var StripGalleryController=function(t,e){var i=this;this.resize=_.debounce(_.bind(this._resize,this),200),StripGalleryController.super_.apply(this,arguments),this.el=t,this.itemClass="item",this.editMode=Wix.Utils.getViewMode(),this.init(e),$(this.el).on("click","."+this.itemClass+" .more",function(t){var e=i.currSlideindex;i.itemClick(i.items[e],e,t.target,t,i.items[e]["data-anchor"],this.mainPageId)})};utils.inherits(StripGalleryController,SimpleAppProto),StripGalleryController.prototype._randomTransition=function(){var t=["crossFade","scroll","slide","zoom"];this._fxRandomized=this._fxRandomized||_.shuffle(t),this._fxRandomIteration=this._fxRandomIteration||0;var e=this._fxRandomIteration%this._fxRandomized.length;return this._fxRandomIteration++,this._fxFromTransition(this._fxRandomized[e])},StripGalleryController.prototype._fxFromTransition=function(t){var e={fx:t,transition:t,speed:1e3*(this.props.transDuration||1)};switch(t){case"none":e.speed=1;break;case"zoom":case"crossFade":e.fx="fadeout";break;case"scroll":e.fx="scrollVert",e.easing="easeInOutQuart";break;case"slide":e.fx="scrollHorz",e.easing="easeInOutQuart";break;case"random":e.fx="random"}return e},StripGalleryController.prototype.dimCrop=function(t,e){var i=Math.max(this.wrapperWidth/t,this.wrapperHeight/e);return i=Math.min(i,1),{height:Math.floor(e*i),width:Math.floor(t*i)}},StripGalleryController.prototype.itemClick=function(t,e,i){this.openLink(t.href,t.target,t.linkType,t[this.mainPageId],t["data-anchor"],this.mainPageId,t.link)},StripGalleryController.prototype.itemTemplate=_.template('
<% if(description || title) { %><% if(title) { %>
<%=title%>
<% } %><% if(description) { %>
<%=description%>
<% } %><% } %>
Read more    >
'),StripGalleryController.prototype.init=function(t){this.items=t.items||[],this.props=t.props||{},this.marketingLandingPage=t.marketingLandingPage,this.el.html('
'),this.gridSizer=$(".grid-sizer"),this.createDom(),this.createLayout(),this._resize()},StripGalleryController.prototype.zoomClosed=function(){this.autoplayResume()},StripGalleryController.prototype.next=function(){$(this.el).cycle("next")},StripGalleryController.prototype.previous=function(){$(this.el).cycle("prev")},StripGalleryController.prototype.autoplayPause=function(){$(this.el).cycle("pause"),this.el.removeClass("image-animation")},StripGalleryController.prototype.autoplayResume=function(){var t=$(this.el);"editor"!=this.editMode&&(this.props.autoplay&&t.cycle("resume"),this.el.addClass("image-animation"))},StripGalleryController.prototype._resize=function(){this.calculateLayoutSizes(),this.updateLayout(),this.moveCaption("in")},StripGalleryController.prototype.destroy=function(){this.el.cycle("destroy")},StripGalleryController.prototype.createDom=function(){var t=this;this.el.html('
'),this.calculateLayoutSizes();var e=document.createDocumentFragment();_.each(this.items,function(i,r){e.appendChild(t.createSingleItem(i,r))}),this.el.append(e),(this.marketingLandingPage||this.items.length<=1)&&$(".cycle-pager").hide()},StripGalleryController.prototype.moveCaption=function(t){var e=$(".cycle-slide-active .sb-description"),i=0;switch(t){case"in":i=(this.wrapperHeight-e.height())/2,(void 0==i||i<0||!e.width())&&(i=(this.wrapperHeight-196)/2);break;case"out":i=this.wrapperHeight}e.css("top",i+"px")},StripGalleryController.prototype.createLayout=function(){var t=this;this.itemClass;$(this.el).on("cycle-update-view",function(e,i){t.moveCaption("in")}),$(this.el).on("cycle-after",function(e,i){t.moveCaption("out"),t.currSlideindex!==i.nextSlide&&(t.currSlideindex=i.nextSlide,Wix.pushState(JSON.stringify({cmd:"itemChanged",args:[i.nextSlide]})))}),$(this.el).on("cycle-before",function(e,i,r,s,o){"random"==t.props.transition&&("zoom"==$(s).data("transition")?$(t.el).addClass("animation-zoom"):$(t.el).removeClass("animation-zoom"));var a;if(i.pager){var l=i.nextSlide;a=i.API.getComponent("pager"),a.each(function(){$(this).children().removeClass(i.pagerActiveClass).eq(l).addClass(i.pagerActiveClass)});var n=$(this).width(),h=a.children().eq(l).outerWidth(!0);if(h*a.children().length>n){var d=i.nextSlide>i.currSlide,p=-1*h*l+(d?n/3:2*n/3);p=Math.min(p,n/4),a.css("transform","translateX("+p+"px)")}}}),"editor"==this.editMode&&($(this.el).cycle("pause"),$(this.el).removeClass("image-animation"));var e=t.props.backgroundColor,i=t.props.titleColor;$(this.el).find(".more").hover(function(){$(this).css({color:i,backgroundColor:e})},function(){$(this).css({color:e,backgroundColor:i})})},StripGalleryController.prototype.updateSettings=function(t){var e=!0;if(this.mainPageId=t.mainPageId,this.transitionChanged="editor"==self.editMode&&this.props.transition!=t.props.transition,this.quality=t.quality||{},this.marketingLandingPage=t.marketingLandingPage,(this.props.textMode!=t.props.textMode||this.transitionChanged)&&(e=!0),this.items.length!=t.items.length)e=!0;else for(var i=0;i