!function(a){function b(b,f){var h=f.Canvas;null==c&&(d=h.prototype.getTextInfo,e=h.prototype.addText,c=h.prototype.render),h.prototype.render=function(){if(!b.getOptions().canvas)return c.call(this);var a=this.context,d=this._textCache;a.save(),a.textBaseline="middle";for(var e in d)if(g.call(d,e)){var f=d[e];for(var h in f)if(g.call(f,h)){var i=f[h],j=!0;for(var k in i)if(g.call(i,k)){var l=i[k],m=l.positions,n=l.lines;j&&(a.fillStyle=l.font.color,a.font=l.font.definition,j=!1);for(var o,p=0;o=m[p];p++)if(o.active)for(var q,r=0;q=o.lines[r];r++)a.fillText(n[r].text,q[0],q[1]);else m.splice(p--,1);0==m.length&&delete i[k]}}}a.restore()},h.prototype.getTextInfo=function(c,e,f,g,h){if(!b.getOptions().canvas)return d.call(this,c,e,f,g,h);var i,j,k,l;if(e=""+e,i="object"==typeof f?f.style+" "+f.variant+" "+f.weight+" "+f.size+"px "+f.family:f,j=this._textCache[c],null==j&&(j=this._textCache[c]={}),k=j[i],null==k&&(k=j[i]={}),l=k[e],null==l){var m=this.context;if("object"!=typeof f){var n=a("
 
").css("position","absolute").addClass("string"==typeof f?f:null).appendTo(this.getTextLayer(c));f={"lineHeight":n.height(),"style":n.css("font-style"),"variant":n.css("font-variant"),"weight":n.css("font-weight"),"family":n.css("font-family"),"color":n.css("color")},f.size=n.css("line-height",1).height(),n.remove()}i=f.style+" "+f.variant+" "+f.weight+" "+f.size+"px "+f.family,l=k[e]={"width":0,"height":0,"positions":[],"lines":[],"font":{"definition":i,"color":f.color}},m.save(),m.font=i;for(var o=(e+"").replace(/
|\r\n|\r/g,"\n").split("\n"),p=0;p