!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}function e(a,b){function c(a,b){a.attr("transform",function(a){return"translate("+Math.round(b(a)+s)+", 0)"})}function d(a,b){a.attr("transform",function(a){return"translate(0,"+Math.round(b(a))+")"})}function e(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function f(a){var b,c,d=[];if(a.ticks)return a.ticks.apply(a,k);for(c=a.domain(),b=Math.ceil(c[0]);b0&&d[0]>0&&d.unshift(d[0]-(d[1]-d[0])),d}function g(){var a,c=m.copy();return b&&(a=m.domain(),c.domain([a[0],a[1]-1])),c}function h(a){var c=b&&a=0;return"url("+(c?"":document.URL.split("#")[0])+"#"+b+")"}function k(a){return Math.ceil(a)+.5}function l(a,b){var c,d,e;b&&b.axisX?c=b.axisX:(c=Fj.select("."+g.axisX),a&&(c=c.transition())),b&&b.axisY?d=b.axisY:(d=Fj.select("."+g.axisY),a&&(d=d.transition())),b&&b.axisY2?e=b.axisY2:(e=Fj.select("."+g.axisY2),a&&(e=e.transition())),Fj.attr("transform",pj.main),c.attr("transform",pj.x),d.attr("transform",pj.y),e.attr("transform",pj.y2),Fj.select("."+g.chartArcs).attr("transform",pj.arc)}function m(a,b){var c;b&&b.axisSubX?c=b.axisSubX:(c=Gj.select("."+g.axisX),a&&(c=c.transition())),Gj.attr("transform",pj.context),c.attr("transform",pj.subx)}function n(a){(a?Hj.transition():Hj).attr("transform",pj.legend)}function o(a,b){l(a,b),qh&&m(a,b),n(a)}function p(){var a=V(),b=U(),c=qj?0:a,d=me(Qf.data.targets),e=zh||d?0:A("x"),f=qh&&!d?rh+e:0;ng=t(),og=u(),zh?(gg={top:A("y2")+v(),right:d?0:y(),bottom:A("y")+c+w(),left:f+(d?0:x())},hg={top:gg.top,right:0/0,bottom:20+c,left:vj}):(gg={top:4+v(),right:d?0:y(),bottom:e+f+c+w(),left:d?0:x()},hg={top:og-f-c,right:0/0,bottom:e+c,left:gg.left}),ig={top:qj?0:og-a,right:0/0,bottom:0,left:qj?ng-b:0},jg=ng-gg.left-gg.right,lg=og-gg.top-gg.bottom,0>jg&&(jg=0),0>lg&&(lg=0),kg=zh?gg.left-vj-wj:jg,mg=zh?lg:og-hg.top-hg.bottom,0>kg&&(kg=0),0>mg&&(mg=0),sg=jg-(qj?b+10:0),tg=lg-(qj?0:10),r(),qj&&d&&(ig.left=sg/2+1.1*qg)}function q(){Fj.select("line."+g.xgridFocus).attr("x1",zh?0:-10).attr("x2",zh?jg:-10).attr("y1",zh?-10:gg.top).attr("y2",zh?-10:lg)}function r(){qg=Math.min(sg,tg)/2,pg=.95*qg,rg=le(Qf.data.targets)?.6*pg:0}function s(){var a=zh?g.axisX:g.axisY,b=Fj.select("."+a).node(),c=b?b.getBoundingClientRect():{right:0},d=Jj.node().getBoundingClientRect(),e=me(Qf.data.targets),f=c.right-d.left-(e?0:x());return f>0?f:0}function t(){return Tf?Tf:C()}function u(){var a=Uf?Uf:D();return a>0?a:320}function v(){return Xf?Xf:0}function w(){return Yf?Yf:0}function x(){return Vf?Vf:zh?Ah?Math.max(Le(z("x")),40):1:!Sh||Xh?1:Le(z("y"))}function y(){var a=10,b=qj?U()+20:0;return Wf?Wf:zh?a+b:(!_h||ei?a:Le(z("y2")))+b}function z(a){var b=pb(a);return b.isInner?20+Ib(a):40+Ib(a)}function A(a){return"x"!==a||Ah?"x"===a&&Ph?Ph:"y"!==a||Sh?"y2"!==a||_h?(pb(a).isInner?30:40)+("y2"===a?-10:0):xj:th&&!qj?10:1:0}function B(a){for(var b,c=Jj.node();c&&"BODY"!==c.tagName&&!(b=c.getBoundingClientRect()[a]);)c=c.parentNode;return b}function C(){return B("width")}function D(){var a=Jj.style("height");return a.indexOf("px")>0?+a.replace("px",""):0}function E(a){return a?-31:-(gg.left-1)}function F(a){return a?-20:-4}function G(){return E(!zh)}function H(){return F(!zh)}function I(){return E(zh)}function J(){return F(zh)}function K(a){return a?jg+2+30+30:gg.left+20}function L(a){return a?(Ph?Ph:0)+80:lg+8}function M(){return K(!zh)}function N(){return L(!zh)}function O(){return K(zh)}function P(){return L(zh)}function Q(){var a,b,c,d,e,f,g=Fc(Qf.data.targets);return g?(a=g.values[0],b=g.values[g.values.length-1],c=Gg(b.x)-Gg(a.x),0===c?zh?lg:jg:(d=Ec(),e=ie(Qf.data.targets)?(d-(Zi?.25:1))/d:1,f=d>1?c*e/(d-1):c,1>f?1:f)):0}function R(a){rj=a}function S(a){sj=a}function T(a){tj=a}function U(){return th?qj?sj*(rj+1):ng:0}function V(){return th?qj?og:tj*(rj+1):0}function W(){var a,b,c=!Gg;yg=zh?1:0,zg=zh?lg:jg,Ag=zh?0:lg,Bg=zh?jg:1,Cg=yg,Dg=zg,Eg=zh?0:mg,Fg=zh?kg:1,Gg=Z(yg,zg,c?void 0:Gg.domain(),function(){return Mg.tickOffset()}),Hg=$(Ag,Bg,c?void 0:Hg.domain()),Ig=$(Ag,Bg,c?void 0:Ig.domain()),Jg=Z(yg,zg,Kj,function(a){return a%1?0:Pg.tickOffset()}),Kg=$(Eg,Fg,c?void 0:Kg.domain()),Lg=$(Eg,Fg,c?void 0:Lg.domain()),a=eb(),b=Kh?Kh:c?void 0:Mg.tickValues(),Mg=bb(Gg,lj,a,b),Pg=bb(Jg,oj,a,b),Ng=cb(Hg,mj,Yh,$h),Og=cb(Ig,nj,fi,hi),c||(yj.scale(Jg),Zf&&Cj.scale(Gg)),X()}function X(){ug=Lb(),vg=Mb(),wg=Mb(.98)}function Y(a,b,c){return(c?Pf.time.scale():Pf.scale.linear()).range([a,b])}function Z(a,b,c,d){var e,f=Y(a,b,Yi),g=c?f.domain(c):f;Zi?(d=d||function(){return 0},f=function(a,b){var c=g(a)+d(a);return b?c:Math.ceil(c)}):f=function(a,b){var c=g(a);return b?c:Math.ceil(c)};for(e in g)f[e]=g[e];return f.orgDomain=function(){var a=g.domain();return Kj&&Kj[0]===a[0]&&Kj[1]a?a.toFixed(0):a};return Fh&&("function"==typeof Fh?a=Fh:Yi&&(a=function(a){return a?gj(Fh)(a):""})),a}function fb(a){var b;return"y"===a?b=Wh:"y2"===a?b=di:"x"===a&&(b=Rh),b}function gb(a){var b=fb(a);return"string"==typeof b?b:b?b.text:null}function hb(a,b){var c=fb(a);"string"==typeof c?"y"===a?Wh=b:"y2"===a?di=b:"x"===a&&(Rh=b):c&&(c.text=b)}function ib(a){return 10*Math.sin(Math.PI*(a/180))}function jb(a){return 11.5-2.5*(a/15)}function kb(a,b,c){a.selectAll(".tick text").style("text-anchor","start"),b.selectAll(".tick text").attr("y",jb(c)).attr("x",ib(c)).attr("transform","rotate("+c+")")}function lb(a,b){var c=fb(a),d=c&&"object"==typeof c&&c.position?c.position:b;return{isInner:d.indexOf("inner")>=0,isOuter:d.indexOf("outer")>=0,isLeft:d.indexOf("left")>=0,isCenter:d.indexOf("center")>=0,isRight:d.indexOf("right")>=0,isTop:d.indexOf("top")>=0,isMiddle:d.indexOf("middle")>=0,isBottom:d.indexOf("bottom")>=0}}function mb(){return lb("x",zh?"inner-top":"inner-right")}function nb(){return lb("y",zh?"inner-right":"inner-top")}function ob(){return lb("y2",zh?"inner-right":"inner-top")}function pb(a){return"y2"===a?ob():"y"===a?nb():mb()}function qb(){return gb("x")}function rb(){return gb("y")}function sb(){return gb("y2")}function tb(a,b){return a?b.isLeft?0:b.isCenter?jg/2:jg:b.isBottom?-lg:b.isMiddle?-lg/2:0}function ub(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"}function vb(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"}function wb(){return tb(!zh,mb())}function xb(){return tb(zh,nb())}function yb(){return tb(zh,ob())}function zb(){return ub(!zh,mb())}function Ab(){return ub(zh,nb())}function Bb(){return ub(zh,ob())}function Cb(){var a=mb();return zh?a.isInner?"1.2em":-25-Ib("x"):a.isInner?"-0.5em":Ph?Ph-10:"3em"}function Db(){var a=nb();return zh?a.isInner?"-0.5em":"3em":a.isInner?"1.2em":-20-Ib("y")}function Eb(){var a=ob();return zh?a.isInner?"1.2em":"-2.2em":a.isInner?"-0.5em":30+Ib("y2")}function Fb(){return vb(!zh,mb())}function Gb(){return vb(zh,nb())}function Hb(){return vb(zh,ob())}function Ib(a){var b=0,c="x"===a?g.axisX:"y"===a?g.axisY:g.axisY2;return Pf.selectAll("."+c+" .tick text").each(function(){var a=this.getBoundingClientRect();bb?0:b}function Jb(a){var b=Fj.select("."+g.axisX+" ."+g.axisXLabel),c=Fj.select("."+g.axisY+" ."+g.axisYLabel),d=Fj.select("."+g.axisY2+" ."+g.axisY2Label);(a?b.transition():b).attr("x",wb).attr("dx",zb).attr("dy",Cb).text(qb),(a?c.transition():c).attr("x",xb).attr("dx",Ab).attr("dy",Db).attr("dy",Db).text(rb),(a?d.transition():d).attr("x",yb).attr("dx",Bb).attr("dy",Eb).text(sb)}function Kb(a){var b=!1;return xg(Mc(Qf.data.targets)).forEach(function(c){b||c.data.id!==a.data.id||(b=!0,a=c)}),b?a:null}function Lb(){var a=Pf.svg.arc().outerRadius(pg).innerRadius(rg),b=function(b,c){var d;return c?a(b):(d=Kb(b),d?a(d):"M 0 0")};return b.centroid=a.centroid,b}function Mb(a){var b=Pf.svg.arc().outerRadius(qg*(a?a:1)).innerRadius(rg);return function(a){var c=Kb(a);return c?b(c):"M 0 0"}}function Nb(a,b){return te(a.data)?ug(a,b):"M 0 0"}function Ob(a){var b,c,d,e,f,g=Kb(a),h="";return g&&(b=ug.centroid(g),c=b[0],d=b[1],e=Math.sqrt(c*c+d*d),f=(36/pg>.375?1.175-36/pg:.8)*pg/e,h="translate("+c*f+","+d*f+")"),h}function Pb(a){return a?(a.endAngle-a.startAngle)/(2*Math.PI):null}function Qb(a){return uc({id:a.data.id,value:a.value,ratio:Pb(a)})}function Rb(a){var b,c,d,e;return Ub()?(b=Kb(a),c=b?b.value:null,d=Pb(b),e=Vb(),e?e(c,d):Hd(c,d)):""}function Sb(a,b){var c=Dj.selectAll("."+g.chartArc+td(a)),d=Dj.selectAll("."+g.arc).filter(function(b){return b.data.id!==a});ze(a)&&c.selectAll("path").transition().duration(50).attr("d",vg).transition().duration(100).attr("d",wg).each(function(a){se(a.data)}),b||d.style("opacity",.3)}function Tb(a){var b=Dj.selectAll("."+g.chartArc+td(a));b.selectAll("path").transition().duration(50).attr("d",ug),Dj.selectAll("."+g.arc).style("opacity",1)}function Ub(){return le(Qf.data.targets)?Di:xi}function Vb(){return le(Qf.data.targets)?Ei:yi}function Wb(){return le(Qf.data.targets)?Gi:""}function Xb(){var a=le(Qf.data.targets)?Hi:Ai;return"function"==typeof a?a:function(){}}function Yb(){var a=le(Qf.data.targets)?Ii:Bi;return"function"==typeof a?a:function(){}}function Zb(){var a=le(Qf.data.targets)?Ji:Ci;return"function"==typeof a?a:function(){}}function $b(a){var b,c,d,e,f,g,h=Hc(a),i=Tc(a);if(Wg.length>0)for(g=Vc(a),b=0;b=0}),0!==e.length)for(d=e[0],g&&i[d]&&i[d].forEach(function(a,b){i[d][b]=0>a?a:0}),c=1;c0||(i[d][b]+=+a)});return Pf.min(Object.keys(i).map(function(a){return Pf.min(i[a])}))}function _b(a){var b,c,d,e,f,g,h=Hc(a),i=Tc(a);if(Wg.length>0)for(g=Wc(a),b=0;b=0}),0!==e.length)for(d=e[0],g&&i[d]&&i[d].forEach(function(a,b){i[d][b]=a>0?a:0}),c=1;c+a||(i[d][b]+=+a)});return Pf.max(Object.keys(i).map(function(a){return Pf.max(i[a])}))}function ac(a,c){var d,e,f,g,h,i,j,k,l=a.filter(function(a){return db(a.id)===c}),m="y2"===c?bi:Uh,n="y2"===c?ai:Th,o=b(m)?m:$b(l),p=b(n)?n:_b(l),q="y2"===c?ci:Vh,r=Bd()&&zh;return 0===l.length?"y2"===c?Ig.domain():Hg.domain():(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),r&&(i=Cd(o,p),j=fc(Hg.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]))),"y"===c&&Zh&&(f=b(Zh.top)?Zh.top:e,g=b(Zh.bottom)?Zh.bottom:e),"y2"===c&&gi&&(f=b(gi.top)?gi.top:e,g=b(gi.bottom)?gi.bottom:e),ie(l)&&!Vc(l)&&(g=o),[o-g,p+f])}function bc(a){return Nh?Yi?Be(Nh):Nh:Pf.min(a,function(a){return Pf.min(a.values,function(a){return a.x})})}function cc(a){return Mh?Yi?Be(Mh):Mh:Pf.max(a,function(a){return Pf.max(a.values,function(a){return a.x})})}function dc(a){var c,d,e,f,g=Gc(a),h=g[1]-g[0];return Zi?d=0:ie(a)?(c=Ec(),d=c>1?h/(c-1)/2:.5):d=.01*h,"object"==typeof Oh&&Ge(Oh)?(e=b(Oh.left)?Oh.left:d,f=b(Oh.right)?Oh.right:d):e=f="number"==typeof Oh?Oh:d,{left:e,right:f}}function ec(a){var b=[bc(a),cc(a)],c=b[0],d=b[1],e=dc(a),f=0,g=0;return c-d!==0||Zi||(c=Yi?new Date(.5*c.getTime()):-.5,d=Yi?new Date(1.5*d.getTime()):.5),(c||0===c)&&(f=Yi?new Date(c.getTime()-e.left):c-e.left),(d||0===d)&&(g=Yi?new Date(d.getTime()+e.right):d+e.right),[f,g]}function fc(a){return a[1]-a[0]}function gc(a){for(var b=0;bb?0:b-c}function mc(a){var b,c=kc(a),d="y"===a.axis?Hg:Ig;return b="y"===a.axis||"y2"===a.axis?zh?lg:"start"in a?d(a.start):lg:zh?"end"in a?Gg(Yi?Be(a.end):a.end):lg:lg,c>b?0:b-c}function nc(a){return Qg&&a===Qg||Ge(Rg)&&He(Rg,a)}function oc(a){return!nc(a)}function pc(a){return Qg?Qg:Ge(Rg)?Rg[a]:null}function qc(a,b){var c,d=b&&Ge(b)?Hc(b):[];return d.forEach(function(b){pc(b)===a&&(c=Qf.data.xs[b])}),c}function rc(a,b){return a in Qf.data.xs&&Qf.data.xs[a]&&Qf.data.xs[a][b]?Qf.data.xs[a][b]:b}function sc(a){Object.keys(a).forEach(function(b){Rg[b]=a[b]})}function tc(a){return 1===Pf.set(Object.keys(a).map(function(b){return a[b]})).size()}function uc(a){var b;return a&&(b=Ug[a.id],a.name=b?b:a.id),a}function vc(a,b){a.forEach(function(a){a.values.forEach(function(c,d){c.x=xc(b[d],a.id,d)}),Qf.data.xs[a.id]=b})}function wc(a,b){a.forEach(function(a){b[a.id]&&vc([a],b[a.id])})}function xc(a,c,d){var e;return e=Yi?a?a instanceof Date?a:Be(a):Be(rc(c,d)):$i&&!Zi?b(a)?+a:rc(c,d):d}function yc(a){var b,c,d=a[0],e={},f=[];for(b=1;b=0?Qf.data.xs[c]=a.map(function(a){return a[f]}).filter(b).map(function(a,b){return xc(a,c,b)}):Qg?(d=Object.keys(Qf.data.xs),Qf.data.xs[c]=d.length>0?Qf.data.xs[d[0]]:void 0):Ge(Rg)&&(Qf.data.xs[c]=qc(f,Qf.data.targets)):Qf.data.xs[c]=a.map(function(a,b){return b})}),d.forEach(function(a){if(!Qf.data.xs[a])throw new Error('x is not defined for id = "'+a+'".')}),c=d.map(function(b,c){var d=Tg(b);return{id:d,id_org:b,values:a.map(function(a,e){var f=pc(b),g=a[f],h=xc(g,b,e);return $i&&Zi&&0===c&&g&&(0===e&&(Dh=[]),Dh.push(g)),("undefined"==typeof a[b]||Qf.data.xs[b].length<=e)&&(h=void 0),{x:h,value:null===a[b]||isNaN(a[b])?null:+a[b],id:d}}).filter(function(a){return"undefined"!=typeof a.x})}}),c.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++})}),Yg&&ge(Hc(c).filter(function(a){return!(a in Zg)}),Yg),c.forEach(function(a){hc(a.id_org,a)}),c}function Bc(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 Cc(a){return a>0&&Qf.data.targets[0].values[a-1]?Qf.data.targets[0].values[a-1].x:void 0}function Dc(a){return a1?a.forEach(function(a){a.values.length>d&&(b=a,d=a.values.length)}):b=c?a[0]:null,b}function Gc(a){var b,c,d=Fc(a);return d?(b=d.values[0],c=d.values[d.values.length-1],[b.x,c.x]):[0,0]}function Hc(a){return a.map(function(a){return a.id})}function Ic(a){return a?"string"==typeof a?[a]:a:Hc(Qf.data.targets)}function Jc(a,b){var c,d=Hc(a);for(c=0;c2){for(f=c-2,d=a[0],e=a[a.length-1],g=(e-d)/(f+1),j=[d],h=0;f>h;h++)i=+d+g*(h+1),j.push(Yi?new Date(i):i);j.push(e)}return Yi||(j=j.sort(function(a,b){return a-b})),j}function Pc(a){ij=ij.concat(a)}function Qc(a){ij=ij.filter(function(b){return a.indexOf(b)<0})}function Rc(a){jj=jj.concat(a)}function Sc(a){jj=jj.filter(function(b){return a.indexOf(b)<0})}function Tc(a){var b={};return a.forEach(function(a){b[a.id]=[],a.values.forEach(function(c){b[a.id].push(c.value)})}),b}function Uc(a,b){var c,d,e,f=Object.keys(a);for(c=0;ca})}function Wc(a){return Uc(a,function(a){return a>0})}function Xc(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||0===a[f].x)&&(e=e.concat(Nd(a,f))),(a[g].x||0===a[g].x)&&(e=e.concat(Nd(a,g))),Qd(e,b)):Od(a,b,f,g)}function Pd(a,b){var c;return c=a.map(function(a){return Od(a.values,b)}),Qd(c,b)}function Qd(a,b){var c,d;return a.forEach(function(a){var e=Ie(a,b);(c>e||!c)&&(c=e,d=a)}),d}function Rd(a,b){return Pf.merge(a.map(function(a){return a.values})).filter(function(a){return a.x-b===0})}function Sd(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 Td(){return _g&&"desc"===_g.toLowerCase()}function Ud(){return _g&&"asc"===_g.toLowerCase()}function Vd(a){var b=Ud(),c=Td();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 _g&&a.sort(_g),a}function Wd(a,c){var d,e,f,g,h,i,j,k=me(Qf.data.targets),l=a.filter(function(a){return a&&b(a.value)});0!==l.length&&Li&&(Ij.html(Oi(a,eb(),Dd(k),fj)).style("display","block"),d=Ij.property("offsetWidth"),e=Ij.property("offsetHeight"),k?(g=jg/2+c[0],i=lg/2+c[1]+20):(zh?(f=s(),g=f+c[0]+100,h=g+d,j=t()-y(),i=Gg(l[0].x)+20):(f=s(),g=f+x()+Gg(l[0].x)+20,h=g+d,j=f+t()-y(),i=c[1]+15),h>j&&(g-=h-j),i+e>u()&&(i-=e+30)),Ij.style("top",i+"px").style("left",g+"px"))}function Xd(){Ij.style("display","none")}function Yd(a){var c=a.filter(function(a){return a&&b(a.value)});if(Li&&!je(Qf.data.targets)&&!me(Qf.data.targets)){var d=Fj.selectAll("line."+g.xgridFocus);d.style("visibility","visible").data([c[0]]).attr(zh?"y1":"x1",Jd).attr(zh?"y2":"x2",Jd),sf(d,"grid")}}function Zd(){Fj.select("line."+g.xgridFocus).style("visibility","hidden")}function $d(a,b){var c,d,e,f,h=[],i=Fj.select("."+g.axisX).selectAll(".tick").size();if("year"===a)for(c=ec(),d=c[0].getFullYear(),e=c[1].getFullYear(),f=d;e>=f;f++)h.push(new Date(f+"-01-01 00:00:00"));else h=b.ticks(10);return h.slice(0,i)}function _d(a){return a.x||0===a.x?Gg(a.x):null}function ae(a){return _(a.id)(a.value)}function be(){var a,b,d={},e=0;return Mc(Qf.data.targets.filter(pe)).forEach(function(f){for(a=0;a0&&(i+=g(b.values[f].value)-h)}),i}}function fe(a,b){return"number"==typeof vi?vi:b?2*a.tickOffset()*wi/b:0}function ge(a,b){Ic(a).forEach(function(a){Mj[a]=b===Zg[a],Zg[a]=b})}function he(a,b){var c=!1;return a.forEach(function(a){Zg[a.id]===b&&(c=!0),a.id in Zg||"line"!==b||(c=!0)}),c}function ie(a){return he(a,"bar")}function je(a){return he(a,"scatter")}function ke(a){return"pie"===Yg||he(a,"pie")}function le(a){return"donut"===Yg||he(a,"donut")}function me(a){return ke(a)||le(a)}function ne(a){var b="string"==typeof a?a:a.id;return!(b in Zg)||"line"===Zg[b]||"spline"===Zg[b]||"area"===Zg[b]||"area-spline"===Zg[b]}function oe(a){var b="string"==typeof a?a:a.id;return"spline"===Zg[b]||"area-spline"===Zg[b]}function pe(a){var b="string"==typeof a?a:a.id;return"bar"===Zg[b]}function qe(a){var b="string"==typeof a?a:a.id;return"scatter"===Zg[b]}function re(a){var b="string"==typeof a?a:a.id;return"pie"===Zg[b]}function se(a){var b="string"==typeof a?a:a.id;return"donut"===Zg[b]}function te(a){return re(a)||se(a)}function ue(a){return ne(a)?[a]:[]}function ve(a){return te(a.data)?[a]:[]}function we(a){return pe(a)?a.values:[]}function xe(a){return ne(a)||qe(a)?a.values:[]}function ye(a){return pe(a)||ne(a)?a.values:[]}function ze(a){return se(a)&&Fi||re(a)&&zi}function Ae(a,b,c){var d=[];return function(e){var f,g=e.id||e;return a[g]instanceof Function?f=a[g](e):a[g]?f=a[g]:(d.indexOf(g)<0&&d.push(g),f=b[d.indexOf(g)%b.length]),c instanceof Function?c(f,e):f}}function Be(b){var c;try{c=Sg?Pf.time.format(Sg).parse(b):new Date(b)}catch(d){a.console.error("Failed to parse x '"+b+"' to Date with format "+Sg)}return c}function Ce(a,b){var c=Pf.mouse(a),d=Pf.select(a),e=1*d.attr("cx"),f=1*d.attr("cy");return Math.sqrt(Math.pow(e-c[0],2)+Math.pow(f-c[1],2))0}function He(a,b){var c=!1;return Object.keys(a).forEach(function(d){a[d]===b&&(c=!0)}),c}function Ie(a,b){var c="y"===db(a.id)?Hg:Ig,d=zh?1:0,e=zh?0:1;return Math.pow(Gg(a.x)-b[d],2)+Math.pow(c(a.value)-b[e],2)}function Je(a,b){var c=0;a.each(function(){++c}).each("end",function(){--c||b.apply(this,arguments)})}function Ke(a,b,c){return d(a[b])?a[b]:c}function Le(a){return 10*Math.ceil(a/10)}function Me(a,b,c){mh(b,a.node()),Fj.select("."+g.selectedCircles+sd(b.id)).selectAll("."+g.selectedCircle+"-"+c).data([b]).enter().append("circle").attr("class",function(){return Yc(g.selectedCircle,c)}).attr("cx",zh?ae:_d).attr("cy",zh?_d:ae).attr("stroke",function(){return fj(b)}).attr("r",1.4*Xe(b)).transition().duration(100).attr("r",Xe)}function Ne(a,b,c){nh(b,a.node()),Fj.select("."+g.selectedCircles+sd(b.id)).selectAll("."+g.selectedCircle+"-"+c).transition().duration(100).attr("r",0).remove()}function Oe(a,b,c,d){a?Me(b,c,d):Ne(b,c,d)}function Pe(a,b){mh(b,a.node()),a.transition().duration(100).style("fill",function(){return Pf.rgb(fj(b)).brighter(.75)})}function Qe(a,b){nh(b,a.node()),a.transition().duration(100).style("fill",function(){return fj(b)})}function Re(a,b,c,d){a?Pe(b,c,d):Qe(b,c,d)}function Se(a,b,c,d){Re(a,b,c.data,d)}function Te(a){return"circle"===a.nodeName?Oe:Pf.select(a).classed(g.bar)?Re:Se}function Ue(a){return a.filter(function(a){return b(a.value)})}function Ve(a){return oi?"function"==typeof pi?pi(a):pi:0}function We(a){return ri?si?si:1.75*Ve(a):Ve(a)}function Xe(a){return ti?ti:4*Ve(a)}function Ye(a,c){return(c?Fj.selectAll("."+g.circles+sd(c)):Fj).selectAll("."+g.circle+(b(a)?"-"+a:""))}function Ze(a,b){Ye(a,b).classed(g.EXPANDED,!0).attr("r",We)}function $e(a){Ye(a).filter(function(){return Pf.select(this).classed(g.EXPANDED)}).classed(g.EXPANDED,!1).attr("r",Ve)}function _e(a){return Fj.selectAll("."+g.bar+(b(a)?"-"+a:""))}function af(a){_e(a).classed(g.EXPANDED,!0)}function bf(a){_e(a).classed(g.EXPANDED,!1)}function cf(a,b,c){var d=function(a){return c(a.id)(a.value)},e=Pf.svg.line().x(zh?d:b).y(zh?b:d);return ui||(e=e.defined(function(a){return null!=a.value})),function(b){var d=ui?Ue(b.values):b.values,f=c(b.id),g=0,h=0;return ne(b)?ah[b.id]?jf(d,a,f,ah[b.id]):(e.interpolate(oe(b)?"cardinal":"linear"),e(d)):(d[0]&&(g=a(d[0].x),h=f(d[0].value)),zh?"M "+h+" "+g:"M "+g+" "+h)}}function df(a,b){var c=hf(a,b);return function(a,b){var d=c(a,b),e=zh?1:0,f=zh?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 ef(a,b){var c=hf(a,!1),d=b?ff:gf;return function(a,b){return d(c(a,b),a,this)}}function ff(a,b){var c;return zh?(c=pe(b)?4:6,a[2][1]+c*(b.value<0?-1:1)):a[0][0]+(a[2][0]-a[0][0])/2 }function gf(a,b,c){var d=c.getBoundingClientRect();return zh?(a[0][0]+a[2][0]+.6*d.height)/2:a[2][1]+(b.value<0?d.height:pe(b)?-3:-6)}function hf(a,b){var c=a.__max__+1,d=fe(Mg,c),e=ce(d,c,a,!!b),f=de(!!b),g=ee(a,!!b),h=b?ab:_;return function(a,b){var c=h(a.id)(0),i=g(a,b)||c,j=e(a),k=f(a);return zh&&(0k||a.value<0&&k>c)&&(k=c),[[j,i],[j,k-(c-i)],[j+d,k-(c-i)],[j+d,i]]}}function jf(a,b,e,f){var g,h,i,j,k,l,m,n,o,p,q,r,s=-1,t="M",u=[];if(d(f))for(g=0;g=h;h+=p)t+=i(a[g-1],a[g],h,o);s=a[g].x}return t}function kf(b){var c=new MutationObserver(function(d){d.forEach(function(d){if("childList"===d.type&&d.previousSibling){c.disconnect();var e=a.setInterval(function(){b.node().parentNode&&(a.clearInterval(e),tf({withUpdateTranslate:!0,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withLegend:!0}),b.transition().style("opacity",1))},10)}})});c.observe(b.node(),{attributes:!0,childList:!0,characterData:!0})}function lf(b){var c,d,e,f=!0;if(Jj=Pf.select(Sf),Jj.empty()&&(Jj=Pf.select(document.createElement("div")).style("opacity",0),kf(Jj),f=!1),Jj.html("").classed("c3",!0),Qf.data.xs={},Qf.data.targets=Ac(b),eh&&(Qf.data.targets=Qf.data.targets.filter(eh)),dh&&Pc(dh===!0?Hc(Qf.data.targets):dh),p(),W(),Gg.domain(Pf.extent(ec(Qf.data.targets))),Hg.domain(ac(Qf.data.targets,"y")),Ig.domain(ac(Qf.data.targets,"y2")),Jg.domain(Gg.domain()),Kg.domain(Hg.domain()),Lg.domain(Ig.domain()),Kj=Gg.domain(),yj.scale(Jg),Zf&&Cj.scale(Gg),Dj=Jj.append("svg").style("overflow","hidden").on("mouseenter",bg).on("mouseleave",cg),Ej=Dj.append("defs"),Ej.append("clipPath").attr("id",Si).append("rect"),Ej.append("clipPath").attr("id",Ti).append("rect"),Ej.append("clipPath").attr("id",Ui).append("rect"),xf(),Fj=Dj.append("g").attr("transform",pj.main),Gj=Dj.append("g").attr("transform",pj.context),Hj=Dj.append("g").attr("transform",pj.legend),qh||Gj.style("visibility","hidden"),th||(Hj.style("visibility","hidden"),jj=Hc(Qf.data.targets)),Ij=Jj.style("position","relative").append("div").style("position","absolute").style("pointer-events","none").style("z-index","10").style("display","none"),Kf(Hc(Qf.data.targets),{withTransform:!1,withTransitionForTransform:!1}),d=Fj.append("g").attr("clip-path",Vi).attr("class",g.grid),ii&&d.append("g").attr("class",g.xgrids),Ge(ki)&&d.append("g").attr("class",g.xgridLines),qi&&d.append("g").attr("class",g.xgridFocus).append("line").attr("class",g.xgridFocus),li&&d.append("g").attr("class",g.ygrids),Ge(mi)&&d.append("g").attr("class",g.ygridLines),Fj.append("g").attr("clip-path",Vi).attr("class",g.regions),Fj.append("g").attr("clip-path",Vi).attr("class",g.chart),c=Fj.select("."+g.chart).append("g").attr("class",g.eventRects).style("fill-opacity",0).style("cursor",Zf?zh?"ns-resize":"ew-resize":null),Fj.select("."+g.chart).append("g").attr("class",g.chartBars),Fj.select("."+g.chart).append("g").attr("class",g.chartLines),Fj.select("."+g.chart).append("g").attr("class",g.chartArcs).attr("transform",pj.arc).append("text").attr("class",g.chartArcsTitle).style("text-anchor","middle").text(Wb()),Fj.select("."+g.chart).append("g").attr("class",g.chartTexts),Zf&&Fj.insert("rect",_f?null:"g."+g.grid).attr("class",g.zoomRect).attr("width",jg).attr("height",lg).style("opacity",0).style("cursor",zh?"ns-resize":"ew-resize").call(Cj).on("dblclick.zoom",null),Qh&&yj.extent("function"!=typeof Qh?Qh:Qh(ec())),kj.x=Fj.append("g").attr("class",g.axisX).attr("clip-path",Wi).attr("transform",pj.x).style("visibility",Ah?"visible":"hidden"),kj.x.append("text").attr("class",g.axisXLabel).attr("transform",zh?"rotate(-90)":"").style("text-anchor",Fb),kj.y=Fj.append("g").attr("class",g.axisY).attr("clip-path",Xi).attr("transform",pj.y).style("visibility",Sh?"visible":"hidden"),kj.y.append("text").attr("class",g.axisYLabel).attr("transform",zh?"":"rotate(-90)").style("text-anchor",Gb),kj.y2=Fj.append("g").attr("class",g.axisY2).attr("transform",pj.y2).style("visibility",_h?"visible":"hidden"),kj.y2.append("text").attr("class",g.axisY2Label).attr("transform",zh?"":"rotate(-90)").style("text-anchor",Hb),Gj.append("g").attr("clip-path",Vi).attr("class",g.chart),Gj.select("."+g.chart).append("g").attr("class",g.chartBars),Gj.select("."+g.chart).append("g").attr("class",g.chartLines),Gj.append("g").attr("clip-path",Vi).attr("class",g.brush).call(yj).selectAll("rect").attr(zh?"width":"height",zh?kg:mg),kj.subx=Gj.append("g").attr("class",g.axisX).attr("transform",pj.subx).attr("clip-path",zh?"":Wi),Af(Qf.data.targets),f&&tf({withUpdateTranslate:!0,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1}),Pi){if(Yi&&"string"==typeof Qi){for(Qi=Be(Qi),e=0;ef&&h>c&&d>i&&j>d;else{if(!n.classed(g.bar))return;m=Sd(this),c=m.x,d=m.y,e=m.width,k=m.height,l=Re,q=!(c>h||f>c+e||d>j||i>d+k)}q^p&&(n.classed(g.INCLUDED,!p),n.classed(g.SELECTED,!o),l(!o,n,a,b))}))}function qf(a){me(Qf.data.targets)||fh&&(_i=a,Fj.select("."+g.chart).append("rect").attr("class",g.dragarea).style("opacity",.1),aj=!0,oh())}function rf(){me(Qf.data.targets)||fh&&(Fj.select("."+g.dragarea).transition().duration(100).style("opacity",0).remove(),Fj.selectAll("."+g.shape).classed(g.INCLUDED,!1),aj=!1,ph())}function sf(a,b){"grid"===b&&a.each(function(){var a=Pf.select(this),b=a.attr("x1"),c=a.attr("x2"),d=a.attr("y1"),e=a.attr("y2");a.attr({x1:Math.ceil(b),x2:Math.ceil(c),y1:Math.ceil(d),y2:Math.ceil(e)})})}function tf(a,c){var d,e,f,h,i,j,k,l,m,n,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,R,S,T,U,V,X,Y,Z,$=be(),_=me(Qf.data.targets),ab=Mc(Qf.data.targets);if(a=a||{},E=Ke(a,"withY",!0),F=Ke(a,"withSubchart",!0),G=Ke(a,"withTransition",!0),J=Ke(a,"withTransform",!1),K=Ke(a,"withUpdateXDomain",!1),L=Ke(a,"withUpdateOrgXDomain",!1),N=Ke(a,"withUpdateTranslate",!1),M=Ke(a,"withLegend",!1),H=Ke(a,"withTransitionForExit",G),I=Ke(a,"withTransitionForAxis",G),T=G?fg:0,U=H?T:0,V=I?T:0,c=c||yf(V),N&&(zh?(kj.x.call(Mg),kj.subx.call(Pg)):(kj.y.call(Ng),kj.y2.call(Og)),p(),W(),xf(),o(!1)),M&&th&&Kf(Hc(Qf.data.targets),a,c),Zi&&0===ab.length&&Gg.domain([0,kj.x.selectAll(".tick").size()]),ab.length&&(L&&(Gg.domain(Pf.extent(ec(ab))),Kj=Gg.domain(),Zf&&Cj.scale(Gg).updateScaleExtent(),Jg.domain(Gg.domain()),yj.scale(Jg)),K&&(Gg.domain(yj.empty()?Kj:yj.extent()),Zf&&Cj.scale(Gg).updateScaleExtent()),Kh||!Jh&&!Ih||(X=Oc(Nc(ab),Ih),Mg.tickValues(X),Pg.tickValues(X))),Hg.domain(ac(ab,"y")),Ig.domain(ac(ab,"y2")),kj.x.style("opacity",_?0:1),kj.y.style("opacity",_?0:1),kj.y2.style("opacity",_?0:1),kj.subx.style("opacity",_?0:1),c.axisX.call(Mg),c.axisY.call(Ng),c.axisY2.call(Og),c.axisSubX.call(Pg),Jb(G),K&&ab.length)if(Gh&&X){for(Y=1;Y=0&&Pf.select(this).style("display",b%Z?"none":"block")})}else Dj.selectAll("."+g.axisX+" .tick text").style("display","block");!zh&&Lh&&kb(kj.x,c.axisX,Lh),O=df($),R=ef($,!0),S=ef($,!1),Kg.domain(Hg.domain()),Lg.domain(Ig.domain()),Ij.style("display","none"),q(),Fj.select("line."+g.xgridFocus).style("visibility","hidden"),ii&&(f=$d(ji,Gg),B=Zi?Mg.tickOffset():0,e=zh?{x1:0,x2:jg,y1:function(a){return Gg(a)-B},y2:function(a){return Gg(a)-B}}:{x1:function(a){return Gg(a)+B},x2:function(a){return Gg(a)+B},y1:gg.top,y2:lg},d=Fj.select("."+g.xgrids).selectAll("."+g.xgrid).data(f),d.enter().append("line").attr("class",g.xgrid),d.attr(e).style("opacity",function(){return+Pf.select(this).attr(zh?"y1":"x1")===(zh?lg:0)?0:1}),d.exit().remove()),Ge(ki)&&(h=Fj.select("."+g.xgridLines).selectAll("."+g.xgridLine).data(ki),i=h.enter().append("g").attr("class",function(a){return g.xgridLine+(a.class?a.class:"")}),i.append("line").style("opacity",0),i.append("text").attr("text-anchor","end").attr("transform",zh?"":"rotate(-90)").attr("dx",zh?0:-gg.top).attr("dy",-5).style("opacity",0),h.select("line").transition().duration(T).attr("x1",zh?0:Kd).attr("x2",zh?jg:Kd).attr("y1",zh?Kd:gg.top).attr("y2",zh?Kd:lg).style("opacity",1),h.select("text").transition().duration(T).attr("x",zh?jg:0).attr("y",Kd).text(function(a){return a.text}).style("opacity",1),h.exit().transition().duration(T).style("opacity",0).remove()),E&&li&&(j=Fj.select("."+g.ygrids).selectAll("."+g.ygrid).data(Hg.ticks(ni)),j.enter().append("line").attr("class",g.ygrid),j.attr("x1",zh?Hg:0).attr("x2",zh?Hg:jg).attr("y1",zh?0:Hg).attr("y2",zh?lg:Hg),j.exit().remove(),sf(j,"grid")),E&&Ge(mi)&&(k=Fj.select("."+g.ygridLines).selectAll("."+g.ygridLine).data(mi),l=k.enter().append("g").attr("class",function(a){return g.ygridLine+(a.class?a.class:"")}),l.append("line").style("opacity",0),l.append("text").attr("text-anchor","end").attr("transform",zh?"rotate(-90)":"").attr("dx",zh?0:-gg.top).attr("dy",-5).style("opacity",0),k.select("line").transition().duration(T).attr("x1",zh?Ld:0).attr("x2",zh?Ld:jg).attr("y1",zh?0:Ld).attr("y2",zh?lg:Ld).style("opacity",1),k.select("text").transition().duration(T).attr("x",zh?0:jg).attr("y",Ld).text(function(a){return a.text}).style("opacity",1),k.exit().transition().duration(T).style("opacity",0).remove()),u=Fj.select("."+g.regions).selectAll("."+g.region).data(Ki),u.enter().append("g").attr("class",ld).append("rect").style("fill-opacity",0),u.selectAll("rect").transition().duration(T).attr("x",jc).attr("y",kc).attr("width",lc).attr("height",mc).style("fill-opacity",function(a){return b(a.opacity)?a.opacity:.1}),u.exit().transition().duration(T).style("opacity",0).remove(),s=Fj.selectAll("."+g.bars).selectAll("."+g.bar).data(we),s.enter().append("path").attr("class",fd).style("stroke","none").style("fill",fj),s.style("opacity",xd).transition().duration(T).attr("d",O).style("fill",fj).style("opacity",1),s.exit().transition().duration(U).style("opacity",0).remove(),m=Fj.selectAll("."+g.lines).selectAll("."+g.line).data(ue),m.enter().append("path").attr("class",bd).style("stroke",fj),m.style("opacity",xd).transition().duration(T).attr("d",zj).style("stroke",fj).style("opacity",1),m.exit().transition().duration(U).style("opacity",0).remove(),n=Fj.selectAll("."+g.areas).selectAll("."+g.area).data(ue),n.enter().append("path").attr("class",jd).style("fill",fj).style("opacity",function(){return Lj=+Pf.select(this).style("opacity"),0}),n.style("opacity",0).transition().duration(T).attr("d",Bj).style("fill",fj).style("opacity",Lj),n.exit().transition().duration(U).style("opacity",0).remove(),oi&&(r=Fj.selectAll("."+g.circles).selectAll("."+g.circle).data(xe),r.enter().append("circle").attr("class",dd).attr("r",Ve).style("fill",fj),r.style("opacity",xd).transition().duration(T).style("opacity",zd).style("fill",fj).attr("cx",zh?ae:_d).attr("cy",zh?_d:ae),r.exit().remove()),Bd()&&(v=Fj.selectAll("."+g.texts).selectAll("."+g.text).data(ye),v.enter().append("text").attr("class",Zc).attr("text-anchor",function(a){return zh?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill",fj).style("fill-opacity",0),v.text(function(a){return Id(a.id)(a.value,a.id)}).style("fill-opacity",yd).transition().duration(T).attr("x",R).attr("y",S).style("fill",fj).style("fill-opacity",Ad),v.exit().transition().duration(U).style("fill-opacity",0).remove()),t=Fj.selectAll("."+g.arcs).selectAll("."+g.arc).data(ve),t.enter().append("path").attr("class",hd).style("fill",function(a){return fj(a.data)}).style("cursor",function(a){return hh(a)?"pointer":null}).style("opacity",0).each(function(a){this._current=a}).on("mouseover",function(a,b){var c,d,e;dj||(c=Kb(a),d=Qb(c),e=Yb(),Sb(c.data.id),Gf(c.data.id,!0),e(d,b))}).on("mousemove",function(a){var b=Kb(a),c=Qb(b),d=[c];Wd(d,Pf.mouse(this))}).on("mouseout",function(a,b){var c,d,e;dj||(c=Kb(a),d=Qb(c),e=Zb(),Tb(c.data.id),Hf(),Xd(),e(d,b))}).on("click",function(a,b){var c=Kb(a),d=Qb(c),e=Xb();of(this,a,b),e(d,b)}),t.attr("transform",J?"scale(0)":"").style("opacity",function(a){return a===this._current?0:1}).each(function(){dj=!0}).transition().duration(T).attrTween("d",function(a){var b,c=Kb(a);return c?(b=Pf.interpolate(this._current,c),this._current=b(0),function(a){return Nb(b(a),!0)}):function(){return"M 0 0"}}).attr("transform",J?"scale(1)":"").style("fill",function(a){return fj(a.data)}).style("opacity",1).call(Je,function(){dj=!1}),t.exit().transition().duration(U).style("opacity",0).remove(),Fj.selectAll("."+g.chartArc).select("text").style("opacity",0).text(Rb).attr("transform",Ob).transition().duration(T).style("opacity",function(a){return Kc(a.data.id)&&te(a.data)?1:0}),Fj.select("."+g.chartArcsTitle).style("opacity",le(Qf.data.targets)?1:0),qh&&(Pf.event&&"zoom"===Pf.event.type&&yj.extent(Gg.orgDomain()).update(),F&&(!zh&&Lh&&kb(kj.subx,c.axisSubX,Lh),yj.empty()||yj.extent(Gg.orgDomain()).update(),P=df($,!0),x=Gj.selectAll("."+g.bars).selectAll("."+g.bar).data(we),x.enter().append("path").attr("class",fd).style("stroke","none").style("fill",fj),x.style("opacity",xd).transition().duration(T).attr("d",P).style("opacity",1),x.exit().transition().duration(T).style("opacity",0).remove(),w=Gj.selectAll("."+g.lines).selectAll("."+g.line).data(ue),w.enter().append("path").attr("class",bd).style("stroke",fj),w.style("opacity",xd).transition().duration(T).attr("d",Aj).style("opacity",1),w.exit().transition().duration(T).style("opacity",0).remove())),Fj.selectAll("."+g.selectedCircles).filter(function(a){return pe(a)}).selectAll("circle").remove(),Fj.selectAll("."+g.selectedCircle).transition().duration(T).attr("cx",zh?ae:_d).attr("cy",zh?_d:ae),ag&&(y=Fj.select("."+g.eventRects),Ge(Rg)&&!tc(Rg)?(y.classed(g.eventRectsMultiple)||y.classed(g.eventRectsMultiple,!0).classed(g.eventRectsSingle,!1).selectAll("."+g.eventRect).remove(),z=Fj.select("."+g.eventRects).selectAll("."+g.eventRect).data([0]),nf(z.enter()),z.attr("x",0).attr("y",0).attr("width",jg).attr("height",lg)):(y.classed(g.eventRectsSingle)||y.classed(g.eventRectsMultiple,!1).classed(g.eventRectsSingle,!0).selectAll("."+g.eventRect).remove(),!$i&&!Yi||Zi?(D=Q(),C=function(a){return Gg(a.x)-D/2}):(D=function(a,b){var c=Cc(b),d=Dc(b),e=Qf.data.xs[a.id][b];return(Gg(d?d:1.1*e)-Gg(c?c:.9*e))/2},C=function(a,b){var c=Cc(b),d=Qf.data.xs[a.id][b];return(Gg(d)+Gg(c?c:.9*d))/2}),A=Fc(Qf.data.targets),Fj.select("."+g.eventRects).datum(A?A.values:[]),z=Fj.select("."+g.eventRects).selectAll("."+g.eventRect).data(function(a){return a}),mf(z.enter()),z.attr("class",md).attr("x",zh?0:C).attr("y",zh?C:0).attr("width",zh?jg:D).attr("height",zh?D:lg),z.exit().remove())),Hc(Qf.data.targets).forEach(function(a){Mj[a]=!0})}function uf(){tf({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}function vf(){if(0!==Mc(Qf.data.targets).length){if("mousemove"===Pf.event.sourceEvent.type&&Cj.altDomain)return Gg.domain(Cj.altDomain),void Cj.scale(Gg).updateScaleExtent();Zi&&Gg.orgDomain()[0]===Kj[0]&&Gg.domain([Kj[0]-1e-10,Gg.orgDomain()[1]]),tf({withTransition:!1,withY:!1,withSubchart:!1}),"mousemove"===Pf.event.sourceEvent.type&&(bj=!0)}}function wf(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a}function xf(){Dj.attr("width",ng).attr("height",og),Dj.select("#"+Si).select("rect").attr("width",jg).attr("height",lg),Dj.select("#"+Ti).select("rect").attr("x",G).attr("y",H).attr("width",M).attr("height",N),Dj.select("#"+Ui).select("rect").attr("x",I).attr("y",J).attr("width",O).attr("height",P),Dj.select("."+g.zoomRect).attr("width",jg).attr("height",lg),Jj.style("max-height",og+"px")}function yf(a){return{axisX:a?kj.x.transition().duration(a):kj.x,axisY:a?kj.y.transition().duration(a):kj.y,axisY2:a?kj.y2.transition().duration(a):kj.y2,axisSubX:a?kj.subx.transition().duration(a):kj.subx}}function zf(a){var b;a=a||{},a.withTransition=Ke(a,"withTransition",!0),a.withTransform=Ke(a,"withTransform",!1),a.withLegend=Ke(a,"withLegend",!1),a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.withTransitionForExit=!1,a.withLegend&&th||(b=yf(a.withTransitionForAxis?fg:0),p(),W(),xf(),o(a.withTransition,b)),tf(a,b)}function Af(a){var b,c,d,e,f,h,i,j,k,l,m,n;i=Fj.select("."+g.chartTexts).selectAll("."+g.chartText).data(a).attr("class",od),j=i.enter().append("g").attr("class",od).style("opacity",0).style("pointer-events","none"),j.append("g").attr("class",$c),e=Fj.select("."+g.chartBars).selectAll("."+g.chartBar).data(a).attr("class",qd),d=e.enter().append("g").attr("class",qd).style("opacity",0).style("pointer-events","none"),d.append("g").attr("class",gd).style("cursor",function(a){return hh(a)?"pointer":null}),c=Fj.select("."+g.chartLines).selectAll("."+g.chartLine).data(a).attr("class",pd),b=c.enter().append("g").attr("class",pd).style("opacity",0).style("pointer-events","none"),b.append("g").attr("class",cd),b.append("g").attr("class",kd),b.append("g").attr("class",function(a){return Yc(g.selectedCircles,a.id)}),b.append("g").attr("class",ed).style("cursor",function(a){return hh(a)?"pointer":null}),a.forEach(function(a){Fj.selectAll("."+g.selectedCircles+sd(a.id)).selectAll("."+g.selectedCircle).each(function(b){b.value=a.values[b.index].value})}),h=Fj.select("."+g.chartArcs).selectAll("."+g.chartArc).data(xg(a)).attr("class",rd),f=h.enter().append("g").attr("class",rd),f.append("g").attr("class",id),f.append("text").attr("dy",".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none"),qh&&(n=Gj.select("."+g.chartBars).selectAll("."+g.chartBar).data(a).attr("class",qd),m=n.enter().append("g").style("opacity",0).attr("class",qd),m.append("g").attr("class",gd),l=Gj.select("."+g.chartLines).selectAll("."+g.chartLine).data(a).attr("class",pd),k=l.enter().append("g").style("opacity",0).attr("class",pd),k.append("g").attr("class",cd)),Dj.selectAll("."+g.target).filter(function(a){return Kc(a.id)}).transition().duration(fg).style("opacity",1)}function Bf(a,b){b.filter&&(a=a.filter(b.filter)),(b.type||b.types)&&a.forEach(function(a){b.types?ge(a.id,b.types[a.id]):ge(a.id,b.type)}),Qf.data.targets.forEach(function(b){for(var c=0;cf&&(f=(l-k)/2,z=0,F++)),E[a]=F,D[F]=f,A[a]=z,z+=k}var f,g,h=b.getBoundingClientRect(),i=10*Math.ceil((h.width+v)/10),j=10*Math.ceil((h.height+u)/10),k=qj?j:i,l=qj?V():U();return d&&(z=0,F=0,w=0,x=0),th&&!Lc(c)?void(B[c]=C[c]=E[c]=A[c]=0):(B[c]=i,C[c]=j,(!w||i>=w)&&(w=i),(!x||j>=x)&&(x=j),g=qj?x:w,void(yh?(Object.keys(B).forEach(function(a){B[a]=w}),Object.keys(C).forEach(function(a){C[a]=x}),f=(l-g*a.length)/2,y>f?(z=0,F=0,a.forEach(function(a){e(a)})):e(c,!0)):e(c)))}var f,h,i,j,k,l,m,n,q,r,s,t,u=4,v=26,w=0,x=0,y=10,z=0,A={},B={},C={},D=[0],E={},F=0,G=Hj.selectAll("."+g.legendItemFocused).size();b=b||{},n=Ke(b,"withTransition",!0),q=Ke(b,"withTransitionForTransform",!0),qj?(f=function(a){return w*E[a]},j=function(a){return D[E[a]]+A[a]}):(f=function(a){return D[E[a]]+A[a]},j=function(a){return x*E[a]}),h=function(a,b){return f(a,b)+14},k=function(a,b){return j(a,b)+9},i=function(a,b){return f(a,b)-4},l=function(a,b){return j(a,b)-7},m=Hj.selectAll("."+g.legendItem).data(a).enter().append("g").attr("class",function(a){return Yc(g.legendItem,a)}).style("visibility",function(a){return Lc(a)?"visible":"hidden"}).style("cursor","pointer").on("click",function(a){"function"==typeof vh?vh(a):Qf.toggle(a)}).on("mouseover",function(a){Pf.select(this).classed(g.legendItemFocused,!0),dj||Qf.focus(a),"function"==typeof wh&&wh(a)}).on("mouseout",function(a){Pf.select(this).classed(g.legendItemFocused,!1),dj||Qf.revert(),"function"==typeof xh&&xh(a)}),m.append("text").text(function(a){return d(Ug[a])?Ug[a]:a}).each(function(a,b){e(this,a,0===b)}).style("pointer-events","none").attr("x",qj?h:-200).attr("y",qj?-200:k),m.append("rect").attr("class",g.legendItemEvent).style("fill-opacity",0).attr("x",qj?i:-200).attr("y",qj?-200:l),m.append("rect").attr("class",g.legendItemTile).style("pointer-events","none").style("fill",fj).attr("x",qj?h:-200).attr("y",qj?-200:j).attr("width",10).attr("height",10),r=Hj.selectAll("text").data(a).text(function(a){return d(Ug[a])?Ug[a]:a}).each(function(a,b){e(this,a,0===b)}),(n?r.transition():r).attr("x",h).attr("y",k),s=Hj.selectAll("rect."+g.legendItemEvent).data(a),(n?s.transition():s).attr("width",function(a){return B[a]}).attr("height",function(a){return C[a]}).attr("x",i).attr("y",l),t=Hj.selectAll("rect."+g.legendItemTile).data(a),(n?t.transition():t).style("fill",fj).attr("x",f).attr("y",j),Hj.selectAll("."+g.legendItem).classed(g.legendItemHidden,function(a){return!Kc(a)}).transition().style("opacity",function(a){var b=Pf.select(this);return Kc(a)?!G||b.classed(g.legendItemFocused)?Ef(b):Ff(b):uj}),S(w),T(x),R(F),p(),W(),xf(),o(q,c)}function Lf(a){return Jc(Qf.data.targets,a.id)}function Mf(a){return"data"in a&&Jc(Qf.data.targets,a.data.id)}function Nf(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}}function Of(a,b,c){var d=!me(Qf.data.targets);dj=!1,ge(a,b),zf(c||{withTransitionForAxis:d})}var Pf=a.d3?a.d3:"undefined"!=typeof require?require("d3"):void 0,Qf={data:{},axis:{},legend:{}},Rf={},Sf=i(["bindto"],"#chart"),Tf=i(["size","width"]),Uf=i(["size","height"]),Vf=i(["padding","left"]),Wf=i(["padding","right"]),Xf=i(["padding","top"]),Yf=i(["padding","bottom"]),Zf=i(["zoom","enabled"],!1),$f=i(["zoom","extent"]),_f=i(["zoom","privileged"],!1),ag=i(["interaction","enabled"],!0),bg=i(["onenter"],function(){}),cg=i(["onleave"],function(){}),dg=i(["onresize"],function(){}),eg=i(["onresized"],function(){}),fg=i(["transition","duration"],350);h("data","data is required in config");var gg,hg,ig,jg,kg,lg,mg,ng,og,pg,qg,rg,sg,tg,ug,vg,wg,xg,yg,zg,Ag,Bg,Cg,Dg,Eg,Fg,Gg,Hg,Ig,Jg,Kg,Lg,Mg,Ng,Og,Pg,Qg=i(["data","x"]),Rg=i(["data","xs"],{}),Sg=i(["data","x_format"]),Tg=i(["data","id_converter"],function(a){return a}),Ug=i(["data","names"],{}),Vg=i(["data","classes"],{}),Wg=i(["data","groups"],[]),Xg=i(["data","axes"],{}),Yg=i(["data","type"]),Zg=i(["data","types"],{}),$g=i(["data","labels"],{}),_g=i(["data","order"]),ah=i(["data","regions"],{}),bh=i(["data","color"]),ch=i(["data","colors"],{}),dh=i(["data","hide"],!1),eh=i(["data","filter"]),fh=i(["data","selection","enabled"],!1),gh=i(["data","selection","grouped"],!1),hh=i(["data","selection","isselectable"],function(){return!0}),ih=i(["data","selection","multiple"],!0),jh=i(["data","onclick"],function(){}),kh=i(["data","onenter"],function(){}),lh=i(["data","onleave"],function(){}),mh=i(["data","onselected"],function(){}),nh=i(["data","onunselected"],function(){}),oh=i(["data","ondragstart"],function(){}),ph=i(["data","ondragend"],function(){}),qh=i(["subchart","show"],!1),rh=i(["subchart","size","height"],60),sh=i(["color","pattern"],[]),th=i(["legend","show"],!0),uh=i(["legend","position"],"bottom"),vh=i(["legend","item","onclick"]),wh=i(["legend","item","onmouseover"]),xh=i(["legend","item","onmouseout"]),yh=i(["legend","equally"],!1),zh=i(["axis","rotated"],!1),Ah=i(["axis","x","show"],!0),Bh=i(["axis","x","type"],"indexed"),Ch=i(["axis","x","localtime"],!0),Dh=i(["axis","x","categories"],[]),Eh=i(["axis","x","tick","centered"],!1),Fh=i(["axis","x","tick","format"]),Gh=i(["axis","x","tick","culling"],{}),Hh=i(["axis","x","tick","culling","max"],10),Ih=i(["axis","x","tick","count"]),Jh=i(["axis","x","tick","fit"],!0),Kh=i(["axis","x","tick","values"],null),Lh=i(["axis","x","tick","rotate"]),Mh=i(["axis","x","max"],null),Nh=i(["axis","x","min"],null),Oh=i(["axis","x","padding"],{}),Ph=i(["axis","x","height"]),Qh=i(["axis","x","default"]),Rh=i(["axis","x","label"],{}),Sh=i(["axis","y","show"],!0),Th=i(["axis","y","max"]),Uh=i(["axis","y","min"]),Vh=i(["axis","y","center"]),Wh=i(["axis","y","label"],{}),Xh=i(["axis","y","inner"],!1),Yh=i(["axis","y","tick","format"]),Zh=i(["axis","y","padding"]),$h=i(["axis","y","ticks"],10),_h=i(["axis","y2","show"],!1),ai=i(["axis","y2","max"]),bi=i(["axis","y2","min"]),ci=i(["axis","y2","center"]),di=i(["axis","y2","label"],{}),ei=i(["axis","y2","inner"],!1),fi=i(["axis","y2","tick","format"]),gi=i(["axis","y2","padding"]),hi=i(["axis","y2","ticks"],10),ii=i(["grid","x","show"],!1),ji=i(["grid","x","type"],"tick"),ki=i(["grid","x","lines"],[]),li=i(["grid","y","show"],!1),mi=i(["grid","y","lines"],[]),ni=i(["grid","y","ticks"],10),oi=i(["point","show"],!0),pi=i(["point","r"],2.5),qi=i(["point","focus","line","enabled"],!0),ri=i(["point","focus","expand","enabled"],!0),si=i(["point","focus","expand","r"]),ti=i(["point","focus","select","r"]),ui=i(["line","connect_null"],!1),vi=i(["bar","width"]),wi=i(["bar","width","ratio"],.6),xi=i(["pie","label","show"],!0),yi=i(["pie","label","format"]),zi=i(["pie","expand"],!0),Ai=i(["pie","onclick"],function(){}),Bi=i(["pie","onmouseover"],function(){}),Ci=i(["pie","onmouseout"],function(){}),Di=i(["donut","label","show"],!0),Ei=i(["donut","label","format"]),Fi=i(["donut","expand"],!0),Gi=i(["donut","title"],""),Hi=i(["donut","onclick"],function(){}),Ii=i(["donut","onmouseover"],function(){}),Ji=i(["donut","onmouseout"],function(){}),Ki=i(["regions"],[]),Li=i(["tooltip","show"],!0),Mi=i(["tooltip","format","title"]),Ni=i(["tooltip","format","value"]),Oi=i(["tooltip","contents"],function(a,b,c,d){var e,f,h,i,j,k=Mi?Mi:b,l=Ni?Ni:c;for(f=0;f"+(h||0===h?""+h+"":"")),j=a[f].name,i=l(a[f].value,a[f].ratio,a[f].id,a[f].index),e+="",e+=""+j+"",e+=""+i+"",e+="");return e+""}),Pi=i(["tooltip","init","show"],!1),Qi=i(["tooltip","init","x"],0),Ri=i(["tooltip","init","position"],{top:"0px",left:"50px"}),Si="c3-"+ +new Date+"-clip",Ti=Si+"-xaxis",Ui=Si+"-yaxis",Vi=j(Si),Wi=j(Ti),Xi=j(Ui),Yi="timeseries"===Bh,Zi="categorized"===Bh,$i=!Yi&&(Qg||Ge(Rg)),_i=null,aj=!1,bj=!1,cj=!1,dj=!1,ej=Pf.scale.category10().range(),fj=Ae(ch,Ge(sh)?sh:ej,bh),gj=Ch?Pf.time.format:Pf.time.format.utc,hj=gj.multi([[".%L",function(a){return a.getMilliseconds() }],[":%S",function(a){return a.getSeconds()}],["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%-m/%-d",function(a){return a.getDay()&&1!==a.getDate()}],["%-m/%-d",function(a){return 1!==a.getDate()}],["%-m/%-d",function(a){return a.getMonth()}],["%Y/%-m/%-d",function(){return!0}]]),ij=[],jj=[],kj={},lj=zh?"left":"bottom",mj=zh?Xh?"top":"bottom":Xh?"right":"left",nj=zh?ei?"bottom":"top":ei?"left":"right",oj=zh?"left":"bottom",pj={main:function(){return"translate("+k(gg.left)+","+k(gg.top)+")"},context:function(){return"translate("+k(hg.left)+","+k(hg.top)+")"},legend:function(){return"translate("+ig.left+","+ig.top+")"},x:function(){return"translate(0,"+(zh?0:lg)+")"},y:function(){return"translate(0,"+(zh?lg:0)+")"},y2:function(){return"translate("+(zh?0:jg)+","+(zh?1:0)+")"},subx:function(){return"translate(0,"+(zh?0:mg)+")"},arc:function(){return"translate("+sg/2+","+tg/2+")"}},qj="right"===uh,rj=0,sj=0,tj=0,uj=.15,vj=30,wj=zh&&!Ah?0:30,xj=5;xg=Pf.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)});var yj,zj=cf(Gg,Jd,_),Aj=cf(Jg,Md,ab),Bj=function(){var a;return a=zh?Pf.svg.area().x0(function(a){return _(a.id)(0)}).x1(function(a){return _(a.id)(a.value)}).y(Jd):Pf.svg.area().x(Jd).y0(function(a){return _(a.id)(0)}).y1(function(a){return _(a.id)(a.value)}),function(b){var c,d,e=Ue(b.values);return he([b],"area")||he([b],"area-spline")?(a.interpolate(oe(b)?"cardinal":"linear"),a(e)):(c=e[0]?Gg(e[0].x):0,d=e[0]?_(b.id)(e[0].value):0,zh?"M "+d+" "+c:"M "+c+" "+d)}}(),Cj=function(){};yj=Pf.svg.brush().on("brush",uf),yj.update=function(){return Gj&&Gj.select("."+g.brush).call(this),this},yj.scale=function(a){return zh?this.y(a):this.x(a)},Zf&&(Cj=Pf.behavior.zoom().on("zoomstart",function(){Cj.altDomain=Pf.event.sourceEvent.altKey?Gg.orgDomain():null}).on("zoom",Zf?vf:null),Cj.scale=function(a){return zh?this.y(a):this.x(a)},Cj.orgScaleExtent=function(){var a=$f?$f:[1,10];return[a[0],Math.max(Ec()/a[1],a[1])]},Cj.updateScaleExtent=function(){var a=fc(Gg.orgDomain())/fc(Kj),b=this.orgScaleExtent();return this.scaleExtent([b[0]*a,b[1]*a]),this});var Dj,Ej,Fj,Gj,Hj,Ij,Jj,Kj,Lj,Mj={};if(Qf.focus=function(a){function b(a){Mc(a).transition().duration(100).style("opacity",1)}var c=Dj.selectAll(td(a)),d=c.filter(Lf),e=c.filter(Mf);Qf.revert(),Qf.defocus(),b(d.classed(g.focused,!0)),b(e),me(Qf.data.targets)&&Sb(a,!0),Gf(a,!0)},Qf.defocus=function(a){function b(a){Mc(a).transition().duration(100).style("opacity",.3)}var c=Dj.selectAll(td(a)),d=c.filter(Lf),e=c.filter(Mf);Qf.revert(),b(d.classed(g.focused,!1)),b(e),me(Qf.data.targets)&&Tb(a),Gf(a,!1)},Qf.revert=function(a){function b(a){Mc(a).transition().duration(100).style("opacity",1)}var c=Dj.selectAll(td(a)),d=c.filter(Lf),e=c.filter(Mf);b(d.classed(g.focused,!1)),b(e),me(Qf.data.targets)&&Tb(a),Hf()},Qf.show=function(a,b){a=Ic(a),b=b||{},Qc(a),Dj.selectAll(ud(a)).transition().style("opacity",1),b.withLegend&&If(a),tf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},Qf.hide=function(a,b){a=Ic(a),b=b||{},Pc(a),Dj.selectAll(ud(a)).transition().style("opacity",0),b.withLegend&&Jf(a),tf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},Qf.toggle=function(a){Kc(a)?Qf.hide(a):Qf.show(a)},Qf.unzoom=function(){yj.clear().update(),tf({withUpdateXDomain:!0})},Qf.load=function(a){return a.xs&&sc(a.xs),"classes"in a&&Object.keys(a.classes).forEach(function(b){Vg[b]=a.classes[b]}),"categories"in a&&Zi&&(Dh=a.categories,Mg.categories(Dh)),"cacheIds"in a&&gc(a.cacheIds)?void Bf(ic(a.cacheIds),a.done):void("unload"in a?Df(Ic("boolean"==typeof a.unload&&a.unload?null:a.unload),function(){Cf(a)}):Cf(a))},Qf.unload=function(a,b){Df(Ic(a),function(){tf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),"function"==typeof b&&b()})},Qf.selected=function(a){return Pf.merge(Fj.selectAll("."+g.shapes+sd(a)).selectAll("."+g.shape).filter(function(){return Pf.select(this).classed(g.SELECTED)}).map(function(a){return a.map(function(a){var b=a.__data__;return b.data?b.data:b})}))},Qf.select=function(a,b,c){fh&&Fj.selectAll("."+g.shapes).selectAll("."+g.shape).each(function(e,f){var h=Pf.select(this),i=e.data?e.data.id:e.id,j=Te(this),k=gh||!a||a.indexOf(i)>=0,l=!b||b.indexOf(f)>=0,m=h.classed(g.SELECTED);h.classed(g.line)||h.classed(g.area)||(k&&l?hh(e)&&!m&&j(!0,h.classed(g.SELECTED,!0),e,f):d(c)&&c&&m&&j(!1,h.classed(g.SELECTED,!1),e,f))})},Qf.unselect=function(a,b){fh&&Fj.selectAll("."+g.shapes).selectAll("."+g.shape).each(function(c,d){var e=Pf.select(this),f=c.data?c.data.id:c.id,h=Te(this),i=gh||!a||a.indexOf(f)>=0,j=!b||b.indexOf(d)>=0,k=e.classed(g.SELECTED);e.classed(g.line)||e.classed(g.area)||i&&j&&hh(c)&&k&&h(!1,e.classed(g.SELECTED,!1),c,d)})},Qf.toLine=function(a){Of(a,"line")},Qf.toSpline=function(a){Of(a,"spline")},Qf.toBar=function(a){Of(a,"bar")},Qf.toScatter=function(a){Of(a,"scatter")},Qf.toArea=function(a){Of(a,"area")},Qf.toAreaSpline=function(a){Of(a,"area-spline")},Qf.toPie=function(a){Of(a,"pie",{withTransform:!0})},Qf.toDonut=function(a){Of(a,"donut",{withTransform:!0})},Qf.groups=function(a){return c(a)?Wg:(Wg=a,tf(),Wg)},Qf.xgrids=function(a){return a?(ki=a,tf(),ki):ki},Qf.xgrids.add=function(a){return a?Qf.xgrids(ki.concat(a)):void 0},Qf.xgrids.remove=function(a){var b=Nf(a);return Qf.xgrids(ki.filter(b))},Qf.ygrids=function(a){return a?(mi=a,tf(),mi):mi},Qf.ygrids.add=function(a){return a?Qf.ygrids(mi.concat(a)):void 0},Qf.ygrids.remove=function(a){var b=Nf(a);return Qf.ygrids(mi.filter(b))},Qf.regions=function(a){return a?(Ki=a,tf(),Ki):Ki},Qf.regions.add=function(a){return a?(Ki=Ki.concat(a),tf(),Ki):Ki},Qf.regions.remove=function(a){var b,c,d;return a=a||{},b=Ke(a,"duration",fg),c=Ke(a,"classes",[g.region]),d=Fj.select("."+g.regions).selectAll(c.map(function(a){return"."+a})),(b?d.transition().duration(b):d).style("opacity",0).remove(),Ki=Ki.filter(function(a){var b=!1;return a.class?(a.class.split(" ").forEach(function(a){c.indexOf(a)>=0&&(b=!0)}),!b):!0})},Qf.data.get=function(a){var b=Qf.data.getAsTarget(a);return d(b)?b.values.map(function(a){return a.value}):void 0},Qf.data.getAsTarget=function(a){var b=Qf.data.targets.filter(function(b){return b.id===a});return b.length>0?b[0]:void 0},Qf.data.names=function(a){return arguments.length?(Object.keys(a).forEach(function(b){Ug[b]=a[b]}),tf({withLegend:!0}),Ug):Ug},Qf.data.colors=function(a){return arguments.length?(Object.keys(a).forEach(function(b){ch[b]=a[b]}),tf({withLegend:!0}),ch):ch},Qf.x=function(a){return arguments.length&&(vc(Qf.data.targets,a),tf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),Qf.data.xs},Qf.xs=function(a){return arguments.length&&(wc(Qf.data.targets,a),tf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),Qf.data.xs},Qf.axis.labels=function(a){arguments.length&&(Object.keys(a).forEach(function(b){hb(b,a[b])}),Jb())},Qf.axis.max=function(a){arguments.length&&("object"==typeof a?(b(a.x)&&(Mh=+a.x),b(a.y)&&(Th=+a.y),b(a.y2)&&(ai=+a.y2)):Th=ai=+a,tf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))},Qf.axis.min=function(a){arguments.length&&("object"==typeof a?(b(a.x)&&(Nh=+a.x),b(a.y)&&(Uh=+a.y),b(a.y2)&&(bi=+a.y2)):Uh=bi=+a,tf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))},Qf.axis.range=function(a){arguments.length&&("undefined"!=typeof a.max&&Qf.axis.max(a.max),"undefined"!=typeof a.min&&Qf.axis.min(a.min))},Qf.legend.show=function(a){If(Ic(a)),tf({withLegend:!0})},Qf.legend.hide=function(a){Jf(Ic(a)),tf({withLegend:!0})},Qf.resize=function(a){Tf=a?a.width:null,Uf=a?a.height:null,zf({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},Qf.destroy=function(){Qf.data.targets=void 0,Qf.data.xs={},Jj.classed("c3",!1).html(""),a.onresize=null},"url"in f.data)Pf.xhr(f.data.url,function(a,b){var c,d=Pf.csv.parseRows(b.response);1===d.length?(c=[{}],d[0].forEach(function(a){c[0][a]=null})):c=Pf.csv.parse(b.response),lf(c)});else if("rows"in f.data)lf(yc(f.data.rows));else{if(!("columns"in f.data))throw Error("url or rows or columns is required.");lf(zc(f.data.columns))}return Qf.element=Jj.node(),Qf},"function"==typeof define&&define.amd?define("c3",["d3"],f):"undefined"!=typeof exports&&"undefined"!=typeof module?module.exports=f:a.c3=f}(window);