AnonSec Team
Server IP : 81.169.145.165  /  Your IP : 216.73.216.204
Web Server : Apache/2.4.68 (Unix)
System : Linux localhost 5.14.0-611.24.1.el9_7.x86_64 #1 SMP
User :  ( 1388231)
PHP Version : 8.4.26
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (1777) :  /../../../usr/../../tmp/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //../../../usr/../../tmp/minify_g=jtl3.js_8f3b149e98bf7f2b3830e8686fc46191
/* jQuery Mobile v1.4.3 | Copyright 2010, 2014 jQuery Foundation, Inc. | jquery.org/license */

(function(e,t,n){typeof define=="function"&&define.amd?define(["jquery"],function(r){return n(r,e,t),r.mobile}):n(e.jQuery,e,t)})(this,document,function(e,t,n,r){(function(e,t,n,r){function T(e){while(e&&typeof e.originalEvent!="undefined")e=e.originalEvent;return e}function N(t,n){var i=t.type,s,o,a,l,c,h,p,d,v;t=e.Event(t),t.type=n,s=t.originalEvent,o=e.event.props,i.search(/^(mouse|click)/)>-1&&(o=f);if(s)for(p=o.length,l;p;)l=o[--p],t[l]=s[l];i.search(/mouse(down|up)|click/)>-1&&!t.which&&(t.which=1);if(i.search(/^touch/)!==-1){a=T(s),i=a.touches,c=a.changedTouches,h=i&&i.length?i[0]:c&&c.length?c[0]:r;if(h)for(d=0,v=u.length;d<v;d++)l=u[d],t[l]=h[l]}return t}function C(t){var n={},r,s;while(t){r=e.data(t,i);for(s in r)r[s]&&(n[s]=n.hasVirtualBinding=!0);t=t.parentNode}return n}function k(t,n){var r;while(t){r=e.data(t,i);if(r&&(!n||r[n]))return t;t=t.parentNode}return null}function L(){g=!1}function A(){g=!0}function O(){E=0,v.length=0,m=!1,A()}function M(){L()}function _(){D(),c=setTimeout(function(){c=0,O()},e.vmouse.resetTimerDuration)}function D(){c&&(clearTimeout(c),c=0)}function P(t,n,r){var i;if(r&&r[t]||!r&&k(n.target,t))i=N(n,t),e(n.target).trigger(i);return i}function H(t){var n=e.data(t.target,s),r;!m&&(!E||E!==n)&&(r=P("v"+t.type,t),r&&(r.isDefaultPrevented()&&t.preventDefault(),r.isPropagationStopped()&&t.stopPropagation(),r.isImmediatePropagationStopped()&&t.stopImmediatePropagation()))}function B(t){var n=T(t).touches,r,i,o;n&&n.length===1&&(r=t.target,i=C(r),i.hasVirtualBinding&&(E=w++,e.data(r,s,E),D(),M(),d=!1,o=T(t).touches[0],h=o.pageX,p=o.pageY,P("vmouseover",t,i),P("vmousedown",t,i)))}function j(e){if(g)return;d||P("vmousecancel",e,C(e.target)),d=!0,_()}function F(t){if(g)return;var n=T(t).touches[0],r=d,i=e.vmouse.moveDistanceThreshold,s=C(t.target);d=d||Math.abs(n.pageX-h)>i||Math.abs(n.pageY-p)>i,d&&!r&&P("vmousecancel",t,s),P("vmousemove",t,s),_()}function I(e){if(g)return;A();var t=C(e.target),n,r;P("vmouseup",e,t),d||(n=P("vclick",e,t),n&&n.isDefaultPrevented()&&(r=T(e).changedTouches[0],v.push({touchID:E,x:r.clientX,y:r.clientY}),m=!0)),P("vmouseout",e,t),d=!1,_()}function q(t){var n=e.data(t,i),r;if(n)for(r in n)if(n[r])return!0;return!1}function R(){}function U(t){var n=t.substr(1);return{setup:function(){q(this)||e.data(this,i,{});var r=e.data(this,i);r[t]=!0,l[t]=(l[t]||0)+1,l[t]===1&&b.bind(n,H),e(this).bind(n,R),y&&(l.touchstart=(l.touchstart||0)+1,l.touchstart===1&&b.bind("touchstart",B).bind("touchend",I).bind("touchmove",F).bind("scroll",j))},teardown:function(){--l[t],l[t]||b.unbind(n,H),y&&(--l.touchstart,l.touchstart||b.unbind("touchstart",B).unbind("touchmove",F).unbind("touchend",I).unbind("scroll",j));var r=e(this),s=e.data(this,i);s&&(s[t]=!1),r.unbind(n,R),q(this)||r.removeData(i)}}}var i="virtualMouseBindings",s="virtualTouchID",o="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),u="clientX clientY pageX pageY screenX screenY".split(" "),a=e.event.mouseHooks?e.event.mouseHooks.props:[],f=e.event.props.concat(a),l={},c=0,h=0,p=0,d=!1,v=[],m=!1,g=!1,y="addEventListener"in n,b=e(n),w=1,E=0,S,x;e.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(x=0;x<o.length;x++)e.event.special[o[x]]=U(o[x]);y&&n.addEventListener("click",function(t){var n=v.length,r=t.target,i,o,u,a,f,l;if(n){i=t.clientX,o=t.clientY,S=e.vmouse.clickDistanceThreshold,u=r;while(u){for(a=0;a<n;a++){f=v[a],l=0;if(u===r&&Math.abs(f.x-i)<S&&Math.abs(f.y-o)<S||e.data(u,s)===f.touchID){t.preventDefault(),t.stopPropagation();return}}u=u.parentNode}}},!0)})(e,t,n),function(e){e.mobile={}}(e),function(e,t){var r={touch:"ontouchend"in n};e.mobile.support=e.mobile.support||{},e.extend(e.support,r),e.extend(e.mobile.support,r)}(e),function(e,t,r){function l(t,n,i,s){var o=i.type;i.type=n,s?e.event.trigger(i,r,t):e.event.dispatch.call(t,i),i.type=o}var i=e(n),s=e.mobile.support.touch,o="touchmove scroll",u=s?"touchstart":"mousedown",a=s?"touchend":"mouseup",f=s?"touchmove":"mousemove";e.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(t,n){e.fn[n]=function(e){return e?this.bind(n,e):this.trigger(n)},e.attrFn&&(e.attrFn[n]=!0)}),e.event.special.scrollstart={enabled:!0,setup:function(){function s(e,n){r=n,l(t,r?"scrollstart":"scrollstop",e)}var t=this,n=e(t),r,i;n.bind(o,function(t){if(!e.event.special.scrollstart.enabled)return;r||s(t,!0),clearTimeout(i),i=setTimeout(function(){s(t,!1)},50)})},teardown:function(){e(this).unbind(o)}},e.event.special.tap={tapholdThreshold:750,emitTapOnTaphold:!0,setup:function(){var t=this,n=e(t),r=!1;n.bind("vmousedown",function(s){function a(){clearTimeout(u)}function f(){a(),n.unbind("vclick",c).unbind("vmouseup",a),i.unbind("vmousecancel",f)}function c(e){f(),!r&&o===e.target?l(t,"tap",e):r&&e.preventDefault()}r=!1;if(s.which&&s.which!==1)return!1;var o=s.target,u;n.bind("vmouseup",a).bind("vclick",c),i.bind("vmousecancel",f),u=setTimeout(function(){e.event.special.tap.emitTapOnTaphold||(r=!0),l(t,"taphold",e.Event("taphold",{target:o}))},e.event.special.tap.tapholdThreshold)})},teardown:function(){e(this).unbind("vmousedown").unbind("vclick").unbind("vmouseup"),i.unbind("vmousecancel")}},e.event.special.swipe={scrollSupressionThreshold:30,durationThreshold:1e3,horizontalDistanceThreshold:30,verticalDistanceThreshold:30,getLocation:function(e){var n=t.pageXOffset,r=t.pageYOffset,i=e.clientX,s=e.clientY;if(e.pageY===0&&Math.floor(s)>Math.floor(e.pageY)||e.pageX===0&&Math.floor(i)>Math.floor(e.pageX))i-=n,s-=r;else if(s<e.pageY-r||i<e.pageX-n)i=e.pageX-n,s=e.pageY-r;return{x:i,y:s}},start:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,r=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[r.x,r.y],origin:e(t.target)}},stop:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,r=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[r.x,r.y]}},handleSwipe:function(t,n,r,i){if(n.time-t.time<e.event.special.swipe.durationThreshold&&Math.abs(t.coords[0]-n.coords[0])>e.event.special.swipe.horizontalDistanceThreshold&&Math.abs(t.coords[1]-n.coords[1])<e.event.special.swipe.verticalDistanceThreshold){var s=t.coords[0]>n.coords[0]?"swipeleft":"swiperight";return l(r,"swipe",e.Event("swipe",{target:i,swipestart:t,swipestop:n}),!0),l(r,s,e.Event(s,{target:i,swipestart:t,swipestop:n}),!0),!0}return!1},eventInProgress:!1,setup:function(){var t,n=this,r=e(n),s={};t=e.data(this,"mobile-events"),t||(t={length:0},e.data(this,"mobile-events",t)),t.length++,t.swipe=s,s.start=function(t){if(e.event.special.swipe.eventInProgress)return;e.event.special.swipe.eventInProgress=!0;var r,o=e.event.special.swipe.start(t),u=t.target,l=!1;s.move=function(t){if(!o)return;r=e.event.special.swipe.stop(t),l||(l=e.event.special.swipe.handleSwipe(o,r,n,u),l&&(e.event.special.swipe.eventInProgress=!1)),Math.abs(o.coords[0]-r.coords[0])>e.event.special.swipe.scrollSupressionThreshold&&t.preventDefault()},s.stop=function(){l=!0,e.event.special.swipe.eventInProgress=!1,i.off(f,s.move),s.move=null},i.on(f,s.move).one(a,s.stop)},r.on(u,s.start)},teardown:function(){var t,n;t=e.data(this,"mobile-events"),t&&(n=t.swipe,delete t.swipe,t.length--,t.length===0&&e.removeData(this,"mobile-events")),n&&(n.start&&e(this).off(u,n.start),n.move&&i.off(f,n.move),n.stop&&i.off(a,n.stop))}},e.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe.left",swiperight:"swipe.right"},function(t,n){e.event.special[t]={setup:function(){e(this).bind(n,e.noop)},teardown:function(){e(this).unbind(n)}}})}(e,this)});
;/* Backstretch - v2.0.4 - 2013-06-19
* http://srobbin.com/jquery-plugins/backstretch/
* Copyright (c) 2013 Scott Robbin; Licensed MIT */
(function(a,d,p){a.fn.backstretch=function(c,b){(c===p||0===c.length)&&a.error("No images were supplied for Backstretch");0===a(d).scrollTop()&&d.scrollTo(0,0);return this.each(function(){var d=a(this),g=d.data("backstretch");if(g){if("string"==typeof c&&"function"==typeof g[c]){g[c](b);return}b=a.extend(g.options,b);g.destroy(!0)}g=new q(this,c,b);d.data("backstretch",g)})};a.backstretch=function(c,b){return a("body").backstretch(c,b).data("backstretch")};a.expr[":"].backstretch=function(c){return a(c).data("backstretch")!==p};a.fn.backstretch.defaults={centeredX:!0,centeredY:!0,duration:5E3,fade:0};var r={left:0,top:0,overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",zIndex:-999999},s={position:"absolute",display:"none",margin:0,padding:0,border:"none",width:"auto",height:"auto",maxHeight:"none",maxWidth:"none",zIndex:-999999},q=function(c,b,e){this.options=a.extend({},a.fn.backstretch.defaults,e||{});this.images=a.isArray(b)?b:[b];a.each(this.images,function(){a("<img />")[0].src=this});this.isBody=c===document.body;this.$container=a(c);this.$root=this.isBody?l?a(d):a(document):this.$container;c=this.$container.children(".backstretch").first();this.$wrap=c.length?c:a('<div class="backstretch hidden-print hidden-xs"></div>').css(r).appendTo(this.$container);this.isBody||(c=this.$container.css("position"),b=this.$container.css("zIndex"),this.$container.css({position:"static"===c?"relative":c,zIndex:"auto"===b?0:b,background:"none"}),this.$wrap.css({zIndex:-999998}));this.$wrap.css({position:this.isBody&&l?"fixed":"absolute"});this.index=0;this.show(this.index);a(d).on("resize.backstretch",a.proxy(this.resize,this)).on("orientationchange.backstretch",a.proxy(function(){this.isBody&&0===d.pageYOffset&&(d.scrollTo(0,1),this.resize())},this))};q.prototype={resize:function(){try{var a={left:0,top:0},b=this.isBody?this.$root.width():this.$root.innerWidth(),e=b,g=this.isBody?d.innerHeight?d.innerHeight:this.$root.height():this.$root.innerHeight(),j=e/this.$img.data("ratio"),f;j>=g?(f=(j-g)/2,this.options.centeredY&&(a.top="-"+f+"px")):(j=g,e=j*this.$img.data("ratio"),f=(e-b)/2,this.options.centeredX&&(a.left="-"+f+"px"));this.$wrap.css({width:b,height:g}).find("img:not(.deleteable)").css({width:e,height:j}).css(a)}catch(h){}return this},show:function(c){if(!(Math.abs(c)>this.images.length-1)){var b=this,e=b.$wrap.find("img").addClass("deleteable"),d={relatedTarget:b.$container[0]};b.$container.trigger(a.Event("backstretch.before",d),[b,c]);this.index=c;clearInterval(b.interval);b.$img=a("<img class='hidden-print' />").css(s).bind("load",function(f){var h=this.width||a(f.target).width();f=this.height||a(f.target).height();a(this).data("ratio",h/f);a(this).fadeIn(b.options.speed||b.options.fade,function(){e.remove();b.paused||b.cycle();a(["after","show"]).each(function(){b.$container.trigger(a.Event("backstretch."+this,d),[b,c])})});b.resize()}).appendTo(b.$wrap);b.$img.attr("src",b.images[c]);return b}},next:function(){return this.show(this.index<this.images.length-1?this.index+1:0)},prev:function(){return this.show(0===this.index?this.images.length-1:this.index-1)},pause:function(){this.paused=!0;return this},resume:function(){this.paused=!1;this.next();return this},cycle:function(){1<this.images.length&&(clearInterval(this.interval),this.interval=setInterval(a.proxy(function(){this.paused||this.next()},this),this.options.duration));return this},destroy:function(c){a(d).off("resize.backstretch orientationchange.backstretch");clearInterval(this.interval);c||this.$wrap.remove();this.$container.removeData("backstretch")}};var l,f=navigator.userAgent,m=navigator.platform,e=f.match(/AppleWebKit\/([0-9]+)/),e=!!e&&e[1],h=f.match(/Fennec\/([0-9]+)/),h=!!h&&h[1],n=f.match(/Opera Mobi\/([0-9]+)/),t=!!n&&n[1],k=f.match(/MSIE ([0-9]+)/),k=!!k&&k[1];l=!((-1<m.indexOf("iPhone")||-1<m.indexOf("iPad")||-1<m.indexOf("iPod"))&&e&&534>e||d.operamini&&"[object OperaMini]"==={}.toString.call(d.operamini)||n&&7458>t||-1<f.indexOf("Android")&&e&&533>e||h&&6>h||"palmGetResource"in d&&e&&534>e||-1<f.indexOf("MeeGo")&&-1<f.indexOf("NokiaBrowser/8.5.0")||k&&6>=k)})(jQuery,window);
;(function($){'use strict';$.fn.hiddenDimension=function(){if(arguments.length&&typeof arguments[0]==='string'){var dimension=arguments[0];if(this.is(':visible')){return this[dimension]();}
var visible_container=this.closest(':visible');if(!visible_container.is('body')){var container_clone=$('<div />').append(visible_container.children().clone()).css({position:'absolute',left:'-32000px',top:'-32000px',width:visible_container.width(),height:visible_container.height()}).appendTo(visible_container),element_index=$('*',visible_container).index(this),element_clone=$('*',container_clone).slice(element_index);element_clone.parentsUntil(':visible').show();var result=element_clone[dimension]();container_clone.remove();return result;}}
return undefined;};}(jQuery));;(function(){var Offcanvas,OffcanvasDropdown,OffcanvasTouch,transformCheck,__bind=function(fn,me){return function(){return fn.apply(me,arguments);};};OffcanvasDropdown=(function(){function OffcanvasDropdown(element){this.element=element;this._clickEvent=__bind(this._clickEvent,this);this.element=$(this.element);this.dropdown=this.element.parent().find(".dropdown-menu");this.element.on('click',this._clickEvent);}
OffcanvasDropdown.prototype._clickEvent=function(e){if(!this.dropdown.hasClass('shown')){e.preventDefault();}
this.dropdown.toggleClass("shown");return this.element.parent().toggleClass('active');};return OffcanvasDropdown;})();OffcanvasTouch=(function(){function OffcanvasTouch(element,location,offcanvas){this.element=element;this.location=location;this.offcanvas=offcanvas;this._clearCss=__bind(this._clearCss,this);this._getFade=__bind(this._getFade,this);this._getCss=__bind(this._getCss,this);this._touchEnd=__bind(this._touchEnd,this);this._touchMove=__bind(this._touchMove,this);this._touchStart=__bind(this._touchStart,this);this.endThreshold=130;this.startThreshold=this.element.hasClass('navbar-offcanvas-right')?$("body").outerWidth()-60:20;this.maxStartThreshold=this.element.hasClass('navbar-offcanvas-right')?$("body").outerWidth()-20:60;this.currentX=0;this.fade=this.element.hasClass('navbar-offcanvas-fade')?true:false;this.overlay=$('<div />').addClass('navbar-overlay');$(document).on("touchstart",this._touchStart);$(document).on("touchmove",this._touchMove);$(document).on("touchend",this._touchEnd);offcanvas.element.insertBefore(this.overlay);}
OffcanvasTouch.prototype._touchStart=function(e){return this.startX=e.originalEvent.touches[0].pageX;};OffcanvasTouch.prototype._touchMove=function(e){var x;if($(e.target).parents('.navbar-offcanvas').length>0){return true;}
if(this.startX>this.startThreshold&&this.startX<this.maxStartThreshold){e.preventDefault();x=e.originalEvent.touches[0].pageX-this.startX;x=this.element.hasClass('navbar-offcanvas-right')?-x:x;if(Math.abs(x)<this.element.outerWidth()){this.element.css(this._getCss(x));return this.element.css(this._getFade(x));}}else if(this.element.hasClass('in')){e.preventDefault();x=e.originalEvent.touches[0].pageX+(this.currentX-this.startX);x=this.element.hasClass('navbar-offcanvas-right')?-x:x;if(Math.abs(x)<this.element.outerWidth()){this.element.css(this._getCss(x));return this.element.css(this._getFade(x));}}};OffcanvasTouch.prototype._touchEnd=function(e){var end,x;if($(e.target).parents('.navbar-offcanvas').length>0){return true;}
x=e.originalEvent.changedTouches[0].pageX;end=this.element.hasClass('navbar-offcanvas-right')?Math.abs(x)>(this.endThreshold+50):x<(this.endThreshold+50);if(this.element.hasClass('in')&&end){this.currentX=0;this.element.removeClass('in').css(this._clearCss());}else if(Math.abs(x-this.startX)>this.endThreshold&&this.startX>this.startThreshold&&this.startX<this.maxStartThreshold){this.currentX=this.element.hasClass('navbar-offcanvas-right')?-this.element.outerWidth():this.element.outerWidth();this.element.toggleClass('in').css(this._clearCss());}else{this.element.css(this._clearCss());}
return this.offcanvas.bodyOverflow();};OffcanvasTouch.prototype._getCss=function(x){x=this.element.hasClass('navbar-offcanvas-right')?-x:x;return{"-webkit-transform":"translate3d("+x+"px, 0px, 0px)","-webkit-transition-duration":"0s","-moz-transform":"translate3d("+x+"px, 0px, 0px)","-moz-transition":"0s","-o-transform":"translate3d("+x+"px, 0px, 0px)","-o-transition":"0s","transform":"translate3d("+x+"px, 0px, 0px)","transition":"0s"};};OffcanvasTouch.prototype._getFade=function(x){if(this.fade){return{"opacity":x/this.element.outerWidth()};}else{return{};}};OffcanvasTouch.prototype._clearCss=function(){return{"-webkit-transform":"","-webkit-transition-duration":"","-moz-transform":"","-moz-transition":"","-o-transform":"","-o-transition":"","transform":"","transition":"","opacity":""};};return OffcanvasTouch;})();Offcanvas=(function(){function Offcanvas(element){var t,target;this.element=element;this.bodyOverflow=__bind(this.bodyOverflow,this);this._sendEventsAfter=__bind(this._sendEventsAfter,this);this._sendEventsBefore=__bind(this._sendEventsBefore,this);this._documentClicked=__bind(this._documentClicked,this);this._clicked=__bind(this._clicked,this);target=this.element.attr('data-target')?this.element.attr('data-target'):false;if(target){this.target=$(target);if(this.target.length&&!this.target.hasClass('js-offcanas-done')){this.element.addClass('js-offcanvas-has-events');this.location=this.target.hasClass("navbar-offcanvas-right")?"right":"left";this.target.addClass(transform?"offcanvas-transform js-offcanas-done":"offcanvas-position js-offcanas-done");this.target.data('offcanvas',this);this.element.on("click",this._clicked);$(document).on("click",this._documentClicked);if(this.target.hasClass('navbar-offcanvas-touch')){t=new OffcanvasTouch(this.target,this.location,this);}
this.target.find(".dropdown-toggle").each(function(){var d;return d=new OffcanvasDropdown(this);});}}else{console.warn('Offcanvas: `data-target` attribute must be present.');}}
Offcanvas.prototype._clicked=function(e){e.preventDefault();if(!this.overlay){this.overlay=$('<div />').addClass('navbar-overlay');$('body').prepend(this.overlay);}
this._sendEventsBefore();$(".navbar-offcanvas").removeClass('in');this.target.toggleClass('in');return this.bodyOverflow();};Offcanvas.prototype._documentClicked=function(e){var clickedEl;clickedEl=$(e.target);if(!clickedEl.hasClass('offcanvas-toggle')&&clickedEl.parents('.offcanvas-toggle').length===0&&clickedEl.parents('.navbar-offcanvas').length===0&&!clickedEl.hasClass('navbar-offcanvas')){if(this.target.hasClass('in')){e.preventDefault();this._sendEventsBefore();this.target.removeClass('in');return this.bodyOverflow();}}};Offcanvas.prototype._sendEventsBefore=function(){if(this.target.hasClass('in')){return this.target.trigger('show.bs.offcanvas');}else{return this.target.trigger('hide.bs.offcanvas');}};Offcanvas.prototype._sendEventsAfter=function(){if(this.target.hasClass('in')){return this.target.trigger('shown.bs.offcanvas');}else{return this.target.trigger('hidden.bs.offcanvas');}};Offcanvas.prototype._toggleOverlay=function(){if(this.target.hasClass('in')){$('.navbar-overlay').show();}else{$('.navbar-overlay').hide();}};Offcanvas.prototype.bodyOverflow=function(){this._toggleOverlay();this._sendEventsAfter();return $("body").css({'overflow':this.target.hasClass('in')?'hidden':'','position':this.target.hasClass('in')?'fixed':'','max-width':this.target.hasClass('in')?'100%':''});};return Offcanvas;})();transformCheck=(function(_this){return function(){var asSupport,el,regex,translate3D;el=document.createElement('div');translate3D="translate3d(0px, 0px, 0px)";regex=/translate3d\(0px, 0px, 0px\)/g;el.style.cssText="-webkit-transform: "+translate3D+"; -moz-transform: "+translate3D+"; -o-transform: "+translate3D+"; transform: "+translate3D;asSupport=el.style.cssText.match(regex);return _this.transform=asSupport.length!=null;};})(this);$(function(){transformCheck();$('[data-toggle="offcanvas"]').each(function(){var oc;return oc=new Offcanvas($(this));});return $('.offcanvas-toggle').each(function(){return $(this).on('click',function(e){var el,selector;if(!$(this).hasClass('js-offcanvas-has-events')){selector=$(this).attr('data-target');el=$(selector);if(el){el.removeClass('in');return $('body').css({'overflow':'','position':'','max-width':''});}}});});});}).call(this);;(function(e){var t=function(t,n){var r=e.extend({},e.fn.nivoSlider.defaults,n);var i={currentSlide:0,currentImage:"",totalSlides:0,running:false,paused:false,stop:false,controlNavEl:false};var s=e(t);s.data("nivo:vars",i).addClass("nivoSlider");var o=s.children();o.each(function(){var t=e(this);var n="";if(!t.is("img")){if(t.is("a")){t.addClass("nivo-imageLink");n=t}t=t.find("img:first")}var r=r===0?t.attr("width"):t.width(),s=s===0?t.attr("height"):t.height();if(n!==""){n.css("display","none")}t.css("display","none");i.totalSlides++});if(r.randomStart){r.startSlide=Math.floor(Math.random()*i.totalSlides)}if(r.startSlide>0){if(r.startSlide>=i.totalSlides){r.startSlide=i.totalSlides-1}i.currentSlide=r.startSlide}if(e(o[i.currentSlide]).is("img")){i.currentImage=e(o[i.currentSlide])}else{i.currentImage=e(o[i.currentSlide]).find("img:first")}if(e(o[i.currentSlide]).is("a")){e(o[i.currentSlide]).css("display","block")}var u=e("<img/>").addClass("nivo-main-image");u.attr("src",i.currentImage.attr("src")).show();s.append(u);e(window).resize(function(){s.children("img").width(s.width());u.attr("src",i.currentImage.attr("src"));u.stop().height("auto");e(".nivo-slice").remove();e(".nivo-box").remove()});s.append(e('<div class="nivo-caption"></div>'));var a=function(t){var n=e(".nivo-caption",s);if(i.currentImage.attr("title")!=""&&i.currentImage.attr("title")!=undefined){var r=i.currentImage.attr("title");if(r.substr(0,1)=="#")r=e(r).html();if(n.css("display")=="block"){setTimeout(function(){n.html(r)},t.animSpeed)}else{n.html(r);n.stop().fadeIn(t.animSpeed)}}else{n.stop().fadeOut(t.animSpeed)}};a(r);var f=0;if(!r.manualAdvance&&o.length>1){f=setInterval(function(){d(s,o,r,false)},r.pauseTime)}if(r.directionNav){s.append('<div class="nivo-directionNav"><a class="nivo-prevNav">'+r.prevText+'</a><a class="nivo-nextNav">'+r.nextText+"</a></div>");e(s).on("click","a.nivo-prevNav",function(){if(i.running){return false}clearInterval(f);f="";i.currentSlide-=2;d(s,o,r,"prev")});e(s).on("click","a.nivo-nextNav",function(){if(i.running){return false}clearInterval(f);f="";d(s,o,r,"next")})}if(r.controlNav){i.controlNavEl=e('<div class="nivo-controlNav"></div>');s.after(i.controlNavEl);for(var l=0;l<o.length;l++){if(r.controlNavThumbs){i.controlNavEl.addClass("nivo-thumbs-enabled");var c=o.eq(l);if(!c.is("img")){c=c.find("img:first")}if(c.attr("data-thumb"))i.controlNavEl.append('<a class="nivo-control" rel="'+l+'"><img src="'+c.attr("data-thumb")+'" alt="" /></a>')}else{i.controlNavEl.append('<a class="nivo-control" rel="'+l+'">'+(l+1)+"</a>")}}e("a:eq("+i.currentSlide+")",i.controlNavEl).addClass("active");e("a",i.controlNavEl).bind("click",function(){if(i.running)return false;if(e(this).hasClass("active"))return false;clearInterval(f);f="";u.attr("src",i.currentImage.attr("src"));i.currentSlide=e(this).attr("rel")-1;d(s,o,r,"control")})}if(r.pauseOnHover){s.hover(function(){i.paused=true;clearInterval(f);f=""},function(){i.paused=false;if(f===""&&!r.manualAdvance){f=setInterval(function(){d(s,o,r,false)},r.pauseTime)}})}s.bind("nivo:animFinished",function(){u.attr("src",i.currentImage.attr("src"));i.running=false;e(o).each(function(){if(e(this).is("a")){e(this).css("display","none")}});if(e(o[i.currentSlide]).is("a")){e(o[i.currentSlide]).css("display","block")}if(f===""&&!i.paused&&!r.manualAdvance){f=setInterval(function(){d(s,o,r,false)},r.pauseTime)}r.afterChange.call(this)});var h=function(t,n,r){if(e(r.currentImage).parent().is("a"))e(r.currentImage).parent().css("display","block");e('img[src="'+r.currentImage.attr("src")+'"]',t).not(".nivo-main-image,.nivo-control img").width(t.width()).css("visibility","hidden").show();var i=e('img[src="'+r.currentImage.attr("src")+'"]',t).not(".nivo-main-image,.nivo-control img").parent().is("a")?e('img[src="'+r.currentImage.attr("src")+'"]',t).not(".nivo-main-image,.nivo-control img").parent().height():e('img[src="'+r.currentImage.attr("src")+'"]',t).not(".nivo-main-image,.nivo-control img").height();for(var s=0;s<n.slices;s++){var o=Math.round(t.width()/n.slices);if(s===n.slices-1){t.append(e('<div class="nivo-slice" name="'+s+'"><img src="'+r.currentImage.attr("src")+'" style="position:absolute; width:'+t.width()+"px; height:auto; display:block !important; top:0; left:-"+(o+s*o-o)+'px;" /></div>').css({left:o*s+"px",width:t.width()-o*s+"px",height:i+"px",opacity:"0",overflow:"hidden"}))}else{t.append(e('<div class="nivo-slice" name="'+s+'"><img src="'+r.currentImage.attr("src")+'" style="position:absolute; width:'+t.width()+"px; height:auto; display:block !important; top:0; left:-"+(o+s*o-o)+'px;" /></div>').css({left:o*s+"px",width:o+"px",height:i+"px",opacity:"0",overflow:"hidden"}))}}e(".nivo-slice",t).height(i);u.stop().animate({height:e(r.currentImage).height()},n.animSpeed)};var p=function(t,n,r){if(e(r.currentImage).parent().is("a"))e(r.currentImage).parent().css("display","block");e('img[src="'+r.currentImage.attr("src")+'"]',t).not(".nivo-main-image,.nivo-control img").width(t.width()).css("visibility","hidden").show();var i=Math.round(t.width()/n.boxCols),s=Math.round(e('img[src="'+r.currentImage.attr("src")+'"]',t).not(".nivo-main-image,.nivo-control img").height()/n.boxRows);for(var o=0;o<n.boxRows;o++){for(var a=0;a<n.boxCols;a++){if(a===n.boxCols-1){t.append(e('<div class="nivo-box" name="'+a+'" rel="'+o+'"><img src="'+r.currentImage.attr("src")+'" style="position:absolute; width:'+t.width()+"px; height:auto; display:block; top:-"+s*o+"px; left:-"+i*a+'px;" /></div>').css({opacity:0,left:i*a+"px",top:s*o+"px",width:t.width()-i*a+"px"}));e('.nivo-box[name="'+a+'"]',t).height(e('.nivo-box[name="'+a+'"] img',t).height()+"px")}else{t.append(e('<div class="nivo-box" name="'+a+'" rel="'+o+'"><img src="'+r.currentImage.attr("src")+'" style="position:absolute; width:'+t.width()+"px; height:auto; display:block; top:-"+s*o+"px; left:-"+i*a+'px;" /></div>').css({opacity:0,left:i*a+"px",top:s*o+"px",width:i+"px"}));e('.nivo-box[name="'+a+'"]',t).height(e('.nivo-box[name="'+a+'"] img',t).height()+"px")}}}u.stop().animate({height:e(r.currentImage).height()},n.animSpeed)};var d=function(t,n,r,i){var s=t.data("nivo:vars");if(s&&s.currentSlide===s.totalSlides-1){r.lastSlide.call(this)}if((!s||s.stop)&&!i){return false}r.beforeChange.call(this);if(!i){u.attr("src",s.currentImage.attr("src"))}else{if(i==="prev"){u.attr("src",s.currentImage.attr("src"))}if(i==="next"){u.attr("src",s.currentImage.attr("src"))}}s.currentSlide++;if(s.currentSlide===s.totalSlides){s.currentSlide=0;r.slideshowEnd.call(this)}if(s.currentSlide<0){s.currentSlide=s.totalSlides-1}if(e(n[s.currentSlide]).is("img")){s.currentImage=e(n[s.currentSlide])}else{s.currentImage=e(n[s.currentSlide]).find("img:first")}if(r.controlNav){e("a",s.controlNavEl).removeClass("active");e("a:eq("+s.currentSlide+")",s.controlNavEl).addClass("active")}a(r);e(".nivo-slice",t).remove();e(".nivo-box",t).remove();var o=r.effect,f="";if(r.effect==="random"){f=new Array("sliceDownRight","sliceDownLeft","sliceUpRight","sliceUpLeft","sliceUpDown","sliceUpDownLeft","fold","fade","boxRandom","boxRain","boxRainReverse","boxRainGrow","boxRainGrowReverse");o=f[Math.floor(Math.random()*(f.length+1))];if(o===undefined){o="fade"}}if(r.effect.indexOf(",")!==-1){f=r.effect.split(",");o=f[Math.floor(Math.random()*f.length)];if(o===undefined){o="fade"}}if(s.currentImage.attr("data-transition")){o=s.currentImage.attr("data-transition")}s.running=true;var l=0,c=0,d="",m="",g="",y="";if(o==="sliceDown"||o==="sliceDownRight"||o==="sliceDownLeft"){h(t,r,s);l=0;c=0;d=e(".nivo-slice",t);if(o==="sliceDownLeft"){d=e(".nivo-slice",t)._reverse()}d.each(function(){var n=e(this);n.css({top:"0px"});if(c===r.slices-1){setTimeout(function(){n.animate({opacity:"1.0"},r.animSpeed,"",function(){t.trigger("nivo:animFinished")})},100+l)}else{setTimeout(function(){n.animate({opacity:"1.0"},r.animSpeed)},100+l)}l+=50;c++})}else if(o==="sliceUp"||o==="sliceUpRight"||o==="sliceUpLeft"){h(t,r,s);l=0;c=0;d=e(".nivo-slice",t);if(o==="sliceUpLeft"){d=e(".nivo-slice",t)._reverse()}d.each(function(){var n=e(this);n.css({bottom:"0px"});if(c===r.slices-1){setTimeout(function(){n.animate({opacity:"1.0"},r.animSpeed,"",function(){t.trigger("nivo:animFinished")})},100+l)}else{setTimeout(function(){n.animate({opacity:"1.0"},r.animSpeed)},100+l)}l+=50;c++})}else if(o==="sliceUpDown"||o==="sliceUpDownRight"||o==="sliceUpDownLeft"){h(t,r,s);l=0;c=0;var b=0;d=e(".nivo-slice",t);if(o==="sliceUpDownLeft"){d=e(".nivo-slice",t)._reverse()}d.each(function(){var n=e(this);if(c===0){n.css("top","0px");c++}else{n.css("bottom","0px");c=0}if(b===r.slices-1){setTimeout(function(){n.animate({opacity:"1.0"},r.animSpeed,"",function(){t.trigger("nivo:animFinished")})},100+l)}else{setTimeout(function(){n.animate({opacity:"1.0"},r.animSpeed)},100+l)}l+=50;b++})}else if(o==="fold"){h(t,r,s);l=0;c=0;e(".nivo-slice",t).each(function(){var n=e(this);var i=n.width();n.css({top:"0px",width:"0px"});if(c===r.slices-1){setTimeout(function(){n.animate({width:i,opacity:"1.0"},r.animSpeed,"",function(){t.trigger("nivo:animFinished")})},100+l)}else{setTimeout(function(){n.animate({width:i,opacity:"1.0"},r.animSpeed)},100+l)}l+=50;c++})}else if(o==="fade"){h(t,r,s);m=e(".nivo-slice:first",t);m.css({width:t.width()+"px"});m.animate({opacity:"1.0"},r.animSpeed*2,"",function(){t.trigger("nivo:animFinished")})}else if(o==="slideInRight"){h(t,r,s);m=e(".nivo-slice:first",t);m.css({width:"0px",opacity:"1"});m.animate({width:t.width()+"px"},r.animSpeed*2,"",function(){t.trigger("nivo:animFinished")})}else if(o==="slideInLeft"){h(t,r,s);m=e(".nivo-slice:first",t);m.css({width:"0px",opacity:"1",left:"",right:"0px"});m.animate({width:t.width()+"px"},r.animSpeed*2,"",function(){m.css({left:"0px",right:""});t.trigger("nivo:animFinished")})}else if(o==="boxRandom"){p(t,r,s);g=r.boxCols*r.boxRows;c=0;l=0;y=v(e(".nivo-box",t));y.each(function(){var n=e(this);if(c===g-1){setTimeout(function(){n.animate({opacity:"1"},r.animSpeed,"",function(){t.trigger("nivo:animFinished")})},100+l)}else{setTimeout(function(){n.animate({opacity:"1"},r.animSpeed)},100+l)}l+=20;c++})}else if(o==="boxRain"||o==="boxRainReverse"||o==="boxRainGrow"||o==="boxRainGrowReverse"){p(t,r,s);g=r.boxCols*r.boxRows;c=0;l=0;var w=0;var E=0;var S=[];S[w]=[];y=e(".nivo-box",t);if(o==="boxRainReverse"||o==="boxRainGrowReverse"){y=e(".nivo-box",t)._reverse()}y.each(function(){S[w][E]=e(this);E++;if(E===r.boxCols){w++;E=0;S[w]=[]}});for(var x=0;x<r.boxCols*2;x++){var T=x;for(var N=0;N<r.boxRows;N++){if(T>=0&&T<r.boxCols){(function(n,i,s,u,a){var f=e(S[n][i]);var l=f.width();var c=f.height();if(o==="boxRainGrow"||o==="boxRainGrowReverse"){f.width(0).height(0)}if(u===a-1){setTimeout(function(){f.animate({opacity:"1",width:l,height:c},r.animSpeed/1.3,"",function(){t.trigger("nivo:animFinished")})},100+s)}else{setTimeout(function(){f.animate({opacity:"1",width:l,height:c},r.animSpeed/1.3)},100+s)}})(N,T,l,c,g);c++}T--}l+=100}}};var v=function(e){for(var t,n,r=e.length;r;t=parseInt(Math.random()*r,10),n=e[--r],e[r]=e[t],e[t]=n);return e};var m=function(e){if(this.console&&typeof console.log!=="undefined"){console.log(e)}};this.stop=function(){if(!e(t).data("nivo:vars").stop){e(t).data("nivo:vars").stop=true;m("Stop Slider")}};this.start=function(){if(e(t).data("nivo:vars").stop){e(t).data("nivo:vars").stop=false;m("Start Slider")}};r.afterLoad.call(this);return this};e.fn.nivoSlider=function(n){return this.each(function(r,i){var s=e(this);if(s.data("nivoslider")){return s.data("nivoslider")}var o=new t(this,n);s.data("nivoslider",o)})};e.fn.nivoSlider.defaults={effect:"random",slices:15,boxCols:8,boxRows:4,animSpeed:500,pauseTime:3e3,startSlide:0,directionNav:true,controlNav:true,controlNavThumbs:false,pauseOnHover:true,manualAdvance:false,prevText:"Prev",nextText:"Next",randomStart:false,beforeChange:function(){},afterChange:function(){},slideshowEnd:function(){},lastSlide:function(){},afterLoad:function(){}};e.fn._reverse=[].reverse})(jQuery);;(function($){var eventNamespace='waitForImages';$.waitForImages={hasImageProperties:['backgroundImage','listStyleImage','borderImage','borderCornerImage']};$.expr[':'].uncached=function(obj){if(!$(obj).is('img[src!=""]')){return false;}
var img=document.createElement('img');img.src=obj.src;return!img.complete;};$.fn.waitForImages=function(finishedCallback,eachCallback,waitForAll){if($.isPlainObject(arguments[0])){eachCallback=finishedCallback.each;waitForAll=finishedCallback.waitForAll;finishedCallback=finishedCallback.finished;}
finishedCallback=finishedCallback||$.noop;eachCallback=eachCallback||$.noop;waitForAll=!!waitForAll;if(!$.isFunction(finishedCallback)||!$.isFunction(eachCallback)){throw new TypeError('An invalid callback was supplied.');};return this.each(function(){var obj=$(this),allImgs=[];if(waitForAll){var hasImgProperties=$.waitForImages.hasImageProperties||[],matchUrl=/url\((['"]?)(.*?)\1\)/g;obj.find('*').each(function(){var element=$(this);if(element.is('img:uncached')){allImgs.push({src:element.attr('src'),element:element[0]});}
$.each(hasImgProperties,function(i,property){var propertyValue=element.css(property);if(!propertyValue){return true;}
var match;while(match=matchUrl.exec(propertyValue)){allImgs.push({src:match[2],element:element[0]});};});});}else{obj.find('img:uncached').each(function(){allImgs.push({src:this.src,element:this});});};var allImgsLength=allImgs.length,allImgsLoaded=0;if(allImgsLength==0){finishedCallback.call(obj[0]);};$.each(allImgs,function(i,img){var image=new Image;$(image).bind('load.'+eventNamespace+' error.'+eventNamespace,function(event){allImgsLoaded++;eachCallback.call(img.element,allImgsLoaded,allImgsLength,event.type=='load');if(allImgsLoaded==allImgsLength){finishedCallback.call(obj[0]);return false;};});image.src=img.src;});});};})(jQuery);;$.fn.lazy=function(threshold,callback){var $w=$(window),th=threshold||0,retina=window.devicePixelRatio>1,attrib=retina?"data-src-retina":"data-src",images=this,loaded;this.one("lazy",function(){var source=this.getAttribute(attrib);source=source||this.getAttribute("data-src");if(source){this.setAttribute("src",source);if(typeof callback==="function")callback.call(this);}});function lazy(){var inview=images.filter(function(){var $e=$(this);var wt=$w.scrollTop(),wb=wt+$w.height(),et=$e.offset().top,eb=et+$e.height();return eb>=wt-th&&et<=wb+th;});loaded=inview.trigger("lazy");images=images.not(loaded);}
$w.on("scroll.lazy resize.lazy lookup.lazy",lazy);lazy();return this;};;(function(root,factory){if(typeof define==="function"&&define.amd){define(["exports","jquery"],function(exports,$){return factory(exports,$);});}
else if(typeof exports!=="undefined"){var $=require("jquery");factory(exports,$);}
else{factory(root,(root.jQuery||root.Zepto||root.ender||root.$));}}(this,function(exports,$){var patterns={validate:/^[a-z_][a-z0-9_]*(?:\[(?:\d*|[a-z0-9_]+)\])*$/i,key:/[a-z0-9_]+|(?=\[\])/gi,push:/^$/,fixed:/^\d+$/,named:/^[a-z0-9_]+$/i};function FormSerializer(helper,$form){var data={},pushes={};function build(base,key,value){base[key]=value;return base;}
function makeObject(root,value){var keys=root.match(patterns.key),k;while((k=keys.pop())!==undefined){if(patterns.push.test(k)){var idx=incrementPush(root.replace(/\[\]$/,''));value=build({},idx,value);}
else if(patterns.fixed.test(k)){value=build({},k,value);}
else if(patterns.named.test(k)){value=build({},k,value);}}
return value;}
function incrementPush(key){if(pushes[key]===undefined){pushes[key]=0;}
return pushes[key]++;}
function encode(pair){switch($('[name="'+pair.name+'"]',$form).attr("type")){case"checkbox":return pair.value==="on"?true:pair.value;default:return pair.value;}}
function addPair(pair){if(!patterns.validate.test(pair.name))return this;var obj=makeObject(pair.name,encode(pair));data=helper.extend(true,data,obj);return this;}
function addPairs(pairs){if(!helper.isArray(pairs)){throw new Error("formSerializer.addPairs expects an Array");}
for(var i=0,len=pairs.length;i<len;i++){this.addPair(pairs[i]);}
return this;}
function serialize(){return data;}
function serializeJSON(){return JSON.stringify(serialize());}
this.addPair=addPair;this.addPairs=addPairs;this.serialize=serialize;this.serializeJSON=serializeJSON;}
FormSerializer.patterns=patterns;FormSerializer.serializeObject=function serializeObject(){return new FormSerializer($,this).addPairs(this.serializeArray()).serialize();};FormSerializer.serializeJSON=function serializeJSON(){return new FormSerializer($,this).addPairs(this.serializeArray()).serializeJSON();};if(typeof $.fn!=="undefined"){$.fn.serializeObject=FormSerializer.serializeObject;$.fn.serializeJSON=FormSerializer.serializeJSON;}
exports.FormSerializer=FormSerializer;return FormSerializer;}));
;/*
 * Bootstrap v3.3.4 (http://getbootstrap.com)
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */

/*
 * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=61f368255baa5f1a73fe)
 * Config saved to config.json and https://gist.github.com/61f368255baa5f1a73fe
 */
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(t){"use strict";var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var i=t(this),n=i.data("bs.alert");n||i.data("bs.alert",n=new o(this)),"string"==typeof e&&n[e].call(i)})}var i='[data-dismiss="alert"]',o=function(e){t(e).on("click",i,this.close)};o.VERSION="3.3.2",o.TRANSITION_DURATION=150,o.prototype.close=function(e){function i(){a.detach().trigger("closed.bs.alert").remove()}var n=t(this),s=n.attr("data-target");s||(s=n.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,""));var a=t(s);e&&e.preventDefault(),a.length||(a=n.closest(".alert")),a.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(a.removeClass("in"),t.support.transition&&a.hasClass("fade")?a.one("bsTransitionEnd",i).emulateTransitionEnd(o.TRANSITION_DURATION):i())};var n=t.fn.alert;t.fn.alert=e,t.fn.alert.Constructor=o,t.fn.alert.noConflict=function(){return t.fn.alert=n,this},t(document).on("click.bs.alert.data-api",i,o.prototype.close)}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.button"),s="object"==typeof e&&e;n||o.data("bs.button",n=new i(this,s)),"toggle"==e?n.toggle():e&&n.setState(e)})}var i=function(e,o){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,o),this.isLoading=!1};i.VERSION="3.3.2",i.DEFAULTS={loadingText:"loading..."},i.prototype.setState=function(e){var i="disabled",o=this.$element,n=o.is("input")?"val":"html",s=o.data();e+="Text",null==s.resetText&&o.data("resetText",o[n]()),setTimeout(t.proxy(function(){o[n](null==s[e]?this.options[e]:s[e]),"loadingText"==e?(this.isLoading=!0,o.addClass(i).attr(i,i)):this.isLoading&&(this.isLoading=!1,o.removeClass(i).removeAttr(i))},this),0)},i.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")&&(i.prop("checked")&&this.$element.hasClass("active")?t=!1:e.find(".active").removeClass("active")),t&&i.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));t&&this.$element.toggleClass("active")};var o=t.fn.button;t.fn.button=e,t.fn.button.Constructor=i,t.fn.button.noConflict=function(){return t.fn.button=o,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(i){var o=t(i.target);o.hasClass("btn")||(o=o.closest(".btn")),e.call(o,"toggle"),i.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(e){t(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))})}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.carousel"),s=t.extend({},i.DEFAULTS,o.data(),"object"==typeof e&&e),a="string"==typeof e?e:s.slide;n||o.data("bs.carousel",n=new i(this,s)),"number"==typeof e?n.to(e):a?n[a]():s.interval&&n.pause().cycle()})}var i=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",t.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",t.proxy(this.pause,this)).on("mouseleave.bs.carousel",t.proxy(this.cycle,this))};i.VERSION="3.3.2",i.TRANSITION_DURATION=600,i.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},i.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},i.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},i.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},i.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e),o="prev"==t&&0===i||"next"==t&&i==this.$items.length-1;if(o&&!this.options.wrap)return e;var n="prev"==t?-1:1,s=(i+n)%this.$items.length;return this.$items.eq(s)},i.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));return t>this.$items.length-1||0>t?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",this.$items.eq(t))},i.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},i.prototype.next=function(){return this.sliding?void 0:this.slide("next")},i.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},i.prototype.slide=function(e,o){var n=this.$element.find(".item.active"),s=o||this.getItemForDirection(e,n),a=this.interval,r="next"==e?"left":"right",l=this;if(s.hasClass("active"))return this.sliding=!1;var h=s[0],d=t.Event("slide.bs.carousel",{relatedTarget:h,direction:r});if(this.$element.trigger(d),!d.isDefaultPrevented()){if(this.sliding=!0,a&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var p=t(this.$indicators.children()[this.getItemIndex(s)]);p&&p.addClass("active")}var c=t.Event("slid.bs.carousel",{relatedTarget:h,direction:r});return t.support.transition&&this.$element.hasClass("slide")?(s.addClass(e),s[0].offsetWidth,n.addClass(r),s.addClass(r),n.one("bsTransitionEnd",function(){s.removeClass([e,r].join(" ")).addClass("active"),n.removeClass(["active",r].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(c)},0)}).emulateTransitionEnd(i.TRANSITION_DURATION)):(n.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(c)),a&&this.cycle(),this}};var o=t.fn.carousel;t.fn.carousel=e,t.fn.carousel.Constructor=i,t.fn.carousel.noConflict=function(){return t.fn.carousel=o,this};var n=function(i){var o,n=t(this),s=t(n.attr("data-target")||(o=n.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var a=t.extend({},s.data(),n.data()),r=n.attr("data-slide-to");r&&(a.interval=!1),e.call(s,a),r&&s.data("bs.carousel").to(r),i.preventDefault()}};t(document).on("click.bs.carousel.data-api","[data-slide]",n).on("click.bs.carousel.data-api","[data-slide-to]",n),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var i=t(this);e.call(i,i.data())})})}(jQuery),+function(t){"use strict";function e(e){e&&3===e.which||(t(n).remove(),t(s).each(function(){var o=t(this),n=i(o),s={relatedTarget:this};n.hasClass("open")&&(n.trigger(e=t.Event("hide.bs.dropdown",s)),e.isDefaultPrevented()||(o.attr("aria-expanded","false"),n.removeClass("open").trigger("hidden.bs.dropdown",s)))}))}function i(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var o=i&&t(i);return o&&o.length?o:e.parent()}function o(e){return this.each(function(){var i=t(this),o=i.data("bs.dropdown");o||i.data("bs.dropdown",o=new a(this)),"string"==typeof e&&o[e].call(i)})}var n=".dropdown-backdrop",s='[data-toggle="dropdown"]',a=function(e){t(e).on("click.bs.dropdown",this.toggle)};a.VERSION="3.3.2",a.prototype.toggle=function(o){var n=t(this);if(!n.is(".disabled, :disabled")){var s=i(n),a=s.hasClass("open");if(e(),!a){"ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&t('<div class="dropdown-backdrop"/>').insertAfter(t(this)).on("click",e);var r={relatedTarget:this};if(s.trigger(o=t.Event("show.bs.dropdown",r)),o.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),s.toggleClass("open").trigger("shown.bs.dropdown",r)}return!1}},a.prototype.keydown=function(e){if(/(38|40|27|32)/.test(e.which)&&!/input|textarea/i.test(e.target.tagName)){var o=t(this);if(e.preventDefault(),e.stopPropagation(),!o.is(".disabled, :disabled")){var n=i(o),a=n.hasClass("open");if(!a&&27!=e.which||a&&27==e.which)return 27==e.which&&n.find(s).trigger("focus"),o.trigger("click");var r=" li:not(.disabled):visible a",l=n.find('[role="menu"]'+r+', [role="listbox"]'+r);if(l.length){var h=l.index(e.target);38==e.which&&h>0&&h--,40==e.which&&h<l.length-1&&h++,~h||(h=0),l.eq(h).trigger("focus")}}}};var r=t.fn.dropdown;t.fn.dropdown=o,t.fn.dropdown.Constructor=a,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=r,this},t(document).on("click.bs.dropdown.data-api",e).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",s,a.prototype.toggle).on("keydown.bs.dropdown.data-api",s,a.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="menu"]',a.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="listbox"]',a.prototype.keydown)}(jQuery),+function(t){"use strict";function e(e,o){return this.each(function(){var n=t(this),s=n.data("bs.modal"),a=t.extend({},i.DEFAULTS,n.data(),"object"==typeof e&&e);s||n.data("bs.modal",s=new i(this,a)),"string"==typeof e?s[e](o):a.show&&s.show(o)})}var i=function(e,i){this.options=i,this.$body=t(document.body),this.$element=t(e),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,t.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};i.VERSION="3.3.2",i.TRANSITION_DURATION=300,i.BACKDROP_TRANSITION_DURATION=150,i.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},i.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},i.prototype.show=function(e){var o=this,n=t.Event("show.bs.modal",{relatedTarget:e});this.$element.trigger(n),this.isShown||n.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',t.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){o.$element.one("mouseup.dismiss.bs.modal",function(e){t(e.target).is(o.$element)&&(o.ignoreBackdropClick=!0)})}),this.backdrop(function(){var n=t.support.transition&&o.$element.hasClass("fade");o.$element.parent().length||o.$element.appendTo(o.$body),o.$element.show().scrollTop(0),o.adjustDialog(),n&&o.$element[0].offsetWidth,o.$element.addClass("in").attr("aria-hidden",!1),o.enforceFocus();var s=t.Event("shown.bs.modal",{relatedTarget:e});n?o.$dialog.one("bsTransitionEnd",function(){o.$element.trigger("focus").trigger(s)}).emulateTransitionEnd(i.TRANSITION_DURATION):o.$element.trigger("focus").trigger(s)}))},i.prototype.hide=function(e){e&&e.preventDefault(),e=t.Event("hide.bs.modal"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),t(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),t.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",t.proxy(this.hideModal,this)).emulateTransitionEnd(i.TRANSITION_DURATION):this.hideModal())},i.prototype.enforceFocus=function(){t(document).off("focusin.bs.modal").on("focusin.bs.modal",t.proxy(function(t){this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},i.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",t.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},i.prototype.resize=function(){this.isShown?t(window).on("resize.bs.modal",t.proxy(this.handleUpdate,this)):t(window).off("resize.bs.modal")},i.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")})},i.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},i.prototype.backdrop=function(e){var o=this,n=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var s=t.support.transition&&n;if(this.$backdrop=t('<div class="modal-backdrop '+n+'" />').appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",t.proxy(function(t){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),s&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;s?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):e()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var a=function(){o.removeBackdrop(),e&&e()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",a).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):a()}else e&&e()},i.prototype.handleUpdate=function(){this.adjustDialog()},i.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},i.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},i.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},i.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",t+this.scrollbarWidth)},i.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},i.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var o=t.fn.modal;t.fn.modal=e,t.fn.modal.Constructor=i,t.fn.modal.noConflict=function(){return t.fn.modal=o,this},t(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(i){var o=t(this),n=o.attr("href"),s=t(o.attr("data-target")||n&&n.replace(/.*(?=#[^\s]+$)/,"")),a=s.data("bs.modal")?"toggle":t.extend({remote:!/#/.test(n)&&n},s.data(),o.data());o.is("a")&&i.preventDefault(),s.one("show.bs.modal",function(t){t.isDefaultPrevented()||s.one("hidden.bs.modal",function(){o.is(":visible")&&o.trigger("focus")})}),e.call(s,a,this)})}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.tooltip"),s="object"==typeof e&&e;(n||!/destroy|hide/.test(e))&&(n||o.data("bs.tooltip",n=new i(this,s)),"string"==typeof e&&n[e]())})}var i=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.init("tooltip",t,e)};i.VERSION="3.3.2",i.TRANSITION_DURATION=150,i.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},i.prototype.init=function(e,i,o){if(this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(o),this.$viewport=this.options.viewport&&t(this.options.viewport.selector||this.options.viewport),this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var n=this.options.trigger.split(" "),s=n.length;s--;){var a=n[s];if("click"==a)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=a){var r="hover"==a?"mouseenter":"focusin",l="hover"==a?"mouseleave":"focusout";this.$element.on(r+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},i.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,o){i[t]!=o&&(e[t]=o)}),e},i.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i&&i.$tip&&i.$tip.is(":visible")?void(i.hoverState="in"):(i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show())},i.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()},i.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var o=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!o)return;var n=this,s=this.tip(),a=this.getUID(this.type);this.setContent(),s.attr("id",a),this.$element.attr("aria-describedby",a),this.options.animation&&s.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,h=l.test(r);h&&(r=r.replace(l,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element);var d=this.getPosition(),p=s[0].offsetWidth,c=s[0].offsetHeight;if(h){var f=r,u=this.options.container?t(this.options.container):this.$element.parent(),g=this.getPosition(u);r="bottom"==r&&d.bottom+c>g.bottom?"top":"top"==r&&d.top-c<g.top?"bottom":"right"==r&&d.right+p>g.width?"left":"left"==r&&d.left-p<g.left?"right":r,s.removeClass(f).addClass(r)}var m=this.getCalculatedOffset(r,d,p,c);this.applyPlacement(m,r);var v=function(){var t=n.hoverState;n.$element.trigger("shown.bs."+n.type),n.hoverState=null,"out"==t&&n.leave(n)};t.support.transition&&this.$tip.hasClass("fade")?s.one("bsTransitionEnd",v).emulateTransitionEnd(i.TRANSITION_DURATION):v()}},i.prototype.applyPlacement=function(e,i){var o=this.tip(),n=o[0].offsetWidth,s=o[0].offsetHeight,a=parseInt(o.css("margin-top"),10),r=parseInt(o.css("margin-left"),10);isNaN(a)&&(a=0),isNaN(r)&&(r=0),e.top=e.top+a,e.left=e.left+r,t.offset.setOffset(o[0],t.extend({using:function(t){o.css({top:Math.round(t.top),left:Math.round(t.left)})}},e),0),o.addClass("in");var l=o[0].offsetWidth,h=o[0].offsetHeight;"top"==i&&h!=s&&(e.top=e.top+s-h);var d=this.getViewportAdjustedDelta(i,e,l,h);d.left?e.left+=d.left:e.top+=d.top;var p=/top|bottom/.test(i),c=p?2*d.left-n+l:2*d.top-s+h,f=p?"offsetWidth":"offsetHeight";o.offset(e),this.replaceArrow(c,o[0][f],p)},i.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?"left":"top",50*(1-t/e)+"%").css(i?"top":"left","")},i.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e),t.removeClass("fade in top bottom left right")},i.prototype.hide=function(e){function o(){"in"!=n.hoverState&&s.detach(),n.$element.removeAttr("aria-describedby").trigger("hidden.bs."+n.type),e&&e()}var n=this,s=t(this.$tip),a=t.Event("hide.bs."+this.type);return this.$element.trigger(a),a.isDefaultPrevented()?void 0:(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",o).emulateTransitionEnd(i.TRANSITION_DURATION):o(),this.hoverState=null,this)},i.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},i.prototype.hasContent=function(){return this.getTitle()},i.prototype.getPosition=function(e){e=e||this.$element;var i=e[0],o="BODY"==i.tagName,n=i.getBoundingClientRect();null==n.width&&(n=t.extend({},n,{width:n.right-n.left,height:n.bottom-n.top}));var s=o?{top:0,left:0}:e.offset(),a={scroll:o?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop()},r=o?{width:t(window).width(),height:t(window).height()}:null;return t.extend({},n,a,r,s)},i.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},i.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(t)){var r=e.top-s-a.scroll,l=e.top+s-a.scroll+o;r<a.top?n.top=a.top-r:l>a.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;h<a.left?n.left=a.left-h:d>a.width&&(n.left=a.left+a.width-d)}return n},i.prototype.getTitle=function(){var t,e=this.$element,i=this.options;return t=e.attr("data-original-title")||("function"==typeof i.title?i.title.call(e[0]):i.title)},i.prototype.getUID=function(t){do t+=~~(1e6*Math.random());while(document.getElementById(t));return t},i.prototype.tip=function(){return this.$tip=this.$tip||t(this.options.template)},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},i.prototype.enable=function(){this.enabled=!0},i.prototype.disable=function(){this.enabled=!1},i.prototype.toggleEnabled=function(){this.enabled=!this.enabled},i.prototype.toggle=function(e){var i=this;e&&(i=t(e.currentTarget).data("bs."+this.type),i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i))),i.tip().hasClass("in")?i.leave(i):i.enter(i)},i.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type)})};var o=t.fn.tooltip;t.fn.tooltip=e,t.fn.tooltip.Constructor=i,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=o,this}}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.popover"),s="object"==typeof e&&e;(n||!/destroy|hide/.test(e))&&(n||o.data("bs.popover",n=new i(this,s)),"string"==typeof e&&n[e]())})}var i=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");i.VERSION="3.3.2",i.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),i.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),i.prototype.constructor=i,i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](e),t.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof i?"html":"append":"text"](i),t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},i.prototype.hasContent=function(){return this.getTitle()||this.getContent()},i.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var o=t.fn.popover;t.fn.popover=e,t.fn.popover.Constructor=i,t.fn.popover.noConflict=function(){return t.fn.popover=o,this}}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.tab");n||o.data("bs.tab",n=new i(this)),"string"==typeof e&&n[e]()})}var i=function(e){this.element=t(e)};i.VERSION="3.3.2",i.TRANSITION_DURATION=150,i.prototype.show=function(){var e=this.element,i=e.closest("ul:not(.dropdown-menu)"),o=e.data("target");if(o||(o=e.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,"")),!e.parent("li").hasClass("active")){var n=i.find(".active:last a"),s=t.Event("hide.bs.tab",{relatedTarget:e[0]}),a=t.Event("show.bs.tab",{relatedTarget:n[0]});if(n.trigger(s),e.trigger(a),!a.isDefaultPrevented()&&!s.isDefaultPrevented()){var r=t(o);this.activate(e.closest("li"),i),this.activate(r,r.parent(),function(){n.trigger({type:"hidden.bs.tab",relatedTarget:e[0]}),e.trigger({type:"shown.bs.tab",relatedTarget:n[0]})})}}},i.prototype.activate=function(e,o,n){function s(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),e.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),r?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu").length&&e.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),n&&n()}var a=o.find("> .active"),r=n&&t.support.transition&&(a.length&&a.hasClass("fade")||!!o.find("> .fade").length);a.length&&r?a.one("bsTransitionEnd",s).emulateTransitionEnd(i.TRANSITION_DURATION):s(),a.removeClass("in")};var o=t.fn.tab;t.fn.tab=e,t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=o,this};var n=function(i){i.preventDefault(),e.call(t(this),"show")};t(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',n).on("click.bs.tab.data-api",'[data-toggle="pill"]',n)}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.affix"),s="object"==typeof e&&e;n||o.data("bs.affix",n=new i(this,s)),"string"==typeof e&&n[e]()})}var i=function(e,o){this.options=t.extend({},i.DEFAULTS,o),this.$target=t(this.options.target).on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(e),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};i.VERSION="3.3.2",i.RESET="affix affix-top affix-bottom",i.DEFAULTS={offset:0,target:window},i.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return i>n?"top":!1;if("bottom"==this.affixed)return null!=i?n+this.unpin<=s.top?!1:"bottom":t-o>=n+a?!1:"bottom";var r=null==this.affixed,l=r?n:s.top,h=r?a:e;return null!=i&&i>=n?"top":null!=o&&l+h>=t-o?"bottom":!1},i.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(i.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},i.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},i.prototype.checkPosition=function(){if(this.$element.is(":visible")){var e=this.$element.height(),o=this.options.offset,n=o.top,s=o.bottom,a=t(document.body).height();"object"!=typeof o&&(s=n=o),"function"==typeof n&&(n=o.top(this.$element)),"function"==typeof s&&(s=o.bottom(this.$element));var r=this.getState(a,e,n,s);if(this.affixed!=r){null!=this.unpin&&this.$element.css("top","");var l="affix"+(r?"-"+r:""),h=t.Event(l+".bs.affix");if(this.$element.trigger(h),h.isDefaultPrevented())return;this.affixed=r,this.unpin="bottom"==r?this.getPinnedOffset():null,this.$element.removeClass(i.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==r&&this.$element.offset({top:a-e-s})}};var o=t.fn.affix;t.fn.affix=e,t.fn.affix.Constructor=i,t.fn.affix.noConflict=function(){return t.fn.affix=o,this},t(window).on("load",function(){t('[data-spy="affix"]').each(function(){var i=t(this),o=i.data();o.offset=o.offset||{},null!=o.offsetBottom&&(o.offset.bottom=o.offsetBottom),null!=o.offsetTop&&(o.offset.top=o.offsetTop),e.call(i,o)})})}(jQuery),+function(t){"use strict";function e(e){var i,o=e.attr("data-target")||(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return t(o)}function i(e){return this.each(function(){var i=t(this),n=i.data("bs.collapse"),s=t.extend({},o.DEFAULTS,i.data(),"object"==typeof e&&e);!n&&s.toggle&&/show|hide/.test(e)&&(s.toggle=!1),n||i.data("bs.collapse",n=new o(this,s)),"string"==typeof e&&n[e]()})}var o=function(e,i){this.$element=t(e),this.options=t.extend({},o.DEFAULTS,i),this.$trigger=t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};o.VERSION="3.3.2",o.TRANSITION_DURATION=350,o.DEFAULTS={toggle:!0},o.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},o.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e,n=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(n&&n.length&&(e=n.data("bs.collapse"),e&&e.transitioning))){var s=t.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){n&&n.length&&(i.call(n,"hide"),e||n.data("bs.collapse",null));var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var r=function(){this.$element.removeClass("collapsing").addClass("collapse in")[a](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return r.call(this);var l=t.camelCase(["scroll",a].join("-"));this.$element.one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(o.TRANSITION_DURATION)[a](this.$element[0][l])}}}},o.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var n=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return t.support.transition?void this.$element[i](0).one("bsTransitionEnd",t.proxy(n,this)).emulateTransitionEnd(o.TRANSITION_DURATION):n.call(this)}}},o.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},o.prototype.getParent=function(){return t(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy(function(i,o){var n=t(o);
this.addAriaAndCollapsedClass(e(n),n)},this)).end()},o.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var n=t.fn.collapse;t.fn.collapse=i,t.fn.collapse.Constructor=o,t.fn.collapse.noConflict=function(){return t.fn.collapse=n,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(o){var n=t(this);n.attr("data-target")||o.preventDefault();var s=e(n),a=s.data("bs.collapse"),r=a?"toggle":n.data();i.call(s,r)})}(jQuery),+function(t){"use strict";function e(i,o){this.$body=t(document.body),this.$scrollElement=t(t(i).is(document.body)?window:i),this.options=t.extend({},e.DEFAULTS,o),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",t.proxy(this.process,this)),this.refresh(),this.process()}function i(i){return this.each(function(){var o=t(this),n=o.data("bs.scrollspy"),s="object"==typeof i&&i;n||o.data("bs.scrollspy",n=new e(this,s)),"string"==typeof i&&n[i]()})}e.VERSION="3.3.2",e.DEFAULTS={offset:10},e.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},e.prototype.refresh=function(){var e=this,i="offset",o=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),t.isWindow(this.$scrollElement[0])||(i="position",o=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var e=t(this),n=e.data("target")||e.attr("href"),s=/^#./.test(n)&&t(n);return s&&s.length&&s.is(":visible")&&[[s[i]().top+o,n]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){e.offsets.push(this[0]),e.targets.push(this[1])})},e.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),e>=o)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e<n[0])return this.activeTarget=null,this.clear();for(t=n.length;t--;)a!=s[t]&&e>=n[t]&&(void 0===n[t+1]||e<=n[t+1])&&this.activate(s[t])},e.prototype.activate=function(e){this.activeTarget=e,this.clear();var i=this.selector+'[data-target="'+e+'"],'+this.selector+'[href="'+e+'"]',o=t(i).parents("li").addClass("active");o.parent(".dropdown-menu").length&&(o=o.closest("li.dropdown").addClass("active")),o.trigger("activate.bs.scrollspy")},e.prototype.clear=function(){t(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var o=t.fn.scrollspy;t.fn.scrollspy=i,t.fn.scrollspy.Constructor=e,t.fn.scrollspy.noConflict=function(){return t.fn.scrollspy=o,this},t(window).on("load.bs.scrollspy.data-api",function(){t('[data-spy="scroll"]').each(function(){var e=t(this);i.call(e,e.data())})})}(jQuery),+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,o=this;t(this).one("bsTransitionEnd",function(){i=!0});var n=function(){i||t(o).trigger(t.support.transition.end)};return setTimeout(n,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){return t(e.target).is(this)?e.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery);
;!function($){var WinReszier=(function(){var registered=[];var inited=false;var timer;var resize=function(ev){clearTimeout(timer);timer=setTimeout(notify,100);};var notify=function(){for(var i=0,cnt=registered.length;i<cnt;i++){registered[i].apply();}};return{register:function(fn){registered.push(fn);if(inited===false){$(window).bind('resize',resize);inited=true;}},unregister:function(fn){for(var i=0,cnt=registered.length;i<cnt;i++){if(registered[i]==fn){delete registered[i];break;}}}}}());var TabDrop=function(element,options){this.element=$(element);this.dropdown=$('<li class="dropdown hide pull-right tabdrop"><a class="dropdown-toggle" data-toggle="dropdown" href="#">'+options.text+' <b class="caret"></b></a><ul class="dropdown-menu"></ul></li>').prependTo(this.element);if(this.element.parent().is('.tabs-below')){this.dropdown.addClass('dropup');}
WinReszier.register($.proxy(this.layout,this));this.layout();};TabDrop.prototype={constructor:TabDrop,layout:function(){var collection=[];this.dropdown.removeClass('hide');this.element.append(this.dropdown.find('li')).find('>li').not('.tabdrop').each(function(){if(this.offsetTop>0){collection.push(this);}});if(collection.length>0){collection=$(collection);this.dropdown.find('ul').empty().append(collection);if(this.dropdown.find('.active').length==1){this.dropdown.addClass('active');}else{this.dropdown.removeClass('active');}}else{this.dropdown.addClass('hide');}}}
$.fn.tabdrop=function(option){return this.each(function(){var $this=$(this),data=$this.data('tabdrop'),options=typeof option==='object'&&option;if(!data){$this.data('tabdrop',(data=new TabDrop(this,$.extend({},$.fn.tabdrop.defaults,options))));}
if(typeof option=='string'){data[option]();}})};$.fn.tabdrop.defaults={text:'<i class="icon-align-justify"></i>'};$.fn.tabdrop.Constructor=TabDrop;}(window.jQuery);;(function(root,factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory);}
else if(typeof module==="object"&&module.exports){var jQuery;try{jQuery=require("jquery");}
catch(err){jQuery=null;}
module.exports=factory(jQuery);}
else{root.Slider=factory(root.jQuery);}}(this,function($){var Slider;(function($){'use strict';var slice=Array.prototype.slice;function noop(){}
function defineBridget($){if(!$){return;}
function addOptionMethod(PluginClass){if(PluginClass.prototype.option){return;}
PluginClass.prototype.option=function(opts){if(!$.isPlainObject(opts)){return;}
this.options=$.extend(true,this.options,opts);};}
var logError=typeof console==='undefined'?noop:function(message){console.error(message);};function bridge(namespace,PluginClass){$.fn[namespace]=function(options){if(typeof options==='string'){var args=slice.call(arguments,1);for(var i=0,len=this.length;i<len;i++){var elem=this[i];var instance=$.data(elem,namespace);if(!instance){logError("cannot call methods on "+namespace+" prior to initialization; "+"attempted to call '"+options+"'");continue;}
if(!$.isFunction(instance[options])||options.charAt(0)==='_'){logError("no such method '"+options+"' for "+namespace+" instance");continue;}
var returnValue=instance[options].apply(instance,args);if(returnValue!==undefined&&returnValue!==instance){return returnValue;}}
return this;}else{var objects=this.map(function(){var instance=$.data(this,namespace);if(instance){instance.option(options);instance._init();}else{instance=new PluginClass(this,options);$.data(this,namespace,instance);}
return $(this);});if(!objects||objects.length>1){return objects;}else{return objects[0];}}};}
$.bridget=function(namespace,PluginClass){addOptionMethod(PluginClass);bridge(namespace,PluginClass);};return $.bridget;}
defineBridget($);})($);(function($){var ErrorMsgs={formatInvalidInputErrorMsg:function(input){return"Invalid input value '"+input+"' passed in";},callingContextNotSliderInstance:"Calling context element does not have instance of Slider bound to it. Check your code to make sure the JQuery object returned from the call to the slider() initializer is calling the method"};var SliderScale={linear:{toValue:function(percentage){var rawValue=percentage/100*(this.options.max-this.options.min);if(this.options.ticks_positions.length>0){var minv,maxv,minp,maxp=0;for(var i=0;i<this.options.ticks_positions.length;i++){if(percentage<=this.options.ticks_positions[i]){minv=(i>0)?this.options.ticks[i-1]:0;minp=(i>0)?this.options.ticks_positions[i-1]:0;maxv=this.options.ticks[i];maxp=this.options.ticks_positions[i];break;}}
if(i>0){var partialPercentage=(percentage-minp)/(maxp-minp);rawValue=minv+partialPercentage*(maxv-minv);}}
var value=this.options.min+Math.round(rawValue/this.options.step)*this.options.step;if(value<this.options.min){return this.options.min;}else if(value>this.options.max){return this.options.max;}else{return value;}},toPercentage:function(value){if(this.options.max===this.options.min){return 0;}
if(this.options.ticks_positions.length>0){var minv,maxv,minp,maxp=0;for(var i=0;i<this.options.ticks.length;i++){if(value<=this.options.ticks[i]){minv=(i>0)?this.options.ticks[i-1]:0;minp=(i>0)?this.options.ticks_positions[i-1]:0;maxv=this.options.ticks[i];maxp=this.options.ticks_positions[i];break;}}
if(i>0){var partialPercentage=(value-minv)/(maxv-minv);return minp+partialPercentage*(maxp-minp);}}
return 100*(value-this.options.min)/(this.options.max-this.options.min);}},logarithmic:{toValue:function(percentage){var min=(this.options.min===0)?0:Math.log(this.options.min);var max=Math.log(this.options.max);var value=Math.exp(min+(max-min)*percentage/100);value=this.options.min+Math.round((value-this.options.min)/this.options.step)*this.options.step;if(value<this.options.min){return this.options.min;}else if(value>this.options.max){return this.options.max;}else{return value;}},toPercentage:function(value){if(this.options.max===this.options.min){return 0;}else{var max=Math.log(this.options.max);var min=this.options.min===0?0:Math.log(this.options.min);var v=value===0?0:Math.log(value);return 100*(v-min)/(max-min);}}}};Slider=function(element,options){createNewSlider.call(this,element,options);return this;};function createNewSlider(element,options){if(typeof element==="string"){this.element=document.querySelector(element);}else if(element instanceof HTMLElement){this.element=element;}
options=options?options:{};var optionTypes=Object.keys(this.defaultOptions);for(var i=0;i<optionTypes.length;i++){var optName=optionTypes[i];var val=options[optName];val=(typeof val!=='undefined')?val:getDataAttrib(this.element,optName);val=(val!==null)?val:this.defaultOptions[optName];if(!this.options){this.options={};}
this.options[optName]=val;}
function getDataAttrib(element,optName){var dataName="data-slider-"+optName.replace(/_/g,'-');var dataValString=element.getAttribute(dataName);try{return JSON.parse(dataValString);}
catch(err){return dataValString;}}
var origWidth=this.element.style.width;var updateSlider=false;var parent=this.element.parentNode;var sliderTrackSelection;var sliderTrackLow,sliderTrackHigh;var sliderMinHandle;var sliderMaxHandle;if(this.sliderElem){updateSlider=true;}else{this.sliderElem=document.createElement("div");this.sliderElem.className="slider";var sliderTrack=document.createElement("div");sliderTrack.className="slider-track";sliderTrackLow=document.createElement("div");sliderTrackLow.className="slider-track-low";sliderTrackSelection=document.createElement("div");sliderTrackSelection.className="slider-selection";sliderTrackHigh=document.createElement("div");sliderTrackHigh.className="slider-track-high";sliderMinHandle=document.createElement("div");sliderMinHandle.className="slider-handle min-slider-handle";sliderMaxHandle=document.createElement("div");sliderMaxHandle.className="slider-handle max-slider-handle";sliderTrack.appendChild(sliderTrackLow);sliderTrack.appendChild(sliderTrackSelection);sliderTrack.appendChild(sliderTrackHigh);this.ticks=[];if(Array.isArray(this.options.ticks)&&this.options.ticks.length>0){for(i=0;i<this.options.ticks.length;i++){var tick=document.createElement('div');tick.className='slider-tick';this.ticks.push(tick);sliderTrack.appendChild(tick);}
sliderTrackSelection.className+=" tick-slider-selection";}
sliderTrack.appendChild(sliderMinHandle);sliderTrack.appendChild(sliderMaxHandle);this.tickLabels=[];if(Array.isArray(this.options.ticks_labels)&&this.options.ticks_labels.length>0){this.tickLabelContainer=document.createElement('div');this.tickLabelContainer.className='slider-tick-label-container';for(i=0;i<this.options.ticks_labels.length;i++){var label=document.createElement('div');label.className='slider-tick-label';label.innerHTML=this.options.ticks_labels[i];this.tickLabels.push(label);this.tickLabelContainer.appendChild(label);}}
var createAndAppendTooltipSubElements=function(tooltipElem){var arrow=document.createElement("div");arrow.className="tooltip-arrow";var inner=document.createElement("div");inner.className="tooltip-inner";tooltipElem.appendChild(arrow);tooltipElem.appendChild(inner);};var sliderTooltip=document.createElement("div");sliderTooltip.className="tooltip tooltip-main";createAndAppendTooltipSubElements(sliderTooltip);var sliderTooltipMin=document.createElement("div");sliderTooltipMin.className="tooltip tooltip-min";createAndAppendTooltipSubElements(sliderTooltipMin);var sliderTooltipMax=document.createElement("div");sliderTooltipMax.className="tooltip tooltip-max";createAndAppendTooltipSubElements(sliderTooltipMax);this.sliderElem.appendChild(sliderTrack);this.sliderElem.appendChild(sliderTooltip);this.sliderElem.appendChild(sliderTooltipMin);this.sliderElem.appendChild(sliderTooltipMax);if(this.tickLabelContainer){this.sliderElem.appendChild(this.tickLabelContainer);}
parent.insertBefore(this.sliderElem,this.element);this.element.style.display="none";}
if($){this.$element=$(this.element);this.$sliderElem=$(this.sliderElem);}
this.eventToCallbackMap={};this.sliderElem.id=this.options.id;this.touchCapable='ontouchstart'in window||(window.DocumentTouch&&document instanceof window.DocumentTouch);this.tooltip=this.sliderElem.querySelector('.tooltip-main');this.tooltipInner=this.tooltip.querySelector('.tooltip-inner');this.tooltip_min=this.sliderElem.querySelector('.tooltip-min');this.tooltipInner_min=this.tooltip_min.querySelector('.tooltip-inner');this.tooltip_max=this.sliderElem.querySelector('.tooltip-max');this.tooltipInner_max=this.tooltip_max.querySelector('.tooltip-inner');if(SliderScale[this.options.scale]){this.options.scale=SliderScale[this.options.scale];}
if(updateSlider===true){this._removeClass(this.sliderElem,'slider-horizontal');this._removeClass(this.sliderElem,'slider-vertical');this._removeClass(this.tooltip,'hide');this._removeClass(this.tooltip_min,'hide');this._removeClass(this.tooltip_max,'hide');["left","top","width","height"].forEach(function(prop){this._removeProperty(this.trackLow,prop);this._removeProperty(this.trackSelection,prop);this._removeProperty(this.trackHigh,prop);},this);[this.handle1,this.handle2].forEach(function(handle){this._removeProperty(handle,'left');this._removeProperty(handle,'top');},this);[this.tooltip,this.tooltip_min,this.tooltip_max].forEach(function(tooltip){this._removeProperty(tooltip,'left');this._removeProperty(tooltip,'top');this._removeProperty(tooltip,'margin-left');this._removeProperty(tooltip,'margin-top');this._removeClass(tooltip,'right');this._removeClass(tooltip,'top');},this);}
if(this.options.orientation==='vertical'){this._addClass(this.sliderElem,'slider-vertical');this.stylePos='top';this.mousePos='pageY';this.sizePos='offsetHeight';this._addClass(this.tooltip,'right');this.tooltip.style.left='100%';this._addClass(this.tooltip_min,'right');this.tooltip_min.style.left='100%';this._addClass(this.tooltip_max,'right');this.tooltip_max.style.left='100%';}else{this._addClass(this.sliderElem,'slider-horizontal');this.sliderElem.style.width=origWidth;this.options.orientation='horizontal';this.stylePos='left';this.mousePos='pageX';this.sizePos='offsetWidth';this._addClass(this.tooltip,'top');this.tooltip.style.top=-this.tooltip.outerHeight-14+'px';this._addClass(this.tooltip_min,'top');this.tooltip_min.style.top=-this.tooltip_min.outerHeight-14+'px';this._addClass(this.tooltip_max,'top');this.tooltip_max.style.top=-this.tooltip_max.outerHeight-14+'px';}
if(Array.isArray(this.options.ticks)&&this.options.ticks.length>0){this.options.max=Math.max.apply(Math,this.options.ticks);this.options.min=Math.min.apply(Math,this.options.ticks);}
if(Array.isArray(this.options.value)){this.options.range=true;}else if(this.options.range){this.options.value=[this.options.value,this.options.max];}
this.trackLow=sliderTrackLow||this.trackLow;this.trackSelection=sliderTrackSelection||this.trackSelection;this.trackHigh=sliderTrackHigh||this.trackHigh;if(this.options.selection==='none'){this._addClass(this.trackLow,'hide');this._addClass(this.trackSelection,'hide');this._addClass(this.trackHigh,'hide');}
this.handle1=sliderMinHandle||this.handle1;this.handle2=sliderMaxHandle||this.handle2;if(updateSlider===true){this._removeClass(this.handle1,'round triangle');this._removeClass(this.handle2,'round triangle hide');for(i=0;i<this.ticks.length;i++){this._removeClass(this.ticks[i],'round triangle hide');}}
var availableHandleModifiers=['round','triangle','custom'];var isValidHandleType=availableHandleModifiers.indexOf(this.options.handle)!==-1;if(isValidHandleType){this._addClass(this.handle1,this.options.handle);this._addClass(this.handle2,this.options.handle);for(i=0;i<this.ticks.length;i++){this._addClass(this.ticks[i],this.options.handle);}}
this.offset=this._offset(this.sliderElem);this.size=this.sliderElem[this.sizePos];this.setValue(this.options.value);this.handle1Keydown=this._keydown.bind(this,0);this.handle1.addEventListener("keydown",this.handle1Keydown,false);this.handle2Keydown=this._keydown.bind(this,1);this.handle2.addEventListener("keydown",this.handle2Keydown,false);this.mousedown=this._mousedown.bind(this);if(this.touchCapable){this.sliderElem.addEventListener("touchstart",this.mousedown,false);}
this.sliderElem.addEventListener("mousedown",this.mousedown,false);if(this.options.tooltip==='hide'){this._addClass(this.tooltip,'hide');this._addClass(this.tooltip_min,'hide');this._addClass(this.tooltip_max,'hide');}else if(this.options.tooltip==='always'){this._showTooltip();this._alwaysShowTooltip=true;}else{this.showTooltip=this._showTooltip.bind(this);this.hideTooltip=this._hideTooltip.bind(this);this.sliderElem.addEventListener("mouseenter",this.showTooltip,false);this.sliderElem.addEventListener("mouseleave",this.hideTooltip,false);this.handle1.addEventListener("focus",this.showTooltip,false);this.handle1.addEventListener("blur",this.hideTooltip,false);this.handle2.addEventListener("focus",this.showTooltip,false);this.handle2.addEventListener("blur",this.hideTooltip,false);}
if(this.options.enabled){this.enable();}else{this.disable();}}
Slider.prototype={_init:function(){},constructor:Slider,defaultOptions:{id:"",min:0,max:10,step:1,precision:0,orientation:'horizontal',value:5,range:false,selection:'before',tooltip:'show',tooltip_split:false,handle:'round',reversed:false,enabled:true,formatter:function(val){if(Array.isArray(val)){return val[0]+" : "+val[1];}else{return val;}},natural_arrow_keys:false,ticks:[],ticks_positions:[],ticks_labels:[],ticks_snap_bounds:0,scale:'linear',focus:false},over:false,inDrag:false,getValue:function(){if(this.options.range){return this.options.value;}
return this.options.value[0];},setValue:function(val,triggerSlideEvent,triggerChangeEvent){if(!val){val=0;}
var oldValue=this.getValue();this.options.value=this._validateInputValue(val);var applyPrecision=this._applyPrecision.bind(this);if(this.options.range){this.options.value[0]=applyPrecision(this.options.value[0]);this.options.value[1]=applyPrecision(this.options.value[1]);this.options.value[0]=Math.max(this.options.min,Math.min(this.options.max,this.options.value[0]));this.options.value[1]=Math.max(this.options.min,Math.min(this.options.max,this.options.value[1]));}else{this.options.value=applyPrecision(this.options.value);this.options.value=[Math.max(this.options.min,Math.min(this.options.max,this.options.value))];this._addClass(this.handle2,'hide');if(this.options.selection==='after'){this.options.value[1]=this.options.max;}else{this.options.value[1]=this.options.min;}}
if(this.options.max>this.options.min){this.percentage=[this._toPercentage(this.options.value[0]),this._toPercentage(this.options.value[1]),this.options.step*100/(this.options.max-this.options.min)];}else{this.percentage=[0,0,100];}
this._layout();var newValue=this.options.range?this.options.value:this.options.value[0];if(triggerSlideEvent===true){this._trigger('slide',newValue);}
if((oldValue!==newValue)&&(triggerChangeEvent===true)){this._trigger('change',{oldValue:oldValue,newValue:newValue});}
this._setDataVal(newValue);return this;},destroy:function(){this._removeSliderEventHandlers();this.sliderElem.parentNode.removeChild(this.sliderElem);this.element.style.display="";this._cleanUpEventCallbacksMap();this.element.removeAttribute("data");if($){this._unbindJQueryEventHandlers();this.$element.removeData('slider');}},disable:function(){this.options.enabled=false;this.handle1.removeAttribute("tabindex");this.handle2.removeAttribute("tabindex");this._addClass(this.sliderElem,'slider-disabled');this._trigger('slideDisabled');return this;},enable:function(){this.options.enabled=true;this.handle1.setAttribute("tabindex",0);this.handle2.setAttribute("tabindex",0);this._removeClass(this.sliderElem,'slider-disabled');this._trigger('slideEnabled');return this;},toggle:function(){if(this.options.enabled){this.disable();}else{this.enable();}
return this;},isEnabled:function(){return this.options.enabled;},on:function(evt,callback){this._bindNonQueryEventHandler(evt,callback);return this;},getAttribute:function(attribute){if(attribute){return this.options[attribute];}else{return this.options;}},setAttribute:function(attribute,value){this.options[attribute]=value;return this;},refresh:function(){this._removeSliderEventHandlers();createNewSlider.call(this,this.element,this.options);if($){$.data(this.element,'slider',this);}
return this;},relayout:function(){this._layout();return this;},_removeSliderEventHandlers:function(){this.handle1.removeEventListener("keydown",this.handle1Keydown,false);this.handle1.removeEventListener("focus",this.showTooltip,false);this.handle1.removeEventListener("blur",this.hideTooltip,false);this.handle2.removeEventListener("keydown",this.handle2Keydown,false);this.handle2.removeEventListener("focus",this.handle2Keydown,false);this.handle2.removeEventListener("blur",this.handle2Keydown,false);this.sliderElem.removeEventListener("mouseenter",this.showTooltip,false);this.sliderElem.removeEventListener("mouseleave",this.hideTooltip,false);this.sliderElem.removeEventListener("touchstart",this.mousedown,false);this.sliderElem.removeEventListener("mousedown",this.mousedown,false);},_bindNonQueryEventHandler:function(evt,callback){if(this.eventToCallbackMap[evt]===undefined){this.eventToCallbackMap[evt]=[];}
this.eventToCallbackMap[evt].push(callback);},_cleanUpEventCallbacksMap:function(){var eventNames=Object.keys(this.eventToCallbackMap);for(var i=0;i<eventNames.length;i++){var eventName=eventNames[i];this.eventToCallbackMap[eventName]=null;}},_showTooltip:function(){if(this.options.tooltip_split===false){this._addClass(this.tooltip,'in');}else{this._addClass(this.tooltip_min,'in');this._addClass(this.tooltip_max,'in');}
this.over=true;},_hideTooltip:function(){if(this.inDrag===false&&this.alwaysShowTooltip!==true){this._removeClass(this.tooltip,'in');this._removeClass(this.tooltip_min,'in');this._removeClass(this.tooltip_max,'in');}
this.over=false;},_layout:function(){var positionPercentages;if(this.options.reversed){positionPercentages=[100-this.percentage[0],this.percentage[1]];}else{positionPercentages=[this.percentage[0],this.percentage[1]];}
this.handle1.style[this.stylePos]=positionPercentages[0]+'%';this.handle2.style[this.stylePos]=positionPercentages[1]+'%';if(Array.isArray(this.options.ticks)&&this.options.ticks.length>0){var maxTickValue=Math.max.apply(Math,this.options.ticks);var minTickValue=Math.min.apply(Math,this.options.ticks);var styleSize=this.options.orientation==='vertical'?'height':'width';var styleMargin=this.options.orientation==='vertical'?'marginTop':'marginLeft';var labelSize=this.size/(this.options.ticks.length-1);if(this.tickLabelContainer){var extraMargin=0;if(this.options.ticks_positions.length===0){this.tickLabelContainer.style[styleMargin]=-labelSize/2+'px';extraMargin=this.tickLabelContainer.offsetHeight;}else{for(i=0;i<this.tickLabelContainer.childNodes.length;i++){if(this.tickLabelContainer.childNodes[i].offsetHeight>extraMargin){extraMargin=this.tickLabelContainer.childNodes[i].offsetHeight;}}}
if(this.options.orientation==='horizontal'){this.sliderElem.style.marginBottom=extraMargin+'px';}}
for(var i=0;i<this.options.ticks.length;i++){var percentage=this.options.ticks_positions[i]||100*(this.options.ticks[i]-minTickValue)/(maxTickValue-minTickValue);this.ticks[i].style[this.stylePos]=percentage+'%';this._removeClass(this.ticks[i],'in-selection');if(!this.options.range){if(this.options.selection==='after'&&percentage>=positionPercentages[0]){this._addClass(this.ticks[i],'in-selection');}else if(this.options.selection==='before'&&percentage<=positionPercentages[0]){this._addClass(this.ticks[i],'in-selection');}}else if(percentage>=positionPercentages[0]&&percentage<=positionPercentages[1]){this._addClass(this.ticks[i],'in-selection');}
if(this.tickLabels[i]){this.tickLabels[i].style[styleSize]=labelSize+'px';if(this.options.ticks_positions[i]!==undefined){this.tickLabels[i].style.position='absolute';this.tickLabels[i].style[this.stylePos]=this.options.ticks_positions[i]+'%';this.tickLabels[i].style[styleMargin]=-labelSize/2+'px';}}}}
if(this.options.orientation==='vertical'){this.trackLow.style.top='0';this.trackLow.style.height=Math.min(positionPercentages[0],positionPercentages[1])+'%';this.trackSelection.style.top=Math.min(positionPercentages[0],positionPercentages[1])+'%';this.trackSelection.style.height=Math.abs(positionPercentages[0]-positionPercentages[1])+'%';this.trackHigh.style.bottom='0';this.trackHigh.style.height=(100-Math.min(positionPercentages[0],positionPercentages[1])-Math.abs(positionPercentages[0]-positionPercentages[1]))+'%';}else{this.trackLow.style.left='0';this.trackLow.style.width=Math.min(positionPercentages[0],positionPercentages[1])+'%';this.trackSelection.style.left=Math.min(positionPercentages[0],positionPercentages[1])+'%';this.trackSelection.style.width=Math.abs(positionPercentages[0]-positionPercentages[1])+'%';this.trackHigh.style.right='0';this.trackHigh.style.width=(100-Math.min(positionPercentages[0],positionPercentages[1])-Math.abs(positionPercentages[0]-positionPercentages[1]))+'%';var offset_min=this.tooltip_min.getBoundingClientRect();var offset_max=this.tooltip_max.getBoundingClientRect();if(offset_min.right>offset_max.left){this._removeClass(this.tooltip_max,'top');this._addClass(this.tooltip_max,'bottom');this.tooltip_max.style.top=18+'px';}else{this._removeClass(this.tooltip_max,'bottom');this._addClass(this.tooltip_max,'top');this.tooltip_max.style.top=this.tooltip_min.style.top;}}
var formattedTooltipVal;if(this.options.range){formattedTooltipVal=this.options.formatter(this.options.value);this._setText(this.tooltipInner,formattedTooltipVal);this.tooltip.style[this.stylePos]=(positionPercentages[1]+positionPercentages[0])/2+'%';if(this.options.orientation==='vertical'){this._css(this.tooltip,'margin-top',-this.tooltip.offsetHeight/2+'px');}else{this._css(this.tooltip,'margin-left',-this.tooltip.offsetWidth/2+'px');}
if(this.options.orientation==='vertical'){this._css(this.tooltip,'margin-top',-this.tooltip.offsetHeight/2+'px');}else{this._css(this.tooltip,'margin-left',-this.tooltip.offsetWidth/2+'px');}
var innerTooltipMinText=this.options.formatter(this.options.value[0]);this._setText(this.tooltipInner_min,innerTooltipMinText);var innerTooltipMaxText=this.options.formatter(this.options.value[1]);this._setText(this.tooltipInner_max,innerTooltipMaxText);this.tooltip_min.style[this.stylePos]=positionPercentages[0]+'%';if(this.options.orientation==='vertical'){this._css(this.tooltip_min,'margin-top',-this.tooltip_min.offsetHeight/2+'px');}else{this._css(this.tooltip_min,'margin-left',-this.tooltip_min.offsetWidth/2+'px');}
this.tooltip_max.style[this.stylePos]=positionPercentages[1]+'%';if(this.options.orientation==='vertical'){this._css(this.tooltip_max,'margin-top',-this.tooltip_max.offsetHeight/2+'px');}else{this._css(this.tooltip_max,'margin-left',-this.tooltip_max.offsetWidth/2+'px');}}else{formattedTooltipVal=this.options.formatter(this.options.value[0]);this._setText(this.tooltipInner,formattedTooltipVal);this.tooltip.style[this.stylePos]=positionPercentages[0]+'%';if(this.options.orientation==='vertical'){this._css(this.tooltip,'margin-top',-this.tooltip.offsetHeight/2+'px');}else{this._css(this.tooltip,'margin-left',-this.tooltip.offsetWidth/2+'px');}}},_removeProperty:function(element,prop){if(element.style.removeProperty){element.style.removeProperty(prop);}else{element.style.removeAttribute(prop);}},_mousedown:function(ev){if(!this.options.enabled){return false;}
this.offset=this._offset(this.sliderElem);this.size=this.sliderElem[this.sizePos];var percentage=this._getPercentage(ev);if(this.options.range){var diff1=Math.abs(this.percentage[0]-percentage);var diff2=Math.abs(this.percentage[1]-percentage);this.dragged=(diff1<diff2)?0:1;}else{this.dragged=0;}
this.percentage[this.dragged]=this.options.reversed?100-percentage:percentage;this._layout();if(this.touchCapable){document.removeEventListener("touchmove",this.mousemove,false);document.removeEventListener("touchend",this.mouseup,false);}
if(this.mousemove){document.removeEventListener("mousemove",this.mousemove,false);}
if(this.mouseup){document.removeEventListener("mouseup",this.mouseup,false);}
this.mousemove=this._mousemove.bind(this);this.mouseup=this._mouseup.bind(this);if(this.touchCapable){document.addEventListener("touchmove",this.mousemove,false);document.addEventListener("touchend",this.mouseup,false);}
document.addEventListener("mousemove",this.mousemove,false);document.addEventListener("mouseup",this.mouseup,false);this.inDrag=true;var newValue=this._calculateValue();this._trigger('slideStart',newValue);this._setDataVal(newValue);this.setValue(newValue,false,true);this._pauseEvent(ev);if(this.options.focus){this._triggerFocusOnHandle(this.dragged);}
return true;},_triggerFocusOnHandle:function(handleIdx){if(handleIdx===0){this.handle1.focus();}
if(handleIdx===1){this.handle2.focus();}},_keydown:function(handleIdx,ev){if(!this.options.enabled){return false;}
var dir;switch(ev.keyCode){case 37:case 40:dir=-1;break;case 39:case 38:dir=1;break;}
if(!dir){return;}
if(this.options.natural_arrow_keys){var ifVerticalAndNotReversed=(this.options.orientation==='vertical'&&!this.options.reversed);var ifHorizontalAndReversed=(this.options.orientation==='horizontal'&&this.options.reversed);if(ifVerticalAndNotReversed||ifHorizontalAndReversed){dir=-dir;}}
var val=this.options.value[handleIdx]+dir*this.options.step;if(this.options.range){val=[(!handleIdx)?val:this.options.value[0],(handleIdx)?val:this.options.value[1]];}
this._trigger('slideStart',val);this._setDataVal(val);this.setValue(val,true,true);this._trigger('slideStop',val);this._setDataVal(val);this._layout();this._pauseEvent(ev);return false;},_pauseEvent:function(ev){if(ev.stopPropagation){ev.stopPropagation();}
if(ev.preventDefault){ev.preventDefault();}
ev.cancelBubble=true;ev.returnValue=false;},_mousemove:function(ev){if(!this.options.enabled){return false;}
var percentage=this._getPercentage(ev);this._adjustPercentageForRangeSliders(percentage);this.percentage[this.dragged]=this.options.reversed?100-percentage:percentage;this._layout();var val=this._calculateValue(true);this.setValue(val,true,true);return false;},_adjustPercentageForRangeSliders:function(percentage){if(this.options.range){if(this.dragged===0&&this.percentage[1]<percentage){this.percentage[0]=this.percentage[1];this.dragged=1;}else if(this.dragged===1&&this.percentage[0]>percentage){this.percentage[1]=this.percentage[0];this.dragged=0;}}},_mouseup:function(){if(!this.options.enabled){return false;}
if(this.touchCapable){document.removeEventListener("touchmove",this.mousemove,false);document.removeEventListener("touchend",this.mouseup,false);}
document.removeEventListener("mousemove",this.mousemove,false);document.removeEventListener("mouseup",this.mouseup,false);this.inDrag=false;if(this.over===false){this._hideTooltip();}
var val=this._calculateValue(true);this._layout();this._trigger('slideStop',val);this._setDataVal(val);return false;},_calculateValue:function(snapToClosestTick){var val;if(this.options.range){val=[this.options.min,this.options.max];if(this.percentage[0]!==0){val[0]=this._toValue(this.percentage[0]);val[0]=this._applyPrecision(val[0]);}
if(this.percentage[1]!==100){val[1]=this._toValue(this.percentage[1]);val[1]=this._applyPrecision(val[1]);}}else{val=this._toValue(this.percentage[0]);val=parseFloat(val);val=this._applyPrecision(val);}
if(snapToClosestTick){var min=[val,Infinity];for(var i=0;i<this.options.ticks.length;i++){var diff=Math.abs(this.options.ticks[i]-val);if(diff<=min[1]){min=[this.options.ticks[i],diff];}}
if(min[1]<=this.options.ticks_snap_bounds){return min[0];}}
return val;},_applyPrecision:function(val){var precision=this.options.precision||this._getNumDigitsAfterDecimalPlace(this.options.step);return this._applyToFixedAndParseFloat(val,precision);},_getNumDigitsAfterDecimalPlace:function(num){var match=(''+num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);if(!match){return 0;}
return Math.max(0,(match[1]?match[1].length:0)-(match[2]?+match[2]:0));},_applyToFixedAndParseFloat:function(num,toFixedInput){var truncatedNum=num.toFixed(toFixedInput);return parseFloat(truncatedNum);},_getPercentage:function(ev){if(this.touchCapable&&(ev.type==='touchstart'||ev.type==='touchmove')){ev=ev.touches[0];}
var eventPosition=ev[this.mousePos];var sliderOffset=this.offset[this.stylePos];var distanceToSlide=eventPosition-sliderOffset;var percentage=(distanceToSlide/this.size)*100;percentage=Math.round(percentage/this.percentage[2])*this.percentage[2];return Math.max(0,Math.min(100,percentage));},_validateInputValue:function(val){if(typeof val==='number'){return val;}else if(Array.isArray(val)){this._validateArray(val);return val;}else{throw new Error(ErrorMsgs.formatInvalidInputErrorMsg(val));}},_validateArray:function(val){for(var i=0;i<val.length;i++){var input=val[i];if(typeof input!=='number'){throw new Error(ErrorMsgs.formatInvalidInputErrorMsg(input));}}},_setDataVal:function(val){var value="value: '"+val+"'";this.element.setAttribute('data',value);this.element.setAttribute('value',val);this.element.value=val;},_trigger:function(evt,val){val=(val||val===0)?val:undefined;var callbackFnArray=this.eventToCallbackMap[evt];if(callbackFnArray&&callbackFnArray.length){for(var i=0;i<callbackFnArray.length;i++){var callbackFn=callbackFnArray[i];callbackFn(val);}}
if($){this._triggerJQueryEvent(evt,val);}},_triggerJQueryEvent:function(evt,val){var eventData={type:evt,value:val};this.$element.trigger(eventData);this.$sliderElem.trigger(eventData);},_unbindJQueryEventHandlers:function(){this.$element.off();this.$sliderElem.off();},_setText:function(element,text){if(typeof element.innerText!=="undefined"){element.innerText=text;}else if(typeof element.textContent!=="undefined"){element.textContent=text;}},_removeClass:function(element,classString){var classes=classString.split(" ");var newClasses=element.className;for(var i=0;i<classes.length;i++){var classTag=classes[i];var regex=new RegExp("(?:\\s|^)"+classTag+"(?:\\s|$)");newClasses=newClasses.replace(regex," ");}
element.className=newClasses.trim();},_addClass:function(element,classString){var classes=classString.split(" ");var newClasses=element.className;for(var i=0;i<classes.length;i++){var classTag=classes[i];var regex=new RegExp("(?:\\s|^)"+classTag+"(?:\\s|$)");var ifClassExists=regex.test(newClasses);if(!ifClassExists){newClasses+=" "+classTag;}}
element.className=newClasses.trim();},_offsetLeft:function(obj){var offsetLeft=obj.offsetLeft;while((obj=obj.offsetParent)&&!isNaN(obj.offsetLeft)){offsetLeft+=obj.offsetLeft;}
return offsetLeft;},_offsetTop:function(obj){var offsetTop=obj.offsetTop;while((obj=obj.offsetParent)&&!isNaN(obj.offsetTop)){offsetTop+=obj.offsetTop;}
return offsetTop;},_offset:function(obj){return{left:this._offsetLeft(obj),top:this._offsetTop(obj)};},_css:function(elementRef,styleName,value){if($){$.style(elementRef,styleName,value);}else{var style=styleName.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(all,letter){return letter.toUpperCase();});elementRef.style[style]=value;}},_toValue:function(percentage){return this.options.scale.toValue.apply(this,[percentage]);},_toPercentage:function(value){return this.options.scale.toPercentage.apply(this,[value]);}};if($){var namespace=$.fn.slider?'bootstrapSlider':'slider';$.bridget(namespace,Slider);}})($);return Slider;}));;;(function(define){define(["jquery"],function($){var $modal;var defaultSettings;var options={};var lastParams={};var tmpModalContent="tmp-modal-content";var recModalContent="rec-modal-content";var bin="recycle-bin";var div="<div>";return{ajax:ajax,alert:alert,confirm:confirm,emptyBin:emptyBin,prompt:prompt,setEModalOptions:setEModalOptions,setModalOptions:setModalOptions,close:close};function ajax(data,title){var params={loading:true,url:data.url||data};if(data.url){$.extend(params,data);}
$modalBody=alert(params,title).find(".modal-body");$.get(params.url,function(data){var content=prepareContent(data);$modalBody.html(content);var $modal=$modalBody.closest(".modal-dialog");var title=$modal.find('.modal-body h1')
if(title.length>0&&title.text().length>0){$modal.find('.modal-title').text(title.text());title.remove();}}).fail(function(responseText,textStatus){alert("Url [ "+params.url+" ] load fail.","Loading: "+(params.title||title));});return $modalBody.closest(".modal-dialog");}
function prepareContent(content){var wrapper=$('<div />').html(content).find('#content').html();return wrapper;}
function alert(params,title){setup(params,title);var $message=$("<section>").append(getMessage(params),getFooter(params.buttons));return build($message,params);}
function confirm(params,title,callback){var label={OK:"Cancel",Yes:"No",True:"False"};var defaultLabel="OK";var label1=label[params.label]?label[params.label]:label[defaultLabel];var label2=label[params.label]?params.label:defaultLabel;if(params.label1){label1=params.label1;}
if(params.label2){label2=params.label2;}
return alert({message:params.message||params,title:params.title||title,onHide:click,size:params.size,buttons:[{close:true,click:click,text:label1,style:"danger"},{close:true,click:click,text:label2,success:true}]});function click(ev){var fn=params.callback||callback;close();if(typeof fn==="function"){var target=$(ev.currentTarget);var key=target.html();var success=(target.attr('data-success')==='true')||label[key];return fn(success);}
throw new Error("No callback provided to execute confim modal action.");}}
function emptyBin(){return $("#"+bin+" > *").remove();}
function prompt(data,title,callback){var params={};if(typeof data==="object"){$.extend(params,data);}
else{params.message=data;params.title=title;params.callback=callback;}
params.buttons=false;params.onHide=submit;var buttons=getFooter([{close:true,type:"reset",text:"Cancel",style:"danger"},{close:false,type:"submit",text:"OK"}]);params.message=$("<form role=form style=\"margin-bottom: 0;\">"+"<div  class=modal-body>"+"<label for=prompt-input class=control-label>"+(params.message||"")+"</label>"+"<input type=text class=form-control id=prompt-input required autofocus value=\""+(params.value||"")+(params.pattern?"\" pattern=\""+params.pattern:"")+"\">"+"</div></form>").append(buttons).on("submit",submit);return alert(params);function submit(ev){var fn=params.callback||callback;close();if(typeof fn==="function"){return fn($(ev.currentTarget).html()==="Cancel"?null:$modal.find("input").val());}
throw new Error("No callback provided to execute prompt modal action.");}}
function setEModalOptions(overrideOptions){!defaultSettings&&(defaultSettings=getDefaultSettings());return $.extend(defaultSettings,overrideOptions);}
function setModalOptions(overrideOptions){$modal&&$modal.remove();return $.extend(options,overrideOptions);}
function close(){return $modal.off("hide.bs.modal").modal("hide");}
function build(message,params){$modal.find(".modal-content").append(message.addClass(params.useBin&&!params.loading?recModalContent:tmpModalContent));return $modal.modal(options);}
function getDefaultSettings(){return{allowContentRecycle:true,size:"",loadingHtml:"<h5>Loading...</h5><div class=progress><div class=\"progress-bar progress-bar-striped active\" role=progressbar aria-valuenow=100 aria-valuemin=0 aria-valuemax=100 style=\"width: 100%\"><span class=sr-only>100% Complete</span></div></div>",title:"Attention"};}
function getModalInstance(){if(!$modal){if(!document.getElementById(bin)){$("body").append($(div).prop("id",bin).hide());}
defaultSettings=getDefaultSettings();$modal=createModalElement();}
return $modal;function createModalElement(){return $("<div class=\"modal fade\">"
+" <div class='modal-dialog'>"
+"  <div class=modal-content>"
+"   <div class=modal-header><button type=button class=\"x close\" data-dismiss=modal><span aria-hidden=true>&times;</span><span class=sr-only>Close</span></button><h4 class=modal-title></h4></div>"
+"  </div>"
+" </div>"
+"</div>").on("show.bs.modal",function(ev){var modal=$(this);}).on("hidden.bs.modal",recycleModal).on("click","button.x",function(ev){var btn=$(ev.currentTarget);if(btn.prop("type")!=="submit")
return close();try{if(btn.closest("form")[0].checkValidity())
return close();}catch(e){return close();}
return $modal;});}}
function getFooter(buttons){if(buttons===false){return"";}
var messageFooter=$(div).addClass("modal-footer");if(buttons){for(var i=0,k=buttons.length;i<k;i++){var btnOp=buttons[i];var btn=$("<button>").addClass("btn btn-"+(btnOp.style||"info"));for(var index in btnOp){if(btnOp.hasOwnProperty(index)){switch(index){case"close":if(btnOp[index]){btn.attr("data-dismiss","modal").addClass("x");}
break;case"click":btn.click(btnOp.click);break;case"text":btn.html(btnOp[index]);break;case'success':btn.attr('data-success',btnOp.success);break;default:btn.attr(index,btnOp[index]);}}}
messageFooter.append(btn);}}else{}
return messageFooter;}
function getMessage(params){var $message;var content=params.loading?defaultSettings.loadingHtml:(params.message||params);if(content.on||content.onclick)
$message=params.clone===true?$(content).clone():$(content);else{$message=$(div).addClass("modal-body").html(content);}
return params.css&&(params.css!==$message.css&&$message.css(params.css)),$message;}
function recycleModal(){if(!$modal)return $modal;$modal.off("hide.bs.modal").find("."+tmpModalContent+(!defaultSettings.allowContentRecycle||lastParams.clone?", ."+recModalContent:"")).remove();return $modal.find("."+recModalContent).removeClass(recModalContent).appendTo("#"+bin);}
function setup(params,title){if(!params)throw new Error("Invalid parameters!");recycleModal();lastParams=params;var $ref=getModalInstance();$ref.find(".modal-dialog").removeClass("modal-sm modal-lg").addClass(params.size?"modal-"+params.size:defaultSettings.size);$ref.find(".modal-title").html((params.title||title||defaultSettings.title)+" ").append($("<small>").html(params.subtitle||""));$ref.on("hide.bs.modal",params.onHide);$ref.on("show.bs.modal",params.onShow);$ref.on("shown.bs.modal",params.onShown);return $ref;}});}(typeof define=="function"&&define.amd?define:function(n,t){typeof window.module!="undefined"&&window.module.exports?window.module.exports=t(window.require(n[0])):window.eModal=t(window.jQuery);}));;(function($){'use strict';$.fn.equalHeight=function(){var heights=[];$.each(this,function(i,element){var $element=$(element);var elementHeight;var includePadding=($element.css('box-sizing')==='border-box')||($element.css('-moz-box-sizing')==='border-box');if(includePadding){elementHeight=$element.innerHeight();}else{elementHeight=$element.height();}
heights.push(elementHeight);});this.css('height',Math.max.apply(window,heights)+'px');return this;};$.fn.equalHeightGrid=function(columns){var $tiles=this.filter(':visible');$tiles.css('height','auto');for(var i=0;i<$tiles.length;i++){if(i%columns===0){var row=$($tiles[i]);for(var n=1;n<columns;n++){row=row.add($tiles[i+n]);}
row.equalHeight();}}
return this;};$.fn.detectGridColumns=function(){var offset=0,cols=0,$tiles=this.filter(':visible');$tiles.each(function(i,elem){var elemOffset=$(elem).offset().top;if(offset===0||elemOffset===offset){cols++;offset=elemOffset;}else{return false;}});return cols;};var grids_event_uid=0;$.fn.responsiveEqualHeightGrid=function(){var _this=this;var event_namespace='.grids_'+grids_event_uid;_this.data('grids-event-namespace',event_namespace);function syncHeights(){var cols=_this.detectGridColumns();_this.equalHeightGrid(cols);}
$(window).bind('resize'+event_namespace+' load'+event_namespace,syncHeights);syncHeights();grids_event_uid++;return this;};$.fn.responsiveEqualHeightGridDestroy=function(){var _this=this;_this.css('height','auto');$(window).unbind(_this.data('grids-event-namespace'));return this;};})(window.jQuery);;;var ResponsiveBootstrapToolkit=(function($){var internal={detectionDivs:{bootstrap:{'xs':$('<div class="device-xs visible-xs visible-xs-block"></div>'),'sm':$('<div class="device-sm visible-sm visible-sm-block"></div>'),'md':$('<div class="device-md visible-md visible-md-block"></div>'),'lg':$('<div class="device-lg visible-lg visible-lg-block"></div>')},foundation:{'small':$('<div class="device-xs show-for-small-only"></div>'),'medium':$('<div class="device-sm show-for-medium-only"></div>'),'large':$('<div class="device-md show-for-large-only"></div>'),'xlarge':$('<div class="device-lg show-for-xlarge-only"></div>')}},applyDetectionDivs:function(){$(document).ready(function(){$.each(self.breakpoints,function(alias){self.breakpoints[alias].appendTo('.responsive-bootstrap-toolkit');});});},isAnExpression:function(str){return(str.charAt(0)=='<'||str.charAt(0)=='>');},splitExpression:function(str){var operator=str.charAt(0);var orEqual=(str.charAt(1)=='=')?true:false;var index=1+(orEqual?1:0);var breakpointName=str.slice(index);return{operator:operator,orEqual:orEqual,breakpointName:breakpointName};},isAnyActive:function(breakpoints){var found=false;$.each(breakpoints,function(index,alias){if(self.breakpoints[alias].is(':visible')){found=true;return false;}});return found;},isMatchingExpression:function(str){var expression=internal.splitExpression(str);var breakpointList=Object.keys(self.breakpoints);var pos=breakpointList.indexOf(expression.breakpointName);if(pos!==-1){var start=0;var end=0;if(expression.operator=='<'){start=0;end=expression.orEqual?++pos:pos;}
if(expression.operator=='>'){start=expression.orEqual?pos:++pos;end=undefined;}
var acceptedBreakpoints=breakpointList.slice(start,end);return internal.isAnyActive(acceptedBreakpoints);}}};var self={interval:300,framework:null,breakpoints:null,is:function(str){if(internal.isAnExpression(str)){return internal.isMatchingExpression(str);}
return self.breakpoints[str]&&self.breakpoints[str].is(':visible');},use:function(frameworkName,breakpoints){self.framework=frameworkName.toLowerCase();if(self.framework==='bootstrap'||self.framework==='foundation'){self.breakpoints=internal.detectionDivs[self.framework];}else{self.breakpoints=breakpoints;}
internal.applyDetectionDivs();},current:function(){var name='unrecognized';$.each(self.breakpoints,function(alias){if(self.is(alias)){name=alias;}});return name;},changed:function(fn,ms){var timer;return function(){clearTimeout(timer);timer=setTimeout(function(){fn();},ms||self.interval);};}};$(document).ready(function(){$('<div class="responsive-bootstrap-toolkit"></div>').appendTo('body');});if(self.framework===null){self.use('bootstrap');}
return self;})(jQuery);;(function($){'use strict';if(!String.prototype.includes){(function(){'use strict';var toString={}.toString;var defineProperty=(function(){try{var object={};var $defineProperty=Object.defineProperty;var result=$defineProperty(object,object,object)&&$defineProperty;}catch(error){}
return result;}());var indexOf=''.indexOf;var includes=function(search){if(this==null){throw new TypeError();}
var string=String(this);if(search&&toString.call(search)=='[object RegExp]'){throw new TypeError();}
var stringLength=string.length;var searchString=String(search);var searchLength=searchString.length;var position=arguments.length>1?arguments[1]:undefined;var pos=position?Number(position):0;if(pos!=pos){pos=0;}
var start=Math.min(Math.max(pos,0),stringLength);if(searchLength+start>stringLength){return false;}
return indexOf.call(string,searchString,pos)!=-1;};if(defineProperty){defineProperty(String.prototype,'includes',{'value':includes,'configurable':true,'writable':true});}else{String.prototype.includes=includes;}}());}
if(!String.prototype.startsWith){(function(){'use strict';var defineProperty=(function(){try{var object={};var $defineProperty=Object.defineProperty;var result=$defineProperty(object,object,object)&&$defineProperty;}catch(error){}
return result;}());var toString={}.toString;var startsWith=function(search){if(this==null){throw new TypeError();}
var string=String(this);if(search&&toString.call(search)=='[object RegExp]'){throw new TypeError();}
var stringLength=string.length;var searchString=String(search);var searchLength=searchString.length;var position=arguments.length>1?arguments[1]:undefined;var pos=position?Number(position):0;if(pos!=pos){pos=0;}
var start=Math.min(Math.max(pos,0),stringLength);if(searchLength+start>stringLength){return false;}
var index=-1;while(++index<searchLength){if(string.charCodeAt(start+index)!=searchString.charCodeAt(index)){return false;}}
return true;};if(defineProperty){defineProperty(String.prototype,'startsWith',{'value':startsWith,'configurable':true,'writable':true});}else{String.prototype.startsWith=startsWith;}}());}
if(!Object.keys){Object.keys=function(o,k,r){r=[];for(k in o)
r.hasOwnProperty.call(o,k)&&r.push(k);return r;};}
$.fn.triggerNative=function(eventName){var el=this[0],event;if(el.dispatchEvent){if(typeof Event==='function'){event=new Event(eventName,{bubbles:true});}else{event=document.createEvent('Event');event.initEvent(eventName,true,false);}
el.dispatchEvent(event);}else{if(el.fireEvent){event=document.createEventObject();event.eventType=eventName;el.fireEvent('on'+eventName,event);}
this.trigger(eventName);}};$.expr[':'].icontains=function(obj,index,meta){var $obj=$(obj);var haystack=($obj.data('tokens')||$obj.text()).toUpperCase();return haystack.includes(meta[3].toUpperCase());};$.expr[':'].ibegins=function(obj,index,meta){var $obj=$(obj);var haystack=($obj.data('tokens')||$obj.text()).toUpperCase();return haystack.startsWith(meta[3].toUpperCase());};$.expr[':'].aicontains=function(obj,index,meta){var $obj=$(obj);var haystack=($obj.data('tokens')||$obj.data('normalizedText')||$obj.text()).toUpperCase();return haystack.includes(meta[3].toUpperCase());};$.expr[':'].aibegins=function(obj,index,meta){var $obj=$(obj);var haystack=($obj.data('tokens')||$obj.data('normalizedText')||$obj.text()).toUpperCase();return haystack.startsWith(meta[3].toUpperCase());};function normalizeToBase(text){var rExps=[{re:/[\xC0-\xC6]/g,ch:"A"},{re:/[\xE0-\xE6]/g,ch:"a"},{re:/[\xC8-\xCB]/g,ch:"E"},{re:/[\xE8-\xEB]/g,ch:"e"},{re:/[\xCC-\xCF]/g,ch:"I"},{re:/[\xEC-\xEF]/g,ch:"i"},{re:/[\xD2-\xD6]/g,ch:"O"},{re:/[\xF2-\xF6]/g,ch:"o"},{re:/[\xD9-\xDC]/g,ch:"U"},{re:/[\xF9-\xFC]/g,ch:"u"},{re:/[\xC7-\xE7]/g,ch:"c"},{re:/[\xD1]/g,ch:"N"},{re:/[\xF1]/g,ch:"n"}];$.each(rExps,function(){text=text.replace(this.re,this.ch);});return text;}
function htmlEscape(html){var escapeMap={'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#x27;','`':'&#x60;'};var source='(?:'+Object.keys(escapeMap).join('|')+')',testRegexp=new RegExp(source),replaceRegexp=new RegExp(source,'g'),string=html==null?'':''+html;return testRegexp.test(string)?string.replace(replaceRegexp,function(match){return escapeMap[match];}):string;}
var Selectpicker=function(element,options,e){if(e){e.stopPropagation();e.preventDefault();}
this.$element=$(element);this.$newElement=null;this.$button=null;this.$menu=null;this.$lis=null;this.options=options;if(this.options.title===null){this.options.title=this.$element.attr('title');}
this.val=Selectpicker.prototype.val;this.render=Selectpicker.prototype.render;this.refresh=Selectpicker.prototype.refresh;this.setStyle=Selectpicker.prototype.setStyle;this.selectAll=Selectpicker.prototype.selectAll;this.deselectAll=Selectpicker.prototype.deselectAll;this.destroy=Selectpicker.prototype.destroy;this.remove=Selectpicker.prototype.remove;this.show=Selectpicker.prototype.show;this.hide=Selectpicker.prototype.hide;this.init();};Selectpicker.VERSION='1.8.1';Selectpicker.DEFAULTS={noneSelectedText:'Nothing selected',noneResultsText:'No results matched {0}',countSelectedText:function(numSelected,numTotal){return(numSelected==1)?"{0} item selected":"{0} items selected";},maxOptionsText:function(numAll,numGroup){return[(numAll==1)?'Limit reached ({n} item max)':'Limit reached ({n} items max)',(numGroup==1)?'Group limit reached ({n} item max)':'Group limit reached ({n} items max)'];},selectAllText:'Select All',deselectAllText:'Deselect All',doneButton:false,doneButtonText:'Close',multipleSeparator:', ',styleBase:'btn',style:'btn-default',size:'auto',title:null,selectedTextFormat:'values',width:false,container:false,hideDisabled:false,showSubtext:false,showIcon:true,showContent:true,dropupAuto:true,header:false,liveSearch:false,liveSearchPlaceholder:null,liveSearchNormalize:false,liveSearchStyle:'contains',actionsBox:false,iconBase:'glyphicon',tickIcon:'glyphicon-ok',template:{caret:'<span class="caret"></span>'},maxOptions:false,mobile:false,selectOnTab:false,dropdownAlignRight:false,showTick:false};Selectpicker.prototype={constructor:Selectpicker,init:function(){var that=this,id=this.$element.attr('id');this.liObj={};this.multiple=this.$element.prop('multiple');this.autofocus=this.$element.prop('autofocus');this.$newElement=this.createView();this.$element.after(this.$newElement).appendTo(this.$newElement);this.$button=this.$newElement.children('button');this.$menu=this.$newElement.children('.dropdown-menu');this.$menuInner=this.$menu.children('.inner');this.$searchbox=this.$menu.find('input');if(this.options.dropdownAlignRight)
this.$menu.addClass('dropdown-menu-right');if(typeof id!=='undefined'){this.$button.attr('data-id',id);$('label[for="'+id+'"]').click(function(e){e.preventDefault();that.$button.focus();});}
this.checkDisabled();this.clickListener();if(this.options.liveSearch)this.liveSearchListener();this.render();this.setStyle();this.setWidth();if(this.options.container)this.selectPosition();this.$menu.data('this',this);this.$newElement.data('this',this);if(this.options.mobile)this.mobile();this.$newElement.on({'hide.bs.dropdown':function(e){that.$element.trigger('hide.bs.select',e);},'hidden.bs.dropdown':function(e){that.$element.trigger('hidden.bs.select',e);},'show.bs.dropdown':function(e){that.$element.trigger('show.bs.select',e);},'shown.bs.dropdown':function(e){that.$element.trigger('shown.bs.select',e);}});if(that.$element[0].hasAttribute('required')){this.$element.on('invalid',function(){that.$button.addClass('bs-invalid').focus();that.$element.on({'focus.bs.select':function(){that.$button.focus();that.$element.off('focus.bs.select');},'shown.bs.select':function(){that.$element.val(that.$element.val()).off('shown.bs.select');},'rendered.bs.select':function(){if(this.validity.valid)that.$button.removeClass('bs-invalid');that.$element.off('rendered.bs.select');}});});}
setTimeout(function(){that.$element.trigger('loaded.bs.select');});},createDropdown:function(){var multiple=this.multiple||this.options.showTick?' show-tick':'',inputGroup=this.$element.parent().hasClass('input-group')?' input-group-btn':'',autofocus=this.autofocus?' autofocus':'';var header=this.options.header?'<div class="popover-title"><button type="button" class="close" aria-hidden="true">&times;</button>'+this.options.header+'</div>':'';var searchbox=this.options.liveSearch?'<div class="bs-searchbox">'+'<input type="text" class="form-control" autocomplete="off"'+
(null===this.options.liveSearchPlaceholder?'':' placeholder="'+htmlEscape(this.options.liveSearchPlaceholder)+'"')+'>'+'</div>':'';var actionsbox=this.multiple&&this.options.actionsBox?'<div class="bs-actionsbox">'+'<div class="btn-group btn-group-sm btn-block">'+'<button type="button" class="actions-btn bs-select-all btn btn-default">'+
this.options.selectAllText+'</button>'+'<button type="button" class="actions-btn bs-deselect-all btn btn-default">'+
this.options.deselectAllText+'</button>'+'</div>'+'</div>':'';var donebutton=this.multiple&&this.options.doneButton?'<div class="bs-donebutton">'+'<div class="btn-group btn-block">'+'<button type="button" class="btn btn-sm btn-default">'+
this.options.doneButtonText+'</button>'+'</div>'+'</div>':'';var drop='<div class="btn-group bootstrap-select'+multiple+inputGroup+'">'+'<button type="button" class="'+this.options.styleBase+' dropdown-toggle" data-toggle="dropdown"'+autofocus+'>'+'<span class="filter-option pull-left"></span>&nbsp;'+'<span class="bs-caret">'+
this.options.template.caret+'</span>'+'</button>'+'<div class="dropdown-menu open">'+
header+
searchbox+
actionsbox+'<ul class="dropdown-menu inner" role="menu">'+'</ul>'+
donebutton+'</div>'+'</div>';return $(drop);},createView:function(){var $drop=this.createDropdown(),li=this.createLi();$drop.find('ul')[0].innerHTML=li;return $drop;},reloadLi:function(){this.destroyLi();var li=this.createLi();this.$menuInner[0].innerHTML=li;},destroyLi:function(){this.$menu.find('li').remove();},createLi:function(){var that=this,_li=[],optID=0,titleOption=document.createElement('option'),liIndex=-1;var generateLI=function(content,index,classes,optgroup){return'<li'+
((typeof classes!=='undefined'&''!==classes)?' class="'+classes+'"':'')+
((typeof index!=='undefined'&null!==index)?' data-original-index="'+index+'"':'')+
((typeof optgroup!=='undefined'&null!==optgroup)?'data-optgroup="'+optgroup+'"':'')+'>'+content+'</li>';};var generateA=function(text,classes,inline,tokens){return'<a tabindex="0"'+
(typeof classes!=='undefined'?' class="'+classes+'"':'')+
(typeof inline!=='undefined'?' style="'+inline+'"':'')+
(that.options.liveSearchNormalize?' data-normalized-text="'+normalizeToBase(htmlEscape(text))+'"':'')+
(typeof tokens!=='undefined'||tokens!==null?' data-tokens="'+tokens+'"':'')+'>'+text+'<span class="'+that.options.iconBase+' '+that.options.tickIcon+' check-mark"></span>'+'</a>';};if(this.options.title&&!this.multiple){liIndex--;if(!this.$element.find('.bs-title-option').length){var element=this.$element[0];titleOption.className='bs-title-option';titleOption.appendChild(document.createTextNode(this.options.title));titleOption.value='';element.insertBefore(titleOption,element.firstChild);if($(element.options[element.selectedIndex]).attr('selected')===undefined)titleOption.selected=true;}}
this.$element.find('option').each(function(index){var $this=$(this);liIndex++;if($this.hasClass('bs-title-option'))return;var optionClass=this.className||'',inline=this.style.cssText,text=$this.data('content')?$this.data('content'):$this.html(),tokens=$this.data('tokens')?$this.data('tokens'):null,subtext=typeof $this.data('subtext')!=='undefined'?'<small class="text-muted">'+$this.data('subtext')+'</small>':'',icon=typeof $this.data('icon')!=='undefined'?'<span class="'+that.options.iconBase+' '+$this.data('icon')+'"></span> ':'',isDisabled=this.disabled||(this.parentNode.tagName==='OPTGROUP'&&this.parentNode.disabled);if(icon!==''&&isDisabled){icon='<span>'+icon+'</span>';}
if(that.options.hideDisabled&&isDisabled){liIndex--;return;}
if(!$this.data('content')){text=icon+'<span class="text">'+text+subtext+'</span>';}
if(this.parentNode.tagName==='OPTGROUP'&&$this.data('divider')!==true){var optGroupClass=' '+this.parentNode.className||'';if($this.index()===0){optID+=1;var label=this.parentNode.label,labelSubtext=typeof $this.parent().data('subtext')!=='undefined'?'<small class="text-muted">'+$this.parent().data('subtext')+'</small>':'',labelIcon=$this.parent().data('icon')?'<span class="'+that.options.iconBase+' '+$this.parent().data('icon')+'"></span> ':'';label=labelIcon+'<span class="text">'+label+labelSubtext+'</span>';if(index!==0&&_li.length>0){liIndex++;_li.push(generateLI('',null,'divider',optID+'div'));}
liIndex++;_li.push(generateLI(label,null,'dropdown-header'+optGroupClass,optID));}
_li.push(generateLI(generateA(text,'opt '+optionClass+optGroupClass,inline,tokens),index,'',optID));}else if($this.data('divider')===true){_li.push(generateLI('',index,'divider'));}else if($this.data('hidden')===true){_li.push(generateLI(generateA(text,optionClass,inline,tokens),index,'hidden is-hidden'));}else{if(this.previousElementSibling&&this.previousElementSibling.tagName==='OPTGROUP'){liIndex++;_li.push(generateLI('',null,'divider',optID+'div'));}
_li.push(generateLI(generateA(text,optionClass,inline,tokens),index));}
that.liObj[index]=liIndex;});if(!this.multiple&&this.$element.find('option:selected').length===0&&!this.options.title){this.$element.find('option').eq(0).prop('selected',true).attr('selected','selected');}
return _li.join('');},findLis:function(){if(this.$lis==null)this.$lis=this.$menu.find('li');return this.$lis;},render:function(updateLi){var that=this,notDisabled;if(updateLi!==false){this.$element.find('option').each(function(index){var $lis=that.findLis().eq(that.liObj[index]);that.setDisabled(index,this.disabled||this.parentNode.tagName==='OPTGROUP'&&this.parentNode.disabled,$lis);that.setSelected(index,this.selected,$lis);});}
this.tabIndex();var selectedItems=this.$element.find('option').map(function(){if(this.selected){if(that.options.hideDisabled&&(this.disabled||this.parentNode.tagName==='OPTGROUP'&&this.parentNode.disabled))return;var $this=$(this),icon=$this.data('icon')&&that.options.showIcon?'<i class="'+that.options.iconBase+' '+$this.data('icon')+'"></i> ':'',subtext;if(that.options.showSubtext&&$this.data('subtext')&&!that.multiple){subtext=' <small class="text-muted">'+$this.data('subtext')+'</small>';}else{subtext='';}
if(typeof $this.attr('title')!=='undefined'){return $this.attr('title');}else if($this.data('content')&&that.options.showContent){return $this.data('content');}else{return icon+$this.html()+subtext;}}}).toArray();var title=!this.multiple?selectedItems[0]:selectedItems.join(this.options.multipleSeparator);if(this.multiple&&this.options.selectedTextFormat.indexOf('count')>-1){var max=this.options.selectedTextFormat.split('>');if((max.length>1&&selectedItems.length>max[1])||(max.length==1&&selectedItems.length>=2)){notDisabled=this.options.hideDisabled?', [disabled]':'';var totalCount=this.$element.find('option').not('[data-divider="true"], [data-hidden="true"]'+notDisabled).length,tr8nText=(typeof this.options.countSelectedText==='function')?this.options.countSelectedText(selectedItems.length,totalCount):this.options.countSelectedText;title=tr8nText.replace('{0}',selectedItems.length.toString()).replace('{1}',totalCount.toString());}}
if(this.options.title==undefined){this.options.title=this.$element.attr('title');}
if(this.options.selectedTextFormat=='static'){title=this.options.title;}
if(!title){title=typeof this.options.title!=='undefined'?this.options.title:this.options.noneSelectedText;}
this.$button.attr('title',$.trim(title.replace(/<[^>]*>?/g,'')));this.$button.children('.filter-option').html(title);this.$element.trigger('rendered.bs.select');},setStyle:function(style,status){if(this.$element.attr('class')){this.$newElement.addClass(this.$element.attr('class').replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,''));}
var buttonClass=style?style:this.options.style;if(status=='add'){this.$button.addClass(buttonClass);}else if(status=='remove'){this.$button.removeClass(buttonClass);}else{this.$button.removeClass(this.options.style);this.$button.addClass(buttonClass);}},liHeight:function(refresh){if(!refresh&&(this.options.size===false||this.sizeInfo))return;var newElement=document.createElement('div'),menu=document.createElement('div'),menuInner=document.createElement('ul'),divider=document.createElement('li'),li=document.createElement('li'),a=document.createElement('a'),text=document.createElement('span'),header=this.options.header&&this.$menu.find('.popover-title').length>0?this.$menu.find('.popover-title')[0].cloneNode(true):null,search=this.options.liveSearch?document.createElement('div'):null,actions=this.options.actionsBox&&this.multiple&&this.$menu.find('.bs-actionsbox').length>0?this.$menu.find('.bs-actionsbox')[0].cloneNode(true):null,doneButton=this.options.doneButton&&this.multiple&&this.$menu.find('.bs-donebutton').length>0?this.$menu.find('.bs-donebutton')[0].cloneNode(true):null;text.className='text';newElement.className=this.$menu[0].parentNode.className+' open';menu.className='dropdown-menu open';menuInner.className='dropdown-menu inner';divider.className='divider';text.appendChild(document.createTextNode('Inner text'));a.appendChild(text);li.appendChild(a);menuInner.appendChild(li);menuInner.appendChild(divider);if(header)menu.appendChild(header);if(search){var input=document.createElement('span');search.className='bs-searchbox';input.className='form-control';search.appendChild(input);menu.appendChild(search);}
if(actions)menu.appendChild(actions);menu.appendChild(menuInner);if(doneButton)menu.appendChild(doneButton);newElement.appendChild(menu);document.body.appendChild(newElement);var liHeight=a.offsetHeight,headerHeight=header?header.offsetHeight:0,searchHeight=search?search.offsetHeight:0,actionsHeight=actions?actions.offsetHeight:0,doneButtonHeight=doneButton?doneButton.offsetHeight:0,dividerHeight=$(divider).outerHeight(true),menuStyle=typeof getComputedStyle==='function'?getComputedStyle(menu):false,$menu=menuStyle?null:$(menu),menuPadding=parseInt(menuStyle?menuStyle.paddingTop:$menu.css('paddingTop'))+
parseInt(menuStyle?menuStyle.paddingBottom:$menu.css('paddingBottom'))+
parseInt(menuStyle?menuStyle.borderTopWidth:$menu.css('borderTopWidth'))+
parseInt(menuStyle?menuStyle.borderBottomWidth:$menu.css('borderBottomWidth')),menuExtras=menuPadding+
parseInt(menuStyle?menuStyle.marginTop:$menu.css('marginTop'))+
parseInt(menuStyle?menuStyle.marginBottom:$menu.css('marginBottom'))+2;document.body.removeChild(newElement);this.sizeInfo={liHeight:liHeight,headerHeight:headerHeight,searchHeight:searchHeight,actionsHeight:actionsHeight,doneButtonHeight:doneButtonHeight,dividerHeight:dividerHeight,menuPadding:menuPadding,menuExtras:menuExtras};},setSize:function(){this.findLis();this.liHeight();if(this.options.header)this.$menu.css('padding-top',0);if(this.options.size===false)return;var that=this,$menu=this.$menu,$menuInner=this.$menuInner,$window=$(window),selectHeight=this.$newElement[0].offsetHeight,liHeight=this.sizeInfo['liHeight'],headerHeight=this.sizeInfo['headerHeight'],searchHeight=this.sizeInfo['searchHeight'],actionsHeight=this.sizeInfo['actionsHeight'],doneButtonHeight=this.sizeInfo['doneButtonHeight'],divHeight=this.sizeInfo['dividerHeight'],menuPadding=this.sizeInfo['menuPadding'],menuExtras=this.sizeInfo['menuExtras'],notDisabled=this.options.hideDisabled?'.disabled':'',menuHeight,getHeight,selectOffsetTop,selectOffsetBot,posVert=function(){selectOffsetTop=that.$newElement.offset().top-$window.scrollTop();selectOffsetBot=$window.height()-selectOffsetTop-selectHeight;};posVert();if(this.options.size==='auto'){var getSize=function(){var minHeight,hasClass=function(className,include){return function(element){if(include){return(element.classList?element.classList.contains(className):$(element).hasClass(className));}else{return!(element.classList?element.classList.contains(className):$(element).hasClass(className));}};},lis=that.$menuInner[0].getElementsByTagName('li'),lisVisible=Array.prototype.filter?Array.prototype.filter.call(lis,hasClass('hidden',false)):that.$lis.not('.hidden'),optGroup=Array.prototype.filter?Array.prototype.filter.call(lisVisible,hasClass('dropdown-header',true)):lisVisible.filter('.dropdown-header');posVert();menuHeight=selectOffsetBot-menuExtras;if(that.options.container){if(!$menu.data('height'))$menu.data('height',$menu.height());getHeight=$menu.data('height');}else{getHeight=$menu.height();}
if(that.options.dropupAuto){that.$newElement.toggleClass('dropup',selectOffsetTop>selectOffsetBot&&(menuHeight-menuExtras)<getHeight);}
if(that.$newElement.hasClass('dropup')){menuHeight=selectOffsetTop-menuExtras;}
if((lisVisible.length+optGroup.length)>3){minHeight=liHeight*3+menuExtras-2;}else{minHeight=0;}
$menu.css({'max-height':menuHeight+'px','overflow':'hidden','min-height':minHeight+headerHeight+searchHeight+actionsHeight+doneButtonHeight+'px'});$menuInner.css({'max-height':menuHeight-headerHeight-searchHeight-actionsHeight-doneButtonHeight-menuPadding+'px','overflow-y':'auto','min-height':Math.max(minHeight-menuPadding,0)+'px'});};getSize();this.$searchbox.off('input.getSize propertychange.getSize').on('input.getSize propertychange.getSize',getSize);$window.off('resize.getSize scroll.getSize').on('resize.getSize scroll.getSize',getSize);}else if(this.options.size&&this.options.size!='auto'&&this.$lis.not(notDisabled).length>this.options.size){var optIndex=this.$lis.not('.divider').not(notDisabled).children().slice(0,this.options.size).last().parent().index(),divLength=this.$lis.slice(0,optIndex+1).filter('.divider').length;menuHeight=liHeight*this.options.size+divLength*divHeight+menuPadding;if(that.options.container){if(!$menu.data('height'))$menu.data('height',$menu.height());getHeight=$menu.data('height');}else{getHeight=$menu.height();}
if(that.options.dropupAuto){this.$newElement.toggleClass('dropup',selectOffsetTop>selectOffsetBot&&(menuHeight-menuExtras)<getHeight);}
$menu.css({'max-height':menuHeight+headerHeight+searchHeight+actionsHeight+doneButtonHeight+'px','overflow':'hidden','min-height':''});$menuInner.css({'max-height':menuHeight-menuPadding+'px','overflow-y':'auto','min-height':''});}},setWidth:function(){if(this.options.width==='auto'){this.$menu.css('min-width','0');var $selectClone=this.$menu.parent().clone().appendTo('body'),$selectClone2=this.options.container?this.$newElement.clone().appendTo('body'):$selectClone,ulWidth=$selectClone.children('.dropdown-menu').outerWidth(),btnWidth=$selectClone2.css('width','auto').children('button').outerWidth();$selectClone.remove();$selectClone2.remove();this.$newElement.css('width',Math.max(ulWidth,btnWidth)+'px');}else if(this.options.width==='fit'){this.$menu.css('min-width','');this.$newElement.css('width','').addClass('fit-width');}else if(this.options.width){this.$menu.css('min-width','');this.$newElement.css('width',this.options.width);}else{this.$menu.css('min-width','');this.$newElement.css('width','');}
if(this.$newElement.hasClass('fit-width')&&this.options.width!=='fit'){this.$newElement.removeClass('fit-width');}},selectPosition:function(){this.$bsContainer=$('<div class="bs-container" />');var that=this,pos,actualHeight,getPlacement=function($element){that.$bsContainer.addClass($element.attr('class').replace(/form-control|fit-width/gi,'')).toggleClass('dropup',$element.hasClass('dropup'));pos=$element.offset();actualHeight=$element.hasClass('dropup')?0:$element[0].offsetHeight;that.$bsContainer.css({'top':pos.top+actualHeight,'left':pos.left,'width':$element[0].offsetWidth});};this.$button.on('click',function(){var $this=$(this);if(that.isDisabled()){return;}
getPlacement(that.$newElement);that.$bsContainer.appendTo(that.options.container).toggleClass('open',!$this.hasClass('open')).append(that.$menu);});$(window).on('resize scroll',function(){getPlacement(that.$newElement);});this.$element.on('hide.bs.select',function(){that.$menu.data('height',that.$menu.height());that.$bsContainer.detach();});},setSelected:function(index,selected,$lis){if(!$lis){$lis=this.findLis().eq(this.liObj[index]);}
$lis.toggleClass('selected',selected);},setDisabled:function(index,disabled,$lis){if(!$lis){$lis=this.findLis().eq(this.liObj[index]);}
if(disabled){$lis.addClass('disabled').children('a').attr('href','#').attr('tabindex',-1);}else{$lis.removeClass('disabled').children('a').removeAttr('href').attr('tabindex',0);}},isDisabled:function(){return this.$element[0].disabled;},checkDisabled:function(){var that=this;if(this.isDisabled()){this.$newElement.addClass('disabled');this.$button.addClass('disabled').attr('tabindex',-1);}else{if(this.$button.hasClass('disabled')){this.$newElement.removeClass('disabled');this.$button.removeClass('disabled');}
if(this.$button.attr('tabindex')==-1&&!this.$element.data('tabindex')){this.$button.removeAttr('tabindex');}}
this.$button.click(function(){return!that.isDisabled();});},tabIndex:function(){if(this.$element.data('tabindex')!==this.$element.attr('tabindex')&&(this.$element.attr('tabindex')!==-98&&this.$element.attr('tabindex')!=='-98')){this.$element.data('tabindex',this.$element.attr('tabindex'));this.$button.attr('tabindex',this.$element.data('tabindex'));}
this.$element.attr('tabindex',-98);},clickListener:function(){var that=this,$document=$(document);this.$newElement.on('touchstart.dropdown','.dropdown-menu',function(e){e.stopPropagation();});$document.data('spaceSelect',false);this.$button.on('keyup',function(e){if(/(32)/.test(e.keyCode.toString(10))&&$document.data('spaceSelect')){e.preventDefault();$document.data('spaceSelect',false);}});this.$button.on('click',function(){that.setSize();that.$element.on('shown.bs.select',function(){if(!that.options.liveSearch&&!that.multiple){that.$menuInner.find('.selected a').focus();}else if(!that.multiple){var selectedIndex=that.liObj[that.$element[0].selectedIndex];if(typeof selectedIndex!=='number'||that.options.size===false)return;var offset=that.$lis.eq(selectedIndex)[0].offsetTop-that.$menuInner[0].offsetTop;offset=offset-that.$menuInner[0].offsetHeight/2+that.sizeInfo.liHeight/2;that.$menuInner[0].scrollTop=offset;}});});this.$menuInner.on('click','li a',function(e){var $this=$(this),clickedIndex=$this.parent().data('originalIndex'),prevValue=that.$element.val(),prevIndex=that.$element.prop('selectedIndex');if(that.multiple){e.stopPropagation();}
e.preventDefault();if(!that.isDisabled()&&!$this.parent().hasClass('disabled')){var $options=that.$element.find('option'),$option=$options.eq(clickedIndex),state=$option.prop('selected'),$optgroup=$option.parent('optgroup'),maxOptions=that.options.maxOptions,maxOptionsGrp=$optgroup.data('maxOptions')||false;if(!that.multiple){$options.prop('selected',false);$option.prop('selected',true);that.$menuInner.find('.selected').removeClass('selected');that.setSelected(clickedIndex,true);}else{$option.prop('selected',!state);that.setSelected(clickedIndex,!state);$this.blur();if(maxOptions!==false||maxOptionsGrp!==false){var maxReached=maxOptions<$options.filter(':selected').length,maxReachedGrp=maxOptionsGrp<$optgroup.find('option:selected').length;if((maxOptions&&maxReached)||(maxOptionsGrp&&maxReachedGrp)){if(maxOptions&&maxOptions==1){$options.prop('selected',false);$option.prop('selected',true);that.$menuInner.find('.selected').removeClass('selected');that.setSelected(clickedIndex,true);}else if(maxOptionsGrp&&maxOptionsGrp==1){$optgroup.find('option:selected').prop('selected',false);$option.prop('selected',true);var optgroupID=$this.parent().data('optgroup');that.$menuInner.find('[data-optgroup="'+optgroupID+'"]').removeClass('selected');that.setSelected(clickedIndex,true);}else{var maxOptionsArr=(typeof that.options.maxOptionsText==='function')?that.options.maxOptionsText(maxOptions,maxOptionsGrp):that.options.maxOptionsText,maxTxt=maxOptionsArr[0].replace('{n}',maxOptions),maxTxtGrp=maxOptionsArr[1].replace('{n}',maxOptionsGrp),$notify=$('<div class="notify"></div>');if(maxOptionsArr[2]){maxTxt=maxTxt.replace('{var}',maxOptionsArr[2][maxOptions>1?0:1]);maxTxtGrp=maxTxtGrp.replace('{var}',maxOptionsArr[2][maxOptionsGrp>1?0:1]);}
$option.prop('selected',false);that.$menu.append($notify);if(maxOptions&&maxReached){$notify.append($('<div>'+maxTxt+'</div>'));that.$element.trigger('maxReached.bs.select');}
if(maxOptionsGrp&&maxReachedGrp){$notify.append($('<div>'+maxTxtGrp+'</div>'));that.$element.trigger('maxReachedGrp.bs.select');}
setTimeout(function(){that.setSelected(clickedIndex,false);},10);$notify.delay(750).fadeOut(300,function(){$(this).remove();});}}}}
if(!that.multiple){that.$button.focus();}else if(that.options.liveSearch){that.$searchbox.focus();}
if((prevValue!=that.$element.val()&&that.multiple)||(prevIndex!=that.$element.prop('selectedIndex')&&!that.multiple)){that.$element.triggerNative('change');that.$element.trigger('changed.bs.select',[clickedIndex,$option.prop('selected'),state]);}}});this.$menu.on('click','li.disabled a, .popover-title, .popover-title :not(.close)',function(e){if(e.currentTarget==this){e.preventDefault();e.stopPropagation();if(that.options.liveSearch&&!$(e.target).hasClass('close')){that.$searchbox.focus();}else{that.$button.focus();}}});this.$menuInner.on('click','.divider, .dropdown-header',function(e){e.preventDefault();e.stopPropagation();if(that.options.liveSearch){that.$searchbox.focus();}else{that.$button.focus();}});this.$menu.on('click','.popover-title .close',function(){that.$button.click();});this.$searchbox.on('click',function(e){e.stopPropagation();});this.$menu.on('click','.actions-btn',function(e){if(that.options.liveSearch){that.$searchbox.focus();}else{that.$button.focus();}
e.preventDefault();e.stopPropagation();if($(this).hasClass('bs-select-all')){that.selectAll();}else{that.deselectAll();}
that.$element.triggerNative('change');});this.$element.change(function(){that.render(false);});},liveSearchListener:function(){var that=this,$no_results=$('<li class="no-results"></li>');this.$button.on('click.dropdown.data-api touchstart.dropdown.data-api',function(){that.$menuInner.find('.active').removeClass('active');if(!!that.$searchbox.val()){that.$searchbox.val('');that.$lis.not('.is-hidden').removeClass('hidden');if(!!$no_results.parent().length)$no_results.remove();}
if(!that.multiple)that.$menuInner.find('.selected').addClass('active');setTimeout(function(){that.$searchbox.focus();},10);});this.$searchbox.on('click.dropdown.data-api focus.dropdown.data-api touchend.dropdown.data-api',function(e){e.stopPropagation();});this.$searchbox.on('input propertychange',function(){if(that.$searchbox.val()){var $searchBase=that.$lis.not('.is-hidden').removeClass('hidden').children('a');if(that.options.liveSearchNormalize){$searchBase=$searchBase.not(':a'+that._searchStyle()+'("'+normalizeToBase(that.$searchbox.val())+'")');}else{$searchBase=$searchBase.not(':'+that._searchStyle()+'("'+that.$searchbox.val()+'")');}
$searchBase.parent().addClass('hidden');that.$lis.filter('.dropdown-header').each(function(){var $this=$(this),optgroup=$this.data('optgroup');if(that.$lis.filter('[data-optgroup='+optgroup+']').not($this).not('.hidden').length===0){$this.addClass('hidden');that.$lis.filter('[data-optgroup='+optgroup+'div]').addClass('hidden');}});var $lisVisible=that.$lis.not('.hidden');$lisVisible.each(function(index){var $this=$(this);if($this.hasClass('divider')&&($this.index()===$lisVisible.first().index()||$this.index()===$lisVisible.last().index()||$lisVisible.eq(index+1).hasClass('divider'))){$this.addClass('hidden');}});if(!that.$lis.not('.hidden, .no-results').length){if(!!$no_results.parent().length){$no_results.remove();}
$no_results.html(that.options.noneResultsText.replace('{0}','"'+htmlEscape(that.$searchbox.val())+'"')).show();that.$menuInner.append($no_results);}else if(!!$no_results.parent().length){$no_results.remove();}}else{that.$lis.not('.is-hidden').removeClass('hidden');if(!!$no_results.parent().length){$no_results.remove();}}
that.$lis.filter('.active').removeClass('active');if(that.$searchbox.val())that.$lis.not('.hidden, .divider, .dropdown-header').eq(0).addClass('active').children('a').focus();$(this).focus();});},_searchStyle:function(){var styles={begins:'ibegins',startsWith:'ibegins'};return styles[this.options.liveSearchStyle]||'icontains';},val:function(value){if(typeof value!=='undefined'){this.$element.val(value);this.render();return this.$element;}else{return this.$element.val();}},changeAll:function(status){if(typeof status==='undefined')status=true;this.findLis();var $options=this.$element.find('option'),$lisVisible=this.$lis.not('.divider, .dropdown-header, .disabled, .hidden').toggleClass('selected',status),lisVisLen=$lisVisible.length,selectedOptions=[];for(var i=0;i<lisVisLen;i++){var origIndex=$lisVisible[i].getAttribute('data-original-index');selectedOptions[selectedOptions.length]=$options.eq(origIndex)[0];}
$(selectedOptions).prop('selected',status);this.render(false);},selectAll:function(){return this.changeAll(true);},deselectAll:function(){return this.changeAll(false);},keydown:function(e){var $this=$(this),$parent=$this.is('input')?$this.parent().parent():$this.parent(),$items,that=$parent.data('this'),index,next,first,last,prev,nextPrev,prevIndex,isActive,selector=':not(.disabled, .hidden, .dropdown-header, .divider)',keyCodeMap={32:' ',48:'0',49:'1',50:'2',51:'3',52:'4',53:'5',54:'6',55:'7',56:'8',57:'9',59:';',65:'a',66:'b',67:'c',68:'d',69:'e',70:'f',71:'g',72:'h',73:'i',74:'j',75:'k',76:'l',77:'m',78:'n',79:'o',80:'p',81:'q',82:'r',83:'s',84:'t',85:'u',86:'v',87:'w',88:'x',89:'y',90:'z',96:'0',97:'1',98:'2',99:'3',100:'4',101:'5',102:'6',103:'7',104:'8',105:'9'};if(that.options.liveSearch)$parent=$this.parent().parent();if(that.options.container)$parent=that.$menu;$items=$('[role=menu] li',$parent);isActive=that.$newElement.hasClass('open');if(!isActive&&(e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105||e.keyCode>=65&&e.keyCode<=90)){if(!that.options.container){that.setSize();that.$menu.parent().addClass('open');isActive=true;}else{that.$button.trigger('click');}
that.$searchbox.focus();}
if(that.options.liveSearch){if(/(^9$|27)/.test(e.keyCode.toString(10))&&isActive&&that.$menu.find('.active').length===0){e.preventDefault();that.$menu.parent().removeClass('open');if(that.options.container)that.$newElement.removeClass('open');that.$button.focus();}
$items=$('[role=menu] li'+selector,$parent);if(!$this.val()&&!/(38|40)/.test(e.keyCode.toString(10))){if($items.filter('.active').length===0){$items=that.$menuInner.find('li');if(that.options.liveSearchNormalize){$items=$items.filter(':a'+that._searchStyle()+'('+normalizeToBase(keyCodeMap[e.keyCode])+')');}else{$items=$items.filter(':'+that._searchStyle()+'('+keyCodeMap[e.keyCode]+')');}}}}
if(!$items.length)return;if(/(38|40)/.test(e.keyCode.toString(10))){index=$items.index($items.find('a').filter(':focus').parent());first=$items.filter(selector).first().index();last=$items.filter(selector).last().index();next=$items.eq(index).nextAll(selector).eq(0).index();prev=$items.eq(index).prevAll(selector).eq(0).index();nextPrev=$items.eq(next).prevAll(selector).eq(0).index();if(that.options.liveSearch){$items.each(function(i){if(!$(this).hasClass('disabled')){$(this).data('index',i);}});index=$items.index($items.filter('.active'));first=$items.first().data('index');last=$items.last().data('index');next=$items.eq(index).nextAll().eq(0).data('index');prev=$items.eq(index).prevAll().eq(0).data('index');nextPrev=$items.eq(next).prevAll().eq(0).data('index');}
prevIndex=$this.data('prevIndex');if(e.keyCode==38){if(that.options.liveSearch)index--;if(index!=nextPrev&&index>prev)index=prev;if(index<first)index=first;if(index==prevIndex)index=last;}else if(e.keyCode==40){if(that.options.liveSearch)index++;if(index==-1)index=0;if(index!=nextPrev&&index<next)index=next;if(index>last)index=last;if(index==prevIndex)index=first;}
$this.data('prevIndex',index);if(!that.options.liveSearch){$items.eq(index).children('a').focus();}else{e.preventDefault();if(!$this.hasClass('dropdown-toggle')){$items.removeClass('active').eq(index).addClass('active').children('a').focus();$this.focus();}}}else if(!$this.is('input')){var keyIndex=[],count,prevKey;$items.each(function(){if(!$(this).hasClass('disabled')){if($.trim($(this).children('a').text().toLowerCase()).substring(0,1)==keyCodeMap[e.keyCode]){keyIndex.push($(this).index());}}});count=$(document).data('keycount');count++;$(document).data('keycount',count);prevKey=$.trim($(':focus').text().toLowerCase()).substring(0,1);if(prevKey!=keyCodeMap[e.keyCode]){count=1;$(document).data('keycount',count);}else if(count>=keyIndex.length){$(document).data('keycount',0);if(count>keyIndex.length)count=1;}
$items.eq(keyIndex[count-1]).children('a').focus();}
if((/(13|32)/.test(e.keyCode.toString(10))||(/(^9$)/.test(e.keyCode.toString(10))&&that.options.selectOnTab))&&isActive){if(!/(32)/.test(e.keyCode.toString(10)))e.preventDefault();if(!that.options.liveSearch){var elem=$(':focus');elem.click();elem.focus();e.preventDefault();$(document).data('spaceSelect',true);}else if(!/(32)/.test(e.keyCode.toString(10))){that.$menuInner.find('.active a').click();$this.focus();}
$(document).data('keycount',0);}
if((/(^9$|27)/.test(e.keyCode.toString(10))&&isActive&&(that.multiple||that.options.liveSearch))||(/(27)/.test(e.keyCode.toString(10))&&!isActive)){that.$menu.parent().removeClass('open');if(that.options.container)that.$newElement.removeClass('open');that.$button.focus();}},mobile:function(){this.$element.addClass('mobile-device');},refresh:function(){this.$lis=null;this.liObj={};this.reloadLi();this.render();this.checkDisabled();this.liHeight(true);this.setStyle();this.setWidth();if(this.$lis)this.$searchbox.trigger('propertychange');this.$element.trigger('refreshed.bs.select');},hide:function(){this.$newElement.hide();},show:function(){this.$newElement.show();},remove:function(){this.$newElement.remove();this.$element.remove();},destroy:function(){this.$newElement.remove();if(this.$bsContainer){this.$bsContainer.remove();}else{this.$menu.remove();}
this.$element.off('.bs.select').removeData('selectpicker').removeClass('bs-select-hidden selectpicker');}};function Plugin(option,event){var args=arguments;var _option=option,_event=event;[].shift.apply(args);var value;var chain=this.each(function(){var $this=$(this);if($this.is('select')){var data=$this.data('selectpicker'),options=typeof _option=='object'&&_option;if(!data){var config=$.extend({},Selectpicker.DEFAULTS,$.fn.selectpicker.defaults||{},$this.data(),options);config.template=$.extend({},Selectpicker.DEFAULTS.template,($.fn.selectpicker.defaults?$.fn.selectpicker.defaults.template:{}),$this.data().template,options.template);$this.data('selectpicker',(data=new Selectpicker(this,config,_event)));}else if(options){for(var i in options){if(options.hasOwnProperty(i)){data.options[i]=options[i];}}}
if(typeof _option=='string'){if(data[_option]instanceof Function){value=data[_option].apply(data,args);}else{value=data.options[_option];}}}});if(typeof value!=='undefined'){return value;}else{return chain;}}
var old=$.fn.selectpicker;$.fn.selectpicker=Plugin;$.fn.selectpicker.Constructor=Selectpicker;$.fn.selectpicker.noConflict=function(){$.fn.selectpicker=old;return this;};$(document).data('keycount',0).on('keydown.bs.select','.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="menu"], .bs-searchbox input',Selectpicker.prototype.keydown).on('focusin.modal','.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="menu"], .bs-searchbox input',function(e){e.stopPropagation();});$(window).on('load.bs.select.data-api',function(){$('.selectpicker').each(function(){var $selectpicker=$(this);Plugin.call($selectpicker,$selectpicker.data());})});})(jQuery);
;/**
 * @preserve
 * Project: Bootstrap Hover Dropdown
 * Author: Cameron Spear
 * Version: v2.2.1
 * Contributors: Mattia Larentis
 * Dependencies: Bootstrap's Dropdown plugin, jQuery
 * Description: A simple plugin to enable Bootstrap dropdowns to active on hover and provide a nice user experience.
 * License: MIT
 * Homepage: http://cameronspear.com/blog/bootstrap-dropdown-on-hover-plugin/
 */
!function(e,n){var o=e();e.fn.dropdownHover=function(t){return"ontouchstart"in document?this:(o=o.add(this.parent()),this.each(function(){function r(){d.parents(".navbar").find(".navbar-toggle").is(":visible")||(n.clearTimeout(a),n.clearTimeout(i),i=n.setTimeout(function(){o.find(":focus").blur(),v.instantlyCloseOthers===!0&&o.removeClass("open"),n.clearTimeout(i),d.attr("aria-expanded","true"),s.addClass("open"),d.trigger(h)},v.hoverDelay))}var a,i,d=e(this),s=d.parent(),u={delay:500,hoverDelay:0,instantlyCloseOthers:!0},l={delay:e(this).data("delay"),hoverDelay:e(this).data("hover-delay"),instantlyCloseOthers:e(this).data("close-others")},h="show.bs.dropdown",c="hide.bs.dropdown",v=e.extend(!0,{},u,t,l);s.hover(function(e){return s.hasClass("open")||d.is(e.target)?void r(e):!0},function(){n.clearTimeout(i),a=n.setTimeout(function(){d.attr("aria-expanded","false"),s.removeClass("open"),d.trigger(c)},v.delay)}),d.hover(function(e){return s.hasClass("open")||s.is(e.target)?void r(e):!0}),s.find(".dropdown-submenu").each(function(){var o,t=e(this);t.hover(function(){n.clearTimeout(o),t.children(".dropdown-menu").show(),t.siblings().children(".dropdown-menu").hide()},function(){var e=t.children(".dropdown-menu");o=n.setTimeout(function(){e.hide()},v.delay)})})}))},e(document).ready(function(){e('[data-hover="dropdown"]').dropdownHover()})}(jQuery,window);
;(function(){'use strict';if(!$.evo){$.evo={'showDebug':false};}
var EvoClass=function(options){this.init(options);};EvoClass.VERSION='1.0.0';EvoClass.DEFAULTS={captcha:{}};EvoClass.prototype={constructor:EvoClass,init:function(options){this.options=$.extend({},EvoClass.DEFAULTS,options);},generateSlickSlider:function(){$('.evo-box-slider:not(.slick-initialized)').slick({arrows:true,slidesToShow:1});$('.evo-slider:not(.slick-initialized)').slick({arrows:true,slidesToShow:3,responsive:[{breakpoint:480,settings:{slidesToShow:1}},{breakpoint:768,settings:{slidesToShow:2}},{breakpoint:992,settings:{slidesToShow:3}}]});},addSliderTouchSupport:function(){$('.carousel').each(function(){if($(this).find('.item').length>1){$(this).find('.carousel-control').css('display','block');$(this).swiperight(function(){$(this).carousel('prev');}).swipeleft(function(){$(this).carousel('next');});}else{$(this).find('.carousel-control').css('display','none');}});},scrollStuff:function(){var breakpoint=0,pos,sidePanel=$('#sidepanel_left');if(sidePanel.length){breakpoint=sidePanel.position().top+sidePanel.hiddenDimension('height');}
pos=breakpoint-$(this).scrollTop();if($(this).scrollTop()>200&&!$('#to-top').hasClass('active')){$('#to-top').addClass('active');}else if($(this).scrollTop()<200&&$('#to-top').hasClass('active')){$('#to-top').removeClass('active');}
if($(window).width()>768){var $document=$(document),$element=$('.navbar-fixed-top'),className='nav-closed';$document.scroll(function(){$element.toggleClass(className,$document.scrollTop()>=150);});}},productTabs:function(){var tabAnchor=$('#article-tabs');if(tabAnchor&&tabAnchor.hasClass('tab-content')){var items='<ul id="article-tabs-list" class="nav nav-tabs">';$('.panel-heading[data-parent="#article-tabs"]').each(function(){var href=$(this).attr('data-target'),aria=href.replace('#',''),title=$(this).text();items+='<li role="presentation" class="'+aria+'-list"><a href="'+href+'" aria-controls="'+aria+'" role="tab" data-toggle="tab">'+title+'</a></li>';$(this).remove();});$('#article-tabs.tab-content').before(items+'</ul>');$('#article-tabs-list li:first,#article-tabs.tab-content div:first').addClass('active');$('#article-tabs-list').on('click','a',function(e){e.preventDefault();$(this).tab('show');if($(e.target).attr('aria-controls')==='tab-preisverlauf'&&typeof window.priceHistoryChart!=='undefined'&&window.priceHistoryChart===null){window.priceHistoryChart=new Chart(window.ctx).Bar(window.chartData,{responsive:true,scaleBeginAtZero:false,tooltipTemplate:"<%if (label){%><%=label%> - <%}%><%= parseFloat(value).toFixed(2).replace('.', ',') %> "+window.chartDataCurrency});}});if(window.location.hash){$('#article-tabs-list').find('a[href="'+window.location.hash+'"]').tab('show');}}},autoheight:function(){$('.row-eq-height').each(function(i,e){$(e).find('[class*="col-"] > *').responsiveEqualHeightGrid();});},tooltips:function(){$('[data-toggle="tooltip"]').tooltip();},imagebox:function(){$('.image-box').each(function(i,item){var box=$(this),img=box.find('img'),src=img.data('src');box.addClass('loading');if(src&&src.length>0){var padding=$(window).height()/2,square=box.width()+'px';$(img).lazy(padding,function(){$(this).load(function(){img.css('max-height',square);box.css('line-height',square).css('max-height',square).removeClass('loading').addClass('loaded');}).error(function(){box.removeClass('loading').addClass('error');});});}});},bootlint:function(){(function(){var p=window.alert;var s=document.createElement("script");window.alert=function(){console.info(arguments);};s.onload=function(){bootlint.showLintReportForCurrentDocument([]);window.alert=p;};s.src="https://maxcdn.bootstrapcdn.com/bootlint/latest/bootlint.min.js";document.body.appendChild(s);})();},showNotify:function(options){eModal.alert({size:'lg',buttons:false,title:options.title,message:options.text,onShown:function(){$.evo.extended().generateSlickSlider();}});},renderCaptcha:function(parameters){if(typeof parameters!='undefined'){this.options.captcha=$.extend({},this.options.captcha,parameters);}
if(typeof grecaptcha=='undefined'&&!this.options.captcha.loaded){this.options.captcha.loaded=true;var lang=document.documentElement.lang;$.getScript("https://www.google.com/recaptcha/api.js?render=explicit&onload=g_recaptcha_callback&hl="+lang);}else{$('.g-recaptcha').each(function(index,item){parameters=$.extend({},$(item).data(),parameters);try{grecaptcha.render(item,parameters);}
catch(e){}});}},popupDep:function(){$('.popup-dep').click(function(e){var id='#popup'+$(this).attr('id'),title=$(this).attr('title'),html=$(id).html();eModal.alert({message:html,title:title,onShown:function(){var recaptcha=$('.tmp-modal-content .g-recaptcha');if(recaptcha.length===1){var siteKey=recaptcha.data('sitekey'),newRecaptcha=$('<div />');if(typeof siteKey!=='undefined'){newRecaptcha.attr('id','popup-recaptcha').addClass('g-recaptcha');recaptcha.replaceWith(newRecaptcha);grecaptcha.render('popup-recaptcha',{'sitekey':siteKey});}}}});return false;});},popover:function(){$('[data-toggle="popover"]').popover({trigger:'hover',html:true,content:function(){var ref=$(this).attr('data-ref');return $(ref).html();}});},smoothScrollToAnchor:function(href,pushToHistory){var anchorRegex=/^#[\w]+$/;if(!anchorRegex.test(href)){return false;}
var target,targetOffset;target=$('#'+href.slice(1));if(target.length>0){var nav=$('#evo-main-nav-wrapper.do-affix');var fixedOffset=nav.length>0?nav.outerHeight():0;targetOffset=target.offset().top-fixedOffset-parseInt(target.css('margin-top'));$('html, body').animate({scrollTop:targetOffset});if(pushToHistory){history.pushState({},document.title,location.pathname+href);}
return true;}
return false;},smoothScroll:function(){var supportHistory=(history&&history.pushState)?true:false;var that=this;this.smoothScrollToAnchor(location.hash,false);$(document).delegate('a[href^="#"]','click',function(e){var elem=e.target;if(!e.isDefaultPrevented()){if(that.smoothScrollToAnchor(elem.getAttribute('href'),supportHistory)){e.preventDefault();}}});},preventDropdownToggle:function(){$('a.dropdown-toggle').click(function(e){var elem=e.target;if(elem.getAttribute('aria-expanded')=='true'&&elem.getAttribute('href')!='#'){window.location.href=elem.getAttribute('href');e.preventDefault();}});},register:function(){this.addSliderTouchSupport();this.productTabs();this.generateSlickSlider();$('.nav-pills, .nav-tabs').tabdrop();this.autoheight();this.tooltips();this.imagebox();this.renderCaptcha();this.popupDep();this.popover();this.preventDropdownToggle();this.smoothScroll();},loadContent:function(url,callback,error,animation){var that=this;var $wrapper=$('#result-wrapper');if(animation){$wrapper.addClass('loading');}
$.ajax(url,{data:'isAjax'}).done(function(html){var $data=$(html);if(animation){$data.addClass('loading');}
$wrapper.replaceWith($data);$wrapper=$data;if(typeof callback=='function'){callback();}}).fail(function(){if(typeof error=='function'){error();}}).always(function(){$wrapper.removeClass('loading');that.trigger('contentLoaded');});},spinner:function(){var opts={lines:12,length:7,width:5,radius:10,scale:2.0,corners:1,color:'#000',opacity:1/4,rotate:0,direction:1,speed:1,trail:100,fps:20,zIndex:2e9,className:'spinner',top:'50%',left:'50%',shadow:false,hwaccel:false,position:'absolute'}
var target=document.getElementsByClassName('product-offer')[0];var elem=new Spinner(opts).spin(target);return elem;},trigger:function(event,args){$(document).trigger('evo:'+event,args);}};var ie=/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:false;if(ie&&parseInt(ie)<=9){$(document).ready(function(){$.evo.extended().register();});}else{$(window).on('load',function(){$.evo.extended().register();});}
$(window).on('resize',function(){$.evo.extended().autoheight();});$.evo.extended=function(option){return new EvoClass(option);};$.evo.error=function(){if(console&&console.error){console.error(arguments);}}})(jQuery);function g_recaptcha_callback(){$.evo.extended().renderCaptcha();};(function($,document,window,viewport){'use strict';var _stock_info=['out-of-stock','in-short-supply','in-stock'],$v,ArticleClass=function(){this.init();};ArticleClass.DEFAULTS={input:{id:'a'},action:{compareList:'Vergleichsliste',compareListRemove:'Vergleichsliste.remove'},selector:{navBadgeUpdate:'#shop-nav li.compare-list-menu',navBadgeAppend:'#shop-nav li.cart-menu',boxContainer:'section.box-compare'}};ArticleClass.prototype={constructor:ArticleClass,init:function(){this.options=ArticleClass.DEFAULTS;},onLoad:function(){var that=this;var form=$.evo.io().getFormValues('buy_form');if(typeof history.replaceState==='function'){history.replaceState({a:form.a,a2:form.VariKindArtikel||form.a,url:document.location.href,variations:{}},document.title,document.location.href);}
window.addEventListener('popstate',function(event){if(event.state){that.setArticleContent(event.state.a,event.state.a2,event.state.url,event.state.variations);}},false);},register:function(){var that=this,config,inner;this.gallery=$('#gallery').gallery();this.galleryIndex=0;this.galleryLastIdent='_';config=$('.product-configuration').closest('form').find('input[type="radio"], input[type="checkbox"], input[type="number"], select');if(config.length>0){config.on('change',function(){that.configurator();}).keypress(function(e){if(e.which==13){return false;}});that.configurator(true);}
$('.variations select').selectpicker({iconBase:'fa',tickIcon:'fa-check',hideDisabled:true,showTick:true});$('.simple-variations input[type="radio"]').on('change',function(){var val=$(this).val(),key=$(this).parent().data('key');$('.simple-variations [data-key="'+key+'"]').removeClass('active');$('.simple-variations [data-value="'+val+'"]').addClass('active');});$('.simple-variations input[type="radio"], .simple-variations select').on('change',function(){that.variationPrice(true);});$('.switch-variations input[type="radio"], .switch-variations select').on('change',function(){that.variationSwitch(this,true);});if("ontouchstart"in document.documentElement){$('.variations .swatches .variation').on('mouseover',function(){$(this).trigger('click');});}
if(typeof document.body.style.msTransform==='string'){$('.variations label.variation').on('click',function(e){if(e.target.tagName==='IMG'){$(this).trigger('click');}});}
inner=function(context,temporary,force){var id=$(context).attr('data-key'),value=$(context).attr('data-value'),data=$(context).data('list'),title=$(context).attr('data-title'),gallery=$.evo.article().gallery;if(typeof temporary==='undefined'){temporary=true;}
if(!$(context).hasClass('active')||force){if(!!data){gallery.setItems([data],value);if(!temporary){var items=[data];var stacks=gallery.getStacks();for(var s in stacks){if(stacks.hasOwnProperty(s)&&s.match(/^_[0-9a-zA-Z]*$/)&&s!='_'+id){items=$.merge(items,stacks[s]);}}
gallery.setItems([data],'_'+id);gallery.setItems(items,'__');gallery.render('__');$.evo.article().galleryIndex=gallery.index;$.evo.article().galleryLastIdent=gallery.ident;}else{gallery.render(value);}}}};$('.variations .bootstrap-select select').change(function(){var tmp_idx=parseInt($('.variations .bootstrap-select li.selected').attr('data-original-index'))+1;var sel=$(this).find('option:nth-child('+tmp_idx+')');var cont=$(this).closest('.variations');if(cont.hasClass('simple-variations')){inner(sel,false,false);}else{inner(sel,true,false);}});var touchCapable='ontouchstart'in window||(window.DocumentTouch&&document instanceof window.DocumentTouch);if(!touchCapable||ResponsiveBootstrapToolkit.current()!=='xs'){$('.variations .bootstrap-select .dropdown-menu li').hover(function(){var tmp_idx=parseInt($(this).attr('data-original-index'))+1;var sel=$(this).closest('.bootstrap-select').find('select option:nth-child('+tmp_idx+')');inner(sel);},function(){var tmp_idx=parseInt($(this).attr('data-original-index'))+1,p=$(this).closest('.bootstrap-select').find('select option:nth-child('+tmp_idx+')'),id=$(p).attr('data-key'),data=$(p).data('list'),gallery,active;if(!!data){gallery=$.evo.article().gallery;active=$(p).find('.variation.active');gallery.render($.evo.article().galleryLastIdent);gallery.activate($.evo.article().galleryIndex);}});}
$('.variations.simple-variations .variation').click(function(){inner(this,false);});if(!touchCapable||ResponsiveBootstrapToolkit.current()!=='xs'){$('.variations .variation').hover(function(){inner(this);},function(){var p=$(this).closest('.variation'),data=$(this).data('list'),gallery,active;if(!!data){gallery=$.evo.article().gallery;active=$(p).find('.variation.active');gallery.render($.evo.article().galleryLastIdent);gallery.activate($.evo.article().galleryIndex);}});}
$('#jump-to-votes-tab').click(function(){$('#content a[href="#tab-votes"]').tab('show');});if($('.switch-variations').length==1){this.variationSwitch();}
this.registerProductActions();},registerProductActions:function($container){if(typeof $container=='undefined'){$container=$('body');}
$('*[data-toggle="product-actions"] button',$container).on('click',function(event){var data=$(this.form).serializeObject();if($.evo.article().handleProductAction(this,data)){event.preventDefault();}});$('a[data-toggle="product-actions"]',$container).on('click',function(event){var data=$(this).data('value');this.name=$(this).data('name');if($.evo.article().handleProductAction(this,data)){event.preventDefault();}});},addToComparelist:function(data){var productId=parseInt(data[this.options.input.id]);if(productId>0){var that=this;$.evo.io().call('pushToComparelist',[productId],that,function(error,data){if(error){return;}
var response=data.response;if(response){switch(response.nType){case 0:var errorlist='<ul><li>'+response.cHints.join('</li><li>')+'</li></ul>';eModal.alert({title:response.cTitle,message:errorlist});break;case 1:window.location.href=response.cLocation;break;case 2:that.updateComparelist(response);eModal.alert({title:response.cTitle,message:response.cNotification});break;}}});return true;}
return false;},removeFromCompareList:function(data){var productId=parseInt(data[this.options.input.id]);if(productId>0){var that=this;$.evo.io().call('removeFromComparelist',[productId],that,function(error,data){if(error){return;}
var response=data.response;if(response){switch(response.nType){case 0:var errorlist='<ul><li>'+response.cHints.join('</li><li>')+'</li></ul>';eModal.alert({title:response.cTitle,message:errorlist});break;case 1:window.location.href=response.cLocation;break;case 2:that.updateComparelist(response);break;}}});return true;}
return false;},configurator:function(init){var that=this,container=$('#cfg-container'),width,form,sidebar=$('#product-configuration-sidebar');if(container.length===0){return;}
if(viewport.current()!='lg'){sidebar.removeClass('affix');}
if(!sidebar.hasClass('affix')){sidebar.css('width','');}
sidebar.css('width',sidebar.width());if(init){sidebar.affix({offset:{top:function(){var top=container.offset().top-$('#evo-main-nav-wrapper.affix').outerHeight(true);if(viewport.current()!='lg'){top=999999;}
return top;},bottom:function(){var bottom=$('body').height()-(container.height()+container.offset().top);if(viewport.current()!='lg'){bottom=999999;}
return bottom;}}});}
$('#buy_form').find('*[data-selected="true"]').attr('checked',true).attr('selected',true).attr('data-selected',null);form=$.evo.io().getFormValues('buy_form');$.evo.io().call('buildConfiguration',[form],that,function(error,data){var result,i,j,item,cBeschreibung,quantityWrapper,grp,value,enableQuantity,nNetto,quantityInput;if(error){$.evo.error(data);return;}
result=data.response;if(!result.oKonfig_arr){$.evo.error('Missing configuration groups');return;}
nNetto=result.nNettoPreise;that.setPrice(result.fGesamtpreis[nNetto],result.cPreisLocalized[nNetto],result.cPreisString);$('#content .summary').html(result.cTemplate);sidebar.affix('checkPosition');for(i=0;i<result.oKonfig_arr.length;i++){grp=result.oKonfig_arr[i];quantityWrapper=that.getConfigGroupQuantity(grp.kKonfiggruppe);quantityInput=that.getConfigGroupQuantityInput(grp.kKonfiggruppe);if(grp.bAktiv){enableQuantity=grp.bAnzahl;for(j=0;j<grp.oItem_arr.length;j++){item=grp.oItem_arr[j];if(item.bAktiv){if(item.cBildPfad){that.setConfigItemImage(grp.kKonfiggruppe,item.cBildPfad.cPfadKlein);}else{that.setConfigItemImage(grp.kKonfiggruppe,grp.cBildPfad);}
that.setConfigItemDescription(grp.kKonfiggruppe,item.cBeschreibung);enableQuantity=item.bAnzahl;if(!enableQuantity){quantityInput.attr('min',item.fInitial).attr('max',item.fInitial).val(item.fInitial).attr('disabled',true);if(item.fInitial==1){quantityWrapper.slideUp(200);}else{quantityWrapper.slideDown(200);}}else{if(quantityWrapper.css('display')=='none'&&!init){quantityInput.val(item.fInitial);}
quantityWrapper.slideDown(200);quantityInput.attr('disabled',false).attr('min',item.fMin).attr('max',item.fMax);value=quantityInput.val();if(value<item.fMin||value>item.fMax){quantityInput.val(item.fInitial);}}}}}
else{that.setConfigItemDescription(grp.kKonfiggruppe,'');quantityInput.attr('disabled',true);quantityWrapper.slideUp(200);}}});},getConfigGroupQuantity:function(groupId){return $('.cfg-group[data-id="'+groupId+'"] .quantity');},getConfigGroupQuantityInput:function(groupId){return $('.cfg-group[data-id="'+groupId+'"] .quantity input');},getConfigGroupImage:function(groupId){return $('.cfg-group[data-id="'+groupId+'"] .group-image img');},handleProductAction:function(action,data){switch(action.name){case this.options.action.compareList:return this.addToComparelist(data);case this.options.action.compareListRemove:return this.removeFromCompareList(data);}
return false;},setConfigItemImage:function(groupId,img){$('.cfg-group[data-id="'+groupId+'"] .group-image img').attr('src',img).first();},setConfigItemDescription:function(groupId,itemBeschreibung){var groupItems=$('.cfg-group[data-id="'+groupId+'"] .group-items');var descriptionDropdownContent=groupItems.find('#filter-collapsible_dropdown_'+groupId+'');var descriptionDropdownContentHidden=groupItems.find('.hidden');var descriptionCheckdioContent=groupItems.find('div[id^="filter-collapsible_checkdio"]');var multiselect=groupItems.find('select').attr("multiple");if(descriptionDropdownContentHidden.length>0&&descriptionCheckdioContent.length==0&&itemBeschreibung.length>0&&multiselect!=="multiple"){groupItems.find('a[href="#filter-collapsible_dropdown_'+groupId+'"]').removeClass('hidden');descriptionDropdownContent.replaceWith('<div id="filter-collapsible_dropdown_'+groupId+'" class="collapse top10 panel-body">'+itemBeschreibung+'</div>');}else if(descriptionDropdownContentHidden.length==0&&descriptionCheckdioContent.length==0&&itemBeschreibung.length==0&&multiselect!=="multiple"){groupItems.find('a[href="#filter-collapsible_dropdown_'+groupId+'"]').addClass('hidden');descriptionDropdownContent.addClass('hidden');}else if(descriptionDropdownContentHidden.length==0&&descriptionCheckdioContent.length==0&&itemBeschreibung.length>0&&multiselect!=="multiple"){descriptionDropdownContent.replaceWith('<div id="filter-collapsible_dropdown_'+groupId+'" class="collapse top10 panel-body">'+itemBeschreibung+'</div>');}},setPrice:function(price,fmtPrice,priceLabel){$('#product-offer .price').html(fmtPrice);if(priceLabel.length>0){$('#product-offer .price_label').html(priceLabel);}},setStaffelPrice:function(prices,fmtPrices){var $container=$('#product-offer');$.each(fmtPrices,function(index,value){$('.bulk-price-'+index+' .bulk-price',$container).html(value);});},setVPEPrice:function(fmtVPEPrice,VPEPrices,fmtVPEPrices){var $container=$('#product-offer');$('.base-price .value',$container).html(fmtVPEPrice);$.each(fmtVPEPrices,function(index,value){$('.bulk-price-'+index+' .bulk-base-price',$container).html(value);});},setUnitWeight:function(UnitWeight,newUnitWeight){$('#article-tabs .product-attributes .weight-unit').html(newUnitWeight);},setProductNumber:function(productNumber){$('#product-offer span[itemprop="sku"]').html(productNumber);},setArticleContent:function(id,variation,url,variations){$.evo.extended().loadContent(url,function(content){$.evo.extended().register();$.evo.article().register();$(variations).each(function(i,item){$.evo.article().variationSetVal(item.key,item.value);});if(document.location.href!=url){history.pushState({a:id,a2:variation,url:url,variations:variations},"",url);}},function(){$.evo.error('Error loading '+url);});},updateComparelist:function(response){var $badgeUpd=$(this.options.selector.navBadgeUpdate);if(response.nCount>1&&response.cNavBadge.length){var badge=$(response.cNavBadge);if($badgeUpd.size()>0){$badgeUpd.replaceWith(badge);}else{$(this.options.selector.navBadgeAppend).before(badge);}
badge.on('click','.popup',function(e){var url=e.currentTarget.href;url+=(url.indexOf('?')===-1)?'?isAjax=true':'&isAjax=true';eModal.ajax({'size':'lg','url':url});e.stopPropagation();return false;});}else if($badgeUpd.size()>0){$badgeUpd.remove();}
var $list=$(this.options.selector.boxContainer);if($list.size()>0){if(response.cBoxContainer.length){var $boxContent=$(response.cBoxContainer);this.registerProductActions($boxContent);$list.replaceWith($boxContent).removeClass('hidden');}else{$list.html('').addClass('hidden');}}},variationResetAll:function(){$('.variation[data-value] input:checked').prop('checked',false);$('.variations select option').prop('selected',false);$('.variations select').selectpicker('refresh');},variationDisableAll:function(){$('.swatches-selected').text('');$('[data-value].variation').each(function(i,item){$(item).removeClass('active').removeClass('loading').addClass('not-available');$.evo.article().removeStockInfo($(item));});},variationSetVal:function(key,value){$('[data-key="'+key+'"]').val(value).closest('select').selectpicker('refresh');},variationEnable:function(key,value){var item=$('[data-value="'+value+'"].variation');item.removeClass('not-available');item.closest('select').selectpicker('refresh');},variationActive:function(key,value,def){var item=$('[data-value="'+value+'"].variation');item.addClass('active').removeClass('loading').find('input').prop('checked',true).end().prop('selected',true);item.closest('select').selectpicker('refresh');$('[data-id="'+key+'"].swatches-selected').text($(item).attr('data-original'));},removeStockInfo:function(item){var type=item.attr('data-type'),elem,label,wrapper;switch(type){case'option':label=item.data('content');wrapper=$('<div />').append(label);$(wrapper).find('.label-not-available').remove();label=$(wrapper).html();item.data('content',label).attr('data-content',label);item.closest('select').selectpicker('refresh');break;case'radio':elem=item.find('.label-not-available');if(elem.length===1){$(elem).remove();}
break;case'swatch':item.tooltip('destroy');break;}
item.removeAttr('data-stock');},variationInfo:function(value,status,note){var item=$('[data-value="'+value+'"].variation'),type=item.attr('data-type'),text,content,wrapper,label;item.attr('data-stock',_stock_info[status]);switch(type){case'option':text=' ('+note+')';content=item.data('content');wrapper=$('<div />');wrapper.append(content);wrapper.find('.label-not-available').remove();label=$('<span />').addClass('label label-default label-not-available').text(note);wrapper.append(label);item.data('content',$(wrapper).html()).attr('data-content',$(wrapper).html());item.closest('select').selectpicker('refresh');break;case'radio':item.find('.label-not-available').remove();label=$('<span />').addClass('label label-default label-not-available').text(note);item.append(label);break;case'swatch':item.tooltip({title:note,trigger:'hover',container:'body'});break;}},variationSwitch:function(item,animation){var key=0,value=0,io=$.evo.io(),args=io.getFormValues('buy_form'),$current,$spinner=null,$wrapper=$('#result-wrapper');if(animation){$wrapper.addClass('loading');$spinner=$.evo.extended().spinner();}
if(item){$current=$(item).hasClass('variation')?$(item):$(item).closest('.variation');if($current.context.tagName==='SELECT'){$current=$(item).find('option:selected');}
$current.addClass('loading');key=$current.data('key');value=$current.data('value');}
$.evo.article().variationDispose();io.call('checkVarkombiDependencies',[args,key,value],item,function(error,data){$wrapper.removeClass('loading');if(animation){$spinner.stop();}
if(error){$.evo.error('checkVarkombiDependencies');}});},variationDispose:function(){$('[role="tooltip"]').remove();},variationPrice:function(animation){var io=$.evo.io(),args=io.getFormValues('buy_form');var $spinner=null,$wrapper=$('#result-wrapper');if(animation){$wrapper.addClass('loading');$spinner=$.evo.extended().spinner();}
io.call('checkDependencies',[args],null,function(error,data){$wrapper.removeClass('loading');if(animation){$spinner.stop();}
if(error){$.evo.error('checkDependencies');}});}};$v=new ArticleClass();var ie=/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:false;if(ie&&parseInt(ie)<=9){$(document).ready(function(){$v.onLoad();$v.register();});}else{$(window).on('load',function(){$v.onLoad();$v.register();});}
$(window).resize(viewport.changed(function(){$v.configurator();}));$.evo.article=function(){return $v;};})(jQuery,document,window,ResponsiveBootstrapToolkit);;(function(){'use strict';var BasketClass=function(options){this.init(options);};BasketClass.DEFAULTS={input:{id:'a',quantity:'anzahl'},selector:{list:{main:'*[data-toggle="basket-add"]',form:'form.form-basket',quantity:'input.quantity',submit:'*[type="submit"]',loading:'io-loading'},cart:{container:'*[data-toggle="basket-items"]'}}};BasketClass.prototype={constructor:BasketClass,init:function(options){this.options=$.extend({},BasketClass.DEFAULTS,options);},addToBasket:function($form){var $main=$form;var data=$form.serializeObject();var productId=parseInt(data[this.options.input.id]);var quantity=parseFloat(data[this.options.input.quantity]);if(productId>0&&quantity>0){this.pushToBasket($main,productId,quantity,data);}},pushToBasket:function($main,productId,quantity,data){var that=this;that.toggleState($main,true);$.evo.io().call('pushToBasket',[productId,quantity,data],that,function(error,data){that.toggleState($main,false);if(error){return;}
var response=data.response;if(response){switch(response.nType){case 0:that.error(response);break;case 1:that.redirectTo(response);break;case 2:that.updateCart();that.pushedToBasket(response);break;}}});},toggleState:function($main,loading){var cls=this.options.selector.list.loading;if(loading){$main.addClass(cls);}else{$main.removeClass(cls);}},redirectTo:function(response){window.location.href=response.cLocation;},error:function(response){var errorlist='<ul><li>'+response.cHints.join('</li><li>')+'</li></ul>';$.evo.extended().showNotify({text:errorlist,title:response.cLabel});},pushedToBasket:function(response){$.evo.extended().showNotify({text:response.cPopup,title:response.cNotification});},updateCart:function(type){var that=this,t=parseInt(type);$.evo.io().call('getBasketItems',[t],this,function(error,data){if(error){return;}
var tpl=data.response.cTemplate;$(that.options.selector.cart.container).empty().append(tpl);});}};$.evo.basket=function(){return new BasketClass();};$('#main-wrapper').on('submit','[data-toggle="basket-add"]',function(event){event.preventDefault();$.evo.basket().addToBasket($(this));}).on('show.bs.dropdown','[data-toggle="basket-items"]',function(event){$.evo.basket().updateCart();});})(jQuery);;(function(){'use strict';var IOClass=function(options){this.init(options);};IOClass.DEFAULTS={baseUrl:'',ioUrl:''};IOClass.prototype={constructor:IOClass,init:function(options){this.options=$.extend({},IOClass.DEFAULTS,options);},call:function(name,params,context,callback){var data={'name':name,'params':params};this.request(data,context,callback);},request:function(req,context,callback){var that=this;return $.ajax({type:"POST",dataType:"json",url:this.options.ioUrl,data:{'io':JSON.stringify(req)},success:function(data,textStatus,jqXHR){that.handleResponse(data,context);if(typeof callback==='function'){callback(false,context);}},error:function(jqXHR,textStatus,errorThrown){that.handleError(textStatus,errorThrown);if(typeof callback==='function'){callback(true,textStatus);}}});},handleResponse:function(data,context){var jslist=data.js||[];var csslist=data.css||[];for(var i=0;i<csslist.length;i++){var item=csslist[i];var value=item.data.replace(/'/g,"\\'");var js="if ($('#"+item.target+"').length > 0) $('#"+item.target+"')[0]['"+item.attr+"'] = '"+value+"';";jslist.push(js);}
if(!context){context=this;}
context.delegate=function(){var calllist=jslist.join('');eval(calllist);};context.delegate();},handleError:function(textStatus,errorThrown){$.evo.error('handleError',textStatus,errorThrown);},getFormValues:function(parent){return $('#'+parent).serializeObject();}};$.evo.io=function(){return new IOClass({'ioUrl':'io.php'});};})(jQuery);;(function(){'use strict';var GalleryClass=function(element,options){this.init(element,options);};GalleryClass.DEFAULTS={items:[],size:'md',fullscreen:false,template:{inline:'<div class="image-gallery has-thumbs">'+'<ul class="image-container v-wrap carousel vertical slide"></ul>'+'<div class="thumbs">'+'<button name="btnGalleryPre" type="button" class="btnGalleryPre slick-up"></button>'+'<div class="thumbs-box">'+'<ul class="image-thumbs carousel vertical"></ul>'+'</div>'+'<button  name="btnGalleryNext" type="button" class="btnGalleryNext stick-down"></button>'+'</div>'+'</div>',fullscreen:'<div class="fullscreen image-gallery has-thumbs">'+'<ul class="image-container box-expanded"></ul>'+'<ul class="image-thumbs carousel vertical"></ul>'+'</div>',indicator:'<div class="pswp-indicator nivo-controlNav carousel-indicators bottom17"></div>'}};GalleryClass.prototype={constructor:GalleryClass,element:null,ident:'_',index:0,stack:[],init:function(element,options){var items=[];this.index=0;this.element=element;this.options=$.extend({},GalleryClass.DEFAULTS,options);if(this.options.items.length>0){items=this.options.items;}else{$(this.element).find('img').each(function(i,item){var image=$(item).data('list');items.push(image);});}
this.setItems(items);this.render();},getIdent:function(){return this.ident;},setItems:function(items,scope){var self=this;this.ident=scope||this.ident;this.clearStack();$(items).each(function(i,item){self.getStack().push(item);});},render:function(scope){var self=this,template,index,item,src,alt,itemClass,image,thumb,pswpElement,items,pswpItems,options,gallery,indicator,step,p,i;this.ident=scope||this.ident;$(this.element).removeClass('hidden').hide();template=$(this.options.fullscreen?this.options.template.fullscreen:this.options.template.inline);self.showThumbs(false);$(this.element).empty();for(i=0;i<self.getStack().length;i++){item=self.getStack()[i];src=item[self.options.size].src;alt=item[self.options.size].alt;itemClass=this.options.fullscreen?'item box-expanded':'item v-box';image=$('<li />').addClass(itemClass).data('src',src).append($('<img />').attr('src',src).attr('alt',alt).addClass('img-responsive-width'));$(template).find('.image-container').append(image);thumb=$('<li />').addClass('item').append($('<img />').attr('src',item.xs.src).attr('alt',alt).attr('width',item.xs.size.width).attr('height',item.xs.size.height));$(template).find('.image-thumbs').append(thumb);}
$(this.element).append($(template));if(ResponsiveBootstrapToolkit.current()==='xs'){$(this.element).find('.image-container').swipeleft(function(e){self.next();});$(this.element).find('.image-container').swiperight(function(e){self.prev();});$(this.element).find('.thumbs').swipeleft(function(e){var el=GalleryClass.prototype;el.scrollTo(-2);});$(this.element).find('.thumbs').swiperight(function(e){var el=GalleryClass.prototype;el.scrollTo(2);});}
$(this.element).find('.image-thumbs > li').on('click',function(e){self.activate($(this).index());});if(!this.options.fullscreen){$(this.element).find('.image-container li').addClass('action').on('click',function(){index=$(this).index();pswpElement=document.querySelectorAll('.pswp')[0];items=jQuery.extend(true,[],self.getStack());pswpItems=[];for(i=0;i<items.length;i++){p=items[i]['lg'];pswpItems.push({src:p.src,w:p.size.width,h:p.size.height});}
options={index:index,mouseUsed:true,closeOnScroll:false,history:false};gallery=new PhotoSwipe(pswpElement,PhotoSwipeUI_Default,pswpItems,options);gallery.init();if(pswpItems.length>1){indicator=$(self.options.template.indicator);$(gallery.container).parent().addClass('theme-default');$(gallery.container).parent().append(indicator);for(i=0;i<pswpItems.length;i++){indicator.append($('<a />').attr('src','#').attr('rel',i).addClass(gallery.getCurrentIndex()==i?'nivo-control active':'nivo-control').click(function(e){gallery.goTo(parseInt($(this).attr('rel')));}));}
gallery.listen('beforeChange',function(){$(this.container).parent().find('a.nivo-control').removeClass('active');$(this.container).parent().find('a.nivo-control[rel="'+this.getCurrentIndex()+'"]').addClass('active');});}
return false;});}
$(this.element).show();this.adjust();$(window).resize(function(){self.adjust();});this.activate(0);this.showThumbs(this.itemCount()>1);this.adjust();GalleryClass.prototype.element=this.element;$(this.element).find('button[name="btnGalleryPre"]').click(function(){var el=GalleryClass.prototype;if($(el.element).find('.image-thumbs').css('position')==='absolute'){step=Math.ceil($(el.element).find('.thumbs-box').outerHeight(false)/$(el.element).find('.image-thumbs li').outerHeight(true));}else{step=Math.ceil($(el.element).find('.thumbs-box').outerWidth(false)/$(el.element).find('.image-thumbs li').outerWidth(true));}
el.scrollTo(-step);});$(this.element).find('button[name="btnGalleryNext"]').click(function(){var el=GalleryClass.prototype;if($(el.element).find('.image-thumbs').css('position')==='absolute'){step=Math.ceil($(el.element).find('.thumbs-box').outerHeight(false)/$(el.element).find('.image-thumbs li').outerHeight(true));}else{step=Math.ceil($(el.element).find('.thumbs-box').outerWidth(false)/$(el.element).find('.image-thumbs li').outerWidth(true));}
el.scrollTo(step);});},scrollTo:function(step){var next,img_w,img_h,rect,listElem;if($(this.element).find('.image-thumbs').css('position')==='absolute'){listElem=$(this.element).find('.image-thumbs li');rect=listElem[0].getBoundingClientRect();if(rect.height){img_h=rect.height+((parseInt(listElem.css('margin-bottom').replace('px',''))+parseInt(listElem.css('margin-top').replace('px','')))/2);}else{img_h=(rect.bottom-rect.top)+(listElem.outerHeight(true)-(rect.bottom-rect.top))/2+listElem.outerHeight(true)-(rect.bottom-rect.top);}
if($(this.element).find('.image-thumbs').outerHeight(false)-$(this.element).find('.thumbs-box').scrollTop()-(img_h*step)>(img_h*step)){next=img_h*step;}else{next=Math.floor(($(this.element).find('.image-thumbs').outerHeight(false)-$(this.element).find('.thumbs-box').scrollTop()-(img_h*step))/img_h)*img_h;}
$(this.element).find('.thumbs-box').animate({scrollTop:'+='+next},'slow');}else{img_w=$(this.element).find('.image-thumbs li').outerWidth(true);if($(this.element).find('.image-thumbs').outerWidth(false)-$(this.element).find('.thumbs-box').scrollLeft()+(img_w*step)>(img_w*step*-1)){next=img_w*step;}else{next=Math.floor(($(this.element).find('.image-thumbs').outerWidth(false)-$(this.element).find('.thumbs-box').scrollLeft()-(img_w*step*-1))/img_w)*img_w*-1;}
$(this.element).find('.thumbs-box').animate({scrollLeft:'-='+next},'slow');}},showThumbs:function(show){if(show){$(this.element).find('.image-gallery').addClass('has-thumbs');}else{$(this.element).find('.image-gallery').removeClass('has-thumbs');}},adjust:function(){var height=this.calcHeights(),imgCount=this.itemCount(),primary_h,listElem,main_img_w,main_img_h,img_w,img_w_outer,img_h_outer,img_h,h,prevElem,nextElem,btn_left,btn_top,w,rect,imagesPerView,ulw;if(imgCount>0){primary_h=$('.product-primary').height();listElem=$(this.element).find('.image-thumbs li');main_img_w=$(this.element).find('.thumbs').width();main_img_h=$('.product-gallery').height();img_w=listElem.outerWidth(true);img_w_outer=(listElem.outerWidth(true)-listElem.outerWidth(false));prevElem=$(this.element).find('button[name="btnGalleryPre"]');nextElem=$(this.element).find('button[name="btnGalleryNext"]');if($(this.element).find('.image-thumbs').css('position')==='absolute'){primary_h-=40;$(this.element).find('.thumbs-box').scrollLeft(0);rect=listElem[0].getBoundingClientRect();img_h_outer=((parseInt(listElem.css('margin-bottom').replace('px',''))+parseInt(listElem.css('margin-top').replace('px','')))/2);img_h=(rect.height)?(rect.height+img_h_outer):(rect.bottom-rect.top+img_h_outer);imagesPerView=Math.floor(primary_h/img_h);$(this.element).find('.thumbs-box').css({'height':Math.ceil((imagesPerView*img_h)-img_h_outer)+'px','width':(img_w-img_w_outer)+'px','overflow':'hidden'});$(this.element).find('.thumbs').css({'position':'absolute'});btn_left=parseInt((img_w-img_w_outer)/2-prevElem.outerHeight(true)/2);prevElem.removeClass('btn-gallery-left').addClass('btn-gallery-up').css({'top':'','left':btn_left+'px'});nextElem.removeClass('btn-gallery-right').addClass('btn-gallery-down').css({'top':'','left':btn_left+'px'});if($(this.element).find('.image-thumbs').height()<=$(this.element).find('.thumbs').height()){prevElem.hide();nextElem.hide();}else{prevElem.show();nextElem.show();$(this.element).find('.thumbs-box').css({'margin':'22px 0'});}}else{$(this.element).find('.thumbs-box').scrollTop(0);img_h=$(this.element).find('.image-thumbs li').outerHeight(true);h=ResponsiveBootstrapToolkit.current()==='xs'?img_h:parseInt((primary_h-main_img_h)/img_h)*img_h;h=(h===0)?img_h:h;w=parseInt((main_img_w/img_w))*(img_w);ulw=Math.ceil(imgCount/parseInt(h/img_h))*img_w;if((h/img_h)*(w/img_w)>imgCount){h=Math.ceil(imgCount/(w/img_w))*img_h;ulw=w;}
$(this.element).find('.thumbs-box').css({'height':h+'px','width':(w-img_w_outer)+'px','overflow':'hidden'});$(this.element).find('.image-thumbs').css({'width':ulw+'px'});$(this.element).find('.thumbs').css({'position':'relative'});btn_top=parseInt((h-prevElem.height())/2);prevElem.removeClass('btn-gallery-up').addClass('btn-gallery-left').css({'left':'','top':btn_top+'px'});nextElem.removeClass('btn-gallery-down').addClass('btn-gallery-right').css({'left':'','top':btn_top+'px'});if($(this.element).find('.image-thumbs').width()<=$(this.element).find('.thumbs').width()){prevElem.hide();nextElem.hide();}else{prevElem.show();nextElem.show();$(this.element).find('.thumbs-box').css({'margin':'auto'});}}}else{$(this.element).find('.thumbs').hide();}
if(this.options.fullscreen||ResponsiveBootstrapToolkit.current()==='xs'){this.resetMaxHeight();}else{this.setMaxHeight(height,img_h);}},calcHeights:function(){var images=this.getStack(),newMaxHeight=$(this.element).find('ul.image-container').outerHeight(false),i,size;for(i=0;i<images.length;i++){size=images[i][this.options.size].size;if(size.height>newMaxHeight){newMaxHeight=size.height;}}
return newMaxHeight;},setMaxHeight:function(height,thumb_height){$(this.element).find('.image-gallery').css('max-height',height+thumb_height);$(this.element).find('ul.image-container > li img').css('max-height',height);$(this.element).find('ul.image-container').css('height',height);},resetMaxHeight:function(){$(this.element).find('.image-gallery, ul.image-container > li img').css('max-height','');$(this.element).find('ul.image-container').css('height','');},itemCount:function(){return this.getStack().length;},clearStack:function(scope){var s=scope||this.ident;if(typeof this.stack[s]!=='undefined'){this.stack[s]=[];}},getStack:function(scope){var s=scope||this.ident;if(typeof this.stack[s]==='undefined'){this.stack[s]=[];}
return this.stack[s];},getStacks:function(){return this.stack;},activate:function(index){$(this.element).find('ul.image-container > li, ul.image-thumbs > li').each(function(index,item){$(item).removeClass('active');});$(this.element).find('ul.image-container > li:eq('+index+'), ul.image-thumbs > li:eq('+index+')').addClass('active');this.index=index;},next:function(){var idx=(this.index+1)>=this.itemCount()?0:this.index+1;this.activate(idx);},prev:function(){var idx=(this.index-1)<0?this.itemCount()-1:this.index-1;this.activate(idx);}};$.fn.gallery=function(option){if(this.length===0){return this;}else if(this.length>1){this.each(function(){$(this).gallery(option);});return this;}
return new GalleryClass(this,option);};})(jQuery);;(function(root,factory){if(typeof define==="function"&&define.amd){define("bloodhound",["jquery"],function(a0){return root["Bloodhound"]=factory(a0);});}else if(typeof exports==="object"){module.exports=factory(require("jquery"));}else{root["Bloodhound"]=factory(jQuery);}})(this,function($){var _=function(){"use strict";return{isMsie:function(){return /(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:false;},isBlankString:function(str){return!str||/^\s*$/.test(str);},escapeRegExChars:function(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");},isString:function(obj){return typeof obj==="string";},isNumber:function(obj){return typeof obj==="number";},isArray:$.isArray,isFunction:$.isFunction,isObject:$.isPlainObject,isUndefined:function(obj){return typeof obj==="undefined";},isElement:function(obj){return!!(obj&&obj.nodeType===1);},isJQuery:function(obj){return obj instanceof $;},toStr:function toStr(s){return _.isUndefined(s)||s===null?"":s+"";},bind:$.proxy,each:function(collection,cb){$.each(collection,reverseArgs);function reverseArgs(index,value){return cb(value,index);}},map:$.map,filter:$.grep,every:function(obj,test){var result=true;if(!obj){return result;}
$.each(obj,function(key,val){if(!(result=test.call(null,val,key,obj))){return false;}});return!!result;},some:function(obj,test){var result=false;if(!obj){return result;}
$.each(obj,function(key,val){if(result=test.call(null,val,key,obj)){return false;}});return!!result;},mixin:$.extend,identity:function(x){return x;},clone:function(obj){return $.extend(true,{},obj);},getIdGenerator:function(){var counter=0;return function(){return counter++;};},templatify:function templatify(obj){return $.isFunction(obj)?obj:template;function template(){return String(obj);}},defer:function(fn){setTimeout(fn,0);},debounce:function(func,wait,immediate){var timeout,result;return function(){var context=this,args=arguments,later,callNow;later=function(){timeout=null;if(!immediate){result=func.apply(context,args);}};callNow=immediate&&!timeout;clearTimeout(timeout);timeout=setTimeout(later,wait);if(callNow){result=func.apply(context,args);}
return result;};},throttle:function(func,wait){var context,args,timeout,result,previous,later;previous=0;later=function(){previous=new Date();timeout=null;result=func.apply(context,args);};return function(){var now=new Date(),remaining=wait-(now-previous);context=this;args=arguments;if(remaining<=0){clearTimeout(timeout);timeout=null;previous=now;result=func.apply(context,args);}else if(!timeout){timeout=setTimeout(later,remaining);}
return result;};},stringify:function(val){return _.isString(val)?val:JSON.stringify(val);},noop:function(){}};}();var VERSION="0.11.1";var tokenizers=function(){"use strict";return{nonword:nonword,whitespace:whitespace,obj:{nonword:getObjTokenizer(nonword),whitespace:getObjTokenizer(whitespace)}};function whitespace(str){str=_.toStr(str);return str?str.split(/\s+/):[];}
function nonword(str){str=_.toStr(str);return str?str.split(/\W+/):[];}
function getObjTokenizer(tokenizer){return function setKey(keys){keys=_.isArray(keys)?keys:[].slice.call(arguments,0);return function tokenize(o){var tokens=[];_.each(keys,function(k){tokens=tokens.concat(tokenizer(_.toStr(o[k])));});return tokens;};};}}();var LruCache=function(){"use strict";function LruCache(maxSize){this.maxSize=_.isNumber(maxSize)?maxSize:100;this.reset();if(this.maxSize<=0){this.set=this.get=$.noop;}}
_.mixin(LruCache.prototype,{set:function set(key,val){var tailItem=this.list.tail,node;if(this.size>=this.maxSize){this.list.remove(tailItem);delete this.hash[tailItem.key];this.size--;}
if(node=this.hash[key]){node.val=val;this.list.moveToFront(node);}else{node=new Node(key,val);this.list.add(node);this.hash[key]=node;this.size++;}},get:function get(key){var node=this.hash[key];if(node){this.list.moveToFront(node);return node.val;}},reset:function reset(){this.size=0;this.hash={};this.list=new List();}});function List(){this.head=this.tail=null;}
_.mixin(List.prototype,{add:function add(node){if(this.head){node.next=this.head;this.head.prev=node;}
this.head=node;this.tail=this.tail||node;},remove:function remove(node){node.prev?node.prev.next=node.next:this.head=node.next;node.next?node.next.prev=node.prev:this.tail=node.prev;},moveToFront:function(node){this.remove(node);this.add(node);}});function Node(key,val){this.key=key;this.val=val;this.prev=this.next=null;}
return LruCache;}();var PersistentStorage=function(){"use strict";var LOCAL_STORAGE;try{LOCAL_STORAGE=window.localStorage;LOCAL_STORAGE.setItem("~~~","!");LOCAL_STORAGE.removeItem("~~~");}catch(err){LOCAL_STORAGE=null;}
function PersistentStorage(namespace,override){this.prefix=["__",namespace,"__"].join("");this.ttlKey="__ttl__";this.keyMatcher=new RegExp("^"+_.escapeRegExChars(this.prefix));this.ls=override||LOCAL_STORAGE;!this.ls&&this._noop();}
_.mixin(PersistentStorage.prototype,{_prefix:function(key){return this.prefix+key;},_ttlKey:function(key){return this._prefix(key)+this.ttlKey;},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=_.noop;},_safeSet:function(key,val){try{this.ls.setItem(key,val);}catch(err){if(err.name==="QuotaExceededError"){this.clear();this._noop();}}},get:function(key){if(this.isExpired(key)){this.remove(key);}
return decode(this.ls.getItem(this._prefix(key)));},set:function(key,val,ttl){if(_.isNumber(ttl)){this._safeSet(this._ttlKey(key),encode(now()+ttl));}else{this.ls.removeItem(this._ttlKey(key));}
return this._safeSet(this._prefix(key),encode(val));},remove:function(key){this.ls.removeItem(this._ttlKey(key));this.ls.removeItem(this._prefix(key));return this;},clear:function(){var i,keys=gatherMatchingKeys(this.keyMatcher);for(i=keys.length;i--;){this.remove(keys[i]);}
return this;},isExpired:function(key){var ttl=decode(this.ls.getItem(this._ttlKey(key)));return _.isNumber(ttl)&&now()>ttl?true:false;}});return PersistentStorage;function now(){return new Date().getTime();}
function encode(val){return JSON.stringify(_.isUndefined(val)?null:val);}
function decode(val){return $.parseJSON(val);}
function gatherMatchingKeys(keyMatcher){var i,key,keys=[],len=LOCAL_STORAGE.length;for(i=0;i<len;i++){if((key=LOCAL_STORAGE.key(i)).match(keyMatcher)){keys.push(key.replace(keyMatcher,""));}}
return keys;}}();var Transport=function(){"use strict";var pendingRequestsCount=0,pendingRequests={},maxPendingRequests=6,sharedCache=new LruCache(10);function Transport(o){o=o||{};this.cancelled=false;this.lastReq=null;this._send=o.transport;this._get=o.limiter?o.limiter(this._get):this._get;this._cache=o.cache===false?new LruCache(0):sharedCache;}
Transport.setMaxPendingRequests=function setMaxPendingRequests(num){maxPendingRequests=num;};Transport.resetCache=function resetCache(){sharedCache.reset();};_.mixin(Transport.prototype,{_fingerprint:function fingerprint(o){o=o||{};return o.url+o.type+$.param(o.data||{});},_get:function(o,cb){var that=this,fingerprint,jqXhr;fingerprint=this._fingerprint(o);if(this.cancelled||fingerprint!==this.lastReq){return;}
if(jqXhr=pendingRequests[fingerprint]){jqXhr.done(done).fail(fail);}else if(pendingRequestsCount<maxPendingRequests){pendingRequestsCount++;pendingRequests[fingerprint]=this._send(o).done(done).fail(fail).always(always);}else{this.onDeckRequestArgs=[].slice.call(arguments,0);}
function done(resp){cb(null,resp);that._cache.set(fingerprint,resp);}
function fail(){cb(true);}
function always(){pendingRequestsCount--;delete pendingRequests[fingerprint];if(that.onDeckRequestArgs){that._get.apply(that,that.onDeckRequestArgs);that.onDeckRequestArgs=null;}}},get:function(o,cb){var resp,fingerprint;cb=cb||$.noop;o=_.isString(o)?{url:o}:o||{};fingerprint=this._fingerprint(o);this.cancelled=false;this.lastReq=fingerprint;if(resp=this._cache.get(fingerprint)){cb(null,resp);}else{this._get(o,cb);}},cancel:function(){this.cancelled=true;}});return Transport;}();var SearchIndex=window.SearchIndex=function(){"use strict";var CHILDREN="c",IDS="i";function SearchIndex(o){o=o||{};if(!o.datumTokenizer||!o.queryTokenizer){$.error("datumTokenizer and queryTokenizer are both required");}
this.identify=o.identify||_.stringify;this.datumTokenizer=o.datumTokenizer;this.queryTokenizer=o.queryTokenizer;this.reset();}
_.mixin(SearchIndex.prototype,{bootstrap:function bootstrap(o){this.datums=o.datums;this.trie=o.trie;},add:function(data){var that=this;data=_.isArray(data)?data:[data];_.each(data,function(datum){var id,tokens;that.datums[id=that.identify(datum)]=datum;tokens=normalizeTokens(that.datumTokenizer(datum));_.each(tokens,function(token){var node,chars,ch;node=that.trie;chars=token.split("");while(ch=chars.shift()){node=node[CHILDREN][ch]||(node[CHILDREN][ch]=newNode());node[IDS].push(id);}});});},get:function get(ids){var that=this;return _.map(ids,function(id){return that.datums[id];});},search:function search(query){var that=this,tokens,matches;tokens=normalizeTokens(this.queryTokenizer(query));_.each(tokens,function(token){var node,chars,ch,ids;if(matches&&matches.length===0){return false;}
node=that.trie;chars=token.split("");while(node&&(ch=chars.shift())){node=node[CHILDREN][ch];}
if(node&&chars.length===0){ids=node[IDS].slice(0);matches=matches?getIntersection(matches,ids):ids;}else{matches=[];return false;}});return matches?_.map(unique(matches),function(id){return that.datums[id];}):[];},all:function all(){var values=[];for(var key in this.datums){values.push(this.datums[key]);}
return values;},reset:function reset(){this.datums={};this.trie=newNode();},serialize:function serialize(){return{datums:this.datums,trie:this.trie};}});return SearchIndex;function normalizeTokens(tokens){tokens=_.filter(tokens,function(token){return!!token;});tokens=_.map(tokens,function(token){return token.toLowerCase();});return tokens;}
function newNode(){var node={};node[IDS]=[];node[CHILDREN]={};return node;}
function unique(array){var seen={},uniques=[];for(var i=0,len=array.length;i<len;i++){if(!seen[array[i]]){seen[array[i]]=true;uniques.push(array[i]);}}
return uniques;}
function getIntersection(arrayA,arrayB){var ai=0,bi=0,intersection=[];arrayA=arrayA.sort();arrayB=arrayB.sort();var lenArrayA=arrayA.length,lenArrayB=arrayB.length;while(ai<lenArrayA&&bi<lenArrayB){if(arrayA[ai]<arrayB[bi]){ai++;}else if(arrayA[ai]>arrayB[bi]){bi++;}else{intersection.push(arrayA[ai]);ai++;bi++;}}
return intersection;}}();var Prefetch=function(){"use strict";var keys;keys={data:"data",protocol:"protocol",thumbprint:"thumbprint"};function Prefetch(o){this.url=o.url;this.ttl=o.ttl;this.cache=o.cache;this.prepare=o.prepare;this.transform=o.transform;this.transport=o.transport;this.thumbprint=o.thumbprint;this.storage=new PersistentStorage(o.cacheKey);}
_.mixin(Prefetch.prototype,{_settings:function settings(){return{url:this.url,type:"GET",dataType:"json"};},store:function store(data){if(!this.cache){return;}
this.storage.set(keys.data,data,this.ttl);this.storage.set(keys.protocol,location.protocol,this.ttl);this.storage.set(keys.thumbprint,this.thumbprint,this.ttl);},fromCache:function fromCache(){var stored={},isExpired;if(!this.cache){return null;}
stored.data=this.storage.get(keys.data);stored.protocol=this.storage.get(keys.protocol);stored.thumbprint=this.storage.get(keys.thumbprint);isExpired=stored.thumbprint!==this.thumbprint||stored.protocol!==location.protocol;return stored.data&&!isExpired?stored.data:null;},fromNetwork:function(cb){var that=this,settings;if(!cb){return;}
settings=this.prepare(this._settings());this.transport(settings).fail(onError).done(onResponse);function onError(){cb(true);}
function onResponse(resp){cb(null,that.transform(resp));}},clear:function clear(){this.storage.clear();return this;}});return Prefetch;}();var Remote=function(){"use strict";function Remote(o){this.url=o.url;this.prepare=o.prepare;this.transform=o.transform;this.transport=new Transport({cache:o.cache,limiter:o.limiter,transport:o.transport});}
_.mixin(Remote.prototype,{_settings:function settings(){return{url:this.url,type:"GET",dataType:"json"};},get:function get(query,cb){var that=this,settings;if(!cb){return;}
query=query||"";settings=this.prepare(query,this._settings());return this.transport.get(settings,onResponse);function onResponse(err,resp){err?cb([]):cb(that.transform(resp));}},cancelLastRequest:function cancelLastRequest(){this.transport.cancel();}});return Remote;}();var oParser=function(){"use strict";return function parse(o){var defaults,sorter;defaults={initialize:true,identify:_.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null};o=_.mixin(defaults,o||{});!o.datumTokenizer&&$.error("datumTokenizer is required");!o.queryTokenizer&&$.error("queryTokenizer is required");sorter=o.sorter;o.sorter=sorter?function(x){return x.sort(sorter);}:_.identity;o.local=_.isFunction(o.local)?o.local():o.local;o.prefetch=parsePrefetch(o.prefetch);o.remote=parseRemote(o.remote);return o;};function parsePrefetch(o){var defaults;if(!o){return null;}
defaults={url:null,ttl:24*60*60*1e3,cache:true,cacheKey:null,thumbprint:"",prepare:_.identity,transform:_.identity,transport:null};o=_.isString(o)?{url:o}:o;o=_.mixin(defaults,o);!o.url&&$.error("prefetch requires url to be set");o.transform=o.filter||o.transform;o.cacheKey=o.cacheKey||o.url;o.thumbprint=VERSION+o.thumbprint;o.transport=o.transport?callbackToDeferred(o.transport):$.ajax;return o;}
function parseRemote(o){var defaults;if(!o){return;}
defaults={url:null,cache:true,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:_.identity,transport:null};o=_.isString(o)?{url:o}:o;o=_.mixin(defaults,o);!o.url&&$.error("remote requires url to be set");o.transform=o.filter||o.transform;o.prepare=toRemotePrepare(o);o.limiter=toLimiter(o);o.transport=o.transport?callbackToDeferred(o.transport):$.ajax;delete o.replace;delete o.wildcard;delete o.rateLimitBy;delete o.rateLimitWait;return o;}
function toRemotePrepare(o){var prepare,replace,wildcard;prepare=o.prepare;replace=o.replace;wildcard=o.wildcard;if(prepare){return prepare;}
if(replace){prepare=prepareByReplace;}else if(o.wildcard){prepare=prepareByWildcard;}else{prepare=idenityPrepare;}
return prepare;function prepareByReplace(query,settings){settings.url=replace(settings.url,query);return settings;}
function prepareByWildcard(query,settings){settings.url=settings.url.replace(wildcard,encodeURIComponent(query));return settings;}
function idenityPrepare(query,settings){return settings;}}
function toLimiter(o){var limiter,method,wait;limiter=o.limiter;method=o.rateLimitBy;wait=o.rateLimitWait;if(!limiter){limiter=/^throttle$/i.test(method)?throttle(wait):debounce(wait);}
return limiter;function debounce(wait){return function debounce(fn){return _.debounce(fn,wait);};}
function throttle(wait){return function throttle(fn){return _.throttle(fn,wait);};}}
function callbackToDeferred(fn){return function wrapper(o){var deferred=$.Deferred();fn(o,onSuccess,onError);return deferred;function onSuccess(resp){_.defer(function(){deferred.resolve(resp);});}
function onError(err){_.defer(function(){deferred.reject(err);});}};}}();var Bloodhound=function(){"use strict";var old;old=window&&window.Bloodhound;function Bloodhound(o){o=oParser(o);this.sorter=o.sorter;this.identify=o.identify;this.sufficient=o.sufficient;this.local=o.local;this.remote=o.remote?new Remote(o.remote):null;this.prefetch=o.prefetch?new Prefetch(o.prefetch):null;this.index=new SearchIndex({identify:this.identify,datumTokenizer:o.datumTokenizer,queryTokenizer:o.queryTokenizer});o.initialize!==false&&this.initialize();}
Bloodhound.noConflict=function noConflict(){window&&(window.Bloodhound=old);return Bloodhound;};Bloodhound.tokenizers=tokenizers;_.mixin(Bloodhound.prototype,{__ttAdapter:function ttAdapter(){var that=this;return this.remote?withAsync:withoutAsync;function withAsync(query,sync,async){return that.search(query,sync,async);}
function withoutAsync(query,sync){return that.search(query,sync);}},_loadPrefetch:function loadPrefetch(){var that=this,deferred,serialized;deferred=$.Deferred();if(!this.prefetch){deferred.resolve();}else if(serialized=this.prefetch.fromCache()){this.index.bootstrap(serialized);deferred.resolve();}else{this.prefetch.fromNetwork(done);}
return deferred.promise();function done(err,data){if(err){return deferred.reject();}
that.add(data);that.prefetch.store(that.index.serialize());deferred.resolve();}},_initialize:function initialize(){var that=this,deferred;this.clear();(this.initPromise=this._loadPrefetch()).done(addLocalToIndex);return this.initPromise;function addLocalToIndex(){that.add(that.local);}},initialize:function initialize(force){return!this.initPromise||force?this._initialize():this.initPromise;},add:function add(data){this.index.add(data);return this;},get:function get(ids){ids=_.isArray(ids)?ids:[].slice.call(arguments);return this.index.get(ids);},search:function search(query,sync,async){var that=this,local;local=this.sorter(this.index.search(query));sync(this.remote?local.slice():local);if(this.remote&&local.length<this.sufficient){this.remote.get(query,processRemote);}else if(this.remote){this.remote.cancelLastRequest();}
return this;function processRemote(remote){var nonDuplicates=[];_.each(remote,function(r){!_.some(local,function(l){return that.identify(r)===that.identify(l);})&&nonDuplicates.push(r);});async&&async(nonDuplicates);}},all:function all(){return this.index.all();},clear:function clear(){this.index.reset();return this;},clearPrefetchCache:function clearPrefetchCache(){this.prefetch&&this.prefetch.clear();return this;},clearRemoteCache:function clearRemoteCache(){Transport.resetCache();return this;},ttAdapter:function ttAdapter(){return this.__ttAdapter();}});return Bloodhound;}();return Bloodhound;});(function(root,factory){if(typeof define==="function"&&define.amd){define("typeahead.js",["jquery"],function(a0){return factory(a0);});}else if(typeof exports==="object"){module.exports=factory(require("jquery"));}else{factory(jQuery);}})(this,function($){var _=function(){"use strict";return{isMsie:function(){return /(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:false;},isBlankString:function(str){return!str||/^\s*$/.test(str);},escapeRegExChars:function(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");},isString:function(obj){return typeof obj==="string";},isNumber:function(obj){return typeof obj==="number";},isArray:$.isArray,isFunction:$.isFunction,isObject:$.isPlainObject,isUndefined:function(obj){return typeof obj==="undefined";},isElement:function(obj){return!!(obj&&obj.nodeType===1);},isJQuery:function(obj){return obj instanceof $;},toStr:function toStr(s){return _.isUndefined(s)||s===null?"":s+"";},bind:$.proxy,each:function(collection,cb){$.each(collection,reverseArgs);function reverseArgs(index,value){return cb(value,index);}},map:$.map,filter:$.grep,every:function(obj,test){var result=true;if(!obj){return result;}
$.each(obj,function(key,val){if(!(result=test.call(null,val,key,obj))){return false;}});return!!result;},some:function(obj,test){var result=false;if(!obj){return result;}
$.each(obj,function(key,val){if(result=test.call(null,val,key,obj)){return false;}});return!!result;},mixin:$.extend,identity:function(x){return x;},clone:function(obj){return $.extend(true,{},obj);},getIdGenerator:function(){var counter=0;return function(){return counter++;};},templatify:function templatify(obj){return $.isFunction(obj)?obj:template;function template(){return String(obj);}},defer:function(fn){setTimeout(fn,0);},debounce:function(func,wait,immediate){var timeout,result;return function(){var context=this,args=arguments,later,callNow;later=function(){timeout=null;if(!immediate){result=func.apply(context,args);}};callNow=immediate&&!timeout;clearTimeout(timeout);timeout=setTimeout(later,wait);if(callNow){result=func.apply(context,args);}
return result;};},throttle:function(func,wait){var context,args,timeout,result,previous,later;previous=0;later=function(){previous=new Date();timeout=null;result=func.apply(context,args);};return function(){var now=new Date(),remaining=wait-(now-previous);context=this;args=arguments;if(remaining<=0){clearTimeout(timeout);timeout=null;previous=now;result=func.apply(context,args);}else if(!timeout){timeout=setTimeout(later,remaining);}
return result;};},stringify:function(val){return _.isString(val)?val:JSON.stringify(val);},noop:function(){}};}();var WWW=function(){"use strict";var defaultClassNames={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return build;function build(o){var www,classes;classes=_.mixin({},defaultClassNames,o);www={css:buildCss(),classes:classes,html:buildHtml(classes),selectors:buildSelectors(classes)};return{css:www.css,html:www.html,classes:www.classes,selectors:www.selectors,mixin:function(o){_.mixin(o,www);}};}
function buildHtml(c){return{wrapper:'<span class="'+c.wrapper+'"></span>',menu:'<div class="'+c.menu+'"></div>'};}
function buildSelectors(classes){var selectors={};_.each(classes,function(v,k){selectors[k]="."+v;});return selectors;}
function buildCss(){var css={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};if(_.isMsie()){_.mixin(css.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"});}
return css;}}();var EventBus=function(){"use strict";var namespace,deprecationMap;namespace="typeahead:";deprecationMap={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"};function EventBus(o){if(!o||!o.el){$.error("EventBus initialized without el");}
this.$el=$(o.el);}
_.mixin(EventBus.prototype,{_trigger:function(type,args){var $e;$e=$.Event(namespace+type);(args=args||[]).unshift($e);this.$el.trigger.apply(this.$el,args);return $e;},before:function(type){var args,$e;args=[].slice.call(arguments,1);$e=this._trigger("before"+type,args);return $e.isDefaultPrevented();},trigger:function(type){var deprecatedType;this._trigger(type,[].slice.call(arguments,1));if(deprecatedType=deprecationMap[type]){this._trigger(deprecatedType,[].slice.call(arguments,1));}}});return EventBus;}();var EventEmitter=function(){"use strict";var splitter=/\s+/,nextTick=getNextTick();return{onSync:onSync,onAsync:onAsync,off:off,trigger:trigger};function on(method,types,cb,context){var type;if(!cb){return this;}
types=types.split(splitter);cb=context?bindContext(cb,context):cb;this._callbacks=this._callbacks||{};while(type=types.shift()){this._callbacks[type]=this._callbacks[type]||{sync:[],async:[]};this._callbacks[type][method].push(cb);}
return this;}
function onAsync(types,cb,context){return on.call(this,"async",types,cb,context);}
function onSync(types,cb,context){return on.call(this,"sync",types,cb,context);}
function off(types){var type;if(!this._callbacks){return this;}
types=types.split(splitter);while(type=types.shift()){delete this._callbacks[type];}
return this;}
function trigger(types){var type,callbacks,args,syncFlush,asyncFlush;if(!this._callbacks){return this;}
types=types.split(splitter);args=[].slice.call(arguments,1);while((type=types.shift())&&(callbacks=this._callbacks[type])){syncFlush=getFlush(callbacks.sync,this,[type].concat(args));asyncFlush=getFlush(callbacks.async,this,[type].concat(args));syncFlush()&&nextTick(asyncFlush);}
return this;}
function getFlush(callbacks,context,args){return flush;function flush(){var cancelled;for(var i=0,len=callbacks.length;!cancelled&&i<len;i+=1){cancelled=callbacks[i].apply(context,args)===false;}
return!cancelled;}}
function getNextTick(){var nextTickFn;if(window.setImmediate){nextTickFn=function nextTickSetImmediate(fn){setImmediate(function(){fn();});};}else{nextTickFn=function nextTickSetTimeout(fn){setTimeout(function(){fn();},0);};}
return nextTickFn;}
function bindContext(fn,context){return fn.bind?fn.bind(context):function(){fn.apply(context,[].slice.call(arguments,0));};}}();var highlight=function(doc){"use strict";var defaults={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:false,caseSensitive:false};return function hightlight(o){var regex;o=_.mixin({},defaults,o);if(!o.node||!o.pattern){return;}
o.pattern=_.isArray(o.pattern)?o.pattern:[o.pattern];regex=getRegex(o.pattern,o.caseSensitive,o.wordsOnly);traverse(o.node,hightlightTextNode);function hightlightTextNode(textNode){var match,patternNode,wrapperNode;if(match=regex.exec(textNode.data)){wrapperNode=doc.createElement(o.tagName);o.className&&(wrapperNode.className=o.className);patternNode=textNode.splitText(match.index);patternNode.splitText(match[0].length);wrapperNode.appendChild(patternNode.cloneNode(true));textNode.parentNode.replaceChild(wrapperNode,patternNode);}
return!!match;}
function traverse(el,hightlightTextNode){var childNode,TEXT_NODE_TYPE=3;for(var i=0;i<el.childNodes.length;i++){childNode=el.childNodes[i];if(childNode.nodeType===TEXT_NODE_TYPE){i+=hightlightTextNode(childNode)?1:0;}else{traverse(childNode,hightlightTextNode);}}}};function getRegex(patterns,caseSensitive,wordsOnly){var escapedPatterns=[],regexStr;for(var i=0,len=patterns.length;i<len;i++){escapedPatterns.push(_.escapeRegExChars(patterns[i]));}
regexStr=wordsOnly?"\\b("+escapedPatterns.join("|")+")\\b":"("+escapedPatterns.join("|")+")";return caseSensitive?new RegExp(regexStr):new RegExp(regexStr,"i");}}(window.document);var Input=function(){"use strict";var specialKeyCodeMap;specialKeyCodeMap={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"};function Input(o,www){o=o||{};if(!o.input){$.error("input is missing");}
www.mixin(this);this.$hint=$(o.hint);this.$input=$(o.input);this.query=this.$input.val();this.queryWhenFocused=this.hasFocus()?this.query:null;this.$overflowHelper=buildOverflowHelper(this.$input);this._checkLanguageDirection();if(this.$hint.length===0){this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=_.noop;}}
Input.normalizeQuery=function(str){return _.toStr(str).replace(/^\s*/g,"").replace(/\s{2,}/g," ");};_.mixin(Input.prototype,EventEmitter,{_onBlur:function onBlur(){this.resetInputValue();this.trigger("blurred");},_onFocus:function onFocus(){this.queryWhenFocused=this.query;this.trigger("focused");},_onKeydown:function onKeydown($e){var keyName=specialKeyCodeMap[$e.which||$e.keyCode];this._managePreventDefault(keyName,$e);if(keyName&&this._shouldTrigger(keyName,$e)){this.trigger(keyName+"Keyed",$e);}},_onInput:function onInput(){this._setQuery(this.getInputValue());this.clearHintIfInvalid();this._checkLanguageDirection();},_managePreventDefault:function managePreventDefault(keyName,$e){var preventDefault;switch(keyName){case"up":case"down":preventDefault=!withModifier($e);break;default:preventDefault=false;}
preventDefault&&$e.preventDefault();},_shouldTrigger:function shouldTrigger(keyName,$e){var trigger;switch(keyName){case"tab":trigger=!withModifier($e);break;default:trigger=true;}
return trigger;},_checkLanguageDirection:function checkLanguageDirection(){var dir=(this.$input.css("direction")||"ltr").toLowerCase();if(this.dir!==dir){this.dir=dir;this.$hint.attr("dir",dir);this.trigger("langDirChanged",dir);}},_setQuery:function setQuery(val,silent){var areEquivalent,hasDifferentWhitespace;areEquivalent=areQueriesEquivalent(val,this.query);hasDifferentWhitespace=areEquivalent?this.query.length!==val.length:false;this.query=val;if(!silent&&!areEquivalent){this.trigger("queryChanged",this.query);}else if(!silent&&hasDifferentWhitespace){this.trigger("whitespaceChanged",this.query);}},bind:function(){var that=this,onBlur,onFocus,onKeydown,onInput;onBlur=_.bind(this._onBlur,this);onFocus=_.bind(this._onFocus,this);onKeydown=_.bind(this._onKeydown,this);onInput=_.bind(this._onInput,this);this.$input.on("blur.tt",onBlur).on("focus.tt",onFocus).on("keydown.tt",onKeydown);if(!_.isMsie()||_.isMsie()>9){this.$input.on("input.tt",onInput);}else{this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function($e){if(specialKeyCodeMap[$e.which||$e.keyCode]){return;}
_.defer(_.bind(that._onInput,that,$e));});}
return this;},focus:function focus(){this.$input.focus();},blur:function blur(){this.$input.blur();},getLangDir:function getLangDir(){return this.dir;},getQuery:function getQuery(){return this.query||"";},setQuery:function setQuery(val,silent){this.setInputValue(val);this._setQuery(val,silent);},hasQueryChangedSinceLastFocus:function hasQueryChangedSinceLastFocus(){return this.query!==this.queryWhenFocused;},getInputValue:function getInputValue(){return this.$input.val();},setInputValue:function setInputValue(value){this.$input.val(value);this.clearHintIfInvalid();this._checkLanguageDirection();},resetInputValue:function resetInputValue(){this.setInputValue(this.query);},getHint:function getHint(){return this.$hint.val();},setHint:function setHint(value){this.$hint.val(value);},clearHint:function clearHint(){this.setHint("");},clearHintIfInvalid:function clearHintIfInvalid(){var val,hint,valIsPrefixOfHint,isValid;val=this.getInputValue();hint=this.getHint();valIsPrefixOfHint=val!==hint&&hint.indexOf(val)===0;isValid=val!==""&&valIsPrefixOfHint&&!this.hasOverflow();!isValid&&this.clearHint();},hasFocus:function hasFocus(){return this.$input.is(":focus");},hasOverflow:function hasOverflow(){var constraint=this.$input.width()-2;this.$overflowHelper.text(this.getInputValue());return this.$overflowHelper.width()>=constraint;},isCursorAtEnd:function(){var valueLength,selectionStart,range;valueLength=this.$input.val().length;selectionStart=this.$input[0].selectionStart;if(_.isNumber(selectionStart)){return selectionStart===valueLength;}else if(document.selection){range=document.selection.createRange();range.moveStart("character",-valueLength);return valueLength===range.text.length;}
return true;},destroy:function destroy(){this.$hint.off(".tt");this.$input.off(".tt");this.$overflowHelper.remove();this.$hint=this.$input=this.$overflowHelper=$("<div>");}});return Input;function buildOverflowHelper($input){return $('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:$input.css("font-family"),fontSize:$input.css("font-size"),fontStyle:$input.css("font-style"),fontVariant:$input.css("font-variant"),fontWeight:$input.css("font-weight"),wordSpacing:$input.css("word-spacing"),letterSpacing:$input.css("letter-spacing"),textIndent:$input.css("text-indent"),textRendering:$input.css("text-rendering"),textTransform:$input.css("text-transform")}).insertAfter($input);}
function areQueriesEquivalent(a,b){return Input.normalizeQuery(a)===Input.normalizeQuery(b);}
function withModifier($e){return $e.altKey||$e.ctrlKey||$e.metaKey||$e.shiftKey;}}();var Dataset=function(){"use strict";var keys,nameGenerator;keys={val:"tt-selectable-display",obj:"tt-selectable-object"};nameGenerator=_.getIdGenerator();function Dataset(o,www){o=o||{};o.templates=o.templates||{};o.templates.notFound=o.templates.notFound||o.templates.empty;if(!o.source){$.error("missing source");}
if(!o.node){$.error("missing node");}
if(o.name&&!isValidName(o.name)){$.error("invalid dataset name: "+o.name);}
www.mixin(this);this.highlight=!!o.highlight;this.name=o.name||nameGenerator();this.limit=o.limit||5;this.displayFn=getDisplayFn(o.display||o.displayKey);this.templates=getTemplates(o.templates,this.displayFn);this.source=o.source.__ttAdapter?o.source.__ttAdapter():o.source;this.async=_.isUndefined(o.async)?this.source.length>2:!!o.async;this._resetLastSuggestion();this.$el=$(o.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name);}
Dataset.extractData=function extractData(el){var $el=$(el);if($el.data(keys.obj)){return{val:$el.data(keys.val)||"",obj:$el.data(keys.obj)||null};}
return null;};_.mixin(Dataset.prototype,EventEmitter,{_overwrite:function overwrite(query,suggestions){suggestions=suggestions||[];if(suggestions.length){this._renderSuggestions(query,suggestions);}else if(this.async&&this.templates.pending){this._renderPending(query);}else if(!this.async&&this.templates.notFound){this._renderNotFound(query);}else{this._empty();}
this.trigger("rendered",this.name,suggestions,false);},_append:function append(query,suggestions){suggestions=suggestions||[];if(suggestions.length&&this.$lastSuggestion.length){this._appendSuggestions(query,suggestions);}else if(suggestions.length){this._renderSuggestions(query,suggestions);}else if(!this.$lastSuggestion.length&&this.templates.notFound){this._renderNotFound(query);}
this.trigger("rendered",this.name,suggestions,true);},_renderSuggestions:function renderSuggestions(query,suggestions){var $fragment;$fragment=this._getSuggestionsFragment(query,suggestions);this.$lastSuggestion=$fragment.children().last();this.$el.html($fragment).prepend(this._getHeader(query,suggestions)).append(this._getFooter(query,suggestions));},_appendSuggestions:function appendSuggestions(query,suggestions){var $fragment,$lastSuggestion;$fragment=this._getSuggestionsFragment(query,suggestions);$lastSuggestion=$fragment.children().last();this.$lastSuggestion.after($fragment);this.$lastSuggestion=$lastSuggestion;},_renderPending:function renderPending(query){var template=this.templates.pending;this._resetLastSuggestion();template&&this.$el.html(template({query:query,dataset:this.name}));},_renderNotFound:function renderNotFound(query){var template=this.templates.notFound;this._resetLastSuggestion();template&&this.$el.html(template({query:query,dataset:this.name}));},_empty:function empty(){this.$el.empty();this._resetLastSuggestion();},_getSuggestionsFragment:function getSuggestionsFragment(query,suggestions){var that=this,fragment;fragment=document.createDocumentFragment();_.each(suggestions,function getSuggestionNode(suggestion){var $el,context;context=that._injectQuery(query,suggestion);$el=$(that.templates.suggestion(context)).data(keys.obj,suggestion).data(keys.val,that.displayFn(suggestion)).addClass(that.classes.suggestion+" "+that.classes.selectable);fragment.appendChild($el[0]);});this.highlight&&highlight({className:this.classes.highlight,node:fragment,pattern:query});return $(fragment);},_getFooter:function getFooter(query,suggestions){return this.templates.footer?this.templates.footer({query:query,suggestions:suggestions,dataset:this.name}):null;},_getHeader:function getHeader(query,suggestions){return this.templates.header?this.templates.header({query:query,suggestions:suggestions,dataset:this.name}):null;},_resetLastSuggestion:function resetLastSuggestion(){this.$lastSuggestion=$();},_injectQuery:function injectQuery(query,obj){return _.isObject(obj)?_.mixin({_query:query},obj):obj;},update:function update(query){var that=this,canceled=false,syncCalled=false,rendered=0;this.cancel();this.cancel=function cancel(){canceled=true;that.cancel=$.noop;that.async&&that.trigger("asyncCanceled",query);};this.source(query,sync,async);!syncCalled&&sync([]);function sync(suggestions){if(syncCalled){return;}
syncCalled=true;suggestions=(suggestions||[]).slice(0,that.limit);rendered=suggestions.length;that._overwrite(query,suggestions);if(rendered<that.limit&&that.async){that.trigger("asyncRequested",query);}}
function async(suggestions){suggestions=suggestions||[];if(!canceled&&rendered<that.limit){that.cancel=$.noop;rendered+=suggestions.length;that._append(query,suggestions.slice(0,that.limit-rendered));that.async&&that.trigger("asyncReceived",query);}}},cancel:$.noop,clear:function clear(){this._empty();this.cancel();this.trigger("cleared");},isEmpty:function isEmpty(){return this.$el.is(":empty");},destroy:function destroy(){this.$el=$("<div>");}});return Dataset;function getDisplayFn(display){display=display||_.stringify;return _.isFunction(display)?display:displayFn;function displayFn(obj){return obj[display];}}
function getTemplates(templates,displayFn){return{notFound:templates.notFound&&_.templatify(templates.notFound),pending:templates.pending&&_.templatify(templates.pending),header:templates.header&&_.templatify(templates.header),footer:templates.footer&&_.templatify(templates.footer),suggestion:templates.suggestion||suggestionTemplate};function suggestionTemplate(context){return $("<div>").text(displayFn(context));}}
function isValidName(str){return /^[_a-zA-Z0-9-]+$/.test(str);}}();var Menu=function(){"use strict";function Menu(o,www){var that=this;o=o||{};if(!o.node){$.error("node is required");}
www.mixin(this);this.$node=$(o.node);this.query=null;this.datasets=_.map(o.datasets,initializeDataset);function initializeDataset(oDataset){var node=that.$node.find(oDataset.node).first();oDataset.node=node.length?node:$("<div>").appendTo(that.$node);return new Dataset(oDataset,www);}}
_.mixin(Menu.prototype,EventEmitter,{_onSelectableClick:function onSelectableClick($e){this.trigger("selectableClicked",$($e.currentTarget));},_onRendered:function onRendered(type,dataset,suggestions,async){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty());this.trigger("datasetRendered",dataset,suggestions,async);},_onCleared:function onCleared(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty());this.trigger("datasetCleared");},_propagate:function propagate(){this.trigger.apply(this,arguments);},_allDatasetsEmpty:function allDatasetsEmpty(){return _.every(this.datasets,isDatasetEmpty);function isDatasetEmpty(dataset){return dataset.isEmpty();}},_getSelectables:function getSelectables(){return this.$node.find(this.selectors.selectable);},_removeCursor:function _removeCursor(){var $selectable=this.getActiveSelectable();$selectable&&$selectable.removeClass(this.classes.cursor);},_ensureVisible:function ensureVisible($el){var elTop,elBottom,nodeScrollTop,nodeHeight;elTop=$el.position().top;elBottom=elTop+$el.outerHeight(true);nodeScrollTop=this.$node.scrollTop();nodeHeight=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10);if(elTop<0){this.$node.scrollTop(nodeScrollTop+elTop);}else if(nodeHeight<elBottom){this.$node.scrollTop(nodeScrollTop+(elBottom-nodeHeight));}},bind:function(){var that=this,onSelectableClick;onSelectableClick=_.bind(this._onSelectableClick,this);this.$node.on("click.tt",this.selectors.selectable,onSelectableClick);_.each(this.datasets,function(dataset){dataset.onSync("asyncRequested",that._propagate,that).onSync("asyncCanceled",that._propagate,that).onSync("asyncReceived",that._propagate,that).onSync("rendered",that._onRendered,that).onSync("cleared",that._onCleared,that);});return this;},isOpen:function isOpen(){return this.$node.hasClass(this.classes.open);},open:function open(){this.$node.addClass(this.classes.open);},close:function close(){this.$node.removeClass(this.classes.open);this._removeCursor();},setLanguageDirection:function setLanguageDirection(dir){this.$node.attr("dir",dir);},selectableRelativeToCursor:function selectableRelativeToCursor(delta){var $selectables,$oldCursor,oldIndex,newIndex;$oldCursor=this.getActiveSelectable();$selectables=this._getSelectables();oldIndex=$oldCursor?$selectables.index($oldCursor):-1;newIndex=oldIndex+delta;newIndex=(newIndex+1)%($selectables.length+1)-1;newIndex=newIndex<-1?$selectables.length-1:newIndex;return newIndex===-1?null:$selectables.eq(newIndex);},setCursor:function setCursor($selectable){this._removeCursor();if($selectable=$selectable&&$selectable.first()){$selectable.addClass(this.classes.cursor);this._ensureVisible($selectable);}},getSelectableData:function getSelectableData($el){return $el&&$el.length?Dataset.extractData($el):null;},getActiveSelectable:function getActiveSelectable(){var $selectable=this._getSelectables().filter(this.selectors.cursor).first();return $selectable.length?$selectable:null;},getTopSelectable:function getTopSelectable(){var $selectable=this._getSelectables().first();return $selectable.length?$selectable:null;},update:function update(query){var isValidUpdate=query!==this.query;if(isValidUpdate){this.query=query;_.each(this.datasets,updateDataset);}
return isValidUpdate;function updateDataset(dataset){dataset.update(query);}},empty:function empty(){_.each(this.datasets,clearDataset);this.query=null;this.$node.addClass(this.classes.empty);function clearDataset(dataset){dataset.clear();}},destroy:function destroy(){this.$node.off(".tt");this.$node=$("<div>");_.each(this.datasets,destroyDataset);function destroyDataset(dataset){dataset.destroy();}}});return Menu;}();var DefaultMenu=function(){"use strict";var s=Menu.prototype;function DefaultMenu(){Menu.apply(this,[].slice.call(arguments,0));}
_.mixin(DefaultMenu.prototype,Menu.prototype,{open:function open(){!this._allDatasetsEmpty()&&this._show();return s.open.apply(this,[].slice.call(arguments,0));},close:function close(){this._hide();return s.close.apply(this,[].slice.call(arguments,0));},_onRendered:function onRendered(){if(this._allDatasetsEmpty()){this._hide();}else{this.isOpen()&&this._show();}
return s._onRendered.apply(this,[].slice.call(arguments,0));},_onCleared:function onCleared(){if(this._allDatasetsEmpty()){this._hide();}else{this.isOpen()&&this._show();}
return s._onCleared.apply(this,[].slice.call(arguments,0));},setLanguageDirection:function setLanguageDirection(dir){this.$node.css(dir==="ltr"?this.css.ltr:this.css.rtl);return s.setLanguageDirection.apply(this,[].slice.call(arguments,0));},_hide:function hide(){this.$node.hide();},_show:function show(){this.$node.css("display","block");}});return DefaultMenu;}();var Typeahead=function(){"use strict";function Typeahead(o,www){var onFocused,onBlurred,onEnterKeyed,onTabKeyed,onEscKeyed,onUpKeyed,onDownKeyed,onLeftKeyed,onRightKeyed,onQueryChanged,onWhitespaceChanged;o=o||{};if(!o.input){$.error("missing input");}
if(!o.menu){$.error("missing menu");}
if(!o.eventBus){$.error("missing event bus");}
www.mixin(this);this.eventBus=o.eventBus;this.minLength=_.isNumber(o.minLength)?o.minLength:1;this.input=o.input;this.menu=o.menu;this.enabled=true;this.active=false;this.input.hasFocus()&&this.activate();this.dir=this.input.getLangDir();this._hacks();this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this);onFocused=c(this,"activate","open","_onFocused");onBlurred=c(this,"deactivate","_onBlurred");onEnterKeyed=c(this,"isActive","isOpen","_onEnterKeyed");onTabKeyed=c(this,"isActive","isOpen","_onTabKeyed");onEscKeyed=c(this,"isActive","_onEscKeyed");onUpKeyed=c(this,"isActive","open","_onUpKeyed");onDownKeyed=c(this,"isActive","open","_onDownKeyed");onLeftKeyed=c(this,"isActive","isOpen","_onLeftKeyed");onRightKeyed=c(this,"isActive","isOpen","_onRightKeyed");onQueryChanged=c(this,"_openIfActive","_onQueryChanged");onWhitespaceChanged=c(this,"_openIfActive","_onWhitespaceChanged");this.input.bind().onSync("focused",onFocused,this).onSync("blurred",onBlurred,this).onSync("enterKeyed",onEnterKeyed,this).onSync("tabKeyed",onTabKeyed,this).onSync("escKeyed",onEscKeyed,this).onSync("upKeyed",onUpKeyed,this).onSync("downKeyed",onDownKeyed,this).onSync("leftKeyed",onLeftKeyed,this).onSync("rightKeyed",onRightKeyed,this).onSync("queryChanged",onQueryChanged,this).onSync("whitespaceChanged",onWhitespaceChanged,this).onSync("langDirChanged",this._onLangDirChanged,this);}
_.mixin(Typeahead.prototype,{_hacks:function hacks(){var $input,$menu;$input=this.input.$input||$("<div>");$menu=this.menu.$node||$("<div>");$input.on("blur.tt",function($e){var active,isActive,hasActive;active=document.activeElement;isActive=$menu.is(active);hasActive=$menu.has(active).length>0;if(_.isMsie()&&(isActive||hasActive)){$e.preventDefault();$e.stopImmediatePropagation();_.defer(function(){$input.focus();});}});$menu.on("mousedown.tt",function($e){$e.preventDefault();});},_onSelectableClicked:function onSelectableClicked(type,$el){this.select($el);},_onDatasetCleared:function onDatasetCleared(){this._updateHint();},_onDatasetRendered:function onDatasetRendered(type,dataset,suggestions,async){this._updateHint();this.eventBus.trigger("render",suggestions,async,dataset);},_onAsyncRequested:function onAsyncRequested(type,dataset,query){this.eventBus.trigger("asyncrequest",query,dataset);},_onAsyncCanceled:function onAsyncCanceled(type,dataset,query){this.eventBus.trigger("asynccancel",query,dataset);},_onAsyncReceived:function onAsyncReceived(type,dataset,query){this.eventBus.trigger("asyncreceive",query,dataset);},_onFocused:function onFocused(){this._minLengthMet()&&this.menu.update(this.input.getQuery());},_onBlurred:function onBlurred(){if(this.input.hasQueryChangedSinceLastFocus()){this.eventBus.trigger("change",this.input.getQuery());}},_onEnterKeyed:function onEnterKeyed(type,$e){var $selectable;if($selectable=this.menu.getActiveSelectable()){this.select($selectable)&&$e.preventDefault();}},_onTabKeyed:function onTabKeyed(type,$e){var $selectable;if($selectable=this.menu.getActiveSelectable()){this.select($selectable)&&$e.preventDefault();}else if($selectable=this.menu.getTopSelectable()){this.autocomplete($selectable)&&$e.preventDefault();}},_onEscKeyed:function onEscKeyed(){this.close();},_onUpKeyed:function onUpKeyed(){this.moveCursor(-1);},_onDownKeyed:function onDownKeyed(){this.moveCursor(+1);},_onLeftKeyed:function onLeftKeyed(){if(this.dir==="rtl"&&this.input.isCursorAtEnd()){this.autocomplete(this.menu.getTopSelectable());}},_onRightKeyed:function onRightKeyed(){if(this.dir==="ltr"&&this.input.isCursorAtEnd()){this.autocomplete(this.menu.getTopSelectable());}},_onQueryChanged:function onQueryChanged(e,query){this._minLengthMet(query)?this.menu.update(query):this.menu.empty();},_onWhitespaceChanged:function onWhitespaceChanged(){this._updateHint();},_onLangDirChanged:function onLangDirChanged(e,dir){if(this.dir!==dir){this.dir=dir;this.menu.setLanguageDirection(dir);}},_openIfActive:function openIfActive(){this.isActive()&&this.open();},_minLengthMet:function minLengthMet(query){query=_.isString(query)?query:this.input.getQuery()||"";return query.length>=this.minLength;},_updateHint:function updateHint(){var $selectable,data,val,query,escapedQuery,frontMatchRegEx,match;$selectable=this.menu.getTopSelectable();data=this.menu.getSelectableData($selectable);val=this.input.getInputValue();if(data&&!_.isBlankString(val)&&!this.input.hasOverflow()){query=Input.normalizeQuery(val);escapedQuery=_.escapeRegExChars(query);frontMatchRegEx=new RegExp("^(?:"+escapedQuery+")(.+$)","i");match=frontMatchRegEx.exec(data.val);match&&this.input.setHint(val+match[1]);}else{this.input.clearHint();}},isEnabled:function isEnabled(){return this.enabled;},enable:function enable(){this.enabled=true;},disable:function disable(){this.enabled=false;},isActive:function isActive(){return this.active;},activate:function activate(){if(this.isActive()){return true;}else if(!this.isEnabled()||this.eventBus.before("active")){return false;}else{this.active=true;this.eventBus.trigger("active");return true;}},deactivate:function deactivate(){if(!this.isActive()){return true;}else if(this.eventBus.before("idle")){return false;}else{this.active=false;this.close();this.eventBus.trigger("idle");return true;}},isOpen:function isOpen(){return this.menu.isOpen();},open:function open(){if(!this.isOpen()&&!this.eventBus.before("open")){this.menu.open();this._updateHint();this.eventBus.trigger("open");}
return this.isOpen();},close:function close(){if(this.isOpen()&&!this.eventBus.before("close")){this.menu.close();this.input.clearHint();this.input.resetInputValue();this.eventBus.trigger("close");}
return!this.isOpen();},setVal:function setVal(val){this.input.setQuery(_.toStr(val));},getVal:function getVal(){return this.input.getQuery();},select:function select($selectable){var data=this.menu.getSelectableData($selectable);if(data&&!this.eventBus.before("select",data.obj)){this.input.setQuery(data.val,true);this.eventBus.trigger("select",data.obj);this.close();return true;}
return false;},autocomplete:function autocomplete($selectable){var query,data,isValid;query=this.input.getQuery();data=this.menu.getSelectableData($selectable);isValid=data&&query!==data.val;if(isValid&&!this.eventBus.before("autocomplete",data.obj)){this.input.setQuery(data.val);this.eventBus.trigger("autocomplete",data.obj);return true;}
return false;},moveCursor:function moveCursor(delta){var query,$candidate,data,payload,cancelMove;query=this.input.getQuery();$candidate=this.menu.selectableRelativeToCursor(delta);data=this.menu.getSelectableData($candidate);payload=data?data.obj:null;cancelMove=this._minLengthMet()&&this.menu.update(query);if(!cancelMove&&!this.eventBus.before("cursorchange",payload)){this.menu.setCursor($candidate);if(data){this.input.setInputValue(data.val);}else{this.input.resetInputValue();this._updateHint();}
this.eventBus.trigger("cursorchange",payload);return true;}
return false;},destroy:function destroy(){this.input.destroy();this.menu.destroy();}});return Typeahead;function c(ctx){var methods=[].slice.call(arguments,1);return function(){var args=[].slice.call(arguments);_.each(methods,function(method){return ctx[method].apply(ctx,args);});};}}();(function(){"use strict";var old,keys,methods;old=$.fn.typeahead;keys={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"};methods={initialize:function initialize(o,datasets){var www;datasets=_.isArray(datasets)?datasets:[].slice.call(arguments,1);o=o||{};www=WWW(o.classNames);return this.each(attach);function attach(){var $input,$wrapper,$hint,$menu,defaultHint,defaultMenu,eventBus,input,menu,typeahead,MenuConstructor;_.each(datasets,function(d){d.highlight=!!o.highlight;});$input=$(this);$wrapper=$(www.html.wrapper);$hint=$elOrNull(o.hint);$menu=$elOrNull(o.menu);defaultHint=o.hint!==false&&!$hint;defaultMenu=o.menu!==false&&!$menu;defaultHint&&($hint=buildHintFromInput($input,www));defaultMenu&&($menu=$(www.html.menu).css(www.css.menu));$hint&&$hint.val("");$input=prepInput($input,www);if(defaultHint||defaultMenu){$wrapper.css(www.css.wrapper);$input.css(defaultHint?www.css.input:www.css.inputWithNoHint);$input.wrap($wrapper).parent().prepend(defaultHint?$hint:null).append(defaultMenu?$menu:null);}
MenuConstructor=defaultMenu?DefaultMenu:Menu;eventBus=new EventBus({el:$input});input=new Input({hint:$hint,input:$input},www);menu=new MenuConstructor({node:$menu,datasets:datasets},www);typeahead=new Typeahead({input:input,menu:menu,eventBus:eventBus,minLength:o.minLength},www);$input.data(keys.www,www);$input.data(keys.typeahead,typeahead);}},isEnabled:function isEnabled(){var enabled;ttEach(this.first(),function(t){enabled=t.isEnabled();});return enabled;},enable:function enable(){ttEach(this,function(t){t.enable();});return this;},disable:function disable(){ttEach(this,function(t){t.disable();});return this;},isActive:function isActive(){var active;ttEach(this.first(),function(t){active=t.isActive();});return active;},activate:function activate(){ttEach(this,function(t){t.activate();});return this;},deactivate:function deactivate(){ttEach(this,function(t){t.deactivate();});return this;},isOpen:function isOpen(){var open;ttEach(this.first(),function(t){open=t.isOpen();});return open;},open:function open(){ttEach(this,function(t){t.open();});return this;},close:function close(){ttEach(this,function(t){t.close();});return this;},select:function select(el){var success=false,$el=$(el);ttEach(this.first(),function(t){success=t.select($el);});return success;},autocomplete:function autocomplete(el){var success=false,$el=$(el);ttEach(this.first(),function(t){success=t.autocomplete($el);});return success;},moveCursor:function moveCursoe(delta){var success=false;ttEach(this.first(),function(t){success=t.moveCursor(delta);});return success;},val:function val(newVal){var query;if(!arguments.length){ttEach(this.first(),function(t){query=t.getVal();});return query;}else{ttEach(this,function(t){t.setVal(newVal);});return this;}},destroy:function destroy(){ttEach(this,function(typeahead,$input){revert($input);typeahead.destroy();});return this;}};$.fn.typeahead=function(method){if(methods[method]){return methods[method].apply(this,[].slice.call(arguments,1));}else{return methods.initialize.apply(this,arguments);}};$.fn.typeahead.noConflict=function noConflict(){$.fn.typeahead=old;return this;};function ttEach($els,fn){$els.each(function(){var $input=$(this),typeahead;(typeahead=$input.data(keys.typeahead))&&fn(typeahead,$input);});}
function buildHintFromInput($input,www){return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop("readonly",true).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1});}
function prepInput($input,www){$input.data(keys.attrs,{dir:$input.attr("dir"),autocomplete:$input.attr("autocomplete"),spellcheck:$input.attr("spellcheck"),style:$input.attr("style")});$input.addClass(www.classes.input).attr({autocomplete:"off",spellcheck:false});try{!$input.attr("dir")&&$input.attr("dir","auto");}catch(e){}
return $input;}
function getBackgroundStyles($el){return{backgroundAttachment:$el.css("background-attachment"),backgroundClip:$el.css("background-clip"),backgroundColor:$el.css("background-color"),backgroundImage:$el.css("background-image"),backgroundOrigin:$el.css("background-origin"),backgroundPosition:$el.css("background-position"),backgroundRepeat:$el.css("background-repeat"),backgroundSize:$el.css("background-size")};}
function revert($input){var www,$wrapper;www=$input.data(keys.www);$wrapper=$input.parent().filter(www.selectors.wrapper);_.each($input.data(keys.attrs),function(val,key){_.isUndefined(val)?$input.removeAttr(key):$input.attr(key,val);});$input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input);if($wrapper.length){$input.detach().insertAfter($wrapper);$wrapper.remove();}}
function $elOrNull(obj){var isValid,$el;isValid=_.isJQuery(obj)||_.isElement(obj);$el=isValid?$(obj).first():[];return $el.length?$el:null;}})();});;(function(root,factory){if(typeof define==='function'&&define.amd){define(factory);}else if(typeof exports==='object'){module.exports=factory();}else{root.PhotoSwipe=factory();}})(this,function(){'use strict';var PhotoSwipe=function(template,UiClass,items,options){var framework={features:null,bind:function(target,type,listener,unbind){var methodName=(unbind?'remove':'add')+'EventListener';type=type.split(' ');for(var i=0;i<type.length;i++){if(type[i]){target[methodName](type[i],listener,false);}}},isArray:function(obj){return(obj instanceof Array);},createEl:function(classes,tag){var el=document.createElement(tag||'div');if(classes){el.className=classes;}
return el;},getScrollY:function(){var yOffset=window.pageYOffset;return yOffset!==undefined?yOffset:document.documentElement.scrollTop;},unbind:function(target,type,listener){framework.bind(target,type,listener,true);},removeClass:function(el,className){var reg=new RegExp('(\\s|^)'+className+'(\\s|$)');el.className=el.className.replace(reg,' ').replace(/^\s\s*/,'').replace(/\s\s*$/,'');},addClass:function(el,className){if(!framework.hasClass(el,className)){el.className+=(el.className?' ':'')+className;}},hasClass:function(el,className){return el.className&&new RegExp('(^|\\s)'+className+'(\\s|$)').test(el.className);},getChildByClass:function(parentEl,childClassName){var node=parentEl.firstChild;while(node){if(framework.hasClass(node,childClassName)){return node;}
node=node.nextSibling;}},arraySearch:function(array,value,key){var i=array.length;while(i--){if(array[i][key]===value){return i;}}
return-1;},extend:function(o1,o2,preventOverwrite){for(var prop in o2){if(o2.hasOwnProperty(prop)){if(preventOverwrite&&o1.hasOwnProperty(prop)){continue;}
o1[prop]=o2[prop];}}},easing:{sine:{out:function(k){return Math.sin(k*(Math.PI/2));},inOut:function(k){return-(Math.cos(Math.PI*k)-1)/2;}},cubic:{out:function(k){return--k*k*k+1;}}},detectFeatures:function(){if(framework.features){return framework.features;}
var helperEl=framework.createEl(),helperStyle=helperEl.style,vendor='',features={};features.oldIE=document.all&&!document.addEventListener;features.touch='ontouchstart'in window;if(window.requestAnimationFrame){features.raf=window.requestAnimationFrame;features.caf=window.cancelAnimationFrame;}
features.pointerEvent=navigator.pointerEnabled||navigator.msPointerEnabled;if(!features.pointerEvent){var ua=navigator.userAgent;if(/iP(hone|od)/.test(navigator.platform)){var v=(navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);if(v&&v.length>0){v=parseInt(v[1],10);if(v>=1&&v<8){features.isOldIOSPhone=true;}}}
var match=ua.match(/Android\s([0-9\.]*)/);var androidversion=match?match[1]:0;androidversion=parseFloat(androidversion);if(androidversion>=1){if(androidversion<4.4){features.isOldAndroid=true;}
features.androidVersion=androidversion;}
features.isMobileOpera=/opera mini|opera mobi/i.test(ua);}
var styleChecks=['transform','perspective','animationName'],vendors=['','webkit','Moz','ms','O'],styleCheckItem,styleName;for(var i=0;i<4;i++){vendor=vendors[i];for(var a=0;a<3;a++){styleCheckItem=styleChecks[a];styleName=vendor+(vendor?styleCheckItem.charAt(0).toUpperCase()+styleCheckItem.slice(1):styleCheckItem);if(!features[styleCheckItem]&&styleName in helperStyle){features[styleCheckItem]=styleName;}}
if(vendor&&!features.raf){vendor=vendor.toLowerCase();features.raf=window[vendor+'RequestAnimationFrame'];if(features.raf){features.caf=window[vendor+'CancelAnimationFrame']||window[vendor+'CancelRequestAnimationFrame'];}}}
if(!features.raf){var lastTime=0;features.raf=function(fn){var currTime=new Date().getTime();var timeToCall=Math.max(0,16-(currTime-lastTime));var id=window.setTimeout(function(){fn(currTime+timeToCall);},timeToCall);lastTime=currTime+timeToCall;return id;};features.caf=function(id){clearTimeout(id);};}
features.svg=!!document.createElementNS&&!!document.createElementNS('http://www.w3.org/2000/svg','svg').createSVGRect;framework.features=features;return features;}};framework.detectFeatures();if(framework.features.oldIE){framework.bind=function(target,type,listener,unbind){type=type.split(' ');var methodName=(unbind?'detach':'attach')+'Event',evName,_handleEv=function(){listener.handleEvent.call(listener);};for(var i=0;i<type.length;i++){evName=type[i];if(evName){if(typeof listener==='object'&&listener.handleEvent){if(!unbind){listener['oldIE'+evName]=_handleEv;}else{if(!listener['oldIE'+evName]){return false;}}
target[methodName]('on'+evName,listener['oldIE'+evName]);}else{target[methodName]('on'+evName,listener);}}}};}
var self=this;var DOUBLE_TAP_RADIUS=25,NUM_HOLDERS=3;var _options={allowPanToNext:true,spacing:0.12,bgOpacity:1,mouseUsed:false,loop:true,pinchToClose:true,closeOnScroll:true,closeOnVerticalDrag:true,verticalDragRange:0.75,hideAnimationDuration:333,showAnimationDuration:333,showHideOpacity:false,focus:true,escKey:true,arrowKeys:true,mainScrollEndFriction:0.35,panEndFriction:0.35,isClickableElement:function(el){return el.tagName==='A';},getDoubleTapZoom:function(isMouseClick,item){if(isMouseClick){return 1;}else{return item.initialZoomLevel<0.7?1:1.33;}},maxSpreadZoom:1.33,modal:true,scaleMode:'fit'};framework.extend(_options,options);var _getEmptyPoint=function(){return{x:0,y:0};};var _isOpen,_isDestroying,_closedByScroll,_currentItemIndex,_containerStyle,_containerShiftIndex,_currPanDist=_getEmptyPoint(),_startPanOffset=_getEmptyPoint(),_panOffset=_getEmptyPoint(),_upMoveEvents,_downEvents,_globalEventHandlers,_viewportSize={},_currZoomLevel,_startZoomLevel,_translatePrefix,_translateSufix,_updateSizeInterval,_itemsNeedUpdate,_currPositionIndex=0,_offset={},_slideSize=_getEmptyPoint(),_itemHolders,_prevItemIndex,_indexDiff=0,_dragStartEvent,_dragMoveEvent,_dragEndEvent,_dragCancelEvent,_transformKey,_pointerEventEnabled,_isFixedPosition=true,_likelyTouchDevice,_modules=[],_requestAF,_cancelAF,_initalClassName,_initalWindowScrollY,_oldIE,_currentWindowScrollY,_features,_windowVisibleSize={},_renderMaxResolution=false,_registerModule=function(name,module){framework.extend(self,module.publicMethods);_modules.push(name);},_getLoopedId=function(index){var numSlides=_getNumItems();if(index>numSlides-1){return index-numSlides;}else if(index<0){return numSlides+index;}
return index;},_listeners={},_listen=function(name,fn){if(!_listeners[name]){_listeners[name]=[];}
return _listeners[name].push(fn);},_shout=function(name){var listeners=_listeners[name];if(listeners){var args=Array.prototype.slice.call(arguments);args.shift();for(var i=0;i<listeners.length;i++){listeners[i].apply(self,args);}}},_getCurrentTime=function(){return new Date().getTime();},_applyBgOpacity=function(opacity){_bgOpacity=opacity;self.bg.style.opacity=opacity*_options.bgOpacity;},_applyZoomTransform=function(styleObj,x,y,zoom,item){if(!_renderMaxResolution||(item&&item!==self.currItem)){zoom=zoom/(item?item.fitRatio:self.currItem.fitRatio);}
styleObj[_transformKey]=_translatePrefix+x+'px, '+y+'px'+_translateSufix+' scale('+zoom+')';},_applyCurrentZoomPan=function(allowRenderResolution){if(_currZoomElementStyle){if(allowRenderResolution){if(_currZoomLevel>self.currItem.fitRatio){if(!_renderMaxResolution){_setImageSize(self.currItem,false,true);_renderMaxResolution=true;}}else{if(_renderMaxResolution){_setImageSize(self.currItem);_renderMaxResolution=false;}}}
_applyZoomTransform(_currZoomElementStyle,_panOffset.x,_panOffset.y,_currZoomLevel);}},_applyZoomPanToItem=function(item){if(item.container){_applyZoomTransform(item.container.style,item.initialPosition.x,item.initialPosition.y,item.initialZoomLevel,item);}},_setTranslateX=function(x,elStyle){elStyle[_transformKey]=_translatePrefix+x+'px, 0px'+_translateSufix;},_moveMainScroll=function(x,dragging){if(!_options.loop&&dragging){var newSlideIndexOffset=_currentItemIndex+(_slideSize.x*_currPositionIndex-x)/_slideSize.x,delta=Math.round(x-_mainScrollPos.x);if((newSlideIndexOffset<0&&delta>0)||(newSlideIndexOffset>=_getNumItems()-1&&delta<0)){x=_mainScrollPos.x+delta*_options.mainScrollEndFriction;}}
_mainScrollPos.x=x;_setTranslateX(x,_containerStyle);},_calculatePanOffset=function(axis,zoomLevel){var m=_midZoomPoint[axis]-_offset[axis];return _startPanOffset[axis]+_currPanDist[axis]+m-m*(zoomLevel/_startZoomLevel);},_equalizePoints=function(p1,p2){p1.x=p2.x;p1.y=p2.y;if(p2.id){p1.id=p2.id;}},_roundPoint=function(p){p.x=Math.round(p.x);p.y=Math.round(p.y);},_mouseMoveTimeout=null,_onFirstMouseMove=function(){if(_mouseMoveTimeout){framework.unbind(document,'mousemove',_onFirstMouseMove);framework.addClass(template,'pswp--has_mouse');_options.mouseUsed=true;_shout('mouseUsed');}
_mouseMoveTimeout=setTimeout(function(){_mouseMoveTimeout=null;},100);},_bindEvents=function(){framework.bind(document,'keydown',self);if(_features.transform){framework.bind(self.scrollWrap,'click',self);}
if(!_options.mouseUsed){framework.bind(document,'mousemove',_onFirstMouseMove);}
framework.bind(window,'resize scroll',self);_shout('bindEvents');},_unbindEvents=function(){framework.unbind(window,'resize',self);framework.unbind(window,'scroll',_globalEventHandlers.scroll);framework.unbind(document,'keydown',self);framework.unbind(document,'mousemove',_onFirstMouseMove);if(_features.transform){framework.unbind(self.scrollWrap,'click',self);}
if(_isDragging){framework.unbind(window,_upMoveEvents,self);}
_shout('unbindEvents');},_calculatePanBounds=function(zoomLevel,update){var bounds=_calculateItemSize(self.currItem,_viewportSize,zoomLevel);if(update){_currPanBounds=bounds;}
return bounds;},_getMinZoomLevel=function(item){if(!item){item=self.currItem;}
return item.initialZoomLevel;},_getMaxZoomLevel=function(item){if(!item){item=self.currItem;}
return item.w>0?_options.maxSpreadZoom:1;},_modifyDestPanOffset=function(axis,destPanBounds,destPanOffset,destZoomLevel){if(destZoomLevel===self.currItem.initialZoomLevel){destPanOffset[axis]=self.currItem.initialPosition[axis];return true;}else{destPanOffset[axis]=_calculatePanOffset(axis,destZoomLevel);if(destPanOffset[axis]>destPanBounds.min[axis]){destPanOffset[axis]=destPanBounds.min[axis];return true;}else if(destPanOffset[axis]<destPanBounds.max[axis]){destPanOffset[axis]=destPanBounds.max[axis];return true;}}
return false;},_setupTransforms=function(){if(_transformKey){var allow3dTransform=_features.perspective&&!_likelyTouchDevice;_translatePrefix='translate'+(allow3dTransform?'3d(':'(');_translateSufix=_features.perspective?', 0px)':')';return;}
_transformKey='left';framework.addClass(template,'pswp--ie');_setTranslateX=function(x,elStyle){elStyle.left=x+'px';};_applyZoomPanToItem=function(item){var zoomRatio=item.fitRatio>1?1:item.fitRatio,s=item.container.style,w=zoomRatio*item.w,h=zoomRatio*item.h;s.width=w+'px';s.height=h+'px';s.left=item.initialPosition.x+'px';s.top=item.initialPosition.y+'px';};_applyCurrentZoomPan=function(){if(_currZoomElementStyle){var s=_currZoomElementStyle,item=self.currItem,zoomRatio=item.fitRatio>1?1:item.fitRatio,w=zoomRatio*item.w,h=zoomRatio*item.h;s.width=w+'px';s.height=h+'px';s.left=_panOffset.x+'px';s.top=_panOffset.y+'px';}};},_onKeyDown=function(e){var keydownAction='';if(_options.escKey&&e.keyCode===27){keydownAction='close';}else if(_options.arrowKeys){if(e.keyCode===37){keydownAction='prev';}else if(e.keyCode===39){keydownAction='next';}}
if(keydownAction){if(!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.metaKey){if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}
self[keydownAction]();}}},_onGlobalClick=function(e){if(!e){return;}
if(_moved||_zoomStarted||_mainScrollAnimating||_verticalDragInitiated){e.preventDefault();e.stopPropagation();}},_updatePageScrollOffset=function(){self.setScrollOffset(0,framework.getScrollY());};var _animations={},_numAnimations=0,_stopAnimation=function(name){if(_animations[name]){if(_animations[name].raf){_cancelAF(_animations[name].raf);}
_numAnimations--;delete _animations[name];}},_registerStartAnimation=function(name){if(_animations[name]){_stopAnimation(name);}
if(!_animations[name]){_numAnimations++;_animations[name]={};}},_stopAllAnimations=function(){for(var prop in _animations){if(_animations.hasOwnProperty(prop)){_stopAnimation(prop);}}},_animateProp=function(name,b,endProp,d,easingFn,onUpdate,onComplete){var startAnimTime=_getCurrentTime(),t;_registerStartAnimation(name);var animloop=function(){if(_animations[name]){t=_getCurrentTime()-startAnimTime;if(t>=d){_stopAnimation(name);onUpdate(endProp);if(onComplete){onComplete();}
return;}
onUpdate((endProp-b)*easingFn(t/d)+b);_animations[name].raf=_requestAF(animloop);}};animloop();};var publicMethods={shout:_shout,listen:_listen,viewportSize:_viewportSize,options:_options,isMainScrollAnimating:function(){return _mainScrollAnimating;},getZoomLevel:function(){return _currZoomLevel;},getCurrentIndex:function(){return _currentItemIndex;},isDragging:function(){return _isDragging;},isZooming:function(){return _isZooming;},setScrollOffset:function(x,y){_offset.x=x;_currentWindowScrollY=_offset.y=y;_shout('updateScrollOffset',_offset);},applyZoomPan:function(zoomLevel,panX,panY,allowRenderResolution){_panOffset.x=panX;_panOffset.y=panY;_currZoomLevel=zoomLevel;_applyCurrentZoomPan(allowRenderResolution);},init:function(){if(_isOpen||_isDestroying){return;}
var i;self.framework=framework;self.template=template;self.bg=framework.getChildByClass(template,'pswp__bg');_initalClassName=template.className;_isOpen=true;_features=framework.detectFeatures();_requestAF=_features.raf;_cancelAF=_features.caf;_transformKey=_features.transform;_oldIE=_features.oldIE;self.scrollWrap=framework.getChildByClass(template,'pswp__scroll-wrap');self.container=framework.getChildByClass(self.scrollWrap,'pswp__container');_containerStyle=self.container.style;self.itemHolders=_itemHolders=[{el:self.container.children[0],wrap:0,index:-1},{el:self.container.children[1],wrap:0,index:-1},{el:self.container.children[2],wrap:0,index:-1}];_itemHolders[0].el.style.display=_itemHolders[2].el.style.display='none';_setupTransforms();_globalEventHandlers={resize:self.updateSize,scroll:_updatePageScrollOffset,keydown:_onKeyDown,click:_onGlobalClick};var oldPhone=_features.isOldIOSPhone||_features.isOldAndroid||_features.isMobileOpera;if(!_features.animationName||!_features.transform||oldPhone){_options.showAnimationDuration=_options.hideAnimationDuration=0;}
for(i=0;i<_modules.length;i++){self['init'+_modules[i]]();}
if(UiClass){var ui=self.ui=new UiClass(self,framework);ui.init();}
_shout('firstUpdate');_currentItemIndex=_currentItemIndex||_options.index||0;if(isNaN(_currentItemIndex)||_currentItemIndex<0||_currentItemIndex>=_getNumItems()){_currentItemIndex=0;}
self.currItem=_getItemAt(_currentItemIndex);if(_features.isOldIOSPhone||_features.isOldAndroid){_isFixedPosition=false;}
template.setAttribute('aria-hidden','false');if(_options.modal){if(!_isFixedPosition){template.style.position='absolute';template.style.top=framework.getScrollY()+'px';}else{template.style.position='fixed';}}
if(_currentWindowScrollY===undefined){_shout('initialLayout');_currentWindowScrollY=_initalWindowScrollY=framework.getScrollY();}
var rootClasses='pswp--open ';if(_options.mainClass){rootClasses+=_options.mainClass+' ';}
if(_options.showHideOpacity){rootClasses+='pswp--animate_opacity ';}
rootClasses+=_likelyTouchDevice?'pswp--touch':'pswp--notouch';rootClasses+=_features.animationName?' pswp--css_animation':'';rootClasses+=_features.svg?' pswp--svg':'';framework.addClass(template,rootClasses);self.updateSize();_containerShiftIndex=-1;_indexDiff=null;for(i=0;i<NUM_HOLDERS;i++){_setTranslateX((i+_containerShiftIndex)*_slideSize.x,_itemHolders[i].el.style);}
if(!_oldIE){framework.bind(self.scrollWrap,_downEvents,self);}
_listen('initialZoomInEnd',function(){self.setContent(_itemHolders[0],_currentItemIndex-1);self.setContent(_itemHolders[2],_currentItemIndex+1);_itemHolders[0].el.style.display=_itemHolders[2].el.style.display='block';if(_options.focus){template.focus();}
_bindEvents();});self.setContent(_itemHolders[1],_currentItemIndex);self.updateCurrItem();_shout('afterInit');if(!_isFixedPosition){_updateSizeInterval=setInterval(function(){if(!_numAnimations&&!_isDragging&&!_isZooming&&(_currZoomLevel===self.currItem.initialZoomLevel)){self.updateSize();}},1000);}
framework.addClass(template,'pswp--visible');},close:function(){if(!_isOpen){return;}
_isOpen=false;_isDestroying=true;_shout('close');_unbindEvents();_showOrHide(self.currItem,null,true,self.destroy);},destroy:function(){_shout('destroy');if(_showOrHideTimeout){clearTimeout(_showOrHideTimeout);}
template.setAttribute('aria-hidden','true');template.className=_initalClassName;if(_updateSizeInterval){clearInterval(_updateSizeInterval);}
framework.unbind(self.scrollWrap,_downEvents,self);framework.unbind(window,'scroll',self);_stopDragUpdateLoop();_stopAllAnimations();_listeners=null;},panTo:function(x,y,force){if(!force){if(x>_currPanBounds.min.x){x=_currPanBounds.min.x;}else if(x<_currPanBounds.max.x){x=_currPanBounds.max.x;}
if(y>_currPanBounds.min.y){y=_currPanBounds.min.y;}else if(y<_currPanBounds.max.y){y=_currPanBounds.max.y;}}
_panOffset.x=x;_panOffset.y=y;_applyCurrentZoomPan();},handleEvent:function(e){e=e||window.event;if(_globalEventHandlers[e.type]){_globalEventHandlers[e.type](e);}},goTo:function(index){index=_getLoopedId(index);var diff=index-_currentItemIndex;_indexDiff=diff;_currentItemIndex=index;self.currItem=_getItemAt(_currentItemIndex);_currPositionIndex-=diff;_moveMainScroll(_slideSize.x*_currPositionIndex);_stopAllAnimations();_mainScrollAnimating=false;self.updateCurrItem();},next:function(){self.goTo(_currentItemIndex+1);},prev:function(){self.goTo(_currentItemIndex-1);},updateCurrZoomItem:function(emulateSetContent){if(emulateSetContent){_shout('beforeChange',0);}
if(_itemHolders[1].el.children.length){var zoomElement=_itemHolders[1].el.children[0];if(framework.hasClass(zoomElement,'pswp__zoom-wrap')){_currZoomElementStyle=zoomElement.style;}else{_currZoomElementStyle=null;}}else{_currZoomElementStyle=null;}
_currPanBounds=self.currItem.bounds;_startZoomLevel=_currZoomLevel=self.currItem.initialZoomLevel;_panOffset.x=_currPanBounds.center.x;_panOffset.y=_currPanBounds.center.y;if(emulateSetContent){_shout('afterChange');}},invalidateCurrItems:function(){_itemsNeedUpdate=true;for(var i=0;i<NUM_HOLDERS;i++){if(_itemHolders[i].item){_itemHolders[i].item.needsUpdate=true;}}},updateCurrItem:function(beforeAnimation){if(_indexDiff===0){return;}
var diffAbs=Math.abs(_indexDiff),tempHolder;if(beforeAnimation&&diffAbs<2){return;}
self.currItem=_getItemAt(_currentItemIndex);_renderMaxResolution=false;_shout('beforeChange',_indexDiff);if(diffAbs>=NUM_HOLDERS){_containerShiftIndex+=_indexDiff+(_indexDiff>0?-NUM_HOLDERS:NUM_HOLDERS);diffAbs=NUM_HOLDERS;}
for(var i=0;i<diffAbs;i++){if(_indexDiff>0){tempHolder=_itemHolders.shift();_itemHolders[NUM_HOLDERS-1]=tempHolder;_containerShiftIndex++;_setTranslateX((_containerShiftIndex+2)*_slideSize.x,tempHolder.el.style);self.setContent(tempHolder,_currentItemIndex-diffAbs+i+1+1);}else{tempHolder=_itemHolders.pop();_itemHolders.unshift(tempHolder);_containerShiftIndex--;_setTranslateX(_containerShiftIndex*_slideSize.x,tempHolder.el.style);self.setContent(tempHolder,_currentItemIndex+diffAbs-i-1-1);}}
if(_currZoomElementStyle&&Math.abs(_indexDiff)===1){var prevItem=_getItemAt(_prevItemIndex);if(prevItem.initialZoomLevel!==_currZoomLevel){_calculateItemSize(prevItem,_viewportSize);_setImageSize(prevItem);_applyZoomPanToItem(prevItem);}}
_indexDiff=0;self.updateCurrZoomItem();_prevItemIndex=_currentItemIndex;_shout('afterChange');},updateSize:function(force){if(!_isFixedPosition&&_options.modal){var windowScrollY=framework.getScrollY();if(_currentWindowScrollY!==windowScrollY){template.style.top=windowScrollY+'px';_currentWindowScrollY=windowScrollY;}
if(!force&&_windowVisibleSize.x===window.innerWidth&&_windowVisibleSize.y===window.innerHeight){return;}
_windowVisibleSize.x=window.innerWidth;_windowVisibleSize.y=window.innerHeight;template.style.height=_windowVisibleSize.y+'px';}
_viewportSize.x=self.scrollWrap.clientWidth;_viewportSize.y=self.scrollWrap.clientHeight;_updatePageScrollOffset();_slideSize.x=_viewportSize.x+Math.round(_viewportSize.x*_options.spacing);_slideSize.y=_viewportSize.y;_moveMainScroll(_slideSize.x*_currPositionIndex);_shout('beforeResize');if(_containerShiftIndex!==undefined){var holder,item,hIndex;for(var i=0;i<NUM_HOLDERS;i++){holder=_itemHolders[i];_setTranslateX((i+_containerShiftIndex)*_slideSize.x,holder.el.style);hIndex=_currentItemIndex+i-1;if(_options.loop&&_getNumItems()>2){hIndex=_getLoopedId(hIndex);}
item=_getItemAt(hIndex);if(item&&(_itemsNeedUpdate||item.needsUpdate||!item.bounds)){self.cleanSlide(item);self.setContent(holder,hIndex);if(i===1){self.currItem=item;self.updateCurrZoomItem(true);}
item.needsUpdate=false;}else if(holder.index===-1&&hIndex>=0){self.setContent(holder,hIndex);}
if(item&&item.container){_calculateItemSize(item,_viewportSize);_setImageSize(item);_applyZoomPanToItem(item);}}
_itemsNeedUpdate=false;}
_startZoomLevel=_currZoomLevel=self.currItem.initialZoomLevel;_currPanBounds=self.currItem.bounds;if(_currPanBounds){_panOffset.x=_currPanBounds.center.x;_panOffset.y=_currPanBounds.center.y;_applyCurrentZoomPan(true);}
_shout('resize');},zoomTo:function(destZoomLevel,centerPoint,speed,easingFn,updateFn){if(centerPoint){_startZoomLevel=_currZoomLevel;_midZoomPoint.x=Math.abs(centerPoint.x)-_panOffset.x;_midZoomPoint.y=Math.abs(centerPoint.y)-_panOffset.y;_equalizePoints(_startPanOffset,_panOffset);}
var destPanBounds=_calculatePanBounds(destZoomLevel,false),destPanOffset={};_modifyDestPanOffset('x',destPanBounds,destPanOffset,destZoomLevel);_modifyDestPanOffset('y',destPanBounds,destPanOffset,destZoomLevel);var initialZoomLevel=_currZoomLevel;var initialPanOffset={x:_panOffset.x,y:_panOffset.y};_roundPoint(destPanOffset);var onUpdate=function(now){if(now===1){_currZoomLevel=destZoomLevel;_panOffset.x=destPanOffset.x;_panOffset.y=destPanOffset.y;}else{_currZoomLevel=(destZoomLevel-initialZoomLevel)*now+initialZoomLevel;_panOffset.x=(destPanOffset.x-initialPanOffset.x)*now+initialPanOffset.x;_panOffset.y=(destPanOffset.y-initialPanOffset.y)*now+initialPanOffset.y;}
if(updateFn){updateFn(now);}
_applyCurrentZoomPan(now===1);};if(speed){_animateProp('customZoomTo',0,1,speed,easingFn||framework.easing.sine.inOut,onUpdate);}else{onUpdate(1);}}};var MIN_SWIPE_DISTANCE=30,DIRECTION_CHECK_OFFSET=10;var _gestureStartTime,_gestureCheckSpeedTime,p={},p2={},delta={},_currPoint={},_startPoint={},_currPointers=[],_startMainScrollPos={},_releaseAnimData,_posPoints=[],_tempPoint={},_isZoomingIn,_verticalDragInitiated,_oldAndroidTouchEndTimeout,_currZoomedItemIndex=0,_centerPoint=_getEmptyPoint(),_lastReleaseTime=0,_isDragging,_isMultitouch,_zoomStarted,_moved,_dragAnimFrame,_mainScrollShifted,_currentPoints,_isZooming,_currPointsDistance,_startPointsDistance,_currPanBounds,_mainScrollPos=_getEmptyPoint(),_currZoomElementStyle,_mainScrollAnimating,_midZoomPoint=_getEmptyPoint(),_currCenterPoint=_getEmptyPoint(),_direction,_isFirstMove,_opacityChanged,_bgOpacity,_wasOverInitialZoom,_isEqualPoints=function(p1,p2){return p1.x===p2.x&&p1.y===p2.y;},_isNearbyPoints=function(touch0,touch1){return Math.abs(touch0.x-touch1.x)<DOUBLE_TAP_RADIUS&&Math.abs(touch0.y-touch1.y)<DOUBLE_TAP_RADIUS;},_calculatePointsDistance=function(p1,p2){_tempPoint.x=Math.abs(p1.x-p2.x);_tempPoint.y=Math.abs(p1.y-p2.y);return Math.sqrt(_tempPoint.x*_tempPoint.x+_tempPoint.y*_tempPoint.y);},_stopDragUpdateLoop=function(){if(_dragAnimFrame){_cancelAF(_dragAnimFrame);_dragAnimFrame=null;}},_dragUpdateLoop=function(){if(_isDragging){_dragAnimFrame=_requestAF(_dragUpdateLoop);_renderMovement();}},_canPan=function(){return!(_options.scaleMode==='fit'&&_currZoomLevel===self.currItem.initialZoomLevel);},_closestElement=function(el,fn){if(!el){return false;}
if(el.className&&el.className.indexOf('pswp__scroll-wrap')>-1){return false;}
if(fn(el)){return el;}
return _closestElement(el.parentNode,fn);},_preventObj={},_preventDefaultEventBehaviour=function(e,isDown){_preventObj.prevent=!_closestElement(e.target,_options.isClickableElement);_shout('preventDragEvent',e,isDown,_preventObj);return _preventObj.prevent;},_convertTouchToPoint=function(touch,p){p.x=touch.pageX;p.y=touch.pageY;p.id=touch.identifier;return p;},_findCenterOfPoints=function(p1,p2,pCenter){pCenter.x=(p1.x+p2.x)*0.5;pCenter.y=(p1.y+p2.y)*0.5;},_pushPosPoint=function(time,x,y){if(time-_gestureCheckSpeedTime>50){var o=_posPoints.length>2?_posPoints.shift():{};o.x=x;o.y=y;_posPoints.push(o);_gestureCheckSpeedTime=time;}},_calculateVerticalDragOpacityRatio=function(){var yOffset=_panOffset.y-self.currItem.initialPosition.y;return 1-Math.abs(yOffset/(_viewportSize.y/2));},_ePoint1={},_ePoint2={},_tempPointsArr=[],_tempCounter,_getTouchPoints=function(e){while(_tempPointsArr.length>0){_tempPointsArr.pop();}
if(!_pointerEventEnabled){if(e.type.indexOf('touch')>-1){if(e.touches&&e.touches.length>0){_tempPointsArr[0]=_convertTouchToPoint(e.touches[0],_ePoint1);if(e.touches.length>1){_tempPointsArr[1]=_convertTouchToPoint(e.touches[1],_ePoint2);}}}else{_ePoint1.x=e.pageX;_ePoint1.y=e.pageY;_ePoint1.id='';_tempPointsArr[0]=_ePoint1;}}else{_tempCounter=0;_currPointers.forEach(function(p){if(_tempCounter===0){_tempPointsArr[0]=p;}else if(_tempCounter===1){_tempPointsArr[1]=p;}
_tempCounter++;});}
return _tempPointsArr;},_panOrMoveMainScroll=function(axis,delta){var panFriction,overDiff=0,newOffset=_panOffset[axis]+delta[axis],startOverDiff,dir=delta[axis]>0,newMainScrollPosition=_mainScrollPos.x+delta.x,mainScrollDiff=_mainScrollPos.x-_startMainScrollPos.x,newPanPos,newMainScrollPos;if(newOffset>_currPanBounds.min[axis]||newOffset<_currPanBounds.max[axis]){panFriction=_options.panEndFriction;}else{panFriction=1;}
newOffset=_panOffset[axis]+delta[axis]*panFriction;if(_options.allowPanToNext||_currZoomLevel===self.currItem.initialZoomLevel){if(!_currZoomElementStyle){newMainScrollPos=newMainScrollPosition;}else if(_direction==='h'&&axis==='x'&&!_zoomStarted){if(dir){if(newOffset>_currPanBounds.min[axis]){panFriction=_options.panEndFriction;overDiff=_currPanBounds.min[axis]-newOffset;startOverDiff=_currPanBounds.min[axis]-_startPanOffset[axis];}
if((startOverDiff<=0||mainScrollDiff<0)&&_getNumItems()>1){newMainScrollPos=newMainScrollPosition;if(mainScrollDiff<0&&newMainScrollPosition>_startMainScrollPos.x){newMainScrollPos=_startMainScrollPos.x;}}else{if(_currPanBounds.min.x!==_currPanBounds.max.x){newPanPos=newOffset;}}}else{if(newOffset<_currPanBounds.max[axis]){panFriction=_options.panEndFriction;overDiff=newOffset-_currPanBounds.max[axis];startOverDiff=_startPanOffset[axis]-_currPanBounds.max[axis];}
if((startOverDiff<=0||mainScrollDiff>0)&&_getNumItems()>1){newMainScrollPos=newMainScrollPosition;if(mainScrollDiff>0&&newMainScrollPosition<_startMainScrollPos.x){newMainScrollPos=_startMainScrollPos.x;}}else{if(_currPanBounds.min.x!==_currPanBounds.max.x){newPanPos=newOffset;}}}}
if(axis==='x'){if(newMainScrollPos!==undefined){_moveMainScroll(newMainScrollPos,true);if(newMainScrollPos===_startMainScrollPos.x){_mainScrollShifted=false;}else{_mainScrollShifted=true;}}
if(_currPanBounds.min.x!==_currPanBounds.max.x){if(newPanPos!==undefined){_panOffset.x=newPanPos;}else if(!_mainScrollShifted){_panOffset.x+=delta.x*panFriction;}}
return newMainScrollPos!==undefined;}}
if(!_mainScrollAnimating){if(!_mainScrollShifted){if(_currZoomLevel>self.currItem.fitRatio){_panOffset[axis]+=delta[axis]*panFriction;}}}},_onDragStart=function(e){if(e.type==='mousedown'&&e.button>0){return;}
if(_initialZoomRunning){e.preventDefault();return;}
if(_oldAndroidTouchEndTimeout&&e.type==='mousedown'){return;}
if(_preventDefaultEventBehaviour(e,true)){e.preventDefault();}
_shout('pointerDown');if(_pointerEventEnabled){var pointerIndex=framework.arraySearch(_currPointers,e.pointerId,'id');if(pointerIndex<0){pointerIndex=_currPointers.length;}
_currPointers[pointerIndex]={x:e.pageX,y:e.pageY,id:e.pointerId};}
var startPointsList=_getTouchPoints(e),numPoints=startPointsList.length;_currentPoints=null;_stopAllAnimations();if(!_isDragging||numPoints===1){_isDragging=_isFirstMove=true;framework.bind(window,_upMoveEvents,self);_isZoomingIn=_wasOverInitialZoom=_opacityChanged=_verticalDragInitiated=_mainScrollShifted=_moved=_isMultitouch=_zoomStarted=false;_direction=null;_shout('firstTouchStart',startPointsList);_equalizePoints(_startPanOffset,_panOffset);_currPanDist.x=_currPanDist.y=0;_equalizePoints(_currPoint,startPointsList[0]);_equalizePoints(_startPoint,_currPoint);_startMainScrollPos.x=_slideSize.x*_currPositionIndex;_posPoints=[{x:_currPoint.x,y:_currPoint.y}];_gestureCheckSpeedTime=_gestureStartTime=_getCurrentTime();_calculatePanBounds(_currZoomLevel,true);_stopDragUpdateLoop();_dragUpdateLoop();}
if(!_isZooming&&numPoints>1&&!_mainScrollAnimating&&!_mainScrollShifted){_startZoomLevel=_currZoomLevel;_zoomStarted=false;_isZooming=_isMultitouch=true;_currPanDist.y=_currPanDist.x=0;_equalizePoints(_startPanOffset,_panOffset);_equalizePoints(p,startPointsList[0]);_equalizePoints(p2,startPointsList[1]);_findCenterOfPoints(p,p2,_currCenterPoint);_midZoomPoint.x=Math.abs(_currCenterPoint.x)-_panOffset.x;_midZoomPoint.y=Math.abs(_currCenterPoint.y)-_panOffset.y;_currPointsDistance=_startPointsDistance=_calculatePointsDistance(p,p2);}},_onDragMove=function(e){e.preventDefault();if(_pointerEventEnabled){var pointerIndex=framework.arraySearch(_currPointers,e.pointerId,'id');if(pointerIndex>-1){var p=_currPointers[pointerIndex];p.x=e.pageX;p.y=e.pageY;}}
if(_isDragging){var touchesList=_getTouchPoints(e);if(!_direction&&!_moved&&!_isZooming){if(_mainScrollPos.x!==_slideSize.x*_currPositionIndex){_direction='h';}else{var diff=Math.abs(touchesList[0].x-_currPoint.x)-Math.abs(touchesList[0].y-_currPoint.y);if(Math.abs(diff)>=DIRECTION_CHECK_OFFSET){_direction=diff>0?'h':'v';_currentPoints=touchesList;}}}else{_currentPoints=touchesList;}}},_renderMovement=function(){if(!_currentPoints){return;}
var numPoints=_currentPoints.length;if(numPoints===0){return;}
_equalizePoints(p,_currentPoints[0]);delta.x=p.x-_currPoint.x;delta.y=p.y-_currPoint.y;if(_isZooming&&numPoints>1){_currPoint.x=p.x;_currPoint.y=p.y;if(!delta.x&&!delta.y&&_isEqualPoints(_currentPoints[1],p2)){return;}
_equalizePoints(p2,_currentPoints[1]);if(!_zoomStarted){_zoomStarted=true;_shout('zoomGestureStarted');}
var pointsDistance=_calculatePointsDistance(p,p2);var zoomLevel=_calculateZoomLevel(pointsDistance);if(zoomLevel>self.currItem.initialZoomLevel+self.currItem.initialZoomLevel/15){_wasOverInitialZoom=true;}
var zoomFriction=1,minZoomLevel=_getMinZoomLevel(),maxZoomLevel=_getMaxZoomLevel();if(zoomLevel<minZoomLevel){if(_options.pinchToClose&&!_wasOverInitialZoom&&_startZoomLevel<=self.currItem.initialZoomLevel){var minusDiff=minZoomLevel-zoomLevel;var percent=1-minusDiff/(minZoomLevel/1.2);_applyBgOpacity(percent);_shout('onPinchClose',percent);_opacityChanged=true;}else{zoomFriction=(minZoomLevel-zoomLevel)/minZoomLevel;if(zoomFriction>1){zoomFriction=1;}
zoomLevel=minZoomLevel-zoomFriction*(minZoomLevel/3);}}else if(zoomLevel>maxZoomLevel){zoomFriction=(zoomLevel-maxZoomLevel)/(minZoomLevel*6);if(zoomFriction>1){zoomFriction=1;}
zoomLevel=maxZoomLevel+zoomFriction*minZoomLevel;}
if(zoomFriction<0){zoomFriction=0;}
_currPointsDistance=pointsDistance;_findCenterOfPoints(p,p2,_centerPoint);_currPanDist.x+=_centerPoint.x-_currCenterPoint.x;_currPanDist.y+=_centerPoint.y-_currCenterPoint.y;_equalizePoints(_currCenterPoint,_centerPoint);_panOffset.x=_calculatePanOffset('x',zoomLevel);_panOffset.y=_calculatePanOffset('y',zoomLevel);_isZoomingIn=zoomLevel>_currZoomLevel;_currZoomLevel=zoomLevel;_applyCurrentZoomPan();}else{if(!_direction){return;}
if(_isFirstMove){_isFirstMove=false;if(Math.abs(delta.x)>=DIRECTION_CHECK_OFFSET){delta.x-=_currentPoints[0].x-_startPoint.x;}
if(Math.abs(delta.y)>=DIRECTION_CHECK_OFFSET){delta.y-=_currentPoints[0].y-_startPoint.y;}}
_currPoint.x=p.x;_currPoint.y=p.y;if(delta.x===0&&delta.y===0){return;}
if(_direction==='v'&&_options.closeOnVerticalDrag){if(!_canPan()){_currPanDist.y+=delta.y;_panOffset.y+=delta.y;var opacityRatio=_calculateVerticalDragOpacityRatio();_verticalDragInitiated=true;_shout('onVerticalDrag',opacityRatio);_applyBgOpacity(opacityRatio);_applyCurrentZoomPan();return;}}
_pushPosPoint(_getCurrentTime(),p.x,p.y);_moved=true;_currPanBounds=self.currItem.bounds;var mainScrollChanged=_panOrMoveMainScroll('x',delta);if(!mainScrollChanged){_panOrMoveMainScroll('y',delta);_roundPoint(_panOffset);_applyCurrentZoomPan();}}},_onDragRelease=function(e){if(_features.isOldAndroid){if(_oldAndroidTouchEndTimeout&&e.type==='mouseup'){return;}
if(e.type.indexOf('touch')>-1){clearTimeout(_oldAndroidTouchEndTimeout);_oldAndroidTouchEndTimeout=setTimeout(function(){_oldAndroidTouchEndTimeout=0;},600);}}
_shout('pointerUp');if(_preventDefaultEventBehaviour(e,false)){e.preventDefault();}
var releasePoint;if(_pointerEventEnabled){var pointerIndex=framework.arraySearch(_currPointers,e.pointerId,'id');if(pointerIndex>-1){releasePoint=_currPointers.splice(pointerIndex,1)[0];if(navigator.pointerEnabled){releasePoint.type=e.pointerType||'mouse';}else{var MSPOINTER_TYPES={4:'mouse',2:'touch',3:'pen'};releasePoint.type=MSPOINTER_TYPES[e.pointerType];if(!releasePoint.type){releasePoint.type=e.pointerType||'mouse';}}}}
var touchList=_getTouchPoints(e),gestureType,numPoints=touchList.length;if(e.type==='mouseup'){numPoints=0;}
if(numPoints===2){_currentPoints=null;return true;}
if(numPoints===1){_equalizePoints(_startPoint,touchList[0]);}
if(numPoints===0&&!_direction&&!_mainScrollAnimating){if(!releasePoint){if(e.type==='mouseup'){releasePoint={x:e.pageX,y:e.pageY,type:'mouse'};}else if(e.changedTouches&&e.changedTouches[0]){releasePoint={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY,type:'touch'};}}
_shout('touchRelease',e,releasePoint);}
var releaseTimeDiff=-1;if(numPoints===0){_isDragging=false;framework.unbind(window,_upMoveEvents,self);_stopDragUpdateLoop();if(_isZooming){releaseTimeDiff=0;}else if(_lastReleaseTime!==-1){releaseTimeDiff=_getCurrentTime()-_lastReleaseTime;}}
_lastReleaseTime=numPoints===1?_getCurrentTime():-1;if(releaseTimeDiff!==-1&&releaseTimeDiff<150){gestureType='zoom';}else{gestureType='swipe';}
if(_isZooming&&numPoints<2){_isZooming=false;if(numPoints===1){gestureType='zoomPointerUp';}
_shout('zoomGestureEnded');}
_currentPoints=null;if(!_moved&&!_zoomStarted&&!_mainScrollAnimating&&!_verticalDragInitiated){return;}
_stopAllAnimations();if(!_releaseAnimData){_releaseAnimData=_initDragReleaseAnimationData();}
_releaseAnimData.calculateSwipeSpeed('x');if(_verticalDragInitiated){var opacityRatio=_calculateVerticalDragOpacityRatio();if(opacityRatio<_options.verticalDragRange){self.close();}else{var initalPanY=_panOffset.y,initialBgOpacity=_bgOpacity;_animateProp('verticalDrag',0,1,300,framework.easing.cubic.out,function(now){_panOffset.y=(self.currItem.initialPosition.y-initalPanY)*now+initalPanY;_applyBgOpacity((1-initialBgOpacity)*now+initialBgOpacity);_applyCurrentZoomPan();});_shout('onVerticalDrag',1);}
return;}
if((_mainScrollShifted||_mainScrollAnimating)&&numPoints===0){var itemChanged=_finishSwipeMainScrollGesture(gestureType,_releaseAnimData);if(itemChanged){return;}
gestureType='zoomPointerUp';}
if(_mainScrollAnimating){return;}
if(gestureType!=='swipe'){_completeZoomGesture();return;}
if(!_mainScrollShifted&&_currZoomLevel>self.currItem.fitRatio){_completePanGesture(_releaseAnimData);}},_initDragReleaseAnimationData=function(){var lastFlickDuration,tempReleasePos;var s={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(axis){if(_posPoints.length>1){lastFlickDuration=_getCurrentTime()-_gestureCheckSpeedTime+50;tempReleasePos=_posPoints[_posPoints.length-2][axis];}else{lastFlickDuration=_getCurrentTime()-_gestureStartTime;tempReleasePos=_startPoint[axis];}
s.lastFlickOffset[axis]=_currPoint[axis]-tempReleasePos;s.lastFlickDist[axis]=Math.abs(s.lastFlickOffset[axis]);if(s.lastFlickDist[axis]>20){s.lastFlickSpeed[axis]=s.lastFlickOffset[axis]/lastFlickDuration;}else{s.lastFlickSpeed[axis]=0;}
if(Math.abs(s.lastFlickSpeed[axis])<0.1){s.lastFlickSpeed[axis]=0;}
s.slowDownRatio[axis]=0.95;s.slowDownRatioReverse[axis]=1-s.slowDownRatio[axis];s.speedDecelerationRatio[axis]=1;},calculateOverBoundsAnimOffset:function(axis,speed){if(!s.backAnimStarted[axis]){if(_panOffset[axis]>_currPanBounds.min[axis]){s.backAnimDestination[axis]=_currPanBounds.min[axis];}else if(_panOffset[axis]<_currPanBounds.max[axis]){s.backAnimDestination[axis]=_currPanBounds.max[axis];}
if(s.backAnimDestination[axis]!==undefined){s.slowDownRatio[axis]=0.7;s.slowDownRatioReverse[axis]=1-s.slowDownRatio[axis];if(s.speedDecelerationRatioAbs[axis]<0.05){s.lastFlickSpeed[axis]=0;s.backAnimStarted[axis]=true;_animateProp('bounceZoomPan'+axis,_panOffset[axis],s.backAnimDestination[axis],speed||300,framework.easing.sine.out,function(pos){_panOffset[axis]=pos;_applyCurrentZoomPan();});}}}},calculateAnimOffset:function(axis){if(!s.backAnimStarted[axis]){s.speedDecelerationRatio[axis]=s.speedDecelerationRatio[axis]*(s.slowDownRatio[axis]+
s.slowDownRatioReverse[axis]-
s.slowDownRatioReverse[axis]*s.timeDiff/10);s.speedDecelerationRatioAbs[axis]=Math.abs(s.lastFlickSpeed[axis]*s.speedDecelerationRatio[axis]);s.distanceOffset[axis]=s.lastFlickSpeed[axis]*s.speedDecelerationRatio[axis]*s.timeDiff;_panOffset[axis]+=s.distanceOffset[axis];}},panAnimLoop:function(){if(_animations.zoomPan){_animations.zoomPan.raf=_requestAF(s.panAnimLoop);s.now=_getCurrentTime();s.timeDiff=s.now-s.lastNow;s.lastNow=s.now;s.calculateAnimOffset('x');s.calculateAnimOffset('y');_applyCurrentZoomPan();s.calculateOverBoundsAnimOffset('x');s.calculateOverBoundsAnimOffset('y');if(s.speedDecelerationRatioAbs.x<0.05&&s.speedDecelerationRatioAbs.y<0.05){_panOffset.x=Math.round(_panOffset.x);_panOffset.y=Math.round(_panOffset.y);_applyCurrentZoomPan();_stopAnimation('zoomPan');return;}}}};return s;},_completePanGesture=function(animData){animData.calculateSwipeSpeed('y');_currPanBounds=self.currItem.bounds;animData.backAnimDestination={};animData.backAnimStarted={};if(Math.abs(animData.lastFlickSpeed.x)<=0.05&&Math.abs(animData.lastFlickSpeed.y)<=0.05){animData.speedDecelerationRatioAbs.x=animData.speedDecelerationRatioAbs.y=0;animData.calculateOverBoundsAnimOffset('x');animData.calculateOverBoundsAnimOffset('y');return true;}
_registerStartAnimation('zoomPan');animData.lastNow=_getCurrentTime();animData.panAnimLoop();},_finishSwipeMainScrollGesture=function(gestureType,_releaseAnimData){var itemChanged;if(!_mainScrollAnimating){_currZoomedItemIndex=_currentItemIndex;}
var itemsDiff;if(gestureType==='swipe'){var totalShiftDist=_currPoint.x-_startPoint.x,isFastLastFlick=_releaseAnimData.lastFlickDist.x<10;if(totalShiftDist>MIN_SWIPE_DISTANCE&&(isFastLastFlick||_releaseAnimData.lastFlickOffset.x>20)){itemsDiff=-1;}else if(totalShiftDist<-MIN_SWIPE_DISTANCE&&(isFastLastFlick||_releaseAnimData.lastFlickOffset.x<-20)){itemsDiff=1;}}
var nextCircle;if(itemsDiff){_currentItemIndex+=itemsDiff;if(_currentItemIndex<0){_currentItemIndex=_options.loop?_getNumItems()-1:0;nextCircle=true;}else if(_currentItemIndex>=_getNumItems()){_currentItemIndex=_options.loop?0:_getNumItems()-1;nextCircle=true;}
if(!nextCircle||_options.loop){_indexDiff+=itemsDiff;_currPositionIndex-=itemsDiff;itemChanged=true;}}
var animateToX=_slideSize.x*_currPositionIndex;var animateToDist=Math.abs(animateToX-_mainScrollPos.x);var finishAnimDuration;if(!itemChanged&&animateToX>_mainScrollPos.x!==_releaseAnimData.lastFlickSpeed.x>0){finishAnimDuration=333;}else{finishAnimDuration=Math.abs(_releaseAnimData.lastFlickSpeed.x)>0?animateToDist/Math.abs(_releaseAnimData.lastFlickSpeed.x):333;finishAnimDuration=Math.min(finishAnimDuration,400);finishAnimDuration=Math.max(finishAnimDuration,250);}
if(_currZoomedItemIndex===_currentItemIndex){itemChanged=false;}
_mainScrollAnimating=true;_shout('mainScrollAnimStart');_animateProp('mainScroll',_mainScrollPos.x,animateToX,finishAnimDuration,framework.easing.cubic.out,_moveMainScroll,function(){_stopAllAnimations();_mainScrollAnimating=false;_currZoomedItemIndex=-1;if(itemChanged||_currZoomedItemIndex!==_currentItemIndex){self.updateCurrItem();}
_shout('mainScrollAnimComplete');});if(itemChanged){self.updateCurrItem(true);}
return itemChanged;},_calculateZoomLevel=function(touchesDistance){return 1/_startPointsDistance*touchesDistance*_startZoomLevel;},_completeZoomGesture=function(){var destZoomLevel=_currZoomLevel,minZoomLevel=_getMinZoomLevel(),maxZoomLevel=_getMaxZoomLevel();if(_currZoomLevel<minZoomLevel){destZoomLevel=minZoomLevel;}else if(_currZoomLevel>maxZoomLevel){destZoomLevel=maxZoomLevel;}
var destOpacity=1,onUpdate,initialOpacity=_bgOpacity;if(_opacityChanged&&!_isZoomingIn&&!_wasOverInitialZoom&&_currZoomLevel<minZoomLevel){self.close();return true;}
if(_opacityChanged){onUpdate=function(now){_applyBgOpacity((destOpacity-initialOpacity)*now+initialOpacity);};}
self.zoomTo(destZoomLevel,0,200,framework.easing.cubic.out,onUpdate);return true;};_registerModule('Gestures',{publicMethods:{initGestures:function(){var addEventNames=function(pref,down,move,up,cancel){_dragStartEvent=pref+down;_dragMoveEvent=pref+move;_dragEndEvent=pref+up;if(cancel){_dragCancelEvent=pref+cancel;}else{_dragCancelEvent='';}};_pointerEventEnabled=_features.pointerEvent;if(_pointerEventEnabled&&_features.touch){_features.touch=false;}
if(_pointerEventEnabled){if(navigator.pointerEnabled){addEventNames('pointer','down','move','up','cancel');}else{addEventNames('MSPointer','Down','Move','Up','Cancel');}}else if(_features.touch){addEventNames('touch','start','move','end','cancel');_likelyTouchDevice=true;}else{addEventNames('mouse','down','move','up');}
_upMoveEvents=_dragMoveEvent+' '+_dragEndEvent+' '+_dragCancelEvent;_downEvents=_dragStartEvent;if(_pointerEventEnabled&&!_likelyTouchDevice){_likelyTouchDevice=(navigator.maxTouchPoints>1)||(navigator.msMaxTouchPoints>1);}
self.likelyTouchDevice=_likelyTouchDevice;_globalEventHandlers[_dragStartEvent]=_onDragStart;_globalEventHandlers[_dragMoveEvent]=_onDragMove;_globalEventHandlers[_dragEndEvent]=_onDragRelease;if(_dragCancelEvent){_globalEventHandlers[_dragCancelEvent]=_globalEventHandlers[_dragEndEvent];}
if(_features.touch){_downEvents+=' mousedown';_upMoveEvents+=' mousemove mouseup';_globalEventHandlers.mousedown=_globalEventHandlers[_dragStartEvent];_globalEventHandlers.mousemove=_globalEventHandlers[_dragMoveEvent];_globalEventHandlers.mouseup=_globalEventHandlers[_dragEndEvent];}
if(!_likelyTouchDevice){_options.allowPanToNext=false;}}}});var _showOrHideTimeout,_showOrHide=function(item,img,out,completeFn){if(_showOrHideTimeout){clearTimeout(_showOrHideTimeout);}
_initialZoomRunning=true;_initialContentSet=true;var thumbBounds;if(item.initialLayout){thumbBounds=item.initialLayout;item.initialLayout=null;}else{thumbBounds=_options.getThumbBoundsFn&&_options.getThumbBoundsFn(_currentItemIndex);}
var duration=out?_options.hideAnimationDuration:_options.showAnimationDuration;var onComplete=function(){_stopAnimation('initialZoom');if(!out){_applyBgOpacity(1);if(img){img.style.display='block';}
framework.addClass(template,'pswp--animated-in');_shout('initialZoom'+(out?'OutEnd':'InEnd'));}else{self.template.removeAttribute('style');self.bg.removeAttribute('style');}
if(completeFn){completeFn();}
_initialZoomRunning=false;};if(!duration||!thumbBounds||thumbBounds.x===undefined){_shout('initialZoom'+(out?'Out':'In'));_currZoomLevel=item.initialZoomLevel;_equalizePoints(_panOffset,item.initialPosition);_applyCurrentZoomPan();template.style.opacity=out?0:1;_applyBgOpacity(1);if(duration){setTimeout(function(){onComplete();},duration);}else{onComplete();}
return;}
var startAnimation=function(){var closeWithRaf=_closedByScroll,fadeEverything=!self.currItem.src||self.currItem.loadError||_options.showHideOpacity;if(item.miniImg){item.miniImg.style.webkitBackfaceVisibility='hidden';}
if(!out){_currZoomLevel=thumbBounds.w/item.w;_panOffset.x=thumbBounds.x;_panOffset.y=thumbBounds.y-_initalWindowScrollY;self[fadeEverything?'template':'bg'].style.opacity=0.001;_applyCurrentZoomPan();}
_registerStartAnimation('initialZoom');if(out&&!closeWithRaf){framework.removeClass(template,'pswp--animated-in');}
if(fadeEverything){if(out){framework[(closeWithRaf?'remove':'add')+'Class'](template,'pswp--animate_opacity');}else{setTimeout(function(){framework.addClass(template,'pswp--animate_opacity');},30);}}
_showOrHideTimeout=setTimeout(function(){_shout('initialZoom'+(out?'Out':'In'));if(!out){_currZoomLevel=item.initialZoomLevel;_equalizePoints(_panOffset,item.initialPosition);_applyCurrentZoomPan();_applyBgOpacity(1);if(fadeEverything){template.style.opacity=1;}else{_applyBgOpacity(1);}
_showOrHideTimeout=setTimeout(onComplete,duration+20);}else{var destZoomLevel=thumbBounds.w/item.w,initialPanOffset={x:_panOffset.x,y:_panOffset.y},initialZoomLevel=_currZoomLevel,initalBgOpacity=_bgOpacity,onUpdate=function(now){if(now===1){_currZoomLevel=destZoomLevel;_panOffset.x=thumbBounds.x;_panOffset.y=thumbBounds.y-_currentWindowScrollY;}else{_currZoomLevel=(destZoomLevel-initialZoomLevel)*now+initialZoomLevel;_panOffset.x=(thumbBounds.x-initialPanOffset.x)*now+initialPanOffset.x;_panOffset.y=(thumbBounds.y-_currentWindowScrollY-initialPanOffset.y)*now+initialPanOffset.y;}
_applyCurrentZoomPan();if(fadeEverything){template.style.opacity=1-now;}else{_applyBgOpacity(initalBgOpacity-now*initalBgOpacity);}};if(closeWithRaf){_animateProp('initialZoom',0,1,duration,framework.easing.cubic.out,onUpdate,onComplete);}else{onUpdate(1);_showOrHideTimeout=setTimeout(onComplete,duration+20);}}},out?25:90);};startAnimation();};var _items,_tempPanAreaSize={},_imagesToAppendPool=[],_initialContentSet,_initialZoomRunning,_controllerDefaultOptions={index:0,errorMsg:'<div class="pswp__error-msg"><a href="%url%" target="_blank">The image</a> could not be loaded.</div>',forceProgressiveLoading:false,preload:[1,1],getNumItemsFn:function(){return _items.length;}};var _getItemAt,_getNumItems,_initialIsLoop,_getZeroBounds=function(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}};},_calculateSingleItemPanBounds=function(item,realPanElementW,realPanElementH){var bounds=item.bounds;bounds.center.x=Math.round((_tempPanAreaSize.x-realPanElementW)/2);bounds.center.y=Math.round((_tempPanAreaSize.y-realPanElementH)/2)+item.vGap.top;bounds.max.x=(realPanElementW>_tempPanAreaSize.x)?Math.round(_tempPanAreaSize.x-realPanElementW):bounds.center.x;bounds.max.y=(realPanElementH>_tempPanAreaSize.y)?Math.round(_tempPanAreaSize.y-realPanElementH)+item.vGap.top:bounds.center.y;bounds.min.x=(realPanElementW>_tempPanAreaSize.x)?0:bounds.center.x;bounds.min.y=(realPanElementH>_tempPanAreaSize.y)?item.vGap.top:bounds.center.y;},_calculateItemSize=function(item,viewportSize,zoomLevel){if(item.src&&!item.loadError){var isInitial=!zoomLevel;if(isInitial){if(!item.vGap){item.vGap={top:0,bottom:0};}
_shout('parseVerticalMargin',item);}
_tempPanAreaSize.x=viewportSize.x;_tempPanAreaSize.y=viewportSize.y-item.vGap.top-item.vGap.bottom;if(isInitial){var hRatio=_tempPanAreaSize.x/item.w;var vRatio=_tempPanAreaSize.y/item.h;item.fitRatio=hRatio<vRatio?hRatio:vRatio;var scaleMode=_options.scaleMode;if(scaleMode==='orig'){zoomLevel=1;}else if(scaleMode==='fit'){zoomLevel=item.fitRatio;}
if(zoomLevel>1){zoomLevel=1;}
item.initialZoomLevel=zoomLevel;if(!item.bounds){item.bounds=_getZeroBounds();}}
if(!zoomLevel){return;}
_calculateSingleItemPanBounds(item,item.w*zoomLevel,item.h*zoomLevel);if(isInitial&&zoomLevel===item.initialZoomLevel){item.initialPosition=item.bounds.center;}
return item.bounds;}else{item.w=item.h=0;item.initialZoomLevel=item.fitRatio=1;item.bounds=_getZeroBounds();item.initialPosition=item.bounds.center;return item.bounds;}
return false;},_appendImage=function(index,item,baseDiv,img,preventAnimation,keepPlaceholder){if(item.loadError){return;}
if(img){item.imageAppended=true;_setImageSize(item,img,(item===self.currItem&&_renderMaxResolution));baseDiv.appendChild(img);if(keepPlaceholder){setTimeout(function(){if(item&&item.loaded&&item.placeholder){item.placeholder.style.display='none';item.placeholder=null;}},500);}}},_preloadImage=function(item){item.loading=true;item.loaded=false;var img=item.img=framework.createEl('pswp__img','img');var onComplete=function(){item.loading=false;item.loaded=true;if(item.loadComplete){item.loadComplete(item);}else{item.img=null;}
img.onload=img.onerror=null;img=null;};img.onload=onComplete;img.onerror=function(){item.loadError=true;onComplete();};img.src=item.src;return img;},_checkForError=function(item,cleanUp){if(item.src&&item.loadError&&item.container){if(cleanUp){item.container.innerHTML='';}
item.container.innerHTML=_options.errorMsg.replace('%url%',item.src);return true;}},_setImageSize=function(item,img,maxRes){if(!item.src){return;}
if(!img){img=item.container.lastChild;}
var w=maxRes?item.w:Math.round(item.w*item.fitRatio),h=maxRes?item.h:Math.round(item.h*item.fitRatio);if(item.placeholder&&!item.loaded){item.placeholder.style.width=w+'px';item.placeholder.style.height=h+'px';}
img.style.width=w+'px';img.style.height=h+'px';},_appendImagesPool=function(){if(_imagesToAppendPool.length){var poolItem;for(var i=0;i<_imagesToAppendPool.length;i++){poolItem=_imagesToAppendPool[i];if(poolItem.holder.index===poolItem.index){_appendImage(poolItem.index,poolItem.item,poolItem.baseDiv,poolItem.img,false,poolItem.clearPlaceholder);}}
_imagesToAppendPool=[];}};_registerModule('Controller',{publicMethods:{lazyLoadItem:function(index){index=_getLoopedId(index);var item=_getItemAt(index);if(!item||((item.loaded||item.loading)&&!_itemsNeedUpdate)){return;}
_shout('gettingData',index,item);if(!item.src){return;}
_preloadImage(item);},initController:function(){framework.extend(_options,_controllerDefaultOptions,true);self.items=_items=items;_getItemAt=self.getItemAt;_getNumItems=_options.getNumItemsFn;_initialIsLoop=_options.loop;if(_getNumItems()<3){_options.loop=false;}
_listen('beforeChange',function(diff){var p=_options.preload,isNext=diff===null?true:(diff>=0),preloadBefore=Math.min(p[0],_getNumItems()),preloadAfter=Math.min(p[1],_getNumItems()),i;for(i=1;i<=(isNext?preloadAfter:preloadBefore);i++){self.lazyLoadItem(_currentItemIndex+i);}
for(i=1;i<=(isNext?preloadBefore:preloadAfter);i++){self.lazyLoadItem(_currentItemIndex-i);}});_listen('initialLayout',function(){self.currItem.initialLayout=_options.getThumbBoundsFn&&_options.getThumbBoundsFn(_currentItemIndex);});_listen('mainScrollAnimComplete',_appendImagesPool);_listen('initialZoomInEnd',_appendImagesPool);_listen('destroy',function(){var item;for(var i=0;i<_items.length;i++){item=_items[i];if(item.container){item.container=null;}
if(item.placeholder){item.placeholder=null;}
if(item.img){item.img=null;}
if(item.preloader){item.preloader=null;}
if(item.loadError){item.loaded=item.loadError=false;}}
_imagesToAppendPool=null;});},getItemAt:function(index){if(index>=0){return _items[index]!==undefined?_items[index]:false;}
return false;},allowProgressiveImg:function(){return _options.forceProgressiveLoading||!_likelyTouchDevice||_options.mouseUsed||screen.width>1200;},setContent:function(holder,index){if(_options.loop){index=_getLoopedId(index);}
var prevItem=self.getItemAt(holder.index);if(prevItem){prevItem.container=null;}
var item=self.getItemAt(index),img;if(!item){holder.el.innerHTML='';return;}
_shout('gettingData',index,item);holder.index=index;holder.item=item;var baseDiv=item.container=framework.createEl('pswp__zoom-wrap');if(!item.src&&item.html){if(item.html.tagName){baseDiv.appendChild(item.html);}else{baseDiv.innerHTML=item.html;}}
_checkForError(item);_calculateItemSize(item,_viewportSize);if(item.src&&!item.loadError&&!item.loaded){item.loadComplete=function(item){if(!_isOpen){return;}
if(holder&&holder.index===index){if(_checkForError(item,true)){item.loadComplete=item.img=null;_calculateItemSize(item,_viewportSize);_applyZoomPanToItem(item);if(holder.index===_currentItemIndex){self.updateCurrZoomItem();}
return;}
if(!item.imageAppended){if(_features.transform&&(_mainScrollAnimating||_initialZoomRunning)){_imagesToAppendPool.push({item:item,baseDiv:baseDiv,img:item.img,index:index,holder:holder,clearPlaceholder:true});}else{_appendImage(index,item,baseDiv,item.img,_mainScrollAnimating||_initialZoomRunning,true);}}else{if(!_initialZoomRunning&&item.placeholder){item.placeholder.style.display='none';item.placeholder=null;}}}
item.loadComplete=null;item.img=null;_shout('imageLoadComplete',index,item);};if(framework.features.transform){var placeholderClassName='pswp__img pswp__img--placeholder';placeholderClassName+=(item.msrc?'':' pswp__img--placeholder--blank');var placeholder=framework.createEl(placeholderClassName,item.msrc?'img':'');if(item.msrc){placeholder.src=item.msrc;}
_setImageSize(item,placeholder);baseDiv.appendChild(placeholder);item.placeholder=placeholder;}
if(!item.loading){_preloadImage(item);}
if(self.allowProgressiveImg()){if(!_initialContentSet&&_features.transform){_imagesToAppendPool.push({item:item,baseDiv:baseDiv,img:item.img,index:index,holder:holder});}else{_appendImage(index,item,baseDiv,item.img,true,true);}}}else if(item.src&&!item.loadError){img=framework.createEl('pswp__img','img');img.style.opacity=1;img.src=item.src;_setImageSize(item,img);_appendImage(index,item,baseDiv,img,true);}
if(!_initialContentSet&&index===_currentItemIndex){_currZoomElementStyle=baseDiv.style;_showOrHide(item,(img||item.img));}else{_applyZoomPanToItem(item);}
holder.el.innerHTML='';holder.el.appendChild(baseDiv);},cleanSlide:function(item){if(item.img){item.img.onload=item.img.onerror=null;}
item.loaded=item.loading=item.img=item.imageAppended=false;}}});var tapTimer,tapReleasePoint={},_dispatchTapEvent=function(origEvent,releasePoint,pointerType){var e=document.createEvent('CustomEvent'),eDetail={origEvent:origEvent,target:origEvent.target,releasePoint:releasePoint,pointerType:pointerType||'touch'};e.initCustomEvent('pswpTap',true,true,eDetail);origEvent.target.dispatchEvent(e);};_registerModule('Tap',{publicMethods:{initTap:function(){_listen('firstTouchStart',self.onTapStart);_listen('touchRelease',self.onTapRelease);_listen('destroy',function(){tapReleasePoint={};tapTimer=null;});},onTapStart:function(touchList){if(touchList.length>1){clearTimeout(tapTimer);tapTimer=null;}},onTapRelease:function(e,releasePoint){if(!releasePoint){return;}
if(!_moved&&!_isMultitouch&&!_numAnimations){var p0=releasePoint;if(tapTimer){clearTimeout(tapTimer);tapTimer=null;if(_isNearbyPoints(p0,tapReleasePoint)){_shout('doubleTap',p0);return;}}
if(releasePoint.type==='mouse'){_dispatchTapEvent(e,releasePoint,'mouse');return;}
var clickedTagName=e.target.tagName.toUpperCase();if(clickedTagName==='BUTTON'||framework.hasClass(e.target,'pswp__single-tap')){_dispatchTapEvent(e,releasePoint);return;}
_equalizePoints(tapReleasePoint,p0);tapTimer=setTimeout(function(){_dispatchTapEvent(e,releasePoint);tapTimer=null;},300);}}}});var _wheelDelta;_registerModule('DesktopZoom',{publicMethods:{initDesktopZoom:function(){if(_oldIE){return;}
if(_likelyTouchDevice){_listen('mouseUsed',function(){self.setupDesktopZoom();});}else{self.setupDesktopZoom(true);}},setupDesktopZoom:function(onInit){_wheelDelta={};var events='wheel mousewheel DOMMouseScroll';_listen('bindEvents',function(){framework.bind(template,events,self.handleMouseWheel);});_listen('unbindEvents',function(){if(_wheelDelta){framework.unbind(template,events,self.handleMouseWheel);}});self.mouseZoomedIn=false;var hasDraggingClass,updateZoomable=function(){if(self.mouseZoomedIn){framework.removeClass(template,'pswp--zoomed-in');self.mouseZoomedIn=false;}
if(_currZoomLevel<1){framework.addClass(template,'pswp--zoom-allowed');}else{framework.removeClass(template,'pswp--zoom-allowed');}
removeDraggingClass();},removeDraggingClass=function(){if(hasDraggingClass){framework.removeClass(template,'pswp--dragging');hasDraggingClass=false;}};_listen('resize',updateZoomable);_listen('afterChange',updateZoomable);_listen('pointerDown',function(){if(self.mouseZoomedIn){hasDraggingClass=true;framework.addClass(template,'pswp--dragging');}});_listen('pointerUp',removeDraggingClass);if(!onInit){updateZoomable();}},handleMouseWheel:function(e){if(_currZoomLevel<=self.currItem.fitRatio){if(_options.modal){if(!_options.closeOnScroll||_numAnimations||_isDragging){e.preventDefault();}else if(_transformKey&&Math.abs(e.deltaY)>2){_closedByScroll=true;self.close();}}
return true;}
e.stopPropagation();_wheelDelta.x=0;if('deltaX'in e){if(e.deltaMode===1){_wheelDelta.x=e.deltaX*18;_wheelDelta.y=e.deltaY*18;}else{_wheelDelta.x=e.deltaX;_wheelDelta.y=e.deltaY;}}else if('wheelDelta'in e){if(e.wheelDeltaX){_wheelDelta.x=-0.16*e.wheelDeltaX;}
if(e.wheelDeltaY){_wheelDelta.y=-0.16*e.wheelDeltaY;}else{_wheelDelta.y=-0.16*e.wheelDelta;}}else if('detail'in e){_wheelDelta.y=e.detail;}else{return;}
_calculatePanBounds(_currZoomLevel,true);var newPanX=_panOffset.x-_wheelDelta.x,newPanY=_panOffset.y-_wheelDelta.y;if(_options.modal||(newPanX<=_currPanBounds.min.x&&newPanX>=_currPanBounds.max.x&&newPanY<=_currPanBounds.min.y&&newPanY>=_currPanBounds.max.y)){e.preventDefault();}
self.panTo(newPanX,newPanY);},toggleDesktopZoom:function(centerPoint){centerPoint=centerPoint||{x:_viewportSize.x/2+_offset.x,y:_viewportSize.y/2+_offset.y};var doubleTapZoomLevel=_options.getDoubleTapZoom(true,self.currItem);var zoomOut=_currZoomLevel===doubleTapZoomLevel;self.mouseZoomedIn=!zoomOut;self.zoomTo(zoomOut?self.currItem.initialZoomLevel:doubleTapZoomLevel,centerPoint,333);framework[(!zoomOut?'add':'remove')+'Class'](template,'pswp--zoomed-in');}}});var _historyDefaultOptions={history:true,galleryUID:1};var _historyUpdateTimeout,_hashChangeTimeout,_hashAnimCheckTimeout,_hashChangedByScript,_hashChangedByHistory,_hashReseted,_initialHash,_historyChanged,_closedFromURL,_urlChangedOnce,_windowLoc,_supportsPushState,_getHash=function(){return _windowLoc.hash.substring(1);},_cleanHistoryTimeouts=function(){if(_historyUpdateTimeout){clearTimeout(_historyUpdateTimeout);}
if(_hashAnimCheckTimeout){clearTimeout(_hashAnimCheckTimeout);}},_parseItemIndexFromURL=function(){var hash=_getHash(),params={};if(hash.length<5){return params;}
var i,vars=hash.split('&');for(i=0;i<vars.length;i++){if(!vars[i]){continue;}
var pair=vars[i].split('=');if(pair.length<2){continue;}
params[pair[0]]=pair[1];}
if(_options.galleryPIDs){var searchfor=params.pid;params.pid=0;for(i=0;i<_items.length;i++){if(_items[i].pid===searchfor){params.pid=i;break;}}}else{params.pid=parseInt(params.pid,10)-1;}
if(params.pid<0){params.pid=0;}
return params;},_updateHash=function(){if(_hashAnimCheckTimeout){clearTimeout(_hashAnimCheckTimeout);}
if(_numAnimations||_isDragging){_hashAnimCheckTimeout=setTimeout(_updateHash,500);return;}
if(_hashChangedByScript){clearTimeout(_hashChangeTimeout);}else{_hashChangedByScript=true;}
var pid=(_currentItemIndex+1);var item=_getItemAt(_currentItemIndex);if(item.hasOwnProperty('pid')){pid=item.pid;}
var newHash=_initialHash+'&'+'gid='+_options.galleryUID+'&'+'pid='+pid;if(!_historyChanged){if(_windowLoc.hash.indexOf(newHash)===-1){_urlChangedOnce=true;}}
var newURL=_windowLoc.href.split('#')[0]+'#'+newHash;if(_supportsPushState){if('#'+newHash!==window.location.hash){history[_historyChanged?'replaceState':'pushState']('',document.title,newURL);}}else{if(_historyChanged){_windowLoc.replace(newURL);}else{_windowLoc.hash=newHash;}}
_historyChanged=true;_hashChangeTimeout=setTimeout(function(){_hashChangedByScript=false;},60);};_registerModule('History',{publicMethods:{initHistory:function(){framework.extend(_options,_historyDefaultOptions,true);if(!_options.history){return;}
_windowLoc=window.location;_urlChangedOnce=false;_closedFromURL=false;_historyChanged=false;_initialHash=_getHash();_supportsPushState=('pushState'in history);if(_initialHash.indexOf('gid=')>-1){_initialHash=_initialHash.split('&gid=')[0];_initialHash=_initialHash.split('?gid=')[0];}
_listen('afterChange',self.updateURL);_listen('unbindEvents',function(){framework.unbind(window,'hashchange',self.onHashChange);});var returnToOriginal=function(){_hashReseted=true;if(!_closedFromURL){if(_urlChangedOnce){history.back();}else{if(_initialHash){_windowLoc.hash=_initialHash;}else{if(_supportsPushState){history.pushState('',document.title,_windowLoc.pathname+_windowLoc.search);}else{_windowLoc.hash='';}}}}
_cleanHistoryTimeouts();};_listen('unbindEvents',function(){if(_closedByScroll){returnToOriginal();}});_listen('destroy',function(){if(!_hashReseted){returnToOriginal();}});_listen('firstUpdate',function(){_currentItemIndex=_parseItemIndexFromURL().pid;});var index=_initialHash.indexOf('pid=');if(index>-1){_initialHash=_initialHash.substring(0,index);if(_initialHash.slice(-1)==='&'){_initialHash=_initialHash.slice(0,-1);}}
setTimeout(function(){if(_isOpen){framework.bind(window,'hashchange',self.onHashChange);}},40);},onHashChange:function(){if(_getHash()===_initialHash){_closedFromURL=true;self.close();return;}
if(!_hashChangedByScript){_hashChangedByHistory=true;self.goTo(_parseItemIndexFromURL().pid);_hashChangedByHistory=false;}},updateURL:function(){_cleanHistoryTimeouts();if(_hashChangedByHistory){return;}
if(!_historyChanged){_updateHash();}else{_historyUpdateTimeout=setTimeout(_updateHash,800);}}}});framework.extend(self,publicMethods);};return PhotoSwipe;});(function(root,factory){if(typeof define==='function'&&define.amd){define(factory);}else if(typeof exports==='object'){module.exports=factory();}else{root.PhotoSwipeUI_Default=factory();}})(this,function(){'use strict';var PhotoSwipeUI_Default=function(pswp,framework){var ui=this;var _overlayUIUpdated=false,_controlsVisible=true,_fullscrenAPI,_controls,_captionContainer,_fakeCaptionContainer,_indexIndicator,_shareButton,_shareModal,_shareModalHidden=true,_initalCloseOnScrollValue,_isIdle,_listen,_loadingIndicator,_loadingIndicatorHidden,_loadingIndicatorTimeout,_galleryHasOneSlide,_options,_defaultUIOptions={barsSize:{top:44,bottom:'auto'},closeElClasses:['item','caption','zoom-wrap','ui','top-bar'],timeToIdle:4000,timeToIdleOutside:1000,loadingIndicatorDelay:1000,addCaptionHTMLFn:function(item,captionEl){if(!item.title){captionEl.children[0].innerHTML='';return false;}
captionEl.children[0].innerHTML=item.title;return true;},closeEl:true,captionEl:true,fullscreenEl:true,zoomEl:true,shareEl:false,counterEl:false,arrowEl:true,preloaderEl:true,tapToClose:false,tapToToggleControls:true,clickToCloseNonZoomable:false,shareButtons:[],getImageURLForShare:function(){return pswp.currItem.src||'';},getPageURLForShare:function(){return window.location.href;},getTextForShare:function(){return pswp.currItem.title||'';},indexIndicatorSep:' / '},_blockControlsTap,_blockControlsTapTimeout;var _onControlsTap=function(e){if(_blockControlsTap){return true;}
e=e||window.event;if(_options.timeToIdle&&_options.mouseUsed&&!_isIdle){_onIdleMouseMove();}
var target=e.target||e.srcElement,uiElement,clickedClass=target.className,found;for(var i=0;i<_uiElements.length;i++){uiElement=_uiElements[i];if(uiElement.onTap&&clickedClass.indexOf('pswp__'+uiElement.name)>-1){uiElement.onTap();found=true;}}
if(found){if(e.stopPropagation){e.stopPropagation();}
_blockControlsTap=true;var tapDelay=framework.features.isOldAndroid?600:30;_blockControlsTapTimeout=setTimeout(function(){_blockControlsTap=false;},tapDelay);}},_fitControlsInViewport=function(){return!pswp.likelyTouchDevice||_options.mouseUsed||screen.width>1200;},_togglePswpClass=function(el,cName,add){framework[(add?'add':'remove')+'Class'](el,'pswp__'+cName);},_countNumItems=function(){var hasOneSlide=(_options.getNumItemsFn()===1);if(hasOneSlide!==_galleryHasOneSlide){_togglePswpClass(_controls,'ui--one-slide',hasOneSlide);_galleryHasOneSlide=hasOneSlide;}},_toggleShareModalClass=function(){_togglePswpClass(_shareModal,'share-modal--hidden',_shareModalHidden);},_toggleShareModal=function(){_shareModalHidden=!_shareModalHidden;if(!_shareModalHidden){_toggleShareModalClass();setTimeout(function(){if(!_shareModalHidden){framework.addClass(_shareModal,'pswp__share-modal--fade-in');}},30);}else{framework.removeClass(_shareModal,'pswp__share-modal--fade-in');setTimeout(function(){if(_shareModalHidden){_toggleShareModalClass();}},300);}
if(!_shareModalHidden){_updateShareURLs();}
return false;},_openWindowPopup=function(e){e=e||window.event;var target=e.target||e.srcElement;pswp.shout('shareLinkClick',e,target);if(!target.href){return false;}
if(target.hasAttribute('download')){return true;}
window.open(target.href,'pswp_share','scrollbars=yes,resizable=yes,toolbar=no,'+'location=yes,width=550,height=420,top=100,left='+
(window.screen?Math.round(screen.width/2-275):100));if(!_shareModalHidden){_toggleShareModal();}
return false;},_updateShareURLs=function(){var shareButtonOut='',shareButtonData,shareURL,image_url,page_url,share_text;for(var i=0;i<_options.shareButtons.length;i++){shareButtonData=_options.shareButtons[i];image_url=_options.getImageURLForShare(shareButtonData);page_url=_options.getPageURLForShare(shareButtonData);share_text=_options.getTextForShare(shareButtonData);shareURL=shareButtonData.url.replace('{{url}}',encodeURIComponent(page_url)).replace('{{image_url}}',encodeURIComponent(image_url)).replace('{{raw_image_url}}',image_url).replace('{{text}}',encodeURIComponent(share_text));shareButtonOut+='<a href="'+shareURL+'" target="_blank" '+'class="pswp__share--'+shareButtonData.id+'"'+
(shareButtonData.download?'download':'')+'>'+
shareButtonData.label+'</a>';if(_options.parseShareButtonOut){shareButtonOut=_options.parseShareButtonOut(shareButtonData,shareButtonOut);}}
_shareModal.children[0].innerHTML=shareButtonOut;_shareModal.children[0].onclick=_openWindowPopup;},_hasCloseClass=function(target){for(var i=0;i<_options.closeElClasses.length;i++){if(framework.hasClass(target,'pswp__'+_options.closeElClasses[i])){return true;}}},_idleInterval,_idleTimer,_idleIncrement=0,_onIdleMouseMove=function(){clearTimeout(_idleTimer);_idleIncrement=0;if(_isIdle){ui.setIdle(false);}},_onMouseLeaveWindow=function(e){e=e?e:window.event;var from=e.relatedTarget||e.toElement;if(!from||from.nodeName==='HTML'){clearTimeout(_idleTimer);_idleTimer=setTimeout(function(){ui.setIdle(true);},_options.timeToIdleOutside);}},_setupFullscreenAPI=function(){if(_options.fullscreenEl&&!framework.features.isOldAndroid){if(!_fullscrenAPI){_fullscrenAPI=ui.getFullscreenAPI();}
if(_fullscrenAPI){framework.bind(document,_fullscrenAPI.eventK,ui.updateFullscreen);ui.updateFullscreen();framework.addClass(pswp.template,'pswp--supports-fs');}else{framework.removeClass(pswp.template,'pswp--supports-fs');}}},_setupLoadingIndicator=function(){if(_options.preloaderEl){_toggleLoadingIndicator(true);_listen('beforeChange',function(){clearTimeout(_loadingIndicatorTimeout);_loadingIndicatorTimeout=setTimeout(function(){if(pswp.currItem&&pswp.currItem.loading){if(!pswp.allowProgressiveImg()||(pswp.currItem.img&&!pswp.currItem.img.naturalWidth)){_toggleLoadingIndicator(false);}}else{_toggleLoadingIndicator(true);}},_options.loadingIndicatorDelay);});_listen('imageLoadComplete',function(index,item){if(pswp.currItem===item){_toggleLoadingIndicator(true);}});}},_toggleLoadingIndicator=function(hide){if(_loadingIndicatorHidden!==hide){_togglePswpClass(_loadingIndicator,'preloader--active',!hide);_loadingIndicatorHidden=hide;}},_applyNavBarGaps=function(item){var gap=item.vGap;if(_fitControlsInViewport()){var bars=_options.barsSize;if(_options.captionEl&&bars.bottom==='auto'){if(!_fakeCaptionContainer){_fakeCaptionContainer=framework.createEl('pswp__caption pswp__caption--fake');_fakeCaptionContainer.appendChild(framework.createEl('pswp__caption__center'));_controls.insertBefore(_fakeCaptionContainer,_captionContainer);framework.addClass(_controls,'pswp__ui--fit');}
if(_options.addCaptionHTMLFn(item,_fakeCaptionContainer,true)){var captionSize=_fakeCaptionContainer.clientHeight;gap.bottom=parseInt(captionSize,10)||44;}else{gap.bottom=bars.top;}}else{gap.bottom=bars.bottom==='auto'?0:bars.bottom;}
gap.top=bars.top;}else{gap.top=gap.bottom=0;}},_setupIdle=function(){if(_options.timeToIdle){_listen('mouseUsed',function(){framework.bind(document,'mousemove',_onIdleMouseMove);framework.bind(document,'mouseout',_onMouseLeaveWindow);_idleInterval=setInterval(function(){_idleIncrement++;if(_idleIncrement===2){ui.setIdle(true);}},_options.timeToIdle/2);});}},_setupHidingControlsDuringGestures=function(){_listen('onVerticalDrag',function(now){if(_controlsVisible&&now<0.95){ui.hideControls();}else if(!_controlsVisible&&now>=0.95){ui.showControls();}});var pinchControlsHidden;_listen('onPinchClose',function(now){if(_controlsVisible&&now<0.9){ui.hideControls();pinchControlsHidden=true;}else if(pinchControlsHidden&&!_controlsVisible&&now>0.9){ui.showControls();}});_listen('zoomGestureEnded',function(){pinchControlsHidden=false;if(pinchControlsHidden&&!_controlsVisible){ui.showControls();}});};var _uiElements=[{name:'caption',option:'captionEl',onInit:function(el){_captionContainer=el;}},{name:'share-modal',option:'shareEl',onInit:function(el){_shareModal=el;},onTap:function(){_toggleShareModal();}},{name:'button--share',option:'shareEl',onInit:function(el){_shareButton=el;},onTap:function(){_toggleShareModal();}},{name:'button--zoom',option:'zoomEl',onTap:pswp.toggleDesktopZoom},{name:'counter',option:'counterEl',onInit:function(el){_indexIndicator=el;}},{name:'button--close',option:'closeEl',onTap:pswp.close},{name:'button--arrow--left',option:'arrowEl',onTap:pswp.prev},{name:'button--arrow--right',option:'arrowEl',onTap:pswp.next},{name:'button--fs',option:'fullscreenEl',onTap:function(){if(_fullscrenAPI.isFullscreen()){_fullscrenAPI.exit();}else{_fullscrenAPI.enter();}}},{name:'preloader',option:'preloaderEl',onInit:function(el){_loadingIndicator=el;}}];var _setupUIElements=function(){var item,classAttr,uiElement;var loopThroughChildElements=function(sChildren){if(!sChildren){return;}
var l=sChildren.length;for(var i=0;i<l;i++){item=sChildren[i];classAttr=item.className;for(var a=0;a<_uiElements.length;a++){uiElement=_uiElements[a];if(classAttr.indexOf('pswp__'+uiElement.name)>-1){if(_options[uiElement.option]){framework.removeClass(item,'pswp__element--disabled');if(uiElement.onInit){uiElement.onInit(item);}}else{framework.addClass(item,'pswp__element--disabled');}}}}};loopThroughChildElements(_controls.children);var topBar=framework.getChildByClass(_controls,'pswp__top-bar');if(topBar){loopThroughChildElements(topBar.children);}};ui.init=function(){framework.extend(pswp.options,_defaultUIOptions,true);_options=pswp.options;_controls=framework.getChildByClass(pswp.scrollWrap,'pswp__ui');_listen=pswp.listen;_setupHidingControlsDuringGestures();_listen('beforeChange',ui.update);_listen('doubleTap',function(point){var initialZoomLevel=pswp.currItem.initialZoomLevel;if(pswp.getZoomLevel()!==initialZoomLevel){pswp.zoomTo(initialZoomLevel,point,333);}else{pswp.zoomTo(_options.getDoubleTapZoom(false,pswp.currItem),point,333);}});_listen('preventDragEvent',function(e,isDown,preventObj){var t=e.target||e.srcElement;if(t&&t.className&&e.type.indexOf('mouse')>-1&&(t.className.indexOf('__caption')>0||(/(SMALL|STRONG|EM)/i).test(t.tagName))){preventObj.prevent=false;}});_listen('bindEvents',function(){framework.bind(_controls,'pswpTap click',_onControlsTap);framework.bind(pswp.scrollWrap,'pswpTap',ui.onGlobalTap);if(!pswp.likelyTouchDevice){framework.bind(pswp.scrollWrap,'mouseover',ui.onMouseOver);}});_listen('unbindEvents',function(){if(!_shareModalHidden){_toggleShareModal();}
if(_idleInterval){clearInterval(_idleInterval);}
framework.unbind(document,'mouseout',_onMouseLeaveWindow);framework.unbind(document,'mousemove',_onIdleMouseMove);framework.unbind(_controls,'pswpTap click',_onControlsTap);framework.unbind(pswp.scrollWrap,'pswpTap',ui.onGlobalTap);framework.unbind(pswp.scrollWrap,'mouseover',ui.onMouseOver);if(_fullscrenAPI){framework.unbind(document,_fullscrenAPI.eventK,ui.updateFullscreen);if(_fullscrenAPI.isFullscreen()){_options.hideAnimationDuration=0;_fullscrenAPI.exit();}
_fullscrenAPI=null;}});_listen('destroy',function(){if(_options.captionEl){if(_fakeCaptionContainer){_controls.removeChild(_fakeCaptionContainer);}
framework.removeClass(_captionContainer,'pswp__caption--empty');}
if(_shareModal){_shareModal.children[0].onclick=null;}
framework.removeClass(_controls,'pswp__ui--over-close');framework.addClass(_controls,'pswp__ui--hidden');ui.setIdle(false);});if(!_options.showAnimationDuration){framework.removeClass(_controls,'pswp__ui--hidden');}
_listen('initialZoomIn',function(){if(_options.showAnimationDuration){framework.removeClass(_controls,'pswp__ui--hidden');}});_listen('initialZoomOut',function(){framework.addClass(_controls,'pswp__ui--hidden');});_listen('parseVerticalMargin',_applyNavBarGaps);_setupUIElements();if(_options.shareEl&&_shareButton&&_shareModal){_shareModalHidden=true;}
_countNumItems();_setupIdle();_setupFullscreenAPI();_setupLoadingIndicator();};ui.setIdle=function(isIdle){_isIdle=isIdle;_togglePswpClass(_controls,'ui--idle',isIdle);};ui.update=function(){if(_controlsVisible&&pswp.currItem){ui.updateIndexIndicator();if(_options.captionEl){_options.addCaptionHTMLFn(pswp.currItem,_captionContainer);_togglePswpClass(_captionContainer,'caption--empty',!pswp.currItem.title);}
_overlayUIUpdated=true;}else{_overlayUIUpdated=false;}
if(!_shareModalHidden){_toggleShareModal();}
_countNumItems();};ui.updateFullscreen=function(e){if(e){setTimeout(function(){pswp.setScrollOffset(0,framework.getScrollY());},50);}
framework[(_fullscrenAPI.isFullscreen()?'add':'remove')+'Class'](pswp.template,'pswp--fs');};ui.updateIndexIndicator=function(){if(_options.counterEl){_indexIndicator.innerHTML=(pswp.getCurrentIndex()+1)+
_options.indexIndicatorSep+
_options.getNumItemsFn();}};ui.onGlobalTap=function(e){e=e||window.event;var target=e.target||e.srcElement;if(_blockControlsTap){return;}
if(e.detail&&e.detail.pointerType==='mouse'){if(_hasCloseClass(target)){pswp.close();return;}
if(framework.hasClass(target,'pswp__img')){if(pswp.getZoomLevel()===1&&pswp.getZoomLevel()<=pswp.currItem.fitRatio){if(_options.clickToCloseNonZoomable){pswp.close();}}else{pswp.toggleDesktopZoom(e.detail.releasePoint);}}}else{if(_options.tapToToggleControls){if(_controlsVisible){ui.hideControls();}else{ui.showControls();}}
if(_options.tapToClose&&(framework.hasClass(target,'pswp__img')||_hasCloseClass(target))){pswp.close();return;}}};ui.onMouseOver=function(e){e=e||window.event;var target=e.target||e.srcElement;_togglePswpClass(_controls,'ui--over-close',_hasCloseClass(target));};ui.hideControls=function(){framework.addClass(_controls,'pswp__ui--hidden');_controlsVisible=false;};ui.showControls=function(){_controlsVisible=true;if(!_overlayUIUpdated){ui.update();}
framework.removeClass(_controls,'pswp__ui--hidden');};ui.supportsFullscreen=function(){var d=document;return!!(d.exitFullscreen||d.mozCancelFullScreen||d.webkitExitFullscreen||d.msExitFullscreen);};ui.getFullscreenAPI=function(){var dE=document.documentElement,api,tF='fullscreenchange';if(dE.requestFullscreen){api={enterK:'requestFullscreen',exitK:'exitFullscreen',elementK:'fullscreenElement',eventK:tF};}else if(dE.mozRequestFullScreen){api={enterK:'mozRequestFullScreen',exitK:'mozCancelFullScreen',elementK:'mozFullScreenElement',eventK:'moz'+tF};}else if(dE.webkitRequestFullscreen){api={enterK:'webkitRequestFullscreen',exitK:'webkitExitFullscreen',elementK:'webkitFullscreenElement',eventK:'webkit'+tF};}else if(dE.msRequestFullscreen){api={enterK:'msRequestFullscreen',exitK:'msExitFullscreen',elementK:'msFullscreenElement',eventK:'MSFullscreenChange'};}
if(api){api.enter=function(){_initalCloseOnScrollValue=_options.closeOnScroll;_options.closeOnScroll=false;if(this.enterK==='webkitRequestFullscreen'){pswp.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT);}else{return pswp.template[this.enterK]();}};api.exit=function(){_options.closeOnScroll=_initalCloseOnScrollValue;return document[this.exitK]();};api.isFullscreen=function(){return document[this.elementK];};}
return api;};};return PhotoSwipeUI_Default;});;(function(factory){'use strict';if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports!=='undefined'){module.exports=factory(require('jquery'));}else{factory(jQuery);}}(function($){'use strict';var Slick=window.Slick||{};Slick=(function(){var instanceUid=0;function Slick(element,settings){var _=this,dataSettings;_.defaults={accessibility:true,adaptiveHeight:false,appendArrows:$(element),appendDots:$(element),arrows:true,asNavFor:null,prevArrow:'<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>',nextArrow:'<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>',autoplay:false,autoplaySpeed:3000,centerMode:false,centerPadding:'50px',cssEase:'ease',customPaging:function(slider,i){return'<button type="button" data-role="none" role="button" aria-required="false" tabindex="0">'+(i+1)+'</button>';},dots:false,dotsClass:'slick-dots',draggable:true,easing:'linear',edgeFriction:0.35,fade:false,focusOnSelect:false,infinite:true,initialSlide:0,lazyLoad:'ondemand',mobileFirst:false,pauseOnHover:true,pauseOnDotsHover:false,respondTo:'window',responsive:null,rows:1,rtl:false,slide:'',slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:true,swipeToSlide:false,touchMove:true,touchThreshold:5,useCSS:true,useTransform:false,variableWidth:false,vertical:false,verticalSwiping:false,waitForAnimate:true,zIndex:1000};_.initials={animating:false,dragging:false,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:false,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:false,unslicked:false};$.extend(_,_.initials);_.activeBreakpoint=null;_.animType=null;_.animProp=null;_.breakpoints=[];_.breakpointSettings=[];_.cssTransitions=false;_.hidden='hidden';_.paused=false;_.positionProp=null;_.respondTo=null;_.rowCount=1;_.shouldClick=true;_.$slider=$(element);_.$slidesCache=null;_.transformType=null;_.transitionType=null;_.visibilityChange='visibilitychange';_.windowWidth=0;_.windowTimer=null;dataSettings=$(element).data('slick')||{};_.options=$.extend({},_.defaults,dataSettings,settings);_.currentSlide=_.options.initialSlide;_.originalSettings=_.options;if(typeof document.mozHidden!=='undefined'){_.hidden='mozHidden';_.visibilityChange='mozvisibilitychange';}else if(typeof document.webkitHidden!=='undefined'){_.hidden='webkitHidden';_.visibilityChange='webkitvisibilitychange';}
_.autoPlay=$.proxy(_.autoPlay,_);_.autoPlayClear=$.proxy(_.autoPlayClear,_);_.changeSlide=$.proxy(_.changeSlide,_);_.clickHandler=$.proxy(_.clickHandler,_);_.selectHandler=$.proxy(_.selectHandler,_);_.setPosition=$.proxy(_.setPosition,_);_.swipeHandler=$.proxy(_.swipeHandler,_);_.dragHandler=$.proxy(_.dragHandler,_);_.keyHandler=$.proxy(_.keyHandler,_);_.autoPlayIterator=$.proxy(_.autoPlayIterator,_);_.instanceUid=instanceUid++;_.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/;_.registerBreakpoints();_.init(true);_.checkResponsive(true);}
return Slick;}());Slick.prototype.addSlide=Slick.prototype.slickAdd=function(markup,index,addBefore){var _=this;if(typeof(index)==='boolean'){addBefore=index;index=null;}else if(index<0||(index>=_.slideCount)){return false;}
_.unload();if(typeof(index)==='number'){if(index===0&&_.$slides.length===0){$(markup).appendTo(_.$slideTrack);}else if(addBefore){$(markup).insertBefore(_.$slides.eq(index));}else{$(markup).insertAfter(_.$slides.eq(index));}}else{if(addBefore===true){$(markup).prependTo(_.$slideTrack);}else{$(markup).appendTo(_.$slideTrack);}}
_.$slides=_.$slideTrack.children(this.options.slide);_.$slideTrack.children(this.options.slide).detach();_.$slideTrack.append(_.$slides);_.$slides.each(function(index,element){$(element).attr('data-slick-index',index);});_.$slidesCache=_.$slides;_.reinit();};Slick.prototype.animateHeight=function(){var _=this;if(_.options.slidesToShow===1&&_.options.adaptiveHeight===true&&_.options.vertical===false){var targetHeight=_.$slides.eq(_.currentSlide).outerHeight(true);_.$list.animate({height:targetHeight},_.options.speed);}};Slick.prototype.animateSlide=function(targetLeft,callback){var animProps={},_=this;_.animateHeight();if(_.options.rtl===true&&_.options.vertical===false){targetLeft=-targetLeft;}
if(_.transformsEnabled===false){if(_.options.vertical===false){_.$slideTrack.animate({left:targetLeft},_.options.speed,_.options.easing,callback);}else{_.$slideTrack.animate({top:targetLeft},_.options.speed,_.options.easing,callback);}}else{if(_.cssTransitions===false){if(_.options.rtl===true){_.currentLeft=-(_.currentLeft);}
$({animStart:_.currentLeft}).animate({animStart:targetLeft},{duration:_.options.speed,easing:_.options.easing,step:function(now){now=Math.ceil(now);if(_.options.vertical===false){animProps[_.animType]='translate('+
now+'px, 0px)';_.$slideTrack.css(animProps);}else{animProps[_.animType]='translate(0px,'+
now+'px)';_.$slideTrack.css(animProps);}},complete:function(){if(callback){callback.call();}}});}else{_.applyTransition();targetLeft=Math.ceil(targetLeft);if(_.options.vertical===false){animProps[_.animType]='translate3d('+targetLeft+'px, 0px, 0px)';}else{animProps[_.animType]='translate3d(0px,'+targetLeft+'px, 0px)';}
_.$slideTrack.css(animProps);if(callback){setTimeout(function(){_.disableTransition();callback.call();},_.options.speed);}}}};Slick.prototype.asNavFor=function(index){var _=this,asNavFor=_.options.asNavFor;if(asNavFor&&asNavFor!==null){asNavFor=$(asNavFor).not(_.$slider);}
if(asNavFor!==null&&typeof asNavFor==='object'){asNavFor.each(function(){var target=$(this).slick('getSlick');if(!target.unslicked){target.slideHandler(index,true);}});}};Slick.prototype.applyTransition=function(slide){var _=this,transition={};if(_.options.fade===false){transition[_.transitionType]=_.transformType+' '+_.options.speed+'ms '+_.options.cssEase;}else{transition[_.transitionType]='opacity '+_.options.speed+'ms '+_.options.cssEase;}
if(_.options.fade===false){_.$slideTrack.css(transition);}else{_.$slides.eq(slide).css(transition);}};Slick.prototype.autoPlay=function(){var _=this;if(_.autoPlayTimer){clearInterval(_.autoPlayTimer);}
if(_.slideCount>_.options.slidesToShow&&_.paused!==true){_.autoPlayTimer=setInterval(_.autoPlayIterator,_.options.autoplaySpeed);}};Slick.prototype.autoPlayClear=function(){var _=this;if(_.autoPlayTimer){clearInterval(_.autoPlayTimer);}};Slick.prototype.autoPlayIterator=function(){var _=this;if(_.options.infinite===false){if(_.direction===1){if((_.currentSlide+1)===_.slideCount-
1){_.direction=0;}
_.slideHandler(_.currentSlide+_.options.slidesToScroll);}else{if((_.currentSlide-1===0)){_.direction=1;}
_.slideHandler(_.currentSlide-_.options.slidesToScroll);}}else{_.slideHandler(_.currentSlide+_.options.slidesToScroll);}};Slick.prototype.buildArrows=function(){var _=this;if(_.options.arrows===true){_.$prevArrow=$(_.options.prevArrow).addClass('slick-arrow');_.$nextArrow=$(_.options.nextArrow).addClass('slick-arrow');if(_.slideCount>_.options.slidesToShow){_.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');_.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');if(_.htmlExpr.test(_.options.prevArrow)){_.$prevArrow.prependTo(_.options.appendArrows);}
if(_.htmlExpr.test(_.options.nextArrow)){_.$nextArrow.appendTo(_.options.appendArrows);}
if(_.options.infinite!==true){_.$prevArrow.addClass('slick-disabled').attr('aria-disabled','true');}}else{_.$prevArrow.add(_.$nextArrow).addClass('slick-hidden').attr({'aria-disabled':'true','tabindex':'-1'});}}};Slick.prototype.buildDots=function(){var _=this,i,dotString;if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){dotString='<ul class="'+_.options.dotsClass+'">';for(i=0;i<=_.getDotCount();i+=1){dotString+='<li>'+_.options.customPaging.call(this,_,i)+'</li>';}
dotString+='</ul>';_.$dots=$(dotString).appendTo(_.options.appendDots);_.$dots.find('li').first().addClass('slick-active').attr('aria-hidden','false');}};Slick.prototype.buildOut=function(){var _=this;_.$slides=_.$slider.children(_.options.slide+':not(.slick-cloned)').addClass('slick-slide');_.slideCount=_.$slides.length;_.$slides.each(function(index,element){$(element).attr('data-slick-index',index).data('originalStyling',$(element).attr('style')||'');});_.$slider.addClass('slick-slider');_.$slideTrack=(_.slideCount===0)?$('<div class="slick-track"/>').appendTo(_.$slider):_.$slides.wrapAll('<div class="slick-track"/>').parent();_.$list=_.$slideTrack.wrap('<div aria-live="polite" class="slick-list"/>').parent();_.$slideTrack.css('opacity',0);if(_.options.centerMode===true||_.options.swipeToSlide===true){_.options.slidesToScroll=1;}
$('img[data-lazy]',_.$slider).not('[src]').addClass('slick-loading');_.setupInfinite();_.buildArrows();_.buildDots();_.updateDots();_.setSlideClasses(typeof _.currentSlide==='number'?_.currentSlide:0);if(_.options.draggable===true){_.$list.addClass('draggable');}};Slick.prototype.buildRows=function(){var _=this,a,b,c,newSlides,numOfSlides,originalSlides,slidesPerSection;newSlides=document.createDocumentFragment();originalSlides=_.$slider.children();if(_.options.rows>1){slidesPerSection=_.options.slidesPerRow*_.options.rows;numOfSlides=Math.ceil(originalSlides.length/slidesPerSection);for(a=0;a<numOfSlides;a++){var slide=document.createElement('div');for(b=0;b<_.options.rows;b++){var row=document.createElement('div');for(c=0;c<_.options.slidesPerRow;c++){var target=(a*slidesPerSection+((b*_.options.slidesPerRow)+c));if(originalSlides.get(target)){row.appendChild(originalSlides.get(target));}}
slide.appendChild(row);}
newSlides.appendChild(slide);}
_.$slider.html(newSlides);_.$slider.children().children().children().css({'width':(100/_.options.slidesPerRow)+'%','display':'inline-block'});}};Slick.prototype.checkResponsive=function(initial,forceUpdate){var _=this,breakpoint,targetBreakpoint,respondToWidth,triggerBreakpoint=false;var sliderWidth=_.$slider.width();var windowWidth=window.innerWidth||$(window).width();if(_.respondTo==='window'){respondToWidth=windowWidth;}else if(_.respondTo==='slider'){respondToWidth=sliderWidth;}else if(_.respondTo==='min'){respondToWidth=Math.min(windowWidth,sliderWidth);}
if(_.options.responsive&&_.options.responsive.length&&_.options.responsive!==null){targetBreakpoint=null;for(breakpoint in _.breakpoints){if(_.breakpoints.hasOwnProperty(breakpoint)){if(_.originalSettings.mobileFirst===false){if(respondToWidth<_.breakpoints[breakpoint]){targetBreakpoint=_.breakpoints[breakpoint];}}else{if(respondToWidth>_.breakpoints[breakpoint]){targetBreakpoint=_.breakpoints[breakpoint];}}}}
if(targetBreakpoint!==null){if(_.activeBreakpoint!==null){if(targetBreakpoint!==_.activeBreakpoint||forceUpdate){_.activeBreakpoint=targetBreakpoint;if(_.breakpointSettings[targetBreakpoint]==='unslick'){_.unslick(targetBreakpoint);}else{_.options=$.extend({},_.originalSettings,_.breakpointSettings[targetBreakpoint]);if(initial===true){_.currentSlide=_.options.initialSlide;}
_.refresh(initial);}
triggerBreakpoint=targetBreakpoint;}}else{_.activeBreakpoint=targetBreakpoint;if(_.breakpointSettings[targetBreakpoint]==='unslick'){_.unslick(targetBreakpoint);}else{_.options=$.extend({},_.originalSettings,_.breakpointSettings[targetBreakpoint]);if(initial===true){_.currentSlide=_.options.initialSlide;}
_.refresh(initial);}
triggerBreakpoint=targetBreakpoint;}}else{if(_.activeBreakpoint!==null){_.activeBreakpoint=null;_.options=_.originalSettings;if(initial===true){_.currentSlide=_.options.initialSlide;}
_.refresh(initial);triggerBreakpoint=targetBreakpoint;}}
if(!initial&&triggerBreakpoint!==false){_.$slider.trigger('breakpoint',[_,triggerBreakpoint]);}}};Slick.prototype.changeSlide=function(event,dontAnimate){var _=this,$target=$(event.target),indexOffset,slideOffset,unevenOffset;if($target.is('a')){event.preventDefault();}
if(!$target.is('li')){$target=$target.closest('li');}
unevenOffset=(_.slideCount%_.options.slidesToScroll!==0);indexOffset=unevenOffset?0:(_.slideCount-_.currentSlide)%_.options.slidesToScroll;switch(event.data.message){case'previous':slideOffset=indexOffset===0?_.options.slidesToScroll:_.options.slidesToShow-indexOffset;if(_.slideCount>_.options.slidesToShow){_.slideHandler(_.currentSlide-slideOffset,false,dontAnimate);}
break;case'next':slideOffset=indexOffset===0?_.options.slidesToScroll:indexOffset;if(_.slideCount>_.options.slidesToShow){_.slideHandler(_.currentSlide+slideOffset,false,dontAnimate);}
break;case'index':var index=event.data.index===0?0:event.data.index||$target.index()*_.options.slidesToScroll;_.slideHandler(_.checkNavigable(index),false,dontAnimate);$target.children().trigger('focus');break;default:return;}};Slick.prototype.checkNavigable=function(index){var _=this,navigables,prevNavigable;navigables=_.getNavigableIndexes();prevNavigable=0;if(index>navigables[navigables.length-1]){index=navigables[navigables.length-1];}else{for(var n in navigables){if(index<navigables[n]){index=prevNavigable;break;}
prevNavigable=navigables[n];}}
return index;};Slick.prototype.cleanUpEvents=function(){var _=this;if(_.options.dots&&_.$dots!==null){$('li',_.$dots).off('click.slick',_.changeSlide);if(_.options.pauseOnDotsHover===true&&_.options.autoplay===true){$('li',_.$dots).off('mouseenter.slick',$.proxy(_.setPaused,_,true)).off('mouseleave.slick',$.proxy(_.setPaused,_,false));}}
if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow&&_.$prevArrow.off('click.slick',_.changeSlide);_.$nextArrow&&_.$nextArrow.off('click.slick',_.changeSlide);}
_.$list.off('touchstart.slick mousedown.slick',_.swipeHandler);_.$list.off('touchmove.slick mousemove.slick',_.swipeHandler);_.$list.off('touchend.slick mouseup.slick',_.swipeHandler);_.$list.off('touchcancel.slick mouseleave.slick',_.swipeHandler);_.$list.off('click.slick',_.clickHandler);$(document).off(_.visibilityChange,_.visibility);_.$list.off('mouseenter.slick',$.proxy(_.setPaused,_,true));_.$list.off('mouseleave.slick',$.proxy(_.setPaused,_,false));if(_.options.accessibility===true){_.$list.off('keydown.slick',_.keyHandler);}
if(_.options.focusOnSelect===true){$(_.$slideTrack).children().off('click.slick',_.selectHandler);}
$(window).off('orientationchange.slick.slick-'+_.instanceUid,_.orientationChange);$(window).off('resize.slick.slick-'+_.instanceUid,_.resize);$('[draggable!=true]',_.$slideTrack).off('dragstart',_.preventDefault);$(window).off('load.slick.slick-'+_.instanceUid,_.setPosition);$(document).off('ready.slick.slick-'+_.instanceUid,_.setPosition);};Slick.prototype.cleanUpRows=function(){var _=this,originalSlides;if(_.options.rows>1){originalSlides=_.$slides.children().children();originalSlides.removeAttr('style');_.$slider.html(originalSlides);}};Slick.prototype.clickHandler=function(event){var _=this;if(_.shouldClick===false){event.stopImmediatePropagation();event.stopPropagation();event.preventDefault();}};Slick.prototype.destroy=function(refresh){var _=this;_.autoPlayClear();_.touchObject={};_.cleanUpEvents();$('.slick-cloned',_.$slider).detach();if(_.$dots){_.$dots.remove();}
if(_.$prevArrow&&_.$prevArrow.length){_.$prevArrow.removeClass('slick-disabled slick-arrow slick-hidden').removeAttr('aria-hidden aria-disabled tabindex').css("display","");if(_.htmlExpr.test(_.options.prevArrow)){_.$prevArrow.remove();}}
if(_.$nextArrow&&_.$nextArrow.length){_.$nextArrow.removeClass('slick-disabled slick-arrow slick-hidden').removeAttr('aria-hidden aria-disabled tabindex').css("display","");if(_.htmlExpr.test(_.options.nextArrow)){_.$nextArrow.remove();}}
if(_.$slides){_.$slides.removeClass('slick-slide slick-active slick-center slick-visible slick-current').removeAttr('aria-hidden').removeAttr('data-slick-index').each(function(){$(this).attr('style',$(this).data('originalStyling'));});_.$slideTrack.children(this.options.slide).detach();_.$slideTrack.detach();_.$list.detach();_.$slider.append(_.$slides);}
_.cleanUpRows();_.$slider.removeClass('slick-slider');_.$slider.removeClass('slick-initialized');_.unslicked=true;if(!refresh){_.$slider.trigger('destroy',[_]);}};Slick.prototype.disableTransition=function(slide){var _=this,transition={};transition[_.transitionType]='';if(_.options.fade===false){_.$slideTrack.css(transition);}else{_.$slides.eq(slide).css(transition);}};Slick.prototype.fadeSlide=function(slideIndex,callback){var _=this;if(_.cssTransitions===false){_.$slides.eq(slideIndex).css({zIndex:_.options.zIndex});_.$slides.eq(slideIndex).animate({opacity:1},_.options.speed,_.options.easing,callback);}else{_.applyTransition(slideIndex);_.$slides.eq(slideIndex).css({opacity:1,zIndex:_.options.zIndex});if(callback){setTimeout(function(){_.disableTransition(slideIndex);callback.call();},_.options.speed);}}};Slick.prototype.fadeSlideOut=function(slideIndex){var _=this;if(_.cssTransitions===false){_.$slides.eq(slideIndex).animate({opacity:0,zIndex:_.options.zIndex-2},_.options.speed,_.options.easing);}else{_.applyTransition(slideIndex);_.$slides.eq(slideIndex).css({opacity:0,zIndex:_.options.zIndex-2});}};Slick.prototype.filterSlides=Slick.prototype.slickFilter=function(filter){var _=this;if(filter!==null){_.$slidesCache=_.$slides;_.unload();_.$slideTrack.children(this.options.slide).detach();_.$slidesCache.filter(filter).appendTo(_.$slideTrack);_.reinit();}};Slick.prototype.getCurrent=Slick.prototype.slickCurrentSlide=function(){var _=this;return _.currentSlide;};Slick.prototype.getDotCount=function(){var _=this;var breakPoint=0;var counter=0;var pagerQty=0;if(_.options.infinite===true){while(breakPoint<_.slideCount){++pagerQty;breakPoint=counter+_.options.slidesToScroll;counter+=_.options.slidesToScroll<=_.options.slidesToShow?_.options.slidesToScroll:_.options.slidesToShow;}}else if(_.options.centerMode===true){pagerQty=_.slideCount;}else{while(breakPoint<_.slideCount){++pagerQty;breakPoint=counter+_.options.slidesToScroll;counter+=_.options.slidesToScroll<=_.options.slidesToShow?_.options.slidesToScroll:_.options.slidesToShow;}}
return pagerQty-1;};Slick.prototype.getLeft=function(slideIndex){var _=this,targetLeft,verticalHeight,verticalOffset=0,targetSlide;_.slideOffset=0;verticalHeight=_.$slides.first().outerHeight(true);if(_.options.infinite===true){if(_.slideCount>_.options.slidesToShow){_.slideOffset=(_.slideWidth*_.options.slidesToShow)*-1;verticalOffset=(verticalHeight*_.options.slidesToShow)*-1;}
if(_.slideCount%_.options.slidesToScroll!==0){if(slideIndex+_.options.slidesToScroll>_.slideCount&&_.slideCount>_.options.slidesToShow){if(slideIndex>_.slideCount){_.slideOffset=((_.options.slidesToShow-(slideIndex-_.slideCount))*_.slideWidth)*-1;verticalOffset=((_.options.slidesToShow-(slideIndex-_.slideCount))*verticalHeight)*-1;}else{_.slideOffset=((_.slideCount%_.options.slidesToScroll)*_.slideWidth)*-1;verticalOffset=((_.slideCount%_.options.slidesToScroll)*verticalHeight)*-1;}}}}else{if(slideIndex+_.options.slidesToShow>_.slideCount){_.slideOffset=((slideIndex+_.options.slidesToShow)-_.slideCount)*_.slideWidth;verticalOffset=((slideIndex+_.options.slidesToShow)-_.slideCount)*verticalHeight;}}
if(_.slideCount<=_.options.slidesToShow){_.slideOffset=0;verticalOffset=0;}
if(_.options.centerMode===true&&_.options.infinite===true){_.slideOffset+=_.slideWidth*Math.floor(_.options.slidesToShow/2)-_.slideWidth;}else if(_.options.centerMode===true){_.slideOffset=0;_.slideOffset+=_.slideWidth*Math.floor(_.options.slidesToShow/2);}
if(_.options.vertical===false){targetLeft=((slideIndex*_.slideWidth)*-1)+_.slideOffset;}else{targetLeft=((slideIndex*verticalHeight)*-1)+verticalOffset;}
if(_.options.variableWidth===true){if(_.slideCount<=_.options.slidesToShow||_.options.infinite===false){targetSlide=_.$slideTrack.children('.slick-slide').eq(slideIndex);}else{targetSlide=_.$slideTrack.children('.slick-slide').eq(slideIndex+_.options.slidesToShow);}
if(_.options.rtl===true){if(targetSlide[0]){targetLeft=(_.$slideTrack.width()-targetSlide[0].offsetLeft-targetSlide.width())*-1;}else{targetLeft=0;}}else{targetLeft=targetSlide[0]?targetSlide[0].offsetLeft*-1:0;}
if(_.options.centerMode===true){if(_.slideCount<=_.options.slidesToShow||_.options.infinite===false){targetSlide=_.$slideTrack.children('.slick-slide').eq(slideIndex);}else{targetSlide=_.$slideTrack.children('.slick-slide').eq(slideIndex+_.options.slidesToShow+1);}
if(_.options.rtl===true){if(targetSlide[0]){targetLeft=(_.$slideTrack.width()-targetSlide[0].offsetLeft-targetSlide.width())*-1;}else{targetLeft=0;}}else{targetLeft=targetSlide[0]?targetSlide[0].offsetLeft*-1:0;}
targetLeft+=(_.$list.width()-targetSlide.outerWidth())/2;}}
return targetLeft;};Slick.prototype.getOption=Slick.prototype.slickGetOption=function(option){var _=this;return _.options[option];};Slick.prototype.getNavigableIndexes=function(){var _=this,breakPoint=0,counter=0,indexes=[],max;if(_.options.infinite===false){max=_.slideCount;}else{breakPoint=_.options.slidesToScroll*-1;counter=_.options.slidesToScroll*-1;max=_.slideCount*2;}
while(breakPoint<max){indexes.push(breakPoint);breakPoint=counter+_.options.slidesToScroll;counter+=_.options.slidesToScroll<=_.options.slidesToShow?_.options.slidesToScroll:_.options.slidesToShow;}
return indexes;};Slick.prototype.getSlick=function(){return this;};Slick.prototype.getSlideCount=function(){var _=this,slidesTraversed,swipedSlide,centerOffset;centerOffset=_.options.centerMode===true?_.slideWidth*Math.floor(_.options.slidesToShow/2):0;if(_.options.swipeToSlide===true){_.$slideTrack.find('.slick-slide').each(function(index,slide){if(slide.offsetLeft-centerOffset+($(slide).outerWidth()/2)>(_.swipeLeft*-1)){swipedSlide=slide;return false;}});slidesTraversed=Math.abs($(swipedSlide).attr('data-slick-index')-_.currentSlide)||1;return slidesTraversed;}else{return _.options.slidesToScroll;}};Slick.prototype.goTo=Slick.prototype.slickGoTo=function(slide,dontAnimate){var _=this;_.changeSlide({data:{message:'index',index:parseInt(slide)}},dontAnimate);};Slick.prototype.init=function(creation){var _=this;if(!$(_.$slider).hasClass('slick-initialized')){$(_.$slider).addClass('slick-initialized');_.buildRows();_.buildOut();_.setProps();_.startLoad();_.loadSlider();_.initializeEvents();_.updateArrows();_.updateDots();}
if(creation){_.$slider.trigger('init',[_]);}
if(_.options.accessibility===true){_.initADA();}};Slick.prototype.initArrowEvents=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.on('click.slick',{message:'previous'},_.changeSlide);_.$nextArrow.on('click.slick',{message:'next'},_.changeSlide);}};Slick.prototype.initDotEvents=function(){var _=this;if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){$('li',_.$dots).on('click.slick',{message:'index'},_.changeSlide);}
if(_.options.dots===true&&_.options.pauseOnDotsHover===true&&_.options.autoplay===true){$('li',_.$dots).on('mouseenter.slick',$.proxy(_.setPaused,_,true)).on('mouseleave.slick',$.proxy(_.setPaused,_,false));}};Slick.prototype.initializeEvents=function(){var _=this;_.initArrowEvents();_.initDotEvents();_.$list.on('touchstart.slick mousedown.slick',{action:'start'},_.swipeHandler);_.$list.on('touchmove.slick mousemove.slick',{action:'move'},_.swipeHandler);_.$list.on('touchend.slick mouseup.slick',{action:'end'},_.swipeHandler);_.$list.on('touchcancel.slick mouseleave.slick',{action:'end'},_.swipeHandler);_.$list.on('click.slick',_.clickHandler);$(document).on(_.visibilityChange,$.proxy(_.visibility,_));_.$list.on('mouseenter.slick',$.proxy(_.setPaused,_,true));_.$list.on('mouseleave.slick',$.proxy(_.setPaused,_,false));if(_.options.accessibility===true){_.$list.on('keydown.slick',_.keyHandler);}
if(_.options.focusOnSelect===true){$(_.$slideTrack).children().on('click.slick',_.selectHandler);}
$(window).on('orientationchange.slick.slick-'+_.instanceUid,$.proxy(_.orientationChange,_));$(window).on('resize.slick.slick-'+_.instanceUid,$.proxy(_.resize,_));$('[draggable!=true]',_.$slideTrack).on('dragstart',_.preventDefault);$(window).on('load.slick.slick-'+_.instanceUid,_.setPosition);$(document).on('ready.slick.slick-'+_.instanceUid,_.setPosition);};Slick.prototype.initUI=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.show();_.$nextArrow.show();}
if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){_.$dots.show();}
if(_.options.autoplay===true){_.autoPlay();}};Slick.prototype.keyHandler=function(event){var _=this;if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')){if(event.keyCode===37&&_.options.accessibility===true){_.changeSlide({data:{message:'previous'}});}else if(event.keyCode===39&&_.options.accessibility===true){_.changeSlide({data:{message:'next'}});}}};Slick.prototype.lazyLoad=function(){var _=this,loadRange,cloneRange,rangeStart,rangeEnd;function loadImages(imagesScope){$('img[data-lazy]',imagesScope).each(function(){var image=$(this),imageSource=$(this).attr('data-lazy'),imageToLoad=document.createElement('img');imageToLoad.onload=function(){image.animate({opacity:0},100,function(){image.attr('src',imageSource).animate({opacity:1},200,function(){image.removeAttr('data-lazy').removeClass('slick-loading');});});};imageToLoad.src=imageSource;});}
if(_.options.centerMode===true){if(_.options.infinite===true){rangeStart=_.currentSlide+(_.options.slidesToShow/2+1);rangeEnd=rangeStart+_.options.slidesToShow+2;}else{rangeStart=Math.max(0,_.currentSlide-(_.options.slidesToShow/2+1));rangeEnd=2+(_.options.slidesToShow/2+1)+_.currentSlide;}}else{rangeStart=_.options.infinite?_.options.slidesToShow+_.currentSlide:_.currentSlide;rangeEnd=rangeStart+_.options.slidesToShow;if(_.options.fade===true){if(rangeStart>0)rangeStart--;if(rangeEnd<=_.slideCount)rangeEnd++;}}
loadRange=_.$slider.find('.slick-slide').slice(rangeStart,rangeEnd);loadImages(loadRange);if(_.slideCount<=_.options.slidesToShow){cloneRange=_.$slider.find('.slick-slide');loadImages(cloneRange);}else
if(_.currentSlide>=_.slideCount-_.options.slidesToShow){cloneRange=_.$slider.find('.slick-cloned').slice(0,_.options.slidesToShow);loadImages(cloneRange);}else if(_.currentSlide===0){cloneRange=_.$slider.find('.slick-cloned').slice(_.options.slidesToShow*-1);loadImages(cloneRange);}};Slick.prototype.loadSlider=function(){var _=this;_.setPosition();_.$slideTrack.css({opacity:1});_.$slider.removeClass('slick-loading');_.initUI();if(_.options.lazyLoad==='progressive'){_.progressiveLazyLoad();}};Slick.prototype.next=Slick.prototype.slickNext=function(){var _=this;_.changeSlide({data:{message:'next'}});};Slick.prototype.orientationChange=function(){var _=this;_.checkResponsive();_.setPosition();};Slick.prototype.pause=Slick.prototype.slickPause=function(){var _=this;_.autoPlayClear();_.paused=true;};Slick.prototype.play=Slick.prototype.slickPlay=function(){var _=this;_.paused=false;_.autoPlay();};Slick.prototype.postSlide=function(index){var _=this;_.$slider.trigger('afterChange',[_,index]);_.animating=false;_.setPosition();_.swipeLeft=null;if(_.options.autoplay===true&&_.paused===false){_.autoPlay();}
if(_.options.accessibility===true){_.initADA();}};Slick.prototype.prev=Slick.prototype.slickPrev=function(){var _=this;_.changeSlide({data:{message:'previous'}});};Slick.prototype.preventDefault=function(event){event.preventDefault();};Slick.prototype.progressiveLazyLoad=function(){var _=this,imgCount,targetImage;imgCount=$('img[data-lazy]',_.$slider).length;if(imgCount>0){targetImage=$('img[data-lazy]',_.$slider).first();targetImage.attr('src',null);targetImage.attr('src',targetImage.attr('data-lazy')).removeClass('slick-loading').load(function(){targetImage.removeAttr('data-lazy');_.progressiveLazyLoad();if(_.options.adaptiveHeight===true){_.setPosition();}}).error(function(){targetImage.removeAttr('data-lazy');_.progressiveLazyLoad();});}};Slick.prototype.refresh=function(initializing){var _=this,currentSlide,firstVisible;firstVisible=_.slideCount-_.options.slidesToShow;if(!_.options.infinite){if(_.slideCount<=_.options.slidesToShow){_.currentSlide=0;}else if(_.currentSlide>firstVisible){_.currentSlide=firstVisible;}}
currentSlide=_.currentSlide;_.destroy(true);$.extend(_,_.initials,{currentSlide:currentSlide});_.init();if(!initializing){_.changeSlide({data:{message:'index',index:currentSlide}},false);}};Slick.prototype.registerBreakpoints=function(){var _=this,breakpoint,currentBreakpoint,l,responsiveSettings=_.options.responsive||null;if($.type(responsiveSettings)==="array"&&responsiveSettings.length){_.respondTo=_.options.respondTo||'window';for(breakpoint in responsiveSettings){l=_.breakpoints.length-1;currentBreakpoint=responsiveSettings[breakpoint].breakpoint;if(responsiveSettings.hasOwnProperty(breakpoint)){while(l>=0){if(_.breakpoints[l]&&_.breakpoints[l]===currentBreakpoint){_.breakpoints.splice(l,1);}
l--;}
_.breakpoints.push(currentBreakpoint);_.breakpointSettings[currentBreakpoint]=responsiveSettings[breakpoint].settings;}}
_.breakpoints.sort(function(a,b){return(_.options.mobileFirst)?a-b:b-a;});}};Slick.prototype.reinit=function(){var _=this;_.$slides=_.$slideTrack.children(_.options.slide).addClass('slick-slide');_.slideCount=_.$slides.length;if(_.currentSlide>=_.slideCount&&_.currentSlide!==0){_.currentSlide=_.currentSlide-_.options.slidesToScroll;}
if(_.slideCount<=_.options.slidesToShow){_.currentSlide=0;}
_.registerBreakpoints();_.setProps();_.setupInfinite();_.buildArrows();_.updateArrows();_.initArrowEvents();_.buildDots();_.updateDots();_.initDotEvents();_.checkResponsive(false,true);if(_.options.focusOnSelect===true){$(_.$slideTrack).children().on('click.slick',_.selectHandler);}
_.setSlideClasses(0);_.setPosition();_.$slider.trigger('reInit',[_]);if(_.options.autoplay===true){_.focusHandler();}};Slick.prototype.resize=function(){var _=this;if($(window).width()!==_.windowWidth){clearTimeout(_.windowDelay);_.windowDelay=window.setTimeout(function(){_.windowWidth=$(window).width();_.checkResponsive();if(!_.unslicked){_.setPosition();}},50);}};Slick.prototype.removeSlide=Slick.prototype.slickRemove=function(index,removeBefore,removeAll){var _=this;if(typeof(index)==='boolean'){removeBefore=index;index=removeBefore===true?0:_.slideCount-1;}else{index=removeBefore===true?--index:index;}
if(_.slideCount<1||index<0||index>_.slideCount-1){return false;}
_.unload();if(removeAll===true){_.$slideTrack.children().remove();}else{_.$slideTrack.children(this.options.slide).eq(index).remove();}
_.$slides=_.$slideTrack.children(this.options.slide);_.$slideTrack.children(this.options.slide).detach();_.$slideTrack.append(_.$slides);_.$slidesCache=_.$slides;_.reinit();};Slick.prototype.setCSS=function(position){var _=this,positionProps={},x,y;if(_.options.rtl===true){position=-position;}
x=_.positionProp=='left'?Math.ceil(position)+'px':'0px';y=_.positionProp=='top'?Math.ceil(position)+'px':'0px';positionProps[_.positionProp]=position;if(_.transformsEnabled===false){_.$slideTrack.css(positionProps);}else{positionProps={};if(_.cssTransitions===false){positionProps[_.animType]='translate('+x+', '+y+')';_.$slideTrack.css(positionProps);}else{positionProps[_.animType]='translate3d('+x+', '+y+', 0px)';_.$slideTrack.css(positionProps);}}};Slick.prototype.setDimensions=function(){var _=this;if(_.options.vertical===false){if(_.options.centerMode===true){_.$list.css({padding:('0px '+_.options.centerPadding)});}}else{_.$list.height(_.$slides.first().outerHeight(true)*_.options.slidesToShow);if(_.options.centerMode===true){_.$list.css({padding:(_.options.centerPadding+' 0px')});}}
_.listWidth=_.$list.width();_.listHeight=_.$list.height();if(_.options.vertical===false&&_.options.variableWidth===false){_.slideWidth=Math.ceil(_.listWidth/_.options.slidesToShow);_.$slideTrack.width(Math.ceil((_.slideWidth*_.$slideTrack.children('.slick-slide').length)));}else if(_.options.variableWidth===true){_.$slideTrack.width(5000*_.slideCount);}else{_.slideWidth=Math.ceil(_.listWidth);_.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true)*_.$slideTrack.children('.slick-slide').length)));}
var offset=_.$slides.first().outerWidth(true)-_.$slides.first().width();if(_.options.variableWidth===false)_.$slideTrack.children('.slick-slide').width(_.slideWidth-offset);};Slick.prototype.setFade=function(){var _=this,targetLeft;_.$slides.each(function(index,element){targetLeft=(_.slideWidth*index)*-1;if(_.options.rtl===true){$(element).css({position:'relative',right:targetLeft,top:0,zIndex:_.options.zIndex-2,opacity:0});}else{$(element).css({position:'relative',left:targetLeft,top:0,zIndex:_.options.zIndex-2,opacity:0});}});_.$slides.eq(_.currentSlide).css({zIndex:_.options.zIndex-1,opacity:1});};Slick.prototype.setHeight=function(){var _=this;if(_.options.slidesToShow===1&&_.options.adaptiveHeight===true&&_.options.vertical===false){var targetHeight=_.$slides.eq(_.currentSlide).outerHeight(true);_.$list.css('height',targetHeight);}};Slick.prototype.setOption=Slick.prototype.slickSetOption=function(option,value,refresh){var _=this,l,item;if(option==="responsive"&&$.type(value)==="array"){for(item in value){if($.type(_.options.responsive)!=="array"){_.options.responsive=[value[item]];}else{l=_.options.responsive.length-1;while(l>=0){if(_.options.responsive[l].breakpoint===value[item].breakpoint){_.options.responsive.splice(l,1);}
l--;}
_.options.responsive.push(value[item]);}}}else{_.options[option]=value;}
if(refresh===true){_.unload();_.reinit();}};Slick.prototype.setPosition=function(){var _=this;_.setDimensions();_.setHeight();if(_.options.fade===false){_.setCSS(_.getLeft(_.currentSlide));}else{_.setFade();}
_.$slider.trigger('setPosition',[_]);};Slick.prototype.setProps=function(){var _=this,bodyStyle=document.body.style;_.positionProp=_.options.vertical===true?'top':'left';if(_.positionProp==='top'){_.$slider.addClass('slick-vertical');}else{_.$slider.removeClass('slick-vertical');}
if(bodyStyle.WebkitTransition!==undefined||bodyStyle.MozTransition!==undefined||bodyStyle.msTransition!==undefined){if(_.options.useCSS===true){_.cssTransitions=true;}}
if(_.options.fade){if(typeof _.options.zIndex==='number'){if(_.options.zIndex<3){_.options.zIndex=3;}}else{_.options.zIndex=_.defaults.zIndex;}}
if(bodyStyle.OTransform!==undefined){_.animType='OTransform';_.transformType='-o-transform';_.transitionType='OTransition';if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.webkitPerspective===undefined)_.animType=false;}
if(bodyStyle.MozTransform!==undefined){_.animType='MozTransform';_.transformType='-moz-transform';_.transitionType='MozTransition';if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.MozPerspective===undefined)_.animType=false;}
if(bodyStyle.webkitTransform!==undefined){_.animType='webkitTransform';_.transformType='-webkit-transform';_.transitionType='webkitTransition';if(bodyStyle.perspectiveProperty===undefined&&bodyStyle.webkitPerspective===undefined)_.animType=false;}
if(bodyStyle.msTransform!==undefined){_.animType='msTransform';_.transformType='-ms-transform';_.transitionType='msTransition';if(bodyStyle.msTransform===undefined)_.animType=false;}
if(bodyStyle.transform!==undefined&&_.animType!==false){_.animType='transform';_.transformType='transform';_.transitionType='transition';}
_.transformsEnabled=_.options.useTransform&&(_.animType!==null&&_.animType!==false);};Slick.prototype.setSlideClasses=function(index){var _=this,centerOffset,allSlides,indexOffset,remainder;allSlides=_.$slider.find('.slick-slide').removeClass('slick-active slick-center slick-current').attr('aria-hidden','true');_.$slides.eq(index).addClass('slick-current');if(_.options.centerMode===true){centerOffset=Math.floor(_.options.slidesToShow/2);if(_.options.infinite===true){if(index>=centerOffset&&index<=(_.slideCount-1)-centerOffset){_.$slides.slice(index-centerOffset,index+centerOffset+1).addClass('slick-active').attr('aria-hidden','false');}else{indexOffset=_.options.slidesToShow+index;allSlides.slice(indexOffset-centerOffset+1,indexOffset+centerOffset+2).addClass('slick-active').attr('aria-hidden','false');}
if(index===0){allSlides.eq(allSlides.length-1-_.options.slidesToShow).addClass('slick-center');}else if(index===_.slideCount-1){allSlides.eq(_.options.slidesToShow).addClass('slick-center');}}
_.$slides.eq(index).addClass('slick-center');}else{if(index>=0&&index<=(_.slideCount-_.options.slidesToShow)){_.$slides.slice(index,index+_.options.slidesToShow).addClass('slick-active').attr('aria-hidden','false');}else if(allSlides.length<=_.options.slidesToShow){allSlides.addClass('slick-active').attr('aria-hidden','false');}else{remainder=_.slideCount%_.options.slidesToShow;indexOffset=_.options.infinite===true?_.options.slidesToShow+index:index;if(_.options.slidesToShow==_.options.slidesToScroll&&(_.slideCount-index)<_.options.slidesToShow){allSlides.slice(indexOffset-(_.options.slidesToShow-remainder),indexOffset+remainder).addClass('slick-active').attr('aria-hidden','false');}else{allSlides.slice(indexOffset,indexOffset+_.options.slidesToShow).addClass('slick-active').attr('aria-hidden','false');}}}
if(_.options.lazyLoad==='ondemand'){_.lazyLoad();}};Slick.prototype.setupInfinite=function(){var _=this,i,slideIndex,infiniteCount;if(_.options.fade===true){_.options.centerMode=false;}
if(_.options.infinite===true&&_.options.fade===false){slideIndex=null;if(_.slideCount>_.options.slidesToShow){if(_.options.centerMode===true){infiniteCount=_.options.slidesToShow+1;}else{infiniteCount=_.options.slidesToShow;}
for(i=_.slideCount;i>(_.slideCount-
infiniteCount);i-=1){slideIndex=i-1;$(_.$slides[slideIndex]).clone(true).attr('id','').attr('data-slick-index',slideIndex-_.slideCount).prependTo(_.$slideTrack).addClass('slick-cloned');}
for(i=0;i<infiniteCount;i+=1){slideIndex=i;$(_.$slides[slideIndex]).clone(true).attr('id','').attr('data-slick-index',slideIndex+_.slideCount).appendTo(_.$slideTrack).addClass('slick-cloned');}
_.$slideTrack.find('.slick-cloned').find('[id]').each(function(){$(this).attr('id','');});}}};Slick.prototype.setPaused=function(paused){var _=this;if(_.options.autoplay===true&&_.options.pauseOnHover===true){_.paused=paused;if(!paused){_.autoPlay();}else{_.autoPlayClear();}}};Slick.prototype.selectHandler=function(event){var _=this;var targetElement=$(event.target).is('.slick-slide')?$(event.target):$(event.target).parents('.slick-slide');var index=parseInt(targetElement.attr('data-slick-index'));if(!index)index=0;if(_.slideCount<=_.options.slidesToShow){_.setSlideClasses(index);_.asNavFor(index);return;}
_.slideHandler(index);};Slick.prototype.slideHandler=function(index,sync,dontAnimate){var targetSlide,animSlide,oldSlide,slideLeft,targetLeft=null,_=this;sync=sync||false;if(_.animating===true&&_.options.waitForAnimate===true){return;}
if(_.options.fade===true&&_.currentSlide===index){return;}
if(_.slideCount<=_.options.slidesToShow){return;}
if(sync===false){_.asNavFor(index);}
targetSlide=index;targetLeft=_.getLeft(targetSlide);slideLeft=_.getLeft(_.currentSlide);_.currentLeft=_.swipeLeft===null?slideLeft:_.swipeLeft;if(_.options.infinite===false&&_.options.centerMode===false&&(index<0||index>_.getDotCount()*_.options.slidesToScroll)){if(_.options.fade===false){targetSlide=_.currentSlide;if(dontAnimate!==true){_.animateSlide(slideLeft,function(){_.postSlide(targetSlide);});}else{_.postSlide(targetSlide);}}
return;}else if(_.options.infinite===false&&_.options.centerMode===true&&(index<0||index>(_.slideCount-_.options.slidesToScroll))){if(_.options.fade===false){targetSlide=_.currentSlide;if(dontAnimate!==true){_.animateSlide(slideLeft,function(){_.postSlide(targetSlide);});}else{_.postSlide(targetSlide);}}
return;}
if(_.options.autoplay===true){clearInterval(_.autoPlayTimer);}
if(targetSlide<0){if(_.slideCount%_.options.slidesToScroll!==0){animSlide=_.slideCount-(_.slideCount%_.options.slidesToScroll);}else{animSlide=_.slideCount+targetSlide;}}else if(targetSlide>=_.slideCount){if(_.slideCount%_.options.slidesToScroll!==0){animSlide=0;}else{animSlide=targetSlide-_.slideCount;}}else{animSlide=targetSlide;}
_.animating=true;_.$slider.trigger('beforeChange',[_,_.currentSlide,animSlide]);oldSlide=_.currentSlide;_.currentSlide=animSlide;_.setSlideClasses(_.currentSlide);_.updateDots();_.updateArrows();if(_.options.fade===true){if(dontAnimate!==true){_.fadeSlideOut(oldSlide);_.fadeSlide(animSlide,function(){_.postSlide(animSlide);});}else{_.postSlide(animSlide);}
_.animateHeight();return;}
if(dontAnimate!==true){_.animateSlide(targetLeft,function(){_.postSlide(animSlide);});}else{_.postSlide(animSlide);}};Slick.prototype.startLoad=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.hide();_.$nextArrow.hide();}
if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){_.$dots.hide();}
_.$slider.addClass('slick-loading');};Slick.prototype.swipeDirection=function(){var xDist,yDist,r,swipeAngle,_=this;xDist=_.touchObject.startX-_.touchObject.curX;yDist=_.touchObject.startY-_.touchObject.curY;r=Math.atan2(yDist,xDist);swipeAngle=Math.round(r*180/Math.PI);if(swipeAngle<0){swipeAngle=360-Math.abs(swipeAngle);}
if((swipeAngle<=45)&&(swipeAngle>=0)){return(_.options.rtl===false?'left':'right');}
if((swipeAngle<=360)&&(swipeAngle>=315)){return(_.options.rtl===false?'left':'right');}
if((swipeAngle>=135)&&(swipeAngle<=225)){return(_.options.rtl===false?'right':'left');}
if(_.options.verticalSwiping===true){if((swipeAngle>=35)&&(swipeAngle<=135)){return'left';}else{return'right';}}
return'vertical';};Slick.prototype.swipeEnd=function(event){var _=this,slideCount;_.dragging=false;_.shouldClick=(_.touchObject.swipeLength>10)?false:true;if(_.touchObject.curX===undefined){return false;}
if(_.touchObject.edgeHit===true){_.$slider.trigger('edge',[_,_.swipeDirection()]);}
if(_.touchObject.swipeLength>=_.touchObject.minSwipe){switch(_.swipeDirection()){case'left':slideCount=_.options.swipeToSlide?_.checkNavigable(_.currentSlide+_.getSlideCount()):_.currentSlide+_.getSlideCount();_.slideHandler(slideCount);_.currentDirection=0;_.touchObject={};_.$slider.trigger('swipe',[_,'left']);break;case'right':slideCount=_.options.swipeToSlide?_.checkNavigable(_.currentSlide-_.getSlideCount()):_.currentSlide-_.getSlideCount();_.slideHandler(slideCount);_.currentDirection=1;_.touchObject={};_.$slider.trigger('swipe',[_,'right']);break;}}else{if(_.touchObject.startX!==_.touchObject.curX){_.slideHandler(_.currentSlide);_.touchObject={};}}};Slick.prototype.swipeHandler=function(event){var _=this;if((_.options.swipe===false)||('ontouchend'in document&&_.options.swipe===false)){return;}else if(_.options.draggable===false&&event.type.indexOf('mouse')!==-1){return;}
_.touchObject.fingerCount=event.originalEvent&&event.originalEvent.touches!==undefined?event.originalEvent.touches.length:1;_.touchObject.minSwipe=_.listWidth/_.options.touchThreshold;if(_.options.verticalSwiping===true){_.touchObject.minSwipe=_.listHeight/_.options.touchThreshold;}
switch(event.data.action){case'start':_.swipeStart(event);break;case'move':_.swipeMove(event);break;case'end':_.swipeEnd(event);break;}};Slick.prototype.swipeMove=function(event){var _=this,edgeWasHit=false,curLeft,swipeDirection,swipeLength,positionOffset,touches;touches=event.originalEvent!==undefined?event.originalEvent.touches:null;if(!_.dragging||touches&&touches.length!==1){return false;}
curLeft=_.getLeft(_.currentSlide);_.touchObject.curX=touches!==undefined?touches[0].pageX:event.clientX;_.touchObject.curY=touches!==undefined?touches[0].pageY:event.clientY;_.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(_.touchObject.curX-_.touchObject.startX,2)));if(_.options.verticalSwiping===true){_.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(_.touchObject.curY-_.touchObject.startY,2)));}
swipeDirection=_.swipeDirection();if(swipeDirection==='vertical'){return;}
if(event.originalEvent!==undefined&&_.touchObject.swipeLength>4){event.preventDefault();}
positionOffset=(_.options.rtl===false?1:-1)*(_.touchObject.curX>_.touchObject.startX?1:-1);if(_.options.verticalSwiping===true){positionOffset=_.touchObject.curY>_.touchObject.startY?1:-1;}
swipeLength=_.touchObject.swipeLength;_.touchObject.edgeHit=false;if(_.options.infinite===false){if((_.currentSlide===0&&swipeDirection==='right')||(_.currentSlide>=_.getDotCount()&&swipeDirection==='left')){swipeLength=_.touchObject.swipeLength*_.options.edgeFriction;_.touchObject.edgeHit=true;}}
if(_.options.vertical===false){_.swipeLeft=curLeft+swipeLength*positionOffset;}else{_.swipeLeft=curLeft+(swipeLength*(_.$list.height()/_.listWidth))*positionOffset;}
if(_.options.verticalSwiping===true){_.swipeLeft=curLeft+swipeLength*positionOffset;}
if(_.options.fade===true||_.options.touchMove===false){return false;}
if(_.animating===true){_.swipeLeft=null;return false;}
_.setCSS(_.swipeLeft);};Slick.prototype.swipeStart=function(event){var _=this,touches;if(_.touchObject.fingerCount!==1||_.slideCount<=_.options.slidesToShow){_.touchObject={};return false;}
if(event.originalEvent!==undefined&&event.originalEvent.touches!==undefined){touches=event.originalEvent.touches[0];}
_.touchObject.startX=_.touchObject.curX=touches!==undefined?touches.pageX:event.clientX;_.touchObject.startY=_.touchObject.curY=touches!==undefined?touches.pageY:event.clientY;_.dragging=true;};Slick.prototype.unfilterSlides=Slick.prototype.slickUnfilter=function(){var _=this;if(_.$slidesCache!==null){_.unload();_.$slideTrack.children(this.options.slide).detach();_.$slidesCache.appendTo(_.$slideTrack);_.reinit();}};Slick.prototype.unload=function(){var _=this;$('.slick-cloned',_.$slider).remove();if(_.$dots){_.$dots.remove();}
if(_.$prevArrow&&_.htmlExpr.test(_.options.prevArrow)){_.$prevArrow.remove();}
if(_.$nextArrow&&_.htmlExpr.test(_.options.nextArrow)){_.$nextArrow.remove();}
_.$slides.removeClass('slick-slide slick-active slick-visible slick-current').attr('aria-hidden','true').css('width','');};Slick.prototype.unslick=function(fromBreakpoint){var _=this;_.$slider.trigger('unslick',[_,fromBreakpoint]);_.destroy();};Slick.prototype.updateArrows=function(){var _=this,centerOffset;centerOffset=Math.floor(_.options.slidesToShow/2);if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow&&!_.options.infinite){_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled','false');_.$nextArrow.removeClass('slick-disabled').attr('aria-disabled','false');if(_.currentSlide===0){_.$prevArrow.addClass('slick-disabled').attr('aria-disabled','true');_.$nextArrow.removeClass('slick-disabled').attr('aria-disabled','false');}else if(_.currentSlide>=_.slideCount-_.options.slidesToShow&&_.options.centerMode===false){_.$nextArrow.addClass('slick-disabled').attr('aria-disabled','true');_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled','false');}else if(_.currentSlide>=_.slideCount-1&&_.options.centerMode===true){_.$nextArrow.addClass('slick-disabled').attr('aria-disabled','true');_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled','false');}}};Slick.prototype.updateDots=function(){var _=this;if(_.$dots!==null){_.$dots.find('li').removeClass('slick-active').attr('aria-hidden','true');_.$dots.find('li').eq(Math.floor(_.currentSlide/_.options.slidesToScroll)).addClass('slick-active').attr('aria-hidden','false');}};Slick.prototype.visibility=function(){var _=this;if(document[_.hidden]){_.paused=true;_.autoPlayClear();}else{if(_.options.autoplay===true){_.paused=false;_.autoPlay();}}};Slick.prototype.initADA=function(){var _=this;_.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({'aria-hidden':'true','tabindex':'-1'}).find('a, input, button, select').attr({'tabindex':'-1'});_.$slideTrack.attr('role','listbox');_.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i){$(this).attr({'role':'option','aria-describedby':'slick-slide'+_.instanceUid+i+''});});if(_.$dots!==null){_.$dots.attr('role','tablist').find('li').each(function(i){$(this).attr({'role':'presentation','aria-selected':'false','aria-controls':'navigation'+_.instanceUid+i+'','id':'slick-slide'+_.instanceUid+i+''});}).first().attr('aria-selected','true').end().find('button').attr('role','button').end().closest('div').attr('role','toolbar');}
_.activateADA();};Slick.prototype.activateADA=function(){var _=this;_.$slideTrack.find('.slick-active').attr({'aria-hidden':'false'}).find('a, input, button, select').attr({'tabindex':'0'});};Slick.prototype.focusHandler=function(){var _=this;_.$slider.on('focus.slick blur.slick','*',function(event){event.stopImmediatePropagation();var sf=$(this);setTimeout(function(){if(_.isPlay){if(sf.is(':focus')){_.autoPlayClear();_.paused=true;}else{_.paused=false;_.autoPlay();}}},0);});};$.fn.slick=function(){var _=this,opt=arguments[0],args=Array.prototype.slice.call(arguments,1),l=_.length,i,ret;for(i=0;i<l;i++){if(typeof opt=='object'||typeof opt=='undefined')
_[i].slick=new Slick(_[i],opt);else
ret=_[i].slick[opt].apply(_[i].slick,args);if(typeof ret!='undefined')return ret;}
return _;};}));;;(function(root,factory){if(typeof module=='object'&&module.exports)module.exports=factory()
else if(typeof define=='function'&&define.amd)define(factory)
else root.Spinner=factory()}(this,function(){"use strict"
var prefixes=['webkit','Moz','ms','O'],animations={},useCssAnimations,sheet
function createEl(tag,prop){var el=document.createElement(tag||'div'),n
for(n in prop)el[n]=prop[n]
return el}
function ins(parent){for(var i=1,n=arguments.length;i<n;i++){parent.appendChild(arguments[i])}
return parent}
function addAnimation(alpha,trail,i,lines){var name=['opacity',trail,~~(alpha*100),i,lines].join('-'),start=0.01+i/lines*100,z=Math.max(1-(1-alpha)/trail*(100-start),alpha),prefix=useCssAnimations.substring(0,useCssAnimations.indexOf('Animation')).toLowerCase(),pre=prefix&&'-'+prefix+'-'||''
if(!animations[name]){sheet.insertRule('@'+pre+'keyframes '+name+'{'+'0%{opacity:'+z+'}'+
start+'%{opacity:'+alpha+'}'+
(start+0.01)+'%{opacity:1}'+
(start+trail)%100+'%{opacity:'+alpha+'}'+'100%{opacity:'+z+'}'+'}',sheet.cssRules.length)
animations[name]=1}
return name}
function vendor(el,prop){var s=el.style,pp,i
prop=prop.charAt(0).toUpperCase()+prop.slice(1)
if(s[prop]!==undefined)return prop
for(i=0;i<prefixes.length;i++){pp=prefixes[i]+prop
if(s[pp]!==undefined)return pp}}
function css(el,prop){for(var n in prop){el.style[vendor(el,n)||n]=prop[n]}
return el}
function merge(obj){for(var i=1;i<arguments.length;i++){var def=arguments[i]
for(var n in def){if(obj[n]===undefined)obj[n]=def[n]}}
return obj}
function getColor(color,idx){return typeof color=='string'?color:color[idx%color.length]}
var defaults={lines:12,length:7,width:5,radius:10,scale:1.0,corners:1,color:'#000',opacity:1/4,rotate:0,direction:1,speed:1,trail:100,fps:20,zIndex:2e9,className:'spinner',top:'50%',left:'50%',shadow:false,hwaccel:false,position:'absolute'}
function Spinner(o){this.opts=merge(o||{},Spinner.defaults,defaults)}
Spinner.defaults={}
merge(Spinner.prototype,{spin:function(target){this.stop()
var self=this,o=self.opts,el=self.el=createEl(null,{className:o.className})
css(el,{position:o.position,width:0,zIndex:o.zIndex,left:o.left,top:o.top})
if(target){target.insertBefore(el,target.firstChild||null)}
el.setAttribute('role','progressbar')
self.lines(el,self.opts)
if(!useCssAnimations){var i=0,start=(o.lines-1)*(1-o.direction)/2,alpha,fps=o.fps,f=fps/o.speed,ostep=(1-o.opacity)/(f*o.trail/100),astep=f/o.lines;(function anim(){i++
for(var j=0;j<o.lines;j++){alpha=Math.max(1-(i+(o.lines-j)*astep)%f*ostep,o.opacity)
self.opacity(el,j*o.direction+start,alpha,o)}
self.timeout=self.el&&setTimeout(anim,~~(1000/fps))})()}
return self},stop:function(){var el=this.el
if(el){clearTimeout(this.timeout)
if(el.parentNode)el.parentNode.removeChild(el)
this.el=undefined}
return this},lines:function(el,o){var i=0,start=(o.lines-1)*(1-o.direction)/2,seg
function fill(color,shadow){return css(createEl(),{position:'absolute',width:o.scale*(o.length+o.width)+'px',height:o.scale*o.width+'px',background:color,boxShadow:shadow,transformOrigin:'left',transform:'rotate('+~~(360/o.lines*i+o.rotate)+'deg) translate('+o.scale*o.radius+'px'+',0)',borderRadius:(o.corners*o.scale*o.width>>1)+'px'})}
for(;i<o.lines;i++){seg=css(createEl(),{position:'absolute',top:1+~(o.scale*o.width/2)+'px',transform:o.hwaccel?'translate3d(0,0,0)':'',opacity:o.opacity,animation:useCssAnimations&&addAnimation(o.opacity,o.trail,start+i*o.direction,o.lines)+' '+1/o.speed+'s linear infinite'})
if(o.shadow)ins(seg,css(fill('#000','0 0 4px #000'),{top:'2px'}))
ins(el,ins(seg,fill(getColor(o.color,i),'0 0 1px rgba(0,0,0,.1)')))}
return el},opacity:function(el,i,val){if(i<el.childNodes.length)el.childNodes[i].style.opacity=val}})
function initVML(){function vml(tag,attr){return createEl('<'+tag+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',attr)}
sheet.addRule('.spin-vml','behavior:url(#default#VML)')
Spinner.prototype.lines=function(el,o){var r=o.scale*(o.length+o.width),s=o.scale*2*r
function grp(){return css(vml('group',{coordsize:s+' '+s,coordorigin:-r+' '+-r}),{width:s,height:s})}
var margin=-(o.width+o.length)*o.scale*2+'px',g=css(grp(),{position:'absolute',top:margin,left:margin}),i
function seg(i,dx,filter){ins(g,ins(css(grp(),{rotation:360/o.lines*i+'deg',left:~~dx}),ins(css(vml('roundrect',{arcsize:o.corners}),{width:r,height:o.scale*o.width,left:o.scale*o.radius,top:-o.scale*o.width>>1,filter:filter}),vml('fill',{color:getColor(o.color,i),opacity:o.opacity}),vml('stroke',{opacity:0}))))}
if(o.shadow)
for(i=1;i<=o.lines;i++){seg(i,-2,'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)')}
for(i=1;i<=o.lines;i++)seg(i)
return ins(el,g)}
Spinner.prototype.opacity=function(el,i,val,o){var c=el.firstChild
o=o.shadow&&o.lines||0
if(c&&i+o<c.childNodes.length){c=c.childNodes[i+o];c=c&&c.firstChild;c=c&&c.firstChild
if(c)c.opacity=val}}}
if(typeof document!=='undefined'){sheet=(function(){var el=createEl('style',{type:'text/css'})
ins(document.getElementsByTagName('head')[0],el)
return el.sheet||el.styleSheet}())
var probe=css(createEl('group'),{behavior:'url(#default#VML)'})
if(!vendor(probe,'transform')&&probe.adj)initVML()
else useCssAnimations=vendor(probe,'animation')}
return Spinner}));;'use strict';$('body').on('click','.option li',function(e){var i=$(this).parents('.select').attr('id'),v=$(this).children().text(),o=$(this).attr('id');$('#'+i+' .selected').attr('id',o).text(v);});function formatSize(size){var fileSize=Math.round(size/1024),suffix='KB',fileSizeParts;if(fileSize>1000){fileSize=Math.round(fileSize/1000);suffix='MB';}
fileSizeParts=fileSize.toString().split('.');fileSize=fileSizeParts[0];if(fileSizeParts.length>1){fileSize+='.'+fileSizeParts[1].substr(0,2);}
fileSize+=suffix;return fileSize;}
function getCategoryMenu(categoryId,success){var xx={};var io=$.evo.io();io.call('getCategoryMenu',[categoryId],xx,function(error,data){if(error){console.error(data);}
else{if(typeof success==='function'){success(xx.response);}}});return true;}
function categoryMenu(rootcategory){if(typeof rootcategory==='undefined'){rootcategory=$('.sidebar-offcanvas .navbar-categories').html();}
$('.sidebar-offcanvas li a.nav-sub').on('click',function(e){var navbar=$('.sidebar-offcanvas .navbar-categories'),ref=$(this).data('ref');if(ref===0){$(navbar).html(rootcategory);categoryMenu(rootcategory);}
else{getCategoryMenu(ref,function(data){$(navbar).html(data);categoryMenu(rootcategory);});}
return false;});}
function compatibility(){var __enforceFocus=$.fn.modal.Constructor.prototype.enforceFocus;$.fn.modal.Constructor.prototype.enforceFocus=function(){if($('.modal-body .g-recaptcha').length==0){__enforceFocus.apply(this,arguments);}};}
function regionsToState(){if($('#state').length==0)
return;var title=$('#state').attr('title');if($('#state').attr('required')=='required'){var stateIsRequired=true;}else{var stateIsRequired=false;}
$('#country').change(function(){var result={};var io=$.evo.io();var val=$(this).find(':selected').val();io.call('getRegionsByCountry',[val],result,function(error,data){if(error){console.error(data);}
else{var data=result.response;var def=$('#state').val();if(data!=null&&data.length>0){if(stateIsRequired){var state=$('<select />').attr({id:'state',name:'bundesland',class:'required form-control',required:'required'});}else{var state=$('<select />').attr({id:'state',name:'bundesland',class:'form-control'});}
state.append('<option value="">'+title+'</option>');$(data).each(function(idx,item){state.append($('<option></option>').val(item.cCode).html(item.cName).attr('selected',item.cCode==def||item.cName==def?'selected':false));});$('#state').replaceWith(state);}
else{if(stateIsRequired){var state=$('<input />').attr({type:'text',id:'state',name:'bundesland',class:'required form-control',placeholder:title,required:'required'});}else{var state=$('<input />').attr({type:'text',id:'state',name:'bundesland',class:'form-control',placeholder:title});}
$('#state').replaceWith(state);}}});return false;}).trigger('change');}
function loadContent(url)
{$.evo.extended().loadContent(url,function(){$.evo.extended().register();$('html,body').animate({scrollTop:$('.list-pageinfo').offset().top-$('#evo-main-nav-wrapper').outerHeight()-10},100);});}
function navigation()
{var navWrapper=$('#evo-main-nav-wrapper');if(navWrapper.hasClass('do-affix')){navWrapper.parent().height(navWrapper.height());navWrapper.affix({offset:{top:navWrapper.offset().top}});}}
$(window).load(function(){navigation();});$(document).ready(function(){$('#complete-order-button').click(function(){var commentField=$('#comment'),commentFieldHidden=$('#comment-hidden');if(commentField&&commentFieldHidden){commentFieldHidden.val(commentField.val());}});$('.footnote-vat a, .versand, .popup').click(function(e){var url=e.currentTarget.href;url+=(url.indexOf('?')===-1)?'?isAjax=true':'&isAjax=true';eModal.ajax({'size':'lg','url':url,'title':typeof e.currentTarget.title!=='undefined'?e.currentTarget.title:''});e.stopPropagation();return false;});$(document).on('click','.pagination-ajax li:not(.active) a',function(e){var url=$(this).attr('href');history.pushState(null,null,url);loadContent(url);return e.preventDefault();});if($('.pagination-ajax').length>0){window.addEventListener('popstate',function(e){loadContent(document.location.href);},false);};$('.dropdown .dropdown-menu.keepopen').on('click touchstart',function(e){e.stopPropagation();});if(typeof $.fn.jtl_search==='undefined'){var productSearch=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace('keyword'),queryTokenizer:Bloodhound.tokenizers.whitespace,remote:{url:'io.php?io={"name":"suggestions","params":["%QUERY"]}',wildcard:'%QUERY'}});$('input[name="qs"]').typeahead({highlight:true},{name:'product-search',display:'keyword',source:productSearch,templates:{suggestion:function(e){return e.suggestion;}}});}
$('.btn-offcanvas').click(function(){$('body').click();});if("ontouchstart"in document.documentElement){$('.variations .swatches .variation').on('mouseover',function(){$(this).trigger('click');});}
$('section.box-categories .nav-panel li a').on('click',function(e){if($(e.target).hasClass("nav-toggle")){$(e.delegateTarget).parent('li').find('> ul.nav').toggle();return false;}});$('section.box-linkgroup .nav-panel li a').on('click',function(e){if($(e.target).hasClass("nav-toggle")){$(e.delegateTarget).parent('li').find('> ul.nav').toggle();return false;}});(function($,document,window,viewport){$(window).resize(viewport.changed(function(){$('body').attr('data-viewport',viewport.current());}));$('body').attr('data-viewport',viewport.current());})(jQuery,document,window,ResponsiveBootstrapToolkit);categoryMenu();regionsToState();compatibility();});

AnonSec - 2021