>>1;l[m]u-o){var g=(i*y+a*v)/r;e(t,d,v,i,o,g,u),e(d,n,y,g,o,a,u)}else{var b=(o*y+u*v)/r;e(t,d,v,i,o,a,b),e(d,n,y,i,b,a,u)}}(0,u,e.value,t,n,r,i)},gm=function(e,t,n,r,i){(1&e.depth?pm:Zh)(e,t,n,r,i)},bm=function e(t){function n(e,n,r,i,o){if((a=e._squarify)&&a.ratio===t)for(var a,s,u,l,c,f=-1,p=a.length,d=e.value;++f
1?t:1)},n}(dm),xm=function(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}},wm=function(e,t){var n=Sr(+e,+t);return function(e){var t=n(e);return t-360*Math.floor(t/360)}},Em=function(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}},_m=Math.SQRT2;function Sm(e){return((e=Math.exp(e))+1/e)/2}var Am=function(e,t){var n,r,i=e[0],o=e[1],a=e[2],s=t[0],u=t[1],l=t[2],c=s-i,f=u-o,p=c*c+f*f;if(p<1e-12)r=Math.log(l/a)/_m,n=function(e){return[i+e*c,o+e*f,a*Math.exp(_m*e*r)]};else{var d=Math.sqrt(p),h=(l*l-a*a+4*p)/(2*a*2*d),m=(l*l-a*a-4*p)/(2*l*2*d),v=Math.log(Math.sqrt(h*h+1)-h),y=Math.log(Math.sqrt(m*m+1)-m);r=(y-v)/_m,n=function(e){var t,n=e*r,s=Sm(v),u=a/(2*d)*(s*(t=_m*n+v,((t=Math.exp(2*t))-1)/(t+1))-function(e){return((e=Math.exp(e))-1/e)/2}(v));return[i+u*c,o+u*f,a*s/Sm(_m*n+v)]}}return n.duration=1e3*r,n};function km(e){return function(t,n){var r=e((t=vr(t)).h,(n=vr(n)).h),i=kr(t.s,n.s),o=kr(t.l,n.l),a=kr(t.opacity,n.opacity);return function(e){return t.h=r(e),t.s=i(e),t.l=o(e),t.opacity=a(e),t+""}}}var Cm=km(Sr),Tm=km(kr);function Dm(e,t){var n=kr((e=Ma(e)).l,(t=Ma(t)).l),r=kr(e.a,t.a),i=kr(e.b,t.b),o=kr(e.opacity,t.opacity);return function(t){return e.l=n(t),e.a=r(t),e.b=i(t),e.opacity=o(t),e+""}}function Mm(e){return function(t,n){var r=e((t=Ia(t)).h,(n=Ia(n)).h),i=kr(t.c,n.c),o=kr(t.l,n.l),a=kr(t.opacity,n.opacity);return function(e){return t.h=r(e),t.c=i(e),t.l=o(e),t.opacity=a(e),t+""}}}var Om=Mm(Sr),Pm=Mm(kr);function Lm(e){return function t(n){function r(t,r){var i=e((t=Ya(t)).h,(r=Ya(r)).h),o=kr(t.s,r.s),a=kr(t.l,r.l),s=kr(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=o(e),t.l=a(Math.pow(e,n)),t.opacity=s(e),t+""}}return n=+n,r.gamma=t,r}(1)}var Nm=Lm(Sr),Fm=Lm(kr);function Rm(e,t){for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n1&&(t=e[o[a-2]],n=e[o[a-1]],r=e[s],(n[0]-t[0])*(r[1]-t[1])-(n[1]-t[1])*(r[0]-t[0])<=0);)--a;o[a++]=s}return o.slice(0,a)}var Um=function(e){if((n=e.length)<3)return null;var t,n,r=new Array(n),i=new Array(n);for(t=0;t=0;--t)l.push(e[r[o[t]][2]]);for(t=+s;ts!=l>s&&a<(u-n)*(s-r)/(l-r)+n&&(c=!c),u=n,l=r;return c},Wm=function(e){for(var t,n,r=-1,i=e.length,o=e[i-1],a=o[0],s=o[1],u=0;++r1);return e+n*o*Math.sqrt(-2*Math.log(i)/i)}}return n.source=e,n}(Ym),Gm=function e(t){function n(){var e=Hm.source(t).apply(this,arguments);return function(){return Math.exp(e())}}return n.source=e,n}(Ym),Km=function e(t){function n(e){return function(){for(var n=0,r=0;rr&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function dv(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i2?hv:dv,i=o=null,f}function f(t){return isNaN(t=+t)?n:(i||(i=r(a.map(e),s,u)))(e(l(t)))}return f.invert=function(n){return l(t((o||(o=r(s,a.map(e),Rr)))(n)))},f.domain=function(e){return arguments.length?(a=tv.call(e,uv),l===cv||(l=pv(a)),c()):a.slice()},f.range=function(e){return arguments.length?(s=nv.call(e),c()):s.slice()},f.rangeRound=function(e){return s=nv.call(e),u=Em,c()},f.clamp=function(e){return arguments.length?(l=e?pv(a):cv,f):l!==cv},f.interpolate=function(e){return arguments.length?(u=e,c()):u},f.unknown=function(e){return arguments.length?(n=e,f):n},function(n,r){return e=n,t=r,c()}}function yv(e,t){return vv()(e,t)}var gv=function(e,t,n,r){var i,o=Ve(e,t,n);switch((r=ol(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=bl(o,a))||(r.precision=i),cl(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=xl(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=gl(o))||(r.precision=i-2*("%"===r.type))}return ll(r)};function bv(e){var t=e.domain;return e.ticks=function(e){var n=t();return ze(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return gv(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i=t(),o=0,a=i.length-1,s=i[o],u=i[a];return u0?r=Ue(s=Math.floor(s/r)*r,u=Math.ceil(u/r)*r,n):r<0&&(r=Ue(s=Math.ceil(s*r)/r,u=Math.floor(u*r)/r,n)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(u/r)*r,t(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(u*r)/r,t(i)),e},e}function xv(){var e=yv(cv,cv);return e.copy=function(){return mv(e,xv())},Zm.apply(e,arguments),bv(e)}function wv(e){var t;function n(e){return isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=tv.call(t,uv),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return wv(e).unknown(t)},e=arguments.length?tv.call(e,uv):[0,1],bv(n)}var Ev=function(e,t){var n,r=0,i=(e=e.slice()).length-1,o=e[r],a=e[i];return a0){for(;pu)break;m.push(f)}}else for(;p=1;--c)if(!((f=l*c)u)break;m.push(f)}}else m=ze(p,d,Math.min(d-p,h)).map(n);return r?m.reverse():m},r.tickFormat=function(e,i){if(null==i&&(i=10===o?".0e":","),"function"!=typeof i&&(i=ll(i)),e===1/0)return i;null==e&&(e=10);var a=Math.max(1,o*e/r.ticks().length);return function(e){var r=e/n(Math.round(t(e)));return r*o0?r[i-1]:t[0],i=r?[i[r-1],n]:[i[a-1],i[a]]},a.unknown=function(t){return arguments.length?(e=t,a):a},a.thresholds=function(){return i.slice()},a.copy=function(){return Uv().domain([t,n]).range(o).unknown(e)},Zm.apply(bv(a),arguments)}function Vv(){var e,t=[.5],n=[0,1],r=1;function i(i){return i<=i?n[_e(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=nv.call(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=nv.call(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return Vv().domain(t).range(n).unknown(e)},Zm.apply(i,arguments)}var Wv=new Date,Yv=new Date;function Xv(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return Wv.setTime(+t),Yv.setTime(+r),e(Wv),e(Yv),Math.floor(n(Wv,Yv))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var Hv=Xv((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));Hv.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Xv((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null};var Gv=Hv,Kv=Hv.range,$v=Xv((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})),Jv=$v,Zv=$v.range;function Qv(e){return Xv((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/6048e5}))}var ey=Qv(0),ty=Qv(1),ny=Qv(2),ry=Qv(3),iy=Qv(4),oy=Qv(5),ay=Qv(6),sy=ey.range,uy=ty.range,ly=ny.range,cy=ry.range,fy=iy.range,py=oy.range,dy=ay.range,hy=Xv((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5}),(function(e){return e.getDate()-1})),my=hy,vy=hy.range,yy=Xv((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()})),gy=yy,by=yy.range,xy=Xv((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getMinutes()})),wy=xy,Ey=xy.range,_y=Xv((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()})),Sy=_y,Ay=_y.range,ky=Xv((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));ky.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?Xv((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):ky:null};var Cy=ky,Ty=ky.range;function Dy(e){return Xv((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/6048e5}))}var My=Dy(0),Oy=Dy(1),Py=Dy(2),Ly=Dy(3),Ny=Dy(4),Fy=Dy(5),Ry=Dy(6),jy=My.range,Iy=Oy.range,By=Py.range,qy=Ly.range,zy=Ny.range,Uy=Fy.range,Vy=Ry.range,Wy=Xv((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1})),Yy=Wy,Xy=Wy.range,Hy=Xv((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));Hy.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Xv((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};var Gy=Hy,Ky=Hy.range;function $y(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Jy(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Zy(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Qy(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,u=e.shortMonths,l=fg(i),c=pg(i),f=fg(o),p=pg(o),d=fg(a),h=pg(a),m=fg(s),v=pg(s),y=fg(u),g=pg(u),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return u[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:Lg,e:Lg,f:Ig,H:Ng,I:Fg,j:Rg,L:jg,m:Bg,M:qg,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:hb,s:mb,S:zg,u:Ug,U:Vg,V:Wg,w:Yg,W:Xg,x:null,X:null,y:Hg,Y:Gg,Z:Kg,"%":db},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return u[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:$g,e:$g,f:tb,H:Jg,I:Zg,j:Qg,L:eb,m:nb,M:rb,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:hb,s:mb,S:ib,u:ob,U:ab,V:sb,w:ub,W:lb,x:null,X:null,y:cb,Y:fb,Z:pb,"%":db},w={a:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=h[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=p[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=v[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return S(e,t,n,r)},d:_g,e:_g,f:Dg,H:Ag,I:Ag,j:Sg,L:Tg,m:Eg,M:kg,p:function(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=c[r[0].toLowerCase()],n+r[0].length):-1},q:wg,Q:Og,s:Pg,S:Cg,u:hg,U:mg,V:vg,w:dg,W:yg,x:function(e,t,r){return S(e,n,t,r)},X:function(e,t,n){return S(e,r,t,n)},y:bg,Y:gg,Z:xg,"%":Mg};function E(e,t){return function(n){var r,i,o,a=[],s=-1,u=0,l=e.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Jy(Zy(o.y,0,1))).getUTCDay(),r=i>4||0===i?Oy.ceil(r):Oy(r),r=Yy.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=$y(Zy(o.y,0,1))).getDay(),r=i>4||0===i?ty.ceil(r):ty(r),r=my.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Jy(Zy(o.y,0,1)).getUTCDay():$y(Zy(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Jy(o)):$y(o)}}function S(e,t,n,r){for(var i,o,a=0,s=t.length,u=n.length;a=u)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=w[i in og?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=E(n,b),b.X=E(r,b),b.c=E(t,b),x.x=E(n,x),x.X=E(r,x),x.c=E(t,x),{format:function(e){var t=E(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=_(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=E(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=_(e+="",!0);return t.toString=function(){return e},t}}}var eg,tg,ng,rg,ig,og={"-":"",_:" ",0:"0"},ag=/^\s*\d+/,sg=/^%/,ug=/[\\^$*+?|[\]().{}]/g;function lg(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o68?1900:2e3),n+r[0].length):-1}function xg(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function wg(e,t,n){var r=ag.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function Eg(e,t,n){var r=ag.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function _g(e,t,n){var r=ag.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Sg(e,t,n){var r=ag.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Ag(e,t,n){var r=ag.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function kg(e,t,n){var r=ag.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Cg(e,t,n){var r=ag.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Tg(e,t,n){var r=ag.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Dg(e,t,n){var r=ag.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Mg(e,t,n){var r=sg.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Og(e,t,n){var r=ag.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Pg(e,t,n){var r=ag.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Lg(e,t){return lg(e.getDate(),t,2)}function Ng(e,t){return lg(e.getHours(),t,2)}function Fg(e,t){return lg(e.getHours()%12||12,t,2)}function Rg(e,t){return lg(1+my.count(Gv(e),e),t,3)}function jg(e,t){return lg(e.getMilliseconds(),t,3)}function Ig(e,t){return jg(e,t)+"000"}function Bg(e,t){return lg(e.getMonth()+1,t,2)}function qg(e,t){return lg(e.getMinutes(),t,2)}function zg(e,t){return lg(e.getSeconds(),t,2)}function Ug(e){var t=e.getDay();return 0===t?7:t}function Vg(e,t){return lg(ey.count(Gv(e)-1,e),t,2)}function Wg(e,t){var n=e.getDay();return e=n>=4||0===n?iy(e):iy.ceil(e),lg(iy.count(Gv(e),e)+(4===Gv(e).getDay()),t,2)}function Yg(e){return e.getDay()}function Xg(e,t){return lg(ty.count(Gv(e)-1,e),t,2)}function Hg(e,t){return lg(e.getFullYear()%100,t,2)}function Gg(e,t){return lg(e.getFullYear()%1e4,t,4)}function Kg(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+lg(t/60|0,"0",2)+lg(t%60,"0",2)}function $g(e,t){return lg(e.getUTCDate(),t,2)}function Jg(e,t){return lg(e.getUTCHours(),t,2)}function Zg(e,t){return lg(e.getUTCHours()%12||12,t,2)}function Qg(e,t){return lg(1+Yy.count(Gy(e),e),t,3)}function eb(e,t){return lg(e.getUTCMilliseconds(),t,3)}function tb(e,t){return eb(e,t)+"000"}function nb(e,t){return lg(e.getUTCMonth()+1,t,2)}function rb(e,t){return lg(e.getUTCMinutes(),t,2)}function ib(e,t){return lg(e.getUTCSeconds(),t,2)}function ob(e){var t=e.getUTCDay();return 0===t?7:t}function ab(e,t){return lg(My.count(Gy(e)-1,e),t,2)}function sb(e,t){var n=e.getUTCDay();return e=n>=4||0===n?Ny(e):Ny.ceil(e),lg(Ny.count(Gy(e),e)+(4===Gy(e).getUTCDay()),t,2)}function ub(e){return e.getUTCDay()}function lb(e,t){return lg(Oy.count(Gy(e)-1,e),t,2)}function cb(e,t){return lg(e.getUTCFullYear()%100,t,2)}function fb(e,t){return lg(e.getUTCFullYear()%1e4,t,4)}function pb(){return"+0000"}function db(){return"%"}function hb(e){return+e}function mb(e){return Math.floor(+e/1e3)}function vb(e){return eg=Qy(e),tg=eg.format,ng=eg.parse,rg=eg.utcFormat,ig=eg.utcParse,eg}vb({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function yb(e){return new Date(e)}function gb(e){return e instanceof Date?+e:+new Date(+e)}function bb(e,t,n,r,i,o,a,s,u){var l=yv(cv,cv),c=l.invert,f=l.domain,p=u(".%L"),d=u(":%S"),h=u("%I:%M"),m=u("%I %p"),v=u("%a %d"),y=u("%b %d"),g=u("%B"),b=u("%Y"),x=[[a,1,1e3],[a,5,5e3],[a,15,15e3],[a,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,36e5],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[t,1,2592e6],[t,3,7776e6],[e,1,31536e6]];function w(s){return(a(s)1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return sw.h=360*e-100,sw.s=1.5-1.5*t,sw.l=.8-.9*t,sw+""},lw=lr(),cw=Math.PI/3,fw=2*Math.PI/3,pw=function(e){var t;return e=(.5-e)*Math.PI,lw.r=255*(t=Math.sin(e))*t,lw.g=255*(t=Math.sin(e+cw))*t,lw.b=255*(t=Math.sin(e+fw))*t,lw+""},dw=function(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-14825.05*e)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+707.56*e)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-6838.66*e)))))))+")"};function hw(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}var mw=hw(Yb("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),vw=hw(Yb("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),yw=hw(Yb("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),gw=hw(Yb("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),bw=function(e){return In(gn(e).call(document.documentElement))},xw=0;function ww(){return new Ew}function Ew(){this._="@"+(++xw).toString(36)}Ew.prototype=ww.prototype={constructor:Ew,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};var _w=function(e){return"string"==typeof e?new Fn([document.querySelectorAll(e)],[document.documentElement]):new Fn([null==e?[]:e],Nn)},Sw=function(e,t){null==t&&(t=Wr().touches);for(var n=0,r=t?t.length:0,i=new Array(r);n1?0:e<-1?Lw:Math.acos(e)}function jw(e){return e>=1?Nw:e<=-1?-Nw:Math.asin(e)}function Iw(e){return e.innerRadius}function Bw(e){return e.outerRadius}function qw(e){return e.startAngle}function zw(e){return e.endAngle}function Uw(e){return e&&e.padAngle}function Vw(e,t,n,r,i,o,a,s){var u=n-e,l=r-t,c=a-i,f=s-o,p=f*u-c*l;if(!(p*p<1e-12))return[e+(p=(c*(t-o)-f*(e-i))/p)*u,t+p*l]}function Ww(e,t,n,r,i,o,a){var s=e-n,u=t-r,l=(a?o:-o)/Pw(s*s+u*u),c=l*u,f=-l*s,p=e+c,d=t+f,h=n+c,m=r+f,v=(p+h)/2,y=(d+m)/2,g=h-p,b=m-d,x=g*g+b*b,w=i-o,E=p*m-h*d,_=(b<0?-1:1)*Pw(Dw(0,w*w*x-E*E)),S=(E*b-g*_)/x,A=(-E*g-b*_)/x,k=(E*b+g*_)/x,C=(-E*g+b*_)/x,T=S-v,D=A-y,M=k-v,O=C-y;return T*T+D*D>M*M+O*O&&(S=k,A=C),{cx:S,cy:A,x01:-c,y01:-f,x11:S*(i/w-1),y11:A*(i/w-1)}}var Yw=function(){var e=Iw,t=Bw,n=Aw(0),r=null,i=qw,o=zw,a=Uw,s=null;function u(){var u,l,c=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-Nw,d=o.apply(this,arguments)-Nw,h=kw(d-p),m=d>p;if(s||(s=u=ia()),f1e-12)if(h>Fw-1e-12)s.moveTo(f*Tw(p),f*Ow(p)),s.arc(0,0,f,p,d,!m),c>1e-12&&(s.moveTo(c*Tw(d),c*Ow(d)),s.arc(0,0,c,d,p,m));else{var v,y,g=p,b=d,x=p,w=d,E=h,_=h,S=a.apply(this,arguments)/2,A=S>1e-12&&(r?+r.apply(this,arguments):Pw(c*c+f*f)),k=Mw(kw(f-c)/2,+n.apply(this,arguments)),C=k,T=k;if(A>1e-12){var D=jw(A/c*Ow(S)),M=jw(A/f*Ow(S));(E-=2*D)>1e-12?(x+=D*=m?1:-1,w-=D):(E=0,x=w=(p+d)/2),(_-=2*M)>1e-12?(g+=M*=m?1:-1,b-=M):(_=0,g=b=(p+d)/2)}var O=f*Tw(g),P=f*Ow(g),L=c*Tw(w),N=c*Ow(w);if(k>1e-12){var F,R=f*Tw(b),j=f*Ow(b),I=c*Tw(x),B=c*Ow(x);if(h1e-12?T>1e-12?(v=Ww(I,B,O,P,f,T,m),y=Ww(R,j,L,N,f,T,m),s.moveTo(v.cx+v.x01,v.cy+v.y01),T1e-12&&E>1e-12?C>1e-12?(v=Ww(L,N,R,j,c,-C,m),y=Ww(O,P,I,B,c,-C,m),s.lineTo(v.cx+v.x01,v.cy+v.y01),C=c;--f)s.point(v[f],y[f]);s.lineEnd(),s.areaEnd()}m&&(v[l]=+e(p,l,u),y[l]=+n(p,l,u),s.point(t?+t(p,l,u):v[l],r?+r(p,l,u):y[l]))}if(d)return s=null,d+""||null}function l(){return $w().defined(i).curve(a).context(o)}return u.x=function(n){return arguments.length?(e="function"==typeof n?n:Aw(+n),t=null,u):e},u.x0=function(t){return arguments.length?(e="function"==typeof t?t:Aw(+t),u):e},u.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:Aw(+e),u):t},u.y=function(e){return arguments.length?(n="function"==typeof e?e:Aw(+e),r=null,u):n},u.y0=function(e){return arguments.length?(n="function"==typeof e?e:Aw(+e),u):n},u.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:Aw(+e),u):r},u.lineX0=u.lineY0=function(){return l().x(e).y(n)},u.lineY1=function(){return l().x(e).y(r)},u.lineX1=function(){return l().x(t).y(n)},u.defined=function(e){return arguments.length?(i="function"==typeof e?e:Aw(!!e),u):i},u.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),u):a},u.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),u):o},u},Zw=function(e,t){return te?1:t>=e?0:NaN},Qw=function(e){return e},eE=function(){var e=Qw,t=Zw,n=null,r=Aw(0),i=Aw(Fw),o=Aw(0);function a(a){var s,u,l,c,f,p=a.length,d=0,h=new Array(p),m=new Array(p),v=+r.apply(this,arguments),y=Math.min(Fw,Math.max(-Fw,i.apply(this,arguments)-v)),g=Math.min(Math.abs(y)/p,o.apply(this,arguments)),b=g*(y<0?-1:1);for(s=0;s0&&(d+=f);for(null!=t?h.sort((function(e,n){return t(m[e],m[n])})):null!=n&&h.sort((function(e,t){return n(a[e],a[t])})),s=0,l=d?(y-p*b)/d:0;s
0?f*l:0)+b,m[u]={data:a[u],index:s,value:f,startAngle:v,endAngle:c,padAngle:g};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:Aw(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:Aw(+e),a):r},a.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:Aw(+e),a):i},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:Aw(+e),a):o},a},tE=rE(Hw);function nE(e){this._curve=e}function rE(e){function t(t){return new nE(e(t))}return t._curve=e,t}function iE(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(e){return arguments.length?t(rE(e)):t()._curve},e}nE.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};var oE=function(){return iE($w().curve(tE))},aE=function(){var e=Jw().curve(tE),t=e.curve,n=e.lineX0,r=e.lineX1,i=e.lineY0,o=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return iE(n())},delete e.lineX0,e.lineEndAngle=function(){return iE(r())},delete e.lineX1,e.lineInnerRadius=function(){return iE(i())},delete e.lineY0,e.lineOuterRadius=function(){return iE(o())},delete e.lineY1,e.curve=function(e){return arguments.length?t(rE(e)):t()._curve},e},sE=function(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]},uE=Array.prototype.slice;function lE(e){return e.source}function cE(e){return e.target}function fE(e){var t=lE,n=cE,r=Gw,i=Kw,o=null;function a(){var a,s=uE.call(arguments),u=t.apply(this,s),l=n.apply(this,s);if(o||(o=a=ia()),e(o,+r.apply(this,(s[0]=u,s)),+i.apply(this,s),+r.apply(this,(s[0]=l,s)),+i.apply(this,s)),a)return o=null,a+""||null}return a.source=function(e){return arguments.length?(t=e,a):t},a.target=function(e){return arguments.length?(n=e,a):n},a.x=function(e){return arguments.length?(r="function"==typeof e?e:Aw(+e),a):r},a.y=function(e){return arguments.length?(i="function"==typeof e?e:Aw(+e),a):i},a.context=function(e){return arguments.length?(o=null==e?null:e,a):o},a}function pE(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function dE(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t,n=(n+i)/2,r,n,r,i)}function hE(e,t,n,r,i){var o=sE(t,n),a=sE(t,n=(n+i)/2),s=sE(r,n),u=sE(r,i);e.moveTo(o[0],o[1]),e.bezierCurveTo(a[0],a[1],s[0],s[1],u[0],u[1])}function mE(){return fE(pE)}function vE(){return fE(dE)}function yE(){var e=fE(hE);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}var gE={draw:function(e,t){var n=Math.sqrt(t/Lw);e.moveTo(n,0),e.arc(0,0,n,0,Fw)}},bE={draw:function(e,t){var n=Math.sqrt(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},xE=Math.sqrt(1/3),wE=2*xE,EE={draw:function(e,t){var n=Math.sqrt(t/wE),r=n*xE;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},_E=Math.sin(Lw/10)/Math.sin(7*Lw/10),SE=Math.sin(Fw/10)*_E,AE=-Math.cos(Fw/10)*_E,kE={draw:function(e,t){var n=Math.sqrt(.8908130915292852*t),r=SE*n,i=AE*n;e.moveTo(0,-n),e.lineTo(r,i);for(var o=1;o<5;++o){var a=Fw*o/5,s=Math.cos(a),u=Math.sin(a);e.lineTo(u*n,-s*n),e.lineTo(s*r-u*i,u*r+s*i)}e.closePath()}},CE={draw:function(e,t){var n=Math.sqrt(t),r=-n/2;e.rect(r,r,n,n)}},TE=Math.sqrt(3),DE={draw:function(e,t){var n=-Math.sqrt(t/(3*TE));e.moveTo(0,2*n),e.lineTo(-TE*n,-n),e.lineTo(TE*n,-n),e.closePath()}},ME=Math.sqrt(3)/2,OE=1/Math.sqrt(12),PE=3*(OE/2+1),LE={draw:function(e,t){var n=Math.sqrt(t/PE),r=n/2,i=n*OE,o=r,a=n*OE+n,s=-o,u=a;e.moveTo(r,i),e.lineTo(o,a),e.lineTo(s,u),e.lineTo(-.5*r-ME*i,ME*r+-.5*i),e.lineTo(-.5*o-ME*a,ME*o+-.5*a),e.lineTo(-.5*s-ME*u,ME*s+-.5*u),e.lineTo(-.5*r+ME*i,-.5*i-ME*r),e.lineTo(-.5*o+ME*a,-.5*a-ME*o),e.lineTo(-.5*s+ME*u,-.5*u-ME*s),e.closePath()}},NE=[gE,bE,EE,CE,kE,DE,LE],FE=function(){var e=Aw(gE),t=Aw(64),n=null;function r(){var r;if(n||(n=r=ia()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),r)return n=null,r+""||null}return r.type=function(t){return arguments.length?(e="function"==typeof t?t:Aw(t),r):e},r.size=function(e){return arguments.length?(t="function"==typeof e?e:Aw(+e),r):t},r.context=function(e){return arguments.length?(n=null==e?null:e,r):n},r},RE=function(){};function jE(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function IE(e){this._context=e}IE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:jE(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:jE(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};var BE=function(e){return new IE(e)};function qE(e){this._context=e}qE.prototype={areaStart:RE,areaEnd:RE,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:jE(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};var zE=function(e){return new qE(e)};function UE(e){this._context=e}UE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:jE(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};var VE=function(e){return new UE(e)};function WE(e,t){this._basis=new IE(e),this._beta=t}WE.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r,i=e[0],o=t[0],a=e[n]-i,s=t[n]-o,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*e[u]+(1-this._beta)*(i+r*a),this._beta*t[u]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var YE=function e(t){function n(e){return 1===t?new IE(e):new WE(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function XE(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function HE(e,t){this._context=e,this._k=(1-t)/6}HE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:XE(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:XE(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var GE=function e(t){function n(e){return new HE(e,t)}return n.tension=function(t){return e(+t)},n}(0);function KE(e,t){this._context=e,this._k=(1-t)/6}KE.prototype={areaStart:RE,areaEnd:RE,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:XE(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var $E=function e(t){function n(e){return new KE(e,t)}return n.tension=function(t){return e(+t)},n}(0);function JE(e,t){this._context=e,this._k=(1-t)/6}JE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:XE(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ZE=function e(t){function n(e){return new JE(e,t)}return n.tension=function(t){return e(+t)},n}(0);function QE(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*l+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}function e_(e,t){this._context=e,this._alpha=t}e_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:QE(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var t_=function e(t){function n(e){return t?new e_(e,t):new HE(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function n_(e,t){this._context=e,this._alpha=t}n_.prototype={areaStart:RE,areaEnd:RE,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:QE(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var r_=function e(t){function n(e){return t?new n_(e,t):new KE(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function i_(e,t){this._context=e,this._alpha=t}i_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:QE(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var o_=function e(t){function n(e){return t?new i_(e,t):new JE(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function a_(e){this._context=e}a_.prototype={areaStart:RE,areaEnd:RE,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};var s_=function(e){return new a_(e)};function u_(e){return e<0?-1:1}function l_(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(u_(o)+u_(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function c_(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function f_(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function p_(e){this._context=e}function d_(e){this._context=new h_(e)}function h_(e){this._context=e}function m_(e){return new p_(e)}function v_(e){return new d_(e)}function y_(e){this._context=e}function g_(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var w_=function(e){return new x_(e,.5)};function E_(e){return new x_(e,0)}function __(e){return new x_(e,1)}var S_=function(e,t){if((i=e.length)>1)for(var n,r,i,o=1,a=e[t[0]],s=a.length;o=0;)n[t]=t;return n};function k_(e,t){return e[t]}var C_=function(){var e=Aw([]),t=A_,n=S_,r=k_;function i(i){var o,a,s=e.apply(this,arguments),u=i.length,l=s.length,c=new Array(l);for(o=0;o0){for(var n,r,i,o=0,a=e[0].length;o0)for(var n,r,i,o,a,s,u=0,l=e[t[0]].length;u0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):(r[0]=0,r[1]=i)},M_=function(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],o=i.length;r0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,a=1;ao&&(o=t,r=n);return r}var N_=function(e){var t=e.map(F_);return A_(e).sort((function(e,n){return t[e]-t[n]}))};function F_(e){for(var t,n=0,r=-1,i=e.length;++r0)){if(o/=p,p<0){if(o0){if(o>f)return;o>c&&(c=o)}if(o=r-u,p||!(o<0)){if(o/=p,p<0){if(o>f)return;o>c&&(c=o)}else if(p>0){if(o0)){if(o/=d,d<0){if(o0){if(o>f)return;o>c&&(c=o)}if(o=i-l,d||!(o<0)){if(o/=d,d<0){if(o>f)return;o>c&&(c=o)}else if(d>0){if(o0||f<1)||(c>0&&(e[0]=[u+c*p,l+c*d]),f<1&&(e[1]=[u+f*p,l+f*d]),!0)}}}}}function tS(e,t,n,r,i){var o=e[1];if(o)return!0;var a,s,u=e[0],l=e.left,c=e.right,f=l[0],p=l[1],d=c[0],h=c[1],m=(f+d)/2,v=(p+h)/2;if(h===p){if(m=r)return;if(f>d){if(u){if(u[1]>=i)return}else u=[m,n];o=[m,i]}else{if(u){if(u[1]1)if(f>d){if(u){if(u[1]>=i)return}else u=[(n-s)/a,n];o=[(i-s)/a,i]}else{if(u){if(u[1]=r)return}else u=[t,a*t+s];o=[r,a*r+s]}else{if(u){if(u[0]=-_S)){var d=u*u+l*l,h=c*c+f*f,m=(f*d-l*h)/p,v=(u*h-c*d)/p,y=aS.pop()||new sS;y.arc=e,y.site=i,y.x=m+a,y.y=(y.cy=v+s)+Math.sqrt(m*m+v*v),e.circle=y;for(var g=null,b=xS._;b;)if(y.yES)s=s.L;else{if(!((i=o-yS(s,a))>ES)){r>-ES?(t=s.P,n=s):i>-ES?(t=s,n=s.N):t=n=s;break}if(!s.R){t=s;break}s=s.R}!function(e){bS[e.index]={site:e,halfedges:[]}}(e);var u=pS(e);if(gS.insert(t,u),t||n){if(t===n)return lS(t),n=pS(t.site),gS.insert(u,n),u.edge=n.edge=J_(t.site,u.site),uS(t),void uS(n);if(n){lS(t),lS(n);var l=t.site,c=l[0],f=l[1],p=e[0]-c,d=e[1]-f,h=n.site,m=h[0]-c,v=h[1]-f,y=2*(p*v-d*m),g=p*p+d*d,b=m*m+v*v,x=[(v*g-d*b)/y+c,(p*b-m*g)/y+f];Q_(n.edge,l,h,x),u.edge=J_(l,e,null,x),n.edge=J_(e,h,null,x),uS(t),uS(n)}else u.edge=J_(t.site,u.site)}}function vS(e,t){var n=e.site,r=n[0],i=n[1],o=i-t;if(!o)return r;var a=e.P;if(!a)return-1/0;var s=(n=a.site)[0],u=n[1],l=u-t;if(!l)return s;var c=s-r,f=1/o-1/l,p=c/l;return f?(-p+Math.sqrt(p*p-2*f*(c*c/(-2*l)-u+l/2+i-o/2)))/f+r:(r+s)/2}function yS(e,t){var n=e.N;if(n)return vS(n,t);var r=e.site;return r[1]===t?r[0]:1/0}var gS,bS,xS,wS,ES=1e-6,_S=1e-12;function SS(e,t){return t[1]-e[1]||t[0]-e[0]}function AS(e,t){var n,r,i,o=e.sort(SS).pop();for(wS=[],bS=new Array(e.length),gS=new $_,xS=new $_;;)if(i=oS,o&&(!i||o[1]ES||Math.abs(i[0][1]-i[1][1])>ES)||delete wS[o]}(a,s,u,l),function(e,t,n,r){var i,o,a,s,u,l,c,f,p,d,h,m,v=bS.length,y=!0;for(i=0;iES||Math.abs(m-p)>ES)&&(u.splice(s,0,wS.push(Z_(a,d,Math.abs(h-e)ES?[e,Math.abs(f-e)ES?[Math.abs(p-r)ES?[n,Math.abs(f-n)ES?[Math.abs(p-t)=s)return null;var u=e-i.site[0],l=t-i.site[1],c=u*u+l*l;do{i=o.cells[r=a],a=null,i.halfedges.forEach((function(n){var r=o.edges[n],s=r.left;if(s!==i.site&&s||(s=r.right)){var u=e-s[0],l=t-s[1],f=u*u+l*l;fr?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}var qS=function(){var e,t,n=NS,r=FS,i=BS,o=jS,a=IS,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Am,f=At("start","zoom","end"),p=0;function d(e){e.property("__zoom",RS).on("wheel.zoom",x).on("mousedown.zoom",w).on("dblclick.zoom",E).filter(a).on("touchstart.zoom",_).on("touchmove.zoom",S).on("touchend.zoom touchcancel.zoom",A).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(e,t){return(t=Math.max(s[0],Math.min(s[1],t)))===e.k?e:new DS(t,e.x,e.y)}function m(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new DS(e.k,r,i)}function v(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function y(e,t,n){e.on("start.zoom",(function(){g(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){g(this,arguments).end()})).tween("zoom",(function(){var e=this,i=arguments,o=g(e,i),a=r.apply(e,i),s=null==n?v(a):"function"==typeof n?n.apply(e,i):n,u=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),l=e.__zoom,f="function"==typeof t?t.apply(e,i):t,p=c(l.invert(s).concat(u/l.k),f.invert(s).concat(u/f.k));return function(e){if(1===e)e=f;else{var t=p(e),n=u/t[2];e=new DS(n,s[0]-t[0]*n,s[1]-t[1]*n)}o.zoom(null,e)}}))}function g(e,t,n){return!n&&e.__zooming||new b(e,t)}function b(e,t){this.that=e,this.args=t,this.active=0,this.extent=r.apply(e,t),this.taps=0}function x(){if(n.apply(this,arguments)){var e=g(this,arguments),t=this.__zoom,r=Math.max(s[0],Math.min(s[1],t.k*Math.pow(2,o.apply(this,arguments)))),a=Hr(this);if(e.wheel)e.mouse[0][0]===a[0]&&e.mouse[0][1]===a[1]||(e.mouse[1]=t.invert(e.mouse[0]=a)),clearTimeout(e.wheel);else{if(t.k===r)return;e.mouse=[a,t.invert(a)],wi(this),e.start()}LS(),e.wheel=setTimeout(l,150),e.zoom("mouse",i(m(h(t,r),e.mouse[0],e.mouse[1]),e.extent,u))}function l(){e.wheel=null,e.end()}}function w(){if(!t&&n.apply(this,arguments)){var e=g(this,arguments,!0),r=In(Sn.view).on("mousemove.zoom",l,!0).on("mouseup.zoom",c,!0),o=Hr(this),a=Sn.clientX,s=Sn.clientY;zn(Sn.view),PS(),e.mouse=[o,this.__zoom.invert(o)],wi(this),e.start()}function l(){if(LS(),!e.moved){var t=Sn.clientX-a,n=Sn.clientY-s;e.moved=t*t+n*n>p}e.zoom("mouse",i(m(e.that.__zoom,e.mouse[0]=Hr(e.that),e.mouse[1]),e.extent,u))}function c(){r.on("mousemove.zoom mouseup.zoom",null),Un(Sn.view,e.moved),LS(),e.end()}}function E(){if(n.apply(this,arguments)){var e=this.__zoom,t=Hr(this),o=e.invert(t),a=e.k*(Sn.shiftKey?.5:2),s=i(m(h(e,a),t,o),r.apply(this,arguments),u);LS(),l>0?In(this).transition().duration(l).call(y,s,t):In(this).call(d.transform,s)}}function _(){if(n.apply(this,arguments)){var t,r,i,o,a=Sn.touches,s=a.length,u=g(this,arguments,Sn.changedTouches.length===s);for(PS(),r=0;re(...n,...t)}const mA=f.a.oneOfType([f.a.string,f.a.number,f.a.array,f.a.func]),vA=(f.a.oneOf(["linear","time","ordinal","log","pow"]),f.a.oneOfType([f.a.number,f.a.string,f.a.instanceOf(Date),f.a.func]));var yA=n(61),gA=n.n(yA),bA=n(198),xA=n.n(bA),wA=n(26),EA=n.n(wA),_A=n(95),SA=n.n(_A),AA=n(36),kA=n.n(AA),CA=n(56),TA=n.n(CA),DA=n(52),MA=n.n(DA),OA=n(143),PA=n.n(OA),LA=n(12),NA=n.n(LA),FA=n(93),RA=n.n(FA),jA=n(315),IA=n.n(jA),BA=n(316),qA=n.n(BA),zA=n(108),UA=n.n(zA),VA=n(317),WA=n.n(VA),YA=n(17),XA=n.n(YA);function HA(e){return cA()(e)?e:gA()(e)||pA()(e)?XA.a:xA()(e)}function GA(e){return cA()(e)?e:()=>e}function KA(e,...t){return cA()(e)?e(...t):e}function $A(e){if(Array.isArray(e.datasets))return e.datasets;if(Array.isArray(e.data))return[e.data];if(s.a.Children.count(e.children)){let t=[];return s.a.Children.forEach(e.children,e=>{t=t.concat($A(e.props))}),t}return[]}function JA(e,t=XA.a){if(Array.isArray(e))return e.every((e,n)=>void 0===t(e,n))?"categorical":e.every((e,n)=>EA()(t(e,n))||void 0===t(e,n))?"number":e.every((e,n)=>SA()(t(e,n))||void 0===t(e,n))?"time":"categorical";throw new Error("inferDataType expects a data array")}function ZA(e,t=XA.a){if(!Array.isArray(e))throw new Error("inferDatasetsType expects a datasets array");const n=e.map(e=>JA(e,t)),r=kA()(n);return 1===r.length?r[0]:"categorical"}function QA(e,t="categorical"){return Array.isArray(e)&&!!e.length&&("categorical"===t||"number"===t&&2===e.length&&e.every(EA.a)||"time"===t&&2===e.length&&e.every(SA.a))}function ek(e,t){if(Array.isArray(e))return"categorical"===t?kA()(TA()(MA()(e))):Oe(TA()(e))}function tk(e){return PA()(["top","bottom","left","right"].map(t=>[t,NA()(RA()(e,t),t)]))}function nk(e,t=XA.a,n){let r=n;return r||(r=JA(e,t)),"number"===r||"time"===r?Oe(e.map(t)):kA()(e.map(t))}function rk(e){const{horizontal:t,data:n,getX:r,getY:i}=e;return{[t?"y":"x"]:nk(n,HA(t?i:r))}}function ik(e,t=XA.a,n){let r=n;r||(r=ZA(e,t));return ek(e.map(e=>nk(e,t,r)),r)}function ok(e,t,n,r){let i=r;switch(i||(i=JA(e,t)),i){case"number":case"time":return Oe(TA()([Oe(e,(e,n)=>+t(e,n)),Oe(e,(e,t)=>+n(e,t))]));case"categorical":return kA()(TA()([e.map(t),e.map(n)]));default:return[]}}function ak(e=[],t="x"){const n=e.map(e=>{const{data:n}=e;return IA()(n,e.combineKey||t)}),r=[].concat(...e.map(e=>e.data.map(HA(e.combineKey||t))));return qA()(r,e=>e instanceof Date?e.toString():e).map(r=>{const i={[t]:r};return e.forEach((e,t)=>{if(!e.dataKeys||!Object.keys(e.dataKeys).length)return;const o=n[t];if(!UA()(o,r))return;const a=o[r];WA()(e.dataKeys,(e,t)=>{i[e]=a[t]})}),i})}function sk(){return(sk=Object.assign||function(e){for(var t=1;t{this.props.onMouseEnterSlice(e,t)}),uk(this,"onMouseMoveSlice",(e,t)=>{this.props.onMouseMoveSlice(e,t)}),uk(this,"onMouseLeaveSlice",(e,t)=>{this.props.onMouseLeaveSlice(e,t)}),uk(this,"onMouseEnterLine",(e,t)=>{this.props.onMouseEnterLine(e,t)}),uk(this,"onMouseMoveLine",(e,t)=>{this.props.onMouseMoveLine(e,t)}),uk(this,"onMouseLeaveLine",(e,t)=>{this.props.onMouseLeaveLine(e,t)}),uk(this,"onClick",(e,t)=>{this.props.onClick(e,t)})}renderMarkerLine(e){const{markerLineClassName:t,markerLineStyle:n}=this.props,r={value:this.props.markerLineValue},[i,o,a,u]=["onMouseEnterLine","onMouseMoveLine","onMouseLeaveLine","onClick"].map(e=>{const t=dA(e,this.props,this);return cA()(t)?hA(t,r):null});return s.a.createElement("path",sk({style:n,className:"rct-marker-line "+t,d:e},{onMouseEnter:i,onMouseMove:o,onMouseLeave:a,onClick:u}))}renderSliceLabel(e,t,n,r,i){const{getPieSliceLabel:o,pieSliceLabelStyle:a,pieSliceLabelDistance:u}=this.props,l=(t.end-t.start)/2+t.start,c={textAnchor:"middle",dominantBaseline:"central"};a&&Object.assign(c,KA(a,e));const f=u?r+KA(u,e):r,p=n.x+Math.sin(2*Math.PI/(1/l))*f,d=n.y-Math.cos(2*Math.PI/(1/l))*f;return s.a.createElement("text",{key:i,x:p,y:d,style:c},o(e))}renderCenterLabel(e){const{centerLabelStyle:t,centerLabelClassName:n,centerLabel:r}=this.props,{x:i,y:o}=e,a=Object.assign({},{textAnchor:"middle",dominantBaseline:"central"},t);return s.a.createElement("text",sk({className:"rct-pie-label-center "+n},{x:i,y:o,style:a}),r)}render(){const{marginLeft:e,marginRight:t,marginTop:n,marginBottom:r,holeRadius:i}=this.props,o=this.props.width||(this.props.radius?2*this.props.radius+e+t:this.props.height)||150,a=this.props.height||(this.props.radius?2*this.props.radius+n+r:this.props.width)||150,u=this.props.radius||Math.min((o-(e+t))/2,(a-(n+r))/2),l={x:e+u,y:n+u},{data:c,total:f,centerLabel:p,getPieSliceLabel:d,markerLineValue:h,markerLineOverhangInner:m,markerLineOverhangOuter:v,pieSliceClassName:y}=this.props,g=HA(this.props.slice),b=uA()(c,g),x=f||b,w=isFinite(h)?h/x:null;let E=0;const _=c.map(e=>{const t=g(e)/x,n={start:E,end:E+t};return E+=t,n});return s.a.createElement("svg",sk({className:"rct-pie-chart"},{width:o,height:a}),c.map((e,t)=>{const[n,r,o,a]=["onMouseEnterSlice","onMouseMoveSlice","onMouseLeaveSlice","onClick"].map(t=>{const n=dA(t,this.props,this);return cA()(n)?hA(n,e):null}),c=`rct-pie-slice rct-pie-slice-${t} ${KA(y,e,t)||""}`,f=_[t],p=ck(f.start,f.end,l,u,i),d="pie-slice-"+t;return s.a.createElement("path",{className:c,d:p,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:a,key:d,style:KA(this.props.pieSliceStyle,e,t)})}),bthis.renderSliceLabel(e,_[t],l,u,t)):null)}}function ck(e,t,n,r,i=0){let o=t;1===o&&(o=.9999999);const a=Math.sin(2*Math.PI/(1/e)),s=Math.cos(2*Math.PI/(1/e)),u=Math.sin(2*Math.PI/(1/o)),l=Math.cos(2*Math.PI/(1/o)),c=o-e<=.5?0:1,[f,p,d,h,m,v,y]=[n,r,i,a,u,s,l];return[`M ${f.x+h*d},${f.y-v*d}`,`L ${f.x+h*p},${f.y-v*p}`,`A ${p},${p} 0 ${c} 1 ${f.x+m*p},${f.y-y*p}`].concat(i?[`L ${f.x+m*d},${f.y-y*d}`,`A ${d},${d} 0 ${c} 0 ${f.x+h*d},${f.y-v*d} z`]:"z").join(" ")}uk(lk,"propTypes",{data:f.a.array.isRequired,slice:mA.isRequired,total:f.a.number,width:f.a.number,height:f.a.number,radius:f.a.number,marginTop:f.a.number,marginBottom:f.a.number,marginLeft:f.a.number,marginRight:f.a.number,holeRadius:f.a.number,centerLabel:f.a.string,centerLabelClassName:f.a.string,centerLabelStyle:f.a.object,getPieSliceLabel:f.a.func,pieSliceLabelStyle:f.a.oneOfType([f.a.object,f.a.func]),pieSliceLabelDistance:f.a.oneOfType([f.a.number,f.a.func]),pieSliceClassName:f.a.oneOfType([f.a.string,f.a.func]),pieSliceStyle:f.a.oneOfType([f.a.object,f.a.func]),markerLineValue:f.a.number,markerLineClassName:f.a.string,markerLineStyle:f.a.object,markerLineOverhangInner:f.a.number,markerLineOverhangOuter:f.a.number,onMouseEnterLine:f.a.func,onMouseMoveLine:f.a.func,onMouseLeaveLine:f.a.func,onMouseEnterSlice:f.a.func,onMouseMoveSlice:f.a.func,onMouseLeaveSlice:f.a.func,onClick:f.a.func}),uk(lk,"defaultProps",{centerLabelClassName:"",centerLabelStyle:{},pieSliceClassName:"",pieSliceStyle:{},markerLineClassName:"",markerLineOverhangInner:2,markerLineOverhangOuter:2,markerLineStyle:{},marginTop:0,marginBottom:0,marginLeft:0,marginRight:0});var fk=lk;function pk(e){return e.target.depth}function dk(e,t){return e.sourceLinks.length?e.depth:t-1}function hk(e){return function(){return e}}function mk(e,t){return yk(e.source,t.source)||e.index-t.index}function vk(e,t){return yk(e.target,t.target)||e.index-t.index}function yk(e,t){return e.y0-t.y0}function gk(e){return e.value}function bk(e){return e.index}function xk(e){return e.nodes}function wk(e){return e.links}function Ek(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function _k({nodes:e}){for(const t of e){let e=t.y0,n=e;for(const n of t.sourceLinks)n.y0=e+n.width/2,e+=n.width;for(const e of t.targetLinks)e.y1=n+e.width/2,n+=e.width}}function Sk(){let e,t,n,r=0,i=0,o=1,a=1,s=24,u=8,l=bk,c=dk,f=xk,p=wk,d=6;function h(){const e={nodes:f.apply(null,arguments),links:p.apply(null,arguments)};return m(e),v(e),y(e),g(e),b(e),_k(e),e}function m({nodes:e,links:t}){for(const[t,n]of e.entries())n.index=t,n.sourceLinks=[],n.targetLinks=[];const r=new Map(e.map((t,n)=>[l(t,n,e),t]));for(const[e,n]of t.entries()){n.index=e;let{source:t,target:i}=n;"object"!=typeof t&&(t=n.source=Ek(r,t)),"object"!=typeof i&&(i=n.target=Ek(r,i)),t.sourceLinks.push(n),i.targetLinks.push(n)}if(null!=n)for(const{sourceLinks:t,targetLinks:r}of e)t.sort(n),r.sort(n)}function v({nodes:e}){for(const t of e)t.value=void 0===t.fixedValue?Math.max(rt(t.sourceLinks,gk),rt(t.targetLinks,gk)):t.fixedValue}function y({nodes:e}){const t=e.length;let n=new Set(e),r=new Set,i=0;for(;n.size;){for(const e of n){e.depth=i;for(const{target:t}of e.sourceLinks)r.add(t)}if(++i>t)throw new Error("circular link");n=r,r=new Set}}function g({nodes:e}){const t=e.length;let n=new Set(e),r=new Set,i=0;for(;n.size;){for(const e of n){e.height=i;for(const{source:t}of e.targetLinks)r.add(t)}if(++i>t)throw new Error("circular link");n=r,r=new Set}}function b(n){const l=function({nodes:e}){const n=Ke(e,e=>e.depth)+1,i=(o-r-s)/(n-1),a=new Array(n);for(const t of e){const e=Math.max(0,Math.min(n-1,Math.floor(c.call(null,t,n))));t.layer=e,t.x0=r+e*i,t.x1=t.x0+s,a[e]?a[e].push(t):a[e]=[t]}if(t)for(const e of a)e.sort(t);return a}(n);e=Math.min(u,(a-i)/(Ke(l,e=>e.length)-1)),function(t){const n=Qe(t,t=>(a-i-(t.length-1)*e)/rt(t,gk));for(const r of t){let t=i;for(const i of r){i.y0=t,i.y1=t+i.value*n,t=i.y1+e;for(const e of i.sourceLinks)e.width=e.value*n}t=(a-t+e)/(r.length+1);for(let e=0;e0))continue;let i=(t/r-e.y0)*n;e.y0+=i,e.y1+=i,A(e)}void 0===t&&o.sort(yk),E(o,r)}}function w(e,n,r){for(let i=e.length-2;i>=0;--i){const o=e[i];for(const e of o){let t=0,r=0;for(const{target:n,value:i}of e.sourceLinks){let o=i*(n.layer-e.layer);t+=T(e,n)*o,r+=o}if(!(r>0))continue;let i=(t/r-e.y0)*n;e.y0+=i,e.y1+=i,A(e)}void 0===t&&o.sort(yk),E(o,r)}}function E(t,n){const r=t.length>>1,o=t[r];S(t,o.y0-e,r-1,n),_(t,o.y1+e,r+1,n),S(t,a,t.length-1,n),_(t,i,0,n)}function _(t,n,r,i){for(;r1e-6&&(o.y0+=a,o.y1+=a),n=o.y1+e}}function S(t,n,r,i){for(;r>=0;--r){const o=t[r],a=(o.y1-n)*i;a>1e-6&&(o.y0-=a,o.y1-=a),n=o.y0-e}}function A({sourceLinks:e,targetLinks:t}){if(void 0===n){for(const{source:{sourceLinks:e}}of t)e.sort(vk);for(const{target:{targetLinks:t}}of e)t.sort(mk)}}function k(e){if(void 0===n)for(const{sourceLinks:t,targetLinks:n}of e)t.sort(vk),n.sort(mk)}function C(t,n){let r=t.y0-(t.sourceLinks.length-1)*e/2;for(const{target:i,width:o}of t.sourceLinks){if(i===n)break;r+=o+e}for(const{source:e,width:i}of n.targetLinks){if(e===t)break;r-=i}return r}function T(t,n){let r=n.y0-(n.targetLinks.length-1)*e/2;for(const{source:i,width:o}of n.targetLinks){if(i===t)break;r+=o+e}for(const{target:e,width:i}of t.sourceLinks){if(e===n)break;r-=i}return r}return h.update=function(e){return _k(e),e},h.nodeId=function(e){return arguments.length?(l="function"==typeof e?e:hk(e),h):l},h.nodeAlign=function(e){return arguments.length?(c="function"==typeof e?e:hk(e),h):c},h.nodeSort=function(e){return arguments.length?(t=e,h):t},h.nodeWidth=function(e){return arguments.length?(s=+e,h):s},h.nodePadding=function(t){return arguments.length?(u=e=+t,h):u},h.nodes=function(e){return arguments.length?(f="function"==typeof e?e:hk(e),h):f},h.links=function(e){return arguments.length?(p="function"==typeof e?e:hk(e),h):p},h.linkSort=function(e){return arguments.length?(n=e,h):n},h.size=function(e){return arguments.length?(r=i=0,o=+e[0],a=+e[1],h):[o-r,a-i]},h.extent=function(e){return arguments.length?(r=+e[0][0],o=+e[1][0],i=+e[0][1],a=+e[1][1],h):[[r,i],[o,a]]},h.iterations=function(e){return arguments.length?(d=+e,h):d},h}function Ak(e){return[e.source.x1,e.y0]}function kk(e){return[e.target.x0,e.y1]}var Ck=n(51),Tk=n.n(Ck),Dk=n(44),Mk=n.n(Dk),Ok=n(64),Pk=n.n(Ok),Lk=n(94),Nk=n.n(Lk);function Fk(){return(Fk=Object.assign||function(e){for(var t=1;t{const{graph:t,node:n,nodeClassName:r,nodeStyle:i,onMouseEnterNode:o,onMouseLeaveNode:a,onMouseMoveNode:u,onMouseDownNode:l,onMouseUpNode:c,onClickNode:f}=e,p=e=>cA()(e)?hA(e,{node:n,graph:t}):null;return s.a.createElement("rect",{x:n.x0,y:n.y0,width:Math.abs(n.x1-n.x0),height:Math.abs(n.y1-n.y0),className:"rct-sankey-node "+KA(r,n,t),style:KA(i,n,t),onMouseEnter:p(o),onMouseLeave:p(a),onMouseMove:p(u),onMouseDown:p(l),onMouseUp:p(c),onClick:p(f)})};Bk.propTypes={graph:f.a.object,node:f.a.object,nodeClassName:f.a.oneOfType([f.a.string,f.a.func]),nodeStyle:f.a.oneOfType([f.a.object,f.a.func]),onMouseEnterNode:f.a.func,onMouseLeaveNode:f.a.func,onMouseMoveNode:f.a.func,onMouseDownNode:f.a.func,onMouseUpNode:f.a.func,onClickNode:f.a.func};const qk=e=>{const{graph:t,link:n,linkPath:r,linkClassName:i,linkStyle:o,onMouseEnterLink:a,onMouseLeaveLink:u,onMouseMoveLink:l,onMouseDownLink:c,onMouseUpLink:f,onClickLink:p}=e,d=e=>cA()(e)?hA(e,{link:n,graph:t}):null;return s.a.createElement("path",{d:r,className:"rct-sankey-link "+KA(i,n,t),style:jk(jk({},KA(o,n,t)),{},{strokeWidth:n.width}),onMouseEnter:d(a),onMouseLeave:d(u),onMouseMove:d(l),onMouseDown:d(c),onMouseUp:d(f),onClick:d(p)})};qk.propTypes={graph:f.a.object,link:f.a.object,linkPath:f.a.string,linkClassName:f.a.oneOfType([f.a.string,f.a.func]),linkStyle:f.a.oneOfType([f.a.object,f.a.func]),onMouseEnterLink:f.a.func,onMouseLeaveLink:f.a.func,onMouseMoveLink:f.a.func,onMouseDownLink:f.a.func,onMouseUpLink:f.a.func,onClickLink:f.a.func};const zk=e=>{const{node:t,graph:n,nodeTerminalWidth:r,nodeTerminalDistance:i,nodeTerminalStyle:o,nodeTerminalClassName:a,nodeTerminalAttributes:u,onMouseEnterNodeTerminal:l,onMouseLeaveNodeTerminal:c,onMouseMoveNodeTerminal:f,onMouseDownNodeTerminal:p,onMouseUpNodeTerminal:d,onClickNodeTerminal:h}=e;if(!t.terminalValue)return null;const m=r=>cA()(r)?hA(r,{node:t,graph:n,props:e}):null,v=r=>KA(r,t,n,e),y=v(r)||0,g=v(i)||0,b=Math.abs(t.y1-t.y0)||0,x=(b*t.terminalValue||0)/(t.value||0)||0,w=v(o),E="rct-sankey-node-terminal "+v(a),_=v(u);return s.a.createElement("rect",Fk({x:t.x1+g,y:t.y0+(b-x)},{width:y,height:x,style:w,className:E},_,{onMouseEnter:m(l),onMouseLeave:m(c),onMouseMove:m(f),onMouseDown:m(p),onMouseUp:m(d),onClick:m(h)}))};zk.propTypes={node:f.a.object,graph:f.a.object,nodeTerminalWidth:f.a.oneOfType([f.a.bool,f.a.number]),nodeTerminalDistance:f.a.oneOfType([f.a.number,f.a.func]),nodeTerminalStyle:f.a.oneOfType([f.a.object,f.a.func]),nodeTerminalClassName:f.a.oneOfType([f.a.string,f.a.func]),nodeTerminalAttributes:f.a.oneOfType([f.a.object,f.a.func]),onMouseEnterNodeTerminal:f.a.func,onMouseLeaveNodeTerminal:f.a.func,onMouseMoveNodeTerminal:f.a.func,onMouseDownNodeTerminal:f.a.func,onMouseUpNodeTerminal:f.a.func,onClickNodeTerminal:f.a.func};const Uk=e=>{const{node:t,graph:n,nodeLabelText:r,nodeId:i,nodeLabelPlacement:o,nodeLabelDistance:a}=e,u=r=>KA(r,t,n,e),l=cA()(r)?r:i,c=u(o),f=u(a)||0,p=u(l);if(gA()(p)||pA()(p)||!1===p||""===p)return null;if(!(Tk()(p)||EA()(p)))return p;const d="rct-sankey-node-label "+u(e.nodeLabelClassName),h=u(e.nodeLabelStyle);let m,v;"above"===c?(v=jk({alignmentBaseline:"baseline",textAnchor:"middle"},h),m={x:t.x0+Math.abs(t.x1-t.x0)/2,y:t.y0-f}):"below"===c?(v=jk({alignmentBaseline:"hanging",textAnchor:"middle"},h),m={x:t.x0+Math.abs(t.x1-t.x0)/2,y:t.y1+f}):"before"===c?(v=jk({alignmentBaseline:"middle",textAnchor:"end"},h),m={x:t.x0-f,y:t.y0+Math.abs(t.y1-t.y0)/2}):(pA()(c)||"after"===c||console.warn(c+' is not a valid value for nodeLabelPlacement - defaulting to "after"'),v=jk({alignmentBaseline:"middle",textAnchor:"start"},h),m={x:t.x1+f,y:t.y0+Math.abs(t.y1-t.y0)/2});const y=d+" rct-sankey-node-label-text";return s.a.createElement("text",Fk({},m,{className:y,style:v}),p)};Uk.propTypes={node:f.a.object,graph:f.a.object,nodeLabelClassName:f.a.oneOfType([f.a.string,f.a.func]),nodeLabelStyle:f.a.oneOfType([f.a.object,f.a.func]),nodeLabelText:f.a.func,nodeId:f.a.func,nodeLabelPlacement:f.a.oneOfType([f.a.oneOf(["before","after","above","below"]),f.a.func]),nodeLabelDistance:f.a.oneOfType([f.a.number,f.a.func])};const Vk=e=>{const{link:t,graph:n,linkLabelClassName:r,linkLabelStyle:i,linkLabelAttributes:o,linkLabelStartOffset:a,linkLabelText:u,linkPathId:l}=e,c=r=>KA(r,t,n,e),f="rct-sankey-link-label "+c(r||""),p=c(i||{}),d=c(o||{}),h=c(a||0);return s.a.createElement("text",Fk({className:f,style:p},d),s.a.createElement("textPath",{startOffset:h,xlinkHref:"#"+l},c(u)))};Vk.propTypes={link:f.a.object,graph:f.a.object,linkLabelClassName:f.a.oneOfType([f.a.string,f.a.func]),linkLabelStyle:f.a.oneOfType([f.a.object,f.a.func]),linkLabelAttributes:f.a.oneOfType([f.a.object,f.a.func]),linkLabelStartOffset:f.a.oneOfType([f.a.string,f.a.number]),linkLabelText:f.a.func,linkPathId:f.a.string};const Wk=e=>{const{x:t,y:n,stepLabelPadding:r,stepLabelText:i,stepLabelClassName:o,stepLabelStyle:a,step:u}=e;let l=n;return EA()(r)&&(l-=r),s.a.createElement("text",{className:"rct-step-label "+KA(o,u),style:KA(a,u),x:t,y:l,key:`step-${t}-${u}`},KA(i,u))};Wk.propTypes={x:f.a.number,y:f.a.number,stepLabelPadding:f.a.number,stepLabelText:f.a.oneOfType([f.a.string,f.a.func]),stepLabelClassName:f.a.oneOfType([f.a.string,f.a.func]),stepLabelStyle:f.a.oneOfType([f.a.object,f.a.func]),step:f.a.string};const Yk=e=>{const t=Mk()(e,["standalone"]);return e.standalone?s.a.createElement("svg",t):s.a.createElement("g",t)};function Xk(e,t){return`link-${t(e.source)}-to-${t(e.target)}`}Yk.propTypes={standalone:f.a.bool};const Hk={left:function(e){return e.depth},right:function(e,t){return t-1-e.height},center:function(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?Qe(e.sourceLinks,pk)-1:0},justify:dk};class Gk extends s.a.Component{static getDerivedStateFromProps(e,t){const{prevProps:n}=t;if(["nodes","links","width","height","marginTop","marginBottom","marginLeft","marginRight","nodeId","nodeWidth","nodePadding","nodeAlignment"].some(t=>e[t]!==n[t])){return{graph:Gk.makeSankeyGraph(e),prevProps:Pk()(e)}}return null}static makeSankeyGraph(e){const t=e.width-(e.marginLeft+e.marginRight),n=e.height-(e.marginTop+e.marginBottom),r=Sk().size([t,n]).nodeId(e.nodeId).nodeWidth(e.nodeWidth).nodePadding(e.nodePadding).nodeAlign(Hk[e.nodeAlignment]||Hk.justify)({nodes:e.shouldClone?Pk()(e.nodes):e.nodes,links:e.shouldClone?Pk()(e.links):e.links});return(i=r).nodes.forEach(e=>{const t=(e.sourceLinks||[]).reduce((e,t)=>e+t.value,0);e.terminalValue=Math.max(e.value-t,0)}),i.links.forEach(e=>{e.valueSourceRelative=(e.value||0)/NA()(e,"source.value",0),e.valueTargetRelative=(e.value||0)/NA()(e,"target.value",0)}),i.maxDepth=RA()(i.nodes,"depth"),i.maxDepth=i.nodes.reduce((e,t)=>Math.max(t.depth||0,e),0),i;var i}constructor(e){super(e);const t=Gk.makeSankeyGraph(e),n=Pk()(e);this.state={graph:t,prevProps:n}}render(){const{width:e,height:t,style:n,standalone:r,nodeId:i,marginTop:o,marginBottom:a,marginLeft:u,marginRight:l}=this.props,{graph:c}=this.state,f=mE().source(Ak).target(kk),p="rct-sankey-diagram "+this.props.className,d=e-(u+l),h=t-(o+a);function m(e,t,n){return e?s.a.createElement("g",{className:t},(c.nodes||[]).map((t,r)=>{if(!KA(e,t,c))return null;const o="node-"+i(t);return n(t,r,o)})):null}function v(e,t,n){return e?s.a.createElement("g",{className:t},(c.links||[]).map((t,r)=>{if(!KA(e,t,c))return null;const o=`link-${i(t.source)}-to-${i(t.target)}`;return n(t,r,o)})):null}return s.a.createElement(Yk,{standalone:r,width:e,height:t,className:p,style:n},s.a.createElement("g",{width:d,height:h,transform:`translate(${u}, ${o})`},function(e,t,n,r,i){if(!e)return null;const o={},a={};return i.forEach(e=>{o[e.depth]=e.x0,a[e.depth]=a[e.depth]?Math.min(e.y0,a[e.depth]):e.y0}),s.a.createElement("g",{className:"rct-step-labels",width:d,height:100},Nk()(o,(i,o)=>{const u={y:a[o],step:o,x:i,stepLabelText:e,stepLabelClassName:t,stepLabelPadding:r,stepLabelStyle:n};return s.a.createElement(Wk,Fk({key:"rct-step-"+o},u))}))}(this.props.stepLabelText,this.props.stepLabelClassName,this.props.stepLabelStyle,this.props.stepLabelPadding,c.nodes),v(this.props.showLinks,"rct-sankey-links",(e,t,n)=>{const r=jk(jk({},this.props),{},{key:n,graph:c,link:e,linkPath:f(e)});return s.a.createElement(qk,r)}),m(this.props.showNodes,"rct-sankey-nodes",(e,t,n)=>s.a.createElement(Bk,Fk({},this.props,{key:n,graph:c,node:e}))),";",m(this.props.showNodeTerminals,"rct-sankey-node-terminals",(e,t,n)=>s.a.createElement(zk,Fk({},this.props,{key:n,graph:c,node:e}))),";",this.props.showLinkLabels||this.props.showLinkSourceLabels||this.props.showLinkTargetLabels?s.a.createElement("defs",null,c.links.map(e=>{if(!(KA(this.props.showLinkLabels,e,c)||KA(this.props.showLinkSourceLabels,e,c)||KA(this.props.showLinkTargetLabels,e,c)))return null;const t=f(e),n=Xk(e,i)+"-path";return s.a.createElement("path",{id:n,d:t,key:n})})):null,v(this.props.showLinkLabels,"rct-sankey-link-labels",(e,t,n)=>{const r=Xk(e,i)+"-path",o=jk(jk({},this.props),{},{key:n,graph:c,link:e,linkPathId:r});return s.a.createElement(Vk,o)}),m(this.props.showNodeLabels,"rct-sankey-node-labels",(e,t,n)=>s.a.createElement(Uk,Fk({},this.props,{key:n,graph:c,node:e}))),";",v(this.props.showLinkSourceLabels,"rct-sankey-link-source-labels",(e,t,n)=>{const r=Xk(e,i)+"-path",o=jk(jk({},this.props),{},{key:n,graph:c,link:e,linkPathId:r}),a=jk(jk({},o),{},{linkLabelText:this.props.linkSourceLabelText,linkLabelClassName:this.props.linkSourceLabelClassName,linkLabelStyle:this.props.linkSourceLabelStyle,linkLabelAttributes:this.props.linkSourceLabelAttributes,linkLabelStartOffset:this.props.linkSourceLabelStartOffset});return s.a.createElement(Vk,a)}),v(this.props.showLinkTargetLabels,"rct-sankey-link-target-labels",(e,t,n)=>{const r=Xk(e,i)+"-path",o=jk(jk({},this.props),{},{key:n,graph:c,link:e,linkPathId:r}),a=jk(jk({},o),{},{linkLabelText:this.props.linkTargetLabelText,linkLabelClassName:this.props.linkTargetLabelClassName,linkLabelStyle:jk({textAnchor:"end"},this.props.linkTargetLabelStyle),linkLabelAttributes:this.props.linkTargetLabelAttributes,linkLabelStartOffset:this.props.linkTargetLabelStartOffset});return s.a.createElement(Vk,a)})))}}Ik(Gk,"propTypes",{nodes:f.a.arrayOf(f.a.object).isRequired,links:f.a.arrayOf(f.a.shape({source:f.a.oneOfType([f.a.string,f.a.number]),target:f.a.oneOfType([f.a.string,f.a.number]),value:f.a.number})).isRequired,width:f.a.number.isRequired,height:f.a.number.isRequired,shouldClone:f.a.bool,className:f.a.string,style:f.a.object,standalone:f.a.bool,marginTop:f.a.number,marginBottom:f.a.number,marginLeft:f.a.number,marginRight:f.a.number,showNodes:f.a.oneOfType([f.a.bool,f.a.func]),nodeId:f.a.func,nodeWidth:f.a.number,nodePadding:f.a.number,nodeAlignment:f.a.oneOf(["left","right","center","justify"]),nodeClassName:f.a.oneOfType([f.a.string,f.a.func]),nodeStyle:f.a.oneOfType([f.a.object,f.a.func]),onMouseEnterNode:f.a.func,onMouseLeaveNode:f.a.func,onMouseMoveNode:f.a.func,onMouseDownNode:f.a.func,onMouseUpNode:f.a.func,onClickNode:f.a.func,showLinks:f.a.oneOfType([f.a.bool,f.a.func]),linkClassName:f.a.oneOfType([f.a.string,f.a.func]),linkStyle:f.a.oneOfType([f.a.object,f.a.func]),onMouseEnterLink:f.a.func,onMouseLeaveLink:f.a.func,onMouseMoveLink:f.a.func,onMouseDownLink:f.a.func,onMouseUpLink:f.a.func,onClickLink:f.a.func,showNodeTerminals:f.a.oneOfType([f.a.bool,f.a.func]),nodeTerminalWidth:f.a.oneOfType([f.a.bool,f.a.number]),nodeTerminalDistance:f.a.oneOfType([f.a.number,f.a.func]),nodeTerminalClassName:f.a.oneOfType([f.a.string,f.a.func]),nodeTerminalStyle:f.a.oneOfType([f.a.object,f.a.func]),nodeTerminalAttributes:f.a.oneOfType([f.a.object,f.a.func]),onMouseEnterNodeTerminal:f.a.func,onMouseLeaveNodeTerminal:f.a.func,onMouseMoveNodeTerminal:f.a.func,onMouseDownNodeTerminal:f.a.func,onMouseUpNodeTerminal:f.a.func,onClickNodeTerminal:f.a.func,showNodeLabels:f.a.oneOfType([f.a.bool,f.a.func]),nodeLabelPlacement:f.a.oneOfType([f.a.oneOf(["before","after","above","below"]),f.a.func]),nodeLabelDistance:f.a.oneOfType([f.a.number,f.a.func]),nodeLabelText:f.a.func,nodeLabelClassName:f.a.oneOfType([f.a.string,f.a.func]),nodeLabelStyle:f.a.oneOfType([f.a.object,f.a.func]),showLinkLabels:f.a.oneOfType([f.a.bool,f.a.func]),linkLabelText:f.a.func,linkLabelClassName:f.a.oneOfType([f.a.string,f.a.func]),linkLabelStyle:f.a.oneOfType([f.a.object,f.a.func]),linkLabelAttributes:f.a.oneOfType([f.a.object,f.a.func]),linkLabelStartOffset:f.a.oneOfType([f.a.string,f.a.number]),showLinkSourceLabels:f.a.oneOfType([f.a.bool,f.a.func]),linkSourceLabelText:f.a.func,linkSourceLabelClassName:f.a.oneOfType([f.a.string,f.a.func]),linkSourceLabelStyle:f.a.oneOfType([f.a.object,f.a.func]),linkSourceLabelAttributes:f.a.oneOfType([f.a.object,f.a.func]),linkSourceLabelStartOffset:f.a.oneOfType([f.a.string,f.a.number]),showLinkTargetLabels:f.a.oneOfType([f.a.bool,f.a.func]),linkTargetLabelText:f.a.func,linkTargetLabelClassName:f.a.oneOfType([f.a.string,f.a.func]),linkTargetLabelStyle:f.a.oneOfType([f.a.object,f.a.func]),linkTargetLabelAttributes:f.a.oneOfType([f.a.object,f.a.func]),linkTargetLabelStartOffset:f.a.oneOfType([f.a.string,f.a.number]),stepLabelText:f.a.oneOfType([f.a.string,f.a.func]),stepLabelClassName:f.a.oneOfType([f.a.string,f.a.func]),stepLabelStyle:f.a.oneOfType([f.a.object,f.a.func]),stepLabelPadding:f.a.number}),Ik(Gk,"defaultProps",{width:400,height:300,shouldClone:!0,className:"",style:{},standalone:!0,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,nodeId:e=>e.index,showNodes:!0,nodeWidth:12,nodePadding:8,stepLabelPadding:8,nodeAlignment:"justify",nodeClassName:"",nodeStyle:{},showLinks:!0,linkClassName:"",linkStyle:{},showNodeTerminals:!0,nodeTerminalWidth:5,nodeTerminalDistance:1,nodeTerminalClassName:"",nodeTerminalStyle:{},nodeTerminalAttributes:{rx:2,ry:2},showNodeLabels:!0,nodeLabelPlacement:(e,t)=>e.depthUA()(e,"name")?e.name:UA()(e,"label")?e.label:KA(n.nodeId,e,t,n),nodeLabelClassName:"",nodeLabelStyle:{},showLinkLabels:!1,linkLabelText:(e,t,n)=>{const r=e.value||0,i=cl(".1~f",r)(r);return`${KA(n.nodeLabelText,e.source,t,n)}→${KA(n.nodeLabelText,e.target,t,n)}: ${i}`},linkLabelClassName:"",linkLabelStyle:{},linkLabelAttributes:{},linkLabelStartOffset:"25%",showLinkSourceLabels:!1,linkSourceLabelText:(e,t,n)=>{const r=e.valueSourceRelative;if(null===r||!isFinite(r))return"";return`${r<.001?"<0.1%":ll(".1~%")(r)} to ${KA(n.nodeLabelText,e.target,t,n)}`},linkSourceLabelClassName:"",linkSourceLabelStyle:{},linkSourceLabelAttributes:{},linkSourceLabelStartOffset:"2%",showLinkTargetLabels:!1,linkTargetLabelText:(e,t,n)=>{const r=e.valueTargetRelative;if(null===r||!isFinite(r))return"";return`${r<.001?"<0.1%":ll(".1~%")(r)} from ${KA(n.nodeLabelText,e.source,t,n)}`},linkTargetLabelClassName:"",linkTargetLabelStyle:{},linkTargetLabelAttributes:{},linkTargetLabelStartOffset:"98%"});var Kk=n(318),$k=n.n(Kk),Jk=n(20),Zk=n.n(Jk);function Qk(){return(Qk=Object.assign||function(e){for(var t=1;t{const{node:t,getLabel:n,nodeStyle:r,labelStyle:i,minLabelWidth:o,minLabelHeight:a,NodeLabelComponent:u,parentNames:l}=e,{depth:c,parent:f,x0:p,y0:d,x1:h,y1:m}=t,v=NA()(f,"data.name"),y=`rct-tree-map-node node-depth-${c} ${f?`node-group-${$k()(v)} node-group-i-${l.indexOf(v)}`:""}`,g={position:"absolute",width:h-p,height:m-d,top:d,left:p,transition:"all .2s"},b=cA()(r)?r(t):Zk()(r)?r:{};Object.assign(g,b);const x=["onClick","onMouseEnter","onMouseLeave","onMouseMove"].reduce((n,r)=>{const i=e[r+"Node"];return i&&(n[r]=i.bind(null,t)),n},{});return s.a.createElement("div",Qk({className:y,style:g},x),h-p>o&&m-d>a?s.a.createElement(u,{node:t,getLabel:n,labelStyle:i}):null)};eC.propTypes={node:f.a.shape({parent:f.a.object,children:f.a.array,value:f.a.number,depth:f.a.number,x:f.a.number,y:f.a.number,dx:f.a.number,dy:f.a.number,x0:f.a.number,y0:f.a.number,x1:f.a.number,y1:f.a.number}),nodeStyle:f.a.oneOfType([f.a.func,f.a.object]),minLabelWidth:f.a.number,minLabelHeight:f.a.number,getLabel:mA,labelStyle:f.a.oneOfType([f.a.func,f.a.object]),NodeLabelComponent:f.a.func,parentNames:f.a.arrayOf(f.a.string)},eC.defaultProps={minLabelWidth:0,minLabelHeight:0};var tC=eC;function nC(){return(nC=Object.assign||function(e){for(var t=1;t{const{node:t,getLabel:n,labelStyle:r}=e,{x1:i,x0:o}=t,a={width:i-o},u=cA()(r)?r(t):Zk()(r)?r:{};return Object.assign(a,u),s.a.createElement("div",nC({className:"rct-node-label"},{style:a}),HA(n)(t))};rC.propTypes={node:f.a.object,getLabel:mA,labelStyle:f.a.oneOfType([f.a.func,f.a.object]),minLabelWidth:f.a.number,minLabelHeight:f.a.number};var iC=rC;function oC(){return(oC=Object.assign||function(e){for(var t=1;tcA()(r)?r(e):Tk()(r)?e[r]:0);return t(i?o.sort(i):o).descendants()}static getStateFromProps(e){return{tree:function(e){const{width:t,height:n,ratio:r,round:i,padding:o}=e,a=pA()(r)?bm:bm.ratio(r),s=vm().tile(a).size([t,n]);pA()(o)||s.paddingOuter(o);pA()(i)||s.round(i);return s}(e),rootNode:function(e,t){const{getChildren:n}=t;return Eh(e,HA(n))}(Pk()(e.data),e),prevProps:Pk()(e)}}static getDerivedStateFromProps(e,t){const{width:n,height:r,data:i,sticky:o}=t.prevProps;return o&&n===e.width&&r===e.height&&JSON.stringify(i)===JSON.stringify(e.data)?null:sC.getStateFromProps(e)}constructor(e){super(e),this.state=sC.getStateFromProps(e)}render(){const{width:e,height:t,nodeStyle:n,labelStyle:r,getLabel:i,minLabelWidth:o,minLabelHeight:a,onClickNode:u,onMouseEnterNode:l,onMouseLeaveNode:c,onMouseMoveNode:f,NodeComponent:p,NodeLabelComponent:d}=this.props,{rootNode:h,tree:m}=this.state,v=sC.initTreemap(h,m,this.props),y={position:"relative",width:e,height:t},g=kA()(Nk()(v,"parent.data.name"));return s.a.createElement("div",oC({className:"rct-tree-map"},{style:y}),v.map((e,t)=>s.a.createElement(p,{node:e,nodeStyle:n,minLabelWidth:o,minLabelHeight:a,labelStyle:r,getLabel:i,parentNames:g,NodeLabelComponent:d,onClickNode:u,onMouseEnterNode:l,onMouseLeaveNode:c,onMouseMoveNode:f,key:"node-"+t})))}}aC(sC,"propTypes",{width:f.a.number.isRequired,height:f.a.number.isRequired,data:f.a.object.isRequired,getValue:mA,getChildren:mA,getLabel:mA,sort:f.a.func,padding:f.a.number,round:f.a.bool,sticky:f.a.bool,ratio:f.a.number,nodeStyle:f.a.oneOfType([f.a.func,f.a.object]),labelStyle:f.a.oneOfType([f.a.func,f.a.object]),minLabelWidth:f.a.number,minLabelHeight:f.a.number,onClickNode:f.a.func,onMouseEnterNode:f.a.func,onMouseLeaveNode:f.a.func,onMouseMoveNode:f.a.func,NodeComponent:f.a.func,NodeLabelComponent:f.a.func}),aC(sC,"defaultProps",{getValue:"value",getChildren:"children",getLabel:"name",minLabelWidth:0,minLabelHeight:0,NodeComponent:tC,NodeLabelComponent:iC});var uC=sC,lC=n(63),cC=n.n(lC),fC=n(319),pC=n.n(fC),dC=n(78),hC=n.n(dC),mC=n(199),vC=n.n(mC),yC=n(200),gC=n.n(yC);const bC={top:0,bottom:0,left:0,right:0};function xC(e={},t){const n=Object.keys(e).find(e=>!!e.match(new RegExp(t,"i")));if(void 0!==n)return e[n]}function wC(e,t={}){return Math.max(e-((xC(t,"left")||0)+(xC(t,"right")||0)),0)}function EC(e,t={}){return Math.max(e-((xC(t,"top")||0)+(xC(t,"bottom")||0)),0)}function _C({width:e,height:t}={},n={}){return{width:wC(e,n),height:EC(t,n)}}function SC(e,t){return t?pC()(e,(e,n)=>t+hC()(n)):e}function AC(e=[],t){return e.reduce((e,t)=>vC()(e,(n,r)=>(e[r]||0)+(t[r]||0)),gC()(SC(bC,t)))}var kC=n(320),CC=n.n(kC),TC=n(4),DC=n.n(TC),MC=n(96),OC=n.n(MC);function PC(e){return NA()({number:"linear",time:"time",categorical:"ordinal"},e,"ordinal")}function LC(e){return NA()({linear:"number",log:"number",pow:"number",time:"time",ordinal:"categorical"},e,"categorical")}function NC(e){if(!Array.isArray(e))throw new Error("invalid domain, inferDataTypeFromDomain cannot infer data type");return 2!==e.length?"categorical":e.every(EA.a)?"number":e.every(SA.a)?"time":"categorical"}function FC(e){return e.ticks?SA()(e.domain()[0])?"time":e.base?"log":e.exponent?"pow":"linear":"ordinal"}function RC(e){switch(e){case"linear":return xv();case"time":return xb();case"ordinal":return sv();case"log":return Mv();case"pow":return Bv();default:return}}function jC(e){return cA()(e)&&cA()(e.domain)&&cA()(e.range)}function IC(e,t,n=10){return"ordinal"===(t||FC(e))?e.domain():e.ticks(n)}function BC(e,{ticks:t,tickCount:n,nice:r}={}){const i=FC(e),o=e.domain();return r&&"ordinal"!==i&&(e=e.copy().domain(o).nice(n||10)),Array.isArray(t)?ek([e.domain(),nk(t,XA.a,LC(i))]):r&&"ordinal"!==i?e.domain():void 0}function qC(e,t){return jC(e)&&jC(t)?OC()(e.domain(),t.domain())&&OC()(e.range(),t.range()):e===t}function zC(e,t){const n=e.domain(),r=n.map(t=>e(t));if(r.length<=1)return n[0];r[0]>r[1]&&(n.reverse(),r.reverse());return n[function(e,t){return t.reduce((n,r,i)=>Math.abs(r-e)e&&s.a.isValidElement(e)?t(e.props,e.type,...n):null))}function HC(e){return CC()(e,e=>pA()(e)||gA()(e))}function GC(e){var t,n;return n=t=class extends s.a.Component{constructor(...e){super(...e),WC(this,"_makeScales",({width:e,height:t,xScaleType:n,yScaleType:r,invertXScale:i,invertYScale:o,xDomain:a,yDomain:s,xScale:u,yScale:l,marginTop:c,marginBottom:f,marginLeft:p,marginRight:d,spacingTop:h,spacingBottom:m,spacingLeft:v,spacingRight:y})=>{const g={top:h,bottom:m,left:v,right:y},b={top:c,bottom:f,left:p,right:d},x=wC(e,b),w=EC(t,b);let E=u,_=l;if(!jC(E)){const e=function(e,t={}){const n=xC(t,"left")||0;return[Math.min(n,e),Math.min(n+wC(e,t),e)]}(x,g).map(e=>e-(g.left||0));E=RC(n).domain(a).range(e),i&&E.domain(E.domain().reverse())}if(!jC(l)){const e=function(e,t={}){const n=xC(t,"top")||0;return[Math.min(n+EC(e,t),e),Math.min(n,e)]}(w,g).map(e=>e-(g.top||0));_=RC(r).domain(s).range(e),o&&_.domain(_.domain().reverse())}return{xScale:E,yScale:_}})}_resolveScaleType(e,t){let{xScaleType:n,yScaleType:r}=e;const i=()=>[n,r].every(YC);if(i())return{xScaleType:n,yScaleType:r};if(cA()(t.getScaleType)){const o=HC(t.getScaleType(e));if(({xScaleType:n,yScaleType:r}=Object.assign(o,HC({xScaleType:n,yScaleType:r}))),i())return{xScaleType:n,yScaleType:r}}if(!YC(n)&&QA(e.xDomain)&&(n=PC(NC(e.xDomain))),!YC(r)&&QA(e.yDomain)&&(r=PC(NC(e.yDomain))),i())return{xScaleType:n,yScaleType:r};if(Array.isArray(e.data)||Array.isArray(e.datasets)){const t=Array.isArray(e.datasets)?e.datasets:[e.data];if(YC(n)||(n=PC(ZA(t,GA(e.x)))),YC(r)||(r=PC(ZA(t,GA(e.y)))),i())return{xScaleType:n,yScaleType:r}}if(s.a.Children.count(e.children)){const t=XC(e.children,this._resolveScaleType.bind(this));if(!YC(n)){const e=MA()(kA()(t.map(e=>e.xScaleType)));1===!e.length&&console.warn("Multiple children with different X scale types found - defaulting to 'ordinal'"),n=1===e.length?e[0]:"ordinal"}if(!YC(r)){const e=MA()(kA()(t.map(e=>e.yScaleType)));1===!e.length&&console.warn("Multiple children with different Y scale types found - defaulting to 'ordinal'"),r=1===e.length?e[0]:"ordinal"}}return{xScaleType:n,yScaleType:r}}_resolveDomain(e,t,n,r){let{xDomain:i,yDomain:o}=e;const{includeXZero:a,includeYZero:u}=e,l=LC(n),c=LC(r),f=()=>QA(i,l),p=()=>QA(o,c),d=()=>f()&&p();if(d())return{xDomain:i,yDomain:o};if(cA()(t.getDomain)){const{xDomain:a,yDomain:s}=t.getDomain(VC(VC({},e),{},{xScaleType:n,yScaleType:r}));f()||!a||QA(a,l)||console.warn(`Component.getDomain returned an invalid domain for data type '${l}': ${a} - ignoring`),!f()&&QA(a,l)&&(i=a),p()||!s||QA(s,c)||console.warn(`Component.getDomain returned an invalid domain for data type '${c}': ${s} - ignoring`),!p()&&QA(s,c)&&(o=s)}if(!d()&&(Array.isArray(e.data)||Array.isArray(e.datasets))){const t=Array.isArray(e.datasets)?e.datasets:[e.data];f()||(i=ik(t,GA(e.x),l)),p()||(o=ik(t,GA(e.y),c))}if(!d()&&s.a.Children.count(e.children)){const t=XC(e.children,this._resolveDomain.bind(this),n,r);if(!f()){const e=MA()(t.map(e=>e.xDomain));i=ek(e,l)}if(!p()){const e=MA()(t.map(e=>e.yDomain));o=ek(e,c)}}return d()&&(a&&!cC()(0,...i)&&(i[0]<0&&i[1]<0?i[1]=0:i[0]=0),u&&!cC()(0,...o)&&(o[0]<0&&o[1]<0?o[1]=0:o[0]=0)),{xDomain:i,yDomain:o}}_resolveTickDomain(e,t,{xScaleType:n,yScaleType:r,xDomain:i,yDomain:o,xScale:a,yScale:u}){if(cA()(t.getTickDomain)){return HC(t.getTickDomain(VC({xScaleType:n,yScaleType:r,xDomain:i,yDomain:o,xScale:a,yScale:u},e)))}if(s.a.Children.count(e.children)){const t=XC(e.children,this._resolveTickDomain.bind(this),{xScaleType:n,yScaleType:r,xDomain:i,yDomain:o,xScale:a,yScale:u}),s=MA()(t.map(e=>e.xTickDomain)),l=s.length?ek(s,LC(n)):void 0,c=MA()(t.map(e=>e.yTickDomain));return HC({xTickDomain:l,yTickDomain:c.length?ek(c,LC(r)):void 0})}return{}}_resolveMargin(e,t,{xScaleType:n,yScaleType:r,xDomain:i,yDomain:o,xScale:a,yScale:u}){let{marginTop:l,marginBottom:c,marginLeft:f,marginRight:p}=e;const d=()=>[l,c,f,p].every(EA.a);if(d())return{marginTop:l,marginBottom:c,marginLeft:f,marginRight:p};if(cA()(t.getMargin)){const s=HC(t.getMargin(VC(VC({},e),{},{xScaleType:n,yScaleType:r,xDomain:i,yDomain:o,xScale:a,yScale:u})));if(({marginTop:l,marginBottom:c,marginLeft:f,marginRight:p}=Object.assign(s,HC({marginTop:l,marginBottom:c,marginLeft:f,marginRight:p}))),d())return{marginTop:l,marginBottom:c,marginLeft:f,marginRight:p}}if(s.a.Children.count(e.children)){const t=tk(XC(e.children,this._resolveMargin.bind(this),{xScaleType:n,yScaleType:r,xDomain:i,yDomain:o,xScale:a,yScale:u}).map(e=>({top:e.marginTop,bottom:e.marginBottom,left:e.marginLeft,right:e.marginRight})));l=pA()(l)?t.top:l,c=pA()(c)?t.bottom:c,f=pA()(f)?t.left:f,p=pA()(p)?t.right:p}return{marginTop:l,marginBottom:c,marginLeft:f,marginRight:p}}_resolveSpacing(e,t,{xScaleType:n,yScaleType:r,xDomain:i,yDomain:o,xScale:a,yScale:u}){let{spacingTop:l,spacingBottom:c,spacingLeft:f,spacingRight:p}=e;const d=()=>[l,c,f,p].every(EA.a);if(d())return{spacingTop:l,spacingBottom:c,spacingLeft:f,spacingRight:p};if(cA()(t.getSpacing)){const s=HC(t.getSpacing(VC(VC({},e),{},{xScaleType:n,yScaleType:r,xDomain:i,yDomain:o,xScale:a,yScale:u})));if(({spacingTop:l,spacingBottom:c,spacingLeft:f,spacingRight:p}=Object.assign(s,HC({spacingTop:l,spacingBottom:c,spacingLeft:f,spacingRight:p}))),d())return{spacingTop:l,spacingBottom:c,spacingLeft:f,spacingRight:p}}if(s.a.Children.count(e.children)){const t=tk(XC(e.children,this._resolveSpacing.bind(this),{xScaleType:n,yScaleType:r,xDomain:i,yDomain:o,xScale:a,yScale:u}).map(e=>({top:e.spacingTop,bottom:e.spacingBottom,left:e.spacingLeft,right:e.spacingRight})));l=pA()(l)?t.top:l,c=pA()(c)?t.bottom:c,f=pA()(f)?t.left:f,p=pA()(p)?t.right:p}return d()?{spacingTop:l,spacingBottom:c,spacingLeft:f,spacingRight:p}:void 0}render(){const{props:t}=this,{width:n,height:r,invertXScale:i,invertYScale:o}=t,{xScaleType:a,yScaleType:u}=this._resolveScaleType(t,e);let{xDomain:l,yDomain:c}=this._resolveDomain(t,e,a,u);i&&(l=l.slice().reverse()),o&&(c=c.slice().reverse());let f={width:n,height:r,xScaleType:a,yScaleType:u,xDomain:l,yDomain:c,invertXScale:i,invertYScale:o,marginTop:t.marginTop,marginBottom:t.marginBottom,marginLeft:t.marginLeft,marginRight:t.marginRight,spacingTop:t.spacingTop,spacingBottom:t.spacingBottom,spacingLeft:t.spacingLeft,spacingRight:t.spacingRight,xScale:t.xScale,yScale:t.yScale},p=this._makeScales(f);const{xScale:d,yScale:h}=p,{xTickDomain:m,yTickDomain:v}=this._resolveTickDomain(t,e,{xScaleType:a,yScaleType:u,xDomain:l,yDomain:c,xScale:d,yScale:h});QA(m,LC(a))&&(l=ek([l,m],LC(a))),QA(v,LC(u))&&(c=ek([c,v],LC(u))),f=VC(VC({},f),{},{xDomain:l,yDomain:c}),p=this._makeScales(f);const{marginTop:y,marginBottom:g,marginLeft:b,marginRight:x}=DC()(this._resolveMargin(t,e,{xScaleType:a,yScaleType:u,xDomain:l,yDomain:c,xScale:p.xScale,yScale:p.yScale}),{marginTop:0,marginBottom:0,marginLeft:0,marginRight:0}),{spacingTop:w,spacingBottom:E,spacingLeft:_,spacingRight:S}=DC()(this._resolveSpacing(t,e,{xScaleType:a,yScaleType:u,xDomain:l,yDomain:c,xScale:p.xScale,yScale:p.yScale}),{spacingTop:0,spacingBottom:0,spacingLeft:0,spacingRight:0});f=VC(VC({},f),{},{marginTop:y,marginBottom:g,marginLeft:b,marginRight:x,spacingTop:w,spacingBottom:E,spacingLeft:_,spacingRight:S});const{xScale:A,yScale:k}=this._makeScales(f),C=Object.assign({},this.props,{xScale:A,yScale:k,xDomain:l,yDomain:c,xScaleType:a,yScaleType:u,marginTop:y,marginBottom:g,marginLeft:b,marginRight:x,spacingTop:w,spacingBottom:E,spacingLeft:_,spacingRight:S});return s.a.createElement(e,C)}},WC(t,"propTypes",{xScale:f.a.func,yScale:f.a.func,marginTop:f.a.number,marginBottom:f.a.number,marginLeft:f.a.number,marginRight:f.a.number,spacingTop:f.a.number,spacingBottom:f.a.number,spacingLeft:f.a.number,spacingRight:f.a.number,invertXScale:f.a.bool,invertYScale:f.a.bool,width:f.a.number,height:f.a.number}),WC(t,"getScaleType",e.getScaleType),WC(t,"getSpacing",e.getSpacing),WC(t,"getDomain",e.getDomain),WC(t,"getMargin",e.getMargin),WC(t,"defaultProps",e.defaultProps),n}function KC(){return(KC=Object.assign||function(e){for(var t=1;t{const n=this.props[e];if(!cA()(n))return;n(function(e,{xScale:t,yScale:n,height:r,width:i,marginTop:o,marginBottom:a,marginLeft:s,marginRight:u}){const l=e.currentTarget.getBoundingClientRect(),c=Math.round(e.clientX-l.left),f=Math.round(e.clientY-l.top),p=c-(s||0),d=f-(o||0),h=_C({width:i,height:r},{top:o,bottom:a,left:s,right:u}),m=FC(t),v=FC(n);return{event:e,outerX:c,outerY:f,innerX:p,innerY:d,xValue:cC()(p,0,h.width)?"ordinal"===m?zC(t,p):t.invert(p):null,yValue:cC()(d,0,h.height)?"ordinal"===v?zC(n,d):n.invert(d):null,xScale:t,yScale:n,marginTop:o,marginBottom:a,marginLeft:s,marginRight:u}}(t,this.props))}),ZC(this,"onMouseMove",this.onXYMouseEvent.bind(this,"onMouseMove")),ZC(this,"onMouseDown",this.onXYMouseEvent.bind(this,"onMouseDown")),ZC(this,"onMouseUp",this.onXYMouseEvent.bind(this,"onMouseUp")),ZC(this,"onClick",this.onXYMouseEvent.bind(this,"onClick")),ZC(this,"onMouseEnter",this.onXYMouseEvent.bind(this,"onMouseEnter")),ZC(this,"onMouseLeave",this.onXYMouseEvent.bind(this,"onMouseLeave"))}render(){const{width:e,height:t,marginTop:n,marginBottom:r,marginLeft:i,marginRight:o,spacingTop:a,spacingBottom:u,spacingLeft:l,spacingRight:c,xyPlotContainerStyle:f,xyPlotStyle:p,xyPlotClassName:d,xScale:h,yScale:m}=this.props,v=_C({width:e,height:t},{top:n,bottom:r,left:i,right:o}),y=_C(v,{top:a,bottom:u,left:l,right:c}),g=["onMouseMove","onMouseEnter","onMouseLeave","onMouseDown","onMouseUp","onClick"],b=PA()(g.map(e=>[e,dA(e,this.props,this)])),x={xScale:h,yScale:m},w=[...g,"xyPlotContainerStyle","xyPlotStyle","xyPlotClassName"],E=JC(JC(JC({},Mk()(this.props,w)),y),x),_="rct-xy-plot "+d;return s.a.createElement("svg",KC({width:e,height:t,className:_,style:f},b),s.a.createElement("rect",KC({className:"rct-chart-background"},{width:e,height:t})),s.a.createElement("g",{transform:`translate(${i+l}, ${n+a})`,className:"rct-chart-inner"},s.a.createElement("rect",KC({transform:`translate(${-l}, ${-a})`,className:"rct-plot-background",style:p},v)),s.a.Children.map(this.props.children,e=>gA()(e)||pA()(e)?null:s.a.cloneElement(e,E))))}}ZC(QC,"propTypes",{width:f.a.number,height:f.a.number,xDomain:f.a.array,yDomain:f.a.array,xScaleType:f.a.string,yScaleType:f.a.string,invertXScale:f.a.bool,invertYScale:f.a.bool,includeXZero:f.a.bool,includeYZero:f.a.bool,marginTop:f.a.number,marginBottom:f.a.number,marginLeft:f.a.number,marginRight:f.a.number,spacingTop:f.a.number,spacingBottom:f.a.number,spacingLeft:f.a.number,spacingRight:f.a.number,onMouseMove:f.a.func,onMouseEnter:f.a.func,onMouseLeave:f.a.func,onMouseDown:f.a.func,onMouseUp:f.a.func,onClick:f.a.func,xyPlotContainerStyle:f.a.object,xyPlotStyle:f.a.object,xyPlotClassName:f.a.string,xScale:f.a.func,yScale:f.a.func,children:f.a.any}),ZC(QC,"defaultProps",{width:400,height:250,invertXScale:!1,invertYScale:!1,includeXZero:!1,includeYZero:!1,xyPlotContainerStyle:{},xyPlotStyle:{},xyPlotClassName:""});var eT=GC(QC),tT=n(201),nT=n.n(tT);const rT=["margin","scaleType","spacing","domain","style","data"];function iT(e,t,n=[],r=!0){const i=r?rT.concat(n):n,o=i.concat("scale");return nT()(Mk()(e,o),Mk()(t,o))&&i.every(n=>OC()(e[n],t[n]))&&["x","y"].every(t=>qC(NA()(e,`scale[${t}]`),NA()(e,`scale[${t}]`)))}function oT(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class aT extends s.a.Component{constructor(...e){super(...e),oT(this,"state",{bisectX:null}),oT(this,"getHovered",e=>{const t=this.state.bisectX(this.props.data,e);return this.props.data[t]})}static getBisectorState(e){return{bisectX:be(t=>KA(e.x,t)).left}}static getDerivedStateFromProps(e){return e.x?aT.getBisectorState(e):null}shouldComponentUpdate(e){return!iT(this.props,e,["lineStyle","lineClassName"])}render(){const{data:e,xScale:t,yScale:n,x:r,y:i,curve:o,lineStyle:a,lineClassName:u}=this.props,l=$w().curve(o).x((e,n)=>t(KA(r,e,n))).y((e,t)=>n(KA(i,e,t)))(e);return s.a.createElement("g",{className:"rct-line-chart "+u},s.a.createElement("path",{className:"rct-line-path",d:l,style:a}))}}function sT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uT(e){for(var t=1;t{this.props.onMouseEnterPoint(e,t)}),lT(this,"onMouseMovePoint",(e,t)=>{this.props.onMouseMovePoint(e,t)}),lT(this,"onMouseLeavePoint",(e,t)=>{this.props.onMouseLeavePoint(e,t)}),lT(this,"renderPoint",(e,t)=>{const[n,r,i]=["onMouseEnterPoint","onMouseMovePoint","onMouseLeavePoint"].map(t=>{const n=dA(t,this.props,this);return cA()(n)?hA(n,e):null}),{xScale:o,yScale:a,x:u,y:l,pointRadius:c,pointOffset:f,pointStyle:p,pointClassName:d}=this.props;let{pointSymbol:h}=this.props;const m="rct-chart-scatterplot-point "+KA(d,e,t),v=KA(p,e,t),y={className:m,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,key:"scatter-point-"+t};cA()(h)&&(h=h(e,t)),(Tk()(h)||EA()(h))&&(h=s.a.createElement("text",null,h)),"circle"===h.type&&pA()(h.props.r)&&(y.r=c);const g=o(KA(u,e,t))+f[0],b=a(KA(l,e,t))+f[1];return"circle"===h.type||"ellipse"===h.type?Object.assign(y,{cx:g,cy:b,style:uT({},v)}):"text"===h.type?Object.assign(y,{x:g,y:b,style:uT({textAnchor:"middle",dominantBaseline:"central"},v)}):Object.assign(y,{x:g,y:b,style:uT({},v)}),s.a.cloneElement(h,y)})}shouldComponentUpdate(e){return!iT(this.props,e,["pointStyle"])}render(){return s.a.createElement("g",null,this.props.data.map(this.renderPoint))}}lT(cT,"propTypes",{data:f.a.array.isRequired,x:vA,y:vA,xScale:f.a.func,yScale:f.a.func,pointRadius:f.a.number,pointSymbol:f.a.oneOfType([f.a.node,f.a.func]),pointOffset:f.a.arrayOf(f.a.number),pointStyle:f.a.oneOfType([f.a.object,f.a.func]),pointClassName:f.a.oneOfType([f.a.string,f.a.func]),onMouseEnterPoint:f.a.func,onMouseMovePoint:f.a.func,onMouseLeavePoint:f.a.func}),lT(cT,"defaultProps",{pointRadius:3,pointSymbol:s.a.createElement("circle",null),pointOffset:[0,0],pointStyle:{},pointClassName:""});var fT=n(57),pT=n.n(fT),dT=n(22),hT=n.n(dT),mT=n(97),vT=n.n(mT),yT=n(79),gT=n.n(yT);function bT(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class xT extends s.a.Component{render(){const{xScale:e,yScale:t,x:n,xEnd:r,y:i,yEnd:o,thickness:a,style:u,onMouseEnter:l,onMouseMove:c,onMouseLeave:f,onClick:p,showLabel:d,className:h,labelFormat:m,labelDistance:v,labelClassName:y}=this.props;var g,b;gT()([g=r,b=o].some(pA.a)&&[g,b].some(e=>!pA()(e)),"Bar expects an xEnd *or* yEnd prop, but not both.");const x=pA()(r)?"vertical":"horizontal",w=`rct-chart-bar rct-chart-bar-${x} ${h}`,E="rct-chart-bar-label "+(y||"");let _,S,A,k,C,T,D,M;if("horizontal"===x){S=t(i)-a/2;const o=e(n),s=e(r);_=Math.min(o,s),A=Math.abs(s-o),k=a,C=Math.max(o,s)+v,T=S+a/2+5,D="",M=r}else{_=e(n)-a/2;const r=t(i),s=t(o);S=Math.min(r,s),k=Math.abs(s-r),A=a,C=_+a/2,T=S-v,D="middle",M=o}const O=s.a.createElement("rect",{x:_,y:S,className:w,width:A,height:k,style:u,onMouseEnter:l,onMouseMove:c,onMouseLeave:f,onClick:p}),P=s.a.createElement("text",{textAnchor:D,x:C,y:T,className:E},m?m(M):M);return d?s.a.createElement("g",null,O,P):O}}function wT(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}bT(xT,"propTypes",{x:f.a.oneOfType([f.a.number,f.a.string,f.a.instanceOf(Date)]),y:f.a.oneOfType([f.a.number,f.a.string,f.a.instanceOf(Date)]),xEnd:f.a.oneOfType([f.a.number,f.a.string,f.a.instanceOf(Date)]),yEnd:f.a.oneOfType([f.a.number,f.a.string,f.a.instanceOf(Date)]),thickness:f.a.number,className:f.a.string,style:f.a.object,onMouseMove:f.a.func,onMouseEnter:f.a.func,onMouseLeave:f.a.func,onClick:f.a.func,xScale:f.a.func,yScale:f.a.func,showLabel:f.a.bool,labelFormat:f.a.func,labelDistance:f.a.number,labelClassName:f.a.string}),bT(xT,"defaultProps",{x:0,y:0,thickness:8,className:"",style:{},labelDistance:24});class ET extends s.a.Component{static getDomain(e){const{xScaleType:t,yScaleType:n,horizontal:r,data:i,x:o,xEnd:a,y:s,yEnd:u}=e;return{[(r?"x":"y")+"Domain"]:ok(i,GA(r?o:s),GA(r?a:u),LC(r?t:n))}}static getSpacing(e){const{barThickness:t,horizontal:n,x:r,y:i,xScale:o,yScale:a,data:s,xDomain:u,yDomain:l}=e,c=t/2,f=n?l:u,p=n?a:o,d=nk(s,GA(n?i:r)),[h,m]=[pT()(f),hT()(f)].map(p).sort(),[v,y]=[pT()(d),hT()(d)].map(p).sort(),[g,b]=[vT()(c-(m-y),0,c),vT()(c-(v-h),0,c)];return n?{spacingTop:b,spacingBottom:g,spacingLeft:0,spacingRight:0}:{spacingTop:0,spacingBottom:0,spacingLeft:b,spacingRight:g}}shouldComponentUpdate(e){return!iT(this.props,e,["barStyle"])}render(){const{xScale:e,yScale:t,data:n,horizontal:r,x:i,xEnd:o,y:a,yEnd:u,barThickness:l,barClassName:c,barStyle:f,showLabels:p,barLabelFormat:d,labelDistance:h,labelClassName:m}=this.props;return s.a.createElement("g",null,n.map((n,v)=>{const[y,g,b,x]=["onMouseEnterBar","onMouseMoveBar","onMouseLeaveBar","onClick"].map(e=>{const t=NA()(this.props,e);return cA()(t)?hA(t,n):null}),w={x:KA(i,n,v),y:KA(a,n,v),xEnd:r?KA(o,n,v):void 0,yEnd:r?void 0:KA(u,n,v),xScale:e,yScale:t,key:"chart-bar-"+v,onMouseEnter:y,onMouseMove:g,onMouseLeave:b,onClick:x,thickness:l,showLabel:p,labelFormat:d,labelDistance:h,labelClassName:KA(m,n,v),className:"rct-chart-bar "+(KA(c,n,v)||""),style:KA(f,n,v)};return s.a.createElement(xT,w)}))}}function _T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ST(e){for(var t=1;t{const[p,d,h]=["onMouseEnterBar","onMouseMoveBar","onMouseLeaveBar"].map(e=>{const t=NA()(this.props,e);return cA()(t)?hA(t,n):null});return s.a.createElement(DT,{xScale:e,yScale:t,className:"rct-chart-area-bar "+KA(l,n,f),style:KA(c,n,f),x:r?0:KA(i,n,f),xEnd:KA(r?i:o,n,f),y:r?KA(a,n,f):0,yEnd:KA(r?u:a,n,f),key:"rct-chart-area-bar-"+f,onMouseEnter:p,onMouseMove:d,onMouseLeave:h})}))}}function PT(){return(PT=Object.assign||function(e){for(var t=1;t{this.props.onMouseEnterLine(e,t)}),LT(this,"onMouseMoveLine",(e,t)=>{this.props.onMouseMoveLine(e,t)}),LT(this,"onMouseLeaveLine",(e,t)=>{this.props.onMouseLeaveLine(e,t)}),LT(this,"renderRangeValueLine",(e,t)=>{const[n,r,i]=["onMouseEnterLine","onMouseMoveLine","onMouseLeaveLine"].map(t=>{const n=dA(t,this.props,this);return cA()(n)?hA(n,e):null}),{x:o,xEnd:a,y:u,yEnd:l,horizontal:c,xScale:f,yScale:p,lineClassName:d,lineStyle:h}=this.props,m=f(GA(o)(e)),v=p(GA(u)(e)),y=pA()(a)?0:f(GA(a)(e)),g=pA()(l)?0:p(GA(l)(e)),[b,x]=[m,v],w=c?m:y,E=c?g:v,_="marker-line-"+t;return[b,w,x,E].every(e=>null!==e&&isFinite(e))?s.a.createElement("line",PT({className:""+KA(d,e,t),style:KA(h,e,t)},{x1:b,x2:w,y1:x,y2:E,key:_,onMouseEnter:n,onMouseMove:r,onMouseLeave:i})):null}),LT(this,"renderValueValueLine",(e,t)=>{const[n,r,i]=["onMouseEnterLine","onMouseMoveLine","onMouseLeaveLine"].map(t=>{const n=dA(t,this.props,this);return cA()(n)?hA(n,e):null}),{x:o,y:a,horizontal:u,lineLength:l,xScale:c,yScale:f,lineClassName:p,lineStyle:d}=this.props,h=c(GA(o)(e)),m=f(GA(a)(e)),v=u?h:h-l/2,y=u?h:h+l/2,g=u?m-l/2:m,b=u?m+l/2:m,x="marker-line-"+t;return[v,y,g,b].every(e=>null!==e&&isFinite(e))?s.a.createElement("line",PT({className:""+KA(p,e,t),style:KA(d,e,t)},{x1:v,x2:y,y1:g,y2:b,key:x,onMouseEnter:n,onMouseMove:r,onMouseLeave:i})):null})}static getSpacing(e){if("RangeValue"===NT(e))return{spacingTop:0,spacingRight:0,spacingBottom:0,spacingLeft:0};const{lineLength:t,horizontal:n,data:r,xDomain:i,yDomain:o,xScale:a,yScale:s,x:u,y:l}=e,c=t/2,f=n?o:i,p=n?s:a,d=nk(r,GA(n?l:u)),[h,m]=[pT()(f),hT()(f)].map(p).sort(),[v,y]=[pT()(d),hT()(d)].map(p).sort(),[g,b]=[vT()(c-(m-y),0,c),vT()(c-(v-h),0,c)];return n?{spacingTop:b,spacingBottom:g,spacingLeft:0,spacingRight:0}:{spacingTop:0,spacingBottom:0,spacingLeft:b,spacingRight:g}}static getDomain(e){if("RangeValue"===NT(e)){const{data:t,x:n,xEnd:r,y:i,yEnd:o,xScaleType:a,yScaleType:s,horizontal:u}=e;return{[(u?"y":"x")+"Domain"]:ok(t,GA(u?i:n),GA(u?o:r),LC(u?s:a))}}return{}}shouldComponentUpdate(e){return!iT(this.props,e,[])}render(){const e=NT(this.props);return s.a.createElement("g",{className:"rct-marker-line-chart"},"RangeValue"===e?this.props.data.map(this.renderRangeValueLine):this.props.data.map(this.renderValueValueLine))}}LT(FT,"propTypes",{data:f.a.array.isRequired,x:vA,y:vA,xEnd:vA,yEnd:vA,horizontal:f.a.bool,lineLength:f.a.number,xScaleType:f.a.string,yScaleType:f.a.string,xScale:f.a.func,yScale:f.a.func,lineClassName:f.a.oneOfType([f.a.string,f.a.func]),lineStyle:f.a.oneOfType([f.a.object,f.a.func]),onMouseEnterLine:f.a.func,onMouseMoveLine:f.a.func,onMouseLeaveLine:f.a.func}),LT(FT,"defaultProps",{horizontal:!1,lineLength:10,lineClassName:"",lineStyle:{}});var RT=n(321),jT=n.n(RT);function IT(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class BT extends s.a.Component{static getDomain(e){const{data:t,x:n,y:r,yEnd:i}=e,o={x:GA(n),y:GA(r),yEnd:GA(i)};return{yDomain:ek([nk(t,o.y),nk(t,o.yEnd)])}}shouldComponentUpdate(e){return!iT(this.props,e,["pathStyle","pathStylePositive","pathStyleNegative"])}render(){const{data:e,x:t,y:n,yEnd:r,xScale:i,yScale:o,isDifference:a,pathStyle:u,pathStylePositive:l,pathStyleNegative:c,shouldShowGaps:f,pathClassName:p,isDefined:d,curve:h}=this.props,m={x:GA(t),y:GA(n),yEnd:GA(r)},v=Jw();f&&v.defined((e,t)=>d(e,t,m)),v.x((e,t)=>i(m.x(e,t))).y0((e,t)=>o(m.y(e,t))).y1((e,t)=>o(m.yEnd(e,t))),h&&v.curve(h);const y=v(e);if(a){v.y0(this.props.height);const t=v(e);v.y0(0);const n=v(e),r=jT()(),i="clip-above-area-"+r,o="clip-below-area-"+r,a=l||u||{},f=c||u||{};return s.a.createElement("g",{className:"rct-area-chart--difference"},s.a.createElement("clipPath",{id:i},s.a.createElement("path",{className:"rct-area-chart-path",d:n})),s.a.createElement("clipPath",{id:o},s.a.createElement("path",{className:"rct-area-chart-path",d:t})),s.a.createElement("path",{className:"rct-area-chart-path "+p,d:y,clipPath:`url(#${i})`,style:a}),s.a.createElement("path",{className:"rct-area-chart-path "+p,d:y,clipPath:`url(#${o})`,style:f}))}return s.a.createElement("g",{className:"rct-area-chart"},s.a.createElement("path",{className:"rct-area-chart-path "+p,d:y,style:u||{}}))}}IT(BT,"propTypes",{data:f.a.array.isRequired,x:vA,y:vA,yEnd:vA,pathClassName:f.a.string,pathStyle:f.a.object,isDifference:f.a.bool,pathStylePositive:f.a.object,pathStyleNegative:f.a.object,shouldShowGaps:f.a.bool,isDefined:f.a.func,xScale:f.a.func,yScale:f.a.func,xScaleType:f.a.string,yScaleType:f.a.string,height:f.a.number,curve:f.a.func}),IT(BT,"defaultProps",{shouldShowGaps:!0,isDefined:(e,t,n)=>!pA()(n.y(e,t))&&!pA()(n.yEnd(e,t)),pathClassName:"",pathStyle:{}});var qT=n(322),zT=n.n(qT),UT=n(144),VT=n.n(UT);function WT(){return(WT=Object.assign||function(e){for(var t=1;t{const l=d(p(e)),h=XT(XT({},KA(c,e,r)),{},{fill:l}),m=""+KA(f,e,r),v="heatmap-rect-"+r;return s.a.createElement(DT,WT({x:KA(i,e,r),xEnd:KA(o,e,r),y:KA(a,e,r),yEnd:KA(u,e,r)},{xScale:t,yScale:n,style:h,className:m,key:v}))}))}}function $T(){return($T=Object.assign||function(e){for(var t=1;t{this.props.onMouseEnter(e)}),JT(this,"onMouseLeave",e=>{this.props.onMouseLeave(e)}),JT(this,"onMouseMove",e=>{const{xScale:t,yScale:n,onMouseMove:r}=this.props;if(!cA()(r))return;const i=this.refs.background.getBoundingClientRect();if(!i)return;const[o,a]=[e.clientX-(i.left||0),e.clientY-(i.top||0)],[s,u]=[t.invert(o),n.invert(a)];r(e,{xVal:s,yVal:u})})}static getDomain(e){const{data:t,x:n,xEnd:r,y:i,yEnd:o}=e;return{x:Oe(TA()([t.map(GA(n)),t.map(GA(r))])),y:Oe(TA()([t.map(GA(i)),t.map(GA(o))]))}}shouldComponentUpdate(e){return!iT(this.props,e,["rectStyle"])}render(){const{data:e,area:t,x:n,xEnd:r,y:i,yEnd:o,xScale:a,yScale:u,scaleWidth:l,scaleHeight:c,rectClassName:f,rectStyle:p}=this.props,[d,h,m,v,y]=[t,n,r,i,o].map(GA),g=this.props.unitsPerPixel||Math.max.apply(this,e.map((e,s)=>KA(t,e,s)/Math.abs((a(KA(r,e,s))-a(KA(n,e,s)))*(u(KA(o,e,s))-u(KA(i,e,s)))))),b={onMouseMove:dA("onMouseMove",this.props,this),onMouseEnter:dA("onMouseEnter",this.props,this),onMouseLeave:dA("onMouseLeave",this.props,this)};return s.a.createElement("g",$T({className:"rct-area-heatmap-chart"},b),s.a.createElement("rect",{x:"0",y:"0",width:l,height:c,ref:"background",fill:"transparent"}),e.map((e,l)=>{const[c,d,h,m,v]=[n,r,i,o,t].map(t=>KA(t,e,l)),y=Math.abs(a(d)-a(c)),b=Math.abs(u(m)-u(h)),x=Math.min(a(d),a(c)),w=Math.min(u(m),u(h)),E=v/g,_=Math.sqrt(E*(y/b)),S=Math.sqrt(E*(b/y)),A=x+(y-_)/2,k=w+(b-S)/2;if(![A,k,_,S].every(e=>null!==e&&isFinite(e)))return null;const C="rct-area-heatmap-rect "+KA(f,e,l),T=KA(p,e,l),D="rect-"+l;return s.a.createElement("rect",{x:A,y:k,width:_,height:S,className:C,style:T,key:D})}))}}function QT(){return(QT=Object.assign||function(e){for(var t=1;te.length).length]}}static computeHistogram(e,t,n,r,i){let o=Ye().value(n).thresholds(t);if(r)i&&console.warn("Warning: if binDomain is defined and nice = true, histogram prioritizes binDomain and disregards nice."),o=o.domain(r);else if(i){const t=xv().domain(Oe(e)).nice().ticks();o=o.domain([pT()(t),hT()(t)])}return o(e)}shouldComponentUpdate(e){return!iT(this.props,e,[])}render(){const{value:e,data:t,thresholds:n,binDomain:r,nice:i}=this.props,o=tD.computeHistogram(t,n,e,r,i);return o?s.a.createElement(OT,QT({},this.props,{data:o,x:nD,xEnd:rD,y:iD})):s.a.createElement("g",null)}}function nD(e){return e.x0}function rD(e){return e.x1}function iD(e){return e.length}function oD(){return(oD=Object.assign||function(e){for(var t=1;te[0],y:e=>500*e[1]}))}}aD(sD,"propTypes",{data:f.a.array.isRequired,bandwidth:f.a.number,sampleCount:f.a.number,lineStyle:f.a.object,lineClassName:f.a.string,x:vA,xScale:f.a.func,yScale:f.a.func}),aD(sD,"defaultProps",{bandwidth:.5,sampleCount:null,lineClassName:"",lineStyle:{}});var uD=sD;function lD(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class cD extends s.a.Component{static getDomain(e){const{data:t,xScaleType:n,yScaleType:r,x:i,y:o,horizontal:a}=e,[s,u]=[GA(i),GA(o)],[l,c]=[LC(n),LC(r)];return a?{xDomain:ek([nk(t,s,l),nk(t,(e,t)=>-s(e,t),l)]),yDomain:nk(t,u,c)}:{xDomain:nk(t,s,l),yDomain:ek([nk(t,u,c),nk(t,(e,t)=>-u(e,t),c)])}}shouldComponentUpdate(e){return!iT(this.props,e,[])}render(){const{data:e,xScale:t,yScale:n,color:r,pathStyle:i,x:o,y:a,horizontal:u,pathClassName:l}=this.props,c=Jw();u?c.x0((e,n)=>t(-KA(o,e,n))).x1((e,n)=>t(KA(o,e,n))).y((e,t)=>n(KA(a,e,t))):c.x((e,n)=>t(KA(o,e,n))).y0((e,t)=>n(-KA(a,e,t))).y1((e,t)=>n(KA(a,e,t)));const f=iv(Xb).domain(VT()(10));return s.a.createElement("g",{className:"rct-funnel-chart"},e.map((t,n)=>{if(0===n)return null;const o=c([e[n-1],t]),a=r?KA(r,t,n):f(n-1);let u=KA(i,t,n);return u=DC()({},u,{fill:a,stroke:"transparent"}),s.a.createElement("path",{d:o,className:""+(KA(l,t,n)||""),style:u,key:n})}))}}function fD(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}lD(cD,"propTypes",{data:f.a.array.isRequired,x:vA,y:vA,color:f.a.oneOfType([f.a.string,f.a.func]),horizontal:f.a.bool,pathClassName:f.a.oneOfType([f.a.string,f.a.func]),pathStyle:f.a.oneOfType([f.a.object,f.a.func]),xScale:f.a.func,yScale:f.a.func}),lD(cD,"defaultProps",{pathClassName:"",pathStyle:{}});class pD extends s.a.Component{render(){const{xScale:e,value:t,yScale:n,yLimit:r,yDomain:i,height:o,style:a,spacingTop:u,spacingBottom:l}=this.props,c="rct-chart-line-x "+this.props.className,f=e(t);let p=-u,d=o+l;return void 0!==r&&(p=n(i[0])+l,d=n(r)),s.a.createElement("line",{x1:f,x2:f,y1:p,y2:d,className:c,style:a})}}function dD(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}fD(pD,"propTypes",{height:f.a.number,xScale:f.a.func,value:f.a.oneOfType([f.a.number,f.a.string,f.a.instanceOf(Date)]).isRequired,yScale:f.a.func,yLimit:f.a.oneOfType([f.a.number,f.a.string,f.a.instanceOf(Date)]),yDomain:f.a.array,spacingTop:f.a.number,spacingBottom:f.a.number,style:f.a.object,className:f.a.string}),fD(pD,"defaultProps",{style:{},className:"",spacingTop:0,spacingBottom:0});class hD extends s.a.Component{render(){const{width:e,yScale:t,value:n,xScale:r,xLimit:i,spacingLeft:o,spacingRight:a,style:u}=this.props,l="rct-chart-line-y "+(this.props.className||""),c=t(n),f=void 0===i?e+a:r(i);return s.a.createElement("line",{x1:-o,x2:f,y1:c,y2:c,className:l,style:u})}}function mD(e){const{width:t,height:n,xScale:r,yScale:i,spacingTop:o,spacingBottom:a,spacingLeft:s,spacingRight:u,position:l,placement:c,ticks:f,tickCount:p,tickLength:d,tickClassName:h,tickStyle:m,title:v,titleDistance:y,titleAlign:g,titleRotate:b,titleStyle:x,labelDistance:w,labelClassName:E,labelStyle:_,labelFormat:S,labelFormats:A,labelOffset:k,labels:C,gridLineClassName:T,gridLineStyle:D,onMouseEnterLabel:M,onMouseMoveLabel:O,onMouseLeaveLabel:P,onMouseClickLabel:L}=e;return{ticksProps:{width:t,height:n,xScale:r,yScale:i,ticks:f,tickCount:p,spacingTop:o,spacingBottom:a,spacingLeft:s,spacingRight:u,position:l,placement:c,tickLength:d,tickStyle:m,tickClassName:h},gridProps:{width:t,height:n,xScale:r,yScale:i,ticks:f,tickCount:p,spacingTop:o,spacingBottom:a,spacingLeft:s,spacingRight:u,lineClassName:T,lineStyle:D},labelsProps:{width:t,height:n,xScale:r,yScale:i,ticks:f,tickCount:p,spacingTop:o,spacingBottom:a,spacingLeft:s,spacingRight:u,position:l,placement:c,labels:C,labelClassName:E,labelStyle:_,distance:w,format:S,formats:A,offset:k,onMouseEnterLabel:M,onMouseMoveLabel:O,onMouseLeaveLabel:P,onMouseClickLabel:L},titleProps:{width:t,height:n,position:l,placement:c,title:v,spacingTop:o,spacingBottom:a,spacingLeft:s,spacingRight:u,style:x,distance:y,alignment:g,rotate:b}}}function vD(e,t,n){gT()("x"===e||"y"===e,"axisType should be either x or y.");const r=t.currentTarget.getBoundingClientRect(),i=FC(n),o=Math.round(t.clientY-r.top),a=Math.round(t.clientX-r.left),s="y"===e,u=s?o:a,l=s?r.height:r.width,c=cC()(u,0,l)?"ordinal"===i?zC(n,u):n.invert(u):null,f={event:t,outerX:a,outerY:o};return s?(f.yValue=c,f.yScale=n):(f.xValue=c,f.xScale=n),f}dD(hD,"propTypes",{yScale:f.a.func,width:f.a.number,value:f.a.oneOfType([f.a.number,f.a.string,f.a.instanceOf(Date)]).isRequired,xScale:f.a.func,xLimit:f.a.oneOfType([f.a.number,f.a.string,f.a.instanceOf(Date)]),spacingLeft:f.a.number,spacingRight:f.a.number,style:f.a.object,className:f.a.string}),dD(hD,"defaultProps",{style:{},className:"",spacingLeft:0,spacingRight:0});var yD=n(323),gD=n.n(yD),bD=n(80),xD=n.n(bD),wD=n(62),ED=n.n(wD),_D=n(65),SD=n.n(_D);const AD=document.createElement("canvas"),kD=(e,t)=>{if(!t.unit)return SD.a.parse(`${e.value*t.value}${e.unit}`);const n=["%","ch","cm","em","ex"];if(-1!==n.indexOf(t.unit))throw new Error(`We do not currently support the unit ${t.unit}\n from the provided line-height ${t.value}.\n Unsupported units include ${n.join(", ")}.`);return"px"===t.unit?t:SD.a.parse(SD.a.convert(t,"px"))};var CD=({text:e,fontFamily:t,fontSize:n,lineHeight:r,fontWeight:i=400,fontStyle:o="normal",canvas:a=AD})=>{const s=a.getContext("2d");s.font=`${i} ${o} ${n} ${t}`;const u=e=>({text:e,width:SD.a.parse(s.measureText(e).width+"px"),height:kD(SD.a.parse(n),SD.a.parse(r))});return Array.isArray(e)?e.map(u).reduce((e,t)=>({width:t.width.value>e.width.value?t.width:e.width,height:SD.a.parse(`${e.height.value+t.height.value}${t.height.unit}`),text:t.text.length>e.text.length?t.text:e.text})):u(e)};function TD(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class DD extends s.a.Component{static getLabel(e){const{value:t,format:n}=e,r=DC()(e.style,DD.defaultProps.style),i=n(t),o=Object.assign({text:i},r),a=CD(o);return{value:e.value,text:a.text,height:a.height.value,width:a.width.value}}render(){const{value:e,format:t}=this.props,n=Mk()(this.props,["value","format"]);return s.a.createElement("text",n,s.a.Children.count(this.props.children)?this.props.children:t(e))}}TD(DD,"propTypes",{value:f.a.any,format:f.a.func,children:f.a.any}),TD(DD,"defaultProps",{format:XA.a,style:{fontFamily:"Helvetica, sans-serif",fontSize:"20px",lineHeight:1,textAnchor:"middle"}});var MD=n(324),OD=n.n(MD),PD=n(202),LD=n.n(PD),ND=n(203),FD=n.n(ND);function RD(e){return"ordinal"===e?[XA.a]:"time"===e?["%Y","'%y","%b %Y","%m/%Y"]:["~s",",d",".1~f",".2~f",".4~f",".6~f"]}function jD(e,t){return e.map(e=>Tk()(e)?"time"===t?t=>tg(e)(t):t=>ll(e)(t):e)}function ID(e){const t=Nk()(e,"text");return kA()(t).length===t.length}function BD(e){return OD()(e).reduce((t,n,r)=>function(e,t){if(![e,t].every(e=>Array.isArray(e)&&2===e.length&&e.every(e=>null!==e&&isFinite(e))&&e[0]<=e[1]))throw new Error("checkRangesOverlap expects 2 range arrays with 2 numbers each, first <= second");return e[0]<=t[1]&&t[0]<=e[1]}(e[r],n)?t+1:t,0)}function qD(e,t,n="middle"){const r=e(t.value)+({start:0,middle:-.5,end:-1}[n]||0)*t.width;return[r,r+t.width]}function zD(e,t,n="middle"){return FD()(t,([t,r],i)=>{const[o,a]=function(e,t,n="middle"){const[r,i]=qD(e,t,n);return[Math.ceil(Math.max(LD()(e.range())-r,0)),Math.ceil(Math.max(i-xD()(e.range()),0))]}(e,i,n);return[Math.max(t,o),Math.max(r,a)]},[0,0])}function UD(e,t,n="middle"){return FD()(t,([t,r],i)=>{const[o,a]=function(e,t,n="middle"){const[r,i]=function(e,t,n="middle"){const r=e(t.value)+({top:0,middle:-.5,bottom:-1}[n]||0)*t.height;return[r,r+t.height]}(e,t,n);return[Math.ceil(Math.max(LD()(e.range())-r,0)),Math.ceil(Math.max(i-xD()(e.range()),0))]}(e,i,n);return[Math.max(t,o),Math.max(r,a)]},[0,0])}function VD(){return(VD=Object.assign||function(e){for(var t=1;tMath.ceil(o+e.height))),[l,c]=zD(n,a,"middle");return DC()({["margin"+ED()(r)]:u,marginLeft:l,marginRight:c},s)}static getLabels(e){const{tickCount:t,labelStyle:n,xScale:r}=DC()(e,{},XD.defaultProps),i=e.ticks||IC(r,null,t),o={labelStyle:n,defaultStyle:XD.defaultProps.labelStyle},a=e.format?[e.format]:e.formats,s=FC(r),u=jD(Array.isArray(a)&&a.length?a:RD(s),s),{labels:l}=function(e,t,n=[],r,i=!0){let o;const a=[],s=n.find(n=>{const i=t.map((e,t)=>DD.getLabel({value:e,format:n,style:DC()(KA(r.labelStyle,{value:e},t),r.defaultStyle)})),s=ID(i);if(!s)return a.push({labels:i,format:n,areLabelsDistinct:s}),!1;const u=BD(i.map(t=>qD(e,t,r.textAnchor||"middle")));return u?(a.push({labels:i,format:n,areLabelsDistinct:s,collisionCount:u}),!1):(o=i,!0)});if(!pA()(s))return{labels:o,format:s,areLabelsDistinct:!0,collisionCount:0};if(!i)return{attempts:a};const u=a.filter(e=>e.areLabelsDistinct);return 0===u.length?hT()(a):gD()(u,"collisionCount")}(r,i,u,o);return l}shouldComponentUpdate(e){return!iT(this.props,e)}render(){const{height:e,xScale:t,position:n,distance:r,labelStyle:i,labelClassName:o,spacingTop:a,spacingBottom:u,offset:l}=this.props,c=this.props.labels||XD.getLabels(this.props),f=this.props.placement||("top"===n?"above":"below"),p="rct-chart-value-label rct-chart-value-label-x "+o,d="bottom"===n?`translate(0, ${e+u})`:`translate(0, ${-a})`;return s.a.createElement("g",{className:"rct-chart-value-labels-x",transform:d},c.map((e,n)=>{const o=t(e.value)+l,a="above"===f?-e.height-r:r,[u,c,d,h]=["onMouseEnterLabel","onMouseMoveLabel","onMouseLeaveLabel","onMouseClickLabel"].map(t=>{const n=NA()(this.props,t);return cA()(n)?hA(n,e.value):null}),m=DC()({textAnchor:"middle"},KA(i,function(e){for(var t=1;ts.a.createElement(pD,{height:e,xScale:t,className:f,spacingTop:o,spacingBottom:a,spacingLeft:u,spacingRight:l,value:n,style:i,key:"grid-x-line-"+r})))}}function eM(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}ZD(QD,"propTypes",{width:f.a.number,height:f.a.number,xScale:f.a.func,spacingTop:f.a.number,spacingBottom:f.a.number,spacingLeft:f.a.number,spacingRight:f.a.number,nice:f.a.bool,ticks:f.a.array,tickCount:f.a.number,lineClassName:f.a.string,lineStyle:f.a.object}),ZD(QD,"defaultProps",{nice:!0,lineStyle:{}});class tM extends s.a.Component{static getTickDomain(e){if(!e.xScale)return;const t=DC()({},e,tM.defaultProps);return{xTickDomain:BC(t.xScale,t)}}static getMargin(e){const{tickLength:t,position:n}=DC()({},e,tM.defaultProps),r=e.placement||("top"===n?"above":"below"),i={marginTop:0,marginBottom:0,marginLeft:0,marginRight:0};return"bottom"===n&&"above"===r||"top"===n&&"below"===r?i:DC()({["margin"+ED()(n)]:t||0},i)}render(){const{height:e,xScale:t,tickCount:n,position:r,tickLength:i,tickStyle:o,tickClassName:a,spacingTop:u,spacingBottom:l}=this.props,c=this.props.placement||("top"===r?"above":"below"),f=this.props.ticks||IC(t,null,n),p="rct-chart-tick rct-chart-tick-x "+(a||""),d="bottom"===r?`translate(0, ${e+(l||0)})`:`translate(0, ${-u||0})`;return s.a.createElement("g",{className:"rct-chart-ticks-x",transform:d},f.map((e,n)=>{const r=t(e),a="above"===c?-i:i;return s.a.createElement("line",{x1:r,x2:r,y1:0,y2:a,className:p,style:o,key:"tick-"+n})}))}}function nM(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}eM(tM,"propTypes",{height:f.a.number,xScale:f.a.func,position:f.a.oneOf(["bottom","top"]),placement:f.a.oneOf(["above","below"]),ticks:f.a.array,tickCount:f.a.number,tickLength:f.a.number,tickStyle:f.a.object,tickClassName:f.a.string,spacingTop:f.a.number,spacingBottom:f.a.number,nice:f.a.bool}),eM(tM,"defaultProps",{position:"bottom",nice:!0,tickLength:5,tickStyle:{},tickClassName:""});const rM=vD.bind(null,"x");class iM extends s.a.Component{constructor(...e){super(...e),nM(this,"handleOnMouseMove",e=>{const{onMouseMoveAxis:t,xScale:n}=this.props;if(!cA()(t))return;t(rM(e,n))}),nM(this,"handleOnMouseEnter",e=>{const{onMouseEnterAxis:t,xScale:n}=this.props;if(!cA()(t))return;t(rM(e,n))}),nM(this,"handleOnMouseLeave",e=>{const{onMouseLeaveAxis:t,xScale:n}=this.props;if(!cA()(t))return;t(rM(e,n))}),nM(this,"handleOnClick",e=>{const{onMouseClickAxis:t,xScale:n}=this.props;if(!cA()(t))return;t(rM(e,n))})}static getTickDomain(e){if(!e.xScale)return;const t=DC()({},e,iM.defaultProps);return{xTickDomain:BC(t.xScale,t)}}static getMargin(e){const{ticksProps:t,labelsProps:n,titleProps:r}=mD(e),i=[];return e.showTicks&&i.push(tM.getMargin(t)),e.showTitle&&e.title&&i.push(JD.getMargin(r)),e.showLabels&&i.push(HD.getMargin(n)),AC(i,"margin")}shouldComponentUpdate(e){return!iT(this.props,e)}render(){const{width:e,height:t,position:n,spacingTop:r,spacingBottom:i,spacingLeft:o,spacingRight:a,tickLength:u,titleDistance:l,labelDistance:c,showTitle:f,showLabels:p,showTicks:d,showGrid:h,showLine:m,lineStyle:v}=this.props,{ticksProps:y,gridProps:g,labelsProps:b,titleProps:x}=mD(this.props);if(b.distance=c+(d?u:0),f&&p){const e=HD.getMargin(b);x.distance=l+e["margin"+hC()(n)]}else f&&d&&(x.distance=l+u);const w="bottom"===n?t+i:-r;return s.a.createElement("g",{className:"rct-chart-axis rct-chart-axis-x",onMouseMove:this.handleOnMouseMove,onMouseEnter:this.handleOnMouseEnter,onMouseLeave:this.handleOnMouseLeave,onClick:this.handleOnClick},h?s.a.createElement(QD,g):null,d?s.a.createElement(tM,y):null,p?s.a.createElement(HD,b):null,f?s.a.createElement(JD,x):null,m?s.a.createElement("line",{className:"rct-chart-axis-line rct-chart-axis-line-x",x1:-o,x2:e+a,y1:w,y2:w,style:v}):null)}}function oM(){return(oM=Object.assign||function(e){for(var t=1;tMath.ceil(o+e.width))),[l,c]=UD(n,a,"middle");return DC()({["margin"+ED()(r)]:u,marginTop:l,marginBottom:c},s)}static getLabels(e){const{tickCount:t,labelStyle:n,yScale:r}=DC()(e,{},uM.defaultProps),i=e.ticks||IC(r,null,t),o={labelStyle:n,defaultStyle:uM.defaultProps.labelStyle},a=FC(r),s=e.format?[e.format]:e.formats,u=jD(Array.isArray(s)&&s.length?s:RD(a),a),{labels:l}=function(e,t,n=[],r,i=!0){let o;const a=[],s=n.find(e=>{const n=t.map((t,n)=>DD.getLabel({value:t,format:e,style:DC()(KA(r.labelStyle,{value:t},n),r.defaultStyle)})),i=ID(n);return i?(o=n,!0):(a.push({labels:n,format:e,areLabelsDistinct:i}),!1)});return pA()(s)?i?hT()(a):{attempts:a}:{labels:o,format:s,areLabelsDistinct:!0,collisionCount:0}}(0,i,u,o);return l}shouldComponentUpdate(e){return!iT(this.props,e)}render(){const{width:e,yScale:t,position:n,distance:r,labelStyle:i,labelClassName:o,spacingLeft:a,spacingRight:u,offset:l}=this.props,c=this.props.placement||("left"===n?"before":"after"),f="rct-chart-value-label rct-chart-value-label-y "+o,p="before"===c?"end":"start",d=this.props.labels||uM.getLabels(this.props),h="left"===n?`translate(${-a}, 0)`:`translate(${e+u}, 0)`;return s.a.createElement("g",{className:"rct-chart-value-labels-y",transform:h},d.map((e,n)=>{const o=t(e.value)+l,a="before"===c?-r:r,[u,d,h,m]=["onMouseEnterLabel","onMouseMoveLabel","onMouseLeaveLabel","onMouseClickLabel"].map(t=>{const n=NA()(this.props,t);return cA()(n)?hA(n,e.value):null}),v=DC()({textAnchor:p},KA(i,function(e){for(var t=1;ts.a.createElement(hD,{width:e,yScale:t,className:f,spacingTop:o,spacingBottom:a,spacingLeft:u,spacingRight:l,value:n,style:i,key:"grid-y-line-"+r})))}}function vM(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}hM(mM,"propTypes",{width:f.a.number,height:f.a.number,yScale:f.a.func,spacingTop:f.a.number,spacingBottom:f.a.number,spacingLeft:f.a.number,spacingRight:f.a.number,nice:f.a.bool,ticks:f.a.array,tickCount:f.a.number,lineClassName:f.a.string,lineStyle:f.a.object}),hM(mM,"defaultProps",{nice:!0,lineStyle:{}});class yM extends s.a.Component{static getTickDomain(e){if(!e.yScale)return;const t=DC()({},e,yM.defaultProps);return{yTickDomain:BC(e.yScale,t)}}static getMargin(e){const{tickLength:t,position:n}=DC()({},e,yM.defaultProps),r=e.placement||("left"===n?"before":"after"),i={marginTop:0,marginBottom:0,marginLeft:0,marginRight:0};return"left"===n&&"after"===r||"right"===n&&"before"===r?i:DC()({["margin"+ED()(n)]:t||0},i)}render(){const{width:e,yScale:t,tickCount:n,position:r,tickLength:i,tickStyle:o,tickClassName:a,spacingLeft:u,spacingRight:l}=this.props,c=this.props.placement||("left"===r?"before":"after"),f=this.props.ticks||IC(t,null,n),p="rct-chart-tick rct-chart-tick-y "+(a||""),d="right"===r?`translate(${e+(l||0)}, 0)`:`translate(${-u||0}, 0)`;return s.a.createElement("g",{className:"rct-chart-ticks-y",transform:d},f.map((e,n)=>{const r=t(e),a="before"===c?-i:i;return s.a.createElement("line",{x1:0,x2:a,y1:r,y2:r,className:p,style:o,key:"tick-"+n})}))}}function gM(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}vM(yM,"propTypes",{width:f.a.number,yScale:f.a.func,position:f.a.oneOf(["left","right"]),placement:f.a.oneOf(["before","after"]),ticks:f.a.array,tickCount:f.a.number,tickLength:f.a.number,tickStyle:f.a.object,tickClassName:f.a.string,spacingLeft:f.a.number,spacingRight:f.a.number,nice:f.a.bool}),vM(yM,"defaultProps",{position:"left",nice:!0,tickLength:5,tickStyle:{}});const bM=vD.bind(null,"y");class xM extends s.a.Component{constructor(...e){super(...e),gM(this,"handleOnMouseMove",e=>{const{onMouseMoveAxis:t,yScale:n}=this.props;if(!cA()(t))return;t(bM(e,n))}),gM(this,"handleOnMouseEnter",e=>{const{onMouseEnterAxis:t,yScale:n}=this.props;if(!cA()(t))return;t(bM(e,n))}),gM(this,"handleOnMouseLeave",e=>{const{onMouseLeaveAxis:t,yScale:n}=this.props;if(!cA()(t))return;t(bM(e,n))}),gM(this,"handleOnClick",e=>{const{onMouseClickAxis:t,yScale:n}=this.props;if(!cA()(t))return;t(bM(e,n))})}static getTickDomain(e){if(!e.yScale)return;const t=DC()({},e,xM.defaultProps);return{yTickDomain:BC(t.yScale,t)}}static getMargin(e){const{ticksProps:t,labelsProps:n,titleProps:r}=mD(e),i=[];return e.showTicks&&i.push(yM.getMargin(t)),e.showTitle&&e.title&&i.push(dM.getMargin(r)),e.showLabels&&i.push(lM.getMargin(n)),AC(i,"margin")}shouldComponentUpdate(e){return!iT(this.props,e)}render(){const{width:e,height:t,position:n,tickLength:r,titleDistance:i,labelDistance:o,showTitle:a,showLabels:u,showTicks:l,showGrid:c,spacingTop:f,spacingBottom:p,spacingLeft:d,spacingRight:h,showLine:m,lineStyle:v}=this.props,{ticksProps:y,gridProps:g,labelsProps:b,titleProps:x}=mD(this.props);if(b.distance=o+(l?r:0),a&&u){const e=lM.getMargin(b);x.distance=i+e["margin"+hC()(n)]}else a&&l&&(x.distance=i+r);const w="left"===n?-d:e+h;return s.a.createElement("g",{className:"rct-chart-axis rct-chart-axis-y",onMouseMove:this.handleOnMouseMove,onMouseEnter:this.handleOnMouseEnter,onMouseLeave:this.handleOnMouseLeave,onClick:this.handleOnClick},c?s.a.createElement(mM,g):null,l?s.a.createElement(yM,y):null,u?s.a.createElement(lM,b):null,a?s.a.createElement(dM,x):null,m?s.a.createElement("line",{className:"rct-chart-axis-line rct-chart-axis-line-y",x1:w,x2:w,y1:-f,y2:t+p,style:v}):null)}}function wM(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EM(e){const{zoomScale:t,zoomX:n,zoomY:r}=e;return MS.translate(n||0,r||0).scale(t||1)}gM(xM,"propTypes",{yScale:f.a.func,width:f.a.number,height:f.a.number,position:f.a.string,placement:f.a.string,nice:f.a.bool,ticks:f.a.array,tickCount:f.a.number,spacingTop:f.a.number,spacingBottom:f.a.number,spacingLeft:f.a.number,spacingRight:f.a.number,showTitle:f.a.bool,showLabels:f.a.bool,showTicks:f.a.bool,showGrid:f.a.bool,title:f.a.string,titleDistance:f.a.number,titleAlign:f.a.string,titleRotate:f.a.bool,titleStyle:f.a.object,labelDistance:f.a.number,labelClassName:f.a.string,labelStyle:f.a.oneOfType([f.a.func,f.a.object]),labelFormat:f.a.func,labelFormats:f.a.array,labels:f.a.array,labelOffset:f.a.number,tickLength:f.a.number,tickClassName:f.a.string,tickStyle:f.a.object,gridLineClassName:f.a.string,gridLineStyle:f.a.object,onMouseClickLabel:f.a.func,onMouseEnterLabel:f.a.func,onMouseMoveLabel:f.a.func,onMouseLeaveLabel:f.a.func,onMouseEnterAxis:f.a.func,onMouseLeaveAxis:f.a.func,onMouseMoveAxis:f.a.func,onMouseClickAxis:f.a.func,showLine:f.a.bool,lineStyle:f.a.object}),gM(xM,"defaultProps",{width:400,height:250,position:"left",nice:!0,showTitle:!0,showLabels:!0,showTicks:!0,showGrid:!0,tickLength:5,labelDistance:3,titleDistance:5,spacingTop:0,spacingBottom:0,spacingLeft:0,spacingRight:0,showLine:!0,lineStyle:{}});class _M extends s.a.Component{constructor(...e){super(...e),wM(this,"state",{lastZoomTransform:null,selection:null}),wM(this,"handleZoom",(...e)=>{const t=Sn.transform;if(this.props.controlled){const{selection:e,lastZoomTransform:t}=this.state;this.zoom.on("zoom",null),this.zoom.transform(e,t),this.zoom.on("zoom",this.handleZoom)}else this.setState({zoomKey:Math.random()});this.props.onZoom&&this.props.onZoom(t,...e)})}componentDidMount(){const e=EM(this.props),t=In(this.refs.svg);this.zoom=qS(),t.call(this.zoom),this.props.disableMouseWheelZoom?t.call(this.zoom).on("wheel.zoom",null):t.call(this.zoom),this.zoom.transform(t,e),this._updateZoomProps(),this.zoom.on("zoom",this.handleZoom),this.setState({selection:t,lastZoomTransform:e})}componentDidUpdate(e){const t=this.props;if(e.controlled){if(t.zoomX!==e.zoomX||t.zoomY!==e.zoomY||t.zoomScale!==e.zoomScale){this.zoom.on("zoom",null);const e=EM(t);this.zoom.transform(this.state.selection,e),this.zoom.on("zoom",this.handleZoom),this.setState({lastZoomTransform:e})}}this._updateZoomProps(t)}_updateZoomProps(e){let t=e;t||(t=this.props);const{extent:n,scaleExtent:r,translateExtent:i,clickDistance:o,duration:a,interpolate:s,constrain:u,filter:l,touchable:c,wheelDelta:f}=t;Array.isArray(n)&&this.zoom.extent(n),Array.isArray(r)&&this.zoom.scaleExtent(r),Array.isArray(i)&&this.zoom.translateExtent(i),null!==o&&isFinite(o)&&this.zoom.clickDistance(o),null!==a&&isFinite(a)&&this.zoom.duration(a),cA()(s)&&this.zoom.interpolate(s),cA()(u)&&this.zoom.constrain(u),cA()(l)&&this.zoom.filter(l),cA()(c)&&this.zoom.touchable(c),cA()(f)&&this.zoom.wheelDelta(f)}render(){const e=this.refs.svg?OS(this.refs.svg):null;return s.a.createElement("svg",{ref:"svg",width:this.props.width,height:this.props.height},s.a.createElement("g",{width:this.props.width,height:this.props.height,transform:e},this.props.children))}}wM(_M,"propTypes",{width:f.a.number,height:f.a.number,onZoom:f.a.func,controlled:f.a.bool,disableMouseWheelZoom:f.a.bool,zoomX:f.a.number,zoomY:f.a.number,zoomScale:f.a.number,extent:f.a.array,scaleExtent:f.a.array,translateExtent:f.a.array,clickDistance:f.a.number,duration:f.a.number,interpolate:f.a.func,constrain:f.a.func,filter:f.a.func,touchable:f.a.func,wheelDelta:f.a.func,children:f.a.any}),wM(_M,"defaultProps",{width:800,height:600,controlled:!1,disableMouseWheelZoom:!1,zoomX:0,zoomY:0,zoomScale:1});const SM={Data:i};function AM(e=100,t=0,n=10){return ue.a.reduce(ue.a.range(e-1),e=>e.concat(ue.a.last(e)+ue.a.random(-n,n)),[t])}function kM(e=100,t=0,n=10){return AM(e,t,n).map((e,t)=>[t,e])}function CM(e=100,t=0,n=10,r=new Date(2015,0,1)){let i=r;return AM(e,t,n).map(e=>(i=new Date(i.getTime()+864e5),[i,e]))}function TM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function DM(e){for(var t=1;t{this.props.onClick&&this.props.onClick(e,this.props.id)})}render(){const{codeText:e,isExpanded:t,label:n,id:i,description:a}=this.props,u=DM(DM({React:s.a,ReactDOM:l.a,d3:r,_:ue.a,randomWalk:AM,randomWalkSeries:kM,randomWalkTimeSeries:CM},o),this.props.scope);return s.a.createElement("div",{className:"row example "+(t?"example-active":"example-inactive")},s.a.createElement("div",{className:"col-md-12"},s.a.createElement("h3",{className:"example-header",onClick:this.onClick},n||i," ",t?"▼":"►"),t?s.a.createElement("div",null,a?s.a.createElement("div",{className:"example-description"},a):null,s.a.createElement(aA,{codeText:e,scope:u,noRender:!1})):null))}}MM(OM,"propTypes",{codeText:f.a.string,scope:f.a.object,isExpanded:f.a.bool,label:f.a.node,id:f.a.string,description:f.a.node,onClick:f.a.func}),MM(OM,"defaultProps",{codeText:"",scope:{},isExpanded:!0,label:"Example",id:""});var PM=n(329);function LM(){return(LM=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,LM({},e,{key:e.id}))))}}var RM=n(330);function jM(){return(jM=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,jM({},e,{key:e.id}))))}}var qM=n(331);function zM(){return(zM=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,zM({},e,{key:e.id}))))}}var WM=n(332);function YM(){return(YM=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,YM({},e,{key:e.id}))))}}var GM=n(333);function KM(){return(KM=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,KM({},e,{key:e.id}))))}}var ZM=n(334);function QM(){return(QM=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,QM({},e,{key:e.id}))))}}var nO=n(335);function rO(){return(rO=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,rO({},e,{key:e.id}))))}}var aO=n(336);function sO(){return(sO=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,sO({},e,{key:e.id}))))}}var cO=n(337);function fO(){return(fO=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,fO({},e,{key:e.id}))))}}var hO=n(338);function mO(){return(mO=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,mO({},e,{key:e.id}))))}}var gO=n(339);function bO(){return(bO=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,bO({},e,{key:e.id}))))}}n(340);n(880).default;s.a.Component;var EO=n(341);function _O(){return(_O=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,_O({},e,{key:e.id}))))}}var kO=n(342);function CO(){return(CO=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,CO({},e,{key:e.id}))))}}var MO=n(343);function OO(){return(OO=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,OO({},e,{key:e.id}))))}}var NO=n(344);function FO(){return(FO=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,FO({},e,{key:e.id}))))}}var IO=n(345);function BO(){return(BO=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,BO({},e,{key:e.id}))))}}var UO=n(346);function VO(){return(VO=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,VO({},e,{key:e.id}))))}}var XO=n(347);function HO(){return(HO=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,HO({},e,{key:e.id}))))}}var $O=n(348);function JO(){return(JO=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,JO({},e,{key:e.id}))))}}var eP=n(349);function tP(){return(tP=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,tP({},e,{key:e.id}))))}}var iP=n(350);function oP(){return(oP=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,oP({},e,{key:e.id}))))}}var uP=n(351);function lP(){return(lP=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,lP({},e,{key:e.id}))))}}var pP=n(352);function dP(){return(dP=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,dP({},e,{key:e.id}))))}}var vP=n(353);function yP(){return(yP=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,yP({},e,{key:e.id}))))}}var xP=n(354);function wP(){return(wP=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,wP({},e,{key:e.id}))))}}var SP=n(355);function AP(){return(AP=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,AP({},e,{key:e.id}))))}}var TP=n(356);function DP(){return(DP=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,DP({},e,{key:e.id}))))}}var PP=n(357);function LP(){return(LP=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,LP({},e,{key:e.id}))))}}var RP=n(358);function jP(){return(jP=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,jP({},e,{key:e.id}))))}}var qP=n(359);function zP(){return(zP=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,zP({},e,{key:e.id}))))}}var WP=n(360);function YP(){return(YP=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,YP({},e,{key:e.id}))))}}class GP extends s.a.Component{render(){const{name:e,children:t}=this.props;return s.a.createElement("div",null,s.a.createElement("h2",null,e),t)}}var KP,$P,JP;function ZP(){return(ZP=Object.assign||function(e){for(var t=1;ts.a.createElement(OM,ZP({},e,{key:e.id}))))}}class tL extends s.a.Component{render(){return s.a.createElement(GP,{name:"XY Plots",componentName:"XYPlots"},s.a.createElement("p",null,'Nearly all of the chart components included in Reactochart (except PieChart and TreeMap) are cartesian or "X/Y"-type charts. They accept an array of ',s.a.createElement("code",null,"data")," and represent these data with some form of SVG marks on a 2-dimensional X/Y coordinate plane."),s.a.createElement("p",null,"These chart components are not meant to be rendered on their own, but should instead always be wrapped in a",s.a.createElement("code",null,"<","XYPlot",">")," ","component. ",s.a.createElement("code",null,"XYPlot")," is a wrapper which iterates over all of its charts and generates a common set of X and Y"," ",s.a.createElement("a",{href:"https://github.com/d3/d3-scale"},"scales"),", which are shared and provided to its children as ",s.a.createElement("code",null,"scale")," props."," ",s.a.createElement("code",null,"XYPlot")," also accepts several other props which apply to all of its children, such as ",s.a.createElement("code",null,"width")," and"," ",s.a.createElement("code",null,"height"),"."),s.a.createElement("p",null,"Here's an example of basic ",s.a.createElement("code",null,"XYPlot")," to render a"," ",s.a.createElement("code",null,"LineChart"),":"),s.a.createElement(OM,{id:"basic",label:"XYPlot and LineChart",codeText:n(910).default}),s.a.createElement("p",null,"Generally, you will want to render a ",s.a.createElement("code",null,"XAxis")," and a"," ",s.a.createElement("code",null,"YAxis")," component along with your chart. These components render titles, labels, ticks and grid lines to denote your X and Y axes. One advantage of using a common ",s.a.createElement("code",null,"XYPlot")," wrapper is that it ensures the axis labels are using the same scales as the charts themselves, and are therefore correctly labeling them."," ",s.a.createElement("code",null,"XAxis")," and ",s.a.createElement("code",null,"YAxis")," accept several props to control how they are displayed; see their docs for more information."),s.a.createElement("p",null,"Note that the axes will take up some space in the margin around the chart. The ",s.a.createElement("code",null,"width")," and ",s.a.createElement("code",null,"height")," props provided to ",s.a.createElement("code",null,"XYPlot")," control the ",s.a.createElement("strong",null,"outer")," width of the chart, including the margin and the axes inside them. The inner size of the chart plot itself is determined by ",s.a.createElement("code",null,"XYPlot")," and passed down to children charts as (smaller) ",s.a.createElement("code",null,"width")," and"," ",s.a.createElement("code",null,"height")," props."),s.a.createElement(OM,{id:"lineChartWithAxis",label:"LineChart with axes",codeText:n(911).default}),s.a.createElement("p",null,"Another advantage of ",s.a.createElement("code",null,"XYPlot")," is that it provides a common container for rendering multiple charts together on the same axes. These can be charts of the same type (ie. multiple"," ",s.a.createElement("code",null,"LineCharts"),"), and/or multiple kinds of charts. Any of the XY-type charts in Reactochart can be rendered alongside one another inside ",s.a.createElement("code",null,"XYPlot"),"."),s.a.createElement("p",null,"Note that these charts render SVG elements, which do not respect"," ",s.a.createElement("code",null,"z-index"),"; instead their Z-order is determined by the order in which they are drawn. So if you want to draw a"," ",s.a.createElement("code",null,"BarChart")," underneath a ",s.a.createElement("code",null,"LineChart"),", put it before the ",s.a.createElement("code",null,"LineChart")," inside ",s.a.createElement("code",null,"XYPlot"),"."),s.a.createElement(OM,{id:"multiChart",label:"Multiple Charts in one XYPlot",codeText:n(912).default}))}}n(310);s.a.Component;n(914).default;s.a.Component;s.a.Component;function nL(){return(nL=Object.assign||function(e){for(var t=1;ts.a.createElement(X,{path:t,exact:!0,children:({match:n})=>s.a.createElement("li",{className:"example-link "+(n?"active":"")},s.a.createElement(ie,{to:t},e))});cL.propTypes={label:f.a.string,to:f.a.string};const fL=()=>s.a.createElement("div",{className:"sidebar-nav col-md-2",style:{backgroundColor:"#2E2F33"}},s.a.createElement("h3",null,"Lessons"),s.a.createElement("ul",{className:"nav-inverse nav-tabs nav-stacked"},rL.map((e,t)=>s.a.createElement(cL,{to:e.path,label:e.name,key:"lesson-"+t}))),s.a.createElement("h3",null,"Component Docs"),s.a.createElement("ul",{className:"nav-inverse nav-tabs nav-stacked"},iL.map((e,t)=>s.a.createElement(cL,{to:e.path,label:e.name,key:"chart-component-"+t}))),s.a.createElement("h4",null,"XY Chart Components"),s.a.createElement("ul",{className:"nav-inverse nav-tabs nav-stacked"},oL.map((e,t)=>s.a.createElement(cL,{to:e.path,label:e.name,key:"chart-component-"+t}))),s.a.createElement("h4",null,"Standalone Chart Components"),s.a.createElement("ul",{className:"nav-inverse nav-tabs nav-stacked"},aL.map((e,t)=>s.a.createElement(cL,{to:e.path,label:e.name,key:"chart-component-"+t}))),s.a.createElement("h4",null,"XY Data Components"),s.a.createElement("ul",{className:"nav-inverse nav-tabs nav-stacked"},sL.map((e,t)=>s.a.createElement(cL,{to:e.path,label:e.name,key:"data-component-"+t}))),s.a.createElement("h4",null,"XY Axis Components"),s.a.createElement("ul",{className:"nav-inverse nav-tabs nav-stacked"},uL.map((e,t)=>s.a.createElement(cL,{to:e.path,label:e.name,key:"axis-component-"+t})))),pL=()=>s.a.createElement("div",{className:"docs-home"},s.a.createElement("p",null,"Reactochart is a library of React components for creating charts and graphs, used internally at Spotify."),s.a.createElement(SL,null)),dL=()=>s.a.createElement(Z,null,s.a.createElement("div",{className:"row docs-home"},s.a.createElement(fL,null),s.a.createElement("div",{className:"col-md-10"},s.a.createElement(X,{exact:!0,path:"/",component:pL}),lL.map((e,t)=>s.a.createElement(X,{path:e.path,component:e.Component,key:t}))))),{XYPlot:hL,XAxis:mL,YAxis:vL,RangeBarChart:yL,LineChart:gL,ScatterPlot:bL,BarChart:xL,MarkerLineChart:wL,ColorHeatmap:EL,AreaHeatmap:_L}=o;class SL extends s.a.Component{render(){return s.a.createElement("div",null,s.a.createElement(hL,nL({xDomain:[-2,2],yDomain:[-2,2]},{width:400,height:400}),s.a.createElement(mL,{title:"Phase"}),s.a.createElement(vL,{title:"Intensity"}),s.a.createElement(yL,{data:ue.a.range(0,2,.03),x:e=>e,y:e=>.7*Math.sin(3*e)+1.2,yEnd:e=>Math.sin(3*e)*Math.cos(3*e)*.7+1.2,barThickness:2,barStyle:{fill:"#3690c0"}}),s.a.createElement(gL,{data:ue.a.range(-2,0,.005),x:e=>e,y:e=>1.8*Math.pow(Math.abs(Math.sin(5*e)),Math.abs(Math.sin(.25*e))),lineStyle:{stroke:"#02818a",strokeWidth:3}}),s.a.createElement(bL,{data:ue.a.range(-2,0,.05),x:e=>e,y:e=>.1*Math.pow(2,1.8*(e+2)),pointSymbol:s.a.createElement("rect",{width:5,height:5,fill:"#3690c0"})}),s.a.createElement(xL,{data:ue.a.range(0,2,.03),x:e=>e,y:e=>-Math.abs(Math.sin(4*e)*Math.cos(3*e)),barThickness:3,barStyle:{fill:"#67a9cf"}}),s.a.createElement(wL,{data:ue.a.range(0,1.5,.1),x:e=>e,y:e=>Math.cos(e),lineStyle:{stroke:"#ec7014",strokeWidth:3}}),s.a.createElement(EL,{data:ue.a.flatten(ue.a.range(-2,0,.1).map(e=>ue.a.range(-2,0,.1).map(t=>[e,t]))),value:([e,t])=>Math.sin(e*t*5),x:([e,t])=>e,xEnd:([e,t])=>e+.1,y:([e,t])=>t,yEnd:([e,t])=>t+.1,colors:["#d0d1e6","#016450"],interpolator:"lab"}),s.a.createElement(_L,{data:ue.a.flatten(ue.a.range(0,2,.1).map(e=>ue.a.range(-2,-1,.1).map(t=>[e,t]))),area:([e,t])=>-Math.sin(e*t*5),x:([e,t])=>e,xEnd:([e,t])=>e+.1,y:([e,t])=>t,yEnd:([e,t])=>t+.1,rectStyle:{fill:"#016450"}})))}}l.a.render(s.a.createElement(dL,null),document.getElementById("container"))}]);
-//# sourceMappingURL=bundle.842ca399cc199401252e.js.map
\ No newline at end of file
+ */var r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,v=r?Symbol.for("react.memo"):60115,y=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,x=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function E(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case f:case p:case a:case u:case s:case h:return e;default:switch(e=e&&e.$$typeof){case c:case d:case y:case v:case l:return e;default:return t}}case o:return t}}}function _(e){return E(e)===p}t.AsyncMode=f,t.ConcurrentMode=p,t.ContextConsumer=c,t.ContextProvider=l,t.Element=i,t.ForwardRef=d,t.Fragment=a,t.Lazy=y,t.Memo=v,t.Portal=o,t.Profiler=u,t.StrictMode=s,t.Suspense=h,t.isAsyncMode=function(e){return _(e)||E(e)===f},t.isConcurrentMode=_,t.isContextConsumer=function(e){return E(e)===c},t.isContextProvider=function(e){return E(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return E(e)===d},t.isFragment=function(e){return E(e)===a},t.isLazy=function(e){return E(e)===y},t.isMemo=function(e){return E(e)===v},t.isPortal=function(e){return E(e)===o},t.isProfiler=function(e){return E(e)===u},t.isStrictMode=function(e){return E(e)===s},t.isSuspense=function(e){return E(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===u||e===s||e===h||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===v||e.$$typeof===l||e.$$typeof===c||e.$$typeof===d||e.$$typeof===b||e.$$typeof===x||e.$$typeof===w||e.$$typeof===g)},t.typeOf=E},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"version",(function(){return ye})),n.d(r,"bisect",(function(){return _e})),n.d(r,"bisectRight",(function(){return we})),n.d(r,"bisectLeft",(function(){return Ee})),n.d(r,"ascending",(function(){return ge})),n.d(r,"bisector",(function(){return be})),n.d(r,"cross",(function(){return ke})),n.d(r,"descending",(function(){return Ce})),n.d(r,"deviation",(function(){return Me})),n.d(r,"extent",(function(){return Oe})),n.d(r,"histogram",(function(){return Ye})),n.d(r,"thresholdFreedmanDiaconis",(function(){return He})),n.d(r,"thresholdScott",(function(){return Ge})),n.d(r,"thresholdSturges",(function(){return We})),n.d(r,"max",(function(){return Ke})),n.d(r,"mean",(function(){return $e})),n.d(r,"median",(function(){return Je})),n.d(r,"merge",(function(){return Ze})),n.d(r,"min",(function(){return Qe})),n.d(r,"pairs",(function(){return Se})),n.d(r,"permute",(function(){return et})),n.d(r,"quantile",(function(){return Xe})),n.d(r,"range",(function(){return je})),n.d(r,"scan",(function(){return tt})),n.d(r,"shuffle",(function(){return nt})),n.d(r,"sum",(function(){return rt})),n.d(r,"ticks",(function(){return ze})),n.d(r,"tickIncrement",(function(){return Ue})),n.d(r,"tickStep",(function(){return Ve})),n.d(r,"transpose",(function(){return it})),n.d(r,"variance",(function(){return De})),n.d(r,"zip",(function(){return at})),n.d(r,"axisTop",(function(){return mt})),n.d(r,"axisRight",(function(){return vt})),n.d(r,"axisBottom",(function(){return yt})),n.d(r,"axisLeft",(function(){return gt})),n.d(r,"brush",(function(){return zo})),n.d(r,"brushX",(function(){return Bo})),n.d(r,"brushY",(function(){return qo})),n.d(r,"brushSelection",(function(){return Io})),n.d(r,"chord",(function(){return $o})),n.d(r,"ribbon",(function(){return ca})),n.d(r,"nest",(function(){return ha})),n.d(r,"set",(function(){return Ea})),n.d(r,"map",(function(){return da})),n.d(r,"keys",(function(){return _a})),n.d(r,"values",(function(){return Sa})),n.d(r,"entries",(function(){return Aa})),n.d(r,"color",(function(){return or})),n.d(r,"rgb",(function(){return lr})),n.d(r,"hsl",(function(){return vr})),n.d(r,"lab",(function(){return Ma})),n.d(r,"hcl",(function(){return Ia})),n.d(r,"lch",(function(){return ja})),n.d(r,"gray",(function(){return Da})),n.d(r,"cubehelix",(function(){return Ya})),n.d(r,"contours",(function(){return ts})),n.d(r,"contourDensity",(function(){return ss})),n.d(r,"dispatch",(function(){return At})),n.d(r,"drag",(function(){return hs})),n.d(r,"dragDisable",(function(){return zn})),n.d(r,"dragEnable",(function(){return Un})),n.d(r,"dsvFormat",(function(){return ws})),n.d(r,"csvParse",(function(){return _s})),n.d(r,"csvParseRows",(function(){return Ss})),n.d(r,"csvFormat",(function(){return As})),n.d(r,"csvFormatBody",(function(){return ks})),n.d(r,"csvFormatRows",(function(){return Cs})),n.d(r,"csvFormatRow",(function(){return Ts})),n.d(r,"csvFormatValue",(function(){return Ds})),n.d(r,"tsvParse",(function(){return Os})),n.d(r,"tsvParseRows",(function(){return Ps})),n.d(r,"tsvFormat",(function(){return Ls})),n.d(r,"tsvFormatBody",(function(){return Ns})),n.d(r,"tsvFormatRows",(function(){return Fs})),n.d(r,"tsvFormatRow",(function(){return Rs})),n.d(r,"tsvFormatValue",(function(){return js})),n.d(r,"autoType",(function(){return Is})),n.d(r,"easeLinear",(function(){return qs})),n.d(r,"easeQuad",(function(){return Vs})),n.d(r,"easeQuadIn",(function(){return zs})),n.d(r,"easeQuadOut",(function(){return Us})),n.d(r,"easeQuadInOut",(function(){return Vs})),n.d(r,"easeCubic",(function(){return so})),n.d(r,"easeCubicIn",(function(){return oo})),n.d(r,"easeCubicOut",(function(){return ao})),n.d(r,"easeCubicInOut",(function(){return so})),n.d(r,"easePoly",(function(){return Xs})),n.d(r,"easePolyIn",(function(){return Ws})),n.d(r,"easePolyOut",(function(){return Ys})),n.d(r,"easePolyInOut",(function(){return Xs})),n.d(r,"easeSin",(function(){return Js})),n.d(r,"easeSinIn",(function(){return Ks})),n.d(r,"easeSinOut",(function(){return $s})),n.d(r,"easeSinInOut",(function(){return Js})),n.d(r,"easeExp",(function(){return eu})),n.d(r,"easeExpIn",(function(){return Zs})),n.d(r,"easeExpOut",(function(){return Qs})),n.d(r,"easeExpInOut",(function(){return eu})),n.d(r,"easeCircle",(function(){return ru})),n.d(r,"easeCircleIn",(function(){return tu})),n.d(r,"easeCircleOut",(function(){return nu})),n.d(r,"easeCircleInOut",(function(){return ru})),n.d(r,"easeBounce",(function(){return ou})),n.d(r,"easeBounceIn",(function(){return iu})),n.d(r,"easeBounceOut",(function(){return ou})),n.d(r,"easeBounceInOut",(function(){return au})),n.d(r,"easeBack",(function(){return lu})),n.d(r,"easeBackIn",(function(){return su})),n.d(r,"easeBackOut",(function(){return uu})),n.d(r,"easeBackInOut",(function(){return lu})),n.d(r,"easeElastic",(function(){return pu})),n.d(r,"easeElasticIn",(function(){return fu})),n.d(r,"easeElasticOut",(function(){return pu})),n.d(r,"easeElasticInOut",(function(){return du})),n.d(r,"blob",(function(){return mu})),n.d(r,"buffer",(function(){return yu})),n.d(r,"dsv",(function(){return wu})),n.d(r,"csv",(function(){return Eu})),n.d(r,"tsv",(function(){return _u})),n.d(r,"image",(function(){return Su})),n.d(r,"json",(function(){return ku})),n.d(r,"text",(function(){return bu})),n.d(r,"xml",(function(){return Tu})),n.d(r,"html",(function(){return Du})),n.d(r,"svg",(function(){return Mu})),n.d(r,"forceCenter",(function(){return Ou})),n.d(r,"forceCollide",(function(){return Wu})),n.d(r,"forceLink",(function(){return Hu})),n.d(r,"forceManyBody",(function(){return Zu})),n.d(r,"forceRadial",(function(){return Qu})),n.d(r,"forceSimulation",(function(){return Ju})),n.d(r,"forceX",(function(){return el})),n.d(r,"forceY",(function(){return tl})),n.d(r,"formatDefaultLocale",(function(){return yl})),n.d(r,"format",(function(){return ll})),n.d(r,"formatPrefix",(function(){return cl})),n.d(r,"formatLocale",(function(){return vl})),n.d(r,"formatSpecifier",(function(){return ol})),n.d(r,"FormatSpecifier",(function(){return al})),n.d(r,"precisionFixed",(function(){return gl})),n.d(r,"precisionPrefix",(function(){return bl})),n.d(r,"precisionRound",(function(){return xl})),n.d(r,"geoArea",(function(){return fc})),n.d(r,"geoBounds",(function(){return rf})),n.d(r,"geoCentroid",(function(){return vf})),n.d(r,"geoCircle",(function(){return Cf})),n.d(r,"geoClipAntimeridian",(function(){return Bf})),n.d(r,"geoClipCircle",(function(){return qf})),n.d(r,"geoClipExtent",(function(){return Yf})),n.d(r,"geoClipRectangle",(function(){return zf})),n.d(r,"geoContains",(function(){return lp})),n.d(r,"geoDistance",(function(){return ep})),n.d(r,"geoGraticule",(function(){return pp})),n.d(r,"geoGraticule10",(function(){return dp})),n.d(r,"geoInterpolate",(function(){return gp})),n.d(r,"geoLength",(function(){return Jf})),n.d(r,"geoPath",(function(){return vd})),n.d(r,"geoAlbers",(function(){return Fd})),n.d(r,"geoAlbersUsa",(function(){return Rd})),n.d(r,"geoAzimuthalEqualArea",(function(){return qd})),n.d(r,"geoAzimuthalEqualAreaRaw",(function(){return Bd})),n.d(r,"geoAzimuthalEquidistant",(function(){return Ud})),n.d(r,"geoAzimuthalEquidistantRaw",(function(){return zd})),n.d(r,"geoConicConformal",(function(){return Gd})),n.d(r,"geoConicConformalRaw",(function(){return Hd})),n.d(r,"geoConicEqualArea",(function(){return Nd})),n.d(r,"geoConicEqualAreaRaw",(function(){return Ld})),n.d(r,"geoConicEquidistant",(function(){return Zd})),n.d(r,"geoConicEquidistantRaw",(function(){return Jd})),n.d(r,"geoEqualEarth",(function(){return oh})),n.d(r,"geoEqualEarthRaw",(function(){return ih})),n.d(r,"geoEquirectangular",(function(){return $d})),n.d(r,"geoEquirectangularRaw",(function(){return Kd})),n.d(r,"geoGnomonic",(function(){return sh})),n.d(r,"geoGnomonicRaw",(function(){return ah})),n.d(r,"geoIdentity",(function(){return uh})),n.d(r,"geoProjection",(function(){return Md})),n.d(r,"geoProjectionMutator",(function(){return Od})),n.d(r,"geoMercator",(function(){return Wd})),n.d(r,"geoMercatorRaw",(function(){return Vd})),n.d(r,"geoNaturalEarth1",(function(){return ch})),n.d(r,"geoNaturalEarth1Raw",(function(){return lh})),n.d(r,"geoOrthographic",(function(){return ph})),n.d(r,"geoOrthographicRaw",(function(){return fh})),n.d(r,"geoStereographic",(function(){return hh})),n.d(r,"geoStereographicRaw",(function(){return dh})),n.d(r,"geoTransverseMercator",(function(){return vh})),n.d(r,"geoTransverseMercatorRaw",(function(){return mh})),n.d(r,"geoRotation",(function(){return Sf})),n.d(r,"geoStream",(function(){return rc})),n.d(r,"geoTransform",(function(){return yd})),n.d(r,"cluster",(function(){return xh})),n.d(r,"hierarchy",(function(){return Eh})),n.d(r,"pack",(function(){return Hh})),n.d(r,"packSiblings",(function(){return zh})),n.d(r,"packEnclose",(function(){return Th})),n.d(r,"partition",(function(){return Qh})),n.d(r,"stratify",(function(){return im})),n.d(r,"tree",(function(){return fm})),n.d(r,"treemap",(function(){return vm})),n.d(r,"treemapBinary",(function(){return ym})),n.d(r,"treemapDice",(function(){return Zh})),n.d(r,"treemapSlice",(function(){return pm})),n.d(r,"treemapSliceDice",(function(){return gm})),n.d(r,"treemapSquarify",(function(){return mm})),n.d(r,"treemapResquarify",(function(){return bm})),n.d(r,"interpolate",(function(){return Vr})),n.d(r,"interpolateArray",(function(){return Lr})),n.d(r,"interpolateBasis",(function(){return xr})),n.d(r,"interpolateBasisClosed",(function(){return wr})),n.d(r,"interpolateDate",(function(){return Fr})),n.d(r,"interpolateDiscrete",(function(){return xm})),n.d(r,"interpolateHue",(function(){return wm})),n.d(r,"interpolateNumber",(function(){return Rr})),n.d(r,"interpolateNumberArray",(function(){return Or})),n.d(r,"interpolateObject",(function(){return jr})),n.d(r,"interpolateRound",(function(){return Em})),n.d(r,"interpolateString",(function(){return Ur})),n.d(r,"interpolateTransformCss",(function(){return ki})),n.d(r,"interpolateTransformSvg",(function(){return Ci})),n.d(r,"interpolateZoom",(function(){return Am})),n.d(r,"interpolateRgb",(function(){return Cr})),n.d(r,"interpolateRgbBasis",(function(){return Dr})),n.d(r,"interpolateRgbBasisClosed",(function(){return Mr})),n.d(r,"interpolateHsl",(function(){return Cm})),n.d(r,"interpolateHslLong",(function(){return Tm})),n.d(r,"interpolateLab",(function(){return Dm})),n.d(r,"interpolateHcl",(function(){return Om})),n.d(r,"interpolateHclLong",(function(){return Pm})),n.d(r,"interpolateCubehelix",(function(){return Nm})),n.d(r,"interpolateCubehelixLong",(function(){return Fm})),n.d(r,"piecewise",(function(){return Rm})),n.d(r,"quantize",(function(){return jm})),n.d(r,"path",(function(){return ia})),n.d(r,"polygonArea",(function(){return Im})),n.d(r,"polygonCentroid",(function(){return Bm})),n.d(r,"polygonHull",(function(){return Um})),n.d(r,"polygonContains",(function(){return Vm})),n.d(r,"polygonLength",(function(){return Wm})),n.d(r,"quadtree",(function(){return Iu})),n.d(r,"randomUniform",(function(){return Xm})),n.d(r,"randomNormal",(function(){return Hm})),n.d(r,"randomLogNormal",(function(){return Gm})),n.d(r,"randomBates",(function(){return $m})),n.d(r,"randomIrwinHall",(function(){return Km})),n.d(r,"randomExponential",(function(){return Jm})),n.d(r,"scaleBand",(function(){return ov})),n.d(r,"scalePoint",(function(){return sv})),n.d(r,"scaleIdentity",(function(){return wv})),n.d(r,"scaleLinear",(function(){return xv})),n.d(r,"scaleLog",(function(){return Mv})),n.d(r,"scaleSymlog",(function(){return Nv})),n.d(r,"scaleOrdinal",(function(){return iv})),n.d(r,"scaleImplicit",(function(){return rv})),n.d(r,"scalePow",(function(){return Bv})),n.d(r,"scaleSqrt",(function(){return qv})),n.d(r,"scaleQuantile",(function(){return zv})),n.d(r,"scaleQuantize",(function(){return Uv})),n.d(r,"scaleThreshold",(function(){return Vv})),n.d(r,"scaleTime",(function(){return xb})),n.d(r,"scaleUtc",(function(){return Mb})),n.d(r,"scaleSequential",(function(){return Lb})),n.d(r,"scaleSequentialLog",(function(){return Nb})),n.d(r,"scaleSequentialPow",(function(){return Rb})),n.d(r,"scaleSequentialSqrt",(function(){return jb})),n.d(r,"scaleSequentialSymlog",(function(){return Fb})),n.d(r,"scaleSequentialQuantile",(function(){return Ib})),n.d(r,"scaleDiverging",(function(){return qb})),n.d(r,"scaleDivergingLog",(function(){return zb})),n.d(r,"scaleDivergingPow",(function(){return Vb})),n.d(r,"scaleDivergingSqrt",(function(){return Wb})),n.d(r,"scaleDivergingSymlog",(function(){return Ub})),n.d(r,"tickFormat",(function(){return gv})),n.d(r,"schemeCategory10",(function(){return Xb})),n.d(r,"schemeAccent",(function(){return Hb})),n.d(r,"schemeDark2",(function(){return Gb})),n.d(r,"schemePaired",(function(){return Kb})),n.d(r,"schemePastel1",(function(){return $b})),n.d(r,"schemePastel2",(function(){return Jb})),n.d(r,"schemeSet1",(function(){return Zb})),n.d(r,"schemeSet2",(function(){return Qb})),n.d(r,"schemeSet3",(function(){return ex})),n.d(r,"schemeTableau10",(function(){return tx})),n.d(r,"interpolateBrBG",(function(){return ix})),n.d(r,"schemeBrBG",(function(){return rx})),n.d(r,"interpolatePRGn",(function(){return ax})),n.d(r,"schemePRGn",(function(){return ox})),n.d(r,"interpolatePiYG",(function(){return ux})),n.d(r,"schemePiYG",(function(){return sx})),n.d(r,"interpolatePuOr",(function(){return cx})),n.d(r,"schemePuOr",(function(){return lx})),n.d(r,"interpolateRdBu",(function(){return px})),n.d(r,"schemeRdBu",(function(){return fx})),n.d(r,"interpolateRdGy",(function(){return hx})),n.d(r,"schemeRdGy",(function(){return dx})),n.d(r,"interpolateRdYlBu",(function(){return vx})),n.d(r,"schemeRdYlBu",(function(){return mx})),n.d(r,"interpolateRdYlGn",(function(){return gx})),n.d(r,"schemeRdYlGn",(function(){return yx})),n.d(r,"interpolateSpectral",(function(){return xx})),n.d(r,"schemeSpectral",(function(){return bx})),n.d(r,"interpolateBuGn",(function(){return Ex})),n.d(r,"schemeBuGn",(function(){return wx})),n.d(r,"interpolateBuPu",(function(){return Sx})),n.d(r,"schemeBuPu",(function(){return _x})),n.d(r,"interpolateGnBu",(function(){return kx})),n.d(r,"schemeGnBu",(function(){return Ax})),n.d(r,"interpolateOrRd",(function(){return Tx})),n.d(r,"schemeOrRd",(function(){return Cx})),n.d(r,"interpolatePuBuGn",(function(){return Mx})),n.d(r,"schemePuBuGn",(function(){return Dx})),n.d(r,"interpolatePuBu",(function(){return Px})),n.d(r,"schemePuBu",(function(){return Ox})),n.d(r,"interpolatePuRd",(function(){return Nx})),n.d(r,"schemePuRd",(function(){return Lx})),n.d(r,"interpolateRdPu",(function(){return Rx})),n.d(r,"schemeRdPu",(function(){return Fx})),n.d(r,"interpolateYlGnBu",(function(){return Ix})),n.d(r,"schemeYlGnBu",(function(){return jx})),n.d(r,"interpolateYlGn",(function(){return qx})),n.d(r,"schemeYlGn",(function(){return Bx})),n.d(r,"interpolateYlOrBr",(function(){return Ux})),n.d(r,"schemeYlOrBr",(function(){return zx})),n.d(r,"interpolateYlOrRd",(function(){return Wx})),n.d(r,"schemeYlOrRd",(function(){return Vx})),n.d(r,"interpolateBlues",(function(){return Xx})),n.d(r,"schemeBlues",(function(){return Yx})),n.d(r,"interpolateGreens",(function(){return Gx})),n.d(r,"schemeGreens",(function(){return Hx})),n.d(r,"interpolateGreys",(function(){return $x})),n.d(r,"schemeGreys",(function(){return Kx})),n.d(r,"interpolatePurples",(function(){return Zx})),n.d(r,"schemePurples",(function(){return Jx})),n.d(r,"interpolateReds",(function(){return ew})),n.d(r,"schemeReds",(function(){return Qx})),n.d(r,"interpolateOranges",(function(){return nw})),n.d(r,"schemeOranges",(function(){return tw})),n.d(r,"interpolateCividis",(function(){return rw})),n.d(r,"interpolateCubehelixDefault",(function(){return iw})),n.d(r,"interpolateRainbow",(function(){return uw})),n.d(r,"interpolateWarm",(function(){return ow})),n.d(r,"interpolateCool",(function(){return aw})),n.d(r,"interpolateSinebow",(function(){return pw})),n.d(r,"interpolateTurbo",(function(){return dw})),n.d(r,"interpolateViridis",(function(){return mw})),n.d(r,"interpolateMagma",(function(){return vw})),n.d(r,"interpolateInferno",(function(){return yw})),n.d(r,"interpolatePlasma",(function(){return gw})),n.d(r,"create",(function(){return bw})),n.d(r,"creator",(function(){return gn})),n.d(r,"local",(function(){return ww})),n.d(r,"matcher",(function(){return Mt})),n.d(r,"mouse",(function(){return Hr})),n.d(r,"namespace",(function(){return It})),n.d(r,"namespaces",(function(){return jt})),n.d(r,"clientPoint",(function(){return Yr})),n.d(r,"select",(function(){return In})),n.d(r,"selectAll",(function(){return _w})),n.d(r,"selection",(function(){return jn})),n.d(r,"selector",(function(){return Ct})),n.d(r,"selectorAll",(function(){return Dt})),n.d(r,"style",(function(){return Kt})),n.d(r,"touch",(function(){return Xr})),n.d(r,"touches",(function(){return Sw})),n.d(r,"window",(function(){return Yt})),n.d(r,"event",(function(){return Sn})),n.d(r,"customEvent",(function(){return Mn})),n.d(r,"arc",(function(){return Yw})),n.d(r,"area",(function(){return Jw})),n.d(r,"line",(function(){return $w})),n.d(r,"pie",(function(){return eE})),n.d(r,"areaRadial",(function(){return aE})),n.d(r,"radialArea",(function(){return aE})),n.d(r,"lineRadial",(function(){return oE})),n.d(r,"radialLine",(function(){return oE})),n.d(r,"pointRadial",(function(){return sE})),n.d(r,"linkHorizontal",(function(){return mE})),n.d(r,"linkVertical",(function(){return vE})),n.d(r,"linkRadial",(function(){return yE})),n.d(r,"symbol",(function(){return FE})),n.d(r,"symbols",(function(){return NE})),n.d(r,"symbolCircle",(function(){return gE})),n.d(r,"symbolCross",(function(){return bE})),n.d(r,"symbolDiamond",(function(){return EE})),n.d(r,"symbolSquare",(function(){return CE})),n.d(r,"symbolStar",(function(){return kE})),n.d(r,"symbolTriangle",(function(){return DE})),n.d(r,"symbolWye",(function(){return LE})),n.d(r,"curveBasisClosed",(function(){return zE})),n.d(r,"curveBasisOpen",(function(){return VE})),n.d(r,"curveBasis",(function(){return BE})),n.d(r,"curveBundle",(function(){return YE})),n.d(r,"curveCardinalClosed",(function(){return $E})),n.d(r,"curveCardinalOpen",(function(){return ZE})),n.d(r,"curveCardinal",(function(){return GE})),n.d(r,"curveCatmullRomClosed",(function(){return r_})),n.d(r,"curveCatmullRomOpen",(function(){return o_})),n.d(r,"curveCatmullRom",(function(){return t_})),n.d(r,"curveLinearClosed",(function(){return s_})),n.d(r,"curveLinear",(function(){return Hw})),n.d(r,"curveMonotoneX",(function(){return m_})),n.d(r,"curveMonotoneY",(function(){return v_})),n.d(r,"curveNatural",(function(){return b_})),n.d(r,"curveStep",(function(){return w_})),n.d(r,"curveStepAfter",(function(){return __})),n.d(r,"curveStepBefore",(function(){return E_})),n.d(r,"stack",(function(){return C_})),n.d(r,"stackOffsetExpand",(function(){return T_})),n.d(r,"stackOffsetDiverging",(function(){return D_})),n.d(r,"stackOffsetNone",(function(){return S_})),n.d(r,"stackOffsetSilhouette",(function(){return M_})),n.d(r,"stackOffsetWiggle",(function(){return O_})),n.d(r,"stackOrderAppearance",(function(){return P_})),n.d(r,"stackOrderAscending",(function(){return N_})),n.d(r,"stackOrderDescending",(function(){return R_})),n.d(r,"stackOrderInsideOut",(function(){return j_})),n.d(r,"stackOrderNone",(function(){return A_})),n.d(r,"stackOrderReverse",(function(){return I_})),n.d(r,"timeInterval",(function(){return Xv})),n.d(r,"timeMillisecond",(function(){return Cy})),n.d(r,"timeMilliseconds",(function(){return Ty})),n.d(r,"utcMillisecond",(function(){return Cy})),n.d(r,"utcMilliseconds",(function(){return Ty})),n.d(r,"timeSecond",(function(){return Sy})),n.d(r,"timeSeconds",(function(){return Ay})),n.d(r,"utcSecond",(function(){return Sy})),n.d(r,"utcSeconds",(function(){return Ay})),n.d(r,"timeMinute",(function(){return wy})),n.d(r,"timeMinutes",(function(){return Ey})),n.d(r,"timeHour",(function(){return gy})),n.d(r,"timeHours",(function(){return by})),n.d(r,"timeDay",(function(){return my})),n.d(r,"timeDays",(function(){return vy})),n.d(r,"timeWeek",(function(){return ey})),n.d(r,"timeWeeks",(function(){return sy})),n.d(r,"timeSunday",(function(){return ey})),n.d(r,"timeSundays",(function(){return sy})),n.d(r,"timeMonday",(function(){return ty})),n.d(r,"timeMondays",(function(){return uy})),n.d(r,"timeTuesday",(function(){return ny})),n.d(r,"timeTuesdays",(function(){return ly})),n.d(r,"timeWednesday",(function(){return ry})),n.d(r,"timeWednesdays",(function(){return cy})),n.d(r,"timeThursday",(function(){return iy})),n.d(r,"timeThursdays",(function(){return fy})),n.d(r,"timeFriday",(function(){return oy})),n.d(r,"timeFridays",(function(){return py})),n.d(r,"timeSaturday",(function(){return ay})),n.d(r,"timeSaturdays",(function(){return dy})),n.d(r,"timeMonth",(function(){return Jv})),n.d(r,"timeMonths",(function(){return Zv})),n.d(r,"timeYear",(function(){return Gv})),n.d(r,"timeYears",(function(){return Kv})),n.d(r,"utcMinute",(function(){return Tb})),n.d(r,"utcMinutes",(function(){return Db})),n.d(r,"utcHour",(function(){return Ab})),n.d(r,"utcHours",(function(){return kb})),n.d(r,"utcDay",(function(){return Yy})),n.d(r,"utcDays",(function(){return Xy})),n.d(r,"utcWeek",(function(){return My})),n.d(r,"utcWeeks",(function(){return jy})),n.d(r,"utcSunday",(function(){return My})),n.d(r,"utcSundays",(function(){return jy})),n.d(r,"utcMonday",(function(){return Oy})),n.d(r,"utcMondays",(function(){return Iy})),n.d(r,"utcTuesday",(function(){return Py})),n.d(r,"utcTuesdays",(function(){return By})),n.d(r,"utcWednesday",(function(){return Ly})),n.d(r,"utcWednesdays",(function(){return qy})),n.d(r,"utcThursday",(function(){return Ny})),n.d(r,"utcThursdays",(function(){return zy})),n.d(r,"utcFriday",(function(){return Fy})),n.d(r,"utcFridays",(function(){return Uy})),n.d(r,"utcSaturday",(function(){return Ry})),n.d(r,"utcSaturdays",(function(){return Vy})),n.d(r,"utcMonth",(function(){return Eb})),n.d(r,"utcMonths",(function(){return _b})),n.d(r,"utcYear",(function(){return Gy})),n.d(r,"utcYears",(function(){return Ky})),n.d(r,"timeFormatDefaultLocale",(function(){return vb})),n.d(r,"timeFormat",(function(){return tg})),n.d(r,"timeParse",(function(){return ng})),n.d(r,"utcFormat",(function(){return rg})),n.d(r,"utcParse",(function(){return ig})),n.d(r,"timeFormatLocale",(function(){return Qy})),n.d(r,"isoFormat",(function(){return B_})),n.d(r,"isoParse",(function(){return q_})),n.d(r,"now",(function(){return ni})),n.d(r,"timer",(function(){return oi})),n.d(r,"timerFlush",(function(){return ai})),n.d(r,"timeout",(function(){return ci})),n.d(r,"interval",(function(){return z_})),n.d(r,"transition",(function(){return no})),n.d(r,"active",(function(){return fo})),n.d(r,"interrupt",(function(){return wi})),n.d(r,"voronoi",(function(){return kS})),n.d(r,"zoom",(function(){return qS})),n.d(r,"zoomTransform",(function(){return OS})),n.d(r,"zoomIdentity",(function(){return MS}));var i={};n.r(i),n.d(i,"makeAccessor",(function(){return HA})),n.d(i,"makeAccessor2",(function(){return GA})),n.d(i,"getValue",(function(){return KA})),n.d(i,"datasetsFromPropsOrDescendants",(function(){return $A})),n.d(i,"inferDataType",(function(){return JA})),n.d(i,"inferDatasetsType",(function(){return ZA})),n.d(i,"isValidDomain",(function(){return QA})),n.d(i,"combineDomains",(function(){return ek})),n.d(i,"combineBorderObjects",(function(){return tk})),n.d(i,"domainFromData",(function(){return nk})),n.d(i,"getDataDomainByAxis",(function(){return rk})),n.d(i,"domainFromDatasets",(function(){return ik})),n.d(i,"domainFromRangeData",(function(){return ok})),n.d(i,"combineDatasets",(function(){return ak}));var o={};n.r(o),n.d(o,"PieChart",(function(){return fk})),n.d(o,"SankeyDiagram",(function(){return Gk})),n.d(o,"TreeMap",(function(){return uC})),n.d(o,"XYPlot",(function(){return eT})),n.d(o,"LineChart",(function(){return aT})),n.d(o,"ScatterPlot",(function(){return cT})),n.d(o,"BarChart",(function(){return CT})),n.d(o,"RangeBarChart",(function(){return ET})),n.d(o,"AreaBarChart",(function(){return OT})),n.d(o,"MarkerLineChart",(function(){return FT})),n.d(o,"AreaChart",(function(){return BT})),n.d(o,"ColorHeatmap",(function(){return KT})),n.d(o,"AreaHeatmap",(function(){return ZT})),n.d(o,"Histogram",(function(){return tD})),n.d(o,"KernelDensityEstimation",(function(){return uD})),n.d(o,"FunnelChart",(function(){return cD})),n.d(o,"Bar",(function(){return xT})),n.d(o,"RangeRect",(function(){return DT})),n.d(o,"XLine",(function(){return pD})),n.d(o,"YLine",(function(){return hD})),n.d(o,"XAxis",(function(){return iM})),n.d(o,"XAxisLabels",(function(){return HD})),n.d(o,"XAxisTitle",(function(){return JD})),n.d(o,"XGrid",(function(){return QD})),n.d(o,"XTicks",(function(){return tM})),n.d(o,"YAxis",(function(){return xM})),n.d(o,"YAxisLabels",(function(){return lM})),n.d(o,"YAxisTitle",(function(){return dM})),n.d(o,"YGrid",(function(){return mM})),n.d(o,"YTicks",(function(){return yM})),n.d(o,"resolveXYScales",(function(){return GC})),n.d(o,"ZoomContainer",(function(){return _M})),n.d(o,"utils",(function(){return SM}));n(363);var a=n(1),s=n.n(a),u=n(43),l=n.n(u),c=n(0),f=n.n(c),p=n(27);function d(){return(d=Object.assign||function(e){for(var t=1;t=0;c--){var f=i[c];"."===f?m(i,c):".."===f?(m(i,c),l++):l&&(m(i,c),l--)}if(!s)for(;l--;l)i.unshift("..");!s||""===i[0]||i[0]&&h(i[0])||i.unshift("");var p=i.join("/");return n&&"/"!==p.substr(-1)&&(p+="/"),p};var y=function(e,t){if(!e)throw new Error("Invariant failed")};function g(e){return"/"===e.charAt(0)?e:"/"+e}function b(e){return"/"===e.charAt(0)?e.substr(1):e}function x(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function w(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function E(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function _(e,t,n,r){var i;"string"==typeof e?(i=function(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(i=d({},e)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==t&&void 0===i.state&&(i.state=t));try{i.pathname=decodeURI(i.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(i.key=n),r?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=v(i.pathname,r.pathname)):i.pathname=r.pathname:i.pathname||(i.pathname="/"),i}function S(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,r):n.push(r),c({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=_(e,t,f(),y.location);l.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(y.entries[y.index]=r,c({action:"REPLACE",location:r}))}))},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(e){var t=y.index+e;return t>=0&&t=0||(i[n]=e[n]);return i}n(361);var q=function(e){var t=Object(R.a)();return t.displayName=e,t}("Router-History"),z=function(e){var t=Object(R.a)();return t.displayName=e,t}("Router"),U=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}Object(p.a)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return s.a.createElement(z.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},s.a.createElement(q.Provider,{children:this.props.children||null,value:this.props.history}))},t}(s.a.Component);s.a.Component;s.a.Component;var V={},W=0;function Y(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,i=n.exact,o=void 0!==i&&i,a=n.strict,s=void 0!==a&&a,u=n.sensitive,l=void 0!==u&&u;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=V[n]||(V[n]={});if(r[e])return r[e];var i=[],o={regexp:I()(e,i,t),keys:i};return W<1e4&&(r[e]=o,W++),o}(n,{end:o,strict:s,sensitive:l}),i=r.regexp,a=r.keys,u=i.exec(e);if(!u)return null;var c=u[0],f=u.slice(1),p=e===c;return o&&!p?null:{path:n,url:"/"===n&&""===c?"/":c,isExact:p,params:a.reduce((function(e,t,n){return e[t.name]=f[n],e}),{})}}),null)}var X=function(e){function t(){return e.apply(this,arguments)||this}return Object(p.a)(t,e),t.prototype.render=function(){var e=this;return s.a.createElement(z.Consumer,null,(function(t){t||y(!1);var n=e.props.location||t.location,r=d({},t,{location:n,match:e.props.computedMatch?e.props.computedMatch:e.props.path?Y(n.pathname,e.props):t.match}),i=e.props,o=i.children,a=i.component,u=i.render;return Array.isArray(o)&&0===o.length&&(o=null),s.a.createElement(z.Provider,{value:r},r.match?o?"function"==typeof o?o(r):o:a?s.a.createElement(a,r):u?u(r):null:"function"==typeof o?o(r):null)}))},t}(s.a.Component);function H(e){return"/"===e.charAt(0)?e:"/"+e}function G(e,t){if(!e)return t;var n=H(e);return 0!==t.pathname.indexOf(n)?t:d({},t,{pathname:t.pathname.substr(n.length)})}function K(e){return"string"==typeof e?e:E(e)}function $(e){return function(){y(!1)}}function J(){}s.a.Component;s.a.Component;s.a.useContext;s.a.Component;var Z=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i{const{name:t,propDocs:n,children:r}=e,i=ue.a.get(n,"props"),o=Object.entries(i).sort((e,t)=>e[0](e[t]=n,e),{});return s.a.createElement("div",{className:"container-fluid component-docs"},s.a.createElement("div",{className:"row"},s.a.createElement("h2",null,t)),n.description?s.a.createElement("div",{className:"row component-description"},me(n.description)):null,s.a.createElement("div",{className:"row prop-docs"},s.a.createElement("h4",null,t," props:"),ue.a.map(o,(e,t)=>s.a.createElement("div",{key:t,className:"prop-doc"},s.a.createElement("strong",null,t),": ",function(e){const t=ue.a.get(e,"type");if(!t)return"unknown";const n=ue.a.get(t,"name","unknown");let r=n;if("union"===n)r=t.computed?"func || value":he(t,"name");else if("custom"===n)"CustomPropTypes.valueOrAccessor"===t.raw?r="date || func || number || string":"CustomPropTypes.getter"===t.raw&&(r="array || func || number || string");else if("arrayOf"===n){const t=ue.a.get(e,"type.value.name",{});r=`Array<${t}>`}else"enum"===n&&(r=he(t,"value"));return r}(e),s.a.createElement("i",null,e.required&&" (required)"),e.description?s.a.createElement("br",null):null,e.description?s.a.createElement("span",{className:"prop-description"},me(e.description)):null,e.defaultValue?s.a.createElement("div",{className:"prop-default"},"default value: ",s.a.createElement("code",null,e.defaultValue.value)):null))),r)};function he(e,t){return ue.a.get(e,"value",[]).map(e=>{const n=ue.a.get(e,t,"");return"enum"===n?he(e,"value"):"instanceOf"===n?ue.a.get(e,"value","").toLowerCase():n}).join(" || ")}function me(e=""){return ce()().use(pe.a).processSync(e).contents}de.propTypes={name:f.a.string,propDocs:f.a.object,children:f.a.any};var ve=de,ye="5.16.0",ge=function(e,t){return et?1:e>=t?0:NaN},be=function(e){var t;return 1===e.length&&(t=e,e=function(e,n){return ge(t(e),n)}),{left:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r>>1;e(t[o],n)<0?r=o+1:i=o}return r},right:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r>>1;e(t[o],n)>0?i=o:r=o+1}return r}}};var xe=be(ge),we=xe.right,Ee=xe.left,_e=we,Se=function(e,t){null==t&&(t=Ae);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);ne?1:t>=e?0:NaN},Te=function(e){return null===e?NaN:+e},De=function(e,t){var n,r,i=e.length,o=0,a=-1,s=0,u=0;if(null==t)for(;++a1)return u/(o-1)},Me=function(e,t){var n=De(e,t);return n?Math.sqrt(n):n},Oe=function(e,t){var n,r,i,o=e.length,a=-1;if(null==t){for(;++a=n)for(r=i=n;++an&&(r=n),i=n)for(r=i=n;++an&&(r=n),i0)return[e];if((r=t0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(i=Math.ceil(t-e+1));++s=0?(o>=Ie?10:o>=Be?5:o>=qe?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=Ie?10:o>=Be?5:o>=qe?2:1)}function Ve(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=Ie?i*=10:o>=Be?i*=5:o>=qe&&(i*=2),tc;)f.pop(),--p;var d,h=new Array(p+1);for(i=0;i<=p;++i)(d=h[i]=[]).x0=i>0?f[i-1]:l,d.x1=i=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e);return a+(+n(e[o+1],o+1,e)-a)*(i-o)}},He=function(e,t,n){return e=Ne.call(e,Te).sort(ge),Math.ceil((n-t)/(2*(Xe(e,.75)-Xe(e,.25))*Math.pow(e.length,-1/3)))},Ge=function(e,t,n){return Math.ceil((n-t)/(3.5*Me(e)*Math.pow(e.length,-1/3)))},Ke=function(e,t){var n,r,i=e.length,o=-1;if(null==t){for(;++o=n)for(r=n;++or&&(r=n)}else for(;++o=n)for(r=n;++or&&(r=n);return r},$e=function(e,t){var n,r=e.length,i=r,o=-1,a=0;if(null==t)for(;++o=0;)for(t=(r=e[i]).length;--t>=0;)n[--a]=r[t];return n},Qe=function(e,t){var n,r,i=e.length,o=-1;if(null==t){for(;++o=n)for(r=n;++on&&(r=n)}else for(;++o=n)for(r=n;++on&&(r=n);return r},et=function(e,t){for(var n=t.length,r=new Array(n);n--;)r[n]=e[t[n]];return r},tt=function(e,t){if(n=e.length){var n,r,i=0,o=0,a=e[o];for(null==t&&(t=ge);++i=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}}))}function _t(e,t){for(var n,r=0,i=e.length;r