b=b||{},n=Ze(b,"withTransition",!0),q=Ze(b,"withTransitionForTransform",!0),_j?(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=nk.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"==typeofTh?Th(a):kg.toggle(a)}).on("mouseover",function(a){jg.select(this).classed(g.legendItemFocused,!0),Nj||kg.focus(a),"function"==typeofUh&&Uh(a)}).on("mouseout",function(a){jg.select(this).classed(g.legendItemFocused,!1),Nj||kg.revert(),"function"==typeofVh&&Vh(a)}),m.append("text").text(function(a){returnd(oh[a])?oh[a]:a}).each(function(a,b){e(this,a,0===b)}).style("pointer-events","none").attr("x",_j?h:-200).attr("y",_j?-200:k),m.append("rect").attr("class",g.legendItemEvent).style("fill-opacity",0).attr("x",_j?i:-200).attr("y",_j?-200:l),m.append("rect").attr("class",g.legendItemTile).style("pointer-events","none").style("fill",Pj).attr("x",_j?h:-200).attr("y",_j?-200:j).attr("width",10).attr("height",10),r=nk.selectAll("text").data(a).text(function(a){returnd(oh[a])?oh[a]:a}).each(function(a,b){e(this,a,0===b)}),(n?r.transition():r).attr("x",h).attr("y",k),s=nk.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=nk.selectAll("rect."+g.legendItemTile).data(a),(n?t.transition():t).style("fill",Pj).attr("x",f).attr("y",j),nk.selectAll("."+g.legendItem).classed(g.legendItemHidden,function(a){return!Tc(a)}).transition().style("opacity",function(a){varb=jg.select(this);returnTc(a)?!G||b.classed(g.legendItemFocused)?Zf(b):$f(b):dk}),S(w),T(x),R(F),p(),W(),Sf(),o(q,c)}functioneg(a){returnSc(kg.data.targets,a.id)}functionfg(a){return"data"ina&&Sc(kg.data.targets,a.data.id)}functiongg(a){varb=a&&a.value?a.value:null,c=a&&a["class"]?a["class"]:null;returnb?function(a){returna.value!==b}:c?function(a){returna["class"]!==c}:function(){return!0}}functionhg(a,b,c){vard=!we(kg.data.targets);Nj=!1,pe(a,b),Uf(c||{withTransitionForAxis:d})}functionig(a){varb=a.mimeType?a.mimeType:"csv";jg.xhr(a.url,function(c,d){vare;e="json"===b?Gc(JSON.parse(d.response),a.keys):Fc(d.response),Gf(e)})}varjg=a.d3?a.d3:"undefined"!=typeofrequire?require("d3"):void0,kg={data:{},axis:{},legend:{}},lg={},mg=i(["bindto"],"#chart"),ng=i(["size","width"]),og=i(["size","height"]),pg=i(["padding","left"]),qg=i(["padding","right"]),rg=i(["padding","top"]),sg=i(["padding","bottom"]),tg=i(["zoom","enabled"],!1),ug=i(["zoom","extent"]),vg=i(["zoom","privileged"],!1),wg=i(["interaction","enabled"],!0),xg=i(["onenter"],function(){}),yg=i(["onleave"],function(){}),zg=i(["onresize"],function(){}),Ag=i(["onresized"],function(){}),Bg=i(["transition","duration"],350);h("data","data is required in config");varCg,Dg,Eg,Fg,Gg,Hg,Ig,Jg,Kg,Lg,Mg,Ng,Og,Pg,Qg,Rg,Sg,Tg,Ug,Vg,Wg,Xg,Yg,Zg,$g,_g,ah,bh,ch,dh,eh,fh,gh,hh,ih,jh,kh=i(["data","x"]),lh=i(["data","xs"],{}),mh=i(["data","x_format"],"%Y-%m-%d"),nh=i(["data","id_converter"],function(a){returna}),oh=i(["data","names"],{}),ph=i(["data","classes"],{}),qh=i(["data","groups"],[]),rh=i(["data","axes"],{}),sh=i(["data","type"]),th=i(["data","types"],{}),uh=i(["data","labels"],{}),vh=i(["data","order"]),wh=i(["data","regions"],{}),xh=i(["data","color"]),yh=i(["data","colors"],{}),zh=i(["data","hide"],!1),Ah=i(["data","filter"]),Bh=i(["data","selection","enabled"],!1),Ch=i(["data","selection","grouped"],!1),Dh=i(["data","selection","isselectable"],function(){return!0}),Eh=i(["data","selection","multiple"],!0),Fh=i(["data","onclick"],function(){}),Gh=i(["data","onenter"],function(){}),Hh=i(["data","onleave"],function(){}),Ih=i(["data","onselected"],function(){}),Jh=i(["data","onunselected"],function(){}),Kh=i(["data