(function(){"use strict";function t(t,e){t&&(this.el=t,this.container=e&&e.container,this.reRender=e&&e.reRender)}function e(e){e.style.display="none",t.r=e.offsetTop,e.style.display=""}function i(t,e){if(t)for(var i=e&&e.display,n=t.parentNode.children,l=a.call(n,t),o=l+1,s=n.length;s>o;o++)n[o].style.display=i}function n(t,e){var i=t.getClientRects(),n=0;return p(i,function(t){n+=l(t.height,e)}),n}function l(t,e){return Math.floor(t/e)}function o(){var t=document.createElement("test"),e={},i={Webkit:["WebkitColumnCount","WebkitColumnGap"],Moz:["MozColumnCount","MozColumnGap"],ms:["msColumnCount","msColumnGap"],"":["columnCount","columnGap"]};for(var n in i)i[n][0]in t.style&&(e.columnCount=i[n][0],e.columnGap=i[n][1],e[n.toLowerCase()]=!0);return e}function s(t){return parseInt(t[y.columnCount],10)||1}function h(t){return parseInt(t[y.columnGap],10)||0}function r(t){var e=parseInt(t.lineHeight,10);if(!e)throw Error(f[0]);return e}function u(t){return[t.offsetWidth,t.offsetHeight]}function p(t,e){for(var i=0,n=t.length;n>i&&!e(t[i]);i++);}var a=Array.prototype.indexOf,c=window.getComputedStyle,d="ellipsis-overflowing-child",m="ellipsis-set",f=["The ellipsis container must have line-height set on it"],y=o();t.prototype.calc=function(){if(!this.el)return this;var t=c(this.el),e=u(this.el);return this.columnHeight=e[1],this.columnCount=s(t),this.columnGap=h(t),this.columnWidth=e[0]/this.columnCount,this.lineHeight=r(t),this.deltaHeight=e[1]%this.lineHeight,this.linesPerColumn=Math.floor(this.columnHeight/this.lineHeight),this.totalLines=this.linesPerColumn*this.columnCount,!this.deltaHeight&&this.columnCount>1&&(this.el.style.height=this.columnHeight+"px"),this.child=this.getOverflowingChild(),this},t.prototype.set=function(){return this.el&&this.child?(this.clampChild(),i(this.child.el,{display:"none"}),this.markContainer(),this):this},t.prototype.unset=function(){return this.el&&this.child?(this.el.style.height="",this.unclampChild(this.child),i(this.child.el,{display:""}),this.unmarkContainer(),this.child=null,this):this},t.prototype.destroy=function(){return this.el=this.child=this.container=null,this},t.prototype.getOverflowingChild=function(){var t=this,e={},i=0;return p(this.el.children,function(n){var l,o,s,h=Math.floor(i/t.linesPerColumn)||0;return i+=l=t.getLineCount(n),i>=t.totalLines?(o=i-t.totalLines,s=l-o,e.el=n,e.clampedLines=s,e.clampedHeight=e.clampedLines*t.lineHeight,e.visibleColumnSpan=t.columnCount-h,e.gutterSpan=e.visibleColumnSpan-1,e.applyTopMargin=t.shouldApplyTopMargin(e),y.webkit&&e.clampedLines>1&&(e.clampedHeight+=e.gutterSpan*t.deltaHeight),e):void 0}),e},t.prototype.getLineCount=function(t){return t.offsetWidth>this.columnWidth?n(t,this.lineHeight):l(t.clientHeight,this.lineHeight)},t.prototype.markContainer=function(){this.container&&(this.container.classList.add(m),this.reRender&&e(this.container))},t.prototype.unmarkContainer=function(){this.container&&(this.container.classList.remove(m),this.reRender&&e(this.container))},t.prototype.shouldApplyTopMargin=function(t){var e=t.el;if(y.webkit&&1!==this.columnCount&&!(3>=this.deltaHeight)&&e.previousElementSibling)return 0===e.offsetTop||e.offsetTop===this.columnHeight},t.prototype.clampChild=function(){var t=this.child;t&&t.el&&(t.el.style.height=t.clampedHeight+"px",y.webkit&&(t.el.style.webkitLineClamp=t.clampedLines,t.el.style.display="-webkit-box",t.el.style.webkitBoxOrient="vertical"),this.shouldHideOverflow()&&(t.el.style.overflow="hidden"),t.applyTopMargin&&(t.el.style.marginTop="2em"),t.el.classList.add(d),y.webkit||(t.el.style.position="relative",t.helper=t.el.appendChild(this.helperElement())))},t.prototype.unclampChild=function(t){t&&t.el&&(t.el.style.display="",t.el.style.height="",t.el.style.webkitLineClamp="",t.el.style.webkitBoxOrient="",t.el.style.marginTop="",t.el.style.overflow="",t.el.classList.remove(d),t.helper&&t.helper.parentNode.removeChild(t.helper))},t.prototype.helperElement=function(){var t,e,i=document.createElement("span"),n=this.child.visibleColumnSpan-1;return i.className="ellipsis-helper",i.style.display="block",i.style.height=this.lineHeight+"px",i.style.width="5em",i.style.position="absolute",i.style.bottom=0,i.style.right=0,y.moz&&n&&(t=-(100*n),e=-(n*this.columnGap),i.style.right=t+"%",i.style.marginRight=e+"px",i.style.marginBottom=this.deltaHeight+"px"),i},t.prototype.shouldHideOverflow=function(){var t=this.columnCount>1;return this.columnHeight