1function toggleCollapsed(e,t){e.hasClass("collapsed")?e.animate({maxHeight:e.attr("original-height")},(function(){e.removeClass("collapsed"),e.find(".expander").html(t[0])})):(e.attr("original-height",e.height()),e.animate({maxHeight:e[0].scrollHeight},(function(){e.addClass("collapsed"),e.find(".expander").html(t[1])})))}function getShareLink(e,t,n,o,i){var a,r=encodeURIComponent(t).replace(/%20/g,"+"),l=encodeURIComponent(o).replace(/%20/g,"+"),s=document.head.querySelector('meta[property="fb:app_id"]'),c=document.head.querySelector('meta[property="og:image"]'),u=c?c.content:site;switch(e){case"fb":s&&(a=`https://www.facebook.com/dialog/share?app_id=${s.content}&display=popup&href=${n}&redirect_uri=${n}`);break;case"tw":a=`https://twitter.com/intent/tweet?original_referer=${n}&text=${r}+-+&url=${n}&via=${i}`;break;case"li":a=`https://www.linkedin.com/shareArticle?mini=true&url=${n}`;break;case"gl":a=`https://plus.google.com/share?url=${n}`;break;case"pi":a=`https://pinterest.com/pin/create/button/?url=${n}&media=${encodeURIComponent(u)}&description=${r}%0A${l}`;break;case"ma":a=`mailto:?subject=${t}&body=${o}%0A%0A${n}`;break;case"st":a=`http://www.stumbleupon.com/submit?url=${n}&title=${r}`;break;case"re":a=`http://reddit.com/submit?url=${n}&title=${r}&text=${l}`;break;case"de":a=`http://del.icio.us/post?url=${n}&title=${r}`;break;case"tu":a=`http://www.tumblr.com/share/link?url=${n}&name=${r}&description=${l}`}return a}function loginUser(){$("#login-modal").modal("show")}$.fn.serializeObject=function(){var e={},t=this.serializeArray();return $.each(t,(function(){void 0!==e[this.name]?(e[this.name].push||(e[this.name]=[e[this.name]]),e[this.name].push(this.value||"")):e[this.name]=this.value||""})),e},$(document).ready((function(){if($(".icon-info").click((function(){$("#info-modal").remove(),$("footer").append('<div class="modal" id="info-modal" role="dialog"><div class="modal-dialog modal-sm"><div class="modal-content"><div class="modal-header text-center"><h4>'+$(this).data("title")+'<button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">Ã</span></button></h4></div><div class="modal-body" style="color:#000">'+$(this).data("text")+"</div></div></div></div>"),$("#info-modal").modal("show"),$(".tooltip").remove()})),$('[data-toggle="tooltip"]').tooltip(),$(".head .tags-container > div").height()>50&&$(".head .tags .more-tags").show(),$(".PageDescription__content").length){var e=$(".PageDescription__content .btn");e.data("orig-text",$(".PageDescription__content .btn").text()),$(".PageDescription__mobile-wrapper").on("show.bs.collapse",(function(){e.text($(".PageDescription__content .btn").data("text"))})),$(".PageDescription__mobile-wrapper").on("hide.bs.collapse",(function(){e.text($(".PageDescription__content .btn").data("orig-text"))}))}var t;$(".container-mini_featured").length&&$(".swiper-container").swiper({direction:"horizontal",slidesPerView:4,scrollbar:".swiper-scrollbar",scrollbarHide:!1,scrollbarDraggable:!0,nextButton:".arrow-right",prevButton:".arrow-left"}),$(".container article img:not(.ignore)").on("click",(function(e){if(0==$(this).parent("a").length||function(e){return null!=e.match(/\.(jpeg|jpg|gif|png|webp)$/)}($(this).parent("a").attr("href"))){var t=$(this).attr("preview")||$(this).attr("popup-src")||$(this).attr("src"),n=[],o=0;$(".container article img:not(.ignore)").each((function(e){var i;void 0!==(i=null!=$(this).attr("popup-src")?{src:$(this).attr("popup-src"),w:$(this).parent().find("[itemprop='width']").length>0?$(this).parent().find("[itemprop='width']").first().attr("content"):0,h:$(this).parent().find("[itemprop='height']").length>0?$(this).parent().find("[itemprop='height']").first().attr("content"):0}:{src:$(this).attr("src"),w:$(this).prop("naturalWidth"),h:$(this).prop("naturalHeight")})&&(i.src==t&&(o=n.length),n.push(i))}));var i={index:o,bgOpacity:.7},a=new PhotoSwipe($(".pswp")[0],PhotoSwipeUI_Default,n,i);a.listen("gettingData",(function(e,t){if(t.w<1||t.h<1){var n=new Image;n.onload=function(){t.w=this.width,t.h=this.height,a.invalidateCurrItems(),a.updateSize(!0)},n.src=t.src}})),a.init(),e.preventDefault()}}));var n,o,i="Elektor";$(".main").on("click",".share",(function(e){var i=$(this).position();$(this).closest("article").find("img").attr("src"),t=$(this).attr("url");let a=document.querySelector('meta[property="og:title"]');a&&(n=a.content),n||(n=$(this).closest("article").find("h1").text()),o=(o=$(this).closest("article").find(".text").text())||n,$("#share").css({top:i.top-60,left:i.left}).hide().toggle(),e.stopPropagation()})),$(document).on("click",(function(){$("#share").hide()})),$("#share").on("click",(function(){$("#share").hide()})),$("#share").on("click",".sharebut",(function(){var e=getShareLink($(this).attr("id"),n,t,o,i);window.open(e)})),$(".share-direct").on("click",".sharebut",(function(){var e=$
1(this).parent().parent();t=e.attr("url");var a=document.querySelector('meta[property="og:title"]');a&&(n=a.content),n||(n=e.attr("title")||e.closest("article").find("h3").html()||e.closest("article").find("h1").html()||$("article").find("h1").html()),o=$("article").find(".text").html()||n;var r=getShareLink($(this).attr("id"),n,t,o,i);"em"==$(this).attr("id")?$("#shareEmbed").trigger("focus").trigger("select").val('<iframe width="700" height="600" src="'+r+'" frameborder="0" allowfullscreen=""></iframe>'):window.open(r)})),$("img:not([alt])").attr("alt","elektor")})),$(document).ready((function(){$(".card").each((function(){var e=$(this).find("h3").remove().end().html();$(this).replaceWith('<button class="accordion">'+$(this).find("h3").text()+'</button><div class="panel">'+e+"</div>")}));var e,t=document.getElementsByClassName("accordion");for(e=0;e<t.length;e++)t[e].addEventListener("click",(function(){this.classList.toggle("active");var e=this.nextElementSibling;e.style.display="block"===e.style.display?"none":"block"}))}));var App=function(){var e,t=!1,n=!1,o=!1,i=[],a=function(){for(var e=0;e<i.length;e++){i[e].call()}}
1,r=function(){$("[data-auto-height]").each((function(){var e=$(this),t=$("[data-height]",e),n=0,o=e.attr("data-mode"),i=parseInt(e.attr("data-offset")?e.attr("data-offset"):0);t.each((function(){"height"==$(this).attr("data-height")?$(this).css("height",""):$(this).css("min-height","");var e="base-height"==o?$(this).outerHeight():$(this).outerHeight(!0);e>n&&(n=e)})),n+=i,t.each((function(){"height"==$(this).attr("data-height")?$(this).css("height",n):$(this).css("min-height",n)})),e.attr("data-related")&&$(e.attr("data-related")).css("height",e.height())}))};return{init:function(){var i;r(),this.addResizeHandler(r),t=!!navigator.userAgent.match(/MSIE 9.0/),n=!!navigator.userAgent.match(/MSIE 10.0/),o=navigator.userAgent.indexOf("MSIE ")>-1||navigator.userAgent.indexOf("Trident/")>-1,n&&$("html").addClass("ie10"),t&&$("html").addClass("ie9"),o&&$("html").addClass("ie"),$(window).on("resize",(function(){i&&clearTimeout(i),i=setTimeout((function(){a()}),50)})),$("body").on("click",".c-checkbox > label, .c-radio >
1 label",(function(){var e=$(this),t=$(this).children("span:first-child");t.addClass("inc");var n=t.clone(!0);t.before(n),$("."+t.attr("class")+":last",e).remove()})),$("body").on("click",'[data-close="alert"]',(function(e){$(this).parent(".alert").hide(),$(this).closest(".note").hide(),e.preventDefault()})),$("body").on("click",'[data-close="note"]',(function(e){$(this).closest(".note").hide(),e.preventDefault()})),$("body").on("click",'[data-remove="note"]',(function(e){$(this).closest(".note").remove(),e.preventDefault()})),$("body").on("click",".dropdown-menu.hold-on-click",(function(e){e.stopPropagation()})),$(".tooltips").tooltip(),$(".popovers").popover(),$(document).on("click.bs.popover.data-api",(function(t){e&&e.popover("hide")})),$("body").on("shown.bs.collapse",".accordion.scrollable",(function(e){Jango.scrollTo($(e.target))})),$("body").on("hide.bs.modal",(function(){$(".modal:visible").length>1&&!1===$("html").hasClass("modal-open")?$("html").addClass("modal-open"):$(".modal:visible").length<=1&&$("html").removeClass("modal-open")})),$("body").on("show.bs.modal",".modal",(function(){$(this).hasClass("modal-scroll")&&$("body").addClass("modal-open-noscroll")})),$("body").on("hide.bs.modal",".modal",(function(){$("body").removeClass("modal-open-noscroll")})),$("body").on("hidden.bs.modal",".modal:not(.modal-cached)",(function(){$(this).removeData("bs.modal")})),(t||n)&&$("input[placeholder]:not(.placeholder-no-fix), textarea[placeholder]:not(.placeholder-no-fix)").each((function(){var e=$
1(this);""===e.val()&&""!==e.attr("placeholder")&&e.addClass("placeholder").val(e.attr("placeholder")),e.on("focus",(function(){e.val()==e.attr("placeholder")&&e.val("")})),e.on("blur",(function(){""!==e.val()&&e.val()!=e.attr("placeholder")||e.val(e.attr("placeholder"))}))}))},changeLogo:function(e){var t="../assets/jango/img/layout/logos/"+e+".png";$(".c-brand img.c-desktop-logo").attr("src",t)},setLastPopedPopover:function(t){e=t},addResizeHandler:function(e){i.push(e)},runResizeHandlers:function(){a()},scrollTo:function(e,t){var n=e&&e.length>0?e.offset().top:0;e&&($("body").hasClass("page-header-fixed")&&(n-=$(".page-header").height()),n+=t||-1*e.height()),$("html,body").animate({scrollTop:n},"slow")},scrollTop:function(){Jango.scrollTo()},initFancybox:function(){handleFancybox()},getActualVal:function(e){return(e=$(e)).val()===e.attr("placeholder")?"":e.val()},getURLParameter:function(e){var t,n,o=window.location.search.substring(1).split("&");for(t=0;t<o.length;t++)if((n=o[t].split("="))[0]==e)return unescape(n[1]);return null},isTouchDevice:function(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}},getViewPort:function(){var e=window,t="inner";return"innerWidth"in window||(t="client",e=document.documentElement||document.body),{width:e[t+"Width"],height:e[t+"Height"]}},getUniqueID:function(e){return"prefix_"+Math.floor(Math.random()*(new Date).getTime())},isIE:function(){return o},isIE9:function(){return t},isIE10:function(){return n},getBreakpoint:function(e){var t={xs:480,sm:768,md:992,lg:1200};return t[e]?t[e]:0}}}(),canRunAds=!0;!function(e){function t(t,n){var o=t,i=e.extend(e.fn.tagBox.defaults,n);o.find(".TagContainer__tag:not(:visible)").slice(0,i.startWith).css("display","inline-block"),o.find(".TagContainer__tag:not(:visible)").length>0&&(e('<span class="TagContainer__button TagContainer__button__less"> '+translations.less_tags+"</span>").on("click",(function(){e(o).tagBox("less")})).appendTo(o),e('<span class="TagContainer__button TagContainer__button__more">'+translations.more_tags+"</span>").on("click",(function(){e(o).tagBox("more")})).appendTo(o)),this.more=function(){o.find(".TagContainer__tag:not(:visible)").length>0&&o.find(".TagContainer__tag:not(:visible)").slice(0,i.nextStep).css("display","inline-block"),0==o.find(".TagContainer__tag:not(:visible)").length&&o.find(".TagContainer__button__more").hide(),o.find(".TagContainer__tag:visible").length<=i.startWith?o.find(".TagContainer__button__less").removeClass("HasLess").hide():o.find(".TagContainer__button__less").addClass("HasLess").show()},this.less=function(){o.find(".TagContainer__tag:visible").length>i.startWith&&o.find(".TagContainer__tag:visible").slice(-i.nextStep).hide(),o.find(".TagContainer__tag:visible").length<=i.startWith?(o.find(".TagContainer__button__less").removeClass("HasLess").hide(),o.find(".TagContainer__tag").slice(0,5).show()):o.find(".TagContainer__button__less").addClass("HasLess").show(),o.find(".TagContainer__button__more").show()}}e.fn.tagBox=function(n){if("string"==typeof n){var o,i=Array.prototype.slice.call(arguments,1);return this.each((function(){var t=e.data(this,"tagbox");if(t&&"function"==typeof t[n]){var a=t[n].apply(t,i);void 0===o&&(o=a)}})),void 0!==o?o:this}return this.each((function(){var o=e(this);o.data("tagbox",new t(o,e.extend(n,e(this).data())))}))},e.fn.tagBox.defaults={startWith:3,nextStep:25}}(jQuery),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(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().style,t="",n={};if(n.oldIE=document.all&&!document.addEventListener,n.touch="ontouchstart"in window,window.requestAnimationFrame&&(n.raf=window.requestAnimationFrame,n.caf=window.cancelAnimationFrame),n.pointerEvent=navigator.pointerEnabled||navigator.msPointerEnabled,!n.pointerEvent){var o=navigator.userAgent;if(/iP(hone|od)/.test(navigator.platform)){var a=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);a&&a.length>0&&((a=parseInt(a[1],10))>=1&&8>a&&(n.isOldIOSPhone=!0))}var r=o.match(/Android\s([0-9\.]*)/),l=r?r[1]:0;(l=parseFloat(l))>=1&&(4.4>l&&(n.isOldAndroid=!0),n.androidVersion=l),n.isMobileOpera=/opera mini|o
1pera mobi/i.test(o)}for(var s,c,u=["transform","perspective","animationName"],d=["","webkit","Moz","ms","O"],p=0;4>p;p++){t=d[p];for(var m=0;3>m;m++)s=u[m],c=t+(t?s.charAt(0).toUpperCase()+s.slice(1):s),!n[s]&&c in e&&(n[s]=c);t&&!n.raf&&(t=t.toLowerCase(),n.raf=window[t+"RequestAnimationFrame"],n.raf&&(n.caf=window[t+"CancelAnimationFrame"]||window[t+"CancelRequestAnimationFrame"]))}if(!n.raf){var f=0;n.raf=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-f)),o=window.setTimeout((function(){e(t+n)}),n);return f=t+n,o},n.caf=function(e){clearTimeout(e)}}return n.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,i.features=n,n}};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||t.initialZoomLevel<.7?1:1.33},maxSpreadZoom:1.33,modal:!0,scaleMode:"fit"};i.extend(r,o);var l,s,c,u,d,p,m,f,h,g,v,w,y,x,b,C,_,T,I,$,E,k,D,S,M,A,F,O,R,L,P,Z,z,U,H,N,B,K,W,q,Y,G,V,X,j,J,Q,ee,te,ne,oe,ie,ae,re,le,se={x:0,y:0},ce={x:0,y:0},ue={x:0,y:0},de={},pe=0,me={},fe={x:0,y:0},he=0,ge=!0,ve=[],we={},ye=!1,xe=function(e,t){i.extend(a,t.publicMethods),ve.push(e)},be=function(e){var t=Ut();return e>t-1?e-t:0>e?t+e:e},Ce={},_e=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)}},Ie=function(){return(new Date).getTime()},$e=function(e){ae=e,a.bg.style.opacity=e*r.bgOpacity},Ee=function(e,t,n,o,i){(!ye||i&&i!==a.currItem)&&(o/=i?i.fitRatio:a.currItem.fitRatio),e[k]=w+t+"px, "+n+"px"+y+" scale("+o+")"},ke=function(e){ee&&(e&&(g>a.currItem.fitRatio?ye||(Vt(a.currItem,!1,!0),ye=!0):ye&&(Vt(a.currItem),ye=!1)),Ee(ee,ue.x,ue.y,g))},De=function(e){e.container&&Ee(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},Se=function(e,t){t[k]=w+e+"px, 0px"+y},Me=function(e,t){if(!r.loop&&t){var n=u+(fe.x*pe-e)/fe.x,o=Math.round(e-ct.x);(0>n&&o>0||n>=Ut()-1&&0>o)&&(e=ct.x+o*r.mainScrollEndFriction)}ct.x=e,Se(e,d)},Ae=function(e,t){var n=ut[e]-me[e];return ce[e]+se[e]+n-n*(t/v)},Fe=function(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)},Oe=function(e){e.x=Math.round(e.x),e.y=Math.round(e.y)},Re=null,Le=function(){Re&&(i.unbind(document,"mousemove",Le),i.addClass(e,"pswp--has_mouse"),r.mouseUsed=!0,Te("mouseUsed")),Re=setTimeout((function(){Re=null}),100)},Pe=function(e,t){var n=Wt(a.currItem,de,e);return t&&(Q=n),n},Ze=function(e){return e||(e=a.currItem),e.initialZoomLevel},ze=function(e){return e||(e=a.currItem),e.w>0?r.maxSpreadZoom:1},Ue=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))},He=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]()))},Ne=function(e){e&&(Y||q||te||N)&&(e.preventDefault(),e.stopPropagation())},Be=function(){a.setScrollOffset(0,i.getScrollY())},Ke={},We=0,qe=function(e){Ke[e]&&(Ke[e].raf&&A(Ke[e].raf),We--,delete Ke[e])},Ye=function(e){Ke[e]&&qe(e),Ke[e]||(We++,Ke[e]={})},Ge=function(){for(var e in Ke)Ke.hasOwnProperty(e)&&qe(e)},Ve=function(e,t,n,o,i,a,r){var l,s=Ie();Ye(e);var c=function(){if(Ke[e]){if((l=Ie()-s)>=o)return qe(e),a(n),void(r&&r());a((n-t)*i(l/o)+t),Ke[e].raf=M(c)}};c()},Xe={shout:Te,listen:_e,viewportSize:de,options:r,isMainScrollAnimating:function(){return te},getZoomLevel:function(){return g},getCurrentIndex:function(){return u},isDragging:function(){return K},isZooming:function(){return j},setScrollOffset:function(e,t){me.x=e,L=me.y=t,Te("updateScrollOffset",me)},applyZoomPan:function(e,t,n,o){ue.x=t,ue.y=n,g=e,ke(o)},init:function(){if(!l&&!s){var n;a.framework=i,a.template=e,a.bg=i.getChildByClass(e,"pswp__bg"),F=e.className,l=!0,P=i.detectFeatures(),M=P.raf,A=P.caf,k=P.transform,R=P.oldIE,a.scrollWrap=i.getChildByClass(e,"pswp__scroll-wrap"),a.container=i.getChildByClass(a.scrollWrap,"pswp__container"),d=a.container.style,a.itemHolders=C=[{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}
1],C[0].el.style.display=C[2].el.style.display="none",function(){if(k){var t=P.perspective&&!S;return w="translate"+(t?"3d(":"("),void(y=P.perspective?", 0px)":")")}k="left",i.addClass(e,"pswp--ie"),Se=function(e,t){t.left=e+"px"},De=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"},ke=function(){if(ee){var e=ee,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=ue.x+"px",e.top=ue.y+"px"}}}(),h={resize:a.updateSize,scroll:Be,keydown:He,click:Ne};var o=P.isOldIOSPhone||P.isOldAndroid||P.isMobileOpera;for(P.animationName&&P.transform&&!o||(r.showAnimationDuration=r.hideAnimationDuration=0),n=0;n<ve.length;n++)a["init"+ve[n]]();if(t)(a.ui=new t(a,i)).init();Te("firstUpdate"),u=u||r.index||0,(isNaN(u)||0>u||u>=Ut())&&(u=0),a.currItem=zt(u),(P.isOldIOSPhone||P.isOldAndroid)&&(ge=!1),e.setAttribute("aria-hidden","false"),r.modal&&(ge?e.style.position="fixed":(e.style.position="absolute",e.style.top=i.getScrollY()+"px")),void 0===L&&(Te("initialLayout"),L=O=i.getScrollY());var c="pswp--open ";for(r.mainClass&&(c+=r.mainClass+" "),r.showHideOpacity&&(c+="pswp--animate_opacity "),c+=S?"pswp--touch":"pswp--notouch",c+=P.animationName?" pswp--css_animation":"",c+=P.svg?" pswp--svg":"",i.addClass(e,c),a.updateSize(),p=-1,he=null,n=0;3>n;n++)Se((n+p)*fe.x,C[n].el.style);R||i.bind(a.scrollWrap,f,a),_e("initialZoomInEnd",(function(){a.setContent(C[0],u-1),a.setContent(C[2],u+1),C[0].el.style.display=C[2].el.style.display="block",r.focus&&e.focus(),i.bind(document,"keydown",a),P.transform&&i.bind(a.scrollWrap,"click",a),r.mouseUsed||i.bind(document,"mousemove",Le),i.bind(window,"resize scroll",a),Te("bindEvents")})),a.setContent(C[1],u),a.updateCurrItem(),Te("afterInit"),ge||(x=setInterval((function(){We||K||j||g!==a.currItem.initialZoomLevel||a.updateSize()}),1e3)),i.addClass(e,"pswp--visible")}},close:function(){l&&(l=!1,s=!0,Te("close"),i.unbind(window,"resize",a),i.unbind(window,"scroll",h.scroll),i.unbind(document,"keydown",a),i.unbind(document,"mousemove",Le),P.transform&&i.unbind(a.scrollWrap,"click",a),K&&i.unbind(window,m,a),Te("unbindEvents"),Ht(a.currItem,null,!0,a.destroy))},destroy:function(){Te("destroy"),Rt&&clearTimeout(Rt),e.setAttribute("aria-hidden","true"),e.className=F,x&&clearInterval(x),i.unbind(a.scrollWrap,f,a),i.unbind(window,"scroll",a),mt(),Ge(),Ce=null},panTo:function(e,t,n){n||(e>Q.min.x?e=Q.min.x:e<Q.max.x&&(e=Q.max.x),t>Q.min.y?t=Q.min.y:t<Q.max.y&&(t=Q.max.y)),ue.x=e,ue.y=t,ke()},handleEvent:function(e){e=e||window.event,h[e.type]&&h[e.type](e)},goTo:function(e){var t=(e=be(e))-u;he=t,u=e,a.currItem=zt(u),pe-=t,Me(fe.x*pe),Ge(),te=!1,a.updateCurrItem()},next:function(){a.goTo(u+1)},prev:function(){a.goTo(u-1)},updateCurrZoomItem:function(e){if(e&&Te("beforeChange",0),C[1].el.children.length){var t=C[1].el.children[0];ee=i.hasClass(t,"pswp__zoom-wrap")?t.style:null}else ee=null;Q=a.currItem.bounds,v=g=a.currItem.initialZoomLevel,ue.x=Q.center.x,ue.y=Q.center.y,e&&Te("afterChange")},invalidateCurrItems:function(){b=!0;for(var e=0;3>e;e++)C[e].item&&(C[e].item.needsUpdate=!0)},updateCurrItem:function(e){if(0!==he){var t,n=Math.abs(he);if(!(e&&2>n)){a.currItem=zt(u),ye=!1,Te("beforeChange",he),n>=3&&(p+=he+(he>0?-3:3),n=3);for(var o=0;n>o;o++)he>0?(t=C.shift(),C[2]=t,p++,Se((p+2)*fe.x,t.el.style),a.setContent(t,u-n+o+1+1)):(t=C.pop(),C.unshift(t),p--,Se(p*fe.x,t.el.style),a.setContent(t,u+n-o-1-1));if(ee&&1===Math.abs(he)){var i=zt(_);i.initialZoomLevel!==g&&(Wt(i,de),Vt(i),De(i))}he=0,a.updateCurrZoomItem(),_=u,Te("afterChange")}}},updateSize:function(t){if(!ge&&r.modal){var n=i.getScrollY();if(L!==n&&(e.style.top=n+"px",L=n),!t&&we.x===window.innerWidth&&we.y===window.innerHeight)return;we.x=window.innerWidth,we.y=window.innerHeight,e.style.height=we.y+"px"}if(de.x=a.scrollWrap.clientWidth,de.y=a.scrollWrap.clientHeight,Be(),fe.x=de.x+Math.round(de.x*r.spacing),fe.y=de.y,Me(fe.x*pe),Te("beforeResize"),void 0!==p){for(var o,l,s,c=0;3>c;
1c++)o=C[c],Se((c+p)*fe.x,o.el.style),s=u+c-1,r.loop&&Ut()>2&&(s=be(s)),(l=zt(s))&&(b||l.needsUpdate||!l.bounds)?(a.cleanSlide(l),a.setContent(o,s),1===c&&(a.currItem=l,a.updateCurrZoomItem(!0)),l.needsUpdate=!1):-1===o.index&&s>=0&&a.setContent(o,s),l&&l.container&&(Wt(l,de),Vt(l),De(l));b=!1}v=g=a.currItem.initialZoomLevel,(Q=a.currItem.bounds)&&(ue.x=Q.center.x,ue.y=Q.center.y,ke(!0)),Te("resize")},zoomTo:function(e,t,n,o,a){t&&(v=g,ut.x=Math.abs(t.x)-ue.x,ut.y=Math.abs(t.y)-ue.y,Fe(ce,ue));var r=Pe(e,!1),l={};Ue("x",r,l,e),Ue("y",r,l,e);var s=g,c=ue.x,u=ue.y;Oe(l);var d=function(t){1===t?(g=e,ue.x=l.x,ue.y=l.y):(g=(e-s)*t+s,ue.x=(l.x-c)*t+c,ue.y=(l.y-u)*t+u),a&&a(t),ke(1===t)};n?Ve("customZoomTo",0,1,n,o||i.easing.sine.inOut,d):d(1)}},je={},Je={},Qe={},et={},tt={},nt=[],ot={},it=[],at={},rt=0,lt={x:0,y:0},st=0,ct={x:0,y:0},ut={x:0,y:0},dt={x:0,y:0},pt=function(e,t){return at.x=Math.abs(e.x-t.x),at.y=Math.abs(e.y-t.y),Math.sqrt(at.x*at.x+at.y*at.y)},mt=function(){G&&(A(G),G=null)},ft=function(){K&&(G=M(ft),kt())},ht=function(e,t){return!(!e||e===document)&&(!(e.getAttribute("class")&&e.getAttribute("class").indexOf("pswp__scroll-wrap")>-1)&&(t(e)?e:ht(e.parentNode,t)))},gt={},vt=function(e,t){return gt.prevent=!ht(e.target,r.isClickableElement),Te("preventDragEvent",e,t,gt),gt.prevent},wt=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)},xt=function(){var e=ue.y-a.currItem.initialPosition.y;return 1-Math.abs(e/(de.y/2))},bt={},Ct={},_t=[],Tt=function(e){for(;_t.length>0;)_t.pop();return D?(le=0,nt.forEach((function(e){0===le?_t[0]=e:1===le&&(_t[1]=e),le++}))):e.type.indexOf("touch")>-1?e.touches&&e.touches.length>0&&(_t[0]=wt(e.touches[0],bt),e.touches.length>1&&(_t[1]=wt(e.touches[1],Ct))):(bt.x=e.pageX,bt.y=e.pageY,bt.id="",_t[0]=bt),_t},It=function(e,t){var n,o,i,l,s=ue[e]+t[e],c=t[e]>0,u=ct.x+t.x,d=ct.x-ot.x;return n=s>Q.min[e]||s<Q.max[e]?r.panEndFriction:1,s=ue[e]+t[e]*n,!r.allowPanToNext&&g!==a.currItem.initialZoomLevel||(ee?"h"!==ne||"x"!==e||q||(c?(s>Q.min[e]&&(n=r.panEndFriction,Q.min[e]-s,o=Q.min[e]-ce[e]),(0>=o||0>d)&&Ut()>1?(l=u,0>d&&u>ot.x&&(l=ot.x)):Q.min.x!==Q.max.x&&(i=s)):(s<Q.max[e]&&(n=r.panEndFriction,s-Q.max[e],o=ce[e]-Q.max[e]),(0>=o||d>0)&&Ut()>1?(l=u,d>0&&u<ot.x&&(l=ot.x)):Q.min.x!==Q.max.x&&(i=s))):l=u,"x"!==e)?void(te||V||g>a.currItem.fitRatio&&(ue[e]+=t[e]*n)):(void 0!==l&&(Me(l,!0),V=l!==ot.x),Q.min.x!==Q.max.x&&(void 0!==i?ue.x=i:V||(ue.x+=t.x*n)),void 0!==l)},$t=function(e){if(!("mousedown"===e.type&&e.button>0)){if(Zt)return void e.preventDefault();if(!B||"mousedown"!==e.type){if(vt(e,!0)&&e.preventDefault(),Te("pointerDown"),D){var t=i.arraySearch(nt,e.pointerId,"id");0>t&&(t=nt.length),nt[t]={x:e.pageX,y:e.pageY,id:e.pointerId}}var n=Tt(e),o=n.length;X=null,Ge(),K&&1!==o||(K=oe=!0,i.bind(window,m,a),H=re=ie=N=V=Y=W=q=!1,ne=null,Te("firstTouchStart",n),Fe(ce,ue),se.x=se.y=0,Fe(et,n[0]),Fe(tt,et),ot.x=fe.x*pe,it=[{x:et.x,y:et.y}],z=Z=Ie(),Pe(g,!0),mt(),ft()),!j&&o>1&&!te&&!V&&(v=g,q=!1,j=W=!0,se.y=se.x=0,Fe(ce,ue),Fe(je,n[0]),Fe(Je,n[1]),yt(je,Je,dt),ut.x=Math.abs(dt.x)-ue.x,ut.y=Math.abs(dt.y)-ue.y,J=pt(je,Je))}}},Et=function(e){if(e.preventDefault(),D){var t=i.arraySearch(nt,e.pointerId,"id");if(t>-1){var n=nt[t];n.x=e.pageX,n.y=e.pageY}}if(K){var o=Tt(e);if(ne||Y||j)X=o;else if(ct.x!==fe.x*pe)ne="h";else{var a=Math.abs(o[0].x-et.x)-Math.abs(o[0].y-et.y);Math.abs(a)>=10&&(ne=a>0?"h":"v",X=o)}}},kt=function(){if(X){var e=X.length;if(0!==e)if(Fe(je,X[0]),Qe.x=je.x-et.x,Qe.y=je.y-et.y,j&&e>1){if(et.x=je.x,et.y=je.y,!Qe.x&&!Qe.y&&function(e,t){return e.x===t.x&&e.y===t.y}(X[1],Je))return;Fe(Je,X[1]),q||(q=!0,Te("zoomGestureStarted"));var t=pt(je,Je),n=Ft(t);n>a.currItem.initialZoomLevel+a.currItem.initialZoomLevel/15&&(re=!0);var o=1,i=Ze(),l=ze();if(i>n)if(r.pinchToClose&&!re&&v<=a.currItem.initialZoomLevel){var s=1-(i-n)/(i/1.2);$e(s),Te("onPinchClose",s),ie=!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);0>o&&(o=0),yt(je,Je,lt),se.x+=lt.x-dt.x,se.y+=lt.y-dt.y,Fe(dt,lt),ue.x=Ae("x",n),ue.y=Ae("y",n),H=n>g,g=n,ke()}else{if(!ne)return;if(oe&&(oe=!1,Math.abs(Qe.x)>=10&&(Qe.x-=X[0].x-tt.x),Math.abs(Qe.y)>=10&&(Qe.y-=X[0].y-tt.y)),et.x=je.x,et.y=je.y,0===Qe.x&&0===Qe.y)return;if("v"===ne&&r.closeOnVerticalDrag&&"fit"===r.scaleMode&&g===a.currItem.initialZoomLevel){se.y+=Qe.y,ue.y+=Qe.y;var c=xt();return N=!0,Te("onVerticalDrag",c),$e(c),void ke()}(function(e,t,n){if(e-z>50){var o=it.length>2?it.shift():{};o.x=t,o.y=n,it.push(o),z=e}})(Ie(),je.x,je.y),Y=!0,Q=a.currItem.bounds,It("x",Qe)||(It("y",Qe),Oe(ue),ke())}}},Dt=function(e){if(P.isOldAndroid){if(B&&"mouseup"===e.type)return;e.type.indexOf("touch")>-1&&(clearTimeout(B),B=setTimeout((function(){B=0}),600))}var t;if(Te("pointerUp"),vt(e,!1)&&e.preventDefault(),D){var n=i.arraySearch(nt,e.pointerId,"id");if(n>-1)if(t=nt.splice(n,1)[0],navigator.pointerEnabled)t.type=e.pointerType||"mouse";else{t.type={4:"mouse",2:"touch",3:"pen"}[e.pointerType],t.type||(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&&Fe(tt,l[0]),0!==s||ne||te||(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 c=-1;if(0===s&&(K=!1,i.unbind(window,m,a),mt(),j?c=0:-1!==st&&(c=Ie()-st)),st=1===s?Ie():-1,o=-1!==c&&150>c?"zoom":"swipe",j&&2>s&&(j=!1,1===s&&(o="zoomPointerUp"),Te("zoomGestureEnded")),X=null,Y||q||te||N)if(Ge(
1),U||(U=St()),U.calculateSwipeSpeed("x"),N){if(xt()<r.verticalDragRange)a.close();else{var u=ue.y,d=ae;Ve("verticalDrag",0,1,300,i.easing.cubic.out,(function(e){ue.y=(a.currItem.initialPosition.y-u)*e+u,$e((1-d)*e+d),ke()})),Te("onVerticalDrag",1)}}else{if((V||te)&&0===s){if(At(o,U))return;o="zoomPointerUp"}if(!te)return"swipe"!==o?void Ot():void(!V&&g>a.currItem.fitRatio&&Mt(U))}},St=function(){var e,t,n={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(o){it.length>1?(e=Ie()-z+50,t=it[it.length-2][o]):(e=Ie()-Z,t=tt[o]),n.lastFlickOffset[o]=et[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]||(ue[e]>Q.min[e]?n.backAnimDestination[e]=Q.min[e]:ue[e]<Q.max[e]&&(n.backAnimDestination[e]=Q.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,ue[e],n.backAnimDestination[e],t||300,i.easing.sine.out,(function(t){ue[e]=t,ke()})))))},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,ue[e]+=n.distanceOffset[e])},panAnimLoop:function(){return Ke.zoomPan&&(Ke.zoomPan.raf=M(n.panAnimLoop),n.now=Ie(),n.timeDiff=n.now-n.lastNow,n.lastNow=n.now,n.calculateAnimOffset("x"),n.calculateAnimOffset("y"),ke(),n.calculateOverBoundsAnimOffset("x"),n.calculateOverBoundsAnimOffset("y"),n.speedDecelerationRatioAbs.x<.05&&n.speedDecelerationRatioAbs.y<.05)?(ue.x=Math.round(ue.x),ue.y=Math.round(ue.y),ke(),void qe("zoomPan")):void 0}};return n},Mt=function(e){return e.calculateSwipeSpeed("y"),Q=a.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):(Ye("zoomPan"),e.lastNow=Ie(),void e.panAnimLoop())},At=function(e,t){var n,o,l;if(te||(rt=u),"swipe"===e){var s=et.x-tt.x,c=t.lastFlickDist.x<10;s>30&&(c||t.lastFlickOffset.x>20)?o=-1:-30>s&&(c||t.lastFlickOffset.x<-20)&&(o=1)}o&&(0>(u+=o)?(u=r.loop?Ut()-1:0,l=!0):u>=Ut()&&(u=r.loop?0:Ut()-1,l=!0),(!l||r.loop)&&(he+=o,pe-=o,n=!0));var d,p=fe.x*pe,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,rt===u&&(n=!1),te=!0,Te("mainScrollAnimStart"),Ve("mainScroll",ct.x,p,d,i.easing.cubic.out,Me,(function(){Ge(),te=!1,rt=-1,(n||rt!==u)&&a.updateCurrItem(),Te("mainScrollAnimComplete")})),n&&a.updateCurrItem(!0),n},Ft=function(e){return 1/J*e*v},Ot=function(){var e=g,t=Ze(),n=ze();t>g?e=t:g>n&&(e=n);var o,r=ae;return ie&&!H&&!re&&t>g?(a.close(),!0):(ie&&(o=function(e){$e((1-r)*e+r)}),a.zoomTo(e,0,200,i.easing.cubic.out,o),!0)};xe("Gestures",{publicMethods:{initGestures:function(){var e=function(e,t,n,o,i){T=e+t,I=e+n,$=e+o,E=i?e+i:""};(D=P.pointerEvent)&&P.touch&&(P.touch=!1),D?navigator.pointerEnabled?e("pointer","down","move","up","cancel"):e("MSPointer","Down","Move","Up","Cancel"):P.touch?(e("touch","start","move","end","cancel"),S=!0):e("mouse","down","move","up"),m=I+" "+$+" "+E,f=T,D&&!S&&(S=navigator.maxTouchPoints>1||navigator.msMaxTouchPoints>1),a.likelyTouchDevice=S,h[T]=$t,h[I]=Et,h[$]=Dt,E&&(h[E]=h[$]),P.touch&&(f+=" mousedown",m+=" mousemove mouseup",h.mousedown=h[T],h.mousemove=h[I],h.mouseup=h[$]),S||(r.allowPanToNext=!1)}}});var Rt,Lt,Pt,Zt,zt,Ut,Ht=function(t,n,o,l){var s;Rt&&clearTimeout(Rt),Zt=!0,Pt=!0,t.initialLayout?(s=t.initialLayout,t.initialLayout=null):s=r.getThumbBoundsFn&&r.getThumbBoundsFn(u);var d=o?r.hideAnimationDuration:r.showAnimationDuration,p=function(){qe("initialZoom"),o?(a.template.removeAttribute("style"),a.bg.removeAttribute("style")):($e(1),n&&(n.style.display="block"),i.addClass(e,"pswp--animated-in"),Te("initialZoom"+(o?"OutEnd":"InEnd"))),l&&l(),Zt=!1};if(!d||!s||void 0===s.x)return Te("initialZoom"+(o?"Out":"In")),g=t.initialZoomLevel,Fe(ue,t.initialPosition),ke(),e.style.opacity=o?0:1,$e(1),void(d?setTimeout((function(){p()}),d):p());!function(){var n=c,l=!a.currItem.src||a.currItem.loadError||r.showHideOpacity;t.miniImg&&(t.miniImg.style.webkitBackfaceVisibility="hidden"),o||(g=s.w/t.w,ue.x=s.x,ue.y=s.y-O,a[l?"template":"bg"].style.opacity=.001,ke()),Ye("initialZoom"),o&&!n&&i.removeClass(e,"pswp--animated-in"),l&&(o?i[(n?"remove":"add")+"Class"](e,"pswp--animate_opacity"):setTimeout((function(){i.addClass(e,"pswp--animate_opacity")}),30)),Rt=setTimeout((function(){if(Te("initialZoom"+(o?"Out":"In")),o){var a=s.w/t.w,r={x:ue.x,y:ue.y},c=g,u=ae,m=function(t){1===t?(g=a,ue.x=s.x,ue.y=s.y-L):(g=(a-c)*t+c,ue.x=(s.x-r.x)*t+r.x,ue.y=(s.y-L-r.y)*t+r.y),ke(),l?e.style.opacity=1-t:$e(u-t*u)};n?Ve("initialZoom",0,1,d,i.easing.cubic.out,m,p):(m(1),Rt=setTimeout(p,d+20))}else g=t.initialZoomLevel,Fe(ue,t.initialPosition),ke(),$e(1),l?e.style.opacity=1:$e(1),Rt=setTimeout(p,d+20)}),o?25:90)}()},Nt={},Bt=[],Kt={index:0,errorMsg:'<div class="pswp__error-msg"><a href="%url%" target="_blank" rel="noopener">The image</a> could not be loaded.</div>',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return Lt.length}},Wt=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)),Nt.x=t.x,Nt.y=t.y-e.vGap.top-e.vGap.bottom,o){var i=Nt.x/e.w,a=Nt.y/e.h;e.fitRatio=a>i?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((Nt.x-t)/2),o.center.y=Math.round((Nt.y-n)/2)+e.vGap.top,o.max.x=t>Nt.x?Math.round(Nt.x-t):o.center.x,o.max.y=n>Nt.y?Math.round(Nt.y-n)+e.vGap.top:o.center.y,o.min.x=t>Nt.x?0:o.center.x,o.min.y=n>Nt.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}}
1,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))},Yt=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},Gt=function(e,t){return e.src&&e.loadError&&e.container?(t&&(e.container.innerHTML=""),e.container.innerHTML=r.errorMsg.replace("%url%",e.src),!0):void 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(Bt.length){for(var e,t=0;t<Bt.length;t++)(e=Bt[t]).holder.index===e.index&&qt(e.index,e.item,e.baseDiv,e.img,0,e.clearPlaceholder);Bt=[]}};xe("Controller",{publicMethods:{lazyLoadItem:function(e){e=be(e);var t=zt(e);t&&(!t.loaded&&!t.loading||b)&&(Te("gettingData",e,t),t.src&&Yt(t))},initController:function(){i.extend(r,Kt,!0),a.items=Lt=n,zt=a.getItemAt,Ut=r.getNumItemsFn,r.loop,Ut()<3&&(r.loop=!1),_e("beforeChange",(function(e){var t,n=r.preload,o=null===e||e>=0,i=Math.min(n[0],Ut()),l=Math.min(n[1],Ut());for(t=1;(o?l:i)>=t;t++)a.lazyLoadItem(u+t);for(t=1;(o?i:l)>=t;t++)a.lazyLoadItem(u-t)})),_e("initialLayout",(function(){a.currItem.initialLayout=r.getThumbBoundsFn&&r.getThumbBoundsFn(u)})),_e("mainScrollAnimComplete",Xt),_e("initialZoomInEnd",Xt),_e("destroy",(function(){for(var e,t=0;t<Lt.length;t++)(e=Lt[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);Bt=null}))},getItemAt:function(e){return e>=0&&void 0!==Lt[e]&&Lt[e]},allowProgressiveImg:function(){return r.forceProgressiveLoading||!S||r.mouseUsed||screen.width>1200},setContent:function(e,t){r.loop&&(t=be(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 c=s.container=i.createEl("pswp__zoom-wrap");if(!s.src&&s.html&&(s.html.tagName?c.appendChild(s.html):c.innerHTML=s.html),Gt(s),Wt(s,de),!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(0,s,c,o));else{if(s.loadComplete=function(n){if(l){if(e&&e.index===t){if(Gt(n,!0))return n.loadComplete=n.img=null,Wt(n,de),De(n),void(e.index===u&&a.updateCurrZoomItem());n.imageAppended?!Zt&&n.placeholder&&(n.placeholder.style.display="none",n.placeholder=null):P.transform&&(te||Zt)?Bt.push({item:n,baseDiv:c,img:n.img,index:t,holder:e,clearPlaceholder:!0}):qt(0,n,c,n.img,0,!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),c.appendChild(p),s.placeholder=p}s.loading||Yt(s),a.allowProgressiveImg()&&(!Pt&&P.transform?Bt.push({item:s,baseDiv:c,img:s.img,index:t,holder:e}):qt(0,s,c,s.img,0,!0))}Pt||t!==u?De(s):(ee=c.style,Ht(s,o||s.img)),e.el.innerHTML="",e.el.appendChild(c)}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,Jt,Qt={},en=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)};xe("Tap",{publicMethods:{initTap:function(){_e("firstTouchStart",a.onTapStart),_e("touchRelease",a.onTapRelease),_e("destroy",(function(){Qt={},jt=null}))},onTapStart:function(e){e.length>1&&(clearTimeout(jt),jt=null)},onTapRelease:function(e,t){if(t&&!Y&&!W&&!We){var n=t;if(jt&&(clearTimeout(jt),jt=null,function(e,t){return Math.abs(e.x-t.x)<25&&Math.abs(e.y-t.y)<25}(n,Qt)))return void Te("doubleTap",n);if("mouse"===t.type)return void en(e,t,"mouse");if("BUTTON"===e.target.tagName.toUpperCase()||i.hasClass(e.target,"pswp__single-tap"))return void en(e,t);Fe(Qt,n),jt=setTimeout((function(){en(e,t),jt=null}),300)}}}}),xe("DesktopZoom",{publicMethods:{initDesktopZoom:function(){R||(S?_e("mouseUsed",(function(){a.setupDesktopZoom()})):a.setupDesktopZoom(!0))},setupDesktopZoom:function(t){Jt={};var n="wheel mousewheel DOMMouseScroll";_e("bindEvents",(function(){i.bind(e,n,a.handleMouseWheel)})),_e("unbindEvents",(function(){Jt&&i.unbind(e,n,a.handleMouseWheel)})),a.mouseZoomedIn=!1;var o,r=function(){a.mouseZoomedIn&&(i.removeClass(e,"pswp--zoomed-in"),a.mouseZoomedIn=!1),1>g?i.addClass(e,"pswp--zoom-allowed"):i.removeClass(e,"pswp--zoom-allowed"),l()},l=function(){o&&(i.removeClass(e,"pswp--dragging"),o=!1)};_e("resize",r),_e("afterChange",r),_e("pointerDown",(function(){a.mouseZoomedIn&&(o=!0,i.addClass(e,"pswp--dragging"))})),_e("pointerUp",l),t||r()},handleMouseWheel:function(e){if(g<=a.currItem.fitRatio)return r.modal&&(!r.closeOnScroll||We||K?e.preventDefault():k&&Math.abs(e.deltaY)>2&&(c=!0,a.close())),!0;if(e.stopPropagation(),Jt.x=0,"deltaX"in e)1===e.deltaMode?(Jt.x=18*e.deltaX,Jt.y=18*e.deltaY):(Jt.x=e.deltaX,Jt.y=e.deltaY);else if("wheelDelta"in e)e.wheelDeltaX&&(Jt.x=-.16*e.wheelDeltaX),e.wheelDeltaY?Jt.y=-.16*e.wheelDeltaY:Jt.y=-.16*e.wheelDelta;else{if(!("detail"in e))return;Jt.y=e.detail}Pe(g,!0);var t=ue.x-Jt.x,n=ue.y-Jt.y;(r.modal||t<=Q.min.x&&t>=Q.max.x&&n<=Q.min.y&&n>=Q.max.y)&&e.preventDefault(),a.panTo(t,n)},toggleDesktopZoom:function(t){t=t||{x:de.x/2+me.x,y:de.y/2+me.y};var n=r.getDoubleTapZoom(!0,a.currItem),o=g===n;a.mouseZoomedIn=!o,a.zoomTo(o?a.currItem.initialZoomLevel:n,t,333),i[(o?"remove":"add")+"Class"](e,"pswp--zoomed-in")}}});var tn,nn,on,an,rn,ln,sn,cn,un,dn,pn,mn,fn={history:!0,galleryUID:1},hn=function(){return pn.hash.substring(1)},gn=function(){tn&&clearTimeout(tn),on&&clearTimeout(on)},vn=function(){var e=hn(),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<Lt.length;n++)if(Lt[n].pid===a){t.pid=n;break}}else t.pid=parseInt(t.pid,10)-1;return t.pid<0&&(t.pid=0),t},wn=function(){if(on&&clearTimeout(on),We||K)on=setTimeout(wn,500);else{an?clearTimeout(nn):an=!0;var e=u+1,t=zt(u);t.hasOwnProperty("pid")&&(e=t.pid);var n=sn+"&gid="+r.galleryUID+"&pid="+e;cn||-1===pn.hash.indexOf(n)&&(dn=!0);var o=pn.href.split("#")[0]+"#"+n;mn?"#"+n!==window.location.hash&&history[cn?"replaceState":"pushState"]("",document.title,o):cn?pn.replace(o):pn.hash=n,cn=!0,nn=setTimeout((function(){an=!1}),60)}};xe("History",{publicMethods:{initHistory:function(){if(i.extend(r,fn,!0),r.history){pn=window.location,dn=!1,un=!1,cn=!1,sn=hn(),mn="pushState"in history,sn.indexOf("gid=")>-1&&(sn=(sn=sn.split("&gid=")[0]).split("?gid=")[0]),_e("afterChange",a.updateURL),_e("unbindEvents",(function(){i.unbind(window,"hashchange",a.onHashChange)}));var e=function(){ln=!0,un||(dn?history.back():sn?pn.hash=sn:mn?history.pushState("",document.title,pn.pathname+pn.search):pn.hash=""),gn()};_e("unbindEvents",(function(){c&&e()})),_e("destroy",(function(){ln||e()})),_e("firstUpdate",(function(){u=vn().pid}));var t=sn.indexOf("pid=");t>-1&&("&"===(sn=sn.substring(0,t)).slice(-1)&&(sn=sn.slice(0,-1))),setTimeout((function(){l&&i.bind(window,"hashchange",a.onHashChange)}),40)}},onHashChange:function(){return hn()===sn?(un=!0,void a.close()):void(an||(rn=!0,a.goTo(vn().pid),rn=!1))},updateURL:function(){gn(),rn||(cn?tn=setTimeout(wn,800):wn())}}}),i.extend(a,Xe)}})),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(e,t){var n,o,i,a,r,l,s,c,u,d,p,m,f,h,g,v,w,y,x=this,b=!1,C=!0,_=!0,T={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
1:!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},I=function(e){if(v)return!0;e=e||window.event,g.timeToIdle&&g.mouseUsed&&!u&&R();for(var n,o,i=(e.target||e.srcElement).getAttribute("class")||"",a=0;a<z.length;a++)(n=z[a]).onTap&&i.indexOf("pswp__"+n.name)>-1&&(n.onTap(),o=!0);if(o){e.stopPropagation&&e.stopPropagation(),v=!0;var r=t.features.isOldAndroid?600:30;setTimeout((function(){v=!1}),r)}},$=function(){return!e.likelyTouchDevice||g.mouseUsed||screen.width>g.fitControlsWidth},E=function(e,n,o){t[(o?"add":"remove")+"Class"](e,"pswp__"+n)},k=function(){var e=1===g.getNumItemsFn();e!==h&&(E(o,"ui--one-slide",e),h=e)},D=function(){E(s,"share-modal--hidden",_)},S=function(){return(_=!_)?(t.removeClass(s,"pswp__share-modal--fade-in"),setTimeout((function(){_&&D()}),300)):(D(),setTimeout((function(){_||t.addClass(s,"pswp__share-modal--fade-in")}),30)),_||A(),!1},M=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)),_||S(),!1))},A=function(){for(var e,t,n,o,i="",a=0;a<g.shareButtons.length;a++)e=g.shareButtons[a],t=g.getImageURLForShare(e),n=g.getPageURLForShare(e),o=g.getTextForShare(e),i+='<a href="'+e.url.replace("{{url}}",encodeURIComponent(n)).replace("{{image_url}}",encodeURIComponent(t)).replace("{{raw_image_url}}",t).replace("{{text}}",encodeURIComponent(o))+'" target="_blank" class="pswp__share--'+e.id+'"'+(e.download?"download":"")+">"+e.label+"</a>",g.parseShareButtonOut&&(i=g.parseShareButtonOut(e,i));s.children[0].innerHTML=i,s.children[0].onclick=M},F=function(e){for(var n=0;n<g.closeElClasses.length;n++)if(t.hasClass(e,"pswp__"+g.closeElClasses[n]))return!0},O=0,R=function(){clearTimeout(y),O=0,u&&x.setIdle(!1)},L=function(e){var t=(e=e||window.event).relatedTarget||e.toElement;t&&"HTML"!==t.nodeName||(clearTimeout(y),y=setTimeout((function(){x.setIdle(!0)}),g.timeToIdleOutside))},P=function(e){m!==e&&(E(p,"preloader--active",!e),m=e)},Z=function(e){var n=e.vGap;if($()){var r=g.barsSize;if(g.captionEl&&"auto"===r.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")),g.addCaptionHTMLFn(e,a,!0)){var l=a.clientHeight;n.bottom=parseInt(l,10)||44}else n.bottom=r.top;else n.bottom="auto"===r.bottom?0:r.bottom;n.top=r.top}else n.top=n.bottom=0},z=[{name:"caption",option:"captionEl",onInit:function(e){i=e}},{name:"share-modal",option:"shareEl",onInit:function(e){s=e},onTap:function(){S()}},{name:"button--share",option:"shareEl",onInit:function(e){l=e},onTap:function(){S()}},{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}}];x.init=function(){t.extend(e.options,T,!0),g=e.options,o=t.getChildByClass(e.scrollWrap,"pswp__ui"),d=e.listen,function(){var e;d("onVerticalDrag",(function(e){C&&.95>e?x.hideControls():!C&&e>=.95&&x.showControls()})),d("onPinchClose",(function(t){C&&.9>t?(x.hideControls(),e=!0):e&&!C&&t>.9&&x.showControls()})),d("zoomGestureEnded",(function(){(e=!1)&&!C&&x.showControls()}))}(),d("beforeChange",x.update),d("doubleTap",(function(t){var n=e.currItem.initialZoomLevel;e.getZoomLevel()!==n?e.zoomTo(n,t,333):e.zoomTo(g.getDoubleTapZoom(!1,e.currItem),t,333)})),d("preventDragEvent",(function(e,t,n){var o=e.target||e.srcElement;
1o&&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",I),t.bind(e.scrollWrap,"pswpTap",x.onGlobalTap),e.likelyTouchDevice||t.bind(e.scrollWrap,"mouseover",x.onMouseOver)})),d("unbindEvents",(function(){_||S(),w&&clearInterval(w),t.unbind(document,"mouseout",L),t.unbind(document,"mousemove",R),t.unbind(o,"pswpTap click",I),t.unbind(e.scrollWrap,"pswpTap",x.onGlobalTap),t.unbind(e.scrollWrap,"mouseover",x.onMouseOver),n&&(t.unbind(document,n.eventK,x.updateFullscreen),n.isFullscreen()&&(g.hideAnimationDuration=0,n.exit()),n=null)})),d("destroy",(function(){g.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"),x.setIdle(!1)})),g.showAnimationDuration||t.removeClass(o,"pswp__ui--hidden"),d("initialZoomIn",(function(){g.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;a>r;r++){e=o[r],n=e.className;for(var l=0;l<z.length;l++)i=z[l],n.indexOf("pswp__"+i.name)>-1&&(g[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)}(),g.shareEl&&l&&s&&(_=!0),k(),g.timeToIdle&&d("mouseUsed",(function(){t.bind(document,"mousemove",R),t.bind(document,"mouseout",L),w=setInterval((function(){2==++O&&x.setIdle(!0)}),g.timeToIdle/2)})),g.fullscreenEl&&!t.features.isOldAndroid&&(n||(n=x.getFullscreenAPI()),n?(t.bind(document,n.eventK,x.updateFullscreen),x.updateFullscreen(),t.addClass(e.template,"pswp--supports-fs")):t.removeClass(e.template,"pswp--supports-fs")),g.preloaderEl&&(P(!0),d("beforeChange",(function(){clearTimeout(f),f=setTimeout((function(){e.currItem&&e.currItem.loading?(!e.allowProgressiveImg()||e.currItem.img&&!e.currItem.img.naturalWidth)&&P(!1):P(!0)}),g.loadingIndicatorDelay)})),d("imageLoadComplete",(function(t,n){e.currItem===n&&P(!0)})))},x.setIdle=function(e){u=e,E(o,"ui--idle",e)},x.update=function(){C&&e.currItem?(x.updateIndexIndicator(),g.captionEl&&(g.addCaptionHTMLFn(e.currItem,i),E(i,"caption--empty",!e.currItem.title)),b=!0):b=!1,_||S(),k()},x.updateFullscreen=function(o){o&&setTimeout((function(){e.setScrollOffset(0,t.getScrollY())}),50),t[(n.isFullscreen()?"add":"remove")+"Class"](e.template,"pswp--fs")},x.updateIndexIndicator=function(){g.counterEl&&(r.innerHTML=e.getCurrentIndex()+1+g.indexIndicatorSep+g.getNumItemsFn())},x.onGlobalTap=function(n){var o=(n=n||window.event).target||n.srcElement;if(!v)if(n.detail&&"mouse"===n.detail.pointerType){if(F(o))return void e.close();t.hasClass(o,"pswp__img")&&(1===e.getZoomLevel()&&e.getZoomLevel()<=e.currItem.fitRatio?g.clickToCloseNonZoomable&&e.close():e.toggleDesktopZoom(n.detail.releasePoint))}else if(g.tapToToggleControls&&(C?x.hideControls():x.showControls()),g.tapToClose&&(t.hasClass(o,"pswp__img")||F(o)))return void e.close()},x.onMouseOver=function(e){var t=(e=e||window.event).target||e.srcElement;E(o,"ui--over-close",F(t))},x.hideControls=function(){t.addClass(o,"pswp__ui--hidden"),C=!1},x.showControls=function(){C=!0,b||x.update(),t.removeClass(o,"pswp__ui--hidden")},x.supportsFullscreen=function(){var e=document;return!!(e.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.msExitFullscreen)},x.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"}
1),t&&(t.enter=function(){return c=g.closeOnScroll,g.closeOnScroll=!1,"webkitRequestFullscreen"!==this.enterK?e.template[this.enterK]():void e.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},t.exit=function(){return g.closeOnScroll=c,document[this.exitK]()},t.isFullscreen=function(){return document[this.elementK]}),t}}}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.