/**
* Galleria - v1.6.1 2019-10-17
*
*
* Copyright (c) 2010 - 2019 worse is better UG
* Licensed under the MIT License.
*/
!function(a,b){"function"==typeof define&&define.amd?define(["../galleria","jquery"],function(c,d){return b(a,c,d)}):"object"==typeof module&&module.exports?module.exports=b(a,require("galleria"),require("jquery")):b(a,a.Galleria,a.jQuery)}(window,function(a,b,c){return b.addTheme({name:"twelve",version:1.6,author:"Galleria",css:"galleria.twelve.css",defaults:{transition:"pulse",transitionSpeed:500,imageCrop:!0,thumbCrop:!0,carousel:!1,_locale:{show_thumbnails:"Show thumbnails",hide_thumbnails:"Hide thumbnails",play:"Play slideshow",pause:"Pause slideshow",enter_fullscreen:"Enter fullscreen",exit_fullscreen:"Exit fullscreen",popout_image:"Popout image",showing_image:"Showing image %s of %s"},_showFullscreen:!0,_showPopout:!0,_showProgress:!0,_showTooltip:!0},init:function(a){b.requires(1.6,"This version of Twelve theme requires Galleria version 1.6 or later"),this.addElement("bar","fullscreen","play","popout","thumblink","s1","s2","s3","s4","progress"),this.append({stage:"progress",container:["bar","tooltip"],bar:["fullscreen","play","popout","thumblink","info","s1","s2","s3","s4"]}),this.prependChild("info","counter");var d=this,e=this.$("thumbnails-container"),f=this.$("thumblink"),g=this.$("fullscreen"),h=this.$("play"),i=this.$("popout"),j=this.$("bar"),k=this.$("progress"),l=a.transition,m=a._locale,n=!1,o=!1,p=!!a.autoplay,q=!1,r=function(){e.height(d.getStageHeight()).width(d.getStageWidth()).css("top",n?0:d.getStageHeight()+30)},s=function(a){n&&q?d.play():(q=p,d.pause()),b.utils.animate(e,{top:n?d.getStageHeight()+30:0},{easing:"galleria",duration:400,complete:function(){d.defineTooltip("thumblink",n?m.show_thumbnails:m.hide_thumbnails),f[n?"removeClass":"addClass"]("open"),n=!n}})};r(),a._showTooltip&&d.bindTooltip({thumblink:m.show_thumbnails,fullscreen:m.enter_fullscreen,play:function(){return p?m.pause:m.play},popout:m.popout_image,caption:function(){var a=d.getData(),b="";return a&&(a.title&&a.title.length&&(b+=""+a.title+""),a.description&&a.description.length&&(b+="
"+a.description)),b},counter:function(){return m.showing_image.replace(/\%s/,d.getIndex()+1).replace(/\%s/,d.getDataLength())}}),a.showInfo||this.$("info").hide(),this.bind("play",function(){p=!0,h.addClass("playing")}),this.bind("pause",function(){p=!1,h.removeClass("playing"),k.width(0)}),a._showProgress&&this.bind("progress",function(a){k.width(a.percent/100*this.getStageWidth())}),this.bind("loadstart",function(a){a.cached||this.$("loader").show()}),this.bind("loadfinish",function(a){k.width(0),this.$("loader").hide(),this.refreshTooltip("counter","caption")}),this.bind("thumbnail",function(a){c(a.thumbTarget).hover(function(){d.setInfo(a.thumbOrder),d.setCounter(a.thumbOrder)},function(){d.setInfo(),d.setCounter()}).on("click:fast",function(){s()})}),this.bind("fullscreen_enter",function(a){o=!0,d.setOptions("transition",!1),g.addClass("open"),j.css("bottom",0),this.defineTooltip("fullscreen",m.exit_fullscreen),b.TOUCH||this.addIdleState(j,{bottom:-31})}),this.bind("fullscreen_exit",function(a){o=!1,b.utils.clearTimer("bar"),d.setOptions("transition",l),g.removeClass("open"),j.css("bottom",0),this.defineTooltip("fullscreen",m.enter_fullscreen),b.TOUCH||this.removeIdleState(j,{bottom:-31})}),this.bind("rescale",r),b.TOUCH||(this.addIdleState(this.get("image-nav-left"),{left:-36}),this.addIdleState(this.get("image-nav-right"),{right:-36})),f.on("click:fast",s),a.thumbnails||(f.hide(),h.css("left",0),this.$("s2").hide(),this.$("info").css("left",41)),a._showPopout?i.on("click:fast",function(a){d.openLightbox(),a.preventDefault()}):(i.remove(),a._showFullscreen&&(this.$("s4").remove(),this.$("info").css("right",40),g.css("right",0))),h.on("click:fast",function(){p?d.pause():(n&&f.trigger("click:fast"),d.play())}),a._showFullscreen?g.on("click:fast",function(a){o?d.exitFullscreen():d.enterFullscreen(),a.preventDefault()}):(g.remove(),a._show_popout&&(this.$("s4").remove(),this.$("info").css("right",40),i.css("right",0))),a._showFullscreen||a._showPopout||(this.$("s3,s4").remove(),this.$("info").css("right",10)),a.autoplay&&this.trigger("play")}}),b});