/*! wookmark plugin @name wookmark.js @author Christoph Ono (chri@sto.ph or @gbks) @author Sebastian Helzle (sebastian@helzle.net or @sebobo) @version 2.2.0 @date 11/24/2019 @category jQuery plugin @copyright (c) 2009-2019 Christoph Ono (www.wookmark.com) @license Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. */ !function(a){!function(a){"function"==typeof define&&define.amd?define(a):a()}(function(){function b(a,b){return function(){return a.apply(b,arguments)}}function c(a,b){var c;for(c in b)b.hasOwnProperty(c)&&(a.style[c]=b[c])}function d(a,b){u(function(){var d,e;for(d=0;d1&&(k=p(k)),!c)for(f=this.items.length;f--;)-1===r(k,this.items[f])&&l(this.items[f],this.inactiveClass)}else k=this.items;if(!c){for(f=k.length;f--;)m(k[f],this.inactiveClass);this.columns=null,this.layout()}return k},s.prototype.refreshPlaceholders=function(a,b){var d,e,f,g,h,j,k,l=i(this.container),m=this.columns.length,o="";if(this.placeholders.length';this.container.insertAdjacentHTML("beforeend",o),this.placeholders=this.container.querySelectorAll("."+this.placeholderClass)}for(g=this.offset+2*parseInt(q(this.placeholders[0],"border-left-width"),10)||0,g+=2*parseInt(q(this.placeholders[0],"padding-left"),10)||0,d=0;d=m||0===e.length?j.style.display="none":(h=e[e.length-1],k=n(h,"top",!0)+n(h,"height",!0)+this.verticalOffset,f=Math.max(0,l-k-g),c(j,{position:"absolute",display:f>0?"block":"none",left:d*a+b+"px",top:k+"px",width:a-g+"px",height:f+"px"}))},s.prototype.getActiveItems=function(){var a,b,c=this.inactiveClass,d=[],e=this.items;if(!this.ignoreInactiveItems)return e;for(a=0;a0&&(void 0===a||0===a&&!this.flexibleWidth)?a=j(this.items[0]):"string"==typeof a&&a.indexOf("%")>=0&&(a=parseFloat(a)/100*b),c){"function"==typeof c&&(c=c()),"string"==typeof c&&c.indexOf("%")>=0&&(c=parseFloat(c)/100*b);var d=b+this.offset,e=Math.floor(.5+d/(c+this.offset)),f=Math.floor(d/(a+this.offset)),g=Math.max(e,f),h=Math.min(c,Math.floor((b-(g-1)*this.offset)/g));a=Math.max(a,h)}return a},s.prototype.layout=function(a,b){if(a||!h(this.container)){var c,d,e=this.getItemWidth(),f=e+this.offset,g=j(this.container),i=g-2*this.outerOffset,k=Math.floor((i+this.offset)/f),l=0,m=this.getActiveItems(),n=m.length;if(a||this.itemHeightsDirty||!this.itemHeightsInitialized){for(var p=0;p>1)),this.direction=this.direction||("right"===this.align?"right":"left"),l=a||null===this.columns||this.columns.length!==k||this.activeItemCount!==n?this.layoutFull(f,k,c):this.layoutColumns(f,c),this.activeItemCount=n,this.container.style.height=l+"px",this.fillEmptySpace&&this.refreshPlaceholders(f,c),void 0!==this.onLayoutChanged&&"function"==typeof this.onLayoutChanged&&this.onLayoutChanged(),"function"==typeof b&&b()}},s.prototype.sortElements=function(a){return"function"==typeof this.comparator?a.sort(this.comparator):a},s.prototype.layoutFull=function(a,b,c){var e,f,g,h,i=0,j=0,m=null,p=null,q=[],r=[],s="left"===this.align,t=this;for(this.columns=[],f=this.sortElements(this.getActiveItems()),g=f.length;q.length0||!s)&&(h+=p*a),r[j]={el:e,css:{position:"absolute",top:m+"px"}},r[j].css[this.direction]=h+"px",q[p]+=n(e,"height",!0)+this.verticalOffset,this.columns[p].push(e),j++}return d(r,function(){k(t.container,"wookmark-initialised")||l(t.container,"wookmark-initialised")}),Math.max.apply(Math,q)},s.prototype.layoutColumns=function(a,b){for(var c,e,f,g,h=[],i=[],j=0,k=0,l=this.columns.length;l--;){for(c=this.outerOffset,h.push(c),e=this.columns[l],g=l*a+b,j=0;j1)for(;c--;)a(this).eq(c).wookmark(b);else 1===c&&(this.wookmarkInstance?this.wookmarkInstance.updateOptions(b||{}):this.wookmarkInstance=new s(this[0],b||{}));return this}),window.Wookmark=s,s})}(window.jQuery);