varu=2*o;for(h=o;1>=h;h+=u)s+=i(a[g-1],a[g],h,o)}r=a[g].x}returns}functiondf(b){varc,d,e;if(wj=Hf.select(Kf),wj.empty())thrownewError('Bind element not found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');if(wj.html("").classed("c3",!0),If.data.xs={},If.data.targets=wc(b),Ug&&Mc(Ug===!0?Dc(If.data.targets):Ug),p(),T(),vg.domain(Hf.extent(ac(If.data.targets))),wg.domain(Yb(If.data.targets,"y")),xg.domain(Yb(If.data.targets,"y2")),yg.domain(vg.domain()),zg.domain(wg.domain()),Ag.domain(xg.domain()),xj=vg.domain(),lj.scale(yg),Rf&&pj.scale(vg),qj=wj.append("svg").on("mouseenter",Uf).on("mouseleave",Vf),rj=qj.append("defs"),rj.append("clipPath").attr("id",Gi).append("rect"),rj.append("clipPath").attr("id",Hi).append("rect"),rj.append("clipPath").attr("id",Ii).append("rect"),qf(),sj=qj.append("g").attr("transform",cj.main),tj=qj.append("g").attr("transform",cj.context),uj=qj.append("g").attr("transform",cj.legend),eh||tj.style("visibility","hidden"),hh||(uj.style("visibility","hidden"),Zi=Dc(If.data.targets)),vj=Hf.select(Kf).style("position","relative").append("div").style("position","absolute").style("pointer-events","none").style("z-index","10").style("display","none"),Cf(Dc(If.data.targets),{withTransform:!1,withTransitionForTransform:!1}),d=sj.append("g").attr("clip-path",Ji).attr("class",g.grid),Yh&&d.append("g").attr("class",g.xgrids),De($h)&&d.append("g").attr("class",g.xgridLines),ei&&d.append("g").attr("class",g.xgridFocus).append("line").attr("class",g.xgridFocus),_h&&d.append("g").attr("class",g.ygrids),De(ai)&&d.append("g").attr("class",g.ygridLines),sj.append("g").attr("clip-path",Ji).attr("class",g.regions),sj.append("g").attr("clip-path",Ji).attr("class",g.chart),c=sj.select("."+g.chart).append("g").attr("class",g.eventRects).style("fill-opacity",0).style("cursor",Rf?nh?"ns-resize":"ew-resize":null),sj.select("."+g.chart).append("g").attr("class",g.chartBars),sj.select("."+g.chart).append("g").attr("class",g.chartLines),sj.select("."+g.chart).append("g").attr("class",g.chartArcs).attr("transform",cj.arc).append("text").attr("class",g.chartArcsTitle).style("text-anchor","middle").text(Sb()),sj.select("."+g.chart).append("g").attr("class",g.chartTexts),Rf&&sj.insert("rect",Tf?null:"g."+g.grid).attr("class",g.zoomRect).attr("width",ag).attr("height",cg).style("opacity",0).style("cursor",nh?"ns-resize":"ew-resize").call(pj).on("dblclick.zoom",null),Eh&&lj.extent("function"!=typeofEh?Eh:Eh(ac())),oh&&sj.append("g").attr("class",g.axisX).attr("clip-path",Ki).attr("transform",cj.x).append("text").attr("class",g.axisXLabel).attr("transform",nh?"rotate(-90)":"").style("text-anchor",Bb),Gh&&sj.append("g").attr("class",g.axisY).attr("clip-path",Li).attr("transform",cj.y).append("text").attr("class",g.axisYLabel).attr("transform",nh?"":"rotate(-90)").style("text-anchor",Cb),Ph&&sj.append("g").attr("class",g.axisY2).attr("transform",cj.y2).append("text").attr("class",g.axisY2Label).attr("transform",nh?"":"rotate(-90)").style("text-anchor",Db),tj.append("g").attr("clip-path",Ji).attr("class",g.chart),tj.select("."+g.chart).append("g").attr("class",g.chartBars),tj.select("."+g.chart).append("g").attr("class",g.chartLines),tj.append("g").attr("clip-path",Ji).attr("class",g.brush).call(lj).selectAll("rect").attr(nh?"width":"height",nh?bg:dg),tj.append("g").attr("class",g.axisX).attr("transform",cj.subx).attr("clip-path",nh?"":Ki),sf(If.data.targets),nh?sj.select("."+g.axisX).style("opacity",0).call(Bg):(sj.select("."+g.axisY).style("opacity",0).call(Cg),sj.select("."+g.axisY2).style("opacity",0).call(Dg)),p(),T(),qf(),o(!1),mf({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1}),Di){if(Mi&&"string"==typeofEi){for(Ei=ye(Ei),e=0;e<If.data.targets[0].values.length&&If.data.targets[0].values[e].x-Ei!==0;e++);Ei=e}vj.html(Ci(If.data.targets.map(function(a){returnqc(a.values[Ei])}),ab(),Ad(je(If.data.targets)),Vi)),vj.style("top",Fi.top).style("left",Fi.left).style("display","block")}null==a.onresize&&(a.onresize=pf()),a.onresize