/*! * masonry packaged v3.2.2 * cascading grid layout library * http://masonry.desandro.com * mit license * by david desandro */ !function(a){function b(){}function c(a){function c(b){b.prototype.option||(b.prototype.option=function(b){a.isplainobject(b)&&(this.options=a.extend(!0,this.options,b))})}function e(b,c){a.fn[b]=function(e){if("string"==typeof e){for(var g=d.call(arguments,1),h=0,i=this.length;i>h;h++){var j=this[h],k=a.data(j,b);if(k)if(a.isfunction(k[e])&&"_"!==e.charat(0)){var l=k[e].apply(k,g);if(void 0!==l)return l}else f("no such method '"+e+"' for "+b+" instance");else f("cannot call methods on "+b+" prior to initialization; attempted to call '"+e+"'")}return this}return this.each(function(){var d=a.data(this,b);d?(d.option(e),d._init()):(d=new c(this,e),a.data(this,b,d))})}}if(a){var f="undefined"==typeof console?b:function(a){console.error(a)};return a.bridget=function(a,b){c(b),e(a,b)},a.bridget}}var d=array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],c):c("object"==typeof exports?require("jquery"):a.jquery)}(window),function(a){function b(b){var c=a.event;return c.target=c.target||c.srcelement||b,c}var c=document.documentelement,d=function(){};c.addeventlistener?d=function(a,b,c){a.addeventlistener(b,c,!1)}:c.attachevent&&(d=function(a,c,d){a[c+d]=d.handleevent?function(){var c=b(a);d.handleevent.call(d,c)}:function(){var c=b(a);d.call(a,c)},a.attachevent("on"+c,a[c+d])});var e=function(){};c.removeeventlistener?e=function(a,b,c){a.removeeventlistener(b,c,!1)}:c.detachevent&&(e=function(a,b,c){a.detachevent("on"+b,a[b+c]);try{delete a[b+c]}catch(d){a[b+c]=void 0}});var f={bind:d,unbind:e};"function"==typeof define&&define.amd?define("eventie/eventie",f):"object"==typeof exports?module.exports=f:a.eventie=f}(this),function(a){function b(a){"function"==typeof a&&(b.isready?a():g.push(a))}function c(a){var c="readystatechange"===a.type&&"complete"!==f.readystate;b.isready||c||d()}function d(){b.isready=!0;for(var a=0,c=g.length;c>a;a++){var d=g[a];d()}}function e(e){return"complete"===f.readystate?d():(e.bind(f,"domcontentloaded",c),e.bind(f,"readystatechange",c),e.bind(a,"load",c)),b}var f=a.document,g=[];b.isready=!1,"function"==typeof define&&define.amd?define("doc-ready/doc-ready",["eventie/eventie"],e):"object"==typeof exports?module.exports=e(require("eventie")):a.docready=e(a.eventie)}(window),function(){function a(){}function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}function c(a){return function(){return this[a].apply(this,arguments)}}var d=a.prototype,e=this,f=e.eventemitter;d.getlisteners=function(a){var b,c,d=this._getevents();if(a instanceof regexp){b={};for(c in d)d.hasownproperty(c)&&a.test(c)&&(b[c]=d[c])}else b=d[a]||(d[a]=[]);return b},d.flattenlisteners=function(a){var b,c=[];for(b=0;be;e++)if(b=c[e]+a,"string"==typeof d[b])return b}}var c="webkit moz ms ms o".split(" "),d=document.documentelement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return b}):"object"==typeof exports?module.exports=b:a.getstyleproperty=b}(window),function(a){function b(a){var b=parsefloat(a),c=-1===a.indexof("%")&&!isnan(b);return c&&b}function c(){}function d(){for(var a={width:0,height:0,innerwidth:0,innerheight:0,outerwidth:0,outerheight:0},b=0,c=g.length;c>b;b++){var d=g[b];a[d]=0}return a}function e(c){function e(){if(!m){m=!0;var d=a.getcomputedstyle;if(j=function(){var a=d?function(a){return d(a,null)}:function(a){return a.currentstyle};return function(b){var c=a(b);return c||f("style returned "+c+". are you running this code in a hidden iframe on firefox? see http://bit.ly/getsizebug1"),c}}(),k=c("boxsizing")){var e=document.createelement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderstyle="solid",e.style.borderwidth="1px 2px 3px 4px",e.style[k]="border-box";var g=document.body||document.documentelement;g.appendchild(e);var h=j(e);l=200===b(h.width),g.removechild(e)}}}function h(a){if(e(),"string"==typeof a&&(a=document.queryselector(a)),a&&"object"==typeof a&&a.nodetype){var c=j(a);if("none"===c.display)return d();var f={};f.width=a.offsetwidth,f.height=a.offsetheight;for(var h=f.isborderbox=!(!k||!c[k]||"border-box"!==c[k]),m=0,n=g.length;n>m;m++){var o=g[m],p=c[o];p=i(a,p);var q=parsefloat(p);f[o]=isnan(q)?0:q}var r=f.paddingleft+f.paddingright,s=f.paddingtop+f.paddingbottom,t=f.marginleft+f.marginright,u=f.margintop+f.marginbottom,v=f.borderleftwidth+f.borderrightwidth,w=f.bordertopwidth+f.borderbottomwidth,x=h&&l,y=b(c.width);y!==!1&&(f.width=y+(x?0:r+v));var z=b(c.height);return z!==!1&&(f.height=z+(x?0:s+w)),f.innerwidth=f.width-(r+v),f.innerheight=f.height-(s+w),f.outerwidth=f.width+t,f.outerheight=f.height+u,f}}function i(b,c){if(a.getcomputedstyle||-1===c.indexof("%"))return c;var d=b.style,e=d.left,f=b.runtimestyle,g=f&&f.left;return g&&(f.left=b.currentstyle.left),d.left=c,c=d.pixelleft,d.left=e,g&&(f.left=g),c}var j,k,l,m=!1;return h}var f="undefined"==typeof console?c:function(a){console.error(a)},g=["paddingleft","paddingright","paddingtop","paddingbottom","marginleft","marginright","margintop","marginbottom","borderleftwidth","borderrightwidth","bordertopwidth","borderbottomwidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],e):"object"==typeof exports?module.exports=e(require("desandro-get-style-property")):a.getsize=e(a.getstyleproperty)}(window),function(a){function b(a,b){return a[g](b)}function c(a){if(!a.parentnode){var b=document.createdocumentfragment();b.appendchild(a)}}function d(a,b){c(a);for(var d=a.parentnode.queryselectorall(b),e=0,f=d.length;f>e;e++)if(d[e]===a)return!0;return!1}function e(a,d){return c(a),b(a,d)}var f,g=function(){if(a.matchesselector)return"matchesselector";for(var b=["webkit","moz","ms","o"],c=0,d=b.length;d>c;c++){var e=b[c],f=e+"matchesselector";if(a[f])return f}}();if(g){var h=document.createelement("div"),i=b(h,"div");f=i?b:e}else f=d;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return f}):"object"==typeof exports?module.exports=f:window.matchesselector=f}(element.prototype),function(a){function b(a,b){for(var c in b)a[c]=b[c];return a}function c(a){for(var b in a)return!1;return b=null,!0}function d(a){return a.replace(/([a-z])/g,function(a){return"-"+a.tolowercase()})}function e(a,e,f){function h(a,b){a&&(this.element=a,this.layout=b,this.position={x:0,y:0},this._create())}var i=f("transition"),j=f("transform"),k=i&&j,l=!!f("perspective"),m={webkittransition:"webkittransitionend",moztransition:"transitionend",otransition:"otransitionend",transition:"transitionend"}[i],n=["transform","transition","transitionduration","transitionproperty"],o=function(){for(var a={},b=0,c=n.length;c>b;b++){var d=n[b],e=f(d);e&&e!==d&&(a[d]=e)}return a}();b(h.prototype,a.prototype),h.prototype._create=function(){this._transn={ingproperties:{},clean:{},onend:{}},this.css({position:"absolute"})},h.prototype.handleevent=function(a){var b="on"+a.type;this[b]&&this[b](a)},h.prototype.getsize=function(){this.size=e(this.element)},h.prototype.css=function(a){var b=this.element.style;for(var c in a){var d=o[c]||c;b[d]=a[c]}},h.prototype.getposition=function(){var a=g(this.element),b=this.layout.options,c=b.isoriginleft,d=b.isorigintop,e=parseint(a[c?"left":"right"],10),f=parseint(a[d?"top":"bottom"],10);e=isnan(e)?0:e,f=isnan(f)?0:f;var h=this.layout.size;e-=c?h.paddingleft:h.paddingright,f-=d?h.paddingtop:h.paddingbottom,this.position.x=e,this.position.y=f},h.prototype.layoutposition=function(){var a=this.layout.size,b=this.layout.options,c={};b.isoriginleft?(c.left=this.position.x+a.paddingleft+"px",c.right=""):(c.right=this.position.x+a.paddingright+"px",c.left=""),b.isorigintop?(c.top=this.position.y+a.paddingtop+"px",c.bottom=""):(c.bottom=this.position.y+a.paddingbottom+"px",c.top=""),this.css(c),this.emitevent("layout",[this])};var p=l?function(a,b){return"translate3d("+a+"px, "+b+"px, 0)"}:function(a,b){return"translate("+a+"px, "+b+"px)"};h.prototype._transitionto=function(a,b){this.getposition();var c=this.position.x,d=this.position.y,e=parseint(a,10),f=parseint(b,10),g=e===this.position.x&&f===this.position.y;if(this.setposition(a,b),g&&!this.istransitioning)return void this.layoutposition();var h=a-c,i=b-d,j={},k=this.layout.options;h=k.isoriginleft?h:-h,i=k.isorigintop?i:-i,j.transform=p(h,i),this.transition({to:j,ontransitionend:{transform:this.layoutposition},iscleaning:!0})},h.prototype.goto=function(a,b){this.setposition(a,b),this.layoutposition()},h.prototype.moveto=k?h.prototype._transitionto:h.prototype.goto,h.prototype.setposition=function(a,b){this.position.x=parseint(a,10),this.position.y=parseint(b,10)},h.prototype._nontransition=function(a){this.css(a.to),a.iscleaning&&this._removestyles(a.to);for(var b in a.ontransitionend)a.ontransitionend[b].call(this)},h.prototype._transition=function(a){if(!parsefloat(this.layout.options.transitionduration))return void this._nontransition(a);var b=this._transn;for(var c in a.ontransitionend)b.onend[c]=a.ontransitionend[c];for(c in a.to)b.ingproperties[c]=!0,a.iscleaning&&(b.clean[c]=!0);if(a.from){this.css(a.from);var d=this.element.offsetheight;d=null}this.enabletransition(a.to),this.css(a.to),this.istransitioning=!0};var q=j&&d(j)+",opacity";h.prototype.enabletransition=function(){this.istransitioning||(this.css({transitionproperty:q,transitionduration:this.layout.options.transitionduration}),this.element.addeventlistener(m,this,!1))},h.prototype.transition=h.prototype[i?"_transition":"_nontransition"],h.prototype.onwebkittransitionend=function(a){this.ontransitionend(a)},h.prototype.onotransitionend=function(a){this.ontransitionend(a)};var r={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};h.prototype.ontransitionend=function(a){if(a.target===this.element){var b=this._transn,d=r[a.propertyname]||a.propertyname;if(delete b.ingproperties[d],c(b.ingproperties)&&this.disabletransition(),d in b.clean&&(this.element.style[a.propertyname]="",delete b.clean[d]),d in b.onend){var e=b.onend[d];e.call(this),delete b.onend[d]}this.emitevent("transitionend",[this])}},h.prototype.disabletransition=function(){this.removetransitionstyles(),this.element.removeeventlistener(m,this,!1),this.istransitioning=!1},h.prototype._removestyles=function(a){var b={};for(var c in a)b[c]="";this.css(b)};var s={transitionproperty:"",transitionduration:""};return h.prototype.removetransitionstyles=function(){this.css(s)},h.prototype.removeelem=function(){this.element.parentnode.removechild(this.element),this.emitevent("remove",[this])},h.prototype.remove=function(){if(!i||!parsefloat(this.layout.options.transitionduration))return void this.removeelem();var a=this;this.on("transitionend",function(){return a.removeelem(),!0}),this.hide()},h.prototype.reveal=function(){delete this.ishidden,this.css({display:""});var a=this.layout.options;this.transition({from:a.hiddenstyle,to:a.visiblestyle,iscleaning:!0})},h.prototype.hide=function(){this.ishidden=!0,this.css({display:""});var a=this.layout.options;this.transition({from:a.visiblestyle,to:a.hiddenstyle,iscleaning:!0,ontransitionend:{opacity:function(){this.ishidden&&this.css({display:"none"})}}})},h.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},h}var f=a.getcomputedstyle,g=f?function(a){return f(a,null)}:function(a){return a.currentstyle};"function"==typeof define&&define.amd?define("outlayer/item",["eventemitter/eventemitter","get-size/get-size","get-style-property/get-style-property"],e):"object"==typeof exports?module.exports=e(require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property")):(a.outlayer={},a.outlayer.item=e(a.eventemitter,a.getsize,a.getstyleproperty))}(window),function(a){function b(a,b){for(var c in b)a[c]=b[c];return a}function c(a){return"[object array]"===l.call(a)}function d(a){var b=[];if(c(a))b=a;else if(a&&"number"==typeof a.length)for(var d=0,e=a.length;e>d;d++)b.push(a[d]);else b.push(a);return b}function e(a,b){var c=n(b,a);-1!==c&&b.splice(c,1)}function f(a){return a.replace(/(.)([a-z])/g,function(a,b,c){return b+"-"+c}).tolowercase()}function g(c,g,l,n,o,p){function q(a,c){if("string"==typeof a&&(a=h.queryselector(a)),!a||!m(a))return void(i&&i.error("bad "+this.constructor.namespace+" element: "+a));this.element=a,this.options=b({},this.constructor.defaults),this.option(c);var d=++r;this.element.outlayerguid=d,s[d]=this,this._create(),this.options.isinitlayout&&this.layout()}var r=0,s={};return q.namespace="outlayer",q.item=p,q.defaults={containerstyle:{position:"relative"},isinitlayout:!0,isoriginleft:!0,isorigintop:!0,isresizebound:!0,isresizingcontainer:!0,transitionduration:"0.4s",hiddenstyle:{opacity:0,transform:"scale(0.001)"},visiblestyle:{opacity:1,transform:"scale(1)"}},b(q.prototype,l.prototype),q.prototype.option=function(a){b(this.options,a)},q.prototype._create=function(){this.reloaditems(),this.stamps=[],this.stamp(this.options.stamp),b(this.element.style,this.options.containerstyle),this.options.isresizebound&&this.bindresize()},q.prototype.reloaditems=function(){this.items=this._itemize(this.element.children)},q.prototype._itemize=function(a){for(var b=this._filterfinditemelements(a),c=this.constructor.item,d=[],e=0,f=b.length;f>e;e++){var g=b[e],h=new c(g,this);d.push(h)}return d},q.prototype._filterfinditemelements=function(a){a=d(a);for(var b=this.options.itemselector,c=[],e=0,f=a.length;f>e;e++){var g=a[e];if(m(g))if(b){o(g,b)&&c.push(g);for(var h=g.queryselectorall(b),i=0,j=h.length;j>i;i++)c.push(h[i])}else c.push(g)}return c},q.prototype.getitemelements=function(){for(var a=[],b=0,c=this.items.length;c>b;b++)a.push(this.items[b].element);return a},q.prototype.layout=function(){this._resetlayout(),this._managestamps();var a=void 0!==this.options.islayoutinstant?this.options.islayoutinstant:!this._islayoutinited;this.layoutitems(this.items,a),this._islayoutinited=!0},q.prototype._init=q.prototype.layout,q.prototype._resetlayout=function(){this.getsize()},q.prototype.getsize=function(){this.size=n(this.element)},q.prototype._getmeasurement=function(a,b){var c,d=this.options[a];d?("string"==typeof d?c=this.element.queryselector(d):m(d)&&(c=d),this[a]=c?n(c)[b]:d):this[a]=0},q.prototype.layoutitems=function(a,b){a=this._getitemsforlayout(a),this._layoutitems(a,b),this._postlayout()},q.prototype._getitemsforlayout=function(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c];e.isignored||b.push(e)}return b},q.prototype._layoutitems=function(a,b){function c(){d.emitevent("layoutcomplete",[d,a])}var d=this;if(!a||!a.length)return void c();this._itemson(a,"layout",c);for(var e=[],f=0,g=a.length;g>f;f++){var h=a[f],i=this._getitemlayoutposition(h);i.item=h,i.isinstant=b||h.islayoutinstant,e.push(i)}this._processlayoutqueue(e)},q.prototype._getitemlayoutposition=function(){return{x:0,y:0}},q.prototype._processlayoutqueue=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];this._positionitem(d.item,d.x,d.y,d.isinstant)}},q.prototype._positionitem=function(a,b,c,d){d?a.goto(b,c):a.moveto(b,c)},q.prototype._postlayout=function(){this.resizecontainer()},q.prototype.resizecontainer=function(){if(this.options.isresizingcontainer){var a=this._getcontainersize();a&&(this._setcontainermeasure(a.width,!0),this._setcontainermeasure(a.height,!1))}},q.prototype._getcontainersize=k,q.prototype._setcontainermeasure=function(a,b){if(void 0!==a){var c=this.size;c.isborderbox&&(a+=b?c.paddingleft+c.paddingright+c.borderleftwidth+c.borderrightwidth:c.paddingbottom+c.paddingtop+c.bordertopwidth+c.borderbottomwidth),a=math.max(a,0),this.element.style[b?"width":"height"]=a+"px"}},q.prototype._itemson=function(a,b,c){function d(){return e++,e===f&&c.call(g),!0}for(var e=0,f=a.length,g=this,h=0,i=a.length;i>h;h++){var j=a[h];j.on(b,d)}},q.prototype.ignore=function(a){var b=this.getitem(a);b&&(b.isignored=!0)},q.prototype.unignore=function(a){var b=this.getitem(a);b&&delete b.isignored},q.prototype.stamp=function(a){if(a=this._find(a)){this.stamps=this.stamps.concat(a);for(var b=0,c=a.length;c>b;b++){var d=a[b];this.ignore(d)}}},q.prototype.unstamp=function(a){if(a=this._find(a))for(var b=0,c=a.length;c>b;b++){var d=a[b];e(d,this.stamps),this.unignore(d)}},q.prototype._find=function(a){return a?("string"==typeof a&&(a=this.element.queryselectorall(a)),a=d(a)):void 0},q.prototype._managestamps=function(){if(this.stamps&&this.stamps.length){this._getboundingrect();for(var a=0,b=this.stamps.length;b>a;a++){var c=this.stamps[a];this._managestamp(c)}}},q.prototype._getboundingrect=function(){var a=this.element.getboundingclientrect(),b=this.size;this._boundingrect={left:a.left+b.paddingleft+b.borderleftwidth,top:a.top+b.paddingtop+b.bordertopwidth,right:a.right-(b.paddingright+b.borderrightwidth),bottom:a.bottom-(b.paddingbottom+b.borderbottomwidth)}},q.prototype._managestamp=k,q.prototype._getelementoffset=function(a){var b=a.getboundingclientrect(),c=this._boundingrect,d=n(a),e={left:b.left-c.left-d.marginleft,top:b.top-c.top-d.margintop,right:c.right-b.right-d.marginright,bottom:c.bottom-b.bottom-d.marginbottom};return e},q.prototype.handleevent=function(a){var b="on"+a.type;this[b]&&this[b](a)},q.prototype.bindresize=function(){this.isresizebound||(c.bind(a,"resize",this),this.isresizebound=!0)},q.prototype.unbindresize=function(){this.isresizebound&&c.unbind(a,"resize",this),this.isresizebound=!1},q.prototype.onresize=function(){function a(){b.resize(),delete b.resizetimeout}this.resizetimeout&&cleartimeout(this.resizetimeout);var b=this;this.resizetimeout=settimeout(a,100)},q.prototype.resize=function(){this.isresizebound&&this.needsresizelayout()&&this.layout()},q.prototype.needsresizelayout=function(){var a=n(this.element),b=this.size&&a;return b&&a.innerwidth!==this.size.innerwidth},q.prototype.additems=function(a){var b=this._itemize(a);return b.length&&(this.items=this.items.concat(b)),b},q.prototype.appended=function(a){var b=this.additems(a);b.length&&(this.layoutitems(b,!0),this.reveal(b))},q.prototype.prepended=function(a){var b=this._itemize(a);if(b.length){var c=this.items.slice(0);this.items=b.concat(c),this._resetlayout(),this._managestamps(),this.layoutitems(b,!0),this.reveal(b),this.layoutitems(c)}},q.prototype.reveal=function(a){var b=a&&a.length;if(b)for(var c=0;b>c;c++){var d=a[c];d.reveal()}},q.prototype.hide=function(a){var b=a&&a.length;if(b)for(var c=0;b>c;c++){var d=a[c];d.hide()}},q.prototype.getitem=function(a){for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];if(d.element===a)return d}},q.prototype.getitems=function(a){if(a&&a.length){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c],f=this.getitem(e);f&&b.push(f)}return b}},q.prototype.remove=function(a){a=d(a);var b=this.getitems(a);if(b&&b.length){this._itemson(b,"remove",function(){this.emitevent("removecomplete",[this,b])});for(var c=0,f=b.length;f>c;c++){var g=b[c];g.remove(),e(g,this.items)}}},q.prototype.destroy=function(){var a=this.element.style;a.height="",a.position="",a.width="";for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];d.destroy()}this.unbindresize();var e=this.element.outlayerguid;delete s[e],delete this.element.outlayerguid,j&&j.removedata(this.element,this.constructor.namespace)},q.data=function(a){var b=a&&a.outlayerguid;return b&&s[b]},q.create=function(a,c){function d(){q.apply(this,arguments)}return object.create?d.prototype=object.create(q.prototype):b(d.prototype,q.prototype),d.prototype.constructor=d,d.defaults=b({},q.defaults),b(d.defaults,c),d.prototype.settings={},d.namespace=a,d.data=q.data,d.item=function(){p.apply(this,arguments)},d.item.prototype=new p,g(function(){for(var b=f(a),c=h.queryselectorall(".js-"+b),e="data-"+b+"-options",g=0,k=c.length;k>g;g++){var l,m=c[g],n=m.getattribute(e);try{l=n&&json.parse(n)}catch(o){i&&i.error("error parsing "+e+" on "+m.nodename.tolowercase()+(m.id?"#"+m.id:"")+": "+o);continue}var p=new d(m,l);j&&j.data(m,a,p)}}),j&&j.bridget&&j.bridget(a,d),d},q.item=p,q}var h=a.document,i=a.console,j=a.jquery,k=function(){},l=object.prototype.tostring,m="function"==typeof htmlelement||"object"==typeof htmlelement?function(a){return a instanceof htmlelement}:function(a){return a&&"object"==typeof a&&1===a.nodetype&&"string"==typeof a.nodename},n=array.prototype.indexof?function(a,b){return a.indexof(b)}:function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1};"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","doc-ready/doc-ready","eventemitter/eventemitter","get-size/get-size","matches-selector/matches-selector","./item"],g):"object"==typeof exports?module.exports=g(require("eventie"),require("doc-ready"),require("wolfy87-eventemitter"),require("get-size"),require("desandro-matches-selector"),require("./item")):a.outlayer=g(a.eventie,a.docready,a.eventemitter,a.getsize,a.matchesselector,a.outlayer.item)}(window),function(a){function b(a,b){var d=a.create("masonry");return d.prototype._resetlayout=function(){this.getsize(),this._getmeasurement("columnwidth","outerwidth"),this._getmeasurement("gutter","outerwidth"),this.measurecolumns();var a=this.cols;for(this.colys=[];a--;)this.colys.push(0);this.maxy=0},d.prototype.measurecolumns=function(){if(this.getcontainerwidth(),!this.columnwidth){var a=this.items[0],c=a&&a.element;this.columnwidth=c&&b(c).outerwidth||this.containerwidth}this.columnwidth+=this.gutter,this.cols=math.floor((this.containerwidth+this.gutter)/this.columnwidth),this.cols=math.max(this.cols,1)},d.prototype.getcontainerwidth=function(){var a=this.options.isfitwidth?this.element.parentnode:this.element,c=b(a);this.containerwidth=c&&c.innerwidth},d.prototype._getitemlayoutposition=function(a){a.getsize();var b=a.size.outerwidth%this.columnwidth,d=b&&1>b?"round":"ceil",e=math[d](a.size.outerwidth/this.columnwidth);e=math.min(e,this.cols);for(var f=this._getcolgroup(e),g=math.min.apply(math,f),h=c(f,g),i={x:this.columnwidth*h,y:g},j=g+a.size.outerheight,k=this.cols+1-f.length,l=0;k>l;l++)this.colys[h+l]=j;return i},d.prototype._getcolgroup=function(a){if(2>a)return this.colys;for(var b=[],c=this.cols+1-a,d=0;c>d;d++){var e=this.colys.slice(d,d+a);b[d]=math.max.apply(math,e)}return b},d.prototype._managestamp=function(a){var c=b(a),d=this._getelementoffset(a),e=this.options.isoriginleft?d.left:d.right,f=e+c.outerwidth,g=math.floor(e/this.columnwidth);g=math.max(0,g);var h=math.floor(f/this.columnwidth);h-=f%this.columnwidth?0:1,h=math.min(this.cols-1,h);for(var i=(this.options.isorigintop?d.top:d.bottom)+c.outerheight,j=g;h>=j;j++)this.colys[j]=math.max(i,this.colys[j])},d.prototype._getcontainersize=function(){this.maxy=math.max.apply(math,this.colys);var a={height:this.maxy};return this.options.isfitwidth&&(a.width=this._getcontainerfitwidth()),a},d.prototype._getcontainerfitwidth=function(){for(var a=0,b=this.cols;--b&&0===this.colys[b];)a++;return(this.cols-a)*this.columnwidth-this.gutter},d.prototype.needsresizelayout=function(){var a=this.containerwidth;return this.getcontainerwidth(),a!==this.containerwidth},d}var c=array.prototype.indexof?function(a,b){return a.indexof(b)}:function(a,b){for(var c=0,d=a.length;d>c;c++){var e=a[c];if(e===b)return c}return-1};"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],b):"object"==typeof exports?module.exports=b(require("outlayer"),require("get-size")):a.masonry=b(a.outlayer,a.getsize)}(window);