").addClass("vc_grid-pagination").appendTo(n.$el)).twbsPagination({totalPages:t,visiblePages:n.settings.visible_pages,onPageClick:function(t,i){s.to(i-1),window.setTimeout(function(){var t=s.$element.find(".owl-item.active");t.length&&t.offset().top{var t=function(t){this.grid=t,this.settings=t.settings,this.filterValue=null,this.$el=!1,this.$content=!1,this.isLoading=!1,this.filtered=!1,this.$loader=n(''),this.masonryEnabled=!1,_.bindAll(this,"setMasonry"),this.init()};t.prototype=_.extend({},window.vcGridStyleAll.prototype,{render:function(){this.$el=this.grid.$el,this.$content=this.$el,_.defer(this.setIsLoading),this.grid.ajax({},this.addItems)},showItems:function(){var t=this.$content.find(".vc_grid-item"+this.filterValue),i=this;this.setIsLoading(),t.imagesLoaded(function(){t.addClass("vc_visible-item"),i.setItems(t),i.filtered&&(i.filtered=!1,i.setMasonry()),i.unsetIsLoading(),window.vc_prettyPhoto(),n(window).trigger("grid:items:added",i.$el)})},filter:function(t){if(t=_.isUndefined(t)||"*"===t?"":t,this.filterValue==t)return!1;this.filterValue=t,this.$content.data("masonry")&&this.$content.masonry("destroy"),this.masonryEnabled=!1,this.$content.find(".vc_visible-item").removeClass("vc_visible-item"),this.$content.find(".vc_grid-item"+this.filterValue),this.filtered=!0,n(window).on("resize",this.setMasonry),this.setMasonry(),this.showItems()},setIsLoading:function(){this.$el.append(this.$loader),this.isLoading=!0},unsetIsLoading:function(){this.isLoading=!1,this.$loader&&this.$loader.remove()},setItems:function(t){this.masonryEnabled?this.$content.masonry("appended",t):this.setMasonry()},setMasonry:function(t){var i,n,e,s;window.innerWidth{var i=function(i){this.grid=i,this.settings=i.settings,this.$el=!1,this.filterValue=null,this.filtered=!1,this.$content=!1,this.isLoading=!1,this.$loader=e(''),this.masonryEnabled=!1,_.bindAll(this,"setMasonry"),this.init()};i.prototype=_.extend({},window.vcGridStyleLazy.prototype,{render:function(){this.$el=this.grid.$el,this.$content=this.$el,this.setIsLoading(),this.grid.ajax({},this.addItems)},showItems:function(){if(!0===this.isLoading)return!1;this.setIsLoading();var i=this.$content.find(".vc_grid_filter-item:not(.vc_visible-item):lt("+this.settings.items_per_page+")"),t=this;i.imagesLoaded(function(){i.addClass("vc_visible-item"),t.setItems(i),t.filtered&&(t.filtered=!1,t.setMasonry(),t.initScroll(),window.vc_prettyPhoto()),t.unsetIsLoading(),e(window).trigger("grid:items:added",t.$el)})},setIsLoading:function(){this.$el.append(this.$loader),this.isLoading=!0},filter:function(i){if(i=_.isUndefined(i)||"*"===i?"":i,this.filterValue==i)return!1;this.$content.data("masonry")&&this.$content.masonry("destroy"),this.masonryEnabled=!1,this.$content.find(".vc_visible-item, .vc_grid_filter-item").removeClass("vc_visible-item vc_grid_filter-item"),this.filterValue=i,this.$content.find(".vc_grid-item"+this.filterValue).addClass("vc_grid_filter-item"),this.filtered=!0,e(window).on("resize",this.setMasonry),this.setMasonry(),_.defer(this.showItems)},setItems:function(i){this.masonryEnabled?this.$content.masonry("appended",i):this.setMasonry()},setMasonry:function(i){var t,e,s;window.innerWidth{var t=function(t){this.grid=t,this.settings=t.settings,this.$loadMoreBtn=!1,this.$el=!1,this.filterValue=null,this.$content=!1,this.isLoading=!1,this.filtered=!1,this.$loader=e(''),this.masonryEnabled=!1,_.bindAll(this,"setMasonry"),this.init()};t.prototype=_.extend({},window.vcGridStyleLoadMore.prototype,{render:function(){this.$el=this.grid.$el,this.$content=this.$el,this.setIsLoading(),this.grid.ajax({},this.addItems)},showItems:function(){if(!0===this.isLoading)return!1;this.setIsLoading();var t=this.$content.find(".vc_grid_filter-item:not(.vc_visible-item):lt("+this.settings.items_per_page+")"),i=this;t.imagesLoaded(function(){t.addClass("vc_visible-item"),i.setItems(t),i.filtered&&(i.filtered=!1,i.setMasonry(),window.vc_prettyPhoto()),i.unsetIsLoading(),e(window).trigger("grid:items:added",i.$el),setTimeout(function(){i.$content.masonry(i.settings)},100)})},filter:function(t){if(t=_.isUndefined(t)||"*"===t?"":t,this.filterValue==t)return!1;this.$content.data("masonry")&&this.$content.masonry("destroy"),this.masonryEnabled=!1,this.$content.find(".vc_visible-item, .vc_grid_filter-item").removeClass("vc_visible-item vc_grid_filter-item"),this.filterValue=t,this.$content.find(".vc_grid-item"+this.filterValue).addClass("vc_grid_filter-item"),this.filtered=!0,e(window).on("resize",this.setMasonry),this.setMasonry(),this.showItems()},setIsLoading:function(){this.$el.append(this.$loader),this.$loadMoreBtn&&this.$loadMoreBtn.hide(),this.isLoading=!0},unsetIsLoading:function(){this.isLoading=!1,this.$loader&&this.$loader.remove(),this.setLoadMoreBtn()},setItems:function(t){this.masonryEnabled?this.$content.masonry("appended",t):this.setMasonry()},setMasonry:function(t){var i,e,s;window.innerWidth{var n,a={addItemsAnimation:"zoomIn",mobileWindowWidth:768,itemAnimationSpeed:1e3,itemAnimationDelay:[],clearAnimationDelays:function(){_.each(this.itemAnimationDelay,function(i){window.clearTimeout(i)}),this.itemAnimationDelay=[]}};(n=function(i){this.$el=s(i),this.settings={},this.$filter=!1,this.gridBuilder=!1,this.init()}).prototype.init=function(){_.bindAll(this,"filterItems","filterItemsDropdown"),this.setSettings(),this.initStyle(),this.initHover(),this.initZoneLink()},n.prototype.setSettings=function(){this.settings=s.extend({visible_pages:5},this.$el.data("vcGridSettings")||{})},n.prototype.initStyle=function(){var i=!!this.settings.style&&s.camelCase("vc-grid-style-"+this.settings.style);i&&!_.isUndefined(window[i])&&window[i].prototype.render&&(this.gridBuilder=new window[i](this),this.gridBuilder.render())},n.prototype.initFilter=function(){this.$filter=this.$el.find("[data-vc-grid-filter]"),this.$filterDropdown=this.$el.find("[data-vc-grid-filter-select]"),this.$filter.length&&this.$filter.find(".vc_grid-filter-item").off("click.vc-grid").on("click.vc-grid",this.filterItems),this.$filterDropdown.length&&this.$filterDropdown.off("change.vc-grid").on("change.vc-grid",this.filterItemsDropdown)},n.prototype.initHover=function(){this.$el.off("mouseover.vc-grid").off("mouseleave.vc-grid").on("mouseover.vc-grid",".vc_grid-item-mini",function(){s(this).addClass("vc_is-hover")}).on("mouseleave.vc-grid",".vc_grid-item-mini",function(){s(this).removeClass("vc_is-hover")})},n.prototype.initZoneLink=function(){window.vc_iframe?(this.$el.off("click.zonePostLink").on("click.zonePostLink","[data-vc-link]",function(){s(this);var i=s(this).data("vcLink");window.open(i)}),this.$el.off("click.vc-grid-zone").on("click.vc-grid-zone",".vc_gitem-link",function(i){i&&i.prevenDefault&&i.preventDefault();i=s(this);i.hasClass("vc-gitem-link-ajax")||i.hasClass("prettyphoto")||window.open(i.attr("href"))})):(this.$el.off("click.zonePostLink").on("click.zonePostLink","[data-vc-link]",function(){var i=s(this),t=s(this).data("vcLink");"_blank"===i.data("vcTarget")?window.open(t):window.location.href=t}),this.$el.off("click.vc-grid-zone").on("click.vc-grid-zone",".vc_gitem-link",function(i){var t,e,n,a=s(this);a.hasClass("vc-gitem-link-ajax")&&(i.preventDefault(),t=new XMLHttpRequest,a.addClass("vc-spinner"),t.open("GET",a.attr("href"),!0),t.send(),e=function(){a.removeClass("vc-spinner vc-spinner-complete vc-spinner-failed")},n=0,t.onreadystatechange=function(){XMLHttpRequest.DONE===t.readyState&&(n=(200===t.status?a.addClass("vc-spinner-complete"):a.addClass("vc-spinner-failed"),n&&(window.clearTimeout(n),n=0),window.setTimeout(e,500)))})}))},n.prototype.initHover_old=function(){this.$el.on("mouseover",".vc_grid-item",function(){var n=s(this);n.hasClass("vc_is-hover")||(a.clearAnimationDelays(),n.addClass("vc_is-hover vc_is-animated"),n.find(".vc_grid-item-row-animate").each(function(){var i=s(this),t=i.data("animationIn"),e=i.data("animationOut");i.removeClass(e).addClass(t),a.itemAnimationDelay.push(_.delay(function(){i.removeClass(t),n.removeClass("vc_is-animated")},a.itemAnimationSpeed))}))}).on("mouseleave",".vc_grid-item",function(){var n=s(this);a.clearAnimationDelays(),n.addClass("vc_is-animated").removeClass("vc_is-hover"),n.find(".vc_grid-item-row-animate").each(function(){var i=n.find(".vc_grid-item-row-animate"),t=i.data("animationOut"),e=i.data("animationIn");i.addClass(t),a.itemAnimationDelay.push(_.delay(function(){i.removeClass(t+" "+e),n.removeClass("vc_is-animated")},a.itemAnimationSpeed-1))})})},n.prototype.filterItems=function(i){var t;if(i&&i.preventDefault&&i.preventDefault(),this.style&&s.camelCase("filter-"+this.style),t=(i=s(i.currentTarget).find("[data-vc-grid-filter-value]")).data("vcGridFilterValue"),i.hasClass("vc_active"))return!1;this.$filter.find(".vc_active").removeClass("vc_active"),this.$filterDropdown.find(".vc_active").removeClass("vc_active"),this.$filterDropdown.find('[value="'+t+'"]').addClass("vc_active").attr("selected","selected"),i.parent().addClass("vc_active"),this.gridBuilder.filter(t)},n.prototype.filterItemsDropdown=function(i){var t=this.$filterDropdown.find(":selected"),e=t.val();if(t.hasClass("vc_active"))return!1;this.$filterDropdown.find(".vc_active").removeClass("vc_active"),this.$filter.find(".vc_active").removeClass("vc_active"),this.$filter.find('[data-vc-grid-filter-value="'+e+'"]').parent().addClass("vc_active"),t.addClass("vc_active"),this.gridBuilder.filter(e)},n.prototype.ajax=function(i,t){_.isUndefined(i)&&(i={}),i=_.extend({action:"vc_get_vc_grid_data",vc_action:"vc_get_vc_grid_data",tag:this.settings.tag,data:this.settings,vc_post_id:this.$el.data("vcPostId"),_vcnonce:this.$el.data("vcPublicNonce")},i),s.ajax({type:"POST",dataType:"html",url:this.$el.data("vcRequest"),data:i}).done(t)},s.fn.vcGrid=function(e){return this.each(function(){var i=s(this),t=i.data("vcGrid");t||i.data("vcGrid",t=new n(this)),"string"==typeof e&&t[e]()})},s.fn.vcGrid.Constructor=n,s(document).ready(function(){s("[data-vc-grid-settings]").vcGrid()}),window.VcGrid=n,window.vcGridSettings=a})(window.jQuery);