2019-05-31 23:37:11 +02:00

2 lines
24 KiB
JavaScript

!function(t){var e=Array.prototype.slice;function i(){}function n(t){if(t){var n="undefined"==typeof console?i:function(t){console.error(t)};return t.bridget=function(i,o){!function(e){e.prototype.option||(e.prototype.option=function(e){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))})}(o),function(i,o){t.fn[i]=function(r){if("string"==typeof r){for(var s=e.call(arguments,1),a=0,h=this.length;a<h;a++){var p=this[a],u=t.data(p,i);if(u)if(t.isFunction(u[r])&&"_"!==r.charAt(0)){var f=u[r].apply(u,s);if(void 0!==f)return f}else n("no such method '"+r+"' for "+i+" instance");else n("cannot call methods on "+i+" prior to initialization; attempted to call '"+r+"'")}return this}return this.each(function(){var e=t.data(this,i);e?(e.option(r),e._init()):(e=new o(this,r),t.data(this,i,e))})}}(i,o)},t.bridget}}"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],n):n(t.jQuery)}(window),function(t){var e=document.documentElement,i=function(){};function n(e){var i=t.event;return i.target=i.target||i.srcElement||e,i}e.addEventListener?i=function(t,e,i){t.addEventListener(e,i,!1)}:e.attachEvent&&(i=function(t,e,i){t[e+i]=i.handleEvent?function(){var e=n(t);i.handleEvent.call(i,e)}:function(){var e=n(t);i.call(t,e)},t.attachEvent("on"+e,t[e+i])});var o=function(){};e.removeEventListener?o=function(t,e,i){t.removeEventListener(e,i,!1)}:e.detachEvent&&(o=function(t,e,i){t.detachEvent("on"+e,t[e+i]);try{delete t[e+i]}catch(n){t[e+i]=void 0}});var r={bind:i,unbind:o};"function"==typeof define&&define.amd?define("eventie/eventie",r):"object"==typeof exports?module.exports=r:t.eventie=r}(this),function(t){var e=t.document,i=[];function n(t){"function"==typeof t&&(n.isReady?t():i.push(t))}function o(t){var o="readystatechange"===t.type&&"complete"!==e.readyState;if(!n.isReady&&!o){n.isReady=!0;for(var r=0,s=i.length;r<s;r++){(0,i[r])()}}}function r(i){return i.bind(e,"DOMContentLoaded",o),i.bind(e,"readystatechange",o),i.bind(t,"load",o),n}n.isReady=!1,"function"==typeof define&&define.amd?(n.isReady="function"==typeof requirejs,define("doc-ready/doc-ready",["eventie/eventie"],r)):t.docReady=r(t.eventie)}(this),function(){function t(){}var e=t.prototype,i=this,n=i.EventEmitter;function o(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function r(t){return function(){return this[t].apply(this,arguments)}}e.getListeners=function(t){var e,i,n=this._getEvents();if(t instanceof RegExp)for(i in e={},n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i]);else e=n[t]||(n[t]=[]);return e},e.flattenListeners=function(t){var e,i=[];for(e=0;e<t.length;e+=1)i.push(t[e].listener);return i},e.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&((e={})[t]=i),e||i},e.addListener=function(t,e){var i,n=this.getListenersAsObject(t),r="object"==typeof e;for(i in n)n.hasOwnProperty(i)&&-1===o(n[i],e)&&n[i].push(r?e:{listener:e,once:!1});return this},e.on=r("addListener"),e.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},e.once=r("addOnceListener"),e.defineEvent=function(t){return this.getListeners(t),this},e.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},e.removeListener=function(t,e){var i,n,r=this.getListenersAsObject(t);for(n in r)r.hasOwnProperty(n)&&-1!==(i=o(r[n],e))&&r[n].splice(i,1);return this},e.off=r("removeListener"),e.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},e.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},e.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},e.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"===i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},e.removeAllListeners=r("removeEvent"),e.emitEvent=function(t,e){var i,n,o,r=this.getListenersAsObject(t);for(o in r)if(r.hasOwnProperty(o))for(n=r[o].length;n--;)!0===(i=r[o][n]).once&&this.removeListener(t,i.listener),i.listener.apply(this,e||[])===this._getOnceReturnValue()&&this.removeListener(t,i.listener);return this},e.trigger=r("emitEvent"),e.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},e.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},e._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},e._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return i.EventEmitter=n,t},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return t}):"object"==typeof module&&module.exports?module.exports=t:this.EventEmitter=t}.call(this),function(t){var e="Webkit Moz ms Ms O".split(" "),i=document.documentElement.style;function n(t){if(t){if("string"==typeof i[t])return t;var n;t=t.charAt(0).toUpperCase()+t.slice(1);for(var o=0,r=e.length;o<r;o++)if(n=e[o]+t,"string"==typeof i[n])return n}}"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return n}):"object"==typeof exports?module.exports=n:t.getStyleProperty=n}(window),function(t,e){var i=t.getComputedStyle,n=i?function(t){return i(t,null)}:function(t){return t.currentStyle};function o(t){var e=parseFloat(t);return-1===t.indexOf("%")&&!isNaN(e)&&e}var r=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];function s(t){var e,s=t("boxSizing");function a(t,e){if(i||-1===e.indexOf("%"))return e;var n=t.style,o=n.left,r=t.runtimeStyle,s=r&&r.left;return s&&(r.left=t.currentStyle.left),n.left=e,e=n.pixelLeft,n.left=o,s&&(r.left=s),e}return function(){if(s){var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style[s]="border-box";var i=document.body||document.documentElement;i.appendChild(t);var r=n(t);e=200===o(r.width),i.removeChild(t)}}(),function(t){if("string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var i=n(t);if("none"===i.display)return function(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0,i=r.length;e<i;e++)t[r[e]]=0;return t}();var h={};h.width=t.offsetWidth,h.height=t.offsetHeight;for(var p=h.isBorderBox=!(!s||!i[s]||"border-box"!==i[s]),u=0,f=r.length;u<f;u++){var l=r[u],c=i[l];c=a(t,c);var d=parseFloat(c);h[l]=isNaN(d)?0:d}var m=h.paddingLeft+h.paddingRight,y=h.paddingTop+h.paddingBottom,g=h.marginLeft+h.marginRight,v=h.marginTop+h.marginBottom,b=h.borderLeftWidth+h.borderRightWidth,_=h.borderTopWidth+h.borderBottomWidth,E=p&&e,L=o(i.width);!1!==L&&(h.width=L+(E?0:m+b));var x=o(i.height);return!1!==x&&(h.height=x+(E?0:y+_)),h.innerWidth=h.width-(m+b),h.innerHeight=h.height-(y+_),h.outerWidth=h.width+g,h.outerHeight=h.height+v,h}}}"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],s):"object"==typeof exports?module.exports=s(require("get-style-property")):t.getSize=s(t.getStyleProperty)}(window),function(t,e){var i,n=function(){if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],i=0,n=t.length;i<n;i++){var o=t[i]+"MatchesSelector";if(e[o])return o}}();function o(t,e){return t[n](e)}function r(t){t.parentNode||document.createDocumentFragment().appendChild(t)}if(n){var s=o(document.createElement("div"),"div");i=s?o:function(t,e){return r(t),o(t,e)}}else i=function(t,e){r(t);for(var i=t.parentNode.querySelectorAll(e),n=0,o=i.length;n<o;n++)if(i[n]===t)return!0;return!1};"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return i}):window.matchesSelector=i}(0,Element.prototype),function(t){var e=document.defaultView,i=e&&e.getComputedStyle?function(t){return e.getComputedStyle(t,null)}:function(t){return t.currentStyle};function n(t,e,n){var o=n("transition"),r=n("transform"),s=o&&r,a=!!n("perspective"),h={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[o],p=["transform","transition","transitionDuration","transitionProperty"],u=function(){for(var t={},e=0,i=p.length;e<i;e++){var o=p[e],r=n(o);r&&r!==o&&(t[o]=r)}return t}();function f(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}!function(t,e){for(var i in e)t[i]=e[i]}(f.prototype,t.prototype),f.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},f.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},f.prototype.getSize=function(){this.size=e(this.element)},f.prototype.css=function(t){var e=this.element.style;for(var i in t){e[u[i]||i]=t[i]}},f.prototype.getPosition=function(){var t=i(this.element),e=this.layout.options,n=e.isOriginLeft,o=e.isOriginTop,r=parseInt(t[n?"left":"right"],10),s=parseInt(t[o?"top":"bottom"],10);r=isNaN(r)?0:r,s=isNaN(s)?0:s;var a=this.layout.size;r-=n?a.paddingLeft:a.paddingRight,s-=o?a.paddingTop:a.paddingBottom,this.position.x=r,this.position.y=s},f.prototype.layoutPosition=function(){var t=this.layout.size,e=this.layout.options,i={};e.isOriginLeft?(i.left=this.position.x+t.paddingLeft+"px",i.right=""):(i.right=this.position.x+t.paddingRight+"px",i.left=""),e.isOriginTop?(i.top=this.position.y+t.paddingTop+"px",i.bottom=""):(i.bottom=this.position.y+t.paddingBottom+"px",i.top=""),this.css(i),this.emitEvent("layout",[this])};var l=a?function(t,e){return"translate3d("+t+"px, "+e+"px, 0)"}:function(t,e){return"translate("+t+"px, "+e+"px)"};f.prototype._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=parseInt(t,10),r=parseInt(e,10),s=o===this.position.x&&r===this.position.y;if(this.setPosition(t,e),!s||this.isTransitioning){var a=t-i,h=e-n,p={},u=this.layout.options;a=u.isOriginLeft?a:-a,h=u.isOriginTop?h:-h,p.transform=l(a,h),this.transition({to:p,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})}else this.layoutPosition()},f.prototype.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},f.prototype.moveTo=s?f.prototype._transitionTo:f.prototype.goTo,f.prototype.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10)},f.prototype._nonTransition=function(t){for(var e in this.css(t.to),t.isCleaning&&this._removeStyles(t.to),t.onTransitionEnd)t.onTransitionEnd[e].call(this)},f.prototype._transition=function(t){if(parseFloat(this.layout.options.transitionDuration)){var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);this.element.offsetHeight;null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0}else this._nonTransition(t)};var c=r&&r.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})+",opacity";f.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:c,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(h,this,!1))},f.prototype.transition=f.prototype[o?"_transition":"_nonTransition"],f.prototype.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},f.prototype.onotransitionend=function(t){this.ontransitionend(t)};var d={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};f.prototype.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,i=d[t.propertyName]||t.propertyName;if(delete e.ingProperties[i],function(t){for(var e in t)return!1;return!0}(e.ingProperties)&&this.disableTransition(),i in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[i]),i in e.onEnd)e.onEnd[i].call(this),delete e.onEnd[i];this.emitEvent("transitionEnd",[this])}},f.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(h,this,!1),this.isTransitioning=!1},f.prototype._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var m={transitionProperty:"",transitionDuration:""};return f.prototype.removeTransitionStyles=function(){this.css(m)},f.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.emitEvent("remove",[this])},f.prototype.remove=function(){if(o&&parseFloat(this.layout.options.transitionDuration)){var t=this;this.on("transitionEnd",function(){return t.removeElem(),!0}),this.hide()}else this.removeElem()},f.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options;this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0})},f.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options;this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:{opacity:function(){this.isHidden&&this.css({display:"none"})}}})},f.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},f}"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property"],n):(t.Outlayer={},t.Outlayer.Item=n(t.EventEmitter,t.getSize,t.getStyleProperty))}(window),function(t){var e=t.document,i=t.console,n=t.jQuery,o=function(){};function r(t,e){for(var i in e)t[i]=e[i];return t}var s=Object.prototype.toString;function a(t){var e=[];if(function(t){return"[object Array]"===s.call(t)}(t))e=t;else if(t&&"number"==typeof t.length)for(var i=0,n=t.length;i<n;i++)e.push(t[i]);else e.push(t);return e}var h="object"==typeof HTMLElement?function(t){return t instanceof HTMLElement}:function(t){return t&&"object"==typeof t&&1===t.nodeType&&"string"==typeof t.nodeName},p=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1};function u(t,e){var i=p(e,t);-1!==i&&e.splice(i,1)}function f(s,p,f,l,c,d){var m=0,y={};function g(t,n){if("string"==typeof t&&(t=e.querySelector(t)),t&&h(t)){this.element=t,this.options=r({},this.options),this.option(n);var o=++m;this.element.outlayerGUID=o,y[o]=this,this._create(),this.options.isInitLayout&&this.layout()}else i&&i.error("Bad "+this.constructor.namespace+" element: "+t)}return g.namespace="outlayer",g.Item=d,g.prototype.options={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},r(g.prototype,f.prototype),g.prototype.option=function(t){r(this.options,t)},g.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),r(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(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0,r=e.length;o<r;o++){var s=new i(e[o],this);n.push(s)}return n},g.prototype._filterFindItemElements=function(t){t=a(t);for(var e=this.options.itemSelector,i=[],n=0,o=t.length;n<o;n++){var r=t[n];if(h(r))if(e){c(r,e)&&i.push(r);for(var s=r.querySelectorAll(e),p=0,u=s.length;p<u;p++)i.push(s[p])}else i.push(r)}return i},g.prototype.getAllItems=function(){for(var t=[],e=0,i=this.items.length;e<i;e++)t.push(this.items[e]);return t},g.prototype.getItemElements=function(){for(var t=[],e=0,i=this.items.length;e<i;e++)t.push(this.items[e].element);return t},g.prototype.layout=function(){this._resetLayout(),this._manageStamps();var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,t),this._isLayoutInited=!0},g.prototype._init=g.prototype.layout,g.prototype._resetLayout=function(){this.getSize()},g.prototype.getSize=function(){this.size=l(this.element)},g.prototype._getMeasurement=function(t,e){var i,n=this.options[t];n?("string"==typeof n?i=this.element.querySelector(n):h(n)&&(i=n),this[t]=i?l(i)[e]:n):this[t]=0},g.prototype.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},g.prototype._getItemsForLayout=function(t){for(var e=[],i=0,n=t.length;i<n;i++){var o=t[i];o.isIgnored||e.push(o)}return e},g.prototype._layoutItems=function(t,e){var i=this;function n(){i.emitEvent("layoutComplete",[i,t])}if(t&&t.length){this._itemsOn(t,"layout",n);for(var o=[],r=0,s=t.length;r<s;r++){var a=t[r],h=this._getItemLayoutPosition(a);h.item=a,h.isInstant=e||a.isLayoutInstant,o.push(h)}this._processLayoutQueue(o)}else n()},g.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},g.prototype._processLayoutQueue=function(t){for(var e=0,i=t.length;e<i;e++){var n=t[e];this._positionItem(n.item,n.x,n.y,n.isInstant)}},g.prototype._positionItem=function(t,e,i,n){n?t.goTo(e,i):t.moveTo(e,i)},g.prototype._postLayout=function(){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1))},g.prototype._getContainerSize=o,g.prototype._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},g.prototype._itemsOn=function(t,e,i){var n=0,o=t.length,r=this;function s(){return++n===o&&i.call(r),!0}for(var a=0,h=t.length;a<h;a++){t[a].on(e,s)}},g.prototype.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},g.prototype.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},g.prototype.stamp=function(t){if(t=this._find(t)){this.stamps=this.stamps.concat(t);for(var e=0,i=t.length;e<i;e++){var n=t[e];this.ignore(n)}}},g.prototype.unstamp=function(t){if(t=this._find(t))for(var e=0,i=t.length;e<i;e++){var n=t[e];u(n,this.stamps),this.unignore(n)}},g.prototype._find=function(t){if(t)return"string"==typeof t&&(t=this.element.querySelectorAll(t)),t=a(t)},g.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var t=0,e=this.stamps.length;t<e;t++){var i=this.stamps[t];this._manageStamp(i)}}},g.prototype._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},g.prototype._manageStamp=o,g.prototype._getElementOffset=function(t){var e=t.getBoundingClientRect(),i=this._boundingRect,n=l(t);return{left:e.left-i.left-n.marginLeft,top:e.top-i.top-n.marginTop,right:i.right-e.right-n.marginRight,bottom:i.bottom-e.bottom-n.marginBottom}},g.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},g.prototype.bindResize=function(){this.isResizeBound||(s.bind(t,"resize",this),this.isResizeBound=!0)},g.prototype.unbindResize=function(){s.unbind(t,"resize",this),this.isResizeBound=!1},g.prototype.onresize=function(){this.resizeTimeout&&clearTimeout(this.resizeTimeout);var t=this;this.resizeTimeout=setTimeout(function(){t.resize(),delete t.resizeTimeout},100)},g.prototype.resize=function(){var t=l(this.element);this.size&&t&&t.innerWidth===this.size.innerWidth||this.layout()},g.prototype.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},g.prototype.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},g.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},g.prototype.reveal=function(t){var e=t&&t.length;if(e)for(var i=0;i<e;i++){t[i].reveal()}},g.prototype.hide=function(t){var e=t&&t.length;if(e)for(var i=0;i<e;i++){t[i].hide()}},g.prototype.getItem=function(t){for(var e=0,i=this.items.length;e<i;e++){var n=this.items[e];if(n.element===t)return n}},g.prototype.getItems=function(t){if(t&&t.length){for(var e=[],i=0,n=t.length;i<n;i++){var o=t[i],r=this.getItem(o);r&&e.push(r)}return e}},g.prototype.remove=function(t){t=a(t);var e=this.getItems(t);if(e&&e.length){this._itemsOn(e,"remove",function(){this.emitEvent("removeComplete",[this,e])});for(var i=0,n=e.length;i<n;i++){var o=e[i];o.remove(),u(o,this.items)}}},g.prototype.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="";for(var e=0,i=this.items.length;e<i;e++){this.items[e].destroy()}this.unbindResize(),delete this.element.outlayerGUID,n&&n.removeData(this.element,this.constructor.namespace)},g.data=function(t){var e=t&&t.outlayerGUID;return e&&y[e]},g.create=function(t,o){function s(){g.apply(this,arguments)}var a;return Object.create?s.prototype=Object.create(g.prototype):r(s.prototype,g.prototype),s.prototype.constructor=s,a="options",s.prototype[a]=r({},g.prototype[a]),r(s.prototype.options,o),s.namespace=t,s.data=g.data,s.Item=function(){d.apply(this,arguments)},s.Item.prototype=new d,p(function(){for(var o=t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase(),r=e.querySelectorAll(".js-"+o),a="data-"+o+"-options",h=0,p=r.length;h<p;h++){var u,f=r[h],l=f.getAttribute(a);try{u=l&&JSON.parse(l)}catch(t){i&&i.error("Error parsing "+a+" on "+f.nodeName.toLowerCase()+(f.id?"#"+f.id:"")+": "+t);continue}var c=new s(f,u);n&&n.data(f,t,c)}}),n&&n.bridget&&n.bridget(t,s),s},g.Item=d,g}"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"],f):t.Outlayer=f(t.eventie,t.docReady,t.EventEmitter,t.getSize,t.matchesSelector,t.Outlayer.Item)}(window),function(t){var e=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,n=t.length;i<n;i++){if(t[i]===e)return i}return-1};function i(t,i){var n=t.create("masonry");return n.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var t=this.cols;for(this.colYs=[];t--;)this.colYs.push(0);this.maxY=0},n.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){for(var t,e=0,n=this.items.length;e<n;e++)if(!this.items[e].isIgnored){t=this.items[e];break}t||(t=this.items[0]);var o=t&&t.element;this.columnWidth=o&&i(o).outerWidth||this.containerWidth}this.columnWidth+=this.gutter,this.cols=Math.floor((this.containerWidth+this.gutter)/this.columnWidth),this.cols=Math.max(this.cols,1)},n.prototype.getContainerWidth=function(){var t=this.options.isFitWidth?this.element.parentNode:this.element,e=i(t);this.containerWidth=e&&e.innerWidth},n.prototype._getItemLayoutPosition=function(t){t.getSize();var i=t.size.outerWidth%this.columnWidth,n=Math[i&&i<1?"round":"ceil"](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this._getColGroup(n),r=Math.min.apply(Math,o),s=e(o,r),a={x:this.columnWidth*s,y:r},h=r+t.size.outerHeight,p=this.cols+1-o.length,u=0;u<p;u++)this.colYs[s+u]=h;return a},n.prototype._getColGroup=function(t){if(t<2)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;n<i;n++){var o=this.colYs.slice(n,n+t);e[n]=Math.max.apply(Math,o)}return e},n.prototype._manageStamp=function(t){var e=i(t),n=this._getElementOffset(t),o=this.options.isOriginLeft?n.left:n.right,r=o+e.outerWidth,s=Math.floor(o/this.columnWidth);s=Math.max(0,s);var a=Math.floor(r/this.columnWidth);a-=r%this.columnWidth?0:1,a=Math.min(this.cols-1,a);for(var h=(this.options.isOriginTop?n.top:n.bottom)+e.outerHeight,p=s;p<=a;p++)this.colYs[p]=Math.max(h,this.colYs[p])},n.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this.options.isFitWidth&&(t.width=this._getContainerFitWidth()),t},n.prototype._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.prototype.resize=function(){var t=this.containerWidth;this.getContainerWidth(),t!==this.containerWidth&&this.layout()},n}"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],i):t.Masonry=i(t.Outlayer,t.getSize)}(window);