!function(n){"use strict";function t(n,i){if(!(this instanceof t)){var r=new t(n,i);return r.open(),r}this.id=t.id++;this.setup(n,i);this.chainCallbacks(t._callbackChain)}if("undefined"==typeof n)return void("console"in window&&window.console.info("Too much lightness, Featherlight needs jQuery."));var i=[],r=function(t){return i=n.grep(i,function(n){return n!==t&&n.$instance.closest("body").length>0})},e=function(n,t){var u={},e=new RegExp("^"+t+"([A-Z])(.*)"),r,i,f;for(r in n)i=r.match(e),i&&(f=(i[1]+i[2].replace(/([A-Z])/g,"-$1")).toLowerCase(),u[f]=n[r]);return u},u={keyup:"onKeyUp",resize:"onResize"},o=function(i){n.each(t.opened().reverse(),function(){if(!i.isDefaultPrevented()&&!1===this[u[i.type]](i))return(i.preventDefault(),i.stopPropagation(),!1)})},f=function(i){if(i!==t._globalHandlerInstalled){t._globalHandlerInstalled=i;var r=n.map(u,function(n,i){return i+"."+t.prototype.namespace}).join(" ");n(window)[i?"on":"off"](r,o)}};t.prototype={constructor:t,namespace:"featherlight",targetAttr:"data-featherlight",variant:null,resetCss:!1,background:null,openTrigger:"click",closeTrigger:"click",filter:null,root:"body",openSpeed:250,closeSpeed:250,closeOnClick:"background",closeOnEsc:!0,closeIcon:"&#10005;",loading:"",persist:!1,otherClose:null,beforeOpen:n.noop,beforeContent:n.noop,beforeClose:n.noop,afterOpen:n.noop,afterContent:n.noop,afterClose:n.noop,onKeyUp:n.noop,onResize:n.noop,type:null,contentFilters:["jquery","image","html","ajax","iframe","text"],setup:function(t,i){"object"!=typeof t||t instanceof n!=!1||i||(i=t,t=void 0);var r=n.extend(this,i,{target:t}),u=r.resetCss?r.namespace+"-reset":r.namespace,f=n(r.background||['<div class="'+u+"-loading "+u+'">','<div class="'+u+'-content">','<span class="'+u+"-close-icon "+r.namespace+'-close">',r.closeIcon,"<\/span>",'<div class="'+r.namespace+'-inner">'+r.loading+"<\/div>","<\/div>","<\/div>"].join("")),e="."+r.namespace+"-close"+(r.otherClose?","+r.otherClose:"");return r.$instance=f.clone().addClass(r.variant),r.$instance.on(r.closeTrigger+"."+r.namespace,function(t){var i=n(t.target);("background"===r.closeOnClick&&i.is("."+r.namespace)||"anywhere"===r.closeOnClick||i.closest(e).length)&&(r.close(t),t.preventDefault())}),this},getContent:function(){var e,u;if(this.persist!==!1&&this.$content)return this.$content;var r=this,f=this.constructor.contentFilters,o=function(n){return r.$currentTarget&&r.$currentTarget.attr(n)},s=o(r.targetAttr),t=r.target||s||"",i=f[r.type];if(!i&&t in f&&(i=f[t],t=r.target&&s),t=t||o("href")||"",!i)for(e in f)r[e]&&(i=f[e],t=r[e]);return!i&&(u=t,t=null,n.each(r.contentFilters,function(){return i=f[this],i.test&&(t=i.test(u)),!t&&i.regex&&u.match&&u.match(i.regex)&&(t=u),!t}),!t)?("console"in window&&window.console.error("Featherlight: no content filter found "+(u?' for "'+u+'"':" (no target specified)")),!1):i.process.call(r,t)},setContent:function(t){var i=this;return(t.is("iframe")||n("iframe",t).length>0)&&i.$instance.addClass(i.namespace+"-iframe"),i.$instance.removeClass(i.namespace+"-loading"),i.$instance.find("."+i.namespace+"-inner").not(t).slice(1).remove().end().replaceWith(n.contains(i.$instance[0],t[0])?"":t),i.$content=t.addClass(i.namespace+"-inner"),i},open:function(t){var r=this,u;return(r.$instance.hide().appendTo(r.root),!(t&&t.isDefaultPrevented()||r.beforeOpen(t)===!1))&&(t&&t.preventDefault(),u=r.getContent(),u)?(i.push(r),f(!0),r.$instance.fadeIn(r.openSpeed),r.beforeContent(t),n.when(u).always(function(n){r.setContent(n);r.afterContent(t)}).then(r.$instance.promise()).done(function(){r.afterOpen(t)})):(r.$instance.detach(),n.Deferred().reject().promise())},close:function(t){var i=this,u=n.Deferred();return i.beforeClose(t)===!1?u.reject():(0===r(i).length&&f(!1),i.$instance.fadeOut(i.closeSpeed,function(){i.$instance.detach();i.afterClose(t);u.resolve()})),u.promise()},resize:function(n,t){if(n&&t){this.$content.css("width","").css("height","");var i=Math.max(n/(parseInt(this.$content.parent().css("width"),10)-1),t/(parseInt(this.$content.parent().css("height"),10)-1));i>1&&(i=t/Math.floor(t/i),this.$content.css("width",""+n/i+"px").css("height",""+t/i+"px"))}},chainCallbacks:function(t){for(var i in t)this[i]=n.proxy(t[i],this,n.proxy(this[i],this))}};n.extend(t,{id:0,autoBind:"[data-featherlight]",defaults:t.prototype,contentFilters:{jquery:{regex:/^[#.]\w/,test:function(t){return t instanceof n&&t},process:function(t){return this.persist!==!1?n(t):n(t).clone(!0)}},image:{regex:/\.(png|jpg|jpeg|gif|tiff|bmp|svg)(\?\S*)?$/i,process:function(t){var f=this,u=n.Deferred(),i=new Image,r=n('<img src="'+t+'" alt="" class="'+f.namespace+'-image" />');return i.onload=function(){r.naturalWidth=i.width;r.naturalHeight=i.height;u.resolve(r)},i.onerror=function(){u.reject(r)},i.src=t,u.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(t){return n(t)}},ajax:{regex:/./,process:function(t){var i=n.Deferred(),r=n("<div><\/div>").load(t,function(n,t){"error"!==t&&i.resolve(r.contents());i.fail()});return i.promise()}},iframe:{process:function(t){var i=new n.Deferred,r=n("<iframe/>").hide().attr("src",t).css(e(this,"iframe")).on("load",function(){i.resolve(r.show())}).appendTo(this.$instance.find("."+this.namespace+"-content"));return i.promise()}},text:{process:function(t){return n("<div>",{text:t})}}},functionAttributes:["beforeOpen","afterOpen","beforeContent","afterContent","beforeClose","afterClose"],readElementConfig:function(t,i){var u=this,f=new RegExp("^data-"+i+"-(.*)"),r={};return t&&t.attributes&&n.each(t.attributes,function(){var e=this.name.match(f),t,i;if(e){if(t=this.value,i=n.camelCase(e[1]),n.inArray(i,u.functionAttributes)>=0)t=new Function(t);else try{t=n.parseJSON(t)}catch(o){}r[i]=t}}),r},extend:function(t,i){var r=function(){this.constructor=t};return r.prototype=this.prototype,t.prototype=new r,t.__super__=this.prototype,n.extend(t,this,i),t.defaults=t.prototype,t},attach:function(t,i,r){var u=this,e,o,f;return"object"!=typeof i||i instanceof n!=!1||r||(r=i,i=void 0),r=n.extend({},r),o=r.namespace||u.defaults.namespace,f=n.extend({},u.defaults,u.readElementConfig(t[0],o),r),t.on(f.openTrigger+"."+f.namespace,f.filter,function(o){var h=n.extend({$source:t,$currentTarget:n(this)},u.readElementConfig(t[0],f.namespace),u.readElementConfig(this,f.namespace),r),s=e||n(this).data("featherlight-persisted")||new u(i,h);"shared"===s.persist?e=s:s.persist!==!1&&n(this).data("featherlight-persisted",s);h.$currentTarget.blur();s.open(o)}),t},current:function(){var n=this.opened();return n[n.length-1]||null},opened:function(){var t=this;return r(),n.grep(i,function(n){return n instanceof t})},close:function(n){var t=this.current();if(t)return t.close(n)},_onReady:function(){var t=this;t.autoBind&&(n(t.autoBind).each(function(){t.attach(n(this))}),n(document).on("click",t.autoBind,function(i){i.isDefaultPrevented()||"featherlight"===i.namespace||(i.preventDefault(),t.attach(n(i.currentTarget)),n(i.target).trigger("click.featherlight"))}))},_callbackChain:{onKeyUp:function(t,i){return 27===i.keyCode?(this.closeOnEsc&&n.featherlight.close(i),!1):t(i)},onResize:function(n,t){return this.resize(this.$content.naturalWidth,this.$content.naturalHeight),n(t)},afterContent:function(n,t){var i=n(t);return this.onResize(t),i}}});n.featherlight=t;n.fn.featherlight=function(n,i){return t.attach(this,n,i)};n(document).ready(function(){t._onReady()})}(jQuery);!function(n){"use strict";function t(i,r){if(!(this instanceof t)){var u=new t(n.extend({$source:i,$currentTarget:i.first()},r));return u.open(),u}n.featherlight.apply(this,arguments);this.chainCallbacks(f)}var i=function(n){window.console&&window.console.warn&&window.console.warn("FeatherlightGallery: "+n)},f;if("undefined"==typeof n)return i("Too much lightness, Featherlight needs jQuery.");if(!n.featherlight)return i("Load the featherlight plugin before the gallery plugin");var u="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,e=n.event&&n.event.special.swipeleft&&n,o=window.Hammer&&function(n){var t=new window.Hammer.Manager(n[0]);return t.add(new window.Hammer.Swipe),t},r=u&&(e||o);u&&!r&&i("No compatible swipe library detected; one must be included before featherlightGallery for swipe motions to navigate the galleries.");f={afterClose:function(n,t){var i=this;return i.$instance.off("next."+i.namespace+" previous."+i.namespace),i._swiper&&(i._swiper.off("swipeleft",i._swipeleft).off("swiperight",i._swiperight),i._swiper=null),n(t)},beforeOpen:function(n,t){var i=this;return i.$instance.on("next."+i.namespace+" previous."+i.namespace,function(n){var t="next"===n.type?1:-1;i.navigateTo(i.currentNavigation()+t)}),r?i._swiper=r(i.$instance).on("swipeleft",i._swipeleft=function(){i.$instance.trigger("next")}).on("swiperight",i._swiperight=function(){i.$instance.trigger("previous")}):i.$instance.find("."+i.namespace+"-content").append(i.createNavigation("previous")).append(i.createNavigation("next")),n(t)},beforeContent:function(n,t){var i=this.currentNavigation(),r=this.slides().length;return this.$instance.toggleClass(this.namespace+"-first-slide",0===i).toggleClass(this.namespace+"-last-slide",i===r-1),n(t)},onKeyUp:function(n,t){var i={37:"previous",39:"next"}[t.keyCode];return i?(this.$instance.trigger(i),!1):n(t)}};n.featherlight.extend(t,{autoBind:"[data-featherlight-gallery]"});n.extend(t.prototype,{previousIcon:"&#9664;",nextIcon:"&#9654;",galleryFadeIn:100,galleryFadeOut:300,slides:function(){return this.filter?this.$source.find(this.filter):this.$source},images:function(){return i("images is deprecated, please use slides instead"),this.slides()},currentNavigation:function(){return this.slides().index(this.$currentTarget)},navigateTo:function(t){var i=this,u=i.slides(),r=u.length,f=i.$instance.find("."+i.namespace+"-inner");return t=(t%r+r)%r,i.$currentTarget=u.eq(t),i.beforeContent(),n.when(i.getContent(),f.fadeTo(i.galleryFadeOut,.2)).always(function(n){i.setContent(n);i.afterContent();n.fadeTo(i.galleryFadeIn,1)})},createNavigation:function(t){var i=this;return n('<span title="'+t+'" class="'+this.namespace+"-"+t+'"><span>'+this[t+"Icon"]+"<\/span><\/span>").click(function(){n(this).trigger(t+"."+i.namespace)})}});n.featherlightGallery=t;n.fn.featherlightGallery=function(n){return t.attach(this,n)};n(document).ready(function(){t._onReady()})}(jQuery)