From 68b0fe568c7f19c4d98033863b41e04b827ea237 Mon Sep 17 00:00:00 2001 From: noahamac Date: Mon, 13 Jan 2020 16:35:00 -0800 Subject: [PATCH 1/2] cleaning up solution and adding dist file --- dist/liquid_fill_gauge.js | 2 +- .../liquid_fill_gauge/liquid_fill_gauge.ts | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/dist/liquid_fill_gauge.js b/dist/liquid_fill_gauge.js index cb60615f..e664c4bf 100644 --- a/dist/liquid_fill_gauge.js +++ b/dist/liquid_fill_gauge.js @@ -7,4 +7,4 @@ * This file was copied from https://raw.githubusercontent.com/ugomeda/d3-liquid-fill-gauge/master/liquidFillGauge.js * and modified for use in the Looker example custom visualizations project. */ -var e={minValue:0,maxValue:100,circleThickness:.05,circleFillGap:.05,circleColor:"#178BCA",backgroundColor:null,waveColor:"#178BCA",width:0,height:0,gradientFromColor:"#FFF",gradientToColor:"#000",waveHeight:.05,waveCount:1,waveOffset:0,waveRise:!0,waveRiseTime:1e3,waveRiseAtStart:!0,waveAnimate:!0,waveAnimateTime:1800,waveHeightScaling:!0,valueCountUp:!0,valueCountUpAtStart:!0,textVertPosition:.5,textSize:1,displayPercent:!0,textColor:"#045681",waveTextColor:"#A4DBf8"};t.exports={initialize:function(t){var n,r=(n=0,function(t){return t+"-"+n++});t.liquidfillgauge=function(n,i,u){var o=t.map(e);t.map(u).each((function(t,n){o.set(n,t)})),n.each((function(n){var e,u=t.select(this),a=0!==o.get("width")?o.get("width"):parseInt(u.style("width")),c=0!==o.get("height")?o.get("height"):parseInt(u.style("height")),f=Math.min(a,c)/2,s=a/2-f,l=c/2-f,h=Math.max(o.get("minValue"),Math.min(o.get("maxValue"),i))/o.get("maxValue");e=o.get("waveHeightScaling")?t.scaleLinear().range([0,o.get("waveHeight"),0]).domain([0,50,100]):t.scaleLinear().range([o.get("waveHeight"),o.get("waveHeight")]).domain([0,100]);var d=o.get("textSize")*f/2,p=parseFloat(i).toFixed(2),v=o.get("valueCountUp")?o.get("minValue"):p,g=o.get("displayPercent")?"%":"",y=o.get("circleThickness")*f,_=y+o.get("circleFillGap")*f,m=f-_,x=m*e(100*h),b=2*m/o.get("waveCount"),w=1+o.get("waveCount"),M=b*w,T=function(t){return Math.round(t)};parseFloat(p)!=parseFloat(T(p))&&(T=function(t){return parseFloat(t).toFixed(1)}),parseFloat(p)!=parseFloat(T(p))&&(T=function(t){return parseFloat(t).toFixed(2)});for(var S=[],k=0;k<=40*w;k++)S.push({x:k/(40*w),y:k/40});var C=t.scaleLinear().range([0,2*Math.PI]).domain([0,1]),A=t.scaleLinear().range([0,f]).domain([0,f]),N=t.scaleLinear().range([0,M]).domain([0,1]),E=t.scaleLinear().range([0,x]).domain([0,1]),z=t.scaleLinear().range([_+2*m+x,_-x]).domain([0,1]),P=t.scaleLinear().range([0,M-2*m]).domain([0,1]),O=t.scaleLinear().range([_+2*m,_+.7*d]).domain([0,1]),R=u.append("g").attr("transform","translate("+s+","+l+")");o.get("backgroundColor")&&R.append("circle").attr("r",f).style("fill",o.get("backgroundColor")).attr("transform","translate("+f+","+f+")");var L=t.arc().startAngle(C(0)).endAngle(C(1)).outerRadius(A(f)).innerRadius(A(f-y));R.append("path").attr("d",L).style("fill",o.get("circleColor")).attr("transform","translate("+f+","+f+")");var q=R.append("text").attr("class","liquidFillGaugeText").attr("text-anchor","middle").attr("font-size",d+"px").style("fill",o.get("textColor")).attr("transform","translate("+f+","+O(o.get("textVertPosition"))+")"),U=t.area().x((function(t){return N(t.x)})).y0((function(t){return E(Math.sin(2*Math.PI*o.get("waveOffset")*-1+2*Math.PI*(1-o.get("waveCount"))+2*t.y*Math.PI))})).y1((function(t){return 2*m+x})),D=R.append("defs"),F=r("clipWave"),j=D.append("clipPath").attr("id",F),I=j.append("path").datum(S).attr("d",U),H=R.append("g").attr("clip-path","url(#"+F+")");if(H.append("circle").attr("cx",f).attr("cy",f).attr("r",m),o.get("fillWithGradient")){var Y=o.get("gradientPoints"),B=r("linearGradient"),V=D.append("linearGradient").attr("id",B).attr("x1",Y[0]).attr("y1",Y[1]).attr("x2",Y[2]).attr("y2",Y[3]);V.append("stop").attr("offset","0").attr("stop-color",o.get("gradientFromColor")),V.append("stop").attr("offset","1").attr("stop-color",o.get("gradientToColor")),H.style("fill","url(#"+B+")")}else H.style("fill",o.get("waveColor"));var X=H.append("text").attr("class","liquidFillGaugeText").attr("text-anchor","middle").attr("font-size",d+"px").style("fill",o.get("waveTextColor")).attr("transform","translate("+f+","+O(o.get("textVertPosition"))+")"),W=_+2*m-M;o.get("waveAnimate")&&function n(){I.transition().duration(o.get("waveAnimateTime")).ease(t.easeLinear).attr("transform","translate("+P(1)+",0)").on("end",(function(){I.attr("transform","translate("+P(0)+",0)"),n()}))}();var $=function(n,e,r,i){if(i){var u=function(){var r=t.select(this),i=t.interpolate(n,e);return function(t){r.text(T(i(t))+g)}};q.transition().duration(o.get("waveRiseTime")).tween("text",u),X.transition().duration(o.get("waveRiseTime")).tween("text",u)}else q.text(T(e)+g),X.text(T(e)+g);var a=Math.max(o.get("minValue"),Math.min(o.get("maxValue"),e))/o.get("maxValue"),c=Math.max(o.get("minValue"),Math.min(o.get("maxValue"),n))/o.get("maxValue");r?j.attr("transform","translate("+W+","+z(c)+")").transition().duration(o.get("waveRiseTime")).attr("transform","translate("+W+","+z(a)+")"):j.attr("transform","translate("+W+","+z(a)+")")};$(v,p,o.get("waveRise")&&o.get("waveRiseAtStart"),o.get("valueCountUp")&&o.get("valueCountUpAtStart")),u.on("valueChanged",(function(t){$(i,t,o.get("waveRise"),o.get("valueCountUp")),i=t})),u.on("destroy",(function(){q.interrupt().transition(),X.interrupt().transition(),j.interrupt().transition(),I.interrupt().transition(),u.on("valueChanged",null),u.on("destroy",null)}))}))}},defaultConfig:e}},2:function(t,n,e){"use strict";function r(){}function i(t,n){var e=new r;if(t instanceof r)t.each((function(t,n){e.set(n,t)}));else if(Array.isArray(t)){var i,u=-1,o=t.length;if(null==n)for(;++u=r.length)return null!=t&&e.sort(t),null!=n?n(e):e;for(var f,s,l,h=-1,d=e.length,p=r[i++],v=u(),g=a();++hr.length)return e;var o,a=i[u-1];return null!=n&&u>=r.length?o=e.entries():(o=[],e.each((function(n,e){o.push({key:e,values:t(n,u)})}))),null!=a?o.sort((function(t,n){return a(t.key,n.key)})):o}(o(t,0,f,s),0)},key:function(t){return r.push(t),e},sortKeys:function(t){return i[r.length-1]=t,e},sortValues:function(n){return t=n,e},rollup:function(t){return n=t,e}}};function a(){return{}}function c(t,n,e){t[n]=e}function f(){return u()}function s(t,n,e){t.set(n,e)}function l(){}var h=u.prototype;function d(t,n){var e=new l;if(t instanceof l)t.each((function(t){e.add(t)}));else if(t){var r=-1,i=t.length;if(null==n)for(;++r=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),o=-1,a=u.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o0)for(var e,r,i=new Array(e),u=0;u=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),k.hasOwnProperty(n)?{space:k[n],local:t}:t},A=function(t){var n=C(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===S&&n.documentElement.namespaceURI===S?n.createElement(t):n.createElementNS(e,t)}})(n)};function N(){}var E=function(t){return null==t?N:function(){return this.querySelector(t)}};function z(){return[]}var P=function(t){return null==t?z:function(){return this.querySelectorAll(t)}},O=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var R=document.documentElement;if(!R.matches){var L=R.webkitMatchesSelector||R.msMatchesSelector||R.mozMatchesSelector||R.oMatchesSelector;O=function(t){return function(){return L.call(this,t)}}}}var q=O,U=function(t){return new Array(t.length)};function D(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}D.prototype={constructor:D,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var F="$";function j(t,n,e,r,i,u){for(var o,a=0,c=n.length,f=u.length;an?1:t>=n?0:NaN}var Y=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function B(t,n){return t.style.getPropertyValue(n)||Y(t).getComputedStyle(t,null).getPropertyValue(n)}function V(t){return t.trim().split(/^|\s+/)}function X(t){return t.classList||new W(t)}function W(t){this._node=t,this._names=V(t.getAttribute("class")||"")}function $(t,n){for(var e=X(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var it={},ut=null;function ot(t,n,e){return t=at(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function at(t,n,e){return function(r){var i=ut;ut=r;try{t.call(this,this.__data__,n,e)}finally{ut=i}}}function ct(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,u=n.length;r=b&&(b=x+1);!(m=y[b])&&++b=0;)(r=i[u])&&(o&&o!==r.nextSibling&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=H);for(var e=this._groups,r=e.length,i=new Array(r),u=0;u1?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?function(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}:function(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):B(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=V(t+"");if(arguments.length<2){for(var r=X(this.node()),i=-1,u=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),o=u.length;if(!(arguments.length<2)){for(a=n?ft:ct,null==e&&(e=!1),r=0;rl}c.mouse("drag")}function v(){gt(ut.view).on("mousemove.drag mouseup.drag",null),Et(ut.view,e),At(),c.mouse("end")}function g(){if(i.apply(this,arguments)){var t,n,e=ut.changedTouches,r=u.apply(this,arguments),o=e.length;for(t=0;t>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=Vt.exec(t))?tn(parseInt(n[1],16)):(n=Xt.exec(t))?new un(n[1],n[2],n[3],1):(n=Wt.exec(t))?new un(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=$t.exec(t))?nn(n[1],n[2],n[3],n[4]):(n=Gt.exec(t))?nn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Zt.exec(t))?on(n[1],n[2]/100,n[3]/100,1):(n=Qt.exec(t))?on(n[1],n[2]/100,n[3]/100,n[4]):Jt.hasOwnProperty(t)?tn(Jt[t]):"transparent"===t?new un(NaN,NaN,NaN,0):null}function tn(t){return new un(t>>16&255,t>>8&255,255&t,1)}function nn(t,n,e,r){return r<=0&&(t=n=e=NaN),new un(t,n,e,r)}function en(t){return t instanceof jt||(t=Kt(t)),t?new un((t=t.rgb()).r,t.g,t.b,t.opacity):new un}function rn(t,n,e,r){return 1===arguments.length?en(t):new un(t,n,e,null==r?1:r)}function un(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function on(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new cn(t,n,e,r)}function an(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof cn)return new cn(t.h,t.s,t.l,t.opacity);if(t instanceof jt||(t=Kt(t)),!t)return new cn;if(t instanceof cn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),u=Math.max(n,e,r),o=NaN,a=u-i,c=(u+i)/2;return a?(o=n===u?(e-r)/a+6*(e0&&c<1?0:o,new cn(o,a,c,t.opacity)}(t):new cn(t,n,e,null==r?1:r)}function cn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function fn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Dt(jt,Kt,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),Dt(un,rn,Ft(jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new un(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new un(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),Dt(cn,an,Ft(jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new cn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new cn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new un(fn(t>=240?t-240:t+120,i,r),fn(t,i,r),fn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var sn=Math.PI/180,ln=180/Math.PI,hn=.95047,dn=1,pn=1.08883,vn=4/29,gn=6/29,yn=3*gn*gn,_n=gn*gn*gn;function mn(t){if(t instanceof bn)return new bn(t.l,t.a,t.b,t.opacity);if(t instanceof Cn){var n=t.h*sn;return new bn(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof un||(t=en(t));var e=Sn(t.r),r=Sn(t.g),i=Sn(t.b),u=wn((.4124564*e+.3575761*r+.1804375*i)/hn),o=wn((.2126729*e+.7151522*r+.072175*i)/dn);return new bn(116*o-16,500*(u-o),200*(o-wn((.0193339*e+.119192*r+.9503041*i)/pn)),t.opacity)}function xn(t,n,e,r){return 1===arguments.length?mn(t):new bn(t,n,e,null==r?1:r)}function bn(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function wn(t){return t>_n?Math.pow(t,1/3):t/yn+vn}function Mn(t){return t>gn?t*t*t:yn*(t-vn)}function Tn(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Sn(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function kn(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof Cn)return new Cn(t.h,t.c,t.l,t.opacity);t instanceof bn||(t=mn(t));var n=Math.atan2(t.b,t.a)*ln;return new Cn(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new Cn(t,n,e,null==r?1:r)}function Cn(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}Dt(bn,xn,Ft(jt,{brighter:function(t){return new bn(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new bn(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=dn*Mn(t),new un(Tn(3.2404542*(n=hn*Mn(n))-1.5371385*t-.4985314*(e=pn*Mn(e))),Tn(-.969266*n+1.8760108*t+.041556*e),Tn(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),Dt(Cn,kn,Ft(jt,{brighter:function(t){return new Cn(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Cn(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return mn(this).rgb()}}));var An=-.29227,Nn=-.90649,En=1.97294,zn=En*Nn,Pn=1.78277*En,On=1.78277*An- -.14861*Nn;function Rn(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof Ln)return new Ln(t.h,t.s,t.l,t.opacity);t instanceof un||(t=en(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(On*r+zn*n-Pn*e)/(On+zn-Pn),u=r-i,o=(En*(e-i)-An*u)/Nn,a=Math.sqrt(o*o+u*u)/(En*i*(1-i)),c=a?Math.atan2(o,u)*ln-120:NaN;return new Ln(c<0?c+360:c,a,i,t.opacity)}(t):new Ln(t,n,e,null==r?1:r)}function Ln(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function qn(t,n,e,r,i){var u=t*t,o=u*t;return((1-3*t+3*u-o)*n+(4-6*u+3*o)*e+(1+3*t+3*u-3*o)*r+o*i)/6}Dt(Ln,Rn,Ft(jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ln(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ln(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*sn,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new un(255*(n+e*(-.14861*r+1.78277*i)),255*(n+e*(An*r+Nn*i)),255*(n+e*(En*r)),this.opacity)}}));var Un=function(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],u=t[r+1],o=r>0?t[r-1]:2*i-u,a=r180||e<-180?e-360*Math.round(e/360):e):Fn(isNaN(t)?n:t)}function Hn(t,n){var e=n-t;return e?jn(t,e):Fn(isNaN(t)?n:t)}var Yn=function t(n){var e=function(t){return 1==(t=+t)?Hn:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):Fn(isNaN(n)?e:n)}}(n);function r(t,n){var r=e((t=rn(t)).r,(n=rn(n)).r),i=e(t.g,n.g),u=e(t.b,n.b),o=Hn(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=u(n),t.opacity=o(n),t+""}}return r.gamma=t,r}(1);function Bn(t){return function(n){var e,r,i=n.length,u=new Array(i),o=new Array(i),a=new Array(i);for(e=0;eu&&(i=n.slice(u,i),a[o]?a[o]+=i:a[++o]=i),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,c.push({i:o,x:Kn(e,r)})),u=ee.lastIndex;return u180?n+=360:n-t>180&&(t+=360),u.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Kn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(u.rotate,o.rotate,a,c),function(t,n,e,u){t!==n?u.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Kn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(u.skewX,o.skewX,a,c),function(t,n,e,r,u,o){if(t!==e||n!==r){var a=u.push(i(u)+"scale(",null,",",null,")");o.push({i:a-4,x:Kn(t,e)},{i:a-2,x:Kn(n,r)})}else 1===e&&1===r||u.push(i(u)+"scale("+e+","+r+")")}(u.scaleX,u.scaleY,o.scaleX,o.scaleY,a,c),u=o=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(null,t),n=n._next;--Ae}function He(){Oe=(Pe=Le.now())+Re,Ae=Ne=0;try{Ie()}finally{Ae=0,function(){for(var t,n,e=Me,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Me=n);Te=t,Be(r)}(),Oe=0}}function Ye(){var t=Le.now(),n=t-Pe;n>ze&&(Re-=n,Pe=t)}function Be(t){Ae||(Ne&&(Ne=clearTimeout(Ne)),t-Oe>24?(t<1/0&&(Ne=setTimeout(He,t-Le.now()-Re)),Ee&&(Ee=clearInterval(Ee))):(Ee||(Pe=Le.now(),Ee=setInterval(Ye,ze)),Ae=1,qe(He)))}Fe.prototype=je.prototype={constructor:Fe,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Ue():+e)+(null==n?0:+n),this._next||Te===this||(Te?Te._next=this:Me=this,Te=this),this._call=t,this._time=e,Be()},stop:function(){this._call&&(this._call=null,this._time=1/0,Be())}};var Ve=function(t,n,e){var r=new Fe;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r},Xe=function(t,n,e){var r=new Fe,i=n;return null==n?(r.restart(t,n,e),r):(n=+n,e=null==e?Ue():+e,r.restart((function u(o){o+=i,r.restart(u,i+=n,e),t(o)}),n,e),r)},We=T("start","end","interrupt"),$e=[],Ge=0,Ze=1,Qe=2,Je=3,Ke=4,tr=5,nr=6,er=function(t,n,e,r,i,u){var o=t.__transition;if(o){if(e in o)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function u(c){var f,s,l,h;if(e.state!==Ze)return a();for(f in i)if((h=i[f]).name===e.name){if(h.state===Je)return Ve(u);h.state===Ke?(h.state=nr,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[f]):+fGe)throw new Error("too late; already scheduled");return e}function ir(t,n){var e=ur(t,n);if(e.state>Qe)throw new Error("too late; already started");return e}function ur(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var or=function(t,n){var e,r,i,u=t.__transition,o=!0;if(u){for(i in n=null==n?null:n+"",u)(e=u[i]).name===n?(r=e.state>Qe&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?rr:ir;return function(){var o=u(this,t),a=o.on;a!==r&&(i=(r=a).copy()).on(n,e),o.on=i}}(e,t,n))},attr:function(t,n){var e=C(t),r="transform"===e?le:cr;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,i,u;return function(){var o,a=e(this);if(null!=a)return(o=this.getAttributeNS(t.space,t.local))===a?null:o===r&&a===i?u:u=n(r=o,i=a);this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,i,u;return function(){var o,a=e(this);if(null!=a)return(o=this.getAttribute(t))===a?null:o===r&&a===i?u:u=n(r=o,i=a);this.removeAttribute(t)}})(e,r,ar(this,"attr."+t,n)):null==n?(e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(e):(e.local?function(t,n,e){var r,i;return function(){var u=this.getAttributeNS(t.space,t.local);return u===e?null:u===r?i:i=n(r=u,e)}}:function(t,n,e){var r,i;return function(){var u=this.getAttribute(t);return u===e?null:u===r?i:i=n(r=u,e)}})(e,r,n+""))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=C(t);return this.tween(e,(r.local?function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}:function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e})(r,n))},style:function(t,n,e){var r="transform"==(t+="")?se:cr;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var u=B(this,t),o=(this.style.removeProperty(t),B(this,t));return u===o?null:u===e&&o===r?i:i=n(e=u,r=o)}}(t,r)).on("end.style."+t,function(t){return function(){this.style.removeProperty(t)}}(t)):this.styleTween(t,"function"==typeof n?function(t,n,e){var r,i,u;return function(){var o=B(this,t),a=e(this);return null==a&&(this.style.removeProperty(t),a=B(this,t)),o===a?null:o===r&&a===i?u:u=n(r=o,i=a)}}(t,r,ar(this,"style."+t,n)):function(t,n,e){var r,i;return function(){var u=B(this,t);return u===e?null:u===r?i:i=n(r=u,e)}}(t,r,n+""),e)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(ar(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",(t=this._id,function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}));var t},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=ur(this.node(),e).tween,u=0,o=i.length;uZe&&e.name===n)return new lr([[t]],ii,n,+r);return null},oi=function(t){return function(){return t}},ai=function(t,n,e){this.target=t,this.type=n,this.selection=e};function ci(){ut.stopImmediatePropagation()}var fi=function(){ut.preventDefault(),ut.stopImmediatePropagation()},si={name:"drag"},li={name:"space"},hi={name:"handle"},di={name:"center"},pi={name:"x",handles:["e","w"].map(wi),input:function(t,n){return t&&[[t[0],n[0][1]],[t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},vi={name:"y",handles:["n","s"].map(wi),input:function(t,n){return t&&[[n[0][0],t[0]],[n[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},gi={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(wi),input:function(t){return t},output:function(t){return t}},yi={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},_i={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},mi={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},xi={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},bi={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function wi(t){return{type:t}}function Mi(){return!ut.button}function Ti(){var t=this.ownerSVGElement||this;return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Si(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function ki(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Ci(t){var n=t.__brush;return n?n.dim.output(n.selection):null}function Ai(){return zi(pi)}function Ni(){return zi(vi)}var Ei=function(){return zi(gi)};function zi(t){var n,e=Ti,r=Mi,i=T(o,"start","brush","end"),u=6;function o(n){var e=n.property("__brush",l).selectAll(".overlay").data([wi("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",yi.overlay).merge(e).each((function(){var t=Si(this).extent;gt(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),n.selectAll(".selection").data([wi("selection")]).enter().append("rect").attr("class","selection").attr("cursor",yi.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=n.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return yi[t.type]})),n.each(a).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",s)}function a(){var t=gt(this),n=Si(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?n[1][0]-u/2:n[0][0]-u/2})).attr("y",(function(t){return"s"===t.type[0]?n[1][1]-u/2:n[0][1]-u/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+u:u})).attr("height",(function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+u:u}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(t,n){return t.__brush.emitter||new f(t,n)}function f(t,n){this.that=t,this.args=n,this.state=t.__brush,this.active=0}function s(){if(ut.touches){if(ut.changedTouches.length0&&(e=i-d),w<0?l=h-p:w>0&&(u=o-p),x=li,L.attr("cursor",yi.selection),D());break;default:return}fi()}),!0).on("keyup.brush",(function(){switch(ut.keyCode){case 16:E&&(g=y=E=!1,D());break;case 18:x===di&&(b<0?f=s:b>0&&(e=i),w<0?l=h:w>0&&(u=o),x=hi,D());break;case 32:x===li&&(ut.altKey?(b&&(f=s-d*b,e=i+d*b),w&&(l=h-p*w,u=o+p*w),x=di):(b<0?f=s:b>0&&(e=i),w<0?l=h:w>0&&(u=o),x=hi),L.attr("cursor",yi[m]),D());break;default:return}fi()}),!0).on("mousemove.brush",U,!0).on("mouseup.brush",F,!0);Nt(ut.view)}ci(),or(_),a.call(_),O.start()}function U(){var t=Mt(_);!E||g||y||(Math.abs(t[0]-P[0])>Math.abs(t[1]-P[1])?y=!0:g=!0),P=t,v=!0,fi(),D()}function D(){var t;switch(d=P[0]-z[0],p=P[1]-z[1],x){case li:case si:b&&(d=Math.max(k-e,Math.min(A-f,d)),i=e+d,s=f+d),w&&(p=Math.max(C-u,Math.min(N-l,p)),o=u+p,h=l+p);break;case hi:b<0?(d=Math.max(k-e,Math.min(A-e,d)),i=e+d,s=f):b>0&&(d=Math.max(k-f,Math.min(A-f,d)),i=e,s=f+d),w<0?(p=Math.max(C-u,Math.min(N-u,p)),o=u+p,h=l):w>0&&(p=Math.max(C-l,Math.min(N-l,p)),o=u,h=l+p);break;case di:b&&(i=Math.max(k,Math.min(A,e-d*b)),s=Math.max(k,Math.min(A,f+d*b))),w&&(o=Math.max(C,Math.min(N,u-p*w)),h=Math.max(C,Math.min(N,l+p*w)))}s=u?c=!0:(r=t.charCodeAt(o++))===Ji?f=!0:r===Ki&&(f=!0,t.charCodeAt(o)===Ji&&++o),t.slice(i+1,n-1).replace(/""/g,'"')}for(;o=(u=(v+y)/2))?v=u:y=u,(s=e>=(o=(g+_)/2))?g=o:_=o,i=d,!(d=d[l=s<<1|f]))return i[l]=p,t;if(a=+t._x.call(null,d.data),c=+t._y.call(null,d.data),n===a&&e===c)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(f=n>=(u=(v+y)/2))?v=u:y=u,(s=e>=(o=(g+_)/2))?g=o:_=o}while((l=s<<1|f)==(h=(c>=o)<<1|a>=u));return i[h]=d,i[l]=p,t}var gu=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i};function yu(t){return t[0]}function _u(t){return t[1]}function mu(t,n,e){var r=new xu(null==n?yu:n,null==e?_u:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function xu(t,n,e,r,i,u){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=u,this._root=void 0}function bu(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var wu=mu.prototype=xu.prototype;function Mu(t){return t.x+t.vx}function Tu(t){return t.y+t.vy}wu.copy=function(){var t,n,e=new xu(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=bu(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=bu(n));return e},wu.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return vu(this.cover(n,e),n,e,t)},wu.addAll=function(t){var n,e,r,i,u=t.length,o=new Array(u),a=new Array(u),c=1/0,f=1/0,s=-1/0,l=-1/0;for(e=0;es&&(s=r),il&&(l=i));for(st||t>i||r>n||n>u))return this;var o,a,c=i-e,f=this._root;switch(a=(n<(r+u)/2)<<1|t<(e+i)/2){case 0:do{(o=new Array(4))[a]=f,f=o}while(u=r+(c*=2),t>(i=e+c)||n>u);break;case 1:do{(o=new Array(4))[a]=f,f=o}while(u=r+(c*=2),(e=i-c)>t||n>u);break;case 2:do{(o=new Array(4))[a]=f,f=o}while(r=u-(c*=2),t>(i=e+c)||r>n);break;case 3:do{(o=new Array(4))[a]=f,f=o}while(r=u-(c*=2),(e=i-c)>t||r>n)}this._root&&this._root.length&&(this._root=f)}return this._x0=e,this._y0=r,this._x1=i,this._y1=u,this},wu.data=function(){var t=[];return this.visit((function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)})),t},wu.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},wu.find=function(t,n,e){var r,i,u,o,a,c,f,s=this._x0,l=this._y0,h=this._x1,d=this._y1,p=[],v=this._root;for(v&&p.push(new gu(v,s,l,h,d)),null==e?e=1/0:(s=t-e,l=n-e,h=t+e,d=n+e,e*=e);c=p.pop();)if(!(!(v=c.node)||(i=c.x0)>h||(u=c.y0)>d||(o=c.x1)=y)<<1|t>=g)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=c)}else{var _=t-+this._x.call(null,v.data),m=n-+this._y.call(null,v.data),x=_*_+m*m;if(x=(a=(p+g)/2))?p=a:g=a,(s=o>=(c=(v+y)/2))?v=c:y=c,n=d,!(d=d[l=s<<1|f]))return this;if(!d.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},wu.removeAll=function(t){for(var n=0,e=t.length;nc+d||if+d||ua.index){var p=c-o.x-o.vx,v=f-o.y-o.vy,g=p*p+v*v;gt.r&&(t.r=t[n].r)}function a(){if(n){var r,i,u=n.length;for(e=new Array(u),r=0;r1?(null==e?a.remove(t):a.set(t,d(e)),n):a.get(t)},find:function(n,e,r){var i,u,o,a,c,f=0,s=t.length;for(null==r?r=1/0:r*=r,f=0;f1?(f.on(t,e),n):f.on(t)}}},Lu=function(){var t,n,e,r,i=du(-30),u=1,o=1/0,a=.81;function c(r){var i,u=t.length,o=mu(t,Nu,Eu).visitAfter(s);for(e=r,i=0;i=o)){(t.data!==n||t.next)&&(0===s&&(d+=(s=pu())*s),0===l&&(d+=(l=pu())*l),d1?r[0]+r.slice(2):r,+t.slice(e+1)]},ju=function(t){return(t=Fu(Math.abs(t)))?t[1]:NaN},Iu=function(t,n){var e=Fu(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Hu={"":function(t,n){t:for(var e,r=(t=t.toPrecision(n)).length,i=1,u=-1;i0&&(u=0)}return u>0?t.slice(0,u)+t.slice(e+1):t},"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return Iu(100*t,n)},r:Iu,s:function(t,n){var e=Fu(t,n);if(!e)return t+"";var r=e[0],i=e[1],u=i-(zu=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return u===o?r:u>o?r+new Array(u-o+1).join("0"):u>0?r.slice(0,u)+"."+r.slice(u):"0."+new Array(1-u).join("0")+Fu(t,Math.max(0,n+u-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},Yu=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function Bu(t){return new Vu(t)}function Vu(t){if(!(n=Yu.exec(t)))throw new Error("invalid format: "+t);var n,e=n[1]||" ",r=n[2]||">",i=n[3]||"-",u=n[4]||"",o=!!n[5],a=n[6]&&+n[6],c=!!n[7],f=n[8]&&+n[8].slice(1),s=n[9]||"";"n"===s?(c=!0,s="g"):Hu[s]||(s=""),(o||"0"===e&&"="===r)&&(o=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=i,this.symbol=u,this.zero=o,this.width=a,this.comma=c,this.precision=f,this.type=s}Bu.prototype=Vu.prototype,Vu.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var Xu,Wu,$u,Gu=function(t){return t},Zu=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],Qu=function(t){var n,e,r=t.grouping&&t.thousands?(n=t.grouping,e=t.thousands,function(t,r){for(var i=t.length,u=[],o=0,a=n[0],c=0;i>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),u.push(t.substring(i-=a,i+a)),!((c+=a+1)>r));)a=n[o=(o+1)%n.length];return u.reverse().join(e)}):Gu,i=t.currency,u=t.decimal,o=t.numerals?function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(t.numerals):Gu,a=t.percent||"%";function c(t){var n=(t=Bu(t)).fill,e=t.align,c=t.sign,f=t.symbol,s=t.zero,l=t.width,h=t.comma,d=t.precision,p=t.type,v="$"===f?i[0]:"#"===f&&/[boxX]/.test(p)?"0"+p.toLowerCase():"",g="$"===f?i[1]:/[%p]/.test(p)?a:"",y=Hu[p],_=!p||/[defgprs%]/.test(p);function m(t){var i,a,f,m=v,x=g;if("c"===p)x=y(t)+x,t="";else{var b=(t=+t)<0;if(t=y(Math.abs(t),d),b&&0==+t&&(b=!1),m=(b?"("===c?c:"-":"-"===c||"("===c?"":c)+m,x=("s"===p?Zu[8+zu/3]:"")+x+(b&&"("===c?")":""),_)for(i=-1,a=t.length;++i(f=t.charCodeAt(i))||f>57){x=(46===f?u+t.slice(i+1):t.slice(i))+x,t=t.slice(0,i);break}}h&&!s&&(t=r(t,1/0));var w=m.length+t.length+x.length,M=w>1)+m+t+x+M.slice(w);break;default:t=M+m+t+x}return o(t)}return d=null==d?p?6:12:/[gprs]/.test(p)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),m.toString=function(){return t+""},m}return{format:c,formatPrefix:function(t,n){var e=c(((t=Bu(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(ju(n)/3))),i=Math.pow(10,-r),u=Zu[8+r/3];return function(t){return e(i*t)+u}}}};function Ju(t){return Xu=Qu(t),Wu=Xu.format,$u=Xu.formatPrefix,Xu}Ju({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var Ku=function(t){return Math.max(0,-ju(Math.abs(t)))},to=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ju(n)/3)))-ju(Math.abs(t)))},no=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,ju(n)-ju(t))+1},eo=function(){return new ro};function ro(){this.reset()}ro.prototype={constructor:ro,reset:function(){this.s=this.t=0},add:function(t){uo(io,t,this.t),uo(this,io.s,this.s),this.s?this.t+=io.t:this.s=io.t},valueOf:function(){return this.s}};var io=new ro;function uo(t,n,e){var r=t.s=n+e,i=r-n,u=r-i;t.t=n-u+(e-i)}var oo=1e-6,ao=Math.PI,co=ao/2,fo=ao/4,so=2*ao,lo=180/ao,ho=ao/180,po=Math.abs,vo=Math.atan,go=Math.atan2,yo=Math.cos,_o=Math.ceil,mo=Math.exp,xo=(Math.floor,Math.log),bo=Math.pow,wo=Math.sin,Mo=Math.sign||function(t){return t>0?1:t<0?-1:0},To=Math.sqrt,So=Math.tan;function ko(t){return t>1?0:t<-1?ao:Math.acos(t)}function Co(t){return t>1?co:t<-1?-co:Math.asin(t)}function Ao(t){return(t=wo(t/2))*t}function No(){}function Eo(t,n){t&&Po.hasOwnProperty(t.type)&&Po[t.type](t,n)}var zo={Feature:function(t,n){Eo(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,u=yo(n=(n*=ho)/2+fo),o=wo(n),a=Fo*o,c=Do*u+a*yo(i),f=a*r*wo(i);Io.add(go(f,c)),Uo=t,Do=u,Fo=o}var $o=function(t){return Ho.reset(),jo(t,Yo),2*Ho};function Go(t){return[go(t[1],t[0]),Co(t[2])]}function Zo(t){var n=t[0],e=t[1],r=yo(e);return[r*yo(n),r*wo(n),wo(e)]}function Qo(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Jo(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Ko(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function ta(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function na(t){var n=To(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var ea,ra,ia,ua,oa,aa,ca,fa,sa,la,ha=eo(),da={point:pa,lineStart:ga,lineEnd:ya,polygonStart:function(){da.point=_a,da.lineStart=ma,da.lineEnd=xa,ha.reset(),Yo.polygonStart()},polygonEnd:function(){Yo.polygonEnd(),da.point=pa,da.lineStart=ga,da.lineEnd=ya,Io<0?(ea=-(ia=180),ra=-(ua=90)):ha>oo?ua=90:ha<-oo&&(ra=-90),la[0]=ea,la[1]=ia}};function pa(t,n){sa.push(la=[ea=t,ia=t]),nua&&(ua=n)}function va(t,n){var e=Zo([t*ho,n*ho]);if(fa){var r=Jo(fa,e),i=Jo([r[1],-r[0],0],r);na(i),i=Go(i);var u,o=t-oa,a=o>0?1:-1,c=i[0]*lo*a,f=po(o)>180;f^(a*oaua&&(ua=u):f^(a*oa<(c=(c+360)%360-180)&&cua&&(ua=n)),f?tba(ea,ia)&&(ia=t):ba(t,ia)>ba(ea,ia)&&(ea=t):ia>=ea?(tia&&(ia=t)):t>oa?ba(ea,t)>ba(ea,ia)&&(ia=t):ba(t,ia)>ba(ea,ia)&&(ea=t)}else sa.push(la=[ea=t,ia=t]);nua&&(ua=n),fa=e,oa=t}function ga(){da.point=va}function ya(){la[0]=ea,la[1]=ia,da.point=pa,fa=null}function _a(t,n){if(fa){var e=t-oa;ha.add(po(e)>180?e+(e>0?360:-360):e)}else aa=t,ca=n;Yo.point(t,n),va(t,n)}function ma(){Yo.lineStart()}function xa(){_a(aa,ca),Yo.lineEnd(),po(ha)>oo&&(ea=-(ia=180)),la[0]=ea,la[1]=ia,fa=null}function ba(t,n){return(n-=t)<0?n+360:n}function wa(t,n){return t[0]-n[0]}function Ma(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nba(r[0],r[1])&&(r[1]=i[1]),ba(i[0],r[1])>ba(r[0],r[1])&&(r[0]=i[0])):u.push(r=i);for(o=-1/0,n=0,r=u[e=u.length-1];n<=e;r=i,++n)i=u[n],(a=ba(r[1],i[0]))>o&&(o=a,ea=i[0],ia=r[1])}return sa=la=null,ea===1/0||ra===1/0?[[NaN,NaN],[NaN,NaN]]:[[ea,ra],[ia,ua]]},Ia={sphere:No,point:Ha,lineStart:Ba,lineEnd:Wa,polygonStart:function(){Ia.lineStart=$a,Ia.lineEnd=Ga},polygonEnd:function(){Ia.lineStart=Ba,Ia.lineEnd=Wa}};function Ha(t,n){t*=ho;var e=yo(n*=ho);Ya(e*yo(t),e*wo(t),wo(n))}function Ya(t,n,e){ka+=(t-ka)/++Ta,Ca+=(n-Ca)/Ta,Aa+=(e-Aa)/Ta}function Ba(){Ia.point=Va}function Va(t,n){t*=ho;var e=yo(n*=ho);Ua=e*yo(t),Da=e*wo(t),Fa=wo(n),Ia.point=Xa,Ya(Ua,Da,Fa)}function Xa(t,n){t*=ho;var e=yo(n*=ho),r=e*yo(t),i=e*wo(t),u=wo(n),o=go(To((o=Da*u-Fa*i)*o+(o=Fa*r-Ua*u)*o+(o=Ua*i-Da*r)*o),Ua*r+Da*i+Fa*u);Sa+=o,Na+=o*(Ua+(Ua=r)),Ea+=o*(Da+(Da=i)),za+=o*(Fa+(Fa=u)),Ya(Ua,Da,Fa)}function Wa(){Ia.point=Ha}function $a(){Ia.point=Za}function Ga(){Qa(La,qa),Ia.point=Ha}function Za(t,n){La=t,qa=n,t*=ho,n*=ho,Ia.point=Qa;var e=yo(n);Ua=e*yo(t),Da=e*wo(t),Fa=wo(n),Ya(Ua,Da,Fa)}function Qa(t,n){t*=ho;var e=yo(n*=ho),r=e*yo(t),i=e*wo(t),u=wo(n),o=Da*u-Fa*i,a=Fa*r-Ua*u,c=Ua*i-Da*r,f=To(o*o+a*a+c*c),s=Co(f),l=f&&-s/f;Pa+=l*o,Oa+=l*a,Ra+=l*c,Sa+=s,Na+=s*(Ua+(Ua=r)),Ea+=s*(Da+(Da=i)),za+=s*(Fa+(Fa=u)),Ya(Ua,Da,Fa)}var Ja=function(t){Ta=Sa=ka=Ca=Aa=Na=Ea=za=Pa=Oa=Ra=0,jo(t,Ia);var n=Pa,e=Oa,r=Ra,i=n*n+e*e+r*r;return i<1e-12&&(n=Na,e=Ea,r=za,Saao?t-so:t<-ao?t+so:t,n]}function ec(t,n,e){return(t%=so)?n||e?tc(ic(t),uc(n,e)):ic(t):n||e?uc(n,e):nc}function rc(t){return function(n,e){return[(n+=t)>ao?n-so:n<-ao?n+so:n,e]}}function ic(t){var n=rc(t);return n.invert=rc(-t),n}function uc(t,n){var e=yo(t),r=wo(t),i=yo(n),u=wo(n);function o(t,n){var o=yo(n),a=yo(t)*o,c=wo(t)*o,f=wo(n),s=f*e+a*r;return[go(c*i-s*u,a*e-f*r),Co(s*i+c*u)]}return o.invert=function(t,n){var o=yo(n),a=yo(t)*o,c=wo(t)*o,f=wo(n),s=f*i-c*u;return[go(c*i+f*u,a*e+s*r),Co(s*e-a*r)]},o}nc.invert=nc;var oc=function(t){function n(n){return(n=t(n[0]*ho,n[1]*ho))[0]*=lo,n[1]*=lo,n}return t=ec(t[0]*ho,t[1]*ho,t.length>2?t[2]*ho:0),n.invert=function(n){return(n=t.invert(n[0]*ho,n[1]*ho))[0]*=lo,n[1]*=lo,n},n};function ac(t,n,e,r,i,u){if(e){var o=yo(n),a=wo(n),c=r*e;null==i?(i=n+r*so,u=n-c/2):(i=cc(o,i),u=cc(o,u),(r>0?iu)&&(i+=r*so));for(var f,s=i;r>0?s>u:s1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}},lc=function(t,n){return po(t[0]-n[0])=0;--u)i.point((s=f[u])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}f=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}};function pc(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r=0?1:-1,T=M*w,S=T>ao,k=p*x;if(vc.add(go(k*M*wo(T),v*b+k*yo(T))),u+=S?w+M*so:w,S^h>=e^_>=e){var C=Jo(Zo(l),Zo(y));na(C);var A=Jo(i,C);na(A);var N=(S^w>=0?-1:1)*Co(A[2]);(r>N||r===N&&(C[0]||C[1]))&&(o+=S^w>=0?1:-1)}}return(u<-oo||u0){for(h||(u.polygonStart(),h=!0),u.lineStart(),t=0;t1&&2&i&&f.push(f.pop().concat(f.shift())),a.push(f.filter(_c))}return d}};function _c(t){return t.length>1}function mc(t,n){return((t=t.x)[0]<0?t[1]-co-oo:co-t[1])-((n=n.x)[0]<0?n[1]-co-oo:co-n[1])}var xc=yc((function(){return!0}),(function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(u,o){var a=u>0?ao:-ao,c=po(u-e);po(c-ao)0?co:-co),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(u,r),n=0):i!==a&&c>=ao&&(po(e-i)oo?vo((wo(n)*(u=yo(r))*wo(e)-wo(r)*(i=yo(n))*wo(t))/(i*u*o)):(n+r)/2}(e,r,u,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),n=0),t.point(e=u,r=o),i=a},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}),(function(t,n,e,r){var i;if(null==t)i=e*co,r.point(-ao,i),r.point(0,i),r.point(ao,i),r.point(ao,0),r.point(ao,-i),r.point(0,-i),r.point(-ao,-i),r.point(-ao,0),r.point(-ao,i);else if(po(t[0]-n[0])>oo){var u=t[0]0,i=po(n)>oo;function u(t,e){return yo(t)*yo(e)>n}function o(t,e,r){var i=[1,0,0],u=Jo(Zo(t),Zo(e)),o=Qo(u,u),a=u[0],c=o-a*a;if(!c)return!r&&t;var f=n*o/c,s=-n*a/c,l=Jo(i,u),h=ta(i,f);Ko(h,ta(u,s));var d=l,p=Qo(h,d),v=Qo(d,d),g=p*p-v*(Qo(h,h)-1);if(!(g<0)){var y=To(g),_=ta(d,(-p-y)/v);if(Ko(_,h),_=Go(_),!r)return _;var m,x=t[0],b=e[0],w=t[1],M=e[1];b0^_[1]<(po(_[0]-x)ao^(x<=_[0]&&_[0]<=b)){var k=ta(d,(-p+y)/v);return Ko(k,h),[_,Go(k)]}}}function a(n,e){var i=r?t:ao-t,u=0;return n<-i?u|=1:n>i&&(u|=2),e<-i?u|=4:e>i&&(u|=8),u}return yc(u,(function(t){var n,e,c,f,s;return{lineStart:function(){f=c=!1,s=1},point:function(l,h){var d,p=[l,h],v=u(l,h),g=r?v?0:a(l,h):v?a(l+(l<0?ao:-ao),h):0;if(!n&&(f=c=v)&&t.lineStart(),v!==c&&(!(d=o(n,p))||lc(n,d)||lc(p,d))&&(p[0]+=oo,p[1]+=oo,v=u(p[0],p[1])),v!==c)s=0,v?(t.lineStart(),d=o(p,n),t.point(d[0],d[1])):(d=o(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(i&&n&&r^v){var y;g&e||!(y=o(p,n,!0))||(s=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!v||n&&lc(n,p)||t.point(p[0],p[1]),n=p,c=v,e=g},lineEnd:function(){c&&t.lineEnd(),n=null},clean:function(){return s|(f&&c)<<1}}}),(function(n,r,i,u){ac(u,t,e,i,n,r)}),r?[0,-t]:[-ao,t-ao])},wc=function(t,n,e,r,i,u){var o,a=t[0],c=t[1],f=0,s=1,l=n[0]-a,h=n[1]-c;if(o=e-a,l||!(o>0)){if(o/=l,l<0){if(o0){if(o>s)return;o>f&&(f=o)}if(o=i-a,l||!(o<0)){if(o/=l,l<0){if(o>s)return;o>f&&(f=o)}else if(l>0){if(o0)){if(o/=h,h<0){if(o0){if(o>s)return;o>f&&(f=o)}if(o=u-c,h||!(o<0)){if(o/=h,h<0){if(o>s)return;o>f&&(f=o)}else if(h>0){if(o0&&(t[0]=a+f*l,t[1]=c+f*h),s<1&&(n[0]=a+s*l,n[1]=c+s*h),!0}}}}},Mc=1e9,Tc=-Mc;function Sc(t,n,e,i){function u(r,u){return t<=r&&r<=e&&n<=u&&u<=i}function o(r,u,o,c){var s=0,l=0;if(null==r||(s=a(r,o))!==(l=a(u,o))||f(r,u)<0^o>0)do{c.point(0===s||3===s?t:e,s>1?i:n)}while((s=(s+o+4)%4)!==l);else c.point(u[0],u[1])}function a(r,i){return po(r[0]-t)0?0:3:po(r[0]-e)0?2:1:po(r[1]-n)0?1:0:i>0?3:2}function c(t,n){return f(t.x,n.x)}function f(t,n){var e=a(t,1),r=a(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(a){var f,s,l,h,d,p,v,g,y,_,m,x=a,b=sc(),w={point:M,lineStart:function(){w.point=T,s&&s.push(l=[]),_=!0,y=!1,v=g=NaN},lineEnd:function(){f&&(T(h,d),p&&y&&b.rejoin(),f.push(b.result())),w.point=M,y&&x.lineEnd()},polygonStart:function(){x=b,f=[],s=[],m=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,r=s.length;ei&&(h-u)*(i-o)>(d-o)*(t-u)&&++n:d<=i&&(h-u)*(i-o)<(d-o)*(t-u)&&--n;return n}(),e=m&&n,u=(f=Object(r.n)(f)).length;(e||u)&&(a.polygonStart(),e&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),u&&dc(f,c,n,o,a),a.polygonEnd()),x=a,f=s=l=null}};function M(t,n){u(t,n)&&x.point(t,n)}function T(r,o){var a=u(r,o);if(s&&l.push([r,o]),_)h=r,d=o,p=a,_=!1,a&&(x.lineStart(),x.point(r,o));else if(a&&y)x.point(r,o);else{var c=[v=Math.max(Tc,Math.min(Mc,v)),g=Math.max(Tc,Math.min(Mc,g))],f=[r=Math.max(Tc,Math.min(Mc,r)),o=Math.max(Tc,Math.min(Mc,o))];wc(c,f,t,n,e,i)?(y||(x.lineStart(),x.point(c[0],c[1])),x.point(f[0],f[1]),a||x.lineEnd(),m=!1):a&&(x.lineStart(),x.point(r,o),m=!1)}v=r,g=o,y=a}return w}}var kc,Cc,Ac,Nc=function(){var t,n,e,r=0,i=0,u=960,o=500;return e={stream:function(e){return t&&n===e?t:t=Sc(r,i,u,o)(n=e)},extent:function(a){return arguments.length?(r=+a[0][0],i=+a[0][1],u=+a[1][0],o=+a[1][1],t=n=null,e):[[r,i],[u,o]]}}},Ec=eo(),zc={sphere:No,point:No,lineStart:function(){zc.point=Oc,zc.lineEnd=Pc},lineEnd:No,polygonStart:No,polygonEnd:No};function Pc(){zc.point=zc.lineEnd=No}function Oc(t,n){kc=t*=ho,Cc=wo(n*=ho),Ac=yo(n),zc.point=Rc}function Rc(t,n){t*=ho;var e=wo(n*=ho),r=yo(n),i=po(t-kc),u=yo(i),o=r*wo(i),a=Ac*e-Cc*r*u,c=Cc*e+Ac*r*u;Ec.add(go(To(o*o+a*a),c)),kc=t,Cc=e,Ac=r}var Lc=function(t){return Ec.reset(),jo(t,zc),+Ec},qc=[null,null],Uc={type:"LineString",coordinates:qc},Dc=function(t,n){return qc[0]=t,qc[1]=n,Lc(Uc)},Fc={Feature:function(t,n){return Ic(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++roo})).map(f)).concat(Object(r.s)(_o(o/p)*p,u,p).filter((function(t){return po(t%g)>oo})).map(s))}return _.lines=function(){return m().map((function(t){return{type:"LineString",coordinates:t}}))},_.outline=function(){return{type:"Polygon",coordinates:[l(i).concat(h(a).slice(1),l(e).reverse().slice(1),h(c).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.extentMajor(t).extentMinor(t):_.extentMinor()},_.extentMajor=function(t){return arguments.length?(i=+t[0][0],e=+t[1][0],c=+t[0][1],a=+t[1][1],i>e&&(t=i,i=e,e=t),c>a&&(t=c,c=a,a=t),_.precision(y)):[[i,c],[e,a]]},_.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],u=+e[1][1],n>t&&(e=n,n=t,t=e),o>u&&(e=o,o=u,u=e),_.precision(y)):[[n,o],[t,u]]},_.step=function(t){return arguments.length?_.stepMajor(t).stepMinor(t):_.stepMinor()},_.stepMajor=function(t){return arguments.length?(v=+t[0],g=+t[1],_):[v,g]},_.stepMinor=function(t){return arguments.length?(d=+t[0],p=+t[1],_):[d,p]},_.precision=function(r){return arguments.length?(y=+r,f=$c(o,u,90),s=Gc(n,t,y),l=$c(c,a,90),h=Gc(i,e,y),_):y},_.extentMajor([[-180,-90+oo],[180,90-oo]]).extentMinor([[-180,-80-oo],[180,80+oo]])}function Qc(){return Zc()()}var Jc,Kc,tf,nf,ef=function(t,n){var e=t[0]*ho,r=t[1]*ho,i=n[0]*ho,u=n[1]*ho,o=yo(r),a=wo(r),c=yo(u),f=wo(u),s=o*yo(e),l=o*wo(e),h=c*yo(i),d=c*wo(i),p=2*Co(To(Ao(u-r)+o*c*Ao(i-e))),v=wo(p),g=p?function(t){var n=wo(t*=p)/v,e=wo(p-t)/v,r=e*s+n*h,i=e*l+n*d,u=e*a+n*f;return[go(i,r)*lo,go(u,To(r*r+i*i))*lo]}:function(){return[e*lo,r*lo]};return g.distance=p,g},rf=function(t){return t},uf=eo(),of=eo(),af={point:No,lineStart:No,lineEnd:No,polygonStart:function(){af.lineStart=cf,af.lineEnd=lf},polygonEnd:function(){af.lineStart=af.lineEnd=af.point=No,uf.add(po(of)),of.reset()},result:function(){var t=uf/2;return uf.reset(),t}};function cf(){af.point=ff}function ff(t,n){af.point=sf,Jc=tf=t,Kc=nf=n}function sf(t,n){of.add(nf*t-tf*n),tf=t,nf=n}function lf(){sf(Jc,Kc)}var hf,df,pf,vf,gf=af,yf=1/0,_f=yf,mf=-yf,xf=mf,bf={point:function(t,n){tmf&&(mf=t),n<_f&&(_f=n),n>xf&&(xf=n)},lineStart:No,lineEnd:No,polygonStart:No,polygonEnd:No,result:function(){var t=[[yf,_f],[mf,xf]];return mf=xf=-(_f=yf=1/0),t}},wf=0,Mf=0,Tf=0,Sf=0,kf=0,Cf=0,Af=0,Nf=0,Ef=0,zf={point:Pf,lineStart:Of,lineEnd:qf,polygonStart:function(){zf.lineStart=Uf,zf.lineEnd=Df},polygonEnd:function(){zf.point=Pf,zf.lineStart=Of,zf.lineEnd=qf},result:function(){var t=Ef?[Af/Ef,Nf/Ef]:Cf?[Sf/Cf,kf/Cf]:Tf?[wf/Tf,Mf/Tf]:[NaN,NaN];return wf=Mf=Tf=Sf=kf=Cf=Af=Nf=Ef=0,t}};function Pf(t,n){wf+=t,Mf+=n,++Tf}function Of(){zf.point=Rf}function Rf(t,n){zf.point=Lf,Pf(pf=t,vf=n)}function Lf(t,n){var e=t-pf,r=n-vf,i=To(e*e+r*r);Sf+=i*(pf+t)/2,kf+=i*(vf+n)/2,Cf+=i,Pf(pf=t,vf=n)}function qf(){zf.point=Pf}function Uf(){zf.point=Ff}function Df(){jf(hf,df)}function Ff(t,n){zf.point=jf,Pf(hf=pf=t,df=vf=n)}function jf(t,n){var e=t-pf,r=n-vf,i=To(e*e+r*r);Sf+=i*(pf+t)/2,kf+=i*(vf+n)/2,Cf+=i,Af+=(i=vf*t-pf*n)*(pf+t),Nf+=i*(vf+n),Ef+=3*i,Pf(pf=t,vf=n)}var If=zf;function Hf(t){this._context=t}Hf.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,so)}},result:No};var Yf,Bf,Vf,Xf,Wf,$f=eo(),Gf={point:No,lineStart:function(){Gf.point=Zf},lineEnd:function(){Yf&&Qf(Bf,Vf),Gf.point=No},polygonStart:function(){Yf=!0},polygonEnd:function(){Yf=null},result:function(){var t=+$f;return $f.reset(),t}};function Zf(t,n){Gf.point=Qf,Bf=Xf=t,Vf=Wf=n}function Qf(t,n){Xf-=t,Wf-=n,$f.add(To(Xf*Xf+Wf*Wf)),Xf=t,Wf=n}var Jf=Gf;function Kf(){this._string=[]}function ts(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}Kf.prototype={_radius:4.5,_circle:ts(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=ts(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var ns=function(t,n){var e,r,i=4.5;function u(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),jo(t,e(r))),r.result()}return u.area=function(t){return jo(t,e(gf)),gf.result()},u.measure=function(t){return jo(t,e(Jf)),Jf.result()},u.bounds=function(t){return jo(t,e(bf)),bf.result()},u.centroid=function(t){return jo(t,e(If)),If.result()},u.projection=function(n){return arguments.length?(e=null==n?(t=null,rf):(t=n).stream,u):t},u.context=function(t){return arguments.length?(r=null==t?(n=null,new Kf):new Hf(n=t),"function"!=typeof i&&r.pointRadius(i),u):n},u.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),u):i},u.projection(t).context(n)},es=function(t){return{stream:rs(t)}};function rs(t){return function(n){var e=new is;for(var r in t)e[r]=t[r];return e.stream=n,e}}function is(){}function us(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),jo(e,t.stream(bf)),n(bf.result()),null!=r&&t.clipExtent(r),t}function os(t,n,e){return us(t,(function(e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],u=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),o=+n[0][0]+(r-u*(e[1][0]+e[0][0]))/2,a=+n[0][1]+(i-u*(e[1][1]+e[0][1]))/2;t.scale(150*u).translate([o,a])}),e)}function as(t,n,e){return os(t,[[0,0],n],e)}function cs(t,n,e){return us(t,(function(e){var r=+n,i=r/(e[1][0]-e[0][0]),u=(r-i*(e[1][0]+e[0][0]))/2,o=-i*e[0][1];t.scale(150*i).translate([u,o])}),e)}function fs(t,n,e){return us(t,(function(e){var r=+n,i=r/(e[1][1]-e[0][1]),u=-i*e[0][0],o=(r-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([u,o])}),e)}is.prototype={constructor:is,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var ss=16,ls=yo(30*ho),hs=function(t,n){return+n?function(t,n){function e(r,i,u,o,a,c,f,s,l,h,d,p,v,g){var y=f-r,_=s-i,m=y*y+_*_;if(m>4*n&&v--){var x=o+h,b=a+d,w=c+p,M=To(x*x+b*b+w*w),T=Co(w/=M),S=po(po(w)-1)n||po((y*N+_*E)/m-.5)>.3||o*h+a*d+c*p2?t[2]%360*ho:0,A()):[g*lo,y*lo,_*lo]},S.precision=function(t){return arguments.length?(T=hs(C,M=t*t),N()):To(M)},S.fitExtent=function(t,n){return os(S,t,n)},S.fitSize=function(t,n){return as(S,t,n)},S.fitWidth=function(t,n){return cs(S,t,n)},S.fitHeight=function(t,n){return fs(S,t,n)},function(){return n=t.apply(this,arguments),S.invert=n.invert&&k,A()}}function gs(t){var n=0,e=ao/3,r=vs(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*ho,e=t[1]*ho):[n*lo,e*lo]},i}function ys(t,n){var e=wo(t),r=(e+wo(n))/2;if(po(r)=.12&&i<.234&&r>=-.425&&r<-.214?a:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:o).invert(t)},s.stream=function(e){return t&&n===e?t:(r=[o.stream(n=e),a.stream(e),c.stream(e)],i=r.length,t={point:function(t,n){for(var e=-1;++e0?n<-co+oo&&(n=-co+oo):n>co-oo&&(n=co-oo);var e=i/bo(Es(n),r);return[e*wo(r*t),i-e*yo(r*t)]}return u.invert=function(t,n){var e=i-n,u=Mo(r)*To(t*t+e*e);return[go(t,po(e))/r*Mo(e),2*vo(bo(i/u,1/r))-co]},u}var Ps=function(){return gs(zs).scale(109.5).parallels([30,30])};function Os(t,n){return[t,n]}Os.invert=Os;var Rs=function(){return ps(Os).scale(152.63)};function Ls(t,n){var e=yo(t),r=t===n?wo(t):(e-yo(n))/(n-t),i=e/r+t;if(po(r)oo&&--i>0);return[t/(.8707+(u=r*r)*(u*(u*u*u*(.003971-.001529*u)-.013791)-.131979)),r]};var Hs=function(){return ps(Is).scale(175.295)};function Ys(t,n){return[yo(n)*wo(t),wo(n)]}Ys.invert=ws(Co);var Bs=function(){return ps(Ys).scale(249.5).clipAngle(90+oo)};function Vs(t,n){var e=yo(n),r=1+yo(t)*e;return[e*wo(t)/r,wo(n)/r]}Vs.invert=ws((function(t){return 2*vo(t)}));var Xs=function(){return ps(Vs).scale(250).clipAngle(142)};function Ws(t,n){return[xo(So((co+n)/2)),-t]}Ws.invert=function(t,n){return[-n,2*vo(mo(t))-co]};var $s=function(){var t=Ns(Ws),n=t.center,e=t.rotate;return t.center=function(t){return arguments.length?n([-t[1],t[0]]):[(t=n())[1],-t[0]]},t.rotate=function(t){return arguments.length?e([t[0],t[1],t.length>2?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)};function Gs(t,n){return t.parent===n.parent?1:2}function Zs(t,n){return t+n.x}function Qs(t,n){return Math.max(t,n.y)}var Js=function(){var t=Gs,n=1,e=1,r=!1;function i(i){var u,o=0;i.eachAfter((function(n){var e=n.children;e?(n.x=function(t){return t.reduce(Zs,0)/t.length}(e),n.y=function(t){return 1+t.reduce(Qs,0)}(e)):(n.x=u?o+=t(n,u):0,n.y=0,u=n)}));var a=function(t){for(var n;n=t.children;)t=n[0];return t}(i),c=function(t){for(var n;n=t.children;)t=n[n.length-1];return t}(i),f=a.x-t(a,c)/2,s=c.x+t(c,a)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*n,t.y=(i.y-t.y)*e}:function(t){t.x=(t.x-f)/(s-f)*n,t.y=(1-(i.y?t.y/i.y:1))*e})}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i};function Ks(t){var n=0,e=t.children,r=e&&e.length;if(r)for(;--r>=0;)n+=e[r].value;else n=1;t.value=n}function tl(t,n){var e,r,i,u,o,a=new il(t),c=+t.value&&(a.value=t.value),f=[a];for(null==n&&(n=nl);e=f.pop();)if(c&&(e.value=+e.data.value),(i=n(e.data))&&(o=i.length))for(e.children=new Array(o),u=o-1;u>=0;--u)f.push(r=e.children[u]=new il(i[u])),r.parent=e,r.depth=e.depth+1;return a.eachBefore(rl)}function nl(t){return t.children}function el(t){t.data=t.data.data}function rl(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function il(t){this.data=t,this.depth=this.height=0,this.parent=null}il.prototype=tl.prototype={constructor:il,count:function(){return this.eachAfter(Ks)},each:function(t){var n,e,r,i,u=this,o=[u];do{for(n=o.reverse(),o=[];u=n.pop();)if(t(u),e=u.children)for(r=0,i=e.length;r=0;--e)i.push(n[e]);return this},sum:function(t){return this.eachAfter((function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e}))},sort:function(t){return this.eachBefore((function(n){n.children&&n.children.sort(t)}))},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){var t=[];return this.each((function(n){t.push(n)})),t},leaves:function(){var t=[];return this.eachBefore((function(n){n.children||t.push(n)})),t},links:function(){var t=this,n=[];return t.each((function(e){e!==t&&n.push({source:e.parent,target:e})})),n},copy:function(){return tl(this).eachBefore(el)}};var ul=Array.prototype.slice,ol=function(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(ul.call(t))).length,u=[];r0&&e*e>r*r+i*i}function sl(t,n){for(var e=0;ee*e+r*r}function gl(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,u=(n.y*e.r+e.y*n.r)/r;return i*i+u*u}function yl(t){this._=t,this.next=null,this.previous=null}function _l(t){if(!(i=t.length))return 0;var n,e,r,i,u,o,a,c,f,s,l;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;pl(e,n,r=t[2]),n=new yl(n),e=new yl(e),r=new yl(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(a=3;a0)throw new Error("cycle");return u}return e.id=function(n){return arguments.length?(t=xl(n),e):t},e.parentId=function(t){return arguments.length?(n=xl(t),e):n},e};function Ul(t,n){return t.parent===n.parent?1:2}function Dl(t){var n=t.children;return n?n[0]:t.t}function Fl(t){var n=t.children;return n?n[n.length-1]:t.t}function jl(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function Il(t,n,e){return t.a.parent===n.parent?t.a:e}function Hl(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}Hl.prototype=Object.create(il.prototype);var Yl=function(){var t=Ul,n=1,e=1,r=null;function i(i){var c=function(t){for(var n,e,r,i,u,o=new Hl(t,0),a=[o];n=a.pop();)if(r=n._.children)for(n.children=new Array(u=r.length),i=u-1;i>=0;--i)a.push(e=n.children[i]=new Hl(r[i],i)),e.parent=n;return(o.parent=new Hl(null,0)).children=[o],o}(i);if(c.eachAfter(u),c.parent.m=-c.z,c.eachBefore(o),r)i.eachBefore(a);else{var f=i,s=i,l=i;i.eachBefore((function(t){t.xs.x&&(s=t),t.depth>l.depth&&(l=t)}));var h=f===s?1:t(f,s)/2,d=h-f.x,p=n/(s.x+h+d),v=e/(l.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*v}))}return i}function u(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,u=i.length;--u>=0;)(n=i[u]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var u=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-u):n.z=u}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,u=n,o=n,a=e,c=u.parent.children[0],f=u.m,s=o.m,l=a.m,h=c.m;a=Fl(a),u=Dl(u),a&&u;)c=Dl(c),(o=Fl(o)).a=n,(i=a.z+l-u.z-f+t(a._,u._))>0&&(jl(Il(a,n,r),n,i),f+=i,s+=i),l+=a.m,f+=u.m,h+=c.m,s+=o.m;a&&!Fl(o)&&(o.t=a,o.m+=l-s),u&&!Dl(c)&&(c.t=u,c.m+=f-h,r=n)}return r}(n,i,n.parent.A||r[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function a(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},Bl=function(t,n,e,r,i){for(var u,o=t.children,a=-1,c=o.length,f=t.value&&(i-e)/t.value;++ah&&(h=a),g=s*s*v,(d=Math.max(h/g,g/l))>p){s-=a;break}p=d}y.push(o={value:s,dice:c1?n:1)},e}(Vl),$l=function(){var t=Wl,n=!1,e=1,r=1,i=[0],u=bl,o=bl,a=bl,c=bl,f=bl;function s(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(l),i=[0],n&&t.eachBefore(Al),t}function l(n){var e=i[n.depth],r=n.x0+e,s=n.y0+e,l=n.x1-e,h=n.y1-e;l=e-1){var s=a[n];return s.x0=i,s.y0=u,s.x1=o,void(s.y1=c)}for(var l=f[n],h=r/2+l,d=n+1,p=e-1;d>>1;f[v]c-u){var _=(i*y+o*g)/r;t(n,d,g,i,u,_,c),t(d,e,y,_,u,o,c)}else{var m=(u*y+c*g)/r;t(n,d,g,i,u,o,m),t(d,e,y,i,m,o,c)}}(0,c,t.value,n,e,r,i)},Zl=function(t,n,e,r,i){(1&t.depth?Bl:Nl)(t,n,e,r,i)},Ql=function t(n){function e(t,e,r,i,u){if((o=t._squarify)&&o.ratio===n)for(var o,a,c,f,s,l=-1,h=o.length,d=t.value;++l1?n:1)},e}(Vl),Jl=function(t){for(var n,e=-1,r=t.length,i=t[r-1],u=0;++e1&&th(t[e[r-2]],t[e[r-1]],t[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}var rh=function(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n=0;--n)f.push(t[r[u[n]][2]]);for(n=+a;na!=f>a&&o<(c-e)*(a-r)/(f-r)+e&&(s=!s),c=e,f=r;return s},uh=function(t){for(var n,e,r=-1,i=t.length,u=t[i-1],o=u[0],a=u[1],c=0;++r=0;)if((e=t._tasks[r])&&(t._tasks[r]=null,e.abort))try{e.abort()}catch(n){}t._active=NaN,hh(t)}function hh(t){if(!t._active&&t._call){var n=t._data;t._data=void 0,t._call(t._error,n)}}function dh(t){if(null==t)t=1/0;else if(!((t=+t)>=1))throw new Error("invalid concurrency");return new ch(t)}ch.prototype=dh.prototype={constructor:ch,defer:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("defer after await");if(null!=this._error)return this;var n=oh.call(arguments,1);return n.push(t),++this._waiting,this._tasks.push(n),fh(this),this},abort:function(){return null==this._error&&lh(this,new Error("abort")),this},await:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=function(n,e){t.apply(null,[n].concat(e))},hh(this),this},awaitAll:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=t,hh(this),this}};var ph=function(){return Math.random()},vh=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(ph),gh=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var u;if(null!=r)u=r,r=null;else do{r=2*n()-1,u=2*n()-1,i=r*r+u*u}while(!i||i>1);return t+e*u*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(ph),yh=function t(n){function e(){var t=gh.source(n).apply(this,arguments);return function(){return Math.exp(t())}}return e.source=t,e}(ph),_h=function t(n){function e(t){return function(){for(var e=0,r=0;r=200&&r<300||304===r){if(i)try{n=i.call(e,c)}catch(t){return void o.call("error",e,t)}else n=c;o.call("load",e,n)}else o.call("error",e,t)}if("undefined"==typeof XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(t)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=c.ontimeout=h:c.onreadystatechange=function(t){c.readyState>3&&h(t)},c.onprogress=function(t){o.call("progress",e,t)},e={header:function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?a.get(t):(null==n?a.remove(t):a.set(t,n+""),e)},mimeType:function(t){return arguments.length?(r=null==t?null:t+"",e):r},responseType:function(t){return arguments.length?(u=t,e):u},timeout:function(t){return arguments.length?(l=+t,e):l},user:function(t){return arguments.length<1?f:(f=null==t?null:t+"",e)},password:function(t){return arguments.length<1?s:(s=null==t?null:t+"",e)},response:function(t){return i=t,e},get:function(t,n){return e.send("GET",t,n)},post:function(t,n){return e.send("POST",t,n)},send:function(n,i,h){return c.open(n,t,!0,f,s),null==r||a.has("accept")||a.set("accept",r+",*/*"),c.setRequestHeader&&a.each((function(t,n){c.setRequestHeader(n,t)})),null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),l>0&&(c.timeout=l),null==h&&"function"==typeof i&&(h=i,i=null),null!=h&&1===h.length&&(h=function(t){return function(n,e){t(null==n?e:null)}}(h)),null!=h&&e.on("error",h).on("load",(function(t){h(null,t)})),o.call("beforesend",e,c),c.send(null==i?null:i),e},abort:function(){return c.abort(),e},on:function(){var t=o.on.apply(o,arguments);return t===o?e:t}},null!=n){if("function"!=typeof n)throw new Error("invalid callback: "+n);return e.get(n)}return e},wh=function(t,n){return function(e,r){var i=bh(e).mimeType(t).response(n);if(null!=r){if("function"!=typeof r)throw new Error("invalid callback: "+r);return i.get(r)}return i}},Mh=wh("text/html",(function(t){return document.createRange().createContextualFragment(t.responseText)})),Th=wh("application/json",(function(t){return JSON.parse(t.responseText)})),Sh=wh("text/plain",(function(t){return t.responseText})),kh=wh("application/xml",(function(t){var n=t.responseXML;if(!n)throw new Error("parse error");return n})),Ch=function(t,n){return function(e,r,i){arguments.length<3&&(i=r,r=null);var u=bh(e).mimeType(t);return u.row=function(t){return arguments.length?u.response(function(t,n){return function(e){return t(e.responseText,n)}}(n,r=t)):r},u.row(r),i?u.get(i):u}},Ah=Ch("text/csv",ru),Nh=Ch("text/tab-separated-values",cu),Eh=Array.prototype,zh=Eh.map,Ph=Eh.slice,Oh={name:"implicit"};function Rh(t){var n=Object($i.c)(),e=[],r=Oh;function i(i){var u=i+"",o=n.get(u);if(!o){if(r!==Oh)return r;n.set(u,o=e.push(i))}return t[(o-1)%t.length]}return t=null==t?[]:Ph.call(t),i.domain=function(t){if(!arguments.length)return e.slice();e=[],n=Object($i.c)();for(var r,u,o=-1,a=t.length;++o2?Hh:Ih,r=i=null,s}function s(n){return(r||(r=e(u,o,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=n?0:t>=e?1:r(t)}}}(t):t,a)))(+n)}return s.invert=function(t){return(i||(i=e(o,u,jh,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}(n):n)))(+t)},s.domain=function(t){return arguments.length?(u=zh.call(t,Dh),f()):u.slice()},s.range=function(t){return arguments.length?(o=Ph.call(t),f()):o.slice()},s.rangeRound=function(t){return o=Ph.call(t),a=ue,f()},s.clamp=function(t){return arguments.length?(c=!!t,f()):c},s.interpolate=function(t){return arguments.length?(a=t,f()):a},f()}var Vh=function(t,n,e){var i,u=t[0],o=t[t.length-1],a=Object(r.A)(u,o,null==n?10:n);switch((e=Bu(null==e?",f":e)).type){case"s":var c=Math.max(Math.abs(u),Math.abs(o));return null!=e.precision||isNaN(i=to(a,c))||(e.precision=i),$u(e,c);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(i=no(a,Math.max(Math.abs(u),Math.abs(o))))||(e.precision=i-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(i=Ku(a))||(e.precision=i-2*("%"===e.type))}return Wu(e)};function Xh(t){var n=t.domain;return t.ticks=function(t){var e=n();return Object(r.B)(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return Vh(n(),t,e)},t.nice=function(e){null==e&&(e=10);var i,u=n(),o=0,a=u.length-1,c=u[o],f=u[a];return f0?(c=Math.floor(c/i)*i,f=Math.ceil(f/i)*i,i=Object(r.z)(c,f,e)):i<0&&(c=Math.ceil(c*i)/i,f=Math.floor(f*i)/i,i=Object(r.z)(c,f,e)),i>0?(u[o]=Math.floor(c/i)*i,u[a]=Math.ceil(f/i)*i,n(u)):i<0&&(u[o]=Math.ceil(c*i)/i,u[a]=Math.floor(f*i)/i,n(u)),t},t}function Wh(){var t=Bh(jh,Kn);return t.copy=function(){return Yh(t,Wh())},Xh(t)}function $h(){var t=[0,1];function n(t){return+t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=zh.call(e,Dh),n):t.slice()},n.copy=function(){return $h().domain(t)},Xh(n)}var Gh=function(t,n){var e,r=0,i=(t=t.slice()).length-1,u=t[r],o=t[i];return o0){for(;df)break;g.push(h)}}else for(;d=1;--l)if(!((h=s*l)f)break;g.push(h)}}else g=Object(r.B)(d,p,Math.min(p-d,v)).map(u);return o?g.reverse():g},t.tickFormat=function(n,r){if(null==r&&(r=10===e?".0e":","),"function"!=typeof r&&(r=Wu(r)),n===1/0)return r;null==n&&(n=10);var o=Math.max(1,e*n/t.ticks().length);return function(t){var n=t/u(Math.round(i(t)));return n*e0?e[i-1]:t[0],i=e?[i[e-1],n]:[i[o-1],i[o]]},o.copy=function(){return ad().domain([t,n]).range(u)},Xh(o)}function cd(){var t=[.5],n=[0,1],e=1;function i(i){if(i<=i)return n[Object(r.b)(t,i,0,e)]}return i.domain=function(r){return arguments.length?(t=Ph.call(r),e=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(r){return arguments.length?(n=Ph.call(r),e=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.copy=function(){return cd().domain(t).range(n)},i}var fd=new Date,sd=new Date;function ld(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n0))return a;do{a.push(o=new Date(+e)),n(e,u),t(e)}while(o=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););}))},e&&(i.count=function(n,r){return fd.setTime(+n),sd.setTime(+r),t(fd),t(sd),Math.floor(e(fd,sd))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var hd=ld((function(){}),(function(t,n){t.setTime(+t+n)}),(function(t,n){return n-t}));hd.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?ld((function(n){n.setTime(Math.floor(n/t)*t)}),(function(n,e){n.setTime(+n+e*t)}),(function(n,e){return(e-n)/t})):hd:null};var dd=hd,pd=hd.range,vd=6e4,gd=6048e5,yd=ld((function(t){t.setTime(1e3*Math.floor(t/1e3))}),(function(t,n){t.setTime(+t+1e3*n)}),(function(t,n){return(n-t)/1e3}),(function(t){return t.getUTCSeconds()})),_d=yd,md=yd.range,xd=ld((function(t){t.setTime(Math.floor(t/vd)*vd)}),(function(t,n){t.setTime(+t+n*vd)}),(function(t,n){return(n-t)/vd}),(function(t){return t.getMinutes()})),bd=xd,wd=xd.range,Md=ld((function(t){var n=t.getTimezoneOffset()*vd%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getHours()})),Td=Md,Sd=Md.range,kd=ld((function(t){t.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*vd)/864e5}),(function(t){return t.getDate()-1})),Cd=kd,Ad=kd.range;function Nd(t){return ld((function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+7*n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*vd)/gd}))}var Ed=Nd(0),zd=Nd(1),Pd=Nd(2),Od=Nd(3),Rd=Nd(4),Ld=Nd(5),qd=Nd(6),Ud=Ed.range,Dd=zd.range,Fd=Pd.range,jd=Od.range,Id=Rd.range,Hd=Ld.range,Yd=qd.range,Bd=ld((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,n){t.setMonth(t.getMonth()+n)}),(function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),Vd=Bd,Xd=Bd.range,Wd=ld((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n)}),(function(t,n){return n.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Wd.every=function(t){return isFinite(t=Math.floor(t))&&t>0?ld((function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)}),(function(n,e){n.setFullYear(n.getFullYear()+e*t)})):null};var $d=Wd,Gd=Wd.range,Zd=ld((function(t){t.setUTCSeconds(0,0)}),(function(t,n){t.setTime(+t+n*vd)}),(function(t,n){return(n-t)/vd}),(function(t){return t.getUTCMinutes()})),Qd=Zd,Jd=Zd.range,Kd=ld((function(t){t.setUTCMinutes(0,0,0)}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getUTCHours()})),tp=Kd,np=Kd.range,ep=ld((function(t){t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+n)}),(function(t,n){return(n-t)/864e5}),(function(t){return t.getUTCDate()-1})),rp=ep,ip=ep.range;function up(t){return ld((function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+7*n)}),(function(t,n){return(n-t)/gd}))}var op=up(0),ap=up(1),cp=up(2),fp=up(3),sp=up(4),lp=up(5),hp=up(6),dp=op.range,pp=ap.range,vp=cp.range,gp=fp.range,yp=sp.range,_p=lp.range,mp=hp.range,xp=ld((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCMonth(t.getUTCMonth()+n)}),(function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),bp=xp,wp=xp.range,Mp=ld((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)}),(function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));Mp.every=function(t){return isFinite(t=Math.floor(t))&&t>0?ld((function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)}),(function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)})):null};var Tp=Mp,Sp=Mp.range;function kp(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Cp(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Ap(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function Np(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,u=t.days,o=t.shortDays,a=t.months,c=t.shortMonths,f=Ip(i),s=Hp(i),l=Ip(u),h=Hp(u),d=Ip(o),p=Hp(o),v=Ip(a),g=Hp(a),y=Ip(c),_=Hp(c),m={a:function(t){return o[t.getDay()]},A:function(t){return u[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:cv,e:cv,f:dv,H:fv,I:sv,j:lv,L:hv,m:pv,M:vv,p:function(t){return i[+(t.getHours()>=12)]},Q:Yv,s:Bv,S:gv,u:yv,U:_v,V:mv,w:xv,W:bv,x:null,X:null,y:wv,Y:Mv,Z:Tv,"%":Hv},x={a:function(t){return o[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:Sv,e:Sv,f:Ev,H:kv,I:Cv,j:Av,L:Nv,m:zv,M:Pv,p:function(t){return i[+(t.getUTCHours()>=12)]},Q:Yv,s:Bv,S:Ov,u:Rv,U:Lv,V:qv,w:Uv,W:Dv,x:null,X:null,y:Fv,Y:jv,Z:Iv,"%":Hv},b={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=l.exec(n.slice(e));return r?(t.w=h[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=y.exec(n.slice(e));return r?(t.m=_[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=g[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return T(t,n,e,r)},d:Jp,e:Jp,f:iv,H:tv,I:tv,j:Kp,L:rv,m:Qp,M:nv,p:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.p=s[r[0].toLowerCase()],e+r[0].length):-1},Q:ov,s:av,S:ev,u:Bp,U:Vp,V:Xp,w:Yp,W:Wp,x:function(t,n,r){return T(t,e,n,r)},X:function(t,n,e){return T(t,r,n,e)},y:Gp,Y:$p,Z:Zp,"%":uv};function w(t,n){return function(e){var r,i,u,o=[],a=-1,c=0,f=t.length;for(e instanceof Date||(e=new Date(+e));++a53)return null;"w"in u||(u.w=1),"Z"in u?(r=(i=(r=Cp(Ap(u.y))).getUTCDay())>4||0===i?ap.ceil(r):ap(r),r=rp.offset(r,7*(u.V-1)),u.y=r.getUTCFullYear(),u.m=r.getUTCMonth(),u.d=r.getUTCDate()+(u.w+6)%7):(r=(i=(r=n(Ap(u.y))).getDay())>4||0===i?zd.ceil(r):zd(r),r=Cd.offset(r,7*(u.V-1)),u.y=r.getFullYear(),u.m=r.getMonth(),u.d=r.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),i="Z"in u?Cp(Ap(u.y)).getUTCDay():n(Ap(u.y)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(i+5)%7:u.w+7*u.U-(i+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,Cp(u)):n(u)}}function T(t,n,e,r){for(var i,u,o=0,a=n.length,c=e.length;o=c)return-1;if(37===(i=n.charCodeAt(o++))){if(i=n.charAt(o++),!(u=b[i in Lp?n.charAt(o++):i])||(r=u(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return m.x=w(e,m),m.X=w(r,m),m.c=w(n,m),x.x=w(e,x),x.X=w(r,x),x.c=w(n,x),{format:function(t){var n=w(t+="",m);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",kp);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",x);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t,Cp);return n.toString=function(){return t},n}}}var Ep,zp,Pp,Op,Rp,Lp={"-":"",_:" ",0:"0"},qp=/^\s*\d+/,Up=/^%/,Dp=/[\\^$*+?|[\]().{}]/g;function Fp(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",u=i.length;return r+(u68?1900:2e3),e+r[0].length):-1}function Zp(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Qp(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function Jp(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function Kp(t,n,e){var r=qp.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function tv(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function nv(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function ev(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function rv(t,n,e){var r=qp.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function iv(t,n,e){var r=qp.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function uv(t,n,e){var r=Up.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function ov(t,n,e){var r=qp.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function av(t,n,e){var r=qp.exec(n.slice(e));return r?(t.Q=1e3*+r[0],e+r[0].length):-1}function cv(t,n){return Fp(t.getDate(),n,2)}function fv(t,n){return Fp(t.getHours(),n,2)}function sv(t,n){return Fp(t.getHours()%12||12,n,2)}function lv(t,n){return Fp(1+Cd.count($d(t),t),n,3)}function hv(t,n){return Fp(t.getMilliseconds(),n,3)}function dv(t,n){return hv(t,n)+"000"}function pv(t,n){return Fp(t.getMonth()+1,n,2)}function vv(t,n){return Fp(t.getMinutes(),n,2)}function gv(t,n){return Fp(t.getSeconds(),n,2)}function yv(t){var n=t.getDay();return 0===n?7:n}function _v(t,n){return Fp(Ed.count($d(t),t),n,2)}function mv(t,n){var e=t.getDay();return t=e>=4||0===e?Rd(t):Rd.ceil(t),Fp(Rd.count($d(t),t)+(4===$d(t).getDay()),n,2)}function xv(t){return t.getDay()}function bv(t,n){return Fp(zd.count($d(t),t),n,2)}function wv(t,n){return Fp(t.getFullYear()%100,n,2)}function Mv(t,n){return Fp(t.getFullYear()%1e4,n,4)}function Tv(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Fp(n/60|0,"0",2)+Fp(n%60,"0",2)}function Sv(t,n){return Fp(t.getUTCDate(),n,2)}function kv(t,n){return Fp(t.getUTCHours(),n,2)}function Cv(t,n){return Fp(t.getUTCHours()%12||12,n,2)}function Av(t,n){return Fp(1+rp.count(Tp(t),t),n,3)}function Nv(t,n){return Fp(t.getUTCMilliseconds(),n,3)}function Ev(t,n){return Nv(t,n)+"000"}function zv(t,n){return Fp(t.getUTCMonth()+1,n,2)}function Pv(t,n){return Fp(t.getUTCMinutes(),n,2)}function Ov(t,n){return Fp(t.getUTCSeconds(),n,2)}function Rv(t){var n=t.getUTCDay();return 0===n?7:n}function Lv(t,n){return Fp(op.count(Tp(t),t),n,2)}function qv(t,n){var e=t.getUTCDay();return t=e>=4||0===e?sp(t):sp.ceil(t),Fp(sp.count(Tp(t),t)+(4===Tp(t).getUTCDay()),n,2)}function Uv(t){return t.getUTCDay()}function Dv(t,n){return Fp(ap.count(Tp(t),t),n,2)}function Fv(t,n){return Fp(t.getUTCFullYear()%100,n,2)}function jv(t,n){return Fp(t.getUTCFullYear()%1e4,n,4)}function Iv(){return"+0000"}function Hv(){return"%"}function Yv(t){return+t}function Bv(t){return Math.floor(+t/1e3)}function Vv(t){return Ep=Np(t),zp=Ep.format,Pp=Ep.parse,Op=Ep.utcFormat,Rp=Ep.utcParse,Ep}Vv({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"]});var Xv=Date.prototype.toISOString?function(t){return t.toISOString()}:Op("%Y-%m-%dT%H:%M:%S.%LZ"),Wv=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:Rp("%Y-%m-%dT%H:%M:%S.%LZ"),$v=1e3,Gv=60*$v,Zv=60*Gv,Qv=24*Zv,Jv=7*Qv,Kv=30*Qv,tg=365*Qv;function ng(t){return new Date(t)}function eg(t){return t instanceof Date?+t:+new Date(+t)}function rg(t,n,e,i,u,o,a,c,f){var s=Bh(jh,Kn),l=s.invert,h=s.domain,d=f(".%L"),p=f(":%S"),v=f("%I:%M"),g=f("%I %p"),y=f("%a %d"),_=f("%b %d"),m=f("%B"),x=f("%Y"),b=[[a,1,$v],[a,5,5*$v],[a,15,15*$v],[a,30,30*$v],[o,1,Gv],[o,5,5*Gv],[o,15,15*Gv],[o,30,30*Gv],[u,1,Zv],[u,3,3*Zv],[u,6,6*Zv],[u,12,12*Zv],[i,1,Qv],[i,2,2*Qv],[e,1,Jv],[n,1,Kv],[n,3,3*Kv],[t,1,tg]];function w(r){return(a(r)1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return pg.h=360*t-100,pg.s=1.5-1.5*n,pg.l=.8-.9*n,pg+""};function gg(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var yg=gg(og("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),_g=gg(og("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),mg=gg(og("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),xg=gg(og("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function bg(t){var n=0,e=1,r=!1;function i(i){var u=(i-n)/(e-n);return t(r?Math.max(0,Math.min(1,u)):u)}return i.domain=function(t){return arguments.length?(n=+t[0],e=+t[1],i):[n,e]},i.clamp=function(t){return arguments.length?(r=!!t,i):r},i.interpolator=function(n){return arguments.length?(t=n,i):t},i.copy=function(){return bg(t).domain([n,e]).clamp(r)},Xh(i)}var wg=e(5),Mg=function(t){return function(){return t}};function Tg(t){return t[0]}function Sg(t){return t[1]}function kg(){this._=null}function Cg(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Ag(t,n){var e=n,r=n.R,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function Ng(t,n){var e=n,r=n.L,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function Eg(t){for(;t.L;)t=t.L;return t}kg.prototype={constructor:kg,insert:function(t,n){var e,r,i;if(t){if(n.P=t,n.N=t.N,t.N&&(t.N.P=n),t.N=n,t.R){for(t=t.R;t.L;)t=t.L;t.L=n}else t.R=n;e=t}else this._?(t=Eg(this._),n.P=null,n.N=t,t.P=t.L=n,e=t):(n.P=n.N=null,this._=n,e=null);for(n.L=n.R=null,n.U=e,n.C=!0,t=n;e&&e.C;)e===(r=e.U).L?(i=r.R)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.R&&(Ag(this,e),e=(t=e).U),e.C=!1,r.C=!0,Ng(this,r)):(i=r.L)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.L&&(Ng(this,e),e=(t=e).U),e.C=!1,r.C=!0,Ag(this,r)),e=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var n,e,r,i=t.U,u=t.L,o=t.R;if(e=u?o?Eg(o):u:o,i?i.L===t?i.L=e:i.R=e:this._=e,u&&o?(r=e.C,e.C=t.C,e.L=u,u.U=e,e!==o?(i=e.U,e.U=t.U,t=e.R,i.L=t,e.R=o,o.U=e):(e.U=i,i=e,t=e.R)):(r=t.C,t=e),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((n=i.R).C&&(n.C=!1,i.C=!0,Ag(this,i),n=i.R),n.L&&n.L.C||n.R&&n.R.C){n.R&&n.R.C||(n.L.C=!1,n.C=!0,Ng(this,n),n=i.R),n.C=i.C,i.C=n.R.C=!1,Ag(this,i),t=this._;break}}else if((n=i.L).C&&(n.C=!1,i.C=!0,Ng(this,i),n=i.L),n.L&&n.L.C||n.R&&n.R.C){n.L&&n.L.C||(n.R.C=!1,n.C=!0,Ag(this,n),n=i.L),n.C=i.C,i.C=n.L.C=!1,Ng(this,i),t=this._;break}n.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var zg=kg;function Pg(t,n,e,r){var i=[null,null],u=ty.push(i)-1;return i.left=t,i.right=n,e&&Rg(i,t,n,e),r&&Rg(i,n,t,r),Jg[t.index].halfedges.push(u),Jg[n.index].halfedges.push(u),i}function Og(t,n,e){var r=[n,e];return r.left=t,r}function Rg(t,n,e,r){t[0]||t[1]?t.left===e?t[1]=r:t[0]=r:(t[0]=r,t.left=n,t.right=e)}function Lg(t,n,e,r,i){var u,o=t[0],a=t[1],c=o[0],f=o[1],s=0,l=1,h=a[0]-c,d=a[1]-f;if(u=n-c,h||!(u>0)){if(u/=h,h<0){if(u0){if(u>l)return;u>s&&(s=u)}if(u=r-c,h||!(u<0)){if(u/=h,h<0){if(u>l)return;u>s&&(s=u)}else if(h>0){if(u0)){if(u/=d,d<0){if(u0){if(u>l)return;u>s&&(s=u)}if(u=i-f,d||!(u<0)){if(u/=d,d<0){if(u>l)return;u>s&&(s=u)}else if(d>0){if(u0||l<1)||(s>0&&(t[0]=[c+s*h,f+s*d]),l<1&&(t[1]=[c+l*h,f+l*d]),!0)}}}}}function qg(t,n,e,r,i){var u=t[1];if(u)return!0;var o,a,c=t[0],f=t.left,s=t.right,l=f[0],h=f[1],d=s[0],p=s[1],v=(l+d)/2,g=(h+p)/2;if(p===h){if(v=r)return;if(l>d){if(c){if(c[1]>=i)return}else c=[v,e];u=[v,i]}else{if(c){if(c[1]1)if(l>d){if(c){if(c[1]>=i)return}else c=[(e-a)/o,e];u=[(i-a)/o,i]}else{if(c){if(c[1]=r)return}else c=[n,o*n+a];u=[r,o*r+a]}else{if(c){if(c[0]=-ey)){var d=c*c+f*f,p=s*s+l*l,v=(l*d-f*p)/h,g=(c*p-s*d)/h,y=Ig.pop()||new function(){Cg(this),this.x=this.y=this.arc=this.site=this.cy=null};y.arc=t,y.site=i,y.x=v+o,y.y=(y.cy=g+a)+Math.sqrt(v*v+g*g),t.circle=y;for(var _=null,m=Kg._;m;)if(y.yny)a=a.L;else{if(!((i=u-Zg(a,o))>ny)){r>-ny?(n=a.P,e=a):i>-ny?(n=a,e=a.N):n=e=a;break}if(!a.R){n=a;break}a=a.R}!function(t){Jg[t.index]={site:t,halfedges:[]}}(t);var c=Vg(t);if(Qg.insert(n,c),n||e){if(n===e)return Yg(n),e=Vg(n.site),Qg.insert(c,e),c.edge=e.edge=Pg(n.site,c.site),Hg(n),void Hg(e);if(e){Yg(n),Yg(e);var f=n.site,s=f[0],l=f[1],h=t[0]-s,d=t[1]-l,p=e.site,v=p[0]-s,g=p[1]-l,y=2*(h*g-d*v),_=h*h+d*d,m=v*v+g*g,x=[(g*_-d*m)/y+s,(h*m-v*_)/y+l];Rg(e.edge,f,p,x),c.edge=Pg(f,t,null,x),e.edge=Pg(t,p,null,x),Hg(n),Hg(e)}else c.edge=Pg(n.site,c.site)}}function Gg(t,n){var e=t.site,r=e[0],i=e[1],u=i-n;if(!u)return r;var o=t.P;if(!o)return-1/0;var a=(e=o.site)[0],c=e[1],f=c-n;if(!f)return a;var s=a-r,l=1/u-1/f,h=s/f;return l?(-h+Math.sqrt(h*h-2*l*(s*s/(-2*f)-c+f/2+i-u/2)))/l+r:(r+a)/2}function Zg(t,n){var e=t.N;if(e)return Gg(e,n);var r=t.site;return r[1]===n?r[0]:1/0}var Qg,Jg,Kg,ty,ny=1e-6,ey=1e-12;function ry(t,n){return n[1]-t[1]||n[0]-t[0]}function iy(t,n){var e,r,i,u=t.sort(ry).pop();for(ty=[],Jg=new Array(t.length),Qg=new zg,Kg=new zg;;)if(i=jg,u&&(!i||u[1]ny||Math.abs(i[0][1]-i[1][1])>ny)||delete ty[u]}(o,a,c,f),function(t,n,e,r){var i,u,o,a,c,f,s,l,h,d,p,v,g=Jg.length,y=!0;for(i=0;iny||Math.abs(v-h)>ny)&&(c.splice(a,0,ty.push(Og(o,d,Math.abs(p-t)ny?[t,Math.abs(l-t)ny?[Math.abs(h-r)ny?[e,Math.abs(l-e)ny?[Math.abs(h-n)=a)return null;var c=t-i.site[0],f=n-i.site[1],s=c*c+f*f;do{i=u.cells[r=o],o=null,i.halfedges.forEach((function(e){var r=u.edges[e],a=r.left;if(a!==i.site&&a||(a=r.right)){var c=t-a[0],f=n-a[1],l=c*c+f*f;lr?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>u?(u+o)/2:Math.min(0,u)||Math.max(0,o))}var _y=function(){var t,n,e=hy,r=dy,i=yy,u=vy,o=gy,a=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],f=250,s=pe,l=[],h=T("start","zoom","end"),d=500,p=150,v=0;function g(t){t.property("__zoom",py).on("wheel.zoom",M).on("mousedown.zoom",S).on("dblclick.zoom",k).filter(o).on("touchstart.zoom",C).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(t,n){return(n=Math.max(a[0],Math.min(a[1],n)))===t.k?t:new ay(n,t.x,t.y)}function _(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new ay(t.k,r,i)}function m(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,n,e){t.on("start.zoom",(function(){b(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).end()})).tween("zoom",(function(){var t=arguments,i=b(this,t),u=r.apply(this,t),o=e||m(u),a=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),c=this.__zoom,f="function"==typeof n?n.apply(this,t):n,l=s(c.invert(o).concat(a/c.k),f.invert(o).concat(a/f.k));return function(t){if(1===t)t=f;else{var n=l(t),e=a/n[2];t=new ay(e,o[0]-n[0]*e,o[1]-n[1]*e)}i.zoom(null,t)}}))}function b(t,n){for(var e,r=0,i=l.length;rv}t.zoom("mouse",i(_(t.that.__zoom,t.mouse[0]=Mt(t.that),t.mouse[1]),t.extent,c))}),!0).on("mouseup.zoom",(function(){r.on("mousemove.zoom mouseup.zoom",null),Et(ut.view,t.moved),ly(),t.end()}),!0),u=Mt(this),o=ut.clientX,a=ut.clientY;Nt(ut.view),sy(),t.mouse=[u,this.__zoom.invert(u)],or(this),t.start()}}function k(){if(e.apply(this,arguments)){var t=this.__zoom,n=Mt(this),u=t.invert(n),o=t.k*(ut.shiftKey?.5:2),a=i(_(y(t,o),n,u),r.apply(this,arguments),c);ly(),f>0?gt(this).transition().duration(f).call(x,a,n):gt(this).call(g.transform,a)}}function C(){if(e.apply(this,arguments)){var n,r,i,u,o=b(this,arguments),a=ut.changedTouches,c=a.length;for(sy(),r=0;r-1&&(n+=",");var e=t.split(".");switch(n+=".",n+=e.length>1?e[1].length:0,t.slice(-1)){case"%":n+="%";break;case"0":n+="f"}return r.format(n)}},u=function(t,n,e){var r=function(n,e,r,i,u){return!(!t.addError||!t.clearErrors||(ru?(t.addError({title:"Too Many "+e+"s",message:"This visualization requires "+(i===u?"exactly":"no more than")+" "+u+" "+e.toLowerCase()+(1===i?"":"s")+".",group:n}),1):(t.clearErrors(n),0)))},i=n.fields,u=i.pivots,o=i.dimensions,a=i.measure_like;return r("pivot-req","Pivot",u.length,e.min_pivots,e.max_pivots)&&r("dim-req","Dimension",o.length,e.min_dimensions,e.max_dimensions)&&r("mes-req","Measure",a.length,e.min_measures,e.max_measures)}},5:function(t,n,e){"use strict";var r=e(1),i=function(t){return function(){return t}},u=Math.abs,o=Math.atan2,a=Math.cos,c=Math.max,f=Math.min,s=Math.sin,l=Math.sqrt,h=1e-12,d=Math.PI,p=d/2,v=2*d;function g(t){return t>=1?p:t<=-1?-p:Math.asin(t)}function y(t){return t.innerRadius}function _(t){return t.outerRadius}function m(t){return t.startAngle}function x(t){return t.endAngle}function b(t){return t&&t.padAngle}function w(t,n,e,r,i,u,o){var a=t-e,f=n-r,s=(o?u:-u)/l(a*a+f*f),h=s*f,d=-s*a,p=t+h,v=n+d,g=e+h,y=r+d,_=(p+g)/2,m=(v+y)/2,x=g-p,b=y-v,w=x*x+b*b,M=i-u,T=p*y-g*v,S=(b<0?-1:1)*l(c(0,M*M*w-T*T)),k=(T*b-x*S)/w,C=(-T*x-b*S)/w,A=(T*b+x*S)/w,N=(-T*x+b*S)/w,E=k-_,z=C-m,P=A-_,O=N-m;return E*E+z*z>P*P+O*O&&(k=A,C=N),{cx:k,cy:C,x01:-h,y01:-d,x11:k*(i/M-1),y11:C*(i/M-1)}}var M=function(){var t=y,n=_,e=i(0),c=null,M=m,T=x,S=b,k=null;function C(){var i,y,_,m=+t.apply(this,arguments),x=+n.apply(this,arguments),b=M.apply(this,arguments)-p,C=T.apply(this,arguments)-p,A=u(C-b),N=C>b;if(k||(k=i=Object(r.a)()),xh)if(A>v-h)k.moveTo(x*a(b),x*s(b)),k.arc(0,0,x,b,C,!N),m>h&&(k.moveTo(m*a(C),m*s(C)),k.arc(0,0,m,C,b,N));else{var E,z,P=b,O=C,R=b,L=C,q=A,U=A,D=S.apply(this,arguments)/2,F=D>h&&(c?+c.apply(this,arguments):l(m*m+x*x)),j=f(u(x-m)/2,+e.apply(this,arguments)),I=j,H=j;if(F>h){var Y=g(F/m*s(D)),B=g(F/x*s(D));(q-=2*Y)>h?(R+=Y*=N?1:-1,L-=Y):(q=0,R=L=(b+C)/2),(U-=2*B)>h?(P+=B*=N?1:-1,O-=B):(U=0,P=O=(b+C)/2)}var V=x*a(P),X=x*s(P),W=m*a(L),$=m*s(L);if(j>h){var G=x*a(O),Z=x*s(O),Q=m*a(R),J=m*s(R);if(Ah?function(t,n,e,r,i,u,o,a){var c=e-t,f=r-n,s=o-i,l=a-u,h=(s*(n-u)-l*(t-i))/(l*c-s*f);return[t+h*c,n+h*f]}(V,X,Q,J,G,Z,W,$):[W,$],tt=V-K[0],nt=X-K[1],et=G-K[0],rt=Z-K[1],it=1/s(((_=(tt*et+nt*rt)/(l(tt*tt+nt*nt)*l(et*et+rt*rt)))>1?0:_<-1?d:Math.acos(_))/2),ut=l(K[0]*K[0]+K[1]*K[1]);I=f(j,(m-ut)/(it-1)),H=f(j,(x-ut)/(it+1))}}U>h?H>h?(E=w(Q,J,V,X,x,H,N),z=w(G,Z,W,$,x,H,N),k.moveTo(E.cx+E.x01,E.cy+E.y01),Hh&&q>h?I>h?(E=w(W,$,G,Z,m,-I,N),z=w(V,X,Q,J,m,-I,N),k.lineTo(E.cx+E.x01,E.cy+E.y01),I=l;--h)f.point(y[h],_[h]);f.lineEnd(),f.areaEnd()}g&&(y[s]=+t(d,s,i),_[s]=+e(d,s,i),f.point(n?+n(d,s,i):y[s],u?+u(d,s,i):_[s]))}if(p)return f=null,p+""||null}function l(){return A().defined(o).curve(c).context(a)}return s.x=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),n=null,s):t},s.x0=function(n){return arguments.length?(t="function"==typeof n?n:i(+n),s):t},s.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:i(+t),s):n},s.y=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),u=null,s):e},s.y0=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),s):e},s.y1=function(t){return arguments.length?(u=null==t?null:"function"==typeof t?t:i(+t),s):u},s.lineX0=s.lineY0=function(){return l().x(t).y(e)},s.lineY1=function(){return l().x(t).y(u)},s.lineX1=function(){return l().x(n).y(e)},s.defined=function(t){return arguments.length?(o="function"==typeof t?t:i(!!t),s):o},s.curve=function(t){return arguments.length?(c=t,null!=a&&(f=c(a)),s):c},s.context=function(t){return arguments.length?(null==t?a=f=null:f=c(a=t),s):a},s},E=function(t,n){return nt?1:n>=t?0:NaN},z=function(t){return t},P=function(){var t=z,n=E,e=null,r=i(0),u=i(v),o=i(0);function a(i){var a,c,f,s,l,h=i.length,d=0,p=new Array(h),g=new Array(h),y=+r.apply(this,arguments),_=Math.min(v,Math.max(-v,u.apply(this,arguments)-y)),m=Math.min(Math.abs(_)/h,o.apply(this,arguments)),x=m*(_<0?-1:1);for(a=0;a0&&(d+=l);for(null!=n?p.sort((function(t,e){return n(g[t],g[e])})):null!=e&&p.sort((function(t,n){return e(i[t],i[n])})),a=0,f=d?(_-h*x)/d:0;a0?l*f:0)+x,g[c]={data:i[c],index:a,value:l,startAngle:y,endAngle:s,padAngle:m};return g}return a.value=function(n){return arguments.length?(t="function"==typeof n?n:i(+n),a):t},a.sortValues=function(t){return arguments.length?(n=t,e=null,a):n},a.sort=function(t){return arguments.length?(e=t,n=null,a):e},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:i(+t),a):r},a.endAngle=function(t){return arguments.length?(u="function"==typeof t?t:i(+t),a):u},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:i(+t),a):o},a},O=L(S);function R(t){this._curve=t}function L(t){function n(n){return new R(t(n))}return n._curve=t,n}function q(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(L(t)):n()._curve},t}R.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var U=function(){return q(A().curve(O))},D=function(){var t=N().curve(O),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,u=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return q(e())},delete t.lineX0,t.lineEndAngle=function(){return q(r())},delete t.lineX1,t.lineInnerRadius=function(){return q(i())},delete t.lineY0,t.lineOuterRadius=function(){return q(u())},delete t.lineY1,t.curve=function(t){return arguments.length?n(L(t)):n()._curve},t},F=function(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]},j=Array.prototype.slice;function I(t){return t.source}function H(t){return t.target}function Y(t){var n=I,e=H,u=k,o=C,a=null;function c(){var i,c=j.call(arguments),f=n.apply(this,c),s=e.apply(this,c);if(a||(a=i=Object(r.a)()),t(a,+u.apply(this,(c[0]=f,c)),+o.apply(this,c),+u.apply(this,(c[0]=s,c)),+o.apply(this,c)),i)return a=null,i+""||null}return c.source=function(t){return arguments.length?(n=t,c):n},c.target=function(t){return arguments.length?(e=t,c):e},c.x=function(t){return arguments.length?(u="function"==typeof t?t:i(+t),c):u},c.y=function(t){return arguments.length?(o="function"==typeof t?t:i(+t),c):o},c.context=function(t){return arguments.length?(a=null==t?null:t,c):a},c}function B(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function V(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n,e=(e+i)/2,r,e,r,i)}function X(t,n,e,r,i){var u=F(n,e),o=F(n,e=(e+i)/2),a=F(r,e),c=F(r,i);t.moveTo(u[0],u[1]),t.bezierCurveTo(o[0],o[1],a[0],a[1],c[0],c[1])}function W(){return Y(B)}function $(){return Y(V)}function G(){var t=Y(X);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}var Z={draw:function(t,n){var e=Math.sqrt(n/d);t.moveTo(e,0),t.arc(0,0,e,0,v)}},Q={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},J=Math.sqrt(1/3),K=2*J,tt={draw:function(t,n){var e=Math.sqrt(n/K),r=e*J;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},nt=Math.sin(d/10)/Math.sin(7*d/10),et=Math.sin(v/10)*nt,rt=-Math.cos(v/10)*nt,it={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=et*e,i=rt*e;t.moveTo(0,-e),t.lineTo(r,i);for(var u=1;u<5;++u){var o=v*u/5,a=Math.cos(o),c=Math.sin(o);t.lineTo(c*e,-a*e),t.lineTo(a*r-c*i,c*r+a*i)}t.closePath()}},ut={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},ot=Math.sqrt(3),at={draw:function(t,n){var e=-Math.sqrt(n/(3*ot));t.moveTo(0,2*e),t.lineTo(-ot*e,-e),t.lineTo(ot*e,-e),t.closePath()}},ct=Math.sqrt(3)/2,ft=1/Math.sqrt(12),st=3*(ft/2+1),lt={draw:function(t,n){var e=Math.sqrt(n/st),r=e/2,i=e*ft,u=r,o=e*ft+e,a=-u,c=o;t.moveTo(r,i),t.lineTo(u,o),t.lineTo(a,c),t.lineTo(-.5*r-ct*i,ct*r+-.5*i),t.lineTo(-.5*u-ct*o,ct*u+-.5*o),t.lineTo(-.5*a-ct*c,ct*a+-.5*c),t.lineTo(-.5*r+ct*i,-.5*i-ct*r),t.lineTo(-.5*u+ct*o,-.5*o-ct*u),t.lineTo(-.5*a+ct*c,-.5*c-ct*a),t.closePath()}},ht=[Z,Q,tt,ut,it,at,lt],dt=function(){var t=i(Z),n=i(64),e=null;function u(){var i;if(e||(e=i=Object(r.a)()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),i)return e=null,i+""||null}return u.type=function(n){return arguments.length?(t="function"==typeof n?n:i(n),u):t},u.size=function(t){return arguments.length?(n="function"==typeof t?t:i(+t),u):n},u.context=function(t){return arguments.length?(e=null==t?null:t,u):e},u},pt=function(){};function vt(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function gt(t){this._context=t}gt.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:vt(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(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);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:vt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var yt=function(t){return new gt(t)};function _t(t){this._context=t}_t.prototype={areaStart:pt,areaEnd:pt,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(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:vt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var mt=function(t){return new _t(t)};function xt(t){this._context=t}xt.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(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:vt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var bt=function(t){return new xt(t)};function wt(t,n){this._basis=new gt(t),this._beta=n}wt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],u=n[0],o=t[e]-i,a=n[e]-u,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*o),this._beta*n[c]+(1-this._beta)*(u+r*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var Mt=function t(n){function e(t){return 1===n?new gt(t):new wt(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function Tt(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function St(t,n){this._context=t,this._k=(1-n)/6}St.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:Tt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:Tt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var kt=function t(n){function e(t){return new St(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Ct(t,n){this._context=t,this._k=(1-n)/6}Ct.prototype={areaStart:pt,areaEnd:pt,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(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Tt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var At=function t(n){function e(t){return new Ct(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Nt(t,n){this._context=t,this._k=(1-n)/6}Nt.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(t,n){switch(t=+t,n=+n,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:Tt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Et=function t(n){function e(t){return new Nt(t,n)}return e.tension=function(n){return t(+n)},e}(0);function zt(t,n,e){var r=t._x1,i=t._y1,u=t._x2,o=t._y2;if(t._l01_a>h){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>h){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);u=(u*f+t._x1*t._l23_2a-n*t._l12_2a)/s,o=(o*f+t._y1*t._l23_2a-e*t._l12_2a)/s}t._context.bezierCurveTo(r,i,u,o,t._x2,t._y2)}function Pt(t,n){this._context=t,this._alpha=n}Pt.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(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:zt(this,t,n)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Ot=function t(n){function e(t){return n?new Pt(t,n):new St(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function Rt(t,n){this._context=t,this._alpha=n}Rt.prototype={areaStart:pt,areaEnd:pt,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(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:zt(this,t,n)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Lt=function t(n){function e(t){return n?new Rt(t,n):new Ct(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function qt(t,n){this._context=t,this._alpha=n}qt.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(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+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:zt(this,t,n)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Ut=function t(n){function e(t){return n?new qt(t,n):new Nt(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function Dt(t){this._context=t}Dt.prototype={areaStart:pt,areaEnd:pt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};var Ft=function(t){return new Dt(t)};function jt(t){return t<0?-1:1}function It(t,n,e){var r=t._x1-t._x0,i=n-t._x1,u=(t._y1-t._y0)/(r||i<0&&-0),o=(e-t._y1)/(i||r<0&&-0),a=(u*i+o*r)/(r+i);return(jt(u)+jt(o))*Math.min(Math.abs(u),Math.abs(o),.5*Math.abs(a))||0}function Ht(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function Yt(t,n,e){var r=t._x0,i=t._y0,u=t._x1,o=t._y1,a=(u-r)/3;t._context.bezierCurveTo(r+a,i+a*n,u-a,o-a*e,u,o)}function Bt(t){this._context=t}function Vt(t){this._context=new Xt(t)}function Xt(t){this._context=t}function Wt(t){return new Bt(t)}function $t(t){return new Vt(t)}function Gt(t){this._context=t}function Zt(t){var n,e,r=t.length-1,i=new Array(r),u=new Array(r),o=new Array(r);for(i[0]=0,u[0]=2,o[0]=t[0]+2*t[1],n=1;n=0;--n)i[n]=(o[n]-i[n+1])/u[n];for(u[r-1]=(t[r]+i[r-1])/2,n=0;n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var Kt=function(t){return new Jt(t,.5)};function tn(t){return new Jt(t,0)}function nn(t){return new Jt(t,1)}var en=function(t,n){if((i=t.length)>1)for(var e,r,i,u=1,o=t[n[0]],a=o.length;u=0;)e[n]=n;return e};function un(t,n){return t[n]}var on=function(){var t=i([]),n=rn,e=en,r=un;function u(i){var u,o,a=t.apply(this,arguments),c=i.length,f=a.length,s=new Array(f);for(u=0;u0){for(var e,r,i,u=0,o=t[0].length;u1)for(var e,r,i,u,o,a,c=0,f=t[n[0]].length;c=0?(r[0]=u,r[1]=u+=i):i<0?(r[1]=o,r[0]=o+=i):r[0]=u},fn=function(t,n){if((e=t.length)>0){for(var e,r=0,i=t[n[0]],u=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,u=0,o=1;o=r.length)return null!=t&&e.sort(t),null!=n?n(e):e;for(var f,s,l,h=-1,d=e.length,p=r[i++],v=u(),g=a();++hr.length)return e;var o,a=i[u-1];return null!=n&&u>=r.length?o=e.entries():(o=[],e.each((function(n,e){o.push({key:e,values:t(n,u)})}))),null!=a?o.sort((function(t,n){return a(t.key,n.key)})):o}(o(t,0,f,s),0)},key:function(t){return r.push(t),e},sortKeys:function(t){return i[r.length-1]=t,e},sortValues:function(n){return t=n,e},rollup:function(t){return n=t,e}}};function a(){return{}}function c(t,n,e){t[n]=e}function f(){return u()}function s(t,n,e){t.set(n,e)}function l(){}var h=u.prototype;function d(t,n){var e=new l;if(t instanceof l)t.each((function(t){e.add(t)}));else if(t){var r=-1,i=t.length;if(null==n)for(;++r=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),o=-1,a=u.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o0)for(var e,r,i=new Array(e),u=0;u=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),k.hasOwnProperty(n)?{space:k[n],local:t}:t},A=function(t){var n=C(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===S&&n.documentElement.namespaceURI===S?n.createElement(t):n.createElementNS(e,t)}})(n)};function N(){}var E=function(t){return null==t?N:function(){return this.querySelector(t)}};function z(){return[]}var P=function(t){return null==t?z:function(){return this.querySelectorAll(t)}},O=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var R=document.documentElement;if(!R.matches){var L=R.webkitMatchesSelector||R.msMatchesSelector||R.mozMatchesSelector||R.oMatchesSelector;O=function(t){return function(){return L.call(this,t)}}}}var q=O,U=function(t){return new Array(t.length)};function D(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}D.prototype={constructor:D,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var F="$";function j(t,n,e,r,i,u){for(var o,a=0,c=n.length,f=u.length;an?1:t>=n?0:NaN}var Y=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function B(t,n){return t.style.getPropertyValue(n)||Y(t).getComputedStyle(t,null).getPropertyValue(n)}function V(t){return t.trim().split(/^|\s+/)}function X(t){return t.classList||new W(t)}function W(t){this._node=t,this._names=V(t.getAttribute("class")||"")}function $(t,n){for(var e=X(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var it={},ut=null;function ot(t,n,e){return t=at(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function at(t,n,e){return function(r){var i=ut;ut=r;try{t.call(this,this.__data__,n,e)}finally{ut=i}}}function ct(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,u=n.length;r=b&&(b=x+1);!(m=y[b])&&++b=0;)(r=i[u])&&(o&&o!==r.nextSibling&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=H);for(var e=this._groups,r=e.length,i=new Array(r),u=0;u1?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?function(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}:function(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):B(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=V(t+"");if(arguments.length<2){for(var r=X(this.node()),i=-1,u=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),o=u.length;if(!(arguments.length<2)){for(a=n?ft:ct,null==e&&(e=!1),r=0;rl}c.mouse("drag")}function v(){gt(ut.view).on("mousemove.drag mouseup.drag",null),Et(ut.view,e),At(),c.mouse("end")}function g(){if(i.apply(this,arguments)){var t,n,e=ut.changedTouches,r=u.apply(this,arguments),o=e.length;for(t=0;t>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=Vt.exec(t))?tn(parseInt(n[1],16)):(n=Xt.exec(t))?new un(n[1],n[2],n[3],1):(n=Wt.exec(t))?new un(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=$t.exec(t))?nn(n[1],n[2],n[3],n[4]):(n=Gt.exec(t))?nn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Zt.exec(t))?on(n[1],n[2]/100,n[3]/100,1):(n=Qt.exec(t))?on(n[1],n[2]/100,n[3]/100,n[4]):Jt.hasOwnProperty(t)?tn(Jt[t]):"transparent"===t?new un(NaN,NaN,NaN,0):null}function tn(t){return new un(t>>16&255,t>>8&255,255&t,1)}function nn(t,n,e,r){return r<=0&&(t=n=e=NaN),new un(t,n,e,r)}function en(t){return t instanceof jt||(t=Kt(t)),t?new un((t=t.rgb()).r,t.g,t.b,t.opacity):new un}function rn(t,n,e,r){return 1===arguments.length?en(t):new un(t,n,e,null==r?1:r)}function un(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function on(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new cn(t,n,e,r)}function an(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof cn)return new cn(t.h,t.s,t.l,t.opacity);if(t instanceof jt||(t=Kt(t)),!t)return new cn;if(t instanceof cn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),u=Math.max(n,e,r),o=NaN,a=u-i,c=(u+i)/2;return a?(o=n===u?(e-r)/a+6*(e0&&c<1?0:o,new cn(o,a,c,t.opacity)}(t):new cn(t,n,e,null==r?1:r)}function cn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function fn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Dt(jt,Kt,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),Dt(un,rn,Ft(jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new un(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new un(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),Dt(cn,an,Ft(jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new cn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new cn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new un(fn(t>=240?t-240:t+120,i,r),fn(t,i,r),fn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var sn=Math.PI/180,ln=180/Math.PI,hn=.95047,dn=1,pn=1.08883,vn=4/29,gn=6/29,yn=3*gn*gn,_n=gn*gn*gn;function mn(t){if(t instanceof bn)return new bn(t.l,t.a,t.b,t.opacity);if(t instanceof Cn){var n=t.h*sn;return new bn(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof un||(t=en(t));var e=Sn(t.r),r=Sn(t.g),i=Sn(t.b),u=wn((.4124564*e+.3575761*r+.1804375*i)/hn),o=wn((.2126729*e+.7151522*r+.072175*i)/dn);return new bn(116*o-16,500*(u-o),200*(o-wn((.0193339*e+.119192*r+.9503041*i)/pn)),t.opacity)}function xn(t,n,e,r){return 1===arguments.length?mn(t):new bn(t,n,e,null==r?1:r)}function bn(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function wn(t){return t>_n?Math.pow(t,1/3):t/yn+vn}function Mn(t){return t>gn?t*t*t:yn*(t-vn)}function Tn(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Sn(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function kn(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof Cn)return new Cn(t.h,t.c,t.l,t.opacity);t instanceof bn||(t=mn(t));var n=Math.atan2(t.b,t.a)*ln;return new Cn(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new Cn(t,n,e,null==r?1:r)}function Cn(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}Dt(bn,xn,Ft(jt,{brighter:function(t){return new bn(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new bn(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=dn*Mn(t),new un(Tn(3.2404542*(n=hn*Mn(n))-1.5371385*t-.4985314*(e=pn*Mn(e))),Tn(-.969266*n+1.8760108*t+.041556*e),Tn(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),Dt(Cn,kn,Ft(jt,{brighter:function(t){return new Cn(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Cn(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return mn(this).rgb()}}));var An=-.29227,Nn=-.90649,En=1.97294,zn=En*Nn,Pn=1.78277*En,On=1.78277*An- -.14861*Nn;function Rn(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof Ln)return new Ln(t.h,t.s,t.l,t.opacity);t instanceof un||(t=en(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(On*r+zn*n-Pn*e)/(On+zn-Pn),u=r-i,o=(En*(e-i)-An*u)/Nn,a=Math.sqrt(o*o+u*u)/(En*i*(1-i)),c=a?Math.atan2(o,u)*ln-120:NaN;return new Ln(c<0?c+360:c,a,i,t.opacity)}(t):new Ln(t,n,e,null==r?1:r)}function Ln(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function qn(t,n,e,r,i){var u=t*t,o=u*t;return((1-3*t+3*u-o)*n+(4-6*u+3*o)*e+(1+3*t+3*u-3*o)*r+o*i)/6}Dt(Ln,Rn,Ft(jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ln(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ln(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*sn,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new un(255*(n+e*(-.14861*r+1.78277*i)),255*(n+e*(An*r+Nn*i)),255*(n+e*(En*r)),this.opacity)}}));var Un=function(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],u=t[r+1],o=r>0?t[r-1]:2*i-u,a=r180||e<-180?e-360*Math.round(e/360):e):Fn(isNaN(t)?n:t)}function Hn(t,n){var e=n-t;return e?jn(t,e):Fn(isNaN(t)?n:t)}var Yn=function t(n){var e=function(t){return 1==(t=+t)?Hn:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):Fn(isNaN(n)?e:n)}}(n);function r(t,n){var r=e((t=rn(t)).r,(n=rn(n)).r),i=e(t.g,n.g),u=e(t.b,n.b),o=Hn(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=u(n),t.opacity=o(n),t+""}}return r.gamma=t,r}(1);function Bn(t){return function(n){var e,r,i=n.length,u=new Array(i),o=new Array(i),a=new Array(i);for(e=0;eu&&(i=n.slice(u,i),a[o]?a[o]+=i:a[++o]=i),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,c.push({i:o,x:Kn(e,r)})),u=ee.lastIndex;return u180?n+=360:n-t>180&&(t+=360),u.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Kn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(u.rotate,o.rotate,a,c),function(t,n,e,u){t!==n?u.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Kn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(u.skewX,o.skewX,a,c),function(t,n,e,r,u,o){if(t!==e||n!==r){var a=u.push(i(u)+"scale(",null,",",null,")");o.push({i:a-4,x:Kn(t,e)},{i:a-2,x:Kn(n,r)})}else 1===e&&1===r||u.push(i(u)+"scale("+e+","+r+")")}(u.scaleX,u.scaleY,o.scaleX,o.scaleY,a,c),u=o=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(null,t),n=n._next;--Ae}function He(){Oe=(Pe=Le.now())+Re,Ae=Ne=0;try{Ie()}finally{Ae=0,function(){for(var t,n,e=Me,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Me=n);Te=t,Be(r)}(),Oe=0}}function Ye(){var t=Le.now(),n=t-Pe;n>ze&&(Re-=n,Pe=t)}function Be(t){Ae||(Ne&&(Ne=clearTimeout(Ne)),t-Oe>24?(t<1/0&&(Ne=setTimeout(He,t-Le.now()-Re)),Ee&&(Ee=clearInterval(Ee))):(Ee||(Pe=Le.now(),Ee=setInterval(Ye,ze)),Ae=1,qe(He)))}Fe.prototype=je.prototype={constructor:Fe,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Ue():+e)+(null==n?0:+n),this._next||Te===this||(Te?Te._next=this:Me=this,Te=this),this._call=t,this._time=e,Be()},stop:function(){this._call&&(this._call=null,this._time=1/0,Be())}};var Ve=function(t,n,e){var r=new Fe;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r},Xe=function(t,n,e){var r=new Fe,i=n;return null==n?(r.restart(t,n,e),r):(n=+n,e=null==e?Ue():+e,r.restart((function u(o){o+=i,r.restart(u,i+=n,e),t(o)}),n,e),r)},We=T("start","end","interrupt"),$e=[],Ge=0,Ze=1,Qe=2,Je=3,Ke=4,tr=5,nr=6,er=function(t,n,e,r,i,u){var o=t.__transition;if(o){if(e in o)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function u(c){var f,s,l,h;if(e.state!==Ze)return a();for(f in i)if((h=i[f]).name===e.name){if(h.state===Je)return Ve(u);h.state===Ke?(h.state=nr,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[f]):+fGe)throw new Error("too late; already scheduled");return e}function ir(t,n){var e=ur(t,n);if(e.state>Qe)throw new Error("too late; already started");return e}function ur(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var or=function(t,n){var e,r,i,u=t.__transition,o=!0;if(u){for(i in n=null==n?null:n+"",u)(e=u[i]).name===n?(r=e.state>Qe&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?rr:ir;return function(){var o=u(this,t),a=o.on;a!==r&&(i=(r=a).copy()).on(n,e),o.on=i}}(e,t,n))},attr:function(t,n){var e=C(t),r="transform"===e?le:cr;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,i,u;return function(){var o,a=e(this);if(null!=a)return(o=this.getAttributeNS(t.space,t.local))===a?null:o===r&&a===i?u:u=n(r=o,i=a);this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,i,u;return function(){var o,a=e(this);if(null!=a)return(o=this.getAttribute(t))===a?null:o===r&&a===i?u:u=n(r=o,i=a);this.removeAttribute(t)}})(e,r,ar(this,"attr."+t,n)):null==n?(e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(e):(e.local?function(t,n,e){var r,i;return function(){var u=this.getAttributeNS(t.space,t.local);return u===e?null:u===r?i:i=n(r=u,e)}}:function(t,n,e){var r,i;return function(){var u=this.getAttribute(t);return u===e?null:u===r?i:i=n(r=u,e)}})(e,r,n+""))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=C(t);return this.tween(e,(r.local?function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}:function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e})(r,n))},style:function(t,n,e){var r="transform"==(t+="")?se:cr;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var u=B(this,t),o=(this.style.removeProperty(t),B(this,t));return u===o?null:u===e&&o===r?i:i=n(e=u,r=o)}}(t,r)).on("end.style."+t,function(t){return function(){this.style.removeProperty(t)}}(t)):this.styleTween(t,"function"==typeof n?function(t,n,e){var r,i,u;return function(){var o=B(this,t),a=e(this);return null==a&&(this.style.removeProperty(t),a=B(this,t)),o===a?null:o===r&&a===i?u:u=n(r=o,i=a)}}(t,r,ar(this,"style."+t,n)):function(t,n,e){var r,i;return function(){var u=B(this,t);return u===e?null:u===r?i:i=n(r=u,e)}}(t,r,n+""),e)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(ar(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",(t=this._id,function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}));var t},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=ur(this.node(),e).tween,u=0,o=i.length;uZe&&e.name===n)return new lr([[t]],ii,n,+r);return null},oi=function(t){return function(){return t}},ai=function(t,n,e){this.target=t,this.type=n,this.selection=e};function ci(){ut.stopImmediatePropagation()}var fi=function(){ut.preventDefault(),ut.stopImmediatePropagation()},si={name:"drag"},li={name:"space"},hi={name:"handle"},di={name:"center"},pi={name:"x",handles:["e","w"].map(wi),input:function(t,n){return t&&[[t[0],n[0][1]],[t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},vi={name:"y",handles:["n","s"].map(wi),input:function(t,n){return t&&[[n[0][0],t[0]],[n[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},gi={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(wi),input:function(t){return t},output:function(t){return t}},yi={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},_i={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},mi={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},xi={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},bi={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function wi(t){return{type:t}}function Mi(){return!ut.button}function Ti(){var t=this.ownerSVGElement||this;return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Si(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function ki(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Ci(t){var n=t.__brush;return n?n.dim.output(n.selection):null}function Ai(){return zi(pi)}function Ni(){return zi(vi)}var Ei=function(){return zi(gi)};function zi(t){var n,e=Ti,r=Mi,i=T(o,"start","brush","end"),u=6;function o(n){var e=n.property("__brush",l).selectAll(".overlay").data([wi("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",yi.overlay).merge(e).each((function(){var t=Si(this).extent;gt(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),n.selectAll(".selection").data([wi("selection")]).enter().append("rect").attr("class","selection").attr("cursor",yi.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=n.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return yi[t.type]})),n.each(a).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",s)}function a(){var t=gt(this),n=Si(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?n[1][0]-u/2:n[0][0]-u/2})).attr("y",(function(t){return"s"===t.type[0]?n[1][1]-u/2:n[0][1]-u/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+u:u})).attr("height",(function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+u:u}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(t,n){return t.__brush.emitter||new f(t,n)}function f(t,n){this.that=t,this.args=n,this.state=t.__brush,this.active=0}function s(){if(ut.touches){if(ut.changedTouches.length0&&(e=i-d),w<0?l=h-p:w>0&&(u=o-p),x=li,L.attr("cursor",yi.selection),D());break;default:return}fi()}),!0).on("keyup.brush",(function(){switch(ut.keyCode){case 16:E&&(g=y=E=!1,D());break;case 18:x===di&&(b<0?f=s:b>0&&(e=i),w<0?l=h:w>0&&(u=o),x=hi,D());break;case 32:x===li&&(ut.altKey?(b&&(f=s-d*b,e=i+d*b),w&&(l=h-p*w,u=o+p*w),x=di):(b<0?f=s:b>0&&(e=i),w<0?l=h:w>0&&(u=o),x=hi),L.attr("cursor",yi[m]),D());break;default:return}fi()}),!0).on("mousemove.brush",U,!0).on("mouseup.brush",F,!0);Nt(ut.view)}ci(),or(_),a.call(_),O.start()}function U(){var t=Mt(_);!E||g||y||(Math.abs(t[0]-P[0])>Math.abs(t[1]-P[1])?y=!0:g=!0),P=t,v=!0,fi(),D()}function D(){var t;switch(d=P[0]-z[0],p=P[1]-z[1],x){case li:case si:b&&(d=Math.max(k-e,Math.min(A-f,d)),i=e+d,s=f+d),w&&(p=Math.max(C-u,Math.min(N-l,p)),o=u+p,h=l+p);break;case hi:b<0?(d=Math.max(k-e,Math.min(A-e,d)),i=e+d,s=f):b>0&&(d=Math.max(k-f,Math.min(A-f,d)),i=e,s=f+d),w<0?(p=Math.max(C-u,Math.min(N-u,p)),o=u+p,h=l):w>0&&(p=Math.max(C-l,Math.min(N-l,p)),o=u,h=l+p);break;case di:b&&(i=Math.max(k,Math.min(A,e-d*b)),s=Math.max(k,Math.min(A,f+d*b))),w&&(o=Math.max(C,Math.min(N,u-p*w)),h=Math.max(C,Math.min(N,l+p*w)))}s=u?c=!0:(r=t.charCodeAt(o++))===Ji?f=!0:r===Ki&&(f=!0,t.charCodeAt(o)===Ji&&++o),t.slice(i+1,n-1).replace(/""/g,'"')}for(;o=(u=(v+y)/2))?v=u:y=u,(s=e>=(o=(g+_)/2))?g=o:_=o,i=d,!(d=d[l=s<<1|f]))return i[l]=p,t;if(a=+t._x.call(null,d.data),c=+t._y.call(null,d.data),n===a&&e===c)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(f=n>=(u=(v+y)/2))?v=u:y=u,(s=e>=(o=(g+_)/2))?g=o:_=o}while((l=s<<1|f)==(h=(c>=o)<<1|a>=u));return i[h]=d,i[l]=p,t}var gu=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i};function yu(t){return t[0]}function _u(t){return t[1]}function mu(t,n,e){var r=new xu(null==n?yu:n,null==e?_u:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function xu(t,n,e,r,i,u){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=u,this._root=void 0}function bu(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var wu=mu.prototype=xu.prototype;function Mu(t){return t.x+t.vx}function Tu(t){return t.y+t.vy}wu.copy=function(){var t,n,e=new xu(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=bu(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=bu(n));return e},wu.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return vu(this.cover(n,e),n,e,t)},wu.addAll=function(t){var n,e,r,i,u=t.length,o=new Array(u),a=new Array(u),c=1/0,f=1/0,s=-1/0,l=-1/0;for(e=0;es&&(s=r),il&&(l=i));for(st||t>i||r>n||n>u))return this;var o,a,c=i-e,f=this._root;switch(a=(n<(r+u)/2)<<1|t<(e+i)/2){case 0:do{(o=new Array(4))[a]=f,f=o}while(u=r+(c*=2),t>(i=e+c)||n>u);break;case 1:do{(o=new Array(4))[a]=f,f=o}while(u=r+(c*=2),(e=i-c)>t||n>u);break;case 2:do{(o=new Array(4))[a]=f,f=o}while(r=u-(c*=2),t>(i=e+c)||r>n);break;case 3:do{(o=new Array(4))[a]=f,f=o}while(r=u-(c*=2),(e=i-c)>t||r>n)}this._root&&this._root.length&&(this._root=f)}return this._x0=e,this._y0=r,this._x1=i,this._y1=u,this},wu.data=function(){var t=[];return this.visit((function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)})),t},wu.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},wu.find=function(t,n,e){var r,i,u,o,a,c,f,s=this._x0,l=this._y0,h=this._x1,d=this._y1,p=[],v=this._root;for(v&&p.push(new gu(v,s,l,h,d)),null==e?e=1/0:(s=t-e,l=n-e,h=t+e,d=n+e,e*=e);c=p.pop();)if(!(!(v=c.node)||(i=c.x0)>h||(u=c.y0)>d||(o=c.x1)=y)<<1|t>=g)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=c)}else{var _=t-+this._x.call(null,v.data),m=n-+this._y.call(null,v.data),x=_*_+m*m;if(x=(a=(p+g)/2))?p=a:g=a,(s=o>=(c=(v+y)/2))?v=c:y=c,n=d,!(d=d[l=s<<1|f]))return this;if(!d.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},wu.removeAll=function(t){for(var n=0,e=t.length;nc+d||if+d||ua.index){var p=c-o.x-o.vx,v=f-o.y-o.vy,g=p*p+v*v;gt.r&&(t.r=t[n].r)}function a(){if(n){var r,i,u=n.length;for(e=new Array(u),r=0;r1?(null==e?a.remove(t):a.set(t,d(e)),n):a.get(t)},find:function(n,e,r){var i,u,o,a,c,f=0,s=t.length;for(null==r?r=1/0:r*=r,f=0;f1?(f.on(t,e),n):f.on(t)}}},Lu=function(){var t,n,e,r,i=du(-30),u=1,o=1/0,a=.81;function c(r){var i,u=t.length,o=mu(t,Nu,Eu).visitAfter(s);for(e=r,i=0;i=o)){(t.data!==n||t.next)&&(0===s&&(d+=(s=pu())*s),0===l&&(d+=(l=pu())*l),d1?r[0]+r.slice(2):r,+t.slice(e+1)]},ju=function(t){return(t=Fu(Math.abs(t)))?t[1]:NaN},Iu=function(t,n){var e=Fu(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Hu={"":function(t,n){t:for(var e,r=(t=t.toPrecision(n)).length,i=1,u=-1;i0&&(u=0)}return u>0?t.slice(0,u)+t.slice(e+1):t},"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return Iu(100*t,n)},r:Iu,s:function(t,n){var e=Fu(t,n);if(!e)return t+"";var r=e[0],i=e[1],u=i-(zu=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return u===o?r:u>o?r+new Array(u-o+1).join("0"):u>0?r.slice(0,u)+"."+r.slice(u):"0."+new Array(1-u).join("0")+Fu(t,Math.max(0,n+u-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},Yu=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function Bu(t){return new Vu(t)}function Vu(t){if(!(n=Yu.exec(t)))throw new Error("invalid format: "+t);var n,e=n[1]||" ",r=n[2]||">",i=n[3]||"-",u=n[4]||"",o=!!n[5],a=n[6]&&+n[6],c=!!n[7],f=n[8]&&+n[8].slice(1),s=n[9]||"";"n"===s?(c=!0,s="g"):Hu[s]||(s=""),(o||"0"===e&&"="===r)&&(o=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=i,this.symbol=u,this.zero=o,this.width=a,this.comma=c,this.precision=f,this.type=s}Bu.prototype=Vu.prototype,Vu.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var Xu,Wu,$u,Gu=function(t){return t},Zu=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],Qu=function(t){var n,e,r=t.grouping&&t.thousands?(n=t.grouping,e=t.thousands,function(t,r){for(var i=t.length,u=[],o=0,a=n[0],c=0;i>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),u.push(t.substring(i-=a,i+a)),!((c+=a+1)>r));)a=n[o=(o+1)%n.length];return u.reverse().join(e)}):Gu,i=t.currency,u=t.decimal,o=t.numerals?function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(t.numerals):Gu,a=t.percent||"%";function c(t){var n=(t=Bu(t)).fill,e=t.align,c=t.sign,f=t.symbol,s=t.zero,l=t.width,h=t.comma,d=t.precision,p=t.type,v="$"===f?i[0]:"#"===f&&/[boxX]/.test(p)?"0"+p.toLowerCase():"",g="$"===f?i[1]:/[%p]/.test(p)?a:"",y=Hu[p],_=!p||/[defgprs%]/.test(p);function m(t){var i,a,f,m=v,x=g;if("c"===p)x=y(t)+x,t="";else{var b=(t=+t)<0;if(t=y(Math.abs(t),d),b&&0==+t&&(b=!1),m=(b?"("===c?c:"-":"-"===c||"("===c?"":c)+m,x=("s"===p?Zu[8+zu/3]:"")+x+(b&&"("===c?")":""),_)for(i=-1,a=t.length;++i(f=t.charCodeAt(i))||f>57){x=(46===f?u+t.slice(i+1):t.slice(i))+x,t=t.slice(0,i);break}}h&&!s&&(t=r(t,1/0));var w=m.length+t.length+x.length,M=w>1)+m+t+x+M.slice(w);break;default:t=M+m+t+x}return o(t)}return d=null==d?p?6:12:/[gprs]/.test(p)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),m.toString=function(){return t+""},m}return{format:c,formatPrefix:function(t,n){var e=c(((t=Bu(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(ju(n)/3))),i=Math.pow(10,-r),u=Zu[8+r/3];return function(t){return e(i*t)+u}}}};function Ju(t){return Xu=Qu(t),Wu=Xu.format,$u=Xu.formatPrefix,Xu}Ju({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var Ku=function(t){return Math.max(0,-ju(Math.abs(t)))},to=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ju(n)/3)))-ju(Math.abs(t)))},no=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,ju(n)-ju(t))+1},eo=function(){return new ro};function ro(){this.reset()}ro.prototype={constructor:ro,reset:function(){this.s=this.t=0},add:function(t){uo(io,t,this.t),uo(this,io.s,this.s),this.s?this.t+=io.t:this.s=io.t},valueOf:function(){return this.s}};var io=new ro;function uo(t,n,e){var r=t.s=n+e,i=r-n,u=r-i;t.t=n-u+(e-i)}var oo=1e-6,ao=Math.PI,co=ao/2,fo=ao/4,so=2*ao,lo=180/ao,ho=ao/180,po=Math.abs,vo=Math.atan,go=Math.atan2,yo=Math.cos,_o=Math.ceil,mo=Math.exp,xo=(Math.floor,Math.log),bo=Math.pow,wo=Math.sin,Mo=Math.sign||function(t){return t>0?1:t<0?-1:0},To=Math.sqrt,So=Math.tan;function ko(t){return t>1?0:t<-1?ao:Math.acos(t)}function Co(t){return t>1?co:t<-1?-co:Math.asin(t)}function Ao(t){return(t=wo(t/2))*t}function No(){}function Eo(t,n){t&&Po.hasOwnProperty(t.type)&&Po[t.type](t,n)}var zo={Feature:function(t,n){Eo(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,u=yo(n=(n*=ho)/2+fo),o=wo(n),a=Fo*o,c=Do*u+a*yo(i),f=a*r*wo(i);Io.add(go(f,c)),Uo=t,Do=u,Fo=o}var $o=function(t){return Ho.reset(),jo(t,Yo),2*Ho};function Go(t){return[go(t[1],t[0]),Co(t[2])]}function Zo(t){var n=t[0],e=t[1],r=yo(e);return[r*yo(n),r*wo(n),wo(e)]}function Qo(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Jo(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Ko(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function ta(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function na(t){var n=To(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var ea,ra,ia,ua,oa,aa,ca,fa,sa,la,ha=eo(),da={point:pa,lineStart:ga,lineEnd:ya,polygonStart:function(){da.point=_a,da.lineStart=ma,da.lineEnd=xa,ha.reset(),Yo.polygonStart()},polygonEnd:function(){Yo.polygonEnd(),da.point=pa,da.lineStart=ga,da.lineEnd=ya,Io<0?(ea=-(ia=180),ra=-(ua=90)):ha>oo?ua=90:ha<-oo&&(ra=-90),la[0]=ea,la[1]=ia}};function pa(t,n){sa.push(la=[ea=t,ia=t]),nua&&(ua=n)}function va(t,n){var e=Zo([t*ho,n*ho]);if(fa){var r=Jo(fa,e),i=Jo([r[1],-r[0],0],r);na(i),i=Go(i);var u,o=t-oa,a=o>0?1:-1,c=i[0]*lo*a,f=po(o)>180;f^(a*oaua&&(ua=u):f^(a*oa<(c=(c+360)%360-180)&&cua&&(ua=n)),f?tba(ea,ia)&&(ia=t):ba(t,ia)>ba(ea,ia)&&(ea=t):ia>=ea?(tia&&(ia=t)):t>oa?ba(ea,t)>ba(ea,ia)&&(ia=t):ba(t,ia)>ba(ea,ia)&&(ea=t)}else sa.push(la=[ea=t,ia=t]);nua&&(ua=n),fa=e,oa=t}function ga(){da.point=va}function ya(){la[0]=ea,la[1]=ia,da.point=pa,fa=null}function _a(t,n){if(fa){var e=t-oa;ha.add(po(e)>180?e+(e>0?360:-360):e)}else aa=t,ca=n;Yo.point(t,n),va(t,n)}function ma(){Yo.lineStart()}function xa(){_a(aa,ca),Yo.lineEnd(),po(ha)>oo&&(ea=-(ia=180)),la[0]=ea,la[1]=ia,fa=null}function ba(t,n){return(n-=t)<0?n+360:n}function wa(t,n){return t[0]-n[0]}function Ma(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nba(r[0],r[1])&&(r[1]=i[1]),ba(i[0],r[1])>ba(r[0],r[1])&&(r[0]=i[0])):u.push(r=i);for(o=-1/0,n=0,r=u[e=u.length-1];n<=e;r=i,++n)i=u[n],(a=ba(r[1],i[0]))>o&&(o=a,ea=i[0],ia=r[1])}return sa=la=null,ea===1/0||ra===1/0?[[NaN,NaN],[NaN,NaN]]:[[ea,ra],[ia,ua]]},Ia={sphere:No,point:Ha,lineStart:Ba,lineEnd:Wa,polygonStart:function(){Ia.lineStart=$a,Ia.lineEnd=Ga},polygonEnd:function(){Ia.lineStart=Ba,Ia.lineEnd=Wa}};function Ha(t,n){t*=ho;var e=yo(n*=ho);Ya(e*yo(t),e*wo(t),wo(n))}function Ya(t,n,e){ka+=(t-ka)/++Ta,Ca+=(n-Ca)/Ta,Aa+=(e-Aa)/Ta}function Ba(){Ia.point=Va}function Va(t,n){t*=ho;var e=yo(n*=ho);Ua=e*yo(t),Da=e*wo(t),Fa=wo(n),Ia.point=Xa,Ya(Ua,Da,Fa)}function Xa(t,n){t*=ho;var e=yo(n*=ho),r=e*yo(t),i=e*wo(t),u=wo(n),o=go(To((o=Da*u-Fa*i)*o+(o=Fa*r-Ua*u)*o+(o=Ua*i-Da*r)*o),Ua*r+Da*i+Fa*u);Sa+=o,Na+=o*(Ua+(Ua=r)),Ea+=o*(Da+(Da=i)),za+=o*(Fa+(Fa=u)),Ya(Ua,Da,Fa)}function Wa(){Ia.point=Ha}function $a(){Ia.point=Za}function Ga(){Qa(La,qa),Ia.point=Ha}function Za(t,n){La=t,qa=n,t*=ho,n*=ho,Ia.point=Qa;var e=yo(n);Ua=e*yo(t),Da=e*wo(t),Fa=wo(n),Ya(Ua,Da,Fa)}function Qa(t,n){t*=ho;var e=yo(n*=ho),r=e*yo(t),i=e*wo(t),u=wo(n),o=Da*u-Fa*i,a=Fa*r-Ua*u,c=Ua*i-Da*r,f=To(o*o+a*a+c*c),s=Co(f),l=f&&-s/f;Pa+=l*o,Oa+=l*a,Ra+=l*c,Sa+=s,Na+=s*(Ua+(Ua=r)),Ea+=s*(Da+(Da=i)),za+=s*(Fa+(Fa=u)),Ya(Ua,Da,Fa)}var Ja=function(t){Ta=Sa=ka=Ca=Aa=Na=Ea=za=Pa=Oa=Ra=0,jo(t,Ia);var n=Pa,e=Oa,r=Ra,i=n*n+e*e+r*r;return i<1e-12&&(n=Na,e=Ea,r=za,Saao?t-so:t<-ao?t+so:t,n]}function ec(t,n,e){return(t%=so)?n||e?tc(ic(t),uc(n,e)):ic(t):n||e?uc(n,e):nc}function rc(t){return function(n,e){return[(n+=t)>ao?n-so:n<-ao?n+so:n,e]}}function ic(t){var n=rc(t);return n.invert=rc(-t),n}function uc(t,n){var e=yo(t),r=wo(t),i=yo(n),u=wo(n);function o(t,n){var o=yo(n),a=yo(t)*o,c=wo(t)*o,f=wo(n),s=f*e+a*r;return[go(c*i-s*u,a*e-f*r),Co(s*i+c*u)]}return o.invert=function(t,n){var o=yo(n),a=yo(t)*o,c=wo(t)*o,f=wo(n),s=f*i-c*u;return[go(c*i+f*u,a*e+s*r),Co(s*e-a*r)]},o}nc.invert=nc;var oc=function(t){function n(n){return(n=t(n[0]*ho,n[1]*ho))[0]*=lo,n[1]*=lo,n}return t=ec(t[0]*ho,t[1]*ho,t.length>2?t[2]*ho:0),n.invert=function(n){return(n=t.invert(n[0]*ho,n[1]*ho))[0]*=lo,n[1]*=lo,n},n};function ac(t,n,e,r,i,u){if(e){var o=yo(n),a=wo(n),c=r*e;null==i?(i=n+r*so,u=n-c/2):(i=cc(o,i),u=cc(o,u),(r>0?iu)&&(i+=r*so));for(var f,s=i;r>0?s>u:s1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}},lc=function(t,n){return po(t[0]-n[0])=0;--u)i.point((s=f[u])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}f=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}};function pc(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r=0?1:-1,T=M*w,S=T>ao,k=p*x;if(vc.add(go(k*M*wo(T),v*b+k*yo(T))),u+=S?w+M*so:w,S^h>=e^_>=e){var C=Jo(Zo(l),Zo(y));na(C);var A=Jo(i,C);na(A);var N=(S^w>=0?-1:1)*Co(A[2]);(r>N||r===N&&(C[0]||C[1]))&&(o+=S^w>=0?1:-1)}}return(u<-oo||u0){for(h||(u.polygonStart(),h=!0),u.lineStart(),t=0;t1&&2&i&&f.push(f.pop().concat(f.shift())),a.push(f.filter(_c))}return d}};function _c(t){return t.length>1}function mc(t,n){return((t=t.x)[0]<0?t[1]-co-oo:co-t[1])-((n=n.x)[0]<0?n[1]-co-oo:co-n[1])}var xc=yc((function(){return!0}),(function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(u,o){var a=u>0?ao:-ao,c=po(u-e);po(c-ao)0?co:-co),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(u,r),n=0):i!==a&&c>=ao&&(po(e-i)oo?vo((wo(n)*(u=yo(r))*wo(e)-wo(r)*(i=yo(n))*wo(t))/(i*u*o)):(n+r)/2}(e,r,u,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),n=0),t.point(e=u,r=o),i=a},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}),(function(t,n,e,r){var i;if(null==t)i=e*co,r.point(-ao,i),r.point(0,i),r.point(ao,i),r.point(ao,0),r.point(ao,-i),r.point(0,-i),r.point(-ao,-i),r.point(-ao,0),r.point(-ao,i);else if(po(t[0]-n[0])>oo){var u=t[0]0,i=po(n)>oo;function u(t,e){return yo(t)*yo(e)>n}function o(t,e,r){var i=[1,0,0],u=Jo(Zo(t),Zo(e)),o=Qo(u,u),a=u[0],c=o-a*a;if(!c)return!r&&t;var f=n*o/c,s=-n*a/c,l=Jo(i,u),h=ta(i,f);Ko(h,ta(u,s));var d=l,p=Qo(h,d),v=Qo(d,d),g=p*p-v*(Qo(h,h)-1);if(!(g<0)){var y=To(g),_=ta(d,(-p-y)/v);if(Ko(_,h),_=Go(_),!r)return _;var m,x=t[0],b=e[0],w=t[1],M=e[1];b0^_[1]<(po(_[0]-x)ao^(x<=_[0]&&_[0]<=b)){var k=ta(d,(-p+y)/v);return Ko(k,h),[_,Go(k)]}}}function a(n,e){var i=r?t:ao-t,u=0;return n<-i?u|=1:n>i&&(u|=2),e<-i?u|=4:e>i&&(u|=8),u}return yc(u,(function(t){var n,e,c,f,s;return{lineStart:function(){f=c=!1,s=1},point:function(l,h){var d,p=[l,h],v=u(l,h),g=r?v?0:a(l,h):v?a(l+(l<0?ao:-ao),h):0;if(!n&&(f=c=v)&&t.lineStart(),v!==c&&(!(d=o(n,p))||lc(n,d)||lc(p,d))&&(p[0]+=oo,p[1]+=oo,v=u(p[0],p[1])),v!==c)s=0,v?(t.lineStart(),d=o(p,n),t.point(d[0],d[1])):(d=o(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(i&&n&&r^v){var y;g&e||!(y=o(p,n,!0))||(s=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!v||n&&lc(n,p)||t.point(p[0],p[1]),n=p,c=v,e=g},lineEnd:function(){c&&t.lineEnd(),n=null},clean:function(){return s|(f&&c)<<1}}}),(function(n,r,i,u){ac(u,t,e,i,n,r)}),r?[0,-t]:[-ao,t-ao])},wc=function(t,n,e,r,i,u){var o,a=t[0],c=t[1],f=0,s=1,l=n[0]-a,h=n[1]-c;if(o=e-a,l||!(o>0)){if(o/=l,l<0){if(o0){if(o>s)return;o>f&&(f=o)}if(o=i-a,l||!(o<0)){if(o/=l,l<0){if(o>s)return;o>f&&(f=o)}else if(l>0){if(o0)){if(o/=h,h<0){if(o0){if(o>s)return;o>f&&(f=o)}if(o=u-c,h||!(o<0)){if(o/=h,h<0){if(o>s)return;o>f&&(f=o)}else if(h>0){if(o0&&(t[0]=a+f*l,t[1]=c+f*h),s<1&&(n[0]=a+s*l,n[1]=c+s*h),!0}}}}},Mc=1e9,Tc=-Mc;function Sc(t,n,e,i){function u(r,u){return t<=r&&r<=e&&n<=u&&u<=i}function o(r,u,o,c){var s=0,l=0;if(null==r||(s=a(r,o))!==(l=a(u,o))||f(r,u)<0^o>0)do{c.point(0===s||3===s?t:e,s>1?i:n)}while((s=(s+o+4)%4)!==l);else c.point(u[0],u[1])}function a(r,i){return po(r[0]-t)0?0:3:po(r[0]-e)0?2:1:po(r[1]-n)0?1:0:i>0?3:2}function c(t,n){return f(t.x,n.x)}function f(t,n){var e=a(t,1),r=a(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(a){var f,s,l,h,d,p,v,g,y,_,m,x=a,b=sc(),w={point:M,lineStart:function(){w.point=T,s&&s.push(l=[]),_=!0,y=!1,v=g=NaN},lineEnd:function(){f&&(T(h,d),p&&y&&b.rejoin(),f.push(b.result())),w.point=M,y&&x.lineEnd()},polygonStart:function(){x=b,f=[],s=[],m=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,r=s.length;ei&&(h-u)*(i-o)>(d-o)*(t-u)&&++n:d<=i&&(h-u)*(i-o)<(d-o)*(t-u)&&--n;return n}(),e=m&&n,u=(f=Object(r.n)(f)).length;(e||u)&&(a.polygonStart(),e&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),u&&dc(f,c,n,o,a),a.polygonEnd()),x=a,f=s=l=null}};function M(t,n){u(t,n)&&x.point(t,n)}function T(r,o){var a=u(r,o);if(s&&l.push([r,o]),_)h=r,d=o,p=a,_=!1,a&&(x.lineStart(),x.point(r,o));else if(a&&y)x.point(r,o);else{var c=[v=Math.max(Tc,Math.min(Mc,v)),g=Math.max(Tc,Math.min(Mc,g))],f=[r=Math.max(Tc,Math.min(Mc,r)),o=Math.max(Tc,Math.min(Mc,o))];wc(c,f,t,n,e,i)?(y||(x.lineStart(),x.point(c[0],c[1])),x.point(f[0],f[1]),a||x.lineEnd(),m=!1):a&&(x.lineStart(),x.point(r,o),m=!1)}v=r,g=o,y=a}return w}}var kc,Cc,Ac,Nc=function(){var t,n,e,r=0,i=0,u=960,o=500;return e={stream:function(e){return t&&n===e?t:t=Sc(r,i,u,o)(n=e)},extent:function(a){return arguments.length?(r=+a[0][0],i=+a[0][1],u=+a[1][0],o=+a[1][1],t=n=null,e):[[r,i],[u,o]]}}},Ec=eo(),zc={sphere:No,point:No,lineStart:function(){zc.point=Oc,zc.lineEnd=Pc},lineEnd:No,polygonStart:No,polygonEnd:No};function Pc(){zc.point=zc.lineEnd=No}function Oc(t,n){kc=t*=ho,Cc=wo(n*=ho),Ac=yo(n),zc.point=Rc}function Rc(t,n){t*=ho;var e=wo(n*=ho),r=yo(n),i=po(t-kc),u=yo(i),o=r*wo(i),a=Ac*e-Cc*r*u,c=Cc*e+Ac*r*u;Ec.add(go(To(o*o+a*a),c)),kc=t,Cc=e,Ac=r}var Lc=function(t){return Ec.reset(),jo(t,zc),+Ec},qc=[null,null],Uc={type:"LineString",coordinates:qc},Dc=function(t,n){return qc[0]=t,qc[1]=n,Lc(Uc)},Fc={Feature:function(t,n){return Ic(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++roo})).map(f)).concat(Object(r.s)(_o(o/p)*p,u,p).filter((function(t){return po(t%g)>oo})).map(s))}return _.lines=function(){return m().map((function(t){return{type:"LineString",coordinates:t}}))},_.outline=function(){return{type:"Polygon",coordinates:[l(i).concat(h(a).slice(1),l(e).reverse().slice(1),h(c).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.extentMajor(t).extentMinor(t):_.extentMinor()},_.extentMajor=function(t){return arguments.length?(i=+t[0][0],e=+t[1][0],c=+t[0][1],a=+t[1][1],i>e&&(t=i,i=e,e=t),c>a&&(t=c,c=a,a=t),_.precision(y)):[[i,c],[e,a]]},_.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],u=+e[1][1],n>t&&(e=n,n=t,t=e),o>u&&(e=o,o=u,u=e),_.precision(y)):[[n,o],[t,u]]},_.step=function(t){return arguments.length?_.stepMajor(t).stepMinor(t):_.stepMinor()},_.stepMajor=function(t){return arguments.length?(v=+t[0],g=+t[1],_):[v,g]},_.stepMinor=function(t){return arguments.length?(d=+t[0],p=+t[1],_):[d,p]},_.precision=function(r){return arguments.length?(y=+r,f=$c(o,u,90),s=Gc(n,t,y),l=$c(c,a,90),h=Gc(i,e,y),_):y},_.extentMajor([[-180,-90+oo],[180,90-oo]]).extentMinor([[-180,-80-oo],[180,80+oo]])}function Qc(){return Zc()()}var Jc,Kc,tf,nf,ef=function(t,n){var e=t[0]*ho,r=t[1]*ho,i=n[0]*ho,u=n[1]*ho,o=yo(r),a=wo(r),c=yo(u),f=wo(u),s=o*yo(e),l=o*wo(e),h=c*yo(i),d=c*wo(i),p=2*Co(To(Ao(u-r)+o*c*Ao(i-e))),v=wo(p),g=p?function(t){var n=wo(t*=p)/v,e=wo(p-t)/v,r=e*s+n*h,i=e*l+n*d,u=e*a+n*f;return[go(i,r)*lo,go(u,To(r*r+i*i))*lo]}:function(){return[e*lo,r*lo]};return g.distance=p,g},rf=function(t){return t},uf=eo(),of=eo(),af={point:No,lineStart:No,lineEnd:No,polygonStart:function(){af.lineStart=cf,af.lineEnd=lf},polygonEnd:function(){af.lineStart=af.lineEnd=af.point=No,uf.add(po(of)),of.reset()},result:function(){var t=uf/2;return uf.reset(),t}};function cf(){af.point=ff}function ff(t,n){af.point=sf,Jc=tf=t,Kc=nf=n}function sf(t,n){of.add(nf*t-tf*n),tf=t,nf=n}function lf(){sf(Jc,Kc)}var hf,df,pf,vf,gf=af,yf=1/0,_f=yf,mf=-yf,xf=mf,bf={point:function(t,n){tmf&&(mf=t),n<_f&&(_f=n),n>xf&&(xf=n)},lineStart:No,lineEnd:No,polygonStart:No,polygonEnd:No,result:function(){var t=[[yf,_f],[mf,xf]];return mf=xf=-(_f=yf=1/0),t}},wf=0,Mf=0,Tf=0,Sf=0,kf=0,Cf=0,Af=0,Nf=0,Ef=0,zf={point:Pf,lineStart:Of,lineEnd:qf,polygonStart:function(){zf.lineStart=Uf,zf.lineEnd=Df},polygonEnd:function(){zf.point=Pf,zf.lineStart=Of,zf.lineEnd=qf},result:function(){var t=Ef?[Af/Ef,Nf/Ef]:Cf?[Sf/Cf,kf/Cf]:Tf?[wf/Tf,Mf/Tf]:[NaN,NaN];return wf=Mf=Tf=Sf=kf=Cf=Af=Nf=Ef=0,t}};function Pf(t,n){wf+=t,Mf+=n,++Tf}function Of(){zf.point=Rf}function Rf(t,n){zf.point=Lf,Pf(pf=t,vf=n)}function Lf(t,n){var e=t-pf,r=n-vf,i=To(e*e+r*r);Sf+=i*(pf+t)/2,kf+=i*(vf+n)/2,Cf+=i,Pf(pf=t,vf=n)}function qf(){zf.point=Pf}function Uf(){zf.point=Ff}function Df(){jf(hf,df)}function Ff(t,n){zf.point=jf,Pf(hf=pf=t,df=vf=n)}function jf(t,n){var e=t-pf,r=n-vf,i=To(e*e+r*r);Sf+=i*(pf+t)/2,kf+=i*(vf+n)/2,Cf+=i,Af+=(i=vf*t-pf*n)*(pf+t),Nf+=i*(vf+n),Ef+=3*i,Pf(pf=t,vf=n)}var If=zf;function Hf(t){this._context=t}Hf.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,so)}},result:No};var Yf,Bf,Vf,Xf,Wf,$f=eo(),Gf={point:No,lineStart:function(){Gf.point=Zf},lineEnd:function(){Yf&&Qf(Bf,Vf),Gf.point=No},polygonStart:function(){Yf=!0},polygonEnd:function(){Yf=null},result:function(){var t=+$f;return $f.reset(),t}};function Zf(t,n){Gf.point=Qf,Bf=Xf=t,Vf=Wf=n}function Qf(t,n){Xf-=t,Wf-=n,$f.add(To(Xf*Xf+Wf*Wf)),Xf=t,Wf=n}var Jf=Gf;function Kf(){this._string=[]}function ts(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}Kf.prototype={_radius:4.5,_circle:ts(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=ts(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var ns=function(t,n){var e,r,i=4.5;function u(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),jo(t,e(r))),r.result()}return u.area=function(t){return jo(t,e(gf)),gf.result()},u.measure=function(t){return jo(t,e(Jf)),Jf.result()},u.bounds=function(t){return jo(t,e(bf)),bf.result()},u.centroid=function(t){return jo(t,e(If)),If.result()},u.projection=function(n){return arguments.length?(e=null==n?(t=null,rf):(t=n).stream,u):t},u.context=function(t){return arguments.length?(r=null==t?(n=null,new Kf):new Hf(n=t),"function"!=typeof i&&r.pointRadius(i),u):n},u.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),u):i},u.projection(t).context(n)},es=function(t){return{stream:rs(t)}};function rs(t){return function(n){var e=new is;for(var r in t)e[r]=t[r];return e.stream=n,e}}function is(){}function us(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),jo(e,t.stream(bf)),n(bf.result()),null!=r&&t.clipExtent(r),t}function os(t,n,e){return us(t,(function(e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],u=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),o=+n[0][0]+(r-u*(e[1][0]+e[0][0]))/2,a=+n[0][1]+(i-u*(e[1][1]+e[0][1]))/2;t.scale(150*u).translate([o,a])}),e)}function as(t,n,e){return os(t,[[0,0],n],e)}function cs(t,n,e){return us(t,(function(e){var r=+n,i=r/(e[1][0]-e[0][0]),u=(r-i*(e[1][0]+e[0][0]))/2,o=-i*e[0][1];t.scale(150*i).translate([u,o])}),e)}function fs(t,n,e){return us(t,(function(e){var r=+n,i=r/(e[1][1]-e[0][1]),u=-i*e[0][0],o=(r-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([u,o])}),e)}is.prototype={constructor:is,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var ss=16,ls=yo(30*ho),hs=function(t,n){return+n?function(t,n){function e(r,i,u,o,a,c,f,s,l,h,d,p,v,g){var y=f-r,_=s-i,m=y*y+_*_;if(m>4*n&&v--){var x=o+h,b=a+d,w=c+p,M=To(x*x+b*b+w*w),T=Co(w/=M),S=po(po(w)-1)n||po((y*N+_*E)/m-.5)>.3||o*h+a*d+c*p2?t[2]%360*ho:0,A()):[g*lo,y*lo,_*lo]},S.precision=function(t){return arguments.length?(T=hs(C,M=t*t),N()):To(M)},S.fitExtent=function(t,n){return os(S,t,n)},S.fitSize=function(t,n){return as(S,t,n)},S.fitWidth=function(t,n){return cs(S,t,n)},S.fitHeight=function(t,n){return fs(S,t,n)},function(){return n=t.apply(this,arguments),S.invert=n.invert&&k,A()}}function gs(t){var n=0,e=ao/3,r=vs(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*ho,e=t[1]*ho):[n*lo,e*lo]},i}function ys(t,n){var e=wo(t),r=(e+wo(n))/2;if(po(r)=.12&&i<.234&&r>=-.425&&r<-.214?a:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:o).invert(t)},s.stream=function(e){return t&&n===e?t:(r=[o.stream(n=e),a.stream(e),c.stream(e)],i=r.length,t={point:function(t,n){for(var e=-1;++e0?n<-co+oo&&(n=-co+oo):n>co-oo&&(n=co-oo);var e=i/bo(Es(n),r);return[e*wo(r*t),i-e*yo(r*t)]}return u.invert=function(t,n){var e=i-n,u=Mo(r)*To(t*t+e*e);return[go(t,po(e))/r*Mo(e),2*vo(bo(i/u,1/r))-co]},u}var Ps=function(){return gs(zs).scale(109.5).parallels([30,30])};function Os(t,n){return[t,n]}Os.invert=Os;var Rs=function(){return ps(Os).scale(152.63)};function Ls(t,n){var e=yo(t),r=t===n?wo(t):(e-yo(n))/(n-t),i=e/r+t;if(po(r)oo&&--i>0);return[t/(.8707+(u=r*r)*(u*(u*u*u*(.003971-.001529*u)-.013791)-.131979)),r]};var Hs=function(){return ps(Is).scale(175.295)};function Ys(t,n){return[yo(n)*wo(t),wo(n)]}Ys.invert=ws(Co);var Bs=function(){return ps(Ys).scale(249.5).clipAngle(90+oo)};function Vs(t,n){var e=yo(n),r=1+yo(t)*e;return[e*wo(t)/r,wo(n)/r]}Vs.invert=ws((function(t){return 2*vo(t)}));var Xs=function(){return ps(Vs).scale(250).clipAngle(142)};function Ws(t,n){return[xo(So((co+n)/2)),-t]}Ws.invert=function(t,n){return[-n,2*vo(mo(t))-co]};var $s=function(){var t=Ns(Ws),n=t.center,e=t.rotate;return t.center=function(t){return arguments.length?n([-t[1],t[0]]):[(t=n())[1],-t[0]]},t.rotate=function(t){return arguments.length?e([t[0],t[1],t.length>2?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)};function Gs(t,n){return t.parent===n.parent?1:2}function Zs(t,n){return t+n.x}function Qs(t,n){return Math.max(t,n.y)}var Js=function(){var t=Gs,n=1,e=1,r=!1;function i(i){var u,o=0;i.eachAfter((function(n){var e=n.children;e?(n.x=function(t){return t.reduce(Zs,0)/t.length}(e),n.y=function(t){return 1+t.reduce(Qs,0)}(e)):(n.x=u?o+=t(n,u):0,n.y=0,u=n)}));var a=function(t){for(var n;n=t.children;)t=n[0];return t}(i),c=function(t){for(var n;n=t.children;)t=n[n.length-1];return t}(i),f=a.x-t(a,c)/2,s=c.x+t(c,a)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*n,t.y=(i.y-t.y)*e}:function(t){t.x=(t.x-f)/(s-f)*n,t.y=(1-(i.y?t.y/i.y:1))*e})}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i};function Ks(t){var n=0,e=t.children,r=e&&e.length;if(r)for(;--r>=0;)n+=e[r].value;else n=1;t.value=n}function tl(t,n){var e,r,i,u,o,a=new il(t),c=+t.value&&(a.value=t.value),f=[a];for(null==n&&(n=nl);e=f.pop();)if(c&&(e.value=+e.data.value),(i=n(e.data))&&(o=i.length))for(e.children=new Array(o),u=o-1;u>=0;--u)f.push(r=e.children[u]=new il(i[u])),r.parent=e,r.depth=e.depth+1;return a.eachBefore(rl)}function nl(t){return t.children}function el(t){t.data=t.data.data}function rl(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function il(t){this.data=t,this.depth=this.height=0,this.parent=null}il.prototype=tl.prototype={constructor:il,count:function(){return this.eachAfter(Ks)},each:function(t){var n,e,r,i,u=this,o=[u];do{for(n=o.reverse(),o=[];u=n.pop();)if(t(u),e=u.children)for(r=0,i=e.length;r=0;--e)i.push(n[e]);return this},sum:function(t){return this.eachAfter((function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e}))},sort:function(t){return this.eachBefore((function(n){n.children&&n.children.sort(t)}))},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){var t=[];return this.each((function(n){t.push(n)})),t},leaves:function(){var t=[];return this.eachBefore((function(n){n.children||t.push(n)})),t},links:function(){var t=this,n=[];return t.each((function(e){e!==t&&n.push({source:e.parent,target:e})})),n},copy:function(){return tl(this).eachBefore(el)}};var ul=Array.prototype.slice,ol=function(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(ul.call(t))).length,u=[];r0&&e*e>r*r+i*i}function sl(t,n){for(var e=0;ee*e+r*r}function gl(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,u=(n.y*e.r+e.y*n.r)/r;return i*i+u*u}function yl(t){this._=t,this.next=null,this.previous=null}function _l(t){if(!(i=t.length))return 0;var n,e,r,i,u,o,a,c,f,s,l;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;pl(e,n,r=t[2]),n=new yl(n),e=new yl(e),r=new yl(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(a=3;a0)throw new Error("cycle");return u}return e.id=function(n){return arguments.length?(t=xl(n),e):t},e.parentId=function(t){return arguments.length?(n=xl(t),e):n},e};function Ul(t,n){return t.parent===n.parent?1:2}function Dl(t){var n=t.children;return n?n[0]:t.t}function Fl(t){var n=t.children;return n?n[n.length-1]:t.t}function jl(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function Il(t,n,e){return t.a.parent===n.parent?t.a:e}function Hl(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}Hl.prototype=Object.create(il.prototype);var Yl=function(){var t=Ul,n=1,e=1,r=null;function i(i){var c=function(t){for(var n,e,r,i,u,o=new Hl(t,0),a=[o];n=a.pop();)if(r=n._.children)for(n.children=new Array(u=r.length),i=u-1;i>=0;--i)a.push(e=n.children[i]=new Hl(r[i],i)),e.parent=n;return(o.parent=new Hl(null,0)).children=[o],o}(i);if(c.eachAfter(u),c.parent.m=-c.z,c.eachBefore(o),r)i.eachBefore(a);else{var f=i,s=i,l=i;i.eachBefore((function(t){t.xs.x&&(s=t),t.depth>l.depth&&(l=t)}));var h=f===s?1:t(f,s)/2,d=h-f.x,p=n/(s.x+h+d),v=e/(l.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*v}))}return i}function u(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,u=i.length;--u>=0;)(n=i[u]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var u=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-u):n.z=u}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,u=n,o=n,a=e,c=u.parent.children[0],f=u.m,s=o.m,l=a.m,h=c.m;a=Fl(a),u=Dl(u),a&&u;)c=Dl(c),(o=Fl(o)).a=n,(i=a.z+l-u.z-f+t(a._,u._))>0&&(jl(Il(a,n,r),n,i),f+=i,s+=i),l+=a.m,f+=u.m,h+=c.m,s+=o.m;a&&!Fl(o)&&(o.t=a,o.m+=l-s),u&&!Dl(c)&&(c.t=u,c.m+=f-h,r=n)}return r}(n,i,n.parent.A||r[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function a(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},Bl=function(t,n,e,r,i){for(var u,o=t.children,a=-1,c=o.length,f=t.value&&(i-e)/t.value;++ah&&(h=a),g=s*s*v,(d=Math.max(h/g,g/l))>p){s-=a;break}p=d}y.push(o={value:s,dice:c1?n:1)},e}(Vl),$l=function(){var t=Wl,n=!1,e=1,r=1,i=[0],u=bl,o=bl,a=bl,c=bl,f=bl;function s(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(l),i=[0],n&&t.eachBefore(Al),t}function l(n){var e=i[n.depth],r=n.x0+e,s=n.y0+e,l=n.x1-e,h=n.y1-e;l=e-1){var s=a[n];return s.x0=i,s.y0=u,s.x1=o,void(s.y1=c)}for(var l=f[n],h=r/2+l,d=n+1,p=e-1;d>>1;f[v]c-u){var _=(i*y+o*g)/r;t(n,d,g,i,u,_,c),t(d,e,y,_,u,o,c)}else{var m=(u*y+c*g)/r;t(n,d,g,i,u,o,m),t(d,e,y,i,m,o,c)}}(0,c,t.value,n,e,r,i)},Zl=function(t,n,e,r,i){(1&t.depth?Bl:Nl)(t,n,e,r,i)},Ql=function t(n){function e(t,e,r,i,u){if((o=t._squarify)&&o.ratio===n)for(var o,a,c,f,s,l=-1,h=o.length,d=t.value;++l1?n:1)},e}(Vl),Jl=function(t){for(var n,e=-1,r=t.length,i=t[r-1],u=0;++e1&&th(t[e[r-2]],t[e[r-1]],t[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}var rh=function(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n=0;--n)f.push(t[r[u[n]][2]]);for(n=+a;na!=f>a&&o<(c-e)*(a-r)/(f-r)+e&&(s=!s),c=e,f=r;return s},uh=function(t){for(var n,e,r=-1,i=t.length,u=t[i-1],o=u[0],a=u[1],c=0;++r=0;)if((e=t._tasks[r])&&(t._tasks[r]=null,e.abort))try{e.abort()}catch(n){}t._active=NaN,hh(t)}function hh(t){if(!t._active&&t._call){var n=t._data;t._data=void 0,t._call(t._error,n)}}function dh(t){if(null==t)t=1/0;else if(!((t=+t)>=1))throw new Error("invalid concurrency");return new ch(t)}ch.prototype=dh.prototype={constructor:ch,defer:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("defer after await");if(null!=this._error)return this;var n=oh.call(arguments,1);return n.push(t),++this._waiting,this._tasks.push(n),fh(this),this},abort:function(){return null==this._error&&lh(this,new Error("abort")),this},await:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=function(n,e){t.apply(null,[n].concat(e))},hh(this),this},awaitAll:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=t,hh(this),this}};var ph=function(){return Math.random()},vh=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(ph),gh=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var u;if(null!=r)u=r,r=null;else do{r=2*n()-1,u=2*n()-1,i=r*r+u*u}while(!i||i>1);return t+e*u*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(ph),yh=function t(n){function e(){var t=gh.source(n).apply(this,arguments);return function(){return Math.exp(t())}}return e.source=t,e}(ph),_h=function t(n){function e(t){return function(){for(var e=0,r=0;r=200&&r<300||304===r){if(i)try{n=i.call(e,c)}catch(t){return void o.call("error",e,t)}else n=c;o.call("load",e,n)}else o.call("error",e,t)}if("undefined"==typeof XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(t)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=c.ontimeout=h:c.onreadystatechange=function(t){c.readyState>3&&h(t)},c.onprogress=function(t){o.call("progress",e,t)},e={header:function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?a.get(t):(null==n?a.remove(t):a.set(t,n+""),e)},mimeType:function(t){return arguments.length?(r=null==t?null:t+"",e):r},responseType:function(t){return arguments.length?(u=t,e):u},timeout:function(t){return arguments.length?(l=+t,e):l},user:function(t){return arguments.length<1?f:(f=null==t?null:t+"",e)},password:function(t){return arguments.length<1?s:(s=null==t?null:t+"",e)},response:function(t){return i=t,e},get:function(t,n){return e.send("GET",t,n)},post:function(t,n){return e.send("POST",t,n)},send:function(n,i,h){return c.open(n,t,!0,f,s),null==r||a.has("accept")||a.set("accept",r+",*/*"),c.setRequestHeader&&a.each((function(t,n){c.setRequestHeader(n,t)})),null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),l>0&&(c.timeout=l),null==h&&"function"==typeof i&&(h=i,i=null),null!=h&&1===h.length&&(h=function(t){return function(n,e){t(null==n?e:null)}}(h)),null!=h&&e.on("error",h).on("load",(function(t){h(null,t)})),o.call("beforesend",e,c),c.send(null==i?null:i),e},abort:function(){return c.abort(),e},on:function(){var t=o.on.apply(o,arguments);return t===o?e:t}},null!=n){if("function"!=typeof n)throw new Error("invalid callback: "+n);return e.get(n)}return e},wh=function(t,n){return function(e,r){var i=bh(e).mimeType(t).response(n);if(null!=r){if("function"!=typeof r)throw new Error("invalid callback: "+r);return i.get(r)}return i}},Mh=wh("text/html",(function(t){return document.createRange().createContextualFragment(t.responseText)})),Th=wh("application/json",(function(t){return JSON.parse(t.responseText)})),Sh=wh("text/plain",(function(t){return t.responseText})),kh=wh("application/xml",(function(t){var n=t.responseXML;if(!n)throw new Error("parse error");return n})),Ch=function(t,n){return function(e,r,i){arguments.length<3&&(i=r,r=null);var u=bh(e).mimeType(t);return u.row=function(t){return arguments.length?u.response(function(t,n){return function(e){return t(e.responseText,n)}}(n,r=t)):r},u.row(r),i?u.get(i):u}},Ah=Ch("text/csv",ru),Nh=Ch("text/tab-separated-values",cu),Eh=Array.prototype,zh=Eh.map,Ph=Eh.slice,Oh={name:"implicit"};function Rh(t){var n=Object($i.c)(),e=[],r=Oh;function i(i){var u=i+"",o=n.get(u);if(!o){if(r!==Oh)return r;n.set(u,o=e.push(i))}return t[(o-1)%t.length]}return t=null==t?[]:Ph.call(t),i.domain=function(t){if(!arguments.length)return e.slice();e=[],n=Object($i.c)();for(var r,u,o=-1,a=t.length;++o2?Hh:Ih,r=i=null,s}function s(n){return(r||(r=e(u,o,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=n?0:t>=e?1:r(t)}}}(t):t,a)))(+n)}return s.invert=function(t){return(i||(i=e(o,u,jh,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}(n):n)))(+t)},s.domain=function(t){return arguments.length?(u=zh.call(t,Dh),f()):u.slice()},s.range=function(t){return arguments.length?(o=Ph.call(t),f()):o.slice()},s.rangeRound=function(t){return o=Ph.call(t),a=ue,f()},s.clamp=function(t){return arguments.length?(c=!!t,f()):c},s.interpolate=function(t){return arguments.length?(a=t,f()):a},f()}var Vh=function(t,n,e){var i,u=t[0],o=t[t.length-1],a=Object(r.A)(u,o,null==n?10:n);switch((e=Bu(null==e?",f":e)).type){case"s":var c=Math.max(Math.abs(u),Math.abs(o));return null!=e.precision||isNaN(i=to(a,c))||(e.precision=i),$u(e,c);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(i=no(a,Math.max(Math.abs(u),Math.abs(o))))||(e.precision=i-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(i=Ku(a))||(e.precision=i-2*("%"===e.type))}return Wu(e)};function Xh(t){var n=t.domain;return t.ticks=function(t){var e=n();return Object(r.B)(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return Vh(n(),t,e)},t.nice=function(e){null==e&&(e=10);var i,u=n(),o=0,a=u.length-1,c=u[o],f=u[a];return f0?(c=Math.floor(c/i)*i,f=Math.ceil(f/i)*i,i=Object(r.z)(c,f,e)):i<0&&(c=Math.ceil(c*i)/i,f=Math.floor(f*i)/i,i=Object(r.z)(c,f,e)),i>0?(u[o]=Math.floor(c/i)*i,u[a]=Math.ceil(f/i)*i,n(u)):i<0&&(u[o]=Math.ceil(c*i)/i,u[a]=Math.floor(f*i)/i,n(u)),t},t}function Wh(){var t=Bh(jh,Kn);return t.copy=function(){return Yh(t,Wh())},Xh(t)}function $h(){var t=[0,1];function n(t){return+t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=zh.call(e,Dh),n):t.slice()},n.copy=function(){return $h().domain(t)},Xh(n)}var Gh=function(t,n){var e,r=0,i=(t=t.slice()).length-1,u=t[r],o=t[i];return o0){for(;df)break;g.push(h)}}else for(;d=1;--l)if(!((h=s*l)f)break;g.push(h)}}else g=Object(r.B)(d,p,Math.min(p-d,v)).map(u);return o?g.reverse():g},t.tickFormat=function(n,r){if(null==r&&(r=10===e?".0e":","),"function"!=typeof r&&(r=Wu(r)),n===1/0)return r;null==n&&(n=10);var o=Math.max(1,e*n/t.ticks().length);return function(t){var n=t/u(Math.round(i(t)));return n*e0?e[i-1]:t[0],i=e?[i[e-1],n]:[i[o-1],i[o]]},o.copy=function(){return ad().domain([t,n]).range(u)},Xh(o)}function cd(){var t=[.5],n=[0,1],e=1;function i(i){if(i<=i)return n[Object(r.b)(t,i,0,e)]}return i.domain=function(r){return arguments.length?(t=Ph.call(r),e=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(r){return arguments.length?(n=Ph.call(r),e=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.copy=function(){return cd().domain(t).range(n)},i}var fd=new Date,sd=new Date;function ld(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n0))return a;do{a.push(o=new Date(+e)),n(e,u),t(e)}while(o=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););}))},e&&(i.count=function(n,r){return fd.setTime(+n),sd.setTime(+r),t(fd),t(sd),Math.floor(e(fd,sd))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var hd=ld((function(){}),(function(t,n){t.setTime(+t+n)}),(function(t,n){return n-t}));hd.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?ld((function(n){n.setTime(Math.floor(n/t)*t)}),(function(n,e){n.setTime(+n+e*t)}),(function(n,e){return(e-n)/t})):hd:null};var dd=hd,pd=hd.range,vd=6e4,gd=6048e5,yd=ld((function(t){t.setTime(1e3*Math.floor(t/1e3))}),(function(t,n){t.setTime(+t+1e3*n)}),(function(t,n){return(n-t)/1e3}),(function(t){return t.getUTCSeconds()})),_d=yd,md=yd.range,xd=ld((function(t){t.setTime(Math.floor(t/vd)*vd)}),(function(t,n){t.setTime(+t+n*vd)}),(function(t,n){return(n-t)/vd}),(function(t){return t.getMinutes()})),bd=xd,wd=xd.range,Md=ld((function(t){var n=t.getTimezoneOffset()*vd%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getHours()})),Td=Md,Sd=Md.range,kd=ld((function(t){t.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*vd)/864e5}),(function(t){return t.getDate()-1})),Cd=kd,Ad=kd.range;function Nd(t){return ld((function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+7*n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*vd)/gd}))}var Ed=Nd(0),zd=Nd(1),Pd=Nd(2),Od=Nd(3),Rd=Nd(4),Ld=Nd(5),qd=Nd(6),Ud=Ed.range,Dd=zd.range,Fd=Pd.range,jd=Od.range,Id=Rd.range,Hd=Ld.range,Yd=qd.range,Bd=ld((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,n){t.setMonth(t.getMonth()+n)}),(function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),Vd=Bd,Xd=Bd.range,Wd=ld((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n)}),(function(t,n){return n.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Wd.every=function(t){return isFinite(t=Math.floor(t))&&t>0?ld((function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)}),(function(n,e){n.setFullYear(n.getFullYear()+e*t)})):null};var $d=Wd,Gd=Wd.range,Zd=ld((function(t){t.setUTCSeconds(0,0)}),(function(t,n){t.setTime(+t+n*vd)}),(function(t,n){return(n-t)/vd}),(function(t){return t.getUTCMinutes()})),Qd=Zd,Jd=Zd.range,Kd=ld((function(t){t.setUTCMinutes(0,0,0)}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getUTCHours()})),tp=Kd,np=Kd.range,ep=ld((function(t){t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+n)}),(function(t,n){return(n-t)/864e5}),(function(t){return t.getUTCDate()-1})),rp=ep,ip=ep.range;function up(t){return ld((function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+7*n)}),(function(t,n){return(n-t)/gd}))}var op=up(0),ap=up(1),cp=up(2),fp=up(3),sp=up(4),lp=up(5),hp=up(6),dp=op.range,pp=ap.range,vp=cp.range,gp=fp.range,yp=sp.range,_p=lp.range,mp=hp.range,xp=ld((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCMonth(t.getUTCMonth()+n)}),(function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),bp=xp,wp=xp.range,Mp=ld((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)}),(function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));Mp.every=function(t){return isFinite(t=Math.floor(t))&&t>0?ld((function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)}),(function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)})):null};var Tp=Mp,Sp=Mp.range;function kp(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Cp(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Ap(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function Np(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,u=t.days,o=t.shortDays,a=t.months,c=t.shortMonths,f=Ip(i),s=Hp(i),l=Ip(u),h=Hp(u),d=Ip(o),p=Hp(o),v=Ip(a),g=Hp(a),y=Ip(c),_=Hp(c),m={a:function(t){return o[t.getDay()]},A:function(t){return u[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:cv,e:cv,f:dv,H:fv,I:sv,j:lv,L:hv,m:pv,M:vv,p:function(t){return i[+(t.getHours()>=12)]},Q:Yv,s:Bv,S:gv,u:yv,U:_v,V:mv,w:xv,W:bv,x:null,X:null,y:wv,Y:Mv,Z:Tv,"%":Hv},x={a:function(t){return o[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:Sv,e:Sv,f:Ev,H:kv,I:Cv,j:Av,L:Nv,m:zv,M:Pv,p:function(t){return i[+(t.getUTCHours()>=12)]},Q:Yv,s:Bv,S:Ov,u:Rv,U:Lv,V:qv,w:Uv,W:Dv,x:null,X:null,y:Fv,Y:jv,Z:Iv,"%":Hv},b={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=l.exec(n.slice(e));return r?(t.w=h[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=y.exec(n.slice(e));return r?(t.m=_[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=g[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return T(t,n,e,r)},d:Jp,e:Jp,f:iv,H:tv,I:tv,j:Kp,L:rv,m:Qp,M:nv,p:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.p=s[r[0].toLowerCase()],e+r[0].length):-1},Q:ov,s:av,S:ev,u:Bp,U:Vp,V:Xp,w:Yp,W:Wp,x:function(t,n,r){return T(t,e,n,r)},X:function(t,n,e){return T(t,r,n,e)},y:Gp,Y:$p,Z:Zp,"%":uv};function w(t,n){return function(e){var r,i,u,o=[],a=-1,c=0,f=t.length;for(e instanceof Date||(e=new Date(+e));++a53)return null;"w"in u||(u.w=1),"Z"in u?(r=(i=(r=Cp(Ap(u.y))).getUTCDay())>4||0===i?ap.ceil(r):ap(r),r=rp.offset(r,7*(u.V-1)),u.y=r.getUTCFullYear(),u.m=r.getUTCMonth(),u.d=r.getUTCDate()+(u.w+6)%7):(r=(i=(r=n(Ap(u.y))).getDay())>4||0===i?zd.ceil(r):zd(r),r=Cd.offset(r,7*(u.V-1)),u.y=r.getFullYear(),u.m=r.getMonth(),u.d=r.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),i="Z"in u?Cp(Ap(u.y)).getUTCDay():n(Ap(u.y)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(i+5)%7:u.w+7*u.U-(i+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,Cp(u)):n(u)}}function T(t,n,e,r){for(var i,u,o=0,a=n.length,c=e.length;o=c)return-1;if(37===(i=n.charCodeAt(o++))){if(i=n.charAt(o++),!(u=b[i in Lp?n.charAt(o++):i])||(r=u(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return m.x=w(e,m),m.X=w(r,m),m.c=w(n,m),x.x=w(e,x),x.X=w(r,x),x.c=w(n,x),{format:function(t){var n=w(t+="",m);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",kp);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",x);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t,Cp);return n.toString=function(){return t},n}}}var Ep,zp,Pp,Op,Rp,Lp={"-":"",_:" ",0:"0"},qp=/^\s*\d+/,Up=/^%/,Dp=/[\\^$*+?|[\]().{}]/g;function Fp(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",u=i.length;return r+(u68?1900:2e3),e+r[0].length):-1}function Zp(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Qp(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function Jp(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function Kp(t,n,e){var r=qp.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function tv(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function nv(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function ev(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function rv(t,n,e){var r=qp.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function iv(t,n,e){var r=qp.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function uv(t,n,e){var r=Up.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function ov(t,n,e){var r=qp.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function av(t,n,e){var r=qp.exec(n.slice(e));return r?(t.Q=1e3*+r[0],e+r[0].length):-1}function cv(t,n){return Fp(t.getDate(),n,2)}function fv(t,n){return Fp(t.getHours(),n,2)}function sv(t,n){return Fp(t.getHours()%12||12,n,2)}function lv(t,n){return Fp(1+Cd.count($d(t),t),n,3)}function hv(t,n){return Fp(t.getMilliseconds(),n,3)}function dv(t,n){return hv(t,n)+"000"}function pv(t,n){return Fp(t.getMonth()+1,n,2)}function vv(t,n){return Fp(t.getMinutes(),n,2)}function gv(t,n){return Fp(t.getSeconds(),n,2)}function yv(t){var n=t.getDay();return 0===n?7:n}function _v(t,n){return Fp(Ed.count($d(t),t),n,2)}function mv(t,n){var e=t.getDay();return t=e>=4||0===e?Rd(t):Rd.ceil(t),Fp(Rd.count($d(t),t)+(4===$d(t).getDay()),n,2)}function xv(t){return t.getDay()}function bv(t,n){return Fp(zd.count($d(t),t),n,2)}function wv(t,n){return Fp(t.getFullYear()%100,n,2)}function Mv(t,n){return Fp(t.getFullYear()%1e4,n,4)}function Tv(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Fp(n/60|0,"0",2)+Fp(n%60,"0",2)}function Sv(t,n){return Fp(t.getUTCDate(),n,2)}function kv(t,n){return Fp(t.getUTCHours(),n,2)}function Cv(t,n){return Fp(t.getUTCHours()%12||12,n,2)}function Av(t,n){return Fp(1+rp.count(Tp(t),t),n,3)}function Nv(t,n){return Fp(t.getUTCMilliseconds(),n,3)}function Ev(t,n){return Nv(t,n)+"000"}function zv(t,n){return Fp(t.getUTCMonth()+1,n,2)}function Pv(t,n){return Fp(t.getUTCMinutes(),n,2)}function Ov(t,n){return Fp(t.getUTCSeconds(),n,2)}function Rv(t){var n=t.getUTCDay();return 0===n?7:n}function Lv(t,n){return Fp(op.count(Tp(t),t),n,2)}function qv(t,n){var e=t.getUTCDay();return t=e>=4||0===e?sp(t):sp.ceil(t),Fp(sp.count(Tp(t),t)+(4===Tp(t).getUTCDay()),n,2)}function Uv(t){return t.getUTCDay()}function Dv(t,n){return Fp(ap.count(Tp(t),t),n,2)}function Fv(t,n){return Fp(t.getUTCFullYear()%100,n,2)}function jv(t,n){return Fp(t.getUTCFullYear()%1e4,n,4)}function Iv(){return"+0000"}function Hv(){return"%"}function Yv(t){return+t}function Bv(t){return Math.floor(+t/1e3)}function Vv(t){return Ep=Np(t),zp=Ep.format,Pp=Ep.parse,Op=Ep.utcFormat,Rp=Ep.utcParse,Ep}Vv({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"]});var Xv=Date.prototype.toISOString?function(t){return t.toISOString()}:Op("%Y-%m-%dT%H:%M:%S.%LZ"),Wv=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:Rp("%Y-%m-%dT%H:%M:%S.%LZ"),$v=1e3,Gv=60*$v,Zv=60*Gv,Qv=24*Zv,Jv=7*Qv,Kv=30*Qv,tg=365*Qv;function ng(t){return new Date(t)}function eg(t){return t instanceof Date?+t:+new Date(+t)}function rg(t,n,e,i,u,o,a,c,f){var s=Bh(jh,Kn),l=s.invert,h=s.domain,d=f(".%L"),p=f(":%S"),v=f("%I:%M"),g=f("%I %p"),y=f("%a %d"),_=f("%b %d"),m=f("%B"),x=f("%Y"),b=[[a,1,$v],[a,5,5*$v],[a,15,15*$v],[a,30,30*$v],[o,1,Gv],[o,5,5*Gv],[o,15,15*Gv],[o,30,30*Gv],[u,1,Zv],[u,3,3*Zv],[u,6,6*Zv],[u,12,12*Zv],[i,1,Qv],[i,2,2*Qv],[e,1,Jv],[n,1,Kv],[n,3,3*Kv],[t,1,tg]];function w(r){return(a(r)1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return pg.h=360*t-100,pg.s=1.5-1.5*n,pg.l=.8-.9*n,pg+""};function gg(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var yg=gg(og("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),_g=gg(og("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),mg=gg(og("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),xg=gg(og("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function bg(t){var n=0,e=1,r=!1;function i(i){var u=(i-n)/(e-n);return t(r?Math.max(0,Math.min(1,u)):u)}return i.domain=function(t){return arguments.length?(n=+t[0],e=+t[1],i):[n,e]},i.clamp=function(t){return arguments.length?(r=!!t,i):r},i.interpolator=function(n){return arguments.length?(t=n,i):t},i.copy=function(){return bg(t).domain([n,e]).clamp(r)},Xh(i)}var wg=e(5),Mg=function(t){return function(){return t}};function Tg(t){return t[0]}function Sg(t){return t[1]}function kg(){this._=null}function Cg(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Ag(t,n){var e=n,r=n.R,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function Ng(t,n){var e=n,r=n.L,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function Eg(t){for(;t.L;)t=t.L;return t}kg.prototype={constructor:kg,insert:function(t,n){var e,r,i;if(t){if(n.P=t,n.N=t.N,t.N&&(t.N.P=n),t.N=n,t.R){for(t=t.R;t.L;)t=t.L;t.L=n}else t.R=n;e=t}else this._?(t=Eg(this._),n.P=null,n.N=t,t.P=t.L=n,e=t):(n.P=n.N=null,this._=n,e=null);for(n.L=n.R=null,n.U=e,n.C=!0,t=n;e&&e.C;)e===(r=e.U).L?(i=r.R)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.R&&(Ag(this,e),e=(t=e).U),e.C=!1,r.C=!0,Ng(this,r)):(i=r.L)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.L&&(Ng(this,e),e=(t=e).U),e.C=!1,r.C=!0,Ag(this,r)),e=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var n,e,r,i=t.U,u=t.L,o=t.R;if(e=u?o?Eg(o):u:o,i?i.L===t?i.L=e:i.R=e:this._=e,u&&o?(r=e.C,e.C=t.C,e.L=u,u.U=e,e!==o?(i=e.U,e.U=t.U,t=e.R,i.L=t,e.R=o,o.U=e):(e.U=i,i=e,t=e.R)):(r=t.C,t=e),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((n=i.R).C&&(n.C=!1,i.C=!0,Ag(this,i),n=i.R),n.L&&n.L.C||n.R&&n.R.C){n.R&&n.R.C||(n.L.C=!1,n.C=!0,Ng(this,n),n=i.R),n.C=i.C,i.C=n.R.C=!1,Ag(this,i),t=this._;break}}else if((n=i.L).C&&(n.C=!1,i.C=!0,Ng(this,i),n=i.L),n.L&&n.L.C||n.R&&n.R.C){n.L&&n.L.C||(n.R.C=!1,n.C=!0,Ag(this,n),n=i.L),n.C=i.C,i.C=n.L.C=!1,Ng(this,i),t=this._;break}n.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var zg=kg;function Pg(t,n,e,r){var i=[null,null],u=ty.push(i)-1;return i.left=t,i.right=n,e&&Rg(i,t,n,e),r&&Rg(i,n,t,r),Jg[t.index].halfedges.push(u),Jg[n.index].halfedges.push(u),i}function Og(t,n,e){var r=[n,e];return r.left=t,r}function Rg(t,n,e,r){t[0]||t[1]?t.left===e?t[1]=r:t[0]=r:(t[0]=r,t.left=n,t.right=e)}function Lg(t,n,e,r,i){var u,o=t[0],a=t[1],c=o[0],f=o[1],s=0,l=1,h=a[0]-c,d=a[1]-f;if(u=n-c,h||!(u>0)){if(u/=h,h<0){if(u0){if(u>l)return;u>s&&(s=u)}if(u=r-c,h||!(u<0)){if(u/=h,h<0){if(u>l)return;u>s&&(s=u)}else if(h>0){if(u0)){if(u/=d,d<0){if(u0){if(u>l)return;u>s&&(s=u)}if(u=i-f,d||!(u<0)){if(u/=d,d<0){if(u>l)return;u>s&&(s=u)}else if(d>0){if(u0||l<1)||(s>0&&(t[0]=[c+s*h,f+s*d]),l<1&&(t[1]=[c+l*h,f+l*d]),!0)}}}}}function qg(t,n,e,r,i){var u=t[1];if(u)return!0;var o,a,c=t[0],f=t.left,s=t.right,l=f[0],h=f[1],d=s[0],p=s[1],v=(l+d)/2,g=(h+p)/2;if(p===h){if(v=r)return;if(l>d){if(c){if(c[1]>=i)return}else c=[v,e];u=[v,i]}else{if(c){if(c[1]1)if(l>d){if(c){if(c[1]>=i)return}else c=[(e-a)/o,e];u=[(i-a)/o,i]}else{if(c){if(c[1]=r)return}else c=[n,o*n+a];u=[r,o*r+a]}else{if(c){if(c[0]=-ey)){var d=c*c+f*f,p=s*s+l*l,v=(l*d-f*p)/h,g=(c*p-s*d)/h,y=Ig.pop()||new function(){Cg(this),this.x=this.y=this.arc=this.site=this.cy=null};y.arc=t,y.site=i,y.x=v+o,y.y=(y.cy=g+a)+Math.sqrt(v*v+g*g),t.circle=y;for(var _=null,m=Kg._;m;)if(y.yny)a=a.L;else{if(!((i=u-Zg(a,o))>ny)){r>-ny?(n=a.P,e=a):i>-ny?(n=a,e=a.N):n=e=a;break}if(!a.R){n=a;break}a=a.R}!function(t){Jg[t.index]={site:t,halfedges:[]}}(t);var c=Vg(t);if(Qg.insert(n,c),n||e){if(n===e)return Yg(n),e=Vg(n.site),Qg.insert(c,e),c.edge=e.edge=Pg(n.site,c.site),Hg(n),void Hg(e);if(e){Yg(n),Yg(e);var f=n.site,s=f[0],l=f[1],h=t[0]-s,d=t[1]-l,p=e.site,v=p[0]-s,g=p[1]-l,y=2*(h*g-d*v),_=h*h+d*d,m=v*v+g*g,x=[(g*_-d*m)/y+s,(h*m-v*_)/y+l];Rg(e.edge,f,p,x),c.edge=Pg(f,t,null,x),e.edge=Pg(t,p,null,x),Hg(n),Hg(e)}else c.edge=Pg(n.site,c.site)}}function Gg(t,n){var e=t.site,r=e[0],i=e[1],u=i-n;if(!u)return r;var o=t.P;if(!o)return-1/0;var a=(e=o.site)[0],c=e[1],f=c-n;if(!f)return a;var s=a-r,l=1/u-1/f,h=s/f;return l?(-h+Math.sqrt(h*h-2*l*(s*s/(-2*f)-c+f/2+i-u/2)))/l+r:(r+a)/2}function Zg(t,n){var e=t.N;if(e)return Gg(e,n);var r=t.site;return r[1]===n?r[0]:1/0}var Qg,Jg,Kg,ty,ny=1e-6,ey=1e-12;function ry(t,n){return n[1]-t[1]||n[0]-t[0]}function iy(t,n){var e,r,i,u=t.sort(ry).pop();for(ty=[],Jg=new Array(t.length),Qg=new zg,Kg=new zg;;)if(i=jg,u&&(!i||u[1]ny||Math.abs(i[0][1]-i[1][1])>ny)||delete ty[u]}(o,a,c,f),function(t,n,e,r){var i,u,o,a,c,f,s,l,h,d,p,v,g=Jg.length,y=!0;for(i=0;iny||Math.abs(v-h)>ny)&&(c.splice(a,0,ty.push(Og(o,d,Math.abs(p-t)ny?[t,Math.abs(l-t)ny?[Math.abs(h-r)ny?[e,Math.abs(l-e)ny?[Math.abs(h-n)=a)return null;var c=t-i.site[0],f=n-i.site[1],s=c*c+f*f;do{i=u.cells[r=o],o=null,i.halfedges.forEach((function(e){var r=u.edges[e],a=r.left;if(a!==i.site&&a||(a=r.right)){var c=t-a[0],f=n-a[1],l=c*c+f*f;lr?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>u?(u+o)/2:Math.min(0,u)||Math.max(0,o))}var _y=function(){var t,n,e=hy,r=dy,i=yy,u=vy,o=gy,a=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],f=250,s=pe,l=[],h=T("start","zoom","end"),d=500,p=150,v=0;function g(t){t.property("__zoom",py).on("wheel.zoom",M).on("mousedown.zoom",S).on("dblclick.zoom",k).filter(o).on("touchstart.zoom",C).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(t,n){return(n=Math.max(a[0],Math.min(a[1],n)))===t.k?t:new ay(n,t.x,t.y)}function _(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new ay(t.k,r,i)}function m(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,n,e){t.on("start.zoom",(function(){b(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).end()})).tween("zoom",(function(){var t=arguments,i=b(this,t),u=r.apply(this,t),o=e||m(u),a=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),c=this.__zoom,f="function"==typeof n?n.apply(this,t):n,l=s(c.invert(o).concat(a/c.k),f.invert(o).concat(a/f.k));return function(t){if(1===t)t=f;else{var n=l(t),e=a/n[2];t=new ay(e,o[0]-n[0]*e,o[1]-n[1]*e)}i.zoom(null,t)}}))}function b(t,n){for(var e,r=0,i=l.length;rv}t.zoom("mouse",i(_(t.that.__zoom,t.mouse[0]=Mt(t.that),t.mouse[1]),t.extent,c))}),!0).on("mouseup.zoom",(function(){r.on("mousemove.zoom mouseup.zoom",null),Et(ut.view,t.moved),ly(),t.end()}),!0),u=Mt(this),o=ut.clientX,a=ut.clientY;Nt(ut.view),sy(),t.mouse=[u,this.__zoom.invert(u)],or(this),t.start()}}function k(){if(e.apply(this,arguments)){var t=this.__zoom,n=Mt(this),u=t.invert(n),o=t.k*(ut.shiftKey?.5:2),a=i(_(y(t,o),n,u),r.apply(this,arguments),c);ly(),f>0?gt(this).transition().duration(f).call(x,a,n):gt(this).call(g.transform,a)}}function C(){if(e.apply(this,arguments)){var n,r,i,u,o=b(this,arguments),a=ut.changedTouches,c=a.length;for(sy(),r=0;r-1&&(n+=",");var e=t.split(".");switch(n+=".",n+=e.length>1?e[1].length:0,t.slice(-1)){case"%":n+="%";break;case"0":n+="f"}return r.format(n)}},u=function(t,n,e){var r=function(n,e,r,i,u){return!(!t.addError||!t.clearErrors||(ru?(t.addError({title:"Too Many "+e+"s",message:"This visualization requires "+(i===u?"exactly":"no more than")+" "+u+" "+e.toLowerCase()+(1===i?"":"s")+".",group:n}),1):(t.clearErrors(n),0)))},i=n.fields,u=i.pivots,o=i.dimensions,a=i.measure_like;return r("pivot-req","Pivot",u.length,e.min_pivots,e.max_pivots)&&r("dim-req","Dimension",o.length,e.min_dimensions,e.max_dimensions)&&r("mes-req","Measure",a.length,e.min_measures,e.max_measures)}},5:function(t,n,e){"use strict";var r=e(1),i=function(t){return function(){return t}},u=Math.abs,o=Math.atan2,a=Math.cos,c=Math.max,f=Math.min,s=Math.sin,l=Math.sqrt,h=1e-12,d=Math.PI,p=d/2,v=2*d;function g(t){return t>=1?p:t<=-1?-p:Math.asin(t)}function y(t){return t.innerRadius}function _(t){return t.outerRadius}function m(t){return t.startAngle}function x(t){return t.endAngle}function b(t){return t&&t.padAngle}function w(t,n,e,r,i,u,o){var a=t-e,f=n-r,s=(o?u:-u)/l(a*a+f*f),h=s*f,d=-s*a,p=t+h,v=n+d,g=e+h,y=r+d,_=(p+g)/2,m=(v+y)/2,x=g-p,b=y-v,w=x*x+b*b,M=i-u,T=p*y-g*v,S=(b<0?-1:1)*l(c(0,M*M*w-T*T)),k=(T*b-x*S)/w,C=(-T*x-b*S)/w,A=(T*b+x*S)/w,N=(-T*x+b*S)/w,E=k-_,z=C-m,P=A-_,O=N-m;return E*E+z*z>P*P+O*O&&(k=A,C=N),{cx:k,cy:C,x01:-h,y01:-d,x11:k*(i/M-1),y11:C*(i/M-1)}}var M=function(){var t=y,n=_,e=i(0),c=null,M=m,T=x,S=b,k=null;function C(){var i,y,_,m=+t.apply(this,arguments),x=+n.apply(this,arguments),b=M.apply(this,arguments)-p,C=T.apply(this,arguments)-p,A=u(C-b),N=C>b;if(k||(k=i=Object(r.a)()),xh)if(A>v-h)k.moveTo(x*a(b),x*s(b)),k.arc(0,0,x,b,C,!N),m>h&&(k.moveTo(m*a(C),m*s(C)),k.arc(0,0,m,C,b,N));else{var E,z,P=b,O=C,R=b,L=C,q=A,U=A,D=S.apply(this,arguments)/2,F=D>h&&(c?+c.apply(this,arguments):l(m*m+x*x)),j=f(u(x-m)/2,+e.apply(this,arguments)),I=j,H=j;if(F>h){var Y=g(F/m*s(D)),B=g(F/x*s(D));(q-=2*Y)>h?(R+=Y*=N?1:-1,L-=Y):(q=0,R=L=(b+C)/2),(U-=2*B)>h?(P+=B*=N?1:-1,O-=B):(U=0,P=O=(b+C)/2)}var V=x*a(P),X=x*s(P),W=m*a(L),$=m*s(L);if(j>h){var G=x*a(O),Z=x*s(O),Q=m*a(R),J=m*s(R);if(Ah?function(t,n,e,r,i,u,o,a){var c=e-t,f=r-n,s=o-i,l=a-u,h=(s*(n-u)-l*(t-i))/(l*c-s*f);return[t+h*c,n+h*f]}(V,X,Q,J,G,Z,W,$):[W,$],tt=V-K[0],nt=X-K[1],et=G-K[0],rt=Z-K[1],it=1/s(((_=(tt*et+nt*rt)/(l(tt*tt+nt*nt)*l(et*et+rt*rt)))>1?0:_<-1?d:Math.acos(_))/2),ut=l(K[0]*K[0]+K[1]*K[1]);I=f(j,(m-ut)/(it-1)),H=f(j,(x-ut)/(it+1))}}U>h?H>h?(E=w(Q,J,V,X,x,H,N),z=w(G,Z,W,$,x,H,N),k.moveTo(E.cx+E.x01,E.cy+E.y01),Hh&&q>h?I>h?(E=w(W,$,G,Z,m,-I,N),z=w(V,X,Q,J,m,-I,N),k.lineTo(E.cx+E.x01,E.cy+E.y01),I=l;--h)f.point(y[h],_[h]);f.lineEnd(),f.areaEnd()}g&&(y[s]=+t(d,s,i),_[s]=+e(d,s,i),f.point(n?+n(d,s,i):y[s],u?+u(d,s,i):_[s]))}if(p)return f=null,p+""||null}function l(){return A().defined(o).curve(c).context(a)}return s.x=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),n=null,s):t},s.x0=function(n){return arguments.length?(t="function"==typeof n?n:i(+n),s):t},s.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:i(+t),s):n},s.y=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),u=null,s):e},s.y0=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),s):e},s.y1=function(t){return arguments.length?(u=null==t?null:"function"==typeof t?t:i(+t),s):u},s.lineX0=s.lineY0=function(){return l().x(t).y(e)},s.lineY1=function(){return l().x(t).y(u)},s.lineX1=function(){return l().x(n).y(e)},s.defined=function(t){return arguments.length?(o="function"==typeof t?t:i(!!t),s):o},s.curve=function(t){return arguments.length?(c=t,null!=a&&(f=c(a)),s):c},s.context=function(t){return arguments.length?(null==t?a=f=null:f=c(a=t),s):a},s},E=function(t,n){return nt?1:n>=t?0:NaN},z=function(t){return t},P=function(){var t=z,n=E,e=null,r=i(0),u=i(v),o=i(0);function a(i){var a,c,f,s,l,h=i.length,d=0,p=new Array(h),g=new Array(h),y=+r.apply(this,arguments),_=Math.min(v,Math.max(-v,u.apply(this,arguments)-y)),m=Math.min(Math.abs(_)/h,o.apply(this,arguments)),x=m*(_<0?-1:1);for(a=0;a0&&(d+=l);for(null!=n?p.sort((function(t,e){return n(g[t],g[e])})):null!=e&&p.sort((function(t,n){return e(i[t],i[n])})),a=0,f=d?(_-h*x)/d:0;a0?l*f:0)+x,g[c]={data:i[c],index:a,value:l,startAngle:y,endAngle:s,padAngle:m};return g}return a.value=function(n){return arguments.length?(t="function"==typeof n?n:i(+n),a):t},a.sortValues=function(t){return arguments.length?(n=t,e=null,a):n},a.sort=function(t){return arguments.length?(e=t,n=null,a):e},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:i(+t),a):r},a.endAngle=function(t){return arguments.length?(u="function"==typeof t?t:i(+t),a):u},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:i(+t),a):o},a},O=L(S);function R(t){this._curve=t}function L(t){function n(n){return new R(t(n))}return n._curve=t,n}function q(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(L(t)):n()._curve},t}R.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var U=function(){return q(A().curve(O))},D=function(){var t=N().curve(O),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,u=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return q(e())},delete t.lineX0,t.lineEndAngle=function(){return q(r())},delete t.lineX1,t.lineInnerRadius=function(){return q(i())},delete t.lineY0,t.lineOuterRadius=function(){return q(u())},delete t.lineY1,t.curve=function(t){return arguments.length?n(L(t)):n()._curve},t},F=function(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]},j=Array.prototype.slice;function I(t){return t.source}function H(t){return t.target}function Y(t){var n=I,e=H,u=k,o=C,a=null;function c(){var i,c=j.call(arguments),f=n.apply(this,c),s=e.apply(this,c);if(a||(a=i=Object(r.a)()),t(a,+u.apply(this,(c[0]=f,c)),+o.apply(this,c),+u.apply(this,(c[0]=s,c)),+o.apply(this,c)),i)return a=null,i+""||null}return c.source=function(t){return arguments.length?(n=t,c):n},c.target=function(t){return arguments.length?(e=t,c):e},c.x=function(t){return arguments.length?(u="function"==typeof t?t:i(+t),c):u},c.y=function(t){return arguments.length?(o="function"==typeof t?t:i(+t),c):o},c.context=function(t){return arguments.length?(a=null==t?null:t,c):a},c}function B(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function V(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n,e=(e+i)/2,r,e,r,i)}function X(t,n,e,r,i){var u=F(n,e),o=F(n,e=(e+i)/2),a=F(r,e),c=F(r,i);t.moveTo(u[0],u[1]),t.bezierCurveTo(o[0],o[1],a[0],a[1],c[0],c[1])}function W(){return Y(B)}function $(){return Y(V)}function G(){var t=Y(X);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}var Z={draw:function(t,n){var e=Math.sqrt(n/d);t.moveTo(e,0),t.arc(0,0,e,0,v)}},Q={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},J=Math.sqrt(1/3),K=2*J,tt={draw:function(t,n){var e=Math.sqrt(n/K),r=e*J;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},nt=Math.sin(d/10)/Math.sin(7*d/10),et=Math.sin(v/10)*nt,rt=-Math.cos(v/10)*nt,it={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=et*e,i=rt*e;t.moveTo(0,-e),t.lineTo(r,i);for(var u=1;u<5;++u){var o=v*u/5,a=Math.cos(o),c=Math.sin(o);t.lineTo(c*e,-a*e),t.lineTo(a*r-c*i,c*r+a*i)}t.closePath()}},ut={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},ot=Math.sqrt(3),at={draw:function(t,n){var e=-Math.sqrt(n/(3*ot));t.moveTo(0,2*e),t.lineTo(-ot*e,-e),t.lineTo(ot*e,-e),t.closePath()}},ct=Math.sqrt(3)/2,ft=1/Math.sqrt(12),st=3*(ft/2+1),lt={draw:function(t,n){var e=Math.sqrt(n/st),r=e/2,i=e*ft,u=r,o=e*ft+e,a=-u,c=o;t.moveTo(r,i),t.lineTo(u,o),t.lineTo(a,c),t.lineTo(-.5*r-ct*i,ct*r+-.5*i),t.lineTo(-.5*u-ct*o,ct*u+-.5*o),t.lineTo(-.5*a-ct*c,ct*a+-.5*c),t.lineTo(-.5*r+ct*i,-.5*i-ct*r),t.lineTo(-.5*u+ct*o,-.5*o-ct*u),t.lineTo(-.5*a+ct*c,-.5*c-ct*a),t.closePath()}},ht=[Z,Q,tt,ut,it,at,lt],dt=function(){var t=i(Z),n=i(64),e=null;function u(){var i;if(e||(e=i=Object(r.a)()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),i)return e=null,i+""||null}return u.type=function(n){return arguments.length?(t="function"==typeof n?n:i(n),u):t},u.size=function(t){return arguments.length?(n="function"==typeof t?t:i(+t),u):n},u.context=function(t){return arguments.length?(e=null==t?null:t,u):e},u},pt=function(){};function vt(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function gt(t){this._context=t}gt.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:vt(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(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);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:vt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var yt=function(t){return new gt(t)};function _t(t){this._context=t}_t.prototype={areaStart:pt,areaEnd:pt,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(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:vt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var mt=function(t){return new _t(t)};function xt(t){this._context=t}xt.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(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:vt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var bt=function(t){return new xt(t)};function wt(t,n){this._basis=new gt(t),this._beta=n}wt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],u=n[0],o=t[e]-i,a=n[e]-u,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*o),this._beta*n[c]+(1-this._beta)*(u+r*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var Mt=function t(n){function e(t){return 1===n?new gt(t):new wt(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function Tt(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function St(t,n){this._context=t,this._k=(1-n)/6}St.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:Tt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:Tt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var kt=function t(n){function e(t){return new St(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Ct(t,n){this._context=t,this._k=(1-n)/6}Ct.prototype={areaStart:pt,areaEnd:pt,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(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Tt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var At=function t(n){function e(t){return new Ct(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Nt(t,n){this._context=t,this._k=(1-n)/6}Nt.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(t,n){switch(t=+t,n=+n,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:Tt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Et=function t(n){function e(t){return new Nt(t,n)}return e.tension=function(n){return t(+n)},e}(0);function zt(t,n,e){var r=t._x1,i=t._y1,u=t._x2,o=t._y2;if(t._l01_a>h){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>h){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);u=(u*f+t._x1*t._l23_2a-n*t._l12_2a)/s,o=(o*f+t._y1*t._l23_2a-e*t._l12_2a)/s}t._context.bezierCurveTo(r,i,u,o,t._x2,t._y2)}function Pt(t,n){this._context=t,this._alpha=n}Pt.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(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:zt(this,t,n)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Ot=function t(n){function e(t){return n?new Pt(t,n):new St(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function Rt(t,n){this._context=t,this._alpha=n}Rt.prototype={areaStart:pt,areaEnd:pt,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(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:zt(this,t,n)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Lt=function t(n){function e(t){return n?new Rt(t,n):new Ct(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function qt(t,n){this._context=t,this._alpha=n}qt.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(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+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:zt(this,t,n)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Ut=function t(n){function e(t){return n?new qt(t,n):new Nt(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function Dt(t){this._context=t}Dt.prototype={areaStart:pt,areaEnd:pt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};var Ft=function(t){return new Dt(t)};function jt(t){return t<0?-1:1}function It(t,n,e){var r=t._x1-t._x0,i=n-t._x1,u=(t._y1-t._y0)/(r||i<0&&-0),o=(e-t._y1)/(i||r<0&&-0),a=(u*i+o*r)/(r+i);return(jt(u)+jt(o))*Math.min(Math.abs(u),Math.abs(o),.5*Math.abs(a))||0}function Ht(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function Yt(t,n,e){var r=t._x0,i=t._y0,u=t._x1,o=t._y1,a=(u-r)/3;t._context.bezierCurveTo(r+a,i+a*n,u-a,o-a*e,u,o)}function Bt(t){this._context=t}function Vt(t){this._context=new Xt(t)}function Xt(t){this._context=t}function Wt(t){return new Bt(t)}function $t(t){return new Vt(t)}function Gt(t){this._context=t}function Zt(t){var n,e,r=t.length-1,i=new Array(r),u=new Array(r),o=new Array(r);for(i[0]=0,u[0]=2,o[0]=t[0]+2*t[1],n=1;n=0;--n)i[n]=(o[n]-i[n+1])/u[n];for(u[r-1]=(t[r]+i[r-1])/2,n=0;n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var Kt=function(t){return new Jt(t,.5)};function tn(t){return new Jt(t,0)}function nn(t){return new Jt(t,1)}var en=function(t,n){if((i=t.length)>1)for(var e,r,i,u=1,o=t[n[0]],a=o.length;u=0;)e[n]=n;return e};function un(t,n){return t[n]}var on=function(){var t=i([]),n=rn,e=en,r=un;function u(i){var u,o,a=t.apply(this,arguments),c=i.length,f=a.length,s=new Array(f);for(u=0;u0){for(var e,r,i,u=0,o=t[0].length;u1)for(var e,r,i,u,o,a,c=0,f=t[n[0]].length;c=0?(r[0]=u,r[1]=u+=i):i<0?(r[1]=o,r[0]=o+=i):r[0]=u},fn=function(t,n){if((e=t.length)>0){for(var e,r=0,i=t[n[0]],u=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,u=0,o=1;o Date: Tue, 14 Jan 2020 09:38:28 -0800 Subject: [PATCH 2/2] refactoring solution and adding dist file --- dist/liquid_fill_gauge.js | 2 +- src/examples/liquid_fill_gauge/liquid_fill_gauge.ts | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/dist/liquid_fill_gauge.js b/dist/liquid_fill_gauge.js index e664c4bf..3e0d96e7 100644 --- a/dist/liquid_fill_gauge.js +++ b/dist/liquid_fill_gauge.js @@ -7,4 +7,4 @@ * This file was copied from https://raw.githubusercontent.com/ugomeda/d3-liquid-fill-gauge/master/liquidFillGauge.js * and modified for use in the Looker example custom visualizations project. */ -var e={minValue:0,maxValue:100,circleThickness:.05,circleFillGap:.05,circleColor:"#178BCA",backgroundColor:null,waveColor:"#178BCA",width:0,height:0,gradientFromColor:"#FFF",gradientToColor:"#000",waveHeight:.05,waveCount:1,waveOffset:0,waveRise:!0,waveRiseTime:1e3,waveRiseAtStart:!0,waveAnimate:!0,waveAnimateTime:1800,waveHeightScaling:!0,valueCountUp:!0,valueCountUpAtStart:!0,textVertPosition:.5,textSize:1,displayPercent:!0,textColor:"#045681",waveTextColor:"#A4DBf8"};t.exports={initialize:function(t){var n,r=(n=0,function(t){return t+"-"+n++});t.liquidfillgauge=function(n,i,u){var o=t.map(e);t.map(u).each((function(t,n){o.set(n,t)})),n.each((function(n){var e,u=t.select(this),a=0!==o.get("width")?o.get("width"):parseInt(u.style("width")),c=0!==o.get("height")?o.get("height"):parseInt(u.style("height")),f=Math.min(a,c)/2,s=a/2-f,l=c/2-f,h=Math.max(o.get("minValue"),Math.min(o.get("maxValue"),i))/o.get("maxValue");e=o.get("waveHeightScaling")?t.scaleLinear().range([0,o.get("waveHeight"),0]).domain([0,50,100]):t.scaleLinear().range([o.get("waveHeight"),o.get("waveHeight")]).domain([0,100]);var d=o.get("textSize")*f/2,p=parseFloat(i).toFixed(2),v=o.get("valueCountUp")?o.get("minValue"):p,g=o.get("displayPercent")?"%":"",y=o.get("circleThickness")*f,_=y+o.get("circleFillGap")*f,m=f-_,x=m*e(100*h),b=2*m/o.get("waveCount"),w=1+o.get("waveCount"),M=b*w,T=function(t){return Math.round(t)};parseFloat(p)!=parseFloat(T(p))&&(T=function(t){return parseFloat(t).toFixed(1)}),parseFloat(p)!=parseFloat(T(p))&&(T=function(t){return parseFloat(t).toFixed(2)});for(var S=[],k=0;k<=40*w;k++)S.push({x:k/(40*w),y:k/40});var C=t.scaleLinear().range([0,2*Math.PI]).domain([0,1]),A=t.scaleLinear().range([0,f]).domain([0,f]),N=t.scaleLinear().range([0,M]).domain([0,1]),E=t.scaleLinear().range([0,x]).domain([0,1]),z=t.scaleLinear().range([_+2*m+x,_-x]).domain([0,1]),P=t.scaleLinear().range([0,M-2*m]).domain([0,1]),O=t.scaleLinear().range([_+2*m,_+.7*d]).domain([0,1]),R=u.append("g").attr("transform","translate("+s+","+l+")");o.get("backgroundColor")&&R.append("circle").attr("r",f).style("fill",o.get("backgroundColor")).attr("transform","translate("+f+","+f+")");var L=t.arc().startAngle(C(0)).endAngle(C(1)).outerRadius(A(f)).innerRadius(A(f-y));R.append("path").attr("d",L).style("fill",o.get("circleColor")).attr("transform","translate("+f+","+f+")");var q=R.append("text").attr("class","liquidFillGaugeText").attr("text-anchor","middle").attr("font-size",d+"px").style("fill",o.get("textColor")).attr("transform","translate("+f+","+O(o.get("textVertPosition"))+")"),U=t.area().x((function(t){return N(t.x)})).y0((function(t){return E(Math.sin(2*Math.PI*o.get("waveOffset")*-1+2*Math.PI*(1-o.get("waveCount"))+2*t.y*Math.PI))})).y1((function(t){return 2*m+x})),D=R.append("defs"),F=r("clipWave"),j=D.append("clipPath").attr("id",F),I=j.append("path").datum(S).attr("d",U),H=R.append("g").attr("clip-path","url(#"+F+")");if(H.append("circle").attr("cx",f).attr("cy",f).attr("r",m),o.get("fillWithGradient")){var Y=o.get("gradientPoints"),B=r("linearGradient"),V=D.append("linearGradient").attr("id",B).attr("x1",Y[0]).attr("y1",Y[1]).attr("x2",Y[2]).attr("y2",Y[3]);V.append("stop").attr("offset","0").attr("stop-color",o.get("gradientFromColor")),V.append("stop").attr("offset","1").attr("stop-color",o.get("gradientToColor")),H.style("fill","url(#"+B+")")}else H.style("fill",o.get("waveColor"));var X=H.append("text").attr("class","liquidFillGaugeText").attr("text-anchor","middle").attr("font-size",d+"px").style("fill",o.get("waveTextColor")).attr("transform","translate("+f+","+O(o.get("textVertPosition"))+")"),W=_+2*m-M;o.get("waveAnimate")&&function n(){I.transition().duration(o.get("waveAnimateTime")).ease(t.easeLinear).attr("transform","translate("+P(1)+",0)").on("end",(function(){I.attr("transform","translate("+P(0)+",0)"),n()}))}();var $=function(n,e,r,i){if(i){var u=function(){var r=t.select(this),i=t.interpolate(n,e);return function(t){r.text(T(i(t))+g)}};q.transition().duration(o.get("waveRiseTime")).tween("text",u),X.transition().duration(o.get("waveRiseTime")).tween("text",u)}else q.text(T(e)+g),X.text(T(e)+g);var a=Math.max(o.get("minValue"),Math.min(o.get("maxValue"),e))/o.get("maxValue"),c=Math.max(o.get("minValue"),Math.min(o.get("maxValue"),n))/o.get("maxValue");r?j.attr("transform","translate("+W+","+z(c)+")").transition().duration(o.get("waveRiseTime")).attr("transform","translate("+W+","+z(a)+")"):j.attr("transform","translate("+W+","+z(a)+")")};$(v,p,o.get("waveRise")&&o.get("waveRiseAtStart"),o.get("valueCountUp")&&o.get("valueCountUpAtStart")),u.on("valueChanged",(function(t){$(i,t,o.get("waveRise"),o.get("valueCountUp")),i=t})),u.on("destroy",(function(){q.interrupt().transition(),X.interrupt().transition(),j.interrupt().transition(),I.interrupt().transition(),u.on("valueChanged",null),u.on("destroy",null)}))}))}},defaultConfig:e}},2:function(t,n,e){"use strict";function r(){}function i(t,n){var e=new r;if(t instanceof r)t.each((function(t,n){e.set(n,t)}));else if(Array.isArray(t)){var i,u=-1,o=t.length;if(null==n)for(;++u=r.length)return null!=t&&e.sort(t),null!=n?n(e):e;for(var f,s,l,h=-1,d=e.length,p=r[i++],v=u(),g=a();++hr.length)return e;var o,a=i[u-1];return null!=n&&u>=r.length?o=e.entries():(o=[],e.each((function(n,e){o.push({key:e,values:t(n,u)})}))),null!=a?o.sort((function(t,n){return a(t.key,n.key)})):o}(o(t,0,f,s),0)},key:function(t){return r.push(t),e},sortKeys:function(t){return i[r.length-1]=t,e},sortValues:function(n){return t=n,e},rollup:function(t){return n=t,e}}};function a(){return{}}function c(t,n,e){t[n]=e}function f(){return u()}function s(t,n,e){t.set(n,e)}function l(){}var h=u.prototype;function d(t,n){var e=new l;if(t instanceof l)t.each((function(t){e.add(t)}));else if(t){var r=-1,i=t.length;if(null==n)for(;++r=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),o=-1,a=u.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o0)for(var e,r,i=new Array(e),u=0;u=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),k.hasOwnProperty(n)?{space:k[n],local:t}:t},A=function(t){var n=C(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===S&&n.documentElement.namespaceURI===S?n.createElement(t):n.createElementNS(e,t)}})(n)};function N(){}var E=function(t){return null==t?N:function(){return this.querySelector(t)}};function z(){return[]}var P=function(t){return null==t?z:function(){return this.querySelectorAll(t)}},O=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var R=document.documentElement;if(!R.matches){var L=R.webkitMatchesSelector||R.msMatchesSelector||R.mozMatchesSelector||R.oMatchesSelector;O=function(t){return function(){return L.call(this,t)}}}}var q=O,U=function(t){return new Array(t.length)};function D(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}D.prototype={constructor:D,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var F="$";function j(t,n,e,r,i,u){for(var o,a=0,c=n.length,f=u.length;an?1:t>=n?0:NaN}var Y=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function B(t,n){return t.style.getPropertyValue(n)||Y(t).getComputedStyle(t,null).getPropertyValue(n)}function V(t){return t.trim().split(/^|\s+/)}function X(t){return t.classList||new W(t)}function W(t){this._node=t,this._names=V(t.getAttribute("class")||"")}function $(t,n){for(var e=X(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var it={},ut=null;function ot(t,n,e){return t=at(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function at(t,n,e){return function(r){var i=ut;ut=r;try{t.call(this,this.__data__,n,e)}finally{ut=i}}}function ct(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,u=n.length;r=b&&(b=x+1);!(m=y[b])&&++b=0;)(r=i[u])&&(o&&o!==r.nextSibling&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=H);for(var e=this._groups,r=e.length,i=new Array(r),u=0;u1?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?function(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}:function(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):B(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=V(t+"");if(arguments.length<2){for(var r=X(this.node()),i=-1,u=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),o=u.length;if(!(arguments.length<2)){for(a=n?ft:ct,null==e&&(e=!1),r=0;rl}c.mouse("drag")}function v(){gt(ut.view).on("mousemove.drag mouseup.drag",null),Et(ut.view,e),At(),c.mouse("end")}function g(){if(i.apply(this,arguments)){var t,n,e=ut.changedTouches,r=u.apply(this,arguments),o=e.length;for(t=0;t>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=Vt.exec(t))?tn(parseInt(n[1],16)):(n=Xt.exec(t))?new un(n[1],n[2],n[3],1):(n=Wt.exec(t))?new un(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=$t.exec(t))?nn(n[1],n[2],n[3],n[4]):(n=Gt.exec(t))?nn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Zt.exec(t))?on(n[1],n[2]/100,n[3]/100,1):(n=Qt.exec(t))?on(n[1],n[2]/100,n[3]/100,n[4]):Jt.hasOwnProperty(t)?tn(Jt[t]):"transparent"===t?new un(NaN,NaN,NaN,0):null}function tn(t){return new un(t>>16&255,t>>8&255,255&t,1)}function nn(t,n,e,r){return r<=0&&(t=n=e=NaN),new un(t,n,e,r)}function en(t){return t instanceof jt||(t=Kt(t)),t?new un((t=t.rgb()).r,t.g,t.b,t.opacity):new un}function rn(t,n,e,r){return 1===arguments.length?en(t):new un(t,n,e,null==r?1:r)}function un(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function on(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new cn(t,n,e,r)}function an(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof cn)return new cn(t.h,t.s,t.l,t.opacity);if(t instanceof jt||(t=Kt(t)),!t)return new cn;if(t instanceof cn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),u=Math.max(n,e,r),o=NaN,a=u-i,c=(u+i)/2;return a?(o=n===u?(e-r)/a+6*(e0&&c<1?0:o,new cn(o,a,c,t.opacity)}(t):new cn(t,n,e,null==r?1:r)}function cn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function fn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Dt(jt,Kt,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),Dt(un,rn,Ft(jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new un(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new un(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),Dt(cn,an,Ft(jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new cn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new cn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new un(fn(t>=240?t-240:t+120,i,r),fn(t,i,r),fn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var sn=Math.PI/180,ln=180/Math.PI,hn=.95047,dn=1,pn=1.08883,vn=4/29,gn=6/29,yn=3*gn*gn,_n=gn*gn*gn;function mn(t){if(t instanceof bn)return new bn(t.l,t.a,t.b,t.opacity);if(t instanceof Cn){var n=t.h*sn;return new bn(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof un||(t=en(t));var e=Sn(t.r),r=Sn(t.g),i=Sn(t.b),u=wn((.4124564*e+.3575761*r+.1804375*i)/hn),o=wn((.2126729*e+.7151522*r+.072175*i)/dn);return new bn(116*o-16,500*(u-o),200*(o-wn((.0193339*e+.119192*r+.9503041*i)/pn)),t.opacity)}function xn(t,n,e,r){return 1===arguments.length?mn(t):new bn(t,n,e,null==r?1:r)}function bn(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function wn(t){return t>_n?Math.pow(t,1/3):t/yn+vn}function Mn(t){return t>gn?t*t*t:yn*(t-vn)}function Tn(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Sn(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function kn(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof Cn)return new Cn(t.h,t.c,t.l,t.opacity);t instanceof bn||(t=mn(t));var n=Math.atan2(t.b,t.a)*ln;return new Cn(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new Cn(t,n,e,null==r?1:r)}function Cn(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}Dt(bn,xn,Ft(jt,{brighter:function(t){return new bn(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new bn(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=dn*Mn(t),new un(Tn(3.2404542*(n=hn*Mn(n))-1.5371385*t-.4985314*(e=pn*Mn(e))),Tn(-.969266*n+1.8760108*t+.041556*e),Tn(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),Dt(Cn,kn,Ft(jt,{brighter:function(t){return new Cn(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Cn(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return mn(this).rgb()}}));var An=-.29227,Nn=-.90649,En=1.97294,zn=En*Nn,Pn=1.78277*En,On=1.78277*An- -.14861*Nn;function Rn(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof Ln)return new Ln(t.h,t.s,t.l,t.opacity);t instanceof un||(t=en(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(On*r+zn*n-Pn*e)/(On+zn-Pn),u=r-i,o=(En*(e-i)-An*u)/Nn,a=Math.sqrt(o*o+u*u)/(En*i*(1-i)),c=a?Math.atan2(o,u)*ln-120:NaN;return new Ln(c<0?c+360:c,a,i,t.opacity)}(t):new Ln(t,n,e,null==r?1:r)}function Ln(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function qn(t,n,e,r,i){var u=t*t,o=u*t;return((1-3*t+3*u-o)*n+(4-6*u+3*o)*e+(1+3*t+3*u-3*o)*r+o*i)/6}Dt(Ln,Rn,Ft(jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ln(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ln(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*sn,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new un(255*(n+e*(-.14861*r+1.78277*i)),255*(n+e*(An*r+Nn*i)),255*(n+e*(En*r)),this.opacity)}}));var Un=function(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],u=t[r+1],o=r>0?t[r-1]:2*i-u,a=r180||e<-180?e-360*Math.round(e/360):e):Fn(isNaN(t)?n:t)}function Hn(t,n){var e=n-t;return e?jn(t,e):Fn(isNaN(t)?n:t)}var Yn=function t(n){var e=function(t){return 1==(t=+t)?Hn:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):Fn(isNaN(n)?e:n)}}(n);function r(t,n){var r=e((t=rn(t)).r,(n=rn(n)).r),i=e(t.g,n.g),u=e(t.b,n.b),o=Hn(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=u(n),t.opacity=o(n),t+""}}return r.gamma=t,r}(1);function Bn(t){return function(n){var e,r,i=n.length,u=new Array(i),o=new Array(i),a=new Array(i);for(e=0;eu&&(i=n.slice(u,i),a[o]?a[o]+=i:a[++o]=i),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,c.push({i:o,x:Kn(e,r)})),u=ee.lastIndex;return u180?n+=360:n-t>180&&(t+=360),u.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Kn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(u.rotate,o.rotate,a,c),function(t,n,e,u){t!==n?u.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Kn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(u.skewX,o.skewX,a,c),function(t,n,e,r,u,o){if(t!==e||n!==r){var a=u.push(i(u)+"scale(",null,",",null,")");o.push({i:a-4,x:Kn(t,e)},{i:a-2,x:Kn(n,r)})}else 1===e&&1===r||u.push(i(u)+"scale("+e+","+r+")")}(u.scaleX,u.scaleY,o.scaleX,o.scaleY,a,c),u=o=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(null,t),n=n._next;--Ae}function He(){Oe=(Pe=Le.now())+Re,Ae=Ne=0;try{Ie()}finally{Ae=0,function(){for(var t,n,e=Me,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Me=n);Te=t,Be(r)}(),Oe=0}}function Ye(){var t=Le.now(),n=t-Pe;n>ze&&(Re-=n,Pe=t)}function Be(t){Ae||(Ne&&(Ne=clearTimeout(Ne)),t-Oe>24?(t<1/0&&(Ne=setTimeout(He,t-Le.now()-Re)),Ee&&(Ee=clearInterval(Ee))):(Ee||(Pe=Le.now(),Ee=setInterval(Ye,ze)),Ae=1,qe(He)))}Fe.prototype=je.prototype={constructor:Fe,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Ue():+e)+(null==n?0:+n),this._next||Te===this||(Te?Te._next=this:Me=this,Te=this),this._call=t,this._time=e,Be()},stop:function(){this._call&&(this._call=null,this._time=1/0,Be())}};var Ve=function(t,n,e){var r=new Fe;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r},Xe=function(t,n,e){var r=new Fe,i=n;return null==n?(r.restart(t,n,e),r):(n=+n,e=null==e?Ue():+e,r.restart((function u(o){o+=i,r.restart(u,i+=n,e),t(o)}),n,e),r)},We=T("start","end","interrupt"),$e=[],Ge=0,Ze=1,Qe=2,Je=3,Ke=4,tr=5,nr=6,er=function(t,n,e,r,i,u){var o=t.__transition;if(o){if(e in o)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function u(c){var f,s,l,h;if(e.state!==Ze)return a();for(f in i)if((h=i[f]).name===e.name){if(h.state===Je)return Ve(u);h.state===Ke?(h.state=nr,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[f]):+fGe)throw new Error("too late; already scheduled");return e}function ir(t,n){var e=ur(t,n);if(e.state>Qe)throw new Error("too late; already started");return e}function ur(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var or=function(t,n){var e,r,i,u=t.__transition,o=!0;if(u){for(i in n=null==n?null:n+"",u)(e=u[i]).name===n?(r=e.state>Qe&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?rr:ir;return function(){var o=u(this,t),a=o.on;a!==r&&(i=(r=a).copy()).on(n,e),o.on=i}}(e,t,n))},attr:function(t,n){var e=C(t),r="transform"===e?le:cr;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,i,u;return function(){var o,a=e(this);if(null!=a)return(o=this.getAttributeNS(t.space,t.local))===a?null:o===r&&a===i?u:u=n(r=o,i=a);this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,i,u;return function(){var o,a=e(this);if(null!=a)return(o=this.getAttribute(t))===a?null:o===r&&a===i?u:u=n(r=o,i=a);this.removeAttribute(t)}})(e,r,ar(this,"attr."+t,n)):null==n?(e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(e):(e.local?function(t,n,e){var r,i;return function(){var u=this.getAttributeNS(t.space,t.local);return u===e?null:u===r?i:i=n(r=u,e)}}:function(t,n,e){var r,i;return function(){var u=this.getAttribute(t);return u===e?null:u===r?i:i=n(r=u,e)}})(e,r,n+""))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=C(t);return this.tween(e,(r.local?function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}:function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e})(r,n))},style:function(t,n,e){var r="transform"==(t+="")?se:cr;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var u=B(this,t),o=(this.style.removeProperty(t),B(this,t));return u===o?null:u===e&&o===r?i:i=n(e=u,r=o)}}(t,r)).on("end.style."+t,function(t){return function(){this.style.removeProperty(t)}}(t)):this.styleTween(t,"function"==typeof n?function(t,n,e){var r,i,u;return function(){var o=B(this,t),a=e(this);return null==a&&(this.style.removeProperty(t),a=B(this,t)),o===a?null:o===r&&a===i?u:u=n(r=o,i=a)}}(t,r,ar(this,"style."+t,n)):function(t,n,e){var r,i;return function(){var u=B(this,t);return u===e?null:u===r?i:i=n(r=u,e)}}(t,r,n+""),e)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(ar(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",(t=this._id,function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}));var t},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=ur(this.node(),e).tween,u=0,o=i.length;uZe&&e.name===n)return new lr([[t]],ii,n,+r);return null},oi=function(t){return function(){return t}},ai=function(t,n,e){this.target=t,this.type=n,this.selection=e};function ci(){ut.stopImmediatePropagation()}var fi=function(){ut.preventDefault(),ut.stopImmediatePropagation()},si={name:"drag"},li={name:"space"},hi={name:"handle"},di={name:"center"},pi={name:"x",handles:["e","w"].map(wi),input:function(t,n){return t&&[[t[0],n[0][1]],[t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},vi={name:"y",handles:["n","s"].map(wi),input:function(t,n){return t&&[[n[0][0],t[0]],[n[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},gi={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(wi),input:function(t){return t},output:function(t){return t}},yi={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},_i={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},mi={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},xi={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},bi={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function wi(t){return{type:t}}function Mi(){return!ut.button}function Ti(){var t=this.ownerSVGElement||this;return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Si(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function ki(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Ci(t){var n=t.__brush;return n?n.dim.output(n.selection):null}function Ai(){return zi(pi)}function Ni(){return zi(vi)}var Ei=function(){return zi(gi)};function zi(t){var n,e=Ti,r=Mi,i=T(o,"start","brush","end"),u=6;function o(n){var e=n.property("__brush",l).selectAll(".overlay").data([wi("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",yi.overlay).merge(e).each((function(){var t=Si(this).extent;gt(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),n.selectAll(".selection").data([wi("selection")]).enter().append("rect").attr("class","selection").attr("cursor",yi.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=n.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return yi[t.type]})),n.each(a).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",s)}function a(){var t=gt(this),n=Si(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?n[1][0]-u/2:n[0][0]-u/2})).attr("y",(function(t){return"s"===t.type[0]?n[1][1]-u/2:n[0][1]-u/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+u:u})).attr("height",(function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+u:u}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(t,n){return t.__brush.emitter||new f(t,n)}function f(t,n){this.that=t,this.args=n,this.state=t.__brush,this.active=0}function s(){if(ut.touches){if(ut.changedTouches.length0&&(e=i-d),w<0?l=h-p:w>0&&(u=o-p),x=li,L.attr("cursor",yi.selection),D());break;default:return}fi()}),!0).on("keyup.brush",(function(){switch(ut.keyCode){case 16:E&&(g=y=E=!1,D());break;case 18:x===di&&(b<0?f=s:b>0&&(e=i),w<0?l=h:w>0&&(u=o),x=hi,D());break;case 32:x===li&&(ut.altKey?(b&&(f=s-d*b,e=i+d*b),w&&(l=h-p*w,u=o+p*w),x=di):(b<0?f=s:b>0&&(e=i),w<0?l=h:w>0&&(u=o),x=hi),L.attr("cursor",yi[m]),D());break;default:return}fi()}),!0).on("mousemove.brush",U,!0).on("mouseup.brush",F,!0);Nt(ut.view)}ci(),or(_),a.call(_),O.start()}function U(){var t=Mt(_);!E||g||y||(Math.abs(t[0]-P[0])>Math.abs(t[1]-P[1])?y=!0:g=!0),P=t,v=!0,fi(),D()}function D(){var t;switch(d=P[0]-z[0],p=P[1]-z[1],x){case li:case si:b&&(d=Math.max(k-e,Math.min(A-f,d)),i=e+d,s=f+d),w&&(p=Math.max(C-u,Math.min(N-l,p)),o=u+p,h=l+p);break;case hi:b<0?(d=Math.max(k-e,Math.min(A-e,d)),i=e+d,s=f):b>0&&(d=Math.max(k-f,Math.min(A-f,d)),i=e,s=f+d),w<0?(p=Math.max(C-u,Math.min(N-u,p)),o=u+p,h=l):w>0&&(p=Math.max(C-l,Math.min(N-l,p)),o=u,h=l+p);break;case di:b&&(i=Math.max(k,Math.min(A,e-d*b)),s=Math.max(k,Math.min(A,f+d*b))),w&&(o=Math.max(C,Math.min(N,u-p*w)),h=Math.max(C,Math.min(N,l+p*w)))}s=u?c=!0:(r=t.charCodeAt(o++))===Ji?f=!0:r===Ki&&(f=!0,t.charCodeAt(o)===Ji&&++o),t.slice(i+1,n-1).replace(/""/g,'"')}for(;o=(u=(v+y)/2))?v=u:y=u,(s=e>=(o=(g+_)/2))?g=o:_=o,i=d,!(d=d[l=s<<1|f]))return i[l]=p,t;if(a=+t._x.call(null,d.data),c=+t._y.call(null,d.data),n===a&&e===c)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(f=n>=(u=(v+y)/2))?v=u:y=u,(s=e>=(o=(g+_)/2))?g=o:_=o}while((l=s<<1|f)==(h=(c>=o)<<1|a>=u));return i[h]=d,i[l]=p,t}var gu=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i};function yu(t){return t[0]}function _u(t){return t[1]}function mu(t,n,e){var r=new xu(null==n?yu:n,null==e?_u:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function xu(t,n,e,r,i,u){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=u,this._root=void 0}function bu(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var wu=mu.prototype=xu.prototype;function Mu(t){return t.x+t.vx}function Tu(t){return t.y+t.vy}wu.copy=function(){var t,n,e=new xu(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=bu(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=bu(n));return e},wu.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return vu(this.cover(n,e),n,e,t)},wu.addAll=function(t){var n,e,r,i,u=t.length,o=new Array(u),a=new Array(u),c=1/0,f=1/0,s=-1/0,l=-1/0;for(e=0;es&&(s=r),il&&(l=i));for(st||t>i||r>n||n>u))return this;var o,a,c=i-e,f=this._root;switch(a=(n<(r+u)/2)<<1|t<(e+i)/2){case 0:do{(o=new Array(4))[a]=f,f=o}while(u=r+(c*=2),t>(i=e+c)||n>u);break;case 1:do{(o=new Array(4))[a]=f,f=o}while(u=r+(c*=2),(e=i-c)>t||n>u);break;case 2:do{(o=new Array(4))[a]=f,f=o}while(r=u-(c*=2),t>(i=e+c)||r>n);break;case 3:do{(o=new Array(4))[a]=f,f=o}while(r=u-(c*=2),(e=i-c)>t||r>n)}this._root&&this._root.length&&(this._root=f)}return this._x0=e,this._y0=r,this._x1=i,this._y1=u,this},wu.data=function(){var t=[];return this.visit((function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)})),t},wu.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},wu.find=function(t,n,e){var r,i,u,o,a,c,f,s=this._x0,l=this._y0,h=this._x1,d=this._y1,p=[],v=this._root;for(v&&p.push(new gu(v,s,l,h,d)),null==e?e=1/0:(s=t-e,l=n-e,h=t+e,d=n+e,e*=e);c=p.pop();)if(!(!(v=c.node)||(i=c.x0)>h||(u=c.y0)>d||(o=c.x1)=y)<<1|t>=g)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=c)}else{var _=t-+this._x.call(null,v.data),m=n-+this._y.call(null,v.data),x=_*_+m*m;if(x=(a=(p+g)/2))?p=a:g=a,(s=o>=(c=(v+y)/2))?v=c:y=c,n=d,!(d=d[l=s<<1|f]))return this;if(!d.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},wu.removeAll=function(t){for(var n=0,e=t.length;nc+d||if+d||ua.index){var p=c-o.x-o.vx,v=f-o.y-o.vy,g=p*p+v*v;gt.r&&(t.r=t[n].r)}function a(){if(n){var r,i,u=n.length;for(e=new Array(u),r=0;r1?(null==e?a.remove(t):a.set(t,d(e)),n):a.get(t)},find:function(n,e,r){var i,u,o,a,c,f=0,s=t.length;for(null==r?r=1/0:r*=r,f=0;f1?(f.on(t,e),n):f.on(t)}}},Lu=function(){var t,n,e,r,i=du(-30),u=1,o=1/0,a=.81;function c(r){var i,u=t.length,o=mu(t,Nu,Eu).visitAfter(s);for(e=r,i=0;i=o)){(t.data!==n||t.next)&&(0===s&&(d+=(s=pu())*s),0===l&&(d+=(l=pu())*l),d1?r[0]+r.slice(2):r,+t.slice(e+1)]},ju=function(t){return(t=Fu(Math.abs(t)))?t[1]:NaN},Iu=function(t,n){var e=Fu(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Hu={"":function(t,n){t:for(var e,r=(t=t.toPrecision(n)).length,i=1,u=-1;i0&&(u=0)}return u>0?t.slice(0,u)+t.slice(e+1):t},"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return Iu(100*t,n)},r:Iu,s:function(t,n){var e=Fu(t,n);if(!e)return t+"";var r=e[0],i=e[1],u=i-(zu=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return u===o?r:u>o?r+new Array(u-o+1).join("0"):u>0?r.slice(0,u)+"."+r.slice(u):"0."+new Array(1-u).join("0")+Fu(t,Math.max(0,n+u-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},Yu=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function Bu(t){return new Vu(t)}function Vu(t){if(!(n=Yu.exec(t)))throw new Error("invalid format: "+t);var n,e=n[1]||" ",r=n[2]||">",i=n[3]||"-",u=n[4]||"",o=!!n[5],a=n[6]&&+n[6],c=!!n[7],f=n[8]&&+n[8].slice(1),s=n[9]||"";"n"===s?(c=!0,s="g"):Hu[s]||(s=""),(o||"0"===e&&"="===r)&&(o=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=i,this.symbol=u,this.zero=o,this.width=a,this.comma=c,this.precision=f,this.type=s}Bu.prototype=Vu.prototype,Vu.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var Xu,Wu,$u,Gu=function(t){return t},Zu=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],Qu=function(t){var n,e,r=t.grouping&&t.thousands?(n=t.grouping,e=t.thousands,function(t,r){for(var i=t.length,u=[],o=0,a=n[0],c=0;i>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),u.push(t.substring(i-=a,i+a)),!((c+=a+1)>r));)a=n[o=(o+1)%n.length];return u.reverse().join(e)}):Gu,i=t.currency,u=t.decimal,o=t.numerals?function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(t.numerals):Gu,a=t.percent||"%";function c(t){var n=(t=Bu(t)).fill,e=t.align,c=t.sign,f=t.symbol,s=t.zero,l=t.width,h=t.comma,d=t.precision,p=t.type,v="$"===f?i[0]:"#"===f&&/[boxX]/.test(p)?"0"+p.toLowerCase():"",g="$"===f?i[1]:/[%p]/.test(p)?a:"",y=Hu[p],_=!p||/[defgprs%]/.test(p);function m(t){var i,a,f,m=v,x=g;if("c"===p)x=y(t)+x,t="";else{var b=(t=+t)<0;if(t=y(Math.abs(t),d),b&&0==+t&&(b=!1),m=(b?"("===c?c:"-":"-"===c||"("===c?"":c)+m,x=("s"===p?Zu[8+zu/3]:"")+x+(b&&"("===c?")":""),_)for(i=-1,a=t.length;++i(f=t.charCodeAt(i))||f>57){x=(46===f?u+t.slice(i+1):t.slice(i))+x,t=t.slice(0,i);break}}h&&!s&&(t=r(t,1/0));var w=m.length+t.length+x.length,M=w>1)+m+t+x+M.slice(w);break;default:t=M+m+t+x}return o(t)}return d=null==d?p?6:12:/[gprs]/.test(p)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),m.toString=function(){return t+""},m}return{format:c,formatPrefix:function(t,n){var e=c(((t=Bu(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(ju(n)/3))),i=Math.pow(10,-r),u=Zu[8+r/3];return function(t){return e(i*t)+u}}}};function Ju(t){return Xu=Qu(t),Wu=Xu.format,$u=Xu.formatPrefix,Xu}Ju({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var Ku=function(t){return Math.max(0,-ju(Math.abs(t)))},to=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ju(n)/3)))-ju(Math.abs(t)))},no=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,ju(n)-ju(t))+1},eo=function(){return new ro};function ro(){this.reset()}ro.prototype={constructor:ro,reset:function(){this.s=this.t=0},add:function(t){uo(io,t,this.t),uo(this,io.s,this.s),this.s?this.t+=io.t:this.s=io.t},valueOf:function(){return this.s}};var io=new ro;function uo(t,n,e){var r=t.s=n+e,i=r-n,u=r-i;t.t=n-u+(e-i)}var oo=1e-6,ao=Math.PI,co=ao/2,fo=ao/4,so=2*ao,lo=180/ao,ho=ao/180,po=Math.abs,vo=Math.atan,go=Math.atan2,yo=Math.cos,_o=Math.ceil,mo=Math.exp,xo=(Math.floor,Math.log),bo=Math.pow,wo=Math.sin,Mo=Math.sign||function(t){return t>0?1:t<0?-1:0},To=Math.sqrt,So=Math.tan;function ko(t){return t>1?0:t<-1?ao:Math.acos(t)}function Co(t){return t>1?co:t<-1?-co:Math.asin(t)}function Ao(t){return(t=wo(t/2))*t}function No(){}function Eo(t,n){t&&Po.hasOwnProperty(t.type)&&Po[t.type](t,n)}var zo={Feature:function(t,n){Eo(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,u=yo(n=(n*=ho)/2+fo),o=wo(n),a=Fo*o,c=Do*u+a*yo(i),f=a*r*wo(i);Io.add(go(f,c)),Uo=t,Do=u,Fo=o}var $o=function(t){return Ho.reset(),jo(t,Yo),2*Ho};function Go(t){return[go(t[1],t[0]),Co(t[2])]}function Zo(t){var n=t[0],e=t[1],r=yo(e);return[r*yo(n),r*wo(n),wo(e)]}function Qo(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Jo(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Ko(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function ta(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function na(t){var n=To(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var ea,ra,ia,ua,oa,aa,ca,fa,sa,la,ha=eo(),da={point:pa,lineStart:ga,lineEnd:ya,polygonStart:function(){da.point=_a,da.lineStart=ma,da.lineEnd=xa,ha.reset(),Yo.polygonStart()},polygonEnd:function(){Yo.polygonEnd(),da.point=pa,da.lineStart=ga,da.lineEnd=ya,Io<0?(ea=-(ia=180),ra=-(ua=90)):ha>oo?ua=90:ha<-oo&&(ra=-90),la[0]=ea,la[1]=ia}};function pa(t,n){sa.push(la=[ea=t,ia=t]),nua&&(ua=n)}function va(t,n){var e=Zo([t*ho,n*ho]);if(fa){var r=Jo(fa,e),i=Jo([r[1],-r[0],0],r);na(i),i=Go(i);var u,o=t-oa,a=o>0?1:-1,c=i[0]*lo*a,f=po(o)>180;f^(a*oaua&&(ua=u):f^(a*oa<(c=(c+360)%360-180)&&cua&&(ua=n)),f?tba(ea,ia)&&(ia=t):ba(t,ia)>ba(ea,ia)&&(ea=t):ia>=ea?(tia&&(ia=t)):t>oa?ba(ea,t)>ba(ea,ia)&&(ia=t):ba(t,ia)>ba(ea,ia)&&(ea=t)}else sa.push(la=[ea=t,ia=t]);nua&&(ua=n),fa=e,oa=t}function ga(){da.point=va}function ya(){la[0]=ea,la[1]=ia,da.point=pa,fa=null}function _a(t,n){if(fa){var e=t-oa;ha.add(po(e)>180?e+(e>0?360:-360):e)}else aa=t,ca=n;Yo.point(t,n),va(t,n)}function ma(){Yo.lineStart()}function xa(){_a(aa,ca),Yo.lineEnd(),po(ha)>oo&&(ea=-(ia=180)),la[0]=ea,la[1]=ia,fa=null}function ba(t,n){return(n-=t)<0?n+360:n}function wa(t,n){return t[0]-n[0]}function Ma(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nba(r[0],r[1])&&(r[1]=i[1]),ba(i[0],r[1])>ba(r[0],r[1])&&(r[0]=i[0])):u.push(r=i);for(o=-1/0,n=0,r=u[e=u.length-1];n<=e;r=i,++n)i=u[n],(a=ba(r[1],i[0]))>o&&(o=a,ea=i[0],ia=r[1])}return sa=la=null,ea===1/0||ra===1/0?[[NaN,NaN],[NaN,NaN]]:[[ea,ra],[ia,ua]]},Ia={sphere:No,point:Ha,lineStart:Ba,lineEnd:Wa,polygonStart:function(){Ia.lineStart=$a,Ia.lineEnd=Ga},polygonEnd:function(){Ia.lineStart=Ba,Ia.lineEnd=Wa}};function Ha(t,n){t*=ho;var e=yo(n*=ho);Ya(e*yo(t),e*wo(t),wo(n))}function Ya(t,n,e){ka+=(t-ka)/++Ta,Ca+=(n-Ca)/Ta,Aa+=(e-Aa)/Ta}function Ba(){Ia.point=Va}function Va(t,n){t*=ho;var e=yo(n*=ho);Ua=e*yo(t),Da=e*wo(t),Fa=wo(n),Ia.point=Xa,Ya(Ua,Da,Fa)}function Xa(t,n){t*=ho;var e=yo(n*=ho),r=e*yo(t),i=e*wo(t),u=wo(n),o=go(To((o=Da*u-Fa*i)*o+(o=Fa*r-Ua*u)*o+(o=Ua*i-Da*r)*o),Ua*r+Da*i+Fa*u);Sa+=o,Na+=o*(Ua+(Ua=r)),Ea+=o*(Da+(Da=i)),za+=o*(Fa+(Fa=u)),Ya(Ua,Da,Fa)}function Wa(){Ia.point=Ha}function $a(){Ia.point=Za}function Ga(){Qa(La,qa),Ia.point=Ha}function Za(t,n){La=t,qa=n,t*=ho,n*=ho,Ia.point=Qa;var e=yo(n);Ua=e*yo(t),Da=e*wo(t),Fa=wo(n),Ya(Ua,Da,Fa)}function Qa(t,n){t*=ho;var e=yo(n*=ho),r=e*yo(t),i=e*wo(t),u=wo(n),o=Da*u-Fa*i,a=Fa*r-Ua*u,c=Ua*i-Da*r,f=To(o*o+a*a+c*c),s=Co(f),l=f&&-s/f;Pa+=l*o,Oa+=l*a,Ra+=l*c,Sa+=s,Na+=s*(Ua+(Ua=r)),Ea+=s*(Da+(Da=i)),za+=s*(Fa+(Fa=u)),Ya(Ua,Da,Fa)}var Ja=function(t){Ta=Sa=ka=Ca=Aa=Na=Ea=za=Pa=Oa=Ra=0,jo(t,Ia);var n=Pa,e=Oa,r=Ra,i=n*n+e*e+r*r;return i<1e-12&&(n=Na,e=Ea,r=za,Saao?t-so:t<-ao?t+so:t,n]}function ec(t,n,e){return(t%=so)?n||e?tc(ic(t),uc(n,e)):ic(t):n||e?uc(n,e):nc}function rc(t){return function(n,e){return[(n+=t)>ao?n-so:n<-ao?n+so:n,e]}}function ic(t){var n=rc(t);return n.invert=rc(-t),n}function uc(t,n){var e=yo(t),r=wo(t),i=yo(n),u=wo(n);function o(t,n){var o=yo(n),a=yo(t)*o,c=wo(t)*o,f=wo(n),s=f*e+a*r;return[go(c*i-s*u,a*e-f*r),Co(s*i+c*u)]}return o.invert=function(t,n){var o=yo(n),a=yo(t)*o,c=wo(t)*o,f=wo(n),s=f*i-c*u;return[go(c*i+f*u,a*e+s*r),Co(s*e-a*r)]},o}nc.invert=nc;var oc=function(t){function n(n){return(n=t(n[0]*ho,n[1]*ho))[0]*=lo,n[1]*=lo,n}return t=ec(t[0]*ho,t[1]*ho,t.length>2?t[2]*ho:0),n.invert=function(n){return(n=t.invert(n[0]*ho,n[1]*ho))[0]*=lo,n[1]*=lo,n},n};function ac(t,n,e,r,i,u){if(e){var o=yo(n),a=wo(n),c=r*e;null==i?(i=n+r*so,u=n-c/2):(i=cc(o,i),u=cc(o,u),(r>0?iu)&&(i+=r*so));for(var f,s=i;r>0?s>u:s1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}},lc=function(t,n){return po(t[0]-n[0])=0;--u)i.point((s=f[u])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}f=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}};function pc(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r=0?1:-1,T=M*w,S=T>ao,k=p*x;if(vc.add(go(k*M*wo(T),v*b+k*yo(T))),u+=S?w+M*so:w,S^h>=e^_>=e){var C=Jo(Zo(l),Zo(y));na(C);var A=Jo(i,C);na(A);var N=(S^w>=0?-1:1)*Co(A[2]);(r>N||r===N&&(C[0]||C[1]))&&(o+=S^w>=0?1:-1)}}return(u<-oo||u0){for(h||(u.polygonStart(),h=!0),u.lineStart(),t=0;t1&&2&i&&f.push(f.pop().concat(f.shift())),a.push(f.filter(_c))}return d}};function _c(t){return t.length>1}function mc(t,n){return((t=t.x)[0]<0?t[1]-co-oo:co-t[1])-((n=n.x)[0]<0?n[1]-co-oo:co-n[1])}var xc=yc((function(){return!0}),(function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(u,o){var a=u>0?ao:-ao,c=po(u-e);po(c-ao)0?co:-co),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(u,r),n=0):i!==a&&c>=ao&&(po(e-i)oo?vo((wo(n)*(u=yo(r))*wo(e)-wo(r)*(i=yo(n))*wo(t))/(i*u*o)):(n+r)/2}(e,r,u,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),n=0),t.point(e=u,r=o),i=a},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}),(function(t,n,e,r){var i;if(null==t)i=e*co,r.point(-ao,i),r.point(0,i),r.point(ao,i),r.point(ao,0),r.point(ao,-i),r.point(0,-i),r.point(-ao,-i),r.point(-ao,0),r.point(-ao,i);else if(po(t[0]-n[0])>oo){var u=t[0]0,i=po(n)>oo;function u(t,e){return yo(t)*yo(e)>n}function o(t,e,r){var i=[1,0,0],u=Jo(Zo(t),Zo(e)),o=Qo(u,u),a=u[0],c=o-a*a;if(!c)return!r&&t;var f=n*o/c,s=-n*a/c,l=Jo(i,u),h=ta(i,f);Ko(h,ta(u,s));var d=l,p=Qo(h,d),v=Qo(d,d),g=p*p-v*(Qo(h,h)-1);if(!(g<0)){var y=To(g),_=ta(d,(-p-y)/v);if(Ko(_,h),_=Go(_),!r)return _;var m,x=t[0],b=e[0],w=t[1],M=e[1];b0^_[1]<(po(_[0]-x)ao^(x<=_[0]&&_[0]<=b)){var k=ta(d,(-p+y)/v);return Ko(k,h),[_,Go(k)]}}}function a(n,e){var i=r?t:ao-t,u=0;return n<-i?u|=1:n>i&&(u|=2),e<-i?u|=4:e>i&&(u|=8),u}return yc(u,(function(t){var n,e,c,f,s;return{lineStart:function(){f=c=!1,s=1},point:function(l,h){var d,p=[l,h],v=u(l,h),g=r?v?0:a(l,h):v?a(l+(l<0?ao:-ao),h):0;if(!n&&(f=c=v)&&t.lineStart(),v!==c&&(!(d=o(n,p))||lc(n,d)||lc(p,d))&&(p[0]+=oo,p[1]+=oo,v=u(p[0],p[1])),v!==c)s=0,v?(t.lineStart(),d=o(p,n),t.point(d[0],d[1])):(d=o(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(i&&n&&r^v){var y;g&e||!(y=o(p,n,!0))||(s=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!v||n&&lc(n,p)||t.point(p[0],p[1]),n=p,c=v,e=g},lineEnd:function(){c&&t.lineEnd(),n=null},clean:function(){return s|(f&&c)<<1}}}),(function(n,r,i,u){ac(u,t,e,i,n,r)}),r?[0,-t]:[-ao,t-ao])},wc=function(t,n,e,r,i,u){var o,a=t[0],c=t[1],f=0,s=1,l=n[0]-a,h=n[1]-c;if(o=e-a,l||!(o>0)){if(o/=l,l<0){if(o0){if(o>s)return;o>f&&(f=o)}if(o=i-a,l||!(o<0)){if(o/=l,l<0){if(o>s)return;o>f&&(f=o)}else if(l>0){if(o0)){if(o/=h,h<0){if(o0){if(o>s)return;o>f&&(f=o)}if(o=u-c,h||!(o<0)){if(o/=h,h<0){if(o>s)return;o>f&&(f=o)}else if(h>0){if(o0&&(t[0]=a+f*l,t[1]=c+f*h),s<1&&(n[0]=a+s*l,n[1]=c+s*h),!0}}}}},Mc=1e9,Tc=-Mc;function Sc(t,n,e,i){function u(r,u){return t<=r&&r<=e&&n<=u&&u<=i}function o(r,u,o,c){var s=0,l=0;if(null==r||(s=a(r,o))!==(l=a(u,o))||f(r,u)<0^o>0)do{c.point(0===s||3===s?t:e,s>1?i:n)}while((s=(s+o+4)%4)!==l);else c.point(u[0],u[1])}function a(r,i){return po(r[0]-t)0?0:3:po(r[0]-e)0?2:1:po(r[1]-n)0?1:0:i>0?3:2}function c(t,n){return f(t.x,n.x)}function f(t,n){var e=a(t,1),r=a(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(a){var f,s,l,h,d,p,v,g,y,_,m,x=a,b=sc(),w={point:M,lineStart:function(){w.point=T,s&&s.push(l=[]),_=!0,y=!1,v=g=NaN},lineEnd:function(){f&&(T(h,d),p&&y&&b.rejoin(),f.push(b.result())),w.point=M,y&&x.lineEnd()},polygonStart:function(){x=b,f=[],s=[],m=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,r=s.length;ei&&(h-u)*(i-o)>(d-o)*(t-u)&&++n:d<=i&&(h-u)*(i-o)<(d-o)*(t-u)&&--n;return n}(),e=m&&n,u=(f=Object(r.n)(f)).length;(e||u)&&(a.polygonStart(),e&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),u&&dc(f,c,n,o,a),a.polygonEnd()),x=a,f=s=l=null}};function M(t,n){u(t,n)&&x.point(t,n)}function T(r,o){var a=u(r,o);if(s&&l.push([r,o]),_)h=r,d=o,p=a,_=!1,a&&(x.lineStart(),x.point(r,o));else if(a&&y)x.point(r,o);else{var c=[v=Math.max(Tc,Math.min(Mc,v)),g=Math.max(Tc,Math.min(Mc,g))],f=[r=Math.max(Tc,Math.min(Mc,r)),o=Math.max(Tc,Math.min(Mc,o))];wc(c,f,t,n,e,i)?(y||(x.lineStart(),x.point(c[0],c[1])),x.point(f[0],f[1]),a||x.lineEnd(),m=!1):a&&(x.lineStart(),x.point(r,o),m=!1)}v=r,g=o,y=a}return w}}var kc,Cc,Ac,Nc=function(){var t,n,e,r=0,i=0,u=960,o=500;return e={stream:function(e){return t&&n===e?t:t=Sc(r,i,u,o)(n=e)},extent:function(a){return arguments.length?(r=+a[0][0],i=+a[0][1],u=+a[1][0],o=+a[1][1],t=n=null,e):[[r,i],[u,o]]}}},Ec=eo(),zc={sphere:No,point:No,lineStart:function(){zc.point=Oc,zc.lineEnd=Pc},lineEnd:No,polygonStart:No,polygonEnd:No};function Pc(){zc.point=zc.lineEnd=No}function Oc(t,n){kc=t*=ho,Cc=wo(n*=ho),Ac=yo(n),zc.point=Rc}function Rc(t,n){t*=ho;var e=wo(n*=ho),r=yo(n),i=po(t-kc),u=yo(i),o=r*wo(i),a=Ac*e-Cc*r*u,c=Cc*e+Ac*r*u;Ec.add(go(To(o*o+a*a),c)),kc=t,Cc=e,Ac=r}var Lc=function(t){return Ec.reset(),jo(t,zc),+Ec},qc=[null,null],Uc={type:"LineString",coordinates:qc},Dc=function(t,n){return qc[0]=t,qc[1]=n,Lc(Uc)},Fc={Feature:function(t,n){return Ic(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++roo})).map(f)).concat(Object(r.s)(_o(o/p)*p,u,p).filter((function(t){return po(t%g)>oo})).map(s))}return _.lines=function(){return m().map((function(t){return{type:"LineString",coordinates:t}}))},_.outline=function(){return{type:"Polygon",coordinates:[l(i).concat(h(a).slice(1),l(e).reverse().slice(1),h(c).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.extentMajor(t).extentMinor(t):_.extentMinor()},_.extentMajor=function(t){return arguments.length?(i=+t[0][0],e=+t[1][0],c=+t[0][1],a=+t[1][1],i>e&&(t=i,i=e,e=t),c>a&&(t=c,c=a,a=t),_.precision(y)):[[i,c],[e,a]]},_.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],u=+e[1][1],n>t&&(e=n,n=t,t=e),o>u&&(e=o,o=u,u=e),_.precision(y)):[[n,o],[t,u]]},_.step=function(t){return arguments.length?_.stepMajor(t).stepMinor(t):_.stepMinor()},_.stepMajor=function(t){return arguments.length?(v=+t[0],g=+t[1],_):[v,g]},_.stepMinor=function(t){return arguments.length?(d=+t[0],p=+t[1],_):[d,p]},_.precision=function(r){return arguments.length?(y=+r,f=$c(o,u,90),s=Gc(n,t,y),l=$c(c,a,90),h=Gc(i,e,y),_):y},_.extentMajor([[-180,-90+oo],[180,90-oo]]).extentMinor([[-180,-80-oo],[180,80+oo]])}function Qc(){return Zc()()}var Jc,Kc,tf,nf,ef=function(t,n){var e=t[0]*ho,r=t[1]*ho,i=n[0]*ho,u=n[1]*ho,o=yo(r),a=wo(r),c=yo(u),f=wo(u),s=o*yo(e),l=o*wo(e),h=c*yo(i),d=c*wo(i),p=2*Co(To(Ao(u-r)+o*c*Ao(i-e))),v=wo(p),g=p?function(t){var n=wo(t*=p)/v,e=wo(p-t)/v,r=e*s+n*h,i=e*l+n*d,u=e*a+n*f;return[go(i,r)*lo,go(u,To(r*r+i*i))*lo]}:function(){return[e*lo,r*lo]};return g.distance=p,g},rf=function(t){return t},uf=eo(),of=eo(),af={point:No,lineStart:No,lineEnd:No,polygonStart:function(){af.lineStart=cf,af.lineEnd=lf},polygonEnd:function(){af.lineStart=af.lineEnd=af.point=No,uf.add(po(of)),of.reset()},result:function(){var t=uf/2;return uf.reset(),t}};function cf(){af.point=ff}function ff(t,n){af.point=sf,Jc=tf=t,Kc=nf=n}function sf(t,n){of.add(nf*t-tf*n),tf=t,nf=n}function lf(){sf(Jc,Kc)}var hf,df,pf,vf,gf=af,yf=1/0,_f=yf,mf=-yf,xf=mf,bf={point:function(t,n){tmf&&(mf=t),n<_f&&(_f=n),n>xf&&(xf=n)},lineStart:No,lineEnd:No,polygonStart:No,polygonEnd:No,result:function(){var t=[[yf,_f],[mf,xf]];return mf=xf=-(_f=yf=1/0),t}},wf=0,Mf=0,Tf=0,Sf=0,kf=0,Cf=0,Af=0,Nf=0,Ef=0,zf={point:Pf,lineStart:Of,lineEnd:qf,polygonStart:function(){zf.lineStart=Uf,zf.lineEnd=Df},polygonEnd:function(){zf.point=Pf,zf.lineStart=Of,zf.lineEnd=qf},result:function(){var t=Ef?[Af/Ef,Nf/Ef]:Cf?[Sf/Cf,kf/Cf]:Tf?[wf/Tf,Mf/Tf]:[NaN,NaN];return wf=Mf=Tf=Sf=kf=Cf=Af=Nf=Ef=0,t}};function Pf(t,n){wf+=t,Mf+=n,++Tf}function Of(){zf.point=Rf}function Rf(t,n){zf.point=Lf,Pf(pf=t,vf=n)}function Lf(t,n){var e=t-pf,r=n-vf,i=To(e*e+r*r);Sf+=i*(pf+t)/2,kf+=i*(vf+n)/2,Cf+=i,Pf(pf=t,vf=n)}function qf(){zf.point=Pf}function Uf(){zf.point=Ff}function Df(){jf(hf,df)}function Ff(t,n){zf.point=jf,Pf(hf=pf=t,df=vf=n)}function jf(t,n){var e=t-pf,r=n-vf,i=To(e*e+r*r);Sf+=i*(pf+t)/2,kf+=i*(vf+n)/2,Cf+=i,Af+=(i=vf*t-pf*n)*(pf+t),Nf+=i*(vf+n),Ef+=3*i,Pf(pf=t,vf=n)}var If=zf;function Hf(t){this._context=t}Hf.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,so)}},result:No};var Yf,Bf,Vf,Xf,Wf,$f=eo(),Gf={point:No,lineStart:function(){Gf.point=Zf},lineEnd:function(){Yf&&Qf(Bf,Vf),Gf.point=No},polygonStart:function(){Yf=!0},polygonEnd:function(){Yf=null},result:function(){var t=+$f;return $f.reset(),t}};function Zf(t,n){Gf.point=Qf,Bf=Xf=t,Vf=Wf=n}function Qf(t,n){Xf-=t,Wf-=n,$f.add(To(Xf*Xf+Wf*Wf)),Xf=t,Wf=n}var Jf=Gf;function Kf(){this._string=[]}function ts(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}Kf.prototype={_radius:4.5,_circle:ts(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=ts(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var ns=function(t,n){var e,r,i=4.5;function u(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),jo(t,e(r))),r.result()}return u.area=function(t){return jo(t,e(gf)),gf.result()},u.measure=function(t){return jo(t,e(Jf)),Jf.result()},u.bounds=function(t){return jo(t,e(bf)),bf.result()},u.centroid=function(t){return jo(t,e(If)),If.result()},u.projection=function(n){return arguments.length?(e=null==n?(t=null,rf):(t=n).stream,u):t},u.context=function(t){return arguments.length?(r=null==t?(n=null,new Kf):new Hf(n=t),"function"!=typeof i&&r.pointRadius(i),u):n},u.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),u):i},u.projection(t).context(n)},es=function(t){return{stream:rs(t)}};function rs(t){return function(n){var e=new is;for(var r in t)e[r]=t[r];return e.stream=n,e}}function is(){}function us(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),jo(e,t.stream(bf)),n(bf.result()),null!=r&&t.clipExtent(r),t}function os(t,n,e){return us(t,(function(e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],u=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),o=+n[0][0]+(r-u*(e[1][0]+e[0][0]))/2,a=+n[0][1]+(i-u*(e[1][1]+e[0][1]))/2;t.scale(150*u).translate([o,a])}),e)}function as(t,n,e){return os(t,[[0,0],n],e)}function cs(t,n,e){return us(t,(function(e){var r=+n,i=r/(e[1][0]-e[0][0]),u=(r-i*(e[1][0]+e[0][0]))/2,o=-i*e[0][1];t.scale(150*i).translate([u,o])}),e)}function fs(t,n,e){return us(t,(function(e){var r=+n,i=r/(e[1][1]-e[0][1]),u=-i*e[0][0],o=(r-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([u,o])}),e)}is.prototype={constructor:is,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var ss=16,ls=yo(30*ho),hs=function(t,n){return+n?function(t,n){function e(r,i,u,o,a,c,f,s,l,h,d,p,v,g){var y=f-r,_=s-i,m=y*y+_*_;if(m>4*n&&v--){var x=o+h,b=a+d,w=c+p,M=To(x*x+b*b+w*w),T=Co(w/=M),S=po(po(w)-1)n||po((y*N+_*E)/m-.5)>.3||o*h+a*d+c*p2?t[2]%360*ho:0,A()):[g*lo,y*lo,_*lo]},S.precision=function(t){return arguments.length?(T=hs(C,M=t*t),N()):To(M)},S.fitExtent=function(t,n){return os(S,t,n)},S.fitSize=function(t,n){return as(S,t,n)},S.fitWidth=function(t,n){return cs(S,t,n)},S.fitHeight=function(t,n){return fs(S,t,n)},function(){return n=t.apply(this,arguments),S.invert=n.invert&&k,A()}}function gs(t){var n=0,e=ao/3,r=vs(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*ho,e=t[1]*ho):[n*lo,e*lo]},i}function ys(t,n){var e=wo(t),r=(e+wo(n))/2;if(po(r)=.12&&i<.234&&r>=-.425&&r<-.214?a:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:o).invert(t)},s.stream=function(e){return t&&n===e?t:(r=[o.stream(n=e),a.stream(e),c.stream(e)],i=r.length,t={point:function(t,n){for(var e=-1;++e0?n<-co+oo&&(n=-co+oo):n>co-oo&&(n=co-oo);var e=i/bo(Es(n),r);return[e*wo(r*t),i-e*yo(r*t)]}return u.invert=function(t,n){var e=i-n,u=Mo(r)*To(t*t+e*e);return[go(t,po(e))/r*Mo(e),2*vo(bo(i/u,1/r))-co]},u}var Ps=function(){return gs(zs).scale(109.5).parallels([30,30])};function Os(t,n){return[t,n]}Os.invert=Os;var Rs=function(){return ps(Os).scale(152.63)};function Ls(t,n){var e=yo(t),r=t===n?wo(t):(e-yo(n))/(n-t),i=e/r+t;if(po(r)oo&&--i>0);return[t/(.8707+(u=r*r)*(u*(u*u*u*(.003971-.001529*u)-.013791)-.131979)),r]};var Hs=function(){return ps(Is).scale(175.295)};function Ys(t,n){return[yo(n)*wo(t),wo(n)]}Ys.invert=ws(Co);var Bs=function(){return ps(Ys).scale(249.5).clipAngle(90+oo)};function Vs(t,n){var e=yo(n),r=1+yo(t)*e;return[e*wo(t)/r,wo(n)/r]}Vs.invert=ws((function(t){return 2*vo(t)}));var Xs=function(){return ps(Vs).scale(250).clipAngle(142)};function Ws(t,n){return[xo(So((co+n)/2)),-t]}Ws.invert=function(t,n){return[-n,2*vo(mo(t))-co]};var $s=function(){var t=Ns(Ws),n=t.center,e=t.rotate;return t.center=function(t){return arguments.length?n([-t[1],t[0]]):[(t=n())[1],-t[0]]},t.rotate=function(t){return arguments.length?e([t[0],t[1],t.length>2?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)};function Gs(t,n){return t.parent===n.parent?1:2}function Zs(t,n){return t+n.x}function Qs(t,n){return Math.max(t,n.y)}var Js=function(){var t=Gs,n=1,e=1,r=!1;function i(i){var u,o=0;i.eachAfter((function(n){var e=n.children;e?(n.x=function(t){return t.reduce(Zs,0)/t.length}(e),n.y=function(t){return 1+t.reduce(Qs,0)}(e)):(n.x=u?o+=t(n,u):0,n.y=0,u=n)}));var a=function(t){for(var n;n=t.children;)t=n[0];return t}(i),c=function(t){for(var n;n=t.children;)t=n[n.length-1];return t}(i),f=a.x-t(a,c)/2,s=c.x+t(c,a)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*n,t.y=(i.y-t.y)*e}:function(t){t.x=(t.x-f)/(s-f)*n,t.y=(1-(i.y?t.y/i.y:1))*e})}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i};function Ks(t){var n=0,e=t.children,r=e&&e.length;if(r)for(;--r>=0;)n+=e[r].value;else n=1;t.value=n}function tl(t,n){var e,r,i,u,o,a=new il(t),c=+t.value&&(a.value=t.value),f=[a];for(null==n&&(n=nl);e=f.pop();)if(c&&(e.value=+e.data.value),(i=n(e.data))&&(o=i.length))for(e.children=new Array(o),u=o-1;u>=0;--u)f.push(r=e.children[u]=new il(i[u])),r.parent=e,r.depth=e.depth+1;return a.eachBefore(rl)}function nl(t){return t.children}function el(t){t.data=t.data.data}function rl(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function il(t){this.data=t,this.depth=this.height=0,this.parent=null}il.prototype=tl.prototype={constructor:il,count:function(){return this.eachAfter(Ks)},each:function(t){var n,e,r,i,u=this,o=[u];do{for(n=o.reverse(),o=[];u=n.pop();)if(t(u),e=u.children)for(r=0,i=e.length;r=0;--e)i.push(n[e]);return this},sum:function(t){return this.eachAfter((function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e}))},sort:function(t){return this.eachBefore((function(n){n.children&&n.children.sort(t)}))},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){var t=[];return this.each((function(n){t.push(n)})),t},leaves:function(){var t=[];return this.eachBefore((function(n){n.children||t.push(n)})),t},links:function(){var t=this,n=[];return t.each((function(e){e!==t&&n.push({source:e.parent,target:e})})),n},copy:function(){return tl(this).eachBefore(el)}};var ul=Array.prototype.slice,ol=function(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(ul.call(t))).length,u=[];r0&&e*e>r*r+i*i}function sl(t,n){for(var e=0;ee*e+r*r}function gl(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,u=(n.y*e.r+e.y*n.r)/r;return i*i+u*u}function yl(t){this._=t,this.next=null,this.previous=null}function _l(t){if(!(i=t.length))return 0;var n,e,r,i,u,o,a,c,f,s,l;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;pl(e,n,r=t[2]),n=new yl(n),e=new yl(e),r=new yl(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(a=3;a0)throw new Error("cycle");return u}return e.id=function(n){return arguments.length?(t=xl(n),e):t},e.parentId=function(t){return arguments.length?(n=xl(t),e):n},e};function Ul(t,n){return t.parent===n.parent?1:2}function Dl(t){var n=t.children;return n?n[0]:t.t}function Fl(t){var n=t.children;return n?n[n.length-1]:t.t}function jl(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function Il(t,n,e){return t.a.parent===n.parent?t.a:e}function Hl(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}Hl.prototype=Object.create(il.prototype);var Yl=function(){var t=Ul,n=1,e=1,r=null;function i(i){var c=function(t){for(var n,e,r,i,u,o=new Hl(t,0),a=[o];n=a.pop();)if(r=n._.children)for(n.children=new Array(u=r.length),i=u-1;i>=0;--i)a.push(e=n.children[i]=new Hl(r[i],i)),e.parent=n;return(o.parent=new Hl(null,0)).children=[o],o}(i);if(c.eachAfter(u),c.parent.m=-c.z,c.eachBefore(o),r)i.eachBefore(a);else{var f=i,s=i,l=i;i.eachBefore((function(t){t.xs.x&&(s=t),t.depth>l.depth&&(l=t)}));var h=f===s?1:t(f,s)/2,d=h-f.x,p=n/(s.x+h+d),v=e/(l.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*v}))}return i}function u(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,u=i.length;--u>=0;)(n=i[u]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var u=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-u):n.z=u}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,u=n,o=n,a=e,c=u.parent.children[0],f=u.m,s=o.m,l=a.m,h=c.m;a=Fl(a),u=Dl(u),a&&u;)c=Dl(c),(o=Fl(o)).a=n,(i=a.z+l-u.z-f+t(a._,u._))>0&&(jl(Il(a,n,r),n,i),f+=i,s+=i),l+=a.m,f+=u.m,h+=c.m,s+=o.m;a&&!Fl(o)&&(o.t=a,o.m+=l-s),u&&!Dl(c)&&(c.t=u,c.m+=f-h,r=n)}return r}(n,i,n.parent.A||r[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function a(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},Bl=function(t,n,e,r,i){for(var u,o=t.children,a=-1,c=o.length,f=t.value&&(i-e)/t.value;++ah&&(h=a),g=s*s*v,(d=Math.max(h/g,g/l))>p){s-=a;break}p=d}y.push(o={value:s,dice:c1?n:1)},e}(Vl),$l=function(){var t=Wl,n=!1,e=1,r=1,i=[0],u=bl,o=bl,a=bl,c=bl,f=bl;function s(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(l),i=[0],n&&t.eachBefore(Al),t}function l(n){var e=i[n.depth],r=n.x0+e,s=n.y0+e,l=n.x1-e,h=n.y1-e;l=e-1){var s=a[n];return s.x0=i,s.y0=u,s.x1=o,void(s.y1=c)}for(var l=f[n],h=r/2+l,d=n+1,p=e-1;d>>1;f[v]c-u){var _=(i*y+o*g)/r;t(n,d,g,i,u,_,c),t(d,e,y,_,u,o,c)}else{var m=(u*y+c*g)/r;t(n,d,g,i,u,o,m),t(d,e,y,i,m,o,c)}}(0,c,t.value,n,e,r,i)},Zl=function(t,n,e,r,i){(1&t.depth?Bl:Nl)(t,n,e,r,i)},Ql=function t(n){function e(t,e,r,i,u){if((o=t._squarify)&&o.ratio===n)for(var o,a,c,f,s,l=-1,h=o.length,d=t.value;++l1?n:1)},e}(Vl),Jl=function(t){for(var n,e=-1,r=t.length,i=t[r-1],u=0;++e1&&th(t[e[r-2]],t[e[r-1]],t[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}var rh=function(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n=0;--n)f.push(t[r[u[n]][2]]);for(n=+a;na!=f>a&&o<(c-e)*(a-r)/(f-r)+e&&(s=!s),c=e,f=r;return s},uh=function(t){for(var n,e,r=-1,i=t.length,u=t[i-1],o=u[0],a=u[1],c=0;++r=0;)if((e=t._tasks[r])&&(t._tasks[r]=null,e.abort))try{e.abort()}catch(n){}t._active=NaN,hh(t)}function hh(t){if(!t._active&&t._call){var n=t._data;t._data=void 0,t._call(t._error,n)}}function dh(t){if(null==t)t=1/0;else if(!((t=+t)>=1))throw new Error("invalid concurrency");return new ch(t)}ch.prototype=dh.prototype={constructor:ch,defer:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("defer after await");if(null!=this._error)return this;var n=oh.call(arguments,1);return n.push(t),++this._waiting,this._tasks.push(n),fh(this),this},abort:function(){return null==this._error&&lh(this,new Error("abort")),this},await:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=function(n,e){t.apply(null,[n].concat(e))},hh(this),this},awaitAll:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=t,hh(this),this}};var ph=function(){return Math.random()},vh=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(ph),gh=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var u;if(null!=r)u=r,r=null;else do{r=2*n()-1,u=2*n()-1,i=r*r+u*u}while(!i||i>1);return t+e*u*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(ph),yh=function t(n){function e(){var t=gh.source(n).apply(this,arguments);return function(){return Math.exp(t())}}return e.source=t,e}(ph),_h=function t(n){function e(t){return function(){for(var e=0,r=0;r=200&&r<300||304===r){if(i)try{n=i.call(e,c)}catch(t){return void o.call("error",e,t)}else n=c;o.call("load",e,n)}else o.call("error",e,t)}if("undefined"==typeof XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(t)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=c.ontimeout=h:c.onreadystatechange=function(t){c.readyState>3&&h(t)},c.onprogress=function(t){o.call("progress",e,t)},e={header:function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?a.get(t):(null==n?a.remove(t):a.set(t,n+""),e)},mimeType:function(t){return arguments.length?(r=null==t?null:t+"",e):r},responseType:function(t){return arguments.length?(u=t,e):u},timeout:function(t){return arguments.length?(l=+t,e):l},user:function(t){return arguments.length<1?f:(f=null==t?null:t+"",e)},password:function(t){return arguments.length<1?s:(s=null==t?null:t+"",e)},response:function(t){return i=t,e},get:function(t,n){return e.send("GET",t,n)},post:function(t,n){return e.send("POST",t,n)},send:function(n,i,h){return c.open(n,t,!0,f,s),null==r||a.has("accept")||a.set("accept",r+",*/*"),c.setRequestHeader&&a.each((function(t,n){c.setRequestHeader(n,t)})),null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),l>0&&(c.timeout=l),null==h&&"function"==typeof i&&(h=i,i=null),null!=h&&1===h.length&&(h=function(t){return function(n,e){t(null==n?e:null)}}(h)),null!=h&&e.on("error",h).on("load",(function(t){h(null,t)})),o.call("beforesend",e,c),c.send(null==i?null:i),e},abort:function(){return c.abort(),e},on:function(){var t=o.on.apply(o,arguments);return t===o?e:t}},null!=n){if("function"!=typeof n)throw new Error("invalid callback: "+n);return e.get(n)}return e},wh=function(t,n){return function(e,r){var i=bh(e).mimeType(t).response(n);if(null!=r){if("function"!=typeof r)throw new Error("invalid callback: "+r);return i.get(r)}return i}},Mh=wh("text/html",(function(t){return document.createRange().createContextualFragment(t.responseText)})),Th=wh("application/json",(function(t){return JSON.parse(t.responseText)})),Sh=wh("text/plain",(function(t){return t.responseText})),kh=wh("application/xml",(function(t){var n=t.responseXML;if(!n)throw new Error("parse error");return n})),Ch=function(t,n){return function(e,r,i){arguments.length<3&&(i=r,r=null);var u=bh(e).mimeType(t);return u.row=function(t){return arguments.length?u.response(function(t,n){return function(e){return t(e.responseText,n)}}(n,r=t)):r},u.row(r),i?u.get(i):u}},Ah=Ch("text/csv",ru),Nh=Ch("text/tab-separated-values",cu),Eh=Array.prototype,zh=Eh.map,Ph=Eh.slice,Oh={name:"implicit"};function Rh(t){var n=Object($i.c)(),e=[],r=Oh;function i(i){var u=i+"",o=n.get(u);if(!o){if(r!==Oh)return r;n.set(u,o=e.push(i))}return t[(o-1)%t.length]}return t=null==t?[]:Ph.call(t),i.domain=function(t){if(!arguments.length)return e.slice();e=[],n=Object($i.c)();for(var r,u,o=-1,a=t.length;++o2?Hh:Ih,r=i=null,s}function s(n){return(r||(r=e(u,o,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=n?0:t>=e?1:r(t)}}}(t):t,a)))(+n)}return s.invert=function(t){return(i||(i=e(o,u,jh,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}(n):n)))(+t)},s.domain=function(t){return arguments.length?(u=zh.call(t,Dh),f()):u.slice()},s.range=function(t){return arguments.length?(o=Ph.call(t),f()):o.slice()},s.rangeRound=function(t){return o=Ph.call(t),a=ue,f()},s.clamp=function(t){return arguments.length?(c=!!t,f()):c},s.interpolate=function(t){return arguments.length?(a=t,f()):a},f()}var Vh=function(t,n,e){var i,u=t[0],o=t[t.length-1],a=Object(r.A)(u,o,null==n?10:n);switch((e=Bu(null==e?",f":e)).type){case"s":var c=Math.max(Math.abs(u),Math.abs(o));return null!=e.precision||isNaN(i=to(a,c))||(e.precision=i),$u(e,c);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(i=no(a,Math.max(Math.abs(u),Math.abs(o))))||(e.precision=i-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(i=Ku(a))||(e.precision=i-2*("%"===e.type))}return Wu(e)};function Xh(t){var n=t.domain;return t.ticks=function(t){var e=n();return Object(r.B)(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return Vh(n(),t,e)},t.nice=function(e){null==e&&(e=10);var i,u=n(),o=0,a=u.length-1,c=u[o],f=u[a];return f0?(c=Math.floor(c/i)*i,f=Math.ceil(f/i)*i,i=Object(r.z)(c,f,e)):i<0&&(c=Math.ceil(c*i)/i,f=Math.floor(f*i)/i,i=Object(r.z)(c,f,e)),i>0?(u[o]=Math.floor(c/i)*i,u[a]=Math.ceil(f/i)*i,n(u)):i<0&&(u[o]=Math.ceil(c*i)/i,u[a]=Math.floor(f*i)/i,n(u)),t},t}function Wh(){var t=Bh(jh,Kn);return t.copy=function(){return Yh(t,Wh())},Xh(t)}function $h(){var t=[0,1];function n(t){return+t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=zh.call(e,Dh),n):t.slice()},n.copy=function(){return $h().domain(t)},Xh(n)}var Gh=function(t,n){var e,r=0,i=(t=t.slice()).length-1,u=t[r],o=t[i];return o0){for(;df)break;g.push(h)}}else for(;d=1;--l)if(!((h=s*l)f)break;g.push(h)}}else g=Object(r.B)(d,p,Math.min(p-d,v)).map(u);return o?g.reverse():g},t.tickFormat=function(n,r){if(null==r&&(r=10===e?".0e":","),"function"!=typeof r&&(r=Wu(r)),n===1/0)return r;null==n&&(n=10);var o=Math.max(1,e*n/t.ticks().length);return function(t){var n=t/u(Math.round(i(t)));return n*e0?e[i-1]:t[0],i=e?[i[e-1],n]:[i[o-1],i[o]]},o.copy=function(){return ad().domain([t,n]).range(u)},Xh(o)}function cd(){var t=[.5],n=[0,1],e=1;function i(i){if(i<=i)return n[Object(r.b)(t,i,0,e)]}return i.domain=function(r){return arguments.length?(t=Ph.call(r),e=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(r){return arguments.length?(n=Ph.call(r),e=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.copy=function(){return cd().domain(t).range(n)},i}var fd=new Date,sd=new Date;function ld(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n0))return a;do{a.push(o=new Date(+e)),n(e,u),t(e)}while(o=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););}))},e&&(i.count=function(n,r){return fd.setTime(+n),sd.setTime(+r),t(fd),t(sd),Math.floor(e(fd,sd))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var hd=ld((function(){}),(function(t,n){t.setTime(+t+n)}),(function(t,n){return n-t}));hd.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?ld((function(n){n.setTime(Math.floor(n/t)*t)}),(function(n,e){n.setTime(+n+e*t)}),(function(n,e){return(e-n)/t})):hd:null};var dd=hd,pd=hd.range,vd=6e4,gd=6048e5,yd=ld((function(t){t.setTime(1e3*Math.floor(t/1e3))}),(function(t,n){t.setTime(+t+1e3*n)}),(function(t,n){return(n-t)/1e3}),(function(t){return t.getUTCSeconds()})),_d=yd,md=yd.range,xd=ld((function(t){t.setTime(Math.floor(t/vd)*vd)}),(function(t,n){t.setTime(+t+n*vd)}),(function(t,n){return(n-t)/vd}),(function(t){return t.getMinutes()})),bd=xd,wd=xd.range,Md=ld((function(t){var n=t.getTimezoneOffset()*vd%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getHours()})),Td=Md,Sd=Md.range,kd=ld((function(t){t.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*vd)/864e5}),(function(t){return t.getDate()-1})),Cd=kd,Ad=kd.range;function Nd(t){return ld((function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+7*n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*vd)/gd}))}var Ed=Nd(0),zd=Nd(1),Pd=Nd(2),Od=Nd(3),Rd=Nd(4),Ld=Nd(5),qd=Nd(6),Ud=Ed.range,Dd=zd.range,Fd=Pd.range,jd=Od.range,Id=Rd.range,Hd=Ld.range,Yd=qd.range,Bd=ld((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,n){t.setMonth(t.getMonth()+n)}),(function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),Vd=Bd,Xd=Bd.range,Wd=ld((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n)}),(function(t,n){return n.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Wd.every=function(t){return isFinite(t=Math.floor(t))&&t>0?ld((function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)}),(function(n,e){n.setFullYear(n.getFullYear()+e*t)})):null};var $d=Wd,Gd=Wd.range,Zd=ld((function(t){t.setUTCSeconds(0,0)}),(function(t,n){t.setTime(+t+n*vd)}),(function(t,n){return(n-t)/vd}),(function(t){return t.getUTCMinutes()})),Qd=Zd,Jd=Zd.range,Kd=ld((function(t){t.setUTCMinutes(0,0,0)}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getUTCHours()})),tp=Kd,np=Kd.range,ep=ld((function(t){t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+n)}),(function(t,n){return(n-t)/864e5}),(function(t){return t.getUTCDate()-1})),rp=ep,ip=ep.range;function up(t){return ld((function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+7*n)}),(function(t,n){return(n-t)/gd}))}var op=up(0),ap=up(1),cp=up(2),fp=up(3),sp=up(4),lp=up(5),hp=up(6),dp=op.range,pp=ap.range,vp=cp.range,gp=fp.range,yp=sp.range,_p=lp.range,mp=hp.range,xp=ld((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCMonth(t.getUTCMonth()+n)}),(function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),bp=xp,wp=xp.range,Mp=ld((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)}),(function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));Mp.every=function(t){return isFinite(t=Math.floor(t))&&t>0?ld((function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)}),(function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)})):null};var Tp=Mp,Sp=Mp.range;function kp(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Cp(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Ap(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function Np(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,u=t.days,o=t.shortDays,a=t.months,c=t.shortMonths,f=Ip(i),s=Hp(i),l=Ip(u),h=Hp(u),d=Ip(o),p=Hp(o),v=Ip(a),g=Hp(a),y=Ip(c),_=Hp(c),m={a:function(t){return o[t.getDay()]},A:function(t){return u[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:cv,e:cv,f:dv,H:fv,I:sv,j:lv,L:hv,m:pv,M:vv,p:function(t){return i[+(t.getHours()>=12)]},Q:Yv,s:Bv,S:gv,u:yv,U:_v,V:mv,w:xv,W:bv,x:null,X:null,y:wv,Y:Mv,Z:Tv,"%":Hv},x={a:function(t){return o[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:Sv,e:Sv,f:Ev,H:kv,I:Cv,j:Av,L:Nv,m:zv,M:Pv,p:function(t){return i[+(t.getUTCHours()>=12)]},Q:Yv,s:Bv,S:Ov,u:Rv,U:Lv,V:qv,w:Uv,W:Dv,x:null,X:null,y:Fv,Y:jv,Z:Iv,"%":Hv},b={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=l.exec(n.slice(e));return r?(t.w=h[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=y.exec(n.slice(e));return r?(t.m=_[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=g[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return T(t,n,e,r)},d:Jp,e:Jp,f:iv,H:tv,I:tv,j:Kp,L:rv,m:Qp,M:nv,p:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.p=s[r[0].toLowerCase()],e+r[0].length):-1},Q:ov,s:av,S:ev,u:Bp,U:Vp,V:Xp,w:Yp,W:Wp,x:function(t,n,r){return T(t,e,n,r)},X:function(t,n,e){return T(t,r,n,e)},y:Gp,Y:$p,Z:Zp,"%":uv};function w(t,n){return function(e){var r,i,u,o=[],a=-1,c=0,f=t.length;for(e instanceof Date||(e=new Date(+e));++a53)return null;"w"in u||(u.w=1),"Z"in u?(r=(i=(r=Cp(Ap(u.y))).getUTCDay())>4||0===i?ap.ceil(r):ap(r),r=rp.offset(r,7*(u.V-1)),u.y=r.getUTCFullYear(),u.m=r.getUTCMonth(),u.d=r.getUTCDate()+(u.w+6)%7):(r=(i=(r=n(Ap(u.y))).getDay())>4||0===i?zd.ceil(r):zd(r),r=Cd.offset(r,7*(u.V-1)),u.y=r.getFullYear(),u.m=r.getMonth(),u.d=r.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),i="Z"in u?Cp(Ap(u.y)).getUTCDay():n(Ap(u.y)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(i+5)%7:u.w+7*u.U-(i+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,Cp(u)):n(u)}}function T(t,n,e,r){for(var i,u,o=0,a=n.length,c=e.length;o=c)return-1;if(37===(i=n.charCodeAt(o++))){if(i=n.charAt(o++),!(u=b[i in Lp?n.charAt(o++):i])||(r=u(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return m.x=w(e,m),m.X=w(r,m),m.c=w(n,m),x.x=w(e,x),x.X=w(r,x),x.c=w(n,x),{format:function(t){var n=w(t+="",m);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",kp);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",x);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t,Cp);return n.toString=function(){return t},n}}}var Ep,zp,Pp,Op,Rp,Lp={"-":"",_:" ",0:"0"},qp=/^\s*\d+/,Up=/^%/,Dp=/[\\^$*+?|[\]().{}]/g;function Fp(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",u=i.length;return r+(u68?1900:2e3),e+r[0].length):-1}function Zp(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Qp(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function Jp(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function Kp(t,n,e){var r=qp.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function tv(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function nv(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function ev(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function rv(t,n,e){var r=qp.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function iv(t,n,e){var r=qp.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function uv(t,n,e){var r=Up.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function ov(t,n,e){var r=qp.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function av(t,n,e){var r=qp.exec(n.slice(e));return r?(t.Q=1e3*+r[0],e+r[0].length):-1}function cv(t,n){return Fp(t.getDate(),n,2)}function fv(t,n){return Fp(t.getHours(),n,2)}function sv(t,n){return Fp(t.getHours()%12||12,n,2)}function lv(t,n){return Fp(1+Cd.count($d(t),t),n,3)}function hv(t,n){return Fp(t.getMilliseconds(),n,3)}function dv(t,n){return hv(t,n)+"000"}function pv(t,n){return Fp(t.getMonth()+1,n,2)}function vv(t,n){return Fp(t.getMinutes(),n,2)}function gv(t,n){return Fp(t.getSeconds(),n,2)}function yv(t){var n=t.getDay();return 0===n?7:n}function _v(t,n){return Fp(Ed.count($d(t),t),n,2)}function mv(t,n){var e=t.getDay();return t=e>=4||0===e?Rd(t):Rd.ceil(t),Fp(Rd.count($d(t),t)+(4===$d(t).getDay()),n,2)}function xv(t){return t.getDay()}function bv(t,n){return Fp(zd.count($d(t),t),n,2)}function wv(t,n){return Fp(t.getFullYear()%100,n,2)}function Mv(t,n){return Fp(t.getFullYear()%1e4,n,4)}function Tv(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Fp(n/60|0,"0",2)+Fp(n%60,"0",2)}function Sv(t,n){return Fp(t.getUTCDate(),n,2)}function kv(t,n){return Fp(t.getUTCHours(),n,2)}function Cv(t,n){return Fp(t.getUTCHours()%12||12,n,2)}function Av(t,n){return Fp(1+rp.count(Tp(t),t),n,3)}function Nv(t,n){return Fp(t.getUTCMilliseconds(),n,3)}function Ev(t,n){return Nv(t,n)+"000"}function zv(t,n){return Fp(t.getUTCMonth()+1,n,2)}function Pv(t,n){return Fp(t.getUTCMinutes(),n,2)}function Ov(t,n){return Fp(t.getUTCSeconds(),n,2)}function Rv(t){var n=t.getUTCDay();return 0===n?7:n}function Lv(t,n){return Fp(op.count(Tp(t),t),n,2)}function qv(t,n){var e=t.getUTCDay();return t=e>=4||0===e?sp(t):sp.ceil(t),Fp(sp.count(Tp(t),t)+(4===Tp(t).getUTCDay()),n,2)}function Uv(t){return t.getUTCDay()}function Dv(t,n){return Fp(ap.count(Tp(t),t),n,2)}function Fv(t,n){return Fp(t.getUTCFullYear()%100,n,2)}function jv(t,n){return Fp(t.getUTCFullYear()%1e4,n,4)}function Iv(){return"+0000"}function Hv(){return"%"}function Yv(t){return+t}function Bv(t){return Math.floor(+t/1e3)}function Vv(t){return Ep=Np(t),zp=Ep.format,Pp=Ep.parse,Op=Ep.utcFormat,Rp=Ep.utcParse,Ep}Vv({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"]});var Xv=Date.prototype.toISOString?function(t){return t.toISOString()}:Op("%Y-%m-%dT%H:%M:%S.%LZ"),Wv=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:Rp("%Y-%m-%dT%H:%M:%S.%LZ"),$v=1e3,Gv=60*$v,Zv=60*Gv,Qv=24*Zv,Jv=7*Qv,Kv=30*Qv,tg=365*Qv;function ng(t){return new Date(t)}function eg(t){return t instanceof Date?+t:+new Date(+t)}function rg(t,n,e,i,u,o,a,c,f){var s=Bh(jh,Kn),l=s.invert,h=s.domain,d=f(".%L"),p=f(":%S"),v=f("%I:%M"),g=f("%I %p"),y=f("%a %d"),_=f("%b %d"),m=f("%B"),x=f("%Y"),b=[[a,1,$v],[a,5,5*$v],[a,15,15*$v],[a,30,30*$v],[o,1,Gv],[o,5,5*Gv],[o,15,15*Gv],[o,30,30*Gv],[u,1,Zv],[u,3,3*Zv],[u,6,6*Zv],[u,12,12*Zv],[i,1,Qv],[i,2,2*Qv],[e,1,Jv],[n,1,Kv],[n,3,3*Kv],[t,1,tg]];function w(r){return(a(r)1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return pg.h=360*t-100,pg.s=1.5-1.5*n,pg.l=.8-.9*n,pg+""};function gg(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var yg=gg(og("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),_g=gg(og("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),mg=gg(og("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),xg=gg(og("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function bg(t){var n=0,e=1,r=!1;function i(i){var u=(i-n)/(e-n);return t(r?Math.max(0,Math.min(1,u)):u)}return i.domain=function(t){return arguments.length?(n=+t[0],e=+t[1],i):[n,e]},i.clamp=function(t){return arguments.length?(r=!!t,i):r},i.interpolator=function(n){return arguments.length?(t=n,i):t},i.copy=function(){return bg(t).domain([n,e]).clamp(r)},Xh(i)}var wg=e(5),Mg=function(t){return function(){return t}};function Tg(t){return t[0]}function Sg(t){return t[1]}function kg(){this._=null}function Cg(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Ag(t,n){var e=n,r=n.R,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function Ng(t,n){var e=n,r=n.L,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function Eg(t){for(;t.L;)t=t.L;return t}kg.prototype={constructor:kg,insert:function(t,n){var e,r,i;if(t){if(n.P=t,n.N=t.N,t.N&&(t.N.P=n),t.N=n,t.R){for(t=t.R;t.L;)t=t.L;t.L=n}else t.R=n;e=t}else this._?(t=Eg(this._),n.P=null,n.N=t,t.P=t.L=n,e=t):(n.P=n.N=null,this._=n,e=null);for(n.L=n.R=null,n.U=e,n.C=!0,t=n;e&&e.C;)e===(r=e.U).L?(i=r.R)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.R&&(Ag(this,e),e=(t=e).U),e.C=!1,r.C=!0,Ng(this,r)):(i=r.L)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.L&&(Ng(this,e),e=(t=e).U),e.C=!1,r.C=!0,Ag(this,r)),e=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var n,e,r,i=t.U,u=t.L,o=t.R;if(e=u?o?Eg(o):u:o,i?i.L===t?i.L=e:i.R=e:this._=e,u&&o?(r=e.C,e.C=t.C,e.L=u,u.U=e,e!==o?(i=e.U,e.U=t.U,t=e.R,i.L=t,e.R=o,o.U=e):(e.U=i,i=e,t=e.R)):(r=t.C,t=e),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((n=i.R).C&&(n.C=!1,i.C=!0,Ag(this,i),n=i.R),n.L&&n.L.C||n.R&&n.R.C){n.R&&n.R.C||(n.L.C=!1,n.C=!0,Ng(this,n),n=i.R),n.C=i.C,i.C=n.R.C=!1,Ag(this,i),t=this._;break}}else if((n=i.L).C&&(n.C=!1,i.C=!0,Ng(this,i),n=i.L),n.L&&n.L.C||n.R&&n.R.C){n.L&&n.L.C||(n.R.C=!1,n.C=!0,Ag(this,n),n=i.L),n.C=i.C,i.C=n.L.C=!1,Ng(this,i),t=this._;break}n.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var zg=kg;function Pg(t,n,e,r){var i=[null,null],u=ty.push(i)-1;return i.left=t,i.right=n,e&&Rg(i,t,n,e),r&&Rg(i,n,t,r),Jg[t.index].halfedges.push(u),Jg[n.index].halfedges.push(u),i}function Og(t,n,e){var r=[n,e];return r.left=t,r}function Rg(t,n,e,r){t[0]||t[1]?t.left===e?t[1]=r:t[0]=r:(t[0]=r,t.left=n,t.right=e)}function Lg(t,n,e,r,i){var u,o=t[0],a=t[1],c=o[0],f=o[1],s=0,l=1,h=a[0]-c,d=a[1]-f;if(u=n-c,h||!(u>0)){if(u/=h,h<0){if(u0){if(u>l)return;u>s&&(s=u)}if(u=r-c,h||!(u<0)){if(u/=h,h<0){if(u>l)return;u>s&&(s=u)}else if(h>0){if(u0)){if(u/=d,d<0){if(u0){if(u>l)return;u>s&&(s=u)}if(u=i-f,d||!(u<0)){if(u/=d,d<0){if(u>l)return;u>s&&(s=u)}else if(d>0){if(u0||l<1)||(s>0&&(t[0]=[c+s*h,f+s*d]),l<1&&(t[1]=[c+l*h,f+l*d]),!0)}}}}}function qg(t,n,e,r,i){var u=t[1];if(u)return!0;var o,a,c=t[0],f=t.left,s=t.right,l=f[0],h=f[1],d=s[0],p=s[1],v=(l+d)/2,g=(h+p)/2;if(p===h){if(v=r)return;if(l>d){if(c){if(c[1]>=i)return}else c=[v,e];u=[v,i]}else{if(c){if(c[1]1)if(l>d){if(c){if(c[1]>=i)return}else c=[(e-a)/o,e];u=[(i-a)/o,i]}else{if(c){if(c[1]=r)return}else c=[n,o*n+a];u=[r,o*r+a]}else{if(c){if(c[0]=-ey)){var d=c*c+f*f,p=s*s+l*l,v=(l*d-f*p)/h,g=(c*p-s*d)/h,y=Ig.pop()||new function(){Cg(this),this.x=this.y=this.arc=this.site=this.cy=null};y.arc=t,y.site=i,y.x=v+o,y.y=(y.cy=g+a)+Math.sqrt(v*v+g*g),t.circle=y;for(var _=null,m=Kg._;m;)if(y.yny)a=a.L;else{if(!((i=u-Zg(a,o))>ny)){r>-ny?(n=a.P,e=a):i>-ny?(n=a,e=a.N):n=e=a;break}if(!a.R){n=a;break}a=a.R}!function(t){Jg[t.index]={site:t,halfedges:[]}}(t);var c=Vg(t);if(Qg.insert(n,c),n||e){if(n===e)return Yg(n),e=Vg(n.site),Qg.insert(c,e),c.edge=e.edge=Pg(n.site,c.site),Hg(n),void Hg(e);if(e){Yg(n),Yg(e);var f=n.site,s=f[0],l=f[1],h=t[0]-s,d=t[1]-l,p=e.site,v=p[0]-s,g=p[1]-l,y=2*(h*g-d*v),_=h*h+d*d,m=v*v+g*g,x=[(g*_-d*m)/y+s,(h*m-v*_)/y+l];Rg(e.edge,f,p,x),c.edge=Pg(f,t,null,x),e.edge=Pg(t,p,null,x),Hg(n),Hg(e)}else c.edge=Pg(n.site,c.site)}}function Gg(t,n){var e=t.site,r=e[0],i=e[1],u=i-n;if(!u)return r;var o=t.P;if(!o)return-1/0;var a=(e=o.site)[0],c=e[1],f=c-n;if(!f)return a;var s=a-r,l=1/u-1/f,h=s/f;return l?(-h+Math.sqrt(h*h-2*l*(s*s/(-2*f)-c+f/2+i-u/2)))/l+r:(r+a)/2}function Zg(t,n){var e=t.N;if(e)return Gg(e,n);var r=t.site;return r[1]===n?r[0]:1/0}var Qg,Jg,Kg,ty,ny=1e-6,ey=1e-12;function ry(t,n){return n[1]-t[1]||n[0]-t[0]}function iy(t,n){var e,r,i,u=t.sort(ry).pop();for(ty=[],Jg=new Array(t.length),Qg=new zg,Kg=new zg;;)if(i=jg,u&&(!i||u[1]ny||Math.abs(i[0][1]-i[1][1])>ny)||delete ty[u]}(o,a,c,f),function(t,n,e,r){var i,u,o,a,c,f,s,l,h,d,p,v,g=Jg.length,y=!0;for(i=0;iny||Math.abs(v-h)>ny)&&(c.splice(a,0,ty.push(Og(o,d,Math.abs(p-t)ny?[t,Math.abs(l-t)ny?[Math.abs(h-r)ny?[e,Math.abs(l-e)ny?[Math.abs(h-n)=a)return null;var c=t-i.site[0],f=n-i.site[1],s=c*c+f*f;do{i=u.cells[r=o],o=null,i.halfedges.forEach((function(e){var r=u.edges[e],a=r.left;if(a!==i.site&&a||(a=r.right)){var c=t-a[0],f=n-a[1],l=c*c+f*f;lr?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>u?(u+o)/2:Math.min(0,u)||Math.max(0,o))}var _y=function(){var t,n,e=hy,r=dy,i=yy,u=vy,o=gy,a=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],f=250,s=pe,l=[],h=T("start","zoom","end"),d=500,p=150,v=0;function g(t){t.property("__zoom",py).on("wheel.zoom",M).on("mousedown.zoom",S).on("dblclick.zoom",k).filter(o).on("touchstart.zoom",C).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(t,n){return(n=Math.max(a[0],Math.min(a[1],n)))===t.k?t:new ay(n,t.x,t.y)}function _(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new ay(t.k,r,i)}function m(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,n,e){t.on("start.zoom",(function(){b(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).end()})).tween("zoom",(function(){var t=arguments,i=b(this,t),u=r.apply(this,t),o=e||m(u),a=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),c=this.__zoom,f="function"==typeof n?n.apply(this,t):n,l=s(c.invert(o).concat(a/c.k),f.invert(o).concat(a/f.k));return function(t){if(1===t)t=f;else{var n=l(t),e=a/n[2];t=new ay(e,o[0]-n[0]*e,o[1]-n[1]*e)}i.zoom(null,t)}}))}function b(t,n){for(var e,r=0,i=l.length;rv}t.zoom("mouse",i(_(t.that.__zoom,t.mouse[0]=Mt(t.that),t.mouse[1]),t.extent,c))}),!0).on("mouseup.zoom",(function(){r.on("mousemove.zoom mouseup.zoom",null),Et(ut.view,t.moved),ly(),t.end()}),!0),u=Mt(this),o=ut.clientX,a=ut.clientY;Nt(ut.view),sy(),t.mouse=[u,this.__zoom.invert(u)],or(this),t.start()}}function k(){if(e.apply(this,arguments)){var t=this.__zoom,n=Mt(this),u=t.invert(n),o=t.k*(ut.shiftKey?.5:2),a=i(_(y(t,o),n,u),r.apply(this,arguments),c);ly(),f>0?gt(this).transition().duration(f).call(x,a,n):gt(this).call(g.transform,a)}}function C(){if(e.apply(this,arguments)){var n,r,i,u,o=b(this,arguments),a=ut.changedTouches,c=a.length;for(sy(),r=0;r-1&&(n+=",");var e=t.split(".");switch(n+=".",n+=e.length>1?e[1].length:0,t.slice(-1)){case"%":n+="%";break;case"0":n+="f"}return r.format(n)}},u=function(t,n,e){var r=function(n,e,r,i,u){return!(!t.addError||!t.clearErrors||(ru?(t.addError({title:"Too Many "+e+"s",message:"This visualization requires "+(i===u?"exactly":"no more than")+" "+u+" "+e.toLowerCase()+(1===i?"":"s")+".",group:n}),1):(t.clearErrors(n),0)))},i=n.fields,u=i.pivots,o=i.dimensions,a=i.measure_like;return r("pivot-req","Pivot",u.length,e.min_pivots,e.max_pivots)&&r("dim-req","Dimension",o.length,e.min_dimensions,e.max_dimensions)&&r("mes-req","Measure",a.length,e.min_measures,e.max_measures)}},5:function(t,n,e){"use strict";var r=e(1),i=function(t){return function(){return t}},u=Math.abs,o=Math.atan2,a=Math.cos,c=Math.max,f=Math.min,s=Math.sin,l=Math.sqrt,h=1e-12,d=Math.PI,p=d/2,v=2*d;function g(t){return t>=1?p:t<=-1?-p:Math.asin(t)}function y(t){return t.innerRadius}function _(t){return t.outerRadius}function m(t){return t.startAngle}function x(t){return t.endAngle}function b(t){return t&&t.padAngle}function w(t,n,e,r,i,u,o){var a=t-e,f=n-r,s=(o?u:-u)/l(a*a+f*f),h=s*f,d=-s*a,p=t+h,v=n+d,g=e+h,y=r+d,_=(p+g)/2,m=(v+y)/2,x=g-p,b=y-v,w=x*x+b*b,M=i-u,T=p*y-g*v,S=(b<0?-1:1)*l(c(0,M*M*w-T*T)),k=(T*b-x*S)/w,C=(-T*x-b*S)/w,A=(T*b+x*S)/w,N=(-T*x+b*S)/w,E=k-_,z=C-m,P=A-_,O=N-m;return E*E+z*z>P*P+O*O&&(k=A,C=N),{cx:k,cy:C,x01:-h,y01:-d,x11:k*(i/M-1),y11:C*(i/M-1)}}var M=function(){var t=y,n=_,e=i(0),c=null,M=m,T=x,S=b,k=null;function C(){var i,y,_,m=+t.apply(this,arguments),x=+n.apply(this,arguments),b=M.apply(this,arguments)-p,C=T.apply(this,arguments)-p,A=u(C-b),N=C>b;if(k||(k=i=Object(r.a)()),xh)if(A>v-h)k.moveTo(x*a(b),x*s(b)),k.arc(0,0,x,b,C,!N),m>h&&(k.moveTo(m*a(C),m*s(C)),k.arc(0,0,m,C,b,N));else{var E,z,P=b,O=C,R=b,L=C,q=A,U=A,D=S.apply(this,arguments)/2,F=D>h&&(c?+c.apply(this,arguments):l(m*m+x*x)),j=f(u(x-m)/2,+e.apply(this,arguments)),I=j,H=j;if(F>h){var Y=g(F/m*s(D)),B=g(F/x*s(D));(q-=2*Y)>h?(R+=Y*=N?1:-1,L-=Y):(q=0,R=L=(b+C)/2),(U-=2*B)>h?(P+=B*=N?1:-1,O-=B):(U=0,P=O=(b+C)/2)}var V=x*a(P),X=x*s(P),W=m*a(L),$=m*s(L);if(j>h){var G=x*a(O),Z=x*s(O),Q=m*a(R),J=m*s(R);if(Ah?function(t,n,e,r,i,u,o,a){var c=e-t,f=r-n,s=o-i,l=a-u,h=(s*(n-u)-l*(t-i))/(l*c-s*f);return[t+h*c,n+h*f]}(V,X,Q,J,G,Z,W,$):[W,$],tt=V-K[0],nt=X-K[1],et=G-K[0],rt=Z-K[1],it=1/s(((_=(tt*et+nt*rt)/(l(tt*tt+nt*nt)*l(et*et+rt*rt)))>1?0:_<-1?d:Math.acos(_))/2),ut=l(K[0]*K[0]+K[1]*K[1]);I=f(j,(m-ut)/(it-1)),H=f(j,(x-ut)/(it+1))}}U>h?H>h?(E=w(Q,J,V,X,x,H,N),z=w(G,Z,W,$,x,H,N),k.moveTo(E.cx+E.x01,E.cy+E.y01),Hh&&q>h?I>h?(E=w(W,$,G,Z,m,-I,N),z=w(V,X,Q,J,m,-I,N),k.lineTo(E.cx+E.x01,E.cy+E.y01),I=l;--h)f.point(y[h],_[h]);f.lineEnd(),f.areaEnd()}g&&(y[s]=+t(d,s,i),_[s]=+e(d,s,i),f.point(n?+n(d,s,i):y[s],u?+u(d,s,i):_[s]))}if(p)return f=null,p+""||null}function l(){return A().defined(o).curve(c).context(a)}return s.x=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),n=null,s):t},s.x0=function(n){return arguments.length?(t="function"==typeof n?n:i(+n),s):t},s.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:i(+t),s):n},s.y=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),u=null,s):e},s.y0=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),s):e},s.y1=function(t){return arguments.length?(u=null==t?null:"function"==typeof t?t:i(+t),s):u},s.lineX0=s.lineY0=function(){return l().x(t).y(e)},s.lineY1=function(){return l().x(t).y(u)},s.lineX1=function(){return l().x(n).y(e)},s.defined=function(t){return arguments.length?(o="function"==typeof t?t:i(!!t),s):o},s.curve=function(t){return arguments.length?(c=t,null!=a&&(f=c(a)),s):c},s.context=function(t){return arguments.length?(null==t?a=f=null:f=c(a=t),s):a},s},E=function(t,n){return nt?1:n>=t?0:NaN},z=function(t){return t},P=function(){var t=z,n=E,e=null,r=i(0),u=i(v),o=i(0);function a(i){var a,c,f,s,l,h=i.length,d=0,p=new Array(h),g=new Array(h),y=+r.apply(this,arguments),_=Math.min(v,Math.max(-v,u.apply(this,arguments)-y)),m=Math.min(Math.abs(_)/h,o.apply(this,arguments)),x=m*(_<0?-1:1);for(a=0;a0&&(d+=l);for(null!=n?p.sort((function(t,e){return n(g[t],g[e])})):null!=e&&p.sort((function(t,n){return e(i[t],i[n])})),a=0,f=d?(_-h*x)/d:0;a0?l*f:0)+x,g[c]={data:i[c],index:a,value:l,startAngle:y,endAngle:s,padAngle:m};return g}return a.value=function(n){return arguments.length?(t="function"==typeof n?n:i(+n),a):t},a.sortValues=function(t){return arguments.length?(n=t,e=null,a):n},a.sort=function(t){return arguments.length?(e=t,n=null,a):e},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:i(+t),a):r},a.endAngle=function(t){return arguments.length?(u="function"==typeof t?t:i(+t),a):u},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:i(+t),a):o},a},O=L(S);function R(t){this._curve=t}function L(t){function n(n){return new R(t(n))}return n._curve=t,n}function q(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(L(t)):n()._curve},t}R.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var U=function(){return q(A().curve(O))},D=function(){var t=N().curve(O),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,u=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return q(e())},delete t.lineX0,t.lineEndAngle=function(){return q(r())},delete t.lineX1,t.lineInnerRadius=function(){return q(i())},delete t.lineY0,t.lineOuterRadius=function(){return q(u())},delete t.lineY1,t.curve=function(t){return arguments.length?n(L(t)):n()._curve},t},F=function(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]},j=Array.prototype.slice;function I(t){return t.source}function H(t){return t.target}function Y(t){var n=I,e=H,u=k,o=C,a=null;function c(){var i,c=j.call(arguments),f=n.apply(this,c),s=e.apply(this,c);if(a||(a=i=Object(r.a)()),t(a,+u.apply(this,(c[0]=f,c)),+o.apply(this,c),+u.apply(this,(c[0]=s,c)),+o.apply(this,c)),i)return a=null,i+""||null}return c.source=function(t){return arguments.length?(n=t,c):n},c.target=function(t){return arguments.length?(e=t,c):e},c.x=function(t){return arguments.length?(u="function"==typeof t?t:i(+t),c):u},c.y=function(t){return arguments.length?(o="function"==typeof t?t:i(+t),c):o},c.context=function(t){return arguments.length?(a=null==t?null:t,c):a},c}function B(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function V(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n,e=(e+i)/2,r,e,r,i)}function X(t,n,e,r,i){var u=F(n,e),o=F(n,e=(e+i)/2),a=F(r,e),c=F(r,i);t.moveTo(u[0],u[1]),t.bezierCurveTo(o[0],o[1],a[0],a[1],c[0],c[1])}function W(){return Y(B)}function $(){return Y(V)}function G(){var t=Y(X);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}var Z={draw:function(t,n){var e=Math.sqrt(n/d);t.moveTo(e,0),t.arc(0,0,e,0,v)}},Q={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},J=Math.sqrt(1/3),K=2*J,tt={draw:function(t,n){var e=Math.sqrt(n/K),r=e*J;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},nt=Math.sin(d/10)/Math.sin(7*d/10),et=Math.sin(v/10)*nt,rt=-Math.cos(v/10)*nt,it={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=et*e,i=rt*e;t.moveTo(0,-e),t.lineTo(r,i);for(var u=1;u<5;++u){var o=v*u/5,a=Math.cos(o),c=Math.sin(o);t.lineTo(c*e,-a*e),t.lineTo(a*r-c*i,c*r+a*i)}t.closePath()}},ut={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},ot=Math.sqrt(3),at={draw:function(t,n){var e=-Math.sqrt(n/(3*ot));t.moveTo(0,2*e),t.lineTo(-ot*e,-e),t.lineTo(ot*e,-e),t.closePath()}},ct=Math.sqrt(3)/2,ft=1/Math.sqrt(12),st=3*(ft/2+1),lt={draw:function(t,n){var e=Math.sqrt(n/st),r=e/2,i=e*ft,u=r,o=e*ft+e,a=-u,c=o;t.moveTo(r,i),t.lineTo(u,o),t.lineTo(a,c),t.lineTo(-.5*r-ct*i,ct*r+-.5*i),t.lineTo(-.5*u-ct*o,ct*u+-.5*o),t.lineTo(-.5*a-ct*c,ct*a+-.5*c),t.lineTo(-.5*r+ct*i,-.5*i-ct*r),t.lineTo(-.5*u+ct*o,-.5*o-ct*u),t.lineTo(-.5*a+ct*c,-.5*c-ct*a),t.closePath()}},ht=[Z,Q,tt,ut,it,at,lt],dt=function(){var t=i(Z),n=i(64),e=null;function u(){var i;if(e||(e=i=Object(r.a)()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),i)return e=null,i+""||null}return u.type=function(n){return arguments.length?(t="function"==typeof n?n:i(n),u):t},u.size=function(t){return arguments.length?(n="function"==typeof t?t:i(+t),u):n},u.context=function(t){return arguments.length?(e=null==t?null:t,u):e},u},pt=function(){};function vt(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function gt(t){this._context=t}gt.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:vt(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(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);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:vt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var yt=function(t){return new gt(t)};function _t(t){this._context=t}_t.prototype={areaStart:pt,areaEnd:pt,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(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:vt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var mt=function(t){return new _t(t)};function xt(t){this._context=t}xt.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(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:vt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var bt=function(t){return new xt(t)};function wt(t,n){this._basis=new gt(t),this._beta=n}wt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],u=n[0],o=t[e]-i,a=n[e]-u,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*o),this._beta*n[c]+(1-this._beta)*(u+r*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var Mt=function t(n){function e(t){return 1===n?new gt(t):new wt(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function Tt(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function St(t,n){this._context=t,this._k=(1-n)/6}St.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:Tt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:Tt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var kt=function t(n){function e(t){return new St(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Ct(t,n){this._context=t,this._k=(1-n)/6}Ct.prototype={areaStart:pt,areaEnd:pt,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(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Tt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var At=function t(n){function e(t){return new Ct(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Nt(t,n){this._context=t,this._k=(1-n)/6}Nt.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(t,n){switch(t=+t,n=+n,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:Tt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Et=function t(n){function e(t){return new Nt(t,n)}return e.tension=function(n){return t(+n)},e}(0);function zt(t,n,e){var r=t._x1,i=t._y1,u=t._x2,o=t._y2;if(t._l01_a>h){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>h){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);u=(u*f+t._x1*t._l23_2a-n*t._l12_2a)/s,o=(o*f+t._y1*t._l23_2a-e*t._l12_2a)/s}t._context.bezierCurveTo(r,i,u,o,t._x2,t._y2)}function Pt(t,n){this._context=t,this._alpha=n}Pt.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(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:zt(this,t,n)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Ot=function t(n){function e(t){return n?new Pt(t,n):new St(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function Rt(t,n){this._context=t,this._alpha=n}Rt.prototype={areaStart:pt,areaEnd:pt,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(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:zt(this,t,n)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Lt=function t(n){function e(t){return n?new Rt(t,n):new Ct(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function qt(t,n){this._context=t,this._alpha=n}qt.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(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+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:zt(this,t,n)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Ut=function t(n){function e(t){return n?new qt(t,n):new Nt(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function Dt(t){this._context=t}Dt.prototype={areaStart:pt,areaEnd:pt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};var Ft=function(t){return new Dt(t)};function jt(t){return t<0?-1:1}function It(t,n,e){var r=t._x1-t._x0,i=n-t._x1,u=(t._y1-t._y0)/(r||i<0&&-0),o=(e-t._y1)/(i||r<0&&-0),a=(u*i+o*r)/(r+i);return(jt(u)+jt(o))*Math.min(Math.abs(u),Math.abs(o),.5*Math.abs(a))||0}function Ht(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function Yt(t,n,e){var r=t._x0,i=t._y0,u=t._x1,o=t._y1,a=(u-r)/3;t._context.bezierCurveTo(r+a,i+a*n,u-a,o-a*e,u,o)}function Bt(t){this._context=t}function Vt(t){this._context=new Xt(t)}function Xt(t){this._context=t}function Wt(t){return new Bt(t)}function $t(t){return new Vt(t)}function Gt(t){this._context=t}function Zt(t){var n,e,r=t.length-1,i=new Array(r),u=new Array(r),o=new Array(r);for(i[0]=0,u[0]=2,o[0]=t[0]+2*t[1],n=1;n=0;--n)i[n]=(o[n]-i[n+1])/u[n];for(u[r-1]=(t[r]+i[r-1])/2,n=0;n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var Kt=function(t){return new Jt(t,.5)};function tn(t){return new Jt(t,0)}function nn(t){return new Jt(t,1)}var en=function(t,n){if((i=t.length)>1)for(var e,r,i,u=1,o=t[n[0]],a=o.length;u=0;)e[n]=n;return e};function un(t,n){return t[n]}var on=function(){var t=i([]),n=rn,e=en,r=un;function u(i){var u,o,a=t.apply(this,arguments),c=i.length,f=a.length,s=new Array(f);for(u=0;u0){for(var e,r,i,u=0,o=t[0].length;u1)for(var e,r,i,u,o,a,c=0,f=t[n[0]].length;c=0?(r[0]=u,r[1]=u+=i):i<0?(r[1]=o,r[0]=o+=i):r[0]=u},fn=function(t,n){if((e=t.length)>0){for(var e,r=0,i=t[n[0]],u=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,u=0,o=1;o=r.length)return null!=t&&e.sort(t),null!=n?n(e):e;for(var f,s,l,h=-1,d=e.length,p=r[i++],v=u(),g=a();++hr.length)return e;var o,a=i[u-1];return null!=n&&u>=r.length?o=e.entries():(o=[],e.each((function(n,e){o.push({key:e,values:t(n,u)})}))),null!=a?o.sort((function(t,n){return a(t.key,n.key)})):o}(o(t,0,f,s),0)},key:function(t){return r.push(t),e},sortKeys:function(t){return i[r.length-1]=t,e},sortValues:function(n){return t=n,e},rollup:function(t){return n=t,e}}};function a(){return{}}function c(t,n,e){t[n]=e}function f(){return u()}function s(t,n,e){t.set(n,e)}function l(){}var h=u.prototype;function d(t,n){var e=new l;if(t instanceof l)t.each((function(t){e.add(t)}));else if(t){var r=-1,i=t.length;if(null==n)for(;++r=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),o=-1,a=u.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o0)for(var e,r,i=new Array(e),u=0;u=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),k.hasOwnProperty(n)?{space:k[n],local:t}:t},A=function(t){var n=C(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===S&&n.documentElement.namespaceURI===S?n.createElement(t):n.createElementNS(e,t)}})(n)};function N(){}var E=function(t){return null==t?N:function(){return this.querySelector(t)}};function z(){return[]}var P=function(t){return null==t?z:function(){return this.querySelectorAll(t)}},O=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var R=document.documentElement;if(!R.matches){var L=R.webkitMatchesSelector||R.msMatchesSelector||R.mozMatchesSelector||R.oMatchesSelector;O=function(t){return function(){return L.call(this,t)}}}}var q=O,U=function(t){return new Array(t.length)};function D(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}D.prototype={constructor:D,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var F="$";function j(t,n,e,r,i,u){for(var o,a=0,c=n.length,f=u.length;an?1:t>=n?0:NaN}var Y=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function B(t,n){return t.style.getPropertyValue(n)||Y(t).getComputedStyle(t,null).getPropertyValue(n)}function V(t){return t.trim().split(/^|\s+/)}function X(t){return t.classList||new W(t)}function W(t){this._node=t,this._names=V(t.getAttribute("class")||"")}function $(t,n){for(var e=X(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var it={},ut=null;function ot(t,n,e){return t=at(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function at(t,n,e){return function(r){var i=ut;ut=r;try{t.call(this,this.__data__,n,e)}finally{ut=i}}}function ct(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,u=n.length;r=b&&(b=x+1);!(m=y[b])&&++b=0;)(r=i[u])&&(o&&o!==r.nextSibling&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=H);for(var e=this._groups,r=e.length,i=new Array(r),u=0;u1?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?function(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}:function(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):B(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=V(t+"");if(arguments.length<2){for(var r=X(this.node()),i=-1,u=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),o=u.length;if(!(arguments.length<2)){for(a=n?ft:ct,null==e&&(e=!1),r=0;rl}c.mouse("drag")}function v(){gt(ut.view).on("mousemove.drag mouseup.drag",null),Et(ut.view,e),At(),c.mouse("end")}function g(){if(i.apply(this,arguments)){var t,n,e=ut.changedTouches,r=u.apply(this,arguments),o=e.length;for(t=0;t>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=Vt.exec(t))?tn(parseInt(n[1],16)):(n=Xt.exec(t))?new un(n[1],n[2],n[3],1):(n=Wt.exec(t))?new un(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=$t.exec(t))?nn(n[1],n[2],n[3],n[4]):(n=Gt.exec(t))?nn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Zt.exec(t))?on(n[1],n[2]/100,n[3]/100,1):(n=Qt.exec(t))?on(n[1],n[2]/100,n[3]/100,n[4]):Jt.hasOwnProperty(t)?tn(Jt[t]):"transparent"===t?new un(NaN,NaN,NaN,0):null}function tn(t){return new un(t>>16&255,t>>8&255,255&t,1)}function nn(t,n,e,r){return r<=0&&(t=n=e=NaN),new un(t,n,e,r)}function en(t){return t instanceof jt||(t=Kt(t)),t?new un((t=t.rgb()).r,t.g,t.b,t.opacity):new un}function rn(t,n,e,r){return 1===arguments.length?en(t):new un(t,n,e,null==r?1:r)}function un(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function on(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new cn(t,n,e,r)}function an(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof cn)return new cn(t.h,t.s,t.l,t.opacity);if(t instanceof jt||(t=Kt(t)),!t)return new cn;if(t instanceof cn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),u=Math.max(n,e,r),o=NaN,a=u-i,c=(u+i)/2;return a?(o=n===u?(e-r)/a+6*(e0&&c<1?0:o,new cn(o,a,c,t.opacity)}(t):new cn(t,n,e,null==r?1:r)}function cn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function fn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Dt(jt,Kt,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),Dt(un,rn,Ft(jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new un(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new un(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),Dt(cn,an,Ft(jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new cn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new cn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new un(fn(t>=240?t-240:t+120,i,r),fn(t,i,r),fn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var sn=Math.PI/180,ln=180/Math.PI,hn=.95047,dn=1,pn=1.08883,vn=4/29,gn=6/29,yn=3*gn*gn,_n=gn*gn*gn;function mn(t){if(t instanceof bn)return new bn(t.l,t.a,t.b,t.opacity);if(t instanceof Cn){var n=t.h*sn;return new bn(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof un||(t=en(t));var e=Sn(t.r),r=Sn(t.g),i=Sn(t.b),u=wn((.4124564*e+.3575761*r+.1804375*i)/hn),o=wn((.2126729*e+.7151522*r+.072175*i)/dn);return new bn(116*o-16,500*(u-o),200*(o-wn((.0193339*e+.119192*r+.9503041*i)/pn)),t.opacity)}function xn(t,n,e,r){return 1===arguments.length?mn(t):new bn(t,n,e,null==r?1:r)}function bn(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function wn(t){return t>_n?Math.pow(t,1/3):t/yn+vn}function Mn(t){return t>gn?t*t*t:yn*(t-vn)}function Tn(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Sn(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function kn(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof Cn)return new Cn(t.h,t.c,t.l,t.opacity);t instanceof bn||(t=mn(t));var n=Math.atan2(t.b,t.a)*ln;return new Cn(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new Cn(t,n,e,null==r?1:r)}function Cn(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}Dt(bn,xn,Ft(jt,{brighter:function(t){return new bn(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new bn(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=dn*Mn(t),new un(Tn(3.2404542*(n=hn*Mn(n))-1.5371385*t-.4985314*(e=pn*Mn(e))),Tn(-.969266*n+1.8760108*t+.041556*e),Tn(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),Dt(Cn,kn,Ft(jt,{brighter:function(t){return new Cn(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Cn(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return mn(this).rgb()}}));var An=-.29227,Nn=-.90649,En=1.97294,zn=En*Nn,Pn=1.78277*En,On=1.78277*An- -.14861*Nn;function Rn(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof Ln)return new Ln(t.h,t.s,t.l,t.opacity);t instanceof un||(t=en(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(On*r+zn*n-Pn*e)/(On+zn-Pn),u=r-i,o=(En*(e-i)-An*u)/Nn,a=Math.sqrt(o*o+u*u)/(En*i*(1-i)),c=a?Math.atan2(o,u)*ln-120:NaN;return new Ln(c<0?c+360:c,a,i,t.opacity)}(t):new Ln(t,n,e,null==r?1:r)}function Ln(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function qn(t,n,e,r,i){var u=t*t,o=u*t;return((1-3*t+3*u-o)*n+(4-6*u+3*o)*e+(1+3*t+3*u-3*o)*r+o*i)/6}Dt(Ln,Rn,Ft(jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ln(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ln(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*sn,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new un(255*(n+e*(-.14861*r+1.78277*i)),255*(n+e*(An*r+Nn*i)),255*(n+e*(En*r)),this.opacity)}}));var Un=function(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],u=t[r+1],o=r>0?t[r-1]:2*i-u,a=r180||e<-180?e-360*Math.round(e/360):e):Fn(isNaN(t)?n:t)}function Hn(t,n){var e=n-t;return e?jn(t,e):Fn(isNaN(t)?n:t)}var Yn=function t(n){var e=function(t){return 1==(t=+t)?Hn:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):Fn(isNaN(n)?e:n)}}(n);function r(t,n){var r=e((t=rn(t)).r,(n=rn(n)).r),i=e(t.g,n.g),u=e(t.b,n.b),o=Hn(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=u(n),t.opacity=o(n),t+""}}return r.gamma=t,r}(1);function Bn(t){return function(n){var e,r,i=n.length,u=new Array(i),o=new Array(i),a=new Array(i);for(e=0;eu&&(i=n.slice(u,i),a[o]?a[o]+=i:a[++o]=i),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,c.push({i:o,x:Kn(e,r)})),u=ee.lastIndex;return u180?n+=360:n-t>180&&(t+=360),u.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Kn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(u.rotate,o.rotate,a,c),function(t,n,e,u){t!==n?u.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Kn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(u.skewX,o.skewX,a,c),function(t,n,e,r,u,o){if(t!==e||n!==r){var a=u.push(i(u)+"scale(",null,",",null,")");o.push({i:a-4,x:Kn(t,e)},{i:a-2,x:Kn(n,r)})}else 1===e&&1===r||u.push(i(u)+"scale("+e+","+r+")")}(u.scaleX,u.scaleY,o.scaleX,o.scaleY,a,c),u=o=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(null,t),n=n._next;--Ae}function He(){Oe=(Pe=Le.now())+Re,Ae=Ne=0;try{Ie()}finally{Ae=0,function(){for(var t,n,e=Me,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Me=n);Te=t,Be(r)}(),Oe=0}}function Ye(){var t=Le.now(),n=t-Pe;n>ze&&(Re-=n,Pe=t)}function Be(t){Ae||(Ne&&(Ne=clearTimeout(Ne)),t-Oe>24?(t<1/0&&(Ne=setTimeout(He,t-Le.now()-Re)),Ee&&(Ee=clearInterval(Ee))):(Ee||(Pe=Le.now(),Ee=setInterval(Ye,ze)),Ae=1,qe(He)))}Fe.prototype=je.prototype={constructor:Fe,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Ue():+e)+(null==n?0:+n),this._next||Te===this||(Te?Te._next=this:Me=this,Te=this),this._call=t,this._time=e,Be()},stop:function(){this._call&&(this._call=null,this._time=1/0,Be())}};var Ve=function(t,n,e){var r=new Fe;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r},Xe=function(t,n,e){var r=new Fe,i=n;return null==n?(r.restart(t,n,e),r):(n=+n,e=null==e?Ue():+e,r.restart((function u(o){o+=i,r.restart(u,i+=n,e),t(o)}),n,e),r)},We=T("start","end","interrupt"),$e=[],Ge=0,Ze=1,Qe=2,Je=3,Ke=4,tr=5,nr=6,er=function(t,n,e,r,i,u){var o=t.__transition;if(o){if(e in o)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function u(c){var f,s,l,h;if(e.state!==Ze)return a();for(f in i)if((h=i[f]).name===e.name){if(h.state===Je)return Ve(u);h.state===Ke?(h.state=nr,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[f]):+fGe)throw new Error("too late; already scheduled");return e}function ir(t,n){var e=ur(t,n);if(e.state>Qe)throw new Error("too late; already started");return e}function ur(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var or=function(t,n){var e,r,i,u=t.__transition,o=!0;if(u){for(i in n=null==n?null:n+"",u)(e=u[i]).name===n?(r=e.state>Qe&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?rr:ir;return function(){var o=u(this,t),a=o.on;a!==r&&(i=(r=a).copy()).on(n,e),o.on=i}}(e,t,n))},attr:function(t,n){var e=C(t),r="transform"===e?le:cr;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,i,u;return function(){var o,a=e(this);if(null!=a)return(o=this.getAttributeNS(t.space,t.local))===a?null:o===r&&a===i?u:u=n(r=o,i=a);this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,i,u;return function(){var o,a=e(this);if(null!=a)return(o=this.getAttribute(t))===a?null:o===r&&a===i?u:u=n(r=o,i=a);this.removeAttribute(t)}})(e,r,ar(this,"attr."+t,n)):null==n?(e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(e):(e.local?function(t,n,e){var r,i;return function(){var u=this.getAttributeNS(t.space,t.local);return u===e?null:u===r?i:i=n(r=u,e)}}:function(t,n,e){var r,i;return function(){var u=this.getAttribute(t);return u===e?null:u===r?i:i=n(r=u,e)}})(e,r,n+""))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=C(t);return this.tween(e,(r.local?function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}:function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e})(r,n))},style:function(t,n,e){var r="transform"==(t+="")?se:cr;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var u=B(this,t),o=(this.style.removeProperty(t),B(this,t));return u===o?null:u===e&&o===r?i:i=n(e=u,r=o)}}(t,r)).on("end.style."+t,function(t){return function(){this.style.removeProperty(t)}}(t)):this.styleTween(t,"function"==typeof n?function(t,n,e){var r,i,u;return function(){var o=B(this,t),a=e(this);return null==a&&(this.style.removeProperty(t),a=B(this,t)),o===a?null:o===r&&a===i?u:u=n(r=o,i=a)}}(t,r,ar(this,"style."+t,n)):function(t,n,e){var r,i;return function(){var u=B(this,t);return u===e?null:u===r?i:i=n(r=u,e)}}(t,r,n+""),e)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(ar(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",(t=this._id,function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}));var t},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=ur(this.node(),e).tween,u=0,o=i.length;uZe&&e.name===n)return new lr([[t]],ii,n,+r);return null},oi=function(t){return function(){return t}},ai=function(t,n,e){this.target=t,this.type=n,this.selection=e};function ci(){ut.stopImmediatePropagation()}var fi=function(){ut.preventDefault(),ut.stopImmediatePropagation()},si={name:"drag"},li={name:"space"},hi={name:"handle"},di={name:"center"},pi={name:"x",handles:["e","w"].map(wi),input:function(t,n){return t&&[[t[0],n[0][1]],[t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},vi={name:"y",handles:["n","s"].map(wi),input:function(t,n){return t&&[[n[0][0],t[0]],[n[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},gi={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(wi),input:function(t){return t},output:function(t){return t}},yi={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},_i={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},mi={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},xi={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},bi={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function wi(t){return{type:t}}function Mi(){return!ut.button}function Ti(){var t=this.ownerSVGElement||this;return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Si(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function ki(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Ci(t){var n=t.__brush;return n?n.dim.output(n.selection):null}function Ai(){return zi(pi)}function Ni(){return zi(vi)}var Ei=function(){return zi(gi)};function zi(t){var n,e=Ti,r=Mi,i=T(o,"start","brush","end"),u=6;function o(n){var e=n.property("__brush",l).selectAll(".overlay").data([wi("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",yi.overlay).merge(e).each((function(){var t=Si(this).extent;gt(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),n.selectAll(".selection").data([wi("selection")]).enter().append("rect").attr("class","selection").attr("cursor",yi.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=n.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return yi[t.type]})),n.each(a).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",s)}function a(){var t=gt(this),n=Si(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?n[1][0]-u/2:n[0][0]-u/2})).attr("y",(function(t){return"s"===t.type[0]?n[1][1]-u/2:n[0][1]-u/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+u:u})).attr("height",(function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+u:u}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(t,n){return t.__brush.emitter||new f(t,n)}function f(t,n){this.that=t,this.args=n,this.state=t.__brush,this.active=0}function s(){if(ut.touches){if(ut.changedTouches.length0&&(e=i-d),w<0?l=h-p:w>0&&(u=o-p),x=li,L.attr("cursor",yi.selection),D());break;default:return}fi()}),!0).on("keyup.brush",(function(){switch(ut.keyCode){case 16:E&&(g=y=E=!1,D());break;case 18:x===di&&(b<0?f=s:b>0&&(e=i),w<0?l=h:w>0&&(u=o),x=hi,D());break;case 32:x===li&&(ut.altKey?(b&&(f=s-d*b,e=i+d*b),w&&(l=h-p*w,u=o+p*w),x=di):(b<0?f=s:b>0&&(e=i),w<0?l=h:w>0&&(u=o),x=hi),L.attr("cursor",yi[m]),D());break;default:return}fi()}),!0).on("mousemove.brush",U,!0).on("mouseup.brush",F,!0);Nt(ut.view)}ci(),or(_),a.call(_),O.start()}function U(){var t=Mt(_);!E||g||y||(Math.abs(t[0]-P[0])>Math.abs(t[1]-P[1])?y=!0:g=!0),P=t,v=!0,fi(),D()}function D(){var t;switch(d=P[0]-z[0],p=P[1]-z[1],x){case li:case si:b&&(d=Math.max(k-e,Math.min(A-f,d)),i=e+d,s=f+d),w&&(p=Math.max(C-u,Math.min(N-l,p)),o=u+p,h=l+p);break;case hi:b<0?(d=Math.max(k-e,Math.min(A-e,d)),i=e+d,s=f):b>0&&(d=Math.max(k-f,Math.min(A-f,d)),i=e,s=f+d),w<0?(p=Math.max(C-u,Math.min(N-u,p)),o=u+p,h=l):w>0&&(p=Math.max(C-l,Math.min(N-l,p)),o=u,h=l+p);break;case di:b&&(i=Math.max(k,Math.min(A,e-d*b)),s=Math.max(k,Math.min(A,f+d*b))),w&&(o=Math.max(C,Math.min(N,u-p*w)),h=Math.max(C,Math.min(N,l+p*w)))}s=u?c=!0:(r=t.charCodeAt(o++))===Ji?f=!0:r===Ki&&(f=!0,t.charCodeAt(o)===Ji&&++o),t.slice(i+1,n-1).replace(/""/g,'"')}for(;o=(u=(v+y)/2))?v=u:y=u,(s=e>=(o=(g+_)/2))?g=o:_=o,i=d,!(d=d[l=s<<1|f]))return i[l]=p,t;if(a=+t._x.call(null,d.data),c=+t._y.call(null,d.data),n===a&&e===c)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(f=n>=(u=(v+y)/2))?v=u:y=u,(s=e>=(o=(g+_)/2))?g=o:_=o}while((l=s<<1|f)==(h=(c>=o)<<1|a>=u));return i[h]=d,i[l]=p,t}var gu=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i};function yu(t){return t[0]}function _u(t){return t[1]}function mu(t,n,e){var r=new xu(null==n?yu:n,null==e?_u:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function xu(t,n,e,r,i,u){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=u,this._root=void 0}function bu(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var wu=mu.prototype=xu.prototype;function Mu(t){return t.x+t.vx}function Tu(t){return t.y+t.vy}wu.copy=function(){var t,n,e=new xu(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=bu(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=bu(n));return e},wu.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return vu(this.cover(n,e),n,e,t)},wu.addAll=function(t){var n,e,r,i,u=t.length,o=new Array(u),a=new Array(u),c=1/0,f=1/0,s=-1/0,l=-1/0;for(e=0;es&&(s=r),il&&(l=i));for(st||t>i||r>n||n>u))return this;var o,a,c=i-e,f=this._root;switch(a=(n<(r+u)/2)<<1|t<(e+i)/2){case 0:do{(o=new Array(4))[a]=f,f=o}while(u=r+(c*=2),t>(i=e+c)||n>u);break;case 1:do{(o=new Array(4))[a]=f,f=o}while(u=r+(c*=2),(e=i-c)>t||n>u);break;case 2:do{(o=new Array(4))[a]=f,f=o}while(r=u-(c*=2),t>(i=e+c)||r>n);break;case 3:do{(o=new Array(4))[a]=f,f=o}while(r=u-(c*=2),(e=i-c)>t||r>n)}this._root&&this._root.length&&(this._root=f)}return this._x0=e,this._y0=r,this._x1=i,this._y1=u,this},wu.data=function(){var t=[];return this.visit((function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)})),t},wu.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},wu.find=function(t,n,e){var r,i,u,o,a,c,f,s=this._x0,l=this._y0,h=this._x1,d=this._y1,p=[],v=this._root;for(v&&p.push(new gu(v,s,l,h,d)),null==e?e=1/0:(s=t-e,l=n-e,h=t+e,d=n+e,e*=e);c=p.pop();)if(!(!(v=c.node)||(i=c.x0)>h||(u=c.y0)>d||(o=c.x1)=y)<<1|t>=g)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=c)}else{var _=t-+this._x.call(null,v.data),m=n-+this._y.call(null,v.data),x=_*_+m*m;if(x=(a=(p+g)/2))?p=a:g=a,(s=o>=(c=(v+y)/2))?v=c:y=c,n=d,!(d=d[l=s<<1|f]))return this;if(!d.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},wu.removeAll=function(t){for(var n=0,e=t.length;nc+d||if+d||ua.index){var p=c-o.x-o.vx,v=f-o.y-o.vy,g=p*p+v*v;gt.r&&(t.r=t[n].r)}function a(){if(n){var r,i,u=n.length;for(e=new Array(u),r=0;r1?(null==e?a.remove(t):a.set(t,d(e)),n):a.get(t)},find:function(n,e,r){var i,u,o,a,c,f=0,s=t.length;for(null==r?r=1/0:r*=r,f=0;f1?(f.on(t,e),n):f.on(t)}}},Lu=function(){var t,n,e,r,i=du(-30),u=1,o=1/0,a=.81;function c(r){var i,u=t.length,o=mu(t,Nu,Eu).visitAfter(s);for(e=r,i=0;i=o)){(t.data!==n||t.next)&&(0===s&&(d+=(s=pu())*s),0===l&&(d+=(l=pu())*l),d1?r[0]+r.slice(2):r,+t.slice(e+1)]},ju=function(t){return(t=Fu(Math.abs(t)))?t[1]:NaN},Iu=function(t,n){var e=Fu(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Hu={"":function(t,n){t:for(var e,r=(t=t.toPrecision(n)).length,i=1,u=-1;i0&&(u=0)}return u>0?t.slice(0,u)+t.slice(e+1):t},"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return Iu(100*t,n)},r:Iu,s:function(t,n){var e=Fu(t,n);if(!e)return t+"";var r=e[0],i=e[1],u=i-(zu=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return u===o?r:u>o?r+new Array(u-o+1).join("0"):u>0?r.slice(0,u)+"."+r.slice(u):"0."+new Array(1-u).join("0")+Fu(t,Math.max(0,n+u-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},Yu=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function Bu(t){return new Vu(t)}function Vu(t){if(!(n=Yu.exec(t)))throw new Error("invalid format: "+t);var n,e=n[1]||" ",r=n[2]||">",i=n[3]||"-",u=n[4]||"",o=!!n[5],a=n[6]&&+n[6],c=!!n[7],f=n[8]&&+n[8].slice(1),s=n[9]||"";"n"===s?(c=!0,s="g"):Hu[s]||(s=""),(o||"0"===e&&"="===r)&&(o=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=i,this.symbol=u,this.zero=o,this.width=a,this.comma=c,this.precision=f,this.type=s}Bu.prototype=Vu.prototype,Vu.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var Xu,Wu,$u,Gu=function(t){return t},Zu=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],Qu=function(t){var n,e,r=t.grouping&&t.thousands?(n=t.grouping,e=t.thousands,function(t,r){for(var i=t.length,u=[],o=0,a=n[0],c=0;i>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),u.push(t.substring(i-=a,i+a)),!((c+=a+1)>r));)a=n[o=(o+1)%n.length];return u.reverse().join(e)}):Gu,i=t.currency,u=t.decimal,o=t.numerals?function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(t.numerals):Gu,a=t.percent||"%";function c(t){var n=(t=Bu(t)).fill,e=t.align,c=t.sign,f=t.symbol,s=t.zero,l=t.width,h=t.comma,d=t.precision,p=t.type,v="$"===f?i[0]:"#"===f&&/[boxX]/.test(p)?"0"+p.toLowerCase():"",g="$"===f?i[1]:/[%p]/.test(p)?a:"",y=Hu[p],_=!p||/[defgprs%]/.test(p);function m(t){var i,a,f,m=v,x=g;if("c"===p)x=y(t)+x,t="";else{var b=(t=+t)<0;if(t=y(Math.abs(t),d),b&&0==+t&&(b=!1),m=(b?"("===c?c:"-":"-"===c||"("===c?"":c)+m,x=("s"===p?Zu[8+zu/3]:"")+x+(b&&"("===c?")":""),_)for(i=-1,a=t.length;++i(f=t.charCodeAt(i))||f>57){x=(46===f?u+t.slice(i+1):t.slice(i))+x,t=t.slice(0,i);break}}h&&!s&&(t=r(t,1/0));var w=m.length+t.length+x.length,M=w>1)+m+t+x+M.slice(w);break;default:t=M+m+t+x}return o(t)}return d=null==d?p?6:12:/[gprs]/.test(p)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),m.toString=function(){return t+""},m}return{format:c,formatPrefix:function(t,n){var e=c(((t=Bu(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(ju(n)/3))),i=Math.pow(10,-r),u=Zu[8+r/3];return function(t){return e(i*t)+u}}}};function Ju(t){return Xu=Qu(t),Wu=Xu.format,$u=Xu.formatPrefix,Xu}Ju({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var Ku=function(t){return Math.max(0,-ju(Math.abs(t)))},to=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ju(n)/3)))-ju(Math.abs(t)))},no=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,ju(n)-ju(t))+1},eo=function(){return new ro};function ro(){this.reset()}ro.prototype={constructor:ro,reset:function(){this.s=this.t=0},add:function(t){uo(io,t,this.t),uo(this,io.s,this.s),this.s?this.t+=io.t:this.s=io.t},valueOf:function(){return this.s}};var io=new ro;function uo(t,n,e){var r=t.s=n+e,i=r-n,u=r-i;t.t=n-u+(e-i)}var oo=1e-6,ao=Math.PI,co=ao/2,fo=ao/4,so=2*ao,lo=180/ao,ho=ao/180,po=Math.abs,vo=Math.atan,go=Math.atan2,yo=Math.cos,_o=Math.ceil,mo=Math.exp,xo=(Math.floor,Math.log),bo=Math.pow,wo=Math.sin,Mo=Math.sign||function(t){return t>0?1:t<0?-1:0},To=Math.sqrt,So=Math.tan;function ko(t){return t>1?0:t<-1?ao:Math.acos(t)}function Co(t){return t>1?co:t<-1?-co:Math.asin(t)}function Ao(t){return(t=wo(t/2))*t}function No(){}function Eo(t,n){t&&Po.hasOwnProperty(t.type)&&Po[t.type](t,n)}var zo={Feature:function(t,n){Eo(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,u=yo(n=(n*=ho)/2+fo),o=wo(n),a=Fo*o,c=Do*u+a*yo(i),f=a*r*wo(i);Io.add(go(f,c)),Uo=t,Do=u,Fo=o}var $o=function(t){return Ho.reset(),jo(t,Yo),2*Ho};function Go(t){return[go(t[1],t[0]),Co(t[2])]}function Zo(t){var n=t[0],e=t[1],r=yo(e);return[r*yo(n),r*wo(n),wo(e)]}function Qo(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Jo(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Ko(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function ta(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function na(t){var n=To(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var ea,ra,ia,ua,oa,aa,ca,fa,sa,la,ha=eo(),da={point:pa,lineStart:ga,lineEnd:ya,polygonStart:function(){da.point=_a,da.lineStart=ma,da.lineEnd=xa,ha.reset(),Yo.polygonStart()},polygonEnd:function(){Yo.polygonEnd(),da.point=pa,da.lineStart=ga,da.lineEnd=ya,Io<0?(ea=-(ia=180),ra=-(ua=90)):ha>oo?ua=90:ha<-oo&&(ra=-90),la[0]=ea,la[1]=ia}};function pa(t,n){sa.push(la=[ea=t,ia=t]),nua&&(ua=n)}function va(t,n){var e=Zo([t*ho,n*ho]);if(fa){var r=Jo(fa,e),i=Jo([r[1],-r[0],0],r);na(i),i=Go(i);var u,o=t-oa,a=o>0?1:-1,c=i[0]*lo*a,f=po(o)>180;f^(a*oaua&&(ua=u):f^(a*oa<(c=(c+360)%360-180)&&cua&&(ua=n)),f?tba(ea,ia)&&(ia=t):ba(t,ia)>ba(ea,ia)&&(ea=t):ia>=ea?(tia&&(ia=t)):t>oa?ba(ea,t)>ba(ea,ia)&&(ia=t):ba(t,ia)>ba(ea,ia)&&(ea=t)}else sa.push(la=[ea=t,ia=t]);nua&&(ua=n),fa=e,oa=t}function ga(){da.point=va}function ya(){la[0]=ea,la[1]=ia,da.point=pa,fa=null}function _a(t,n){if(fa){var e=t-oa;ha.add(po(e)>180?e+(e>0?360:-360):e)}else aa=t,ca=n;Yo.point(t,n),va(t,n)}function ma(){Yo.lineStart()}function xa(){_a(aa,ca),Yo.lineEnd(),po(ha)>oo&&(ea=-(ia=180)),la[0]=ea,la[1]=ia,fa=null}function ba(t,n){return(n-=t)<0?n+360:n}function wa(t,n){return t[0]-n[0]}function Ma(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nba(r[0],r[1])&&(r[1]=i[1]),ba(i[0],r[1])>ba(r[0],r[1])&&(r[0]=i[0])):u.push(r=i);for(o=-1/0,n=0,r=u[e=u.length-1];n<=e;r=i,++n)i=u[n],(a=ba(r[1],i[0]))>o&&(o=a,ea=i[0],ia=r[1])}return sa=la=null,ea===1/0||ra===1/0?[[NaN,NaN],[NaN,NaN]]:[[ea,ra],[ia,ua]]},Ia={sphere:No,point:Ha,lineStart:Ba,lineEnd:Wa,polygonStart:function(){Ia.lineStart=$a,Ia.lineEnd=Ga},polygonEnd:function(){Ia.lineStart=Ba,Ia.lineEnd=Wa}};function Ha(t,n){t*=ho;var e=yo(n*=ho);Ya(e*yo(t),e*wo(t),wo(n))}function Ya(t,n,e){ka+=(t-ka)/++Ta,Ca+=(n-Ca)/Ta,Aa+=(e-Aa)/Ta}function Ba(){Ia.point=Va}function Va(t,n){t*=ho;var e=yo(n*=ho);Ua=e*yo(t),Da=e*wo(t),Fa=wo(n),Ia.point=Xa,Ya(Ua,Da,Fa)}function Xa(t,n){t*=ho;var e=yo(n*=ho),r=e*yo(t),i=e*wo(t),u=wo(n),o=go(To((o=Da*u-Fa*i)*o+(o=Fa*r-Ua*u)*o+(o=Ua*i-Da*r)*o),Ua*r+Da*i+Fa*u);Sa+=o,Na+=o*(Ua+(Ua=r)),Ea+=o*(Da+(Da=i)),za+=o*(Fa+(Fa=u)),Ya(Ua,Da,Fa)}function Wa(){Ia.point=Ha}function $a(){Ia.point=Za}function Ga(){Qa(La,qa),Ia.point=Ha}function Za(t,n){La=t,qa=n,t*=ho,n*=ho,Ia.point=Qa;var e=yo(n);Ua=e*yo(t),Da=e*wo(t),Fa=wo(n),Ya(Ua,Da,Fa)}function Qa(t,n){t*=ho;var e=yo(n*=ho),r=e*yo(t),i=e*wo(t),u=wo(n),o=Da*u-Fa*i,a=Fa*r-Ua*u,c=Ua*i-Da*r,f=To(o*o+a*a+c*c),s=Co(f),l=f&&-s/f;Pa+=l*o,Oa+=l*a,Ra+=l*c,Sa+=s,Na+=s*(Ua+(Ua=r)),Ea+=s*(Da+(Da=i)),za+=s*(Fa+(Fa=u)),Ya(Ua,Da,Fa)}var Ja=function(t){Ta=Sa=ka=Ca=Aa=Na=Ea=za=Pa=Oa=Ra=0,jo(t,Ia);var n=Pa,e=Oa,r=Ra,i=n*n+e*e+r*r;return i<1e-12&&(n=Na,e=Ea,r=za,Saao?t-so:t<-ao?t+so:t,n]}function ec(t,n,e){return(t%=so)?n||e?tc(ic(t),uc(n,e)):ic(t):n||e?uc(n,e):nc}function rc(t){return function(n,e){return[(n+=t)>ao?n-so:n<-ao?n+so:n,e]}}function ic(t){var n=rc(t);return n.invert=rc(-t),n}function uc(t,n){var e=yo(t),r=wo(t),i=yo(n),u=wo(n);function o(t,n){var o=yo(n),a=yo(t)*o,c=wo(t)*o,f=wo(n),s=f*e+a*r;return[go(c*i-s*u,a*e-f*r),Co(s*i+c*u)]}return o.invert=function(t,n){var o=yo(n),a=yo(t)*o,c=wo(t)*o,f=wo(n),s=f*i-c*u;return[go(c*i+f*u,a*e+s*r),Co(s*e-a*r)]},o}nc.invert=nc;var oc=function(t){function n(n){return(n=t(n[0]*ho,n[1]*ho))[0]*=lo,n[1]*=lo,n}return t=ec(t[0]*ho,t[1]*ho,t.length>2?t[2]*ho:0),n.invert=function(n){return(n=t.invert(n[0]*ho,n[1]*ho))[0]*=lo,n[1]*=lo,n},n};function ac(t,n,e,r,i,u){if(e){var o=yo(n),a=wo(n),c=r*e;null==i?(i=n+r*so,u=n-c/2):(i=cc(o,i),u=cc(o,u),(r>0?iu)&&(i+=r*so));for(var f,s=i;r>0?s>u:s1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}},lc=function(t,n){return po(t[0]-n[0])=0;--u)i.point((s=f[u])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}f=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}};function pc(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r=0?1:-1,T=M*w,S=T>ao,k=p*x;if(vc.add(go(k*M*wo(T),v*b+k*yo(T))),u+=S?w+M*so:w,S^h>=e^_>=e){var C=Jo(Zo(l),Zo(y));na(C);var A=Jo(i,C);na(A);var N=(S^w>=0?-1:1)*Co(A[2]);(r>N||r===N&&(C[0]||C[1]))&&(o+=S^w>=0?1:-1)}}return(u<-oo||u0){for(h||(u.polygonStart(),h=!0),u.lineStart(),t=0;t1&&2&i&&f.push(f.pop().concat(f.shift())),a.push(f.filter(_c))}return d}};function _c(t){return t.length>1}function mc(t,n){return((t=t.x)[0]<0?t[1]-co-oo:co-t[1])-((n=n.x)[0]<0?n[1]-co-oo:co-n[1])}var xc=yc((function(){return!0}),(function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(u,o){var a=u>0?ao:-ao,c=po(u-e);po(c-ao)0?co:-co),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(u,r),n=0):i!==a&&c>=ao&&(po(e-i)oo?vo((wo(n)*(u=yo(r))*wo(e)-wo(r)*(i=yo(n))*wo(t))/(i*u*o)):(n+r)/2}(e,r,u,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),n=0),t.point(e=u,r=o),i=a},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}),(function(t,n,e,r){var i;if(null==t)i=e*co,r.point(-ao,i),r.point(0,i),r.point(ao,i),r.point(ao,0),r.point(ao,-i),r.point(0,-i),r.point(-ao,-i),r.point(-ao,0),r.point(-ao,i);else if(po(t[0]-n[0])>oo){var u=t[0]0,i=po(n)>oo;function u(t,e){return yo(t)*yo(e)>n}function o(t,e,r){var i=[1,0,0],u=Jo(Zo(t),Zo(e)),o=Qo(u,u),a=u[0],c=o-a*a;if(!c)return!r&&t;var f=n*o/c,s=-n*a/c,l=Jo(i,u),h=ta(i,f);Ko(h,ta(u,s));var d=l,p=Qo(h,d),v=Qo(d,d),g=p*p-v*(Qo(h,h)-1);if(!(g<0)){var y=To(g),_=ta(d,(-p-y)/v);if(Ko(_,h),_=Go(_),!r)return _;var m,x=t[0],b=e[0],w=t[1],M=e[1];b0^_[1]<(po(_[0]-x)ao^(x<=_[0]&&_[0]<=b)){var k=ta(d,(-p+y)/v);return Ko(k,h),[_,Go(k)]}}}function a(n,e){var i=r?t:ao-t,u=0;return n<-i?u|=1:n>i&&(u|=2),e<-i?u|=4:e>i&&(u|=8),u}return yc(u,(function(t){var n,e,c,f,s;return{lineStart:function(){f=c=!1,s=1},point:function(l,h){var d,p=[l,h],v=u(l,h),g=r?v?0:a(l,h):v?a(l+(l<0?ao:-ao),h):0;if(!n&&(f=c=v)&&t.lineStart(),v!==c&&(!(d=o(n,p))||lc(n,d)||lc(p,d))&&(p[0]+=oo,p[1]+=oo,v=u(p[0],p[1])),v!==c)s=0,v?(t.lineStart(),d=o(p,n),t.point(d[0],d[1])):(d=o(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(i&&n&&r^v){var y;g&e||!(y=o(p,n,!0))||(s=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!v||n&&lc(n,p)||t.point(p[0],p[1]),n=p,c=v,e=g},lineEnd:function(){c&&t.lineEnd(),n=null},clean:function(){return s|(f&&c)<<1}}}),(function(n,r,i,u){ac(u,t,e,i,n,r)}),r?[0,-t]:[-ao,t-ao])},wc=function(t,n,e,r,i,u){var o,a=t[0],c=t[1],f=0,s=1,l=n[0]-a,h=n[1]-c;if(o=e-a,l||!(o>0)){if(o/=l,l<0){if(o0){if(o>s)return;o>f&&(f=o)}if(o=i-a,l||!(o<0)){if(o/=l,l<0){if(o>s)return;o>f&&(f=o)}else if(l>0){if(o0)){if(o/=h,h<0){if(o0){if(o>s)return;o>f&&(f=o)}if(o=u-c,h||!(o<0)){if(o/=h,h<0){if(o>s)return;o>f&&(f=o)}else if(h>0){if(o0&&(t[0]=a+f*l,t[1]=c+f*h),s<1&&(n[0]=a+s*l,n[1]=c+s*h),!0}}}}},Mc=1e9,Tc=-Mc;function Sc(t,n,e,i){function u(r,u){return t<=r&&r<=e&&n<=u&&u<=i}function o(r,u,o,c){var s=0,l=0;if(null==r||(s=a(r,o))!==(l=a(u,o))||f(r,u)<0^o>0)do{c.point(0===s||3===s?t:e,s>1?i:n)}while((s=(s+o+4)%4)!==l);else c.point(u[0],u[1])}function a(r,i){return po(r[0]-t)0?0:3:po(r[0]-e)0?2:1:po(r[1]-n)0?1:0:i>0?3:2}function c(t,n){return f(t.x,n.x)}function f(t,n){var e=a(t,1),r=a(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(a){var f,s,l,h,d,p,v,g,y,_,m,x=a,b=sc(),w={point:M,lineStart:function(){w.point=T,s&&s.push(l=[]),_=!0,y=!1,v=g=NaN},lineEnd:function(){f&&(T(h,d),p&&y&&b.rejoin(),f.push(b.result())),w.point=M,y&&x.lineEnd()},polygonStart:function(){x=b,f=[],s=[],m=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,r=s.length;ei&&(h-u)*(i-o)>(d-o)*(t-u)&&++n:d<=i&&(h-u)*(i-o)<(d-o)*(t-u)&&--n;return n}(),e=m&&n,u=(f=Object(r.n)(f)).length;(e||u)&&(a.polygonStart(),e&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),u&&dc(f,c,n,o,a),a.polygonEnd()),x=a,f=s=l=null}};function M(t,n){u(t,n)&&x.point(t,n)}function T(r,o){var a=u(r,o);if(s&&l.push([r,o]),_)h=r,d=o,p=a,_=!1,a&&(x.lineStart(),x.point(r,o));else if(a&&y)x.point(r,o);else{var c=[v=Math.max(Tc,Math.min(Mc,v)),g=Math.max(Tc,Math.min(Mc,g))],f=[r=Math.max(Tc,Math.min(Mc,r)),o=Math.max(Tc,Math.min(Mc,o))];wc(c,f,t,n,e,i)?(y||(x.lineStart(),x.point(c[0],c[1])),x.point(f[0],f[1]),a||x.lineEnd(),m=!1):a&&(x.lineStart(),x.point(r,o),m=!1)}v=r,g=o,y=a}return w}}var kc,Cc,Ac,Nc=function(){var t,n,e,r=0,i=0,u=960,o=500;return e={stream:function(e){return t&&n===e?t:t=Sc(r,i,u,o)(n=e)},extent:function(a){return arguments.length?(r=+a[0][0],i=+a[0][1],u=+a[1][0],o=+a[1][1],t=n=null,e):[[r,i],[u,o]]}}},Ec=eo(),zc={sphere:No,point:No,lineStart:function(){zc.point=Oc,zc.lineEnd=Pc},lineEnd:No,polygonStart:No,polygonEnd:No};function Pc(){zc.point=zc.lineEnd=No}function Oc(t,n){kc=t*=ho,Cc=wo(n*=ho),Ac=yo(n),zc.point=Rc}function Rc(t,n){t*=ho;var e=wo(n*=ho),r=yo(n),i=po(t-kc),u=yo(i),o=r*wo(i),a=Ac*e-Cc*r*u,c=Cc*e+Ac*r*u;Ec.add(go(To(o*o+a*a),c)),kc=t,Cc=e,Ac=r}var Lc=function(t){return Ec.reset(),jo(t,zc),+Ec},qc=[null,null],Uc={type:"LineString",coordinates:qc},Dc=function(t,n){return qc[0]=t,qc[1]=n,Lc(Uc)},Fc={Feature:function(t,n){return Ic(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++roo})).map(f)).concat(Object(r.s)(_o(o/p)*p,u,p).filter((function(t){return po(t%g)>oo})).map(s))}return _.lines=function(){return m().map((function(t){return{type:"LineString",coordinates:t}}))},_.outline=function(){return{type:"Polygon",coordinates:[l(i).concat(h(a).slice(1),l(e).reverse().slice(1),h(c).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.extentMajor(t).extentMinor(t):_.extentMinor()},_.extentMajor=function(t){return arguments.length?(i=+t[0][0],e=+t[1][0],c=+t[0][1],a=+t[1][1],i>e&&(t=i,i=e,e=t),c>a&&(t=c,c=a,a=t),_.precision(y)):[[i,c],[e,a]]},_.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],u=+e[1][1],n>t&&(e=n,n=t,t=e),o>u&&(e=o,o=u,u=e),_.precision(y)):[[n,o],[t,u]]},_.step=function(t){return arguments.length?_.stepMajor(t).stepMinor(t):_.stepMinor()},_.stepMajor=function(t){return arguments.length?(v=+t[0],g=+t[1],_):[v,g]},_.stepMinor=function(t){return arguments.length?(d=+t[0],p=+t[1],_):[d,p]},_.precision=function(r){return arguments.length?(y=+r,f=$c(o,u,90),s=Gc(n,t,y),l=$c(c,a,90),h=Gc(i,e,y),_):y},_.extentMajor([[-180,-90+oo],[180,90-oo]]).extentMinor([[-180,-80-oo],[180,80+oo]])}function Qc(){return Zc()()}var Jc,Kc,tf,nf,ef=function(t,n){var e=t[0]*ho,r=t[1]*ho,i=n[0]*ho,u=n[1]*ho,o=yo(r),a=wo(r),c=yo(u),f=wo(u),s=o*yo(e),l=o*wo(e),h=c*yo(i),d=c*wo(i),p=2*Co(To(Ao(u-r)+o*c*Ao(i-e))),v=wo(p),g=p?function(t){var n=wo(t*=p)/v,e=wo(p-t)/v,r=e*s+n*h,i=e*l+n*d,u=e*a+n*f;return[go(i,r)*lo,go(u,To(r*r+i*i))*lo]}:function(){return[e*lo,r*lo]};return g.distance=p,g},rf=function(t){return t},uf=eo(),of=eo(),af={point:No,lineStart:No,lineEnd:No,polygonStart:function(){af.lineStart=cf,af.lineEnd=lf},polygonEnd:function(){af.lineStart=af.lineEnd=af.point=No,uf.add(po(of)),of.reset()},result:function(){var t=uf/2;return uf.reset(),t}};function cf(){af.point=ff}function ff(t,n){af.point=sf,Jc=tf=t,Kc=nf=n}function sf(t,n){of.add(nf*t-tf*n),tf=t,nf=n}function lf(){sf(Jc,Kc)}var hf,df,pf,vf,gf=af,yf=1/0,_f=yf,mf=-yf,xf=mf,bf={point:function(t,n){tmf&&(mf=t),n<_f&&(_f=n),n>xf&&(xf=n)},lineStart:No,lineEnd:No,polygonStart:No,polygonEnd:No,result:function(){var t=[[yf,_f],[mf,xf]];return mf=xf=-(_f=yf=1/0),t}},wf=0,Mf=0,Tf=0,Sf=0,kf=0,Cf=0,Af=0,Nf=0,Ef=0,zf={point:Pf,lineStart:Of,lineEnd:qf,polygonStart:function(){zf.lineStart=Uf,zf.lineEnd=Df},polygonEnd:function(){zf.point=Pf,zf.lineStart=Of,zf.lineEnd=qf},result:function(){var t=Ef?[Af/Ef,Nf/Ef]:Cf?[Sf/Cf,kf/Cf]:Tf?[wf/Tf,Mf/Tf]:[NaN,NaN];return wf=Mf=Tf=Sf=kf=Cf=Af=Nf=Ef=0,t}};function Pf(t,n){wf+=t,Mf+=n,++Tf}function Of(){zf.point=Rf}function Rf(t,n){zf.point=Lf,Pf(pf=t,vf=n)}function Lf(t,n){var e=t-pf,r=n-vf,i=To(e*e+r*r);Sf+=i*(pf+t)/2,kf+=i*(vf+n)/2,Cf+=i,Pf(pf=t,vf=n)}function qf(){zf.point=Pf}function Uf(){zf.point=Ff}function Df(){jf(hf,df)}function Ff(t,n){zf.point=jf,Pf(hf=pf=t,df=vf=n)}function jf(t,n){var e=t-pf,r=n-vf,i=To(e*e+r*r);Sf+=i*(pf+t)/2,kf+=i*(vf+n)/2,Cf+=i,Af+=(i=vf*t-pf*n)*(pf+t),Nf+=i*(vf+n),Ef+=3*i,Pf(pf=t,vf=n)}var If=zf;function Hf(t){this._context=t}Hf.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,so)}},result:No};var Yf,Bf,Vf,Xf,Wf,$f=eo(),Gf={point:No,lineStart:function(){Gf.point=Zf},lineEnd:function(){Yf&&Qf(Bf,Vf),Gf.point=No},polygonStart:function(){Yf=!0},polygonEnd:function(){Yf=null},result:function(){var t=+$f;return $f.reset(),t}};function Zf(t,n){Gf.point=Qf,Bf=Xf=t,Vf=Wf=n}function Qf(t,n){Xf-=t,Wf-=n,$f.add(To(Xf*Xf+Wf*Wf)),Xf=t,Wf=n}var Jf=Gf;function Kf(){this._string=[]}function ts(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}Kf.prototype={_radius:4.5,_circle:ts(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=ts(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var ns=function(t,n){var e,r,i=4.5;function u(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),jo(t,e(r))),r.result()}return u.area=function(t){return jo(t,e(gf)),gf.result()},u.measure=function(t){return jo(t,e(Jf)),Jf.result()},u.bounds=function(t){return jo(t,e(bf)),bf.result()},u.centroid=function(t){return jo(t,e(If)),If.result()},u.projection=function(n){return arguments.length?(e=null==n?(t=null,rf):(t=n).stream,u):t},u.context=function(t){return arguments.length?(r=null==t?(n=null,new Kf):new Hf(n=t),"function"!=typeof i&&r.pointRadius(i),u):n},u.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),u):i},u.projection(t).context(n)},es=function(t){return{stream:rs(t)}};function rs(t){return function(n){var e=new is;for(var r in t)e[r]=t[r];return e.stream=n,e}}function is(){}function us(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),jo(e,t.stream(bf)),n(bf.result()),null!=r&&t.clipExtent(r),t}function os(t,n,e){return us(t,(function(e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],u=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),o=+n[0][0]+(r-u*(e[1][0]+e[0][0]))/2,a=+n[0][1]+(i-u*(e[1][1]+e[0][1]))/2;t.scale(150*u).translate([o,a])}),e)}function as(t,n,e){return os(t,[[0,0],n],e)}function cs(t,n,e){return us(t,(function(e){var r=+n,i=r/(e[1][0]-e[0][0]),u=(r-i*(e[1][0]+e[0][0]))/2,o=-i*e[0][1];t.scale(150*i).translate([u,o])}),e)}function fs(t,n,e){return us(t,(function(e){var r=+n,i=r/(e[1][1]-e[0][1]),u=-i*e[0][0],o=(r-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([u,o])}),e)}is.prototype={constructor:is,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var ss=16,ls=yo(30*ho),hs=function(t,n){return+n?function(t,n){function e(r,i,u,o,a,c,f,s,l,h,d,p,v,g){var y=f-r,_=s-i,m=y*y+_*_;if(m>4*n&&v--){var x=o+h,b=a+d,w=c+p,M=To(x*x+b*b+w*w),T=Co(w/=M),S=po(po(w)-1)n||po((y*N+_*E)/m-.5)>.3||o*h+a*d+c*p2?t[2]%360*ho:0,A()):[g*lo,y*lo,_*lo]},S.precision=function(t){return arguments.length?(T=hs(C,M=t*t),N()):To(M)},S.fitExtent=function(t,n){return os(S,t,n)},S.fitSize=function(t,n){return as(S,t,n)},S.fitWidth=function(t,n){return cs(S,t,n)},S.fitHeight=function(t,n){return fs(S,t,n)},function(){return n=t.apply(this,arguments),S.invert=n.invert&&k,A()}}function gs(t){var n=0,e=ao/3,r=vs(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*ho,e=t[1]*ho):[n*lo,e*lo]},i}function ys(t,n){var e=wo(t),r=(e+wo(n))/2;if(po(r)=.12&&i<.234&&r>=-.425&&r<-.214?a:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:o).invert(t)},s.stream=function(e){return t&&n===e?t:(r=[o.stream(n=e),a.stream(e),c.stream(e)],i=r.length,t={point:function(t,n){for(var e=-1;++e0?n<-co+oo&&(n=-co+oo):n>co-oo&&(n=co-oo);var e=i/bo(Es(n),r);return[e*wo(r*t),i-e*yo(r*t)]}return u.invert=function(t,n){var e=i-n,u=Mo(r)*To(t*t+e*e);return[go(t,po(e))/r*Mo(e),2*vo(bo(i/u,1/r))-co]},u}var Ps=function(){return gs(zs).scale(109.5).parallels([30,30])};function Os(t,n){return[t,n]}Os.invert=Os;var Rs=function(){return ps(Os).scale(152.63)};function Ls(t,n){var e=yo(t),r=t===n?wo(t):(e-yo(n))/(n-t),i=e/r+t;if(po(r)oo&&--i>0);return[t/(.8707+(u=r*r)*(u*(u*u*u*(.003971-.001529*u)-.013791)-.131979)),r]};var Hs=function(){return ps(Is).scale(175.295)};function Ys(t,n){return[yo(n)*wo(t),wo(n)]}Ys.invert=ws(Co);var Bs=function(){return ps(Ys).scale(249.5).clipAngle(90+oo)};function Vs(t,n){var e=yo(n),r=1+yo(t)*e;return[e*wo(t)/r,wo(n)/r]}Vs.invert=ws((function(t){return 2*vo(t)}));var Xs=function(){return ps(Vs).scale(250).clipAngle(142)};function Ws(t,n){return[xo(So((co+n)/2)),-t]}Ws.invert=function(t,n){return[-n,2*vo(mo(t))-co]};var $s=function(){var t=Ns(Ws),n=t.center,e=t.rotate;return t.center=function(t){return arguments.length?n([-t[1],t[0]]):[(t=n())[1],-t[0]]},t.rotate=function(t){return arguments.length?e([t[0],t[1],t.length>2?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)};function Gs(t,n){return t.parent===n.parent?1:2}function Zs(t,n){return t+n.x}function Qs(t,n){return Math.max(t,n.y)}var Js=function(){var t=Gs,n=1,e=1,r=!1;function i(i){var u,o=0;i.eachAfter((function(n){var e=n.children;e?(n.x=function(t){return t.reduce(Zs,0)/t.length}(e),n.y=function(t){return 1+t.reduce(Qs,0)}(e)):(n.x=u?o+=t(n,u):0,n.y=0,u=n)}));var a=function(t){for(var n;n=t.children;)t=n[0];return t}(i),c=function(t){for(var n;n=t.children;)t=n[n.length-1];return t}(i),f=a.x-t(a,c)/2,s=c.x+t(c,a)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*n,t.y=(i.y-t.y)*e}:function(t){t.x=(t.x-f)/(s-f)*n,t.y=(1-(i.y?t.y/i.y:1))*e})}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i};function Ks(t){var n=0,e=t.children,r=e&&e.length;if(r)for(;--r>=0;)n+=e[r].value;else n=1;t.value=n}function tl(t,n){var e,r,i,u,o,a=new il(t),c=+t.value&&(a.value=t.value),f=[a];for(null==n&&(n=nl);e=f.pop();)if(c&&(e.value=+e.data.value),(i=n(e.data))&&(o=i.length))for(e.children=new Array(o),u=o-1;u>=0;--u)f.push(r=e.children[u]=new il(i[u])),r.parent=e,r.depth=e.depth+1;return a.eachBefore(rl)}function nl(t){return t.children}function el(t){t.data=t.data.data}function rl(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function il(t){this.data=t,this.depth=this.height=0,this.parent=null}il.prototype=tl.prototype={constructor:il,count:function(){return this.eachAfter(Ks)},each:function(t){var n,e,r,i,u=this,o=[u];do{for(n=o.reverse(),o=[];u=n.pop();)if(t(u),e=u.children)for(r=0,i=e.length;r=0;--e)i.push(n[e]);return this},sum:function(t){return this.eachAfter((function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e}))},sort:function(t){return this.eachBefore((function(n){n.children&&n.children.sort(t)}))},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){var t=[];return this.each((function(n){t.push(n)})),t},leaves:function(){var t=[];return this.eachBefore((function(n){n.children||t.push(n)})),t},links:function(){var t=this,n=[];return t.each((function(e){e!==t&&n.push({source:e.parent,target:e})})),n},copy:function(){return tl(this).eachBefore(el)}};var ul=Array.prototype.slice,ol=function(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(ul.call(t))).length,u=[];r0&&e*e>r*r+i*i}function sl(t,n){for(var e=0;ee*e+r*r}function gl(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,u=(n.y*e.r+e.y*n.r)/r;return i*i+u*u}function yl(t){this._=t,this.next=null,this.previous=null}function _l(t){if(!(i=t.length))return 0;var n,e,r,i,u,o,a,c,f,s,l;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;pl(e,n,r=t[2]),n=new yl(n),e=new yl(e),r=new yl(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(a=3;a0)throw new Error("cycle");return u}return e.id=function(n){return arguments.length?(t=xl(n),e):t},e.parentId=function(t){return arguments.length?(n=xl(t),e):n},e};function Ul(t,n){return t.parent===n.parent?1:2}function Dl(t){var n=t.children;return n?n[0]:t.t}function Fl(t){var n=t.children;return n?n[n.length-1]:t.t}function jl(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function Il(t,n,e){return t.a.parent===n.parent?t.a:e}function Hl(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}Hl.prototype=Object.create(il.prototype);var Yl=function(){var t=Ul,n=1,e=1,r=null;function i(i){var c=function(t){for(var n,e,r,i,u,o=new Hl(t,0),a=[o];n=a.pop();)if(r=n._.children)for(n.children=new Array(u=r.length),i=u-1;i>=0;--i)a.push(e=n.children[i]=new Hl(r[i],i)),e.parent=n;return(o.parent=new Hl(null,0)).children=[o],o}(i);if(c.eachAfter(u),c.parent.m=-c.z,c.eachBefore(o),r)i.eachBefore(a);else{var f=i,s=i,l=i;i.eachBefore((function(t){t.xs.x&&(s=t),t.depth>l.depth&&(l=t)}));var h=f===s?1:t(f,s)/2,d=h-f.x,p=n/(s.x+h+d),v=e/(l.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*v}))}return i}function u(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,u=i.length;--u>=0;)(n=i[u]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var u=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-u):n.z=u}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,u=n,o=n,a=e,c=u.parent.children[0],f=u.m,s=o.m,l=a.m,h=c.m;a=Fl(a),u=Dl(u),a&&u;)c=Dl(c),(o=Fl(o)).a=n,(i=a.z+l-u.z-f+t(a._,u._))>0&&(jl(Il(a,n,r),n,i),f+=i,s+=i),l+=a.m,f+=u.m,h+=c.m,s+=o.m;a&&!Fl(o)&&(o.t=a,o.m+=l-s),u&&!Dl(c)&&(c.t=u,c.m+=f-h,r=n)}return r}(n,i,n.parent.A||r[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function a(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},Bl=function(t,n,e,r,i){for(var u,o=t.children,a=-1,c=o.length,f=t.value&&(i-e)/t.value;++ah&&(h=a),g=s*s*v,(d=Math.max(h/g,g/l))>p){s-=a;break}p=d}y.push(o={value:s,dice:c1?n:1)},e}(Vl),$l=function(){var t=Wl,n=!1,e=1,r=1,i=[0],u=bl,o=bl,a=bl,c=bl,f=bl;function s(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(l),i=[0],n&&t.eachBefore(Al),t}function l(n){var e=i[n.depth],r=n.x0+e,s=n.y0+e,l=n.x1-e,h=n.y1-e;l=e-1){var s=a[n];return s.x0=i,s.y0=u,s.x1=o,void(s.y1=c)}for(var l=f[n],h=r/2+l,d=n+1,p=e-1;d>>1;f[v]c-u){var _=(i*y+o*g)/r;t(n,d,g,i,u,_,c),t(d,e,y,_,u,o,c)}else{var m=(u*y+c*g)/r;t(n,d,g,i,u,o,m),t(d,e,y,i,m,o,c)}}(0,c,t.value,n,e,r,i)},Zl=function(t,n,e,r,i){(1&t.depth?Bl:Nl)(t,n,e,r,i)},Ql=function t(n){function e(t,e,r,i,u){if((o=t._squarify)&&o.ratio===n)for(var o,a,c,f,s,l=-1,h=o.length,d=t.value;++l1?n:1)},e}(Vl),Jl=function(t){for(var n,e=-1,r=t.length,i=t[r-1],u=0;++e1&&th(t[e[r-2]],t[e[r-1]],t[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}var rh=function(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n=0;--n)f.push(t[r[u[n]][2]]);for(n=+a;na!=f>a&&o<(c-e)*(a-r)/(f-r)+e&&(s=!s),c=e,f=r;return s},uh=function(t){for(var n,e,r=-1,i=t.length,u=t[i-1],o=u[0],a=u[1],c=0;++r=0;)if((e=t._tasks[r])&&(t._tasks[r]=null,e.abort))try{e.abort()}catch(n){}t._active=NaN,hh(t)}function hh(t){if(!t._active&&t._call){var n=t._data;t._data=void 0,t._call(t._error,n)}}function dh(t){if(null==t)t=1/0;else if(!((t=+t)>=1))throw new Error("invalid concurrency");return new ch(t)}ch.prototype=dh.prototype={constructor:ch,defer:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("defer after await");if(null!=this._error)return this;var n=oh.call(arguments,1);return n.push(t),++this._waiting,this._tasks.push(n),fh(this),this},abort:function(){return null==this._error&&lh(this,new Error("abort")),this},await:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=function(n,e){t.apply(null,[n].concat(e))},hh(this),this},awaitAll:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=t,hh(this),this}};var ph=function(){return Math.random()},vh=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(ph),gh=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var u;if(null!=r)u=r,r=null;else do{r=2*n()-1,u=2*n()-1,i=r*r+u*u}while(!i||i>1);return t+e*u*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(ph),yh=function t(n){function e(){var t=gh.source(n).apply(this,arguments);return function(){return Math.exp(t())}}return e.source=t,e}(ph),_h=function t(n){function e(t){return function(){for(var e=0,r=0;r=200&&r<300||304===r){if(i)try{n=i.call(e,c)}catch(t){return void o.call("error",e,t)}else n=c;o.call("load",e,n)}else o.call("error",e,t)}if("undefined"==typeof XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(t)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=c.ontimeout=h:c.onreadystatechange=function(t){c.readyState>3&&h(t)},c.onprogress=function(t){o.call("progress",e,t)},e={header:function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?a.get(t):(null==n?a.remove(t):a.set(t,n+""),e)},mimeType:function(t){return arguments.length?(r=null==t?null:t+"",e):r},responseType:function(t){return arguments.length?(u=t,e):u},timeout:function(t){return arguments.length?(l=+t,e):l},user:function(t){return arguments.length<1?f:(f=null==t?null:t+"",e)},password:function(t){return arguments.length<1?s:(s=null==t?null:t+"",e)},response:function(t){return i=t,e},get:function(t,n){return e.send("GET",t,n)},post:function(t,n){return e.send("POST",t,n)},send:function(n,i,h){return c.open(n,t,!0,f,s),null==r||a.has("accept")||a.set("accept",r+",*/*"),c.setRequestHeader&&a.each((function(t,n){c.setRequestHeader(n,t)})),null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),l>0&&(c.timeout=l),null==h&&"function"==typeof i&&(h=i,i=null),null!=h&&1===h.length&&(h=function(t){return function(n,e){t(null==n?e:null)}}(h)),null!=h&&e.on("error",h).on("load",(function(t){h(null,t)})),o.call("beforesend",e,c),c.send(null==i?null:i),e},abort:function(){return c.abort(),e},on:function(){var t=o.on.apply(o,arguments);return t===o?e:t}},null!=n){if("function"!=typeof n)throw new Error("invalid callback: "+n);return e.get(n)}return e},wh=function(t,n){return function(e,r){var i=bh(e).mimeType(t).response(n);if(null!=r){if("function"!=typeof r)throw new Error("invalid callback: "+r);return i.get(r)}return i}},Mh=wh("text/html",(function(t){return document.createRange().createContextualFragment(t.responseText)})),Th=wh("application/json",(function(t){return JSON.parse(t.responseText)})),Sh=wh("text/plain",(function(t){return t.responseText})),kh=wh("application/xml",(function(t){var n=t.responseXML;if(!n)throw new Error("parse error");return n})),Ch=function(t,n){return function(e,r,i){arguments.length<3&&(i=r,r=null);var u=bh(e).mimeType(t);return u.row=function(t){return arguments.length?u.response(function(t,n){return function(e){return t(e.responseText,n)}}(n,r=t)):r},u.row(r),i?u.get(i):u}},Ah=Ch("text/csv",ru),Nh=Ch("text/tab-separated-values",cu),Eh=Array.prototype,zh=Eh.map,Ph=Eh.slice,Oh={name:"implicit"};function Rh(t){var n=Object($i.c)(),e=[],r=Oh;function i(i){var u=i+"",o=n.get(u);if(!o){if(r!==Oh)return r;n.set(u,o=e.push(i))}return t[(o-1)%t.length]}return t=null==t?[]:Ph.call(t),i.domain=function(t){if(!arguments.length)return e.slice();e=[],n=Object($i.c)();for(var r,u,o=-1,a=t.length;++o2?Hh:Ih,r=i=null,s}function s(n){return(r||(r=e(u,o,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=n?0:t>=e?1:r(t)}}}(t):t,a)))(+n)}return s.invert=function(t){return(i||(i=e(o,u,jh,c?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}(n):n)))(+t)},s.domain=function(t){return arguments.length?(u=zh.call(t,Dh),f()):u.slice()},s.range=function(t){return arguments.length?(o=Ph.call(t),f()):o.slice()},s.rangeRound=function(t){return o=Ph.call(t),a=ue,f()},s.clamp=function(t){return arguments.length?(c=!!t,f()):c},s.interpolate=function(t){return arguments.length?(a=t,f()):a},f()}var Vh=function(t,n,e){var i,u=t[0],o=t[t.length-1],a=Object(r.A)(u,o,null==n?10:n);switch((e=Bu(null==e?",f":e)).type){case"s":var c=Math.max(Math.abs(u),Math.abs(o));return null!=e.precision||isNaN(i=to(a,c))||(e.precision=i),$u(e,c);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(i=no(a,Math.max(Math.abs(u),Math.abs(o))))||(e.precision=i-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(i=Ku(a))||(e.precision=i-2*("%"===e.type))}return Wu(e)};function Xh(t){var n=t.domain;return t.ticks=function(t){var e=n();return Object(r.B)(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return Vh(n(),t,e)},t.nice=function(e){null==e&&(e=10);var i,u=n(),o=0,a=u.length-1,c=u[o],f=u[a];return f0?(c=Math.floor(c/i)*i,f=Math.ceil(f/i)*i,i=Object(r.z)(c,f,e)):i<0&&(c=Math.ceil(c*i)/i,f=Math.floor(f*i)/i,i=Object(r.z)(c,f,e)),i>0?(u[o]=Math.floor(c/i)*i,u[a]=Math.ceil(f/i)*i,n(u)):i<0&&(u[o]=Math.ceil(c*i)/i,u[a]=Math.floor(f*i)/i,n(u)),t},t}function Wh(){var t=Bh(jh,Kn);return t.copy=function(){return Yh(t,Wh())},Xh(t)}function $h(){var t=[0,1];function n(t){return+t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=zh.call(e,Dh),n):t.slice()},n.copy=function(){return $h().domain(t)},Xh(n)}var Gh=function(t,n){var e,r=0,i=(t=t.slice()).length-1,u=t[r],o=t[i];return o0){for(;df)break;g.push(h)}}else for(;d=1;--l)if(!((h=s*l)f)break;g.push(h)}}else g=Object(r.B)(d,p,Math.min(p-d,v)).map(u);return o?g.reverse():g},t.tickFormat=function(n,r){if(null==r&&(r=10===e?".0e":","),"function"!=typeof r&&(r=Wu(r)),n===1/0)return r;null==n&&(n=10);var o=Math.max(1,e*n/t.ticks().length);return function(t){var n=t/u(Math.round(i(t)));return n*e0?e[i-1]:t[0],i=e?[i[e-1],n]:[i[o-1],i[o]]},o.copy=function(){return ad().domain([t,n]).range(u)},Xh(o)}function cd(){var t=[.5],n=[0,1],e=1;function i(i){if(i<=i)return n[Object(r.b)(t,i,0,e)]}return i.domain=function(r){return arguments.length?(t=Ph.call(r),e=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(r){return arguments.length?(n=Ph.call(r),e=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.copy=function(){return cd().domain(t).range(n)},i}var fd=new Date,sd=new Date;function ld(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n0))return a;do{a.push(o=new Date(+e)),n(e,u),t(e)}while(o=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););}))},e&&(i.count=function(n,r){return fd.setTime(+n),sd.setTime(+r),t(fd),t(sd),Math.floor(e(fd,sd))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var hd=ld((function(){}),(function(t,n){t.setTime(+t+n)}),(function(t,n){return n-t}));hd.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?ld((function(n){n.setTime(Math.floor(n/t)*t)}),(function(n,e){n.setTime(+n+e*t)}),(function(n,e){return(e-n)/t})):hd:null};var dd=hd,pd=hd.range,vd=6e4,gd=6048e5,yd=ld((function(t){t.setTime(1e3*Math.floor(t/1e3))}),(function(t,n){t.setTime(+t+1e3*n)}),(function(t,n){return(n-t)/1e3}),(function(t){return t.getUTCSeconds()})),_d=yd,md=yd.range,xd=ld((function(t){t.setTime(Math.floor(t/vd)*vd)}),(function(t,n){t.setTime(+t+n*vd)}),(function(t,n){return(n-t)/vd}),(function(t){return t.getMinutes()})),bd=xd,wd=xd.range,Md=ld((function(t){var n=t.getTimezoneOffset()*vd%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getHours()})),Td=Md,Sd=Md.range,kd=ld((function(t){t.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*vd)/864e5}),(function(t){return t.getDate()-1})),Cd=kd,Ad=kd.range;function Nd(t){return ld((function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+7*n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*vd)/gd}))}var Ed=Nd(0),zd=Nd(1),Pd=Nd(2),Od=Nd(3),Rd=Nd(4),Ld=Nd(5),qd=Nd(6),Ud=Ed.range,Dd=zd.range,Fd=Pd.range,jd=Od.range,Id=Rd.range,Hd=Ld.range,Yd=qd.range,Bd=ld((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,n){t.setMonth(t.getMonth()+n)}),(function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),Vd=Bd,Xd=Bd.range,Wd=ld((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n)}),(function(t,n){return n.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Wd.every=function(t){return isFinite(t=Math.floor(t))&&t>0?ld((function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)}),(function(n,e){n.setFullYear(n.getFullYear()+e*t)})):null};var $d=Wd,Gd=Wd.range,Zd=ld((function(t){t.setUTCSeconds(0,0)}),(function(t,n){t.setTime(+t+n*vd)}),(function(t,n){return(n-t)/vd}),(function(t){return t.getUTCMinutes()})),Qd=Zd,Jd=Zd.range,Kd=ld((function(t){t.setUTCMinutes(0,0,0)}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getUTCHours()})),tp=Kd,np=Kd.range,ep=ld((function(t){t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+n)}),(function(t,n){return(n-t)/864e5}),(function(t){return t.getUTCDate()-1})),rp=ep,ip=ep.range;function up(t){return ld((function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+7*n)}),(function(t,n){return(n-t)/gd}))}var op=up(0),ap=up(1),cp=up(2),fp=up(3),sp=up(4),lp=up(5),hp=up(6),dp=op.range,pp=ap.range,vp=cp.range,gp=fp.range,yp=sp.range,_p=lp.range,mp=hp.range,xp=ld((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCMonth(t.getUTCMonth()+n)}),(function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),bp=xp,wp=xp.range,Mp=ld((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)}),(function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));Mp.every=function(t){return isFinite(t=Math.floor(t))&&t>0?ld((function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)}),(function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)})):null};var Tp=Mp,Sp=Mp.range;function kp(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Cp(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Ap(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function Np(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,u=t.days,o=t.shortDays,a=t.months,c=t.shortMonths,f=Ip(i),s=Hp(i),l=Ip(u),h=Hp(u),d=Ip(o),p=Hp(o),v=Ip(a),g=Hp(a),y=Ip(c),_=Hp(c),m={a:function(t){return o[t.getDay()]},A:function(t){return u[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:cv,e:cv,f:dv,H:fv,I:sv,j:lv,L:hv,m:pv,M:vv,p:function(t){return i[+(t.getHours()>=12)]},Q:Yv,s:Bv,S:gv,u:yv,U:_v,V:mv,w:xv,W:bv,x:null,X:null,y:wv,Y:Mv,Z:Tv,"%":Hv},x={a:function(t){return o[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:Sv,e:Sv,f:Ev,H:kv,I:Cv,j:Av,L:Nv,m:zv,M:Pv,p:function(t){return i[+(t.getUTCHours()>=12)]},Q:Yv,s:Bv,S:Ov,u:Rv,U:Lv,V:qv,w:Uv,W:Dv,x:null,X:null,y:Fv,Y:jv,Z:Iv,"%":Hv},b={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=l.exec(n.slice(e));return r?(t.w=h[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=y.exec(n.slice(e));return r?(t.m=_[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=g[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return T(t,n,e,r)},d:Jp,e:Jp,f:iv,H:tv,I:tv,j:Kp,L:rv,m:Qp,M:nv,p:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.p=s[r[0].toLowerCase()],e+r[0].length):-1},Q:ov,s:av,S:ev,u:Bp,U:Vp,V:Xp,w:Yp,W:Wp,x:function(t,n,r){return T(t,e,n,r)},X:function(t,n,e){return T(t,r,n,e)},y:Gp,Y:$p,Z:Zp,"%":uv};function w(t,n){return function(e){var r,i,u,o=[],a=-1,c=0,f=t.length;for(e instanceof Date||(e=new Date(+e));++a53)return null;"w"in u||(u.w=1),"Z"in u?(r=(i=(r=Cp(Ap(u.y))).getUTCDay())>4||0===i?ap.ceil(r):ap(r),r=rp.offset(r,7*(u.V-1)),u.y=r.getUTCFullYear(),u.m=r.getUTCMonth(),u.d=r.getUTCDate()+(u.w+6)%7):(r=(i=(r=n(Ap(u.y))).getDay())>4||0===i?zd.ceil(r):zd(r),r=Cd.offset(r,7*(u.V-1)),u.y=r.getFullYear(),u.m=r.getMonth(),u.d=r.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),i="Z"in u?Cp(Ap(u.y)).getUTCDay():n(Ap(u.y)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(i+5)%7:u.w+7*u.U-(i+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,Cp(u)):n(u)}}function T(t,n,e,r){for(var i,u,o=0,a=n.length,c=e.length;o=c)return-1;if(37===(i=n.charCodeAt(o++))){if(i=n.charAt(o++),!(u=b[i in Lp?n.charAt(o++):i])||(r=u(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return m.x=w(e,m),m.X=w(r,m),m.c=w(n,m),x.x=w(e,x),x.X=w(r,x),x.c=w(n,x),{format:function(t){var n=w(t+="",m);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",kp);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",x);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t,Cp);return n.toString=function(){return t},n}}}var Ep,zp,Pp,Op,Rp,Lp={"-":"",_:" ",0:"0"},qp=/^\s*\d+/,Up=/^%/,Dp=/[\\^$*+?|[\]().{}]/g;function Fp(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",u=i.length;return r+(u68?1900:2e3),e+r[0].length):-1}function Zp(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Qp(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function Jp(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function Kp(t,n,e){var r=qp.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function tv(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function nv(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function ev(t,n,e){var r=qp.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function rv(t,n,e){var r=qp.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function iv(t,n,e){var r=qp.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function uv(t,n,e){var r=Up.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function ov(t,n,e){var r=qp.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function av(t,n,e){var r=qp.exec(n.slice(e));return r?(t.Q=1e3*+r[0],e+r[0].length):-1}function cv(t,n){return Fp(t.getDate(),n,2)}function fv(t,n){return Fp(t.getHours(),n,2)}function sv(t,n){return Fp(t.getHours()%12||12,n,2)}function lv(t,n){return Fp(1+Cd.count($d(t),t),n,3)}function hv(t,n){return Fp(t.getMilliseconds(),n,3)}function dv(t,n){return hv(t,n)+"000"}function pv(t,n){return Fp(t.getMonth()+1,n,2)}function vv(t,n){return Fp(t.getMinutes(),n,2)}function gv(t,n){return Fp(t.getSeconds(),n,2)}function yv(t){var n=t.getDay();return 0===n?7:n}function _v(t,n){return Fp(Ed.count($d(t),t),n,2)}function mv(t,n){var e=t.getDay();return t=e>=4||0===e?Rd(t):Rd.ceil(t),Fp(Rd.count($d(t),t)+(4===$d(t).getDay()),n,2)}function xv(t){return t.getDay()}function bv(t,n){return Fp(zd.count($d(t),t),n,2)}function wv(t,n){return Fp(t.getFullYear()%100,n,2)}function Mv(t,n){return Fp(t.getFullYear()%1e4,n,4)}function Tv(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Fp(n/60|0,"0",2)+Fp(n%60,"0",2)}function Sv(t,n){return Fp(t.getUTCDate(),n,2)}function kv(t,n){return Fp(t.getUTCHours(),n,2)}function Cv(t,n){return Fp(t.getUTCHours()%12||12,n,2)}function Av(t,n){return Fp(1+rp.count(Tp(t),t),n,3)}function Nv(t,n){return Fp(t.getUTCMilliseconds(),n,3)}function Ev(t,n){return Nv(t,n)+"000"}function zv(t,n){return Fp(t.getUTCMonth()+1,n,2)}function Pv(t,n){return Fp(t.getUTCMinutes(),n,2)}function Ov(t,n){return Fp(t.getUTCSeconds(),n,2)}function Rv(t){var n=t.getUTCDay();return 0===n?7:n}function Lv(t,n){return Fp(op.count(Tp(t),t),n,2)}function qv(t,n){var e=t.getUTCDay();return t=e>=4||0===e?sp(t):sp.ceil(t),Fp(sp.count(Tp(t),t)+(4===Tp(t).getUTCDay()),n,2)}function Uv(t){return t.getUTCDay()}function Dv(t,n){return Fp(ap.count(Tp(t),t),n,2)}function Fv(t,n){return Fp(t.getUTCFullYear()%100,n,2)}function jv(t,n){return Fp(t.getUTCFullYear()%1e4,n,4)}function Iv(){return"+0000"}function Hv(){return"%"}function Yv(t){return+t}function Bv(t){return Math.floor(+t/1e3)}function Vv(t){return Ep=Np(t),zp=Ep.format,Pp=Ep.parse,Op=Ep.utcFormat,Rp=Ep.utcParse,Ep}Vv({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"]});var Xv=Date.prototype.toISOString?function(t){return t.toISOString()}:Op("%Y-%m-%dT%H:%M:%S.%LZ"),Wv=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:Rp("%Y-%m-%dT%H:%M:%S.%LZ"),$v=1e3,Gv=60*$v,Zv=60*Gv,Qv=24*Zv,Jv=7*Qv,Kv=30*Qv,tg=365*Qv;function ng(t){return new Date(t)}function eg(t){return t instanceof Date?+t:+new Date(+t)}function rg(t,n,e,i,u,o,a,c,f){var s=Bh(jh,Kn),l=s.invert,h=s.domain,d=f(".%L"),p=f(":%S"),v=f("%I:%M"),g=f("%I %p"),y=f("%a %d"),_=f("%b %d"),m=f("%B"),x=f("%Y"),b=[[a,1,$v],[a,5,5*$v],[a,15,15*$v],[a,30,30*$v],[o,1,Gv],[o,5,5*Gv],[o,15,15*Gv],[o,30,30*Gv],[u,1,Zv],[u,3,3*Zv],[u,6,6*Zv],[u,12,12*Zv],[i,1,Qv],[i,2,2*Qv],[e,1,Jv],[n,1,Kv],[n,3,3*Kv],[t,1,tg]];function w(r){return(a(r)1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return pg.h=360*t-100,pg.s=1.5-1.5*n,pg.l=.8-.9*n,pg+""};function gg(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var yg=gg(og("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),_g=gg(og("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),mg=gg(og("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),xg=gg(og("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function bg(t){var n=0,e=1,r=!1;function i(i){var u=(i-n)/(e-n);return t(r?Math.max(0,Math.min(1,u)):u)}return i.domain=function(t){return arguments.length?(n=+t[0],e=+t[1],i):[n,e]},i.clamp=function(t){return arguments.length?(r=!!t,i):r},i.interpolator=function(n){return arguments.length?(t=n,i):t},i.copy=function(){return bg(t).domain([n,e]).clamp(r)},Xh(i)}var wg=e(5),Mg=function(t){return function(){return t}};function Tg(t){return t[0]}function Sg(t){return t[1]}function kg(){this._=null}function Cg(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Ag(t,n){var e=n,r=n.R,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function Ng(t,n){var e=n,r=n.L,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function Eg(t){for(;t.L;)t=t.L;return t}kg.prototype={constructor:kg,insert:function(t,n){var e,r,i;if(t){if(n.P=t,n.N=t.N,t.N&&(t.N.P=n),t.N=n,t.R){for(t=t.R;t.L;)t=t.L;t.L=n}else t.R=n;e=t}else this._?(t=Eg(this._),n.P=null,n.N=t,t.P=t.L=n,e=t):(n.P=n.N=null,this._=n,e=null);for(n.L=n.R=null,n.U=e,n.C=!0,t=n;e&&e.C;)e===(r=e.U).L?(i=r.R)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.R&&(Ag(this,e),e=(t=e).U),e.C=!1,r.C=!0,Ng(this,r)):(i=r.L)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.L&&(Ng(this,e),e=(t=e).U),e.C=!1,r.C=!0,Ag(this,r)),e=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var n,e,r,i=t.U,u=t.L,o=t.R;if(e=u?o?Eg(o):u:o,i?i.L===t?i.L=e:i.R=e:this._=e,u&&o?(r=e.C,e.C=t.C,e.L=u,u.U=e,e!==o?(i=e.U,e.U=t.U,t=e.R,i.L=t,e.R=o,o.U=e):(e.U=i,i=e,t=e.R)):(r=t.C,t=e),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((n=i.R).C&&(n.C=!1,i.C=!0,Ag(this,i),n=i.R),n.L&&n.L.C||n.R&&n.R.C){n.R&&n.R.C||(n.L.C=!1,n.C=!0,Ng(this,n),n=i.R),n.C=i.C,i.C=n.R.C=!1,Ag(this,i),t=this._;break}}else if((n=i.L).C&&(n.C=!1,i.C=!0,Ng(this,i),n=i.L),n.L&&n.L.C||n.R&&n.R.C){n.L&&n.L.C||(n.R.C=!1,n.C=!0,Ag(this,n),n=i.L),n.C=i.C,i.C=n.L.C=!1,Ng(this,i),t=this._;break}n.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var zg=kg;function Pg(t,n,e,r){var i=[null,null],u=ty.push(i)-1;return i.left=t,i.right=n,e&&Rg(i,t,n,e),r&&Rg(i,n,t,r),Jg[t.index].halfedges.push(u),Jg[n.index].halfedges.push(u),i}function Og(t,n,e){var r=[n,e];return r.left=t,r}function Rg(t,n,e,r){t[0]||t[1]?t.left===e?t[1]=r:t[0]=r:(t[0]=r,t.left=n,t.right=e)}function Lg(t,n,e,r,i){var u,o=t[0],a=t[1],c=o[0],f=o[1],s=0,l=1,h=a[0]-c,d=a[1]-f;if(u=n-c,h||!(u>0)){if(u/=h,h<0){if(u0){if(u>l)return;u>s&&(s=u)}if(u=r-c,h||!(u<0)){if(u/=h,h<0){if(u>l)return;u>s&&(s=u)}else if(h>0){if(u0)){if(u/=d,d<0){if(u0){if(u>l)return;u>s&&(s=u)}if(u=i-f,d||!(u<0)){if(u/=d,d<0){if(u>l)return;u>s&&(s=u)}else if(d>0){if(u0||l<1)||(s>0&&(t[0]=[c+s*h,f+s*d]),l<1&&(t[1]=[c+l*h,f+l*d]),!0)}}}}}function qg(t,n,e,r,i){var u=t[1];if(u)return!0;var o,a,c=t[0],f=t.left,s=t.right,l=f[0],h=f[1],d=s[0],p=s[1],v=(l+d)/2,g=(h+p)/2;if(p===h){if(v=r)return;if(l>d){if(c){if(c[1]>=i)return}else c=[v,e];u=[v,i]}else{if(c){if(c[1]1)if(l>d){if(c){if(c[1]>=i)return}else c=[(e-a)/o,e];u=[(i-a)/o,i]}else{if(c){if(c[1]=r)return}else c=[n,o*n+a];u=[r,o*r+a]}else{if(c){if(c[0]=-ey)){var d=c*c+f*f,p=s*s+l*l,v=(l*d-f*p)/h,g=(c*p-s*d)/h,y=Ig.pop()||new function(){Cg(this),this.x=this.y=this.arc=this.site=this.cy=null};y.arc=t,y.site=i,y.x=v+o,y.y=(y.cy=g+a)+Math.sqrt(v*v+g*g),t.circle=y;for(var _=null,m=Kg._;m;)if(y.yny)a=a.L;else{if(!((i=u-Zg(a,o))>ny)){r>-ny?(n=a.P,e=a):i>-ny?(n=a,e=a.N):n=e=a;break}if(!a.R){n=a;break}a=a.R}!function(t){Jg[t.index]={site:t,halfedges:[]}}(t);var c=Vg(t);if(Qg.insert(n,c),n||e){if(n===e)return Yg(n),e=Vg(n.site),Qg.insert(c,e),c.edge=e.edge=Pg(n.site,c.site),Hg(n),void Hg(e);if(e){Yg(n),Yg(e);var f=n.site,s=f[0],l=f[1],h=t[0]-s,d=t[1]-l,p=e.site,v=p[0]-s,g=p[1]-l,y=2*(h*g-d*v),_=h*h+d*d,m=v*v+g*g,x=[(g*_-d*m)/y+s,(h*m-v*_)/y+l];Rg(e.edge,f,p,x),c.edge=Pg(f,t,null,x),e.edge=Pg(t,p,null,x),Hg(n),Hg(e)}else c.edge=Pg(n.site,c.site)}}function Gg(t,n){var e=t.site,r=e[0],i=e[1],u=i-n;if(!u)return r;var o=t.P;if(!o)return-1/0;var a=(e=o.site)[0],c=e[1],f=c-n;if(!f)return a;var s=a-r,l=1/u-1/f,h=s/f;return l?(-h+Math.sqrt(h*h-2*l*(s*s/(-2*f)-c+f/2+i-u/2)))/l+r:(r+a)/2}function Zg(t,n){var e=t.N;if(e)return Gg(e,n);var r=t.site;return r[1]===n?r[0]:1/0}var Qg,Jg,Kg,ty,ny=1e-6,ey=1e-12;function ry(t,n){return n[1]-t[1]||n[0]-t[0]}function iy(t,n){var e,r,i,u=t.sort(ry).pop();for(ty=[],Jg=new Array(t.length),Qg=new zg,Kg=new zg;;)if(i=jg,u&&(!i||u[1]ny||Math.abs(i[0][1]-i[1][1])>ny)||delete ty[u]}(o,a,c,f),function(t,n,e,r){var i,u,o,a,c,f,s,l,h,d,p,v,g=Jg.length,y=!0;for(i=0;iny||Math.abs(v-h)>ny)&&(c.splice(a,0,ty.push(Og(o,d,Math.abs(p-t)ny?[t,Math.abs(l-t)ny?[Math.abs(h-r)ny?[e,Math.abs(l-e)ny?[Math.abs(h-n)=a)return null;var c=t-i.site[0],f=n-i.site[1],s=c*c+f*f;do{i=u.cells[r=o],o=null,i.halfedges.forEach((function(e){var r=u.edges[e],a=r.left;if(a!==i.site&&a||(a=r.right)){var c=t-a[0],f=n-a[1],l=c*c+f*f;lr?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>u?(u+o)/2:Math.min(0,u)||Math.max(0,o))}var _y=function(){var t,n,e=hy,r=dy,i=yy,u=vy,o=gy,a=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],f=250,s=pe,l=[],h=T("start","zoom","end"),d=500,p=150,v=0;function g(t){t.property("__zoom",py).on("wheel.zoom",M).on("mousedown.zoom",S).on("dblclick.zoom",k).filter(o).on("touchstart.zoom",C).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(t,n){return(n=Math.max(a[0],Math.min(a[1],n)))===t.k?t:new ay(n,t.x,t.y)}function _(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new ay(t.k,r,i)}function m(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,n,e){t.on("start.zoom",(function(){b(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).end()})).tween("zoom",(function(){var t=arguments,i=b(this,t),u=r.apply(this,t),o=e||m(u),a=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),c=this.__zoom,f="function"==typeof n?n.apply(this,t):n,l=s(c.invert(o).concat(a/c.k),f.invert(o).concat(a/f.k));return function(t){if(1===t)t=f;else{var n=l(t),e=a/n[2];t=new ay(e,o[0]-n[0]*e,o[1]-n[1]*e)}i.zoom(null,t)}}))}function b(t,n){for(var e,r=0,i=l.length;rv}t.zoom("mouse",i(_(t.that.__zoom,t.mouse[0]=Mt(t.that),t.mouse[1]),t.extent,c))}),!0).on("mouseup.zoom",(function(){r.on("mousemove.zoom mouseup.zoom",null),Et(ut.view,t.moved),ly(),t.end()}),!0),u=Mt(this),o=ut.clientX,a=ut.clientY;Nt(ut.view),sy(),t.mouse=[u,this.__zoom.invert(u)],or(this),t.start()}}function k(){if(e.apply(this,arguments)){var t=this.__zoom,n=Mt(this),u=t.invert(n),o=t.k*(ut.shiftKey?.5:2),a=i(_(y(t,o),n,u),r.apply(this,arguments),c);ly(),f>0?gt(this).transition().duration(f).call(x,a,n):gt(this).call(g.transform,a)}}function C(){if(e.apply(this,arguments)){var n,r,i,u,o=b(this,arguments),a=ut.changedTouches,c=a.length;for(sy(),r=0;r-1&&(n+=",");var e=t.split(".");switch(n+=".",n+=e.length>1?e[1].length:0,t.slice(-1)){case"%":n+="%";break;case"0":n+="f"}return r.format(n)}},u=function(t,n,e){var r=function(n,e,r,i,u){return!(!t.addError||!t.clearErrors||(ru?(t.addError({title:"Too Many "+e+"s",message:"This visualization requires "+(i===u?"exactly":"no more than")+" "+u+" "+e.toLowerCase()+(1===i?"":"s")+".",group:n}),1):(t.clearErrors(n),0)))},i=n.fields,u=i.pivots,o=i.dimensions,a=i.measure_like;return r("pivot-req","Pivot",u.length,e.min_pivots,e.max_pivots)&&r("dim-req","Dimension",o.length,e.min_dimensions,e.max_dimensions)&&r("mes-req","Measure",a.length,e.min_measures,e.max_measures)}},5:function(t,n,e){"use strict";var r=e(1),i=function(t){return function(){return t}},u=Math.abs,o=Math.atan2,a=Math.cos,c=Math.max,f=Math.min,s=Math.sin,l=Math.sqrt,h=1e-12,d=Math.PI,p=d/2,v=2*d;function g(t){return t>=1?p:t<=-1?-p:Math.asin(t)}function y(t){return t.innerRadius}function _(t){return t.outerRadius}function m(t){return t.startAngle}function x(t){return t.endAngle}function b(t){return t&&t.padAngle}function w(t,n,e,r,i,u,o){var a=t-e,f=n-r,s=(o?u:-u)/l(a*a+f*f),h=s*f,d=-s*a,p=t+h,v=n+d,g=e+h,y=r+d,_=(p+g)/2,m=(v+y)/2,x=g-p,b=y-v,w=x*x+b*b,M=i-u,T=p*y-g*v,S=(b<0?-1:1)*l(c(0,M*M*w-T*T)),k=(T*b-x*S)/w,C=(-T*x-b*S)/w,A=(T*b+x*S)/w,N=(-T*x+b*S)/w,E=k-_,z=C-m,P=A-_,O=N-m;return E*E+z*z>P*P+O*O&&(k=A,C=N),{cx:k,cy:C,x01:-h,y01:-d,x11:k*(i/M-1),y11:C*(i/M-1)}}var M=function(){var t=y,n=_,e=i(0),c=null,M=m,T=x,S=b,k=null;function C(){var i,y,_,m=+t.apply(this,arguments),x=+n.apply(this,arguments),b=M.apply(this,arguments)-p,C=T.apply(this,arguments)-p,A=u(C-b),N=C>b;if(k||(k=i=Object(r.a)()),xh)if(A>v-h)k.moveTo(x*a(b),x*s(b)),k.arc(0,0,x,b,C,!N),m>h&&(k.moveTo(m*a(C),m*s(C)),k.arc(0,0,m,C,b,N));else{var E,z,P=b,O=C,R=b,L=C,q=A,U=A,D=S.apply(this,arguments)/2,F=D>h&&(c?+c.apply(this,arguments):l(m*m+x*x)),j=f(u(x-m)/2,+e.apply(this,arguments)),I=j,H=j;if(F>h){var Y=g(F/m*s(D)),B=g(F/x*s(D));(q-=2*Y)>h?(R+=Y*=N?1:-1,L-=Y):(q=0,R=L=(b+C)/2),(U-=2*B)>h?(P+=B*=N?1:-1,O-=B):(U=0,P=O=(b+C)/2)}var V=x*a(P),X=x*s(P),W=m*a(L),$=m*s(L);if(j>h){var G=x*a(O),Z=x*s(O),Q=m*a(R),J=m*s(R);if(Ah?function(t,n,e,r,i,u,o,a){var c=e-t,f=r-n,s=o-i,l=a-u,h=(s*(n-u)-l*(t-i))/(l*c-s*f);return[t+h*c,n+h*f]}(V,X,Q,J,G,Z,W,$):[W,$],tt=V-K[0],nt=X-K[1],et=G-K[0],rt=Z-K[1],it=1/s(((_=(tt*et+nt*rt)/(l(tt*tt+nt*nt)*l(et*et+rt*rt)))>1?0:_<-1?d:Math.acos(_))/2),ut=l(K[0]*K[0]+K[1]*K[1]);I=f(j,(m-ut)/(it-1)),H=f(j,(x-ut)/(it+1))}}U>h?H>h?(E=w(Q,J,V,X,x,H,N),z=w(G,Z,W,$,x,H,N),k.moveTo(E.cx+E.x01,E.cy+E.y01),Hh&&q>h?I>h?(E=w(W,$,G,Z,m,-I,N),z=w(V,X,Q,J,m,-I,N),k.lineTo(E.cx+E.x01,E.cy+E.y01),I=l;--h)f.point(y[h],_[h]);f.lineEnd(),f.areaEnd()}g&&(y[s]=+t(d,s,i),_[s]=+e(d,s,i),f.point(n?+n(d,s,i):y[s],u?+u(d,s,i):_[s]))}if(p)return f=null,p+""||null}function l(){return A().defined(o).curve(c).context(a)}return s.x=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),n=null,s):t},s.x0=function(n){return arguments.length?(t="function"==typeof n?n:i(+n),s):t},s.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:i(+t),s):n},s.y=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),u=null,s):e},s.y0=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),s):e},s.y1=function(t){return arguments.length?(u=null==t?null:"function"==typeof t?t:i(+t),s):u},s.lineX0=s.lineY0=function(){return l().x(t).y(e)},s.lineY1=function(){return l().x(t).y(u)},s.lineX1=function(){return l().x(n).y(e)},s.defined=function(t){return arguments.length?(o="function"==typeof t?t:i(!!t),s):o},s.curve=function(t){return arguments.length?(c=t,null!=a&&(f=c(a)),s):c},s.context=function(t){return arguments.length?(null==t?a=f=null:f=c(a=t),s):a},s},E=function(t,n){return nt?1:n>=t?0:NaN},z=function(t){return t},P=function(){var t=z,n=E,e=null,r=i(0),u=i(v),o=i(0);function a(i){var a,c,f,s,l,h=i.length,d=0,p=new Array(h),g=new Array(h),y=+r.apply(this,arguments),_=Math.min(v,Math.max(-v,u.apply(this,arguments)-y)),m=Math.min(Math.abs(_)/h,o.apply(this,arguments)),x=m*(_<0?-1:1);for(a=0;a0&&(d+=l);for(null!=n?p.sort((function(t,e){return n(g[t],g[e])})):null!=e&&p.sort((function(t,n){return e(i[t],i[n])})),a=0,f=d?(_-h*x)/d:0;a0?l*f:0)+x,g[c]={data:i[c],index:a,value:l,startAngle:y,endAngle:s,padAngle:m};return g}return a.value=function(n){return arguments.length?(t="function"==typeof n?n:i(+n),a):t},a.sortValues=function(t){return arguments.length?(n=t,e=null,a):n},a.sort=function(t){return arguments.length?(e=t,n=null,a):e},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:i(+t),a):r},a.endAngle=function(t){return arguments.length?(u="function"==typeof t?t:i(+t),a):u},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:i(+t),a):o},a},O=L(S);function R(t){this._curve=t}function L(t){function n(n){return new R(t(n))}return n._curve=t,n}function q(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(L(t)):n()._curve},t}R.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var U=function(){return q(A().curve(O))},D=function(){var t=N().curve(O),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,u=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return q(e())},delete t.lineX0,t.lineEndAngle=function(){return q(r())},delete t.lineX1,t.lineInnerRadius=function(){return q(i())},delete t.lineY0,t.lineOuterRadius=function(){return q(u())},delete t.lineY1,t.curve=function(t){return arguments.length?n(L(t)):n()._curve},t},F=function(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]},j=Array.prototype.slice;function I(t){return t.source}function H(t){return t.target}function Y(t){var n=I,e=H,u=k,o=C,a=null;function c(){var i,c=j.call(arguments),f=n.apply(this,c),s=e.apply(this,c);if(a||(a=i=Object(r.a)()),t(a,+u.apply(this,(c[0]=f,c)),+o.apply(this,c),+u.apply(this,(c[0]=s,c)),+o.apply(this,c)),i)return a=null,i+""||null}return c.source=function(t){return arguments.length?(n=t,c):n},c.target=function(t){return arguments.length?(e=t,c):e},c.x=function(t){return arguments.length?(u="function"==typeof t?t:i(+t),c):u},c.y=function(t){return arguments.length?(o="function"==typeof t?t:i(+t),c):o},c.context=function(t){return arguments.length?(a=null==t?null:t,c):a},c}function B(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function V(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n,e=(e+i)/2,r,e,r,i)}function X(t,n,e,r,i){var u=F(n,e),o=F(n,e=(e+i)/2),a=F(r,e),c=F(r,i);t.moveTo(u[0],u[1]),t.bezierCurveTo(o[0],o[1],a[0],a[1],c[0],c[1])}function W(){return Y(B)}function $(){return Y(V)}function G(){var t=Y(X);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}var Z={draw:function(t,n){var e=Math.sqrt(n/d);t.moveTo(e,0),t.arc(0,0,e,0,v)}},Q={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},J=Math.sqrt(1/3),K=2*J,tt={draw:function(t,n){var e=Math.sqrt(n/K),r=e*J;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},nt=Math.sin(d/10)/Math.sin(7*d/10),et=Math.sin(v/10)*nt,rt=-Math.cos(v/10)*nt,it={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=et*e,i=rt*e;t.moveTo(0,-e),t.lineTo(r,i);for(var u=1;u<5;++u){var o=v*u/5,a=Math.cos(o),c=Math.sin(o);t.lineTo(c*e,-a*e),t.lineTo(a*r-c*i,c*r+a*i)}t.closePath()}},ut={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},ot=Math.sqrt(3),at={draw:function(t,n){var e=-Math.sqrt(n/(3*ot));t.moveTo(0,2*e),t.lineTo(-ot*e,-e),t.lineTo(ot*e,-e),t.closePath()}},ct=Math.sqrt(3)/2,ft=1/Math.sqrt(12),st=3*(ft/2+1),lt={draw:function(t,n){var e=Math.sqrt(n/st),r=e/2,i=e*ft,u=r,o=e*ft+e,a=-u,c=o;t.moveTo(r,i),t.lineTo(u,o),t.lineTo(a,c),t.lineTo(-.5*r-ct*i,ct*r+-.5*i),t.lineTo(-.5*u-ct*o,ct*u+-.5*o),t.lineTo(-.5*a-ct*c,ct*a+-.5*c),t.lineTo(-.5*r+ct*i,-.5*i-ct*r),t.lineTo(-.5*u+ct*o,-.5*o-ct*u),t.lineTo(-.5*a+ct*c,-.5*c-ct*a),t.closePath()}},ht=[Z,Q,tt,ut,it,at,lt],dt=function(){var t=i(Z),n=i(64),e=null;function u(){var i;if(e||(e=i=Object(r.a)()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),i)return e=null,i+""||null}return u.type=function(n){return arguments.length?(t="function"==typeof n?n:i(n),u):t},u.size=function(t){return arguments.length?(n="function"==typeof t?t:i(+t),u):n},u.context=function(t){return arguments.length?(e=null==t?null:t,u):e},u},pt=function(){};function vt(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function gt(t){this._context=t}gt.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:vt(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(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);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:vt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var yt=function(t){return new gt(t)};function _t(t){this._context=t}_t.prototype={areaStart:pt,areaEnd:pt,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(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:vt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var mt=function(t){return new _t(t)};function xt(t){this._context=t}xt.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(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:vt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var bt=function(t){return new xt(t)};function wt(t,n){this._basis=new gt(t),this._beta=n}wt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],u=n[0],o=t[e]-i,a=n[e]-u,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*o),this._beta*n[c]+(1-this._beta)*(u+r*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var Mt=function t(n){function e(t){return 1===n?new gt(t):new wt(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function Tt(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function St(t,n){this._context=t,this._k=(1-n)/6}St.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:Tt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:Tt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var kt=function t(n){function e(t){return new St(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Ct(t,n){this._context=t,this._k=(1-n)/6}Ct.prototype={areaStart:pt,areaEnd:pt,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(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Tt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var At=function t(n){function e(t){return new Ct(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Nt(t,n){this._context=t,this._k=(1-n)/6}Nt.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(t,n){switch(t=+t,n=+n,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:Tt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Et=function t(n){function e(t){return new Nt(t,n)}return e.tension=function(n){return t(+n)},e}(0);function zt(t,n,e){var r=t._x1,i=t._y1,u=t._x2,o=t._y2;if(t._l01_a>h){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>h){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);u=(u*f+t._x1*t._l23_2a-n*t._l12_2a)/s,o=(o*f+t._y1*t._l23_2a-e*t._l12_2a)/s}t._context.bezierCurveTo(r,i,u,o,t._x2,t._y2)}function Pt(t,n){this._context=t,this._alpha=n}Pt.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(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:zt(this,t,n)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Ot=function t(n){function e(t){return n?new Pt(t,n):new St(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function Rt(t,n){this._context=t,this._alpha=n}Rt.prototype={areaStart:pt,areaEnd:pt,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(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:zt(this,t,n)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Lt=function t(n){function e(t){return n?new Rt(t,n):new Ct(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function qt(t,n){this._context=t,this._alpha=n}qt.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(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+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:zt(this,t,n)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Ut=function t(n){function e(t){return n?new qt(t,n):new Nt(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function Dt(t){this._context=t}Dt.prototype={areaStart:pt,areaEnd:pt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};var Ft=function(t){return new Dt(t)};function jt(t){return t<0?-1:1}function It(t,n,e){var r=t._x1-t._x0,i=n-t._x1,u=(t._y1-t._y0)/(r||i<0&&-0),o=(e-t._y1)/(i||r<0&&-0),a=(u*i+o*r)/(r+i);return(jt(u)+jt(o))*Math.min(Math.abs(u),Math.abs(o),.5*Math.abs(a))||0}function Ht(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function Yt(t,n,e){var r=t._x0,i=t._y0,u=t._x1,o=t._y1,a=(u-r)/3;t._context.bezierCurveTo(r+a,i+a*n,u-a,o-a*e,u,o)}function Bt(t){this._context=t}function Vt(t){this._context=new Xt(t)}function Xt(t){this._context=t}function Wt(t){return new Bt(t)}function $t(t){return new Vt(t)}function Gt(t){this._context=t}function Zt(t){var n,e,r=t.length-1,i=new Array(r),u=new Array(r),o=new Array(r);for(i[0]=0,u[0]=2,o[0]=t[0]+2*t[1],n=1;n=0;--n)i[n]=(o[n]-i[n+1])/u[n];for(u[r-1]=(t[r]+i[r-1])/2,n=0;n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var Kt=function(t){return new Jt(t,.5)};function tn(t){return new Jt(t,0)}function nn(t){return new Jt(t,1)}var en=function(t,n){if((i=t.length)>1)for(var e,r,i,u=1,o=t[n[0]],a=o.length;u=0;)e[n]=n;return e};function un(t,n){return t[n]}var on=function(){var t=i([]),n=rn,e=en,r=un;function u(i){var u,o,a=t.apply(this,arguments),c=i.length,f=a.length,s=new Array(f);for(u=0;u0){for(var e,r,i,u=0,o=t[0].length;u1)for(var e,r,i,u,o,a,c=0,f=t[n[0]].length;c=0?(r[0]=u,r[1]=u+=i):i<0?(r[1]=o,r[0]=o+=i):r[0]=u},fn=function(t,n){if((e=t.length)>0){for(var e,r=0,i=t[n[0]],u=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,u=0,o=1;o