diff --git a/public/js/admin/components.min.js b/public/js/admin/components.min.js index ddc2cfb0..49b45b47 100644 --- a/public/js/admin/components.min.js +++ b/public/js/admin/components.min.js @@ -11,4 +11,4 @@ for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.displ },f.lockSwipeToPrev=function(){f.params.allowSwipeToPrev=!1},f.lockSwipes=function(){f.params.allowSwipeToNext=f.params.allowSwipeToPrev=!1},f.unlockSwipeToNext=function(){f.params.allowSwipeToNext=!0},f.unlockSwipeToPrev=function(){f.params.allowSwipeToPrev=!0},f.unlockSwipes=function(){f.params.allowSwipeToNext=f.params.allowSwipeToPrev=!0},f.params.slidesPerColumn>1&&f.container.addClass("swiper-container-multirow"),f.params.grabCursor&&(f.container[0].style.cursor="move",f.container[0].style.cursor="-webkit-grab",f.container[0].style.cursor="-moz-grab",f.container[0].style.cursor="grab"),f.imagesToLoad=[],f.imagesLoaded=0,f.loadImage=function(e,t,n,r){function i(){r&&r()}var o;e.complete&&n?i():t?(o=new Image,o.onload=i,o.onerror=i,o.src=t):i()},f.preloadImages=function(){function e(){"undefined"!=typeof f&&null!==f&&(void 0!==f.imagesLoaded&&f.imagesLoaded++,f.imagesLoaded===f.imagesToLoad.length&&(f.params.updateOnImagesReady&&f.update(),f.params.onImagesReady&&f.params.onImagesReady(f)))}f.imagesToLoad=f.container.find("img");for(var t=0;t=0&&(t=parseFloat(t.replace("%",""))/100*f.size),f.virtualWidth=-t,f.slides.css(f.rtl?{marginLeft:"",marginTop:""}:{marginRight:"",marginBottom:""});var a;f.params.slidesPerColumn>1&&(a=Math.floor(f.slides.length/f.params.slidesPerColumn)===f.slides.length/f.params.slidesPerColumn?f.slides.length:Math.ceil(f.slides.length/f.params.slidesPerColumn)*f.params.slidesPerColumn);var s;for(e=0;e1){var u,c,d,p,h=f.params.slidesPerColumn;"column"===f.params.slidesPerColumnFill?(c=Math.floor(e/h),d=e-c*h,u=c+d*a/h,l.css({"-webkit-box-ordinal-group":u,"-moz-box-ordinal-group":u,"-ms-flex-order":u,"-webkit-order":u,order:u})):(p=a/h,d=Math.floor(e/p),c=e-d*p),l.css({"margin-top":0!==d&&f.params.spaceBetween&&f.params.spaceBetween+"px"}).attr("data-swiper-column",c).attr("data-swiper-row",d)}"none"!==l.css("display")&&("auto"===f.params.slidesPerView?s=r()?l.outerWidth(!0):l.outerHeight(!0):(s=(f.size-(f.params.slidesPerView-1)*t)/f.params.slidesPerView,r()?f.slides[e].style.width=s+"px":f.slides[e].style.height=s+"px"),f.slides[e].swiperSlideSize=s,f.slidesSizesGrid.push(s),f.params.centeredSlides?(n=n+s/2+i/2+t,0===e&&(n=n-f.size/2-t),Math.abs(n)<.001&&(n=0),o%f.params.slidesPerGroup===0&&f.snapGrid.push(n),f.slidesGrid.push(n)):(o%f.params.slidesPerGroup===0&&f.snapGrid.push(n),f.slidesGrid.push(n),n=n+s+t),f.virtualWidth+=s+t,i=s,o++)}f.virtualWidth=Math.max(f.virtualWidth,f.size);var m;if(f.rtl&&f.wrongRTL&&("slide"===f.params.effect||"coverflow"===f.params.effect)&&f.wrapper.css({width:f.virtualWidth+f.params.spaceBetween+"px"}),f.params.slidesPerColumn>1&&(f.virtualWidth=(s+f.params.spaceBetween)*a,f.virtualWidth=Math.ceil(f.virtualWidth/f.params.slidesPerColumn)-f.params.spaceBetween,f.wrapper.css({width:f.virtualWidth+f.params.spaceBetween+"px"}),f.params.centeredSlides)){for(m=[],e=0;eMath.floor(f.snapGrid[f.snapGrid.length-1])&&f.snapGrid.push(f.virtualWidth-f.size)}0===f.snapGrid.length&&(f.snapGrid=[0]),0!==f.params.spaceBetween&&f.slides.css(r()?f.rtl?{marginLeft:t+"px"}:{marginRight:t+"px"}:{marginBottom:t+"px"}),f.params.watchSlidesProgress&&f.updateSlidesOffset()},f.updateSlidesOffset=function(){for(var e=0;e=0&&s0&&l<=f.size||0>=s&&l>=f.size;u&&f.slides.eq(n).addClass(f.params.slideVisibleClass)}i.progress=f.rtl?-a:a}}},f.updateProgress=function(e){"undefined"==typeof e&&(e=f.translate||0);var t=f.maxTranslate()-f.minTranslate();0===t?(f.progress=0,f.isBeginning=f.isEnd=!0):(f.progress=(e-f.minTranslate())/t,f.isBeginning=f.progress<=0,f.isEnd=f.progress>=1),f.isBeginning&&f.params.onReachBeginning&&f.params.onReachBeginning(f),f.isEnd&&f.params.onReachEnd&&f.params.onReachEnd(f),f.params.watchSlidesProgress&&f.updateSlidesProgress(e),f.params.onProgress&&f.params.onProgress(f,f.progress)},f.updateActiveIndex=function(){var e,t,n,r=f.rtl?f.translate:-f.translate;for(t=0;t=f.slidesGrid[t]&&r=f.slidesGrid[t]&&r=f.slidesGrid[t]&&(e=t);(0>e||"undefined"==typeof e)&&(e=0),n=Math.floor(e/f.params.slidesPerGroup),n>=f.snapGrid.length&&(n=f.snapGrid.length-1),e!==f.activeIndex&&(f.snapIndex=n,f.previousIndex=f.activeIndex,f.activeIndex=e,f.updateClasses())},f.updateClasses=function(){f.slides.removeClass(f.params.slideActiveClass+" "+f.params.slideNextClass+" "+f.params.slidePrevClass);var e=f.slides.eq(f.activeIndex);if(e.addClass(f.params.slideActiveClass),e.next("."+f.params.slideClass).addClass(f.params.slideNextClass),e.prev("."+f.params.slideClass).addClass(f.params.slidePrevClass),f.bullets&&f.bullets.length>0){f.bullets.removeClass(f.params.bulletActiveClass);var t;f.params.loop?(t=f.activeIndex-f.loopedSlides,t>f.slides.length-1-2*f.loopedSlides&&(t-=f.slides.length-2*f.loopedSlides)):t="undefined"!=typeof f.snapIndex?f.snapIndex:f.activeIndex||0,f.bullets.eq(t).addClass(f.params.bulletActiveClass)}f.params.loop||(f.params.prevButton&&(f.isBeginning?h(f.params.prevButton).addClass(f.params.buttonDisabledClass):h(f.params.prevButton).removeClass(f.params.buttonDisabledClass)),f.params.nextButton&&(f.isEnd?h(f.params.nextButton).addClass(f.params.buttonDisabledClass):h(f.params.nextButton).removeClass(f.params.buttonDisabledClass)))},f.updatePagination=function(){if(f.params.pagination&&f.paginationContainer&&f.paginationContainer.length>0){for(var e="",t=f.params.loop?f.slides.length-2*f.loopedSlides:f.snapGrid.length,n=0;t>n;n++)e+=f.params.paginationBulletRender?f.params.paginationBulletRender(n,f.params.bulletClass):'';f.paginationContainer.html(e),f.bullets=f.paginationContainer.find("."+f.params.bulletClass)}},f.update=function(e){function t(){r=Math.min(Math.max(f.translate,f.maxTranslate()),f.minTranslate()),f.setWrapperTranslate(r),f.updateActiveIndex(),f.updateClasses()}if(f.updateContainerSize(),f.updateSlidesSize(),f.updateProgress(),f.updatePagination(),f.updateClasses(),f.params.scrollbar&&f.scrollbar&&f.scrollbar.set(),e){var n,r;f.params.freeMode?t():(n="auto"===f.params.slidesPerView&&f.isEnd&&!f.params.centeredSlides?f.slideTo(f.slides.length-1,0,!1,!0):f.slideTo(f.activeIndex,0,!1,!0),n||t())}},f.onResize=function(){if(f.updateContainerSize(),f.updateSlidesSize(),f.updateProgress(),("auto"===f.params.slidesPerView||f.params.freeMode)&&f.updatePagination(),f.params.scrollbar&&f.scrollbar&&f.scrollbar.set(),f.params.freeMode){var e=Math.min(Math.max(f.translate,f.maxTranslate()),f.minTranslate());f.setWrapperTranslate(e),f.updateActiveIndex(),f.updateClasses()}else f.updateClasses(),"auto"===f.params.slidesPerView&&f.isEnd&&!f.params.centeredSlides?f.slideTo(f.slides.length-1,0,!1,!0):f.slideTo(f.activeIndex,0,!1,!0)};var m=["mousedown","mousemove","mouseup"];window.navigator.pointerEnabled?m=["pointerdown","pointermove","pointerup"]:window.navigator.msPointerEnabled&&(m=["MSPointerDown","MSPointerMove","MSPointerUp"]),f.touchEvents={start:f.support.touch||!f.params.simulateTouch?"touchstart":m[0],move:f.support.touch||!f.params.simulateTouch?"touchmove":m[1],end:f.support.touch||!f.params.simulateTouch?"touchend":m[2]},(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&("container"===f.params.touchEventsTarget?f.container:f.wrapper).addClass("swiper-wp8-"+f.params.direction),f.events=function(e){var t=e?"off":"on",r=e?"removeEventListener":"addEventListener",i="container"===f.params.touchEventsTarget?f.container[0]:f.wrapper[0],o=f.support.touch?i:document,a=f.params.nested?!0:!1;f.browser.ie?(i[r](f.touchEvents.start,f.onTouchStart,!1),o[r](f.touchEvents.move,f.onTouchMove,a),o[r](f.touchEvents.end,f.onTouchEnd,!1)):(f.support.touch&&(i[r](f.touchEvents.start,f.onTouchStart,!1),i[r](f.touchEvents.move,f.onTouchMove,a),i[r](f.touchEvents.end,f.onTouchEnd,!1)),!n.simulateTouch||f.device.ios||f.device.android||(i[r]("mousedown",f.onTouchStart,!1),o[r]("mousemove",f.onTouchMove,a),o[r]("mouseup",f.onTouchEnd,!1))),window[r]("resize",f.onResize),f.params.nextButton&&h(f.params.nextButton)[t]("click",f.onClickNext),f.params.prevButton&&h(f.params.prevButton)[t]("click",f.onClickPrev),f.params.pagination&&f.params.paginationClickable&&h(f.paginationContainer)[t]("click","."+f.params.bulletClass,f.onClickIndex),(f.params.preventClicks||f.params.preventClicksPropagation)&&i[r]("click",f.preventClicks,!0)},f.attachEvents=function(){f.events()},f.detachEvents=function(){f.events(!0)},f.allowClick=!0,f.preventClicks=function(e){f.allowClick||(f.params.preventClicks&&e.preventDefault(),f.params.preventClicksPropagation&&(e.stopPropagation(),e.stopImmediatePropagation()))},f.onClickNext=function(e){e.preventDefault(),f.slideNext()},f.onClickPrev=function(e){e.preventDefault(),f.slidePrev()},f.onClickIndex=function(e){e.preventDefault();var t=h(this).index()*f.params.slidesPerGroup;f.params.loop&&(t+=f.loopedSlides),f.slideTo(t)},f.updateClickedSlide=function(e){var t=o(e,"."+f.params.slideClass);if(!t)return f.clickedSlide=void 0,void(f.clickedIndex=void 0);if(f.clickedSlide=t,f.clickedIndex=h(t).index(),f.params.slideToClickedSlide&&void 0!==f.clickedIndex&&f.clickedIndex!==f.activeIndex){var n,r=f.clickedIndex;if(f.params.loop)if(n=h(f.clickedSlide).attr("data-swiper-slide-index"),r>f.slides.length-f.params.slidesPerView)f.fixLoop(),r=f.wrapper.children("."+f.params.slideClass+'[data-swiper-slide-index="'+n+'"]').eq(0).index(),setTimeout(function(){f.slideTo(r)},0);else if(r0&&(x=!1),"touchstart"!==e.type){var t=!0;h(e.target).is(T)&&(t=!1),document.activeElement&&h(document.activeElement).is(T)&&document.activeElement.blur(),t&&e.preventDefault()}f.params.onTouchStart&&f.params.onTouchStart(f,e)}}},f.onTouchMove=function(e){if(e.originalEvent&&(e=e.originalEvent),!(A&&"mousemove"===e.type||e.preventedByNestedSwiper)){if(f.params.onlyExternal)return v=!0,void(f.allowClick=!1);if(A&&document.activeElement&&e.target===document.activeElement&&h(e.target).is(T))return v=!0,void(f.allowClick=!1);if(f.params.onTouchMove&&f.params.onTouchMove(f,e),f.allowClick=!1,!(e.targetTouches&&e.targetTouches.length>1)){if(f.touches.currentX="touchmove"===e.type?e.targetTouches[0].pageX:e.pageX,f.touches.currentY="touchmove"===e.type?e.targetTouches[0].pageY:e.pageY,"undefined"==typeof $){var t=180*Math.atan2(Math.abs(f.touches.currentY-f.touches.startY),Math.abs(f.touches.currentX-f.touches.startX))/Math.PI;$=r()?t>f.params.touchAngle:90-t>f.params.touchAngle}if($&&f.params.onTouchMoveOpposite&&f.params.onTouchMoveOpposite(f,e),g){if($)return void(g=!1);f.params.onSliderMove&&f.params.onSliderMove(f,e),e.preventDefault(),f.params.touchMoveStopPropagation&&!f.params.nested&&e.stopPropagation(),v||(n.loop&&f.fixLoop(),b="cube"===f.params.effect?(f.rtl?-f.translate:f.translate)||0:f.getWrapperTranslate(),f.setWrapperTransition(0),f.animating&&f.wrapper.trigger("webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd msTransitionEnd"),f.params.autoplay&&f.autoplaying&&(f.params.autoplayDisableOnInteraction?f.stopAutoplay():f.pauseAutoplay()),S=!1,f.params.grabCursor&&(f.container[0].style.cursor="move",f.container[0].style.cursor="-webkit-grabbing",f.container[0].style.cursor="-moz-grabbin",f.container[0].style.cursor="grabbing")),v=!0;var i=f.touches.diff=r()?f.touches.currentX-f.touches.startX:f.touches.currentY-f.touches.startY;i*=f.params.touchRatio,f.rtl&&(i=-i),f.swipeDirection=i>0?"prev":"next",w=i+b;var o=!0;if(i>0&&w>f.minTranslate()?(o=!1,f.params.resistance&&(w=f.minTranslate()-1+Math.pow(-f.minTranslate()+b+i,f.params.resistanceRatio))):0>i&&ww&&(w=b),!f.params.allowSwipeToPrev&&"prev"===f.swipeDirection&&w>b&&(w=b),f.params.followFinger){if(f.params.threshold>0){if(!(Math.abs(i)>f.params.threshold||x))return void(w=b);if(!x)return x=!0,f.touches.startX=f.touches.currentX,f.touches.startY=f.touches.currentY,w=b,void(f.touches.diff=r()?f.touches.currentX-f.touches.startX:f.touches.currentY-f.touches.startY)}(f.params.freeMode||f.params.watchSlidesProgress)&&f.updateActiveIndex(),f.params.freeMode&&(0===k.length&&k.push({position:f.touches[r()?"startX":"startY"],time:y}),k.push({position:f.touches[r()?"currentX":"currentY"],time:(new Date).getTime()})),f.updateProgress(w),f.setWrapperTranslate(w)}}}}},f.onTouchEnd=function(e){if(e.originalEvent&&(e=e.originalEvent),f.params.onTouchEnd&&f.params.onTouchEnd(f,e),g){f.params.grabCursor&&v&&g&&(f.container[0].style.cursor="move",f.container[0].style.cursor="-webkit-grab",f.container[0].style.cursor="-moz-grab",f.container[0].style.cursor="grab");var t=Date.now(),n=t-y;if(f.allowClick&&(f.updateClickedSlide(e),f.params.onTap&&f.params.onTap(f,e),300>n&&t-E>300&&(C&&clearTimeout(C),C=setTimeout(function(){f&&(f.params.paginationHide&&f.paginationContainer.length>0&&!h(e.target).hasClass(f.params.bulletClass)&&f.paginationContainer.toggleClass(f.params.paginationHiddenClass),f.params.onClick&&f.params.onClick(f,e))},300)),300>n&&300>t-E&&(C&&clearTimeout(C),f.params.onDoubleTap&&f.params.onDoubleTap(f,e))),E=Date.now(),setTimeout(function(){f&&f.allowClick&&(f.allowClick=!0)},0),!g||!v||!f.swipeDirection||0===f.touches.diff||w===b)return void(g=v=!1);g=v=!1;var r;if(r=f.params.followFinger?f.rtl?f.translate:-f.translate:-w,f.params.freeMode){if(r<-f.minTranslate())return void f.slideTo(f.activeIndex);if(r>-f.maxTranslate())return void f.slideTo(f.slides.length-1);if(f.params.freeModeMomentum){if(k.length>1){var i=k.pop(),o=k.pop(),a=i.position-o.position,s=i.time-o.time;f.velocity=a/s,f.velocity=f.velocity/2,Math.abs(f.velocity)<.02&&(f.velocity=0),(s>150||(new Date).getTime()-i.time>300)&&(f.velocity=0)}else f.velocity=0;k.length=0;var l=1e3*f.params.freeModeMomentumRatio,u=f.velocity*l,c=f.translate+u;f.rtl&&(c=-c);var d,p=!1,m=20*Math.abs(f.velocity)*f.params.freeModeMomentumBounceRatio;cf.minTranslate()&&(f.params.freeModeMomentumBounce?(c-f.minTranslate()>m&&(c=f.minTranslate()+m),d=f.minTranslate(),p=!0,S=!0):c=f.minTranslate()),0!==f.velocity&&(l=Math.abs(f.rtl?(-c-f.translate)/f.velocity:(c-f.translate)/f.velocity)),f.params.freeModeMomentumBounce&&p?(f.updateProgress(d),f.setWrapperTransition(l),f.setWrapperTranslate(c),f.onTransitionStart(),f.animating=!0,f.wrapper.transitionEnd(function(){S&&(f.params.onMomentumBounce&&f.params.onMomentumBounce(f),f.setWrapperTransition(f.params.speed),f.setWrapperTranslate(d),f.wrapper.transitionEnd(function(){f.onTransitionEnd()}))})):f.velocity?(f.updateProgress(c),f.setWrapperTransition(l),f.setWrapperTranslate(c),f.onTransitionStart(),f.animating||(f.animating=!0,f.wrapper.transitionEnd(function(){f.onTransitionEnd()}))):f.updateProgress(c),f.updateActiveIndex()}return void((!f.params.freeModeMomentum||n>=f.params.longSwipesMs)&&(f.updateProgress(),f.updateActiveIndex()))}var $,x=0,T=f.slidesSizesGrid[0];for($=0;$=f.slidesGrid[$]&&r=f.slidesGrid[$]&&(x=$,T=f.slidesGrid[f.slidesGrid.length-1]-f.slidesGrid[f.slidesGrid.length-2]);var A=(r-f.slidesGrid[x])/T;if(n>f.params.longSwipesMs){if(!f.params.longSwipes)return void f.slideTo(f.activeIndex);"next"===f.swipeDirection&&f.slideTo(A>=f.params.longSwipesRatio?x+f.params.slidesPerGroup:x),"prev"===f.swipeDirection&&f.slideTo(A>1-f.params.longSwipesRatio?x+f.params.slidesPerGroup:x)}else{if(!f.params.shortSwipes)return void f.slideTo(f.activeIndex);"next"===f.swipeDirection&&f.slideTo(x+f.params.slidesPerGroup),"prev"===f.swipeDirection&&f.slideTo(x)}}},f._slideTo=function(e,t){return f.slideTo(e,t,!0,!0)},f.slideTo=function(e,t,n,i){"undefined"==typeof n&&(n=!0),"undefined"==typeof e&&(e=0),0>e&&(e=0),f.snapIndex=Math.floor(e/f.params.slidesPerGroup),f.snapIndex>=f.snapGrid.length&&(f.snapIndex=f.snapGrid.length-1);var o=-f.snapGrid[f.snapIndex];f.params.autoplay&&f.autoplaying&&(i||!f.params.autoplayDisableOnInteraction?f.pauseAutoplay(t):f.stopAutoplay()),f.updateProgress(o);for(var a=0;a=f.slidesGrid[a]&&(e=a);if("undefined"==typeof t&&(t=f.params.speed),f.previousIndex=f.activeIndex||0,f.activeIndex=e,o===f.translate)return f.updateClasses(),!1;f.onTransitionStart(n);r()?o:0,r()?0:o;return 0===t?(f.setWrapperTransition(0),f.setWrapperTranslate(o),f.onTransitionEnd(n)):(f.setWrapperTransition(t),f.setWrapperTranslate(o),f.animating||(f.animating=!0,f.wrapper.transitionEnd(function(){f.onTransitionEnd(n)}))),f.updateClasses(),!0},f.onTransitionStart=function(e){"undefined"==typeof e&&(e=!0),f.lazy&&f.lazy.onTransitionStart(),e&&(f.params.onTransitionStart&&f.params.onTransitionStart(f),f.params.onSlideChangeStart&&f.activeIndex!==f.previousIndex&&f.params.onSlideChangeStart(f))},f.onTransitionEnd=function(e){f.animating=!1,f.setWrapperTransition(0),"undefined"==typeof e&&(e=!0),f.lazy&&f.lazy.onTransitionEnd(),e&&(f.params.onTransitionEnd&&f.params.onTransitionEnd(f),f.params.onSlideChangeEnd&&f.activeIndex!==f.previousIndex&&f.params.onSlideChangeEnd(f))},f.slideNext=function(e,t,n){if(f.params.loop){if(f.animating)return!1;f.fixLoop();{f.container[0].clientLeft}return f.slideTo(f.activeIndex+f.params.slidesPerGroup,t,e,n)}return f.slideTo(f.activeIndex+f.params.slidesPerGroup,t,e,n)},f._slideNext=function(e){return f.slideNext(!0,e,!0)},f.slidePrev=function(e,t,n){if(f.params.loop){if(f.animating)return!1;f.fixLoop();{f.container[0].clientLeft}return f.slideTo(f.activeIndex-1,t,e,n)}return f.slideTo(f.activeIndex-1,t,e,n)},f._slidePrev=function(e){return f.slidePrev(!0,e,!0)},f.slideReset=function(e,t){return f.slideTo(f.activeIndex,t,e)},f.setWrapperTransition=function(e,t){f.wrapper.transition(e),f.params.onSetTransition&&f.params.onSetTransition(f,e),"slide"!==f.params.effect&&f.effects[f.params.effect]&&f.effects[f.params.effect].setTransition(e),f.params.parallax&&f.parallax&&f.parallax.setTransition(e),f.params.scrollbar&&f.scrollbar&&f.scrollbar.setTransition(e),f.params.control&&f.controller&&f.controller.setTransition(e,t)},f.setWrapperTranslate=function(e,t,n){var i=0,o=0,a=0;r()?i=f.rtl?-e:e:o=e,f.wrapper.transform(f.support.transforms3d?"translate3d("+i+"px, "+o+"px, "+a+"px)":"translate("+i+"px, "+o+"px)"),f.translate=r()?i:o,t&&f.updateActiveIndex(),"slide"!==f.params.effect&&f.effects[f.params.effect]&&f.effects[f.params.effect].setTranslate(f.translate),f.params.parallax&&f.parallax&&f.parallax.setTranslate(f.translate),f.params.scrollbar&&f.scrollbar&&f.scrollbar.setTranslate(f.translate),f.params.control&&f.controller&&f.controller.setTranslate(f.translate,n),f.params.hashnav&&f.hashnav&&f.hashnav.setHash(),f.params.onSetTranslate&&f.params.onSetTranslate(f,f.translate)},f.getTranslate=function(e,t){var n,r,i,o;return"undefined"==typeof t&&(t="x"),i=window.getComputedStyle(e,null),window.WebKitCSSMatrix?o=new WebKitCSSMatrix("none"===i.webkitTransform?"":i.webkitTransform):(o=i.MozTransform||i.OTransform||i.MsTransform||i.msTransform||i.transform||i.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),n=o.toString().split(",")),"x"===t&&(r=window.WebKitCSSMatrix?o.m41:parseFloat(16===n.length?n[12]:n[4])),"y"===t&&(r=window.WebKitCSSMatrix?o.m42:parseFloat(16===n.length?n[13]:n[5])),f.rtl&&r&&(r=-r),r||0},f.getWrapperTranslate=function(e){return"undefined"==typeof e&&(e=r()?"x":"y"),f.getTranslate(f.wrapper[0],e)},f.observers=[],f.initObservers=function(){if(f.params.observeParents)for(var e=f.container.parents(),t=0;te.length&&(f.loopedSlides=e.length);var t,n=[],r=[];for(e.each(function(t,i){var o=h(this);t=e.length-f.loopedSlides&&n.push(i),o.attr("data-swiper-slide-index",t)}),t=0;t=0;t--)f.wrapper.prepend(h(n[t].cloneNode(!0)).addClass(f.params.slideDuplicateClass))},f.destroyLoop=function(){f.wrapper.children("."+f.params.slideClass+"."+f.params.slideDuplicateClass).remove()},f.fixLoop=function(){var e;f.activeIndex=2*f.loopedSlides||f.activeIndex>f.slides.length-2*f.params.slidesPerView)&&(e=-f.slides.length+f.activeIndex+f.loopedSlides,e+=f.loopedSlides,f.slideTo(e,0,!1,!0))},f.appendSlide=function(e){if(f.params.loop&&f.destroyLoop(),"object"==typeof e&&e.length)for(var t=0;tt&&n--;n=Math.max(n,0)}else t=e,f.slides[t]&&f.slides.eq(t).remove(),n>t&&n--,n=Math.max(n,0);f.params.observer&&f.support.observer||f.update(!0),f.slideTo(n,0,!1)},f.removeAllSlides=function(){for(var e=[],t=0;t'),f.wrapper.append(e)),e.css({height:f.width+"px"})):(e=f.container.find(".swiper-cube-shadow"),0===e.length&&(e=h('
'),f.container.append(e))));for(var n=0;n=s&&s>-1&&(t=90*n+90*s,f.rtl&&(t=90*-n-90*s)),i.transform(d),f.params.cube.slideShadows){var p=i.find(r()?".swiper-slide-shadow-left":".swiper-slide-shadow-top"),m=i.find(r()?".swiper-slide-shadow-right":".swiper-slide-shadow-bottom");0===p.length&&(p=h('
'),i.append(p)),0===m.length&&(m=h('
'),i.append(m));{i[0].progress}p.length&&(p[0].style.opacity=-i[0].progress),m.length&&(m[0].style.opacity=i[0].progress)}}if(f.wrapper.css({"-webkit-transform-origin":"50% 50% -"+f.size/2+"px","-moz-transform-origin":"50% 50% -"+f.size/2+"px","-ms-transform-origin":"50% 50% -"+f.size/2+"px","transform-origin":"50% 50% -"+f.size/2+"px"}),f.params.cube.shadow)if(r())e.transform("translate3d(0px, "+(f.width/2+f.params.cube.shadowOffset)+"px, "+-f.width/2+"px) rotateX(90deg) rotateZ(0deg) scale("+f.params.cube.shadowScale+")");else{var g=Math.abs(t)-90*Math.floor(Math.abs(t)/90),v=1.5-(Math.sin(2*g*Math.PI/360)/2+Math.cos(2*g*Math.PI/360)/2),y=f.params.cube.shadowScale,$=f.params.cube.shadowScale/v,w=f.params.cube.shadowOffset;e.transform("scale3d("+y+", 1, "+$+") translate3d(0px, "+(f.height/2+w)+"px, "+-f.height/2/$+"px) rotateX(-90deg)")}var b=f.isSafari||f.isUiWebView?-f.size/2:0;f.wrapper.transform("translate3d(0px,0,"+b+"px) rotateX("+(r()?0:t)+"deg) rotateY("+(r()?-t:0)+"deg)")},setTransition:function(e){f.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),f.params.cube.shadow&&!r()&&f.container.find(".swiper-cube-shadow").transition(e)}},coverflow:{setTranslate:function(){for(var e=f.translate,t=r()?-e+f.width/2:-e+f.height/2,n=r()?f.params.coverflow.rotate:-f.params.coverflow.rotate,i=f.params.coverflow.depth,o=0,a=f.slides.length;a>o;o++){var s=f.slides.eq(o),l=f.slidesSizesGrid[o],u=s[0].swiperSlideOffset,c=(t-u-l/2)/l*f.params.coverflow.modifier,d=r()?n*c:0,p=r()?0:n*c,m=-i*Math.abs(c),g=r()?0:f.params.coverflow.stretch*c,v=r()?f.params.coverflow.stretch*c:0;Math.abs(v)<.001&&(v=0),Math.abs(g)<.001&&(g=0),Math.abs(m)<.001&&(m=0),Math.abs(d)<.001&&(d=0),Math.abs(p)<.001&&(p=0);var y="translate3d("+v+"px,"+g+"px,"+m+"px) rotateX("+p+"deg) rotateY("+d+"deg)";if(s.transform(y),s[0].style.zIndex=-Math.abs(Math.round(c))+1,f.params.coverflow.slideShadows){var $=s.find(r()?".swiper-slide-shadow-left":".swiper-slide-shadow-top"),w=s.find(r()?".swiper-slide-shadow-right":".swiper-slide-shadow-bottom");0===$.length&&($=h('
'),s.append($)),0===w.length&&(w=h('
'),s.append(w)),$.length&&($[0].style.opacity=c>0?c:0),w.length&&(w[0].style.opacity=-c>0?-c:0)}}if(window.navigator.pointerEnabled||window.navigator.msPointerEnabled){var b=f.wrapper.style;b.perspectiveOrigin=t+"px 50%"}},setTransition:function(e){f.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e)}}},f.lazy={initialImageLoaded:!1,loadImageInSlide:function(e){if("undefined"!=typeof e&&0!==f.slides.length){var t=f.slides.eq(e),n=t.find("img.swiper-lazy:not(.swiper-lazy-loaded):not(.swiper-lazy-loading)");0!==n.length&&n.each(function(){var e=h(this);e.addClass("swiper-lazy-loading");var n=e.attr("data-src");f.loadImage(e[0],n,!1,function(){e.attr("src",n),e.removeAttr("data-src"),e.addClass("swiper-lazy-loaded").removeClass("swiper-lazy-loading"),t.find(".swiper-lazy-preloader, .preloader").remove(),f.params.onLazyImageLoaded&&f.params.onLazyImageLoaded(f,t[0],e[0])}),f.params.onLazyImageLoad&&f.params.onLazyImageLoad(f,t[0],e[0])})}},load:function(){if(f.params.watchSlidesVisibility)f.wrapper.children("."+f.params.slideVisibleClass).each(function(){f.lazy.loadImageInSlide(h(this).index())});else if(f.params.slidesPerView>1)for(var e=f.activeIndex;e0&&f.lazy.loadImageInSlide(t.index());var n=f.wrapper.children("."+f.params.slidePrevClass);n.length>0&&f.loadImageInSlide(n.index())}},onTransitionStart:function(){f.params.lazyLoading&&(f.params.lazyLoadingOnTransitionStart||!f.params.lazyLoadingOnTransitionStart&&!f.lazy.initialImageLoaded)&&(f.lazy.initialImageLoaded=!0,f.lazy.load())},onTransitionEnd:function(){f.params.lazyLoading&&!f.params.lazyLoadingOnTransitionStart&&f.lazy.load()}},f.scrollbar={set:function(){if(f.params.scrollbar){var e=f.scrollbar;e.track=h(f.params.scrollbar),e.drag=e.track.find(".swiper-scrollbar-drag"),0===e.drag.length&&(e.drag=h('
'),e.track.append(e.drag)),e.drag[0].style.width="",e.drag[0].style.height="",e.trackSize=r()?e.track[0].offsetWidth:e.track[0].offsetHeight,e.divider=f.size/f.virtualWidth,e.moveDivider=e.divider*(e.trackSize/f.size),e.dragSize=e.trackSize*e.divider,r()?e.drag[0].style.width=e.dragSize+"px":e.drag[0].style.height=e.dragSize+"px",e.track[0].style.display=e.divider>=1?"none":"",f.params.scrollbarHide&&(e.track[0].style.opacity=0) }},setTranslate:function(){if(f.params.scrollbar){var e,t=f.scrollbar,n=(f.translate||0,t.dragSize);e=(t.trackSize-t.dragSize)*f.progress,f.rtl&&r()?(e=-e,e>0?(n=t.dragSize-e,e=0):-e+t.dragSize>t.trackSize&&(n=t.trackSize+e)):0>e?(n=t.dragSize+e,e=0):e+t.dragSize>t.trackSize&&(n=t.trackSize-e),r()?(t.drag.transform("translate3d("+e+"px, 0, 0)"),t.drag[0].style.width=n+"px"):(t.drag.transform("translate3d(0px, "+e+"px, 0)"),t.drag[0].style.height=n+"px"),f.params.scrollbarHide&&(clearTimeout(t.timeout),t.track[0].style.opacity=1,t.timeout=setTimeout(function(){t.track[0].style.opacity=0,t.track.transition(400)},1e3))}},setTransition:function(e){f.params.scrollbar&&f.scrollbar.drag.transition(e)}},f.controller={setTranslate:function(e,t){var n,r,i=f.params.control;if(f.isArray(i))for(var o=0;on;n++){var i=f.slides.eq(n),o=i.attr("data-hash");if(o===e&&!i.hasClass(f.params.slideDuplicateClass)){var a=i.index();f.slideTo(a,t,f.params.runCallbacksOnInit,!0)}}}},setHash:function(){f.hashnav.initialized&&f.params.hashnav&&(document.location.hash=f.slides.eq(f.activeIndex).attr("data-hash")||"")}},f.disableKeyboardControl=function(){h(document).off("keydown",s)},f.enableKeyboardControl=function(){h(document).on("keydown",s)},f._wheelEvent=!1,f._lastWheelScrollTime=(new Date).getTime(),f.params.mousewheelControl){if(void 0!==document.onmousewheel&&(f._wheelEvent="mousewheel"),!f._wheelEvent)try{new WheelEvent("wheel"),f._wheelEvent="wheel"}catch(O){}f._wheelEvent||(f._wheelEvent="DOMMouseScroll")}return f.disableMousewheelControl=function(){return f._wheelEvent?(f.container.off(f._wheelEvent,l),!0):!1},f.enableMousewheelControl=function(){return f._wheelEvent?(f.container.on(f._wheelEvent,l),!0):!1},f.parallax={setTranslate:function(){f.container.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){u(this,f.progress)}),f.slides.each(function(){var e=h(this);e.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){var t=Math.min(Math.max(e[0].progress,-1),1);u(this,t)})})},setTransition:function(e){"undefined"==typeof e&&(e=f.params.speed),f.container.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){var t=h(this),n=parseInt(t.attr("data-swiper-parallax-duration"),10)||e;0===e&&(n=0),t.transition(n)})}},f.init=function(){f.params.loop&&f.createLoop(),f.updateContainerSize(),f.updateSlidesSize(),f.updatePagination(),f.params.scrollbar&&f.scrollbar&&f.scrollbar.set(),"slide"!==f.params.effect&&f.effects[f.params.effect]&&(f.params.loop||f.updateProgress(),f.effects[f.params.effect].setTranslate()),f.params.loop?f.slideTo(f.params.initialSlide+f.loopedSlides,0,f.params.runCallbacksOnInit):(f.slideTo(f.params.initialSlide,0,f.params.runCallbacksOnInit),0===f.params.initialSlide&&(f.parallax&&f.params.parallax&&f.parallax.setTranslate(),f.lazy&&f.params.lazyLoading&&f.lazy.load())),f.attachEvents(),f.params.observer&&f.support.observer&&f.initObservers(),f.params.preloadImages&&!f.params.lazyLoading&&f.preloadImages(),f.params.autoplay&&f.startAutoplay(),f.params.keyboardControl&&f.enableKeyboardControl&&f.enableKeyboardControl(),f.params.mousewheelControl&&f.enableMousewheelControl&&f.enableMousewheelControl(),f.params.hashnav&&f.hashnav&&f.hashnav.init(),f.params.onInit&&f.params.onInit(f)},f.destroy=function(e){f.detachEvents(),f.disconnectObservers(),f.params.keyboardControl&&f.disableKeyboardControl&&f.disableKeyboardControl(),f.params.mousewheelControl&&f.disableMousewheelControl&&f.disableMousewheelControl(),f.params.onDestroy&&f.params.onDestroy(),e!==!1&&(f=null)},f.init(),f}},Swiper.prototype={isSafari:function(){var e=navigator.userAgent.toLowerCase();return e.indexOf("safari")>=0&&e.indexOf("chrome")<0&&e.indexOf("android")<0}(),isUiWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent),isArray:function(e){return"[object Array]"===Object.prototype.toString.apply(e)},browser:{ie:window.navigator.pointerEnabled||window.navigator.msPointerEnabled},device:function(){var e=navigator.userAgent,t=e.match(/(Android);?[\s\/]+([\d.]+)?/),n=e.match(/(iPad).*OS\s([\d_]+)/),r=(e.match(/(iPod)(.*OS\s([\d_]+))?/),!n&&e.match(/(iPhone\sOS)\s([\d_]+)/));return{ios:n||r||n,android:t}}(),support:{touch:window.Modernizr&&Modernizr.touch===!0||function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}(),transforms3d:window.Modernizr&&Modernizr.csstransforms3d===!0||function(){var e=document.createElement("div").style;return"webkitPerspective"in e||"MozPerspective"in e||"OPerspective"in e||"MsPerspective"in e||"perspective"in e}(),flexbox:function(){for(var e=document.createElement("div").style,t="WebkitBox msFlexbox MsFlexbox WebkitFlex MozBox flex".split(" "),n=0;n=0&&s.indexOf(">")>=0){var l="div";for(0===s.indexOf(":~]/)?(n||document).querySelectorAll(t):[document.getElementById(t.split("#")[1])],i=0;i0&&t[0].nodeType)for(i=0;i0?parseFloat(this.css("width")):null},outerWidth:function(e){return this.length>0?e?this[0].offsetWidth+parseFloat(this.css("margin-right"))+parseFloat(this.css("margin-left")):this[0].offsetWidth:null},height:function(){return this[0]===window?window.innerHeight:this.length>0?parseFloat(this.css("height")):null},outerHeight:function(e){return this.length>0?e?this[0].offsetHeight+parseFloat(this.css("margin-top"))+parseFloat(this.css("margin-bottom")):this[0].offsetHeight:null},offset:function(){if(this.length>0){var e=this[0],t=e.getBoundingClientRect(),n=document.body,r=e.clientTop||n.clientTop||0,i=e.clientLeft||n.clientLeft||0,o=window.pageYOffset||e.scrollTop,a=window.pageXOffset||e.scrollLeft;return{top:t.top+o-r,left:t.left+a-i}}return null},css:function(e,t){var n;if(1===arguments.length){if("string"!=typeof e){for(n=0;nr-1?new e([]):0>t?(n=r+t,new e(0>n?[]:[this[n]])):new e([this[t]])},append:function(t){var n,r;for(n=0;n=0;r--)this[n].insertBefore(i.childNodes[r],this[n].childNodes[0])}else if(t instanceof e)for(r=0;r1)for(var i=0;i1)for(var i=0;i0?n?this[0].nextElementSibling&&t(this[0].nextElementSibling).is(n)?[this[0].nextElementSibling]:[]:this[0].nextElementSibling?[this[0].nextElementSibling]:[]:[])},nextAll:function(n){var r=[],i=this[0];if(!i)return new e([]);for(;i.nextElementSibling;){var o=i.nextElementSibling;n?t(o).is(n)&&r.push(o):r.push(o),i=o}return new e(r)},prev:function(n){return new e(this.length>0?n?this[0].previousElementSibling&&t(this[0].previousElementSibling).is(n)?[this[0].previousElementSibling]:[]:this[0].previousElementSibling?[this[0].previousElementSibling]:[]:[])},prevAll:function(n){var r=[],i=this[0];if(!i)return new e([]);for(;i.previousElementSibling;){var o=i.previousElementSibling;n?t(o).is(n)&&r.push(o):r.push(o),i=o}return new e(r)},parent:function(e){for(var n=[],r=0;r-1&&(this.siblings.splice(r,1),this.source.index()0?this.siblings[this.index-1]:null},next:function(){return this.index0?1:-1,t.dirY=0===t.distY?0:t.distY>0?1:-1;var r=Math.abs(t.distX)>Math.abs(t.distY)?1:0;return n?(t.dirAx=r,void(t.moving=!0)):(t.dirAx!==r?(t.distAxX=0,t.distAxY=0):(t.distAxX+=Math.abs(t.distX),0!==t.dirX&&t.dirX!==t.lastDirX&&(t.distAxX=0),t.distAxY+=Math.abs(t.distY),0!==t.dirY&&t.dirY!==t.lastDirY&&(t.distAxY=0)),void(t.dirAx=r))}}}])}(),function(){"use strict";angular.module("ui.tree").controller("TreeController",["$scope","$element","$attrs","treeConfig",function(e,t){this.scope=e,e.$element=t,e.$nodesScope=null,e.$type="uiTree",e.$emptyElm=null,e.$callbacks=null,e.dragEnabled=!0,e.emptyPlaceHolderEnabled=!0,e.maxDepth=0,e.dragDelay=0,e.isEmpty=function(){return e.$nodesScope&&e.$nodesScope.$modelValue&&0===e.$nodesScope.$modelValue.length},e.place=function(t){e.$nodesScope.$element.append(t),e.$emptyElm.remove()},e.resetEmptyElement=function(){0===e.$nodesScope.$modelValue.length&&e.emptyPlaceHolderEnabled?t.append(e.$emptyElm):e.$emptyElm.remove()};var n=function(e,t){for(var r=e.childNodes(),i=0;i0},e.safeApply=function(e){var t=this.$root.$$phase;"$apply"==t||"$digest"==t?e&&"function"==typeof e&&e():this.$apply(e)},e.removeNode=function(t){var n=e.$modelValue.indexOf(t.$modelValue);return n>-1?(e.safeApply(function(){e.$modelValue.splice(n,1)[0]}),t):null},e.insertNode=function(t,n){e.safeApply(function(){e.$modelValue.splice(t,0,n)})},e.childNodes=function(){var t=[];if(e.$modelValue)for(var n=0;n0?e.depth()+t.maxSubDepth()+1>n:!1}}])}(),function(){"use strict";angular.module("ui.tree").controller("TreeNodeController",["$scope","$element","$attrs","treeConfig",function(e,t){this.scope=e,e.$element=t,e.$modelValue=null,e.$parentNodeScope=null,e.$childNodesScope=null,e.$parentNodesScope=null,e.$treeScope=null,e.$handleScope=null,e.$type="uiTreeNode",e.$$apply=!1,e.collapsed=!1,e.init=function(n){var r=n[0];e.$treeScope=n[1]?n[1].scope:null,e.$parentNodeScope=r.scope.$nodeScope,e.$modelValue=r.scope.$modelValue[e.$index],e.$parentNodesScope=r.scope,r.scope.initSubNode(e),t.on("$destroy",function(){r.scope.destroySubNode(e)})},e.index=function(){return e.$parentNodesScope.$modelValue.indexOf(e.$modelValue)},e.dragEnabled=function(){return!(e.$treeScope&&!e.$treeScope.dragEnabled)},e.isSibling=function(t){return e.$parentNodesScope==t.$parentNodesScope},e.isChild=function(t){var n=e.childNodes();return n&&n.indexOf(t)>-1},e.prev=function(){var t=e.index();return t>0?e.siblings()[t-1]:null},e.siblings=function(){return e.$parentNodesScope.childNodes()},e.childNodesCount=function(){return e.childNodes()?e.childNodes().length:0},e.hasChild=function(){return e.childNodesCount()>0},e.childNodes=function(){return e.$childNodesScope&&e.$childNodesScope.$modelValue?e.$childNodesScope.childNodes():null},e.accept=function(t,n){return e.$childNodesScope&&e.$childNodesScope.$modelValue&&e.$childNodesScope.accept(t,n)},e.removeNode=function(){var t=e.remove();return e.$callbacks.removed(t),t},e.remove=function(){return e.$parentNodesScope.removeNode(e)},e.toggle=function(){e.collapsed=!e.collapsed},e.collapse=function(){e.collapsed=!0},e.expand=function(){e.collapsed=!1},e.depth=function(){var t=e.$parentNodeScope;return t?t.depth()+1:1};var n=0,r=function(e){for(var t=0,i=e.childNodes(),o=0;oi&&(i=0),0>a&&(a=0),a+10>v&&(a=v-10),i+10>y&&(i=y-10),m.css({left:i+"px",top:a+"px"});var l=window.pageYOffset||n.document.documentElement.scrollTop,h=l+(window.innerHeight||n.document.clientHeight||n.document.clientHeight);if(h=h&&window.scrollBy(0,10),l>s.pageY&&window.scrollBy(0,-10),t.positionMoved(e,p,c),c)return void(c=!1);if(p.dirAx&&p.distAxX>=u.levelThreshold&&(p.distAxX=0,p.distX>0&&(r=d.prev(),r&&!r.collapsed&&r.accept(o,r.childNodesCount())&&(r.$childNodesScope.$element.append(f),d.moveTo(r.$childNodesScope,r.childNodes(),r.childNodesCount()))),p.distX<0)){var $=d.next();if(!$){var C=d.parentNode();C&&C.$parentNodesScope.accept(o,C.index()+1)&&(C.$element.after(f),d.moveTo(C.$parentNodesScope,C.siblings(),C.index()+1))}}var S,T=(t.offset(m).left-t.offset(f).left>=u.threshold,s.pageX-n.document.body.scrollLeft),E=s.pageY-(window.pageYOffset||n.document.documentElement.scrollTop);angular.isFunction(m.hide)?m.hide():(S=m[0].style.display,m[0].style.display="none"),n.document.elementFromPoint(T,E);var k=angular.element(n.document.elementFromPoint(T,E));if(angular.isFunction(m.show)?m.show():m[0].style.display=S,!p.dirAx){var A,O;O=k.scope();var N=!1;if(!O)return;if("uiTree"==O.$type&&O.dragEnabled&&(N=O.isEmpty()),"uiTreeHandle"==O.$type&&(O=O.$nodeScope),"uiTreeNode"!=O.$type&&!N)return;if(w&&f.parent()[0]!=w.$element[0]&&(w.resetEmptyElement(),w=null),N)w=O,O.$nodesScope.accept(o,0)&&(O.place(f),d.moveTo(O.$nodesScope,O.$nodesScope.childNodes(),0));else if(O.dragEnabled()){k=O.$element;var D=t.offset(k);A=O.horizontal?s.pageX').insertAfter(e(this)).on("click",t);var s={relatedTarget:this};if(o.trigger(r=e.Event("show.bs.dropdown",s)),r.isDefaultPrevented())return;i.trigger("focus").attr("aria-expanded","true"),o.toggleClass("open").trigger("shown.bs.dropdown",s)}return!1}},a.prototype.keydown=function(t){if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)){var r=e(this);if(t.preventDefault(),t.stopPropagation(),!r.is(".disabled, :disabled")){var i=n(r),a=i.hasClass("open");if(!a&&27!=t.which||a&&27==t.which)return 27==t.which&&i.find(o).trigger("focus"),r.trigger("click");var s=" li:not(.disabled):visible a",l=i.find('[role="menu"]'+s+', [role="listbox"]'+s);if(l.length){var u=l.index(t.target);38==t.which&&u>0&&u--,40==t.which&&u .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),i&&i()}var a=r.find("> .active"),s=i&&e.support.transition&&(a.length&&a.hasClass("fade")||!!r.find("> .fade").length);a.length&&s?a.one("bsTransitionEnd",o).emulateTransitionEnd(n.TRANSITION_DURATION):o(),a.removeClass("in")};var r=e.fn.tab;e.fn.tab=t,e.fn.tab.Constructor=n,e.fn.tab.noConflict=function(){return e.fn.tab=r,this};var i=function(n){n.preventDefault(),t.call(e(this),"show")};e(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),+function(e){"use strict";function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(void 0!==e.style[n])return{end:t[n]};return!1}e.fn.emulateTransitionEnd=function(t){var n=!1,r=this;e(this).one("bsTransitionEnd",function(){n=!0});var i=function(){n||e(r).trigger(e.support.transition.end)};return setTimeout(i,t),this},e(function(){e.support.transition=t(),e.support.transition&&(e.event.special.bsTransitionEnd={bindType:e.support.transition.end,delegateType:e.support.transition.end,handle:function(t){return e(t.target).is(this)?t.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),function(e,t){"function"==typeof define&&define.amd?define(["jquery","sifter","microplugin"],t):"object"==typeof exports?module.exports=t(require("jquery"),require("sifter"),require("microplugin")):e.Selectize=t(e.jQuery,e.Sifter,e.MicroPlugin)}(this,function(e,t,n){"use strict";var r=function(e,t){if("string"!=typeof t||t.length){var n="string"==typeof t?new RegExp(t,"i"):t,r=function(e){var t=0;if(3===e.nodeType){var i=e.data.search(n);if(i>=0&&e.data.length>0){var o=e.data.match(n),a=document.createElement("span");a.className="highlight";var s=e.splitText(i),l=(s.splitText(o[0].length),s.cloneNode(!0));a.appendChild(l),s.parentNode.replaceChild(a,s),t=1}}else if(1===e.nodeType&&e.childNodes&&!/(script|style)/i.test(e.tagName))for(var u=0;u/g,">").replace(/"/g,""")},k=function(e){return(e+"").replace(/\$/g,"$$$$")},A={};A.before=function(e,t,n){var r=e[t];e[t]=function(){return n.apply(e,arguments),r.apply(e,arguments)}},A.after=function(e,t,n){var r=e[t];e[t]=function(){var t=r.apply(e,arguments);return n.apply(e,arguments),t}};var O=function(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}},N=function(e,t){var n;return function(){var r=this,i=arguments;window.clearTimeout(n),n=window.setTimeout(function(){e.apply(r,i)},t)}},D=function(e,t,n){var r,i=e.trigger,o={};e.trigger=function(){var n=arguments[0];return-1===t.indexOf(n)?i.apply(e,arguments):void(o[n]=arguments)},n.apply(e,[]),e.trigger=i;for(r in o)o.hasOwnProperty(r)&&i.apply(e,o[r])},M=function(e,t,n,r){e.on(t,n,function(t){for(var n=t.target;n&&n.parentNode!==e[0];)n=n.parentNode;return t.currentTarget=n,r.apply(this,[t])})},P=function(e){var t={};if("selectionStart"in e)t.start=e.selectionStart,t.length=e.selectionEnd-t.start;else if(document.selection){e.focus();var n=document.selection.createRange(),r=document.selection.createRange().text.length;n.moveStart("character",-e.value.length),t.start=n.text.length-r,t.length=r}return t},F=function(e,t,n){var r,i,o={};if(n)for(r=0,i=n.length;i>r;r++)o[n[r]]=e.css(n[r]);else o=e.css();t.css(o)},I=function(t,n){if(!t)return 0;var r=e("").css({position:"absolute",top:-99999,left:-99999,width:"auto",padding:0,whiteSpace:"pre"}).text(t).appendTo("body");F(n,r,["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"]);var i=r.width();return r.remove(),i},L=function(e){var t=null,n=function(n,r){var i,o,a,s,l,u,c,d;n=n||window.event||{},r=r||{},n.metaKey||n.altKey||(r.force||e.data("grow")!==!1)&&(i=e.val(),n.type&&"keydown"===n.type.toLowerCase()&&(o=n.keyCode,a=o>=97&&122>=o||o>=65&&90>=o||o>=48&&57>=o||32===o,o===g||o===m?(d=P(e[0]),d.length?i=i.substring(0,d.start)+i.substring(d.start+d.length):o===m&&d.start?i=i.substring(0,d.start-1)+i.substring(d.start+1):o===g&&"undefined"!=typeof d.start&&(i=i.substring(0,d.start)+i.substring(d.start+1))):a&&(u=n.shiftKey,c=String.fromCharCode(n.keyCode),c=u?c.toUpperCase():c.toLowerCase(),i+=c)),s=e.attr("placeholder"),!i&&s&&(i=s),l=I(i,e)+4,l!==t&&(t=l,e.width(l),e.triggerHandler("resize")))};e.on("keydown keyup update blur",n),n()},_=function(n,r){var i,o,a,s,l=this;s=n[0],s.selectize=l;var u=window.getComputedStyle&&window.getComputedStyle(s,null);if(a=u?u.getPropertyValue("direction"):s.currentStyle&&s.currentStyle.direction,a=a||n.parents("[dir]:first").attr("dir")||"",e.extend(l,{order:0,settings:r,$input:n,tabIndex:n.attr("tabindex")||"",tagType:"select"===s.tagName.toLowerCase()?b:x,rtl:/rtl/i.test(a),eventNS:".selectize"+ ++_.count,highlightedValue:null,isOpen:!1,isDisabled:!1,isRequired:n.is("[required]"),isInvalid:!1,isLocked:!1,isFocused:!1,isInputHidden:!1,isSetup:!1,isShiftDown:!1,isCmdDown:!1,isCtrlDown:!1,ignoreFocus:!1,ignoreBlur:!1,ignoreHover:!1,hasOptions:!1,currentResults:null,lastValue:"",caretPos:0,loading:0,loadedSearches:{},$activeOption:null,$activeItems:[],optgroups:{},options:{},userOptions:{},items:[],renderCache:{},onSearchChange:null===r.loadThrottle?l.onSearchChange:N(l.onSearchChange,r.loadThrottle)}),l.sifter=new t(this.options,{diacritics:r.diacritics}),l.settings.options){for(i=0,o=l.settings.options.length;o>i;i++)l.registerOption(l.settings.options[i]);delete l.settings.options}if(l.settings.optgroups){for(i=0,o=l.settings.optgroups.length;o>i;i++)l.registerOptionGroup(l.settings.optgroups[i]);delete l.settings.optgroups}l.settings.mode=l.settings.mode||(1===l.settings.maxItems?"single":"multi"),"boolean"!=typeof l.settings.hideSelected&&(l.settings.hideSelected="multi"===l.settings.mode),l.initializePlugins(l.settings.plugins),l.setupCallbacks(),l.setupTemplates(),l.setup()};return i.mixin(_),n.mixin(_),e.extend(_.prototype,{setup:function(){var t,n,r,i,a,s,l,u,c,d=this,p=d.settings,f=d.eventNS,h=e(window),m=e(document),g=d.$input;if(l=d.settings.mode,u=g.attr("class")||"",t=e("
").addClass(p.wrapperClass).addClass(u).addClass(l),n=e("
").addClass(p.inputClass).addClass("items").appendTo(t),r=e('').appendTo(n).attr("tabindex",g.is(":disabled")?"-1":d.tabIndex),s=e(p.dropdownParent||t),i=e("
").addClass(p.dropdownClass).addClass(l).hide().appendTo(s),a=e("
").addClass(p.dropdownContentClass).appendTo(i),d.settings.copyClassesToDropdown&&i.addClass(u),t.css({width:g[0].style.width}),d.plugins.names.length&&(c="plugin-"+d.plugins.names.join(" plugin-"),t.addClass(c),i.addClass(c)),(null===p.maxItems||p.maxItems>1)&&d.tagType===b&&g.attr("multiple","multiple"),d.settings.placeholder&&r.attr("placeholder",p.placeholder),!d.settings.splitOn&&d.settings.delimiter){var w=d.settings.delimiter.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");d.settings.splitOn=new RegExp("\\s*"+w+"+\\s*")}g.attr("autocorrect")&&r.attr("autocorrect",g.attr("autocorrect")),g.attr("autocapitalize")&&r.attr("autocapitalize",g.attr("autocapitalize")),d.$wrapper=t,d.$control=n,d.$control_input=r,d.$dropdown=i,d.$dropdown_content=a,i.on("mouseenter","[data-selectable]",function(){return d.onOptionHover.apply(d,arguments)}),i.on("mousedown click","[data-selectable]",function(){return d.onOptionSelect.apply(d,arguments)}),M(n,"mousedown","*:not(input)",function(){return d.onItemSelect.apply(d,arguments)}),L(r),n.on({mousedown:function(){return d.onMouseDown.apply(d,arguments)},click:function(){return d.onClick.apply(d,arguments)}}),r.on({mousedown:function(e){e.stopPropagation()},keydown:function(){return d.onKeyDown.apply(d,arguments)},keyup:function(){return d.onKeyUp.apply(d,arguments)},keypress:function(){return d.onKeyPress.apply(d,arguments)},resize:function(){d.positionDropdown.apply(d,[])},blur:function(){return d.onBlur.apply(d,arguments)},focus:function(){return d.ignoreBlur=!1,d.onFocus.apply(d,arguments)},paste:function(){return d.onPaste.apply(d,arguments)}}),m.on("keydown"+f,function(e){d.isCmdDown=e[o?"metaKey":"ctrlKey"],d.isCtrlDown=e[o?"altKey":"ctrlKey"],d.isShiftDown=e.shiftKey}),m.on("keyup"+f,function(e){e.keyCode===$&&(d.isCtrlDown=!1),e.keyCode===v&&(d.isShiftDown=!1),e.keyCode===y&&(d.isCmdDown=!1)}),m.on("mousedown"+f,function(e){if(d.isFocused){if(e.target===d.$dropdown[0]||e.target.parentNode===d.$dropdown[0])return!1;d.$control.has(e.target).length||e.target===d.$control[0]||d.blur(e.target)}}),h.on(["scroll"+f,"resize"+f].join(" "),function(){d.isOpen&&d.positionDropdown.apply(d,arguments)}),h.on("mousemove"+f,function(){d.ignoreHover=!1}),this.revertSettings={$children:g.children().detach(),tabindex:g.attr("tabindex")},g.attr("tabindex",-1).hide().after(d.$wrapper),e.isArray(p.items)&&(d.setValue(p.items),delete p.items),C&&g.on("invalid"+f,function(e){e.preventDefault(),d.isInvalid=!0,d.refreshState()}),d.updateOriginalInput(),d.refreshItems(),d.refreshState(),d.updatePlaceholder(),d.isSetup=!0,g.is(":disabled")&&d.disable(),d.on("change",this.onChange),g.data("selectize",d),g.addClass("selectized"),d.trigger("initialize"),p.preload===!0&&d.onSearchChange("")},setupTemplates:function(){var t=this,n=t.settings.labelField,r=t.settings.optgroupLabelField,i={optgroup:function(e){return'
'+e.html+"
"},optgroup_header:function(e,t){return'
'+t(e[r])+"
"},option:function(e,t){return'
'+t(e[n])+"
"},item:function(e,t){return'
'+t(e[n])+"
"},option_create:function(e,t){return'
Add '+t(e.input)+"
"}};t.settings.render=e.extend({},i,t.settings.render)},setupCallbacks:function(){var e,t,n={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(e in n)n.hasOwnProperty(e)&&(t=this.settings[n[e]],t&&this.on(e,t))},onClick:function(e){var t=this;t.isFocused||(t.focus(),e.preventDefault())},onMouseDown:function(t){{var n=this,r=t.isDefaultPrevented();e(t.target)}if(n.isFocused){if(t.target!==n.$control_input[0])return"single"===n.settings.mode?n.isOpen?n.close():n.open():r||n.setActiveItem(null),!1}else r||window.setTimeout(function(){n.focus()},0)},onChange:function(){this.$input.trigger("change")},onPaste:function(t){var n=this;n.isFull()||n.isInputHidden||n.isLocked?t.preventDefault():n.settings.splitOn&&setTimeout(function(){for(var t=e.trim(n.$control_input.val()||"").split(n.settings.splitOn),r=0,i=t.length;i>r;r++)n.createItem(t[r])},0)},onKeyPress:function(e){if(this.isLocked)return e&&e.preventDefault();var t=String.fromCharCode(e.keyCode||e.which);return this.settings.create&&"multi"===this.settings.mode&&t===this.settings.delimiter?(this.createItem(),e.preventDefault(),!1):void 0},onKeyDown:function(e){var t=(e.target===this.$control_input[0],this);if(t.isLocked)return void(e.keyCode!==w&&e.preventDefault());switch(e.keyCode){case a:if(t.isCmdDown)return void t.selectAll();break;case l:return void(t.isOpen&&(e.preventDefault(),e.stopPropagation(),t.close()));case h:if(!e.ctrlKey||e.altKey)break;case f:if(!t.isOpen&&t.hasOptions)t.open();else if(t.$activeOption){t.ignoreHover=!0;var n=t.getAdjacentOption(t.$activeOption,1);n.length&&t.setActiveOption(n,!0,!0)}return void e.preventDefault();case d:if(!e.ctrlKey||e.altKey)break;case c:if(t.$activeOption){t.ignoreHover=!0;var r=t.getAdjacentOption(t.$activeOption,-1);r.length&&t.setActiveOption(r,!0,!0)}return void e.preventDefault();case s:return void(t.isOpen&&t.$activeOption&&(t.onOptionSelect({currentTarget:t.$activeOption}),e.preventDefault()));case u:return void t.advanceSelection(-1,e);case p:return void t.advanceSelection(1,e);case w:return t.settings.selectOnTab&&t.isOpen&&t.$activeOption&&(t.onOptionSelect({currentTarget:t.$activeOption}),t.isFull()||e.preventDefault()),void(t.settings.create&&t.createItem()&&e.preventDefault());case m:case g:return void t.deleteSelection(e)}return!t.isFull()&&!t.isInputHidden||(o?e.metaKey:e.ctrlKey)?void 0:void e.preventDefault()},onKeyUp:function(e){var t=this;if(t.isLocked)return e&&e.preventDefault();var n=t.$control_input.val()||"";t.lastValue!==n&&(t.lastValue=n,t.onSearchChange(n),t.refreshOptions(),t.trigger("type",n))},onSearchChange:function(e){var t=this,n=t.settings.load;n&&(t.loadedSearches.hasOwnProperty(e)||(t.loadedSearches[e]=!0,t.load(function(r){n.apply(t,[e,r])})))},onFocus:function(e){var t=this,n=t.isFocused;return t.isDisabled?(t.blur(),e&&e.preventDefault(),!1):void(t.ignoreFocus||(t.isFocused=!0,"focus"===t.settings.preload&&t.onSearchChange(""),n||t.trigger("focus"),t.$activeItems.length||(t.showInput(),t.setActiveItem(null),t.refreshOptions(!!t.settings.openOnFocus)),t.refreshState()))},onBlur:function(e,t){var n=this;if(n.isFocused&&(n.isFocused=!1,!n.ignoreFocus)){if(!n.ignoreBlur&&document.activeElement===n.$dropdown_content[0])return n.ignoreBlur=!0,void n.onFocus(e);var r=function(){n.close(),n.setTextboxValue(""),n.setActiveItem(null),n.setActiveOption(null),n.setCaret(n.items.length),n.refreshState(),(t||document.body).focus(),n.ignoreFocus=!1,n.trigger("blur")};n.ignoreFocus=!0,n.settings.create&&n.settings.createOnBlur?n.createItem(null,!1,r):r()}},onOptionHover:function(e){this.ignoreHover||this.setActiveOption(e.currentTarget,!1)},onOptionSelect:function(t){var n,r,i=this;t.preventDefault&&(t.preventDefault(),t.stopPropagation()),r=e(t.currentTarget),r.hasClass("create")?i.createItem(null,function(){i.settings.closeAfterSelect&&i.close()}):(n=r.attr("data-value"),"undefined"!=typeof n&&(i.lastQuery=null,i.setTextboxValue(""),i.addItem(n),i.settings.closeAfterSelect?i.close():!i.settings.hideSelected&&t.type&&/mouse/.test(t.type)&&i.setActiveOption(i.getOption(n))))},onItemSelect:function(e){var t=this;t.isLocked||"multi"===t.settings.mode&&(e.preventDefault(),t.setActiveItem(e.currentTarget,e))},load:function(e){var t=this,n=t.$wrapper.addClass(t.settings.loadingClass);t.loading++,e.apply(t,[function(e){t.loading=Math.max(t.loading-1,0),e&&e.length&&(t.addOption(e),t.refreshOptions(t.isFocused&&!t.isInputHidden)),t.loading||n.removeClass(t.settings.loadingClass),t.trigger("load",e)}])},setTextboxValue:function(e){var t=this.$control_input,n=t.val()!==e;n&&(t.val(e).triggerHandler("update"),this.lastValue=e)},getValue:function(){return this.tagType===b&&this.$input.attr("multiple")?this.items:this.items.join(this.settings.delimiter)},setValue:function(e,t){var n=t?[]:["change"];D(this,n,function(){this.clear(),this.addItems(e,t)})},setActiveItem:function(t,n){var r,i,o,a,s,l,u,c,d=this;if("single"!==d.settings.mode){if(t=e(t),!t.length)return e(d.$activeItems).removeClass("active"),d.$activeItems=[],void(d.isFocused&&d.showInput());if(r=n&&n.type.toLowerCase(),"mousedown"===r&&d.isShiftDown&&d.$activeItems.length){for(c=d.$control.children(".active:last"),a=Array.prototype.indexOf.apply(d.$control[0].childNodes,[c[0]]),s=Array.prototype.indexOf.apply(d.$control[0].childNodes,[t[0]]),a>s&&(u=a,a=s,s=u),i=a;s>=i;i++)l=d.$control[0].childNodes[i],-1===d.$activeItems.indexOf(l)&&(e(l).addClass("active"),d.$activeItems.push(l));n.preventDefault()}else"mousedown"===r&&d.isCtrlDown||"keydown"===r&&this.isShiftDown?t.hasClass("active")?(o=d.$activeItems.indexOf(t[0]),d.$activeItems.splice(o,1),t.removeClass("active")):d.$activeItems.push(t.addClass("active")[0]):(e(d.$activeItems).removeClass("active"),d.$activeItems=[t.addClass("active")[0]]);d.hideInput(),this.isFocused||d.focus()}},setActiveOption:function(t,n,r){var i,o,a,s,l,u=this;u.$activeOption&&u.$activeOption.removeClass("active"),u.$activeOption=null,t=e(t),t.length&&(u.$activeOption=t.addClass("active"),(n||!S(n))&&(i=u.$dropdown_content.height(),o=u.$activeOption.outerHeight(!0),n=u.$dropdown_content.scrollTop()||0,a=u.$activeOption.offset().top-u.$dropdown_content.offset().top+n,s=a,l=a-i+o,a+o>i+n?u.$dropdown_content.stop().animate({scrollTop:l},r?u.settings.scrollDuration:0):n>a&&u.$dropdown_content.stop().animate({scrollTop:s},r?u.settings.scrollDuration:0)))},selectAll:function(){var e=this;"single"!==e.settings.mode&&(e.$activeItems=Array.prototype.slice.apply(e.$control.children(":not(input)").addClass("active")),e.$activeItems.length&&(e.hideInput(),e.close()),e.focus())},hideInput:function(){var e=this;e.setTextboxValue(""),e.$control_input.css({opacity:0,position:"absolute",left:e.rtl?1e4:-1e4}),e.isInputHidden=!0},showInput:function(){this.$control_input.css({opacity:1,position:"relative",left:0}),this.isInputHidden=!1},focus:function(){var e=this;e.isDisabled||(e.ignoreFocus=!0,e.$control_input[0].focus(),window.setTimeout(function(){e.ignoreFocus=!1,e.onFocus()},0))},blur:function(e){this.$control_input[0].blur(),this.onBlur(null,e)},getScoreFunction:function(e){return this.sifter.getScoreFunction(e,this.getSearchOptions())},getSearchOptions:function(){var e=this.settings,t=e.sortField;return"string"==typeof t&&(t=[{field:t}]),{fields:e.searchField,conjunction:e.searchConjunction,sort:t}},search:function(t){var n,r,i,o=this,a=o.settings,s=this.getSearchOptions();if(a.score&&(i=o.settings.score.apply(this,[t]),"function"!=typeof i))throw new Error('Selectize "score" setting must be a function that returns a function');if(t!==o.lastQuery?(o.lastQuery=t,r=o.sifter.search(t,e.extend(s,{score:i})),o.currentResults=r):r=e.extend(!0,{},o.currentResults),a.hideSelected)for(n=r.items.length-1;n>=0;n--)-1!==o.items.indexOf(T(r.items[n].id))&&r.items.splice(n,1);return r},refreshOptions:function(t){var n,i,o,a,s,l,u,c,d,p,f,h,m,g,v,y;"undefined"==typeof t&&(t=!0);var $=this,w=e.trim($.$control_input.val()),b=$.search(w),x=$.$dropdown_content,C=$.$activeOption&&T($.$activeOption.attr("data-value"));for(a=b.items.length,"number"==typeof $.settings.maxOptions&&(a=Math.min(a,$.settings.maxOptions)),s={},l=[],n=0;a>n;n++)for(u=$.options[b.items[n].id],c=$.render("option",u),d=u[$.settings.optgroupField]||"",p=e.isArray(d)?d:[d],i=0,o=p&&p.length;o>i;i++)d=p[i],$.optgroups.hasOwnProperty(d)||(d=""),s.hasOwnProperty(d)||(s[d]=[],l.push(d)),s[d].push(c);for(this.settings.lockOptgroupOrder&&l.sort(function(e,t){var n=$.optgroups[e].$order||0,r=$.optgroups[t].$order||0;return n-r}),f=[],n=0,a=l.length;a>n;n++)d=l[n],$.optgroups.hasOwnProperty(d)&&s[d].length?(h=$.render("optgroup_header",$.optgroups[d])||"",h+=s[d].join(""),f.push($.render("optgroup",e.extend({},$.optgroups[d],{html:h})))):f.push(s[d].join(""));if(x.html(f.join("")),$.settings.highlight&&b.query.length&&b.tokens.length)for(n=0,a=b.tokens.length;a>n;n++)r(x,b.tokens[n].regex);if(!$.settings.hideSelected)for(n=0,a=$.items.length;a>n;n++)$.getOption($.items[n]).addClass("selected");m=$.canCreate(w),m&&(x.prepend($.render("option_create",{input:w})),y=e(x[0].childNodes[0])),$.hasOptions=b.items.length>0||m,$.hasOptions?(b.items.length>0?(v=C&&$.getOption(C),v&&v.length?g=v:"single"===$.settings.mode&&$.items.length&&(g=$.getOption($.items[0])),g&&g.length||(g=y&&!$.settings.addPrecedence?$.getAdjacentOption(y,1):x.find("[data-selectable]:first"))):g=y,$.setActiveOption(g),t&&!$.isOpen&&$.open()):($.setActiveOption(null),t&&$.isOpen&&$.close())},addOption:function(t){var n,r,i,o=this;if(e.isArray(t))for(n=0,r=t.length;r>n;n++)o.addOption(t[n]);else(i=o.registerOption(t))&&(o.userOptions[i]=!0,o.lastQuery=null,o.trigger("option_add",i,t))},registerOption:function(e){var t=T(e[this.settings.valueField]);return!t||this.options.hasOwnProperty(t)?!1:(e.$order=e.$order||++this.order,this.options[t]=e,t)},registerOptionGroup:function(e){var t=T(e[this.settings.optgroupValueField]);return t?(e.$order=e.$order||++this.order,this.optgroups[t]=e,t):!1},addOptionGroup:function(e,t){t[this.settings.optgroupValueField]=e,(e=this.registerOptionGroup(t))&&this.trigger("optgroup_add",e,t)},removeOptionGroup:function(e){this.optgroups.hasOwnProperty(e)&&(delete this.optgroups[e],this.renderCache={},this.trigger("optgroup_remove",e))},clearOptionGroups:function(){this.optgroups={},this.renderCache={},this.trigger("optgroup_clear")},updateOption:function(t,n){var r,i,o,a,s,l,u,c=this;if(t=T(t),o=T(n[c.settings.valueField]),null!==t&&c.options.hasOwnProperty(t)){if("string"!=typeof o)throw new Error("Value must be set in option data");u=c.options[t].$order,o!==t&&(delete c.options[t],a=c.items.indexOf(t),-1!==a&&c.items.splice(a,1,o)),n.$order=n.$order||u,c.options[o]=n,s=c.renderCache.item,l=c.renderCache.option,s&&(delete s[t],delete s[o]),l&&(delete l[t],delete l[o]),-1!==c.items.indexOf(o)&&(r=c.getItem(t),i=e(c.render("item",n)),r.hasClass("active")&&i.addClass("active"),r.replaceWith(i)),c.lastQuery=null,c.isOpen&&c.refreshOptions(!1)}},removeOption:function(e,t){var n=this;e=T(e);var r=n.renderCache.item,i=n.renderCache.option;r&&delete r[e],i&&delete i[e],delete n.userOptions[e],delete n.options[e],n.lastQuery=null,n.trigger("option_remove",e),n.removeItem(e,t)},clearOptions:function(){var e=this;e.loadedSearches={},e.userOptions={},e.renderCache={},e.options=e.sifter.items={},e.lastQuery=null,e.trigger("option_clear"),e.clear()},getOption:function(e){return this.getElementWithValue(e,this.$dropdown_content.find("[data-selectable]"))},getAdjacentOption:function(t,n){var r=this.$dropdown.find("[data-selectable]"),i=r.index(t)+n;return i>=0&&ir;r++)if(n[r].getAttribute("data-value")===t)return e(n[r]);return e()},getItem:function(e){return this.getElementWithValue(e,this.$control.children())},addItems:function(t,n){for(var r=e.isArray(t)?t:[t],i=0,o=r.length;o>i;i++)this.isPending=o-1>i,this.addItem(r[i],n)},addItem:function(t,n){var r=n?[]:["change"];D(this,r,function(){var r,i,o,a,s,l=this,u=l.settings.mode;return t=T(t),-1!==l.items.indexOf(t)?void("single"===u&&l.close()):void(l.options.hasOwnProperty(t)&&("single"===u&&l.clear(),"multi"===u&&l.isFull()||(r=e(l.render("item",l.options[t])),s=l.isFull(),l.items.splice(l.caretPos,0,t),l.insertAtCaret(r),(!l.isPending||!s&&l.isFull())&&l.refreshState(),l.isSetup&&(o=l.$dropdown_content.find("[data-selectable]"),l.isPending||(i=l.getOption(t),a=l.getAdjacentOption(i,1).attr("data-value"),l.refreshOptions(l.isFocused&&"single"!==u),a&&l.setActiveOption(l.getOption(a))),!o.length||l.isFull()?l.close():l.positionDropdown(),l.updatePlaceholder(),l.trigger("item_add",t,r),l.updateOriginalInput({silent:n}))))) -})},removeItem:function(e,t){var n,r,i,o=this;n="object"==typeof e?e:o.getItem(e),e=T(n.attr("data-value")),r=o.items.indexOf(e),-1!==r&&(n.remove(),n.hasClass("active")&&(i=o.$activeItems.indexOf(n[0]),o.$activeItems.splice(i,1)),o.items.splice(r,1),o.lastQuery=null,!o.settings.persist&&o.userOptions.hasOwnProperty(e)&&o.removeOption(e,t),r0),t.$control_input.data("grow",!n&&!r)},isFull:function(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems},updateOriginalInput:function(e){var t,n,r,i,o=this;if(e=e||{},o.tagType===b){for(r=[],t=0,n=o.items.length;n>t;t++)i=o.options[o.items[t]][o.settings.labelField]||"",r.push('");r.length||this.$input.attr("multiple")||r.push(''),o.$input.html(r.join(""))}else o.$input.val(o.getValue()),o.$input.attr("value",o.$input.val());o.isSetup&&(e.silent||o.trigger("change",o.$input.val()))},updatePlaceholder:function(){if(this.settings.placeholder){var e=this.$control_input;this.items.length?e.removeAttr("placeholder"):e.attr("placeholder",this.settings.placeholder),e.triggerHandler("update",{force:!0})}},open:function(){var e=this;e.isLocked||e.isOpen||"multi"===e.settings.mode&&e.isFull()||(e.focus(),e.isOpen=!0,e.refreshState(),e.$dropdown.css({visibility:"hidden",display:"block"}),e.positionDropdown(),e.$dropdown.css({visibility:"visible"}),e.trigger("dropdown_open",e.$dropdown))},close:function(){var e=this,t=e.isOpen;"single"===e.settings.mode&&e.items.length&&e.hideInput(),e.isOpen=!1,e.$dropdown.hide(),e.setActiveOption(null),e.refreshState(),t&&e.trigger("dropdown_close",e.$dropdown)},positionDropdown:function(){var e=this.$control,t="body"===this.settings.dropdownParent?e.offset():e.position();t.top+=e.outerHeight(!0),this.$dropdown.css({width:e.outerWidth(),top:t.top,left:t.left})},clear:function(e){var t=this;t.items.length&&(t.$control.children(":not(input)").remove(),t.items=[],t.lastQuery=null,t.setCaret(0),t.setActiveItem(null),t.updatePlaceholder(),t.updateOriginalInput({silent:e}),t.refreshState(),t.showInput(),t.trigger("clear"))},insertAtCaret:function(t){var n=Math.min(this.caretPos,this.items.length);0===n?this.$control.prepend(t):e(this.$control[0].childNodes[n]).before(t),this.setCaret(n+1)},deleteSelection:function(t){var n,r,i,o,a,s,l,u,c,d=this;if(i=t&&t.keyCode===m?-1:1,o=P(d.$control_input[0]),d.$activeOption&&!d.settings.hideSelected&&(l=d.getAdjacentOption(d.$activeOption,-1).attr("data-value")),a=[],d.$activeItems.length){for(c=d.$control.children(".active:"+(i>0?"last":"first")),s=d.$control.children(":not(input)").index(c),i>0&&s++,n=0,r=d.$activeItems.length;r>n;n++)a.push(e(d.$activeItems[n]).attr("data-value"));t&&(t.preventDefault(),t.stopPropagation())}else(d.isFocused||"single"===d.settings.mode)&&d.items.length&&(0>i&&0===o.start&&0===o.length?a.push(d.items[d.caretPos-1]):i>0&&o.start===d.$control_input.val().length&&a.push(d.items[d.caretPos]));if(!a.length||"function"==typeof d.settings.onDelete&&d.settings.onDelete.apply(d,[a])===!1)return!1;for("undefined"!=typeof s&&d.setCaret(s);a.length;)d.removeItem(a.pop());return d.showInput(),d.positionDropdown(),d.refreshOptions(!0),l&&(u=d.getOption(l),u.length&&d.setActiveOption(u)),!0},advanceSelection:function(e,t){var n,r,i,o,a,s,l=this;0!==e&&(l.rtl&&(e*=-1),n=e>0?"last":"first",r=P(l.$control_input[0]),l.isFocused&&!l.isInputHidden?(o=l.$control_input.val().length,a=0>e?0===r.start&&0===r.length:r.start===o,a&&!o&&l.advanceCaret(e,t)):(s=l.$control.children(".active:"+n),s.length&&(i=l.$control.children(":not(input)").index(s),l.setActiveItem(null),l.setCaret(e>0?i+1:i))))},advanceCaret:function(e,t){var n,r,i=this;0!==e&&(n=e>0?"next":"prev",i.isShiftDown?(r=i.$control_input[n](),r.length&&(i.hideInput(),i.setActiveItem(r),t&&t.preventDefault())):i.setCaret(i.caretPos+e))},setCaret:function(t){var n=this;if(t="single"===n.settings.mode?n.items.length:Math.max(0,Math.min(n.items.length,t)),!n.isPending){var r,i,o,a;for(o=n.$control.children(":not(input)"),r=0,i=o.length;i>r;r++)a=e(o[r]).detach(),t>r?n.$control_input.before(a):n.$control.append(a)}n.caretPos=t},lock:function(){this.close(),this.isLocked=!0,this.refreshState()},unlock:function(){this.isLocked=!1,this.refreshState()},disable:function(){var e=this;e.$input.prop("disabled",!0),e.$control_input.prop("disabled",!0).prop("tabindex",-1),e.isDisabled=!0,e.lock()},enable:function(){var e=this;e.$input.prop("disabled",!1),e.$control_input.prop("disabled",!1).prop("tabindex",e.tabIndex),e.isDisabled=!1,e.unlock()},destroy:function(){var t=this,n=t.eventNS,r=t.revertSettings;t.trigger("destroy"),t.off(),t.$wrapper.remove(),t.$dropdown.remove(),t.$input.html("").append(r.$children).removeAttr("tabindex").removeClass("selectized").attr({tabindex:r.tabindex}).show(),t.$control_input.removeData("grow"),t.$input.removeData("selectize"),e(window).off(n),e(document).off(n),e(document.body).off(n),delete t.$input[0].selectize},render:function(e,t){var n,r,i="",o=!1,a=this,s=/^[\t \r\n]*<([a-z][a-z0-9\-_]*(?:\:[a-z][a-z0-9\-_]*)?)/i;return("option"===e||"item"===e)&&(n=T(t[a.settings.valueField]),o=!!n),o&&(S(a.renderCache[e])||(a.renderCache[e]={}),a.renderCache[e].hasOwnProperty(n))?a.renderCache[e][n]:(i=a.settings.render[e].apply(this,[t,E]),("option"===e||"option_create"===e)&&(i=i.replace(s,"<$1 data-selectable")),"optgroup"===e&&(r=t[a.settings.optgroupValueField]||"",i=i.replace(s,'<$1 data-group="'+k(E(r))+'"')),("option"===e||"item"===e)&&(i=i.replace(s,'<$1 data-value="'+k(E(n||""))+'"')),o&&(a.renderCache[e][n]=i),i)},clearCache:function(e){var t=this;"undefined"==typeof e?t.renderCache={}:delete t.renderCache[e]},canCreate:function(e){var t=this;if(!t.settings.create)return!1;var n=t.settings.createFilter;return!(!e.length||"function"==typeof n&&!n.apply(t,[e])||"string"==typeof n&&!new RegExp(n).test(e)||n instanceof RegExp&&!n.test(e))}}),_.count=0,_.defaults={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:!1,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,maxOptions:1e3,maxItems:null,hideSelected:null,addPrecedence:!1,selectOnTab:!1,preload:!1,allowEmptyOption:!1,closeAfterSelect:!1,scrollDuration:60,loadThrottle:300,loadingClass:"loading",dataAttr:"data-data",optgroupField:"optgroup",valueField:"value",labelField:"text",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"selectize-control",inputClass:"selectize-input",dropdownClass:"selectize-dropdown",dropdownContentClass:"selectize-dropdown-content",dropdownParent:null,copyClassesToDropdown:!0,render:{}},e.fn.selectize=function(t){var n=e.fn.selectize.defaults,r=e.extend({},n,t),i=r.dataAttr,o=r.labelField,a=r.valueField,s=r.optgroupField,l=r.optgroupLabelField,u=r.optgroupValueField,c={},d=function(t,n){var s,l,u,c,d=t.attr(i);if(d)for(n.options=JSON.parse(d),s=0,l=n.options.length;l>s;s++)n.items.push(n.options[s][a]);else{var p=e.trim(t.val()||"");if(!r.allowEmptyOption&&!p.length)return;for(u=p.split(r.delimiter),s=0,l=u.length;l>s;s++)c={},c[o]=u[s],c[a]=u[s],n.options.push(c);n.items=u}},p=function(t,n){var d,p,f,h,m=n.options,g=function(e){var t=i&&e.attr(i);return"string"==typeof t&&t.length?JSON.parse(t):null},v=function(t,i){t=e(t);var l=T(t.attr("value"));if(l||r.allowEmptyOption)if(c.hasOwnProperty(l)){if(i){var u=c[l][s];u?e.isArray(u)?u.push(i):c[l][s]=[u,i]:c[l][s]=i}}else{var d=g(t)||{};d[o]=d[o]||t.text(),d[a]=d[a]||l,d[s]=d[s]||i,c[l]=d,m.push(d),t.is(":selected")&&n.items.push(l)}},y=function(t){var r,i,o,a,s;for(t=e(t),o=t.attr("label"),o&&(a=g(t)||{},a[l]=o,a[u]=o,n.optgroups.push(a)),s=e("option",t),r=0,i=s.length;i>r;r++)v(s[r],o)};for(n.maxItems=t.attr("multiple")?null:1,h=t.children(),d=0,p=h.length;p>d;d++)f=h[d].tagName.toLowerCase(),"optgroup"===f?y(h[d]):"option"===f&&v(h[d])};return this.each(function(){if(!this.selectize){var i,o=e(this),a=this.tagName.toLowerCase(),s=o.attr("placeholder")||o.attr("data-placeholder");s||r.allowEmptyOption||(s=o.children('option[value=""]').text());var l={placeholder:s,options:[],optgroups:[],items:[]};"select"===a?p(o,l):d(o,l),i=new _(o,e.extend(!0,{},n,l,t))}})},e.fn.selectize.defaults=_.defaults,e.fn.selectize.support={validity:C},_.define("drag_drop",function(){if(!e.fn.sortable)throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');if("multi"===this.settings.mode){var t=this;t.lock=function(){var e=t.lock;return function(){var n=t.$control.data("sortable");return n&&n.disable(),e.apply(t,arguments)}}(),t.unlock=function(){var e=t.unlock;return function(){var n=t.$control.data("sortable");return n&&n.enable(),e.apply(t,arguments)}}(),t.setup=function(){var n=t.setup;return function(){n.apply(this,arguments);var r=t.$control.sortable({items:"[data-value]",forcePlaceholderSize:!0,disabled:t.isLocked,start:function(e,t){t.placeholder.css("width",t.helper.css("width")),r.css({overflow:"visible"})},stop:function(){r.css({overflow:"hidden"});var n=t.$activeItems?t.$activeItems.slice():null,i=[];r.children("[data-value]").each(function(){i.push(e(this).attr("data-value"))}),t.setValue(i),t.setActiveItem(n)}})}}()}}),_.define("dropdown_header",function(t){var n=this;t=e.extend({title:"Untitled",headerClass:"selectize-dropdown-header",titleRowClass:"selectize-dropdown-header-title",labelClass:"selectize-dropdown-header-label",closeClass:"selectize-dropdown-header-close",html:function(e){return'
'+e.title+'×
'}},t),n.setup=function(){var r=n.setup;return function(){r.apply(n,arguments),n.$dropdown_header=e(t.html(t)),n.$dropdown.prepend(n.$dropdown_header)}}()}),_.define("optgroup_columns",function(t){var n=this;t=e.extend({equalizeWidth:!0,equalizeHeight:!0},t),this.getAdjacentOption=function(t,n){var r=t.closest("[data-group]").find("[data-selectable]"),i=r.index(t)+n;return i>=0&&i
',e=e.firstChild,n.body.appendChild(e),t=r.width=e.offsetWidth-e.clientWidth,n.body.removeChild(e)),t},i=function(){var i,o,a,s,l,u,c;if(c=e("[data-group]",n.$dropdown_content),o=c.length,o&&n.$dropdown_content.width()){if(t.equalizeHeight){for(a=0,i=0;o>i;i++)a=Math.max(a,c.eq(i).height());c.css({height:a})}t.equalizeWidth&&(u=n.$dropdown_content.innerWidth()-r(),s=Math.round(u/o),c.css({width:s}),o>1&&(l=u-s*(o-1),c.eq(o-1).css({width:l})))}};(t.equalizeHeight||t.equalizeWidth)&&(A.after(this,"positionDropdown",i),A.after(this,"refreshOptions",i))}),_.define("remove_button",function(t){if("single"!==this.settings.mode){t=e.extend({label:"×",title:"Remove",className:"remove",append:!0},t);var n=this,r=''+t.label+"",i=function(e,t){var n=e.search(/(<\/[^>]+>\s*)$/);return e.substring(0,n)+t+e.substring(n)};this.setup=function(){var o=n.setup;return function(){if(t.append){var a=n.settings.render.item;n.settings.render.item=function(){return i(a.apply(this,arguments),r)}}o.apply(this,arguments),this.$control.on("click","."+t.className,function(t){if(t.preventDefault(),!n.isLocked){var r=e(t.currentTarget).parent();n.setActiveItem(r),n.deleteSelection()&&n.setCaret(n.items.length)}})}}()}}),_.define("restore_on_backspace",function(e){var t=this;e.text=e.text||function(e){return e[this.settings.labelField]},this.onKeyDown=function(){var n=t.onKeyDown;return function(t){var r,i;return t.keyCode===m&&""===this.$control_input.val()&&!this.$activeItems.length&&(r=this.caretPos-1,r>=0&&ro;o++)n=n.replace(new RegExp(r.charAt(o),"g"),i.charAt(o));return n=e.trim(n),n=n.toLowerCase().replace(/[^\w ]+/g,"").replace(/ +/g,"-")}};e.fn.slug=function(n){return t[n]?t[n].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof n&&n?void e.error("Method "+n+" does not exist on jQuery.slug"):t.init.apply(this,arguments)},e("[data-slug]").slug()}(jQuery),"undefined"!=typeof TypiCMS&&$(function(){$.ajaxSetup({headers:{"X-XSRF-TOKEN":TypiCMS.encrypted_token}})}),$(function(){$('[data-toggle="offcanvas"]').click(function(){$(".row-offcanvas").toggleClass("active")})}),$(function(){function e(e,t){var n={};n[e]=t,$.ajax({type:"POST",url:"/admin/users/current/updatepreferences",data:n}).fail(function(){alertify.error("User preference couldn’t be set.")})}$(".panel-collapse").on("hide.bs.collapse",function(){e("menus_"+$(this).attr("id")+"_collapsed","true")}),$(".panel-collapse").on("show.bs.collapse",function(){e("menus_"+$(this).attr("id")+"_collapsed","")})}),$(function(){$(".btn-preview").fancybox({width:1200,type:"iframe"})}),function(e){"use strict";var t=$("html").attr("lang");e.module("typicms",["ngResource","smart-table","gettext","ui.tree"],["$locationProvider",function(){}]),e.module("typicms").run(["gettextCatalog",function(e){e.setCurrentLanguage(t),e.loadRemote("/languages/"+t+".json")}]),e.module("typicms").factory("$api",["$location","$resource",function(e,t){var n=e.absUrl().split("?")[0],r=n.split("/")[4];return"galleries"===r&&"edit"===n.split("/")[6]&&(r="files"),"menus"===r&&"edit"===n.split("/")[6]&&(r="menulinks"),"dashboard"===r&&(r="history"),t("/api/"+r+"/:id",null,{update:{method:"PUT"}})}])}(angular),angular.module("typicms").filter("dateFromMySQL",["dateFilter",function(e){return function(t,n){return t?(t=new Date(t.replace(/-/g,"/")),e(t,n)):void 0}}]),function(e){"use strict";e.module("typicms").controller("ListController",["$http","$scope","$location","$api",function(t,n,r,i){n.itemsByPage=25;var o=r.absUrl().split("?")[0],a=o.split("/")[4],s={};n.TypiCMS=TypiCMS,"galleries"===a&&o.split("/")[5]&&(s.gallery_id=o.split("/")[5]),"menus"===a&&o.split("/")[5]&&(s.menu_id=o.split("/")[5],a="menulinks"),i.query(s).$promise.then(function(e){n.models=e,n.displayedModels=[].concat(n.models)}),n.toggleStatus=function(e){var t=Math.abs(e.status-1),n=["offline","online"];e.status=t,i.update({id:e.id},e).$promise.then(function(){alertify.success("Item is "+n[t]+".")},function(e){alertify.error("Error "+e.status+" "+e.statusText)})},n.toggleHomepage=function(e){e.homepage=Math.abs(e.homepage-1),i.update({id:e.id},e).$promise.then(function(){},function(e){alertify.error("Error "+e.status+" "+e.statusText)})},n.update=function(e){i.update({id:e.id},e).$promise.then(function(){},function(e){alertify.error("Error "+e.status+" "+e.statusText)})},n.selectAndClose=function(e,t){window.opener.CKEDITOR.tools.callFunction(e,t),window.close()},n["delete"]=function(e,t){if(t||(t=e.title),!window.confirm("Supprimer « "+t+" » ?"))return!1;var r=n.models.indexOf(e);i["delete"]({id:e.id},function(){-1!==r&&n.models.splice(r,1)},function(e){alertify.error("Error "+e.status+" "+e.statusText)})},n.deleteFromNested=function(e,t){return t||(t=e.model.title),e.hasChild()?(alertify.error("Cannot delete item because it has children."),!1):window.confirm("Supprimer « "+t+" » ?")?void i["delete"]({id:e.model.id},function(){e.remove()}):!1},n.treeOptions={dragThreshold:0,dropped:function(n){var r=n.source.nodeScope.model,i=null,o={},s=n.dest.nodesScope,l=s.$modelValue;return n.dest.nodesScope.$nodeScope&&(i=s.$nodeScope.model.id),n.dest.index===n.source.index&&r.parent_id===i?!1:(o.moved=r.id,o.item=[],r.position=n.dest.index+1,r.parent_id=i,e.forEach(l,function(e){o.item.push({id:e.id,parent_id:e.parent_id})}),void t.post("/admin/"+a+"/sort",o).success(function(e){alertify.success(e.message)}).error(function(e){alertify.error(e.error.message)}))}}}])}(angular),angular.module("typicms").filter("betterFilter",["filterFilter",function(e){return function(t,n,r){for(var i in n)n[i]=normalize(n[i]);for(var o=angular.copy(t),a=0;a
',n=["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/vnd.openxmlformats-officedocument.presentationml.slide","application/msword","application/vnd.ms-powerpoint","application/vnd.ms-excel","application/pdf","application/zip","image/jpeg","image/gif","image/png"],Dropzone.options.dropzone={url:"/api/files",paramName:"file",clickable:!0,maxFilesize:60,acceptedFiles:n.join(),previewTemplate:t,thumbnailWidth:130,thumbnailHeight:130,init:function(){this.on("success",function(t,n){var r=this;window.setTimeout(function(){$(t.previewElement).fadeOut("fast",function(){r.removeFile(t),e.$apply(function(){e.models.push(n.model)})})},1e3)}),this.on("sending",function(e,t,n){n.append("gallery_id",r),n.append("_token",TypiCMS._token);for(var o=i.length-1;o>=0;o--)n.append(i[o]["short"]+"[description]",""),n.append(i[o]["short"]+"[alt_attribute]",""),n.append(i[o]["short"]+"[keywords]",""),n.append(i[o]["short"]+"[status]",1)})}}}}),angular.module("smart-table").directive("stFilter",["$timeout",function(){return{require:"^stTable",link:{pre:function(e,t,n,r){r.setFilterFunction("betterFilter")}}}}]),angular.module("smart-table").directive("stOrder",["$parse",function(){return{require:"^stTable",link:{pre:function(e,t,n,r){r.setSortFunction("betterOrderBy")}}}}]),angular.module("typicms").directive("typiBtnDelete",function(){return{scope:{action:"&"},template:''}}),angular.module("typicms").directive("typiBtnFiles",function(){return{scope:{model:"="},template:'{{ model.files_count }}'}}),angular.module("typicms").directive("typiBtnStatus",function(){return{scope:{model:"=",action:"&"},template:''}}),angular.module("typicms").directive("typiPagination",function(){return{template:'
'}}); \ No newline at end of file +})},removeItem:function(e,t){var n,r,i,o=this;n="object"==typeof e?e:o.getItem(e),e=T(n.attr("data-value")),r=o.items.indexOf(e),-1!==r&&(n.remove(),n.hasClass("active")&&(i=o.$activeItems.indexOf(n[0]),o.$activeItems.splice(i,1)),o.items.splice(r,1),o.lastQuery=null,!o.settings.persist&&o.userOptions.hasOwnProperty(e)&&o.removeOption(e,t),r0),t.$control_input.data("grow",!n&&!r)},isFull:function(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems},updateOriginalInput:function(e){var t,n,r,i,o=this;if(e=e||{},o.tagType===b){for(r=[],t=0,n=o.items.length;n>t;t++)i=o.options[o.items[t]][o.settings.labelField]||"",r.push('");r.length||this.$input.attr("multiple")||r.push(''),o.$input.html(r.join(""))}else o.$input.val(o.getValue()),o.$input.attr("value",o.$input.val());o.isSetup&&(e.silent||o.trigger("change",o.$input.val()))},updatePlaceholder:function(){if(this.settings.placeholder){var e=this.$control_input;this.items.length?e.removeAttr("placeholder"):e.attr("placeholder",this.settings.placeholder),e.triggerHandler("update",{force:!0})}},open:function(){var e=this;e.isLocked||e.isOpen||"multi"===e.settings.mode&&e.isFull()||(e.focus(),e.isOpen=!0,e.refreshState(),e.$dropdown.css({visibility:"hidden",display:"block"}),e.positionDropdown(),e.$dropdown.css({visibility:"visible"}),e.trigger("dropdown_open",e.$dropdown))},close:function(){var e=this,t=e.isOpen;"single"===e.settings.mode&&e.items.length&&e.hideInput(),e.isOpen=!1,e.$dropdown.hide(),e.setActiveOption(null),e.refreshState(),t&&e.trigger("dropdown_close",e.$dropdown)},positionDropdown:function(){var e=this.$control,t="body"===this.settings.dropdownParent?e.offset():e.position();t.top+=e.outerHeight(!0),this.$dropdown.css({width:e.outerWidth(),top:t.top,left:t.left})},clear:function(e){var t=this;t.items.length&&(t.$control.children(":not(input)").remove(),t.items=[],t.lastQuery=null,t.setCaret(0),t.setActiveItem(null),t.updatePlaceholder(),t.updateOriginalInput({silent:e}),t.refreshState(),t.showInput(),t.trigger("clear"))},insertAtCaret:function(t){var n=Math.min(this.caretPos,this.items.length);0===n?this.$control.prepend(t):e(this.$control[0].childNodes[n]).before(t),this.setCaret(n+1)},deleteSelection:function(t){var n,r,i,o,a,s,l,u,c,d=this;if(i=t&&t.keyCode===m?-1:1,o=P(d.$control_input[0]),d.$activeOption&&!d.settings.hideSelected&&(l=d.getAdjacentOption(d.$activeOption,-1).attr("data-value")),a=[],d.$activeItems.length){for(c=d.$control.children(".active:"+(i>0?"last":"first")),s=d.$control.children(":not(input)").index(c),i>0&&s++,n=0,r=d.$activeItems.length;r>n;n++)a.push(e(d.$activeItems[n]).attr("data-value"));t&&(t.preventDefault(),t.stopPropagation())}else(d.isFocused||"single"===d.settings.mode)&&d.items.length&&(0>i&&0===o.start&&0===o.length?a.push(d.items[d.caretPos-1]):i>0&&o.start===d.$control_input.val().length&&a.push(d.items[d.caretPos]));if(!a.length||"function"==typeof d.settings.onDelete&&d.settings.onDelete.apply(d,[a])===!1)return!1;for("undefined"!=typeof s&&d.setCaret(s);a.length;)d.removeItem(a.pop());return d.showInput(),d.positionDropdown(),d.refreshOptions(!0),l&&(u=d.getOption(l),u.length&&d.setActiveOption(u)),!0},advanceSelection:function(e,t){var n,r,i,o,a,s,l=this;0!==e&&(l.rtl&&(e*=-1),n=e>0?"last":"first",r=P(l.$control_input[0]),l.isFocused&&!l.isInputHidden?(o=l.$control_input.val().length,a=0>e?0===r.start&&0===r.length:r.start===o,a&&!o&&l.advanceCaret(e,t)):(s=l.$control.children(".active:"+n),s.length&&(i=l.$control.children(":not(input)").index(s),l.setActiveItem(null),l.setCaret(e>0?i+1:i))))},advanceCaret:function(e,t){var n,r,i=this;0!==e&&(n=e>0?"next":"prev",i.isShiftDown?(r=i.$control_input[n](),r.length&&(i.hideInput(),i.setActiveItem(r),t&&t.preventDefault())):i.setCaret(i.caretPos+e))},setCaret:function(t){var n=this;if(t="single"===n.settings.mode?n.items.length:Math.max(0,Math.min(n.items.length,t)),!n.isPending){var r,i,o,a;for(o=n.$control.children(":not(input)"),r=0,i=o.length;i>r;r++)a=e(o[r]).detach(),t>r?n.$control_input.before(a):n.$control.append(a)}n.caretPos=t},lock:function(){this.close(),this.isLocked=!0,this.refreshState()},unlock:function(){this.isLocked=!1,this.refreshState()},disable:function(){var e=this;e.$input.prop("disabled",!0),e.$control_input.prop("disabled",!0).prop("tabindex",-1),e.isDisabled=!0,e.lock()},enable:function(){var e=this;e.$input.prop("disabled",!1),e.$control_input.prop("disabled",!1).prop("tabindex",e.tabIndex),e.isDisabled=!1,e.unlock()},destroy:function(){var t=this,n=t.eventNS,r=t.revertSettings;t.trigger("destroy"),t.off(),t.$wrapper.remove(),t.$dropdown.remove(),t.$input.html("").append(r.$children).removeAttr("tabindex").removeClass("selectized").attr({tabindex:r.tabindex}).show(),t.$control_input.removeData("grow"),t.$input.removeData("selectize"),e(window).off(n),e(document).off(n),e(document.body).off(n),delete t.$input[0].selectize},render:function(e,t){var n,r,i="",o=!1,a=this,s=/^[\t \r\n]*<([a-z][a-z0-9\-_]*(?:\:[a-z][a-z0-9\-_]*)?)/i;return("option"===e||"item"===e)&&(n=T(t[a.settings.valueField]),o=!!n),o&&(S(a.renderCache[e])||(a.renderCache[e]={}),a.renderCache[e].hasOwnProperty(n))?a.renderCache[e][n]:(i=a.settings.render[e].apply(this,[t,E]),("option"===e||"option_create"===e)&&(i=i.replace(s,"<$1 data-selectable")),"optgroup"===e&&(r=t[a.settings.optgroupValueField]||"",i=i.replace(s,'<$1 data-group="'+k(E(r))+'"')),("option"===e||"item"===e)&&(i=i.replace(s,'<$1 data-value="'+k(E(n||""))+'"')),o&&(a.renderCache[e][n]=i),i)},clearCache:function(e){var t=this;"undefined"==typeof e?t.renderCache={}:delete t.renderCache[e]},canCreate:function(e){var t=this;if(!t.settings.create)return!1;var n=t.settings.createFilter;return!(!e.length||"function"==typeof n&&!n.apply(t,[e])||"string"==typeof n&&!new RegExp(n).test(e)||n instanceof RegExp&&!n.test(e))}}),_.count=0,_.defaults={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:!1,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,maxOptions:1e3,maxItems:null,hideSelected:null,addPrecedence:!1,selectOnTab:!1,preload:!1,allowEmptyOption:!1,closeAfterSelect:!1,scrollDuration:60,loadThrottle:300,loadingClass:"loading",dataAttr:"data-data",optgroupField:"optgroup",valueField:"value",labelField:"text",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"selectize-control",inputClass:"selectize-input",dropdownClass:"selectize-dropdown",dropdownContentClass:"selectize-dropdown-content",dropdownParent:null,copyClassesToDropdown:!0,render:{}},e.fn.selectize=function(t){var n=e.fn.selectize.defaults,r=e.extend({},n,t),i=r.dataAttr,o=r.labelField,a=r.valueField,s=r.optgroupField,l=r.optgroupLabelField,u=r.optgroupValueField,c={},d=function(t,n){var s,l,u,c,d=t.attr(i);if(d)for(n.options=JSON.parse(d),s=0,l=n.options.length;l>s;s++)n.items.push(n.options[s][a]);else{var p=e.trim(t.val()||"");if(!r.allowEmptyOption&&!p.length)return;for(u=p.split(r.delimiter),s=0,l=u.length;l>s;s++)c={},c[o]=u[s],c[a]=u[s],n.options.push(c);n.items=u}},p=function(t,n){var d,p,f,h,m=n.options,g=function(e){var t=i&&e.attr(i);return"string"==typeof t&&t.length?JSON.parse(t):null},v=function(t,i){t=e(t);var l=T(t.attr("value"));if(l||r.allowEmptyOption)if(c.hasOwnProperty(l)){if(i){var u=c[l][s];u?e.isArray(u)?u.push(i):c[l][s]=[u,i]:c[l][s]=i}}else{var d=g(t)||{};d[o]=d[o]||t.text(),d[a]=d[a]||l,d[s]=d[s]||i,c[l]=d,m.push(d),t.is(":selected")&&n.items.push(l)}},y=function(t){var r,i,o,a,s;for(t=e(t),o=t.attr("label"),o&&(a=g(t)||{},a[l]=o,a[u]=o,n.optgroups.push(a)),s=e("option",t),r=0,i=s.length;i>r;r++)v(s[r],o)};for(n.maxItems=t.attr("multiple")?null:1,h=t.children(),d=0,p=h.length;p>d;d++)f=h[d].tagName.toLowerCase(),"optgroup"===f?y(h[d]):"option"===f&&v(h[d])};return this.each(function(){if(!this.selectize){var i,o=e(this),a=this.tagName.toLowerCase(),s=o.attr("placeholder")||o.attr("data-placeholder");s||r.allowEmptyOption||(s=o.children('option[value=""]').text());var l={placeholder:s,options:[],optgroups:[],items:[]};"select"===a?p(o,l):d(o,l),i=new _(o,e.extend(!0,{},n,l,t))}})},e.fn.selectize.defaults=_.defaults,e.fn.selectize.support={validity:C},_.define("drag_drop",function(){if(!e.fn.sortable)throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');if("multi"===this.settings.mode){var t=this;t.lock=function(){var e=t.lock;return function(){var n=t.$control.data("sortable");return n&&n.disable(),e.apply(t,arguments)}}(),t.unlock=function(){var e=t.unlock;return function(){var n=t.$control.data("sortable");return n&&n.enable(),e.apply(t,arguments)}}(),t.setup=function(){var n=t.setup;return function(){n.apply(this,arguments);var r=t.$control.sortable({items:"[data-value]",forcePlaceholderSize:!0,disabled:t.isLocked,start:function(e,t){t.placeholder.css("width",t.helper.css("width")),r.css({overflow:"visible"})},stop:function(){r.css({overflow:"hidden"});var n=t.$activeItems?t.$activeItems.slice():null,i=[];r.children("[data-value]").each(function(){i.push(e(this).attr("data-value"))}),t.setValue(i),t.setActiveItem(n)}})}}()}}),_.define("dropdown_header",function(t){var n=this;t=e.extend({title:"Untitled",headerClass:"selectize-dropdown-header",titleRowClass:"selectize-dropdown-header-title",labelClass:"selectize-dropdown-header-label",closeClass:"selectize-dropdown-header-close",html:function(e){return'
'+e.title+'×
'}},t),n.setup=function(){var r=n.setup;return function(){r.apply(n,arguments),n.$dropdown_header=e(t.html(t)),n.$dropdown.prepend(n.$dropdown_header)}}()}),_.define("optgroup_columns",function(t){var n=this;t=e.extend({equalizeWidth:!0,equalizeHeight:!0},t),this.getAdjacentOption=function(t,n){var r=t.closest("[data-group]").find("[data-selectable]"),i=r.index(t)+n;return i>=0&&i
',e=e.firstChild,n.body.appendChild(e),t=r.width=e.offsetWidth-e.clientWidth,n.body.removeChild(e)),t},i=function(){var i,o,a,s,l,u,c;if(c=e("[data-group]",n.$dropdown_content),o=c.length,o&&n.$dropdown_content.width()){if(t.equalizeHeight){for(a=0,i=0;o>i;i++)a=Math.max(a,c.eq(i).height());c.css({height:a})}t.equalizeWidth&&(u=n.$dropdown_content.innerWidth()-r(),s=Math.round(u/o),c.css({width:s}),o>1&&(l=u-s*(o-1),c.eq(o-1).css({width:l})))}};(t.equalizeHeight||t.equalizeWidth)&&(A.after(this,"positionDropdown",i),A.after(this,"refreshOptions",i))}),_.define("remove_button",function(t){if("single"!==this.settings.mode){t=e.extend({label:"×",title:"Remove",className:"remove",append:!0},t);var n=this,r=''+t.label+"",i=function(e,t){var n=e.search(/(<\/[^>]+>\s*)$/);return e.substring(0,n)+t+e.substring(n)};this.setup=function(){var o=n.setup;return function(){if(t.append){var a=n.settings.render.item;n.settings.render.item=function(){return i(a.apply(this,arguments),r)}}o.apply(this,arguments),this.$control.on("click","."+t.className,function(t){if(t.preventDefault(),!n.isLocked){var r=e(t.currentTarget).parent();n.setActiveItem(r),n.deleteSelection()&&n.setCaret(n.items.length)}})}}()}}),_.define("restore_on_backspace",function(e){var t=this;e.text=e.text||function(e){return e[this.settings.labelField]},this.onKeyDown=function(){var n=t.onKeyDown;return function(t){var r,i;return t.keyCode===m&&""===this.$control_input.val()&&!this.$activeItems.length&&(r=this.caretPos-1,r>=0&&ro;o++)n=n.replace(new RegExp(r.charAt(o),"g"),i.charAt(o));return n=e.trim(n),n=n.toLowerCase().replace(/[^\w ]+/g,"").replace(/ +/g,"-")}};e.fn.slug=function(n){return t[n]?t[n].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof n&&n?void e.error("Method "+n+" does not exist on jQuery.slug"):t.init.apply(this,arguments)},e("[data-slug]").slug()}(jQuery),"undefined"!=typeof TypiCMS&&$(function(){$.ajaxSetup({headers:{"X-XSRF-TOKEN":TypiCMS.encrypted_token}})}),$(function(){$('[data-toggle="offcanvas"]').click(function(){$(".row-offcanvas").toggleClass("active")})}),$(function(){function e(e,t){var n={};n[e]=t,$.ajax({type:"POST",url:"/admin/users/current/updatepreferences",data:n}).fail(function(){alertify.error("User preference couldn’t be set.")})}$(".panel-collapse").on("hide.bs.collapse",function(){e("menus_"+$(this).attr("id")+"_collapsed","true")}),$(".panel-collapse").on("show.bs.collapse",function(){e("menus_"+$(this).attr("id")+"_collapsed","")})}),$(function(){$(".btn-preview").fancybox({width:1200,type:"iframe"})}),function(e){"use strict";var t=$("html").attr("lang");e.module("typicms",["ngResource","smart-table","gettext","ui.tree"],["$locationProvider",function(){}]),e.module("typicms").run(["gettextCatalog",function(e){e.setCurrentLanguage(t),e.loadRemote("/languages/"+t+".json")}]),e.module("typicms").factory("$api",["$location","$resource",function(e,t){var n=e.absUrl().split("?")[0],r=n.split("/")[4];return"galleries"===r&&"edit"===n.split("/")[6]&&(r="files"),"menus"===r&&"edit"===n.split("/")[6]&&(r="menulinks"),"dashboard"===r&&(r="history"),t("/api/"+r+"/:id",null,{update:{method:"PUT"}})}])}(angular),angular.module("typicms").filter("dateFromMySQL",["dateFilter",function(e){return function(t,n){return t?(t=new Date(t.replace(/-/g,"/")),e(t,n)):void 0}}]),function(e){"use strict";e.module("typicms").controller("ListController",["$http","$scope","$location","$api",function(t,n,r,i){n.itemsByPage=25;var o=r.absUrl().split("?")[0],a=o.split("/")[4],s={};n.TypiCMS=TypiCMS,"galleries"===a&&o.split("/")[5]&&(s.gallery_id=o.split("/")[5],n.gallery_id=s.gallery_id),"menus"===a&&o.split("/")[5]&&(s.menu_id=o.split("/")[5],a="menulinks"),i.query(s).$promise.then(function(e){n.models=e,n.displayedModels=[].concat(n.models)}),n.toggleStatus=function(e){var t=Math.abs(e.status-1),n=["offline","online"];e.status=t,i.update({id:e.id},e).$promise.then(function(){alertify.success("Item is "+n[t]+".")},function(e){alertify.error("Error "+e.status+" "+e.statusText)})},n.toggleHomepage=function(e){e.homepage=Math.abs(e.homepage-1),i.update({id:e.id},e).$promise.then(function(){},function(e){alertify.error("Error "+e.status+" "+e.statusText)})},n.update=function(e){i.update({id:e.id},e).$promise.then(function(){},function(e){alertify.error("Error "+e.status+" "+e.statusText)})},n.selectAndClose=function(e,t){window.opener.CKEDITOR.tools.callFunction(e,t),window.close()},n["delete"]=function(e,t){if(t||(t=e.title),!window.confirm("Supprimer « "+t+" » ?"))return!1;var r=n.models.indexOf(e);i["delete"]({id:e.id},function(){-1!==r&&n.models.splice(r,1)},function(e){alertify.error("Error "+e.status+" "+e.statusText)})},n.deleteFromNested=function(e,t){return t||(t=e.model.title),e.hasChild()?(alertify.error("Cannot delete item because it has children."),!1):window.confirm("Supprimer « "+t+" » ?")?void i["delete"]({id:e.model.id},function(){e.remove()}):!1},n.treeOptions={dragThreshold:0,dropped:function(n){var r=n.source.nodeScope.model,i=null,o={},s=n.dest.nodesScope,l=s.$modelValue;return n.dest.nodesScope.$nodeScope&&(i=s.$nodeScope.model.id),n.dest.index===n.source.index&&r.parent_id===i?!1:(o.moved=r.id,o.item=[],r.position=n.dest.index+1,r.parent_id=i,e.forEach(l,function(e){o.item.push({id:e.id,parent_id:e.parent_id})}),void t.post("/admin/"+a+"/sort",o).success(function(e){alertify.success(e.message)}).error(function(e){alertify.error(e.error.message)}))}}}])}(angular),angular.module("typicms").filter("betterFilter",["filterFilter",function(e){return function(t,n,r){for(var i in n)n[i]=normalize(n[i]);for(var o=angular.copy(t),a=0;a
',n=["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/vnd.openxmlformats-officedocument.presentationml.slide","application/msword","application/vnd.ms-powerpoint","application/vnd.ms-excel","application/pdf","application/zip","image/jpeg","image/gif","image/png"],Dropzone.options.dropzone={url:"/api/files",paramName:"file",clickable:!0,maxFilesize:60,acceptedFiles:n.join(),previewTemplate:t,thumbnailWidth:130,thumbnailHeight:130,init:function(){this.on("success",function(t,n){var r=this;window.setTimeout(function(){$(t.previewElement).fadeOut("fast",function(){r.removeFile(t),e.$apply(function(){e.models.push(n.model)})})},1e3)}),this.on("sending",function(t,n,i){i.append("gallery_id",e.gallery_id),i.append("_token",TypiCMS._token);for(var o=r.length-1;o>=0;o--)i.append(r[o]["short"]+"[description]",""),i.append(r[o]["short"]+"[alt_attribute]",""),i.append(r[o]["short"]+"[keywords]",""),i.append(r[o]["short"]+"[status]",1)})}}}}),angular.module("smart-table").directive("stFilter",["$timeout",function(){return{require:"^stTable",link:{pre:function(e,t,n,r){r.setFilterFunction("betterFilter")}}}}]),angular.module("smart-table").directive("stOrder",["$parse",function(){return{require:"^stTable",link:{pre:function(e,t,n,r){r.setSortFunction("betterOrderBy")}}}}]),angular.module("typicms").directive("typiBtnDelete",function(){return{scope:{action:"&"},template:''}}),angular.module("typicms").directive("typiBtnFiles",function(){return{scope:{model:"="},template:'{{ model.files_count }}'}}),angular.module("typicms").directive("typiBtnStatus",function(){return{scope:{model:"=",action:"&"},template:''}}),angular.module("typicms").directive("typiPagination",function(){return{template:'
'}}); \ No newline at end of file diff --git a/resources/assets/typicms/components/list/ListController.js b/resources/assets/typicms/components/list/ListController.js index 7c0f983e..f4966454 100644 --- a/resources/assets/typicms/components/list/ListController.js +++ b/resources/assets/typicms/components/list/ListController.js @@ -19,6 +19,7 @@ // if we query files from a gallery, we need the gallery_id value : if (moduleName === 'galleries' && url.split('/')[5]) { $params.gallery_id = url.split('/')[5]; + $scope.gallery_id = $params.gallery_id; } // if we query menulinks menu_id value : diff --git a/resources/assets/typicms/components/list/directives/dropZone.js b/resources/assets/typicms/components/list/directives/dropZone.js index 9059ceff..b33490e1 100644 --- a/resources/assets/typicms/components/list/directives/dropZone.js +++ b/resources/assets/typicms/components/list/directives/dropZone.js @@ -11,9 +11,9 @@ angular.module('typicms').directive('dropZone', function () { $( "#uploaderAddButton" ).on('click', function () { $('#dropzone').trigger('click'); }); + var dropZoneTemplate, acceptedFiles, - parentId = scope.parentId, locales = scope.TypiCMS.locales; dropZoneTemplate = '
\ @@ -73,8 +73,7 @@ angular.module('typicms').directive('dropZone', function () { }); this.on('sending', function (file, xhr, formData) { - - formData.append('gallery_id', parentId); + formData.append('gallery_id', scope.gallery_id); formData.append('_token', TypiCMS._token); for (var i = locales.length - 1; i >= 0; i--) { formData.append(locales[i].short + '[description]', '');