"use strict";function _toConsumableArray(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}!function(){function t(t,e){function i(t,e){if(t.data){var i=t.data.staticClass?t.data.staticClass+" ":"";t.data.staticClass=i+e}}function n(t){return t.__underlying_element}return{props:{options:{type:Object,default:{layoutMode:"masonry",masonry:{gutter:10}},sort:String},itemSelector:{type:String,default:"item"},list:{type:Array,required:!0}},render:function t(e){var n=this,r={},o=this.prevChildren=this.children,s=this.$slots.default||[],a=this.children=[],l=this.removedIndex=[];s.forEach(function(t){return i(t,n.itemSelector)});for(var u=0;u<s.length;u++){var c=s[u];if(c.tag)if(null!=c.key&&0!==String(c.key).indexOf("__vlist"))a.push(c),r[c.key]=c;else{var h=c.componentOptions,f=h?h.Ctor.options.name||h.tag||"":c.tag;console.log("Warning template error: isotope children must be keyed: <"+f+">")}}var d=this.displayChildren=[].concat(a);if(o)for(var m=0;m<o.length;m++){var p=o[m];r[p.key]||(d.splice(m,0,p),l.push(m))}return e("div",null,d)},mounted:function i(){var r=this,o=t.merge({},this.compiledOptions),s=function e(i){t.forOwn(i,function(t,e){i[e]=function(e){var i=n(e);return t.call(r,i.vm,i.index)}})};s(o.getSortData),s(o.getFilterData),this.$nextTick(function(){r._isotopeOptions=o,r.link(),r.listen();var t=new e(r.$el,o);t._requestUpdate=function(){t._willUpdate||(t._willUpdate=!0,r.$nextTick(function(){t.arrange(),t._willUpdate=!1}))},r.iso=t})},beforeDestroy:function e(){this.iso.destroy(),t.forEach(this._listeners,function(t){t()}),this._filterlistener&&this._filterlistener(),this.iso=null},beforeUpdate:function t(){this._oldChidren=Array.prototype.slice.call(this.$el.children)},updated:function e(){var i=this;if(this.iso){var n=[].concat(_toConsumableArray(this.$el.children)),r=t.difference(n,this._oldChidren),o=this.removedIndex.map(function(t){return i.$el.children[t]});this.cleanupNodes(),this.link(),(o.length||r.length)&&(this.listen(),this.iso.remove(o),this.iso.insert(r),this.iso._requestUpdate())}},methods:{cleanupNodes:function t(){var e=this;this.removedIndex.reverse(),this.removedIndex.forEach(function(t){return e._vnode.children.splice(t,1)})},link:function t(){var e=this;(this.$slots.default||[]).forEach(function(t,i){var n=t.elm;n&&(n.__underlying_element={vm:e.list[i],index:i})})},listen:function e(){var i=this;this._listeners=t(this.compiledOptions.getSortData).map(function(e){return t.map(i.list,function(t,n){return i.$watch(function(){return e(t)},function(){i.iso.updateSortData(),i.iso._requestUpdate()})})}).flatten().value()},sort:function e(i){var e=i;t.isString(i)&&(e={sortBy:i}),this.arrange(e),this.$emit("sort",i)},filter:function e(i){var n=this,e=this._isotopeOptions.getFilterData[i];this._filterlistener=this.$watch(function(){return t.map(n.list,function(t,e){return n.options.getFilterData[i](t,e)})},function(){n.iso._requestUpdate()}),this.arrange({filter:e}),this.$emit("filter",i)},unfilter:function t(){this.arrange({filter:function t(){return!0}}),this.$emit("filter",null)},layout:function e(i){var e=i;t.isString(i)&&(e={layoutMode:i}),this.arrange(e),this.$emit("layout",e)},arrange:function t(e){this.iso.arrange(e),this.$emit("arrange",e)},shuffle:function t(){this.iso.shuffle(),this.$emit("shuffle"),this.$emit("sort",null)},getFilteredItemElements:function t(){return this.iso.getFilteredItemElements()},getElementItems:function t(){return this.iso.getElementItems()}},computed:{compiledOptions:function e(){var i=t.merge({},this.options,{itemSelector:"."+this.itemSelector,isJQueryFiltering:!1});return t.forOwn(i.getSortData,function(e,n){t.isString(e)&&(i.getSortData[n]=function(t){return t[e]})}),i}}}}if(window.Vue&&window._&&window.Isotope){var e=t(window._,window.Isotope);Vue.component("isotope",e)}}();