/*! * imagesloaded packaged v4.1.1 * javascript is all like "you images are done yet or what?" * mit license */ !function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.evemitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexof(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceevents=this._onceevents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexof(e);return-1!=n&&i.splice(n,1),this}},e.emitevent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var r=this._onceevents&&this._onceevents[t];o;){var s=r&&r[o];s&&(this.off(t,o),delete r[o]),o.apply(this,e),n+=s?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesloaded=e(t,t.evemitter)}(window,function(t,e){function i(t,e){for(var i in e)t[i]=e[i];return t}function n(t){var e=[];if(array.isarray(t))e=t;else if("number"==typeof t.length)for(var i=0;ih;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}(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){"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(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.matches)return"matches";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,b){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["doc-ready/doc-ready","matches-selector/matches-selector"],function(c,d){return b(a,c,d)}):"object"==typeof exports?module.exports=b(a,require("doc-ready"),require("desandro-matches-selector")):a.fizzyuiutils=b(a,a.docready,a.matchesselector)}(window,function(a,b,c){var d={};d.extend=function(a,b){for(var c in b)a[c]=b[c];return a},d.modulo=function(a,b){return(a%b+b)%b};var e=object.prototype.tostring;d.isarray=function(a){return"[object array]"==e.call(a)},d.makearray=function(a){var b=[];if(d.isarray(a))b=a;else if(a&&"number"==typeof a.length)for(var c=0,e=a.length;e>c;c++)b.push(a[c]);else b.push(a);return b},d.indexof=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},d.removefrom=function(a,b){var c=d.indexof(a,b);-1!=c&&a.splice(c,1)},d.iselement="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},d.settext=function(){function a(a,c){b=b||(void 0!==document.documentelement.textcontent?"textcontent":"innertext"),a[b]=c}var b;return a}(),d.getparent=function(a,b){for(;a!=document.body;)if(a=a.parentnode,c(a,b))return a},d.getqueryelement=function(a){return"string"==typeof a?document.queryselector(a):a},d.handleevent=function(a){var b="on"+a.type;this[b]&&this[b](a)},d.filterfindelements=function(a,b){a=d.makearray(a);for(var e=[],f=0,g=a.length;g>f;f++){var h=a[f];if(d.iselement(h))if(b){c(h,b)&&e.push(h);for(var i=h.queryselectorall(b),j=0,k=i.length;k>j;j++)e.push(i[j])}else e.push(h)}return e},d.debouncemethod=function(a,b,c){var d=a.prototype[b],e=b+"timeout";a.prototype[b]=function(){var a=this[e];a&&cleartimeout(a);var b=arguments,f=this;this[e]=settimeout(function(){d.apply(f,b),delete f[e]},c||100)}},d.todashed=function(a){return a.replace(/(.)([a-z])/g,function(a,b,c){return b+"-"+c}).tolowercase()};var f=a.console;return d.htmlinit=function(c,e){b(function(){for(var b=d.todashed(e),g=document.queryselectorall(".js-"+b),h="data-"+b+"-options",i=0,j=g.length;j>i;i++){var k,l=g[i],m=l.getattribute(h);try{k=m&&json.parse(m)}catch(n){f&&f.error("error parsing "+h+" on "+l.nodename.tolowercase()+(l.id?"#"+l.id:"")+": "+n);continue}var o=new c(l,k),p=a.jquery;p&&p.data(l,e,o)}})},d}),function(a,b){"function"==typeof define&&define.amd?define("outlayer/item",["eventemitter/eventemitter","get-size/get-size","get-style-property/get-style-property","fizzy-ui-utils/utils"],function(c,d,e,f){return b(a,c,d,e,f)}):"object"==typeof exports?module.exports=b(a,require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property"),require("fizzy-ui-utils")):(a.outlayer={},a.outlayer.item=b(a,a.eventemitter,a.getsize,a.getstyleproperty,a.fizzyuiutils))}(window,function(a,b,c,d,e){function f(a){for(var b in a)return!1;return b=null,!0}function g(a,b){a&&(this.element=a,this.layout=b,this.position={x:0,y:0},this._create())}function h(a){return a.replace(/([a-z])/g,function(a){return"-"+a.tolowercase()})}var i=a.getcomputedstyle,j=i?function(a){return i(a,null)}:function(a){return a.currentstyle},k=d("transition"),l=d("transform"),m=k&&l,n=!!d("perspective"),o={webkittransition:"webkittransitionend",moztransition:"transitionend",otransition:"otransitionend",transition:"transitionend"}[k],p=["transform","transition","transitionduration","transitionproperty"],q=function(){for(var a={},b=0,c=p.length;c>b;b++){var e=p[b],f=d(e);f&&f!==e&&(a[e]=f)}return a}();e.extend(g.prototype,b.prototype),g.prototype._create=function(){this._transn={ingproperties:{},clean:{},onend:{}},this.css({position:"absolute"})},g.prototype.handleevent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.getsize=function(){this.size=c(this.element)},g.prototype.css=function(a){var b=this.element.style;for(var c in a){var d=q[c]||c;b[d]=a[c]}},g.prototype.getposition=function(){var a=j(this.element),b=this.layout.options,c=b.isoriginleft,d=b.isorigintop,e=a[c?"left":"right"],f=a[d?"top":"bottom"],g=this.layout.size,h=-1!=e.indexof("%")?parsefloat(e)/100*g.width:parseint(e,10),i=-1!=f.indexof("%")?parsefloat(f)/100*g.height:parseint(f,10);h=isnan(h)?0:h,i=isnan(i)?0:i,h-=c?g.paddingleft:g.paddingright,i-=d?g.paddingtop:g.paddingbottom,this.position.x=h,this.position.y=i},g.prototype.layoutposition=function(){var a=this.layout.size,b=this.layout.options,c={},d=b.isoriginleft?"paddingleft":"paddingright",e=b.isoriginleft?"left":"right",f=b.isoriginleft?"right":"left",g=this.position.x+a[d];c[e]=this.getxvalue(g),c[f]="";var h=b.isorigintop?"paddingtop":"paddingbottom",i=b.isorigintop?"top":"bottom",j=b.isorigintop?"bottom":"top",k=this.position.y+a[h];c[i]=this.getyvalue(k),c[j]="",this.css(c),this.emitevent("layout",[this])},g.prototype.getxvalue=function(a){var b=this.layout.options;return b.percentposition&&!b.ishorizontal?a/this.layout.size.width*100+"%":a+"px"},g.prototype.getyvalue=function(a){var b=this.layout.options;return b.percentposition&&b.ishorizontal?a/this.layout.size.height*100+"%":a+"px"},g.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={};j.transform=this.gettranslate(h,i),this.transition({to:j,ontransitionend:{transform:this.layoutposition},iscleaning:!0})},g.prototype.gettranslate=function(a,b){var c=this.layout.options;return a=c.isoriginleft?a:-a,b=c.isorigintop?b:-b,n?"translate3d("+a+"px, "+b+"px, 0)":"translate("+a+"px, "+b+"px)"},g.prototype.goto=function(a,b){this.setposition(a,b),this.layoutposition()},g.prototype.moveto=m?g.prototype._transitionto:g.prototype.goto,g.prototype.setposition=function(a,b){this.position.x=parseint(a,10),this.position.y=parseint(b,10)},g.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)},g.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 r="opacity,"+h(q.transform||"transform");g.prototype.enabletransition=function(){this.istransitioning||(this.css({transitionproperty:r,transitionduration:this.layout.options.transitionduration}),this.element.addeventlistener(o,this,!1))},g.prototype.transition=g.prototype[k?"_transition":"_nontransition"],g.prototype.onwebkittransitionend=function(a){this.ontransitionend(a)},g.prototype.onotransitionend=function(a){this.ontransitionend(a)};var s={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};g.prototype.ontransitionend=function(a){if(a.target===this.element){var b=this._transn,c=s[a.propertyname]||a.propertyname;if(delete b.ingproperties[c],f(b.ingproperties)&&this.disabletransition(),c in b.clean&&(this.element.style[a.propertyname]="",delete b.clean[c]),c in b.onend){var d=b.onend[c];d.call(this),delete b.onend[c]}this.emitevent("transitionend",[this])}},g.prototype.disabletransition=function(){this.removetransitionstyles(),this.element.removeeventlistener(o,this,!1),this.istransitioning=!1},g.prototype._removestyles=function(a){var b={};for(var c in a)b[c]="";this.css(b)};var t={transitionproperty:"",transitionduration:""};return g.prototype.removetransitionstyles=function(){this.css(t)},g.prototype.removeelem=function(){this.element.parentnode.removechild(this.element),this.css({display:""}),this.emitevent("remove",[this])},g.prototype.remove=function(){if(!k||!parsefloat(this.layout.options.transitionduration))return void this.removeelem();var a=this;this.once("transitionend",function(){a.removeelem()}),this.hide()},g.prototype.reveal=function(){delete this.ishidden,this.css({display:""});var a=this.layout.options,b={},c=this.gethiderevealtransitionendproperty("visiblestyle");b[c]=this.onrevealtransitionend,this.transition({from:a.hiddenstyle,to:a.visiblestyle,iscleaning:!0,ontransitionend:b})},g.prototype.onrevealtransitionend=function(){this.ishidden||this.emitevent("reveal")},g.prototype.gethiderevealtransitionendproperty=function(a){var b=this.layout.options[a];if(b.opacity)return"opacity";for(var c in b)return c},g.prototype.hide=function(){this.ishidden=!0,this.css({display:""});var a=this.layout.options,b={},c=this.gethiderevealtransitionendproperty("hiddenstyle");b[c]=this.onhidetransitionend,this.transition({from:a.visiblestyle,to:a.hiddenstyle,iscleaning:!0,ontransitionend:b})},g.prototype.onhidetransitionend=function(){this.ishidden&&(this.css({display:"none"}),this.emitevent("hide"))},g.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},g}),function(a,b){"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","eventemitter/eventemitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(c,d,e,f,g){return b(a,c,d,e,f,g)}):"object"==typeof exports?module.exports=b(a,require("eventie"),require("wolfy87-eventemitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):a.outlayer=b(a,a.eventie,a.eventemitter,a.getsize,a.fizzyuiutils,a.outlayer.item)}(window,function(a,b,c,d,e,f){function g(a,b){var c=e.getqueryelement(a);if(!c)return void(h&&h.error("bad element for "+this.constructor.namespace+": "+(c||a)));this.element=c,i&&(this.$element=i(this.element)),this.options=e.extend({},this.constructor.defaults),this.option(b);var d=++k;this.element.outlayerguid=d,l[d]=this,this._create(),this.options.isinitlayout&&this.layout()}var h=a.console,i=a.jquery,j=function(){},k=0,l={};return g.namespace="outlayer",g.item=f,g.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)"}},e.extend(g.prototype,c.prototype),g.prototype.option=function(a){e.extend(this.options,a)},g.prototype._create=function(){this.reloaditems(),this.stamps=[],this.stamp(this.options.stamp),e.extend(this.element.style,this.options.containerstyle),this.options.isresizebound&&this.bindresize()},g.prototype.reloaditems=function(){this.items=this._itemize(this.element.children)},g.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},g.prototype._filterfinditemelements=function(a){return e.filterfindelements(a,this.options.itemselector)},g.prototype.getitemelements=function(){for(var a=[],b=0,c=this.items.length;c>b;b++)a.push(this.items[b].element);return a},g.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},g.prototype._init=g.prototype.layout,g.prototype._resetlayout=function(){this.getsize()},g.prototype.getsize=function(){this.size=d(this.element)},g.prototype._getmeasurement=function(a,b){var c,f=this.options[a];f?("string"==typeof f?c=this.element.queryselector(f):e.iselement(f)&&(c=f),this[a]=c?d(c)[b]:f):this[a]=0},g.prototype.layoutitems=function(a,b){a=this._getitemsforlayout(a),this._layoutitems(a,b),this._postlayout()},g.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},g.prototype._layoutitems=function(a,b){if(this._emitcompleteonitems("layout",a),a&&a.length){for(var c=[],d=0,e=a.length;e>d;d++){var f=a[d],g=this._getitemlayoutposition(f);g.item=f,g.isinstant=b||f.islayoutinstant,c.push(g)}this._processlayoutqueue(c)}},g.prototype._getitemlayoutposition=function(){return{x:0,y:0}},g.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)}},g.prototype._positionitem=function(a,b,c,d){d?a.goto(b,c):a.moveto(b,c)},g.prototype._postlayout=function(){this.resizecontainer()},g.prototype.resizecontainer=function(){if(this.options.isresizingcontainer){var a=this._getcontainersize();a&&(this._setcontainermeasure(a.width,!0),this._setcontainermeasure(a.height,!1))}},g.prototype._getcontainersize=j,g.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"}},g.prototype._emitcompleteonitems=function(a,b){function c(){e.dispatchevent(a+"complete",null,[b])}function d(){g++,g===f&&c()}var e=this,f=b.length;if(!b||!f)return void c();for(var g=0,h=0,i=b.length;i>h;h++){var j=b[h];j.once(a,d)}},g.prototype.dispatchevent=function(a,b,c){var d=b?[b].concat(c):c;if(this.emitevent(a,d),i)if(this.$element=this.$element||i(this.element),b){var e=i.event(b);e.type=a,this.$element.trigger(e,c)}else this.$element.trigger(a,c)},g.prototype.ignore=function(a){var b=this.getitem(a);b&&(b.isignored=!0)},g.prototype.unignore=function(a){var b=this.getitem(a);b&&delete b.isignored},g.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)}}},g.prototype.unstamp=function(a){if(a=this._find(a))for(var b=0,c=a.length;c>b;b++){var d=a[b];e.removefrom(this.stamps,d),this.unignore(d)}},g.prototype._find=function(a){return a?("string"==typeof a&&(a=this.element.queryselectorall(a)),a=e.makearray(a)):void 0},g.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)}}},g.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)}},g.prototype._managestamp=j,g.prototype._getelementoffset=function(a){var b=a.getboundingclientrect(),c=this._boundingrect,e=d(a),f={left:b.left-c.left-e.marginleft,top:b.top-c.top-e.margintop,right:c.right-b.right-e.marginright,bottom:c.bottom-b.bottom-e.marginbottom};return f},g.prototype.handleevent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.bindresize=function(){this.isresizebound||(b.bind(a,"resize",this),this.isresizebound=!0)},g.prototype.unbindresize=function(){this.isresizebound&&b.unbind(a,"resize",this),this.isresizebound=!1},g.prototype.onresize=function(){function a(){b.resize(),delete b.resizetimeout}this.resizetimeout&&cleartimeout(this.resizetimeout);var b=this;this.resizetimeout=settimeout(a,100)},g.prototype.resize=function(){this.isresizebound&&this.needsresizelayout()&&this.layout()},g.prototype.needsresizelayout=function(){var a=d(this.element),b=this.size&&a;return b&&a.innerwidth!==this.size.innerwidth},g.prototype.additems=function(a){var b=this._itemize(a);return b.length&&(this.items=this.items.concat(b)),b},g.prototype.appended=function(a){var b=this.additems(a);b.length&&(this.layoutitems(b,!0),this.reveal(b))},g.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)}},g.prototype.reveal=function(a){this._emitcompleteonitems("reveal",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.reveal()}},g.prototype.hide=function(a){this._emitcompleteonitems("hide",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.hide()}},g.prototype.revealitemelements=function(a){var b=this.getitems(a);this.reveal(b)},g.prototype.hideitemelements=function(a){var b=this.getitems(a);this.hide(b)},g.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}},g.prototype.getitems=function(a){a=e.makearray(a);for(var b=[],c=0,d=a.length;d>c;c++){var f=a[c],g=this.getitem(f);g&&b.push(g)}return b},g.prototype.remove=function(a){var b=this.getitems(a);if(this._emitcompleteonitems("remove",b),b&&b.length)for(var c=0,d=b.length;d>c;c++){var f=b[c];f.remove(),e.removefrom(this.items,f)}},g.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 l[e],delete this.element.outlayerguid,i&&i.removedata(this.element,this.constructor.namespace)},g.data=function(a){a=e.getqueryelement(a);var b=a&&a.outlayerguid;return b&&l[b]},g.create=function(a,b){function c(){g.apply(this,arguments)}return object.create?c.prototype=object.create(g.prototype):e.extend(c.prototype,g.prototype),c.prototype.constructor=c,c.defaults=e.extend({},g.defaults),e.extend(c.defaults,b),c.prototype.settings={},c.namespace=a,c.data=g.data,c.item=function(){f.apply(this,arguments)},c.item.prototype=new f,e.htmlinit(c,a),i&&i.bridget&&i.bridget(a,c),c},g.item=f,g}),function(a,b){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","fizzy-ui-utils/utils"],b):"object"==typeof exports?module.exports=b(require("outlayer"),require("get-size"),require("fizzy-ui-utils")):a.masonry=b(a.outlayer,a.getsize,a.fizzyuiutils)}(window,function(a,b,c){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}var d=this.columnwidth+=this.gutter,e=this.containerwidth+this.gutter,f=e/d,g=d-e%d,h=g&&1>g?"round":"floor";f=math[h](f),this.cols=math.max(f,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.indexof(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});