1!function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var e=window.Slick||{};(e=function(){var e=0;return function(t,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(t),appendDots:i(t),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('<button type="button" />').text(t+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(t),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,s=i(t).data("slick")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,void 0!==document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=e++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}}()).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},e.prototype.addSlide=e.prototype.slickAdd=function(e,t,o){var s=this;if("boolean"==typeof t)o=t,t=null;else if(t<0||t>=s.slideCount)return!1;s.unload(),"number"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):!0===o?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each(function(e,t){i(t).attr("data-slick-index",e)}),s.$slidesCache=s.$slides,s.reinit()},e.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},e.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),!0===s.options.rtl&&!1===s.options.vertical&&(e=-e),!1===s.transformsEnabled?!1===s.options.vertical?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):!1===s.cssTransitions?(!0===s.options.rtl&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),!1===s.options.vertical?(o[s.animType]="translate("+i+"px, 0px)",s.$slideTrack.css(o)):(o[s.animType]="translate(0px,"+i+"px)",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),!1===s.options.vertical?o[s.animType]="translate3d("+e+"px, 0px, 0px)":o[s.animType]="translate3d(0px,"+e+"px, 0px)",s.$slideTrack.css(o),t&&setTimeout(function(){s.disableTransition(),t.call()},s.options.speed))},e.prototype.getNavTarget=function(){var e=this,t=e.options.asNavFor;return t&&null!==t&&(t=i(t).not(e.$slider)),t},e.prototype.asNavFor=function(e){var t=this.getNavTarget();null!==t&&"object"==typeof t&&t.each(function(){var t=i(this).slick("getSlick");t.unslicked||t.slideHandler(e,!0)})},e.prototype.applyTransition=function(i){var e=this,t={};!1===e.options.fade?t[e.transitionType]=e.transformType+" "+e.options.speed+"ms "+e.options.cssEase:t[e.transitionType]="opacity "+e.options.speed+"ms "+e.options.cssEase,!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},e.prototype.autoPlayClear=function(){var i=this;i.autoPlayTimer&&clearInterval(i.autoPlayTimer)},e.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(!1===i.options.infinite&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1==0&&(i.direction=1))),i.slideHandler(e))},e.prototype.buildArrows=function(){var e=this;!0===e.options.arrows&&(e.$prevArrow=i(e.options.prevArrow).addClass("slick-arrow"),e.$nextArrow=i(e.options.nextArrow).addClass("slick-arrow"),e.slideCount>e.options.slidesToShow?(e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.prependTo(e.options.appendArrows),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.appendTo(e.options.appendArrows),!0!==e.options.infinite&&e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},e.prototype.buildDots=function(){var e,t,o=this;if(!0===o.options.dots){for(o.$slider.addClass("slick-dotted"),t=i("<ul />").addClass(o.options.dotsClass),e=0;e<=o.getDotCount();e+=1)t.append(i("<li />").append(o.options.customPaging.call(this,o,e)));o.$dots=t.appendTo(o.options.appendDots),o.$dots.find("li").first().addClass("slick-active")}},e.prototype.buildOut=function(){var e=this;e.$slides=e.$slider.children(e.options.slide+":not(.slick-cloned)").addClass("slick-slide"),e.slideCount=e.$slides.length,e.$slides.each(function(e,t){i(t).attr("data-slick-index",e).data("originalStyling",i(t).attr("style")||"")}),e.$slider.addClass("slick-slider"),e.$slideTrack=0===e.slideCount?i('<div class="slick-track"/>').appendTo(e.$slider):e.$slides.wrapAll('<div class="slick-track"/>').parent(),e.$list=e.$slideTrack.wrap('<div class="slick-list"/>').parent(),e.$slideTrack.css("opacity",0),!0!==e.options.centerMode&&!0!==e.options.swipeToSlide||(e.options.slidesToScroll=1),i("img[data-lazy]",e.$slider).not("[src]").addClass("slick-loading"),e.setupInfinite(),e.buildArrows(),e.buildDots(),e.updateDots(),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),!0===e.options.draggable&&e.$list.addClass("draggable")},e.prototype.buildRows=function(){var i,e,t,o,s,n,r,l=this;if(o=document.createDocumentFragment(),n=l.$slider.children(),l.o
1ptions.rows>1){for(r=l.options.slidesPerRow*l.options.rows,s=Math.ceil(n.length/r),i=0;i<s;i++){var d=document.createElement("div");for(e=0;e<l.options.rows;e++){var a=document.createElement("div");for(t=0;t<l.options.slidesPerRow;t++){var c=i*r+(e*l.options.slidesPerRow+t);n.get(c)&&a.appendChild(n.get(c))}d.appendChild(a)}o.appendChild(d)}l.$slider.empty().append(o),l.$slider.children().children().children().css({width:100/l.options.slidesPerRow+"%",display:"inline-block"})}},e.prototype.checkResponsive=function(e,t){var o,s,n,r=this,l=!1,d=r.$slider.width(),a=window.innerWidth||i(window).width();if("window"===r.respondTo?n=a:"slider"===r.respondTo?n=d:"min"===r.respondTo&&(n=Math.min(a,d)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){s=null;for(o in r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(!1===r.originalSettings.mobileFirst?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||t)&&(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e),l=s),e||!1===l||r.$slider.trigger("breakpoint",[r,l])}},e.prototype.changeSlide=function(e,t){var o,s,n,r=this,l=i(e.currentTarget);switch(l.is("a")&&e.preventDefault(),l.is("li")||(l=l.closest("li")),n=r.slideCount%r.options.slidesToScroll!=0,o=n?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll,e.data.message){case"previous":s=0===o?r.options.slidesToScroll:r.options.slidesToShow-o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-s,!1,t);break;case"next":s=0===o?r.options.slidesToScroll:o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+s,!1,t);break;case"index":var d=0===e.data.index?0:e.data.index||l.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(d),!1,t),l.children().trigger("focus");break;default:return}},e.prototype.checkNavigable=function(i){var e,t;if(e=this.getNavigableIndexes(),t=0,i>e[e.length-1])i=e[e.length-1];else for(var o in e){if(i<e[o]){i=t;break}t=e[o]}return i},e.prototype.cleanUpEvents=function(){var e=this;e.options.dots&&null!==e.$dots&&(i("li",e.$dots).off("click.slick",e.changeSlide).off("mouseenter.slick",i.proxy(e.interrupt,e,!0)).off("mouseleave.slick",i.proxy(e.interrupt,e,!1)),!0===e.options.accessibility&&e.$dots.off("keydown.slick",e.keyHandler)),e.$slider.off("focus.slick blur.slick"),!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow&&e.$prevArrow.off("click.slick",e.changeSlide),e.$nextArrow&&e.$nextArrow.off("click.slick",e.changeSlide),!0===e.options.accessibility&&(e.$prevArrow&&e.$prevArrow.off("keydown.slick",e.keyHandler),e.$nextArrow&&e.$nextArrow.off("keydown.slick",e.keyHandler))),e.$list.off("touchstart.slick mousedown.slick",e.swipeHandler),e.$list.off("touchmove.slick mousemove.slick",e.swipeHandler),e.$list.off("touchend.slick mouseup.slick",e.swipeHandler),e.$list.off("touchcancel.slick mouseleave.
1slick",e.swipeHandler),e.$list.off("click.slick",e.clickHandler),i(document).off(e.visibilityChange,e.visibility),e.cleanUpSlideEvents(),!0===e.options.accessibility&&e.$list.off("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().off("click.slick",e.selectHandler),i(window).off("orientationchange.slick.slick-"+e.instanceUid,e.orientationChange),i(window).off("resize.slick.slick-"+e.instanceUid,e.resize),i("[draggable!=true]",e.$slideTrack).off("dragstart",e.preventDefault),i(window).off("load.slick.slick-"+e.instanceUid,e.setPosition)},e.prototype.cleanUpSlideEvents=function(){var e=this;e.$list.off("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.off("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.cleanUpRows=function(){var i,e=this;e.options.rows>1&&((i=e.$slides.children().children()).removeAttr("style"),e.$slider.empty().append(i))},e.prototype.clickHandler=function(i){!1===this.shouldClick&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},e.prototype.destroy=function(e){var t=this;t.autoPlayClear(),t.touchObject={},t.cleanUpEvents(),i(".slick-cloned",t.$slider).detach(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.$prevArrow.length&&(t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove()),t.$nextArrow&&t.$nextArrow.length&&(t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove()),t.$slides&&(t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){i(this).attr("style",i(this).data("originalStyling"))}),t.$slideTrack.children(this.options.slide).detach(),t.$slideTrack.detach(),t.$list.detach(),t.$slider.append(t.$slides)),t.cleanUpRows(),t.$slider.removeClass("slick-slider"),t.$slider.removeClass("slick-initialized"),t.$slider.removeClass("slick-dotted"),t.unslicked=!0,e||t.$slider.trigger("destroy",[t])},e.prototype.disableTransition=function(i){var e=this,t={};t[e.transitionType]="",!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.fadeSlide=function(i,e){var t=this;!1===t.cssTransitions?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout(function(){t.disableTransition(i),e.call()},t.options.speed))},e.prototype.fadeSlideOut=function(i){var e=this;!1===e.cssTransitions?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},e.prototype.filterSlides=e.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},e.prototype.focusHandler=function(){var e=this;e.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*",function(t){t.stopImmediatePropagation();var o=i(this);setTimeout(function(){e.options.pauseOnFocus&&(e.focussed=o.is(":focus"),e.autoPlay())},0)})},e.prototype.getCurrent=e.prototype.slickCurrentSlide=function(){return this.currentSlide},e.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(!0===i.options.infinite)if(i.slideCount<=i.options.slidesToShow)++o;else for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(!0===i.options.centerMode)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},e.prototype.getLeft=function(i){var e,t,o,s,n=this,r=0;return n.slideOffset=0,t=n.$slides.first().outerHeight(!0),!0===n.options.infinite?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=n.slideWidth*n.options.slidesToShow*-1,s=-1,!0===n.options.vertical&&!0===n.options.centerMode&&(2===n.options.slidesToShow?s=-1.5:1===n.options.slidesToShow&&(s=-2)),r=t*n.options.slidesToShow*s),n.slideCount%n.options.slidesToScroll!=0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=(n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*-1,r=(n.options.slidesToShow-(i-n.slideCount))*t*-1):(n.slideOffset=n.slideCount%n.options.slidesToScroll*n.slideWidth*-1,r=n.slideCount%n.options.slidesToScroll*t*-1))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,r=(i+n.options.slidesToShow-n.slideCount)*t),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,r=0),!0===n.options.centerMode&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:!0===n.options.centerMode&&!0===n.options.infinite?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:!0===n.options.centerMode&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),e=!1===n.options.vertical?i*n.slideWidth*-1+n.slideOffset:i*t*-1+r,!0===n.options.variableWidth&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,!0===n.options.centerMode&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow+1),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,e+=(n.$list.width()-o.outerWidth())/2)),e},e.prototype.getOption=e.prototype.slickGetOption=function(i){return this.options[i]},e.prototype.getNavigableIndexes=function(){var i,e=this,t=0,o=0,s=[];for(!1===e.options.infinite?i=e.slideCount:(t=-1*e.options.slidesToScroll,o=-1*e.options.slidesToScroll,i=2*e.slideCount);t<i;)s.push(t),t=o+e.options.slidesToScroll,o+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return s},e.prototype.getSlick=function(){return this},e.prototype.getSlideCount=function(){var e,t,o=this;return t=!0===o.options.centerMode?o.slideWidth*Math.floor(o.options.slidesToShow/2):0,!0===o.options.swipeToSlide?(o.$slideTrack.find(".slick-slide").each(function(s,n){if(n.offsetLeft-t+i(n).outerWidth()/2>-1*o.swipeLeft)return e=n,!1}),Math.abs(i(e).attr("data-slick-index")-o.currentSlide)||1):o.options.slidesToScroll},e.prototype.goTo=e.prototype.slickGoTo=function(i,e){this.changeSlide({data:{message:"index",index:
1parseInt(i)}},e)},e.prototype.init=function(e){var t=this;i(t.$slider).hasClass("slick-initialized")||(i(t.$slider).addClass("slick-initialized"),t.buildRows(),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots(),t.checkResponsive(!0),t.focusHandler()),e&&t.$slider.trigger("init",[t]),!0===t.options.accessibility&&t.initADA(),t.options.autoplay&&(t.paused=!1,t.autoPlay())},e.prototype.initADA=function(){var e=this,t=Math.ceil(e.slideCount/e.options.slidesToShow),o=e.getNavigableIndexes().filter(function(i){return i>=0&&i<e.slideCount});e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==e.$dots&&(e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function(t){var s=o.indexOf(t);i(this).attr({role:"tabpanel",id:"slick-slide"+e.instanceUid+t,tabindex:-1}),-1!==s&&i(this).attr({"aria-describedby":"slick-slide-control"+e.instanceUid+s})}),e.$dots.attr("role","tablist").find("li").each(function(s){var n=o[s];i(this).attr({role:"presentation"}),i(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+e.instanceUid+s,"aria-controls":"slick-slide"+e.instanceUid+n,"aria-label":s+1+" of "+t,"aria-selected":null,tabindex:"-1"})}).eq(e.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var s=e.currentSlide,n=s+e.options.slidesToShow;s<n;s++)e.$slides.eq(s).attr("tabindex",0);e.activateADA()},e.prototype.initArrowEvents=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},i.changeSlide),i.$nextArrow.off("click.slick").on("click.slick",{message:"next"},i.changeSlide),!0===i.options.accessibility&&(i.$prevArrow.on("keydown.slick",i.keyHandler),i.$nextArrow.on("keydown.slick",i.keyHandler)))},e.prototype.initDotEvents=function(){var e=this;!0===e.options.dots&&(i("li",e.$dots).on("click.slick",{message:"index"},e.changeSlide),!0===e.options.accessibility&&e.$dots.on("keydown.slick",e.keyHandler)),!0===e.options.dots&&!0===e.options.pauseOnDotsHover&&i("li",e.$dots).on("mouseenter.slick",i.proxy(e.interrupt,e,!0)).on("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.initSlideEvents=function(){var e=this;e.options.pauseOnHover&&(e.$list.on("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.on("mouseleave.slick",i.proxy(e.interrupt,e,!1)))},e.prototype.initializeEvents=function(){var e=this;e.initArrowEvents(),e.initDotEvents(),e.initSlideEvents(),e.$list.on("touchstart.slick mousedown.slick",{action:"start"},e.swipeHandler),e.$list.on("touchmove.slick mousemove.slick",{action:"move"},e.swipeHandler),e.$list.on("touchend.slick mouseup.slick",{action:"end"}
1,e.swipeHandler),e.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},e.swipeHandler),e.$list.on("click.slick",e.clickHandler),i(document).on(e.visibilityChange,i.proxy(e.visibility,e)),!0===e.options.accessibility&&e.$list.on("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),i(window).on("orientationchange.slick.slick-"+e.instanceUid,i.proxy(e.orientationChange,e)),i(window).on("resize.slick.slick-"+e.instanceUid,i.proxy(e.resize,e)),i("[draggable!=true]",e.$slideTrack).on("dragstart",e.preventDefault),i(window).on("load.slick.slick-"+e.instanceUid,e.setPosition),i(e.setPosition)},e.prototype.initUI=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},e.prototype.keyHandler=function(i){var e=this;i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&!0===e.options.accessibility?e.changeSlide({data:{message:!0===e.options.rtl?"next":"previous"}}):39===i.keyCode&&!0===e.options.accessibility&&e.changeSlide({data:{message:!0===e.options.rtl?"previous":"next"}}))},e.prototype.lazyLoad=function(){function e(e){i("img[data-lazy]",e).each(function(){var e=i(this),t=i(this).attr("data-lazy"),o=i(this).attr("data-srcset"),s=i(this).attr("data-sizes")||n.$slider.attr("data-sizes"),r=document.createElement("img");r.onload=function(){e.animate({opacity:0}
vendor: 5,619 bytes, line 1
1,100,function(){o&&(e.attr("srcset",o),s&&e.attr("sizes",s)),e.attr("src",t).animate({opacity:1},200,function(){e.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")}),n.$slider.trigger("lazyLoaded",[n,e,t])})},r.onerror=function(){e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),n.$slider.trigger("lazyLoadError",[n,e,t])},r.src=t})}var t,o,s,n=this;if(!0===n.options.centerMode?!0===n.options.infinite?s=(o=n.currentSlide+(n.options.slidesToShow/2+1))+n.options.slidesToShow+2:(o=Math.max(0,n.currentSlide-(n.options.slidesToShow/2+1)),s=n.options.slidesToShow/2+1+2+n.currentSlide):(o=n.options.infinite?n.options.slidesToShow+n.currentSlide:n.currentSlide,s=Math.ceil(o+n.options.slidesToShow),!0===n.options.fade&&(o>0&&o--,s<=n.slideCount&&s++)),t=n.$slider.find(".slick-slide").slice(o,s),"anticipated"===n.options.lazyLoad)for(var r=o-1,l=s,d=n.$slider.find(".slick-slide"),a=0;a<n.options.slidesToScroll;a++)r<0&&(r=n.slideCount-1),t=(t=t.add(d.eq(r))).add(d.eq(l)),r--,l++;e(t),n.slideCount<=n.options.slidesToShow?e(n.$slider.find(".slick-slide")):n.currentSlide>=n.slideCount-n.options.slidesToShow?e(n.$slider.find(".slick-cloned").slice(0,n.options.slidesToShow)):0===n.currentSlide&&e(n.$slider.find(".slick-cloned").slice(-1*n.options.slidesToShow))},e.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass("slick-loading"),i.initUI(),"progressive"===i.options.lazyLoad&&i.progressiveLazyLoad()},e.prototype.next=e.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},e.prototype.orientationChange=function(){var i=this;i.checkResponsive(),i.setPosition()},e.prototype.pause=e.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},e.prototype.play=e.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},e.prototype.postSlide=function(e){var t=this;t.unslicked||(t.$slider.trigger("afterChange",[t,e]),t.animating=!1,t.slideCount>t.options.slidesToShow&&t.setPosition(),t.swipeLeft=null,t.options.autoplay&&t.autoPlay(),!0===t.options.accessibility&&(t.initADA(),t.options.focusOnChange&&i(t.$slides.get(t.currentSlide)).attr("tabindex",0).focus()))},e.prototype.prev=e.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},e.prototype.preventDefault=function(i){i.preventDefault()},e.prototype.progressiveLazyLoad=function(e){e=e||1;var t,o,s,n,r,l=this,d=i("img[data-lazy]",l.$slider);d.length?(t=d.first(),o=t.attr("data-lazy"),s=t.attr("data-srcset"),n=t.attr("data-sizes")||l.$slider.attr("data-sizes"),(r=document.createElement("img")).onload=function(){s&&(t.attr("srcset",s),n&&t.attr("sizes",n)),t.attr("src",o).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===l.options.adaptiveHeight&&l.setPosition(),l.$slider.trigger("lazyLoaded",[l,t,o]),l.progressiveLazyLoad()},r.onerror=function(){e<3?setTimeout(function(){l.progressiveLazyLoad(e+1)},500):(t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),l.$slider.trigger("lazyLoadError",[l,t,o]),l.progressiveLazyLoad())},r.src=o):l.$slider.trigger("allImagesLoaded",[l])},e.prototype.refresh=function(e){var t,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),t=s.currentSlide,s.destroy(!0),i.extend(s,s.initials,{currentSlide:t}),s.init(),e||s.changeSlide({data:{message:"index",index:t}},!1)},e.prototype.registerBreakpoints=function(){var e,t,o,s=this,n=s.options.responsive||null;if("array"===i.type(n)&&n.length){s.respondTo=s.options.respondTo||"window";for(e in n)if(o=s.breakpoints.length-1,n.hasOwnProperty(e)){for(t=n[e].breakpoint;o>=0;)s.breakpoints[o]&&s.breakpoints[o]===t&&s.breakpoints.splice(o,1),o--;s.breakpoints.push(t),s.breakpointSettings[t]=n[e].settings}s.breakpoints.sort(function(i,e){return s.options.mobileFirst?i-e:e-i})}},e.prototype.reinit=function(){var e=this;e.$slides=e.$slideTrack.children(e.options.slide).addClass("slick-slide"),e.slideCount=e.$slides.length,e.currentSlide>=e.slideCount&&0!==e.currentSlide&&(e.currentSlide=e.currentSlide-e.options.slidesToScroll),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),e.registerBreakpoints(),e.setProps(),e.setupInfinite(),e.buildArrows(),e.updateArrows(),e.initArrowEvents(),e.buildDots(),e.updateDots(),e.initDotEvents(),e.cleanUpSlideEvents(),e.initSlideEvents(),e.checkResponsive(!1,!0),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.setPosition(),e.focusHandler(),e.paused=!e.options.autoplay,e.autoPlay(),e.$slider.trigger("reInit",[e])},e.prototype.resize=function(){var e=this;i(window).width()!==e.windowWidth&&(clearTimeout(e.windowDelay),e.windowDelay=window.setTimeout(function(){e.windowWidth=i(window).width(),e.checkResponsive(),e.unslicked||e.setPosition()},50))},e.prototype.removeSlide=e.prototype.slickRemove=function(i,e,t){var o=this;if(i="boolean"==typeof i?!0===(e=i)?0:o.slideCount-1:!0===e?--i:i,o.slideCount<1||i<0||i>o.slideCount-1)return!1;o.unload(),!0===t?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(i).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,o.reinit()},e.prototype.setCSS=function(i){var e,t,o=this,s={};
1!0===o.options.rtl&&(i=-i),e="left"==o.positionProp?Math.ceil(i)+"px":"0px",t="top"==o.positionProp?Math.ceil(i)+"px":"0px",s[o.positionProp]=i,!1===o.transformsEnabled?o.$slideTrack.css(s):(s={},!1===o.cssTransitions?(s[o.animType]="translate("+e+", "+t+")",o.$slideTrack.css(s)):(s[o.animType]="translate3d("+e+", "+t+", 0px)",o.$slideTrack.css(s)))},e.prototype.setDimensions=function(){var i=this;!1===i.options.vertical?!0===i.options.centerMode&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),!0===i.options.centerMode&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),!1===i.options.vertical&&!1===i.options.variableWidth?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):!0===i.options.variableWidth?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();!1===i.options.variableWidth&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-e)},e.prototype.setFade=function(){var e,t=this;t.$slides.each(function(o,s){e=t.slideWidth*o*-1,!0===t.options.rtl?i(s).css({position:"relative",right:e,top:0,zIndex:t.options.zIndex-2,opacity:0}
1):i(s).css({position:"relative",left:e,top:0,zIndex:t.options.zIndex-2,opacity:0})}),t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})},e.prototype.setHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.css("height",e)}},e.prototype.setOption=e.prototype.slickSetOption=function(){var e,t,o,s,n,r=this,l=!1;if("object"===i.type(arguments[0])?(o=arguments[0],l=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(o=arguments[0],s=arguments[1],l=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":void 0!==arguments[1]&&(n="single")),"single"===n)r.options[o]=s;else if("multiple"===n)i.each(o,function(i,e){r.options[i]=e});else if("responsive"===n)for(t in s)if("array"!==i.type(r.options.responsive))r.options.responsive=[s[t]];else{for(e=r.options.responsive.length-1;e>=0;)r.options.responsive[e].breakpoint===s[t].breakpoint&&r.options.responsive.splice(e,1),e--;r.options.responsive.push(s[t])}l&&(r.unload(),r.reinit())},e.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),!1===i.options.fade?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger("setPosition",[i])},e.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=!0===i.options.vertical?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),void 0===e.WebkitTransition&&void 0===e.MozTransition&&void 0===e.msTransition||!0===i.options.useCSS&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&!1!==i.animType&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&!1!==i.animType},e.prototype.setSlideClasses=function(i){var e,t,o,s,n=this;if(t=n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),n.$slides.eq(i).addClass("slick-current"),!0===n.options.centerMode){var r=n.options.slidesToShow%2==0?1:0;e=Math.floor(n.options.slidesToShow/2),!0===n.options.infinite&&(i>=e&&i<=n.slideCount-1-e?n.$slides.slice(i-e+r,i+e+1).addClass("slick-active").attr("aria-hidden","false"):(o=n.options.slidesToShow+i,t.slice(o-e+1+r,o+e+2).addClass("slick-active").attr("aria-hidden","false")),0===i?t.eq(t.length-1-n.options.slidesToShow).addClass("slick-center"):i===n.slideCount-1&&t.eq(n.options.slidesToShow).addClass("slick-center")),n.$slides.eq(i).addClass("slick-center")}else i>=0&&i<=n.slideCount-n.options.slidesToShow?n.$slides.slice(i,i+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):t.length<=n.options.slidesToShow?t.addClass("slick-active").attr("aria-hidden","false"):(s=n.slideCount%n.options.slidesToShow,o=!0===n.options.infinite?n.options.slidesToShow+i:i,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-i<n.options.slidesToShow?t.slice(o-(n.options.slidesToShow-s),o+s).addClass("slick-active").attr("aria-hidden","false"):t.slice(o,o+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==n.options.lazyLoad&&"anticipated"!==n.options.lazyLoad||n.lazyLoad()},e.prototype.setupInfinite=function(){var e,t,o,s=this;if(!0===s.options.fade&&(s.options.centerMode=!1),!0===s.options.infinite&&!1===s.options.fade&&(t=null,s.slideCount>s.options.slidesToShow)){for(o=!0===s.options.centerMode?s.options.slidesToShow+1:s.options.slidesToShow,e=s.slideCount;e>s.slideCount-o;e-=1)t=e-1,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t-s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned");for(e=0;e<o+s.slideCount;e+=1)t=e,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t+s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned");s.$slideTrack.find(".slick-cloned").find("[id]").each(function(){i(this).attr("id","")})}},e.prototype.interrupt=function(i){var e=this;i||e.autoPlay(),e.interrupted=i},e.prototype.selectHandler=function(e){var t=this,o=i(e.target).is(".slick-slide")?i(e.target):i(e.target).parents(".slick-slide"),s=parseInt(o.attr("data-slick-index"));s||(s=0),t.slideCount<=t.options.slidesToShow?t.slideHandler(s,!1,!0):t.slideHandler(s)},e.prototype.slideHandler=function(i,e,t){var o,s,n,r,l,d=null,a=this;if(e=e||!1,!(!0===a.animating&&!0===a.options.waitForAnimate||!0===a.options.fade&&a.currentSlide===i))if(!1===e&&a.asNavFor(i),o=i,d=a.getLeft(o),r=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?r:a.swipeLeft,!1===a.options.infinite&&!1===a.options.centerMode&&(i<0||i>a.getDotCount()*a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else if(!1===a.options.infinite&&!0===a.options.centerMode&&(i<0||i>a.slideCount-a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else{if(a.options.autoplay&&clearInterval(a.autoPlayTimer),s=o<0?a.slideCount%a.options.slidesToScroll!=0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+
1o:o>=a.slideCount?a.slideCount%a.options.slidesToScroll!=0?0:o-a.slideCount:o,a.animating=!0,a.$slider.trigger("beforeChange",[a,a.currentSlide,s]),n=a.currentSlide,a.currentSlide=s,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(l=(l=a.getNavTarget()).slick("getSlick")).slideCount<=l.options.slidesToShow&&l.setSlideClasses(a.currentSlide),a.updateDots(),a.updateArrows(),!0===a.options.fade)return!0!==t?(a.fadeSlideOut(n),a.fadeSlide(s,function(){a.postSlide(s)})):a.postSlide(s),void a.animateHeight();!0!==t?a.animateSlide(d,function(){a.postSlide(s)}):a.postSlide(s)}},e.prototype.startLoad=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass("slick-loading")},e.prototype.swipeDirection=function(){var i,e,t,o,s=this;return i=s.touchObject.startX-s.touchObject.curX,e=s.touchObject.startY-s.touchObject.curY,t=Math.atan2(e,i),(o=Math.round(180*t/Math.PI))<0&&(o=360-Math.abs(o)),o<=45&&o>=0?!1===s.options.rtl?"left":"right":o<=360&&o>=315?!1===s.options.rtl?"left":"right":o>=135&&o<=225?!1===s.options.rtl?"right":"left":!0===s.options.verticalSwiping?o>=35&&o<=135?"down":"up":"vertical"},e.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.swiping=!1,o.scrolling)return o.scrolling=!1,!1;if(o.interrupted=!1,o.shouldClick=!(o.touchObject.swipeLength>10),void 0===o.touchObject.curX)return!1;if(!0===o.touchObject.edgeHit&&o.$slider.trigger("edge",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case"left":case"down":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case"right":case"up":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}"vertical"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger("swipe",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},e.prototype.swipeHandler=function(i){var e=this;if(!(!1===e.options.swipe||"ontouchend"in document&&!1===e.options.swipe||!1===e.options.draggable&&-1!==i.type.indexOf("mouse")))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,!0===e.options.verticalSwiping&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case"start":e.swipeStart(i);break;case"move":e.swipeMove(i);break;case"end":e.swipeEnd(i)}},e.prototype.swipeMove=function(i){var e,t,o,s,n,r,l=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!(!l.dragging||l.scrolling||n&&1!==n.length)&&(e=l.getLeft(l.currentSlide),l.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,l.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,l.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(l.touchObject.curX-l.touchObject.startX,2))),r=Math.round(Math.sqrt(Math.pow(l.touchObject.curY-l.touchObject.startY,2))),!l.options.verticalSwiping&&!l.swiping&&r>4?(l.scrolling=!0,!1):(!0===l.options.verticalSwiping&&(l.touchObject.swipeLength=r),t=l.swipeDirection(),void 0!==i.originalEvent&&l.touchObject.swipeLength>4&&(l.swiping=!0,i.preventDefault()),s=(!1===l.options.rtl?1:-1)*(l.touchObject.curX>l.touchObject.startX?1:-1),!0===l.options.verticalSwiping&&(s=l.touchObject.curY>l.touchObject.startY?1:-1),o=l.touchObject.swipeLength,l.touchObject.edgeHit=!1,!1===l.options.infinite&&(0===l.currentSlide&&"right"===t||l.currentSlide>=l.getDotCount()&&"left"===t)&&(o=l.touchObject.swipeLength*l.options.edgeFriction,l.touchObject.edgeHit=!0),!1===l.options.vertical?l.swipeLeft=e+o*s:l.swipeLeft=e+o*(l.$list.height()/l.listWidth)*s,!0===l.options.verticalSwiping&&(l.swipeLeft=e+o*s),!0!==l.options.fade&&!1!==l.options.touchMove&&(!0===l.animating?(l.swipeLeft=null,!1):void l.setCSS(l.swipeLeft))))},e.prototype.swipeStart=function(i){var e,t=this;if(t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow)return t.touchObject={},!1;void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,t.dragging=!0},e.prototype.unfilterSlides=e.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},e.prototype.unload=function(){var e=this;i(".slick-cloned",e.$slider).remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove(),e.$nextArrow&&e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove(),e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")}
1,e.prototype.unslick=function(i){var e=this;e.$slider.trigger("unslick",[e,i]),e.destroy()},e.prototype.updateArrows=function(){var i=this;Math.floor(i.options.slidesToShow/2),!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&!i.options.infinite&&(i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===i.currentSlide?(i.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-i.options.slidesToShow&&!1===i.options.centerMode?(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-1&&!0===i.options.centerMode&&(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},e.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find("li").removeClass("slick-active").end(),i.$dots.find("li").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass("slick-active"))},e.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(i=0;i<r;i++)if("object"==typeof s||void 0===s?o[i].slick=new e(o[i],s):t=o[i].slick[s].apply(o[i].slick,n),void 0!==t)return t;return o}}); 2
vendor: 14,690 bytes, line 3
3!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AOS=t():e.AOS=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="dist/",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=n(1),a=(o(r),n(6)),u=o(a),c=n(7),s=o(c),f=n(8),d=o(f),l=n(9),p=o(l),m=n(10),b=o(m),v=n(11),y=o(v),g=n(14),h=o(g),w=[],k=!1,x={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,startEvent:"DOMContentLoaded",throttleDelay:99,debounceDelay:50,disableMutationObserver:!1},j=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e&&(k=!0),k)return w=(0,y.default)(w,x),(0,b.default)(w,x.once),w},O=function(){w=(0,h.default)(),j()},M=function(){w.forEach(function(e,t){e.node.removeAttribute("data-aos"),e.node.removeAttribute("data-aos-easing"),e.node.removeAttribute("data-aos-duration"),e.node.removeAttribute("data-aos-delay")})},S=function(e){return e===!0||"mobile"===e&&p.default.mobile()||"phone"===e&&p.default.phone()||"tablet"===e&&p.default.tablet()||"function"==typeof e&&e()===!0},_=function(e){x=i(x,e),w=(0,h.default)();var t=document.all&&!window.atob;return S(x.disable)||t?M():(x.disableMutationObserver||d.default.isSupported()||(console.info('\n aos: MutationObserver is not supported on this browser,\n code mutations observing has been disabled.\n You may have to call "refreshHard()" by yourself.\n '),x.disableMutationObserver=!0),document.querySelector("body").setAttribute("data-aos-easing",x.easing),document.querySelector("body").setAttribute("data-aos-duration",x.duration),document.querySelector("body").setAttribute("data-aos-delay",x.delay),"DOMContentLoaded"===x.startEvent&&["complete","interactive"].indexOf(document.readyState)>-1?j(!0):"load"===x.startEvent?window.addEventListener(x.startEvent,function(){j(!0)}):document.addEventListener(x.startEvent,function(){j(!0)}),window.addEventListener("resize",(0,s.default)(j,x.debounceDelay,!0)),window.addEventListener("orientationchange",(0,s.default)(j,x.debounceDelay,!0)),window.addEventListener("scroll",(0,u.default)(function(){(0,b.default)(w,x.once)},x.throttleDelay)),x.disableMutationObserver||d.default.ready("[data-aos]",O),w)};e.exports={init:_,refresh:j,refreshHard:O}},function(e,t){},,,,,function(e,t){(function(t){"use strict";function n(e,t,n){function o(t){var n=b,o=v;return b=v=void 0,k=t,g=e.apply(o,n)}function r(e){return k=e,h=setTimeout(f,t),M?o(e):g}function a(e){var n=e-w,o=e-k,i=t-n;return S?j(i,y-o):i}function c(e){var n=e-w,o=e-k;return void 0===w||n>=t||n<0||S&&o>=y}function f(){var e=O();return c(e)?d(e):void(h=setTimeout(f,a(e)))}function d(e){return h=void 0,_&&b?o(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),k=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(O())}function m(){var e=O(),n=c(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(f,t),o(w)}return void 0===h&&(h=setTimeout(f,t)),g}var b,v,y,g,h,w,k=0,M=!1,S=!1,_=!0;if("function"!=typeof e)throw new TypeError(s);return t=u(t)||0,i(n)&&(M=!!n.leading,S="maxWait"in n,y=S?x(u(n.maxWait)||0,t):y,_="trailing"in n?!!n.trailing:_),m.cancel=l,m.flush=p,m}function o(e,t,o){var r=!0,a=!0;if("function"!=typeof e)throw new TypeError(s);return i(o)&&(r="leading"in o?!!o.leading:r,a="trailing"in o?!!o.trailing:a),n(e,t,{leading:r,maxWait:t,trailing:a})}function i(e){var t="undefined"==typeof e?"undefined":c(e);return!!e&&("object"==t||"function"==t)}function r(e){return!!e&&"object"==("undefined"==typeof e?"undefined":c(e))}function a(e){return"symbol"==("undefined"==typeof e?"undefined":c(e))||r(e)&&k.call(e)==d}function u(e){if("number"==typeof e)return e;if(a(e))return f;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(l,"");var n=m.test(e);return n||b.test(e)?v(e.slice(2),n?2:8):p.test(e)?f:+e}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s="Expected a function",f=NaN,d="[object Symbol]",l=/^\s+|\s+$/g,p=/^[-+]0x[0-9a-f]+$/i,m=/^0b[01]+$/i,b=/^0o[0-7]+$/i,v=parseInt,y="object"==("undefined"==typeof t?"undefined":c(t))&&t&&t.Object===Object&&t,g="object"==("undefined"==typeof self?"undefined":c(self))&&self&&self.Object===Object&&self,h=y||g||Function("return this")(),w=Object.prototype,k=w.toString,x=Math.max,j=Math.min,O=function(){return h.Date.now()};e.exports=o}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";function n(e,t,n){function i(t){var n=b,o=v;return b=v=void 0,O=t,g=e.apply(o,n)}function r(e){return O=e,h=setTimeout(f,t),M?i(e):g}function u(e){var n=e-w,o=e-O,i=t-n;return S?x(i,y-o):i}function s(e){var n=e-w,o=e-O;return void 0===w||n>=t||n<0||S&&o>=y}function f(){var e=j();return s(e)?d(e):void(h=setTimeout(f,u(e)))}function d(e){return h=void 0,_&&b?i(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),O=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(j())}function m(){var e=j(),n=s(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(f,t),i(w)}return void 0===h&&(h=setTimeout(f,t)),g}var b,v,y,g,h,w,O=0,M=!1,S=!1,_=!0;if("function"!=typeof e)throw new TypeError(c);return t=a(t)||0,o(n)&&(M=!!n.leading,S="maxWait"in n,y=S?k(a(n.maxWait)||0,t):y,_="trailing"in n?!!n.trailing:_),m.cancel=l,m.flush=p,m}function o(e){var t="undefined"==typeof e?"undefined":u(e);return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==("undefined"==typeof e?"undefined":u(e))}function r(e){return"symbol"==("undefined"==typeof e?"undefined":u(e))||i(e)&&w.call(e)==f}function a(e){if("number"==typeof e)return e;if(r(e))return s;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(d,"");var n=p.test(e);return n||m.test(e)?b(e.slice(2),n?2:8):l.test(e)?s:+e}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c="Expected a function",s=NaN,f="[object Symbol]",d=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,m=/^0o[0-7]+$/i,b=parseInt,v="object"==("undefined"==typeof t?"undefined":u(t))&&t&&t.Object===Object&&t,y="object"==("undefined"==typeof self?"undefined":u(self))&&self&&self.Object===Object&&self,g=v||y||Function("return this")(),h=Object.prototype,w=h.toString,k=Math.max,x=Math.min,j=function(){return g.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t){"use strict";function n(e){var t=void 0,o=void 0,i=void 0;for(t=0;t<e.length;t+=1){if(o=e[t],o.dataset&&o.dataset.aos)return!0;if(i=o.children&&n(o.children))return!0}return!1}function o(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function i(){return!!o()}function r(e,t){var n=window.document,i=o(),r=new i(a);u=t,r.observe(n.documentElement,{childList:!0,subtree:!0,removedNodes:!0})}function a(e){e&&e.forEach(function(e){var t=Array.prototype.slice.call(e.addedNodes),o=Array.prototype.slice.call(e.removedNodes),i=t.concat(o);if(n(i))return u()})}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){};t.default={isSupported:i,ready:r}},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return navigator.userAgent||navigator.vendor||window.opera||""}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,a=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,u=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,c=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,s=function(){function e(){n(this,e)}return i(e,[{key:"phone",value:function(){var e=o();return!(!r.test(e)&&!a.test(e.substr(0,4)))}},{key:"mobile",value:function(){var e=o();return!(!u.test(e)&&!c.test(e.substr(0,4)))}},{key:"tablet",value:function(){return this.mobile()&&!this.phone()}}]),e}();t.default=new s},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,n){var o=e.node.getAttribute("data-aos-once");t>e.position?e.node.classList.add("aos-animate"):"undefined"!=typeof o&&("false"===o||!n&&"true"!==o)&&e.node.classList.remove("aos-animate")},o=function(e,t){var o=window.pageYOffset,i=window.innerHeight;e.forEach(function(e,r){n(e,i+o,t)})};t.default=o},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(12),r=o(i),a=function(e,t){return e.forEach(function(e,n){e.node.classList.add("aos-init"),e.position=(0,r.default)(e.node,t.offset)}),e};t.default=a},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(13),r=o(i),a=function(e,t){var n=0,o=0,i=window.innerHeight,a={offset:e.getAttribute("data-aos-offset"),anchor:e.getAttribute("data-aos-anchor"),anchorPlacement:e.getAttribute("data-aos-anchor-placement")};switch(a.offset&&!isNaN(a.offset)&&(o=parseInt(a.offset)),a.anchor&&document.querySelectorAll(a.anchor)&&(e=document.querySelectorAll(a.anchor)[0]),n=(0,r.default)(e).top,a.anchorPlacement){case"top-bottom":break;case"center-bottom":n+=e.offsetHeight/2;break;case"bottom-bottom":n+=e.offsetHeight;break;case"top-center":n+=i/2;break;case"bottom-center":n+=i/2+e.offsetHeight;break;case"center-center":n+=i/2+e.offsetHeight/2;break;case"top-top":n+=i;break;case"bottom-top":n+=e.offsetHeight+i;break;case"center-top":n+=e.offsetHeight/2+i}return a.anchorPlacement||a.offset||isNaN(t)||(o=t),n+o};t.default=a},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){for(var t=0,n=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-("BODY"!=e.tagName?e.scrollLeft:0),n+=e.offsetTop-("BODY"!=e.tagName?e.scrollTop:0),e=e.offsetParent;return{top:n,left:t}};t.default=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e=e||document.querySelectorAll("[data-aos]"),Array.prototype.map.call(e,function(e){return{node:e}})};t.default=n}])});
3 4/*! 5 * Bootstrap v4.3.1 (https://getbootstrap.com/) 6 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 7 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 8 */ 9!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,function(t,g,u){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function l(o){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},e=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.forEach(function(t){var e,n,i;e=o,i=r[n=t],n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i})}return o}g=g&&g.hasOwnProperty("default")?g.default:g,u=u&&u.hasOwnProperty("default")?u.default:u;var e="transitionend";function n(t){var e=this,n=!1;return g(this).one(_.TRANSITION_END,function(){n=!0}),setTimeout(function(){n||_.triggerTransitionEnd(e)},t),this}var _={TRANSITION_END:"bsTransitionEnd",getUID:function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(t){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var e=g(t).css("transition-duration"),n=g(t).css("transition-delay"),i=parseFloat(e),o=parseFloat(n);return i||o?(e=e.split(",")[0],n=n.split(",")[0],1e3*(parseFloat(e)+parseFloat(n))):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){g(t).trigger(e)},supportsTransitionEnd:function(){return Boolean(e)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=n[i],r=e[i],s=r&&_.isElement(r)?"element":(a=r,{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase());if(!new RegExp(o).test(s))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+s+'" but expected type "'+o+'".')}var a},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"!=typeof t.getRootNode)return t instanceof ShadowRoot?t:t.parentNode?_.findShadowRoot(t.parentNode):null;var e=t.getRootNode();return e instanceof ShadowRoot?e:null}};g.fn.emulateTransitionEnd=n,g.event.special[_.TRANSITION_END]={bindType:e,delegateType:e,handle:function(t){if(g(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var o="alert",r="bs.alert",a="."+r,c=g.fn[o],h={CLOSE:"close"+a,CLOSED:"closed"+a,CLICK_DATA_API:"click"+a+".data-api"},f="alert",d="fade",m="show",p=function(){function i(t){this._element=t}var t=i.prototype;return t.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},t.dispose=function(){g.removeData(this._element,r),this._element=null},t._getRootElement=function(t){var e=_.getSelectorFromElement(t),n=!1;return e&&(n=document.querySelector(e)),n||(n=g(t).closest("."+f)[0]),n},t._triggerCloseEvent=function(t){var e=g.Event(h.CLOSE);return g(t).trigger(e),e},t._removeElement=function(e){var n=this;if(g(e).removeClass(m),g(e).hasClass(d)){var t=_.getTransitionDurationFromElement(e);g(e).one(_.TRANSITION_END,function(t){return n._destroyElement(e,t)}).emulateTransitionEnd(t)}else this._destroyElement(e)},t._destroyElement=function(t){g(t).detach().trigger(h.CLOSED).remove()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(r);e||(e=new i(this),t.data(r,e)),"close"===n&&e[n](this)})},i._handleDismiss=function(e){return function(t){t&&t.preventDefault(),e.close(this)}},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}}]),i}();
9g(document).on(h.CLICK_DATA_API,'[data-dismiss="alert"]',p._handleDismiss(new p)),g.fn[o]=p._jQueryInterface,g.fn[o].Constructor=p,g.fn[o].noConflict=function(){return g.fn[o]=c,p._jQueryInterface};var v="button",y="bs.button",E="."+y,C=".data-api",T=g.fn[v],S="active",b="btn",I="focus",D='[data-toggle^="button"]',w='[data-toggle="buttons"]',A='input:not([type="hidden"])',N=".active",O=".btn",k={CLICK_DATA_API:"click"+E+C,FOCUS_BLUR_DATA_API:"focus"+E+C+" blur"+E+C},P=function(){function n(t){this._element=t}var t=n.prototype;return t.toggle=function(){var t=!0,e=!0,n=g(this._element).closest(w)[0];if(n){var i=this._element.querySelector(A);if(i){if("radio"===i.type)if(i.checked&&this._element.classList.contains(S))t=!1;else{var o=n.querySelector(N);o&&g(o).removeClass(S)}if(t){if(i.hasAttribute("disabled")||n.hasAttribute("disabled")||i.classList.contains("disabled")||n.classList.contains("disabled"))return;i.checked=!this._element.classList.contains(S),g(i).trigger("change")}i.focus(),e=!1}}e&&this._element.setAttribute("aria-pressed",!this._element.classList.contains(S)),t&&g(this._element).toggleClass(S)},t.dispose=function(){g.removeData(this._element,y),this._element=null},n._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(y);t||(t=new n(this),g(this).data(y,t)),"toggle"===e&&t[e]()})},s(n,null,[{key:"VERSION",get:function(){return"4.3.1"}}]),n}();g(document).on(k.CLICK_DATA_API,D,function(t){t.preventDefault();var e=t.target;g(e).hasClass(b)||(e=g(e).closest(O)),P._jQueryInterface.call(g(e),"toggle")}).on(k.FOCUS_BLUR_DATA_API,D,function(t){var e=g(t.target).closest(O)[0];g(e).toggleClass(I,/^focus(in)?$/.test(t.type))}),g.fn[v]=P._jQueryInterface,g.fn[v].Constructor=P,g.fn[v].noConflict=function(){return g.fn[v]=T,P._jQueryInterface};var L="carousel",j="bs.carousel",H="."+j,R=".data-api",x=g.fn[L],F={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},U={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},W="next",q="prev",M="left",K="right",Q={SLIDE:"slide"+H,SLID:"slid"+H,KEYDOWN:"keydown"+H,MOUSEENTER:"mouseenter"+H,MOUSELEAVE:"mouseleave"+H,TOUCHSTART:"touchstart"+H,TOUCHMOVE:"touchmove"+H,TOUCHEND:"touchend"+H,POINTERDOWN:"pointerdown"+H,POINTERUP:"pointerup"+H,DRAG_START:"dragstart"+H,LOAD_DATA_API:"load"+H+R,CLICK_DATA_API:"click"+H+R},B="carousel",V="active",Y="slide",z="carousel-item-right",X="carousel-item-left",$="carousel-item-next",G="carousel-item-prev",J="pointer-event",Z=".active",tt=".active.carousel-item",et=".carousel-item",nt=".carousel-item img",it=".carousel-item-next, .carousel-item-prev",ot=".carousel-indicators",rt="[data-slide], [data-slide-to]",st='[data-ride="carousel"]',at={TOUCH:"touch",PEN:"pen"},lt=function(){function r(t,e){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._element=t,this._indicatorsElement=this._element.querySelector(ot),this._touchSupported="ontouchstart"in document.documentElement||0<navigator.maxTouchPoints,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var t=r.prototype;return t.next=function(){this._isSliding||this._slide(W)},t.nextWhenVisible=function(){!document.hidden&&g(this._element).is(":visible")&&"hidden"!==g(this._element).css("visibility")&&this.next()},t.prev=function(){this._isSliding||this._slide(q)},t.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(it)&&(_.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},t.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},t.to=function(t){var e=this;this._activeElement=this._element.querySelector(tt);var n=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)g(this._element).one(Q.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=n<t?W:q;this._slide(i,this._items[t])}},t.dispose=function(){g(this._element).off(H),g.removeData(this._element,j),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},t._getConfig=function(t){return t=l({},F,t),_.typeCheckConfig(L,t,U),t},t._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;0<e&&this.prev(),e<0&&this.next()}},t._addEventListeners=function(){var e=this;this._config.keyboard&&g(this._element).on(Q.KEYDOWN,function(t){return e._keydown(t)}),"hover"===this._config.pause&&g(this._element).on(Q.MOUSEENTER,function(t){return e.pause(t)}).on(Q.MOUSELEAVE,function(t){return e.cycle(t)}),this._config.touch&&this._addTouchEventListeners()},t._addTouchEventListeners=function(){var n=this;if(this._touchSupported){var e=function(t){n._pointerEvent&&at[t.originalEvent.pointerType.toUpperCase()]?n.touchStartX=t.originalEvent.clientX:n._pointerEvent||(n.touchStartX=t.originalEvent.touches[0].clientX)},i=function(t){n._pointerEvent&&at[t.originalEvent.pointerType.toUpperCase()]&&(n.touchDeltaX=t.originalEvent.clientX-n.touchStartX),n._handleSwipe(),"hover"===n._config.pause&&(n.pause(),n.touchTimeout&&clearTimeout(n.touchTimeout),n.touchTimeout=setTimeout(function(t){return n.cycle(t)},500+n._config.interval))};g(this._element.querySelectorAll(nt)).on(Q.DRAG_START,function(t){return t.preventDefault()}),this._pointerEvent?(g(this._element).on(Q.POINTERDOWN,function(t){return e(t)}),g(this._element).on(Q.POINTERUP,function(t){return i(t)}),this._element.classList.add(J)):(g(this._element).on(Q.TOUCHSTART,function(t){return e(t)}),g(this._element).on(Q.TOUCHMOVE,function(t){var e;(e=t).originalEvent.touches&&1<e.originalEvent.touches.length?n.touchDeltaX=0:n.touchDeltaX=e.originalEvent.touches[0].clientX-n.touchStartX}),g(this._element).on(Q.TOUCHEND,function(t){return i(t)}))}},t._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},t._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(et)):[],this._items.indexOf(t)},t._getItemByDirection=function(t,e){var n=t===W,i=t===q,o=this._getItemIndex(e),r=this._items.length-1;if((i&&0===o||n&&o===r)&&!this._config.wrap)return e;var s=(o+(t===q?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},t._triggerSlideEvent=function(t,e){var n=this._getItemIndex(t),i=this._getItemIndex(this._element.querySelector(tt)),o=g.Event(Q.SLIDE,{relatedTarget:t,direction:e,from:i,to:n});return g(this._element).trigger(o),o},t._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var e=[].slice.call(this._indicatorsElement.querySelectorAll(Z));g(e).removeClass(V);var n=this._indicatorsElement.children[this._getItemIndex(t)];n&&g(n).addClass(V)}},t._slide=function(t,e){var n,i,o,r=this,s=this._element.querySelector(tt),a=this._getItemIndex(s),l=e||s&&this._getItemByDirection(t,s),c=this._getItemIndex(l),h=Boolean(this._interval);if(o=t===W?(n=X,i=$,M):(n=z,i=G,K),l&&g(l).hasClass(V))this._isSliding=!1;else if(!this._triggerSlideEvent(l,o).isDefaultPrevented()&&s&&l){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(l);var u=g.Event(Q.SLID,{relatedTarget:l,direction:o,from:a,to:c});if(g(this._element).hasClass(Y)){g(l).addClass(i),_.reflow(l),g(s).addClass(n),g(l).addClass(n);var f=parseInt(l.getAttribute("data-interval"),10);this._config.interval=f?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,f):this._config.defaultInterval||this._config.interval;var d=_.getTransitionDurationFromElement(s);g(s).one(_.TRANSITION_END,function(){g(l).removeClass(n+" "+i).addClass(V),g(s).removeClass(V+" "+i+" "+n),r._isSliding=!1,setTimeout(function(){return g(r._element).trigger(u)},0)}).emulateTransitionEnd(d)}else g(s).removeClass(V),g(l).addClass(V),this._isSliding=!1,g(this._element).trigger(u);h&&this.cycle()}},r._jQueryInterface=function(i){return this.each(function(){var t=g(this).data(j),e=l({},F,g(this).data());"object"==typeof i&&(e=l({},e,i));var n="string"==typeof i?i:e.slide;if(t||(t=new r(this,e),g(this).data(j,t)),"number"==typeof i)t.to(i);else if("string"==typeof n){if("undefined"==typeof t[n])throw new TypeError('No method n
9amed "'+n+'"');t[n]()}else e.interval&&e.ride&&(t.pause(),t.cycle())})},r._dataApiClickHandler=function(t){var e=_.getSelectorFromElement(this);if(e){var n=g(e)[0];if(n&&g(n).hasClass(B)){var i=l({},g(n).data(),g(this).data()),o=this.getAttribute("data-slide-to");o&&(i.interval=!1),r._jQueryInterface.call(g(n),i),o&&g(n).data(j).to(o),t.preventDefault()}}},s(r,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return F}}]),r}();g(document).on(Q.CLICK_DATA_API,rt,lt._dataApiClickHandler),g(window).on(Q.LOAD_DATA_API,function(){for(var t=[].slice.call(document.querySelectorAll(st)),e=0,n=t.length;e<n;e++){var i=g(t[e]);lt._jQueryInterface.call(i,i.data())}}),g.fn[L]=lt._jQueryInterface,g.fn[L].Constructor=lt,g.fn[L].noConflict=function(){return g.fn[L]=x,lt._jQueryInterface};var ct="collapse",ht="bs.collapse",ut="."+ht,ft=g.fn[ct],dt={toggle:!0,parent:""},gt={toggle:"boolean",parent:"(string|element)"},_t={SHOW:"show"+ut,SHOWN:"shown"+ut,HIDE:"hide"+ut,HIDDEN:"hidden"+ut,CLICK_DATA_API:"click"+ut+".data-api"},mt="show",pt="collapse",vt="collapsing",yt="collapsed",Et="width",Ct="height",Tt=".show, .collapsing",St='[data-toggle="collapse"]',bt=function(){function a(e,t){this._isTransitioning=!1,this._element=e,this._config=this._getConfig(t),this._triggerArray=[].slice.call(document.querySelectorAll('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var n=[].slice.call(document.querySelectorAll(St)),i=0,o=n.length;i<o;i++){var r=n[i],s=_.getSelectorFromElement(r),a=[].slice.call(document.querySelectorAll(s)).filter(function(t){return t===e});null!==s&&0<a.length&&(this._selector=s,this._triggerArray.push(r))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var t=a.prototype;return t.toggle=function(){g(this._element).hasClass(mt)?this.hide():this.show()},t.show=function(){var t,e,n=this;if(!this._isTransitioning&&!g(this._element).hasClass(mt)&&(this._parent&&0===(t=[].slice.call(this._parent.querySelectorAll(Tt)).filter(function(t){return"string"==typeof n._config.parent?t.getAttribute("data-parent")===n._config.parent:t.classList.contains(pt)})).length&&(t=null),!(t&&(e=g(t).not(this._selector).data(ht))&&e._isTransitioning))){var i=g.Event(_t.SHOW);if(g(this._element).trigger(i),!i.isDefaultPrevented()){t&&(a._jQueryInterface.call(g(t).not(this._selector),"hide"),e||g(t).data(ht,null));var o=this._getDimension();g(this._element).removeClass(pt).addClass(vt),this._element.style[o]=0,this._triggerArray.length&&g(this._triggerArray).removeClass(yt).attr("aria-expanded",!0),this.setTransitioning(!0);var r="scroll"+(o[0].toUpperCase()+o.slice(1)),s=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(){g(n._element).removeClass(vt).addClass(pt).addClass(mt),n._element.style[o]="",n.setTransitioning(!1),g(n._element).trigger(_t.SHOWN)}).emulateTransitionEnd(s),this._element.style[o]=this._element[r]+"px"}}},t.hide=function(){var t=this;if(!this._isTransitioning&&g(this._element).hasClass(mt)){var e=g.Event(_t.HIDE);if(g(this._element).trigger(e),!e.isDefaultPrevented()){var n=this._getDimension();this._element.style[n]=this._element.getBoundingClientRect()[n]+"px",_.reflow(this._element),g(this._element).addClass(vt).removeClass(pt).removeClass(mt);var i=this._triggerArray.length;if(0<i)for(var o=0;o<i;o++){var r=this._triggerArray[o],s=_.getSelectorFromElement(r);if(null!==s)g([].slice.call(document.querySelectorAll(s))).hasClass(mt)||g(r).addClass(yt).attr("aria-expanded",!1)}this.setTransitioning(!0);this._element.style[n]="";var a=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(){t.setTransitioning(!1),g(t._element).removeClass(vt).addClass(pt).trigger(_t.HIDDEN)}).emulateTransitionEnd(a)}}},t.setTransitioning=function(t){this._isTransitioning=t},t.dispose=function(){g.removeData(this._element,ht),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},t._getConfig=function(t){return(t=l({},dt,t)).toggle=Boolean(t.toggle),_.typeCheckConfig(ct,t,gt),t},t._getDimension=function(){return g(this._element).hasClass(Et)?Et:Ct},t._getParent=function(){var t,n=this;_.isElement(this._config.parent)?(t=this._config.parent,"undefined"!=typeof this._config.parent.jquery&&(t=this._config.parent[0])):t=document.querySelector(this._config.parent);var e='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]',i=[].slice.call(t.querySelectorAll(e));return g(i).each(function(t,e){n._addAriaAndCollapsedClass(a._getTargetFromElement(e),[e])}),t},t._addAriaAndCollapsedClass=function(t,e){var n=g(t).hasClass(mt);e.length&&g(e).toggleClass(yt,!n).attr("aria-expanded",n)},a._getTargetFromElement=function(t){var e=_.getSelectorFromElement(t);return e?document.querySelector(e):null},a._jQueryInterface=function(i){return this.each(function(){var t=g(this),e=t.data(ht),n=l({},dt,t.data(),"object"==typeof i&&i?i:{});if(!e&&n.toggle&&/show|hide/.test(i)&&(n.toggle=!1),e||(e=new a(this,n),t.data(ht,e)),"string"==typeof i){if("undefined"==typeof e[i])throw new TypeError('No method n
9amed "'+i+'"');e[i]()}})},s(a,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return dt}}]),a}();g(document).on(_t.CLICK_DATA_API,St,function(t){"A"===t.currentTarget.tagName&&t.preventDefault();var n=g(this),e=_.getSelectorFromElement(this),i=[].slice.call(document.querySelectorAll(e));g(i).each(function(){var t=g(this),e=t.data(ht)?"toggle":n.data();bt._jQueryInterface.call(t,e)})}),g.fn[ct]=bt._jQueryInterface,g.fn[ct].Constructor=bt,g.fn[ct].noConflict=function(){return g.fn[ct]=ft,bt._jQueryInterface};var It="dropdown",Dt="bs.dropdown",wt="."+Dt,At=".data-api",Nt=g.fn[It],Ot=new RegExp("38|40|27"),kt={HIDE:"hide"+wt,HIDDEN:"hidden"+wt,SHOW:"show"+wt,SHOWN:"shown"+wt,CLICK:"click"+wt,CLICK_DATA_API:"click"+wt+At,KEYDOWN_DATA_API:"keydown"+wt+At,KEYUP_DATA_API:"keyup"+wt+At},Pt="disabled",Lt="show",jt="dropup",Ht="dropright",Rt="dropleft",xt="dropdown-menu-right",Ft="position-static",Ut='[data-toggle="dropdown"]',Wt=".dropdown form",qt=".dropdown-menu",Mt=".navbar-nav",Kt=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",Qt="top-start",Bt="top-end",Vt="bottom-start",Yt="bottom-end",zt="right-start",Xt="left-start",$t={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic"},Gt={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string"},Jt=function(){function c(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var t=c.prototype;return t.toggle=function(){if(!this._element.disabled&&!g(this._element).hasClass(Pt)){var t=c._getParentFromElement(this._element),e=g(this._menu).hasClass(Lt);if(c._clearMenus(),!e){var n={relatedTarget:this._element},i=g.Event(kt.SHOW,n);if(g(t).trigger(i),!i.isDefaultPrevented()){if(!this._inNavbar){if("undefined"==typeof u)throw new TypeError("Bootstrap's dropdowns require Popper.js (https://popper.js.org/)");var o=this._element;"parent"===this._config.reference?o=t:_.isElement(this._config.reference)&&(o=this._config.reference,"undefined"!=typeof this._config.reference.jquery&&(o=this._config.reference[0])),"scrollParent"!==this._config.boundary&&g(t).addClass(Ft),this._popper=new u(o,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===g(t).closest(Mt).length&&g(document.body).children().on("mouseover",null,g.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),g(this._menu).toggleClass(Lt),g(t).toggleClass(Lt).trigger(g.Event(kt.SHOWN,n))}}}},t.show=function(){if(!(this._element.disabled||g(this._element).hasClass(Pt)||g(this._menu).hasClass(Lt))){var t={relatedTarget:this._element},e=g.Event(kt.SHOW,t),n=c._getParentFromElement(this._element);g(n).trigger(e),e.isDefaultPrevented()||(g(this._menu).toggleClass(Lt),g(n).toggleClass(Lt).trigger(g.Event(kt.SHOWN,t)))}},t.hide=function(){if(!this._element.disabled&&!g(this._element).hasClass(Pt)&&g(this._menu).hasClass(Lt)){var t={relatedTarget:this._element},e=g.Event(kt.HIDE,t),n=c._getParentFromElement(this._element);g(n).trigger(e),e.isDefaultPrevented()||(g(this._menu).toggleClass(Lt),g(n).toggleClass(Lt).trigger(g.Event(kt.HIDDEN,t)))}},t.dispose=function(){g.removeData(this._element,Dt),g(this._element).off(wt),this._element=null,(this._menu=null)!==this._popper&&(this._popper.destroy(),this._popper=null)},t.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},t._addEventListeners=function(){var e=this;g(this._element).on(kt.CLICK,function(t){t.preventDefault(),t.stopPropagation(),e.toggle()})},t._getConfig=function(t){return t=l({},this.constructor.Default,g(this._element).data(),t),_.typeCheckConfig(It,t,this.constructor.DefaultType),t},t._getMenuElement=function(){if(!this._menu){var t=c._getParentFromElement(this._element);t&&(this._menu=t.querySelector(qt))}return this._menu},t._getPlacement=function(){var t=g(this._element.parentNode),e=Vt;return t.hasClass(jt)?(e=Qt,g(this._menu).hasClass(xt)&&(e=Bt)):t.hasClass(Ht)?e=zt:t.hasClass(Rt)?e=Xt:g(this._menu).hasClass(xt)&&(e=Yt),e},t._detectNavbar=function(){return 0<g(this._element).closest(".
9navbar").length},t._getOffset=function(){var e=this,t={};return"function"==typeof this._config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e._config.offset(t.offsets,e._element)||{}),t}:t.offset=this._config.offset,t},t._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),t},c._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(Dt);if(t||(t=new c(this,"object"==typeof e?e:null),g(this).data(Dt,t)),"string"==typeof e){if("undefined"==typeof t[e])throw new TypeError('No method named "'+e+'"');t[e]()}})},c._clearMenus=function(t){if(!t||3!==t.which&&("keyup"!==t.type||9===t.which))for(var e=[].slice.call(document.querySelectorAll(Ut)),n=0,i=e.length;n<i;n++){var o=c._getParentFromElement(e[n]),r=g(e[n]).data(Dt),s={relatedTarget:e[n]};if(t&&"click"===t.type&&(s.clickEvent=t),r){var a=r._menu;if(g(o).hasClass(Lt)&&!(t&&("click"===t.type&&/input|textarea/i.test(t.target.tagName)||"keyup"===t.type&&9===t.which)&&g.contains(o,t.target))){var l=g.Event(kt.HIDE,s);g(o).trigger(l),l.isDefaultPrevented()||("ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),e[n].setAttribute("aria-expanded","false"),g(a).removeClass(Lt),g(o).removeClass(Lt).trigger(g.Event(kt.HIDDEN,s)))}}}},c._getParentFromElement=function(t){var e,n=_.getSelectorFromElement(t);return n&&(e=document.querySelector(n)),e||t.parentNode},c._dataApiKeydownHandler=function(t){if((/input|textarea/i.test(t.target.tagName)?!(32===t.which||27!==t.which&&(40!==t.which&&38!==t.which||g(t.target).closest(qt).length)):Ot.test(t.which))&&(t.preventDefault(),t.stopPropagation(),!this.disabled&&!g(this).hasClass(Pt))){var e=c._getParentFromElement(this),n=g(e).hasClass(Lt);if(n&&(!n||27!==t.which&&32!==t.which)){var i=[].slice.call(e.querySelectorAll(Kt));if(0!==i.length){var o=i.indexOf(t.target);38===t.which&&0<o&&o--,40===t.which&&o<i.length-1&&o++,o<0&&(o=0),i[o].focus()}}else{if(27===t.which){var r=e.querySelector(Ut);g(r).trigger("focus")}g(this).trigger("click")}}},s(c,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return $t}},{key:"DefaultType",get:function(){return Gt}}]),c}();g(document).on(kt.KEYDOWN_DATA_API,Ut,Jt._dataApiKeydownHandler).on(kt.KEYDOWN_DATA_API,qt,Jt._dataApiKeydownHandler).on(kt.CLICK_DATA_API+" "+kt.KEYUP_DATA_API,Jt._clearMenus).on(kt.CLICK_DATA_API,Ut,function(t){t.preventDefault(),t.stopPropagation(),Jt._jQueryInterface.call(g(this),"toggle")}).on(kt.CLICK_DATA_API,Wt,function(t){t.stopPropagation()}),g.fn[It]=Jt._jQueryInterface,g.fn[It].Constructor=Jt,g.fn[It].noConflict=function(){return g.fn[It]=Nt,Jt._jQueryInterface};var Zt="modal",te="bs.modal",ee="."+te,ne=g.fn[Zt],ie={backdrop:!0,keyboard:!0,focus:!0,show:!0},oe={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},re={HIDE:"hide"+ee,HIDDEN:"hidden"+ee,SHOW:"show"+ee,SHOWN:"shown"+ee,FOCUSIN:"focusin"+ee,RESIZE:"resize"+ee,CLICK_DISMISS:"click.dismiss"+ee,KEYDOWN_DISMISS:"keydown.dismiss"+ee,MOUSEUP_DISMISS:"mouseup.dismiss"+ee,MOUSEDOWN_DISMISS:"mousedown.dismiss"+ee,CLICK_DATA_API:"click"+ee+".data-api"},se="modal-dialog-scrollable",ae="modal-scrollbar-measure",le="modal-backdrop",ce="modal-open",he="fade",ue="show",fe=".modal-dialog",de=".modal-body",ge='[data-toggle="modal"]',_e='[data-dismiss="modal"]',me=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",pe=".sticky-top",ve=function(){function o(t,e){this._config=this._getConfig(e),this._element=t,this._dialog=t.querySelector(fe),this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollbarWidth=0}var t=o.prototype;return t.toggle=function(t){return this._isShown?this.hide():this.show(t)},t.show=function(t){var e=this;if(!this._isShown&&!this._isTransitioning){g(this._element).hasClass(he)&&(this._isTransitioning=!0);var n=g.Event(re.SHOW,{relatedTarget:t});g(this._element).trigger(n),this._isShown||n.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),g(this._element).on(re.CLICK_DISMISS,_e,function(t){return e.hide(t)}),g(this._dialog).on(re.MOUSEDOWN_DISMISS,function(){g(e._element).one(re.MOUSEUP_DISMISS,function(t){g(t.target).is(e._element)&&(e._ignoreBackdropClick=!0)})}),this._showBackdrop(function(){return e._showElement(t)}))}},t.hide=function(t){var e=this;if(t&&t.preventDefault(),this._isShown&&!this._isTransitioning){var n=g.Event(re.HIDE);if(g(this._element).trigger(n),this._isShown&&!n.isDefaultPrevented()){this._isShown=!1;var i=g(this._element).hasClass(he);if(i&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),g(document).off(re.FOCUSIN),g(this._element).removeClass(ue),g(this._element).off(re.CLICK_DISMISS),g(this._dialog).off(re.MOUSEDOWN_DISMISS),i){var o=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,function(t){return e._hideModal(t)}).emulateTransitionEnd(o)}else this._hideModal()}}},t.dispose=function(){[window,this._element,this._dialog].forEach(function(t){return g(t).off(ee)}),g(document).off(re.FOCUSIN),g.removeData(this._element,te),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._isTransitioning=null,this._scrollbarWidth=null},t.handleUpdate=function(){this._adjustDialog()},t._getConfig=function(t){return t=l({},ie,t),_.typeCheckConfig(Zt,t,oe),t},t._showElement=function(t){var e=this,n=g(this._element).hasClass(he);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),g(this._dialog).hasClass(se)?this._dialog.querySelector(de).scrollTop=0:this._element.scrollTop=0,n&&_.reflow(this._element),g(this._element).addClass(ue),this._config.focus&&this._enforceFocus();
9var i=g.Event(re.SHOWN,{relatedTarget:t}),o=function(){e._config.focus&&e._element.focus(),e._isTransitioning=!1,g(e._element).trigger(i)};if(n){var r=_.getTransitionDurationFromElement(this._dialog);g(this._dialog).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o()},t._enforceFocus=function(){var e=this;g(document).off(re.FOCUSIN).on(re.FOCUSIN,function(t){document!==t.target&&e._element!==t.target&&0===g(e._element).has(t.target).length&&e._element.focus()})},t._setEscapeEvent=function(){var e=this;this._isShown&&this._config.keyboard?g(this._element).on(re.KEYDOWN_DISMISS,function(t){27===t.which&&(t.preventDefault(),e.hide())}):this._isShown||g(this._element).off(re.KEYDOWN_DISMISS)},t._setResizeEvent=function(){var e=this;this._isShown?g(window).on(re.RESIZE,function(t){return e.handleUpdate(t)}):g(window).off(re.RESIZE)},t._hideModal=function(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._isTransitioning=!1,this._showBackdrop(function(){g(document.body).removeClass(ce),t._resetAdjustments(),t._resetScrollbar(),g(t._element).trigger(re.HIDDEN)})},t._removeBackdrop=function(){this._backdrop&&(g(this._backdrop).remove(),this._backdrop=null)},t._showBackdrop=function(t){var e=this,n=g(this._element).hasClass(he)?he:"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className=le,n&&this._backdrop.classList.add(n),g(this._backdrop).appendTo(document.body),g(this._element).on(re.CLICK_DISMISS,function(t){e._ignoreBackdropClick?e._ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"===e._config.backdrop?e._element.focus():e.hide())}),n&&_.reflow(this._backdrop),g(this._backdrop).addClass(ue),!t)return;if(!n)return void t();var i=_.getTransitionDurationFromElement(this._backdrop);g(this._backdrop).one(_.TRANSITION_END,t).emulateTransitionEnd(i)}else if(!this._isShown&&this._backdrop){g(this._backdrop).removeClass(ue);var o=function(){e._removeBackdrop(),t&&t()};if(g(this._element).hasClass(he)){var r=_.getTransitionDurationFromElement(this._backdrop);g(this._backdrop).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o()}else t&&t()},t._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},t._setScrollbar=function(){var o=this;if(this._isBodyOverflowing){var t=[].slice.call(document.querySelectorAll(me)),e=[].slice.call(document.querySelectorAll(pe));g(t).each(function(t,e){var n=e.style.paddingRight,i=g(e).css("padding-right");g(e).data("padding-right",n).css("padding-right",parseFloat(i)+o._scrollbarWidth+"px")}),g(e).each(function(t,e){var n=e.style.marginRight,i=g(e).css("margin-right");g(e).data("margin-right",n).css("margin-right",parseFloat(i)-o._scrollbarWidth+"px")});var n=document.body.style.paddingRight,i=g(document.body).css("padding-right");g(document.body).data("padding-right",n).css("padding-right",parseFloat(i)+this._scrollbarWidth+"px")}g(document.body).addClass(ce)},t._resetScrollbar=function(){var t=[].slice.call(document.querySelectorAll(me));g(t).each(function(t,e){var n=g(e).data("padding-right");g(e).removeData("padding-right"),e.style.paddingRight=n||""});var e=[].slice.call(document.querySelectorAll(""+pe));g(e).each(function(t,e){var n=g(e).data("margin-right");"undefined"!=typeof n&&g(e).css("margin-right",n).removeData("margin-right")});var n=g(document.body).data("padding-right");g(document.body).removeData("padding-right"),document.body.style.paddingRight=n||""},t._getScrollbarWidth=function(){var t=document.createElement("div");t.className=ae,document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},o._jQueryInterface=function(n,i){return this.each(function(){var t=g(this).data(te),e=l({},ie,g(this).data(),"object"==typeof n&&n?n:{});if(t||(t=new o(this,e),g(this).data(te,t)),"string"==typeof n){if("undefined"==typeof t[n])throw new TypeError('No method n
9amed "'+n+'"');t[n](i)}else e.show&&t.show(i)})},s(o,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return ie}}]),o}();g(document).on(re.CLICK_DATA_API,ge,function(t){var e,n=this,i=_.getSelectorFromElement(this);i&&(e=document.querySelector(i));var o=g(e).data(te)?"toggle":l({},g(e).data(),g(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||t.preventDefault();var r=g(e).one(re.SHOW,function(t){t.isDefaultPrevented()||r.one(re.HIDDEN,function(){g(n).is(":visible")&&n.focus()})});ve._jQueryInterface.call(g(e),o,this)}),g.fn[Zt]=ve._jQueryInterface,g.fn[Zt].Constructor=ve,g.fn[Zt].noConflict=function(){return g.fn[Zt]=ne,ve._jQueryInterface};var ye=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],Ee={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Ce=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,Te=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function Se(t,s,e){if(0===t.length)return t;if(e&&"function"==typeof e)return e(t);for(var n=(new window.DOMParser).parseFromString(t,"text/html"),a=Object.keys(s),l=[].slice.call(n.body.querySelectorAll("*")),i=function(t,e){var n=l[t],i=n.nodeName.toLowerCase();if(-1===a.indexOf(n.nodeName.toLowerCase()))return n.parentNode.removeChild(n),"continue";var o=[].slice.call(n.attributes),r=[].concat(s["*"]||[],s[i]||[]);o.forEach(function(t){(function(t,e){var n=t.nodeName.toLowerCase();if(-1!==e.indexOf(n))return-1===ye.indexOf(n)||Boolean(t.nodeValue.match(Ce)||t.nodeValue.match(Te));for(var i=e.filter(function(t){return t instanceof RegExp}),o=0,r=i.length;o<r;o++)if(n.match(i[o]))return!0;return!1})(t,r)||n.removeAttribute(t.nodeName)})},o=0,r=l.length;o<r;o++)i(o);return n.body.innerHTML}var be="tooltip",Ie="bs.tooltip",De="."+Ie,we=g.fn[be],Ae="bs-tooltip",Ne=new RegExp("(^|\\s)"+Ae+"\\S+","g"),Oe=["sanitize","whiteList","sanitizeFn"],ke={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string|function)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)",sanitize:"boolean",sanitizeFn:"(null|function)",whiteList:"object"},Pe={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},Le={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:Ee},je="show",He="out",Re={HIDE:"hide"+De,HIDDEN:"hidden"+De,SHOW:"show"+De,SHOWN:"shown"+De,INSERTED:"inserted"+De,CLICK:"click"+De,FOCUSIN:"focusin"+De,FOCUSOUT:"focusout"+De,MOUSEENTER:"mouseenter"+De,MOUSELEAVE:"mouseleave"+De},xe="fade",Fe="show",Ue=".tooltip-inner",We=".arrow",qe="hover",Me="focus",Ke="click",Qe="manual",Be=function(){function i(t,e){if("undefined"==typeof u)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=g(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(g(this.getTipElement()).hasClass(Fe))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),g.removeData(this.element,this.constructor.DATA_KEY),g(this.element).off(this.constructor.EVENT_KEY),g(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&g(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===g(this.element).css("display"))throw new Error("Please use show on visible elements");var t=g.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){g(this.element).trigger(t);var n=_.findShadowRoot(this.element),i=g.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!i)return;var o=this.getTipElement(),r=_.getUID(this.constructor.NAME);o.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&g(o).addClass(xe);var s="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,a=this._getAttachment(s);this.addAttachmentClass(a);var l=this._getContainer();g(o).data(this.constructor.DATA_KEY,this),g.contains(this.element.ownerDocument.documentElement,this.tip)||g(o).appendTo(l),g(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new u(this.element,o,{placement:a,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:We}
9,preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),g(o).addClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().on("mouseover",null,g.noop);var c=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,g(e.element).trigger(e.constructor.Event.SHOWN),t===He&&e._leave(null,e)};if(g(this.tip).hasClass(xe)){var h=_.getTransitionDurationFromElement(this.tip);g(this.tip).one(_.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=g.Event(this.constructor.Event.HIDE),o=function(){e._hoverState!==je&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),g(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(g(this.element).trigger(i),!i.isDefaultPrevented()){if(g(n).removeClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),this._activeTrigger[Ke]=!1,this._activeTrigger[Me]=!1,this._activeTrigger[qe]=!1,g(this.tip).hasClass(xe)){var r=_.getTransitionDurationFromElement(n);g(n).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){g(this.getTipElement()).addClass(Ae+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},t.setContent=function(){var t=this.getTipElement();this.setElementContent(g(t.querySelectorAll(Ue)),this.getTitle()),g(t).removeClass(xe+" "+Fe)},t.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=Se(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?g(e).parent().is(t)||t.empty().append(e):t.text(g(e).text())},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getOffset=function(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},t._getContainer=function(){return!1===this.config.container?document.body:_.isElement(this.config.container)?g(this.config.container):g(document).find(this.config.container)},t._getAttachment=function(t){return Pe[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)g(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==Qe){var e=t===qe?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===qe?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;g(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}}),g(this.element).closest(".modal").on("hide.bs.modal",function(){i.element&&i.hide()}),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Me:qe]=!0),g(e.getTipElement()).hasClass(Fe)||e._hoverState===je?e._hoverState=je:(clearTimeout(e._timeout),e._hoverState=je,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===je&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Me:qe]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=He,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===He&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){var e=g(this.element).data();return Object.keys(e).forEach(function(t){-1!==Oe.indexOf(t)&&delete e[t]}),"number"==typeof(t=l({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),_.typeCheckConfig(be,t,this.constructor.DefaultType),t.sanitize&&(t.template=Se(t.template,t.whiteList,t.sanitizeFn)),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ne);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(g(t).removeClass(xe),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ie),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ie,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method n
9amed "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Le}},{key:"NAME",get:function(){return be}},{key:"DATA_KEY",get:function(){return Ie}},{key:"Event",get:function(){return Re}},{key:"EVENT_KEY",get:function(){return De}},{key:"DefaultType",get:function(){return ke}}]),i}();g.fn[be]=Be._jQueryInterface,g.fn[be].Constructor=Be,g.fn[be].noConflict=function(){return g.fn[be]=we,Be._jQueryInterface};var Ve="popover",Ye="bs.popover",ze="."+Ye,Xe=g.fn[Ve],$e="bs-popover",Ge=new RegExp("(^|\\s)"+$e+"\\S+","g"),Je=l({},Be.Default,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'}),Ze=l({},Be.DefaultType,{content:"(string|element|function)"}),tn="fade",en="show",nn=".popover-header",on=".popover-body",rn={HIDE:"hide"+ze,HIDDEN:"hidden"+ze,SHOW:"show"+ze,SHOWN:"shown"+ze,INSERTED:"inserted"+ze,CLICK:"click"+ze,FOCUSIN:"focusin"+ze,FOCUSOUT:"focusout"+ze,MOUSEENTER:"mouseenter"+ze,MOUSELEAVE:"mouseleave"+ze},sn=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var o=i.prototype;return o.isWithContent=function(){return this.getTitle()||this._getContent()},o.addAttachmentClass=function(t){g(this.getTipElement()).addClass($e+"-"+t)},o.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},o.setContent=function(){var t=g(this.getTipElement());this.setElementContent(t.find(nn),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(on),e),t.removeClass(tn+" "+en)},o._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},o._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ge);null!==e&&0<e.length&&t.removeClass(e.join(""))},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ye),e="object"==typeof n?n:null;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ye,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Je}},{key:"NAME",get:function(){return Ve}},{key:"DATA_KEY",get:function(){return Ye}},{key:"Event",get:function(){return rn}},{key:"EVENT_KEY",get:function(){return ze}},{key:"DefaultType",get:function(){return Ze}}]),i}(Be);g.fn[Ve]=sn._jQueryInterface,g.fn[Ve].Constructor=sn,g.fn[Ve].noConflict=function(){return g.fn[Ve]=Xe,sn._jQueryInterface};var an="scrollspy",ln="bs.scrollspy",cn="."+ln,hn=g.fn[an],un={offset:10,method:"auto",target:""},fn={offset:"number",method:"string",target:"(string|element)"},dn={ACTIVATE:"activate"+cn,SCROLL:"scroll"+cn,LOAD_DATA_API:"load"+cn+".data-api"},gn="dropdown-item",_n="active",mn='[data-spy="scroll"]',pn=".nav, .list-group",vn=".nav-link",yn=".nav-item",En=".list-group-item",Cn=".dropdown",Tn=".dropdown-item",Sn=".dropdown-toggle",bn="offset",In="position",Dn=function(){function n(t,e){var n=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(e),this._selector=this._config.target+" "+vn+","+this._config.target+" "+En+","+this._config.target+" "+Tn,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,g(this._scrollElement).on(dn.SCROLL,function(t){return n._process(t)}),this.refresh(),this._process()}var t=n.prototype;return t.refresh=function(){var e=this,t=this._scrollElement===this._scrollElement.window?bn:In,o="auto"===this._config.method?t:this._config.method,r=o===In?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map(function(t){var e,n=_.getSelectorFromElement(t);if(n&&(e=document.querySelector(n)),e){var i=e.getBoundingClientRect();if(i.width||i.height)return[g(e)[o]().top+r,n]}return null}).filter(function(t){return t}).sort(function(t,e){return t[0]-e[0]}
9).forEach(function(t){e._offsets.push(t[0]),e._targets.push(t[1])})},t.dispose=function(){g.removeData(this._element,ln),g(this._scrollElement).off(cn),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},t._getConfig=function(t){if("string"!=typeof(t=l({},un,"object"==typeof t&&t?t:{})).target){var e=g(t.target).attr("id");e||(e=_.getUID(an),g(t.target).attr("id",e)),t.target="#"+e}return _.typeCheckConfig(an,t,fn),t},t._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},t._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},t._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},t._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),n<=t){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t<this._offsets[0]&&0<this._offsets[0])return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t<this._offsets[o+1])&&this._activate(this._targets[o])}}},t._activate=function(e){this._activeTarget=e,this._clear();var t=this._selector.split(",").map(function(t){return t+'[data-target="'+e+'"],'+t+'[href="'+e+'"]'}),n=g([].slice.call(document.querySelectorAll(t.join(","))));n.hasClass(gn)?(n.closest(Cn).find(Sn).addClass(_n),n.addClass(_n)):(n.addClass(_n),n.parents(pn).prev(vn+", "+En).addClass(_n),n.parents(pn).prev(yn).children(vn).addClass(_n)),g(this._scrollElement).trigger(dn.ACTIVATE,{relatedTarget:e})},t._clear=function(){[].slice.call(document.querySelectorAll(this._selector)).filter(function(t){return t.classList.contains(_n)}).forEach(function(t){return t.classList.remove(_n)})},n._jQueryInterface=function(e){return this.each(function(){var t=g(this).data(ln);if(t||(t=new n(this,"object"==typeof e&&e),g(this).data(ln,t)),"string"==typeof e){if("undefined"==typeof t[e])throw new TypeError('No method named "'+e+'"');t[e]()}})},s(n,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return un}}]),n}();g(window).on(dn.LOAD_DATA_API,function(){for(var t=[].slice.call(document.querySelectorAll(mn)),e=t.length;e--;){var n=g(t[e]);Dn._jQueryInterface.call(n,n.data())}}),g.fn[an]=Dn._jQueryInterface,g.fn[an].Constructor=Dn,g.fn[an].noConflict=function(){return g.fn[an]=hn,Dn._jQueryInterface};var wn="bs.tab",An="."+wn,Nn=g.fn.tab,On={HIDE:"hide"+An,HIDDEN:"hidden"+An,SHOW:"show"+An,SHOWN:"shown"+An,CLICK_DATA_API:"click"+An+".data-api"},kn="dropdown-menu",Pn="active",Ln="disabled",jn="fade",Hn="show",Rn=".dropdown",xn=".nav, .list-group",Fn=".active",Un="> li > .active",Wn='[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',qn=".dropdown-toggle",Mn="> .dropdown-menu .active",Kn=function(){function i(t){this._element=t}var t=i.prototype;return t.show=function(){var n=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&g(this._element).hasClass(Pn)||g(this._element).hasClass(Ln))){var t,i,e=g(this._element).closest(xn)[0],o=_.getSelectorFromElement(this._element);if(e){var r="UL"===e.nodeName||"OL"===e.nodeName?Un:Fn;i=(i=g.makeArray(g(e).find(r)))[i.length-1]}var s=g.Event(On.HIDE,{relatedTarget:this._element}),a=g.Event(On.SHOW,{relatedTarget:i});if(i&&g(i).trigger(s),g(this._element).trigger(a),!a.isDefaultPrevented()&&!s.isDefaultPrevented()){o&&(t=document.querySelector(o)),this._activate(this._element,e);var l=function(){var t=g.Event(On.HIDDEN,{relatedTarget:n._element}),e=g.Event(On.SHOWN,{relatedTarget:i});g(i).trigger(t),g(n._element).trigger(e)};t?this._activate(t,t.parentNode,l):l()}}},t.dispose=function(){g.removeData(this._element,wn),this._element=null},t._activate=function(t,e,n){var i=this,o=(!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?g(e).children(Fn):g(e).find(Un))[0],r=n&&o&&g(o).hasClass(jn),s=function(){return i._transitionComplete(t,o,n)};if(o&&r){var a=_.getTransitionDurationFromElement(o);g(o).removeClass(Hn).one(_.TRANSITION_END,s).emulateTransitionEnd(a)}else s()},t._transitionComplete=function(t,e,n){if(e){g(e).removeClass(Pn);var i=g(e.parentNode).find(Mn)[0];i&&g(i).removeClass(Pn),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!1)}if(g(t).addClass(Pn),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),_.reflow(t),t.classList.contains(jn)&&t.classList.add(Hn),t.parentNode&&g(t.parentNode).hasClass(kn)){var o=g(t).closest(Rn)[0];if(o){var r=[].slice.call(o.querySelectorAll(qn));g(r).addClass(Pn)}t.setAttribute("aria-expanded",!0)}n&&n()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(wn);if(e||(e=new i(this),t.data(wn,e)),"string"==typeof n){if("undefined"==typeof e[n])throw new TypeError('No method n
9amed "'+n+'"');e[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}}]),i}();g(document).on(On.CLICK_DATA_API,Wn,function(t){t.preventDefault(),Kn._jQueryInterface.call(g(this),"show")}),g.fn.tab=Kn._jQueryInterface,g.fn.tab.Constructor=Kn,g.fn.tab.noConflict=function(){return g.fn.tab=Nn,Kn._jQueryInterface};var Qn="toast",Bn="bs.toast",Vn="."+Bn,Yn=g.fn[Qn],zn={CLICK_DISMISS:"click.dismiss"+Vn,HIDE:"hide"+Vn,HIDDEN:"hidden"+Vn,SHOW:"show"+Vn,SHOWN:"shown"+Vn},Xn="fade",$n="hide",Gn="show",Jn="showing",Zn={animation:"boolean",autohide:"boolean",delay:"number"},ti={animation:!0,autohide:!0,delay:500},ei='[data-dismiss="toast"]',ni=function(){function i(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var t=i.prototype;return t.show=function(){var t=this;g(this._element).trigger(zn.SHOW),this._config.animation&&this._element.classList.add(Xn);var e=function(){t._element.classList.remove(Jn),t._element.classList.add(Gn),g(t._element).trigger(zn.SHOWN),t._config.autohide&&t.hide()};if(this._element.classList.remove($n),this._element.classList.add(Jn),this._config.animation){var n=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},t.hide=function(t){var e=this;this._element.classList.contains(Gn)&&(g(this._element).trigger(zn.HIDE),t?this._close():this._timeout=setTimeout(function(){e._close()},this._config.delay))},t.dispose=function(){clearTimeout(this._timeout),this._timeout=null,this._element.classList.contains(Gn)&&this._element.classList.remove(Gn),g(this._element).off(zn.CLICK_DISMISS),g.removeData(this._element,Bn),this._element=null,this._config=null},t._getConfig=function(t){return t=l({},ti,g(this._element).data(),"object"==typeof t&&t?t:{}),_.typeCheckConfig(Qn,t,this.constructor.DefaultType),t},t._setListeners=function(){var t=this;g(this._element).on(zn.CLICK_DISMISS,ei,function(){return t.hide(!0)})},t._close=function(){var t=this,e=function(){t._element.classList.add($n),g(t._element).trigger(zn.HIDDEN)};if(this._element.classList.remove(Gn),this._config.animation){var n=_.getTransitionDurationFromElement(this._element);g(this._element).one(_.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(Bn);if(e||(e=new i(this,"object"==typeof n&&n),t.data(Bn,e)),"string"==typeof n){if("undefined"==typeof e[n])throw new TypeError('No method named "'+n+'"');e[n](this)}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"DefaultType",get:function(){return Zn}},{key:"Default",get:function(){return ti}}]),i}();g.fn[Qn]=ni._jQueryInterface,g.fn[Qn].Constructor=ni,g.fn[Qn].noConflict=function(){return g.fn[Qn]=Yn,ni._jQueryInterface},function(){if("undefined"==typeof g)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=g.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||4<=t[0])throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(),t.Util=_,t.Alert=p,t.Button=P,t.Carousel=lt,t.Collapse=bt,t.Dropdown=Jt,t.Modal=ve,t.Popover=sn,t.Scrollspy=Dn,t.Tab=Kn,t.Toast=ni,t.Tooltip=Be,Object.defineProperty(t,"__esModule",{value:!0})}); 10//# sourceMappingURL=bootstrap.min.js.map 11/* 12 * jQuery Nestoria Slider 13 * 14 * Copyright 2014, Lokku Ltd. 15 * Free to use and abuse under the MIT license. 16 * http://www.opensource.org/licenses/mit-license.php 17 */ 18(function($) { 19 /* 20 * These are used for user interaction. This plugin assumes the user can 21 * interact with one control at a time. For this reason it's safe to keep 22 * these global. 23 */ 24 var _$current_slider; 25 var _is_mousedown; 26 var _original_mousex; 27 28 // both for keyboard and mouse interaction 29 var _is_left_grip; 30 31 // for keyboard interaction only 32 var _before_keydown_value; 33 var _before_keydown_pixel; 34 var _before_keyup_value; 35 var _before_keyup_pixel; 36 37 // a fixed configuration for the single bar slider, used to decide where to 38 // place the naked bar. 39 var _naked_bar_deltas; // see populateNakedBarDeltas 40 41 var _methods = { 42 /* 43 * This method must be called once during initialization. 44 * It sets the behaviour of the naked bar in case of one handle. 45 */ 46 'setNakedBarDelta': function (position, handleWidth) { 47 if (position === "stickToSides") { 48 _naked_bar_deltas = { 49 toEndWidth: handleWidth, 50 toBeginLeft: 0, 51 toBeginWidth: handleWidth 52 }; 53 } 54 else if (position === "middle") { 55 // Position naked end of the bar at the middle value. 56 _naked_bar_deltas = { 57 toEndWidth: handleWidth/2, 58 toBeginLeft: handleWidth/2, 59 toBeginWidth: handleWidth/2 60 }; 61 } 62 else { 63 throw new Error('unknown position of setNakedBarDelta: ' + position); 64 } 65 }, 66 'getSliderValuesAtPositionPx' : function (leftPx, rightPx) { 67 var $this = this, 68 leftPxInValue, rightPxInValue, 69 pixel_to_value_mapping_func = $this.data('pixel_to_value_mapping'); 70 71 if (typeof pixel_to_value_mapping_func !== 'undefined') { 72 leftPxInValue = pixel_to_value_mapping_func(leftPx); 73 rightPxInValue = pixel_to_value_mapping_func(rightPx); 74 } 75 else { 76 var w = _methods.getSliderWidthPx.call($this) - $this.data('left_grip_width'); 77 leftPxInValue = _methods.inverse_rangemap_0_to_n.call($this, leftPx, w); 78 rightPxInValue = _methods.inverse_rangemap_0_to_n.call($this, rightPx, w); 79 } 80 81 return [leftPxInValue, rightPxInValue]; 82 }, 83 /* 84 * Move slider grips to the specified position. This method is 85 * designed to run within the user interaction lifecycle. Only call 86 * this method if the user has interacted with the sliders 87 * actually... 88 * 89 * First the desired positions are validated. If values are ok, the 90 * move is performed, otherwise it's just ignored because weird 91 * values have been passed. 92 */ 93 'validateAndMoveGripsToPx' : function (nextLeftGripPositionPx, nextRightGripPositionPx) { 94 var $this = this; 95 96 var draggableAreaLengthPx = _methods.getSliderWidthPx.call($this) - $this.data('left_grip_width'); 97 98 // 99 // Validate & Move 100 // 101 if (nextRightGripPositionPx <= draggableAreaLengthPx && 102 nextLeftGripPositionPx >= 0 && 103 nextLeftGripPositionPx <= draggableAreaLengthPx && 104 (!$this.data('has_right_grip') || nextLeftGripPositionPx <= nextRightGripPositionPx) ) { 105 106 var prevMin = $this.data('cur_min'), 107 prevMax = $this.data('cur_max'); 108 109 // note: also stores new cur_min, cur_max 110 _methods.set_position_from_px.call($this, nextLeftGripPositionPx, nextRightGripPositionPx); 111 112 // set the style of the grips according to the highlighted range 113 _methods.refresh_grips_style.call($this); 114 115 _methods.notify_changed_implicit.call($this, 'drag_move', prevMin, prevMax); 116 } 117 118 return $this; 119 }, 120 /* 121 * Update aria attributes of the slider based on the current 122 * configuration of the slider. 123 */ 124 'updateAriaAttributes' : function () { 125 var $this = this, 126 settings = $this.data('settings'), 127 $leftGrip = $this.find(settings.left_grip_selector); 128 129 // 130 // double grips sliders is probably the most common case... 131 // ... also, the values to be set in the two cases are quite 132 // different. 133 // 134 if ($this.data('has_right_grip')) { 135 136 var $rightGrip = $this.find(settings.right_grip_selector); 137 138 // 139 // grips are mutually binding their max/min values when 2 grips 140 // are present. For example, we should imagine the left grip as 141 // being constrained between [ rangeMin, valueMax ] 142 // 143 $leftGrip 144 .attr('aria-valuemin', $this.data('range_min')) 145 .attr('aria-valuenow', methods.get_current_min_value.call($this)) 146 .attr('aria-valuemax', methods.get_current_max_value.call($this)); 147 148 $rightGrip 149 .attr('aria-valuemin', methods.get_current_min_value.call($this)) 150 .attr('aria-valuenow', methods.get_current_max_value.call($this)) 151 .attr('aria-valuemax', $this.data('range_max')); 152 } 153 else { 154 $leftGrip 155 .attr('aria-valuemin', $this.data('range_min')) 156 .attr('aria-valuenow', methods.get_current_min_value.call($this)) 157 .attr('aria-valuemax', $this.data('range_max')); 158 } 159 160 return $this; 161 }, 162 /* 163 * Return the width in pixels of the slider bar, i.e., the maximum 164 * number of pixels the user can slide the slider over. This function 165 * should always be used internally to obtain the width of the 166 * slider in pixels! 167 */ 168 'getSliderWidthPx' : function () { 169 var $this = this; 170 171 // 172 // .width() can actually return a floating point number! see 173 // jquery docs! 174 // 175 return Math.round($this.width()); 176 }, 177 /* 178 * Return the position of a given grip in pixel in integer format. 179 * Use this method internally if you are literally going to get the 180 * left CSS property from the provided grip. 181 * 182 * This method assumes a certain grip exists and will have the left 183 * property. 184 * 185 * This is generally safe for the left grip, because it is basically 186 * guaranteed to exist. But for the right grip you should be really 187 * using getRightGripPositionPx instead. 188 * 189 */ 190 'getGripPositionPx' : function ($grip) { 191 return parseInt($grip.css('left').replace('px',''), 10); 192 }, 193 /* 194 * Just the same as getGripPositionPx, but there is no need to provide 195 * the $slider. 196 */ 197 'getLeftGripPositionPx' : function () { 198 var $this = this, 199 settings = $this.data('settings'), 200 $leftGrip = $this.find(settings.left_grip_selector); 201 202 return _methods.getGripPositionPx.call($this, $leftGrip); 203 }, 204 /* 205 * Return the position of the right Grip if it exists or return the 206 * current position if not. Even if the right grip doesn't exist, its 207 * position should be defined, as it determines the position of the 208 * bar. 209 */ 210 'getRightGripPositionPx' : function () { 211 var $this = this, 212 settings = $this.data('settings'); 213 214 if ($this.data('has_right_grip')) { 215 return _methods.getGripPositionPx.call($this, 216 $this.find(settings.right_grip_selector) 217 ); 218 } 219 220 // default 221 var sliderWidthPx = _methods.getSliderWidthPx.call($this) - $this.data('left_grip_width'); 222 return _methods.rangemap_0_to_n.call($this, $this.data('cur_max'), sliderWidthPx); 223 }, 224 /* 225 * Return the width of the left grip. Like getSliderWidthPx, this 226 * method deals with .width() returning a floating point number. All 227 * the code in this plugin assumes an integer here! 228 */ 229 'getLeftGripWidth' : function () { 230 var $this = this, 231 settings = $this.data('settings'), 232 $leftGrip = $this.find(settings.left_grip_selector); 233 234 return Math.round($leftGrip.outerWidth()); 235 }, 236 /* 237 * Return the width of the right grip. The calling method should 238 * check that the right grip actually exists. This method assumes it 239 * does. 240 */ 241 'getRightGripWidth' : function () { 242 var $this = this, 243 settings = $this.data('settings'), 244 $rightGrip = $this.find(settings.right_grip_selector); 245 246 return Math.round($rightGrip.outerWidth()); 247 }, 248 'binarySearchValueToPxCompareFunc' : function (s, a, i) { 249 // Must return: 250 // 251 // s: element to search for 252 // a: array we are looking in 253 // i: position of the element we are looking for 254 // 255 // -1 (s < a[i]) 256 // 0 found (= a[i]) 257 // 1 (s > a[i]) 258 if (s === a[i]) { return 0; } // element found exactly 259 if (s < a[i] && i === 0) { return 0; } // left extreme case e.g., a = [ 3, ... ], s = 1 260 if (a[i-1] <= s && s < a[i]) { return 0; } // s is between two elements, always return the rightmost 261 if (s > a[i]) { return 1; } 262 if (s <= a[i-1]) { return -1; } 263 $.error('cannot compare s: ' + s + ' with a[' + i + ']. a is: ' + a.join(',')); 264 }, 265 /* 266 * Perform binary search to find searchElement into a generic array.
267 * It uses a customized compareFunc to perform the comparison between 268 * two elements of the array and a getElement function to pick the 269 * element from the array (e.g., in case we want to pick a field of an 270 * array of objects) 271 */ 272 'binarySearch' : function(array, searchElement, getElementFunc, compareFunc) { 273 var minIndex = 0; 274 var maxIndex = array.length - 1; 275 var currentIndex; 276 var currentElement; 277 278 while (minIndex <= maxIndex) { 279 currentIndex = (minIndex + maxIndex) / 2 | 0; 280 currentElement = getElementFunc(array, currentIndex); 281 282 // lt = -1 (searchElement < currentElement) 283 // eq = 0 284 // gt = 1 (searchElement > currentElement) 285 var lt_eq_gt = compareFunc(searchElement, array, currentIndex); 286 287 if (lt_eq_gt > 0) { 288 minIndex = currentIndex + 1; 289 } 290 else if (lt_eq_gt < 0) { 291 maxIndex = currentIndex - 1; 292 } 293 else { 294 return currentIndex; 295 } 296 } 297 298 return -1; 299 }, 300 /* 301 * Returns true if this slider has limit, false otherwise. There can be 302 * an upper limit and a lower limit for the sliders. 303 * The lower/upper limits are values that are out of the slider range, 304 * but that can be selected by the user when he moves a slider all the 305 * way down the minimum and up to the maximum value. 306 */ 307 'haveLimits' : function () { 308 var $this = this, 309 lowerLimit = $this.data('lower-limit'), 310 upperLimit = $this.data('upper-limit'), 311 haveLimits = false; 312 313 if (typeof lowerLimit !== 'undefined' && 314 typeof upperLimit !== 'undefined') { 315 316 haveLimits = true; 317 } 318 319 return haveLimits; 320 }, 321 /* 322 * This method is called whenever the style of the grips needs to get 323 * updated. 324 */ 325 'refresh_grips_style' : function () { 326 var $this = this, 327 settings = $this.data('settings'); 328 329 // Skip refreshing grips style if no hihglight is specified in 330 // construction 331 if (typeof settings.highlight === 'undefined') { 332 return; 333 } 334 335 var highlightedRangeMin = $this.data('highlightedRangeMin'); 336 337 if (typeof highlightedRangeMin === 'undefined') { 338 return; 339 } 340 341 var $leftGrip = $this.find(settings.left_grip_selector), 342 $rightGrip = $this.find(settings.right_grip_selector), 343 highlightedRangeMax = $this.data('highlightedRangeMax'), 344 curMin = $this.data('cur_min'), 345 curMax = $this.data('cur_max'), 346 highlightGripClass = settings.highlight.grip_class; 347 348 // curmin is within the highlighted range 349 if (curMin < highlightedRangeMin || curMin > highlightedRangeMax) { 350 // de-highlight grip 351 $leftGrip.removeClass(highlightGripClass); 352 } 353 else { 354 // highlight grip 355 $leftGrip.addClass(highlightGripClass); 356 } 357 358 // time to highlight right grip 359 if (curMax < highlightedRangeMin || curMax > highlightedRangeMax) { 360 // de-highlight grip 361 $rightGrip.removeClass(highlightGripClass); 362 } 363 else { 364 // highlight grip 365 $rightGrip.addClass(highlightGripClass); 366 } 367 }, 368 /* 369 * Set left and right handle at the right position on the screen (pixels) 370 * given the desired position in currency. 371 * 372 * e.g., _methods.set_position_from_val.call($this, 10000, 100000); 373 * 374 * may set the left handle at 100px and the right handle at 375 * 200px; 376 * 377 */ 378 'set_position_from_val' : function (cur_min, cur_max) { 379 var $this = this; 380 // 381 // We need to understand how much pixels cur_min and cur_max 382 // correspond. 383 // 384 var range_min = $this.data('range_min'), 385 range_max = $this.data('range_max'); 386 387 // 388 // (safety) constrain the cur_min or the cur_max value between the 389 // max/min ranges allowed for this slider. 390 // 391 if (cur_min < range_min) { cur_min = range_min; } 392 if (cur_min > range_max) { cur_min = range_max; } 393 394 if ($this.data('has_right_grip')) { 395 if (cur_max > range_max) { cur_max = range_max; } 396 if (cur_max < range_min) { cur_max = range_min; } 397 } 398 else { 399 cur_max = $this.data('cur_max'); 400 } 401 402 var leftPx = methods.value_to_px.call($this, cur_min), 403 rightPx = methods.value_to_px.call($this, cur_max); 404 405 _methods.set_handles_at_px.call($this, leftPx, rightPx); 406 407 // save this position 408 $this.data('cur_min', cur_min); 409 410 if ($this.data('has_right_grip')) { 411 $this.data('cur_max', cur_max); 412 } 413 414 return $this; 415 }, 416 /* 417 * Set the position of the handles at the specified pixel points (taking 418 * the whole slider width as a maximum point). 419 */ 420 'set_position_from_px' : function (leftPx, rightPx) { 421 var $this = this; 422 423 // 424 // we need to find a value from the given value in pixels 425 // 426 427 // now set the position as requested... 428 _methods.set_handles_at_px.call($this, leftPx, rightPx); 429 430 var valueLeftRight = _methods.getSliderValuesAtPositionPx.call($this, leftPx, rightPx), 431 leftPxInValue = valueLeftRight[0], 432 rightPxInValue = valueLeftRight[1]; 433 434 // ... and save the one we've found. 435 $this.data('cur_min', leftPxInValue); 436 437 if ($this.data('has_right_grip')) { 438 $this.data('cur_max', rightPxInValue); 439 } 440 441 return $this; 442 }, 443 /* 444 * Updates the CSS of grips and bar so that the left grip appears at 445 * leftPx and the right grip appears at rightPx. Note: leftPx can be > 446 * rightPx. 447 */ 448 'set_handles_at_px' : function (leftPx, rightPx) { 449 var $this = this; 450 var settings = $this.data('settings'); 451 452 var left_grip_selector = settings.left_grip_selector, 453 right_grip_selector = settings.right_grip_selector, 454 value_bar_selector = settings.value_bar_selector; 455 456 var handleWidth = $this.data('left_grip_width'); 457 458 // The left grip 459 $this.find(left_grip_selector).css('left', leftPx + 'px'); 460 461 // The right grip 462 $this.find(right_grip_selector).css('left', rightPx + 'px'); 463 464 // The value bar 465 if ($this.data('has_right_grip')) { 466 // If both the grips are there, the value bar must stick to 467 // beginning and the end of the grips. 468 $this.find(value_bar_selector) 469 .css('left', leftPx + 'px') 470 .css('width', (rightPx - leftPx + handleWidth) + 'px'); 471 } 472 else { 473 if (!_naked_bar_deltas) { 474 _methods.populateNakedBarDeltas.call($this, leftPx, rightPx, handleWidth); 475 } 476 477 if (rightPx > leftPx) { 478 // The naked end of the bar is on the right of the grip 479 $this.find(value_bar_selector) 480 .css('left', leftPx + 'px') 481 .css('width', rightPx - leftPx + _naked_bar_deltas.toEndWidth + 'px'); 482 } 483 else { 484 // The naked end of the bar is on the left of the grip 485 // NOTE: leftPx and rightPx are to be read swapped here. 486 $this.find(value_bar_selector) 487 .css('left', rightPx + _naked_bar_deltas.toBeginLeft + 'px') 488 .css('width', (leftPx - rightPx + _naked_bar_deltas.toBeginWidth) + 'px'); 489 } 490 } 491 492 return $this; 493 494 }, 495 'drag_start_func_touch' : function (e, settings, $left_grip, $right_grip, is_touch) { 496 var $this = this, 497 original_event = e.originalEvent, 498 touch = original_event.touches[0]; 499 500 // for touch devices we need to make sure we allow the user to scroll 501 // if the click was too far from the slider. 502 var curY = touch.pageY, 503 curX = touch.pageX; 504 505 // is the user allowed to grab if he/she tapped too far from the 506 // slider? 507 var ydelta = Math.abs($this.offset().top - curY), 508 slider_left = $this.offset().left, 509 xldelta = slider_left - curX, 510 xrdelta = curX - (slider_left + $this.width()); 511 512 if (ydelta > settings.touch_tolerance_value_bar_y || 513 xldelta > settings.touch_tolerance_value_bar_x || 514 xrdelta > settings.touch_tolerance_value_bar_x ) { 515 516 return; 517 } 518 519 original_event.preventDefault(); 520 _original_mousex = touch.pageX; 521 522 // true : is touch event 523 _methods.drag_start_func.call($this, touch, settings, $left_grip, 524 $right_grip, is_touch); 525 }, 526 'drag_start_func' : function (e, settings, $leftGrip, $rightGrip, 527 is_touch) { 528 529 var $this = this; 530 531 $this.find(settings.left_grip_selector + 532 ',' + settings.value_bar_selector + 533 ',' + settings.right_grip_selector).removeClass( 534 535 settings.animating_css_class 536 ); 537 538 if (!methods.is_enabled.call($this)) { return; } 539 540 // 541 // if the user used the finger, he/she is allowed to touch anywhere. 542 // but if the mouse is used, we want to enable the logic only for 543 // left grip, right grip, bar/panel elements. 544 // 545 var $target = $(e.target); 546 547 // ... if the highlight range was enabled we should check wether 548 // the user has tapped or clicked the highlight panel... 549 var targetIsPanelSelector = false;
550 if (typeof settings.highlight === 'object') { 551 targetIsPanelSelector = $target.is(settings.highlight.panel_selector); 552 } 553 554 if (is_touch === false && 555 !$target.is(settings.left_grip_selector) && 556 !$target.is(settings.right_grip_selector) && 557 !$target.is(settings.value_bar_selector) && 558 !targetIsPanelSelector && 559 !$target.is($this) ) { 560 561 return; 562 } 563 564 // - - - - 565 // the following logic finds the nearest slider grip and starts 566 // dragging it. 567 // - - - - 568 569 _$current_slider = $this; 570 571 var leftGripPositionPx = _methods.getGripPositionPx.call($this, $leftGrip), 572 sliderWidthPx = _methods.getSliderWidthPx.call($this) - $this.data('left_grip_width'), 573 lleft = $leftGrip.offset().left, 574 rleft, // don't compute this yet (maybe not needed if 1 grip) 575 curX, 576 ldist, 577 rdist, 578 ldelta, 579 rdelta; 580 581 var rightGripPositionPx = _methods.getRightGripPositionPx.call($this); 582 583 // 584 // We need to do as if the click happened a bit more on the left. 585 // That's because we will be setting the left CSS property at the 586 // point where the click happened, meaning the slider grip will be 587 // spanning to the right. 588 // 589 curX = Math.round(e.pageX) - ($this.data('left_grip_width') / 2); 590 591 // calculate deltas from left and right grip 592 ldist = Math.abs(lleft - curX); 593 ldelta = curX - lleft; 594 595 if ($this.data('has_right_grip')) { 596 rleft = $rightGrip.offset().left; 597 rdist = Math.abs(rleft - curX); 598 rdelta = curX - rleft; 599 } 600 else { 601 // no right grip... we make the right slider 602 // unreachable! 603 rdist = ldist * 2; 604 rdelta = ldelta * 2; 605 } 606 607 // notify the beginning of a dragging... 608 settings.user_drag_start_callback.call($this, e); 609 610 if (ldist === rdist) { 611 612 if (curX < lleft) { 613 // move the left grip 614 leftGripPositionPx += ldelta; 615 _is_left_grip = true; 616 } 617 else { 618 // move the right grip 619 rightGripPositionPx += rdelta; 620 _is_left_grip = false; 621 } 622 } 623 else if (ldist < rdist) { 624 625 // move the left grip 626 leftGripPositionPx += ldelta; 627 _is_left_grip = true; 628 } 629 else { 630 // move the right grip 631 rightGripPositionPx += rdelta; 632 _is_left_grip = false; 633 } 634 635 // 636 // Limit the right grip to the maximum allowed - as the user can 637 // actually click beyond it! 638 // 639 // ............... 640 // ^-- maximum clickable 641 // ^--- maximum allowed (i.e., sliderWidth - gripWidth) 642 // 643 // if user clicks at sliderWidth, we will be setting CSS left of 644 // right handle having: 645 // 646 // ...............R <-- out of bound :-( 647 // ^-- maximum clickable 648 // ^--- maximum allowed (i.e., sliderWidth - gripWidth) 649 // 650 // but we want: 651 // 652 // ..............R <-- within bound :-) 653 // ^-- maximum clickable 654 // ^--- maximum allowed (i.e., sliderWidth - gripWidth) 655 // 656 // Hence we limit. 657 // 658 659 if ($this.data('has_right_grip')) { 660 // here we check the right handle only, because it should 661 // always be the one that gets moved if the user clicks towards 662 // the right extremity! 663 if (rightGripPositionPx > sliderWidthPx) { 664 rightGripPositionPx = sliderWidthPx; 665 } 666 } 667 else { 668 // in case we have one handle only, we will be moving the left 669 // handle instead of the right one... hence we need to perform 670 // this check on the left handle as well! 671 if (leftGripPositionPx > sliderWidthPx) { 672 leftGripPositionPx = sliderWidthPx; 673 } 674 } 675 676 // this can happen because the user can click on the left handle! 677 // (which is out of the left boundary) 678 if (leftGripPositionPx < 0) { 679 leftGripPositionPx = 0; 680 } 681 682 _is_mousedown = true; 683 684 var prev_min = $this.data('cur_min'), 685 prev_max = $this.data('cur_max'); 686 687 _methods.set_position_from_px.call($this, leftGripPositionPx, rightGripPositionPx); 688 689 // set the style of the grips according to the highlighted range 690 _methods.refresh_grips_style.call($this); 691 692 _methods.notify_changed_implicit.call($this, 'drag_start', prev_min, prev_max); 693 694 // no need to call preventDefault on touch events, as we called 695 // preventDefault on the original event already 696 if (Object.prototype.toString.apply(e) !== "[object Touch]") { 697 e.preventDefault(); 698 } 699 }, 700 'drag_move_func_touch' : function (e) { 701 if (_is_mousedown === true) { 702 var original_event = e.originalEvent; 703 original_event.preventDefault(); 704 var touch = original_event.touches[0]; 705 _methods.drag_move_func(touch); 706 } 707 }, 708 'drag_move_func' : function (e) { 709 if (_is_mousedown) { 710 // our slider element. 711 var $this = _$current_slider, 712 settings = $this.data('settings'), 713 sliderWidthPx = _methods.getSliderWidthPx.call($this) - $this.data('left_grip_width'), 714 leftGripPositionPx = _methods.getLeftGripPositionPx.call($this); 715 716 var rightGripPositionPx = _methods.getRightGripPositionPx.call($this); 717 718 // 719 // Here we are going to set the position in pixels based on
720 // where the user has moved the mouse cursor. We obtain the 721 // position of the mouse cursors via e.pageX, which returns the 722 // absolute position of the mouse on the screen. 723 // 724 var absoluteMousePosition = Math.round(e.pageX); 725 726 // 727 // Compute the delta (in px) for the slider movement. It is the 728 // difference between the new position of the cursor and the 729 // old position of the cursor. 730 // 731 // Based on the delta we decide how to move the dragged handle. 732 // 733 // 0 : no movement 734 // -delta: move left 735 // +delta: move right 736 // 737 var delta = absoluteMousePosition - _original_mousex; 738 739 // 740 // User cannot drag the handles outside the slider bar area. 741 // 742 743 // 1) calculate the area within which the movement is 744 // considered to be valid. 745 var half_a_grip_width = $this.data('left_grip_width') / 2, 746 drag_area_start = $this.offset().left + $this.data('left_grip_width') - half_a_grip_width, 747 drag_area_end = drag_area_start + sliderWidthPx; 748 749 if (settings.crossable_handles === false && $this.data('has_right_grip')) { 750 // if handles are not crossable, we should define the left 751 // and the right boundary of the movement. 752 if (_is_left_grip) { 753 drag_area_end = drag_area_start + rightGripPositionPx; 754 } 755 else { 756 drag_area_start = drag_area_start + leftGripPositionPx; 757 } 758 } 759 760 // 2) by default we accept to move the slider according to both 761 // the deltas (i.e., left or right) 762 var ignore_positive_delta = 0, 763 ignore_negative_delta = 0; 764 765 // 3) but if the user is moving the mouse beyond the draggable 766 // area, we should only accept a movement in one direction. 767 if (absoluteMousePosition < drag_area_start) { 768 ignore_positive_delta = 1; 769 ignore_negative_delta = 0; 770 } 771 if (absoluteMousePosition > drag_area_end) { 772 ignore_negative_delta = 1; 773 ignore_positive_delta = 0; 774 } 775 776 // 777 // Here we decide whether to invert the grip being moved. 778 // 779 if (settings.crossable_handles === true && 780 $this.data('has_right_grip')) { 781 782 if (_is_left_grip) { 783 784 // ... if we are using the left grip 785 if (rightGripPositionPx <= sliderWidthPx) { 786 787 // the inversion logic should only be active when the 788 // slider is not at the extremity 789 if (leftGripPositionPx + delta > rightGripPositionPx) { 790 791 _is_left_grip = false; 792 793 // TWEAK: keep the position of the left handle fixed 794 // at the one of the right handle as the user may 795 // have moved the mouse too fast, thus giving 796 // leftGripPositionPx > rightGripPositionPx. 797 // 798 // Basically here we avoid: 799 // 800 // Initial State: 801 // 802 // ------L-R------ (leftGripPositionPx < rightGripPositionPx) 803 // 804 // Fast Mouse Move: 805 // 806 // --------R--L--- (leftGripPositionPx + delta) 807 // --------R-L---- (leftGripPositionPx [ still > rightGripPositionPx! ]) 808 // 809 // _is_left_grip becomes false (this code) 810 // 811 leftGripPositionPx = rightGripPositionPx; 812 } 813 } 814 } 815 else { 816 // ... converse logic 817 if (leftGripPositionPx >= 0) { 818 if (rightGripPositionPx + delta < leftGripPositionPx) { 819 820 // current_max = current_min; 821 _is_left_grip = true; 822 823 rightGripPositionPx = leftGripPositionPx; 824 } 825 } 826 } 827 } 828 829 // 830 // Decide the position of the new handles. 831 // 832 var nextLeftGripPositionPx = leftGripPositionPx, 833 nextRightGripPositionPx = rightGripPositionPx; 834 835 if ((delta > 0 && !ignore_positive_delta) || 836 (delta < 0 && !ignore_negative_delta)) { 837 838 if (_is_left_grip) { 839 nextLeftGripPositionPx += delta; 840 } 841 else { 842 nextRightGripPositionPx += delta; 843 } 844 } 845 846 _methods.validateAndMoveGripsToPx.call($this, nextLeftGripPositionPx, nextRightGripPositionPx); 847 848 // prepare for next movement 849 _original_mousex = absoluteMousePosition; 850 851 852 // no need to call preventDefault on touch events, as we called 853 // preventDefault on the original event already 854 if (Object.prototype.toString.apply(e) !== "[object Touch]") { 855 e.preventDefault(); 856 } 857 } 858 }, 859 'drag_end_func_touch' : function (e) { 860 var original_event = e.originalEvent; 861 original_event.preventDefault(); 862 var touch = original_event.touches[0]; 863 _methods.drag_end_func(touch); 864 }, 865 'drag_end_func' : function (/* e */) { 866 var $this = _$current_slider; 867 if (typeof $this !== 'undefined') { 868 _is_mousedown = false;
869 _original_mousex = undefined; 870 871 _methods.notify_mouse_up_implicit.call($this, _is_left_grip); 872 873 // require another click on a handler before going into here again! 874 _$current_slider = undefined; 875 876 // put back the class once user finished dragging 877 var settings = $this.data('settings'); 878 $this.find(settings.left_grip_selector + 879 ',' + settings.value_bar_selector + 880 ',' + settings.right_grip_selector).addClass( 881 882 settings.animating_css_class 883 ); 884 } 885 }, 886 'get_rounding_for_value' : function (v) { 887 var $this = this; 888 var rounding = $this.data('rounding'); 889 var rounding_ranges = $this.data('rounding_ranges'); 890 891 if (typeof rounding_ranges === 'object') { 892 893 // then it means the rounding is not fixed, we should find the 894 // value in the roundings_array. 895 var roundingIdx = _methods.binarySearch.call($this, rounding_ranges, v, 896 // pick an element from the array 897 function (array, index) { return array[index].range; }, 898 899 // compare search element with current element 900 // < 0 search < current 901 // 0 equals 902 // > 0 search > current 903 function (search, array, currentIdx) { 904 905 // first check if this is our element 906 907 // this is our element if the search value is: 908 if (search < array[currentIdx].range) { 909 910 // we can have a match or search in the left half 911 if (currentIdx > 0) { 912 if (search >= array[currentIdx - 1].range) { 913 return 0; 914 } 915 else { 916 // go left 917 return -1; 918 } 919 } 920 else { 921 return 0; 922 } 923 } 924 else { 925 // we must search in the next half 926 return 1; 927 } 928 } 929 ); 930 931 rounding = 1; 932 if (roundingIdx > -1) { 933 rounding = parseInt(rounding_ranges[roundingIdx].value, 10); 934 } 935 else { 936 var lastIdx = rounding_ranges.length - 1; 937 if (v >= rounding_ranges[lastIdx].range) { 938 rounding = rounding_ranges[lastIdx].value; 939 } 940 } 941 } 942 return rounding; 943 }, 944 /* 945 * Calls the user mouseup callback with the right parameters. Relies on 946 * $data('beforestart_min/max') in addition to the isLeftGrip parameter. 947 * 948 * NOTE: saves the new beforestart_min and begforestart_max as well. 949 */ 950 'notify_mouse_up_implicit' : function(isLeftGrip) { 951 var $this = this, 952 current_min_value = methods.get_current_min_value.call($this), 953 current_max_value = methods.get_current_max_value.call($this), 954 didValuesChange = false; 955 956 // check if we changed. 957 if (($this.data('beforestart_min') !== current_min_value) || 958 ($this.data('beforestart_max') !== current_max_value) 959 ) { 960 // values have changed! 961 didValuesChange = true; 962 963 // save the new values 964 $this.data('beforestart_min', current_min_value); 965 $this.data('beforestart_max', current_max_value); 966 } 967 968 969 var settings = $this.data('settings'); 970 971 settings.user_mouseup_callback.call($this, 972 methods.get_current_min_value.call($this), 973 methods.get_current_max_value.call($this), 974 isLeftGrip, 975 didValuesChange 976 ); 977 978 return $this; 979 }, 980 /* 981 * NOTE: this method may take the previous min/max value as input. 982 * if no arguments are provided the method blindly notifies. 983 */ 984 'notify_changed_implicit' : function (cause, prevMin, prevMax) { 985 var $this = this; 986 987 var force = false;
988 if (cause === 'init' || cause === 'refresh') { 989 force = true; 990 } 991 992 var curMin = methods.get_current_min_value.call($this), 993 curMax = methods.get_current_max_value.call($this); 994 995 if (!force) { 996 prevMin = methods.round_value_according_to_rounding.call($this, prevMin); 997 prevMax = methods.round_value_according_to_rounding.call($this, prevMax); 998 } 999 1000 if (force || curMin !== prevMin || curMax !== prevMax) { 1001 1002 _methods.notify_changed_explicit.call($this, cause, prevMin, prevMax, curMin, curMax); 1003 1004 force = 1; 1005 } 1006 1007 return force; 1008 }, 1009 'notify_changed_explicit' : function (cause, prevMin, prevMax, curMin, curMax) { 1010 var $this = this, 1011 settings = $this.data('settings'); 1012 1013 // maybe update aria attributes for accessibility 1014 if ($this.data('aria_enabled')) { 1015 _methods.updateAriaAttributes.call($this); 1016 } 1017 1018 settings.value_changed_callback.call($this, cause, curMin, curMax, prevMin, prevMax); 1019 1020 return $this; 1021 }, 1022 'validate_params' : function (settings) { 1023 var $this = this; 1024 var min_value = $this.data('range_min'), 1025 max_value = $this.data('range_max'), 1026 cur_min = $this.data('cur_min'), 1027 lower_limit = $this.data('lower-limit'), 1028 upper_limit = $this.data('upper-limit'); 1029 1030 var have_limits = _methods.haveLimits.call($this); 1031 1032 if (typeof min_value === 'undefined') { 1033 $.error("the data-range_min attribute was not defined"); 1034 } 1035 if (typeof max_value === 'undefined') { 1036 $.error("the data-range_max attribute was not defined"); 1037 } 1038 if (typeof cur_min === 'undefined') { 1039 $.error("the data-cur_min attribute must be defined"); 1040 } 1041 if (min_value > max_value) { 1042 $.error("Invalid input parameter. must be min < max"); 1043 } 1044 1045 if (have_limits && lower_limit > upper_limit) { 1046 $.error('Invalid data-lower-limit or data-upper-limit'); 1047 } 1048 if ($this.find(settings.left_grip_selector).length === 0) { 1049 $.error("Cannot find element pointed by left_grip_selector: " + settings.left_grip_selector); 1050 } 1051 /* 1052 * NOTE: only validate right grip selector if it is not 1053 * undefined otherwise just assume that if it isn't 1054 * found isn't there. This is because we initialize the 1055 * slider at once and let the markup decide if the 1056 * slider is there or not. 1057 */ 1058 if (typeof settings.right_grip_selector !== 'undefined') { 1059 if ($this.find(settings.right_grip_selector).length === 0) { 1060 $.error("Cannot find element pointed by right_grip_selector: " + settings.right_grip_selector); 1061 } 1062 } 1063 1064 // same thing for the value bar selector 1065 if (typeof settings.value_bar_selector !== 'undefined') { 1066 if ($this.find(settings.value_bar_selector).length === 0) { 1067 $.error("Cannot find element pointed by value_bar_selector" + settings.value_bar_selector); 1068 } 1069 } 1070 }, 1071 /* 1072 * Maps a value between [minRange -- maxRange] into [0 -- n]. 1073 * The target range will be an integer number. 1074 */ 1075 'rangemap_0_to_n' : function (val, n) { 1076 var $this = this; 1077 var rangeMin = $this.data('range_min'); 1078 var rangeMax = $this.data('range_max'); 1079 1080 if (val <= rangeMin) { return 0; } 1081 if (val >= rangeMax) { return n; } 1082 1083 return Math.floor((n * val - n * rangeMin) / (rangeMax - rangeMin)); 1084 }, 1085 /* 1086 * Maps a value between [0 -- max] back into [minRange -- maxRange]. 1087 * The target range can be a floating point number. 1088 */ 1089 'inverse_rangemap_0_to_n' : function (val, max) { 1090 var $this = this; 1091 var rangeMin = $this.data('range_min'); 1092 var rangeMax = $this.data('range_max'); 1093 1094 if (val <= 0) { return rangeMin; } 1095 if (val >= max) { return rangeMax; } 1096 1097 // 1098 // To do this we first map 0 -- max relatively withing [minRange 1099 // and maxRange], that is between [0 and (maxRange-minRange)]. 1100 // 1101 var relativeMapping = (rangeMax - rangeMin) * val / max; 1102 1103 // ... then we bring this to the actual value by adding rangeMin. 1104 return relativeMapping + rangeMin; 1105 } 1106 1107 }; 1108 var methods = { 1109 '_m' : function (m) { return _methods[m]; }, // for test, removed by Grunt 1110 'teardown' : function () { 1111 var $this = this; 1112 1113 // remove all data set with .data() 1114 $this.removeData(); 1115 1116 // unbind the document as well 1117 $(document) 1118 .unbind('mousemove.nstSlider') 1119 .unbind('mouseup.nstSlider'); 1120 1121 // unbind events bound to the container element 1122 $this.parent() 1123 .unbind('mousedown.nstSlider') 1124 .unbind('touchstart.nstSlider')
1125 .unbind('touchmove.nstSlider') 1126 .unbind('touchend.nstSlider'); 1127 1128 // unbind events bound to the current element 1129 $this.unbind('keydown.nstSlider') 1130 .unbind('keyup.nstSlider'); 1131 1132 return $this; 1133 }, 1134 'init' : function(options) { 1135 var settings = $.extend({ 1136 'animating_css_class' : 'nst-animating', 1137 // this is the distance from the value bar by which we should 1138 // grab the left or the right handler. 1139 'touch_tolerance_value_bar_y': 30, // px 1140 'touch_tolerance_value_bar_x': 15, // px 1141 // where is the left grip? 1142 'left_grip_selector': '.nst-slider-grip-left', 1143 // where is the right grip? 1144 // undefined = (only left grip bar) 1145 'right_grip_selector': undefined, 1146 1147 // Specify highlight like this if you want to highlight a range 1148 // in the slider. 1149 // 1150 // 'highlight' : { 1151 // 'grip_class' : '.nsti-slider-hi', 1152 // 'panel_selector' : '.nst-slider-highlight-panel' 1153 // }, 1154 'highlight' : undefined, 1155 1156 // Lets you specify the increment rounding for the slider handles 1157 // for when the user moves them. 1158 // It can be a string, indicating a fixed increment, or an object 1159 // indicating the increment based on the value to be rounded. 1160 // 1161 // This can be specified in the following form: { 1162 // '1' : '100', 1163 // '10' : '1000', /* rounding = 10 for values in [100-999] */ 1164 // '50' : '10000', 1165 // } 1166 'rounding': undefined, 1167 1168 // if the bar is not wanted 1169 'value_bar_selector': undefined, 1170 1171 // Allow handles to cross each other while one of them is being 1172 // dragged. This option is ignored if just one handle is used. 1173 'crossable_handles': true, 1174 1175 'value_changed_callback': function(/*cause, vmin, vmax*/) { return; }, 1176 'user_mouseup_callback' : function(/*vmin, vmax, left_grip_moved*/) { return; }, 1177 'user_drag_start_callback' : function () { return; } 1178 }, options); 1179 1180 // 1181 // we need to unbind events attached to the document, 1182 // as if we replace html elements and re-initialize, we 1183 // don't want to double-bind events! 1184 // 1185 var $document = $(document); 1186 1187 // make sure only one event is bound to the document 1188 $document.unbind('mouseup.nstSlider'); 1189 $document.unbind('mousemove.nstSlider'); 1190 1191 $document.bind('mousemove.nstSlider', _methods.drag_move_func); 1192 $document.bind('mouseup.nstSlider', _methods.drag_end_func); 1193 1194 return this.each(function() { 1195 // 1196 // $this is like: 1197 // 1198 // <div class="outer-slider" data-... data-...> 1199 // <div class="bar"></div> 1200 // <div class="leftGrip"></div> 1201 // <div class="rightGrip"></div> 1202 // </div> 1203 // 1204 // It is supposed to be enclosed in a container 1205 // 1206 var $this = $(this), 1207 $container = $this.parent(); 1208 1209 // enable: the user is able to move the grips of this slider. 1210 $this.data('enabled', true); 1211 1212 // fix some values first 1213 var rangeMin = $this.data('range_min'), 1214 rangeMax = $this.data('range_max'), 1215 valueMin = $this.data('cur_min'), 1216 valueMax = $this.data('cur_max'); 1217 1218 // assume 0 if valueMax is not specified 1219 if (typeof valueMax === 'undefined') { 1220 valueMax = valueMin; 1221 } 1222 1223 if (rangeMin === '') { rangeMin = 0; } 1224 if (rangeMax === '') { rangeMax = 0; } 1225 if (valueMin === '') { valueMin = 0; } 1226 if (valueMax === '') { valueMax = 0; } 1227 1228 $this.data('range_min', rangeMin); 1229 $this.data('range_max', rangeMax); 1230 $this.data('cur_min', valueMin); 1231 $this.data('cur_max', valueMax); 1232 1233 // halt on error 1234 _methods.validate_params.call($this, settings); 1235 1236 $this.data('settings', settings); 1237 1238 // override rounding from markup if defined in configuration 1239 if (typeof settings.rounding !== 'undefined') { 1240 methods.set_rounding.call($this, settings.rounding); 1241 } 1242 else if (typeof $this.data('rounding') !== 'undefined') { 1243 methods.set_rounding.call($this, $this.data('rounding')); 1244 } 1245 else { 1246 methods.set_rounding.call($this, 1); 1247 } 1248 1249 var left_grip = $this.find(settings.left_grip_selector)[0], 1250 $left_grip = $(left_grip), 1251 $right_grip = $($this.find(settings.right_grip_selector)[0]); 1252 1253 // make sure left grip can be tabbed if the user hasn't 1254 // defined their own tab index 1255 if (typeof $left_grip.attr('tabindex') === 'undefined') { 1256 $left_grip.attr('tabindex', 0); 1257 } 1258 1259 // no right handler means single handler 1260 var has_right_grip = false;
1261 if ($this.find(settings.right_grip_selector).length > 0) { 1262 has_right_grip = true; 1263 1264 // make sure right grip can be tabbed if the user hasn't 1265 // defined their own tab index 1266 if (typeof $right_grip.attr('tabindex') === 'undefined') { 1267 $right_grip.attr('tabindex', 0); 1268 } 1269 } 1270 $this.data('has_right_grip', has_right_grip); 1271 1272 // enable aria attributes update? 1273 if ($this.data('aria_enabled') === true) { 1274 // setup aria role attributes on each grip 1275 $left_grip 1276 .attr('role', 'slider') 1277 .attr('aria-disabled', 'false'); 1278 1279 if (has_right_grip) { 1280 $right_grip 1281 .attr('role', 'slider') 1282 .attr('aria-disabled', 'false'); 1283 } 1284 } 1285 1286 // 1287 // deal with keypresses here 1288 // 1289 $this.bind('keyup.nstSlider', function (e) { 1290 if ($this.data('enabled')) { 1291 switch (e.which) { 1292 case 37: // left 1293 case 38: // up 1294 case 39: // right 1295 case 40: // down 1296 1297 if (_before_keydown_value === _before_keyup_value) { 1298 1299 // we should search for the next value change... 1300 // ... in which direction? depends on whe 1301 1302 var searchUntil = _methods.getSliderWidthPx.call($this), 1303 val, 1304 i, 1305 setAtPixel; 1306 1307 if (_before_keydown_pixel - _before_keyup_pixel < 0) { 1308 // the grip was moved towards the right 1309 1310 for (i=_before_keyup_pixel; i<=searchUntil; i++) { 1311 // if the value at pixel i is different than 1312 // the current value then we are good to go. 1313 // 1314 val = methods.round_value_according_to_rounding.call($this, 1315 _methods.getSliderValuesAtPositionPx.call($this, i, i)[1] 1316 ); 1317 if (val !== _before_keyup_value) { 1318 setAtPixel = i; 1319 break; 1320 } 1321 } 1322 } 1323 else { 1324 // the grip was moved towards the left 1325 1326 for (i=_before_keyup_pixel; i>=0; i--) { 1327 1328 // if the value at pixel i is different than 1329 // the current value then we are good to go. 1330 // 1331 val = methods.round_value_according_to_rounding.call($this, 1332 _methods.getSliderValuesAtPositionPx.call($this, i, i)[1] 1333 ); 1334 if (val !== _before_keyup_value) { 1335 setAtPixel = i; 1336 break; 1337 } 1338 } 1339 } 1340 1341 1342 // we need to set the slider at this position 1343 if (_is_left_grip) { 1344 _methods.validateAndMoveGripsToPx.call($this, setAtPixel, _methods.getRightGripPositionPx.call($this)); 1345 } 1346 else { 1347 _methods.validateAndMoveGripsToPx.call($this, _methods.getLeftGripPositionPx.call($this), setAtPixel); 1348 } 1349 1350 // 1351 // call the mouseup callback when the key is up! 1352 // 1353 _methods.notify_mouse_up_implicit.call($this, _is_left_grip); 1354 } 1355 } 1356 1357 // clear values 1358 _before_keydown_value = undefined; 1359 _before_keydown_pixel = undefined; 1360 _before_keyup_value = undefined; 1361 _before_keyup_pixel = undefined; 1362 } 1363 }); 1364 $this.bind('keydown.nstSlider', function (evt) { 1365 if ($this.data('enabled')) { 1366 1367 var moveHandleBasedOnKeysFunc = function ($grip, e) { 1368 1369 var nextLeft = _methods.getLeftGripPositionPx.call($this), 1370 nextRight = _methods.getRightGripPositionPx.call($this); 1371 1372 if (typeof _before_keydown_value === 'undefined') { 1373 _before_keydown_pixel = _is_left_grip ? nextLeft : nextRight; 1374 1375 _before_keydown_value = _is_left_grip ? methods.get_current_min_value.call($this) : methods.get_current_max_value.call($this); 1376 } 1377 1378 switch (e.which) { 1379 case 37: // left 1380 case 40: // down 1381 if (_is_left_grip) { nextLeft--; } else { nextRight--; } 1382 e.preventDefault(); 1383 break; 1384 1385 case 38: // up 1386 case 39: // right 1387 if (_is_left_grip) { nextLeft++; } else { nextRight++; } 1388 1389 e.preventDefault(); 1390 break; 1391 } 1392 1393 _before_keyup_pixel = _is_left_grip ? nextLeft : nextRight; 1394 1395 // may write into cur_min, cur_max data... 1396 _methods.validateAndMoveGripsToPx.call($this, nextLeft, 1397 nextRight); 1398 1399 _before_keyup_value = _is_left_grip ? methods.get_current_min_value.call($this) : methods.get_current_max_value.call($this); 1400 }; 1401 1402 // default 1403 if (has_right_grip && $this.find(':focus').is($right_grip)) { 1404 _is_left_grip = false;
1405 moveHandleBasedOnKeysFunc.call($this, $right_grip, evt); 1406 } 1407 else { 1408 _is_left_grip = true; 1409 moveHandleBasedOnKeysFunc.call($this, $left_grip, evt); 1410 } 1411 } 1412 }); 1413 1414 // determine size of grips 1415 var left_grip_width = _methods.getLeftGripWidth.call($this), 1416 right_grip_width = has_right_grip ? 1417 _methods.getRightGripWidth.call($this) : left_grip_width; 1418 1419 $this.data('left_grip_width', left_grip_width); 1420 $this.data('right_grip_width', right_grip_width); 1421 1422 $this.data('value_bar_selector', settings.value_bar_selector); 1423 1424 // set behaviour of naked bar in case of one handle 1425 if (!has_right_grip) { 1426 var bStickToSides = valueMax === rangeMax || valueMax === rangeMin; 1427 _methods.setNakedBarDelta.call($this,
1428 bStickToSides ? "stickToSides" : "middle", 1429 left_grip_width 1430 ); 1431 } 1432 1433 // this will set the range to the right extreme in such a case. 1434 if (rangeMin === rangeMax || valueMin === valueMax) { 1435 methods.set_range.call($this, rangeMin, rangeMax); 1436 } 1437 else { 1438 1439 // set the initial position 1440 _methods.set_position_from_val.call($this, 1441 $this.data('cur_min'), $this.data('cur_max')); 1442 } 1443 1444 _methods.notify_changed_implicit.call($this, 'init'); 1445 1446 // handle mouse movement 1447 $this.data('beforestart_min', methods.get_current_min_value.call($this)); 1448 $this.data('beforestart_max', methods.get_current_max_value.call($this)); 1449 1450 // pass a closure, so that 'this' will be the current slider bar, 1451 // not the container. 1452 $this.bind('mousedown.nstSlider', function (e) { 1453 _methods.drag_start_func.call($this, e, settings, $left_grip, $right_grip, false); 1454 }); 1455 1456 $container.bind('touchstart.nstSlider', function (e) { 1457 _methods.drag_start_func_touch.call($this, e, settings, $left_grip, $right_grip, true); 1458 }); 1459 $container.bind('touchend.nstSlider', function (e) { 1460 _methods.drag_end_func_touch.call($this, e); 1461 }); 1462 $container.bind('touchmove.nstSlider', function (e) { 1463 _methods.drag_move_func_touch.call($this, e); 1464 }); 1465 1466 // if the data-histogram attribute exists, then use this 1467 // histogram to set the step distribution 1468 var step_histogram = $this.data('histogram'); 1469 if (typeof step_histogram !== 'undefined') { 1470 methods.set_step_histogram.call($this, step_histogram); 1471 } 1472 }); // -- each slider 1473 }, 1474 'get_range_min' : function () { 1475 var $this = this; 1476 return $this.data('range_min'); 1477 }, 1478 'get_range_max' : function () { 1479 var $this = this; 1480 return $this.data('range_max'); 1481 }, 1482 'get_current_min_value' : function () { 1483 var $this = $(this); 1484 1485 var rangeMin = methods.get_range_min.call($this), 1486 rangeMax = methods.get_range_max.call($this); 1487 1488 var currentMin = $this.data('cur_min'); 1489 1490 var min; 1491 if (rangeMin >= currentMin) { 1492 min = rangeMin; 1493 } 1494 else { 1495 min = methods.round_value_according_to_rounding.call($this, currentMin); 1496 } 1497 1498 if (_methods.haveLimits.call($this)) { 1499 if (min <= rangeMin) { 1500 return $this.data('lower-limit'); 1501 } 1502 else if (min >= rangeMax) { 1503 return $this.data('upper-limit'); 1504 } 1505 } 1506 else { 1507 if (min <= rangeMin) { 1508 return rangeMin; 1509 } 1510 else if (min >= rangeMax) { 1511 return rangeMax; 1512 } 1513 } 1514 1515 return min; 1516 }, 1517 'get_current_max_value' : function () { 1518 var $this = $(this); 1519 1520 var rangeMin = methods.get_range_min.call($this), 1521 rangeMax = methods.get_range_max.call($this); 1522 1523 var currentMax = $this.data('cur_max'); 1524 1525 var max; 1526 if (rangeMax <= currentMax) { 1527 max = rangeMax; 1528 } 1529 else { 1530 max = methods.round_value_according_to_rounding.call($this, currentMax); 1531 } 1532 1533 1534 if (_methods.haveLimits.call($this)) { 1535 if (max >= rangeMax) { 1536 return $this.data('upper-limit'); 1537 } 1538 else if (max <= rangeMin) { 1539 return $this.data('lower-limit'); 1540 } 1541 } 1542 else { 1543 if (max >= rangeMax) { 1544 return rangeMax; 1545 } 1546 else if (max <= rangeMin) { 1547 return rangeMin; 1548 } 1549 } 1550 1551 return max; 1552 }, 1553 'is_handle_to_left_extreme' : function () { 1554 var $this = this; 1555 if (_methods.haveLimits.call($this)) { 1556 return $this.data('lower-limit') === methods.get_current_min_value.call($this); 1557 } 1558 else { 1559 return methods.get_range_min.call($this) === methods.get_current_min_value.call($this); 1560 } 1561 }, 1562 'is_handle_to_right_extreme' : function () { 1563 var $this = this; 1564 if (_methods.haveLimits.call($this)) { 1565 return $this.data('upper-limit') === methods.get_current_max_value.call($this); 1566 } 1567 else { 1568 return methods.get_range_max.call($this) === methods.get_current_max_value.call($this); 1569 } 1570 }, 1571 // just call set_position on the current values 1572 'refresh' : function () { 1573 var $this = this; 1574 1575 // re-set the slider step if specified 1576 var lastStepHistogram = $this.data('last_step_histogram'); 1577 if (typeof lastStepHistogram !== 'undefined') { 1578 methods.set_step_histogram.call($this, lastStepHistogram); 1579 } 1580 1581 // re-center given values 1582 _methods.set_position_from_val.call($this, 1583 methods.get_current_min_value.call($this), 1584 methods.get_current_max_value.call($this) 1585 ); 1586 1587 // re-highlight the range 1588 var highlightRangeMin = $this.data('highlightedRangeMin'); 1589 if (typeof highlightRangeMin === 'number') { 1590 // a highlight range is present, we must update it 1591 var highlightRangeMax = $this.data('highlightedRangeMax'); 1592 methods.highlight_range.call($this, highlightRangeMin, highlightRangeMax); 1593 } 1594 1595 _methods.notify_changed_implicit.call($this, 'refresh'); 1596 return $this; 1597 }, 1598 'disable' : function () { 1599 var $this = this, 1600 settings = $this.data('settings'); 1601 1602 $this.data('enabled', false) 1603 .find(settings.left_grip_selector) 1604 .attr('aria-disabled', 'true') 1605 .end() 1606 .find(settings.right_grip_selector) 1607 .attr('aria-disabled', 'true'); 1608 1609 return $this; 1610 }, 1611 'enable' : function() { 1612 var $this = this, 1613 settings = $this.data('settings'); 1614 1615 $this.data('enabled', true) 1616 .find(settings.left_grip_selector) 1617 .attr('aria-disabled', 'false') 1618 .end() 1619 .find(settings.right_grip_selector) 1620 .attr('aria-disabled', 'false'); 1621 1622 return $this; 1623 }, 1624 'is_enabled' : function() { 1625 var $this = this; 1626 return $this.data('enabled'); 1627 }, 1628 /* 1629 * This one is the public method, called externally. 1630 * It sets the position and notifies in fact. 1631 */ 1632 'set_position' : function(min, max) { 1633 var $this = this; 1634 1635 var prev_min = $this.data('cur_min'), 1636 prev_max = $this.data('cur_max'); 1637 1638 if (min > max) { 1639 _methods.set_position_from_val.call($this, max, min); 1640 } 1641 else { 1642 _methods.set_position_from_val.call($this, min, max); 1643 } 1644 1645 // set the style of the grips according to the highlighted range 1646 _methods.refresh_grips_style.call($this); 1647 1648 _methods.notify_changed_implicit.call($this, 'set_position', prev_min, prev_max); 1649 1650 // this is for the future, therefore "before the next 1651 // interaction starts" 1652 $this.data('beforestart_min', min); 1653 $this.data('beforestart_max', max); 1654 }, 1655 /* 1656 * This tells the slider to increment its step non linearly over the 1657 * current range, based on the histogram on where results are. 1658 * 1659 * the input parameter 'histogram' identifies an empirical probability 1660 * density function (PDF). 1661 * 1662 */ 1663 'set_step_histogram' : function (histogram) { 1664 var $this = this; 1665 1666 $this.data('last_step_histogram', histogram); 1667 1668 if (typeof histogram === 'undefined') { 1669 $.error('got an undefined histogram in set_step_histogram'); 1670 _methods.unset_step_histogram.call($this); 1671 } 1672 1673 var sliderWidthPx = _methods.getSliderWidthPx.call($this) - $this.data('left_grip_width'), 1674 nbuckets = histogram.length; 1675 1676 if (sliderWidthPx <= 0) { 1677 // that means the slider is not visible... 1678 return; 1679 } 1680 1681 // 1682 // we need to transform this pdf into a cdf, and use it to obtain 1683 // two mappings: pixel to value and value to pixel. 1684 // 1685 // 1) normalize the pdf to sum to sliderWidthPx first 1686 var i; 1687 var histogram_sum = 0; 1688 for (i=0; i<nbuckets; i++) { 1689 histogram_sum += histogram[i]; 1690 } 1691 1692 // 1693 // if the sum of the histogram is 0 it means that all is 0 in the 1694 // histogram! (i.e, flat histogram). In this case we already know 1695 // what's going to be the answer... 1696 // 1697 if (histogram_sum === 0) { 1698 // ... and the answer is: a linear scale between min_range and 1699 // max range! 1700 methods.unset_step_histogram.call($this); 1701 1702 return $this; 1703 } 1704 1705 // coefficient for normalization
1706 var coeff = parseFloat(histogram_sum)/sliderWidthPx; 1707 1708 // go normalize the histogram using this coefficient! 1709 for (i=0; i<nbuckets; i++) { 1710 histogram[i] = histogram[i]/coeff; 1711 } 1712 1713 // 2) now that the histogram is normalized, extract the cumulative 1714 // distribution function (CDF). This is an always increasing function 1715 // that ranges between 0 and sliderWidthPx; 1716 // 1717 // We also build the inverted cdf, just the cdf read the other way 1718 // around. 1719 // 1720 var cdf = [ histogram[0] ]; // points to pixels 1721 for (i=1; i<nbuckets; i++) { 1722 var cdf_x = cdf[i-1] + histogram[i]; 1723 cdf.push(cdf_x); 1724 } 1725 cdf.push(sliderWidthPx); 1726 1727 1728 // the first value here is always min_range as the cdf is supposed 1729 // to start from 0 (also first pixel = min_range) 1730 var pixel_to_value_lookup = [ $this.data('range_min') ]; 1731 1732 var last_filled = 0; // we've already filled 0 1733 1734 // now stretch over the rest of the cdf 1735 var last_price_for_cdf_bucket = pixel_to_value_lookup[0]; 1736 1737 var cdf_bucket_count = 0; 1738 while (last_filled <= sliderWidthPx) { // do until all pixels are filled 1739 1740 // get next item from cdf 1741 var fill_up_to_px = parseInt(cdf.shift(), 10); 1742 var price_for_cdf_bucket = 1743 _methods.inverse_rangemap_0_to_n.call($this, cdf_bucket_count+1, nbuckets+1); 1744 1745 cdf_bucket_count++; 1746 1747 // how many pixels do we have to fill 1748 var fill_tot = fill_up_to_px - last_filled; 1749 1750 // interpolate and fill 1751 var diff = price_for_cdf_bucket - last_price_for_cdf_bucket; 1752 for (i = last_filled; i < fill_up_to_px; i++) { 1753 var next_price_for_cdf_bucket = 1754 last_price_for_cdf_bucket + (diff * (i-last_filled+1) / fill_tot); 1755 1756 pixel_to_value_lookup.push(next_price_for_cdf_bucket); 1757 1758 last_filled++; 1759 1760 last_price_for_cdf_bucket = next_price_for_cdf_bucket; 1761 } 1762 1763 if (last_filled === sliderWidthPx) { 1764 break; 1765 } 1766 } 1767 pixel_to_value_lookup[pixel_to_value_lookup.length-1] = $this.data('range_max'); 1768 1769 // 3) build lookup functions to extract pixels and values from the 1770 // cdf and the inverted cdf. 1771 // 1772 var pixel_to_value_mapping = function (pixel) { 1773 return pixel_to_value_lookup[parseInt(pixel, 10)]; 1774 }; 1775 1776 var value_to_pixel_mapping = function (value) { 1777 // 1778 // Binary search into the array of pixels, returns always the 1779 // rightmost pixel if there is no exact match. 1780 // 1781 var suggestedPixel = _methods.binarySearch.call($this, pixel_to_value_lookup, value, 1782 function(a, i) { return a[i]; }, // access a value in the array 1783 _methods.binarySearchValueToPxCompareFunc 1784 ); 1785 1786 // exact match 1787 if (pixel_to_value_lookup[suggestedPixel] === value) { 1788 return suggestedPixel; 1789 } 1790 1791 // approx match: we need to check if it's closer to the value 1792 // at suggestedPixel or the value at suggestedPixel-1 1793 if ( Math.abs(pixel_to_value_lookup[suggestedPixel-1] - value) < 1794 Math.abs(pixel_to_value_lookup[suggestedPixel] - value) ) { 1795 1796 return suggestedPixel-1; 1797 } 1798 return suggestedPixel; 1799 }; 1800 1801 // 1802 // these two functions will be stored and then used internally to 1803 // decide what value to display given a certain pixel, and what 1804 // pixel to put the slider on given a certain value. 1805 // 1806 $this.data('pixel_to_value_mapping', pixel_to_value_mapping); 1807 $this.data('value_to_pixel_mapping', value_to_pixel_mapping); 1808 1809 return $this; 1810 }, 1811 /* 1812 * Remove the pixel-to-value and the value-to-pixel mappings from the 1813 * slider so that the slider can follow a linear step over the current 1814 * range again. 1815 */ 1816 'unset_step_histogram' : function () { 1817 var $this = this; 1818 1819 $this.removeData('pixel_to_value_mapping'); 1820 $this.removeData('value_to_pixel_mapping'); 1821 $this.removeData('last_step_histogram'); 1822 1823 return $this; 1824 }, 1825 'set_range' : function (rangeMin, rangeMax) { 1826 var $this = this; 1827 1828 // get the current values 1829 var oldMin = methods.get_current_min_value.call($this), 1830 oldMax = methods.get_current_max_value.call($this); 1831 1832 // set range 1833 $this.data('range_min', rangeMin); 1834 $this.data('range_max', rangeMax); 1835 1836 // try to re-center old values in the new range. 1837 // NOTE: this may set different values! 1838 _methods.set_position_from_val.call($this, oldMin, oldMax); 1839 1840 /* 1841 * Re-highlight ranges if any are defined. 1842 */ 1843 // var highlightRangeMin = $this.data('highlightedRangeMin'); 1844 // if (typeof rangeMin === 'number') { 1845 // // a highlight range is present, we must update it 1846 // var highlightRangeMax = $this.data('highlightedRangeMax'); 1847 // methods.highlight_range.call($this, highlightRangeMin, highlightRangeMax); 1848 // } 1849 1850 // pass old min and max in the notify_changed_implicit method, so that we 1851 // notify if we need to 1852 _methods.notify_changed_implicit.call($this, 'set_range', oldMin, oldMax); 1853 1854 return $this; 1855 }, 1856 /* 1857 * This method highlights the range of the slider apart from the 1858 * position of the slider grips. 1859 * To work well, the slider must have background color set to 1860 * transparent in the CSS or not set. 1861 */ 1862 'highlight_range' : function(rangeMin, rangeMax) { 1863 var $this = this; 1864 var settings = $this.data('settings'); 1865 1866 if (typeof settings.highlight === "undefined") { 1867 $.error('you cannot call highlight_range if you haven\' specified the "highlight" parameter in construction!'); 1868 } 1869 1870 // avoid empty string 1871 if (!rangeMin) { rangeMin = 0; } 1872 if (!rangeMax) { rangeMax = 0; } 1873 1874 // we need to map rangeMin and rangeMax into pixels. 1875 var leftPx = methods.value_to_px.call($this, rangeMin), 1876 rightPx = methods.value_to_px.call($this, rangeMax), 1877 barWidth = rightPx - leftPx + $this.data('left_grip_width'); 1878 1879 // set position 1880 var $highlightPanel = $this.find( 1881 settings.highlight.panel_selector 1882 ); 1883 1884 $highlightPanel.css('left', leftPx + "px"); 1885 $highlightPanel.css('width', barWidth + "px"); 1886 1887 // keep the latest highlighted range, because if set_range is called 1888 // we must be able to update the highlighting. 1889 $this.data('highlightedRangeMin', rangeMin); 1890 $this.data('highlightedRangeMax', rangeMax); 1891 1892 // now decide wether the handler should be highlight 1893 _methods.refresh_grips_style.call($this); 1894 1895 return $this; 1896 }, 1897 /*
1898 * Sets the increment rounding for the slider, see input parameters section 1899 * for more information. 1900 */ 1901 'set_rounding' : function (rounding) { 1902 var $this = this; 1903 1904 if (typeof rounding === 'string' && rounding.indexOf('{') > -1) { 1905 // probably a json string 1906 rounding = $.parseJSON(rounding); 1907 } 1908 1909 $this.data('rounding', rounding); 1910 1911 // build an array of roundings and sort it by value to facilitate search 1912 // when the range is going to be set. 1913 var roundings_array = []; 1914 if (typeof rounding === 'object') { 1915 // initial object has the form { value : range } 1916 var rounding_value; 1917 for (rounding_value in rounding) { // skip_javascript_test 1918 if (rounding.hasOwnProperty(rounding_value)) { 1919 var rounding_range = rounding[rounding_value]; 1920 roundings_array.push({ 1921 'range' : rounding_range, 1922 'value' : rounding_value 1923 }); 1924 } 1925 } 1926 1927 // now sort it by rounding range 1928 roundings_array.sort(function (a, b) { return a.range - b.range; }); 1929 1930 $this.data('rounding_ranges', roundings_array); 1931 } 1932 else { 1933 $this.removeData('rounding_ranges'); 1934 } 1935 1936 return $this; 1937 }, 1938 'get_rounding' : function () { 1939 var $this = this; 1940 return $this.data('rounding'); 1941 }, 1942 /* 1943 * This method rounds a given value to the closest integer defined 1944 * according to the rounding. Examples: 1945 * rounding: 10 v: 12.3 --> 10 1946 * rounding: 1 v: 12.3 --> 12 1947 * rounding: 10 v: 12.6 --> 13 1948 */ 1949 'round_value_according_to_rounding' : function(v) { 1950 var $this = this; 1951 var rounding = _methods.get_rounding_for_value.call($this, v); 1952 1953 if (rounding > 0) { 1954 // We bring ourselves in a space of unitary roundings. You can 1955 // imagine now that sliders range between a certain minimum and 1956 // maximum, and we always increase/decrease of one. 1957 var increment = v / rounding; 1958 1959 // This is the proposed value. 1960 var increment_int = parseInt(increment, 10); 1961 1962 // delta is a positive number between 0 and 1 that tells us how 1963 // close is the slider to integer + 1 (i.e., the next rounding). 1964 // 0 means the grip is exactly on integer 1965 // 1 means the grip is on integer + 1. 1966 var delta = increment - increment_int; 1967 1968 // now use delta to modify or not the current value. 1969 if (delta > 0.5) { 1970 increment_int++; 1971 } 1972 1973 // we now move the 1974 var rounded = increment_int * rounding; 1975 1976 return rounded; 1977 } 1978 else { 1979 $.error('rounding must be > 0, got ' + rounding + ' instead'); 1980 } 1981 return v; 1982 }, 1983 /* 1984 * Utility function. Given a value within the range of the slider, 1985 * converts the value in pixels. If a value_to_pixel_mapping function 1986 * is defined it will be used, otherwise a linear mapping is used for 1987 * the conversion. 1988 */ 1989 'value_to_px' : function (value) { 1990 var $this = this, 1991 value_to_pixel_mapping_func = $this.data('value_to_pixel_mapping'); 1992 1993 // try using non-linear mapping if it's there... 1994 if (typeof value_to_pixel_mapping_func !== 'undefined') { 1995 return value_to_pixel_mapping_func(value); 1996 } 1997 1998 // ... use linear mapping otherwise 1999 var w = _methods.getSliderWidthPx.call($this) - $this.data('left_grip_width'); 2000 return _methods.rangemap_0_to_n.call($this, value, w); 2001 } 2002 }; 2003 2004 var __name__ = 'nstSlider'; 2005 2006 $.fn[__name__] = function(method) { 2007 /* 2008 * Just a router for method calls 2009 */ 2010 if (methods[method]) { 2011 if (this.data('initialized') === true) { 2012 // call a method 2013 return methods[method].apply(this, 2014 Array.prototype.slice.call(arguments, 1) 2015 ); 2016 } 2017 else { 2018 throw new Error('method ' + method + ' called on an uninitialized instance of ' + __name__); 2019 } 2020 } 2021 else if (typeof method === 'object' || !method) { 2022 // call init, user passed the settings as parameters 2023 this.data('initialized', true); 2024 return methods.init.apply(this, arguments); 2025 } 2026 else { 2027 $.error('Cannot call method ' + method); 2028 } 2029 }; 2030})(jQuery); 2031 2032/*! Magnific Popup - v1.1.0 - 2016-02-20
2033* http://dimsemenov.com/plugins/magnific-popup/ 2034* Copyright (c) 2016 Dmitry Semenov; */ 2035!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isLowIE=b.isIE8=document.all&&!document.addEventListener,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e<h.length;e++)if(g=h[e],g.parsed&&(g=g.el[0]),g===c.el[0]){b.index=e;break}}else b.items=a.isArray(c.items)?c.items:[c.items],b.index=c.index||0;if(b.isOpen)return void b.updateItemHTML();b.types=[],f="",c.mainEl&&c.mainEl.length?b.ev=c.mainEl.eq(0):b.ev=d,c.key?(b.popupsCache[c.key]||(b.popupsCache[c.key]={}),b.currTemplate=b.popupsCache[c.key]):b.currTemplate={},b.st=a.extend(!0,{},a.magnificPopup.defaults,c),b.fixedContentPos="auto"===b.st.fixedContentPos?!b.probablyMobile:b.st.fixedContentPos,b.st.modal&&(b.st.closeOnContentClick=!1,b.st.closeOnBgClick=!1,b.st.showCloseBtn=!1,b.st.enableEscapeKey=!1),b.bgOverlay||(b.bgOverlay=x("bg").on("click"+p,function(){b.close()}),b.wrap=x("wrap").attr("tabindex",-1).on("click"+p,function(a){b._checkIfClose(a.target)&&b.close()}),b.container=x("container",b.wrap)),b.contentContainer=x("content"),b.st.preloader&&(b.preloader=x("preloader",b.container,b.st.tLoading));var i=a.magnificPopup.modules;for(e=0;e<i.length;e++){var j=i[e];j=j.charAt(0).toUpperCase()+j.slice(1),b["init"+j].call(b)}y("BeforeOpen"),b.st.showCloseBtn&&(b.st.closeBtnInside?(w(l,function(a,b,c,d){c.close_replaceWith=z(d.type)}),f+=" mfp-close-btn-in"):b.wrap.append(z())),b.st.alignTop&&(f+=" mfp-align-top"),b.fixedContentPos?b.wrap.css({overflow:b.st.overflowY,overflowX:"hidden",overflowY:b.st.overflowY}):b.wrap.css({top:v.scrollTop(),position:"absolute"}),(b.st.fixedBgPos===!1||"auto"===b.st.fixedBgPos&&!b.fixedContentPos)&&b.bgOverlay.css({height:d.height(),position:"absolute"}),b.st.enableEscapeKey&&d.on("keyup"+p,function(a){27===a.keyCode&&b.close()}),v.on("resize"+p,function(){b.updateSize()}),b.st.closeOnContentClick||(f+=" mfp-auto-cursor"),f&&b.wrap.addClass(f);var k=b.wH=v.height(),n={};if(b.fixedContentPos&&b._hasScrollBar(k)){var o=b._getScrollbarSize();o&&(n.marginRight=o)}b.fixedContentPos&&(b.isIE7?a("body, html").css("overflow","hidden"):n.overflow="hidden");var r=b.st.mainClass;return b.isIE7&&(r+=" mfp-ie7"),r&&b._addClassToMFP(r),b.updateItemHTML(),y("BuildControls"),a("html").css(n),b.bgOverlay.add(b.wrap).prependTo(b.st.prependTo||a(document.body)),b._lastFocusedEl=document.activeElement,setTimeout(function(){b.content?(b._addClassToMFP(q),b._setFocus()):b.bgOverlay.addClass(q),d.on("focusin"+p,b._onFocusIn)},16),b.isOpen=!0,b.updateSize(k),y(m),c},close:function(){b.isOpen&&(y(i),b.isOpen=!1,b.st.removalDelay&&!b.isLowIE&&b.supportsTransition?(b._addClassToMFP(r),setTimeout(function(){b._close()},b.st.removalDelay)):b._close())},_close:function(){y(h);var c=r+" "+q+" ";if(b.bgOverlay.detach(),b.wrap.detach(),b.container.empty(),b.st.mainClass&&(c+=b.st.mainClass+" "),b._removeClassFromMFP(c),b.fixedContentPos){var e={marginRight:""};b.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}d.off("keyup"+p+" focusin"+p),b.ev.off(p),b.wrap.attr("class","mfp-wrap").removeAttr("style"),b.bgOverlay.attr("class","mfp-bg"),b.container.attr("class","mfp-container"),!b.st.showCloseBtn||b.st.closeBtnInside&&b.currTemplate[b.currItem.type]!==!0||b.currTemplate.closeBtn&&b.currTemplate.closeBtn.detach(),b.st.autoFocusLast&&b._lastFocusedEl&&a(b._lastFocusedEl).focus(),b.currItem=null,b.content=null,b.currTemplate=null,b.prevHeight=0,y(j)}
2035,updateSize:function(a){if(b.isIOS){var c=document.documentElement.clientWidth/window.innerWidth,d=window.innerHeight*c;b.wrap.css("height",d),b.wH=d}else b.wH=a||v.height();b.fixedContentPos||b.wrap.css("height",b.wH),y("Resize")},updateItemHTML:function(){var c=b.items[b.index];b.contentContainer.detach(),b.content&&b.content.detach(),c.parsed||(c=b.parseEl(b.index));var d=c.type;if(y("BeforeChange",[b.currItem?b.currItem.type:"",d]),b.currItem=c,!b.currTemplate[d]){var f=b.st[d]?b.st[d].markup:!1;y("FirstMarkupParse",f),f?b.currTemplate[d]=a(f):b.currTemplate[d]=!0}e&&e!==c.type&&b.container.removeClass("mfp-"+e+"-holder");var g=b["get"+d.charAt(0).toUpperCase()+d.slice(1)](c,b.currTemplate[d]);b.appendContent(g,d),c.preloaded=!0,y(n,c),e=c.type,b.container.prepend(b.contentContainer),y("AfterChange")},appendContent:function(a,c){b.content=a,a?b.st.showCloseBtn&&b.st.closeBtnInside&&b.currTemplate[c]===!0?b.content.find(".mfp-close").length||b.content.append(z()):b.content=a:b.content="",y(k),b.container.addClass("mfp-"+c+"-holder"),b.contentContainer.append(b.content)},parseEl:function(c){var d,e=b.items[c];if(e.tagName?e={el:a(e)}:(d=e.type,e={data:e,src:e.src}),e.el){for(var f=b.types,g=0;g<f.length;g++)if(e.el.hasClass("mfp-"+f[g])){d=f[g];break}e.src=e.el.attr("data-mfp-src"),e.src||(e.src=e.el.attr("href"))}return e.type=d||b.st.type||"inline",e.index=c,e.parsed=!0,b.items[c]=e,y("ElementParse",e),b.items[c]},addGroup:function(a,c){var d=function(d){d.mfpEl=this,b._openClick(d,a,c)};c||(c={});var e="click.magnificPopup";c.mainEl=a,c.items?(c.isObj=!0,a.off(e).on(e,d)):(c.isObj=!1,c.delegate?a.off(e).on(e,c.delegate,d):(c.items=a,a.off(e).on(e,d)))},_openClick:function(c,d,e){var f=void 0!==e.midClick?e.midClick:a.magnificPopup.defaults.midClick;if(f||!(2===c.which||c.ctrlKey||c.metaKey||c.altKey||c.shiftKey)){var g=void 0!==e.disableOn?e.disableOn:a.magnificPopup.defaults.disableOn;if(g)if(a.isFunction(g)){if(!g.call(b))return!0}else if(v.width()<g)return!0;c.type&&(c.preventDefault(),b.isOpen&&c.stopPropagation()),e.el=a(c.mfpEl),e.delegate&&(e.items=d.find(e.delegate)),b.open(e)}},updateStatus:function(a,d){if(b.preloader){c!==a&&b.container.removeClass("mfp-s-"+c),d||"loading"!==a||(d=b.st.tLoading);var e={status:a,text:d};y("UpdateStatus",e),a=e.status,d=e.text,b.preloader.html(d),b.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),b.container.addClass("mfp-s-"+a),c=a}},_checkIfClose:function(c){if(!a(c).hasClass(s)){var d=b.st.closeOnContentClick,e=b.st.closeOnBgClick;if(d&&e)return!0;if(!b.content||a(c).hasClass("mfp-close")||b.preloader&&c===b.preloader[0])return!0;if(c===b.content[0]||a.contains(b.content[0],c)){if(d)return!0}else if(e&&a.contains(document,c))return!0;return!1}},_addClassToMFP:function(a){b.bgOverlay.addClass(a),b.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),b.wrap.removeClass(a)},_hasScrollBar:function(a){return(b.isIE7?d.height():document.body.scrollHeight)>(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(c,d){if(void 0===d||d===!1)return!0;if(e=c.split("_"),e.length>1){var f=b.find(p+"-"+e[0]);if(f.length>0){var g=e[1];"replaceWith"===g?f[0]!==d[0]&&f.replaceWith(d):"img"===g?f.is("img")?f.attr("src",d):f.replaceWith(a("<img>").attr("src",d).attr("class",f.attr("class"))):f.attr(e[1],d)}}else b.find(p+"-"+c).html(d)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},a.fn.magnificPopup=function(c){A();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1
2035));else c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("<div>");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;
2035var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});
2035var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=b.st.gallery,e=".mfp-gallery";return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s);e.click(function(){b.prev()}),f.click(function(){b.next()}),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('<img class="mfp-img" />').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),A()}); 2036/* perfect-scrollbar v0.6.10 */ 2037(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ 2038'use strict'; 2039 2040var ps = require('../main') 2041 , psInstances = require('../plugin/instances'); 2042 2043function mountJQuery(jQuery) { 2044 jQuery.fn.perfectScrollbar = function (settingOrCommand) { 2045 return this.each(function () { 2046 if (typeof settingOrCommand === 'object' || 2047 typeof settingOrCommand === 'undefined') { 2048 // If it's an object or none, initialize. 2049 var settings = settingOrCommand; 2050 2051 if (!psInstances.get(this)) { 2052 ps.initialize(this, settings); 2053 } 2054 } else { 2055 // Unless, it may be a command. 2056 var command = settingOrCommand; 2057 2058 if (command === 'update') { 2059 ps.update(this); 2060 } else if (command === 'destroy') { 2061 ps.destroy(this); 2062 } 2063 }; 2064 return jQuery(this); 2065 }); 2066 }; 2067} 2068 2069if (typeof define === 'function' && define.amd) { 2070 // AMD. Register as an anonymous module.
2071 define(['jquery'], mountJQuery); 2072} else { 2073 var jq = window.jQuery ? window.jQuery : window.$; 2074 if (typeof jq !== 'undefined') { 2075 mountJQuery(jq); 2076 } 2077} 2078 2079module.exports = mountJQuery; 2080 2081},{"../main":7,"../plugin/instances":18}],2:[function(require,module,exports){ 2082'use strict'; 2083 2084function oldAdd(element, className) { 2085 var classes = element.className.split(' '); 2086 if (classes.indexOf(className) < 0) { 2087 classes.push(className); 2088 } 2089 element.className = classes.join(' '); 2090} 2091 2092function oldRemove(element, className) { 2093 var classes = element.className.split(' '); 2094 var idx = classes.indexOf(className); 2095 if (idx >= 0) { 2096 classes.splice(idx, 1); 2097 } 2098 element.className = classes.join(' '); 2099} 2100 2101exports.add = function (element, className) { 2102 if (element.classList) { 2103 element.classList.add(className); 2104 } else { 2105 oldAdd(element, className); 2106 } 2107}; 2108 2109exports.remove = function (element, className) { 2110 if (element.classList) { 2111 element.classList.remove(className); 2112 } else { 2113 oldRemove(element, className); 2114 } 2115}; 2116 2117exports.list = function (element) { 2118 if (element.classList) { 2119 return Array.prototype.slice.apply(element.classList); 2120 } else { 2121 return element.className.split(' '); 2122 } 2123}; 2124 2125},{}],3:[function(require,module,exports){ 2126'use strict'; 2127 2128var DOM = {}; 2129 2130DOM.e = function (tagName, className) { 2131 var element = document.createElement(tagName); 2132 element.className = className; 2133 return element; 2134}; 2135 2136DOM.appendTo = function (child, parent) { 2137 parent.appendChild(child); 2138 return child; 2139}; 2140 2141function cssGet(element, styleName) { 2142 return window.getComputedStyle(element)[styleName]; 2143} 2144 2145function cssSet(element, styleName, styleValue) { 2146 if (typeof styleValue === 'number') { 2147 styleValue = styleValue.toString() + 'px'; 2148 } 2149 element.style[styleName] = styleValue; 2150 return element; 2151} 2152 2153function cssMultiSet(element, obj) { 2154 for (var key in obj) { 2155 var val = obj[key]; 2156 if (typeof val === 'number') { 2157 val = val.toString() + 'px'; 2158 } 2159 element.style[key] = val; 2160 } 2161 return element; 2162} 2163 2164DOM.css = function (element, styleNameOrObject, styleValue) { 2165 if (typeof styleNameOrObject === 'object') { 2166 // multiple set with object 2167 return cssMultiSet(element, styleNameOrObject); 2168 } else { 2169 if (typeof styleValue === 'undefined') { 2170 return cssGet(element, styleNameOrObject); 2171 } else { 2172 return cssSet(element, styleNameOrObject, styleValue); 2173 } 2174 } 2175}; 2176 2177DOM.matches = function (element, query) { 2178 if (typeof element.matches !== 'undefined') { 2179 return element.matches(query); 2180 } else { 2181 if (typeof element.matchesSelector !== 'undefined') { 2182 return element.matchesSelector(query); 2183 } else if (typeof element.webkitMatchesSelector !== 'undefined') { 2184 return element.webkitMatchesSelector(query); 2185 } else if (typeof element.mozMatchesSelector !== 'undefined') { 2186 return element.mozMatchesSelector(query); 2187 } else if (typeof element.msMatchesSelector !== 'undefined') { 2188 return element.msMatchesSelector(query); 2189 } 2190 } 2191}; 2192 2193DOM.remove = function (element) { 2194 if (typeof element.remove !== 'undefined') { 2195 element.remove(); 2196 } else { 2197 if (element.parentNode) { 2198 element.parentNode.removeChild(element); 2199 } 2200 } 2201}; 2202 2203DOM.queryChildren = function (element, selector) { 2204 return Array.prototype.filter.call(element.childNodes, function (child) { 2205 return DOM.matches(child, selector); 2206 }); 2207}; 2208 2209module.exports = DOM; 2210 2211},{}],4:[function(require,module,exports){ 2212'use strict'; 2213 2214var EventElement = function (element) { 2215 this.element = element; 2216 this.events = {}; 2217}; 2218 2219EventElement.prototype.bind = function (eventName, handler) { 2220 if (typeof this.events[eventName] === 'undefined') { 2221 this.events[eventName] = []; 2222 } 2223 this.events[eventName].push(handler); 2224 this.element.addEventListener(eventName, handler, false); 2225}; 2226 2227EventElement.prototype.unbind = function (eventName, handler) { 2228 var isHandlerProvided = (typeof handler !== 'undefined'); 2229 this.events[eventName] = this.events[eventName].filter(function (hdlr) { 2230 if (isHandlerProvided && hdlr !== handler) { 2231 return true; 2232 } 2233 this.element.removeEventListener(eventName, hdlr, false); 2234 return false;
2235 }, this); 2236}; 2237 2238EventElement.prototype.unbindAll = function () { 2239 for (var name in this.events) { 2240 this.unbind(name); 2241 } 2242}; 2243 2244var EventManager = function () { 2245 this.eventElements = []; 2246}; 2247 2248EventManager.prototype.eventElement = function (element) { 2249 var ee = this.eventElements.filter(function (eventElement) { 2250 return eventElement.element === element; 2251 })[0]; 2252 if (typeof ee === 'undefined') { 2253 ee = new EventElement(element); 2254 this.eventElements.push(ee); 2255 } 2256 return ee; 2257}; 2258 2259EventManager.prototype.bind = function (element, eventName, handler) { 2260 this.eventElement(element).bind(eventName, handler); 2261}; 2262 2263EventManager.prototype.unbind = function (element, eventName, handler) { 2264 this.eventElement(element).unbind(eventName, handler); 2265}; 2266 2267EventManager.prototype.unbindAll = function () { 2268 for (var i = 0; i < this.eventElements.length; i++) { 2269 this.eventElements[i].unbindAll(); 2270 } 2271}; 2272 2273EventManager.prototype.once = function (element, eventName, handler) { 2274 var ee = this.eventElement(element); 2275 var onceHandler = function (e) { 2276 ee.unbind(eventName, onceHandler); 2277 handler(e); 2278 }; 2279 ee.bind(eventName, onceHandler); 2280}; 2281 2282module.exports = EventManager; 2283 2284},{}],5:[function(require,module,exports){ 2285'use strict'; 2286 2287module.exports = (function () { 2288 function s4() { 2289 return Math.floor((1 + Math.random()) * 0x10000) 2290 .toString(16) 2291 .substring(1); 2292 } 2293 return function () { 2294 return s4() + s4() + '-' + s4() + '-' + s4() + '-' + 2295 s4() + '-' + s4() + s4() + s4(); 2296 }; 2297})(); 2298 2299},{}],6:[function(require,module,exports){ 2300'use strict'; 2301 2302var cls = require('./class') 2303 , d = require('./dom'); 2304 2305exports.toInt = function (x) { 2306 return parseInt(x, 10) || 0; 2307}; 2308 2309exports.clone = function (obj) { 2310 if (obj === null) { 2311 return null; 2312 } else if (typeof obj === 'object') { 2313 var result = {}; 2314 for (var key in obj) { 2315 result[key] = this.clone(obj[key]); 2316 } 2317 return result; 2318 } else { 2319 return obj; 2320 } 2321}; 2322 2323exports.extend = function (original, source) { 2324 var result = this.clone(original); 2325 for (var key in source) { 2326 result[key] = this.clone(source[key]); 2327 } 2328 return result; 2329}; 2330 2331exports.isEditable = function (el) { 2332 return d.matches(el, "input,[contenteditable]") || 2333 d.matches(el, "select,[contenteditable]") || 2334 d.matches(el, "textarea,[contenteditable]") || 2335 d.matches(el, "button,[contenteditable]"); 2336}; 2337 2338exports.removePsClasses = function (element) { 2339 var clsList = cls.list(element); 2340 for (var i = 0; i < clsList.length; i++) { 2341 var className = clsList[i]; 2342 if (className.indexOf('ps-') === 0) { 2343 cls.remove(element, className); 2344 } 2345 } 2346}; 2347 2348exports.outerWidth = function (element) { 2349 return this.toInt(d.css(element, 'width')) + 2350 this.toInt(d.css(element, 'paddingLeft')) + 2351 this.toInt(d.css(element, 'paddingRight')) + 2352 this.toInt(d.css(element, 'borderLeftWidth')) + 2353 this.toInt(d.css(element, 'borderRightWidth')); 2354}; 2355 2356exports.startScrolling = function (element, axis) { 2357 cls.add(element, 'ps-in-scrolling'); 2358 if (typeof axis !== 'undefined') { 2359 cls.add(element, 'ps-' + axis); 2360 } else { 2361 cls.add(element, 'ps-x'); 2362 cls.add(element, 'ps-y'); 2363 } 2364}; 2365 2366exports.stopScrolling = function (element, axis) { 2367 cls.remove(element, 'ps-in-scrolling'); 2368 if (typeof axis !== 'undefined') { 2369 cls.remove(element, 'ps-' + axis); 2370 } else { 2371 cls.remove(element, 'ps-x'); 2372 cls.remove(element, 'ps-y'); 2373 } 2374}; 2375 2376exports.env = { 2377 isWebKit: 'WebkitAppearance' in document.documentElement.style, 2378 supportsTouch: (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch), 2379 supportsIePointer: window.navigator.msMaxTouchPoints !== null 2380}; 2381 2382},{"./class":2,"./dom":3}],7:[function(require,module,exports){ 2383'use strict'; 2384 2385var destroy = require('./plugin/destroy') 2386 , initialize = require('./plugin/initialize') 2387 , update = require('./plugin/update'); 2388 2389module.exports = { 2390 initialize: initialize, 2391 update: update, 2392 destroy: destroy 2393}; 2394 2395},{"./plugin/destroy":9,"./plugin/initialize":17,"./plugin/update":2
23951}],8:[function(require,module,exports){ 2396'use strict'; 2397 2398module.exports = { 2399 maxScrollbarLength: null, 2400 minScrollbarLength: null, 2401 scrollXMarginOffset: 0, 2402 scrollYMarginOffset: 0, 2403 stopPropagationOnClick: true, 2404 suppressScrollX: false, 2405 suppressScrollY: false, 2406 swipePropagation: true, 2407 useBothWheelAxes: false, 2408 useKeyboard: true, 2409 useSelectionScroll: false, 2410 wheelPropagation: false, 2411 wheelSpeed: 1, 2412 theme: 'default' 2413}; 2414 2415},{}],9:[function(require,module,exports){ 2416'use strict'; 2417 2418var d = require('../lib/dom') 2419 , h = require('../lib/helper') 2420 , instances = require('./instances'); 2421 2422module.exports = function (element) { 2423 var i = instances.get(element); 2424 2425 if (!i) { 2426 return; 2427 } 2428 2429 i.event.unbindAll(); 2430 d.remove(i.scrollbarX); 2431 d.remove(i.scrollbarY); 2432 d.remove(i.scrollbarXRail); 2433 d.remove(i.scrollbarYRail); 2434 h.removePsClasses(element); 2435 2436 instances.remove(element); 2437}; 2438 2439},{"../lib/dom":3,"../lib/helper":6,"./instances":18}],10:[function(require,module,exports){ 2440'use strict'; 2441 2442var h = require('../../lib/helper') 2443 , instances = require('../instances') 2444 , updateGeometry = require('../update-geometry') 2445 , updateScroll = require('../update-scroll'); 2446 2447function bindClickRailHandler(element, i) { 2448 function pageOffset(el) { 2449 return el.getBoundingClientRect(); 2450 } 2451 var stopPropagation = window.Event.prototype.stopPropagation.bind; 2452 2453 if (i.settings.stopPropagationOnClick) { 2454 i.event.bind(i.scrollbarY, 'click', stopPropagation); 2455 } 2456 i.event.bind(i.scrollbarYRail, 'click', function (e) { 2457 var halfOfScrollbarLength = h.toInt(i.scrollbarYHeight / 2); 2458 var positionTop = i.railYRatio * (e.pageY - window.pageYOffset - pageOffset(i.scrollbarYRail).top - halfOfScrollbarLength); 2459 var maxPositionTop = i.railYRatio * (i.railYHeight - i.scrollbarYHeight); 2460 var positionRatio = positionTop / maxPositionTop; 2461 2462 if (positionRatio < 0) { 2463 positionRatio = 0; 2464 } else if (positionRatio > 1) { 2465 positionRatio = 1; 2466 } 2467 2468 updateScroll(element, 'top', (i.contentHeight - i.containerHeight) * positionRatio); 2469 updateGeometry(element); 2470 2471 e.stopPropagation(); 2472 }); 2473 2474 if (i.settings.stopPropagationOnClick) { 2475 i.event.bind(i.scrollbarX, 'click', stopPropagation); 2476 } 2477 i.event.bind(i.scrollbarXRail, 'click', function (e) { 2478 var halfOfScrollbarLength = h.toInt(i.scrollbarXWidth / 2); 2479 var positionLeft = i.railXRatio * (e.pageX - window.pageXOffset - pageOffset(i.scrollbarXRail).left - halfOfScrollbarLength); 2480 var maxPositionLeft = i.railXRatio * (i.railXWidth - i.scrollbarXWidth); 2481 var positionRatio = positionLeft / maxPositionLeft; 2482 2483 if (positionRatio < 0) { 2484 positionRatio = 0; 2485 } else if (positionRatio > 1) { 2486 positionRatio = 1; 2487 } 2488 2489 updateScroll(element, 'left', ((i.contentWidth - i.containerWidth) * positionRatio) - i.negativeScrollAdjustment); 2490 updateGeometry(element); 2491 2492 e.stopPropagation(); 2493 }); 2494} 2495 2496module.exports = function (element) { 2497 var i = instances.get(element); 2498 bindClickRailHandler(element, i); 2499}; 2500 2501},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],11:[function(require,module,exports){ 2502'use strict'; 2503 2504var d = require('../../lib/dom') 2505 , h = require('../../lib/helper') 2506 , instances = require('../instances') 2507 , updateGeometry = require('../update-geometry') 2508 , updateScroll = require('../update-scroll'); 2509 2510function bindMouseScrollXHandler(element, i) { 2511 var currentLeft = null; 2512 var currentPageX = null; 2513 2514 function updateScrollLeft(deltaX) { 2515 var newLeft = currentLeft + (deltaX * i.railXRatio); 2516 var maxLeft = Math.max(0, i.scrollbarXRail.getBoundingClientRect().left) + (i.railXRatio * (i.railXWidth - i.scrollbarXWidth)); 2517 2518 if (newLeft < 0) { 2519 i.scrollbarXLeft = 0; 2520 } else if (newLeft > maxLeft) { 2521 i.scrollbarXLeft = maxLeft; 2522 } else { 2523 i.scrollbarXLeft = newLeft; 2524 } 2525 2526 var scrollLeft = h.toInt(i.scrollbarXLeft * (i.contentWidth - i.containerWidth) / (i.containerWidth - (i.railXRatio * i.scrollbarXWidth))) - i.negativeScrollAdjustment; 2527 updateScroll(element, 'left', scrollLeft); 2528 } 2529 2530 var mouseMoveHandler = function (e) { 2531 updateScrollLeft(e.pageX - currentPageX); 2532 updateGeometry(element); 2533 e.stopPropagation(); 2534 e.preventDefault(); 2535 }; 2536 2537 var mouseUpHandler = function () { 2538 h.stopScrolling(element, 'x'); 2539 i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler); 2540 }; 2541 2542 i.event.bind(i.scrollbarX, 'mousedown', function (e) { 2543 currentPageX = e.pageX; 2544 currentLeft = h.toInt(d.css(i.scrollbarX, 'left')) * i.railXRatio; 2545 h.startScrolling(element, 'x'); 2546 2547 i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler); 2548 i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler); 2549 2550 e.stopPropagation(); 2551 e.preventDefault(); 2552 }); 2553} 2554 2555function bindMouseScrollYHandler(element, i) { 2556 var currentTop = null; 2557 var currentPageY = null; 2558 2559 function updateScrollTop(deltaY) { 2560 var newTop = currentTop + (deltaY * i.railYRatio); 2561 var maxTop = Math.max(0, i.scrollbarYRail.getBoundingClientRect().top) + (i.railYRatio * (i.railYHeight - i.scrollbarYHeight)); 2562 2563 if (newTop < 0) { 2564 i.scrollbarYTop = 0; 2565 } else if (newTop > maxTop) { 2566 i.scrollbarYTop = maxTop; 2567 } else { 2568 i.scrollbarYTop = newTop; 2569 } 2570 2571 var scrollTop = h.toInt(i.scrollbarYTop * (i.contentHeight - i.containerHeight) / (i.containerHeight - (i.railYRatio * i.scrollbarYHeight))); 2572 updateScroll(element, 'top', scrollTop); 2573 } 2574 2575 var mouseMoveHandler = function (e) { 2576 updateScrollTop(e.pageY - currentPageY); 2577 updateGeometry(element); 2578 e.stopPropagation(); 2579 e.preventDefault(); 2580 }; 2581 2582 var mouseUpHandler = function () { 2583 h.stopScrolling(element, 'y'); 2584 i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler); 2585 }; 2586 2587 i.event.bind(i.scrollbarY, 'mousedown', function (e) { 2588 currentPageY = e.pageY; 2589 currentTop = h.toInt(d.css(i.scrollbarY, 'top')) * i.railYRatio; 2590 h.startScrolling(element, 'y'); 2591 2592 i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler); 2593 i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler); 2594 2595 e.stopPropagation(); 2596 e.preventDefault(); 2597 }); 2598} 2599 2600module.exports = function (element) { 2601 var i = instances.get(element); 2602 bindMouseScrollXHandler(element, i); 2603 bindMouseScrollYHandler(element, i); 2604}; 2605 2606},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],12:[function(require,module,exports){ 2607'use strict'; 2608 2609var h = require('../../lib/helper') 2610 , d = require('../../lib/dom') 2611 , instances = require('../instances') 2612 , updateGeometry = require('../update-geometry') 2613 , updateScroll = require('../update-scroll'); 2614 2615function bindKeyboardHandler(element, i) { 2616 var hovered = false;
2617 i.event.bind(element, 'mouseenter', function () { 2618 hovered = true; 2619 }); 2620 i.event.bind(element, 'mouseleave', function () { 2621 hovered = false; 2622 }); 2623 2624 var shouldPrevent = false; 2625 function shouldPreventDefault(deltaX, deltaY) { 2626 var scrollTop = element.scrollTop; 2627 if (deltaX === 0) { 2628 if (!i.scrollbarYActive) { 2629 return false; 2630 } 2631 if ((scrollTop === 0 && deltaY > 0) || (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)) { 2632 return !i.settings.wheelPropagation; 2633 } 2634 } 2635 2636 var scrollLeft = element.scrollLeft; 2637 if (deltaY === 0) { 2638 if (!i.scrollbarXActive) { 2639 return false; 2640 } 2641 if ((scrollLeft === 0 && deltaX < 0) || (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)) { 2642 return !i.settings.wheelPropagation; 2643 } 2644 } 2645 return true; 2646 } 2647 2648 i.event.bind(i.ownerDocument, 'keydown', function (e) { 2649 if (e.isDefaultPrevented && e.isDefaultPrevented()) { 2650 return; 2651 } 2652 2653 var focused = d.matches(i.scrollbarX, ':focus') || 2654 d.matches(i.scrollbarY, ':focus'); 2655 2656 if (!hovered && !focused) { 2657 return; 2658 } 2659 2660 var activeElement = document.activeElement ? document.activeElement : i.ownerDocument.activeElement; 2661 if (activeElement) { 2662 // go deeper if element is a webcomponent 2663 while (activeElement.shadowRoot) { 2664 activeElement = activeElement.shadowRoot.activeElement; 2665 } 2666 if (h.isEditable(activeElement)) { 2667 return; 2668 } 2669 } 2670 2671 var deltaX = 0; 2672 var deltaY = 0; 2673 2674 switch (e.which) { 2675 case 37: // left 2676 deltaX = -30; 2677 break; 2678 case 38: // up 2679 deltaY = 30; 2680 break; 2681 case 39: // right 2682 deltaX = 30; 2683 break; 2684 case 40: // down 2685 deltaY = -30; 2686 break; 2687 case 33: // page up 2688 deltaY = 90; 2689 break; 2690 case 32: // space bar 2691 if (e.shiftKey) { 2692 deltaY = 90; 2693 } else { 2694 deltaY = -90; 2695 } 2696 break; 2697 case 34: // page down 2698 deltaY = -90; 2699 break; 2700 case 35: // end 2701 if (e.ctrlKey) { 2702 deltaY = -i.contentHeight; 2703 } else { 2704 deltaY = -i.containerHeight; 2705 } 2706 break; 2707 case 36: // home 2708 if (e.ctrlKey) { 2709 deltaY = element.scrollTop; 2710 } else { 2711 deltaY = i.containerHeight; 2712 } 2713 break; 2714 default: 2715 return; 2716 } 2717 2718 updateScroll(element, 'top', element.scrollTop - deltaY); 2719 updateScroll(element, 'left', element.scrollLeft + deltaX); 2720 updateGeometry(element); 2721 2722 shouldPrevent = shouldPreventDefault(deltaX, deltaY); 2723 if (shouldPrevent) { 2724 e.preventDefault(); 2725 } 2726 }); 2727} 2728 2729module.exports = function (element) { 2730 var i = instances.get(element); 2731 bindKeyboardHandler(element, i); 2732}; 2733 2734},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],13:[function(require,module,exports){ 2735'use strict'; 2736 2737var instances = require('../instances') 2738 , updateGeometry = require('../update-geometry') 2739 , updateScroll = require('../update-scroll'); 2740 2741function bindMouseWheelHandler(element, i) { 2742 var shouldPrevent = false; 2743 2744 function shouldPreventDefault(deltaX, deltaY) { 2745 var scrollTop = element.scrollTop; 2746 if (deltaX === 0) { 2747 if (!i.scrollbarYActive) { 2748 return false; 2749 } 2750 if ((scrollTop === 0 && deltaY > 0) || (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)) { 2751 return !i.settings.wheelPropagation; 2752 } 2753 } 2754 2755 var scrollLeft = element.scrollLeft; 2756 if (deltaY === 0) { 2757 if (!i.scrollbarXActive) { 2758 return false; 2759 } 2760 if ((scrollLeft === 0 && deltaX < 0) || (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)) { 2761 return !i.settings.wheelPropagation; 2762 } 2763 } 2764 return true; 2765 } 2766 2767 function getDeltaFromEvent(e) { 2768 var deltaX = e.deltaX; 2769 var deltaY = -1 * e.deltaY; 2770 2771 if (typeof deltaX === "undefined" || typeof deltaY === "undefined") { 2772 // OS X Safari 2773 deltaX = -1 * e.wheelDeltaX / 6; 2774 deltaY = e.wheelDeltaY / 6; 2775 } 2776 2777 if (e.deltaMode && e.deltaMode === 1) { 2778 // Firefox in deltaMode 1: Line scrolling 2779 deltaX *= 10; 2780 deltaY *= 10; 2781 } 2782 2783 if (deltaX !== deltaX && deltaY !== deltaY/* NaN checks */) { 2784 // IE in some mouse drivers 2785 deltaX = 0; 2786 deltaY = e.wheelDelta; 2787 } 2788 2789 return [deltaX, deltaY]; 2790 } 2791 2792 function shouldBeConsumedByTextarea(deltaX, deltaY) { 2793 var hoveredTextarea = element.querySelector('textarea:hover'); 2794 if (hoveredTextarea) { 2795 var maxScrollTop = hoveredTextarea.scrollHeight - hoveredTextarea.clientHeight; 2796 if (maxScrollTop > 0) { 2797 if (!(hoveredTextarea.scrollTop === 0 && deltaY > 0) && 2798 !(hoveredTextarea.scrollTop === maxScrollTop && deltaY < 0)) { 2799 return true; 2800 } 2801 } 2802 var maxScrollLeft = hoveredTextarea.scrollLeft - hoveredTextarea.clientWidth; 2803 if (maxScrollLeft > 0) { 2804 if (!(hoveredTextarea.scrollLeft === 0 && deltaX < 0) && 2805 !(hoveredTextarea.scrollLeft === maxScrollLeft && deltaX > 0)) { 2806 return true; 2807 } 2808 } 2809 } 2810 return false;
2811 } 2812 2813 function mousewheelHandler(e) { 2814 var delta = getDeltaFromEvent(e); 2815 2816 var deltaX = delta[0]; 2817 var deltaY = delta[1]; 2818 2819 if (shouldBeConsumedByTextarea(deltaX, deltaY)) { 2820 return; 2821 } 2822 2823 shouldPrevent = false; 2824 if (!i.settings.useBothWheelAxes) { 2825 // deltaX will only be used for horizontal scrolling and deltaY will 2826 // only be used for vertical scrolling - this is the default 2827 updateScroll(element, 'top', element.scrollTop - (deltaY * i.settings.wheelSpeed)); 2828 updateScroll(element, 'left', element.scrollLeft + (deltaX * i.settings.wheelSpeed)); 2829 } else if (i.scrollbarYActive && !i.scrollbarXActive) { 2830 // only vertical scrollbar is active and useBothWheelAxes option is 2831 // active, so let's scroll vertical bar using both mouse wheel axes 2832 if (deltaY) { 2833 updateScroll(element, 'top', element.scrollTop - (deltaY * i.settings.wheelSpeed)); 2834 } else { 2835 updateScroll(element, 'top', element.scrollTop + (deltaX * i.settings.wheelSpeed)); 2836 } 2837 shouldPrevent = true; 2838 } else if (i.scrollbarXActive && !i.scrollbarYActive) { 2839 // useBothWheelAxes and only horizontal bar is active, so use both 2840 // wheel axes for horizontal bar 2841 if (deltaX) { 2842 updateScroll(element, 'left', element.scrollLeft + (deltaX * i.settings.wheelSpeed)); 2843 } else { 2844 updateScroll(element, 'left', element.scrollLeft - (deltaY * i.settings.wheelSpeed)); 2845 } 2846 shouldPrevent = true; 2847 } 2848 2849 updateGeometry(element); 2850 2851 shouldPrevent = (shouldPrevent || shouldPreventDefault(deltaX, deltaY)); 2852 if (shouldPrevent) { 2853 e.stopPropagation(); 2854 e.preventDefault(); 2855 } 2856 } 2857 2858 if (typeof window.onwheel !== "undefined") { 2859 i.event.bind(element, 'wheel', mousewheelHandler); 2860 } else if (typeof window.onmousewheel !== "undefined") { 2861 i.event.bind(element, 'mousewheel', mousewheelHandler); 2862 } 2863} 2864 2865module.exports = function (element) { 2866 var i = instances.get(element); 2867 bindMouseWheelHandler(element, i); 2868}; 2869 2870},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],14:[function(require,module,exports){ 2871'use strict'; 2872 2873var instances = require('../instances') 2874 , updateGeometry = require('../update-geometry'); 2875 2876function bindNativeScrollHandler(element, i) { 2877 i.event.bind(element, 'scroll', function () { 2878 updateGeometry(element); 2879 }); 2880} 2881 2882module.exports = function (element) { 2883 var i = instances.get(element); 2884 bindNativeScrollHandler(element, i); 2885}; 2886 2887},{"../instances":18,"../update-geometry":19}],15:[function(require,module,exports){ 2888'use strict'; 2889 2890var h = require('../../lib/helper') 2891 , instances = require('../instances') 2892 , updateGeometry = require('../update-geometry') 2893 , updateScroll = require('../update-scroll'); 2894 2895function bindSelectionHandler(element, i) { 2896 function getRangeNode() { 2897 var selection = window.getSelection ? window.getSelection() : 2898 document.getSelection ? document.getSelection() : ''; 2899 if (selection.toString().length === 0) { 2900 return null; 2901 } else { 2902 return selection.getRangeAt(0).commonAncestorContainer; 2903 } 2904 } 2905 2906 var scrollingLoop = null; 2907 var scrollDiff = {top: 0, left: 0}; 2908 function startScrolling() { 2909 if (!scrollingLoop) { 2910 scrollingLoop = setInterval(function () { 2911 if (!instances.get(element)) { 2912 clearInterval(scrollingLoop); 2913 return; 2914 } 2915 2916 updateScroll(element, 'top', element.scrollTop + scrollDiff.top); 2917 updateScroll(element, 'left', element.scrollLeft + scrollDiff.left); 2918 updateGeometry(element); 2919 }, 50); // every .1 sec 2920 } 2921 } 2922 function stopScrolling() { 2923 if (scrollingLoop) { 2924 clearInterval(scrollingLoop); 2925 scrollingLoop = null; 2926 } 2927 h.stopScrolling(element); 2928 } 2929 2930 var isSelected = false; 2931 i.event.bind(i.ownerDocument, 'selectionchange', function () { 2932 if (element.contains(getRangeNode())) { 2933 isSelected = true; 2934 } else { 2935 isSelected = false; 2936 stopScrolling(); 2937 } 2938 }); 2939 i.event.bind(window, 'mouseup', function () { 2940 if (isSelected) { 2941 isSelected = false;
2942 stopScrolling(); 2943 } 2944 }); 2945 2946 i.event.bind(window, 'mousemove', function (e) { 2947 if (isSelected) { 2948 var mousePosition = {x: e.pageX, y: e.pageY}; 2949 var containerGeometry = { 2950 left: element.offsetLeft, 2951 right: element.offsetLeft + element.offsetWidth, 2952 top: element.offsetTop, 2953 bottom: element.offsetTop + element.offsetHeight 2954 }; 2955 2956 if (mousePosition.x < containerGeometry.left + 3) { 2957 scrollDiff.left = -5; 2958 h.startScrolling(element, 'x'); 2959 } else if (mousePosition.x > containerGeometry.right - 3) { 2960 scrollDiff.left = 5; 2961 h.startScrolling(element, 'x'); 2962 } else { 2963 scrollDiff.left = 0; 2964 } 2965 2966 if (mousePosition.y < containerGeometry.top + 3) { 2967 if (containerGeometry.top + 3 - mousePosition.y < 5) { 2968 scrollDiff.top = -5; 2969 } else { 2970 scrollDiff.top = -20; 2971 } 2972 h.startScrolling(element, 'y'); 2973 } else if (mousePosition.y > containerGeometry.bottom - 3) { 2974 if (mousePosition.y - containerGeometry.bottom + 3 < 5) { 2975 scrollDiff.top = 5; 2976 } else { 2977 scrollDiff.top = 20; 2978 } 2979 h.startScrolling(element, 'y'); 2980 } else { 2981 scrollDiff.top = 0; 2982 } 2983 2984 if (scrollDiff.top === 0 && scrollDiff.left === 0) { 2985 stopScrolling(); 2986 } else { 2987 startScrolling(); 2988 } 2989 } 2990 }); 2991} 2992 2993module.exports = function (element) { 2994 var i = instances.get(element); 2995 bindSelectionHandler(element, i); 2996}; 2997 2998},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],16:[function(require,module,exports){ 2999'use strict'; 3000 3001var instances = require('../instances') 3002 , updateGeometry = require('../update-geometry') 3003 , updateScroll = require('../update-scroll'); 3004 3005function bindTouchHandler(element, i, supportsTouch, supportsIePointer) { 3006 function shouldPreventDefault(deltaX, deltaY) { 3007 var scrollTop = element.scrollTop; 3008 var scrollLeft = element.scrollLeft; 3009 var magnitudeX = Math.abs(deltaX); 3010 var magnitudeY = Math.abs(deltaY); 3011 3012 if (magnitudeY > magnitudeX) { 3013 // user is perhaps trying to swipe up/down the page 3014 3015 if (((deltaY < 0) && (scrollTop === i.contentHeight - i.containerHeight)) || 3016 ((deltaY > 0) && (scrollTop === 0))) { 3017 return !i.settings.swipePropagation; 3018 } 3019 } else if (magnitudeX > magnitudeY) { 3020 // user is perhaps trying to swipe left/right across the page 3021 3022 if (((deltaX < 0) && (scrollLeft === i.contentWidth - i.containerWidth)) || 3023 ((deltaX > 0) && (scrollLeft === 0))) { 3024 return !i.settings.swipePropagation; 3025 } 3026 } 3027 3028 return true; 3029 } 3030 3031 function applyTouchMove(differenceX, differenceY) { 3032 updateScroll(element, 'top', element.scrollTop - differenceY); 3033 updateScroll(element, 'left', element.scrollLeft - differenceX); 3034 3035 updateGeometry(element); 3036 } 3037 3038 var startOffset = {}; 3039 var startTime = 0; 3040 var speed = {}; 3041 var easingLoop = null; 3042 var inGlobalTouch = false; 3043 var inLocalTouch = false; 3044 3045 function globalTouchStart() { 3046 inGlobalTouch = true; 3047 } 3048 function globalTouchEnd() { 3049 inGlobalTouch = false; 3050 } 3051 3052 function getTouch(e) { 3053 if (e.targetTouches) { 3054 return e.targetTouches[0]; 3055 } else { 3056 // Maybe IE pointer 3057 return e; 3058 } 3059 } 3060 function shouldHandle(e) { 3061 if (e.targetTouches && e.targetTouches.length === 1) { 3062 return true; 3063 } 3064 if (e.pointerType && e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) { 3065 return true; 3066 } 3067 return false; 3068 } 3069 function touchStart(e) { 3070 if (shouldHandle(e)) { 3071 inLocalTouch = true; 3072 3073 var touch = getTouch(e); 3074 3075 startOffset.pageX = touch.pageX; 3076 startOffset.pageY = touch.pageY; 3077 3078 startTime = (new Date()).getTime(); 3079 3080 if (easingLoop !== null) { 3081 clearInterval(easingLoop); 3082 } 3083 3084 e.stopPropagation(); 3085 } 3086 } 3087 function touchMove(e) { 3088 if (!inGlobalTouch && inLocalTouch && shouldHandle(e)) { 3089 var touch = getTouch(e); 3090 3091 var currentOffset = {pageX: touch.pageX, pageY: touch.pageY}; 3092 3093 var differenceX = currentOffset.pageX - startOffset.pageX; 3094 var differenceY = currentOffset.pageY - startOffset.pageY; 3095 3096 applyTouchMove(differenceX, differenceY); 3097 startOffset = currentOffset; 3098 3099 var currentTime = (new Date()).getTime(); 3100 3101 var timeGap = currentTime - startTime; 3102 if (timeGap > 0) { 3103 speed.x = differenceX / timeGap;
3104 speed.y = differenceY / timeGap; 3105 startTime = currentTime; 3106 } 3107 3108 if (shouldPreventDefault(differenceX, differenceY)) { 3109 e.stopPropagation(); 3110 e.preventDefault(); 3111 } 3112 } 3113 } 3114 function touchEnd() { 3115 if (!inGlobalTouch && inLocalTouch) { 3116 inLocalTouch = false; 3117 3118 clearInterval(easingLoop); 3119 easingLoop = setInterval(function () { 3120 if (!instances.get(element)) { 3121 clearInterval(easingLoop); 3122 return; 3123 } 3124 3125 if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) { 3126 clearInterval(easingLoop); 3127 return; 3128 } 3129 3130 applyTouchMove(speed.x * 30, speed.y * 30); 3131 3132 speed.x *= 0.8; 3133 speed.y *= 0.8; 3134 }, 10); 3135 } 3136 } 3137 3138 if (supportsTouch) { 3139 i.event.bind(window, 'touchstart', globalTouchStart); 3140 i.event.bind(window, 'touchend', globalTouchEnd); 3141 i.event.bind(element, 'touchstart', touchStart); 3142 i.event.bind(element, 'touchmove', touchMove); 3143 i.event.bind(element, 'touchend', touchEnd); 3144 } 3145 3146 if (supportsIePointer) { 3147 if (window.PointerEvent) { 3148 i.event.bind(window, 'pointerdown', globalTouchStart); 3149 i.event.bind(window, 'pointerup', globalTouchEnd); 3150 i.event.bind(element, 'pointerdown', touchStart); 3151 i.event.bind(element, 'pointermove', touchMove); 3152 i.event.bind(element, 'pointerup', touchEnd); 3153 } else if (window.MSPointerEvent) { 3154 i.event.bind(window, 'MSPointerDown', globalTouchStart); 3155 i.event.bind(window, 'MSPointerUp', globalTouchEnd); 3156 i.event.bind(element, 'MSPointerDown', touchStart); 3157 i.event.bind(element, 'MSPointerMove', touchMove); 3158 i.event.bind(element, 'MSPointerUp', touchEnd); 3159 } 3160 } 3161} 3162 3163module.exports = function (element, supportsTouch, supportsIePointer) { 3164 var i = instances.get(element); 3165 bindTouchHandler(element, i, supportsTouch, supportsIePointer); 3166}; 3167 3168},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],17:[function(require,module,exports){ 3169'use strict'; 3170 3171var cls = require('../lib/class') 3172 , h = require('../lib/helper') 3173 , instances = require('./instances') 3174 , updateGeometry = require('./update-geometry'); 3175 3176// Handlers 3177var clickRailHandler = require('./handler/click-rail') 3178 , dragScrollbarHandler = require('./handler/drag-scrollbar') 3179 , keyboardHandler = require('./handler/keyboard') 3180 , mouseWheelHandler = require('./handler/mouse-wheel') 3181 , nativeScrollHandler = require('./handler/native-scroll') 3182 , selectionHandler = require('./handler/selection') 3183 , touchHandler = require('./handler/touch'); 3184 3185module.exports = function (element, userSettings) { 3186 userSettings = typeof userSettings === 'object' ? userSettings : {}; 3187 3188 cls.add(element, 'ps-container'); 3189 3190 // Create a plugin instance. 3191 var i = instances.add(element); 3192 3193 i.settings = h.extend(i.settings, userSettings); 3194 cls.add(element, 'ps-theme-' + i.settings.theme); 3195 3196 clickRailHandler(element); 3197 dragScrollbarHandler(element); 3198 mouseWheelHandler(element); 3199 nativeScrollHandler(element); 3200 3201 if (i.settings.useSelectionScroll) { 3202 selectionHandler(element); 3203 } 3204 3205 if (h.env.supportsTouch || h.env.supportsIePointer) { 3206 touchHandler(element, h.env.supportsTouch, h.env.supportsIePointer); 3207 } 3208 if (i.settings.useKeyboard) { 3209 keyboardHandler(element); 3210 } 3211 3212 updateGeometry(element); 3213}; 3214 3215},{"../lib/class":2,"../lib/helper":6,"./handler/click-rail":10,"./handler/drag-scrollbar":11,"./handler/keyboard":12,"./handler/mouse-wheel":13,"./handler/native-scroll":14,"./handler/selection":15,"./handler/touch":16,"./instances":18,"./update-geometry":19}],18:[function(require,module,exports){ 3216'use strict'; 3217 3218var cls = require('../lib/class') 3219 , d = require('../lib/dom') 3220 , defaultSettings = require('./default-setting') 3221 , EventManager = require('../lib/event-manager') 3222 , guid = require('../lib/guid') 3223 , h = require('../lib/helper'); 3224 3225var instances = {}; 3226 3227function Instance(element) { 3228 var i = this; 3229 3230 i.settings = h.clone(defaultSettings); 3231 i.containerWidth = null; 3232 i.containerHeight = null; 3233 i.contentWidth = null; 3234 i.contentHeight = null; 3235 3236 i.isRtl = d.css(element, 'direction') === "rtl"; 3237 i.isNegativeScroll = (function () { 3238 var originalScrollLeft = element.scrollLeft; 3239 var result = null; 3240 element.scrollLeft = -1; 3241 result = element.scrollLeft < 0; 3242 element.scrollLeft = originalScrollLeft; 3243 return result; 3244 })(); 3245 i.negativeScrollAdjustment = i.isNegativeScroll ? element.scrollWidth - element.clientWidth : 0; 3246 i.event = new EventManager(); 3247 i.ownerDocument = element.ownerDocument || document; 3248 3249 function focus() { 3250 cls.add(element, 'ps-focus'); 3251 } 3252 3253 function blur() { 3254 cls.remove(element, 'ps-focus'); 3255 } 3256 3257 i.scrollbarXRail = d.appendTo(d.e('div', 'ps-scrollbar-x-rail'), element); 3258 i.scrollbarX = d.appendTo(d.e('div', 'ps-scrollbar-x'), i.scrollbarXRail); 3259 i.scrollbarX.setAttribute('tabindex', 0);
3260 i.event.bind(i.scrollbarX, 'focus', focus); 3261 i.event.bind(i.scrollbarX, 'blur', blur); 3262 i.scrollbarXActive = null; 3263 i.scrollbarXWidth = null; 3264 i.scrollbarXLeft = null; 3265 i.scrollbarXBottom = h.toInt(d.css(i.scrollbarXRail, 'bottom')); 3266 i.isScrollbarXUsingBottom = i.scrollbarXBottom === i.scrollbarXBottom; // !isNaN 3267 i.scrollbarXTop = i.isScrollbarXUsingBottom ? null : h.toInt(d.css(i.scrollbarXRail, 'top')); 3268 i.railBorderXWidth = h.toInt(d.css(i.scrollbarXRail, 'borderLeftWidth')) + h.toInt(d.css(i.scrollbarXRail, 'borderRightWidth')); 3269 // Set rail to display:block to calculate margins 3270 d.css(i.scrollbarXRail, 'display', 'block'); 3271 i.railXMarginWidth = h.toInt(d.css(i.scrollbarXRail, 'marginLeft')) + h.toInt(d.css(i.scrollbarXRail, 'marginRight')); 3272 d.css(i.scrollbarXRail, 'display', ''); 3273 i.railXWidth = null; 3274 i.railXRatio = null; 3275 3276 i.scrollbarYRail = d.appendTo(d.e('div', 'ps-scrollbar-y-rail'), element); 3277 i.scrollbarY = d.appendTo(d.e('div', 'ps-scrollbar-y'), i.scrollbarYRail); 3278 i.scrollbarY.setAttribute('tabindex', 0); 3279 i.event.bind(i.scrollbarY, 'focus', focus); 3280 i.event.bind(i.scrollbarY, 'blur', blur); 3281 i.scrollbarYActive = null; 3282 i.scrollbarYHeight = null; 3283 i.scrollbarYTop = null; 3284 i.scrollbarYRight = h.toInt(d.css(i.scrollbarYRail, 'right')); 3285 i.isScrollbarYUsingRight = i.scrollbarYRight === i.scrollbarYRight; // !isNaN 3286 i.scrollbarYLeft = i.isScrollbarYUsingRight ? null : h.toInt(d.css(i.scrollbarYRail, 'left')); 3287 i.scrollbarYOuterWidth = i.isRtl ? h.outerWidth(i.scrollbarY) : null; 3288 i.railBorderYWidth = h.toInt(d.css(i.scrollbarYRail, 'borderTopWidth')) + h.toInt(d.css(i.scrollbarYRail, 'borderBottomWidth')); 3289 d.css(i.scrollbarYRail, 'display', 'block'); 3290 i.railYMarginHeight = h.toInt(d.css(i.scrollbarYRail, 'marginTop')) + h.toInt(d.css(i.scrollbarYRail, 'marginBottom')); 3291 d.css(i.scrollbarYRail, 'display', ''); 3292 i.railYHeight = null; 3293 i.railYRatio = null; 3294} 3295 3296function getId(element) { 3297 if (typeof element.dataset === 'undefined') { 3298 return element.getAttribute('data-ps-id'); 3299 } else { 3300 return element.dataset.psId; 3301 } 3302} 3303 3304function setId(element, id) { 3305 if (typeof element.dataset === 'undefined') { 3306 element.setAttribute('data-ps-id', id); 3307 } else { 3308 element.dataset.psId = id; 3309 } 3310} 3311 3312function removeId(element) { 3313 if (typeof element.dataset === 'undefined') { 3314 element.removeAttribute('data-ps-id'); 3315 } else { 3316 delete element.dataset.psId; 3317 } 3318} 3319 3320exports.add = function (element) { 3321 var newId = guid(); 3322 setId(element, newId); 3323 instances[newId] = new Instance(element); 3324 return instances[newId]; 3325}; 3326 3327exports.remove = function (element) { 3328 delete instances[getId(element)]; 3329 removeId(element); 3330}; 3331 3332exports.get = function (element) { 3333 return instances[getId(element)]; 3334}; 3335 3336},{"../lib/class":2,"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(require,module,exports){ 3337'use strict'; 3338 3339var cls = require('../lib/class') 3340 , d = require('../lib/dom') 3341 , h = require('../lib/helper') 3342 , instances = require('./instances') 3343 , updateScroll = require('./update-scroll'); 3344 3345function getThumbSize(i, thumbSize) { 3346 if (i.settings.minScrollbarLength) { 3347 thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength); 3348 } 3349 if (i.settings.maxScrollbarLength) { 3350 thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength); 3351 } 3352 return thumbSize; 3353} 3354 3355function updateCss(element, i) { 3356 var xRailOffset = {width: i.railXWidth}; 3357 if (i.isRtl) { 3358 xRailOffset.left = i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth - i.contentWidth; 3359 } else { 3360 xRailOffset.left = element.scrollLeft; 3361 } 3362 if (i.isScrollbarXUsingBottom) { 3363 xRailOffset.bottom = i.scrollbarXBottom - element.scrollTop; 3364 } else { 3365 xRailOffset.top = i.scrollbarXTop + element.scrollTop; 3366 } 3367 d.css(i.scrollbarXRail, xRailOffset); 3368 3369 var yRailOffset = {top: element.scrollTop, height: i.railYHeight}; 3370 if (i.isScrollbarYUsingRight) { 3371 if (i.isRtl) { 3372 yRailOffset.right = i.contentWidth - (i.negativeScrollAdjustment + element.scrollLeft) - i.scrollbarYRight - i.scrollbarYOuterWidth; 3373 } else { 3374 yRailOffset.right = i.scrollbarYRight - element.scrollLeft; 3375 } 3376 } else { 3377 if (i.isRtl) { 3378 yRailOffset.left = i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth * 2 - i.contentWidth - i.scrollbarYLeft - i.scrollbarYOuterWidth; 3379 } else { 3380 yRailOffset.left = i.scrollbarYLeft + element.scrollLeft; 3381 } 3382 } 3383 d.css(i.scrollbarYRail, yRailOffset); 3384 3385 d.css(i.scrollbarX, {left: i.scrollbarXLeft, width: i.scrollbarXWidth - i.railBorderXWidth}); 3386 d.css(i.scrollbarY, {top: i.scrollbarYTop, height: i.scrollbarYHeight - i.railBorderYWidth}); 3387} 3388 3389module.exports = function (element) { 3390 var i = instances.get(element); 3391 3392 i.containerWidth = element.clientWidth; 3393 i.containerHeight = element.clientHeight; 3394 i.contentWidth = element.scrollWidth; 3395 i.contentHeight = element.scrollHeight; 3396 3397 var existingRails; 3398 if (!element.contains(i.scrollbarXRail)) { 3399 existingRails = d.queryChildren(element, '.ps-scrollbar-x-rail'); 3400 if (existingRails.length > 0) {
3401 existingRails.forEach(function (rail) { 3402 d.remove(rail); 3403 }); 3404 } 3405 d.appendTo(i.scrollbarXRail, element); 3406 } 3407 if (!element.contains(i.scrollbarYRail)) { 3408 existingRails = d.queryChildren(element, '.ps-scrollbar-y-rail'); 3409 if (existingRails.length > 0) { 3410 existingRails.forEach(function (rail) { 3411 d.remove(rail); 3412 }); 3413 } 3414 d.appendTo(i.scrollbarYRail, element); 3415 } 3416 3417 if (!i.settings.suppressScrollX && i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth) { 3418 i.scrollbarXActive = true; 3419 i.railXWidth = i.containerWidth - i.railXMarginWidth; 3420 i.railXRatio = i.containerWidth / i.railXWidth; 3421 i.scrollbarXWidth = getThumbSize(i, h.toInt(i.railXWidth * i.containerWidth / i.contentWidth)); 3422 i.scrollbarXLeft = h.toInt((i.negativeScrollAdjustment + element.scrollLeft) * (i.railXWidth - i.scrollbarXWidth) / (i.contentWidth - i.containerWidth)); 3423 } else { 3424 i.scrollbarXActive = false; 3425 } 3426 3427 if (!i.settings.suppressScrollY && i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight) { 3428 i.scrollbarYActive = true; 3429 i.railYHeight = i.containerHeight - i.railYMarginHeight; 3430 i.railYRatio = i.containerHeight / i.railYHeight; 3431 i.scrollbarYHeight = getThumbSize(i, h.toInt(i.railYHeight * i.containerHeight / i.contentHeight)); 3432 i.scrollbarYTop = h.toInt(element.scrollTop * (i.railYHeight - i.scrollbarYHeight) / (i.contentHeight - i.containerHeight)); 3433 } else { 3434 i.scrollbarYActive = false; 3435 } 3436 3437 if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) { 3438 i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth; 3439 } 3440 if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) { 3441 i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight; 3442 } 3443 3444 updateCss(element, i); 3445 3446 if (i.scrollbarXActive) { 3447 cls.add(element, 'ps-active-x'); 3448 } else { 3449 cls.remove(element, 'ps-active-x'); 3450 i.scrollbarXWidth = 0; 3451 i.scrollbarXLeft = 0; 3452 updateScroll(element, 'left', 0); 3453 } 3454 if (i.scrollbarYActive) { 3455 cls.add(element, 'ps-active-y'); 3456 } else { 3457 cls.remove(element, 'ps-active-y'); 3458 i.scrollbarYHeight = 0; 3459 i.scrollbarYTop = 0; 3460 updateScroll(element, 'top', 0); 3461 } 3462}; 3463 3464},{"../lib/class":2,"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-scroll":20}],20:[function(require,module,exports){ 3465'use strict'; 3466 3467var instances = require('./instances'); 3468 3469var upEvent = document.createEvent('Event') 3470 , downEvent = document.createEvent('Event') 3471 , leftEvent = document.createEvent('Event') 3472 , rightEvent = document.createEvent('Event') 3473 , yEvent = document.createEvent('Event') 3474 , xEvent = document.createEvent('Event') 3475 , xStartEvent = document.createEvent('Event') 3476 , xEndEvent = document.createEvent('Event') 3477 , yStartEvent = document.createEvent('Event') 3478 , yEndEvent = document.createEvent('Event') 3479 , lastTop 3480 , lastLeft; 3481 3482upEvent.initEvent('ps-scroll-up', true, true); 3483downEvent.initEvent('ps-scroll-down', true, true); 3484leftEvent.initEvent('ps-scroll-left', true, true); 3485rightEvent.initEvent('ps-scroll-right', true, true); 3486yEvent.initEvent('ps-scroll-y', true, true); 3487xEvent.initEvent('ps-scroll-x', true, true); 3488xStartEvent.initEvent('ps-x-reach-start', true, true); 3489xEndEvent.initEvent('ps-x-reach-end', true, true); 3490yStartEvent.initEvent('ps-y-reach-start', true, true); 3491yEndEvent.initEvent('ps-y-reach-end', true, true); 3492 3493module.exports = function (element, axis, value) { 3494 if (typeof element === 'undefined') { 3495 throw 'You must provide an element to the update-scroll function'; 3496 } 3497 3498 if (typeof axis === 'undefined') { 3499 throw 'You must provide an axis to the update-scroll function'; 3500 } 3501 3502 if (typeof value === 'undefined') { 3503 throw 'You must provide a value to the update-scroll function'; 3504 } 3505 3506 if (axis === 'top' && value <= 0) { 3507 element.scrollTop = value = 0; // don't allow negative scroll 3508 element.dispatchEvent(yStartEvent); 3509 } 3510 3511 if (axis === 'left' && value <= 0) { 3512 element.scrollLeft = value = 0; // don't allow negative scroll 3513 element.dispatchEvent(xStartEvent); 3514 } 3515 3516 var i = instances.get(element); 3517 3518 if (axis === 'top' && value >= i.contentHeight - i.containerHeight) { 3519 element.scrollTop = value = i.contentHeight - i.containerHeight; // don't allow scroll past container 3520 element.dispatchEvent(yEndEvent); 3521 } 3522 3523 if (axis === 'left' && value >= i.contentWidth - i.containerWidth) { 3524 element.scrollLeft = value = i.contentWidth - i.containerWidth; // don't allow scroll past container 3525 element.dispatchEvent(xEndEvent); 3526 } 3527 3528 if (!lastTop) { 3529 lastTop = element.scrollTop; 3530 } 3531 3532 if (!lastLeft) { 3533 lastLeft = element.scrollLeft; 3534 } 3535 3536 if (axis === 'top' && value < lastTop) { 3537 element.dispatchEvent(upEvent); 3538 } 3539 3540 if (axis === 'top' && value > lastTop) { 3541 element.dispatchEvent(downEvent); 3542 } 3543 3544 if (axis === 'left' && value < lastLeft) { 3545 element.dispatchEvent(leftEvent); 3546 } 3547 3548 if (axis === 'left' && value > lastLeft) { 3549 element.dispatchEvent(rightEvent); 3550 } 3551 3552 if (axis === 'top') { 3553 element.scrollTop = lastTop = value; 3554 element.dispatchEvent(yEvent); 3555 } 3556 3557 if (axis === 'left') { 3558 element.scrollLeft = lastLeft = value; 3559 element.dispatchEvent(xEvent); 3560 } 3561 3562}; 3563 3564},{"./instances":18}],21:[function(require,module,exports){ 3565'use strict'; 3566 3567var d = require('../lib/dom') 3568 , h = require('../lib/helper') 3569 , instances = require('./instances') 3570 , updateGeometry = require('./update-geometry') 3571 , updateScroll = require('./update-scroll'); 3572 3573module.exports = function (element) { 3574 var i = instances.get(element); 3575 3576 if (!i) { 3577 return; 3578 } 3579 3580 // Recalcuate negative scrollLeft adjustment 3581 i.negativeScrollAdjustment = i.isNegativeScroll ? element.scrollWidth - element.clientWidth : 0; 3582 3583 // Recalculate rail margins 3584 d.css(i.scrollbarXRail, 'display', 'block'); 3585 d.css(i.scrollbarYRail, 'display', 'block'); 3586 i.railXMarginWidth = h.toInt(d.css(i.scrollbarXRail, 'marginLeft')) + h.toInt(d.css(i.scrollbarXRail, 'marginRight')); 3587 i.railYMarginHeight = h.toInt(d.css(i.scrollbarYRail, 'marginTop')) + h.toInt(d.css(i.scrollbarYRail, 'marginBottom')); 3588 3589 // Hide scrollbars not to affect scrollWidth and scrollHeight 3590 d.css(i.scrollbarXRail, 'display', 'none'); 3591 d.css(i.scrollbarYRail, 'display', 'none'); 3592 3593 updateGeometry(element); 3594 3595 // Update top/left scroll to trigger events 3596 updateScroll(element, 'top', element.scrollTop); 3597 updateScroll(element, 'left', element.scrollLeft); 3598 3599 d.css(i.scrollbarXRail, 'display', ''); 3600 d.css(i.scrollbarYRail, 'display', ''); 3601}; 3602 3603},{"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-geometry":19,"./update-scroll":20}]},{},[1]); 3604/*! 3605 * imagesLoaded PACKAGED v3.1.8 3606 * JavaScript is all like "You images are done yet or what?" 3607 * MIT License 3608 */ 3609 3610(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1
3610);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function f(e){this.img=e}function c(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var f=r[o];this.addImage(f)}}},s.prototype.addImage=function(e){var t=new f(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),f.prototype=new t,f.prototype.check=function(){var e=v[this.img.src]||new c(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return c.prototype=new t,c.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},c.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit
vendor: 4,960 bytes, lines 3610-3621
3610("confirm",this,t)},c.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s}); 3611/*! 3612 * Isotope PACKAGED v3.0.5 3613 * 3614 * Licensed GPLv3 for open source use 3615 * or Isotope Commercial License for commercial use 3616 * 3617 * https://isotope.metafizzy.co 3618 * Copyright 2017 Metafizzy 3619 */ 3620 3621!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,s,a){function u(t,e,o){var n,s="$()."+i+'("'+e+'")';return t.each(function(t,u){var h=a.data(u,i);if(!h)return void r(i+" not initialized. Cannot call methods, i.e. "+s);var d=h[e];if(!d||"_"==e.charAt(0))return void r(s+" is not a valid method");var l=d.apply(h,o);n=void 0===n?l:n}),void 0!==n?n:t}function h(t,e){t.each(function(t,o){var n=a.data(o,i);n?(n.option(e),n._init()):(n=new s(o,e),a.data(o,i,n))})}a=a||e||t.jQuery,a&&(s.prototype.option||(s.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=n.call(arguments,1);return u(this,t,e)}return h(this,t),this},o(a))}function o(t){!t||t&&t.bridget||(t.bridget=i)}var n=Array.prototype.slice,s=t.console,r="undefined"==typeof s?function(){}:function(t){s.error(t)};return o(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},o=i[t]=i[t]||[];return o.indexOf(e)==-1&&o.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},o=i[t]=i[t]||{};return o[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=i.indexOf(e);return o!=-1&&i.splice(o,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var o=this._onceEvents&&this._onceEvents[t],n=0;n<i.length;n++){var s=i[n],r=o&&o[s];r&&(this.off(t,s),delete o[s]),s.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return e()}):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e<h;e++){var i=u[e];t[i]=0}return t}function o(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),e}function n(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var n=o(e);s.isBoxSizeOuter=r=200==t(n.width),i.removeChild(e)}}function s(e){if(n(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var s=o(e);if("none"==s.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==s.boxSizing,l=0;l<h;l++){var f=u[l],c=s[f],m=parseFloat(c);a[f]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,y=a.paddingTop+a.paddingBottom,g=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,I=a.borderTopWidth+a.borderBottomWidth,z=d&&r,x=t(s.width);x!==!1&&(a.width=x+(z?0:p+_));var S=t(s.height);return S!==!1&&(a.height=S+(z?0:y+I)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(y+I),a.outerWidth=a.width+g,a.outerHeight=a.height+v,a}}var r,a="undefined"==typeof console?e:function(t){console.error(t)},u=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],h=u.length,d=!1;return s}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var o=e[i],n=o+"MatchesSelector";if(t[n])return n}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["de
3621sandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e},i.makeArray=function(t){var e=[];if(Array.isArray(t))e=t;else if(t&&"object"==typeof t&&"number"==typeof t.length)for(var i=0;i<t.length;i++)e.push(t[i]);else e.push(t);return e},i.removeFrom=function(t,e){var i=t.indexOf(e);i!=-1&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,o){t=i.makeArray(t);var n=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!o)return void n.push(t);e(t,o)&&n.push(t);for(var i=t.querySelectorAll(o),s=0;s<i.length;s++)n.push(i[s])}}),n},i.debounceMethod=function(t,e,i){var o=t.prototype[e],n=e+"Timeout";t.prototype[e]=function(){var t=this[n];t&&clearTimeout(t);var e=arguments,s=this;this[n]=setTimeout(function(){o.apply(s,e),delete s[n]},i||100)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var o=t.console;return i.htmlInit=function(e,n){i.docReady(function(){var s=i.toDashed(n),r="data-"+s,a=document.querySelectorAll("["+r+"]"),u=document.querySelectorAll(".js-"+s),h=i.makeArray(a).concat(i.makeArray(u)),d=r+"-options",l=t.jQuery;h.forEach(function(t){var i,s=t.getAttribute(r)||t.getAttribute(d);try{i=s&&JSON.parse(s)}catch(a){return void(o&&o.error("Error parsing "+r+" on "+t.className+": "+a))}var u=new e(t,i);l&&l.data(t,n,u)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,function(t,e){"use strict";function i(t){for(var e in t)return!1;return e=null,!0}function o(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function n(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var s=document.documentElement.style,r="string"==typeof s.transition?"transition":"WebkitTransition",a="string"==typeof s.transform?"transform":"WebkitTransform",u={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[r],h={transform:a,transition:r,transitionDuration:r+"Duration",transitionProperty:r+"Property",transitionDelay:r+"Delay"},d=o.prototype=Object.create(t.prototype);d.constructor=o,d._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.getSize=function(){this.size=e(this.element)},d.css=function(t){var e=this.element.style;for(var i in t){var o=h[i]||i;e[o]=t[i]}},d.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),o=t[e?"left":"right"],n=t[i?"top":"bottom"],s=this.layout.size,r=o.indexOf("%")!=-1?parseFloat(o)/100*s.width:parseInt(o,10),a=n.indexOf("%")!=-1?parseFloat(n)/100*s.height:parseInt(n,10);r=isNaN(r)?0:r,a=isNaN(a)?0:a,r-=e?s.paddingLeft:s.paddingRight,a-=i?s.paddingTop:s.paddingBottom,this.position.x=r,this.position.y=a},d.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),o=this.layout._getOption("originTop"),n=i?"paddingLeft":"paddingRight",s=i?"left":"right",r=i?"right":"left",a=this.position.x+t[n];e[s]=this.getXValue(a),e[r]="";var u=o?"paddingTop":"paddingBottom",h=o?"top":"bottom",d=o?"bottom":"top",l=this.position.y+t[u];e[h]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},d.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},d.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},d._transitionTo=function(t,e){this.getPosition();var i=this.position.x,o=this.position.y,n=parseInt(t,10),s=parseInt(e,10),r=n===this.position.x&&s===this.position.y;if(this.setPosition(t,e),r&&!this.isTransitioning)return void this.layoutPosition();var a=t-i,u=e-o,h={};
3621h.transform=this.getTranslate(a,u),this.transition({to:h,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},d.getTranslate=function(t,e){var i=this.layout._getOption("originLeft"),o=this.layout._getOption("originTop");return t=i?t:-t,e=o?e:-e,"translate3d("+t+"px, "+e+"px, 0)"},d.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},d.moveTo=d._transitionTo,d.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10
vendor: 22,182 bytes, line 3621
3621)},d._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},d.transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var o=this.element.offsetHeight;o=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var l="opacity,"+n(a);d.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(u,this,!1)}},d.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},d.onotransitionend=function(t){this.ontransitionend(t)};var f={"-webkit-transform":"transform"};d.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,o=f[t.propertyName]||t.propertyName;if(delete e.ingProperties[o],i(e.ingProperties)&&this.disableTransition(),o in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[o]),o in e.onEnd){var n=e.onEnd[o];n.call(this),delete e.onEnd[o]}this.emitEvent("transitionEnd",[this])}},d.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(u,this,!1),this.isTransitioning=!1},d._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var c={transitionProperty:"",transitionDuration:"",transitionDelay:""};return d.removeTransitionStyles=function(){this.css(c)},d.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},d.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},d.remove=function(){return r&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},d.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},d.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},d.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},d.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},d.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},d.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},o}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,o,n,s){return e(t,i,o,n,s)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,o,n){"use strict";function s(t,e){var i=o.getQueryElement(t);if(!i)return void(u&&u.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,h&&(this.$element=h(this.element)),this.options=o.extend({},this.constructor.defaults),this.option(e);var n=++l;this.element.outlayerGUID=n,f[n]=this,this._create();var s=this._getOption("initLayout");s&&this.layout()}function r(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}function a(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],o=e&&e[2];if(!i.length)return 0;i=parseFloat(i);var n=m[o]||1;return i*n}var u=t.console,h=t.jQuery,d=function(){},l=0,f={};s.namespace="outlayer",s.Item=n,s.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var c=s.prototype;o.extend(c,e.prototype),c.option=function(t){o.extend(this.options,t)},c._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},s.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},c._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),o.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},c.reloadItems=function(){this.items=this._itemize(this.element.children)},c._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,o=[],n=0;n<e.length;n++){var s=e[n],r=new i(s,this);o.push(r)}return o},c._filterFindItemElements=function(t){return o.filterFindElements(t,this.options.itemSelector)},c.getItemElements=function(){return this.items.map(function(t){return t.element})},c.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},c._init=c.layout,c._resetLayout=function(){this.getSize()},c.getSize=function(){this.size=i(this.element)},c._getMeasurement=function(t,e){var o,n=this.options[t];n?("string"==typeof n?o=this.element.querySelector(n):n instanceof HTMLElement&&(o=n),this[t]=o?i(o)[e]:n):this[t]=0},c.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},c._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},c._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach(function(t){var o=this._getItemLayoutPosition(t);o.item=t,o.isInstant=e||t.isLayoutInstant,i.push(o)},this),this._processLayoutQueue(i)}},c._getItemLayoutPosition=function(){return{x:0,y:0}},c._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)},this)},c.updateStagger=function(){var t=this.options.stagger;return null===t||void 0===t?void(this.stagger=0):(this.stagger=a(t),this.stagger)},c._positionItem=function(t,e,i,o,n){o?t.goTo(e,i):(t.stagger(n*this.stagger),t.moveTo(e,i))},c._postLayout=function(){this.resizeContainer()},c.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},c._getContainerSize=d,c._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},c._emitCompleteOnItems=function(t,e){function i(){n.dispatchEvent(t+"Complete",null,[e])}function o(){r++,r==s&&i()}var n=this,s=e.length;if(!e||!s)return void i();var r=0;e.forEach(function(e){e.once(t,o)})},c.dispatchEvent=function(t,e,i){var o=e?[e].concat(i):i;if(this.emitEvent(t,o),h)if(this.$element=this.$element||h(this.element),e){var n=h.Event(e);n.type=t,this.$element.trigger(n,i)}else this.$element.trigger(t,i)},c.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},c.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},c.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},c.unstamp=function(t){t=this._find(t),t&&t.forEach(function(t){o.removeFrom(this.stamps,t),this.unignore(t)},this)},c._find=function(t){if(t)return"string"==typeof t&&(t=this.element.querySelectorAll(t)),t=o.makeArray(t)},c._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},c._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},c._manageStamp=d,c._getElementOffset=function(t){var e=t.getBoundingClientRect(),o=this._boundingRect,n=i(t),s={left:e.left-o.left-n.marginLeft,top:e.top-o.top-n.marginTop,right:o.right-e.right-n.marginRight,bottom:o.bottom-e.bottom-n.marginBottom};return s},c.handleEvent=o.handleEvent,c.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},c.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},c.onresize=function(){this.resize()},o.debounceMethod(s,"onresize",100),c.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},c.needsResizeLayout=function(){var t=i(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},c.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},c.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},c.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},c.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.reveal()})}},c.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.hide()})}},c.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},c.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},c.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},c.getItems=function(t){t=o.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getItem(t);i&&e.push(i)},this),e},c.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),o.removeFrom(this.items,t)},this)},c.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete f[e],delete this.element.outlayerGUID,h&&h.removeData(this.element,this.constructor.namespace)},s.data=function(t){t=o.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&f[e]},s.create=function(t,e){var i=r(s);return i.defaults=o.extend({},s.defaults),o.extend(i.defaults,e),i.compatOptions=o.extend({},s.compatOptions),i.namespace=t,i.data=s.data,i.Item=r(n),o.htmlInit(i,t),h&&h.bridget&&h.bridget(t,i),i};var m={ms:1,s:1e3};return s.Item=n,s}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/item",["outlayer/outlayer"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer")):(t.Isotope=t.Isotope||{},t.Isotope.Item=e(t.Outlayer))}(window,function(t){"use strict";function e(){t.Item.apply(this,arguments)}var i=e.prototype=Object.create(t.Item.prototype),o=i._create;i._create=function(){this.id=this.layout.itemGUID++,o.call(this),this.sortData={}},i.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData["original-order"]=this.id,this.sortData.random=Math.random();var t=this.layout.options.getSortData,e=this.layout._sorters;for(var i in t){var o=e[i];this.sortData[i]=o(this.element,this)}}};var n=i.destroy;return i.destroy=function(){n.apply(this,arguments),this.css({display:""})},e}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-mode",["get-size/get-size","outlayer/outlayer"],e):"object"==typeof module&&module.exports?module.exports=e(require("get-size"),require("outlayer")):(t.Isotope=t.Isotope||{},t.Isotope.LayoutMode=e(t.getSize,t.Outlayer))}(window,function(t,e){"use strict";function i(t){this.isotope=t,t&&(this.options=t.options[this.namespace],this.element=t.element,this.items=t.filteredItems,this.size=t.size)}var o=i.prototype,n=["_resetLayout","_getItemLayoutPosition","_manageStamp","_getContainerSize","_getElementOffset","needsResizeLayout","_getOption"];return n.forEach(function(t){o[t]=function(){return e.prototype[t].apply(this.isotope,arguments)}}),o.needsVerticalResizeLayout=function(){var e=t(this.isotope.element),i=this.isotope.size&&e;return i&&e.innerHeight!=this.isotope.size.innerHeight},o._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},o.getColumnWidth=function(){this.getSegmentSize("column","Width")},o.getRowHeight=function(){this.getSegmentSize("row","Height")},o.getSegmentSize=function(t,e){var i=t+e,o="outer"+e;if(this._getMeasurement(i,o),!this[i]){var n=this.getFirstItemSize();this[i]=n&&n[o]||this.isotope.size["inner"+e]}},o.getFirstItemSize=function(){var e=this.isotope.filteredItems[0];return e&&e.element&&t(e.element)},o.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},o.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},i.modes={},i.create=function(t,e){function n(){i.apply(this,arguments)}return n.prototype=Object.create(o),n.prototype.constructor=n,e&&(n.options=e),n.prototype.namespace=t,i.modes[t]=n,n},i}),function(t,e){"function"==typeof define&&define.amd?define("masonry-layout/masonry",["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,e){var i=t.create("masonry");i.compatOptions.fitWidth="isFitWidth";var o=i.prototype;return o._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},o.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var o=this.columnWidth+=this.gutter,n=this.containerWidth+this.gutter,s=n/o,r=o-n%o,a=r&&r<1?"round":"floor";s=Math[a](s),this.cols=Math.max(s,1)},o.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,o=e(i);this.containerWidth=o&&o.innerWidth},o._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&e<1?"round":"ceil",o=Math[i](t.size.outerWidth/this.columnWidth);o=Math.min(o,this.cols);for(var n=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",s=this[n](o,t),r={x:this.columnWidth*s.col,y:s.y},a=s.y+t.size.outerHeight,u=o+s.col,h=s.col;h<u;h++)this.colYs[h]=a;return r},o._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},o._getTopColGroup=function(t){if(t<2)return this.colYs;for(var e=[],i=this.cols+1-t,o=0;o<i;o++)e[o]=this._getColGroupY(o,t);return e},o._getColGroupY=function(t,e){if(e<2)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},o._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,o=t>1&&i+t>this.cols;i=o?0:i;var n=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=n?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},o._manageStamp=function(t){var i=e(t),o=this._getElementOffset(t),n=this._getOption("originLeft"),s=n?o.left:o.right,r=s+i.outerWidth,a=Math.floor(s/this.columnWidth);a=Math.max(0,a);var u=Math.floor(r/this.columnWidth);u-=r%this.columnWidth?0:1,u=Math.min(this.cols-1,u);for(var h=this._getOption("originTop"),d=(h?o.top:o.bottom)+i.outerHeight,l=a;l<=u;l++)this.colYs[l]=Math.max(d,this.colYs[l])},o._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},o._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},o.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-modes/masonry",["../layout-mode","masonry-layout/masonry"],e):"object"==typeof module&&module.exports?module.exports=e(require("../layout-mode"),require("masonry-layout")):e(t.Isotope.LayoutMode,t.Masonry)}(window,function(t,e){"use strict";var i=t.create("masonry"),o=i.prototype,n={_getElementOffset:!0,layout:!0,_getMeasurement:!0};for(var s in e.prototype)n[s]||(o[s]=e.prototype[s]);var r=o.measureColumns;o.measureColumns=function(){this.items=this.isotope.filteredItems,r.call(this)};var a=o._getOption;return o._getOption=function(t){return"fitWidth"==t?void 0!==this.options.isFitWidth?this.options.isFitWidth:this.options.fitWidth:a.apply(this.isotope,arguments)},i}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-modes/fit-rows",["../layout-mode"],e):"object"==typeof exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window,function(t){"use strict";var e=t.create("fitRows"),i=e.prototype;return i._resetLayout=function(){this.x=0,this.y=0,this.maxY=0,this._getMeasurement("gutter","outerWidth")},i._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth+this.gutter,i=this.isotope.size.innerWidth+this.gutter;0!==this.x&&e+this.x>i&&(this.x=0,this.y=this.maxY);var o={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+t.size.outerHeight),this.x+=e,o},i._getContainerSize=function(){return{height:this.maxY}},e}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-modes/vertical",["../layout-mode"],e):"object"==typeof module&&module.exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window,function(t){"use strict";var e=t.create("vertical",{horizontalAlignment:0}),i=e.prototype;return i._resetLayout=function(){this.y=0},i._getItemLayoutPosition=function(t){t.getSize();var e=(this.isotope.size.innerWidth-t.size.outerWidth)*this.options.horizontalAlignment,i=this.y;return this.y+=t.size.outerHeight,{x:e,y:i}},i._getContainerSize=function(){return{height:this.y}},e}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","desandro-matches-selector/matches-selector","fizzy-ui-utils/utils","isotope-layout/js/item","isotope-layout/js/layout-mode","isotope-layout/js/layout-modes/masonry","isotope-layout/js/layout-modes/fit-rows","isotope-layout/js/layout-modes/vertical"],function(i,o,n,s,r,a){return e(t,i,o,n,s,r,a)}):"object"==typeof module&&module.exports?module.exports=e(t,require("outlayer"),require("get-size"),require("desandro-matches-selector"),require("fizzy-ui-utils"),require("isotope-layout/js/item"),require("isotope-layout/js/layout-mode"),require("isotope-layout/js/layout-modes/masonry"),require("isotope-layout/js/layout-modes/fit-rows"),require("isotope-layout/js/layout-modes/vertical")):t.Isotope=e(t,t.Outlayer,t.getSize,t.matchesSelector,t.fizzyUIUtils,t.Isotope.Item,t.Isotope.LayoutMode)}(window,function(t,e,i,o,n,s,r){function a(t,e){return function(i,o){for(var n=0;n<t.length;n++){var s=t[n],r=i.sortData[s],a=o.sortData[s];if(r>a||r<a){var u=void 0!==e[s]?e[s]:e,h=u?1:-1;return(r>a?1:-1)*h}}return 0}}var u=t.jQuery,h=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")},d=e.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});d.Item=s,d.LayoutMode=r;var l=d.prototype;l._create=function(){this.itemGUID=0,this._sorters={},this._getSorters(),e.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"];for(var t in r.modes)this._initLayoutMode(t)},l.reloadItems=function(){this.itemGUID=0,e.prototype.reloadItems.call(this)},l._itemize=function(){for(var t=e.prototype._itemize.apply(this,arguments),i=0;i<t.length;i++){var o=t[i];o.id=this.itemGUID++}return this._updateItemsSortData(t),t},l._initLayoutMode=function(t){var e=r.modes[t],i=this.options[t]||{};this.options[t]=e.options?n.extend(e.options,i):i,this.modes[t]=new e(this)},l.layout=function(){return!this._isLayoutInited&&this._getOption("initLayout")?void this.arrange():void this._layout()},l._layout=function(){var t=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,t),this._isLayoutInited=!0},l.arrange=function(t){this.option(t),this._getIsInstant();var e=this._filter(this.items);this.filteredItems=e.matches,this._bindArrangeComplete(),this._isInstant?this._noTransition(this._hideReveal,[e]):this._hideReveal(e),this._sort(),this._layout()},l._init=l.arrange,l._hideReveal=function(t){this.reveal(t.needReveal),this.hide(t.needHide)},l._getIsInstant=function(){var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;return this._isInstant=e,e},l._bindArrangeComplete=function(){function t(){e&&i&&o&&n.dispatchEvent("arrangeComplete",null,[n.filteredItems])}var e,i,o,n=this;this.once("layoutComplete",function(){e=!0,t()}),this.once("hideComplete",function(){i=!0,t()}),this.once("revealComplete",function(){o=!0,t()})},l._filter=function(t){var e=this.options.filter;e=e||"*";for(var i=[],o=[],n=[],s=this._getFilterTest(e),r=0;r<t.length;r++){var a=t[r];if(!a.isIgnored){var u=s(a);u&&i.push(a),u&&a.isHidden?o.push(a):u||a.isHidden||n.push(a)}}return{matches:i,needReveal:o,needHide:n}},l._getFilterTest=function(t){
vendor: 3,138 bytes, lines 3621-3622
3621 3622return u&&this.options.isJQueryFiltering?function(e){return u(e.element).is(t)}:"function"==typeof t?function(e){return t(e.element)}:function(e){return o(e.element,t)}},l.updateSortData=function(t){var e;t?(t=n.makeArray(t),e=this.getItems(t)):e=this.items,this._getSorters(),this._updateItemsSortData(e)},l._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=f(i)}},l._updateItemsSortData=function(t){for(var e=t&&t.length,i=0;e&&i<e;i++){var o=t[i];o.updateSortData()}};var f=function(){function t(t){if("string"!=typeof t)return t;var i=h(t).split(" "),o=i[0],n=o.match(/^\[(.+)\]$/),s=n&&n[1],r=e(s,o),a=d.sortDataParsers[i[1]];return t=a?function(t){return t&&a(r(t))}:function(t){return t&&r(t)}}function e(t,e){return t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&i.textContent}}return t}();d.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},l._sort=function(){if(this.options.sortBy){var t=n.makeArray(this.options.sortBy);this._getIsSameSortBy(t)||(this.sortHistory=t.concat(this.sortHistory));var e=a(this.sortHistory,this.options.sortAscending);this.filteredItems.sort(e)}},l._getIsSameSortBy=function(t){for(var e=0;e<t.length;e++)if(t[e]!=this.sortHistory[e])return!1;return!0},l._mode=function(){var t=this.options.layoutMode,e=this.modes[t];if(!e)throw new Error("No layout mode: "+t);return e.options=this.options[t],e},l._resetLayout=function(){e.prototype._resetLayout.call(this),this._mode()._resetLayout()},l._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},l._manageStamp=function(t){this._mode()._manageStamp(t)},l._getContainerSize=function(){return this._mode()._getContainerSize()},l.needsResizeLayout=function(){return this._mode().needsResizeLayout()},l.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},l.prepended=function(t){var e=this._itemize(t);if(e.length){this._resetLayout(),this._manageStamps();var i=this._filterRevealAdded(e);this.layoutItems(this.filteredItems),this.filteredItems=i.concat(this.filteredItems),this.items=e.concat(this.items)}},l._filterRevealAdded=function(t){var e=this._filter(t);return this.hide(e.needHide),this.reveal(e.matches),this.layoutItems(e.matches,!0),e.matches},l.insert=function(t){var e=this.addItems(t);if(e.length){var i,o,n=e.length;for(i=0;i<n;i++)o=e[i],this.element.appendChild(o.element);var s=this._filter(e).matches;for(i=0;i<n;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;i<n;i++)delete e[i].isLayoutInstant;this.reveal(s)}};var c=l.remove;return l.remove=function(t){t=n.makeArray(t);var e=this.getItems(t);c.call(this,t);for(var i=e&&e.length,o=0;i&&o<i;o++){var s=e[o];n.removeFrom(this.filteredItems,s)}},l.shuffle=function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];e.sortData.random=Math.random()}this.options.sortBy="random",this._sort(),this._layout()},l._noTransition=function(t,e){var i=this.options.transitionDuration;this.options.transitionDuration=0;
3622var o=t.apply(this,e);return this.options.transitionDuration=i,o},l.getFilteredItemElements=function(){return this.filteredItems.map(function(t){return t.element})},d}); 3623// Generated by CoffeeScript 1.9.3 3624(function(){var e;e=function(){function e(e,t){var n,r;this.options={target:"instafeed",get:"popular",resolution:"thumbnail",sortBy:"none",links:!0,mock:!1,useHttp:!1};if(typeof e=="object")for(n in e)r=e[n],this.options[n]=r;this.context=t!=null?t:this,this.unique=this._genKey()}return e.prototype.hasNext=function(){return typeof this.context.nextUrl=="string"&&this.context.nextUrl.length>0},e.prototype.next=function(){return this.hasNext()?this.run(this.context.nextUrl):!1},e.prototype.run=function(t){var n,r,i;if(typeof this.options.clientId!="string"&&typeof this.options.accessToken!="string")throw new Error("Missing clientId or accessToken.");if(typeof this.options.accessToken!="string"&&typeof this.options.clientId!="string")throw new Error("Missing clientId or accessToken.");return this.options.before!=null&&typeof this.options.before=="function"&&this.options.before.call(this),typeof document!="undefined"&&document!==null&&(i=document.createElement("script"),i.id="instafeed-fetcher",i.src=t||this._buildUrl(),n=document.getElementsByTagName("head"),n[0].appendChild(i),r="instafeedCache"+this.unique,window[r]=new e(this.options,this),window[r].unique=this.unique),!0},e.prototype.parse=function(e){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D;if(typeof e!="object"){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,"Invalid JSON data"),!1;throw new Error("Invalid JSON response")}if(e.meta.code!==200){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,e.meta.error_message),!1;throw new Error("Error from Instagram: "+e.meta.error_message)}if(e.data.length===0){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,"No images were returned from Instagram"),!1;throw new Error("No images were returned from Instagram")}this.options.success!=null&&typeof this.options.success=="function"&&this.options.success.call(this,e),this.context.nextUrl="",e.pagination!=null&&(this.context.nextUrl=e.pagination.next_url);if(this.options.sortBy!=="none"){this.options.sortBy==="random"?M=["","random"]:M=this.options.sortBy.split("-"),O=M[0]==="least"?!0:!1;switch(M[1]){case"random":e.data.sort(function(){return.5-Math.random()});break;case"recent":e.data=this._sortBy(e.data,"created_time",O);break;case"liked":e.data=this._sortBy(e.data,"likes.count",O);break;case"commented":e.data=this._sortBy(e.data,"comments.count",O);break;default:throw new Error("Invalid option for sortBy: '"+this.options.sortBy+"'.")}}if(typeof document!="undefined"&&document!==null&&this.options.mock===!1){m=e.data,A=parseInt(this.options.limit,10),this.options.limit!=null&&m.length>A&&(m=m.slice(0,A)),u=document.createDocumentFragment(),this.options.filter!=null&&typeof this.options.filter=="function"&&(m=this._filter(m,this.options.filter));if(this.options.template!=null&&typeof this.options.template=="string"){f="",d="",w="",D=document.createElement("div");for(c=0,N=m.length;c<N;c++){h=m[c],p=h.images[this.options.resolution];if(typeof p!="object")throw o="No image found for resolution: "+this.options.resolution+".",new Error(o);E=p.width,y=p.height,b="square",E>y&&(b="landscape"),E<y&&(b="portrait"),v=p.url,l=window.location.protocol.indexOf("http")>=0,l&&!this.options.useHttp&&(v=v.replace(/https?:\/\//,"//")),d=this._makeTemplate(this.options.template,{model:h,id:h.id,link:h.link,type:h.type,image:v,width:E,height:y,orientation:b,caption:this._getObjectProperty(h,"caption.text"),likes:h.likes.count,comments:h.comments.count,location:this._getObjectProperty(h,"location.name")}),f+=d}D.innerHTML=f,i=[],r=0,n=D.childNodes.length;while(r<n)i.push(D.childNodes[r]),r+=1;for(x=0,C=i.length;x<C;x++)L=i[x],u.appendChild(L)}else for(T=0,k=m.length;T<k;T++){h=m[T],g=document.createElement("img"),p=h.images[this.options.resolution];if(typeof p!="object")throw o="No image found for resolution: "+this.options.resolution+".",new Error(o);v=p.url,l=window.location.protocol.indexOf("http")>=0,l&&!this.options.useHttp&&(v=v.replace(/https?:\/\//,"//")),g.src=v,this.options.links===!0?(t=document.createElement("a"),t.href=h.link,t.appendChild(g),u.appendChild(t)):u.appendChild(g)}_=this.options.target,typeof _=="string"&&(_=document.getElementById(_));if(_==null)throw o='No element with id="'+this.options.target+'" on page.',new Error(o);_.appendChild(u),a=document.getElementsByTagName("head")[0],a.removeChild(document.getElementById("instafeed-fetcher")),S="instafeedCache"+this.unique,window[S]=void 0;try{delete window[S]}catch(P){s=P}}return this.options.after!=null&&typeof this.options.after=="function"&&this.options.after.call(this),!0},e.prototype._buildUrl=function(){var e,t,n;e="https://api.instagram.com/v1";switch(this.options.get){case"popular":t="media/popular";break;case"tagged":if(!this.options.tagName)throw new Error("No tag name specified. Use the 'tagName' option.");t="tags/"+this.options.tagName+"/media/recent";break;case"location":if(!this.options.locationId)throw new Error("No location specified. Use the 'locationId' option.");t="locations/"+this.options.locationId+"/media/recent";break;case"user":if(!this.options.userId)throw new Error("No user specified. Use the 'userId' option.");t="users/"+this.options.userId+"/media/recent";break;default:throw new Error("Invalid option for get: '"+this.options.get+"'.")}return n=e+"/"+t,this.options.accessToken!=null?n+="?access_token="+this.options.accessToken:n+="?client_id="+this.options.clientId,this.options.limit!=null&&(n+="&count="+this.options.limit),n+="&callback=instafeedCache"+this.unique+".parse",n},e.prototype._genKey=function(){var e;return e=function(){return((1+Math.random())*65536|0).toString(16).substring(1)},""+e()+e()+e()+e()},e.prototype._makeTemplate=function(e,t){var n,r,i,s,o;r=/(?:\{{2})([\w\[\]\.]+)(?:\}{2})/,n=e;while(r.test(n))s=n.match(r)[1],o=(i=this._getObjectProperty(t,s))!=null?i:"",n=n.replace(r,""+o);return n},e.prototype._getObjectProperty=function(e,t){var n,r;t=t.replace(/\[(\w+)\]/g,".$1"),r=t.split(".");while(r.length){n=r.shift();if(!(e!=null&&n in e))return null;e=e[n]}return e},e.prototype._sortBy=function(e,t,n){var r;return r=function(e,r){var i,s;return i=this._getObjectProperty(e,t),s=this._getObjectProperty(r,t),n?i>s?1:-1:i<s?1:-1},e.sort(r.bind(this)),e},e.prototype._filter=function(e,t){var n,r,i,s,o;n=[],r=function(e){if(t(e))return n.push(e)};for(i=0,o=e.length;i<o;i++)s=e[i],r(s);return n},e}(),function(e,t){return typeof define=="function"&&define.amd?define([],t):typeof module=="object"&&module.exports?module.exports=t():e.Instafeed=t()}(this,function(){return e})}).call(this); 3625/* jQuery Nice Select - v1.0 3626 https://github.com/hernansartorio/jquery-nice-select 3627 Made by Hernán Sartorio */ 3628!function(e){e.fn.niceSelect=function(t){function s(t){t.after(e("<div></div>").addClass("nice-select").addClass(t.attr("class")||"").addClass(t.attr("disabled")?"disabled":"").attr("tabindex",t.attr("disabled")?null:"0").html('<span class="current"></span><ul class="list"></ul>'));var s=t.next(),n=t.find("option"),i=t.find("option:selected");s.find(".current").html(i.data("display")||i.text()),n.each(function(t){var n=e(this),i=n.data("display");s.find("ul").append(e("<li></li>").attr("data-value",n.val()).attr("data-display",i||null).addClass("option"+(n.is(":selected")?" selected":"")+(n.is(":disabled")?" disabled":"")).html(n.text()))})}if("string"==typeof t)return"update"==t?this.each(function(){var t=e(this),n=e(this).next(".nice-select"),i=n.hasClass("open");n.length&&(n.remove(),s(t),i&&t.next().trigger("click"))}):"destroy"==t?(this.each(function(){var t=e(this),s=e(this).next(".nice-select");s.length&&(s.remove(),t.css("display",""))}),0==e(".nice-select").length&&e(document).off(".nice_select")):console.log('Method "'+t+'" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass("nice-select")||s(t)}),e(document).off(".nice_select"),e(document).on("click.nice_select",".nice-select",function(t){var s=e(this);e(".nice-select").not(s).removeClass("open"),s.toggleClass("open"),s.hasClass("open")?(s.find(".option"),s.find(".focus").removeClass("focus"),s.find(".selected").addClass("focus")):s.focus()}),e(document).on("click.nice_select",function(t){0===e(t.target).closest(".
3628nice-select").length&&e(".nice-select").removeClass("open").find(".option")}),e(document).on("click.nice_select",".nice-select .option:not(.disabled)",function(t){var s=e(this),n=s.closest(".nice-select");n.find(".selected").removeClass("selected"),s.addClass("selected");var i=s.data("display")||s.text();n.find(".current").text(i),n.prev("select").val(s.data("value")).trigger("change")}),e(document).on("keydown.nice_select",".nice-select",function(t){var s=e(this),n=e(s.find(".focus")||s.find(".list .option.selected"));if(32==t.keyCode||13==t.keyCode)return s.hasClass("open")?n.trigger("click"):s.trigger("click"),!1;if(40==t.keyCode){if(s.hasClass("open")){var i=n.nextAll(".option:not(.disabled)").first();i.length>0&&(s.find(".focus").removeClass("focus"),i.addClass("focus"))}else s.trigger("click");return!1}if(38==t.keyCode){if(s.hasClass("open")){var l=n.prevAll(".option:not(.disabled)").first();l.length>0&&(s.find(".focus").removeClass("focus"),l.addClass("focus"))}else s.trigger("click");return!1}if(27==t.keyCode)s.hasClass("open")&&s.trigger("click");else if(9==t.keyCode&&s.hasClass("open"))return!1});var n=document.createElement("a").style;return n.cssText="pointer-events:auto","auto"!==n.pointerEvents&&e("html").addClass("no-csspointerevents"),this}}(jQuery); 3629/*! 3630 * jQuery Form Plugin 3631 * version: 3.32.0-2013.04.09 3632 * @requires jQuery v1.5 or later 3633 * Copyright (c) 2013 M. Alsup 3634 * Examples and documentation at: http://malsup.com/jquery/form/ 3635 * Project repository: https://github.com/malsup/form 3636 * Dual licensed under the MIT and GPL licenses. 3637 * https://github.com/malsup/form#copyright-and-license 3638 */ 3639/*global ActiveXObject */ 3640;(function($) { 3641"use strict"; 3642 3643/* 3644 Usage Note: 3645 ----------- 3646 Do not use both ajaxSubmit and ajaxForm on the same form. These 3647 functions are mutually exclusive. Use ajaxSubmit if you want 3648 to bind your own submit handler to the form. For example, 3649 3650 $(document).ready(function() { 3651 $('#myForm').on('submit', function(e) { 3652 e.preventDefault(); // <-- important 3653 $(this).ajaxSubmit({ 3654 target: '#output' 3655 }); 3656 }); 3657 }); 3658 3659 Use ajaxForm when you want the plugin to manage all the event binding 3660 for you. For example, 3661 3662 $(document).ready(function() { 3663 $('#myForm').ajaxForm({ 3664 target: '#output' 3665 }); 3666 }); 3667 3668 You can also use ajaxForm with delegation (requires jQuery v1.7+), so the 3669 form does not have to exist when you invoke ajaxForm: 3670 3671 $('#myForm').ajaxForm({ 3672 delegation: true, 3673 target: '#output' 3674 }); 3675 3676 When using ajaxForm, the ajaxSubmit function will be invoked for you 3677 at the appropriate time. 3678*/ 3679 3680/** 3681 * Feature detection 3682 */ 3683var feature = {}; 3684feature.fileapi = $("<input type='file'/>").get(0).files !== undefined; 3685feature.formdata = window.FormData !== undefined; 3686 3687var hasProp = !!$.fn.prop; 3688 3689// attr2 uses prop when it can but checks the return type for 3690// an expected string. this accounts for the case where a form 3691// contains inputs with names like "action" or "method"; in those 3692// cases "prop" returns the element 3693$.fn.attr2 = function() { 3694 if ( ! hasProp ) 3695 return this.attr.apply(this, arguments); 3696 var val = this.prop.apply(this, arguments); 3697 if ( ( val && val.jquery ) || typeof val === 'string' ) 3698 return val; 3699 return this.attr.apply(this, arguments); 3700}; 3701 3702/** 3703 * ajaxSubmit() provides a mechanism for immediately submitting 3704 * an HTML form using AJAX. 3705 */ 3706$.fn.ajaxSubmit = function(options) { 3707 /*jshint scripturl:true */ 3708 3709 // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) 3710 if (!this.length) { 3711 log('ajaxSubmit: skipping submit process - no element selected'); 3712 return this; 3713 } 3714 3715 var method, action, url, $form = this; 3716 3717 if (typeof options == 'function') { 3718 options = { success: options }; 3719 } 3720 3721 method = this.attr2('method'); 3722 action = this.attr2('action'); 3723 3724 url = (typeof action === 'string') ? $.trim(action) : ''; 3725 url = url || window.location.href || ''; 3726 if (url) { 3727 // clean url (don't include hash vaue) 3728 url = (url.match(/^([^#]+)/)||[])[1]; 3729 } 3730 3731 options = $.extend(true, { 3732 url: url, 3733 success: $.ajaxSettings.success, 3734 type: method || 'GET', 3735 iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' 3736 }, options); 3737 3738 // hook for manipulating the form data before it is extracted; 3739 // convenient for use with rich editors like tinyMCE or FCKEditor 3740 var veto = {}; 3741 this.trigger('form-pre-serialize', [this, options, veto]); 3742 if (veto.veto) { 3743 log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); 3744 return this; 3745 } 3746 3747 // provide opportunity to alter form data before it is serialized 3748 if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { 3749 log('ajaxSubmit: submit aborted via beforeSerialize callback'); 3750 return this; 3751 } 3752 3753 var traditional = options.traditional; 3754 if ( traditional === undefined ) { 3755 traditional = $.ajaxSettings.traditional; 3756 } 3757 3758 var elements = []; 3759 var qx, a = this.formToArray(options.semantic, elements); 3760 if (options.data) { 3761 options.extraData = options.data; 3762 qx = $.param(options.data, traditional); 3763 } 3764 3765 // give pre-submit callback an opportunity to abort the submit 3766 if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { 3767 log('ajaxSubmit: submit aborted via beforeSubmit callback'); 3768 return this; 3769 } 3770 3771 // fire vetoable 'validate' event 3772 this.trigger('form-submit-validate', [a, this, options, veto]); 3773 if (veto.veto) { 3774 log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); 3775 return this; 3776 } 3777 3778 var q = $.param(a, traditional); 3779 if (qx) { 3780 q = ( q ? (q + '&' + qx) : qx ); 3781 } 3782 if (options.type.toUpperCase() == 'GET') { 3783 options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; 3784 options.data = null; // data is null for 'get' 3785 } 3786 else { 3787 options.data = q; // data is the query string for 'post' 3788 } 3789 3790 var callbacks = []; 3791 if (options.resetForm) { 3792 callbacks.push(function() { $form.resetForm(); }); 3793 } 3794 if (options.clearForm) { 3795 callbacks.push(function() { $form.clearForm(options.includeHidden); }); 3796 } 3797 3798 // perform a load on the target only if dataType is not provided 3799 if (!options.dataType && options.target) { 3800 var oldSuccess = options.success || function(){}; 3801 callbacks.push(function(data) { 3802 var fn = options.replaceTarget ? 'replaceWith' : 'html'; 3803 $(options.target)[fn](data).each(oldSuccess, arguments); 3804 }); 3805 } 3806 else if (options.success) { 3807 callbacks.push(options.success); 3808 } 3809 3810 options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg 3811 var context = options.context || this ; // jQuery 1.4+ supports scope context 3812 for (var i=0, max=callbacks.length; i < max; i++) { 3813 callbacks[i].apply(context, [data, status, xhr || $form, $form]); 3814 } 3815 }; 3816 3817 // are there files to upload? 3818 3819 // [value] (issue #113), also see comment: 3820 // https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219 3821 var fileInputs = $('input[type=file]:enabled[value!=""]', this); 3822 3823 var hasFileInputs = fileInputs.length > 0; 3824 var mp = 'multipart/form-data'; 3825 var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); 3826 3827 var fileAPI = feature.fileapi && feature.formdata; 3828 log("fileAPI :" + fileAPI); 3829 var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI; 3830 3831 var jqxhr; 3832 3833 // options.iframe allows user to force iframe mode 3834 // 06-NOV-09: now defaulting to iframe mode if file input is detected 3835 if (options.iframe !== false && (options.iframe || shouldUseFrame)) { 3836 // hack to fix Safari hang (thanks to Tim Molendijk for this) 3837 // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d 3838 if (options.closeKeepAlive) { 3839 $.get(options.closeKeepAlive, function() { 3840 jqxhr = fileUploadIframe(a); 3841 }); 3842 } 3843 else { 3844 jqxhr = fileUploadIframe(a); 3845 } 3846 } 3847 else if ((hasFileInputs || multipart) && fileAPI) { 3848 jqxhr = fileUploadXhr(a); 3849 } 3850 else { 3851 jqxhr = $.ajax(options); 3852 } 3853 3854 $form.removeData('jqxhr').data('jqxhr', jqxhr); 3855 3856 // clear element array 3857 for (var k=0; k < elements.length; k++) 3858 elements[k] = null; 3859 3860 // fire 'notify' event 3861 this.trigger('form-submit-notify', [this, options]); 3862 return this; 3863 3864 // utility fn for deep serialization 3865 function deepSerialize(extraData){ 3866 var serialized = $.param(extraData).split('&'); 3867 var len = serialized.length; 3868 var result = []; 3869 var i, part; 3870 for (i=0; i < len; i++) { 3871 // #252; undo param space replacement 3872 serialized[i] = serialized[i].replace(/\+/g,' '); 3873 part = serialized[i].split('='); 3874 // #278; use array instead of object storage, favoring array serializations 3875 result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]); 3876 } 3877 return result; 3878 } 3879 3880 // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz) 3881 function fileUploadXhr(a) { 3882 var formdata = new FormData(); 3883 3884 for (var i=0; i < a.length; i++) { 3885 formdata.append(a[i].name, a[i].value); 3886 } 3887 3888 if (options.extraData) { 3889 var serializedData = deepSerialize(options.extraData); 3890 for (i=0; i < serializedData.length; i++) 3891 if (serializedData[i]) 3892 formdata.append(serializedData[i][0], serializedData[i][1]); 3893 } 3894 3895 options.data = null; 3896 3897 var s = $.extend(true, {}, $.ajaxSettings, options, { 3898 contentType: false, 3899 processData: false, 3900 cache: false, 3901 type: method || 'POST' 3902 }); 3903 3904 if (options.uploadProgress) { 3905 // workaround because jqXHR does not expose upload property 3906 s.xhr = function() { 3907 var xhr = jQuery.ajaxSettings.xhr(); 3908 if (xhr.upload) { 3909 xhr.upload.addEventListener('progress', function(event) { 3910 var percent = 0; 3911 var position = event.loaded || event.position; /*event.position is deprecated*/ 3912 var total = event.total; 3913 if (event.lengthComputable) {
3914 percent = Math.ceil(position / total * 100); 3915 } 3916 options.uploadProgress(event, position, total, percent); 3917 }, false); 3918 } 3919 return xhr; 3920 }; 3921 } 3922 3923 s.data = null; 3924 var beforeSend = s.beforeSend; 3925 s.beforeSend = function(xhr, o) { 3926 o.data = formdata; 3927 if(beforeSend) 3928 beforeSend.call(this, xhr, o); 3929 }; 3930 return $.ajax(s); 3931 } 3932 3933 // private function for handling file uploads (hat tip to YAHOO!) 3934 function fileUploadIframe(a) { 3935 var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle; 3936 var deferred = $.Deferred(); 3937 3938 if (a) { 3939 // ensure that every serialized input is still enabled 3940 for (i=0; i < elements.length; i++) { 3941 el = $(elements[i]); 3942 if ( hasProp ) 3943 el.prop('disabled', false); 3944 else 3945 el.removeAttr('disabled'); 3946 } 3947 } 3948 3949 s = $.extend(true, {}, $.ajaxSettings, options); 3950 s.context = s.context || s; 3951 id = 'jqFormIO' + (new Date().getTime()); 3952 if (s.iframeTarget) { 3953 $io = $(s.iframeTarget); 3954 n = $io.attr2('name'); 3955 if (!n) 3956 $io.attr2('name', id); 3957 else 3958 id = n; 3959 } 3960 else { 3961 $io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />'); 3962 $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' }); 3963 } 3964 io = $io[0]; 3965 3966 3967 xhr = { // mock object 3968 aborted: 0, 3969 responseText: null, 3970 responseXML: null, 3971 status: 0, 3972 statusText: 'n/a', 3973 getAllResponseHeaders: function() {}, 3974 getResponseHeader: function() {}, 3975 setRequestHeader: function() {}, 3976 abort: function(status) { 3977 var e = (status === 'timeout' ? 'timeout' : 'aborted'); 3978 log('aborting upload... ' + e); 3979 this.aborted = 1; 3980 3981 try { // #214, #257 3982 if (io.contentWindow.document.execCommand) { 3983 io.contentWindow.document.execCommand('Stop'); 3984 } 3985 } 3986 catch(ignore) {} 3987 3988 $io.attr('src', s.iframeSrc); // abort op in progress 3989 xhr.error = e; 3990 if (s.error) 3991 s.error.call(s.context, xhr, e, status); 3992 if (g) 3993 $.event.trigger("ajaxError", [xhr, s, e]); 3994 if (s.complete) 3995 s.complete.call(s.context, xhr, e); 3996 } 3997 }; 3998 3999 g = s.global; 4000 // trigger ajax global events so that activity/block indicators work like normal 4001 if (g && 0 === $.active++) { 4002 $.event.trigger("ajaxStart"); 4003 } 4004 if (g) { 4005 $.event.trigger("ajaxSend", [xhr, s]); 4006 } 4007 4008 if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) { 4009 if (s.global) { 4010 $.active--; 4011 } 4012 deferred.reject(); 4013 return deferred; 4014 } 4015 if (xhr.aborted) { 4016 deferred.reject(); 4017 return deferred; 4018 } 4019 4020 // add submitting element to data if we know it 4021 sub = form.clk; 4022 if (sub) { 4023 n = sub.name; 4024 if (n && !sub.disabled) { 4025 s.extraData = s.extraData || {}; 4026 s.extraData[n] = sub.value; 4027 if (sub.type == "image") { 4028 s.extraData[n+'.x'] = form.clk_x; 4029 s.extraData[n+'.y'] = form.clk_y; 4030 } 4031 } 4032 } 4033 4034 var CLIENT_TIMEOUT_ABORT = 1; 4035 var SERVER_ABORT = 2; 4036 4037 function getDoc(frame) { 4038 /* it looks like contentWindow or contentDocument do not 4039 * carry the protocol property in ie8, when running under ssl 4040 * frame.document is the only valid response document, since 4041 * the protocol is know but not on the other two objects. strange? 4042 * "Same origin policy" http://en.wikipedia.org/wiki/Same_origin_policy 4043 */ 4044 4045 var doc = null; 4046 4047 // IE8 cascading access check 4048 try { 4049 if (frame.contentWindow) { 4050 doc = frame.contentWindow.document; 4051 } 4052 } catch(err) { 4053 // IE8 access denied under ssl & missing protocol 4054 log('cannot get iframe.contentWindow document: ' + err); 4055 } 4056 4057 if (doc) { // successful getting content 4058 return doc; 4059 } 4060 4061 try { // simply checking may throw in ie8 under ssl or mismatched protocol 4062 doc = frame.contentDocument ? frame.contentDocument : frame.document; 4063 } catch(err) { 4064 // last attempt 4065 log('cannot get iframe.contentDocument: ' + err); 4066 doc = frame.document; 4067 } 4068 return doc; 4069 } 4070 4071 // Rails CSRF hack (thanks to Yvan Barthelemy) 4072 var csrf_token = $('meta[name=csrf-token]').attr('content'); 4073 var csrf_param = $('meta[name=csrf-param]').attr('content'); 4074 if (csrf_param && csrf_token) { 4075 s.extraData = s.extraData || {}; 4076 s.extraData[csrf_param] = csrf_token; 4077 } 4078 4079 // take a breath so that pending repaints get some cpu time before the upload starts 4080 function doSubmit() { 4081 // make sure form attrs are set 4082 var t = $form.attr2('target'), a = $form.attr2('action'); 4083 4084 // update form attrs in IE friendly way 4085 form.setAttribute('target',id);
4086 if (!method) { 4087 form.setAttribute('method', 'POST'); 4088 } 4089 if (a != s.url) { 4090 form.setAttribute('action', s.url); 4091 } 4092 4093 // ie borks in some cases when setting encoding 4094 if (! s.skipEncodingOverride && (!method || /post/i.test(method))) { 4095 $form.attr({ 4096 encoding: 'multipart/form-data', 4097 enctype: 'multipart/form-data' 4098 }); 4099 } 4100 4101 // support timout 4102 if (s.timeout) { 4103 timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout); 4104 } 4105 4106 // look for server aborts 4107 function checkState() { 4108 try { 4109 var state = getDoc(io).readyState; 4110 log('state = ' + state); 4111 if (state && state.toLowerCase() == 'uninitialized') 4112 setTimeout(checkState,50); 4113 } 4114 catch(e) { 4115 log('Server abort: ' , e, ' (', e.name, ')'); 4116 cb(SERVER_ABORT); 4117 if (timeoutHandle) 4118 clearTimeout(timeoutHandle); 4119 timeoutHandle = undefined; 4120 } 4121 } 4122 4123 // add "extra" data to form if provided in options 4124 var extraInputs = []; 4125 try { 4126 if (s.extraData) { 4127 for (var n in s.extraData) { 4128 if (s.extraData.hasOwnProperty(n)) { 4129 // if using the $.param format that allows for multiple values with the same name 4130 if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) { 4131 extraInputs.push( 4132 $('<input type="hidden" name="'+s.extraData[n].name+'">').val(s.extraData[n].value) 4133 .appendTo(form)[0]); 4134 } else { 4135 extraInputs.push( 4136 $('<input type="hidden" name="'+n+'">').val(s.extraData[n]) 4137 .appendTo(form)[0]); 4138 } 4139 } 4140 } 4141 } 4142 4143 if (!s.iframeTarget) { 4144 // add iframe to doc and submit the form 4145 $io.appendTo('body'); 4146 if (io.attachEvent) 4147 io.attachEvent('onload', cb); 4148 else 4149 io.addEventListener('load', cb, false); 4150 } 4151 setTimeout(checkState,15); 4152 4153 try { 4154 form.submit(); 4155 } catch(err) { 4156 // just in case form has element with name/id of 'submit' 4157 var submitFn = document.createElement('form').submit; 4158 submitFn.apply(form); 4159 } 4160 } 4161 finally { 4162 // reset attrs and remove "extra" input elements 4163 form.setAttribute('action',a); 4164 if(t) { 4165 form.setAttribute('target', t); 4166 } else { 4167 $form.removeAttr('target'); 4168 } 4169 $(extraInputs).remove(); 4170 } 4171 } 4172 4173 if (s.forceSync) { 4174 doSubmit(); 4175 } 4176 else { 4177 setTimeout(doSubmit, 10); // this lets dom updates render 4178 } 4179 4180 var data, doc, domCheckCount = 50, callbackProcessed; 4181 4182 function cb(e) { 4183 if (xhr.aborted || callbackProcessed) { 4184 return; 4185 } 4186 4187 doc = getDoc(io); 4188 if(!doc) { 4189 log('cannot access response document'); 4190 e = SERVER_ABORT; 4191 } 4192 if (e === CLIENT_TIMEOUT_ABORT && xhr) { 4193 xhr.abort('timeout'); 4194 deferred.reject(xhr, 'timeout'); 4195 return; 4196 } 4197 else if (e == SERVER_ABORT && xhr) { 4198 xhr.abort('server abort'); 4199 deferred.reject(xhr, 'error', 'server abort'); 4200 return; 4201 } 4202 4203 if (!doc || doc.location.href == s.iframeSrc) { 4204 // response not received yet 4205 if (!timedOut) 4206 return; 4207 } 4208 if (io.detachEvent) 4209 io.detachEvent('onload', cb); 4210 else 4211 io.removeEventListener('load', cb, false); 4212 4213 var status = 'success', errMsg; 4214 try { 4215 if (timedOut) { 4216 throw 'timeout'; 4217 } 4218 4219 var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc); 4220 log('isXml='+isXml); 4221 if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) { 4222 if (--domCheckCount) { 4223 // in some browsers (Opera) the iframe DOM is not always traversable when 4224 // the onload callback fires, so we loop a bit to accommodate 4225 log('requeing onLoad callback, DOM not available'); 4226 setTimeout(cb, 250); 4227 return; 4228 } 4229 // let this fall through because server response could be an empty document 4230 //log('Could not access iframe DOM after mutiple tries.'); 4231 //throw 'DOMException: not available'; 4232 } 4233 4234 //log('response detected'); 4235 var docRoot = doc.body ? doc.body : doc.documentElement; 4236 xhr.responseText = docRoot ? docRoot.innerHTML : null; 4237 xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc; 4238 if (isXml) 4239 s.dataType = 'xml'; 4240 xhr.getResponseHeader = function(header){ 4241 var headers = {'content-type': s.dataType}; 4242 return headers[header]; 4243 }; 4244 // support for XHR 'status' & 'statusText' emulation : 4245 if (docRoot) { 4246 xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status; 4247 xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText; 4248 } 4249 4250 var dt = (s.dataType || '').toLowerCase(); 4251 var scr = /(json|script|text)/.test(dt); 4252 if (scr || s.textarea) { 4253 // see if user embedded response in textarea 4254 var ta = doc.getElementsByTagName('textarea')[0]; 4255 if (ta) { 4256 xhr.responseText = ta.value; 4257 // support for XHR 'status' & 'statusText' emulation : 4258 xhr.status = Number( ta.getAttribute('status') ) || xhr.status; 4259 xhr.statusText = ta.getAttribute('statusText') || xhr.statusText; 4260 } 4261 else if (scr) { 4262 // account for browsers injecting pre around json response 4263 var pre = doc.getElementsByTagName('pre')[0]; 4264 var b = doc.getElementsByTagName('body')[0]; 4265 if (pre) { 4266 xhr.responseText = pre.textContent ? pre.textContent : pre.innerText; 4267 } 4268 else if (b) { 4269 xhr.responseText = b.textContent ? b.textContent : b.innerText; 4270 } 4271 } 4272 } 4273 else if (dt == 'xml' && !xhr.responseXML && xhr.responseText) { 4274 xhr.responseXML = toXml(xhr.responseText); 4275 } 4276 4277 try { 4278 data = httpData(xhr, dt, s); 4279 } 4280 catch (err) { 4281 status = 'parsererror'; 4282 xhr.error = errMsg = (err || status); 4283 } 4284 } 4285 catch (err) { 4286 log('error caught: ',err); 4287 status = 'error'; 4288 xhr.error = errMsg = (err || status); 4289 } 4290 4291 if (xhr.aborted) { 4292 log('upload aborted'); 4293 status = null; 4294 } 4295 4296 if (xhr.status) { // we've set xhr.status 4297 status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error'; 4298 } 4299 4300 // ordering of these callbacks/triggers is odd, but that's how $.ajax does it 4301 if (status === 'success') { 4302 if (s.success) 4303 s.success.call(s.context, data, 'success', xhr); 4304 deferred.resolve(xhr.responseText, 'success', xhr); 4305 if (g) 4306 $.event.trigger("ajaxSuccess", [xhr, s]); 4307 } 4308 else if (status) { 4309 if (errMsg === undefined) 4310 errMsg = xhr.statusText; 4311 if (s.error) 4312 s.error.call(s.context, xhr, status, errMsg); 4313 deferred.reject(xhr, 'error', errMsg); 4314 if (g) 4315 $.event.trigger("ajaxError", [xhr, s, errMsg]); 4316 } 4317 4318 if (g)
4319 $.event.trigger("ajaxComplete", [xhr, s]); 4320 4321 if (g && ! --$.active) { 4322 $.event.trigger("ajaxStop"); 4323 } 4324 4325 if (s.complete) 4326 s.complete.call(s.context, xhr, status); 4327 4328 callbackProcessed = true; 4329 if (s.timeout) 4330 clearTimeout(timeoutHandle); 4331 4332 // clean up 4333 setTimeout(function() { 4334 if (!s.iframeTarget) 4335 $io.remove(); 4336 xhr.responseXML = null; 4337 }, 100); 4338 } 4339 4340 var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+) 4341 if (window.ActiveXObject) { 4342 doc = new ActiveXObject('Microsoft.XMLDOM'); 4343 doc.async = 'false'; 4344 doc.loadXML(s); 4345 } 4346 else { 4347 doc = (new DOMParser()).parseFromString(s, 'text/xml'); 4348 } 4349 return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null; 4350 }; 4351 var parseJSON = $.parseJSON || function(s) { 4352 /*jslint evil:true */ 4353 return window['eval']('(' + s + ')'); 4354 }; 4355 4356 var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4 4357 4358 var ct = xhr.getResponseHeader('content-type') || '', 4359 xml = type === 'xml' || !type && ct.indexOf('xml') >= 0, 4360 data = xml ? xhr.responseXML : xhr.responseText; 4361 4362 if (xml && data.documentElement.nodeName === 'parsererror') { 4363 if ($.error) 4364 $.error('parsererror'); 4365 } 4366 if (s && s.dataFilter) { 4367 data = s.dataFilter(data, type); 4368 } 4369 if (typeof data === 'string') { 4370 if (type === 'json' || !type && ct.indexOf('json') >= 0) { 4371 data = parseJSON(data); 4372 } else if (type === "script" || !type && ct.indexOf("javascript") >= 0) { 4373 $.globalEval(data); 4374 } 4375 } 4376 return data; 4377 }; 4378 4379 return deferred; 4380 } 4381}; 4382 4383/** 4384 * ajaxForm() provides a mechanism for fully automating form submission. 4385 * 4386 * The advantages of using this method instead of ajaxSubmit() are: 4387 * 4388 * 1: This method will include coordinates for <input type="image" /> elements (if the element 4389 * is used to submit the form). 4390 * 2. This method will include the submit element's name/value data (for the element that was 4391 * used to submit the form). 4392 * 3. This method binds the submit() method to the form for you. 4393 * 4394 * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely 4395 * passes the options argument along after properly binding events for submit elements and 4396 * the form itself. 4397 */ 4398$.fn.ajaxForm = function(options) { 4399 options = options || {}; 4400 options.delegation = options.delegation && $.isFunction($.fn.on); 4401 4402 // in jQuery 1.3+ we can fix mistakes with the ready state 4403 if (!options.delegation && this.length === 0) { 4404 var o = { s: this.selector, c: this.context }; 4405 if (!$.isReady && o.s) { 4406 log('DOM not ready, queuing ajaxForm'); 4407 $(function() { 4408 $(o.s,o.c).ajaxForm(options); 4409 }); 4410 return this; 4411 } 4412 // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready() 4413 log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)')); 4414 return this; 4415 } 4416 4417 if ( options.delegation ) { 4418 $(document) 4419 .off('submit.form-plugin', this.selector, doAjaxSubmit) 4420 .off('click.form-plugin', this.selector, captureSubmittingElement) 4421 .on('submit.form-plugin', this.selector, options, doAjaxSubmit) 4422 .on('click.form-plugin', this.selector, options, captureSubmittingElement); 4423 return this; 4424 } 4425 4426 return this.ajaxFormUnbind() 4427 .bind('submit.form-plugin', options, doAjaxSubmit) 4428 .bind('click.form-plugin', options, captureSubmittingElement); 4429}; 4430 4431// private event handlers 4432function doAjaxSubmit(e) { 4433 /*jshint validthis:true */ 4434 var options = e.data; 4435 if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed 4436 e.preventDefault(); 4437 $(this).ajaxSubmit(options); 4438 } 4439} 4440 4441function captureSubmittingElement(e) { 4442 /*jshint validthis:true */ 4443 var target = e.target; 4444 var $el = $(target); 4445 if (!($el.is("[type=submit],[type=image]"))) { 4446 // is this a child element of the submit el? (ex: a span within a button) 4447 var t = $el.closest('[type=submit]'); 4448 if (t.length === 0) { 4449 return; 4450 } 4451 target = t[0]; 4452 } 4453 var form = this; 4454 form.clk = target; 4455 if (target.type == 'image') { 4456 if (e.offsetX !== undefined) { 4457 form.clk_x = e.offsetX; 4458 form.clk_y = e.offsetY; 4459 } else if (typeof $.fn.offset == 'function') { 4460 var offset = $el.offset(); 4461 form.clk_x = e.pageX - offset.left; 4462 form.clk_y = e.pageY - offset.top; 4463 } else { 4464 form.clk_x = e.pageX - target.offsetLeft; 4465 form.clk_y = e.pageY - target.offsetTop; 4466 } 4467 } 4468 // clear form vars 4469 setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100); 4470} 4471 4472 4473// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm 4474$.fn.ajaxFormUnbind = function() { 4475 return this.unbind('submit.form-plugin click.form-plugin'); 4476}; 4477 4478/** 4479 * formToArray() gathers form element data into an array of objects that can 4480 * be passed to any of the following ajax functions: $.get, $.post, or load. 4481 * Each object in the array has both a 'name' and 'value' property. An example of 4482 * an array for a simple login form might be: 4483 * 4484 * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] 4485 * 4486 * It is this array that is passed to pre-submit callback functions provided to the 4487 * ajaxSubmit() and ajaxForm() methods. 4488 */ 4489$.fn.formToArray = function(semantic, elements) { 4490 var a = []; 4491 if (this.length === 0) { 4492 return a; 4493 } 4494 4495 var form = this[0]; 4496 var els = semantic ? form.getElementsByTagName('*') : form.elements; 4497 if (!els) { 4498 return a; 4499 } 4500 4501 var i,j,n,v,el,max,jmax; 4502 for(i=0, max=els.length; i < max; i++) { 4503 el = els[i]; 4504 n = el.name; 4505 if (!n || el.disabled) { 4506 continue; 4507 } 4508 4509 if (semantic && form.clk && el.type == "image") { 4510 // handle image inputs on the fly when semantic == true 4511 if(form.clk == el) { 4512 a.push({name: n, value: $(el).val(), type: el.type }); 4513 a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); 4514 } 4515 continue; 4516 } 4517 4518 v = $.fieldValue(el, true); 4519 if (v && v.constructor == Array) { 4520 if (elements) 4521 elements.push(el); 4522 for(j=0, jmax=v.length; j < jmax; j++) { 4523 a.push({name: n, value: v[j]}); 4524 } 4525 } 4526 else if (feature.fileapi && el.type == 'file') { 4527 if (elements) 4528 elements.push(el); 4529 var files = el.files; 4530 if (files.length) { 4531 for (j=0; j < files.length; j++) { 4532 a.push({name: n, value: files[j], type: el.type}); 4533 } 4534 } 4535 else { 4536 // #180 4537 a.push({ name: n, value: '', type: el.type }); 4538 } 4539 } 4540 else if (v !== null && typeof v != 'undefined') { 4541 if (elements) 4542 elements.push(el); 4543 a.push({name: n, value: v, type: el.type, required: el.required}); 4544 } 4545 } 4546 4547 if (!semantic && form.clk) { 4548 // input type=='image' are not found in elements array! handle it here 4549 var $input = $(form.clk), input = $input[0]; 4550 n = input.name; 4551 if (n && !input.disabled && input.type == 'image') { 4552 a.push({name: n, value: $input.val()}); 4553 a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); 4554 } 4555 } 4556 return a; 4557}; 4558 4559/** 4560 * Serializes form data into a 'submittable' string. This method will return a string 4561 * in the format: name1=value1&name2=value2 4562 */
4563$.fn.formSerialize = function(semantic) { 4564 //hand off to jQuery.param for proper encoding 4565 return $.param(this.formToArray(semantic)); 4566}; 4567 4568/** 4569 * Serializes all field elements in the jQuery object into a query string. 4570 * This method will return a string in the format: name1=value1&name2=value2 4571 */ 4572$.fn.fieldSerialize = function(successful) { 4573 var a = []; 4574 this.each(function() { 4575 var n = this.name; 4576 if (!n) { 4577 return; 4578 } 4579 var v = $.fieldValue(this, successful); 4580 if (v && v.constructor == Array) { 4581 for (var i=0,max=v.length; i < max; i++) { 4582 a.push({name: n, value: v[i]}); 4583 } 4584 } 4585 else if (v !== null && typeof v != 'undefined') { 4586 a.push({name: this.name, value: v}); 4587 } 4588 }); 4589 //hand off to jQuery.param for proper encoding 4590 return $.param(a); 4591}; 4592 4593/** 4594 * Returns the value(s) of the element in the matched set. For example, consider the following form: 4595 * 4596 * <form><fieldset> 4597 * <input name="A" type="text" /> 4598 * <input name="A" type="text" /> 4599 * <input name="B" type="checkbox" value="B1" /> 4600 * <input name="B" type="checkbox" value="B2"/> 4601 * <input name="C" type="radio" value="C1" /> 4602 * <input name="C" type="radio" value="C2" /> 4603 * </fieldset></form> 4604 * 4605 * var v = $('input[type=text]').fieldValue(); 4606 * // if no values are entered into the text inputs 4607 * v == ['',''] 4608 * // if values entered into the text inputs are 'foo' and 'bar' 4609 * v == ['foo','bar'] 4610 * 4611 * var v = $('input[type=checkbox]').fieldValue(); 4612 * // if neither checkbox is checked 4613 * v === undefined 4614 * // if both checkboxes are checked 4615 * v == ['B1', 'B2'] 4616 * 4617 * var v = $('input[type=radio]').fieldValue(); 4618 * // if neither radio is checked 4619 * v === undefined 4620 * // if first radio is checked 4621 * v == ['C1'] 4622 * 4623 * The successful argument controls whether or not the field element must be 'successful' 4624 * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls). 4625 * The default value of the successful argument is true. If this value is false the value(s) 4626 * for each element is returned. 4627 * 4628 * Note: This method *always* returns an array. If no valid value can be determined the 4629 * array will be empty, otherwise it will contain one or more values. 4630 */ 4631$.fn.fieldValue = function(successful) { 4632 for (var val=[], i=0, max=this.length; i < max; i++) { 4633 var el = this[i]; 4634 var v = $.fieldValue(el, successful); 4635 if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) { 4636 continue; 4637 } 4638 if (v.constructor == Array) 4639 $.merge(val, v); 4640 else 4641 val.push(v); 4642 } 4643 return val; 4644}; 4645 4646/** 4647 * Returns the value of the field element. 4648 */ 4649$.fieldValue = function(el, successful) { 4650 var n = el.name, t = el.type, tag = el.tagName.toLowerCase(); 4651 if (successful === undefined) { 4652 successful = true; 4653 } 4654 4655 if (successful && (!n || el.disabled || t == 'reset' || t == 'button' || 4656 (t == 'checkbox' || t == 'radio') && !el.checked || 4657 (t == 'submit' || t == 'image') && el.form && el.form.clk != el || 4658 tag == 'select' && el.selectedIndex == -1)) { 4659 return null; 4660 } 4661 4662 if (tag == 'select') { 4663 var index = el.selectedIndex; 4664 if (index < 0) { 4665 return null; 4666 } 4667 var a = [], ops = el.options; 4668 var one = (t == 'select-one'); 4669 var max = (one ? index+1 : ops.length); 4670 for(var i=(one ? index : 0); i < max; i++) { 4671 var op = ops[i]; 4672 if (op.selected) { 4673 var v = op.value; 4674 if (!v) { // extra pain for IE... 4675 v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value; 4676 } 4677 if (one) { 4678 return v; 4679 } 4680 a.push(v); 4681 } 4682 } 4683 return a; 4684 } 4685 return $(el).val(); 4686}; 4687 4688/** 4689 * Clears the form data. Takes the following actions on the form's input fields: 4690 * - input text fields will have their 'value' property set to the empty string 4691 * - select elements will have their 'selectedIndex' property set to -1 4692 * - checkbox and radio inputs will have their 'checked' property set to false 4693 * - inputs of type submit, button, reset, and hidden will *not* be effected 4694 * - button elements will *not* be effected 4695 */ 4696$.fn.clearForm = function(includeHidden) { 4697 return this.each(function() { 4698 $('input,select,textarea', this).clearFields(includeHidden); 4699 }); 4700}; 4701 4702/** 4703 * Clears the selected form elements. 4704 */ 4705$.fn.clearFields = $.fn.clearInputs = function(includeHidden) { 4706 var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list 4707 return this.each(function() { 4708 var t = this.type, tag = this.tagName.toLowerCase(); 4709 if (re.test(t) || tag == 'textarea') { 4710 this.value = ''; 4711 } 4712 else if (t == 'checkbox' || t == 'radio') { 4713 this.checked = false;
4714 } 4715 else if (tag == 'select') { 4716 this.selectedIndex = -1; 4717 } 4718 else if (t == "file") { 4719 if (/MSIE/.test(navigator.userAgent)) { 4720 $(this).replaceWith($(this).clone(true)); 4721 } else { 4722 $(this).val(''); 4723 } 4724 } 4725 else if (includeHidden) { 4726 // includeHidden can be the value true, or it can be a selector string 4727 // indicating a special test; for example: 4728 // $('#myForm').clearForm('.special:hidden') 4729 // the above would clean hidden inputs that have the class of 'special' 4730 if ( (includeHidden === true && /hidden/.test(t)) || 4731 (typeof includeHidden == 'string' && $(this).is(includeHidden)) ) 4732 this.value = ''; 4733 } 4734 }); 4735}; 4736 4737/** 4738 * Resets the form data. Causes all form elements to be reset to their original value. 4739 */ 4740$.fn.resetForm = function() { 4741 return this.each(function() { 4742 // guard against an input with the name of 'reset' 4743 // note that IE reports the reset function as an 'object' 4744 if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) { 4745 this.reset(); 4746 } 4747 }); 4748}; 4749 4750/** 4751 * Enables or disables any matching elements. 4752 */ 4753$.fn.enable = function(b) { 4754 if (b === undefined) { 4755 b = true; 4756 } 4757 return this.each(function() { 4758 this.disabled = !b; 4759 }); 4760}; 4761 4762/** 4763 * Checks/unchecks any matching checkboxes or radio buttons and 4764 * selects/deselects and matching option elements. 4765 */ 4766$.fn.selected = function(select) { 4767 if (select === undefined) { 4768 select = true; 4769 } 4770 return this.each(function() { 4771 var t = this.type; 4772 if (t == 'checkbox' || t == 'radio') { 4773 this.checked = select; 4774 } 4775 else if (this.tagName.toLowerCase() == 'option') { 4776 var $sel = $(this).parent('select'); 4777 if (select && $sel[0] && $sel[0].type == 'select-one') { 4778 // deselect all other options 4779 $sel.find('option').selected(false); 4780 } 4781 this.selected = select; 4782 } 4783 }); 4784}; 4785 4786// expose debug var 4787$.fn.ajaxSubmit.debug = false; 4788 4789// helper fn for console logging 4790function log() { 4791 if (!$.fn.ajaxSubmit.debug) 4792 return; 4793 var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,''); 4794 if (window.console && window.console.log) { 4795 window.console.log(msg); 4796 } 4797 else if (window.opera && window.opera.postError) { 4798 window.opera.postError(msg); 4799 } 4800} 4801 4802})(jQuery); 4803 4804/*! jQuery Validation Plugin - v1.11.1 - 3/22/2013\n* https://github.com/jzaefferer/jquery-validation 4805* Copyright (c) 2013 Jörn Zaefferer; Licensed MIT */(function(t){t.extend(t.fn,{validate:function(e){if(!this.length)return e&&e.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."),void 0;var i=t.data(this[0],"validator");return i?i:(this.attr("novalidate","novalidate"),i=new t.validator(e,this[0]),t.data(this[0],"validator",i),i.settings.onsubmit&&(this.validateDelegate(":submit","click",function(e){i.settings.submitHandler&&(i.submitButton=e.target),t(e.target).hasClass("cancel")&&(i.cancelSubmit=!0),void 0!==t(e.target).attr("formnovalidate")&&(i.cancelSubmit=!0)}),this.submit(function(e){function s(){var s;return i.settings.submitHandler?(i.submitButton&&(s=t("<input type='hidden'/>").attr("name",i.submitButton.name).val(t(i.submitButton).val()).appendTo(i.currentForm)),i.settings.submitHandler.call(i,i.currentForm,e),i.submitButton&&s.remove(),!1):!0}return i.settings.debug&&e.preventDefault(),i.cancelSubmit?(i.cancelSubmit=!1,s()):i.form()?i.pendingRequest?(i.formSubmitted=!0,!1):s():(i.focusInvalid(),!1)})),i)},valid:function(){if(t(this[0]).is("form"))return this.validate().form();var e=!0,i=t(this[0].form).validate();return this.each(function(){e=e&&i.element(this)}),e},removeAttrs:function(e){var i={},s=this;return t.each(e.split(/\s/),function(t,e){i[e]=s.attr(e),s.removeAttr(e)}),i},rules:function(e,i){var s=this[0];if(e){var r=t.data(s.form,"validator").settings,n=r.rules,a=t.validator.staticRules(s);switch(e){case"add":t.extend(a,t.validator.normalizeRule(i)),delete a.messages,n[s.name]=a,i.messages&&(r.messages[s.name]=t.extend(r.messages[s.name],i.messages));break;case"remove":if(!i)return delete n[s.name],a;var u={};return t.each(i.split(/\s/),function(t,e){u[e]=a[e],delete a[e]}),u}}var o=t.validator.normalizeRules(t.extend({},t.validator.classRules(s),t.validator.attributeRules(s),t.validator.dataRules(s),t.validator.staticRules(s)),s);if(o.required){var l=o.required;delete o.required,o=t.extend({required:l},o)}return o}}),t.extend(t.expr[":"],{blank:function(e){return!t.trim(""+t(e).val())},filled:function(e){return!!t.trim(""+t(e).val())},unchecked:function(e){return!t(e).prop("checked")}}),t.validator=function(e,i){this.settings=t.extend(!0,{},t.validator.defaults,e),this.currentForm=i,this.init()},t.validator.format=function(e,i){return 1===arguments.length?function(){var i=t.makeArray(arguments);return i.unshift(e),t.validator.format.apply(this,i)}:(arguments.length>2&&i.constructor!==Array&&(i=t.makeArray(arguments).slice(1)),i.constructor!==Array&&(i=[i]),t.each(i,function(t,i){e=e.replace(RegExp("\\{"+t+"\\}","g"),function(){return i})}),e)},t.extend(t.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:t([]),errorLabelContainer:t([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(t){this.lastActive=t,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,t,this.settings.errorClass,this.settings.val
4805idClass),this.addWrapper(this.errorsFor(t)).hide())},onfocusout:function(t){this.checkable(t)||!(t.name in this.submitted)&&this.optional(t)||this.element(t)},onkeyup:function(t,e){(9!==e.which||""!==this.elementValue(t))&&(t.name in this.submitted||t===this.lastElement)&&this.element(t)},onclick:function(t){t.name in this.submitted?this.element(t):t.parentNode.name in this.submitted&&this.element(t.parentNode)},highlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).addClass(i).removeClass(s):t(e).addClass(i).removeClass(s)},unhighlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).removeClass(i).addClass(s):t(e).removeClass(i).addClass(s)}},setDefaults:function(e){t.extend(t.validator.defaults,e)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:t.validator.format("Please enter no more than {0} characters."),minlength:t.validator.format("Please enter at least {0} characters."),rangelength:t.validator.format("Please enter a value between {0} and {1} characters long."),range:t.validator.format("Please enter a value between {0} and {1}."),max:t.validator.format("Please enter a value less than or equal to {0}."),min:t.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function e(e){var i=t.data(this[0].form,"validator"),s="on"+e.type.replace(/^validate/,"");i.settings[s]&&i.settings[s].call(i,this[0],e)}this.labelContainer=t(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||t(this.currentForm),this.containers=t(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var i=this.groups={};t.each(this.settings.groups,function(e,s){"string"==typeof s&&(s=s.split(/\s/)),t.each(s,function(t,s){i[s]=e})});var s=this.settings.rules;t.each(s,function(e,i){s[e]=t.validator.normalizeRule(i)}),t(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",e).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",e),this.settings.invalidHandler&&t(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),t.extend(this.submitted,this.errorMap),this.invalid=t.extend({},this.errorMap),this.valid()||t(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var t=0,e=this.currentElements=this.elements();e[t];t++)this.check(e[t]);return this.valid()},element:function(e){e=this.validationTargetFor(this.clean(e)),this.lastElement=e,this.prepareElement(e),this.currentElements=t(e);var i=this.check(e)!==!1;return i?delete this.invalid[e.name]:this.invalid[e.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),i},showErrors:function(e){if(e){t.extend(this.errorMap,e),this.errorList=[];for(var i in e)this.errorList.push({message:e[i],element:this.findByName(i)[0]});this.successList=t.grep(this.successList,function(t){return!(t.name in e)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){t.fn.resetForm&&t(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(t){var e=0;for(var i in t)e++;return e},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{t(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(e){}},findLastActive:function(){var e=this.lastActive;return e&&1===t.grep(this.errorList,function(t){return t.element.name===e.name}).length&&e},elements:function(){var e=this,i={};return t(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&e.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in i||!e.objectLength(t(this).rules())?!1:(i[this.name]=!0,!0)})},clean:function(e){return t(e)[0]},errors:function(){var e=this.settings.errorClass.replace(" ",".");return t(this.settings.errorElement+"."+e,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=t([]),this.toHide=t([]),this.currentElements=t([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers
4805)},prepareElement:function(t){this.reset(),this.toHide=this.errorsFor(t)},elementValue:function(e){var i=t(e).attr("type"),s=t(e).val();return"radio"===i||"checkbox"===i?t("input[name='"+t(e).attr("name")+"']:checked").val():"string"==typeof s?s.replace(/\r/g,""):s},check:function(e){e=this.validationTargetFor(this.clean(e));var i,s=t(e).rules(),r=!1,n=this.elementValue(e);for(var a in s){var u={method:a,parameters:s[a]};try{if(i=t.validator.methods[a].call(this,n,e,u.parameters),"dependency-mismatch"===i){r=!0;continue}if(r=!1,"pending"===i)return this.toHide=this.toHide.not(this.errorsFor(e)),void 0;if(!i)return this.formatAndAdd(e,u),!1}catch(o){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+e.id+", check the '"+u.method+"' method.",o),o}}return r?void 0:(this.objectLength(s)&&this.successList.push(e),!0)},customDataMessage:function(e,i){return t(e).data("msg-"+i.toLowerCase())||e.attributes&&t(e).attr("data-msg-"+i.toLowerCase())},customMessage:function(t,e){var i=this.settings.messages[t];return i&&(i.constructor===String?i:i[e])},findDefined:function(){for(var t=0;arguments.length>t;t++)if(void 0!==arguments[t])return arguments[t];return void 0},defaultMessage:function(e,i){return this.findDefined(this.customMessage(e.name,i),this.customDataMessage(e,i),!this.settings.ignoreTitle&&e.title||void 0,t.validator.messages[i],"<strong>Warning: No message defined for "+e.name+"</strong>")},formatAndAdd:function(e,i){var s=this.defaultMessage(e,i.method),r=/\$?\{(\d+)\}/g;"function"==typeof s?s=s.call(this,i.parameters,e):r.test(s)&&(s=t.validator.format(s.replace(r,"{$1}"),i.parameters)),this.errorList.push({message:s,element:e}),this.errorMap[e.name]=s,this.submitted[e.name]=s},addWrapper:function(t){return this.settings.wrapper&&(t=t.add(t.parent(this.settings.wrapper))),t},defaultShowErrors:function(){var t,e;for(t=0;this.errorList[t];t++){var i=this.errorList[t];this.settings.highlight&&this.settings.highlight.call(this,i.element,this.settings.errorClass,this.settings.validClass),this.showLabel(i.element,i.message)}if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(t=0;this.successList[t];t++)this.showLabel(this.successList[t]);if(this.settings.unhighlight)for(t=0,e=this.validElements();e[t];t++)this.settings.unhighlight.call(this,e[t],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return t(this.errorList).map(function(){return this.element})},showLabel:function(e,i){var s=this.errorsFor(e);s.length?(s.removeClass(this.settings.validClass).addClass(this.settings.errorClass),s.html(i)):(s=t("<"+this.settings.errorElement+">").attr("for",this.idOrName(e)).addClass(this.settings.errorClass).html(i||""),this.settings.wrapper&&(s=s.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(s).length||(this.settings.errorPlacement?this.settings.errorPlacement(s,t(e)):s.insertAfter(e))),!i&&this.settings.success&&(s.text(""),"string"==typeof this.settings.success?s.addClass(this.settings.success):this.settings.success(s,e)),this.toShow=this.toShow.add(s)},errorsFor:function(e){var i=this.idOrName(e);return this.errors().filter(function(){return t(this).attr("for")===i})},idOrName:function(t){return this.groups[t.name]||(this.checkable(t)?t.name:t.id||t.name)},validationTargetFor:function(t){return this.checkable(t)&&(t=this.findByName(t.name).not(this.settings.ignore)[0]),t},checkable:function(t){return/radio|checkbox/i.test(t.type)},findByName:function(e){return t(this.currentForm).find("[name='"+e+"']")},getLength:function(e,i){switch(i.nodeName.toLowerCase()){case"select":return t("option:selected",i).length;case"input":if(this.checkable(i))return this.findByName(i.name).filter(":checked").length}return e.length},depend:function(t,e){return this.dependTypes[typeof t]?this.dependTypes[typeof t](t,e):!0}
4805,dependTypes:{"boolean":function(t){return t},string:function(e,i){return!!t(e,i.form).length},"function":function(t,e){return t(e)}},optional:function(e){var i=this.elementValue(e);return!t.validator.methods.required.call(this,i,e)&&"dependency-mismatch"},startRequest:function(t){this.pending[t.name]||(this.pendingRequest++,this.pending[t.name]=!0)},stopRequest:function(e,i){this.pendingRequest--,0>this.pendingRequest&&(this.pendingRequest=0),delete this.pending[e.name],i&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(t(this.currentForm).submit(),this.formSubmitted=!1):!i&&0===this.pendingRequest&&this.formSubmitted&&(t(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(e){return t.data(e,"previousValue")||t.data(e,"previousValue",{old:null,valid:!0,message:this.defaultMessage(e,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(e,i){e.constructor===String?this.classRuleSettings[e]=i:t.extend(this.classRuleSettings,e)},classRules:function(e){var i={},s=t(e).attr("class");return s&&t.each(s.split(" "),function(){this in t.validator.classRuleSettings&&t.extend(i,t.validator.classRuleSettings[this])}),i},attributeRules:function(e){var i={},s=t(e),r=s[0].getAttribute("type");for(var n in t.validator.methods){var a;"required"===n?(a=s.get(0).getAttribute(n),""===a&&(a=!0),a=!!a):a=s.attr(n),/min|max/.test(n)&&(null===r||/number|range|text/.test(r))&&(a=Number(a)),a?i[n]=a:r===n&&"range"!==r&&(i[n]=!0)}return i.maxlength&&/-1|2147483647|524288/.test(i.maxlength)&&delete i.maxlength,i},dataRules:function(e){var i,s,r={},n=t(e);for(i in t.validator.methods)s=n.data("rule-"+i.toLowerCase()),void 0!==s&&(r[i]=s);return r},staticRules:function(e){var i={},s=t.data(e.form,"validator");return s.settings.rules&&(i=t.validator.normalizeRule(s.settings.rules[e.name])||{}),i},normalizeRules:function(e,i){return t.each(e,function(s,r){if(r===!1)return delete e[s],void 0;if(r.param||r.depends){var n=!0;switch(typeof r.depends){case"string":n=!!t(r.depends,i.form).length;break;case"function":n=r.depends.call(i,i)}n?e[s]=void 0!==r.param?r.param:!0:delete e[s]}}),t.each(e,function(s,r){e[s]=t.isFunction(r)?r(i):r}),t.each(["minlength","maxlength"],function(){e[this]&&(e[this]=Number(e[this]))}),t.each(["rangelength","range"],function(){var i;e[this]&&(t.isArray(e[this])?e[this]=[Number(e[this][0]),Number(e[this][1])]:"string"==typeof e[this]&&(i=e[this].split(/[\s,]+/),e[this]=[Number(i[0]),Number(i[1])]))}),t.validator.autoCreateRanges&&(e.min&&e.max&&(e.range=[e.min,e.max],delete e.min,delete e.max),e.minlength&&e.maxlength&&(e.rangelength=[e.minlength,e.maxlength],delete e.minlength,delete e.maxlength)),e},normalizeRule:function(e){if("string"==typeof e){var i={};t.each(e.split(/\s/),function(){i[this]=!0}),e=i}return e},addMethod:function(e,i,s){t.validator.methods[e]=i,t.validator.messages[e]=void 0!==s?s:t.validator.messages[e],3>i.length&&t.validator.addClassRules(e,t.validator.normalizeRule(e))},methods:{required:function(e,i,s){if(!this.depend(s,i))return"dependency-mismatch";if("select"===i.nodeName.toLowerCase()){var r=t(i).val();return r&&r.length>0}return this.checkable(i)?this.getLength(e,i)>0:t.trim(e).length>0},email:function(t,e){return this.optional(e)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(t)},url:function(t,e){return this.optional(e)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(t)},date:function(t,e){return this.optional(e)||!/Invalid|NaN/.test(""+new Date(t))},dateISO:function(t,e){return this.optional(e)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(t)},number:function(t,e){return this.optional(e)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(t)},digits:function(t,e){return this.optional(e)||/^\d+$/.test(t)},creditcard:function(t,e){if(this.optional(e))return"dependency-mismatch";if(/[^0-9 \-]+/.test(t))return!1;var i=0,s=0,r=!1;t=t.replace(/\D/g,"");for(var n=t.length-1;n>=0;n--){var a=t.charAt(n);s=parseInt(a,10),r&&(s*=2)>9&&(s-=9),i+=s,r=!r}return 0===i%10},minlength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||r>=s},maxlength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||s>=r},rangelength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||r>=s[0]&&s[1]>=r}
4805,min:function(t,e,i){return this.optional(e)||t>=i},max:function(t,e,i){return this.optional(e)||i>=t},range:function(t,e,i){return this.optional(e)||t>=i[0]&&i[1]>=t},equalTo:function(e,i,s){var r=t(s);return this.settings.onfocusout&&r.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){t(i).valid()}),e===r.val()},remote:function(e,i,s){if(this.optional(i))return"dependency-mismatch";var r=this.previousValue(i);if(this.settings.messages[i.name]||(this.settings.messages[i.name]={}),r.originalMessage=this.settings.messages[i.name].remote,this.settings.messages[i.name].remote=r.message,s="string"==typeof s&&{url:s}||s,r.old===e)return r.valid;r.old=e;var n=this;this.startRequest(i);var a={};return a[i.name]=e,t.ajax(t.extend(!0,{url:s,mode:"abort",port:"validate"+i.name,dataType:"json",data:a,success:function(s){n.settings.messages[i.name].remote=r.originalMessage;var a=s===!0||"true"===s;if(a){var u=n.formSubmitted;n.prepareElement(i),n.formSubmitted=u,n.successList.push(i),delete n.invalid[i.name],n.showErrors()}else{var o={},l=s||n.defaultMessage(i,"remote");o[i.name]=r.message=t.isFunction(l)?l(e):l,n.invalid[i.name]=!0,n.showErrors(o)}r.valid=a,n.stopRequest(i,a)}},s)),"pending"}}}),t.format=t.validator.format})(jQuery),function(t){var e={};if(t.ajaxPrefilter)t.ajaxPrefilter(function(t,i,s){var r=t.port;"abort"===t.mode&&(e[r]&&e[r].abort(),e[r]=s)});else{var i=t.ajax;t.ajax=function(s){var r=("mode"in s?s:t.ajaxSettings).mode,n=("port"in s?s:t.ajaxSettings).port;return"abort"===r?(e[n]&&e[n].abort(),e[n]=i.apply(this,arguments),e[n]):i.apply(this,arguments)}}}(jQuery),function(t){t.extend(t.fn,{validateDelegate:function(e,i,s){return this.bind(i,function(i){var r=t(i.target);return r.is(e)?s.apply(r,arguments):void 0})}})}(jQuery); 4806jQuery(function($){ 4807 $('#contactform').validate({ 4808 rules: { 4809 name: { 4810 required: true, 4811 minlength: 2 4812 }, 4813 email: { 4814 required: true, 4815 email: true 4816 }, 4817 message: { 4818 required: true, 4819 } 4820 }, 4821 messages: { 4822 name: { 4823 required: "Please enter your name", 4824 minlength: "Your name must consist of at least 2 characters" 4825 }, 4826 email: { 4827 required: "Please enter your email" 4828 }, 4829 message: { 4830 required: "Please enter your message" 4831 } 4832 }, 4833 submitHandler: function(form) { 4834 $(form).ajaxSubmit({ 4835 type:"POST", 4836 data: $(form).serialize(), 4837 url:"external/form/contact-form.php", 4838 success: function() { 4839 $('#success').fadeIn(); 4840 $('#contactform').each(function(){this.reset();}); 4841 $('#contactform .form-group').each(function(){ 4842 if($(this).hasClass('focused')){ 4843 $(this).removeClass('focused'); 4844 } 4845 }); 4846 }, 4847 error: function() { 4848 $('#contactform').fadeTo( "slow", 1, function() { 4849 $('#error').fadeIn(); 4850 }); 4851 } 4852 }); 4853 } 4854 }); 4855 $('#contactform02').validate({ 4856 rules: { 4857 name: { 4858 required: true, 4859 minlength: 2 4860 }, 4861 email: { 4862 required: true, 4863 email: true 4864 }, 4865 message: { 4866 required: true, 4867 } 4868 }, 4869 messages: { 4870 name: { 4871 required: "Please enter your name", 4872 minlength: "Your name must consist of at least 2 characters" 4873 }, 4874 email: { 4875 required: "Please enter your email" 4876 }, 4877 message: { 4878 required: "Please enter your message" 4879 } 4880 }, 4881 submitHandler: function(form) { 4882 $(form).ajaxSubmit({ 4883 type:"POST", 4884 data: $(form).serialize(), 4885 url:"external/form/contact-form02.php", 4886 success: function() { 4887 $('#success').fadeIn(); 4888 $('#contactform02').each(function(){this.reset();}); 4889 $('#contactform02 .form-group').each(function(){ 4890 if($(this).hasClass('focused')){ 4891 $(this).removeClass('focused'); 4892 } 4893 }); 4894 }, 4895 error: function() { 4896 $('#contactform02').fadeTo( "slow", 1, function() { 4897 $('#error').fadeIn(); 4898 }); 4899 } 4900 }); 4901 } 4902 }); 4903 $('#newsletter-01').validate({ 4904 rules: { 4905 email: { 4906 required: true, 4907 email: true 4908 } 4909 }, 4910 submitHandler: function(form) { 4911 $(form).ajaxSubmit({ 4912 type:"POST", 4913 data: $(form).serialize(), 4914 url:"external/form/newsletter-form.php", 4915 success: function() { 4916 $('#success').fadeIn(); 4917 $('#newsletterform-01').each(function(){this.reset();}); 4918 }, 4919 error: function() { 4920 $('#newsletter-01').fadeTo( "slow", 1, function() { 4921 $('#error').fadeIn(); 4922 }); 4923 } 4924 }); 4925 } 4926 }); 4927}); 4928/* 4929 Accordeon 4930*/ 4931(function($){ 4932 var methods = { 4933 init: function(options){ 4934 return this.each(function(){ 4935 var object = $(this), 4936 objectOpen = object.find('.accordeon__item.is-open'), 4937 objectItemTitle = object.find('.accordeon__item .accordeon__title'); 4938 4939 objectOpen.find('.accordeon__content').slideToggle(100); 4940 4941 objectItemTitle.on('click', function(){ 4942 $(this).next().slideToggle(200).parent().toggleClass('is-open'); 4943 }); 4944 }); 4945 } 4946 }; 4947 $.fn.accordeon = function(action){ 4948 if(methods[action]){ 4949 return methods[action].apply(this, Array.prototype.slice.call(arguments, 1)); 4950 } else if(typeof action === 'object' || !action){ 4951 return methods.init.apply(this, arguments); 4952 } else {
4953 console.info('Action ' +action+ 'not found this plugin'); 4954 return this; 4955 } 4956 }; 4957 var jsAccordeon = $('#mainContent .js-accordeon'); 4958 if(!jsAccordeon.length) return; 4959 jsAccordeon.accordeon(); 4960})(jQuery); 4961 4962(function($){ 4963 var methods = { 4964 init: function(options){ 4965 return this.each(function(){ 4966 var $this = $(this); 4967 methods.alignmen(options, $this); 4968 }); 4969 }, 4970 alignmen: function(options, $this){ 4971 var arrow = $this.find('.slick-arrow'), 4972 arrowHeight = arrow.findHeight(), 4973 obj = $this.find('.' + options.centeringObject), 4974 objHeight = obj.findHeight(); 4975 4976 arrow.css({ 4977 'top' : objHeight - arrowHeight, 4978 'margin-top': '0px' 4979 }).animate({opacity: 1}); 4980 } 4981 }; 4982 $.fn.alignment = function(action){ 4983 if(methods[action]){ 4984 return methods[action].apply(this, Array.prototype.slice.call(arguments, 1)); 4985 } else if(typeof action === 'object' || !action){ 4986 return methods.init.apply(this, arguments); 4987 } else { 4988 console.info('Action ' +action+ 'not found this plugin'); 4989 return this; 4990 } 4991 }; 4992 $.fn.findHeight = function(){ 4993 var $box = $(this), 4994 maxH = $box.eq(0).innerHeight(); 4995 4996 $box.each(function(){ 4997 maxH = ( $(this).innerHeight() > maxH ) ? $(this).innerHeight() : maxH; 4998 }); 4999 5000 return maxH/2; 5001 }; 5002 $(window).resize((function(e){ 5003 setTimeout(function(){ 5004 $('#mainContent .js-align-arrow-award').imagesLoaded().alignment({ 5005 centeringObject: 'award__img' 5006 }); 5007 }, 500); 5008 })).resize(); 5009 function debouncer(func, timeout) { 5010 var timeoutID, timeout = timeout || 500; 5011 return function() { 5012 var scope = this, 5013 args = arguments; 5014 clearTimeout(timeoutID); 5015 timeoutID = setTimeout(function(){ 5016 func.apply(scope, Array.prototype.slice.call(args)); 5017 }, timeout); 5018 } 5019 }; 5020})(jQuery); 5021 5022/* 5023 Animation Number 5024*/ 5025(function($){ 5026 var time = 1, 5027 cc = 1, 5028 $mainContent = $('#mainContent'), 5029 $section = $mainContent.find('.section'); 5030 5031 $(window).on('scroll', function(){ 5032 $section.each(function(){ 5033 var cPos = $(this).offset().top, 5034 topWindow = $(window).scrollTop(); 5035 if(cPos < topWindow + 300){ 5036 if(cc < 2){ 5037 $('.animate-number').addClass("viz").each(function(){ 5038 var 5039 i = 1, 5040 num = $(this).data('num'), 5041 step = 500 * time / num, 5042 that = $(this), 5043 int = setInterval(function(){ 5044 if (i <= num) { 5045 that.html(i); 5046 } 5047 else { 5048 cc= cc+2; 5049 clearInterval(int); 5050 } 5051 i++; 5052 },step); 5053 }); 5054 } 5055 } 5056 }); 5057 }); 5058})(jQuery); 5059 5060/* 5061 Carusel News 5062*/ 5063(function($){ 5064 var $jsCarouselProducts = $('#mainContent .js-carousel-products'); 5065 if ($jsCarouselProducts.length){ 5066 $jsCarouselProducts.slick({ 5067 dots: false, 5068 arrows: true, 5069 infinite: true, 5070 speed: 300, 5071 slidesToShow: 3, 5072 slidesToScroll: 1, 5073 adaptiveHeight: true, 5074 responsive: [ 5075 { 5076 breakpoint: 1025, 5077 settings: { 5078 slidesToShow: 2, 5079 slidesToScroll: 1, 5080 } 5081 }, 5082 { 5083 breakpoint: 576, 5084 settings: { 5085 slidesToShow: 1, 5086 slidesToScroll: 1, 5087 } 5088 } 5089 ] 5090 }); 5091 }; 5092})(jQuery); 5093 5094/* 5095 Carusel Award 5096*/ 5097(function($){ 5098 var $sliderInit = $('#mainContent .js-award-carusel'); 5099 if(!$sliderInit.length) return; 5100 $sliderInit.slick({ 5101 dots: false, 5102 arrows: true, 5103 infinite: true, 5104 speed: 300, 5105 slidesToShow: 4, 5106 slidesToScroll: 1, 5107 adaptiveHeight: true, 5108 responsive: [ 5109 { 5110 breakpoint: 790, 5111 settings: { 5112 slidesToShow: 3, 5113 slidesToScroll: 1, 5114 } 5115 }, 5116 { 5117 breakpoint: 576, 5118 settings: { 5119 slidesToShow: 2, 5120 slidesToScroll: 1, 5121 } 5122 } 5123 ] 5124 }); 5125})(jQuery); 5126 5127/* 5128 Carusel Blockquote 5129*/ 5130(function($){ 5131 var $sliderInit = $('#mainContent .js-carusel-blockquote'), 5132 $slickArrow = $sliderInit.closest('section').find('.slick-arrow-external'), 5133 $sliderArrowLeft = $slickArrow.find('.slick-prev'), 5134 $sliderArrowRight = $slickArrow.find('.slick-next'); 5135 5136 if(!$sliderInit.length) return; 5137 5138 $sliderInit.slick({ 5139 dots: false, 5140 arrows: false, 5141 infinite: true, 5142 speed: 300, 5143 slidesToShow: 1, 5144 slidesToScroll: 1, 5145 adaptiveHeight: true 5146 }); 5147 if ($sliderArrowRight.length){ 5148 $sliderArrowRight.on('click', function(e){ 5149 $sliderInit.slick('slickNext'); 5150 return false;
5151 }); 5152 }; 5153 if ($sliderArrowLeft.length){ 5154 $sliderArrowLeft.on('click', function(e){ 5155 $sliderInit.slick('slickPrev'); 5156 return false; 5157 }); 5158 }; 5159})(jQuery); 5160 5161/* 5162 Slider External Block 5163*/ 5164(function($){ 5165 var $sliderInit = $('#mainContent .js-carusel-external-box'), 5166 $sliderArrow = $('#mainContent .layout-external-box .col-nav-slider'); 5167 5168 if(!$sliderInit.length) return; 5169 $sliderInit.slick({ 5170 infinite: true, 5171 slidesToShow: 1, 5172 slidesToScroll: 1, 5173 arrows: false 5174 }); 5175 if ($sliderArrow.length){ 5176 $sliderArrow.on('click', function(){ 5177 $sliderInit.slick('slickNext'); 5178 }); 5179 }; 5180})(jQuery); 5181 5182/* 5183 Carusel News 5184*/ 5185(function($){ 5186 var $sliderInit = $('#mainContent .js-carusel-news'), 5187 $slickArrow = $sliderInit.closest('section').find('.slick-arrow-extraright'), 5188 $sliderArrowLeft = $slickArrow.find('.slick-prev'), 5189 $sliderArrowRight = $slickArrow.find('.slick-next'); 5190 5191 if(!$sliderInit.length) return; 5192 5193 $sliderInit.slick({ 5194 dots: false, 5195 arrows: false, 5196 infinite: true, 5197 speed: 300, 5198 slidesToShow: 3, 5199 slidesToScroll: 1, 5200 adaptiveHeight: true, 5201 responsive: [ 5202 { 5203 breakpoint: 790, 5204 settings: { 5205 slidesToShow: 2, 5206 slidesToScroll: 1, 5207 } 5208 }, 5209 { 5210 breakpoint: 576, 5211 settings: { 5212 slidesToShow: 1, 5213 slidesToScroll: 1, 5214 } 5215 } 5216 ] 5217 }); 5218 if ($sliderArrowRight.length && $sliderArrowLeft.length){ 5219 $sliderArrowRight.on('click', function(e){ 5220 $sliderInit.slick('slickNext'); 5221 return false; 5222 }); 5223 $sliderArrowLeft.on('click', function(e){ 5224 $sliderInit.slick('slickPrev'); 5225 return false; 5226 }); 5227 }; 5228})(jQuery); 5229 5230/* 5231 Carusel Partners 5232*/ 5233(function($){ 5234 var $sliderInit = $('#mainContent .js-carusel-partners'), 5235 $slickArrowExtraLeft = $(' #mainContent .wrapper-carusel-partners .slick-slick-arrow'), 5236 $sliderArrowLeft = $slickArrowExtraLeft.find('.slick-prev'), 5237 $sliderArrowRight = $slickArrowExtraLeft.find('.slick-next'); 5238 5239 if(!$sliderInit.length) return; 5240 5241 $sliderInit.slick({ 5242 dots: false, 5243 arrows: false, 5244 infinite: true, 5245 speed: 300, 5246 slidesToShow: 4, 5247 slidesToScroll: 1, 5248 adaptiveHeight: true, 5249 responsive: [ 5250 { 5251 breakpoint: 1024, 5252 settings: { 5253 slidesToShow: 3, 5254 slidesToScroll: 1, 5255 } 5256 }, 5257 { 5258 breakpoint: 791, 5259 settings: { 5260 slidesToShow: 2, 5261 slidesToScroll: 1, 5262 } 5263 } 5264 ] 5265 }); 5266 if ($sliderArrowRight.length && $sliderArrowLeft.length){ 5267 $sliderArrowRight.on('click', function(){ 5268 $sliderInit.slick('slickNext'); 5269 }); 5270 $sliderArrowLeft.on('click', function(){ 5271 $sliderInit.slick('slickPrev'); 5272 }); 5273 }; 5274})(jQuery); 5275 5276/* 5277 Carusel Partners 5278*/ 5279(function($){ 5280 var $sliderInit = $('#mainContent .js-presentation-projects'), 5281 $slickArrowExtraLeft = $(' #mainContent .presentation-projects .slick-slick-arrow'), 5282 $sliderArrowLeft = $slickArrowExtraLeft.find('.slick-prev'), 5283 $sliderArrowRight = $slickArrowExtraLeft.find('.slick-next'); 5284 5285 if(!$sliderInit.length) return; 5286 5287 $sliderInit.slick({ 5288 dots: false, 5289 arrows: false, 5290 infinite: true, 5291 speed: 300, 5292 fade: true, 5293 slidesToShow: 1, 5294 slidesToScroll: 1, 5295 adaptiveHeight: true 5296 }); 5297 function contentСentering(){ 5298 setTimeout(function(){ 5299 var $imgHeight = $sliderInit.find('picture img').height(); 5300 $('.col-link-wrapper').height($imgHeight); 5301 }, 310); 5302 }; 5303 contentСentering(); 5304 $(window).resize(function(e){ 5305 contentСentering(); 5306 }); 5307 if ($sliderArrowRight.length && $sliderArrowLeft.length){ 5308 $sliderArrowRight.on('click', function(){ 5309 $sliderInit.slick('slickNext'); 5310 }); 5311 $sliderArrowLeft.on('click', function(){ 5312 $sliderInit.slick('slickPrev'); 5313 }); 5314 }; 5315})(jQuery); 5316 5317/* 5318 Carusel Partners 5319*/ 5320(function($){ 5321 var $sliderInit = $('#mainContent .js-carusel-twocol-fullwidth'), 5322 $slickArrowExtraLeft = $(' #mainContent .wrapper-carusel-partners .slick-slick-arrow'), 5323 $sliderArrowLeft = $slickArrowExtraLeft.find('.slick-prev'), 5324 $sliderArrowRight = $slickArrowExtraLeft.find('.slick-next'); 5325 5326 if(!$sliderInit.length) return; 5327 5328 $sliderInit.slick({ 5329 dots: false, 5330 arrows: false, 5331 infinite: true, 5332 speed: 300, 5333 slidesToShow: 3, 5334 slidesToScroll: 1, 5335 adaptiveHeight: true, 5336 responsive: [ 5337 { 5338 breakpoint: 1024, 5339 settings: { 5340 slidesToShow: 2 5341 } 5342 }, 5343 { 5344 breakpoint: 576, 5345 settings: { 5346 slidesToShow: 1 5347 } 5348 } 5349 ] 5350 }); 5351 if ($sliderArrowRight.length && $sliderArrowLeft.length){ 5352 $sliderArrowRight.on('click', function(){ 5353 $sliderInit.slick('slickNext'); 5354 }); 5355 $sliderArrowLeft.on('click', function(){ 5356 $sliderInit.slick('slickPrev'); 5357 }); 5358 }; 5359})(jQuery); 5360 5361/* 5362 Slider External Block 5363*/ 5364(function($){ 5365 var $sliderInit = $('#mainContent .wrapper-carusel-two-col .js-carusel-two-col'), 5366 $slickArrowExtraLeft = $(' #mainContent .wrapper-carusel-two-col .slick-arrow-extraleft'), 5367 $sliderArrowLeft = $slickArrowExtraLeft.find('.slick-prev'), 5368 $sliderArrowRight = $slickArrowExtraLeft.find('.slick-next'); 5369 5370 if(!$sliderInit.length) return; 5371 $sliderInit.slick({ 5372 dots: false,
5373 arrows: false, 5374 infinite: true, 5375 speed: 300, 5376 slidesToShow: 3, 5377 slidesToScroll: 1, 5378 adaptiveHeight: true, 5379 responsive: [ 5380 { 5381 breakpoint: 791, 5382 settings: { 5383 slidesToShow: 2, 5384 slidesToScroll: 1, 5385 } 5386 }, 5387 { 5388 breakpoint: 576, 5389 settings: { 5390 slidesToShow: 1, 5391 slidesToScroll: 1, 5392 } 5393 } 5394 ] 5395 }); 5396 if ($sliderArrowRight.length && $sliderArrowLeft.length){ 5397 $sliderArrowRight.on('click', function(){ 5398 $sliderInit.slick('slickNext'); 5399 }); 5400 $sliderArrowLeft.on('click', function(){ 5401 $sliderInit.slick('slickPrev'); 5402 }); 5403 }; 5404})(jQuery); 5405 5406/* 5407 Slider External Block 5408*/ 5409(function($){ 5410 var $sliderInit = $('#mainContent .js-caruser-custom'); 5411 if(!$sliderInit.length) return; 5412 $sliderInit.slick({ 5413 dots: true, 5414 arrows: false, 5415 infinite: true, 5416 speed: 300, 5417 slidesToShow: 2, 5418 slidesToScroll: 1, 5419 adaptiveHeight: true, 5420 customPaging: function (slider, i) { 5421 return '<span>' + '0' + (i + 1) + '</span>'; 5422 }, 5423 responsive: [ 5424 { 5425 breakpoint: 576, 5426 settings: { 5427 slidesToShow: 1, 5428 slidesToScroll: 1, 5429 } 5430 } 5431 ] 5432 }); 5433})(jQuery); 5434 5435/* 5436 Slider External Block 5437*/ 5438(function($){ 5439 const init = { 5440 autoplay: false, 5441 infinite: false, 5442 arrows:false, 5443 cssEase: "linear", 5444 slidesToShow: 1, 5445 slidesToScroll: 1 5446 }; 5447 $(() => { 5448 const win = $(window); 5449 const slider = $("#mainContent .js-mobile-slider"); 5450 5451 win.on("load resize", () => { 5452 if (win.width() < 790) { 5453 slider.not(".slick-initialized").slick(init); 5454 } else if (slider.hasClass("slick-initialized")) { 5455 slider.slick("unslick"); 5456 } 5457 }); 5458 }); 5459})(jQuery); 5460 5461 5462/* 5463 Debouncer 5464*/ 5465function debouncer(func, timeout) { 5466 var timeoutID, timeout = timeout || 300; 5467 return function() { 5468 var scope = this, 5469 args = arguments; 5470 clearTimeout(timeoutID); 5471 timeoutID = setTimeout(function() { 5472 func.apply(scope, Array.prototype.slice.call(args)); 5473 }, timeout); 5474 } 5475}; 5476/* 5477 Definition of touch devices 5478*/ 5479(function($){ 5480 function isTouchDevice(){ 5481 return typeof window.ontouchstart !== 'undefined'; 5482 }; 5483 if(isTouchDevice()){ 5484 $('body').addClass('touch').one('click', '#mainContent .block-once', function(event){ 5485 event.preventDefault(); 5486 }); 5487 }; 5488})(jQuery); 5489 5490/* 5491 Footer mobile collapse 5492*/ 5493(function($){ 5494 'use strict' 5495 5496 var footerMobileCollapse = $('#footer .collapse-title:not(.no-collapse)'), 5497 $window = $(window); 5498 if (footerMobileCollapse.length){ 5499 ptFooterCollapse(); 5500 }; 5501 function ptFooterCollapse() { 5502 footerMobileCollapse.on('click',function(e){ 5503 e.preventDefault; 5504 var ptlayout = $(this).next(), 5505 ptwindowWidth = window.innerWidth || $window.width(); 5506 5507 $(this).toggleClass('is-open'); 5508 if(ptlayout.css('display') == 'none' && ptwindowWidth <= 790){ 5509 ptlayout.animate({height: 'show'}, 300); 5510 }else if(ptlayout.css('display') == 'block' && ptwindowWidth <= 790){ 5511 ptlayout.animate({height: 'hide'}, 300); 5512 } 5513 }); 5514 }; 5515 $window.resize(debouncer(function(e){ 5516 if(footerMobileCollapse.length && window.innerWidth || $window.width() <= 790){ 5517 footerMobileCollapse.removeClass('is-open').next().removeAttr('style'); 5518 } 5519 })); 5520})(jQuery); 5521 5522/* 5523 Slick init 5524*/ 5525(function($){ 5526 var $formDefault = $('#mainContent .form-default .form-control:not(select)'); 5527 if($formDefault.length){ 5528 $formDefault.focus(function(){ 5529 $(this).parents('.form-group').addClass('focused'); 5530 }); 5531 5532 $formDefault.blur(function(){ 5533 var inputValue = $(this).val(); 5534 if (inputValue == ""){ 5535 $(this).removeClass('filled'); 5536 $(this).parents('.form-group').removeClass('focused'); 5537 } else { 5538 $(this).addClass('filled'); 5539 }; 5540 }); 5541 }; 5542})(jQuery); 5543 5544/* 5545 Form Init Select 5546*/ 5547(function($){ 5548 'use strict' 5549 var objSelect = $('#mainContent .js-init-select'); 5550 if(!objSelect.length) return; 5551 objSelect.niceSelect(); 5552})(jQuery); 5553 5554/* 5555 Gallery 5556*/ 5557(function($){ 5558 var $window = $(window), 5559 $ttPageContent = $('#mainContent'), 5560 gallery = $ttPageContent.find('.galley-masonry'); 5561 5562 $window.on('load', function(){ 5563 var ttwindowWidth = window.innerWidth || $window.width(); 5564 5565 if (gallery.length){ 5566 initGallery(); 5567 initGalleyPopup(); 5568 }; 5569 }); 5570 function initGallery(){ 5571 var $grid = gallery.find('.tt-portfolio-content').isotope({ 5572 itemSelector: '.element-item', 5573 layoutMode: 'masonry', 5574 }); 5575 $grid.imagesLoaded().progress( function() { 5576 $grid.isotope('layout').addClass('tt-show'); 5577 }); 5578 var ttFilterNav = gallery.find('.filter-nav'); 5579 if (ttFilterNav.length) {
5580 var filterFns = { 5581 ium: function() { 5582 var name = $(this).find('.name').text(); 5583 return name.match(/ium$/); 5584 } 5585 }; 5586 ttFilterNav.on('click', '.button', function() { 5587 var filterValue = $(this).attr('data-filter'); 5588 filterValue = filterFns[filterValue] || filterValue; 5589 $grid.isotope({ 5590 filter: filterValue 5591 }); 5592 $(this).addClass('active').siblings().removeClass('active'); 5593 }); 5594 }; 5595 }; 5596 function initGalleyPopup() { 5597 var objZoom = $ttPageContent.find('.galley-masonry .btn-zomm'); 5598 objZoom.magnificPopup({ 5599 type: 'image', 5600 gallery: { 5601 enabled: true 5602 } 5603 }); 5604 }; 5605})(jQuery); 5606 5607/* 5608 Header Stuck 5609*/ 5610(function($){ 5611 var $topBar = $('#top-bar'), 5612 $window = $(window); 5613 5614 var scroll = $window.scrollTop(); 5615 if (scroll > 20){ 5616 $topBar.addClass("stuck"); 5617 }; 5618 5619 $window.on('scroll', function(){ 5620 var scroll = $window.scrollTop(); 5621 if (scroll > 20){ 5622 $topBar.addClass("stuck"); 5623 } else { 5624 $topBar.removeClass("stuck"); 5625 }; 5626 }); 5627})(jQuery); 5628 5629/* 5630 Header Stuck 5631*/ 5632(function($){ 5633 var subpageHeaderBg = $(".subpage-header__bg"); 5634 5635 if(!subpageHeaderBg.length) return; 5636 5637 scrollSubpage(); 5638 $(window).resize(function(){ 5639 scrollSubpage(); 5640 }); 5641 5642 function scrollSubpage(){ 5643 if (window.innerWidth > 791) { 5644 $(window).on('scroll', function(){ 5645 var yPos = +($(window).scrollTop() / 4), 5646 coords = 'center '+ yPos + 'px'; 5647 subpageHeaderBg.css({ backgroundPosition: coords }); 5648 }); 5649 }; 5650 }; 5651 5652})(jQuery); 5653 5654/* 5655 AOS init 5656*/ 5657AOS.init({ 5658 offset: 100, 5659 duration: 900, 5660 easing: 'ease-out', 5661 delay: 100, 5662 once: true, 5663 disable: 'mobile' 5664}); 5665 5666 5667(function ($){ 5668 var maps = $('#mainContent .googlemap'); 5669 _g_map(); 5670 function _g_map(){ 5671 if( maps.length > 0){ 5672 var apiKey = maps.attr('data-api-key'), 5673 apiURL; 5674 5675 if(apiKey){ 5676 apiURL = 'http://maps.google.com/maps/api/js?key='+ apiKey +' &sensor=false'; 5677 }else{ 5678 apiURL = 'http://maps.google.com/maps/api/js?sensor=false'; 5679 }; 5680 5681 $.getScript( apiURL , function(data, textStatus, jqxhr){ 5682 maps.each(function(){ 5683 var current_map = $(this), 5684 latlng = new google.maps.LatLng(current_map.attr('data-longitude'), 5685 current_map.attr('data-latitude')), 5686 point = current_map.attr('data-marker'), 5687 5688 myOptions = { 5689 zoom: 14, 5690 center: latlng, 5691 mapTypeId: google.maps.MapTypeId.ROADMAP, 5692 mapTypeControl: false, 5693 scrollwheel: false, 5694 draggable: true, 5695 panControl: false, 5696 zoomControl: false, 5697 disableDefaultUI: true 5698 }, 5699 5700 stylez = [ 5701 { 5702 featureType: "all", 5703 elementType: "all", 5704 stylers: [ 5705 { saturation: -100 } // <-- THIS 5706 ] 5707 } 5708 ]; 5709 5710 var map = new google.maps.Map(current_map[0], myOptions); 5711 5712 var mapType = new google.maps.StyledMapType(stylez, { name:"Grayscale" }); 5713 map.mapTypes.set('Grayscale', mapType); 5714 map.setMapTypeId('Grayscale'); 5715 5716 var marker = new google.maps.Marker({ 5717 map: map, 5718 icon: { 5719 size: new google.maps.Size(59,69), 5720 origin: new google.maps.Point(0,0), 5721 anchor: new google.maps.Point(0,69), 5722 url: point 5723 }, 5724 position: latlng 5725 }); 5726 5727 google.maps.event.addDomListener(window, "resize", function(){ 5728 var center = map.getCenter(); 5729 google.maps.event.trigger(map, "resize"); 5730 map.setCenter(center); 5731 }); 5732 }); 5733 }); 5734 }; 5735 }; 5736})(jQuery); 5737/* 5738 Masonry 5739*/ 5740(function($){ 5741 var $mainContent = $('#mainContent'), 5742 masonryLayout01 = $mainContent.find('.masonry-layout-01'), 5743 $window = $(window), 5744 $body = $('body'), 5745 $html = $('html'); 5746 5747 $window.on('load', function(){ 5748 var ptwindowWidth = window.innerWidth || $window.width(); 5749 if (masonryLayout01.length){ 5750 masonry(); 5751 }; 5752 }); 5753 5754 function masonry(){ 5755 var $grid = masonryLayout01.find('.masonry-layout-01-init').isotope({ 5756 itemSelector: '.element-item', 5757 layoutMode: 'masonry', 5758 }); 5759 $grid.imagesLoaded().progress(function(){ 5760 $grid.isotope('layout').addClass('pt-show'); 5761 }); 5762 }; 5763})(jQuery); 5764 5765/* 5766 Slick init 5767*/ 5768(function($){ 5769 var videoPopup = $('.video-popup'); 5770 if(!videoPopup.length) return; 5771 videoPopup.each(function(){ 5772 $(this).magnificPopup({ 5773 type: 'iframe', 5774 iframe: { 5775 patterns: { 5776 dailymotion: { 5777 index: 'dailymotion.com', 5778 id: function(url) { 5779 var m = url.match(/^.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/); 5780 if (m !== null) { 5781 if(m[4] !== undefined){ 5782 return m[4]; 5783 } 5784 return m[2]; 5785 } 5786 return null; 5787 }, 5788 src: 'https://www.dailymotion.com/embed/video/%id%' 5789 } 5790 } 5791 } 5792 }); 5793 }); 5794})(jQuery); 5795 5796(function($){ 5797 $.fn.instafeed = function(new_object){ 5798 var $this = $(this), 5799 $accessToken = $(this).attr('data-accessToken'), 5800 $clientId = $(this).attr('data-clientId'), 5801 $userId = $(this).attr('data-userId'), 5802 $limitImg = $(this).attr('data-limitImg'); 5803 5804 if(!$this.length) return; 5805 var new_object = new_object || {}, 5806 set_object = { 5807 get: 'user', 5808 userId: $userId, 5809 clientId: $clientId, 5810 limit: $limitImg, 5811 sortBy: 'most-liked', 5812 resolution: "standard_resolution", 5813 accessToken: $accessToken, 5814 template: '<a href="{{link}}" target="_blank"><img src="{{image}}" /></a>', 5815 }; 5816 $.extend(set_object, new_object); 5817 var feed = new Instafeed(set_object); 5818 feed.run(); 5819 }; 5820 $('#instafeed').each(function(){ 5821 $(this).instafeed(); 5822 }); 5823})(jQuery); 5824 5825(function($){ 5826 var jsScrollDown = $('#js-scroll-down'), 5827 scrollDownAnchor = $('#scroll-down-anchor'), 5828 $window = $(window); 5829 5830 if (jsScrollDown.length && scrollDownAnchor.length){ 5831 initbacktotop(); 5832 }; 5833 function initbacktotop(){ 5834 jsScrollDown.on('click', function(e){ 5835 $('html, body').animate({ 5836 scrollTop: scrollDownAnchor.offset().top 5837 }, 1000); 5838 return false;
5839 }); 5840 $window.scroll(function(){ 5841 $window.scrollTop() > 500 ? jsScrollDown.stop(true.false).addClass('show') : jsScrollDown.stop(true.false).removeClass('show'); 5842 }); 5843 }; 5844})(jQuery); 5845 5846(function($){ 5847 var ptBackToTop = $('#js-back-to-top'), 5848 $window = $(window); 5849 5850 if (ptBackToTop.length){ 5851 ptBackToTop.on('click', function(e){ 5852 $('html, body').animate({ 5853 scrollTop: 0 5854 }, 500); 5855 return false; 5856 }); 5857 $window.scroll(function(){ 5858 $window.scrollTop() > 750 ? ptBackToTop.stop(true.false).addClass('show') : ptBackToTop.stop(true.false).removeClass('show'); 5859 }); 5860 }; 5861})(jQuery); 5862 5863/* 5864 Main Slider 5865*/ 5866(function($){ 5867 dataBg('[data-bg]'); 5868 function dataBg(el){ 5869 $(el).each(function(){ 5870 var $this = $(this), 5871 bg = $this.attr('data-bg'); 5872 $this.css({ 5873 'background-image': 'url(' + bg + ')' 5874 }); 5875 }); 5876 }; 5877 var mainSlider = $('.mainSlider'); 5878 if (mainSlider.length){ 5879 mainslider(); 5880 }; 5881 function mainslider(){ 5882 var $obj = mainSlider; 5883 $obj.find('.slide').first().imagesLoaded({ 5884 background: true 5885 }, function(){ 5886 setTimeout(function(){ 5887 $obj.parent().find('.loading-content').addClass('disable'); 5888 }, 100); 5889 }); 5890 $obj.on('init', function (e, slick){ 5891 var $firstAnimatingElements = $('div.slide:first-child').find('[data-animation]'); 5892 runAnimation($firstAnimatingElements); 5893 }); 5894 $obj.on('beforeChange', function (e, slick, currentSlide, nextSlide){ 5895 var $currentSlide = $('div.slide[data-slick-index="' + nextSlide + '"]'); 5896 var $animatingElements = $currentSlide.find('[data-animation]'); 5897 runAnimation($animatingElements); 5898 }); 5899 var dataArrow = $obj.data('arrow'), 5900 dataDots = $obj.data('dots'); 5901 $obj.slick({ 5902 arrows: dataArrow || false, 5903 dots: dataDots || false, 5904 autoplay: true, 5905 autoplaySpeed: 5500, 5906 fade: true, 5907 speed: 1000, 5908 pauseOnHover: false, 5909 pauseOnDotsHover: true, 5910 customPaging: function (slider, i) { 5911 return '<span>' + '0' + (i + 1) + '</span>'; 5912 } 5913 }); 5914 }; 5915 function runAnimation(elements){ 5916 var animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'; 5917 elements.each(function(){ 5918 var $this = $(this), 5919 $animationType = 'animated ' + $this.data('animation'), 5920 $animationDelay = $this.data('animation-delay'); 5921 $this.css({ 5922 'animation-delay': $animationDelay, 5923 '-webkit-animation-delay': $animationDelay 5924 }); 5925 $this.addClass($animationType).one(animationEndEvents, function(){ 5926 $this.removeClass($animationType); 5927 }); 5928 if ($this.hasClass('animate')){ 5929 $this.removeClass('animation'); 5930 } 5931 }); 5932 }; 5933 5934 5935 var $allVideos = $("iframe[src^='//player.vimeo.com'], iframe[src^='//www.youtube.com'], object, embed"), 5936 $fluidEl = $("figure"); 5937 5938 $allVideos.each(function() { 5939 5940 $(this) 5941 // jQuery .data does not work on object/embed elements 5942 .attr('data-aspectRatio', this.height / this.width) 5943 .removeAttr('height') 5944 .removeAttr('width'); 5945 5946 }); 5947 5948 $(window).resize(function() { 5949 5950 var newWidth = $fluidEl.width(); 5951 $allVideos.each(function() { 5952 5953 var $el = $(this); 5954 $el 5955 .width(newWidth) 5956 .height(newWidth * $el.attr('data-aspectRatio')); 5957 5958 }); 5959 5960 }).resize(); 5961 5962 5963})(jQuery); 5964 5965/* 5966 Desktop Menu 5967*/ 5968(function($){ 5969 var location = window.location.href, 5970 $desctopMenu = $('#top-bar__navigation'); 5971 5972 if(!$desctopMenu) return; 5973 5974 $desctopMenu.find('li').each(function(){ 5975 var link = $(this).find('a').attr('href'); 5976 5977 if(location.indexOf(link) !== -1){ 5978 $(this).addClass('active').closest('.is-submenu').addClass('active'); 5979 } 5980 if($(this).is(':has(ul)')){ 5981 $(this).addClass('is-submenu'); 5982 } 5983 }); 5984 5985 $desctopMenu.find('ul li').on("mouseenter", function(){ 5986 var $ul = $(this).find('ul:first'); 5987 $(this).find('a:first').addClass('is-hover'); 5988 if ($ul.length){ 5989 var windW = window.innerWidth, 5990 ulW = parseInt($ul.css('width'), 10) + 20, 5991 thisR = this.getBoundingClientRect().right, 5992 thisL = this.getBoundingClientRect().left; 5993 5994 if (windW - thisR < ulW){ 5995 $ul.addClass('right-popup'); 5996 } else if (thisL < ulW){ 5997 $ul.removeClass('right-popup'); 5998 }; 5999 } 6000 }).on('mouseleave', function(){ 6001 $(this).find('a:first').removeClass('is-hover'); 6002 }); 6003})(jQuery); 6004 6005/* 6006 Mobile Menu 6007*/ 6008(function($){ 6009 var $mobileMenu = $('#nav-aside_menu'), 6010 $topBarNavigation = $('#top-bar__navigation > ul'); 6011 6012 if(!$mobileMenu && !$topBarNavigation) return; 6013 6014 var $objBarNavigation = $topBarNavigation.clone(); 6015 $mobileMenu.append($objBarNavigation); 6016 $mobileMenu.find('li').each(function(){ 6017 if($(this).is(':has(ul)')){ 6018 $(this).addClass('is-submenu'); 6019 } 6020 }); 6021 $(document).one('click', '#nav-aside_menu li.is-submenu', function(e){ 6022 $(this).toggleClass('is-open'); 6023 return false;
6024 }); 6025})(jQuery); 6026 6027/* 6028 Navigation Toggler 6029*/ 6030(function($){ 6031 var btnToggle = $('#top-bar__navigation-toggler'); 6032 if(btnToggle.length){ 6033 var $html = $('html'), 6034 $body = $('body'), 6035 $navigationAside = $('#nav-aside'), 6036 $btnClose = $navigationAside.find('.nav-aside__close'); 6037 6038 btnToggle.on('click', function(e){ 6039 e.preventDefault(); 6040 var ttScrollValue = $body.scrollTop() || $html.scrollTop(); 6041 $navigationAside.toggleClass('aside-open').perfectScrollbar(); 6042 $body.css("top", - ttScrollValue).addClass("no-scroll").append('<div class="nav-aside-background"></div>'); 6043 var modalFilter = $('.nav-aside-background').fadeTo('fast',1); 6044 if (modalFilter.length){ 6045 modalFilter.on('click', function(){ 6046 $btnClose.trigger('click'); 6047 }) 6048 } 6049 return false; 6050 }); 6051 $btnClose.on('click', function(e){ 6052 e.preventDefault(); 6053 $navigationAside.removeClass('aside-open').perfectScrollbar('destroy'); 6054 var top = parseInt($body.css("top").replace("px", ""), 10) * -1; 6055 $body.removeAttr("style").removeClass("no-scroll").scrollTop(top); 6056 $html.removeAttr("style").scrollTop(top); 6057 $(".nav-aside-background").off().remove(); 6058 }); 6059 } 6060})(jQuery); 6061 6062/* 6063 Promobox03 Hover 6064*/ 6065(function($){ 6066 var $object = $('#mainContent .promobox03'); 6067 if ($object.length){ 6068 $object.find('.promobox03__show').slideUp('0'); 6069 $('body .promobox03').hover( 6070 function(){ 6071 $(this).find('.promobox03__show').stop().delay(100).slideDown('200'); 6072 }, 6073 function(){ 6074 $(this).find('.promobox03__show').stop().delay(100).slideUp().removeAttr("style"); 6075 } 6076 ); 6077 }; 6078})(jQuery); 6079 6080(function($){ 6081 'use strict' 6082 6083 var $colAside = $('#js-aside-col'), 6084 $collapseAside = $colAside.find('.collapse-aside .collapse-aside__title'); 6085 6086 if(!$colAside && !$collapseAside) return; 6087 6088 (function toggleColAside(){ 6089 $collapseAside.on('click', this, function(e){ 6090 var ptlayout = $(this).next(); 6091 6092 $(this).toggleClass('is-open'); 6093 if(ptlayout.css('display') == 'none'){ 6094 ptlayout.slideToggle(200); 6095 } else if(ptlayout.css('display') == 'block'){ 6096 ptlayout.slideToggle(200); 6097 }; 6098 }); 6099 })(); 6100})(jQuery); 6101 6102(function($){ 6103 'use strict' 6104 6105 var $colorSwitcher = $('#mainContent .menu-aside li'); 6106 6107 if(!$colorSwitcher) return; 6108 6109 (function asideMenu(){ 6110 $colorSwitcher.on('click', this, function(e){ 6111 $(this).addClass('active').siblings().removeClass('active'); 6112 return false; 6113 }); 6114 })(); 6115})(jQuery); 6116 6117/* 6118 Slider Price (shop aside) 6119*/ 6120(function($){ 6121 var $priceSlider = $('#price-slider'); 6122 if ($priceSlider.length){ 6123 $priceSlider.find('.nstSlider').nstSlider({ 6124 "left_grip_selector": ".leftGrip", 6125 "right_grip_selector": ".rightGrip", 6126 "value_bar_selector": ".bar", 6127 "value_changed_callback": function(cause, leftValue, rightValue) { 6128 $(this).parent().find('.leftLabel').text(leftValue); 6129 $(this).parent().find('.rightLabel').text(rightValue); 6130 } 6131 }); 6132 }; 6133})(jQuery); 6134 6135(function($){ 6136 'use strict' 6137 6138 var $colorSwitcher = $('#mainContent .js-color-switcher'); 6139 6140 if(!$colorSwitcher) return; 6141 6142 (function switcherList(){ 6143 $colorSwitcher.find('li').on('click', this, function(e){ 6144 $(this).addClass('active').siblings().removeClass('active'); 6145 return false; 6146 }); 6147 })(); 6148})(jQuery); 6149 6150(function($){ 6151 var $body = $('body'), 6152 $html = $('html'), 6153 $colAside = $('#js-aside-col'), 6154 $btnToggleAside = $('#js-toggle-aside'); 6155 6156 if(!$colAside && !$btnToggleAside) return; 6157 6158 (function toggleColAside(){ 6159 var $btnCloseAside = $colAside.find('.btn-asidecol-close'); 6160 $btnToggleAside.on('click', function(e){ 6161 e.preventDefault(); 6162 var ptScrollValue = $body.scrollTop() || $html.scrollTop(); 6163 $colAside.toggleClass('is-open').perfectScrollbar(); 6164 $body.css("top", - ptScrollValue).addClass("no-scroll").append('<div class="filter-bg"></div>'); 6165 var modalFilter = $('.filter-bg').fadeTo('fast',1); 6166 if (modalFilter.length){ 6167 modalFilter.on('click', function(){ 6168 $btnCloseAside.trigger('click'); 6169 }) 6170 } 6171 return false; 6172 }); 6173 $btnCloseAside.on('click', function(e){ 6174 e.preventDefault(); 6175 $colAside.removeClass('is-open').perfectScrollbar('destroy'); 6176 var top = parseInt($body.css("top").replace("px", ""), 10) * -1; 6177 $body.removeAttr("style").removeClass("no-scroll").scrollTop(top); 6178 $html.removeAttr("style").scrollTop(top); 6179 $(".filter-bg").off().remove(); 6180 }); 6181 })(); 6182})(jQuery); 6183 6184(function($){ 6185 'use strict' 6186 6187 var $counterItem = $('#mainContent .js-counter-item'); 6188
6189 if(!$counterItem.length) return; 6190 6191 $counterItem.on('click', '.minus-btn, .plus-btn', function(){ 6192 var $this = $(this), 6193 $count = $this.siblings(".count"), 6194 delta = $this.hasClass('plus-btn') ? 1 : -1; 6195 $count.val(Math.max(0, parseInt($count.val()) + delta)); 6196 }); 6197})(jQuery); 6198 6199/* 6200 Tabs Default 6201*/ 6202(function($){ 6203 var $navTabs = $('#mainContent .nav-tabs'); 6204 if ($navTabs.length){ 6205 $('body').on('click', '#mainContent .nav-tabs', function(e){ 6206 e.preventDefault(); 6207 $(this).tab('show'); 6208 }); 6209 }; 6210})(jQuery); 6211 6212/* 6213 Shop Slider Product 6214*/ 6215(function($){ 6216 var sliderProduct = $('#mainContent .slider-product'); 6217 if(sliderProduct.length){ 6218 $('body').on('click', '.slider-product .img-small a', function(e){ 6219 e.preventDefault(); 6220 var imgLarge = $(this).closest('.slider-product').find('.img-large img'); 6221 $(this).closest('.item').addClass('active').siblings().removeClass('active'); 6222 imgLarge.hide().attr('src', $(this).attr('href')); 6223 imgLarge.fadeIn(300); 6224 }); 6225 }; 6226})(jQuery); 6227 6228/* 6229 Slick init 6230*/ 6231(function($){ 6232 $('#mainContent [data-slick]').each(function(index, element){ 6233 if($(element).hasClass('slick-initialized')) return; 6234 $(element).slick(); 6235 }); 6236 var $jsCaruselTwoCol = $('#mainContent .js-carusel-two-col'); 6237 if($jsCaruselTwoCol.length) return; 6238 $jsCaruselTwoCol.slick({ 6239 dots: false, 6240 infinite: true, 6241 speed: 300, 6242 slidesToShow: 3, 6243 slidesToScroll: 1, 6244 adaptiveHeight: true 6245 }); 6246})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.