/*!
* Angular Tooltips v0.1.13
*
* Released under the MIT license
* www.opensource.org/licenses/MIT
*
* Brought to you by 720kb.net
*
* 2015-06-24
*/
!function(a){"use strict";a.module("720kb.tooltips",[]).directive("tooltips",["$window","$compile","$interpolate",function(b,c,d){var e=8,f=9,g=10,h="_720kb-tooltip-",i=d.startSymbol(),j=d.endSymbol();return{restrict:"A",scope:{},link:function(d,k,l){function m(){M&&x||(x=!0,d.initTooltip(G)),I&&d.tooltipTryPosition(),d.showTooltip()}function n(){d.hideTooltip()}function o(){d.hideTooltip(),d.initTooltip(F)}var p,q,r,s,t,u,v,w,x=!1,y=a.element(k[0]),z=a.element(b.document.getElementsByTagName("body")[0]),A=l.tooltipTitle||l.title||"",B=l.tooltipContent||"",C=l.tooltipHtml||"",D=l.tooltipShowTrigger||"mouseover",E=l.tooltipHideTrigger||"mouseleave",F=l.tooltipSide||"top",G=F,H=l.tooltipSize||"medium",I="undefined"!=typeof l.tooltipTry&&null!==l.tooltipTry?d.$eval(l.tooltipTry):!0,J=l.tooltipClass||"",K=(l.tooltipSpeed||"medium").toLowerCase(),L=l.tooltipDelay||0,M="undefined"!=typeof l.tooltipLazy&&null!==l.tooltipLazy?d.$eval(l.tooltipLazy):!0,N="undefined"!=typeof l.tooltipCloseButton&&null!==l.tooltipCloseButton,O=l.tooltipCloseButton||"",P='
',d.title=A,d.content=B,d.html=C,d.parseSpeed=function(){switch(K){case"fast":K=100;break;case"medium":K=450;break;case"slow":K=800;break;default:K=Number(K)}},p=c(P)(d),p.addClass(J),z.append(p),d.isTooltipEmpty=function(){return d.title||d.content||d.html?void 0:!0},d.initTooltip=function(a){d.isTooltipEmpty()?p.css("visibility","hidden"):(p.css("visibility",""),t=y[0].offsetHeight,u=y[0].offsetWidth,v=d.getRootOffsetTop(y[0],0),w=d.getRootOffsetLeft(y[0],0),q=p[0].offsetHeight,r=p[0].offsetWidth,d.parseSpeed(),d.tooltipPositioning(a))},d.getRootOffsetTop=function(a,b){return null===a.offsetParent?b+a.offsetTop:d.getRootOffsetTop(a.offsetParent,b+a.offsetTop-a.scrollTop)},d.getRootOffsetLeft=function(a,b){return null===a.offsetParent?b+a.offsetLeft:d.getRootOffsetLeft(a.offsetParent,b+a.offsetLeft-a.scrollLeft)},d.bindShowTriggers=function(){y.bind(D,m)},d.bindHideTriggers=function(){y.bind(E,n)},d.clearTriggers=function(){y.unbind(D,m),y.unbind(E,n)},d.bindShowTriggers(),d.showTooltip=function(){p.addClass(h+"open"),p.css("transition","opacity "+K+"ms linear"),L&&p.css("transition-delay",L+"ms"),d.clearTriggers(),d.bindHideTriggers()},d.hideTooltip=function(){p.removeClass(h+"open"),p.css("transition",""),d.clearTriggers(),d.bindShowTriggers()},d.removePosition=function(){p.removeClass(h+"left").removeClass(h+"right").removeClass(h+"top").removeClass(h+"bottom ")},d.tooltipPositioning=function(a){d.removePosition();var b,c;"small"===H?s=e:"medium"===H?s=f:"large"===H&&(s=g),"left"===a&&(b=v+t/2-q/2,c=w-(r+s),p.css("top",b+"px"),p.css("left",c+"px"),p.addClass(h+"left")),"right"===a&&(b=v+t/2-q/2,c=w+u+s,p.css("top",b+"px"),p.css("left",c+"px"),p.addClass(h+"right")),"top"===a&&(b=v-s-q,c=w+u/2-r/2,p.css("top",b+"px"),p.css("left",c+"px"),p.addClass(h+"top")),"bottom"===a&&(b=v+t+s,c=w+u/2-r/2,p.css("top",b+"px"),p.css("left",c+"px"),p.addClass(h+"bottom"))},d.tooltipTryPosition=function(){var a=p[0].offsetHeight,c=p[0].offsetWidth,e=p[0].offsetTop,f=p[0].offsetLeft,g=b.outerWidth,h=b.outerHeight,i=g-(c+f),j=h-(a+e),k=y[0].offsetHeight,l=y[0].offsetWidth,m=y[0].offsetLeft,n=y[0].offsetTop,o=g-(m+l),q=h-(k+n),r={left:f,top:e,bottom:j,right:i},s={left:m,right:o,top:n,bottom:q},t=Object.keys(s).reduce(function(a,b){return s[a]>s[b]?a:b}),u=Object.keys(r).reduce(function(a,b){return r[a]