!function(e,i){"function"==typeof define&&define.amd?define(["jquery"],function(t){return i(e,t)}):"object"==typeof module&&module.exports?module.exports=i(e,require("jquery")):e.Galleria=i(e,e.jQuery)}(window,function(b,w,x,y){function r(){}function s(){return!1}function _(){return{html:A.documentElement,body:A.body,head:A.getElementsByTagName("head")[0],title:A.title}}function c(i){var n;return"object"!=typeof i||w.each(i,function(t,e){/^[a-z]+_/.test(t)&&(n="",w.each(t.split("_"),function(t,e){n+=0<t?e.substr(0,1).toUpperCase()+e.substr(1):e}),i[n]=e,delete i[t])}),i}function i(t){return-1<w.inArray(t,R)?x[t.toUpperCase()]:t}function l(t,e){for(var i=0;i<W._inst.length;i++)if(W._inst[i].id===e&&W._inst[i].type==t)return W._inst[i];this.type=t,this.id=e,this.readys=[],W._inst.push(this);var n=this;w.extend(this,W[t]),_videoThumbs=function(t){n.data=t,w.each(n.readys,function(t,e){e(n.data)}),n.readys=[]},this.hasOwnProperty("getUrl")?w.getJSON(this.getUrl(),_videoThumbs):b.setTimeout(_videoThumbs,400),this.getMedia=function(e,i,n){n=n||r;function t(t){i(a["get_"+e](t))}var a=this;try{a.data?t(a.data):a.readys.push(t)}catch(t){n()}}}function h(t){var e;for(var i in W)if((e=t&&W[i].reg&&t.match(W[i].reg))&&e.length)return{id:e[2],provider:i};return!1}function u(i){G.push(i),w.each(B,function(t,e){e._options.theme!=i.name&&(e._initialized||e._options.theme)||(e.theme=i,e._init.call(e))})}function f(t){return Q.insertStyleTag(".galleria-videoicon{width:60px;height:60px;position:absolute;top:50%;left:50%;z-index:1;margin:-30px 0 0 -30px;cursor:pointer;background:#000;background:rgba(0,0,0,.8);border-radius:3px;-webkit-transition:all 150ms}.galleria-videoicon i{width:0px;height:0px;border-style:solid;border-width:10px 0 10px 16px;display:block;border-color:transparent transparent transparent #ffffff;margin:20px 0 0 22px}.galleria-image:hover .galleria-videoicon{background:#000}","galleria-videoicon"),w(Q.create("galleria-videoicon")).html("<i></i>").appendTo(t).click(function(){w(this).siblings("img").mouseup()})}var d,p,g,m,v,T,k,C,I,S,t,n,A=b.document,E=w(A),z=w(b),a=w,D=Array.prototype,o=!0,L=!1,e=navigator.userAgent.toLowerCase(),$=b.location.hash.replace(/#\//,""),P="file:"==b.location.protocol?"http:":b.location.protocol,F=Math,H=!(1279<b.screen.width&&1==b.devicePixelRatio||1e3<b.screen.width&&b.innerWidth<.9*b.screen.width),O=function(){for(var t=3,e=A.createElement("div"),i=e.getElementsByTagName("i");e.innerHTML="\x3c!--[if gt IE "+ ++t+"]><i></i><![endif]--\x3e",i[0];);return 4<t?t:A.documentMode||y}(),M=b.parent!==b.self,N="data ready thumbnail loadstart loadfinish image play pause progress fullscreen_enter fullscreen_exit idle_enter idle_exit rescale lightbox_open lightbox_close lightbox_image",R=(n=[],w.each(N.split(" "),function(t,e){n.push(e),/_/.test(e)&&n.push(e.replace(/_/g,""))}),n),W={youtube:{reg:/https?:\/\/(?:[a-zA_Z]{2,3}.)?(?:youtube\.com\/watch\?)((?:[\w\d\-\_\=]+&amp;(?:amp;)?)*v(?:&lt;[A-Z]+&gt;)?=([0-9a-zA-Z\-\_]+))/i,embed:function(){return P+"//www.youtube.com/embed/"+this.id},get_thumb:function(t){return P+"//img.youtube.com/vi/"+this.id+"/default.jpg"},get_image:function(t){return P+"//img.youtube.com/vi/"+this.id+"/maxresdefault.jpg"}},vimeo:{reg:/https?:\/\/(?:www\.)?(vimeo\.com)\/(?:hd#)?([0-9]+)/i,embed:function(){return P+"//player.vimeo.com/video/"+this.id},getUrl:function(){return P+"//vimeo.com/api/v2/video/"+this.id+".json?callback=?"},get_thumb:function(t){return t[0].thumbnail_medium},get_image:function(t){return t[0].thumbnail_large}},dailymotion:{reg:/https?:\/\/(?:www\.)?(dailymotion\.com)\/video\/([^_]+)/,embed:function(){return P+"//www.dailymotion.com/embed/video/"+this.id},getUrl:function(){return"https://api.dailymotion.com/video/"+this.id+"?fields=thumbnail_240_url,thumbnail_720_url&callback=?"},get_thumb:function(t){return t.thumbnail_240_url},get_image:function(t){return t.thumbnail_720_url}},_inst:[]},q={support:(t=_().html,!M&&(t.requestFullscreen||t.msRequestFullscreen||t.mozRequestFullScreen||t.webkitRequestFullScreen)),callback:r,enter:function(t,e,i){this.instance=t,this.callback=e||r,(i=i||_().html).requestFullscreen?i.requestFullscreen():i.msRequestFullscreen?i.msRequestFullscreen():i.mozRequestFullScreen?i.mozRequestFullScreen():i.webkitRequestFullScreen&&i.webkitRequestFullScreen()},exit:function(t){this.callback=t||r,A.exitFullscreen?A.exitFullscreen():A.msExitFullscreen?A.msExitFullscreen():A.mozCancelFullScreen?A.mozCancelFullScreen():A.webkitCancelFullScreen&&A.webkitCancelFullScreen()},instance:null,listen:function(){if(this.support){function t(){if(q.instance){var t=q.instance._fullscreen;A.fullscreen||A.mozFullScreen||A.webkitIsFullScreen||A.msFullscreenElement&&null!==A.msFullscreenElement?t._enter(q.callback):t._exit(q.callback)}}A.addEventListener("fullscreenchange",t,!1),A.addEventListener("MSFullscreenChange",t,!1),A.addEventListener("mozfullscreenchange",t,!1),A.addEventListener("webkitfullscreenchange",t,!1)}}},U=[],V=[],j=!1,X=!1,B=[],G=[],Q={clearTimer:function(t){w.each(x.get(),function(){this.clearTimer(t)})},addTimer:function(t){w.each(x.get(),function(){this.addTimer(t)})},array:function(t){return D.slice.call(t,0)},create:function(t,e){e=e||"div";var i=A.createElement(e);return i.className=t,i},removeFromArray:function(i,n){return w.each(i,function(t,e){if(e==n)return i.splice(t,1),!1}),i},getScriptPath:function(t){var e=(t=t||w("script:last").attr("src")).split("/");return 1==e.length?"":(e.pop(),e.join("/")+"/")},animate:(C=function(t){var e,i="transition WebkitTransition MozTransition OTransition".split(" ");if(b.opera)return!1;for(e=0;i[e];e++)if(void 0!==t[i[e]])return i[e];return!1}((A.body||A.documentElement).style),I={MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[C],function(i,t,e){if(e=w.extend({duration:400,complete:r,stop:!1},e),i=w(i),!e.duration)return i.css(t),void e.complete.call(i[0]);var n,a,o,s;C?(e.stop&&(i.off(I),J(i)),d=!1,w.each(t,function(t,e){k=i.css(t),Q.parseValue(k)!=Q.parseValue(e)&&(d=!0),i.css(t,k)}),d?(p=[],g=e.easing in S?S[e.easing]:S._default,m=" "+e.duration+"ms cubic-bezier("+g.join(",")+")",b.setTimeout((n=i,a=I,o=t,s=m,function(){var t;n.one(a,(t=n,function(){J(t),e.complete.call(t[0])})),x.WEBKIT&&x.TOUCH&&(v={},T=[0,0,0],w.each(["left","top"],function(t,e){e in o&&(T[t]=Q.parseValue(o[e])-Q.parseValue(n.css(e))+"px",v[e]=o[e],delete o[e])}),(T[0]||T[1])&&(n.data("revert",v),p.push("-webkit-transform"+s),Z(n,"translate3d("+T.join(",")+")","transform"))),w.each(o,function(t,e){p.push(t+s)}),Z(n,p.join(",")),n.css(o)}),2)):b.setTimeout(function(){e.complete.call(i[0])},e.duration)):i.animate(t,e)}),removeAlpha:function(t){if(t instanceof a&&(t=t[0]),O<9&&t){var e=t.style,i=t.currentStyle,n=i&&i.filter||e.filter||"";/alpha/.test(n)&&(e.filter=n.replace(/alpha\([^)]*\)/i,""))}},forceStyles:function(t,e){(t=w(t)).attr("style")&&t.data("styles",t.attr("style")).removeAttr("style"),t.css(e)},revertStyles:function(){w.each(Q.array(arguments),function(t,e){(e=w(e)).removeAttr("style"),e.attr("style",""),e.data("styles")&&e.attr("style",e.data("styles")).data("styles",null)})},moveOut:function(t){Q.forceStyles(t,{position:"absolute",left:-1e4})},moveIn:function(){Q.revertStyles.apply(Q,Q.array(arguments))},hide:function(t,e,i){i=i||r;var n=w(t);t=n[0],n.data("opacity")||n.data("opacity",n.css("opacity"));var a={opacity:0};if(e){var o=O<9&&t?function(){Q.removeAlpha(t),t.style.visibility="hidden",i.call(t)}:i;Q.animate(t,a,{duration:e,complete:o,stop:!0})}else O<9&&t?(Q.removeAlpha(t),t.style.visibility="hidden"):n.css(a)},show:function(t,e,i){i=i||r;var n=w(t);t=n[0];var a={opacity:parseFloat(n.data("opacity"))||1};if(e){O<9&&(n.css("opacity",0),t.style.visibility="visible");var o=O<9&&t?function(){1==a.opacity&&Q.removeAlpha(t),i.call(t)}:i;Q.animate(t,a,{duration:e,complete:o,stop:!0})}else O<9&&1==a.opacity&&t?(Q.removeAlpha(t),t.style.visibility="visible"):n.css(a)},wait:function(t){x._waiters=x._waiters||[],t=w.extend({until:s,success:r,error:function(){x.raise("Could not complete wait function.")},timeout:3e3},t);var e,i,n,a=Q.timestamp(),o=function(){return i=Q.timestamp(),e=i-a,Q.removeFromArray(x._waiters,n),t.until(e)?(t.success(),!1):"number"==typeof t.timeout&&i>=a+t.timeout?(t.error(),!1):void x._waiters.push(n=b.setTimeout(o,10))};x._waiters.push(n=b.setTimeout(o,10))},toggleQuality:function(t,e){7!==O&&8!==O||!t||"IMG"!=t.nodeName.toUpperCase()||(void 0===e&&(e="nearest-neighbor"===t.style.msInterpolationMode),t.style.msInterpolationMode=e?"bicubic":"nearest-neighbor")},insertStyleTag:function(t,e){if(!e||!w("#"+e).length){var i=A.createElement("style");if(e&&(i.id=e),_().head.appendChild(i),i.styleSheet)i.styleSheet.cssText=t;else{var n=A.createTextNode(t);i.appendChild(n)}}},loadScript:function(t,e){var i=!1,n=w("<script>").attr({src:t,async:!0}).get(0);n.onload=n.onreadystatechange=function(){i||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(i=!0,n.onload=n.onreadystatechange=null,"function"==typeof e&&e.call(this,this))},_().head.appendChild(n)},parseValue:function(t){if("number"==typeof t)return t;if("string"!=typeof t)return 0;var e=t.match(/\-?\d|\./g);return e&&e.constructor===Array?+e.join(""):0},timestamp:function(){return(new Date).getTime()},loadCSS:function(t,e,i){var n,a;if(w("link[rel=stylesheet]").each(function(){if(new RegExp(t).test(this.href))return n=this,!1}),"function"==typeof e&&(i=e,e=y),i=i||r,n)return i.call(n,n),n;if(a=A.styleSheets.length,w("#"+e).length)w("#"+e).attr("href",t),a--;else{n=w("<link>").attr({rel:"stylesheet",href:t,id:e}).get(0);var o=w('link[rel="stylesheet"], style');if(o.length?o.get(0).parentNode.insertBefore(n,o[0]):_().head.appendChild(n),O&&31<=a)return void x.raise("You have reached the browser stylesheet limit (31)",!0)}if("function"==typeof i){var s=w("<s>").attr("id","galleria-loader").hide().appendTo(_().body);Q.wait({until:function(){return 0<s.height()},success:function(){s.remove(),i.call(n,n)},error:function(){s.remove(),x.raise("Theme CSS could not load after 20 sec. "+(x.QUIRK?"Your browser is in Quirks Mode, please add a correct doctype.":"Please download the latest theme."),!0)},timeout:5e3})}return n}},K={active:!(S={_default:[.25,.1,.25,1],galleria:[.645,.045,.355,1],galleriaIn:[.55,.085,.68,.53],galleriaOut:[.25,.46,.45,.94],ease:[.25,0,.25,1],linear:[.25,.25,.75,.75],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]}),init:function(t,e,i){K.effects.hasOwnProperty(t)&&K.effects[t].call(this,e,i)},effects:{fade:function(t,e){w(t.next).css({opacity:0,left:0}),Q.animate(t.next,{opacity:1},{duration:t.speed,complete:e}),t.prev&&(w(t.prev).css("opacity",1).show(),Q.animate(t.prev,{opacity:0},{duration:t.speed}))},flash:function(t,e){w(t.next).css({opacity:0,left:0}),t.prev?Q.animate(t.prev,{opacity:0},{duration:t.speed/2,complete:function(){Q.animate(t.next,{opacity:1},{duration:t.speed,complete:e})}}):Q.animate(t.next,{opacity:1},{duration:t.speed,complete:e})},pulse:function(t,e){t.prev&&w(t.prev).hide(),w(t.next).css({opacity:0,left:0}).show(),Q.animate(t.next,{opacity:1},{duration:t.speed,complete:e})},slide:function(t,e){Y.apply(this,Q.array(arguments))},fadeslide:function(t,e){Y.apply(this,Q.array(arguments).concat([!0]))},doorslide:function(t,e){Y.apply(this,Q.array(arguments).concat([!1,!0]))}}};function Y(t,e,i,n){var a,o=this.getOptions("easing"),s=this.getStageWidth(),r={left:s*(t.rewind?-1:1)},c={left:0};i?(r.opacity=0,c.opacity=1):r.opacity=1,w(t.next).css(r),Q.animate(t.next,c,{duration:t.speed,complete:(a=w(t.next).add(t.prev),function(){e(),a.css({left:0})}),queue:!1,easing:o}),n&&(t.rewind=!t.rewind),t.prev&&(r={left:0},c={left:s*(t.rewind?1:-1)},i&&(r.opacity=1,c.opacity=0),w(t.prev).css(r),Q.animate(t.prev,c,{duration:t.speed,queue:!1,easing:o,complete:function(){w(this).css("opacity",0)}}))}function Z(t,e,i){var n={};i=i||"transition",w.each("webkit moz ms o".split(" "),function(){n["-"+this+"-"+i]=e}),t.css(n)}function J(t){Z(t,"none","transition"),x.WEBKIT&&x.TOUCH&&(Z(t,"translate3d(0,0,0)","transform"),t.data("revert")&&(t.css(t.data("revert")),t.data("revert",null)))}return q.listen(),w.event.special["click:fast"]={propagate:!0,add:function(i){function n(t){if(t.touches&&t.touches.length){var e=t.touches[0];return{x:e.pageX,y:e.pageY}}}var a={touched:!1,touchdown:!1,coords:{x:0,y:0},evObj:{}};w(this).data({clickstate:a,timer:0}).on("touchstart.fast",function(t){b.clearTimeout(w(this).data("timer")),w(this).data("clickstate",{touched:!0,touchdown:!0,coords:n(t.originalEvent),evObj:t})}).on("touchmove.fast",function(t){var e=n(t.originalEvent),i=w(this).data("clickstate");6<Math.max(Math.abs(i.coords.x-e.x),Math.abs(i.coords.y-e.y))&&w(this).data("clickstate",w.extend(i,{touchdown:!1}))}).on("touchend.fast",function(t){var e=w(this);e.data("clickstate").touchdown&&i.handler.call(this,t),e.data("timer",b.setTimeout(function(){e.data("clickstate",a)},400))}).on("click.fast",function(t){if(w(this).data("clickstate").touched)return!1;w(this).data("clickstate",a),i.handler.call(this,t)})},remove:function(){w(this).off("touchstart.fast touchmove.fast touchend.fast click.fast")}},z.on("orientationchange",function(){w(this).resize()}),(x=function(){var m=this;this._options={},this._playing=!1,this._playtime=5e3,this._active=null,this._queue={length:0},this._data=[],this._dom={},this._thumbnails=[],this._layers=[],this._initialized=!1,this._firstrun=!1,this._stageWidth=0,this._stageHeight=0,this._target=y,this._binds=[],this._id=parseInt(1e4*F.random(),10);w.each("container stage images image-nav image-nav-left image-nav-right info info-text info-title info-description thumbnails thumbnails-list thumbnails-container thumb-nav-left thumb-nav-right loader counter tooltip".split(" "),function(t,e){m._dom[e]=Q.create("galleria-"+e)}),w.each("current total".split(" "),function(t,e){m._dom[e]=Q.create("galleria-"+e,"span")});var n=this._keyboard={keys:{UP:38,DOWN:40,LEFT:37,RIGHT:39,RETURN:13,ESCAPE:27,BACKSPACE:8,SPACE:32},map:{},bound:!1,press:function(t){var e=t.keyCode||t.which;e in n.map&&"function"==typeof n.map[e]&&n.map[e].call(m,t)},attach:function(t){var e,i;for(e in t)t.hasOwnProperty(e)&&((i=e.toUpperCase())in n.keys?n.map[n.keys[i]]=t[e]:n.map[i]=t[e]);n.bound||(n.bound=!0,E.on("keydown",n.press))},detach:function(){n.bound=!1,n.map={},E.off("keydown",n.press)}},t=this._controls={0:y,1:y,active:0,swap:function(){t.active=t.active?0:1},getActive:function(){return m._options.swipe?t.slides[m._active]:t[t.active]},getNext:function(){return m._options.swipe?t.slides[m.getNext(m._active)]:t[1-t.active]},slides:[],frames:[],layers:[]},i=this._carousel={next:m.$("thumb-nav-right"),prev:m.$("thumb-nav-left"),width:0,current:0,max:0,hooks:[],update:function(){var n=0,a=0,o=[0];w.each(m._thumbnails,function(t,e){if(e.ready){n+=e.outerWidth||w(e.container).outerWidth(!0);var i=w(e.container).width();n+=i-F.floor(i),o[t+1]=n,a=F.max(a,e.outerHeight||w(e.container).outerHeight(!0))}}),m.$("thumbnails").css({width:n,height:a}),i.max=n,i.hooks=o,i.width=m.$("thumbnails-list").width(),i.setClasses(),m.$("thumbnails-container").toggleClass("galleria-carousel",n>i.width),i.width=m.$("thumbnails-list").width()},bindControls:function(){var e;i.next.on("click:fast",function(t){if(t.preventDefault(),"auto"===m._options.carouselSteps){for(e=i.current;e<i.hooks.length;e++)if(i.hooks[e]-i.hooks[i.current]>i.width){i.set(e-2);break}}else i.set(i.current+m._options.carouselSteps)}),i.prev.on("click:fast",function(t){if(t.preventDefault(),"auto"===m._options.carouselSteps)for(e=i.current;0<=e;e--){if(i.hooks[i.current]-i.hooks[e]>i.width){i.set(e+2);break}if(0===e){i.set(0);break}}else i.set(i.current-m._options.carouselSteps)})},set:function(t){for(t=F.max(t,0);i.hooks[t-1]+i.width>=i.max&&0<=t;)t--;i.current=t,i.animate()},getLast:function(t){return(t||i.current)-1},follow:function(t){if(0!==t&&t!==i.hooks.length-2){for(var e=i.current;i.hooks[e]-i.hooks[i.current]<i.width&&e<=i.hooks.length;)e++;t-1<i.current?i.set(t-1):e<t+2&&i.set(t-e+i.current+2)}else i.set(t)},setClasses:function(){i.prev.toggleClass("disabled",!i.current),i.next.toggleClass("disabled",i.hooks[i.current]+i.width>=i.max)},animate:function(t){i.setClasses();var e=-1*i.hooks[i.current];isNaN(e)||(m.$("thumbnails").css("left",function(){return w(this).css("left")}),Q.animate(m.get("thumbnails"),{left:e},{duration:m._options.carouselSpeed,easing:m._options.easing,queue:!1}))}},a=this._tooltip={initialized:!1,open:!1,timer:"tooltip"+m._id,swapTimer:"swap"+m._id,init:function(){a.initialized=!0;Q.insertStyleTag(".galleria-tooltip{padding:3px 8px;max-width:50%;background:#ffe;color:#000;z-index:3;position:absolute;font-size:11px;line-height:1.3;opacity:0;box-shadow:0 0 2px rgba(0,0,0,.4);-moz-box-shadow:0 0 2px rgba(0,0,0,.4);-webkit-box-shadow:0 0 2px rgba(0,0,0,.4);}","galleria-tooltip"),m.$("tooltip").css({opacity:.8,visibility:"visible",display:"none"})},move:function(t){var e=m.getMousePosition(t).x,i=m.getMousePosition(t).y,n=m.$("tooltip"),a=e,o=i,s=n.outerHeight(!0)+1,r=n.outerWidth(!0),c=s+15,l=m.$("container").width()-r-2,h=m.$("container").height()-s-2;isNaN(a)||isNaN(o)||(a+=10,o-=s+8,a=F.max(0,F.min(l,a)),o=F.max(0,F.min(h,o)),i<c&&(o=c),n.css({left:a,top:o}))},bind:function(t,e){if(!x.TOUCH){a.initialized||a.init();function i(){m.$("container").off("mousemove",a.move),m.clearTimer(a.timer),m.$("tooltip").stop().animate({opacity:0},200,function(){m.$("tooltip").hide(),m.addTimer(a.swapTimer,function(){a.open=!1},1e3)})}function n(t,e){a.define(t,e),w(t).hover(function(){m.clearTimer(a.swapTimer),m.$("container").off("mousemove",a.move).on("mousemove",a.move).trigger("mousemove"),a.show(t),m.addTimer(a.timer,function(){m.$("tooltip").stop().show().animate({opacity:1}),a.open=!0},a.open?0:500)},i).click(i)}"string"==typeof e?n(t in m._dom?m.get(t):t,e):w.each(t,function(t,e){n(m.get(t),e)})}},show:function(i){var t=(i=w(i in m._dom?m.get(i):i)).data("tt"),n=function(t){var e;b.setTimeout((e=t,function(){a.move(e)}),10),i.off("mouseup",n)};(t="function"==typeof t?t():t)&&(m.$("tooltip").html(t.replace(/\s/,"&#160;")),i.on("mouseup",n))},define:function(t,e){if("function"!=typeof e){var i=e;e=function(){return i}}t=w(t in m._dom?m.get(t):t).data("tt",e),a.show(t)}},v=this._fullscreen={scrolled:0,crop:y,active:!1,prev:w(),beforeEnter:function(t){t()},beforeExit:function(t){t()},keymap:m._keyboard.map,parseCallback:function(i,n){return K.active?function(){"function"==typeof i&&i.call(m);var t=m._controls.getActive(),e=m._controls.getNext();m._scaleImage(e),m._scaleImage(t),n&&m._options.trueFullscreen&&w(t.container).add(e.container).trigger("transitionend")}:i},enter:function(t){v.beforeEnter(function(){t=v.parseCallback(t,!0),m._options.trueFullscreen&&q.support?(v.active=!0,Q.forceStyles(m.get("container"),{width:"100%",height:"100%"}),m.rescale(),x.MAC?x.SAFARI&&/version\/[1-5]/.test(e)?(m.$("stage").css("opacity",0),b.setTimeout(function(){v.scale(),m.$("stage").css("opacity",1)},4)):(m.$("container").css("opacity",0).addClass("fullscreen"),b.setTimeout(function(){v.scale(),m.$("container").css("opacity",1)},50)):m.$("container").addClass("fullscreen"),z.resize(v.scale),q.enter(m,t,m.get("container"))):(v.scrolled=z.scrollTop(),x.TOUCH||b.scrollTo(0,0),v._enter(t))})},_enter:function(t){var e,i,n,a;v.active=!0,M&&(v.iframe=(i=A.referrer,n=A.createElement("a"),a=b.location,n.href=i,n.protocol!=a.protocol||n.hostname!=a.hostname||n.port!=a.port?(x.raise("Parent fullscreen not available. Iframe protocol, domains and ports must match."),!1):(v.pd=b.parent.document,w(v.pd).find("iframe").each(function(){if((this.contentDocument||this.contentWindow.document)===A)return e=this,!1}),e))),Q.hide(m.getActiveImage()),M&&v.iframe&&(v.iframe.scrolled=w(b.parent).scrollTop(),b.parent.scrollTo(0,0));var o=m.getData(),s=m._options,r=!m._options.trueFullscreen||!q.support,c={height:"100%",overflow:"hidden",margin:0,padding:0};if(r&&(m.$("container").addClass("fullscreen"),v.prev=m.$("container").prev(),v.prev.length||(v.parent=m.$("container").parent()),m.$("container").appendTo("body"),Q.forceStyles(m.get("container"),{position:x.TOUCH?"absolute":"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1e4}),Q.forceStyles(_().html,c),Q.forceStyles(_().body,c)),M&&v.iframe&&(Q.forceStyles(v.pd.documentElement,c),Q.forceStyles(v.pd.body,c),Q.forceStyles(v.iframe,w.extend(c,{width:"100%",height:"100%",top:0,left:0,position:"fixed",zIndex:1e4,border:"none"}))),v.keymap=w.extend({},m._keyboard.map),m.attachKeyboard({escape:m.exitFullscreen,right:m.next,left:m.prev}),v.crop=s.imageCrop,s.fullscreenCrop!=y&&(s.imageCrop=s.fullscreenCrop),o&&o.big&&o.image!==o.big){var l=new x.Picture,h=l.isCached(o.big),u=m.getIndex(),d=m._thumbnails[u];m.trigger({type:x.LOADSTART,cached:h,rewind:!1,index:u,imageTarget:m.getActiveImage(),thumbTarget:d,galleriaData:o}),l.load(o.big,function(t){m._scaleImage(t,{complete:function(t){m.trigger({type:x.LOADFINISH,cached:h,index:u,rewind:!1,imageTarget:t.image,thumbTarget:d});var e=m._controls.getActive().image;e&&(w(e).width(t.image.width).height(t.image.height).attr("style",w(t.image).attr("style")),t.image.src.srcset&&w(e).attr("srcset",t.image.src.srcset),t.image.src.sizes&&w(e).attr("sizes",t.image.src.sizes),w(e).attr("src",t.image.src))}})});var p=m.getNext(u),g=new x.Picture,f=m.getData(p);g.preload(m.isFullscreen()&&f.big?f.big:f.image)}m.rescale(function(){m.addTimer(!1,function(){r&&Q.show(m.getActiveImage()),"function"==typeof t&&t.call(m),m.rescale()},100),m.trigger(x.FULLSCREEN_ENTER)}),r?z.resize(v.scale):Q.show(m.getActiveImage())},scale:function(){m.rescale()},exit:function(t){v.beforeExit(function(){t=v.parseCallback(t),m._options.trueFullscreen&&q.support?q.exit(t):v._exit(t)})},_exit:function(t){v.active=!1;var e=!m._options.trueFullscreen||!q.support,i=m.$("container").removeClass("fullscreen");if(v.parent?v.parent.prepend(i):i.insertAfter(v.prev),e){Q.hide(m.getActiveImage()),Q.revertStyles(m.get("container"),_().html,_().body),x.TOUCH||b.scrollTo(0,v.scrolled);var n=m._controls.frames[m._controls.active];n&&n.image&&(n.image.src=n.image.src)}M&&v.iframe&&(Q.revertStyles(v.pd.documentElement,v.pd.body,v.iframe),v.iframe.scrolled&&b.parent.scrollTo(0,v.iframe.scrolled)),m.detachKeyboard(),m.attachKeyboard(v.keymap),m._options.imageCrop=v.crop;var a,o=m.getData().big,s=m._controls.getActive().image;!m.getData().iframe&&s&&o&&o==s.src&&b.setTimeout((a=m.getData().image,function(){s.src=a}),1),m.rescale(function(){m.addTimer(!1,function(){e&&Q.show(m.getActiveImage()),"function"==typeof t&&t.call(m),z.trigger("resize")},50),m.trigger(x.FULLSCREEN_EXIT)}),z.off("resize",v.scale)}},s=this._idle={trunk:[],bound:!1,active:!1,add:function(t,e,i,n){if(t&&!x.TOUCH){s.bound||s.addEvent(),t=w(t),"boolean"==typeof i&&(n=i,i={}),i=i||{};var a,o={};for(a in e)e.hasOwnProperty(a)&&(o[a]=t.css(a));t.data("idle",{from:w.extend(o,i),to:e,complete:!0,busy:!1}),n?t.css(e):s.addTimer(),s.trunk.push(t)}},remove:function(i){i=w(i),w.each(s.trunk,function(t,e){e&&e.length&&!e.not(i).length&&(i.css(i.data("idle").from),s.trunk.splice(t,1))}),s.trunk.length||(s.removeEvent(),m.clearTimer(s.timer))},addEvent:function(){s.bound=!0,m.$("container").on("mousemove click",s.showAll),"hover"==m._options.idleMode&&m.$("container").on("mouseleave",s.hide)},removeEvent:function(){s.bound=!1,m.$("container").on("mousemove click",s.showAll),"hover"==m._options.idleMode&&m.$("container").off("mouseleave",s.hide)},addTimer:function(){"hover"!=m._options.idleMode&&m.addTimer("idle",function(){s.hide()},m._options.idleTime)},hide:function(){if(m._options.idleMode&&!1!==m.getIndex()){m.trigger(x.IDLE_ENTER);var n=s.trunk.length;w.each(s.trunk,function(t,e){var i=e.data("idle");i&&(e.data("idle").complete=!1,Q.animate(e,i.to,{duration:m._options.idleSpeed,complete:function(){t==n-1&&(s.active=!1)}}))})}},showAll:function(){m.clearTimer("idle"),w.each(s.trunk,function(t,e){s.show(e)})},show:function(t){var e=t.data("idle");s.active&&(e.busy||e.complete)||(e.busy=!0,m.trigger(x.IDLE_EXIT),m.clearTimer("idle"),Q.animate(t,e.from,{duration:m._options.idleSpeed/2,complete:function(){s.active=!0,w(t).data("idle").busy=!1,w(t).data("idle").complete=!0}})),s.addTimer()}},h=this._lightbox={width:0,height:0,initialized:!1,active:null,image:null,elems:{},keymap:!1,init:function(){if(!h.initialized){h.initialized=!0;var a={},t=m._options,i="",e="position:absolute;",n="lightbox-",o={overlay:"position:fixed;display:none;opacity:"+t.overlayOpacity+";filter:alpha(opacity="+100*t.overlayOpacity+");top:0;left:0;width:100%;height:100%;background:"+t.overlayBackground+";z-index:99990",box:"position:fixed;display:none;width:400px;height:400px;top:50%;left:50%;margin-top:-200px;margin-left:-200px;z-index:99991",shadow:e+"background:#000;width:100%;height:100%;",content:e+"background-color:#fff;top:10px;left:10px;right:10px;bottom:10px;overflow:hidden",info:e+"bottom:10px;left:10px;right:10px;color:#444;font:11px/13px arial,sans-serif;height:13px",close:e+"top:10px;right:10px;height:20px;width:20px;background:#fff;text-align:center;cursor:pointer;color:#444;font:16px/22px arial,sans-serif;z-index:99999",image:e+"top:10px;left:10px;right:10px;bottom:30px;overflow:hidden;display:block;",prevholder:e+"width:50%;top:0;bottom:40px;cursor:pointer;",nextholder:e+"width:50%;top:0;bottom:40px;right:-1px;cursor:pointer;",prev:e+"top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;left:20px;display:none;text-align:center;color:#000;font:bold 16px/36px arial,sans-serif",next:e+"top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;right:20px;left:auto;display:none;font:bold 16px/36px arial,sans-serif;text-align:center;color:#000",title:"float:left",counter:"float:right;margin-left:8px;"},s={},r="";r=7<O?O<9?"background:#000;filter:alpha(opacity=0);":"background:rgba(0,0,0,0);":"z-index:99999",o.nextholder+=r,o.prevholder+=r,w.each(o,function(t,e){i+=".galleria-"+n+t+"{"+e+"}"}),i+=".galleria-"+n+"box.iframe .galleria-"+n+"prevholder,.galleria-"+n+"box.iframe .galleria-"+n+"nextholder{width:100px;height:100px;top:50%;margin-top:-70px}",Q.insertStyleTag(i,"galleria-lightbox"),w.each("overlay box content shadow title info close prevholder prev nextholder next counter image".split(" "),function(t,e){m.addElement("lightbox-"+e),a[e]=h.elems[e]=m.get("lightbox-"+e)}),h.image=new x.Picture,w.each({box:"shadow content close prevholder nextholder",info:"title counter",content:"info image",prevholder:"prev",nextholder:"next"},function(t,e){var i=[];w.each(e.split(" "),function(t,e){i.push(n+e)}),s[n+t]=i}),m.append(s),w(a.image).append(h.image.container),w(_().body).append(a.overlay,a.box),w(a.close).on("click:fast",h.hide).html("&#215;").hover(function(){w(this).css("color","#bbb")},function(){w(this).css("color","#444")}),w.each(["Prev","Next"],function(t,e){var i=w(a[e.toLowerCase()]).html(/v/.test(e)?"&#8249;&#160;":"&#160;&#8250;"),n=w(a[e.toLowerCase()+"holder"]);n.on("click:fast",function(){h["show"+e]()}),O<8||x.TOUCH?i.show():n.hover(function(){i.show()},function(t){i.stop().fadeOut(200)})}),w(a.overlay).on("click:fast",h.hide),x.IPAD&&(m._options.lightboxTransitionSpeed=0)}},rescale:function(t){var e=F.min(z.width()-40,h.width),i=F.min(z.height()-60,h.height),n=F.min(e/h.width,i/h.height),a=F.round(h.width*n)+40,o=F.round(h.height*n)+60,s={width:a,height:o,"margin-top":-1*F.ceil(o/2),"margin-left":-1*F.ceil(a/2)};t?w(h.elems.box).css(s):w(h.elems.box).animate(s,{duration:m._options.lightboxTransitionSpeed,easing:m._options.easing,complete:function(){var t=h.image,e=m._options.lightboxFadeSpeed;m.trigger({type:x.LIGHTBOX_IMAGE,imageTarget:t.image}),w(t.container).show(),w(t.image).animate({opacity:1},e),Q.show(h.elems.info,e)}})},hide:function(){h.image.image=null,z.off("resize",h.rescale),w(h.elems.box).hide().find("iframe").remove(),Q.hide(h.elems.info),m.detachKeyboard(),m.attachKeyboard(h.keymap),h.keymap=!1,Q.hide(h.elems.overlay,200,function(){w(this).hide().css("opacity",m._options.overlayOpacity),m.trigger(x.LIGHTBOX_CLOSE)})},showNext:function(){h.show(m.getNext(h.active))},showPrev:function(){h.show(m.getPrev(h.active))},show:function(r){h.active=r="number"==typeof r?r:m.getIndex()||0,h.initialized||h.init(),m.trigger(x.LIGHTBOX_OPEN),h.keymap||(h.keymap=w.extend({},m._keyboard.map),m.attachKeyboard({escape:h.hide,right:h.showNext,left:h.showPrev})),z.off("resize",h.rescale);var t,e,i,c=m.getData(r),l=m.getDataLength(),n=m.getNext(r);Q.hide(h.elems.info);try{for(i=m._options.preload;0<i;i--)e=new x.Picture,t=m.getData(n),e.preload(t.big?t.big:t.image),n=m.getNext(n)}catch(t){}h.image.isIframe=c.iframe&&!c.image,w(h.elems.box).toggleClass("iframe",h.image.isIframe),w(h.image.container).find(".galleria-videoicon").remove(),h.image.load(c.big||c.image||c.iframe,function(t){if(t.isIframe){var e=w(b).width(),i=w(b).height();if(t.video&&m._options.maxVideoSize){var n=F.min(m._options.maxVideoSize/e,m._options.maxVideoSize/i);n<1&&(e*=n,i*=n)}h.width=e,h.height=i}else h.width=t.original.width,h.height=t.original.height;if(w(t.image).css({width:t.isIframe?"100%":"100.1%",height:t.isIframe?"100%":"100.1%",top:0,bottom:0,zIndex:99998,opacity:0,visibility:"visible"}).parent().height("100%"),h.elems.title.innerHTML=c.title||"",h.elems.counter.innerHTML=r+1+" / "+l,z.resize(h.rescale),h.rescale(),c.image&&c.iframe){if(w(h.elems.box).addClass("iframe"),c.video){var a=f(t.container).hide();b.setTimeout(function(){a.fadeIn(200)},200)}w(t.image).css("cursor","pointer").mouseup((o=c,s=t,function(t){w(h.image.container).find(".galleria-videoicon").remove(),t.preventDefault(),s.isIframe=!0,s.load(o.iframe+(o.video?"&autoplay=1":""),{width:"100%",height:O<8?w(h.image.container).height():"100%"})}))}var o,s}),w(h.elems.overlay).show().css("visibility","visible"),w(h.elems.box).show()}},o=this._timer={trunk:{},add:function(t,e,i,n){if(t=t||(new Date).getTime(),n=n||!1,this.clear(t),n){var a=e;e=function(){a(),o.add(t,e,i)}}this.trunk[t]=b.setTimeout(e,i)},clear:function(t){function e(t){b.clearTimeout(this.trunk[t]),delete this.trunk[t]}var i;if(t&&t in this.trunk)e.call(this,t);else if(void 0===t)for(i in this.trunk)this.trunk.hasOwnProperty(i)&&e.call(this,i)}};return this}).prototype={constructor:x,init:function(t,e){if(e=c(e),this._original={target:t,options:e,data:null},this._target=this._dom.target=t.nodeName?t:w(t).get(0),this._original.html=this._target.innerHTML,V.push(this),this._target){if(this._options={autoplay:!1,carousel:!0,carouselFollow:!0,carouselSpeed:400,carouselSteps:"auto",clicknext:!1,dailymotion:{foreground:"%23EEEEEE",highlight:"%235BCEC5",background:"%23222222",logo:0,hideInfos:1},dataConfig:function(t){return{}},dataSelector:"img",dataSort:!1,dataSource:this._target,debug:y,dummy:y,easing:"galleria",extend:function(t){},fullscreenCrop:y,fullscreenDoubleTap:!0,fullscreenTransition:y,height:0,idleMode:!0,idleTime:3e3,idleSpeed:200,imageCrop:!1,imageMargin:0,imagePan:!1,imagePanSmoothness:12,imagePosition:"50%",imageTimeout:y,initialTransition:y,keepSource:!1,layerFollow:!0,lightbox:!1,lightboxFadeSpeed:200,lightboxTransitionSpeed:200,linkSourceImages:!0,maxScaleRatio:y,maxVideoSize:y,minScaleRatio:y,overlayOpacity:.85,overlayBackground:"#0b0b0b",pauseOnInteraction:!0,popupLinks:!1,preload:2,queue:!0,responsive:!0,show:0,showInfo:!0,showCounter:!0,showImagenav:!0,swipe:"auto",theme:null,thumbCrop:!0,thumbEventType:"click:fast",thumbMargin:0,thumbQuality:"auto",thumbDisplayOrder:!0,thumbPosition:"50%",thumbnails:!0,touchTransition:y,transition:"fade",transitionInitial:y,transitionSpeed:400,trueFullscreen:!0,useCanvas:!1,variation:"",videoPoster:!0,vimeo:{title:0,byline:0,portrait:0,color:"aaaaaa"},wait:5e3,width:"auto",youtube:{modestbranding:1,autohide:1,color:"white",hd:1,rel:0,showinfo:0}},this._options.initialTransition=this._options.initialTransition||this._options.transitionInitial,e&&(!1===e.debug&&(o=!1),"number"==typeof e.imageTimeout&&e.imageTimeout,"string"==typeof e.dummy&&(L=e.dummy),"string"==typeof e.theme&&(this._options.theme=e.theme)),w(this._target).children().hide(),x.QUIRK&&x.raise("Your page is in Quirks mode, Galleria may not render correctly. Please validate your HTML and add a correct doctype."),G.length)if(this._options.theme){for(var i=0;i<G.length;i++)if(this._options.theme===G[i].name){this.theme=G[i];break}}else this.theme=G[0];return"object"==typeof this.theme?this._init():B.push(this),this}x.raise("Target not found",!0)},_init:function(){var t,e,i,n,a,o,s,r,c=this,l=this._options;if(this._initialized)return x.raise("Init failed: Gallery instance already initialized."),this;if(this._initialized=!0,!this.theme)return x.raise("Init failed: No theme found.",!0),this;if(w.extend(!0,l,this.theme.defaults,this._original.options,x.configure.options),l.swipe="enforced"==(t=l.swipe)||!1!==t&&"disabled"!=t&&!!x.TOUCH,l.swipe&&(l.clicknext=!1,l.imagePan=!1),"getContext"in(e=A.createElement("canvas"))?X=X||{elem:e,context:e.getContext("2d"),cache:{},length:0}:e=null,this.bind(x.DATA,function(){b.screen&&b.screen.width&&Array.prototype.forEach&&this._data.forEach(function(t){var e="devicePixelRatio"in b?b.devicePixelRatio:1;F.max(b.screen.width,b.screen.height)*e<1024&&(t.big=t.image)}),this._original.data=this._data,this.get("total").innerHTML=this.getDataLength();var t=this.$("container");c._options.height<2&&(c._userRatio=c._ratio=c._options.height);function e(){return c.$("stage").height()}var i={width:0,height:0};Q.wait({until:function(){return i=c._getWH(),t.width(i.width).height(i.height),e()&&i.width&&50<i.height},success:function(){c._width=i.width,c._height=i.height,c._ratio=c._ratio||i.height/i.width,x.WEBKIT?b.setTimeout(function(){c._run()},1):c._run()},error:function(){e()?x.raise("Could not extract sufficient width/height of the gallery container. Traced measures: width:"+i.width+"px, height: "+i.height+"px.",!0):x.raise("Could not extract a stage height from the CSS. Traced height: "+e()+"px.",!0)},timeout:"number"==typeof this._options.wait&&this._options.wait})}),this.append({"info-text":["info-title","info-description"],info:["info-text"],"image-nav":["image-nav-right","image-nav-left"],stage:["images","loader","counter","image-nav"],"thumbnails-list":["thumbnails"],"thumbnails-container":["thumb-nav-left","thumbnails-list","thumb-nav-right"],container:["stage","thumbnails-container","info","tooltip"]}),Q.hide(this.$("counter").append(this.get("current"),A.createTextNode(" / "),this.get("total"))),this.setCounter("&#8211;"),Q.hide(c.get("tooltip")),this.$("container").addClass([x.TOUCH?"touch":"notouch",this._options.variation,"galleria-theme-"+this.theme.name].join(" ")),this._options.swipe||w.each(new Array(2),function(t){var e=new x.Picture;w(e.container).css({position:"absolute",top:0,left:0}).prepend(c._layers[t]=w(Q.create("galleria-layer")).css({position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:2})[0]),c.$("images").append(e.container),c._controls[t]=e;var i=new x.Picture;i.isIframe=!0,w(i.container).attr("class","galleria-frame").css({position:"absolute",top:0,left:0,zIndex:4,background:"#000",display:"none"}).appendTo(e.container),c._controls.frames[t]=i}),this.$("images").css({position:"relative",top:0,left:0,width:"100%",height:"100%"}),l.swipe&&(this.$("images").css({position:"absolute",top:0,left:0,width:0,height:"100%"}),this.finger=new x.Finger(this.get("stage"),{onchange:function(t){c.pause().show(t)},oncomplete:function(t){var e=F.max(0,F.min(parseInt(t,10),c.getDataLength()-1)),i=c.getData(e);w(c._thumbnails[e].container).addClass("active").siblings(".active").removeClass("active"),i&&(c.$("images").find(".galleria-frame").css("opacity",0).hide().find("iframe").remove(),c._options.carousel&&c._options.carouselFollow&&c._carousel.follow(e))}}),this.bind(x.RESCALE,function(){this.finger.setup()}),this.$("stage").on("click",function(t){var e=c.getData();if(e){if(e.iframe){c.isPlaying()&&c.pause();var i=c._controls.frames[c._active],n=c._stageWidth,a=c._stageHeight;if(w(i.container).find("iframe").length)return;return w(i.container).css({width:n,height:a,opacity:0}).show().animate({opacity:1},200),void b.setTimeout(function(){i.load(e.iframe+(e.video?"&autoplay=1":""),{width:n,height:a},function(t){c.$("container").addClass("videoplay"),t.scale({width:c._stageWidth,height:c._stageHeight,iframelimit:e.video?c._options.maxVideoSize:y})})},100)}if(e.link)if(c._options.popupLinks)b.open(e.link,"_blank");else b.location.href=e.link;else;}}),this.bind(x.IMAGE,function(t){c.setCounter(t.index),c.setInfo(t.index);var e=this.getNext(),i=this.getPrev(),n=[i,e];n.push(this.getNext(e),this.getPrev(i),c._controls.slides.length-1);var a=[];w.each(n,function(t,e){-1==w.inArray(e,a)&&a.push(e)}),w.each(a,function(t,e){var i=c.getData(e),n=c._controls.slides[e],a=c.isFullscreen()&&i.big?i.big:i.image||i.iframe;i.iframe&&!i.image&&(n.isIframe=!0),n.ready||c._controls.slides[e].load(a,function(t){t.isIframe||w(t.image).css("visibility","hidden"),c._scaleImage(t,{complete:function(t){t.isIframe||w(t.image).css({opacity:0,visibility:"visible"}).animate({opacity:1},200)}})})})})),this.$("thumbnails, thumbnails-list").css({overflow:"hidden",position:"relative"}),this.$("image-nav-right, image-nav-left").on("click:fast",function(t){l.pauseOnInteraction&&c.pause();var e=/right/.test(this.className)?"next":"prev";c[e]()}).on("click",function(t){t.preventDefault(),(l.clicknext||l.swipe)&&t.stopPropagation()}),w.each(["info","counter","image-nav"],function(t,e){!1===l["show"+e.substr(0,1).toUpperCase()+e.substr(1).replace(/-/,"")]&&Q.moveOut(c.get(e.toLowerCase()))}),this.load(),l.keepSource||O||(this._target.innerHTML=""),this.get("errors")&&this.appendChild("target","errors"),this.appendChild("target","container"),l.carousel){var h=0,u=l.show;this.bind(x.THUMBNAIL,function(){this.updateCarousel(),++h==this.getDataLength()&&"number"==typeof u&&0<u&&this._carousel.follow(u)})}function d(t){return t.originalEvent.touches?t.originalEvent.touches[0]:t}return l.responsive&&z.on("resize",function(){c.isFullscreen()||c.resize()}),l.fullscreenDoubleTap&&this.$("stage").on("touchstart",(c.$("stage").on("touchmove",function(){i=0}),function(t){if(!/(-left|-right)/.test(t.target.className)){if(r=Q.timestamp(),n=d(t).pageX,a=d(t).pageY,t.originalEvent.touches.length<2&&r-i<300&&n-o<20&&a-s<20)return c.toggleFullscreen(),void t.preventDefault();i=r,o=n,s=a}})),w.each(x.on.binds,function(t,e){-1==w.inArray(e.hash,c._binds)&&c.bind(e.type,e.callback)}),this},addTimer:function(){return this._timer.add.apply(this._timer,Q.array(arguments)),this},clearTimer:function(){return this._timer.clear.apply(this._timer,Q.array(arguments)),this},_getWH:function(){var i,n=this.$("container"),a=this.$("target"),o=this,s={};return w.each(["width","height"],function(t,e){o._options[e]&&"number"==typeof o._options[e]?s[e]=o._options[e]:(i=[Q.parseValue(n.css(e)),Q.parseValue(a.css(e)),n[e](),a[e]()],o["_"+e]||i.splice(i.length,Q.parseValue(n.css("min-"+e)),Q.parseValue(a.css("min-"+e))),s[e]=F.max.apply(F,i))}),o._userRatio&&(s.height=s.width*o._userRatio),s},_createThumbnails:function(t){this.get("total").innerHTML=this.getDataLength();function e(t){return A.defaultView&&A.defaultView.getComputedStyle?A.defaultView.getComputedStyle(s.container,null)[t]:l.css(t)}function i(t,e,i){return function(){w(i).append(t),u.trigger({type:x.THUMBNAIL,thumbTarget:t,index:e,galleriaData:u.getData(e)})}}function n(t){d.pauseOnInteraction&&u.pause();var e=w(t.currentTarget).data("index");u.getIndex()!==e&&u.show(e),t.preventDefault()}function r(t,e){w(t.container).css("visibility","visible"),u.trigger({type:x.THUMBNAIL,thumbTarget:t.image,index:t.data.order,galleriaData:u.getData(t.data.order)}),"function"==typeof e&&e.call(u,t)}function a(t,s){t.scale({width:t.data.width,height:t.data.height,crop:d.thumbCrop,margin:d.thumbMargin,canvas:d.useCanvas,position:d.thumbPosition,complete:function(i){var n,a,o=["left","top"];u.getData(i.index);w.each(["Width","Height"],function(t,e){n=e.toLowerCase(),!0===d.thumbCrop&&d.thumbCrop!==n||((a={})[n]=i[n],w(i.container).css(a),(a={})[o[t]]=0,w(i.image).css(a)),i["outer"+e]=w(i.container)["outer"+e](!0)}),Q.toggleQuality(i.image,!0===d.thumbQuality||"auto"===d.thumbQuality&&i.original.width<3*i.width),d.thumbDisplayOrder&&!i.lazy?w.each(f,function(t,e){if(t===m&&e.ready&&!e.displayed)return m++,e.displayed=!0,void r(e,s)}):r(i,s)}})}var o,s,c,l,h,u=this,d=this._options,p=t?this._data.length-t.length:0,g=p,f=[],m=0,v=O<8?"http://upload.wikimedia.org/wikipedia/commons/c/c0/Blank.gif":"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D",y=!!(h=u.$("thumbnails").find(".active")).length&&h.find("img").attr("src"),_="string"==typeof d.thumbnails?d.thumbnails.toLowerCase():null;for(t||(this._thumbnails=[],this.$("thumbnails").empty());this._data[p];p++)o=(c=this._data[p]).thumb||c.image,!0!==d.thumbnails&&"lazy"!=_||!c.thumb&&!c.image?c.iframe&&null!==_||"empty"===_||"numbers"===_?(s={container:Q.create("galleria-image"),image:Q.create("img","span"),ready:!0,data:{order:p}},"numbers"===_&&w(s.image).text(p+1),c.iframe&&w(s.image).addClass("iframe"),this.$("thumbnails").append(s.container),b.setTimeout(i(s.image,p,s.container),50+20*p)):s={container:null,image:null}:((s=new x.Picture(p)).index=p,s.displayed=!1,s.lazy=!1,s.video=!1,this.$("thumbnails").append(s.container),(l=w(s.container)).css("visibility","hidden"),s.data={width:Q.parseValue(e("width")),height:Q.parseValue(e("height")),order:p,src:o},!0!==d.thumbCrop?l.css({width:"auto",height:"auto"}):l.css({width:s.data.width,height:s.data.height}),"lazy"==_?(l.addClass("lazy"),s.lazy=!0,s.load(v,{height:s.data.height,width:s.data.width})):s.load(o,a),"all"===d.preload&&s.preload(c.image)),w(s.container).add(d.keepSource&&d.linkSourceImages?c.original:null).data("index",p).on(d.thumbEventType,n).data("thumbload",a),y===o&&w(s.container).addClass("active"),this._thumbnails.push(s);return f=this._thumbnails.slice(g),this},lazyLoad:function(t,s){var r=t.constructor==Array?t:[t],c=this,l=0;return w.each(r,function(t,e){if(!(e>c._thumbnails.length-1)){function i(){++l==r.length&&"function"==typeof s&&s.call(c)}var n=c._thumbnails[e],a=n.data,o=w(n.container).data("thumbload");o&&(n.video?o.call(c,n,i):n.load(a.src,function(t){o.call(c,t,i)}))}}),this},lazyLoadChunks:function(t,i){var e=this.getDataLength(),n=0,a=0,o=[],s=[],r=this;for(i=i||0;n<e;n++)s.push(n),++a!=t&&n!=e-1||(o.push(s),a=0,s=[]);var c=function(t){var e=o.shift();e&&b.setTimeout(function(){r.lazyLoad(e,function(){c(!0)})},i&&t?i:0)};return c(!1),this},_run:function(){var o=this;o._createThumbnails(),Q.wait({timeout:1e4,until:function(){return x.OPERA&&o.$("stage").css("display","inline-block"),o._stageWidth=o.$("stage").width(),o._stageHeight=o.$("stage").height(),o._stageWidth&&50<o._stageHeight},success:function(){if(U.push(o),o._options.swipe){var a=o.$("images").width(o.getDataLength()*o._stageWidth);w.each(new Array(o.getDataLength()),function(t){var e=new x.Picture,i=o.getData(t);w(e.container).css({position:"absolute",top:0,left:o._stageWidth*t}).prepend(o._layers[t]=w(Q.create("galleria-layer")).css({position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:2})[0]).appendTo(a),i.video&&f(e.container),o._controls.slides.push(e);var n=new x.Picture;n.isIframe=!0,w(n.container).attr("class","galleria-frame").css({position:"absolute",top:0,left:0,zIndex:4,background:"#000",display:"none"}).appendTo(e.container),o._controls.frames.push(n)}),o.finger.setup()}if(Q.show(o.get("counter")),o._options.carousel&&o._carousel.bindControls(),o._options.autoplay&&(o.pause(),"number"==typeof o._options.autoplay&&(o._playtime=o._options.autoplay),o._playing=!0),o._firstrun)return o._options.autoplay&&o.trigger(x.PLAY),void("number"==typeof o._options.show&&o.show(o._options.show));o._firstrun=!0,x.History&&x.History.change(function(t){isNaN(t)?b.history.go(-1):o.show(t,y,!0)}),o.trigger(x.READY),o.theme.init.call(o,o._options),w.each(x.ready.callbacks,function(t,e){"function"==typeof e&&e.call(o,o._options)}),o._options.extend.call(o,o._options),/^[0-9]{1,4}$/.test($)&&x.History?o.show($,y,!0):o._data[o._options.show]&&o.show(o._options.show),o._options.autoplay&&o.trigger(x.PLAY)},error:function(){x.raise("Stage width or height is too small to show the gallery. Traced measures: width:"+o._stageWidth+"px, height: "+o._stageHeight+"px.",!0)}})},load:function(t,e,s){var r=this,i=this._options;return this._data=[],this._thumbnails=[],this.$("thumbnails").empty(),"function"==typeof e&&(s=e,e=null),t=t||i.dataSource,e=e||i.dataSelector,s=s||i.dataConfig,w.isPlainObject(t)&&(t=[t]),w.isArray(t)?this.validate(t)?this._data=t:x.raise("Load failed: JSON Array not valid."):(e+=",.video,.iframe",w(t).find(e).each(function(t,i){i=w(i);var n={},e=i.parent(),a=e.attr("href"),o=e.attr("rel");a&&("IMG"==i[0].nodeName||i.hasClass("video"))&&h(a)?n.video=a:a&&i.hasClass("iframe")?n.iframe=a:n.image=a,o&&(n.big=o),n.imagesrcset=e.data("srcset"),n.imagesizes=e.data("sizes"),n.thumbsizes=i.attr("sizes"),n.thumbsrcset=i.attr("srcset"),w.each("big bigsrcset bigsizes title description link layer image imagesrcset imagesizes".split(" "),function(t,e){i.data(e)&&(n[e]=i.data(e).toString())}),i.data("srcset")&&(n.imagesrcset=i.data("srcset")),i.data("sizes")&&(n.imagesizes=i.data("sizes")),n.big||(n.big=n.image,n.bigsrcset=n.imagesrcset,n.bigsizes=n.imagesizes),r._data.push(w.extend({title:i.attr("title")||"",thumb:i.attr("src"),image:i.attr("src"),big:i.attr("src"),description:i.attr("alt")||"",link:i.attr("longdesc"),original:i.get(0)},n,s(i)))})),"function"==typeof i.dataSort?D.sort.call(this._data,i.dataSort):"random"==i.dataSort&&this._data.sort(function(){return F.round(F.random())-.5}),this.getDataLength()&&this._parseData(function(){this.trigger(x.DATA)}),this},_parseData:function(t){function s(){var i=!0;w.each(c._data,function(t,e){if(e.loading)return i=!1}),i&&!e&&(e=!0,t.call(c))}var r,c=this,e=!1;return w.each(this._data,function(t,i){if(r=c._data[t],w.each("big image thumb".split(" "),function(t,e){i[e]&&(i[e]=new String(i[e]),i[e].srcset=i[e+"srcset"],i[e].sizes=i[e+"sizes"])}),"thumb"in i==!1&&(r.thumb=i.image),i.big||(r.big=i.image),"video"in i){var o=h(i.video);o&&(r.iframe=new l(o.provider,o.id).embed()+function(){if("object"!=typeof c._options[o.provider])return"";var i=[];return w.each(c._options[o.provider],function(t,e){i.push(t+"="+e)}),"youtube"==o.provider&&(i=["wmode=opaque"].concat(i)),"?"+i.join("&")}(),r.thumb&&r.image||w.each(["thumb","image"],function(t,e){if("image"!=e||c._options.videoPoster){var i,n,a=new l(o.provider,o.id);r[e]||(r.loading=!0,a.getMedia(e,(i=r,n=e,function(t){i[n]=t,"image"!=n||i.big||(i.big=i.image),delete i.loading,s()})))}else r.image=y}))}}),s(),this},destroy:function(){return this.$("target").data("galleria",null),this.$("container").off("galleria"),this.get("target").innerHTML=this._original.html,this.clearTimer(),Q.removeFromArray(V,this),Q.removeFromArray(U,this),W._inst=[],void 0!==x._waiters&&x._waiters.length&&w.each(x._waiters,function(t,e){e&&b.clearTimeout(e)}),this},splice:function(){var t=this,e=Q.array(arguments);return b.setTimeout(function(){D.splice.apply(t._data,e),t._parseData(function(){t._createThumbnails()})},2),t},push:function(){var t=this,e=Q.array(arguments);return 1==e.length&&e[0].constructor==Array&&(e=e[0]),b.setTimeout(function(){D.push.apply(t._data,e),t._parseData(function(){t._createThumbnails(e)})},2),t},_getActive:function(){return this._controls.getActive()},validate:function(t){return!0},bind:function(t,e){return t=i(t),this.$("container").on(t,this.proxy(e)),this},unbind:function(t){return t=i(t),this.$("container").off(t),this},trigger:function(t){return t="object"==typeof t?w.extend(t,{scope:this}):{type:i(t),scope:this},this.$("container").trigger(t),this},addIdleState:function(t,e,i,n){return this._idle.add.apply(this._idle,Q.array(arguments)),this},removeIdleState:function(t){return this._idle.remove.apply(this._idle,Q.array(arguments)),this},enterIdleMode:function(){return this._idle.hide(),this},exitIdleMode:function(){return this._idle.showAll(),this},enterFullscreen:function(t){return this._fullscreen.enter.apply(this,Q.array(arguments)),this},exitFullscreen:function(t){return this._fullscreen.exit.apply(this,Q.array(arguments)),this},toggleFullscreen:function(t){return this._fullscreen[this.isFullscreen()?"exit":"enter"].apply(this,Q.array(arguments)),this},bindTooltip:function(t,e){return this._tooltip.bind.apply(this._tooltip,Q.array(arguments)),this},defineTooltip:function(t,e){return this._tooltip.define.apply(this._tooltip,Q.array(arguments)),this},refreshTooltip:function(t){return this._tooltip.show.apply(this._tooltip,Q.array(arguments)),this},openLightbox:function(){return this._lightbox.show.apply(this._lightbox,Q.array(arguments)),this},closeLightbox:function(){return this._lightbox.hide.apply(this._lightbox,Q.array(arguments)),this},hasVariation:function(t){return-1<w.inArray(t,this._options.variation.split(/\s+/))},getActiveImage:function(){var t=this._getActive();return t?t.image:y},getActiveThumb:function(){return this._thumbnails[this._active].image||y},getMousePosition:function(t){return{x:t.pageX-this.$("container").offset().left,y:t.pageY-this.$("container").offset().top}},addPan:function(a){if(!1!==this._options.imageCrop){a=w(a||this.getActiveImage());function e(t,e,i){if(0<t&&(f=F.round(F.max(-1*t,F.min(0,e))),g!==f))if(g=f,8===O)a.parent()["scroll"+i](-1*f);else{var n={};n[i.toLowerCase()]=f,a.css(n)}}function t(t){Q.timestamp()-p<50||(d=!0,n=i.getMousePosition(t).x,o=i.getMousePosition(t).y)}var i=this,n=a.width()/2,o=a.height()/2,s=parseInt(a.css("left"),10),r=parseInt(a.css("top"),10),c=s||0,l=r||0,h=0,u=0,d=!1,p=Q.timestamp(),g=0,f=0;return 8===O&&(a.parent().scrollTop(-1*l).scrollLeft(-1*c),a.css({top:0,left:0})),this.$("stage").off("mousemove",t).on("mousemove",t),this.addTimer("pan"+i._id,function(t){d&&(h=a.width()-i._stageWidth,u=a.height()-i._stageHeight,s=n/i._stageWidth*h*-1,r=o/i._stageHeight*u*-1,c+=(s-c)/i._options.imagePanSmoothness,l+=(r-l)/i._options.imagePanSmoothness,e(u,l,"Top"),e(h,c,"Left"))},50,!0),this}},proxy:function(t,e){return"function"!=typeof t?r:(e=e||this,function(){return t.apply(e,Q.array(arguments))})},getThemeName:function(){return this.theme.name},removePan:function(){return this.$("stage").off("mousemove"),this.clearTimer("pan"+this._id),this},addElement:function(t){var i=this._dom;return w.each(Q.array(arguments),function(t,e){i[e]=Q.create("galleria-"+e)}),this},attachKeyboard:function(t){return this._keyboard.attach.apply(this._keyboard,Q.array(arguments)),this},detachKeyboard:function(){return this._keyboard.detach.apply(this._keyboard,Q.array(arguments)),this},appendChild:function(t,e){return this.$(t).append(this.get(e)||e),this},prependChild:function(t,e){return this.$(t).prepend(this.get(e)||e),this},remove:function(t){return this.$(Q.array(arguments).join(",")).remove(),this},append:function(t){var e,i;for(e in t)if(t.hasOwnProperty(e))if(t[e].constructor===Array)for(i=0;t[e][i];i++)this.appendChild(e,t[e][i]);else this.appendChild(e,t[e]);return this},_scaleImage:function(t,e){if(t=t||this._controls.getActive()){function i(t){w(t.container).children(":first").css({top:F.max(0,Q.parseValue(t.image.style.top)),left:F.max(0,Q.parseValue(t.image.style.left)),width:Q.parseValue(t.image.width),height:Q.parseValue(t.image.height)})}var n;return e=w.extend({width:this._stageWidth,height:this._stageHeight,crop:this._options.imageCrop,max:this._options.maxScaleRatio,min:this._options.minScaleRatio,margin:this._options.imageMargin,position:this._options.imagePosition,iframelimit:this._options.maxVideoSize},e),this._options.layerFollow&&!0!==this._options.imageCrop?"function"==typeof e.complete?(n=e.complete,e.complete=function(){n.call(t,t),i(t)}):e.complete=i:w(t.container).children(":first").css({top:0,left:0}),t.scale(e),this}},updateCarousel:function(){return this._carousel.update(),this},resize:function(i,t){"function"==typeof i&&(t=i,i=y),i=w.extend({width:0,height:0},i);var n=this,a=this.$("container");return w.each(i,function(t,e){e||(a[t]("auto"),i[t]=n._getWH()[t])}),w.each(i,function(t,e){a[t](e)}),this.rescale(t)},rescale:function(t,e,i){var n=this;"function"==typeof t&&(i=t,t=y);return function(){n._stageWidth=t||n.$("stage").width(),n._stageHeight=e||n.$("stage").height(),n._options.swipe?(w.each(n._controls.slides,function(t,e){n._scaleImage(e),w(e.container).css("left",n._stageWidth*t)}),n.$("images").css("width",n._stageWidth*n.getDataLength())):n._scaleImage(),n._options.carousel&&n.updateCarousel(),n._controls.frames[n._controls.active]&&n._controls.frames[n._controls.active].scale({width:n._stageWidth,height:n._stageHeight,iframelimit:n._options.maxVideoSize}),n.trigger(x.RESCALE),"function"==typeof i&&i.call(n)}.call(n),this},refreshImage:function(){return this._scaleImage(),this._options.imagePan&&this.addPan(),this},_preload:function(){if(this._options.preload){var t,e,i,n=this.getNext();try{for(e=this._options.preload;0<e;e--)t=new x.Picture,i=this.getData(n),t.preload(this.isFullscreen()&&i.big?i.big:i.image),n=this.getNext(n)}catch(t){}}},show:function(t,e,i){var n=this._options.swipe;if(n||!(3<this._queue.length||!1===t||!this._options.queue&&this._queue.stalled)){if(t=F.max(0,F.min(parseInt(t,10),this.getDataLength()-1)),e=void 0!==e?!!e:t<this.getIndex(),(i=i||!1)||!x.History){if(this.finger&&t!==this._active&&(this.finger.to=-t*this.finger.width,this.finger.index=t),this._active=t,n){var a=this.getData(t),o=this;if(!a)return;var s=this.isFullscreen()&&a.big?a.big:a.image||a.iframe,r=this._controls.slides[t],c=r.isCached(s),l=this._thumbnails[t],h={cached:c,index:t,rewind:e,imageTarget:r.image,thumbTarget:l.image,galleriaData:a};this.trigger(w.extend(h,{type:x.LOADSTART})),o.$("container").removeClass("videoplay");function u(){o._layers[t].innerHTML=o.getData().layer||"",o.trigger(w.extend(h,{type:x.LOADFINISH})),o._playCheck()}o._preload(),b.setTimeout(function(){r.ready&&w(r.image).attr("src")==s?(o.trigger(w.extend(h,{type:x.IMAGE})),u()):(a.iframe&&!a.image&&(r.isIframe=!0),r.load(s,function(t){h.imageTarget=t.image,o._scaleImage(t,u).trigger(w.extend(h,{type:x.IMAGE})),u()}))},100)}else D.push.call(this._queue,{index:t,rewind:e}),this._queue.stalled||this._show();return this}x.History.set(t.toString())}},_show:function(){var a=this,o=this._queue[0],s=this.getData(o.index);if(s){function r(){w(e.image).trigger("mouseup")}var t=this.isFullscreen()&&s.big?s.big:s.image||s.iframe,c=this._controls.getActive(),e=this._controls.getNext(),l=e.isCached(t),i=this._thumbnails[o.index];a.$("container").toggleClass("iframe",!!s.isIframe).removeClass("videoplay");var h,n,u,d,p,g=(h=s,n=e,u=c,d=o,p=i,function(){K.active=!1,Q.toggleQuality(n.image,a._options.imageQuality),a._layers[a._controls.active].innerHTML="",w(u.container).css({zIndex:0,opacity:0}).show(),w(u.container).find("iframe, .galleria-videoicon").remove(),w(a._controls.frames[a._controls.active].container).hide(),w(n.container).css({zIndex:1,left:0,top:0}).show(),a._controls.swap(),a._options.imagePan&&a.addPan(n.image),(h.iframe&&h.image||h.link||a._options.lightbox||a._options.clicknext)&&w(n.image).css({cursor:"pointer"}).on("mouseup",function(t){if(!("number"==typeof t.which&&1<t.which)){if(h.iframe){a.isPlaying()&&a.pause();var e=a._controls.frames[a._controls.active],i=a._stageWidth,n=a._stageHeight;return w(e.container).css({width:i,height:n,opacity:0}).show().animate({opacity:1},200),void b.setTimeout(function(){e.load(h.iframe+(h.video?"&autoplay=1":""),{width:i,height:n},function(t){a.$("container").addClass("videoplay"),t.scale({width:a._stageWidth,height:a._stageHeight,iframelimit:h.video?a._options.maxVideoSize:y})})},100)}if(a._options.clicknext&&!x.TOUCH)return a._options.pauseOnInteraction&&a.pause(),void a.next();h.link?a._options.popupLinks?b.open(h.link,"_blank"):b.location.href=h.link:a._options.lightbox&&a.openLightbox()}}),a._playCheck(),a.trigger({type:x.IMAGE,index:d.index,imageTarget:n.image,thumbTarget:p.image,galleriaData:h}),D.shift.call(a._queue),a._queue.stalled=!1,a._queue.length&&a._show()});this._options.carousel&&this._options.carouselFollow&&this._carousel.follow(o.index),a._preload(),Q.show(e.container),e.isIframe=s.iframe&&!s.image,w(a._thumbnails[o.index].container).addClass("active").siblings(".active").removeClass("active"),a.trigger({type:x.LOADSTART,cached:l,index:o.index,rewind:o.rewind,imageTarget:e.image,thumbTarget:i.image,galleriaData:s}),a._queue.stalled=!0,e.load(t,function(t){var n=w(a._layers[1-a._controls.active]).html(s.layer||"").hide();a._scaleImage(t,{complete:function(t){"image"in c&&Q.toggleQuality(c.image,!1),Q.toggleQuality(t.image,!1),a.removePan(),a.setInfo(o.index),a.setCounter(o.index),s.layer&&(n.show(),(s.iframe&&s.image||s.link||a._options.lightbox||a._options.clicknext)&&n.css("cursor","pointer").off("mouseup").mouseup(r)),s.video&&s.image&&f(t.container);var i=a._options.transition;if(w.each({initial:null===c.image,touch:x.TOUCH,fullscreen:a.isFullscreen()},function(t,e){if(e&&a._options[t+"Transition"]!==y)return i=a._options[t+"Transition"],!1}),i in K.effects==!1)g();else{var e={prev:c.container,next:t.container,rewind:o.rewind,speed:a._options.transitionSpeed||400};K.active=!0,K.init.call(a,i,e,g)}a.trigger({type:x.LOADFINISH,cached:l,index:o.index,rewind:o.rewind,imageTarget:t.image,thumbTarget:a._thumbnails[o.index].image,galleriaData:a.getData(o.index)})}})})}},getNext:function(t){return(t="number"==typeof t?t:this.getIndex())===this.getDataLength()-1?0:t+1},getPrev:function(t){return 0===(t="number"==typeof t?t:this.getIndex())?this.getDataLength()-1:t-1},next:function(){return 1<this.getDataLength()&&this.show(this.getNext(),!1),this},prev:function(){return 1<this.getDataLength()&&this.show(this.getPrev(),!0),this},get:function(t){return t in this._dom?this._dom[t]:null},getData:function(t){return t in this._data?this._data[t]:this._data[this._active]},getDataLength:function(){return this._data.length},getIndex:function(){return"number"==typeof this._active&&this._active},getStageHeight:function(){return this._stageHeight},getStageWidth:function(){return this._stageWidth},getOptions:function(t){return void 0===t?this._options:this._options[t]},setOptions:function(t,e){return"object"==typeof t?w.extend(this._options,t):this._options[t]=e,this},play:function(t){return this._playing=!0,this._playtime=t||this._playtime,this._playCheck(),this.trigger(x.PLAY),this},pause:function(){return this._playing=!1,this.trigger(x.PAUSE),this},playToggle:function(t){return this._playing?this.pause():this.play(t)},isPlaying:function(){return this._playing},isFullscreen:function(){return this._fullscreen.active},_playCheck:function(){var t=this,e=0,i=Q.timestamp(),n="play"+this._id;if(this._playing){this.clearTimer(n);var a=function(){if((e=Q.timestamp()-i)>=t._playtime&&t._playing)return t.clearTimer(n),void t.next();t._playing&&(t.trigger({type:x.PROGRESS,percent:F.ceil(e/t._playtime*100),seconds:F.floor(e/1e3),milliseconds:e}),t.addTimer(n,a,20))};t.addTimer(n,a,20)}},setPlaytime:function(t){return this._playtime=t,this},setIndex:function(t){return this._active=t,this},setCounter:function(t){if("number"==typeof t?t++:void 0===t&&(t=this.getIndex()+1),this.get("current").innerHTML=t,O){var e=this.$("counter"),i=e.css("opacity");1===parseInt(i,10)?Q.removeAlpha(e[0]):this.$("counter").css("opacity",i)}return this},setInfo:function(t){var n=this,a=this.getData(t);return w.each(["title","description"],function(t,e){var i=n.$("info-"+e);a[e]?i[a[e].length?"show":"hide"]().html(a[e]):i.empty().hide()}),this},hasInfo:function(t){var e,i="title description".split(" ");for(e=0;i[e];e++)if(this.getData(t)[i[e]])return!0;return!1},jQuery:function(t){var i=this,n=[];w.each(t.split(","),function(t,e){e=w.trim(e),i.get(e)&&n.push(e)});var a=w(i.get(n.shift()));return w.each(n,function(t,e){a=a.add(i.get(e))}),a},$:function(t){return this.jQuery.apply(this,Q.array(arguments))}},w.each(R,function(t,e){var i=/_/.test(e)?e.replace(/_/g,""):e;x[e.toUpperCase()]="galleria."+i}),w.extend(x,{IE9:9===O,IE8:8===O,IE7:7===O,IE6:6===O,IE:O,WEBKIT:/webkit/.test(e),CHROME:/chrome/.test(e),SAFARI:/safari/.test(e)&&!/chrome/.test(e),QUIRK:O&&A.compatMode&&"BackCompat"===A.compatMode,MAC:/mac/.test(navigator.platform.toLowerCase()),OPERA:!!b.opera,IPHONE:/iphone/.test(e),IPAD:/ipad/.test(e),ANDROID:/android/.test(e),TOUCH:"ontouchstart"in A&&H}),x.addTheme=function(i){i.name||x.raise("No theme name specified"),(!i.version||parseInt(10*x.version)>parseInt(10*i.version))&&x.raise("This version of Galleria requires "+i.name+" theme version "+parseInt(10*x.version)/10+" or later",!0),"object"!=typeof i.defaults?i.defaults={}:i.defaults=c(i.defaults);var n,a,o=!1;return"string"==typeof i.css?(w("link").each(function(t,e){if((n=new RegExp(i.css)).test(e.href))return o=!0,u(i),!1}),o||w(function(){var t=0,e=function(){w("script").each(function(t,e){n=new RegExp("galleria\\."+i.name.toLowerCase()+"\\."),a=new RegExp("galleria\\.io\\/theme\\/"+i.name.toLowerCase()+"\\/(\\d*\\.*)?(\\d*\\.*)?(\\d*\\/)?js"),(n.test(e.src)||a.test(e.src))&&(o=e.src.replace(/[^\/]*$/,"")+i.css,b.setTimeout(function(){Q.loadCSS(o,"galleria-theme-"+i.name,function(){u(i)})},1))}),o||(5<t++?x.raise("No theme CSS loaded"):b.setTimeout(e,500))};e()})):u(i),i},x.loadTheme=function(t,e){if(!w("script").filter(function(){return w(this).attr("src")==t}).length){var i,n=!1;return w(b).on("load",function(){n||(i=b.setTimeout(function(){n||x.raise("Galleria had problems loading theme at "+t+". Please check theme path or load manually.",!0)},2e4))}),Q.loadScript(t,function(){n=!0,b.clearTimeout(i)}),x}},x.get=function(t){return V[t]?V[t]:"number"!=typeof t?V:void x.raise("Gallery index "+t+" not found")},x.configure=function(t,e){var i={};return"string"==typeof t&&e?(i[t]=e,t=i):w.extend(i,t),x.configure.options=i,w.each(x.get(),function(t,e){e.setOptions(i)}),x},x.configure.options={},x.on=function(i,n){if(i){var a=i+(n=n||r).toString().replace(/\s/g,"")+Q.timestamp();return w.each(x.get(),function(t,e){e._binds.push(a),e.bind(i,n)}),x.on.binds.push({type:i,callback:n,hash:a}),x}},x.on.binds=[],x.run=function(t,e){return w.isFunction(e)&&(e={extend:e}),w(t||"#galleria").galleria(e),x},x.addTransition=function(t,e){return K.effects[t]=e,x},x.utils=Q,x.log=function(){var e=Q.array(arguments);if(!("console"in b&&"log"in b.console))return b.alert(e.join("<br>"));try{return b.console.log.apply(b.console,e)}catch(t){w.each(e,function(){b.console.log(this)})}},x.ready=function(i){return"function"!=typeof i||(w.each(U,function(t,e){i.call(e,e._options)}),x.ready.callbacks.push(i)),x},x.ready.callbacks=[],x.raise=function(t,e){function i(t){var i='<div style="padding:4px;margin:0 0 2px;background:#'+(e?"811":"222")+';">'+(e?"<strong>"+n+": </strong>":"")+t+"</div>";w.each(V,function(){var t=this.$("errors"),e=this.$("target");t.length||(e.css("position","relative"),t=this.addElement("errors").appendChild("target","errors").$("errors").css(a)),t.append(i)}),V.length||w("<div>").css(w.extend(a,{position:"fixed"})).append(i).appendTo(_().body)}var n=e?"Fatal error":"Error",a={color:"#fff",position:"absolute",top:0,left:0,zIndex:1e5};if(o){if(i(t),e)throw new Error(n+": "+t)}else if(e){if(j)return;e=!(j=!0),i("Gallery could not load.")}},x.version=1.61,x.getLoadedThemes=function(){return w.map(G,function(t){return t.name})},x.requires=function(t,e){return e=e||"You need to upgrade Galleria to version "+t+" to use one or more components.",x.version<t&&x.raise(e,!0),x},x.Picture=function(t){this.id=t||null,this.image=null,this.container=Q.create("galleria-image"),w(this.container).css({overflow:"hidden",position:"relative"}),this.original={width:0,height:0},this.ready=!1,this.isIframe=!1},x.Picture.prototype={cache:{},show:function(){Q.show(this.image)},hide:function(){Q.moveOut(this.image)},clear:function(){this.image=null},isCached:function(t){return!!this.cache[t]},preload:function(t){var e,i,n=w(new Image).on("load",(e=t,i=this.cache,function(){i[e]=e}));t.srcset&&n.attr("srcset",t.srcset),t.sizes&&n.attr("sizes",t.sizes),n.attr("src",t)},load:function(i,n,t){if("function"==typeof n&&(t=n,n=null),this.isIframe){var e="if"+(new Date).getTime(),a=this.image=w("<iframe>",{src:i,frameborder:0,id:e,allowfullscreen:!0,css:{visibility:"hidden"}})[0];return n&&w(a).css(n),w(this.container).find("iframe,img").remove(),this.container.appendChild(this.image),w("#"+e).on("load",(o=this,s=t,function(){b.setTimeout(function(){w(o.image).css("visibility","visible"),"function"==typeof s&&s.call(o,o)},10)})),this.container}var o,s;this.image=new Image,x.IE8&&w(this.image).css("filter","inherit"),x.IE||x.CHROME||x.SAFARI||w(this.image).css("image-rendering","optimizequality");var r,c,l,h=!1,u=!1,d=w(this.container),p=w(this.image),g=(r=this,c=t,l=i,function(){function t(){w(this).off("load"),r.original=n||{height:this.height,width:this.width},x.HAS3D&&(this.style.MozTransform=this.style.webkitTransform="translate3d(0,0,0)"),d.append(this),r.cache[l]=l,"function"==typeof c&&b.setTimeout(function(){c.call(r,r)},1)}var e;this.width&&this.height?t.call(this):(e=this,Q.wait({until:function(){return e.width&&e.height},success:function(){t.call(e)},error:function(){u?x.raise("Could not extract width/height from image: "+e.src+". Traced measures: width:"+e.width+"px, height: "+e.height+"px."):(w(new Image).on("load",g).attr("src",e.src),u=!0)},timeout:100}))});return d.find("iframe,img").remove(),p.css("display","block"),Q.hide(this.image),w.each("minWidth minHeight maxWidth maxHeight".split(" "),function(t,e){p.css(e,/min/.test(e)?"0":"none")}),p.on("load",g).on("error",function(){var t,e;h?L?w(this).attr("src",L):x.raise("Image not found: "+i):(h=!0,b.setTimeout((t=w(this),e=i,function(){t.attr("src",e+(-1<e.indexOf("?")?"&":"?")+Q.timestamp())}),50))}),i.srcset&&p.attr("srcset",i.srcset),i.sizes&&p.attr("sizes",i.sizes),p.attr("src",i),this.container},scale:function(h){var u=this;if(h=w.extend({width:0,height:0,min:y,max:y,margin:0,complete:r,position:"center",crop:!1,canvas:!1,iframelimit:y},h),this.isIframe){var t,e,i=h.width,n=h.height;if(h.iframelimit){var a=F.min(h.iframelimit/i,h.iframelimit/n);a<1?(t=i*a,e=n*a,w(this.image).css({top:n/2-e/2,left:i/2-t/2,position:"absolute"})):w(this.image).css({top:0,left:0})}w(this.image).width(t||i).height(e||n).removeAttr("width").removeAttr("height"),w(this.container).width(i).height(n),h.complete.call(u,u);try{this.image.contentWindow&&w(this.image.contentWindow).trigger("resize")}catch(t){}return this.container}if(!this.image)return this.container;var d,p,g,o=w(u.container);return Q.wait({until:function(){return d=h.width||o.width()||Q.parseValue(o.css("width")),p=h.height||o.height()||Q.parseValue(o.css("height")),d&&p},success:function(){var t=(d-2*h.margin)/u.original.width,e=(p-2*h.margin)/u.original.height,i=F.min(t,e),n=F.max(t,e),a={true:n,width:t,height:e,false:i,landscape:u.original.width>u.original.height?n:i,portrait:u.original.width<u.original.height?n:i}[h.crop.toString()],o="";h.max&&(a=F.min(h.max,a)),h.min&&(a=F.max(h.min,a)),w.each(["width","height"],function(t,e){w(u.image)[e](u[e]=u.image[e]=F.round(u.original[e]*a))}),w(u.container).width(d).height(p),h.canvas&&X&&(X.elem.width=u.width,X.elem.height=u.height,o=u.image.src+":"+u.width+"x"+u.height,u.image.src=X.cache[o]||function(t){X.context.drawImage(u.image,0,0,u.original.width*a,u.original.height*a);try{return g=X.elem.toDataURL(),X.length+=g.length,X.cache[t]=g}catch(t){return u.image.src}}(o));function s(t,e,i){var n=0;if(/\%/.test(t)){var a=parseInt(t,10)/100,o=u.image[e]||w(u.image)[e]();n=F.ceil(-1*o*a+i*a)}else n=Q.parseValue(t);return n}var r={},c={},l={top:{top:0},left:{left:0},right:{left:"100%"},bottom:{top:"100%"}};w.each(h.position.toLowerCase().split(" "),function(t,e){"center"===e&&(e="50%"),r[t?"top":"left"]=e}),w.each(r,function(t,e){l.hasOwnProperty(e)&&w.extend(c,l[e])}),r=r.top?w.extend(r,c):c,r=w.extend({top:"50%",left:"50%"},r),w(u.image).css({position:"absolute",top:s(r.top,"height",p),left:s(r.left,"width",d)}),u.show(),u.ready=!0,h.complete.call(u,u)},error:function(){x.raise("Could not scale image: "+u.image.src)},timeout:1e3}),this}},w.extend(w.easing,{galleria:function(t,e,i,n,a){return(e/=a/2)<1?n/2*e*e*e+i:n/2*((e-=2)*e*e+2)+i},galleriaIn:function(t,e,i,n,a){return n*(e/=a)*e+i},galleriaOut:function(t,e,i,n,a){return-n*(e/=a)*(e-2)+i}}),x.Finger=function(){F.abs;function t(t,e){if(this.config={start:0,duration:500,onchange:function(){},oncomplete:function(){},easing:function(t,e,i,n,a){return-n*((e=e/a-1)*e*e*e-1)+i}},this.easeout=function(t,e,i,n,a){return n*((e=e/a-1)*e*e*e*e+1)+i},t.children.length){var n=this;w.extend(this.config,e),this.elem=t,this.child=t.children[0],this.to=this.pos=0,this.touching=!1,this.start={},this.index=this.config.start,this.anim=0,this.easing=this.config.easing,i||(this.child.style.position="absolute",this.elem.style.position="relative"),w.each(["ontouchstart","ontouchmove","ontouchend","setup"],function(t,e){var i;n[e]=(i=n[e],function(){i.apply(n,arguments)})}),this.setX=function(){var t=n.child.style;i?t.MozTransform=t.webkitTransform=t.transform="translate3d("+n.pos+"px,0,0)":t.left=n.pos+"px"},w(t).on("touchstart",this.ontouchstart),w(b).on("resize",this.setup),w(b).on("orientationchange",this.setup),this.setup(),function t(){a(t),n.loop.call(n)}()}}var e,i=x.HAS3D=function(){var t,e,i=A.createElement("p"),n=["webkit","O","ms","Moz",""],a=0,o="transform";for(_().html.insertBefore(i,null);n[a];a++)e=n[a]?n[a]+"Transform":o,void 0!==i.style[e]&&(i.style[e]="translate3d(1px,1px,1px)",t=w(i).css(n[a]?"-"+n[a].toLowerCase()+"-"+o:o));return _().html.removeChild(i),void 0!==t&&0<t.length&&"none"!==t}(),a=(e="RequestAnimationFrame",b.requestAnimationFrame||b["webkit"+e]||b["moz"+e]||b["o"+e]||b["ms"+e]||function(t){b.setTimeout(t,1e3/60)});return t.prototype={constructor:t,setup:function(){this.width=w(this.elem).width(),this.length=F.ceil(w(this.child).width()/this.width),0!==this.index&&(this.index=F.max(0,F.min(this.index,this.length-1)),this.pos=this.to=-this.width*this.index)},setPosition:function(t){this.pos=t,this.to=t},ontouchstart:function(t){var e=t.originalEvent.touches;this.start={pageX:e[0].pageX,pageY:e[0].pageY,time:+new Date},this.isScrolling=null,this.touching=!0,this.deltaX=0,E.on("touchmove",this.ontouchmove),E.on("touchend",this.ontouchend)},ontouchmove:function(t){var e=t.originalEvent.touches;e&&1<e.length||t.scale&&1!==t.scale||(this.deltaX=e[0].pageX-this.start.pageX,null===this.isScrolling&&(this.isScrolling=!!(this.isScrolling||F.abs(this.deltaX)<F.abs(e[0].pageY-this.start.pageY))),this.isScrolling||(t.preventDefault(),this.deltaX/=!this.index&&0<this.deltaX||this.index==this.length-1&&this.deltaX<0?F.abs(this.deltaX)/this.width+1.8:1,this.to=this.deltaX-this.index*this.width),t.stopPropagation())},ontouchend:function(t){this.touching=!1;var e=new Date-this.start.time<250&&40<F.abs(this.deltaX)||F.abs(this.deltaX)>this.width/2,i=!this.index&&0<this.deltaX||this.index==this.length-1&&this.deltaX<0;this.isScrolling||this.show(this.index+(e&&!i?this.deltaX<0?1:-1:0)),E.off("touchmove",this.ontouchmove),E.off("touchend",this.ontouchend)},show:function(t){t!=this.index?this.config.onchange.call(this,t):this.to=-t*this.width},moveTo:function(t){t!=this.index&&(this.pos=this.to=-t*this.width,this.index=t)},loop:function(){var t=this.to-this.pos,e=1;if(this.width&&t&&(e=F.max(.5,F.min(1.5,F.abs(t/this.width)))),this.touching||F.abs(t)<=1)this.pos=this.to,t=0,this.anim&&!this.touching&&this.config.oncomplete(this.index),this.anim=0,this.easing=this.config.easing;else{this.anim||(this.anim={start:this.pos,time:+new Date,distance:t,factor:e,destination:this.to});var i=new Date-this.anim.time,n=this.config.duration*this.anim.factor;if(n<i||this.anim.destination!=this.to)return this.anim=0,void(this.easing=this.easeout);this.pos=this.easing(null,i,this.anim.start,this.anim.distance,n)}this.setX()}},t}(),w.fn.galleria=function(t){var e=this.selector;return w(this).length?this.each(function(){w.data(this,"galleria")&&(w.data(this,"galleria").destroy(),w(this).find("*").hide()),w.data(this,"galleria",(new x).init(this,t))}):(w(function(){w(e).length?w(e).galleria(t):x.utils.wait({until:function(){return w(e).length},success:function(){w(e).galleria(t)},error:function(){x.raise('Init failed: Galleria could not find the element "'+e+'".')},timeout:5e3})}),this)},x});