t*n))(t).map((t,n)=>(t.value=+e[n],a(t)))}function a(t){return t.coordinates.forEach(u),t}function u(t){t.forEach(c)}function c(t){t.forEach(f)}function f(t){t[0]=t[0]*Math.pow(2,p)-g,t[1]=t[1]*Math.pow(2,p)-g}function _(){return y=e+2*(g=3*d)>>p,v=r+2*g>>p,n}return n.contours=function(t){var e=o(t),r=va().size([y,v]),i=Math.pow(2,2*p),t=t=>{var n=a(r.contour(e,(t=+t)*i));return n.value=t,n};return Object.defineProperty(t,"max",{get:()=>nt(e)/i}),t},n.x=function(t){return arguments.length?(s="function"==typeof t?t:da(+t),n):s},n.y=function(t){return arguments.length?(l="function"==typeof t?t:da(+t),n):l},n.weight=function(t){return arguments.length?(h="function"==typeof t?t:da(+t),n):h},n.size=function(t){if(!arguments.length)return[e,r];var n=+t[0],t=+t[1];if(!(0<=n&&0<=t))throw new Error("invalid size");return e=n,r=t,_()},n.cellSize=function(t){if(!arguments.length)return 1<n(...t));const i=(e=e.map(x)).map(v);var o=e.length-1;const a=new Array(1+o).fill(0),u=[];if(o<0||i.some(m))return u;for(;;){u.push(a.map((t,n)=>e[n][t]));let t=o;for(;++a[t]===i[t];){if(0===t)return r?u.map(r):u;a[t--]=0}}},u.csv=Au,u.csvFormat=ou,u.csvFormatBody=au,u.csvFormatRow=cu,u.csvFormatRows=uu,u.csvFormatValue=fu,u.csvParse=ru,u.csvParseRows=iu,u.cubehelix=Qe,u.cumsum=function(n,e){var r=0,i=0;return Float64Array.from(n,void 0===e?t=>r+=+t||0:t=>r+=+e(t,i++,n)||0)},u.curveBasis=function(t){return new hm(t)},u.curveBasisClosed=function(t){return new dm(t)},u.curveBasisOpen=function(t){return new pm(t)},u.curveBumpX=Gb,u.curveBumpY=Xb,u.curveBundle=Pg,u.curveCardinal=Rg,u.curveCardinalClosed=Qg,u.curveCardinalOpen=ny,u.curveCatmullRom=zv,u.curveCatmullRomClosed=t_,u.curveCatmullRomOpen=Ud,u.curveLinear=Cb,u.curveLinearClosed=function(t){return new Am(t)},u.curveMonotoneX=function(t){return new Nm(t)},u.curveMonotoneY=function(t){return new Cm(t)},u.curveNatural=function(t){return new zm(t)},u.curveStep=function(t){return new Rm(t,.5)},u.curveStepAfter=function(t){return new Rm(t,1)},u.curveStepBefore=function(t){return new Rm(t,0)},u.descending=t,u.deviation=M,u.difference=function(t,...n){t=new E(t);for(const e of n)for(const r of e)t.delete(r);return t},u.disjoint=function(t,n){const e=n[Symbol.iterator](),r=new E;for(const a of t){if(r.has(a))return!1;for(var i,o;({value:i,done:o}=e.next())&&!o;){if(Object.is(a,i))return!1;r.add(i)}}return!0},u.dispatch=Rt,u.drag=function(){var r,i,o,a,u=Ln,c=Bn,e=jn,n=Yn,g={},y=Rt("start","drag","end"),v=0,f=0;function _(t){t.on("mousedown.drag",s).filter(n).on("touchstart.drag",d).on("touchmove.drag",p,zn).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function s(t,n){a||!u.call(this,t,n)||(n=m(this,c.call(this,t,n),t,n,"mouse"))&&(En(t.view).on("mousemove.drag",l,Dn).on("mouseup.drag",h,Dn),qn(t.view),Rn(t),o=!1,r=t.clientX,i=t.clientY,n("start",t))}function l(t){var n,e;Fn(t),o||(n=t.clientX-r,e=t.clientY-i,o=f+t,u.easePoly=Oi,u.easePolyIn=qi,u.easePolyInOut=Oi,u.easePolyOut=Ii,u.easeQuad=Ri,u.easeQuadIn=function(t){return t*t},u.easeQuadInOut=Ri,u.easeQuadOut=function(t){return t*(2-t)},u.easeSin=Bi,u.easeSinIn=function(t){return 1==+t?1:1-Math.cos(t*Li)},u.easeSinInOut=Bi,u.easeSinOut=function(t){return Math.sin(t*Li)},u.every=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");let e=-1;for(const r of t)if(!n(r,++e,t))return!1;return!0},u.extent=A,u.fcumsum=function(n,e){const r=new S;let i=-1;return Float64Array.from(n,void 0===e?t=>r.add(+t||0):t=>r.add(+e(t,++i,n)||0))},u.filter=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");const e=[];let r=-1;for(const i of t)n(i,++r,t)&&e.push(i);return e},u.flatGroup=function(t,...n){return F(R(t,...n),n)},u.flatRollup=function(t,n,...e){return F(I(t,n,...e),e)},u.forceCenter=function(o,a){var u,c=1;function n(){for(var t,n=u.length,e=0,r=0,i=0;iu.index&&((i=(r=c-o.x-o.vx)*r+(e=f-o.y-o.vy)*e)t.r&&(t.r=t[n].r)}function e(){if(o){var t,n,e=o.length;for(a=new Array(e),t=0;t[u(t,n,o),t])),i=0;for(a=new Array(n);i(t=(Hu*t+Gu)%Xu)/Xu}();function i(){h(),e.call("tick",o),aGf(r[0],r[1])&&(r[1]=i[1]),Gf(i[0],r[1])>Gf(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,n=0,r=o[e=o.length-1];n<=e;r=i,++n)i=o[n],(u=Gf(r[1],i[0]))>a&&(a=u,Zc=i[0],Qc=r[1])}return af=uf=null,Zc===1/0||Kc===1/0?[[NaN,NaN],[NaN,NaN]]:[[Zc,Kc],[Qc,Jc]]},u.geoCentroid=function(t){wf=Mf=Af=Tf=Ef=Sf=kf=Nf=0,Cf=new S,Pf=new S,zf=new S,$c(t,Wf);var n=+Cf,e=+Pf,r=+zf;return(t=kc(n,e,r))c(n,r)||c(t,e)):B(D(t,n),([t,n],[e,r])=>i(n,r)||c(t,e))).map(([t])=>t)},u.groups=R,u.hcl=je,u.hierarchy=$h,u.histogram=tt,u.hsl=me,u.html=Nu,u.image=function(i,o){return new Promise(function(t,n){var e,r=new Image;for(e in o)r[e]=o[e];r.onerror=n,r.onload=function(){t(r)},r.src=i})},u.index=function(t,...n){return U(t,z,O,n)},u.indexes=function(t,...n){return U(t,Array.from,O,n)},u.interpolate=xr,u.interpolateArray=function(t,n){return(dr(n)?hr:pr)(t,n)},u.interpolateBasis=nr,u.interpolateBasisClosed=er,u.interpolateBlues=$_,u.interpolateBrBG=e_,u.interpolateBuGn=m_,u.interpolateBuPu=w_,u.interpolateCividis=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},u.interpolateCool=e,u.interpolateCubehelix=Ur,u.interpolateCubehelixDefault=nb,u.interpolateCubehelixLong=Lr,u.interpolateDate=gr,u.interpolateDiscrete=function(n){var e=n.length;return function(t){return n[Math.max(0,Math.min(e-1,Math.floor(t*e)))]}},u.interpolateGnBu=A_,u.interpolateGreens=G_,u.interpolateGreys=V_,u.interpolateHcl=qr,u.interpolateHclLong=Ir,u.interpolateHsl=Dr,u.interpolateHslLong=Rr,u.interpolateHue=function(t,n){var e=or(+t,+n);return function(t){t=e(t);return t-360*Math.floor(t/360)}},u.interpolateInferno=Wn,u.interpolateLab=function(n,t){var e=ur((n=Fe(n)).l,(t=Fe(t)).l),r=ur(n.a,t.a),i=ur(n.b,t.b),o=ur(n.opacity,t.opacity);return function(t){return n.l=e(t),n.a=r(t),n.b=i(t),n.opacity=o(t),n+""}},u.interpolateMagma=Zn,u.interpolateNumber=yr,u.interpolateNumberArray=hr,u.interpolateObject=vr,u.interpolateOrRd=E_,u.interpolateOranges=tb,u.interpolatePRGn=i_,u.interpolatePiYG=a_,u.interpolatePlasma=Di,u.interpolatePuBu=C_,u.interpolatePuBuGn=k_,u.interpolatePuOr=c_,u.interpolatePuRd=z_,u.interpolatePurples=Z_,u.interpolateRainbow=function(t){(t<0||1r(t,n,e))},u.matcher=Gt,u.max=nt,u.maxIndex=et,u.mean=function(n,e){let r=0,i=0;if(void 0===e)for(var t of n)null!=t&&(t=+t)>=t&&(++r,i+=t);else{let t=-1;for(var o of n)null!=(o=e(o,++t,n))&&(o=+o)>=o&&(++r,i+=o)}if(r)return i/r},u.median=function(t,n){return ct(t,.5,n)},u.medianIndex=function(t,n){return st(t,.5,n)},u.merge=lt,u.min=rt,u.minIndex=it,u.mode=function(n,e){const r=new T;if(void 0===e)for(var t of n)null!=t&&t>=t&&r.set(t,(r.get(t)||0)+1);else{let t=-1;for(var i of n)null!=(i=e(i,++t,n))&&i>=i&&r.set(i,(r.get(i)||0)+1)}let o,a=0;for(var[u,c]of r)c>a&&(a=c,o=u);return o},u.namespace=Ut,u.namespaces=Ot,u.nice=Q,u.now=Jr,u.pack=function(){var e=null,r=1,i=1,o=Qh;function n(t){var n=rd();return t.x=r/2,t.y=i/2,e?t.eachBefore(yd(e)).eachAfter(vd(o,.5,n)).eachBefore(_d(1)):t.eachBefore(yd(gd)).eachAfter(vd(Qh,1,n)).eachAfter(vd(o,t.r/Math.min(r,i),n)).eachBefore(_d(Math.min(r,i)/(2*t.r))),t}return n.radius=function(t){return arguments.length?(e=Zh(t),n):e},n.size=function(t){return arguments.length?(r=+t[0],i=+t[1],n):[r,i]},n.padding=function(t){return arguments.length?(o="function"==typeof t?t:Jh(+t),n):o},n},u.packEnclose=function(t){return id(t,rd())},u.packSiblings=function(t){return pd(t,rd()),t},u.pairs=function(t,n=function(t,n){return[t,n]}){const e=[];let r,i=!1;for(const o of t)i&&e.push(n(r,o)),r=o,i=!0;return e},u.partition=function(){var e=1,r=1,u=0,i=!1;function n(t){var o,a,n=t.height+1;return t.x0=t.y0=u,t.x1=e,t.y1=r/n,t.eachBefore((o=r,a=n,function(t){t.children&&md(t,t.x0,o*(t.depth+1)/a,t.x1,o*(t.depth+2)/a);var n=t.x0,e=t.y0,r=t.x1-u,i=t.y1-u;rPn(t,n))},u.polygonArea=function(t){for(var n,e=-1,r=t.length,i=t[r-1],o=0;++e(n=1664525*n+1013904223|0,rp*(n>>>0))},u.randomLogNormal=Yd,u.randomLogistic=np,u.randomNormal=jd,u.randomPareto=Xd,u.randomPoisson=ep,u.randomUniform=Ld,u.randomWeibull=Jd,u.range=ht,u.rank=function(t,e=c){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");let r=Array.from(t);const i=new Float64Array(r.length);2!==e.length&&(r=r.map(e),e=c);const o=(t,n)=>e(r[t],r[n]);let a,u;return Uint32Array.from(r,(t,n)=>n).sort(e===c?(t,n)=>Y(r[t],r[n]):j(o)).forEach((t,n)=>{var e=o(t,void 0===a?t:a);0<=e?((void 0===a||0gp(n,t()).base(n.base()),ip.apply(n,arguments),n},u.scaleOrdinal=up,u.scalePoint=function(){return function t(n){var e=n.copy;return n.padding=n.paddingOuter,delete n.paddingInner,delete n.paddingOuter,n.copy=function(){return t(e())},n}(cp.apply(null,arguments).paddingInner(1))},u.scalePow=Fp,u.scaleQuantile=function t(){var n,e=[],r=[],i=[];function o(){var t=0,n=Math.max(1,r.length);for(i=new Array(n-1);++te(n/(r.length-1)))},i.quantiles=function(e){return Array.from({length:e+1},(t,n)=>ct(r,n/e))},i.copy=function(){return t(e).domain(r)},op.apply(i,arguments)},u.scaleSequentialSqrt=function(){return Lv.apply(null,arguments).exponent(.5)},u.scaleSequentialSymlog=function t(){var n=Cp(Ov());return n.copy=function(){return Uv(n,t()).constant(n.constant())},op.apply(n,arguments)},u.scaleSqrt=function(){return Fp.apply(null,arguments).exponent(.5)},u.scaleSymlog=function t(){var n=Cp(yp());return n.copy=function(){return gp(n,t()).constant(n.constant())},ip.apply(n,arguments)},u.scaleThreshold=function t(){var n,e=[.5],r=[0,1],i=1;function o(t){return null!=t&&t<=t?r[_(e,t,0,i)]:n}return o.domain=function(t){return arguments.length?(e=Array.from(t),i=Math.min(e.length,r.length-1),o):e.slice()},o.range=function(t){return arguments.length?(r=Array.from(t),i=Math.min(e.length,r.length-1),o):r.slice()},o.invertExtent=function(t){return t=r.indexOf(t),[e[t-1],e[t]]},o.unknown=function(t){return arguments.length?(n=t,o):n},o.copy=function(){return t().domain(e).range(r).unknown(n)},ip.apply(o,arguments)},u.scaleTime=function(){return ip.apply(Iv(uy,cy,Eg,Mg,cg,og,eg,Jp,Zp,u.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},u.scaleUtc=function(){return ip.apply(Iv(oy,ay,ey,Jg,Og,Fg,zg,Ng,Zp,u.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},u.scan=function(t,n){return(n=dt(t,n))<0?void 0:n},u.schemeAccent=Hv,u.schemeBlues=Y_,u.schemeBrBG=n_,u.schemeBuGn=b_,u.schemeBuPu=x_,u.schemeCategory10=$v,u.schemeDark2=Gv,u.schemeGnBu=M_,u.schemeGreens=H_,u.schemeGreys=X_,u.schemeOrRd=T_,u.schemeOranges=J_,u.schemePRGn=r_,u.schemePaired=Xv,u.schemePastel1=Vv,u.schemePastel2=Wv,u.schemePiYG=o_,u.schemePuBu=N_,u.schemePuBuGn=S_,u.schemePuOr=u_,u.schemePuRd=P_,u.schemePurples=W_,u.schemeRdBu=f_,u.schemeRdGy=l_,u.schemeRdPu=D_,u.schemeRdYlBu=d_,u.schemeRdYlGn=g_,u.schemeReds=K_,u.schemeSet1=Zv,u.schemeSet2=Kv,u.schemeSet3=Qv,u.schemeSpectral=v_,u.schemeTableau10=Jv,u.schemeYlGn=I_,u.schemeYlGnBu=F_,u.schemeYlOrBr=U_,u.schemeYlOrRd=B_,u.select=En,u.selectAll=function(t){return"string"==typeof t?new An([document.querySelectorAll(t)],[document.documentElement]):new An([Yt(t)],Mn)},u.selection=Tn,u.selector=jt,u.selectorAll=Ht,u.shuffle=pt,u.shuffler=gt,u.some=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");let e=-1;for(const r of t)if(n(r,++e,t))return!0;return!1},u.sort=B,u.stack=function(){var u=cb([]),c=qm,f=Fm,s=Im;function n(t){var n,e,r=Array.from(u.apply(this,arguments),Om),i=r.length,o=-1;for(const a of t)for(n=0,++o;nfunction(t){var n=(t=`${t}`).length;Sd(t,n-1)&&!Sd(t,n-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(y(t,n,e))),p=d.map(Ed),g=new Set(d).add("");for(const r of p)g.has(r)||(g.add(r),d.push(r),p.push(Ed(r)),f.push(Md));s=(t,n)=>d[n],l=(t,n)=>p[n]}for(r=0,n=f.length;re.x&&(e=t),t.depth>r.depth&&(r=t)}),u=n===e?1:h(n,e)/2,i=u-n.x,o=c/(e.x+u+i),a=f/(r.depth||1),t.eachBefore(function(t){t.x=(t.x+i)*o,t.y=t.depth*a})),t}function l(t){var n=t.children,e=t.parent.children,r=t.i?e[t.i-1]:null;n?(function(t){for(var n,e=0,r=0,i=t.children,o=i.length;0<=--o;)(n=i[o]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(t),n=(n[0].z+n[n.length-1].z)/2,r?(t.z=r.z+h(t._,r._),t.m=t.z-n):t.z=n):r&&(t.z=r.z+h(t._,r._)),t.parent.A=function(t,n,e){if(n){for(var r,i=t,o=t,a=n,u=i.parent.children[0],c=i.m,f=o.m,s=a.m,l=u.m;a=Cd(a),i=Nd(i),a&&i;)u=Nd(u),(o=Cd(o)).a=t,0<(r=a.z+s-i.z-c+h(a._,i._))&&(function(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(t,n,e){return t.a.parent===n.parent?t.a:e}(a,t,e),t,r),c+=r,f+=r),s+=a.m,c+=i.m,l+=u.m,f+=o.m;a&&!Cd(o)&&(o.t=a,o.m+=s-f),i&&!Nd(u)&&(u.t=i,u.m+=c-l,e=t)}return e}(t,r,t.parent.A||e[0])}function d(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function p(t){t.x*=c,t.y=t.depth*f}return n.separation=function(t){return arguments.length?(h=t,n):h},n.size=function(t){return arguments.length?(s=!1,c=+t[0],f=+t[1],n):s?null:[c,f]},n.nodeSize=function(t){return arguments.length?(s=!0,c=+t[0],f=+t[1],n):s?[c,f]:null},n},u.treemap=function(){var a=Fd,n=!1,e=1,r=1,u=[0],c=Qh,f=Qh,s=Qh,l=Qh,h=Qh;function i(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(o),u=[0],n&&t.eachBefore(bd),t}function o(t){var n=u[t.depth],e=t.x0+n,r=t.y0+n,i=t.x1-n,o=t.y1-n;i>>1;y[d]u&&(u=t[0]),t[1]c&&(c=t[1])}function r(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(r);break;case"Point":e(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(e)}}for(n in t.arcs.forEach(function(t){for(var n,e=-1,r=t.length;++eu&&(u=n[0]),n[1]c&&(c=n[1])}),t.objects)r(t.objects[n]);return[o,a,u,c]}function o(n,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return e(n,t)})}:e(n,t)}var h=function(t){if(null==t)return n;var o,a,u=t.scale[0],c=t.scale[1],f=t.translate[0],s=t.translate[1];return function(t,n){n||(o=a=0);var e=2,r=t.length,i=new Array(r);for(i[0]=(o+=t[0])*u+f,i[1]=(a+=t[1])*c+s;ea&&(i=e[0],e[0]=e[o],e[o]=i,a=r);return e})}}function g(t,n){for(var e=0,r=t.length;e>>1;t[i]=i)throw new Error("full hashset");e=c[n=n+1&f]}return c[n]=t,!0},has:function(t){for(var n=o(t)&f,e=c[n],r=0;e!=u;){if(a(e,t))return!0;if(++r>=i)break;e=c[n=n+1&f]}return!1},values:function(){for(var t=[],n=0,e=c.length;n=o)throw new Error("full hashmap");r=f[e=e+1&l]}return f[e]=t,s[e]=n},maybeSet:function(t,n){for(var e=a(t)&l,r=f[e],i=0;r!=c;){if(u(r,t))return s[e];if(++i>=o)throw new Error("full hashmap");r=f[e=e+1&l]}return f[e]=t,s[e]=n},get:function(t,n){for(var e=a(t)&l,r=f[e],i=0;r!=c;){if(u(r,t))return s[e];if(++i>=o)break;r=f[e=e+1&l]}return n},keys:function(){for(var t=[],n=0,e=f.length;n>7^c[2]^c[3])}function m(t){for(var i=t.coordinates,n=t.lines,e=t.rings,r=function(){for(var t=E(1.4*i.length,x,w,Int32Array,-1,Int32Array),n=new Int32Array(i.length),e=0,r=i.length;e>1);n