!function(a){"use strict";function b(a){return a||0===a}function c(a){return"undefined"==typeof a}function d(a){return"undefined"!=typeof a}var e={};e.generate=function(e){function f(a,b){if(!(a in e))throw Error(b)}function g(a,b){var c,d,f,g=e;for(c=0;c_e&&(_e=0),0>bf&&(bf=0),Ze={top:kg?Ye.top:ef-eg-(Jh?0:ff),right:0/0,bottom:20+(Jh?0:ff),left:kg?Nh:Ye.left},af=kg?Ye.left-Nh-Oh:_e,cf=kg?bf:ef-Ze.top-Ze.bottom,0>af&&(af=0),0>cf&&(cf=0),$e={top:Jh?0:ef-ff,right:0/0,bottom:0,left:Jh?df-gf:0},n(),Jh&&zd(He.data.targets)&&($e.left=_e/2+jf)}function n(){jf=bf/2,hf=.95*jf,kf=yd(He.data.targets)?.6*hf:0}function o(){var a=kg?Me.axisX:Me.axisY,b=Ge.select("."+a).node(),c=b?b.getBoundingClientRect():{right:0},d=Ge.select(Ne).node().getBoundingClientRect(),e=c.right-d.left-r();return e>0?e:0}function p(){return Oe?Oe:v()}function q(){var a=Pe?Pe:w();return a>0?a:320}function r(){return zd(He.data.targets)?0:Qe?Qe:kg||!vg||Ag?1:t("y")}function s(){var a=1;return zd(He.data.targets)?0:Re?Re:Jh?gf+(Eg&&!kg?t("y2"):a):Eg?Jg||kg?a:t("y2"):a}function t(a){var b=db(a);return b.isInner?20+wb(a):40+wb(a)}function u(a){return"y"!==a||vg?"y2"!==a||Eg?(db(a).isInner?30:40)+("y2"===a?-10:0):Ph:gg&&!Jh?10:1}function v(){return+Ge.select(Ne).style("width").replace("px","")}function w(){return+Ge.select(Ne).style("height").replace("px","")}function x(a){return a?-5:-(Ye.left-1)}function y(a){return a?-20:-1}function z(){return x(!kg)}function A(){return y(!kg)}function B(){return x(kg)}function C(){return y(kg)}function D(a){return a?_e+2+4:Ye.left+20}function E(a){return a?80:bf+2}function F(){return D(!kg)}function G(){return E(!kg)}function H(){return D(kg)}function I(){return E(kg)}function J(){var a=kg?bf:_e,b=mc(),c=Rb()*(vd(He.data.targets)?(b-(vh?.25:1))/b:.98);return b>1?a*c/(b-1):a}function K(a){Kh=a}function L(a){Lh=a}function M(a){Mh=a}function N(){return gg?Jh?Lh*(Kh+1):df:0}function O(){return gg?Jh?ef:Mh*(Kh+1):0}function P(){var a,b,c=!xf;pf=kg?1:0,qf=kg?bf:_e,rf=kg?0:bf,sf=kg?_e:1,tf=pf,uf=qf,vf=kg?0:cf,wf=kg?af:1,xf=R(pf,qf,c?void 0:xf.domain(),function(){return Df.tickOffset()}),yf=S(rf,sf),zf=S(rf,sf),Af=R(pf,qf,ai,function(a){return a%1?0:Gf.tickOffset()}),Bf=S(vf,wf),Cf=S(vf,wf),a=Y(),b=Z(),Df=V(xf,Eh,a,b),Gf=V(Af,Hh,a,b),Ef=W(yf,Fh,Bg,Dg),Ff=W(zf,Gh,Kg,Mg),c||(Qh.scale(Af),Se&&Uh.scale(xf)),Q()}function Q(){lf=zb(),mf=Ab(),nf=Ab(.98)}function R(a,b,e,f){var g=(uh?Ge.time.scale():Ge.scale.linear()).range([a,b]);if(g.orgDomain=function(){return g.domain()},d(e)&&g.domain(e),c(f)&&(f=function(){return 0}),vh){var h,i=g;g=function(a){return i(a)+f(a)};for(h in i)g[h]=i[h];g.orgDomain=function(){return i.domain()},g.domain=function(a){return arguments.length?(i.domain(a),g):(a=i.domain(),[a[0],a[1]+1])}}return g}function S(a,b){return Ge.scale.linear().range([a,b])}function T(a){return"y2"===X(a)?zf:yf}function U(a){return"y2"===X(a)?Cf:Bf}function V(a,b,c,d){var e=(vh?xb():Ge.svg.axis()).scale(a).orient(b);return e.tickFormat(c).ticks(d),vh?e.tickCentered(ng):e.tickOffset=function(){var a=kg?bf:_e;return a*Rb()/mc()/2},vh&&e.categories(mg),e}function W(a,b,c,d){return Ge.svg.axis().scale(a).orient(b).tickFormat(c).ticks(d).outerTickSize(0)}function X(a){return a in Nf?Nf[a]:"y"}function Y(){var a=uh?Ch:vh?zc:null;return og&&("function"==typeof og?a=og:uh&&(a=function(a){return Ge.time.format(og)(a)})),a}function Z(){var a=mc();return pg&&a>qg?qg:a}function $(a){return"string"==typeof a?a:a?a.text:null}function _(a,b){var c=a&&"object"==typeof a&&a.position?a.position:b;return{isInner:c.indexOf("inner")>=0,isOuter:c.indexOf("outer")>=0,isLeft:c.indexOf("left")>=0,isCenter:c.indexOf("center")>=0,isRight:c.indexOf("right")>=0,isTop:c.indexOf("top")>=0,isMiddle:c.indexOf("middle")>=0,isBottom:c.indexOf("bottom")>=0}}function ab(){return _(ug,kg?"inner-top":"inner-right")}function bb(){return _(zg,kg?"inner-right":"inner-top")}function cb(){return _(Ig,kg?"inner-right":"inner-top")}function db(a){return"y2"===a?cb():"y"===a?bb():ab()}function eb(){return $(ug)}function fb(){return $(zg)}function gb(){return $(Ig)}function hb(a,b){return a?b.isLeft?0:b.isCenter?_e/2:_e:b.isBottom?-bf:b.isMiddle?-bf/2:0}function ib(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"}function jb(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"}function kb(){return hb(!kg,ab())}function lb(){return hb(kg,bb())}function mb(){return hb(kg,cb())}function nb(){return ib(!kg,ab())}function ob(){return ib(kg,bb())}function pb(){return ib(kg,cb())}function qb(){var a=ab();return kg?a.isInner?"1.2em":-30-wb("x"):a.isInner?"-0.5em":"3em"}function rb(){var a=bb();return kg?a.isInner?"-0.5em":"3em":a.isInner?"1.2em":-20-wb("y")}function sb(){var a=cb();return kg?a.isInner?"1.2em":"-2.2em":a.isInner?"-0.5em":30+wb("y2")}function tb(){return jb(!kg,ab())}function ub(){return jb(kg,bb())}function vb(){return jb(kg,cb())}function wb(a){var b=0,c="x"===a?Me.axisX:"y"===a?Me.axisY:Me.axisY2;return Ge.selectAll("."+c+" .tick text").each(function(){var a=this.getBBox();bb?[b,c]:[c,b]}function d(a){for(var b=[],c=Math.ceil(a[0]);c0&&b[0]>0&&b.unshift(b[0]-(b[1]-b[0])),b}function e(a,b){var c=a.length-1;return o>=c||b%Math.ceil(c/o)===0}function f(a){return a0)for(f=xc(a),b=0;ba?a:0}),c=1;c0||(g[d][b]+=+a)});return Ge.min(Object.keys(g).map(function(a){return Ge.min(g[a])}))}function Pb(a){var b,c,d,e,f,g=vc(a);if(Mf.length>0)for(f=yc(a),b=0;b0?a:0}),c=1;c+a||(g[d][b]+=+a)});return Ge.max(Object.keys(g).map(function(a){return Ge.max(g[a])}))}function Qb(a,c){var d,e,f,g,h,i,j,k,l=a.filter(function(a){return X(a.id)===c}),m="y2"===c?Gg:xg,n="y2"===c?Fg:wg,o=b(m)?m:Ob(l),p=b(n)?n:Pb(l),q="y2"===c?Hg:yg,r=Uc()&&kg;return o===p&&(0>o?p=0:o=0),d=Math.abs(p-o),e=f=g=r?0:.1*d,q&&(h=Math.max(Math.abs(o),Math.abs(p)),p=h-q,o=q-h),"y"===c&&Cg&&(f=b(Cg.top)?Cg.top:e,g=b(Cg.bottom)?Cg.bottom:e),"y2"===c&&Lg&&(f=b(Lg.top)?Lg.top:e,g=b(Lg.bottom)?Lg.bottom:e),r&&(i=Vc(o,p),j=Wb(yf.range()),k=[i[0]/j,i[1]/j],f+=d*(k[1]/(1-k[0]-k[1])),g+=d*(k[0]/(1-k[0]-k[1]))),vd(l)&&!xc(l)&&(g=o),[o-g,p+f]}function Rb(a){var b=Wb(ai),c=Wb(xf.domain());return a||0===c?1:b/c}function Sb(a){return sg?sg:Ge.min(a,function(a){return Ge.min(a.values,function(a){return a.x})})}function Tb(a){return rg?rg:Ge.max(a,function(a){return Ge.max(a.values,function(a){return a.x})})}function Ub(a,b){var c,d,e=b[0],f=b[1],g=Math.abs(e-f);return vh?d=0:vd(a)?(c=mc(),d=c>1?g/(c-1)/2:.5):d=.01*g,d}function Vb(a){var b=[Sb(a),Tb(a)],c=b[0],d=b[1],e=Ub(a,b),f=uh?new Date(c.getTime()-e):c-e,g=uh?new Date(d.getTime()+e):d+e;return[f,g]}function Wb(a){return a[1]-a[0]}function Xb(a){for(var b=0;bd?0:d}function ac(a){return Hf&&a===Hf||Pd(If)&&Qd(If,a)}function bc(a){return!ac(a)}function cc(a){return Hf?Hf:Pd(If)?If[a]:null}function dc(a,b){return a in He.data.x&&He.data.x[a]&&He.data.x[a][b]?He.data.x[a][b]:b}function ec(a){Object.keys(a).forEach(function(b){If[b]=a[b]})}function fc(a){var b;return a&&(b=Lf[a.id],a.name=b?b:a.id),a}function gc(a){var b,c,d=a[0],e={},f=[];for(b=1;b=0?a.map(function(a){return a[c]}):He.data.x[Object.keys(He.data.x)[0]]}),b=c.map(function(b,c){var d=Kf(b);return{id:d,id_org:b,values:a.map(function(a,e){var f,g=cc(b);return uh?f=a[g]?a[g]instanceof Date?a[g]:Ld(a[g]):null:wh&&!vh?f=a[g]?+a[g]:dc(b,e):wh&&vh?(f=e,0===c&&a[g]&&(0===e&&(mg=[]),mg.push(a[g]))):f=e,a.x=f,{x:f,value:null===a[b]||isNaN(a[b])?null:+a[b],id:d}})}}),b.forEach(function(a){var b;a.values=a.values.sort(function(a,b){var c=a.x||0===a.x?a.x:1/0,d=b.x||0===b.x?b.x:1/0;return c-d}),b=0,a.values.forEach(function(a){a.index=b++})}),Of&&td(oc(b).filter(function(a){return!(a in Pf)}),Of),b.forEach(function(a){Yb(a.id_org,a)}),b}function jc(a){return{id:a.id,id_org:a.id_org,values:a.values.map(function(a){return{x:a.x,value:a.value,id:a.id}})}}function kc(a){return a>0&&He.data.targets[0].values[a-1]?He.data.targets[0].values[a-1].x:void 0}function lc(a){return a1?He.data.targets.forEach(function(b){b.values.length>c&&(a=b,c=b.values.length)}):a=b?He.data.targets[0]:null,a}function oc(a){return a=c(a)?He.data.targets:a,a.map(function(a){return a.id})}function pc(a){var b,c=oc();for(b=0;ba})}function yc(a){return wc(a,function(a){return a>0})}function zc(a){return a=0&&d===a[c].x;c--)e.push(a[c]);for(c=b;c0?g=h:f=h,g-f===1||0===f&&0===g?(e=[],a[f].x&&(e=e.concat(ad(a,f))),a[g].x&&(e=e.concat(ad(a,g))),dd(e,b)):bd(a,b,f,g)}function cd(a,b){var c;return c=a.map(function(a){return bd(a.values,b)}),dd(c,b)}function dd(a,b){var c,d;return a.forEach(function(a){var e=Rd(a,b);(c>e||!c)&&(c=e,d=a)}),d}function ed(a){var b=a.getBoundingClientRect(),c=[a.pathSegList.getItem(0),a.pathSegList.getItem(1)],d=c[0].x,e=Math.min(c[0].y,c[1].y);return{x:d,y:e,width:b.width,height:b.height}}function fd(){return Rf&&"desc"===Rf.toLowerCase()}function gd(){return Rf&&"asc"===Rf.toLowerCase()}function hd(a){var b=gd(),c=fd();return b||c?a.sort(function(a,c){var d=function(a,b){return a+Math.abs(b.value)},e=a.values.reduce(d,0),f=c.values.reduce(d,0);return b?f-e:e-f}):"function"==typeof Rf&&a.sort(Rf),a}function id(a,c){var d,e,f,g,h,i,j,k=zd(He.data.targets),l=k?_c:$c,m=a.filter(function(a){return a&&b(a.value)});lh&&0!==m.length&&($h.html(oh(a,Y(),l,Bh)).style("display","block"),d=$h.property("offsetWidth"),e=$h.property("offsetHeight"),k?(g=_e/2+c[0],i=bf/2+c[1]+20):(kg?(f=o(),g=f+c[0]+100,h=g+d,j=p()-s(),i=xf(m[0].x)+20):(f=o(),g=f+r()+xf(m[0].x)+20,h=g+d,j=f+p()-s(),i=c[1]+15),h>j&&(g-=d+60),i+e>q()&&(i-=e+30)),$h.style("top",i+"px").style("left",g+"px"))}function jd(){$h.style("display","none")}function kd(a){var c=a.filter(function(a){return a&&b(a.value)});lh&&(wd(He.data.targets)||zd(He.data.targets)||Xh.selectAll("line."+Me.xgridFocus).style("visibility","visible").data([c[0]]).attr(kg?"y1":"x1",Wc).attr(kg?"y2":"x2",Wc))}function ld(){Xh.select("line."+Me.xgridFocus).style("visibility","hidden")}function md(a){return a.x||0===a.x?xf(a.x):null}function nd(a){return T(a.id)(a.value)}function od(){var a,b,d={},e=0;return qc(Cd).forEach(function(f){for(a=0;a0&&(i+=g(b.values[f].value)-h)}),i}}function sd(a,b){return Zg?Zg:b?2*a.tickOffset()*$g/b:0}function td(a,b){var d=c(a)?oc():a;"string"==typeof d&&(d=[d]);for(var e=0;e0}function Qd(a,b){var c=!1;return Object.keys(a).forEach(function(d){a[d]===b&&(c=!0)}),c}function Rd(a,b){return Math.pow(xf(a.x)-b[0],2)+Math.pow(yf(a.value)-b[1],2)}function Sd(a,b,c){_f(b,a.node()),Xh.select("."+Me.selectedCircles+Oc(b.id)).selectAll("."+Me.selectedCircle+"-"+c).data([b]).enter().append("circle").attr("class",function(){return Ac(Me.selectedCircle,c)}).attr("cx",kg?nd:md).attr("cy",kg?md:nd).attr("stroke",function(){return Bh(b.id)}).attr("r",1.4*Yg).transition().duration(100).attr("r",Yg)}function Td(a,b,c){ag(b,a.node()),Xh.select("."+Me.selectedCircles+Oc(b.id)).selectAll("."+Me.selectedCircle+"-"+c).transition().duration(100).attr("r",0).remove()}function Ud(a,b,c,d){a?Sd(b,c,d):Td(b,c,d)}function Vd(a,b){_f(b,a.node()),a.transition().duration(100).style("fill",function(){return Ge.rgb(Bh(b.id)).darker(1)})}function Wd(a,b){ag(b,a.node()),a.transition().duration(100).style("fill",function(){return Bh(b.id)})}function Xd(a,b,c,d){a?Vd(b,c,d):Wd(b,c,d)}function Yd(a){return a.filter(function(a){return b(a.value)})}function Zd(a,c){return(c?Xh.selectAll("."+Me.circles+Oc(c)):Xh).selectAll("."+Me.circle+(b(a)?"-"+a:""))}function $d(a,b){Zd(a,b).classed(Je,!0).attr("r",Xg)}function _d(a){Zd(a).filter(function(){return Ge.select(this).classed(Je)}).classed(Je,!1).attr("r",Ug)}function ae(a){return Xh.selectAll("."+Me.bar+(b(a)?"-"+a:""))}function be(a){ae(a).classed(Je,!0)}function ce(a){ae(a).classed(Je,!1)}function de(a,b){var c=he(a,b);return function(a,b){var d=c(a,b),e=kg?1:0,f=kg?0:1,g="M "+d[0][e]+","+d[0][f]+" L"+d[1][e]+","+d[1][f]+" L"+d[2][e]+","+d[2][f]+" L"+d[3][e]+","+d[3][f]+" z";return g}}function ee(a,b){var c=he(a,!1),d=b?fe:ge;return function(a,b){return d(c(a,b),a,this)}}function fe(a,b){var c;return kg?(c=Cd(b)?4:6,a[2][1]+c*(b.value<0?-1:1)):a[0][0]+(a[2][0]-a[0][0])/2}function ge(a,b,c){var d=c.getBBox();return kg?(a[0][0]+a[2][0]+.6*d.height)/2:a[2][1]+(b.value<0?d.height:Cd(b)?-3:-6)}function he(a,b){var c=a.__max__+1,d=sd(Df,c),e=pd(d,c,a,!!b),f=qd(!!b),g=rd(a,!!b),h=b?U:T;return function(a,b){var c=h(a.id)(0),i=g(a,b)||c,j=e(a),k=f(a);return kg&&(a.value>0&&i>k||a.value<0&&k>i)&&(k=i),[[j,i],[j,k-(c-i)],[j+d,k-(c-i)],[j+d,i]]}}function ie(a,b,e,f){var g,h,i,j,k,l,m,n,o,p,q,r=-1,s="M",t=[];if(d(f))for(g=0;g=h;h+=u)s+=i(a[g-1],a[g],h,o)}r=a[g].x}return s}function je(b){var c,d,e;if(_h=Ge.select(Ne),_h.empty())throw new Error('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');if(_h.html(""),_h.classed("c3",!0),He.data.x={},He.data.targets=ic(b),m(),P(),xf.domain(Ge.extent(Vb(He.data.targets))),yf.domain(Qb(He.data.targets,"y")),zf.domain(Qb(He.data.targets,"y2")),Af.domain(xf.domain()),Bf.domain(yf.domain()),Cf.domain(zf.domain()),ai=xf.domain(),Qh.scale(Af),Se&&Uh.scale(xf),Vh=_h.append("svg").attr("width",_e+Ye.left+Ye.right).attr("height",bf+Ye.top+Ye.bottom).on("mouseenter",Ve).on("mouseleave",We),Wh=Vh.append("defs"),Wh.append("clipPath").attr("id",sh).append("rect").attr("width",_e).attr("height",bf),Wh.append("clipPath").attr("id","xaxis-clip").append("rect").attr("x",z).attr("y",A).attr("width",F).attr("height",G),Wh.append("clipPath").attr("id","yaxis-clip").append("rect").attr("x",B).attr("y",C).attr("width",H).attr("height",I),Xh=Vh.append("g").attr("transform",Ih.main),Yh=dg?Vh.append("g").attr("transform",Ih.context):null,Zh=gg?Vh.append("g").attr("transform",Ih.legend):null,$h=Ge.select(Ne).style("position","relative").append("div").style("position","absolute").style("pointer-events","none").style("z-index","10").style("display","none"),Xh.append("g").attr("class",Me.axisX).attr("clip-path",kg?"":h("xaxis-clip")).attr("transform",Ih.x).append("text").attr("class",Me.axisXLabel).attr("transform",kg?"rotate(-90)":"").attr("dx",nb).attr("dy",qb).style("text-anchor",tb).text(eb),vg&&Xh.append("g").attr("class",Me.axisY).attr("clip-path",kg?h("yaxis-clip"):"").append("text").attr("class",Me.axisYLabel).attr("transform",kg?"":"rotate(-90)").attr("dx",ob).attr("dy",rb).style("text-anchor",ub).text(fb),Eg&&Xh.append("g").attr("class",Me.axisY2).attr("transform",Ih.y2).append("text").attr("class",Me.axisY2Label).attr("transform",kg?"":"rotate(-90)").attr("dx",pb).style("text-anchor",vb).text(gb),d=Xh.append("g").attr("clip-path",th).attr("class",Me.grid),Ng&&d.append("g").attr("class",Me.xgrids),Pd(Pg)&&d.append("g").attr("class",Me.xgridLines),Vg&&d.append("g").attr("class",Me.xgridFocus).append("line").attr("class",Me.xgridFocus).attr("x1",kg?0:-10).attr("x2",kg?_e:-10).attr("y1",kg?-10:Ye.top).attr("y2",kg?-10:bf),Qg&&d.append("g").attr("class",Me.ygrids),Pd(Rg)&&d.append("g").attr("class",Me.ygridLines),Xh.append("g").attr("clip-path",th).attr("class",Me.regions),Xh.append("g").attr("clip-path",th).attr("class",Me.chart),c=Xh.select("."+Me.chart).append("g").attr("class",Me.eventRects).style("fill-opacity",0).style("cursor",Se?kg?"ns-resize":"ew-resize":null),Xh.select("."+Me.chart).append("g").attr("class",Me.chartBars),Xh.select("."+Me.chart).append("g").attr("class",Me.chartLines),Xh.select("."+Me.chart).append("g").attr("class",Me.chartArcs).attr("transform",Ih.arc).append("text").attr("class",Me.chartArcsTitle).style("text-anchor","middle").text(Kb()),Xh.select("."+Me.chart).append("g").attr("class",Me.chartTexts),Se&&Xh.insert("rect",Ue?null:"g."+Me.grid).attr("class",Me.zoomRect).attr("width",_e).attr("height",bf).style("opacity",0).style("cursor",kg?"ns-resize":"ew-resize").call(Uh).on("dblclick.zoom",null),tg&&Qh.extent("function"!=typeof tg?tg:tg(Vb())),dg&&(Yh.append("g").attr("clip-path",th).attr("class",Me.chart),Yh.select("."+Me.chart).append("g").attr("class",Me.chartBars),Yh.select("."+Me.chart).append("g").attr("class",Me.chartLines),Yh.append("g").attr("clip-path",th).attr("class",Me.brush).call(Qh).selectAll("rect").attr(kg?"width":"height",kg?af:cf),Yh.append("g").attr("class",Me.axisX).attr("transform",Ih.subx).attr("clip-path",kg?"":h("xaxis-clip"))),we(He.data.targets),kg?Xh.select("."+Me.axisX).style("opacity",0).call(Df):(Xh.select("."+Me.axisY).style("opacity",0).call(Ef),Xh.select("."+Me.axisY2).style("opacity",0).call(Ff)),ve({withTransform:!0,withLegend:!0,durationForAxis:0}),ph){if(uh&&"string"==typeof qh){for(qh=Ld(qh),e=0;e0){d=[];for(var f in Lf)for(c=0;cf&&g>c&&d>h&&i>d):"path"===this.nodeName&&(l=ed(this),c=l.x,d=l.y,e=l.width,j=l.height,k=Xd,p=!(c>g||f>c+e||d>i||h>d+j)),p^o&&(m.classed(Le,!o),m.classed(Ke,!n),k(!n,m,a,b))}))}function oe(a){zd(He.data.targets)||Uf&&(xh=a,Xh.select("."+Me.chart).append("rect").attr("class",Me.dragarea).style("opacity",.1),yh=!0,bg())}function pe(){zd(He.data.targets)||Uf&&(Xh.select("."+Me.dragarea).transition().duration(100).style("opacity",0).remove(),Xh.selectAll("."+Me.shape).classed(Le,!1),yh=!1,cg())}function qe(a){var c,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H=od(),I=zd(He.data.targets),K=sc(He.data.targets);if(0!==K.length){if(a=d(a)?a:{},t=d(a.withY)?a.withY:!0,u=d(a.withSubchart)?a.withSubchart:!0,v=d(a.withTransition)?a.withTransition:!0,w=d(a.withTransform)?a.withTransform:!1,x=d(a.withUpdateXDomain)?a.withUpdateXDomain:!1,y=d(a.withUpdateOrgXDomain)?a.withUpdateOrgXDomain:!1,z=d(a.withLegend)?a.withLegend:!1,E=v?Xe:0,F=d(a.durationForExit)?a.durationForExit:E,G=d(a.durationForAxis)?a.durationForAxis:E,z&&gg&&Ce(He.data.targets,a),y&&(xf.domain(Ge.extent(Vb(K))),ai=xf.domain(),Se&&Uh.scale(xf).updateScaleExtent(),Af.domain(xf.domain()),Qh.scale(Af)),x&&(xf.domain(Qh.empty()?ai:Qh.extent()),Se&&Uh.scale(xf).updateScaleExtent()),yf.domain(Qb(K,"y")),zf.domain(Qb(K,"y2")),Xh.select("."+Me.axisX).style("opacity",I?0:1).transition().duration(G).call(Df),Xh.select("."+Me.axisY).style("opacity",I?0:1).transition().duration(G).call(Ef),Xh.select("."+Me.axisY2).style("opacity",I?0:1).transition().duration(G).call(Ff),A=de(H),C=ee(H,!0),D=ee(H,!1),Xh.select("."+Me.axisX+" ."+Me.axisXLabel).attr("x",kb),Xh.select("."+Me.axisY+" ."+Me.axisYLabel).attr("x",lb).attr("dy",rb),Xh.select("."+Me.axisY2+" ."+Me.axisY2Label).attr("x",mb).attr("dy",sb),Bf.domain(yf.domain()),Cf.domain(zf.domain()),$h.style("display","none"),Xh.select("line."+Me.xgridFocus).style("visibility","hidden"),Ng){if("year"===Og){e=[];for(var L=Vb(),M=L[0].getFullYear(),N=L[1].getFullYear(),O=M;N>=O;O++)e.push(new Date(O+"-01-01 00:00:00"))}else e=xf.ticks(10);c=Xh.select("."+Me.xgrids).selectAll("."+Me.xgrid).data(e),c.enter().append("line").attr("class",Me.xgrid),c.attr("x1",kg?0:function(a){return xf(a)-Df.tickOffset()}).attr("x2",kg?_e:function(a){return xf(a)-Df.tickOffset()}).attr("y1",kg?function(a){return xf(a)-Df.tickOffset()}:Ye.top).attr("y2",kg?function(a){return xf(a)-Df.tickOffset()}:bf).style("opacity",function(){return+Ge.select(this).attr(kg?"y1":"x1")===(kg?bf:0)?0:1}),c.exit().remove()}Pd(Pg)&&(f=Xh.select("."+Me.xgridLines).selectAll("."+Me.xgridLine).data(Pg),g=f.enter().append("g").attr("class",function(a){return Me.xgridLine+(a.class?a.class:"")}),g.append("line").style("opacity",0),g.append("text").attr("text-anchor","end").attr("transform",kg?"":"rotate(-90)").attr("dx",kg?0:-Ye.top).attr("dy",-5).style("opacity",0),f.select("line").transition().duration(E).attr("x1",kg?0:Xc).attr("x2",kg?_e:Xc).attr("y1",kg?Xc:Ye.top).attr("y2",kg?Xc:bf).style("opacity",1),f.select("text").transition().duration(E).attr("x",kg?_e:0).attr("y",Xc).text(function(a){return a.text}).style("opacity",1),f.exit().transition().duration(E).style("opacity",0).remove()),t&&Qg&&(h=Xh.select("."+Me.ygrids).selectAll("."+Me.ygrid).data(yf.ticks(Sg)),h.enter().append("line").attr("class",Me.ygrid),h.attr("x1",kg?yf:0).attr("x2",kg?yf:_e).attr("y1",kg?0:yf).attr("y2",kg?bf:yf),h.exit().remove()),t&&Pd(Rg)&&(i=Xh.select("."+Me.ygridLines).selectAll("."+Me.ygridLine).data(Rg),j=i.enter().append("g").attr("class",function(a){return Me.ygridLine+(a.class?a.class:"")}),j.append("line").style("opacity",0),j.append("text").attr("text-anchor","end").attr("transform",kg?"rotate(-90)":"").attr("dx",kg?0:-Ye.top).attr("dy",-5).style("opacity",0),i.select("line").transition().duration(E).attr("x1",kg?Yc:0).attr("x2",kg?Yc:_e).attr("y1",kg?0:Yc).attr("y2",kg?bf:Yc).style("opacity",1),i.select("text").transition().duration(E).attr("x",kg?0:_e).attr("y",Yc).text(function(a){return a.text}).style("opacity",1),i.exit().transition().duration(E).style("opacity",0).remove()),l=Xh.selectAll("."+Me.bars).selectAll("."+Me.bar).data(Hd),l.enter().append("path").attr("d",A).style("stroke","none").style("opacity",0).style("fill",function(a){return Bh(a.id)}).attr("class",Ic),l.style("opacity",Qc).transition().duration(E).attr("d",A).style("opacity",1),l.exit().transition().duration(F).style("opacity",0).remove(),n=Xh.selectAll("."+Me.texts).selectAll("."+Me.text).data(Jd),n.enter().append("text").attr("class",Bc).attr("text-anchor",function(a){return kg?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill-opacity",0).text(function(a){return $c(a.value)}),n.style("fill-opacity",Rc).transition().duration(E).attr("x",C).attr("y",D).style("fill-opacity",Tc),n.exit().transition().duration(F).style("fill-opacity",0).remove(),Xh.selectAll("."+Me.line).style("opacity",Qc).transition().duration(E).attr("d",Rh).style("opacity",1),Xh.selectAll("."+Me.area).style("opacity",0).transition().duration(E).attr("d",Sh).style("opacity",bi),k=Xh.selectAll("."+Me.circles).selectAll("."+Me.circle).data(Id),k.enter().append("circle").attr("class",Gc).style("opacity",0).attr("r",Ug),k.style("opacity",Qc).transition().duration(E).style("opacity",Sc).attr("cx",kg?nd:md).attr("cy",kg?md:nd),k.exit().remove(),Xh.selectAll("."+Me.chartArc).select("."+Me.arc).attr("transform",w?"scale(0)":"").style("opacity",function(a){return a===this._current?0:1}).transition().duration(E).attrTween("d",function(a){var b=yb(a);if(!b)return function(){return"M 0 0"};var c=Ge.interpolate(this._current,b);return this._current=c(0),function(a){return Bb(c(a),!0)}}).attr("transform",w?"scale(1)":"").style("opacity",1),Xh.selectAll("."+Me.chartArc).select("text").attr("transform",Cb).style("opacity",0).transition().duration(E).text(Fb).style("opacity",function(a){return Gd(a.data)?1:0}),Xh.select("."+Me.chartArcsTitle).style("opacity",yd(He.data.targets)?1:0),dg&&(null!==Ge.event&&"zoom"===Ge.event.type&&Qh.extent(xf.orgDomain()).update(),u&&(Yh.select("."+Me.axisX).style("opacity",I?0:1).transition().duration(E).call(Gf),Qh.empty()||Qh.extent(xf.orgDomain()).update(),B=de(H,!0),o=Yh.selectAll("."+Me.bars).selectAll("."+Me.bar).data(Hd),o.enter().append("path").attr("d",B).style("stroke","none").style("fill",function(a){return Bh(a.id)}).attr("class",Ic),o.style("opacity",Qc).transition().duration(E).attr("d",B).style("opacity",1),o.exit().transition().duration(E).style("opacity",0).remove(),Yh.selectAll("."+Me.line).style("opacity",Qc).transition().duration(E).attr("d",Th).style("opacity",1))),Xh.selectAll("."+Me.selectedCircles).filter(function(a){return Cd(a)}).selectAll("circle").remove(),Xh.selectAll("."+Me.selectedCircle).transition().duration(E).attr("cx",kg?nd:md).attr("cy",kg?md:nd),Pd(If)?(p=Xh.select("."+Me.eventRects).selectAll("."+Me.eventRect).data([0]),le(p.enter()),p.attr("x",0).attr("y",0).attr("width",_e).attr("height",bf)):(wh&&!vh?(s=function(a,b){var c=kc(b),d=lc(b);return(xf(d?d:a.x+50)-xf(c?c:a.x-50))/2},r=function(a,b){var c=kc(b);return(xf(a.x)+xf(c?c:a.x-50))/2}):(s=J(),r=function(a){return xf(a.x)-s/2}),q=nc(),Xh.select("."+Me.eventRects).datum(q?q.values:[]),p=Xh.select("."+Me.eventRects).selectAll("."+Me.eventRect).data(function(a){return a}),ke(p.enter()),p.attr("class",Nc).attr("x",kg?0:r).attr("y",kg?r:0).attr("width",kg?_e:s).attr("height",kg?s:bf),p.exit().remove()),m=Xh.select("."+Me.regions).selectAll("rect."+Me.region).data(kh),m.enter().append("rect").style("fill-opacity",0),m.attr("class",Mc).attr("x",kg?0:$b).attr("y",kg?$b:Ye.top).attr("width",kg?_e:_b).attr("height",kg?_b:bf).transition().duration(E).style("fill-opacity",function(a){return b(a.opacity)?a.opacity:.1}),m.exit().transition().duration(E).style("fill-opacity",0).remove(),oc().forEach(function(a){ci[a]=!0})}}function re(){qe({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}function se(){return"mousemove"===Ge.event.sourceEvent.type&&Uh.altDomain?(xf.domain(Uh.altDomain),void Uh.scale(xf).updateScaleExtent()):(vh&&xf.orgDomain()[0]===ai[0]&&xf.domain([ai[0]-1e-10,xf.orgDomain()[1]]),qe({withTransition:!1,withY:!1,withSubchart:!1}),void("mousemove"===Ge.event.sourceEvent.type&&(zh=!0)))}function te(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a}function ue(){Vh.attr("width",df).attr("height",ef),Vh.select("#"+sh).select("rect").attr("width",_e).attr("height",bf),Vh.select("#xaxis-clip").select("rect").attr("width",F),Vh.select("#yaxis-clip").select("rect").attr("width",H),Vh.select("."+Me.zoomRect).attr("width",_e).attr("height",bf)}function ve(a){a=d(a)?a:{},a.withTransition=d(a.withTransition)?a.withTransition:!0,a.withTransform=d(a.withTransform)?a.withTransform:!1,a.withLegend=d(a.withLegend)?a.withLegend:!1,a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.durationForExit=0,m(),P(),ue(),l(a.withTransition),qe(a)}function we(a){var b,c,d,e,f,g,h,i,j,k,l,m;h=Xh.select("."+Me.chartTexts).selectAll("."+Me.chartText).data(a),i=h.enter().append("g").attr("class",function(a){return Me.chartText+Ac(Me.target,a.id)}).style("pointer-events","none"),i.append("g").attr("class",Cc).style("fill",function(a){return Bh(a.id)}),e=Xh.select("."+Me.chartBars).selectAll("."+Me.chartBar).data(a),d=e.enter().append("g").attr("class",function(a){return Me.chartBar+Ac(Me.target,a.id)}).style("pointer-events","none"),d.append("g").attr("class",Jc).style("fill",function(a){return Bh(a.id)}).style("stroke","none").style("cursor",function(a){return Wf(a)?"pointer":null}),c=Xh.select("."+Me.chartLines).selectAll("."+Me.chartLine).data(a),b=c.enter().append("g").attr("class",function(a){return Me.chartLine+Ac(Me.target,a.id)}).style("pointer-events","none"),b.append("path").attr("class",Fc).style("opacity",0).style("stroke",function(a){return Bh(a.id)}),b.append("path").attr("class",Lc).style("opacity",function(){return bi=+Ge.select(this).style("opacity"),0}).style("fill",function(a){return Bh(a.id)}),b.append("g").attr("class",function(a){return Ac(Me.selectedCircles,a.id)}),b.append("g").attr("class",Hc).style("fill",function(a){return Bh(a.id)}).style("cursor",function(a){return Wf(a)?"pointer":null}),a.forEach(function(a){Xh.selectAll("."+Me.selectedCircles+Oc(a.id)).selectAll("."+Me.selectedCircle).each(function(b){b.value=a.values[b.x].value})}),g=Xh.select("."+Me.chartArcs).selectAll("."+Me.chartArc).data(of(a)),f=g.enter().append("g").attr("class",function(a){return Me.chartArc+Ac(Me.target,a.data.id)}),f.append("path").attr("class",Kc).style("opacity",0).style("fill",function(a){return Bh(a.data.id)}).style("cursor",function(a){return Wf(a)?"pointer":null}).each(function(a){this._current=a}).on("mouseover",function(a,b){var c=Eb(a),d=Mb();Gb(a.data.id),ze(a.data.id),d(c,b)}).on("mousemove",function(a){var b=[Eb(a)];id(b,Ge.mouse(this))}).on("mouseout",function(a,b){var c=Eb(a),d=Nb();Hb(a.data.id),Be(),jd(),d(c,b)}).on("click",function(a,b){var c=Eb(a),d=Lb();d(c,b)}),f.append("text").attr("dy",".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none"),dg&&(m=Yh.select("."+Me.chartBars).selectAll("."+Me.chartBar).data(a),l=m.enter().append("g").attr("class",function(a){return Me.chartBar+Ac(Me.target,a.id)}),l.append("g").attr("class",Jc).style("fill",function(a){return Bh(a.id)}),k=Yh.select("."+Me.chartLines).selectAll("."+Me.chartLine).data(a),j=k.enter().append("g").attr("class",function(a){return Me.chartLine+Ac(Me.target,a.id)}),j.append("path").attr("class",Fc).style("opacity",0).style("stroke",function(a){return Bh(a.id)})),Vh.selectAll("."+Me.target).filter(function(a){return rc(a.id)}).transition().style("opacity",1)}function xe(a,b){He.data.targets.forEach(function(b){for(var c=0;ce&&(e=(k-j)/2,v=0,B++)),A[a]=B,z[B]=e,w[a]=v,v+=j}var e,f,g=a.getBBox(),h=10*Math.ceil((g.width+r)/10),i=10*Math.ceil((g.height+q)/10),j=Jh?i:h,k=Jh?ff:gf;c&&(v=0,B=0,s=0,t=0),x[b]=h,y[b]=i,(!s||h>=s)&&(s=h),(!t||i>=t)&&(t=i),f=Jh?t:s,jg?(Object.keys(x).forEach(function(a){x[a]=s}),Object.keys(y).forEach(function(a){y[a]=t}),e=(k-f*p.length)/2,u>e?(v=0,B=0,p.forEach(function(a){d(a)})):d(b,!0)):d(b)}var f,g,h,i,j,k,n,o,p=oc(a),q=4,r=26,s=0,t=0,u=10,v=0,w={},x={},y={},z={},A={},B=0;b=c(b)?{}:b,o=d(b.withTransition)?b.withTransition:!0,Jh?(g=function(a){return s*(.2+A[a])},j=function(a){return z[A[a]]+w[a]}):(g=function(a){return z[A[a]]+w[a]},j=function(a){return t*(.2+A[a])}),h=function(a,b){return g(a,b)+14},k=function(a,b){return j(a,b)+9},i=function(a,b){return g(a,b)-4},n=function(a,b){return j(a,b)-7},f=Zh.selectAll("."+Me.legendItem).data(p).enter().append("g").attr("class",function(a){return Ac(Me.legendItem,a)}).style("cursor","pointer").on("click",function(a){"function"==typeof ig?ig(a):He.toggle(a)}).on("mouseover",function(a){He.focus(a)}).on("mouseout",function(){He.revert()}),f.append("text").text(function(a){return d(Lf[a])?Lf[a]:a}).each(function(a,b){e(this,a,0===b)}).style("pointer-events","none").attr("x",Jh?h:-200).attr("y",Jh?-200:k),f.append("rect").attr("class",Me.legendItemEvent).style("fill-opacity",0).attr("x",Jh?i:-200).attr("y",Jh?-200:n).attr("width",function(a){return x[a]}).attr("height",function(a){return y[a]}),f.append("rect").attr("class",Me.legendItemTile).style("pointer-events","none").style("fill",function(a){return Bh(a)}).attr("x",Jh?h:-200).attr("y",Jh?-200:j).attr("width",10).attr("height",10),Zh.selectAll("text").data(p).each(function(a,b){e(this,a,0===b)}).transition().duration(o?250:0).attr("x",h).attr("y",k),Zh.selectAll("rect."+Me.legendItemEvent).data(p).transition().duration(o?250:0).attr("x",i).attr("y",n),Zh.selectAll("rect."+Me.legendItemTile).data(p).transition().duration(o?250:0).attr("x",g).attr("y",j),L(s),M(t),K(B),m(),P(),ue(),l(!1)}function De(a){return pc(a.id)}function Ee(a){return"data"in a&&pc(a.data.id)}function Fe(a){var b=a&&a.value?a.value:null,c=a&&a["class"]?a["class"]:null;return b?function(a){return a.value!==b}:c?function(a){return a["class"]!==c}:function(){return!0}}var Ge=a.d3?a.d3:a.require?a.require("d3"):void 0,He={data:{}},Ie={},Je="_expanded_",Ke="_selected_",Le="_included_",Me={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",region:"c3-region",regions:"c3-regions",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",area:"c3-area",text:"c3-text",texts:"c3-texts",grid:"c3-grid",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",dragarea:"c3-dragarea"},Ne=g(["bindto"],"#chart"),Oe=g(["size","width"]),Pe=g(["size","height"]),Qe=g(["padding","left"]),Re=g(["padding","right"]),Se=g(["zoom","enabled"],!1),Te=g(["zoom","extent"]),Ue=g(["zoom","privileged"],!1),Ve=g(["onenter"],function(){}),We=g(["onleave"],function(){}),Xe=g(["transition","duration"],350);f("data","data is required in config");var Ye,Ze,$e,_e,af,bf,cf,df,ef,ff,gf,hf,jf,kf,lf,mf,nf,of,pf,qf,rf,sf,tf,uf,vf,wf,xf,yf,zf,Af,Bf,Cf,Df,Ef,Ff,Gf,Hf=g(["data","x"]),If=g(["data","xs"],{}),Jf=g(["data","x_format"],"%Y-%m-%d"),Kf=g(["data","id_converter"],function(a){return a}),Lf=g(["data","names"],{}),Mf=g(["data","groups"],[]),Nf=g(["data","axes"],{}),Of=g(["data","type"]),Pf=g(["data","types"],{}),Qf=g(["data","labels"],{}),Rf=g(["data","order"]),Sf=g(["data","regions"],{}),Tf=g(["data","colors"],{}),Uf=g(["data","selection","enabled"],!1),Vf=g(["data","selection","grouped"],!1),Wf=g(["data","selection","isselectable"],function(){return!0}),Xf=g(["data","selection","multiple"],!0),Yf=g(["data","onclick"],function(){}),Zf=g(["data","onenter"],function(){}),$f=g(["data","onleave"],function(){}),_f=g(["data","onselected"],function(){}),ag=g(["data","onunselected"],function(){}),bg=g(["data","ondragstart"],function(){}),cg=g(["data","ondragend"],function(){}),dg=g(["subchart","show"],!1),eg=dg?g(["subchart","size","height"],60):0,fg=g(["color","pattern"],[]),gg=g(["legend","show"],!0),hg=g(["legend","position"],"bottom"),ig=g(["legend","item","onclick"]),jg=g(["legend","equally"],!1),kg=g(["axis","rotated"],!1),lg=g(["axis","x","type"],"indexed"),mg=g(["axis","x","categories"],[]),ng=g(["axis","x","tick","centered"],!1),og=g(["axis","x","tick","format"]),pg=g(["axis","x","tick","culling"],"categorized"===lg?!1:!0),qg=g(["axis","x","tick","count"],10),rg=g(["axis","x","max"]),sg=g(["axis","x","min"]),tg=g(["axis","x","default"]),ug=g(["axis","x","label"],{}),vg=g(["axis","y","show"],!0),wg=g(["axis","y","max"]),xg=g(["axis","y","min"]),yg=g(["axis","y","center"]),zg=g(["axis","y","label"],{}),Ag=g(["axis","y","inner"],!1),Bg=g(["axis","y","tick","format"]),Cg=g(["axis","y","padding"]),Dg=g(["axis","y","ticks"],10),Eg=g(["axis","y2","show"],!1),Fg=g(["axis","y2","max"]),Gg=g(["axis","y2","min"]),Hg=g(["axis","y2","center"]),Ig=g(["axis","y2","label"]),Jg=g(["axis","y2","inner"],!1),Kg=g(["axis","y2","tick","format"]),Lg=g(["axis","y2","padding"]),Mg=g(["axis","y2","ticks"],10),Ng=g(["grid","x","show"],!1),Og=g(["grid","x","type"],"tick"),Pg=g(["grid","x","lines"],[]),Qg=g(["grid","y","show"],!1),Rg=g(["grid","y","lines"],[]),Sg=g(["grid","y","ticks"],10),Tg=g(["point","show"],!0),Ug=Tg?g(["point","r"],2.5):0,Vg=g(["point","focus","line","enabled"],!0),Wg=g(["point","focus","expand","enabled"],!0),Xg=g(["point","focus","expand","r"],Wg?4:Ug),Yg=g(["point","focus","select","r"],8),Zg=g(["bar","width"]),$g=g(["bar","width","ratio"],.6),_g=g(["pie","label","show"],!0),ah=g(["pie","label","format"]),bh=g(["pie","onclick"],function(){}),ch=g(["pie","onmouseover"],function(){}),dh=g(["pie","onmouseout"],function(){}),eh=g(["donut","label","show"],!0),fh=g(["donut","label","format"]),gh=g(["donut","title"],""),hh=g(["donut","onclick"],function(){}),ih=g(["donut","onmouseover"],function(){}),jh=g(["donut","onmouseout"],function(){}),kh=g(["regions"],[]),lh=g(["tooltip","show"],!0),mh=g(["tooltip","format","title"]),nh=g(["tooltip","format","value"]),oh=g(["tooltip","contents"],function(a,b,c,d){var e,f,g,h,i,j=mh?mh:b,k=nh?nh:c;for(f=0;f"+(g||0===g?""+g+"":"")),i=a[f].name,h=k(a[f].value,a[f].ratio),e+="",e+=""+i+"",e+=""+h+"",e+="");return e+""}),ph=g(["tooltip","init","show"],!1),qh=g(["tooltip","init","x"],0),rh=g(["tooltip","init","position"],{top:"0px",left:"50px"}),sh=("string"==typeof Ne?Ne.replace("#",""):Ne.id)+"-clip",th=h(sh),uh="timeseries"===lg,vh="categorized"===lg,wh=!uh&&(Hf||Pd(If)),xh=null,yh=!1,zh=!1,Ah=!1,Bh=Kd(Tf,fg),Ch=function(){var a=[[Ge.time.format("%Y/%-m/%-d"),function(){return!0}],[Ge.time.format("%-m/%-d"),function(a){return a.getMonth()}],[Ge.time.format("%-m/%-d"),function(a){return 1!==a.getDate()}],[Ge.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[Ge.time.format("%I %p"),function(a){return a.getHours()}],[Ge.time.format("%I:%M"),function(a){return a.getMinutes()}],[Ge.time.format(":%S"),function(a){return a.getSeconds()}],[Ge.time.format(".%L"),function(a){return a.getMilliseconds()}]];return function(b){for(var c=a.length-1,d=a[c];!d[1](b);)d=a[--c];return d[0](b)}}(),Dh=[],Eh=kg?"left":"bottom",Fh=kg?Ag?"top":"bottom":Ag?"right":"left",Gh=kg?Jg?"bottom":"top":Jg?"left":"right",Hh=kg?"left":"bottom",Ih={main:function(){return"translate("+Ye.left+","+Ye.top+")"},context:function(){return"translate("+Ze.left+","+Ze.top+")"},legend:function(){return"translate("+$e.left+","+$e.top+")"},x:function(){return"translate(0,"+(kg?0:bf)+")"},y:function(){return"translate(0,"+(kg?bf:0)+")"},y2:function(){return"translate("+(kg?0:_e)+","+(kg?1:0)+")"},subx:function(){return"translate(0,"+(kg?0:cf)+")"},arc:function(){return"translate("+_e/2+","+bf/2+")"}},Jh="right"===hg,Kh=0,Lh=0,Mh=0,Nh=30,Oh=30,Ph=5;of=Ge.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)});var Qh,Rh=function(){var a=Ge.svg.line().x(kg?function(a){return T(a.id)(a.value)}:Wc).y(kg?Wc:function(a){return T(a.id)(a.value)});return function(b){var c,d,e=Yd(b.values);return Ad(b)?(a.interpolate(Bd(b)?"cardinal":"linear"),Sf[b.id]?ie(e,xf,T(b.id),Sf[b.id]):a(e)):(c=xf(e[0].x),d=T(b.id)(e[0].value),kg?"M "+d+" "+c:"M "+c+" "+d)}}(),Sh=function(){var a;return a=kg?Ge.svg.area().x0(function(a){return T(a.id)(0)}).x1(function(a){return T(a.id)(a.value)}).y(Wc):Ge.svg.area().x(Wc).y0(function(a){return T(a.id)(0)}).y1(function(a){return T(a.id)(a.value)}),function(b){var c,d,e=Yd(b.values);return ud([b],"area")||ud([b],"area-spline")?(a.interpolate(Bd(b)?"cardinal":"linear"),a(e)):(c=xf(e[0].x),d=T(b.id)(e[0].value),kg?"M "+d+" "+c:"M "+c+" "+d)}}(),Th=function(){var a=Ge.svg.line().x(kg?function(a){return U(a.id)(a.value)}:Zc).y(kg?Zc:function(a){return U(a.id)(a.value)});return function(b){var c=Yd(b.values);return Ad(b)?a(c):"M "+Af(c[0].x)+" "+U(b.id)(c[0].value)}}(),Uh=function(){};Qh=Ge.svg.brush().on("brush",re),Qh.update=function(){return Yh&&Yh.select("."+Me.brush).call(this),this},Qh.scale=function(a){return kg?this.y(a):this.x(a)},Se&&(Uh=Ge.behavior.zoom().on("zoomstart",function(){Uh.altDomain=Ge.event.sourceEvent.altKey?xf.orgDomain():null}).on("zoom",Se?se:null),Uh.scale=function(a){return kg?this.y(a):this.x(a)},Uh.orgScaleExtent=function(){var a=Te?Te:[1,10];return[a[0],Math.max(mc()/a[1],a[1])]},Uh.updateScaleExtent=function(){var a=Wb(xf.orgDomain())/Wb(ai),b=this.orgScaleExtent();return this.scaleExtent([b[0]*a,b[1]*a]),this});var Vh,Wh,Xh,Yh,Zh,$h,_h,ai,bi,ci={};if(He.focus=function(a){function b(a){sc(a).transition().duration(100).style("opacity",1)}var c=Vh.selectAll(Pc(a)),d=c.filter(De),e=c.filter(Ee);He.revert(),He.defocus(),b(d.classed(Me.focused,!0)),b(e),zd(He.data.targets)&&Gb(a,!0),ze(a)},He.defocus=function(a){function b(a){sc(a).transition().duration(100).style("opacity",.3)}var c=Vh.selectAll(Pc(a)),d=c.filter(De),e=c.filter(Ee);He.revert(),b(d.classed(Me.focused,!1)),b(e),zd(He.data.targets)&&Hb(a),Ae(a)},He.revert=function(a){function b(a){sc(a).transition().duration(100).style("opacity",1)}var c=Vh.selectAll(Pc(a)),d=c.filter(De),e=c.filter(Ee);b(d.classed(Me.focused,!1)),b(e),zd(He.data.targets)&&Hb(a),Be()},He.show=function(a){uc(a),Vh.selectAll(Pc(a)).transition().style("opacity",1),qe({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!1})},He.hide=function(a){tc(a),Vh.selectAll(Pc(a)).transition().style("opacity",0),qe({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!1})},He.toggle=function(a){rc(a)?He.hide(a):He.show(a)},He.unzoom=function(){Qh.clear().update(),qe({withUpdateXDomain:!0})},He.load=function(a){if("function"!=typeof a.done&&(a.done=function(){}),a.xs&&ec(a.xs),"categories"in a&&vh&&(mg=a.categories,Df.categories(mg)),"cacheIds"in a&&Xb(a.cacheIds))return void xe(Zb(a.cacheIds),a.done);if("data"in a)xe(ic(a.data),a.done);else if("url"in a)Ge.csv(a.url,function(b,c){xe(ic(c),a.done)});else if("rows"in a)xe(ic(gc(a.rows)),a.done);else{if(!("columns"in a))throw Error("url or rows or columns is required.");xe(ic(hc(a.columns)),a.done)}},He.unload=function(a){He.data.targets=He.data.targets.filter(function(b){return b.id!==a}),Vh.selectAll(Pc(a)).transition().style("opacity",0).remove(),gg&&Zh.selectAll("."+Me.legendItem+Oc(a)).remove(),He.data.targets.length>0&&qe({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},He.selected=function(a){return Ge.merge(Xh.selectAll("."+Me.shapes+Oc(a)).selectAll("."+Me.shape).filter(function(){return Ge.select(this).classed(Ke)}).map(function(a){return a.map(function(a){return a.__data__})}))},He.select=function(a,b,c){Uf&&Xh.selectAll("."+Me.shapes).selectAll("."+Me.shape).each(function(e,f){var g=Ge.select(this),h="circle"===this.nodeName?Sd:Vd,i="circle"===this.nodeName?Td:Wd,j=Vf||!a||a.indexOf(e.id)>=0,k=!b||b.indexOf(f)>=0,l=g.classed(Ke);j&&k?Wf(e)&&!l&&h(g.classed(Ke,!0),e,f):d(c)&&c&&l&&i(g.classed(Ke,!1),e,f)})},He.unselect=function(a,b){Uf&&Xh.selectAll("."+Me.shapes).selectAll("."+Me.shape).each(function(c,d){var e=Ge.select(this),f="circle"===this.nodeName?Td:Wd,g=Vf||!a||a.indexOf(c.id)>=0,h=!b||b.indexOf(d)>=0,i=e.classed(Ke);g&&h&&Wf(c)&&i&&f(e.classed(Ke,!1),c,d)})},He.toLine=function(a){td(a,"line"),ve()},He.toSpline=function(a){td(a,"spline"),ve()},He.toBar=function(a){td(a,"bar"),ve()},He.toScatter=function(a){td(a,"scatter"),ve()},He.toArea=function(a){td(a,"area"),ve()},He.toAreaSpline=function(a){td(a,"area-spline"),ve()},He.toPie=function(a){td(a,"pie"),ve({withTransform:!0})},He.toDonut=function(a){td(a,"donut"),ve({withTransform:!0})},He.groups=function(a){return c(a)?Mf:(Mf=a,qe(),Mf)},He.xgrids=function(a){return a?(Pg=a,qe(),Pg):Pg},He.xgrids.add=function(a){return a?He.xgrids(Pg.concat(a)):void 0},He.xgrids.remove=function(a){var b=Fe(a);return He.xgrids(Pg.filter(b))},He.ygrids=function(a){return a?(Rg=a,qe(),Rg):Rg},He.ygrids.add=function(a){return a?He.ygrids(Rg.concat(a)):void 0},He.ygrids.remove=function(a){var b=Fe(a);return He.ygrids(Rg.filter(b))},He.regions=function(a){return c(a)?kh:(kh=a,qe(),kh)},He.regions.add=function(a){return c(a)?kh:(kh=kh.concat(a),qe(),kh)},He.regions.remove=function(a,c){var e=[].concat(a);return c=d(c)?c:{},e.forEach(function(a){var d=b(c.duration)?c.duration:0;Vh.selectAll("."+a).transition().duration(d).style("fill-opacity",0).remove(),kh=kh.filter(function(b){return b.classes.indexOf(a)<0})}),kh},He.data.get=function(a){var b=He.data.getAsTarget(a);return d(b)?b.values.map(function(a){return a.value}):void 0},He.data.getAsTarget=function(a){var b=qc(function(b){return b.id===a});return b.length>0?b[0]:void 0},He.resize=function(a){Oe=a?a.width:null,Pe=a?a.height:null,ve({withLegend:!0,withTransition:!1})},He.destroy=function(){He.data.targets=void 0,He.data.x={},_h.html(""),a.onresize=null},"url"in e.data)Ge.csv(e.data.url,function(a,b){je(b)});else if("rows"in e.data)je(gc(e.data.rows));else{if(!("columns"in e.data))throw Error("url or rows or columns is required.");je(hc(e.data.columns))}return He},"function"==typeof a.define&&a.define.amd?a.define(e):a.c3=e}(window);