d3-geo-projection
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -1,3 +0,3 @@ | ||
// https://d3js.org/d3-geo-projection/ Version 1.2.2. Copyright 2017 Mike Bostock. | ||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("d3-geo"),require("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-geo","d3-array"],r):r(n.d3=n.d3||{},n.d3,n.d3)}(this,function(n,r,e){"use strict";function t(n){return n?n/Math.sin(n):1}function o(n){return n>1?Xr:n<-1?-Xr:Math.asin(n)}function i(n){return n>1?0:n<-1?Jr:Math.acos(n)}function u(n){return n>0?Math.sqrt(n):0}function a(n){return((n=Hr(2*n))-1)/(n+1)}function c(n){return(Hr(n)-Hr(-n))/2}function f(n){return(Hr(n)+Hr(-n))/2}function l(n){return Wr(n+u(n*n+1))}function g(n){return Wr(n+u(n*n-1))}function v(n){function r(n,r){var e=Br(n),o=Br(r),i=_r(r),u=o*e,a=-((1-u?Wr((1+u)/2)/(1-u):-.5)+t/(1+u));return[a*o*_r(n),a*i]}var e=Kr(n/2),t=2*Wr(Br(n/2))/(e*e);return r.invert=function(r,e){var i,a=u(r*r+e*e),c=-n/2,f=50;if(!a)return[0,0];do{var l=c/2,g=Br(l),v=_r(l),s=Kr(l),h=Wr(1/g);c-=i=(2/s*h-t*s-a)/(-h/(v*v)+1-t/(2*g*g))}while(Lr(i)>Or&&--f>0);var p=_r(c);return[xr(r*p,a*Br(c)),o(e*p/a)]},r}function s(n,r){var e=Br(r),o=t(i(e*Br(n/=2)));return[2*e*_r(n)*o,_r(r)*o]}function h(n){function r(n,r){var a=Br(r),c=Br(n/=2);return[(1+a)*_r(n),(o*r>-xr(c,i)-.001?0:10*-o)+u+_r(r)*t-(1+a)*e*c]}var e=_r(n),t=Br(n),o=n>=0?1:-1,i=Kr(o*n),u=(1+e-t)/2;return r.invert=function(n,r){var a=0,c=0,f=50;do{var l=Br(a),g=_r(a),v=Br(c),s=_r(c),h=1+v,p=h*g-n,d=u+s*t-h*e*l-r,w=h*l/2,P=-g*s,m=e*h*g/2,y=t*v+e*l*s,R=P*m-y*w,j=(d*P-p*y)/R/2,M=(p*m-d*w)/R;a-=j,c-=M}while((Lr(j)>Or||Lr(M)>Or)&&--f>0);return o*c>-xr(Br(a),i)-.001?[2*a,c]:null},r}function p(n,r){var e=Kr(r/2),t=u(1-e*e),o=1+t*Br(n/=2),i=_r(n)*t/o,a=e/o,c=i*i,f=a*a;return[4/3*i*(3+c-3*f),4/3*a*(3+3*c-f)]}function d(n,r){var e=Lr(r);return e<Yr?[n,Wr(Kr(Yr+r/2))]:[n*Br(e)*(2*$r-1/_r(e)),Nr(r)*(2*$r*(e-Yr)-Wr(Kr(e/2)))]}function w(n){function e(n,e){var i=r.geoAzimuthalEquidistantRaw(n,e);if(Lr(n)>Xr){var a=xr(i[1],i[0]),c=u(i[0]*i[0]+i[1]*i[1]),f=t*Vr((a-Xr)/t)+Xr,l=xr(_r(a-=f),2-Br(a));a=f+o(Jr/c*_r(l))-l,i[0]=c*Br(a),i[1]=c*_r(a)}return i}var t=2*Jr/n;return e.invert=function(n,e){var o=u(n*n+e*e);if(o>Xr){var a=xr(e,n),c=t*Vr((a-Xr)/t)+Xr,f=a>c?-1:1,l=o*Br(c-a),g=1/Kr(f*i((l-Jr)/u(Jr*(Jr-2*l)+o*o)));a=c+2*qr((g+f*u(g*g-3))/3),n=o*Br(a),e=o*_r(a)}return r.geoAzimuthalEquidistantRaw.invert(n,e)},e}function P(n,r){var e,t=n*_r(r),o=30;do{r-=e=(r+_r(r)-t)/(1+Br(r))}while(Lr(e)>Or&&--o>0);return r/2}function m(n,r,e){function t(t,o){return[n*t*Br(o=P(e,o)),r*_r(o)]}return t.invert=function(t,i){return i=o(i/r),[t/(n*Br(i)),o((2*i+_r(2*i))/e)]},t}function y(n,r){var e=P(Jr,r);return[he*n/(1/Br(r)+pe/Br(e)),(r+$r*_r(e))/he]}function R(n,r){return[n*Br(r),r]}function j(n){function r(r,t){var o=e+n-t,i=o?r*Br(t)/o:o;return[o*_r(i),e-o*Br(i)]}if(!n)return R;var e=1/Kr(n);return r.invert=function(r,t){var o=u(r*r+(t=e-t)*t),i=e+n-o;return[o/Br(i)*xr(r,t),i]},r}function M(n){function r(r,e){var t=Xr-e,o=t?r*n*_r(t)/t:t;return[t*_r(o)/n,Xr-t*Br(o)]}return r.invert=function(r,e){var t=r*n,o=Xr-e,i=u(t*t+o*o),a=xr(t,o);return[(i?i/_r(i):1)*a/n,Xr-i]},r}function E(n,r,e,t,a,c){var f,l=Br(c);if(Lr(n)>1||Lr(c)>1)f=i(e*a+r*t*l);else{var g=_r(n/2),v=_r(c/2);f=2*o(u(g*g+r*t*v*v))}return Lr(f)>Or?[f,xr(t*_r(c),r*a-e*t*l)]:[0,0]}function b(n,r,e){return i((n*n+r*r-e*e)/(2*n*r))}function k(n){return n-2*Jr*Ir((n+Jr)/(2*Jr))}function S(n,r,e){function t(n,r){var e,t=_r(r),o=Br(r),u=new Array(3);for(e=0;e<3;++e){var a=i[e];if(u[e]=E(r-a[1],a[3],a[2],o,t,n-a[0]),!u[e][0])return a.point;u[e][1]=k(u[e][1]-a.v[1])}var c=g.slice();for(e=0;e<3;++e){var v=2==e?0:e+1,s=b(i[e].v[0],u[e][0],u[v][0]);u[e][1]<0&&(s=-s),e?1==e?(s=f-s,c[0]-=u[e][0]*Br(s),c[1]-=u[e][0]*_r(s)):(s=l-s,c[0]+=u[e][0]*Br(s),c[1]+=u[e][0]*_r(s)):(c[0]+=u[e][0]*Br(s),c[1]-=u[e][0]*_r(s))}return c[0]/=3,c[1]/=3,c}for(var o,i=[[n[0],n[1],_r(n[1]),Br(n[1])],[r[0],r[1],_r(r[1]),Br(r[1])],[e[0],e[1],_r(e[1]),Br(e[1])]],u=i[2],a=0;a<3;++a,u=o)o=i[a],u.v=E(o[1]-u[1],u[3],u[2],o[3],o[2],o[0]-u[0]),u.point=[0,0];var c=b(i[0].v[0],i[2].v[0],i[1].v[0]),f=b(i[0].v[0],i[1].v[0],i[2].v[0]),l=Jr-c;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var g=[i[2].point[0]=i[0].point[0]+i[2].v[0]*Br(c),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*_r(c))];return t}function A(n){return n[0]*=te,n[1]*=te,n}function G(){return C([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function C(n,e,t){var o=r.geoCentroid({type:"MultiPoint",coordinates:[n,e,t]}),i=[-o[0],-o[1]],u=r.geoRotation(i),a=r.geoProjection(S(A(u(n)),A(u(e)),A(u(t)))).rotate(i),c=a.center;return delete a.rotate,a.center=function(n){return arguments.length?c(u(n)):u.invert(c())},a.clipAngle(90)}function z(n,r){var e=u(1-_r(r));return[2/ne*n*e,ne*(1-e)]}function F(n){function r(n,r){return[n,(n?n/_r(n):1)*(_r(r)*Br(n)-e*Br(r))]}var e=Kr(n);return r.invert=e?function(n,r){n&&(r*=_r(n)/n);var t=Br(n);return[n,2*xr(u(t*t+e*e-r*r)-t,e-r)]}:function(n,r){return[n,o(n?r*Kr(n)/n:r)]},r}function L(n,r){return[be*n*(2*Br(2*r/3)-1)/ne,be*ne*_r(r/3)]}function q(n){function r(n,r){return[n*e,_r(r)/e]}var e=Br(n);return r.invert=function(n,r){return[n/e,o(r*e)]},r}function x(n){function r(n,r){return[n*e,(1+e)*Kr(r/2)]}var e=Br(n);return r.invert=function(n,r){return[n/e,2*qr(r/(1+e))]},r}function B(n,r){var e=u(8/(3*Jr));return[e*n*(1-Lr(r)/Jr),e*r]}function H(n,r){var e=u(4-3*_r(Lr(r)));return[2/u(6*Jr)*n*e,Nr(r)*u(2*Jr/3)*(2-e)]}function I(n,r){var e=u(Jr*(4+Jr));return[2/e*n*(1+u(1-4*r*r/(Jr*Jr))),4/e*r]}function W(n,r){var e=(2+Xr)*_r(r);r/=2;for(var t=0,o=1/0;t<10&&Lr(o)>Or;t++){var i=Br(r);r-=o=(r+_r(r)*(i+2)-e)/(2*i*(1+i))}return[2/u(Jr*(4+Jr))*n*(1+Br(r)),2*u(Jr/(4+Jr))*_r(r)]}function T(n,r){return[n*(1+Br(r))/u(2+Jr),2*r/u(2+Jr)]}function D(n,r){for(var e=(1+Xr)*_r(r),t=0,o=1/0;t<10&&Lr(o)>Or;t++)r-=o=(r+_r(r)-e)/(1+Br(r));return e=u(2+Jr),[n*(1+Br(r))/e,2*r/e]}function Q(n,r){var e=_r(n/=2),t=Br(n),o=u(Br(r)),i=Br(r/=2),a=_r(r)/(i+$r*t*o),c=u(2/(1+a*a)),f=u(($r*i+(t+e)*o)/($r*i+(t-e)*o));return[xe*(c*(f-1/f)-2*Wr(f)),xe*(c*a*(f+1/f)-2*qr(a))]}function V(n,r){var e=Kr(r/2);return[n*He*u(1-e*e),(1+He)*e]}function N(n,r){var e=r/2,t=Br(e);return[2*n/ne*Br(r)*t*t,ne*Kr(e)]}function _(n){return[n[0]/2,o(Kr(n[1]/2*te))*ee]}function K(n){return[2*n[0],2*qr(_r(n[1]*te))*ee]}function O(n,e){function t(e,t){var a=r.geoAzimuthalEquidistantRaw(e,t),c=a[0],f=a[1],l=c*c+f*f;if(l>i){var g=u(l),v=xr(f,c),s=o*Vr(v/o),h=v-s,p=n*Br(h),d=(n*_r(h)-h*_r(p))/(Xr-p),w=U(h,d),P=(Jr-n)/J(w,p,Jr);c=g;var m,y=50;do{c-=m=(n+J(w,p,c)*P-g)/(w(c)*P)}while(Lr(m)>Or&&--y>0);f=h*_r(c),c<Xr&&(f-=d*(c-Xr));var R=_r(s),j=Br(s);a[0]=c*j-f*R,a[1]=c*R+f*j}return a}var o=2*Jr/e,i=n*n;return t.invert=function(e,t){var a=e*e+t*t;if(a>i){var c=u(a),f=xr(t,e),l=o*Vr(f/o),g=f-l;e=c*Br(g),t=c*_r(g);for(var v=e-Xr,s=_r(e),h=t/s,p=e<Xr?1/0:0,d=10;;){var w=n*_r(h),P=n*Br(h),m=_r(P),y=Xr-P,R=(w-h*m)/y,j=U(h,R);if(Lr(p)<Ur||!--d)break;h-=p=(h*s-R*v-t)/(s-2*v*(y*(P+h*w*Br(P)-m)-w*(w-h*m))/(y*y))}c=n+J(j,P,e)*(Jr-n)/J(j,P,Jr),f=l+h,e=c*Br(f),t=c*_r(f)}return r.geoAzimuthalEquidistantRaw.invert(e,t)},t}function U(n,r){return function(e){var t=n*Br(e);return e<Xr&&(t-=r),u(1+t*t)}}function J(n,r,e){for(var t=(e-r)/50,o=n(r)+n(e),i=1,u=r;i<50;++i)o+=2*n(u+=t);return.5*o*t}function X(n,r){var e=n*n,t=r*r;return[n*(1-.162388*t)*(.87-952426e-9*e*e),r*(1+t/12)]}function Y(n,r){var e=Nr(n),t=Nr(r),i=Br(r),u=Br(n)*i,a=_r(n)*i,c=_r(t*r);n=Lr(xr(a,c)),r=o(u),Lr(n-Xr)>Or&&(n%=Xr);var f=Z(n>Jr/4?Xr-n:n,r);return n>Jr/4&&(c=f[0],f[0]=-f[1],f[1]=-c),f[0]*=e,f[1]*=-t,f}function Z(n,r){if(r===Xr)return[0,0];var e,t,i=_r(r),a=i*i,c=a*a,f=1+c,l=1+3*c,g=1-c,v=o(1/u(f)),s=g+a*f*v,h=(1-i)/s,p=u(h),d=h*f,w=u(d),P=p*g;if(0===n)return[0,-(P+a*w)];var m,y=Br(r),R=1/y,j=2*i*y,M=(-3*a+v*l)*j,E=(-s*y-(1-i)*M)/(s*s),b=.5*E/p,k=g*b-2*a*p*j,S=a*f*E+h*l*j,A=-R*j,G=-R*S,C=-2*R*k,z=4*n/Jr;if(n>.222*Jr||r<Jr/4&&n>.175*Jr){if(e=(P+a*u(d*(1+c)-P*P))/(1+c),n>Jr/4)return[e,e];var F=e,L=.5*e;e=.5*(L+F),t=50;do{var q=u(d-e*e),x=e*(C+A*q)+G*o(e/w)-z;if(!x)break;x<0?L=e:F=e,e=.5*(L+F)}while(Lr(F-L)>Or&&--t>0)}else{e=Or,t=25;do{var B=e*e,H=u(d-B),I=C+A*H,W=e*I+G*o(e/w)-z,T=I+(G-A*B)/H;e-=m=H?W/T:0}while(Lr(m)>Or&&--t>0)}return[e,-P-a*u(d-e*e)]}function $(n,r){for(var e=0,t=1,i=.5,a=50;;){var c=i*i,f=u(i),l=o(1/u(1+c)),g=1-c+i*(1+c)*l,v=(1-f)/g,s=u(v),h=v*(1+c),p=s*(1-c),d=h-n*n,w=u(d),P=r+p+i*w;if(Lr(t-e)<Ur||0==--a||0===P)break;P>0?e=i:t=i,i=.5*(e+t)}if(!a)return null;var m=o(f),y=Br(m),R=1/y,j=2*f*y,M=(-3*i+l*(1+3*c))*j,E=(-g*y-(1-f)*M)/(g*g);return[Jr/4*(n*(-2*R*(.5*E/s*(1-c)-2*i*s*j)+-R*j*w)+-R*(i*(1+c)*E+v*(1+3*c)*j)*o(n/u(h))),m]}function nn(n,r,e){var t,o,i;return n?(t=rn(n,e),r?(o=rn(r,1-e),i=o[1]*o[1]+e*t[0]*t[0]*o[0]*o[0],[[t[0]*o[2]/i,t[1]*t[2]*o[0]*o[1]/i],[t[1]*o[1]/i,-t[0]*t[2]*o[0]*o[2]/i],[t[2]*o[1]*o[2]/i,-e*t[0]*t[1]*o[0]/i]]):[[t[0],0],[t[1],0],[t[2],0]]):(o=rn(r,1-e),[[0,o[0]/o[1]],[1/o[1],0],[o[2]/o[1],0]])}function rn(n,r){var e,t,i,l,g;if(r<Or)return l=_r(n),t=Br(n),e=r*(n-l*t)/4,[l-e*t,t+e*l,1-r*l*l/2,n-e];if(r>=1-Or)return e=(1-r)/4,t=f(n),l=a(n),i=1/t,g=t*c(n),[l+e*(g-n)/(t*t),i-e*l*i*(g-n),i+e*l*i*(g+n),2*qr(Hr(n))-Xr+e*(g-n)/t];var v=[1,0,0,0,0,0,0,0,0],s=[u(r),0,0,0,0,0,0,0,0],h=0;for(t=u(1-r),g=1;Lr(s[h]/v[h])>Or&&h<8;)e=v[h++],s[h]=(e-t)/2,v[h]=(e+t)/2,t=u(e*t),g*=2;i=g*v[h]*n;do{l=s[h]*_r(t=i)/v[h],i=(o(l)+i)/2}while(--h);return[_r(i),l=Br(i),l/Br(i-t),i]}function en(n,r,e){var t=Lr(n),o=Lr(r),i=c(o);if(t){var a=1/_r(t),f=1/(Kr(t)*Kr(t)),l=-(f+e*(i*i*a*a)-1+e),g=(e-1)*f,v=(-l+u(l*l-4*g))/2;return[tn(qr(1/u(v)),e)*Nr(n),tn(qr(u((v/f-1)/e)),1-e)*Nr(r)]}return[0,tn(qr(i),1-e)*Nr(r)]}function tn(n,r){if(!r)return n;if(1===r)return Wr(Kr(n/2+Yr));for(var e=1,t=u(1-r),o=u(r),i=0;Lr(o)>Or;i++){if(n%Jr){var a=qr(t*Kr(n)/e);a<0&&(a+=Jr),n+=a+~~(n/Jr)*Jr}else n+=n;o=(e+t)/2,t=u(e*t),o=((e=o)-t)/2}return n/(Qr(2,i)*e)}function on(n,r){var e=($r-1)/($r+1),t=u(1-e*e),o=tn(Xr,t*t),i=Wr(Kr(Jr/4+Lr(r)/2)),a=Hr(-1*i)/u(e),c=un(a*Br(-1*n),a*_r(-1*n)),f=en(c[0],c[1],t*t);return[-f[1],(r>=0?1:-1)*(.5*o-f[0])]}function un(n,r){var e=n*n,t=r+1,o=1-e-r*r;return[.5*((n>=0?Xr:-Xr)-xr(o,2*n)),-.25*Wr(o*o+4*e)+.5*Wr(t*t+e)]}function an(n,r){var e=r[0]*r[0]+r[1]*r[1];return[(n[0]*r[0]+n[1]*r[1])/e,(n[1]*r[0]-n[0]*r[1])/e]}function cn(n,e){function t(t,o){var i=r.geoAzimuthalEqualAreaRaw(t/e,o);return i[0]*=n,i}return arguments.length<2&&(e=n),1===e?r.geoAzimuthalEqualAreaRaw:e===1/0?fn:(t.invert=function(t,o){var i=r.geoAzimuthalEqualAreaRaw.invert(t/n,o);return i[0]*=e,i},t)}function fn(n,r){return[n*Br(r)/Br(r/=2),2*_r(r)]}function ln(n){function r(n,r){var u=o(n,r);n=u[0],r=u[1];var a=_r(r),c=Br(r),f=Br(n),l=i(e*a+t*c*f),g=_r(l),v=Lr(g)>Or?l/g:1;return[v*t*_r(n),(Lr(n)>Xr?v:-v)*(e*c-t*a*f)]}var e=_r(n),t=Br(n),o=gn(n);return o.invert=gn(-n),r.invert=function(n,r){var t=u(n*n+r*r),i=-_r(t),a=Br(t),c=t*a,f=-r*i,l=t*e,g=u(c*c+f*f-l*l),v=xr(c*l+f*g,f*l-c*g),s=(t>Xr?-1:1)*xr(n*i,t*Br(v)*a+r*_r(v)*i);return o.invert(s,v)},r}function gn(n){var r=_r(n),e=Br(n);return function(n,t){var i=Br(t),u=Br(n)*i,a=_r(n)*i,c=_r(t);return[xr(a,u*e-c*r),o(c*e+u*r)]}}function vn(n){function r(r,l){var g,v=Lr(l);if(v>e){var s=Dr(n-1,Tr(0,Ir((r+Jr)/a)));r+=Jr*(n-1)/n-s*a,g=z(r,v),g[0]=g[0]*re/t-re*(n-1)/(2*n)+s*re/n,g[1]=o+4*(g[1]-i)*u/re,l<0&&(g[1]=-g[1])}else g=ot(r,l);return g[0]*=c,g[1]/=f,g}var e=tt*te,t=z(Jr,e)[0]-z(-Jr,e)[0],o=ot(0,e)[1],i=z(0,e)[1],u=ne-i,a=re/n,c=4/re,f=o+u*u*4/re;return r.invert=function(r,e){r/=c,e*=f;var l=Lr(e);if(l>o){var g=Dr(n-1,Tr(0,Ir((r+Jr)/a)));r=(r+Jr*(n-1)/n-g*a)*t/re;var v=z.invert(r,.25*(l-o)*re/u+i);return v[0]-=Jr*(n-1)/n-g*a,e<0&&(v[1]=-v[1]),v}return ot.invert(r,e)},r}function sn(n){return{type:"Polygon",coordinates:[e.range(-180,180+n/2,n).map(function(n,r){return[n,1&r?90-1e-6:tt]}).concat(e.range(180,-180-n/2,-n).map(function(n,r){return[n,1&r?1e-6-90:-tt]}))]}}function hn(n){function r(r,o){var i,a,s=1-_r(o);if(s&&s<2){var h,p=Xr-o,d=25;do{var w=_r(p),P=Br(p),m=c+xr(w,t-P),y=1+v-2*t*P;p-=h=(p-g*c-t*w+y*m-.5*s*e)/(2*t*w*m)}while(Lr(h)>Ur&&--d>0);i=f*u(y),a=r*m/Jr}else i=f*(n+s),a=r*c/Jr;return[i*_r(a),l-i*Br(a)]}var e,t=1+n,a=_r(1/t),c=o(a),f=2*u(Jr/(e=Jr+4*c*t)),l=.5*f*(t+u(n*(2+n))),g=n*n,v=t*t;return r.invert=function(n,r){var a=n*n+(r-=l)*r,s=(1+v-a/(f*f))/(2*t),h=i(s),p=_r(h),d=c+xr(p,t-s);return[o(n/u(a))*Jr/d,o(1-2*(h-g*c-t*p+(1+v-2*t*s)*d)/e)]},r}function pn(n,r){return r>-at?(n=ve(n,r),n[1]+=ct,n):R(n,r)}function dn(n,r){return Lr(r)>at?(n=ve(n,r),n[1]-=r>0?ct:-ct,n):R(n,r)}function wn(n,r){return Lr(n[0]-r[0])<Or&&Lr(n[1]-r[1])<Or}function Pn(n,r){for(var e,t,o,i=-1,u=n.length,a=n[0],c=[];++i<u;){e=n[i],t=(e[0]-a[0])/r,o=(e[1]-a[1])/r;for(var f=0;f<r;++f)c.push([a[0]+f*t,a[1]+f*o]);a=e}return c.push(e),c}function mn(n){var r,t,o,i,u,a,c,f=[],l=n[0].length;for(c=0;c<l;++c)r=n[0][c],t=r[0][0],o=r[0][1],i=r[1][1],u=r[2][0],a=r[2][1],f.push(Pn([[t+Or,o+Or],[t+Or,i-Or],[u-Or,i-Or],[u-Or,a+Or]],30));for(c=n[1].length-1;c>=0;--c)r=n[1][c],t=r[0][0],o=r[0][1],i=r[1][1],u=r[2][0],a=r[2][1],f.push(Pn([[u-Or,a-Or],[u-Or,i+Or],[t+Or,i+Or],[t+Or,o-Or]],30));return{type:"Polygon",coordinates:[e.merge(f)]}}function yn(n,r){return[3/re*n*u(Jr*Jr/3-r*r),r]}function Rn(n){function r(r,e){if(Lr(Lr(e)-Xr)<Or)return[0,e<0?-2:2];var t=_r(e),o=Qr((1+t)/(1-t),n/2),i=.5*(o+1/o)+Br(r*=n);return[2*_r(r)/i,(o-1/o)/i]}return r.invert=function(r,e){var t=Lr(e);if(Lr(t-2)<Or)return r?null:[0,Nr(e)*Xr];if(t>2)return null;r/=2,e/=2;var i=r*r,u=e*e,a=2*e/(1+i+u);return a=Qr((1+a)/(1-a),1/n),[xr(2*r,1-i-u)/n,o((a-1)/(a+1))]},r}function jn(n,r){return[n*(1+u(Br(r)))/2,r/(Br(r/2)*Br(n/6))]}function Mn(n,r){var e=n*n,t=r*r;return[n*(.975534+t*(e*-.0143059-.119161+t*-.0547009)),r*(1.00384+e*(.0802894+t*-.02855+199025e-9*e)+t*(.0998909+t*-.0491032))]}function En(n,r){return[_r(n)/Br(r),Kr(r)*Br(n)]}function bn(n){function r(r,o){var i=o-n,u=Lr(i)<Or?r*e:Lr(u=Yr+o/2)<Or||Lr(Lr(u)-Xr)<Or?0:r*i/Wr(Kr(u)/t);return[u,i]}var e=Br(n),t=Kr(Yr+n/2);return r.invert=function(r,o){var i,u=o+n;return[Lr(o)<Or?r/e:Lr(i=Yr+u/2)<Or||Lr(Lr(i)-Xr)<Or?0:r*Wr(Kr(i)/t)/o,u]},r}function kn(n,r){return[n,1.25*Wr(Kr(Yr+.4*r))]}function Sn(n){function r(r,t){for(var o,i=Br(t),u=2/(1+i*Br(r)),a=u*i*_r(r),c=u*_r(t),f=e,l=n[f],g=l[0],v=l[1];--f>=0;)l=n[f],g=l[0]+a*(o=g)-c*v,v=l[1]+a*v+c*o;return g=a*(o=g)-c*v,v=a*v+c*o,[g,v]}var e=n.length-1;return r.invert=function(r,t){var i=20,a=r,c=t;do{for(var f,l=e,g=n[l],v=g[0],s=g[1],h=0,p=0;--l>=0;)g=n[l],h=v+a*(f=h)-c*p,p=s+a*p+c*f,v=g[0]+a*(f=v)-c*s,s=g[1]+a*s+c*f;h=v+a*(f=h)-c*p,p=s+a*p+c*f,v=a*(f=v)-c*s-r,s=a*s+c*f-t;var d,w,P=h*h+p*p;a-=d=(v*h+s*p)/P,c-=w=(s*h-v*p)/P}while(Lr(d)+Lr(w)>Or*Or&&--i>0);if(i){var m=u(a*a+c*c),y=2*qr(.5*m),R=_r(y);return[xr(a*R,m*Br(y)),m?o(c*R/m):0]}},r}function An(){return Ln(Ft,[152,-64]).scale(1500).center([-160.908,62.4864]).clipAngle(25)}function Gn(){return Ln(Lt,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Cn(){return Ln(qt,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function zn(){return Ln(xt,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function Fn(){return Ln(Bt,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function Ln(n,e){var t=r.geoProjection(Sn(n)).rotate(e).clipAngle(90),o=r.geoRotation(e),i=t.center;return delete t.rotate,t.center=function(n){return arguments.length?i(o(n)):o.invert(i())},t}function qn(n,r){var e=o(7*_r(r)/(3*Ht));return[Ht*n*(2*Br(2*e/3)-1)/It,9*_r(e/3)/It]}function xn(n,r){for(var e,t=(1+Zr)*_r(r),o=r,i=0;i<25&&(o-=e=(_r(o/2)+_r(o)-t)/(.5*Br(o/2)+Br(o)),!(Lr(e)<Or));i++);return[n*(1+2*Br(o)/Br(o/2))/(3*$r),2*u(3)*_r(o/2)/u(2+$r)]}function Bn(n,r){for(var e,t=u(6/(4+Jr)),o=(1+Jr/4)*_r(r),i=r/2,a=0;a<25&&(i-=e=(i/2+_r(i)-o)/(.5+Br(i)),!(Lr(e)<Or));a++);return[t*(.5+Br(i))*n/1.5,t*i]}function Hn(n,r){var e=r*r,t=e*e;return[n*(.8707-.131979*e+t*(t*(.003971*e-.001529*t)-.013791)),r*(1.007226+e*(.015085+t*(.028874*e-.044475-.005916*t)))]}function In(n,r){return[n*(1+Br(r))/2,2*(r-Kr(r/2))]}function Wn(n,r){var e=r*r;return[n,r*(Nt+e*e*(_t+e*(Kt+Ot*e)))]}function Tn(n,r){if(Lr(r)<Or)return[n,0];var e=Kr(r),t=n*_r(r);return[_r(t)/e,r+(1-Br(t))/e]}function Dn(n){var r=1/(n[0]*n[4]-n[1]*n[3]);return[r*n[4],-r*n[1],r*(n[1]*n[5]-n[2]*n[4]),-r*n[3],r*n[0],r*(n[2]*n[3]-n[0]*n[5])]}function Qn(n,r){return[n[0]*r[0]+n[1]*r[3],n[0]*r[1]+n[1]*r[4],n[0]*r[2]+n[1]*r[5]+n[2],n[3]*r[0]+n[4]*r[3],n[3]*r[1]+n[4]*r[4],n[3]*r[2]+n[4]*r[5]+n[5]]}function Vn(n,r){return[n[0]-r[0],n[1]-r[1]]}function Nn(n){return u(n[0]*n[0]+n[1]*n[1])}function _n(n,r){return xr(n[0]*r[1]-n[1]*r[0],n[0]*r[0]+n[1]*r[1])}function Kn(n,e,t){var o,i,u=e.edges,a=u.length,c={type:"MultiPoint",coordinates:e.face},f=e.face.filter(function(n){return 90!==Lr(n[1])}),l=r.geoBounds({type:"MultiPoint",coordinates:f}),g=!1,v=-1,s=l[1][0]-l[0][0],h=180===s||360===s?[(l[0][0]+l[1][0])/2,(l[0][1]+l[1][1])/2]:r.geoCentroid(c);if(t)for(;++v<a&&u[v]!==t;);++v;for(var p=0;p<a;++p)i=u[(p+v)%a],Array.isArray(i)?(g||(n.point((o=r.geoInterpolate(i[0],h)(Or))[0],o[1]),g=!0),n.point((o=r.geoInterpolate(i[1],h)(Or))[0],o[1])):(g=!1,i!==t&&Kn(n,i,e))}function On(n,r){return n&&r&&n[0]===r[0]&&n[1]===r[1]}function Un(n,r){for(var e,t,o=n.length,i=null,u=0;u<o;++u){e=n[u];for(var a=r.length;--a>=0;)if(t=r[a],e[0]===t[0]&&e[1]===t[1]){if(i)return[i,e];i=e}}}function Jn(n){for(var r=n.length,e=[],t=n[r-1],o=0;o<r;++o)e.push([t,t=n[o]]);return e}function Xn(n){return n.project.invert||n.children&&n.children.some(Xn)}function Yn(n,r){var e=z(n,r);return[e[0]*io,e[1]]}function Zn(n,r){for(var e=0,t=n.length,o=0;e<t;++e)o+=n[e]*r[e];return o}function $n(n,r){return[n[1]*r[2]-n[2]*r[1],n[2]*r[0]-n[0]*r[2],n[0]*r[1]-n[1]*r[0]]}function nr(n){return[xr(n[1],n[0])*ee,o(Tr(-1,Dr(1,n[2])))*ee]}function rr(n){var r=n[0]*te,e=n[1]*te,t=Br(e);return[t*Br(r),t*_r(r),_r(e)]}function er(n,r){return{type:"FeatureCollection",features:n.features.map(function(n){return tr(n,r)})}}function tr(n,r){return{type:"Feature",id:n.id,properties:n.properties,geometry:ir(n.geometry,r)}}function or(n,r){return{type:"GeometryCollection",geometries:n.geometries.map(function(n){return ir(n,r)})}}function ir(n,e){if(!n)return null;if("GeometryCollection"===n.type)return or(n,e);var t;switch(n.type){case"Point":t=ho;break;case"MultiPoint":t=ho;break;case"LineString":t=po;break;case"MultiLineString":t=po;break;case"Polygon":t=wo;break;case"MultiPolygon":t=wo;break;case"Sphere":t=wo;break;default:return null}return r.geoStream(n,e(t)),t.result()}function ur(n){function r(r,t){var o=e?Kr(r*e/2)/e:r/2;if(!t)return[2*o,-n];var i=2*qr(o*_r(t)),u=1/Kr(t);return[_r(i)*u,t+(1-Br(i))*u-n]}var e=_r(n);return r.invert=function(r,t){if(Lr(t+=n)<Or)return[e?2*qr(e*r/2)/e:r,0];var u,a=r*r+t*t,c=0,f=10;do{var l=Kr(c),g=1/Br(c),v=a-2*t*c+c*c;c-=u=(l*v+2*(c-t))/(2+v*g*g+2*(c-t)*l)}while(Lr(u)>Or&&--f>0);var s=r*(l=Kr(c)),h=Kr(Lr(t)<Lr(c+1/l)?.5*o(s):.5*i(s)+Jr/4)/_r(c);return[e?2*qr(e*h)/e:2*h,c]},r}function ar(n,r){var e,t=Dr(18,36*Lr(r)/Jr),o=Ir(t),i=t-o,u=(e=Mo[o])[0],a=e[1],c=(e=Mo[++o])[0],f=e[1],l=(e=Mo[Dr(19,++o)])[0],g=e[1];return[n*(c+i*(l-u)/2+i*i*(l-2*c+u)/2),(r>0?Xr:-Xr)*(f+i*(g-a)/2+i*i*(g-2*f+a)/2)]}function cr(n){function r(r,e){var t=Br(e),o=(n-1)/(n-t*Br(r));return[o*t*_r(r),o*_r(e)]}return r.invert=function(r,e){var t=r*r+e*e,i=u(t),a=(n-u(1-t*(n+1)/(n-1)))/((n-1)/i+i/(n-1));return[xr(r*a,i*u(1-a*a)),i?o(e*a/i):0]},r}function fr(n,r){function e(r,e){var u=t(r,e),a=u[1],c=a*i/(n-1)+o;return[u[0]*o/c,a/c]}var t=cr(n);if(!r)return t;var o=Br(r),i=_r(r);return e.invert=function(r,e){var u=(n-1)/(n-1-e*i);return t.invert(u*r,u*e*o)},e}function lr(n){return Math.floor(n*ko)/ko}function gr(n){return n===zo||n===Lo?[0,n]:[So,lr(n)]}function vr(n){n[0]<=Ao?n[0]=So:n[0]>=Co&&(n[0]=Go),n[1]<=Fo?n[1]=zo:n[1]>=qo&&(n[1]=Lo)}function sr(n){n.forEach(vr)}function hr(n,r){for(var e=0,t=n.length;e<t;++e){var o=n[e];o.polygon=n,r.push(o);for(var i=0,u=o.length;i<u;++i){var a=o[i],c=a[0],f=a[1];if(c<=Ao||c>=Co||f<=Fo||f>=qo){vr(a);for(var l=i+1;l<u;++l){var g=o[l],v=g[0],s=g[1];if(v>Ao&&v<Co&&s>Fo&&s<qo)break}if(l===i+1)continue;if(i){var h=o.slice(0,i+1);h.polygon=n,h[h.length-1]=gr(f),r[r.length-1]=h}else r.pop();if(l>=u)break;r.push(o=o.slice(l-1)),o[0]=gr(o[0][1]),o.polygon=n,i=-1,u=o.length}}}n.length=0}function pr(n){var r,e,t,o,i,u,a=n.length,c={},f={};for(r=0;r<a;++r)e=n[r],t=e[0],i=e[e.length-1],t[0]!==i[0]||t[1]!==i[1]?(e.index=r,c[t]=f[i]=e):(e.polygon.push(e),n[r]=null);for(r=0;r<a;++r)if(e=n[r]){if(t=e[0],i=e[e.length-1],o=f[t],u=c[i],delete c[t],delete f[i],t[0]===i[0]&&t[1]===i[1]){e.polygon.push(e);continue}o?(delete f[t],delete c[o[0]],o.pop(),n[o.index]=null,e=o.concat(e),e.polygon=o.polygon,o===u?e.polygon.push(e):(e.index=a++,n.push(c[e[0]]=f[e[e.length-1]]=e))):u?(delete c[i],delete f[u[u.length-1]],e.pop(),e=e.concat(u),e.polygon=u.polygon,e.index=a++,n[u.index]=null,n.push(c[e[0]]=f[e[e.length-1]]=e)):(e.push(e[0]),e.polygon.push(e))}}function dr(n){wr(n.geometry)}function wr(n){if(n){var r,e,t;switch(n.type){case"GeometryCollection":return void n.geometries.forEach(wr);case"Point":vr(n.coordinates);break;case"MultiPoint":case"LineString":sr(n.coordinates);break;case"MultiLineString":n.coordinates.forEach(sr);break;case"Polygon":hr(n.coordinates,r=[]);break;case"MultiPolygon":for(r=[],e=-1,t=n.coordinates.length;++e<t;)hr(n.coordinates[e],r);break;default:return}pr(r)}}function Pr(n,r){var e=Kr(r/2),t=_r(Yr*e);return[n*(.74482-.34588*t*t),1.70711*e]}function mr(n){function e(n,e){var o=r.geoGnomonicRaw(n,e);return o[0]*=t,o}var t=Br(n);return e.invert=function(n,e){return r.geoGnomonicRaw.invert(n/t,e)},e}function yr(){return Rr([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function Rr(n,r){return Ho(mr,n,r)}function jr(n){function e(r,e){var c=i(Br(e)*Br(r-t)),f=i(Br(e)*Br(r-o)),l=e<0?-1:1;return c*=c,f*=f,[(c-f)/(2*n),l*u(4*a*f-(a-c+f)*(a-c+f))/(2*n)]}if(!(n*=2))return r.geoAzimuthalEquidistantRaw;var t=-n/2,o=-t,a=n*n,c=Kr(o),f=.5/_r(o);return e.invert=function(n,r){var e,a,l=r*r,g=Br(u(l+(e=n+t)*e)),v=Br(u(l+(e=n+o)*e));return[xr(a=g-v,e=(g+v)*c),(r<0?-1:1)*i(u(e*e+a*a)*f)]},e}function Mr(){return Er([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function Er(n,r){return Ho(jr,n,r)}function br(n,r){if(Lr(r)<Or)return[n,0];var e=Lr(r/Xr),t=o(e);if(Lr(n)<Or||Lr(Lr(r)-Xr)<Or)return[0,Nr(r)*Jr*Kr(t/2)];var i=Br(t),a=Lr(Jr/n-n/Jr)/2,c=a*a,f=i/(e+i-1),l=f*(2/e-1),g=l*l,v=g+c,s=f-g,h=c+f;return[Nr(n)*Jr*(a*s+u(c*s*s-v*(f*f-g)))/v,Nr(r)*Jr*(l*h-a*u((c+1)*v-h*h))/v]}function kr(n,r){if(Lr(r)<Or)return[n,0];var e=Lr(r/Xr),t=o(e);if(Lr(n)<Or||Lr(Lr(r)-Xr)<Or)return[0,Nr(r)*Jr*Kr(t/2)];var i=Br(t),a=Lr(Jr/n-n/Jr)/2,c=a*a,f=i*(u(1+c)-a*i)/(1+c*e*e);return[Nr(n)*Jr*f,Nr(r)*Jr*u(1-f*(2*a+f))]}function Sr(n,r){if(Lr(r)<Or)return[n,0];var e=r/Xr,t=o(e);if(Lr(n)<Or||Lr(Lr(r)-Xr)<Or)return[0,Jr*Kr(t/2)];var i=(Jr/n-n/Jr)/2,a=e/(1+Br(t));return[Jr*(Nr(n)*u(i*i+1-a*a)-i),Jr*a]}function Ar(n,r){if(!r)return[n,0];var e=Lr(r);if(!n||e===Xr)return[0,r];var t=e/Xr,o=t*t,i=(8*t-o*(o+2)-5)/(2*o*(t-1)),a=i*i,c=t*i,f=o+a+2*c,l=t+3*i,g=n/Xr,v=g+1/g,s=Nr(Lr(n)-Xr)*u(v*v-4),h=s*s,p=f*(o+a*h-1)+(1-o)*(o*(l*l+4*a)+12*c*a+4*a*a),d=(s*(f+a-1)+2*u(p))/(4*f+h);return[Nr(n)*Xr*d,Nr(r)*Xr*u(1+s*Lr(d)-d*d)]}function Gr(n,r){return[n*u(1-3*r*r/(Jr*Jr)),r]}function Cr(n,r){var e=.90631*_r(r),t=u(1-e*e),o=u(2/(1+t*Br(n/=3)));return[2.66723*t*o*_r(n),1.24104*e*o]}function zr(n,r){var e=Br(r),t=Br(n)*e,o=1-t,i=Br(n=xr(_r(n)*e,-_r(r))),a=_r(n);return e=u(1-t*t),[a*e-i*o,-i*e-a*o]}function Fr(n,r){var e=s(n,r);return[(e[0]+n/Xr)/2,(e[1]+r)/2]}var Lr=Math.abs,qr=Math.atan,xr=Math.atan2,Br=Math.cos,Hr=Math.exp,Ir=Math.floor,Wr=Math.log,Tr=Math.max,Dr=Math.min,Qr=Math.pow,Vr=Math.round,Nr=Math.sign||function(n){return n>0?1:n<0?-1:0},_r=Math.sin,Kr=Math.tan,Or=1e-6,Ur=1e-12,Jr=Math.PI,Xr=Jr/2,Yr=Jr/4,Zr=Math.SQRT1_2,$r=u(2),ne=u(Jr),re=2*Jr,ee=180/Jr,te=Jr/180,oe=function(){var n=Xr,e=r.geoProjectionMutator(v),t=e(n);return t.radius=function(r){return arguments.length?e(n=r*te):n*ee},t.scale(179.976).clipAngle(147)};s.invert=function(n,r){if(!(n*n+4*r*r>Jr*Jr+Or)){var e=n,t=r,o=25;do{var a,c=_r(e),f=_r(e/2),l=Br(e/2),g=_r(t),v=Br(t),s=_r(2*t),h=g*g,p=v*v,d=f*f,w=1-p*l*l,P=w?i(v*l)*u(a=1/w):a=0,m=2*P*v*f-n,y=P*g-r,R=a*(p*d+P*v*l*h),j=a*(.5*c*s-2*P*g*f),M=.25*a*(s*f-P*g*p*c),E=a*(h*l+P*d*v),b=j*M-E*R;if(!b)break;var k=(y*j-m*E)/b,S=(m*M-y*R)/b;e-=k,t-=S}while((Lr(k)>Or||Lr(S)>Or)&&--o>0);return[e,t]}};var ie=function(){return r.geoProjection(s).scale(152.63)},ue=function(){var n=20*te,e=n>=0?1:-1,t=Kr(e*n),o=r.geoProjectionMutator(h),i=o(n),u=i.stream;return i.parallel=function(r){return arguments.length?(t=Kr((e=(n=r*te)>=0?1:-1)*n),o(n)):n*ee},i.stream=function(r){var o=i.rotate(),a=u(r),c=(i.rotate([0,0]),u(r));return i.rotate(o),a.sphere=function(){c.polygonStart(),c.lineStart();for(var r=e*-180;e*r<180;r+=90*e)c.point(r,90*e);for(;e*(r-=n)>=-180;)c.point(r,e*-xr(Br(r*te/2),t)*ee);c.lineEnd(),c.polygonEnd()},a},i.scale(218.695).center([0,28.0974])};p.invert=function(n,r){if(n*=3/8,r*=3/8,!n&&Lr(r)>1)return null;var e=n*n,t=r*r,i=1+e+t,a=u((i-u(i*i-4*r*r))/2),v=o(a)/3,s=a?g(Lr(r/a))/3:l(Lr(n))/3,h=Br(v),p=f(s),d=p*p-h*h;return[2*Nr(n)*xr(c(s)*h,.25-d),2*Nr(r)*xr(p*_r(v),.25+d)]};var ae=function(){return r.geoProjection(p).scale(66.1603)},ce=u(8),fe=Wr(1+$r);d.invert=function(n,r){if((t=Lr(r))<fe)return[n,2*qr(Hr(r))-Xr];var e,t,o=Yr,i=25;do{var u=Br(o/2),a=Kr(o/2);o-=e=(ce*(o-Yr)-Wr(a)-t)/(ce-u*u/(2*a))}while(Lr(e)>Ur&&--i>0);return[n/(Br(o)*(ce-1/_r(o))),Nr(r)*o]};var le=function(){return r.geoProjection(d).scale(112.314)},ge=function(){var n=5,e=r.geoProjectionMutator(w),t=e(n),i=t.stream,u=-Br(.01*te),a=_r(.01*te);return t.lobes=function(r){return arguments.length?e(n=+r):n},t.stream=function(r){var e=t.rotate(),c=i(r),f=(t.rotate([0,0]),i(r));return t.rotate(e),c.sphere=function(){f.polygonStart(),f.lineStart();for(var r=0,e=360/n,t=2*Jr/n,i=90-180/n,c=Xr;r<n;++r,i-=e,c-=t)f.point(xr(a*Br(c),u)*ee,o(a*_r(c))*ee),i<-90?(f.point(-90,-180-i-.01),f.point(-90,-180-i+.01)):(f.point(90,i+.01),f.point(90,i-.01));f.lineEnd(),f.polygonEnd()},c},t.scale(87.8076).center([0,17.1875]).clipAngle(179.999)},ve=m($r/Xr,$r,Jr),se=function(){return r.geoProjection(ve).scale(169.529)},he=2.00276,pe=1.11072;y.invert=function(n,r){var e,t,o=he*r,i=r<0?-Yr:Yr,u=25;do{t=o-$r*_r(i),i-=e=(_r(2*i)+2*i-Jr*_r(t))/(2*Br(2*i)+2+Jr*Br(t)*$r*Br(i))}while(Lr(e)>Or&&--u>0);return t=o-$r*_r(i),[n*(1/Br(t)+pe/Br(i))/he,t]};var de=function(){return r.geoProjection(y).scale(160.857)},we=function(n){var e=0,t=r.geoProjectionMutator(n),o=t(e);return o.parallel=function(n){return arguments.length?t(e=n*te):e*ee},o};R.invert=function(n,r){return[n/Br(r),r]};var Pe=function(){return r.geoProjection(R).scale(152.63)},me=function(){return we(j).scale(123.082).center([0,26.1441]).parallel(45)},ye=function(){var n=.5,e=r.geoProjectionMutator(M),t=e(n);return t.fraction=function(r){return arguments.length?e(n=+r):n},t.scale(158.837)},Re=m(1,4/Jr,Jr),je=function(){return r.geoProjection(Re).scale(152.63)};z.invert=function(n,r){var e=(e=r/ne-1)*e;return[e>0?n*u(Jr/e)/2:0,o(1-e)]};var Me=function(){return r.geoProjection(z).scale(95.6464).center([0,30])},Ee=function(){return we(F).scale(249.828).clipAngle(90)},be=u(3);L.invert=function(n,r){var e=3*o(r/(be*ne));return[ne*n/(be*(2*Br(2*e/3)-1)),e]};var ke=function(){return r.geoProjection(L).scale(156.19)},Se=function(){return we(q).parallel(38.58).scale(195.044)},Ae=function(){return we(x).scale(124.75)};B.invert=function(n,r){var e=u(8/(3*Jr)),t=r/e;return[n/(e*(1-Lr(t)/Jr)),t]};var Ge=function(){return r.geoProjection(B).scale(165.664)};H.invert=function(n,r){var e=2-Lr(r)/u(2*Jr/3);return[n*u(6*Jr)/(2*e),Nr(r)*o((4-e*e)/3)]};var Ce=function(){return r.geoProjection(H).scale(165.664)};I.invert=function(n,r){var e=u(Jr*(4+Jr))/2;return[n*e/(1+u(1-r*r*(4+Jr)/(4*Jr))),r*e/2]};var ze=function(){return r.geoProjection(I).scale(180.739)};W.invert=function(n,r){var e=r*u((4+Jr)/Jr)/2,t=o(e),i=Br(t);return[n/(2/u(Jr*(4+Jr))*(1+i)),o((t+e*(i+2))/(2+Xr))]};var Fe=function(){return r.geoProjection(W).scale(180.739)};T.invert=function(n,r){var e=u(2+Jr),t=r*e/2;return[e*n/(1+Br(t)),t]};var Le=function(){return r.geoProjection(T).scale(173.044)};D.invert=function(n,r){var e=1+Xr,t=u(e/2);return[2*n*t/(1+Br(r*=t)),o((r+_r(r))/e)]};var qe=function(){return r.geoProjection(D).scale(173.044)},xe=3+2*$r;Q.invert=function(n,r){if(!(e=p.invert(n/1.2,1.065*r)))return null;var e,t=e[0],o=e[1],i=20;n/=xe,r/=xe;do{var a=t/2,c=o/2,f=_r(a),l=Br(a),g=_r(c),v=Br(c),s=Br(o),h=u(s),d=g/(v+$r*l*h),w=d*d,P=u(2/(1+w)),m=$r*v+(l+f)*h,y=$r*v+(l-f)*h,R=m/y,j=u(R),M=j-1/j,E=j+1/j,b=P*M-2*Wr(j)-n,k=P*d*E-2*qr(d)-r,S=g&&Zr*h*f*w/g,A=($r*l*v+h)/(2*(v+$r*l*h)*(v+$r*l*h)*h),G=-.5*d*P*P*P,C=G*S,z=G*A,F=(F=2*v+$r*h*(l-f))*F*j,L=($r*l*v*h+s)/F,q=-($r*f*g)/(h*F),x=M*C-2*L/j+P*(L+L/R),B=M*z-2*q/j+P*(q+q/R),H=d*E*C-2*S/(1+w)+P*E*S+P*d*(L-L/R),I=d*E*z-2*A/(1+w)+P*E*A+P*d*(q-q/R),W=B*H-I*x;if(!W)break;var T=(k*B-b*I)/W,D=(b*H-k*x)/W;t-=T,o=Tr(-Xr,Dr(Xr,o-D))}while((Lr(T)>Or||Lr(D)>Or)&&--i>0);return Lr(Lr(o)-Xr)<Or?[0,o]:i&&[t,o]};var Be=function(){return r.geoProjection(Q).scale(62.5271)},He=Br(35*te);V.invert=function(n,r){var e=r/(1+He);return[n&&n/(He*u(1-e*e)),2*qr(e)]};var Ie=function(){return r.geoProjection(V).scale(137.152)};N.invert=function(n,r){var e=qr(r/ne),t=Br(e),o=2*e;return[n*ne/2/(Br(o)*t*t),o]};var We=function(){return r.geoProjection(N).scale(135.264)},Te=function(n){function e(n){return i(_(n))}function t(n){e[n]=function(r){return arguments.length?(i[n](r),e):i[n]()}}null==n&&(n=r.geoOrthographic);var i=n(),u=r.geoEquirectangular().scale(ee).precision(0).clipAngle(null).translate([0,0]);return i.invert&&(e.invert=function(n){return K(i.invert(n))}),e.stream=function(n){var r=i.stream(n),e=u.stream({point:function(n,e){r.point(n/2,o(Kr(-e/2*te))*ee)},lineStart:function(){r.lineStart()},lineEnd:function(){r.lineEnd()},polygonStart:function(){r.polygonStart()},polygonEnd:function(){r.polygonEnd()}});return e.sphere=r.sphere,e},e.rotate=function(n){return arguments.length?(u.rotate(n),e):u.rotate()},e.center=function(n){return arguments.length?(i.center(_(n)),e):K(i.center())},t("clipAngle"),t("clipExtent"),t("scale"),t("translate"),t("precision"),e.scale(249.5)},De=function(){var n=6,e=30*te,t=Br(e),i=_r(e),u=r.geoProjectionMutator(O),a=u(e,n),c=a.stream,f=-Br(.01*te),l=_r(.01*te);return a.radius=function(r){return arguments.length?(t=Br(e=r*te),i=_r(e),u(e,n)):e*ee},a.lobes=function(r){return arguments.length?u(e,n=+r):n},a.stream=function(r){var e=a.rotate(),u=c(r),g=(a.rotate([0,0]),c(r));return a.rotate(e),u.sphere=function(){g.polygonStart(),g.lineStart();for(var r=0,e=2*Jr/n,u=0;r<n;++r,u-=e)g.point(xr(l*Br(u),f)*ee,o(l*_r(u))*ee),g.point(xr(i*Br(u-e/2),t)*ee,o(i*_r(u-e/2))*ee);g.lineEnd(),g.polygonEnd()},u},a.rotate([90,-40]).scale(91.7095).clipAngle(179.999)},Qe=function(n,r,e,t,i,a,c,f){function l(u,l){if(!l)return[n*u/Jr,0];var g=l*l,v=n+g*(r+g*(e+g*t)),s=l*(i-1+g*(a-f+g*c)),h=(v*v+s*s)/(2*s),p=u*o(v/h)/Jr;return[h*_r(p),l*(1+g*f)+h*(1-Br(p))]}return arguments.length<8&&(f=0),l.invert=function(l,g){var v,s,h=Jr*l/n,p=g,d=50;do{var w=p*p,P=n+w*(r+w*(e+w*t)),m=p*(i-1+w*(a-f+w*c)),y=P*P+m*m,R=2*m,j=y/R,M=j*j,E=o(P/j)/Jr,b=h*E,k=P*P,S=(2*r+w*(4*e+6*w*t))*p,A=i+w*(3*a+5*w*c),G=2*(P*S+m*(A-1)),C=2*(A-1),z=(G*R-y*C)/(R*R),F=Br(b),L=_r(b),q=j*F,x=j*L,B=h/Jr*(1/u(1-k/M))*(S*j-P*z)/M,H=x-l,I=p*(1+w*f)+j-q-g,W=z*L+q*B,T=q*E,D=1+z-(z*F-x*B),Q=x*E,V=W*Q-D*T;if(!V)break;h-=v=(I*W-H*D)/V,p-=s=(H*Q-I*T)/V}while((Lr(v)>Or||Lr(s)>Or)&&--d>0);return[h,p]},l},Ve=Qe(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),Ne=function(){return r.geoProjection(Ve).scale(149.995)},_e=Qe(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),Ke=function(){return r.geoProjection(_e).scale(153.93)},Oe=Qe(5/6*Jr,-.62636,-.0344,0,1.3493,-.05524,0,.045),Ue=function(){return r.geoProjection(Oe).scale(130.945)};X.invert=function(n,r){var e,t=n,o=r,i=50;do{var u=o*o;o-=e=(o*(1+u/12)-r)/(1+u/4)}while(Lr(e)>Or&&--i>0);i=50,n/=1-.162388*u;do{var a=(a=t*t)*a | ||
;t-=e=(t*(.87-952426e-9*a)-n)/(.87-.00476213*a)}while(Lr(e)>Or&&--i>0);return[t,o]};var Je=function(){return r.geoProjection(X).scale(131.747)},Xe=Qe(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762),Ye=function(){return r.geoProjection(Xe).scale(131.087)},Ze=function(n){function r(r,t){var o=r>0?-.5:.5,i=n(r+o*Jr,t);return i[0]-=o*e,i}var e=n(Xr,0)[0]-n(-Xr,0)[0];return n.invert&&(r.invert=function(r,t){var o=r>0?-.5:.5,i=n.invert(r+o*e,t),u=i[0]-o*Jr;return u<-Jr?u+=2*Jr:u>Jr&&(u-=2*Jr),i[0]=u,i}),r};Y.invert=function(n,r){var e=Nr(n),t=Nr(r),i=-e*n,u=-t*r,a=u/i<1,c=$(a?u:i,a?i:u),f=c[0],l=c[1],g=Br(l);return a&&(f=-Xr-f),[e*(xr(_r(f)*g,-_r(l))+Jr),t*o(Br(f)*g)]};var $e=function(){return r.geoProjection(Ze(Y)).scale(239.75)};on.invert=function(n,r){var e=($r-1)/($r+1),t=u(1-e*e),o=tn(Xr,t*t),i=nn(.5*o-r,-n,t*t),a=an(i[0],i[1]);return[xr(a[1],a[0])/-1,2*qr(Hr(-.5*Wr(e*a[0]*a[0]+e*a[1]*a[1])))-Xr]};var nt=function(){return r.geoProjection(Ze(on)).scale(151.496)};fn.invert=function(n,r){var e=2*o(r/2);return[n*Br(e/2)/Br(e),e]};var rt=function(){var n=2,e=r.geoProjectionMutator(cn),t=e(n);return t.coefficient=function(r){return arguments.length?e(n=+r):n},t.scale(169.529)},et=function(){var n=0,e=r.geoProjectionMutator(ln),t=e(n),o=t.rotate,i=t.stream,u=r.geoCircle();return t.parallel=function(r){if(!arguments.length)return n*ee;var o=t.rotate();return e(n=r*te).rotate(o)},t.rotate=function(r){return arguments.length?(o.call(t,[r[0],r[1]-n*ee]),u.center([-r[0],-r[1]]),t):(r=o.call(t),r[1]+=n*ee,r)},t.stream=function(n){return n=i(n),n.sphere=function(){n.polygonStart();var r,e=u.radius(89.99)().coordinates[0],t=e.length-1,o=-1;for(n.lineStart();++o<t;)n.point((r=e[o])[0],r[1]);for(n.lineEnd(),e=u.radius(90.01)().coordinates[0],t=e.length-1,n.lineStart();--o>=0;)n.point((r=e[o])[0],r[1]);n.lineEnd(),n.polygonEnd()},n},t.scale(79.4187).parallel(45).clipAngle(179.999)},tt=41+48/36+37/3600,ot=q(0),it=function(){var n=4,e=r.geoProjectionMutator(vn),t=e(n),o=t.stream;return t.lobes=function(r){return arguments.length?e(n=+r):n},t.stream=function(e){var i=t.rotate(),u=o(e),a=(t.rotate([0,0]),o(e));return t.rotate(i),u.sphere=function(){r.geoStream(sn(180/n),a)},u},t.scale(239.75)},ut=function(){var n=1,e=r.geoProjectionMutator(hn),t=e(n);return t.ratio=function(r){return arguments.length?e(n=+r):n},t.scale(167.774).center([0,18.67])},at=.7109889596207567,ct=.0528035274542;pn.invert=function(n,r){return r>-at?ve.invert(n,r-ct):R.invert(n,r)};var ft=function(){return r.geoProjection(pn).rotate([-20,-55]).scale(164.263).center([0,-5.4036])};dn.invert=function(n,r){return Lr(r)>at?ve.invert(n,r+(r>0?ct:-ct)):R.invert(n,r)};var lt=function(){return r.geoProjection(dn).scale(152.63)},gt=function(n,e){function t(r,t){for(var o=t<0?-1:1,i=e[+(t<0)],u=0,a=i.length-1;u<a&&r>i[u][2][0];++u);var c=n(r-i[u][1][0],t);return c[0]+=n(i[u][1][0],o*t>o*i[u][0][1]?i[u][0][1]:t)[0],c}var o=mn(e);e=e.map(function(n){return n.map(function(n){return[[n[0][0]*te,n[0][1]*te],[n[1][0]*te,n[1][1]*te],[n[2][0]*te,n[2][1]*te]]})});var i=e.map(function(r){return r.map(function(r){var e,t=n(r[0][0],r[0][1])[0],o=n(r[2][0],r[2][1])[0],i=n(r[1][0],r[0][1])[1],u=n(r[1][0],r[1][1])[1];return i>u&&(e=i,i=u,u=e),[[t,i],[o,u]]})});n.invert&&(t.invert=function(r,o){for(var u=i[+(o<0)],a=e[+(o<0)],c=0,f=u.length;c<f;++c){var l=u[c];if(l[0][0]<=r&&r<l[1][0]&&l[0][1]<=o&&o<l[1][1]){var g=n.invert(r-n(a[c][1][0],0)[0],o);return g[0]+=a[c][1][0],wn(t(g[0],g[1]),[r,o])?g:null}}});var u=r.geoProjection(t),a=u.stream;return u.stream=function(n){var e=u.rotate(),t=a(n),i=(u.rotate([0,0]),a(n));return u.rotate(e),t.sphere=function(){r.geoStream(o,i)},t},u},vt=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],st=function(){return gt(y,vt).scale(160.857)},ht=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],pt=function(){return gt(dn,ht).scale(152.63)},dt=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],wt=function(){return gt(ve,dt).scale(169.529)},Pt=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]],mt=function(){return gt(ve,Pt).scale(169.529).rotate([20,0])},yt=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]],Rt=function(){return gt(pn,yt).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},jt=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]],Mt=function(){return gt(R,jt).scale(152.63).rotate([-20,0])};yn.invert=function(n,r){return[re/3*n/u(Jr*Jr/3-r*r),r]};var Et=function(){return r.geoProjection(yn).scale(158.837)},bt=function(){var n=.5,e=r.geoProjectionMutator(Rn),t=e(n);return t.spacing=function(r){return arguments.length?e(n=+r):n},t.scale(124.75)},kt=Jr/$r;jn.invert=function(n,r){var e=Lr(n),t=Lr(r),o=Or,a=Xr;t<kt?a*=t/kt:o+=6*i(kt/t);for(var c=0;c<25;c++){var f=_r(a),l=u(Br(a)),g=_r(a/2),v=Br(a/2),s=_r(o/6),h=Br(o/6),p=.5*o*(1+l)-e,d=a/(v*h)-t,w=l?-.25*o*f/l:0,P=.5*(1+l),m=(1+.5*a*g/v)/(v*h),y=a/v*(s/6)/(h*h),R=w*y-m*P,j=(p*y-d*P)/R,M=(d*w-p*m)/R;if(a-=j,o-=M,Lr(j)<Or&&Lr(M)<Or)break}return[n<0?-o:o,r<0?-a:a]};var St=function(){return r.geoProjection(jn).scale(97.2672)};Mn.invert=function(n,r){var e=Nr(n)*Jr,t=r/2,o=50;do{var i=e*e,u=t*t,a=e*t,c=e*(.975534+u*(i*-.0143059-.119161+u*-.0547009))-n,f=t*(1.00384+i*(.0802894+u*-.02855+199025e-9*i)+u*(.0998909+u*-.0491032))-r,l=.975534-u*(.119161+3*i*.0143059+.0547009*u),g=-a*(.238322+.2188036*u+.0286118*i),v=a*(.1605788+7961e-7*i+-.0571*u),s=1.00384+i*(.0802894+199025e-9*i)+u*(3*(.0998909-.02855*i)-.245516*u),h=g*v-s*l,p=(f*g-c*s)/h,d=(c*v-f*l)/h;e-=p,t-=d}while((Lr(p)>Or||Lr(d)>Or)&&--o>0);return o&&[e,t]};var At=function(){return r.geoProjection(Mn).scale(139.98)};En.invert=function(n,r){var e=n*n,t=r*r,a=t+1,c=n?Zr*u((a-u(e*e+2*e*(t-1)+a*a))/e+1):1/u(a);return[o(n*c),Nr(r)*i(c)]};var Gt=function(){return r.geoProjection(En).scale(144.049).clipAngle(89.999)},Ct=function(){return we(bn).parallel(40).scale(158.837)};kn.invert=function(n,r){return[n,2.5*qr(Hr(.8*r))-.625*Jr]};var zt=function(){return r.geoProjection(kn).scale(108.318)},Ft=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Lt=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],qt=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],xt=[[.9245,0],[0,0],[.01943,0]],Bt=[[.721316,0],[0,0],[-.00881625,-.00617325]],Ht=u(6),It=u(7);qn.invert=function(n,r){var e=3*o(r*It/9);return[n*It/(Ht*(2*Br(2*e/3)-1)),o(3*_r(e)*Ht/7)]};var Wt=function(){return r.geoProjection(qn).scale(164.859)};xn.invert=function(n,r){var e=r*u(2+$r)/(2*u(3)),t=2*o(e);return[3*$r*n/(1+2*Br(t)/Br(t/2)),o((e+_r(t))/(1+Zr))]};var Tt=function(){return r.geoProjection(xn).scale(188.209)};Bn.invert=function(n,r){var e=u(6/(4+Jr)),t=r/e;return Lr(Lr(t)-Xr)<Or&&(t=t<0?-Xr:Xr),[1.5*n/(e*(.5+Br(t))),o((t/2+_r(t))/(1+Jr/4))]};var Dt=function(){return r.geoProjection(Bn).scale(166.518)};Hn.invert=function(n,r){var e,t=r,o=25;do{var i=t*t,u=i*i;t-=e=(t*(1.007226+i*(.015085+u*(.028874*i-.044475-.005916*u)))-r)/(1.007226+i*(.045255+u*(.259866*i-.311325-.005916*11*u)))}while(Lr(e)>Or&&--o>0);return[n/(.8707+(i=t*t)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),t]};var Qt=function(){return r.geoProjection(Hn).scale(175.295)};In.invert=function(n,r){for(var e=r/2,t=0,o=1/0;t<10&&Lr(o)>Or;++t){var i=Br(r/2);r-=o=(r-Kr(r/2)-e)/(1-.5/(i*i))}return[2*n/(1+Br(r)),r]};var Vt=function(){return r.geoProjection(In).scale(152.63)},Nt=1.0148,_t=.23185,Kt=-.14499,Ot=.02406,Ut=Nt,Jt=5*_t,Xt=7*Kt,Yt=9*Ot;Wn.invert=function(n,r){r>1.790857183?r=1.790857183:r<-1.790857183&&(r=-1.790857183);var e,t=r;do{var o=t*t;t-=e=(t*(Nt+o*o*(_t+o*(Kt+Ot*o)))-r)/(Ut+o*o*(Jt+o*(Xt+Yt*o)))}while(Lr(e)>Or);return[n,t]};var Zt=function(){return r.geoProjection(Wn).scale(139.319)};Tn.invert=function(n,r){if(Lr(r)<Or)return[n,0];var e,t=n*n+r*r,u=.5*r,a=10;do{var c=Kr(u),f=1/Br(u),l=t-2*r*u+u*u;u-=e=(c*l+2*(u-r))/(2+l*f*f+2*(u-r)*c)}while(Lr(e)>Or&&--a>0);return c=Kr(u),[(Lr(r)<Lr(u+1/c)?o(n*c):Nr(n)*(i(Lr(n*c))+Xr))/_r(u),u]};var $t=function(){return r.geoProjection(Tn).scale(103.74)},no=function(n,r){var e=Vn(n[1],n[0]),t=Vn(r[1],r[0]),o=_n(e,t),i=Nn(e)/Nn(t);return Qn([1,0,n[0][0],0,1,n[0][1]],Qn([i,0,0,0,i,0],Qn([Br(o),_r(o),0,-_r(o),Br(o),0],[1,0,-r[0][0],0,1,-r[0][1]])))},ro=function(n,e,t){function o(n,r){if(n.edges=Jn(n.face),r.face){var e=n.shared=Un(n.face,r.face),t=no(e.map(r.project),e.map(n.project));n.transform=r.transform?Qn(r.transform,t):t;for(var i=r.edges,u=0,a=i.length;u<a;++u)On(e[0],i[u][1])&&On(e[1],i[u][0])&&(i[u]=n),On(e[0],i[u][0])&&On(e[1],i[u][1])&&(i[u]=n);for(i=n.edges,u=0,a=i.length;u<a;++u)On(e[0],i[u][0])&&On(e[1],i[u][1])&&(i[u]=r),On(e[0],i[u][1])&&On(e[1],i[u][0])&&(i[u]=r)}else n.transform=r.transform;return n.children&&n.children.forEach(function(r){o(r,n)}),n}function i(n,r){var t,o=e(n,r),i=o.project([n*ee,r*ee]);return(t=o.transform)?[t[0]*i[0]+t[1]*i[1]+t[2],-(t[3]*i[0]+t[4]*i[1]+t[5])]:(i[1]=-i[1],i)}function u(n,r){var e=n.project.invert,t=n.transform,o=r;if(t&&(t=Dn(t),o=[t[0]*o[0]+t[1]*o[1]+t[2],t[3]*o[0]+t[4]*o[1]+t[5]]),e&&n===a(i=e(o)))return i;for(var i,c=n.children,f=0,l=c&&c.length;f<l;++f)if(i=u(c[f],r))return i}function a(n){return e(n[0]*te,n[1]*te)}t=null==t?-Jr/6:t,o(n,{transform:[Br(t),_r(t),0,-_r(t),Br(t),0]}),Xn(n)&&(i.invert=function(r,e){var t=u(n,[r,-e]);return t&&(t[0]*=te,t[1]*=te,t)});var c=r.geoProjection(i),f=c.stream;return c.stream=function(r){var e=c.rotate(),t=f(r),o=(c.rotate([0,0]),f(r));return c.rotate(e),t.sphere=function(){o.polygonStart(),o.lineStart(),Kn(o,n),o.lineEnd(),o.polygonEnd()},t},c},eo=[[0,90],[-90,0],[0,0],[90,0],[180,0],[0,-90]],to=[[0,2,1],[0,3,2],[5,1,2],[5,2,3],[0,1,4],[0,4,3],[5,4,1],[5,3,4]].map(function(n){return n.map(function(n){return eo[n]})}),oo=function(n){n=n||function(n){var e=r.geoCentroid({type:"MultiPoint",coordinates:n});return r.geoGnomonic().scale(1).translate([0,0]).rotate([-e[0],-e[1]])};var e=to.map(function(r){return{face:r,project:n(r)}});return[-1,0,0,1,0,1,4,5].forEach(function(n,r){var t=e[n];t&&(t.children||(t.children=[])).push(e[r])}),ro(e[0],function(n,r){return e[n<-Jr/2?r<0?6:4:n<0?r<0?2:0:n<Jr/2?r<0?3:1:r<0?7:5]}).scale(101.858).center([0,45])},io=2/u(3);Yn.invert=function(n,r){return z.invert(n/io,r)};var uo=function(n){n=n||function(n){var e=r.geoCentroid({type:"MultiPoint",coordinates:n});return r.geoProjection(Yn).translate([0,0]).scale(1).rotate(e[1]>0?[-e[0],0]:[180-e[0],180])};var e=to.map(function(r){return{face:r,project:n(r)}});return[-1,0,0,1,0,1,4,5].forEach(function(n,r){var t=e[n];t&&(t.children||(t.children=[])).push(e[r])}),ro(e[0],function(n,r){return e[n<-Jr/2?r<0?6:4:n<0?r<0?2:0:n<Jr/2?r<0?3:1:r<0?7:5]}).scale(121.906).center([0,48.5904])},ao=function(n){function e(n,r){var e=Br(r),t=[e*Br(n),e*_r(n),_r(r)],i=n<-Jr/2?r<0?6:4:n<0?r<0?2:0:n<Jr/2?r<0?3:1:r<0?7:5,a=o[i];return u[Zn(a[0],t)<0?8+3*i:Zn(a[1],t)<0?8+3*i+1:Zn(a[2],t)<0?8+3*i+2:i]}n=n||function(n){var e=6===n.length?r.geoCentroid({type:"MultiPoint",coordinates:n}):n[0];return r.geoGnomonic().scale(1).translate([0,0]).rotate([-e[0],-e[1]])};var t=to.map(function(n){for(var r,e=n.map(rr),t=e.length,o=e[t-1],i=[],u=0;u<t;++u)r=e[u],i.push(nr([.9486832980505138*o[0]+.31622776601683794*r[0],.9486832980505138*o[1]+.31622776601683794*r[1],.9486832980505138*o[2]+.31622776601683794*r[2]]),nr([.9486832980505138*r[0]+.31622776601683794*o[0],.9486832980505138*r[1]+.31622776601683794*o[1],.9486832980505138*r[2]+.31622776601683794*o[2]])),o=r;return i}),o=[],i=[-1,0,0,1,0,1,4,5];t.forEach(function(n,r){for(var e=to[r],u=e.length,a=o[r]=[],c=0;c<u;++c)t.push([e[c],n[(2*c+2)%(2*u)],n[(2*c+1)%(2*u)]]),i.push(r),a.push($n(rr(n[(2*c+2)%(2*u)]),rr(n[(2*c+1)%(2*u)])))});var u=t.map(function(r){return{project:n(r),face:r}});return i.forEach(function(n,r){var e=u[n];e&&(e.children||(e.children=[])).push(u[r])}),ro(u[0],e).scale(110.625).center([0,45])},co=function(){},fo=function(n){if((r=n.length)<4)return!1;for(var r,e=0,t=n[r-1][1]*n[0][0]-n[r-1][0]*n[0][1];++e<r;)t+=n[e-1][1]*n[e][0]-n[e-1][0]*n[e][1];return t<=0},lo=function(n,r){for(var e=r[0],t=r[1],o=!1,i=0,u=n.length,a=u-1;i<u;a=i++){var c=n[i],f=c[0],l=c[1],g=n[a],v=g[0],s=g[1];l>t^s>t&&e<(v-f)*(t-l)/(s-l)+f&&(o=!o)}return o},go=function(n,r){var e,t=r.stream;if(!t)throw new Error("invalid projection");switch(n&&n.type){case"Feature":e=tr;break;case"FeatureCollection":e=er;break;default:e=ir}return e(n,t)},vo=[],so=[],ho={point:function(n,r){vo.push([n,r])},result:function(){var n=vo.length?vo.length<2?{type:"Point",coordinates:vo[0]}:{type:"MultiPoint",coordinates:vo}:null;return vo=[],n}},po={lineStart:co,point:function(n,r){vo.push([n,r])},lineEnd:function(){vo.length&&(so.push(vo),vo=[])},result:function(){var n=so.length?so.length<2?{type:"LineString",coordinates:so[0]}:{type:"MultiLineString",coordinates:so}:null;return so=[],n}},wo={polygonStart:co,lineStart:co,point:function(n,r){vo.push([n,r])},lineEnd:function(){var n=vo.length;if(n){do{vo.push(vo[0].slice())}while(++n<4);so.push(vo),vo=[]}},polygonEnd:co,result:function(){if(!so.length)return null;var n=[],r=[];return so.forEach(function(e){fo(e)?n.push([e]):r.push(e)}),r.forEach(function(r){var e=r[0];n.some(function(n){if(lo(n[0],e))return n.push(r),!0})||n.push([r])}),so=[],n.length?n.length>1?{type:"MultiPolygon",coordinates:n}:{type:"Polygon",coordinates:n[0]}:null}},Po=function(n){function e(r,e){var o=Lr(r)<Xr,i=n(o?r:r>0?r-Jr:r+Jr,e),u=(i[0]-i[1])*Zr,a=(i[0]+i[1])*Zr;if(o)return[u,a];var c=t*Zr,f=u>0^a>0?-1:1;return[f*u-Nr(a)*c,f*a-Nr(u)*c]}var t=n(Xr,0)[0]-n(-Xr,0)[0];return n.invert&&(e.invert=function(r,e){var o=(r+e)*Zr,i=(e-r)*Zr,u=Lr(o)<.5*t&&Lr(i)<.5*t;if(!u){var a=t*Zr,c=o>0^i>0?-1:1,f=-c*(r+(i>0?1:-1)*a),l=-c*(e+(o>0?1:-1)*a);o=(-f-l)*Zr,i=(f-l)*Zr}var g=n.invert(o,i);return u||(g[0]+=o>0?Jr:-Jr),g}),r.geoProjection(e).rotate([-90,-90,45]).clipAngle(179.999)},mo=function(){return Po(Y).scale(176.423)},yo=function(){return Po(on).scale(111.48)},Ro=function(n,r){function e(n){n[0]=+n[0].toFixed(r),n[1]=+n[1].toFixed(r)}function t(n){n.forEach(e)}function o(n){n.forEach(t)}function i(n){if(n)switch(n.type){case"GeometryCollection":n.geometries.forEach(i);break;case"Point":e(n.coordinates);break;case"MultiPoint":case"LineString":t(n.coordinates);break;case"MultiLineString":case"Polygon":o(n.coordinates);break;case"MultiPolygon":n.coordinates.forEach(o);break;default:return}}function u(n){i(n.geometry)}if(!(0<=(r=+r)&&r<=20))throw new Error("invalid digits");if(n)switch(n.type){case"Feature":u(n);break;case"FeatureCollection":n.features.forEach(u);break;default:i(n)}return n},jo=function(){return we(ur).scale(131.215)},Mo=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];Mo.forEach(function(n){n[1]*=1.0144}),ar.invert=function(n,r){var e=r/Xr,t=90*e,o=Dr(18,Lr(t/5)),i=Tr(0,Ir(o));do{var u=Mo[i][1],a=Mo[i+1][1],c=Mo[Dr(19,i+2)][1],f=c-u,l=c-2*a+u,g=2*(Lr(e)-a)/f,v=l/f,s=g*(1-v*g*(1-2*v*g));if(s>=0||1===i){t=(r>=0?5:-5)*(s+o);var h,p=50;do{o=Dr(18,Lr(t)/5),i=Ir(o),s=o-i,u=Mo[i][1],a=Mo[i+1][1],c=Mo[Dr(19,i+2)][1],t-=(h=(r>=0?Xr:-Xr)*(a+s*(c-u)/2+s*s*(c-2*a+u)/2)-r)*ee}while(Lr(h)>Ur&&--p>0);break}}while(--i>=0);var d=Mo[i][0],w=Mo[i+1][0],P=Mo[Dr(19,i+2)][0];return[n/(w+s*(P-d)/2+s*s*(P-2*w+d)/2),t*te]};var Eo=function(){return r.geoProjection(ar).scale(152.63)},bo=function(){var n=2,e=0,t=r.geoProjectionMutator(fr),o=t(n,e);return o.distance=function(r){return arguments.length?t(n=+r,e):n},o.tilt=function(r){return arguments.length?t(n,e=r*te):e*ee},o.scale(432.147).clipAngle(i(1/n)*ee-1e-6)},ko=1e4,So=-180,Ao=So+1e-4,Go=180,Co=Go-1e-4,zo=-90,Fo=zo+1e-4,Lo=90,qo=Lo-1e-4,xo=function(n){if(n)switch(n.type){case"Feature":dr(n);break;case"FeatureCollection":n.features.forEach(dr);break;default:wr(n)}return n};Pr.invert=function(n,r){var e=r/1.70711,t=_r(Yr*e);return[n/(.74482-.34588*t*t),2*qr(e)]};var Bo=function(){return r.geoProjection(Pr).scale(146.153)},Ho=function(n,e,t){var i=r.geoInterpolate(e,t),u=i(.5),a=r.geoRotation([-u[0],-u[1]])(e),c=i.distance/2,f=-o(_r(a[1]*te)/_r(c)),l=[-u[0],-u[1],-(a[0]>0?Jr-f:f)*ee],g=r.geoProjection(n(c)).rotate(l),v=r.geoRotation(l),s=g.center;return delete g.rotate,g.center=function(n){return arguments.length?s(v(n)):v.invert(s())},g.clipAngle(90)};br.invert=function(n,r){if(Lr(r)<Or)return[n,0];if(Lr(n)<Or)return[0,Xr*_r(2*qr(r/Jr))];var e=(n/=Jr)*n,t=(r/=Jr)*r,o=e+t,a=o*o,c=-Lr(r)*(1+o),f=c-2*t+e,l=-2*c+1+2*t+a,g=t/l+(2*f*f*f/(l*l*l)-9*c*f/(l*l))/27,v=(c-f*f/(3*l))/l,s=2*u(-v/3),h=i(3*g/(v*s))/3;return[Jr*(o-1+u(1+2*(e-t)+a))/(2*n),Nr(r)*Jr*(-s*Br(h+Jr/3)-f/(3*l))]};var Io=function(){return r.geoProjection(br).scale(79.4183)};kr.invert=function(n,r){if(!n)return[0,Xr*_r(2*qr(r/Jr))];var e=Lr(n/Jr),t=(1-e*e-(r/=Jr)*r)/(2*e),o=t*t,i=u(o+1);return[Nr(n)*Jr*(i-t),Nr(r)*Xr*_r(2*xr(u((1-2*t*e)*(t+i)-e),u(i+t+e)))]};var Wo=function(){return r.geoProjection(kr).scale(79.4183)};Sr.invert=function(n,r){if(!r)return[n,0];var e=r/Jr,t=(Jr*Jr*(1-e*e)-n*n)/(2*Jr*n);return[n?Jr*(Nr(n)*u(t*t+1)-t):0,Xr*_r(2*qr(e))]};var To=function(){return r.geoProjection(Sr).scale(79.4183)};Ar.invert=function(n,r){var e;if(!n||!r)return[n,r];r/=Jr;var t=Nr(n)*n/Xr,o=(t*t-1+4*r*r)/Lr(t),i=o*o,a=2*r,c=50;do{var f=a*a,l=(8*a-f*(f+2)-5)/(2*f*(a-1)),g=(3*a-f*a-10)/(2*f*a),v=l*l,s=a*l,h=a+l,p=h*h,d=a+3*l,w=p*(f+v*i-1)+(1-f)*(f*(d*d+4*v)+v*(12*s+4*v)),P=-2*h*(4*s*v+(1-4*f+3*f*f)*(1+g)+v*(14*f-6-i+(8*f-8-2*i)*g)+s*(12*f-8+(10*f-10-i)*g)),m=u(w);a-=e=(o*(p+v-1)+2*m-t*(4*p+i))/(o*(2*l*g+2*h*(1+g))+P/m-8*h*(o*(-1+v+p)+2*m)*(1+g)/(i+4*p))}while(e>Or&&--c>0);return[Nr(n)*(u(o*o+4)+o)*Jr/4,Xr*a]};var Do=function(){return r.geoProjection(Ar).scale(127.16)},Qo=4*Jr+3*u(3),Vo=2*u(2*Jr*u(3)/Qo),No=m(Vo*u(3)/Jr,Vo,Qo/6),_o=function(){return r.geoProjection(No).scale(176.84)};Gr.invert=function(n,r){return[n/u(1-3*r*r/(Jr*Jr)),r]};var Ko=function(){return r.geoProjection(Gr).scale(152.63)};Cr.invert=function(n,r){var e=n/2.66723,t=r/1.24104,i=u(e*e+t*t),a=2*o(i/2);return[3*xr(n*Kr(a),2.66723*i),i&&o(r*_r(a)/(1.24104*.90631*i))]};var Oo=function(){return r.geoProjection(Cr).scale(172.632)};zr.invert=function(n,r){var e=(n*n+r*r)/-2,t=u(-e*(2+e)),i=r*e+n*t,a=n*e-r*t,c=u(a*a+i*i);return[xr(t*i,c*(1+e)),c?-o(t*a/c):0]};var Uo=function(){return r.geoProjection(zr).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)};Fr.invert=function(n,r){var e=n,t=r,o=25;do{var a,c=Br(t),f=_r(t),l=_r(2*t),g=f*f,v=c*c,s=_r(e),h=Br(e/2),p=_r(e/2),d=p*p,w=1-v*h*h,P=w?i(c*h)*u(a=1/w):a=0,m=.5*(2*P*c*p+e/Xr)-n,y=.5*(P*f+t)-r,R=.5*a*(v*d+P*c*h*g)+.5/Xr,j=a*(s*l/4-P*f*p),M=.125*a*(l*p-P*f*v*s),E=.5*a*(g*h+P*d*c)+.5,b=j*M-E*R,k=(y*j-m*E)/b,S=(m*M-y*R)/b;e-=k,t-=S}while((Lr(k)>Or||Lr(S)>Or)&&--o>0);return[e,t]};var Jo=function(){return r.geoProjection(Fr).scale(158.837)};n.geoAiry=oe,n.geoAiryRaw=v,n.geoAitoff=ie,n.geoAitoffRaw=s,n.geoArmadillo=ue,n.geoArmadilloRaw=h,n.geoAugust=ae,n.geoAugustRaw=p,n.geoBaker=le,n.geoBakerRaw=d,n.geoBerghaus=ge,n.geoBerghausRaw=w,n.geoBoggs=de,n.geoBoggsRaw=y,n.geoBonne=me,n.geoBonneRaw=j,n.geoBottomley=ye,n.geoBottomleyRaw=M,n.geoBromley=je,n.geoBromleyRaw=Re,n.geoChamberlin=C,n.geoChamberlinRaw=S,n.geoChamberlinAfrica=G,n.geoCollignon=Me,n.geoCollignonRaw=z,n.geoCraig=Ee,n.geoCraigRaw=F,n.geoCraster=ke,n.geoCrasterRaw=L,n.geoCylindricalEqualArea=Se,n.geoCylindricalEqualAreaRaw=q,n.geoCylindricalStereographic=Ae,n.geoCylindricalStereographicRaw=x,n.geoEckert1=Ge,n.geoEckert1Raw=B,n.geoEckert2=Ce,n.geoEckert2Raw=H,n.geoEckert3=ze,n.geoEckert3Raw=I,n.geoEckert4=Fe,n.geoEckert4Raw=W,n.geoEckert5=Le,n.geoEckert5Raw=T,n.geoEckert6=qe,n.geoEckert6Raw=D,n.geoEisenlohr=Be,n.geoEisenlohrRaw=Q,n.geoFahey=Ie,n.geoFaheyRaw=V,n.geoFoucaut=We,n.geoFoucautRaw=N,n.geoGilbert=Te,n.geoGingery=De,n.geoGingeryRaw=O,n.geoGinzburg4=Ne,n.geoGinzburg4Raw=Ve,n.geoGinzburg5=Ke,n.geoGinzburg5Raw=_e,n.geoGinzburg6=Ue,n.geoGinzburg6Raw=Oe,n.geoGinzburg8=Je,n.geoGinzburg8Raw=X,n.geoGinzburg9=Ye,n.geoGinzburg9Raw=Xe,n.geoGringorten=$e,n.geoGringortenRaw=Y,n.geoGuyou=nt,n.geoGuyouRaw=on,n.geoHammer=rt,n.geoHammerRaw=cn,n.geoHammerRetroazimuthal=et,n.geoHammerRetroazimuthalRaw=ln,n.geoHealpix=it,n.geoHealpixRaw=vn,n.geoHill=ut,n.geoHillRaw=hn,n.geoHomolosine=lt,n.geoHomolosineRaw=dn,n.geoInterrupt=gt,n.geoInterruptedBoggs=st,n.geoInterruptedHomolosine=pt,n.geoInterruptedMollweide=wt,n.geoInterruptedMollweideHemispheres=mt,n.geoInterruptedSinuMollweide=Rt,n.geoInterruptedSinusoidal=Mt,n.geoKavrayskiy7=Et,n.geoKavrayskiy7Raw=yn,n.geoLagrange=bt,n.geoLagrangeRaw=Rn,n.geoLarrivee=St,n.geoLarriveeRaw=jn,n.geoLaskowski=At,n.geoLaskowskiRaw=Mn,n.geoLittrow=Gt,n.geoLittrowRaw=En,n.geoLoximuthal=Ct,n.geoLoximuthalRaw=bn,n.geoMiller=zt,n.geoMillerRaw=kn,n.geoModifiedStereographic=Ln,n.geoModifiedStereographicRaw=Sn,n.geoModifiedStereographicAlaska=An,n.geoModifiedStereographicGs48=Gn,n.geoModifiedStereographicGs50=Cn,n.geoModifiedStereographicMiller=zn,n.geoModifiedStereographicLee=Fn,n.geoMollweide=se,n.geoMollweideRaw=ve,n.geoMtFlatPolarParabolic=Wt,n.geoMtFlatPolarParabolicRaw=qn,n.geoMtFlatPolarQuartic=Tt,n.geoMtFlatPolarQuarticRaw=xn,n.geoMtFlatPolarSinusoidal=Dt,n.geoMtFlatPolarSinusoidalRaw=Bn,n.geoNaturalEarth=Qt,n.geoNaturalEarthRaw=Hn,n.geoNellHammer=Vt,n.geoNellHammerRaw=In,n.geoPatterson=Zt,n.geoPattersonRaw=Wn,n.geoPolyconic=$t,n.geoPolyconicRaw=Tn,n.geoPolyhedral=ro,n.geoPolyhedralButterfly=oo,n.geoPolyhedralCollignon=uo,n.geoPolyhedralWaterman=ao,n.geoProject=go,n.geoGringortenQuincuncial=mo,n.geoPeirceQuincuncial=yo,n.geoPierceQuincuncial=yo,n.geoQuantize=Ro,n.geoQuincuncial=Po,n.geoRectangularPolyconic=jo,n.geoRectangularPolyconicRaw=ur,n.geoRobinson=Eo,n.geoRobinsonRaw=ar,n.geoSatellite=bo,n.geoSatelliteRaw=fr,n.geoSinuMollweide=ft,n.geoSinuMollweideRaw=pn,n.geoSinusoidal=Pe,n.geoSinusoidalRaw=R,n.geoStitch=xo,n.geoTimes=Bo,n.geoTimesRaw=Pr,n.geoTwoPointAzimuthal=Rr,n.geoTwoPointAzimuthalRaw=mr,n.geoTwoPointAzimuthalUsa=yr,n.geoTwoPointEquidistant=Er,n.geoTwoPointEquidistantRaw=jr,n.geoTwoPointEquidistantUsa=Mr,n.geoVanDerGrinten=Io,n.geoVanDerGrintenRaw=br,n.geoVanDerGrinten2=Wo,n.geoVanDerGrinten2Raw=kr,n.geoVanDerGrinten3=To,n.geoVanDerGrinten3Raw=Sr,n.geoVanDerGrinten4=Do,n.geoVanDerGrinten4Raw=Ar,n.geoWagner4=_o,n.geoWagner4Raw=No,n.geoWagner6=Ko,n.geoWagner6Raw=Gr,n.geoWagner7=Oo,n.geoWagner7Raw=Cr,n.geoWiechel=Uo,n.geoWiechelRaw=zr,n.geoWinkel3=Jo,n.geoWinkel3Raw=Fr,Object.defineProperty(n,"__esModule",{value:!0})}); | ||
// https://d3js.org/d3-geo-projection/ Version 1.2.3. Copyright 2017 Mike Bostock. | ||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("d3-geo"),require("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-geo","d3-array"],r):r(n.d3=n.d3||{},n.d3,n.d3)}(this,function(n,r,e){"use strict";function t(n){return n?n/Math.sin(n):1}function o(n){return n>1?Yr:n<-1?-Yr:Math.asin(n)}function i(n){return n>1?0:n<-1?Xr:Math.acos(n)}function u(n){return n>0?Math.sqrt(n):0}function a(n){return((n=Ir(2*n))-1)/(n+1)}function c(n){return(Ir(n)-Ir(-n))/2}function f(n){return(Ir(n)+Ir(-n))/2}function l(n){return Tr(n+u(n*n+1))}function g(n){return Tr(n+u(n*n-1))}function v(n){function r(n,r){var e=Hr(n),o=Hr(r),i=Kr(r),u=o*e,a=-((1-u?Tr((1+u)/2)/(1-u):-.5)+t/(1+u));return[a*o*Kr(n),a*i]}var e=Or(n/2),t=2*Tr(Hr(n/2))/(e*e);return r.invert=function(r,e){var i,a=u(r*r+e*e),c=-n/2,f=50;if(!a)return[0,0];do{var l=c/2,g=Hr(l),v=Kr(l),s=Or(l),h=Tr(1/g);c-=i=(2/s*h-t*s-a)/(-h/(v*v)+1-t/(2*g*g))}while(qr(i)>Ur&&--f>0);var p=Kr(c);return[Br(r*p,a*Hr(c)),o(e*p/a)]},r}function s(n,r){var e=Hr(r),o=t(i(e*Hr(n/=2)));return[2*e*Kr(n)*o,Kr(r)*o]}function h(n){function r(n,r){var a=Hr(r),c=Hr(n/=2);return[(1+a)*Kr(n),(o*r>-Br(c,i)-.001?0:10*-o)+u+Kr(r)*t-(1+a)*e*c]}var e=Kr(n),t=Hr(n),o=n>=0?1:-1,i=Or(o*n),u=(1+e-t)/2;return r.invert=function(n,r){var a=0,c=0,f=50;do{var l=Hr(a),g=Kr(a),v=Hr(c),s=Kr(c),h=1+v,p=h*g-n,d=u+s*t-h*e*l-r,w=h*l/2,P=-g*s,m=e*h*g/2,y=t*v+e*l*s,R=P*m-y*w,j=(d*P-p*y)/R/2,M=(p*m-d*w)/R;a-=j,c-=M}while((qr(j)>Ur||qr(M)>Ur)&&--f>0);return o*c>-Br(Hr(a),i)-.001?[2*a,c]:null},r}function p(n,r){var e=Or(r/2),t=u(1-e*e),o=1+t*Hr(n/=2),i=Kr(n)*t/o,a=e/o,c=i*i,f=a*a;return[4/3*i*(3+c-3*f),4/3*a*(3+3*c-f)]}function d(n,r){var e=qr(r);return e<Zr?[n,Tr(Or(Zr+r/2))]:[n*Hr(e)*(2*ne-1/Kr(e)),_r(r)*(2*ne*(e-Zr)-Tr(Or(e/2)))]}function w(n){function e(n,e){var i=r.geoAzimuthalEquidistantRaw(n,e);if(qr(n)>Yr){var a=Br(i[1],i[0]),c=u(i[0]*i[0]+i[1]*i[1]),f=t*Nr((a-Yr)/t)+Yr,l=Br(Kr(a-=f),2-Hr(a));a=f+o(Xr/c*Kr(l))-l,i[0]=c*Hr(a),i[1]=c*Kr(a)}return i}var t=2*Xr/n;return e.invert=function(n,e){var o=u(n*n+e*e);if(o>Yr){var a=Br(e,n),c=t*Nr((a-Yr)/t)+Yr,f=a>c?-1:1,l=o*Hr(c-a),g=1/Or(f*i((l-Xr)/u(Xr*(Xr-2*l)+o*o)));a=c+2*xr((g+f*u(g*g-3))/3),n=o*Hr(a),e=o*Kr(a)}return r.geoAzimuthalEquidistantRaw.invert(n,e)},e}function P(n,r){var e,t=n*Kr(r),o=30;do{r-=e=(r+Kr(r)-t)/(1+Hr(r))}while(qr(e)>Ur&&--o>0);return r/2}function m(n,r,e){function t(t,o){return[n*t*Hr(o=P(e,o)),r*Kr(o)]}return t.invert=function(t,i){return i=o(i/r),[t/(n*Hr(i)),o((2*i+Kr(2*i))/e)]},t}function y(n,r){var e=P(Xr,r);return[pe*n/(1/Hr(r)+de/Hr(e)),(r+ne*Kr(e))/pe]}function R(n,r){return[n*Hr(r),r]}function j(n){function r(r,t){var o=e+n-t,i=o?r*Hr(t)/o:o;return[o*Kr(i),e-o*Hr(i)]}if(!n)return R;var e=1/Or(n);return r.invert=function(r,t){var o=u(r*r+(t=e-t)*t),i=e+n-o;return[o/Hr(i)*Br(r,t),i]},r}function M(n){function r(r,e){var t=Yr-e,o=t?r*n*Kr(t)/t:t;return[t*Kr(o)/n,Yr-t*Hr(o)]}return r.invert=function(r,e){var t=r*n,o=Yr-e,i=u(t*t+o*o),a=Br(t,o);return[(i?i/Kr(i):1)*a/n,Yr-i]},r}function E(n,r,e,t,a,c){var f,l=Hr(c);if(qr(n)>1||qr(c)>1)f=i(e*a+r*t*l);else{var g=Kr(n/2),v=Kr(c/2);f=2*o(u(g*g+r*t*v*v))}return qr(f)>Ur?[f,Br(t*Kr(c),r*a-e*t*l)]:[0,0]}function b(n,r,e){return i((n*n+r*r-e*e)/(2*n*r))}function k(n){return n-2*Xr*Wr((n+Xr)/(2*Xr))}function S(n,r,e){function t(n,r){var e,t=Kr(r),o=Hr(r),u=new Array(3);for(e=0;e<3;++e){var a=i[e];if(u[e]=E(r-a[1],a[3],a[2],o,t,n-a[0]),!u[e][0])return a.point;u[e][1]=k(u[e][1]-a.v[1])}var c=g.slice();for(e=0;e<3;++e){var v=2==e?0:e+1,s=b(i[e].v[0],u[e][0],u[v][0]);u[e][1]<0&&(s=-s),e?1==e?(s=f-s,c[0]-=u[e][0]*Hr(s),c[1]-=u[e][0]*Kr(s)):(s=l-s,c[0]+=u[e][0]*Hr(s),c[1]+=u[e][0]*Kr(s)):(c[0]+=u[e][0]*Hr(s),c[1]-=u[e][0]*Kr(s))}return c[0]/=3,c[1]/=3,c}for(var o,i=[[n[0],n[1],Kr(n[1]),Hr(n[1])],[r[0],r[1],Kr(r[1]),Hr(r[1])],[e[0],e[1],Kr(e[1]),Hr(e[1])]],u=i[2],a=0;a<3;++a,u=o)o=i[a],u.v=E(o[1]-u[1],u[3],u[2],o[3],o[2],o[0]-u[0]),u.point=[0,0];var c=b(i[0].v[0],i[2].v[0],i[1].v[0]),f=b(i[0].v[0],i[1].v[0],i[2].v[0]),l=Xr-c;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var g=[i[2].point[0]=i[0].point[0]+i[2].v[0]*Hr(c),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*Kr(c))];return t}function A(n){return n[0]*=oe,n[1]*=oe,n}function G(){return C([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function C(n,e,t){var o=r.geoCentroid({type:"MultiPoint",coordinates:[n,e,t]}),i=[-o[0],-o[1]],u=r.geoRotation(i),a=r.geoProjection(S(A(u(n)),A(u(e)),A(u(t)))).rotate(i),c=a.center;return delete a.rotate,a.center=function(n){return arguments.length?c(u(n)):u.invert(c())},a.clipAngle(90)}function z(n,r){var e=u(1-Kr(r));return[2/re*n*e,re*(1-e)]}function F(n){function r(n,r){return[n,(n?n/Kr(n):1)*(Kr(r)*Hr(n)-e*Hr(r))]}var e=Or(n);return r.invert=e?function(n,r){n&&(r*=Kr(n)/n);var t=Hr(n);return[n,2*Br(u(t*t+e*e-r*r)-t,e-r)]}:function(n,r){return[n,o(n?r*Or(n)/n:r)]},r}function L(n,r){return[ke*n*(2*Hr(2*r/3)-1)/re,ke*re*Kr(r/3)]}function q(n){function r(n,r){return[n*e,Kr(r)/e]}var e=Hr(n);return r.invert=function(n,r){return[n/e,o(r*e)]},r}function x(n){function r(n,r){return[n*e,(1+e)*Or(r/2)]}var e=Hr(n);return r.invert=function(n,r){return[n/e,2*xr(r/(1+e))]},r}function B(n,r){var e=u(8/(3*Xr));return[e*n*(1-qr(r)/Xr),e*r]}function H(n,r){var e=u(4-3*Kr(qr(r)));return[2/u(6*Xr)*n*e,_r(r)*u(2*Xr/3)*(2-e)]}function I(n,r){var e=u(Xr*(4+Xr));return[2/e*n*(1+u(1-4*r*r/(Xr*Xr))),4/e*r]}function W(n,r){var e=(2+Yr)*Kr(r);r/=2;for(var t=0,o=1/0;t<10&&qr(o)>Ur;t++){var i=Hr(r);r-=o=(r+Kr(r)*(i+2)-e)/(2*i*(1+i))}return[2/u(Xr*(4+Xr))*n*(1+Hr(r)),2*u(Xr/(4+Xr))*Kr(r)]}function T(n,r){return[n*(1+Hr(r))/u(2+Xr),2*r/u(2+Xr)]}function D(n,r){for(var e=(1+Yr)*Kr(r),t=0,o=1/0;t<10&&qr(o)>Ur;t++)r-=o=(r+Kr(r)-e)/(1+Hr(r));return e=u(2+Xr),[n*(1+Hr(r))/e,2*r/e]}function Q(n,r){var e=Kr(n/=2),t=Hr(n),o=u(Hr(r)),i=Hr(r/=2),a=Kr(r)/(i+ne*t*o),c=u(2/(1+a*a)),f=u((ne*i+(t+e)*o)/(ne*i+(t-e)*o));return[Be*(c*(f-1/f)-2*Tr(f)),Be*(c*a*(f+1/f)-2*xr(a))]}function V(n,r){var e=Or(r/2);return[n*Ie*u(1-e*e),(1+Ie)*e]}function N(n,r){var e=r/2,t=Hr(e);return[2*n/re*Hr(r)*t*t,re*Or(e)]}function _(n){return[n[0]/2,o(Or(n[1]/2*oe))*te]}function K(n){return[2*n[0],2*xr(Kr(n[1]*oe))*te]}function O(n,e){function t(e,t){var a=r.geoAzimuthalEquidistantRaw(e,t),c=a[0],f=a[1],l=c*c+f*f;if(l>i){var g=u(l),v=Br(f,c),s=o*Nr(v/o),h=v-s,p=n*Hr(h),d=(n*Kr(h)-h*Kr(p))/(Yr-p),w=U(h,d),P=(Xr-n)/J(w,p,Xr);c=g;var m,y=50;do{c-=m=(n+J(w,p,c)*P-g)/(w(c)*P)}while(qr(m)>Ur&&--y>0);f=h*Kr(c),c<Yr&&(f-=d*(c-Yr));var R=Kr(s),j=Hr(s);a[0]=c*j-f*R,a[1]=c*R+f*j}return a}var o=2*Xr/e,i=n*n;return t.invert=function(e,t){var a=e*e+t*t;if(a>i){var c=u(a),f=Br(t,e),l=o*Nr(f/o),g=f-l;e=c*Hr(g),t=c*Kr(g);for(var v=e-Yr,s=Kr(e),h=t/s,p=e<Yr?1/0:0,d=10;;){var w=n*Kr(h),P=n*Hr(h),m=Kr(P),y=Yr-P,R=(w-h*m)/y,j=U(h,R);if(qr(p)<Jr||!--d)break;h-=p=(h*s-R*v-t)/(s-2*v*(y*(P+h*w*Hr(P)-m)-w*(w-h*m))/(y*y))}c=n+J(j,P,e)*(Xr-n)/J(j,P,Xr),f=l+h,e=c*Hr(f),t=c*Kr(f)}return r.geoAzimuthalEquidistantRaw.invert(e,t)},t}function U(n,r){return function(e){var t=n*Hr(e);return e<Yr&&(t-=r),u(1+t*t)}}function J(n,r,e){for(var t=(e-r)/50,o=n(r)+n(e),i=1,u=r;i<50;++i)o+=2*n(u+=t);return.5*o*t}function X(n,r){var e=n*n,t=r*r;return[n*(1-.162388*t)*(.87-952426e-9*e*e),r*(1+t/12)]}function Y(n,r){var e=_r(n),t=_r(r),i=Hr(r),u=Hr(n)*i,a=Kr(n)*i,c=Kr(t*r);n=qr(Br(a,c)),r=o(u),qr(n-Yr)>Ur&&(n%=Yr);var f=Z(n>Xr/4?Yr-n:n,r);return n>Xr/4&&(c=f[0],f[0]=-f[1],f[1]=-c),f[0]*=e,f[1]*=-t,f}function Z(n,r){if(r===Yr)return[0,0];var e,t,i=Kr(r),a=i*i,c=a*a,f=1+c,l=1+3*c,g=1-c,v=o(1/u(f)),s=g+a*f*v,h=(1-i)/s,p=u(h),d=h*f,w=u(d),P=p*g;if(0===n)return[0,-(P+a*w)];var m,y=Hr(r),R=1/y,j=2*i*y,M=(-3*a+v*l)*j,E=(-s*y-(1-i)*M)/(s*s),b=.5*E/p,k=g*b-2*a*p*j,S=a*f*E+h*l*j,A=-R*j,G=-R*S,C=-2*R*k,z=4*n/Xr;if(n>.222*Xr||r<Xr/4&&n>.175*Xr){if(e=(P+a*u(d*(1+c)-P*P))/(1+c),n>Xr/4)return[e,e];var F=e,L=.5*e;e=.5*(L+F),t=50;do{var q=u(d-e*e),x=e*(C+A*q)+G*o(e/w)-z;if(!x)break;x<0?L=e:F=e,e=.5*(L+F)}while(qr(F-L)>Ur&&--t>0)}else{e=Ur,t=25;do{var B=e*e,H=u(d-B),I=C+A*H,W=e*I+G*o(e/w)-z,T=I+(G-A*B)/H;e-=m=H?W/T:0}while(qr(m)>Ur&&--t>0)}return[e,-P-a*u(d-e*e)]}function $(n,r){for(var e=0,t=1,i=.5,a=50;;){var c=i*i,f=u(i),l=o(1/u(1+c)),g=1-c+i*(1+c)*l,v=(1-f)/g,s=u(v),h=v*(1+c),p=s*(1-c),d=h-n*n,w=u(d),P=r+p+i*w;if(qr(t-e)<Jr||0==--a||0===P)break;P>0?e=i:t=i,i=.5*(e+t)}if(!a)return null;var m=o(f),y=Hr(m),R=1/y,j=2*f*y,M=(-3*i+l*(1+3*c))*j,E=(-g*y-(1-f)*M)/(g*g);return[Xr/4*(n*(-2*R*(.5*E/s*(1-c)-2*i*s*j)+-R*j*w)+-R*(i*(1+c)*E+v*(1+3*c)*j)*o(n/u(h))),m]}function nn(n,r,e){var t,o,i;return n?(t=rn(n,e),r?(o=rn(r,1-e),i=o[1]*o[1]+e*t[0]*t[0]*o[0]*o[0],[[t[0]*o[2]/i,t[1]*t[2]*o[0]*o[1]/i],[t[1]*o[1]/i,-t[0]*t[2]*o[0]*o[2]/i],[t[2]*o[1]*o[2]/i,-e*t[0]*t[1]*o[0]/i]]):[[t[0],0],[t[1],0],[t[2],0]]):(o=rn(r,1-e),[[0,o[0]/o[1]],[1/o[1],0],[o[2]/o[1],0]])}function rn(n,r){var e,t,i,l,g;if(r<Ur)return l=Kr(n),t=Hr(n),e=r*(n-l*t)/4,[l-e*t,t+e*l,1-r*l*l/2,n-e];if(r>=1-Ur)return e=(1-r)/4,t=f(n),l=a(n),i=1/t,g=t*c(n),[l+e*(g-n)/(t*t),i-e*l*i*(g-n),i+e*l*i*(g+n),2*xr(Ir(n))-Yr+e*(g-n)/t];var v=[1,0,0,0,0,0,0,0,0],s=[u(r),0,0,0,0,0,0,0,0],h=0;for(t=u(1-r),g=1;qr(s[h]/v[h])>Ur&&h<8;)e=v[h++],s[h]=(e-t)/2,v[h]=(e+t)/2,t=u(e*t),g*=2;i=g*v[h]*n;do{l=s[h]*Kr(t=i)/v[h],i=(o(l)+i)/2}while(--h);return[Kr(i),l=Hr(i),l/Hr(i-t),i]}function en(n,r,e){var t=qr(n),o=qr(r),i=c(o);if(t){var a=1/Kr(t),f=1/(Or(t)*Or(t)),l=-(f+e*(i*i*a*a)-1+e),g=(e-1)*f,v=(-l+u(l*l-4*g))/2;return[tn(xr(1/u(v)),e)*_r(n),tn(xr(u((v/f-1)/e)),1-e)*_r(r)]}return[0,tn(xr(i),1-e)*_r(r)]}function tn(n,r){if(!r)return n;if(1===r)return Tr(Or(n/2+Zr));for(var e=1,t=u(1-r),o=u(r),i=0;qr(o)>Ur;i++){if(n%Xr){var a=xr(t*Or(n)/e);a<0&&(a+=Xr),n+=a+~~(n/Xr)*Xr}else n+=n;o=(e+t)/2,t=u(e*t),o=((e=o)-t)/2}return n/(Vr(2,i)*e)}function on(n,r){var e=(ne-1)/(ne+1),t=u(1-e*e),o=tn(Yr,t*t),i=Tr(Or(Xr/4+qr(r)/2)),a=Ir(-1*i)/u(e),c=un(a*Hr(-1*n),a*Kr(-1*n)),f=en(c[0],c[1],t*t);return[-f[1],(r>=0?1:-1)*(.5*o-f[0])]}function un(n,r){var e=n*n,t=r+1,o=1-e-r*r;return[.5*((n>=0?Yr:-Yr)-Br(o,2*n)),-.25*Tr(o*o+4*e)+.5*Tr(t*t+e)]}function an(n,r){var e=r[0]*r[0]+r[1]*r[1];return[(n[0]*r[0]+n[1]*r[1])/e,(n[1]*r[0]-n[0]*r[1])/e]}function cn(n,e){function t(t,o){var i=r.geoAzimuthalEqualAreaRaw(t/e,o);return i[0]*=n,i}return arguments.length<2&&(e=n),1===e?r.geoAzimuthalEqualAreaRaw:e===1/0?fn:(t.invert=function(t,o){var i=r.geoAzimuthalEqualAreaRaw.invert(t/n,o);return i[0]*=e,i},t)}function fn(n,r){return[n*Hr(r)/Hr(r/=2),2*Kr(r)]}function ln(n){function r(n,r){var u=o(n,r);n=u[0],r=u[1];var a=Kr(r),c=Hr(r),f=Hr(n),l=i(e*a+t*c*f),g=Kr(l),v=qr(g)>Ur?l/g:1;return[v*t*Kr(n),(qr(n)>Yr?v:-v)*(e*c-t*a*f)]}var e=Kr(n),t=Hr(n),o=gn(n);return o.invert=gn(-n),r.invert=function(n,r){var t=u(n*n+r*r),i=-Kr(t),a=Hr(t),c=t*a,f=-r*i,l=t*e,g=u(c*c+f*f-l*l),v=Br(c*l+f*g,f*l-c*g),s=(t>Yr?-1:1)*Br(n*i,t*Hr(v)*a+r*Kr(v)*i);return o.invert(s,v)},r}function gn(n){var r=Kr(n),e=Hr(n);return function(n,t){var i=Hr(t),u=Hr(n)*i,a=Kr(n)*i,c=Kr(t);return[Br(a,u*e-c*r),o(c*e+u*r)]}}function vn(n){function r(r,l){var g,v=qr(l);if(v>e){var s=Qr(n-1,Dr(0,Wr((r+Xr)/a)));r+=Xr*(n-1)/n-s*a,g=z(r,v),g[0]=g[0]*ee/t-ee*(n-1)/(2*n)+s*ee/n,g[1]=o+4*(g[1]-i)*u/ee,l<0&&(g[1]=-g[1])}else g=it(r,l);return g[0]*=c,g[1]/=f,g}var e=ot*oe,t=z(Xr,e)[0]-z(-Xr,e)[0],o=it(0,e)[1],i=z(0,e)[1],u=re-i,a=ee/n,c=4/ee,f=o+u*u*4/ee;return r.invert=function(r,e){r/=c,e*=f;var l=qr(e);if(l>o){var g=Qr(n-1,Dr(0,Wr((r+Xr)/a)));r=(r+Xr*(n-1)/n-g*a)*t/ee;var v=z.invert(r,.25*(l-o)*ee/u+i);return v[0]-=Xr*(n-1)/n-g*a,e<0&&(v[1]=-v[1]),v}return it.invert(r,e)},r}function sn(n){return{type:"Polygon",coordinates:[e.range(-180,180+n/2,n).map(function(n,r){return[n,1&r?90-1e-6:ot]}).concat(e.range(180,-180-n/2,-n).map(function(n,r){return[n,1&r?1e-6-90:-ot]}))]}}function hn(n){function r(r,o){var i,a,s=1-Kr(o);if(s&&s<2){var h,p=Yr-o,d=25;do{var w=Kr(p),P=Hr(p),m=c+Br(w,t-P),y=1+v-2*t*P;p-=h=(p-g*c-t*w+y*m-.5*s*e)/(2*t*w*m)}while(qr(h)>Jr&&--d>0);i=f*u(y),a=r*m/Xr}else i=f*(n+s),a=r*c/Xr;return[i*Kr(a),l-i*Hr(a)]}var e,t=1+n,a=Kr(1/t),c=o(a),f=2*u(Xr/(e=Xr+4*c*t)),l=.5*f*(t+u(n*(2+n))),g=n*n,v=t*t;return r.invert=function(n,r){var a=n*n+(r-=l)*r,s=(1+v-a/(f*f))/(2*t),h=i(s),p=Kr(h),d=c+Br(p,t-s);return[o(n/u(a))*Xr/d,o(1-2*(h-g*c-t*p+(1+v-2*t*s)*d)/e)]},r}function pn(n,r){return r>-ct?(n=se(n,r),n[1]+=ft,n):R(n,r)}function dn(n,r){return qr(r)>ct?(n=se(n,r),n[1]-=r>0?ft:-ft,n):R(n,r)}function wn(n,r){return qr(n[0]-r[0])<Ur&&qr(n[1]-r[1])<Ur}function Pn(n,r){for(var e,t,o,i=-1,u=n.length,a=n[0],c=[];++i<u;){e=n[i],t=(e[0]-a[0])/r,o=(e[1]-a[1])/r;for(var f=0;f<r;++f)c.push([a[0]+f*t,a[1]+f*o]);a=e}return c.push(e),c}function mn(n){var r,t,o,i,u,a,c,f=[],l=n[0].length;for(c=0;c<l;++c)r=n[0][c],t=r[0][0],o=r[0][1],i=r[1][1],u=r[2][0],a=r[2][1],f.push(Pn([[t+Ur,o+Ur],[t+Ur,i-Ur],[u-Ur,i-Ur],[u-Ur,a+Ur]],30));for(c=n[1].length-1;c>=0;--c)r=n[1][c],t=r[0][0],o=r[0][1],i=r[1][1],u=r[2][0],a=r[2][1],f.push(Pn([[u-Ur,a-Ur],[u-Ur,i+Ur],[t+Ur,i+Ur],[t+Ur,o-Ur]],30));return{type:"Polygon",coordinates:[e.merge(f)]}}function yn(n,r){return[3/ee*n*u(Xr*Xr/3-r*r),r]}function Rn(n){function r(r,e){if(qr(qr(e)-Yr)<Ur)return[0,e<0?-2:2];var t=Kr(e),o=Vr((1+t)/(1-t),n/2),i=.5*(o+1/o)+Hr(r*=n);return[2*Kr(r)/i,(o-1/o)/i]}return r.invert=function(r,e){var t=qr(e);if(qr(t-2)<Ur)return r?null:[0,_r(e)*Yr];if(t>2)return null;r/=2,e/=2;var i=r*r,u=e*e,a=2*e/(1+i+u);return a=Vr((1+a)/(1-a),1/n),[Br(2*r,1-i-u)/n,o((a-1)/(a+1))]},r}function jn(n,r){return[n*(1+u(Hr(r)))/2,r/(Hr(r/2)*Hr(n/6))]}function Mn(n,r){var e=n*n,t=r*r;return[n*(.975534+t*(e*-.0143059-.119161+t*-.0547009)),r*(1.00384+e*(.0802894+t*-.02855+199025e-9*e)+t*(.0998909+t*-.0491032))]}function En(n,r){return[Kr(n)/Hr(r),Or(r)*Hr(n)]}function bn(n){function r(r,o){var i=o-n,u=qr(i)<Ur?r*e:qr(u=Zr+o/2)<Ur||qr(qr(u)-Yr)<Ur?0:r*i/Tr(Or(u)/t);return[u,i]}var e=Hr(n),t=Or(Zr+n/2);return r.invert=function(r,o){var i,u=o+n;return[qr(o)<Ur?r/e:qr(i=Zr+u/2)<Ur||qr(qr(i)-Yr)<Ur?0:r*Tr(Or(i)/t)/o,u]},r}function kn(n,r){return[n,1.25*Tr(Or(Zr+.4*r))]}function Sn(n){function r(r,t){for(var o,i=Hr(t),u=2/(1+i*Hr(r)),a=u*i*Kr(r),c=u*Kr(t),f=e,l=n[f],g=l[0],v=l[1];--f>=0;)l=n[f],g=l[0]+a*(o=g)-c*v,v=l[1]+a*v+c*o;return g=a*(o=g)-c*v,v=a*v+c*o,[g,v]}var e=n.length-1;return r.invert=function(r,t){var i=20,a=r,c=t;do{for(var f,l=e,g=n[l],v=g[0],s=g[1],h=0,p=0;--l>=0;)g=n[l],h=v+a*(f=h)-c*p,p=s+a*p+c*f,v=g[0]+a*(f=v)-c*s,s=g[1]+a*s+c*f;h=v+a*(f=h)-c*p,p=s+a*p+c*f,v=a*(f=v)-c*s-r,s=a*s+c*f-t;var d,w,P=h*h+p*p;a-=d=(v*h+s*p)/P,c-=w=(s*h-v*p)/P}while(qr(d)+qr(w)>Ur*Ur&&--i>0);if(i){var m=u(a*a+c*c),y=2*xr(.5*m),R=Kr(y);return[Br(a*R,m*Hr(y)),m?o(c*R/m):0]}},r}function An(){return Ln(Lt,[152,-64]).scale(1500).center([-160.908,62.4864]).clipAngle(25)}function Gn(){return Ln(qt,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Cn(){return Ln(xt,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function zn(){return Ln(Bt,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function Fn(){return Ln(Ht,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function Ln(n,e){var t=r.geoProjection(Sn(n)).rotate(e).clipAngle(90),o=r.geoRotation(e),i=t.center;return delete t.rotate,t.center=function(n){return arguments.length?i(o(n)):o.invert(i())},t}function qn(n,r){var e=o(7*Kr(r)/(3*It));return[It*n*(2*Hr(2*e/3)-1)/Wt,9*Kr(e/3)/Wt]}function xn(n,r){for(var e,t=(1+$r)*Kr(r),o=r,i=0;i<25&&(o-=e=(Kr(o/2)+Kr(o)-t)/(.5*Hr(o/2)+Hr(o)),!(qr(e)<Ur));i++);return[n*(1+2*Hr(o)/Hr(o/2))/(3*ne),2*u(3)*Kr(o/2)/u(2+ne)]}function Bn(n,r){for(var e,t=u(6/(4+Xr)),o=(1+Xr/4)*Kr(r),i=r/2,a=0;a<25&&(i-=e=(i/2+Kr(i)-o)/(.5+Hr(i)),!(qr(e)<Ur));a++);return[t*(.5+Hr(i))*n/1.5,t*i]}function Hn(n,r){var e=r*r,t=e*e;return[n*(.8707-.131979*e+t*(t*(.003971*e-.001529*t)-.013791)),r*(1.007226+e*(.015085+t*(.028874*e-.044475-.005916*t)))]}function In(n,r){return[n*(1+Hr(r))/2,2*(r-Or(r/2))]}function Wn(n,r){var e=r*r;return[n,r*(_t+e*e*(Kt+e*(Ot+Ut*e)))]}function Tn(n,r){if(qr(r)<Ur)return[n,0];var e=Or(r),t=n*Kr(r);return[Kr(t)/e,r+(1-Hr(t))/e]}function Dn(n){var r=1/(n[0]*n[4]-n[1]*n[3]);return[r*n[4],-r*n[1],r*(n[1]*n[5]-n[2]*n[4]),-r*n[3],r*n[0],r*(n[2]*n[3]-n[0]*n[5])]}function Qn(n,r){return[n[0]*r[0]+n[1]*r[3],n[0]*r[1]+n[1]*r[4],n[0]*r[2]+n[1]*r[5]+n[2],n[3]*r[0]+n[4]*r[3],n[3]*r[1]+n[4]*r[4],n[3]*r[2]+n[4]*r[5]+n[5]]}function Vn(n,r){return[n[0]-r[0],n[1]-r[1]]}function Nn(n){return u(n[0]*n[0]+n[1]*n[1])}function _n(n,r){return Br(n[0]*r[1]-n[1]*r[0],n[0]*r[0]+n[1]*r[1])}function Kn(n,e,t){var o,i,u=e.edges,a=u.length,c={type:"MultiPoint",coordinates:e.face},f=e.face.filter(function(n){return 90!==qr(n[1])}),l=r.geoBounds({type:"MultiPoint",coordinates:f}),g=!1,v=-1,s=l[1][0]-l[0][0],h=180===s||360===s?[(l[0][0]+l[1][0])/2,(l[0][1]+l[1][1])/2]:r.geoCentroid(c);if(t)for(;++v<a&&u[v]!==t;);++v;for(var p=0;p<a;++p)i=u[(p+v)%a],Array.isArray(i)?(g||(n.point((o=r.geoInterpolate(i[0],h)(Ur))[0],o[1]),g=!0),n.point((o=r.geoInterpolate(i[1],h)(Ur))[0],o[1])):(g=!1,i!==t&&Kn(n,i,e))}function On(n,r){return n&&r&&n[0]===r[0]&&n[1]===r[1]}function Un(n,r){for(var e,t,o=n.length,i=null,u=0;u<o;++u){e=n[u];for(var a=r.length;--a>=0;)if(t=r[a],e[0]===t[0]&&e[1]===t[1]){if(i)return[i,e];i=e}}}function Jn(n){for(var r=n.length,e=[],t=n[r-1],o=0;o<r;++o)e.push([t,t=n[o]]);return e}function Xn(n){return n.project.invert||n.children&&n.children.some(Xn)}function Yn(n,r){var e=z(n,r);return[e[0]*uo,e[1]]}function Zn(n,r){for(var e=0,t=n.length,o=0;e<t;++e)o+=n[e]*r[e];return o}function $n(n,r){return[n[1]*r[2]-n[2]*r[1],n[2]*r[0]-n[0]*r[2],n[0]*r[1]-n[1]*r[0]]}function nr(n){return[Br(n[1],n[0])*te,o(Dr(-1,Qr(1,n[2])))*te]}function rr(n){var r=n[0]*oe,e=n[1]*oe,t=Hr(e);return[t*Hr(r),t*Kr(r),Kr(e)]}function er(n,r){return{type:"FeatureCollection",features:n.features.map(function(n){return tr(n,r)})}}function tr(n,r){return{type:"Feature",id:n.id,properties:n.properties,geometry:ir(n.geometry,r)}}function or(n,r){return{type:"GeometryCollection",geometries:n.geometries.map(function(n){return ir(n,r)})}}function ir(n,e){if(!n)return null;if("GeometryCollection"===n.type)return or(n,e);var t;switch(n.type){case"Point":case"MultiPoint":t=po;break;case"LineString":case"MultiLineString":t=wo;break;case"Polygon":case"MultiPolygon":case"Sphere":t=Po;break;default:return null}return r.geoStream(n,e(t)),t.result()}function ur(n){function r(r,t){var o=e?Or(r*e/2)/e:r/2;if(!t)return[2*o,-n];var i=2*xr(o*Kr(t)),u=1/Or(t);return[Kr(i)*u,t+(1-Hr(i))*u-n]}var e=Kr(n);return r.invert=function(r,t){if(qr(t+=n)<Ur)return[e?2*xr(e*r/2)/e:r,0];var u,a=r*r+t*t,c=0,f=10;do{var l=Or(c),g=1/Hr(c),v=a-2*t*c+c*c;c-=u=(l*v+2*(c-t))/(2+v*g*g+2*(c-t)*l)}while(qr(u)>Ur&&--f>0);var s=r*(l=Or(c)),h=Or(qr(t)<qr(c+1/l)?.5*o(s):.5*i(s)+Xr/4)/Kr(c);return[e?2*xr(e*h)/e:2*h,c]},r}function ar(n,r){var e,t=Qr(18,36*qr(r)/Xr),o=Wr(t),i=t-o,u=(e=Eo[o])[0],a=e[1],c=(e=Eo[++o])[0],f=e[1],l=(e=Eo[Qr(19,++o)])[0],g=e[1];return[n*(c+i*(l-u)/2+i*i*(l-2*c+u)/2),(r>0?Yr:-Yr)*(f+i*(g-a)/2+i*i*(g-2*f+a)/2)]}function cr(n){function r(r,e){var t=Hr(e),o=(n-1)/(n-t*Hr(r));return[o*t*Kr(r),o*Kr(e)]}return r.invert=function(r,e){var t=r*r+e*e,i=u(t),a=(n-u(1-t*(n+1)/(n-1)))/((n-1)/i+i/(n-1));return[Br(r*a,i*u(1-a*a)),i?o(e*a/i):0]},r}function fr(n,r){function e(r,e){var u=t(r,e),a=u[1],c=a*i/(n-1)+o;return[u[0]*o/c,a/c]}var t=cr(n);if(!r)return t;var o=Hr(r),i=Kr(r);return e.invert=function(r,e){var u=(n-1)/(n-1-e*i);return t.invert(u*r,u*e*o)},e}function lr(n){return n.length>0}function gr(n){return Math.floor(n*So)/So}function vr(n){return n===Fo||n===qo?[0,n]:[Ao,gr(n)]}function sr(n){n[0]<=Go?n[0]=Ao:n[0]>=zo&&(n[0]=Co),n[1]<=Lo?n[1]=Fo:n[1]>=xo&&(n[1]=qo)}function hr(n){n.forEach(sr)}function pr(n,r){for(var e=0,t=n.length;e<t;++e){var o=n[e];o.polygon=n,r.push(o);for(var i=0,u=o.length;i<u;++i){var a=o[i],c=a[0],f=a[1];if(c<=Go||c>=zo||f<=Lo||f>=xo){sr(a);for(var l=i+1;l<u;++l){var g=o[l],v=g[0],s=g[1];if(v>Go&&v<zo&&s>Lo&&s<xo)break}if(l===i+1)continue;if(i){var h=o.slice(0,i+1);h.polygon=n,h[h.length-1]=vr(f),r[r.length-1]=h}else r.pop();if(l>=u)break;r.push(o=o.slice(l-1)),o[0]=vr(o[0][1]),o.polygon=n,i=-1,u=o.length}}}n.length=0}function dr(n){var r,e,t,o,i,u,a=n.length,c={},f={};for(r=0;r<a;++r)e=n[r],t=e[0],i=e[e.length-1],t[0]!==i[0]||t[1]!==i[1]?(e.index=r,c[t]=f[i]=e):(e.polygon.push(e),n[r]=null);for(r=0;r<a;++r)if(e=n[r]){if(t=e[0],i=e[e.length-1],o=f[t],u=c[i],delete c[t],delete f[i],t[0]===i[0]&&t[1]===i[1]){e.polygon.push(e);continue}o?(delete f[t],delete c[o[0]],o.pop(),n[o.index]=null,e=o.concat(e),e.polygon=o.polygon,o===u?e.polygon.push(e):(e.index=a++,n.push(c[e[0]]=f[e[e.length-1]]=e))):u?(delete c[i],delete f[u[u.length-1]],e.pop(),e=e.concat(u),e.polygon=u.polygon,e.index=a++,n[u.index]=null,n.push(c[e[0]]=f[e[e.length-1]]=e)):(e.push(e[0]),e.polygon.push(e))}}function wr(n){Pr(n.geometry)}function Pr(n){if(n){var r,e,t;switch(n.type){case"GeometryCollection":n.geometries.forEach(Pr);break;case"Point":sr(n.coordinates);break;case"MultiPoint":case"LineString":hr(n.coordinates);break;case"MultiLineString":n.coordinates.forEach(hr);break;case"Polygon":pr(n.coordinates,r=[]),dr(r);break;case"MultiPolygon":for(r=[],e=-1,t=n.coordinates.length;++e<t;)pr(n.coordinates[e],r);dr(r),n.coordinates=n.coordinates.filter(lr)}}}function mr(n,r){var e=Or(r/2),t=Kr(Zr*e);return[n*(.74482-.34588*t*t),1.70711*e]}function yr(n){function e(n,e){var o=r.geoGnomonicRaw(n,e);return o[0]*=t,o}var t=Hr(n);return e.invert=function(n,e){return r.geoGnomonicRaw.invert(n/t,e)},e}function Rr(){return jr([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function jr(n,r){return Io(yr,n,r)}function Mr(n){function e(r,e){var c=i(Hr(e)*Hr(r-t)),f=i(Hr(e)*Hr(r-o)),l=e<0?-1:1;return c*=c,f*=f,[(c-f)/(2*n),l*u(4*a*f-(a-c+f)*(a-c+f))/(2*n)]}if(!(n*=2))return r.geoAzimuthalEquidistantRaw;var t=-n/2,o=-t,a=n*n,c=Or(o),f=.5/Kr(o);return e.invert=function(n,r){var e,a,l=r*r,g=Hr(u(l+(e=n+t)*e)),v=Hr(u(l+(e=n+o)*e));return[Br(a=g-v,e=(g+v)*c),(r<0?-1:1)*i(u(e*e+a*a)*f)]},e}function Er(){return br([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function br(n,r){return Io(Mr,n,r)}function kr(n,r){if(qr(r)<Ur)return[n,0];var e=qr(r/Yr),t=o(e);if(qr(n)<Ur||qr(qr(r)-Yr)<Ur)return[0,_r(r)*Xr*Or(t/2)];var i=Hr(t),a=qr(Xr/n-n/Xr)/2,c=a*a,f=i/(e+i-1),l=f*(2/e-1),g=l*l,v=g+c,s=f-g,h=c+f;return[_r(n)*Xr*(a*s+u(c*s*s-v*(f*f-g)))/v,_r(r)*Xr*(l*h-a*u((c+1)*v-h*h))/v]}function Sr(n,r){if(qr(r)<Ur)return[n,0];var e=qr(r/Yr),t=o(e);if(qr(n)<Ur||qr(qr(r)-Yr)<Ur)return[0,_r(r)*Xr*Or(t/2)];var i=Hr(t),a=qr(Xr/n-n/Xr)/2,c=a*a,f=i*(u(1+c)-a*i)/(1+c*e*e);return[_r(n)*Xr*f,_r(r)*Xr*u(1-f*(2*a+f))]}function Ar(n,r){if(qr(r)<Ur)return[n,0];var e=r/Yr,t=o(e);if(qr(n)<Ur||qr(qr(r)-Yr)<Ur)return[0,Xr*Or(t/2)];var i=(Xr/n-n/Xr)/2,a=e/(1+Hr(t));return[Xr*(_r(n)*u(i*i+1-a*a)-i),Xr*a]}function Gr(n,r){if(!r)return[n,0];var e=qr(r);if(!n||e===Yr)return[0,r];var t=e/Yr,o=t*t,i=(8*t-o*(o+2)-5)/(2*o*(t-1)),a=i*i,c=t*i,f=o+a+2*c,l=t+3*i,g=n/Yr,v=g+1/g,s=_r(qr(n)-Yr)*u(v*v-4),h=s*s,p=f*(o+a*h-1)+(1-o)*(o*(l*l+4*a)+12*c*a+4*a*a),d=(s*(f+a-1)+2*u(p))/(4*f+h);return[_r(n)*Yr*d,_r(r)*Yr*u(1+s*qr(d)-d*d)]}function Cr(n,r){return[n*u(1-3*r*r/(Xr*Xr)),r]}function zr(n,r){var e=.90631*Kr(r),t=u(1-e*e),o=u(2/(1+t*Hr(n/=3)));return[2.66723*t*o*Kr(n),1.24104*e*o]}function Fr(n,r){var e=Hr(r),t=Hr(n)*e,o=1-t,i=Hr(n=Br(Kr(n)*e,-Kr(r))),a=Kr(n);return e=u(1-t*t),[a*e-i*o,-i*e-a*o]}function Lr(n,r){var e=s(n,r);return[(e[0]+n/Yr)/2,(e[1]+r)/2]}var qr=Math.abs,xr=Math.atan,Br=Math.atan2,Hr=Math.cos,Ir=Math.exp,Wr=Math.floor,Tr=Math.log,Dr=Math.max,Qr=Math.min,Vr=Math.pow,Nr=Math.round,_r=Math.sign||function(n){return n>0?1:n<0?-1:0},Kr=Math.sin,Or=Math.tan,Ur=1e-6,Jr=1e-12,Xr=Math.PI,Yr=Xr/2,Zr=Xr/4,$r=Math.SQRT1_2,ne=u(2),re=u(Xr),ee=2*Xr,te=180/Xr,oe=Xr/180,ie=function(){var n=Yr,e=r.geoProjectionMutator(v),t=e(n);return t.radius=function(r){return arguments.length?e(n=r*oe):n*te},t.scale(179.976).clipAngle(147)};s.invert=function(n,r){if(!(n*n+4*r*r>Xr*Xr+Ur)){var e=n,t=r,o=25;do{var a,c=Kr(e),f=Kr(e/2),l=Hr(e/2),g=Kr(t),v=Hr(t),s=Kr(2*t),h=g*g,p=v*v,d=f*f,w=1-p*l*l,P=w?i(v*l)*u(a=1/w):a=0,m=2*P*v*f-n,y=P*g-r,R=a*(p*d+P*v*l*h),j=a*(.5*c*s-2*P*g*f),M=.25*a*(s*f-P*g*p*c),E=a*(h*l+P*d*v),b=j*M-E*R;if(!b)break;var k=(y*j-m*E)/b,S=(m*M-y*R)/b;e-=k,t-=S}while((qr(k)>Ur||qr(S)>Ur)&&--o>0);return[e,t]}};var ue=function(){return r.geoProjection(s).scale(152.63)},ae=function(){var n=20*oe,e=n>=0?1:-1,t=Or(e*n),o=r.geoProjectionMutator(h),i=o(n),u=i.stream;return i.parallel=function(r){return arguments.length?(t=Or((e=(n=r*oe)>=0?1:-1)*n),o(n)):n*te},i.stream=function(r){var o=i.rotate(),a=u(r),c=(i.rotate([0,0]),u(r));return i.rotate(o),a.sphere=function(){c.polygonStart(),c.lineStart();for(var r=e*-180;e*r<180;r+=90*e)c.point(r,90*e);for(;e*(r-=n)>=-180;)c.point(r,e*-Br(Hr(r*oe/2),t)*te);c.lineEnd(),c.polygonEnd()},a},i.scale(218.695).center([0,28.0974])};p.invert=function(n,r){if(n*=3/8,r*=3/8,!n&&qr(r)>1)return null;var e=n*n,t=r*r,i=1+e+t,a=u((i-u(i*i-4*r*r))/2),v=o(a)/3,s=a?g(qr(r/a))/3:l(qr(n))/3,h=Hr(v),p=f(s),d=p*p-h*h;return[2*_r(n)*Br(c(s)*h,.25-d),2*_r(r)*Br(p*Kr(v),.25+d)]};var ce=function(){return r.geoProjection(p).scale(66.1603)},fe=u(8),le=Tr(1+ne);d.invert=function(n,r){if((t=qr(r))<le)return[n,2*xr(Ir(r))-Yr];var e,t,o=Zr,i=25;do{var u=Hr(o/2),a=Or(o/2);o-=e=(fe*(o-Zr)-Tr(a)-t)/(fe-u*u/(2*a))}while(qr(e)>Jr&&--i>0);return[n/(Hr(o)*(fe-1/Kr(o))),_r(r)*o]};var ge=function(){return r.geoProjection(d).scale(112.314)},ve=function(){var n=5,e=r.geoProjectionMutator(w),t=e(n),i=t.stream,u=-Hr(.01*oe),a=Kr(.01*oe);return t.lobes=function(r){return arguments.length?e(n=+r):n},t.stream=function(r){var e=t.rotate(),c=i(r),f=(t.rotate([0,0]),i(r));return t.rotate(e),c.sphere=function(){f.polygonStart(),f.lineStart();for(var r=0,e=360/n,t=2*Xr/n,i=90-180/n,c=Yr;r<n;++r,i-=e,c-=t)f.point(Br(a*Hr(c),u)*te,o(a*Kr(c))*te),i<-90?(f.point(-90,-180-i-.01),f.point(-90,-180-i+.01)):(f.point(90,i+.01),f.point(90,i-.01));f.lineEnd(),f.polygonEnd()},c},t.scale(87.8076).center([0,17.1875]).clipAngle(179.999)},se=m(ne/Yr,ne,Xr),he=function(){return r.geoProjection(se).scale(169.529)},pe=2.00276,de=1.11072;y.invert=function(n,r){var e,t,o=pe*r,i=r<0?-Zr:Zr,u=25;do{t=o-ne*Kr(i),i-=e=(Kr(2*i)+2*i-Xr*Kr(t))/(2*Hr(2*i)+2+Xr*Hr(t)*ne*Hr(i))}while(qr(e)>Ur&&--u>0);return t=o-ne*Kr(i),[n*(1/Hr(t)+de/Hr(i))/pe,t]};var we=function(){return r.geoProjection(y).scale(160.857)},Pe=function(n){var e=0,t=r.geoProjectionMutator(n),o=t(e);return o.parallel=function(n){return arguments.length?t(e=n*oe):e*te},o};R.invert=function(n,r){return[n/Hr(r),r]};var me=function(){return r.geoProjection(R).scale(152.63)},ye=function(){return Pe(j).scale(123.082).center([0,26.1441]).parallel(45)},Re=function(){var n=.5,e=r.geoProjectionMutator(M),t=e(n);return t.fraction=function(r){return arguments.length?e(n=+r):n},t.scale(158.837)},je=m(1,4/Xr,Xr),Me=function(){return r.geoProjection(je).scale(152.63)};z.invert=function(n,r){var e=(e=r/re-1)*e;return[e>0?n*u(Xr/e)/2:0,o(1-e)]};var Ee=function(){return r.geoProjection(z).scale(95.6464).center([0,30])},be=function(){return Pe(F).scale(249.828).clipAngle(90)},ke=u(3);L.invert=function(n,r){var e=3*o(r/(ke*re));return[re*n/(ke*(2*Hr(2*e/3)-1)),e]};var Se=function(){return r.geoProjection(L).scale(156.19)},Ae=function(){return Pe(q).parallel(38.58).scale(195.044)},Ge=function(){return Pe(x).scale(124.75)};B.invert=function(n,r){var e=u(8/(3*Xr)),t=r/e;return[n/(e*(1-qr(t)/Xr)),t]};var Ce=function(){return r.geoProjection(B).scale(165.664)};H.invert=function(n,r){var e=2-qr(r)/u(2*Xr/3);return[n*u(6*Xr)/(2*e),_r(r)*o((4-e*e)/3)]};var ze=function(){return r.geoProjection(H).scale(165.664)};I.invert=function(n,r){var e=u(Xr*(4+Xr))/2;return[n*e/(1+u(1-r*r*(4+Xr)/(4*Xr))),r*e/2]};var Fe=function(){return r.geoProjection(I).scale(180.739)};W.invert=function(n,r){var e=r*u((4+Xr)/Xr)/2,t=o(e),i=Hr(t);return[n/(2/u(Xr*(4+Xr))*(1+i)),o((t+e*(i+2))/(2+Yr))]};var Le=function(){return r.geoProjection(W).scale(180.739)};T.invert=function(n,r){var e=u(2+Xr),t=r*e/2;return[e*n/(1+Hr(t)),t]};var qe=function(){return r.geoProjection(T).scale(173.044)};D.invert=function(n,r){var e=1+Yr,t=u(e/2);return[2*n*t/(1+Hr(r*=t)),o((r+Kr(r))/e)]};var xe=function(){return r.geoProjection(D).scale(173.044)},Be=3+2*ne;Q.invert=function(n,r){if(!(e=p.invert(n/1.2,1.065*r)))return null;var e,t=e[0],o=e[1],i=20;n/=Be,r/=Be;do{var a=t/2,c=o/2,f=Kr(a),l=Hr(a),g=Kr(c),v=Hr(c),s=Hr(o),h=u(s),d=g/(v+ne*l*h),w=d*d,P=u(2/(1+w)),m=ne*v+(l+f)*h,y=ne*v+(l-f)*h,R=m/y,j=u(R),M=j-1/j,E=j+1/j,b=P*M-2*Tr(j)-n,k=P*d*E-2*xr(d)-r,S=g&&$r*h*f*w/g,A=(ne*l*v+h)/(2*(v+ne*l*h)*(v+ne*l*h)*h),G=-.5*d*P*P*P,C=G*S,z=G*A,F=(F=2*v+ne*h*(l-f))*F*j,L=(ne*l*v*h+s)/F,q=-(ne*f*g)/(h*F),x=M*C-2*L/j+P*(L+L/R),B=M*z-2*q/j+P*(q+q/R),H=d*E*C-2*S/(1+w)+P*E*S+P*d*(L-L/R),I=d*E*z-2*A/(1+w)+P*E*A+P*d*(q-q/R),W=B*H-I*x;if(!W)break;var T=(k*B-b*I)/W,D=(b*H-k*x)/W;t-=T,o=Dr(-Yr,Qr(Yr,o-D))}while((qr(T)>Ur||qr(D)>Ur)&&--i>0);return qr(qr(o)-Yr)<Ur?[0,o]:i&&[t,o]};var He=function(){return r.geoProjection(Q).scale(62.5271)},Ie=Hr(35*oe);V.invert=function(n,r){var e=r/(1+Ie);return[n&&n/(Ie*u(1-e*e)),2*xr(e)]};var We=function(){return r.geoProjection(V).scale(137.152)};N.invert=function(n,r){var e=xr(r/re),t=Hr(e),o=2*e;return[n*re/2/(Hr(o)*t*t),o]};var Te=function(){return r.geoProjection(N).scale(135.264)},De=function(n){function e(n){return i(_(n))}function t(n){e[n]=function(r){return arguments.length?(i[n](r),e):i[n]()}}null==n&&(n=r.geoOrthographic);var i=n(),u=r.geoEquirectangular().scale(te).precision(0).clipAngle(null).translate([0,0]);return i.invert&&(e.invert=function(n){return K(i.invert(n))}),e.stream=function(n){var r=i.stream(n),e=u.stream({point:function(n,e){r.point(n/2,o(Or(-e/2*oe))*te)},lineStart:function(){r.lineStart()},lineEnd:function(){r.lineEnd()},polygonStart:function(){r.polygonStart()},polygonEnd:function(){r.polygonEnd()}});return e.sphere=r.sphere,e},e.rotate=function(n){return arguments.length?(u.rotate(n),e):u.rotate()},e.center=function(n){return arguments.length?(i.center(_(n)),e):K(i.center())},t("clipAngle"),t("clipExtent"),t("scale"),t("translate"),t("precision"),e.scale(249.5)},Qe=function(){var n=6,e=30*oe,t=Hr(e),i=Kr(e),u=r.geoProjectionMutator(O),a=u(e,n),c=a.stream,f=-Hr(.01*oe),l=Kr(.01*oe);return a.radius=function(r){return arguments.length?(t=Hr(e=r*oe),i=Kr(e),u(e,n)):e*te},a.lobes=function(r){return arguments.length?u(e,n=+r):n},a.stream=function(r){var e=a.rotate(),u=c(r),g=(a.rotate([0,0]),c(r));return a.rotate(e),u.sphere=function(){g.polygonStart(),g.lineStart();for(var r=0,e=2*Xr/n,u=0;r<n;++r,u-=e)g.point(Br(l*Hr(u),f)*te,o(l*Kr(u))*te),g.point(Br(i*Hr(u-e/2),t)*te,o(i*Kr(u-e/2))*te);g.lineEnd(),g.polygonEnd()},u},a.rotate([90,-40]).scale(91.7095).clipAngle(179.999)},Ve=function(n,r,e,t,i,a,c,f){function l(u,l){if(!l)return[n*u/Xr,0];var g=l*l,v=n+g*(r+g*(e+g*t)),s=l*(i-1+g*(a-f+g*c)),h=(v*v+s*s)/(2*s),p=u*o(v/h)/Xr;return[h*Kr(p),l*(1+g*f)+h*(1-Hr(p))]}return arguments.length<8&&(f=0),l.invert=function(l,g){var v,s,h=Xr*l/n,p=g,d=50;do{var w=p*p,P=n+w*(r+w*(e+w*t)),m=p*(i-1+w*(a-f+w*c)),y=P*P+m*m,R=2*m,j=y/R,M=j*j,E=o(P/j)/Xr,b=h*E,k=P*P,S=(2*r+w*(4*e+6*w*t))*p,A=i+w*(3*a+5*w*c),G=2*(P*S+m*(A-1)),C=2*(A-1),z=(G*R-y*C)/(R*R),F=Hr(b),L=Kr(b),q=j*F,x=j*L,B=h/Xr*(1/u(1-k/M))*(S*j-P*z)/M,H=x-l,I=p*(1+w*f)+j-q-g,W=z*L+q*B,T=q*E,D=1+z-(z*F-x*B),Q=x*E,V=W*Q-D*T;if(!V)break;h-=v=(I*W-H*D)/V,p-=s=(H*Q-I*T)/V}while((qr(v)>Ur||qr(s)>Ur)&&--d>0);return[h,p]},l},Ne=Ve(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),_e=function(){return r.geoProjection(Ne).scale(149.995)},Ke=Ve(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),Oe=function(){return r.geoProjection(Ke).scale(153.93)},Ue=Ve(5/6*Xr,-.62636,-.0344,0,1.3493,-.05524,0,.045),Je=function(){return r.geoProjection(Ue).scale(130.945)};X.invert=function(n,r){var e,t=n,o=r,i=50;do{var u=o*o;o-=e=(o*(1+u/12)-r)/(1+u/4)}while(qr(e)>Ur&&--i>0);i=50,n/=1-.162388*u;do{var a=(a=t*t)*a | ||
;t-=e=(t*(.87-952426e-9*a)-n)/(.87-.00476213*a)}while(qr(e)>Ur&&--i>0);return[t,o]};var Xe=function(){return r.geoProjection(X).scale(131.747)},Ye=Ve(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762),Ze=function(){return r.geoProjection(Ye).scale(131.087)},$e=function(n){function r(r,t){var o=r>0?-.5:.5,i=n(r+o*Xr,t);return i[0]-=o*e,i}var e=n(Yr,0)[0]-n(-Yr,0)[0];return n.invert&&(r.invert=function(r,t){var o=r>0?-.5:.5,i=n.invert(r+o*e,t),u=i[0]-o*Xr;return u<-Xr?u+=2*Xr:u>Xr&&(u-=2*Xr),i[0]=u,i}),r};Y.invert=function(n,r){var e=_r(n),t=_r(r),i=-e*n,u=-t*r,a=u/i<1,c=$(a?u:i,a?i:u),f=c[0],l=c[1],g=Hr(l);return a&&(f=-Yr-f),[e*(Br(Kr(f)*g,-Kr(l))+Xr),t*o(Hr(f)*g)]};var nt=function(){return r.geoProjection($e(Y)).scale(239.75)};on.invert=function(n,r){var e=(ne-1)/(ne+1),t=u(1-e*e),o=tn(Yr,t*t),i=nn(.5*o-r,-n,t*t),a=an(i[0],i[1]);return[Br(a[1],a[0])/-1,2*xr(Ir(-.5*Tr(e*a[0]*a[0]+e*a[1]*a[1])))-Yr]};var rt=function(){return r.geoProjection($e(on)).scale(151.496)};fn.invert=function(n,r){var e=2*o(r/2);return[n*Hr(e/2)/Hr(e),e]};var et=function(){var n=2,e=r.geoProjectionMutator(cn),t=e(n);return t.coefficient=function(r){return arguments.length?e(n=+r):n},t.scale(169.529)},tt=function(){var n=0,e=r.geoProjectionMutator(ln),t=e(n),o=t.rotate,i=t.stream,u=r.geoCircle();return t.parallel=function(r){if(!arguments.length)return n*te;var o=t.rotate();return e(n=r*oe).rotate(o)},t.rotate=function(r){return arguments.length?(o.call(t,[r[0],r[1]-n*te]),u.center([-r[0],-r[1]]),t):(r=o.call(t),r[1]+=n*te,r)},t.stream=function(n){return n=i(n),n.sphere=function(){n.polygonStart();var r,e=u.radius(89.99)().coordinates[0],t=e.length-1,o=-1;for(n.lineStart();++o<t;)n.point((r=e[o])[0],r[1]);for(n.lineEnd(),e=u.radius(90.01)().coordinates[0],t=e.length-1,n.lineStart();--o>=0;)n.point((r=e[o])[0],r[1]);n.lineEnd(),n.polygonEnd()},n},t.scale(79.4187).parallel(45).clipAngle(179.999)},ot=41+48/36+37/3600,it=q(0),ut=function(){var n=4,e=r.geoProjectionMutator(vn),t=e(n),o=t.stream;return t.lobes=function(r){return arguments.length?e(n=+r):n},t.stream=function(e){var i=t.rotate(),u=o(e),a=(t.rotate([0,0]),o(e));return t.rotate(i),u.sphere=function(){r.geoStream(sn(180/n),a)},u},t.scale(239.75)},at=function(){var n=1,e=r.geoProjectionMutator(hn),t=e(n);return t.ratio=function(r){return arguments.length?e(n=+r):n},t.scale(167.774).center([0,18.67])},ct=.7109889596207567,ft=.0528035274542;pn.invert=function(n,r){return r>-ct?se.invert(n,r-ft):R.invert(n,r)};var lt=function(){return r.geoProjection(pn).rotate([-20,-55]).scale(164.263).center([0,-5.4036])};dn.invert=function(n,r){return qr(r)>ct?se.invert(n,r+(r>0?ft:-ft)):R.invert(n,r)};var gt=function(){return r.geoProjection(dn).scale(152.63)},vt=function(n,e){function t(r,t){for(var o=t<0?-1:1,i=e[+(t<0)],u=0,a=i.length-1;u<a&&r>i[u][2][0];++u);var c=n(r-i[u][1][0],t);return c[0]+=n(i[u][1][0],o*t>o*i[u][0][1]?i[u][0][1]:t)[0],c}var o=mn(e);e=e.map(function(n){return n.map(function(n){return[[n[0][0]*oe,n[0][1]*oe],[n[1][0]*oe,n[1][1]*oe],[n[2][0]*oe,n[2][1]*oe]]})});var i=e.map(function(r){return r.map(function(r){var e,t=n(r[0][0],r[0][1])[0],o=n(r[2][0],r[2][1])[0],i=n(r[1][0],r[0][1])[1],u=n(r[1][0],r[1][1])[1];return i>u&&(e=i,i=u,u=e),[[t,i],[o,u]]})});n.invert&&(t.invert=function(r,o){for(var u=i[+(o<0)],a=e[+(o<0)],c=0,f=u.length;c<f;++c){var l=u[c];if(l[0][0]<=r&&r<l[1][0]&&l[0][1]<=o&&o<l[1][1]){var g=n.invert(r-n(a[c][1][0],0)[0],o);return g[0]+=a[c][1][0],wn(t(g[0],g[1]),[r,o])?g:null}}});var u=r.geoProjection(t),a=u.stream;return u.stream=function(n){var e=u.rotate(),t=a(n),i=(u.rotate([0,0]),a(n));return u.rotate(e),t.sphere=function(){r.geoStream(o,i)},t},u},st=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],ht=function(){return vt(y,st).scale(160.857)},pt=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],dt=function(){return vt(dn,pt).scale(152.63)},wt=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],Pt=function(){return vt(se,wt).scale(169.529)},mt=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]],yt=function(){return vt(se,mt).scale(169.529).rotate([20,0])},Rt=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]],jt=function(){return vt(pn,Rt).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},Mt=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]],Et=function(){return vt(R,Mt).scale(152.63).rotate([-20,0])};yn.invert=function(n,r){return[ee/3*n/u(Xr*Xr/3-r*r),r]};var bt=function(){return r.geoProjection(yn).scale(158.837)},kt=function(){var n=.5,e=r.geoProjectionMutator(Rn),t=e(n);return t.spacing=function(r){return arguments.length?e(n=+r):n},t.scale(124.75)},St=Xr/ne;jn.invert=function(n,r){var e=qr(n),t=qr(r),o=Ur,a=Yr;t<St?a*=t/St:o+=6*i(St/t);for(var c=0;c<25;c++){var f=Kr(a),l=u(Hr(a)),g=Kr(a/2),v=Hr(a/2),s=Kr(o/6),h=Hr(o/6),p=.5*o*(1+l)-e,d=a/(v*h)-t,w=l?-.25*o*f/l:0,P=.5*(1+l),m=(1+.5*a*g/v)/(v*h),y=a/v*(s/6)/(h*h),R=w*y-m*P,j=(p*y-d*P)/R,M=(d*w-p*m)/R;if(a-=j,o-=M,qr(j)<Ur&&qr(M)<Ur)break}return[n<0?-o:o,r<0?-a:a]};var At=function(){return r.geoProjection(jn).scale(97.2672)};Mn.invert=function(n,r){var e=_r(n)*Xr,t=r/2,o=50;do{var i=e*e,u=t*t,a=e*t,c=e*(.975534+u*(i*-.0143059-.119161+u*-.0547009))-n,f=t*(1.00384+i*(.0802894+u*-.02855+199025e-9*i)+u*(.0998909+u*-.0491032))-r,l=.975534-u*(.119161+3*i*.0143059+.0547009*u),g=-a*(.238322+.2188036*u+.0286118*i),v=a*(.1605788+7961e-7*i+-.0571*u),s=1.00384+i*(.0802894+199025e-9*i)+u*(3*(.0998909-.02855*i)-.245516*u),h=g*v-s*l,p=(f*g-c*s)/h,d=(c*v-f*l)/h;e-=p,t-=d}while((qr(p)>Ur||qr(d)>Ur)&&--o>0);return o&&[e,t]};var Gt=function(){return r.geoProjection(Mn).scale(139.98)};En.invert=function(n,r){var e=n*n,t=r*r,a=t+1,c=n?$r*u((a-u(e*e+2*e*(t-1)+a*a))/e+1):1/u(a);return[o(n*c),_r(r)*i(c)]};var Ct=function(){return r.geoProjection(En).scale(144.049).clipAngle(89.999)},zt=function(){return Pe(bn).parallel(40).scale(158.837)};kn.invert=function(n,r){return[n,2.5*xr(Ir(.8*r))-.625*Xr]};var Ft=function(){return r.geoProjection(kn).scale(108.318)},Lt=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],qt=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],xt=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Bt=[[.9245,0],[0,0],[.01943,0]],Ht=[[.721316,0],[0,0],[-.00881625,-.00617325]],It=u(6),Wt=u(7);qn.invert=function(n,r){var e=3*o(r*Wt/9);return[n*Wt/(It*(2*Hr(2*e/3)-1)),o(3*Kr(e)*It/7)]};var Tt=function(){return r.geoProjection(qn).scale(164.859)};xn.invert=function(n,r){var e=r*u(2+ne)/(2*u(3)),t=2*o(e);return[3*ne*n/(1+2*Hr(t)/Hr(t/2)),o((e+Kr(t))/(1+$r))]};var Dt=function(){return r.geoProjection(xn).scale(188.209)};Bn.invert=function(n,r){var e=u(6/(4+Xr)),t=r/e;return qr(qr(t)-Yr)<Ur&&(t=t<0?-Yr:Yr),[1.5*n/(e*(.5+Hr(t))),o((t/2+Kr(t))/(1+Xr/4))]};var Qt=function(){return r.geoProjection(Bn).scale(166.518)};Hn.invert=function(n,r){var e,t=r,o=25;do{var i=t*t,u=i*i;t-=e=(t*(1.007226+i*(.015085+u*(.028874*i-.044475-.005916*u)))-r)/(1.007226+i*(.045255+u*(.259866*i-.311325-.005916*11*u)))}while(qr(e)>Ur&&--o>0);return[n/(.8707+(i=t*t)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),t]};var Vt=function(){return r.geoProjection(Hn).scale(175.295)};In.invert=function(n,r){for(var e=r/2,t=0,o=1/0;t<10&&qr(o)>Ur;++t){var i=Hr(r/2);r-=o=(r-Or(r/2)-e)/(1-.5/(i*i))}return[2*n/(1+Hr(r)),r]};var Nt=function(){return r.geoProjection(In).scale(152.63)},_t=1.0148,Kt=.23185,Ot=-.14499,Ut=.02406,Jt=_t,Xt=5*Kt,Yt=7*Ot,Zt=9*Ut;Wn.invert=function(n,r){r>1.790857183?r=1.790857183:r<-1.790857183&&(r=-1.790857183);var e,t=r;do{var o=t*t;t-=e=(t*(_t+o*o*(Kt+o*(Ot+Ut*o)))-r)/(Jt+o*o*(Xt+o*(Yt+Zt*o)))}while(qr(e)>Ur);return[n,t]};var $t=function(){return r.geoProjection(Wn).scale(139.319)};Tn.invert=function(n,r){if(qr(r)<Ur)return[n,0];var e,t=n*n+r*r,u=.5*r,a=10;do{var c=Or(u),f=1/Hr(u),l=t-2*r*u+u*u;u-=e=(c*l+2*(u-r))/(2+l*f*f+2*(u-r)*c)}while(qr(e)>Ur&&--a>0);return c=Or(u),[(qr(r)<qr(u+1/c)?o(n*c):_r(n)*(i(qr(n*c))+Yr))/Kr(u),u]};var no=function(){return r.geoProjection(Tn).scale(103.74)},ro=function(n,r){var e=Vn(n[1],n[0]),t=Vn(r[1],r[0]),o=_n(e,t),i=Nn(e)/Nn(t);return Qn([1,0,n[0][0],0,1,n[0][1]],Qn([i,0,0,0,i,0],Qn([Hr(o),Kr(o),0,-Kr(o),Hr(o),0],[1,0,-r[0][0],0,1,-r[0][1]])))},eo=function(n,e,t){function o(n,r){if(n.edges=Jn(n.face),r.face){var e=n.shared=Un(n.face,r.face),t=ro(e.map(r.project),e.map(n.project));n.transform=r.transform?Qn(r.transform,t):t;for(var i=r.edges,u=0,a=i.length;u<a;++u)On(e[0],i[u][1])&&On(e[1],i[u][0])&&(i[u]=n),On(e[0],i[u][0])&&On(e[1],i[u][1])&&(i[u]=n);for(i=n.edges,u=0,a=i.length;u<a;++u)On(e[0],i[u][0])&&On(e[1],i[u][1])&&(i[u]=r),On(e[0],i[u][1])&&On(e[1],i[u][0])&&(i[u]=r)}else n.transform=r.transform;return n.children&&n.children.forEach(function(r){o(r,n)}),n}function i(n,r){var t,o=e(n,r),i=o.project([n*te,r*te]);return(t=o.transform)?[t[0]*i[0]+t[1]*i[1]+t[2],-(t[3]*i[0]+t[4]*i[1]+t[5])]:(i[1]=-i[1],i)}function u(n,r){var e=n.project.invert,t=n.transform,o=r;if(t&&(t=Dn(t),o=[t[0]*o[0]+t[1]*o[1]+t[2],t[3]*o[0]+t[4]*o[1]+t[5]]),e&&n===a(i=e(o)))return i;for(var i,c=n.children,f=0,l=c&&c.length;f<l;++f)if(i=u(c[f],r))return i}function a(n){return e(n[0]*oe,n[1]*oe)}t=null==t?-Xr/6:t,o(n,{transform:[Hr(t),Kr(t),0,-Kr(t),Hr(t),0]}),Xn(n)&&(i.invert=function(r,e){var t=u(n,[r,-e]);return t&&(t[0]*=oe,t[1]*=oe,t)});var c=r.geoProjection(i),f=c.stream;return c.stream=function(r){var e=c.rotate(),t=f(r),o=(c.rotate([0,0]),f(r));return c.rotate(e),t.sphere=function(){o.polygonStart(),o.lineStart(),Kn(o,n),o.lineEnd(),o.polygonEnd()},t},c},to=[[0,90],[-90,0],[0,0],[90,0],[180,0],[0,-90]],oo=[[0,2,1],[0,3,2],[5,1,2],[5,2,3],[0,1,4],[0,4,3],[5,4,1],[5,3,4]].map(function(n){return n.map(function(n){return to[n]})}),io=function(n){n=n||function(n){var e=r.geoCentroid({type:"MultiPoint",coordinates:n});return r.geoGnomonic().scale(1).translate([0,0]).rotate([-e[0],-e[1]])};var e=oo.map(function(r){return{face:r,project:n(r)}});return[-1,0,0,1,0,1,4,5].forEach(function(n,r){var t=e[n];t&&(t.children||(t.children=[])).push(e[r])}),eo(e[0],function(n,r){return e[n<-Xr/2?r<0?6:4:n<0?r<0?2:0:n<Xr/2?r<0?3:1:r<0?7:5]}).scale(101.858).center([0,45])},uo=2/u(3);Yn.invert=function(n,r){return z.invert(n/uo,r)};var ao=function(n){n=n||function(n){var e=r.geoCentroid({type:"MultiPoint",coordinates:n});return r.geoProjection(Yn).translate([0,0]).scale(1).rotate(e[1]>0?[-e[0],0]:[180-e[0],180])};var e=oo.map(function(r){return{face:r,project:n(r)}});return[-1,0,0,1,0,1,4,5].forEach(function(n,r){var t=e[n];t&&(t.children||(t.children=[])).push(e[r])}),eo(e[0],function(n,r){return e[n<-Xr/2?r<0?6:4:n<0?r<0?2:0:n<Xr/2?r<0?3:1:r<0?7:5]}).scale(121.906).center([0,48.5904])},co=function(n){function e(n,r){var e=Hr(r),t=[e*Hr(n),e*Kr(n),Kr(r)],i=n<-Xr/2?r<0?6:4:n<0?r<0?2:0:n<Xr/2?r<0?3:1:r<0?7:5,a=o[i];return u[Zn(a[0],t)<0?8+3*i:Zn(a[1],t)<0?8+3*i+1:Zn(a[2],t)<0?8+3*i+2:i]}n=n||function(n){var e=6===n.length?r.geoCentroid({type:"MultiPoint",coordinates:n}):n[0];return r.geoGnomonic().scale(1).translate([0,0]).rotate([-e[0],-e[1]])};var t=oo.map(function(n){for(var r,e=n.map(rr),t=e.length,o=e[t-1],i=[],u=0;u<t;++u)r=e[u],i.push(nr([.9486832980505138*o[0]+.31622776601683794*r[0],.9486832980505138*o[1]+.31622776601683794*r[1],.9486832980505138*o[2]+.31622776601683794*r[2]]),nr([.9486832980505138*r[0]+.31622776601683794*o[0],.9486832980505138*r[1]+.31622776601683794*o[1],.9486832980505138*r[2]+.31622776601683794*o[2]])),o=r;return i}),o=[],i=[-1,0,0,1,0,1,4,5];t.forEach(function(n,r){for(var e=oo[r],u=e.length,a=o[r]=[],c=0;c<u;++c)t.push([e[c],n[(2*c+2)%(2*u)],n[(2*c+1)%(2*u)]]),i.push(r),a.push($n(rr(n[(2*c+2)%(2*u)]),rr(n[(2*c+1)%(2*u)])))});var u=t.map(function(r){return{project:n(r),face:r}});return i.forEach(function(n,r){var e=u[n];e&&(e.children||(e.children=[])).push(u[r])}),eo(u[0],e).scale(110.625).center([0,45])},fo=function(){},lo=function(n){if((r=n.length)<4)return!1;for(var r,e=0,t=n[r-1][1]*n[0][0]-n[r-1][0]*n[0][1];++e<r;)t+=n[e-1][1]*n[e][0]-n[e-1][0]*n[e][1];return t<=0},go=function(n,r){for(var e=r[0],t=r[1],o=!1,i=0,u=n.length,a=u-1;i<u;a=i++){var c=n[i],f=c[0],l=c[1],g=n[a],v=g[0],s=g[1];l>t^s>t&&e<(v-f)*(t-l)/(s-l)+f&&(o=!o)}return o},vo=function(n,r){var e,t=r.stream;if(!t)throw new Error("invalid projection");switch(n&&n.type){case"Feature":e=tr;break;case"FeatureCollection":e=er;break;default:e=ir}return e(n,t)},so=[],ho=[],po={point:function(n,r){so.push([n,r])},result:function(){var n=so.length?so.length<2?{type:"Point",coordinates:so[0]}:{type:"MultiPoint",coordinates:so}:null;return so=[],n}},wo={lineStart:fo,point:function(n,r){so.push([n,r])},lineEnd:function(){so.length&&(ho.push(so),so=[])},result:function(){var n=ho.length?ho.length<2?{type:"LineString",coordinates:ho[0]}:{type:"MultiLineString",coordinates:ho}:null;return ho=[],n}},Po={polygonStart:fo,lineStart:fo,point:function(n,r){so.push([n,r])},lineEnd:function(){var n=so.length;if(n){do{so.push(so[0].slice())}while(++n<4);ho.push(so),so=[]}},polygonEnd:fo,result:function(){if(!ho.length)return null;var n=[],r=[];return ho.forEach(function(e){lo(e)?n.push([e]):r.push(e)}),r.forEach(function(r){var e=r[0];n.some(function(n){if(go(n[0],e))return n.push(r),!0})||n.push([r])}),ho=[],n.length?n.length>1?{type:"MultiPolygon",coordinates:n}:{type:"Polygon",coordinates:n[0]}:null}},mo=function(n){function e(r,e){var o=qr(r)<Yr,i=n(o?r:r>0?r-Xr:r+Xr,e),u=(i[0]-i[1])*$r,a=(i[0]+i[1])*$r;if(o)return[u,a];var c=t*$r,f=u>0^a>0?-1:1;return[f*u-_r(a)*c,f*a-_r(u)*c]}var t=n(Yr,0)[0]-n(-Yr,0)[0];return n.invert&&(e.invert=function(r,e){var o=(r+e)*$r,i=(e-r)*$r,u=qr(o)<.5*t&&qr(i)<.5*t;if(!u){var a=t*$r,c=o>0^i>0?-1:1,f=-c*(r+(i>0?1:-1)*a),l=-c*(e+(o>0?1:-1)*a);o=(-f-l)*$r,i=(f-l)*$r}var g=n.invert(o,i);return u||(g[0]+=o>0?Xr:-Xr),g}),r.geoProjection(e).rotate([-90,-90,45]).clipAngle(179.999)},yo=function(){return mo(Y).scale(176.423)},Ro=function(){return mo(on).scale(111.48)},jo=function(n,r){function e(n){n[0]=+n[0].toFixed(r),n[1]=+n[1].toFixed(r)}function t(n){n.forEach(e)}function o(n){n.forEach(t)}function i(n){if(n)switch(n.type){case"GeometryCollection":n.geometries.forEach(i);break;case"Point":e(n.coordinates);break;case"MultiPoint":case"LineString":t(n.coordinates);break;case"MultiLineString":case"Polygon":o(n.coordinates);break;case"MultiPolygon":n.coordinates.forEach(o);break;default:return}}function u(n){i(n.geometry)}if(!(0<=(r=+r)&&r<=20))throw new Error("invalid digits");if(n)switch(n.type){case"Feature":u(n);break;case"FeatureCollection":n.features.forEach(u);break;default:i(n)}return n},Mo=function(){return Pe(ur).scale(131.215)},Eo=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];Eo.forEach(function(n){n[1]*=1.0144}),ar.invert=function(n,r){var e=r/Yr,t=90*e,o=Qr(18,qr(t/5)),i=Dr(0,Wr(o));do{var u=Eo[i][1],a=Eo[i+1][1],c=Eo[Qr(19,i+2)][1],f=c-u,l=c-2*a+u,g=2*(qr(e)-a)/f,v=l/f,s=g*(1-v*g*(1-2*v*g));if(s>=0||1===i){t=(r>=0?5:-5)*(s+o);var h,p=50;do{o=Qr(18,qr(t)/5),i=Wr(o),s=o-i,u=Eo[i][1],a=Eo[i+1][1],c=Eo[Qr(19,i+2)][1],t-=(h=(r>=0?Yr:-Yr)*(a+s*(c-u)/2+s*s*(c-2*a+u)/2)-r)*te}while(qr(h)>Jr&&--p>0);break}}while(--i>=0);var d=Eo[i][0],w=Eo[i+1][0],P=Eo[Qr(19,i+2)][0];return[n/(w+s*(P-d)/2+s*s*(P-2*w+d)/2),t*oe]};var bo=function(){return r.geoProjection(ar).scale(152.63)},ko=function(){var n=2,e=0,t=r.geoProjectionMutator(fr),o=t(n,e);return o.distance=function(r){return arguments.length?t(n=+r,e):n},o.tilt=function(r){return arguments.length?t(n,e=r*oe):e*te},o.scale(432.147).clipAngle(i(1/n)*te-1e-6)},So=1e4,Ao=-180,Go=Ao+1e-4,Co=180,zo=Co-1e-4,Fo=-90,Lo=Fo+1e-4,qo=90,xo=qo-1e-4,Bo=function(n){if(n)switch(n.type){case"Feature":wr(n);break;case"FeatureCollection":n.features.forEach(wr);break;default:Pr(n)}return n};mr.invert=function(n,r){var e=r/1.70711,t=Kr(Zr*e);return[n/(.74482-.34588*t*t),2*xr(e)]};var Ho=function(){return r.geoProjection(mr).scale(146.153)},Io=function(n,e,t){var i=r.geoInterpolate(e,t),u=i(.5),a=r.geoRotation([-u[0],-u[1]])(e),c=i.distance/2,f=-o(Kr(a[1]*oe)/Kr(c)),l=[-u[0],-u[1],-(a[0]>0?Xr-f:f)*te],g=r.geoProjection(n(c)).rotate(l),v=r.geoRotation(l),s=g.center;return delete g.rotate,g.center=function(n){return arguments.length?s(v(n)):v.invert(s())},g.clipAngle(90)};kr.invert=function(n,r){if(qr(r)<Ur)return[n,0];if(qr(n)<Ur)return[0,Yr*Kr(2*xr(r/Xr))];var e=(n/=Xr)*n,t=(r/=Xr)*r,o=e+t,a=o*o,c=-qr(r)*(1+o),f=c-2*t+e,l=-2*c+1+2*t+a,g=t/l+(2*f*f*f/(l*l*l)-9*c*f/(l*l))/27,v=(c-f*f/(3*l))/l,s=2*u(-v/3),h=i(3*g/(v*s))/3;return[Xr*(o-1+u(1+2*(e-t)+a))/(2*n),_r(r)*Xr*(-s*Hr(h+Xr/3)-f/(3*l))]};var Wo=function(){return r.geoProjection(kr).scale(79.4183)};Sr.invert=function(n,r){if(!n)return[0,Yr*Kr(2*xr(r/Xr))];var e=qr(n/Xr),t=(1-e*e-(r/=Xr)*r)/(2*e),o=t*t,i=u(o+1);return[_r(n)*Xr*(i-t),_r(r)*Yr*Kr(2*Br(u((1-2*t*e)*(t+i)-e),u(i+t+e)))]};var To=function(){return r.geoProjection(Sr).scale(79.4183)};Ar.invert=function(n,r){if(!r)return[n,0];var e=r/Xr,t=(Xr*Xr*(1-e*e)-n*n)/(2*Xr*n);return[n?Xr*(_r(n)*u(t*t+1)-t):0,Yr*Kr(2*xr(e))]};var Do=function(){return r.geoProjection(Ar).scale(79.4183)};Gr.invert=function(n,r){var e;if(!n||!r)return[n,r];r/=Xr;var t=_r(n)*n/Yr,o=(t*t-1+4*r*r)/qr(t),i=o*o,a=2*r,c=50;do{var f=a*a,l=(8*a-f*(f+2)-5)/(2*f*(a-1)),g=(3*a-f*a-10)/(2*f*a),v=l*l,s=a*l,h=a+l,p=h*h,d=a+3*l,w=p*(f+v*i-1)+(1-f)*(f*(d*d+4*v)+v*(12*s+4*v)),P=-2*h*(4*s*v+(1-4*f+3*f*f)*(1+g)+v*(14*f-6-i+(8*f-8-2*i)*g)+s*(12*f-8+(10*f-10-i)*g)),m=u(w);a-=e=(o*(p+v-1)+2*m-t*(4*p+i))/(o*(2*l*g+2*h*(1+g))+P/m-8*h*(o*(-1+v+p)+2*m)*(1+g)/(i+4*p))}while(e>Ur&&--c>0);return[_r(n)*(u(o*o+4)+o)*Xr/4,Yr*a]};var Qo=function(){return r.geoProjection(Gr).scale(127.16)},Vo=4*Xr+3*u(3),No=2*u(2*Xr*u(3)/Vo),_o=m(No*u(3)/Xr,No,Vo/6),Ko=function(){return r.geoProjection(_o).scale(176.84)};Cr.invert=function(n,r){return[n/u(1-3*r*r/(Xr*Xr)),r]};var Oo=function(){return r.geoProjection(Cr).scale(152.63)};zr.invert=function(n,r){var e=n/2.66723,t=r/1.24104,i=u(e*e+t*t),a=2*o(i/2);return[3*Br(n*Or(a),2.66723*i),i&&o(r*Kr(a)/(1.24104*.90631*i))]};var Uo=function(){return r.geoProjection(zr).scale(172.632)};Fr.invert=function(n,r){var e=(n*n+r*r)/-2,t=u(-e*(2+e)),i=r*e+n*t,a=n*e-r*t,c=u(a*a+i*i);return[Br(t*i,c*(1+e)),c?-o(t*a/c):0]};var Jo=function(){return r.geoProjection(Fr).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)};Lr.invert=function(n,r){var e=n,t=r,o=25;do{var a,c=Hr(t),f=Kr(t),l=Kr(2*t),g=f*f,v=c*c,s=Kr(e),h=Hr(e/2),p=Kr(e/2),d=p*p,w=1-v*h*h,P=w?i(c*h)*u(a=1/w):a=0,m=.5*(2*P*c*p+e/Yr)-n,y=.5*(P*f+t)-r,R=.5*a*(v*d+P*c*h*g)+.5/Yr,j=a*(s*l/4-P*f*p),M=.125*a*(l*p-P*f*v*s),E=.5*a*(g*h+P*d*c)+.5,b=j*M-E*R,k=(y*j-m*E)/b,S=(m*M-y*R)/b;e-=k,t-=S}while((qr(k)>Ur||qr(S)>Ur)&&--o>0);return[e,t]};var Xo=function(){return r.geoProjection(Lr).scale(158.837)};n.geoAiry=ie,n.geoAiryRaw=v,n.geoAitoff=ue,n.geoAitoffRaw=s,n.geoArmadillo=ae,n.geoArmadilloRaw=h,n.geoAugust=ce,n.geoAugustRaw=p,n.geoBaker=ge,n.geoBakerRaw=d,n.geoBerghaus=ve,n.geoBerghausRaw=w,n.geoBoggs=we,n.geoBoggsRaw=y,n.geoBonne=ye,n.geoBonneRaw=j,n.geoBottomley=Re,n.geoBottomleyRaw=M,n.geoBromley=Me,n.geoBromleyRaw=je,n.geoChamberlin=C,n.geoChamberlinRaw=S,n.geoChamberlinAfrica=G,n.geoCollignon=Ee,n.geoCollignonRaw=z,n.geoCraig=be,n.geoCraigRaw=F,n.geoCraster=Se,n.geoCrasterRaw=L,n.geoCylindricalEqualArea=Ae,n.geoCylindricalEqualAreaRaw=q,n.geoCylindricalStereographic=Ge,n.geoCylindricalStereographicRaw=x,n.geoEckert1=Ce,n.geoEckert1Raw=B,n.geoEckert2=ze,n.geoEckert2Raw=H,n.geoEckert3=Fe,n.geoEckert3Raw=I,n.geoEckert4=Le,n.geoEckert4Raw=W,n.geoEckert5=qe,n.geoEckert5Raw=T,n.geoEckert6=xe,n.geoEckert6Raw=D,n.geoEisenlohr=He,n.geoEisenlohrRaw=Q,n.geoFahey=We,n.geoFaheyRaw=V,n.geoFoucaut=Te,n.geoFoucautRaw=N,n.geoGilbert=De,n.geoGingery=Qe,n.geoGingeryRaw=O,n.geoGinzburg4=_e,n.geoGinzburg4Raw=Ne,n.geoGinzburg5=Oe,n.geoGinzburg5Raw=Ke,n.geoGinzburg6=Je,n.geoGinzburg6Raw=Ue,n.geoGinzburg8=Xe,n.geoGinzburg8Raw=X,n.geoGinzburg9=Ze,n.geoGinzburg9Raw=Ye,n.geoGringorten=nt,n.geoGringortenRaw=Y,n.geoGuyou=rt,n.geoGuyouRaw=on,n.geoHammer=et,n.geoHammerRaw=cn,n.geoHammerRetroazimuthal=tt,n.geoHammerRetroazimuthalRaw=ln,n.geoHealpix=ut,n.geoHealpixRaw=vn,n.geoHill=at,n.geoHillRaw=hn,n.geoHomolosine=gt,n.geoHomolosineRaw=dn,n.geoInterrupt=vt,n.geoInterruptedBoggs=ht,n.geoInterruptedHomolosine=dt,n.geoInterruptedMollweide=Pt,n.geoInterruptedMollweideHemispheres=yt,n.geoInterruptedSinuMollweide=jt,n.geoInterruptedSinusoidal=Et,n.geoKavrayskiy7=bt,n.geoKavrayskiy7Raw=yn,n.geoLagrange=kt,n.geoLagrangeRaw=Rn,n.geoLarrivee=At,n.geoLarriveeRaw=jn,n.geoLaskowski=Gt,n.geoLaskowskiRaw=Mn,n.geoLittrow=Ct,n.geoLittrowRaw=En,n.geoLoximuthal=zt,n.geoLoximuthalRaw=bn,n.geoMiller=Ft,n.geoMillerRaw=kn,n.geoModifiedStereographic=Ln,n.geoModifiedStereographicRaw=Sn,n.geoModifiedStereographicAlaska=An,n.geoModifiedStereographicGs48=Gn,n.geoModifiedStereographicGs50=Cn,n.geoModifiedStereographicMiller=zn,n.geoModifiedStereographicLee=Fn,n.geoMollweide=he,n.geoMollweideRaw=se,n.geoMtFlatPolarParabolic=Tt,n.geoMtFlatPolarParabolicRaw=qn,n.geoMtFlatPolarQuartic=Dt,n.geoMtFlatPolarQuarticRaw=xn,n.geoMtFlatPolarSinusoidal=Qt,n.geoMtFlatPolarSinusoidalRaw=Bn,n.geoNaturalEarth=Vt,n.geoNaturalEarthRaw=Hn,n.geoNellHammer=Nt,n.geoNellHammerRaw=In,n.geoPatterson=$t,n.geoPattersonRaw=Wn,n.geoPolyconic=no,n.geoPolyconicRaw=Tn,n.geoPolyhedral=eo,n.geoPolyhedralButterfly=io,n.geoPolyhedralCollignon=ao,n.geoPolyhedralWaterman=co,n.geoProject=vo,n.geoGringortenQuincuncial=yo,n.geoPeirceQuincuncial=Ro,n.geoPierceQuincuncial=Ro,n.geoQuantize=jo,n.geoQuincuncial=mo,n.geoRectangularPolyconic=Mo,n.geoRectangularPolyconicRaw=ur,n.geoRobinson=bo,n.geoRobinsonRaw=ar,n.geoSatellite=ko,n.geoSatelliteRaw=fr,n.geoSinuMollweide=lt,n.geoSinuMollweideRaw=pn,n.geoSinusoidal=me,n.geoSinusoidalRaw=R,n.geoStitch=Bo,n.geoTimes=Ho,n.geoTimesRaw=mr,n.geoTwoPointAzimuthal=jr,n.geoTwoPointAzimuthalRaw=yr,n.geoTwoPointAzimuthalUsa=Rr,n.geoTwoPointEquidistant=br,n.geoTwoPointEquidistantRaw=Mr,n.geoTwoPointEquidistantUsa=Er,n.geoVanDerGrinten=Wo,n.geoVanDerGrintenRaw=kr,n.geoVanDerGrinten2=To,n.geoVanDerGrinten2Raw=Sr,n.geoVanDerGrinten3=Do,n.geoVanDerGrinten3Raw=Ar,n.geoVanDerGrinten4=Qo,n.geoVanDerGrinten4Raw=Gr,n.geoWagner4=Ko,n.geoWagner4Raw=_o,n.geoWagner6=Oo,n.geoWagner6Raw=Cr,n.geoWagner7=Uo,n.geoWagner7Raw=zr,n.geoWiechel=Jo,n.geoWiechelRaw=Fr,n.geoWinkel3=Xo,n.geoWinkel3Raw=Lr,Object.defineProperty(n,"__esModule",{value:!0})}); |
{ | ||
"name": "d3-geo-projection", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Extended geographic projections for d3-geo.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -8,2 +8,6 @@ var epsilon = 1e-4, | ||
function nonempty(coordinates) { | ||
return coordinates.length > 0; | ||
} | ||
function quantize(x) { | ||
@@ -92,3 +96,2 @@ return Math.floor(x * epsilonInverse) / epsilonInverse; | ||
// Now stitch the fragments back together into rings. | ||
// TODO remove empty polygons. | ||
function stitchFragments(fragments) { | ||
@@ -180,23 +183,10 @@ var i, n = fragments.length; | ||
var fragments, i, n; | ||
switch (o.type) { | ||
case "GeometryCollection": { | ||
o.geometries.forEach(stitchGeometry); | ||
return; | ||
} | ||
case "Point": { | ||
clampPoint(o.coordinates); | ||
break; | ||
} | ||
case "MultiPoint": | ||
case "LineString": { | ||
clampPoints(o.coordinates); | ||
break; | ||
} | ||
case "MultiLineString": { | ||
o.coordinates.forEach(clampPoints); | ||
break; | ||
} | ||
case "GeometryCollection": o.geometries.forEach(stitchGeometry); break; | ||
case "Point": clampPoint(o.coordinates); break; | ||
case "MultiPoint": case "LineString": clampPoints(o.coordinates); break; | ||
case "MultiLineString": o.coordinates.forEach(clampPoints); break; | ||
case "Polygon": { | ||
extractFragments(o.coordinates, fragments = []); | ||
stitchFragments(fragments); | ||
break; | ||
@@ -207,8 +197,7 @@ } | ||
while (++i < n) extractFragments(o.coordinates[i], fragments); | ||
stitchFragments(fragments); | ||
o.coordinates = o.coordinates.filter(nonempty); | ||
break; | ||
} | ||
default: return; | ||
} | ||
stitchFragments(fragments); | ||
} | ||
@@ -215,0 +204,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6828528
7958