').html(content).find(slide.opts.filter)}}
slide.$slide.one('onReset',function(){if(slide.$placeholder){slide.$placeholder.after(content.hide()).remove();slide.$placeholder=null}
if(slide.$smallBtn){slide.$smallBtn.remove();slide.$smallBtn=null}
if(!slide.hasError){$(this).empty();slide.isLoaded=!1}});slide.$content=$(content).appendTo(slide.$slide);this.afterLoad(slide)},setError:function(slide){slide.hasError=!0;slide.$slide.removeClass('fancybox-slide--'+slide.type);this.setContent(slide,this.translate(slide,slide.opts.errorTpl))},showLoading:function(slide){var self=this;slide=slide||self.current;if(slide&&!slide.$spinner){slide.$spinner=$(self.opts.spinnerTpl).appendTo(slide.$slide)}},hideLoading:function(slide){var self=this;slide=slide||self.current;if(slide&&slide.$spinner){slide.$spinner.remove();delete slide.$spinner}},afterLoad:function(slide){var self=this;if(self.isClosing){return}
slide.isLoading=!1;slide.isLoaded=!0;self.trigger('afterLoad',slide);self.hideLoading(slide);if(slide.opts.smallBtn&&!slide.$smallBtn){slide.$smallBtn=$(self.translate(slide,slide.opts.btnTpl.smallBtn)).appendTo(slide.$content.filter('div,form').first())}
if(slide.opts.protect&&slide.$content&&!slide.hasError){slide.$content.on('contextmenu.fb',function(e){if(e.button==2){e.preventDefault()}
return!0});if(slide.type==='image'){$('
').appendTo(slide.$content)}}
self.revealContent(slide)},revealContent:function(slide){var self=this;var $slide=slide.$slide;var effect,effectClassName,duration,opacity,end,start=!1;effect=slide.opts[self.firstRun?'animationEffect':'transitionEffect'];duration=slide.opts[self.firstRun?'animationDuration':'transitionDuration'];duration=parseInt(slide.forcedDuration===undefined?duration:slide.forcedDuration,10);if(slide.isMoved||slide.pos!==self.currPos||!duration){effect=!1}
if(effect==='zoom'&&!(slide.pos===self.currPos&&duration&&slide.type==='image'&&!slide.hasError&&(start=self.getThumbPos(slide)))){effect='fade'}
if(effect==='zoom'){end=self.getFitPos(slide);end.scaleX=end.width/start.width;end.scaleY=end.height/start.height;delete end.width;delete end.height;opacity=slide.opts.zoomOpacity;if(opacity=='auto'){opacity=Math.abs(slide.width/slide.height-start.width/start.height)>0.1}
if(opacity){start.opacity=0.1;end.opacity=1}
$.fancybox.setTranslate(slide.$content.removeClass('fancybox-is-hidden'),start);forceRedraw(slide.$content);$.fancybox.animate(slide.$content,end,duration,function(){self.complete()});return}
self.updateSlide(slide);if(!effect){forceRedraw($slide);slide.$content.removeClass('fancybox-is-hidden');if(slide.pos===self.currPos){self.complete()}
return}
$.fancybox.stop($slide);effectClassName='fancybox-animated fancybox-slide--'+(slide.pos>=self.prevPos?'next':'previous')+' fancybox-fx-'+effect;$slide.removeAttr('style').removeClass('fancybox-slide--current fancybox-slide--next fancybox-slide--previous').addClass(effectClassName);slide.$content.removeClass('fancybox-is-hidden');forceRedraw($slide);$.fancybox.animate($slide,'fancybox-slide--current',duration,function(e){$slide.removeClass(effectClassName).removeAttr('style');if(slide.pos===self.currPos){self.complete()}},!0)},getThumbPos:function(slide){var self=this;var rez=!1;var isElementVisible=function($el){var element=$el[0];var elementRect=element.getBoundingClientRect();var parentRects=[];var visibleInAllParents;while(element.parentElement!==null){if($(element.parentElement).css('overflow')==='hidden'||$(element.parentElement).css('overflow')==='auto'){parentRects.push(element.parentElement.getBoundingClientRect())}
element=element.parentElement}
visibleInAllParents=parentRects.every(function(parentRect){var visiblePixelX=Math.min(elementRect.right,parentRect.right)-Math.max(elementRect.left,parentRect.left);var visiblePixelY=Math.min(elementRect.bottom,parentRect.bottom)-Math.max(elementRect.top,parentRect.top);return visiblePixelX>0&&visiblePixelY>0});return visibleInAllParents&&elementRect.bottom>0&&elementRect.right>0&&elementRect.left<$(window).width()&&elementRect.top<$(window).height()};var $thumb=slide.opts.$thumb;var thumbPos=$thumb?$thumb.offset():0;var slidePos;if(thumbPos&&$thumb[0].ownerDocument===document&&isElementVisible($thumb)){slidePos=self.$refs.stage.offset();rez={top:thumbPos.top-slidePos.top+parseFloat($thumb.css("border-top-width")||0),left:thumbPos.left-slidePos.left+parseFloat($thumb.css("border-left-width")||0),width:$thumb.width(),height:$thumb.height(),scaleX:1,scaleY:1}}
return rez},complete:function(){var self=this;var current=self.current;var slides={};if(current.isMoved||!current.isLoaded||current.isComplete){return}
current.isComplete=!0;current.$slide.siblings().trigger('onReset');forceRedraw(current.$slide);current.$slide.addClass('fancybox-slide--complete');$.each(self.slides,function(key,slide){if(slide.pos>=self.currPos-1&&slide.pos<=self.currPos+1){slides[slide.pos]=slide}
else if(slide){$.fancybox.stop(slide.$slide);slide.$slide.off().remove()}});self.slides=slides;self.updateCursor();self.trigger('afterShow');if($(document.activeElement).is('[disabled]')||(current.opts.autoFocus&&!(current.type=='image'||current.type==='iframe'))){self.focus()}},preload:function(){var self=this;var next,prev;if(self.group.length<2){return}
next=self.slides[self.currPos+1];prev=self.slides[self.currPos-1];if(next&&next.type==='image'){self.loadSlide(next)}
if(prev&&prev.type==='image'){self.loadSlide(prev)}},focus:function(){var current=this.current;var $el;if(this.isClosing){return}
if(current&¤t.isComplete){$el=current.$slide.find('input[autofocus]:enabled:visible:first');if(!$el.length){$el=current.$slide.find('button,:input,[tabindex],a').filter(':enabled:visible:first')}}
$el=$el&&$el.length?$el:this.$refs.container;$el.focus()},activate:function(){var self=this;$('.fancybox-container').each(function(){var instance=$(this).data('FancyBox');if(instance&&instance.id!==self.id&&!instance.isClosing){instance.trigger('onDeactivate');instance.removeEvents();instance.isVisible=!1}});self.isVisible=!0;if(self.current||self.isIdle){self.update();self.updateControls()}
self.trigger('onActivate');self.addEvents()},close:function(e,d){var self=this;var current=self.current;var effect,duration;var $what,opacity,start,end;var done=function(){self.cleanUp(e)};if(self.isClosing){return!1}
self.isClosing=!0;if(self.trigger('beforeClose',e)===!1){self.isClosing=!1;requestAFrame(function(){self.update()});return!1}
self.removeEvents();if(current.timouts){clearTimeout(current.timouts)}
$what=current.$content;effect=current.opts.animationEffect;duration=$.isNumeric(d)?d:(effect?current.opts.animationDuration:0);current.$slide.off(transitionEnd).removeClass('fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated');current.$slide.siblings().trigger('onReset').remove();if(duration){self.$refs.container.removeClass('fancybox-is-open').addClass('fancybox-is-closing')}
self.hideLoading(current);self.hideControls();self.updateCursor();if(effect==='zoom'&&!(e!==!0&&$what&&duration&¤t.type==='image'&&!current.hasError&&(end=self.getThumbPos(current)))){effect='fade'}
if(effect==='zoom'){$.fancybox.stop($what);start=$.fancybox.getTranslate($what);start.width=start.width*start.scaleX;start.height=start.height*start.scaleY;opacity=current.opts.zoomOpacity;if(opacity=='auto'){opacity=Math.abs(current.width/current.height-end.width/end.height)>0.1}
if(opacity){end.opacity=0}
start.scaleX=start.width/end.width;start.scaleY=start.height/end.height;start.width=end.width;start.height=end.height;$.fancybox.setTranslate(current.$content,start);forceRedraw(current.$content);$.fancybox.animate(current.$content,end,duration,done);return!0}
if(effect&&duration){if(e===!0){setTimeout(done,duration)}
else{$.fancybox.animate(current.$slide.removeClass('fancybox-slide--current'),'fancybox-animated fancybox-slide--previous fancybox-fx-'+effect,duration,done)}}
else{done()}
return!0},cleanUp:function(e){var self=this,$body=$('body'),instance,offset;self.current.$slide.trigger('onReset');self.$refs.container.empty().remove();self.trigger('afterClose',e);if(self.$lastFocus&&!!self.current.opts.backFocus){self.$lastFocus.focus()}
self.current=null;instance=$.fancybox.getInstance();if(instance){instance.activate()}
else{$W.scrollTop(self.scrollTop).scrollLeft(self.scrollLeft);$body.removeClass('fancybox-active compensate-for-scrollbar');if($body.hasClass('fancybox-iosfix')){offset=parseInt(document.body.style.top,10);$body.removeClass('fancybox-iosfix').css('top','').scrollTop(offset*-1)}
$('#fancybox-style-noscroll').remove()}},trigger:function(name,slide){var args=Array.prototype.slice.call(arguments,1),self=this,obj=slide&&slide.opts?slide:self.current,rez;if(obj){args.unshift(obj)}
else{obj=self}
args.unshift(self);if($.isFunction(obj.opts[name])){rez=obj.opts[name].apply(obj,args)}
if(rez===!1){return rez}
if(name==='afterClose'||!self.$refs){$D.trigger(name+'.fb',args)}
else{self.$refs.container.trigger(name+'.fb',args)}},updateControls:function(force){var self=this;var current=self.current,index=current.index,caption=current.opts.caption,$container=self.$refs.container,$caption=self.$refs.caption;current.$slide.trigger('refresh');self.$caption=caption&&caption.length?$caption.html(caption):null;if(!self.isHiddenControls&&!self.isIdle){self.showControls()}
$container.find('[data-fancybox-count]').html(self.group.length);$container.find('[data-fancybox-index]').html(index+1);$container.find('[data-fancybox-prev]').prop('disabled',(!current.opts.loop&&index<=0));$container.find('[data-fancybox-next]').prop('disabled',(!current.opts.loop&&index>=self.group.length-1));if(current.type==='image'){$container.find('[data-fancybox-download]').attr('href',current.opts.image.src||current.src).show()}
else{$container.find('[data-fancybox-download],[data-fancybox-zoom]').hide()}},hideControls:function(){this.isHiddenControls=!0;this.$refs.container.removeClass('fancybox-show-infobar fancybox-show-toolbar fancybox-show-caption fancybox-show-nav')},showControls:function(){var self=this;var opts=self.current?self.current.opts:self.opts;var $container=self.$refs.container;self.isHiddenControls=!1;self.idleSecondsCounter=0;$container.toggleClass('fancybox-show-toolbar',!!(opts.toolbar&&opts.buttons)).toggleClass('fancybox-show-infobar',!!(opts.infobar&&self.group.length>1)).toggleClass('fancybox-show-nav',!!(opts.arrows&&self.group.length>1)).toggleClass('fancybox-is-modal',!!opts.modal);if(self.$caption){$container.addClass('fancybox-show-caption ')}
else{$container.removeClass('fancybox-show-caption')}},toggleControls:function(){if(this.isHiddenControls){this.showControls()}
else{this.hideControls()}},});$.fancybox={version:"3.2.5",defaults:defaults,getInstance:function(command){var instance=$('.fancybox-container:not(".fancybox-is-closing"):last').data('FancyBox');var args=Array.prototype.slice.call(arguments,1);if(instance instanceof FancyBox){if($.type(command)==='string'){instance[command].apply(instance,args)}
else if($.type(command)==='function'){command.apply(instance,args)}
return instance}
return!1},open:function(items,opts,index){return new FancyBox(items,opts,index)},close:function(all){var instance=this.getInstance();if(instance){instance.close();if(all===!0){this.close()}}},destroy:function(){this.close(!0);$D.off('click.fb-start')},isMobile:document.createTouch!==undefined&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),use3d:(function(){var div=document.createElement('div');return window.getComputedStyle&&window.getComputedStyle(div).getPropertyValue('transform')&&!(document.documentMode&&document.documentMode<11)}()),getTranslate:function($el){var matrix;if(!$el||!$el.length){return!1}
matrix=$el.eq(0).css('transform');if(matrix&&matrix.indexOf('matrix')!==-1){matrix=matrix.split('(')[1];matrix=matrix.split(')')[0];matrix=matrix.split(',')}
else{matrix=[]}
if(matrix.length){if(matrix.length>10){matrix=[matrix[13],matrix[12],matrix[0],matrix[5]]}
else{matrix=[matrix[5],matrix[4],matrix[0],matrix[3]]}
matrix=matrix.map(parseFloat)}
else{matrix=[0,0,1,1];var transRegex=/\.*translate\((.*)px,(.*)px\)/i;var transRez=transRegex.exec($el.eq(0).attr('style'));if(transRez){matrix[0]=parseFloat(transRez[2]);matrix[1]=parseFloat(transRez[1])}}
return{top:matrix[0],left:matrix[1],scaleX:matrix[2],scaleY:matrix[3],opacity:parseFloat($el.css('opacity')),width:$el.width(),height:$el.height()}},setTranslate:function($el,props){var str='';var css={};if(!$el||!props){return}
if(props.left!==undefined||props.top!==undefined){str=(props.left===undefined?$el.position().left:props.left)+'px, '+(props.top===undefined?$el.position().top:props.top)+'px';if(this.use3d){str='translate3d('+str+', 0px)'}
else{str='translate('+str+')'}}
if(props.scaleX!==undefined&&props.scaleY!==undefined){str=(str.length?str+' ':'')+'scale('+props.scaleX+', '+props.scaleY+')'}
if(str.length){css.transform=str}
if(props.opacity!==undefined){css.opacity=props.opacity}
if(props.width!==undefined){css.width=props.width}
if(props.height!==undefined){css.height=props.height}
return $el.css(css)},animate:function($el,to,duration,callback,leaveAnimationName){if($.isFunction(duration)){callback=duration;duration=null}
if(!$.isPlainObject(to)){$el.removeAttr('style')}
$el.on(transitionEnd,function(e){if(e&&e.originalEvent&&(!$el.is(e.originalEvent.target)||e.originalEvent.propertyName=='z-index')){return}
$.fancybox.stop($el);if($.isPlainObject(to)){if(to.scaleX!==undefined&&to.scaleY!==undefined){$el.css('transition-duration','');to.width=Math.round($el.width()*to.scaleX);to.height=Math.round($el.height()*to.scaleY);to.scaleX=1;to.scaleY=1;$.fancybox.setTranslate($el,to)}}
else if(leaveAnimationName!==!0){$el.removeClass(to)}
if($.isFunction(callback)){callback(e)}});if($.isNumeric(duration)){$el.css('transition-duration',duration+'ms')}
if($.isPlainObject(to)){$.fancybox.setTranslate($el,to)}
else{$el.addClass(to)}
if(to.scaleX&&$el.hasClass('fancybox-image-wrap')){$el.parent().addClass('fancybox-is-scaling')}
$el.data("timer",setTimeout(function(){$el.trigger('transitionend')},duration+16))},stop:function($el){clearTimeout($el.data("timer"));$el.off('transitionend').css('transition-duration','');if($el.hasClass('fancybox-image-wrap')){$el.parent().removeClass('fancybox-is-scaling')}}};function _run(e){var $target=$(e.currentTarget),opts=e.data?e.data.options:{},value=$target.attr('data-fancybox')||'',index=0,items=[];if(e.isDefaultPrevented()){return}
e.preventDefault();if(value){items=opts.selector?$(opts.selector):(e.data?e.data.items:[]);items=items.length?items.filter('[data-fancybox="'+value+'"]'):$('[data-fancybox="'+value+'"]');index=items.index($target);if(index<0){index=0}}
else{items=[$target]}
$.fancybox.open(items,opts,index)}
$.fn.fancybox=function(options){var selector;options=options||{};selector=options.selector||!1;if(selector){$('body').off('click.fb-start',selector).on('click.fb-start',selector,{options:options},_run)}
else{this.off('click.fb-start').on('click.fb-start',{items:this,options:options},_run)}
return this};$D.on('click.fb-start','[data-fancybox]',_run)}(window,document,window.jQuery||jQuery));(function($){'use strict';var format=function(url,rez,params){if(!url){return}
params=params||'';if($.type(params)==="object"){params=$.param(params,!0)}
$.each(rez,function(key,value){url=url.replace('$'+key,value||'')});if(params.length){url+=(url.indexOf('?')>0?'&':'?')+params}
return url};var defaults={youtube:{matcher:/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:'transparent',enablejsapi:1,html5:1},paramPlace:8,type:'iframe',url:'//www.youtube.com/embed/$4',thumb:'//img.youtube.com/vi/$4/hqdefault.jpg'},vimeo:{matcher:/^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1,api:1},paramPlace:3,type:'iframe',url:'//player.vimeo.com/video/$2'},metacafe:{matcher:/metacafe.com\/watch\/(\d+)\/(.*)?/,type:'iframe',url:'//www.metacafe.com/embed/$1/?ap=1'},dailymotion:{matcher:/dailymotion.com\/video\/(.*)\/?(.*)/,params:{additionalInfos:0,autoStart:1},type:'iframe',url:'//www.dailymotion.com/embed/video/$1'},vine:{matcher:/vine.co\/v\/([a-zA-Z0-9\?\=\-]+)/,type:'iframe',url:'//vine.co/v/$1/embed/simple'},instagram:{matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,type:'image',url:'//$1/p/$2/media/?size=l'},gmap_place:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i,type:'iframe',url:function(rez){return '//maps.google.'+rez[2]+'/?ll='+(rez[9]?rez[9]+'&z='+Math.floor(rez[10])+(rez[12]?rez[12].replace(/^\//,"&"):''):rez[12])+'&output='+(rez[12]&&rez[12].indexOf('layer=c')>0?'svembed':'embed')}},gmap_search:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i,type:'iframe',url:function(rez){return '//maps.google.'+rez[2]+'/maps?q='+rez[5].replace('query=','q=').replace('api=1','')+'&output=embed'}}};$(document).on('objectNeedsType.fb',function(e,instance,item){var url=item.src||'',type=!1,media,thumb,rez,params,urlParams,paramObj,provider;media=$.extend(!0,{},defaults,item.opts.media);$.each(media,function(providerName,providerOpts){rez=url.match(providerOpts.matcher);if(!rez){return}
type=providerOpts.type;paramObj={};if(providerOpts.paramPlace&&rez[providerOpts.paramPlace]){urlParams=rez[providerOpts.paramPlace];if(urlParams[0]=='?'){urlParams=urlParams.substring(1)}
urlParams=urlParams.split('&');for(var m=0;m
el.clientHeight;var horizontal=(overflowX==='scroll'||overflowX==='auto')&&el.scrollWidth>el.clientWidth;return vertical||horizontal};var isScrollable=function($el){var rez=!1;while(!0){rez=hasScrollbars($el.get(0));if(rez){break}
$el=$el.parent();if(!$el.length||$el.hasClass('fancybox-stage')||$el.is('body')){break}}
return rez};var Guestures=function(instance){var self=this;self.instance=instance;self.$bg=instance.$refs.bg;self.$stage=instance.$refs.stage;self.$container=instance.$refs.container;self.destroy();self.$container.on('touchstart.fb.touch mousedown.fb.touch',$.proxy(self,'ontouchstart'))};Guestures.prototype.destroy=function(){this.$container.off('.fb.touch')};Guestures.prototype.ontouchstart=function(e){var self=this;var $target=$(e.target);var instance=self.instance;var current=instance.current;var $content=current.$content;var isTouchDevice=(e.type=='touchstart');if(isTouchDevice){self.$container.off('mousedown.fb.touch')}
if(!current||self.instance.isAnimating||self.instance.isClosing){e.stopPropagation();e.preventDefault();return}
if(e.originalEvent&&e.originalEvent.button==2){return}
if(!$target.length||isClickable($target)||isClickable($target.parent())){return}
if(e.originalEvent.clientX>$target[0].clientWidth+$target.offset().left){return}
self.startPoints=pointers(e);if(!self.startPoints||(self.startPoints.length>1&&instance.isSliding)){return}
self.$target=$target;self.$content=$content;self.canTap=!0;self.opts=current.opts.touch;$(document).off('.fb.touch');$(document).on(isTouchDevice?'touchend.fb.touch touchcancel.fb.touch':'mouseup.fb.touch mouseleave.fb.touch',$.proxy(self,"ontouchend"));$(document).on(isTouchDevice?'touchmove.fb.touch':'mousemove.fb.touch',$.proxy(self,"ontouchmove"));if(!(self.opts||instance.canPan())||!($target.is(self.$stage)||self.$stage.find($target).length)){if($target.is('img')){e.preventDefault()}
return}
e.stopPropagation();if(!($.fancybox.isMobile&&(isScrollable(self.$target)||isScrollable(self.$target.parent())))){e.preventDefault()}
self.canvasWidth=Math.round(current.$slide[0].clientWidth);self.canvasHeight=Math.round(current.$slide[0].clientHeight);self.startTime=new Date().getTime();self.distanceX=self.distanceY=self.distance=0;self.isPanning=!1;self.isSwiping=!1;self.isZooming=!1;self.sliderStartPos=self.sliderLastPos||{top:0,left:0};self.contentStartPos=$.fancybox.getTranslate(self.$content);self.contentLastPos=null;if(self.startPoints.length===1&&!self.isZooming){self.canTap=!instance.isSliding;if(current.type==='image'&&(self.contentStartPos.width>self.canvasWidth+1||self.contentStartPos.height>self.canvasHeight+1)){$.fancybox.stop(self.$content);self.$content.css('transition-duration','0ms');self.isPanning=!0}
else{self.isSwiping=!0}
self.$container.addClass('fancybox-controls--isGrabbing')}
if(self.startPoints.length===2&&!instance.isAnimating&&!current.hasError&¤t.type==='image'&&(current.isLoaded||current.$ghost)){self.isZooming=!0;self.isSwiping=!1;self.isPanning=!1;$.fancybox.stop(self.$content);self.$content.css('transition-duration','0ms');self.centerPointStartX=((self.startPoints[0].x+self.startPoints[1].x)*0.5)-$(window).scrollLeft();self.centerPointStartY=((self.startPoints[0].y+self.startPoints[1].y)*0.5)-$(window).scrollTop();self.percentageOfImageAtPinchPointX=(self.centerPointStartX-self.contentStartPos.left)/self.contentStartPos.width;self.percentageOfImageAtPinchPointY=(self.centerPointStartY-self.contentStartPos.top)/self.contentStartPos.height;self.startDistanceBetweenFingers=distance(self.startPoints[0],self.startPoints[1])}};Guestures.prototype.ontouchmove=function(e){var self=this;self.newPoints=pointers(e);if($.fancybox.isMobile&&(isScrollable(self.$target)||isScrollable(self.$target.parent()))){e.stopPropagation();self.canTap=!1;return}
if(!(self.opts||self.instance.canPan())||!self.newPoints||!self.newPoints.length){return}
self.distanceX=distance(self.newPoints[0],self.startPoints[0],'x');self.distanceY=distance(self.newPoints[0],self.startPoints[0],'y');self.distance=distance(self.newPoints[0],self.startPoints[0]);if(self.distance>0){if(!(self.$target.is(self.$stage)||self.$stage.find(self.$target).length)){return}
e.stopPropagation();e.preventDefault();if(self.isSwiping){self.onSwipe()}
else if(self.isPanning){self.onPan()}
else if(self.isZooming){self.onZoom()}}};Guestures.prototype.onSwipe=function(){var self=this;var swiping=self.isSwiping;var left=self.sliderStartPos.left||0;var angle;if(swiping===!0){if(Math.abs(self.distance)>10){self.canTap=!1;if(self.instance.group.length<2&&self.opts.vertical){self.isSwiping='y'}
else if(self.instance.isSliding||self.opts.vertical===!1||(self.opts.vertical==='auto'&&$(window).width()>800)){self.isSwiping='x'}
else{angle=Math.abs(Math.atan2(self.distanceY,self.distanceX)*180/Math.PI);self.isSwiping=(angle>45&&angle<135)?'y':'x'}
self.instance.isSliding=self.isSwiping;self.startPoints=self.newPoints;$.each(self.instance.slides,function(index,slide){$.fancybox.stop(slide.$slide);slide.$slide.css('transition-duration','0ms');slide.inTransition=!1;if(slide.pos===self.instance.current.pos){self.sliderStartPos.left=$.fancybox.getTranslate(slide.$slide).left}});if(self.instance.SlideShow&&self.instance.SlideShow.isActive){self.instance.SlideShow.stop()}}}
else{if(swiping=='x'){if(self.distanceX>0&&(self.instance.group.length<2||(self.instance.current.index===0&&!self.instance.current.opts.loop))){left=left+Math.pow(self.distanceX,0.8)}
else if(self.distanceX<0&&(self.instance.group.length<2||(self.instance.current.index===self.instance.group.length-1&&!self.instance.current.opts.loop))){left=left-Math.pow(-self.distanceX,0.8)}
else{left=left+self.distanceX}}
self.sliderLastPos={top:swiping=='x'?0:self.sliderStartPos.top+self.distanceY,left:left};if(self.requestId){cancelAFrame(self.requestId);self.requestId=null}
self.requestId=requestAFrame(function(){if(self.sliderLastPos){$.each(self.instance.slides,function(index,slide){var pos=slide.pos-self.instance.currPos;$.fancybox.setTranslate(slide.$slide,{top:self.sliderLastPos.top,left:self.sliderLastPos.left+(pos*self.canvasWidth)+(pos*slide.opts.gutter)})});self.$container.addClass('fancybox-is-sliding')}})}};Guestures.prototype.onPan=function(){var self=this;var newOffsetX,newOffsetY,newPos;self.canTap=!1;if(self.contentStartPos.width>self.canvasWidth){newOffsetX=self.contentStartPos.left+self.distanceX}
else{newOffsetX=self.contentStartPos.left}
newOffsetY=self.contentStartPos.top+self.distanceY;newPos=self.limitMovement(newOffsetX,newOffsetY,self.contentStartPos.width,self.contentStartPos.height);newPos.scaleX=self.contentStartPos.scaleX;newPos.scaleY=self.contentStartPos.scaleY;self.contentLastPos=newPos;if(self.requestId){cancelAFrame(self.requestId);self.requestId=null}
self.requestId=requestAFrame(function(){$.fancybox.setTranslate(self.$content,self.contentLastPos)})};Guestures.prototype.limitMovement=function(newOffsetX,newOffsetY,newWidth,newHeight){var self=this;var minTranslateX,minTranslateY,maxTranslateX,maxTranslateY;var canvasWidth=self.canvasWidth;var canvasHeight=self.canvasHeight;var currentOffsetX=self.contentStartPos.left;var currentOffsetY=self.contentStartPos.top;var distanceX=self.distanceX;var distanceY=self.distanceY;minTranslateX=Math.max(0,canvasWidth*0.5-newWidth*0.5);minTranslateY=Math.max(0,canvasHeight*0.5-newHeight*0.5);maxTranslateX=Math.min(canvasWidth-newWidth,canvasWidth*0.5-newWidth*0.5);maxTranslateY=Math.min(canvasHeight-newHeight,canvasHeight*0.5-newHeight*0.5);if(newWidth>canvasWidth){if(distanceX>0&&newOffsetX>minTranslateX){newOffsetX=minTranslateX-1+Math.pow(-minTranslateX+currentOffsetX+distanceX,0.8)||0}
if(distanceX<0&&newOffsetXcanvasHeight){if(distanceY>0&&newOffsetY>minTranslateY){newOffsetY=minTranslateY-1+Math.pow(-minTranslateY+currentOffsetY+distanceY,0.8)||0}
if(distanceY<0&&newOffsetYcanvasWidth){newOffsetX=newOffsetX>0?0:newOffsetX;newOffsetX=newOffsetXcanvasHeight){newOffsetY=newOffsetY>0?0:newOffsetY;newOffsetY=newOffsetY50){$.fancybox.animate(self.instance.current.$slide,{top:self.sliderStartPos.top+self.distanceY+(self.velocityY*150),opacity:0},150);ret=self.instance.close(!0,300)}
else if(swiping=='x'&&self.distanceX>50&&self.instance.group.length>1){ret=self.instance.previous(self.speedX)}
else if(swiping=='x'&&self.distanceX<-50&&self.instance.group.length>1){ret=self.instance.next(self.speedX)}
if(ret===!1&&(swiping=='x'||swiping=='y')){self.instance.jumpTo(self.instance.current.index,150)}
self.$container.removeClass('fancybox-is-sliding')};Guestures.prototype.endPanning=function(){var self=this;var newOffsetX,newOffsetY,newPos;if(!self.contentLastPos){return}
if(self.opts.momentum===!1){newOffsetX=self.contentLastPos.left;newOffsetY=self.contentLastPos.top}
else{newOffsetX=self.contentLastPos.left+(self.velocityX*self.speed);newOffsetY=self.contentLastPos.top+(self.velocityY*self.speed)}
newPos=self.limitPosition(newOffsetX,newOffsetY,self.contentStartPos.width,self.contentStartPos.height);newPos.width=self.contentStartPos.width;newPos.height=self.contentStartPos.height;$.fancybox.animate(self.$content,newPos,330)};Guestures.prototype.endZooming=function(){var self=this;var current=self.instance.current;var newOffsetX,newOffsetY,newPos,reset;var newWidth=self.newWidth;var newHeight=self.newHeight;if(!self.contentLastPos){return}
newOffsetX=self.contentLastPos.left;newOffsetY=self.contentLastPos.top;reset={top:newOffsetY,left:newOffsetX,width:newWidth,height:newHeight,scaleX:1,scaleY:1};$.fancybox.setTranslate(self.$content,reset);if(newWidthcurrent.width||newHeight>current.height){self.instance.scaleToActual(self.centerPointStartX,self.centerPointStartY,150)}
else{newPos=self.limitPosition(newOffsetX,newOffsetY,newWidth,newHeight);$.fancybox.setTranslate(self.content,$.fancybox.getTranslate(self.$content));$.fancybox.animate(self.$content,newPos,150)}};Guestures.prototype.onTap=function(e){var self=this;var $target=$(e.target);var instance=self.instance;var current=instance.current;var endPoints=(e&&pointers(e))||self.startPoints;var tapX=endPoints[0]?endPoints[0].x-self.$stage.offset().left:0;var tapY=endPoints[0]?endPoints[0].y-self.$stage.offset().top:0;var where;var process=function(prefix){var action=current.opts[prefix];if($.isFunction(action)){action=action.apply(instance,[current,e])}
if(!action){return}
switch(action){case "close":instance.close(self.startEvent);break;case "toggleControls":instance.toggleControls(!0);break;case "next":instance.next();break;case "nextOrClose":if(instance.group.length>1){instance.next()}
else{instance.close(self.startEvent)}
break;case "zoom":if(current.type=='image'&&(current.isLoaded||current.$ghost)){if(instance.canPan()){instance.scaleToFit()}
else if(instance.isScaledDown()){instance.scaleToActual(tapX,tapY)}
else if(instance.group.length<2){instance.close(self.startEvent)}}
break}};if(e.originalEvent&&e.originalEvent.button==2){return}
if(instance.isSliding){return}
if(tapX>$target[0].clientWidth+$target.offset().left){return}
if($target.is('.fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container')){where='Outside'}
else if($target.is('.fancybox-slide')){where='Slide'}
else if(instance.current.$content&&instance.current.$content.has(e.target).length){where='Content'}
else{return}
if(self.tapped){clearTimeout(self.tapped);self.tapped=null;if(Math.abs(tapX-self.tapX)>50||Math.abs(tapY-self.tapY)>50||instance.isSliding){return this}
process('dblclick'+where)}
else{self.tapX=tapX;self.tapY=tapY;if(current.opts['dblclick'+where]&¤t.opts['dblclick'+where]!==current.opts['click'+where]){self.tapped=setTimeout(function(){self.tapped=null;process('click'+where)},300)}
else{process('click'+where)}}
return this};$(document).on('onActivate.fb',function(e,instance){if(instance&&!instance.Guestures){instance.Guestures=new Guestures(instance)}});$(document).on('beforeClose.fb',function(e,instance){if(instance&&instance.Guestures){instance.Guestures.destroy()}})}(window,document,window.jQuery||jQuery));(function(document,$){'use strict';$.extend(!0,$.fancybox.defaults,{btnTpl:{slideShow:''+''+' '+' '+' '+' '},slideShow:{autoStart:!1,speed:3000}});var SlideShow=function(instance){this.instance=instance;this.init()};$.extend(SlideShow.prototype,{timer:null,isActive:!1,$button:null,init:function(){var self=this;self.$button=self.instance.$refs.toolbar.find('[data-fancybox-play]').on('click',function(){self.toggle()});if(self.instance.group.length<2||!self.instance.group[self.instance.currIndex].opts.slideShow){self.$button.hide()}},set:function(force){var self=this;if(self.instance&&self.instance.current&&(force===!0||self.instance.current.opts.loop||self.instance.currIndex'+''+' '+' '+''},fullScreen:{autoStart:!1}});$(document).on({'onInit.fb':function(e,instance){var $container;if(instance&&instance.group[instance.currIndex].opts.fullScreen){$container=instance.$refs.container;$container.on('click.fb-fullscreen','[data-fancybox-fullscreen]',function(e){e.stopPropagation();e.preventDefault();FullScreen.toggle($container[0])});if(instance.opts.fullScreen&&instance.opts.fullScreen.autoStart===!0){FullScreen.request($container[0])}
instance.FullScreen=FullScreen}
else if(instance){instance.$refs.toolbar.find('[data-fancybox-fullscreen]').hide()}},'afterKeydown.fb':function(e,instance,current,keypress,keycode){if(instance&&instance.FullScreen&&keycode===70){keypress.preventDefault();instance.FullScreen.toggle(instance.$refs.container[0])}},'beforeClose.fb':function(instance){if(instance&&instance.FullScreen){FullScreen.exit()}}});$(document).on(fn.fullscreenchange,function(){var isFullscreen=FullScreen.isFullscreen(),instance=$.fancybox.getInstance();if(instance){if(instance.current&&instance.current.type==='image'&&instance.isAnimating){instance.current.$content.css('transition','none');instance.isAnimating=!1;instance.update(!0,!0,0)}
instance.trigger('onFullscreenChange',isFullscreen);instance.$refs.container.toggleClass('fancybox-is-fullscreen',isFullscreen)}})}(document,window.jQuery||jQuery));(function(document,$){'use strict';$.fancybox.defaults=$.extend(!0,{btnTpl:{thumbs:''+''+' '+' '+' '},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:'.fancybox-container',axis:'y'}},$.fancybox.defaults);$.fancybox.defaults=$.extend(!0,{btnTpl:{save:' '},},$.fancybox.defaults);var FancyThumbs=function(instance){this.init(instance)};$.extend(FancyThumbs.prototype,{$button:null,$grid:null,$list:null,isVisible:!1,isActive:!1,init:function(instance){var self=this;self.instance=instance;instance.Thumbs=self;var first=instance.group[0],second=instance.group[1];self.opts=instance.group[instance.currIndex].opts.thumbs;self.$button=instance.$refs.toolbar.find('[data-fancybox-thumbs]');if(self.opts&&first&&second&&((first.type=='image'||first.opts.thumb||first.opts.$thumb)&&(second.type=='image'||second.opts.thumb||second.opts.$thumb))){self.$button.show().on('click',function(){self.toggle()});self.isActive=!0}
else{self.$button.hide()}},create:function(){var self=this,instance=self.instance,parentEl=self.opts.parentEl,list,src;self.$grid=$('
').appendTo(instance.$refs.container.find(parentEl).addBack().filter(parentEl));list='';$.each(instance.group,function(i,item){src=item.opts.thumb||(item.opts.$thumb?item.opts.$thumb.attr('src'):null);if(!src&&item.type==='image'){src=item.src}
if(src&&src.length){list+=' '}});list+=' ';self.$list=$(list).appendTo(self.$grid).on('click','li',function(){instance.jumpTo($(this).data('index'))});self.$list.find('img').hide().one('load',function(){var $parent=$(this).parent().removeClass('fancybox-thumbs-loading'),thumbWidth=$parent.outerWidth(),thumbHeight=$parent.outerHeight(),width,height,widthRatio,heightRatio;width=this.naturalWidth||this.width;height=this.naturalHeight||this.height;widthRatio=width/thumbWidth;heightRatio=height/thumbHeight;if(widthRatio>=1&&heightRatio>=1){if(widthRatio>heightRatio){width=width/heightRatio;height=thumbHeight}
else{width=thumbWidth;height=height/widthRatio}}
$(this).css({width:Math.floor(width),height:Math.floor(height),'margin-top':height>thumbHeight?(Math.floor(thumbHeight*0.3-height*0.3)):Math.floor(thumbHeight*0.5-height*0.5),'margin-left':Math.floor(thumbWidth*0.5-width*0.5)}).show()}).each(function(){this.src=$(this).data('src')});if(self.opts.axis==='x'){self.$list.width(parseInt(self.$grid.css("padding-right"))+(instance.group.length*self.$list.children().eq(0).outerWidth(!0))+'px')}},focus:function(duration){var self=this,$list=self.$list,thumb,thumbPos;if(self.instance.current){thumb=$list.children().removeClass('fancybox-thumbs-active').filter('[data-index="'+self.instance.current.index+'"]').addClass('fancybox-thumbs-active');thumbPos=thumb.position();if(self.opts.axis==='y'&&(thumbPos.top<0||thumbPos.top>($list.height()-thumb.outerHeight()))){$list.stop().animate({'scrollTop':$list.scrollTop()+thumbPos.top},duration)}
else if(self.opts.axis==='x'&&(thumbPos.left<$list.parent().scrollLeft()||thumbPos.left>($list.parent().scrollLeft()+($list.parent().width()-thumb.outerWidth())))){$list.parent().stop().animate({'scrollLeft':thumbPos.left},duration)}}},update:function(){this.instance.$refs.container.toggleClass('fancybox-show-thumbs',this.isVisible);if(this.isVisible){if(!this.$grid){this.create()}
this.instance.trigger('onThumbsShow');this.focus(0)}
else if(this.$grid){this.instance.trigger('onThumbsHide')}
this.instance.update()},hide:function(){this.isVisible=!1;this.update()},show:function(){this.isVisible=!0;this.update()},toggle:function(){this.isVisible=!this.isVisible;this.update()}});$(document).on({'onInit.fb':function(e,instance){var Thumbs;if(instance&&!instance.Thumbs){Thumbs=new FancyThumbs(instance);if(Thumbs.isActive&&Thumbs.opts.autoStart===!0){Thumbs.show()}}},'beforeShow.fb':function(e,instance,item,firstRun){var Thumbs=instance&&instance.Thumbs;if(Thumbs&&Thumbs.isVisible){Thumbs.focus(firstRun?0:250)}},'afterKeydown.fb':function(e,instance,current,keypress,keycode){var Thumbs=instance&&instance.Thumbs;if(Thumbs&&Thumbs.isActive&&keycode===71){keypress.preventDefault();Thumbs.toggle()}},'beforeClose.fb':function(e,instance){var Thumbs=instance&&instance.Thumbs;if(Thumbs&&Thumbs.isVisible&&Thumbs.opts.hideOnClose!==!1){Thumbs.$grid.hide()}}})}(document,window.jQuery));(function(document,$){'use strict';$.extend(!0,$.fancybox.defaults,{btnTpl:{share:''+''+''+' '+' '},share:{tpl:''}});function escapeHtml(string){var entityMap={'&':'&','<':'<','>':'>','"':'"',"'":''','/':'/','`':'`','=':'='};return String(string).replace(/[&<>"'`=\/]/g,function(s){return entityMap[s]})}
$(document).on('click','[data-fancybox-share]',function(){var f=$.fancybox.getInstance(),url,tpl;if(f){url=f.current.opts.hash===!1?f.current.src:window.location;tpl=f.current.opts.share.tpl.replace(/\{\{src\}\}/g,encodeURIComponent(url)).replace(/\{\{src_raw\}\}/g,escapeHtml(url)).replace(/\{\{descr\}\}/g,f.$caption?encodeURIComponent(f.$caption.text()):'');$.fancybox.open({src:f.translate(f,tpl),type:'html',opts:{animationEffect:"fade",animationDuration:250}})}})}(document,window.jQuery||jQuery));(function(document,window,$){'use strict';if(!$.escapeSelector){$.escapeSelector=function(sel){var rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;var fcssescape=function(ch,asCodePoint){if(asCodePoint){if(ch==="\0"){return "\uFFFD"}
return ch.slice(0,-1)+"\\"+ch.charCodeAt(ch.length-1).toString(16)+" "}
return "\\"+ch};return(sel+"").replace(rcssescape,fcssescape)}}
var shouldCreateHistory=!0;var currentHash=null;var timerID=null;function parseUrl(){var hash=window.location.hash.substr(1);var rez=hash.split('-');var index=rez.length>1&&/^\+?\d+$/.test(rez[rez.length-1])?parseInt(rez.pop(-1),10)||1:1;var gallery=rez.join('-');if(index<1){index=1}
return{hash:hash,index:index,gallery:gallery}}
function triggerFromUrl(url){var $el;if(url.gallery!==''){$el=$("[data-fancybox='"+$.escapeSelector(url.gallery)+"']").eq(url.index-1);if(!$el.length){$el=$("#"+$.escapeSelector(url.gallery)+"")}
if($el.length){shouldCreateHistory=!1;$el.trigger('click')}}}
function getGalleryID(instance){var opts;if(!instance){return!1}
opts=instance.current?instance.current.opts:instance.opts;return opts.hash||(opts.$orig?opts.$orig.data('fancybox'):'')}
$(function(){if($.fancybox.defaults.hash===!1){return}
$(document).on({'onInit.fb':function(e,instance){var url,gallery;if(instance.group[instance.currIndex].opts.hash===!1){return}
url=parseUrl();gallery=getGalleryID(instance);if(gallery&&url.gallery&&gallery==url.gallery){instance.currIndex=url.index-1}},'beforeShow.fb':function(e,instance,current){var gallery;if(!current||current.opts.hash===!1){return}
gallery=getGalleryID(instance);if(gallery&&gallery!==''){if(window.location.hash.indexOf(gallery)<0){instance.opts.origHash=window.location.hash}
currentHash=gallery+(instance.group.length>1?'-'+(current.index+1):'');if('replaceState' in window.history){if(timerID){clearTimeout(timerID)}
timerID=setTimeout(function(){window.history[shouldCreateHistory?'pushState':'replaceState']({},document.title,window.location.pathname+window.location.search+'?'+currentHash);timerID=null;shouldCreateHistory=!1},300)}
else{window.location.hash=currentHash}}},'beforeClose.fb':function(e,instance,current){var gallery,origHash;if(timerID){clearTimeout(timerID)}
if(current.opts.hash===!1){return}
gallery=getGalleryID(instance);origHash=instance&&instance.opts.origHash?instance.opts.origHash:'';if(gallery&&gallery!==''){if('replaceState' in history){window.history.replaceState({},document.title,window.location.pathname+window.location.search+origHash)}
else{window.location.hash=origHash;$(window).scrollTop(instance.scrollTop).scrollLeft(instance.scrollLeft)}}
currentHash=null}});$(window).on('hashchange.fb',function(){var url=parseUrl();if($.fancybox.getInstance()){if(currentHash&¤tHash!==url.gallery+'-'+url.index&&!(url.index===1&¤tHash==url.gallery)){currentHash=null;$.fancybox.close()}}
else if(url.gallery!==''){triggerFromUrl(url)}});setTimeout(function(){triggerFromUrl(parseUrl())},50)})}(document,window,window.jQuery||jQuery))