[css]cssだけでプルダウンメニューを実装する

「マウスオーバー時に低階層メニューを表示する」ってギミックに限り、
アニメーションとかいらないってなら、
jsとか使わないでcssだけで作ったほうが楽だった。
多分今後もやっていく。

こう作る

メニュー自体のデザインは今回省く。
キモのところだけ。
[html]

");$("body").addClass("compensate-for-scrollbar")}buttonStr="";$.each(firstItemOpts.buttons,function(index,value){buttonStr+=firstItemOpts.btnTpl[value]||""});$container=$(self.translate(self,firstItemOpts.baseTpl.replace("{{buttons}}",buttonStr).replace("{{arrows}}",firstItemOpts.btnTpl.arrowLeft+firstItemOpts.btnTpl.arrowRight))).attr("id","fancybox-container-"+self.id).addClass(firstItemOpts.baseClass).data("FancyBox",self).appendTo(firstItemOpts.parentEl);self.$refs={container:$container};["bg","inner","infobar","toolbar","stage","caption","navigation"].forEach(function(item){self.$refs[item]=$container.find(".fancybox-"+item)});self.trigger("onInit");self.activate();self.jumpTo(self.currIndex)},translate:function(obj,str){var arr=obj.opts.i18n[obj.opts.lang]||obj.opts.i18n.en;return str.replace(/\{\{(\w+)\}\}/g,function(match,n){return arr[n]===undefined?match:arr[n]})},addContent:function(content){var self=this,items=$.makeArray(content),thumbs;$.each(items,function(i,item){var obj={},opts={},$item,type,found,src,srcParts;if($.isPlainObject(item)){obj=item;opts=item.opts||item}else if($.type(item)==="object"&&$(item).length){$item=$(item);opts=$item.data()||{};opts=$.extend(!0,{},opts,opts.options);opts.$orig=$item;obj.src=self.opts.src||opts.src||$item.attr("href");if(!obj.type&&!obj.src){obj.type="inline";obj.src=item}}else{obj={type:"html",src:item+""}}obj.opts=$.extend(!0,{},self.opts,opts);if($.isArray(opts.buttons)){obj.opts.buttons=opts.buttons}if($.fancyboxforwp.isMobile&&obj.opts.mobile){obj.opts=mergeOpts(obj.opts,obj.opts.mobile)}type=obj.type||obj.opts.type;src=obj.src||"";if(!type&&src){if((found=src.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))){type="video";if(!obj.opts.video.format){obj.opts.video.format="video/"+(found[1]==="ogv"?"ogg":found[1])}}else if(src.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)){type="image"}else if(src.match(/\.(pdf)((\?|#).*)?$/i)){type="iframe";obj=$.extend(!0,obj,{contentType:"pdf",opts:{iframe:{preload:!1}}})}else if(src.charAt(0)==="#"){type="inline"}}if(type){obj.type=type}else{self.trigger("objectNeedsType",obj)}if(!obj.contentType){obj.contentType=$.inArray(obj.type,["html","inline","ajax"])>-1?"html":obj.type}obj.index=self.group.length;if(obj.opts.smallBtn=="auto"){obj.opts.smallBtn=$.inArray(obj.type,["html","inline","ajax"])>-1}if(obj.opts.toolbar==="auto"){obj.opts.toolbar=!obj.opts.smallBtn}obj.$thumb=obj.opts.$thumb||null;if(obj.opts.$trigger&&obj.index===self.opts.index){obj.$thumb=obj.opts.$trigger.find("img:first");if(obj.$thumb.length){obj.opts.$orig=obj.opts.$trigger}}if(!(obj.$thumb&&obj.$thumb.length)&&obj.opts.$orig){obj.$thumb=obj.opts.$orig.find("img:first")}if(obj.$thumb&&!obj.$thumb.length){obj.$thumb=null}obj.thumb=obj.opts.thumb||(obj.$thumb?obj.$thumb[0].src:null);if($.type(obj.opts.caption)==="function"){obj.opts.caption=obj.opts.caption.apply(item,[self,obj])}if($.type(self.opts.caption)==="function"){obj.opts.caption=self.opts.caption.apply(item,[self,obj])}if(!(obj.opts.caption instanceof $)){obj.opts.caption=obj.opts.caption===undefined?"":obj.opts.caption+""}if(obj.type==="ajax"){srcParts=src.split(/\s+/,2);if(srcParts.length>1){obj.src=srcParts.shift();obj.opts.filter=srcParts.shift()}}if(obj.opts.modal){obj.opts=$.extend(!0,obj.opts,{trapFocus:!0,infobar:0,toolbar:0,smallBtn:0,keyboard:0,slideShow:0,fullScreen:0,thumbs:0,touch:0,clickContent:!1,clickSlide:!1,clickOutside:!1,dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1})}self.group.push(obj)});if(Object.keys(self.slides).length){self.updateControls();thumbs=self.Thumbs;if(thumbs&&thumbs.isActive){thumbs.create();thumbs.focus()}}},addEvents:function(){var self=this;self.removeEvents();self.$refs.container.on("click.fb-close","[data-fancybox-close]",function(e){e.stopPropagation();e.preventDefault();self.close(e)}).on("touchstart.fb-prev click.fb-prev","[data-fancybox-prev]",function(e){e.stopPropagation();e.preventDefault();self.previous()}).on("touchstart.fb-next click.fb-next","[data-fancybox-next]",function(e){e.stopPropagation();e.preventDefault();self.next()}).on("click.fb","[data-fancybox-zoom]",function(e){self[self.isScaledDown()?"scaleToActual":"scaleToFit"]()});$W.on("orientationchange.fb resize.fb",function(e){if(e&&e.originalEvent&&e.originalEvent.type==="resize"){if(self.requestId){cancelAFrame(self.requestId)}self.requestId=requestAFrame(function(){self.update(e)})}else{if(self.current&&self.current.type==="iframe"){self.$refs.stage.hide()}setTimeout(function(){self.$refs.stage.show();self.update(e)},$.fancyboxforwp.isMobile?600:250)}});$D.on("keydown.fb",function(e){var instance=$.fancyboxforwp?$.fancyboxforwp.getInstance():null,current=instance.current,keycode=e.keyCode||e.which;if(keycode==9){if(current.opts.trapFocus){self.focus(e)}return}if(!current.opts.keyboard||e.ctrlKey||e.altKey||e.shiftKey||$(e.target).is("input,textarea,video,audio,select")){return}if(keycode===8||keycode===27){e.preventDefault();self.close(e);return}if(keycode===37||keycode===38){e.preventDefault();self.previous();return}if(keycode===39||keycode===40){e.preventDefault();self.next();return}self.trigger("afterKeydown",e,keycode)});if(self.group[self.currIndex].opts.idleTime){self.idleSecondsCounter=0;$D.on("mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle",function(e){self.idleSecondsCounter=0;if(self.isIdle){self.showControls()}self.isIdle=!1});self.idleInterval=window.setInterval(function(){self.idleSecondsCounter++;if(self.idleSecondsCounter>=self.group[self.currIndex].opts.idleTime&&!self.isDragging){self.isIdle=!0;self.idleSecondsCounter=0;self.hideControls()}},1000)}},removeEvents:function(){var self=this;$W.off("orientationchange.fb resize.fb");$D.off("keydown.fb .fb-idle");this.$refs.container.off(".fb-close .fb-prev .fb-next");if(self.idleInterval){window.clearInterval(self.idleInterval);self.idleInterval=null}},previous:function(duration){return this.jumpTo(this.currPos-1,duration)},next:function(duration){return this.jumpTo(this.currPos+1,duration)},jumpTo:function(pos,duration){var self=this,groupLen=self.group.length,firstRun,isMoved,loop,current,previous,slidePos,stagePos,prop,diff;if(self.isDragging||self.isClosing||(self.isAnimating&&self.firstRun)){return}pos=parseInt(pos,10);loop=self.current?self.current.opts.loop:self.opts.loop;if(!loop&&(pos<0||pos>=groupLen)){return !1}firstRun=self.firstRun=!Object.keys(self.slides).length;previous=self.current;self.prevIndex=self.currIndex;self.prevPos=self.currPos;current=self.createSlide(pos);if(groupLen>1){if(loop||current.index0){self.createSlide(pos-1)}}self.current=current;self.currIndex=current.index;self.currPos=current.pos;self.trigger("beforeShow",firstRun);self.updateControls();current.forcedDuration=undefined;if($.isNumeric(duration)){current.forcedDuration=duration}else{duration=current.opts[firstRun?"animationDuration":"transitionDuration"]}duration=parseInt(duration,10);isMoved=self.isMoved(current);current.$slide.addClass("fancybox-slide--current");if(firstRun){if(current.opts.animationEffect&&duration){self.$refs.container.css("transition-duration",duration+"ms")}self.$refs.container.addClass("fancybox-is-open").trigger("focus");self.loadSlide(current);self.preload("image");return}slidePos=$.fancyboxforwp.getTranslate(previous.$slide);stagePos=$.fancyboxforwp.getTranslate(self.$refs.stage);$.each(self.slides,function(index,slide){$.fancyboxforwp.stop(slide.$slide,!0)});if(previous.pos!==current.pos){previous.isComplete=!1}previous.$slide.removeClass("fancybox-slide--complete fancybox-slide--current");if(isMoved){diff=slidePos.left-(previous.pos*slidePos.width+previous.pos*previous.opts.gutter);$.each(self.slides,function(index,slide){slide.$slide.removeClass("fancybox-animated").removeClass(function(index,className){return(className.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")});var leftPos=slide.pos*slidePos.width+slide.pos*slide.opts.gutter;$.fancyboxforwp.setTranslate(slide.$slide,{top:0,left:leftPos-stagePos.left+diff});if(slide.pos!==current.pos){slide.$slide.addClass("fancybox-slide--"+(slide.pos>current.pos?"next":"previous"))}forceRedraw(slide.$slide);$.fancyboxforwp.animate(slide.$slide,{top:0,left:(slide.pos-current.pos)*slidePos.width+(slide.pos-current.pos)*slide.opts.gutter},duration,function(){slide.$slide.css({transform:"",opacity:""}).removeClass("fancybox-slide--next fancybox-slide--previous");if(slide.pos===self.currPos){self.complete()}})})}else if(duration&¤t.opts.transitionEffect){prop="fancybox-animated fancybox-fx-"+current.opts.transitionEffect;previous.$slide.addClass("fancybox-slide--"+(previous.pos>current.pos?"next":"previous"));$.fancyboxforwp.animate(previous.$slide,prop,duration,function(){previous.$slide.removeClass(prop).removeClass("fancybox-slide--next fancybox-slide--previous")},!1)}if(current.isLoaded){self.revealContent(current)}else{self.loadSlide(current)}self.preload("image")},createSlide:function(pos){var self=this,$slide,index;index=pos%self.group.length;index=index<0?self.group.length+index:index;if(!self.slides[pos]&&self.group[index]){$slide=$('
').appendTo(self.$refs.stage);self.slides[pos]=$.extend(!0,{},self.group[index],{pos:pos,$slide:$slide,isLoaded:!1});self.updateSlide(self.slides[pos])}return self.slides[pos]},scaleToActual:function(x,y,duration){var self=this,current=self.current,$content=current.$content,canvasWidth=$.fancyboxforwp.getTranslate(current.$slide).width,canvasHeight=$.fancyboxforwp.getTranslate(current.$slide).height,newImgWidth=current.width,newImgHeight=current.height,imgPos,posX,posY,scaleX,scaleY;if(self.isAnimating||self.isMoved()||!$content||!(current.type=="image"&¤t.isLoaded&&!current.hasError)){return}self.isAnimating=!0;$.fancyboxforwp.stop($content);x=x===undefined?canvasWidth*0.5:x;y=y===undefined?canvasHeight*0.5:y;imgPos=$.fancyboxforwp.getTranslate($content);imgPos.top-=$.fancyboxforwp.getTranslate(current.$slide).top;imgPos.left-=$.fancyboxforwp.getTranslate(current.$slide).left;scaleX=newImgWidth/imgPos.width;scaleY=newImgHeight/imgPos.height;posX=canvasWidth*0.5-newImgWidth*0.5;posY=canvasHeight*0.5-newImgHeight*0.5;if(newImgWidth>canvasWidth){posX=imgPos.left*scaleX-(x*scaleX-x);if(posX>0){posX=0}if(posXcanvasHeight){posY=imgPos.top*scaleY-(y*scaleY-y);if(posY>0){posY=0}if(posYmaxWidth-0.5){width=maxWidth}if(height>maxHeight-0.5){height=maxHeight}if(slide.type==="image"){rez.top=Math.floor((maxHeight-height)*0.5)+parseFloat($slide.css("paddingTop"));rez.left=Math.floor((maxWidth-width)*0.5)+parseFloat($slide.css("paddingLeft"))}else if(slide.contentType==="video"){aspectRatio=slide.opts.width&&slide.opts.height?width / height : slide.opts.ratio || 16 / 9;if(height>width/aspectRatio){height=width/aspectRatio}else if(width>height*aspectRatio){width=height*aspectRatio}}rez.width=width;rez.height=height;return rez},update:function(e){var self=this;$.each(self.slides,function(key,slide){self.updateSlide(slide,e)})},updateSlide:function(slide,e){var self=this,$content=slide&&slide.$content,width=slide.width||slide.opts.width,height=slide.height||slide.opts.height,$slide=slide.$slide;self.adjustCaption(slide);if($content&&(width||height||slide.contentType==="video")&&!slide.hasError){$.fancyboxforwp.stop($content);$.fancyboxforwp.setTranslate($content,self.getFitPos(slide));if(slide.pos===self.currPos){self.isAnimating=!1;self.updateCursor()}}self.adjustLayout(slide);if($slide.length){$slide.trigger("refresh");if(slide.pos===self.currPos){self.$refs.toolbar.add(self.$refs.navigation.find(".fancybox-button--arrow_right")).toggleClass("compensate-for-scrollbar",$slide.get(0).scrollHeight>$slide.get(0).clientHeight)}}self.trigger("onUpdate",slide,e)},centerSlide:function(duration){var self=this,current=self.current,$slide=current.$slide;if(self.isClosing||!current){return}$slide.siblings().css({transform:"",opacity:""});$slide.parent().children().removeClass("fancybox-slide--previous fancybox-slide--next");$.fancyboxforwp.animate($slide,{top:0,left:0,opacity:1},duration===undefined?0:duration,function(){$slide.css({transform:"",opacity:""});if(!current.isComplete){self.complete()}},!1)},isMoved:function(slide){var current=slide||this.current,slidePos,stagePos;if(!current){return !1}stagePos=$.fancyboxforwp.getTranslate(this.$refs.stage);slidePos=$.fancyboxforwp.getTranslate(current.$slide);return(!current.$slide.hasClass("fancybox-animated")&&(Math.abs(slidePos.top-stagePos.top)>0.5||Math.abs(slidePos.left-stagePos.left)>0.5))},updateCursor:function(nextWidth,nextHeight){var self=this,current=self.current,$container=self.$refs.container,canPan,isZoomable;if(!current||self.isClosing||!self.Guestures){return}$container.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan");canPan=self.canPan(nextWidth,nextHeight);isZoomable=canPan?!0:self.isZoomable();$container.toggleClass("fancybox-is-zoomable",isZoomable);$("[data-fancybox-zoom]").prop("disabled",!isZoomable);if(canPan){$container.addClass("fancybox-can-pan")}else if(isZoomable&&(current.opts.clickContent==="zoom"||($.isFunction(current.opts.clickContent)&¤t.opts.clickContent(current)=="zoom"))){$container.addClass("fancybox-can-zoomIn")}else if(current.opts.touch&&(current.opts.touch.vertical||self.group.length>1)&¤t.contentType!=="video"){$container.addClass("fancybox-can-swipe")}},isZoomable:function(){var self=this,current=self.current,fitPos;if(current&&!self.isClosing&¤t.type==="image"&&!current.hasError){if(!current.isLoaded){return !0}fitPos=self.getFitPos(current);if(fitPos&&(current.width>fitPos.width||current.height>fitPos.height)){return !0}}return !1},isScaledDown:function(nextWidth,nextHeight){var self=this,rez=!1,current=self.current,$content=current.$content;if(nextWidth!==undefined&&nextHeight!==undefined){rez=nextWidth1.5||Math.abs(pos.height-rez.height)>1.5}}return rez},loadSlide:function(slide){var self=this,type,$slide,ajaxLoad;if(slide.isLoading||slide.isLoaded){return}slide.isLoading=!0;if(self.trigger("beforeLoad",slide)===!1){slide.isLoading=!1;return !1}type=slide.type;$slide=slide.$slide;$slide.off("refresh").trigger("onReset").addClass(slide.opts.slideClass);switch(type){case "image":self.setImage(slide);break;case "iframe":self.setIframe(slide);break;case "html":self.setContent(slide,slide.src||slide.content);break;case "video":self.setContent(slide,slide.opts.video.tpl.replace(/\{\{src\}\}/gi,slide.src).replace("{{format}}",slide.opts.videoFormat||slide.opts.video.format||"").replace("{{poster}}",slide.thumb||""));break;case "inline":if($(slide.src).length){self.setContent(slide,$(slide.src))}else{self.setError(slide)}break;case "ajax":self.showLoading(slide);ajaxLoad=$.ajax($.extend({},slide.opts.ajax.settings,{url:slide.src,success:function(data,textStatus){if(textStatus==="success"){self.setContent(slide,data)}},error:function(jqXHR,textStatus){if(jqXHR&&textStatus!=="abort"){self.setError(slide)}}}));$slide.one("onReset",function(){ajaxLoad.abort()});break;default:self.setError(slide);break}return !0},setImage:function(slide){var self=this,ghost;setTimeout(function(){var $img=slide.$image;if(!self.isClosing&&slide.isLoading&&(!$img||!$img.length||!$img[0].complete)&&!slide.hasError){self.showLoading(slide)}},50);self.checkSrcset(slide);slide.$content=$('
').addClass("fancybox-is-hidden").appendTo(slide.$slide.addClass("fancybox-slide--image"));if(slide.opts.preload!==!1&&slide.opts.width&&slide.opts.height&&slide.thumb){slide.width=slide.opts.width;slide.height=slide.opts.height;ghost=document.createElement("img");ghost.onerror=function(){$(this).remove();slide.$ghost=null};ghost.onload=function(){self.afterLoad(slide)};slide.$ghost=$(ghost).addClass("fancybox-image").appendTo(slide.$content).attr("src",slide.thumb)}self.setBigImage(slide)},checkSrcset:function(slide){var srcset=slide.opts.srcset||slide.opts.image.srcset,found,temp,pxRatio,windowWidth;if(srcset){pxRatio=window.devicePixelRatio||1;windowWidth=window.innerWidth*pxRatio;temp=srcset.split(",").map(function(el){var ret={};el.trim().split(/\s+/).forEach(function(el,i){var value=parseInt(el.substring(0,el.length-1),10);if(i===0){return(ret.url=el)}if(value){ret.value=value;ret.postfix=el[el.length-1]}});return ret});temp.sort(function(a,b){return a.value-b.value});for(var j=0;j=windowWidth)||(el.postfix==="x"&&el.value>=pxRatio)){found=el;break}}if(!found&&temp.length){found=temp[temp.length-1]}if(found){slide.src=found.url;if(slide.width&&slide.height&&found.postfix=="w"){slide.height=(slide.width/slide.height)*found.value;slide.width=found.value}slide.opts.srcset=srcset}}},setBigImage:function(slide){var self=this,img=document.createElement("img"),$img=$(img);slide.$image=$img.one("error",function(){self.setError(slide)}).one("load",function(){var sizes;if(!slide.$ghost){self.resolveImageSlideSize(slide,this.naturalWidth,this.naturalHeight);self.afterLoad(slide)}if(self.isClosing){return}if(slide.opts.srcset){sizes=slide.opts.sizes;if(!sizes||sizes==="auto"){sizes=(slide.width / slide.height > 1 && $W.width() / $W.height()>1?"100":Math.round((slide.width/slide.height)*100))+"vw"}$img.attr("sizes",sizes).attr("srcset",slide.opts.srcset)}if(slide.$ghost){setTimeout(function(){if(slide.$ghost&&!self.isClosing){slide.$ghost.hide()}},Math.min(300,Math.max(1000,slide.height/1600)))}self.hideLoading(slide)}).addClass("fancybox-image").attr("src",slide.src).appendTo(slide.$content);if((img.complete||img.readyState=="complete")&&$img.naturalWidth&&$img.naturalHeight){$img.trigger("load")}else if(img.error){$img.trigger("error")}},resolveImageSlideSize:function(slide,imgWidth,imgHeight){var maxWidth=parseInt(slide.opts.width,10),maxHeight=parseInt(slide.opts.height,10);slide.width=imgWidth;slide.height=imgHeight;if(maxWidth>0){slide.width=maxWidth;slide.height=Math.floor((maxWidth*imgHeight)/imgWidth)}if(maxHeight>0){slide.width=Math.floor((maxHeight*imgWidth)/imgHeight);slide.height=maxHeight}},setIframe:function(slide){var self=this,opts=slide.opts.iframe,$slide=slide.$slide,$iframe;slide.$content=$('
').css(opts.css).appendTo($slide);$slide.addClass("fancybox-slide--"+slide.contentType);slide.$iframe=$iframe=$(opts.tpl.replace(/\{rnd\}/g,new Date().getTime())).attr(opts.attr).appendTo(slide.$content);if(opts.preload){self.showLoading(slide);$iframe.on("load.fb error.fb",function(e){this.isReady=1;slide.$slide.trigger("refresh");self.afterLoad(slide)});$slide.on("refresh.fb",function(){var $content=slide.$content,frameWidth=opts.css.width,frameHeight=opts.css.height,$contents,$body;if($iframe[0].isReady!==1){return}try{$contents=$iframe.contents();$body=$contents.find("body")}catch(ignore){}if($body&&$body.length&&$body.children().length){$slide.css("overflow","visible");$content.css({width:"100%","max-width":"100%",height:"9999px"});if(frameWidth===undefined){frameWidth=Math.ceil(Math.max($body[0].clientWidth,$body.outerWidth(!0)))}$content.css("width",frameWidth?frameWidth:"").css("max-width","");if(frameHeight===undefined){frameHeight=Math.ceil(Math.max($body[0].clientHeight,$body.outerHeight(!0)))}$content.css("height",frameHeight?frameHeight:"");$slide.css("overflow","auto")}$content.removeClass("fancybox-is-hidden")})}else{self.afterLoad(slide)}$iframe.attr("src",slide.src);$slide.one("onReset",function(){try{$(this).find("iframe").hide().unbind().attr("src","//about:blank")}catch(ignore){}$(this).off("refresh.fb").empty();slide.isLoaded=!1;slide.isRevealed=!1})},setContent:function(slide,content){var self=this;if(self.isClosing){return}self.hideLoading(slide);if(slide.$content){$.fancyboxforwp.stop(slide.$content)}slide.$slide.empty();if(isQuery(content)&&content.parent().length){if(content.hasClass("fancybox-content")||content.parent().hasClass("fancybox-content")){content.parents(".fancybox-slide").trigger("onReset")}slide.$placeholder=$("").hide().insertAfter(content);content.css("display","inline-block")}else if(!slide.hasError){if($.type(content)==="string"){content=$("").append($.trim(content)).contents()}if(slide.opts.filter){content=$("").html(content).find(slide.opts.filter)}}slide.$slide.one("onReset",function(){$(this).find("video,audio").trigger("pause");if(slide.$placeholder){slide.$placeholder.after(content.removeClass("fancybox-content").hide()).remove();slide.$placeholder=null}if(slide.$smallBtn){slide.$smallBtn.remove();slide.$smallBtn=null}if(!slide.hasError){$(this).empty();slide.isLoaded=!1;slide.isRevealed=!1}});$(content).appendTo(slide.$slide);if($(content).is("video,audio")){$(content).addClass("fancybox-video");$(content).wrap("
");slide.contentType="video";slide.opts.width=slide.opts.width||$(content).attr("width");slide.opts.height=slide.opts.height||$(content).attr("height")}slide.$content=slide.$slide.children().filter("div,form,main,video,audio,article,.fancybox-content").first();slide.$content.siblings().hide();if(!slide.$content.length){slide.$content=slide.$slide.wrapInner("
").children().first()}slide.$content.addClass("fancybox-content");slide.$slide.addClass("fancybox-slide--"+slide.contentType);self.afterLoad(slide)},setError:function(slide){slide.hasError=!0;slide.$slide.trigger("onReset").removeClass("fancybox-slide--"+slide.contentType).addClass("fancybox-slide--error");slide.contentType="html";this.setContent(slide,this.translate(slide,slide.opts.errorTpl));if(slide.pos===this.currPos){this.isAnimating=!1}},showLoading:function(slide){var self=this;slide=slide||self.current;if(slide&&!slide.$spinner){slide.$spinner=$(self.translate(self,self.opts.spinnerTpl)).appendTo(slide.$slide).hide().fadeIn("fast")}},hideLoading:function(slide){var self=this;slide=slide||self.current;if(slide&&slide.$spinner){slide.$spinner.stop().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.length)){slide.$smallBtn=$(self.translate(slide,slide.opts.btnTpl.smallBtn)).appendTo(slide.$content)}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.adjustCaption(slide);self.adjustLayout(slide);if(slide.pos===self.currPos){self.updateCursor()}self.revealContent(slide)},adjustCaption:function(slide){var self=this,current=slide||self.current,caption=current.opts.caption,preventOverlap=current.opts.preventCaptionOverlap,$caption=self.$refs.caption,$clone,captionH=!1;$caption.toggleClass("fancybox-caption--separate",preventOverlap);if(preventOverlap&&caption&&caption.length){if(current.pos!==self.currPos){$clone=$caption.clone().appendTo($caption.parent());$clone.children().eq(0).empty().html(caption);captionH=$clone.outerHeight(!0);$clone.empty().remove()}else if(self.$caption){captionH=self.$caption.outerHeight(!0)}current.$slide.css("padding-bottom",captionH||"")}},adjustLayout:function(slide){var self=this,current=slide||self.current,scrollHeight,marginBottom,inlinePadding,actualPadding;if(current.isLoaded&¤t.opts.disableLayoutFix!==!0){current.$content.css("margin-bottom","");if(current.$content.outerHeight()>current.$slide.height()+0.5){inlinePadding=current.$slide[0].style["padding-bottom"];actualPadding=current.$slide.css("padding-bottom");if(parseFloat(actualPadding)>0){scrollHeight=current.$slide[0].scrollHeight;current.$slide.css("padding-bottom",0);if(Math.abs(scrollHeight-current.$slide[0].scrollHeight)<1){marginBottom=actualPadding}current.$slide.css("padding-bottom",inlinePadding)}}current.$content.css("margin-bottom",marginBottom)}},revealContent:function(slide){var self=this,$slide=slide.$slide,end=!1,start=!1,isMoved=self.isMoved(slide),isRevealed=slide.isRevealed,effect,effectClassName,duration,opacity;slide.isRevealed=!0;effect=slide.opts[self.firstRun?"animationEffect":"transitionEffect"];duration=slide.opts[self.firstRun?"animationDuration":"transitionDuration"];duration=parseInt(slide.forcedDuration===undefined?duration:slide.forcedDuration,10);if(isMoved||slide.pos!==self.currPos||!duration){effect=!1}if(effect==="zoom"){if(slide.pos===self.currPos&&duration&&slide.type==="image"&&!slide.hasError&&(start=self.getThumbPos(slide))){end=self.getFitPos(slide)}else{effect="fade"}}if(effect==="zoom"){self.isAnimating=!0;end.scaleX=end.width/start.width;end.scaleY=end.height/start.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}$.fancyboxforwp.setTranslate(slide.$content.removeClass("fancybox-is-hidden"),start);forceRedraw(slide.$content);$.fancyboxforwp.animate(slide.$content,end,duration,function(){self.isAnimating=!1;self.complete()});return}self.updateSlide(slide);if(!effect){slide.$content.removeClass("fancybox-is-hidden");if(!isRevealed&&isMoved&&slide.type==="image"&&!slide.hasError){slide.$content.hide().fadeIn("fast")}if(slide.pos===self.currPos){self.complete()}return}$.fancyboxforwp.stop($slide);effectClassName="fancybox-slide--"+(slide.pos>=self.prevPos?"next":"previous")+" fancybox-animated fancybox-fx-"+effect;$slide.addClass(effectClassName).removeClass("fancybox-slide--current"); slide.$content.removeClass("fancybox-is-hidden");forceRedraw($slide);if(slide.type!=="image"){slide.$content.hide().show(0)}$.fancyboxforwp.animate($slide,"fancybox-slide--current",duration,function(){$slide.removeClass(effectClassName).css({transform:"",opacity:""});if(slide.pos===self.currPos){self.complete()}},!0)},getThumbPos:function(slide){var rez=!1,$thumb=slide.$thumb,thumbPos,btw,brw,bbw,blw;if(!$thumb||!inViewport($thumb[0])){return !1}thumbPos=$.fancyboxforwp.getTranslate($thumb);btw=parseFloat($thumb.css("border-top-width")||0);brw=parseFloat($thumb.css("border-right-width")||0);bbw=parseFloat($thumb.css("border-bottom-width")||0);blw=parseFloat($thumb.css("border-left-width")||0);rez={top:thumbPos.top+btw,left:thumbPos.left+blw,width:thumbPos.width-brw-blw,height:thumbPos.height-btw-bbw,scaleX:1,scaleY:1};return thumbPos.width>0&&thumbPos.height>0?rez:!1},complete:function(){var self=this,current=self.current,slides={},$el;if(self.isMoved()||!current.isLoaded){return}if(!current.isComplete){current.isComplete=!0;current.$slide.siblings().trigger("onReset");self.preload("inline");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){$.fancyboxforwp.stop(slide.$slide);slide.$slide.off().remove()}});self.slides=slides}self.isAnimating=!1;self.updateCursor();self.trigger("afterShow");if(!!current.opts.video.autoStart){current.$slide.find("video,audio").filter(":visible:first").trigger("play").one("ended",function(){if(Document.exitFullscreen){Document.exitFullscreen()}else if(this.webkitExitFullscreen){this.webkitExitFullscreen()}self.next()})}if(current.opts.autoFocus&¤t.contentType==="html"){$el=current.$content.find("input[autofocus]:enabled:visible:first");if($el.length){$el.trigger("focus")}else{self.focus(null,!0)}}current.$slide.scrollTop(0).scrollLeft(0)},preload:function(type){var self=this,prev,next;if(self.group.length<2){return}next=self.slides[self.currPos+1];prev=self.slides[self.currPos-1];if(prev&&prev.type===type){self.loadSlide(prev)}if(next&&next.type===type){self.loadSlide(next)}},focus:function(e,firstRun){var self=this,focusableStr=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","video","audio","[contenteditable]",'[tabindex]:not([tabindex^="-"])'].join(","),focusableItems,focusedItemIndex;if(self.isClosing){return}if(e||!self.current||!self.current.isComplete){focusableItems=self.$refs.container.find("*:visible")}else{focusableItems=self.current.$slide.find("*:visible"+(firstRun?":not(.fancybox-close-small)":""))}focusableItems=focusableItems.filter(focusableStr).filter(function(){return $(this).css("visibility")!=="hidden"&&!$(this).hasClass("disabled")});if(focusableItems.length){focusedItemIndex=focusableItems.index(document.activeElement);if(e&&e.shiftKey){if(focusedItemIndex<0||focusedItemIndex==0){e.preventDefault();focusableItems.eq(focusableItems.length-1).trigger("focus")}}else{if(focusedItemIndex<0||focusedItemIndex==focusableItems.length-1){if(e){e.preventDefault()}focusableItems.eq(0).trigger("focus")}}}else{self.$refs.container.trigger("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,current=self.current,effect,duration,$content,domRect,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();$content=current.$content;effect=current.opts.animationEffect;duration=$.isNumeric(d)?d:effect?current.opts.animationDuration:0;current.$slide.removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated");if(e!==!0){$.fancyboxforwp.stop(current.$slide)}else{effect=!1}current.$slide.siblings().trigger("onReset").remove();if(duration){self.$refs.container.removeClass("fancybox-is-open").addClass("fancybox-is-closing").css("transition-duration",duration+"ms")}self.hideLoading(current);self.hideControls(!0);self.updateCursor();if(effect==="zoom"&&!($content&&duration&¤t.type==="image"&&!self.isMoved()&&!current.hasError&&(end=self.getThumbPos(current)))){effect="fade"}if(effect==="zoom"){$.fancyboxforwp.stop($content);domRect=$.fancyboxforwp.getTranslate($content);start={top:domRect.top,left:domRect.left,scaleX:domRect.width/end.width,scaleY:domRect.height/end.height,width:end.width,height:end.height};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}$.fancyboxforwp.setTranslate($content,start);forceRedraw($content);$.fancyboxforwp.animate($content,end,duration,done);return !0}if(effect&&duration){$.fancyboxforwp.animate(current.$slide.addClass("fancybox-slide--previous").removeClass("fancybox-slide--current"),"fancybox-animated fancybox-fx-"+effect,duration,done)}else{if(e===!0){setTimeout(done,duration)}else{done()}}return !0},cleanUp:function(e){var self=this,instance,$focus=self.current.opts.$orig,x,y;self.current.$slide.trigger("onReset");self.$refs.container.empty().remove();self.trigger("afterClose",e);if(!!self.current.opts.backFocus){if(!$focus||!$focus.length||!$focus.is(":visible")){$focus=self.$trigger}if($focus&&$focus.length){x=window.scrollX;y=window.scrollY;$focus.trigger("focus");$("html, body").scrollTop(y).scrollLeft(x)}}self.current=null;instance=$.fancyboxforwp.getInstance();if(instance){instance.activate()}else{$("body").removeClass("fancybox-active compensate-for-scrollbar");$("#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(){var self=this,current=self.current,index=current.index,$container=self.$refs.container,$caption=self.$refs.caption,caption=current.opts.caption;current.$slide.trigger("refresh");if(caption&&caption.length){self.$caption=$caption;$caption.children().eq(0).html(caption)}else{self.$caption=null}if(!self.hasHiddenControls&&!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-zoom]").show().end().find("[data-fancybox-download]").attr("href",current.opts.image.src||current.src).show()}else if(current.opts.toolbar){$container.find("[data-fancybox-download],[data-fancybox-zoom]").hide()}if($(document.activeElement).is(":hidden,[disabled]")){self.$refs.container.trigger("focus")}},hideControls:function(andCaption){var self=this,arr=["infobar","toolbar","nav"];if(andCaption||!self.current.opts.preventCaptionOverlap){arr.push("caption")}this.$refs.container.removeClass(arr.map(function(i){return "fancybox-show-"+i}).join(" "));this.hasHiddenControls=!0},showControls:function(){var self=this,opts=self.current?self.current.opts:self.opts,$container=self.$refs.container;self.hasHiddenControls=!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-caption",!!self.$caption).toggleClass("fancybox-show-nav",!!(opts.arrows&&self.group.length>1)).toggleClass("fancybox-is-modal",!!opts.modal)},toggleControls:function(){if(this.hasHiddenControls){this.showControls()}else{this.hideControls()}}});$.fancyboxforwp={version:"3.5.7",defaults:defaults, getInstance:function(command){var instance=$('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"),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(all)}}},destroy:function(){this.close(!0);$D.add("body").off("click.fb-start","**")},isMobile:/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)&&window.getComputedStyle(div).getPropertyValue("transform")&&!(document.documentMode&&document.documentMode<11))})(),getTranslate:function($el){var domRect;if(!$el||!$el.length){return !1}domRect=$el[0].getBoundingClientRect();return{top:domRect.top||0,left:domRect.left||0,width:domRect.width,height:domRect.height,opacity:parseFloat($el.css("opacity"))}},setTranslate:function($el,props){var str="",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+=" scale("+props.scaleX+", "+props.scaleY+")"}else if(props.scaleX!==undefined){str+=" scaleX("+props.scaleX+")"}if(str.length){css.transform=str}if(props.opacity!==undefined){css.opacity=props.opacity}if(props.width!==undefined){css.width=props.width}var custom_caption_outerHeight=0;if($('.fancybox-custom-caption.inside-caption').length){custom_caption_outerHeight=$el.find('.fancybox-custom-caption').outerHeight();if(custom_caption_outerHeight==0){custom_caption_outerHeight=10}}else{custom_caption_outerHeight=($el.find('.fancybox-image').outerHeight()-$el.find('.fancybox-image').height())/2;if(custom_caption_outerHeight>20&&custom_caption_outerHeight<25){custom_caption_outerHeight-=2}if(custom_caption_outerHeight>=25&&custom_caption_outerHeight<=30){custom_caption_outerHeight-=4}if(custom_caption_outerHeight>30){custom_caption_outerHeight-=6}}if(props.height!==undefined&&props.height!=$el.outerHeight()){css.height=props.height+custom_caption_outerHeight}return $el.css(css)},animate:function($el,to,duration,callback,leaveAnimationName){var self=this,from;if($.isFunction(duration)){callback=duration;duration=null}self.stop($el);from=self.getTranslate($el);$el.on(transitionEnd,function(e){if(e&&e.originalEvent&&(!$el.is(e.originalEvent.target)||e.originalEvent.propertyName=="z-index")){return}self.stop($el);if($.isNumeric(duration)){$el.css("transition-duration","")}if($.isPlainObject(to)){if(to.scaleX!==undefined&&to.scaleY!==undefined){self.setTranslate($el,{top:to.top,left:to.left,width:from.width*to.scaleX,height:from.height*to.scaleY,scaleX:1,scaleY:1})}}else if(leaveAnimationName!==!0){$el.removeClass(to)}if($.isFunction(callback)){callback(e)}});if($.isNumeric(duration)){$el.css("transition-duration",duration+"ms")}if($.isPlainObject(to)){if(to.scaleX!==undefined&&to.scaleY!==undefined){delete to.width;delete to.height;if($el.parent().hasClass("fancybox-slide--image")){$el.parent().addClass("fancybox-is-scaling")}}$.fancyboxforwp.setTranslate($el,to)}else{$el.addClass(to)}$el.data("timer",setTimeout(function(){$el.trigger(transitionEnd)},duration+33))},stop:function($el,callCallback){if($el&&$el.length){clearTimeout($el.data("timer"));if(callCallback){$el.trigger(transitionEnd)}$el.off(transitionEnd).css("transition-duration","");$el.parent().removeClass("fancybox-is-scaling")}}};function _run(e,opts){var items=[],index=0,$target,value,instance;if(e&&e.isDefaultPrevented()){return}e.preventDefault();opts=opts||{};if(e&&e.data){opts=mergeOpts(e.data.options,opts)}$target=opts.$target||$(e.currentTarget).trigger("blur");instance=$.fancyboxforwp.getInstance();if(instance&&instance.$trigger&&instance.$trigger.is($target)){return}if(opts.selector){items=$(opts.selector)}else{value=$target.attr("data-fancybox")||"";if(value){items=e.data?e.data.items:[];items=items.length?items.filter('[data-fancybox="'+value+'"]'):$('[data-fancybox="'+value+'"]')}else{items=[$target]}}index=$(items).index($target);if(index<0){index=0}instance=$.fancyboxforwp.open(items,opts,index);instance.$trigger=$target}$.fn.fancyboxforwp=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);$D.on("click.fb-start","[data-fancybox-trigger]",function(e){$('[data-fancybox="'+$(this).attr("data-fancybox-trigger")+'"]').eq($(this).attr("data-fancybox-index")||0).trigger("click.fb-start",{$trigger:$(this)})});(function(){var buttonStr=".fancybox-button",focusStr="fancybox-focus",$pressed=null;$D.on("mousedown mouseup focus blur",buttonStr,function(e){switch(e.type){case "mousedown":$pressed=$(this);break;case "mouseup":$pressed=null;break;case "focusin":$(buttonStr).removeClass(focusStr);if(!$(this).is($pressed)&&!$(this).is("[disabled]")){$(this).addClass(focusStr)}break;case "focusout":$(buttonStr).removeClass(focusStr);break}})})()})(window,document,jQuery);(function($){"use strict";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:"https://www.youtube-nocookie.com/embed/$4",thumb:"https://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},paramPlace:3,type:"iframe",url:"//player.vimeo.com/video/$2"},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] + "").replace(/\?/,"&")+"&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"}}};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};$(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;provider=providerName;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;m1&&(current.contentSource==="youtube"||current.contentSource==="vimeo")){VideoAPILoader.load(current.contentSource)}}})})(jQuery);(function(window,document,$){"use strict";var requestAFrame=(function(){return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||function(callback){return window.setTimeout(callback,1000/60)})})();var cancelAFrame=(function(){return(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||function(id){window.clearTimeout(id)})})();var getPointerXY=function(e){var result=[];e=e.originalEvent||e||window.e;e=e.touches&&e.touches.length?e.touches:e.changedTouches&&e.changedTouches.length?e.changedTouches:[e];for(var key in e){if(e[key].pageX){result.push({x:e[key].pageX,y:e[key].pageY})}else if(e[key].clientX){result.push({x:e[key].clientX,y:e[key].clientY})}}return result};var distance=function(point2,point1,what){if(!point1||!point2){return 0}if(what==="x"){return point2.x-point1.x}else if(what==="y"){return point2.y-point1.y}return Math.sqrt(Math.pow(point2.x-point1.x,2)+Math.pow(point2.y-point1.y,2))};var isClickable=function($el){if($el.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio,iframe')||$.isFunction($el.get(0).onclick)||$el.data("selectable")){return !0}for(var i=0,atts=$el[0].attributes,n=atts.length;iel.clientHeight,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(){var self=this;self.$container.off(".fb.touch");$(document).off(".fb.touch");if(self.requestId){cancelAFrame(self.requestId);self.requestId=null}if(self.tapped){clearTimeout(self.tapped);self.tapped=null}};Guestures.prototype.ontouchstart=function(e){var self=this,$target=$(e.target),instance=self.instance,current=instance.current,$slide=current.$slide,$content=current.$content,isTouchDevice=e.type=="touchstart";if(isTouchDevice){self.$container.off("mousedown.fb.touch")}if(e.originalEvent&&e.originalEvent.button==2){return}if(!$slide.length||!$target.length||isClickable($target)||isClickable($target.parent())){return}if(!$target.is("img")&&e.originalEvent.clientX>$target[0].clientWidth+$target.offset().left){return}if(!current||instance.isAnimating||current.$slide.hasClass("fancybox-animated")){e.stopPropagation();e.preventDefault();return}self.realPoints=self.startPoints=getPointerXY(e);if(!self.startPoints.length){return}if(current.touch){e.stopPropagation()}self.startEvent=e;self.canTap=!0;self.$target=$target;self.$content=$content;self.opts=current.opts.touch;self.isPanning=!1;self.isSwiping=!1;self.isZooming=!1;self.isScrolling=!1;self.canPan=instance.canPan();self.startTime=new Date().getTime();self.distanceX=self.distanceY=self.distance=0;self.canvasWidth=Math.round($slide[0].clientWidth);self.canvasHeight=Math.round($slide[0].clientHeight);self.contentLastPos=null;self.contentStartPos=$.fancyboxforwp.getTranslate(self.$content)||{top:0,left:0};self.sliderStartPos=$.fancyboxforwp.getTranslate($slide);self.stagePos=$.fancyboxforwp.getTranslate(instance.$refs.stage);self.sliderStartPos.top-=self.stagePos.top;self.sliderStartPos.left-=self.stagePos.left;self.contentStartPos.top-=self.stagePos.top;self.contentStartPos.left-=self.stagePos.left;$(document).off(".fb.touch").on(isTouchDevice?"touchend.fb.touch touchcancel.fb.touch":"mouseup.fb.touch mouseleave.fb.touch",$.proxy(self,"ontouchend")).on(isTouchDevice?"touchmove.fb.touch":"mousemove.fb.touch",$.proxy(self,"ontouchmove"));if($.fancyboxforwp.isMobile){document.addEventListener("scroll",self.onscroll,!0)}if(!(self.opts||self.canPan)||!($target.is(self.$stage)||self.$stage.find($target).length)){if($target.is(".fancybox-image")){e.preventDefault()}if(!($.fancyboxforwp.isMobile&&$target.parents(".fancybox-caption").length)){return}}self.isScrollable=isScrollable($target)||isScrollable($target.parent());if(!($.fancyboxforwp.isMobile&&self.isScrollable)){e.preventDefault()}if(self.startPoints.length===1||current.hasError){if(self.canPan){$.fancyboxforwp.stop(self.$content);self.isPanning=!0}else{self.isSwiping=!0}self.$container.addClass("fancybox-is-grabbing")}if(self.startPoints.length===2&¤t.type==="image"&&(current.isLoaded||current.$ghost)){self.canTap=!1;self.isSwiping=!1;self.isPanning=!1;self.isZooming=!0;$.fancyboxforwp.stop(self.$content);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.onscroll=function(e){var self=this;self.isScrolling=!0;document.removeEventListener("scroll",self.onscroll,!0)};Guestures.prototype.ontouchmove=function(e){var self=this;if(e.originalEvent.buttons!==undefined&&e.originalEvent.buttons===0){self.ontouchend(e);return}if(self.isScrolling){self.canTap=!1;return}self.newPoints=getPointerXY(e);if(!(self.opts||self.canPan)||!self.newPoints.length||!self.newPoints.length){return}if(!(self.isSwiping&&self.isSwiping===!0)){e.preventDefault()}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.isSwiping){self.onSwipe(e)}else if(self.isPanning){self.onPan()}else if(self.isZooming){self.onZoom()}}};Guestures.prototype.onSwipe=function(e){var self=this,instance=self.instance,swiping=self.isSwiping,left=self.sliderStartPos.left||0,angle;if(swiping===!0){if(Math.abs(self.distance)>10){self.canTap=!1;if(instance.group.length<2&&self.opts.vertical){self.isSwiping="y"}else if(instance.isDragging||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"}if(self.isSwiping==="y"&&$.fancyboxforwp.isMobile&&self.isScrollable){self.isScrolling=!0;return}instance.isDragging=self.isSwiping;self.startPoints=self.newPoints;$.each(instance.slides,function(index,slide){var slidePos,stagePos;$.fancyboxforwp.stop(slide.$slide);slidePos=$.fancyboxforwp.getTranslate(slide.$slide);stagePos=$.fancyboxforwp.getTranslate(instance.$refs.stage);slide.$slide.css({transform:"",opacity:"","transition-duration":""}).removeClass("fancybox-animated").removeClass(function(index,className){return(className.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")});if(slide.pos===instance.current.pos){self.sliderStartPos.top=slidePos.top-stagePos.top;self.sliderStartPos.left=slidePos.left-stagePos.left}$.fancyboxforwp.setTranslate(slide.$slide,{top:slidePos.top-stagePos.top,left:slidePos.left-stagePos.left})});if(instance.SlideShow&&instance.SlideShow.isActive){instance.SlideShow.stop()}}return}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;$.fancyboxforwp.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;if(distance(self.newPoints[0],self.realPoints[0])<($.fancyboxforwp.isMobile?10:5)){self.startPoints=self.newPoints;return}self.canTap=!1;self.contentLastPos=self.limitMovement();if(self.requestId){cancelAFrame(self.requestId)}self.requestId=requestAFrame(function(){$.fancyboxforwp.setTranslate(self.$content,self.contentLastPos)})};Guestures.prototype.limitMovement=function(){var self=this;var canvasWidth=self.canvasWidth;var canvasHeight=self.canvasHeight;var distanceX=self.distanceX;var distanceY=self.distanceY;var contentStartPos=self.contentStartPos;var currentOffsetX=contentStartPos.left;var currentOffsetY=contentStartPos.top;var currentWidth=contentStartPos.width;var currentHeight=contentStartPos.height;var minTranslateX,minTranslateY,maxTranslateX,maxTranslateY,newOffsetX,newOffsetY;if(currentWidth>canvasWidth){newOffsetX=currentOffsetX+distanceX}else{newOffsetX=currentOffsetX}newOffsetY=currentOffsetY+distanceY;minTranslateX=Math.max(0,canvasWidth*0.5-currentWidth*0.5);minTranslateY=Math.max(0,canvasHeight*0.5-currentHeight*0.5);maxTranslateX=Math.min(canvasWidth-currentWidth,canvasWidth*0.5-currentWidth*0.5);maxTranslateY=Math.min(canvasHeight-currentHeight,canvasHeight*0.5-currentHeight*0.5);if(distanceX>0&&newOffsetX>minTranslateX){newOffsetX=minTranslateX-1+Math.pow(-minTranslateX+currentOffsetX+distanceX,0.8)||0}if(distanceX<0&&newOffsetX0&&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=newOffsetY1&&((self.dMs>130&&distanceX>10)||distanceX>50),speedX=300;self.sliderLastPos=null;if(swiping=="y"&&!scrolling&&Math.abs(self.distanceY)>50){$.fancyboxforwp.animate(self.instance.current.$slide,{top:self.sliderStartPos.top+self.distanceY+self.velocityY*150,opacity:0},200);ret=self.instance.close(!0,250)}else if(canAdvance&&self.distanceX>0){ret=self.instance.previous(speedX)}else if(canAdvance&&self.distanceX<0){ret=self.instance.next(speedX)}if(ret===!1&&(swiping=="x"||swiping=="y")){self.instance.centerSlide(200)}self.$container.removeClass("fancybox-is-sliding")};Guestures.prototype.endPanning=function(){var self=this,newOffsetX,newOffsetY,newPos;if(!self.contentLastPos){return}if(self.opts.momentum===!1||self.dMs>350){newOffsetX=self.contentLastPos.left;newOffsetY=self.contentLastPos.top}else{newOffsetX=self.contentLastPos.left+self.velocityX*500;newOffsetY=self.contentLastPos.top+self.velocityY*500}newPos=self.limitPosition(newOffsetX,newOffsetY,self.contentStartPos.width,self.contentStartPos.height);newPos.width=self.contentStartPos.width;newPos.height=self.contentStartPos.height;$.fancyboxforwp.animate(self.$content,newPos,366)};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};$.fancyboxforwp.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);$.fancyboxforwp.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&&getPointerXY(e))||self.startPoints;var tapX=endPoints[0]?endPoints[0].x-$(window).scrollLeft()-self.stagePos.left:0;var tapY=endPoints[0]?endPoints[0].y-$(window).scrollTop()-self.stagePos.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();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(!$target.is("img")&&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.find($target).addBack().filter($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){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;if(!instance.isAnimating){process("click"+where)}},500)}else{process("click"+where)}}return this};$(document).on("onActivate.fb",function(e,instance){if(instance&&!instance.Guestures){instance.Guestures=new Guestures(instance)}}).on("beforeClose.fb",function(e,instance){if(instance&&instance.Guestures){instance.Guestures.destroy()}})})(window,document,jQuery);(function(document,$){"use strict";$.extend(!0,$.fancyboxforwp.defaults,{btnTpl:{slideShow:'