}functioneg(a,b,c){functione(b,c,d){functione(a,b){b||(f=(m-z-l)/2,y>f&&(f=(m-l)/2,z=0,F++)),E[a]=F,D[F]=f,A[a]=z,z+=l}varf,h,i=af(b.textContent,g.legendItem),j=10*Math.ceil((i.width+v)/10),k=10*Math.ceil((i.height+u)/10),l=ck?k:j,m=ck?V():U();returnd&&(z=0,F=0,w=0,x=0),Th&&!Uc(c)?void(B[c]=C[c]=E[c]=A[c]=0):(B[c]=j,C[c]=k,(!w||j>=w)&&(w=j),(!x||k>=x)&&(x=k),h=ck?x:w,void(Yh?(Object.keys(B).forEach(function(a){B[a]=w}),Object.keys(C).forEach(function(a){C[a]=x}),f=(m-h*a.length)/2,y>f?(z=0,F=0,a.forEach(function(a){e(a)})):e(c,!0)):e(c)))}varf,h,i,j,k,l,m,n,q,r,s,t,u=4,v=36,w=0,x=0,y=10,z=0,A={},B={},C={},D=[0],E={},F=0,G=qk.selectAll("."+g.legendItemFocused).size();b=b||{},n=$e(b,"withTransition",!0),q=$e(b,"withTransitionForTransform",!0),ck?(f=function(a){returnw*E[a]},j=function(a){returnD[E[a]]+A[a]}):(f=function(a){returnD[E[a]]+A[a]},j=function(a){returnx*E[a]}),h=function(a,b){returnf(a,b)+14},k=function(a,b){returnj(a,b)+9},i=function(a,b){returnf(a,b)-4},l=function(a,b){returnj(a,b)-7},m=qk.selectAll("."+g.legendItem).data(a).enter().append("g").attr("class",function(a){returnfd(g.legendItem,a)}).style("visibility",function(a){returnUc(a)?"visible":"hidden"}).style("cursor","pointer").on("click",function(a){"function"==typeofVh?Vh(a):mg.toggle(a)}).on("mouseover",function(a){lg.select(this).classed(g.legendItemFocused,!0),Qj||mg.focus(a),"function"==typeofWh&&Wh(a)}).on("mouseout",function(a){lg.select(this).classed(g.legendItemFocused,!1),Qj||mg.revert(),"function"==typeofXh&&Xh(a)}),m.append("text").text(function(a){returnd(qh[a])?qh[a]:a}).each(function(a,b){e(this,a,0===b)}).style("pointer-events","none").attr("x",ck?h:-200).attr("y",ck?-200:k),m.append("rect").attr("class",g.legendItemEvent).style("fill-opacity",0).attr("x",ck?i:-200).attr("y",ck?-200:l),m.append("rect").attr("class",g.legendItemTile).style("pointer-events","none").style("fill",Sj).attr("x",ck?h:-200).attr("y",ck?-200:j).attr("width",10).attr("height",10),r=qk.selectAll("text").data(a).text(function(a){returnd(qh[a])?qh[a]:a}).each(function(a,b){e(this,a,0===b)}),(n?r.transition():r).attr("x",h).attr("y",k),s=qk.selectAll("rect."+g.legendItemEvent).data(a),(n?s.transition():s).attr("width",function(a){returnB[a]}).attr("height",function(a){returnC[a]}).attr("x",i).attr("y",l),t=qk.selectAll("rect."+g.legendItemTile).data(a),(n?t.transition():t).style("fill",Sj).attr("x",f).attr("y",j),qk.selectAll("."+g.legendItem).classed(g.legendItemHidden,function(a){return!Tc(a)}).transition().style("opacity",function(a){varb=lg.select(this);returnTc(a)?!G||b.classed(g.legendItemFocused)?$f(b):_f(b):gk}),S(w),T(x),R(F),p(),W(),Tf(),o(q,c)}functionfg(a){returnSc(mg.data.targets,a.id)}functiongg(a){return"data"ina&&Sc(mg.data.targets,a.data.id)}functionhg(a){returna?function(b){varc=!1;return[].concat(a).forEach(function(d){("value"ind&&b.value===a.value||"class"ind&&b.class===a.class)&&(c=!0)}),c}:function(){return!0}}functionig(a,b){varc=hg(a),d=function(a){return!c(a)},e=b?g.xgridLines:g.ygridLines,f=b?g.xgridLine:g.ygridLine;ok.select("."+e).selectAll("."+f).filter(c).transition().duration(Dg).style("opacity",0).remove(),b?Ki=Ki.filter(d):Mi=Mi.filter(d)}functionjg(a,b,c){vard=!xe(mg.data.targets);Qj=!1,pe(a,b),Vf(c||{withTransitionForAxis:d})}functionkg(a){varb=a.mimeType?a.mimeType:"csv";lg.xhr(a.url,function(c,d){vare;e="json"===b?Gc(JSON.parse(d.response),a.keys):Fc(d.response),Hf(e)})}varlg=a.d3?a.d3:"undefined"!=typeofrequire?require("d3"):void0,mg={data:{},axis:{},legend:{}},ng={},og=i(["bindto"],"#chart"),pg=i(["size","width"]),qg=i(["size","height"]),rg=i(["padding","left"]),sg=i(["padding","right"]),tg=i(["padding","top"]),ug=i(["padding","bottom"]),vg=i(["zoom","enabled"],!1),wg=i(["zoom","extent"]),xg=i(["zoom","privileged"],!1),yg=i(["interaction","enabled"],!0),zg=i(["onenter"],function(){}),Ag=i(["onleave"],function(){}),Bg=i(["onresize"],function(){}),Cg=i(["onresized"],function(){}),Dg=i(["transition","duration"],350);h("data","data is required in config");varEg,Fg,Gg,Hg,Ig,Jg,Kg,Lg,Mg,Ng