eurostat-map 4.3.12 → 4.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /*! /*! eurostat-map v4.3.12 | 2025 Eurostat | EUPL License. See https://github.com/eurostat/eurostat-map/blob/master/LICENSE * / */
1
+ /*! /*! eurostat-map v4.3.13 | 2025 Eurostat | EUPL License. See https://github.com/eurostat/eurostat-map/blob/master/LICENSE * / */
2
2
  !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.eurostatmap=e():t.eurostatmap=e()}(self,(()=>(()=>{var t={6:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var i=n(601),r=n.n(i),a=n(314),o=n.n(a)()(r());o.push([t.id,"/* Legend hover classes for lines */\n.em-flow-lines line.dimmed {\n opacity: 0;\n}\n.em-flow-lines line.highlighted {\n opacity: 1;\n}\n",""]);const s=o},56:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},72:t=>{"use strict";var e=[];function n(t){for(var n=-1,i=0;i<e.length;i++)if(e[i].identifier===t){n=i;break}return n}function i(t,i){for(var a={},o=[],s=0;s<t.length;s++){var l=t[s],c=i.base?l[0]+i.base:l[0],u=a[c]||0,h="".concat(c," ").concat(u);a[c]=u+1;var f=n(h),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==f)e[f].references++,e[f].updater(p);else{var d=r(p,i);i.byIndex=s,e.splice(s,0,{identifier:h,updater:d,references:1})}o.push(h)}return o}function r(t,e){var n=e.domAPI(e);n.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,r){var a=i(t=t||[],r=r||{});return function(t){t=t||[];for(var o=0;o<a.length;o++){var s=n(a[o]);e[s].references--}for(var l=i(t,r),c=0;c<a.length;c++){var u=n(a[c]);0===e[u].references&&(e[u].updater(),e.splice(u,1))}a=l}}},113:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},172:t=>{t.exports=function(t,e){this.v=t,this.k=e},t.exports.__esModule=!0,t.exports.default=t.exports},211:(t,e,n)=>{"use strict";n.d(e,{A:()=>_});var i=n(601),r=n.n(i),a=n(314),o=n.n(a),s=n(489),l=n(666),c=n(604),u=n(470),h=n(789),f=n(991),p=n(875),d=n(765),g=o()(r());g.i(s.A),g.i(l.A),g.i(c.A),g.i(u.A),g.i(h.A),g.i(f.A),g.i(p.A),g.i(d.A),g.push([t.id,"\n",""]);const _=g},262:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var i=n(601),r=n.n(i),a=n(314),o=n.n(a)()(r());o.push([t.id,"/* Proportional symbol and pie styles */\n\n/* muted country boundaries */\n.em--ps .em-cntbn,\n.em--pie .em-cntbn {\n stroke: grey;\n}\n\n/* muted nuts boundaries */\n.em--ps .em-bn-1,\n.em--pie .em-bn-1,\n.em--ps .em-bn-2,\n.em--pie .em-bn-2,\n.em--ps .em-bn-3,\n.em--pie .em-bn-3,\n.em--ps .em-nutsrg [lvl='3'],\n.em--pie .em-nutsrg [lvl='3'],\n.em--ps .em-nutsrg [lvl='2'],\n.em--pie .em-nutsrg [lvl='2'],\n.em--ps .em-nutsrg [lvl='1'],\n.em--pie .em-nutsrg [lvl='1'],\n.em--ps .em-bn-co,\n.em--pie .em-bn-co {\n stroke-width: 0.07px;\n}\n\n/* muted country fill */\n.em--ps .em-cntrg,\n.em--pie .em-cntrg {\n fill: #f2f2f2;\n}\n\n/* muted nuts fill */\n.em--ps .em-nutsrg,\n.em--pie .em-nutsrg {\n fill: #fdfdfd;\n}\n\n/* Hide non-nuts borders (country boundaries > that are 'other' and not coastal, not candidates, not eu and not efta) */\n.em--ps g#em-cntbn > .em-bn-oth:not(.em-bn-co):not(.em-bn-cc):not(.em-bn-eu):not(.em-bn-efta),\n.em--pie g#em-cntbn > .em-bn-oth:not(.em-bn-co):not(.em-bn-cc):not(.em-bn-eu):not(.em-bn-efta) {\n stroke-width: 0px;\n}\n\n/* Coastlines should not be drawn for choropleths, however for prop symbol maps with white regions they can be necessary */\n.em--ps .em-bn-co,\n.em--pie .em-bn-co {\n stroke: grey;\n stroke-width: 0.2px;\n}\n",""]);const s=o},314:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,r,a){"string"==typeof t&&(t=[[null,t,void 0]]);var o={};if(i)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(o[l]=!0)}for(var c=0;c<t.length;c++){var u=[].concat(t[c]);i&&o[u[0]]||(void 0!==a&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=a),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),e.push(u))}},e}},373:t=>{t.exports=function(t){var e=Object(t),n=[];for(var i in e)n.unshift(i);return function t(){for(;n.length;)if((i=n.pop())in e)return t.value=i,t.done=!1,t;return t.done=!0,t}},t.exports.__esModule=!0,t.exports.default=t.exports},387:(t,e)=>{var n,i,r;(r={}).Constants={},r.Math={},r.Accumulator={},function(t){"use strict";t.WGS84={a:6378137,f:1/298.257223563},t.version={major:2,minor:1,patch:1},t.version_string="2.1.1"}(r.Constants),function(t){"use strict";t.digits=53,t.epsilon=Math.pow(.5,t.digits-1),t.degree=Math.PI/180,t.sq=function(t){return t*t},t.hypot=function(t,e){return Math.sqrt(t*t+e*e)},t.cbrt=Math.cbrt||function(t){var e=Math.pow(Math.abs(t),1/3);return t>0?e:t<0?-e:t},t.log1p=Math.log1p||function(t){var e=1+t,n=e-1;return 0===n?t:t*Math.log(e)/n},t.atanh=Math.atanh||function(e){var n=Math.abs(e);return n=t.log1p(2*n/(1-n))/2,e>0?n:e<0?-n:e},t.copysign=function(t,e){return Math.abs(t)*(e<0||0===e&&1/e<0?-1:1)},t.sum=function(t,e){var n=t+e,i=n-e,r=n-i;return i-=t,{s:n,t:n?0-(i+(r-=e)):n}},t.polyval=function(t,e,n,i){for(var r=t<0?0:e[n++];--t>=0;)r=r*i+e[n++];return r},t.AngRound=function(e){var n=1/16,i=Math.abs(e);return i=i<n?n-(n-i):i,t.copysign(i,e)},t.remainder=function(t,e){return(t%=e)<-e/2?t+e:t<e/2?t:t-e},t.AngNormalize=function(e){var n=t.remainder(e,360);return 180===Math.abs(n)?t.copysign(180,e):n},t.LatFix=function(t){return Math.abs(t)>90?NaN:t},t.AngDiff=function(e,n){var i,r,a=t.sum(t.remainder(-e,360),t.remainder(n,360));return i=(a=t.sum(t.remainder(a.s,360),a.t)).s,r=a.t,0!==i&&180!==Math.abs(i)||(i=t.copysign(i,0===r?n-e:-r)),{d:i,e:r}},t.sincosd=function(e){var n,i,r,a,o,s,l;switch(n=e%360,i=(n-=90*(r=Math.round(n/90)))*this.degree,a=Math.sin(i),o=Math.cos(i),45===Math.abs(n)?(o=Math.sqrt(.5),a=t.copysign(o,i)):30===Math.abs(n)&&(o=Math.sqrt(.75),a=t.copysign(.5,i)),3&r){case 0:s=a,l=o;break;case 1:s=o,l=-a;break;case 2:s=-a,l=-o;break;default:s=-o,l=a}return l+=0,0===s&&(s=t.copysign(s,e)),{s,c:l}},t.sincosde=function(e,n){var i,r,a,o,s,l,c;switch(i=e%360,a=Math.round(i/90),r=(i=t.AngRound(i-90*a+n))*this.degree,o=Math.sin(r),s=Math.cos(r),45===Math.abs(i)?(s=Math.sqrt(.5),o=t.copysign(s,r)):30===Math.abs(i)&&(s=Math.sqrt(.75),o=t.copysign(.5,r)),3&a){case 0:l=o,c=s;break;case 1:l=s,c=-o;break;case 2:l=-o,c=-s;break;default:l=-s,c=o}return c+=0,0===l&&(l=t.copysign(l,e+n)),{s:l,c}},t.atan2d=function(e,n){var i,r=0;switch(Math.abs(e)>Math.abs(n)&&([e,n]=[n,e],r=2),t.copysign(1,n)<0&&(n=-n,++r),i=Math.atan2(e,n)/this.degree,r){case 1:i=t.copysign(180,e)-i;break;case 2:i=90-i;break;case 3:i=-90+i}return i}}(r.Math),function(t,e){"use strict";t.Accumulator=function(t){this.Set(t)},t.Accumulator.prototype.Set=function(e){e||(e=0),e.constructor===t.Accumulator?(this._s=e._s,this._t=e._t):(this._s=e,this._t=0)},t.Accumulator.prototype.Add=function(t){var n=e.sum(t,this._t),i=e.sum(n.s,this._s);n=n.t,this._s=i.s,this._t=i.t,0===this._s?this._s=n:this._t+=n},t.Accumulator.prototype.Sum=function(e){var n;return e?((n=new t.Accumulator(this)).Add(e),n._s):this._s},t.Accumulator.prototype.Negate=function(){this._s*=-1,this._t*=-1},t.Accumulator.prototype.Remainder=function(t){this._s=e.remainder(this._s,t),this.Add(0)}}(r.Accumulator,r.Math),r.Geodesic={},r.GeodesicLine={},r.PolygonArea={},function(t,e,n,i,r){"use strict";var a,o,s,l,c,u,h,f,p,d,g,_=20+i.digits+10,m=i.epsilon,v=200*m,y=Math.sqrt(m),x=m,b=1e3*y;t.tiny_=Math.sqrt(Number.MIN_VALUE/Number.EPSILON),t.nC1_=6,t.nC1p_=6,t.nC2_=6,t.nC3_=6,t.nC4_=6,a=t.nC3_*(t.nC3_-1)/2,o=t.nC4_*(t.nC4_+1)/2,t.CAP_C1=1,t.CAP_C1p=2,t.CAP_C2=4,t.CAP_C3=8,t.CAP_C4=16,t.NONE=0,t.ARC=64,t.LATITUDE=128,t.LONGITUDE=256|t.CAP_C3,t.AZIMUTH=512,t.DISTANCE=1024|t.CAP_C1,t.STANDARD=t.LATITUDE|t.LONGITUDE|t.AZIMUTH|t.DISTANCE,t.DISTANCE_IN=2048|t.CAP_C1|t.CAP_C1p,t.REDUCEDLENGTH=4096|t.CAP_C1|t.CAP_C2,t.GEODESICSCALE=8192|t.CAP_C1|t.CAP_C2,t.AREA=16384|t.CAP_C4,t.ALL=32671,t.LONG_UNROLL=32768,t.OUT_MASK=32640|t.LONG_UNROLL,t.SinCosSeries=function(t,e,n,i){var r=i.length,a=r-(t?1:0),o=2*(n-e)*(n+e),s=1&a?i[--r]:0,l=0;for(a=Math.floor(a/2);a--;)s=o*(l=o*s-l+i[--r])-s+i[--r];return t?2*e*n*s:n*(s-l)},s=function(t,e){var n,r,a,o,s,l,c,u,h,f,p,d,g=i.sq(t),_=i.sq(e),m=(g+_-1)/6;return 0===_&&m<=0?n=0:(l=m,(s=(r=g*_/4)*(r+2*(o=m*(a=i.sq(m)))))>=0?(c=r+o,c+=c<0?-Math.sqrt(s):Math.sqrt(s),l+=(u=i.cbrt(c))+(0!==u?a/u:0)):(h=Math.atan2(Math.sqrt(-s),-(r+o)),l+=2*m*Math.cos(h/3)),f=Math.sqrt(i.sq(l)+_),d=((p=l<0?_/(f-l):l+f)-_)/(2*f),n=p/(Math.sqrt(p+i.sq(d))+d)),n},l=[1,4,64,0,256],t.A1m1f=function(t){var e=Math.floor(3);return(i.polyval(e,l,0,i.sq(t))/l[e+1]+t)/(1-t)},c=[-1,6,-16,32,-9,64,-128,2048,9,-16,768,3,-5,512,-7,1280,-7,2048],t.C1f=function(e,n){var r,a,o=i.sq(e),s=e,l=0;for(r=1;r<=t.nC1_;++r)a=Math.floor((t.nC1_-r)/2),n[r]=s*i.polyval(a,c,l,o)/c[l+a+1],l+=a+2,s*=e},u=[205,-432,768,1536,4005,-4736,3840,12288,-225,116,384,-7173,2695,7680,3467,7680,38081,61440],t.C1pf=function(e,n){var r,a,o=i.sq(e),s=e,l=0;for(r=1;r<=t.nC1p_;++r)a=Math.floor((t.nC1p_-r)/2),n[r]=s*i.polyval(a,u,l,o)/u[l+a+1],l+=a+2,s*=e},h=[-11,-28,-192,0,256],t.A2m1f=function(t){var e=Math.floor(3);return(i.polyval(e,h,0,i.sq(t))/h[e+1]-t)/(1+t)},f=[1,2,16,32,35,64,384,2048,15,80,768,7,35,512,63,1280,77,2048],t.C2f=function(e,n){var r,a,o=i.sq(e),s=e,l=0;for(r=1;r<=t.nC2_;++r)a=Math.floor((t.nC2_-r)/2),n[r]=s*i.polyval(a,f,l,o)/f[l+a+1],l+=a+2,s*=e},t.Geodesic=function(t,e){if(this.a=t,this.f=e,this._f1=1-this.f,this._e2=this.f*(2-this.f),this._ep2=this._e2/i.sq(this._f1),this._n=this.f/(2-this.f),this._b=this.a*this._f1,this._c2=(i.sq(this.a)+i.sq(this._b)*(0===this._e2?1:(this._e2>0?i.atanh(Math.sqrt(this._e2)):Math.atan(Math.sqrt(-this._e2)))/Math.sqrt(Math.abs(this._e2))))/2,this._etol2=.1*y/Math.sqrt(Math.max(.001,Math.abs(this.f))*Math.min(1,1-this.f/2)/2),!(isFinite(this.a)&&this.a>0))throw new Error("Equatorial radius is not positive");if(!(isFinite(this._b)&&this._b>0))throw new Error("Polar semi-axis is not positive");this._A3x=new Array(6),this._C3x=new Array(a),this._C4x=new Array(o),this.A3coeff(),this.C3coeff(),this.C4coeff()},p=[-3,128,-2,-3,64,-1,-3,-1,16,3,-1,-2,8,1,-1,2,1,1],t.Geodesic.prototype.A3coeff=function(){var t,e,n=0,r=0;for(t=5;t>=0;--t)e=Math.min(6-t-1,t),this._A3x[r++]=i.polyval(e,p,n,this._n)/p[n+e+1],n+=e+2},d=[3,128,2,5,128,-1,3,3,64,-1,0,1,8,-1,1,4,5,256,1,3,128,-3,-2,3,64,1,-3,2,32,7,512,-10,9,384,5,-9,5,192,7,512,-14,7,512,21,2560],t.Geodesic.prototype.C3coeff=function(){var e,n,r,a=0,o=0;for(e=1;e<t.nC3_;++e)for(n=t.nC3_-1;n>=e;--n)r=Math.min(t.nC3_-n-1,n),this._C3x[o++]=i.polyval(r,d,a,this._n)/d[a+r+1],a+=r+2},g=[97,15015,1088,156,45045,-224,-4784,1573,45045,-10656,14144,-4576,-858,45045,64,624,-4576,6864,-3003,15015,100,208,572,3432,-12012,30030,45045,1,9009,-2944,468,135135,5792,1040,-1287,135135,5952,-11648,9152,-2574,135135,-64,-624,4576,-6864,3003,135135,8,10725,1856,-936,225225,-8448,4992,-1144,225225,-1440,4160,-4576,1716,225225,-136,63063,1024,-208,105105,3584,-3328,1144,315315,-128,135135,-2560,832,405405,128,99099],t.Geodesic.prototype.C4coeff=function(){var e,n,r,a=0,o=0;for(e=0;e<t.nC4_;++e)for(n=t.nC4_-1;n>=e;--n)r=t.nC4_-n-1,this._C4x[o++]=i.polyval(r,g,a,this._n)/g[a+r+1],a+=r+2},t.Geodesic.prototype.A3f=function(t){return i.polyval(5,this._A3x,0,t)},t.Geodesic.prototype.C3f=function(e,n){var r,a,o=1,s=0;for(r=1;r<t.nC3_;++r)a=t.nC3_-r-1,o*=e,n[r]=o*i.polyval(a,this._C3x,s,e),s+=a+1},t.Geodesic.prototype.C4f=function(e,n){var r,a,o=1,s=0;for(r=0;r<t.nC4_;++r)a=t.nC4_-r-1,n[r]=o*i.polyval(a,this._C4x,s,e),s+=a+1,o*=e},t.Geodesic.prototype.Lengths=function(e,n,i,r,a,o,s,l,c,u,h,f,p){var d,g,_,m,v={},y=0,x=0,b=0,w=0;if((h&=t.OUT_MASK)&(t.DISTANCE|t.REDUCEDLENGTH|t.GEODESICSCALE)&&(b=t.A1m1f(e),t.C1f(e,f),h&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(w=t.A2m1f(e),t.C2f(e,p),y=b-w,w=1+w),b=1+b),h&t.DISTANCE)d=t.SinCosSeries(!0,o,s,f)-t.SinCosSeries(!0,i,r,f),v.s12b=b*(n+d),h&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(x=y*n+(b*d-w*(t.SinCosSeries(!0,o,s,p)-t.SinCosSeries(!0,i,r,p))));else if(h&(t.REDUCEDLENGTH|t.GEODESICSCALE)){for(g=1;g<=t.nC2_;++g)p[g]=b*f[g]-w*p[g];x=y*n+(t.SinCosSeries(!0,o,s,p)-t.SinCosSeries(!0,i,r,p))}return h&t.REDUCEDLENGTH&&(v.m0=y,v.m12b=l*(r*o)-a*(i*s)-r*s*x),h&t.GEODESICSCALE&&(_=r*s+i*o,m=this._ep2*(c-u)*(c+u)/(a+l),v.M12=_+(m*o-s*x)*i/a,v.M21=_-(m*i-r*x)*o/l),v},t.Geodesic.prototype.InverseStart=function(e,n,r,a,o,l,c,u,h,f,p){var d,g,_,m,y,x,w,S,M,E,C,A,k,T,P,N,L,F,O,G,D={},z=a*n-o*e,I=o*n+a*e;return D.sig12=-1,d=a*n,d+=o*e,(g=I>=0&&z<.5&&o*c<.5)?(m=i.sq(e+a),m/=m+i.sq(n+o),D.dnm=Math.sqrt(1+this._ep2*m),_=c/(this._f1*D.dnm),y=Math.sin(_),x=Math.cos(_)):(y=u,x=h),D.salp1=o*y,D.calp1=x>=0?z+o*e*i.sq(y)/(1+x):d-o*e*i.sq(y)/(1-x),S=i.hypot(D.salp1,D.calp1),M=e*a+n*o*x,g&&S<this._etol2?(D.salp2=n*y,D.calp2=z-n*a*(x>=0?i.sq(y)/(1+x):1-x),w=i.hypot(D.salp2,D.calp2),D.salp2/=w,D.calp2/=w,D.sig12=Math.atan2(S,M)):Math.abs(this._n)>.1||M>=0||S>=6*Math.abs(this._n)*Math.PI*i.sq(n)||(G=Math.atan2(-u,-h),this.f>=0?(T=(k=i.sq(e)*this._ep2)/(2*(1+Math.sqrt(1+k))+k),E=G/(A=this.f*n*this.A3f(T)*Math.PI),C=d/(A*n)):(P=o*n-a*e,N=Math.atan2(d,P),C=c/(A=((E=(L=this.Lengths(this._n,Math.PI+N,e,-n,r,a,o,l,n,o,t.REDUCEDLENGTH,f,p)).m12b/(n*o*L.m0*Math.PI)-1)<-.01?d/E:-this.f*i.sq(n)*Math.PI)/n)),C>-v&&E>-1-b?this.f>=0?(D.salp1=Math.min(1,-E),D.calp1=-Math.sqrt(1-i.sq(D.salp1))):(D.calp1=Math.max(E>-v?0:-1,E),D.salp1=Math.sqrt(1-i.sq(D.calp1))):(F=s(E,C),O=A*(this.f>=0?-E*F/(1+F):-C*(1+F)/F),y=Math.sin(O),x=-Math.cos(O),D.salp1=o*y,D.calp1=d-o*e*i.sq(y)/(1-x))),D.salp1<=0?(D.salp1=1,D.calp1=0):(w=i.hypot(D.salp1,D.calp1),D.salp1/=w,D.calp1/=w),D},t.Geodesic.prototype.Lambda12=function(e,n,r,a,o,s,l,c,u,h,f,p,d,g){var _,m,v,y,x,b,w,S,M,E,C,A,k,T={};return 0===e&&0===c&&(c=-t.tiny_),m=l*n,v=i.hypot(c,l*e),T.ssig1=e,y=m*e,T.csig1=x=c*n,_=i.hypot(T.ssig1,T.csig1),T.ssig1/=_,T.csig1/=_,T.salp2=o!==n?m/o:l,T.calp2=o!==n||Math.abs(a)!==-e?Math.sqrt(i.sq(c*n)+(n<-e?(o-n)*(n+o):(e-a)*(e+a)))/o:Math.abs(c),T.ssig2=a,b=m*a,T.csig2=w=T.calp2*o,_=i.hypot(T.ssig2,T.csig2),T.ssig2/=_,T.csig2/=_,T.sig12=Math.atan2(Math.max(0,T.csig1*T.ssig2-T.ssig1*T.csig2),T.csig1*T.csig2+T.ssig1*T.ssig2),S=Math.max(0,x*b-y*w),M=x*w+y*b,C=Math.atan2(S*h-M*u,M*h+S*u),A=i.sq(v)*this._ep2,T.eps=A/(2*(1+Math.sqrt(1+A))+A),this.C3f(T.eps,g),E=t.SinCosSeries(!0,T.ssig2,T.csig2,g)-t.SinCosSeries(!0,T.ssig1,T.csig1,g),T.domg12=-this.f*this.A3f(T.eps)*m*(T.sig12+E),T.lam12=C+T.domg12,f&&(0===T.calp2?T.dlam12=-2*this._f1*r/e:(k=this.Lengths(T.eps,T.sig12,T.ssig1,T.csig1,r,T.ssig2,T.csig2,s,n,o,t.REDUCEDLENGTH,p,d),T.dlam12=k.m12b,T.dlam12*=this._f1/(T.calp2*o))),T},t.Geodesic.prototype.Inverse=function(e,n,r,a,o){var s,l;return o||(o=t.STANDARD),o===t.LONG_UNROLL&&(o|=t.STANDARD),o&=t.OUT_MASK,l=(s=this.InverseInt(e,n,r,a,o)).vals,o&t.AZIMUTH&&(l.azi1=i.atan2d(s.salp1,s.calp1),l.azi2=i.atan2d(s.salp2,s.calp2)),l},t.Geodesic.prototype.InverseInt=function(e,n,r,a,o){var s,l,c,u,h,f,p,d,g,v,y,b,w,S,M,E,C,A,k,T,P,N,L,F,O,G,D,z,I,R,j,B,q,U,W,H,V,$,J,Y,X,K,Z,Q,tt,et,nt,it,rt,at,ot,st,lt,ct,ut,ht,ft,pt,dt,gt,_t,mt,vt,yt,xt,bt={};if(bt.lat1=e=i.LatFix(e),bt.lat2=r=i.LatFix(r),e=i.AngRound(e),r=i.AngRound(r),l=(s=i.AngDiff(n,a)).e,s=s.d,o&t.LONG_UNROLL?(bt.lon1=n,bt.lon2=n+s+l):(bt.lon1=i.AngNormalize(n),bt.lon2=i.AngNormalize(a)),l*=c=i.copysign(1,s),M=(s*=c)*i.degree,E=(u=i.sincosde(s,l)).s,C=u.c,l=180-s-l,(h=Math.abs(e)<Math.abs(r)||isNaN(r)?-1:1)<0&&(c*=-1,[r,e]=[e,r]),e*=f=i.copysign(1,-e),r*=f,u=i.sincosd(e),p=this._f1*u.s,d=u.c,p/=u=i.hypot(p,d),d/=u,d=Math.max(t.tiny_,d),u=i.sincosd(r),g=this._f1*u.s,v=u.c,g/=u=i.hypot(g,v),v/=u,v=Math.max(t.tiny_,v),d<-p?v===d&&(g=i.copysign(p,g)):Math.abs(g)===-p&&(v=d),w=Math.sqrt(1+this._ep2*i.sq(p)),S=Math.sqrt(1+this._ep2*i.sq(g)),L=new Array(t.nC1_+1),F=new Array(t.nC2_+1),O=new Array(t.nC3_),(G=-90===e||0===E)&&(T=E,N=0,z=p,I=(k=C)*d,R=g,j=(P=1)*v,A=Math.atan2(Math.max(0,I*R-z*j),I*j+z*R),y=(D=this.Lengths(this._n,A,z,I,w,R,j,S,d,v,o|t.DISTANCE|t.REDUCEDLENGTH,L,F)).s12b,b=D.m12b,o&t.GEODESICSCALE&&(bt.M12=D.M12,bt.M21=D.M21),A<1||b>=0?((A<3*t.tiny_||A<m&&(y<0||b<0))&&(A=b=y=0),b*=this._b,y*=this._b,bt.a12=A/i.degree):G=!1),ft=2,!G&&0===p&&(this.f<=0||l>=180*this.f))k=P=0,T=N=1,y=this.a*M,A=q=M/this._f1,b=this._b*Math.sin(A),o&t.GEODESICSCALE&&(bt.M12=bt.M21=Math.cos(A)),bt.a12=s/this._f1;else if(!G)if(A=(D=this.InverseStart(p,d,w,g,v,S,M,E,C,L,F)).sig12,T=D.salp1,k=D.calp1,A>=0)N=D.salp2,P=D.calp2,U=D.dnm,y=A*this._b*U,b=i.sq(U)*this._b*Math.sin(A/U),o&t.GEODESICSCALE&&(bt.M12=bt.M21=Math.cos(A/U)),bt.a12=A/i.degree,q=M/(this._f1*U);else{for(W=0,H=t.tiny_,V=1,$=t.tiny_,J=-1,Y=!1,X=!1;K=(D=this.Lambda12(p,d,w,g,v,S,T,k,E,C,W<20,L,F,O)).lam12,N=D.salp2,P=D.calp2,A=D.sig12,z=D.ssig1,I=D.csig1,R=D.ssig2,j=D.csig2,B=D.eps,dt=D.domg12,Z=D.dlam12,!X&&Math.abs(K)>=(Y?8:1)*m&&W!=_;++W)K>0&&(W<20||k/T>J/$)?($=T,J=k):K<0&&(W<20||k/T<V/H)&&(H=T,V=k),W<20&&Z>0&&(Q=-K/Z,Math.abs(Q)<Math.PI&&(tt=Math.sin(Q),(nt=T*(et=Math.cos(Q))+k*tt)>0))?(k=k*et-T*tt,T=nt,T/=u=i.hypot(T,k),k/=u,Y=Math.abs(K)<=16*m):(T=(H+$)/2,k=(V+J)/2,T/=u=i.hypot(T,k),k/=u,Y=!1,X=Math.abs(H-T)+(V-k)<x||Math.abs(T-$)+(k-J)<x);it=o|(o&(t.REDUCEDLENGTH|t.GEODESICSCALE)?t.DISTANCE:t.NONE),y=(D=this.Lengths(B,A,z,I,w,R,j,S,d,v,it,L,F)).s12b,b=D.m12b,o&t.GEODESICSCALE&&(bt.M12=D.M12,bt.M21=D.M21),b*=this._b,y*=this._b,bt.a12=A/i.degree,o&t.AREA&&(yt=Math.sin(dt),ft=E*(xt=Math.cos(dt))-C*yt,pt=C*xt+E*yt)}return o&t.DISTANCE&&(bt.s12=0+y),o&t.REDUCEDLENGTH&&(bt.m12=0+b),o&t.AREA&&(rt=T*d,0!==(at=i.hypot(k,T*p))&&0!==rt?(z=p,I=k*d,R=g,j=P*v,B=(st=i.sq(at)*this._ep2)/(2*(1+Math.sqrt(1+st))+st),lt=i.sq(this.a)*at*rt*this._e2,z/=u=i.hypot(z,I),I/=u,R/=u=i.hypot(R,j),j/=u,ct=new Array(t.nC4_),this.C4f(B,ct),ut=t.SinCosSeries(!1,z,I,ct),ht=t.SinCosSeries(!1,R,j,ct),bt.S12=lt*(ht-ut)):bt.S12=0,G||2!=ft||(ft=Math.sin(q),pt=Math.cos(q)),!G&&pt>-.7071&&g-p<1.75?(dt=1+pt,gt=1+d,_t=1+v,ot=2*Math.atan2(ft*(p*_t+g*gt),dt*(p*g+gt*_t))):(vt=P*k+N*T,0==(mt=N*k-P*T)&&vt<0&&(mt=t.tiny_*k,vt=-1),ot=Math.atan2(mt,vt)),bt.S12+=this._c2*ot,bt.S12*=h*c*f,bt.S12+=0),h<0&&([N,T]=[T,N],[P,k]=[k,P],o&t.GEODESICSCALE&&([bt.M21,bt.M12]=[bt.M12,bt.M21])),{vals:bt,salp1:T*=h*c,calp1:k*=h*f,salp2:N*=h*c,calp2:P*=h*f}},t.Geodesic.prototype.GenDirect=function(n,i,r,a,o,s){return s?s===t.LONG_UNROLL&&(s|=t.STANDARD):s=t.STANDARD,a||(s|=t.DISTANCE_IN),new e.GeodesicLine(this,n,i,r,s).GenPosition(a,o,s)},t.Geodesic.prototype.Direct=function(t,e,n,i,r){return this.GenDirect(t,e,n,!1,i,r)},t.Geodesic.prototype.ArcDirect=function(t,e,n,i,r){return this.GenDirect(t,e,n,!0,i,r)},t.Geodesic.prototype.Line=function(t,n,i,r){return new e.GeodesicLine(this,t,n,i,r)},t.Geodesic.prototype.DirectLine=function(t,e,n,i,r){return this.GenDirectLine(t,e,n,!1,i,r)},t.Geodesic.prototype.ArcDirectLine=function(t,e,n,i,r){return this.GenDirectLine(t,e,n,!0,i,r)},t.Geodesic.prototype.GenDirectLine=function(n,i,r,a,o,s){var l;return s||(s=t.STANDARD|t.DISTANCE_IN),a||(s|=t.DISTANCE_IN),(l=new e.GeodesicLine(this,n,i,r,s)).GenSetDistance(a,o),l},t.Geodesic.prototype.InverseLine=function(n,r,a,o,s){var l,c,u;return s||(s=t.STANDARD|t.DISTANCE_IN),l=this.InverseInt(n,r,a,o,t.ARC),u=i.atan2d(l.salp1,l.calp1),s&t.OUT_MASK&t.DISTANCE_IN&&(s|=t.DISTANCE),(c=new e.GeodesicLine(this,n,r,u,s,l.salp1,l.calp1)).SetArc(l.vals.a12),c},t.Geodesic.prototype.Polygon=function(t){return new n.PolygonArea(this,t)},t.WGS84=new t.Geodesic(r.WGS84.a,r.WGS84.f)}(r.Geodesic,r.GeodesicLine,r.PolygonArea,r.Math,r.Constants),function(t,e,n){"use strict";e.GeodesicLine=function(e,i,r,a,o,s,l){var c,u,h,f,p,d;o||(o=t.STANDARD|t.DISTANCE_IN),this.a=e.a,this.f=e.f,this._b=e._b,this._c2=e._c2,this._f1=e._f1,this.caps=o|t.LATITUDE|t.AZIMUTH|t.LONG_UNROLL,this.lat1=n.LatFix(i),this.lon1=r,void 0===s||void 0===l?(this.azi1=n.AngNormalize(a),c=n.sincosd(n.AngRound(this.azi1)),this.salp1=c.s,this.calp1=c.c):(this.azi1=a,this.salp1=s,this.calp1=l),c=n.sincosd(n.AngRound(this.lat1)),h=this._f1*c.s,u=c.c,h/=c=n.hypot(h,u),u/=c,u=Math.max(t.tiny_,u),this._dn1=Math.sqrt(1+e._ep2*n.sq(h)),this._salp0=this.salp1*u,this._calp0=n.hypot(this.calp1,this.salp1*h),this._ssig1=h,this._somg1=this._salp0*h,this._csig1=this._comg1=0!==h||0!==this.calp1?u*this.calp1:1,c=n.hypot(this._ssig1,this._csig1),this._ssig1/=c,this._csig1/=c,this._k2=n.sq(this._calp0)*e._ep2,f=this._k2/(2*(1+Math.sqrt(1+this._k2))+this._k2),this.caps&t.CAP_C1&&(this._A1m1=t.A1m1f(f),this._C1a=new Array(t.nC1_+1),t.C1f(f,this._C1a),this._B11=t.SinCosSeries(!0,this._ssig1,this._csig1,this._C1a),p=Math.sin(this._B11),d=Math.cos(this._B11),this._stau1=this._ssig1*d+this._csig1*p,this._ctau1=this._csig1*d-this._ssig1*p),this.caps&t.CAP_C1p&&(this._C1pa=new Array(t.nC1p_+1),t.C1pf(f,this._C1pa)),this.caps&t.CAP_C2&&(this._A2m1=t.A2m1f(f),this._C2a=new Array(t.nC2_+1),t.C2f(f,this._C2a),this._B21=t.SinCosSeries(!0,this._ssig1,this._csig1,this._C2a)),this.caps&t.CAP_C3&&(this._C3a=new Array(t.nC3_),e.C3f(f,this._C3a),this._A3c=-this.f*this._salp0*e.A3f(f),this._B31=t.SinCosSeries(!0,this._ssig1,this._csig1,this._C3a)),this.caps&t.CAP_C4&&(this._C4a=new Array(t.nC4_),e.C4f(f,this._C4a),this._A4=n.sq(this.a)*this._calp0*this._salp0*e._e2,this._B41=t.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a)),this.a13=this.s13=NaN},e.GeodesicLine.prototype.GenPosition=function(e,i,r){var a,o,s,l,c,u,h,f,p,d,g,_,m,v,y,x,b,w,S,M,E,C,A,k,T,P,N={};return r?r===t.LONG_UNROLL&&(r|=t.STANDARD):r=t.STANDARD,r&=this.caps&t.OUT_MASK,N.lat1=this.lat1,N.azi1=this.azi1,N.lon1=r&t.LONG_UNROLL?this.lon1:n.AngNormalize(this.lon1),e?N.a12=i:N.s12=i,e||this.caps&t.DISTANCE_IN&t.OUT_MASK?(l=0,c=0,e?(a=i*n.degree,o=(A=n.sincosd(i)).s,s=A.c):(f=i/(this._b*(1+this._A1m1)),p=Math.sin(f),d=Math.cos(f),a=f-((l=-t.SinCosSeries(!0,this._stau1*d+this._ctau1*p,this._ctau1*d-this._stau1*p,this._C1pa))-this._B11),o=Math.sin(a),s=Math.cos(a),Math.abs(this.f)>.01&&(u=this._ssig1*s+this._csig1*o,h=this._csig1*s-this._ssig1*o,l=t.SinCosSeries(!0,u,h,this._C1a),a-=((1+this._A1m1)*(a+(l-this._B11))-i/this._b)/Math.sqrt(1+this._k2*n.sq(u)),o=Math.sin(a),s=Math.cos(a))),u=this._ssig1*s+this._csig1*o,h=this._csig1*s-this._ssig1*o,S=Math.sqrt(1+this._k2*n.sq(u)),r&(t.DISTANCE|t.REDUCEDLENGTH|t.GEODESICSCALE)&&((e||Math.abs(this.f)>.01)&&(l=t.SinCosSeries(!0,u,h,this._C1a)),c=(1+this._A1m1)*(l-this._B11)),m=this._calp0*u,0===(v=n.hypot(this._salp0,this._calp0*h))&&(v=h=t.tiny_),b=this._salp0,w=this._calp0*h,e&&r&t.DISTANCE&&(N.s12=this._b*((1+this._A1m1)*a+c)),r&t.LONGITUDE&&(y=this._salp0*u,x=h,_=n.copysign(1,this._salp0),g=((r&t.LONG_UNROLL?_*(a-(Math.atan2(u,h)-Math.atan2(this._ssig1,this._csig1))+(Math.atan2(_*y,x)-Math.atan2(_*this._somg1,this._comg1))):Math.atan2(y*this._comg1-x*this._somg1,x*this._comg1+y*this._somg1))+this._A3c*(a+(t.SinCosSeries(!0,u,h,this._C3a)-this._B31)))/n.degree,N.lon2=r&t.LONG_UNROLL?this.lon1+g:n.AngNormalize(n.AngNormalize(this.lon1)+n.AngNormalize(g))),r&t.LATITUDE&&(N.lat2=n.atan2d(m,this._f1*v)),r&t.AZIMUTH&&(N.azi2=n.atan2d(b,w)),r&(t.REDUCEDLENGTH|t.GEODESICSCALE)&&(M=t.SinCosSeries(!0,u,h,this._C2a),E=(1+this._A2m1)*(M-this._B21),C=(this._A1m1-this._A2m1)*a+(c-E),r&t.REDUCEDLENGTH&&(N.m12=this._b*(S*(this._csig1*u)-this._dn1*(this._ssig1*h)-this._csig1*h*C)),r&t.GEODESICSCALE&&(A=this._k2*(u-this._ssig1)*(u+this._ssig1)/(this._dn1+S),N.M12=s+(A*u-h*C)*this._ssig1/this._dn1,N.M21=s-(A*this._ssig1-this._csig1*C)*u/S)),r&t.AREA&&(k=t.SinCosSeries(!1,u,h,this._C4a),0===this._calp0||0===this._salp0?(T=b*this.calp1-w*this.salp1,P=w*this.calp1+b*this.salp1):(T=this._calp0*this._salp0*(s<=0?this._csig1*(1-s)+o*this._ssig1:o*(this._csig1*o/(1+s)+this._ssig1)),P=n.sq(this._salp0)+n.sq(this._calp0)*this._csig1*h),N.S12=this._c2*Math.atan2(T,P)+this._A4*(k-this._B41)),e||(N.a12=a/n.degree),N):(N.a12=NaN,N)},e.GeodesicLine.prototype.Position=function(t,e){return this.GenPosition(!1,t,e)},e.GeodesicLine.prototype.ArcPosition=function(t,e){return this.GenPosition(!0,t,e)},e.GeodesicLine.prototype.GenSetDistance=function(t,e){t?this.SetArc(e):this.SetDistance(e)},e.GeodesicLine.prototype.SetDistance=function(e){var n;this.s13=e,n=this.GenPosition(!1,this.s13,t.ARC),this.a13=0+n.a12},e.GeodesicLine.prototype.SetArc=function(e){var n;this.a13=e,n=this.GenPosition(!0,this.a13,t.DISTANCE),this.s13=0+n.s12}}(r.Geodesic,r.GeodesicLine,r.Math),function(t,e,n,i){"use strict";var r,a,o,s;r=function(t,e){var i=n.AngDiff(t,e).d;return t=n.AngNormalize(t),e=n.AngNormalize(e),i>0&&(t<0&&e>=0||t>0&&0===e)?1:i<0&&t>=0&&e<0?-1:0},a=function(t,e){return(0<=(e%=720)&&e<360||e<-360?0:1)-(0<=(t%=720)&&t<360||t<-360?0:1)},o=function(t,e,n,i,r){return t.Remainder(e),1&n&&t.Add((t.Sum()<0?1:-1)*e/2),i||t.Negate(),r?t.Sum()>e/2?t.Add(-e):t.Sum()<=-e/2&&t.Add(+e):t.Sum()>=e?t.Add(-e):t.Sum()<0&&t.Add(+e),0+t.Sum()},s=function(t,e,i,r,a){return t=n.remainder(t,e),1&i&&(t+=(t<0?1:-1)*e/2),r||(t*=-1),a?t>e/2?t-=e:t<=-e/2&&(t+=e):t>=e?t-=e:t<0&&(t+=e),0+t},t.PolygonArea=function(t,n){this._geod=t,this.a=this._geod.a,this.f=this._geod.f,this._area0=4*Math.PI*t._c2,this.polyline=n||!1,this._mask=e.LATITUDE|e.LONGITUDE|e.DISTANCE|(this.polyline?e.NONE:e.AREA|e.LONG_UNROLL),this.polyline||(this._areasum=new i.Accumulator(0)),this._perimetersum=new i.Accumulator(0),this.Clear()},t.PolygonArea.prototype.Clear=function(){this.num=0,this._crossings=0,this.polyline||this._areasum.Set(0),this._perimetersum.Set(0),this._lat0=this._lon0=this.lat=this.lon=NaN},t.PolygonArea.prototype.AddPoint=function(t,e){var n;0===this.num?(this._lat0=this.lat=t,this._lon0=this.lon=e):(n=this._geod.Inverse(this.lat,this.lon,t,e,this._mask),this._perimetersum.Add(n.s12),this.polyline||(this._areasum.Add(n.S12),this._crossings+=r(this.lon,e)),this.lat=t,this.lon=e),++this.num},t.PolygonArea.prototype.AddEdge=function(t,e){var n;this.num&&(n=this._geod.Direct(this.lat,this.lon,t,e,this._mask),this._perimetersum.Add(e),this.polyline||(this._areasum.Add(n.S12),this._crossings+=a(this.lon,n.lon2)),this.lat=n.lat2,this.lon=n.lon2),++this.num},t.PolygonArea.prototype.Compute=function(t,e){var n,a,s={number:this.num};return this.num<2?(s.perimeter=0,this.polyline||(s.area=0),s):this.polyline?(s.perimeter=this._perimetersum.Sum(),s):(n=this._geod.Inverse(this.lat,this.lon,this._lat0,this._lon0,this._mask),s.perimeter=this._perimetersum.Sum(n.s12),(a=new i.Accumulator(this._areasum)).Add(n.S12),s.area=o(a,this._area0,this._crossings+r(this.lon,this._lon0),t,e),s)},t.PolygonArea.prototype.TestPoint=function(t,e,n,i){var a,o,l,c,u={number:this.num+1};if(0===this.num)return u.perimeter=0,this.polyline||(u.area=0),u;for(u.perimeter=this._perimetersum.Sum(),o=this.polyline?0:this._areasum.Sum(),l=this._crossings,c=0;c<(this.polyline?1:2);++c)a=this._geod.Inverse(0===c?this.lat:t,0===c?this.lon:e,0!==c?this._lat0:t,0!==c?this._lon0:e,this._mask),u.perimeter+=a.s12,this.polyline||(o+=a.S12,l+=r(0===c?this.lon:e,0!==c?this._lon0:e));return this.polyline||(u.area=s(o,this._area0,l,n,i)),u},t.PolygonArea.prototype.TestEdge=function(t,e,n,i){var o,l,c,u={number:this.num?this.num+1:0};return 0===this.num||(u.perimeter=this._perimetersum.Sum()+e,this.polyline||(l=this._areasum.Sum(),c=this._crossings,l+=(o=this._geod.Direct(this.lat,this.lon,t,e,this._mask)).S12,c+=a(this.lon,o.lon2),c+=r(o.lon2,this._lon0),o=this._geod.Inverse(o.lat2,o.lon2,this._lat0,this._lon0,this._mask),u.perimeter+=o.s12,l+=o.S12,u.area=s(l,this._area0,c,n,i))),u}}(r.PolygonArea,r.Geodesic,r.Math,r.Accumulator),i=r,t.exports?t.exports=i:void 0===(n=function(){return i}.apply(e,[]))||(t.exports=n)},429:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var i=n(601),r=n.n(i),a=n(314),o=n.n(a)()(r());o.push([t.id,"/* muted country boundaries */\n.em--coxcomb .em-cntbn {\n stroke: grey;\n stroke-width: 0.25px;\n}\n\n/* Coastlines should not be drawn for choropleths, however for prop symbol maps with white regions they can be necessary */\n.em--ps .em-bn-co,\n.em--pie .em-bn-co {\n stroke: grey;\n stroke-width: 0.1px;\n}\n",""]);const s=o},470:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var i=n(601),r=n.n(i),a=n(314),o=n.n(a)()(r());o.push([t.id,"#em-labels {\n text-anchor: middle;\n stroke-linejoin: round;\n font-family: Arial, Helvetica, sans-serif;\n dominant-baseline: central;\n}\n\n.em-label {\n font-size: 12px;\n}\n.em-label-background {\n fill: #ffffff;\n pointer-events: none;\n opacity: 0.9;\n}\n.em-label-shadow {\n font-size: 12px;\n stroke-width: 2px;\n stroke: white;\n}\n.em-stat-label {\n opacity: 1;\n font-size: 13px;\n stroke-width: 3px;\n fill: #313131;\n font-weight: bold;\n}\n.em-stat-label-shadow {\n opacity: 1;\n font-size: 13px;\n stroke-width: 4px;\n stroke: white;\n}\n.em-label-cc {\n font-size: 12px;\n stroke: #505050;\n stroke-width: 0.5px;\n}\n.em-label-shadow-cc {\n font-size: 12px;\n stroke: white;\n stroke-width: 3px;\n}\n.em-label-countries {\n font-size: 12px;\n stroke: #505050;\n stroke-width: 0.5px;\n}\n.em-label-shadow-countries {\n font-size: 12px;\n stroke: white;\n stroke-width: 3px;\n}\n.em-label-seas {\n font-size: 9px;\n fill: #003399;\n stroke: #003399;\n stroke-width: 0.2px;\n letter-spacing: 3px;\n}\n.em-label-shadow-seas {\n font-size: 9px;\n letter-spacing: 3px;\n stroke: white;\n stroke-width: 3px;\n}\n\n.em-flow-labels {\n text-anchor: middle;\n stroke-linejoin: round;\n font-family: Arial, Helvetica, sans-serif;\n dominant-baseline: central;\n}\n.em-flow-label {\n font-size: 13px;\n fill: #333333;\n font-weight: bold;\n opacity: 0.9;\n}\n.em-flow-label-shadow {\n font-size: 13px;\n stroke-width: 3px;\n stroke: white;\n}\n",""]);const s=o},489:(t,e,n)=>{"use strict";n.d(e,{A:()=>f});var i=n(601),r=n.n(i),a=n(314),o=n.n(a),s=n(262),l=n(429),c=n(768),u=n(6),h=o()(r());h.i(s.A),h.i(l.A),h.i(c.A),h.i(u.A),h.push([t.id,"/* General text settings */\ntext {\n pointer-events: none;\n}\n\na text {\n pointer-events: all;\n}\n\n/* Main map */\n.em-map,\n.em-legend {\n font-family: Arial, Helvetica, sans-serif;\n}\n\n/* Coastal margin */\n#em-coast-margin {\n filter: url(#em-coastal-blur);\n stroke-linejoin: round;\n stroke-linecap: round;\n fill: none;\n stroke-width: 5;\n stroke: rgb(161, 198, 237);\n}\n\n/* Title and subtitle styling */\n.em-title,\n.em-inset-title {\n fill: #696969;\n stroke: none;\n}\n\n.em-title {\n font-size: 21px;\n font-weight: bold;\n}\n\n.em-inset-title {\n font-size: 11px;\n}\n\n.em-subtitle,\n.em-inset-subtitle {\n fill: #848280;\n stroke: none;\n stroke-linejoin: round;\n paint-order: stroke;\n}\n\n.em-subtitle {\n font-size: 18px;\n font-weight: 100;\n}\n\n.em-inset-subtitle {\n font-size: 12px;\n}\n\n.em-source-pretext {\n fill: #848280;\n font-size: 11px;\n transform: translate(-5px, -5px);\n}\n.em-source-dataset-link {\n font-size: 11px;\n fill: #0e47cb;\n cursor: pointer;\n text-decoration: underline;\n transform: translate(-5px, -5px);\n}\n.em-source-dataset-link:hover {\n fill: #082b7a;\n cursor: pointer;\n text-decoration: underline;\n}\n\n.em-frame {\n stroke-width: 0;\n stroke: grey;\n}\n\n.em-insets .em-frame {\n /* this will give a frame to inset maps */\n stroke: grey;\n stroke-width: 0.3px !important;\n}\n\n.em-sea {\n fill: white;\n /* pointer-events: none; */\n}\n.em-scalebar-line {\n stroke: #696969;\n stroke-width: 0.8px;\n}\n.em-scalebar-label {\n font-size: 9px;\n text-anchor: middle;\n}\n\n/* Bottom text and symbol styling */\n.em-footnote {\n fill: #848280;\n pointer-events: all;\n cursor: pointer;\n font-size: 11px;\n transform: translate(5px, -5px);\n}\n.em-footnote a {\n fill: #0e47cb;\n text-decoration: underline;\n}\n.em-footnote a:hover {\n fill: #0a328e;\n}\n\n.em-centroid {\n cursor: pointer;\n}\n\n/* Graticule styling */\n.em-graticule {\n stroke: lightgray;\n stroke-width: 1;\n}\n\n.em-flow-link {\n cursor: pointer;\n}\n.em-flow-link-outline {\n cursor: pointer;\n}\n.em-flow-labels {\n font-size: 15px;\n stroke-width: 1px;\n fill: #696969;\n pointer-events: none;\n}\n.em-flow-labels-halo {\n font-size: 15px;\n stroke-width: 2px;\n fill: white;\n pointer-events: none;\n}\n\n.em-grid-rect,\n.em-grid-hexagon {\n stroke: white;\n}\n\n.em-flow-donuts {\n cursor: pointer;\n}\n",""]);const f=h},540:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},546:t=>{function e(n,i,r,a){var o=Object.defineProperty;try{o({},"",{})}catch(n){o=0}t.exports=e=function(t,n,i,r){if(n)o?o(t,n,{value:i,enumerable:!r,configurable:!r,writable:!r}):t[n]=i;else{var a=function(n,i){e(t,n,(function(t){return this._invoke(n,i,t)}))};a("next",0),a("throw",1),a("return",2)}},t.exports.__esModule=!0,t.exports.default=t.exports,e(n,i,r,a)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},579:(t,e,n)=>{var i=n(738).default;t.exports=function(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(i(t)+" is not iterable")},t.exports.__esModule=!0,t.exports.default=t.exports},601:t=>{"use strict";t.exports=function(t){return t[1]}},604:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var i=n(601),r=n.n(i),a=n(314),o=n.n(a)()(r());o.push([t.id,".em-legend-background {\n fill: white;\n opacity: 0.7;\n rx: 0;\n ry: 0;\n pointer-events: none;\n}\n.em-legend-label {\n font-size: 15px;\n stroke: none;\n fill: #696969;\n dominant-baseline: unset;\n}\n.em-legend-title {\n font-size: 16px;\n fill: #696969;\n}\n.em-size-legend-title {\n font-size: 16px;\n fill: #696969;\n}\n.em-color-legend-title {\n font-size: 16px;\n fill: #696969;\n}\n.em-legend-subtitle {\n font-size: 15px;\n fill: #696969;\n opacity: 0.8;\n}\n.em-legend-separator {\n stroke: white;\n stroke-width: 1;\n}\n.em-legend-gradient {\n cursor: pointer;\n}\n.em-legend-tick {\n stroke: #696969;\n stroke-width: 1;\n}\n.em-bivariate-frame {\n fill: none;\n stroke: #696969;\n}\n.em-bivariate-nodata {\n stroke: #696969;\n stroke-width: 0.5;\n cursor: pointer;\n}\n.em-bivariate-axis-title {\n font-size: 15px;\n}\n.em-bivariate-nodata-label {\n font-size: 14px;\n dominant-baseline: middle;\n}\n.em-bivariate-tick {\n stroke: #696969;\n stroke-width: 1;\n}\n.em-bivariate-tick-label {\n text-anchor: middle;\n font-size: 12px;\n}\n.em-bivariate-square,\n.em-legend-rect {\n cursor: pointer;\n stroke: white;\n}\n\n.em-bivariate-square:hover,\n.em-legend-rect:hover {\n stroke-width: 2;\n stroke: red;\n}\n\n.em-pie-size-legend-line {\n stroke-dasharray: 2;\n stroke: grey;\n}\n\n.em-legend-diverging-line {\n stroke: #696969;\n}\n\n.em-legend-histogram-bar {\n cursor: pointer;\n}\n.em-month-label {\n font-size: 13px;\n}\n.em-legend-month-segment {\n stroke: #444;\n stroke-width: 0.3;\n opacity: 0.4;\n fill: #ccc;\n cursor: pointer;\n}\n",""]);const s=o},633:(t,e,n)=>{var i=n(172),r=n(993),a=n(869),o=n(887),s=n(791),l=n(373),c=n(579);function u(){"use strict";var e=r(),n=e.m(u),h=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function f(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))}var p={throw:1,return:2,break:3,continue:3};function d(t){var e,n;return function(i){e||(e={stop:function(){return n(i.a,2)},catch:function(){return i.v},abrupt:function(t,e){return n(i.a,p[t],e)},delegateYield:function(t,r,a){return e.resultName=r,n(i.d,c(t),a)},finish:function(t){return n(i.f,t)}},n=function(t,n,r){i.p=e.prev,i.n=e.next;try{return t(n,r)}finally{e.next=i.n}}),e.resultName&&(e[e.resultName]=i.v,e.resultName=void 0),e.sent=i.v,e.next=i.n;try{return t.call(this,e)}finally{i.p=e.prev,i.n=e.next}}}return(t.exports=u=function(){return{wrap:function(t,n,i,r){return e.w(d(t),n,i,r&&r.reverse())},isGeneratorFunction:f,mark:e.m,awrap:function(t,e){return new i(t,e)},AsyncIterator:s,async:function(t,e,n,i,r){return(f(e)?o:a)(d(t),e,n,i,r)},keys:l,values:c}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=u,t.exports.__esModule=!0,t.exports.default=t.exports},659:t=>{"use strict";var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},666:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var i=n(601),r=n.n(i),a=n(314),o=n.n(a)()(r());o.push([t.id,".em-tooltip {\n font-family: Arial;\n color: #383838;\n max-width: 250px;\n overflow: hidden;\n background: white;\n padding: 0px;\n border: 0px;\n border-radius: 0px;\n box-shadow:\n 0px 4px 6px rgba(0, 0, 0, 0.1),\n 0px 1px 3px rgba(0, 0, 0, 0.08);\n position: absolute;\n font-family: Helvetica, Arial, sans-serif;\n pointer-events: none;\n opacity: 0;\n z-index: 99999999;\n}\n.em-tooltip-text {\n background: #ffffff;\n padding: 4px;\n font-size: 15px;\n}\n.em-tooltip-bar {\n background: #515560;\n color: #ffffff;\n padding: 6px;\n font-size: 16px;\n}\n\n.em-footnote-tooltip {\n background: #ffffff;\n padding: 4px;\n font-size: 12px;\n}\n.em-tooltip-table {\n margin: 0px;\n}\n.em-tooltip-piechart-container {\n text-align: center;\n fill: #383838;\n display: flex;\n justify-content: center;\n}\n.em-tooltip-breakdown {\n display: flex;\n flex-direction: column;\n gap: 2px;\n font-size: 13px;\n line-height: 1.2;\n padding: 10px;\n padding-top: 3px;\n}\n\n.em-breakdown-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.em-breakdown-color {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n display: inline-block;\n margin-right: 6px;\n flex-shrink: 0;\n}\n\n.em-breakdown-label {\n flex: 1;\n color: #333;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.em-breakdown-value {\n margin-left: 8px;\n font-weight: 500;\n color: #222;\n white-space: nowrap;\n}\n\n.em-breakdown-item.em-total {\n border-top: 1px solid #ccc;\n margin-top: 3px;\n padding-top: 3px;\n font-weight: bold;\n}\n\n.em-cx-breakdown-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.em-tooltip-cx {\n line-height: 1;\n padding: 0px;\n}\n\n.em-tooltip-cx .em-breakdown-value,\n.em-tooltip-cx .em-breakdown-label,\n.em-tooltip-cx .em-breakdown-color {\n margin: 0;\n font-size: 11px; /* Smaller text for compactness */\n white-space: nowrap;\n}\n\n.em-tooltip-cx-table {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n}\n\n.em-tooltip-cx-table th,\n.em-tooltip-cx-table td {\n padding: 2px 4px; /* Minimal padding */\n border: 1px solid #eee;\n}\n\n.em-tooltip-cx-table th {\n background: #f7f7f7;\n font-weight: bold;\n font-size: 11px;\n}\n\n.em-tooltip-cx-table td {\n font-size: 11px;\n white-space: nowrap;\n}\n\n/* Make the Total value bold and right-aligned */\n.em-tooltip-cx-table .em-total td[colspan] {\n text-align: right;\n font-weight: bold !important;\n}\n\n/* Also make the inner number span bold */\n.em-tooltip-cx-table .em-total td[colspan] .em-breakdown-value {\n font-weight: bold !important;\n}\n.em-total {\n font-weight: bold !important;\n}\n",""]);const s=o},738:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},756:(t,e,n)=>{var i=n(633)();t.exports=i;try{regeneratorRuntime=i}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=i:Function("r","regeneratorRuntime = r")(i)}},765:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var i=n(601),r=n.n(i),a=n(314),o=n.n(a)()(r());o.push([t.id,".em-button {\n width: 35px;\n height: 35px;\n user-select: none;\n cursor: pointer;\n}\n\n.em-button rect {\n fill: white;\n stroke: #ccc;\n}\n\n.em-button rect:hover {\n fill: lightgrey;\n}\n\n.em-button text {\n text-anchor: middle;\n font-size: 20px;\n fill: #333333;\n}\n\n/* zoom */\n.em-zoom-buttons {\n transform: translate(94%, 10%);\n}\n\n/* insets */\n.em-insets-button {\n transform: translate(94%, 2%);\n}\n",""]);const s=o},768:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var i=n(601),r=n.n(i),a=n(314),o=n.n(a)()(r());o.push([t.id,"/* muted country fill */\n.em--alpha .em-cntrg,\n.em--alpha .em-cntrg {\n fill: #f2f2f2;\n}\n\n/* muted nuts fill */\n.em--alpha .em-nutsrg,\n.em--alpha .em-nutsrg {\n fill: #fdfdfd;\n}\n\n/* Coastlines should not be drawn for choropleths, however for alpha maps with white regions they can be necessary */\n.em--alpha .em-bn-co {\n stroke: grey;\n stroke-width: 0.1px;\n}\n",""]);const s=o},789:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var i=n(601),r=n.n(i),a=n(314),o=n.n(a)()(r());o.push([t.id,".em-annotation-group {\n /* pointer-events: none; */\n}\n",""]);const s=o},791:(t,e,n)=>{var i=n(172),r=n(546);t.exports=function t(e,n){function a(t,r,o,s){try{var l=e[t](r),c=l.value;return c instanceof i?n.resolve(c.v).then((function(t){a("next",t,o,s)}),(function(t){a("throw",t,o,s)})):n.resolve(c).then((function(t){l.value=t,o(l)}),(function(t){return a("throw",t,o,s)}))}catch(t){s(t)}}var o;this.next||(r(t.prototype),r(t.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),r(this,"_invoke",(function(t,e,i){function r(){return new n((function(e,n){a(t,i,e,n)}))}return o=o?o.then(r,r):r()}),!0)},t.exports.__esModule=!0,t.exports.default=t.exports},825:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,r&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},869:(t,e,n)=>{var i=n(887);t.exports=function(t,e,n,r,a){var o=i(t,e,n,r,a);return o.next().then((function(t){return t.done?t.value:o.next()}))},t.exports.__esModule=!0,t.exports.default=t.exports},875:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var i=n(601),r=n.n(i),a=n(314),o=n.n(a)()(r());o.push([t.id,"#g_worldbn,\n.em-worldrg,\n.em-worldbn {\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.em-worldbn {\n stroke: #000;\n stroke-width: 0.3px;\n}\n\n.em-worldbn {\n fill: none;\n}\n\n.em-worldrg {\n fill: #efefef;\n cursor: pointer;\n}\n\n.em-bn-d {\n /* disputed */\n stroke: #000;\n stroke-width: 0.1;\n fill: none;\n}\n",""]);const s=o},887:(t,e,n)=>{var i=n(993),r=n(791);t.exports=function(t,e,n,a,o){return new r(i().w(t,e,n,a),o||Promise)},t.exports.__esModule=!0,t.exports.default=t.exports},991:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var i=n(601),r=n.n(i),a=n(314),o=n.n(a)()(r());o.push([t.id,"/* STYLING OF NUTS REGIONS AND BOUNDARIES */\n/* Default region fill */\n.em-cntrg,\n.em-nutsrg,\n.em-grid-cell {\n fill: #e1e1e1;\n}\n\n.em-nutsrg,\n.em-cntrg,\n.em-grid-cell,\n#em-user-regions {\n cursor: pointer;\n}\n\n/* boundaries stroke-width */\n.em-bn-0 {\n stroke: none;\n}\n.em-bn-1,\n.em-bn-2,\n.em-bn-3,\n/* when using MIXED NUTS levels, we add stroke to the regions, then show/hide those that have/dont have data */\n.em-nutsrg [lvl='3'],\n.em-nutsrg [lvl='2'],\n.em-nutsrg [lvl='1'],\n.em-bn-co {\n stroke-width: 0.15;\n}\n\n/* all boudnaries and regions linecap/linejoin */\n#em-nutsbn,\n.em-cntbn,\n.em-bn-0,\n.em-bn-1,\n.em-bn-2,\n.em-bn-3,\n.em-kosovo-bn,\n.em-bn-co,\n.em-nutsrg [lvl='3'],\n.em-nutsrg [lvl='2'],\n.em-nutsrg [lvl='1'],\n.em-cntrg,\n.em-nutsrg,\n.em-grid-cell {\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n/* national boundaries */\n.em-cntbn {\n stroke: #0a0a0a;\n stroke-width: 0.6px;\n}\n\n/* NUTS boundaries stroke color */\n.em-bn-1,\n.em-bn-2,\n.em-bn-3,\n.em-nutsrg [lvl='3'],\n.em-nutsrg [lvl='2'],\n.em-nutsrg [lvl='1'] {\n stroke: #696969;\n}\n\n/* coastal boundaries */\n.em-bn-co {\n stroke: white;\n}\n\n/* kosovo */\n.em-kosovo-bn {\n stroke: #000;\n stroke-width: 0.15;\n}\n\n/* dont fill certain elements */\n.em-frame,\n.em-graticule,\n.em-cntbn,\n.em-bn-0,\n.em-bn-1,\n.em-bn-2,\n.em-bn-3,\n.em-kosovo-bn,\n.em-bn-co {\n fill: none;\n}\n\n/* Hide non-nuts borders (country boundaries > that are 'other' and not coastal, not candidates, not eu and not efta) */\ng#em-cntbn > .em-bn-oth:not(.em-bn-co):not(.em-bn-cc):not(.em-bn-eu):not(.em-bn-efta) {\n stroke-width: 0px;\n}\n",""]);const s=o},993:(t,e,n)=>{var i=n(546);function r(){
3
3
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
4
- var e,n,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.toStringTag||"@@toStringTag";function l(t,r,a,o){var s=r&&r.prototype instanceof u?r:u,l=Object.create(s.prototype);return i(l,"_invoke",function(t,i,r){var a,o,s,l=0,u=r||[],h=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,o=0,s=e,f.n=n,c}};function p(t,i){for(o=t,s=i,n=0;!h&&l&&!r&&n<u.length;n++){var r,a=u[n],p=f.p,d=a[2];t>3?(r=d===i)&&(s=a[(o=a[4])?5:(o=3,3)],a[4]=a[5]=e):a[0]<=p&&((r=t<2&&p<a[1])?(o=0,f.v=i,f.n=a[1]):p<d&&(r=t<3||a[0]>i||i>d)&&(a[4]=t,a[5]=i,f.n=d,o=0))}if(r||t>1)return c;throw h=!0,i}return function(r,u,d){if(l>1)throw TypeError("Generator is already running");for(h&&1===u&&p(u,d),o=u,s=d;(n=o<2?e:s)||!h;){a||(o?o<3?(o>1&&(f.n=-1),p(o,s)):f.n=s:f.v=s);try{if(l=2,a){if(o||(r="next"),n=a[r]){if(!(n=n.call(a,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,o<2&&(o=0)}else 1===o&&(n=a.return)&&n.call(a),o<2&&(s=TypeError("The iterator does not provide a '"+r+"' method"),o=1);a=e}else if((n=(h=f.n<0)?s:t.call(i,f))!==c)break}catch(t){a=e,o=1,s=t}finally{l=1}}return{value:n,done:h}}}(t,a,o),!0),l}var c={};function u(){}function h(){}function f(){}n=Object.getPrototypeOf;var p=[][o]?n(n([][o]())):(i(n={},o,(function(){return this})),n),d=f.prototype=u.prototype=Object.create(p);function g(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,i(t,s,"GeneratorFunction")),t.prototype=Object.create(d),t}return h.prototype=f,i(d,"constructor",f),i(f,"constructor",h),h.displayName="GeneratorFunction",i(f,s,"GeneratorFunction"),i(d),i(d,s,"Generator"),i(d,o,(function(){return this})),i(d,"toString",(function(){return"[object Generator]"})),(t.exports=r=function(){return{w:l,m:g}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var a=e[i]={id:i,exports:{}};return t[i](a,a.exports,n),a.exports}n.m=t,n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.u=t=>t+".eurostatmap.min.js",n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.p="/build/",n.b=document.baseURI||self.location.href,n.nc=void 0;var i={};return(()=>{"use strict";n.r(i),n.d(i,{getDefaultLabels:()=>Vb,getFillPatternDefinitionFunction:()=>Hb,map:()=>Wb,version:()=>$b});var t=n(72),e=n.n(t),r=n(825),a=n.n(r),o=n(659),s=n.n(o),l=n(56),c=n.n(l),u=n(540),h=n.n(u),f=n(113),p=n.n(f),d=n(211),g={};g.styleTagTransform=p(),g.setAttributes=c(),g.insert=s().bind(null,"head"),g.domAPI=a(),g.insertStyleElement=h();e()(d.A,g);d.A&&d.A.locals&&d.A.locals;function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function m(t,e){if(t){if("string"==typeof t)return _(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(t,e):void 0}}function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,a,o,s=[],l=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=a.call(n)).done)&&(s.push(i.value),s.length!==e);l=!0);}catch(t){c=!0,r=t}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw r}}return s}}(t,e)||m(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t){return function(t){if(Array.isArray(t))return _(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||m(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(){}function b(t){return null==t?x:function(){return this.querySelector(t)}}function w(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function S(){return[]}function M(t){return null==t?S:function(){return this.querySelectorAll(t)}}function E(t){return function(){return this.matches(t)}}function C(t){return function(e){return e.matches(t)}}var A=Array.prototype.find;function k(){return this.firstElementChild}var T=Array.prototype.filter;function P(){return Array.from(this.children)}function N(t){return new Array(t.length)}function L(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function F(t,e,n,i,r,a){for(var o,s=0,l=e.length,c=a.length;s<c;++s)(o=e[s])?(o.__data__=a[s],i[s]=o):n[s]=new L(t,a[s]);for(;s<l;++s)(o=e[s])&&(r[s]=o)}function O(t,e,n,i,r,a,o){var s,l,c,u=new Map,h=e.length,f=a.length,p=new Array(h);for(s=0;s<h;++s)(l=e[s])&&(p[s]=c=o.call(l,l.__data__,s,e)+"",u.has(c)?r[s]=l:u.set(c,l));for(s=0;s<f;++s)c=o.call(t,a[s],s,a)+"",(l=u.get(c))?(i[s]=l,l.__data__=a[s],u.delete(c)):n[s]=new L(t,a[s]);for(s=0;s<h;++s)(l=e[s])&&u.get(p[s])===l&&(r[s]=l)}function G(t){return t.__data__}function D(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function z(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}L.prototype={constructor:L,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var I="http://www.w3.org/1999/xhtml";const R={svg:"http://www.w3.org/2000/svg",xhtml:I,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function j(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),R.hasOwnProperty(e)?{space:R[e],local:t}:t}function B(t){return function(){this.removeAttribute(t)}}function q(t){return function(){this.removeAttributeNS(t.space,t.local)}}function U(t,e){return function(){this.setAttribute(t,e)}}function W(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function H(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function V(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function $(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function J(t){return function(){this.style.removeProperty(t)}}function Y(t,e,n){return function(){this.style.setProperty(t,e,n)}}function X(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function K(t,e){return t.style.getPropertyValue(e)||$(t).getComputedStyle(t,null).getPropertyValue(e)}function Z(t){return function(){delete this[t]}}function Q(t,e){return function(){this[t]=e}}function tt(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function et(t){return t.trim().split(/^|\s+/)}function nt(t){return t.classList||new it(t)}function it(t){this._node=t,this._names=et(t.getAttribute("class")||"")}function rt(t,e){for(var n=nt(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function at(t,e){for(var n=nt(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function ot(t){return function(){rt(this,t)}}function st(t){return function(){at(this,t)}}function lt(t,e){return function(){(e.apply(this,arguments)?rt:at)(this,t)}}function ct(){this.textContent=""}function ut(t){return function(){this.textContent=t}}function ht(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function ft(){this.innerHTML=""}function pt(t){return function(){this.innerHTML=t}}function dt(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function gt(){this.nextSibling&&this.parentNode.appendChild(this)}function _t(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===I&&e.documentElement.namespaceURI===I?e.createElement(t):e.createElementNS(n,t)}}function vt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function yt(t){var e=j(t);return(e.local?vt:mt)(e)}function xt(){return null}function bt(){var t=this.parentNode;t&&t.removeChild(this)}function wt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function St(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Mt(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,a=e.length;i<a;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?e.length=r:delete this.__on}}}function Et(t,e,n){return function(){var i,r=this.__on,a=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(r)for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===t.type&&i.name===t.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),void(i.value=e);this.addEventListener(t.type,a,n),i={type:t.type,name:t.name,value:e,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Ct(t,e,n){var i=$(t),r=i.CustomEvent;"function"==typeof r?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function At(t,e){return function(){return Ct(this,t,e)}}function kt(t,e){return function(){return Ct(this,t,e.apply(this,arguments))}}it.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Tt=[null];function Pt(t,e){this._groups=t,this._parents=e}function Nt(){return new Pt([[document.documentElement]],Tt)}Pt.prototype=Nt.prototype={constructor:Pt,select:function(t){"function"!=typeof t&&(t=b(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a,o,s=e[r],l=s.length,c=i[r]=new Array(l),u=0;u<l;++u)(a=s[u])&&(o=t.call(a,a.__data__,u,s))&&("__data__"in a&&(o.__data__=a.__data__),c[u]=o);return new Pt(i,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return w(t.apply(this,arguments))}}(t):M(t);for(var e=this._groups,n=e.length,i=[],r=[],a=0;a<n;++a)for(var o,s=e[a],l=s.length,c=0;c<l;++c)(o=s[c])&&(i.push(t.call(o,o.__data__,c,s)),r.push(o));return new Pt(i,r)},selectChild:function(t){return this.select(null==t?k:function(t){return function(){return A.call(this.children,t)}}("function"==typeof t?t:C(t)))},selectChildren:function(t){return this.selectAll(null==t?P:function(t){return function(){return T.call(this.children,t)}}("function"==typeof t?t:C(t)))},filter:function(t){"function"!=typeof t&&(t=E(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a,o=e[r],s=o.length,l=i[r]=[],c=0;c<s;++c)(a=o[c])&&t.call(a,a.__data__,c,o)&&l.push(a);return new Pt(i,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,G);var n=e?O:F,i=this._parents,r=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var a=r.length,o=new Array(a),s=new Array(a),l=new Array(a),c=0;c<a;++c){var u=i[c],h=r[c],f=h.length,p=D(t.call(u,u&&u.__data__,c,i)),d=p.length,g=s[c]=new Array(d),_=o[c]=new Array(d);n(u,h,g,_,l[c]=new Array(f),p,e);for(var m,v,y=0,x=0;y<d;++y)if(m=g[y]){for(y>=x&&(x=y+1);!(v=_[x])&&++x<d;);m._next=v||null}}return(o=new Pt(o,i))._enter=s,o._exit=l,o},enter:function(){return new Pt(this._enter||this._groups.map(N),this._parents)},exit:function(){return new Pt(this._exit||this._groups.map(N),this._parents)},join:function(t,e,n){var i=this.enter(),r=this,a=this.exit();return"function"==typeof t?(i=t(i))&&(i=i.selection()):i=i.append(t+""),null!=e&&(r=e(r))&&(r=r.selection()),null==n?a.remove():n(a),i&&r?i.merge(r).order():r},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,a=i.length,o=Math.min(r,a),s=new Array(r),l=0;l<o;++l)for(var c,u=n[l],h=i[l],f=u.length,p=s[l]=new Array(f),d=0;d<f;++d)(c=u[d]||h[d])&&(p[d]=c);for(;l<r;++l)s[l]=n[l];return new Pt(s,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,r=t[e],a=r.length-1,o=r[a];--a>=0;)(i=r[a])&&(o&&4^i.compareDocumentPosition(o)&&o.parentNode.insertBefore(i,o),o=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=z);for(var n=this._groups,i=n.length,r=new Array(i),a=0;a<i;++a){for(var o,s=n[a],l=s.length,c=r[a]=new Array(l),u=0;u<l;++u)(o=s[u])&&(c[u]=o);c.sort(e)}return new Pt(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,a=i.length;r<a;++r){var o=i[r];if(o)return o}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r,a=e[n],o=0,s=a.length;o<s;++o)(r=a[o])&&t.call(r,r.__data__,o,a);return this},attr:function(t,e){var n=j(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?q:B:"function"==typeof e?n.local?V:H:n.local?W:U)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?J:"function"==typeof e?X:Y)(t,e,null==n?"":n)):K(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Z:"function"==typeof e?tt:Q)(t,e)):this.node()[t]},classed:function(t,e){var n=et(t+"");if(arguments.length<2){for(var i=nt(this.node()),r=-1,a=n.length;++r<a;)if(!i.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?lt:e?ot:st)(n,e))},text:function(t){return arguments.length?this.each(null==t?ct:("function"==typeof t?ht:ut)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?ft:("function"==typeof t?dt:pt)(t)):this.node().innerHTML},raise:function(){return this.each(gt)},lower:function(){return this.each(_t)},append:function(t){var e="function"==typeof t?t:yt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:yt(t),i=null==e?xt:"function"==typeof e?e:b(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)}))},remove:function(){return this.each(bt)},clone:function(t){return this.select(t?St:wt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,r,a=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),o=a.length;if(!(arguments.length<2)){for(s=e?Et:Mt,i=0;i<o;++i)this.each(s(a[i],e,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(i=0,l=s[c];i<o;++i)if((r=a[i]).type===l.type&&r.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?kt:At)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i,r=t[e],a=0,o=r.length;a<o;++a)(i=r[a])&&(yield i)}};const Lt=Nt;function Ft(t){return"string"==typeof t?new Pt([[document.querySelector(t)]],[document.documentElement]):new Pt([[t]],Tt)}function Ot(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n>r||void 0===n&&r>=r)&&(n=r)}return n}function Gt(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n<r||void 0===n&&r>=r)&&(n=r)}return n}function Dt(t){return null===t?NaN:+t}function zt(t,e,n=Dt){if((i=t.length)&&!isNaN(e=+e)){if(e<=0||i<2)return+n(t[0],0,t);if(e>=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,a=Math.floor(r),o=+n(t[a],a,t);return o+(+n(t[a+1],a+1,t)-o)*(r-a)}}function It(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Rt(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function jt(t){let e,n,i;function r(t,i,r=0,a=t.length){if(r<a){if(0!==e(i,i))return a;do{const e=r+a>>>1;n(t[e],i)<0?r=e+1:a=e}while(r<a)}return r}return 2!==t.length?(e=It,n=(e,n)=>It(t(e),n),i=(e,n)=>t(e)-n):(e=t===It||t===Rt?t:Bt,n=t,i=t),{left:r,center:function(t,e,n=0,a=t.length){const o=r(t,e,n,a-1);return o>n&&i(t[o-1],e)>-i(t[o],e)?o-1:o},right:function(t,i,r=0,a=t.length){if(r<a){if(0!==e(i,i))return a;do{const e=r+a>>>1;n(t[e],i)<=0?r=e+1:a=e}while(r<a)}return r}}}function Bt(){return 0}const qt=jt(It),Ut=qt.right,Wt=(qt.left,jt(Dt).center,Ut);function Ht(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Vt(){var t,e=[],n=[],i=[];function r(){var t=0,r=Math.max(1,n.length);for(i=new Array(r-1);++t<r;)i[t-1]=zt(e,t/r);return a}function a(e){return null==e||isNaN(e=+e)?t:n[Wt(i,e)]}return a.invertExtent=function(t){var r=n.indexOf(t);return r<0?[NaN,NaN]:[r>0?i[r-1]:e[0],r<i.length?i[r]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(It),r()},a.range=function(t){return arguments.length?(n=Array.from(t),r()):n.slice()},a.unknown=function(e){return arguments.length?(t=e,a):t},a.quantiles=function(){return i.slice()},a.copy=function(){return Vt().domain(e).range(n).unknown(t)},Ht.apply(a,arguments)}const $t=Math.sqrt(50),Jt=Math.sqrt(10),Yt=Math.sqrt(2);function Xt(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),a=i/Math.pow(10,r),o=a>=$t?10:a>=Jt?5:a>=Yt?2:1;let s,l,c;return r<0?(c=Math.pow(10,-r)/o,s=Math.round(t*c),l=Math.round(e*c),s/c<t&&++s,l/c>e&&--l,c=-c):(c=Math.pow(10,r)*o,s=Math.round(t/c),l=Math.round(e/c),s*c<t&&++s,l*c>e&&--l),l<s&&.5<=n&&n<2?Xt(t,e,2*n):[s,l,c]}function Kt(t,e,n){return Xt(t=+t,e=+e,n=+n)[2]}function Zt(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Qt(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function te(){}var ee=.7,ne=1/ee,ie="\\s*([+-]?\\d+)\\s*",re="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ae="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",oe=/^#([0-9a-f]{3,8})$/,se=new RegExp(`^rgb\\(${ie},${ie},${ie}\\)$`),le=new RegExp(`^rgb\\(${ae},${ae},${ae}\\)$`),ce=new RegExp(`^rgba\\(${ie},${ie},${ie},${re}\\)$`),ue=new RegExp(`^rgba\\(${ae},${ae},${ae},${re}\\)$`),he=new RegExp(`^hsl\\(${re},${ae},${ae}\\)$`),fe=new RegExp(`^hsla\\(${re},${ae},${ae},${re}\\)$`),pe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function de(){return this.rgb().formatHex()}function ge(){return this.rgb().formatRgb()}function _e(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=oe.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?me(e):3===n?new be(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ve(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ve(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=se.exec(t))?new be(e[1],e[2],e[3],1):(e=le.exec(t))?new be(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ce.exec(t))?ve(e[1],e[2],e[3],e[4]):(e=ue.exec(t))?ve(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=he.exec(t))?Ae(e[1],e[2]/100,e[3]/100,1):(e=fe.exec(t))?Ae(e[1],e[2]/100,e[3]/100,e[4]):pe.hasOwnProperty(t)?me(pe[t]):"transparent"===t?new be(NaN,NaN,NaN,0):null}function me(t){return new be(t>>16&255,t>>8&255,255&t,1)}function ve(t,e,n,i){return i<=0&&(t=e=n=NaN),new be(t,e,n,i)}function ye(t){return t instanceof te||(t=_e(t)),t?new be((t=t.rgb()).r,t.g,t.b,t.opacity):new be}function xe(t,e,n,i){return 1===arguments.length?ye(t):new be(t,e,n,null==i?1:i)}function be(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function we(){return`#${Ce(this.r)}${Ce(this.g)}${Ce(this.b)}`}function Se(){const t=Me(this.opacity);return`${1===t?"rgb(":"rgba("}${Ee(this.r)}, ${Ee(this.g)}, ${Ee(this.b)}${1===t?")":`, ${t})`}`}function Me(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ee(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ce(t){return((t=Ee(t))<16?"0":"")+t.toString(16)}function Ae(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Te(t,e,n,i)}function ke(t){if(t instanceof Te)return new Te(t.h,t.s,t.l,t.opacity);if(t instanceof te||(t=_e(t)),!t)return new Te;if(t instanceof Te)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),a=Math.max(e,n,i),o=NaN,s=a-r,l=(a+r)/2;return s?(o=e===a?(n-i)/s+6*(n<i):n===a?(i-e)/s+2:(e-n)/s+4,s/=l<.5?a+r:2-a-r,o*=60):s=l>0&&l<1?0:o,new Te(o,s,l,t.opacity)}function Te(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Pe(t){return(t=(t||0)%360)<0?t+360:t}function Ne(t){return Math.max(0,Math.min(1,t||0))}function Le(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Fe(t,e,n,i,r){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*i+o*r)/6}Zt(te,_e,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:de,formatHex:de,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ke(this).formatHsl()},formatRgb:ge,toString:ge}),Zt(be,xe,Qt(te,{brighter(t){return t=null==t?ne:Math.pow(ne,t),new be(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?ee:Math.pow(ee,t),new be(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new be(Ee(this.r),Ee(this.g),Ee(this.b),Me(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:we,formatHex:we,formatHex8:function(){return`#${Ce(this.r)}${Ce(this.g)}${Ce(this.b)}${Ce(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Se,toString:Se})),Zt(Te,(function(t,e,n,i){return 1===arguments.length?ke(t):new Te(t,e,n,null==i?1:i)}),Qt(te,{brighter(t){return t=null==t?ne:Math.pow(ne,t),new Te(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?ee:Math.pow(ee,t),new Te(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new be(Le(t>=240?t-240:t+120,r,i),Le(t,r,i),Le(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Te(Pe(this.h),Ne(this.s),Ne(this.l),Me(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Me(this.opacity);return`${1===t?"hsl(":"hsla("}${Pe(this.h)}, ${100*Ne(this.s)}%, ${100*Ne(this.l)}%${1===t?")":`, ${t})`}`}}));const Oe=t=>()=>t;function Ge(t,e){return function(n){return t+n*e}}function De(t){return 1==(t=+t)?ze:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):Oe(isNaN(e)?n:e)}}function ze(t,e){var n=e-t;return n?Ge(t,n):Oe(isNaN(t)?e:t)}const Ie=function t(e){var n=De(e);function i(t,e){var i=n((t=xe(t)).r,(e=xe(e)).r),r=n(t.g,e.g),a=n(t.b,e.b),o=ze(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=a(e),t.opacity=o(e),t+""}}return i.gamma=t,i}(1);function Re(t){return function(e){var n,i,r=e.length,a=new Array(r),o=new Array(r),s=new Array(r);for(n=0;n<r;++n)i=xe(e[n]),a[n]=i.r||0,o[n]=i.g||0,s[n]=i.b||0;return a=t(a),o=t(o),s=t(s),i.opacity=1,function(t){return i.r=a(t),i.g=o(t),i.b=s(t),i+""}}}var je=Re((function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),r=t[i],a=t[i+1],o=i>0?t[i-1]:2*r-a,s=i<e-1?t[i+2]:2*a-r;return Fe((n-i/e)*e,o,r,a,s)}}));Re((function(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),r=t[(i+e-1)%e],a=t[i%e],o=t[(i+1)%e],s=t[(i+2)%e];return Fe((n-i/e)*e,r,a,o,s)}}));function Be(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,a=new Array(r),o=new Array(i);for(n=0;n<r;++n)a[n]=Ye(t[n],e[n]);for(;n<i;++n)o[n]=e[n];return function(t){for(n=0;n<r;++n)o[n]=a[n](t);return o}}function qe(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function Ue(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function We(t,e){var n,i={},r={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?i[n]=Ye(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}}var He=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ve=new RegExp(He.source,"g");function $e(t,e){var n,i,r,a=He.lastIndex=Ve.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(n=He.exec(t))&&(i=Ve.exec(e));)(r=i.index)>a&&(r=e.slice(a,r),s[o]?s[o]+=r:s[++o]=r),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:Ue(n,i)})),a=Ve.lastIndex;return a<e.length&&(r=e.slice(a),s[o]?s[o]+=r:s[++o]=r),s.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,i=0;i<e;++i)s[(n=l[i]).i]=n.x(t);return s.join("")})}function Je(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(a){for(n=0;n<i;++n)r[n]=t[n]*(1-a)+e[n]*a;return r}}function Ye(t,e){var n,i=typeof e;return null==e||"boolean"===i?Oe(e):("number"===i?Ue:"string"===i?(n=_e(e))?(e=n,Ie):$e:e instanceof _e?Ie:e instanceof Date?qe:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(e)?Je:Array.isArray(e)?Be:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?We:Ue)(t,e)}function Xe(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Ke(t){return+t}var Ze=[0,1];function Qe(t){return t}function tn(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function en(t,e,n){var i=t[0],r=t[1],a=e[0],o=e[1];return r<i?(i=tn(r,i),a=n(o,a)):(i=tn(i,r),a=n(a,o)),function(t){return a(i(t))}}function nn(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),a=new Array(i),o=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<i;)r[o]=tn(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(e){var n=Wt(t,e,1,i)-1;return a[n](r[n](e))}}function rn(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function an(){var t,e,n,i,r,a,o=Ze,s=Ze,l=Ye,c=Qe;function u(){var t=Math.min(o.length,s.length);return c!==Qe&&(c=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(o[0],o[t-1])),i=t>2?nn:en,r=a=null,h}function h(e){return null==e||isNaN(e=+e)?n:(r||(r=i(o.map(t),s,l)))(t(c(e)))}return h.invert=function(n){return c(e((a||(a=i(s,o.map(t),Ue)))(n)))},h.domain=function(t){return arguments.length?(o=Array.from(t,Ke),u()):o.slice()},h.range=function(t){return arguments.length?(s=Array.from(t),u()):s.slice()},h.rangeRound=function(t){return s=Array.from(t),l=Xe,u()},h.clamp=function(t){return arguments.length?(c=!!t||Qe,u()):c!==Qe},h.interpolate=function(t){return arguments.length?(l=t,u()):l},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,i){return t=n,e=i,u()}}function on(){return an()(Qe,Qe)}var sn,ln=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function cn(t){if(!(e=ln.exec(t)))throw new Error("invalid format: "+t);var e;return new un({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function un(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function hn(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function fn(t){return(t=hn(Math.abs(t)))?t[1]:NaN}function pn(t,e){var n=hn(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}cn.prototype=un.prototype,un.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const dn={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>pn(100*t,e),r:pn,s:function(t,e){var n=hn(t,e);if(!n)return t+"";var i=n[0],r=n[1],a=r-(sn=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=i.length;return a===o?i:a>o?i+new Array(a-o+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+hn(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function gn(t){return t}var _n,mn,vn,yn=Array.prototype.map,xn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function bn(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?gn:(e=yn.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,a=[],o=0,s=e[0],l=0;r>0&&s>0&&(l+s+1>i&&(s=Math.max(1,i-l)),a.push(t.substring(r-=s,r+s)),!((l+=s+1)>i));)s=e[o=(o+1)%e.length];return a.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?gn:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(yn.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=cn(t)).fill,n=t.align,h=t.sign,f=t.symbol,p=t.zero,d=t.width,g=t.comma,_=t.precision,m=t.trim,v=t.type;"n"===v?(g=!0,v="g"):dn[v]||(void 0===_&&(_=12),m=!0,v="g"),(p||"0"===e&&"="===n)&&(p=!0,e="0",n="=");var y="$"===f?r:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===f?a:/[%p]/.test(v)?l:"",b=dn[v],w=/[defgprs%]/.test(v);function S(t){var r,a,l,f=y,S=x;if("c"===v)S=b(t)+S,t="";else{var M=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:b(Math.abs(t),_),m&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),M&&0==+t&&"+"!==h&&(M=!1),f=(M?"("===h?h:c:"-"===h||"("===h?"":h)+f,S=("s"===v?xn[8+sn/3]:"")+S+(M&&"("===h?")":""),w)for(r=-1,a=t.length;++r<a;)if(48>(l=t.charCodeAt(r))||l>57){S=(46===l?o+t.slice(r+1):t.slice(r))+S,t=t.slice(0,r);break}}g&&!p&&(t=i(t,1/0));var E=f.length+t.length+S.length,C=E<d?new Array(d-E+1).join(e):"";switch(g&&p&&(t=i(C+t,C.length?d-S.length:1/0),C=""),n){case"<":t=f+t+S+C;break;case"=":t=f+C+t+S;break;case"^":t=C.slice(0,E=C.length>>1)+f+t+S+C.slice(E);break;default:t=C+f+t+S}return s(t)}return _=void 0===_?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_)),S.toString=function(){return t+""},S}return{format:h,formatPrefix:function(t,e){var n=h(((t=cn(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(fn(e)/3))),r=Math.pow(10,-i),a=xn[8+i/3];return function(t){return n(r*t)+a}}}}function wn(t){return _n=bn(t),mn=_n.format,vn=_n.formatPrefix,_n}function Sn(t,e,n,i){var r,a=function(t,e,n){n=+n;const i=(e=+e)<(t=+t),r=i?Kt(e,t,n):Kt(t,e,n);return(i?-1:1)*(r<0?1/-r:r)}(t,e,n);switch((i=cn(null==i?",f":i)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(fn(e)/3)))-fn(Math.abs(t)))}(a,o))||(i.precision=r),vn(i,o);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,fn(e)-fn(t))+1}(a,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(t){return Math.max(0,-fn(Math.abs(t)))}(a))||(i.precision=r-2*("%"===i.type))}return mn(i)}function Mn(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const i=e<t,[r,a,o]=i?Xt(e,t,n):Xt(t,e,n);if(!(a>=r))return[];const s=a-r+1,l=new Array(s);if(i)if(o<0)for(let t=0;t<s;++t)l[t]=(a-t)/-o;else for(let t=0;t<s;++t)l[t]=(a-t)*o;else if(o<0)for(let t=0;t<s;++t)l[t]=(r+t)/-o;else for(let t=0;t<s;++t)l[t]=(r+t)*o;return l}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var i=e();return Sn(i[0],i[i.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var i,r,a=e(),o=0,s=a.length-1,l=a[o],c=a[s],u=10;for(c<l&&(r=l,l=c,c=r,r=o,o=s,s=r);u-- >0;){if((r=Kt(l,c,n))===i)return a[o]=l,a[s]=c,e(a);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return t},t}function En(){var t=on();return t.copy=function(){return rn(t,En())},Ht.apply(t,arguments),Mn(t)}function Cn(){var t,e=0,n=1,i=1,r=[.5],a=[0,1];function o(e){return null!=e&&e<=e?a[Wt(r,e,0,i)]:t}function s(){var t=-1;for(r=new Array(i);++t<i;)r[t]=((t+1)*n-(t-i)*e)/(i+1);return o}return o.domain=function(t){return arguments.length?([e,n]=t,e=+e,n=+n,s()):[e,n]},o.range=function(t){return arguments.length?(i=(a=Array.from(t)).length-1,s()):a.slice()},o.invertExtent=function(t){var o=a.indexOf(t);return o<0?[NaN,NaN]:o<1?[e,r[0]]:o>=i?[r[i-1],n]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length?(t=e,o):o},o.thresholds=function(){return r.slice()},o.copy=function(){return Cn().domain([e,n]).range(a).unknown(t)},Ht.apply(Mn(o),arguments)}function An(){var t,e=[.5],n=[0,1],i=1;function r(r){return null!=r&&r<=r?n[Wt(e,r,0,i)]:t}return r.domain=function(t){return arguments.length?(e=Array.from(t),i=Math.min(e.length,n.length-1),r):e.slice()},r.range=function(t){return arguments.length?(n=Array.from(t),i=Math.min(e.length,n.length-1),r):n.slice()},r.invertExtent=function(t){var i=n.indexOf(t);return[e[i-1],e[i]]},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return An().domain(e).range(n).unknown(t)},Ht.apply(r,arguments)}function kn(t){for(var e=t.length/6|0,n=new Array(e),i=0;i<e;)n[i]="#"+t.slice(6*i,6*++i);return n}wn({thousands:",",grouping:[3],currency:["$",""]});const Tn=t=>je(t[t.length-1]);const Pn=Tn(new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(kn));const Nn=Math.PI/180,Ln=180/Math.PI,Fn=.96422,On=.82521,Gn=4/29,Dn=6/29,zn=3*Dn*Dn,In=Dn*Dn*Dn;function Rn(t){if(t instanceof Bn)return new Bn(t.l,t.a,t.b,t.opacity);if(t instanceof $n)return Jn(t);t instanceof be||(t=ye(t));var e,n,i=Hn(t.r),r=Hn(t.g),a=Hn(t.b),o=qn((.2225045*i+.7168786*r+.0606169*a)/1);return i===r&&r===a?e=n=o:(e=qn((.4360747*i+.3850649*r+.1430804*a)/Fn),n=qn((.0139322*i+.0971045*r+.7141733*a)/On)),new Bn(116*o-16,500*(e-o),200*(o-n),t.opacity)}function jn(t,e,n,i){return 1===arguments.length?Rn(t):new Bn(t,e,n,null==i?1:i)}function Bn(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function qn(t){return t>In?Math.pow(t,1/3):t/zn+Gn}function Un(t){return t>Dn?t*t*t:zn*(t-Gn)}function Wn(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Hn(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Vn(t){if(t instanceof $n)return new $n(t.h,t.c,t.l,t.opacity);if(t instanceof Bn||(t=Rn(t)),0===t.a&&0===t.b)return new $n(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Ln;return new $n(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function $n(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}function Jn(t){if(isNaN(t.h))return new Bn(t.l,0,0,t.opacity);var e=t.h*Nn;return new Bn(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function Yn(t,e){var n=ze((t=jn(t)).l,(e=jn(e)).l),i=ze(t.a,e.a),r=ze(t.b,e.b),a=ze(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=i(e),t.b=r(e),t.opacity=a(e),t+""}}Zt(Bn,jn,Qt(te,{brighter(t){return new Bn(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new Bn(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new be(Wn(3.1338561*(e=Fn*Un(e))-1.6168667*(t=1*Un(t))-.4906146*(n=On*Un(n))),Wn(-.9787684*e+1.9161415*t+.033454*n),Wn(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),Zt($n,(function(t,e,n,i){return 1===arguments.length?Vn(t):new $n(t,e,n,null==i?1:i)}),Qt(te,{brighter(t){return new $n(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new $n(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return Jn(this).rgb()}}));var Xn={value:()=>{}};function Kn(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new Zn(i)}function Zn(t){this._=t}function Qn(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function ti(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=Xn,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}Zn.prototype=Kn.prototype={constructor:Zn,on:function(t,e){var n,i,r=this._,a=(i=r,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!i.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=a[o]).type)r[n]=ti(r[n],t.name,e);else if(null==e)for(n in r)r[n]=ti(r[n],t.name,null);return this}for(;++o<s;)if((n=(t=a[o]).type)&&(n=Qn(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Zn(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),a=0;a<n;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(i=this._[t]).length;a<n;++a)i[a].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,a=i.length;r<a;++r)i[r].value.apply(e,n)}};const ei=Kn;var ni,ii,ri=0,ai=0,oi=0,si=0,li=0,ci=0,ui="object"==typeof performance&&performance.now?performance:Date,hi="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function fi(){return li||(hi(pi),li=ui.now()+ci)}function pi(){li=0}function di(){this._call=this._time=this._next=null}function gi(t,e,n){var i=new di;return i.restart(t,e,n),i}function _i(){li=(si=ui.now())+ci,ri=ai=0;try{!function(){fi(),++ri;for(var t,e=ni;e;)(t=li-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ri}()}finally{ri=0,function(){var t,e,n=ni,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:ni=e);ii=t,vi(i)}(),li=0}}function mi(){var t=ui.now(),e=t-si;e>1e3&&(ci-=e,si=t)}function vi(t){ri||(ai&&(ai=clearTimeout(ai)),t-li>24?(t<1/0&&(ai=setTimeout(_i,t-ui.now()-ci)),oi&&(oi=clearInterval(oi))):(oi||(si=ui.now(),oi=setInterval(mi,1e3)),ri=1,hi(_i)))}function yi(t,e,n){var i=new di;return e=null==e?0:+e,i.restart((n=>{i.stop(),t(n+e)}),e,n),i}di.prototype=gi.prototype={constructor:di,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?fi():+n)+(null==e?0:+e),this._next||ii===this||(ii?ii._next=this:ni=this,ii=this),this._call=t,this._time=n,vi()},stop:function(){this._call&&(this._call=null,this._time=1/0,vi())}};var xi=ei("start","end","cancel","interrupt"),bi=[];function wi(t,e,n,i,r,a){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function a(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}function o(a){var c,u,h,f;if(1!==n.state)return l();for(c in r)if((f=r[c]).name===n.name){if(3===f.state)return yi(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete r[c]):+c<e&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete r[c])}if(yi((function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,i=new Array(h=n.tween.length),c=0,u=-1;c<h;++c)(f=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(l),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(t,r);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){for(var i in n.state=6,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=gi(a,0,n.time)}(t,n,{name:e,index:i,group:r,on:xi,tween:bi,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function Si(t,e){var n=Ei(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function Mi(t,e){var n=Ei(t,e);if(n.state>3)throw new Error("too late; already running");return n}function Ei(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Ci(t,e){var n,i,r,a=t.__transition,o=!0;if(a){for(r in e=null==e?null:e+"",a)(n=a[r]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete a[r]):o=!1;o&&delete t.__transition}}var Ai,ki=180/Math.PI,Ti={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Pi(t,e,n,i,r,a){var o,s,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(s=Math.sqrt(n*n+i*i))&&(n/=s,i/=s,l/=s),t*i<e*n&&(t=-t,e=-e,l=-l,o=-o),{translateX:r,translateY:a,rotate:Math.atan2(e,t)*ki,skewX:Math.atan(l)*ki,scaleX:o,scaleY:s}}function Ni(t,e,n,i){function r(t){return t.length?t.pop()+" ":""}return function(a,o){var s=[],l=[];return a=t(a),o=t(o),function(t,i,r,a,o,s){if(t!==r||i!==a){var l=o.push("translate(",null,e,null,n);s.push({i:l-4,x:Ue(t,r)},{i:l-2,x:Ue(i,a)})}else(r||a)&&o.push("translate("+r+e+a+n)}(a.translateX,a.translateY,o.translateX,o.translateY,s,l),function(t,e,n,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(r(n)+"rotate(",null,i)-2,x:Ue(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(a.rotate,o.rotate,s,l),function(t,e,n,a){t!==e?a.push({i:n.push(r(n)+"skewX(",null,i)-2,x:Ue(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(a.skewX,o.skewX,s,l),function(t,e,n,i,a,o){if(t!==n||e!==i){var s=a.push(r(a)+"scale(",null,",",null,")");o.push({i:s-4,x:Ue(t,n)},{i:s-2,x:Ue(e,i)})}else 1===n&&1===i||a.push(r(a)+"scale("+n+","+i+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,n=-1,i=l.length;++n<i;)s[(e=l[n]).i]=e.x(t);return s.join("")}}}var Li=Ni((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ti:Pi(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),Fi=Ni((function(t){return null==t?Ti:(Ai||(Ai=document.createElementNS("http://www.w3.org/2000/svg","g")),Ai.setAttribute("transform",t),(t=Ai.transform.baseVal.consolidate())?Pi((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Ti)}),", ",")",")");function Oi(t,e){var n,i;return function(){var r=Mi(this,t),a=r.tween;if(a!==n)for(var o=0,s=(i=n=a).length;o<s;++o)if(i[o].name===e){(i=i.slice()).splice(o,1);break}r.tween=i}}function Gi(t,e,n){var i,r;if("function"!=typeof n)throw new Error;return function(){var a=Mi(this,t),o=a.tween;if(o!==i){r=(i=o).slice();for(var s={name:e,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===e){r[l]=s;break}l===c&&r.push(s)}a.tween=r}}function Di(t,e,n){var i=t._id;return t.each((function(){var t=Mi(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return Ei(t,i).value[e]}}function zi(t,e){var n;return("number"==typeof e?Ue:e instanceof _e?Ie:(n=_e(e))?(e=n,Ie):$e)(t,e)}function Ii(t){return function(){this.removeAttribute(t)}}function Ri(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ji(t,e,n){var i,r,a=n+"";return function(){var o=this.getAttribute(t);return o===a?null:o===i?r:r=e(i=o,n)}}function Bi(t,e,n){var i,r,a=n+"";return function(){var o=this.getAttributeNS(t.space,t.local);return o===a?null:o===i?r:r=e(i=o,n)}}function qi(t,e,n){var i,r,a;return function(){var o,s,l=n(this);if(null!=l)return(o=this.getAttribute(t))===(s=l+"")?null:o===i&&s===r?a:(r=s,a=e(i=o,l));this.removeAttribute(t)}}function Ui(t,e,n){var i,r,a;return function(){var o,s,l=n(this);if(null!=l)return(o=this.getAttributeNS(t.space,t.local))===(s=l+"")?null:o===i&&s===r?a:(r=s,a=e(i=o,l));this.removeAttributeNS(t.space,t.local)}}function Wi(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,r)),n}return r._value=e,r}function Hi(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,r)),n}return r._value=e,r}function Vi(t,e){return function(){Si(this,t).delay=+e.apply(this,arguments)}}function $i(t,e){return e=+e,function(){Si(this,t).delay=e}}function Ji(t,e){return function(){Mi(this,t).duration=+e.apply(this,arguments)}}function Yi(t,e){return e=+e,function(){Mi(this,t).duration=e}}var Xi=Lt.prototype.constructor;function Ki(t){return function(){this.style.removeProperty(t)}}var Zi=0;function Qi(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function tr(){return++Zi}var er=Lt.prototype;Qi.prototype=function(t){return Lt().transition(t)}.prototype={constructor:Qi,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=b(t));for(var i=this._groups,r=i.length,a=new Array(r),o=0;o<r;++o)for(var s,l,c=i[o],u=c.length,h=a[o]=new Array(u),f=0;f<u;++f)(s=c[f])&&(l=t.call(s,s.__data__,f,c))&&("__data__"in s&&(l.__data__=s.__data__),h[f]=l,wi(h[f],e,n,f,h,Ei(s,n)));return new Qi(a,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=M(t));for(var i=this._groups,r=i.length,a=[],o=[],s=0;s<r;++s)for(var l,c=i[s],u=c.length,h=0;h<u;++h)if(l=c[h]){for(var f,p=t.call(l,l.__data__,h,c),d=Ei(l,n),g=0,_=p.length;g<_;++g)(f=p[g])&&wi(f,e,n,g,p,d);a.push(p),o.push(l)}return new Qi(a,o,e,n)},selectChild:er.selectChild,selectChildren:er.selectChildren,filter:function(t){"function"!=typeof t&&(t=E(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a,o=e[r],s=o.length,l=i[r]=[],c=0;c<s;++c)(a=o[c])&&t.call(a,a.__data__,c,o)&&l.push(a);return new Qi(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,a=Math.min(i,r),o=new Array(i),s=0;s<a;++s)for(var l,c=e[s],u=n[s],h=c.length,f=o[s]=new Array(h),p=0;p<h;++p)(l=c[p]||u[p])&&(f[p]=l);for(;s<i;++s)o[s]=e[s];return new Qi(o,this._parents,this._name,this._id)},selection:function(){return new Xi(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=tr(),i=this._groups,r=i.length,a=0;a<r;++a)for(var o,s=i[a],l=s.length,c=0;c<l;++c)if(o=s[c]){var u=Ei(o,e);wi(o,t,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Qi(i,this._parents,t,n)},call:er.call,nodes:er.nodes,node:er.node,size:er.size,empty:er.empty,each:er.each,on:function(t,e){var n=this._id;return arguments.length<2?Ei(this.node(),n).on.on(t):this.each(function(t,e,n){var i,r,a=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Si:Mi;return function(){var o=a(this,t),s=o.on;s!==i&&(r=(i=s).copy()).on(e,n),o.on=r}}(n,t,e))},attr:function(t,e){var n=j(t),i="transform"===n?Fi:zi;return this.attrTween(t,"function"==typeof e?(n.local?Ui:qi)(n,i,Di(this,"attr."+t,e)):null==e?(n.local?Ri:Ii)(n):(n.local?Bi:ji)(n,i,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var i=j(t);return this.tween(n,(i.local?Wi:Hi)(i,e))},style:function(t,e,n){var i="transform"==(t+="")?Li:zi;return null==e?this.styleTween(t,function(t,e){var n,i,r;return function(){var a=K(this,t),o=(this.style.removeProperty(t),K(this,t));return a===o?null:a===n&&o===i?r:r=e(n=a,i=o)}}(t,i)).on("end.style."+t,Ki(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,r,a;return function(){var o=K(this,t),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(t),l=s=K(this,t)),o===l?null:o===i&&l===r?a:(r=l,a=e(i=o,s))}}(t,i,Di(this,"style."+t,e))).each(function(t,e){var n,i,r,a,o="style."+e,s="end."+o;return function(){var l=Mi(this,t),c=l.on,u=null==l.value[o]?a||(a=Ki(e)):void 0;c===n&&r===u||(i=(n=c).copy()).on(s,r=u),l.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,r,a=n+"";return function(){var o=K(this,t);return o===a?null:o===i?r:r=e(i=o,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function(t,e,n){var i,r;function a(){var a=e.apply(this,arguments);return a!==r&&(i=(r=a)&&function(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}(t,a,n)),i}return a._value=e,a}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Di(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&function(t){return function(e){this.textContent=t.call(this,e)}}(i)),e}return i._value=t,i}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=Ei(this.node(),n).tween,a=0,o=r.length;a<o;++a)if((i=r[a]).name===t)return i.value;return null}return this.each((null==e?Oi:Gi)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Vi:$i)(e,t)):Ei(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Ji:Yi)(e,t)):Ei(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){Mi(this,t).ease=e}}(e,t)):Ei(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;Mi(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,i=n._id,r=n.size();return new Promise((function(a,o){var s={value:o},l={value:function(){0==--r&&a()}};n.each((function(){var n=Mi(this,i),r=n.on;r!==t&&((e=(t=r).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(l)),n.on=e})),0===r&&a()}))},[Symbol.iterator]:er[Symbol.iterator]};var nr={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function ir(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}Lt.prototype.interrupt=function(t){return this.each((function(){Ci(this,t)}))},Lt.prototype.transition=function(t){var e,n;t instanceof Qi?(e=t._id,t=t._name):(e=tr(),(n=nr).time=fi(),t=null==t?null:t+"");for(var i=this._groups,r=i.length,a=0;a<r;++a)for(var o,s=i[a],l=s.length,c=0;c<l;++c)(o=s[c])&&wi(o,t,e,c,s,n||ir(o,e));return new Qi(i,this._parents,t,e)};const{abs:rr,max:ar,min:or}=Math;function sr(t){return[+t[0],+t[1]]}function lr(t){return[sr(t[0]),sr(t[1])]}["w","e"].map(cr),["n","s"].map(cr),["n","w","e","s","nw","ne","sw","se"].map(cr);function cr(t){return{type:t}}function ur(t){return function(){return t}}const hr=Math.abs,fr=Math.atan2,pr=Math.cos,dr=Math.max,gr=Math.min,_r=Math.sin,mr=Math.sqrt,vr=1e-12,yr=Math.PI,xr=yr/2,br=2*yr;function wr(t){return t>=1?xr:t<=-1?-xr:Math.asin(t)}const Sr=Math.PI,Mr=2*Sr,Er=1e-6,Cr=Mr-Er;function Ar(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class kr{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Ar:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Ar;const n=10**e;return function(t){this._+=t[0];for(let e=1,i=t.length;e<i;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,i){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,e,n,i,r,a){this._append`C${+t},${+e},${+n},${+i},${this._x1=+r},${this._y1=+a}`}arcTo(t,e,n,i,r){if(t=+t,e=+e,n=+n,i=+i,(r=+r)<0)throw new Error(`negative radius: ${r}`);let a=this._x1,o=this._y1,s=n-t,l=i-e,c=a-t,u=o-e,h=c*c+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(h>Er)if(Math.abs(u*s-l*c)>Er&&r){let f=n-a,p=i-o,d=s*s+l*l,g=f*f+p*p,_=Math.sqrt(d),m=Math.sqrt(h),v=r*Math.tan((Sr-Math.acos((d+h-g)/(2*_*m)))/2),y=v/m,x=v/_;Math.abs(y-1)>Er&&this._append`L${t+y*c},${e+y*u}`,this._append`A${r},${r},0,0,${+(u*f>c*p)},${this._x1=t+x*s},${this._y1=e+x*l}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,i,r,a){if(t=+t,e=+e,a=!!a,(n=+n)<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),s=n*Math.sin(i),l=t+o,c=e+s,u=1^a,h=a?i-r:r-i;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Er||Math.abs(this._y1-c)>Er)&&this._append`L${l},${c}`,n&&(h<0&&(h=h%Mr+Mr),h>Cr?this._append`A${n},${n},0,1,${u},${t-o},${e-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>Er&&this._append`A${n},${n},0,${+(h>=Sr)},${u},${this._x1=t+n*Math.cos(r)},${this._y1=e+n*Math.sin(r)}`)}rect(t,e,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Tr(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new kr(e)}function Pr(t){return t.innerRadius}function Nr(t){return t.outerRadius}function Lr(t){return t.startAngle}function Fr(t){return t.endAngle}function Or(t){return t&&t.padAngle}function Gr(t,e,n,i,r,a,o){var s=t-n,l=e-i,c=(o?a:-a)/mr(s*s+l*l),u=c*l,h=-c*s,f=t+u,p=e+h,d=n+u,g=i+h,_=(f+d)/2,m=(p+g)/2,v=d-f,y=g-p,x=v*v+y*y,b=r-a,w=f*g-d*p,S=(y<0?-1:1)*mr(dr(0,b*b*x-w*w)),M=(w*y-v*S)/x,E=(-w*v-y*S)/x,C=(w*y+v*S)/x,A=(-w*v+y*S)/x,k=M-_,T=E-m,P=C-_,N=A-m;return k*k+T*T>P*P+N*N&&(M=C,E=A),{cx:M,cy:E,x01:-u,y01:-h,x11:M*(r/b-1),y11:E*(r/b-1)}}function Dr(){var t=Pr,e=Nr,n=ur(0),i=null,r=Lr,a=Fr,o=Or,s=null,l=Tr(c);function c(){var c,u,h=+t.apply(this,arguments),f=+e.apply(this,arguments),p=r.apply(this,arguments)-xr,d=a.apply(this,arguments)-xr,g=hr(d-p),_=d>p;if(s||(s=c=l()),f<h&&(u=f,f=h,h=u),f>vr)if(g>br-vr)s.moveTo(f*pr(p),f*_r(p)),s.arc(0,0,f,p,d,!_),h>vr&&(s.moveTo(h*pr(d),h*_r(d)),s.arc(0,0,h,d,p,_));else{var m,v,y=p,x=d,b=p,w=d,S=g,M=g,E=o.apply(this,arguments)/2,C=E>vr&&(i?+i.apply(this,arguments):mr(h*h+f*f)),A=gr(hr(f-h)/2,+n.apply(this,arguments)),k=A,T=A;if(C>vr){var P=wr(C/h*_r(E)),N=wr(C/f*_r(E));(S-=2*P)>vr?(b+=P*=_?1:-1,w-=P):(S=0,b=w=(p+d)/2),(M-=2*N)>vr?(y+=N*=_?1:-1,x-=N):(M=0,y=x=(p+d)/2)}var L=f*pr(y),F=f*_r(y),O=h*pr(w),G=h*_r(w);if(A>vr){var D,z=f*pr(x),I=f*_r(x),R=h*pr(b),j=h*_r(b);if(g<yr)if(D=function(t,e,n,i,r,a,o,s){var l=n-t,c=i-e,u=o-r,h=s-a,f=h*l-u*c;if(!(f*f<vr))return[t+(f=(u*(e-a)-h*(t-r))/f)*l,e+f*c]}(L,F,R,j,z,I,O,G)){var B=L-D[0],q=F-D[1],U=z-D[0],W=I-D[1],H=1/_r(function(t){return t>1?0:t<-1?yr:Math.acos(t)}((B*U+q*W)/(mr(B*B+q*q)*mr(U*U+W*W)))/2),V=mr(D[0]*D[0]+D[1]*D[1]);k=gr(A,(h-V)/(H-1)),T=gr(A,(f-V)/(H+1))}else k=T=0}M>vr?T>vr?(m=Gr(R,j,L,F,f,T,_),v=Gr(z,I,O,G,f,T,_),s.moveTo(m.cx+m.x01,m.cy+m.y01),T<A?s.arc(m.cx,m.cy,T,fr(m.y01,m.x01),fr(v.y01,v.x01),!_):(s.arc(m.cx,m.cy,T,fr(m.y01,m.x01),fr(m.y11,m.x11),!_),s.arc(0,0,f,fr(m.cy+m.y11,m.cx+m.x11),fr(v.cy+v.y11,v.cx+v.x11),!_),s.arc(v.cx,v.cy,T,fr(v.y11,v.x11),fr(v.y01,v.x01),!_))):(s.moveTo(L,F),s.arc(0,0,f,y,x,!_)):s.moveTo(L,F),h>vr&&S>vr?k>vr?(m=Gr(O,G,z,I,h,-k,_),v=Gr(L,F,R,j,h,-k,_),s.lineTo(m.cx+m.x01,m.cy+m.y01),k<A?s.arc(m.cx,m.cy,k,fr(m.y01,m.x01),fr(v.y01,v.x01),!_):(s.arc(m.cx,m.cy,k,fr(m.y01,m.x01),fr(m.y11,m.x11),!_),s.arc(0,0,h,fr(m.cy+m.y11,m.cx+m.x11),fr(v.cy+v.y11,v.cx+v.x11),_),s.arc(v.cx,v.cy,k,fr(v.y11,v.x11),fr(v.y01,v.x01),!_))):s.arc(0,0,h,w,b,_):s.lineTo(O,G)}else s.moveTo(0,0);if(s.closePath(),c)return s=null,c+""||null}return c.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +a.apply(this,arguments))/2-yr/2;return[pr(i)*n,_r(i)*n]},c.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:ur(+e),c):t},c.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:ur(+t),c):e},c.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:ur(+t),c):n},c.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:ur(+t),c):i},c.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:ur(+t),c):r},c.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:ur(+t),c):a},c.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:ur(+t),c):o},c.context=function(t){return arguments.length?(s=null==t?null:t,c):s},c}const zr={capture:!0,passive:!1};function Ir(t){t.preventDefault(),t.stopImmediatePropagation()}function Rr(t){return((t=Math.exp(t))+1/t)/2}const jr=function t(e,n,i){function r(t,r){var a,o,s=t[0],l=t[1],c=t[2],u=r[0],h=r[1],f=r[2],p=u-s,d=h-l,g=p*p+d*d;if(g<1e-12)o=Math.log(f/c)/e,a=function(t){return[s+t*p,l+t*d,c*Math.exp(e*t*o)]};else{var _=Math.sqrt(g),m=(f*f-c*c+i*g)/(2*c*n*_),v=(f*f-c*c-i*g)/(2*f*n*_),y=Math.log(Math.sqrt(m*m+1)-m),x=Math.log(Math.sqrt(v*v+1)-v);o=(x-y)/e,a=function(t){var i=t*o,r=Rr(y),a=c/(n*_)*(r*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(e*i+y)-function(t){return((t=Math.exp(t))-1/t)/2}(y));return[s+a*p,l+a*d,c*r/Rr(e*i+y)]}}return a.duration=1e3*o*e/Math.SQRT2,a}return r.rho=function(e){var n=Math.max(.001,+e),i=n*n;return t(n,i,i*i)},r}(Math.SQRT2,2,4);function Br(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}const qr=t=>()=>t;function Ur(t,{sourceEvent:e,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function Wr(t,e,n){this.k=t,this.x=e,this.y=n}Wr.prototype={constructor:Wr,scale:function(t){return 1===t?this:new Wr(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Wr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Hr=new Wr(1,0,0);function Vr(t){t.stopImmediatePropagation()}function $r(t){t.preventDefault(),t.stopImmediatePropagation()}function Jr(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Yr(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Xr(){return this.__zoom||Hr}function Kr(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Zr(){return navigator.maxTouchPoints||"ontouchstart"in this}function Qr(t,e,n){var i=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],a=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function ta(){var t,e,n,i=Jr,r=Yr,a=Qr,o=Kr,s=Zr,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,h=jr,f=ei("start","zoom","end"),p=0,d=10;function g(t){t.property("__zoom",Xr).on("wheel.zoom",w,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",M).filter(s).on("touchstart.zoom",E).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new Wr(e,t.x,t.y)}function m(t,e,n){var i=e[0]-n[0]*t.k,r=e[1]-n[1]*t.k;return i===t.x&&r===t.y?t:new Wr(t.k,i,r)}function v(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function y(t,e,n,i){t.on("start.zoom",(function(){x(this,arguments).event(i).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).event(i).end()})).tween("zoom",(function(){var t=this,a=arguments,o=x(t,a).event(i),s=r.apply(t,a),l=null==n?v(s):"function"==typeof n?n.apply(t,a):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=t.__zoom,f="function"==typeof e?e.apply(t,a):e,p=h(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(t){if(1===t)t=f;else{var e=p(t),n=c/e[2];t=new Wr(n,l[0]-e[0]*n,l[1]-e[1]*n)}o.zoom(null,t)}}))}function x(t,e,n){return!n&&t.__zooming||new b(t,e)}function b(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=r.apply(t,e),this.taps=0}function w(t,...e){if(i.apply(this,arguments)){var n=x(this,e).event(t),r=this.__zoom,s=Math.max(l[0],Math.min(l[1],r.k*Math.pow(2,o.apply(this,arguments)))),u=Br(t);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=r.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(r.k===s)return;n.mouse=[u,r.invert(u)],Ci(this),n.start()}$r(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),150),n.zoom("mouse",a(m(_(r,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function S(t,...e){if(!n&&i.apply(this,arguments)){var r=t.currentTarget,o=x(this,e,!0).event(t),s=Ft(t.view).on("mousemove.zoom",(function(t){if($r(t),!o.moved){var e=t.clientX-u,n=t.clientY-h;o.moved=e*e+n*n>p}o.event(t).zoom("mouse",a(m(o.that.__zoom,o.mouse[0]=Br(t,r),o.mouse[1]),o.extent,c))}),!0).on("mouseup.zoom",(function(t){s.on("mousemove.zoom mouseup.zoom",null),function(t,e){var n=t.document.documentElement,i=Ft(t).on("dragstart.drag",null);e&&(i.on("click.drag",Ir,zr),setTimeout((function(){i.on("click.drag",null)}),0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(t.view,o.moved),$r(t),o.event(t).end()}),!0),l=Br(t,r),u=t.clientX,h=t.clientY;!function(t){var e=t.document.documentElement,n=Ft(t).on("dragstart.drag",Ir,zr);"onselectstart"in e?n.on("selectstart.drag",Ir,zr):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),Vr(t),o.mouse=[l,this.__zoom.invert(l)],Ci(this),o.start()}}function M(t,...e){if(i.apply(this,arguments)){var n=this.__zoom,o=Br(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(o),l=n.k*(t.shiftKey?.5:2),h=a(m(_(n,l),o,s),r.apply(this,e),c);$r(t),u>0?Ft(this).transition().duration(u).call(y,h,o,t):Ft(this).call(g.transform,h,o,t)}}function E(n,...r){if(i.apply(this,arguments)){var a,o,s,l,c=n.touches,u=c.length,h=x(this,r,n.changedTouches.length===u).event(n);for(Vr(n),o=0;o<u;++o)l=[l=Br(s=c[o],this),this.__zoom.invert(l),s.identifier],h.touch0?h.touch1||h.touch0[2]===l[2]||(h.touch1=l,h.taps=0):(h.touch0=l,a=!0,h.taps=1+!!t);t&&(t=clearTimeout(t)),a&&(h.taps<2&&(e=l[0],t=setTimeout((function(){t=null}),500)),Ci(this),h.start())}}function C(t,...e){if(this.__zooming){var n,i,r,o,s=x(this,e).event(t),l=t.changedTouches,u=l.length;for($r(t),n=0;n<u;++n)r=Br(i=l[n],this),s.touch0&&s.touch0[2]===i.identifier?s.touch0[0]=r:s.touch1&&s.touch1[2]===i.identifier&&(s.touch1[0]=r);if(i=s.that.__zoom,s.touch1){var h=s.touch0[0],f=s.touch0[1],p=s.touch1[0],d=s.touch1[1],g=(g=p[0]-h[0])*g+(g=p[1]-h[1])*g,v=(v=d[0]-f[0])*v+(v=d[1]-f[1])*v;i=_(i,Math.sqrt(g/v)),r=[(h[0]+p[0])/2,(h[1]+p[1])/2],o=[(f[0]+d[0])/2,(f[1]+d[1])/2]}else{if(!s.touch0)return;r=s.touch0[0],o=s.touch0[1]}s.zoom("touch",a(m(i,r,o),s.extent,c))}}function A(t,...i){if(this.__zooming){var r,a,o=x(this,i).event(t),s=t.changedTouches,l=s.length;for(Vr(t),n&&clearTimeout(n),n=setTimeout((function(){n=null}),500),r=0;r<l;++r)a=s[r],o.touch0&&o.touch0[2]===a.identifier?delete o.touch0:o.touch1&&o.touch1[2]===a.identifier&&delete o.touch1;if(o.touch1&&!o.touch0&&(o.touch0=o.touch1,delete o.touch1),o.touch0)o.touch0[1]=this.__zoom.invert(o.touch0[0]);else if(o.end(),2===o.taps&&(a=Br(a,this),Math.hypot(e[0]-a[0],e[1]-a[1])<d)){var c=Ft(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return g.transform=function(t,e,n,i){var r=t.selection?t.selection():t;r.property("__zoom",Xr),t!==r?y(t,e,n,i):r.interrupt().each((function(){x(this,arguments).event(i).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},g.scaleBy=function(t,e,n,i){g.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),n,i)},g.scaleTo=function(t,e,n,i){g.transform(t,(function(){var t=r.apply(this,arguments),i=this.__zoom,o=null==n?v(t):"function"==typeof n?n.apply(this,arguments):n,s=i.invert(o),l="function"==typeof e?e.apply(this,arguments):e;return a(m(_(i,l),o,s),t,c)}),n,i)},g.translateBy=function(t,e,n,i){g.transform(t,(function(){return a(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),c)}),null,i)},g.translateTo=function(t,e,n,i,o){g.transform(t,(function(){var t=r.apply(this,arguments),o=this.__zoom,s=null==i?v(t):"function"==typeof i?i.apply(this,arguments):i;return a(Hr.translate(s[0],s[1]).scale(o.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,c)}),i,o)},b.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=Ft(this.that).datum();f.call(t,this.that,new Ur(t,{sourceEvent:this.sourceEvent,target:g,type:t,transform:this.that.__zoom,dispatch:f}),e)}},g.wheelDelta=function(t){return arguments.length?(o="function"==typeof t?t:qr(+t),g):o},g.filter=function(t){return arguments.length?(i="function"==typeof t?t:qr(!!t),g):i},g.touchable=function(t){return arguments.length?(s="function"==typeof t?t:qr(!!t),g):s},g.extent=function(t){return arguments.length?(r="function"==typeof t?t:qr([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),g):r},g.scaleExtent=function(t){return arguments.length?(l[0]=+t[0],l[1]=+t[1],g):[l[0],l[1]]},g.translateExtent=function(t){return arguments.length?(c[0][0]=+t[0][0],c[1][0]=+t[1][0],c[0][1]=+t[0][1],c[1][1]=+t[1][1],g):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},g.constrain=function(t){return arguments.length?(a=t,g):a},g.duration=function(t){return arguments.length?(u=+t,g):u},g.interpolate=function(t){return arguments.length?(h=t,g):h},g.on=function(){var t=f.on.apply(f,arguments);return t===f?g:t},g.clickDistance=function(t){return arguments.length?(p=(t=+t)*t,g):Math.sqrt(p)},g.tapDistance=function(t){return arguments.length?(d=+t,g):d},g}function ea(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return na(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?na(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function na(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function ia(t,e,n){if(!t.startsWith(".")&&!t.startsWith("#"))throw new Error('Invalid selector: Must start with "." for classes or "#" for IDs.');for(var i=0,r=Array.from(document.styleSheets);i<r.length;i++){var a=r[i];try{var o,s=ea(a.cssRules||a.rules);try{for(s.s();!(o=s.n()).done;){var l=o.value;if(l.selectorText===t)return void(l.style[e]=n)}}catch(t){s.e(t)}finally{s.f()}}catch(t){console.warn("Could not access rules in stylesheet:",t)}}var c=document.getElementById("custom-styles");c||((c=document.createElement("style")).id="custom-styles",document.head.appendChild(c));try{c.sheet.insertRule("".concat(t," { ").concat(e,": ").concat(n,"; }"),c.sheet.cssRules.length)}catch(i){console.error("Failed to insert rule: ".concat(t," { ").concat(e,": ").concat(n,"; }"),i)}}Wr.prototype;var ra=function(t){var e=document.createElement("div");e.className=t,e.style.position="absolute",e.style.visibility="hidden",e.style.height="auto",e.style.width="auto",e.style.lineHeight="normal",e.style.fontSize="initial",document.body.appendChild(e);var n=parseFloat(window.getComputedStyle(e).fontSize);return document.body.removeChild(e),n||0},aa=function(t,e){var n=document.createElement("div");n.className=t,n.style.position="absolute",n.style.visibility="hidden",n.style.height="auto",n.style.lineHeight="normal",document.body.appendChild(n);var i=window.getComputedStyle(n).getPropertyValue(e);return document.body.removeChild(n),i||null};function oa(t){var e=[],n=function(){var t,e=[],n=ea(document.styleSheets);try{for(n.s();!(t=n.n()).done;){var i=t.value;try{var r,a=ea(i.cssRules);try{for(a.s();!(r=a.n()).done;){var o=r.value;e.push(o)}}catch(t){a.e(t)}finally{a.f()}}catch(t){console.warn("Unable to access stylesheet:",i.href,t)}}}catch(t){n.e(t)}finally{n.f()}return e}();n.forEach((function(n){t.matches(n.selectorText)&&e.push(n.style)}));var i={};return e.forEach((function(t){for(var e=0;e<t.length;e++){var n=t[e];i[n]=t.getPropertyValue(n)}})),i}var sa=function(t){t.querySelectorAll("*").forEach((function(t){var e=oa(t);Object.keys(e).forEach((function(n){var i=e[n];!t.style.getPropertyValue(n)&&i&&t.style.setProperty(n,i)}))}))},la=function(t){return t.toLocaleString("en").replace(/,/gi," ")};function ca(t){return"".concat(t,"-").concat(Math.random().toString(36).substr(2,9))}var ua=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;for(var a in t){var o=t[a];Array.isArray(o)?o.forEach((function(t){Array.isArray(t)?t.forEach((function(t){t.svgId_!==e&&n(t,i,r)})):t.svgId_!==e&&n(t,i,r)})):o.svgId_!==e&&n(o,i,r)}};function ha(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(location.search);return e?decodeURIComponent(e[1].replace(/\+/g," ")):null}var fa=function(t){var e,n,i;if(!t.startsWith("rgb")&&!t.startsWith("#")){var r=document.createElement("div");r.style.color=t,document.body.appendChild(r);var a=window.getComputedStyle(r).color;document.body.removeChild(r),t=a}if(t.startsWith("#")){var o=t.replace("#","");3===o.length&&(o=o.split("").map((function(t){return t+t})).join("")),e=parseInt(o.substring(0,2),16),n=parseInt(o.substring(2,4),16),i=parseInt(o.substring(4,6),16)}else{var s=t.match(/\d+/g);e=parseInt(s[0]),n=parseInt(s[1]),i=parseInt(s[2])}return e/255*.2126+n/255*.7152+i/255*.0722>.5?"black":"white"},pa=function(t){return t.Geometries.userGeometries?"#em-user-regions path":t.gridCartogram_?"#em-grid-container .em-grid-cell":"WORLD"===t.geo_?"#em-worldrg path":"#em-nutsrg path:not(#em-cntrg-RS):not(#em-cntrg-EL), #em-cntrg path:not(#em-cntrg-RS):not(#em-cntrg-EL)"},da=function(t){return t.Geometries.userGeometries?"#em-user-regions":t.gridCartogram_?"#em-grid-container":"WORLD"===t.geo_?"#em-worldrg":"#em-nutsrg, #em-cntrg"};function ga(t){return ga="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ga(t)}function _a(t){var e=function(t,e){if("object"!=ga(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=ga(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ga(e)?e:e+""}function ma(t,e,n){return(e=_a(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function va(t){return"string"==typeof t?new Pt([document.querySelectorAll(t)],[document.documentElement]):new Pt([w(t)],Tt)}class ya{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let i=0;i<this._n&&i<32;i++){const r=e[i],a=t+r,o=Math.abs(t)<Math.abs(r)?t-(a-r):r-(a-t);o&&(e[n++]=o),t=a}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,i,r=this._n,a=0;if(r>0){for(a=t[--r];r>0&&(e=a,n=t[--r],a=e+n,i=n-(a-e),!i););r>0&&(i<0&&t[r-1]<0||i>0&&t[r-1]>0)&&(n=2*i,e=a+n,n==e-a&&(a=e))}return a}}var xa=1e-6,ba=1e-12,wa=Math.PI,Sa=wa/2,Ma=wa/4,Ea=2*wa,Ca=180/wa,Aa=wa/180,ka=Math.abs,Ta=Math.atan,Pa=Math.atan2,Na=Math.cos,La=Math.ceil,Fa=(Math.exp,Math.floor,Math.hypot),Oa=(Math.log,Math.pow,Math.sin),Ga=Math.sign||function(t){return t>0?1:t<0?-1:0},Da=Math.sqrt;Math.tan;function za(t){return t>1?Sa:t<-1?-Sa:Math.asin(t)}function Ia(){}function Ra(t,e){t&&io.hasOwnProperty(t.type)&&io[t.type](t,e)}var ja,Ba,qa,Ua,Wa,Ha,Va,$a,Ja,Ya,Xa,Ka,Za,Qa,to,eo,no={Feature:function(t,e){Ra(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)Ra(n[i].geometry,e)}},io={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){ro(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)ro(n[i],e,0)},Polygon:function(t,e){ao(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)ao(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)Ra(n[i],e)}};function ro(t,e,n){var i,r=-1,a=t.length-n;for(e.lineStart();++r<a;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function ao(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)ro(t[n],e,1);e.polygonEnd()}function oo(t,e){t&&no.hasOwnProperty(t.type)?no[t.type](t,e):Ra(t,e)}var so={sphere:Ia,point:lo,lineStart:uo,lineEnd:po,polygonStart:function(){so.lineStart=go,so.lineEnd=_o},polygonEnd:function(){so.lineStart=uo,so.lineEnd=po}};function lo(t,e){t*=Aa;var n=Na(e*=Aa);co(n*Na(t),n*Oa(t),Oa(e))}function co(t,e,n){++ja,qa+=(t-qa)/ja,Ua+=(e-Ua)/ja,Wa+=(n-Wa)/ja}function uo(){so.point=ho}function ho(t,e){t*=Aa;var n=Na(e*=Aa);Qa=n*Na(t),to=n*Oa(t),eo=Oa(e),so.point=fo,co(Qa,to,eo)}function fo(t,e){t*=Aa;var n=Na(e*=Aa),i=n*Na(t),r=n*Oa(t),a=Oa(e),o=Pa(Da((o=to*a-eo*r)*o+(o=eo*i-Qa*a)*o+(o=Qa*r-to*i)*o),Qa*i+to*r+eo*a);Ba+=o,Ha+=o*(Qa+(Qa=i)),Va+=o*(to+(to=r)),$a+=o*(eo+(eo=a)),co(Qa,to,eo)}function po(){so.point=lo}function go(){so.point=mo}function _o(){vo(Ka,Za),so.point=lo}function mo(t,e){Ka=t,Za=e,t*=Aa,e*=Aa,so.point=vo;var n=Na(e);Qa=n*Na(t),to=n*Oa(t),eo=Oa(e),co(Qa,to,eo)}function vo(t,e){t*=Aa;var n=Na(e*=Aa),i=n*Na(t),r=n*Oa(t),a=Oa(e),o=to*a-eo*r,s=eo*i-Qa*a,l=Qa*r-to*i,c=Fa(o,s,l),u=za(c),h=c&&-u/c;Ja.add(h*o),Ya.add(h*s),Xa.add(h*l),Ba+=u,Ha+=u*(Qa+(Qa=i)),Va+=u*(to+(to=r)),$a+=u*(eo+(eo=a)),co(Qa,to,eo)}function yo(t){ja=Ba=qa=Ua=Wa=Ha=Va=$a=0,Ja=new ya,Ya=new ya,Xa=new ya,oo(t,so);var e=+Ja,n=+Ya,i=+Xa,r=Fa(e,n,i);return r<ba&&(e=Ha,n=Va,i=$a,Ba<xa&&(e=qa,n=Ua,i=Wa),(r=Fa(e,n,i))<ba)?[NaN,NaN]:[Pa(n,e)*Ca,za(i/r)*Ca]}function xo(){var t,e=[];return{point:function(e,n,i){t.push([e,n,i])},lineStart:function(){e.push(t=[])},lineEnd:Ia,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function bo(t,e){return ka(t[0]-e[0])<xa&&ka(t[1]-e[1])<xa}function wo(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function So(t,e,n,i,r){var a,o,s=[],l=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,i=t[0],o=t[e];if(bo(i,o)){if(!i[2]&&!o[2]){for(r.lineStart(),a=0;a<e;++a)r.point((i=t[a])[0],i[1]);return void r.lineEnd()}o[0]+=2e-6}s.push(n=new wo(i,t,null,!0)),l.push(n.o=new wo(i,null,n,!1)),s.push(n=new wo(o,t,null,!1)),l.push(n.o=new wo(o,null,n,!0))}})),s.length){for(l.sort(e),Mo(s),Mo(l),a=0,o=l.length;a<o;++a)l[a].e=n=!n;for(var c,u,h=s[0];;){for(var f=h,p=!0;f.v;)if((f=f.n)===h)return;c=f.z,r.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(a=0,o=c.length;a<o;++a)r.point((u=c[a])[0],u[1]);else i(f.x,f.n.x,1,r);f=f.n}else{if(p)for(c=f.p.z,a=c.length-1;a>=0;--a)r.point((u=c[a])[0],u[1]);else i(f.x,f.p.x,-1,r);f=f.p}c=(f=f.o).z,p=!p}while(!f.v);r.lineEnd()}}}function Mo(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i<e;)r.n=n=t[i],n.p=r,r=n;r.n=n=t[0],n.p=r}}function Eo(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}var Co=1e9,Ao=-Co;function ko(t,e,n,i){function r(r,a){return t<=r&&r<=n&&e<=a&&a<=i}function a(r,a,s,c){var u=0,h=0;if(null==r||(u=o(r,s))!==(h=o(a,s))||l(r,a)<0^s>0)do{c.point(0===u||3===u?t:n,u>1?i:e)}while((u=(u+s+4)%4)!==h);else c.point(a[0],a[1])}function o(i,r){return ka(i[0]-t)<xa?r>0?0:3:ka(i[0]-n)<xa?r>0?2:1:ka(i[1]-e)<xa?r>0?1:0:r>0?3:2}function s(t,e){return l(t.x,e.x)}function l(t,e){var n=o(t,1),i=o(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var l,c,u,h,f,p,d,g,_,m,v,y=o,x=xo(),b={point:w,lineStart:function(){b.point=S,c&&c.push(u=[]);m=!0,_=!1,d=g=NaN},lineEnd:function(){l&&(S(h,f),p&&_&&x.rejoin(),l.push(x.result()));b.point=w,_&&y.lineEnd()},polygonStart:function(){y=x,l=[],c=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,r=c.length;n<r;++n)for(var a,o,s=c[n],l=1,u=s.length,h=s[0],f=h[0],p=h[1];l<u;++l)a=f,o=p,f=(h=s[l])[0],p=h[1],o<=i?p>i&&(f-a)*(i-o)>(p-o)*(t-a)&&++e:p<=i&&(f-a)*(i-o)<(p-o)*(t-a)&&--e;return e}(),n=v&&e,r=(l=Eo(l)).length;(n||r)&&(o.polygonStart(),n&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),r&&So(l,s,e,a,o),o.polygonEnd());y=o,l=c=u=null}};function w(t,e){r(t,e)&&y.point(t,e)}function S(a,o){var s=r(a,o);if(c&&u.push([a,o]),m)h=a,f=o,p=s,m=!1,s&&(y.lineStart(),y.point(a,o));else if(s&&_)y.point(a,o);else{var l=[d=Math.max(Ao,Math.min(Co,d)),g=Math.max(Ao,Math.min(Co,g))],x=[a=Math.max(Ao,Math.min(Co,a)),o=Math.max(Ao,Math.min(Co,o))];!function(t,e,n,i,r,a){var o,s=t[0],l=t[1],c=0,u=1,h=e[0]-s,f=e[1]-l;if(o=n-s,h||!(o>0)){if(o/=h,h<0){if(o<c)return;o<u&&(u=o)}else if(h>0){if(o>u)return;o>c&&(c=o)}if(o=r-s,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o<c)return;o<u&&(u=o)}if(o=i-l,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<u&&(u=o)}else if(f>0){if(o>u)return;o>c&&(c=o)}if(o=a-l,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<u&&(u=o)}return c>0&&(t[0]=s+c*h,t[1]=l+c*f),u<1&&(e[0]=s+u*h,e[1]=l+u*f),!0}}}}}(l,x,t,e,n,i)?s&&(y.lineStart(),y.point(a,o),v=!1):(_||(y.lineStart(),y.point(l[0],l[1])),y.point(x[0],x[1]),s||y.lineEnd(),v=!1)}d=a,g=o,_=s}return b}}const To=t=>t;function Po(t){return function(e){var n=new No;for(var i in t)n[i]=t[i];return n.stream=e,n}}function No(){}No.prototype={constructor:No,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Lo=1/0,Fo=Lo,Oo=-Lo,Go=Oo,Do={point:function(t,e){t<Lo&&(Lo=t);t>Oo&&(Oo=t);e<Fo&&(Fo=e);e>Go&&(Go=e)},lineStart:Ia,lineEnd:Ia,polygonStart:Ia,polygonEnd:Ia,result:function(){var t=[[Lo,Fo],[Oo,Go]];return Oo=Go=-(Fo=Lo=1/0),t}};const zo=Do;function Io(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),oo(n,t.stream(zo)),e(zo.result()),null!=i&&t.clipExtent(i),t}function Ro(t,e,n){return Io(t,(function(n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],a=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),o=+e[0][0]+(i-a*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(r-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([o,s])}),n)}function jo(t,e,n){return Ro(t,[[0,0],e],n)}function Bo(t,e,n){return Io(t,(function(n){var i=+e,r=i/(n[1][0]-n[0][0]),a=(i-r*(n[1][0]+n[0][0]))/2,o=-r*n[0][1];t.scale(150*r).translate([a,o])}),n)}function qo(t,e,n){return Io(t,(function(n){var i=+e,r=i/(n[1][1]-n[0][1]),a=-r*n[0][0],o=(i-r*(n[1][1]+n[0][1]))/2;t.scale(150*r).translate([a,o])}),n)}var Uo,Wo,Ho,Vo,$o=new ya,Jo=new ya,Yo={point:Ia,lineStart:Ia,lineEnd:Ia,polygonStart:function(){Yo.lineStart=Xo,Yo.lineEnd=Qo},polygonEnd:function(){Yo.lineStart=Yo.lineEnd=Yo.point=Ia,$o.add(ka(Jo)),Jo=new ya},result:function(){var t=$o/2;return $o=new ya,t}};function Xo(){Yo.point=Ko}function Ko(t,e){Yo.point=Zo,Uo=Ho=t,Wo=Vo=e}function Zo(t,e){Jo.add(Vo*t-Ho*e),Ho=t,Vo=e}function Qo(){Zo(Uo,Wo)}const ts=Yo;var es,ns,is,rs,as=0,os=0,ss=0,ls=0,cs=0,us=0,hs=0,fs=0,ps=0,ds={point:gs,lineStart:_s,lineEnd:ys,polygonStart:function(){ds.lineStart=xs,ds.lineEnd=bs},polygonEnd:function(){ds.point=gs,ds.lineStart=_s,ds.lineEnd=ys},result:function(){var t=ps?[hs/ps,fs/ps]:us?[ls/us,cs/us]:ss?[as/ss,os/ss]:[NaN,NaN];return as=os=ss=ls=cs=us=hs=fs=ps=0,t}};function gs(t,e){as+=t,os+=e,++ss}function _s(){ds.point=ms}function ms(t,e){ds.point=vs,gs(is=t,rs=e)}function vs(t,e){var n=t-is,i=e-rs,r=Da(n*n+i*i);ls+=r*(is+t)/2,cs+=r*(rs+e)/2,us+=r,gs(is=t,rs=e)}function ys(){ds.point=gs}function xs(){ds.point=ws}function bs(){Ss(es,ns)}function ws(t,e){ds.point=Ss,gs(es=is=t,ns=rs=e)}function Ss(t,e){var n=t-is,i=e-rs,r=Da(n*n+i*i);ls+=r*(is+t)/2,cs+=r*(rs+e)/2,us+=r,hs+=(r=rs*t-is*e)*(is+t),fs+=r*(rs+e),ps+=3*r,gs(is=t,rs=e)}const Ms=ds;function Es(t){this._context=t}Es.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Ea)}},result:Ia};var Cs,As,ks,Ts,Ps,Ns=new ya,Ls={point:Ia,lineStart:function(){Ls.point=Fs},lineEnd:function(){Cs&&Os(As,ks),Ls.point=Ia},polygonStart:function(){Cs=!0},polygonEnd:function(){Cs=null},result:function(){var t=+Ns;return Ns=new ya,t}};function Fs(t,e){Ls.point=Os,As=Ts=t,ks=Ps=e}function Os(t,e){Ts-=t,Ps-=e,Ns.add(Da(Ts*Ts+Ps*Ps)),Ts=t,Ps=e}const Gs=Ls;let Ds,zs,Is,Rs;class js{constructor(t){this._append=null==t?Bs:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return Bs;if(e!==Ds){const t=10**e;Ds=e,zs=function(e){let n=1;this._+=e[0];for(const i=e.length;n<i;++n)this._+=Math.round(arguments[n]*t)/t+e[n]}}return zs}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append`M${t},${e}`,this._point=1;break;case 1:this._append`L${t},${e}`;break;default:if(this._append`M${t},${e}`,this._radius!==Is||this._append!==zs){const t=this._radius,e=this._;this._="",this._append`m0,${t}a${t},${t} 0 1,1 0,${-2*t}a${t},${t} 0 1,1 0,${2*t}z`,Is=t,zs=this._append,Rs=this._,this._=e}this._+=Rs}}result(){const t=this._;return this._="",t.length?t:null}}function Bs(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function qs(t,e){let n,i,r=3,a=4.5;function o(t){return t&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),oo(t,n(i))),i.result()}return o.area=function(t){return oo(t,n(ts)),ts.result()},o.measure=function(t){return oo(t,n(Gs)),Gs.result()},o.bounds=function(t){return oo(t,n(zo)),zo.result()},o.centroid=function(t){return oo(t,n(Ms)),Ms.result()},o.projection=function(e){return arguments.length?(n=null==e?(t=null,To):(t=e).stream,o):t},o.context=function(t){return arguments.length?(i=null==t?(e=null,new js(r)):new Es(e=t),"function"!=typeof a&&i.pointRadius(a),o):e},o.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),o):a},o.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);r=e}return null===e&&(i=new js(r)),o},o.projection(t).digits(r).context(e)}function Us(){}function Ws(){var t,e=[];return{point:function(e,n,i){t.push([e,n,i])},lineStart:function(){e.push(t=[])},lineEnd:Us,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}var Hs=1e-6,Vs=Math.PI,$s=Vs/2,Js=Vs/4,Ys=2*Vs,Xs=180/Vs,Ks=Vs/180,Zs=Math.abs,Qs=Math.atan,tl=Math.atan2,el=Math.cos,nl=(Math.ceil,Math.exp,Math.floor,Math.hypot,Math.log,Math.pow,Math.sin),il=Math.sign||function(t){return t>0?1:t<0?-1:0},rl=Math.sqrt;Math.tan;function al(t){return t>1?$s:t<-1?-$s:Math.asin(t)}function ol(t,e){return Zs(t[0]-e[0])<Hs&&Zs(t[1]-e[1])<Hs}function sl(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function ll(t,e,n,i,r){var a,o,s=[],l=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,i=t[0],o=t[e];if(ol(i,o)){if(!i[2]&&!o[2]){for(r.lineStart(),a=0;a<e;++a)r.point((i=t[a])[0],i[1]);return void r.lineEnd()}o[0]+=2e-6}s.push(n=new sl(i,t,null,!0)),l.push(n.o=new sl(i,null,n,!1)),s.push(n=new sl(o,t,null,!1)),l.push(n.o=new sl(o,null,n,!0))}})),s.length){for(l.sort(e),cl(s),cl(l),a=0,o=l.length;a<o;++a)l[a].e=n=!n;for(var c,u,h=s[0];;){for(var f=h,p=!0;f.v;)if((f=f.n)===h)return;c=f.z,r.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(a=0,o=c.length;a<o;++a)r.point((u=c[a])[0],u[1]);else i(f.x,f.n.x,1,r);f=f.n}else{if(p)for(c=f.p.z,a=c.length-1;a>=0;--a)r.point((u=c[a])[0],u[1]);else i(f.x,f.p.x,-1,r);f=f.p}c=(f=f.o).z,p=!p}while(!f.v);r.lineEnd()}}}function cl(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i<e;)r.n=n=t[i],n.p=r,r=n;r.n=n=t[0],n.p=r}}class ul{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let i=0;i<this._n&&i<32;i++){const r=e[i],a=t+r,o=Math.abs(t)<Math.abs(r)?t-(a-r):r-(a-t);o&&(e[n++]=o),t=a}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,i,r=this._n,a=0;if(r>0){for(a=t[--r];r>0&&(e=a,n=t[--r],a=e+n,i=n-(a-e),!i););r>0&&(i<0&&t[r-1]<0||i>0&&t[r-1]>0)&&(n=2*i,e=a+n,n==e-a&&(a=e))}return a}}function hl(t){return[tl(t[1],t[0]),al(t[2])]}function fl(t){var e=t[0],n=t[1],i=el(n);return[i*el(e),i*nl(e),nl(n)]}function pl(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function dl(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function gl(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function _l(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function ml(t){var e=rl(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function vl(t){return Zs(t[0])<=Vs?t[0]:il(t[0])*((Zs(t[0])+Vs)%Ys-Vs)}function yl(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function xl(t,e,n,i){return function(r){var a,o,s,l=e(r),c=Ws(),u=e(c),h=!1,f={point:p,lineStart:g,lineEnd:_,polygonStart:function(){f.point=m,f.lineStart=v,f.lineEnd=y,o=[],a=[]},polygonEnd:function(){f.point=p,f.lineStart=g,f.lineEnd=_,o=yl(o);var t=function(t,e){var n=vl(e),i=e[1],r=nl(i),a=[nl(n),-el(n),0],o=0,s=0,l=new ul;1===r?i=$s+Hs:-1===r&&(i=-$s-Hs);for(var c=0,u=t.length;c<u;++c)if(f=(h=t[c]).length)for(var h,f,p=h[f-1],d=vl(p),g=p[1]/2+Js,_=nl(g),m=el(g),v=0;v<f;++v,d=x,_=w,m=S,p=y){var y=h[v],x=vl(y),b=y[1]/2+Js,w=nl(b),S=el(b),M=x-d,E=M>=0?1:-1,C=E*M,A=C>Vs,k=_*w;if(l.add(tl(k*E*nl(C),m*S+k*el(C))),o+=A?M+E*Ys:M,A^d>=n^x>=n){var T=dl(fl(p),fl(y));ml(T);var P=dl(a,T);ml(P);var N=(A^M>=0?-1:1)*al(P[2]);(i>N||i===N&&(T[0]||T[1]))&&(s+=A^M>=0?1:-1)}}return(o<-1e-6||o<Hs&&l<-1e-12)^1&s}(a,i);o.length?(h||(r.polygonStart(),h=!0),ll(o,wl,t,n,r)):t&&(h||(r.polygonStart(),h=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),h&&(r.polygonEnd(),h=!1),o=a=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function p(e,n){t(e,n)&&r.point(e,n)}function d(t,e){l.point(t,e)}function g(){f.point=d,l.lineStart()}function _(){f.point=p,l.lineEnd()}function m(t,e){s.push([t,e]),u.point(t,e)}function v(){u.lineStart(),s=[]}function y(){m(s[0][0],s[0][1]),u.lineEnd();var t,e,n,i,l=u.clean(),f=c.result(),p=f.length;if(s.pop(),a.push(s),s=null,p)if(1&l){if((e=(n=f[0]).length-1)>0){for(h||(r.polygonStart(),h=!0),r.lineStart(),t=0;t<e;++t)r.point((i=n[t])[0],i[1]);r.lineEnd()}}else p>1&&2&l&&f.push(f.pop().concat(f.shift())),o.push(f.filter(bl))}return f}}function bl(t){return t.length>1}function wl(t,e){return((t=t.x)[0]<0?t[1]-$s-Hs:$s-t[1])-((e=e.x)[0]<0?e[1]-$s-Hs:$s-e[1])}const Sl=xl((function(){return!0}),(function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?Vs:-Vs,l=Zs(a-n);Zs(l-Vs)<Hs?(t.point(n,i=(i+o)/2>0?$s:-$s),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(s,i),t.point(a,i),e=0):r!==s&&l>=Vs&&(Zs(n-r)<Hs&&(n-=r*Hs),Zs(a-s)<Hs&&(a-=s*Hs),i=function(t,e,n,i){var r,a,o=nl(t-n);return Zs(o)>Hs?Qs((nl(e)*(a=el(i))*nl(n)-nl(i)*(r=el(e))*nl(t))/(r*a*o)):(e+i)/2}(n,i,a,o),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(s,i),e=0),t.point(n=a,i=o),r=s},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}}),(function(t,e,n,i){var r;if(null==t)r=n*$s,i.point(-Vs,r),i.point(0,r),i.point(Vs,r),i.point(Vs,0),i.point(Vs,-r),i.point(0,-r),i.point(-Vs,-r),i.point(-Vs,0),i.point(-Vs,r);else if(Zs(t[0]-e[0])>Hs){var a=t[0]<e[0]?Vs:-Vs;r=n*a/2,i.point(-a,r),i.point(0,r),i.point(a,r)}else i.point(e[0],e[1])}),[-Vs,-$s]);function Ml(t,e,n,i,r,a){if(n){var o=el(e),s=nl(e),l=i*n;null==r?(r=e+i*Ys,a=e-l/2):(r=El(o,r),a=El(o,a),(i>0?r<a:r>a)&&(r+=i*Ys));for(var c,u=r;i>0?u>a:u<a;u-=l)c=hl([o,-s*el(u),-s*nl(u)]),t.point(c[0],c[1])}}function El(t,e){(e=fl(e))[0]-=t,ml(e);var n=function(t){return t>1?0:t<-1?Vs:Math.acos(t)}(-e[1]);return((-e[2]<0?-n:n)+Ys-Hs)%Ys}var Cl=1e9,Al=-1e9;function kl(t,e,n,i){function r(r,a){return t<=r&&r<=n&&e<=a&&a<=i}function a(r,a,s,c){var u=0,h=0;if(null==r||(u=o(r,s))!==(h=o(a,s))||l(r,a)<0^s>0)do{c.point(0===u||3===u?t:n,u>1?i:e)}while((u=(u+s+4)%4)!==h);else c.point(a[0],a[1])}function o(i,r){return Zs(i[0]-t)<Hs?r>0?0:3:Zs(i[0]-n)<Hs?r>0?2:1:Zs(i[1]-e)<Hs?r>0?1:0:r>0?3:2}function s(t,e){return l(t.x,e.x)}function l(t,e){var n=o(t,1),i=o(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var l,c,u,h,f,p,d,g,_,m,v,y=o,x=Ws(),b={point:w,lineStart:function(){b.point=S,c&&c.push(u=[]);m=!0,_=!1,d=g=NaN},lineEnd:function(){l&&(S(h,f),p&&_&&x.rejoin(),l.push(x.result()));b.point=w,_&&y.lineEnd()},polygonStart:function(){y=x,l=[],c=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,r=c.length;n<r;++n)for(var a,o,s=c[n],l=1,u=s.length,h=s[0],f=h[0],p=h[1];l<u;++l)a=f,o=p,f=(h=s[l])[0],p=h[1],o<=i?p>i&&(f-a)*(i-o)>(p-o)*(t-a)&&++e:p<=i&&(f-a)*(i-o)<(p-o)*(t-a)&&--e;return e}(),n=v&&e,r=(l=yl(l)).length;(n||r)&&(o.polygonStart(),n&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),r&&ll(l,s,e,a,o),o.polygonEnd());y=o,l=c=u=null}};function w(t,e){r(t,e)&&y.point(t,e)}function S(a,o){var s=r(a,o);if(c&&u.push([a,o]),m)h=a,f=o,p=s,m=!1,s&&(y.lineStart(),y.point(a,o));else if(s&&_)y.point(a,o);else{var l=[d=Math.max(Al,Math.min(Cl,d)),g=Math.max(Al,Math.min(Cl,g))],x=[a=Math.max(Al,Math.min(Cl,a)),o=Math.max(Al,Math.min(Cl,o))];!function(t,e,n,i,r,a){var o,s=t[0],l=t[1],c=0,u=1,h=e[0]-s,f=e[1]-l;if(o=n-s,h||!(o>0)){if(o/=h,h<0){if(o<c)return;o<u&&(u=o)}else if(h>0){if(o>u)return;o>c&&(c=o)}if(o=r-s,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o<c)return;o<u&&(u=o)}if(o=i-l,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<u&&(u=o)}else if(f>0){if(o>u)return;o>c&&(c=o)}if(o=a-l,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<u&&(u=o)}return c>0&&(t[0]=s+c*h,t[1]=l+c*f),u<1&&(e[0]=s+u*h,e[1]=l+u*f),!0}}}}}(l,x,t,e,n,i)?s&&(y.lineStart(),y.point(a,o),v=!1):(_||(y.lineStart(),y.point(l[0],l[1])),y.point(x[0],x[1]),s||y.lineEnd(),v=!1)}d=a,g=o,_=s}return b}}function Tl(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return(n=e.invert(n,i))&&t.invert(n[0],n[1])}),n}const Pl=t=>t;function Nl(t,e){return[Zs(t)>Vs?t+Math.round(-t/Ys)*Ys:t,e]}function Ll(t,e,n){return(t%=Ys)?e||n?Tl(Ol(t),Gl(e,n)):Ol(t):e||n?Gl(e,n):Nl}function Fl(t){return function(e,n){return[(e+=t)>Vs?e-Ys:e<-Vs?e+Ys:e,n]}}function Ol(t){var e=Fl(t);return e.invert=Fl(-t),e}function Gl(t,e){var n=el(t),i=nl(t),r=el(e),a=nl(e);function o(t,e){var o=el(e),s=el(t)*o,l=nl(t)*o,c=nl(e),u=c*n+s*i;return[tl(l*r-u*a,s*n-c*i),al(u*r+l*a)]}return o.invert=function(t,e){var o=el(e),s=el(t)*o,l=nl(t)*o,c=nl(e),u=c*r-l*a;return[tl(l*r+c*a,s*n+u*i),al(u*n-s*i)]},o}function Dl(t){return function(e){var n=new zl;for(var i in t)n[i]=t[i];return n.stream=e,n}}function zl(){}function Il(t,e){t&&jl.hasOwnProperty(t.type)&&jl[t.type](t,e)}Nl.invert=Nl,zl.prototype={constructor:zl,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Rl={Feature:function(t,e){Il(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)Il(n[i].geometry,e)}},jl={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){Bl(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)Bl(n[i],e,0)},Polygon:function(t,e){ql(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)ql(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)Il(n[i],e)}};function Bl(t,e,n){var i,r=-1,a=t.length-n;for(e.lineStart();++r<a;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function ql(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)Bl(t[n],e,1);e.polygonEnd()}var Ul=1/0,Wl=Ul,Hl=-Ul,Vl=Hl,$l={point:function(t,e){t<Ul&&(Ul=t);t>Hl&&(Hl=t);e<Wl&&(Wl=e);e>Vl&&(Vl=e)},lineStart:Us,lineEnd:Us,polygonStart:Us,polygonEnd:Us,result:function(){var t=[[Ul,Wl],[Hl,Vl]];return Hl=Vl=-(Wl=Ul=1/0),t}};const Jl=$l;function Yl(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),function(t,e){t&&Rl.hasOwnProperty(t.type)?Rl[t.type](t,e):Il(t,e)}(n,t.stream(Jl)),e(Jl.result()),null!=i&&t.clipExtent(i),t}function Xl(t,e,n){return Yl(t,(function(n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],a=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),o=+e[0][0]+(i-a*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(r-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([o,s])}),n)}var Kl=el(30*Ks);function Zl(t,e){return+e?function(t,e){function n(i,r,a,o,s,l,c,u,h,f,p,d,g,_){var m=c-i,v=u-r,y=m*m+v*v;if(y>4*e&&g--){var x=o+f,b=s+p,w=l+d,S=rl(x*x+b*b+w*w),M=al(w/=S),E=Zs(Zs(w)-1)<Hs||Zs(a-h)<Hs?(a+h)/2:tl(b,x),C=t(E,M),A=C[0],k=C[1],T=A-i,P=k-r,N=v*T-m*P;(N*N/y>e||Zs((m*T+v*P)/y-.5)>.3||o*f+s*p+l*d<Kl)&&(n(i,r,a,o,s,l,A,k,E,x/=S,b/=S,w,g,_),_.point(A,k),n(A,k,E,x,b,w,c,u,h,f,p,d,g,_))}}return function(e){var i,r,a,o,s,l,c,u,h,f,p,d,g={point:_,lineStart:m,lineEnd:y,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=m}};function _(n,i){n=t(n,i),e.point(n[0],n[1])}function m(){u=NaN,g.point=v,e.lineStart()}function v(i,r){var a=fl([i,r]),o=t(i,r);n(u,h,c,f,p,d,u=o[0],h=o[1],c=i,f=a[0],p=a[1],d=a[2],16,e),e.point(u,h)}function y(){g.point=_,e.lineEnd()}function x(){m(),g.point=b,g.lineEnd=w}function b(t,e){v(i=t,e),r=u,a=h,o=f,s=p,l=d,g.point=v}function w(){n(u,h,c,f,p,d,r,a,i,o,s,l,16,e),g.lineEnd=y,y()}return g}}(t,e):function(t){return Dl({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Ql=Dl({point:function(t,e){this.stream.point(t*Ks,e*Ks)}});function tc(t,e,n,i,r,a){if(!a)return function(t,e,n,i,r){function a(a,o){return[e+t*(a*=i),n-t*(o*=r)]}return a.invert=function(a,o){return[(a-e)/t*i,(n-o)/t*r]},a}(t,e,n,i,r);var o=el(a),s=nl(a),l=o*t,c=s*t,u=o/t,h=s/t,f=(s*n-o*e)/t,p=(s*e+o*n)/t;function d(t,a){return[l*(t*=i)-c*(a*=r)+e,n-c*t-l*a]}return d.invert=function(t,e){return[i*(u*t-h*e+f),r*(p-h*t-u*e)]},d}function ec(t){return function(t){var e,n,i,r,a,o,s,l,c,u,h=150,f=480,p=250,d=0,g=0,_=0,m=0,v=0,y=0,x=1,b=1,w=null,S=Sl,M=null,E=Pl,C=.5;function A(t){return l(t[0]*Ks,t[1]*Ks)}function k(t){return(t=l.invert(t[0],t[1]))&&[t[0]*Xs,t[1]*Xs]}function T(){var t=tc(h,0,0,x,b,y).apply(null,e(d,g)),i=tc(h,f-t[0],p-t[1],x,b,y);return n=Ll(_,m,v),s=Tl(e,i),l=Tl(n,s),o=Zl(s,C),P()}function P(){return c=u=null,A}return A.stream=function(t){return c&&u===t?c:c=Ql(function(t){return Dl({point:function(e,n){var i=t(e,n);return this.stream.point(i[0],i[1])}})}(n)(S(o(E(u=t)))))},A.preclip=function(t){return arguments.length?(S=t,w=void 0,P()):S},A.postclip=function(t){return arguments.length?(E=t,M=i=r=a=null,P()):E},A.clipAngle=function(t){return arguments.length?(S=+t?function(t){var e=el(t),n=6*Ks,i=e>0,r=Zs(e)>Hs;function a(t,n){return el(t)*el(n)>e}function o(t,n,i){var r=[1,0,0],a=dl(fl(t),fl(n)),o=pl(a,a),s=a[0],l=o-s*s;if(!l)return!i&&t;var c=e*o/l,u=-e*s/l,h=dl(r,a),f=_l(r,c);gl(f,_l(a,u));var p=h,d=pl(f,p),g=pl(p,p),_=d*d-g*(pl(f,f)-1);if(!(_<0)){var m=rl(_),v=_l(p,(-d-m)/g);if(gl(v,f),v=hl(v),!i)return v;var y,x=t[0],b=n[0],w=t[1],S=n[1];b<x&&(y=x,x=b,b=y);var M=b-x,E=Zs(M-Vs)<Hs;if(!E&&S<w&&(y=w,w=S,S=y),E||M<Hs?E?w+S>0^v[1]<(Zs(v[0]-x)<Hs?w:S):w<=v[1]&&v[1]<=S:M>Vs^(x<=v[0]&&v[0]<=b)){var C=_l(p,(-d+m)/g);return gl(C,f),[v,hl(C)]}}}function s(e,n){var r=i?t:Vs-t,a=0;return e<-r?a|=1:e>r&&(a|=2),n<-r?a|=4:n>r&&(a|=8),a}return xl(a,(function(t){var e,n,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(h,f){var p,d=[h,f],g=a(h,f),_=i?g?0:s(h,f):g?s(h+(h<0?Vs:-Vs),f):0;if(!e&&(c=l=g)&&t.lineStart(),g!==l&&(!(p=o(e,d))||ol(e,p)||ol(d,p))&&(d[2]=1),g!==l)u=0,g?(t.lineStart(),p=o(d,e),t.point(p[0],p[1])):(p=o(e,d),t.point(p[0],p[1],2),t.lineEnd()),e=p;else if(r&&e&&i^g){var m;_&n||!(m=o(d,e,!0))||(u=0,i?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1],3)))}!g||e&&ol(e,d)||t.point(d[0],d[1]),e=d,l=g,n=_},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return u|(c&&l)<<1}}}),(function(e,i,r,a){Ml(a,t,n,r,e,i)}),i?[0,-t]:[-Vs,t-Vs])}(w=t*Ks):(w=null,Sl),P()):w*Xs},A.clipExtent=function(t){return arguments.length?(E=null==t?(M=i=r=a=null,Pl):kl(M=+t[0][0],i=+t[0][1],r=+t[1][0],a=+t[1][1]),P()):null==M?null:[[M,i],[r,a]]},A.scale=function(t){return arguments.length?(h=+t,T()):h},A.translate=function(t){return arguments.length?(f=+t[0],p=+t[1],T()):[f,p]},A.center=function(t){return arguments.length?(d=t[0]%360*Ks,g=t[1]%360*Ks,T()):[d*Xs,g*Xs]},A.rotate=function(t){return arguments.length?(_=t[0]%360*Ks,m=t[1]%360*Ks,v=t.length>2?t[2]%360*Ks:0,T()):[_*Xs,m*Xs,v*Xs]},A.angle=function(t){return arguments.length?(y=t%360*Ks,T()):y*Xs},A.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},A.reflectY=function(t){return arguments.length?(b=t?-1:1,T()):b<0},A.precision=function(t){return arguments.length?(o=Zl(s,C=t*t),P()):rl(C)},A.fitExtent=function(t,e){return Xl(A,t,e)},A.fitSize=function(t,e){return function(t,e,n){return Xl(t,[[0,0],e],n)}(A,t,e)},A.fitWidth=function(t,e){return function(t,e,n){return Yl(t,(function(n){var i=+e,r=i/(n[1][0]-n[0][0]),a=(i-r*(n[1][0]+n[0][0]))/2,o=-r*n[0][1];t.scale(150*r).translate([a,o])}),n)}(A,t,e)},A.fitHeight=function(t,e){return function(t,e,n){return Yl(t,(function(n){var i=+e,r=i/(n[1][1]-n[0][1]),a=-r*n[0][0],o=(i-r*(n[1][1]+n[0][1]))/2;t.scale(150*r).translate([a,o])}),n)}(A,t,e)},function(){return e=t.apply(this,arguments),A.invert=e.invert&&k,T()}}((function(){return t}))()}var nc=Math.abs,ic=(Math.atan,Math.atan2,Math.ceil,Math.cos,Math.exp,Math.floor),rc=(Math.log,Math.max),ac=Math.min,oc=(Math.pow,Math.round,Math.sign,Math.sin,Math.tan,Math.PI),sc=oc/2,lc=(Math.SQRT1_2,uc(2),uc(oc),180/oc),cc=oc/180;function uc(t){return t>0?Math.sqrt(t):0}var hc=[[.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]];function fc(t,e){var n,i=ac(18,36*nc(e)/oc),r=ic(i),a=i-r,o=(n=hc[r])[0],s=n[1],l=(n=hc[++r])[0],c=n[1],u=(n=hc[ac(19,++r)])[0],h=n[1];return[t*(l+a*(u-o)/2+a*a*(u-2*l+o)/2),(e>0?sc:-sc)*(c+a*(h-s)/2+a*a*(h-2*c+s)/2)]}hc.forEach((function(t){t[1]*=1.0144})),fc.invert=function(t,e){var n=e/sc,i=90*n,r=ac(18,nc(i/5)),a=rc(0,ic(r));do{var o=hc[a][1],s=hc[a+1][1],l=hc[ac(19,a+2)][1],c=l-o,u=l-2*s+o,h=2*(nc(n)-s)/c,f=u/c,p=h*(1-f*h*(1-2*f*h));if(p>=0||1===a){i=(e>=0?5:-5)*(p+r);var d,g=50;do{p=(r=ac(18,nc(i)/5))-(a=ic(r)),o=hc[a][1],s=hc[a+1][1],l=hc[ac(19,a+2)][1],i-=(d=(e>=0?sc:-sc)*(s+p*(l-o)/2+p*p*(l-2*s+o)/2)-e)*lc}while(nc(d)>1e-12&&--g>0);break}}while(--a>=0);var _=hc[a][0],m=hc[a+1][0],v=hc[ac(19,a+2)][0];return[t/(m+p*(v-_)/2+p*p*(v-2*m+_)/2),i*cc]};var pc="http://www.w3.org/1999/xhtml";const dc={svg:"http://www.w3.org/2000/svg",xhtml:pc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function gc(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),dc.hasOwnProperty(e)?{space:dc[e],local:t}:t}function _c(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===pc&&e.documentElement.namespaceURI===pc?e.createElement(t):e.createElementNS(n,t)}}function mc(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function vc(t){var e=gc(t);return(e.local?mc:_c)(e)}function yc(){}function xc(t){return null==t?yc:function(){return this.querySelector(t)}}function bc(){return[]}function wc(t){return new Array(t.length)}function Sc(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Sc.prototype={constructor:Sc,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Mc(t,e,n,i,r,a){for(var o,s=0,l=e.length,c=a.length;s<c;++s)(o=e[s])?(o.__data__=a[s],i[s]=o):n[s]=new Sc(t,a[s]);for(;s<l;++s)(o=e[s])&&(r[s]=o)}function Ec(t,e,n,i,r,a,o){var s,l,c,u={},h=e.length,f=a.length,p=new Array(h);for(s=0;s<h;++s)(l=e[s])&&(p[s]=c="$"+o.call(l,l.__data__,s,e),c in u?r[s]=l:u[c]=l);for(s=0;s<f;++s)(l=u[c="$"+o.call(t,a[s],s,a)])?(i[s]=l,l.__data__=a[s],u[c]=null):n[s]=new Sc(t,a[s]);for(s=0;s<h;++s)(l=e[s])&&u[p[s]]===l&&(r[s]=l)}function Cc(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Ac(t){return function(){this.removeAttribute(t)}}function kc(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Tc(t,e){return function(){this.setAttribute(t,e)}}function Pc(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Nc(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Lc(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Fc(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Oc(t){return function(){this.style.removeProperty(t)}}function Gc(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Dc(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function zc(t){return function(){delete this[t]}}function Ic(t,e){return function(){this[t]=e}}function Rc(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function jc(t){return t.trim().split(/^|\s+/)}function Bc(t){return t.classList||new qc(t)}function qc(t){this._node=t,this._names=jc(t.getAttribute("class")||"")}function Uc(t,e){for(var n=Bc(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function Wc(t,e){for(var n=Bc(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function Hc(t){return function(){Uc(this,t)}}function Vc(t){return function(){Wc(this,t)}}function $c(t,e){return function(){(e.apply(this,arguments)?Uc:Wc)(this,t)}}function Jc(){this.textContent=""}function Yc(t){return function(){this.textContent=t}}function Xc(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function Kc(){this.innerHTML=""}function Zc(t){return function(){this.innerHTML=t}}function Qc(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function tu(){this.nextSibling&&this.parentNode.appendChild(this)}function eu(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function nu(){return null}function iu(){var t=this.parentNode;t&&t.removeChild(this)}function ru(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function au(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}qc.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ou={},su=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(ou={mouseenter:"mouseover",mouseleave:"mouseout"}));function lu(t,e,n){return t=cu(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function cu(t,e,n){return function(i){var r=su;su=i;try{t.call(this,this.__data__,e,n)}finally{su=r}}}function uu(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,a=e.length;i<a;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.capture);++r?e.length=r:delete this.__on}}}function hu(t,e,n){var i=ou.hasOwnProperty(t.type)?lu:cu;return function(r,a,o){var s,l=this.__on,c=i(e,a,o);if(l)for(var u=0,h=l.length;u<h;++u)if((s=l[u]).type===t.type&&s.name===t.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=c,s.capture=n),void(s.value=e);this.addEventListener(t.type,c,n),s={type:t.type,name:t.name,value:e,listener:c,capture:n},l?l.push(s):this.__on=[s]}}function fu(t,e,n,i){var r=su;t.sourceEvent=su,su=t;try{return e.apply(n,i)}finally{su=r}}function pu(t,e,n){var i=Fc(t),r=i.CustomEvent;"function"==typeof r?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function du(t,e){return function(){return pu(this,t,e)}}function gu(t,e){return function(){return pu(this,t,e.apply(this,arguments))}}var _u=[null];function mu(t,e){this._groups=t,this._parents=e}function vu(){return new mu([[document.documentElement]],_u)}mu.prototype=vu.prototype={constructor:mu,select:function(t){"function"!=typeof t&&(t=xc(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a,o,s=e[r],l=s.length,c=i[r]=new Array(l),u=0;u<l;++u)(a=s[u])&&(o=t.call(a,a.__data__,u,s))&&("__data__"in a&&(o.__data__=a.__data__),c[u]=o);return new mu(i,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=function(t){return null==t?bc:function(){return this.querySelectorAll(t)}}(t));for(var e=this._groups,n=e.length,i=[],r=[],a=0;a<n;++a)for(var o,s=e[a],l=s.length,c=0;c<l;++c)(o=s[c])&&(i.push(t.call(o,o.__data__,c,s)),r.push(o));return new mu(i,r)},filter:function(t){"function"!=typeof t&&(t=function(t){return function(){return this.matches(t)}}(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a,o=e[r],s=o.length,l=i[r]=[],c=0;c<s;++c)(a=o[c])&&t.call(a,a.__data__,c,o)&&l.push(a);return new mu(i,this._parents)},data:function(t,e){if(!t)return p=new Array(this.size()),c=-1,this.each((function(t){p[++c]=t})),p;var n=e?Ec:Mc,i=this._parents,r=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var a=r.length,o=new Array(a),s=new Array(a),l=new Array(a),c=0;c<a;++c){var u=i[c],h=r[c],f=h.length,p=t.call(u,u&&u.__data__,c,i),d=p.length,g=s[c]=new Array(d),_=o[c]=new Array(d);n(u,h,g,_,l[c]=new Array(f),p,e);for(var m,v,y=0,x=0;y<d;++y)if(m=g[y]){for(y>=x&&(x=y+1);!(v=_[x])&&++x<d;);m._next=v||null}}return(o=new mu(o,i))._enter=s,o._exit=l,o},enter:function(){return new mu(this._enter||this._groups.map(wc),this._parents)},exit:function(){return new mu(this._exit||this._groups.map(wc),this._parents)},join:function(t,e,n){var i=this.enter(),r=this,a=this.exit();return i="function"==typeof t?t(i):i.append(t+""),null!=e&&(r=e(r)),null==n?a.remove():n(a),i&&r?i.merge(r).order():r},merge:function(t){for(var e=this._groups,n=t._groups,i=e.length,r=n.length,a=Math.min(i,r),o=new Array(i),s=0;s<a;++s)for(var l,c=e[s],u=n[s],h=c.length,f=o[s]=new Array(h),p=0;p<h;++p)(l=c[p]||u[p])&&(f[p]=l);for(;s<i;++s)o[s]=e[s];return new mu(o,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,r=t[e],a=r.length-1,o=r[a];--a>=0;)(i=r[a])&&(o&&4^i.compareDocumentPosition(o)&&o.parentNode.insertBefore(i,o),o=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=Cc);for(var n=this._groups,i=n.length,r=new Array(i),a=0;a<i;++a){for(var o,s=n[a],l=s.length,c=r[a]=new Array(l),u=0;u<l;++u)(o=s[u])&&(c[u]=o);c.sort(e)}return new mu(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),e=-1;return this.each((function(){t[++e]=this})),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,a=i.length;r<a;++r){var o=i[r];if(o)return o}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r,a=e[n],o=0,s=a.length;o<s;++o)(r=a[o])&&t.call(r,r.__data__,o,a);return this},attr:function(t,e){var n=gc(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?kc:Ac:"function"==typeof e?n.local?Lc:Nc:n.local?Pc:Tc)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?Oc:"function"==typeof e?Dc:Gc)(t,e,null==n?"":n)):function(t,e){return t.style.getPropertyValue(e)||Fc(t).getComputedStyle(t,null).getPropertyValue(e)}(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?zc:"function"==typeof e?Rc:Ic)(t,e)):this.node()[t]},classed:function(t,e){var n=jc(t+"");if(arguments.length<2){for(var i=Bc(this.node()),r=-1,a=n.length;++r<a;)if(!i.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?$c:e?Hc:Vc)(n,e))},text:function(t){return arguments.length?this.each(null==t?Jc:("function"==typeof t?Xc:Yc)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Kc:("function"==typeof t?Qc:Zc)(t)):this.node().innerHTML},raise:function(){return this.each(tu)},lower:function(){return this.each(eu)},append:function(t){var e="function"==typeof t?t:vc(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:vc(t),i=null==e?nu:"function"==typeof e?e:xc(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)}))},remove:function(){return this.each(iu)},clone:function(t){return this.select(t?au:ru)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,r,a=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),o=a.length;if(!(arguments.length<2)){for(s=e?hu:uu,null==n&&(n=!1),i=0;i<o;++i)this.each(s(a[i],e,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(i=0,l=s[c];i<o;++i)if((r=a[i]).type===l.type&&r.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?gu:du)(t,e))}};function yu(t){return"string"==typeof t?new mu([[document.querySelector(t)]],[document.documentElement]):new mu([[t]],_u)}var xu=0;function bu(){this._="@"+(++xu).toString(36)}function wu(){for(var t,e=su;t=e.sourceEvent;)e=t;return e}function Su(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,[(i=i.matrixTransform(t.getScreenCTM().inverse())).x,i.y]}var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}function Mu(t){var e=wu();return e.changedTouches&&(e=e.changedTouches[0]),Su(t,e)}function Eu(t,e,n){arguments.length<3&&(n=e,e=wu().changedTouches);for(var i,r=0,a=e?e.length:0;r<a;++r)if((i=e[r]).identifier===n)return Su(t,i);return null}bu.prototype=function(){return new bu}.prototype={constructor:bu,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var Cu={value:function(){}};function Au(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i)throw new Error("illegal type: "+t);i[t]=[]}return new ku(i)}function ku(t){this._=t}function Tu(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function Pu(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=Cu,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}ku.prototype=Au.prototype={constructor:ku,on:function(t,e){var n,i,r=this._,a=(i=r,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!i.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=a[o]).type)r[n]=Pu(r[n],t.name,e);else if(null==e)for(n in r)r[n]=Pu(r[n],t.name,null);return this}for(;++o<s;)if((n=(t=a[o]).type)&&(n=Tu(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ku(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),a=0;a<n;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(i=this._[t]).length;a<n;++a)i[a].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,a=i.length;r<a;++r)i[r].value.apply(e,n)}};const Nu=Au;function Lu(){su.stopImmediatePropagation()}function Fu(){su.preventDefault(),su.stopImmediatePropagation()}function Ou(t){return function(){return t}}function Gu(t,e,n,i,r,a,o,s,l,c){this.target=t,this.type=e,this.subject=n,this.identifier=i,this.active=r,this.x=a,this.y=o,this.dx=s,this.dy=l,this._=c}function Du(){return!su.button}function zu(){return this.parentNode}function Iu(t){return null==t?{x:su.x,y:su.y}:t}function Ru(){return"ontouchstart"in this}function ju(){var t,e,n,i,r=Du,a=zu,o=Iu,s=Ru,l={},c=Nu("start","drag","end"),u=0,h=0;function f(t){t.on("mousedown.drag",p).filter(s).on("touchstart.drag",_).on("touchmove.drag",m).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(){if(!i&&r.apply(this,arguments)){var o=y("mouse",a.apply(this,arguments),Mu,this,arguments);o&&(yu(su.view).on("mousemove.drag",d,!0).on("mouseup.drag",g,!0),function(t){var e=t.document.documentElement,n=yu(t).on("dragstart.drag",Fu,!0);"onselectstart"in e?n.on("selectstart.drag",Fu,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(su.view),Lu(),n=!1,t=su.clientX,e=su.clientY,o("start"))}}function d(){if(Fu(),!n){var i=su.clientX-t,r=su.clientY-e;n=i*i+r*r>h}l.mouse("drag")}function g(){yu(su.view).on("mousemove.drag mouseup.drag",null),function(t,e){var n=t.document.documentElement,i=yu(t).on("dragstart.drag",null);e&&(i.on("click.drag",Fu,!0),setTimeout((function(){i.on("click.drag",null)}),0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(su.view,n),Fu(),l.mouse("end")}function _(){if(r.apply(this,arguments)){var t,e,n=su.changedTouches,i=a.apply(this,arguments),o=n.length;for(t=0;t<o;++t)(e=y(n[t].identifier,i,Eu,this,arguments))&&(Lu(),e("start"))}}function m(){var t,e,n=su.changedTouches,i=n.length;for(t=0;t<i;++t)(e=l[n[t].identifier])&&(Fu(),e("drag"))}function v(){var t,e,n=su.changedTouches,r=n.length;for(i&&clearTimeout(i),i=setTimeout((function(){i=null}),500),t=0;t<r;++t)(e=l[n[t].identifier])&&(Lu(),e("end"))}function y(t,e,n,i,r){var a,s,h,p=n(e,t),d=c.copy();if(fu(new Gu(f,"beforestart",a,t,u,p[0],p[1],0,0,d),(function(){return null!=(su.subject=a=o.apply(i,r))&&(s=a.x-p[0]||0,h=a.y-p[1]||0,!0)})))return function o(c){var g,_=p;switch(c){case"start":l[t]=o,g=u++;break;case"end":delete l[t],--u;case"drag":p=n(e,t),g=u}fu(new Gu(f,c,a,t,g,p[0]+s,p[1]+h,p[0]-_[0],p[1]-_[1],d),d.apply,d,[c,i,r])}}return f.filter=function(t){return arguments.length?(r="function"==typeof t?t:Ou(!!t),f):r},f.container=function(t){return arguments.length?(a="function"==typeof t?t:Ou(t),f):a},f.subject=function(t){return arguments.length?(o="function"==typeof t?t:Ou(t),f):o},f.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Ou(!!t),f):s},f.on=function(){var t=c.on.apply(c,arguments);return t===c?f:t},f.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,f):Math.sqrt(h)},f}Gu.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var Bu=Math.PI,qu=2*Bu,Uu=1e-6,Wu=qu-Uu;function Hu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Vu(){return new Hu}Hu.prototype=Vu.prototype={constructor:Hu,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,a){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+a)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var a=this._x1,o=this._y1,s=n-t,l=i-e,c=a-t,u=o-e,h=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>Uu)if(Math.abs(u*s-l*c)>Uu&&r){var f=n-a,p=i-o,d=s*s+l*l,g=f*f+p*p,_=Math.sqrt(d),m=Math.sqrt(h),v=r*Math.tan((Bu-Math.acos((d+h-g)/(2*_*m)))/2),y=v/m,x=v/_;Math.abs(y-1)>Uu&&(this._+="L"+(t+y*c)+","+(e+y*u)),this._+="A"+r+","+r+",0,0,"+ +(u*f>c*p)+","+(this._x1=t+x*s)+","+(this._y1=e+x*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,i,r,a){t=+t,e=+e,a=!!a;var o=(n=+n)*Math.cos(i),s=n*Math.sin(i),l=t+o,c=e+s,u=1^a,h=a?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>Uu||Math.abs(this._y1-c)>Uu)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%qu+qu),h>Wu?this._+="A"+n+","+n+",0,1,"+u+","+(t-o)+","+(e-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>Uu&&(this._+="A"+n+","+n+",0,"+ +(h>=Bu)+","+u+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};const $u=Vu;function Ju(t){return function(){return t}}var Yu=1e-12,Xu=Math.PI,Ku=Xu/2,Zu=2*Xu;function Qu(t){return t.innerRadius}function th(t){return t.outerRadius}function eh(t){return t.startAngle}function nh(t){return t.endAngle}function ih(t){return t&&t.padAngle}function rh(t){return t>=1?Ku:t<=-1?-Ku:Math.asin(t)}function ah(t,e,n,i,r,a,o){var s=t-n,l=e-i,c=(o?a:-a)/Math.sqrt(s*s+l*l),u=c*l,h=-c*s,f=t+u,p=e+h,d=n+u,g=i+h,_=(f+d)/2,m=(p+g)/2,v=d-f,y=g-p,x=v*v+y*y,b=r-a,w=f*g-d*p,S=(y<0?-1:1)*Math.sqrt(Math.max(0,b*b*x-w*w)),M=(w*y-v*S)/x,E=(-w*v-y*S)/x,C=(w*y+v*S)/x,A=(-w*v+y*S)/x,k=M-_,T=E-m,P=C-_,N=A-m;return k*k+T*T>P*P+N*N&&(M=C,E=A),{cx:M,cy:E,x01:-u,y01:-h,x11:M*(r/b-1),y11:E*(r/b-1)}}function oh(t){this._context=t}function sh(t){return new oh(t)}function lh(t){return t[0]}function ch(t){return t[1]}oh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};!function(t){function e(e){return new uh(t(e))}e._curve=t}(sh);function uh(t){this._curve=t}uh.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};Math.sqrt(1/3);var hh=Math.sin(Xu/10)/Math.sin(7*Xu/10);Math.sin(Zu/10),Math.cos(Zu/10);Math.sqrt(3);Math.sqrt(3),Math.sqrt(12);function fh(){}function ph(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function dh(t){this._context=t}function gh(t){this._context=t}function _h(t){this._context=t}function mh(t,e){this._basis=new dh(t),this._beta=e}dh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ph(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ph(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},gh.prototype={areaStart:fh,areaEnd:fh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:ph(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},_h.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:ph(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},mh.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i,r=t[0],a=e[0],o=t[n]-r,s=e[n]-a,l=-1;++l<=n;)i=l/n,this._basis.point(this._beta*t[l]+(1-this._beta)*(r+i*o),this._beta*e[l]+(1-this._beta)*(a+i*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};(function t(e){function n(t){return 1===e?new dh(t):new mh(t,e)}return n.beta=function(e){return t(+e)},n})(.85);function vh(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function yh(t,e){this._context=t,this._k=(1-e)/6}yh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:vh(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:vh(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new yh(t,e)}return n.tension=function(e){return t(+e)},n})(0);function xh(t,e){this._context=t,this._k=(1-e)/6}xh.prototype={areaStart:fh,areaEnd:fh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:vh(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new xh(t,e)}return n.tension=function(e){return t(+e)},n})(0);function bh(t,e){this._context=t,this._k=(1-e)/6}bh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:vh(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new bh(t,e)}return n.tension=function(e){return t(+e)},n})(0);function wh(t,e,n){var i=t._x1,r=t._y1,a=t._x2,o=t._y2;if(t._l01_a>Yu){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,r=(r*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Yu){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,a,o,t._x2,t._y2)}function Sh(t,e){this._context=t,this._alpha=e}Sh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:wh(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Mh=function t(e){function n(t){return e?new Sh(t,e):new yh(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Eh(t,e){this._context=t,this._alpha=e}Eh.prototype={areaStart:fh,areaEnd:fh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:wh(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return e?new Eh(t,e):new xh(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function Ch(t,e){this._context=t,this._alpha=e}Ch.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:wh(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return e?new Ch(t,e):new bh(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function Ah(t){this._context=t}function kh(t){return t<0?-1:1}function Th(t,e,n){var i=t._x1-t._x0,r=e-t._x1,a=(t._y1-t._y0)/(i||r<0&&-0),o=(n-t._y1)/(r||i<0&&-0),s=(a*r+o*i)/(i+r);return(kh(a)+kh(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Ph(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Nh(t,e,n){var i=t._x0,r=t._y0,a=t._x1,o=t._y1,s=(a-i)/3;t._context.bezierCurveTo(i+s,r+s*e,a-s,o-s*n,a,o)}function Lh(t){this._context=t}function Fh(t){this._context=new Oh(t)}function Oh(t){this._context=t}function Gh(t){this._context=t}function Dh(t){var e,n,i=t.length-1,r=new Array(i),a=new Array(i),o=new Array(i);for(r[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e<i-1;++e)r[e]=1,a[e]=4,o[e]=4*t[e]+2*t[e+1];for(r[i-1]=2,a[i-1]=7,o[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=r[e]/a[e-1],a[e]-=n,o[e]-=n*o[e-1];for(r[i-1]=o[i-1]/a[i-1],e=i-2;e>=0;--e)r[e]=(o[e]-r[e+1])/a[e];for(a[i-1]=(t[i]+r[i-1])/2,e=0;e<i-1;++e)a[e]=2*t[e+1]-r[e+1];return[r,a]}function zh(t,e){this._context=t,this._t=e}Ah.prototype={areaStart:fh,areaEnd:fh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},Lh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Nh(this,this._t0,Ph(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Nh(this,Ph(this,n=Th(this,t,e)),n);break;default:Nh(this,this._t0,n=Th(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(Fh.prototype=Object.create(Lh.prototype)).point=function(t,e){Lh.prototype.point.call(this,e,t)},Oh.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,a){this._context.bezierCurveTo(e,t,i,n,a,r)}},Gh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var i=Dh(t),r=Dh(e),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(i[0][a],r[0][a],i[1][a],r[1][a],t[o],e[o]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},zh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};Array.prototype.slice;var Ih="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rh=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},jh=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),Bh=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},qh=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,n,i)}if("value"in r)return r.value;var o=r.get;return void 0!==o?o.call(i):void 0},Uh=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},Wh=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},Hh=function(){function t(e){var n=e.x,i=void 0===n?0:n,r=e.y,a=void 0===r?0:r,o=e.nx,s=e.ny,l=e.dy,c=void 0===l?0:l,u=e.dx,h=void 0===u?0:u,f=e.color,p=void 0===f?"grey":f,d=e.data,g=e.type,_=e.subject,m=e.connector,v=e.note,y=e.disable,x=e.id,b=e.className;Rh(this,t),this._dx=void 0!==o?o-i:h,this._dy=void 0!==s?s-a:c,this._x=i,this._y=a,this._color=p,this.id=x,this._className=b||"",this._type=g||"",this.data=d,this.note=v||{},this.connector=m||{},this.subject=_||{},this.disable=y||[]}return jh(t,[{key:"updatePosition",value:function(){this.type.setPosition&&(this.type.setPosition(),this.type.subject&&0!==this.type.subject.selectAll(":not(.handle)").nodes().length&&this.type.redrawSubject())}},{key:"clearComponents",value:function(){this.type.clearComponents&&this.type.clearComponents()}},{key:"updateOffset",value:function(){this.type.setOffset&&(this.type.setOffset(),0!==this.type.connector.selectAll(":not(.handle)").nodes().length&&this.type.redrawConnector(),this.type.redrawNote())}},{key:"className",get:function(){return this._className},set:function(t){this._className=t,this.type.setClassName&&this.type.setClassName()}},{key:"type",get:function(){return this._type},set:function(t){this._type=t,this.clearComponents()}},{key:"x",get:function(){return this._x},set:function(t){this._x=t,this.updatePosition()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this.updatePosition()}},{key:"color",get:function(){return this._color},set:function(t){this._color=t,this.updatePosition()}},{key:"dx",get:function(){return this._dx},set:function(t){this._dx=t,this.updateOffset()}},{key:"dy",get:function(){return this._dy},set:function(t){this._dy=t,this.updateOffset()}},{key:"nx",set:function(t){this._dx=t-this._x,this.updateOffset()}},{key:"ny",set:function(t){this._dy=t-this._y,this.updateOffset()}},{key:"offset",get:function(){return{x:this._dx,y:this._dy}},set:function(t){var e=t.x,n=t.y;this._dx=e,this._dy=n,this.updateOffset()}},{key:"position",get:function(){return{x:this._x,y:this._y}},set:function(t){var e=t.x,n=t.y;this._x=e,this._y=n,this.updatePosition()}},{key:"translation",get:function(){return{x:this._x+this._dx,y:this._y+this._dy}}},{key:"json",get:function(){var t={x:this._x,y:this._y,dx:this._dx,dy:this._dy};return this.data&&Object.keys(this.data).length>0&&(t.data=this.data),this.type&&(t.type=this.type),this._className&&(t.className=this._className),Object.keys(this.connector).length>0&&(t.connector=this.connector),Object.keys(this.subject).length>0&&(t.subject=this.subject),Object.keys(this.note).length>0&&(t.note=this.note),t}}]),t}(),Vh=function(){function t(e){var n=e.annotations,i=e.accessors,r=e.accessorsInverse;Rh(this,t),this.accessors=i,this.accessorsInverse=r,this.annotations=n}return jh(t,[{key:"clearTypes",value:function(t){this.annotations.forEach((function(e){e.type=void 0,e.subject=t&&t.subject||e.subject,e.connector=t&&t.connector||e.connector,e.note=t&&t.note||e.note}))}},{key:"setPositionWithAccessors",value:function(){var t=this;this.annotations.forEach((function(e){e.type.setPositionWithAccessors(t.accessors)}))}},{key:"editMode",value:function(t){this.annotations.forEach((function(e){e.type&&(e.type.editMode=t,e.type.updateEditMode())}))}},{key:"updateDisable",value:function(t){this.annotations.forEach((function(e){e.disable=t,e.type&&t.forEach((function(t){e.type[t]&&(e.type[t].remove&&e.type[t].remove(),e.type[t]=void 0)}))}))}},{key:"updateTextWrap",value:function(t){this.annotations.forEach((function(e){e.type&&e.type.updateTextWrap&&e.type.updateTextWrap(t)}))}},{key:"updateText",value:function(){this.annotations.forEach((function(t){t.type&&t.type.drawText&&t.type.drawText()}))}},{key:"updateNotePadding",value:function(t){this.annotations.forEach((function(e){e.type&&(e.type.notePadding=t)}))}},{key:"json",get:function(){var t=this;return this.annotations.map((function(e){var n=e.json;return t.accessorsInverse&&e.data&&(n.data={},Object.keys(t.accessorsInverse).forEach((function(i){n.data[i]=t.accessorsInverse[i]({x:e.x,y:e.y})}))),n}))}},{key:"noteNodes",get:function(){return this.annotations.map((function(t){return Bh({},t.type.getNoteBBoxOffset(),{positionX:t.x,positionY:t.y})}))}}]),t}(),$h=function(t,e){return"dynamic"!==t&&"left"!==t&&"right"!==t||(t=e<0?"top":"bottom"),t},Jh=function(t,e){return"dynamic"!==t&&"top"!==t&&"bottom"!==t||(t=e<0?"right":"left"),t},Yh=["topBottom","top","bottom"],Xh=["leftRight","left","right"],Kh=function(t){var e=t.data,n=t.curve,i=void 0===n?sh:n,r=t.canvasContext,a=t.className,o=t.classID,s=function(){var t=lh,e=ch,n=Ju(!0),i=null,r=sh,a=null;function o(o){var s,l,c,u=o.length,h=!1;for(null==i&&(a=r(c=$u())),s=0;s<=u;++s)!(s<u&&n(l=o[s],s,o))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+t(l,s,o),+e(l,s,o));if(c)return a=null,c+""||null}return o.x=function(e){return arguments.length?(t="function"==typeof e?e:Ju(+e),o):t},o.y=function(t){return arguments.length?(e="function"==typeof t?t:Ju(+t),o):e},o.defined=function(t){return arguments.length?(n="function"==typeof t?t:Ju(!!t),o):n},o.curve=function(t){return arguments.length?(r=t,null!=i&&(a=r(i)),o):r},o.context=function(t){return arguments.length?(null==t?i=a=null:a=r(i=t),o):i},o}().curve(i),l={type:"path",className:a,classID:o,data:e};return r?(s.context(r),l.pathMethods=s):l.attrs={d:s(e)},l},Zh=function(t){var e=t.data,n=t.canvasContext,i={type:"path",className:t.className,classID:t.classID,data:e},r=function(){var t=Qu,e=th,n=Ju(0),i=null,r=eh,a=nh,o=ih,s=null;function l(){var l,c,u=+t.apply(this,arguments),h=+e.apply(this,arguments),f=r.apply(this,arguments)-Ku,p=a.apply(this,arguments)-Ku,d=Math.abs(p-f),g=p>f;if(s||(s=l=$u()),h<u&&(c=h,h=u,u=c),h>Yu)if(d>Zu-Yu)s.moveTo(h*Math.cos(f),h*Math.sin(f)),s.arc(0,0,h,f,p,!g),u>Yu&&(s.moveTo(u*Math.cos(p),u*Math.sin(p)),s.arc(0,0,u,p,f,g));else{var _,m,v=f,y=p,x=f,b=p,w=d,S=d,M=o.apply(this,arguments)/2,E=M>Yu&&(i?+i.apply(this,arguments):Math.sqrt(u*u+h*h)),C=Math.min(Math.abs(h-u)/2,+n.apply(this,arguments)),A=C,k=C;if(E>Yu){var T=rh(E/u*Math.sin(M)),P=rh(E/h*Math.sin(M));(w-=2*T)>Yu?(x+=T*=g?1:-1,b-=T):(w=0,x=b=(f+p)/2),(S-=2*P)>Yu?(v+=P*=g?1:-1,y-=P):(S=0,v=y=(f+p)/2)}var N=h*Math.cos(v),L=h*Math.sin(v),F=u*Math.cos(b),O=u*Math.sin(b);if(C>Yu){var G=h*Math.cos(y),D=h*Math.sin(y),z=u*Math.cos(x),I=u*Math.sin(x);if(d<Xu){var R=w>Yu?function(t,e,n,i,r,a,o,s){var l=n-t,c=i-e,u=o-r,h=s-a,f=(u*(e-a)-h*(t-r))/(h*l-u*c);return[t+f*l,e+f*c]}(N,L,z,I,G,D,F,O):[F,O],j=N-R[0],B=L-R[1],q=G-R[0],U=D-R[1],W=1/Math.sin(Math.acos((j*q+B*U)/(Math.sqrt(j*j+B*B)*Math.sqrt(q*q+U*U)))/2),H=Math.sqrt(R[0]*R[0]+R[1]*R[1]);A=Math.min(C,(u-H)/(W-1)),k=Math.min(C,(h-H)/(W+1))}}S>Yu?k>Yu?(_=ah(z,I,N,L,h,k,g),m=ah(G,D,F,O,h,k,g),s.moveTo(_.cx+_.x01,_.cy+_.y01),k<C?s.arc(_.cx,_.cy,k,Math.atan2(_.y01,_.x01),Math.atan2(m.y01,m.x01),!g):(s.arc(_.cx,_.cy,k,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!g),s.arc(0,0,h,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(m.cy+m.y11,m.cx+m.x11),!g),s.arc(m.cx,m.cy,k,Math.atan2(m.y11,m.x11),Math.atan2(m.y01,m.x01),!g))):(s.moveTo(N,L),s.arc(0,0,h,v,y,!g)):s.moveTo(N,L),u>Yu&&w>Yu?A>Yu?(_=ah(F,O,G,D,u,-A,g),m=ah(N,L,z,I,u,-A,g),s.lineTo(_.cx+_.x01,_.cy+_.y01),A<C?s.arc(_.cx,_.cy,A,Math.atan2(_.y01,_.x01),Math.atan2(m.y01,m.x01),!g):(s.arc(_.cx,_.cy,A,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!g),s.arc(0,0,u,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(m.cy+m.y11,m.cx+m.x11),g),s.arc(m.cx,m.cy,A,Math.atan2(m.y11,m.x11),Math.atan2(m.y01,m.x01),!g))):s.arc(0,0,u,b,x,g):s.lineTo(F,O)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +a.apply(this,arguments))/2-Xu/2;return[Math.cos(i)*n,Math.sin(i)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Ju(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Ju(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Ju(+t),l):n},l.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Ju(+t),l):i},l.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Ju(+t),l):r},l.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:Ju(+t),l):a},l.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:Ju(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}().innerRadius(e.innerRadius||0).outerRadius(e.outerRadius||e.radius||2).startAngle(e.startAngle||0).endAngle(e.endAngle||2*Math.PI);return n?(r.context(n),i.pathMethods=lineGen):i.attrs={d:r()},i},Qh=function(t){var e=t.type,n=t.subjectType,i=e.annotation,r=i.position,a=i.x-r.x,o=a+i.dx,s=i.y-r.y,l=s+i.dy,c=i.subject;if("circle"===n&&(c.outerRadius||c.radius)){var u=Math.sqrt((a-o)*(a-o)+(s-l)*(s-l)),h=Math.asin(-l/u),f=c.outerRadius||c.radius+(c.radiusPadding||0);a=Math.abs(Math.cos(h)*f)*(o<0?-1:1),s=Math.abs(Math.sin(h)*f)*(l<0?-1:1)}if("rect"===n){var p=c.width,d=c.height;(p>0&&i.dx>0||p<0&&i.dx<0)&&(a=Math.abs(p)>Math.abs(i.dx)?p/2:p),(d>0&&i.dy>0||d<0&&i.dy<0)&&(s=Math.abs(d)>Math.abs(i.dy)?d/2:d),a===p/2&&s===d/2&&(a=o,s=l)}return[[a,s],[o,l]]},tf=function(t){var e=t.type,n=t.connectorData,i=t.subjectType;n||(n={}),n.points&&"number"!=typeof n.points||(n.points=ef(e.annotation.offset,n.points)),n.curve||(n.curve=Mh);var r=[];if(e.editMode){var a=n.points.map((function(t,e){return Bh({},function(t){var e=t.cx,n=void 0===e?0:e,i=t.cy;return{move:{x:n,y:void 0===i?0:i}}}({cx:t[0],cy:t[1]}),{index:e})})),o=function(t){n.points[t][0]+=su.dx,n.points[t][1]+=su.dy,e.redrawConnector()};r=e.mapHandles(a.map((function(t){return Bh({},t.move,{drag:o.bind(e,t.index)})})))}var s=Qh({type:e,subjectType:i});return s=[s[0]].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}(n.points),[s[1]]),{components:[Kh({data:s,curve:n.curve,className:"connector"})],handles:r}},ef=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=t.x/(e+1),i=t.y/(e+1),r=[],a=1;a<=e;a++)r.push([n*a+a%2*20,i*a-a%2*20]);return r},nf=function(t){var e=t.subjectData,n=t.type;e.radius||e.outerRadius||(e.radius=20);var i=[],r=Zh({data:e,className:"subject"});if(n.editMode){var a=function(t){var e=t.cx,n=void 0===e?0:e,i=t.cy,r=void 0===i?0:i,a=t.r1,o=t.r2,s=t.padding,l={move:{x:n,y:r}};return void 0!==a&&(l.r1={x:n+a/Math.sqrt(2),y:r+a/Math.sqrt(2)}),void 0!==o&&(l.r2={x:n+o/Math.sqrt(2),y:r+o/Math.sqrt(2)}),void 0!==s&&(l.padding={x:n+a+s,y:r}),l}({r1:r.data.outerRadius||r.data.radius,r2:r.data.innerRadius,padding:e.radiusPadding}),o=function(t){var i=e[t]+su.dx*Math.sqrt(2);e[t]=i,n.redrawSubject(),n.redrawConnector()},s=[Bh({},a.r1,{drag:o.bind(n,void 0!==e.outerRadius?"outerRadius":"radius")})];e.innerRadius&&s.push(Bh({},a.r2,{drag:o.bind(n,"innerRadius")})),i=n.mapHandles(s)}return r.attrs["fill-opacity"]=0,{components:[r],handles:i}},rf=function(){function t(e){var n=e.a,i=e.annotation,r=e.editMode,a=e.dispatcher,o=e.notePadding,s=e.accessors;if(Rh(this,t),this.a=n,this.note=-1===i.disable.indexOf("note")&&n.select("g.annotation-note"),this.noteContent=this.note&&n.select("g.annotation-note-content"),this.connector=-1===i.disable.indexOf("connector")&&n.select("g.annotation-connector"),this.subject=-1===i.disable.indexOf("subject")&&n.select("g.annotation-subject"),this.dispatcher=a,a){var l=df.bind(null,a,i);l({component:this.note,name:"note"}),l({component:this.connector,name:"connector"}),l({component:this.subject,name:"subject"})}this.annotation=i,this.editMode=i.editMode||r,this.notePadding=void 0!==o?o:3,this.offsetCornerX=0,this.offsetCornerY=0,s&&i.data&&this.init(s)}return jh(t,[{key:"init",value:function(t){this.annotation.x||this.mapX(t),this.annotation.y||this.mapY(t)}},{key:"mapY",value:function(t){t.y&&(this.annotation.y=t.y(this.annotation.data))}},{key:"mapX",value:function(t){t.x&&(this.annotation.x=t.x(this.annotation.data))}},{key:"updateEditMode",value:function(){this.a.selectAll("circle.handle").remove()}},{key:"drawOnSVG",value:function(t,e){var n=this;Array.isArray(e)||(e=[e]),e.filter((function(t){return t})).forEach((function(e){var i=e.type,r=e.className,a=e.attrs,o=e.handles,s=e.classID;if("handle"===i)!function(t){var e=t.group,n=t.handles,i=t.r,r=void 0===i?10:i,a=e.selectAll("circle.handle").data(n);a.enter().append("circle").attr("class","handle").attr("fill","grey").attr("fill-opacity",.1).attr("cursor","move").attr("stroke-dasharray",5).attr("stroke","grey").call(ju().container(yu("g.annotations").node()).on("start",(function(t){return t.start&&t.start(t)})).on("drag",(function(t){return t.drag&&t.drag(t)})).on("end",(function(t){return t.end&&t.end(t)}))),e.selectAll("circle.handle").attr("cx",(function(t){return t.x})).attr("cy",(function(t){return t.y})).attr("r",(function(t){return t.r||r})).attr("class",(function(t){return"handle "+(t.className||"")})),a.exit().remove()}({group:t,r:a&&a.r,handles:o});else{pf(t,[n.annotation],i,r,s);for(var l=t.select(i+"."+(s||r)),c=Object.keys(a),u=[],h=l.node().attributes,f=h.length-1;f>=0;f--){var p=h[f].name;-1===c.indexOf(p)&&"class"!==p&&u.push(p)}c.forEach((function(t){"text"===t?l.text(a[t]):l.attr(t,a[t])})),u.forEach((function(t){return l.attr(t,null)}))}}))}},{key:"getNoteBBox",value:function(){return _f(this.note,".annotation-note-content text")}},{key:"getNoteBBoxOffset",value:function(){var t=_f(this.note,".annotation-note-content"),e=this.noteContent.attr("transform").split(/\(|\,|\)/g);return t.offsetCornerX=parseFloat(e[1])+this.annotation.dx,t.offsetCornerY=parseFloat(e[2])+this.annotation.dy,t.offsetX=this.annotation.dx,t.offsetY=this.annotation.dy,t}},{key:"drawSubject",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.annotation.subject,i=e.type,r={type:this,subjectData:n},a={};"circle"===i?a=nf(r):"rect"===i?a=function(t){var e=t.subjectData,n=t.type;e.width||(e.width=100),e.height||(e.height=100);var i=[],r=e.width,a=e.height,o=Kh({data:[[0,0],[r,0],[r,a],[0,a],[0,0]],className:"subject"});if(n.editMode){var s=[{x:r,y:a/2,drag:function(){e.width=su.x,n.redrawSubject(),n.redrawConnector()}.bind(n)},{x:r/2,y:a,drag:function(){e.height=su.y,n.redrawSubject(),n.redrawConnector()}.bind(n)}];i=n.mapHandles(s)}return o.attrs["fill-opacity"]=.1,{components:[o],handles:i}}(r):"threshold"===i?a=function(t){var e=t.subjectData,n=t.type.annotation.position,i=(void 0!==e.x1?e.x1:n.x)-n.x,r=(void 0!==e.x2?e.x2:n.x)-n.x,a=(void 0!==e.y1?e.y1:n.y)-n.y,o=(void 0!==e.y2?e.y2:n.y)-n.y;return{components:[Kh({data:[[i,a],[r,o]],className:"subject"})]}}(r):"badge"===i&&(a=function(t){var e=t.subjectData,n=void 0===e?{}:e,i=t.type,r=void 0===i?{}:i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.typeSettings&&r.typeSettings.subject;n.radius||(o&&o.radius?n.radius=o.radius:n.radius=14),n.x||o&&o.x&&(n.x=o.x),n.y||o&&o.y&&(n.y=o.y);var s=[],l=[],c=n.radius,u=.7*c,h=0,f=0,p=Math.sqrt(2)*c,d={xleftcorner:-c,xrightcorner:c,ytopcorner:-c,ybottomcorner:c,xleft:-p,xright:p,ytop:-p,ybottom:p};n.x&&!n.y?h=d["x"+n.x]:n.y&&!n.x?f=d["y"+n.y]:n.x&&n.y&&(h=d["x"+n.x+"corner"],f=d["y"+n.y+"corner"]);var g="translate("+h+", "+f+")",_=Zh({className:"subject",data:{radius:c}});_.attrs.transform=g,_.attrs.fill=a.color,_.attrs["stroke-linecap"]="round",_.attrs["stroke-width"]="3px";var m=Zh({className:"subject-ring",data:{outerRadius:c,innerRadius:u}});m.attrs.transform=g,m.attrs["stroke-width"]="3px",m.attrs.fill="white";var v=void 0;if(h&&f||!h&&!f)v=Kh({className:"subject-pointer",data:[[0,0],[h||0,0],[0,f||0],[0,0]]});else if(h||f){var y=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t&&t/Math.sqrt(2)/Math.sqrt(2)||e*c/Math.sqrt(2)};v=Kh({className:"subject-pointer",data:[[0,0],[y(h),y(f)],[y(h,-1),y(f,-1)],[0,0]]})}if(v&&(v.attrs.fill=a.color,v.attrs["stroke-linecap"]="round",v.attrs["stroke-width"]="3px",l.push(v)),r.editMode){var x={x:2*h,y:2*f,drag:function(){n.x=su.x<2*-c?"left":su.x>2*c?"right":void 0,n.y=su.y<2*-c?"top":su.y>2*c?"bottom":void 0,r.redrawSubject()}.bind(r)};x.x||x.y||(x.y=-c),s=r.mapHandles([x])}var b=void 0;return n.text&&(b={type:"text",className:"badge-text",attrs:{fill:"white",stroke:"none","font-size":".7em",text:n.text,"text-anchor":"middle",dy:".25em",x:h,y:f}}),l.push(_),l.push(m),l.push(b),{components:l,handles:s}}(r,this.annotation));var o=a,s=o.components,l=void 0===s?[]:s,c=o.handles,u=void 0===c?[]:c;return l.forEach((function(e){e&&e.attrs&&!e.attrs.stroke&&(e.attrs.stroke=t.annotation.color)})),this.editMode&&(u=u.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),l.push({type:"handle",handles:u})),l}},{key:"drawConnector",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.annotation.connector,i=n.type||e.type,r={type:this,connectorData:n};r.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var a={};a="curve"===i?tf(r):"elbow"===i?function(t){var e=t.type,n=t.subjectType,i=e.annotation,r=i.position,a=i.x-r.x,o=a+i.dx,s=i.y-r.y,l=s+i.dy,c=i.subject;if("rect"===n){var u=c.width,h=c.height;(u>0&&i.dx>0||u<0&&i.dx<0)&&(a=Math.abs(u)>Math.abs(i.dx)?u/2:u),(h>0&&i.dy>0||h<0&&i.dy<0)&&(s=Math.abs(h)>Math.abs(i.dy)?h/2:h),a===u/2&&s===h/2&&(a=o,s=l)}var f=[[a,s],[o,l]],p=l-s,d=o-a,g=o,_=l,m=l<s&&o>a||o<a&&l>s?-1:1;if(Math.abs(d)<Math.abs(p)?(g=o,_=s+d*m):(_=l,g=a+p*m),"circle"===n&&(c.outerRadius||c.radius)){var v=(c.outerRadius||c.radius)+(c.radiusPadding||0),y=v/Math.sqrt(2);if(Math.abs(d)>y&&Math.abs(p)>y)f=[[a=y*(o<0?-1:1),s=y*(l<0?-1:1)],[g,_],[o,l]];else if(Math.abs(d)>Math.abs(p)){var x=Math.asin(-l/v);f=[[a=Math.abs(Math.cos(x)*v)*(o<0?-1:1),l],[o,l]]}else{var b=Math.acos(o/v);f=[[o,s=Math.abs(Math.sin(b)*v)*(l<0?-1:1)],[o,l]]}}else f=[[a,s],[g,_],[o,l]];return{components:[Kh({data:f,className:"connector"})]}}(r):function(t){var e=Qh(t);return{components:[Kh({data:e,className:"connector"})]}}(r);var o=a,s=o.components,l=void 0===s?[]:s,c=o.handles,u=void 0===c?[]:c,h=l[0];h&&(h.attrs.stroke=this.annotation.color,h.attrs.fill="none");var f=n.end||e.end,p={};if("arrow"===f){var d=h.data[1],g=h.data[0];Math.sqrt(Math.pow(d[0]-g[0],2)+Math.pow(d[1]-g[1],2))<5&&h.data[2]&&(d=h.data[2]),p=function(t){var e=t.annotation,n=t.start,i=t.end,r=t.scale,a=void 0===r?1:r,o=e.position;n=n?[-i[0]+n[0],-i[1]+n[1]]:[e.dx,e.dy],i||(i=[e.x-o.x,e.y-o.y]);var s=i[0],l=i[1],c=n[0],u=n[1],h=10*a,f=16/180*Math.PI,p=Math.atan(u/c);c<0&&(p+=Math.PI);var d=[[s,l],[Math.cos(p+f)*h+s,Math.sin(p+f)*h+l],[Math.cos(p-f)*h+s,Math.sin(p-f)*h+l],[s,l]];return{components:[Kh({data:d,className:"connector-end connector-arrow",classID:"connector-end"})]}}({annotation:this.annotation,start:d,end:g,scale:n.endScale})}else"dot"===f?p=function(t){var e=t.line,n=t.scale,i=void 0===n?1:n,r=Zh({className:"connector-end connector-dot",classID:"connector-end",data:{radius:3*Math.sqrt(i)}});return r.attrs.transform="translate("+e.data[0][0]+", "+e.data[0][1]+")",{components:[r]}}({line:h,scale:n.endScale}):f&&"none"!==f||this.connector&&this.connector.select(".connector-end").remove();return p.components&&(p.components.forEach((function(e){e.attrs.fill=t.annotation.color,e.attrs.stroke=t.annotation.color})),l=l.concat(p.components)),this.editMode&&0!==u.length&&l.push({type:"handle",handles:u}),l}},{key:"drawNote",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.annotation.note,i=n.align||e.align||"dynamic",r={bbox:e.bbox,align:i,offset:this.annotation.offset},a=n.lineType||e.lineType,o={};"vertical"===a?o=function(t){var e=t.align,n=t.x,i=void 0===n?0:n,r=t.y,a=void 0===r?0:r,o=t.bbox,s=t.offset;"top"===(e=$h(e,s.y))?a-=o.height:"middle"===e&&(a-=o.height/2);var l=[[i,a],[i,a+o.height]];return{components:[Kh({data:l,className:"note-line"})]}}(r):"horizontal"===a&&(o=function(t){var e=t.align,n=t.x,i=void 0===n?0:n,r=t.y,a=void 0===r?0:r,o=t.offset,s=t.bbox;"right"===(e=Jh(e,o.x))?i-=s.width:"middle"===e&&(i-=s.width/2);var l=[[i,a],[i+s.width,a]];return{components:[Kh({data:l,className:"note-line"})]}}(r));var s=o,l=s.components,c=void 0===l?[]:l,u=s.handles,h=void 0===u?[]:u;if(c.forEach((function(e){e.attrs.stroke=t.annotation.color})),this.editMode){h=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),c.push({type:"handle",handles:h});var f=this.dragNote.bind(this),p=this.dragstarted.bind(this),d=this.dragended.bind(this);this.note.call(ju().container(yu("g.annotations").node()).on("start",(function(t){return p(t)})).on("drag",(function(t){return f(t)})).on("end",(function(t){return d(t)})))}else this.note.on("mousedown.drag",null);return c}},{key:"drawNoteContent",value:function(t){var e=this.annotation.note,n=void 0!==e.padding?e.padding:this.notePadding,i=e.orientation||t.orientation||"topBottom",r=e.lineType||t.lineType,a=e.align||t.align||"dynamic";"vertical"===r?i="leftRight":"horizontal"===r&&(i="topBottom");var o=function(t){var e=t.padding,n=void 0===e?0:e,i=t.bbox,r=void 0===i?{x:0,y:0,width:0,height:0}:i,a=t.align,o=t.orientation,s=t.offset,l=void 0===s?{x:0,y:0}:s,c=-r.x,u=0;return-1!==Yh.indexOf(o)?(a=Jh(a,l.x),l.y<0&&"topBottom"===o||"top"===o?u-=r.height+n:u+=n,"middle"===a?c-=r.width/2:"right"===a&&(c-=r.width)):-1!==Xh.indexOf(o)&&(a=$h(a,l.y),l.x<0&&"leftRight"===o||"left"===o?c-=r.width+n:c+=n,"middle"===a?u-=r.height/2:"top"===a&&(u-=r.height)),{x:c,y:u}}({padding:n,bbox:t.bbox,offset:this.annotation.offset,orientation:i,align:a}),s=o.x,l=o.y;return this.offsetCornerX=s+this.annotation.dx,this.offsetCornerY=l+this.annotation.dy,this.note&&this.noteContent.attr("transform","translate("+s+", "+l+")"),[]}},{key:"drawOnScreen",value:function(t,e){return this.drawOnSVG(t,e)}},{key:"redrawSubject",value:function(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())}},{key:"redrawConnector",value:function(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())}},{key:"redrawNote",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:t})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:t}))}},{key:"setPosition",value:function(){var t=this.annotation.position;this.a.attr("transform","translate("+t.x+", "+t.y+")")}},{key:"clearComponents",value:function(){this.subject&&this.subject.select("*").remove(),this.connector&&this.connector.select("*").remove()}},{key:"setOffset",value:function(){if(this.note){var t=this.annotation.offset;this.note.attr("transform","translate("+t.x+", "+t.y+")")}}},{key:"setPositionWithAccessors",value:function(t){t&&this.annotation.data&&(this.mapX(t),this.mapY(t)),this.setPosition()}},{key:"setClassName",value:function(){this.a.attr("class","annotation "+(this.className&&this.className())+" "+(this.editMode?"editable":"")+" "+(this.annotation.className||""))}},{key:"draw",value:function(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()}},{key:"dragstarted",value:function(){su.sourceEvent.stopPropagation(),this.dispatcher&&this.dispatcher.call("dragstart",this.a,this.annotation),this.a.classed("dragging",!0),this.a.selectAll("circle.handle").style("pointer-events","none")}},{key:"dragended",value:function(){this.dispatcher&&this.dispatcher.call("dragend",this.a,this.annotation),this.a.classed("dragging",!1),this.a.selectAll("circle.handle").style("pointer-events","all")}},{key:"dragSubject",value:function(){var t=this.annotation.position;t.x+=su.dx,t.y+=su.dy,this.annotation.position=t}},{key:"dragNote",value:function(){var t=this.annotation.offset;t.x+=su.dx,t.y+=su.dy,this.annotation.offset=t}},{key:"mapHandles",value:function(t){var e=this;return t.map((function(t){return Bh({},t,{start:e.dragstarted.bind(e),end:e.dragended.bind(e)})}))}}]),t}(),af=function(t,e,n){return function(t){function i(t){Rh(this,i);var n=Wh(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,t));return n.typeSettings=e,e.disable&&e.disable.forEach((function(t){n[t]&&n[t].remove(),n[t]=void 0,"note"===t&&(n.noteContent=void 0)})),n}return Uh(i,t),jh(i,[{key:"className",value:function(){return""+(e.className||qh(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"className",this)&&qh(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"className",this).call(this)||"")}},{key:"drawSubject",value:function(t){return this.typeSettings.subject=Bh({},e.subject,this.typeSettings.subject),qh(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"drawSubject",this).call(this,Bh({},t,this.typeSettings.subject))}},{key:"drawConnector",value:function(t){return this.typeSettings.connector=Bh({},e.connector,this.typeSettings.connector),qh(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"drawConnector",this).call(this,Bh({},t,e.connector,this.typeSettings.connector))}},{key:"drawNote",value:function(t){return this.typeSettings.note=Bh({},e.note,this.typeSettings.note),qh(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"drawNote",this).call(this,Bh({},t,e.note,this.typeSettings.note))}},{key:"drawNoteContent",value:function(t){return qh(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"drawNoteContent",this).call(this,Bh({},t,e.note,this.typeSettings.note))}}],[{key:"init",value:function(t,e){return qh(i.__proto__||Object.getPrototypeOf(i),"init",this).call(this,t,e),n&&(t=n(t,e)),t}}]),i}(t)},of=function(t){function e(t){Rh(this,e);var n=Wh(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.textWrap=t.textWrap||120,n.drawText(),n}return Uh(e,t),jh(e,[{key:"updateTextWrap",value:function(t){this.textWrap=t,this.drawText()}},{key:"drawText",value:function(){if(this.note){pf(this.note,[this.annotation],"g","annotation-note-content");var t=this.note.select("g.annotation-note-content");pf(t,[this.annotation],"rect","annotation-note-bg"),pf(t,[this.annotation],"text","annotation-note-label"),pf(t,[this.annotation],"text","annotation-note-title");var e={height:0},n=this.a.select("text.annotation-note-label"),i=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,r=this.annotation.note&&this.annotation.note.wrapSplitter||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrapSplitter,a=this.annotation.note&&this.annotation.note.bgPadding||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.bgPadding,o={top:0,bottom:0,left:0,right:0};if("number"==typeof a?o={top:a,bottom:a,left:a,right:a}:a&&"object"===(void 0===a?"undefined":Ih(a))&&(o=Bh(o,a)),this.annotation.note.title){var s=this.a.select("text.annotation-note-title");s.text(this.annotation.note.title),s.attr("fill",this.annotation.color),s.attr("font-weight","bold"),s.call(gf,i,r),e=s.node().getBBox()}n.text(this.annotation.note.label).attr("dx","0"),n.call(gf,i,r),n.attr("y",1.1*e.height||0),n.attr("fill",this.annotation.color);var l=this.getNoteBBox();this.a.select("rect.annotation-note-bg").attr("width",l.width+o.left+o.right).attr("height",l.height+o.top+o.bottom).attr("x",l.x-o.left).attr("y",-o.top).attr("fill","white").attr("fill-opacity",0)}}}]),e}(rf),sf=af(of,{className:"label",note:{align:"middle"}}),lf=af(of,{className:"callout",note:{lineType:"horizontal"}}),cf=(af(lf,{className:"callout elbow",connector:{type:"elbow"}}),af(lf,{className:"callout curve",connector:{type:"curve"}}),af(rf,{className:"badge",subject:{type:"badge"},disable:["connector","note"]}),af(of,{className:"callout circle",subject:{type:"circle"},note:{lineType:"horizontal"},connector:{type:"elbow"}})),uf=af(of,{className:"callout rect",subject:{type:"rect"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),hf=function(t){function e(){return Rh(this,e),Wh(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return Uh(e,t),jh(e,[{key:"mapY",value:function(t){qh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"mapY",this).call(this,t);var n=this.annotation;(n.subject.x1||n.subject.x2)&&n.data&&t.y&&(n.y=t.y(n.data)),!n.subject.x1&&!n.subject.x2||n.x||(n.x=n.subject.x1||n.subject.x2)}},{key:"mapX",value:function(t){qh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"mapX",this).call(this,t);var n=this.annotation;(n.subject.y1||n.subject.y2)&&n.data&&t.x&&(n.x=t.x(n.data)),!n.subject.y1&&!n.subject.y2||n.y||(n.y=n.subject.y1||n.subject.y2)}}]),e}(lf),ff=af(hf,{className:"callout xythreshold",subject:{type:"threshold"}}),pf=function(t,e,n,i,r){var a=t.selectAll(n+"."+(r||i)).data(e);return a.enter().append(n).merge(a).attr("class",i),a.exit().remove(),t},df=function(t,e,n){var i=n.component,r=n.name;i&&i.on("mouseover.annotations",(function(){t.call(r+"over",i,e)})).on("mouseout.annotations",(function(){return t.call(r+"out",i,e)})).on("click.annotations",(function(){return t.call(r+"click",i,e)}))},gf=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.2;t.each((function(){for(var t=yu(this),r=t.text().split(n||/[ \t\r\n]+/).reverse().filter((function(t){return""!==t})),a=void 0,o=[],s=t.text(null).append("tspan").attr("x",0).attr("dy","0.8em");a=r.pop();)o.push(a),s.text(o.join(" ")),s.node().getComputedTextLength()>e&&o.length>1&&(o.pop(),s.text(o.join(" ")),o=[a],s=t.append("tspan").attr("x",0).attr("dy",i+"em").text(a))}))},_f=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:":not(.handle)";return t?t.selectAll(e).nodes().reduce((function(t,e){var n=e.getBBox();t.x=Math.min(t.x,n.x),t.y=Math.min(t.y,n.y),t.width=Math.max(t.width,n.width);var i=e&&e.attributes&&e.attributes.y;return t.height=Math.max(t.height,(i&&parseFloat(i.value)||0)+n.height),t}),{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}};function mf(){var t=[],e=void 0,n=void 0,i=[],r={},a={},o=!1,s=void 0,l=lf,c=void 0,u=void 0,h=Nu("subjectover","subjectout","subjectclick","connectorover","connectorout","connectorclick","noteover","noteout","noteclick","dragend","dragstart"),f=void 0,p=function(n){f=n,o||n.selectAll("circle.handle").remove();var p=t.map((function(t){return t.type||(t.type=l),t.disable||(t.disable=i),new Hh(t)}));e=e||new Vh({annotations:p,accessors:r,accessorsInverse:a,ids:s}),n.selectAll("g").data([e]).enter().append("g").attr("class","annotations");var d=n.select("g.annotations");pf(d,e.annotations,"g","annotation");var g=d.selectAll("g.annotation");g.each((function(t){var e=yu(this);e.attr("class","annotation"),pf(e,[t],"g","annotation-connector"),pf(e,[t],"g","annotation-subject"),pf(e,[t],"g","annotation-note"),pf(e.select("g.annotation-note"),[t],"g","annotation-note-content"),t.type="[object Object]"===t.type.toString()?t.type:new t.type({a:e,annotation:t,textWrap:c,notePadding:u,editMode:o,dispatcher:h,accessors:r}),t.type.draw(),t.type.drawText&&t.type.drawText()}))};return p.json=function(){return console.log("Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.",e.json),window.copy(JSON.stringify(e.json.map((function(t){return delete t.type,t})))),p},p.update=function(){return t&&e&&(t=e.annotations.map((function(t){return t.type.draw(),t}))),p},p.updateText=function(){return e&&(e.updateText(c),t=e.annotations),p},p.updatedAccessors=function(){return e.setPositionWithAccessors(),t=e.annotations,p},p.disable=function(n){return arguments.length?(i=n,e&&(e.updateDisable(i),t=e.annotations),p):i},p.textWrap=function(n){return arguments.length?(c=n,e&&(e.updateTextWrap(c),t=e.annotations),p):c},p.notePadding=function(n){return arguments.length?(u=n,e&&(e.updateNotePadding(u),t=e.annotations),p):u},p.type=function(n,i){return arguments.length?(l=n,e&&(e.annotations.map((function(t){t.type.note&&t.type.note.selectAll("*:not(.annotation-note-content)").remove(),t.type.noteContent&&t.type.noteContent.selectAll("*").remove(),t.type.subject&&t.type.subject.selectAll("*").remove(),t.type.connector&&t.type.connector.selectAll("*").remove(),t.type.typeSettings={},t.type=l,t.subject=i&&i.subject||t.subject,t.connector=i&&i.connector||t.connector,t.note=i&&i.note||t.note})),t=e.annotations),p):l},p.annotations=function(n){if(!arguments.length)return e&&e.annotations||t;(t=n,e&&e.annotations)&&(t.some((function(t){return!t.type||"[object Object]"!==t.type.toString()}))?(e=null,p(f)):e.annotations=t);return p},p.context=function(t){return arguments.length?(n=t,p):n},p.accessors=function(t){return arguments.length?(r=t,p):r},p.accessorsInverse=function(t){return arguments.length?(a=t,p):a},p.ids=function(t){return arguments.length?(s=t,p):s},p.editMode=function(n){return arguments.length?(o=n,f&&f.selectAll("g.annotation").classed("editable",o),e&&(e.editMode(o),t=e.annotations),p):o},p.collection=function(t){return arguments.length?(e=t,p):e},p.on=function(){var t=h.on.apply(h,arguments);return t===h?p:t},p}function vf(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function yf(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vf(Object(n),!0).forEach((function(e){ma(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vf(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function xf(t){if(t.svg_){var e=t.svg_.select("#em-zoom-group-"+t.svgId_);e.selectAll(".em-annotation-group").remove();var n=t.annotations_;if(n){var i={annotationLabel:sf,annotationCallout:lf,annotationCalloutRect:uf,annotationCalloutCircle:cf,annotationXYThreshold:ff},r=n.annotations.map((function(t){var e=i[t.type]||sf;return yf(yf({},t),{},{type:e})})),a=mf().type(sf).annotations(r).editMode(n.editMode);e.append("g").attr("class","em-annotation-group").call(a)}}}var bf=function(t,e){var n,i;t.labels_.config||(t.labels_.config=Cf),t.labels_.statLabelsPositions||(t.labels_.statLabelsPositions=Af);var r=e.select("#em-labels"),a=r.empty()?e.append("g").attr("id","em-labels"):r;null!==(n=t.labels_)&&void 0!==n&&n.values&&"ps"!==t._mapType&&Ef(t,a);var o=(null===(i=t.labels_)||void 0===i?void 0:i.labels)||Cf["".concat(t.geo,"_").concat(t.proj_,".cc")];if(o){var s,l=a.append("g").attr("class","em-label-shadows").attr("text-anchor","middle"),c=a.append("g").attr("class","em-labels").attr("text-anchor","middle");if(null!==(s=t.labels_)&&void 0!==s&&s.shadows)l.selectAll("text").data(o).enter().append("text").attr("id",(function(t){return"em-label-shadow-"+t.text.replace(/\s+/g,"-")})).attr("class",(function(t){return"em-label-shadow em-label-shadow-"+t.class})).attr("x",(function(e){return e.rotate?0:t._projection([e.x,e.y])[0]})).attr("y",(function(e){return e.rotate?0:t._projection([e.x,e.y])[1]})).attr("dy",-7).attr("transform",(function(e){if(e.rotate){var n=t._projection([e.x,e.y]),i=n[0],r=n[1];return"translate(".concat(i,",").concat(r,") rotate(").concat(e.rotate,")")}return"rotate(0)"})).text((function(t){return t.text}));c.selectAll("text").data(o).enter().append("text").attr("id",(function(t){return"em-label-"+t.text.replace(/\s+/g,"-")})).attr("class",(function(t){return"em-label em-label-"+t.class})).attr("x",(function(e){return e.rotate?0:t._projection([e.x,e.y])[0]})).attr("y",(function(e){return e.rotate?0:t._projection([e.x,e.y])[1]})).attr("dy",-7).attr("transform",(function(e){if(e.rotate){var n=t._projection([e.x,e.y]),i=n[0],r=n[1];return"translate(".concat(i,",").concat(r,") rotate(").concat(e.rotate,")")}return"rotate(0)"})).text((function(t){return t.text}))}},wf=function(t){var e,n,i;if(t){t.svg_.selectAll("g.em-stat-label > *").remove(),t.svg_.selectAll("g.em-stat-label-shadow > *").remove();var r=t.svg_.selectAll("g.em-stat-label"),a=null!==(e=t.labels_)&&void 0!==e&&e.statLabelsFilterFunction?null===(n=t.labels_)||void 0===n?void 0:n.statLabelsFilterFunction:Mf,o=t.statData();return r.filter((function(e){return a(e,t)})).each((function(e){var n=Ft(this),i=Sf(e,o);t.labels_.backgrounds&&function(t,e){var n=5,i=2,r=e.append("text").attr("visibility","hidden").text(t).node().getBBox(),a=r.width,o=r.height;e.select('text[visibility="hidden"]').remove();var s=-a/2-n,l=-o/2-i;e.append("rect").attr("x",s).attr("y",l).attr("width",a+2*n).attr("height",o+2*i).attr("class","em-label-background")}(i,n),n.append("text").text(i).attr("class","em-stat-label-text")})),null!==(i=t.labels_)&&void 0!==i&&i.shadows&&t.svg_.selectAll("g.em-stat-label-shadow").filter((function(e){return a(e,t)})).append("text").text((function(t){return Sf(t,o)})),t}console.warn("No map specified")},Sf=function(t,e){if(e&&null!=e&&e.get){var n=e.get(t.properties.id);if(!n||!n.value&&0!==n&&0!==n.value)return"";if(":"!==n.value)return la(n.value)}},Mf=function(t,e){var n=e.statData().get(t.properties.id);return!(!n||!n.value&&0!==n&&0!==n.value)},Ef=function(t,e){var n,i=e.append("g").attr("class","em-stat-labels-shadows").attr("text-anchor","middle"),r=e.append("g").attr("class","em-stat-labels").attr("text-anchor","middle"),a=[];t.Geometries.geoJSONs.nutsrg?a="mixed"==t.nutsLevel_?t.Geometries.geoJSONs.mixed.rg0.concat(t.Geometries.geoJSONs.mixed.rg1,t.Geometries.geoJSONs.mixed.rg2,t.Geometries.geoJSONs.mixed.rg3,t.Geometries.geoJSONs.cntrg):t.Geometries.geoJSONs.nutsrg.concat(t.Geometries.geoJSONs.cntrg):t.Geometries.userGeometries&&(a=t.Geometries.statisticalRegions.features);var o=a.filter((function(t,e,n){return e===n.findIndex((function(e){return e.properties.id===t.properties.id}))}));r.selectAll("g").data(o).enter().append("g").attr("transform",(function(e){if(t.labels_.statLabelsPositions[e.properties.id]){var n=t.labels_.statLabelsPositions[e.properties.id],i=t._projection([n.x,n.y]),r=i[0].toFixed(3),a=i[1].toFixed(3);return"translate(".concat(r,",").concat(a,")")}var o=t._pathFunction.centroid(e);return t.labels_.processValueLabelCentroids&&(o=t.labels_.processValueLabelCentroids(e,o)),"translate("+o+")"})).attr("class","em-stat-label"),null!==(n=t.labels_)&&void 0!==n&&n.shadows&&i.selectAll("g").data(a).enter().append("g").attr("transform",(function(e){if(t.labels_.statLabelsPositions[e.properties.id]){var n=t._projection([t.labels_.statLabelsPositions[e.properties.id].x,t.labels_.statLabelsPositions[e.properties.id].y]),i=n[0].toFixed(3),r=n[1].toFixed(3);return"translate(".concat(i,",").concat(r,")")}var a=t._pathFunction.centroid(e);return t.labels_.processValueLabelCentroids&&(a=t.labels_.processValueLabelCentroids(e,a)),"translate("+a+")"})).attr("class","em-stat-label-shadow")},Cf={EUR_3035:{cc:[{text:"AL",x:515e4,y:206e4,class:"cc",size:7},{text:"AT",x:467e4,y:269e4,class:"cc",size:18},{text:"BE",x:393e4,y:301e4,class:"cc",size:17},{text:"BG",x:5567e3,y:225e4,class:"cc",size:22},{text:"HR",x:484e4,y:248e4,class:"cc",size:10},{text:"CY",x:6426e3,y:148e4,class:"cc",size:10},{text:"CZ",x:4707e3,y:292e4,class:"cc",size:18},{text:"DK",x:4316e3,y:3621e3,class:"cc",size:20},{text:"EE",x:522e4,y:399e4,class:"cc",size:12},{text:"FI",x:515e4,y:4424e3,class:"cc",size:20},{text:"FR",x:3767740,y:2662817,class:"cc",size:22},{text:"DE",x:4347284,y:3093276,class:"cc",size:22},{text:"EL",x:537e4,y:175e4,class:"cc",size:22},{text:"HU",x:502e4,y:263e4,class:"cc",size:17},{text:"IS",x:304e4,y:4833e3,class:"cc",size:10},{text:"IE",x:3136e3,y:3394e3,class:"cc",size:17},{text:"IT",x:4469967,y:2181963,class:"cc",size:22},{text:"LV",x:529e4,y:38e5,class:"cc",size:12},{text:"LT",x:519e4,y:363e4,class:"cc",size:12},{text:"LU",x:412e4,y:294e4,class:"cc",size:12},{text:"MT",x:4731e3,y:13e5,class:"cc",size:10},{text:"ME",x:5073e3,y:2185e3,class:"cc",size:7},{text:"GE",x:6942680,y:266e4,class:"cc"},{text:"UA",x:589e4,y:305e4,class:"cc"},{text:"BA",x:4949262,y:2338688,class:"cc"},{text:"MD",x:574e4,y:279e4,class:"cc"},{text:"MK",x:53e5,y:208e4,class:"cc",size:10},{text:"NL",x:402e4,y:3208e3,class:"cc",size:17},{text:"NO",x:43e5,y:4147e3,class:"cc",size:20},{text:"PL",x:4964e3,y:32e5,class:"cc",size:22},{text:"PT",x:277e4,y:199e4,class:"cc",size:18},{text:"RO",x:5451e3,y:26e5,class:"cc",size:22},{text:"RS",x:52e5,y:235e4,class:"cc",size:10},{text:"SK",x:504e4,y:286e4,class:"cc",size:12},{text:"SI",x:4675e3,y:25e5,class:"cc",size:10},{text:"ES",x:3160096,y:19e5,class:"cc",size:22},{text:"SE",x:463e4,y:4e6,class:"cc",size:20},{text:"CH",x:417e4,y:26e5,class:"cc",size:16},{text:"TR",x:651e4,y:21e5,class:"cc",size:22},{text:"UK",x:3558e3,y:325e4,class:"cc",size:17}],en:[{text:"MEDITERRANEAN SEA",x:398e4,y:16e5,class:"seas",size:12,letterSpacing:7},{text:"ATLANTIC OCEAN",x:282e4,y:254e4,class:"seas",size:12,letterSpacing:2},{text:"NORTH SEA",x:3915e3,y:37e5,class:"seas",size:12},{text:"BALTIC SEA",x:49e5,y:373e4,class:"seas",size:10,rotate:-50},{text:"NORWEGIAN SEA",x:385e4,y:48e5,class:"seas",size:12,letterSpacing:1},{text:"BLACK SEA",x:63e5,y:25e5,class:"seas",size:12,letterSpacing:4},{text:"ALBANIA",cc:"AL",x:51e5,y:206e4,class:"countries",size:7,rotate:80},{text:"AUSTRIA",cc:"AT",x:467e4,y:2629e3,class:"countries",size:10},{text:"BELGIUM",cc:"BE",x:39e5,y:303e4,class:"countries",size:7,rotate:30},{text:"BULGARIA",cc:"BG",x:5567e3,y:2256e3,class:"countries",size:12},{text:"CROATIA",cc:"HR",x:4876e3,y:2455e3,class:"countries",size:7},{text:"CYPRUS",cc:"CY",x:6426e3,y:148e4,class:"countries",size:10},{text:"CZECHIA",cc:"CZ",x:4707e3,y:2885e3,class:"countries",size:12},{text:"DENMARK",cc:"DK",x:4316e3,y:3621e3,class:"countries",size:10},{text:"ESTONIA",cc:"EE",x:522e4,y:399e4,class:"countries",size:7},{text:"FINLAND",cc:"FI",x:515e4,y:4424e3,class:"countries",size:12},{text:"FRANCE",cc:"FR",x:3767740,y:2662817,class:"countries",size:12},{text:"GERMANY",cc:"DE",x:4347284,y:3093276,class:"countries",size:12},{text:"GREECE",cc:"EL",x:547e4,y:186e4,class:"countries",size:12},{text:"HUNGARY",cc:"HU",x:502e4,y:263e4,class:"countries",size:10},{text:"ICELAND",cc:"IS",x:304e4,y:4833e3,class:"countries",size:10},{text:"IRELAND",cc:"IE",x:3136e3,y:3394e3,class:"countries",size:10},{text:"ITALY",cc:"IT",x:4469967,y:2181963,class:"countries",size:12},{text:"LATVIA",cc:"LV",x:529e4,y:38e5,class:"countries",size:7},{text:"LITHUANIA",cc:"LT",x:519e4,y:363e4,class:"countries",size:7},{text:"LUX.",cc:"LU",x:412e4,y:294e4,class:"countries",size:7},{text:"MALTA",cc:"MT",x:4731e3,y:133e4,class:"countries",size:7},{text:"MONT.",cc:"ME",x:5073e3,y:2185e3,class:"countries",size:7},{text:"N. MACEDONIA",cc:"MK",x:53e5,y:2082e3,class:"countries",size:7},{text:"NETHERLANDS",cc:"NL",x:3977e3,y:3208e3,class:"countries",size:7},{text:"NORWAY",cc:"NO",x:433e4,y:4147e3,class:"countries",size:12,rotate:-75},{text:"POLAND",cc:"PL",x:4964e3,y:3269e3,class:"countries",size:12},{text:"PORTUGAL",cc:"PT",x:283e4,y:199e4,class:"countries",size:10,rotate:-75},{text:"ROMANIA",cc:"RO",x:5451e3,y:26e5,class:"countries",size:12},{text:"SERBIA",cc:"RS",x:52e5,y:23e5,class:"countries",size:7},{text:"SLOVAKIA",cc:"SK",x:504e4,y:2835e3,class:"countries",size:7,rotate:-30},{text:"SLOVENIA",cc:"SI",x:4735e3,y:2522e3,class:"countries",size:7,rotate:-30},{text:"SPAIN",cc:"ES",x:3160096,y:185e4,class:"countries",size:12},{text:"SWEDEN",cc:"SE",x:463e4,y:41e5,class:"countries",size:12,rotate:-75},{text:"SWITZERLAND",cc:"CH",x:42e5,y:2564e3,class:"countries",size:7},{text:"TURKEY",cc:"TR",x:651e4,y:21e5,class:"countries",size:12},{text:"U.K.",cc:"UK",x:3558e3,y:325e4,class:"countries",size:12}],fr:[{text:"MER MÉDITERRANÉE",x:5472e3,y:1242e3,class:"seas",size:12},{text:"OCÈAN ATLANTIQUE",x:282e4,y:254e4,class:"seas",size:12},{text:"MER DU NORD",x:3915e3,y:37e5,class:"seas",size:12},{text:"MER BALTIQUE",x:49e5,y:3672e3,class:"seas",size:10,rotate:-50},{text:"MER DE NORVÈGE",x:385e4,y:48e5,class:"seas",size:12},{text:"MER NOIRE",x:6265e3,y:2472e3,class:"seas",size:12},{text:"ALBANIE",x:51e5,y:206e4,class:"countries",size:7,rotate:80},{text:"AUTRICHE",x:467e4,y:2629e3,class:"countries",size:10},{text:"BELGIQUE",x:39e5,y:303e4,class:"countries",size:7,rotate:30},{text:"BULGARIE",x:5567e3,y:2256e3,class:"countries",size:12},{text:"CROATIE",x:4876e3,y:2455e3,class:"countries",size:7},{text:"CHYPRE",x:6426e3,y:148e4,class:"countries",size:10},{text:"TCHÉQUIE",x:4707e3,y:2885e3,class:"countries",size:12},{text:"DANEMARK",x:4316e3,y:3621e3,class:"countries",size:10},{text:"ESTONIE",x:522e4,y:399e4,class:"countries",size:10},{text:"FINLANDE",x:5125e3,y:4424e3,class:"countries",size:12},{text:"FRANCE",x:3767740,y:2662817,class:"countries",size:12},{text:"ALLEMAGNE",x:4347284,y:3093276,class:"countries",size:12},{text:"GRÈCE",x:542e4,y:186e4,class:"countries",size:12},{text:"HONGRIE",x:502e4,y:2654e3,class:"countries",size:10},{text:"ISLANDE",x:304e4,y:4833e3,class:"countries",size:10},{text:"IRLANDE",x:3136e3,y:3394e3,class:"countries",size:10},{text:"ITALIE",x:45e5,y:2181963,class:"countries",size:12},{text:"LETTONIE",x:529e4,y:3776e3,class:"countries",size:10},{text:"LITUANIE",x:519e4,y:363e4,class:"countries",size:10},{text:"LUX.",x:412e4,y:294e4,class:"countries",size:7},{text:"MALTE",x:4731e3,y:1335e3,class:"countries",size:7},{text:"MONT.",x:5073e3,y:2185e3,class:"countries",size:7},{text:"MAC. DU NORD",x:53e5,y:2082e3,class:"countries",size:7},{text:"PAYS-BAS",x:3977e3,y:3208e3,class:"countries",size:7},{text:"NORVEGE",x:433e4,y:4147e3,class:"countries",size:12,rotate:-75},{text:"POLOGNE",x:4964e3,y:3269e3,class:"countries",size:12},{text:"PORTUGAL",x:2836136,y:1956179,class:"countries",size:10,rotate:-75},{text:"ROUMANIE",x:5451e3,y:26e5,class:"countries",size:12},{text:"SERBIE",x:52e5,y:23e5,class:"countries",size:7},{text:"SLOVAQUIE",x:504e4,y:2835e3,class:"countries",size:7,rotate:-30},{text:"SLOVÉNIE",x:4735e3,y:2522e3,class:"countries",size:7,rotate:-35},{text:"ESPAGNE",x:3160096,y:185e4,class:"countries",size:12},{text:"SUÈDE",x:47e5,y:4401e3,class:"countries",size:12,rotate:-75},{text:"SUISSE",x:42e5,y:2564e3,class:"countries",size:7},{text:"TURQUIE",x:651e4,y:21e5,class:"countries",size:12},{text:"ROYAUME-UNI",x:3558e3,y:325e4,class:"countries",size:10}],de:[{text:"MITTELMEER",x:5472e3,y:12e5,class:"seas",size:12,letterSpacing:7},{text:"ATLANTISCHER OZEAN",x:282e4,y:254e4,class:"seas",size:12},{text:"NORDSEE",x:3915e3,y:37e5,class:"seas",size:12},{text:"OSTSEE",x:49e5,y:3672e3,class:"seas",size:10,rotate:-50},{text:"NORWEGISCHE MEER",x:385e4,y:48e5,class:"seas",size:12},{text:"SCHWARZE MEER",x:63e5,y:25e5,class:"seas",size:12,letterSpacing:1},{text:"ALBANIEN",x:51e5,y:206e4,class:"countries",size:7,rotate:80},{text:"ÖSTERREICH",x:465e4,y:2629e3,class:"countries",size:7},{text:"BELGIEN",x:39e5,y:303e4,class:"countries",size:7,rotate:30},{text:"BULGARIEN",x:5567e3,y:2256e3,class:"countries",size:10},{text:"KROATIEN",x:4876e3,y:2455e3,class:"countries",size:7},{text:"ZYPERN",x:6426e3,y:148e4,class:"countries",size:10},{text:"TSCHECHIEN",x:4707e3,y:2885e3,class:"countries",size:7},{text:"DÄNEMARK",x:4316e3,y:3621e3,class:"countries",size:10},{text:"ESTLAND",x:522e4,y:399e4,class:"countries",size:7},{text:"FINNLAND",x:515e4,y:4424e3,class:"countries",size:12},{text:"FRANKREICH",x:3767740,y:2662817,class:"countries",size:12},{text:"DEUTSCHLAND",x:4347284,y:3093276,class:"countries",size:10},{text:"GRIECHENLAND",x:555e4,y:15e5,class:"countries",size:10},{text:"UNGARN",x:502e4,y:263e4,class:"countries",size:10},{text:"ISLAND",x:304e4,y:4833e3,class:"countries",size:10},{text:"IRLAND",x:3136e3,y:3394e3,class:"countries",size:10},{text:"ITALIEN",x:4469967,y:2181963,class:"countries",size:12,rotate:35},{text:"LETTLAND",x:529e4,y:38e5,class:"countries",size:7},{text:"LITAUEN",x:519e4,y:363e4,class:"countries",size:7},{text:"LUX.",x:412e4,y:294e4,class:"countries",size:7},{text:"MALTA",x:4731e3,y:133e4,class:"countries",size:7},{text:"MONT.",x:5073e3,y:2185e3,class:"countries",size:7},{text:"NORDMAZEDONIEN",x:535e4,y:2082e3,class:"countries",size:7},{text:"NIEDERLANDE",x:3977e3,y:3208e3,class:"countries",size:7},{text:"NORWEGEN",x:433e4,y:4147e3,class:"countries",size:12,rotate:-75},{text:"POLEN",x:4964e3,y:3269e3,class:"countries",size:12},{text:"PORTUGAL",x:2836136,y:1956179,class:"countries",size:10,rotate:-75},{text:"RUMÄNIEN",x:5451e3,y:26e5,class:"countries",size:12},{text:"SERBIEN",x:52e5,y:23e5,class:"countries",size:7},{text:"SLOWAKEI",x:504e4,y:2835e3,class:"countries",size:7,rotate:-30},{text:"SLOWENIEN",x:4735e3,y:2522e3,class:"countries",size:7,rotate:-30},{text:"SPANIEN",x:3160096,y:185e4,class:"countries",size:12},{text:"SCHWEDEN",x:467e4,y:418e4,class:"countries",size:12,rotate:-75},{text:"SCHWEIZ",x:42e5,y:2564e3,class:"countries",size:7},{text:"TRUTHAHN",x:651e4,y:21e5,class:"countries",size:12},{text:"VEREINIGTES",x:355e4,y:352e4,class:"countries",size:10},{text:"KÖNIGREICH",x:355e4,y:342e4,class:"countries",size:10}]},IC_32628:{cc:[{text:"ES",x:420468,y:3180647,class:"cc",size:12}],en:[{text:"Canary Islands",x:420468,y:3180647,class:"countries",size:12}],fr:[{text:"Les îles Canaries",x:420468,y:3180647,class:"countries",size:12}],de:[{text:"Kanarische Inseln",x:41e4,y:3180647,class:"countries",size:12}]},GP_32620:{cc:[{text:"FR",x:667e3,y:174e4,class:"cc",size:12}],en:[{text:"Guadeloupe",x:7e5,y:181e4,class:"countries",size:12}]},MQ_32620:{cc:[{text:"FR",x:716521,y:1621322,class:"cc",size:12}],en:[{text:"Martinique",x:716521,y:1621322,class:"countries",size:12}]},GF_32622:{cc:[{text:"FR",x:266852,y:444074,class:"cc",size:12}],en:[{text:"Guyane",x:266852,y:444074,class:"countries",size:12}],de:[{text:"Guayana",x:266852,y:444074,class:"countries",size:12}]},RE_32740:{cc:[{text:"FR",x:348011,y:768e4,class:"cc",size:10}],en:[{text:"Réunion",x:348011,y:768e4,class:"countries",size:10}]},YT_32738:{cc:[{text:"FR",x:516549,y:8593920,class:"cc",size:10}],en:[{text:"Mayotte",x:516549,y:8593920,class:"countries",size:10}]},MT_3035:{cc:[{text:"MT",x:4719755,y:1410701,class:"cc",size:10}],en:[{text:"Malta",x:4719755,y:1410701,class:"countries",size:10}]},PT20_32626:{cc:[{text:"PT",x:397418,y:432e4,class:"cc",size:10}],en:[{text:"Azores",x:397418,y:432e4,class:"countries",size:10}],fr:[{text:"Açores",x:397418,y:4271471,class:"countries",size:10}],de:[{text:"Azoren",x:397418,y:4271471,class:"countries",size:10}]},PT30_32628:{cc:[{text:"PT",x:333586,y:3624e3,class:"cc",size:10,rotate:30}],en:[{text:"Madeira",x:333586,y:3624e3,class:"countries",size:10,rotate:30}],fr:[{text:"Madère",x:333586,y:3624e3,class:"countries",size:10,rotate:30}]},LI_3035:{cc:[{text:"LI",x:4287060,y:266e4,class:"cc",size:12}],en:[{text:"Liechtenstein",x:4287060,y:2679e3,class:"countries",size:7}]},IS_3035:{cc:[{text:"IS",x:3011804,y:496e4,class:"cc",size:12}],en:[{text:"Iceland",x:3011804,y:496e4,class:"countries",size:12}],fr:[{text:"Islande",x:3011804,y:496e4,class:"countries",size:12}],de:[{text:"Island",x:3011804,y:496e4,class:"countries",size:12}]},SJ_SV_3035:{cc:[{text:"NO",x:457e4,y:626e4,class:"cc",size:10}],en:[{text:"Svalbard",x:457e4,y:626e4,class:"countries",size:10}],de:[{text:"Spitzbergen",x:457e4,y:626e4,class:"countries",size:7}]},SJ_JM_3035:{cc:[{text:"NO",x:3647762,y:5420300,class:"cc",size:10}],en:[{text:"Jan Mayen",x:3647762,y:5420300,class:"countries",size:7}]},CARIB_32620:{cc:[{text:"FR",x:7e5,y:181e4,class:"cc",size:10},{text:"FR",x:64e4,y:159e4,class:"cc",size:10},{text:"FR",x:54e4,y:1962e3,class:"cc",size:7}],en:[{text:"Guadeloupe",x:7e5,y:181e4,class:"countries",size:10},{text:"Martinique",x:57e4,y:159e4,class:"countries",size:10},{text:"Saint Martin",x:597e3,y:1962e3,class:"countries",size:7}]},WORLD_54030:{en:[{text:"NORTH ATLANTIC",x:-45,y:25,class:"seas",size:10,letterSpacing:1},{text:"SOUTH ATLANTIC",x:-15,y:-25,class:"seas",size:10,letterSpacing:1},{text:"SOUTH PACIFIC",x:-126,y:-25,class:"seas",size:10,letterSpacing:1},{text:"NORTH",x:-136,y:25,class:"seas",size:10,letterSpacing:1},{text:"PACIFIC",x:-134,y:20,class:"seas",size:10,letterSpacing:1},{text:"INDIAN OCEAN",x:80,y:-25,class:"seas",size:10,letterSpacing:1},{text:"SOUTHERN OCEAN",x:-5,y:-67,class:"seas",size:10,letterSpacing:6}]}},Af={AL:{x:515e4,y:2e6},AT:{x:467e4,y:274e4},BE:{x:393e4,y:306e4},BG:{x:5567e3,y:23e5},HR:{x:4657718,y:2400243},CY:{x:6426e3,y:157e4},CH:{x:417e4,y:26e5},CZ:{x:4707e3,y:295e4},DK:{x:4316e3,y:3621e3},EE:{x:522e4,y:405e4},FI:{x:515e4,y:4424e3},FR:{x:3767740,y:2662817},DE:{x:4347284,y:3093276},EL:{x:537e4,y:175e4},HU:{x:502e4,y:267e4},IS:{x:304e4,y:4833e3},IE:{x:3136e3,y:3394e3},IT:{x:45e5,y:2181963},LV:{x:529e4,y:384e4},LT:{x:519e4,y:367e4},LU:{x:412e4,y:294e4},MT:{x:488e4,y:148e4},GE:{x:6912680,y:2696554},UA:{x:5865507,y:3130158},BA:{x:4959262,y:2368688},MD:{x:5736016,y:2835957},ME:{x:5073e3,y:223e4},MK:{x:53e5,y:213e4},NL:{x:402e4,y:3208e3},NO:{x:43e5,y:4147e3},PL:{x:4964e3,y:32e5},PT:{x:276e4,y:199e4},RO:{x:5451e3,y:26e5},RS:{x:52e5,y:237e4},SK:{x:504e4,y:289e4},SI:{x:466e4,y:255e4},ES:{x:32e5,y:2e6},SE:{x:463e4,y:4e6},TR:{x:651e4,y:21e5},UK:{x:3558e3,y:325e4},RU:{x:6842086,y:3230517}};function kf(t,e,n,i,r,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(i,r)}var Tf=n(756),Pf=n.n(Tf);function Nf(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function Lf(t,e){return fetch(t,e).then(Nf)}function Ff(t){return t}function Of(t,e){return"string"==typeof e&&(e=t.objects[e]),"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map((function(e){return Gf(t,e)}))}:Gf(t,e)}function Gf(t,e){var n=e.id,i=e.bbox,r=null==e.properties?{}:e.properties,a=function(t,e){var n=function(t){if(null==t)return Ff;var e,n,i=t.scale[0],r=t.scale[1],a=t.translate[0],o=t.translate[1];return function(t,s){s||(e=n=0);var l=2,c=t.length,u=new Array(c);for(u[0]=(e+=t[0])*i+a,u[1]=(n+=t[1])*r+o;l<c;)u[l]=t[l],++l;return u}}(t.transform),i=t.arcs;function r(t,e){e.length&&e.pop();for(var r=i[t<0?~t:t],a=0,o=r.length;a<o;++a)e.push(n(r[a],a));t<0&&function(t,e){for(var n,i=t.length,r=i-e;r<--i;)n=t[r],t[r++]=t[i],t[i]=n}(e,o)}function a(t){return n(t)}function o(t){for(var e=[],n=0,i=t.length;n<i;++n)r(t[n],e);return e.length<2&&e.push(e[0]),e}function s(t){for(var e=o(t);e.length<4;)e.push(e[0]);return e}function l(t){return t.map(s)}function c(t){var e,n=t.type;switch(n){case"GeometryCollection":return{type:n,geometries:t.geometries.map(c)};case"Point":e=a(t.coordinates);break;case"MultiPoint":e=t.coordinates.map(a);break;case"LineString":e=o(t.arcs);break;case"MultiLineString":e=t.arcs.map(o);break;case"Polygon":e=l(t.arcs);break;case"MultiPolygon":e=t.arcs.map(l);break;default:return null}return{type:n,coordinates:e}}return c(e)}(t,e);return null==n&&null==i?{type:"Feature",properties:r,geometry:a}:null==i?{type:"Feature",id:n,properties:r,geometry:a}:{type:"Feature",id:n,bbox:i,properties:r,geometry:a}}var Df={2021:{3035:{"03M":{type:"Topology",arcs:[[[3061,1303],[-152,-59],[-32,-66],[-65,72],[-96,7],[-16,59],[-64,19],[-56,-39],[-120,39],[-184,-19],[-16,26],[32,52],[-16,72],[24,40],[8,183]],[[2885,0],[-8,46],[-65,85],[-40,-7],[-40,40],[0,111],[80,13],[25,46],[72,13],[40,98],[-56,118],[144,196],[-24,79],[88,59],[-24,98],[-8,20],[24,39],[8,52],[48,72],[-88,125]],[[825,2638],[-112,-98],[-72,-7],[-88,-118],[-176,-39],[56,-91],[88,-33],[24,-53],[56,-39],[24,-91],[-56,-46],[24,-105],[-56,-92],[-104,0],[-48,-104],[-16,-40],[-57,7],[-40,-53],[-16,-78],[113,-118],[-97,-65],[-88,-99],[-80,20],[-80,-39],[-24,-13]],[[1098,2304],[-193,66],[24,39],[-16,39],[65,13],[0,33],[-65,79],[-88,65]],[[2308,1689],[-153,-20],[-64,59],[-40,7],[-96,-27],[-104,138],[-8,92],[-32,78],[-64,26],[-32,-59],[-24,0],[-56,86],[-40,137],[-25,65],[-56,0],[-56,46],[-64,-72],[-120,53],[-88,-40],[-88,46]]],transform:{scale:[37.761044752777565,38.54734205626113],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:1000004,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:1000005,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:1000001,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:1000002,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:1000003,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"10M":{type:"Topology",arcs:[[[962,0],[-29,75],[48,131],[21,35],[11,38],[32,117],[-24,44]],[[1021,440],[-64,-29],[-70,36],[-120,2],[3,121]],[[770,570],[-126,16],[-40,91],[-45,4],[-51,93],[-142,4]],[[275,891],[-131,-99],[30,-36],[24,-31],[-6,-86],[-98,-86],[13,-64],[-27,-38],[-80,-31]],[[366,778],[-37,22],[-54,91]]],transform:{scale:[113.2099448513097,114.12782081303801],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:1000005,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[1],properties:{id:1000004,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[2],properties:{id:1000003,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[3],properties:{id:1000001,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[4],properties:{id:1000002,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}}]}}},"20M":{type:"Topology",arcs:[[[536,0],[-24,45],[15,30],[45,92],[-1,44],[-2,37]],[[569,248],[-130,9],[-10,64]],[[429,321],[-64,10],[-78,94],[-83,13]],[[153,502],[-73,-51],[26,-84],[-48,-53],[-3,-52],[-55,-25]],[[204,438],[-51,64]]],transform:{scale:[203.12309601494124,202.56551463031246],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:1000005,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[1],properties:{id:1000004,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[2],properties:{id:1000003,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[3],properties:{id:1000001,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[4],properties:{id:1000002,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}}]}}},"60M":{type:"Topology",arcs:[[[310,138],[-36,-2],[-40,42]],[[234,178],[-123,65]],[[84,278],[-84,-147]],[[111,243],[-27,35]],[[292,0],[18,138]]],transform:{scale:[372.84281730215633,364.87611898580536],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:1000004,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[1],properties:{id:1000003,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[2],properties:{id:1000001,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[3],properties:{id:1000002,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[4],properties:{id:1000005,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}}]}}}},4326:{"03M":{type:"Topology",arcs:[[[1900,1275],[-30,27],[-27,-13],[-34,23],[-87,6],[25,59],[1,70],[20,34],[24,167]],[[1792,1648],[-116,1],[-62,77],[-89,-8],[-60,148],[7,86],[-4,15],[-13,60],[-45,28],[-33,-48],[-26,4],[-31,142],[-11,53],[5,43],[-19,44],[-39,8],[-40,49],[-52,-59],[-93,71],[-38,-6],[-16,-26]],[[945,2388],[-54,27],[-20,28],[-22,-3],[-17,22],[-25,1],[-10,10],[4,17],[27,14],[-15,29],[1,16],[68,1],[-8,16],[-5,30],[-14,29],[-27,42],[-25,22],[-30,41]],[[773,2730],[-89,-69],[-64,-4],[-82,-92],[-133,-15],[27,-93],[64,-43],[16,-50],[38,-44],[9,-75],[-48,-51],[5,-41],[6,-50],[-52,-84],[-78,14],[-35,-66],[-33,-61],[-45,11],[-35,-42],[-18,-72],[33,-71],[48,-55]],[[1017,2330],[-72,58]],[[307,1677],[-36,-12],[-25,-21],[-26,-10],[-76,-90],[-17,4],[-30,31],[-52,-14],[-26,-23],[-19,1]],[[2319,1185],[-116,-32],[-39,-52],[-42,70],[-68,23],[-12,58],[-43,23],[-42,-23],[-57,23]],[[2044,0],[-4,43],[-38,82],[-34,9],[-24,43],[13,97],[61,4],[32,41],[49,0],[37,82],[-26,118],[130,167],[-8,73],[74,46],[-2,18],[-9,92],[24,35],[7,49],[48,52],[-55,134]]],transform:{scale:[.0006038339283908974,.00036983475567765975],translate:[20.35292839300007,42.26281764300006]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000002,co:"F",oth:"F"}},{type:"LineString",arcs:[1],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000001,co:"F",oth:"F"}},{type:"LineString",arcs:[2],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000003,co:"F",oth:"F"}},{type:"LineString",arcs:[3],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000004,co:"F",oth:"F"}},{type:"LineString",arcs:[4],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000005,co:"F",oth:"F"}},{type:"LineString",arcs:[5],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000006,co:"F",oth:"F"}},{type:"LineString",arcs:[6],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000007,co:"F",oth:"F"}},{type:"LineString",arcs:[7],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000008,co:"F",oth:"F"}}]}}},"10M":{type:"Topology",arcs:[[[659,439],[-54,17],[17,111]],[[622,567],[-93,31],[-25,92],[-36,11],[-29,97],[-23,1],[-63,3]],[[328,822],[-33,74],[-27,44]],[[268,940],[-72,-44],[-38,-31],[27,-86],[-14,-65],[-81,-78],[16,-58]],[[353,802],[-25,20]],[[106,578],[-41,-19],[-65,-28]],[[805,408],[-54,-21],[-92,52]],[[709,0],[-22,72],[0,17],[40,36],[18,67],[53,101],[16,64],[-9,51]]],transform:{scale:[.001740521547911524,.0010740945563829907],translate:[20.35292839300007,42.26281764300006]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000002,co:"F",oth:"F"}},{type:"LineString",arcs:[1],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000003,co:"F",oth:"F"}},{type:"LineString",arcs:[2],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000004,co:"F",oth:"F"}},{type:"LineString",arcs:[3],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000005,co:"F",oth:"F"}},{type:"LineString",arcs:[4],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000006,co:"F",oth:"F"}},{type:"LineString",arcs:[5],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000007,co:"F",oth:"F"}},{type:"LineString",arcs:[6],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000001,co:"F",oth:"F"}},{type:"LineString",arcs:[7],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000008,co:"F",oth:"F"}}]}}},"20M":{type:"Topology",arcs:[[[380,252],[-21,26],[0,48]],[[359,326],[-49,17],[-56,107],[-51,11]],[[189,472],[-34,68]],[[155,540],[-66,-39],[18,-66],[-54,-68],[8,-35]],[[61,332],[-21,-13],[-10,-12],[-13,5],[-17,-7]],[[464,234],[-84,18]],[[409,0],[-14,46],[61,110],[8,78]]],transform:{scale:[.003018276831896498,.0018697201537037245],translate:[20.35292839300007,42.26281764300006]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000002,co:"F",oth:"F"}},{type:"LineString",arcs:[1],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000003,co:"F",oth:"F"}},{type:"LineString",arcs:[2],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000004,co:"F",oth:"F"}},{type:"LineString",arcs:[3],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000005,co:"F",oth:"F"}},{type:"LineString",arcs:[4],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000007,co:"F",oth:"F"}},{type:"LineString",arcs:[5],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000001,co:"F",oth:"F"}},{type:"LineString",arcs:[6],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000008,co:"F",oth:"F"}}]}}},"60M":{type:"Topology",arcs:[[[235,156],[-13,46]],[[222,202],[-96,84]],[[117,293],[-21,42]],[[96,335],[-58,-129]],[[126,286],[-9,7]],[[38,206],[-38,-17]],[[287,145],[-52,11]],[[253,0],[34,145]]],transform:{scale:[.004879722822299564,.0030138772626866006],translate:[20.352928393000074,42.26281764300006]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000002,co:"F",oth:"F"}},{type:"LineString",arcs:[1],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000003,co:"F",oth:"F"}},{type:"LineString",arcs:[2],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000004,co:"F",oth:"F"}},{type:"LineString",arcs:[3],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000005,co:"F",oth:"F"}},{type:"LineString",arcs:[4],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000006,co:"F",oth:"F"}},{type:"LineString",arcs:[5],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000001,co:"F",oth:"F"}},{type:"LineString",arcs:[6],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000007,co:"F",oth:"F"}},{type:"LineString",arcs:[7],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000008,co:"F",oth:"F"}}]}}}}},2024:{3035:{"03M":{type:"Topology",arcs:[[[728,1508],[-48,12],[-22,18],[-15,-5],[-16,13],[-22,-4],[-10,8],[0,13],[21,13],[-16,17],[0,13],[58,9],[-5,8],[-10,22],[-16,17],[-27,25],[-21,13],[-32,26]],[[1912,0],[-6,30],[-42,51],[-32,0],[-21,30],[0,69],[53,8],[21,35],[43,4],[26,60],[-37,81],[96,129],[-16,51],[58,43],[0,9],[-21,64],[16,26],[5,34],[32,43],[-58,85]],[[250,942],[-27,-13],[-21,-17],[-21,-8],[-59,-73],[-16,0],[-26,17],[-43,-13],[-21,-21],[-16,0]],[[1657,861],[-27,13],[-21,-13],[-32,13],[-74,-9],[16,47],[-6,47],[11,26],[5,120]],[[1529,1105],[-100,-17],[-64,47],[-75,-17],[-63,94],[-6,60],[-5,13],[-16,38],[-42,13],[-22,-38],[-21,0],[-42,94],[-16,34],[0,30],[-21,30],[-32,0],[-38,30],[-42,-47],[-85,39],[-32,-9],[-10,-21]],[[547,1726],[-69,-60],[-53,-13],[-59,-73],[-111,-25],[32,-60],[58,-22],[16,-34],[37,-26],[16,-51],[-37,-39],[5,-30],[11,-34],[-37,-64],[-64,4],[-26,-51],[-22,-47],[-42,4],[-21,-34],[-11,-52],[37,-47],[43,-30]],[[797,1478],[-69,30]],[[2029,852],[-96,-38],[-32,-39],[-42,43],[-59,4],[-16,39],[-42,13],[-32,-22],[-53,9]]],transform:{scale:[56.97629608361119,58.91534666536319],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"10M":{type:"Topology",arcs:[[[242,508],[-33,47],[-27,27]],[[637,0],[-25,46],[-2,12],[30,29],[7,47],[34,75],[7,45],[-12,33]],[[83,318],[-32,-18],[-51,-26]],[[552,290],[-46,5],[3,78]],[[509,373],[-79,8],[-30,59],[-30,3],[-34,62],[-19,-1],[-52,-6]],[[182,582],[-55,-39],[-28,-25],[30,-56],[-5,-45],[-59,-62],[18,-37]],[[265,498],[-23,10]],[[676,287],[-43,-21],[-81,24]]],transform:{scale:[171.07449827433382,174.72145763645509],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"20M":{type:"Topology",arcs:[[[50,191],[-17,-11],[-8,-10],[-11,1],[-14,-6]],[[305,224],[-44,6],[-58,68],[-44,2]],[[109,350],[-52,-36],[21,-45],[-38,-54],[10,-24]],[[159,300],[-14,6]],[[145,306],[-36,44]],[[381,0],[-17,31],[41,85],[-1,57]],[[404,173],[-74,2]],[[330,175],[-20,15],[-5,34]]],transform:{scale:[286.13294356075795,290.536823841191],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"60M":{type:"Topology",arcs:[[[258,111],[-47,1]],[[32,123],[-32,-17]],[[211,112],[-16,32]],[[195,144],[-94,49]],[[70,225],[-38,-102]],[[101,193],[-8,4]],[[93,197],[-23,28]],[[243,0],[15,111]]],transform:{scale:[447.98943164212585,451.9461704196305],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}}},4326:{"03M":{type:"Topology",arcs:[[[1543,0],[-4,32],[-28,65],[-24,5],[-19,33],[10,70],[47,5],[23,33],[38,0],[28,59],[-19,92],[94,124],[-5,54],[56,37],[0,11],[-9,70],[19,27],[4,38],[38,38],[-42,102]],[[1750,895],[-85,-27],[-32,-37],[-29,54],[-56,16],[-5,43],[-32,16],[-33,-16],[-43,16]],[[1435,960],[-23,22],[-19,-11],[-28,16],[-66,5],[19,44],[0,54],[14,26],[19,125]],[[230,1262],[-24,-5],[-23,-16],[-19,-11],[-56,-65],[-14,0],[-24,27],[-37,-11],[-19,-21],[-14,5]],[[1351,1241],[-84,0],[-47,59],[-71,-6],[-42,114],[5,64],[-5,11],[-9,43],[-33,22],[-24,-38],[-23,6],[-23,108],[-5,37],[0,33],[-14,32],[-28,5],[-29,38],[-42,-43],[-70,54],[-28,-5],[-10,-22]],[[582,2055],[-66,-49],[-47,-5],[-61,-70],[-103,-11],[19,-70],[51,-32],[10,-38],[28,-32],[9,-54],[-37,-44],[4,-26],[5,-38],[-37,-65],[-61,11],[-29,-49],[-23,-48],[-33,11],[-28,-33],[-14,-54],[28,-54],[33,-43]],[[769,1753],[-56,48]],[[713,1801],[-42,17],[-14,21],[-19,0],[-9,16],[-19,0],[-10,6],[5,16],[19,11],[-9,21],[0,11],[51,0],[-5,11],[-4,22],[-10,26],[-23,27],[-19,22],[-23,27]]],transform:{scale:[.0007994261320208862,.0004913384355349169],translate:[20.35361768088405,42.262163108155406]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"10M":{type:"Topology",arcs:[[[539,0],[-17,52],[0,13],[30,27],[13,48],[41,74],[13,47],[-8,38]],[[611,299],[-41,-16],[-69,37]],[[501,320],[-41,13],[12,81]],[[80,421],[-31,-12],[-49,-20]],[[472,414],[-71,24],[-18,66],[-28,7],[-21,72],[-18,0],[-47,2]],[[203,686],[-54,-32],[-29,-22],[21,-63],[-12,-47],[-60,-57],[11,-44]],[[269,585],[-20,16]],[[249,601],[-25,53],[-21,32]]],transform:{scale:[.002290098349828638,.0014718665962452685],translate:[20.35361768088405,42.262163108155406]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"20M":{type:"Topology",arcs:[[[337,0],[-12,36],[51,84],[6,62]],[[382,182],[-69,13]],[[313,195],[-17,20],[-1,37]],[[50,256],[-17,-10],[-8,-8],[-11,3],[-14,-5]],[[295,252],[-40,13],[-46,82],[-41,9]],[[127,417],[-54,-30],[15,-51],[-44,-53],[6,-27]],[[168,356],[-12,10]],[[156,366],[-29,51]]],transform:{scale:[.0036618323062750017,.0024213440887871805],translate:[20.35361768088405,42.262163108155406]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"60M":{type:"Topology",arcs:[[[220,0],[29,116]],[[249,116],[-45,8]],[[204,124],[-12,37]],[[192,161],[-83,66]],[[109,227],[-8,6]],[[33,163],[-33,-12]],[[83,266],[-50,-103]],[[101,233],[-18,33]]],transform:{scale:[.005617750767056427,.003795866485053587],translate:[20.35361768088405,42.262163108155406]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}}}}};function zf(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(r);++i<r;)a[i]=t+i*n;return a}function If(t,e,n){var i=zf(t,e-xa,n).concat(e);return function(t){return i.map((function(e){return[t,e]}))}}function Rf(t,e,n){var i=zf(t,e-xa,n).concat(e);return function(t){return i.map((function(e){return[e,t]}))}}function jf(){var t,e,n,i,r,a,o,s,l,c,u,h,f=10,p=f,d=90,g=360,_=2.5;function m(){return{type:"MultiLineString",coordinates:v()}}function v(){return zf(La(i/d)*d,n,d).map(u).concat(zf(La(s/g)*g,o,g).map(h)).concat(zf(La(e/f)*f,t,f).filter((function(t){return ka(t%d)>xa})).map(l)).concat(zf(La(a/p)*p,r,p).filter((function(t){return ka(t%g)>xa})).map(c))}return m.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},m.outline=function(){return{type:"Polygon",coordinates:[u(i).concat(h(o).slice(1),u(n).reverse().slice(1),h(s).reverse().slice(1))]}},m.extent=function(t){return arguments.length?m.extentMajor(t).extentMinor(t):m.extentMinor()},m.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],i>n&&(t=i,i=n,n=t),s>o&&(t=s,s=o,o=t),m.precision(_)):[[i,s],[n,o]]},m.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],r=+n[1][1],e>t&&(n=e,e=t,t=n),a>r&&(n=a,a=r,r=n),m.precision(_)):[[e,a],[t,r]]},m.step=function(t){return arguments.length?m.stepMajor(t).stepMinor(t):m.stepMinor()},m.stepMajor=function(t){return arguments.length?(d=+t[0],g=+t[1],m):[d,g]},m.stepMinor=function(t){return arguments.length?(f=+t[0],p=+t[1],m):[f,p]},m.precision=function(f){return arguments.length?(_=+f,l=If(a,r,90),c=Rf(e,t,_),u=If(s,o,90),h=Rf(i,n,_),m):_},m.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function Bf(t){return new Promise(((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)}))}function qf(t,e){let n;return(i,r)=>(()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=Bf(i),n.then((t=>{t.onclose=()=>n=void 0}),(()=>{})),n})().then((t=>r(t.transaction(e,i).objectStore(e))))}let Uf;function Wf(){return Uf||(Uf=qf("keyval-store","keyval")),Uf}function Hf(t,e=Wf()){return e("readonly",(e=>Bf(e.get(t))))}function Vf(t,e,n=Wf()){return n("readwrite",(n=>(n.put(e,t),Bf(n.transaction))))}var $f=function(t,e){var n={};return n.defaultGeoData=void 0,n.allNUTSGeoData=void 0,n.geoJSONs={mixed:{rg0:void 0,rg1:void 0,rg2:void 0,rg3:void 0},cntbn:void 0,cntrg:void 0,nutsbn:void 0,nutsrg:void 0,gra:void 0,worldrg:void 0,worldbn:void 0,kosovo:void 0},n.userGeometries=void 0,n.statisticalRegions=void 0,n.centroidsData=void 0,n.centroidsFeatures=void 0,n._allCentroidsFeatures=void 0,n.getRegionFeatures=function(){return"WORLD"==t.geo_?n.geoJSONs.worldrg:"mixed"===t.nutsLevel_?[n.geoJSONs.mixed.rg0,n.geoJSONs.mixed.rg1,n.geoJSONs.mixed.rg2,n.geoJSONs.mixed.rg3]:n.geoJSONs.nutsrg.concat(n.geoJSONs.cntrg)},n.getDefaultGeoData=function(t,i,r){var a=n.getDefaultGeoDataPromise();return Promise.all(a).then((function(a){return i&&(a=i(a)),n.allNUTSGeoData=a,n.defaultGeoData=a[0],e&&(n.centroidsData="mixed"===r?[a[4],a[5],a[6],a[7]]:a[1]),"WORLD"===t?(n.geoJSONs.worldrg=Of(n.defaultGeoData,n.defaultGeoData.objects.CNTR_RG_20M_2020_4326).features,n.geoJSONs.worldbn=Of(n.defaultGeoData,n.defaultGeoData.objects.CNTR_BN_20M_2020_4326).features,n.geoJSONs.kosovo=Of(n.defaultGeoData,n.defaultGeoData.objects.NUTS_BN_20M_2021_RS_XK_border).features,n.geoJSONs.graticule=[jf().step([30,30])()]):(n.geoJSONs.graticule=Of(n.defaultGeoData,n.defaultGeoData.objects.gra).features,n.geoJSONs.nutsrg=Of(n.defaultGeoData,n.defaultGeoData.objects.nutsrg).features,n.geoJSONs.nutsbn=Of(n.defaultGeoData,n.defaultGeoData.objects.nutsbn).features,n.geoJSONs.cntrg=Of(n.defaultGeoData,n.defaultGeoData.objects.cntrg).features,n.geoJSONs.cntbn=Of(n.defaultGeoData,n.defaultGeoData.objects.cntbn).features),a})).catch((function(t){return Promise.reject(t)}))},n.getDefaultGeoDataPromise=function(){var n=[0,1,2,3],i=[],r=function(t,e,n,i,r,a){var o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],s="".concat(t,"/").concat(e);return n&&"EUR"!==n&&"WORLD"!==n&&(s+="/".concat(n)),s+="/".concat("WORLD"==n?"4326":i),!o&&r&&(s+="/".concat(r)),s+="/".concat(o?"nutspt_":"").concat(a,".json")},a=function(){var t=function(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var a=t.apply(e,n);function o(t){kf(a,i,r,o,s,"next",t)}function s(t){kf(a,i,r,o,s,"throw",t)}o(void 0)}))}}(Pf().mark((function t(e){var n,i,r,a,o;return Pf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="geojson-cache:".concat(e),t.prev=1,t.next=4,Hf(n);case 4:if(!(i=t.sent)){t.next=10;break}if(r=i.timestamp,a=i.data,!(Date.now()-r<864e5)){t.next=10;break}return t.abrupt("return",a);case 10:t.next=16;break;case 12:throw t.prev=12,t.t0=t.catch(1),console.warn("Error reading from IndexedDB cache for ".concat(e,":"),t.t0),t.t0;case 16:return t.next=18,Lf(e);case 18:return o=t.sent,t.prev=19,t.next=22,Vf(n,{timestamp:Date.now(),data:o});case 22:t.next=28;break;case 24:throw t.prev=24,t.t1=t.catch(19),console.warn("Could not cache data in IndexedDB for ".concat(e,":"),t.t1),t.t1;case 28:return t.abrupt("return",o);case 29:case"end":return t.stop()}}),t,null,[[1,12],[19,24]])})));return function(e){return t.apply(this,arguments)}}();if(!t||!t.nuts2jsonBaseURL_)throw new Error("Missing required map context or configuration");if("mixed"===t.nutsLevel_&&"WORLD"!==t.geo_)n.forEach((function(e){var n=r(t.nuts2jsonBaseURL_,t.nutsYear_,t.geo_,t.proj_,t.scale_,e);i.push(a(n))})),e&&n.forEach((function(e){var n=r(t.nuts2jsonBaseURL_,t.nutsYear_,t.geo_,t.proj_,t.scale_,e,!0);i.push(a(n))}));else if("WORLD"===t.geo_){var o=window.location.hostname.includes("ec.europa.eu")?"https://ec.europa.eu/assets/estat/E/E4/gisco/IMAGE/WORLD_4326.json":"https://raw.githubusercontent.com/eurostat/eurostat-map/master/src/assets/topojson/WORLD_4326.json";i.push(a(o))}else{var s=r(t.nuts2jsonBaseURL_,t.nutsYear_,t.geo_,t.proj_,t.scale_,t.nutsLevel_);if(i.push(a(s)),e){var l=r(t.nuts2jsonBaseURL_,t.nutsYear_,t.geo_,t.proj_,t.scale_,t.nutsLevel_,!0);i.push(a(l))}}return i},n.isGeoReady=function(){if(!n.defaultGeoData&&!n.userGeometries)return!1;var e=!0;return ua(t.insetTemplates_,null,(function(t){t.Geometries.isGeoReady()||(e=!1)})),e},n.setUserGeometries=function(t){var e=this;this.userGeometries=t,t.forEach((function(t){t.statisticalRegions&&(e.statisticalRegions=t)}))},n.addDefaultGeometriesToMap=function(t,e,i,r,a,o,s,l){this.geoJSONs.graticule&&e&&t.append("g").attr("id","em-graticule").attr("class","em-graticule").selectAll("path").data(this.geoJSONs.graticule).enter().append("path").attr("d",i),this.geoJSONs.cntrg&&t.append("g").attr("id","em-cntrg").attr("class","em-cntrg").selectAll("path").data(this.geoJSONs.cntrg).enter().append("path").attr("d",i).attr("id",(function(t){var e=t.properties.id;if("RS"==e||"EL"==e)return"em-cntrg-"+e})),this.geoJSONs.worldrg&&t.append("g").attr("id","em-worldrg").attr("class","em-worldrg").selectAll("path").data(this.geoJSONs.worldrg).enter().append("path").attr("d",i),this.geoJSONs.nutsrg&&("mixed"==r?(this.geoJSONs.mixed.rg0=this.geoJSONs.nutsrg,this.geoJSONs.mixed.rg1=Of(n.allNUTSGeoData[1],n.allNUTSGeoData[1].objects.nutsrg).features,this.geoJSONs.mixed.rg2=Of(n.allNUTSGeoData[2],n.allNUTSGeoData[2].objects.nutsrg).features,this.geoJSONs.mixed.rg3=Of(n.allNUTSGeoData[3],n.allNUTSGeoData[3].objects.nutsrg).features,[this.geoJSONs.mixed.rg0,this.geoJSONs.mixed.rg1,this.geoJSONs.mixed.rg2,this.geoJSONs.mixed.rg3].forEach((function(e,n){t.append("g").attr("id","em-nutsrg").attr("class","em-nutsrg em-nutsrg-".concat(n)).selectAll("path").data(e).enter().append("path").attr("d",i).attr("lvl",n)})),"EUR"!=o||"3035"!=s&&"4326"!=s||function(t,e,n,i,r){var a=Df[r]?Df[r][n][i]:Df[2024][n][i],o=Of(a,"nutsbn_1").features;t.append("g").attr("id","em-kosovo-bn").attr("class","em-kosovo-bn em-bn-cc").selectAll("path").data(o).enter().append("path").attr("d",e)}(t,i,s,l,a)):t.append("g").attr("id","em-nutsrg").attr("class","em-nutsrg").selectAll("path").data(this.geoJSONs.nutsrg).enter().append("path").attr("d",i)),this.geoJSONs.cntbn&&t.append("g").attr("id","em-cntbn").attr("class","em-cntbn").selectAll("path").data(this.geoJSONs.cntbn).enter().append("path").filter((function(t){return"T"==t.properties.eu||"T"==t.properties.efta||"T"==t.properties.cc||"T"==t.properties.oth||"T"==t.properties.co?t:void 0})).attr("d",i).attr("id",(function(t){return"em-bn-"+t.properties.id})).attr("class",(function(t){var e=[];return"T"===t.properties.eu&&e.push("em-bn-eu"),"T"===t.properties.efta&&e.push("em-bn-efta"),"T"===t.properties.cc&&e.push("em-bn-cc"),"T"===t.properties.oth&&e.push("em-bn-oth"),"T"===t.properties.co&&e.push("em-bn-co"),e.join(" ")})),this.geoJSONs.nutsbn&&"mixed"!==r&&(this.geoJSONs.nutsbn.sort((function(t,e){return e.properties.lvl-t.properties.lvl})),t.append("g").attr("id","em-nutsbn").attr("class","em-nutsbn").selectAll("path").data(this.geoJSONs.nutsbn).enter().filter((function(t){return"T"==t.properties.eu||"T"==t.properties.efta||"T"==t.properties.cc||"T"==t.properties.oth||"T"==t.properties.co?t:void 0})).append("path").attr("d",i).attr("class",(function(t){var e=t.properties;return e.id>1e5?"em-kosovo-bn":"T"===e.co?"em-bn-co":["em-bn-"+e.lvl].join(" ")}))),this.geoJSONs.worldbn&&t.append("g").attr("id","em-worldbn").attr("class","em-worldbn").selectAll("path").data(this.geoJSONs.worldbn).enter().append("path").attr("d",i).attr("class",(function(t){return t.properties.POL_STAT>0?"em-bn-d":"T"===t.properties.COAS_FLAG?"em-bn-co":"em-worldbn"})),this.geoJSONs.kosovo&&t.append("g").attr("id","em-kosovo-bn").attr("class","em-kosovo-bn").selectAll("path").data(this.geoJSONs.kosovo).enter().append("path").attr("d",i)},n.addUserGeometriesToMap=function(t,e,n){t.forEach((function(t){var i=e.append("g").attr("id",t.statisticalRegions?"em-user-regions":"").attr("class",t.class?t.class:"").selectAll("path").data(t.features).enter().append("path").attr("d",n);"function"==typeof t.onEach&&t.onEach(i)}))},n},Jf=function(t,e,n){var i=Jm(t,n);for(var r in(t=t||{}).proj=t.proj||Xf[t.geo],t.scale=t.scale||e.insetScale_,t.footnote=t.footnote||"",t.showSourceLink=t.showSourceLink||!1,t.zoomExtent=t.zoomExtent||e.insetZoomExtent_,t.width=t.width||e.insetBoxWidth_,t.height=t.height||e.insetBoxWidth_,t.insets=t.insets||[],t.insetTemplates=t.insetTemplates||{},t.callback=t.callback||void 0,["nutsLevel_","nutsYear_","hoverColor_","cntrgFillStyle_","cntbnStroke_","cntbnStrokeWidth_","seaFillStyle_","drawCoastalMargin_","coastalMarginColor_","coastalMarginWidth_","coastalMarginStdDev_","graticuleStroke_","graticuleStrokeWidth_","lg_","projectionFunction_","filterGeometriesFunction_","processCentroids_"].forEach((function(t){i[t]=e[t]})),["stat","statData","legend","legendObj","noDataText","language","transitionDuration","tooltip_","classToText_"].forEach((function(t){i[t]=e[t]})),t)i[r+"_"]=t[r];return i.isInset=!0,i},Yf=function(t,e){for(var n=[{geo:"IC",x:0,y:0,width:t,height:.3*t},{geo:"CARIB",x:0,y:.3*t+e,width:.5*t,height:t},{geo:"GF",x:.5*t,y:.3*t+e,width:.5*t,height:.75*t},{geo:"YT",x:.5*t,y:1.05*t+e,width:.25*t,height:.25*t},{geo:"RE",x:.75*t,y:1.05*t+e,width:.25*t,height:.25*t},{geo:"PT20",x:0,y:1.3*t+2*e,width:.75*t,height:.25*t},{geo:"PT30",x:.75*t,y:1.3*t+2*e,width:.25*t,height:.25*t},{geo:"MT",x:0,y:1.55*t+3*e,width:.25*t,height:.25*t},{geo:"LI",x:.25*t,y:1.55*t+3*e,width:.25*t,height:.25*t},{geo:"SJ_SV",x:.5*t,y:1.55*t+3*e,width:.25*t,height:.25*t},{geo:"SJ_JM",x:.75*t,y:1.55*t+3*e,width:.25*t,height:.25*t}],i=0;i<n.length;i++)n[i].drawGraticule=!1;return n},Xf={EUR:"3035",IC:"32628",GP:"32620",MQ:"32620",GF:"32622",RE:"32740",YT:"32738",MT:"3035",PT20:"32626",PT30:"32628",LI:"3035",IS:"3035",SJ_SV:"3035",SJ_JM:"3035",CARIB:"32620",WORLD:"54030"},Kf=function(t,e){if(e.svg_&&(e.svg_.select("#em-stamp").remove(),t)){var n=e.svg_.append("g").attr("id","em-stamp");t.size||(t.size=60),t.x||(t.x=230),t.y||(t.y=100),t.textColor||(t.textColor="#000"),t.stampColor||(t.stampColor="#000"),t.strokeWidth||(t.strokeWidth=1),t.lineHeight||(t.lineHeight=15),n.append("circle").attr("r",t.size).attr("cx",t.x).attr("cy",t.y).attr("id","em-stamp-circle").attr("fill","none").attr("stroke",t.stampColor).attr("stroke-width",t.strokeWidth);var i=t.text,r=Math.sqrt(Qf(i.trim())*t.lineHeight),a=ep(Zf(i.trim()),r),o=tp(a,t.lineHeight);n.append("text").attr("text-anchor","middle").attr("fill",t.textColor).attr("id","em-stamp-text").attr("transform","translate(".concat(t.x,",").concat(t.y,") scale(").concat(t.size/o,")")).selectAll("tspan").data(a).enter().append("tspan").attr("x",0).attr("y",(function(e,n){return(n-a.length/2+.8)*t.lineHeight})).text((function(t){return t.text.replaceAll("~"," ").replaceAll("¶","")}))}},Zf=function(t){return t.split(/(?<=¶)|\s+/g).map((function(t){return t.trim()})).filter((function(t){return t.length>0}))},Qf=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg"),n=document.createElementNS("http://www.w3.org/2000/svg","text");n.textContent=t,e.appendChild(n),document.body.appendChild(e);var i=n.getComputedTextLength();return document.body.removeChild(e),i+10},tp=function(t,e){for(var n=0,i=0,r=t.length;i<r;++i){var a=(Math.abs(i-r/2+.5)+.5)*e,o=t[i].width/2;n=Math.max(n,Math.sqrt(Math.pow(o,2)+Math.pow(a,2)))}return n},ep=function(t,e){for(var n=[],i={width:0,text:""},r=0,a=t.length;r<a;++r)if("¶"!==t[r]){var o=(i.text?i.text+" ":"")+t[r],s=Qf(o);(i.width+s)/2<e?(i.width=s,i.text=o):(n.push(i),i={width:Qf(t[r]),text:t[r]})}else i.text&&n.push(i),i={width:0,text:""};return i.text&&n.push(i),n},np={},ip={};function rp(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function ap(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var i in t)i in e||n.push(e[i]=i)})),n}function op(t,e){var n=t+"",i=n.length;return i<e?new Array(e-i+1).join(0)+n:n}function sp(t){var e,n=t.getUTCHours(),i=t.getUTCMinutes(),r=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+op(-e,6):e>9999?"+"+op(e,6):op(e,4))+"-"+op(t.getUTCMonth()+1,2)+"-"+op(t.getUTCDate(),2)+(a?"T"+op(n,2)+":"+op(i,2)+":"+op(r,2)+"."+op(a,3)+"Z":r?"T"+op(n,2)+":"+op(i,2)+":"+op(r,2)+"Z":i||n?"T"+op(n,2)+":"+op(i,2)+"Z":"")}function lp(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function i(t,e){var i,r=[],a=t.length,o=0,s=0,l=a<=0,c=!1;function u(){if(l)return ip;if(c)return c=!1,np;var e,i,r=o;if(34===t.charCodeAt(r)){for(;o++<a&&34!==t.charCodeAt(o)||34===t.charCodeAt(++o););return(e=o)>=a?l=!0:10===(i=t.charCodeAt(o++))?c=!0:13===i&&(c=!0,10===t.charCodeAt(o)&&++o),t.slice(r+1,e-1).replace(/""/g,'"')}for(;o<a;){if(10===(i=t.charCodeAt(e=o++)))c=!0;else if(13===i)c=!0,10===t.charCodeAt(o)&&++o;else if(i!==n)continue;return t.slice(r,e)}return l=!0,t.slice(r,a)}for(10===t.charCodeAt(a-1)&&--a,13===t.charCodeAt(a-1)&&--a;(i=u())!==ip;){for(var h=[];i!==np&&i!==ip;)h.push(i),i=u();e&&null==(h=e(h,s++))||r.push(h)}return r}function r(e,n){return e.map((function(e){return n.map((function(t){return o(e[t])})).join(t)}))}function a(e){return e.map(o).join(t)}function o(t){return null==t?"":t instanceof Date?sp(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,r,a=i(t,(function(t,i){if(n)return n(t,i-1);r=t,n=e?function(t,e){var n=rp(t);return function(i,r){return e(n(i),r,t)}}(t,e):rp(t)}));return a.columns=r||[],a},parseRows:i,format:function(e,n){return null==n&&(n=ap(e)),[n.map(o).join(t)].concat(r(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=ap(t)),r(t,e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}var cp=lp(","),up=cp.parse,hp=cp.parseRows,fp=(cp.format,cp.formatBody,cp.formatRows,cp.formatRow,cp.formatValue,function(t){return t.gridCartogramPositions_||("hexagon"===t.gridCartogramShape_?"\n ,IS, , , , , , , , , , ,\n , , , ,NO,SE,FI,EE, , , , ,\n , , , , , , ,LV, , , , ,\n ,IE,UK, , ,DK, ,LT, , , , ,\n , , , ,NL,DE,PL, , , , , ,\n , , ,BE,LU,CZ,SK,UA, , , , ,\n , ,FR,CH,LI,AT,HU,RO,MD, , , ,\n ,PT,ES, ,IT,SI,HR,RS,BG, , , ,\n , , , , , ,BA,ME,MK, , , , \n , , , , , , ,AL,EL,TR,GE, , \n , , , ,MT, , , , ,CY, , , ":"\n ,IS, , ,NO,SE,FI, , , , , ,\n , , , , , , ,EE, , , , ,\n , , , , , , ,LV, , , , ,\n ,IE,UK, , ,DK, ,LT, , , , ,\n , , , ,NL,DE,PL, , , , , ,\n , , ,BE,LU,CZ,SK,UA, , , , ,\n , ,FR,CH,LI,AT,HU,RO,MD, , , ,\n ,PT,ES, ,IT,SI,HR,RS,BG, , , ,\n , , , , , ,BA,ME,MK, , , , \n , , , , , , ,AL,EL,TR,GE, , \n , , , ,MT, , , , ,CY, , , ")}),pp=function(t){var e=new Map;return hp(t.trim(),(function(t,n){t.forEach((function(t,i){(t=t.trim())&&e.set(t,[i,n])}))})),e},dp=function(t,e){return Array.from(t,(function(t){var n=v(t,2),i=n[0],r=v(n[1],2),a=r[0],o=r[1],s=e.Geometries.geoJSONs.nutsrg.find((function(t){return t.properties.id==i}));return{id:i,col:a,row:o,properties:{id:i,name:s?s.properties.na:""}}}))},gp=function(t,e,n){var i=Math.max.apply(Math,y(e.map((function(t){return t.col}))))+1,r=Math.max.apply(Math,y(e.map((function(t){return t.row}))))+1,a=n.gridCartogramMargins_,o=n.gridCartogramCellPadding_||0,s=(n.width_-a.left-a.right)/i-o,l=(n.height_-a.top-a.bottom)/r-o,c=Math.min(s,l);t.selectAll(".em-grid-cell").data(e).enter().append("g").attr("class","em-grid-cell").attr("transform",(function(t){return"translate(".concat(t.col*(c+o)+a.left,", ").concat(t.row*(c+o)+a.top,")")})).each((function(t){Ft(this).append("rect").attr("width",c).attr("height",c).attr("class","em-grid-rect"),Ft(this).append("text").attr("class","em-grid-text").attr("text-anchor","middle").attr("font-size",15).style("pointer-events","none").attr("fill","black").text(t.id).attr("x",c/2).attr("y",c/2+5)}))},_p=function(t,e,n){var i=Math.max.apply(Math,y(e.map((function(t){return t.col}))))+1,r=Math.max.apply(Math,y(e.map((function(t){return t.row}))))+1,a=n.gridCartogramMargins_,o=n.gridCartogramCellPadding_||0,s=Math.min((n.width_-a.left-a.right)/(1.5*i),(n.height_-a.top-a.bottom)/(r*Math.sqrt(3))),l=Math.sqrt(3)*s;t.selectAll(".em-grid-cell").data(e).enter().append("g").attr("class","em-grid-cell").attr("transform",(function(t){var e=t.col*(1.5*s+o)+a.left,n=t.row*(l+o)+(t.col%2==1?(l+o)/2:0)+a.top;return"translate(".concat(e,", ").concat(n,")")})).each((function(t){Ft(this).append("path").attr("d",mp(s)).attr("class","em-grid-hexagon"),Ft(this).append("text").attr("class","em-grid-text").attr("text-anchor","middle").attr("font-size",15).style("pointer-events","none").attr("fill","black").text(t.id).attr("y",5)}))},mp=function(t){var e=Math.PI/3;return Array.from({length:6},(function(n,i){var r=t*Math.cos(e*i),a=t*Math.sin(e*i);return"".concat(0===i?"M":"L").concat(r,",").concat(a)})).join(" ")+" Z"},vp=function(t,e,n,i){t.each((function(){var r=this.getBBox(),a=(e-i.left-i.right-r.width)/2-r.x+i.left,o=(n-i.top-i.bottom-r.height)/2-r.y+i.top;t.attr("transform","translate(".concat(a,", ").concat(o,")"))}))};function yp(t){return[Pa(t[1],t[0]),za(t[2])]}function xp(t){var e=t[0],n=t[1],i=Na(n);return[i*Na(e),i*Oa(e),Oa(n)]}function bp(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function wp(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Sp(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Mp(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Ep(t){var e=Da(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Cp(t){return ka(t[0])<=wa?t[0]:Ga(t[0])*((ka(t[0])+wa)%Ea-wa)}function Ap(t,e,n,i){return function(r){var a,o,s,l=e(r),c=xo(),u=e(c),h=!1,f={point:p,lineStart:g,lineEnd:_,polygonStart:function(){f.point=m,f.lineStart=v,f.lineEnd=y,o=[],a=[]},polygonEnd:function(){f.point=p,f.lineStart=g,f.lineEnd=_,o=Eo(o);var t=function(t,e){var n=Cp(e),i=e[1],r=Oa(i),a=[Oa(n),-Na(n),0],o=0,s=0,l=new ya;1===r?i=Sa+xa:-1===r&&(i=-Sa-xa);for(var c=0,u=t.length;c<u;++c)if(f=(h=t[c]).length)for(var h,f,p=h[f-1],d=Cp(p),g=p[1]/2+Ma,_=Oa(g),m=Na(g),v=0;v<f;++v,d=x,_=w,m=S,p=y){var y=h[v],x=Cp(y),b=y[1]/2+Ma,w=Oa(b),S=Na(b),M=x-d,E=M>=0?1:-1,C=E*M,A=C>wa,k=_*w;if(l.add(Pa(k*E*Oa(C),m*S+k*Na(C))),o+=A?M+E*Ea:M,A^d>=n^x>=n){var T=wp(xp(p),xp(y));Ep(T);var P=wp(a,T);Ep(P);var N=(A^M>=0?-1:1)*za(P[2]);(i>N||i===N&&(T[0]||T[1]))&&(s+=A^M>=0?1:-1)}}return(o<-1e-6||o<xa&&l<-1e-12)^1&s}(a,i);o.length?(h||(r.polygonStart(),h=!0),So(o,Tp,t,n,r)):t&&(h||(r.polygonStart(),h=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),h&&(r.polygonEnd(),h=!1),o=a=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function p(e,n){t(e,n)&&r.point(e,n)}function d(t,e){l.point(t,e)}function g(){f.point=d,l.lineStart()}function _(){f.point=p,l.lineEnd()}function m(t,e){s.push([t,e]),u.point(t,e)}function v(){u.lineStart(),s=[]}function y(){m(s[0][0],s[0][1]),u.lineEnd();var t,e,n,i,l=u.clean(),f=c.result(),p=f.length;if(s.pop(),a.push(s),s=null,p)if(1&l){if((e=(n=f[0]).length-1)>0){for(h||(r.polygonStart(),h=!0),r.lineStart(),t=0;t<e;++t)r.point((i=n[t])[0],i[1]);r.lineEnd()}}else p>1&&2&l&&f.push(f.pop().concat(f.shift())),o.push(f.filter(kp))}return f}}function kp(t){return t.length>1}function Tp(t,e){return((t=t.x)[0]<0?t[1]-Sa-xa:Sa-t[1])-((e=e.x)[0]<0?e[1]-Sa-xa:Sa-e[1])}const Pp=Ap((function(){return!0}),(function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?wa:-wa,l=ka(a-n);ka(l-wa)<xa?(t.point(n,i=(i+o)/2>0?Sa:-Sa),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(s,i),t.point(a,i),e=0):r!==s&&l>=wa&&(ka(n-r)<xa&&(n-=r*xa),ka(a-s)<xa&&(a-=s*xa),i=function(t,e,n,i){var r,a,o=Oa(t-n);return ka(o)>xa?Ta((Oa(e)*(a=Na(i))*Oa(n)-Oa(i)*(r=Na(e))*Oa(t))/(r*a*o)):(e+i)/2}(n,i,a,o),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(s,i),e=0),t.point(n=a,i=o),r=s},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}}),(function(t,e,n,i){var r;if(null==t)r=n*Sa,i.point(-wa,r),i.point(0,r),i.point(wa,r),i.point(wa,0),i.point(wa,-r),i.point(0,-r),i.point(-wa,-r),i.point(-wa,0),i.point(-wa,r);else if(ka(t[0]-e[0])>xa){var a=t[0]<e[0]?wa:-wa;r=n*a/2,i.point(-a,r),i.point(0,r),i.point(a,r)}else i.point(e[0],e[1])}),[-wa,-Sa]);function Np(t,e,n,i,r,a){if(n){var o=Na(e),s=Oa(e),l=i*n;null==r?(r=e+i*Ea,a=e-l/2):(r=Lp(o,r),a=Lp(o,a),(i>0?r<a:r>a)&&(r+=i*Ea));for(var c,u=r;i>0?u>a:u<a;u-=l)c=yp([o,-s*Na(u),-s*Oa(u)]),t.point(c[0],c[1])}}function Lp(t,e){(e=xp(e))[0]-=t,Ep(e);var n=function(t){return t>1?0:t<-1?wa:Math.acos(t)}(-e[1]);return((-e[2]<0?-n:n)+Ea-xa)%Ea}function Fp(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return(n=e.invert(n,i))&&t.invert(n[0],n[1])}),n}function Op(t,e){return ka(t)>wa&&(t-=Math.round(t/Ea)*Ea),[t,e]}function Gp(t,e,n){return(t%=Ea)?e||n?Fp(zp(t),Ip(e,n)):zp(t):e||n?Ip(e,n):Op}function Dp(t){return function(e,n){return ka(e+=t)>wa&&(e-=Math.round(e/Ea)*Ea),[e,n]}}function zp(t){var e=Dp(t);return e.invert=Dp(-t),e}function Ip(t,e){var n=Na(t),i=Oa(t),r=Na(e),a=Oa(e);function o(t,e){var o=Na(e),s=Na(t)*o,l=Oa(t)*o,c=Oa(e),u=c*n+s*i;return[Pa(l*r-u*a,s*n-c*i),za(u*r+l*a)]}return o.invert=function(t,e){var o=Na(e),s=Na(t)*o,l=Oa(t)*o,c=Oa(e),u=c*r-l*a;return[Pa(l*r+c*a,s*n+u*i),za(u*n-s*i)]},o}Op.invert=Op;var Rp=Na(30*Aa);function jp(t,e){return+e?function(t,e){function n(i,r,a,o,s,l,c,u,h,f,p,d,g,_){var m=c-i,v=u-r,y=m*m+v*v;if(y>4*e&&g--){var x=o+f,b=s+p,w=l+d,S=Da(x*x+b*b+w*w),M=za(w/=S),E=ka(ka(w)-1)<xa||ka(a-h)<xa?(a+h)/2:Pa(b,x),C=t(E,M),A=C[0],k=C[1],T=A-i,P=k-r,N=v*T-m*P;(N*N/y>e||ka((m*T+v*P)/y-.5)>.3||o*f+s*p+l*d<Rp)&&(n(i,r,a,o,s,l,A,k,E,x/=S,b/=S,w,g,_),_.point(A,k),n(A,k,E,x,b,w,c,u,h,f,p,d,g,_))}}return function(e){var i,r,a,o,s,l,c,u,h,f,p,d,g={point:_,lineStart:m,lineEnd:y,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=m}};function _(n,i){n=t(n,i),e.point(n[0],n[1])}function m(){u=NaN,g.point=v,e.lineStart()}function v(i,r){var a=xp([i,r]),o=t(i,r);n(u,h,c,f,p,d,u=o[0],h=o[1],c=i,f=a[0],p=a[1],d=a[2],16,e),e.point(u,h)}function y(){g.point=_,e.lineEnd()}function x(){m(),g.point=b,g.lineEnd=w}function b(t,e){v(i=t,e),r=u,a=h,o=f,s=p,l=d,g.point=v}function w(){n(u,h,c,f,p,d,r,a,i,o,s,l,16,e),g.lineEnd=y,y()}return g}}(t,e):function(t){return Po({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Bp,qp=Po({point:function(t,e){this.stream.point(t*Aa,e*Aa)}});function Up(t,e,n,i,r,a){if(!a)return function(t,e,n,i,r){function a(a,o){return[e+t*(a*=i),n-t*(o*=r)]}return a.invert=function(a,o){return[(a-e)/t*i,(n-o)/t*r]},a}(t,e,n,i,r);var o=Na(a),s=Oa(a),l=o*t,c=s*t,u=o/t,h=s/t,f=(s*n-o*e)/t,p=(s*e+o*n)/t;function d(t,a){return[l*(t*=i)-c*(a*=r)+e,n-c*t-l*a]}return d.invert=function(t,e){return[i*(u*t-h*e+f),r*(p-h*t-u*e)]},d}function Wp(t){return function(t){var e,n,i,r,a,o,s,l,c,u,h=150,f=480,p=250,d=0,g=0,_=0,m=0,v=0,y=0,x=1,b=1,w=null,S=Pp,M=null,E=To,C=.5;function A(t){return l(t[0]*Aa,t[1]*Aa)}function k(t){return(t=l.invert(t[0],t[1]))&&[t[0]*Ca,t[1]*Ca]}function T(){var t=Up(h,0,0,x,b,y).apply(null,e(d,g)),i=Up(h,f-t[0],p-t[1],x,b,y);return n=Gp(_,m,v),s=Fp(e,i),l=Fp(n,s),o=jp(s,C),P()}function P(){return c=u=null,A}return A.stream=function(t){return c&&u===t?c:c=qp(function(t){return Po({point:function(e,n){var i=t(e,n);return this.stream.point(i[0],i[1])}})}(n)(S(o(E(u=t)))))},A.preclip=function(t){return arguments.length?(S=t,w=void 0,P()):S},A.postclip=function(t){return arguments.length?(E=t,M=i=r=a=null,P()):E},A.clipAngle=function(t){return arguments.length?(S=+t?function(t){var e=Na(t),n=2*Aa,i=e>0,r=ka(e)>xa;function a(t,n){return Na(t)*Na(n)>e}function o(t,n,i){var r=[1,0,0],a=wp(xp(t),xp(n)),o=bp(a,a),s=a[0],l=o-s*s;if(!l)return!i&&t;var c=e*o/l,u=-e*s/l,h=wp(r,a),f=Mp(r,c);Sp(f,Mp(a,u));var p=h,d=bp(f,p),g=bp(p,p),_=d*d-g*(bp(f,f)-1);if(!(_<0)){var m=Da(_),v=Mp(p,(-d-m)/g);if(Sp(v,f),v=yp(v),!i)return v;var y,x=t[0],b=n[0],w=t[1],S=n[1];b<x&&(y=x,x=b,b=y);var M=b-x,E=ka(M-wa)<xa;if(!E&&S<w&&(y=w,w=S,S=y),E||M<xa?E?w+S>0^v[1]<(ka(v[0]-x)<xa?w:S):w<=v[1]&&v[1]<=S:M>wa^(x<=v[0]&&v[0]<=b)){var C=Mp(p,(-d+m)/g);return Sp(C,f),[v,yp(C)]}}}function s(e,n){var r=i?t:wa-t,a=0;return e<-r?a|=1:e>r&&(a|=2),n<-r?a|=4:n>r&&(a|=8),a}return Ap(a,(function(t){var e,n,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(h,f){var p,d=[h,f],g=a(h,f),_=i?g?0:s(h,f):g?s(h+(h<0?wa:-wa),f):0;if(!e&&(c=l=g)&&t.lineStart(),g!==l&&(!(p=o(e,d))||bo(e,p)||bo(d,p))&&(d[2]=1),g!==l)u=0,g?(t.lineStart(),p=o(d,e),t.point(p[0],p[1])):(p=o(e,d),t.point(p[0],p[1],2),t.lineEnd()),e=p;else if(r&&e&&i^g){var m;_&n||!(m=o(d,e,!0))||(u=0,i?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1],3)))}!g||e&&bo(e,d)||t.point(d[0],d[1]),e=d,l=g,n=_},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return u|(c&&l)<<1}}}),(function(e,i,r,a){Np(a,t,n,r,e,i)}),i?[0,-t]:[-wa,t-wa])}(w=t*Aa):(w=null,Pp),P()):w*Ca},A.clipExtent=function(t){return arguments.length?(E=null==t?(M=i=r=a=null,To):ko(M=+t[0][0],i=+t[0][1],r=+t[1][0],a=+t[1][1]),P()):null==M?null:[[M,i],[r,a]]},A.scale=function(t){return arguments.length?(h=+t,T()):h},A.translate=function(t){return arguments.length?(f=+t[0],p=+t[1],T()):[f,p]},A.center=function(t){return arguments.length?(d=t[0]%360*Aa,g=t[1]%360*Aa,T()):[d*Ca,g*Ca]},A.rotate=function(t){return arguments.length?(_=t[0]%360*Aa,m=t[1]%360*Aa,v=t.length>2?t[2]%360*Aa:0,T()):[_*Ca,m*Ca,v*Ca]},A.angle=function(t){return arguments.length?(y=t%360*Aa,T()):y*Ca},A.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},A.reflectY=function(t){return arguments.length?(b=t?-1:1,T()):b<0},A.precision=function(t){return arguments.length?(o=jp(s,C=t*t),P()):Da(C)},A.fitExtent=function(t,e){return Ro(A,t,e)},A.fitSize=function(t,e){return jo(A,t,e)},A.fitWidth=function(t,e){return Bo(A,t,e)},A.fitHeight=function(t,e){return qo(A,t,e)},function(){return e=t.apply(this,arguments),A.invert=e.invert&&k,T()}}((function(){return t}))()}function Hp(t,e){return[Na(e)*Oa(t),Oa(e)]}Hp.invert=(Bp=za,function(t,e){var n=Da(t*t+e*e),i=Bp(n),r=Oa(i),a=Na(i);return[Pa(t*r,n*a),za(n&&e*r/n)]});var Vp=6378137,$p=.0066943799901413165,Jp=484813681109536e-20,Yp=Math.PI/2,Xp=1e-10,Kp=.017453292519943295,Zp=57.29577951308232,Qp=Math.PI/4,td=2*Math.PI,ed=3.14159265359,nd={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const id={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var rd=/[\s_\-\/\(\)]/g;function ad(t,e){if(t[e])return t[e];for(var n,i=Object.keys(t),r=e.toLowerCase().replace(rd,""),a=-1;++a<i.length;)if((n=i[a]).toLowerCase().replace(rd,"")===r)return t[n]}function od(t){var e,n,i,r={},a=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,e){var n=e.split("=");return n.push(!0),t[n[0].toLowerCase()]=n[1],t}),{}),o={proj:"projName",datum:"datumCode",rf:function(t){r.rf=parseFloat(t)},lat_0:function(t){r.lat0=t*Kp},lat_1:function(t){r.lat1=t*Kp},lat_2:function(t){r.lat2=t*Kp},lat_ts:function(t){r.lat_ts=t*Kp},lon_0:function(t){r.long0=t*Kp},lon_1:function(t){r.long1=t*Kp},lon_2:function(t){r.long2=t*Kp},alpha:function(t){r.alpha=parseFloat(t)*Kp},gamma:function(t){r.rectified_grid_angle=parseFloat(t)*Kp},lonc:function(t){r.longc=t*Kp},x_0:function(t){r.x0=parseFloat(t)},y_0:function(t){r.y0=parseFloat(t)},k_0:function(t){r.k0=parseFloat(t)},k:function(t){r.k0=parseFloat(t)},a:function(t){r.a=parseFloat(t)},b:function(t){r.b=parseFloat(t)},r:function(t){r.a=r.b=parseFloat(t)},r_a:function(){r.R_A=!0},zone:function(t){r.zone=parseInt(t,10)},south:function(){r.utmSouth=!0},towgs84:function(t){r.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){r.to_meter=parseFloat(t)},units:function(t){r.units=t;var e=ad(id,t);e&&(r.to_meter=e.to_meter)},from_greenwich:function(t){r.from_greenwich=t*Kp},pm:function(t){var e=ad(nd,t);r.from_greenwich=(e||parseFloat(t))*Kp},nadgrids:function(t){"@null"===t?r.datumCode="none":r.nadgrids=t},axis:function(t){var e="ewnsud";3===t.length&&-1!==e.indexOf(t.substr(0,1))&&-1!==e.indexOf(t.substr(1,1))&&-1!==e.indexOf(t.substr(2,1))&&(r.axis=t)},approx:function(){r.approx=!0}};for(e in a)n=a[e],e in o?"function"==typeof(i=o[e])?i(n):r[i]=n:r[e]=n;return"string"==typeof r.datumCode&&"WGS84"!==r.datumCode&&(r.datumCode=r.datumCode.toLowerCase()),r}const sd=class{static getId(t){const e=t.find((t=>Array.isArray(t)&&"ID"===t[0]));return e&&e.length>=3?{authority:e[1],code:parseInt(e[2],10)}:null}static convertUnit(t,e="unit"){if(!t||t.length<3)return{type:e,name:"unknown",conversion_factor:null};const n=t[1],i=parseFloat(t[2])||null,r=t.find((t=>Array.isArray(t)&&"ID"===t[0]));return{type:e,name:n,conversion_factor:i,id:r?{authority:r[1],code:parseInt(r[2],10)}:null}}static convertAxis(t){const e=t[1]||"Unknown";let n;const i=e.match(/^\((.)\)$/);if(i){const t=i[1].toUpperCase();if("E"===t)n="east";else if("N"===t)n="north";else{if("U"!==t)throw new Error(`Unknown axis abbreviation: ${t}`);n="up"}}else n=t[2]?t[2].toLowerCase():"unknown";const r=t.find((t=>Array.isArray(t)&&"ORDER"===t[0])),a=r?parseInt(r[1],10):null,o=t.find((t=>Array.isArray(t)&&("LENGTHUNIT"===t[0]||"ANGLEUNIT"===t[0]||"SCALEUNIT"===t[0])));return{name:e,direction:n,unit:this.convertUnit(o),order:a}}static extractAxes(t){return t.filter((t=>Array.isArray(t)&&"AXIS"===t[0])).map((t=>this.convertAxis(t))).sort(((t,e)=>(t.order||0)-(e.order||0)))}static convert(t,e={}){switch(t[0]){case"PROJCRS":e.type="ProjectedCRS",e.name=t[1],e.base_crs=t.find((t=>Array.isArray(t)&&"BASEGEOGCRS"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"BASEGEOGCRS"===t[0]))):null,e.conversion=t.find((t=>Array.isArray(t)&&"CONVERSION"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"CONVERSION"===t[0]))):null;const n=t.find((t=>Array.isArray(t)&&"CS"===t[0]));n&&(e.coordinate_system={type:n[1],axis:this.extractAxes(t)});const i=t.find((t=>Array.isArray(t)&&"LENGTHUNIT"===t[0]));if(i){const t=this.convertUnit(i);e.coordinate_system.unit=t}e.id=this.getId(t);break;case"BASEGEOGCRS":case"GEOGCRS":e.type="GeographicCRS",e.name=t[1];const r=t.find((t=>Array.isArray(t)&&("DATUM"===t[0]||"ENSEMBLE"===t[0])));if(r){const n=this.convert(r);"ENSEMBLE"===r[0]?e.datum_ensemble=n:e.datum=n;const i=t.find((t=>Array.isArray(t)&&"PRIMEM"===t[0]));i&&"Greenwich"!==i[1]&&(n.prime_meridian={name:i[1],longitude:parseFloat(i[2])})}e.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(t)},e.id=this.getId(t);break;case"DATUM":e.type="GeodeticReferenceFrame",e.name=t[1],e.ellipsoid=t.find((t=>Array.isArray(t)&&"ELLIPSOID"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"ELLIPSOID"===t[0]))):null;break;case"ENSEMBLE":e.type="DatumEnsemble",e.name=t[1],e.members=t.filter((t=>Array.isArray(t)&&"MEMBER"===t[0])).map((t=>({type:"DatumEnsembleMember",name:t[1],id:this.getId(t)})));const a=t.find((t=>Array.isArray(t)&&"ENSEMBLEACCURACY"===t[0]));a&&(e.accuracy=parseFloat(a[1]));const o=t.find((t=>Array.isArray(t)&&"ELLIPSOID"===t[0]));o&&(e.ellipsoid=this.convert(o)),e.id=this.getId(t);break;case"ELLIPSOID":e.type="Ellipsoid",e.name=t[1],e.semi_major_axis=parseFloat(t[2]),e.inverse_flattening=parseFloat(t[3]);t.find((t=>Array.isArray(t)&&"LENGTHUNIT"===t[0]))&&this.convert(t.find((t=>Array.isArray(t)&&"LENGTHUNIT"===t[0])),e);break;case"CONVERSION":e.type="Conversion",e.name=t[1],e.method=t.find((t=>Array.isArray(t)&&"METHOD"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"METHOD"===t[0]))):null,e.parameters=t.filter((t=>Array.isArray(t)&&"PARAMETER"===t[0])).map((t=>this.convert(t)));break;case"METHOD":e.type="Method",e.name=t[1],e.id=this.getId(t);break;case"PARAMETER":e.type="Parameter",e.name=t[1],e.value=parseFloat(t[2]),e.unit=this.convertUnit(t.find((t=>Array.isArray(t)&&("LENGTHUNIT"===t[0]||"ANGLEUNIT"===t[0]||"SCALEUNIT"===t[0])))),e.id=this.getId(t);break;case"BOUNDCRS":e.type="BoundCRS";const s=t.find((t=>Array.isArray(t)&&"SOURCECRS"===t[0]));if(s){const t=s.find((t=>Array.isArray(t)));e.source_crs=t?this.convert(t):null}const l=t.find((t=>Array.isArray(t)&&"TARGETCRS"===t[0]));if(l){const t=l.find((t=>Array.isArray(t)));e.target_crs=t?this.convert(t):null}const c=t.find((t=>Array.isArray(t)&&"ABRIDGEDTRANSFORMATION"===t[0]));e.transformation=c?this.convert(c):null;break;case"ABRIDGEDTRANSFORMATION":if(e.type="Transformation",e.name=t[1],e.method=t.find((t=>Array.isArray(t)&&"METHOD"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"METHOD"===t[0]))):null,e.parameters=t.filter((t=>Array.isArray(t)&&("PARAMETER"===t[0]||"PARAMETERFILE"===t[0]))).map((t=>"PARAMETER"===t[0]?this.convert(t):"PARAMETERFILE"===t[0]?{name:t[1],value:t[2],id:{authority:"EPSG",code:8656}}:void 0)),7===e.parameters.length){const t=e.parameters[6];"Scale difference"===t.name&&(t.value=Math.round(1e12*(t.value-1))/1e6)}e.id=this.getId(t);break;case"AXIS":e.coordinate_system||(e.coordinate_system={type:"unspecified",axis:[]}),e.coordinate_system.axis.push(this.convertAxis(t));break;case"LENGTHUNIT":const u=this.convertUnit(t,"LinearUnit");e.coordinate_system&&e.coordinate_system.axis&&e.coordinate_system.axis.forEach((t=>{t.unit||(t.unit=u)})),u.conversion_factor&&1!==u.conversion_factor&&e.semi_major_axis&&(e.semi_major_axis={value:e.semi_major_axis,unit:u});break;default:e.keyword=t[0]}return e}};const ld=class extends sd{static convert(t,e={}){return super.convert(t,e),e.coordinate_system&&"Cartesian"===e.coordinate_system.subtype&&delete e.coordinate_system,e.usage&&delete e.usage,e}};const cd=class extends sd{static convert(t,e={}){super.convert(t,e);const n=t.find((t=>Array.isArray(t)&&"CS"===t[0]));n&&(e.coordinate_system={subtype:n[1],axis:this.extractAxes(t)});const i=t.find((t=>Array.isArray(t)&&"USAGE"===t[0]));if(i){const t=i.find((t=>Array.isArray(t)&&"SCOPE"===t[0])),n=i.find((t=>Array.isArray(t)&&"AREA"===t[0])),r=i.find((t=>Array.isArray(t)&&"BBOX"===t[0]));e.usage={},t&&(e.usage.scope=t[1]),n&&(e.usage.area=n[1]),r&&(e.usage.bbox=r.slice(1))}return e}};function ud(t){const e=function(t){return t.find((t=>Array.isArray(t)&&"USAGE"===t[0]))?"2019":(t.find((t=>Array.isArray(t)&&"CS"===t[0]))||"BOUNDCRS"===t[0]||"PROJCRS"===t[0]||t[0],"2015")}(t);return("2019"===e?cd:ld).convert(t)}const hd=function(t){var e=new vd(t);return e.output()};var fd=1,pd=/\s/,dd=/[A-Za-z]/,gd=/[A-Za-z84_]/,_d=/[,\]]/,md=/[\d\.E\-\+]/;function vd(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=fd}function yd(t,e,n){Array.isArray(e)&&(n.unshift(e),e=null);var i=e?{}:t,r=n.reduce((function(t,e){return xd(e,t),t}),i);e&&(t[e]=r)}function xd(t,e){if(Array.isArray(t)){var n=t.shift();if("PARAMETER"===n&&(n=t.shift()),1===t.length)return Array.isArray(t[0])?(e[n]={},void xd(t[0],e[n])):void(e[n]=t[0]);if(t.length)if("TOWGS84"!==n){if("AXIS"===n)return n in e||(e[n]=[]),void e[n].push(t);var i;switch(Array.isArray(n)||(e[n]={}),n){case"UNIT":case"PRIMEM":case"VERT_DATUM":return e[n]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&xd(t[2],e[n]));case"SPHEROID":case"ELLIPSOID":return e[n]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&xd(t[3],e[n]));case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":return t[0]=["name",t[0]],void yd(e,n,t);case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":return t[0]=["name",t[0]],yd(e,n,t),void(e[n].type=n);default:for(i=-1;++i<t.length;)if(!Array.isArray(t[i]))return xd(t,e[n]);return yd(e,n,t)}}else e[n]=t;else e[n]=!0}else e[t]=!0}vd.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;pd.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case fd:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},vd.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(_d.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},vd.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=fd)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=fd,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},vd.prototype.number=function(t){if(!md.test(t)){if(_d.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},vd.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},vd.prototype.keyword=function(t){if(gd.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=fd)}if(!_d.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},vd.prototype.neutral=function(t){if(dd.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(md.test(t))return this.word=t,void(this.state=3);if(!_d.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},vd.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function bd(t){return.017453292519943295*t}function wd(t){const e=(t.projName||"").toLowerCase().replace(/_/g," ");t.long0||!t.longc||"albers conic equal area"!==e&&"lambert azimuthal equal area"!==e||(t.long0=t.longc),t.lat_ts||!t.lat1||"stereographic south pole"!==e&&"polar stereographic (variant b)"!==e?t.lat_ts||!t.lat0||"polar stereographic"!==e&&"polar stereographic (variant a)"!==e||(t.lat_ts=t.lat0,t.lat0=bd(t.lat0>0?90:-90),delete t.lat1):(t.lat0=bd(t.lat1>0?90:-90),t.lat_ts=t.lat1,delete t.lat1)}function Sd(t){let e={units:null,to_meter:void 0};return"string"==typeof t?(e.units=t.toLowerCase(),"metre"===e.units&&(e.units="meter"),"meter"===e.units&&(e.to_meter=1)):t&&t.name&&(e.units=t.name.toLowerCase(),"metre"===e.units&&(e.units="meter"),e.to_meter=t.conversion_factor),e}function Md(t){return"object"==typeof t?t.value*t.unit.conversion_factor:t}function Ed(t,e){t.ellipsoid.radius?(e.a=t.ellipsoid.radius,e.rf=0):(e.a=Md(t.ellipsoid.semi_major_axis),void 0!==t.ellipsoid.inverse_flattening?e.rf=t.ellipsoid.inverse_flattening:void 0!==t.ellipsoid.semi_major_axis&&void 0!==t.ellipsoid.semi_minor_axis&&(e.rf=e.a/(e.a-Md(t.ellipsoid.semi_minor_axis))))}function Cd(t,e={}){return t&&"object"==typeof t?"BoundCRS"===t.type?(Cd(t.source_crs,e),t.transformation&&(t.transformation.method&&"NTv2"===t.transformation.method.name?e.nadgrids=t.transformation.parameters[0].value:e.datum_params=t.transformation.parameters.map((t=>t.value))),e):(Object.keys(t).forEach((n=>{const i=t[n];if(null!==i)switch(n){case"name":if(e.srsCode)break;e.name=i,e.srsCode=i;break;case"type":"GeographicCRS"===i?e.projName="longlat":"ProjectedCRS"===i&&t.conversion&&t.conversion.method&&(e.projName=t.conversion.method.name);break;case"datum":case"datum_ensemble":i.ellipsoid&&(e.ellps=i.ellipsoid.name,Ed(i,e)),i.prime_meridian&&(e.from_greenwich=i.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=i.name,Ed(i,e);break;case"prime_meridian":e.long0=(i.longitude||0)*Math.PI/180;break;case"coordinate_system":if(i.axis)if(e.axis=i.axis.map((t=>{const e=t.direction;if("east"===e)return"e";if("north"===e)return"n";if("west"===e)return"w";if("south"===e)return"s";throw new Error(`Unknown axis direction: ${e}`)})).join("")+"u",i.unit){const{units:t,to_meter:n}=Sd(i.unit);e.units=t,e.to_meter=n}else if(i.axis[0]&&i.axis[0].unit){const{units:t,to_meter:n}=Sd(i.axis[0].unit);e.units=t,e.to_meter=n}break;case"id":i.authority&&i.code&&(e.title=i.authority+":"+i.code);break;case"conversion":i.method&&i.method.name&&(e.projName=i.method.name),i.parameters&&i.parameters.forEach((t=>{const n=t.name.toLowerCase().replace(/\s+/g,"_"),i=t.value;t.unit&&t.unit.conversion_factor?e[n]=i*t.unit.conversion_factor:"degree"===t.unit?e[n]=i*Math.PI/180:e[n]=i}));break;case"unit":i.name&&(e.units=i.name.toLowerCase(),"metre"===e.units&&(e.units="meter")),i.conversion_factor&&(e.to_meter=i.conversion_factor);break;case"base_crs":Cd(i,e),e.datumCode=i.id?i.id.authority+"_"+i.id.code:i.name}})),void 0!==e.latitude_of_false_origin&&(e.lat0=e.latitude_of_false_origin),void 0!==e.longitude_of_false_origin&&(e.long0=e.longitude_of_false_origin),void 0!==e.latitude_of_standard_parallel&&(e.lat0=e.latitude_of_standard_parallel,e.lat1=e.latitude_of_standard_parallel),void 0!==e.latitude_of_1st_standard_parallel&&(e.lat1=e.latitude_of_1st_standard_parallel),void 0!==e.latitude_of_2nd_standard_parallel&&(e.lat2=e.latitude_of_2nd_standard_parallel),void 0!==e.latitude_of_projection_centre&&(e.lat0=e.latitude_of_projection_centre),void 0!==e.longitude_of_projection_centre&&(e.longc=e.longitude_of_projection_centre),void 0!==e.easting_at_false_origin&&(e.x0=e.easting_at_false_origin),void 0!==e.northing_at_false_origin&&(e.y0=e.northing_at_false_origin),void 0!==e.latitude_of_natural_origin&&(e.lat0=e.latitude_of_natural_origin),void 0!==e.longitude_of_natural_origin&&(e.long0=e.longitude_of_natural_origin),void 0!==e.longitude_of_origin&&(e.long0=e.longitude_of_origin),void 0!==e.false_easting&&(e.x0=e.false_easting),e.easting_at_projection_centre&&(e.x0=e.easting_at_projection_centre),void 0!==e.false_northing&&(e.y0=e.false_northing),e.northing_at_projection_centre&&(e.y0=e.northing_at_projection_centre),void 0!==e.standard_parallel_1&&(e.lat1=e.standard_parallel_1),void 0!==e.standard_parallel_2&&(e.lat2=e.standard_parallel_2),void 0!==e.scale_factor_at_natural_origin&&(e.k0=e.scale_factor_at_natural_origin),void 0!==e.scale_factor_at_projection_centre&&(e.k0=e.scale_factor_at_projection_centre),void 0!==e.scale_factor_on_pseudo_standard_parallel&&(e.k0=e.scale_factor_on_pseudo_standard_parallel),void 0!==e.azimuth&&(e.alpha=e.azimuth),void 0!==e.azimuth_at_projection_centre&&(e.alpha=e.azimuth_at_projection_centre),e.angle_from_rectified_to_skew_grid&&(e.rectified_grid_angle=e.angle_from_rectified_to_skew_grid),wd(e),e):t}var Ad=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function kd(t){for(var e=Object.keys(t),n=0,i=e.length;n<i;++n){var r=e[n];-1!==Ad.indexOf(r)&&Td(t[r]),"object"==typeof t[r]&&kd(t[r])}}function Td(t){if(t.AUTHORITY){var e=Object.keys(t.AUTHORITY)[0];e&&e in t.AUTHORITY&&(t.title=e+":"+t.AUTHORITY[e])}if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var n="",i=0,r=t.AXIS.length;i<r;++i){var a=[t.AXIS[i][0].toLowerCase(),t.AXIS[i][1].toLowerCase()];-1!==a[0].indexOf("north")||("y"===a[0]||"lat"===a[0])&&"north"===a[1]?n+="n":-1!==a[0].indexOf("south")||("y"===a[0]||"lat"===a[0])&&"south"===a[1]?n+="s":-1!==a[0].indexOf("east")||("x"===a[0]||"lon"===a[0])&&"east"===a[1]?n+="e":-1===a[0].indexOf("west")&&("x"!==a[0]&&"lon"!==a[0]||"west"!==a[1])||(n+="w")}2===n.length&&(n+="u"),3===n.length&&(t.axis=n)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var o=t.GEOGCS;function s(e){return e*(t.to_meter||1)}"GEOGCS"===t.type&&(o=t),o&&(o.DATUM?t.datumCode=o.DATUM.name.toLowerCase():t.datumCode=o.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_1949"===t.datumCode&&(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"belge_1972"===t.datumCode&&(t.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(t.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=o.DATUM.SPHEROID.a,t.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(t.datum_params=o.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),t.rectified_grid_angle&&(t.rectified_grid_angle=bd(t.rectified_grid_angle));[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",bd],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",bd],["x0","false_easting",s],["y0","false_northing",s],["long0","central_meridian",bd],["lat0","latitude_of_origin",bd],["lat0","standard_parallel_1",bd],["lat1","standard_parallel_1",bd],["lat2","standard_parallel_2",bd],["azimuth","Azimuth"],["alpha","azimuth",bd],["srsCode","name"]].forEach((function(e){return function(t,e){var n=e[0],i=e[1];!(n in t)&&i in t&&(t[n]=t[i],3===e.length&&(t[n]=e[2](t[n])))}(t,e)})),wd(t)}function Pd(t){if("object"==typeof t)return Cd(t);const e=function(t){const e=t.toUpperCase();return e.includes("PROJCRS")||e.includes("GEOGCRS")||e.includes("BOUNDCRS")||e.includes("VERTCRS")||e.includes("LENGTHUNIT")||e.includes("ANGLEUNIT")||e.includes("SCALEUNIT")?"WKT2":(e.includes("PROJCS")||e.includes("GEOGCS")||e.includes("LOCAL_CS")||e.includes("VERT_CS")||e.includes("UNIT"),"WKT1")}(t);var n=hd(t);if("WKT2"===e){return Cd(ud(n))}var i=n[0],r={};return xd(n,r),kd(r),r[i]}function Nd(t){var e=this;if(2===arguments.length){var n=arguments[1];"string"==typeof n?"+"===n.charAt(0)?Nd[t]=od(arguments[1]):Nd[t]=Pd(arguments[1]):Nd[t]=n}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?Nd.apply(e,t):Nd(t)}));if("string"==typeof t){if(t in Nd)return Nd[t]}else"EPSG"in t?Nd["EPSG:"+t.EPSG]=t:"ESRI"in t?Nd["ESRI:"+t.ESRI]=t:"IAU2000"in t?Nd["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var e=1;e<=60;++e)t("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),t("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(Nd);const Ld=Nd;var Fd=["3857","900913","3785","102113"];const Od=function(t){if(!function(t){return"string"==typeof t}(t))return t.projName?t:Pd(t);if(function(t){return t in Ld}(t))return Ld[t];if(function(t){return 0!==t.indexOf("+")&&-1!==t.indexOf("[")||"object"==typeof t&&!("srsCode"in t)}(t)){var e=Pd(t);if(function(t){var e=ad(t,"authority");if(e){var n=ad(e,"epsg");return n&&Fd.indexOf(n)>-1}}(e))return Ld["EPSG:3857"];var n=function(t){var e=ad(t,"extension");if(e)return ad(e,"proj4")}(e);return n?od(n):e}return function(t){return"+"===t[0]}(t)?od(t):void 0};function Gd(t,e){var n,i;if(t=t||{},!e)return t;for(i in e)void 0!==(n=e[i])&&(t[i]=n);return t}function Dd(t,e,n){var i=t*e;return n/Math.sqrt(1-i*i)}function zd(t){return t<0?-1:1}function Id(t){return Math.abs(t)<=ed?t:t-zd(t)*td}function Rd(t,e,n){var i=t*n,r=.5*t;return i=Math.pow((1-i)/(1+i),r),Math.tan(.5*(Yp-e))/i}function jd(t,e){for(var n,i,r=.5*t,a=Yp-2*Math.atan(e),o=0;o<=15;o++)if(n=t*Math.sin(a),a+=i=Yp-2*Math.atan(e*Math.pow((1-n)/(1+n),r))-a,Math.abs(i)<=1e-10)return a;return-9999}const Bd={init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Dd(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,n,i=t.x,r=t.y;if(r*Zp>90&&r*Zp<-90&&i*Zp>180&&i*Zp<-180)return null;if(Math.abs(Math.abs(r)-Yp)<=Xp)return null;if(this.sphere)e=this.x0+this.a*this.k0*Id(i-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(Qp+.5*r));else{var a=Math.sin(r),o=Rd(this.e,r,a);e=this.x0+this.a*this.k0*Id(i-this.long0),n=this.y0-this.a*this.k0*Math.log(o)}return t.x=e,t.y=n,t},inverse:function(t){var e,n,i=t.x-this.x0,r=t.y-this.y0;if(this.sphere)n=Yp-2*Math.atan(Math.exp(-r/(this.a*this.k0)));else{var a=Math.exp(-r/(this.a*this.k0));if(-9999===(n=jd(this.e,a)))return null}return e=Id(this.long0+i/(this.a*this.k0)),t.x=e,t.y=n,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"]};function qd(t){return t}var Ud=[Bd,{init:function(){},forward:qd,inverse:qd,names:["longlat","identity"]}],Wd={},Hd=[];function Vd(t,e){var n=Hd.length;return t.names?(Hd[n]=t,t.names.forEach((function(t){Wd[t.toLowerCase()]=n})),this):(console.log(e),!0)}function $d(t){return t.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}const Jd={start:function(){Ud.forEach(Vd)},add:Vd,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==Wd[e]&&Hd[Wd[e]]||(e=$d(e))in Wd&&Hd[Wd[e]]?Hd[Wd[e]]:void 0}};const Yd={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},Xd=Yd.WGS84;var Kd={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var Zd in Kd){var Qd=Kd[Zd];Qd.datumName&&(Kd[Qd.datumName]=Qd)}const tg=Kd;const eg=function(t,e,n,i,r,a,o){var s={};return s.datum_type=void 0===t||"none"===t?5:4,e&&(s.datum_params=e.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=1),s.datum_params.length>3&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=2,s.datum_params[3]*=Jp,s.datum_params[4]*=Jp,s.datum_params[5]*=Jp,s.datum_params[6]=s.datum_params[6]/1e6+1))),o&&(s.datum_type=3,s.grids=o),s.a=n,s.b=i,s.es=r,s.ep2=a,s};var ng={};async function ig(t,e){for(var n=[],i=await e.getImageCount(),r=i-1;r>=0;r--){var a=await e.getImage(r),o=await a.readRasters(),s=[a.getWidth(),a.getHeight()],l=a.getBoundingBox().map(ag),c=[a.fileDirectory.ModelPixelScale[0],a.fileDirectory.ModelPixelScale[1]].map(ag),u=l[0]+(s[0]-1)*c[0],h=l[3]-(s[1]-1)*c[1],f=o[0],p=o[1],d=[];for(let t=s[1]-1;t>=0;t--)for(let e=s[0]-1;e>=0;e--){var g=t*s[0]+e;d.push([-og(p[g]),og(f[g])])}n.push({del:c,lim:s,ll:[-u,h],cvs:d})}var _={header:{nSubgrids:i},subgrids:n};return ng[t]=_,_}function rg(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:ng[t]||null,isNull:!1}}function ag(t){return t*Math.PI/180}function og(t){return t/3600*Math.PI/180}function sg(t,e,n){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,n)))}function lg(t){return t.map((function(t){return[og(t.longitudeShift),og(t.latitudeShift)]}))}function cg(t,e,n){return{name:sg(t,e+8,e+16).trim(),parent:sg(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,n),upperLatitude:t.getFloat64(e+88,n),lowerLongitude:t.getFloat64(e+104,n),upperLongitude:t.getFloat64(e+120,n),latitudeInterval:t.getFloat64(e+136,n),longitudeInterval:t.getFloat64(e+152,n),gridNodeCount:t.getInt32(e+168,n)}}function ug(t,e,n,i,r){var a=e+176,o=16;!1===r&&(o=8);for(var s=[],l=0;l<n.gridNodeCount;l++){var c={latitudeShift:t.getFloat32(a+l*o,i),longitudeShift:t.getFloat32(a+l*o+4,i)};!1!==r&&(c.latitudeAccuracy=t.getFloat32(a+l*o+8,i),c.longitudeAccuracy=t.getFloat32(a+l*o+12,i)),s.push(c)}return s}function hg(t,e){if(!(this instanceof hg))return new hg(t);e=e||function(t){if(t)throw t};var n=Od(t);if("object"==typeof n){var i=hg.projections.get(n.projName);if(i){if(n.datumCode&&"none"!==n.datumCode){var r=ad(tg,n.datumCode);r&&(n.datum_params=n.datum_params||(r.towgs84?r.towgs84.split(","):null),n.ellps=r.ellipse,n.datumName=r.datumName?r.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu",n.ellps=n.ellps||"wgs84",n.lat1=n.lat1||n.lat0;var a=function(t,e,n,i,r){if(!t){var a=ad(Yd,i);a||(a=Xd),t=a.a,e=a.b,n=a.rf}return n&&!e&&(e=(1-1/n)*t),(0===n||Math.abs(t-e)<Xp)&&(r=!0,e=t),{a:t,b:e,rf:n,sphere:r}}(n.a,n.b,n.rf,n.ellps,n.sphere),o=function(t,e,n,i){var r=t*t,a=e*e,o=(r-a)/r,s=0;return i?(r=(t*=1-o*(.16666666666666666+o*(.04722222222222222+.022156084656084655*o)))*t,o=0):s=Math.sqrt(o),{es:o,e:s,ep2:(r-a)/a}}(a.a,a.b,a.rf,n.R_A),s=function(t){return void 0===t?null:t.split(",").map(rg)}(n.nadgrids),l=n.datum||eg(n.datumCode,n.datum_params,a.a,a.b,o.es,o.ep2,s);Gd(this,n),Gd(this,i),this.a=a.a,this.b=a.b,this.rf=a.rf,this.sphere=a.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=l,this.init(),e(null,this)}else e("Could not get projection name from: "+t)}else e("Could not parse to valid json: "+t)}hg.projections=Jd,hg.projections.start();const fg=hg;function pg(t,e,n){var i,r,a,o,s=t.x,l=t.y,c=t.z?t.z:0;if(l<-Yp&&l>-1.001*Yp)l=-Yp;else if(l>Yp&&l<1.001*Yp)l=Yp;else{if(l<-Yp)return{x:-1/0,y:-1/0,z:t.z};if(l>Yp)return{x:1/0,y:1/0,z:t.z}}return s>Math.PI&&(s-=2*Math.PI),r=Math.sin(l),o=Math.cos(l),a=r*r,{x:((i=n/Math.sqrt(1-e*a))+c)*o*Math.cos(s),y:(i+c)*o*Math.sin(s),z:(i*(1-e)+c)*r}}function dg(t,e,n,i){var r,a,o,s,l,c,u,h,f,p,d,g,_,m,v,y=1e-12,x=t.x,b=t.y,w=t.z?t.z:0;if(r=Math.sqrt(x*x+b*b),a=Math.sqrt(x*x+b*b+w*w),r/n<y){if(m=0,a/n<y)return v=-i,{x:t.x,y:t.y,z:t.z}}else m=Math.atan2(b,x);o=w/a,h=(s=r/a)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*s*s)),f=o*l,_=0;do{_++,c=e*(u=n/Math.sqrt(1-e*f*f))/(u+(v=r*h+w*f-u*(1-e*f*f))),g=(d=o*(l=1/Math.sqrt(1-c*(2-c)*s*s)))*h-(p=s*(1-c)*l)*f,h=p,f=d}while(g*g>1e-24&&_<30);return{x:m,y:Math.atan(d/Math.abs(p)),z:v}}function gg(t){return 1===t||2===t}function _g(t,e,n){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return n;if(5===t.datum_type||5===e.datum_type)return n;var i=t.a,r=t.es;if(3===t.datum_type){if(0!==mg(t,!1,n))return;i=Vp,r=$p}var a=e.a,o=e.b,s=e.es;if(3===e.datum_type&&(a=Vp,o=6356752.314,s=$p),r===s&&i===a&&!gg(t.datum_type)&&!gg(e.datum_type))return n;if((n=pg(n,r,i),gg(t.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x+n[0],y:t.y+n[1],z:t.z+n[2]};if(2===e){var i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],l=n[5],c=n[6];return{x:c*(t.x-l*t.y+s*t.z)+i,y:c*(l*t.x+t.y-o*t.z)+r,z:c*(-s*t.x+o*t.y+t.z)+a}}}(n,t.datum_type,t.datum_params)),gg(e.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x-n[0],y:t.y-n[1],z:t.z-n[2]};if(2===e){var i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],l=n[5],c=n[6],u=(t.x-i)/c,h=(t.y-r)/c,f=(t.z-a)/c;return{x:u+l*h-s*f,y:-l*u+h+o*f,z:s*u-o*h+f}}}(n,e.datum_type,e.datum_params)),n=dg(n,s,a,o),3===e.datum_type)&&0!==mg(e,!0,n))return;return n}function mg(t,e,n){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var i={x:-n.x,y:n.y},r={x:Number.NaN,y:Number.NaN},a=[];t:for(var o=0;o<t.grids.length;o++){var s=t.grids[o];if(a.push(s.name),s.isNull){r=i;break}if(null!==s.grid)for(var l=s.grid.subgrids,c=0,u=l.length;c<u;c++){var h=l[c],f=(Math.abs(h.del[1])+Math.abs(h.del[0]))/1e4,p=h.ll[0]-f,d=h.ll[1]-f,g=h.ll[0]+(h.lim[0]-1)*h.del[0]+f,_=h.ll[1]+(h.lim[1]-1)*h.del[1]+f;if(!(d>i.y||p>i.x||_<i.y||g<i.x)&&(r=vg(i,e,h),!isNaN(r.x)))break t}else if(s.mandatory)return console.log("Unable to find mandatory grid '"+s.name+"'"),-1}return isNaN(r.x)?(console.log("Failed to find a grid shift table for location '"+-i.x*Zp+" "+i.y*Zp+" tried: '"+a+"'"),-1):(n.x=-r.x,n.y=r.y,0)}function vg(t,e,n){var i={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return i;var r={x:t.x,y:t.y};r.x-=n.ll[0],r.y-=n.ll[1],r.x=Id(r.x-Math.PI)+Math.PI;var a=yg(r,n);if(e){if(isNaN(a.x))return i;a.x=r.x-a.x,a.y=r.y-a.y;var o,s,l=9;do{if(s=yg(a,n),isNaN(s.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}o={x:r.x-(s.x+a.x),y:r.y-(s.y+a.y)},a.x+=o.x,a.y+=o.y}while(l--&&Math.abs(o.x)>1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),i;i.x=Id(a.x+n.ll[0]),i.y=a.y+n.ll[1]}else isNaN(a.x)||(i.x=t.x+a.x,i.y=t.y+a.y);return i}function yg(t,e){var n,i={x:t.x/e.del[0],y:t.y/e.del[1]},r=Math.floor(i.x),a=Math.floor(i.y),o=i.x-1*r,s=i.y-1*a,l={x:Number.NaN,y:Number.NaN};if(r<0||r>=e.lim[0])return l;if(a<0||a>=e.lim[1])return l;n=a*e.lim[0]+r;var c=e.cvs[n][0],u=e.cvs[n][1];n++;var h=e.cvs[n][0],f=e.cvs[n][1];n+=e.lim[0];var p=e.cvs[n][0],d=e.cvs[n][1];n--;var g=e.cvs[n][0],_=e.cvs[n][1],m=o*s,v=o*(1-s),y=(1-o)*(1-s),x=(1-o)*s;return l.x=y*c+v*h+x*g+m*p,l.y=y*u+v*f+x*_+m*d,l}function xg(t,e,n){var i,r,a,o=n.x,s=n.y,l=n.z||0,c={};for(a=0;a<3;a++)if(!e||2!==a||void 0!==n.z)switch(0===a?(i=o,r=-1!=="ew".indexOf(t.axis[a])?"x":"y"):1===a?(i=s,r=-1!=="ns".indexOf(t.axis[a])?"y":"x"):(i=l,r="z"),t.axis[a]){case"e":case"n":c[r]=i;break;case"w":case"s":c[r]=-i;break;case"u":void 0!==n[r]&&(c.z=i);break;case"d":void 0!==n[r]&&(c.z=-i);break;default:return null}return c}function bg(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function wg(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Sg(t,e,n,i){var r,a=void 0!==(n=Array.isArray(n)?bg(n):{x:n.x,y:n.y,z:n.z,m:n.m}).z;if(function(t){wg(t.x),wg(t.y)}(n),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type||3===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type||3===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(n=Sg(t,r=new fg("WGS84"),n,i),t=r),i&&"enu"!==t.axis&&(n=xg(t,!1,n)),"longlat"===t.projName)n={x:n.x*Kp,y:n.y*Kp,z:n.z||0};else if(t.to_meter&&(n={x:n.x*t.to_meter,y:n.y*t.to_meter,z:n.z||0}),!(n=t.inverse(n)))return;if(t.from_greenwich&&(n.x+=t.from_greenwich),n=_g(t.datum,e.datum,n))return e.from_greenwich&&(n={x:n.x-e.from_greenwich,y:n.y,z:n.z||0}),"longlat"===e.projName?n={x:n.x*Zp,y:n.y*Zp,z:n.z||0}:(n=e.forward(n),e.to_meter&&(n={x:n.x/e.to_meter,y:n.y/e.to_meter,z:n.z||0})),i&&"enu"!==e.axis?xg(e,!0,n):(n&&!a&&delete n.z,n)}var Mg=fg("WGS84");function Eg(t,e,n,i){var r,a,o;return Array.isArray(n)?(r=Sg(t,e,n,i)||{x:NaN,y:NaN},n.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof r.z?[r.x,r.y,r.z].concat(n.slice(3)):[r.x,r.y,n[2]].concat(n.slice(3)):[r.x,r.y].concat(n.slice(2)):[r.x,r.y]):(a=Sg(t,e,n,i),2===(o=Object.keys(n)).length||o.forEach((function(i){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===i||"y"===i||"z"===i)return}else if("x"===i||"y"===i)return;a[i]=n[i]})),a)}function Cg(t){return t instanceof fg?t:t.oProj?t.oProj:fg(t)}const Ag=function(t,e,n){t=Cg(t);var i,r=!1;return void 0===e?(e=t,t=Mg,r=!0):(void 0!==e.x||Array.isArray(e))&&(n=e,e=t,t=Mg,r=!0),e=Cg(e),n?Eg(t,e,n):(i={forward:function(n,i){return Eg(t,e,n,i)},inverse:function(n,i){return Eg(e,t,n,i)}},r&&(i.oProj=e),i)};var kg="AJSAJS",Tg="AFAFAF",Pg=65,Ng=73,Lg=79,Fg=86,Og=90;const Gg={forward:Dg,inverse:function(t){var e=jg(Ug(t.toUpperCase()));if(e.lat&&e.lon)return[e.lon,e.lat,e.lon,e.lat];return[e.left,e.bottom,e.right,e.top]},toPoint:zg};function Dg(t,e){return e=e||5,function(t,e){var n="00000"+t.easting,i="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(r=t.easting,a=t.northing,o=t.zoneNumber,s=qg(o),l=Math.floor(r/1e5),c=Math.floor(a/1e5)%20,function(t,e,n){var i=n-1,r=kg.charCodeAt(i),a=Tg.charCodeAt(i),o=r+t-1,s=a+e,l=!1;return o>Og&&(o=o-Og+Pg-1,l=!0),(o===Ng||r<Ng&&o>Ng||(o>Ng||r<Ng)&&l)&&o++,(o===Lg||r<Lg&&o>Lg||(o>Lg||r<Lg)&&l)&&++o===Ng&&o++,o>Og&&(o=o-Og+Pg-1),s>Fg?(s=s-Fg+Pg-1,l=!0):l=!1,(s===Ng||a<Ng&&s>Ng||(s>Ng||a<Ng)&&l)&&s++,(s===Lg||a<Lg&&s>Lg||(s>Lg||a<Lg)&&l)&&++s===Ng&&s++,s>Fg&&(s=s-Fg+Pg-1),String.fromCharCode(o)+String.fromCharCode(s)}(l,c,s))+n.substr(n.length-5,e)+i.substr(i.length-5,e);var r,a,o,s,l,c}(function(t){var e,n,i,r,a,o,s,l,c=t.lat,u=t.lon,h=6378137,f=.00669438,p=.9996,d=Ig(c),g=Ig(u);l=Math.floor((u+180)/6)+1,180===u&&(l=60);c>=56&&c<64&&u>=3&&u<12&&(l=32);c>=72&&c<84&&(u>=0&&u<9?l=31:u>=9&&u<21?l=33:u>=21&&u<33?l=35:u>=33&&u<42&&(l=37));s=Ig(6*(l-1)-180+3),e=f/(1-f),n=h/Math.sqrt(1-f*Math.sin(d)*Math.sin(d)),i=Math.tan(d)*Math.tan(d),r=e*Math.cos(d)*Math.cos(d),a=Math.cos(d)*(g-s),o=h*((1-f/4-3*f*f/64-5*f*f*f/256)*d-(3*f/8+3*f*f/32+45*f*f*f/1024)*Math.sin(2*d)+(15*f*f/256+45*f*f*f/1024)*Math.sin(4*d)-35*f*f*f/3072*Math.sin(6*d));var _=p*n*(a+(1-i+r)*a*a*a/6+(5-18*i+i*i+72*r-58*e)*a*a*a*a*a/120)+5e5,m=p*(o+n*Math.tan(d)*(a*a/2+(5-i+9*r+4*r*r)*a*a*a*a/24+(61-58*i+i*i+600*r-330*e)*a*a*a*a*a*a/720));c<0&&(m+=1e7);return{northing:Math.round(m),easting:Math.round(_),zoneNumber:l,zoneLetter:Bg(c)}}({lat:t[1],lon:t[0]}),e)}function zg(t){var e=jg(Ug(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Ig(t){return t*(Math.PI/180)}function Rg(t){return t/Math.PI*180}function jg(t){var e=t.northing,n=t.easting,i=t.zoneLetter,r=t.zoneNumber;if(r<0||r>60)return null;var a,o,s,l,c,u,h,f,p,d=.9996,g=6378137,_=.00669438,m=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),v=n-5e5,y=e;i<"N"&&(y-=1e7),h=6*(r-1)-180+3,a=.006739496752268451,p=(f=y/d/6367449.145945056)+(3*m/2-27*m*m*m/32)*Math.sin(2*f)+(21*m*m/16-55*m*m*m*m/32)*Math.sin(4*f)+151*m*m*m/96*Math.sin(6*f),o=g/Math.sqrt(1-_*Math.sin(p)*Math.sin(p)),s=Math.tan(p)*Math.tan(p),l=a*Math.cos(p)*Math.cos(p),c=.99330562*g/Math.pow(1-_*Math.sin(p)*Math.sin(p),1.5),u=v/(o*d);var x=p-o*Math.tan(p)/c*(u*u/2-(5+3*s+10*l-4*l*l-9*a)*u*u*u*u/24+(61+90*s+298*l+45*s*s-1.6983531815716497-3*l*l)*u*u*u*u*u*u/720);x=Rg(x);var b,w=(u-(1+2*s+l)*u*u*u/6+(5-2*l+28*s-3*l*l+8*a+24*s*s)*u*u*u*u*u/120)/Math.cos(p);if(w=h+Rg(w),t.accuracy){var S=jg({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});b={top:S.lat,right:S.lon,bottom:x,left:w}}else b={lat:x,lon:w};return b}function Bg(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function qg(t){var e=t%6;return 0===e&&(e=6),e}function Ug(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,n=t.length,i=null,r="",a=0;!/[A-Z]/.test(e=t.charAt(a));){if(a>=2)throw"MGRSPoint bad conversion from: "+t;r+=e,a++}var o=parseInt(r,10);if(0===a||a+3>n)throw"MGRSPoint bad conversion from: "+t;var s=t.charAt(a++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+t;i=t.substring(a,a+=2);for(var l=qg(o),c=function(t,e){var n=kg.charCodeAt(e-1),i=1e5,r=!1;for(;n!==t.charCodeAt(0);){if(++n===Ng&&n++,n===Lg&&n++,n>Og){if(r)throw"Bad character: "+t;n=Pg,r=!0}i+=1e5}return i}(i.charAt(0),l),u=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var n=Tg.charCodeAt(e-1),i=0,r=!1;for(;n!==t.charCodeAt(0);){if(++n===Ng&&n++,n===Lg&&n++,n>Fg){if(r)throw"Bad character: "+t;n=Pg,r=!0}i+=1e5}return i}(i.charAt(1),l);u<Wg(s);)u+=2e6;var h=n-a;if(h%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var f,p,d,g=h/2,_=0,m=0;return g>0&&(f=1e5/Math.pow(10,g),p=t.substring(a,a+g),_=parseFloat(p)*f,d=t.substring(a+g),m=parseFloat(d)*f),{easting:_+c,northing:m+u,zoneLetter:s,zoneNumber:o,accuracy:f}}function Wg(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function Hg(t,e,n){if(!(this instanceof Hg))return new Hg(t,e,n);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var i=t.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=t,this.y=e,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Hg.fromMGRS=function(t){return new Hg(zg(t))},Hg.prototype.toMGRS=function(t){return Dg([this.x,this.y],t)};const Vg=Hg;var $g=.046875,Jg=.01953125,Yg=.01068115234375;function Xg(t){var e=[];e[0]=1-t*(.25+t*($g+t*(Jg+t*Yg))),e[1]=t*(.75-t*($g+t*(Jg+t*Yg)));var n=t*t;return e[2]=n*(.46875-t*(.013020833333333334+.007120768229166667*t)),n*=t,e[3]=n*(.3645833333333333-.005696614583333333*t),e[4]=n*t*.3076171875,e}function Kg(t,e,n,i){return n*=e,e*=e,i[0]*t-n*(i[1]+e*(i[2]+e*(i[3]+e*i[4])))}function Zg(t,e,n){for(var i=1/(1-e),r=t,a=20;a;--a){var o=Math.sin(r),s=1-e*o*o;if(r-=s=(Kg(r,o,Math.cos(r),n)-t)*(s*Math.sqrt(s))*i,Math.abs(s)<Xp)return r}return r}const Qg={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=Xg(this.es),this.ml0=Kg(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,n,i,r=t.x,a=t.y,o=Id(r-this.long0),s=Math.sin(a),l=Math.cos(a);if(this.es){var c=l*o,u=Math.pow(c,2),h=this.ep2*Math.pow(l,2),f=Math.pow(h,2),p=Math.abs(l)>Xp?Math.tan(a):0,d=Math.pow(p,2),g=Math.pow(d,2);e=1-this.es*Math.pow(s,2),c/=Math.sqrt(e);var _=Kg(a,s,l,this.en);n=this.a*(this.k0*c*(1+u/6*(1-d+h+u/20*(5-18*d+g+14*h-58*d*h+u/42*(61+179*g-g*d-479*d)))))+this.x0,i=this.a*(this.k0*(_-this.ml0+s*o*c/2*(1+u/12*(5-d+9*h+4*f+u/30*(61+g-58*d+270*h-330*d*h+u/56*(1385+543*g-g*d-3111*d))))))+this.y0}else{var m=l*Math.sin(o);if(Math.abs(Math.abs(m)-1)<Xp)return 93;if(n=.5*this.a*this.k0*Math.log((1+m)/(1-m))+this.x0,i=l*Math.cos(o)/Math.sqrt(1-Math.pow(m,2)),(m=Math.abs(i))>=1){if(m-1>Xp)return 93;i=0}else i=Math.acos(i);a<0&&(i=-i),i=this.a*this.k0*(i-this.lat0)+this.y0}return t.x=n,t.y=i,t},inverse:function(t){var e,n,i,r,a=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(n=Zg(e=this.ml0+o/this.k0,this.es,this.en),Math.abs(n)<Yp){var s=Math.sin(n),l=Math.cos(n),c=Math.abs(l)>Xp?Math.tan(n):0,u=this.ep2*Math.pow(l,2),h=Math.pow(u,2),f=Math.pow(c,2),p=Math.pow(f,2);e=1-this.es*Math.pow(s,2);var d=a*Math.sqrt(e)/this.k0,g=Math.pow(d,2);i=n-(e*=c)*g/(1-this.es)*.5*(1-g/12*(5+3*f-9*u*f+u-4*h-g/30*(61+90*f-252*u*f+45*p+46*u-g/56*(1385+3633*f+4095*p+1574*p*f)))),r=Id(this.long0+d*(1-g/6*(1+2*f+u-g/20*(5+28*f+24*p+8*u*f+6*u-g/42*(61+662*f+1320*p+720*p*f))))/l)}else i=Yp*zd(o),r=0;else{var _=Math.exp(a/this.k0),m=.5*(_-1/_),v=this.lat0+o/this.k0,y=Math.cos(v);e=Math.sqrt((1-Math.pow(y,2))/(1+Math.pow(m,2))),i=Math.asin(e),o<0&&(i=-i),r=0===m&&0===y?0:Id(Math.atan2(m,y)+this.long0)}return t.x=r,t.y=i,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function t_(t){var e=Math.exp(t);return e=(e-1/e)/2}function e_(t,e){t=Math.abs(t),e=Math.abs(e);var n=Math.max(t,e),i=Math.min(t,e)/(n||1);return n*Math.sqrt(1+Math.pow(i,2))}function n_(t){var e=Math.abs(t);return e=function(t){var e=1+t,n=e-1;return 0===n?t:t*Math.log(e)/n}(e*(1+e/(e_(1,e)+1))),t<0?-e:e}function i_(t,e){for(var n,i=2*Math.cos(2*e),r=t.length-1,a=t[r],o=0;--r>=0;)n=i*a-o+t[r],o=a,a=n;return e+n*Math.sin(2*e)}function r_(t,e,n){for(var i,r,a=Math.sin(e),o=Math.cos(e),s=t_(n),l=function(t){var e=Math.exp(t);return(e+1/e)/2}(n),c=2*o*l,u=-2*a*s,h=t.length-1,f=t[h],p=0,d=0,g=0;--h>=0;)i=d,r=p,f=c*(d=f)-i-u*(p=g)+t[h],g=u*d-r+c*p;return[(c=a*l)*f-(u=o*s)*g,c*g+u*f]}const a_={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Qg.init.apply(this),this.forward=Qg.forward,this.inverse=Qg.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),n=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),n*=e,this.cgb[1]=n*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=n*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),n*=e,this.cgb[2]=n*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=n*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),n*=e,this.cgb[3]=n*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=n*(1237/630+e*(e*(-24832/14175)-2.4)),n*=e,this.cgb[4]=n*(4174/315+e*(-144838/6237)),this.cbg[4]=n*(-734/315+e*(109598/31185)),n*=e,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=n*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=n*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),n*=e,this.utg[2]=n*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=n*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),n*=e,this.utg[3]=n*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=n*(49561/161280+e*(-179/168+e*(6601661/7257600))),n*=e,this.utg[4]=n*(-4583/161280+e*(108847/3991680)),this.gtu[4]=n*(34729/80640+e*(-3418889/1995840)),n*=e,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=.6650675310896665*n;var i=i_(this.cbg,this.lat0);this.Zb=-this.Qn*(i+function(t,e){for(var n,i=2*Math.cos(e),r=t.length-1,a=t[r],o=0;--r>=0;)n=i*a-o+t[r],o=a,a=n;return Math.sin(e)*n}(this.gtu,2*i))},forward:function(t){var e=Id(t.x-this.long0),n=t.y;n=i_(this.cbg,n);var i=Math.sin(n),r=Math.cos(n),a=Math.sin(e),o=Math.cos(e);n=Math.atan2(i,o*r),e=Math.atan2(a*r,e_(i,r*o)),e=n_(Math.tan(e));var s,l,c=r_(this.gtu,2*n,2*e);return n+=c[0],e+=c[1],Math.abs(e)<=2.623395162778?(s=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*n+this.Zb)+this.y0):(s=1/0,l=1/0),t.x=s,t.y=l,t},inverse:function(t){var e,n,i=(t.x-this.x0)*(1/this.a),r=(t.y-this.y0)*(1/this.a);if(r=(r-this.Zb)/this.Qn,i/=this.Qn,Math.abs(i)<=2.623395162778){var a=r_(this.utg,2*r,2*i);r+=a[0],i+=a[1],i=Math.atan(t_(i));var o=Math.sin(r),s=Math.cos(r),l=Math.sin(i),c=Math.cos(i);r=Math.atan2(o*c,e_(l,c*s)),e=Id((i=Math.atan2(l,c*s))+this.long0),n=i_(this.cgb,r)}else e=1/0,n=1/0;return t.x=e,t.y=n,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]};const o_={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(Id(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*Kp,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,a_.init.apply(this),this.forward=a_.forward,this.inverse=a_.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function s_(t,e){return Math.pow((1-t)/(1+t),e)}const l_={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Qp)/(Math.pow(Math.tan(.5*this.lat0+Qp),this.C)*s_(this.e*t,this.ratexp))},forward:function(t){var e=t.x,n=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+Qp),this.C)*s_(this.e*Math.sin(n),this.ratexp))-Yp,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,n=t.y,i=Math.pow(Math.tan(.5*n+Qp)/this.K,1/this.C),r=20;r>0&&(n=2*Math.atan(i*s_(this.e*Math.sin(t.y),-.5*this.e))-Yp,!(Math.abs(n-t.y)<1e-14));--r)t.y=n;return r?(t.x=e,t.y=n,t):null},names:["gauss"]};const c_={init:function(){l_.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,n,i,r;return t.x=Id(t.x-this.long0),l_.forward.apply(this,[t]),e=Math.sin(t.y),n=Math.cos(t.y),i=Math.cos(t.x),r=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*n*i),t.x=r*n*Math.sin(t.x),t.y=r*(this.cosc0*e-this.sinc0*n*i),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,n,i,r,a;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,a=e_(t.x,t.y)){var o=2*Math.atan2(a,this.R2);e=Math.sin(o),n=Math.cos(o),r=Math.asin(n*this.sinc0+t.y*e*this.cosc0/a),i=Math.atan2(t.x*e,a*this.cosc0*n-t.y*this.sinc0*e)}else r=this.phic0,i=0;return t.x=i,t.y=r,l_.inverse.apply(this,[t]),t.x=Id(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};const u_={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Xp&&(this.k0=.5*(1+zd(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Xp&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Xp&&Math.abs(Math.cos(this.lat_ts))>Xp&&(this.k0=.5*this.cons*Dd(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Rd(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Dd(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Yp,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,n,i,r,a,o,s=t.x,l=t.y,c=Math.sin(l),u=Math.cos(l),h=Id(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=Xp&&Math.abs(l+this.lat0)<=Xp?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*c+this.coslat0*u*Math.cos(h)),t.x=this.a*e*u*Math.sin(h)+this.x0,t.y=this.a*e*(this.coslat0*c-this.sinlat0*u*Math.cos(h))+this.y0,t):(n=2*Math.atan(this.ssfn_(l,c,this.e))-Yp,r=Math.cos(n),i=Math.sin(n),Math.abs(this.coslat0)<=Xp?(a=Rd(this.e,l*this.con,this.con*c),o=2*this.a*this.k0*a/this.cons,t.x=this.x0+o*Math.sin(s-this.long0),t.y=this.y0-this.con*o*Math.cos(s-this.long0),t):(Math.abs(this.sinlat0)<Xp?(e=2*this.a*this.k0/(1+r*Math.cos(h)),t.y=e*i):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*i+this.cosX0*r*Math.cos(h))),t.y=e*(this.cosX0*i-this.sinX0*r*Math.cos(h))+this.y0),t.x=e*r*Math.sin(h)+this.x0,t))},inverse:function(t){var e,n,i,r,a;t.x-=this.x0,t.y-=this.y0;var o=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var s=2*Math.atan(o/(2*this.a*this.k0));return e=this.long0,n=this.lat0,o<=Xp?(t.x=e,t.y=n,t):(n=Math.asin(Math.cos(s)*this.sinlat0+t.y*Math.sin(s)*this.coslat0/o),e=Math.abs(this.coslat0)<Xp?this.lat0>0?Id(this.long0+Math.atan2(t.x,-1*t.y)):Id(this.long0+Math.atan2(t.x,t.y)):Id(this.long0+Math.atan2(t.x*Math.sin(s),o*this.coslat0*Math.cos(s)-t.y*this.sinlat0*Math.sin(s))),t.x=e,t.y=n,t)}if(Math.abs(this.coslat0)<=Xp){if(o<=Xp)return n=this.lat0,e=this.long0,t.x=e,t.y=n,t;t.x*=this.con,t.y*=this.con,i=o*this.cons/(2*this.a*this.k0),n=this.con*jd(this.e,i),e=this.con*Id(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else r=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=Xp?a=this.X0:(a=Math.asin(Math.cos(r)*this.sinX0+t.y*Math.sin(r)*this.cosX0/o),e=Id(this.long0+Math.atan2(t.x*Math.sin(r),o*this.cosX0*Math.cos(r)-t.y*this.sinX0*Math.sin(r)))),n=-1*jd(this.e,Math.tan(.5*(Yp+a)));return t.x=e,t.y=n,t},names:["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],ssfn_:function(t,e,n){return e*=n,Math.tan(.5*(Yp+t))*Math.pow((1-e)/(1+e),.5*n)}};const h_={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),n=this.a,i=1/this.rf,r=2*i-Math.pow(i,2),a=this.e=Math.sqrt(r);this.R=this.k0*n*Math.sqrt(1-r)/(1-r*Math.pow(e,2)),this.alpha=Math.sqrt(1+r/(1-r)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+a*e)/(1-a*e));this.K=o-this.alpha*s+this.alpha*a/2*l},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),i=-this.alpha*(e+n)+this.K,r=2*(Math.atan(Math.exp(i))-Math.PI/4),a=this.alpha*(t.x-this.lambda0),o=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(a))),s=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(a));return t.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,t.x=this.R*o+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,n=t.y-this.y0,i=e/this.R,r=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(i)),o=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(r))),s=this.lambda0+o/this.alpha,l=0,c=a,u=-1e3,h=0;Math.abs(c-u)>1e-7;){if(++h>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),u=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=s,t.y=c,t},names:["somerc"]};var f_=1e-7;const p_={init:function(){var t,e,n,i,r,a,o,s,l,c,u,h,f,p,d=0,g=0,_=0,m=0,v=0,y=0,x=0;this.no_off=(f=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],p="object"==typeof(h=this).projName?Object.keys(h.projName)[0]:h.projName,"no_uoff"in h||"no_off"in h||-1!==f.indexOf(p)||-1!==f.indexOf($d(p))),this.no_rot="no_rot"in this;var b=!1;"alpha"in this&&(b=!0);var w=!1;if("rectified_grid_angle"in this&&(w=!0),b&&(x=this.alpha),w&&(d=this.rectified_grid_angle),b||w)g=this.longc;else if(_=this.long1,v=this.lat1,m=this.long2,y=this.lat2,Math.abs(v-y)<=f_||(t=Math.abs(v))<=f_||Math.abs(t-Yp)<=f_||Math.abs(Math.abs(this.lat0)-Yp)<=f_||Math.abs(Math.abs(y)-Yp)<=f_)throw new Error;var S=1-this.es;e=Math.sqrt(S),Math.abs(this.lat0)>Xp?(s=Math.sin(this.lat0),n=Math.cos(this.lat0),t=1-this.es*s*s,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/S),this.A=this.B*this.k0*e/t,(r=(i=this.B*e/(n*Math.sqrt(t)))*i-1)<=0?r=0:(r=Math.sqrt(r),this.lat0<0&&(r=-r)),this.E=r+=i,this.E*=Math.pow(Rd(this.e,this.lat0,s),this.B)):(this.B=1/e,this.A=this.k0,this.E=i=r=1),b||w?(b?(u=Math.asin(Math.sin(x)/i),w||(d=x)):(u=d,x=Math.asin(i*Math.sin(u))),this.lam0=g-Math.asin(.5*(r-1/r)*Math.tan(u))/this.B):(a=Math.pow(Rd(this.e,v,Math.sin(v)),this.B),o=Math.pow(Rd(this.e,y,Math.sin(y)),this.B),r=this.E/a,l=(o-a)/(o+a),c=((c=this.E*this.E)-o*a)/(c+o*a),(t=_-m)<-Math.pi?m-=td:t>Math.pi&&(m+=td),this.lam0=Id(.5*(_+m)-Math.atan(c*Math.tan(.5*this.B*(_-m))/l)/this.B),u=Math.atan(2*Math.sin(this.B*Id(_-this.lam0))/(r-1/r)),d=x=Math.asin(i*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(d),this.cosrot=Math.cos(d),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(x))),this.lat0<0&&(this.u_0=-this.u_0)),r=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(Qp-r)),this.v_pole_s=this.ArB*Math.log(Math.tan(Qp+r))},forward:function(t){var e,n,i,r,a,o,s,l,c={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-Yp)>Xp){if(e=.5*((a=this.E/Math.pow(Rd(this.e,t.y,Math.sin(t.y)),this.B))-(o=1/a)),n=.5*(a+o),r=Math.sin(this.B*t.x),i=(e*this.singam-r*this.cosgam)/n,Math.abs(Math.abs(i)-1)<Xp)throw new Error;l=.5*this.ArB*Math.log((1-i)/(1+i)),o=Math.cos(this.B*t.x),s=Math.abs(o)<f_?this.A*t.x:this.ArB*Math.atan2(e*this.cosgam+r*this.singam,o)}else l=t.y>0?this.v_pole_n:this.v_pole_s,s=this.ArB*t.y;return this.no_rot?(c.x=s,c.y=l):(s-=this.u_0,c.x=l*this.cosrot+s*this.sinrot,c.y=s*this.cosrot-l*this.sinrot),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function(t){var e,n,i,r,a,o,s,l={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(n=t.y,e=t.x):(n=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),r=.5*((i=Math.exp(-this.BrA*n))-1/i),a=.5*(i+1/i),s=((o=Math.sin(this.BrA*e))*this.cosgam+r*this.singam)/a,Math.abs(Math.abs(s)-1)<Xp)l.x=0,l.y=s<0?-Yp:Yp;else{if(l.y=this.E/Math.sqrt((1+s)/(1-s)),l.y=jd(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(r*this.cosgam-o*this.singam,Math.cos(this.BrA*e))}return l.x+=this.lam0,l},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]};const d_={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<Xp)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),n=Math.cos(this.lat1),i=Dd(this.e,e,n),r=Rd(this.e,this.lat1,e),a=Math.sin(this.lat2),o=Math.cos(this.lat2),s=Dd(this.e,a,o),l=Rd(this.e,this.lat2,a),c=Math.abs(Math.abs(this.lat0)-Yp)<Xp?0:Rd(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>Xp?this.ns=Math.log(i/s)/Math.log(r/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=i/(this.ns*Math.pow(r,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,n=t.y;Math.abs(2*Math.abs(n)-Math.PI)<=Xp&&(n=zd(n)*(Yp-2e-10));var i,r,a=Math.abs(Math.abs(n)-Yp);if(a>Xp)i=Rd(this.e,n,Math.sin(n)),r=this.a*this.f0*Math.pow(i,this.ns);else{if((a=n*this.ns)<=0)return null;r=0}var o=this.ns*Id(e-this.long0);return t.x=this.k0*(r*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-r*Math.cos(o))+this.y0,t},inverse:function(t){var e,n,i,r,a,o=(t.x-this.x0)/this.k0,s=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+s*s),n=1):(e=-Math.sqrt(o*o+s*s),n=-1);var l=0;if(0!==e&&(l=Math.atan2(n*o,n*s)),0!==e||this.ns>0){if(n=1/this.ns,i=Math.pow(e/(this.a*this.f0),n),-9999===(r=jd(this.e,i)))return null}else r=-Yp;return a=Id(l/this.ns+this.long0),t.x=a,t.y=r,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};const g_={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,n,i,r,a,o,s,l=t.x,c=t.y,u=Id(l-this.long0);return e=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/e)-this.s45),i=-u*this.alfa,r=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),a=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(r)),o=this.n*a,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n),t.y=s*Math.cos(o)/1,t.x=s*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,n,i,r,a,o,s,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),a=Math.sqrt(t.x*t.x+t.y*t.y),r=Math.atan2(t.y,t.x)/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),n=Math.asin(Math.cos(i)*Math.sin(r)/Math.cos(e)),t.x=this.long0-n/this.alfa,o=e,s=0;var c=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-t.y)<1e-10&&(s=1),o=t.y,c+=1}while(0===s&&c<15);return c>=15?null:t},names:["Krovak","krovak"]};function __(t,e,n,i,r){return t*r-e*Math.sin(2*r)+n*Math.sin(4*r)-i*Math.sin(6*r)}function m_(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function v_(t){return.375*t*(1+.25*t*(1+.46875*t))}function y_(t){return.05859375*t*t*(1+.75*t)}function x_(t){return t*t*t*(35/3072)}function b_(t,e,n){var i=e*n;return t/Math.sqrt(1-i*i)}function w_(t){return Math.abs(t)<Yp?t:t-zd(t)*Math.PI}function S_(t,e,n,i,r){var a,o;a=t/e;for(var s=0;s<15;s++)if(a+=o=(t-(e*a-n*Math.sin(2*a)+i*Math.sin(4*a)-r*Math.sin(6*a)))/(e-2*n*Math.cos(2*a)+4*i*Math.cos(4*a)-6*r*Math.cos(6*a)),Math.abs(o)<=1e-10)return a;return NaN}const M_={init:function(){this.sphere||(this.e0=m_(this.es),this.e1=v_(this.es),this.e2=y_(this.es),this.e3=x_(this.es),this.ml0=this.a*__(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var e,n,i=t.x,r=t.y;if(i=Id(i-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(r)*Math.sin(i)),n=this.a*(Math.atan2(Math.tan(r),Math.cos(i))-this.lat0);else{var a=Math.sin(r),o=Math.cos(r),s=b_(this.a,this.e,a),l=Math.tan(r)*Math.tan(r),c=i*Math.cos(r),u=c*c,h=this.es*o*o/(1-this.es);e=s*c*(1-u*l*(1/6-(8-l+8*h)*u/120)),n=this.a*__(this.e0,this.e1,this.e2,this.e3,r)-this.ml0+s*a/o*u*(.5+(5-l+6*h)*u/24)}return t.x=e+this.x0,t.y=n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,n,i=t.x/this.a,r=t.y/this.a;if(this.sphere){var a=r+this.lat0;e=Math.asin(Math.sin(a)*Math.cos(i)),n=Math.atan2(Math.tan(i),Math.cos(a))}else{var o=S_(this.ml0/this.a+r,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-Yp)<=Xp)return t.x=this.long0,t.y=Yp,r<0&&(t.y*=-1),t;var s=b_(this.a,this.e,Math.sin(o)),l=s*s*s/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(o),2),u=i*this.a/s,h=u*u;e=o-s*Math.tan(o)/l*u*u*(.5-(1+3*c)*u*u/24),n=u*(1-h*(c/3+(1+3*c)*c*h/15))/Math.cos(o)}return t.x=Id(n+this.long0),t.y=w_(e),t},names:["Cassini","Cassini_Soldner","cass"]};function E_(t,e){var n;return t>1e-7?(1-t*t)*(e/(1-(n=t*e)*n)-.5/t*Math.log((1-n)/(1+n))):2*e}var C_=.3333333333333333,A_=.17222222222222222,k_=.10257936507936508,T_=.06388888888888888,P_=.0664021164021164,N_=.016415012942191543;const L_={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-Yp)<Xp?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<Xp?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=E_(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,n=[];return n[0]=t*C_,e=t*t,n[0]+=e*A_,n[1]=e*T_,e*=t,n[0]+=e*k_,n[1]+=e*P_,n[2]=e*N_,n}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=E_(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,n,i,r,a,o,s,l,c,u,h=t.x,f=t.y;if(h=Id(h-this.long0),this.sphere){if(a=Math.sin(f),u=Math.cos(f),i=Math.cos(h),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((n=this.mode===this.EQUIT?1+u*i:1+this.sinph0*a+this.cosph0*u*i)<=Xp)return null;e=(n=Math.sqrt(2/n))*u*Math.sin(h),n*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*u*i}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(f+this.lat0)<Xp)return null;n=Qp-.5*f,e=(n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)))*Math.sin(h),n*=i}}else{switch(s=0,l=0,c=0,i=Math.cos(h),r=Math.sin(h),a=Math.sin(f),o=E_(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(s=o/this.qp,l=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:c=1+this.sinb1*s+this.cosb1*l*i;break;case this.EQUIT:c=1+l*i;break;case this.N_POLE:c=Yp+f,o=this.qp-o;break;case this.S_POLE:c=f-Yp,o=this.qp+o}if(Math.abs(c)<Xp)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:c=Math.sqrt(2/c),n=this.mode===this.OBLIQ?this.ymf*c*(this.cosb1*s-this.sinb1*l*i):(c=Math.sqrt(2/(1+l*i)))*s*this.ymf,e=this.xmf*c*l*r;break;case this.N_POLE:case this.S_POLE:o>=0?(e=(c=Math.sqrt(o))*r,n=i*(this.mode===this.S_POLE?c:-c)):e=n=0}}return t.x=this.a*e+this.x0,t.y=this.a*n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,n,i,r,a,o,s,l=t.x/this.a,c=t.y/this.a;if(this.sphere){var u,h=0,f=0;if((n=.5*(u=Math.sqrt(l*l+c*c)))>1)return null;switch(n=2*Math.asin(n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(f=Math.sin(n),h=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(u)<=Xp?0:Math.asin(c*f/u),l*=f,c=h*u;break;case this.OBLIQ:n=Math.abs(u)<=Xp?this.lat0:Math.asin(h*this.sinph0+c*f*this.cosph0/u),l*=f*this.cosph0,c=(h-Math.sin(n)*this.sinph0)*u;break;case this.N_POLE:c=-c,n=Yp-n;break;case this.S_POLE:n-=Yp}e=0!==c||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(l,c):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(l/=this.dd,c*=this.dd,(o=Math.sqrt(l*l+c*c))<Xp)return t.x=this.long0,t.y=this.lat0,t;r=2*Math.asin(.5*o/this.rq),i=Math.cos(r),l*=r=Math.sin(r),this.mode===this.OBLIQ?(s=i*this.sinb1+c*r*this.cosb1/o,a=this.qp*s,c=o*this.cosb1*i-c*this.sinb1*r):(s=c*r/o,a=this.qp*s,c=o*i)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(c=-c),!(a=l*l+c*c))return t.x=this.long0,t.y=this.lat0,t;s=1-a/this.qp,this.mode===this.S_POLE&&(s=-s)}e=Math.atan2(l,c),n=function(t,e){var n=t+t;return t+e[0]*Math.sin(n)+e[1]*Math.sin(n+n)+e[2]*Math.sin(n+n+n)}(Math.asin(s),this.apa)}return t.x=Id(this.long0+e),t.y=n,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function F_(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}const O_={init:function(){Math.abs(this.lat1+this.lat2)<Xp||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Dd(this.e3,this.sin_po,this.cos_po),this.qs1=E_(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Dd(this.e3,this.sin_po,this.cos_po),this.qs2=E_(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=E_(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>Xp?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,n=t.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var i=E_(this.e3,this.sin_phi),r=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,a=this.ns0*Id(e-this.long0),o=r*Math.sin(a)+this.x0,s=this.rh-r*Math.cos(a)+this.y0;return t.x=o,t.y=s,t},inverse:function(t){var e,n,i,r,a,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1),r=0,0!==e&&(r=Math.atan2(i*t.x,i*t.y)),i=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-i*i)/(2*this.ns0)):(n=(this.c-i*i)/this.ns0,o=this.phi1z(this.e3,n)),a=Id(r/this.ns0+this.long0),t.x=a,t.y=o,t},names:["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"],phi1z:function(t,e){var n,i,r,a,o=F_(.5*e);if(t<Xp)return o;for(var s=t*t,l=1;l<=25;l++)if(o+=a=.5*(r=1-(i=t*(n=Math.sin(o)))*i)*r/Math.cos(o)*(e/(1-s)-n/r+.5/t*Math.log((1-i)/(1+i))),Math.abs(a)<=1e-7)return o;return null}};const G_={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var e,n,i,r,a,o,s,l=t.x,c=t.y;return i=Id(l-this.long0),e=Math.sin(c),n=Math.cos(c),r=Math.cos(i),(a=this.sin_p14*e+this.cos_p14*n*r)>0||Math.abs(a)<=Xp?(o=this.x0+1*this.a*n*Math.sin(i)/a,s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*r)/a):(o=this.x0+this.infinity_dist*n*Math.sin(i),s=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*n*r)),t.x=o,t.y=s,t},inverse:function(t){var e,n,i,r,a,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(r=Math.atan2(e,this.rc),n=Math.sin(r),o=F_((i=Math.cos(r))*this.sin_p14+t.y*n*this.cos_p14/e),a=Math.atan2(t.x*n,e*this.cos_p14*i-t.y*this.sin_p14*n),a=Id(this.long0+a)):(o=this.phic0,a=0),t.x=a,t.y=o,t},names:["gnom"]};const D_={init:function(){this.sphere||(this.k0=Dd(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,n,i=t.x,r=t.y,a=Id(i-this.long0);if(this.sphere)e=this.x0+this.a*a*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(r)/Math.cos(this.lat_ts);else{var o=E_(this.e,Math.sin(r));e=this.x0+this.a*this.k0*a,n=this.y0+this.a*o*.5/this.k0}return t.x=e,t.y=n,t},inverse:function(t){var e,n;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=Id(this.long0+t.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(n=function(t,e){var n=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-n)<1e-6)return e<0?-1*Yp:Yp;for(var i,r,a,o,s=Math.asin(.5*e),l=0;l<30;l++)if(r=Math.sin(s),a=Math.cos(s),o=t*r,s+=i=Math.pow(1-o*o,2)/(2*a)*(e/(1-t*t)-r/(1-o*o)+.5/t*Math.log((1-o)/(1+o))),Math.abs(i)<=1e-10)return s;return NaN}(this.e,2*t.y*this.k0/this.a),e=Id(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=n,t},names:["cea"]};const z_={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,n=t.y,i=Id(e-this.long0),r=w_(n-this.lat0);return t.x=this.x0+this.a*i*this.rc,t.y=this.y0+this.a*r,t},inverse:function(t){var e=t.x,n=t.y;return t.x=Id(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=w_(this.lat0+(n-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"]};const I_={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=m_(this.es),this.e1=v_(this.es),this.e2=y_(this.es),this.e3=x_(this.es),this.ml0=this.a*__(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,n,i,r=t.x,a=t.y,o=Id(r-this.long0);if(i=o*Math.sin(a),this.sphere)Math.abs(a)<=Xp?(e=this.a*o,n=-1*this.a*this.lat0):(e=this.a*Math.sin(i)/Math.tan(a),n=this.a*(w_(a-this.lat0)+(1-Math.cos(i))/Math.tan(a)));else if(Math.abs(a)<=Xp)e=this.a*o,n=-1*this.ml0;else{var s=b_(this.a,this.e,Math.sin(a))/Math.tan(a);e=s*Math.sin(i),n=this.a*__(this.e0,this.e1,this.e2,this.e3,a)-this.ml0+s*(1-Math.cos(i))}return t.x=e+this.x0,t.y=n+this.y0,t},inverse:function(t){var e,n,i,r,a,o,s,l,c;if(i=t.x-this.x0,r=t.y-this.y0,this.sphere)if(Math.abs(r+this.a*this.lat0)<=Xp)e=Id(i/this.a+this.long0),n=0;else{var u;for(o=this.lat0+r/this.a,s=i*i/this.a/this.a+o*o,l=o,a=20;a;--a)if(l+=c=-1*(o*(l*(u=Math.tan(l))+1)-l-.5*(l*l+s)*u)/((l-o)/u-1),Math.abs(c)<=Xp){n=l;break}e=Id(this.long0+Math.asin(i*Math.tan(l)/this.a)/Math.sin(n))}else if(Math.abs(r+this.ml0)<=Xp)n=0,e=Id(this.long0+i/this.a);else{var h,f,p,d,g;for(o=(this.ml0+r)/this.a,s=i*i/this.a/this.a+o*o,l=o,a=20;a;--a)if(g=this.e*Math.sin(l),h=Math.sqrt(1-g*g)*Math.tan(l),f=this.a*__(this.e0,this.e1,this.e2,this.e3,l),p=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=c=(o*(h*(d=f/this.a)+1)-d-.5*h*(d*d+s))/(this.es*Math.sin(2*l)*(d*d+s-2*o*d)/(4*h)+(o-d)*(h*p-2/Math.sin(2*l))-p),Math.abs(c)<=Xp){n=l;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),e=Id(this.long0+Math.asin(i*h/this.a)/Math.sin(n))}return t.x=e,t.y=n,t},names:["Polyconic","American_Polyconic","poly"]};const R_={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,n=t.x,i=t.y-this.lat0,r=n-this.long0,a=i/Jp*1e-5,o=r,s=1,l=0;for(e=1;e<=10;e++)s*=a,l+=this.A[e]*s;var c,u=l,h=o,f=1,p=0,d=0,g=0;for(e=1;e<=6;e++)c=p*u+f*h,f=f*u-p*h,p=c,d=d+this.B_re[e]*f-this.B_im[e]*p,g=g+this.B_im[e]*f+this.B_re[e]*p;return t.x=g*this.a+this.x0,t.y=d*this.a+this.y0,t},inverse:function(t){var e,n,i=t.x,r=t.y,a=i-this.x0,o=(r-this.y0)/this.a,s=a/this.a,l=1,c=0,u=0,h=0;for(e=1;e<=6;e++)n=c*o+l*s,l=l*o-c*s,c=n,u=u+this.C_re[e]*l-this.C_im[e]*c,h=h+this.C_im[e]*l+this.C_re[e]*c;for(var f=0;f<this.iterations;f++){var p,d=u,g=h,_=o,m=s;for(e=2;e<=6;e++)p=g*u+d*h,d=d*u-g*h,g=p,_+=(e-1)*(this.B_re[e]*d-this.B_im[e]*g),m+=(e-1)*(this.B_im[e]*d+this.B_re[e]*g);d=1,g=0;var v=this.B_re[1],y=this.B_im[1];for(e=2;e<=6;e++)p=g*u+d*h,d=d*u-g*h,g=p,v+=e*(this.B_re[e]*d-this.B_im[e]*g),y+=e*(this.B_im[e]*d+this.B_re[e]*g);var x=v*v+y*y;u=(_*v+m*y)/x,h=(m*v-_*y)/x}var b=u,w=h,S=1,M=0;for(e=1;e<=9;e++)S*=b,M+=this.D[e]*S;var E=this.lat0+M*Jp*1e5,C=this.long0+w;return t.x=C,t.y=E,t},names:["New_Zealand_Map_Grid","nzmg"]};const j_={init:function(){},forward:function(t){var e=t.x,n=t.y,i=Id(e-this.long0),r=this.x0+this.a*i,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return t.x=r,t.y=a,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e=Id(this.long0+t.x/this.a),n=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=n,t},names:["Miller_Cylindrical","mill"]};const B_={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Xg(this.es)},forward:function(t){var e,n,i=t.x,r=t.y;if(i=Id(i-this.long0),this.sphere){if(this.m)for(var a=this.n*Math.sin(r),o=20;o;--o){var s=(this.m*r+Math.sin(r)-a)/(this.m+Math.cos(r));if(r-=s,Math.abs(s)<Xp)break}else r=1!==this.n?Math.asin(this.n*Math.sin(r)):r;e=this.a*this.C_x*i*(this.m+Math.cos(r)),n=this.a*this.C_y*r}else{var l=Math.sin(r),c=Math.cos(r);n=this.a*Kg(r,l,c,this.en),e=this.a*i*c/Math.sqrt(1-this.es*l*l)}return t.x=e,t.y=n,t},inverse:function(t){var e,n,i;return t.x-=this.x0,n=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,n/=this.C_x*(this.m+Math.cos(e)),this.m?e=F_((this.m*e+Math.sin(e))/this.n):1!==this.n&&(e=F_(Math.sin(e)/this.n)),n=Id(n+this.long0),e=w_(e)):(e=Zg(t.y/this.a,this.es,this.en),(i=Math.abs(e))<Yp?(i=Math.sin(e),n=Id(this.long0+t.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(e)))):i-Xp<Yp&&(n=this.long0)),t.x=n,t.y=e,t},names:["Sinusoidal","sinu"]};const q_={init:function(){},forward:function(t){for(var e=t.x,n=t.y,i=Id(e-this.long0),r=n,a=Math.PI*Math.sin(n);;){var o=-(r+Math.sin(r)-a)/(1+Math.cos(r));if(r+=o,Math.abs(o)<Xp)break}r/=2,Math.PI/2-Math.abs(n)<Xp&&(i=0);var s=.900316316158*this.a*i*Math.cos(r)+this.x0,l=1.4142135623731*this.a*Math.sin(r)+this.y0;return t.x=s,t.y=l,t},inverse:function(t){var e,n;t.x-=this.x0,t.y-=this.y0,n=t.y/(1.4142135623731*this.a),Math.abs(n)>.999999999999&&(n=.999999999999),e=Math.asin(n);var i=Id(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),n=(2*e+Math.sin(2*e))/Math.PI,Math.abs(n)>1&&(n=1);var r=Math.asin(n);return t.x=i,t.y=r,t},names:["Mollweide","moll"]};const U_={init:function(){Math.abs(this.lat1+this.lat2)<Xp||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=m_(this.es),this.e1=v_(this.es),this.e2=y_(this.es),this.e3=x_(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=Dd(this.e,this.sinphi,this.cosphi),this.ml1=__(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<Xp?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Dd(this.e,this.sinphi,this.cosphi),this.ml2=__(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=__(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,n=t.x,i=t.y;if(this.sphere)e=this.a*(this.g-i);else{var r=__(this.e0,this.e1,this.e2,this.e3,i);e=this.a*(this.g-r)}var a=this.ns*Id(n-this.long0),o=this.x0+e*Math.sin(a),s=this.y0+this.rh-e*Math.cos(a);return t.x=o,t.y=s,t},inverse:function(t){var e,n,i,r;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(n=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(n=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var a=0;return 0!==n&&(a=Math.atan2(e*t.x,e*t.y)),this.sphere?(r=Id(this.long0+a/this.ns),i=w_(this.g-n/this.a),t.x=r,t.y=i,t):(i=S_(this.g-n/this.a,this.e0,this.e1,this.e2,this.e3),r=Id(this.long0+a/this.ns),t.x=r,t.y=i,t)},names:["Equidistant_Conic","eqdc"]};const W_={init:function(){this.R=this.a},forward:function(t){var e,n,i=t.x,r=t.y,a=Id(i-this.long0);Math.abs(r)<=Xp&&(e=this.x0+this.R*a,n=this.y0);var o=F_(2*Math.abs(r/Math.PI));(Math.abs(a)<=Xp||Math.abs(Math.abs(r)-Yp)<=Xp)&&(e=this.x0,n=r>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var s=.5*Math.abs(Math.PI/a-a/Math.PI),l=s*s,c=Math.sin(o),u=Math.cos(o),h=u/(c+u-1),f=h*h,p=h*(2/c-1),d=p*p,g=Math.PI*this.R*(s*(h-d)+Math.sqrt(l*(h-d)*(h-d)-(d+l)*(f-d)))/(d+l);a<0&&(g=-g),e=this.x0+g;var _=l+h;return g=Math.PI*this.R*(p*_-s*Math.sqrt((d+l)*(l+1)-_*_))/(d+l),n=r>=0?this.y0+g:this.y0-g,t.x=e,t.y=n,t},inverse:function(t){var e,n,i,r,a,o,s,l,c,u,h,f;return t.x-=this.x0,t.y-=this.y0,h=Math.PI*this.R,a=(i=t.x/h)*i+(r=t.y/h)*r,h=3*(r*r/(l=-2*(o=-Math.abs(r)*(1+a))+1+2*r*r+a*a)+(2*(s=o-2*r*r+i*i)*s*s/l/l/l-9*o*s/l/l)/27)/(c=(o-s*s/3/l)/l)/(u=2*Math.sqrt(-c/3)),Math.abs(h)>1&&(h=h>=0?1:-1),f=Math.acos(h)/3,n=t.y>=0?(-u*Math.cos(f+Math.PI/3)-s/3/l)*Math.PI:-(-u*Math.cos(f+Math.PI/3)-s/3/l)*Math.PI,e=Math.abs(i)<Xp?this.long0:Id(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(i*i-r*r)+a*a))/2/i),t.x=e,t.y=n,t},names:["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"]};var H_=n(387);const V_={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.g=new H_.Geodesic.Geodesic(this.a,this.es/(1+Math.sqrt(1-this.es)))},forward:function(t){var e,n,i,r,a,o,s,l,c,u,h,f,p,d,g,_=t.x,m=t.y,v=Math.sin(t.y),y=Math.cos(t.y),x=Id(_-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=Xp?(t.x=this.x0+this.a*(Yp-m)*Math.sin(x),t.y=this.y0-this.a*(Yp-m)*Math.cos(x),t):Math.abs(this.sin_p12+1)<=Xp?(t.x=this.x0+this.a*(Yp+m)*Math.sin(x),t.y=this.y0+this.a*(Yp+m)*Math.cos(x),t):(c=this.sin_p12*v+this.cos_p12*y*Math.cos(x),l=(s=Math.acos(c))?s/Math.sin(s):1,t.x=this.x0+this.a*l*y*Math.sin(x),t.y=this.y0+this.a*l*(this.cos_p12*v-this.sin_p12*y*Math.cos(x)),t):(e=m_(this.es),n=v_(this.es),i=y_(this.es),r=x_(this.es),Math.abs(this.sin_p12-1)<=Xp?(a=this.a*__(e,n,i,r,Yp),o=this.a*__(e,n,i,r,m),t.x=this.x0+(a-o)*Math.sin(x),t.y=this.y0-(a-o)*Math.cos(x),t):Math.abs(this.sin_p12+1)<=Xp?(a=this.a*__(e,n,i,r,Yp),o=this.a*__(e,n,i,r,m),t.x=this.x0+(a+o)*Math.sin(x),t.y=this.y0+(a+o)*Math.cos(x),t):Math.abs(_)<Xp&&Math.abs(m-this.lat0)<Xp?(t.x=t.y=0,t):(u=this.lat0/Kp,h=this.long0/Kp,f=m/Kp,p=_/Kp,g=(d=this.g.Inverse(u,h,f,p,this.g.AZIMUTH)).azi1*Kp,t.x=d.s12*Math.sin(g),t.y=d.s12*Math.cos(g),t))},inverse:function(t){var e,n,i,r,a,o,s,l,c,u,h,f,p,d,g,_,m;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*Yp*this.a)return;return n=e/this.a,i=Math.sin(n),r=Math.cos(n),a=this.long0,Math.abs(e)<=Xp?o=this.lat0:(o=F_(r*this.sin_p12+t.y*i*this.cos_p12/e),s=Math.abs(this.lat0)-Yp,a=Math.abs(s)<=Xp?this.lat0>=0?Id(this.long0+Math.atan2(t.x,-t.y)):Id(this.long0-Math.atan2(-t.x,t.y)):Id(this.long0+Math.atan2(t.x*i,e*this.cos_p12*r-t.y*this.sin_p12*i))),t.x=a,t.y=o,t}return l=m_(this.es),c=v_(this.es),u=y_(this.es),h=x_(this.es),Math.abs(this.sin_p12-1)<=Xp?(o=S_(((f=this.a*__(l,c,u,h,Yp))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,l,c,u,h),a=Id(this.long0+Math.atan2(t.x,-1*t.y)),t.x=a,t.y=o,t):Math.abs(this.sin_p12+1)<=Xp?(f=this.a*__(l,c,u,h,Yp),o=S_(((e=Math.sqrt(t.x*t.x+t.y*t.y))-f)/this.a,l,c,u,h),a=Id(this.long0+Math.atan2(t.x,t.y)),t.x=a,t.y=o,t):(p=this.lat0/Kp,d=this.long0/Kp,g=Math.atan2(t.x,t.y)/Kp,_=Math.sqrt(t.x*t.x+t.y*t.y),m=this.g.Direct(p,d,g,_,this.g.STANDARD),t.x=m.lon2*Kp,t.y=m.lat2*Kp,t)},names:["Azimuthal_Equidistant","aeqd"]};const $_={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,n,i,r,a,o,s,l=t.x,c=t.y;return i=Id(l-this.long0),e=Math.sin(c),n=Math.cos(c),r=Math.cos(i),((a=this.sin_p14*e+this.cos_p14*n*r)>0||Math.abs(a)<=Xp)&&(o=1*this.a*n*Math.sin(i),s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*r)),t.x=o,t.y=s,t},inverse:function(t){var e,n,i,r,a,o,s;return t.x-=this.x0,t.y-=this.y0,n=F_((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),i=Math.sin(n),r=Math.cos(n),o=this.long0,Math.abs(e)<=Xp?(s=this.lat0,t.x=o,t.y=s,t):(s=F_(r*this.sin_p14+t.y*i*this.cos_p14/e),a=Math.abs(this.lat0)-Yp,Math.abs(a)<=Xp?(o=this.lat0>=0?Id(this.long0+Math.atan2(t.x,-t.y)):Id(this.long0-Math.atan2(-t.x,t.y)),t.x=o,t.y=s,t):(o=Id(this.long0+Math.atan2(t.x*i,e*this.cos_p14*r-t.y*this.sin_p14*i)),t.x=o,t.y=s,t))},names:["ortho"]};var J_=1,Y_=2,X_=3,K_=4,Z_=5,Q_=6,tm=1,em=2,nm=3,im=4;function rm(t,e,n,i){var r;return t<Xp?(i.value=tm,r=0):(r=Math.atan2(e,n),Math.abs(r)<=Qp?i.value=tm:r>Qp&&r<=Yp+Qp?(i.value=em,r-=Yp):r>Yp+Qp||r<=-(Yp+Qp)?(i.value=nm,r=r>=0?r-ed:r+ed):(i.value=im,r+=Yp)),r}function am(t,e){var n=t+e;return n<-ed?n+=td:n>+ed&&(n-=td),n}const om={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Yp-Qp/2?this.face=Z_:this.lat0<=-(Yp-Qp/2)?this.face=Q_:Math.abs(this.long0)<=Qp?this.face=J_:Math.abs(this.long0)<=Yp+Qp?this.face=this.long0>0?Y_:K_:this.face=X_,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,n,i,r,a,o,s={x:0,y:0},l={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,n=t.x,this.face===Z_)r=Yp-e,n>=Qp&&n<=Yp+Qp?(l.value=tm,i=n-Yp):n>Yp+Qp||n<=-(Yp+Qp)?(l.value=em,i=n>0?n-ed:n+ed):n>-(Yp+Qp)&&n<=-Qp?(l.value=nm,i=n+Yp):(l.value=im,i=n);else if(this.face===Q_)r=Yp+e,n>=Qp&&n<=Yp+Qp?(l.value=tm,i=-n+Yp):n<Qp&&n>=-Qp?(l.value=em,i=-n):n<-Qp&&n>=-(Yp+Qp)?(l.value=nm,i=-n-Yp):(l.value=im,i=n>0?-n+ed:-n-ed);else{var c,u,h,f,p,d;this.face===Y_?n=am(n,+Yp):this.face===X_?n=am(n,+ed):this.face===K_&&(n=am(n,-Yp)),f=Math.sin(e),p=Math.cos(e),d=Math.sin(n),c=p*Math.cos(n),u=p*d,h=f,this.face===J_?i=rm(r=Math.acos(c),h,u,l):this.face===Y_?i=rm(r=Math.acos(u),h,-c,l):this.face===X_?i=rm(r=Math.acos(-c),h,-u,l):this.face===K_?i=rm(r=Math.acos(-u),h,c,l):(r=i=0,l.value=tm)}return o=Math.atan(12/ed*(i+Math.acos(Math.sin(i)*Math.cos(Qp))-Yp)),a=Math.sqrt((1-Math.cos(r))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===em?o+=Yp:l.value===nm?o+=ed:l.value===im&&(o+=1.5*ed),s.x=a*Math.cos(o),s.y=a*Math.sin(o),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,t.x=s.x,t.y=s.y,t},inverse:function(t){var e,n,i,r,a,o,s,l,c,u,h,f,p={lam:0,phi:0},d={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,n=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?d.value=tm:t.y>=0&&t.y>=Math.abs(t.x)?(d.value=em,e-=Yp):t.x<0&&-t.x>=Math.abs(t.y)?(d.value=nm,e=e<0?e+ed:e-ed):(d.value=im,e+=Yp),c=ed/12*Math.tan(e),a=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),o=Math.atan(a),(s=1-(i=Math.cos(e))*i*(r=Math.tan(n))*r*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?s=-1:s>1&&(s=1),this.face===Z_)l=Math.acos(s),p.phi=Yp-l,d.value===tm?p.lam=o+Yp:d.value===em?p.lam=o<0?o+ed:o-ed:d.value===nm?p.lam=o-Yp:p.lam=o;else if(this.face===Q_)l=Math.acos(s),p.phi=l-Yp,d.value===tm?p.lam=-o+Yp:d.value===em?p.lam=-o:d.value===nm?p.lam=-o-Yp:p.lam=o<0?-o-ed:-o+ed;else{var g,_,m;c=(g=s)*g,_=(c+=(m=c>=1?0:Math.sqrt(1-c)*Math.sin(o))*m)>=1?0:Math.sqrt(1-c),d.value===em?(c=_,_=-m,m=c):d.value===nm?(_=-_,m=-m):d.value===im&&(c=_,_=m,m=-c),this.face===Y_?(c=g,g=-_,_=c):this.face===X_?(g=-g,_=-_):this.face===K_&&(c=g,g=_,_=-c),p.phi=Math.acos(-m)-Yp,p.lam=Math.atan2(_,g),this.face===Y_?p.lam=am(p.lam,-Yp):this.face===X_?p.lam=am(p.lam,-ed):this.face===K_&&(p.lam=am(p.lam,+Yp))}return 0!==this.es&&(u=p.phi<0?1:0,h=Math.tan(p.phi),f=this.b/Math.sqrt(h*h+this.one_minus_f_squared),p.phi=Math.atan(Math.sqrt(this.a*this.a-f*f)/(this.one_minus_f*f)),u&&(p.phi=-p.phi)),p.lam+=this.long0,t.x=p.lam,t.y=p.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var sm=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],lm=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],cm=.8487,um=1.3523,hm=Zp/5,fm=1/hm,pm=18,dm=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};const gm={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=Id(t.x-this.long0),n=Math.abs(t.y),i=Math.floor(n*hm);i<0?i=0:i>=pm&&(i=17);var r={x:dm(sm[i],n=Zp*(n-fm*i))*e,y:dm(lm[i],n)};return t.y<0&&(r.y=-r.y),r.x=r.x*this.a*cm+this.x0,r.y=r.y*this.a*um+this.y0,r},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*cm),y:Math.abs(t.y-this.y0)/(this.a*um)};if(e.y>=1)e.x/=sm[18][0],e.y=t.y<0?-Yp:Yp;else{var n=Math.floor(e.y*pm);for(n<0?n=0:n>=pm&&(n=17);;)if(lm[n][0]>e.y)--n;else{if(!(lm[n+1][0]<=e.y))break;++n}var i=lm[n],r=5*(e.y-i[0])/(lm[n+1][0]-i[0]);r=function(t,e,n,i){for(var r=e;i;--i){var a=t(r);if(r-=a,Math.abs(a)<n)break}return r}((function(t){return(dm(i,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(i,t)}),r,Xp,100),e.x/=dm(sm[n],r),e.y=(5*n+r)*Kp,t.y<0&&(e.y=-e.y)}return e.x=Id(e.x+this.long0),e},names:["Robinson","robin"]};const _m={init:function(){this.name="geocent"},forward:function(t){return pg(t,this.es,this.a)},inverse:function(t){return dg(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var mm=0,vm=1,ym=2,xm=3,bm={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};const wm={init:function(){if(Object.keys(bm).forEach(function(t){if(void 0===this[t])this[t]=bm[t].def;else{if(bm[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);bm[t].num&&(this[t]=parseFloat(this[t]))}bm[t].degrees&&(this[t]=this[t]*Kp)}.bind(this)),Math.abs(Math.abs(this.lat0)-Yp)<Xp?this.mode=this.lat0<0?vm:mm:Math.abs(this.lat0)<Xp?this.mode=ym:(this.mode=xm,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var e,n,i,r,a=Math.sin(t.y),o=Math.cos(t.y),s=Math.cos(t.x);switch(this.mode){case xm:n=this.sinph0*a+this.cosph0*o*s;break;case ym:n=o*s;break;case vm:n=-a;break;case mm:n=a}switch(e=(n=this.pn1/(this.p-n))*o*Math.sin(t.x),this.mode){case xm:n*=this.cosph0*a-this.sinph0*o*s;break;case ym:n*=a;break;case mm:n*=-o*s;break;case vm:n*=o*s}return r=1/((i=n*this.cg+e*this.sg)*this.sw*this.h1+this.cw),e=(e*this.cg-n*this.sg)*this.cw*r,n=i*r,t.x=e*this.a,t.y=n*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var e,n,i,r={x:t.x,y:t.y};i=1/(this.pn1-t.y*this.sw),e=this.pn1*t.x*i,n=this.pn1*t.y*this.cw*i,t.x=e*this.cg+n*this.sg,t.y=n*this.cg-e*this.sg;var a=e_(t.x,t.y);if(Math.abs(a)<Xp)r.x=0,r.y=t.y;else{var o,s;switch(s=1-a*a*this.pfact,s=(this.p-Math.sqrt(s))/(this.pn1/a+a/this.pn1),o=Math.sqrt(1-s*s),this.mode){case xm:r.y=Math.asin(o*this.sinph0+t.y*s*this.cosph0/a),t.y=(o-this.sinph0*Math.sin(r.y))*a,t.x*=s*this.cosph0;break;case ym:r.y=Math.asin(t.y*s/a),t.y=o*a,t.x*=s;break;case mm:r.y=Math.asin(o),t.y=-t.y;break;case vm:r.y=-Math.asin(o)}r.x=Math.atan2(t.x,t.y)}return t.x=r.x+this.long0,t.y=r.y,t},names:["Tilted_Perspective","tpers"]};const Sm={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,n,i,r,a=t.x,o=t.y;if(a-=this.long0,"ellipse"===this.shape){o=Math.atan(this.radius_p2*Math.tan(o));var s=this.radius_p/e_(this.radius_p*Math.cos(o),Math.sin(o));if(n=s*Math.cos(a)*Math.cos(o),i=s*Math.sin(a)*Math.cos(o),r=s*Math.sin(o),(this.radius_g-n)*n-i*i-r*r*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(i/e_(r,e)),t.y=this.radius_g_1*Math.atan(r/e)):(t.x=this.radius_g_1*Math.atan(i/e),t.y=this.radius_g_1*Math.atan(r/e_(i,e)))}else"sphere"===this.shape&&(e=Math.cos(o),n=Math.cos(a)*e,i=Math.sin(a)*e,r=Math.sin(o),e=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(i/e_(r,e)),t.y=this.radius_g_1*Math.atan(r/e)):(t.x=this.radius_g_1*Math.atan(i/e),t.y=this.radius_g_1*Math.atan(r/e_(i,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,n,i,r,a=-1,o=0,s=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*e_(1,s)):(o=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*e_(1,o));var l=s/this.radius_p;if(e=o*o+l*l+a*a,(i=(n=2*this.radius_g*a)*n-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;r=(-n-Math.sqrt(i))/(2*e),a=this.radius_g+r*a,o*=r,s*=r,t.x=Math.atan2(o,a),t.y=Math.atan(s*Math.cos(t.x)/a),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+s*s)):(o=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+o*o)),e=o*o+s*s+a*a,(i=(n=2*this.radius_g*a)*n-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;r=(-n-Math.sqrt(i))/(2*e),a=this.radius_g+r*a,o*=r,s*=r,t.x=Math.atan2(o,a),t.y=Math.atan(s*Math.cos(t.x)/a)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var Mm=1.340264,Em=-.081106,Cm=893e-6,Am=.003796,km=Math.sqrt(3)/2;const Tm={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function(t){var e=Id(t.x-this.long0),n=t.y,i=Math.asin(km*Math.sin(n)),r=i*i,a=r*r*r;return t.x=e*Math.cos(i)/(km*(Mm+3*Em*r+a*(7*Cm+9*Am*r))),t.y=i*(Mm+Em*r+a*(Cm+Am*r)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var e,n,i,r,a=t.y;for(r=0;r<12&&(a-=i=(a*(Mm+Em*(e=a*a)+(n=e*e*e)*(Cm+Am*e))-t.y)/(Mm+3*Em*e+n*(7*Cm+9*Am*e)),!(Math.abs(i)<1e-9));++r);return n=(e=a*a)*e*e,t.x=km*t.x*(Mm+3*Em*e+n*(7*Cm+9*Am*e))/Math.cos(a),t.y=Math.asin(Math.sin(a)/km),t.x=Id(t.x+this.long0),t},names:["eqearth","Equal Earth","Equal_Earth"]};var Pm=1e-10;function Nm(t){var e,n,i,r=Id(t.x-(this.long0||0)),a=t.y;return e=this.am1+this.m1-Kg(a,n=Math.sin(a),i=Math.cos(a),this.en),n=i*r/(e*Math.sqrt(1-this.es*n*n)),t.x=e*Math.sin(n),t.y=this.am1-e*Math.cos(n),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function Lm(t){var e,n,i,r;if(t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a,n=e_(t.x,t.y=this.am1-t.y),r=Zg(this.am1+this.m1-n,this.es,this.en),(e=Math.abs(r))<Yp)e=Math.sin(r),i=n*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*e*e)/Math.cos(r);else{if(!(Math.abs(e-Yp)<=Pm))throw new Error;i=0}return t.x=Id(i+(this.long0||0)),t.y=w_(r),t}function Fm(t){var e,n,i=Id(t.x-(this.long0||0)),r=t.y;return n=this.cphi1+this.phi1-r,Math.abs(n)>Pm?(t.x=n*Math.sin(e=i*Math.cos(r)/n),t.y=this.cphi1-n*Math.cos(e)):t.x=t.y=0,t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function Om(t){var e,n;t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var i=e_(t.x,t.y=this.cphi1-t.y);if(n=this.cphi1+this.phi1-i,Math.abs(n)>Yp)throw new Error;return e=Math.abs(Math.abs(n)-Yp)<=Pm?0:i*Math.atan2(t.x,t.y)/Math.cos(n),t.x=Id(e+(this.long0||0)),t.y=w_(n),t}const Gm={init:function(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<Pm)throw new Error;this.es?(this.en=Xg(this.es),this.m1=Kg(this.phi1,this.am1=Math.sin(this.phi1),t=Math.cos(this.phi1),this.en),this.am1=t/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=Lm,this.forward=Nm):(Math.abs(this.phi1)+Pm>=Yp?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=Om,this.forward=Fm)},names:["bonne","Bonne (Werner lat_1=90)"]};Ag.defaultDatum="WGS84",Ag.Proj=fg,Ag.WGS84=new Ag.Proj("WGS84"),Ag.Point=Vg,Ag.toPoint=bg,Ag.defs=Ld,Ag.nadgrid=function(t,e,n){return e instanceof ArrayBuffer?function(t,e,n){var i=!0;void 0!==n&&!1===n.includeErrorFields&&(i=!1);var r=new DataView(e),a=function(t){var e=t.getInt32(8,!1);if(11===e)return!1;e=t.getInt32(8,!0),11!==e&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian");return!0}(r),o=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:sg(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(r,a),s=function(t,e,n,i){for(var r=176,a=[],o=0;o<e.nSubgrids;o++){var s=cg(t,r,n),l=ug(t,r,s,n,i),c=Math.round(1+(s.upperLongitude-s.lowerLongitude)/s.longitudeInterval),u=Math.round(1+(s.upperLatitude-s.lowerLatitude)/s.latitudeInterval);a.push({ll:[og(s.lowerLongitude),og(s.lowerLatitude)],del:[og(s.longitudeInterval),og(s.latitudeInterval)],lim:[c,u],count:s.gridNodeCount,cvs:lg(l)});var h=16;!1===i&&(h=8),r+=176+s.gridNodeCount*h}return a}(r,o,a,i),l={header:o,subgrids:s};return ng[t]=l,l}(t,e,n):{ready:ig(t,e)}},Ag.transform=Sg,Ag.mgrs=Gg,Ag.version="__VERSION__",function(t){t.Proj.projections.add(Qg),t.Proj.projections.add(a_),t.Proj.projections.add(o_),t.Proj.projections.add(c_),t.Proj.projections.add(u_),t.Proj.projections.add(h_),t.Proj.projections.add(p_),t.Proj.projections.add(d_),t.Proj.projections.add(g_),t.Proj.projections.add(M_),t.Proj.projections.add(L_),t.Proj.projections.add(O_),t.Proj.projections.add(G_),t.Proj.projections.add(D_),t.Proj.projections.add(z_),t.Proj.projections.add(I_),t.Proj.projections.add(R_),t.Proj.projections.add(j_),t.Proj.projections.add(B_),t.Proj.projections.add(q_),t.Proj.projections.add(U_),t.Proj.projections.add(W_),t.Proj.projections.add(V_),t.Proj.projections.add($_),t.Proj.projections.add(om),t.Proj.projections.add(gm),t.Proj.projections.add(_m),t.Proj.projections.add(wm),t.Proj.projections.add(Sm),t.Proj.projections.add(Tm),t.Proj.projections.add(Gm)}(Ag);const Dm=Ag;var zm=function(t){var e;if(t.svg_){"3035"===t.proj_?Dm.defs("EPSG:3035","+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs"):"54030"===t.proj_&&Dm.defs("EPSG:54030","+proj=robin +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs"),t.Geometries.geoJSONs.worldrg?jm(t):Lf("https://raw.githubusercontent.com/eurostat/eurostat-map/master/src/assets/topojson/WORLD_4326.json").then((function(e){var n=Of(e,e.objects.CNTR_RG_20M_2020_4326).features;t.Geometries.geoJSONs.worldrg=n,jm(t)})).catch((function(t){return console.error("Failed to load WORLD_4326.json",t)}));var n=(null===(e=t.minimap_)||void 0===e?void 0:e.debounce)||2;window.addEventListener("estatmap:zoomed-"+t.svgId_,function(t,e){var n;return function(){for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];clearTimeout(n),n=setTimeout((function(){return t.apply(void 0,r)}),e)}}((function(t){var e=t.detail,n=Bm(e);if(n){var i=n.lat,r=n.lon,a=Im(e);e._minimapProjection.rotate([-r,-i]),e._minimapProjection.scale(a),e._minimapGlobe.selectAll("path").attr("d",e._minimapPath)}}),n))}},Im=function(t){var e=t.position_.z;if(!e||e<=0)return 50;var n=Math.log2(156543/e);return Rm(n+-1)},Rm=function(t){return 5*Math.pow(2,t)},jm=function(t){try{var e,n,i=t.minimap_||{},r=i.countryId,a=i.x||80,o=i.y||80,s=i.z||160,l=i.color||"#3792B6",c=i.size||160,u=t.Geometries.geoJSONs.worldrg;if(t._minimapContainer=t.svg_.append("g").attr("id","em-minimap").attr("transform","translate(".concat(a,",").concat(o,")")),t._minimapContainer.append("circle").attr("r",c/2).attr("cx",0).attr("cy",0).attr("fill","white").attr("stroke",l).attr("stroke-width",3),t._minimapProjection=Wp(Hp).scale(249.5).clipAngle(90.000001).scale(s).translate([0,0]),t._minimapPath=qs().projection(t._minimapProjection),r){var h=u.find((function(t){return t.properties.id===r}));if(!h)return void console.warn("Country ID ".concat(r," not found in geometries"));var f=v(t._minimapPath.bounds(h),2),p=v(f[0],2),d=p[0],g=p[1],_=v(f[1],2),m=[(d+_[0])/2,(g+_[1])/2],y=t._minimapProjection.invert(m);n=y[0],e=y[1]}else{var x=Bm(t);if(!x)return;e=x.lat,n=x.lon}if(t._minimapProjection.rotate([-n,-e]),t._minimapContainer.append("defs").append("clipPath").attr("id","minimap-clip").append("circle").attr("r",c/2).attr("cx",0).attr("cy",0),t._minimapGlobe=t._minimapContainer.append("g").attr("class","em-minimap-globe").attr("clip-path","url(#minimap-clip)"),t._minimapGlobe.selectAll("path.country").data(u).enter().append("path").attr("d",t._minimapPath).attr("fill","#e0e0e0"),r){var b=u.find((function(t){return t.properties.id===r}));t._minimapGlobe.append("path").datum(b).attr("d",t._minimapPath).attr("fill",l).attr("stroke",l).attr("stroke-width",.5)}t._minimapContainer.append("circle").attr("r",c/2).attr("cx",0).attr("cy",0).attr("fill","none").attr("stroke",l).attr("stroke-width",3)}catch(t){console.error("Error drawing minimap:",t)}},Bm=function(t){var e,n,i=[t.position_.x,t.position_.y];if("3035"===t.proj_){var r=v(Dm("EPSG:3035","EPSG:4326",i),2);n=r[0],e=r[1]}else if("54030"===t.proj_){var a=v(Dm("EPSG:54030","EPSG:4326",i),2);n=a[0],e=a[1]}else n=i[0],e=i[1];return{lat:e.toFixed(2),lon:n.toFixed(2)}};var qm=function(t,e){var n=t.transform,i=(e.width_/2-n.x)/n.k,r=(e.height_/2-n.y)/n.k,a=v(e._projection.invert([i,r]),2),o=a[0],s=a[1];e.position_.x=o,e.position_.y=s,window.dispatchEvent(new CustomEvent("estatmap:zoomed-"+e.svgId_,{detail:e})),"function"==typeof e.onZoom_&&e.onZoom_(t,e)},Um=function(t,e,n){var i,r,a=t.transform,o=(n.width_/2-a.x)/a.k,s=(n.height_/2-a.y)/a.k,l=v(n._projection.invert([o,s]),2),c=l[0],u=l[1];if(n.__programmaticZoom){var h=n.__programmaticZoom;n.position_.x=h.x,n.position_.y=h.y,n.position_.z=h.z,delete n.__programmaticZoom}else n.position_.x=c,n.position_.y=u,n.position_.z=n.__baseZ/a.k;Vm(a,n),null!==(i=n.labels_)&&void 0!==i&&i.values&&Hm(a,n),null!==(r=n.labels_)&&void 0!==r&&r.backgrounds&&Wm(a,n),window.dispatchEvent(new CustomEvent("estatmap:zoomed-"+n.svgId_,{detail:n})),"function"==typeof n.onZoom_&&n.onZoom_(t,n)},Wm=function(t,e){var n=e.svg_.select("#em-zoom-group-"+e.svgId_).selectAll(".em-label-background"),i=t.k,r=[];n.each((function(){var t=Ft(this),e=parseFloat(t.attr("data-width"))||parseFloat(t.attr("width")),n=parseFloat(t.attr("data-height"))||parseFloat(t.attr("height")),a=parseFloat(t.attr("data-x"))||parseFloat(t.attr("x")),o=parseFloat(t.attr("data-y"))||parseFloat(t.attr("y"));if(e>0&&n>0&&!isNaN(a)&&!isNaN(o)){t.attr("data-width")||(t.attr("data-width",e),t.attr("data-height",n),t.attr("data-x",a),t.attr("data-y",o));var s=e*(1/i),l=n*(1/i),c=a*(1/i),u=o*(1/i);r.push({element:t,targetWidth:s,targetHeight:l,targetX:c,targetY:u})}})),r.forEach((function(t){var e=t.element,n=t.targetWidth,i=t.targetHeight,r=t.targetX,a=t.targetY;e.attr("width",n).attr("height",i).attr("x",r).attr("y",a)}))},Hm=function(t,e){var n=e.svg_.select("#em-zoom-group-"+e.svgId_).select("#em-labels").selectAll("*"),i=t.k,r=[];n.each((function(){var t=Ft(this),e=window.getComputedStyle(this),n=t.attr("font-size"),a=e.fontSize,o=n||a;if(o&&parseFloat(o)>0){var s=parseFloat(t.attr("data-fs"))||parseFloat(n)||parseFloat(a);t.attr("data-fs")||t.attr("data-fs",s);var l=s/i;r.push({element:this,targetFontSize:l})}})),r.forEach((function(t){var e=t.element,n=t.targetFontSize;e.style.setProperty("font-size","".concat(n,"px"),"important")}))},Vm=function(t,e){var n=e.svg_.select("#em-zoom-group-"+e.svgId_).selectAll("*"),i=t.k,r=[];n.each((function(){var t=Ft(this),e=window.getComputedStyle(this),n=t.attr("stroke-width"),a=e.strokeWidth,o=n||a;if(o&&parseFloat(o)>0){var s=parseFloat(t.attr("data-sw"))||parseFloat(n)||parseFloat(a);t.attr("data-sw")||t.attr("data-sw",s);var l=s/i;r.push({element:this,targetStrokeWidth:l})}})),r.forEach((function(t){var e=t.element,n=t.targetStrokeWidth;e.style.setProperty("stroke-width","".concat(n,"px"),"important")}))};function $m(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}wn({decimal:".",thousands:" ",grouping:[3],currency:["","€"]});var Jm=function(t,e,n){var i={};i._mapType=n,i.updateValuesLabels=wf,i.svgId_="map",i.svg_=void 0,i.width_=Math.min(795,window.innerWidth),i.height_=0,i.containerId_=void 0,i.gridCartogram_=!1,i.gridCartogramShape_="square",i.gridCartogramMargins_={top:80,right:50,bottom:80,left:150},i.gridCartogramCellPadding_=4,i.gridCartogramPositions_=void 0,i.nutsLevel_=3,i.nutsYear_=2024,i.geo_="EUR",i.proj_="3035",i.projectionFunction_=void 0,i.filterGeometriesFunction_=void 0,i.scale_="20M",i.position_={x:void 0,y:void 0,z:void 0},i.zoomExtent_=void 0,i.translateExtent_=void 0,i.lockPanUntilZoom_=!0,i.onZoomEnd_=void 0,i.onZoom_=void 0,i.onRegionMouseOver_=void 0,i.onRegionMouseMove_=void 0,i.onRegionMouseOut_=void 0,i.geometries_=void 0,i.processCentroids_=void 0,i.dorling_=!1,i.animateDorling_=!0,i.dorlingStrength_={x:1,y:1},i.dorlingIterations_=1,i.onDorlingProgress_=void 0,i.dorlingWorker_=!1,i.dorlingWorkerD3URL_=void 0,i.title_="",i.titlePosition_=void 0,i.subtitle_="",i.subtitlePosition_=void 0,i.showScalebar_=!1,i.scalebarPosition_=[],i.scalebarUnits_=" km",i.scalebarTextOffset_=[0,12],i.scalebarMaxWidth_=150,i.scalebarHeight_=90,i.scalebarStrokeWidth_=1,i.scalebarSegmentHeight_=6,i.scalebarTickHeight_=8,i.stamp_=void 0,i.minimap_=void 0,i.showZoomButtons_=!1,i.showInsetsButton_=!1,i.tooltip_={fontSize:"14px",transitionDuration:200,xOffset:0,yOffset:0,textFunction:null,showFlags:!1,omitRegions:["RU","BY","IL","PS"]},i.hoverColor_="red",i.drawCoastalMargin_=!1,i.coastalMarginStdDev_=3,i.drawGraticule_=!1,i.backgroundMap_=!0,i.labels_=void 0,i.annotations_=void 0,i.annotationsAdded=!1,i.patternFill_=void 0,i.showSourceLink_=!0,i.footnote_="Administrative boundaries: ©EuroGeographics ©UN-FAO ©INSTAT ©Turkstat",i.footnoteTooltipText_='<div class="em-footnote-tooltip">The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the European Union concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Kosovo*: This designation is without prejudice to positions on status, and is in line with UNSCR 1244/1999 and the ICJ Opinion on the Kosovo declaration of independence.</div>',i.nuts2jsonBaseURL_=window.location.hostname.includes("ec.europa.eu")?"https://ec.europa.eu/assets/estat/E/E4/gisco/pub/nuts2json/v2":"https://raw.githubusercontent.com/eurostat/Nuts2json/master/pub/v2",i.noDataFillStyle_="#bcbcbc",i.insets_=[],i.insetTemplates_={},i.insetBoxPosition_=void 0,i.insetBoxPadding_=5,i.insetBoxWidth_=210,i.insetZoomExtent_=null,i.insetScale_="03M";var r=function(t){i[t.substring(0,t.length-1)]=function(e){return arguments.length?(i[t]=e,i):i[t]}};for(var a in i)r(a);!function(t){t.seaFillStyle=function(e){return console.warn("seaFillStyle() is now DEPRECATED, please use the .em-sea CSS class"),ia(".em-sea","fill",e),t},t.cntrgFillStyle=function(e){return console.warn("cntrgFillStyle() is now DEPRECATED, please use the .em-cntrg CSS class"),ia(".em-cntrg","fill",e),t},t.nutsrgFillStyle=function(e){return console.warn("nutsrgFillStyle() is now DEPRECATED, please use the .em-nutsrg CSS class"),ia(".em-nutsrg","fill",e),t},t.nutsbnStroke=function(e){return console.warn("nutsbnStroke() is now DEPRECATED, please use the .bn_0, .bn_1, .bn_2, .bn_3 CSS classes"),e[0]&&ia(".bn_0","stroke",e[0]),e[1]&&ia(".bn_1","stroke",e[1]),e[2]&&ia(".bn_2","stroke",e[2]),e[3]&&ia(".bn_3","stroke",e[3]),t},t.nutsbnStrokeWidth=function(e){return console.warn("nutsbnStrokeWidth() is now DEPRECATED, please use the .bn_0, .bn_1, .bn_2, .bn_3 CSS classes"),e[0]&&ia(".bn_0","stroke-width",e[0]),e[1]&&ia(".bn_1","stroke-width",e[1]),e[2]&&ia(".bn_2","stroke-width",e[2]),e[3]&&ia(".bn_3","stroke-width",e[3]),t},t.graticuleStroke=function(e){return console.warn("graticuleStroke() is now DEPRECATED, please use the .em-graticule CSS class"),ia(".em-graticule","stroke",e),t},t.graticuleStrokeWidth=function(e){return console.warn("graticuleStrokeWidth() is now DEPRECATED, please use the .em-graticule CSS class"),ia(".em-graticule","stroke-width",e),t},t.nutsrgSelFillSty=function(e){return console.warn("nutsrgSelFillSty() is now DEPRECATED, please use hoverColor() instead"),t.hoverColor_=e,t},t.titleFontSize=function(e){return console.warn("map.titleFontSize() is now DEPRECATED. please use the .em-title CSS class"),ia(".em-title","font-size",e),t},t.subtitleFontSize=function(e){return console.warn("map.subtitleFontSize() is now DEPRECATED. please use the .em-subtitle CSS class"),ia(".em-subtitle","font-size",e),t},t.subtitleFontWeight=function(e){return console.warn("map.subtitleFontWeight() is now DEPRECATED. please use the .em-subtitle CSS class"),ia(".em-subtitle","font-weight",e),t},t.titleFill=function(e){return console.warn("map.titleFill() is now DEPRECATED. please use the .em-title CSS class"),ia(".em-title","fill",e),t},t.subtitleFill=function(e){return console.warn("map.subtitleFill() is now DEPRECATED. please use the .em-subtitle CSS class"),ia(".em-subtitle","fill",e),t},t.cntbnStroke=function(e){return console.warn("cntbnStroke() is now DEPRECATED, please use the .em-cntbn .em-bn-eu .em-bn-efta .em-bn-cc .em-bn-oth CSS classes"),e.eu&&ia(".em-bn-eu","stroke",e.eu),e.efta&&ia(".em-bn-efta","stroke",e.efta),e.cc&&ia(".em-bn-cc","stroke",e.cc),e.oth&&ia(".em-bn-oth","stroke",e.oth),e.co&&ia(".em-bn-co","stroke",e.co),t},t.cntbnStrokeWidth=function(e){return console.warn("cntbnStrokeWidth() is now DEPRECATED, please use the .em-cntbn .em-worldbn .em-bn-eu .em-bn-efta .em-bn-cc .em-bn-oth CSS classes"),e.eu&&ia(".em-bn-eu","stroke-width",e.eu),e.efta&&ia(".em-bn-efta","stroke-width",e.efta),e.cc&&ia(".em-bn-cc","stroke-width",e.cc),e.oth&&ia(".em-bn-oth","stroke-width",e.oth),e.co&&ia(".em-bn-co","stroke-width",e.co),t},t.worldStroke=function(e){return console.warn("map.worldStroke() is now DEPRECATED. please use the .em-worldbn .em-bn-co .em-bn-d CSS classes"),ia(".em-worldbn","stroke",e),t},t.worldStrokeWidth=function(e){return console.warn("map.worldStrokeWidth() is now DEPRECATED. please use the .em-worldbn .em-bn-co .em-bn-d CSS classes"),ia(".em-worldbn","stroke-width",e),t},t.worldCoastStroke=function(e){return console.warn("map.worldCoastStroke() is now DEPRECATED. please use the .em-bn-co CSS class"),ia(".em-bn-co","stroke",e),t},t.worldCoastStrokeWidth=function(e){return console.warn("map.worldCoastStrokeWidth() is now DEPRECATED. please use the .em-bn-co CSS class"),ia(".em-bn-co","stroke-width",e),t},t.worldFillStyle=function(e){return console.warn("map.worldFillStyle() is now DEPRECATED. please use the .em-worldrg CSS class"),ia(".em-worldrg","fill",e),t},t.coastalMarginWidth=function(e){return console.warn("map.coastalMarginWidth() is now DEPRECATED. please use the #em-coast-margin CSS rule"),ia("#em-coast-margin","stroke-width",e),t},t.coastalMarginColor=function(e){return console.warn("map.coastalMarginColor() is now DEPRECATED. please use the #em-coast-margin CSS rule"),ia("#em-coast-margin","stroke",e),t},t.fontFamily=function(e){return console.warn("map.fontFamily() is now DEPRECATED. please use the .em-map CSS class"),ia(".em-map","font-family",e),t},t.botTxtFontSize=function(e){return console.warn("map.botTxtFontSize() is now DEPRECATED. please use the .em-footnote CSS class"),ia(".em-footnote","font-size",e),t},t.botTxtFill=function(e){return console.warn("map.botTxtFill() is now DEPRECATED. please use the .em-footnote CSS class"),ia(".em-footnote","fill",e),t},t.scalebarFontSize=function(e){return console.warn("map.scalebarFontSize() is now DEPRECATED. please use the .em-scalebar-label CSS class"),ia(".em-scalebar-label","font-size",e),t},t.frameStroke=function(e){return console.warn("map.frameStroke() is now DEPRECATED. please use the .em-frame CSS class"),ia(".em-frame","stroke",e),t},t.frameStrokeWidth=function(e){return console.warn("map.frameStrokeWidth() is now DEPRECATED. please use the .em-frame CSS class"),ia(".em-frame","stroke-width",e),t},t.psClassifMethod=function(e){return console.warn("psClassifMethod() is now DEPRECATED. please use psClassificationMethod instead"),t.psClassificationMethod_=e,t},t.geoCenter=function(e){return console.warn("map.geoCenter() is now deprecated. Please use map.position({x,y,z}) instead."),t.position_.x=e[0],t.position_.y=e[1],t},t.pixelSize=function(e){return console.warn("map.pixelSize() is now deprecated. Please use the z property in map.position({x,y,z}) instead."),t.position_.z=e,t},t.pixSize=function(e){return console.warn("map.pixelSize() is now deprecated. Please use the z property in map.position({x,y,z}) instead."),t.position_.z=e,t},t.tooltipText=function(e){return console.warn("map.tooltipText() is now deprecated. Please use map.tooltip(config.textFunction) instead. See API reference for details."),t.tooltip_.textFunction=e,t},t.classifMethod=function(e){return console.warn("map.classifMethod() is now DEPRECATED. please use map.classificationMethod() instead."),t.classificationMethod_=e,t},t.threshold=function(e){return console.warn("map.threshold() is now DEPRECATED. please use map.thresholds() instead."),t.thresholds_=e,t},t.psThreshold=function(e){return console.warn("map.psThreshold() is now DEPRECATED. please use map.psThresholds() instead."),t.psThresholds_=e,t},t.clnb=function(e){return console.warn("map.clnb() is now DEPRECATED. please use map.numberOfClasses() instead."),t.numberOfClasses_=e,t},t.nutsLvl=function(e){return console.warn("map.nutsLvl() is now DEPRECATED. please use map.nutsLevel() instead."),t.nutsLevel_=e,t},t.lg=function(e){return console.warn("map.lg() is now DEPRECATED. please use map.language() instead."),t.language_=e,t},t.bottomText=function(e){return console.warn("bottomText is now DEPRECATED. Please use the footnote() method and em-footnote CSS class instead."),t.footnote_=e,t},t.botTxtFontSize=function(e){return console.warn("botTxtFontSize is now DEPRECATED. Please use the em-footnote CSS class instead."),t},t.botTxtFill=function(e){return console.warn("botTxtFill is now DEPRECATED. Please use the em-footnote CSS class instead."),t},t.botTxtPadding=function(e){return console.warn("botTxtPadding is now DEPRECATED. Please use the em-footnote CSS class instead."),t},t.botTxtTooltipTxt=function(e){return console.warn("botTxtTooltipTxt is now DEPRECATED. Please use footnoteTooltipText() instead."),t},t.tooltipShowFlags=function(e){return console.warn("tooltipShowFlags is now DEPRECATED. Please use out.tooltip({showFlags}) instead."),t.tooltip_.showFlags=e,t},t.colorFun=function(e){return console.warn("colorFun is now DEPRECATED. Please use out.colorFunction() instead."),t.colorFunction_=e,t},t.filtersDefinitionFun=function(e){return console.warn("filtersDefinitionFun is now DEPRECATED. Please use out.filtersDefinitionFunction() instead."),t.filtersDefinitionFunction_=e,t},t.labelling=function(e){return console.warn("labelling is now DEPRECATED. Please use out.labels({}) configuration object instead. See documentation for details."),t},t.labelsConfig=function(e){return console.warn("labelsConfig is now DEPRECATED. Please use out.labels({config:yourConfig}) configuration object instead. See documentation for details."),t.labels_=Object.assign(t.labels_||{},{config:e}),t},t.statLabelsPositions=function(e){return console.warn("statLabelsPositions is now DEPRECATED. Please use out.labels({statLabelsPositions:yourPositions}) instead. See documentation for details."),t.labels_=Object.assign(t.labels_||{},{statLabelsPositions:e}),t},t.labelsToShow=function(e){return console.warn("labelsToShow is now DEPRECATED. Please use out.labels({labelFilterFunction:yourFunction(region,map)}) function instead. See documentation for details."),t},t.labelShadowsToShow=function(e){return console.warn("labelShadowsToShow is now DEPRECATED. Please use out.labels({labelFilterFunction:yourFunction(region,map)}) function instead. See documentation for details."),t},t.labelShadow=function(e){return console.warn("labelShadow is now DEPRECATED. Please use out.labels({labelShadow:boolean}) instead. See documentation for details."),t},t.labelShadowWidth=function(e){return console.warn("labelShadow is now DEPRECATED. Please use out.labels({labelShadow:boolean}) instead. See documentation for details."),t},t.labelFilterFunction=function(e){return console.warn("labelFilterFunction is now DEPRECATED. Please use out.labels({labelFilterFunction:yourFunction(region,map)}) instead. See documentation for details."),t},t.labelFill=function(e){return console.warn("map.labelFill() is now DEPRECATED. please use the .em-stat-labels CSS class"),t},t.labelStroke=function(e){return console.warn("map.labelStroke() is now DEPRECATED. please use the .em-stat-labels CSS class"),t},t.labelStrokeWidth=function(e){return console.warn("map.labelStrokeWidth() is now DEPRECATED. please use the .em-stat-labels CSS class"),t},t.labelOpacity=function(e){return console.warn("map.labelOpacity() is now DEPRECATED. please use the .em-stat-labels CSS class"),t},t.labelValuesFontSize=function(e){return console.warn("map.labelValuesFontSize() is now DEPRECATED. please use the .em-stat-labels CSS class"),t},t.labelShadowWidth=function(e){return console.warn("map.labelShadowWidth() is now DEPRECATED. please use the .em-stat-labels-shadows CSS class"),t},t.labelShadowColor=function(e){return console.warn("map.labelShadowColor() is now DEPRECATED. please use the .em-stat-labels-shadows CSS class"),t},t.countriesToShow=function(e){return console.warn("map.countriesToShow() is now DEPRECATED. please use the map.filterGeometriesFunction() function if you wish to filter the default geometries."),t},t.bordersToShow=function(e){return console.warn("map.bordersToShow() is now DEPRECATED. please use the map.filterGeometriesFunction() function if you wish to filter the default geometries."),t}}(i),i.geo=function(t){return arguments.length?(i.geo_=t.toUpperCase(),i):i.geo_},["tooltip_","nuts2jsonBaseURL_","processCentroids_"].forEach((function(t){i[t.substring(0,t.length-1)]=function(e){if(!arguments.length)return i[t];if("object"!==ga(e)||null===e||Array.isArray(e))i[t]=e;else for(var n in e)i[t][n]=e[n];return i.insetTemplates_&&ua(i.insetTemplates_,i.svgId_,(function(e,n){e[t.substring(0,t.length-1)](n)}),e),i}})),i.title=function(t){return arguments.length?(i.title_=t,i.svg()&&i.svg().select("#title"+i.geo()).text(t),i):i.title_},i.subtitle=function(t){return arguments.length?(i.subtitle_=t,i.svg()&&i.svg().select("#subtitle"+i.geo()).text(t),i):i.subtitle_},i.insets=function(){return arguments.length?(1==arguments.length&&"default"===arguments[0]?i.insets_="default":1==arguments.length&&!1===arguments[0]?i.insets_=!1:1==arguments.length&&Array.isArray(arguments[0])?i.insets_=arguments[0]:i.insets_=arguments,i):i.insets_},i.drawGraticule=function(t){if(!arguments.length)return i.drawGraticule_;i.drawGraticule_=t;var e=i.svg_?i.svg().select("#em-graticule"):null,n=i.svg_?i.svg_.select("#em-zoom-group-"+i.svgId_):null;return e&&(e._groups[0][0]&&0==t?e.remove():i.Geometries.geoJSONs.graticule&&i._pathFunction&&n&&1==t&&(e.remove(),n.append("g").attr("id","em-graticule").selectAll("path").data(i.Geometries.geoJSONs.graticule).enter().append("path").attr("d",i._pathFunction).attr("class","em-graticule"),i.svg().select("#em-graticule").each((function(){"WORLD"==i.geo_?this.parentNode.insertBefore(this,this.parentNode.childNodes[3]):this.parentNode.insertBefore(this,this.parentNode.childNodes[1])})))),i},i.drawCoastalMargin=function(t){if(!arguments.length)return i.drawCoastalMargin_;if(i.drawCoastalMargin_=t,i.svg_){var e=va("#em-coast-margin"),n=Ft("#em-coastal-blur"),r=Ft("#em-zoom-group-"+i.svgId_)||null;if(e._groups[0][0]&&0==t)e.remove();else if(1==t&&i._pathFunction&&r){e.remove(),n.remove(),i.svg_.append("filter").attr("id","em-coastal-blur").attr("x","-200%").attr("y","-200%").attr("width","400%").attr("height","400%").append("feGaussianBlur").attr("in","SourceGraphic").attr("stdDeviation",i.coastalMarginStdDev_);var a=function(t){var e=Ft("#em-zoom-group-"+t.svgId_).append("g").attr("id","em-coast-margin");t._geom.cntbn&&e.append("g").attr("id","em-coast-margin-cnt").selectAll("path").data(t._geom.cntbn).enter().filter((function(t){return"T"===t.properties.co})).append("path").attr("d",t._pathFunction),t._geom.nutsbn&&e.append("g").attr("id","em-coast-margin-nuts").selectAll("path").data(t._geom.nutsbn).enter().filter((function(t){return"T"===t.properties.co})).append("path").attr("d",t._pathFunction),t._geom.worldbn&&e.append("g").attr("id","em-coast-margin-nuts").selectAll("path").data(t._geom.worldbn).enter().filter((function(t){return"T"===t.properties.COAS_FLAG})).append("path").attr("d",t._pathFunction)};i.insetTemplates_&&i.drawCoastalMargin_&&(ua(i.insetTemplates_,i.svgId_,a),a(i)),va("#em-coast-margin").each((function(){"WORLD"==i.geo_?this.parentNode.insertBefore(this,this.parentNode.childNodes[3]):this.parentNode.insertBefore(this,this.parentNode.childNodes[1])}))}}return i},i.annotations=function(t){return arguments.length?(i.annotations_=t,xf(i),i):i.annotations_},i.stamp=function(t){return arguments.length?(i.stamp_=t,Kf(i.stamp_,i),i):i.stamp_},i.minimap=function(t){return arguments.length?(i.minimap_=t,zm(i),i):i.minimap_},i.labels=function(t){return arguments.length?(i.labels_=t,function(t){if(t.svg_){var e=t.svg_.selectAll("#em-labels > *");if(e&&e.remove(),t.labels_){var n=t.labels_,i=t.svg_.select("#em-zoom-group-"+t.svgId_);bf(t,i),n.values&&t.updateValuesLabels&&t.updateValuesLabels(t),t.insetTemplates_&&ua(t.insetTemplates_,t.svgId_,(function(t){if(n){var e=t.svg_.select("#em-zoom-group-"+t.svgId_);t.labels_&&bf(t,e),n.values&&t.updateValuesLabels&&t.updateValuesLabels(t)}}))}}}(i),i):i.labels_},i.position=function(t){return arguments.length?(i.position_=t,function(t,e){if(t.svg_&&t.__zoomBehavior){var n=t.svg_,i=n.select("#em-zoom-group-"+t.svgId_),r=t.__baseZ/e.z,a=v(t._projection([e.x,e.y]),2),o=a[0],s=a[1],l=t.width_/2-o*r,c=t.height_/2-s*r,u=Hr.translate(l,c).scale(r);t.__programmaticZoom={x:e.x,y:e.y,z:e.z},t.__lastTransform=u,n.call(t.__zoomBehavior.transform,u),i.attr("data-zoom",r),t.position_.x=e.x,t.position_.y=e.y,t.position_.z=e.z}}(i,t),i):i.position_},i.Geometries=$f(i,e),i.updateGeoMapTemplate=function(t){return i.Geometries.defaultGeoData=null,i.Geometries.allNUTSGeoData=null,i.Geometries.centroidsData=null,i.geometries_?(i.Geometries.setUserGeometries(i.geometries_),i.buildMapTemplate(),t&&t()):i.Geometries.getDefaultGeoData(i.geo_,i.filterGeometriesFunction_,i.nutsLevel_).then((function(){i.buildMapTemplate(),t&&t()})),ua(i.insetTemplates_,i.svgId_,(function(e){e.updateGeoMapTemplate(t)})),i};i.buildMapTemplateBase=function(){var t=function(t){var e=Ft("#"+t.svgId());return 0==e.size()&&(e=Ft("body").append("svg").attr("id",t.svgId())),e.attr("class","em-map"),e.classed("em--"+t._mapType,!0),"pie"!==t._mapType&&"coxcomb"!==t._mapType||e.classed("em--ps",!0),e}(i);i.svg_=t,i.containerId_||(i.containerId_=i.svgId_),i.tooltip_.containerId||(i.tooltip_.containerId=i.containerId_),va("#"+i.svgId()+" > *").remove(),"WORLD"==i.geo_.toUpperCase()&&(i.height()||i.height(.55*i.width()),t.attr("width",i.width()).attr("height",i.height()),i.proj_=54030),i.height()||i.height(.85*i.width()),t.attr("width",i.width()).attr("height",i.height()),t.append("defs").attr("class","em-defs").append("clipPath").attr("id",i.svgId_+"-clip-path").append("path").attr("d",function(t,e,n,i){return t=parseFloat(t,10),e=parseFloat(e,10),n=parseFloat(n,10),i=parseFloat(i,10),t<0||e<0||n<0||i<0?"":"M"+t+","+e+"L"+(t+n)+","+e+" "+(t+n)+","+(e+i)+" "+t+","+(e+i)+"z"}(0,0,i.width_,i.height_)),i.drawCoastalMargin_&&t.append("filter").attr("id","em-coastal-blur").attr("x","-200%").attr("y","-200%").attr("width","400%").attr("height","400%").append("feGaussianBlur").attr("in","SourceGraphic").attr("stdDeviation",i.coastalMarginStdDev_);var n=t.insert("g",":first-child").attr("id","em-drawing-"+i.svgId_).attr("class","em-drawing-group").attr("clip-path","url(#"+i.svgId_+"-clip-path)");n.append("g").attr("id","em-zoom-group-"+i.svgId_).attr("class","em-zoom-group");return function(t){if(t.insetTemplates_){for(var e in t.insetTemplates_){var n=Ft("#"+t.insetTemplates_[e].svgId_);n&&n.html("")}t.insetTemplates_={}}}(i),function(t,e){t.insetBoxPosition_||(t.insetBoxPosition_=[t.width_-t.insetBoxWidth_-2*t.insetBoxPadding_,2*t.insetBoxPadding_]);var n=Ft("#"+t.svgId_).select("#em-drawing-"+t.svgId_).append("g").attr("id","em-insets-group").attr("class","em-insets").attr("transform","translate("+t.insetBoxPosition_[0]+","+t.insetBoxPosition_[1]+")");"default"===t.insets_&&(t.insets_=Yf(t.insetBoxWidth_,t.insetBoxPadding_));for(var i=0;i<t.insets_.length;i++){var r=t.insets_[i];if(r.svgId=r.svgId||"inset"+r.geo+Math.random().toString(36).substring(7),0==Ft("#"+r.svgId).size()){var a=null==r.x?t.insetBoxPadding_:r.x,o=null==r.y?t.insetBoxPadding_+i*(t.insetBoxPadding_+t.insetBoxWidth_):r.y;n.append("g").attr("id","em-inset-"+r.svgId).attr("class","em-inset").attr("transform","translate("+a+","+o+")").append("svg").attr("id",r.svgId)}if(t.insetTemplates_[r.geo]){var s=Jf(r,t,e);s.buildMapTemplateBase(),t.insetTemplates_[r.geo]=[t.insetTemplates_[r.geo],s]}else{var l=Jf(r,t,e).buildMapTemplateBase();t.insetTemplates_[r.geo]=l}}}(i,e),n.append("rect").attr("id","em-frame-"+i.geo_).attr("class","em-frame").attr("x",0).attr("y",0).attr("width",i.width_).attr("height",i.height_),i.stamp_&&Kf(i.stamp_,i),i},i.buildMapTemplate=function(){var t,n=i.svg().select("#em-zoom-group-"+i.svgId_);if(n.selectAll("*").remove(),1==i.gridCartogram_?(!function(t){var e=Ft("#em-zoom-group-".concat(t.svgId_)).append("g").attr("id","em-grid-container");t.gridCartogramMargins_=t.gridCartogramMargins_||{top:80,right:80,bottom:80,left:80};var n=fp(t),i=pp(n),r=dp(i,t);"hexagon"===t.gridCartogramShape_?_p(e,r,t):gp(e,r,t),vp(e,t.width_,t.height_,t.gridCartogramMargins_)}(i),i.footnote_=!1):(i.position_.x&&i.position_.y||c(),i.position_.z=i.position_.z||u(),h(),f(),i.zoomExtent()&&function(t){var e=Ft("#"+t.svgId()),n=Hr,i=!t.lockPanUntilZoom_,r=!1,a=t.zoomExtent_||[0,0],o=t.translateExtent_||!t.lockPanUntilZoom_?[[-t.width_,-t.height_],[2*t.width_,2*t.height_]]:[[0,0],[t.width_,t.height_]];if(t.__zoomBehavior=ta().filter((function(t){return!t.target.closest(".em-zoom-buttons")&&!t.target.closest(".em-button")})).extent([[0,0],[t.width_,t.height_]]).scaleExtent(a).translateExtent(o).on("zoom",(function(a){var o=a.transform,s=t.svg_.select("#em-zoom-group-"+t.svgId_);r?r=!1:(t.__lastTransform=o,o.k!==n.k?(t.lockPanUntilZoom_&&(i=!0),Um(a,n,t),s.attr("data-zoom",o.k).attr("transform",o),n=o):!t.lockPanUntilZoom_||i?(qm(a,t),s.attr("transform",o),n=o):(r=!0,e.call(t.__zoomBehavior.transform,n)))})).on("end",(function(e){var n;return null===(n=t.onZoomEnd_)||void 0===n?void 0:n.call(t,e,t)})),t.__lastTransform=n,!t.__baseZ){var s=t.height_/2,l=v(t._projection.invert([0,s]),1)[0],c=v(t._projection.invert([t.width_,s]),1)[0];t.__baseZ=(c-l)/t.width_}e.call(t.__zoomBehavior)}(i),i.backgroundMap_&&l(i)),e&&o(i),i.labels_&&bf(i,n),i.annotations_&&(xf(i),i.annotationsAdded=!0),i.title()){var r=i.isInset?"em-inset-title":"em-title";i.titlePosition()||i.titlePosition([10,ra(r)+(i.isInset?0:10)]),i.svg().append("text").attr("id","title"+i.geo_).attr("class",r).attr("x",i.titlePosition()[0]).attr("y",i.titlePosition()[1]).html(i.title())}if(i.subtitle()){var a=i.isInset?"em-inset-subtitle":"em-subtitle",s=i.isInset?"em-inset-title":"em-title";i.subtitlePosition()||i.subtitlePosition([10,ra(s)+ra(a)+15]),i.svg().append("text").attr("id","subtitle"+i.geo_).attr("class",a).attr("x",i.subtitlePosition()[0]).attr("y",i.subtitlePosition()[1]).html(i.subtitle())}if((i.footnote_&&d(),i.showSourceLink_)&&((t=e?i.stat("size"):i.stat())&&t.eurostatDatasetCode)){var p=t.eurostatDatasetCode,g="https://ec.europa.eu/eurostat/databrowser/view/".concat(p,"/default/table?lang=en"),m=i.svg().append("a").attr("class","em-source-dataset-link").attr("href",g).attr("target","_blank").append("text").attr("class","em-source-dataset-link-text").attr("x",i.width_).attr("y",i.height_).text("EUROSTAT").attr("text-anchor","end").node().getComputedTextLength();i.svg().append("text").attr("class","em-source-pretext").attr("x",i.width_-m-2).attr("y",i.height_).text("Source:").attr("text-anchor","end")}return i.showScalebar_&&(2!==i.scalebarPosition_.length&&(i.scalebarPosition_[0]=15,i.scalebarPosition_[1]=i.height_-50),_()),i.minimap_&&zm(i),i.showZoomButtons_&&function(t){var e=Ft("#"+t.svgId()).append("g").attr("class","em-zoom-buttons").style("pointer-events","all"),n=parseInt(aa("em-button","width"))||30,i=e.append("g").attr("class","em-zoom-in em-button");i.append("rect").attr("width",n).attr("height",n),i.append("text").attr("x",n/2).attr("y",n/2+7).text("+");var r=e.append("g").attr("class","em-zoom-out em-button").attr("transform","translate(0, ".concat(n,")")).style("cursor","pointer");r.append("rect").attr("width",n).attr("height",n),r.append("text").attr("x",n/2).attr("y",n/2+7).text("−"),i.on("click",(function(e){e.preventDefault(),e.stopPropagation(),function(t){t.svg_.transition().call(t.__zoomBehavior.scaleBy,2)}(t)})),r.on("click",(function(e){e.preventDefault(),e.stopPropagation(),function(t){t.svg_.transition().call(t.__zoomBehavior.scaleBy,.5)}(t)}))}(i),i.showInsetsButton_&&function(t){var e=Ft("#"+t.svgId()),n=parseInt(aa("em-button","width"))||30,i=e.append("g").attr("class","em-insets-button em-button");i.append("rect").attr("width",n).attr("height",n);var r=document.createComment("!Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.");i.node().appendChild(r);var a=n/700;i.append("path").attr("d","M266.3 48.3L232.5 73.6c-5.4 4-8.5 10.4-8.5 17.1l0 9.1c0 6.8 5.5 12.3 12.3 12.3c2.4 0 4.8-.7 6.8-2.1l41.8-27.9c2-1.3 4.4-2.1 6.8-2.1l1 0c6.2 0 11.3 5.1 11.3 11.3c0 3-1.2 5.9-3.3 8l-19.9 19.9c-5.8 5.8-12.9 10.2-20.7 12.8l-26.5 8.8c-5.8 1.9-9.6 7.3-9.6 13.4c0 3.7-1.5 7.3-4.1 10l-17.9 17.9c-6.4 6.4-9.9 15-9.9 24l0 4.3c0 16.4 13.6 29.7 29.9 29.7c11 0 21.2-6.2 26.1-16l4-8.1c2.4-4.8 7.4-7.9 12.8-7.9c4.5 0 8.7 2.1 11.4 5.7l16.3 21.7c2.1 2.9 5.5 4.5 9.1 4.5c8.4 0 13.9-8.9 10.1-16.4l-1.1-2.3c-3.5-7 0-15.5 7.5-18l21.2-7.1c7.6-2.5 12.7-9.6 12.7-17.6c0-10.3 8.3-18.6 18.6-18.6l29.4 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-20.7 0c-7.2 0-14.2 2.9-19.3 8l-4.7 4.7c-2.1 2.1-3.3 5-3.3 8c0 6.2 5.1 11.3 11.3 11.3l11.3 0c6 0 11.8 2.4 16 6.6l6.5 6.5c1.8 1.8 2.8 4.3 2.8 6.8s-1 5-2.8 6.8l-7.5 7.5C386 262 384 266.9 384 272s2 10 5.7 13.7L408 304c10.2 10.2 24.1 16 38.6 16l7.3 0c6.5-20.2 10-41.7 10-64c0-111.4-87.6-202.4-197.7-207.7zm172 307.9c-3.7-2.6-8.2-4.1-13-4.1c-6 0-11.8-2.4-16-6.6L396 332c-7.7-7.7-18-12-28.9-12c-9.7 0-19.2-3.5-26.6-9.8L314 287.4c-11.6-9.9-26.4-15.4-41.7-15.4l-20.9 0c-12.6 0-25 3.7-35.5 10.7L188.5 301c-17.8 11.9-28.5 31.9-28.5 53.3l0 3.2c0 17 6.7 33.3 18.7 45.3l16 16c8.5 8.5 20 13.3 32 13.3l21.3 0c13.3 0 24 10.7 24 24c0 2.5 .4 5 1.1 7.3c71.3-5.8 132.5-47.6 165.2-107.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM187.3 100.7c-6.2-6.2-16.4-6.2-22.6 0l-32 32c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l32-32c6.2-6.2 6.2-16.4 0-22.6z").attr("transform","translate(".concat(n/2,", ").concat(n/2,") scale(").concat(a,") translate(").concat(-256,", ").concat(-256,")")).attr("fill","#333").attr("pointer-events","none"),i.on("click",(function(t){t.preventDefault(),t.stopPropagation();var e=Ft("#em-insets-group");"none"===e.style("display")||""===e.style("display")?e.style("display","block"):e.style("display","none")}))}(i),i};var o=function(t){var e;t.Geometries.centroidsData?e="mixed"==t.nutsLevel_?[].concat(y(t.Geometries.centroidsData[0].features),y(t.Geometries.centroidsData[1].features),y(t.Geometries.centroidsData[2].features),y(t.Geometries.centroidsData[3].features)):t.Geometries.centroidsData.features:"WORLD"==t.geo_&&(e=[],t.Geometries.geoJSONs.worldrg.forEach((function(t){var n=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$m(Object(n),!0).forEach((function(e){ma(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$m(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t);"FR"==t.properties.id?n.geometry={coordinates:[2.2,46.2],type:"Point"}:n.geometry={coordinates:yo(t),type:"Point"},e.push(n)}))),t.processCentroids_&&(e=t.processCentroids_(e));var n=e.map((function(e){var n=t._projection(e.geometry.coordinates);return e.properties.centroid=n,e}));t.Geometries._allCentroidsFeatures=y(n),t.Geometries.centroidsFeatures=n.filter((function(e){return s(e.properties.id,t)})),(i.getCentroidsGroup(t).empty()?t.svg().select("#em-zoom-group-"+t.svgId_).append("g").attr("id","em-centroids-".concat(t.svgId_)).attr("class","em-centroids"):i.getCentroidsGroup(t)).selectAll("g.em-centroid").data(t.Geometries.centroidsFeatures,(function(t){return t.properties.id})).join((function(t){return t.append("g").attr("class","em-centroid").attr("id",(function(t){return"ps"+t.properties.id})).attr("transform",(function(t){return"translate(".concat(t.properties.centroid[0].toFixed(3),",").concat(t.properties.centroid[1].toFixed(3),")")}))}),(function(t){return t}),(function(t){return t.remove()}))};i.getCentroidsGroup=function(t){return t.svg().select("#em-centroids-".concat(t.svgId_))},i.refreshCentroids=function(t){var e=t.Geometries._allCentroidsFeatures;if(e)return t.Geometries.centroidsFeatures=e.filter((function(e){return s(e.properties.id,t)})),i.getCentroidsGroup(t).selectAll("g.em-centroid").data(t.Geometries.centroidsFeatures,(function(t){return t.properties.id})).join((function(t){return t.append("g").attr("class","em-centroid").attr("id",(function(t){return"ps"+t.properties.id})).attr("transform",(function(t){return"translate(".concat(t.properties.centroid[0].toFixed(3),",").concat(t.properties.centroid[1].toFixed(3),")")}))}),(function(t){return t}),(function(t){return t.remove()})),t};var s=function(t,e){return!e.statCodes_||e.statCodes_.some((function(n){var i,r=null===(i=e.statData(n))||void 0===i?void 0:i.get(t);return r&&!isNaN(r.value)&&0!==r.value}))},l=function(t){var e=t.svg().select("#em-zoom-group-"+t.svgId_);e.append("rect").attr("id","sea").attr("class","em-sea").attr("x",-5*t.width_).attr("y",-5*t.height_).attr("width",11*t.width_).attr("height",11*t.height_),"WORLD"==t.geo_&&e.append("path").datum({type:"Sphere"}).attr("id","sphere").attr("d",t._pathFunction).attr("class","em-graticule"),t.drawCoastalMargin_&&g(),t.geometries_?t.Geometries.addUserGeometriesToMap(t.geometries_,e,t._pathFunction):t.Geometries.addDefaultGeometriesToMap(e,t.drawGraticule_,t._pathFunction,t.nutsLevel_,t.nutsYear_,t.geo_,t.proj_,t.scale_)},c=function(){var t,e=Ym[i.geo_+"_"+i.proj_];e?(i.position_.x=i.position_.x||e.geoCenter[0],i.position_.y=i.position_.y||e.geoCenter[1]):null!==(t=i.Geometries.defaultGeoData)&&void 0!==t&&t.bbox&&(i.position_.x=i.position_.x||.5*(i.Geometries.defaultGeoData.bbox[0]+i.Geometries.defaultGeoData.bbox[2]),i.position_.y=i.position_.y||.5*(i.Geometries.defaultGeoData.bbox[1]+i.Geometries.defaultGeoData.bbox[3])),p()},u=function(){var t,e=Ym[i.geo_+"_"+i.proj_];return e?800*e.pixelSize/i.width_:null!==(t=i.Geometries.defaultGeoData)&&void 0!==t&&t.bbox?Math.min((i.Geometries.defaultGeoData.bbox[2]-i.Geometries.defaultGeoData.bbox[0])/i.width_,(i.Geometries.defaultGeoData.bbox[3]-i.Geometries.defaultGeoData.bbox[1])/i.height_):100},h=function(){var t;"WORLD"===i.geo_?i._projection=i.projectionFunction_||ec(fc).scale(152.63).translate([i.width_/2,i.height_/2]).scale((i.width_-20)/(2*Math.PI)):i._projection=i.projectionFunction_||function(){var t,e,n,i,r,a,o,s=1,l=0,c=0,u=1,h=1,f=0,p=null,d=1,g=1,_=Po({point:function(t,e){var n=y([t,e]);this.stream.point(n[0],n[1])}}),m=To;function v(){return d=s*u,g=s*h,a=o=null,y}function y(n){var i=n[0]*d,r=n[1]*g;if(f){var a=r*t-i*e;i=i*t+r*e,r=a}return[i+l,r+c]}return y.invert=function(n){var i=n[0]-l,r=n[1]-c;if(f){var a=r*t+i*e;i=i*t-r*e,r=a}return[i/d,r/g]},y.stream=function(t){return a&&o===t?a:a=_(m(o=t))},y.postclip=function(t){return arguments.length?(m=t,p=n=i=r=null,v()):m},y.clipExtent=function(t){return arguments.length?(m=null==t?(p=n=i=r=null,To):ko(p=+t[0][0],n=+t[0][1],i=+t[1][0],r=+t[1][1]),v()):null==p?null:[[p,n],[i,r]]},y.scale=function(t){return arguments.length?(s=+t,v()):s},y.translate=function(t){return arguments.length?(l=+t[0],c=+t[1],v()):[l,c]},y.angle=function(n){return arguments.length?(e=Oa(f=n%360*Aa),t=Na(f),v()):f*Ca},y.reflectX=function(t){return arguments.length?(u=t?-1:1,v()):u<0},y.reflectY=function(t){return arguments.length?(h=t?-1:1,v()):h<0},y.fitExtent=function(t,e){return Ro(y,t,e)},y.fitSize=function(t,e){return jo(y,t,e)},y.fitWidth=function(t,e){return Bo(y,t,e)},y.fitHeight=function(t,e){return qo(y,t,e)},y}().reflectY(!0).fitSize([i.width_,i.height_],{type:"Feature",geometry:{type:"MultiPoint",coordinates:[[(t=function(t){var e=.5*t.position_.z*t.width_,n=.5*t.position_.z*t.height_;return[t.position_.x-e,t.position_.y-n,t.position_.x+e,t.position_.y+n]}(i))[0],t[1]],[t[2],t[3]]]}})},f=function(){i._pathFunction=qs().projection(i._projection)},p=function(){var t=ha("x"),e=ha("y"),n=ha("z");null==t||null==t||isNaN(+t)||(i.position_.x=+t),null==e||null==e||isNaN(+e)||(i.position_.y=+e),null==n||null==n||isNaN(+n)||(i.position_.z=+n)},d=function(){i.svg().append("text").attr("id","em-footnote").attr("class","em-footnote").attr("x",0).attr("y",i.height_).html(i.footnote_).on("mouseover",(function(){i._tooltip.mw___=i._tooltip.style("max-width"),i._tooltip.style("max-width","400px"),i.footnoteTooltipText_&&i._tooltip.mouseover(i.footnoteTooltipText_)})).on("mousemove",(function(t){i.footnoteTooltipText_&&i._tooltip.mousemove(t)})).on("mouseout",(function(t){i.footnoteTooltipText_&&i._tooltip.mouseout(t),i._tooltip.style("max-width",i._tooltip.mw___)}))},g=function(){var t=i.svg().select("#em-zoom-group-"+i.svgId_).append("g").attr("id","em-coast-margin").attr("class","em-coast-margin");i.Geometries.geoJSONs.cntbn&&t.append("g").attr("id","em-coast-margin-cnt").attr("class","em-coast-margin-cnt").selectAll("path").data(i.Geometries.geoJSONs.cntbn).enter().filter((function(t){return"T"===t.properties.co})).append("path").attr("d",i._pathFunction),i.Geometries.geoJSONs.nutsbn&&t.append("g").attr("id","em-coast-margin-nuts").attr("class","em-coast-margin-nuts").selectAll("path").data(i.Geometries.geoJSONs.nutsbn).enter().filter((function(t){return"T"===t.properties.co})).append("path").attr("d",i._pathFunction),i.Geometries.geoJSONs.worldbn&&t.append("g").attr("id","em-coast-margin-world").attr("class","em-coast-margin-world").selectAll("path").data(i.Geometries.geoJSONs.worldbn).enter().filter((function(t){return"T"===t.properties.COAS_FLAG})).append("path").attr("d",i._pathFunction)},_=function(){var t=i.scalebarMaxWidth_,e=i.scalebarTextOffset_[0],n=i.scalebarTextOffset_[1],r=i.position_.z,a=m(t*r),o=a[0]/r,s=a[1],l=i.svg().append("g").attr("class","em-scalebar").attr("transform","translate(".concat(i.scalebarPosition_[0],",").concat(i.scalebarPosition_[1],")")).attr("width",t+20).attr("height",i.scalebarHeight_);l.append("line").attr("class","em-scalebar-line").attr("x1",5).attr("y1",1).attr("x2",5).attr("y2",i.scalebarTickHeight_),l.append("text").attr("class","em-scalebar-label").attr("x",5+e).attr("y",i.scalebarTickHeight_+n).text("0");var c={1:4,2:2,5:5}[s],u=o/c,h=i.scalebarSegmentHeight_/2+1;if(u>=15){for(var f=1;f<c;f++)if(l.append("line").attr("class","em-scalebar-line").attr("x1",5+i.scalebarStrokeWidth_/2+f*u).attr("y1",1).attr("x2",5+i.scalebarStrokeWidth_/2+f*u).attr("y2",i.scalebarTickHeight_),l.append("text").attr("class","em-scalebar-label").attr("x",5+e+f*u).attr("y",i.scalebarTickHeight_+n).text(x(a[0]/c*f)),1==f)l.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",5+i.scalebarStrokeWidth_-1).attr("y1",h).attr("x2",5+i.scalebarStrokeWidth_/2+f*u).attr("y2",h);else{var p=5+i.scalebarStrokeWidth_/2+(f-1)*u;p>0&&l.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",p).attr("y1",h).attr("x2",5+i.scalebarStrokeWidth_/2+f*u).attr("y2",h)}u>=15&&l.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",5+(c-1)*u).attr("y1",h).attr("x2",5+c*u).attr("y2",h)}else l.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",5+i.scalebarStrokeWidth_-1).attr("y1",h).attr("x2",5+i.scalebarStrokeWidth_/2+u*c).attr("y2",h);l.append("line").attr("class","em-scalebar-line").attr("x1",o+5).attr("y1",1).attr("x2",o+5).attr("y2",i.scalebarTickHeight_),l.append("text").attr("class","em-scalebar-label").attr("x",o+5+e).attr("y",i.scalebarTickHeight_+n).text(x(a[0])+i.scalebarUnits_)},m=function(t){var e=Math.pow(10,Math.floor(Math.log(t)/Math.log(10)));return 5*e<=t?[5*e,5]:2*e<=t?[2*e,2]:[e,1]},x=function(t){return t<.01?1e3*t+"mm":t<1?100*t+"cm":t<1e3?1*t+"m":t/1e3};return i},Ym={EUR_3035:{geoCenter:[479e4,342e4],pixelSize:6400},IC_32628:{geoCenter:[443468,3145647],pixelSize:1e3},GP_32620:{geoCenter:[669498,1784552],pixelSize:130},MQ_32620:{geoCenter:[716521,1621322],pixelSize:130},GF_32622:{geoCenter:[266852,444074],pixelSize:500},RE_32740:{geoCenter:[348011,7661627],pixelSize:130},YT_32738:{geoCenter:[516549,8583920],pixelSize:70},MT_3035:{geoCenter:[4719755,1441701],pixelSize:70},PT20_32626:{geoCenter:[397418,4271471],pixelSize:1500},PT30_32628:{geoCenter:[333586,3622706],pixelSize:150},LI_3035:{geoCenter:[4287060,2672e3],pixelSize:40},IS_3035:{geoCenter:[3011804,496e4],pixelSize:700},SJ_SV_3035:{geoCenter:[457e4,6160156],pixelSize:800},SJ_JM_3035:{geoCenter:[3647762,5408300],pixelSize:100},CARIB_32620:{geoCenter:[636345,1669439],pixelSize:500},WORLD_54030:{geoCenter:[14,17],pixelSize:9e3}},Xm=lp("\t"),Km=Xm.parse;Xm.parseRows,Xm.format,Xm.formatBody,Xm.formatRows,Xm.formatRow,Xm.formatValue;function Zm(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function Qm(t){return function(e,n,i){return 2===arguments.length&&"function"==typeof n&&(i=n,n=void 0),function(t,e){return fetch(t,e).then(Zm)}(e,n).then((function(e){return t(e,i)}))}}var tv=Qm(up);Qm(Km);function ev(t,e){var n,i,r,a,o=function(t,e,n){if(0===Object.entries(t).length)return null;var i,r=[];if(n&&!iv(n.name)&&(n=null),"string"==typeof t&&(t=[t]),Array.isArray(t)||nv(t)){if(t.length===e)return n&&-1===t.findIndex((function(t){return null==t}))?n.from(t):t;if(1===t.length){for(i=0;i<e;i++)r.push(t[0]);return r}}for(i=0;i<e;i++){var a=void 0===t[i]?null:t[i];r.push(a)}return r};if(this.length=0,this.id=[],null!=t)switch(this.class=t.class||"bundle",this.class){case"bundle":var s=[],l=0;if(this.error=null,this.length=0,null===t||"object"!=typeof t)return void(this.class=null);if(t.hasOwnProperty("error"))return void(this.error=t.error);if("dataset"===t.class||"collection"===t.class||"dimension"===t.class)return new ev(t);for(i in t)l++,s.push(i);this.__tree__=t,this.length=l,this.id=s;break;case"dataset":t.hasOwnProperty("__tree__")?this.__tree__=n=t.__tree__:this.__tree__=n=t,this.label=n.label||null,this.note=n.note||null,this.link=n.link||null,this.href=n.href||null,this.updated=n.updated||null,this.source=n.source||null,this.extension=n.extension||null;var c,u=0,h=n.size||n.dimension&&n.dimension.size;if(this.size=h,this.value=n.hasOwnProperty("value")&&null!==n.value&&0!==n.value.length?n.value:{},Array.isArray(this.value)||nv(this.value))u=this.value.length;else{var f=1;for(c=h.length;c--;)f*=h[c];u=f}if(this.value=o(this.value,u,e),this.status=n.hasOwnProperty("status")&&null!==n.status?o(n.status,u):null,n.hasOwnProperty("dimension")){var p=n.dimension,d=n.role||!n.version&&p.role||null,g=n.id||p.id,_=h.length,m=function(t){d.hasOwnProperty(t)||(d[t]=null)};if(!Array.isArray(g)||!Array.isArray(h)||g.length!=_)return;if(this.length=_,this.id=g,d&&(m("time"),m("geo"),m("metric"),m("classification")),d&&null===d.classification){var v=[],y=["time","geo","metric"],x=function(t,e){for(var n=e.length;n--;)if(t===e[n])return!0;return!1};for(c=0;c<3;c++){var b=d[y[c]];null!==b&&(v=v.concat(b))}for(d.classification=[],c=0;c<_;c++)x(g[c],v)||d.classification.push(g[c]);0===d.classification.length&&(d.classification=null)}this.role=d,this.n=u;for(var w=0,S=this.length;w<S;w++)if(p[g[w]].category.hasOwnProperty("index")){if(Array.isArray(p[g[w]].category.index)){var M={},E=p[g[w]].category.index;for(r=E.length,a=0;a<r;a++)M[E[a]]=a;p[g[w]].category.index=M}}else{var C=0;for(i in p[g[w]].category.index={},p[g[w]].category.label)p[g[w]].category.index[i]=C++}}else this.length=0;break;case"dimension":if(!t.hasOwnProperty("__tree__"))return new ev({version:"2.0",class:"dataset",dimension:{d:t},id:["d"],size:[function(t){var e=void 0===t.index?t.label:t.index;return Array.isArray(e)?e.length:Object.keys(e).length}(t.category)],value:[null]}).Dimension(0);var A=[],k=(n=t.__tree__).category;if(!n.hasOwnProperty("category"))return;if(!k.hasOwnProperty("label"))for(i in k.label={},k.index)k.label[i]=i;for(i in k.index)A[k.index[i]]=i;this.__tree__=n,this.label=n.label||null,this.note=n.note||null,this.link=n.link||null,this.href=n.href||null,this.id=A,this.length=A.length,this.role=t.role,this.hierarchy=k.hasOwnProperty("child"),this.extension=n.extension||null;break;case"category":var T=t.child;this.id=T,this.length=null===T?0:T.length,this.index=t.index,this.label=t.label,this.note=t.note||null,this.unit=t.unit,this.coordinates=t.coord;break;case"collection":if(this.length=0,this.label=t.label||null,this.note=t.note||null,this.link=t.link||null,this.href=t.href||null,this.updated=t.updated||null,this.source=t.source||null,this.extension=t.extension||null,null!==this.link&&t.link.item){var P=t.link.item;if(this.length=Array.isArray(P)?P.length:0,this.length)for(a=0;a<this.length;a++)this.id[a]=P[a].href}}}function nv(t){return"[object ArrayBuffer]"===Object.prototype.toString.call(t.buffer)}function iv(t){return-1!==["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].indexOf(t)}function rv(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.json()}ev.prototype.Item=function(t){if(null===this||"collection"!==this.class||!this.length)return null;if("number"==typeof t)return t>this.length||t<0?null:this.link.item[t];var e,n=[];if("object"==typeof t){if(!t.class&&!t.follow)return null;t.class&&(e="dataset"===t.class&&"boolean"==typeof t.embedded?!0===t.embedded?function(t,e,i){var r=t.link.item[e];i.class===r.class&&r.id&&r.size&&r.dimension&&n.push(r)}:function(t,e,i){var r=t.link.item[e];i.class!==r.class||r.id&&r.size&&r.dimension||n.push(r)}:function(t,e,i){i.class===t.link.item[e].class&&n.push(t.link.item[e])})}else e=function(t,e){n.push(t.link.item[e])};for(var i=0;i<this.length;i++)e(this,i,t);return n},ev.prototype.Dataset=function(t){if(null===this)return null;if("dataset"===this.class)return void 0!==t?this:[this];var e,n=[],i=0;if("collection"===this.class){var r=this.Item({class:"dataset",embedded:!0});if(void 0===t){for(e=r.length;i<e;i++)n.push(new ev(r[i]));return n}if("number"==typeof t&&t>=0&&t<r.length)return new ev(r[t]);if("string"==typeof t)for(e=r.length;i<e;i++)if(r[i].href===t)return new ev(r[i]);return null}if("bundle"!==this.class)return null;if(void 0===t){for(e=this.id.length;i<e;i++)n.push(this.Dataset(this.id[i]));return n}if("number"==typeof t){var a=this.id[t];return void 0!==a?this.Dataset(a):null}var o=this.__tree__[t];return void 0===o?null:new ev({class:"dataset",__tree__:o})},ev.prototype.Dimension=function(t,e){e="boolean"!=typeof e||e;var n,i=[],r=this.id.length,a=function(t,e){if(null!==t)for(var n in t)for(var i=null!==t[n]?t[n].length:0;i--;)if(t[n][i]===e)return n;return null};if(null===this||"dataset"!==this.class)return null;if(void 0===t){for(n=0;n<r;n++)i.push(this.Dimension(this.id[n]));return i}if("number"==typeof t){var o=this.id[t];return void 0!==o?this.Dimension(o,e):null}var s=this.role;if("object"==typeof t){if(t.hasOwnProperty("role")){for(n=0;n<r;n++){var l=this.id[n];a(s,l)===t.role&&i.push(this.Dimension(l,e))}return void 0===i[0]?null:i}return null}var c=this.__tree__.dimension;if(void 0===c)return null;var u=c[t];return void 0===u?null:e?new ev({class:"dimension",__tree__:u,role:a(s,t)}):function(t,e){var n=[];for(var i in t)n[t[i]]=e[i];return n}(u.category.index,u.category.label)},ev.prototype.Category=function(t){if(null===this||"dimension"!==this.class)return null;if(void 0===t){for(var e=[],n=0,i=this.id.length;n<i;n++)e.push(this.Category(this.id[n]));return e}if("number"==typeof t){var r=this.id[t];return void 0!==r?this.Category(r):null}var a=this.__tree__.category;if(void 0===a)return null;var o=a.index[t];if(void 0===o)return null;var s=a.unit&&a.unit[t]||null,l=a.coordinates&&a.coordinates[t]||null,c=a.child&&a.child[t]||null,u=a.note&&a.note[t]||null;return new ev({class:"category",index:o,label:a.label[t],note:u,child:c,unit:s,coord:l})},ev.prototype.Dice=function(t,e,n){var i,r,a,o,s=function(t,e){return t.hasOwnProperty(e)&&!!t[e]};if(null===this||"dataset"!==this.class||null===this.value)return null;if("object"!=typeof t)return this;"object"!=typeof e?("boolean"==typeof e&&!0===e&&(i=!0),"boolean"==typeof n&&!0===n||(n=!1)):(i=s(e,"clone"),n=s(e,"drop"),r=s(e,"stringify"),a=s(e,"ovalue"),o=s(e,"ostatus"));var l,c=this.value,u=i?new ev(JSON.parse(JSON.stringify(this))):this,h=u.status,f=[],p=[],d=function(t,e){var n,i,r,a=(n=t,i=e,r={},Array.isArray(n[i])?(n[i].forEach((function(t,e){null!==t&&(r[String(e)]=t)})),r):n[i]);delete t[e],t[e]=a};Array.isArray(t)&&(t=function(t){var e={};return t.forEach((function(t){e[t[0]]=t[1]})),e}(t)),null===t&&(t={});var g=Object.keys(t);return g.length>0&&(g.forEach((function(e){var n=t[e];Array.isArray(n)||(t[e]=[n]),0===t[e].length&&delete t[e]})),n&&(t=function(t){var e={};return Object.keys(t).forEach((function(n){e[n]=u.Dimension(n).id.filter((function(e){return-1===t[n].indexOf(e)}))})),e}(t)),u.toTable({type:"arrobj",content:"id",status:!0}).forEach((function(e,n){var i=[];g.forEach((function(n){var r=t[n],a=[];r.forEach((function(t){a.push(e[n]===t)})),i.push(-1!==a.indexOf(!0))})),-1===i.indexOf(!1)&&(f.push(e.value),p.push(e.status))})),g.forEach((function(e){var n=u.Dimension(e).id,i=0,r={};u.size[u.id.indexOf(e)]=t[e].length,n.forEach((function(n){-1!==t[e].indexOf(n)&&(r[n]=i,i++)})),u.__tree__.dimension[e].category.index=r})),u.n=f.length,u.value=u.__tree__.value=nv(c)?function(t,e){return e.from(t)}(f,c.constructor):f,u.status=u.__tree__.status=null!==h?p:null),r?((l=u.__tree__).hasOwnProperty("id")||(l.version="2.0",l.hasOwnProperty("class")||(l.class="dataset"),l.id=l.dimension.id,l.size=l.dimension.size,delete l.dimension.id,delete l.dimension.size,l.dimension.hasOwnProperty("role")&&(l.role=l.dimension.role,delete l.dimension.role)),l.hasOwnProperty("status")&&-1!==["null","{}","[]"].indexOf(JSON.stringify(l.status))&&delete l.status,l.hasOwnProperty("role")&&(delete l.role.classification,["geo","time","metric"].forEach((function(t){null===l.role[t]&&delete l.role[t]}))),a&&d(l,"value"),o&&l.hasOwnProperty("status")&&d(l,"status"),JSON.stringify(l)):u},ev.prototype.Slice=function(t){if(null===this||"dataset"!==this.class||0===Object.entries(this.value).length)return null;if(void 0===t)return this;if(!Array.isArray(t)){var e,n=[];for(e in t)n.push([e,t[e]]);t=n}return this.Dice(t.map((function(t){return[t[0],[t[1]]]})))},ev.prototype.Data=function(t,e){var n,i,r=[],a=function(t){for(var e in t)if(t.hasOwnProperty(e))return e};if(null===this||"dataset"!==this.class||null===this.value)return null;if(void 0===t){for(i=this.value.length,n=0;n<i;n++)r.push(this.Data(n));return r}if("boolean"!=typeof e&&(e=!0),"number"==typeof t){var o=this.value[t];return void 0===o?null:e?{value:o,status:this.status?this.status[t]:null}:o}var s="object",l=this.__tree__,c=l.size||l.dimension&&l.dimension.size,u=c.length;if(Array.isArray(t)){if(!Array.isArray(t[0])){if(this.length!==t.length)return null;var h=1,f=0,p=[],d=[];for(n=0;n<u;n++)if(void 0!==t[n]){if("number"!=typeof t[n]||t[n]>=c[n])return null;f+=(h*=n>0?c[u-n]:1)*t[u-n-1]}else p.push(n),d.push(c[n]);if(p.length>1)return null;if(1===p.length){for(var g=0,_=d[0];g<_;g++){var m=[];for(n=0;n<u;n++)n!==p[0]?m.push(t[n]):m.push(g);r.push(this.Data(m,e))}return r}return e?{value:this.value[f],status:this.status?this.status[f]:null}:this.value[f]}s="array"}var v=function(t,e,n){var i,r=[],o={},s=t.dimension,l=t.id||s.id,c=t.size||s&&s.size;if("array"===n){for(i=e.length;i--;)o[e[i][0]]=e[i][1];e=o}for(var u=0,h=l.length;u<h;u++){var f=l[u],p=e[f];r.push("string"==typeof p?p:1===c[u]?a(s[f].category.index):null)}return r}(l,t,s),y=[],x=l.dimension,b=l.id||x.id;for(n=0,i=v.length;n<i;n++)y.push(x[b[n]].category.index[v[n]]);return this.Data(y,e)},ev.prototype.toTable=function(t,e){if(null===this||"dataset"!==this.class||null===this.value)return null;1==arguments.length&&"function"==typeof t&&(e=t,t=null),"arrobj"!==(t=t||{field:"label",content:"label",vlabel:"Value",slabel:"Status",type:"array",status:!1,unit:!1,by:null,prefix:"",drop:[],meta:!1,comma:!1,bylabel:!1}).type&&"objarr"!==t.type||void 0!==t.field||(t.field="id");var n,i,r,a,o,s,l,c,u,h="id"===t.field,f=function(t){return(h?"value":t)||"Value"},p=function(t){return(h?"status":t)||"Status"},d=this.__tree__,g=!0===t.status;if("function"==typeof e){n=this.toTable(t);var _=[],m="array"!==t.type?0:1;for(o=(R="object"!==t.type?n.slice(m):n.rows.slice(0)).length,i=0;i<o;i++){var v=e.call(this,R[i],i);void 0!==v&&_.push(v)}return"object"===t.type?{cols:n.cols,rows:_}:("array"===t.type&&_.unshift(n[0]),_)}if("arrobj"===t.type||"objarr"===t.type){var y=[],x=d.role&&d.role.metric,b=function(){},w={},S=this,M=S.id,E=t.by&&-1!==M.indexOf(t.by)?t.by:null,C=!0===t.meta,A=void 0!==t.drop&&Array.isArray(t.drop)?t.drop:[],k=!0===t.comma,T=!0===t.bylabel,P=S.value.constructor,N=function(e){var n,i={},r=f(t.vlabel);return"objarr"===t.type&&(n=null===E&&iv(P.name)?function(t){i[t]=t===r?P.from(e,(function(e){return e[t]})):e.map((function(e){return e[t]}))}:function(t){i[t]=e.map((function(e){return e[t]}))},Object.keys(e[0]).forEach(n),e=i),C?(i={},M.forEach((function(t){var e=S.Dimension(t);i[t]={label:e.label,role:e.role,categories:{id:e.id,label:S.Dimension(t,!1)}}})),{meta:{label:S.label,source:S.source,updated:S.updated,id:M,status:g,unit:t.unit,by:E,bylabel:T,drop:null!==E&&A.length>0?A:null,prefix:null!==E?B||"":null,comma:k,dimensions:i},data:e}):e};E&&(t.field="id");var L=(n=this.toTable({field:t.field,vlabel:t.vlabel,slabel:t.slabel,content:t.content,status:g})).shift();if(null===E&&t.unit&&x){if("id"!==t.content)for(var F=x.length;F--;){var O=this.Dimension(x[F]);w[x[F]]={};for(var G=O.length;G--;)w[x[F]][O.Category(G).label]=O.id[G]}b=function(e,n){if(-1!==x.indexOf(e)){var i=d.dimension[e].category;i.unit?D.unit=i.unit["id"!==t.content?w[e][n]:n]:D.unit=null}},t.unit=!0}else t.unit=!1;for(o=n.length,i=0;i<o;i++){var D={};for(r=n[i].length;r--;)D[L[r]]=n[i][r],b(L[r],n[i][r]);y.push(D)}if(k&&y.forEach((function(t){null!==t.value&&(t.value=(""+t.value).replace(".",","))})),null!==E){var z,I={},R=[],j={},B=void 0!==t.prefix?t.prefix:"";A.forEach((function(t,e){(!S.Dimension(t)||S.Dimension(t).length>1)&&(A[e]="")}));var q=M.filter((function(t){return t!==E&&-1===A.indexOf(t)})),U=S.Dimension(E);for(var W in"id"!==t.content?T?z=function(t,e,n){t[e][B+n[E]]=n.value}:(U.Category().forEach((function(t,e){j[t.label]=U.id[e]})),z=function(t,e,n){t[e][B+j[n[E]]]=n.value}):z=function(t,e,n){t[e][B+n[E]]=n.value},y.forEach((function(t){var e=function(t,e){var n=[];return e.forEach((function(e){n.push(t[e])})),n.join("\t")}(t,q);void 0===I[e]&&(I[e]=function(t,e){var n={};return e.forEach((function(e){n[e]=t[e]})),n}(t,q)),z(I,e,t,E)})),I)R.push(I[W]);return g=!1,N(R)}return N(y)}if("object"===t.type){var H="number"==typeof this.value[0]||null===this.value[0]?"number":"string";s=function(t,e){var n=h&&t||e||t;nt.push({id:t,label:n,type:"string"})},l=function(t,e,n){var i=f(t),r=p(e);n&&nt.push({id:"status",label:r,type:"string"}),nt.push({id:"value",label:i,type:H})},c=function(t){dt.push({v:t})},u=function(t){dt.push({v:t}),it.push({c:dt})}}else s=function(t,e){var n=h&&t||e||t;nt.push(n)},l=function(t,e,n){var i=f(t),r=p(e);n&&nt.push(r),nt.push(i),et.push(nt)},c=function(t){dt.push(t)},u=function(t){dt.push(t),et.push(dt)};var V=d.dimension,$=d.id||V.id,J=d.size||V.size,Y=$.length;if(Y!=J.length)return!1;var X=[],K=1,Z=(F=1,[]),Q=[],tt=[],et=[],nt=[],it=[];for(i=0;i<Y;i++){var rt=$[i];s(rt,V[rt].label),K*=J[i],F*=J[i];var at=[];for(r=0;r<J[i];r++)for(var ot in V[$[i]].category.index)if(V[$[i]].category.index[ot]===r){var st="id"!==t.content&&V[$[i]].category.label?V[$[i]].category.label[ot]:ot;at.push(st)}X.push(at),Z.push(F)}for(l(t.vlabel,t.slabel,g),o=X.length,i=0;i<o;i++){for(var lt=[],ct=0,ut=X[i].length;ct<ut;ct++)for(var ht=0;ht<K/Z[i];ht++)lt.push(X[i][ct]);Q.push(lt)}for(o=Q.length,i=0;i<o;i++){var ft=[],pt=0;for(a=0;a<K;a++)ft.push(Q[i][pt]),++pt===Q[i].length&&(pt=0);tt.push(ft)}for(a=0;a<K;a++){var dt=[];o=Q.length;for(var gt=0;gt<o;gt++)c(tt[gt][a]);g&&c(this.status?this.status[a]:null),u(this.value[a])}return"object"===t.type?{cols:nt,rows:it}:et},ev.prototype.node=function(){return this.__tree__},ev.prototype.toString=function(){return this.class};var av=function(t){var e={__data:void 0,_data_:void 0,get:function(t){return t?e._data_?e._data_[t]:void 0:e._data_},getValue:function(t){var n=e.get(t);return n?n.value:void 0},set:function(t,n){e._data_=e._data_||{};var i=e._data_[t];return i?n.value?(i.value=n.value,i.status=n.status):i.value=n:e._data_[t]=n.value?n:{value:n},e},setData:function(t){return e.__data=t,e._data_={},Object.keys(t).forEach((function(n){return e.set(n,t[n])})),e},setManualMultiDate:function(t){for(var n in e._data_=e._data_||{},t){var i=t[n];for(var r in e._data_[n]={},i){var a=i[r];e._data_[n][r]={value:a}}}return e},getArray:function(){if(e._data_)return Object.values(e._data_).map((function(t){return t.value})).filter((function(t){return 0==t||t}))},getUniqueValues:function(){return Object.values(e._data_).map((function(t){return t.value})).filter((function(t,e,n){return n.indexOf(t)===e}))},getMin:function(){if(e._data_)return Object.values(e._data_).map((function(t){return t.value})).filter((function(t){return 0==t||t&&":"!==t})).reduce((function(t,e){return Math.min(t,e)}))},getMax:function(){if(e._data_)return Object.values(e._data_).map((function(t){return t.value})).filter((function(t){return 0==t||t&&":"!==t})).reduce((function(t,e){return Math.max(t,e)}))},isReady:function(){return null!=e._data_},metadata:void 0,unitText_:void 0,retrieveFromRemote:function(t,n,a){return e.eurostatDatasetCode_?i(t,n,a):e.csvURL_&&r(a),e},eurostatDatasetCode_:void 0,filters_:{lastTimePeriod:1},precision_:2,label_:void 0},n=function(t,n){return e.filters_.geo||(e.filters_.geoLevel=t+""=="0"?"country":"nuts"+t),Lf(function(t,e,n,i){n=n||"en",i=i||"json";var r=[];if(r.push("https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/",t,"?","format=",i,"&lang=",n),e)for(var a in e){var o=e[a];if(Array.isArray(o))for(var s=0;s<o.length;s++)r.push("&",a,"=",o[s]);else r.push("&",a,"=",o)}return r.join("")}(e.eurostatDatasetCode_,e.filters_,n))},i=function(t,i,r){e._data_=null,n(t,i).then((function(t){var n;if(t.error)return console.error("Error retrieving Eurostat data: "+(null===(n=t.error[0])||void 0===n?void 0:n.label));var i=function(t,e,n){var i="object"==typeof e?e:null;return"function"!=typeof n&&(n=null),n||"function"!=typeof e||(n=e),"object"==typeof t?new ev(t,n):"version"===t?"1.5.3":fetch?fetch(t,i).then(rv).then((function(t){return new ev(t,n)})):void 0}(t);e.metadata={label:i.label,href:i.href,source:i.source,updated:i.updated,extension:i.extension},e.metadata.time=i.Dimension("time").id[0],e._data_=function(t){for(var e={},n=t.Dimension("geo").id,i=0;i<n.length;i++)e[n[i]]=t.Data(i);return e}(i),r&&r()}))};e.getTime=function(){var t=e.filters_.time;return t||(e._data_?e.metadata.time:void 0)},e.csvURL_=void 0,e.geoCol_="geo",e.valueCol_="value";var r=function(t){e._data_=null,tv(e.csvURL_).then((function(n){e._data_=function(t,e,n){for(var i={},r=0;r<t.length;r++){var a=t[r],o=a[n];i[a[e]]=o?{value:isNaN(+o)?o:+o,status:""}:{value:":",status:""}}return i}(n,e.geoCol_,e.valueCol_),e.metadata={href:e.csvURL_},t&&t()}))};if(["unitText_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),t)for(var a in t)e[a+"_"]=t[a];return e};function ov(t,e){var n=t.map;n.patternFill_&&n.patternFill_.forEach((function(i,r){if(i.legendLabel){var a=r*t.shapeHeight+r*t.shapePadding+15,o=e.append("g").attr("class","em-legend-item em-pattern-legend-item"),s=i.color||"#000";("#fff"===s.toLowerCase()||"white"===s.toLowerCase())&&o.append("rect").attr("x",0).attr("y",a).attr("width",t.shapeWidth).attr("height",t.shapeHeight).attr("fill","#ddd"),o.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",a).attr("width",t.shapeWidth).attr("height",t.shapeHeight).attr("fill","url(#".concat(i.patternId||i.pattern,")")).on("mouseover",(function(){sv(n,i.patternId||i.pattern),n.insetTemplates_&&ua(n.insetTemplates_,n.svgId,sv,i.patternId||i.pattern)})).on("mouseout",(function(){lv(n),n.insetTemplates_&&ua(n.insetTemplates_,n.svgId,lv)})),o.append("text").attr("class","em-legend-label").attr("x",t.shapeWidth+t.labelOffsets.x).attr("y",a+t.shapeHeight/2).attr("dominant-baseline","middle").attr("dy","0.35em").text(i.legendLabel)}}))}function sv(t,e){var n="url(#".concat(e,")"),i=da(t);t.svg_.selectAll(i).selectAll("[ecl]").filter((function(){return!Ft(this).classed("pattern-fill-overlay")})).style("fill","white"),t.svg_.selectAll(".pattern-fill-overlay").style("opacity",0),t.svg_.selectAll(".pattern-fill-overlay").filter((function(){return Ft(this).attr("fill")===n})).style("opacity",1)}function lv(t){t.svg_.selectAll(".pattern-fill-overlay").style("opacity",1);var e=da(t);t.svg_.selectAll(e).selectAll("[ecl]").filter((function(){return!Ft(this).classed("pattern-fill-overlay")})).each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}class cv extends Map{constructor(t,e=pv){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(uv(this,t))}has(t){return super.has(uv(this,t))}set(t,e){return super.set(hv(this,t),e)}delete(t){return super.delete(fv(this,t))}}Set;function uv({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function hv({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}function fv({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t.delete(i)),n}function pv(t){return null!==t&&"object"==typeof t?t.valueOf():t}const dv=Symbol("implicit");function gv(){var t=new cv,e=[],n=[],i=dv;function r(r){let a=t.get(r);if(void 0===a){if(i!==dv)return i;t.set(r,a=e.push(r)-1)}return n[a%n.length]}return r.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new cv;for(const i of n)t.has(i)||t.set(i,e.push(i)-1);return r},r.range=function(t){return arguments.length?(n=Array.from(t),r):n.slice()},r.unknown=function(t){return arguments.length?(i=t,r):i},r.copy=function(){return gv(e,n).unknown(i)},Ht.apply(r,arguments),r}function _v(){var t,e,n=gv().unknown(void 0),i=n.domain,r=n.range,a=0,o=1,s=!1,l=0,c=0,u=.5;function h(){var n=i().length,h=o<a,f=h?o:a,p=h?a:o;t=(p-f)/Math.max(1,n-l+2*c),s&&(t=Math.floor(t)),f+=(p-f-t*(n-l))*u,e=t*(1-l),s&&(f=Math.round(f),e=Math.round(e));var d=zf(n).map((function(e){return f+t*e}));return r(h?d.reverse():d)}return delete n.unknown,n.domain=function(t){return arguments.length?(i(t),h()):i()},n.range=function(t){return arguments.length?([a,o]=t,a=+a,o=+o,h()):[a,o]},n.rangeRound=function(t){return[a,o]=t,a=+a,o=+o,s=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(s=!!t,h()):s},n.padding=function(t){return arguments.length?(l=Math.min(1,c=+t),h()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},n.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},n.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),h()):u},n.copy=function(){return _v(i(),[a,o]).round(s).paddingInner(l).paddingOuter(c).align(u)},Ht.apply(h(),arguments)}function mv(t){return t}var vv=1e-6;function yv(t){return"translate("+t+",0)"}function xv(t){return"translate(0,"+t+")"}function bv(t){return e=>+t(e)}function wv(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function Sv(){return!this.__axis}function Mv(t,e){var n=[],i=null,r=null,a=6,o=6,s=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,c=1===t||4===t?-1:1,u=4===t||2===t?"x":"y",h=1===t||3===t?yv:xv;function f(f){var p=null==i?e.ticks?e.ticks.apply(e,n):e.domain():i,d=null==r?e.tickFormat?e.tickFormat.apply(e,n):mv:r,g=Math.max(a,0)+s,_=e.range(),m=+_[0]+l,v=+_[_.length-1]+l,y=(e.bandwidth?wv:bv)(e.copy(),l),x=f.selection?f.selection():f,b=x.selectAll(".domain").data([null]),w=x.selectAll(".tick").data(p,e).order(),S=w.exit(),M=w.enter().append("g").attr("class","tick"),E=w.select("line"),C=w.select("text");b=b.merge(b.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(M),E=E.merge(M.append("line").attr("stroke","currentColor").attr(u+"2",c*a)),C=C.merge(M.append("text").attr("fill","currentColor").attr(u,c*g).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),f!==x&&(b=b.transition(f),w=w.transition(f),E=E.transition(f),C=C.transition(f),S=S.transition(f).attr("opacity",vv).attr("transform",(function(t){return isFinite(t=y(t))?h(t+l):this.getAttribute("transform")})),M.attr("opacity",vv).attr("transform",(function(t){var e=this.parentNode.__axis;return h((e&&isFinite(e=e(t))?e:y(t))+l)}))),S.remove(),b.attr("d",4===t||2===t?o?"M"+c*o+","+m+"H"+l+"V"+v+"H"+c*o:"M"+l+","+m+"V"+v:o?"M"+m+","+c*o+"V"+l+"H"+v+"V"+c*o:"M"+m+","+l+"H"+v),w.attr("opacity",1).attr("transform",(function(t){return h(y(t)+l)})),E.attr(u+"2",c*a),C.attr(u,c*g).text(d),x.filter(Sv).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),x.each((function(){this.__axis=y}))}return f.scale=function(t){return arguments.length?(e=t,f):e},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),f):n.slice()},f.tickValues=function(t){return arguments.length?(i=null==t?null:Array.from(t),f):i&&i.slice()},f.tickFormat=function(t){return arguments.length?(r=t,f):r},f.tickSize=function(t){return arguments.length?(a=o=+t,f):a},f.tickSizeInner=function(t){return arguments.length?(a=+t,f):a},f.tickSizeOuter=function(t){return arguments.length?(o=+t,f):o},f.tickPadding=function(t){return arguments.length?(s=+t,f):s},f.offset=function(t){return arguments.length?(l=+t,f):l},f}function Ev(t){return Mv(3,t)}function Cv(t){return Mv(4,t)}var Av=function(t,e,n){var i=t.histogram.orientation||"horizontal",r=t.histogram.showCounts,a=t.histogram.showPercentages,o=t.histogram.labelRotation||0,s=t.histogram.margin||{top:0,right:0,bottom:0,left:0},l=t.histogram.height||200,c=t.histogram.width||270,u=t.getNumberOfClasses(t),h=t.getLabelFormatter(t),f=t.getColorClassifier(t),p=new Array(u).fill(0),d=function(t){var e=t.map;return Object.values(e.statData()._data_).map((function(t){return t.value}))}(t),g=function(t){var e=t.map;return e.colors_?e.colors_:Array.from({length:e.numberOfClasses_}).map((function(t,n){return e.classToFillStyle()(n,e.numberOfClasses_)}))}(t),_=qv(t);d.forEach((function(t){var e=f(t);"number"==typeof e&&e>=0&&e<p.length&&p[e]++}));var m=p.reduce((function(t,e){return t+e}),0),v=t.lgg.append("g").attr("class","em-legend-histogram").attr("transform","translate(".concat(e,", ").concat(n,")"));function y(e,n){var i=Ft(this).style("stroke","black").attr("ecl"),r=g.length-1-parseInt(i,10);Wv(map,r),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,Wv,i)}function x(e,n){Ft(this).style("stroke","none");Hv(map),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,Hv)}"vertical"===i?function(e){var n=p.slice().reverse(),i=n.map((function(t){return m>0?t/m*100:0})),o=_.slice().reverse(),u=_v().domain(n.map((function(t,e){return e}))).range([s.top,l-s.bottom]).padding(.1),f=En().domain([0,Gt(n)]).nice().range([s.left,c-s.right]);e.selectAll("rect").data(n).join("rect").attr("class","em-legend-histogram-bar").attr("y",(function(t,e){return u(e)})).attr("x",s.left).attr("height",u.bandwidth()).attr("width",(function(t){return f(t)-s.left})).attr("fill",(function(t,e){return g[g.length-e-1]})).attr("ecl",(function(t,e){return e})).on("mouseover",y).on("mouseout",x),(r||a)&&e.selectAll("text.em-histogram-label").data(n).join("text").attr("class","em-legend-label em-histogram-label").attr("x",(function(t){return f(t)+5})).attr("y",(function(t,e){return u(e)+u.bandwidth()/2})).attr("alignment-baseline","middle").text((function(t,e){return a?"".concat(i[e].toFixed(1),"%"):n[e]}));var d=e.append("g").attr("id","em-legend-histogram-y-axis").attr("transform","translate(".concat(s.left,",0)"));if("thresholds"===t.labelType){for(var v=[],b=0;b<o.length;b++){var w=u(b);void 0!==w&&v.push(w+u.bandwidth())}var S=En().domain([0,l]).range([0,l]);d.call(Cv(S).tickValues(v).tickFormat((function(t,e){return h?h(o[e],e):o[e]})).tickSize(4).tickSizeOuter(0))}else"ranges"===t.labelType&&d.call(Cv(u).tickSizeOuter(0).tickSize(0).tickFormat((function(t,e){return h?h(o[e],e):o[e]})));d.selectAll("text").attr("class","em-legend-label em-tick-label").attr("text-anchor","end")}(v):function(e){var n=p.slice().reverse(),i=n.map((function(t){return m>0?t/m*100:0})),u=g.slice().reverse(),f=_v().domain(n.map((function(t,e){return e}))).range([s.left,c-s.right]).padding(.1),d=En().domain([0,Gt(n)]).nice().range([l-s.bottom,s.top]);e.selectAll("rect").data(n).join("rect").attr("class","em-legend-histogram-bar").attr("x",(function(t,e){return f(e)})).attr("y",(function(t){return d(t)})).attr("width",f.bandwidth()).attr("height",(function(t){return l-s.bottom-d(t)})).attr("fill",(function(t,e){return u[e]})).attr("ecl",(function(t,e){return e})).on("mouseover",y).on("mouseout",x),(r||a)&&e.selectAll("text.em-histogram-label").data(n).join("text").attr("class","em-legend-label em-histogram-label").attr("x",(function(t,e){return f(e)+f.bandwidth()/2})).attr("y",(function(t){return d(t)-5})).attr("text-anchor","middle").text((function(t,e){return a?"".concat(i[e].toFixed(1),"%"):t}));var v=e.append("g").attr("id","em-legend-histogram-x-axis").attr("transform","translate(0, ".concat(l-s.bottom,")"));if("thresholds"===t.labelType){for(var b=[],w=0;w<_.length;w++){var S=_.length-w-1,M=f(S);void 0!==M&&b.push(M+f.bandwidth())}var E=En().domain([0,c]).range([0,c]);v.call(Ev(E).tickValues(b).tickFormat((function(t,e){return h?h(_[e],e):_[e]})).tickSize(4).tickSizeOuter(0)),v.selectAll("text").attr("class","em-legend-label em-tick-label").attr("text-anchor","end").attr("dy","0em").attr("dx","-0.45em").attr("transform","rotate(-".concat(o,")"))}else"ranges"===t.labelType&&(v.call(Ev(f).tickSizeOuter(0).tickSize(0).tickFormat((function(t,e){return h?h(_[e],e):_[e]}))),v.selectAll("text").attr("class","em-legend-label em-tick-label").attr("text-anchor","end").attr("dy","0.35em").attr("dx","-0.35em").attr("transform","rotate(-".concat(o,")")))}(v)};function kv(t,e,n){t.map;t._continuousLegendContainer=t.lgg.append("g").attr("class","em-continuous-legend").attr("id","em-continuous-legend").attr("transform","translate(".concat(e,", ").concat(n,")"));var i="ps"==t.map._mapType?t.colorLegend:t,r="vertical"===i.orientation,a="legend-gradient-"+Math.random().toString(36).substr(2,5),o=t.width||6*t.shapeWidth,s=r?t.shapeWidth:t.shapeHeight;if(function(t,e,n){for(var i,r=t.map,a="function"==typeof(null===(i=r.colorFunction_)||void 0===i?void 0:i.domain),o=20,s=function(t){var e=t.valueTransform_||function(t){return t},n=Tv(t);return n.map(e)}(r),l=v(3===s.length?s:[s[0],null,s[1]],3),c=l[0],u=l[1],h=l[2],f=t._continuousLegendContainer.append("defs").append("linearGradient").attr("id",e).attr("x1","0%").attr("x2",n?"0%":"100%").attr("y1",n?"100%":"0%").attr("y2","0%"),p=0;p<=o;p++){var d=p/o,g=void 0;g=3===s.length?d<.5?c+2*d*(u-c):u+2*(d-.5)*(h-u):c+d*(h-c);var _=r.colorFunction_(a?g:d);f.append("stop").attr("offset","".concat(100*d,"%")).attr("stop-color",_)}}(t,a,r),function(t,e,n,i,r){var a=Pv(e),o=e._continuousLegendContainer.append("rect").attr("class","em-legend-gradient").attr("id","em-legend-gradient").attr("x",0).attr("y",a).attr("width",r?i:n).attr("height",r?n:i).style("fill","url(#".concat(t,")"));!function(t,e,n,i){var r=e.map,a=Tv(r),o=r.valueUntransform_||function(t){return t},s=e._continuousLegendContainer,l=Pv(e),c=function(t){return"ps"==t._mapType?Ov:Lv}(r),u=function(t){return"ps"==t._mapType?Gv:Fv}(r);t.on("mousemove",(function(t){var u,h=v(Br(t,this),2),f=h[0],p=h[1],d=i?p-l:f,g=Math.max(0,Math.min(n,d)),_=g/n,m=i?1-_:_;if(3===a.length){var y=v(a,3),x=y[0],b=y[1],w=y[2];if(m<.5)u=x+(b-x)*(m/.5);else u=b+(w-b)*((m-.5)/.5)}else{var S=v(a,2),M=S[0];u=M+m*(S[1]-M)}u=o(u),s.selectAll(".em-hover-line, .em-hover-tick, .em-hover-label").remove();var E=i?0:g,C=i?g+l:0;s.append("line").attr("class","em-hover-line").attr("x1",E).attr("y1",C).attr("x2",i?E+e.shapeWidth:E).attr("y2",i?C:C+e.shapeHeight).attr("stroke","black").attr("stroke-width",1).attr("pointer-events","none"),s.append("circle").attr("class","em-hover-tick").attr("cx",i?E+e.shapeWidth:E).attr("cy",i?C:C+e.shapeHeight).attr("r",3).attr("fill","black").attr("pointer-events","none");var A=Uv(e);s.append("text").attr("class","em-hover-label").attr("x",i?E+e.shapeWidth+5:E).attr("y",i?C:C+e.shapeHeight+12).attr("text-anchor",i?"start":"middle").attr("alignment-baseline","middle").attr("pointer-events","none").text(A(u)),c(r,u)})),t.on("mouseout",(function(){s.selectAll(".em-hover-line, .em-hover-tick, .em-hover-label").remove(),u(r)}))}(o,e,n,r)}(a,t,o,s,r),function(t){return t.ticks>1||t.tickValues}(t)?function(t,e,n,i){var r=t.map,a=Tv(r),o=t._continuousLegendContainer.append("g").attr("class","em-legend-ticks"),s=Uv(t),l=r.valueTransform_||function(t){return t},c=Pv(t),u=Array.isArray(t.tickValues)&&t.tickValues?t.tickValues.map(l):function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(t){return t};if(Array.isArray(t)&&3===t.length){var i=v(t,3),r=i[0],a=i[1],o=i[2];return Array.from({length:e},(function(t,i){var s=i/(e-1);return n(s<.5?r+2*s*(a-r):a+2*(s-.5)*(o-a))}))}var s=v(t,2),l=s[0],c=s[1];return Array.from({length:e},(function(t,i){return n(l+i/(e-1)*(c-l))}))}(a,t.ticks,l);u.forEach((function(l,h){var f=function(t,e){if(3===e.length){var n=v(e,3),i=n[0],r=n[1],a=n[2];return t<r?.5*(t-i)/(r-i):.5+.5*(t-r)/(a-r)}return(t-e[0])/(e[1]-e[0])}(l,a);if(i){var p=n,d=e-f*e+c;o.append("line").attr("class","em-legend-tick").attr("x1",p).attr("y1",d).attr("x2",p+t.tickLength).attr("y2",d);var g=Array.isArray(t.tickLabels)&&null!=t.tickLabels[h]?t.tickLabels[h]:r.valueUntransform_?s(r.valueUntransform_(l)):s(l);o.append("text").attr("class","em-legend-label em-legend-ticklabel").attr("x",p+t.tickLength+3).attr("y",d).attr("dy","0.35em").attr("text-anchor","start").text(g)}else{var _=f*e,m=n+c;o.append("line").attr("class","em-legend-tick").attr("x1",_).attr("y1",m).attr("x2",_).attr("y2",m+t.tickLength);var y=Array.isArray(t.tickLabels)&&null!=t.tickLabels[h]?t.tickLabels[h]:r.valueUntransform_?s(r.valueUntransform_(l)):s(l);o.append("text").attr("class","em-legend-label em-legend-ticklabel").attr("x",_).attr("y",m+t.tickLength+10).attr("dy","0").attr("text-anchor",0===h?"start":h===u.length-1?"end":"middle").text(y)}}))}(t,o,s,r):function(t,e,n,i){var r=Pv(t),a=t.lowLabel,o=t.highLabel,s=t.pointOfDivergenceLabel,l=t._continuousLegendContainer;if(i){var c=e,u=n+5;a&&l.append("text").attr("class","em-legend-label").attr("x",u).attr("y",r+c).attr("dy","-0.2em").attr("text-anchor","start").text(a),o&&l.append("text").attr("class","em-legend-label").attr("x",u).attr("y",r).attr("dy","0.8em").attr("text-anchor","start").text(o),s&&l.append("text").attr("class","em-legend-label").attr("x",u).attr("y",r+c/2).attr("dy","0.35em").attr("text-anchor","start").text(s)}else{var h=n+r+10;a&&l.append("text").attr("class","em-legend-label").attr("x",0).attr("y",h).attr("text-anchor","start").text(a),o&&l.append("text").attr("class","em-legend-label").attr("x",e).attr("y",h).attr("text-anchor","end").text(o),s&&l.append("text").attr("class","em-legend-label").attr("x",e/2).attr("y",h).attr("text-anchor","middle").text(s)}}(t,o,s,r),t.noData){var l=(r?t.width+5:s+30)+Pv(t);i.pointOfDivergence&&i.pointOfDivergencePadding&&(l+=i.pointOfDivergencePadding);var c=t._continuousLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(0,",").concat(l,")"));t.appendNoDataLegend(c,i.noDataText,Lv,Fv)}}function Tv(t){var e;return"function"==typeof(null===(e=t.colorFunction_)||void 0===e?void 0:e.domain)?t.colorFunction_.domain():t.domain_||[0,1]}function Pv(t){return"ps"==t.map._mapType?t.colorLegend.titlePadding:t.titlePadding}function Nv(t){var e,n,i;return t&&t.legend_&&null!==(e=null!==(n=t.legend_.highlightTolerance)&&void 0!==n?n:null===(i=t.legend_.colorLegend)||void 0===i?void 0:i.highlightTolerance)&&void 0!==e?e:1}function Lv(t,e){var n=Nv(t),i=da(t),r=t.svg_.selectAll(i).selectAll("[ecl]");r&&r.each((function(){var t=Ft(this),i=t.attr("ecl");if(i&&"nd"!==i){var r=+i;r>=e-n&&r<=e+n?t.style("fill",Ft(this).attr("fill___")):t.style("fill","white")}else{if("nd"===e)return;t.style("fill","white")}}))}function Fv(t){var e=da(t);t.svg_.selectAll(e).selectAll("[ecl]").each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}function Ov(t,e){var n=Nv(t);t.getCentroidsGroup(t).selectAll("[ecl]").each((function(){var i=Ft(this),r=i.attr("ecl");if(!r||"nd"===r)return"nd"===e?void i.style("opacity",t.psFillOpacity_):void i.style("opacity",0);var a=+r;a>=e-n&&a<=e+n?i.style("opacity",t.psFillOpacity_):i.style("opacity",0)}))}function Gv(t){t.getCentroidsGroup(t).selectAll("[ecl]").each((function(){Ft(this).style("opacity",t.psFillOpacity_)}))}function Dv(t,e,n){var i,r;t._discreteLegendContainer=t.lgg.append("g").attr("class","em-discrete-legend-container").attr("transform","translate(".concat(e,",").concat(n,")")),null!==(i=t.colorLegend)&&void 0!==i&&i.title&&t._discreteLegendContainer.append("text").attr("class","em-legend-title em-color-legend-title").attr("id","em-color-legend-title").attr("x",0).attr("y",0).text(t.colorLegend.title);var a="ps"==t.map._mapType?t.colorLegend:t;if("ranges"===t.labelType||"ranges"===(null===(r=t.colorLegend)||void 0===r?void 0:r.labelType)?function(t,e){for(var n=t.map,i=t._discreteLegendContainer,r=t.getLabelFormatter(t),a=t.getNumberOfClasses(t),o=t.getHighlightFunction(n),s=t.getUnHighlightFunction(n),l=t.getClassToFillStyle(t),c=t.getColorClassifier(t),u=zv(t),h=function(){var n=f*e.shapeHeight+u,h=0,p=t.ascending?a-f-1:f,d=l(p,a),g=i.append("g").attr("class","em-legend-item");e.pointOfDivergenceLabel&&f>=e.pointOfDivergence&&(n+=e.pointOfDivergencePadding),g.append("rect").attr("class","em-legend-rect").attr("x",h).attr("y",n).attr("width",e.shapeWidth).attr("height",e.shapeHeight).style("fill",d).on("mouseover",(function(){Ft(this).raise(),o(t.map,p),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,o,p)})).on("mouseout",(function(){s(t.map),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,s,p)})),f>0&&g.append("line").attr("class","em-legend-separator").attr("x1",0).attr("y1",n).attr("x2",e.sepLineLength).attr("y2",n),g.append("text").attr("class","em-legend-label").attr("x",Math.max(e.shapeWidth,e.sepLineLength+e.tickLength)+(e.labelOffsets.x||0)).attr("y",n+e.shapeHeight/2).attr("dy","0.3em").text(e.labels?e.labels[f]:r(c.invertExtent(p)[t.ascending?0:1],f))},f=0;f<a;f++)h();if(e.pointOfDivergenceLabel)for(var p=0;p<a;p++){var d=p*e.shapeHeight+u;p==e.pointOfDivergence&&Iv(t,d,e)}}(t,a):function(t,e){for(var n=t.map,i=t._discreteLegendContainer,r=t.getNumberOfClasses(t),a=zv(t),o=t.getHighlightFunction(n),s=t.getUnHighlightFunction(n),l=t.getColorClassifier(t),c=t.getClassToFillStyle(t),u=t.getLabelFormatter(t),h=function(h){var f=h*e.shapeHeight+a,p=0,d=t.ascending?r-h-1:h,g=c(d,r);if(i.append("rect").attr("class","em-legend-rect").attr("x",p).attr("y",f).attr("width",e.shapeWidth).attr("height",e.shapeHeight).style("fill",g).on("mouseover",(function(){Ft(this).raise(),o(n,d),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,o,d)})).on("mouseout",(function(){s(n),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,s,d)})),h>0&&i.append("line").attr("class","em-legend-separator").attr("x1",0).attr("y1",f).attr("x2",t.sepLineLength).attr("y2",f),h>0&&i.append("line").attr("class","em-legend-tick").attr("x1",e.sepLineLength).attr("y1",f).attr("x2",e.sepLineLength+e.tickLength).attr("y2",f),h<r-1){var _=i.append("text").attr("class","em-legend-label").attr("x",Math.max(e.shapeWidth,e.sepLineLength+e.tickLength)+(e.labelOffsets.x||0)).attr("y",f+e.shapeHeight).attr("dy","0.3em").text((function(){if(e.labels)return e.labels[h];if(null!=l&&l.invertExtent){var i=l.invertExtent(d);return u(i[t.ascending?0:1])}return n.noDataText_||""}));e.pointOfDivergenceLabel&&h==e.pointOfDivergence-1&&_.attr("class","em-legend-label em-legend-label-divergence")}},f=0;f<r;f++)h(f);if(e.pointOfDivergenceLabel)for(var p=0;p<r;p++){var d=p*e.shapeHeight+a;p==e.pointOfDivergence&&Iv(t,d,e)}}(t,a),a.noData){var o=t.getNumberOfClasses(t)*a.shapeHeight+zv(t)+3;a.pointOfDivergence&&a.pointOfDivergencePadding&&(o+=a.pointOfDivergencePadding);var s=t._discreteLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(0,",").concat(o,")")),l=t.getHighlightFunction(t.map),c=t.getUnHighlightFunction(t.map);t.appendNoDataLegend(s,a.noDataText,l,c)}}function zv(t){return"ps"==t.map._mapType?t.colorLegend.titlePadding:0}function Iv(t,e,n){var i,r,a,o=t._discreteLegendContainer.append("g").attr("class","em-legend-divergence-container");"ranges"==n.labelType&&(e+=n.pointOfDivergencePadding/2);var s=t._discreteLegendContainer.selectAll(".em-legend-label").nodes().reduce((function(t,e){return Math.max(t,e.getBBox().width)}),0),l=t.divergingLineLength||t.shapeWidth+(null===(i=t.labelOffsets)||void 0===i?void 0:i.x)+s+(null===(r=t.labelOffsets)||void 0===r?void 0:r.x)+15;o.append("line").attr("x1",0).attr("y1",e).attr("x2",0+l).attr("y2",e).attr("class","em-legend-diverging-line");var c=t.pointOfDivergenceLabel.split("|");if(c.length>1){var u=t.divergingArrowLength||30,h=0+l;o.append("defs").append("marker").attr("id","arrowhead").attr("markerWidth",6).attr("markerHeight",6).attr("refX",0).attr("refY",3).attr("orient","auto").append("polygon").attr("points","0 0, ".concat(6," ").concat(3,", 0 ").concat(6)).attr("fill","black"),o.append("line").attr("class","em-legend-diverging-line").attr("x1",h).attr("y1",e).attr("x2",h).attr("y2",e-u).attr("marker-end","url(#arrowhead)"),o.append("line").attr("class","em-legend-diverging-line").attr("x1",h).attr("y1",e).attr("x2",h).attr("y2",e+u).attr("marker-end","url(#arrowhead)"),o.append("text").attr("class","em-legend-label").attr("x",h+10).attr("y",e-u+10).attr("dy","0.3em").text(c[0]),o.append("text").attr("class","em-legend-label").attr("x",h+10).attr("y",e+u-10).attr("dy","0.3em").text(c[1])}else o.append("text").attr("class","em-legend-diverging-label em-legend-label").attr("x",0+l+5).attr("y",e).attr("dy","0.3em").text(t.pointOfDivergenceLabel);"thresholds"!=t.labelType&&"thresholds"!=(null===(a=t.colorLegend)||void 0===a?void 0:a.labelType)||(c.length>1?t._discreteLegendContainer.selectAll(".em-legend-label-divergence").attr("x",0+l+10):t._discreteLegendContainer.selectAll(".em-legend-label-divergence").remove())}function Rv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function jv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Rv(Object(n),!0).forEach((function(e){ma(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Rv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Bv=function(t,e){var n=ax(t);if(n.labelType="thresholds",n.sepLineLength=n.shapeWidth,n.tickLength=4,n.decimals=0,n.labelOffsets={x:3,y:0},n.labels=null,n.histogram=null,n.pointOfDivergenceLabel=void 0,n.pointOfDivergence=void 0,n.pointOfDivergencePadding=7,n.divergingLineLength=void 0,n.divergingArrowLength=void 0,n.lowLabel="Low",n.highLabel="High",n.ticks=0,n.tickValues=void 0,n.tickLabels=void 0,n.orientation="vertical",e)for(var i in e)"histogram"===i&&"object"===ga(e[i])?n.histogram=jv({orientation:"horizontal",showCounts:!1,showPercentages:!1,labelRotation:0},e.histogram):n[i]=e[i];return n.update=function(){if(n.updateConfig(),n.updateContainer(),n.lgg.node()){var t=n.map;if(n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle(),!t.classToFillStyle())return;n.pointOfDivergenceLabel&&!n.pointOfDivergence&&(n.pointOfDivergence=t.numberOfClasses_/2);var e=n.getBaseY(),i=n.getBaseX();if(n.histogram?Av(n,i,e):"continuous"===t.colorSchemeType_?kv(n,i,e):Dv(n,i,e),t.opacityScale_){var r=n.lgg.node().getBBox().height+10;!function(t,e,n){var i,r=t.map,a=r.statData("alpha");if(a&&a.isReady()){var o=r.opacityScale_,s=o.domain()[0],l=o.domain()[1],c=Uv(t);t._alphaLegendContainer=t.lgg.append("g").attr("class","alpha-legend-container").attr("transform","translate(".concat(e,",").concat(n,")"));for(var u=0;u<40;u++){var h=s+(l-s)*u/40;t._alphaLegendContainer.append("rect").attr("x",3*u).attr("y",0).attr("width",3).attr("height",10).style("fill","#000").style("opacity",o(h))}t._alphaLegendContainer.append("text").attr("x",0).attr("y",22).attr("class","em-legend-label").text(c(s)),t._alphaLegendContainer.append("text").attr("x",120).attr("y",22).attr("text-anchor","end").attr("class","em-legend-label").text(c(l)),t._alphaLegendContainer.append("text").attr("x",60).attr("y",-5).attr("text-anchor","middle").attr("class","em-legend-label").text((null===(i=a.unitText)||void 0===i?void 0:i.call(a))||"Transparency")}}(n,i,e+r)}if(n.map.patternFill_){var a=n.lgg.node().getBBox().height,o=n.lgg.append("g").attr("class","pattern-fill-legend").attr("transform","translate(".concat(n.getBaseX(),", ").concat(a+n.boxPadding+5,")"));ov(n,o)}n.setBoxDimension()}},n.labelDecNb=function(t){return console.warn("labelDecNb is now DEPRECATED. Please use decimals instead."),n},n};function qv(t){var e=t.map,n=e.thresholds_.length>1?e.thresholds_:Array.from({length:e.numberOfClasses_}).map((function(n,i){return e.classifier().invertExtent(i)[t.ascending?0:1]})).slice(1);return n}function Uv(t){if("ranges"==t.labelType){var e=qv(t);return t.labelFormatter||function(n,i){var r=mn(".".concat(t.decimals,"f"));return 0===i?"> ".concat(r(e[e.length-1])):i===e.length?"< ".concat(r(e[0])):"".concat(r(e[e.length-i-1])," - < ").concat(r(e[e.length-i])," ")}}return t.labelType,t.labelFormatter||mn(".".concat(t.decimals,"f"))}function Wv(t,e){var n=da(t),i=t.svg_.selectAll(n).selectAll("[ecl]");i.style("fill","white"),i.filter("[ecl='"+e+"']").each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}function Hv(t){var e=da(t);t.svg_.selectAll(e).selectAll("[ecl]").each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}function Vv(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function $v(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Jv(t){return t<0?-t*t:t*t}function Yv(t){var e=t(Qe,Qe),n=1;return e.exponent=function(e){return arguments.length?1===(n=+e)?t(Qe,Qe):.5===n?t($v,Jv):t(Vv(n),Vv(1/n)):n},Mn(e)}function Xv(){var t=Yv(an());return t.copy=function(){return rn(t,Xv()).exponent(t.exponent())},Ht.apply(t,arguments),t}function Kv(){return Xv.apply(null,arguments).exponent(.5)}function Zv(t,e){let n,i;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=i=e):(n>e&&(n=e),i<e&&(i=e)));else{let r=-1;for(let a of t)null!=(a=e(a,++r,t))&&(void 0===n?a>=a&&(n=i=a):(n>a&&(n=a),i<a&&(i=a)))}return[n,i]}const Qv=Tn(new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(kn)),ty=(mr(3),{draw(t,e){const n=mr(e/yr);t.moveTo(n,0),t.arc(0,0,n,0,br)}}),ey={draw(t,e){const n=mr(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},ny=mr(1/3),iy=2*ny,ry={draw(t,e){const n=mr(e/iy),i=n*ny;t.moveTo(0,-n),t.lineTo(i,0),t.lineTo(0,n),t.lineTo(-i,0),t.closePath()}},ay={draw(t,e){const n=mr(e),i=-n/2;t.rect(i,i,n,n)}},oy=_r(yr/10)/_r(7*yr/10),sy=_r(br/10)*oy,ly=-pr(br/10)*oy,cy={draw(t,e){const n=mr(.8908130915292852*e),i=sy*n,r=ly*n;t.moveTo(0,-n),t.lineTo(i,r);for(let e=1;e<5;++e){const a=br*e/5,o=pr(a),s=_r(a);t.lineTo(s*n,-o*n),t.lineTo(o*i-s*r,s*i+o*r)}t.closePath()}},uy=mr(3),hy={draw(t,e){const n=-mr(e/(3*uy));t.moveTo(0,2*n),t.lineTo(-uy*n,-n),t.lineTo(uy*n,-n),t.closePath()}},fy=(mr(3),-.5),py=mr(3)/2,dy=1/mr(12),gy=3*(dy/2+1),_y={draw(t,e){const n=mr(e/gy),i=n/2,r=n*dy,a=i,o=n*dy+n,s=-a,l=o;t.moveTo(i,r),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(fy*i-py*r,py*i+fy*r),t.lineTo(fy*a-py*o,py*a+fy*o),t.lineTo(fy*s-py*l,py*s+fy*l),t.lineTo(fy*i+py*r,fy*r-py*i),t.lineTo(fy*a+py*o,fy*o-py*a),t.lineTo(fy*s+py*l,fy*l-py*s),t.closePath()}};function my(t,e){let n=null,i=Tr(r);function r(){let r;if(n||(n=r=i()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return t="function"==typeof t?t:ur(t||ty),e="function"==typeof e?e:ur(void 0===e?64:+e),r.type=function(e){return arguments.length?(t="function"==typeof e?e:ur(e),r):t},r.size=function(t){return arguments.length?(e="function"==typeof t?t:ur(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r}function vy(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(Array.isArray(e)){var n=t.svg().select("defs");n.empty()&&(n=t.svg().append("defs"));var i={};e.forEach((function(e){var r,a=e.pattern,o=void 0===a?"hatching":a,s=e.regionIds,l=void 0===s?[]:s,c=e.color,u=void 0===c?"#000":c,h=e.strokeWidth,f=void 0===h?1:h,p=e.customPattern,d=e.spacing;if(p){var g=p.match(/id=['"]([^'"]+)['"]/);if(!g)return void console.warn("customPattern must include an id attribute.");r=g[1],t.svg().select("#".concat(r)).empty()&&n.node().insertAdjacentHTML("beforeend",p)}else{var _=u.replace("#","").toLowerCase();r="".concat(o,"-").concat(_,"-sw").concat(f),function(t,e,n,i,r){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8,o=t.svg().select("defs");if(t.svg().select("#".concat(CSS.escape(e))).empty()){var s=o.append("pattern").attr("id",e).attr("patternUnits","userSpaceOnUse").attr("width",a).attr("height",a);"hatching"===n?s.append("path").attr("d","M-".concat(a/8,",").concat(a/8," l").concat(a/4,",-").concat(a/4," M0,").concat(a," l").concat(a,",-").concat(a," M").concat(a-a/8,",").concat(a+a/8," l").concat(a/4,",-").concat(a/4)).attr("stroke",i).attr("stroke-width",r):"crosshatch"===n?s.append("path").attr("d","M0,0 l".concat(a,",").concat(a," M").concat(a,",0 l-").concat(a,",").concat(a)).attr("stroke",i).attr("stroke-width",r):"dots"===n?s.append("circle").attr("cx",a/2).attr("cy",a/2).attr("r",r).attr("fill",i):(console.warn('Unknown pattern "'.concat(n,'", defaulting to hatching.')),s.append("path").attr("d","M-".concat(a/8,",").concat(a/8," l").concat(a/4,",-").concat(a/4," M0,").concat(a," l").concat(a,",-").concat(a," M").concat(a-a/8,",").concat(a+a/8," l").concat(a/4,",-").concat(a/4)).attr("stroke",i).attr("stroke-width",r))}}(t,r,o,u,f,d)}e.patternId=r,l.forEach((function(t){i[t]||(i[t]=[]),i[t].push(r)}))})),t.svg().selectAll(pa(t)).each((function(t){var e,n=this,r=null==t||null===(e=t.properties)||void 0===e?void 0:e.id,a=i[r];if(a&&a.length){var o=Ft(this);a.forEach((function(t){var e=o.node().cloneNode(!0);Ft(e).attr("fill","url(#".concat(t,")")).attr("pointer-events","none").attr("class",(o.attr("class")||"")+"pattern-fill-overlay"),Ft(n.parentNode).append((function(){return e}))}))}}))}else console.warn("patternFill expects an array of configs")}const yy=4294967296;var xy=Math.PI*(3-Math.sqrt(5));function by(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),a=0,o=.6,s=new Map,l=gi(h),c=ei("tick","end"),u=function(){let t=1;return()=>(t=(1664525*t+1013904223)%yy)/yy}();function h(){f(),c.call("tick",e),n<i&&(l.stop(),c.call("end",e))}function f(i){var l,c,u=t.length;void 0===i&&(i=1);for(var h=0;h<i;++h)for(n+=(a-n)*r,s.forEach((function(t){t(n)})),l=0;l<u;++l)null==(c=t[l]).fx?c.x+=c.vx*=o:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=o:(c.y=c.fy,c.vy=0);return e}function p(){for(var e,n=0,i=t.length;n<i;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var r=10*Math.sqrt(.5+n),a=n*xy;e.x=r*Math.cos(a),e.y=r*Math.sin(a)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function d(e){return e.initialize&&e.initialize(t,u),e}return null==t&&(t=[]),p(),e={tick:f,restart:function(){return l.restart(h),e},stop:function(){return l.stop(),e},nodes:function(n){return arguments.length?(t=n,p(),s.forEach(d),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(i=+t,e):i},alphaDecay:function(t){return arguments.length?(r=+t,e):+r},alphaTarget:function(t){return arguments.length?(a=+t,e):a},velocityDecay:function(t){return arguments.length?(o=1-t,e):1-o},randomSource:function(t){return arguments.length?(u=t,s.forEach(d),e):u},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,d(n)),e):s.get(t)},find:function(e,n,i){var r,a,o,s,l,c=0,u=t.length;for(null==i?i=1/0:i*=i,c=0;c<u;++c)(o=(r=e-(s=t[c]).x)*r+(a=n-s.y)*a)<i&&(l=s,i=o);return l},on:function(t,n){return arguments.length>1?(c.on(t,n),e):c.on(t)}}}function wy(t){return function(){return t}}function Sy(t){var e,n,i,r=wy(.1);function a(t){for(var r,a=0,o=e.length;a<o;++a)(r=e[a]).vx+=(i[a]-r.x)*n[a]*t}function o(){if(e){var a,o=e.length;for(n=new Array(o),i=new Array(o),a=0;a<o;++a)n[a]=isNaN(i[a]=+t(e[a],a,e))?0:+r(e[a],a,e)}}return"function"!=typeof t&&(t=wy(null==t?0:+t)),a.initialize=function(t){e=t,o()},a.strength=function(t){return arguments.length?(r="function"==typeof t?t:wy(+t),o(),a):r},a.x=function(e){return arguments.length?(t="function"==typeof e?e:wy(+e),o(),a):t},a}function My(t){var e,n,i,r=wy(.1);function a(t){for(var r,a=0,o=e.length;a<o;++a)(r=e[a]).vy+=(i[a]-r.y)*n[a]*t}function o(){if(e){var a,o=e.length;for(n=new Array(o),i=new Array(o),a=0;a<o;++a)n[a]=isNaN(i[a]=+t(e[a],a,e))?0:+r(e[a],a,e)}}return"function"!=typeof t&&(t=wy(null==t?0:+t)),a.initialize=function(t){e=t,o()},a.strength=function(t){return arguments.length?(r="function"==typeof t?t:wy(+t),o(),a):r},a.y=function(e){return arguments.length?(t="function"==typeof e?e:wy(+e),o(),a):t},a}function Ey(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,a,o,s,l,c,u,h,f,p=t._root,d={data:i},g=t._x0,_=t._y0,m=t._x1,v=t._y1;if(!p)return t._root=d,t;for(;p.length;)if((c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(_+v)/2))?_=o:v=o,r=p,!(p=p[h=u<<1|c]))return r[h]=d,t;if(s=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===s&&n===l)return d.next=p,r?r[h]=d:t._root=d,t;do{r=r?r[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(_+v)/2))?_=o:v=o}while((h=u<<1|c)==(f=(l>=o)<<1|s>=a));return r[f]=p,r[h]=d,t}function Cy(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function Ay(t){return t[0]}function ky(t){return t[1]}function Ty(t,e,n){var i=new Py(null==e?Ay:e,null==n?ky:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function Py(t,e,n,i,r,a){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=a,this._root=void 0}function Ny(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Ly=Ty.prototype=Py.prototype;function Fy(t){return 1e-6*(t()-.5)}function Oy(t){return t.x+t.vx}function Gy(t){return t.y+t.vy}function Dy(t){var e,n,i,r=1,a=1;function o(){for(var t,o,l,c,u,h,f,p=e.length,d=0;d<a;++d)for(o=Ty(e,Oy,Gy).visitAfter(s),t=0;t<p;++t)l=e[t],h=n[l.index],f=h*h,c=l.x+l.vx,u=l.y+l.vy,o.visit(g);function g(t,e,n,a,o){var s=t.data,p=t.r,d=h+p;if(!s)return e>c+d||a<c-d||n>u+d||o<u-d;if(s.index>l.index){var g=c-s.x-s.vx,_=u-s.y-s.vy,m=g*g+_*_;m<d*d&&(0===g&&(m+=(g=Fy(i))*g),0===_&&(m+=(_=Fy(i))*_),m=(d-(m=Math.sqrt(m)))/m*r,l.vx+=(g*=m)*(d=(p*=p)/(f+p)),l.vy+=(_*=m)*d,s.vx-=g*(d=1-d),s.vy-=_*d)}}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function l(){if(e){var i,r,a=e.length;for(n=new Array(a),i=0;i<a;++i)r=e[i],n[r.index]=+t(r,i,e)}}return"function"!=typeof t&&(t=wy(null==t?1:+t)),o.initialize=function(t,n){e=t,i=n,l()},o.iterations=function(t){return arguments.length?(a=+t,o):a},o.strength=function(t){return arguments.length?(r=+t,o):r},o.radius=function(e){return arguments.length?(t="function"==typeof e?e:wy(+e),l(),o):t},o}function zy(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Iy(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ry(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ry(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Ry(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function jy(t,e){var i=function(i){var r,a,o,s,l,c=i.Geometries.centroidsFeatures||[];if(c.length){qy(i);var u,h=null!==(r=null===(a=i.dorlingStrength_)||void 0===a?void 0:a.x)&&void 0!==r?r:1,f=null!==(o=null===(s=i.dorlingStrength_)||void 0===s?void 0:s.y)&&void 0!==o?o:1,p=null!==(l=i.dorlingIterations_)&&void 0!==l?l:1,d=!1!==i.dorlingWorker_,g=i.dorlingWorkerD3URL_||"https://unpkg.com/d3@7/dist/d3.min.js",_=Iy(c);try{for(_.s();!(u=_.n()).done;){var m,v=u.value,y=null===(m=i._projection)||void 0===m?void 0:m.call(i,v.geometry.coordinates);y?(v.x=y[0],v.y=y[1]):(v.x=NaN,v.y=NaN)}}catch(t){_.e(t)}finally{_.f()}var x=t.getCentroidsGroup(i).selectAll("g.em-centroid"),b=function(t){t.attr("transform",(function(t){return!t||isNaN(t.x)||isNaN(t.y)?null:"translate(".concat(t.x,",").concat(t.y,")")}))};if(!1===i.animateDorling_){if(d){console.log("Running Dorling simulation asynchronously in a Web Worker");var w=new Worker(new URL(n.p+n.u(222),n.b),{type:void 0});return w.postMessage({nodes:c.map((function(t){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?zy(Object(n),!0).forEach((function(e){ma(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zy(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t)})),radii:c.map((function(t){return e(t)})),strengthX:h,strengthY:f,iterations:p,d3URL:g}),void(w.onmessage=function(t){var e=t.data,n=e.type,r=e.nodes,a=e.progress,o=e.total;"progress"!==n?"end"===n&&r&&(c.forEach((function(t,e){t.x=r[e].x,t.y=r[e].y})),b(x),By(1,i),w.terminate()):By(a/o,i)})}for(var S=by(c).force("x",Sy((function(t){return t.properties.centroid[0]})).strength(h)).force("y",My((function(t){return t.properties.centroid[1]})).strength(f)).force("collide",Dy((function(t){return e(t)})).iterations(p)).stop(),M=Math.ceil(Math.log(S.alphaMin())/Math.log(1-S.alphaDecay())),E=0;E<M;E++)S.tick(),E%10==0&&b(x);return b(x),By(1,i),S}return i.simulation=by(c).force("x",Sy((function(t){return t.properties.centroid[0]})).strength(h)).force("y",My((function(t){return t.properties.centroid[1]})).strength(f)).force("collide",Dy((function(t){return e(t)})).iterations(p)).on("tick",(function(){return b(x)})),i.simulation}};i(t),t.insetTemplates_&&ua(t.insetTemplates_,t.svgId_,(function(t){i(t)}))}function By(t,e){e.onDorlingProgress_&&e.onDorlingProgress_(t,e)}function qy(t){t.simulation&&(t.simulation.stop(),t.simulation.on("tick",null),t.simulation=null)}Ly.copy=function(){var t,e,n=new Py(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=Ny(i),n;for(t=[{source:i,target:n._root=new Array(4)}];i=t.pop();)for(var r=0;r<4;++r)(e=i.source[r])&&(e.length?t.push({source:e,target:i.target[r]=new Array(4)}):i.target[r]=Ny(e));return n},Ly.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Ey(this.cover(e,n),e,n,t)},Ly.addAll=function(t){var e,n,i,r,a=t.length,o=new Array(a),s=new Array(a),l=1/0,c=1/0,u=-1/0,h=-1/0;for(n=0;n<a;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(r=+this._y.call(null,e))||(o[n]=i,s[n]=r,i<l&&(l=i),i>u&&(u=i),r<c&&(c=r),r>h&&(h=r));if(l>u||c>h)return this;for(this.cover(l,c).cover(u,h),n=0;n<a;++n)Ey(this,o[n],s[n],t[n]);return this},Ly.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,a=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,a=(i=Math.floor(e))+1;else{for(var o,s,l=r-n||1,c=this._root;n>t||t>=r||i>e||e>=a;)switch(s=(e<i)<<1|t<n,(o=new Array(4))[s]=c,c=o,l*=2,s){case 0:r=n+l,a=i+l;break;case 1:n=r-l,a=i+l;break;case 2:r=n+l,i=a-l;break;case 3:n=r-l,i=a-l}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=i,this._x1=r,this._y1=a,this},Ly.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},Ly.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},Ly.find=function(t,e,n){var i,r,a,o,s,l,c,u=this._x0,h=this._y0,f=this._x1,p=this._y1,d=[],g=this._root;for(g&&d.push(new Cy(g,u,h,f,p)),null==n?n=1/0:(u=t-n,h=e-n,f=t+n,p=e+n,n*=n);l=d.pop();)if(!(!(g=l.node)||(r=l.x0)>f||(a=l.y0)>p||(o=l.x1)<u||(s=l.y1)<h))if(g.length){var _=(r+o)/2,m=(a+s)/2;d.push(new Cy(g[3],_,m,o,s),new Cy(g[2],r,m,_,s),new Cy(g[1],_,a,o,m),new Cy(g[0],r,a,_,m)),(c=(e>=m)<<1|t>=_)&&(l=d[d.length-1],d[d.length-1]=d[d.length-1-c],d[d.length-1-c]=l)}else{var v=t-+this._x.call(null,g.data),y=e-+this._y.call(null,g.data),x=v*v+y*y;if(x<n){var b=Math.sqrt(n=x);u=t-b,h=e-b,f=t+b,p=e+b,i=g.data}}return i},Ly.remove=function(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,n,i,r,a,o,s,l,c,u,h,f,p=this._root,d=this._x0,g=this._y0,_=this._x1,m=this._y1;if(!p)return this;if(p.length)for(;;){if((c=a>=(s=(d+_)/2))?d=s:_=s,(u=o>=(l=(g+m)/2))?g=l:m=l,e=p,!(p=p[h=u<<1|c]))return this;if(!p.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(n=e,f=h)}for(;p.data!==t;)if(i=p,!(p=p.next))return this;return(r=p.next)&&delete p.next,i?(r?i.next=r:delete i.next,this):e?(r?e[h]=r:delete e[h],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(n?n[f]=p:this._root=p),this):(this._root=r,this)},Ly.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},Ly.root=function(){return this._root},Ly.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},Ly.visit=function(t){var e,n,i,r,a,o,s=[],l=this._root;for(l&&s.push(new Cy(l,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(l=e.node,i=e.x0,r=e.y0,a=e.x1,o=e.y1)&&l.length){var c=(i+a)/2,u=(r+o)/2;(n=l[3])&&s.push(new Cy(n,c,u,a,o)),(n=l[2])&&s.push(new Cy(n,i,u,c,o)),(n=l[1])&&s.push(new Cy(n,c,r,a,u)),(n=l[0])&&s.push(new Cy(n,i,r,c,u))}return this},Ly.visitAfter=function(t){var e,n=[],i=[];for(this._root&&n.push(new Cy(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var r=e.node;if(r.length){var a,o=e.x0,s=e.y0,l=e.x1,c=e.y1,u=(o+l)/2,h=(s+c)/2;(a=r[0])&&n.push(new Cy(a,o,s,u,h)),(a=r[1])&&n.push(new Cy(a,u,s,l,h)),(a=r[2])&&n.push(new Cy(a,o,h,u,c)),(a=r[3])&&n.push(new Cy(a,u,h,l,c))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},Ly.x=function(t){return arguments.length?(this._x=t,this):this._x},Ly.y=function(t){return arguments.length?(this._y=t,this):this._y};var Uy=function(t){var e=sx(t,!0,"ps");function n(t){if(t.svg_&&e.classifierColor_){var n=t.statData("color");t.svg_.selectAll(".em-centroid").attr("ecl",(function(t){var i=n.get(t.properties.id);if(!i)return"nd";var r=i.value;return 0!==r&&!r||":"==r?"nd":+e.classifierColor_(+r)}))}}function i(t){return t.statData("size").getArray()?t.statData("size"):t.statData()}function r(t){e.psClassToFillStyle()||e.psClassToFillStyle(Wy(e.psColorFun_,e.psColors_));var n=i(t);if(t.svg_){var r,s;t.svg_.selectAll(":not(#em-insets-group) g.em-centroid > *").remove(),e.updateSymbolsDrawOrder(t),s=e.psCustomSVG_?function(t,n){return t.getCentroidsGroup(t).selectAll("g.em-centroid").append("g").filter((function(t){var e=n.get(t.properties.id);if(e&&":"!==e.value)return t})).attr("class","ps").html(e.psCustomSVG_).attr("transform",(function(t){var i=n.get(t.properties.id),r=e.classifierSize_(+i.value);if(r)return"translate(".concat(e.psOffset_.x*r,",").concat(e.psOffset_.y*r,") scale(").concat(r,")")}))}(t,n):"bar"==e.psShape_?function(t,n){return t.getCentroidsGroup(t).selectAll("g.em-centroid").append("rect").filter((function(t){var e=n.get(t.properties.id);if(e&&":"!==e.value)return t})).attr("width",e.psBarWidth_).attr("height",(function(t){var i=n.get(t.properties.id);return i&&i.value?e.classifierSize_(+i.value):0})).attr("transform",(function(){this.getBoundingClientRect();return"translate(".concat(-this.getAttribute("width")/2)+", -".concat(this.getAttribute("height"),")")}))}(t,n):"circle"==e.psShape_?function(t,n){var i=t.svg().selectAll("g.em-centroid").filter((function(t){var e=n.get(t.properties.id);return e&&":"!==e.value&&e.value})).append("circle").attr("stroke-width",e.psStrokeWidth()).attr("stroke",e.psStroke()).attr("fill-opacity",e.psFillOpacity()).attr("stroke-opacity",e.psStrokeOpacity()).style("pointer-events","none").transition().duration(e.transitionDuration()).attr("r",(function(t){var i=n.get(t.properties.id),r=e.classifierSize_(+i.value);return r<0&&console.error("Negative radius for circle:",t.properties.id),isNaN(r)&&console.error("NaN radius for circle:",t.properties.id),r})).on("end",(function(){Ft(this).style("pointer-events",null)}));return i}(t,n):"spike"==e.psShape_?function(t,n){var i=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.psSpikeWidth_;return"M".concat(-n/2,",0L0,").concat(-t,"L").concat(n/2,",0")},r=t.svg().selectAll("g.em-centroid"),a=r.append("path").attr("d",(function(t){var r=n.get(t.properties.id),a=r?e.classifierSize_(+r.value):0;return i(a)})).style("fill",(function(t){return t.color||"steelblue"})).attr("fill-opacity",t.psFillOpacity_).attr("stroke",t.psStroke_).attr("stroke-width",t.psStrokeWidth_);return a}(t,n):function(t,n){return t.svg().selectAll("g.em-centroid").append("path").filter((function(t){var e=n.get(t.properties.id);if(e&&":"!==e.value)return t})).attr("class","ps").attr("d",(function(t){if(n){var i=n.get(t.properties.id);if(0==i||i){var r=e.classifierSize_(+i.value)||0;if(e.psCustomShape_)return e.psCustomShape_.size(r*r)();var a=Hy[e.psShape_]||Hy.circle;return my().type(a).size(r*r)()}}}))}(t,n);var l=pa(t),c=t.svg().selectAll(l);if("WORLD"!==t.geo_){if("mixed"==t.nutsLevel_){!function(t,n,i){i.style("display",(function(e){if(!this.parentNode.classList.contains("em-cntrg")){var i=n.get(e.properties.id);return!i||!i.value&&0!==i&&0!==i.value?"none":"WORLD"==t.geo_?"block":void 0}})),i.style("stroke",(function(t){var e=Ft(this),i=e.attr("lvl"),r=e.style("stroke"),a=n.get(t.properties.id);if(a&&a.value)return"0"!==i?r||"#777":void 0})).style("stroke-width",(function(t){var i=Ft(this),r=i.attr("lvl"),a=i.style("stroke-width"),o=n.get(t.properties.id);if(o&&o.value)return"WORLD"==e.geo_&&"0"!==r?a||"#777":void 0}))}(t,n,c);var u=[];t.svg().selectAll("g.em-centroid").each((function(t){var e;null!==(e=t.properties)&&void 0!==e&&e.centroid&&u.push(t)})),t.Geometries.centroidsFeatures=u}c.attr("ecl",(function(t){var e=n.get(t.properties.id);return!e||!e.value&&0!==e&&0!==e.value?"ni":e&&e.value&&":"==e.value?"nd":void 0}))}!function(t){t.attr("fill-opacity",e.psFillOpacity()).attr("stroke-opacity",e.psStrokeOpacity()).attr("stroke",e.psStroke()).attr("stroke-width",e.psStrokeWidth()).style("fill",(function(){if(e.classifierColor_){var t=Ft(this.parentNode).attr("ecl");return t&&"nd"!==t?e.psClassToFillStyle_(t,e.psClasses_):e.noDataFillStyle_||"gray"}return e.psFill_})).attr("fill___",(function(){return Ft(this).style("fill")}))}(s),a(t,n),o(t),null!==(r=e.labels_)&&void 0!==r&&r.values&&e.updateValuesLabels(t),e.patternFill_&&vy(t,e.patternFill_)}return t}e.psShape_="circle",e.psCustomShape_,e.psCustomSVG_,e.psSpikeWidth_=7,e.psOffset_={x:0,y:0},e.psMaxSize_=30,e.psMinSize_=5,e.psBarWidth_=10,e.psMaxValue_=void 0,e.psMinValue_=void 0,e.psSizeScale_=void 0,e.psFill_="#2d50a0",e.psFillOpacity_=1,e.psStroke_="#ffffff",e.psStrokeWidth_=.2,e.psStrokeOpacity_=1,e.psClasses_=5,e.psColors_=null,e.psColorFun_=Qv,e.psClassToFillStyle_=void 0,e.psThresholds_=[0],e.psClassificationMethod_="quantile",e.makeClassifNice_=!0,e.classifierSize_=void 0,e.classifierColor_=void 0,e.tooltip_.textFunction=Vy,e.psCodeLabels_=!1,["psMaxSize_","psMinSize_","psMaxValue_","psMinValue_","psFill_","psFillOpacity_","psStrokeOpacity_","psStroke_","psStrokeWidth_","classifierSize_","classifierColor_","psShape_","psCustomShape_","psBarWidth_","psClassToFillStyle_","psColorFun_","psSizeScale_","noDataFillStyle_","psThresholds_","psColors_","psCustomSVG_","psOffset_","psClassificationMethod_","psClasses_","dorling_","dorlingStrength_","dorlingIterations_","animateDorling_","psSpikeWidth_","psCodeLabels_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),t&&["psMaxSize","psMinSize","psFill","psFillOpacity","psStroke","psStrokeWidth","classifierSize","classifierColor","psShape","psCustomShape","psBarWidth","psClassToFillStyle","psColorFun","noDataFillStyle","psThreshold","psColors","psCustomSVG","psOffset","psClassificationMethod","psClasses","dorlingIterations_"].forEach((function(n){null!=t[n]&&e[n](t[n])})),e.psColorFun=function(t){return arguments.length?(e.psColorFun_=t,e.psClassToFillStyle_=Wy(e.psColorFun_,e.psColors_),e):e.psColorFun_},e.psThresholds=function(t){return arguments.length?(e.psThresholds_=t,e.psClasses(t.length+1),e):e.psThresholds_},e.updateClassification=function(){try{return function(){var t,n;e.psSizeScale_||("spike"==e.psShape_?e.psSizeScale_="linear":e.psSizeScale_="sqrt");var i=(e.statData("size").getArray()||e.statData().getArray()).map((function(t){return+t})).filter((function(t){return isFinite(t)&&t>0})),r=Zv(i),a=v(r,2),o=a[0],s=a[1],l=null!==(t=e.psMinValue_)&&void 0!==t?t:o,c=null!==(n=e.psMaxValue_)&&void 0!==n?n:s;isFinite(l)&&isFinite(c)||(l=e.statData().getMin(),c=e.statData().getMax());var u=[l,c],h="sqrt"==e.psSizeScale_?Kv:En;e.classifierSize(h().domain(u).range([e.psMinSize_,e.psMaxSize_]))}(),e.statData("color").getArray()&&function(){var t=function(t){return y(Array(t).keys())};if("quantile"===e.psClassificationMethod_){var n=e.statData("color").getArray(),i=t(e.psClasses_);e.classifierColor(Vt().domain(n).range(i))}else if("equinter"===e.psClassificationMethod_){var r=e.statData("color").getArray(),a=t(e.psClasses_);e.classifierColor(Cn().domain([min(r),max(r)]).range(a)),e.makeClassifNice_&&e.classifierColor().nice()}else if("threshold"===e.psClassificationMethod_){e.psClasses(e.psThresholds().length+1);var o=t(e.psClasses_);e.classifierColor(An().domain(e.psThresholds()).range(o))}}(),e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,n),n(e),e}catch(t){console.error("Error in proportional symbols classification: "+t.message),console.error(t)}};var a=function(t,n){var i,r=t.svg().selectAll("g.em-centroid");if(e.psCodeLabels_)r.filter((function(t){var e=n.get(t.properties.id);return":"!==(null==e?void 0:e.value)&&null!=(null==e?void 0:e.value)})).append("text").attr("class","em-circle-code-label").text((function(t){var e=n.get(t.properties.id);return":"===(null==e?void 0:e.value)?"":t.properties.id})).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","sans-serif").style("font-size",(function(t){var i,r,a=n.get(t.properties.id),o=a?e.classifierSize_(+a.value):0,s=null!==(i=e.labels_)&&void 0!==i&&i.values&&null!==(r=n.get(t.properties.id))&&void 0!==r&&r.value?.8:.9;return"square"===e.psShape_&&(s-=.4),"".concat(o*s,"px")})).attr("fill",(function(){var t,e=null===(t=window.getComputedStyle(this.parentNode.firstChild))||void 0===t?void 0:t.fill;return fa(e)})).attr("dy",(function(t){var i,r;return null!==(i=e.labels_)&&void 0!==i&&i.values&&null!==(r=n.get(t.properties.id))&&void 0!==r&&r.value?"-0.3em":"0"}));if(null!==(i=e.labels_)&&void 0!==i&&i.values)r.filter((function(t){var e=n.get(t.properties.id);return":"!==(null==e?void 0:e.value)&&null!=(null==e?void 0:e.value)})).append("text").attr("class","em-circle-stat-label").text((function(t){var e=n.get(t.properties.id);if(null!=e&&e.value)return e.value})).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","sans-serif").style("font-size",(function(t){var i=n.get(t.properties.id),r=i?e.classifierSize_(+i.value):0;return"".concat(.4*r,"px")})).attr("fill",(function(){var t,n=(null===(t=window.getComputedStyle(this.parentNode.firstChild))||void 0===t?void 0:t.fill)||e.psFill_;return fa(n)})).attr("dy",(function(t){return e.psCodeLabels_?"0.8em":"0"}))},o=function(t){t.svg().selectAll("g.em-centroid").on("mouseover",(function(n,i){var r=Ft(this.childNodes[0]);r.attr("fill___",r.style("fill")),r.style("fill",e.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(i,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,i,this,t)})).on("mousemove",(function(n,i){e._tooltip&&e._tooltip.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,i,this,t)})).on("mouseout",(function(n,i){var r=Ft(this.childNodes[0]),a=r.attr("fill___");a&&(r.style("fill",a),e._tooltip&&e._tooltip.mouseout()),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,i,this,t)}))};return e.updateSymbolsDrawOrder=function(t){var r=e.getCentroidsGroup(t),a=i(t);t.Geometries.centroidsFeatures&&t.Geometries.centroidsFeatures.length||(t.Geometries.centroidsFeatures=t.svg().selectAll("g.em-centroid").data().filter((function(t){var e;return null==t||null===(e=t.properties)||void 0===e?void 0:e.centroid})));var o=t.Geometries.centroidsFeatures.filter((function(t){var e,n=null===(e=a.get)||void 0===e||null===(e=e.call(a,t.properties.id))||void 0===e?void 0:e.value;return null!=n&&":"!==n})).sort((function(t,e){return a.get(e.properties.id).value-a.get(t.properties.id).value}));r.selectAll("g.em-centroid").remove(),r.selectAll("g.em-centroid").data(o,(function(t){return t.properties.id})).enter().append("g").attr("class","em-centroid").attr("id",(function(t){return"ps"+t.properties.id})).attr("transform",(function(t){return"translate(".concat(t.properties.centroid[0].toFixed(3),",").concat(t.properties.centroid[1].toFixed(3),")")})),n(t)},e.updateStyle=function(){try{if(r(e),e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,r),e.dorling_){var t=i(e);jy(e,(function(n){var i=t.get(n.properties.id),r=i?e.classifierSize_(+i.value):0;return"square"===e.psShape_?r/2*Math.SQRT2:r}))}else qy(e);return e}catch(t){console.error("Error in proportional symbols styling: "+t.message),console.error(t)}},e.getLegendConstructor=function(){return ex},e},Wy=function(t,e){return t=t||Qv,e?function(t,n){return e[t]}:function(e,n){return t(e/(n-1))}},Hy={cross:ey,square:ay,diamond:ry,triangle:hy,star:cy,wye:_y,circle:ty},Vy=function(t,e){var n;if(e.tooltip_.omitRegions&&e.tooltip_.omitRegions.includes(t.properties.id))return"";var i=t.properties.na,r=t.properties.id,a=e.statData("size").getArray()?e.statData("size"):e.statData(),o=a.get(t.properties.id),s=o&&(0===o.value||!!o.value),l=s?a.unitText():null,c="<tr><td>".concat(s?la(o.value)+" "+(l||""):e.noDataText_,"</td></tr>"),u="",h=null!==(n=e.statData("color"))&&void 0!==n&&n.getArray()?e.statData("color"):null;if(h){var f=h.get(t.properties.id),p=f&&(0===f.value||!!f.value),d=p?h.unitText():null;u="<tr><td>".concat(p?la(f.value)+" "+(d||""):e.noDataText_,"</td></tr>")}return'\n <div class="em-tooltip-bar">\n <b>'.concat(i,"</b>").concat(r?" (".concat(r,")"):"",'\n </div>\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n ').concat(c,"\n ").concat(u,"\n </tbody>\n </table>\n </div>\n ").trim()};function $y(t,e,n,i,r){var a,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:16;if(r){var s=ra("em-size-legend-title");o+=s,e.append("text").attr("class","em-size-legend-title").attr("id","em-size-legend-title").attr("x",0).attr("y",s).text(r)}var l=i.domain();n||(n=[Math.floor(l[1]),Math.floor(l[0])]);var c=i(Gt(n)),u=c,h=2*c+o,f=e.append("g").attr("transform","translate(".concat(u,",").concat(h,")")).attr("class","em-circle-size-legend").attr("id","em-circle-size-legend").attr("text-anchor","right").style("fill","black").selectAll("g").data(n.filter((function(t){return i(t)}))).join("g").attr("class","em-legend-item");f.append("circle").attr("class","em-legend-circle").style("fill","none").attr("stroke","black").attr("cy",(function(t){return-i(t)})).attr("r",i);var p=(null===(a=t.sizeLegend)||void 0===a?void 0:a.labelFormatter)||la;return f.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("y",(function(t,e){return-1-2*i(t)})).attr("x",c+5).text((function(t){return p(t)})),f.append("line").style("stroke-dasharray",2).style("stroke","grey").attr("x1",2).attr("y1",(function(t,e){return-1-2*i(t)})).attr("x2",c+5).attr("y2",(function(t,e){return-1-2*i(t)})),t}function Jy(t,e,n){var i,r=t.map;if(t._sizeLegendContainer=t.lgg.append("g").attr("class","em-size-legend-container").attr("id","em-size-legend-container").attr("transform","translate(".concat(e,",").concat(n,")")),r.psCustomSVG_||"circle"!=r.psShape_)if("spike"!=r.psShape_){var a=(null===(i=t.sizeLegend)||void 0===i?void 0:i.labelFormatter)||la,o=r.classifierSize_.domain()[1];t.sizeLegend.values&&(t.sizeLegend.cellNb=t.sizeLegend.values.length),r.customSymbols={nodeHeights:0};for(var s=1;s<t.sizeLegend.cellNb+1;s++){var l=t.ascending?t.sizeLegend.cellNb-s+1:s,c=t.sizeLegend.values?t.sizeLegend.values[l-1]:o/l,u=r.classifierSize_(c);"bar"==r.psShape_?Ky(t,c,u,s,a):"custom"==r.psShape_||r.psCustomSVG_?Xy(t,c,u,s,a):Yy(t,c,u,s,a)}if(t.sizeLegend.noData){var h=t._sizeLegendContainer.node().getBBox().height,f=t._sizeLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(0,",").concat(h,")"));t.appendNoDataLegend(f,t.sizeLegend.noDataText,Qy,tx)}}else!function(t){var e=t.map,n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.psSpikeWidth_;return"M".concat(-n/2,",0L0,").concat(-t,"L").concat(n/2,",0")},i=e.classifierSize_(e.classifierSize_.domain()[1]),r=t.sizeLegend.values||e.classifierSize_.ticks(4).slice(1),a=ra("em-legend-label"),o=a-2,s=t._sizeLegendContainer.append("g").attr("id","em-spike-legend").attr("transform","translate(".concat(t.boxPadding,",").concat(t.sizeLegend.titlePadding,")")).attr("fill","black").attr("text-anchor","middle").style("font-size","".concat(a,"px")).selectAll().data(r).join("g").attr("transform",(function(e,n){return"translate(".concat(40*n+t.boxPadding,",").concat(i+5,")")}));if(s.append("path").attr("fill",e.psFill_).attr("fill-opacity",e.psFillOpacity_).attr("stroke",e.psStroke_).attr("stroke-width",e.psStrokeWidth_).attr("d",(function(t){return n(e.classifierSize_(t))})),s.append("text").attr("class","em-legend-label").attr("dy",o).text((function(t){return e.classifierSize_.tickFormat(4,"s")(t)})),t.sizeLegend.noData){var l=i+o+a+5,c=t.boxPadding,u=t._sizeLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(c,",").concat(l,")"));t.appendNoDataLegend(u,t.sizeLegend.noDataText,Qy,tx)}}(t);else if($y(t,t._sizeLegendContainer,t.sizeLegend.values,r.classifierSize_,t.sizeLegend.title,t.sizeLegend.titlePadding),t.sizeLegend.noData){var p=t._sizeLegendContainer.node().getBBox().height+15,d=t._sizeLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(0,",").concat(p,")"));t.appendNoDataLegend(d,t.sizeLegend.noDataText,Qy,tx)}}function Yy(t,e,n,i,r){var a=t.map,o="triangle"==a.psShape_||"diamond"==a.psShape_?n:n/2;0==t.sizeLegend._totalD3SymbolsHeight&&(t.sizeLegend._totalD3SymbolsHeight+=o+t.boxPadding);var s=a.classifierSize_(a.classifierSize_.domain()[1]),l=s,c=(t.sizeLegend.title?t.titleFontSize+t.sizeLegend.titlePadding:0)+t.sizeLegend._totalD3SymbolsHeight+(t.sizeLegend.shapePadding*i-1);t.sizeLegend._totalD3SymbolsHeight+=n;var u=t._sizeLegendContainer.append("g").attr("transform","translate(".concat(l,",").concat(c,")")).attr("class","em-size-legend-item"),h=Zy(t).size(n*n)();u.append("g").style("fill",(function(e){return a.classifierColor_?t.sizeLegend.shapeFill:a.psFill_})).style("fill-opacity",a.psFillOpacity()).style("stroke",t.sizeLegend.shapeStroke?t.sizeLegend.shapeStroke:a.psStroke()).style("stroke-width",a.psStrokeWidth()).append("path").attr("d",h).attr("transform",(function(){return"translate(".concat(t.sizeLegend.shapeOffsets.x,",").concat(t.sizeLegend.shapeOffsets.y,")")}));var f=s/2+t.sizeLegend.labelOffsets.x+t.boxPadding;u.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("x",f).attr("y",0).text(r(e))}function Xy(t,e,n,i,r){var a,o=t.map,s=t.boxPadding;if(o.customSymbols.prevSymb||(a=t.boxPadding+(t.sizeLegend.title?t.titleFontSize+t.sizeLegend.titlePadding:0)+20,o.customSymbols.initialTranslateY=a,o.customSymbols.prevScale=n),o.customSymbols.prevSymb){var l=o.customSymbols.prevSymb.node().getBBox();o.customSymbols.nodeHeights=o.customSymbols.nodeHeights+l.height*o.customSymbols.prevScale,a=o.customSymbols.initialTranslateY+o.customSymbols.nodeHeights+t.sizeLegend.shapePadding*(i-1),o.customSymbols.prevScale=n}var c=t._sizeLegendContainer.append("g").attr("transform","translate(".concat(s,",").concat(a,")")).attr("class","em-size-legend-item");o.customSymbols.prevSymb=c.append("g").attr("class","em-size-legend-symbol").style("fill",(function(e){return o.classifierColor_?t.sizeLegend.shapeFill:o.psFill_})).style("fill-opacity",o.psFillOpacity()).style("stroke",t.sizeLegend.shapeStroke?t.sizeLegend.shapeStroke:o.psStroke()).style("stroke-width",o.psStrokeWidth()).attr("stroke","black").attr("stroke-width",.5).append("g").html(o.psCustomSVG_).attr("transform",(function(){return o.psCustomSVG_?"translate(".concat(t.sizeLegend.shapeOffsets.x,",").concat(t.sizeLegend.shapeOffsets.y,") scale(").concat(n,")"):"translate(".concat(t.sizeLegend.shapeOffsets.x,",").concat(t.sizeLegend.shapeOffsets.y,")")}));var u=s+o.classifierSize_(o.classifierSize_.domain()[0])+t.sizeLegend.labelOffsets.x,h=t.sizeLegend.shapeOffsets.y/2+1;c.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("x",u).attr("y",h).text(r(e))}function Ky(t,e,n,i,r){var a=t.map,o=t.boxPadding,s=t.boxPadding+(t.sizeLegend.title?t.titleFontSize+t.sizeLegend.titlePadding:0)+t.sizeLegend._totalBarsHeight+10;t.sizeLegend._totalBarsHeight+=n+10;var l=Zy(t).size(n*n)(),c=t._sizeLegendContainer.append("g").attr("transform","translate(".concat(o,",").concat(s,")")).attr("class","em-size-legend-item");c.append("g").style("fill",(function(e){return a.classifierColor_?t.sizeLegend.shapeFill:a.psFill_})).style("fill-opacity",a.psFillOpacity()).style("stroke",t.sizeLegend.shapeStroke?t.sizeLegend.shapeStroke:a.psStroke()).style("stroke-width",a.psStrokeWidth()).attr("stroke","black").attr("stroke-width",.5).append("path").attr("d",l).attr("transform",(function(){return a.psCustomSVG_?"translate(".concat(t.sizeLegend.shapeOffsets.x,",").concat(t.sizeLegend.shapeOffsets.y,") scale(").concat(n,")"):"translate(".concat(t.sizeLegend.shapeOffsets.x,",").concat(t.sizeLegend.shapeOffsets.y,")")}));var u=o+a.psBarWidth_+t.sizeLegend.labelOffsets.x,h=n/2+t.sizeLegend.labelOffsets.y;c.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("x",u).attr("y",h).text(r(e))}function Zy(t){var e,n=t.map;if(n.psCustomSVG_)e=n.psCustomSVG_;else if(n.psCustomShape_)e=n.psCustomShape_;else if("bar"==n.psShape_){e=my().type({draw:function(t,e){var i=Math.sqrt(e);t.moveTo(0,0),t.lineTo(0,i),t.lineTo(n.psBarWidth_,i),t.lineTo(n.psBarWidth_,0),t.lineTo(0,0),t.closePath()}})}else{var i=Hy[n.psShape_]||Hy.circle;e=my().type(i)}return e}function Qy(t,e){var n=t.getCentroidsGroup(t).selectAll("[ecl]");n.each((function(t,e){Ft(this).style("opacity","0")})),n.filter("[ecl='"+e+"']").each((function(e,n){Ft(this).style("opacity",t.psFillOpacity_)}))}function tx(t){t.getCentroidsGroup(t).selectAll("[ecl]").each((function(e,n){Ft(this).style("opacity",t.psFillOpacity_)}))}var ex=function(t,e){var n=ax(t);if(n.sizeLegend={title:null,titlePadding:15,values:void 0,cellNb:3,shapePadding:5,shapeOffsets:{x:0,y:0},shapeFill:"white",shapeStroke:null,labelOffsets:{x:10,y:0},decimals:0,labelFormatter:void 0,noData:!1,noDataText:"No data",_totalBarsHeight:0,_totalD3SymbolsHeight:0},n.colorLegend={title:null,titlePadding:10,marginTop:30,shapeWidth:25,shapeHeight:20,shapePadding:1,labelOffsets:{x:5,y:0},decimals:0,labelFormatter:void 0,labelType:"thresholds",labels:null,noData:!0,noDataText:"No data",sepLineLength:24,sepLineStroke:"black",sepLineStrokeWidth:1,tickLength:5,pointOfDivergenceLabel:void 0,pointOfDivergence:void 0,pointOfDivergencePadding:7,divergingLineLength:void 0,divergingArrowLength:void 0},e)for(var i in e)if("colorLegend"==i||"sizeLegend"==i){for(var r in n[i])void 0!==e[i][r]&&(n[i][r]=e[i][r]);0==e.colorLegend&&(n.colorLegend=!1)}else n[i]=e[i];return n.update=function(){if(n.updateConfig(),n.updateContainer(),n.lgg.node()){n.lgg.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle(),n.sizeLegend._totalBarsHeight=0,n.sizeLegend._totalD3SymbolsHeight=0;var e=n.getBaseY(),i=n.getBaseX();if(t.classifierSize_&&Jy(n,i,e),t.classifierColor_&&n.colorLegend){var r=i,a=e;n._sizeLegendContainer&&(a+=n._sizeLegendContainer.node().getBBox().height+n.colorLegend.marginTop),Dv(n,r,a)}if(n.map.patternFill_){var o=n.lgg.node().getBBox().height,s=n.lgg.append("g").attr("class","pattern-fill-legend").attr("transform","translate(".concat(i,", ").concat(o+n.boxPadding+5,")"));ov(n,s)}n.setBoxDimension()}},n};function nx(t){if("ranges"==t.colorLegend.labelType){var e=function(t){var e=t.map,n=e.psThresholds_.length>1?e.psThresholds_:Array.from({length:e.psClasses_}).map((function(n,i){return e.classifier().invertExtent(i)[t.ascending?0:1]})).slice(1);return n}(t);return t.colorLegend.labelFormatter||function(n,i){var r=mn(".".concat(t.decimals,"f"));return 0===i?"> ".concat(r(e[e.length-1])):i===e.length?"< ".concat(r(e[0])):"".concat(r(e[e.length-i-1])," - < ").concat(r(e[e.length-i])," ")}}return t.colorLegend.labelType,t.colorLegend.labelFormatter||mn(".".concat(t.decimals,"f"))}function ix(t,e){var n=t.getCentroidsGroup(t).selectAll("[ecl]");n.each((function(t,e){Ft(this).style("opacity","0")})),n.filter("[ecl='"+e+"']").each((function(e,n){Ft(this).style("opacity",t.psFillOpacity_)}))}function rx(t){t.getCentroidsGroup(t).selectAll("[ecl]").each((function(e,n){Ft(this).style("opacity",t.psFillOpacity_)}))}var ax=function(t){var e={};function n(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new WeakSet,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=r.maxDepth||100;if(a.has(t))return t;if(a.add(t),o>s)return console.warn("Max recursion depth (".concat(s,") reached.")),t;for(var l in e)if(e.hasOwnProperty(l)&&t.hasOwnProperty(l)){var c=e[l],u=t[l];"function"==typeof c?t[l]=c:i(c)&&i(u)?n(u,c,r,a,o+1):Array.isArray(c)&&Array.isArray(u)?t[l]=r.mergeArrays?y(new Set([].concat(y(u),y(c)))):y(c):c instanceof Date?t[l]=new Date(c.getTime()):c instanceof RegExp?t[l]=new RegExp(c):c instanceof Map?t[l]=new Map(c):c instanceof Set?t[l]=new Set(c):t[l]=c}return t}function i(t){return"[object Object]"===Object.prototype.toString.call(t)}return e.map=t,e.svgId="legend_"+Math.round(1e16*Math.random()),e.svg=void 0,e.lgg=void 0,e.x=void 0,e.y=void 0,e.boxPadding=7,e.boxOpacity=.7,e.title="",e.titleFontSize=ra("em-legend-title"),e.width=150,e.titlePadding=5,e.shapeWidth=25,e.shapeHeight=20,e.shapePadding=5,e.labelFontSize=ra("em-legend-label"),e.labelOffsets={x:5,y:5},e.labelFormatter=null,wn({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),e.noData=!0,e.noDataText="No data",e.noDataPadding=5,e.noDataShapeWidth=25,e.noDataShapeHeight=20,e.ascending=!0,e.decimals=0,e.build=function(){e.svg=Ft("#"+e.svgId),e.svg.selectAll("#em-legend-"+e.svgId).remove(),e.lgg=e.svg.append("g").attr("id","em-legend-"+e.svgId).attr("class","em-legend")},e.update=function(){return console.log("Legend update function not implemented"),e},e.updateContainer=function(){var t=e.map;e.lgg.selectAll("*").remove(),e.svg.attr("id")!==t.legend_.svgId&&e.build()},e.updateConfig=function(){var t=e.map;t.legend_&&n(e,t.legend_)},e.makeBackgroundBox=function(){e.lgg.append("rect").attr("id","legendBR").attr("class","em-legend-background").style("opacity",e.boxOpacity)},e.addTitle=function(){if(e.title){var t=e.lgg.append("g").attr("id","em-legend-titles"),n=ra("em-legend-title");t.append("text").attr("class","em-legend-title").attr("x",e.boxPadding).attr("y",e.boxPadding+n).text(e.title)}},e.addSubtitle=function(){if(e.subtitle){var t=e.lgg.select("#em-legend-titles"),n=ra("em-legend-title"),i=ra("em-legend-subtitle");t.append("text").attr("class","em-legend-subtitle").attr("x",e.boxPadding).attr("y",e.boxPadding+n+i+3).text(e.subtitle)}},e.getBaseY=function(){return e.boxPadding+(e.title?ra("em-legend-title"):0)+(e.subtitle?ra("em-legend-subtitle"):0)+10},e.getBaseX=function(){return e.boxPadding},e.setBoxDimension=function(){if(e.lgg.node()){var t=e.lgg.node().getBBox({stroke:!0}),n=e.boxPadding;e.svg.select("#legendBR").attr("x",t.x-n).attr("y",t.y-n).attr("width",t.width+2*n).attr("height",t.height+2*n)}},e.appendNoDataLegend=function(t,n,i,r){var a=e.map;t.append("rect").attr("class","em-legend-rect").style("fill",a.noDataFillStyle()).attr("y",e.noDataPadding).attr("width",e.noDataShapeWidth).attr("height",e.noDataShapeHeight).on("mouseover",(function(){i(a,"nd"),a.insetTemplates_&&ua(a.insetTemplates_,a.svgId,i,"nd")})).on("mouseout",(function(){r(a),a.insetTemplates_&&ua(a.insetTemplates_,a.svgId,r,"nd")})),t.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("x",e.noDataShapeWidth+5).attr("y",e.noDataShapeHeight/2+e.noDataPadding).text(n)},e.getNumberOfClasses=function(t){var e=t.map;return"ps"===e._mapType?e.psClasses_:e.numberOfClasses_},e.getLabelFormatter=function(t){return"ps"===t.map._mapType?nx(t):Uv(t)},e.getClassToFillStyle=function(t){var e=t.map;return"ps"===e._mapType?e.psClassToFillStyle_:e.classToFillStyle_},e.getColorClassifier=function(t){var e=t.map;return"ps"===e._mapType?e.classifierColor_:e.classifier_},e.getHighlightFunction=function(t){return"ps"==t._mapType?ix:Wv},e.getUnHighlightFunction=function(t){return"ps"==t._mapType?rx:Hv},e},ox=function(t){var e,n,i;function r(){i=Ft("#"+t.div),i.empty()&&(i=Ft("body").append("div").attr("id",t.id)),i.attr("class","em-tooltip")}return(t=t||{}).containerId=t.containerId||t.svgId||"map",t.customElement=t.customElement,t.id=t.id||"em-tooltip-".concat(t.containerId),t.offset={x:(null===(e=t.offset)||void 0===e?void 0:e.x)||t.xOffset||30,y:(null===(n=t.offset)||void 0===n?void 0:n.y)||t.yOffset||20},t.transitionDuration=0,r.mouseover=function(e){if(i.html(e),e){var n=event.pageX,a=event.pageY;r.ensureTooltipOnScreen(n,a),i.interrupt().transition().duration(t.transitionDuration).style("opacity",1)}},r.mousemove=function(t){var e=t.pageX,n=t.pageY;this.ensureTooltipOnScreen(e,n)},r.mouseout=function(){i.interrupt().transition().duration(t.transitionDuration).style("opacity",0)},r.style=function(t,e){return 1==arguments.length?i.style(t):(i.style(t,e),r)},r.attr=function(t,e){return 1==arguments.length?i.attr(t):(i.attr(t,e),r)},r.ensureTooltipOnScreen=function(e,n){var r=i.node();r.style.left=e+t.offset.x+"px",r.style.top=n-t.offset.y+"px";var a=document.getElementById(t.containerId).getBoundingClientRect(),o=a.width,s=a.height;if(r.offsetLeft>a.left+o-r.clientWidth){var l=e-r.clientWidth-t.offset.x;if(r.style.left=l+"px",r.offsetLeft+r.clientWidth>e){var c=e-r.clientWidth-t.offset.x;r.style.left=c+"px"}}r.offsetTop+r.clientHeight>a.top+s&&(r.style.top=r.offsetTop-r.clientHeight+"px")},r(),r},sx=function(t,e,n){var i=Jm(t,e,n);if(i.stat_={default:void 0},i.stat=function(t,e){return arguments.length?2==arguments.length?(i.stat_[t]=e,i):"string"==typeof t||t instanceof String?i.stat_[t]:(i.stat_=t.default?t:{default:t},i):i.stat_.default},i.statData_={default:av(),color:av(),size:av(),v1:av(),v2:av(),v3:av()},i.statData=function(t,e){return arguments.length?1===arguments.length?(i.statData_[t]||(i.statData_[t]=av()),i.statData_[t]):(i.statData_[t]=e,i):i.statData_.default},i.noDataText_="No data available",i.language_="en",i.transitionDuration_=500,i.tooltip_.textFunction=void 0,i.filtersDefinitionFunction_=void 0,i.callback_=void 0,i.legend_=void 0,i.legendObj_=void 0,["legend_","legendObj_","noDataText_","language_","transitionDuration_","tooltipText_","filtersDefinitionFunction_","callback_"].forEach((function(t){i[t.substring(0,t.length-1)]=function(e){return arguments.length?(i[t]=e,i):i[t]}})),t)for(var r in t)i[r]&&null!=t[r]&&i[r](t[r]);i.legend=function(t){if(!arguments.length)return i.legend_;if(0==t){var e=i.legendObj();if(e){var n=Ft("#"+e.svgId);n.size()>0&&n.selectAll("*").remove()}return i.legend_=t,i}return i.legend_=t,i.legendObj_&&i.updateLegend(),i},i.updateLegend=function(t){return i.legendObj_&&i.legendObj().update(),i},i.build=function(){return i.projectionFunction_&&i.proj("4326"),i.buildMapTemplateBase(),i.filtersDefinitionFunction_&&i.filtersDefinitionFunction_(i.svg(),i.numberOfClasses_),i.legend()&&i.buildLegend(),i.tooltip_||i.tooltip_||(i.tooltip_={id:i.svgId()}),i._tooltip=ox(i.tooltip_),i.updateGeoData(),i.updateStatData(),i},i.buildLegend=function(){i.legendObj(i.getLegendConstructor()(i,i.legend()));var t=i.legendObj();if(0==Ft("#"+t.svgId).size()){var e=null==t.x?i.width()-100-t.boxPadding:t.x,n=null==t.y?t.boxPadding:t.y;i.svg().append("g").attr("id",t.svgId).attr("class","em-legend").attr("transform","translate("+e+","+n+")")}t.build()};var a=function(){for(var t in i.statData_){var e=!!i.stat_[t],n=!(!i.statData_[t]||!i.statData_[t].get());if((e||n)&&!i.statData_[t].isReady())return!1}return!0};return i.updateGeoData=function(){return i.updateGeoMapTemplate((function(){a()&&(i.updateStatValues(),i.callback()&&i.callback()(i))})),i},i.updateStatData=function(){for(var t in i.stat_){var e,n,r=i.stat(t),o=null===(e=(n=i.statData(t)).get)||void 0===e?void 0:e.call(n);if((r||o)&&r){var s=av(r);i.statData(t,s);var l=i.nutsLevel_;"mixed"===l&&(l=0),s.retrieveFromRemote(l,i.language(),(function(){i.Geometries.isGeoReady()&&a()&&(i.updateStatValues(),i.callback()&&i.callback()(i))}))}}return i},i.updateStatValues=function(){return e&&i.refreshCentroids(i),i.updateClassification(),i.updateStyle(),i.legend_&&i.legendObj()&&i.legendObj().update(),i},i.updateClassification=function(){return console.log("Map updateClassification function not implemented"),i},i.updateStyle=function(){return console.log("Map updateStyle function not implemented"),i},i.getLegendConstructor=function(){return console.log("Map getLegendConstructor function not implemented"),ax},i.getTime=function(){return i.statData("default").getTime()},i.setFromURL=function(){var t=lx();return t.w&&i.width(t.w),t.h&&i.height(t.h),t.x&&t.y&&i.geoCenter([t.x,t.y]),t.z&&i.pixelSize(t.z),t.s&&i.scale(t.s),t.lvl&&i.nutsLevel(t.lvl),t.time&&(i.filters_.time=t.time,delete i.filters_.lastTimePeriod),t.proj&&i.proj(t.proj),t.geo&&i.geo(t.geo),t.ny&&i.nutsYear(t.ny),t.language&&i.language(t.language),t.numberOfClasses&&i.numberOfClasses(+t.numberOfClasses),i},i.exportMapToSVG=function(){var t=i.svg_.node().cloneNode(!0);t.hasAttribute("xmlns")||t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.hasAttribute("xmlns:xlink")||t.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),document.body.appendChild(t),sa(t),document.body.removeChild(t);var e=function(t){var e='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'+t.outerHTML,n=new Blob([e],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(n)}(t),n=document.createElement("a");return n.href=e,n.download="eurostatmap.svg",document.body.appendChild(n),n.click(),document.body.removeChild(n),i},i.exportMapToPNG=function(t,e){var n=i.svg_.node().cloneNode(!0);sa(n);var r=(new XMLSerializer).serializeToString(n),a=new Blob([r],{type:"image/svg+xml;charset=utf-8"}),o=URL.createObjectURL(a);if(t=t||n.getAttribute("width"),e=e||n.getAttribute("height"),!t||!e)throw new Error("SVG width or height attributes are missing or invalid.");var s=new Image;return s.onload=function(){var n=document.createElement("canvas");n.width=parseFloat(t),n.height=parseFloat(e),n.getContext("2d").drawImage(s,0,0,n.width,n.height),n.toBlob((function(t){var e=URL.createObjectURL(t),n=document.createElement("a");n.href=e,n.download="eurostat-map.png",document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(o),URL.revokeObjectURL(e)}),"image/png")},s.src=o,i},i},lx=function(){for(var t={},e=["w","h","x","y","z","s","lvl","time","proj","geo","ny","language","sl","numberOfClasses"],n=0;n<e.length;n++)t[e[n]]=getURLParameterByName(e[n]);return t};function cx(t){return t.slice().sort((function(t,e){return t-e}))}function ux(t,e){for(var n=[],i=0;i<t;i++){for(var r=[],a=0;a<e;a++)r.push(0);n.push(r)}return n}function hx(t,e,n,i){var r;if(t>0){var a=(n[e]-n[t-1])/(e-t+1);r=i[e]-i[t-1]-(e-t+1)*a*a}else r=i[e]-n[e]*n[e]/(e+1);return r<0?0:r}function fx(t,e,n,i,r,a,o){if(!(t>e)){var s=Math.floor((t+e)/2);i[n][s]=i[n-1][s-1],r[n][s]=s;var l=n;t>n&&(l=Math.max(l,r[n][t-1]||0)),l=Math.max(l,r[n-1][s]||0);var c,u,h,f=s-1;e<i[0].length-1&&(f=Math.min(f,r[n][e+1]||0));for(var p=f;p>=l&&!((c=hx(p,s,a,o))+i[n-1][l-1]>=i[n][s]);--p)(u=hx(l,s,a,o)+i[n-1][l-1])<i[n][s]&&(i[n][s]=u,r[n][s]=l),l++,(h=c+i[n-1][p-1])<i[n][s]&&(i[n][s]=h,r[n][s]=p);fx(t,s-1,n,i,r,a,o),fx(s+1,e,n,i,r,a,o)}}function px(t,e){if(e>t.length)throw new Error("cannot generate more classes than there are data values");var n=cx(t),i=function(t){for(var e,n=0,i=0;i<t.length;i++)0!==i&&t[i]===e||(e=t[i],n++);return n}(n);if(1===i)return[n];var r=ux(e,n.length),a=ux(e,n.length);!function(t,e,n){for(var i=e[0].length,r=t[Math.floor(i/2)],a=[],o=[],s=0,l=void 0;s<i;++s)l=t[s]-r,0===s?(a.push(l),o.push(l*l)):(a.push(a[s-1]+l),o.push(o[s-1]+l*l)),e[0][s]=hx(0,s,a,o),n[0][s]=0;for(var c=1;c<e.length;++c)fx(c<e.length-1?c:i-1,i-1,c,e,n,a,o)}(n,r,a);for(var o=[],s=a[0].length-1,l=a.length-1;l>=0;l--){var c=a[l][s];o[l]=n.slice(c,s+1),l>0&&(s=c-1)}return o}function dx(t,e){if(e>t.length)return null;t=t.slice().sort((function(t,e){return t-e}));var n=function(t,e){var n,i,r=[],a=[],o=0;for(n=0;n<t.length+1;n++){var s=[],l=[];for(i=0;i<e+1;i++)s.push(0),l.push(0);r.push(s),a.push(l)}for(n=1;n<e+1;n++)for(r[1][n]=1,a[1][n]=0,i=2;i<t.length+1;i++)a[i][n]=Number.POSITIVE_INFINITY;for(var c=2;c<t.length+1;c++){for(var u=0,h=0,f=0,p=0,d=1;d<c+1;d++){var g=c-d+1,_=t[g-1];if(o=(h+=_*_)-(u+=_)*u/++f,0!=(p=g-1))for(i=2;i<e+1;i++)a[c][i]>=o+a[p][i-1]&&(r[c][i]=g,a[c][i]=o+a[p][i-1])}r[c][1]=1,a[c][1]=o}return{lowerClassLimits:r,varianceCombinations:a}}(t,e);return function(t,e,n){var i=t.length,r=[],a=n;for(r[n]=t[t.length-1];a>0;)r[a-1]=t[e[i][a]-1],i=e[i][a]-1,a--;return r}(t,n.lowerClassLimits,e)}var gx=function(){this.totalCount=0,this.data={}};gx.prototype.train=function(t,e){for(var n in this.data[e]||(this.data[e]={}),t){var i=t[n];void 0===this.data[e][n]&&(this.data[e][n]={}),void 0===this.data[e][n][i]&&(this.data[e][n][i]=0),this.data[e][n][i]++}this.totalCount++},gx.prototype.score=function(t){var e,n={};for(var i in t){var r=t[i];for(e in this.data)n[e]={},this.data[e][i]?n[e][i+"_"+r]=(this.data[e][i][r]||0)/this.totalCount:n[e][i+"_"+r]=0}var a={};for(e in n)for(var o in a[e]=0,n[e])a[e]+=n[e][o];return a};var _x=function(){this.weights=[],this.bias=0};_x.prototype.predict=function(t){if(t.length!==this.weights.length)return null;for(var e=0,n=0;n<this.weights.length;n++)e+=this.weights[n]*t[n];return(e+=this.bias)>0?1:0},_x.prototype.train=function(t,e){if(0!==e&&1!==e)return null;t.length!==this.weights.length&&(this.weights=t,this.bias=1);var n=this.predict(t);if("number"==typeof n&&n!==e){for(var i=e-n,r=0;r<this.weights.length;r++)this.weights[r]+=i*t[r];this.bias+=i}return this};Math.log(Math.sqrt(2*Math.PI));Math.sqrt(2*Math.PI);var mx=Math.sqrt(2*Math.PI);function vx(t){for(var e=t,n=t,i=1;i<15;i++)e+=n*=t*t/(2*i+1);return Math.round(1e4*(.5+e/mx*Math.exp(-t*t/2)))/1e4}for(var yx=[],xx=0;xx<=3.09;xx+=.01)yx.push(vx(xx));var bx=function(t){var e=sx(t,!1,"ch");e.numberOfClasses_=7,e.classificationMethod_="quantile",e.thresholds_=[0],e.colors_=null,e.makeClassifNice_=!0;var n=["#E9ECF6","#D4DAF0","#C1C9EB","#A8B4E6","#93A2DC","#7C90D6","#677CD2","#5169BE","#3C57B0","#2644A7","#15246B","#081132"];function i(t){var n=function(t){return y(Array(t).keys())},i=e.statData().getArray(),r=function(t){t.attr("ecl",(function(t){var n=e.statData().get(t.properties.id);if(n){var i=n.value;return":"===i||null===i?"nd":"continuous"===e.colorSchemeType_?i:null!=i?+e.classifier_(i):void 0}}))};if(function(){var t=n(e.numberOfClasses_);if("continuous"===e.colorSchemeType_){var r,a=e.valueTransform_||function(t){return t},o=i.map(a),s=Ot(o),l=Gt(o),c=function(t){return null!==t.pointOfDivergence_}(e);if(!("function"==typeof(null===(r=e.colorFunction_)||void 0===r?void 0:r.domain)))if(c){var u,h=a(null!==(u=e.pointOfDivergence_)&&void 0!==u?u:0);e.domain_=[s,h,l]}else e.domain_=[s,l];e.classifier((function(t){return t}))}switch(e.classificationMethod_){case"quantile":e.classifier(Vt().domain(i).range(t));break;case"equal-interval":case"equinter":e.classifier(Cn().domain([Ot(i),Gt(i)]).range(t)),e.makeClassifNice_&&e.classifier().nice();break;case"threshold":e.numberOfClasses(e.thresholds_.length+1),e.classifier(An().domain(e.thresholds_).range(n(e.numberOfClasses_)));break;case"jenks":var f=dx(i,e.numberOfClasses_).slice(1,-1);e.classifier(An().domain(f).range(t));break;case"ckmeans":var p=px(i,e.numberOfClasses_).map((function(t){return t.pop()})).slice(0,-1);e.classifier(An().domain(p).range(t))}}(),t.svg_){var a=pa(t);if(r(t.svg().selectAll(a)),"mixed"===t.nutsLevel_)r(t.svg().selectAll("path.em-nutsrg0"))}}function r(t){if(e.filtersDefinitionFunction_?e.classToFillStyle(Sx()):e.classToFillStyle(wx(e.colorFunction_,e.colors_)),t.svg_){var n=pa(t),i=t.svg().selectAll(n);i.style("pointer-events","none").transition().duration(e.transitionDuration()).style("fill",o).end().then((function(){i.style("pointer-events",null),i.each((function(){var t=Ft(this);t.attr("fill___",t.style("fill"))})),s(t,i),e.gridCartogram_&&t.svg().selectAll(".em-grid-text").each((function(){var t=Ft(this.parentNode).style("fill");Ft(this).attr("fill",fa(t))}))})).catch((function(t){})),"mixed"===e.nutsLevel_&&a(t),e.labels_&&e.labels_.values&&e.updateValuesLabels(t),e.patternFill_&&vy(t,e.patternFill_)}}e.colorFunction_=function(t){return function(t,e){void 0===e&&(e=t,t=Ye);for(var n=0,i=e.length-1,r=e[0],a=new Array(i<0?0:i);n<i;)a[n]=t(r,r=e[++n]);return function(t){var e=Math.max(0,Math.min(i-1,Math.floor(t*=i)));return a[e](t-e)}}(Yn,n)(Math.min(Math.max(0,t),1))},e.classToFillStyle_=void 0,e.classifier_=void 0,e.tooltip_.textFunction=Mx,e.colorSchemeType_="discrete",e.valueTransform_=function(t){return t},e.valueUntransform_=function(t){return t},e.pointOfDivergence_=null,["numberOfClasses_","classificationMethod_","thresholds_","makeClassifNice_","colorFunction_","classToFillStyle_","noDataFillStyle_","classifier_","colors_","colorFunction_","colorSchemeType_","valueTransform_","valueUntransform_","pointOfDivergence_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),e.colorFunction=function(t){if(!arguments.length)return e.colorFunction_;if(e.colorFunction_=t,e.filtersDefinitionFunction_)e.classToFillStyle(Sx());else{var n=wx(e.colorFunction_,e.colors_,e.colorSchemeType_);e.classToFillStyle(n)}return e},e.threshold=function(t){return arguments.length?(e.thresholds_=t,e.numberOfClasses(t.length+1),e):e.thresholds_},e.filtersDefinitionFunction=function(t){return arguments.length?(e.filtersDefinitionFunction_=t,e.svg()&&e.filtersDefinitionFunction_(e.svg(),e.numberOfClasses_),e):e.filtersDefinitionFunction_},t&&["numberOfClasses","classificationMethod","threshold","makeClassifNice","colorFunction","classToFillStyle","noDataFillStyle","colors"].forEach((function(n){null!=t[n]&&e[n](t[n])})),e.updateClassification=function(){try{return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,i),i(e),e}catch(t){console.error("Error in updateClassification:",t.message),console.error(t)}},e.updateStyle=function(){try{return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,r),r(e),e}catch(t){console.error("Error in updateStyle:",t.message),console.error(t)}},e.getLegendConstructor=function(){return Bv};var a=function(t){t.svg().selectAll(pa(t)).each((function(){if(!this.parentNode.classList.contains("em-cntrg")){var t=Ft(this),e=t.attr("ecl"),n=t.attr("lvl"),i=e||"0"===n;if(t.style("display",i?"block":"none"),e&&"0"!==n){var r=t.style("stroke")||"#777",a=t.style("stroke-width")||.2;t.style("stroke",r).style("stroke-width",a)}}}))};var o=function(t){var n,i=Ft(this).attr("ecl"),r=e.colorSchemeType_||"discrete";if(i||"0"===i)return"nd"===i?e.noDataFillStyle_||"gray":e.filtersDefinitionFunction_?e.classToFillStyle_(i):"continuous"===r?function(t,e){var n,i=e.colorFunction_,r=e.domain_||[0,1],a="function"==typeof(null==i?void 0:i.domain),o=e.valueTransform_||function(t){return t},s=o(t);if(isNaN(s))return e.noDataFillStyle_||"gray";if(a)return i(s);if(3===r.length){var l,c=v(r,3),u=c[0],h=c[2],f=o(null!==(l=e.pointOfDivergence_)&&void 0!==l?l:0);n=s<f?.5*(s-u)/(f-u):.5+.5*(s-f)/(h-f)}else{var p=v(r,2),d=p[0];n=(s-d)/(p[1]-d)}return i(Math.min(Math.max(n,0),1))}(+i,e):null!==(n=e.Geometries)&&void 0!==n&&n.userGeometries?e.classToFillStyle_(i,e.numberOfClasses_||1):"WORLD"===e.geo_?e.classToFillStyle_(i,e.numberOfClasses_||1)||e.cntrgFillStyle_:e.classToFillStyle_(i,e.numberOfClasses_||1)},s=function(t,n){var i=function(e){var n;return null===(n=t.tooltip_.omitRegions)||void 0===n?void 0:n.includes(e)};n.on("mouseover",(function(n,r){i(r.properties.id)||(Ft(this).style("fill",t.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(r,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,r,this,t))})).on("mousemove",(function(n,r){i(r.properties.id)||(e._tooltip&&e._tooltip.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,r,this,t))})).on("mouseout",(function(n,r){if(!i(r.properties.id)){var a=Ft(this);a.style("fill",a.attr("fill___")),e._tooltip&&e._tooltip.mouseout(),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,r,this,t)}}))};return e.highlightRegion=function(t){if(!e.svg_)return e;var n=pa(e),i=e.svg().selectAll(n).filter((function(e){return e.properties.id===t}));if(!i.empty()){var r=i.datum();if(i.style("fill",e.hoverColor_||"orange"),e._tooltip){var a=e.tooltip_.textFunction(r,e);e._tooltip.mouseover(a);var o=i.node().getBBox(),s=e.__lastTransform||{x:0,y:0,k:1},l=(o.x+o.width/2)*s.k+s.x,c=(o.y+o.height/2)*s.k+s.y,u=e.svg().node().getBoundingClientRect(),h=u.left+l,f=u.top+c;e._tooltip.ensureTooltipOnScreen(h,f)}e.onRegionMouseOver_&&e.onRegionMouseOver_(null,r,i.node(),e)}return e},e.clearHighlight=function(){if(!e.svg_)return e;var t=pa(e);return e.svg().selectAll(t).each((function(){var t=Ft(this),e=t.attr("fill___");e&&t.style("fill",e)})),e._tooltip&&e._tooltip.mouseout(),e},e},wx=function(t,e){return t=t||Pn,"continuous"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"discrete")?function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1],i=(e-n[0])/(n[1]-n[0]);return t(Math.min(Math.max(i,0),1))}:e?function(t,n){return e[t]}:function(e,n){return t(e/(n-1))}},Sx=function(){return function(t){return"url(#pattern_"+t+")"}},Mx=function(t,e){if(e.tooltip_.omitRegions&&e.tooltip_.omitRegions.includes(t.properties.id))return"";var n=[],i=t.properties.na||t.properties.name,r=t.properties.id;n.push('\n <div class="em-tooltip-bar">\n <b>'.concat(i,"</b>").concat(r?" (".concat(r,")"):"","\n </div>\n "));var a=e.statData(),o=a.get(r),s=a.unitText()||"";if(!o||0!==o.value&&!o.value||":"===o.value)return n.push('\n <div class="em-tooltip-text no-data">\n <table class="em-tooltip-table">\n <tbody>\n <tr><td>'.concat(e.noDataText_,"</td></tr>\n </tbody>\n </table>\n </div>\n ")),n.join("");n.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr><td>'.concat(la(o.value)," ").concat(s,"</td></tr>\n </tbody>\n </table>\n </div>\n "));var l=o.status;if(l&&e.tooltip_.showFlags){var c="short"===e.tooltip_.showFlags?l:flags[l]||l;n.push(' <span class="status-flag">'.concat(c,"</span>"))}return n.join("")};const Ex=kn("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");var Cx=function(t,e){var n=ax(t);if(n.order=void 0,e)for(var i in e)n[i]=e[i];function r(t,e){var n=da(t),i=t.svg_.selectAll(n).selectAll("[ecl]");i.style("fill","white"),i.filter("[ecl='"+e+"']").each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}function a(t){var e=da(t);t.svg_.selectAll(e).selectAll("[ecl]").each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}return n.update=function(){if(n.updateConfig(),n.updateContainer(),n.lgg.node()&&n.map.classifier_){n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle();var t=n.getBaseY(),e=n.getBaseX();if(n._categoricalContainer=n.lgg.append("g").attr("class","em-legend-categorical").attr("transform","translate(".concat(e,", ").concat(t,")")),function(t){for(var e=t._categoricalContainer,n=t.map,i=n.classToFillStyle()?Object.keys(n.classToFillStyle()):n.classifier_.domain(),o=t.order?t.order:i,s=function(){var i=o[l],s=n.classifier_(i),c=n.classToFillStyle_[i],u=t.titlePadding+l*(t.shapeHeight+t.shapePadding);e.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",u).attr("width",t.shapeWidth).attr("height",t.shapeHeight).style("fill",c).on("mouseover",(function(){r(t.map,s),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.svgId_,r,s)})).on("mouseout",(function(){a(t.map),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.svgId_,a,s)})),e.append("text").attr("class","em-legend-label").attr("x",t.shapeWidth+t.labelOffsets.x).attr("y",u+.5*t.shapeHeight).attr("dy","0.35em").text(n.classToText()?n.classToText()[i]:i)},l=0;l<o.length;l++)s()}(n),n.map.patternFill_){var i=n.lgg.node().getBBox().height,o=n.lgg.append("g").attr("class","pattern-fill-legend").attr("transform","translate(".concat(e,", ").concat(i+15,")"));ov(n,o)}if(n.noData){var s=n.lgg.node().getBBox().height+10,l=e,c=n.lgg.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(l,",").concat(s+15,")"));n.appendNoDataLegend(c,n.noDataText,r,a)}n.setBoxDimension()}},n},Ax=function(t,e){var n=[];t.properties.id?n.push('<div class="em-tooltip-bar">'+t.properties.na+" ("+t.properties.id+") </div>"):n.push('<div class="em-tooltip-bar">'+t.properties.na+"</div>");var i=e.statData().get(t.properties.id);if(!i||0!=i.value&&!i.value)return n.push(e.noDataText_),n.join("");var r=i.value;if(e.classToText_){var a=e.classToText_[r];return n.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>\n '.concat(a||r,"\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n")),n.join("")}return n.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>\n '.concat(r,"\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n")),n.join("")},kx=Array.prototype.slice;function Tx(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Px(t){this._context=t}function Nx(t){return new Px(t)}function Lx(t){return t[0]}function Fx(t){return t[1]}function Ox(t,e){var n=ur(!0),i=null,r=Nx,a=null,o=Tr(s);function s(s){var l,c,u,h=(s=Tx(s)).length,f=!1;for(null==i&&(a=r(u=o())),l=0;l<=h;++l)!(l<h&&n(c=s[l],l,s))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+t(c,l,s),+e(c,l,s));if(u)return a=null,u+""||null}return t="function"==typeof t?t:void 0===t?Lx:ur(t),e="function"==typeof e?e:void 0===e?Fx:ur(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:ur(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:ur(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:ur(!!t),s):n},s.curve=function(t){return arguments.length?(r=t,null!=i&&(a=r(i)),s):r},s.context=function(t){return arguments.length?(null==t?i=a=null:a=r(i=t),s):i},s}Px.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var Gx=function(t,e){var n=ax(t);if(n.squareSize=100,n.rotation=0,n.label1="Variable 1",n.label2="Variable 2",n.axisTitleFontSize=ra("em-bivariate-axis-title"),n.breaks1=void 0,n.breaks2=void 0,n.showBreaks=!1,n.tickLength=5,n.yAxisLabelsOffset={x:0,y:0},n.xAxisLabelsOffset={x:0,y:0},n.yAxisTitleOffset={x:0,y:0},n.xAxisTitleOffset={x:0,y:0},n.boxPadding=n.labelFontSize,n.noDataYOffset=30,n.axisArrows=!0,n.arrowHeight=15,n.arrowWidth=14,n.arrowPadding=10,e)for(var i in e)n[i]=e[i];function r(t,e,n){var i=da(t),r=t.svg_.selectAll(i).selectAll("[ecl1]");r.style("fill","white"),r.filter("[ecl1='".concat(e,"']")).filter("[ecl2='".concat(n,"']")).each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}function a(t){var e=da(t);t.svg_.selectAll(e).selectAll("[ecl1]").each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}return n.update=function(){if(n.updateConfig(),n.updateContainer(),n._horizontalOffset=n.axisTitleFontSize+n.arrowPadding,n.lgg.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle(),n._y=n.boxPadding+(n.title?n.titleFontSize+n.boxPadding:0),function(){for(var t=n.lgg,e=n.map.numberOfClasses(),i=n.squareSize/e,o=0===n.rotation?0:.7071*n.squareSize+n.boxPadding,s=0,l=t.append("g").attr("class","bivariate-squares-chart").attr("transform","translate(".concat(n.boxPadding+n._horizontalOffset,",").concat(o+n._y,") rotate(").concat(n.rotation,") translate(").concat(n.boxPadding,",0)")),c=0;c<e;c++)for(var u=function(){var t=e-c-1,o=e-h-1,u=n.map.classToFillStyle()(t,o);l.append("rect").attr("class","em-bivariate-square").attr("x",s+(e-1-c)*i).attr("y",h*i).attr("width",i).attr("height",i).style("fill",u).on("mouseover",(function(){r(n.map,t,o),n.map.insetTemplates_&&ua(n.map.insetTemplates_,n.map.svgId,r,t,o),Ft(this).raise()})).on("mouseout",(function(){a(n.map),n.map.insetTemplates_&&ua(n.map.insetTemplates_,n.map.svgId,a,t,o)}))},h=0;h<e;h++)u();l.append("rect").attr("class","em-bivariate-frame").attr("x",s).attr("y",0).attr("width",n.squareSize).attr("height",n.squareSize).attr("stroke-width",.7)}(),!n.breaks1&&!n.breaks2&&n.showBreaks){var e=t.classifier1_;"function"==typeof e.quantiles?n.breaks1=e.quantiles().map((function(t){return parseFloat(t.toFixed(0))})):e.domain&&(n.breaks1=e.domain().map((function(t){return parseFloat(t.toFixed(0))})));var i=t.classifier2_;"function"==typeof i.quantiles?n.breaks2=i.quantiles().map((function(t){return parseFloat(t.toFixed(0))})):i.domain&&(n.breaks2=i.domain().map((function(t){return parseFloat(t.toFixed(0))})))}var o,s;!function(){var t=0===n.rotation?0:.7071*n.squareSize+n.boxPadding,e=0,i=n.map.numberOfClasses(),r=n.squareSize/i,a=n.lgg.append("g").attr("class","bivariate-break-labels").attr("transform","translate(".concat(n.boxPadding+n._horizontalOffset,",").concat(t+n._y,") rotate(").concat(n.rotation,") translate(").concat(n.boxPadding,",0)"));if(n.breaks1)for(var o=0;o<n.breaks1.length;o++){var s=e+r*(o+1),l=n.squareSize+ra("em-bivariate-tick-label");a.append("text").attr("class","em-bivariate-tick-label").attr("x",s+n.xAxisLabelsOffset.x).attr("y",l+n.xAxisLabelsOffset.y).text(n.breaks1[o]),a.append("line").attr("class","em-bivariate-tick").attr("x1",s).attr("x2",s).attr("y1",n.squareSize).attr("y2",n.squareSize+n.tickLength)}if(n.breaks2)for(var c=0;c<n.breaks2.length;c++){var u=e,h=r*(c+2)-r;a.append("text").attr("class","em-bivariate-tick-label").attr("x",u+n.yAxisLabelsOffset.x).attr("y",h-n.yAxisLabelsOffset.y-(n.tickLength+2)).text(y(n.breaks2).reverse()[c]).attr("text-anchor","middle").attr("transform","rotate(-90, ".concat(u,", ").concat(h,")")),a.append("line").attr("class","em-bivariate-tick").attr("x1",u).attr("x2",u-n.tickLength).attr("y1",h).attr("y2",h)}}(),n._xAxisArrowY=0,n._yAxisArrowX=0,n.axisArrows&&function(){var t=0===n.rotation?0:.7071*n.squareSize+n.boxPadding,e=0,i=n.lgg.append("g").attr("class","bivariate-axis-arrows").attr("transform","translate(".concat(n.boxPadding+n._horizontalOffset,",").concat(t+n._y,") rotate(").concat(n.rotation,") translate(").concat(n.boxPadding,",0)"));n._xAxisArrowY=n.squareSize+n.tickLength+n.arrowPadding,(n.showBreaks||n.breaks1&&n.breaks2)&&(n._xAxisArrowY+=ra("em-bivariate-tick-label")/1.5);i.append("path").attr("class","em-bivariate-axis-arrow").attr("d",Ox()([[e,n._xAxisArrowY],[e+n.squareSize,n._xAxisArrowY]])).attr("stroke","black").attr("marker-end","url(#arrowhead)"),n._yAxisArrowX=-n.tickLength-n.arrowPadding,(n.showBreaks||n.breaks1&&n.breaks2)&&(n._yAxisArrowX-=n.labelFontSize/2);i.append("path").attr("class","em-bivariate-axis-arrow").attr("d",Ox()([[n._yAxisArrowX,n.squareSize],[n._yAxisArrowX,0]])).attr("stroke","black").attr("marker-end","url(#arrowhead)")}(),function(){var t=0===n.rotation?0:.7071*n.squareSize+n.boxPadding,e=0,i=n.lgg.append("g").attr("class","bivariate-axis-titles").attr("transform","translate(".concat(n.boxPadding+n._horizontalOffset,",").concat(t+n._y,") rotate(").concat(n.rotation,") translate(").concat(n.boxPadding,",0)")),r=n.squareSize+n.xAxisLabelsOffset.y+(n.axisArrows?n.arrowPadding+n.arrowHeight:7),a=e;(n.showBreaks||n.breaks1&&n.breaks2)&&(r+=ra("em-bivariate-tick-label"));n.xAxisTitleOffset&&(r+=n.xAxisTitleOffset.y);n.xAxisTitleOffset&&(a+=n.xAxisTitleOffset.x);i.append("text").attr("class","em-bivariate-axis-title em-bivariate-axis-title-x").attr("x",a).attr("y",r).text(n.label1).attr("dominant-baseline","hanging").attr("alignment-baseline","hanging");var o=(n.axisArrows?n._yAxisArrowX-n.arrowPadding:7)+(-45==n.rotation?-4:-10);(n.showBreaks||n.breaks1&&n.breaks2)&&(r+=ra("em-bivariate-tick-label"));var s=-n.squareSize;n.yAxisTitleOffset&&(o+=n.yAxisTitleOffset.y);n.yAxisTitleOffset&&(s+=n.yAxisTitleOffset.x);i.append("text").attr("class","em-bivariate-axis-title em-bivariate-axis-title-y").attr("x",s).attr("y",o).text(n.label2).style("transform",n.rotation<0?"translate(".concat(n.axisArrows?-51:-15,"px, 95px) rotate(90deg)"):"rotate(-90deg)")}(),n.lgg.append("defs").append("marker").attr("viewBox","0 0 ".concat(n.arrowWidth," ").concat(n.arrowHeight)).attr("id","arrowhead").attr("refX",0).attr("refY",5).attr("markerWidth",n.arrowWidth).attr("markerHeight",n.arrowHeight).attr("orient","auto").append("path").attr("d","M 0 0 L 5 5 L 0 10").attr("marker-units","strokeWidth"),n.noData&&(o=0===n.rotation?n.noDataYOffset+n.squareSize/n.map.numberOfClasses_+n.arrowHeight/2:n.noDataYOffset,s=0===n.rotation?n._y+n.squareSize+o:n._y+1.4142*n.squareSize+2*n.boxPadding+o,n.lgg.append("rect").attr("class","em-bivariate-nodata").attr("x",n.boxPadding+n.noDataShapeWidth/2).attr("y",s+(0==n.rotation?0:-10)).attr("width",n.noDataShapeWidth).attr("height",n.noDataShapeHeight).style("fill",n.map.noDataFillStyle()).on("mouseover",(function(){("mixed"==n.map.nutsLevel_?va("#em-nutsrg"):Ft("#em-nutsrg")).selectAll("[nd='nd']").style("fill","red")})).on("mouseout",(function(){("mixed"==n.map.nutsLevel_?va("#em-nutsrg"):Ft("#em-nutsrg")).selectAll("[nd='nd']").style("fill",(function(){return Ft(this).attr("fill___")})),Ft(this).style("fill",n.map.noDataFillStyle())})),n.lgg.append("text").attr("class","em-bivariate-nodata-label").attr("x",n.boxPadding+n.noDataShapeWidth+(n.noDataShapeWidth/2+5)).attr("y",s+.5*n.noDataShapeHeight+1+(0==n.rotation?0:-10)).text(n.noDataText)),n.setBoxDimension()},n},Dx=function(t,e,n,i,r){for(var a=[],o=Ie(e,n),s=Ie(i,r),l=0;l<t;l++){for(var c=l/(t-1),u=Ie(o(c),s(c)),h=[],f=0;f<t;f++)h.push(u(f/(t-1)));a.push(h)}return function(t,e){return a[t][e]}},zx=function(t,e){var n=[],i=t.properties.na||t.properties.name;t.properties.id?n.push('<div class="em-tooltip-bar" >'+i+" ("+t.properties.id+") </div>"):n.push('<div class="em-tooltip-bar" >'+i+"</div>");var r=e.statData("v1").get(t.properties.id),a=e.statData("v1").unitText(),o=e.statData("v2").get(t.properties.id),s=e.statData("v2").unitText();return n.push('\n <div class="em-tooltip-text" style="background: #ffffff;color: #171a22;padding: 4px;font-size:15px;">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>\n '.concat(r&&r.value?la(r.value):""," ").concat(a&&r&&r.value?a:"","\n ").concat(!r||0!=r.value&&!r.value?e.noDataText_:"","\n </td>\n </tr>\n <tr>\n <td>\n ").concat(o&&o.value?la(o.value):""," ").concat(s&&o&&o.value?s:"","\n ").concat(!o||0!=o.value&&!o.value?e.noDataText_:"","\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n ")),n.join("")},Ix=function(t,e){var n=ax(t);if(n.width=(null==e?void 0:e.width)||150,n.fontSize=(null==e?void 0:e.fontSize)||12,n.padding=(null==e?void 0:e.padding)||2,n.topText=(null==e?void 0:e.topText)||"Variable 1",n.leftText=(null==e?void 0:e.leftText)||"Variable 2",n.rightText=(null==e?void 0:e.rightText)||"Variable 3",e)for(var i in e)n[i]=e[i];return n.update=function(){if(n.updateConfig(),n.updateContainer(),n.lgg.node()){if(!n.map.colorClassifier_)return console.error("Trivariate legend: map.colorClassifier_ missing"),n;n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle(),function(){var t,e,i,r,a,o,s=n.lgg,l=n.map,c=l.colorClassifier_,u=.866025,h=n.width,f=h*u,p=n.fontSize,d=n.padding,g=n.selectionColor||"red",_=l._tooltip,m=s.attr("class","em-ternary-legend").attr("width",h).attr("height",f+4*d+2*p);m.append("text").attr("x",h/2).attr("y",d+p).text(n.topText).attr("font-size",p).attr("text-anchor","middle"),m.append("text").attr("x",0).attr("y",3*d+2*p+f).text(n.leftText).attr("font-size",p).attr("text-anchor","start"),m.append("text").attr("x",h).attr("y",3*d+2*p+f).text(n.rightText).attr("font-size",p).attr("text-anchor","end");var v=m.append("g").attr("transform","translate(0,".concat(2*d+p,")")),y=function(t,e,n){t.attr("fill",e).on("mouseover",(function(t){Ft(this).attr("fill",g),_&&n&&_.mouseover(n)})).on("mousemove",(function(t){_&&n&&_.mousemove(t)})).on("mouseout",(function(t){Ft(this).attr("fill",e),_&&_.mouseout(t)}))};null!=n&&n.texts&&(c.texts=n.texts);var x=v.append("polygon").attr("points","\n 0,".concat(f," ").concat(h/3,",").concat(f," ").concat(h/2,",").concat(2*f/3," ").concat(h/6,",").concat(2*f/3,"\n"));y(x,c.colors[0],null===(t=c.texts)||void 0===t?void 0:t[0]);var b=v.append("polygon").attr("points","\n ".concat(h/2,",0 ").concat(2*h/3,",").concat(f/3," ").concat(h/2,",").concat(2*f/3," ").concat(h/3,",").concat(f/3,"\n"));y(b,c.colors[1],null===(e=c.texts)||void 0===e?void 0:e[1]);var w=v.append("polygon").attr("points","\n ".concat(h,",").concat(f," ").concat(5*h/6,",").concat(2*f/3," ").concat(h/2,",").concat(2*f/3," ").concat(2*h/3,",").concat(f,"\n"));y(w,c.colors[2],null===(i=c.texts)||void 0===i?void 0:i[2]);var S=v.append("polygon").attr("points","\n ".concat(h/2,",").concat(2*f/3," ").concat(5*h/6,",").concat(2*f/3," ").concat(2*h/3,",").concat(f/3,"\n"));y(S,c.mixColors[0],null===(r=c.texts)||void 0===r?void 0:r.m12);var M=v.append("polygon").attr("points","\n ".concat(h/2,",").concat(2*f/3," ").concat(h/3,",").concat(f," ").concat(2*h/3,",").concat(f,"\n"));y(M,c.mixColors[1],null===(a=c.texts)||void 0===a?void 0:a.m02);var E=v.append("polygon").attr("points","\n ".concat(h/2,",").concat(2*f/3," ").concat(h/6,",").concat(2*f/3," ").concat(h/3,",").concat(f/3,"\n"));if(y(E,c.mixColors[2],null===(o=c.texts)||void 0===o?void 0:o.m01),c.centerCoefficient){var C;y(v.append("circle").attr("cx",h/2).attr("cy",2*f/3).attr("r",c.centerCoefficient*f/3),c.centerColor,null===(C=c.texts)||void 0===C?void 0:C.center)}}(),n.setBoxDimension()}},n},Rx=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=v(n||["red","green","blue"],3),a=r[0],o=r[1],s=r[2],l=i.colorInterpolation||Yn,c=null==i.withMixedClasses||i.withMixedClasses,u=function(t,e){return l(t,e)(.5)},h=v(i.mixedColors||c?[u(o,s),u(a,s),u(a,o)]:[],3),f=h[0],p=h[1],d=h[2],g=i.centerColor||l(u(a,o),s)(.333),_=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t[0],r=t[1],a=t[2],o=v(n.center||[1/3,1/3,1/3],3),s=o[0],l=o[1],c=o[2],u=null==n.withMixedClasses||n.withMixedClasses,h=n.centerCoefficient?1-n.centerCoefficient:void 0,f=function(t){var n=e(t);if(n){var o=+t[i]/n,f=+t[r]/n,p=+t[a]/n;return o>=s&&f<=l&&p<=c?null!=h&&(p-c)*(l-h*l)>=(f-h*l)*(h*c-c)?"center":"0":o<=s&&f>=l&&p<=c?null!=h&&(p-c)*(s-h*s)>=(o-h*s)*(h*c-c)?"center":"1":o<=s&&f<=l&&p>=c?null!=h&&(f-l)*(s-h*s)>=(o-h*s)*(h*l-l)?"center":"2":o<=s&&f>=l&&p>=c?null!=h&&o>h*s?"center":u?"m12":f>p?"1":"2":o>=s&&f<=l&&p>=c?null!=h&&f>h*l?"center":u?"m02":o>p?"0":"2":o>=s&&f>=l&&p<=c?null!=h&&p>h*c?"center":u?"m01":f>o?"1":"0":"unknown"}};return f.center=[s,l,c],f.centerCoefficient=n.centerCoefficient,f}(t,e,i),m=function(t){var e=_(t);return"0"==e?a:"1"==e?o:"2"==e?s:"m12"==e?f:"m02"==e?p:"m01"==e?d:"center"==e?g:i.defaultColor||"black"};return m.center=_.center,m.centerCoefficient=i.centerCoefficient,m.colors=[a,o,s],m.mixColors=[f,p,d],m.centerColor=g,m.classifier=_,m},jx=function(t,e){var n,i,r,a=[],o=t.properties.na||"",s=t.properties.id||"";a.push('<div class="em-tooltip-bar">'.concat(o).concat(s?" (".concat(s,")"):"","</div>"));var l=e.statData("v1").get(s),c=e.statData("v2").get(s),u=e.statData("v3").get(s);return a.push('<div class="em-tooltip-text" style="background:#fff;color:#171a22;padding:4px;font-size:15px;">\n <table class="em-tooltip-table"><tbody>\n <tr><td>'.concat(e.statData("v1").label_||"Variable 1",": ").concat(null!=l&&l.value?la(l.value):""," ").concat((null==l||null===(n=l.unitText)||void 0===n?void 0:n.call(l))||"","</td></tr>\n <tr><td>").concat(e.statData("v2").label_||"Variable 2",": ").concat(null!=c&&c.value?la(c.value):""," ").concat((null==c||null===(i=c.unitText)||void 0===i?void 0:i.call(c))||"","</td></tr>\n <tr><td>").concat(e.statData("v3").label_||"Variable 3",": ").concat(null!=u&&u.value?la(u.value):""," ").concat((null==u||null===(r=u.unitText)||void 0===r?void 0:r.call(u))||"","</td></tr>\n </tbody></table></div>")),a.join("")};function Bx(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function qx(t){return t}function Ux(){var t=qx,e=Bx,n=null,i=ur(0),r=ur(br),a=ur(0);function o(o){var s,l,c,u,h,f=(o=Tx(o)).length,p=0,d=new Array(f),g=new Array(f),_=+i.apply(this,arguments),m=Math.min(br,Math.max(-br,r.apply(this,arguments)-_)),v=Math.min(Math.abs(m)/f,a.apply(this,arguments)),y=v*(m<0?-1:1);for(s=0;s<f;++s)(h=g[d[s]=s]=+t(o[s],s,o))>0&&(p+=h);for(null!=e?d.sort((function(t,n){return e(g[t],g[n])})):null!=n&&d.sort((function(t,e){return n(o[t],o[e])})),s=0,c=p?(m-f*y)/p:0;s<f;++s,_=u)l=d[s],u=_+((h=g[l])>0?h*c:0)+y,g[l]={data:o[l],index:s,value:h,startAngle:_,endAngle:u,padAngle:v};return g}return o.value=function(e){return arguments.length?(t="function"==typeof e?e:ur(+e),o):t},o.sortValues=function(t){return arguments.length?(e=t,n=null,o):e},o.sort=function(t){return arguments.length?(n=t,e=null,o):n},o.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:ur(+t),o):i},o.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:ur(+t),o):r},o.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:ur(+t),o):a},o}const Wx=kn("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");var Hx=function(t,e){var n=ax(t);if(e)for(var i in e)n[i]=e[i];function r(t,e){t.svg_.selectAll("pattern").selectAll("rect").each((function(){var t=Ft(this);t.attr("data-original-fill")||t.attr("data-original-fill",t.style("fill")),t.style("fill","white")})),t.svg_.selectAll("pattern").selectAll("rect[code='"+e+"']").each((function(){var t=Ft(this);t.style("fill",t.attr("data-original-fill"))}))}function a(t){t.svg_.selectAll("pattern").selectAll("rect").each((function(){var t=Ft(this),e=t.attr("data-original-fill");e&&t.style("fill",e)}))}return n.update=function(){n.updateConfig(),n.updateContainer();var t=n.map,e=t.svg(),i=n.lgg;i.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle();var o=0,s=t.catColors(),l=function(l){var c=n.boxPadding+(n.title?n.titleFontSize+n.boxPadding:0)+o*(n.shapeHeight+n.shapePadding);t.catColors()[l];i.append("rect").attr("class","em-legend-rect").attr("x",n.boxPadding).attr("y",c).attr("width",n.shapeWidth).attr("height",n.shapeHeight).style("fill",s[l]).attr("stroke","black").attr("stroke-width",.5).on("mouseover",(function(){Ft(this).raise(),r(n.map,l),n.map.insetTemplates_&&ua(n.map.insetTemplates_,n.map.svgId,r,l)})).on("mouseout",(function(){a(n.map),n.map.insetTemplates_&&ua(n.map.insetTemplates_,n.map.svgId,a)})),i.append("text").attr("class","em-legend-label").attr("x",n.boxPadding+n.shapeWidth+n.labelOffsets.x).attr("y",c+.5*n.shapeHeight).text(t.catLabels()[l]||l).on("mouseover",(function(){e.selectAll("pattern").selectAll("rect[code='"+l+"']").style("fill",t.hoverColor())})).on("mouseout",(function(){var n=t.catColors()[l]||"lightgray";e.selectAll("pattern").selectAll("rect[code='"+l+"']").style("fill",n)})),o++};for(var c in s)l(c);if(n.noData){var u=n.boxPadding+(n.title?n.titleFontSize+n.boxPadding:0)+o*(n.shapeHeight+n.shapePadding);i.append("rect").attr("class","em-legend-rect").attr("x",n.boxPadding).attr("y",u).attr("width",n.shapeWidth).attr("height",n.shapeHeight).style("fill",t.noDataFillStyle()).on("mouseover",(function(){e.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",t.hoverColor()),Ft(this).style("fill",t.hoverColor())})).on("mouseout",(function(){e.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",(function(e){t.noDataFillStyle()}));Ft(this).style("fill",t.noDataFillStyle())})),i.append("text").attr("class","em-legend-label").attr("x",n.boxPadding+n.shapeWidth+n.labelOffsets.x).attr("y",u+.5*n.shapeHeight).text(n.noDataText).on("mouseover",(function(){e.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",t.hoverColor())})).on("mouseout",(function(){e.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",(function(e){t.noDataFillStyle()}))}))}n.setBoxDimension()},n};function Vx(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return $x(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$x(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function $x(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}var Jx=function(t,e){var n=ax(t);if(n.sizeLegend={title:null,titlePadding:10,values:null,labelFormatter:void 0,noData:!1,noDataText:"No data"},n.colorLegend={title:null,titlePadding:10,marginTop:33,labelOffsets:{x:5,y:5},shapeWidth:25,shapeHeight:20,shapePadding:1,noData:!0,noDataText:"No data"},n._sizeLegendHeight=0,e)for(var i in e)if("colorLegend"==i||"sizeLegend"==i){for(var r in n[i])void 0!==e[i][r]&&(n[i][r]=e[i][r]);0==e.colorLegend&&(n.colorLegend=!1)}else n[i]=e[i];function a(t,e){var n=t.svg_.selectAll(".piechart").selectAll("path[code]");n.style("opacity",0),n.filter("path[code='"+e+"']").each((function(){Ft(this).style("opacity",1)}))}function o(t){t.svg_.selectAll(".piechart").selectAll("path[code]").each((function(){Ft(this).style("opacity",1)}))}return n.update=function(){n.updateConfig(),n.updateContainer();var t=n.map,e=n.lgg;e.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle();var i=n.getBaseY(),r=n.getBaseX();t.classifierSize_&&(n._sizeLegendContainer=e.append("g").attr("class","em-pie-size-legend").attr("transform","translate(".concat(r,", ").concat(i,")")),$y(n,n._sizeLegendContainer,n.sizeLegend.values,t.classifierSize_,n.sizeLegend.title,n.sizeLegend.titlePadding)),function(t,e,n){var i=t.map,r=t.colorLegend;if(t._colorLegendContainer=t.lgg.append("g").attr("class","em-pie-color-legend"),t._sizeLegendContainer){var s=t._sizeLegendContainer.node().getBBox().height;t._colorLegendContainer.attr("transform","translate(".concat(e,",").concat(s+t.colorLegend.marginTop,")"))}else t._colorLegendContainer.attr("transform","translate(".concat(e,",").concat(n,")"));r.title&&t._colorLegendContainer.append("text").attr("id","em-color-legend-title").attr("class","em-color-legend-title").attr("x",0).attr("y",t.titleFontSize).text(r.title);var l=0,c=i.catColors(),u=function(e){var n=t.colorLegend.titlePadding+(r.title?t.titleFontSize:0)+l*(r.shapeHeight+r.shapePadding);i.catColors()[e];t._colorLegendContainer.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",n).attr("width",r.shapeWidth).attr("height",r.shapeHeight).style("fill",c[e]).attr("stroke","black").attr("stroke-width",.5).on("mouseover",(function(){a(t.map,e),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,a,e)})).on("mouseout",(function(){o(t.map),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,o,e)})),t._colorLegendContainer.append("text").attr("class","em-legend-label").attr("x",r.shapeWidth+r.labelOffsets.x).attr("y",n+.5*r.shapeHeight).attr("dy","0.35em").text(i.catLabels()[e]||e),l++};for(var h in c)u(h);if(r.noData){var f=0;t._sizeLegendContainer&&(f=t._sizeLegendContainer.node().getBBox().height);var p=f+t.colorLegend.marginTop+t.boxPadding+(r.title?t.titleFontSize+t.boxPadding:0)+l*(r.shapeHeight+r.shapePadding),d=t.lgg.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(t.boxPadding,",").concat(p,")"));t.appendNoDataLegend(d,t.noDataText,a,o)}}(n,r,i),n.setBoxDimension()},n};function Yx(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Xx(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xx(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Xx(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}var Kx=function(t){var e=sx(t,!0,"pie");e.dorling_=(null==t?void 0:t.dorling)||!1,e.animateDorling_=!0,e.pieMinRadius_=5,e.pieMaxRadius_=15,e.pieChartInnerRadius_=0,e.pieStrokeFill_="white",e.pieStrokeWidth_=.3,e.tooltipPieRadius_=40,e.tooltipPieInnerRadius_=0,e.catColors_=void 0,e.catLabels_=void 0,e.pieOtherColor_="#FFCC80",e.pieOtherText_="Other",e.showOnlyWhenComplete_=!1,e.classifierSize_=null,e.statPie_=null,e.pieTotalCode_=void 0,e.statCodes_=void 0,["catColors_","catLabels_","showOnlyWhenComplete_","noDataFillStyle_","pieMaxRadius_","pieMinRadius_","pieChartInnerRadius_","pieOtherColor_","pieOtherText_","pieStrokeFill_","pieStrokeWidth_","dorling_","animateDorling_","pieTotalCode_","statCodes_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),t&&["catColors","catLabels","showOnlyWhenComplete","noDataFillStyle","pieMaxRadius","pieMinRadius","pieChartInnerRadius","pieOtherColor","pieOtherText","pieStrokeFill","pieStrokeWidth","statCodes"].forEach((function(n){null!=t[n]&&e[n](t[n])})),e.statPie=function(t,n,i,r,a,o){t.filters=t.filters||{};for(var s=0;s<i.length;s++){var l=i[s];t.filters[n]=l;var c={};for(var u in t)c[u]=t[u];for(var h in c.filters={},t.filters)c.filters[h]=t.filters[h];e.stat(l,c),a&&(e.catColors_=e.catColors_||{},e.catColors_[l]=a[s]),r&&(e.catLabels_=e.catLabels_||{},e.catLabels_[l]=r[s])}if(e.statCodes_=i,o){e.pieTotalCode_=o,t.filters[n]=o;var f={};for(var p in t)f[p]=t[p];for(var d in f.filters={},t.filters)f.filters[d]=t.filters[d];e.stat(o,f)}else e.pieTotalCode_=void 0;return e},e.updateClassification=function(){return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,n),n(e),e};var n=function(t){if(!e.statCodes_){e.statCodes_=Object.keys(e.statData_);var n=e.statCodes_.indexOf("default");n>-1&&e.statCodes_.splice(n,1)}var i,r=(i=[],e.getCentroidsGroup(e).selectAll("g.em-centroid").data().forEach((function(t){var e=t.properties.id,n=a(e);n&&i.push(n)})),Zv(i));return isNaN(r[0])||(e.classifierSize_=Kv().domain(r).range([e.pieMinRadius_,e.pieMaxRadius_])),e};function i(t){var n=[];if(e.svg_){var i=t.getCentroidsGroup(t);if(i){i.selectAll("g.em-centroid").append("g").attr("class","em-pie").attr("id",(function(t){return n.push(t),"pie_"+t.properties.id}));var o=pa(e),s=e.svg().selectAll(o);"WORLD"!==t.geo_&&"mixed"==t.nutsLevel_&&function(t,e){e.each((function(e){var n=Ft(this);if(!this.parentNode.classList.contains("em-cntrg")){var i=n.attr("lvl"),a=r(e.properties.id),o=a?"WORLD"===t.geo_?"block":null:"none",s=null,l=null;a&&"0"!==i&&(s=n.style("stroke")||"#777","WORLD"===t.geo_&&(l=n.style("stroke-width")||"#777")),n.style("display",o).style("stroke",s).style("stroke-width",l)}}))}(t,s),function(t){t.forEach((function(t){var n=t.properties.id,i=[],o=r(n);for(var s in o)i.push({code:s,value:o[s]});if(i&&0!=i.length){var l=e.svg().selectAll("#pie_"+n),c=e.classifierSize_(a(n)),u=e.pieChartInnerRadius_,h=Ux().sort(null).value((function(t){return t.value})),f=Dr().innerRadius(u).outerRadius(c),p=l.append("g").attr("class","piechart").attr("stroke",e.pieStrokeFill_).attr("stroke-width",e.pieStrokeWidth_+"px").style("pointer-events","none");p.transition().duration(e.transitionDuration()).on("end",(function(){Ft(this).style("pointer-events",null)})),p.selectAll("path").data(h(i)).join("path").attr("d",f).attr("code",(function(t){return t.data.code})).attr("fill",(function(t){return e.catColors_[t.data.code]||"lightgray"})).on("mouseover",(function(n,i){Ft(this.parentNode).style("stroke-width","1px").style("stroke","black"),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(t,e))})).on("mousemove",(function(t){e._tooltip&&e._tooltip.mousemove(t)})).on("mouseout",(function(){Ft(this.parentNode).style("stroke-width",e.pieStrokeWidth_).style("stroke",e.pieStrokeFill_),e._tooltip&&e._tooltip.mouseout()}))}}))}(n),function(t,n){n.on("mouseover",(function(t,n){var i=Ft(this);i.attr("fill___",i.style("fill")),i.style("fill",e.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(n,e))})).on("mousemove",(function(t,n){e._tooltip&&e._tooltip.mousemove(t)})).on("mouseout",(function(){var t=Ft(this);t.attr("fill___")&&(t.style("fill",t.attr("fill___")),e._tooltip&&e._tooltip.mouseout())}))}(0,s)}}}e.updateStyle=function(){try{if(!e.catColors_){e.catColors({});for(var t=0;t<e.statCodes_.length;t++)e.catColors_[e.statCodes_[t]]=Wx[t%10]}return e.pieTotalCode_&&(e.catColors_.other=e.pieOtherColor_,e.catLabels_.other=e.pieOtherText_),e.catLabels_=e.catLabels_||{},e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,i),i(e),e.dorling_?jy(e,(function(t){var n=a(t.properties.id)||0;return e.classifierSize_(n)||0})):qy(e),e}catch(t){console.error("Error in pie symbols styling: "+t.message),console.error(t)}};var r=function(t){for(var n={},i=0,r=e.statCodes_,a=0;a<r.length;a++){var o=r[a],s=e.statData(o).get(t),l=null==s?void 0:s.value;if(null==l||isNaN(l)){if(e.showOnlyWhenComplete())return}else n[o]=l,i+=l}if(e.pieTotalCode_){var c=e.statData(e.pieTotalCode_).get(t),u=null==c?void 0:c.value;i=null==u||isNaN(u)?0:u}if(i&&!isNaN(i)){var h,f=Yx(r);try{for(f.s();!(h=f.n()).done;){var p=h.value;void 0!==n[p]&&(n[p]/=i)}}catch(t){f.e(t)}finally{f.f()}if(e.pieTotalCode_){var d=Object.values(n).reduce((function(t,e){return t+e}),0);n.other=Math.max(0,1-d)}return n}};var a=function(t){var n,i=0;if(e.pieTotalCode_)!(n=e.statData(e.pieTotalCode_).get(t))||0!=n.value&&!n.value||isNaN(n.value)?e.showOnlyWhenComplete()&&(i=void 0):i=n.value;else for(var r=0;r<e.statCodes_.length;r++){var a=e.statCodes_[r];if(!(n=e.statData(a).get(t))||0!=n.value&&!n.value||isNaN(n.value)){if(e.showOnlyWhenComplete())return}else i+=n.value}if(0!=i)return i};e.getLegendConstructor=function(){return Jx};var o=150,s=120,l=Math.min(o,s)/2-10,c=Ux().sort(null).value((function(t){return t.value})),u=Dr().innerRadius(0).outerRadius(.8*l),h=Dr().innerRadius(.9*l).outerRadius(.9*l);return e.tooltip_.textFunction=function(t,n){var i=t.properties.na||t.properties.name,f=t.properties.id,p=r(f),d=[];for(var g in p)d.push({code:g,value:p[g]});var _="";if(_+='<div class="em-tooltip-bar">'.concat(i).concat(f?" (".concat(f,")"):"","</div>"),!d||0===d.length)return _+="<div>".concat(e.noDataText(),"</div>");var m,v="",y="",x="",b=Yx(c(d));try{for(b.s();!(m=b.n()).done;){var w=m.value,S=e.catColors()[w.data.code]||"lightgray",M=u(w);if(v+='<path d="'.concat(M,'" fill="').concat(S,'" stroke="white" stroke-width="1" opacity="0.7"></path>'),w.data.value>.1){var E=u.centroid(w),C=h.centroid(w),A=h.centroid(w),k=w.startAngle+(w.endAngle-w.startAngle)/2;A[0]=.95*l*(k<Math.PI?1:-1),y+='<polyline points="'.concat(E.join(",")," ").concat(C.join(",")," ").concat(A.join(","),'"\n stroke="black" fill="none" stroke-width="1" />');var T=h.centroid(w);T[0]=.99*l*(k<Math.PI?1:-1);var P=k<Math.PI?"start":"end",N=(100*w.data.value).toFixed();isNaN(N)||(x+='<text x="'.concat(T[0],'" y="').concat(T[1],'" text-anchor="').concat(P,'" font-size="12px">\n ').concat(N,"%\n </text>"))}}}catch(t){b.e(t)}finally{b.f()}_+="\n <div class='em-tooltip-piechart-container'>\n <svg viewBox=\"".concat(-75," ").concat(-60," ").concat(o," ").concat(s,'" width="').concat(o,'" height="').concat(115,'">\n <g transform="translate(0,0)">\n ').concat(v,"\n ").concat(y,"\n ").concat(x,"\n </g>\n </svg>\n </div>\n "),_+='<div class="em-tooltip-breakdown">';var L,F=e.statCodes_.map((function(t){var n=e.statData(t).get(f);return n&&void 0!==n.value&&null!==n.value?{code:t,label:e.catLabels_[t],value:n.value,color:e.catColors()[t]||"#666"}:null})).filter(Boolean).sort((function(t,e){return e.value-t.value})),O=a(f)||F.reduce((function(t,e){return t+e.value}),0),G=Yx(F);try{for(G.s();!(L=G.n()).done;){var D,z=L.value,I=O?(z.value/O*100).toFixed(0):0;_+='\n <div class="em-breakdown-item">\n <span class="em-breakdown-color" style="background:'.concat(z.color,'"></span>\n <span class="em-breakdown-label">').concat(z.label,'</span>\n <span class="em-breakdown-value">').concat(null!==(D=z.value)&&void 0!==D&&D.toFixed?la(z.value):0," (").concat(isNaN(I)?0:I,"%)</span>\n </div>\n ")}}catch(t){G.e(t)}finally{G.f()}if(null!=O){var R=e.statData(e.statCodes_[0]).unitText()||"";_+='\n <div class="em-breakdown-item em-total">\n <span class="em-breakdown-label">Total</span>\n <span class="em-breakdown-value">'.concat(la(O)," ").concat(R,"</span>\n </div>\n ")}return _+="</div>"},e};function Zx(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Qx(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Zx(Object(n),!0).forEach((function(e){ma(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zx(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var tb=function(t){var e=sx(t,!0,"spark");e.sparkLineColor_="black",e.sparkAreaColor_="#41afaa",e.sparkLineWidth_=30,e.sparkLineHeight_=20,e.sparkLineStrokeWidth_=.4,e.sparkLineOpacity_=.6,e.sparkType_="line",e.sparkLineCircleRadius_=0,e.sparkTooltipChart_={width:100,height:50,margin:{left:60,right:40,top:40,bottom:40},circleRadius:1.5},e.showOnlyWhenComplete_=!1,e.sparkLineChartFunction_=void 0,e.statSpark_=null,e.sparkHeightClassifier_=null,["sparkLineColor_","showOnlyWhenComplete_","sparkType_","sparkLineWidth_","sparkLineHeight_","sparkLineStrokeWidth_","sparkLineOpacity_","sparkLineCircleRadius_","sparkLineAreaColor_","sparkTooltipChart_","sparkLineChartFunction_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),t&&["sparkLineColor","showOnlyWhenComplete","sparkType","sparkLineWidth","sparkLineHeight","sparkLineStrokeWidth","sparkLineOpacity","sparkLineCircleRadius_","sparkLineAreaColor","sparkTooltipChart_","sparkLineChartFunction_"].forEach((function(n){null!=t[n]&&e[n](t[n])})),e.sparklineData_=void 0,e.sparklineData=function(t){var n=Object.keys(t[Object.keys(t)[0]]);return e._statDates=n,n.forEach((function(n){var i=av(),r={};for(var a in t){var o=t[a];r[a]=o[n]}i.setData(r),e.statData(n,i)})),e},e.statSpark=function(t,n,i){t.filters=t.filters||{};for(var r=0;r<n.length;r++){var a=n[r];t.filters.time=a;var o={};for(var s in t)o[s]=t[s];for(var l in o.filters={},t.filters)o.filters[l]=t.filters[l];e.stat(a,o),i&&(e.catLabels_=e.catLabels_||{},e.catLabels_[a]=i[r])}return e._statDates=n,e},e._statDates=void 0;var n=function(t){for(var n=[],i=0,r=0;r<e._statDates.length;r++){var a=e._statDates[r],o=e.statData(a).get(t);if(!o||0!=o.value&&!o.value||isNaN(o.value)){if(e.showOnlyWhenComplete())return}else n.push({date:a,value:o.value}),i+=o.value}if(0!=i){for(var s=1;s<n.length;s++){var l=n[s-1].value,c=n[s].value;n[s].percentageChange=0===l?.001:(c-l)/l*100}return n}};function i(t,n,r,a){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(e.sparkLineChartFunction_&&e.sparkLineChartFunction_!==i)return e.sparkLineChartFunction_(t,n,r,a,o);var s=En().domain([0,e._statDates.length-1]).range([.5,r-.5]),l=Ot(n.map((function(t){return t.value})))||0,c=Gt(n.map((function(t){return t.value})))||1,u=En().domain([l,c]).range([a,0]),h=n.map((function(t,e){return Qx(Qx({},t),{},{scaledXValue:s(e),scaledYValue:u(t.value)})})),f=u(0);o&&(t.append("g").attr("class","axis-x").attr("transform","translate(0, ".concat(a,")")).call(Ev(s).ticks(e._statDates.length).tickFormat((function(t,n){return e._statDates[n]}))).selectAll("text").style("text-anchor","end").attr("dx","-.8em").attr("dy",".15em").attr("transform","rotate(-65)"),t.append("g").attr("class","axis-y").call(Cv(u).ticks(5)),l<0&&c>0&&t.append("line").attr("x1",0).attr("x2",r).attr("y1",f).attr("y2",f).attr("stroke","gray").attr("stroke-dasharray","2,2").attr("stroke-width",1));var p=Ox().x((function(t){return t.scaledXValue})).y((function(t){return t.scaledYValue}));"area"===e.sparkType_&&t.append("path").datum(h).attr("fill","function"==typeof e.sparkAreaColor_?function(t,n){return e.sparkAreaColor_(t,n)}:e.sparkAreaColor_).attr("stroke","none").attr("opacity",e.sparkLineOpacity_).attr("fill-opacity",.3).attr("d",function(t,e,n){var i=null,r=ur(!0),a=null,o=Nx,s=null,l=Tr(c);function c(c){var u,h,f,p,d,g=(c=Tx(c)).length,_=!1,m=new Array(g),v=new Array(g);for(null==a&&(s=o(d=l())),u=0;u<=g;++u){if(!(u<g&&r(p=c[u],u,c))===_)if(_=!_)h=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=h;--f)s.point(m[f],v[f]);s.lineEnd(),s.areaEnd()}_&&(m[u]=+t(p,u,c),v[u]=+e(p,u,c),s.point(i?+i(p,u,c):m[u],n?+n(p,u,c):v[u]))}if(d)return s=null,d+""||null}function u(){return Ox().defined(r).curve(o).context(a)}return t="function"==typeof t?t:void 0===t?Lx:ur(+t),e="function"==typeof e?e:ur(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?Fx:ur(+n),c.x=function(e){return arguments.length?(t="function"==typeof e?e:ur(+e),i=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:ur(+e),c):t},c.x1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:ur(+t),c):i},c.y=function(t){return arguments.length?(e="function"==typeof t?t:ur(+t),n=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:ur(+t),c):e},c.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:ur(+t),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(i).y(e)},c.defined=function(t){return arguments.length?(r="function"==typeof t?t:ur(!!t),c):r},c.curve=function(t){return arguments.length?(o=t,null!=a&&(s=o(a)),c):o},c.context=function(t){return arguments.length?(null==t?a=s=null:s=o(a=t),c):a},c}().x((function(t){return t.scaledXValue})).y0(f).y1((function(t){return t.scaledYValue}))),t.append("path").datum(h).attr("fill","none").attr("opacity",e.sparkLineOpacity_).attr("stroke","function"==typeof e.sparkLineColor_?function(t,n){return e.sparkLineColor_(t,n)}:e.sparkLineColor_).attr("stroke-width","function"==typeof e.sparkLineStrokeWidth_?function(t,n){return e.sparkLineStrokeWidth_(t,n)}:e.sparkLineStrokeWidth_+"px").attr("d",p),t.selectAll("circle").data(h).enter().append("circle").attr("cx",(function(t){return t.scaledXValue})).attr("cy",(function(t){return t.scaledYValue})).attr("r",e.sparkLineCircleRadius_).attr("fill","red").attr("stroke","none")}e.updateClassification=function(){if(!e._statDates){e._statDates=Object.keys(e.statData_);var t=e._statDates.indexOf("default");t>-1&&e._statDates.splice(t,1)}return e.domain=function(){var t=[];if(e.getCentroidsGroup(e).selectAll("g.em-centroid").data().forEach((function(e){var n=e.properties.id,i=r(n);void 0!==i&&t.push(i)})),0===t.length)return[0,1];return Zv(t)}(),e.widthClassifier_=Kv().domain(e.domain).range([0,e.sparkLineWidth_]),e.heightClassifier_=Kv().domain(e.domain).range([0,e.sparkLineHeight_]),e},e.updateStyle=function(){var t=[],r=(e.getCentroidsGroup(e).selectAll("g.em-centroid").attr("id",(function(e){return t.push(e.properties.id),"spark_"+e.properties.id})),pa(e));return e.svg().selectAll(r).on("mouseover",(function(t,i){if(n(i.properties.id)){var r=Ft(this);r.attr("fill___",r.style("fill")),r.style("fill",e.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(i,e))}})).on("mousemove",(function(t,i){n(i.properties.id)&&e._tooltip&&e._tooltip.mousemove(t)})).on("mouseout",(function(){var t=Ft(this);t.style("fill");t.attr("fill___")&&(t.style("fill",t.attr("fill___")),e._tooltip&&e._tooltip.mouseout())})),t.forEach((function(t){var r=e.svg().select("#spark_"+t),a=n(t);a&&i(r,a,e.sparkLineWidth_,e.sparkLineHeight_)})),e},e.tooltip_.textFunction=function(t,r){var a=[],o=t.properties.na,s=t.properties.id;a.push('\n <div class="em-tooltip-bar">\n <b>'.concat(o,"</b>").concat(s?" (".concat(s,")"):"","\n </div>\n "));var l,c=e.sparkTooltipChart_.height,u=e.sparkTooltipChart_.width,h=e.sparkTooltipChart_.margin,f=n(t.properties.id);if(f){var p=u+h.left+h.right,d=c+h.top+h.bottom,g=(l="div",Ft(yt(l).call(document.documentElement))).attr("class","em-tooltip-chart-container");i(g.append("svg").attr("class","em-tooltip-chart-svg").attr("width",p).attr("height",d).append("g").attr("transform","translate(".concat(h.left,", ").concat(h.top,")")),f,u,c,!0),a.push(g.node().outerHTML)}return a.join("")};var r=function(t){for(var n=0,i=0;i<e._statDates.length;i++){var r=e._statDates[i],a=e.statData(r);if(a&&"function"==typeof a.get){var o=a.get(t);if(!o||0!==o.value&&!o.value||isNaN(o.value)){if(e.showOnlyWhenComplete())return}else o.value>n&&(n=o.value)}}if(0!==n)return n};return e.getLegendConstructor=function(){return Bv},e},eb=function(t,e){var n=ax(t);if(n.flowWidthLegend={title:null,titlePadding:17,values:null,marginTop:5},n.donutSizeLegend={title:null,titlePadding:25,values:null,marginTop:20},n.flowColorLegend={title:null,titlePadding:0,marginTop:33},n.regionColorLegend={title:null,titlePadding:15,marginTop:30},e)for(var i in e)if("colorLegend"==i||"flowWidthLegend"==i||"donutSizeLegend"==i||"flowColorLegend"==i||"regionColorLegend"==i){for(var r in n[i])void 0!==e[i][r]&&(n[i][r]=e[i][r]);0==e.colorLegend&&(n.colorLegend=!1)}else n[i]=e[i];return n.update=function(){n.updateConfig(),n.updateContainer();var t=n.map,e=n.lgg;if(t.legend_)for(var i in t.legend_)if("colorLegend"==i||"flowWidthLegend"==i||"donutSizeLegend"==i||"flowColorLegend"==i||"regionColorLegend"==i)for(var r in n[i])void 0!==t.legend_[i][r]&&(n[i][r]=t.legend_[i][r]);else n[i]=t.legend_[i];e.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle(),function(t){var e=t.map,n=t.getBaseX(),i=t.getBaseY();!function(t,e,n){var i=t.map;if(!i.strokeWidthScale)return;t._flowWidthContainer=t.lgg.append("g").attr("class","em-flow-width-legend").attr("transform","translate(".concat(e,", ").concat(n,")")),t.flowWidthLegend.title&&t._flowWidthContainer.append("text").attr("class","em-size-legend-title").text(t.flowWidthLegend.title||"Flow width");var r=i.strokeWidthScale,a=r.domain(),o=t.flowWidthLegend.values||[a[0],a[a.length-1]],s=t.flowWidthLegend.titlePadding||10,l=7,c=0;o.forEach((function(e,n){var i=r(e);if(n>0){var a=r(o[n-1]);s+=a/2+i/n+l}t._flowWidthContainer.append("line").attr("x1",c).attr("x2",c+40).attr("y1",s).attr("y2",s).attr("stroke","#6b6b6b").attr("stroke-width",i),t._flowWidthContainer.append("text").attr("x",c+50).attr("y",s).attr("dy","0.35em").attr("class","em-legend-label").text(la(e))}))}(t,n,i+t.flowWidthLegend.marginTop);var r=t._flowWidthContainer.node().getBBox().height;if(e.flowDonuts_&&e.donutSizeScale){t._donutLegendContainer=t.lgg.append("g").attr("class","em-donut-legend").attr("transform","translate(".concat(n,", ").concat(i+r,")")),t._donutSizeContainer=t._donutLegendContainer.append("g").attr("class","em-donut-size-legend").attr("transform","translate(".concat(0,", ",t.donutSizeLegend.marginTop,")")),$y(t,t._donutSizeContainer,t.donutSizeLegend.values,e.donutSizeScale,t.donutSizeLegend.title,t.donutSizeLegend.titlePadding);var a=t.donutSizeLegend.marginTop+t._donutSizeContainer.node().getBBox().height+t.flowColorLegend.marginTop;!function(t,e,n){var i,r=t.map,a=Array.from(r.topLocationKeys||[]),o=r.locationColorScale;null===(i=t._donutColorContainer)||void 0===i||i.remove(),t._donutColorContainer=t._donutLegendContainer.append("g").attr("class","em-donut-color-legend").attr("transform","translate(".concat(e,", ").concat(n,")"));var s=t._donutColorContainer.append("text").attr("class","em-color-legend-title").attr("id","em-color-legend-title").attr("dy","0.35em").text(t.flowColorLegend.title||"Destination"),l=a.map((function(t){return{label:r.nodeNameMap.get(t)||t,color:o(t)}}));l.push({label:"Other",color:"#ccc"});var c=s.node().getBBox().height+t.flowColorLegend.titlePadding,u=function(t){r.svg_.selectAll("g.em-flow-container line").classed("highlighted",(function(){return this.getAttribute("stroke")===t})).classed("dimmed",(function(){return this.getAttribute("stroke")!==t}))},h=function(){r.svg_.selectAll("g.em-flow-container line").classed("highlighted",!1).classed("dimmed",!1)};l.forEach((function(e,n){var i=t._donutColorContainer.append("g").attr("class","em-donut-color-item").attr("transform","translate(0, ".concat(22*n+c,")")).style("cursor","pointer").on("mouseover",(function(){u(e.color),Ft(this).select("text").style("font-weight","bold"),Ft(this).select("rect").attr("stroke","black").attr("stroke-width",2)})).on("mouseout",(function(){h(),Ft(this).select("text").style("font-weight","normal"),Ft(this).select("rect").attr("stroke","none")}));i.append("rect").attr("width",18).attr("height",18).attr("fill",e.color),i.append("text").attr("x",25).attr("y",14).attr("class","em-legend-label").text(e.label)}))}(t,0,a)}if(e.importerRegionIds.length>0||e.exporterRegionIds.length>0){var o=i+t.flowWidthLegend.marginTop+r+t.regionColorLegend.marginTop;e.flowDonuts_&&e.donutSizeScale&&(o+=t.donutSizeLegend.marginTop,o+=t._donutLegendContainer.node().getBBox().height),function(t,e,n){t._colorLegendContainer||(t._colorLegendContainer=t.lgg.append("g").attr("class","em-color-legend").attr("transform","translate(".concat(e,", ").concat(n,")")));var i=t._colorLegendContainer.append("g").attr("class","em-flow-overlay-color-legend"),r=(i.append("text").attr("class","em-color-legend-title").attr("id","em-color-legend-title").attr("dy","0.35em").text(t.regionColorLegend.title||"Region fill colors"),t.map),a={"Net Exporter":r.flowOverlayColors_[0],"Net Importer":r.flowOverlayColors_[1]},o=t.regionColorLegend.titlePadding;Object.entries(a).forEach((function(e,n){var r=v(e,2),a=r[0],s=r[1];i.append("rect").attr("x",0).attr("y",o+20*n).attr("width",t.shapeWidth).attr("height",t.shapeHeight).attr("fill",s),i.append("text").attr("x",t.shapeWidth+5).attr("y",o+20*n+15).attr("class","em-legend-label").text(a)}))}(t,n,o)}}(n),n.setBoxDimension()},n};class nb{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}function ib(t){return new nb(t,!0)}function rb(t){return t.source}function ab(t){return t.target}function ob(t){let e=rb,n=ab,i=Lx,r=Fx,a=null,o=null,s=Tr(l);function l(){let l;const c=kx.call(arguments),u=e.apply(this,c),h=n.apply(this,c);if(null==a&&(o=t(l=s())),o.lineStart(),c[0]=u,o.point(+i.apply(this,c),+r.apply(this,c)),c[0]=h,o.point(+i.apply(this,c),+r.apply(this,c)),o.lineEnd(),l)return o=null,l+""||null}return l.source=function(t){return arguments.length?(e=t,l):e},l.target=function(t){return arguments.length?(n=t,l):n},l.x=function(t){return arguments.length?(i="function"==typeof t?t:ur(+t),l):i},l.y=function(t){return arguments.length?(r="function"==typeof t?t:ur(+t),l):r},l.context=function(e){return arguments.length?(null==e?a=o=null:o=t(a=e),l):a},l}function sb(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let i=-1;for(let r of t)(r=+e(r,++i,t))&&(n+=r)}return n}function lb(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return cb(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cb(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function cb(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function ub(t,e){var n=t.svg_,i=(t.flowGraph_,function(t){var e=t.flowGraph_;return function(t){var e,n=t.nodes,i=lb(n);try{for(i.s();!(e=i.n()).done;){var r=e.value;r.value=Math.max(sb(r.sourceLinks,(function(t){return t.value})),sb(r.targetLinks,(function(t){return t.value})))}}catch(t){i.e(t)}finally{i.f()}}(e),function(t){var e=t.nodes,n=e.length,i=new Set(e),r=new Set,a=0;for(;i.size;){var o,s=lb(i);try{for(s.s();!(o=s.n()).done;){var l=o.value;l.depth=a;var c,u=lb(l.sourceLinks);try{for(u.s();!(c=u.n()).done;){var h=c.value.target;r.add(h)}}catch(t){u.e(t)}finally{u.f()}}}catch(t){s.e(t)}finally{s.f()}if(++a>n)throw new Error("circular link");i=r,r=new Set}}(e),function(t){var e=t.nodes,n=e.length,i=new Set(e),r=new Set,a=0;for(;i.size;){var o,s=lb(i);try{for(s.s();!(o=s.n()).done;){var l=o.value;l.height=a;var c,u=lb(l.targetLinks);try{for(u.s();!(c=u.n()).done;){var h=c.value.source;r.add(h)}}catch(t){u.e(t)}finally{u.f()}}}catch(t){s.e(t)}finally{s.f()}if(++a>n)throw new Error("circular link");i=r,r=new Set}}(e),function(t,e){var n,i=e.nodes,r=lb(i);try{for(r.s();!(n=r.n()).done;){var a=n.value;a.sourceLinks.forEach((function(e){return e.width=t.strokeWidthScale(e.value)})),a.targetLinks.forEach((function(e){return e.width=t.strokeWidthScale(e.value)}));var o=Math.max(sb(a.sourceLinks,(function(t){return t.width})),sb(a.targetLinks,(function(t){return t.width})));a.x0=a.x1=a.x,a.y0=a.y-o/2,a.y1=a.y+o/2}}catch(t){r.e(t)}finally{r.f()}!function(t){var e,n=lb(t);try{for(n.s();!(e=n.n()).done;){var i=e.value,r=i.sourceLinks,a=i.targetLinks;r.sort(db),a.sort(gb)}}catch(t){n.e(t)}finally{n.f()}}(i)}(t,e),function(t){var e,n=t.nodes,i=lb(n);try{for(i.s();!(e=i.n()).done;){var r,a=e.value,o=a.y0,s=lb(a.sourceLinks);try{for(s.s();!(r=s.n()).done;){var l=r.value;l.y0=o+l.width/2,o+=l.width}}catch(t){s.e(t)}finally{s.f()}var c,u=a.y0,h=lb(a.targetLinks);try{for(h.s();!(c=h.n()).done;){var f=c.value;f.y1=u+f.width/2,u+=f.width}}catch(t){h.e(t)}finally{h.f()}}}catch(t){i.e(t)}finally{i.f()}}(e),e}(t)),r=i.nodes,a=i.links;t.flowStack_||a.forEach((function(t){var e=(t.source.y0+t.source.y1)/2;t.y0=e}));var o=n.append("defs"),s=ca("arrow"),l=ca("arrow-outline"),c=a.map((function(){return ca("gradient")}));return t.flowArrows_&&(hb(t,o,s,t.flowColor_),hb(t,o,l,"#ffffff")),t.flowGradient_&&function(t,e,n,i){var r=i.filter((function(t){var e,n;return null!=(null===(e=t.source)||void 0===e?void 0:e.x1)&&null!=(null===(n=t.target)||void 0===n?void 0:n.x0)&&null!=t.y0&&null!=t.y1}));e.selectAll("linearGradient").data(r).join("linearGradient").attr("id",(function(t,e){return n[e]})).attr("gradientUnits","userSpaceOnUse").attr("x1",(function(t){return t.source.x1})).attr("x2",(function(t){return t.target.x0})).attr("y1",(function(t){return t.y0})).attr("y2",(function(t){return t.y1})).call((function(e){return e.append("stop").attr("offset","5%").attr("stop-color",t.flowOverlayColors_[0])})).call((function(e){return e.append("stop").attr("offset","50%").attr("stop-color",t.flowColor_)}))}(t,o,c,a),function(t,e,n,i,r,a){var o=e.append("g").attr("class","em-flow-lines").attr("id","em-flow-lines");n.forEach((function(e,n){t.flowOutlines_&&o.append("path").attr("d",_b()(e)).attr("fill","none").attr("stroke","#ffffff").attr("class","em-flow-link-outline").attr("stroke-width",e.width+1.5).attr("marker-end","url(#".concat(r,")")),o.append("path").attr("d",_b()(e)).attr("fill","none").attr("class","em-flow-link").attr("stroke",t.flowGradient_?"url(#".concat(a[n],")"):t.flowColor_).attr("stroke-width",e.width).attr("marker-end",t.flowArrows_?"url(#".concat(i,")"):"").on("mouseover",(function(n){var r=t.hoverColor_;Ft(this).attr("stroke",r),t.flowArrows_&&Ft(this).attr("marker-end","url(#".concat(i+"mouseover",")")),t._tooltip&&t._tooltip.mouseover(t.tooltip_.textFunction(e,t))})).on("mousemove",(function(e){t._tooltip&&t._tooltip.mousemove(e)})).on("mouseout",(function(){t.flowGradient_?Ft(this).attr("stroke","url(#".concat(a[n],")")):Ft(this).attr("stroke",t.flowColor_),t.flowArrows_&&Ft(this).attr("marker-end","url(#".concat(i,")")),t._tooltip&&t._tooltip.mouseout()}))}))}(t,e,a,s,l,c),function(t,e,n){e.append("g").attr("class","em-flow-fill-in-gaps").selectAll("rect").data(n).join("rect").filter((function(t){return t.depth&&t.height})).attr("x",(function(t){return t.x0-.5})).attr("y",(function(t){return t.y0})).attr("width",1).attr("height",(function(t){return t.y1-t.y0})).attr("fill",t.flowColor_)}(t,e,r),n.node()}function hb(t,e,n,i){e.append("marker").attr("id",n).attr("markerHeight",7).attr("markerWidth",7).attr("refX",.5).attr("refY",1.5).attr("orient","auto").append("path").attr("fill",i).attr("d","M0,0 q0,1,0.5,1.5 q-0.5,0.5,-0.5,1.5 q0.75,-0.75,2,-1.5 q-1.25,-0.75,-2,-1.5Z"),e.append("marker").attr("id",n+"mouseover").attr("markerHeight",7).attr("markerWidth",7).attr("refX",.5).attr("refY",1.5).attr("orient","auto").append("path").attr("fill",t.hoverColor_).attr("d","M0,0 q0,1,0.5,1.5 q-0.5,0.5,-0.5,1.5 q0.75,-0.75,2,-1.5 q-1.25,-0.75,-2,-1.5Z")}function fb(t){return[t.source.x1,t.y0]}function pb(t){return[t.target.x0,t.y1]}var db=function(t,e){return t.target.y-e.target.y},gb=function(t,e){return t.source.y-e.source.y},_b=function(){return ob(ib).source(fb).target(pb)};function mb(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return vb(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vb(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function vb(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function yb(t,e){!function(t,e){var n=e.append("g").attr("class","em-flow-lines").attr("id","em-flow-lines"),i=t.flowGraph_,r=i.nodes,a=i.links,o=new Map(r.map((function(t){return[t.id,[t.x,t.y]]}))),s=new Map;a.forEach((function(t){var e="object"===ga(t.source)?t.source.id:t.source,n="object"===ga(t.target)?t.target.id:t.target,i=o.get(e),r=o.get(n);if(i&&r){var a=e<n?"".concat(e,"|").concat(n):"".concat(n,"|").concat(e);s.has(a)||s.set(a,{idA:e<n?e:n,idB:e<n?n:e,coordsA:e<n?i:r,coordsB:e<n?r:i,flowAB:0,flowBA:0});var l=s.get(a);e<n?l.flowAB+=t.value:l.flowBA+=t.value}}));var l,c=mb(s.values());try{var u=function(){var e=l.value,i=e.idA,r=e.idB,a=e.coordsA,o=e.coordsB,s=e.flowAB,c=e.flowBA,u=(a[0]+o[0])/2,g=(a[1]+o[1])/2,_=function(){return h(t,i,r)},m=function(){return h(t,r,i)};s>0&&c>0?(n.append("line").attr("data-nb",s).attr("x1",u).attr("y1",g).attr("x2",o[0]).attr("y2",o[1]).attr("data-origin",i).attr("data-dest",r).attr("stroke",_).attr("stroke-width",t.strokeWidthScale(s).toFixed(1)).attr("stroke-opacity",t.flowOpacity_).style("cursor","pointer").on("mouseover",f(t,i,r,s)).on("mousemove",p(t)).on("mouseout",d(t,_)),n.append("line").attr("data-nb",c).attr("x1",u).attr("y1",g).attr("x2",a[0]).attr("y2",a[1]).attr("data-origin",r).attr("data-dest",i).attr("stroke",m).attr("stroke-width",t.strokeWidthScale(c).toFixed(1)).attr("stroke-opacity",t.flowOpacity_).style("cursor","pointer").on("mouseover",f(t,r,i,c)).on("mousemove",p(t)).on("mouseout",d(t,m))):s>0&&0===c?n.append("line").attr("data-nb",s).attr("x1",a[0]).attr("y1",a[1]).attr("x2",o[0]).attr("y2",o[1]).attr("data-origin",i).attr("data-dest",r).attr("stroke",_).attr("stroke-width",t.strokeWidthScale(s).toFixed(1)).attr("stroke-opacity",t.flowOpacity_).style("cursor","pointer").on("mouseover",f(t,i,r,s)).on("mousemove",p(t)).on("mouseout",d(t,_)):c>0&&0===s&&n.append("line").attr("data-nb",c).attr("x1",o[0]).attr("y1",o[1]).attr("x2",a[0]).attr("y2",a[1]).attr("data-origin",r).attr("data-dest",i).attr("stroke",m).attr("stroke-width",t.strokeWidthScale(c).toFixed(1)).attr("stroke-opacity",t.flowOpacity_).style("cursor","pointer").on("mouseover",f(t,r,i,c)).on("mousemove",p(t)).on("mouseout",d(t,m))};for(c.s();!(l=c.n()).done;)u()}catch(t){c.e(t)}finally{c.f()}function h(t,e,n,i){if(!t.topLocationKeys||!t.flowTopLocations_)return t.flowColor_;var r=t.flowTopLocationsType_||"sum";return"origin"===r?t.topLocationKeys.has(e)?t.locationColorScale(e):t.flowColor_:"destination"===r?t.topLocationKeys.has(n)?t.locationColorScale(n):t.flowColor_:t.topLocationKeys.has(n)?t.locationColorScale(n):t.topLocationKeys.has(e)?t.locationColorScale(e):t.flowColor_}function f(t,e,n,i){return function(r){var a=t.hoverColor_||"black";if(Ft(this).attr("stroke",a),t._tooltip){var o=t.flowGraph_.nodes.find((function(t){return t.id===e})),s=t.flowGraph_.nodes.find((function(t){return t.id===n})),l={source:o,target:s,value:i};t._tooltip.mouseover(t.tooltip_.textFunction(l,t))}}}function p(t){return function(e){t._tooltip&&t._tooltip.mousemove(e)}}function d(t,e){return function(){Ft(this).attr("stroke",e()),t._tooltip&&t._tooltip.mouseout()}}}(t,e)}function xb(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return bb(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bb(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function bb(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function wb(t,e){var n=e.data.parent.id;va("g.em-flow-container line").classed("highlighted",(function(){return this.getAttribute("data-origin")===n||this.getAttribute("data-dest")===n})).classed("dimmed",(function(){return this.getAttribute("data-origin")!==n&&this.getAttribute("data-dest")!==n}))}function Sb(t){va("g.em-flow-container line").classed("highlighted",!1).classed("dimmed",!1)}function Mb(t,e){var n,i,r=mn(".0%"),a=t.data.parent,o=sb(a.donutValues,(function(t){return t.value})),s=null===(n=e.statData)||void 0===n?void 0:n.call(e),l=(null==s||null===(i=s.unitText)||void 0===i?void 0:i.call(s))||"",c=[];c.push('\n <div class="em-tooltip-bar">\n <b>'.concat(a.name||a.id||"Unknown location","</b>\n </div>\n ")),c.push('<div class="em-tooltip-text"><table class="em-tooltip-table"><tbody>');var u=Ab(a.id,e),h=sb(u,(function(t){return t.value}));if(h>0){var f=r(h/o);c.push('\n <tr><td style="padding-top:3px;">Incoming:</td>\n <td>'.concat(la(h)," (").concat(f,")</td>\n </tr>\n ")),u.forEach((function(t){var e=r(t.value/o);c.push('\n <tr>\n <td style="padding-left:1.5em;">\n <span style="\n display:inline-block;\n width:10px;\n height:10px;\n border-radius:50%;\n background:'.concat(t.color,';\n margin-right:6px;\n "></span> ').concat(t.name||t.key,'\n </td>\n <td style="text-align:right">\n ').concat(la(t.value)," (").concat(e,")\n </td>\n </tr>\n "))}))}var p=kb(a.id,e),d=sb(p,(function(t){return t.value}));if(d>0){var g=r(d/o);c.push('\n <tr><td style="padding-top:3px;">Outgoing:</td>\n <td>'.concat(la(d)," (").concat(g,")</td>\n </tr>\n ")),p.forEach((function(t){var e=r(t.value/o);c.push('\n <tr>\n <td style="padding-left:1.5em;">\n <span style="\n display:inline-block;\n width:10px;\n height:10px;\n border-radius:50%;\n background:'.concat(t.color,';\n margin-right:6px;\n "></span> ').concat(t.name||t.key,'\n </td>\n <td style="text-align:right">\n ').concat(la(t.value)," (").concat(e,")\n </td>\n </tr>\n "))}))}return c.push('\n <tr class="em-tooltip-total">\n <td colspan="2" style="padding-top:4px; font-weight:bold;">\n Total: '.concat(la(o)," ").concat(l,"\n </td>\n </tr>\n ")),c.push("</tbody></table></div>"),c.join("")}var Eb=function(t,e){var n=+e.attr("data-zoom")||1;Ft(t.target.parentNode).selectAll("path").each((function(){var t=Ft(this),e=+t.attr("stroke-width")||0;t.attr("data-stroke-width",e)})).attr("stroke","black").attr("stroke-width",2/n)},Cb=function(t,e){var n=+e.attr("data-zoom")||1;Ft(t.target.parentNode).selectAll("path").attr("stroke","white").attr("stroke-width",(function(){return(+Ft(this).attr("data-stroke-width")||0)/n}))};function Ab(t,e){var n,i=e.topLocationKeys,r=e.flowTopLocationsType_,a=e.flowInternal_,o={},s=xb(e.flowGraph_.links);try{for(s.s();!(n=s.n()).done;){var l=n.value,c=l.source.id,u=l.target.id;if(u===t)if(c!==u){var h=void 0;o[h="destination"===r?t:"origin"===r?i.has(c)?c:"Other":i.has(c)||i.has(t)?i.has(c)?c:t:"Other"]=(o[h]||0)+l.value}else a&&(o.Internal=(o.Internal||0)+l.value)}}catch(t){s.e(t)}finally{s.f()}return Tb(Object.entries(o).map((function(n){var i,r=v(n,2),a=r[0],o=r[1];return{key:a,name:(null===(i=e.nodeNameMap)||void 0===i?void 0:i.get(a))||a,value:o,color:Pb(a,t,e)}})))}function kb(t,e){var n,i=e.topLocationKeys,r=e.flowTopLocationsType_,a=e.flowInternal_,o={},s=xb(e.flowGraph_.links);try{for(s.s();!(n=s.n()).done;){var l=n.value,c=l.source.id,u=l.target.id;if(c===t)if(c!==u){var h=void 0;o[h="origin"===r?t:"destination"===r?i.has(u)?u:"Other":i.has(u)||i.has(t)?i.has(u)?u:t:"Other"]=(o[h]||0)+l.value}else a&&(o.Internal=(o.Internal||0)+l.value)}}catch(t){s.e(t)}finally{s.f()}return Tb(Object.entries(o).map((function(n){var i,r=v(n,2),a=r[0],o=r[1];return{key:a,name:(null===(i=e.nodeNameMap)||void 0===i?void 0:i.get(a))||a,value:o,color:Pb(a,t,e)}})))}function Tb(t){return t.sort((function(t,e){return"Other"===t.key?1:"Other"===e.key?-1:e.value-t.value}))}function Pb(t,e,n){var i=n.topLocationKeys||new Set,r=n.locationColorScale;return"Other"===t?"#666":"Internal"===t?i.has(e)?r(e):"#999":i.has(t)?r(t):"#666"}function Nb(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Lb(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lb(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Lb(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}var Fb=function(t){var e=sx(t,!0,"flow");return e.strokeWidthScale=En(),e.labelFormatter=function(t){return mn(".2s")(t)},e.tooltip_.textFunction=Gb,e.flowMapType_="sankey",e.flowDonuts_=!1,e.flowColor_="#848484ff",e.flowOverlayColors_=["#bbd7ee","#c7e3c6"],e.flowMaxWidth_=30,e.flowMinWidth_=1,e.flowArrows_=!0,e.flowOutlines_=!0,e.flowGradient_=!0,e.flowStack_=!1,e.flowLabelOffsets_={x:3,y:0},e.flowOpacity_=.5,e.flowInternal_=!0,e.flowTopLocations_=5,e.flowTopLocationsType_="destination",["flowGraph_","flowColor_","flowOverlayColors_","flowArrows_","flowMaxWidth_","flowMinWidth_","flowOutlines_","flowGradient_","flowStack_","flowDonuts_","flowLabelOffsets_","flowMapType_","flowDonutSizeScale_","flowOpacity_","flowInternal_","flowTopLocations_","flowTopLocationsType_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),e.updateStyle=function(){var t,n=e.flowGraph_.links;e.strokeWidthScale=En().domain([Ot(n,(function(t){return t.value})),Gt(n,(function(t){return t.value}))]).range([e.flowMinWidth_,e.flowMaxWidth_]),e.flowDonuts_&&0==e.flowTopLocations_&&(e.flowTopLocations_=4),function(t){(function(t){t.flowGraph_.nodes.forEach((function(e){if("number"!=typeof e.x||"number"!=typeof e.y)if(t.Geometries.centroidsFeatures){var n=t.Geometries.centroidsFeatures.find((function(t){return e.id==t.properties.id}));if(n){var i=v(n.geometry.coordinates,2),r=i[0],a=i[1];e.x=r,e.y=a}else console.error("could not find coordinates for",e.id)}else{var o,s,l,c=null===(o=(s=t.Geometries).getRegionFeatures)||void 0===o?void 0:o.call(s),u=null==c?void 0:c.find((function(t){return t.properties.id===e.id})),h=v((null==u||null===(l=u.properties)||void 0===l?void 0:l.centroid)||t._pathFunction.centroid(u),2),f=h[0],p=h[1];e.x=f,e.y=p}}))})(t),function(t){var e,n=t.flowGraph_.nodes,i=Nb(n);try{for(i.s();!(e=i.n()).done;){var r=e.value,a=t._projection([r.x,r.y]);r.x=a[0],r.y=a[1]}}catch(t){i.e(t)}finally{i.f()}}(t),function(t){var e=t.flowGraph_,n=e.nodes,i=e.links,r=new Map;i.forEach((function(t){r.set(t.source,(r.get(t.source)||0)+t.value),r.set(t.target,(r.get(t.target)||0)+t.value)})),n.forEach((function(t){t.value=r.get(t.id)||0}))}(t),function(t){var e,n=t.flowGraph_.nodes,i=t.flowGraph_.links,r=function(t){return t.id},a=Nb(n.entries());try{for(a.s();!(e=a.n()).done;){var o=v(e.value,2),s=o[0],l=o[1];l.index=s,l.sourceLinks=[],l.targetLinks=[]}}catch(t){a.e(t)}finally{a.f()}var c,u=new Map(n.map((function(t,e){return[r(t,e,n),t]}))),h=Nb(i.entries());try{for(h.s();!(c=h.n()).done;){var f=v(c.value,2),p=f[0],d=f[1];d.index=p;var g=d.source,_=d.target;"object"!==ga(g)&&(g=d.source=Ob(u,g)),"object"!==ga(_)&&(_=d.target=Ob(u,_)),g.sourceLinks.push(d),_.targetLinks.push(d)}}catch(t){h.e(t)}finally{h.f()}}(t),t.flowTopLocations_&&function(t){var e=t.flowGraph_.nodes,n=t.flowTopLocations_,i=t.flowTopLocationsType_||"sum";e.forEach((function(t){var e=t.sourceLinks.reduce((function(t,e){return t+e.value}),0),n=t.targetLinks.reduce((function(t,e){return t+e.value}),0);t.topScore="origin"===i?e:"destination"===i?n:e+n}));var r=y(e).sort((function(t,e){return e.topScore-t.topScore})).slice(0,n);t.topLocationKeys=new Set(r.map((function(t){return t.id}))),t.locationColorScale=gv().domain(r.map((function(t){return t.id}))).range(["#00B3E3","#FBBA00","#2BA966","#D23142","#005289","#93397F","#E73E11","#4E4084","#056731","#00667E","#B5B900"])}(t);t.nodeNameMap=new Map(t.flowGraph_.nodes.map((function(t){return[t.id,t.name||t.id]})))}(e);var i=Ft("#em-zoom-group-"+e.svgId_).append("g").attr("class","em-flow-container");!function(t){var e=t.flowGraph_,n=[],i=[],r=t.Geometries.getRegionFeatures();if(!r)return;if(e.nodes.forEach((function(t){var e=t.sourceLinks.reduce((function(t,e){return t+e.value}),0),a=t.targetLinks.reduce((function(t,e){return t+e.value}),0);r.find((function(e){return e.properties.id===t.id}))?a>e?n.push(t.id):e>a&&i.push(t.id):console.warn("could not find region geometry for",t.id)})),t.importerRegionIds=n,t.exporterRegionIds=i,0===n.length&&0===i.length)return void console.warn("No importer or exporter regions found in the flow graph.");var a=pa(t),o=t.svg_.selectAll(a);o.each((function(){var e=this.__data__.properties.id;Ft(this).style("fill",(function(){return n.includes(e)?t.flowOverlayColors_[1]:i.includes(e)?t.flowOverlayColors_[0]:null})).attr("class",(function(){return n.includes(e)?"em-flow-importer":i.includes(e)?"em-flow-exporter":null}))}))}(e),"sankey"===e.flowMapType_?ub(e,i):yb(e,i),e.flowDonuts_&&(function(t){var e,n=t.flowGraph_.nodes,i=t.topLocationKeys||new Set,r=(t.locationColorScale,t.flowTopLocationsType_),a=xb(n);try{var o=function(){var n,a=e.value,o=new Map,s=0,l=xb(a.targetLinks);try{for(l.s();!(n=l.n()).done;){var c=n.value,u=c.source.id;if(u!==a.id){var h=void 0;h="origin"===r?i.has(u)?u:"Other":"destination"===r?i.has(a.id)?a.id:"Other":i.has(u)||i.has(a.id)?i.has(a.id)?a.id:u:"Other",o.set(h,(o.get(h)||0)+c.value)}else t.flowInternal_&&(s+=c.value)}}catch(t){l.e(t)}finally{l.f()}var f,p=xb(a.sourceLinks);try{for(p.s();!(f=p.n()).done;){var d=f.value,g=d.target.id;if(g!==a.id){var _=void 0;_="origin"===r?i.has(a.id)?a.id:"Other":"destination"===r?i.has(g)?g:"Other":i.has(g)||i.has(a.id)?i.has(g)?g:a.id:"Other",o.set(_,(o.get(_)||0)+d.value)}else t.flowInternal_&&(s+=d.value)}}catch(t){p.e(t)}finally{p.f()}a.donutValues=Array.from(o.entries()).map((function(e){var n=v(e,2),i=n[0];return{label:i,value:n[1],color:Pb(i,a.id,t)}})),t.flowInternal_&&s>0&&a.donutValues.push({label:"Internal",value:s,color:"#999"})};for(a.s();!(e=a.n()).done;)o()}catch(t){a.e(t)}finally{a.f()}}(e),function(t){var e,n={},i=xb(t.flowGraph_.nodes);try{for(i.s();!(e=i.n()).done;){var r=e.value;n[r.id]={x:r.x,y:r.y,incoming:0,outgoing:0,internal:0}}}catch(t){i.e(t)}finally{i.f()}var a,o=xb(t.flowGraph_.links);try{for(o.s();!(a=o.n()).done;){var s=a.value,l=s.source.id,c=s.target.id;n[l]&&(n[l].outgoing+=s.value),n[c]&&(n[c].incoming+=s.value),l===c&&(n[l].internal+=s.value)}}catch(t){o.e(t)}finally{o.f()}t.locationStats=n}(e),function(t,e){var n=e.append("g").attr("class","donuts").attr("id","donuts"),i=Gt(t.flowGraph_.nodes,(function(t){return sb(t.donutValues,(function(t){return t.value}))}));t.donutSizeScale=t.flowDonutSizeScale_||Kv().domain([0,i]).range([3,10]);var r=Dr().innerRadius(5),a=Ux().value((function(t){return t.value})).sort(null);Object.entries(t.locationStats).forEach((function(e){var i=v(e,2),o=i[0],s=i[1],l=s.x,c=s.y,u=s.incoming,h=s.outgoing,f=s.internal,p=t.flowInternal_?u+h+f:u+h;if(0!==p){var d=Ab(o,t),g=kb(o,t),_=[].concat(y(d),y(g)),m=new Map;_.forEach((function(t){var e=t.color;m.set(e,(m.get(e)||0)+t.value)}));var x=Array.from(m,(function(t){var e=v(t,2),n=e[0];return{label:n,value:e[1],color:n}})),b=a(x);b.forEach((function(e){e.data.parent={id:o,name:t.nodeNameMap.get(o)||o,donutValues:x}}));var w=n.append("g").attr("class","donut-group").attr("transform","translate(".concat(l,",").concat(c,")")).attr("data-total",p);w.selectAll("path").data(b).join("path").attr("d",r.innerRadius(.4*t.donutSizeScale(p)).outerRadius(t.donutSizeScale(p))).attr("fill",(function(t){return t.data.color})).attr("stroke","white").attr("stroke-width",.5).style("cursor","pointer").on("mouseover",(function(e,n){t._tooltip&&t._tooltip.mouseover(Mb(n,t)),Eb(e,t.svg_),wb(0,n)})).on("mousemove",(function(e,n){t._tooltip&&t._tooltip.mousemove(e)})).on("mouseout",(function(e,n){t._tooltip&&t._tooltip.mouseout(),Cb(e,t.svg_),Sb()})),w.append("circle").attr("r",.4*t.donutSizeScale(p)).attr("fill","white").style("cursor","pointer").on("mouseover",(function(e){var n=b[0];t._tooltip&&t._tooltip.mouseover(Mb(n,t)),Eb(e,t.svg_),wb(0,n)})).on("mousemove",(function(e){t._tooltip&&t._tooltip.mousemove(e)})).on("mouseout",(function(e){t._tooltip&&t._tooltip.mouseout(),Cb(e,t.svg_),Sb()}))}}))}(e,i)),null!==(t=e.labels_)&&void 0!==t&&t.values&&function(t,e){var n,i=t.flowGraph_.nodes,r=i.filter((function(t){return t.targetLinks&&0===t.sourceLinks.length})),a=e.append("g").attr("class","em-flow-labels");if(null!==(n=t.labels_)&&void 0!==n&&n.shadows){a.append("g").attr("class","em-flow-label-shadow").selectAll("text").data(r).join("text").attr("text-anchor",(function(t){return t.x>t.targetLinks[0].source.x?"start":"end"})).attr("x",(function(e){return e.x>e.targetLinks[0].source.x?e.x+t.flowLabelOffsets_.x:e.x-t.flowLabelOffsets_.x})).attr("y",(function(e){return e.y+t.flowLabelOffsets_.y})).text((function(e){return t.labelFormatter(e.value)}))}var o=a.append("g").attr("class","em-flow-label").selectAll("g").data(r).join("g").attr("transform",(function(t){return"translate(".concat(t.x,", ").concat(t.y,")")}));o.append("text").attr("class","em-label-text").attr("text-anchor",(function(t){return t.x>t.targetLinks[0].source.x?"start":"end"})).attr("x",(function(e){return e.x>e.targetLinks[0].source.x?t.flowLabelOffsets_.x:-t.flowLabelOffsets_.x})).attr("y",t.flowLabelOffsets_.y).text((function(e){return t.labelFormatter(e.value)})),t.labels_.backgrounds&&o.each((function(){var t=Ft(this).select("text").node().getBBox(),e=5,n=2;Ft(this).insert("rect","text").attr("class","em-label-background").attr("x",t.x-e).attr("y",t.y-n).attr("width",t.width+2*e).attr("height",t.height+2*n)}))}(e,i)},e.updateClassification=function(){},e.getLegendConstructor=function(){return eb},e};function Ob(t,e){var n=t.get(e);if(!n)throw new Error("missing: "+e);return n}var Gb=function(t,e){var n=[],i=e.statData().unitText()||"",r="".concat(t.source.name||t.source.id," to ").concat(t.target.name||t.target.id);return n.push('\n <div class="em-tooltip-bar">\n <b>'.concat(r,"</b>\n </div>\n ")),n.push("<div class='em-tooltip-text'>\n <table class=\"em-tooltip-table\">\n <tbody>\n <tr><td>".concat(la(t.value)," ").concat(i,"</td></tr>\n </tbody>\n </table> \n </div>")),n.join("")};function Db(t){return Math.sign(t)*t*t}function zb(){var t,e=on(),n=[0,1],i=!1;function r(n){var r=function(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}(e(n));return isNaN(r)?t:i?Math.round(r):r}return r.invert=function(t){return e.invert(Db(t))},r.domain=function(t){return arguments.length?(e.domain(t),r):e.domain()},r.range=function(t){return arguments.length?(e.range((n=Array.from(t,Ke)).map(Db)),r):n.slice()},r.rangeRound=function(t){return r.range(t).round(!0)},r.round=function(t){return arguments.length?(i=!!t,r):i},r.clamp=function(t){return arguments.length?(e.clamp(t),r):e.clamp()},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return zb(e.domain(),n).round(i).clamp(e.clamp()).unknown(t)},Ht.apply(r,arguments),Mn(r)}function Ib(t,e){if((r=t.length)>1)for(var n,i,r,a=1,o=t[e[0]],s=o.length;a<r;++a)for(i=o,o=t[e[a]],n=0;n<s;++n)o[n][1]+=o[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Rb(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function jb(t,e){return t[e]}function Bb(t){const e=[];return e.key=t,e}var qb=function(t,e){var n=ax(t);if(n.sizeLegend={title:null,titlePadding:15,values:null},n.colorLegend={title:null,titlePadding:15,marginTop:23,labelOffsets:{x:5,y:5},shapeWidth:25,shapeHeight:20,shapePadding:1,noData:!0,noDataText:"No data"},n.monthLegend={title:null,marginTop:10},n._sizeLegendHeight=0,e)for(var i in e)if("colorLegend"===i||"sizeLegend"===i)for(var r in n[i])void 0!==e[i][r]&&(n[i][r]=e[i][r]);else n[i]=e[i];function a(t,e){var n=t.svg_.selectAll(".em-coxcomb-chart").selectAll("path[code]");n.style("fill","white"),n.filter("path[code='"+e+"']").each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}function o(t){t.svg_.selectAll(".em-coxcomb-chart").selectAll("path[code]").each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}return n.update=function(){n.updateConfig(),n.updateContainer();var e=n.lgg;e.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle();var i=n.getBaseY(),r=n.getBaseX();if(t.classifierSize_){var s=e.append("g").attr("class","em-coxcomb-size-legend").attr("transform","translate(".concat(r,", ").concat(i,")"));n._sizeLegendContainer=s,$y(n,s,n.sizeLegend.values,n.map.classifierSize_,n.sizeLegend.title,n.sizeLegend.titlePadding)}!function(t,e,n){var i=t.map,r=t.colorLegend;t._colorLegendContainer=t.lgg.append("g").attr("class","em-coxcomb-color-legend");var s=0;t._sizeLegendContainer?(s=t._sizeLegendContainer.node().getBBox().height,t._colorLegendContainer.attr("transform","translate(".concat(e,",").concat(s+t.colorLegend.marginTop,")"))):t._colorLegendContainer.attr("transform","translate(".concat(e,",").concat(n,")"));r.title&&t._colorLegendContainer.append("text").attr("class","em-color-legend-title").attr("id","em-color-legend-title").attr("x",0).attr("y",t.titleFontSize).text(r.title);var l=0,c=i.catColors(),u=function(e){var n=t.colorLegend.titlePadding+(r.title?t.titleFontSize:0)+l*(r.shapeHeight+r.shapePadding),s=i.catColors()[e]||"lightgray";t._colorLegendContainer.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",n).attr("width",r.shapeWidth).attr("height",r.shapeHeight).style("fill",s).attr("stroke","black").attr("stroke-width",.5).on("mouseover",(function(){a(t.map,e),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,a,e)})).on("mouseout",(function(){o(t.map),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,o,e)})),t._colorLegendContainer.append("text").attr("class","em-legend-label").attr("x",r.shapeWidth+r.labelOffsets.x).attr("y",n+.5*r.shapeHeight).attr("dy","0.35em").text(i.catLabels()[e]||e),l++};for(var h in c)u(h);if(r.noData){var f=s+t.colorLegend.marginTop+(r.title?t.titleFontSize+t.boxPadding:0)+l*(r.shapeHeight+r.shapePadding),p=t.lgg.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(t.boxPadding,",").concat(f,")"));t.appendNoDataLegend(p,t.noDataText,a,o)}}(n,r,i),function(t,e,n){var i,r,a=t.map._coxcombMonths||[],o=40;if(!a.length)return;var s=n,l=e;t._sizeLegendContainer&&(s+=t._sizeLegendContainer.node().getBBox().height);t._colorLegendContainer&&(s+=t._colorLegendContainer.node().getBBox().height,s+=t.colorLegend.marginTop||0);s+=(null===(i=t.monthLegend)||void 0===i?void 0:i.marginTop)||0,s+=o;var c=18,u=2*Math.PI/a.length,h=(null===(r=t._colorLegendContainer)||void 0===r||null===(r=r.node())||void 0===r?void 0:r.getBBox().width)||0,f=l+h/2+c,p=t.lgg.append("g").attr("class","em-coxcomb-month-legend").attr("transform","translate(".concat(f,", ").concat(s+o,")")),d=Dr().innerRadius(0).outerRadius(o).startAngle((function(t,e){return e*u})).endAngle((function(t,e){return(e+1)*u}));p.selectAll("path").data(a).join("path").attr("d",(function(t,e){return d(t,e)})).attr("fill","#ccc").attr("class","em-legend-month-segment");var g=o+c,_=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];p.selectAll("text.month-label").data(a).join("text").attr("class","em-legend-label em-month-label").attr("x",(function(t,e){return Math.sin(e*u+u/2)*g})).attr("y",(function(t,e){return-Math.cos(e*u+u/2)*g})).attr("text-anchor","middle").attr("alignment-baseline","middle").text((function(t){var e=t.toString().slice(5,7);return _[parseInt(e,10)-1]||t})),p.selectAll("path").on("mouseover",(function(e,n){var i=n;(t.map.svg_||t.map.svg()).selectAll(".em-coxcomb-chart path").style("opacity",(function(t){return t.data.month===i?1:0})),Ft(this).style("stroke-width",1.5).style("opacity",.8)})).on("mouseout",(function(){(t.map.svg_||t.map.svg()).selectAll(".em-coxcomb-chart path").style("opacity",1),Ft(this).style("stroke-width",.3).style("opacity",.4)}))}(n,r,i),n.setBoxDimension()},n},Ub=function(t){var e=sx(t,!0,"coxcomb");function n(t){var n=e.yearlyTotals;return void 0!==n[t]?n[t]:void 0}function i(t){if(e.catLabels_=e.catLabels_||{},e.svg_){var i=t.getCentroidsGroup(t);if(i){var r=i.selectAll("g.em-centroid"),a=r.data().filter((function(t){return void 0!==n(t.properties.id)}));a.forEach((function(t){r.filter((function(e){return e.properties.id===t.properties.id})).append("g").attr("class","em-coxcomb").attr("id","cox_"+t.properties.id)})),function(t){var i=function(e){var n;return null===(n=t.tooltip_.omitRegions)||void 0===n?void 0:n.includes(e)},r=pa(t),a=t.svg().selectAll(r),o=t.svg().selectAll("g.em-centroid");[a,o].forEach((function(t){t.on("mouseover",(function(t,r){if(!i(r.properties.id)&&n(r.properties.id)){var a=Ft(this);a.attr("fill___",a.style("fill")),a.style("fill",e.hoverColor_),a.select("circle.em-coxcomb-max-outline").attr("stroke-width",2),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(r,e))}})).on("mousemove",(function(t,r){i(r.properties.id)||n(r.properties.id)&&e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(r,e))})).on("mouseout",(function(t,r){if(!i(r.properties.id)&&n(r.properties.id)){var a=Ft(this);a.style("fill",a.attr("fill___")||e.noDataFillStyle_),a.attr("fill___",null),a.select("circle.em-coxcomb-max-outline").attr("stroke-width",.3),e._tooltip&&e._tooltip.mouseout()}})).on("click",(function(t,r){i(r.properties.id)||n(r.properties.id)&&e._tooltip&&e._tooltip.click(r,e)}))}))}(t),function(t){var n=e._coxcombMonths,i=e._coxcombCauses,r=function(t){return _v().domain(t).range([0,2*Math.PI]).align(0)}(n);t.forEach((function(t){var a=t.properties.id,o=function(t,n,i){var r=n.map((function(n){var r={month:n},a=0;if(i.forEach((function(i){var o,s=null===(o=e.statData("".concat(n,":").concat(i)))||void 0===o?void 0:o.get(t),l=(null==s?void 0:s.value)||0;r[i]=l,a+=l})),e.totalCode_){var o,s=null===(o=e.statData("".concat(n,":").concat(e.totalCode_)))||void 0===o?void 0:o.get(t),l=(null==s?void 0:s.value)||0,c=l>a?l-a:0;c>0&&(r.other=c)}return Object.values(r).some((function(t){return t&&t>0}))?r:null})).filter(Boolean),a=r.some((function(t){return(t.other||0)>0}));if(!a){var o,s;r.forEach((function(t){return delete t.other})),null===(o=e.catColors_)||void 0===o||delete o.other,null===(s=e.catLabels_)||void 0===s||delete s.other}return r}(a,n,i);if(o.length){var s=function(t,e){var n=y(e);t.some((function(t){return(t.other||0)>0}))&&n.push("other");return n}(o,i),l=function(){var t=ur([]),e=Rb,n=Ib,i=jb;function r(r){var a,o,s=Array.from(t.apply(this,arguments),Bb),l=s.length,c=-1;for(const t of r)for(a=0,++c;a<l;++a)(s[a][c]=[0,+i(t,s[a].key,c,r)]).data=t;for(a=0,o=Tx(e(s));a<l;++a)s[o[a]].index=a;return n(s,o),s}return r.keys=function(e){return arguments.length?(t="function"==typeof e?e:ur(Array.from(e)),r):t},r.value=function(t){return arguments.length?(i="function"==typeof t?t:ur(+t),r):i},r.order=function(t){return arguments.length?(e=null==t?Rb:"function"==typeof t?t:ur(Array.from(t)),r):e},r.offset=function(t){return arguments.length?(n=null==t?Ib:t,r):n},r}().keys(s);!function(t,n,i,r){var a=e.svg().selectAll("#cox_"+t);if(e.coxcombRings_){var o=e.yearlyTotals[t]||0,s=e.classifierSize_(o);a.append("circle").attr("class","em-coxcomb-max-outline").attr("r",0).attr("fill","none").attr("stroke","#000").attr("stroke-width",.3).attr("opacity",.5).attr("pointer-events","none").transition().duration(e.transitionDuration_/2).attr("r",s)}var l=Dr().startAngle((function(t){return r(t.data.month)})).endAngle((function(t){return r(t.data.month)+r.bandwidth()})).padAngle(.01).padRadius(0);i.forEach((function(r){a.append("g").attr("class","em-coxcomb-chart").attr("stroke","#ffffff").attr("stroke-width",.3).selectAll("path").data(n[i.indexOf(r)]).join("path").attr("fill",e.catColors_[r]||("other"===r?"#FFCC80":"lightgray")).attr("fill___",e.catColors_[r]||("other"===r?"#FFCC80":"lightgray")).attr("code",r).attr("month",(function(t){return t.data.month})).transition().delay((function(t,e){return 120*e})).duration(e.transitionDuration_).attrTween("d",(function(n){var i=Ye(0,e.classifierChartSize_(n[0],t)),r=Ye(0,e.classifierChartSize_(n[1],t));return function(t){return l.innerRadius(i(t)).outerRadius(r(t))(n)}}))}))}(a,l(o),s,r)}}))}(a),e.dorling_?jy(e,(function(t){var i=n(t.properties.id)||0;return e.classifierSize_(i)||0})):stopDorlingSimulation(e)}}}return e.coxcombMinRadius_=10,e.coxcombMaxRadius_=80,e.coxcombStrokeFill_="white",e.coxcombStrokeWidth_=.3,e.coxcombRings_=!0,e.catColors_=void 0,e.catLabels_=void 0,e.classifierSize_=null,["catColors_","catLabels_","noDataFillStyle_","coxcombMaxRadius_","coxcombMinRadius_","coxcombRings_","coxcombStrokeFill_","coxcombStrokeWidth_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),t&&["catColors","catLabels","noDataFillStyle","coxcombMaxRadius","coxcombMinRadius","coxcombInnerRadius","coxcombStrokeFill","coxcombStrokeWidth"].forEach((function(n){null!=t[n]&&e[n](t[n])})),e.statCodes_=void 0,e.totalCode_=void 0,e.statCoxcomb=function(t,n,i,r,a,o,s){return e._coxcombMonths=n,e._coxcombCauses=y(r),e._coxcombDim=i,t.filters=t.filters||{},n.forEach((function(n){if(r.forEach((function(s){t.filters.time=n,t.filters[i]=s;var l={};for(var c in t)l[c]=t[c];for(var u in l.filters={},t.filters)l.filters[u]=t.filters[u];var h="".concat(n,":").concat(s);e.stat(h,l),o&&(e.catColors_=e.catColors_||{},e.catColors_[s]=o[r.indexOf(s)]),a&&(e.catLabels_=e.catLabels_||{},e.catLabels_[s]=a[r.indexOf(s)])})),s){t.filters.time=n,t.filters[i]=s;var l={};for(var c in t)l[c]=t[c];for(var u in l.filters={},t.filters)l.filters[u]=t.filters[u];var h="".concat(n,":").concat(s);e.stat(h,l)}})),s&&(e.totalCode_=s,e.catColors_.other="#FFCC80",e.catLabels_.other="Other"),e},e.updateClassification=function(){if(!e.statCodes_){e.statCodes_=Object.keys(e.statData_);var t=e.statCodes_.indexOf("default");t>-1&&e.statCodes_.splice(t,1)}var n,i,r,a,o,s;return function(){var t={},n={};e.totalCode_?e._coxcombMonths.forEach((function(i){var r=e.statData("".concat(i,":").concat(e.totalCode_));if(r&&r._data_)for(var a in r._data_){var o,s=(null===(o=r._data_[a])||void 0===o?void 0:o.value)||0;n[a]=n[a]||{},n[a][i]=s,t[a]=(t[a]||0)+s}})):e._coxcombMonths.forEach((function(i){var r={};for(var a in e._coxcombCauses.forEach((function(t){var n=e.statData("".concat(i,":").concat(t));if(n&&n._data_)for(var a in n._data_){var o,s=(null===(o=n._data_[a])||void 0===o?void 0:o.value)||0;r[a]=(r[a]||0)+s}})),r)n[a]=n[a]||{},n[a][i]=r[a],t[a]=(t[a]||0)+r[a]}));e.yearlyTotals=t,e.monthlyTotals=n}(),n=Object.values(e.yearlyTotals),i=e.coxcombMinRadius_||0,r=e.coxcombMaxRadius_||80,a=Ot(n)||0,o=Gt(n)||0,s=zb().domain([a,o]).range([i,r]),e.classifierChartSize_=function(t,n){var i=s(e.yearlyTotals[n]||0),r=t/Math.max.apply(Math,y(Object.values(e.monthlyTotals[n]||{0:1})));return Math.sqrt(r)*i},e.classifierSize_=s,e},e.updateStyle=function(){if(!e.catColors_){e.catColors({});for(var t=0;t<e.statCodes_.length;t++)e.catColors_[e.statCodes_[t]]=Wx[t%10]}try{return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,i),i(e),e.dorling_?jy(e,(function(t){var i=n(t.properties.id)||0;return e.classifierSize_(i)||0})):stopDorlingSimulation(e),e}catch(t){console.error("Error in updateStyle:",t.message),console.error(t)}return e},e.getLegendConstructor=function(){return qb},e.tooltip_.textFunction=function(t,n){var i,r=t.properties.na||t.properties.name,a=t.properties.id,o=e._coxcombMonths||[],s=y(e._coxcombCauses),l=o.some((function(t){var n,i=(null===(n=e.statData("".concat(t,":").concat(e.totalCode_)))||void 0===n||null===(n=n.get(a))||void 0===n?void 0:n.value)||0,r=e._coxcombCauses.reduce((function(n,i){var r;return n+((null===(r=e.statData("".concat(t,":").concat(i)))||void 0===r||null===(r=r.get(a))||void 0===r?void 0:r.value)||0)}),0);return i>r}));l&&s.push("other");var c='<div class="em-tooltip-bar">'.concat(r).concat(a?" (".concat(a,")"):"","</div>"),u=['<th class="em-breakdown-label">Month</th>'];s.forEach((function(t){var n=e.catLabels_[t]||t,i=e.catColors_[t]||("other"===t?"#FFCC80":"#999");u.push('<th class="em-breakdown-label" style="color:'.concat(i,'">').concat(n,"</th>"))})),u.push('<th class="em-breakdown-label">Total</th>');var h="<tr>".concat(u.join(""),"</tr>"),f=e.yearlyTotals||{},p=e.monthlyTotals||{},d=f[a]||0,g=o.map((function(t){var n,i=['<td class="em-breakdown-label">'.concat(t,"</td>")],r=(null===(n=p[a])||void 0===n?void 0:n[t])||0;return s.forEach((function(n){var r=0;if("other"===n){var o,l=(null===(o=e.statData("".concat(t,":").concat(e.totalCode_)))||void 0===o||null===(o=o.get(a))||void 0===o?void 0:o.value)||0,c=s.filter((function(t){return"other"!==t})).reduce((function(n,i){var r;return n+((null===(r=e.statData("".concat(t,":").concat(i)))||void 0===r||null===(r=r.get(a))||void 0===r?void 0:r.value)||0)}),0);r=Math.max(l-c,0)}else{var u;r=(null===(u=e.statData("".concat(t,":").concat(n)))||void 0===u||null===(u=u.get(a))||void 0===u?void 0:u.value)||0}i.push(r>0?'<td><span class="em-breakdown-value">'.concat(la(r),"</span></td>"):"<td></td>")})),i.push(r>0?'<td><span class="em-breakdown-value">'.concat(la(r),"</span></td>"):"<td></td>"),"<tr>".concat(i.join(""),"</tr>")})),_=(null===(i=e.statData(e.statCodes_[0]))||void 0===i?void 0:i.unitText())||"";return c+='<div class="em-tooltip-breakdown em-tooltip-cx"><table class="em-tooltip-cx-table">',c+=h+g.join(""),d>0&&(c+='\n <tr class="em-total">\n <td class="em-breakdown-label">Year total</td>\n <td colspan="'.concat(s.length,'"></td>\n <td>\n <span class="em-breakdown-value">').concat(la(d)," ").concat(_,"</span>\n </td>\n </tr>")),c+="</table></div>"},e};var Wb=function(t,e){try{return"choropleth"==t||"ch"==t?bx(e):"categorical"==t||"ct"==t?function(t){var e=sx(t,!1,"ct");e.classToFillStyle_=void 0,e.classToText_=void 0,e.tooltip_.textFunction=Ax,e.classifier_=void 0,["classToFillStyle_","classToText_","noDataFillStyle_","tooltipText_","classifier_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),t&&["classToFillStyle","classToText","noDataFillStyle","tooltipText","classifier"].forEach((function(n){null!=t[n]&&e[n](t[n])})),e.updateClassification=function(){return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,n),n(e),e};var n=function(t){var n=e.statData().getUniqueValues(),i=y(Array(n.length).keys()),r=e.classToFillStyle_?e.classToFillStyle():void 0;if(r){var a=Object.keys(r);e.classifier(gv().domain(a).range(a.map((function(t,e){return e}))))}else e.classifier(gv().domain(n).range(i));var o=function(t){t.attr("ecl",(function(t){var n=e.statData().get(t.properties.id);if(n){var i=n.value;if(":"===i)return"nd";var r=isNaN(i)?i:+i;if(e.classifier().domain().includes(r))return e.classifier()(r)}}))},s=pa(t);o(t.svg().selectAll(s)),"mixed"===t.nutsLevel_&&o(t.svg().selectAll("path.em-nutsrg0"))};function i(t){if(t.svg_){var n=pa(t),i=t.svg().selectAll(n);i.style("pointer-events","none").transition().duration(e.transitionDuration()).style("fill",a).end().then((function(){i.style("pointer-events",null),i.each((function(){var t=Ft(this);t.attr("fill___",t.style("fill"))})),o(t,i),e.gridCartogram_&&t.svg().selectAll(".em-grid-text").each((function(){var t=Ft(this.parentNode).style("fill");Ft(this).attr("fill",fa(t))}))})).catch((function(t){})),"mixed"===e.nutsLevel_&&r(t),e.labels_&&e.labels_.values&&e.updateValuesLabels(t),e.patternFill_&&vy(t,e.patternFill_)}}e.updateStyle=function(){if(!e.classToFillStyle()){for(var t={},n=e.classifier().domain(),r=0;r<n.length;r++)t[n[r]]=Ex[r%12];e.classToFillStyle(t)}return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,i),i(e),e};var r=function(t){t.svg().selectAll(pa(t)).style("display",(function(t){if(!this.parentNode.classList.contains("em-cntrg")){var e=Ft(this),n=e.attr("ecl"),i=e.attr("lvl");return n||"0"===i?"block":"none"}})).style("stroke",(function(){var t=Ft(this),e=t.attr("lvl"),n=t.attr("ecl"),i=t.style("stroke");return n&&"0"!==e?i||"#777":null})).style("stroke-width",(function(){var t=Ft(this),e=t.attr("lvl"),n=t.attr("ecl"),i=t.style("stroke-width");return n&&"0"!==e?i||.2:null}))},a=function(t){var n=Ft(this).attr("ecl");return e.Geometries.userGeometries?n?"nd"===n?e.noDataFillStyle()||"gray":e.classToFillStyle_[e.classifier().domain()[n]]:aa("em-nutsrg","fill"):"WORLD"===e.geo_?n?"nd"===n?e.noDataFillStyle()||"gray":e.classToFillStyle_[e.classifier().domain()[n]]||e.cntrgFillStyle_:e.cntrgFillStyle_:(t.properties.id.slice(0,2),n?"nd"===n?e.noDataFillStyle()||"gray":e.classToFillStyle_[e.classifier().domain()[n]]:aa("em-nutsrg","fill"))},o=function(t,n){var i=function(e){var n;return null===(n=t.tooltip_.omitRegions)||void 0===n?void 0:n.includes(e)};n.on("mouseover",(function(n,r){i(r.properties.id)||(Ft(this).style("fill",t.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(r,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,r,this,t))})).on("mousemove",(function(n,r){i(r.properties.id)||(e._tooltip&&e._tooltip.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,r,this,t))})).on("mouseout",(function(n,r){if(!i(r.properties.id)){var a=Ft(this);a.style("fill",a.attr("fill___")),e._tooltip&&e._tooltip.mouseout(),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,r,this,t)}}))};return e.getLegendConstructor=function(){return Cx},e}(e):"proportionalSymbol"==t||"proportionalSymbols"==t||"ps"==t?Uy(e):"bivariateChoropleth"==t||"chbi"==t?function(t){var e=sx(t,!1,"chbi");function n(t){var n=function(t){t.attr("ecl1",(function(t){var n=e.statData("v1").get(t.properties.id);if(n){var i=n.value;return 0!=i&&!i||":"==i?"nd":+e.classifier1_(+i)}})).attr("ecl2",(function(t){var n=e.statData("v2").get(t.properties.id);if(n){var i=n.value;return 0!=i&&!i||":"==i?"nd":+e.classifier2_(+i)}})).attr("nd",(function(t){var n=e.statData("v1").get(t.properties.id),i=e.statData("v2").get(t.properties.id);if(n&&i){var r=n.value;return 0!=r&&!r||":"==r||0!=(r=i.value)&&!r||":"==r?"nd":""}}))};if(function(){var t=e.statData("v1").getArray(),n=e.statData("v2").getArray(),i=y(Array(e.numberOfClasses()).keys());if(e.classifier1_||(e.breaks1_?e.classifier1(An().domain(e.breaks1_).range(i)):e.classifier1(Vt().domain(t).range(i))),e.classifier2_||(e.breaks2_?e.classifier2(An().domain(e.breaks2_).range(i)):e.classifier2(Vt().domain(n).range(i))),!e.classToFillStyle_){var r=Dx(e.numberOfClasses(),e.startColor(),e.color1(),e.color2(),e.endColor());e.classToFillStyle(r)}}(),t.svg_){var i=pa(t);n(t.svg().selectAll(i)),"mixed"===t.nutsLevel_&&n(t.svg().selectAll("path.em-nutsrg0"))}}function i(t){if(t.svg()){var n=pa(t),i=t.svg().selectAll(n);i.style("pointer-events","none").transition().duration(e.transitionDuration()).style("fill",(function(t){var n=Ft(this).attr("ecl1");if("nd"===n)return e.noDataFillStyle()||"gray";var i=Ft(this).attr("ecl2");return n||i?"nd"===i?e.noDataFillStyle()||"gray":e.classToFillStyle_(+n,+i):aa("em-nutsrg","fill")})).end().then((function(){i.style("pointer-events",null),i.each((function(){var t=Ft(this);t.attr("fill___",t.style("fill"))})),a(t,i),e.gridCartogram_&&t.svg().selectAll(".em-grid-text").each((function(){var t=Ft(this.parentNode).style("fill");Ft(this).attr("fill",fa(t))}))}),(function(t){})),"mixed"==e.nutsLevel_&&r(t)}}e.numberOfClasses_=3,e.startColor_="#e8e8e8",e.color1_="#73ae80",e.color2_="#6c83b5",e.endColor_="#2a5a5b",e.classToFillStyle_=void 0,e.classifier1_=void 0,e.classifier2_=void 0,e.breaks1_=void 0,e.breaks2_=void 0,e.tooltip_.textFunction=zx,["numberOfClasses_","breaks1_","breaks2_","startColor_","color1_","color2_","endColor_","classToFillStyle_","noDataFillStyle_","classifier1_","classifier2_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),t&&["numberOfClasses","startColor","color1","color2","endColor","classToFillStyle","noDataFillStyle"].forEach((function(n){null!=t[n]&&e[n](t[n])})),e.updateClassification=function(){return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,n),n(e),e},e.updateStyle=function(){return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,i),i(e),e};var r=function(t){t.svg().selectAll(pa(t)).each((function(){if(!this.parentNode.classList.contains("em-cntrg")){var t=Ft(this),e=t.attr("ecl1"),n=t.attr("ecl2"),i=t.attr("lvl"),r=e||n||"0"===i;if(t.style("display",r?"block":"none"),(e||n)&&"0"!==i){var a=t.style("stroke")||"#777",o=t.style("stroke-width")||.2;t.style("stroke",a).style("stroke-width",o)}}}))},a=function(t,n){var i=function(e){var n;return null===(n=t.tooltip_.omitRegions)||void 0===n?void 0:n.includes(e)};n.on("mouseover",(function(n,r){var a;i(r.properties.id)||(Ft(this).style("fill",t.hoverColor_),null===(a=e._tooltip)||void 0===a||a.mouseover(e.tooltip_.textFunction(r,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,r,this,t))})).on("mousemove",(function(n,r){var a;i(r.properties.id)||(null===(a=e._tooltip)||void 0===a||a.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,r,this,t))})).on("mouseout",(function(n,r){if(!i(r.properties.id)){var a,o=Ft(this),s=o.attr("fill___");s&&(o.style("fill",s),null===(a=e._tooltip)||void 0===a||a.mouseout()),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,r,this,t)}}))};return e.getLegendConstructor=function(){return Gx},e}(e):"trivariateChoropleth"==t||"chbi"==t?function(t){var e=sx(t,!1,"chtri");function n(t){if(t.svg_){var n=pa(t);t.svg().selectAll(n).each((function(n){var i,r,a,o=+(null===(i=t.statData("v1").get(n.properties.id))||void 0===i?void 0:i.value)||0,s=+(null===(r=t.statData("v2").get(n.properties.id))||void 0===r?void 0:r.value)||0,l=+(null===(a=t.statData("v3").get(n.properties.id))||void 0===a?void 0:a.value)||0,c={value1:o,value2:s,value3:l};if(o+s+l){var u=e.colorClassifier_(c);Ft(this).attr("regionClass","tri").style("fill",u)}else Ft(this).attr("regionClass","nd").style("fill",e.noDataFillStyle())}))}}function i(t){if(t.svg()){var n=pa(t);t.svg().selectAll(n).transition().duration(e.transitionDuration()).style("fill",(function(n){var i,r,a,o=+(null===(i=t.statData("v1").get(n.properties.id))||void 0===i?void 0:i.value)||0,s=+(null===(r=t.statData("v2").get(n.properties.id))||void 0===r?void 0:r.value)||0,l=+(null===(a=t.statData("v3").get(n.properties.id))||void 0===a?void 0:a.value)||0,c={value1:o,value2:s,value3:l};return o+s+l?e.colorClassifier_(c):e.noDataFillStyle()})).end().then((function(){t.svg().selectAll(n).each((function(){var t=Ft(this);t.attr("fill___",t.style("fill"))}))}))}}e.color1_=(null==t?void 0:t.color1)||"#e41a1c",e.color2_=(null==t?void 0:t.color2)||"#4daf4a",e.color3_=(null==t?void 0:t.color3)||"#377eb8",e.startColor_=(null==t?void 0:t.startColor)||"#e8e8e8",e.centerCoefficient_=(null==t?void 0:t.centerCoefficient)||.2,e.noDataFillStyle_=(null==t?void 0:t.noDataFillStyle)||"#ccc",e.colorClassifier_=null,e.tooltip_.textFunction=jx,["color1_","color2_","color3_","centerCoefficient_","noDataFillStyle_","colorClassifier_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),e.updateClassification=function(){return e.statData("v1")&&e.statData("v2")&&e.statData("v3")?(e.colorClassifier_=Rx(["value1","value2","value3"],(function(t){return(+t.value1||0)+(+t.value2||0)+(+t.value3||0)}),[e.color1(),e.color2(),e.color3()],{centerCoefficient:e.centerCoefficient(),withMixedClasses:!0,defaultColor:e.noDataFillStyle()}),e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,n),n(e),e):e},e.updateStyle=function(){return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,i),i(e),r(e,e.svg().selectAll(pa(e))),e};var r=function(t,n){var i=function(e){var n;return null===(n=t.tooltip_.omitRegions)||void 0===n?void 0:n.includes(e)};n.on("mouseover",(function(n,r){i(r.properties.id)||(Ft(this).style("fill",t.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(r,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,r,this,t))})).on("mousemove",(function(n,r){i(r.properties.id)||(e._tooltip&&e._tooltip.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,r,this,t))})).on("mouseout",(function(n,r){if(!i(r.properties.id)){var a=Ft(this);a.style("fill",a.attr("fill___")),e._tooltip&&e._tooltip.mouseout(),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,r,this,t)}}))};return e.getLegendConstructor=function(){return Ix},e}(e):"stripeComposition"==t||"scomp"==t?function(t){var e=sx(t,!1,"scomp");e.stripeWidth_=50,e.stripeOrientation_=0,e.catColors_=void 0,e.catLabels_=void 0,e.showOnlyWhenComplete_=!1,e.pieChartRadius_=40,e.pieChartInnerRadius_=15,["stripeWidth_","stripeOrientation_","catColors_","catLabels_","showOnlyWhenComplete_","noDataFillStyle_","pieChartRadius_","pieChartInnerRadius_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),t&&["stripeWidth","stripeOrientation","catColors","catLabels","showOnlyWhenComplete","noDataFillStyle","pieChartRadius","pieChartInnerRadius"].forEach((function(n){null!=t[n]&&e[n](t[n])})),e.statComp=function(t,i,r,a,o){t.filters=t.filters||{};for(var s=0;s<r.length;s++){var l=r[s];t.filters[i]=l;var c={};for(var u in t)c[u]=t[u];for(var h in c.filters={},t.filters)c.filters[h]=t.filters[h];e.stat(l,c),o&&(e.catColors_=e.catColors_||{},e.catColors_[l]=o[s]),a&&(e.catLabels_=e.catLabels_||{},e.catLabels_[l]=a[s])}return n=r,e};var n=void 0,i=function(t){for(var i={},r=0,a=0;a<n.length;a++){var o=n[a],s=e.statData(o).get(t);if(!s||0!=s.value&&!s.value||isNaN(s.value)){if(e.showOnlyWhenComplete())return}else i[o]=s.value,r+=s.value}if(0!=r){for(var l=0;l<n.length;l++)i[n[l]]/=r;return i}};return e.updateClassification=function(){if(!n){var t=(n=Object.keys(e.statData_)).indexOf("default");t>-1&&n.splice(t,1)}return e},e.updateStyle=function(){if(!e.catColors()){e.catColors({});for(var t=0;t<n.length;t++)e.catColors()[n[t]]=Wx[t%10]}e.catLabels_=e.catLabels_||{},e.svg().selectAll(pa(e)).style("fill",(function(t){if(!this.parentNode.classList.contains("em-cntrg")){var n=t.properties.id,r=i(n);if(!r)return e.noDataFillStyle()||"gray";var a=e.svg().append("pattern").attr("id","pattern_"+n).attr("x","0").attr("y","0").attr("width",e.stripeWidth()).attr("height",1).attr("patternUnits","userSpaceOnUse");e.stripeOrientation()&&a.attr("patternTransform","rotate("+e.stripeOrientation()+")"),a.append("rect").attr("x",0).attr("y",0).attr("width",e.stripeWidth()).attr("height",1).style("stroke","none").style("fill","lightgray");var o=0;for(var s in r){var l=r[s];if(l){l*=e.stripeWidth();var c=e.catColors()[s]||"lightgray";a.append("rect").attr("x",o).attr("y",0).attr("height",1).style("stroke","none").attr("code",s).style("fill",c).style("pointer-events","none").transition().duration(e.transitionDuration()).on("end",(function(){Ft(this).style("pointer-events",null)})).attr("width",l),o+=l}}return"url(#pattern_"+n+")"}})).attr("nd",(function(t){return i(t.properties.id)?"":"nd"}));var r=pa(e);return e.svg().selectAll(r).on("mouseover",(function(t,n){var i=Ft(this);i.attr("fill___",i.style("fill")),i.style("fill",e.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(n,e))})).on("mousemove",(function(t,n){e._tooltip&&e._tooltip.mousemove(t)})).on("mouseout",(function(){var t=Ft(this);t.style("fill"),t.attr("fill___")&&(t.style("fill",t.attr("fill___")),e._tooltip&&e._tooltip.mouseout())})),e},e.getLegendConstructor=function(){return Hx},e.tooltip_.textFunction=function(t,n){var r=t.properties.na||t.properties.name,a=t.properties.id,o=i(a),s=[];for(var l in o)s.push({code:l,value:o[l]});var c="";if(c+='<div class="em-tooltip-bar">\n <b>'.concat(r,"</b>").concat(a?" (".concat(a,")"):"","\n </div>"),!s||0===s.length)return c+"<div>".concat(e.noDataText(),"</div>");var u,h=e.pieChartRadius(),f=e.pieChartInnerRadius(),p=Ux().sort(null).value((function(t){return t.value})),d=Dr().innerRadius(f).outerRadius(h),g="",_=Vx(p(s));try{for(_.s();!(u=_.n()).done;){var m=u.value,v=e.catColors()[m.data.code]||"lightgray",y=d(m);g+='<path d="'.concat(y,'" fill="').concat(v,'" stroke="darkgray"></path>')}}catch(t){_.e(t)}finally{_.f()}return c+'\n <div style="display: flex; justify-content: center;">\n <svg viewBox="'.concat(-h," ").concat(-h," ").concat(2*h," ").concat(2*h,'" width="').concat(2*h,'">\n <g>').concat(g,"</g>\n </svg>\n </div>\n ")},e}(e):"pieChart"==t||"pie"==t?Kx(e):"sparkline"==t||"spark"==t||"sparklines"==t?tb(e):"flow"==t||"flowmap"==t?Fb(e):"coxcomb"==t||"polar"==t?Ub(e):"alpha"==t||"valueByAlpha"==t?function(t){var e=bx(t);e.alphaData_=null,e.opacityScale_=null,e.opacityScale=function(t){return arguments.length?(e.opacityScale_=t,e):e.opacityScale_};var n=e.updateStatValues;e.updateStatValues=function(){var t=e.statData("alpha");if(!t||!t.isReady())return e.alphaData_=null,e;e.alphaData_=t;var i=t.getArray().filter((function(t){return null!=t&&":"!==t&&!isNaN(+t)}));if(!e.opacityScale_){var r=Ot(i),a=Gt(i);e.opacityScale_=i.length>0?En().domain([r,a]).range([.1,1]):null}return n.call(e),e.updateStyle()};var i=e.updateStyle;return e.updateStyle=function(){if(!e.svg_||!e.opacityScale_)return e;e.svg_.classed("em--alpha",!0);var t=e.statData();if(!t||!t.isReady())return e;var n=e.statData("alpha");if(!n||!n.isReady())return e;var r=pa(e);return e.svg().selectAll(r).each((function(i){var r,a,o=Ft(this),s=null===(r=t.get(i.properties.id))||void 0===r?void 0:r.value,l=null===(a=n.get(i.properties.id))||void 0===a?void 0:a.value;if(null!=s&&":"!==s)if("nd"!==l&&null!=l)o.style("opacity",e.opacityScale_(+l));else{var c=e.noDataFillStyle_||"gray";o.attr("ecl","nd").attr("force-grey","1").style("fill",c).attr("fill","grey").attr("fill___",c).style("opacity",1)}})),i.call(e),e},e.getLegendConstructor=function(){return Bv},e.tooltip_.textFunction=function(t,e){var n,i,r=[],a=t.properties.na||t.properties.name,o=t.properties.id;r.push('<div class="em-tooltip-bar"><b>'.concat(a,"</b>").concat(o?" (".concat(o,")"):"","</div>"));var s=e.statData(),l=e.alphaData_||e.statData("alpha"),c=s.get(o),u=null==l?void 0:l.get(o),h=(null===(n=s.unitText)||void 0===n?void 0:n.call(s))||"",f=(null==l||null===(i=l.unitText)||void 0===i?void 0:i.call(l))||"",p=s.label_?s.label_+": ":"",d=null!=l&&l.label_?(null==l?void 0:l.label_)+": ":"";return!c||0!==c.value&&!c.value||":"===c.value?(r.push('\n <div class="em-tooltip-text no-data">\n <table class="em-tooltip-table">\n <tbody>\n <tr><td>'.concat(e.noDataText_,"</td></tr>\n </tbody>\n </table>\n </div>\n ")),r.join("")):(r.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>'.concat(p).concat(la(c.value)," ").concat(h,"</td>\n </tr>\n <tr>\n <td>").concat(u&&":"!==u.value&&null!=u.value?"".concat(d).concat(la(u.value)," ").concat(f):"".concat(d).concat(e.noDataText_),"</td>\n </tr>\n </tbody>\n </table>\n </div>\n")),r.join(""))},e}(e):(console.log("Unexpected map type: "+t),sx(e,!0,t))}catch(t){console.error("Error in eurostat-map.map: "+t.message),console.error(t)}},Hb=function(t){(t=t||{}).shape=t.shape||"circle";var e=t.patternSize||5,n=t.minSize||1,i=t.maxSize||5.5;return t.bckColor=t.bckColor||"white",t.symbColor=t.symbColor||"black",function(r,a){r.selectAll(".em-fill-pattern").remove();for(var o=0;o<a;o++){var s=n+(i-n)*o/(a-1),l=r.append("pattern").attr("class","em-fill-pattern").attr("id","pattern_"+o).attr("x","0").attr("y","0").attr("width",e).attr("height",e).attr("patternUnits","userSpaceOnUse");l.append("rect").attr("x",0).attr("y",0).attr("width",e).attr("height",e).style("stroke","none").style("fill",t.bckColor),"square"==t.shape?l.append("rect").attr("x",0).attr("y",0).attr("width",s).attr("height",s).style("stroke","none").style("fill",t.symbColor):l.append("circle").attr("cx",.5*e).attr("cy",.5*e).attr("r",.5*s).style("stroke","none").style("fill",t.symbColor)}}},Vb=function(){return Cf},$b="4.3.12"})(),i})()));
4
+ var e,n,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.toStringTag||"@@toStringTag";function l(t,r,a,o){var s=r&&r.prototype instanceof u?r:u,l=Object.create(s.prototype);return i(l,"_invoke",function(t,i,r){var a,o,s,l=0,u=r||[],h=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,o=0,s=e,f.n=n,c}};function p(t,i){for(o=t,s=i,n=0;!h&&l&&!r&&n<u.length;n++){var r,a=u[n],p=f.p,d=a[2];t>3?(r=d===i)&&(s=a[(o=a[4])?5:(o=3,3)],a[4]=a[5]=e):a[0]<=p&&((r=t<2&&p<a[1])?(o=0,f.v=i,f.n=a[1]):p<d&&(r=t<3||a[0]>i||i>d)&&(a[4]=t,a[5]=i,f.n=d,o=0))}if(r||t>1)return c;throw h=!0,i}return function(r,u,d){if(l>1)throw TypeError("Generator is already running");for(h&&1===u&&p(u,d),o=u,s=d;(n=o<2?e:s)||!h;){a||(o?o<3?(o>1&&(f.n=-1),p(o,s)):f.n=s:f.v=s);try{if(l=2,a){if(o||(r="next"),n=a[r]){if(!(n=n.call(a,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,o<2&&(o=0)}else 1===o&&(n=a.return)&&n.call(a),o<2&&(s=TypeError("The iterator does not provide a '"+r+"' method"),o=1);a=e}else if((n=(h=f.n<0)?s:t.call(i,f))!==c)break}catch(t){a=e,o=1,s=t}finally{l=1}}return{value:n,done:h}}}(t,a,o),!0),l}var c={};function u(){}function h(){}function f(){}n=Object.getPrototypeOf;var p=[][o]?n(n([][o]())):(i(n={},o,(function(){return this})),n),d=f.prototype=u.prototype=Object.create(p);function g(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,i(t,s,"GeneratorFunction")),t.prototype=Object.create(d),t}return h.prototype=f,i(d,"constructor",f),i(f,"constructor",h),h.displayName="GeneratorFunction",i(f,s,"GeneratorFunction"),i(d),i(d,s,"Generator"),i(d,o,(function(){return this})),i(d,"toString",(function(){return"[object Generator]"})),(t.exports=r=function(){return{w:l,m:g}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var a=e[i]={id:i,exports:{}};return t[i](a,a.exports,n),a.exports}n.m=t,n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.u=t=>t+".eurostatmap.min.js",n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.p="/build/",n.b=document.baseURI||self.location.href,n.nc=void 0;var i={};return(()=>{"use strict";n.r(i),n.d(i,{getDefaultLabels:()=>Vb,getFillPatternDefinitionFunction:()=>Hb,map:()=>Wb,version:()=>$b});var t=n(72),e=n.n(t),r=n(825),a=n.n(r),o=n(659),s=n.n(o),l=n(56),c=n.n(l),u=n(540),h=n.n(u),f=n(113),p=n.n(f),d=n(211),g={};g.styleTagTransform=p(),g.setAttributes=c(),g.insert=s().bind(null,"head"),g.domAPI=a(),g.insertStyleElement=h();e()(d.A,g);d.A&&d.A.locals&&d.A.locals;function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function m(t,e){if(t){if("string"==typeof t)return _(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(t,e):void 0}}function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,a,o,s=[],l=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=a.call(n)).done)&&(s.push(i.value),s.length!==e);l=!0);}catch(t){c=!0,r=t}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw r}}return s}}(t,e)||m(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t){return function(t){if(Array.isArray(t))return _(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||m(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(){}function b(t){return null==t?x:function(){return this.querySelector(t)}}function w(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function S(){return[]}function M(t){return null==t?S:function(){return this.querySelectorAll(t)}}function E(t){return function(){return this.matches(t)}}function C(t){return function(e){return e.matches(t)}}var A=Array.prototype.find;function k(){return this.firstElementChild}var T=Array.prototype.filter;function P(){return Array.from(this.children)}function N(t){return new Array(t.length)}function L(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function F(t,e,n,i,r,a){for(var o,s=0,l=e.length,c=a.length;s<c;++s)(o=e[s])?(o.__data__=a[s],i[s]=o):n[s]=new L(t,a[s]);for(;s<l;++s)(o=e[s])&&(r[s]=o)}function O(t,e,n,i,r,a,o){var s,l,c,u=new Map,h=e.length,f=a.length,p=new Array(h);for(s=0;s<h;++s)(l=e[s])&&(p[s]=c=o.call(l,l.__data__,s,e)+"",u.has(c)?r[s]=l:u.set(c,l));for(s=0;s<f;++s)c=o.call(t,a[s],s,a)+"",(l=u.get(c))?(i[s]=l,l.__data__=a[s],u.delete(c)):n[s]=new L(t,a[s]);for(s=0;s<h;++s)(l=e[s])&&u.get(p[s])===l&&(r[s]=l)}function G(t){return t.__data__}function D(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function z(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}L.prototype={constructor:L,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var I="http://www.w3.org/1999/xhtml";const R={svg:"http://www.w3.org/2000/svg",xhtml:I,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function j(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),R.hasOwnProperty(e)?{space:R[e],local:t}:t}function B(t){return function(){this.removeAttribute(t)}}function q(t){return function(){this.removeAttributeNS(t.space,t.local)}}function U(t,e){return function(){this.setAttribute(t,e)}}function W(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function H(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function V(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function $(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function J(t){return function(){this.style.removeProperty(t)}}function Y(t,e,n){return function(){this.style.setProperty(t,e,n)}}function X(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function K(t,e){return t.style.getPropertyValue(e)||$(t).getComputedStyle(t,null).getPropertyValue(e)}function Z(t){return function(){delete this[t]}}function Q(t,e){return function(){this[t]=e}}function tt(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function et(t){return t.trim().split(/^|\s+/)}function nt(t){return t.classList||new it(t)}function it(t){this._node=t,this._names=et(t.getAttribute("class")||"")}function rt(t,e){for(var n=nt(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function at(t,e){for(var n=nt(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function ot(t){return function(){rt(this,t)}}function st(t){return function(){at(this,t)}}function lt(t,e){return function(){(e.apply(this,arguments)?rt:at)(this,t)}}function ct(){this.textContent=""}function ut(t){return function(){this.textContent=t}}function ht(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function ft(){this.innerHTML=""}function pt(t){return function(){this.innerHTML=t}}function dt(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function gt(){this.nextSibling&&this.parentNode.appendChild(this)}function _t(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===I&&e.documentElement.namespaceURI===I?e.createElement(t):e.createElementNS(n,t)}}function vt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function yt(t){var e=j(t);return(e.local?vt:mt)(e)}function xt(){return null}function bt(){var t=this.parentNode;t&&t.removeChild(this)}function wt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function St(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Mt(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,a=e.length;i<a;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?e.length=r:delete this.__on}}}function Et(t,e,n){return function(){var i,r=this.__on,a=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(r)for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===t.type&&i.name===t.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),void(i.value=e);this.addEventListener(t.type,a,n),i={type:t.type,name:t.name,value:e,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Ct(t,e,n){var i=$(t),r=i.CustomEvent;"function"==typeof r?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function At(t,e){return function(){return Ct(this,t,e)}}function kt(t,e){return function(){return Ct(this,t,e.apply(this,arguments))}}it.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Tt=[null];function Pt(t,e){this._groups=t,this._parents=e}function Nt(){return new Pt([[document.documentElement]],Tt)}Pt.prototype=Nt.prototype={constructor:Pt,select:function(t){"function"!=typeof t&&(t=b(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a,o,s=e[r],l=s.length,c=i[r]=new Array(l),u=0;u<l;++u)(a=s[u])&&(o=t.call(a,a.__data__,u,s))&&("__data__"in a&&(o.__data__=a.__data__),c[u]=o);return new Pt(i,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return w(t.apply(this,arguments))}}(t):M(t);for(var e=this._groups,n=e.length,i=[],r=[],a=0;a<n;++a)for(var o,s=e[a],l=s.length,c=0;c<l;++c)(o=s[c])&&(i.push(t.call(o,o.__data__,c,s)),r.push(o));return new Pt(i,r)},selectChild:function(t){return this.select(null==t?k:function(t){return function(){return A.call(this.children,t)}}("function"==typeof t?t:C(t)))},selectChildren:function(t){return this.selectAll(null==t?P:function(t){return function(){return T.call(this.children,t)}}("function"==typeof t?t:C(t)))},filter:function(t){"function"!=typeof t&&(t=E(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a,o=e[r],s=o.length,l=i[r]=[],c=0;c<s;++c)(a=o[c])&&t.call(a,a.__data__,c,o)&&l.push(a);return new Pt(i,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,G);var n=e?O:F,i=this._parents,r=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var a=r.length,o=new Array(a),s=new Array(a),l=new Array(a),c=0;c<a;++c){var u=i[c],h=r[c],f=h.length,p=D(t.call(u,u&&u.__data__,c,i)),d=p.length,g=s[c]=new Array(d),_=o[c]=new Array(d);n(u,h,g,_,l[c]=new Array(f),p,e);for(var m,v,y=0,x=0;y<d;++y)if(m=g[y]){for(y>=x&&(x=y+1);!(v=_[x])&&++x<d;);m._next=v||null}}return(o=new Pt(o,i))._enter=s,o._exit=l,o},enter:function(){return new Pt(this._enter||this._groups.map(N),this._parents)},exit:function(){return new Pt(this._exit||this._groups.map(N),this._parents)},join:function(t,e,n){var i=this.enter(),r=this,a=this.exit();return"function"==typeof t?(i=t(i))&&(i=i.selection()):i=i.append(t+""),null!=e&&(r=e(r))&&(r=r.selection()),null==n?a.remove():n(a),i&&r?i.merge(r).order():r},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,a=i.length,o=Math.min(r,a),s=new Array(r),l=0;l<o;++l)for(var c,u=n[l],h=i[l],f=u.length,p=s[l]=new Array(f),d=0;d<f;++d)(c=u[d]||h[d])&&(p[d]=c);for(;l<r;++l)s[l]=n[l];return new Pt(s,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,r=t[e],a=r.length-1,o=r[a];--a>=0;)(i=r[a])&&(o&&4^i.compareDocumentPosition(o)&&o.parentNode.insertBefore(i,o),o=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=z);for(var n=this._groups,i=n.length,r=new Array(i),a=0;a<i;++a){for(var o,s=n[a],l=s.length,c=r[a]=new Array(l),u=0;u<l;++u)(o=s[u])&&(c[u]=o);c.sort(e)}return new Pt(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,a=i.length;r<a;++r){var o=i[r];if(o)return o}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r,a=e[n],o=0,s=a.length;o<s;++o)(r=a[o])&&t.call(r,r.__data__,o,a);return this},attr:function(t,e){var n=j(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?q:B:"function"==typeof e?n.local?V:H:n.local?W:U)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?J:"function"==typeof e?X:Y)(t,e,null==n?"":n)):K(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Z:"function"==typeof e?tt:Q)(t,e)):this.node()[t]},classed:function(t,e){var n=et(t+"");if(arguments.length<2){for(var i=nt(this.node()),r=-1,a=n.length;++r<a;)if(!i.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?lt:e?ot:st)(n,e))},text:function(t){return arguments.length?this.each(null==t?ct:("function"==typeof t?ht:ut)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?ft:("function"==typeof t?dt:pt)(t)):this.node().innerHTML},raise:function(){return this.each(gt)},lower:function(){return this.each(_t)},append:function(t){var e="function"==typeof t?t:yt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:yt(t),i=null==e?xt:"function"==typeof e?e:b(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)}))},remove:function(){return this.each(bt)},clone:function(t){return this.select(t?St:wt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,r,a=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),o=a.length;if(!(arguments.length<2)){for(s=e?Et:Mt,i=0;i<o;++i)this.each(s(a[i],e,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(i=0,l=s[c];i<o;++i)if((r=a[i]).type===l.type&&r.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?kt:At)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i,r=t[e],a=0,o=r.length;a<o;++a)(i=r[a])&&(yield i)}};const Lt=Nt;function Ft(t){return"string"==typeof t?new Pt([[document.querySelector(t)]],[document.documentElement]):new Pt([[t]],Tt)}function Ot(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n>r||void 0===n&&r>=r)&&(n=r)}return n}function Gt(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let i=-1;for(let r of t)null!=(r=e(r,++i,t))&&(n<r||void 0===n&&r>=r)&&(n=r)}return n}function Dt(t){return null===t?NaN:+t}function zt(t,e,n=Dt){if((i=t.length)&&!isNaN(e=+e)){if(e<=0||i<2)return+n(t[0],0,t);if(e>=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,a=Math.floor(r),o=+n(t[a],a,t);return o+(+n(t[a+1],a+1,t)-o)*(r-a)}}function It(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Rt(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function jt(t){let e,n,i;function r(t,i,r=0,a=t.length){if(r<a){if(0!==e(i,i))return a;do{const e=r+a>>>1;n(t[e],i)<0?r=e+1:a=e}while(r<a)}return r}return 2!==t.length?(e=It,n=(e,n)=>It(t(e),n),i=(e,n)=>t(e)-n):(e=t===It||t===Rt?t:Bt,n=t,i=t),{left:r,center:function(t,e,n=0,a=t.length){const o=r(t,e,n,a-1);return o>n&&i(t[o-1],e)>-i(t[o],e)?o-1:o},right:function(t,i,r=0,a=t.length){if(r<a){if(0!==e(i,i))return a;do{const e=r+a>>>1;n(t[e],i)<=0?r=e+1:a=e}while(r<a)}return r}}}function Bt(){return 0}const qt=jt(It),Ut=qt.right,Wt=(qt.left,jt(Dt).center,Ut);function Ht(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Vt(){var t,e=[],n=[],i=[];function r(){var t=0,r=Math.max(1,n.length);for(i=new Array(r-1);++t<r;)i[t-1]=zt(e,t/r);return a}function a(e){return null==e||isNaN(e=+e)?t:n[Wt(i,e)]}return a.invertExtent=function(t){var r=n.indexOf(t);return r<0?[NaN,NaN]:[r>0?i[r-1]:e[0],r<i.length?i[r]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(It),r()},a.range=function(t){return arguments.length?(n=Array.from(t),r()):n.slice()},a.unknown=function(e){return arguments.length?(t=e,a):t},a.quantiles=function(){return i.slice()},a.copy=function(){return Vt().domain(e).range(n).unknown(t)},Ht.apply(a,arguments)}const $t=Math.sqrt(50),Jt=Math.sqrt(10),Yt=Math.sqrt(2);function Xt(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),a=i/Math.pow(10,r),o=a>=$t?10:a>=Jt?5:a>=Yt?2:1;let s,l,c;return r<0?(c=Math.pow(10,-r)/o,s=Math.round(t*c),l=Math.round(e*c),s/c<t&&++s,l/c>e&&--l,c=-c):(c=Math.pow(10,r)*o,s=Math.round(t/c),l=Math.round(e/c),s*c<t&&++s,l*c>e&&--l),l<s&&.5<=n&&n<2?Xt(t,e,2*n):[s,l,c]}function Kt(t,e,n){return Xt(t=+t,e=+e,n=+n)[2]}function Zt(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Qt(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function te(){}var ee=.7,ne=1/ee,ie="\\s*([+-]?\\d+)\\s*",re="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ae="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",oe=/^#([0-9a-f]{3,8})$/,se=new RegExp(`^rgb\\(${ie},${ie},${ie}\\)$`),le=new RegExp(`^rgb\\(${ae},${ae},${ae}\\)$`),ce=new RegExp(`^rgba\\(${ie},${ie},${ie},${re}\\)$`),ue=new RegExp(`^rgba\\(${ae},${ae},${ae},${re}\\)$`),he=new RegExp(`^hsl\\(${re},${ae},${ae}\\)$`),fe=new RegExp(`^hsla\\(${re},${ae},${ae},${re}\\)$`),pe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function de(){return this.rgb().formatHex()}function ge(){return this.rgb().formatRgb()}function _e(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=oe.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?me(e):3===n?new be(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ve(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ve(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=se.exec(t))?new be(e[1],e[2],e[3],1):(e=le.exec(t))?new be(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ce.exec(t))?ve(e[1],e[2],e[3],e[4]):(e=ue.exec(t))?ve(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=he.exec(t))?Ae(e[1],e[2]/100,e[3]/100,1):(e=fe.exec(t))?Ae(e[1],e[2]/100,e[3]/100,e[4]):pe.hasOwnProperty(t)?me(pe[t]):"transparent"===t?new be(NaN,NaN,NaN,0):null}function me(t){return new be(t>>16&255,t>>8&255,255&t,1)}function ve(t,e,n,i){return i<=0&&(t=e=n=NaN),new be(t,e,n,i)}function ye(t){return t instanceof te||(t=_e(t)),t?new be((t=t.rgb()).r,t.g,t.b,t.opacity):new be}function xe(t,e,n,i){return 1===arguments.length?ye(t):new be(t,e,n,null==i?1:i)}function be(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function we(){return`#${Ce(this.r)}${Ce(this.g)}${Ce(this.b)}`}function Se(){const t=Me(this.opacity);return`${1===t?"rgb(":"rgba("}${Ee(this.r)}, ${Ee(this.g)}, ${Ee(this.b)}${1===t?")":`, ${t})`}`}function Me(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ee(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ce(t){return((t=Ee(t))<16?"0":"")+t.toString(16)}function Ae(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Te(t,e,n,i)}function ke(t){if(t instanceof Te)return new Te(t.h,t.s,t.l,t.opacity);if(t instanceof te||(t=_e(t)),!t)return new Te;if(t instanceof Te)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),a=Math.max(e,n,i),o=NaN,s=a-r,l=(a+r)/2;return s?(o=e===a?(n-i)/s+6*(n<i):n===a?(i-e)/s+2:(e-n)/s+4,s/=l<.5?a+r:2-a-r,o*=60):s=l>0&&l<1?0:o,new Te(o,s,l,t.opacity)}function Te(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Pe(t){return(t=(t||0)%360)<0?t+360:t}function Ne(t){return Math.max(0,Math.min(1,t||0))}function Le(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Fe(t,e,n,i,r){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*i+o*r)/6}Zt(te,_e,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:de,formatHex:de,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ke(this).formatHsl()},formatRgb:ge,toString:ge}),Zt(be,xe,Qt(te,{brighter(t){return t=null==t?ne:Math.pow(ne,t),new be(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?ee:Math.pow(ee,t),new be(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new be(Ee(this.r),Ee(this.g),Ee(this.b),Me(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:we,formatHex:we,formatHex8:function(){return`#${Ce(this.r)}${Ce(this.g)}${Ce(this.b)}${Ce(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Se,toString:Se})),Zt(Te,(function(t,e,n,i){return 1===arguments.length?ke(t):new Te(t,e,n,null==i?1:i)}),Qt(te,{brighter(t){return t=null==t?ne:Math.pow(ne,t),new Te(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?ee:Math.pow(ee,t),new Te(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new be(Le(t>=240?t-240:t+120,r,i),Le(t,r,i),Le(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Te(Pe(this.h),Ne(this.s),Ne(this.l),Me(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Me(this.opacity);return`${1===t?"hsl(":"hsla("}${Pe(this.h)}, ${100*Ne(this.s)}%, ${100*Ne(this.l)}%${1===t?")":`, ${t})`}`}}));const Oe=t=>()=>t;function Ge(t,e){return function(n){return t+n*e}}function De(t){return 1==(t=+t)?ze:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):Oe(isNaN(e)?n:e)}}function ze(t,e){var n=e-t;return n?Ge(t,n):Oe(isNaN(t)?e:t)}const Ie=function t(e){var n=De(e);function i(t,e){var i=n((t=xe(t)).r,(e=xe(e)).r),r=n(t.g,e.g),a=n(t.b,e.b),o=ze(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=a(e),t.opacity=o(e),t+""}}return i.gamma=t,i}(1);function Re(t){return function(e){var n,i,r=e.length,a=new Array(r),o=new Array(r),s=new Array(r);for(n=0;n<r;++n)i=xe(e[n]),a[n]=i.r||0,o[n]=i.g||0,s[n]=i.b||0;return a=t(a),o=t(o),s=t(s),i.opacity=1,function(t){return i.r=a(t),i.g=o(t),i.b=s(t),i+""}}}var je=Re((function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),r=t[i],a=t[i+1],o=i>0?t[i-1]:2*r-a,s=i<e-1?t[i+2]:2*a-r;return Fe((n-i/e)*e,o,r,a,s)}}));Re((function(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),r=t[(i+e-1)%e],a=t[i%e],o=t[(i+1)%e],s=t[(i+2)%e];return Fe((n-i/e)*e,r,a,o,s)}}));function Be(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,a=new Array(r),o=new Array(i);for(n=0;n<r;++n)a[n]=Ye(t[n],e[n]);for(;n<i;++n)o[n]=e[n];return function(t){for(n=0;n<r;++n)o[n]=a[n](t);return o}}function qe(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function Ue(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function We(t,e){var n,i={},r={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?i[n]=Ye(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}}var He=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ve=new RegExp(He.source,"g");function $e(t,e){var n,i,r,a=He.lastIndex=Ve.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(n=He.exec(t))&&(i=Ve.exec(e));)(r=i.index)>a&&(r=e.slice(a,r),s[o]?s[o]+=r:s[++o]=r),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:Ue(n,i)})),a=Ve.lastIndex;return a<e.length&&(r=e.slice(a),s[o]?s[o]+=r:s[++o]=r),s.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,i=0;i<e;++i)s[(n=l[i]).i]=n.x(t);return s.join("")})}function Je(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(a){for(n=0;n<i;++n)r[n]=t[n]*(1-a)+e[n]*a;return r}}function Ye(t,e){var n,i=typeof e;return null==e||"boolean"===i?Oe(e):("number"===i?Ue:"string"===i?(n=_e(e))?(e=n,Ie):$e:e instanceof _e?Ie:e instanceof Date?qe:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(e)?Je:Array.isArray(e)?Be:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?We:Ue)(t,e)}function Xe(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Ke(t){return+t}var Ze=[0,1];function Qe(t){return t}function tn(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function en(t,e,n){var i=t[0],r=t[1],a=e[0],o=e[1];return r<i?(i=tn(r,i),a=n(o,a)):(i=tn(i,r),a=n(a,o)),function(t){return a(i(t))}}function nn(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),a=new Array(i),o=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<i;)r[o]=tn(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(e){var n=Wt(t,e,1,i)-1;return a[n](r[n](e))}}function rn(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function an(){var t,e,n,i,r,a,o=Ze,s=Ze,l=Ye,c=Qe;function u(){var t=Math.min(o.length,s.length);return c!==Qe&&(c=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(o[0],o[t-1])),i=t>2?nn:en,r=a=null,h}function h(e){return null==e||isNaN(e=+e)?n:(r||(r=i(o.map(t),s,l)))(t(c(e)))}return h.invert=function(n){return c(e((a||(a=i(s,o.map(t),Ue)))(n)))},h.domain=function(t){return arguments.length?(o=Array.from(t,Ke),u()):o.slice()},h.range=function(t){return arguments.length?(s=Array.from(t),u()):s.slice()},h.rangeRound=function(t){return s=Array.from(t),l=Xe,u()},h.clamp=function(t){return arguments.length?(c=!!t||Qe,u()):c!==Qe},h.interpolate=function(t){return arguments.length?(l=t,u()):l},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,i){return t=n,e=i,u()}}function on(){return an()(Qe,Qe)}var sn,ln=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function cn(t){if(!(e=ln.exec(t)))throw new Error("invalid format: "+t);var e;return new un({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function un(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function hn(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function fn(t){return(t=hn(Math.abs(t)))?t[1]:NaN}function pn(t,e){var n=hn(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}cn.prototype=un.prototype,un.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const dn={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>pn(100*t,e),r:pn,s:function(t,e){var n=hn(t,e);if(!n)return t+"";var i=n[0],r=n[1],a=r-(sn=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=i.length;return a===o?i:a>o?i+new Array(a-o+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+hn(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function gn(t){return t}var _n,mn,vn,yn=Array.prototype.map,xn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function bn(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?gn:(e=yn.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,a=[],o=0,s=e[0],l=0;r>0&&s>0&&(l+s+1>i&&(s=Math.max(1,i-l)),a.push(t.substring(r-=s,r+s)),!((l+=s+1)>i));)s=e[o=(o+1)%e.length];return a.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?gn:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(yn.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=cn(t)).fill,n=t.align,h=t.sign,f=t.symbol,p=t.zero,d=t.width,g=t.comma,_=t.precision,m=t.trim,v=t.type;"n"===v?(g=!0,v="g"):dn[v]||(void 0===_&&(_=12),m=!0,v="g"),(p||"0"===e&&"="===n)&&(p=!0,e="0",n="=");var y="$"===f?r:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===f?a:/[%p]/.test(v)?l:"",b=dn[v],w=/[defgprs%]/.test(v);function S(t){var r,a,l,f=y,S=x;if("c"===v)S=b(t)+S,t="";else{var M=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:b(Math.abs(t),_),m&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),M&&0==+t&&"+"!==h&&(M=!1),f=(M?"("===h?h:c:"-"===h||"("===h?"":h)+f,S=("s"===v?xn[8+sn/3]:"")+S+(M&&"("===h?")":""),w)for(r=-1,a=t.length;++r<a;)if(48>(l=t.charCodeAt(r))||l>57){S=(46===l?o+t.slice(r+1):t.slice(r))+S,t=t.slice(0,r);break}}g&&!p&&(t=i(t,1/0));var E=f.length+t.length+S.length,C=E<d?new Array(d-E+1).join(e):"";switch(g&&p&&(t=i(C+t,C.length?d-S.length:1/0),C=""),n){case"<":t=f+t+S+C;break;case"=":t=f+C+t+S;break;case"^":t=C.slice(0,E=C.length>>1)+f+t+S+C.slice(E);break;default:t=C+f+t+S}return s(t)}return _=void 0===_?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_)),S.toString=function(){return t+""},S}return{format:h,formatPrefix:function(t,e){var n=h(((t=cn(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(fn(e)/3))),r=Math.pow(10,-i),a=xn[8+i/3];return function(t){return n(r*t)+a}}}}function wn(t){return _n=bn(t),mn=_n.format,vn=_n.formatPrefix,_n}function Sn(t,e,n,i){var r,a=function(t,e,n){n=+n;const i=(e=+e)<(t=+t),r=i?Kt(e,t,n):Kt(t,e,n);return(i?-1:1)*(r<0?1/-r:r)}(t,e,n);switch((i=cn(null==i?",f":i)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(fn(e)/3)))-fn(Math.abs(t)))}(a,o))||(i.precision=r),vn(i,o);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,fn(e)-fn(t))+1}(a,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(t){return Math.max(0,-fn(Math.abs(t)))}(a))||(i.precision=r-2*("%"===i.type))}return mn(i)}function Mn(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const i=e<t,[r,a,o]=i?Xt(e,t,n):Xt(t,e,n);if(!(a>=r))return[];const s=a-r+1,l=new Array(s);if(i)if(o<0)for(let t=0;t<s;++t)l[t]=(a-t)/-o;else for(let t=0;t<s;++t)l[t]=(a-t)*o;else if(o<0)for(let t=0;t<s;++t)l[t]=(r+t)/-o;else for(let t=0;t<s;++t)l[t]=(r+t)*o;return l}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var i=e();return Sn(i[0],i[i.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var i,r,a=e(),o=0,s=a.length-1,l=a[o],c=a[s],u=10;for(c<l&&(r=l,l=c,c=r,r=o,o=s,s=r);u-- >0;){if((r=Kt(l,c,n))===i)return a[o]=l,a[s]=c,e(a);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return t},t}function En(){var t=on();return t.copy=function(){return rn(t,En())},Ht.apply(t,arguments),Mn(t)}function Cn(){var t,e=0,n=1,i=1,r=[.5],a=[0,1];function o(e){return null!=e&&e<=e?a[Wt(r,e,0,i)]:t}function s(){var t=-1;for(r=new Array(i);++t<i;)r[t]=((t+1)*n-(t-i)*e)/(i+1);return o}return o.domain=function(t){return arguments.length?([e,n]=t,e=+e,n=+n,s()):[e,n]},o.range=function(t){return arguments.length?(i=(a=Array.from(t)).length-1,s()):a.slice()},o.invertExtent=function(t){var o=a.indexOf(t);return o<0?[NaN,NaN]:o<1?[e,r[0]]:o>=i?[r[i-1],n]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length?(t=e,o):o},o.thresholds=function(){return r.slice()},o.copy=function(){return Cn().domain([e,n]).range(a).unknown(t)},Ht.apply(Mn(o),arguments)}function An(){var t,e=[.5],n=[0,1],i=1;function r(r){return null!=r&&r<=r?n[Wt(e,r,0,i)]:t}return r.domain=function(t){return arguments.length?(e=Array.from(t),i=Math.min(e.length,n.length-1),r):e.slice()},r.range=function(t){return arguments.length?(n=Array.from(t),i=Math.min(e.length,n.length-1),r):n.slice()},r.invertExtent=function(t){var i=n.indexOf(t);return[e[i-1],e[i]]},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return An().domain(e).range(n).unknown(t)},Ht.apply(r,arguments)}function kn(t){for(var e=t.length/6|0,n=new Array(e),i=0;i<e;)n[i]="#"+t.slice(6*i,6*++i);return n}wn({thousands:",",grouping:[3],currency:["$",""]});const Tn=t=>je(t[t.length-1]);const Pn=Tn(new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(kn));const Nn=Math.PI/180,Ln=180/Math.PI,Fn=.96422,On=.82521,Gn=4/29,Dn=6/29,zn=3*Dn*Dn,In=Dn*Dn*Dn;function Rn(t){if(t instanceof Bn)return new Bn(t.l,t.a,t.b,t.opacity);if(t instanceof $n)return Jn(t);t instanceof be||(t=ye(t));var e,n,i=Hn(t.r),r=Hn(t.g),a=Hn(t.b),o=qn((.2225045*i+.7168786*r+.0606169*a)/1);return i===r&&r===a?e=n=o:(e=qn((.4360747*i+.3850649*r+.1430804*a)/Fn),n=qn((.0139322*i+.0971045*r+.7141733*a)/On)),new Bn(116*o-16,500*(e-o),200*(o-n),t.opacity)}function jn(t,e,n,i){return 1===arguments.length?Rn(t):new Bn(t,e,n,null==i?1:i)}function Bn(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function qn(t){return t>In?Math.pow(t,1/3):t/zn+Gn}function Un(t){return t>Dn?t*t*t:zn*(t-Gn)}function Wn(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Hn(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Vn(t){if(t instanceof $n)return new $n(t.h,t.c,t.l,t.opacity);if(t instanceof Bn||(t=Rn(t)),0===t.a&&0===t.b)return new $n(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Ln;return new $n(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function $n(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}function Jn(t){if(isNaN(t.h))return new Bn(t.l,0,0,t.opacity);var e=t.h*Nn;return new Bn(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function Yn(t,e){var n=ze((t=jn(t)).l,(e=jn(e)).l),i=ze(t.a,e.a),r=ze(t.b,e.b),a=ze(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=i(e),t.b=r(e),t.opacity=a(e),t+""}}Zt(Bn,jn,Qt(te,{brighter(t){return new Bn(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new Bn(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new be(Wn(3.1338561*(e=Fn*Un(e))-1.6168667*(t=1*Un(t))-.4906146*(n=On*Un(n))),Wn(-.9787684*e+1.9161415*t+.033454*n),Wn(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),Zt($n,(function(t,e,n,i){return 1===arguments.length?Vn(t):new $n(t,e,n,null==i?1:i)}),Qt(te,{brighter(t){return new $n(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new $n(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return Jn(this).rgb()}}));var Xn={value:()=>{}};function Kn(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new Zn(i)}function Zn(t){this._=t}function Qn(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function ti(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=Xn,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}Zn.prototype=Kn.prototype={constructor:Zn,on:function(t,e){var n,i,r=this._,a=(i=r,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!i.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=a[o]).type)r[n]=ti(r[n],t.name,e);else if(null==e)for(n in r)r[n]=ti(r[n],t.name,null);return this}for(;++o<s;)if((n=(t=a[o]).type)&&(n=Qn(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Zn(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),a=0;a<n;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(i=this._[t]).length;a<n;++a)i[a].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,a=i.length;r<a;++r)i[r].value.apply(e,n)}};const ei=Kn;var ni,ii,ri=0,ai=0,oi=0,si=0,li=0,ci=0,ui="object"==typeof performance&&performance.now?performance:Date,hi="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function fi(){return li||(hi(pi),li=ui.now()+ci)}function pi(){li=0}function di(){this._call=this._time=this._next=null}function gi(t,e,n){var i=new di;return i.restart(t,e,n),i}function _i(){li=(si=ui.now())+ci,ri=ai=0;try{!function(){fi(),++ri;for(var t,e=ni;e;)(t=li-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ri}()}finally{ri=0,function(){var t,e,n=ni,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:ni=e);ii=t,vi(i)}(),li=0}}function mi(){var t=ui.now(),e=t-si;e>1e3&&(ci-=e,si=t)}function vi(t){ri||(ai&&(ai=clearTimeout(ai)),t-li>24?(t<1/0&&(ai=setTimeout(_i,t-ui.now()-ci)),oi&&(oi=clearInterval(oi))):(oi||(si=ui.now(),oi=setInterval(mi,1e3)),ri=1,hi(_i)))}function yi(t,e,n){var i=new di;return e=null==e?0:+e,i.restart((n=>{i.stop(),t(n+e)}),e,n),i}di.prototype=gi.prototype={constructor:di,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?fi():+n)+(null==e?0:+e),this._next||ii===this||(ii?ii._next=this:ni=this,ii=this),this._call=t,this._time=n,vi()},stop:function(){this._call&&(this._call=null,this._time=1/0,vi())}};var xi=ei("start","end","cancel","interrupt"),bi=[];function wi(t,e,n,i,r,a){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function a(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}function o(a){var c,u,h,f;if(1!==n.state)return l();for(c in r)if((f=r[c]).name===n.name){if(3===f.state)return yi(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete r[c]):+c<e&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete r[c])}if(yi((function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,i=new Array(h=n.tween.length),c=0,u=-1;c<h;++c)(f=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(l),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(t,r);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){for(var i in n.state=6,n.timer.stop(),delete r[e],r)return;delete t.__transition}r[e]=n,n.timer=gi(a,0,n.time)}(t,n,{name:e,index:i,group:r,on:xi,tween:bi,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function Si(t,e){var n=Ei(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function Mi(t,e){var n=Ei(t,e);if(n.state>3)throw new Error("too late; already running");return n}function Ei(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Ci(t,e){var n,i,r,a=t.__transition,o=!0;if(a){for(r in e=null==e?null:e+"",a)(n=a[r]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete a[r]):o=!1;o&&delete t.__transition}}var Ai,ki=180/Math.PI,Ti={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Pi(t,e,n,i,r,a){var o,s,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*i)&&(n-=t*l,i-=e*l),(s=Math.sqrt(n*n+i*i))&&(n/=s,i/=s,l/=s),t*i<e*n&&(t=-t,e=-e,l=-l,o=-o),{translateX:r,translateY:a,rotate:Math.atan2(e,t)*ki,skewX:Math.atan(l)*ki,scaleX:o,scaleY:s}}function Ni(t,e,n,i){function r(t){return t.length?t.pop()+" ":""}return function(a,o){var s=[],l=[];return a=t(a),o=t(o),function(t,i,r,a,o,s){if(t!==r||i!==a){var l=o.push("translate(",null,e,null,n);s.push({i:l-4,x:Ue(t,r)},{i:l-2,x:Ue(i,a)})}else(r||a)&&o.push("translate("+r+e+a+n)}(a.translateX,a.translateY,o.translateX,o.translateY,s,l),function(t,e,n,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(r(n)+"rotate(",null,i)-2,x:Ue(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(a.rotate,o.rotate,s,l),function(t,e,n,a){t!==e?a.push({i:n.push(r(n)+"skewX(",null,i)-2,x:Ue(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(a.skewX,o.skewX,s,l),function(t,e,n,i,a,o){if(t!==n||e!==i){var s=a.push(r(a)+"scale(",null,",",null,")");o.push({i:s-4,x:Ue(t,n)},{i:s-2,x:Ue(e,i)})}else 1===n&&1===i||a.push(r(a)+"scale("+n+","+i+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,n=-1,i=l.length;++n<i;)s[(e=l[n]).i]=e.x(t);return s.join("")}}}var Li=Ni((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ti:Pi(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),Fi=Ni((function(t){return null==t?Ti:(Ai||(Ai=document.createElementNS("http://www.w3.org/2000/svg","g")),Ai.setAttribute("transform",t),(t=Ai.transform.baseVal.consolidate())?Pi((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Ti)}),", ",")",")");function Oi(t,e){var n,i;return function(){var r=Mi(this,t),a=r.tween;if(a!==n)for(var o=0,s=(i=n=a).length;o<s;++o)if(i[o].name===e){(i=i.slice()).splice(o,1);break}r.tween=i}}function Gi(t,e,n){var i,r;if("function"!=typeof n)throw new Error;return function(){var a=Mi(this,t),o=a.tween;if(o!==i){r=(i=o).slice();for(var s={name:e,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===e){r[l]=s;break}l===c&&r.push(s)}a.tween=r}}function Di(t,e,n){var i=t._id;return t.each((function(){var t=Mi(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return Ei(t,i).value[e]}}function zi(t,e){var n;return("number"==typeof e?Ue:e instanceof _e?Ie:(n=_e(e))?(e=n,Ie):$e)(t,e)}function Ii(t){return function(){this.removeAttribute(t)}}function Ri(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ji(t,e,n){var i,r,a=n+"";return function(){var o=this.getAttribute(t);return o===a?null:o===i?r:r=e(i=o,n)}}function Bi(t,e,n){var i,r,a=n+"";return function(){var o=this.getAttributeNS(t.space,t.local);return o===a?null:o===i?r:r=e(i=o,n)}}function qi(t,e,n){var i,r,a;return function(){var o,s,l=n(this);if(null!=l)return(o=this.getAttribute(t))===(s=l+"")?null:o===i&&s===r?a:(r=s,a=e(i=o,l));this.removeAttribute(t)}}function Ui(t,e,n){var i,r,a;return function(){var o,s,l=n(this);if(null!=l)return(o=this.getAttributeNS(t.space,t.local))===(s=l+"")?null:o===i&&s===r?a:(r=s,a=e(i=o,l));this.removeAttributeNS(t.space,t.local)}}function Wi(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,r)),n}return r._value=e,r}function Hi(t,e){var n,i;function r(){var r=e.apply(this,arguments);return r!==i&&(n=(i=r)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,r)),n}return r._value=e,r}function Vi(t,e){return function(){Si(this,t).delay=+e.apply(this,arguments)}}function $i(t,e){return e=+e,function(){Si(this,t).delay=e}}function Ji(t,e){return function(){Mi(this,t).duration=+e.apply(this,arguments)}}function Yi(t,e){return e=+e,function(){Mi(this,t).duration=e}}var Xi=Lt.prototype.constructor;function Ki(t){return function(){this.style.removeProperty(t)}}var Zi=0;function Qi(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function tr(){return++Zi}var er=Lt.prototype;Qi.prototype=function(t){return Lt().transition(t)}.prototype={constructor:Qi,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=b(t));for(var i=this._groups,r=i.length,a=new Array(r),o=0;o<r;++o)for(var s,l,c=i[o],u=c.length,h=a[o]=new Array(u),f=0;f<u;++f)(s=c[f])&&(l=t.call(s,s.__data__,f,c))&&("__data__"in s&&(l.__data__=s.__data__),h[f]=l,wi(h[f],e,n,f,h,Ei(s,n)));return new Qi(a,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=M(t));for(var i=this._groups,r=i.length,a=[],o=[],s=0;s<r;++s)for(var l,c=i[s],u=c.length,h=0;h<u;++h)if(l=c[h]){for(var f,p=t.call(l,l.__data__,h,c),d=Ei(l,n),g=0,_=p.length;g<_;++g)(f=p[g])&&wi(f,e,n,g,p,d);a.push(p),o.push(l)}return new Qi(a,o,e,n)},selectChild:er.selectChild,selectChildren:er.selectChildren,filter:function(t){"function"!=typeof t&&(t=E(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a,o=e[r],s=o.length,l=i[r]=[],c=0;c<s;++c)(a=o[c])&&t.call(a,a.__data__,c,o)&&l.push(a);return new Qi(i,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,a=Math.min(i,r),o=new Array(i),s=0;s<a;++s)for(var l,c=e[s],u=n[s],h=c.length,f=o[s]=new Array(h),p=0;p<h;++p)(l=c[p]||u[p])&&(f[p]=l);for(;s<i;++s)o[s]=e[s];return new Qi(o,this._parents,this._name,this._id)},selection:function(){return new Xi(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=tr(),i=this._groups,r=i.length,a=0;a<r;++a)for(var o,s=i[a],l=s.length,c=0;c<l;++c)if(o=s[c]){var u=Ei(o,e);wi(o,t,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Qi(i,this._parents,t,n)},call:er.call,nodes:er.nodes,node:er.node,size:er.size,empty:er.empty,each:er.each,on:function(t,e){var n=this._id;return arguments.length<2?Ei(this.node(),n).on.on(t):this.each(function(t,e,n){var i,r,a=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Si:Mi;return function(){var o=a(this,t),s=o.on;s!==i&&(r=(i=s).copy()).on(e,n),o.on=r}}(n,t,e))},attr:function(t,e){var n=j(t),i="transform"===n?Fi:zi;return this.attrTween(t,"function"==typeof e?(n.local?Ui:qi)(n,i,Di(this,"attr."+t,e)):null==e?(n.local?Ri:Ii)(n):(n.local?Bi:ji)(n,i,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var i=j(t);return this.tween(n,(i.local?Wi:Hi)(i,e))},style:function(t,e,n){var i="transform"==(t+="")?Li:zi;return null==e?this.styleTween(t,function(t,e){var n,i,r;return function(){var a=K(this,t),o=(this.style.removeProperty(t),K(this,t));return a===o?null:a===n&&o===i?r:r=e(n=a,i=o)}}(t,i)).on("end.style."+t,Ki(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,r,a;return function(){var o=K(this,t),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(t),l=s=K(this,t)),o===l?null:o===i&&l===r?a:(r=l,a=e(i=o,s))}}(t,i,Di(this,"style."+t,e))).each(function(t,e){var n,i,r,a,o="style."+e,s="end."+o;return function(){var l=Mi(this,t),c=l.on,u=null==l.value[o]?a||(a=Ki(e)):void 0;c===n&&r===u||(i=(n=c).copy()).on(s,r=u),l.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,r,a=n+"";return function(){var o=K(this,t);return o===a?null:o===i?r:r=e(i=o,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function(t,e,n){var i,r;function a(){var a=e.apply(this,arguments);return a!==r&&(i=(r=a)&&function(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}(t,a,n)),i}return a._value=e,a}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Di(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&function(t){return function(e){this.textContent=t.call(this,e)}}(i)),e}return i._value=t,i}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=Ei(this.node(),n).tween,a=0,o=r.length;a<o;++a)if((i=r[a]).name===t)return i.value;return null}return this.each((null==e?Oi:Gi)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Vi:$i)(e,t)):Ei(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Ji:Yi)(e,t)):Ei(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){Mi(this,t).ease=e}}(e,t)):Ei(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;Mi(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,i=n._id,r=n.size();return new Promise((function(a,o){var s={value:o},l={value:function(){0==--r&&a()}};n.each((function(){var n=Mi(this,i),r=n.on;r!==t&&((e=(t=r).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(l)),n.on=e})),0===r&&a()}))},[Symbol.iterator]:er[Symbol.iterator]};var nr={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function ir(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}Lt.prototype.interrupt=function(t){return this.each((function(){Ci(this,t)}))},Lt.prototype.transition=function(t){var e,n;t instanceof Qi?(e=t._id,t=t._name):(e=tr(),(n=nr).time=fi(),t=null==t?null:t+"");for(var i=this._groups,r=i.length,a=0;a<r;++a)for(var o,s=i[a],l=s.length,c=0;c<l;++c)(o=s[c])&&wi(o,t,e,c,s,n||ir(o,e));return new Qi(i,this._parents,t,e)};const{abs:rr,max:ar,min:or}=Math;function sr(t){return[+t[0],+t[1]]}function lr(t){return[sr(t[0]),sr(t[1])]}["w","e"].map(cr),["n","s"].map(cr),["n","w","e","s","nw","ne","sw","se"].map(cr);function cr(t){return{type:t}}function ur(t){return function(){return t}}const hr=Math.abs,fr=Math.atan2,pr=Math.cos,dr=Math.max,gr=Math.min,_r=Math.sin,mr=Math.sqrt,vr=1e-12,yr=Math.PI,xr=yr/2,br=2*yr;function wr(t){return t>=1?xr:t<=-1?-xr:Math.asin(t)}const Sr=Math.PI,Mr=2*Sr,Er=1e-6,Cr=Mr-Er;function Ar(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class kr{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Ar:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Ar;const n=10**e;return function(t){this._+=t[0];for(let e=1,i=t.length;e<i;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,i){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,e,n,i,r,a){this._append`C${+t},${+e},${+n},${+i},${this._x1=+r},${this._y1=+a}`}arcTo(t,e,n,i,r){if(t=+t,e=+e,n=+n,i=+i,(r=+r)<0)throw new Error(`negative radius: ${r}`);let a=this._x1,o=this._y1,s=n-t,l=i-e,c=a-t,u=o-e,h=c*c+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(h>Er)if(Math.abs(u*s-l*c)>Er&&r){let f=n-a,p=i-o,d=s*s+l*l,g=f*f+p*p,_=Math.sqrt(d),m=Math.sqrt(h),v=r*Math.tan((Sr-Math.acos((d+h-g)/(2*_*m)))/2),y=v/m,x=v/_;Math.abs(y-1)>Er&&this._append`L${t+y*c},${e+y*u}`,this._append`A${r},${r},0,0,${+(u*f>c*p)},${this._x1=t+x*s},${this._y1=e+x*l}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,i,r,a){if(t=+t,e=+e,a=!!a,(n=+n)<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),s=n*Math.sin(i),l=t+o,c=e+s,u=1^a,h=a?i-r:r-i;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Er||Math.abs(this._y1-c)>Er)&&this._append`L${l},${c}`,n&&(h<0&&(h=h%Mr+Mr),h>Cr?this._append`A${n},${n},0,1,${u},${t-o},${e-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>Er&&this._append`A${n},${n},0,${+(h>=Sr)},${u},${this._x1=t+n*Math.cos(r)},${this._y1=e+n*Math.sin(r)}`)}rect(t,e,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Tr(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new kr(e)}function Pr(t){return t.innerRadius}function Nr(t){return t.outerRadius}function Lr(t){return t.startAngle}function Fr(t){return t.endAngle}function Or(t){return t&&t.padAngle}function Gr(t,e,n,i,r,a,o){var s=t-n,l=e-i,c=(o?a:-a)/mr(s*s+l*l),u=c*l,h=-c*s,f=t+u,p=e+h,d=n+u,g=i+h,_=(f+d)/2,m=(p+g)/2,v=d-f,y=g-p,x=v*v+y*y,b=r-a,w=f*g-d*p,S=(y<0?-1:1)*mr(dr(0,b*b*x-w*w)),M=(w*y-v*S)/x,E=(-w*v-y*S)/x,C=(w*y+v*S)/x,A=(-w*v+y*S)/x,k=M-_,T=E-m,P=C-_,N=A-m;return k*k+T*T>P*P+N*N&&(M=C,E=A),{cx:M,cy:E,x01:-u,y01:-h,x11:M*(r/b-1),y11:E*(r/b-1)}}function Dr(){var t=Pr,e=Nr,n=ur(0),i=null,r=Lr,a=Fr,o=Or,s=null,l=Tr(c);function c(){var c,u,h=+t.apply(this,arguments),f=+e.apply(this,arguments),p=r.apply(this,arguments)-xr,d=a.apply(this,arguments)-xr,g=hr(d-p),_=d>p;if(s||(s=c=l()),f<h&&(u=f,f=h,h=u),f>vr)if(g>br-vr)s.moveTo(f*pr(p),f*_r(p)),s.arc(0,0,f,p,d,!_),h>vr&&(s.moveTo(h*pr(d),h*_r(d)),s.arc(0,0,h,d,p,_));else{var m,v,y=p,x=d,b=p,w=d,S=g,M=g,E=o.apply(this,arguments)/2,C=E>vr&&(i?+i.apply(this,arguments):mr(h*h+f*f)),A=gr(hr(f-h)/2,+n.apply(this,arguments)),k=A,T=A;if(C>vr){var P=wr(C/h*_r(E)),N=wr(C/f*_r(E));(S-=2*P)>vr?(b+=P*=_?1:-1,w-=P):(S=0,b=w=(p+d)/2),(M-=2*N)>vr?(y+=N*=_?1:-1,x-=N):(M=0,y=x=(p+d)/2)}var L=f*pr(y),F=f*_r(y),O=h*pr(w),G=h*_r(w);if(A>vr){var D,z=f*pr(x),I=f*_r(x),R=h*pr(b),j=h*_r(b);if(g<yr)if(D=function(t,e,n,i,r,a,o,s){var l=n-t,c=i-e,u=o-r,h=s-a,f=h*l-u*c;if(!(f*f<vr))return[t+(f=(u*(e-a)-h*(t-r))/f)*l,e+f*c]}(L,F,R,j,z,I,O,G)){var B=L-D[0],q=F-D[1],U=z-D[0],W=I-D[1],H=1/_r(function(t){return t>1?0:t<-1?yr:Math.acos(t)}((B*U+q*W)/(mr(B*B+q*q)*mr(U*U+W*W)))/2),V=mr(D[0]*D[0]+D[1]*D[1]);k=gr(A,(h-V)/(H-1)),T=gr(A,(f-V)/(H+1))}else k=T=0}M>vr?T>vr?(m=Gr(R,j,L,F,f,T,_),v=Gr(z,I,O,G,f,T,_),s.moveTo(m.cx+m.x01,m.cy+m.y01),T<A?s.arc(m.cx,m.cy,T,fr(m.y01,m.x01),fr(v.y01,v.x01),!_):(s.arc(m.cx,m.cy,T,fr(m.y01,m.x01),fr(m.y11,m.x11),!_),s.arc(0,0,f,fr(m.cy+m.y11,m.cx+m.x11),fr(v.cy+v.y11,v.cx+v.x11),!_),s.arc(v.cx,v.cy,T,fr(v.y11,v.x11),fr(v.y01,v.x01),!_))):(s.moveTo(L,F),s.arc(0,0,f,y,x,!_)):s.moveTo(L,F),h>vr&&S>vr?k>vr?(m=Gr(O,G,z,I,h,-k,_),v=Gr(L,F,R,j,h,-k,_),s.lineTo(m.cx+m.x01,m.cy+m.y01),k<A?s.arc(m.cx,m.cy,k,fr(m.y01,m.x01),fr(v.y01,v.x01),!_):(s.arc(m.cx,m.cy,k,fr(m.y01,m.x01),fr(m.y11,m.x11),!_),s.arc(0,0,h,fr(m.cy+m.y11,m.cx+m.x11),fr(v.cy+v.y11,v.cx+v.x11),_),s.arc(v.cx,v.cy,k,fr(v.y11,v.x11),fr(v.y01,v.x01),!_))):s.arc(0,0,h,w,b,_):s.lineTo(O,G)}else s.moveTo(0,0);if(s.closePath(),c)return s=null,c+""||null}return c.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +a.apply(this,arguments))/2-yr/2;return[pr(i)*n,_r(i)*n]},c.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:ur(+e),c):t},c.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:ur(+t),c):e},c.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:ur(+t),c):n},c.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:ur(+t),c):i},c.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:ur(+t),c):r},c.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:ur(+t),c):a},c.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:ur(+t),c):o},c.context=function(t){return arguments.length?(s=null==t?null:t,c):s},c}const zr={capture:!0,passive:!1};function Ir(t){t.preventDefault(),t.stopImmediatePropagation()}function Rr(t){return((t=Math.exp(t))+1/t)/2}const jr=function t(e,n,i){function r(t,r){var a,o,s=t[0],l=t[1],c=t[2],u=r[0],h=r[1],f=r[2],p=u-s,d=h-l,g=p*p+d*d;if(g<1e-12)o=Math.log(f/c)/e,a=function(t){return[s+t*p,l+t*d,c*Math.exp(e*t*o)]};else{var _=Math.sqrt(g),m=(f*f-c*c+i*g)/(2*c*n*_),v=(f*f-c*c-i*g)/(2*f*n*_),y=Math.log(Math.sqrt(m*m+1)-m),x=Math.log(Math.sqrt(v*v+1)-v);o=(x-y)/e,a=function(t){var i=t*o,r=Rr(y),a=c/(n*_)*(r*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(e*i+y)-function(t){return((t=Math.exp(t))-1/t)/2}(y));return[s+a*p,l+a*d,c*r/Rr(e*i+y)]}}return a.duration=1e3*o*e/Math.SQRT2,a}return r.rho=function(e){var n=Math.max(.001,+e),i=n*n;return t(n,i,i*i)},r}(Math.SQRT2,2,4);function Br(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}const qr=t=>()=>t;function Ur(t,{sourceEvent:e,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function Wr(t,e,n){this.k=t,this.x=e,this.y=n}Wr.prototype={constructor:Wr,scale:function(t){return 1===t?this:new Wr(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Wr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Hr=new Wr(1,0,0);function Vr(t){t.stopImmediatePropagation()}function $r(t){t.preventDefault(),t.stopImmediatePropagation()}function Jr(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Yr(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Xr(){return this.__zoom||Hr}function Kr(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Zr(){return navigator.maxTouchPoints||"ontouchstart"in this}function Qr(t,e,n){var i=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],a=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function ta(){var t,e,n,i=Jr,r=Yr,a=Qr,o=Kr,s=Zr,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,h=jr,f=ei("start","zoom","end"),p=0,d=10;function g(t){t.property("__zoom",Xr).on("wheel.zoom",w,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",M).filter(s).on("touchstart.zoom",E).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new Wr(e,t.x,t.y)}function m(t,e,n){var i=e[0]-n[0]*t.k,r=e[1]-n[1]*t.k;return i===t.x&&r===t.y?t:new Wr(t.k,i,r)}function v(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function y(t,e,n,i){t.on("start.zoom",(function(){x(this,arguments).event(i).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).event(i).end()})).tween("zoom",(function(){var t=this,a=arguments,o=x(t,a).event(i),s=r.apply(t,a),l=null==n?v(s):"function"==typeof n?n.apply(t,a):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=t.__zoom,f="function"==typeof e?e.apply(t,a):e,p=h(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(t){if(1===t)t=f;else{var e=p(t),n=c/e[2];t=new Wr(n,l[0]-e[0]*n,l[1]-e[1]*n)}o.zoom(null,t)}}))}function x(t,e,n){return!n&&t.__zooming||new b(t,e)}function b(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=r.apply(t,e),this.taps=0}function w(t,...e){if(i.apply(this,arguments)){var n=x(this,e).event(t),r=this.__zoom,s=Math.max(l[0],Math.min(l[1],r.k*Math.pow(2,o.apply(this,arguments)))),u=Br(t);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=r.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(r.k===s)return;n.mouse=[u,r.invert(u)],Ci(this),n.start()}$r(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),150),n.zoom("mouse",a(m(_(r,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function S(t,...e){if(!n&&i.apply(this,arguments)){var r=t.currentTarget,o=x(this,e,!0).event(t),s=Ft(t.view).on("mousemove.zoom",(function(t){if($r(t),!o.moved){var e=t.clientX-u,n=t.clientY-h;o.moved=e*e+n*n>p}o.event(t).zoom("mouse",a(m(o.that.__zoom,o.mouse[0]=Br(t,r),o.mouse[1]),o.extent,c))}),!0).on("mouseup.zoom",(function(t){s.on("mousemove.zoom mouseup.zoom",null),function(t,e){var n=t.document.documentElement,i=Ft(t).on("dragstart.drag",null);e&&(i.on("click.drag",Ir,zr),setTimeout((function(){i.on("click.drag",null)}),0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(t.view,o.moved),$r(t),o.event(t).end()}),!0),l=Br(t,r),u=t.clientX,h=t.clientY;!function(t){var e=t.document.documentElement,n=Ft(t).on("dragstart.drag",Ir,zr);"onselectstart"in e?n.on("selectstart.drag",Ir,zr):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),Vr(t),o.mouse=[l,this.__zoom.invert(l)],Ci(this),o.start()}}function M(t,...e){if(i.apply(this,arguments)){var n=this.__zoom,o=Br(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(o),l=n.k*(t.shiftKey?.5:2),h=a(m(_(n,l),o,s),r.apply(this,e),c);$r(t),u>0?Ft(this).transition().duration(u).call(y,h,o,t):Ft(this).call(g.transform,h,o,t)}}function E(n,...r){if(i.apply(this,arguments)){var a,o,s,l,c=n.touches,u=c.length,h=x(this,r,n.changedTouches.length===u).event(n);for(Vr(n),o=0;o<u;++o)l=[l=Br(s=c[o],this),this.__zoom.invert(l),s.identifier],h.touch0?h.touch1||h.touch0[2]===l[2]||(h.touch1=l,h.taps=0):(h.touch0=l,a=!0,h.taps=1+!!t);t&&(t=clearTimeout(t)),a&&(h.taps<2&&(e=l[0],t=setTimeout((function(){t=null}),500)),Ci(this),h.start())}}function C(t,...e){if(this.__zooming){var n,i,r,o,s=x(this,e).event(t),l=t.changedTouches,u=l.length;for($r(t),n=0;n<u;++n)r=Br(i=l[n],this),s.touch0&&s.touch0[2]===i.identifier?s.touch0[0]=r:s.touch1&&s.touch1[2]===i.identifier&&(s.touch1[0]=r);if(i=s.that.__zoom,s.touch1){var h=s.touch0[0],f=s.touch0[1],p=s.touch1[0],d=s.touch1[1],g=(g=p[0]-h[0])*g+(g=p[1]-h[1])*g,v=(v=d[0]-f[0])*v+(v=d[1]-f[1])*v;i=_(i,Math.sqrt(g/v)),r=[(h[0]+p[0])/2,(h[1]+p[1])/2],o=[(f[0]+d[0])/2,(f[1]+d[1])/2]}else{if(!s.touch0)return;r=s.touch0[0],o=s.touch0[1]}s.zoom("touch",a(m(i,r,o),s.extent,c))}}function A(t,...i){if(this.__zooming){var r,a,o=x(this,i).event(t),s=t.changedTouches,l=s.length;for(Vr(t),n&&clearTimeout(n),n=setTimeout((function(){n=null}),500),r=0;r<l;++r)a=s[r],o.touch0&&o.touch0[2]===a.identifier?delete o.touch0:o.touch1&&o.touch1[2]===a.identifier&&delete o.touch1;if(o.touch1&&!o.touch0&&(o.touch0=o.touch1,delete o.touch1),o.touch0)o.touch0[1]=this.__zoom.invert(o.touch0[0]);else if(o.end(),2===o.taps&&(a=Br(a,this),Math.hypot(e[0]-a[0],e[1]-a[1])<d)){var c=Ft(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return g.transform=function(t,e,n,i){var r=t.selection?t.selection():t;r.property("__zoom",Xr),t!==r?y(t,e,n,i):r.interrupt().each((function(){x(this,arguments).event(i).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},g.scaleBy=function(t,e,n,i){g.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),n,i)},g.scaleTo=function(t,e,n,i){g.transform(t,(function(){var t=r.apply(this,arguments),i=this.__zoom,o=null==n?v(t):"function"==typeof n?n.apply(this,arguments):n,s=i.invert(o),l="function"==typeof e?e.apply(this,arguments):e;return a(m(_(i,l),o,s),t,c)}),n,i)},g.translateBy=function(t,e,n,i){g.transform(t,(function(){return a(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),c)}),null,i)},g.translateTo=function(t,e,n,i,o){g.transform(t,(function(){var t=r.apply(this,arguments),o=this.__zoom,s=null==i?v(t):"function"==typeof i?i.apply(this,arguments):i;return a(Hr.translate(s[0],s[1]).scale(o.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,c)}),i,o)},b.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=Ft(this.that).datum();f.call(t,this.that,new Ur(t,{sourceEvent:this.sourceEvent,target:g,type:t,transform:this.that.__zoom,dispatch:f}),e)}},g.wheelDelta=function(t){return arguments.length?(o="function"==typeof t?t:qr(+t),g):o},g.filter=function(t){return arguments.length?(i="function"==typeof t?t:qr(!!t),g):i},g.touchable=function(t){return arguments.length?(s="function"==typeof t?t:qr(!!t),g):s},g.extent=function(t){return arguments.length?(r="function"==typeof t?t:qr([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),g):r},g.scaleExtent=function(t){return arguments.length?(l[0]=+t[0],l[1]=+t[1],g):[l[0],l[1]]},g.translateExtent=function(t){return arguments.length?(c[0][0]=+t[0][0],c[1][0]=+t[1][0],c[0][1]=+t[0][1],c[1][1]=+t[1][1],g):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},g.constrain=function(t){return arguments.length?(a=t,g):a},g.duration=function(t){return arguments.length?(u=+t,g):u},g.interpolate=function(t){return arguments.length?(h=t,g):h},g.on=function(){var t=f.on.apply(f,arguments);return t===f?g:t},g.clickDistance=function(t){return arguments.length?(p=(t=+t)*t,g):Math.sqrt(p)},g.tapDistance=function(t){return arguments.length?(d=+t,g):d},g}function ea(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return na(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?na(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function na(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function ia(t,e,n){if(!t.startsWith(".")&&!t.startsWith("#"))throw new Error('Invalid selector: Must start with "." for classes or "#" for IDs.');for(var i=0,r=Array.from(document.styleSheets);i<r.length;i++){var a=r[i];try{var o,s=ea(a.cssRules||a.rules);try{for(s.s();!(o=s.n()).done;){var l=o.value;if(l.selectorText===t)return void(l.style[e]=n)}}catch(t){s.e(t)}finally{s.f()}}catch(t){console.warn("Could not access rules in stylesheet:",t)}}var c=document.getElementById("custom-styles");c||((c=document.createElement("style")).id="custom-styles",document.head.appendChild(c));try{c.sheet.insertRule("".concat(t," { ").concat(e,": ").concat(n,"; }"),c.sheet.cssRules.length)}catch(i){console.error("Failed to insert rule: ".concat(t," { ").concat(e,": ").concat(n,"; }"),i)}}Wr.prototype;var ra=function(t){var e=document.createElement("div");e.className=t,e.style.position="absolute",e.style.visibility="hidden",e.style.height="auto",e.style.width="auto",e.style.lineHeight="normal",e.style.fontSize="initial",document.body.appendChild(e);var n=parseFloat(window.getComputedStyle(e).fontSize);return document.body.removeChild(e),n||0},aa=function(t,e){var n=document.createElement("div");n.className=t,n.style.position="absolute",n.style.visibility="hidden",n.style.height="auto",n.style.lineHeight="normal",document.body.appendChild(n);var i=window.getComputedStyle(n).getPropertyValue(e);return document.body.removeChild(n),i||null};function oa(t){var e=[],n=function(){var t,e=[],n=ea(document.styleSheets);try{for(n.s();!(t=n.n()).done;){var i=t.value;try{var r,a=ea(i.cssRules);try{for(a.s();!(r=a.n()).done;){var o=r.value;e.push(o)}}catch(t){a.e(t)}finally{a.f()}}catch(t){console.warn("Unable to access stylesheet:",i.href,t)}}}catch(t){n.e(t)}finally{n.f()}return e}();n.forEach((function(n){t.matches(n.selectorText)&&e.push(n.style)}));var i={};return e.forEach((function(t){for(var e=0;e<t.length;e++){var n=t[e];i[n]=t.getPropertyValue(n)}})),i}var sa=function(t){t.querySelectorAll("*").forEach((function(t){var e=oa(t);Object.keys(e).forEach((function(n){var i=e[n];!t.style.getPropertyValue(n)&&i&&t.style.setProperty(n,i)}))}))},la=function(t){return t.toLocaleString("en").replace(/,/gi," ")};function ca(t){return"".concat(t,"-").concat(Math.random().toString(36).substr(2,9))}var ua=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;for(var a in t){var o=t[a];Array.isArray(o)?o.forEach((function(t){Array.isArray(t)?t.forEach((function(t){t.svgId_!==e&&n(t,i,r)})):t.svgId_!==e&&n(t,i,r)})):o.svgId_!==e&&n(o,i,r)}};function ha(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(location.search);return e?decodeURIComponent(e[1].replace(/\+/g," ")):null}var fa=function(t){var e,n,i;if(!t.startsWith("rgb")&&!t.startsWith("#")){var r=document.createElement("div");r.style.color=t,document.body.appendChild(r);var a=window.getComputedStyle(r).color;document.body.removeChild(r),t=a}if(t.startsWith("#")){var o=t.replace("#","");3===o.length&&(o=o.split("").map((function(t){return t+t})).join("")),e=parseInt(o.substring(0,2),16),n=parseInt(o.substring(2,4),16),i=parseInt(o.substring(4,6),16)}else{var s=t.match(/\d+/g);e=parseInt(s[0]),n=parseInt(s[1]),i=parseInt(s[2])}return e/255*.2126+n/255*.7152+i/255*.0722>.5?"black":"white"},pa=function(t){return t.Geometries.userGeometries?"#em-user-regions path":t.gridCartogram_?"#em-grid-container .em-grid-cell":"WORLD"===t.geo_?"#em-worldrg path":"#em-nutsrg path:not(#em-cntrg-RS):not(#em-cntrg-EL), #em-cntrg path:not(#em-cntrg-RS):not(#em-cntrg-EL)"},da=function(t){return t.Geometries.userGeometries?"#em-user-regions":t.gridCartogram_?"#em-grid-container":"WORLD"===t.geo_?"#em-worldrg":"#em-nutsrg, #em-cntrg"};function ga(t){return ga="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ga(t)}function _a(t){var e=function(t,e){if("object"!=ga(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=ga(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ga(e)?e:e+""}function ma(t,e,n){return(e=_a(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function va(t){return"string"==typeof t?new Pt([document.querySelectorAll(t)],[document.documentElement]):new Pt([w(t)],Tt)}class ya{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let i=0;i<this._n&&i<32;i++){const r=e[i],a=t+r,o=Math.abs(t)<Math.abs(r)?t-(a-r):r-(a-t);o&&(e[n++]=o),t=a}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,i,r=this._n,a=0;if(r>0){for(a=t[--r];r>0&&(e=a,n=t[--r],a=e+n,i=n-(a-e),!i););r>0&&(i<0&&t[r-1]<0||i>0&&t[r-1]>0)&&(n=2*i,e=a+n,n==e-a&&(a=e))}return a}}var xa=1e-6,ba=1e-12,wa=Math.PI,Sa=wa/2,Ma=wa/4,Ea=2*wa,Ca=180/wa,Aa=wa/180,ka=Math.abs,Ta=Math.atan,Pa=Math.atan2,Na=Math.cos,La=Math.ceil,Fa=(Math.exp,Math.floor,Math.hypot),Oa=(Math.log,Math.pow,Math.sin),Ga=Math.sign||function(t){return t>0?1:t<0?-1:0},Da=Math.sqrt;Math.tan;function za(t){return t>1?Sa:t<-1?-Sa:Math.asin(t)}function Ia(){}function Ra(t,e){t&&io.hasOwnProperty(t.type)&&io[t.type](t,e)}var ja,Ba,qa,Ua,Wa,Ha,Va,$a,Ja,Ya,Xa,Ka,Za,Qa,to,eo,no={Feature:function(t,e){Ra(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)Ra(n[i].geometry,e)}},io={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){ro(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)ro(n[i],e,0)},Polygon:function(t,e){ao(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)ao(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)Ra(n[i],e)}};function ro(t,e,n){var i,r=-1,a=t.length-n;for(e.lineStart();++r<a;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function ao(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)ro(t[n],e,1);e.polygonEnd()}function oo(t,e){t&&no.hasOwnProperty(t.type)?no[t.type](t,e):Ra(t,e)}var so={sphere:Ia,point:lo,lineStart:uo,lineEnd:po,polygonStart:function(){so.lineStart=go,so.lineEnd=_o},polygonEnd:function(){so.lineStart=uo,so.lineEnd=po}};function lo(t,e){t*=Aa;var n=Na(e*=Aa);co(n*Na(t),n*Oa(t),Oa(e))}function co(t,e,n){++ja,qa+=(t-qa)/ja,Ua+=(e-Ua)/ja,Wa+=(n-Wa)/ja}function uo(){so.point=ho}function ho(t,e){t*=Aa;var n=Na(e*=Aa);Qa=n*Na(t),to=n*Oa(t),eo=Oa(e),so.point=fo,co(Qa,to,eo)}function fo(t,e){t*=Aa;var n=Na(e*=Aa),i=n*Na(t),r=n*Oa(t),a=Oa(e),o=Pa(Da((o=to*a-eo*r)*o+(o=eo*i-Qa*a)*o+(o=Qa*r-to*i)*o),Qa*i+to*r+eo*a);Ba+=o,Ha+=o*(Qa+(Qa=i)),Va+=o*(to+(to=r)),$a+=o*(eo+(eo=a)),co(Qa,to,eo)}function po(){so.point=lo}function go(){so.point=mo}function _o(){vo(Ka,Za),so.point=lo}function mo(t,e){Ka=t,Za=e,t*=Aa,e*=Aa,so.point=vo;var n=Na(e);Qa=n*Na(t),to=n*Oa(t),eo=Oa(e),co(Qa,to,eo)}function vo(t,e){t*=Aa;var n=Na(e*=Aa),i=n*Na(t),r=n*Oa(t),a=Oa(e),o=to*a-eo*r,s=eo*i-Qa*a,l=Qa*r-to*i,c=Fa(o,s,l),u=za(c),h=c&&-u/c;Ja.add(h*o),Ya.add(h*s),Xa.add(h*l),Ba+=u,Ha+=u*(Qa+(Qa=i)),Va+=u*(to+(to=r)),$a+=u*(eo+(eo=a)),co(Qa,to,eo)}function yo(t){ja=Ba=qa=Ua=Wa=Ha=Va=$a=0,Ja=new ya,Ya=new ya,Xa=new ya,oo(t,so);var e=+Ja,n=+Ya,i=+Xa,r=Fa(e,n,i);return r<ba&&(e=Ha,n=Va,i=$a,Ba<xa&&(e=qa,n=Ua,i=Wa),(r=Fa(e,n,i))<ba)?[NaN,NaN]:[Pa(n,e)*Ca,za(i/r)*Ca]}function xo(){var t,e=[];return{point:function(e,n,i){t.push([e,n,i])},lineStart:function(){e.push(t=[])},lineEnd:Ia,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function bo(t,e){return ka(t[0]-e[0])<xa&&ka(t[1]-e[1])<xa}function wo(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function So(t,e,n,i,r){var a,o,s=[],l=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,i=t[0],o=t[e];if(bo(i,o)){if(!i[2]&&!o[2]){for(r.lineStart(),a=0;a<e;++a)r.point((i=t[a])[0],i[1]);return void r.lineEnd()}o[0]+=2e-6}s.push(n=new wo(i,t,null,!0)),l.push(n.o=new wo(i,null,n,!1)),s.push(n=new wo(o,t,null,!1)),l.push(n.o=new wo(o,null,n,!0))}})),s.length){for(l.sort(e),Mo(s),Mo(l),a=0,o=l.length;a<o;++a)l[a].e=n=!n;for(var c,u,h=s[0];;){for(var f=h,p=!0;f.v;)if((f=f.n)===h)return;c=f.z,r.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(a=0,o=c.length;a<o;++a)r.point((u=c[a])[0],u[1]);else i(f.x,f.n.x,1,r);f=f.n}else{if(p)for(c=f.p.z,a=c.length-1;a>=0;--a)r.point((u=c[a])[0],u[1]);else i(f.x,f.p.x,-1,r);f=f.p}c=(f=f.o).z,p=!p}while(!f.v);r.lineEnd()}}}function Mo(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i<e;)r.n=n=t[i],n.p=r,r=n;r.n=n=t[0],n.p=r}}function Eo(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}var Co=1e9,Ao=-Co;function ko(t,e,n,i){function r(r,a){return t<=r&&r<=n&&e<=a&&a<=i}function a(r,a,s,c){var u=0,h=0;if(null==r||(u=o(r,s))!==(h=o(a,s))||l(r,a)<0^s>0)do{c.point(0===u||3===u?t:n,u>1?i:e)}while((u=(u+s+4)%4)!==h);else c.point(a[0],a[1])}function o(i,r){return ka(i[0]-t)<xa?r>0?0:3:ka(i[0]-n)<xa?r>0?2:1:ka(i[1]-e)<xa?r>0?1:0:r>0?3:2}function s(t,e){return l(t.x,e.x)}function l(t,e){var n=o(t,1),i=o(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var l,c,u,h,f,p,d,g,_,m,v,y=o,x=xo(),b={point:w,lineStart:function(){b.point=S,c&&c.push(u=[]);m=!0,_=!1,d=g=NaN},lineEnd:function(){l&&(S(h,f),p&&_&&x.rejoin(),l.push(x.result()));b.point=w,_&&y.lineEnd()},polygonStart:function(){y=x,l=[],c=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,r=c.length;n<r;++n)for(var a,o,s=c[n],l=1,u=s.length,h=s[0],f=h[0],p=h[1];l<u;++l)a=f,o=p,f=(h=s[l])[0],p=h[1],o<=i?p>i&&(f-a)*(i-o)>(p-o)*(t-a)&&++e:p<=i&&(f-a)*(i-o)<(p-o)*(t-a)&&--e;return e}(),n=v&&e,r=(l=Eo(l)).length;(n||r)&&(o.polygonStart(),n&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),r&&So(l,s,e,a,o),o.polygonEnd());y=o,l=c=u=null}};function w(t,e){r(t,e)&&y.point(t,e)}function S(a,o){var s=r(a,o);if(c&&u.push([a,o]),m)h=a,f=o,p=s,m=!1,s&&(y.lineStart(),y.point(a,o));else if(s&&_)y.point(a,o);else{var l=[d=Math.max(Ao,Math.min(Co,d)),g=Math.max(Ao,Math.min(Co,g))],x=[a=Math.max(Ao,Math.min(Co,a)),o=Math.max(Ao,Math.min(Co,o))];!function(t,e,n,i,r,a){var o,s=t[0],l=t[1],c=0,u=1,h=e[0]-s,f=e[1]-l;if(o=n-s,h||!(o>0)){if(o/=h,h<0){if(o<c)return;o<u&&(u=o)}else if(h>0){if(o>u)return;o>c&&(c=o)}if(o=r-s,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o<c)return;o<u&&(u=o)}if(o=i-l,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<u&&(u=o)}else if(f>0){if(o>u)return;o>c&&(c=o)}if(o=a-l,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<u&&(u=o)}return c>0&&(t[0]=s+c*h,t[1]=l+c*f),u<1&&(e[0]=s+u*h,e[1]=l+u*f),!0}}}}}(l,x,t,e,n,i)?s&&(y.lineStart(),y.point(a,o),v=!1):(_||(y.lineStart(),y.point(l[0],l[1])),y.point(x[0],x[1]),s||y.lineEnd(),v=!1)}d=a,g=o,_=s}return b}}const To=t=>t;function Po(t){return function(e){var n=new No;for(var i in t)n[i]=t[i];return n.stream=e,n}}function No(){}No.prototype={constructor:No,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Lo=1/0,Fo=Lo,Oo=-Lo,Go=Oo,Do={point:function(t,e){t<Lo&&(Lo=t);t>Oo&&(Oo=t);e<Fo&&(Fo=e);e>Go&&(Go=e)},lineStart:Ia,lineEnd:Ia,polygonStart:Ia,polygonEnd:Ia,result:function(){var t=[[Lo,Fo],[Oo,Go]];return Oo=Go=-(Fo=Lo=1/0),t}};const zo=Do;function Io(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),oo(n,t.stream(zo)),e(zo.result()),null!=i&&t.clipExtent(i),t}function Ro(t,e,n){return Io(t,(function(n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],a=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),o=+e[0][0]+(i-a*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(r-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([o,s])}),n)}function jo(t,e,n){return Ro(t,[[0,0],e],n)}function Bo(t,e,n){return Io(t,(function(n){var i=+e,r=i/(n[1][0]-n[0][0]),a=(i-r*(n[1][0]+n[0][0]))/2,o=-r*n[0][1];t.scale(150*r).translate([a,o])}),n)}function qo(t,e,n){return Io(t,(function(n){var i=+e,r=i/(n[1][1]-n[0][1]),a=-r*n[0][0],o=(i-r*(n[1][1]+n[0][1]))/2;t.scale(150*r).translate([a,o])}),n)}var Uo,Wo,Ho,Vo,$o=new ya,Jo=new ya,Yo={point:Ia,lineStart:Ia,lineEnd:Ia,polygonStart:function(){Yo.lineStart=Xo,Yo.lineEnd=Qo},polygonEnd:function(){Yo.lineStart=Yo.lineEnd=Yo.point=Ia,$o.add(ka(Jo)),Jo=new ya},result:function(){var t=$o/2;return $o=new ya,t}};function Xo(){Yo.point=Ko}function Ko(t,e){Yo.point=Zo,Uo=Ho=t,Wo=Vo=e}function Zo(t,e){Jo.add(Vo*t-Ho*e),Ho=t,Vo=e}function Qo(){Zo(Uo,Wo)}const ts=Yo;var es,ns,is,rs,as=0,os=0,ss=0,ls=0,cs=0,us=0,hs=0,fs=0,ps=0,ds={point:gs,lineStart:_s,lineEnd:ys,polygonStart:function(){ds.lineStart=xs,ds.lineEnd=bs},polygonEnd:function(){ds.point=gs,ds.lineStart=_s,ds.lineEnd=ys},result:function(){var t=ps?[hs/ps,fs/ps]:us?[ls/us,cs/us]:ss?[as/ss,os/ss]:[NaN,NaN];return as=os=ss=ls=cs=us=hs=fs=ps=0,t}};function gs(t,e){as+=t,os+=e,++ss}function _s(){ds.point=ms}function ms(t,e){ds.point=vs,gs(is=t,rs=e)}function vs(t,e){var n=t-is,i=e-rs,r=Da(n*n+i*i);ls+=r*(is+t)/2,cs+=r*(rs+e)/2,us+=r,gs(is=t,rs=e)}function ys(){ds.point=gs}function xs(){ds.point=ws}function bs(){Ss(es,ns)}function ws(t,e){ds.point=Ss,gs(es=is=t,ns=rs=e)}function Ss(t,e){var n=t-is,i=e-rs,r=Da(n*n+i*i);ls+=r*(is+t)/2,cs+=r*(rs+e)/2,us+=r,hs+=(r=rs*t-is*e)*(is+t),fs+=r*(rs+e),ps+=3*r,gs(is=t,rs=e)}const Ms=ds;function Es(t){this._context=t}Es.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Ea)}},result:Ia};var Cs,As,ks,Ts,Ps,Ns=new ya,Ls={point:Ia,lineStart:function(){Ls.point=Fs},lineEnd:function(){Cs&&Os(As,ks),Ls.point=Ia},polygonStart:function(){Cs=!0},polygonEnd:function(){Cs=null},result:function(){var t=+Ns;return Ns=new ya,t}};function Fs(t,e){Ls.point=Os,As=Ts=t,ks=Ps=e}function Os(t,e){Ts-=t,Ps-=e,Ns.add(Da(Ts*Ts+Ps*Ps)),Ts=t,Ps=e}const Gs=Ls;let Ds,zs,Is,Rs;class js{constructor(t){this._append=null==t?Bs:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return Bs;if(e!==Ds){const t=10**e;Ds=e,zs=function(e){let n=1;this._+=e[0];for(const i=e.length;n<i;++n)this._+=Math.round(arguments[n]*t)/t+e[n]}}return zs}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append`M${t},${e}`,this._point=1;break;case 1:this._append`L${t},${e}`;break;default:if(this._append`M${t},${e}`,this._radius!==Is||this._append!==zs){const t=this._radius,e=this._;this._="",this._append`m0,${t}a${t},${t} 0 1,1 0,${-2*t}a${t},${t} 0 1,1 0,${2*t}z`,Is=t,zs=this._append,Rs=this._,this._=e}this._+=Rs}}result(){const t=this._;return this._="",t.length?t:null}}function Bs(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function qs(t,e){let n,i,r=3,a=4.5;function o(t){return t&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),oo(t,n(i))),i.result()}return o.area=function(t){return oo(t,n(ts)),ts.result()},o.measure=function(t){return oo(t,n(Gs)),Gs.result()},o.bounds=function(t){return oo(t,n(zo)),zo.result()},o.centroid=function(t){return oo(t,n(Ms)),Ms.result()},o.projection=function(e){return arguments.length?(n=null==e?(t=null,To):(t=e).stream,o):t},o.context=function(t){return arguments.length?(i=null==t?(e=null,new js(r)):new Es(e=t),"function"!=typeof a&&i.pointRadius(a),o):e},o.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),o):a},o.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);r=e}return null===e&&(i=new js(r)),o},o.projection(t).digits(r).context(e)}function Us(){}function Ws(){var t,e=[];return{point:function(e,n,i){t.push([e,n,i])},lineStart:function(){e.push(t=[])},lineEnd:Us,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}var Hs=1e-6,Vs=Math.PI,$s=Vs/2,Js=Vs/4,Ys=2*Vs,Xs=180/Vs,Ks=Vs/180,Zs=Math.abs,Qs=Math.atan,tl=Math.atan2,el=Math.cos,nl=(Math.ceil,Math.exp,Math.floor,Math.hypot,Math.log,Math.pow,Math.sin),il=Math.sign||function(t){return t>0?1:t<0?-1:0},rl=Math.sqrt;Math.tan;function al(t){return t>1?$s:t<-1?-$s:Math.asin(t)}function ol(t,e){return Zs(t[0]-e[0])<Hs&&Zs(t[1]-e[1])<Hs}function sl(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function ll(t,e,n,i,r){var a,o,s=[],l=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,i=t[0],o=t[e];if(ol(i,o)){if(!i[2]&&!o[2]){for(r.lineStart(),a=0;a<e;++a)r.point((i=t[a])[0],i[1]);return void r.lineEnd()}o[0]+=2e-6}s.push(n=new sl(i,t,null,!0)),l.push(n.o=new sl(i,null,n,!1)),s.push(n=new sl(o,t,null,!1)),l.push(n.o=new sl(o,null,n,!0))}})),s.length){for(l.sort(e),cl(s),cl(l),a=0,o=l.length;a<o;++a)l[a].e=n=!n;for(var c,u,h=s[0];;){for(var f=h,p=!0;f.v;)if((f=f.n)===h)return;c=f.z,r.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(a=0,o=c.length;a<o;++a)r.point((u=c[a])[0],u[1]);else i(f.x,f.n.x,1,r);f=f.n}else{if(p)for(c=f.p.z,a=c.length-1;a>=0;--a)r.point((u=c[a])[0],u[1]);else i(f.x,f.p.x,-1,r);f=f.p}c=(f=f.o).z,p=!p}while(!f.v);r.lineEnd()}}}function cl(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i<e;)r.n=n=t[i],n.p=r,r=n;r.n=n=t[0],n.p=r}}class ul{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let i=0;i<this._n&&i<32;i++){const r=e[i],a=t+r,o=Math.abs(t)<Math.abs(r)?t-(a-r):r-(a-t);o&&(e[n++]=o),t=a}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,i,r=this._n,a=0;if(r>0){for(a=t[--r];r>0&&(e=a,n=t[--r],a=e+n,i=n-(a-e),!i););r>0&&(i<0&&t[r-1]<0||i>0&&t[r-1]>0)&&(n=2*i,e=a+n,n==e-a&&(a=e))}return a}}function hl(t){return[tl(t[1],t[0]),al(t[2])]}function fl(t){var e=t[0],n=t[1],i=el(n);return[i*el(e),i*nl(e),nl(n)]}function pl(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function dl(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function gl(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function _l(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function ml(t){var e=rl(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function vl(t){return Zs(t[0])<=Vs?t[0]:il(t[0])*((Zs(t[0])+Vs)%Ys-Vs)}function yl(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function xl(t,e,n,i){return function(r){var a,o,s,l=e(r),c=Ws(),u=e(c),h=!1,f={point:p,lineStart:g,lineEnd:_,polygonStart:function(){f.point=m,f.lineStart=v,f.lineEnd=y,o=[],a=[]},polygonEnd:function(){f.point=p,f.lineStart=g,f.lineEnd=_,o=yl(o);var t=function(t,e){var n=vl(e),i=e[1],r=nl(i),a=[nl(n),-el(n),0],o=0,s=0,l=new ul;1===r?i=$s+Hs:-1===r&&(i=-$s-Hs);for(var c=0,u=t.length;c<u;++c)if(f=(h=t[c]).length)for(var h,f,p=h[f-1],d=vl(p),g=p[1]/2+Js,_=nl(g),m=el(g),v=0;v<f;++v,d=x,_=w,m=S,p=y){var y=h[v],x=vl(y),b=y[1]/2+Js,w=nl(b),S=el(b),M=x-d,E=M>=0?1:-1,C=E*M,A=C>Vs,k=_*w;if(l.add(tl(k*E*nl(C),m*S+k*el(C))),o+=A?M+E*Ys:M,A^d>=n^x>=n){var T=dl(fl(p),fl(y));ml(T);var P=dl(a,T);ml(P);var N=(A^M>=0?-1:1)*al(P[2]);(i>N||i===N&&(T[0]||T[1]))&&(s+=A^M>=0?1:-1)}}return(o<-1e-6||o<Hs&&l<-1e-12)^1&s}(a,i);o.length?(h||(r.polygonStart(),h=!0),ll(o,wl,t,n,r)):t&&(h||(r.polygonStart(),h=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),h&&(r.polygonEnd(),h=!1),o=a=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function p(e,n){t(e,n)&&r.point(e,n)}function d(t,e){l.point(t,e)}function g(){f.point=d,l.lineStart()}function _(){f.point=p,l.lineEnd()}function m(t,e){s.push([t,e]),u.point(t,e)}function v(){u.lineStart(),s=[]}function y(){m(s[0][0],s[0][1]),u.lineEnd();var t,e,n,i,l=u.clean(),f=c.result(),p=f.length;if(s.pop(),a.push(s),s=null,p)if(1&l){if((e=(n=f[0]).length-1)>0){for(h||(r.polygonStart(),h=!0),r.lineStart(),t=0;t<e;++t)r.point((i=n[t])[0],i[1]);r.lineEnd()}}else p>1&&2&l&&f.push(f.pop().concat(f.shift())),o.push(f.filter(bl))}return f}}function bl(t){return t.length>1}function wl(t,e){return((t=t.x)[0]<0?t[1]-$s-Hs:$s-t[1])-((e=e.x)[0]<0?e[1]-$s-Hs:$s-e[1])}const Sl=xl((function(){return!0}),(function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?Vs:-Vs,l=Zs(a-n);Zs(l-Vs)<Hs?(t.point(n,i=(i+o)/2>0?$s:-$s),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(s,i),t.point(a,i),e=0):r!==s&&l>=Vs&&(Zs(n-r)<Hs&&(n-=r*Hs),Zs(a-s)<Hs&&(a-=s*Hs),i=function(t,e,n,i){var r,a,o=nl(t-n);return Zs(o)>Hs?Qs((nl(e)*(a=el(i))*nl(n)-nl(i)*(r=el(e))*nl(t))/(r*a*o)):(e+i)/2}(n,i,a,o),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(s,i),e=0),t.point(n=a,i=o),r=s},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}}),(function(t,e,n,i){var r;if(null==t)r=n*$s,i.point(-Vs,r),i.point(0,r),i.point(Vs,r),i.point(Vs,0),i.point(Vs,-r),i.point(0,-r),i.point(-Vs,-r),i.point(-Vs,0),i.point(-Vs,r);else if(Zs(t[0]-e[0])>Hs){var a=t[0]<e[0]?Vs:-Vs;r=n*a/2,i.point(-a,r),i.point(0,r),i.point(a,r)}else i.point(e[0],e[1])}),[-Vs,-$s]);function Ml(t,e,n,i,r,a){if(n){var o=el(e),s=nl(e),l=i*n;null==r?(r=e+i*Ys,a=e-l/2):(r=El(o,r),a=El(o,a),(i>0?r<a:r>a)&&(r+=i*Ys));for(var c,u=r;i>0?u>a:u<a;u-=l)c=hl([o,-s*el(u),-s*nl(u)]),t.point(c[0],c[1])}}function El(t,e){(e=fl(e))[0]-=t,ml(e);var n=function(t){return t>1?0:t<-1?Vs:Math.acos(t)}(-e[1]);return((-e[2]<0?-n:n)+Ys-Hs)%Ys}var Cl=1e9,Al=-1e9;function kl(t,e,n,i){function r(r,a){return t<=r&&r<=n&&e<=a&&a<=i}function a(r,a,s,c){var u=0,h=0;if(null==r||(u=o(r,s))!==(h=o(a,s))||l(r,a)<0^s>0)do{c.point(0===u||3===u?t:n,u>1?i:e)}while((u=(u+s+4)%4)!==h);else c.point(a[0],a[1])}function o(i,r){return Zs(i[0]-t)<Hs?r>0?0:3:Zs(i[0]-n)<Hs?r>0?2:1:Zs(i[1]-e)<Hs?r>0?1:0:r>0?3:2}function s(t,e){return l(t.x,e.x)}function l(t,e){var n=o(t,1),i=o(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var l,c,u,h,f,p,d,g,_,m,v,y=o,x=Ws(),b={point:w,lineStart:function(){b.point=S,c&&c.push(u=[]);m=!0,_=!1,d=g=NaN},lineEnd:function(){l&&(S(h,f),p&&_&&x.rejoin(),l.push(x.result()));b.point=w,_&&y.lineEnd()},polygonStart:function(){y=x,l=[],c=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,r=c.length;n<r;++n)for(var a,o,s=c[n],l=1,u=s.length,h=s[0],f=h[0],p=h[1];l<u;++l)a=f,o=p,f=(h=s[l])[0],p=h[1],o<=i?p>i&&(f-a)*(i-o)>(p-o)*(t-a)&&++e:p<=i&&(f-a)*(i-o)<(p-o)*(t-a)&&--e;return e}(),n=v&&e,r=(l=yl(l)).length;(n||r)&&(o.polygonStart(),n&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),r&&ll(l,s,e,a,o),o.polygonEnd());y=o,l=c=u=null}};function w(t,e){r(t,e)&&y.point(t,e)}function S(a,o){var s=r(a,o);if(c&&u.push([a,o]),m)h=a,f=o,p=s,m=!1,s&&(y.lineStart(),y.point(a,o));else if(s&&_)y.point(a,o);else{var l=[d=Math.max(Al,Math.min(Cl,d)),g=Math.max(Al,Math.min(Cl,g))],x=[a=Math.max(Al,Math.min(Cl,a)),o=Math.max(Al,Math.min(Cl,o))];!function(t,e,n,i,r,a){var o,s=t[0],l=t[1],c=0,u=1,h=e[0]-s,f=e[1]-l;if(o=n-s,h||!(o>0)){if(o/=h,h<0){if(o<c)return;o<u&&(u=o)}else if(h>0){if(o>u)return;o>c&&(c=o)}if(o=r-s,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o<c)return;o<u&&(u=o)}if(o=i-l,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<u&&(u=o)}else if(f>0){if(o>u)return;o>c&&(c=o)}if(o=a-l,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<u&&(u=o)}return c>0&&(t[0]=s+c*h,t[1]=l+c*f),u<1&&(e[0]=s+u*h,e[1]=l+u*f),!0}}}}}(l,x,t,e,n,i)?s&&(y.lineStart(),y.point(a,o),v=!1):(_||(y.lineStart(),y.point(l[0],l[1])),y.point(x[0],x[1]),s||y.lineEnd(),v=!1)}d=a,g=o,_=s}return b}}function Tl(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return(n=e.invert(n,i))&&t.invert(n[0],n[1])}),n}const Pl=t=>t;function Nl(t,e){return[Zs(t)>Vs?t+Math.round(-t/Ys)*Ys:t,e]}function Ll(t,e,n){return(t%=Ys)?e||n?Tl(Ol(t),Gl(e,n)):Ol(t):e||n?Gl(e,n):Nl}function Fl(t){return function(e,n){return[(e+=t)>Vs?e-Ys:e<-Vs?e+Ys:e,n]}}function Ol(t){var e=Fl(t);return e.invert=Fl(-t),e}function Gl(t,e){var n=el(t),i=nl(t),r=el(e),a=nl(e);function o(t,e){var o=el(e),s=el(t)*o,l=nl(t)*o,c=nl(e),u=c*n+s*i;return[tl(l*r-u*a,s*n-c*i),al(u*r+l*a)]}return o.invert=function(t,e){var o=el(e),s=el(t)*o,l=nl(t)*o,c=nl(e),u=c*r-l*a;return[tl(l*r+c*a,s*n+u*i),al(u*n-s*i)]},o}function Dl(t){return function(e){var n=new zl;for(var i in t)n[i]=t[i];return n.stream=e,n}}function zl(){}function Il(t,e){t&&jl.hasOwnProperty(t.type)&&jl[t.type](t,e)}Nl.invert=Nl,zl.prototype={constructor:zl,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Rl={Feature:function(t,e){Il(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)Il(n[i].geometry,e)}},jl={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){Bl(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)Bl(n[i],e,0)},Polygon:function(t,e){ql(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)ql(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)Il(n[i],e)}};function Bl(t,e,n){var i,r=-1,a=t.length-n;for(e.lineStart();++r<a;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function ql(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)Bl(t[n],e,1);e.polygonEnd()}var Ul=1/0,Wl=Ul,Hl=-Ul,Vl=Hl,$l={point:function(t,e){t<Ul&&(Ul=t);t>Hl&&(Hl=t);e<Wl&&(Wl=e);e>Vl&&(Vl=e)},lineStart:Us,lineEnd:Us,polygonStart:Us,polygonEnd:Us,result:function(){var t=[[Ul,Wl],[Hl,Vl]];return Hl=Vl=-(Wl=Ul=1/0),t}};const Jl=$l;function Yl(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),function(t,e){t&&Rl.hasOwnProperty(t.type)?Rl[t.type](t,e):Il(t,e)}(n,t.stream(Jl)),e(Jl.result()),null!=i&&t.clipExtent(i),t}function Xl(t,e,n){return Yl(t,(function(n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],a=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),o=+e[0][0]+(i-a*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(r-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([o,s])}),n)}var Kl=el(30*Ks);function Zl(t,e){return+e?function(t,e){function n(i,r,a,o,s,l,c,u,h,f,p,d,g,_){var m=c-i,v=u-r,y=m*m+v*v;if(y>4*e&&g--){var x=o+f,b=s+p,w=l+d,S=rl(x*x+b*b+w*w),M=al(w/=S),E=Zs(Zs(w)-1)<Hs||Zs(a-h)<Hs?(a+h)/2:tl(b,x),C=t(E,M),A=C[0],k=C[1],T=A-i,P=k-r,N=v*T-m*P;(N*N/y>e||Zs((m*T+v*P)/y-.5)>.3||o*f+s*p+l*d<Kl)&&(n(i,r,a,o,s,l,A,k,E,x/=S,b/=S,w,g,_),_.point(A,k),n(A,k,E,x,b,w,c,u,h,f,p,d,g,_))}}return function(e){var i,r,a,o,s,l,c,u,h,f,p,d,g={point:_,lineStart:m,lineEnd:y,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=m}};function _(n,i){n=t(n,i),e.point(n[0],n[1])}function m(){u=NaN,g.point=v,e.lineStart()}function v(i,r){var a=fl([i,r]),o=t(i,r);n(u,h,c,f,p,d,u=o[0],h=o[1],c=i,f=a[0],p=a[1],d=a[2],16,e),e.point(u,h)}function y(){g.point=_,e.lineEnd()}function x(){m(),g.point=b,g.lineEnd=w}function b(t,e){v(i=t,e),r=u,a=h,o=f,s=p,l=d,g.point=v}function w(){n(u,h,c,f,p,d,r,a,i,o,s,l,16,e),g.lineEnd=y,y()}return g}}(t,e):function(t){return Dl({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Ql=Dl({point:function(t,e){this.stream.point(t*Ks,e*Ks)}});function tc(t,e,n,i,r,a){if(!a)return function(t,e,n,i,r){function a(a,o){return[e+t*(a*=i),n-t*(o*=r)]}return a.invert=function(a,o){return[(a-e)/t*i,(n-o)/t*r]},a}(t,e,n,i,r);var o=el(a),s=nl(a),l=o*t,c=s*t,u=o/t,h=s/t,f=(s*n-o*e)/t,p=(s*e+o*n)/t;function d(t,a){return[l*(t*=i)-c*(a*=r)+e,n-c*t-l*a]}return d.invert=function(t,e){return[i*(u*t-h*e+f),r*(p-h*t-u*e)]},d}function ec(t){return function(t){var e,n,i,r,a,o,s,l,c,u,h=150,f=480,p=250,d=0,g=0,_=0,m=0,v=0,y=0,x=1,b=1,w=null,S=Sl,M=null,E=Pl,C=.5;function A(t){return l(t[0]*Ks,t[1]*Ks)}function k(t){return(t=l.invert(t[0],t[1]))&&[t[0]*Xs,t[1]*Xs]}function T(){var t=tc(h,0,0,x,b,y).apply(null,e(d,g)),i=tc(h,f-t[0],p-t[1],x,b,y);return n=Ll(_,m,v),s=Tl(e,i),l=Tl(n,s),o=Zl(s,C),P()}function P(){return c=u=null,A}return A.stream=function(t){return c&&u===t?c:c=Ql(function(t){return Dl({point:function(e,n){var i=t(e,n);return this.stream.point(i[0],i[1])}})}(n)(S(o(E(u=t)))))},A.preclip=function(t){return arguments.length?(S=t,w=void 0,P()):S},A.postclip=function(t){return arguments.length?(E=t,M=i=r=a=null,P()):E},A.clipAngle=function(t){return arguments.length?(S=+t?function(t){var e=el(t),n=6*Ks,i=e>0,r=Zs(e)>Hs;function a(t,n){return el(t)*el(n)>e}function o(t,n,i){var r=[1,0,0],a=dl(fl(t),fl(n)),o=pl(a,a),s=a[0],l=o-s*s;if(!l)return!i&&t;var c=e*o/l,u=-e*s/l,h=dl(r,a),f=_l(r,c);gl(f,_l(a,u));var p=h,d=pl(f,p),g=pl(p,p),_=d*d-g*(pl(f,f)-1);if(!(_<0)){var m=rl(_),v=_l(p,(-d-m)/g);if(gl(v,f),v=hl(v),!i)return v;var y,x=t[0],b=n[0],w=t[1],S=n[1];b<x&&(y=x,x=b,b=y);var M=b-x,E=Zs(M-Vs)<Hs;if(!E&&S<w&&(y=w,w=S,S=y),E||M<Hs?E?w+S>0^v[1]<(Zs(v[0]-x)<Hs?w:S):w<=v[1]&&v[1]<=S:M>Vs^(x<=v[0]&&v[0]<=b)){var C=_l(p,(-d+m)/g);return gl(C,f),[v,hl(C)]}}}function s(e,n){var r=i?t:Vs-t,a=0;return e<-r?a|=1:e>r&&(a|=2),n<-r?a|=4:n>r&&(a|=8),a}return xl(a,(function(t){var e,n,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(h,f){var p,d=[h,f],g=a(h,f),_=i?g?0:s(h,f):g?s(h+(h<0?Vs:-Vs),f):0;if(!e&&(c=l=g)&&t.lineStart(),g!==l&&(!(p=o(e,d))||ol(e,p)||ol(d,p))&&(d[2]=1),g!==l)u=0,g?(t.lineStart(),p=o(d,e),t.point(p[0],p[1])):(p=o(e,d),t.point(p[0],p[1],2),t.lineEnd()),e=p;else if(r&&e&&i^g){var m;_&n||!(m=o(d,e,!0))||(u=0,i?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1],3)))}!g||e&&ol(e,d)||t.point(d[0],d[1]),e=d,l=g,n=_},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return u|(c&&l)<<1}}}),(function(e,i,r,a){Ml(a,t,n,r,e,i)}),i?[0,-t]:[-Vs,t-Vs])}(w=t*Ks):(w=null,Sl),P()):w*Xs},A.clipExtent=function(t){return arguments.length?(E=null==t?(M=i=r=a=null,Pl):kl(M=+t[0][0],i=+t[0][1],r=+t[1][0],a=+t[1][1]),P()):null==M?null:[[M,i],[r,a]]},A.scale=function(t){return arguments.length?(h=+t,T()):h},A.translate=function(t){return arguments.length?(f=+t[0],p=+t[1],T()):[f,p]},A.center=function(t){return arguments.length?(d=t[0]%360*Ks,g=t[1]%360*Ks,T()):[d*Xs,g*Xs]},A.rotate=function(t){return arguments.length?(_=t[0]%360*Ks,m=t[1]%360*Ks,v=t.length>2?t[2]%360*Ks:0,T()):[_*Xs,m*Xs,v*Xs]},A.angle=function(t){return arguments.length?(y=t%360*Ks,T()):y*Xs},A.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},A.reflectY=function(t){return arguments.length?(b=t?-1:1,T()):b<0},A.precision=function(t){return arguments.length?(o=Zl(s,C=t*t),P()):rl(C)},A.fitExtent=function(t,e){return Xl(A,t,e)},A.fitSize=function(t,e){return function(t,e,n){return Xl(t,[[0,0],e],n)}(A,t,e)},A.fitWidth=function(t,e){return function(t,e,n){return Yl(t,(function(n){var i=+e,r=i/(n[1][0]-n[0][0]),a=(i-r*(n[1][0]+n[0][0]))/2,o=-r*n[0][1];t.scale(150*r).translate([a,o])}),n)}(A,t,e)},A.fitHeight=function(t,e){return function(t,e,n){return Yl(t,(function(n){var i=+e,r=i/(n[1][1]-n[0][1]),a=-r*n[0][0],o=(i-r*(n[1][1]+n[0][1]))/2;t.scale(150*r).translate([a,o])}),n)}(A,t,e)},function(){return e=t.apply(this,arguments),A.invert=e.invert&&k,T()}}((function(){return t}))()}var nc=Math.abs,ic=(Math.atan,Math.atan2,Math.ceil,Math.cos,Math.exp,Math.floor),rc=(Math.log,Math.max),ac=Math.min,oc=(Math.pow,Math.round,Math.sign,Math.sin,Math.tan,Math.PI),sc=oc/2,lc=(Math.SQRT1_2,uc(2),uc(oc),180/oc),cc=oc/180;function uc(t){return t>0?Math.sqrt(t):0}var hc=[[.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]];function fc(t,e){var n,i=ac(18,36*nc(e)/oc),r=ic(i),a=i-r,o=(n=hc[r])[0],s=n[1],l=(n=hc[++r])[0],c=n[1],u=(n=hc[ac(19,++r)])[0],h=n[1];return[t*(l+a*(u-o)/2+a*a*(u-2*l+o)/2),(e>0?sc:-sc)*(c+a*(h-s)/2+a*a*(h-2*c+s)/2)]}hc.forEach((function(t){t[1]*=1.0144})),fc.invert=function(t,e){var n=e/sc,i=90*n,r=ac(18,nc(i/5)),a=rc(0,ic(r));do{var o=hc[a][1],s=hc[a+1][1],l=hc[ac(19,a+2)][1],c=l-o,u=l-2*s+o,h=2*(nc(n)-s)/c,f=u/c,p=h*(1-f*h*(1-2*f*h));if(p>=0||1===a){i=(e>=0?5:-5)*(p+r);var d,g=50;do{p=(r=ac(18,nc(i)/5))-(a=ic(r)),o=hc[a][1],s=hc[a+1][1],l=hc[ac(19,a+2)][1],i-=(d=(e>=0?sc:-sc)*(s+p*(l-o)/2+p*p*(l-2*s+o)/2)-e)*lc}while(nc(d)>1e-12&&--g>0);break}}while(--a>=0);var _=hc[a][0],m=hc[a+1][0],v=hc[ac(19,a+2)][0];return[t/(m+p*(v-_)/2+p*p*(v-2*m+_)/2),i*cc]};var pc="http://www.w3.org/1999/xhtml";const dc={svg:"http://www.w3.org/2000/svg",xhtml:pc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function gc(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),dc.hasOwnProperty(e)?{space:dc[e],local:t}:t}function _c(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===pc&&e.documentElement.namespaceURI===pc?e.createElement(t):e.createElementNS(n,t)}}function mc(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function vc(t){var e=gc(t);return(e.local?mc:_c)(e)}function yc(){}function xc(t){return null==t?yc:function(){return this.querySelector(t)}}function bc(){return[]}function wc(t){return new Array(t.length)}function Sc(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Sc.prototype={constructor:Sc,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Mc(t,e,n,i,r,a){for(var o,s=0,l=e.length,c=a.length;s<c;++s)(o=e[s])?(o.__data__=a[s],i[s]=o):n[s]=new Sc(t,a[s]);for(;s<l;++s)(o=e[s])&&(r[s]=o)}function Ec(t,e,n,i,r,a,o){var s,l,c,u={},h=e.length,f=a.length,p=new Array(h);for(s=0;s<h;++s)(l=e[s])&&(p[s]=c="$"+o.call(l,l.__data__,s,e),c in u?r[s]=l:u[c]=l);for(s=0;s<f;++s)(l=u[c="$"+o.call(t,a[s],s,a)])?(i[s]=l,l.__data__=a[s],u[c]=null):n[s]=new Sc(t,a[s]);for(s=0;s<h;++s)(l=e[s])&&u[p[s]]===l&&(r[s]=l)}function Cc(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Ac(t){return function(){this.removeAttribute(t)}}function kc(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Tc(t,e){return function(){this.setAttribute(t,e)}}function Pc(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Nc(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Lc(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Fc(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Oc(t){return function(){this.style.removeProperty(t)}}function Gc(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Dc(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function zc(t){return function(){delete this[t]}}function Ic(t,e){return function(){this[t]=e}}function Rc(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function jc(t){return t.trim().split(/^|\s+/)}function Bc(t){return t.classList||new qc(t)}function qc(t){this._node=t,this._names=jc(t.getAttribute("class")||"")}function Uc(t,e){for(var n=Bc(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function Wc(t,e){for(var n=Bc(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function Hc(t){return function(){Uc(this,t)}}function Vc(t){return function(){Wc(this,t)}}function $c(t,e){return function(){(e.apply(this,arguments)?Uc:Wc)(this,t)}}function Jc(){this.textContent=""}function Yc(t){return function(){this.textContent=t}}function Xc(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function Kc(){this.innerHTML=""}function Zc(t){return function(){this.innerHTML=t}}function Qc(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function tu(){this.nextSibling&&this.parentNode.appendChild(this)}function eu(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function nu(){return null}function iu(){var t=this.parentNode;t&&t.removeChild(this)}function ru(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function au(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}qc.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ou={},su=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(ou={mouseenter:"mouseover",mouseleave:"mouseout"}));function lu(t,e,n){return t=cu(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function cu(t,e,n){return function(i){var r=su;su=i;try{t.call(this,this.__data__,e,n)}finally{su=r}}}function uu(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,a=e.length;i<a;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.capture);++r?e.length=r:delete this.__on}}}function hu(t,e,n){var i=ou.hasOwnProperty(t.type)?lu:cu;return function(r,a,o){var s,l=this.__on,c=i(e,a,o);if(l)for(var u=0,h=l.length;u<h;++u)if((s=l[u]).type===t.type&&s.name===t.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=c,s.capture=n),void(s.value=e);this.addEventListener(t.type,c,n),s={type:t.type,name:t.name,value:e,listener:c,capture:n},l?l.push(s):this.__on=[s]}}function fu(t,e,n,i){var r=su;t.sourceEvent=su,su=t;try{return e.apply(n,i)}finally{su=r}}function pu(t,e,n){var i=Fc(t),r=i.CustomEvent;"function"==typeof r?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function du(t,e){return function(){return pu(this,t,e)}}function gu(t,e){return function(){return pu(this,t,e.apply(this,arguments))}}var _u=[null];function mu(t,e){this._groups=t,this._parents=e}function vu(){return new mu([[document.documentElement]],_u)}mu.prototype=vu.prototype={constructor:mu,select:function(t){"function"!=typeof t&&(t=xc(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a,o,s=e[r],l=s.length,c=i[r]=new Array(l),u=0;u<l;++u)(a=s[u])&&(o=t.call(a,a.__data__,u,s))&&("__data__"in a&&(o.__data__=a.__data__),c[u]=o);return new mu(i,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=function(t){return null==t?bc:function(){return this.querySelectorAll(t)}}(t));for(var e=this._groups,n=e.length,i=[],r=[],a=0;a<n;++a)for(var o,s=e[a],l=s.length,c=0;c<l;++c)(o=s[c])&&(i.push(t.call(o,o.__data__,c,s)),r.push(o));return new mu(i,r)},filter:function(t){"function"!=typeof t&&(t=function(t){return function(){return this.matches(t)}}(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a,o=e[r],s=o.length,l=i[r]=[],c=0;c<s;++c)(a=o[c])&&t.call(a,a.__data__,c,o)&&l.push(a);return new mu(i,this._parents)},data:function(t,e){if(!t)return p=new Array(this.size()),c=-1,this.each((function(t){p[++c]=t})),p;var n=e?Ec:Mc,i=this._parents,r=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var a=r.length,o=new Array(a),s=new Array(a),l=new Array(a),c=0;c<a;++c){var u=i[c],h=r[c],f=h.length,p=t.call(u,u&&u.__data__,c,i),d=p.length,g=s[c]=new Array(d),_=o[c]=new Array(d);n(u,h,g,_,l[c]=new Array(f),p,e);for(var m,v,y=0,x=0;y<d;++y)if(m=g[y]){for(y>=x&&(x=y+1);!(v=_[x])&&++x<d;);m._next=v||null}}return(o=new mu(o,i))._enter=s,o._exit=l,o},enter:function(){return new mu(this._enter||this._groups.map(wc),this._parents)},exit:function(){return new mu(this._exit||this._groups.map(wc),this._parents)},join:function(t,e,n){var i=this.enter(),r=this,a=this.exit();return i="function"==typeof t?t(i):i.append(t+""),null!=e&&(r=e(r)),null==n?a.remove():n(a),i&&r?i.merge(r).order():r},merge:function(t){for(var e=this._groups,n=t._groups,i=e.length,r=n.length,a=Math.min(i,r),o=new Array(i),s=0;s<a;++s)for(var l,c=e[s],u=n[s],h=c.length,f=o[s]=new Array(h),p=0;p<h;++p)(l=c[p]||u[p])&&(f[p]=l);for(;s<i;++s)o[s]=e[s];return new mu(o,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,r=t[e],a=r.length-1,o=r[a];--a>=0;)(i=r[a])&&(o&&4^i.compareDocumentPosition(o)&&o.parentNode.insertBefore(i,o),o=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=Cc);for(var n=this._groups,i=n.length,r=new Array(i),a=0;a<i;++a){for(var o,s=n[a],l=s.length,c=r[a]=new Array(l),u=0;u<l;++u)(o=s[u])&&(c[u]=o);c.sort(e)}return new mu(r,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),e=-1;return this.each((function(){t[++e]=this})),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,a=i.length;r<a;++r){var o=i[r];if(o)return o}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r,a=e[n],o=0,s=a.length;o<s;++o)(r=a[o])&&t.call(r,r.__data__,o,a);return this},attr:function(t,e){var n=gc(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?kc:Ac:"function"==typeof e?n.local?Lc:Nc:n.local?Pc:Tc)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?Oc:"function"==typeof e?Dc:Gc)(t,e,null==n?"":n)):function(t,e){return t.style.getPropertyValue(e)||Fc(t).getComputedStyle(t,null).getPropertyValue(e)}(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?zc:"function"==typeof e?Rc:Ic)(t,e)):this.node()[t]},classed:function(t,e){var n=jc(t+"");if(arguments.length<2){for(var i=Bc(this.node()),r=-1,a=n.length;++r<a;)if(!i.contains(n[r]))return!1;return!0}return this.each(("function"==typeof e?$c:e?Hc:Vc)(n,e))},text:function(t){return arguments.length?this.each(null==t?Jc:("function"==typeof t?Xc:Yc)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Kc:("function"==typeof t?Qc:Zc)(t)):this.node().innerHTML},raise:function(){return this.each(tu)},lower:function(){return this.each(eu)},append:function(t){var e="function"==typeof t?t:vc(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:vc(t),i=null==e?nu:"function"==typeof e?e:xc(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)}))},remove:function(){return this.each(iu)},clone:function(t){return this.select(t?au:ru)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,r,a=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),o=a.length;if(!(arguments.length<2)){for(s=e?hu:uu,null==n&&(n=!1),i=0;i<o;++i)this.each(s(a[i],e,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(i=0,l=s[c];i<o;++i)if((r=a[i]).type===l.type&&r.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?gu:du)(t,e))}};function yu(t){return"string"==typeof t?new mu([[document.querySelector(t)]],[document.documentElement]):new mu([[t]],_u)}var xu=0;function bu(){this._="@"+(++xu).toString(36)}function wu(){for(var t,e=su;t=e.sourceEvent;)e=t;return e}function Su(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,[(i=i.matrixTransform(t.getScreenCTM().inverse())).x,i.y]}var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}function Mu(t){var e=wu();return e.changedTouches&&(e=e.changedTouches[0]),Su(t,e)}function Eu(t,e,n){arguments.length<3&&(n=e,e=wu().changedTouches);for(var i,r=0,a=e?e.length:0;r<a;++r)if((i=e[r]).identifier===n)return Su(t,i);return null}bu.prototype=function(){return new bu}.prototype={constructor:bu,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var Cu={value:function(){}};function Au(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i)throw new Error("illegal type: "+t);i[t]=[]}return new ku(i)}function ku(t){this._=t}function Tu(t,e){for(var n,i=0,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function Pu(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=Cu,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}ku.prototype=Au.prototype={constructor:ku,on:function(t,e){var n,i,r=this._,a=(i=r,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!i.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=a[o]).type)r[n]=Pu(r[n],t.name,e);else if(null==e)for(n in r)r[n]=Pu(r[n],t.name,null);return this}for(;++o<s;)if((n=(t=a[o]).type)&&(n=Tu(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ku(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),a=0;a<n;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(i=this._[t]).length;a<n;++a)i[a].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,a=i.length;r<a;++r)i[r].value.apply(e,n)}};const Nu=Au;function Lu(){su.stopImmediatePropagation()}function Fu(){su.preventDefault(),su.stopImmediatePropagation()}function Ou(t){return function(){return t}}function Gu(t,e,n,i,r,a,o,s,l,c){this.target=t,this.type=e,this.subject=n,this.identifier=i,this.active=r,this.x=a,this.y=o,this.dx=s,this.dy=l,this._=c}function Du(){return!su.button}function zu(){return this.parentNode}function Iu(t){return null==t?{x:su.x,y:su.y}:t}function Ru(){return"ontouchstart"in this}function ju(){var t,e,n,i,r=Du,a=zu,o=Iu,s=Ru,l={},c=Nu("start","drag","end"),u=0,h=0;function f(t){t.on("mousedown.drag",p).filter(s).on("touchstart.drag",_).on("touchmove.drag",m).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(){if(!i&&r.apply(this,arguments)){var o=y("mouse",a.apply(this,arguments),Mu,this,arguments);o&&(yu(su.view).on("mousemove.drag",d,!0).on("mouseup.drag",g,!0),function(t){var e=t.document.documentElement,n=yu(t).on("dragstart.drag",Fu,!0);"onselectstart"in e?n.on("selectstart.drag",Fu,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(su.view),Lu(),n=!1,t=su.clientX,e=su.clientY,o("start"))}}function d(){if(Fu(),!n){var i=su.clientX-t,r=su.clientY-e;n=i*i+r*r>h}l.mouse("drag")}function g(){yu(su.view).on("mousemove.drag mouseup.drag",null),function(t,e){var n=t.document.documentElement,i=yu(t).on("dragstart.drag",null);e&&(i.on("click.drag",Fu,!0),setTimeout((function(){i.on("click.drag",null)}),0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(su.view,n),Fu(),l.mouse("end")}function _(){if(r.apply(this,arguments)){var t,e,n=su.changedTouches,i=a.apply(this,arguments),o=n.length;for(t=0;t<o;++t)(e=y(n[t].identifier,i,Eu,this,arguments))&&(Lu(),e("start"))}}function m(){var t,e,n=su.changedTouches,i=n.length;for(t=0;t<i;++t)(e=l[n[t].identifier])&&(Fu(),e("drag"))}function v(){var t,e,n=su.changedTouches,r=n.length;for(i&&clearTimeout(i),i=setTimeout((function(){i=null}),500),t=0;t<r;++t)(e=l[n[t].identifier])&&(Lu(),e("end"))}function y(t,e,n,i,r){var a,s,h,p=n(e,t),d=c.copy();if(fu(new Gu(f,"beforestart",a,t,u,p[0],p[1],0,0,d),(function(){return null!=(su.subject=a=o.apply(i,r))&&(s=a.x-p[0]||0,h=a.y-p[1]||0,!0)})))return function o(c){var g,_=p;switch(c){case"start":l[t]=o,g=u++;break;case"end":delete l[t],--u;case"drag":p=n(e,t),g=u}fu(new Gu(f,c,a,t,g,p[0]+s,p[1]+h,p[0]-_[0],p[1]-_[1],d),d.apply,d,[c,i,r])}}return f.filter=function(t){return arguments.length?(r="function"==typeof t?t:Ou(!!t),f):r},f.container=function(t){return arguments.length?(a="function"==typeof t?t:Ou(t),f):a},f.subject=function(t){return arguments.length?(o="function"==typeof t?t:Ou(t),f):o},f.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Ou(!!t),f):s},f.on=function(){var t=c.on.apply(c,arguments);return t===c?f:t},f.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,f):Math.sqrt(h)},f}Gu.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var Bu=Math.PI,qu=2*Bu,Uu=1e-6,Wu=qu-Uu;function Hu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Vu(){return new Hu}Hu.prototype=Vu.prototype={constructor:Hu,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,a){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+a)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var a=this._x1,o=this._y1,s=n-t,l=i-e,c=a-t,u=o-e,h=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>Uu)if(Math.abs(u*s-l*c)>Uu&&r){var f=n-a,p=i-o,d=s*s+l*l,g=f*f+p*p,_=Math.sqrt(d),m=Math.sqrt(h),v=r*Math.tan((Bu-Math.acos((d+h-g)/(2*_*m)))/2),y=v/m,x=v/_;Math.abs(y-1)>Uu&&(this._+="L"+(t+y*c)+","+(e+y*u)),this._+="A"+r+","+r+",0,0,"+ +(u*f>c*p)+","+(this._x1=t+x*s)+","+(this._y1=e+x*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,i,r,a){t=+t,e=+e,a=!!a;var o=(n=+n)*Math.cos(i),s=n*Math.sin(i),l=t+o,c=e+s,u=1^a,h=a?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>Uu||Math.abs(this._y1-c)>Uu)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%qu+qu),h>Wu?this._+="A"+n+","+n+",0,1,"+u+","+(t-o)+","+(e-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>Uu&&(this._+="A"+n+","+n+",0,"+ +(h>=Bu)+","+u+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};const $u=Vu;function Ju(t){return function(){return t}}var Yu=1e-12,Xu=Math.PI,Ku=Xu/2,Zu=2*Xu;function Qu(t){return t.innerRadius}function th(t){return t.outerRadius}function eh(t){return t.startAngle}function nh(t){return t.endAngle}function ih(t){return t&&t.padAngle}function rh(t){return t>=1?Ku:t<=-1?-Ku:Math.asin(t)}function ah(t,e,n,i,r,a,o){var s=t-n,l=e-i,c=(o?a:-a)/Math.sqrt(s*s+l*l),u=c*l,h=-c*s,f=t+u,p=e+h,d=n+u,g=i+h,_=(f+d)/2,m=(p+g)/2,v=d-f,y=g-p,x=v*v+y*y,b=r-a,w=f*g-d*p,S=(y<0?-1:1)*Math.sqrt(Math.max(0,b*b*x-w*w)),M=(w*y-v*S)/x,E=(-w*v-y*S)/x,C=(w*y+v*S)/x,A=(-w*v+y*S)/x,k=M-_,T=E-m,P=C-_,N=A-m;return k*k+T*T>P*P+N*N&&(M=C,E=A),{cx:M,cy:E,x01:-u,y01:-h,x11:M*(r/b-1),y11:E*(r/b-1)}}function oh(t){this._context=t}function sh(t){return new oh(t)}function lh(t){return t[0]}function ch(t){return t[1]}oh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};!function(t){function e(e){return new uh(t(e))}e._curve=t}(sh);function uh(t){this._curve=t}uh.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};Math.sqrt(1/3);var hh=Math.sin(Xu/10)/Math.sin(7*Xu/10);Math.sin(Zu/10),Math.cos(Zu/10);Math.sqrt(3);Math.sqrt(3),Math.sqrt(12);function fh(){}function ph(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function dh(t){this._context=t}function gh(t){this._context=t}function _h(t){this._context=t}function mh(t,e){this._basis=new dh(t),this._beta=e}dh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ph(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ph(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},gh.prototype={areaStart:fh,areaEnd:fh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:ph(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},_h.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:ph(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},mh.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i,r=t[0],a=e[0],o=t[n]-r,s=e[n]-a,l=-1;++l<=n;)i=l/n,this._basis.point(this._beta*t[l]+(1-this._beta)*(r+i*o),this._beta*e[l]+(1-this._beta)*(a+i*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};(function t(e){function n(t){return 1===e?new dh(t):new mh(t,e)}return n.beta=function(e){return t(+e)},n})(.85);function vh(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function yh(t,e){this._context=t,this._k=(1-e)/6}yh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:vh(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:vh(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new yh(t,e)}return n.tension=function(e){return t(+e)},n})(0);function xh(t,e){this._context=t,this._k=(1-e)/6}xh.prototype={areaStart:fh,areaEnd:fh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:vh(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new xh(t,e)}return n.tension=function(e){return t(+e)},n})(0);function bh(t,e){this._context=t,this._k=(1-e)/6}bh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:vh(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new bh(t,e)}return n.tension=function(e){return t(+e)},n})(0);function wh(t,e,n){var i=t._x1,r=t._y1,a=t._x2,o=t._y2;if(t._l01_a>Yu){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,r=(r*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Yu){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,a,o,t._x2,t._y2)}function Sh(t,e){this._context=t,this._alpha=e}Sh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:wh(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Mh=function t(e){function n(t){return e?new Sh(t,e):new yh(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Eh(t,e){this._context=t,this._alpha=e}Eh.prototype={areaStart:fh,areaEnd:fh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:wh(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return e?new Eh(t,e):new xh(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function Ch(t,e){this._context=t,this._alpha=e}Ch.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:wh(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return e?new Ch(t,e):new bh(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function Ah(t){this._context=t}function kh(t){return t<0?-1:1}function Th(t,e,n){var i=t._x1-t._x0,r=e-t._x1,a=(t._y1-t._y0)/(i||r<0&&-0),o=(n-t._y1)/(r||i<0&&-0),s=(a*r+o*i)/(i+r);return(kh(a)+kh(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Ph(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Nh(t,e,n){var i=t._x0,r=t._y0,a=t._x1,o=t._y1,s=(a-i)/3;t._context.bezierCurveTo(i+s,r+s*e,a-s,o-s*n,a,o)}function Lh(t){this._context=t}function Fh(t){this._context=new Oh(t)}function Oh(t){this._context=t}function Gh(t){this._context=t}function Dh(t){var e,n,i=t.length-1,r=new Array(i),a=new Array(i),o=new Array(i);for(r[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e<i-1;++e)r[e]=1,a[e]=4,o[e]=4*t[e]+2*t[e+1];for(r[i-1]=2,a[i-1]=7,o[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=r[e]/a[e-1],a[e]-=n,o[e]-=n*o[e-1];for(r[i-1]=o[i-1]/a[i-1],e=i-2;e>=0;--e)r[e]=(o[e]-r[e+1])/a[e];for(a[i-1]=(t[i]+r[i-1])/2,e=0;e<i-1;++e)a[e]=2*t[e+1]-r[e+1];return[r,a]}function zh(t,e){this._context=t,this._t=e}Ah.prototype={areaStart:fh,areaEnd:fh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},Lh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Nh(this,this._t0,Ph(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Nh(this,Ph(this,n=Th(this,t,e)),n);break;default:Nh(this,this._t0,n=Th(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(Fh.prototype=Object.create(Lh.prototype)).point=function(t,e){Lh.prototype.point.call(this,e,t)},Oh.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,a){this._context.bezierCurveTo(e,t,i,n,a,r)}},Gh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var i=Dh(t),r=Dh(e),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(i[0][a],r[0][a],i[1][a],r[1][a],t[o],e[o]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},zh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};Array.prototype.slice;var Ih="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rh=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},jh=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),Bh=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},qh=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var a=Object.getPrototypeOf(e);return null===a?void 0:t(a,n,i)}if("value"in r)return r.value;var o=r.get;return void 0!==o?o.call(i):void 0},Uh=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},Wh=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},Hh=function(){function t(e){var n=e.x,i=void 0===n?0:n,r=e.y,a=void 0===r?0:r,o=e.nx,s=e.ny,l=e.dy,c=void 0===l?0:l,u=e.dx,h=void 0===u?0:u,f=e.color,p=void 0===f?"grey":f,d=e.data,g=e.type,_=e.subject,m=e.connector,v=e.note,y=e.disable,x=e.id,b=e.className;Rh(this,t),this._dx=void 0!==o?o-i:h,this._dy=void 0!==s?s-a:c,this._x=i,this._y=a,this._color=p,this.id=x,this._className=b||"",this._type=g||"",this.data=d,this.note=v||{},this.connector=m||{},this.subject=_||{},this.disable=y||[]}return jh(t,[{key:"updatePosition",value:function(){this.type.setPosition&&(this.type.setPosition(),this.type.subject&&0!==this.type.subject.selectAll(":not(.handle)").nodes().length&&this.type.redrawSubject())}},{key:"clearComponents",value:function(){this.type.clearComponents&&this.type.clearComponents()}},{key:"updateOffset",value:function(){this.type.setOffset&&(this.type.setOffset(),0!==this.type.connector.selectAll(":not(.handle)").nodes().length&&this.type.redrawConnector(),this.type.redrawNote())}},{key:"className",get:function(){return this._className},set:function(t){this._className=t,this.type.setClassName&&this.type.setClassName()}},{key:"type",get:function(){return this._type},set:function(t){this._type=t,this.clearComponents()}},{key:"x",get:function(){return this._x},set:function(t){this._x=t,this.updatePosition()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this.updatePosition()}},{key:"color",get:function(){return this._color},set:function(t){this._color=t,this.updatePosition()}},{key:"dx",get:function(){return this._dx},set:function(t){this._dx=t,this.updateOffset()}},{key:"dy",get:function(){return this._dy},set:function(t){this._dy=t,this.updateOffset()}},{key:"nx",set:function(t){this._dx=t-this._x,this.updateOffset()}},{key:"ny",set:function(t){this._dy=t-this._y,this.updateOffset()}},{key:"offset",get:function(){return{x:this._dx,y:this._dy}},set:function(t){var e=t.x,n=t.y;this._dx=e,this._dy=n,this.updateOffset()}},{key:"position",get:function(){return{x:this._x,y:this._y}},set:function(t){var e=t.x,n=t.y;this._x=e,this._y=n,this.updatePosition()}},{key:"translation",get:function(){return{x:this._x+this._dx,y:this._y+this._dy}}},{key:"json",get:function(){var t={x:this._x,y:this._y,dx:this._dx,dy:this._dy};return this.data&&Object.keys(this.data).length>0&&(t.data=this.data),this.type&&(t.type=this.type),this._className&&(t.className=this._className),Object.keys(this.connector).length>0&&(t.connector=this.connector),Object.keys(this.subject).length>0&&(t.subject=this.subject),Object.keys(this.note).length>0&&(t.note=this.note),t}}]),t}(),Vh=function(){function t(e){var n=e.annotations,i=e.accessors,r=e.accessorsInverse;Rh(this,t),this.accessors=i,this.accessorsInverse=r,this.annotations=n}return jh(t,[{key:"clearTypes",value:function(t){this.annotations.forEach((function(e){e.type=void 0,e.subject=t&&t.subject||e.subject,e.connector=t&&t.connector||e.connector,e.note=t&&t.note||e.note}))}},{key:"setPositionWithAccessors",value:function(){var t=this;this.annotations.forEach((function(e){e.type.setPositionWithAccessors(t.accessors)}))}},{key:"editMode",value:function(t){this.annotations.forEach((function(e){e.type&&(e.type.editMode=t,e.type.updateEditMode())}))}},{key:"updateDisable",value:function(t){this.annotations.forEach((function(e){e.disable=t,e.type&&t.forEach((function(t){e.type[t]&&(e.type[t].remove&&e.type[t].remove(),e.type[t]=void 0)}))}))}},{key:"updateTextWrap",value:function(t){this.annotations.forEach((function(e){e.type&&e.type.updateTextWrap&&e.type.updateTextWrap(t)}))}},{key:"updateText",value:function(){this.annotations.forEach((function(t){t.type&&t.type.drawText&&t.type.drawText()}))}},{key:"updateNotePadding",value:function(t){this.annotations.forEach((function(e){e.type&&(e.type.notePadding=t)}))}},{key:"json",get:function(){var t=this;return this.annotations.map((function(e){var n=e.json;return t.accessorsInverse&&e.data&&(n.data={},Object.keys(t.accessorsInverse).forEach((function(i){n.data[i]=t.accessorsInverse[i]({x:e.x,y:e.y})}))),n}))}},{key:"noteNodes",get:function(){return this.annotations.map((function(t){return Bh({},t.type.getNoteBBoxOffset(),{positionX:t.x,positionY:t.y})}))}}]),t}(),$h=function(t,e){return"dynamic"!==t&&"left"!==t&&"right"!==t||(t=e<0?"top":"bottom"),t},Jh=function(t,e){return"dynamic"!==t&&"top"!==t&&"bottom"!==t||(t=e<0?"right":"left"),t},Yh=["topBottom","top","bottom"],Xh=["leftRight","left","right"],Kh=function(t){var e=t.data,n=t.curve,i=void 0===n?sh:n,r=t.canvasContext,a=t.className,o=t.classID,s=function(){var t=lh,e=ch,n=Ju(!0),i=null,r=sh,a=null;function o(o){var s,l,c,u=o.length,h=!1;for(null==i&&(a=r(c=$u())),s=0;s<=u;++s)!(s<u&&n(l=o[s],s,o))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+t(l,s,o),+e(l,s,o));if(c)return a=null,c+""||null}return o.x=function(e){return arguments.length?(t="function"==typeof e?e:Ju(+e),o):t},o.y=function(t){return arguments.length?(e="function"==typeof t?t:Ju(+t),o):e},o.defined=function(t){return arguments.length?(n="function"==typeof t?t:Ju(!!t),o):n},o.curve=function(t){return arguments.length?(r=t,null!=i&&(a=r(i)),o):r},o.context=function(t){return arguments.length?(null==t?i=a=null:a=r(i=t),o):i},o}().curve(i),l={type:"path",className:a,classID:o,data:e};return r?(s.context(r),l.pathMethods=s):l.attrs={d:s(e)},l},Zh=function(t){var e=t.data,n=t.canvasContext,i={type:"path",className:t.className,classID:t.classID,data:e},r=function(){var t=Qu,e=th,n=Ju(0),i=null,r=eh,a=nh,o=ih,s=null;function l(){var l,c,u=+t.apply(this,arguments),h=+e.apply(this,arguments),f=r.apply(this,arguments)-Ku,p=a.apply(this,arguments)-Ku,d=Math.abs(p-f),g=p>f;if(s||(s=l=$u()),h<u&&(c=h,h=u,u=c),h>Yu)if(d>Zu-Yu)s.moveTo(h*Math.cos(f),h*Math.sin(f)),s.arc(0,0,h,f,p,!g),u>Yu&&(s.moveTo(u*Math.cos(p),u*Math.sin(p)),s.arc(0,0,u,p,f,g));else{var _,m,v=f,y=p,x=f,b=p,w=d,S=d,M=o.apply(this,arguments)/2,E=M>Yu&&(i?+i.apply(this,arguments):Math.sqrt(u*u+h*h)),C=Math.min(Math.abs(h-u)/2,+n.apply(this,arguments)),A=C,k=C;if(E>Yu){var T=rh(E/u*Math.sin(M)),P=rh(E/h*Math.sin(M));(w-=2*T)>Yu?(x+=T*=g?1:-1,b-=T):(w=0,x=b=(f+p)/2),(S-=2*P)>Yu?(v+=P*=g?1:-1,y-=P):(S=0,v=y=(f+p)/2)}var N=h*Math.cos(v),L=h*Math.sin(v),F=u*Math.cos(b),O=u*Math.sin(b);if(C>Yu){var G=h*Math.cos(y),D=h*Math.sin(y),z=u*Math.cos(x),I=u*Math.sin(x);if(d<Xu){var R=w>Yu?function(t,e,n,i,r,a,o,s){var l=n-t,c=i-e,u=o-r,h=s-a,f=(u*(e-a)-h*(t-r))/(h*l-u*c);return[t+f*l,e+f*c]}(N,L,z,I,G,D,F,O):[F,O],j=N-R[0],B=L-R[1],q=G-R[0],U=D-R[1],W=1/Math.sin(Math.acos((j*q+B*U)/(Math.sqrt(j*j+B*B)*Math.sqrt(q*q+U*U)))/2),H=Math.sqrt(R[0]*R[0]+R[1]*R[1]);A=Math.min(C,(u-H)/(W-1)),k=Math.min(C,(h-H)/(W+1))}}S>Yu?k>Yu?(_=ah(z,I,N,L,h,k,g),m=ah(G,D,F,O,h,k,g),s.moveTo(_.cx+_.x01,_.cy+_.y01),k<C?s.arc(_.cx,_.cy,k,Math.atan2(_.y01,_.x01),Math.atan2(m.y01,m.x01),!g):(s.arc(_.cx,_.cy,k,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!g),s.arc(0,0,h,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(m.cy+m.y11,m.cx+m.x11),!g),s.arc(m.cx,m.cy,k,Math.atan2(m.y11,m.x11),Math.atan2(m.y01,m.x01),!g))):(s.moveTo(N,L),s.arc(0,0,h,v,y,!g)):s.moveTo(N,L),u>Yu&&w>Yu?A>Yu?(_=ah(F,O,G,D,u,-A,g),m=ah(N,L,z,I,u,-A,g),s.lineTo(_.cx+_.x01,_.cy+_.y01),A<C?s.arc(_.cx,_.cy,A,Math.atan2(_.y01,_.x01),Math.atan2(m.y01,m.x01),!g):(s.arc(_.cx,_.cy,A,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!g),s.arc(0,0,u,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(m.cy+m.y11,m.cx+m.x11),g),s.arc(m.cx,m.cy,A,Math.atan2(m.y11,m.x11),Math.atan2(m.y01,m.x01),!g))):s.arc(0,0,u,b,x,g):s.lineTo(F,O)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +a.apply(this,arguments))/2-Xu/2;return[Math.cos(i)*n,Math.sin(i)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Ju(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Ju(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Ju(+t),l):n},l.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Ju(+t),l):i},l.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Ju(+t),l):r},l.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:Ju(+t),l):a},l.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:Ju(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}().innerRadius(e.innerRadius||0).outerRadius(e.outerRadius||e.radius||2).startAngle(e.startAngle||0).endAngle(e.endAngle||2*Math.PI);return n?(r.context(n),i.pathMethods=lineGen):i.attrs={d:r()},i},Qh=function(t){var e=t.type,n=t.subjectType,i=e.annotation,r=i.position,a=i.x-r.x,o=a+i.dx,s=i.y-r.y,l=s+i.dy,c=i.subject;if("circle"===n&&(c.outerRadius||c.radius)){var u=Math.sqrt((a-o)*(a-o)+(s-l)*(s-l)),h=Math.asin(-l/u),f=c.outerRadius||c.radius+(c.radiusPadding||0);a=Math.abs(Math.cos(h)*f)*(o<0?-1:1),s=Math.abs(Math.sin(h)*f)*(l<0?-1:1)}if("rect"===n){var p=c.width,d=c.height;(p>0&&i.dx>0||p<0&&i.dx<0)&&(a=Math.abs(p)>Math.abs(i.dx)?p/2:p),(d>0&&i.dy>0||d<0&&i.dy<0)&&(s=Math.abs(d)>Math.abs(i.dy)?d/2:d),a===p/2&&s===d/2&&(a=o,s=l)}return[[a,s],[o,l]]},tf=function(t){var e=t.type,n=t.connectorData,i=t.subjectType;n||(n={}),n.points&&"number"!=typeof n.points||(n.points=ef(e.annotation.offset,n.points)),n.curve||(n.curve=Mh);var r=[];if(e.editMode){var a=n.points.map((function(t,e){return Bh({},function(t){var e=t.cx,n=void 0===e?0:e,i=t.cy;return{move:{x:n,y:void 0===i?0:i}}}({cx:t[0],cy:t[1]}),{index:e})})),o=function(t){n.points[t][0]+=su.dx,n.points[t][1]+=su.dy,e.redrawConnector()};r=e.mapHandles(a.map((function(t){return Bh({},t.move,{drag:o.bind(e,t.index)})})))}var s=Qh({type:e,subjectType:i});return s=[s[0]].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}(n.points),[s[1]]),{components:[Kh({data:s,curve:n.curve,className:"connector"})],handles:r}},ef=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=t.x/(e+1),i=t.y/(e+1),r=[],a=1;a<=e;a++)r.push([n*a+a%2*20,i*a-a%2*20]);return r},nf=function(t){var e=t.subjectData,n=t.type;e.radius||e.outerRadius||(e.radius=20);var i=[],r=Zh({data:e,className:"subject"});if(n.editMode){var a=function(t){var e=t.cx,n=void 0===e?0:e,i=t.cy,r=void 0===i?0:i,a=t.r1,o=t.r2,s=t.padding,l={move:{x:n,y:r}};return void 0!==a&&(l.r1={x:n+a/Math.sqrt(2),y:r+a/Math.sqrt(2)}),void 0!==o&&(l.r2={x:n+o/Math.sqrt(2),y:r+o/Math.sqrt(2)}),void 0!==s&&(l.padding={x:n+a+s,y:r}),l}({r1:r.data.outerRadius||r.data.radius,r2:r.data.innerRadius,padding:e.radiusPadding}),o=function(t){var i=e[t]+su.dx*Math.sqrt(2);e[t]=i,n.redrawSubject(),n.redrawConnector()},s=[Bh({},a.r1,{drag:o.bind(n,void 0!==e.outerRadius?"outerRadius":"radius")})];e.innerRadius&&s.push(Bh({},a.r2,{drag:o.bind(n,"innerRadius")})),i=n.mapHandles(s)}return r.attrs["fill-opacity"]=0,{components:[r],handles:i}},rf=function(){function t(e){var n=e.a,i=e.annotation,r=e.editMode,a=e.dispatcher,o=e.notePadding,s=e.accessors;if(Rh(this,t),this.a=n,this.note=-1===i.disable.indexOf("note")&&n.select("g.annotation-note"),this.noteContent=this.note&&n.select("g.annotation-note-content"),this.connector=-1===i.disable.indexOf("connector")&&n.select("g.annotation-connector"),this.subject=-1===i.disable.indexOf("subject")&&n.select("g.annotation-subject"),this.dispatcher=a,a){var l=df.bind(null,a,i);l({component:this.note,name:"note"}),l({component:this.connector,name:"connector"}),l({component:this.subject,name:"subject"})}this.annotation=i,this.editMode=i.editMode||r,this.notePadding=void 0!==o?o:3,this.offsetCornerX=0,this.offsetCornerY=0,s&&i.data&&this.init(s)}return jh(t,[{key:"init",value:function(t){this.annotation.x||this.mapX(t),this.annotation.y||this.mapY(t)}},{key:"mapY",value:function(t){t.y&&(this.annotation.y=t.y(this.annotation.data))}},{key:"mapX",value:function(t){t.x&&(this.annotation.x=t.x(this.annotation.data))}},{key:"updateEditMode",value:function(){this.a.selectAll("circle.handle").remove()}},{key:"drawOnSVG",value:function(t,e){var n=this;Array.isArray(e)||(e=[e]),e.filter((function(t){return t})).forEach((function(e){var i=e.type,r=e.className,a=e.attrs,o=e.handles,s=e.classID;if("handle"===i)!function(t){var e=t.group,n=t.handles,i=t.r,r=void 0===i?10:i,a=e.selectAll("circle.handle").data(n);a.enter().append("circle").attr("class","handle").attr("fill","grey").attr("fill-opacity",.1).attr("cursor","move").attr("stroke-dasharray",5).attr("stroke","grey").call(ju().container(yu("g.annotations").node()).on("start",(function(t){return t.start&&t.start(t)})).on("drag",(function(t){return t.drag&&t.drag(t)})).on("end",(function(t){return t.end&&t.end(t)}))),e.selectAll("circle.handle").attr("cx",(function(t){return t.x})).attr("cy",(function(t){return t.y})).attr("r",(function(t){return t.r||r})).attr("class",(function(t){return"handle "+(t.className||"")})),a.exit().remove()}({group:t,r:a&&a.r,handles:o});else{pf(t,[n.annotation],i,r,s);for(var l=t.select(i+"."+(s||r)),c=Object.keys(a),u=[],h=l.node().attributes,f=h.length-1;f>=0;f--){var p=h[f].name;-1===c.indexOf(p)&&"class"!==p&&u.push(p)}c.forEach((function(t){"text"===t?l.text(a[t]):l.attr(t,a[t])})),u.forEach((function(t){return l.attr(t,null)}))}}))}},{key:"getNoteBBox",value:function(){return _f(this.note,".annotation-note-content text")}},{key:"getNoteBBoxOffset",value:function(){var t=_f(this.note,".annotation-note-content"),e=this.noteContent.attr("transform").split(/\(|\,|\)/g);return t.offsetCornerX=parseFloat(e[1])+this.annotation.dx,t.offsetCornerY=parseFloat(e[2])+this.annotation.dy,t.offsetX=this.annotation.dx,t.offsetY=this.annotation.dy,t}},{key:"drawSubject",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.annotation.subject,i=e.type,r={type:this,subjectData:n},a={};"circle"===i?a=nf(r):"rect"===i?a=function(t){var e=t.subjectData,n=t.type;e.width||(e.width=100),e.height||(e.height=100);var i=[],r=e.width,a=e.height,o=Kh({data:[[0,0],[r,0],[r,a],[0,a],[0,0]],className:"subject"});if(n.editMode){var s=[{x:r,y:a/2,drag:function(){e.width=su.x,n.redrawSubject(),n.redrawConnector()}.bind(n)},{x:r/2,y:a,drag:function(){e.height=su.y,n.redrawSubject(),n.redrawConnector()}.bind(n)}];i=n.mapHandles(s)}return o.attrs["fill-opacity"]=.1,{components:[o],handles:i}}(r):"threshold"===i?a=function(t){var e=t.subjectData,n=t.type.annotation.position,i=(void 0!==e.x1?e.x1:n.x)-n.x,r=(void 0!==e.x2?e.x2:n.x)-n.x,a=(void 0!==e.y1?e.y1:n.y)-n.y,o=(void 0!==e.y2?e.y2:n.y)-n.y;return{components:[Kh({data:[[i,a],[r,o]],className:"subject"})]}}(r):"badge"===i&&(a=function(t){var e=t.subjectData,n=void 0===e?{}:e,i=t.type,r=void 0===i?{}:i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.typeSettings&&r.typeSettings.subject;n.radius||(o&&o.radius?n.radius=o.radius:n.radius=14),n.x||o&&o.x&&(n.x=o.x),n.y||o&&o.y&&(n.y=o.y);var s=[],l=[],c=n.radius,u=.7*c,h=0,f=0,p=Math.sqrt(2)*c,d={xleftcorner:-c,xrightcorner:c,ytopcorner:-c,ybottomcorner:c,xleft:-p,xright:p,ytop:-p,ybottom:p};n.x&&!n.y?h=d["x"+n.x]:n.y&&!n.x?f=d["y"+n.y]:n.x&&n.y&&(h=d["x"+n.x+"corner"],f=d["y"+n.y+"corner"]);var g="translate("+h+", "+f+")",_=Zh({className:"subject",data:{radius:c}});_.attrs.transform=g,_.attrs.fill=a.color,_.attrs["stroke-linecap"]="round",_.attrs["stroke-width"]="3px";var m=Zh({className:"subject-ring",data:{outerRadius:c,innerRadius:u}});m.attrs.transform=g,m.attrs["stroke-width"]="3px",m.attrs.fill="white";var v=void 0;if(h&&f||!h&&!f)v=Kh({className:"subject-pointer",data:[[0,0],[h||0,0],[0,f||0],[0,0]]});else if(h||f){var y=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t&&t/Math.sqrt(2)/Math.sqrt(2)||e*c/Math.sqrt(2)};v=Kh({className:"subject-pointer",data:[[0,0],[y(h),y(f)],[y(h,-1),y(f,-1)],[0,0]]})}if(v&&(v.attrs.fill=a.color,v.attrs["stroke-linecap"]="round",v.attrs["stroke-width"]="3px",l.push(v)),r.editMode){var x={x:2*h,y:2*f,drag:function(){n.x=su.x<2*-c?"left":su.x>2*c?"right":void 0,n.y=su.y<2*-c?"top":su.y>2*c?"bottom":void 0,r.redrawSubject()}.bind(r)};x.x||x.y||(x.y=-c),s=r.mapHandles([x])}var b=void 0;return n.text&&(b={type:"text",className:"badge-text",attrs:{fill:"white",stroke:"none","font-size":".7em",text:n.text,"text-anchor":"middle",dy:".25em",x:h,y:f}}),l.push(_),l.push(m),l.push(b),{components:l,handles:s}}(r,this.annotation));var o=a,s=o.components,l=void 0===s?[]:s,c=o.handles,u=void 0===c?[]:c;return l.forEach((function(e){e&&e.attrs&&!e.attrs.stroke&&(e.attrs.stroke=t.annotation.color)})),this.editMode&&(u=u.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),l.push({type:"handle",handles:u})),l}},{key:"drawConnector",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.annotation.connector,i=n.type||e.type,r={type:this,connectorData:n};r.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var a={};a="curve"===i?tf(r):"elbow"===i?function(t){var e=t.type,n=t.subjectType,i=e.annotation,r=i.position,a=i.x-r.x,o=a+i.dx,s=i.y-r.y,l=s+i.dy,c=i.subject;if("rect"===n){var u=c.width,h=c.height;(u>0&&i.dx>0||u<0&&i.dx<0)&&(a=Math.abs(u)>Math.abs(i.dx)?u/2:u),(h>0&&i.dy>0||h<0&&i.dy<0)&&(s=Math.abs(h)>Math.abs(i.dy)?h/2:h),a===u/2&&s===h/2&&(a=o,s=l)}var f=[[a,s],[o,l]],p=l-s,d=o-a,g=o,_=l,m=l<s&&o>a||o<a&&l>s?-1:1;if(Math.abs(d)<Math.abs(p)?(g=o,_=s+d*m):(_=l,g=a+p*m),"circle"===n&&(c.outerRadius||c.radius)){var v=(c.outerRadius||c.radius)+(c.radiusPadding||0),y=v/Math.sqrt(2);if(Math.abs(d)>y&&Math.abs(p)>y)f=[[a=y*(o<0?-1:1),s=y*(l<0?-1:1)],[g,_],[o,l]];else if(Math.abs(d)>Math.abs(p)){var x=Math.asin(-l/v);f=[[a=Math.abs(Math.cos(x)*v)*(o<0?-1:1),l],[o,l]]}else{var b=Math.acos(o/v);f=[[o,s=Math.abs(Math.sin(b)*v)*(l<0?-1:1)],[o,l]]}}else f=[[a,s],[g,_],[o,l]];return{components:[Kh({data:f,className:"connector"})]}}(r):function(t){var e=Qh(t);return{components:[Kh({data:e,className:"connector"})]}}(r);var o=a,s=o.components,l=void 0===s?[]:s,c=o.handles,u=void 0===c?[]:c,h=l[0];h&&(h.attrs.stroke=this.annotation.color,h.attrs.fill="none");var f=n.end||e.end,p={};if("arrow"===f){var d=h.data[1],g=h.data[0];Math.sqrt(Math.pow(d[0]-g[0],2)+Math.pow(d[1]-g[1],2))<5&&h.data[2]&&(d=h.data[2]),p=function(t){var e=t.annotation,n=t.start,i=t.end,r=t.scale,a=void 0===r?1:r,o=e.position;n=n?[-i[0]+n[0],-i[1]+n[1]]:[e.dx,e.dy],i||(i=[e.x-o.x,e.y-o.y]);var s=i[0],l=i[1],c=n[0],u=n[1],h=10*a,f=16/180*Math.PI,p=Math.atan(u/c);c<0&&(p+=Math.PI);var d=[[s,l],[Math.cos(p+f)*h+s,Math.sin(p+f)*h+l],[Math.cos(p-f)*h+s,Math.sin(p-f)*h+l],[s,l]];return{components:[Kh({data:d,className:"connector-end connector-arrow",classID:"connector-end"})]}}({annotation:this.annotation,start:d,end:g,scale:n.endScale})}else"dot"===f?p=function(t){var e=t.line,n=t.scale,i=void 0===n?1:n,r=Zh({className:"connector-end connector-dot",classID:"connector-end",data:{radius:3*Math.sqrt(i)}});return r.attrs.transform="translate("+e.data[0][0]+", "+e.data[0][1]+")",{components:[r]}}({line:h,scale:n.endScale}):f&&"none"!==f||this.connector&&this.connector.select(".connector-end").remove();return p.components&&(p.components.forEach((function(e){e.attrs.fill=t.annotation.color,e.attrs.stroke=t.annotation.color})),l=l.concat(p.components)),this.editMode&&0!==u.length&&l.push({type:"handle",handles:u}),l}},{key:"drawNote",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.annotation.note,i=n.align||e.align||"dynamic",r={bbox:e.bbox,align:i,offset:this.annotation.offset},a=n.lineType||e.lineType,o={};"vertical"===a?o=function(t){var e=t.align,n=t.x,i=void 0===n?0:n,r=t.y,a=void 0===r?0:r,o=t.bbox,s=t.offset;"top"===(e=$h(e,s.y))?a-=o.height:"middle"===e&&(a-=o.height/2);var l=[[i,a],[i,a+o.height]];return{components:[Kh({data:l,className:"note-line"})]}}(r):"horizontal"===a&&(o=function(t){var e=t.align,n=t.x,i=void 0===n?0:n,r=t.y,a=void 0===r?0:r,o=t.offset,s=t.bbox;"right"===(e=Jh(e,o.x))?i-=s.width:"middle"===e&&(i-=s.width/2);var l=[[i,a],[i+s.width,a]];return{components:[Kh({data:l,className:"note-line"})]}}(r));var s=o,l=s.components,c=void 0===l?[]:l,u=s.handles,h=void 0===u?[]:u;if(c.forEach((function(e){e.attrs.stroke=t.annotation.color})),this.editMode){h=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),c.push({type:"handle",handles:h});var f=this.dragNote.bind(this),p=this.dragstarted.bind(this),d=this.dragended.bind(this);this.note.call(ju().container(yu("g.annotations").node()).on("start",(function(t){return p(t)})).on("drag",(function(t){return f(t)})).on("end",(function(t){return d(t)})))}else this.note.on("mousedown.drag",null);return c}},{key:"drawNoteContent",value:function(t){var e=this.annotation.note,n=void 0!==e.padding?e.padding:this.notePadding,i=e.orientation||t.orientation||"topBottom",r=e.lineType||t.lineType,a=e.align||t.align||"dynamic";"vertical"===r?i="leftRight":"horizontal"===r&&(i="topBottom");var o=function(t){var e=t.padding,n=void 0===e?0:e,i=t.bbox,r=void 0===i?{x:0,y:0,width:0,height:0}:i,a=t.align,o=t.orientation,s=t.offset,l=void 0===s?{x:0,y:0}:s,c=-r.x,u=0;return-1!==Yh.indexOf(o)?(a=Jh(a,l.x),l.y<0&&"topBottom"===o||"top"===o?u-=r.height+n:u+=n,"middle"===a?c-=r.width/2:"right"===a&&(c-=r.width)):-1!==Xh.indexOf(o)&&(a=$h(a,l.y),l.x<0&&"leftRight"===o||"left"===o?c-=r.width+n:c+=n,"middle"===a?u-=r.height/2:"top"===a&&(u-=r.height)),{x:c,y:u}}({padding:n,bbox:t.bbox,offset:this.annotation.offset,orientation:i,align:a}),s=o.x,l=o.y;return this.offsetCornerX=s+this.annotation.dx,this.offsetCornerY=l+this.annotation.dy,this.note&&this.noteContent.attr("transform","translate("+s+", "+l+")"),[]}},{key:"drawOnScreen",value:function(t,e){return this.drawOnSVG(t,e)}},{key:"redrawSubject",value:function(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())}},{key:"redrawConnector",value:function(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())}},{key:"redrawNote",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:t})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:t}))}},{key:"setPosition",value:function(){var t=this.annotation.position;this.a.attr("transform","translate("+t.x+", "+t.y+")")}},{key:"clearComponents",value:function(){this.subject&&this.subject.select("*").remove(),this.connector&&this.connector.select("*").remove()}},{key:"setOffset",value:function(){if(this.note){var t=this.annotation.offset;this.note.attr("transform","translate("+t.x+", "+t.y+")")}}},{key:"setPositionWithAccessors",value:function(t){t&&this.annotation.data&&(this.mapX(t),this.mapY(t)),this.setPosition()}},{key:"setClassName",value:function(){this.a.attr("class","annotation "+(this.className&&this.className())+" "+(this.editMode?"editable":"")+" "+(this.annotation.className||""))}},{key:"draw",value:function(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()}},{key:"dragstarted",value:function(){su.sourceEvent.stopPropagation(),this.dispatcher&&this.dispatcher.call("dragstart",this.a,this.annotation),this.a.classed("dragging",!0),this.a.selectAll("circle.handle").style("pointer-events","none")}},{key:"dragended",value:function(){this.dispatcher&&this.dispatcher.call("dragend",this.a,this.annotation),this.a.classed("dragging",!1),this.a.selectAll("circle.handle").style("pointer-events","all")}},{key:"dragSubject",value:function(){var t=this.annotation.position;t.x+=su.dx,t.y+=su.dy,this.annotation.position=t}},{key:"dragNote",value:function(){var t=this.annotation.offset;t.x+=su.dx,t.y+=su.dy,this.annotation.offset=t}},{key:"mapHandles",value:function(t){var e=this;return t.map((function(t){return Bh({},t,{start:e.dragstarted.bind(e),end:e.dragended.bind(e)})}))}}]),t}(),af=function(t,e,n){return function(t){function i(t){Rh(this,i);var n=Wh(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,t));return n.typeSettings=e,e.disable&&e.disable.forEach((function(t){n[t]&&n[t].remove(),n[t]=void 0,"note"===t&&(n.noteContent=void 0)})),n}return Uh(i,t),jh(i,[{key:"className",value:function(){return""+(e.className||qh(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"className",this)&&qh(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"className",this).call(this)||"")}},{key:"drawSubject",value:function(t){return this.typeSettings.subject=Bh({},e.subject,this.typeSettings.subject),qh(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"drawSubject",this).call(this,Bh({},t,this.typeSettings.subject))}},{key:"drawConnector",value:function(t){return this.typeSettings.connector=Bh({},e.connector,this.typeSettings.connector),qh(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"drawConnector",this).call(this,Bh({},t,e.connector,this.typeSettings.connector))}},{key:"drawNote",value:function(t){return this.typeSettings.note=Bh({},e.note,this.typeSettings.note),qh(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"drawNote",this).call(this,Bh({},t,e.note,this.typeSettings.note))}},{key:"drawNoteContent",value:function(t){return qh(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"drawNoteContent",this).call(this,Bh({},t,e.note,this.typeSettings.note))}}],[{key:"init",value:function(t,e){return qh(i.__proto__||Object.getPrototypeOf(i),"init",this).call(this,t,e),n&&(t=n(t,e)),t}}]),i}(t)},of=function(t){function e(t){Rh(this,e);var n=Wh(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.textWrap=t.textWrap||120,n.drawText(),n}return Uh(e,t),jh(e,[{key:"updateTextWrap",value:function(t){this.textWrap=t,this.drawText()}},{key:"drawText",value:function(){if(this.note){pf(this.note,[this.annotation],"g","annotation-note-content");var t=this.note.select("g.annotation-note-content");pf(t,[this.annotation],"rect","annotation-note-bg"),pf(t,[this.annotation],"text","annotation-note-label"),pf(t,[this.annotation],"text","annotation-note-title");var e={height:0},n=this.a.select("text.annotation-note-label"),i=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,r=this.annotation.note&&this.annotation.note.wrapSplitter||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrapSplitter,a=this.annotation.note&&this.annotation.note.bgPadding||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.bgPadding,o={top:0,bottom:0,left:0,right:0};if("number"==typeof a?o={top:a,bottom:a,left:a,right:a}:a&&"object"===(void 0===a?"undefined":Ih(a))&&(o=Bh(o,a)),this.annotation.note.title){var s=this.a.select("text.annotation-note-title");s.text(this.annotation.note.title),s.attr("fill",this.annotation.color),s.attr("font-weight","bold"),s.call(gf,i,r),e=s.node().getBBox()}n.text(this.annotation.note.label).attr("dx","0"),n.call(gf,i,r),n.attr("y",1.1*e.height||0),n.attr("fill",this.annotation.color);var l=this.getNoteBBox();this.a.select("rect.annotation-note-bg").attr("width",l.width+o.left+o.right).attr("height",l.height+o.top+o.bottom).attr("x",l.x-o.left).attr("y",-o.top).attr("fill","white").attr("fill-opacity",0)}}}]),e}(rf),sf=af(of,{className:"label",note:{align:"middle"}}),lf=af(of,{className:"callout",note:{lineType:"horizontal"}}),cf=(af(lf,{className:"callout elbow",connector:{type:"elbow"}}),af(lf,{className:"callout curve",connector:{type:"curve"}}),af(rf,{className:"badge",subject:{type:"badge"},disable:["connector","note"]}),af(of,{className:"callout circle",subject:{type:"circle"},note:{lineType:"horizontal"},connector:{type:"elbow"}})),uf=af(of,{className:"callout rect",subject:{type:"rect"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),hf=function(t){function e(){return Rh(this,e),Wh(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return Uh(e,t),jh(e,[{key:"mapY",value:function(t){qh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"mapY",this).call(this,t);var n=this.annotation;(n.subject.x1||n.subject.x2)&&n.data&&t.y&&(n.y=t.y(n.data)),!n.subject.x1&&!n.subject.x2||n.x||(n.x=n.subject.x1||n.subject.x2)}},{key:"mapX",value:function(t){qh(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"mapX",this).call(this,t);var n=this.annotation;(n.subject.y1||n.subject.y2)&&n.data&&t.x&&(n.x=t.x(n.data)),!n.subject.y1&&!n.subject.y2||n.y||(n.y=n.subject.y1||n.subject.y2)}}]),e}(lf),ff=af(hf,{className:"callout xythreshold",subject:{type:"threshold"}}),pf=function(t,e,n,i,r){var a=t.selectAll(n+"."+(r||i)).data(e);return a.enter().append(n).merge(a).attr("class",i),a.exit().remove(),t},df=function(t,e,n){var i=n.component,r=n.name;i&&i.on("mouseover.annotations",(function(){t.call(r+"over",i,e)})).on("mouseout.annotations",(function(){return t.call(r+"out",i,e)})).on("click.annotations",(function(){return t.call(r+"click",i,e)}))},gf=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.2;t.each((function(){for(var t=yu(this),r=t.text().split(n||/[ \t\r\n]+/).reverse().filter((function(t){return""!==t})),a=void 0,o=[],s=t.text(null).append("tspan").attr("x",0).attr("dy","0.8em");a=r.pop();)o.push(a),s.text(o.join(" ")),s.node().getComputedTextLength()>e&&o.length>1&&(o.pop(),s.text(o.join(" ")),o=[a],s=t.append("tspan").attr("x",0).attr("dy",i+"em").text(a))}))},_f=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:":not(.handle)";return t?t.selectAll(e).nodes().reduce((function(t,e){var n=e.getBBox();t.x=Math.min(t.x,n.x),t.y=Math.min(t.y,n.y),t.width=Math.max(t.width,n.width);var i=e&&e.attributes&&e.attributes.y;return t.height=Math.max(t.height,(i&&parseFloat(i.value)||0)+n.height),t}),{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}};function mf(){var t=[],e=void 0,n=void 0,i=[],r={},a={},o=!1,s=void 0,l=lf,c=void 0,u=void 0,h=Nu("subjectover","subjectout","subjectclick","connectorover","connectorout","connectorclick","noteover","noteout","noteclick","dragend","dragstart"),f=void 0,p=function(n){f=n,o||n.selectAll("circle.handle").remove();var p=t.map((function(t){return t.type||(t.type=l),t.disable||(t.disable=i),new Hh(t)}));e=e||new Vh({annotations:p,accessors:r,accessorsInverse:a,ids:s}),n.selectAll("g").data([e]).enter().append("g").attr("class","annotations");var d=n.select("g.annotations");pf(d,e.annotations,"g","annotation");var g=d.selectAll("g.annotation");g.each((function(t){var e=yu(this);e.attr("class","annotation"),pf(e,[t],"g","annotation-connector"),pf(e,[t],"g","annotation-subject"),pf(e,[t],"g","annotation-note"),pf(e.select("g.annotation-note"),[t],"g","annotation-note-content"),t.type="[object Object]"===t.type.toString()?t.type:new t.type({a:e,annotation:t,textWrap:c,notePadding:u,editMode:o,dispatcher:h,accessors:r}),t.type.draw(),t.type.drawText&&t.type.drawText()}))};return p.json=function(){return console.log("Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.",e.json),window.copy(JSON.stringify(e.json.map((function(t){return delete t.type,t})))),p},p.update=function(){return t&&e&&(t=e.annotations.map((function(t){return t.type.draw(),t}))),p},p.updateText=function(){return e&&(e.updateText(c),t=e.annotations),p},p.updatedAccessors=function(){return e.setPositionWithAccessors(),t=e.annotations,p},p.disable=function(n){return arguments.length?(i=n,e&&(e.updateDisable(i),t=e.annotations),p):i},p.textWrap=function(n){return arguments.length?(c=n,e&&(e.updateTextWrap(c),t=e.annotations),p):c},p.notePadding=function(n){return arguments.length?(u=n,e&&(e.updateNotePadding(u),t=e.annotations),p):u},p.type=function(n,i){return arguments.length?(l=n,e&&(e.annotations.map((function(t){t.type.note&&t.type.note.selectAll("*:not(.annotation-note-content)").remove(),t.type.noteContent&&t.type.noteContent.selectAll("*").remove(),t.type.subject&&t.type.subject.selectAll("*").remove(),t.type.connector&&t.type.connector.selectAll("*").remove(),t.type.typeSettings={},t.type=l,t.subject=i&&i.subject||t.subject,t.connector=i&&i.connector||t.connector,t.note=i&&i.note||t.note})),t=e.annotations),p):l},p.annotations=function(n){if(!arguments.length)return e&&e.annotations||t;(t=n,e&&e.annotations)&&(t.some((function(t){return!t.type||"[object Object]"!==t.type.toString()}))?(e=null,p(f)):e.annotations=t);return p},p.context=function(t){return arguments.length?(n=t,p):n},p.accessors=function(t){return arguments.length?(r=t,p):r},p.accessorsInverse=function(t){return arguments.length?(a=t,p):a},p.ids=function(t){return arguments.length?(s=t,p):s},p.editMode=function(n){return arguments.length?(o=n,f&&f.selectAll("g.annotation").classed("editable",o),e&&(e.editMode(o),t=e.annotations),p):o},p.collection=function(t){return arguments.length?(e=t,p):e},p.on=function(){var t=h.on.apply(h,arguments);return t===h?p:t},p}function vf(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function yf(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vf(Object(n),!0).forEach((function(e){ma(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vf(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function xf(t){if(t.svg_){var e=t.svg_.select("#em-zoom-group-"+t.svgId_);e.selectAll(".em-annotation-group").remove();var n=t.annotations_;if(n){var i={annotationLabel:sf,annotationCallout:lf,annotationCalloutRect:uf,annotationCalloutCircle:cf,annotationXYThreshold:ff},r=n.annotations.map((function(t){var e=i[t.type]||sf;return yf(yf({},t),{},{type:e})})),a=mf().type(sf).annotations(r).editMode(n.editMode);e.append("g").attr("class","em-annotation-group").call(a)}}}var bf=function(t,e){var n,i;t.labels_.config||(t.labels_.config=Cf),t.labels_.statLabelsPositions||(t.labels_.statLabelsPositions=Af);var r=e.select("#em-labels"),a=r.empty()?e.append("g").attr("id","em-labels"):r;null!==(n=t.labels_)&&void 0!==n&&n.values&&"ps"!==t._mapType&&Ef(t,a);var o=(null===(i=t.labels_)||void 0===i?void 0:i.labels)||Cf["".concat(t.geo,"_").concat(t.proj_,".cc")];if(o){var s,l=a.append("g").attr("class","em-label-shadows").attr("text-anchor","middle"),c=a.append("g").attr("class","em-labels").attr("text-anchor","middle");if(null!==(s=t.labels_)&&void 0!==s&&s.shadows)l.selectAll("text").data(o).enter().append("text").attr("id",(function(t){return"em-label-shadow-"+t.text.replace(/\s+/g,"-")})).attr("class",(function(t){return"em-label-shadow em-label-shadow-"+t.class})).attr("x",(function(e){return e.rotate?0:t._projection([e.x,e.y])[0]})).attr("y",(function(e){return e.rotate?0:t._projection([e.x,e.y])[1]})).attr("dy",-7).attr("transform",(function(e){if(e.rotate){var n=t._projection([e.x,e.y]),i=n[0],r=n[1];return"translate(".concat(i,",").concat(r,") rotate(").concat(e.rotate,")")}return"rotate(0)"})).text((function(t){return t.text}));c.selectAll("text").data(o).enter().append("text").attr("id",(function(t){return"em-label-"+t.text.replace(/\s+/g,"-")})).attr("class",(function(t){return"em-label em-label-"+t.class})).attr("x",(function(e){return e.rotate?0:t._projection([e.x,e.y])[0]})).attr("y",(function(e){return e.rotate?0:t._projection([e.x,e.y])[1]})).attr("dy",-7).attr("transform",(function(e){if(e.rotate){var n=t._projection([e.x,e.y]),i=n[0],r=n[1];return"translate(".concat(i,",").concat(r,") rotate(").concat(e.rotate,")")}return"rotate(0)"})).text((function(t){return t.text}))}},wf=function(t){var e,n,i;if(t){t.svg_.selectAll("g.em-stat-label > *").remove(),t.svg_.selectAll("g.em-stat-label-shadow > *").remove();var r=t.svg_.selectAll("g.em-stat-label"),a=null!==(e=t.labels_)&&void 0!==e&&e.statLabelsFilterFunction?null===(n=t.labels_)||void 0===n?void 0:n.statLabelsFilterFunction:Mf,o=t.statData();return r.filter((function(e){return a(e,t)})).each((function(e){var n=Ft(this),i=Sf(e,o);t.labels_.backgrounds&&function(t,e){var n=5,i=2,r=e.append("text").attr("visibility","hidden").text(t).node().getBBox(),a=r.width,o=r.height;e.select('text[visibility="hidden"]').remove();var s=-a/2-n,l=-o/2-i;e.append("rect").attr("x",s).attr("y",l).attr("width",a+2*n).attr("height",o+2*i).attr("class","em-label-background")}(i,n),n.append("text").text(i).attr("class","em-stat-label-text")})),null!==(i=t.labels_)&&void 0!==i&&i.shadows&&t.svg_.selectAll("g.em-stat-label-shadow").filter((function(e){return a(e,t)})).append("text").text((function(t){return Sf(t,o)})),t}console.warn("No map specified")},Sf=function(t,e){if(e&&null!=e&&e.get){var n=e.get(t.properties.id);if(!n||!n.value&&0!==n&&0!==n.value)return"";if(":"!==n.value)return la(n.value)}},Mf=function(t,e){var n=e.statData().get(t.properties.id);return!(!n||!n.value&&0!==n&&0!==n.value)},Ef=function(t,e){var n,i=e.append("g").attr("class","em-stat-labels-shadows").attr("text-anchor","middle"),r=e.append("g").attr("class","em-stat-labels").attr("text-anchor","middle"),a=[];t.Geometries.geoJSONs.nutsrg?a="mixed"==t.nutsLevel_?t.Geometries.geoJSONs.mixed.rg0.concat(t.Geometries.geoJSONs.mixed.rg1,t.Geometries.geoJSONs.mixed.rg2,t.Geometries.geoJSONs.mixed.rg3,t.Geometries.geoJSONs.cntrg):t.Geometries.geoJSONs.nutsrg.concat(t.Geometries.geoJSONs.cntrg):t.Geometries.userGeometries&&(a=t.Geometries.statisticalRegions.features);var o=a.filter((function(t,e,n){return e===n.findIndex((function(e){return e.properties.id===t.properties.id}))}));r.selectAll("g").data(o).enter().append("g").attr("transform",(function(e){if(t.labels_.statLabelsPositions[e.properties.id]){var n=t.labels_.statLabelsPositions[e.properties.id],i=t._projection([n.x,n.y]),r=i[0].toFixed(3),a=i[1].toFixed(3);return"translate(".concat(r,",").concat(a,")")}var o=t._pathFunction.centroid(e);return t.labels_.processValueLabelCentroids&&(o=t.labels_.processValueLabelCentroids(e,o)),"translate("+o+")"})).attr("class","em-stat-label"),null!==(n=t.labels_)&&void 0!==n&&n.shadows&&i.selectAll("g").data(a).enter().append("g").attr("transform",(function(e){if(t.labels_.statLabelsPositions[e.properties.id]){var n=t._projection([t.labels_.statLabelsPositions[e.properties.id].x,t.labels_.statLabelsPositions[e.properties.id].y]),i=n[0].toFixed(3),r=n[1].toFixed(3);return"translate(".concat(i,",").concat(r,")")}var a=t._pathFunction.centroid(e);return t.labels_.processValueLabelCentroids&&(a=t.labels_.processValueLabelCentroids(e,a)),"translate("+a+")"})).attr("class","em-stat-label-shadow")},Cf={EUR_3035:{cc:[{text:"AL",x:515e4,y:206e4,class:"cc",size:7},{text:"AT",x:467e4,y:269e4,class:"cc",size:18},{text:"BE",x:393e4,y:301e4,class:"cc",size:17},{text:"BG",x:5567e3,y:225e4,class:"cc",size:22},{text:"HR",x:484e4,y:248e4,class:"cc",size:10},{text:"CY",x:6426e3,y:148e4,class:"cc",size:10},{text:"CZ",x:4707e3,y:292e4,class:"cc",size:18},{text:"DK",x:4316e3,y:3621e3,class:"cc",size:20},{text:"EE",x:522e4,y:399e4,class:"cc",size:12},{text:"FI",x:515e4,y:4424e3,class:"cc",size:20},{text:"FR",x:3767740,y:2662817,class:"cc",size:22},{text:"DE",x:4347284,y:3093276,class:"cc",size:22},{text:"EL",x:537e4,y:175e4,class:"cc",size:22},{text:"HU",x:502e4,y:263e4,class:"cc",size:17},{text:"IS",x:304e4,y:4833e3,class:"cc",size:10},{text:"IE",x:3136e3,y:3394e3,class:"cc",size:17},{text:"IT",x:4469967,y:2181963,class:"cc",size:22},{text:"LV",x:529e4,y:38e5,class:"cc",size:12},{text:"LT",x:519e4,y:363e4,class:"cc",size:12},{text:"LU",x:412e4,y:294e4,class:"cc",size:12},{text:"MT",x:4731e3,y:13e5,class:"cc",size:10},{text:"ME",x:5073e3,y:2185e3,class:"cc",size:7},{text:"GE",x:6942680,y:266e4,class:"cc"},{text:"UA",x:589e4,y:305e4,class:"cc"},{text:"BA",x:4949262,y:2338688,class:"cc"},{text:"MD",x:574e4,y:279e4,class:"cc"},{text:"MK",x:53e5,y:208e4,class:"cc",size:10},{text:"NL",x:402e4,y:3208e3,class:"cc",size:17},{text:"NO",x:43e5,y:4147e3,class:"cc",size:20},{text:"PL",x:4964e3,y:32e5,class:"cc",size:22},{text:"PT",x:277e4,y:199e4,class:"cc",size:18},{text:"RO",x:5451e3,y:26e5,class:"cc",size:22},{text:"RS",x:52e5,y:235e4,class:"cc",size:10},{text:"SK",x:504e4,y:286e4,class:"cc",size:12},{text:"SI",x:4675e3,y:25e5,class:"cc",size:10},{text:"ES",x:3160096,y:19e5,class:"cc",size:22},{text:"SE",x:463e4,y:4e6,class:"cc",size:20},{text:"CH",x:417e4,y:26e5,class:"cc",size:16},{text:"TR",x:651e4,y:21e5,class:"cc",size:22},{text:"UK",x:3558e3,y:325e4,class:"cc",size:17}],en:[{text:"MEDITERRANEAN SEA",x:398e4,y:16e5,class:"seas",size:12,letterSpacing:7},{text:"ATLANTIC OCEAN",x:282e4,y:254e4,class:"seas",size:12,letterSpacing:2},{text:"NORTH SEA",x:3915e3,y:37e5,class:"seas",size:12},{text:"BALTIC SEA",x:49e5,y:373e4,class:"seas",size:10,rotate:-50},{text:"NORWEGIAN SEA",x:385e4,y:48e5,class:"seas",size:12,letterSpacing:1},{text:"BLACK SEA",x:63e5,y:25e5,class:"seas",size:12,letterSpacing:4},{text:"ALBANIA",cc:"AL",x:51e5,y:206e4,class:"countries",size:7,rotate:80},{text:"AUSTRIA",cc:"AT",x:467e4,y:2629e3,class:"countries",size:10},{text:"BELGIUM",cc:"BE",x:39e5,y:303e4,class:"countries",size:7,rotate:30},{text:"BULGARIA",cc:"BG",x:5567e3,y:2256e3,class:"countries",size:12},{text:"CROATIA",cc:"HR",x:4876e3,y:2455e3,class:"countries",size:7},{text:"CYPRUS",cc:"CY",x:6426e3,y:148e4,class:"countries",size:10},{text:"CZECHIA",cc:"CZ",x:4707e3,y:2885e3,class:"countries",size:12},{text:"DENMARK",cc:"DK",x:4316e3,y:3621e3,class:"countries",size:10},{text:"ESTONIA",cc:"EE",x:522e4,y:399e4,class:"countries",size:7},{text:"FINLAND",cc:"FI",x:515e4,y:4424e3,class:"countries",size:12},{text:"FRANCE",cc:"FR",x:3767740,y:2662817,class:"countries",size:12},{text:"GERMANY",cc:"DE",x:4347284,y:3093276,class:"countries",size:12},{text:"GREECE",cc:"EL",x:547e4,y:186e4,class:"countries",size:12},{text:"HUNGARY",cc:"HU",x:502e4,y:263e4,class:"countries",size:10},{text:"ICELAND",cc:"IS",x:304e4,y:4833e3,class:"countries",size:10},{text:"IRELAND",cc:"IE",x:3136e3,y:3394e3,class:"countries",size:10},{text:"ITALY",cc:"IT",x:4469967,y:2181963,class:"countries",size:12},{text:"LATVIA",cc:"LV",x:529e4,y:38e5,class:"countries",size:7},{text:"LITHUANIA",cc:"LT",x:519e4,y:363e4,class:"countries",size:7},{text:"LUX.",cc:"LU",x:412e4,y:294e4,class:"countries",size:7},{text:"MALTA",cc:"MT",x:4731e3,y:133e4,class:"countries",size:7},{text:"MONT.",cc:"ME",x:5073e3,y:2185e3,class:"countries",size:7},{text:"N. MACEDONIA",cc:"MK",x:53e5,y:2082e3,class:"countries",size:7},{text:"NETHERLANDS",cc:"NL",x:3977e3,y:3208e3,class:"countries",size:7},{text:"NORWAY",cc:"NO",x:433e4,y:4147e3,class:"countries",size:12,rotate:-75},{text:"POLAND",cc:"PL",x:4964e3,y:3269e3,class:"countries",size:12},{text:"PORTUGAL",cc:"PT",x:283e4,y:199e4,class:"countries",size:10,rotate:-75},{text:"ROMANIA",cc:"RO",x:5451e3,y:26e5,class:"countries",size:12},{text:"SERBIA",cc:"RS",x:52e5,y:23e5,class:"countries",size:7},{text:"SLOVAKIA",cc:"SK",x:504e4,y:2835e3,class:"countries",size:7,rotate:-30},{text:"SLOVENIA",cc:"SI",x:4735e3,y:2522e3,class:"countries",size:7,rotate:-30},{text:"SPAIN",cc:"ES",x:3160096,y:185e4,class:"countries",size:12},{text:"SWEDEN",cc:"SE",x:463e4,y:41e5,class:"countries",size:12,rotate:-75},{text:"SWITZERLAND",cc:"CH",x:42e5,y:2564e3,class:"countries",size:7},{text:"TURKEY",cc:"TR",x:651e4,y:21e5,class:"countries",size:12},{text:"U.K.",cc:"UK",x:3558e3,y:325e4,class:"countries",size:12}],fr:[{text:"MER MÉDITERRANÉE",x:5472e3,y:1242e3,class:"seas",size:12},{text:"OCÈAN ATLANTIQUE",x:282e4,y:254e4,class:"seas",size:12},{text:"MER DU NORD",x:3915e3,y:37e5,class:"seas",size:12},{text:"MER BALTIQUE",x:49e5,y:3672e3,class:"seas",size:10,rotate:-50},{text:"MER DE NORVÈGE",x:385e4,y:48e5,class:"seas",size:12},{text:"MER NOIRE",x:6265e3,y:2472e3,class:"seas",size:12},{text:"ALBANIE",x:51e5,y:206e4,class:"countries",size:7,rotate:80},{text:"AUTRICHE",x:467e4,y:2629e3,class:"countries",size:10},{text:"BELGIQUE",x:39e5,y:303e4,class:"countries",size:7,rotate:30},{text:"BULGARIE",x:5567e3,y:2256e3,class:"countries",size:12},{text:"CROATIE",x:4876e3,y:2455e3,class:"countries",size:7},{text:"CHYPRE",x:6426e3,y:148e4,class:"countries",size:10},{text:"TCHÉQUIE",x:4707e3,y:2885e3,class:"countries",size:12},{text:"DANEMARK",x:4316e3,y:3621e3,class:"countries",size:10},{text:"ESTONIE",x:522e4,y:399e4,class:"countries",size:10},{text:"FINLANDE",x:5125e3,y:4424e3,class:"countries",size:12},{text:"FRANCE",x:3767740,y:2662817,class:"countries",size:12},{text:"ALLEMAGNE",x:4347284,y:3093276,class:"countries",size:12},{text:"GRÈCE",x:542e4,y:186e4,class:"countries",size:12},{text:"HONGRIE",x:502e4,y:2654e3,class:"countries",size:10},{text:"ISLANDE",x:304e4,y:4833e3,class:"countries",size:10},{text:"IRLANDE",x:3136e3,y:3394e3,class:"countries",size:10},{text:"ITALIE",x:45e5,y:2181963,class:"countries",size:12},{text:"LETTONIE",x:529e4,y:3776e3,class:"countries",size:10},{text:"LITUANIE",x:519e4,y:363e4,class:"countries",size:10},{text:"LUX.",x:412e4,y:294e4,class:"countries",size:7},{text:"MALTE",x:4731e3,y:1335e3,class:"countries",size:7},{text:"MONT.",x:5073e3,y:2185e3,class:"countries",size:7},{text:"MAC. DU NORD",x:53e5,y:2082e3,class:"countries",size:7},{text:"PAYS-BAS",x:3977e3,y:3208e3,class:"countries",size:7},{text:"NORVEGE",x:433e4,y:4147e3,class:"countries",size:12,rotate:-75},{text:"POLOGNE",x:4964e3,y:3269e3,class:"countries",size:12},{text:"PORTUGAL",x:2836136,y:1956179,class:"countries",size:10,rotate:-75},{text:"ROUMANIE",x:5451e3,y:26e5,class:"countries",size:12},{text:"SERBIE",x:52e5,y:23e5,class:"countries",size:7},{text:"SLOVAQUIE",x:504e4,y:2835e3,class:"countries",size:7,rotate:-30},{text:"SLOVÉNIE",x:4735e3,y:2522e3,class:"countries",size:7,rotate:-35},{text:"ESPAGNE",x:3160096,y:185e4,class:"countries",size:12},{text:"SUÈDE",x:47e5,y:4401e3,class:"countries",size:12,rotate:-75},{text:"SUISSE",x:42e5,y:2564e3,class:"countries",size:7},{text:"TURQUIE",x:651e4,y:21e5,class:"countries",size:12},{text:"ROYAUME-UNI",x:3558e3,y:325e4,class:"countries",size:10}],de:[{text:"MITTELMEER",x:5472e3,y:12e5,class:"seas",size:12,letterSpacing:7},{text:"ATLANTISCHER OZEAN",x:282e4,y:254e4,class:"seas",size:12},{text:"NORDSEE",x:3915e3,y:37e5,class:"seas",size:12},{text:"OSTSEE",x:49e5,y:3672e3,class:"seas",size:10,rotate:-50},{text:"NORWEGISCHE MEER",x:385e4,y:48e5,class:"seas",size:12},{text:"SCHWARZE MEER",x:63e5,y:25e5,class:"seas",size:12,letterSpacing:1},{text:"ALBANIEN",x:51e5,y:206e4,class:"countries",size:7,rotate:80},{text:"ÖSTERREICH",x:465e4,y:2629e3,class:"countries",size:7},{text:"BELGIEN",x:39e5,y:303e4,class:"countries",size:7,rotate:30},{text:"BULGARIEN",x:5567e3,y:2256e3,class:"countries",size:10},{text:"KROATIEN",x:4876e3,y:2455e3,class:"countries",size:7},{text:"ZYPERN",x:6426e3,y:148e4,class:"countries",size:10},{text:"TSCHECHIEN",x:4707e3,y:2885e3,class:"countries",size:7},{text:"DÄNEMARK",x:4316e3,y:3621e3,class:"countries",size:10},{text:"ESTLAND",x:522e4,y:399e4,class:"countries",size:7},{text:"FINNLAND",x:515e4,y:4424e3,class:"countries",size:12},{text:"FRANKREICH",x:3767740,y:2662817,class:"countries",size:12},{text:"DEUTSCHLAND",x:4347284,y:3093276,class:"countries",size:10},{text:"GRIECHENLAND",x:555e4,y:15e5,class:"countries",size:10},{text:"UNGARN",x:502e4,y:263e4,class:"countries",size:10},{text:"ISLAND",x:304e4,y:4833e3,class:"countries",size:10},{text:"IRLAND",x:3136e3,y:3394e3,class:"countries",size:10},{text:"ITALIEN",x:4469967,y:2181963,class:"countries",size:12,rotate:35},{text:"LETTLAND",x:529e4,y:38e5,class:"countries",size:7},{text:"LITAUEN",x:519e4,y:363e4,class:"countries",size:7},{text:"LUX.",x:412e4,y:294e4,class:"countries",size:7},{text:"MALTA",x:4731e3,y:133e4,class:"countries",size:7},{text:"MONT.",x:5073e3,y:2185e3,class:"countries",size:7},{text:"NORDMAZEDONIEN",x:535e4,y:2082e3,class:"countries",size:7},{text:"NIEDERLANDE",x:3977e3,y:3208e3,class:"countries",size:7},{text:"NORWEGEN",x:433e4,y:4147e3,class:"countries",size:12,rotate:-75},{text:"POLEN",x:4964e3,y:3269e3,class:"countries",size:12},{text:"PORTUGAL",x:2836136,y:1956179,class:"countries",size:10,rotate:-75},{text:"RUMÄNIEN",x:5451e3,y:26e5,class:"countries",size:12},{text:"SERBIEN",x:52e5,y:23e5,class:"countries",size:7},{text:"SLOWAKEI",x:504e4,y:2835e3,class:"countries",size:7,rotate:-30},{text:"SLOWENIEN",x:4735e3,y:2522e3,class:"countries",size:7,rotate:-30},{text:"SPANIEN",x:3160096,y:185e4,class:"countries",size:12},{text:"SCHWEDEN",x:467e4,y:418e4,class:"countries",size:12,rotate:-75},{text:"SCHWEIZ",x:42e5,y:2564e3,class:"countries",size:7},{text:"TRUTHAHN",x:651e4,y:21e5,class:"countries",size:12},{text:"VEREINIGTES",x:355e4,y:352e4,class:"countries",size:10},{text:"KÖNIGREICH",x:355e4,y:342e4,class:"countries",size:10}]},IC_32628:{cc:[{text:"ES",x:420468,y:3180647,class:"cc",size:12}],en:[{text:"Canary Islands",x:420468,y:3180647,class:"countries",size:12}],fr:[{text:"Les îles Canaries",x:420468,y:3180647,class:"countries",size:12}],de:[{text:"Kanarische Inseln",x:41e4,y:3180647,class:"countries",size:12}]},GP_32620:{cc:[{text:"FR",x:667e3,y:174e4,class:"cc",size:12}],en:[{text:"Guadeloupe",x:7e5,y:181e4,class:"countries",size:12}]},MQ_32620:{cc:[{text:"FR",x:716521,y:1621322,class:"cc",size:12}],en:[{text:"Martinique",x:716521,y:1621322,class:"countries",size:12}]},GF_32622:{cc:[{text:"FR",x:266852,y:444074,class:"cc",size:12}],en:[{text:"Guyane",x:266852,y:444074,class:"countries",size:12}],de:[{text:"Guayana",x:266852,y:444074,class:"countries",size:12}]},RE_32740:{cc:[{text:"FR",x:348011,y:768e4,class:"cc",size:10}],en:[{text:"Réunion",x:348011,y:768e4,class:"countries",size:10}]},YT_32738:{cc:[{text:"FR",x:516549,y:8593920,class:"cc",size:10}],en:[{text:"Mayotte",x:516549,y:8593920,class:"countries",size:10}]},MT_3035:{cc:[{text:"MT",x:4719755,y:1410701,class:"cc",size:10}],en:[{text:"Malta",x:4719755,y:1410701,class:"countries",size:10}]},PT20_32626:{cc:[{text:"PT",x:397418,y:432e4,class:"cc",size:10}],en:[{text:"Azores",x:397418,y:432e4,class:"countries",size:10}],fr:[{text:"Açores",x:397418,y:4271471,class:"countries",size:10}],de:[{text:"Azoren",x:397418,y:4271471,class:"countries",size:10}]},PT30_32628:{cc:[{text:"PT",x:333586,y:3624e3,class:"cc",size:10,rotate:30}],en:[{text:"Madeira",x:333586,y:3624e3,class:"countries",size:10,rotate:30}],fr:[{text:"Madère",x:333586,y:3624e3,class:"countries",size:10,rotate:30}]},LI_3035:{cc:[{text:"LI",x:4287060,y:266e4,class:"cc",size:12}],en:[{text:"Liechtenstein",x:4287060,y:2679e3,class:"countries",size:7}]},IS_3035:{cc:[{text:"IS",x:3011804,y:496e4,class:"cc",size:12}],en:[{text:"Iceland",x:3011804,y:496e4,class:"countries",size:12}],fr:[{text:"Islande",x:3011804,y:496e4,class:"countries",size:12}],de:[{text:"Island",x:3011804,y:496e4,class:"countries",size:12}]},SJ_SV_3035:{cc:[{text:"NO",x:457e4,y:626e4,class:"cc",size:10}],en:[{text:"Svalbard",x:457e4,y:626e4,class:"countries",size:10}],de:[{text:"Spitzbergen",x:457e4,y:626e4,class:"countries",size:7}]},SJ_JM_3035:{cc:[{text:"NO",x:3647762,y:5420300,class:"cc",size:10}],en:[{text:"Jan Mayen",x:3647762,y:5420300,class:"countries",size:7}]},CARIB_32620:{cc:[{text:"FR",x:7e5,y:181e4,class:"cc",size:10},{text:"FR",x:64e4,y:159e4,class:"cc",size:10},{text:"FR",x:54e4,y:1962e3,class:"cc",size:7}],en:[{text:"Guadeloupe",x:7e5,y:181e4,class:"countries",size:10},{text:"Martinique",x:57e4,y:159e4,class:"countries",size:10},{text:"Saint Martin",x:597e3,y:1962e3,class:"countries",size:7}]},WORLD_54030:{en:[{text:"NORTH ATLANTIC",x:-45,y:25,class:"seas",size:10,letterSpacing:1},{text:"SOUTH ATLANTIC",x:-15,y:-25,class:"seas",size:10,letterSpacing:1},{text:"SOUTH PACIFIC",x:-126,y:-25,class:"seas",size:10,letterSpacing:1},{text:"NORTH",x:-136,y:25,class:"seas",size:10,letterSpacing:1},{text:"PACIFIC",x:-134,y:20,class:"seas",size:10,letterSpacing:1},{text:"INDIAN OCEAN",x:80,y:-25,class:"seas",size:10,letterSpacing:1},{text:"SOUTHERN OCEAN",x:-5,y:-67,class:"seas",size:10,letterSpacing:6}]}},Af={AL:{x:515e4,y:2e6},AT:{x:467e4,y:274e4},BE:{x:393e4,y:306e4},BG:{x:5567e3,y:23e5},HR:{x:4657718,y:2400243},CY:{x:6426e3,y:157e4},CH:{x:417e4,y:26e5},CZ:{x:4707e3,y:295e4},DK:{x:4316e3,y:3621e3},EE:{x:522e4,y:405e4},FI:{x:515e4,y:4424e3},FR:{x:3767740,y:2662817},DE:{x:4347284,y:3093276},EL:{x:537e4,y:175e4},HU:{x:502e4,y:267e4},IS:{x:304e4,y:4833e3},IE:{x:3136e3,y:3394e3},IT:{x:45e5,y:2181963},LV:{x:529e4,y:384e4},LT:{x:519e4,y:367e4},LU:{x:412e4,y:294e4},MT:{x:488e4,y:148e4},GE:{x:6912680,y:2696554},UA:{x:5865507,y:3130158},BA:{x:4959262,y:2368688},MD:{x:5736016,y:2835957},ME:{x:5073e3,y:223e4},MK:{x:53e5,y:213e4},NL:{x:402e4,y:3208e3},NO:{x:43e5,y:4147e3},PL:{x:4964e3,y:32e5},PT:{x:276e4,y:199e4},RO:{x:5451e3,y:26e5},RS:{x:52e5,y:237e4},SK:{x:504e4,y:289e4},SI:{x:466e4,y:255e4},ES:{x:32e5,y:2e6},SE:{x:463e4,y:4e6},TR:{x:651e4,y:21e5},UK:{x:3558e3,y:325e4},RU:{x:6842086,y:3230517}};function kf(t,e,n,i,r,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(i,r)}var Tf=n(756),Pf=n.n(Tf);function Nf(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function Lf(t,e){return fetch(t,e).then(Nf)}function Ff(t){return t}function Of(t,e){return"string"==typeof e&&(e=t.objects[e]),"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map((function(e){return Gf(t,e)}))}:Gf(t,e)}function Gf(t,e){var n=e.id,i=e.bbox,r=null==e.properties?{}:e.properties,a=function(t,e){var n=function(t){if(null==t)return Ff;var e,n,i=t.scale[0],r=t.scale[1],a=t.translate[0],o=t.translate[1];return function(t,s){s||(e=n=0);var l=2,c=t.length,u=new Array(c);for(u[0]=(e+=t[0])*i+a,u[1]=(n+=t[1])*r+o;l<c;)u[l]=t[l],++l;return u}}(t.transform),i=t.arcs;function r(t,e){e.length&&e.pop();for(var r=i[t<0?~t:t],a=0,o=r.length;a<o;++a)e.push(n(r[a],a));t<0&&function(t,e){for(var n,i=t.length,r=i-e;r<--i;)n=t[r],t[r++]=t[i],t[i]=n}(e,o)}function a(t){return n(t)}function o(t){for(var e=[],n=0,i=t.length;n<i;++n)r(t[n],e);return e.length<2&&e.push(e[0]),e}function s(t){for(var e=o(t);e.length<4;)e.push(e[0]);return e}function l(t){return t.map(s)}function c(t){var e,n=t.type;switch(n){case"GeometryCollection":return{type:n,geometries:t.geometries.map(c)};case"Point":e=a(t.coordinates);break;case"MultiPoint":e=t.coordinates.map(a);break;case"LineString":e=o(t.arcs);break;case"MultiLineString":e=t.arcs.map(o);break;case"Polygon":e=l(t.arcs);break;case"MultiPolygon":e=t.arcs.map(l);break;default:return null}return{type:n,coordinates:e}}return c(e)}(t,e);return null==n&&null==i?{type:"Feature",properties:r,geometry:a}:null==i?{type:"Feature",id:n,properties:r,geometry:a}:{type:"Feature",id:n,bbox:i,properties:r,geometry:a}}var Df={2021:{3035:{"03M":{type:"Topology",arcs:[[[3061,1303],[-152,-59],[-32,-66],[-65,72],[-96,7],[-16,59],[-64,19],[-56,-39],[-120,39],[-184,-19],[-16,26],[32,52],[-16,72],[24,40],[8,183]],[[2885,0],[-8,46],[-65,85],[-40,-7],[-40,40],[0,111],[80,13],[25,46],[72,13],[40,98],[-56,118],[144,196],[-24,79],[88,59],[-24,98],[-8,20],[24,39],[8,52],[48,72],[-88,125]],[[825,2638],[-112,-98],[-72,-7],[-88,-118],[-176,-39],[56,-91],[88,-33],[24,-53],[56,-39],[24,-91],[-56,-46],[24,-105],[-56,-92],[-104,0],[-48,-104],[-16,-40],[-57,7],[-40,-53],[-16,-78],[113,-118],[-97,-65],[-88,-99],[-80,20],[-80,-39],[-24,-13]],[[1098,2304],[-193,66],[24,39],[-16,39],[65,13],[0,33],[-65,79],[-88,65]],[[2308,1689],[-153,-20],[-64,59],[-40,7],[-96,-27],[-104,138],[-8,92],[-32,78],[-64,26],[-32,-59],[-24,0],[-56,86],[-40,137],[-25,65],[-56,0],[-56,46],[-64,-72],[-120,53],[-88,-40],[-88,46]]],transform:{scale:[37.761044752777565,38.54734205626113],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:1000004,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:1000005,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:1000001,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:1000002,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:1000003,lvl:1,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"10M":{type:"Topology",arcs:[[[962,0],[-29,75],[48,131],[21,35],[11,38],[32,117],[-24,44]],[[1021,440],[-64,-29],[-70,36],[-120,2],[3,121]],[[770,570],[-126,16],[-40,91],[-45,4],[-51,93],[-142,4]],[[275,891],[-131,-99],[30,-36],[24,-31],[-6,-86],[-98,-86],[13,-64],[-27,-38],[-80,-31]],[[366,778],[-37,22],[-54,91]]],transform:{scale:[113.2099448513097,114.12782081303801],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:1000005,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[1],properties:{id:1000004,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[2],properties:{id:1000003,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[3],properties:{id:1000001,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[4],properties:{id:1000002,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}}]}}},"20M":{type:"Topology",arcs:[[[536,0],[-24,45],[15,30],[45,92],[-1,44],[-2,37]],[[569,248],[-130,9],[-10,64]],[[429,321],[-64,10],[-78,94],[-83,13]],[[153,502],[-73,-51],[26,-84],[-48,-53],[-3,-52],[-55,-25]],[[204,438],[-51,64]]],transform:{scale:[203.12309601494124,202.56551463031246],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:1000005,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[1],properties:{id:1000004,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[2],properties:{id:1000003,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[3],properties:{id:1000001,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[4],properties:{id:1000002,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}}]}}},"60M":{type:"Topology",arcs:[[[310,138],[-36,-2],[-40,42]],[[234,178],[-123,65]],[[84,278],[-84,-147]],[[111,243],[-27,35]],[[292,0],[18,138]]],transform:{scale:[372.84281730215633,364.87611898580536],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:1000004,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[1],properties:{id:1000003,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[2],properties:{id:1000001,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[3],properties:{id:1000002,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}},{type:"LineString",arcs:[4],properties:{id:1000005,lvl:1,eu:"F",efta:"F",cc:"T",oth:"T",co:"F"}}]}}}},4326:{"03M":{type:"Topology",arcs:[[[1900,1275],[-30,27],[-27,-13],[-34,23],[-87,6],[25,59],[1,70],[20,34],[24,167]],[[1792,1648],[-116,1],[-62,77],[-89,-8],[-60,148],[7,86],[-4,15],[-13,60],[-45,28],[-33,-48],[-26,4],[-31,142],[-11,53],[5,43],[-19,44],[-39,8],[-40,49],[-52,-59],[-93,71],[-38,-6],[-16,-26]],[[945,2388],[-54,27],[-20,28],[-22,-3],[-17,22],[-25,1],[-10,10],[4,17],[27,14],[-15,29],[1,16],[68,1],[-8,16],[-5,30],[-14,29],[-27,42],[-25,22],[-30,41]],[[773,2730],[-89,-69],[-64,-4],[-82,-92],[-133,-15],[27,-93],[64,-43],[16,-50],[38,-44],[9,-75],[-48,-51],[5,-41],[6,-50],[-52,-84],[-78,14],[-35,-66],[-33,-61],[-45,11],[-35,-42],[-18,-72],[33,-71],[48,-55]],[[1017,2330],[-72,58]],[[307,1677],[-36,-12],[-25,-21],[-26,-10],[-76,-90],[-17,4],[-30,31],[-52,-14],[-26,-23],[-19,1]],[[2319,1185],[-116,-32],[-39,-52],[-42,70],[-68,23],[-12,58],[-43,23],[-42,-23],[-57,23]],[[2044,0],[-4,43],[-38,82],[-34,9],[-24,43],[13,97],[61,4],[32,41],[49,0],[37,82],[-26,118],[130,167],[-8,73],[74,46],[-2,18],[-9,92],[24,35],[7,49],[48,52],[-55,134]]],transform:{scale:[.0006038339283908974,.00036983475567765975],translate:[20.35292839300007,42.26281764300006]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000002,co:"F",oth:"F"}},{type:"LineString",arcs:[1],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000001,co:"F",oth:"F"}},{type:"LineString",arcs:[2],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000003,co:"F",oth:"F"}},{type:"LineString",arcs:[3],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000004,co:"F",oth:"F"}},{type:"LineString",arcs:[4],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000005,co:"F",oth:"F"}},{type:"LineString",arcs:[5],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000006,co:"F",oth:"F"}},{type:"LineString",arcs:[6],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000007,co:"F",oth:"F"}},{type:"LineString",arcs:[7],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000008,co:"F",oth:"F"}}]}}},"10M":{type:"Topology",arcs:[[[659,439],[-54,17],[17,111]],[[622,567],[-93,31],[-25,92],[-36,11],[-29,97],[-23,1],[-63,3]],[[328,822],[-33,74],[-27,44]],[[268,940],[-72,-44],[-38,-31],[27,-86],[-14,-65],[-81,-78],[16,-58]],[[353,802],[-25,20]],[[106,578],[-41,-19],[-65,-28]],[[805,408],[-54,-21],[-92,52]],[[709,0],[-22,72],[0,17],[40,36],[18,67],[53,101],[16,64],[-9,51]]],transform:{scale:[.001740521547911524,.0010740945563829907],translate:[20.35292839300007,42.26281764300006]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000002,co:"F",oth:"F"}},{type:"LineString",arcs:[1],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000003,co:"F",oth:"F"}},{type:"LineString",arcs:[2],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000004,co:"F",oth:"F"}},{type:"LineString",arcs:[3],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000005,co:"F",oth:"F"}},{type:"LineString",arcs:[4],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000006,co:"F",oth:"F"}},{type:"LineString",arcs:[5],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000007,co:"F",oth:"F"}},{type:"LineString",arcs:[6],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000001,co:"F",oth:"F"}},{type:"LineString",arcs:[7],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000008,co:"F",oth:"F"}}]}}},"20M":{type:"Topology",arcs:[[[380,252],[-21,26],[0,48]],[[359,326],[-49,17],[-56,107],[-51,11]],[[189,472],[-34,68]],[[155,540],[-66,-39],[18,-66],[-54,-68],[8,-35]],[[61,332],[-21,-13],[-10,-12],[-13,5],[-17,-7]],[[464,234],[-84,18]],[[409,0],[-14,46],[61,110],[8,78]]],transform:{scale:[.003018276831896498,.0018697201537037245],translate:[20.35292839300007,42.26281764300006]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000002,co:"F",oth:"F"}},{type:"LineString",arcs:[1],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000003,co:"F",oth:"F"}},{type:"LineString",arcs:[2],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000004,co:"F",oth:"F"}},{type:"LineString",arcs:[3],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000005,co:"F",oth:"F"}},{type:"LineString",arcs:[4],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000007,co:"F",oth:"F"}},{type:"LineString",arcs:[5],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000001,co:"F",oth:"F"}},{type:"LineString",arcs:[6],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000008,co:"F",oth:"F"}}]}}},"60M":{type:"Topology",arcs:[[[235,156],[-13,46]],[[222,202],[-96,84]],[[117,293],[-21,42]],[[96,335],[-58,-129]],[[126,286],[-9,7]],[[38,206],[-38,-17]],[[287,145],[-52,11]],[[253,0],[34,145]]],transform:{scale:[.004879722822299564,.0030138772626866006],translate:[20.352928393000074,42.26281764300006]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000002,co:"F",oth:"F"}},{type:"LineString",arcs:[1],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000003,co:"F",oth:"F"}},{type:"LineString",arcs:[2],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000004,co:"F",oth:"F"}},{type:"LineString",arcs:[3],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000005,co:"F",oth:"F"}},{type:"LineString",arcs:[4],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000006,co:"F",oth:"F"}},{type:"LineString",arcs:[5],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000001,co:"F",oth:"F"}},{type:"LineString",arcs:[6],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000007,co:"F",oth:"F"}},{type:"LineString",arcs:[7],properties:{eu:"F",efta:"F",cc:"T",lvl:0,id:1000008,co:"F",oth:"F"}}]}}}}},2024:{3035:{"03M":{type:"Topology",arcs:[[[728,1508],[-48,12],[-22,18],[-15,-5],[-16,13],[-22,-4],[-10,8],[0,13],[21,13],[-16,17],[0,13],[58,9],[-5,8],[-10,22],[-16,17],[-27,25],[-21,13],[-32,26]],[[1912,0],[-6,30],[-42,51],[-32,0],[-21,30],[0,69],[53,8],[21,35],[43,4],[26,60],[-37,81],[96,129],[-16,51],[58,43],[0,9],[-21,64],[16,26],[5,34],[32,43],[-58,85]],[[250,942],[-27,-13],[-21,-17],[-21,-8],[-59,-73],[-16,0],[-26,17],[-43,-13],[-21,-21],[-16,0]],[[1657,861],[-27,13],[-21,-13],[-32,13],[-74,-9],[16,47],[-6,47],[11,26],[5,120]],[[1529,1105],[-100,-17],[-64,47],[-75,-17],[-63,94],[-6,60],[-5,13],[-16,38],[-42,13],[-22,-38],[-21,0],[-42,94],[-16,34],[0,30],[-21,30],[-32,0],[-38,30],[-42,-47],[-85,39],[-32,-9],[-10,-21]],[[547,1726],[-69,-60],[-53,-13],[-59,-73],[-111,-25],[32,-60],[58,-22],[16,-34],[37,-26],[16,-51],[-37,-39],[5,-30],[11,-34],[-37,-64],[-64,4],[-26,-51],[-22,-47],[-42,4],[-21,-34],[-11,-52],[37,-47],[43,-30]],[[797,1478],[-69,30]],[[2029,852],[-96,-38],[-32,-39],[-42,43],[-59,4],[-16,39],[-42,13],[-32,-22],[-53,9]]],transform:{scale:[56.97629608361119,58.91534666536319],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"10M":{type:"Topology",arcs:[[[242,508],[-33,47],[-27,27]],[[637,0],[-25,46],[-2,12],[30,29],[7,47],[34,75],[7,45],[-12,33]],[[83,318],[-32,-18],[-51,-26]],[[552,290],[-46,5],[3,78]],[[509,373],[-79,8],[-30,59],[-30,3],[-34,62],[-19,-1],[-52,-6]],[[182,582],[-55,-39],[-28,-25],[30,-56],[-5,-45],[-59,-62],[18,-37]],[[265,498],[-23,10]],[[676,287],[-43,-21],[-81,24]]],transform:{scale:[171.07449827433382,174.72145763645509],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"20M":{type:"Topology",arcs:[[[50,191],[-17,-11],[-8,-10],[-11,1],[-14,-6]],[[305,224],[-44,6],[-58,68],[-44,2]],[[109,350],[-52,-36],[21,-45],[-38,-54],[10,-24]],[[159,300],[-14,6]],[[145,306],[-36,44]],[[381,0],[-17,31],[41,85],[-1,57]],[[404,173],[-74,2]],[[330,175],[-20,15],[-5,34]]],transform:{scale:[286.13294356075795,290.536823841191],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"60M":{type:"Topology",arcs:[[[258,111],[-47,1]],[[32,123],[-32,-17]],[[211,112],[-16,32]],[[195,144],[-94,49]],[[70,225],[-38,-102]],[[101,193],[-8,4]],[[93,197],[-23,28]],[[243,0],[15,111]]],transform:{scale:[447.98943164212585,451.9461704196305],translate:[5167020.037451873,2202278.5103255166]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}}},4326:{"03M":{type:"Topology",arcs:[[[1543,0],[-4,32],[-28,65],[-24,5],[-19,33],[10,70],[47,5],[23,33],[38,0],[28,59],[-19,92],[94,124],[-5,54],[56,37],[0,11],[-9,70],[19,27],[4,38],[38,38],[-42,102]],[[1750,895],[-85,-27],[-32,-37],[-29,54],[-56,16],[-5,43],[-32,16],[-33,-16],[-43,16]],[[1435,960],[-23,22],[-19,-11],[-28,16],[-66,5],[19,44],[0,54],[14,26],[19,125]],[[230,1262],[-24,-5],[-23,-16],[-19,-11],[-56,-65],[-14,0],[-24,27],[-37,-11],[-19,-21],[-14,5]],[[1351,1241],[-84,0],[-47,59],[-71,-6],[-42,114],[5,64],[-5,11],[-9,43],[-33,22],[-24,-38],[-23,6],[-23,108],[-5,37],[0,33],[-14,32],[-28,5],[-29,38],[-42,-43],[-70,54],[-28,-5],[-10,-22]],[[582,2055],[-66,-49],[-47,-5],[-61,-70],[-103,-11],[19,-70],[51,-32],[10,-38],[28,-32],[9,-54],[-37,-44],[4,-26],[5,-38],[-37,-65],[-61,11],[-29,-49],[-23,-48],[-33,11],[-28,-33],[-14,-54],[28,-54],[33,-43]],[[769,1753],[-56,48]],[[713,1801],[-42,17],[-14,21],[-19,0],[-9,16],[-19,0],[-10,6],[5,16],[19,11],[-9,21],[0,11],[51,0],[-5,11],[-4,22],[-10,26],[-23,27],[-19,22],[-23,27]]],transform:{scale:[.0007994261320208862,.0004913384355349169],translate:[20.35361768088405,42.262163108155406]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"10M":{type:"Topology",arcs:[[[539,0],[-17,52],[0,13],[30,27],[13,48],[41,74],[13,47],[-8,38]],[[611,299],[-41,-16],[-69,37]],[[501,320],[-41,13],[12,81]],[[80,421],[-31,-12],[-49,-20]],[[472,414],[-71,24],[-18,66],[-28,7],[-21,72],[-18,0],[-47,2]],[[203,686],[-54,-32],[-29,-22],[21,-63],[-12,-47],[-60,-57],[11,-44]],[[269,585],[-20,16]],[[249,601],[-25,53],[-21,32]]],transform:{scale:[.002290098349828638,.0014718665962452685],translate:[20.35361768088405,42.262163108155406]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"20M":{type:"Topology",arcs:[[[337,0],[-12,36],[51,84],[6,62]],[[382,182],[-69,13]],[[313,195],[-17,20],[-1,37]],[[50,256],[-17,-10],[-8,-8],[-11,3],[-14,-5]],[[295,252],[-40,13],[-46,82],[-41,9]],[[127,417],[-54,-30],[15,-51],[-44,-53],[6,-27]],[[168,356],[-12,10]],[[156,366],[-29,51]]],transform:{scale:[.0036618323062750017,.0024213440887871805],translate:[20.35361768088405,42.262163108155406]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}},"60M":{type:"Topology",arcs:[[[220,0],[29,116]],[[249,116],[-45,8]],[[204,124],[-12,37]],[[192,161],[-83,66]],[[109,227],[-8,6]],[[33,163],[-33,-12]],[[83,266],[-50,-103]],[[101,233],[-18,33]]],transform:{scale:[.005617750767056427,.003795866485053587],translate:[20.35361768088405,42.262163108155406]},objects:{nutsbn_1:{type:"GeometryCollection",geometries:[{type:"LineString",arcs:[0],properties:{id:"1000008",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[1],properties:{id:"1000007",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[2],properties:{id:"1000002",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[3],properties:{id:"1000003",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[4],properties:{id:"1000006",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[5],properties:{id:"1000001",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[6],properties:{id:"1000005",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}},{type:"LineString",arcs:[7],properties:{id:"1000004",lvl:0,eu:"F",efta:"F",cc:"T",oth:"F",co:"F"}}]}}}}}};function zf(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(r);++i<r;)a[i]=t+i*n;return a}function If(t,e,n){var i=zf(t,e-xa,n).concat(e);return function(t){return i.map((function(e){return[t,e]}))}}function Rf(t,e,n){var i=zf(t,e-xa,n).concat(e);return function(t){return i.map((function(e){return[e,t]}))}}function jf(){var t,e,n,i,r,a,o,s,l,c,u,h,f=10,p=f,d=90,g=360,_=2.5;function m(){return{type:"MultiLineString",coordinates:v()}}function v(){return zf(La(i/d)*d,n,d).map(u).concat(zf(La(s/g)*g,o,g).map(h)).concat(zf(La(e/f)*f,t,f).filter((function(t){return ka(t%d)>xa})).map(l)).concat(zf(La(a/p)*p,r,p).filter((function(t){return ka(t%g)>xa})).map(c))}return m.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},m.outline=function(){return{type:"Polygon",coordinates:[u(i).concat(h(o).slice(1),u(n).reverse().slice(1),h(s).reverse().slice(1))]}},m.extent=function(t){return arguments.length?m.extentMajor(t).extentMinor(t):m.extentMinor()},m.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],i>n&&(t=i,i=n,n=t),s>o&&(t=s,s=o,o=t),m.precision(_)):[[i,s],[n,o]]},m.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],r=+n[1][1],e>t&&(n=e,e=t,t=n),a>r&&(n=a,a=r,r=n),m.precision(_)):[[e,a],[t,r]]},m.step=function(t){return arguments.length?m.stepMajor(t).stepMinor(t):m.stepMinor()},m.stepMajor=function(t){return arguments.length?(d=+t[0],g=+t[1],m):[d,g]},m.stepMinor=function(t){return arguments.length?(f=+t[0],p=+t[1],m):[f,p]},m.precision=function(f){return arguments.length?(_=+f,l=If(a,r,90),c=Rf(e,t,_),u=If(s,o,90),h=Rf(i,n,_),m):_},m.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function Bf(t){return new Promise(((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)}))}function qf(t,e){let n;return(i,r)=>(()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=Bf(i),n.then((t=>{t.onclose=()=>n=void 0}),(()=>{})),n})().then((t=>r(t.transaction(e,i).objectStore(e))))}let Uf;function Wf(){return Uf||(Uf=qf("keyval-store","keyval")),Uf}function Hf(t,e=Wf()){return e("readonly",(e=>Bf(e.get(t))))}function Vf(t,e,n=Wf()){return n("readwrite",(n=>(n.put(e,t),Bf(n.transaction))))}var $f=function(t,e){var n={};return n.defaultGeoData=void 0,n.allNUTSGeoData=void 0,n.geoJSONs={mixed:{rg0:void 0,rg1:void 0,rg2:void 0,rg3:void 0},cntbn:void 0,cntrg:void 0,nutsbn:void 0,nutsrg:void 0,gra:void 0,worldrg:void 0,worldbn:void 0,kosovo:void 0},n.userGeometries=void 0,n.statisticalRegions=void 0,n.centroidsData=void 0,n.centroidsFeatures=void 0,n._allCentroidsFeatures=void 0,n.getRegionFeatures=function(){return"WORLD"==t.geo_?n.geoJSONs.worldrg:"mixed"===t.nutsLevel_?[n.geoJSONs.mixed.rg0,n.geoJSONs.mixed.rg1,n.geoJSONs.mixed.rg2,n.geoJSONs.mixed.rg3]:n.geoJSONs.nutsrg.concat(n.geoJSONs.cntrg)},n.getDefaultGeoData=function(t,i,r){var a=n.getDefaultGeoDataPromise();return Promise.all(a).then((function(a){return i&&(a=i(a)),n.allNUTSGeoData=a,n.defaultGeoData=a[0],e&&(n.centroidsData="mixed"===r?[a[4],a[5],a[6],a[7]]:a[1]),"WORLD"===t?(n.geoJSONs.worldrg=Of(n.defaultGeoData,n.defaultGeoData.objects.CNTR_RG_20M_2020_4326).features,n.geoJSONs.worldbn=Of(n.defaultGeoData,n.defaultGeoData.objects.CNTR_BN_20M_2020_4326).features,n.geoJSONs.kosovo=Of(n.defaultGeoData,n.defaultGeoData.objects.NUTS_BN_20M_2021_RS_XK_border).features,n.geoJSONs.graticule=[jf().step([30,30])()]):(n.geoJSONs.graticule=Of(n.defaultGeoData,n.defaultGeoData.objects.gra).features,n.geoJSONs.nutsrg=Of(n.defaultGeoData,n.defaultGeoData.objects.nutsrg).features,n.geoJSONs.nutsbn=Of(n.defaultGeoData,n.defaultGeoData.objects.nutsbn).features,n.geoJSONs.cntrg=Of(n.defaultGeoData,n.defaultGeoData.objects.cntrg).features,n.geoJSONs.cntbn=Of(n.defaultGeoData,n.defaultGeoData.objects.cntbn).features),a})).catch((function(t){return Promise.reject(t)}))},n.getDefaultGeoDataPromise=function(){var n=[0,1,2,3],i=[],r=function(t,e,n,i,r,a){var o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],s="".concat(t,"/").concat(e);return n&&"EUR"!==n&&"WORLD"!==n&&(s+="/".concat(n)),s+="/".concat("WORLD"==n?"4326":i),!o&&r&&(s+="/".concat(r)),s+="/".concat(o?"nutspt_":"").concat(a,".json")},a=function(){var t=function(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var a=t.apply(e,n);function o(t){kf(a,i,r,o,s,"next",t)}function s(t){kf(a,i,r,o,s,"throw",t)}o(void 0)}))}}(Pf().mark((function t(e){var n,i,r,a,o;return Pf().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="geojson-cache:".concat(e),t.prev=1,t.next=4,Hf(n);case 4:if(!(i=t.sent)){t.next=10;break}if(r=i.timestamp,a=i.data,!(Date.now()-r<864e5)){t.next=10;break}return t.abrupt("return",a);case 10:t.next=16;break;case 12:throw t.prev=12,t.t0=t.catch(1),console.warn("Error reading from IndexedDB cache for ".concat(e,":"),t.t0),t.t0;case 16:return t.next=18,Lf(e);case 18:return o=t.sent,t.prev=19,t.next=22,Vf(n,{timestamp:Date.now(),data:o});case 22:t.next=28;break;case 24:throw t.prev=24,t.t1=t.catch(19),console.warn("Could not cache data in IndexedDB for ".concat(e,":"),t.t1),t.t1;case 28:return t.abrupt("return",o);case 29:case"end":return t.stop()}}),t,null,[[1,12],[19,24]])})));return function(e){return t.apply(this,arguments)}}();if(!t||!t.nuts2jsonBaseURL_)throw new Error("Missing required map context or configuration");if("mixed"===t.nutsLevel_&&"WORLD"!==t.geo_)n.forEach((function(e){var n=r(t.nuts2jsonBaseURL_,t.nutsYear_,t.geo_,t.proj_,t.scale_,e);i.push(a(n))})),e&&n.forEach((function(e){var n=r(t.nuts2jsonBaseURL_,t.nutsYear_,t.geo_,t.proj_,t.scale_,e,!0);i.push(a(n))}));else if("WORLD"===t.geo_){var o=window.location.hostname.includes("ec.europa.eu")?"https://ec.europa.eu/assets/estat/E/E4/gisco/IMAGE/WORLD_4326.json":"https://raw.githubusercontent.com/eurostat/eurostat-map/master/src/assets/topojson/WORLD_4326.json";i.push(a(o))}else{var s=r(t.nuts2jsonBaseURL_,t.nutsYear_,t.geo_,t.proj_,t.scale_,t.nutsLevel_);if(i.push(a(s)),e){var l=r(t.nuts2jsonBaseURL_,t.nutsYear_,t.geo_,t.proj_,t.scale_,t.nutsLevel_,!0);i.push(a(l))}}return i},n.isGeoReady=function(){if(!n.defaultGeoData&&!n.userGeometries)return!1;var e=!0;return ua(t.insetTemplates_,null,(function(t){t.Geometries.isGeoReady()||(e=!1)})),e},n.setUserGeometries=function(t){var e=this;this.userGeometries=t,t.forEach((function(t){t.statisticalRegions&&(e.statisticalRegions=t)}))},n.addDefaultGeometriesToMap=function(t,e,i,r,a,o,s,l){this.geoJSONs.graticule&&e&&t.append("g").attr("id","em-graticule").attr("class","em-graticule").selectAll("path").data(this.geoJSONs.graticule).enter().append("path").attr("d",i),this.geoJSONs.cntrg&&t.append("g").attr("id","em-cntrg").attr("class","em-cntrg").selectAll("path").data(this.geoJSONs.cntrg).enter().append("path").attr("d",i).attr("id",(function(t){var e=t.properties.id;if("RS"==e||"EL"==e)return"em-cntrg-"+e})),this.geoJSONs.worldrg&&t.append("g").attr("id","em-worldrg").attr("class","em-worldrg").selectAll("path").data(this.geoJSONs.worldrg).enter().append("path").attr("d",i),this.geoJSONs.nutsrg&&("mixed"==r?(this.geoJSONs.mixed.rg0=this.geoJSONs.nutsrg,this.geoJSONs.mixed.rg1=Of(n.allNUTSGeoData[1],n.allNUTSGeoData[1].objects.nutsrg).features,this.geoJSONs.mixed.rg2=Of(n.allNUTSGeoData[2],n.allNUTSGeoData[2].objects.nutsrg).features,this.geoJSONs.mixed.rg3=Of(n.allNUTSGeoData[3],n.allNUTSGeoData[3].objects.nutsrg).features,[this.geoJSONs.mixed.rg0,this.geoJSONs.mixed.rg1,this.geoJSONs.mixed.rg2,this.geoJSONs.mixed.rg3].forEach((function(e,n){t.append("g").attr("id","em-nutsrg").attr("class","em-nutsrg em-nutsrg-".concat(n)).selectAll("path").data(e).enter().append("path").attr("d",i).attr("lvl",n)})),"EUR"!=o||"3035"!=s&&"4326"!=s||function(t,e,n,i,r){var a=Df[r]?Df[r][n][i]:Df[2024][n][i],o=Of(a,"nutsbn_1").features;t.append("g").attr("id","em-kosovo-bn").attr("class","em-kosovo-bn em-bn-cc").selectAll("path").data(o).enter().append("path").attr("d",e)}(t,i,s,l,a)):t.append("g").attr("id","em-nutsrg").attr("class","em-nutsrg").selectAll("path").data(this.geoJSONs.nutsrg).enter().append("path").attr("d",i)),this.geoJSONs.cntbn&&t.append("g").attr("id","em-cntbn").attr("class","em-cntbn").selectAll("path").data(this.geoJSONs.cntbn).enter().append("path").filter((function(t){return"T"==t.properties.eu||"T"==t.properties.efta||"T"==t.properties.cc||"T"==t.properties.oth||"T"==t.properties.co?t:void 0})).attr("d",i).attr("id",(function(t){return"em-bn-"+t.properties.id})).attr("class",(function(t){var e=[];return"T"===t.properties.eu&&e.push("em-bn-eu"),"T"===t.properties.efta&&e.push("em-bn-efta"),"T"===t.properties.cc&&e.push("em-bn-cc"),"T"===t.properties.oth&&e.push("em-bn-oth"),"T"===t.properties.co&&e.push("em-bn-co"),e.join(" ")})),this.geoJSONs.nutsbn&&"mixed"!==r&&(this.geoJSONs.nutsbn.sort((function(t,e){return e.properties.lvl-t.properties.lvl})),t.append("g").attr("id","em-nutsbn").attr("class","em-nutsbn").selectAll("path").data(this.geoJSONs.nutsbn).enter().filter((function(t){return"T"==t.properties.eu||"T"==t.properties.efta||"T"==t.properties.cc||"T"==t.properties.oth||"T"==t.properties.co?t:void 0})).append("path").attr("d",i).attr("class",(function(t){var e=t.properties;return e.id>1e5?"em-kosovo-bn":"T"===e.co?"em-bn-co":["em-bn-"+e.lvl].join(" ")}))),this.geoJSONs.worldbn&&t.append("g").attr("id","em-worldbn").attr("class","em-worldbn").selectAll("path").data(this.geoJSONs.worldbn).enter().append("path").attr("d",i).attr("class",(function(t){return t.properties.POL_STAT>0?"em-bn-d":"T"===t.properties.COAS_FLAG?"em-bn-co":"em-worldbn"})),this.geoJSONs.kosovo&&t.append("g").attr("id","em-kosovo-bn").attr("class","em-kosovo-bn").selectAll("path").data(this.geoJSONs.kosovo).enter().append("path").attr("d",i)},n.addUserGeometriesToMap=function(t,e,n){t.forEach((function(t){var i=e.append("g").attr("id",t.statisticalRegions?"em-user-regions":"").attr("class",t.class?t.class:"").selectAll("path").data(t.features).enter().append("path").attr("d",n);"function"==typeof t.onEach&&t.onEach(i)}))},n},Jf=function(t,e,n){var i=Jm(t,n);for(var r in(t=t||{}).proj=t.proj||Xf[t.geo],t.scale=t.scale||e.insetScale_,t.footnote=t.footnote||"",t.showSourceLink=t.showSourceLink||!1,t.zoomExtent=t.zoomExtent||e.insetZoomExtent_,t.width=t.width||e.insetBoxWidth_,t.height=t.height||e.insetBoxWidth_,t.insets=t.insets||[],t.insetTemplates=t.insetTemplates||{},t.callback=t.callback||void 0,["nutsLevel_","nutsYear_","hoverColor_","cntrgFillStyle_","cntbnStroke_","cntbnStrokeWidth_","seaFillStyle_","drawCoastalMargin_","coastalMarginColor_","coastalMarginWidth_","coastalMarginStdDev_","graticuleStroke_","graticuleStrokeWidth_","lg_","projectionFunction_","filterGeometriesFunction_","processCentroids_"].forEach((function(t){i[t]=e[t]})),["stat","statData","legend","legendObj","noDataText","language","transitionDuration","tooltip_","classToText_"].forEach((function(t){i[t]=e[t]})),t)i[r+"_"]=t[r];return i.isInset=!0,i},Yf=function(t,e){for(var n=[{geo:"IC",x:0,y:0,width:t,height:.3*t},{geo:"CARIB",x:0,y:.3*t+e,width:.5*t,height:t},{geo:"GF",x:.5*t,y:.3*t+e,width:.5*t,height:.75*t},{geo:"YT",x:.5*t,y:1.05*t+e,width:.25*t,height:.25*t},{geo:"RE",x:.75*t,y:1.05*t+e,width:.25*t,height:.25*t},{geo:"PT20",x:0,y:1.3*t+2*e,width:.75*t,height:.25*t},{geo:"PT30",x:.75*t,y:1.3*t+2*e,width:.25*t,height:.25*t},{geo:"MT",x:0,y:1.55*t+3*e,width:.25*t,height:.25*t},{geo:"LI",x:.25*t,y:1.55*t+3*e,width:.25*t,height:.25*t},{geo:"SJ_SV",x:.5*t,y:1.55*t+3*e,width:.25*t,height:.25*t},{geo:"SJ_JM",x:.75*t,y:1.55*t+3*e,width:.25*t,height:.25*t}],i=0;i<n.length;i++)n[i].drawGraticule=!1;return n},Xf={EUR:"3035",IC:"32628",GP:"32620",MQ:"32620",GF:"32622",RE:"32740",YT:"32738",MT:"3035",PT20:"32626",PT30:"32628",LI:"3035",IS:"3035",SJ_SV:"3035",SJ_JM:"3035",CARIB:"32620",WORLD:"54030"},Kf=function(t,e){if(e.svg_&&(e.svg_.select("#em-stamp").remove(),t)){var n=e.svg_.append("g").attr("id","em-stamp");t.size||(t.size=60),t.x||(t.x=230),t.y||(t.y=100),t.textColor||(t.textColor="#000"),t.stampColor||(t.stampColor="#000"),t.strokeWidth||(t.strokeWidth=1),t.lineHeight||(t.lineHeight=15),n.append("circle").attr("r",t.size).attr("cx",t.x).attr("cy",t.y).attr("id","em-stamp-circle").attr("fill","none").attr("stroke",t.stampColor).attr("stroke-width",t.strokeWidth);var i=t.text,r=Math.sqrt(Qf(i.trim())*t.lineHeight),a=ep(Zf(i.trim()),r),o=tp(a,t.lineHeight);n.append("text").attr("text-anchor","middle").attr("fill",t.textColor).attr("id","em-stamp-text").attr("transform","translate(".concat(t.x,",").concat(t.y,") scale(").concat(t.size/o,")")).selectAll("tspan").data(a).enter().append("tspan").attr("x",0).attr("y",(function(e,n){return(n-a.length/2+.8)*t.lineHeight})).text((function(t){return t.text.replaceAll("~"," ").replaceAll("¶","")}))}},Zf=function(t){return t.split(/(?<=¶)|\s+/g).map((function(t){return t.trim()})).filter((function(t){return t.length>0}))},Qf=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg"),n=document.createElementNS("http://www.w3.org/2000/svg","text");n.textContent=t,e.appendChild(n),document.body.appendChild(e);var i=n.getComputedTextLength();return document.body.removeChild(e),i+10},tp=function(t,e){for(var n=0,i=0,r=t.length;i<r;++i){var a=(Math.abs(i-r/2+.5)+.5)*e,o=t[i].width/2;n=Math.max(n,Math.sqrt(Math.pow(o,2)+Math.pow(a,2)))}return n},ep=function(t,e){for(var n=[],i={width:0,text:""},r=0,a=t.length;r<a;++r)if("¶"!==t[r]){var o=(i.text?i.text+" ":"")+t[r],s=Qf(o);(i.width+s)/2<e?(i.width=s,i.text=o):(n.push(i),i={width:Qf(t[r]),text:t[r]})}else i.text&&n.push(i),i={width:0,text:""};return i.text&&n.push(i),n},np={},ip={};function rp(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function ap(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var i in t)i in e||n.push(e[i]=i)})),n}function op(t,e){var n=t+"",i=n.length;return i<e?new Array(e-i+1).join(0)+n:n}function sp(t){var e,n=t.getUTCHours(),i=t.getUTCMinutes(),r=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+op(-e,6):e>9999?"+"+op(e,6):op(e,4))+"-"+op(t.getUTCMonth()+1,2)+"-"+op(t.getUTCDate(),2)+(a?"T"+op(n,2)+":"+op(i,2)+":"+op(r,2)+"."+op(a,3)+"Z":r?"T"+op(n,2)+":"+op(i,2)+":"+op(r,2)+"Z":i||n?"T"+op(n,2)+":"+op(i,2)+"Z":"")}function lp(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function i(t,e){var i,r=[],a=t.length,o=0,s=0,l=a<=0,c=!1;function u(){if(l)return ip;if(c)return c=!1,np;var e,i,r=o;if(34===t.charCodeAt(r)){for(;o++<a&&34!==t.charCodeAt(o)||34===t.charCodeAt(++o););return(e=o)>=a?l=!0:10===(i=t.charCodeAt(o++))?c=!0:13===i&&(c=!0,10===t.charCodeAt(o)&&++o),t.slice(r+1,e-1).replace(/""/g,'"')}for(;o<a;){if(10===(i=t.charCodeAt(e=o++)))c=!0;else if(13===i)c=!0,10===t.charCodeAt(o)&&++o;else if(i!==n)continue;return t.slice(r,e)}return l=!0,t.slice(r,a)}for(10===t.charCodeAt(a-1)&&--a,13===t.charCodeAt(a-1)&&--a;(i=u())!==ip;){for(var h=[];i!==np&&i!==ip;)h.push(i),i=u();e&&null==(h=e(h,s++))||r.push(h)}return r}function r(e,n){return e.map((function(e){return n.map((function(t){return o(e[t])})).join(t)}))}function a(e){return e.map(o).join(t)}function o(t){return null==t?"":t instanceof Date?sp(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,r,a=i(t,(function(t,i){if(n)return n(t,i-1);r=t,n=e?function(t,e){var n=rp(t);return function(i,r){return e(n(i),r,t)}}(t,e):rp(t)}));return a.columns=r||[],a},parseRows:i,format:function(e,n){return null==n&&(n=ap(e)),[n.map(o).join(t)].concat(r(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=ap(t)),r(t,e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}var cp=lp(","),up=cp.parse,hp=cp.parseRows,fp=(cp.format,cp.formatBody,cp.formatRows,cp.formatRow,cp.formatValue,function(t){return t.gridCartogramPositions_||("hexagon"===t.gridCartogramShape_?"\n ,IS, , , , , , , , , , ,\n , , , ,NO,SE,FI,EE, , , , ,\n , , , , , , ,LV, , , , ,\n ,IE,UK, , ,DK, ,LT, , , , ,\n , , , ,NL,DE,PL, , , , , ,\n , , ,BE,LU,CZ,SK,UA, , , , ,\n , ,FR,CH,LI,AT,HU,RO,MD, , , ,\n ,PT,ES, ,IT,SI,HR,RS,BG, , , ,\n , , , , , ,BA,ME,MK, , , , \n , , , , , , ,AL,EL,TR,GE, , \n , , , ,MT, , , , ,CY, , , ":"\n ,IS, , ,NO,SE,FI, , , , , ,\n , , , , , , ,EE, , , , ,\n , , , , , , ,LV, , , , ,\n ,IE,UK, , ,DK, ,LT, , , , ,\n , , , ,NL,DE,PL, , , , , ,\n , , ,BE,LU,CZ,SK,UA, , , , ,\n , ,FR,CH,LI,AT,HU,RO,MD, , , ,\n ,PT,ES, ,IT,SI,HR,RS,BG, , , ,\n , , , , , ,BA,ME,MK, , , , \n , , , , , , ,AL,EL,TR,GE, , \n , , , ,MT, , , , ,CY, , , ")}),pp=function(t){var e=new Map;return hp(t.trim(),(function(t,n){t.forEach((function(t,i){(t=t.trim())&&e.set(t,[i,n])}))})),e},dp=function(t,e){return Array.from(t,(function(t){var n=v(t,2),i=n[0],r=v(n[1],2),a=r[0],o=r[1],s=e.Geometries.geoJSONs.nutsrg.find((function(t){return t.properties.id==i}));return{id:i,col:a,row:o,properties:{id:i,name:s?s.properties.na:""}}}))},gp=function(t,e,n){var i=Math.max.apply(Math,y(e.map((function(t){return t.col}))))+1,r=Math.max.apply(Math,y(e.map((function(t){return t.row}))))+1,a=n.gridCartogramMargins_,o=n.gridCartogramCellPadding_||0,s=(n.width_-a.left-a.right)/i-o,l=(n.height_-a.top-a.bottom)/r-o,c=Math.min(s,l);t.selectAll(".em-grid-cell").data(e).enter().append("g").attr("class","em-grid-cell").attr("transform",(function(t){return"translate(".concat(t.col*(c+o)+a.left,", ").concat(t.row*(c+o)+a.top,")")})).each((function(t){Ft(this).append("rect").attr("width",c).attr("height",c).attr("class","em-grid-rect"),Ft(this).append("text").attr("class","em-grid-text").attr("text-anchor","middle").attr("font-size",15).style("pointer-events","none").attr("fill","black").text(t.id).attr("x",c/2).attr("y",c/2+5)}))},_p=function(t,e,n){var i=Math.max.apply(Math,y(e.map((function(t){return t.col}))))+1,r=Math.max.apply(Math,y(e.map((function(t){return t.row}))))+1,a=n.gridCartogramMargins_,o=n.gridCartogramCellPadding_||0,s=Math.min((n.width_-a.left-a.right)/(1.5*i),(n.height_-a.top-a.bottom)/(r*Math.sqrt(3))),l=Math.sqrt(3)*s;t.selectAll(".em-grid-cell").data(e).enter().append("g").attr("class","em-grid-cell").attr("transform",(function(t){var e=t.col*(1.5*s+o)+a.left,n=t.row*(l+o)+(t.col%2==1?(l+o)/2:0)+a.top;return"translate(".concat(e,", ").concat(n,")")})).each((function(t){Ft(this).append("path").attr("d",mp(s)).attr("class","em-grid-hexagon"),Ft(this).append("text").attr("class","em-grid-text").attr("text-anchor","middle").attr("font-size",15).style("pointer-events","none").attr("fill","black").text(t.id).attr("y",5)}))},mp=function(t){var e=Math.PI/3;return Array.from({length:6},(function(n,i){var r=t*Math.cos(e*i),a=t*Math.sin(e*i);return"".concat(0===i?"M":"L").concat(r,",").concat(a)})).join(" ")+" Z"},vp=function(t,e,n,i){t.each((function(){var r=this.getBBox(),a=(e-i.left-i.right-r.width)/2-r.x+i.left,o=(n-i.top-i.bottom-r.height)/2-r.y+i.top;t.attr("transform","translate(".concat(a,", ").concat(o,")"))}))};function yp(t){return[Pa(t[1],t[0]),za(t[2])]}function xp(t){var e=t[0],n=t[1],i=Na(n);return[i*Na(e),i*Oa(e),Oa(n)]}function bp(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function wp(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Sp(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Mp(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Ep(t){var e=Da(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Cp(t){return ka(t[0])<=wa?t[0]:Ga(t[0])*((ka(t[0])+wa)%Ea-wa)}function Ap(t,e,n,i){return function(r){var a,o,s,l=e(r),c=xo(),u=e(c),h=!1,f={point:p,lineStart:g,lineEnd:_,polygonStart:function(){f.point=m,f.lineStart=v,f.lineEnd=y,o=[],a=[]},polygonEnd:function(){f.point=p,f.lineStart=g,f.lineEnd=_,o=Eo(o);var t=function(t,e){var n=Cp(e),i=e[1],r=Oa(i),a=[Oa(n),-Na(n),0],o=0,s=0,l=new ya;1===r?i=Sa+xa:-1===r&&(i=-Sa-xa);for(var c=0,u=t.length;c<u;++c)if(f=(h=t[c]).length)for(var h,f,p=h[f-1],d=Cp(p),g=p[1]/2+Ma,_=Oa(g),m=Na(g),v=0;v<f;++v,d=x,_=w,m=S,p=y){var y=h[v],x=Cp(y),b=y[1]/2+Ma,w=Oa(b),S=Na(b),M=x-d,E=M>=0?1:-1,C=E*M,A=C>wa,k=_*w;if(l.add(Pa(k*E*Oa(C),m*S+k*Na(C))),o+=A?M+E*Ea:M,A^d>=n^x>=n){var T=wp(xp(p),xp(y));Ep(T);var P=wp(a,T);Ep(P);var N=(A^M>=0?-1:1)*za(P[2]);(i>N||i===N&&(T[0]||T[1]))&&(s+=A^M>=0?1:-1)}}return(o<-1e-6||o<xa&&l<-1e-12)^1&s}(a,i);o.length?(h||(r.polygonStart(),h=!0),So(o,Tp,t,n,r)):t&&(h||(r.polygonStart(),h=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),h&&(r.polygonEnd(),h=!1),o=a=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function p(e,n){t(e,n)&&r.point(e,n)}function d(t,e){l.point(t,e)}function g(){f.point=d,l.lineStart()}function _(){f.point=p,l.lineEnd()}function m(t,e){s.push([t,e]),u.point(t,e)}function v(){u.lineStart(),s=[]}function y(){m(s[0][0],s[0][1]),u.lineEnd();var t,e,n,i,l=u.clean(),f=c.result(),p=f.length;if(s.pop(),a.push(s),s=null,p)if(1&l){if((e=(n=f[0]).length-1)>0){for(h||(r.polygonStart(),h=!0),r.lineStart(),t=0;t<e;++t)r.point((i=n[t])[0],i[1]);r.lineEnd()}}else p>1&&2&l&&f.push(f.pop().concat(f.shift())),o.push(f.filter(kp))}return f}}function kp(t){return t.length>1}function Tp(t,e){return((t=t.x)[0]<0?t[1]-Sa-xa:Sa-t[1])-((e=e.x)[0]<0?e[1]-Sa-xa:Sa-e[1])}const Pp=Ap((function(){return!0}),(function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?wa:-wa,l=ka(a-n);ka(l-wa)<xa?(t.point(n,i=(i+o)/2>0?Sa:-Sa),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(s,i),t.point(a,i),e=0):r!==s&&l>=wa&&(ka(n-r)<xa&&(n-=r*xa),ka(a-s)<xa&&(a-=s*xa),i=function(t,e,n,i){var r,a,o=Oa(t-n);return ka(o)>xa?Ta((Oa(e)*(a=Na(i))*Oa(n)-Oa(i)*(r=Na(e))*Oa(t))/(r*a*o)):(e+i)/2}(n,i,a,o),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(s,i),e=0),t.point(n=a,i=o),r=s},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}}),(function(t,e,n,i){var r;if(null==t)r=n*Sa,i.point(-wa,r),i.point(0,r),i.point(wa,r),i.point(wa,0),i.point(wa,-r),i.point(0,-r),i.point(-wa,-r),i.point(-wa,0),i.point(-wa,r);else if(ka(t[0]-e[0])>xa){var a=t[0]<e[0]?wa:-wa;r=n*a/2,i.point(-a,r),i.point(0,r),i.point(a,r)}else i.point(e[0],e[1])}),[-wa,-Sa]);function Np(t,e,n,i,r,a){if(n){var o=Na(e),s=Oa(e),l=i*n;null==r?(r=e+i*Ea,a=e-l/2):(r=Lp(o,r),a=Lp(o,a),(i>0?r<a:r>a)&&(r+=i*Ea));for(var c,u=r;i>0?u>a:u<a;u-=l)c=yp([o,-s*Na(u),-s*Oa(u)]),t.point(c[0],c[1])}}function Lp(t,e){(e=xp(e))[0]-=t,Ep(e);var n=function(t){return t>1?0:t<-1?wa:Math.acos(t)}(-e[1]);return((-e[2]<0?-n:n)+Ea-xa)%Ea}function Fp(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return(n=e.invert(n,i))&&t.invert(n[0],n[1])}),n}function Op(t,e){return ka(t)>wa&&(t-=Math.round(t/Ea)*Ea),[t,e]}function Gp(t,e,n){return(t%=Ea)?e||n?Fp(zp(t),Ip(e,n)):zp(t):e||n?Ip(e,n):Op}function Dp(t){return function(e,n){return ka(e+=t)>wa&&(e-=Math.round(e/Ea)*Ea),[e,n]}}function zp(t){var e=Dp(t);return e.invert=Dp(-t),e}function Ip(t,e){var n=Na(t),i=Oa(t),r=Na(e),a=Oa(e);function o(t,e){var o=Na(e),s=Na(t)*o,l=Oa(t)*o,c=Oa(e),u=c*n+s*i;return[Pa(l*r-u*a,s*n-c*i),za(u*r+l*a)]}return o.invert=function(t,e){var o=Na(e),s=Na(t)*o,l=Oa(t)*o,c=Oa(e),u=c*r-l*a;return[Pa(l*r+c*a,s*n+u*i),za(u*n-s*i)]},o}Op.invert=Op;var Rp=Na(30*Aa);function jp(t,e){return+e?function(t,e){function n(i,r,a,o,s,l,c,u,h,f,p,d,g,_){var m=c-i,v=u-r,y=m*m+v*v;if(y>4*e&&g--){var x=o+f,b=s+p,w=l+d,S=Da(x*x+b*b+w*w),M=za(w/=S),E=ka(ka(w)-1)<xa||ka(a-h)<xa?(a+h)/2:Pa(b,x),C=t(E,M),A=C[0],k=C[1],T=A-i,P=k-r,N=v*T-m*P;(N*N/y>e||ka((m*T+v*P)/y-.5)>.3||o*f+s*p+l*d<Rp)&&(n(i,r,a,o,s,l,A,k,E,x/=S,b/=S,w,g,_),_.point(A,k),n(A,k,E,x,b,w,c,u,h,f,p,d,g,_))}}return function(e){var i,r,a,o,s,l,c,u,h,f,p,d,g={point:_,lineStart:m,lineEnd:y,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=m}};function _(n,i){n=t(n,i),e.point(n[0],n[1])}function m(){u=NaN,g.point=v,e.lineStart()}function v(i,r){var a=xp([i,r]),o=t(i,r);n(u,h,c,f,p,d,u=o[0],h=o[1],c=i,f=a[0],p=a[1],d=a[2],16,e),e.point(u,h)}function y(){g.point=_,e.lineEnd()}function x(){m(),g.point=b,g.lineEnd=w}function b(t,e){v(i=t,e),r=u,a=h,o=f,s=p,l=d,g.point=v}function w(){n(u,h,c,f,p,d,r,a,i,o,s,l,16,e),g.lineEnd=y,y()}return g}}(t,e):function(t){return Po({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Bp,qp=Po({point:function(t,e){this.stream.point(t*Aa,e*Aa)}});function Up(t,e,n,i,r,a){if(!a)return function(t,e,n,i,r){function a(a,o){return[e+t*(a*=i),n-t*(o*=r)]}return a.invert=function(a,o){return[(a-e)/t*i,(n-o)/t*r]},a}(t,e,n,i,r);var o=Na(a),s=Oa(a),l=o*t,c=s*t,u=o/t,h=s/t,f=(s*n-o*e)/t,p=(s*e+o*n)/t;function d(t,a){return[l*(t*=i)-c*(a*=r)+e,n-c*t-l*a]}return d.invert=function(t,e){return[i*(u*t-h*e+f),r*(p-h*t-u*e)]},d}function Wp(t){return function(t){var e,n,i,r,a,o,s,l,c,u,h=150,f=480,p=250,d=0,g=0,_=0,m=0,v=0,y=0,x=1,b=1,w=null,S=Pp,M=null,E=To,C=.5;function A(t){return l(t[0]*Aa,t[1]*Aa)}function k(t){return(t=l.invert(t[0],t[1]))&&[t[0]*Ca,t[1]*Ca]}function T(){var t=Up(h,0,0,x,b,y).apply(null,e(d,g)),i=Up(h,f-t[0],p-t[1],x,b,y);return n=Gp(_,m,v),s=Fp(e,i),l=Fp(n,s),o=jp(s,C),P()}function P(){return c=u=null,A}return A.stream=function(t){return c&&u===t?c:c=qp(function(t){return Po({point:function(e,n){var i=t(e,n);return this.stream.point(i[0],i[1])}})}(n)(S(o(E(u=t)))))},A.preclip=function(t){return arguments.length?(S=t,w=void 0,P()):S},A.postclip=function(t){return arguments.length?(E=t,M=i=r=a=null,P()):E},A.clipAngle=function(t){return arguments.length?(S=+t?function(t){var e=Na(t),n=2*Aa,i=e>0,r=ka(e)>xa;function a(t,n){return Na(t)*Na(n)>e}function o(t,n,i){var r=[1,0,0],a=wp(xp(t),xp(n)),o=bp(a,a),s=a[0],l=o-s*s;if(!l)return!i&&t;var c=e*o/l,u=-e*s/l,h=wp(r,a),f=Mp(r,c);Sp(f,Mp(a,u));var p=h,d=bp(f,p),g=bp(p,p),_=d*d-g*(bp(f,f)-1);if(!(_<0)){var m=Da(_),v=Mp(p,(-d-m)/g);if(Sp(v,f),v=yp(v),!i)return v;var y,x=t[0],b=n[0],w=t[1],S=n[1];b<x&&(y=x,x=b,b=y);var M=b-x,E=ka(M-wa)<xa;if(!E&&S<w&&(y=w,w=S,S=y),E||M<xa?E?w+S>0^v[1]<(ka(v[0]-x)<xa?w:S):w<=v[1]&&v[1]<=S:M>wa^(x<=v[0]&&v[0]<=b)){var C=Mp(p,(-d+m)/g);return Sp(C,f),[v,yp(C)]}}}function s(e,n){var r=i?t:wa-t,a=0;return e<-r?a|=1:e>r&&(a|=2),n<-r?a|=4:n>r&&(a|=8),a}return Ap(a,(function(t){var e,n,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(h,f){var p,d=[h,f],g=a(h,f),_=i?g?0:s(h,f):g?s(h+(h<0?wa:-wa),f):0;if(!e&&(c=l=g)&&t.lineStart(),g!==l&&(!(p=o(e,d))||bo(e,p)||bo(d,p))&&(d[2]=1),g!==l)u=0,g?(t.lineStart(),p=o(d,e),t.point(p[0],p[1])):(p=o(e,d),t.point(p[0],p[1],2),t.lineEnd()),e=p;else if(r&&e&&i^g){var m;_&n||!(m=o(d,e,!0))||(u=0,i?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1],3)))}!g||e&&bo(e,d)||t.point(d[0],d[1]),e=d,l=g,n=_},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return u|(c&&l)<<1}}}),(function(e,i,r,a){Np(a,t,n,r,e,i)}),i?[0,-t]:[-wa,t-wa])}(w=t*Aa):(w=null,Pp),P()):w*Ca},A.clipExtent=function(t){return arguments.length?(E=null==t?(M=i=r=a=null,To):ko(M=+t[0][0],i=+t[0][1],r=+t[1][0],a=+t[1][1]),P()):null==M?null:[[M,i],[r,a]]},A.scale=function(t){return arguments.length?(h=+t,T()):h},A.translate=function(t){return arguments.length?(f=+t[0],p=+t[1],T()):[f,p]},A.center=function(t){return arguments.length?(d=t[0]%360*Aa,g=t[1]%360*Aa,T()):[d*Ca,g*Ca]},A.rotate=function(t){return arguments.length?(_=t[0]%360*Aa,m=t[1]%360*Aa,v=t.length>2?t[2]%360*Aa:0,T()):[_*Ca,m*Ca,v*Ca]},A.angle=function(t){return arguments.length?(y=t%360*Aa,T()):y*Ca},A.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},A.reflectY=function(t){return arguments.length?(b=t?-1:1,T()):b<0},A.precision=function(t){return arguments.length?(o=jp(s,C=t*t),P()):Da(C)},A.fitExtent=function(t,e){return Ro(A,t,e)},A.fitSize=function(t,e){return jo(A,t,e)},A.fitWidth=function(t,e){return Bo(A,t,e)},A.fitHeight=function(t,e){return qo(A,t,e)},function(){return e=t.apply(this,arguments),A.invert=e.invert&&k,T()}}((function(){return t}))()}function Hp(t,e){return[Na(e)*Oa(t),Oa(e)]}Hp.invert=(Bp=za,function(t,e){var n=Da(t*t+e*e),i=Bp(n),r=Oa(i),a=Na(i);return[Pa(t*r,n*a),za(n&&e*r/n)]});var Vp=6378137,$p=.0066943799901413165,Jp=484813681109536e-20,Yp=Math.PI/2,Xp=1e-10,Kp=.017453292519943295,Zp=57.29577951308232,Qp=Math.PI/4,td=2*Math.PI,ed=3.14159265359,nd={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const id={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var rd=/[\s_\-\/\(\)]/g;function ad(t,e){if(t[e])return t[e];for(var n,i=Object.keys(t),r=e.toLowerCase().replace(rd,""),a=-1;++a<i.length;)if((n=i[a]).toLowerCase().replace(rd,"")===r)return t[n]}function od(t){var e,n,i,r={},a=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,e){var n=e.split("=");return n.push(!0),t[n[0].toLowerCase()]=n[1],t}),{}),o={proj:"projName",datum:"datumCode",rf:function(t){r.rf=parseFloat(t)},lat_0:function(t){r.lat0=t*Kp},lat_1:function(t){r.lat1=t*Kp},lat_2:function(t){r.lat2=t*Kp},lat_ts:function(t){r.lat_ts=t*Kp},lon_0:function(t){r.long0=t*Kp},lon_1:function(t){r.long1=t*Kp},lon_2:function(t){r.long2=t*Kp},alpha:function(t){r.alpha=parseFloat(t)*Kp},gamma:function(t){r.rectified_grid_angle=parseFloat(t)*Kp},lonc:function(t){r.longc=t*Kp},x_0:function(t){r.x0=parseFloat(t)},y_0:function(t){r.y0=parseFloat(t)},k_0:function(t){r.k0=parseFloat(t)},k:function(t){r.k0=parseFloat(t)},a:function(t){r.a=parseFloat(t)},b:function(t){r.b=parseFloat(t)},r:function(t){r.a=r.b=parseFloat(t)},r_a:function(){r.R_A=!0},zone:function(t){r.zone=parseInt(t,10)},south:function(){r.utmSouth=!0},towgs84:function(t){r.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){r.to_meter=parseFloat(t)},units:function(t){r.units=t;var e=ad(id,t);e&&(r.to_meter=e.to_meter)},from_greenwich:function(t){r.from_greenwich=t*Kp},pm:function(t){var e=ad(nd,t);r.from_greenwich=(e||parseFloat(t))*Kp},nadgrids:function(t){"@null"===t?r.datumCode="none":r.nadgrids=t},axis:function(t){var e="ewnsud";3===t.length&&-1!==e.indexOf(t.substr(0,1))&&-1!==e.indexOf(t.substr(1,1))&&-1!==e.indexOf(t.substr(2,1))&&(r.axis=t)},approx:function(){r.approx=!0}};for(e in a)n=a[e],e in o?"function"==typeof(i=o[e])?i(n):r[i]=n:r[e]=n;return"string"==typeof r.datumCode&&"WGS84"!==r.datumCode&&(r.datumCode=r.datumCode.toLowerCase()),r}const sd=class{static getId(t){const e=t.find((t=>Array.isArray(t)&&"ID"===t[0]));return e&&e.length>=3?{authority:e[1],code:parseInt(e[2],10)}:null}static convertUnit(t,e="unit"){if(!t||t.length<3)return{type:e,name:"unknown",conversion_factor:null};const n=t[1],i=parseFloat(t[2])||null,r=t.find((t=>Array.isArray(t)&&"ID"===t[0]));return{type:e,name:n,conversion_factor:i,id:r?{authority:r[1],code:parseInt(r[2],10)}:null}}static convertAxis(t){const e=t[1]||"Unknown";let n;const i=e.match(/^\((.)\)$/);if(i){const t=i[1].toUpperCase();if("E"===t)n="east";else if("N"===t)n="north";else{if("U"!==t)throw new Error(`Unknown axis abbreviation: ${t}`);n="up"}}else n=t[2]?t[2].toLowerCase():"unknown";const r=t.find((t=>Array.isArray(t)&&"ORDER"===t[0])),a=r?parseInt(r[1],10):null,o=t.find((t=>Array.isArray(t)&&("LENGTHUNIT"===t[0]||"ANGLEUNIT"===t[0]||"SCALEUNIT"===t[0])));return{name:e,direction:n,unit:this.convertUnit(o),order:a}}static extractAxes(t){return t.filter((t=>Array.isArray(t)&&"AXIS"===t[0])).map((t=>this.convertAxis(t))).sort(((t,e)=>(t.order||0)-(e.order||0)))}static convert(t,e={}){switch(t[0]){case"PROJCRS":e.type="ProjectedCRS",e.name=t[1],e.base_crs=t.find((t=>Array.isArray(t)&&"BASEGEOGCRS"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"BASEGEOGCRS"===t[0]))):null,e.conversion=t.find((t=>Array.isArray(t)&&"CONVERSION"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"CONVERSION"===t[0]))):null;const n=t.find((t=>Array.isArray(t)&&"CS"===t[0]));n&&(e.coordinate_system={type:n[1],axis:this.extractAxes(t)});const i=t.find((t=>Array.isArray(t)&&"LENGTHUNIT"===t[0]));if(i){const t=this.convertUnit(i);e.coordinate_system.unit=t}e.id=this.getId(t);break;case"BASEGEOGCRS":case"GEOGCRS":e.type="GeographicCRS",e.name=t[1];const r=t.find((t=>Array.isArray(t)&&("DATUM"===t[0]||"ENSEMBLE"===t[0])));if(r){const n=this.convert(r);"ENSEMBLE"===r[0]?e.datum_ensemble=n:e.datum=n;const i=t.find((t=>Array.isArray(t)&&"PRIMEM"===t[0]));i&&"Greenwich"!==i[1]&&(n.prime_meridian={name:i[1],longitude:parseFloat(i[2])})}e.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(t)},e.id=this.getId(t);break;case"DATUM":e.type="GeodeticReferenceFrame",e.name=t[1],e.ellipsoid=t.find((t=>Array.isArray(t)&&"ELLIPSOID"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"ELLIPSOID"===t[0]))):null;break;case"ENSEMBLE":e.type="DatumEnsemble",e.name=t[1],e.members=t.filter((t=>Array.isArray(t)&&"MEMBER"===t[0])).map((t=>({type:"DatumEnsembleMember",name:t[1],id:this.getId(t)})));const a=t.find((t=>Array.isArray(t)&&"ENSEMBLEACCURACY"===t[0]));a&&(e.accuracy=parseFloat(a[1]));const o=t.find((t=>Array.isArray(t)&&"ELLIPSOID"===t[0]));o&&(e.ellipsoid=this.convert(o)),e.id=this.getId(t);break;case"ELLIPSOID":e.type="Ellipsoid",e.name=t[1],e.semi_major_axis=parseFloat(t[2]),e.inverse_flattening=parseFloat(t[3]);t.find((t=>Array.isArray(t)&&"LENGTHUNIT"===t[0]))&&this.convert(t.find((t=>Array.isArray(t)&&"LENGTHUNIT"===t[0])),e);break;case"CONVERSION":e.type="Conversion",e.name=t[1],e.method=t.find((t=>Array.isArray(t)&&"METHOD"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"METHOD"===t[0]))):null,e.parameters=t.filter((t=>Array.isArray(t)&&"PARAMETER"===t[0])).map((t=>this.convert(t)));break;case"METHOD":e.type="Method",e.name=t[1],e.id=this.getId(t);break;case"PARAMETER":e.type="Parameter",e.name=t[1],e.value=parseFloat(t[2]),e.unit=this.convertUnit(t.find((t=>Array.isArray(t)&&("LENGTHUNIT"===t[0]||"ANGLEUNIT"===t[0]||"SCALEUNIT"===t[0])))),e.id=this.getId(t);break;case"BOUNDCRS":e.type="BoundCRS";const s=t.find((t=>Array.isArray(t)&&"SOURCECRS"===t[0]));if(s){const t=s.find((t=>Array.isArray(t)));e.source_crs=t?this.convert(t):null}const l=t.find((t=>Array.isArray(t)&&"TARGETCRS"===t[0]));if(l){const t=l.find((t=>Array.isArray(t)));e.target_crs=t?this.convert(t):null}const c=t.find((t=>Array.isArray(t)&&"ABRIDGEDTRANSFORMATION"===t[0]));e.transformation=c?this.convert(c):null;break;case"ABRIDGEDTRANSFORMATION":if(e.type="Transformation",e.name=t[1],e.method=t.find((t=>Array.isArray(t)&&"METHOD"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"METHOD"===t[0]))):null,e.parameters=t.filter((t=>Array.isArray(t)&&("PARAMETER"===t[0]||"PARAMETERFILE"===t[0]))).map((t=>"PARAMETER"===t[0]?this.convert(t):"PARAMETERFILE"===t[0]?{name:t[1],value:t[2],id:{authority:"EPSG",code:8656}}:void 0)),7===e.parameters.length){const t=e.parameters[6];"Scale difference"===t.name&&(t.value=Math.round(1e12*(t.value-1))/1e6)}e.id=this.getId(t);break;case"AXIS":e.coordinate_system||(e.coordinate_system={type:"unspecified",axis:[]}),e.coordinate_system.axis.push(this.convertAxis(t));break;case"LENGTHUNIT":const u=this.convertUnit(t,"LinearUnit");e.coordinate_system&&e.coordinate_system.axis&&e.coordinate_system.axis.forEach((t=>{t.unit||(t.unit=u)})),u.conversion_factor&&1!==u.conversion_factor&&e.semi_major_axis&&(e.semi_major_axis={value:e.semi_major_axis,unit:u});break;default:e.keyword=t[0]}return e}};const ld=class extends sd{static convert(t,e={}){return super.convert(t,e),e.coordinate_system&&"Cartesian"===e.coordinate_system.subtype&&delete e.coordinate_system,e.usage&&delete e.usage,e}};const cd=class extends sd{static convert(t,e={}){super.convert(t,e);const n=t.find((t=>Array.isArray(t)&&"CS"===t[0]));n&&(e.coordinate_system={subtype:n[1],axis:this.extractAxes(t)});const i=t.find((t=>Array.isArray(t)&&"USAGE"===t[0]));if(i){const t=i.find((t=>Array.isArray(t)&&"SCOPE"===t[0])),n=i.find((t=>Array.isArray(t)&&"AREA"===t[0])),r=i.find((t=>Array.isArray(t)&&"BBOX"===t[0]));e.usage={},t&&(e.usage.scope=t[1]),n&&(e.usage.area=n[1]),r&&(e.usage.bbox=r.slice(1))}return e}};function ud(t){const e=function(t){return t.find((t=>Array.isArray(t)&&"USAGE"===t[0]))?"2019":(t.find((t=>Array.isArray(t)&&"CS"===t[0]))||"BOUNDCRS"===t[0]||"PROJCRS"===t[0]||t[0],"2015")}(t);return("2019"===e?cd:ld).convert(t)}const hd=function(t){var e=new vd(t);return e.output()};var fd=1,pd=/\s/,dd=/[A-Za-z]/,gd=/[A-Za-z84_]/,_d=/[,\]]/,md=/[\d\.E\-\+]/;function vd(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=fd}function yd(t,e,n){Array.isArray(e)&&(n.unshift(e),e=null);var i=e?{}:t,r=n.reduce((function(t,e){return xd(e,t),t}),i);e&&(t[e]=r)}function xd(t,e){if(Array.isArray(t)){var n=t.shift();if("PARAMETER"===n&&(n=t.shift()),1===t.length)return Array.isArray(t[0])?(e[n]={},void xd(t[0],e[n])):void(e[n]=t[0]);if(t.length)if("TOWGS84"!==n){if("AXIS"===n)return n in e||(e[n]=[]),void e[n].push(t);var i;switch(Array.isArray(n)||(e[n]={}),n){case"UNIT":case"PRIMEM":case"VERT_DATUM":return e[n]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&xd(t[2],e[n]));case"SPHEROID":case"ELLIPSOID":return e[n]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&xd(t[3],e[n]));case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":return t[0]=["name",t[0]],void yd(e,n,t);case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":return t[0]=["name",t[0]],yd(e,n,t),void(e[n].type=n);default:for(i=-1;++i<t.length;)if(!Array.isArray(t[i]))return xd(t,e[n]);return yd(e,n,t)}}else e[n]=t;else e[n]=!0}else e[t]=!0}vd.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;pd.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case fd:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},vd.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(_d.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},vd.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=fd)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=fd,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},vd.prototype.number=function(t){if(!md.test(t)){if(_d.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},vd.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},vd.prototype.keyword=function(t){if(gd.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=fd)}if(!_d.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},vd.prototype.neutral=function(t){if(dd.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(md.test(t))return this.word=t,void(this.state=3);if(!_d.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},vd.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function bd(t){return.017453292519943295*t}function wd(t){const e=(t.projName||"").toLowerCase().replace(/_/g," ");t.long0||!t.longc||"albers conic equal area"!==e&&"lambert azimuthal equal area"!==e||(t.long0=t.longc),t.lat_ts||!t.lat1||"stereographic south pole"!==e&&"polar stereographic (variant b)"!==e?t.lat_ts||!t.lat0||"polar stereographic"!==e&&"polar stereographic (variant a)"!==e||(t.lat_ts=t.lat0,t.lat0=bd(t.lat0>0?90:-90),delete t.lat1):(t.lat0=bd(t.lat1>0?90:-90),t.lat_ts=t.lat1,delete t.lat1)}function Sd(t){let e={units:null,to_meter:void 0};return"string"==typeof t?(e.units=t.toLowerCase(),"metre"===e.units&&(e.units="meter"),"meter"===e.units&&(e.to_meter=1)):t&&t.name&&(e.units=t.name.toLowerCase(),"metre"===e.units&&(e.units="meter"),e.to_meter=t.conversion_factor),e}function Md(t){return"object"==typeof t?t.value*t.unit.conversion_factor:t}function Ed(t,e){t.ellipsoid.radius?(e.a=t.ellipsoid.radius,e.rf=0):(e.a=Md(t.ellipsoid.semi_major_axis),void 0!==t.ellipsoid.inverse_flattening?e.rf=t.ellipsoid.inverse_flattening:void 0!==t.ellipsoid.semi_major_axis&&void 0!==t.ellipsoid.semi_minor_axis&&(e.rf=e.a/(e.a-Md(t.ellipsoid.semi_minor_axis))))}function Cd(t,e={}){return t&&"object"==typeof t?"BoundCRS"===t.type?(Cd(t.source_crs,e),t.transformation&&(t.transformation.method&&"NTv2"===t.transformation.method.name?e.nadgrids=t.transformation.parameters[0].value:e.datum_params=t.transformation.parameters.map((t=>t.value))),e):(Object.keys(t).forEach((n=>{const i=t[n];if(null!==i)switch(n){case"name":if(e.srsCode)break;e.name=i,e.srsCode=i;break;case"type":"GeographicCRS"===i?e.projName="longlat":"ProjectedCRS"===i&&t.conversion&&t.conversion.method&&(e.projName=t.conversion.method.name);break;case"datum":case"datum_ensemble":i.ellipsoid&&(e.ellps=i.ellipsoid.name,Ed(i,e)),i.prime_meridian&&(e.from_greenwich=i.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=i.name,Ed(i,e);break;case"prime_meridian":e.long0=(i.longitude||0)*Math.PI/180;break;case"coordinate_system":if(i.axis)if(e.axis=i.axis.map((t=>{const e=t.direction;if("east"===e)return"e";if("north"===e)return"n";if("west"===e)return"w";if("south"===e)return"s";throw new Error(`Unknown axis direction: ${e}`)})).join("")+"u",i.unit){const{units:t,to_meter:n}=Sd(i.unit);e.units=t,e.to_meter=n}else if(i.axis[0]&&i.axis[0].unit){const{units:t,to_meter:n}=Sd(i.axis[0].unit);e.units=t,e.to_meter=n}break;case"id":i.authority&&i.code&&(e.title=i.authority+":"+i.code);break;case"conversion":i.method&&i.method.name&&(e.projName=i.method.name),i.parameters&&i.parameters.forEach((t=>{const n=t.name.toLowerCase().replace(/\s+/g,"_"),i=t.value;t.unit&&t.unit.conversion_factor?e[n]=i*t.unit.conversion_factor:"degree"===t.unit?e[n]=i*Math.PI/180:e[n]=i}));break;case"unit":i.name&&(e.units=i.name.toLowerCase(),"metre"===e.units&&(e.units="meter")),i.conversion_factor&&(e.to_meter=i.conversion_factor);break;case"base_crs":Cd(i,e),e.datumCode=i.id?i.id.authority+"_"+i.id.code:i.name}})),void 0!==e.latitude_of_false_origin&&(e.lat0=e.latitude_of_false_origin),void 0!==e.longitude_of_false_origin&&(e.long0=e.longitude_of_false_origin),void 0!==e.latitude_of_standard_parallel&&(e.lat0=e.latitude_of_standard_parallel,e.lat1=e.latitude_of_standard_parallel),void 0!==e.latitude_of_1st_standard_parallel&&(e.lat1=e.latitude_of_1st_standard_parallel),void 0!==e.latitude_of_2nd_standard_parallel&&(e.lat2=e.latitude_of_2nd_standard_parallel),void 0!==e.latitude_of_projection_centre&&(e.lat0=e.latitude_of_projection_centre),void 0!==e.longitude_of_projection_centre&&(e.longc=e.longitude_of_projection_centre),void 0!==e.easting_at_false_origin&&(e.x0=e.easting_at_false_origin),void 0!==e.northing_at_false_origin&&(e.y0=e.northing_at_false_origin),void 0!==e.latitude_of_natural_origin&&(e.lat0=e.latitude_of_natural_origin),void 0!==e.longitude_of_natural_origin&&(e.long0=e.longitude_of_natural_origin),void 0!==e.longitude_of_origin&&(e.long0=e.longitude_of_origin),void 0!==e.false_easting&&(e.x0=e.false_easting),e.easting_at_projection_centre&&(e.x0=e.easting_at_projection_centre),void 0!==e.false_northing&&(e.y0=e.false_northing),e.northing_at_projection_centre&&(e.y0=e.northing_at_projection_centre),void 0!==e.standard_parallel_1&&(e.lat1=e.standard_parallel_1),void 0!==e.standard_parallel_2&&(e.lat2=e.standard_parallel_2),void 0!==e.scale_factor_at_natural_origin&&(e.k0=e.scale_factor_at_natural_origin),void 0!==e.scale_factor_at_projection_centre&&(e.k0=e.scale_factor_at_projection_centre),void 0!==e.scale_factor_on_pseudo_standard_parallel&&(e.k0=e.scale_factor_on_pseudo_standard_parallel),void 0!==e.azimuth&&(e.alpha=e.azimuth),void 0!==e.azimuth_at_projection_centre&&(e.alpha=e.azimuth_at_projection_centre),e.angle_from_rectified_to_skew_grid&&(e.rectified_grid_angle=e.angle_from_rectified_to_skew_grid),wd(e),e):t}var Ad=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function kd(t){for(var e=Object.keys(t),n=0,i=e.length;n<i;++n){var r=e[n];-1!==Ad.indexOf(r)&&Td(t[r]),"object"==typeof t[r]&&kd(t[r])}}function Td(t){if(t.AUTHORITY){var e=Object.keys(t.AUTHORITY)[0];e&&e in t.AUTHORITY&&(t.title=e+":"+t.AUTHORITY[e])}if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var n="",i=0,r=t.AXIS.length;i<r;++i){var a=[t.AXIS[i][0].toLowerCase(),t.AXIS[i][1].toLowerCase()];-1!==a[0].indexOf("north")||("y"===a[0]||"lat"===a[0])&&"north"===a[1]?n+="n":-1!==a[0].indexOf("south")||("y"===a[0]||"lat"===a[0])&&"south"===a[1]?n+="s":-1!==a[0].indexOf("east")||("x"===a[0]||"lon"===a[0])&&"east"===a[1]?n+="e":-1===a[0].indexOf("west")&&("x"!==a[0]&&"lon"!==a[0]||"west"!==a[1])||(n+="w")}2===n.length&&(n+="u"),3===n.length&&(t.axis=n)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var o=t.GEOGCS;function s(e){return e*(t.to_meter||1)}"GEOGCS"===t.type&&(o=t),o&&(o.DATUM?t.datumCode=o.DATUM.name.toLowerCase():t.datumCode=o.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_1949"===t.datumCode&&(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"belge_1972"===t.datumCode&&(t.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(t.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=o.DATUM.SPHEROID.a,t.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(t.datum_params=o.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),t.rectified_grid_angle&&(t.rectified_grid_angle=bd(t.rectified_grid_angle));[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",bd],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",bd],["x0","false_easting",s],["y0","false_northing",s],["long0","central_meridian",bd],["lat0","latitude_of_origin",bd],["lat0","standard_parallel_1",bd],["lat1","standard_parallel_1",bd],["lat2","standard_parallel_2",bd],["azimuth","Azimuth"],["alpha","azimuth",bd],["srsCode","name"]].forEach((function(e){return function(t,e){var n=e[0],i=e[1];!(n in t)&&i in t&&(t[n]=t[i],3===e.length&&(t[n]=e[2](t[n])))}(t,e)})),wd(t)}function Pd(t){if("object"==typeof t)return Cd(t);const e=function(t){const e=t.toUpperCase();return e.includes("PROJCRS")||e.includes("GEOGCRS")||e.includes("BOUNDCRS")||e.includes("VERTCRS")||e.includes("LENGTHUNIT")||e.includes("ANGLEUNIT")||e.includes("SCALEUNIT")?"WKT2":(e.includes("PROJCS")||e.includes("GEOGCS")||e.includes("LOCAL_CS")||e.includes("VERT_CS")||e.includes("UNIT"),"WKT1")}(t);var n=hd(t);if("WKT2"===e){return Cd(ud(n))}var i=n[0],r={};return xd(n,r),kd(r),r[i]}function Nd(t){var e=this;if(2===arguments.length){var n=arguments[1];"string"==typeof n?"+"===n.charAt(0)?Nd[t]=od(arguments[1]):Nd[t]=Pd(arguments[1]):Nd[t]=n}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?Nd.apply(e,t):Nd(t)}));if("string"==typeof t){if(t in Nd)return Nd[t]}else"EPSG"in t?Nd["EPSG:"+t.EPSG]=t:"ESRI"in t?Nd["ESRI:"+t.ESRI]=t:"IAU2000"in t?Nd["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var e=1;e<=60;++e)t("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),t("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(Nd);const Ld=Nd;var Fd=["3857","900913","3785","102113"];const Od=function(t){if(!function(t){return"string"==typeof t}(t))return t.projName?t:Pd(t);if(function(t){return t in Ld}(t))return Ld[t];if(function(t){return 0!==t.indexOf("+")&&-1!==t.indexOf("[")||"object"==typeof t&&!("srsCode"in t)}(t)){var e=Pd(t);if(function(t){var e=ad(t,"authority");if(e){var n=ad(e,"epsg");return n&&Fd.indexOf(n)>-1}}(e))return Ld["EPSG:3857"];var n=function(t){var e=ad(t,"extension");if(e)return ad(e,"proj4")}(e);return n?od(n):e}return function(t){return"+"===t[0]}(t)?od(t):void 0};function Gd(t,e){var n,i;if(t=t||{},!e)return t;for(i in e)void 0!==(n=e[i])&&(t[i]=n);return t}function Dd(t,e,n){var i=t*e;return n/Math.sqrt(1-i*i)}function zd(t){return t<0?-1:1}function Id(t){return Math.abs(t)<=ed?t:t-zd(t)*td}function Rd(t,e,n){var i=t*n,r=.5*t;return i=Math.pow((1-i)/(1+i),r),Math.tan(.5*(Yp-e))/i}function jd(t,e){for(var n,i,r=.5*t,a=Yp-2*Math.atan(e),o=0;o<=15;o++)if(n=t*Math.sin(a),a+=i=Yp-2*Math.atan(e*Math.pow((1-n)/(1+n),r))-a,Math.abs(i)<=1e-10)return a;return-9999}const Bd={init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Dd(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,n,i=t.x,r=t.y;if(r*Zp>90&&r*Zp<-90&&i*Zp>180&&i*Zp<-180)return null;if(Math.abs(Math.abs(r)-Yp)<=Xp)return null;if(this.sphere)e=this.x0+this.a*this.k0*Id(i-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(Qp+.5*r));else{var a=Math.sin(r),o=Rd(this.e,r,a);e=this.x0+this.a*this.k0*Id(i-this.long0),n=this.y0-this.a*this.k0*Math.log(o)}return t.x=e,t.y=n,t},inverse:function(t){var e,n,i=t.x-this.x0,r=t.y-this.y0;if(this.sphere)n=Yp-2*Math.atan(Math.exp(-r/(this.a*this.k0)));else{var a=Math.exp(-r/(this.a*this.k0));if(-9999===(n=jd(this.e,a)))return null}return e=Id(this.long0+i/(this.a*this.k0)),t.x=e,t.y=n,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"]};function qd(t){return t}var Ud=[Bd,{init:function(){},forward:qd,inverse:qd,names:["longlat","identity"]}],Wd={},Hd=[];function Vd(t,e){var n=Hd.length;return t.names?(Hd[n]=t,t.names.forEach((function(t){Wd[t.toLowerCase()]=n})),this):(console.log(e),!0)}function $d(t){return t.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}const Jd={start:function(){Ud.forEach(Vd)},add:Vd,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==Wd[e]&&Hd[Wd[e]]||(e=$d(e))in Wd&&Hd[Wd[e]]?Hd[Wd[e]]:void 0}};const Yd={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},Xd=Yd.WGS84;var Kd={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var Zd in Kd){var Qd=Kd[Zd];Qd.datumName&&(Kd[Qd.datumName]=Qd)}const tg=Kd;const eg=function(t,e,n,i,r,a,o){var s={};return s.datum_type=void 0===t||"none"===t?5:4,e&&(s.datum_params=e.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=1),s.datum_params.length>3&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=2,s.datum_params[3]*=Jp,s.datum_params[4]*=Jp,s.datum_params[5]*=Jp,s.datum_params[6]=s.datum_params[6]/1e6+1))),o&&(s.datum_type=3,s.grids=o),s.a=n,s.b=i,s.es=r,s.ep2=a,s};var ng={};async function ig(t,e){for(var n=[],i=await e.getImageCount(),r=i-1;r>=0;r--){var a=await e.getImage(r),o=await a.readRasters(),s=[a.getWidth(),a.getHeight()],l=a.getBoundingBox().map(ag),c=[a.fileDirectory.ModelPixelScale[0],a.fileDirectory.ModelPixelScale[1]].map(ag),u=l[0]+(s[0]-1)*c[0],h=l[3]-(s[1]-1)*c[1],f=o[0],p=o[1],d=[];for(let t=s[1]-1;t>=0;t--)for(let e=s[0]-1;e>=0;e--){var g=t*s[0]+e;d.push([-og(p[g]),og(f[g])])}n.push({del:c,lim:s,ll:[-u,h],cvs:d})}var _={header:{nSubgrids:i},subgrids:n};return ng[t]=_,_}function rg(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:ng[t]||null,isNull:!1}}function ag(t){return t*Math.PI/180}function og(t){return t/3600*Math.PI/180}function sg(t,e,n){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,n)))}function lg(t){return t.map((function(t){return[og(t.longitudeShift),og(t.latitudeShift)]}))}function cg(t,e,n){return{name:sg(t,e+8,e+16).trim(),parent:sg(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,n),upperLatitude:t.getFloat64(e+88,n),lowerLongitude:t.getFloat64(e+104,n),upperLongitude:t.getFloat64(e+120,n),latitudeInterval:t.getFloat64(e+136,n),longitudeInterval:t.getFloat64(e+152,n),gridNodeCount:t.getInt32(e+168,n)}}function ug(t,e,n,i,r){var a=e+176,o=16;!1===r&&(o=8);for(var s=[],l=0;l<n.gridNodeCount;l++){var c={latitudeShift:t.getFloat32(a+l*o,i),longitudeShift:t.getFloat32(a+l*o+4,i)};!1!==r&&(c.latitudeAccuracy=t.getFloat32(a+l*o+8,i),c.longitudeAccuracy=t.getFloat32(a+l*o+12,i)),s.push(c)}return s}function hg(t,e){if(!(this instanceof hg))return new hg(t);e=e||function(t){if(t)throw t};var n=Od(t);if("object"==typeof n){var i=hg.projections.get(n.projName);if(i){if(n.datumCode&&"none"!==n.datumCode){var r=ad(tg,n.datumCode);r&&(n.datum_params=n.datum_params||(r.towgs84?r.towgs84.split(","):null),n.ellps=r.ellipse,n.datumName=r.datumName?r.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu",n.ellps=n.ellps||"wgs84",n.lat1=n.lat1||n.lat0;var a=function(t,e,n,i,r){if(!t){var a=ad(Yd,i);a||(a=Xd),t=a.a,e=a.b,n=a.rf}return n&&!e&&(e=(1-1/n)*t),(0===n||Math.abs(t-e)<Xp)&&(r=!0,e=t),{a:t,b:e,rf:n,sphere:r}}(n.a,n.b,n.rf,n.ellps,n.sphere),o=function(t,e,n,i){var r=t*t,a=e*e,o=(r-a)/r,s=0;return i?(r=(t*=1-o*(.16666666666666666+o*(.04722222222222222+.022156084656084655*o)))*t,o=0):s=Math.sqrt(o),{es:o,e:s,ep2:(r-a)/a}}(a.a,a.b,a.rf,n.R_A),s=function(t){return void 0===t?null:t.split(",").map(rg)}(n.nadgrids),l=n.datum||eg(n.datumCode,n.datum_params,a.a,a.b,o.es,o.ep2,s);Gd(this,n),Gd(this,i),this.a=a.a,this.b=a.b,this.rf=a.rf,this.sphere=a.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=l,this.init(),e(null,this)}else e("Could not get projection name from: "+t)}else e("Could not parse to valid json: "+t)}hg.projections=Jd,hg.projections.start();const fg=hg;function pg(t,e,n){var i,r,a,o,s=t.x,l=t.y,c=t.z?t.z:0;if(l<-Yp&&l>-1.001*Yp)l=-Yp;else if(l>Yp&&l<1.001*Yp)l=Yp;else{if(l<-Yp)return{x:-1/0,y:-1/0,z:t.z};if(l>Yp)return{x:1/0,y:1/0,z:t.z}}return s>Math.PI&&(s-=2*Math.PI),r=Math.sin(l),o=Math.cos(l),a=r*r,{x:((i=n/Math.sqrt(1-e*a))+c)*o*Math.cos(s),y:(i+c)*o*Math.sin(s),z:(i*(1-e)+c)*r}}function dg(t,e,n,i){var r,a,o,s,l,c,u,h,f,p,d,g,_,m,v,y=1e-12,x=t.x,b=t.y,w=t.z?t.z:0;if(r=Math.sqrt(x*x+b*b),a=Math.sqrt(x*x+b*b+w*w),r/n<y){if(m=0,a/n<y)return v=-i,{x:t.x,y:t.y,z:t.z}}else m=Math.atan2(b,x);o=w/a,h=(s=r/a)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*s*s)),f=o*l,_=0;do{_++,c=e*(u=n/Math.sqrt(1-e*f*f))/(u+(v=r*h+w*f-u*(1-e*f*f))),g=(d=o*(l=1/Math.sqrt(1-c*(2-c)*s*s)))*h-(p=s*(1-c)*l)*f,h=p,f=d}while(g*g>1e-24&&_<30);return{x:m,y:Math.atan(d/Math.abs(p)),z:v}}function gg(t){return 1===t||2===t}function _g(t,e,n){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return n;if(5===t.datum_type||5===e.datum_type)return n;var i=t.a,r=t.es;if(3===t.datum_type){if(0!==mg(t,!1,n))return;i=Vp,r=$p}var a=e.a,o=e.b,s=e.es;if(3===e.datum_type&&(a=Vp,o=6356752.314,s=$p),r===s&&i===a&&!gg(t.datum_type)&&!gg(e.datum_type))return n;if((n=pg(n,r,i),gg(t.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x+n[0],y:t.y+n[1],z:t.z+n[2]};if(2===e){var i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],l=n[5],c=n[6];return{x:c*(t.x-l*t.y+s*t.z)+i,y:c*(l*t.x+t.y-o*t.z)+r,z:c*(-s*t.x+o*t.y+t.z)+a}}}(n,t.datum_type,t.datum_params)),gg(e.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x-n[0],y:t.y-n[1],z:t.z-n[2]};if(2===e){var i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],l=n[5],c=n[6],u=(t.x-i)/c,h=(t.y-r)/c,f=(t.z-a)/c;return{x:u+l*h-s*f,y:-l*u+h+o*f,z:s*u-o*h+f}}}(n,e.datum_type,e.datum_params)),n=dg(n,s,a,o),3===e.datum_type)&&0!==mg(e,!0,n))return;return n}function mg(t,e,n){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var i={x:-n.x,y:n.y},r={x:Number.NaN,y:Number.NaN},a=[];t:for(var o=0;o<t.grids.length;o++){var s=t.grids[o];if(a.push(s.name),s.isNull){r=i;break}if(null!==s.grid)for(var l=s.grid.subgrids,c=0,u=l.length;c<u;c++){var h=l[c],f=(Math.abs(h.del[1])+Math.abs(h.del[0]))/1e4,p=h.ll[0]-f,d=h.ll[1]-f,g=h.ll[0]+(h.lim[0]-1)*h.del[0]+f,_=h.ll[1]+(h.lim[1]-1)*h.del[1]+f;if(!(d>i.y||p>i.x||_<i.y||g<i.x)&&(r=vg(i,e,h),!isNaN(r.x)))break t}else if(s.mandatory)return console.log("Unable to find mandatory grid '"+s.name+"'"),-1}return isNaN(r.x)?(console.log("Failed to find a grid shift table for location '"+-i.x*Zp+" "+i.y*Zp+" tried: '"+a+"'"),-1):(n.x=-r.x,n.y=r.y,0)}function vg(t,e,n){var i={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return i;var r={x:t.x,y:t.y};r.x-=n.ll[0],r.y-=n.ll[1],r.x=Id(r.x-Math.PI)+Math.PI;var a=yg(r,n);if(e){if(isNaN(a.x))return i;a.x=r.x-a.x,a.y=r.y-a.y;var o,s,l=9;do{if(s=yg(a,n),isNaN(s.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}o={x:r.x-(s.x+a.x),y:r.y-(s.y+a.y)},a.x+=o.x,a.y+=o.y}while(l--&&Math.abs(o.x)>1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),i;i.x=Id(a.x+n.ll[0]),i.y=a.y+n.ll[1]}else isNaN(a.x)||(i.x=t.x+a.x,i.y=t.y+a.y);return i}function yg(t,e){var n,i={x:t.x/e.del[0],y:t.y/e.del[1]},r=Math.floor(i.x),a=Math.floor(i.y),o=i.x-1*r,s=i.y-1*a,l={x:Number.NaN,y:Number.NaN};if(r<0||r>=e.lim[0])return l;if(a<0||a>=e.lim[1])return l;n=a*e.lim[0]+r;var c=e.cvs[n][0],u=e.cvs[n][1];n++;var h=e.cvs[n][0],f=e.cvs[n][1];n+=e.lim[0];var p=e.cvs[n][0],d=e.cvs[n][1];n--;var g=e.cvs[n][0],_=e.cvs[n][1],m=o*s,v=o*(1-s),y=(1-o)*(1-s),x=(1-o)*s;return l.x=y*c+v*h+x*g+m*p,l.y=y*u+v*f+x*_+m*d,l}function xg(t,e,n){var i,r,a,o=n.x,s=n.y,l=n.z||0,c={};for(a=0;a<3;a++)if(!e||2!==a||void 0!==n.z)switch(0===a?(i=o,r=-1!=="ew".indexOf(t.axis[a])?"x":"y"):1===a?(i=s,r=-1!=="ns".indexOf(t.axis[a])?"y":"x"):(i=l,r="z"),t.axis[a]){case"e":case"n":c[r]=i;break;case"w":case"s":c[r]=-i;break;case"u":void 0!==n[r]&&(c.z=i);break;case"d":void 0!==n[r]&&(c.z=-i);break;default:return null}return c}function bg(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function wg(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Sg(t,e,n,i){var r,a=void 0!==(n=Array.isArray(n)?bg(n):{x:n.x,y:n.y,z:n.z,m:n.m}).z;if(function(t){wg(t.x),wg(t.y)}(n),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type||3===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type||3===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(n=Sg(t,r=new fg("WGS84"),n,i),t=r),i&&"enu"!==t.axis&&(n=xg(t,!1,n)),"longlat"===t.projName)n={x:n.x*Kp,y:n.y*Kp,z:n.z||0};else if(t.to_meter&&(n={x:n.x*t.to_meter,y:n.y*t.to_meter,z:n.z||0}),!(n=t.inverse(n)))return;if(t.from_greenwich&&(n.x+=t.from_greenwich),n=_g(t.datum,e.datum,n))return e.from_greenwich&&(n={x:n.x-e.from_greenwich,y:n.y,z:n.z||0}),"longlat"===e.projName?n={x:n.x*Zp,y:n.y*Zp,z:n.z||0}:(n=e.forward(n),e.to_meter&&(n={x:n.x/e.to_meter,y:n.y/e.to_meter,z:n.z||0})),i&&"enu"!==e.axis?xg(e,!0,n):(n&&!a&&delete n.z,n)}var Mg=fg("WGS84");function Eg(t,e,n,i){var r,a,o;return Array.isArray(n)?(r=Sg(t,e,n,i)||{x:NaN,y:NaN},n.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof r.z?[r.x,r.y,r.z].concat(n.slice(3)):[r.x,r.y,n[2]].concat(n.slice(3)):[r.x,r.y].concat(n.slice(2)):[r.x,r.y]):(a=Sg(t,e,n,i),2===(o=Object.keys(n)).length||o.forEach((function(i){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===i||"y"===i||"z"===i)return}else if("x"===i||"y"===i)return;a[i]=n[i]})),a)}function Cg(t){return t instanceof fg?t:t.oProj?t.oProj:fg(t)}const Ag=function(t,e,n){t=Cg(t);var i,r=!1;return void 0===e?(e=t,t=Mg,r=!0):(void 0!==e.x||Array.isArray(e))&&(n=e,e=t,t=Mg,r=!0),e=Cg(e),n?Eg(t,e,n):(i={forward:function(n,i){return Eg(t,e,n,i)},inverse:function(n,i){return Eg(e,t,n,i)}},r&&(i.oProj=e),i)};var kg="AJSAJS",Tg="AFAFAF",Pg=65,Ng=73,Lg=79,Fg=86,Og=90;const Gg={forward:Dg,inverse:function(t){var e=jg(Ug(t.toUpperCase()));if(e.lat&&e.lon)return[e.lon,e.lat,e.lon,e.lat];return[e.left,e.bottom,e.right,e.top]},toPoint:zg};function Dg(t,e){return e=e||5,function(t,e){var n="00000"+t.easting,i="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(r=t.easting,a=t.northing,o=t.zoneNumber,s=qg(o),l=Math.floor(r/1e5),c=Math.floor(a/1e5)%20,function(t,e,n){var i=n-1,r=kg.charCodeAt(i),a=Tg.charCodeAt(i),o=r+t-1,s=a+e,l=!1;return o>Og&&(o=o-Og+Pg-1,l=!0),(o===Ng||r<Ng&&o>Ng||(o>Ng||r<Ng)&&l)&&o++,(o===Lg||r<Lg&&o>Lg||(o>Lg||r<Lg)&&l)&&++o===Ng&&o++,o>Og&&(o=o-Og+Pg-1),s>Fg?(s=s-Fg+Pg-1,l=!0):l=!1,(s===Ng||a<Ng&&s>Ng||(s>Ng||a<Ng)&&l)&&s++,(s===Lg||a<Lg&&s>Lg||(s>Lg||a<Lg)&&l)&&++s===Ng&&s++,s>Fg&&(s=s-Fg+Pg-1),String.fromCharCode(o)+String.fromCharCode(s)}(l,c,s))+n.substr(n.length-5,e)+i.substr(i.length-5,e);var r,a,o,s,l,c}(function(t){var e,n,i,r,a,o,s,l,c=t.lat,u=t.lon,h=6378137,f=.00669438,p=.9996,d=Ig(c),g=Ig(u);l=Math.floor((u+180)/6)+1,180===u&&(l=60);c>=56&&c<64&&u>=3&&u<12&&(l=32);c>=72&&c<84&&(u>=0&&u<9?l=31:u>=9&&u<21?l=33:u>=21&&u<33?l=35:u>=33&&u<42&&(l=37));s=Ig(6*(l-1)-180+3),e=f/(1-f),n=h/Math.sqrt(1-f*Math.sin(d)*Math.sin(d)),i=Math.tan(d)*Math.tan(d),r=e*Math.cos(d)*Math.cos(d),a=Math.cos(d)*(g-s),o=h*((1-f/4-3*f*f/64-5*f*f*f/256)*d-(3*f/8+3*f*f/32+45*f*f*f/1024)*Math.sin(2*d)+(15*f*f/256+45*f*f*f/1024)*Math.sin(4*d)-35*f*f*f/3072*Math.sin(6*d));var _=p*n*(a+(1-i+r)*a*a*a/6+(5-18*i+i*i+72*r-58*e)*a*a*a*a*a/120)+5e5,m=p*(o+n*Math.tan(d)*(a*a/2+(5-i+9*r+4*r*r)*a*a*a*a/24+(61-58*i+i*i+600*r-330*e)*a*a*a*a*a*a/720));c<0&&(m+=1e7);return{northing:Math.round(m),easting:Math.round(_),zoneNumber:l,zoneLetter:Bg(c)}}({lat:t[1],lon:t[0]}),e)}function zg(t){var e=jg(Ug(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Ig(t){return t*(Math.PI/180)}function Rg(t){return t/Math.PI*180}function jg(t){var e=t.northing,n=t.easting,i=t.zoneLetter,r=t.zoneNumber;if(r<0||r>60)return null;var a,o,s,l,c,u,h,f,p,d=.9996,g=6378137,_=.00669438,m=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),v=n-5e5,y=e;i<"N"&&(y-=1e7),h=6*(r-1)-180+3,a=.006739496752268451,p=(f=y/d/6367449.145945056)+(3*m/2-27*m*m*m/32)*Math.sin(2*f)+(21*m*m/16-55*m*m*m*m/32)*Math.sin(4*f)+151*m*m*m/96*Math.sin(6*f),o=g/Math.sqrt(1-_*Math.sin(p)*Math.sin(p)),s=Math.tan(p)*Math.tan(p),l=a*Math.cos(p)*Math.cos(p),c=.99330562*g/Math.pow(1-_*Math.sin(p)*Math.sin(p),1.5),u=v/(o*d);var x=p-o*Math.tan(p)/c*(u*u/2-(5+3*s+10*l-4*l*l-9*a)*u*u*u*u/24+(61+90*s+298*l+45*s*s-1.6983531815716497-3*l*l)*u*u*u*u*u*u/720);x=Rg(x);var b,w=(u-(1+2*s+l)*u*u*u/6+(5-2*l+28*s-3*l*l+8*a+24*s*s)*u*u*u*u*u/120)/Math.cos(p);if(w=h+Rg(w),t.accuracy){var S=jg({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});b={top:S.lat,right:S.lon,bottom:x,left:w}}else b={lat:x,lon:w};return b}function Bg(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function qg(t){var e=t%6;return 0===e&&(e=6),e}function Ug(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,n=t.length,i=null,r="",a=0;!/[A-Z]/.test(e=t.charAt(a));){if(a>=2)throw"MGRSPoint bad conversion from: "+t;r+=e,a++}var o=parseInt(r,10);if(0===a||a+3>n)throw"MGRSPoint bad conversion from: "+t;var s=t.charAt(a++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+t;i=t.substring(a,a+=2);for(var l=qg(o),c=function(t,e){var n=kg.charCodeAt(e-1),i=1e5,r=!1;for(;n!==t.charCodeAt(0);){if(++n===Ng&&n++,n===Lg&&n++,n>Og){if(r)throw"Bad character: "+t;n=Pg,r=!0}i+=1e5}return i}(i.charAt(0),l),u=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var n=Tg.charCodeAt(e-1),i=0,r=!1;for(;n!==t.charCodeAt(0);){if(++n===Ng&&n++,n===Lg&&n++,n>Fg){if(r)throw"Bad character: "+t;n=Pg,r=!0}i+=1e5}return i}(i.charAt(1),l);u<Wg(s);)u+=2e6;var h=n-a;if(h%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var f,p,d,g=h/2,_=0,m=0;return g>0&&(f=1e5/Math.pow(10,g),p=t.substring(a,a+g),_=parseFloat(p)*f,d=t.substring(a+g),m=parseFloat(d)*f),{easting:_+c,northing:m+u,zoneLetter:s,zoneNumber:o,accuracy:f}}function Wg(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function Hg(t,e,n){if(!(this instanceof Hg))return new Hg(t,e,n);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var i=t.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=t,this.y=e,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Hg.fromMGRS=function(t){return new Hg(zg(t))},Hg.prototype.toMGRS=function(t){return Dg([this.x,this.y],t)};const Vg=Hg;var $g=.046875,Jg=.01953125,Yg=.01068115234375;function Xg(t){var e=[];e[0]=1-t*(.25+t*($g+t*(Jg+t*Yg))),e[1]=t*(.75-t*($g+t*(Jg+t*Yg)));var n=t*t;return e[2]=n*(.46875-t*(.013020833333333334+.007120768229166667*t)),n*=t,e[3]=n*(.3645833333333333-.005696614583333333*t),e[4]=n*t*.3076171875,e}function Kg(t,e,n,i){return n*=e,e*=e,i[0]*t-n*(i[1]+e*(i[2]+e*(i[3]+e*i[4])))}function Zg(t,e,n){for(var i=1/(1-e),r=t,a=20;a;--a){var o=Math.sin(r),s=1-e*o*o;if(r-=s=(Kg(r,o,Math.cos(r),n)-t)*(s*Math.sqrt(s))*i,Math.abs(s)<Xp)return r}return r}const Qg={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=Xg(this.es),this.ml0=Kg(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,n,i,r=t.x,a=t.y,o=Id(r-this.long0),s=Math.sin(a),l=Math.cos(a);if(this.es){var c=l*o,u=Math.pow(c,2),h=this.ep2*Math.pow(l,2),f=Math.pow(h,2),p=Math.abs(l)>Xp?Math.tan(a):0,d=Math.pow(p,2),g=Math.pow(d,2);e=1-this.es*Math.pow(s,2),c/=Math.sqrt(e);var _=Kg(a,s,l,this.en);n=this.a*(this.k0*c*(1+u/6*(1-d+h+u/20*(5-18*d+g+14*h-58*d*h+u/42*(61+179*g-g*d-479*d)))))+this.x0,i=this.a*(this.k0*(_-this.ml0+s*o*c/2*(1+u/12*(5-d+9*h+4*f+u/30*(61+g-58*d+270*h-330*d*h+u/56*(1385+543*g-g*d-3111*d))))))+this.y0}else{var m=l*Math.sin(o);if(Math.abs(Math.abs(m)-1)<Xp)return 93;if(n=.5*this.a*this.k0*Math.log((1+m)/(1-m))+this.x0,i=l*Math.cos(o)/Math.sqrt(1-Math.pow(m,2)),(m=Math.abs(i))>=1){if(m-1>Xp)return 93;i=0}else i=Math.acos(i);a<0&&(i=-i),i=this.a*this.k0*(i-this.lat0)+this.y0}return t.x=n,t.y=i,t},inverse:function(t){var e,n,i,r,a=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(n=Zg(e=this.ml0+o/this.k0,this.es,this.en),Math.abs(n)<Yp){var s=Math.sin(n),l=Math.cos(n),c=Math.abs(l)>Xp?Math.tan(n):0,u=this.ep2*Math.pow(l,2),h=Math.pow(u,2),f=Math.pow(c,2),p=Math.pow(f,2);e=1-this.es*Math.pow(s,2);var d=a*Math.sqrt(e)/this.k0,g=Math.pow(d,2);i=n-(e*=c)*g/(1-this.es)*.5*(1-g/12*(5+3*f-9*u*f+u-4*h-g/30*(61+90*f-252*u*f+45*p+46*u-g/56*(1385+3633*f+4095*p+1574*p*f)))),r=Id(this.long0+d*(1-g/6*(1+2*f+u-g/20*(5+28*f+24*p+8*u*f+6*u-g/42*(61+662*f+1320*p+720*p*f))))/l)}else i=Yp*zd(o),r=0;else{var _=Math.exp(a/this.k0),m=.5*(_-1/_),v=this.lat0+o/this.k0,y=Math.cos(v);e=Math.sqrt((1-Math.pow(y,2))/(1+Math.pow(m,2))),i=Math.asin(e),o<0&&(i=-i),r=0===m&&0===y?0:Id(Math.atan2(m,y)+this.long0)}return t.x=r,t.y=i,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function t_(t){var e=Math.exp(t);return e=(e-1/e)/2}function e_(t,e){t=Math.abs(t),e=Math.abs(e);var n=Math.max(t,e),i=Math.min(t,e)/(n||1);return n*Math.sqrt(1+Math.pow(i,2))}function n_(t){var e=Math.abs(t);return e=function(t){var e=1+t,n=e-1;return 0===n?t:t*Math.log(e)/n}(e*(1+e/(e_(1,e)+1))),t<0?-e:e}function i_(t,e){for(var n,i=2*Math.cos(2*e),r=t.length-1,a=t[r],o=0;--r>=0;)n=i*a-o+t[r],o=a,a=n;return e+n*Math.sin(2*e)}function r_(t,e,n){for(var i,r,a=Math.sin(e),o=Math.cos(e),s=t_(n),l=function(t){var e=Math.exp(t);return(e+1/e)/2}(n),c=2*o*l,u=-2*a*s,h=t.length-1,f=t[h],p=0,d=0,g=0;--h>=0;)i=d,r=p,f=c*(d=f)-i-u*(p=g)+t[h],g=u*d-r+c*p;return[(c=a*l)*f-(u=o*s)*g,c*g+u*f]}const a_={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Qg.init.apply(this),this.forward=Qg.forward,this.inverse=Qg.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),n=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),n*=e,this.cgb[1]=n*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=n*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),n*=e,this.cgb[2]=n*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=n*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),n*=e,this.cgb[3]=n*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=n*(1237/630+e*(e*(-24832/14175)-2.4)),n*=e,this.cgb[4]=n*(4174/315+e*(-144838/6237)),this.cbg[4]=n*(-734/315+e*(109598/31185)),n*=e,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=n*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=n*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),n*=e,this.utg[2]=n*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=n*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),n*=e,this.utg[3]=n*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=n*(49561/161280+e*(-179/168+e*(6601661/7257600))),n*=e,this.utg[4]=n*(-4583/161280+e*(108847/3991680)),this.gtu[4]=n*(34729/80640+e*(-3418889/1995840)),n*=e,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=.6650675310896665*n;var i=i_(this.cbg,this.lat0);this.Zb=-this.Qn*(i+function(t,e){for(var n,i=2*Math.cos(e),r=t.length-1,a=t[r],o=0;--r>=0;)n=i*a-o+t[r],o=a,a=n;return Math.sin(e)*n}(this.gtu,2*i))},forward:function(t){var e=Id(t.x-this.long0),n=t.y;n=i_(this.cbg,n);var i=Math.sin(n),r=Math.cos(n),a=Math.sin(e),o=Math.cos(e);n=Math.atan2(i,o*r),e=Math.atan2(a*r,e_(i,r*o)),e=n_(Math.tan(e));var s,l,c=r_(this.gtu,2*n,2*e);return n+=c[0],e+=c[1],Math.abs(e)<=2.623395162778?(s=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*n+this.Zb)+this.y0):(s=1/0,l=1/0),t.x=s,t.y=l,t},inverse:function(t){var e,n,i=(t.x-this.x0)*(1/this.a),r=(t.y-this.y0)*(1/this.a);if(r=(r-this.Zb)/this.Qn,i/=this.Qn,Math.abs(i)<=2.623395162778){var a=r_(this.utg,2*r,2*i);r+=a[0],i+=a[1],i=Math.atan(t_(i));var o=Math.sin(r),s=Math.cos(r),l=Math.sin(i),c=Math.cos(i);r=Math.atan2(o*c,e_(l,c*s)),e=Id((i=Math.atan2(l,c*s))+this.long0),n=i_(this.cgb,r)}else e=1/0,n=1/0;return t.x=e,t.y=n,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]};const o_={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(Id(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*Kp,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,a_.init.apply(this),this.forward=a_.forward,this.inverse=a_.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function s_(t,e){return Math.pow((1-t)/(1+t),e)}const l_={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Qp)/(Math.pow(Math.tan(.5*this.lat0+Qp),this.C)*s_(this.e*t,this.ratexp))},forward:function(t){var e=t.x,n=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+Qp),this.C)*s_(this.e*Math.sin(n),this.ratexp))-Yp,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,n=t.y,i=Math.pow(Math.tan(.5*n+Qp)/this.K,1/this.C),r=20;r>0&&(n=2*Math.atan(i*s_(this.e*Math.sin(t.y),-.5*this.e))-Yp,!(Math.abs(n-t.y)<1e-14));--r)t.y=n;return r?(t.x=e,t.y=n,t):null},names:["gauss"]};const c_={init:function(){l_.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,n,i,r;return t.x=Id(t.x-this.long0),l_.forward.apply(this,[t]),e=Math.sin(t.y),n=Math.cos(t.y),i=Math.cos(t.x),r=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*n*i),t.x=r*n*Math.sin(t.x),t.y=r*(this.cosc0*e-this.sinc0*n*i),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,n,i,r,a;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,a=e_(t.x,t.y)){var o=2*Math.atan2(a,this.R2);e=Math.sin(o),n=Math.cos(o),r=Math.asin(n*this.sinc0+t.y*e*this.cosc0/a),i=Math.atan2(t.x*e,a*this.cosc0*n-t.y*this.sinc0*e)}else r=this.phic0,i=0;return t.x=i,t.y=r,l_.inverse.apply(this,[t]),t.x=Id(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};const u_={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Xp&&(this.k0=.5*(1+zd(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Xp&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Xp&&Math.abs(Math.cos(this.lat_ts))>Xp&&(this.k0=.5*this.cons*Dd(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Rd(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Dd(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Yp,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,n,i,r,a,o,s=t.x,l=t.y,c=Math.sin(l),u=Math.cos(l),h=Id(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=Xp&&Math.abs(l+this.lat0)<=Xp?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*c+this.coslat0*u*Math.cos(h)),t.x=this.a*e*u*Math.sin(h)+this.x0,t.y=this.a*e*(this.coslat0*c-this.sinlat0*u*Math.cos(h))+this.y0,t):(n=2*Math.atan(this.ssfn_(l,c,this.e))-Yp,r=Math.cos(n),i=Math.sin(n),Math.abs(this.coslat0)<=Xp?(a=Rd(this.e,l*this.con,this.con*c),o=2*this.a*this.k0*a/this.cons,t.x=this.x0+o*Math.sin(s-this.long0),t.y=this.y0-this.con*o*Math.cos(s-this.long0),t):(Math.abs(this.sinlat0)<Xp?(e=2*this.a*this.k0/(1+r*Math.cos(h)),t.y=e*i):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*i+this.cosX0*r*Math.cos(h))),t.y=e*(this.cosX0*i-this.sinX0*r*Math.cos(h))+this.y0),t.x=e*r*Math.sin(h)+this.x0,t))},inverse:function(t){var e,n,i,r,a;t.x-=this.x0,t.y-=this.y0;var o=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var s=2*Math.atan(o/(2*this.a*this.k0));return e=this.long0,n=this.lat0,o<=Xp?(t.x=e,t.y=n,t):(n=Math.asin(Math.cos(s)*this.sinlat0+t.y*Math.sin(s)*this.coslat0/o),e=Math.abs(this.coslat0)<Xp?this.lat0>0?Id(this.long0+Math.atan2(t.x,-1*t.y)):Id(this.long0+Math.atan2(t.x,t.y)):Id(this.long0+Math.atan2(t.x*Math.sin(s),o*this.coslat0*Math.cos(s)-t.y*this.sinlat0*Math.sin(s))),t.x=e,t.y=n,t)}if(Math.abs(this.coslat0)<=Xp){if(o<=Xp)return n=this.lat0,e=this.long0,t.x=e,t.y=n,t;t.x*=this.con,t.y*=this.con,i=o*this.cons/(2*this.a*this.k0),n=this.con*jd(this.e,i),e=this.con*Id(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else r=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=Xp?a=this.X0:(a=Math.asin(Math.cos(r)*this.sinX0+t.y*Math.sin(r)*this.cosX0/o),e=Id(this.long0+Math.atan2(t.x*Math.sin(r),o*this.cosX0*Math.cos(r)-t.y*this.sinX0*Math.sin(r)))),n=-1*jd(this.e,Math.tan(.5*(Yp+a)));return t.x=e,t.y=n,t},names:["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],ssfn_:function(t,e,n){return e*=n,Math.tan(.5*(Yp+t))*Math.pow((1-e)/(1+e),.5*n)}};const h_={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),n=this.a,i=1/this.rf,r=2*i-Math.pow(i,2),a=this.e=Math.sqrt(r);this.R=this.k0*n*Math.sqrt(1-r)/(1-r*Math.pow(e,2)),this.alpha=Math.sqrt(1+r/(1-r)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+a*e)/(1-a*e));this.K=o-this.alpha*s+this.alpha*a/2*l},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),i=-this.alpha*(e+n)+this.K,r=2*(Math.atan(Math.exp(i))-Math.PI/4),a=this.alpha*(t.x-this.lambda0),o=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(a))),s=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(a));return t.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,t.x=this.R*o+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,n=t.y-this.y0,i=e/this.R,r=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(i)),o=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(r))),s=this.lambda0+o/this.alpha,l=0,c=a,u=-1e3,h=0;Math.abs(c-u)>1e-7;){if(++h>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),u=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=s,t.y=c,t},names:["somerc"]};var f_=1e-7;const p_={init:function(){var t,e,n,i,r,a,o,s,l,c,u,h,f,p,d=0,g=0,_=0,m=0,v=0,y=0,x=0;this.no_off=(f=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],p="object"==typeof(h=this).projName?Object.keys(h.projName)[0]:h.projName,"no_uoff"in h||"no_off"in h||-1!==f.indexOf(p)||-1!==f.indexOf($d(p))),this.no_rot="no_rot"in this;var b=!1;"alpha"in this&&(b=!0);var w=!1;if("rectified_grid_angle"in this&&(w=!0),b&&(x=this.alpha),w&&(d=this.rectified_grid_angle),b||w)g=this.longc;else if(_=this.long1,v=this.lat1,m=this.long2,y=this.lat2,Math.abs(v-y)<=f_||(t=Math.abs(v))<=f_||Math.abs(t-Yp)<=f_||Math.abs(Math.abs(this.lat0)-Yp)<=f_||Math.abs(Math.abs(y)-Yp)<=f_)throw new Error;var S=1-this.es;e=Math.sqrt(S),Math.abs(this.lat0)>Xp?(s=Math.sin(this.lat0),n=Math.cos(this.lat0),t=1-this.es*s*s,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/S),this.A=this.B*this.k0*e/t,(r=(i=this.B*e/(n*Math.sqrt(t)))*i-1)<=0?r=0:(r=Math.sqrt(r),this.lat0<0&&(r=-r)),this.E=r+=i,this.E*=Math.pow(Rd(this.e,this.lat0,s),this.B)):(this.B=1/e,this.A=this.k0,this.E=i=r=1),b||w?(b?(u=Math.asin(Math.sin(x)/i),w||(d=x)):(u=d,x=Math.asin(i*Math.sin(u))),this.lam0=g-Math.asin(.5*(r-1/r)*Math.tan(u))/this.B):(a=Math.pow(Rd(this.e,v,Math.sin(v)),this.B),o=Math.pow(Rd(this.e,y,Math.sin(y)),this.B),r=this.E/a,l=(o-a)/(o+a),c=((c=this.E*this.E)-o*a)/(c+o*a),(t=_-m)<-Math.pi?m-=td:t>Math.pi&&(m+=td),this.lam0=Id(.5*(_+m)-Math.atan(c*Math.tan(.5*this.B*(_-m))/l)/this.B),u=Math.atan(2*Math.sin(this.B*Id(_-this.lam0))/(r-1/r)),d=x=Math.asin(i*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(d),this.cosrot=Math.cos(d),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(x))),this.lat0<0&&(this.u_0=-this.u_0)),r=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(Qp-r)),this.v_pole_s=this.ArB*Math.log(Math.tan(Qp+r))},forward:function(t){var e,n,i,r,a,o,s,l,c={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-Yp)>Xp){if(e=.5*((a=this.E/Math.pow(Rd(this.e,t.y,Math.sin(t.y)),this.B))-(o=1/a)),n=.5*(a+o),r=Math.sin(this.B*t.x),i=(e*this.singam-r*this.cosgam)/n,Math.abs(Math.abs(i)-1)<Xp)throw new Error;l=.5*this.ArB*Math.log((1-i)/(1+i)),o=Math.cos(this.B*t.x),s=Math.abs(o)<f_?this.A*t.x:this.ArB*Math.atan2(e*this.cosgam+r*this.singam,o)}else l=t.y>0?this.v_pole_n:this.v_pole_s,s=this.ArB*t.y;return this.no_rot?(c.x=s,c.y=l):(s-=this.u_0,c.x=l*this.cosrot+s*this.sinrot,c.y=s*this.cosrot-l*this.sinrot),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function(t){var e,n,i,r,a,o,s,l={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(n=t.y,e=t.x):(n=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),r=.5*((i=Math.exp(-this.BrA*n))-1/i),a=.5*(i+1/i),s=((o=Math.sin(this.BrA*e))*this.cosgam+r*this.singam)/a,Math.abs(Math.abs(s)-1)<Xp)l.x=0,l.y=s<0?-Yp:Yp;else{if(l.y=this.E/Math.sqrt((1+s)/(1-s)),l.y=jd(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(r*this.cosgam-o*this.singam,Math.cos(this.BrA*e))}return l.x+=this.lam0,l},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]};const d_={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<Xp)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),n=Math.cos(this.lat1),i=Dd(this.e,e,n),r=Rd(this.e,this.lat1,e),a=Math.sin(this.lat2),o=Math.cos(this.lat2),s=Dd(this.e,a,o),l=Rd(this.e,this.lat2,a),c=Math.abs(Math.abs(this.lat0)-Yp)<Xp?0:Rd(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>Xp?this.ns=Math.log(i/s)/Math.log(r/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=i/(this.ns*Math.pow(r,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,n=t.y;Math.abs(2*Math.abs(n)-Math.PI)<=Xp&&(n=zd(n)*(Yp-2e-10));var i,r,a=Math.abs(Math.abs(n)-Yp);if(a>Xp)i=Rd(this.e,n,Math.sin(n)),r=this.a*this.f0*Math.pow(i,this.ns);else{if((a=n*this.ns)<=0)return null;r=0}var o=this.ns*Id(e-this.long0);return t.x=this.k0*(r*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-r*Math.cos(o))+this.y0,t},inverse:function(t){var e,n,i,r,a,o=(t.x-this.x0)/this.k0,s=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+s*s),n=1):(e=-Math.sqrt(o*o+s*s),n=-1);var l=0;if(0!==e&&(l=Math.atan2(n*o,n*s)),0!==e||this.ns>0){if(n=1/this.ns,i=Math.pow(e/(this.a*this.f0),n),-9999===(r=jd(this.e,i)))return null}else r=-Yp;return a=Id(l/this.ns+this.long0),t.x=a,t.y=r,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};const g_={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,n,i,r,a,o,s,l=t.x,c=t.y,u=Id(l-this.long0);return e=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/e)-this.s45),i=-u*this.alfa,r=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),a=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(r)),o=this.n*a,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n),t.y=s*Math.cos(o)/1,t.x=s*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,n,i,r,a,o,s,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),a=Math.sqrt(t.x*t.x+t.y*t.y),r=Math.atan2(t.y,t.x)/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),n=Math.asin(Math.cos(i)*Math.sin(r)/Math.cos(e)),t.x=this.long0-n/this.alfa,o=e,s=0;var c=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-t.y)<1e-10&&(s=1),o=t.y,c+=1}while(0===s&&c<15);return c>=15?null:t},names:["Krovak","krovak"]};function __(t,e,n,i,r){return t*r-e*Math.sin(2*r)+n*Math.sin(4*r)-i*Math.sin(6*r)}function m_(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function v_(t){return.375*t*(1+.25*t*(1+.46875*t))}function y_(t){return.05859375*t*t*(1+.75*t)}function x_(t){return t*t*t*(35/3072)}function b_(t,e,n){var i=e*n;return t/Math.sqrt(1-i*i)}function w_(t){return Math.abs(t)<Yp?t:t-zd(t)*Math.PI}function S_(t,e,n,i,r){var a,o;a=t/e;for(var s=0;s<15;s++)if(a+=o=(t-(e*a-n*Math.sin(2*a)+i*Math.sin(4*a)-r*Math.sin(6*a)))/(e-2*n*Math.cos(2*a)+4*i*Math.cos(4*a)-6*r*Math.cos(6*a)),Math.abs(o)<=1e-10)return a;return NaN}const M_={init:function(){this.sphere||(this.e0=m_(this.es),this.e1=v_(this.es),this.e2=y_(this.es),this.e3=x_(this.es),this.ml0=this.a*__(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var e,n,i=t.x,r=t.y;if(i=Id(i-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(r)*Math.sin(i)),n=this.a*(Math.atan2(Math.tan(r),Math.cos(i))-this.lat0);else{var a=Math.sin(r),o=Math.cos(r),s=b_(this.a,this.e,a),l=Math.tan(r)*Math.tan(r),c=i*Math.cos(r),u=c*c,h=this.es*o*o/(1-this.es);e=s*c*(1-u*l*(1/6-(8-l+8*h)*u/120)),n=this.a*__(this.e0,this.e1,this.e2,this.e3,r)-this.ml0+s*a/o*u*(.5+(5-l+6*h)*u/24)}return t.x=e+this.x0,t.y=n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,n,i=t.x/this.a,r=t.y/this.a;if(this.sphere){var a=r+this.lat0;e=Math.asin(Math.sin(a)*Math.cos(i)),n=Math.atan2(Math.tan(i),Math.cos(a))}else{var o=S_(this.ml0/this.a+r,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-Yp)<=Xp)return t.x=this.long0,t.y=Yp,r<0&&(t.y*=-1),t;var s=b_(this.a,this.e,Math.sin(o)),l=s*s*s/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(o),2),u=i*this.a/s,h=u*u;e=o-s*Math.tan(o)/l*u*u*(.5-(1+3*c)*u*u/24),n=u*(1-h*(c/3+(1+3*c)*c*h/15))/Math.cos(o)}return t.x=Id(n+this.long0),t.y=w_(e),t},names:["Cassini","Cassini_Soldner","cass"]};function E_(t,e){var n;return t>1e-7?(1-t*t)*(e/(1-(n=t*e)*n)-.5/t*Math.log((1-n)/(1+n))):2*e}var C_=.3333333333333333,A_=.17222222222222222,k_=.10257936507936508,T_=.06388888888888888,P_=.0664021164021164,N_=.016415012942191543;const L_={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-Yp)<Xp?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<Xp?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=E_(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,n=[];return n[0]=t*C_,e=t*t,n[0]+=e*A_,n[1]=e*T_,e*=t,n[0]+=e*k_,n[1]+=e*P_,n[2]=e*N_,n}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=E_(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,n,i,r,a,o,s,l,c,u,h=t.x,f=t.y;if(h=Id(h-this.long0),this.sphere){if(a=Math.sin(f),u=Math.cos(f),i=Math.cos(h),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((n=this.mode===this.EQUIT?1+u*i:1+this.sinph0*a+this.cosph0*u*i)<=Xp)return null;e=(n=Math.sqrt(2/n))*u*Math.sin(h),n*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*u*i}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(f+this.lat0)<Xp)return null;n=Qp-.5*f,e=(n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)))*Math.sin(h),n*=i}}else{switch(s=0,l=0,c=0,i=Math.cos(h),r=Math.sin(h),a=Math.sin(f),o=E_(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(s=o/this.qp,l=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:c=1+this.sinb1*s+this.cosb1*l*i;break;case this.EQUIT:c=1+l*i;break;case this.N_POLE:c=Yp+f,o=this.qp-o;break;case this.S_POLE:c=f-Yp,o=this.qp+o}if(Math.abs(c)<Xp)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:c=Math.sqrt(2/c),n=this.mode===this.OBLIQ?this.ymf*c*(this.cosb1*s-this.sinb1*l*i):(c=Math.sqrt(2/(1+l*i)))*s*this.ymf,e=this.xmf*c*l*r;break;case this.N_POLE:case this.S_POLE:o>=0?(e=(c=Math.sqrt(o))*r,n=i*(this.mode===this.S_POLE?c:-c)):e=n=0}}return t.x=this.a*e+this.x0,t.y=this.a*n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,n,i,r,a,o,s,l=t.x/this.a,c=t.y/this.a;if(this.sphere){var u,h=0,f=0;if((n=.5*(u=Math.sqrt(l*l+c*c)))>1)return null;switch(n=2*Math.asin(n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(f=Math.sin(n),h=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(u)<=Xp?0:Math.asin(c*f/u),l*=f,c=h*u;break;case this.OBLIQ:n=Math.abs(u)<=Xp?this.lat0:Math.asin(h*this.sinph0+c*f*this.cosph0/u),l*=f*this.cosph0,c=(h-Math.sin(n)*this.sinph0)*u;break;case this.N_POLE:c=-c,n=Yp-n;break;case this.S_POLE:n-=Yp}e=0!==c||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(l,c):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(l/=this.dd,c*=this.dd,(o=Math.sqrt(l*l+c*c))<Xp)return t.x=this.long0,t.y=this.lat0,t;r=2*Math.asin(.5*o/this.rq),i=Math.cos(r),l*=r=Math.sin(r),this.mode===this.OBLIQ?(s=i*this.sinb1+c*r*this.cosb1/o,a=this.qp*s,c=o*this.cosb1*i-c*this.sinb1*r):(s=c*r/o,a=this.qp*s,c=o*i)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(c=-c),!(a=l*l+c*c))return t.x=this.long0,t.y=this.lat0,t;s=1-a/this.qp,this.mode===this.S_POLE&&(s=-s)}e=Math.atan2(l,c),n=function(t,e){var n=t+t;return t+e[0]*Math.sin(n)+e[1]*Math.sin(n+n)+e[2]*Math.sin(n+n+n)}(Math.asin(s),this.apa)}return t.x=Id(this.long0+e),t.y=n,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function F_(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}const O_={init:function(){Math.abs(this.lat1+this.lat2)<Xp||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Dd(this.e3,this.sin_po,this.cos_po),this.qs1=E_(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Dd(this.e3,this.sin_po,this.cos_po),this.qs2=E_(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=E_(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>Xp?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,n=t.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var i=E_(this.e3,this.sin_phi),r=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,a=this.ns0*Id(e-this.long0),o=r*Math.sin(a)+this.x0,s=this.rh-r*Math.cos(a)+this.y0;return t.x=o,t.y=s,t},inverse:function(t){var e,n,i,r,a,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1),r=0,0!==e&&(r=Math.atan2(i*t.x,i*t.y)),i=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-i*i)/(2*this.ns0)):(n=(this.c-i*i)/this.ns0,o=this.phi1z(this.e3,n)),a=Id(r/this.ns0+this.long0),t.x=a,t.y=o,t},names:["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"],phi1z:function(t,e){var n,i,r,a,o=F_(.5*e);if(t<Xp)return o;for(var s=t*t,l=1;l<=25;l++)if(o+=a=.5*(r=1-(i=t*(n=Math.sin(o)))*i)*r/Math.cos(o)*(e/(1-s)-n/r+.5/t*Math.log((1-i)/(1+i))),Math.abs(a)<=1e-7)return o;return null}};const G_={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var e,n,i,r,a,o,s,l=t.x,c=t.y;return i=Id(l-this.long0),e=Math.sin(c),n=Math.cos(c),r=Math.cos(i),(a=this.sin_p14*e+this.cos_p14*n*r)>0||Math.abs(a)<=Xp?(o=this.x0+1*this.a*n*Math.sin(i)/a,s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*r)/a):(o=this.x0+this.infinity_dist*n*Math.sin(i),s=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*n*r)),t.x=o,t.y=s,t},inverse:function(t){var e,n,i,r,a,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(r=Math.atan2(e,this.rc),n=Math.sin(r),o=F_((i=Math.cos(r))*this.sin_p14+t.y*n*this.cos_p14/e),a=Math.atan2(t.x*n,e*this.cos_p14*i-t.y*this.sin_p14*n),a=Id(this.long0+a)):(o=this.phic0,a=0),t.x=a,t.y=o,t},names:["gnom"]};const D_={init:function(){this.sphere||(this.k0=Dd(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,n,i=t.x,r=t.y,a=Id(i-this.long0);if(this.sphere)e=this.x0+this.a*a*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(r)/Math.cos(this.lat_ts);else{var o=E_(this.e,Math.sin(r));e=this.x0+this.a*this.k0*a,n=this.y0+this.a*o*.5/this.k0}return t.x=e,t.y=n,t},inverse:function(t){var e,n;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=Id(this.long0+t.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(n=function(t,e){var n=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-n)<1e-6)return e<0?-1*Yp:Yp;for(var i,r,a,o,s=Math.asin(.5*e),l=0;l<30;l++)if(r=Math.sin(s),a=Math.cos(s),o=t*r,s+=i=Math.pow(1-o*o,2)/(2*a)*(e/(1-t*t)-r/(1-o*o)+.5/t*Math.log((1-o)/(1+o))),Math.abs(i)<=1e-10)return s;return NaN}(this.e,2*t.y*this.k0/this.a),e=Id(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=n,t},names:["cea"]};const z_={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,n=t.y,i=Id(e-this.long0),r=w_(n-this.lat0);return t.x=this.x0+this.a*i*this.rc,t.y=this.y0+this.a*r,t},inverse:function(t){var e=t.x,n=t.y;return t.x=Id(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=w_(this.lat0+(n-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"]};const I_={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=m_(this.es),this.e1=v_(this.es),this.e2=y_(this.es),this.e3=x_(this.es),this.ml0=this.a*__(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,n,i,r=t.x,a=t.y,o=Id(r-this.long0);if(i=o*Math.sin(a),this.sphere)Math.abs(a)<=Xp?(e=this.a*o,n=-1*this.a*this.lat0):(e=this.a*Math.sin(i)/Math.tan(a),n=this.a*(w_(a-this.lat0)+(1-Math.cos(i))/Math.tan(a)));else if(Math.abs(a)<=Xp)e=this.a*o,n=-1*this.ml0;else{var s=b_(this.a,this.e,Math.sin(a))/Math.tan(a);e=s*Math.sin(i),n=this.a*__(this.e0,this.e1,this.e2,this.e3,a)-this.ml0+s*(1-Math.cos(i))}return t.x=e+this.x0,t.y=n+this.y0,t},inverse:function(t){var e,n,i,r,a,o,s,l,c;if(i=t.x-this.x0,r=t.y-this.y0,this.sphere)if(Math.abs(r+this.a*this.lat0)<=Xp)e=Id(i/this.a+this.long0),n=0;else{var u;for(o=this.lat0+r/this.a,s=i*i/this.a/this.a+o*o,l=o,a=20;a;--a)if(l+=c=-1*(o*(l*(u=Math.tan(l))+1)-l-.5*(l*l+s)*u)/((l-o)/u-1),Math.abs(c)<=Xp){n=l;break}e=Id(this.long0+Math.asin(i*Math.tan(l)/this.a)/Math.sin(n))}else if(Math.abs(r+this.ml0)<=Xp)n=0,e=Id(this.long0+i/this.a);else{var h,f,p,d,g;for(o=(this.ml0+r)/this.a,s=i*i/this.a/this.a+o*o,l=o,a=20;a;--a)if(g=this.e*Math.sin(l),h=Math.sqrt(1-g*g)*Math.tan(l),f=this.a*__(this.e0,this.e1,this.e2,this.e3,l),p=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=c=(o*(h*(d=f/this.a)+1)-d-.5*h*(d*d+s))/(this.es*Math.sin(2*l)*(d*d+s-2*o*d)/(4*h)+(o-d)*(h*p-2/Math.sin(2*l))-p),Math.abs(c)<=Xp){n=l;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),e=Id(this.long0+Math.asin(i*h/this.a)/Math.sin(n))}return t.x=e,t.y=n,t},names:["Polyconic","American_Polyconic","poly"]};const R_={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,n=t.x,i=t.y-this.lat0,r=n-this.long0,a=i/Jp*1e-5,o=r,s=1,l=0;for(e=1;e<=10;e++)s*=a,l+=this.A[e]*s;var c,u=l,h=o,f=1,p=0,d=0,g=0;for(e=1;e<=6;e++)c=p*u+f*h,f=f*u-p*h,p=c,d=d+this.B_re[e]*f-this.B_im[e]*p,g=g+this.B_im[e]*f+this.B_re[e]*p;return t.x=g*this.a+this.x0,t.y=d*this.a+this.y0,t},inverse:function(t){var e,n,i=t.x,r=t.y,a=i-this.x0,o=(r-this.y0)/this.a,s=a/this.a,l=1,c=0,u=0,h=0;for(e=1;e<=6;e++)n=c*o+l*s,l=l*o-c*s,c=n,u=u+this.C_re[e]*l-this.C_im[e]*c,h=h+this.C_im[e]*l+this.C_re[e]*c;for(var f=0;f<this.iterations;f++){var p,d=u,g=h,_=o,m=s;for(e=2;e<=6;e++)p=g*u+d*h,d=d*u-g*h,g=p,_+=(e-1)*(this.B_re[e]*d-this.B_im[e]*g),m+=(e-1)*(this.B_im[e]*d+this.B_re[e]*g);d=1,g=0;var v=this.B_re[1],y=this.B_im[1];for(e=2;e<=6;e++)p=g*u+d*h,d=d*u-g*h,g=p,v+=e*(this.B_re[e]*d-this.B_im[e]*g),y+=e*(this.B_im[e]*d+this.B_re[e]*g);var x=v*v+y*y;u=(_*v+m*y)/x,h=(m*v-_*y)/x}var b=u,w=h,S=1,M=0;for(e=1;e<=9;e++)S*=b,M+=this.D[e]*S;var E=this.lat0+M*Jp*1e5,C=this.long0+w;return t.x=C,t.y=E,t},names:["New_Zealand_Map_Grid","nzmg"]};const j_={init:function(){},forward:function(t){var e=t.x,n=t.y,i=Id(e-this.long0),r=this.x0+this.a*i,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return t.x=r,t.y=a,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e=Id(this.long0+t.x/this.a),n=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=n,t},names:["Miller_Cylindrical","mill"]};const B_={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Xg(this.es)},forward:function(t){var e,n,i=t.x,r=t.y;if(i=Id(i-this.long0),this.sphere){if(this.m)for(var a=this.n*Math.sin(r),o=20;o;--o){var s=(this.m*r+Math.sin(r)-a)/(this.m+Math.cos(r));if(r-=s,Math.abs(s)<Xp)break}else r=1!==this.n?Math.asin(this.n*Math.sin(r)):r;e=this.a*this.C_x*i*(this.m+Math.cos(r)),n=this.a*this.C_y*r}else{var l=Math.sin(r),c=Math.cos(r);n=this.a*Kg(r,l,c,this.en),e=this.a*i*c/Math.sqrt(1-this.es*l*l)}return t.x=e,t.y=n,t},inverse:function(t){var e,n,i;return t.x-=this.x0,n=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,n/=this.C_x*(this.m+Math.cos(e)),this.m?e=F_((this.m*e+Math.sin(e))/this.n):1!==this.n&&(e=F_(Math.sin(e)/this.n)),n=Id(n+this.long0),e=w_(e)):(e=Zg(t.y/this.a,this.es,this.en),(i=Math.abs(e))<Yp?(i=Math.sin(e),n=Id(this.long0+t.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(e)))):i-Xp<Yp&&(n=this.long0)),t.x=n,t.y=e,t},names:["Sinusoidal","sinu"]};const q_={init:function(){},forward:function(t){for(var e=t.x,n=t.y,i=Id(e-this.long0),r=n,a=Math.PI*Math.sin(n);;){var o=-(r+Math.sin(r)-a)/(1+Math.cos(r));if(r+=o,Math.abs(o)<Xp)break}r/=2,Math.PI/2-Math.abs(n)<Xp&&(i=0);var s=.900316316158*this.a*i*Math.cos(r)+this.x0,l=1.4142135623731*this.a*Math.sin(r)+this.y0;return t.x=s,t.y=l,t},inverse:function(t){var e,n;t.x-=this.x0,t.y-=this.y0,n=t.y/(1.4142135623731*this.a),Math.abs(n)>.999999999999&&(n=.999999999999),e=Math.asin(n);var i=Id(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),n=(2*e+Math.sin(2*e))/Math.PI,Math.abs(n)>1&&(n=1);var r=Math.asin(n);return t.x=i,t.y=r,t},names:["Mollweide","moll"]};const U_={init:function(){Math.abs(this.lat1+this.lat2)<Xp||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=m_(this.es),this.e1=v_(this.es),this.e2=y_(this.es),this.e3=x_(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=Dd(this.e,this.sinphi,this.cosphi),this.ml1=__(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<Xp?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Dd(this.e,this.sinphi,this.cosphi),this.ml2=__(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=__(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,n=t.x,i=t.y;if(this.sphere)e=this.a*(this.g-i);else{var r=__(this.e0,this.e1,this.e2,this.e3,i);e=this.a*(this.g-r)}var a=this.ns*Id(n-this.long0),o=this.x0+e*Math.sin(a),s=this.y0+this.rh-e*Math.cos(a);return t.x=o,t.y=s,t},inverse:function(t){var e,n,i,r;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(n=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(n=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var a=0;return 0!==n&&(a=Math.atan2(e*t.x,e*t.y)),this.sphere?(r=Id(this.long0+a/this.ns),i=w_(this.g-n/this.a),t.x=r,t.y=i,t):(i=S_(this.g-n/this.a,this.e0,this.e1,this.e2,this.e3),r=Id(this.long0+a/this.ns),t.x=r,t.y=i,t)},names:["Equidistant_Conic","eqdc"]};const W_={init:function(){this.R=this.a},forward:function(t){var e,n,i=t.x,r=t.y,a=Id(i-this.long0);Math.abs(r)<=Xp&&(e=this.x0+this.R*a,n=this.y0);var o=F_(2*Math.abs(r/Math.PI));(Math.abs(a)<=Xp||Math.abs(Math.abs(r)-Yp)<=Xp)&&(e=this.x0,n=r>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var s=.5*Math.abs(Math.PI/a-a/Math.PI),l=s*s,c=Math.sin(o),u=Math.cos(o),h=u/(c+u-1),f=h*h,p=h*(2/c-1),d=p*p,g=Math.PI*this.R*(s*(h-d)+Math.sqrt(l*(h-d)*(h-d)-(d+l)*(f-d)))/(d+l);a<0&&(g=-g),e=this.x0+g;var _=l+h;return g=Math.PI*this.R*(p*_-s*Math.sqrt((d+l)*(l+1)-_*_))/(d+l),n=r>=0?this.y0+g:this.y0-g,t.x=e,t.y=n,t},inverse:function(t){var e,n,i,r,a,o,s,l,c,u,h,f;return t.x-=this.x0,t.y-=this.y0,h=Math.PI*this.R,a=(i=t.x/h)*i+(r=t.y/h)*r,h=3*(r*r/(l=-2*(o=-Math.abs(r)*(1+a))+1+2*r*r+a*a)+(2*(s=o-2*r*r+i*i)*s*s/l/l/l-9*o*s/l/l)/27)/(c=(o-s*s/3/l)/l)/(u=2*Math.sqrt(-c/3)),Math.abs(h)>1&&(h=h>=0?1:-1),f=Math.acos(h)/3,n=t.y>=0?(-u*Math.cos(f+Math.PI/3)-s/3/l)*Math.PI:-(-u*Math.cos(f+Math.PI/3)-s/3/l)*Math.PI,e=Math.abs(i)<Xp?this.long0:Id(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(i*i-r*r)+a*a))/2/i),t.x=e,t.y=n,t},names:["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"]};var H_=n(387);const V_={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.g=new H_.Geodesic.Geodesic(this.a,this.es/(1+Math.sqrt(1-this.es)))},forward:function(t){var e,n,i,r,a,o,s,l,c,u,h,f,p,d,g,_=t.x,m=t.y,v=Math.sin(t.y),y=Math.cos(t.y),x=Id(_-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=Xp?(t.x=this.x0+this.a*(Yp-m)*Math.sin(x),t.y=this.y0-this.a*(Yp-m)*Math.cos(x),t):Math.abs(this.sin_p12+1)<=Xp?(t.x=this.x0+this.a*(Yp+m)*Math.sin(x),t.y=this.y0+this.a*(Yp+m)*Math.cos(x),t):(c=this.sin_p12*v+this.cos_p12*y*Math.cos(x),l=(s=Math.acos(c))?s/Math.sin(s):1,t.x=this.x0+this.a*l*y*Math.sin(x),t.y=this.y0+this.a*l*(this.cos_p12*v-this.sin_p12*y*Math.cos(x)),t):(e=m_(this.es),n=v_(this.es),i=y_(this.es),r=x_(this.es),Math.abs(this.sin_p12-1)<=Xp?(a=this.a*__(e,n,i,r,Yp),o=this.a*__(e,n,i,r,m),t.x=this.x0+(a-o)*Math.sin(x),t.y=this.y0-(a-o)*Math.cos(x),t):Math.abs(this.sin_p12+1)<=Xp?(a=this.a*__(e,n,i,r,Yp),o=this.a*__(e,n,i,r,m),t.x=this.x0+(a+o)*Math.sin(x),t.y=this.y0+(a+o)*Math.cos(x),t):Math.abs(_)<Xp&&Math.abs(m-this.lat0)<Xp?(t.x=t.y=0,t):(u=this.lat0/Kp,h=this.long0/Kp,f=m/Kp,p=_/Kp,g=(d=this.g.Inverse(u,h,f,p,this.g.AZIMUTH)).azi1*Kp,t.x=d.s12*Math.sin(g),t.y=d.s12*Math.cos(g),t))},inverse:function(t){var e,n,i,r,a,o,s,l,c,u,h,f,p,d,g,_,m;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*Yp*this.a)return;return n=e/this.a,i=Math.sin(n),r=Math.cos(n),a=this.long0,Math.abs(e)<=Xp?o=this.lat0:(o=F_(r*this.sin_p12+t.y*i*this.cos_p12/e),s=Math.abs(this.lat0)-Yp,a=Math.abs(s)<=Xp?this.lat0>=0?Id(this.long0+Math.atan2(t.x,-t.y)):Id(this.long0-Math.atan2(-t.x,t.y)):Id(this.long0+Math.atan2(t.x*i,e*this.cos_p12*r-t.y*this.sin_p12*i))),t.x=a,t.y=o,t}return l=m_(this.es),c=v_(this.es),u=y_(this.es),h=x_(this.es),Math.abs(this.sin_p12-1)<=Xp?(o=S_(((f=this.a*__(l,c,u,h,Yp))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,l,c,u,h),a=Id(this.long0+Math.atan2(t.x,-1*t.y)),t.x=a,t.y=o,t):Math.abs(this.sin_p12+1)<=Xp?(f=this.a*__(l,c,u,h,Yp),o=S_(((e=Math.sqrt(t.x*t.x+t.y*t.y))-f)/this.a,l,c,u,h),a=Id(this.long0+Math.atan2(t.x,t.y)),t.x=a,t.y=o,t):(p=this.lat0/Kp,d=this.long0/Kp,g=Math.atan2(t.x,t.y)/Kp,_=Math.sqrt(t.x*t.x+t.y*t.y),m=this.g.Direct(p,d,g,_,this.g.STANDARD),t.x=m.lon2*Kp,t.y=m.lat2*Kp,t)},names:["Azimuthal_Equidistant","aeqd"]};const $_={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,n,i,r,a,o,s,l=t.x,c=t.y;return i=Id(l-this.long0),e=Math.sin(c),n=Math.cos(c),r=Math.cos(i),((a=this.sin_p14*e+this.cos_p14*n*r)>0||Math.abs(a)<=Xp)&&(o=1*this.a*n*Math.sin(i),s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*r)),t.x=o,t.y=s,t},inverse:function(t){var e,n,i,r,a,o,s;return t.x-=this.x0,t.y-=this.y0,n=F_((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),i=Math.sin(n),r=Math.cos(n),o=this.long0,Math.abs(e)<=Xp?(s=this.lat0,t.x=o,t.y=s,t):(s=F_(r*this.sin_p14+t.y*i*this.cos_p14/e),a=Math.abs(this.lat0)-Yp,Math.abs(a)<=Xp?(o=this.lat0>=0?Id(this.long0+Math.atan2(t.x,-t.y)):Id(this.long0-Math.atan2(-t.x,t.y)),t.x=o,t.y=s,t):(o=Id(this.long0+Math.atan2(t.x*i,e*this.cos_p14*r-t.y*this.sin_p14*i)),t.x=o,t.y=s,t))},names:["ortho"]};var J_=1,Y_=2,X_=3,K_=4,Z_=5,Q_=6,tm=1,em=2,nm=3,im=4;function rm(t,e,n,i){var r;return t<Xp?(i.value=tm,r=0):(r=Math.atan2(e,n),Math.abs(r)<=Qp?i.value=tm:r>Qp&&r<=Yp+Qp?(i.value=em,r-=Yp):r>Yp+Qp||r<=-(Yp+Qp)?(i.value=nm,r=r>=0?r-ed:r+ed):(i.value=im,r+=Yp)),r}function am(t,e){var n=t+e;return n<-ed?n+=td:n>+ed&&(n-=td),n}const om={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Yp-Qp/2?this.face=Z_:this.lat0<=-(Yp-Qp/2)?this.face=Q_:Math.abs(this.long0)<=Qp?this.face=J_:Math.abs(this.long0)<=Yp+Qp?this.face=this.long0>0?Y_:K_:this.face=X_,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,n,i,r,a,o,s={x:0,y:0},l={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,n=t.x,this.face===Z_)r=Yp-e,n>=Qp&&n<=Yp+Qp?(l.value=tm,i=n-Yp):n>Yp+Qp||n<=-(Yp+Qp)?(l.value=em,i=n>0?n-ed:n+ed):n>-(Yp+Qp)&&n<=-Qp?(l.value=nm,i=n+Yp):(l.value=im,i=n);else if(this.face===Q_)r=Yp+e,n>=Qp&&n<=Yp+Qp?(l.value=tm,i=-n+Yp):n<Qp&&n>=-Qp?(l.value=em,i=-n):n<-Qp&&n>=-(Yp+Qp)?(l.value=nm,i=-n-Yp):(l.value=im,i=n>0?-n+ed:-n-ed);else{var c,u,h,f,p,d;this.face===Y_?n=am(n,+Yp):this.face===X_?n=am(n,+ed):this.face===K_&&(n=am(n,-Yp)),f=Math.sin(e),p=Math.cos(e),d=Math.sin(n),c=p*Math.cos(n),u=p*d,h=f,this.face===J_?i=rm(r=Math.acos(c),h,u,l):this.face===Y_?i=rm(r=Math.acos(u),h,-c,l):this.face===X_?i=rm(r=Math.acos(-c),h,-u,l):this.face===K_?i=rm(r=Math.acos(-u),h,c,l):(r=i=0,l.value=tm)}return o=Math.atan(12/ed*(i+Math.acos(Math.sin(i)*Math.cos(Qp))-Yp)),a=Math.sqrt((1-Math.cos(r))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===em?o+=Yp:l.value===nm?o+=ed:l.value===im&&(o+=1.5*ed),s.x=a*Math.cos(o),s.y=a*Math.sin(o),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,t.x=s.x,t.y=s.y,t},inverse:function(t){var e,n,i,r,a,o,s,l,c,u,h,f,p={lam:0,phi:0},d={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,n=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?d.value=tm:t.y>=0&&t.y>=Math.abs(t.x)?(d.value=em,e-=Yp):t.x<0&&-t.x>=Math.abs(t.y)?(d.value=nm,e=e<0?e+ed:e-ed):(d.value=im,e+=Yp),c=ed/12*Math.tan(e),a=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),o=Math.atan(a),(s=1-(i=Math.cos(e))*i*(r=Math.tan(n))*r*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?s=-1:s>1&&(s=1),this.face===Z_)l=Math.acos(s),p.phi=Yp-l,d.value===tm?p.lam=o+Yp:d.value===em?p.lam=o<0?o+ed:o-ed:d.value===nm?p.lam=o-Yp:p.lam=o;else if(this.face===Q_)l=Math.acos(s),p.phi=l-Yp,d.value===tm?p.lam=-o+Yp:d.value===em?p.lam=-o:d.value===nm?p.lam=-o-Yp:p.lam=o<0?-o-ed:-o+ed;else{var g,_,m;c=(g=s)*g,_=(c+=(m=c>=1?0:Math.sqrt(1-c)*Math.sin(o))*m)>=1?0:Math.sqrt(1-c),d.value===em?(c=_,_=-m,m=c):d.value===nm?(_=-_,m=-m):d.value===im&&(c=_,_=m,m=-c),this.face===Y_?(c=g,g=-_,_=c):this.face===X_?(g=-g,_=-_):this.face===K_&&(c=g,g=_,_=-c),p.phi=Math.acos(-m)-Yp,p.lam=Math.atan2(_,g),this.face===Y_?p.lam=am(p.lam,-Yp):this.face===X_?p.lam=am(p.lam,-ed):this.face===K_&&(p.lam=am(p.lam,+Yp))}return 0!==this.es&&(u=p.phi<0?1:0,h=Math.tan(p.phi),f=this.b/Math.sqrt(h*h+this.one_minus_f_squared),p.phi=Math.atan(Math.sqrt(this.a*this.a-f*f)/(this.one_minus_f*f)),u&&(p.phi=-p.phi)),p.lam+=this.long0,t.x=p.lam,t.y=p.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var sm=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],lm=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],cm=.8487,um=1.3523,hm=Zp/5,fm=1/hm,pm=18,dm=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};const gm={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=Id(t.x-this.long0),n=Math.abs(t.y),i=Math.floor(n*hm);i<0?i=0:i>=pm&&(i=17);var r={x:dm(sm[i],n=Zp*(n-fm*i))*e,y:dm(lm[i],n)};return t.y<0&&(r.y=-r.y),r.x=r.x*this.a*cm+this.x0,r.y=r.y*this.a*um+this.y0,r},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*cm),y:Math.abs(t.y-this.y0)/(this.a*um)};if(e.y>=1)e.x/=sm[18][0],e.y=t.y<0?-Yp:Yp;else{var n=Math.floor(e.y*pm);for(n<0?n=0:n>=pm&&(n=17);;)if(lm[n][0]>e.y)--n;else{if(!(lm[n+1][0]<=e.y))break;++n}var i=lm[n],r=5*(e.y-i[0])/(lm[n+1][0]-i[0]);r=function(t,e,n,i){for(var r=e;i;--i){var a=t(r);if(r-=a,Math.abs(a)<n)break}return r}((function(t){return(dm(i,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(i,t)}),r,Xp,100),e.x/=dm(sm[n],r),e.y=(5*n+r)*Kp,t.y<0&&(e.y=-e.y)}return e.x=Id(e.x+this.long0),e},names:["Robinson","robin"]};const _m={init:function(){this.name="geocent"},forward:function(t){return pg(t,this.es,this.a)},inverse:function(t){return dg(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var mm=0,vm=1,ym=2,xm=3,bm={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};const wm={init:function(){if(Object.keys(bm).forEach(function(t){if(void 0===this[t])this[t]=bm[t].def;else{if(bm[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);bm[t].num&&(this[t]=parseFloat(this[t]))}bm[t].degrees&&(this[t]=this[t]*Kp)}.bind(this)),Math.abs(Math.abs(this.lat0)-Yp)<Xp?this.mode=this.lat0<0?vm:mm:Math.abs(this.lat0)<Xp?this.mode=ym:(this.mode=xm,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var e,n,i,r,a=Math.sin(t.y),o=Math.cos(t.y),s=Math.cos(t.x);switch(this.mode){case xm:n=this.sinph0*a+this.cosph0*o*s;break;case ym:n=o*s;break;case vm:n=-a;break;case mm:n=a}switch(e=(n=this.pn1/(this.p-n))*o*Math.sin(t.x),this.mode){case xm:n*=this.cosph0*a-this.sinph0*o*s;break;case ym:n*=a;break;case mm:n*=-o*s;break;case vm:n*=o*s}return r=1/((i=n*this.cg+e*this.sg)*this.sw*this.h1+this.cw),e=(e*this.cg-n*this.sg)*this.cw*r,n=i*r,t.x=e*this.a,t.y=n*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var e,n,i,r={x:t.x,y:t.y};i=1/(this.pn1-t.y*this.sw),e=this.pn1*t.x*i,n=this.pn1*t.y*this.cw*i,t.x=e*this.cg+n*this.sg,t.y=n*this.cg-e*this.sg;var a=e_(t.x,t.y);if(Math.abs(a)<Xp)r.x=0,r.y=t.y;else{var o,s;switch(s=1-a*a*this.pfact,s=(this.p-Math.sqrt(s))/(this.pn1/a+a/this.pn1),o=Math.sqrt(1-s*s),this.mode){case xm:r.y=Math.asin(o*this.sinph0+t.y*s*this.cosph0/a),t.y=(o-this.sinph0*Math.sin(r.y))*a,t.x*=s*this.cosph0;break;case ym:r.y=Math.asin(t.y*s/a),t.y=o*a,t.x*=s;break;case mm:r.y=Math.asin(o),t.y=-t.y;break;case vm:r.y=-Math.asin(o)}r.x=Math.atan2(t.x,t.y)}return t.x=r.x+this.long0,t.y=r.y,t},names:["Tilted_Perspective","tpers"]};const Sm={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,n,i,r,a=t.x,o=t.y;if(a-=this.long0,"ellipse"===this.shape){o=Math.atan(this.radius_p2*Math.tan(o));var s=this.radius_p/e_(this.radius_p*Math.cos(o),Math.sin(o));if(n=s*Math.cos(a)*Math.cos(o),i=s*Math.sin(a)*Math.cos(o),r=s*Math.sin(o),(this.radius_g-n)*n-i*i-r*r*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(i/e_(r,e)),t.y=this.radius_g_1*Math.atan(r/e)):(t.x=this.radius_g_1*Math.atan(i/e),t.y=this.radius_g_1*Math.atan(r/e_(i,e)))}else"sphere"===this.shape&&(e=Math.cos(o),n=Math.cos(a)*e,i=Math.sin(a)*e,r=Math.sin(o),e=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(i/e_(r,e)),t.y=this.radius_g_1*Math.atan(r/e)):(t.x=this.radius_g_1*Math.atan(i/e),t.y=this.radius_g_1*Math.atan(r/e_(i,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,n,i,r,a=-1,o=0,s=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*e_(1,s)):(o=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*e_(1,o));var l=s/this.radius_p;if(e=o*o+l*l+a*a,(i=(n=2*this.radius_g*a)*n-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;r=(-n-Math.sqrt(i))/(2*e),a=this.radius_g+r*a,o*=r,s*=r,t.x=Math.atan2(o,a),t.y=Math.atan(s*Math.cos(t.x)/a),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+s*s)):(o=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+o*o)),e=o*o+s*s+a*a,(i=(n=2*this.radius_g*a)*n-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;r=(-n-Math.sqrt(i))/(2*e),a=this.radius_g+r*a,o*=r,s*=r,t.x=Math.atan2(o,a),t.y=Math.atan(s*Math.cos(t.x)/a)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var Mm=1.340264,Em=-.081106,Cm=893e-6,Am=.003796,km=Math.sqrt(3)/2;const Tm={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function(t){var e=Id(t.x-this.long0),n=t.y,i=Math.asin(km*Math.sin(n)),r=i*i,a=r*r*r;return t.x=e*Math.cos(i)/(km*(Mm+3*Em*r+a*(7*Cm+9*Am*r))),t.y=i*(Mm+Em*r+a*(Cm+Am*r)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var e,n,i,r,a=t.y;for(r=0;r<12&&(a-=i=(a*(Mm+Em*(e=a*a)+(n=e*e*e)*(Cm+Am*e))-t.y)/(Mm+3*Em*e+n*(7*Cm+9*Am*e)),!(Math.abs(i)<1e-9));++r);return n=(e=a*a)*e*e,t.x=km*t.x*(Mm+3*Em*e+n*(7*Cm+9*Am*e))/Math.cos(a),t.y=Math.asin(Math.sin(a)/km),t.x=Id(t.x+this.long0),t},names:["eqearth","Equal Earth","Equal_Earth"]};var Pm=1e-10;function Nm(t){var e,n,i,r=Id(t.x-(this.long0||0)),a=t.y;return e=this.am1+this.m1-Kg(a,n=Math.sin(a),i=Math.cos(a),this.en),n=i*r/(e*Math.sqrt(1-this.es*n*n)),t.x=e*Math.sin(n),t.y=this.am1-e*Math.cos(n),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function Lm(t){var e,n,i,r;if(t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a,n=e_(t.x,t.y=this.am1-t.y),r=Zg(this.am1+this.m1-n,this.es,this.en),(e=Math.abs(r))<Yp)e=Math.sin(r),i=n*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*e*e)/Math.cos(r);else{if(!(Math.abs(e-Yp)<=Pm))throw new Error;i=0}return t.x=Id(i+(this.long0||0)),t.y=w_(r),t}function Fm(t){var e,n,i=Id(t.x-(this.long0||0)),r=t.y;return n=this.cphi1+this.phi1-r,Math.abs(n)>Pm?(t.x=n*Math.sin(e=i*Math.cos(r)/n),t.y=this.cphi1-n*Math.cos(e)):t.x=t.y=0,t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function Om(t){var e,n;t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var i=e_(t.x,t.y=this.cphi1-t.y);if(n=this.cphi1+this.phi1-i,Math.abs(n)>Yp)throw new Error;return e=Math.abs(Math.abs(n)-Yp)<=Pm?0:i*Math.atan2(t.x,t.y)/Math.cos(n),t.x=Id(e+(this.long0||0)),t.y=w_(n),t}const Gm={init:function(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<Pm)throw new Error;this.es?(this.en=Xg(this.es),this.m1=Kg(this.phi1,this.am1=Math.sin(this.phi1),t=Math.cos(this.phi1),this.en),this.am1=t/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=Lm,this.forward=Nm):(Math.abs(this.phi1)+Pm>=Yp?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=Om,this.forward=Fm)},names:["bonne","Bonne (Werner lat_1=90)"]};Ag.defaultDatum="WGS84",Ag.Proj=fg,Ag.WGS84=new Ag.Proj("WGS84"),Ag.Point=Vg,Ag.toPoint=bg,Ag.defs=Ld,Ag.nadgrid=function(t,e,n){return e instanceof ArrayBuffer?function(t,e,n){var i=!0;void 0!==n&&!1===n.includeErrorFields&&(i=!1);var r=new DataView(e),a=function(t){var e=t.getInt32(8,!1);if(11===e)return!1;e=t.getInt32(8,!0),11!==e&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian");return!0}(r),o=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:sg(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(r,a),s=function(t,e,n,i){for(var r=176,a=[],o=0;o<e.nSubgrids;o++){var s=cg(t,r,n),l=ug(t,r,s,n,i),c=Math.round(1+(s.upperLongitude-s.lowerLongitude)/s.longitudeInterval),u=Math.round(1+(s.upperLatitude-s.lowerLatitude)/s.latitudeInterval);a.push({ll:[og(s.lowerLongitude),og(s.lowerLatitude)],del:[og(s.longitudeInterval),og(s.latitudeInterval)],lim:[c,u],count:s.gridNodeCount,cvs:lg(l)});var h=16;!1===i&&(h=8),r+=176+s.gridNodeCount*h}return a}(r,o,a,i),l={header:o,subgrids:s};return ng[t]=l,l}(t,e,n):{ready:ig(t,e)}},Ag.transform=Sg,Ag.mgrs=Gg,Ag.version="__VERSION__",function(t){t.Proj.projections.add(Qg),t.Proj.projections.add(a_),t.Proj.projections.add(o_),t.Proj.projections.add(c_),t.Proj.projections.add(u_),t.Proj.projections.add(h_),t.Proj.projections.add(p_),t.Proj.projections.add(d_),t.Proj.projections.add(g_),t.Proj.projections.add(M_),t.Proj.projections.add(L_),t.Proj.projections.add(O_),t.Proj.projections.add(G_),t.Proj.projections.add(D_),t.Proj.projections.add(z_),t.Proj.projections.add(I_),t.Proj.projections.add(R_),t.Proj.projections.add(j_),t.Proj.projections.add(B_),t.Proj.projections.add(q_),t.Proj.projections.add(U_),t.Proj.projections.add(W_),t.Proj.projections.add(V_),t.Proj.projections.add($_),t.Proj.projections.add(om),t.Proj.projections.add(gm),t.Proj.projections.add(_m),t.Proj.projections.add(wm),t.Proj.projections.add(Sm),t.Proj.projections.add(Tm),t.Proj.projections.add(Gm)}(Ag);const Dm=Ag;var zm=function(t){var e;if(t.svg_){"3035"===t.proj_?Dm.defs("EPSG:3035","+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs"):"54030"===t.proj_&&Dm.defs("EPSG:54030","+proj=robin +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs"),t.Geometries.geoJSONs.worldrg?jm(t):Lf("https://raw.githubusercontent.com/eurostat/eurostat-map/master/src/assets/topojson/WORLD_4326.json").then((function(e){var n=Of(e,e.objects.CNTR_RG_20M_2020_4326).features;t.Geometries.geoJSONs.worldrg=n,jm(t)})).catch((function(t){return console.error("Failed to load WORLD_4326.json",t)}));var n=(null===(e=t.minimap_)||void 0===e?void 0:e.debounce)||2;window.addEventListener("estatmap:zoomed-"+t.svgId_,function(t,e){var n;return function(){for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];clearTimeout(n),n=setTimeout((function(){return t.apply(void 0,r)}),e)}}((function(t){var e=t.detail,n=Bm(e);if(n){var i=n.lat,r=n.lon,a=Im(e);e._minimapProjection.rotate([-r,-i]),e._minimapProjection.scale(a),e._minimapGlobe.selectAll("path").attr("d",e._minimapPath)}}),n))}},Im=function(t){var e=t.position_.z;if(!e||e<=0)return 50;var n=Math.log2(156543/e);return Rm(n+-1)},Rm=function(t){return 5*Math.pow(2,t)},jm=function(t){try{var e,n,i=t.minimap_||{},r=i.countryId,a=i.x||80,o=i.y||80,s=i.z||160,l=i.color||"#3792B6",c=i.size||160,u=t.Geometries.geoJSONs.worldrg;if(t._minimapContainer=t.svg_.append("g").attr("id","em-minimap").attr("transform","translate(".concat(a,",").concat(o,")")),t._minimapContainer.append("circle").attr("r",c/2).attr("cx",0).attr("cy",0).attr("fill","white").attr("stroke",l).attr("stroke-width",3),t._minimapProjection=Wp(Hp).scale(249.5).clipAngle(90.000001).scale(s).translate([0,0]),t._minimapPath=qs().projection(t._minimapProjection),r){var h=u.find((function(t){return t.properties.id===r}));if(!h)return void console.warn("Country ID ".concat(r," not found in geometries"));var f=v(t._minimapPath.bounds(h),2),p=v(f[0],2),d=p[0],g=p[1],_=v(f[1],2),m=[(d+_[0])/2,(g+_[1])/2],y=t._minimapProjection.invert(m);n=y[0],e=y[1]}else{var x=Bm(t);if(!x)return;e=x.lat,n=x.lon}if(t._minimapProjection.rotate([-n,-e]),t._minimapContainer.append("defs").append("clipPath").attr("id","minimap-clip").append("circle").attr("r",c/2).attr("cx",0).attr("cy",0),t._minimapGlobe=t._minimapContainer.append("g").attr("class","em-minimap-globe").attr("clip-path","url(#minimap-clip)"),t._minimapGlobe.selectAll("path.country").data(u).enter().append("path").attr("d",t._minimapPath).attr("fill","#e0e0e0"),r){var b=u.find((function(t){return t.properties.id===r}));t._minimapGlobe.append("path").datum(b).attr("d",t._minimapPath).attr("fill",l).attr("stroke",l).attr("stroke-width",.5)}t._minimapContainer.append("circle").attr("r",c/2).attr("cx",0).attr("cy",0).attr("fill","none").attr("stroke",l).attr("stroke-width",3)}catch(t){console.error("Error drawing minimap:",t)}},Bm=function(t){var e,n,i=[t.position_.x,t.position_.y];if("3035"===t.proj_){var r=v(Dm("EPSG:3035","EPSG:4326",i),2);n=r[0],e=r[1]}else if("54030"===t.proj_){var a=v(Dm("EPSG:54030","EPSG:4326",i),2);n=a[0],e=a[1]}else n=i[0],e=i[1];return{lat:e.toFixed(2),lon:n.toFixed(2)}};var qm=function(t,e){var n=t.transform,i=(e.width_/2-n.x)/n.k,r=(e.height_/2-n.y)/n.k,a=v(e._projection.invert([i,r]),2),o=a[0],s=a[1];e.position_.x=o,e.position_.y=s,window.dispatchEvent(new CustomEvent("estatmap:zoomed-"+e.svgId_,{detail:e})),"function"==typeof e.onZoom_&&e.onZoom_(t,e)},Um=function(t,e,n){var i,r,a=t.transform,o=(n.width_/2-a.x)/a.k,s=(n.height_/2-a.y)/a.k,l=v(n._projection.invert([o,s]),2),c=l[0],u=l[1];if(n.__programmaticZoom){var h=n.__programmaticZoom;n.position_.x=h.x,n.position_.y=h.y,n.position_.z=h.z,delete n.__programmaticZoom}else n.position_.x=c,n.position_.y=u,n.position_.z=n.__baseZ/a.k;Vm(a,n),null!==(i=n.labels_)&&void 0!==i&&i.values&&Hm(a,n),null!==(r=n.labels_)&&void 0!==r&&r.backgrounds&&Wm(a,n),window.dispatchEvent(new CustomEvent("estatmap:zoomed-"+n.svgId_,{detail:n})),"function"==typeof n.onZoom_&&n.onZoom_(t,n)},Wm=function(t,e){var n=e.svg_.select("#em-zoom-group-"+e.svgId_).selectAll(".em-label-background"),i=t.k,r=[];n.each((function(){var t=Ft(this),e=parseFloat(t.attr("data-width"))||parseFloat(t.attr("width")),n=parseFloat(t.attr("data-height"))||parseFloat(t.attr("height")),a=parseFloat(t.attr("data-x"))||parseFloat(t.attr("x")),o=parseFloat(t.attr("data-y"))||parseFloat(t.attr("y"));if(e>0&&n>0&&!isNaN(a)&&!isNaN(o)){t.attr("data-width")||(t.attr("data-width",e),t.attr("data-height",n),t.attr("data-x",a),t.attr("data-y",o));var s=e*(1/i),l=n*(1/i),c=a*(1/i),u=o*(1/i);r.push({element:t,targetWidth:s,targetHeight:l,targetX:c,targetY:u})}})),r.forEach((function(t){var e=t.element,n=t.targetWidth,i=t.targetHeight,r=t.targetX,a=t.targetY;e.attr("width",n).attr("height",i).attr("x",r).attr("y",a)}))},Hm=function(t,e){var n=e.svg_.select("#em-zoom-group-"+e.svgId_).select("#em-labels").selectAll("*"),i=t.k,r=[];n.each((function(){var t=Ft(this),e=window.getComputedStyle(this),n=t.attr("font-size"),a=e.fontSize,o=n||a;if(o&&parseFloat(o)>0){var s=parseFloat(t.attr("data-fs"))||parseFloat(n)||parseFloat(a);t.attr("data-fs")||t.attr("data-fs",s);var l=s/i;r.push({element:this,targetFontSize:l})}})),r.forEach((function(t){var e=t.element,n=t.targetFontSize;e.style.setProperty("font-size","".concat(n,"px"),"important")}))},Vm=function(t,e){var n=e.svg_.select("#em-zoom-group-"+e.svgId_).selectAll("*"),i=t.k,r=[];n.each((function(){var t=Ft(this),e=window.getComputedStyle(this),n=t.attr("stroke-width"),a=e.strokeWidth,o=n||a;if(o&&parseFloat(o)>0){var s=parseFloat(t.attr("data-sw"))||parseFloat(n)||parseFloat(a);t.attr("data-sw")||t.attr("data-sw",s);var l=s/i;r.push({element:this,targetStrokeWidth:l})}})),r.forEach((function(t){var e=t.element,n=t.targetStrokeWidth;e.style.setProperty("stroke-width","".concat(n,"px"),"important")}))};function $m(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}wn({decimal:".",thousands:" ",grouping:[3],currency:["","€"]});var Jm=function(t,e,n){var i={};i._mapType=n,i.updateValuesLabels=wf,i.svgId_="map",i.svg_=void 0,i.width_=Math.min(795,window.innerWidth),i.height_=0,i.containerId_=void 0,i.gridCartogram_=!1,i.gridCartogramShape_="square",i.gridCartogramMargins_={top:80,right:50,bottom:80,left:150},i.gridCartogramCellPadding_=4,i.gridCartogramPositions_=void 0,i.nutsLevel_=3,i.nutsYear_=2024,i.geo_="EUR",i.proj_="3035",i.projectionFunction_=void 0,i.filterGeometriesFunction_=void 0,i.scale_="20M",i.position_={x:void 0,y:void 0,z:void 0},i.zoomExtent_=void 0,i.translateExtent_=void 0,i.lockPanUntilZoom_=!0,i.onZoomEnd_=void 0,i.onZoom_=void 0,i.onRegionMouseOver_=void 0,i.onRegionMouseMove_=void 0,i.onRegionMouseOut_=void 0,i.geometries_=void 0,i.processCentroids_=void 0,i.dorling_=!1,i.animateDorling_=!0,i.dorlingStrength_={x:1,y:1},i.dorlingIterations_=1,i.onDorlingProgress_=void 0,i.dorlingWorker_=!1,i.dorlingWorkerD3URL_=void 0,i.title_="",i.titlePosition_=void 0,i.subtitle_="",i.subtitlePosition_=void 0,i.showScalebar_=!1,i.scalebarPosition_=[],i.scalebarUnits_=" km",i.scalebarTextOffset_=[0,12],i.scalebarMaxWidth_=150,i.scalebarHeight_=90,i.scalebarStrokeWidth_=1,i.scalebarSegmentHeight_=6,i.scalebarTickHeight_=8,i.stamp_=void 0,i.minimap_=void 0,i.zoomButtons_=!1,i.insetsButton_=!1,i.tooltip_={fontSize:"14px",transitionDuration:200,xOffset:0,yOffset:0,textFunction:null,showFlags:!1,omitRegions:["RU","BY","IL","PS"]},i.hoverColor_="red",i.drawCoastalMargin_=!1,i.coastalMarginStdDev_=3,i.drawGraticule_=!1,i.backgroundMap_=!0,i.labels_=void 0,i.annotations_=void 0,i.annotationsAdded=!1,i.patternFill_=void 0,i.showSourceLink_=!0,i.footnote_="Administrative boundaries: ©EuroGeographics ©UN-FAO ©INSTAT ©Turkstat",i.footnoteTooltipText_='<div class="em-footnote-tooltip">The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the European Union concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries. Kosovo*: This designation is without prejudice to positions on status, and is in line with UNSCR 1244/1999 and the ICJ Opinion on the Kosovo declaration of independence.</div>',i.nuts2jsonBaseURL_=window.location.hostname.includes("ec.europa.eu")?"https://ec.europa.eu/assets/estat/E/E4/gisco/pub/nuts2json/v2":"https://raw.githubusercontent.com/eurostat/Nuts2json/master/pub/v2",i.noDataFillStyle_="#bcbcbc",i.insets_=[],i.insetTemplates_={},i.insetBoxPosition_=void 0,i.insetBoxPadding_=5,i.insetBoxWidth_=210,i.insetZoomExtent_=null,i.insetScale_="03M";var r=function(t){i[t.substring(0,t.length-1)]=function(e){return arguments.length?(i[t]=e,i):i[t]}};for(var a in i)r(a);!function(t){t.showZoomButtons=function(e){return console.warn("showZoomButtons() is now DEPRECATED, please use zoomButtons() instead"),t.zoomButtons_=e,t},t.showInsetsButton=function(e){return console.warn("showInsetsButton() is now DEPRECATED, please use insetsButton() instead"),t.insetsButton_=e,t},t.seaFillStyle=function(e){return console.warn("seaFillStyle() is now DEPRECATED, please use the .em-sea CSS class"),ia(".em-sea","fill",e),t},t.cntrgFillStyle=function(e){return console.warn("cntrgFillStyle() is now DEPRECATED, please use the .em-cntrg CSS class"),ia(".em-cntrg","fill",e),t},t.nutsrgFillStyle=function(e){return console.warn("nutsrgFillStyle() is now DEPRECATED, please use the .em-nutsrg CSS class"),ia(".em-nutsrg","fill",e),t},t.nutsbnStroke=function(e){return console.warn("nutsbnStroke() is now DEPRECATED, please use the .bn_0, .bn_1, .bn_2, .bn_3 CSS classes"),e[0]&&ia(".bn_0","stroke",e[0]),e[1]&&ia(".bn_1","stroke",e[1]),e[2]&&ia(".bn_2","stroke",e[2]),e[3]&&ia(".bn_3","stroke",e[3]),t},t.nutsbnStrokeWidth=function(e){return console.warn("nutsbnStrokeWidth() is now DEPRECATED, please use the .bn_0, .bn_1, .bn_2, .bn_3 CSS classes"),e[0]&&ia(".bn_0","stroke-width",e[0]),e[1]&&ia(".bn_1","stroke-width",e[1]),e[2]&&ia(".bn_2","stroke-width",e[2]),e[3]&&ia(".bn_3","stroke-width",e[3]),t},t.graticuleStroke=function(e){return console.warn("graticuleStroke() is now DEPRECATED, please use the .em-graticule CSS class"),ia(".em-graticule","stroke",e),t},t.graticuleStrokeWidth=function(e){return console.warn("graticuleStrokeWidth() is now DEPRECATED, please use the .em-graticule CSS class"),ia(".em-graticule","stroke-width",e),t},t.nutsrgSelFillSty=function(e){return console.warn("nutsrgSelFillSty() is now DEPRECATED, please use hoverColor() instead"),t.hoverColor_=e,t},t.titleFontSize=function(e){return console.warn("map.titleFontSize() is now DEPRECATED. please use the .em-title CSS class"),ia(".em-title","font-size",e),t},t.subtitleFontSize=function(e){return console.warn("map.subtitleFontSize() is now DEPRECATED. please use the .em-subtitle CSS class"),ia(".em-subtitle","font-size",e),t},t.subtitleFontWeight=function(e){return console.warn("map.subtitleFontWeight() is now DEPRECATED. please use the .em-subtitle CSS class"),ia(".em-subtitle","font-weight",e),t},t.titleFill=function(e){return console.warn("map.titleFill() is now DEPRECATED. please use the .em-title CSS class"),ia(".em-title","fill",e),t},t.subtitleFill=function(e){return console.warn("map.subtitleFill() is now DEPRECATED. please use the .em-subtitle CSS class"),ia(".em-subtitle","fill",e),t},t.cntbnStroke=function(e){return console.warn("cntbnStroke() is now DEPRECATED, please use the .em-cntbn .em-bn-eu .em-bn-efta .em-bn-cc .em-bn-oth CSS classes"),e.eu&&ia(".em-bn-eu","stroke",e.eu),e.efta&&ia(".em-bn-efta","stroke",e.efta),e.cc&&ia(".em-bn-cc","stroke",e.cc),e.oth&&ia(".em-bn-oth","stroke",e.oth),e.co&&ia(".em-bn-co","stroke",e.co),t},t.cntbnStrokeWidth=function(e){return console.warn("cntbnStrokeWidth() is now DEPRECATED, please use the .em-cntbn .em-worldbn .em-bn-eu .em-bn-efta .em-bn-cc .em-bn-oth CSS classes"),e.eu&&ia(".em-bn-eu","stroke-width",e.eu),e.efta&&ia(".em-bn-efta","stroke-width",e.efta),e.cc&&ia(".em-bn-cc","stroke-width",e.cc),e.oth&&ia(".em-bn-oth","stroke-width",e.oth),e.co&&ia(".em-bn-co","stroke-width",e.co),t},t.worldStroke=function(e){return console.warn("map.worldStroke() is now DEPRECATED. please use the .em-worldbn .em-bn-co .em-bn-d CSS classes"),ia(".em-worldbn","stroke",e),t},t.worldStrokeWidth=function(e){return console.warn("map.worldStrokeWidth() is now DEPRECATED. please use the .em-worldbn .em-bn-co .em-bn-d CSS classes"),ia(".em-worldbn","stroke-width",e),t},t.worldCoastStroke=function(e){return console.warn("map.worldCoastStroke() is now DEPRECATED. please use the .em-bn-co CSS class"),ia(".em-bn-co","stroke",e),t},t.worldCoastStrokeWidth=function(e){return console.warn("map.worldCoastStrokeWidth() is now DEPRECATED. please use the .em-bn-co CSS class"),ia(".em-bn-co","stroke-width",e),t},t.worldFillStyle=function(e){return console.warn("map.worldFillStyle() is now DEPRECATED. please use the .em-worldrg CSS class"),ia(".em-worldrg","fill",e),t},t.coastalMarginWidth=function(e){return console.warn("map.coastalMarginWidth() is now DEPRECATED. please use the #em-coast-margin CSS rule"),ia("#em-coast-margin","stroke-width",e),t},t.coastalMarginColor=function(e){return console.warn("map.coastalMarginColor() is now DEPRECATED. please use the #em-coast-margin CSS rule"),ia("#em-coast-margin","stroke",e),t},t.fontFamily=function(e){return console.warn("map.fontFamily() is now DEPRECATED. please use the .em-map CSS class"),ia(".em-map","font-family",e),t},t.botTxtFontSize=function(e){return console.warn("map.botTxtFontSize() is now DEPRECATED. please use the .em-footnote CSS class"),ia(".em-footnote","font-size",e),t},t.botTxtFill=function(e){return console.warn("map.botTxtFill() is now DEPRECATED. please use the .em-footnote CSS class"),ia(".em-footnote","fill",e),t},t.scalebarFontSize=function(e){return console.warn("map.scalebarFontSize() is now DEPRECATED. please use the .em-scalebar-label CSS class"),ia(".em-scalebar-label","font-size",e),t},t.frameStroke=function(e){return console.warn("map.frameStroke() is now DEPRECATED. please use the .em-frame CSS class"),ia(".em-frame","stroke",e),t},t.frameStrokeWidth=function(e){return console.warn("map.frameStrokeWidth() is now DEPRECATED. please use the .em-frame CSS class"),ia(".em-frame","stroke-width",e),t},t.psClassifMethod=function(e){return console.warn("psClassifMethod() is now DEPRECATED. please use psClassificationMethod instead"),t.psClassificationMethod_=e,t},t.geoCenter=function(e){return console.warn("map.geoCenter() is now DEPRECATED. Please use map.position({x,y,z}) instead."),t.position_.x=e[0],t.position_.y=e[1],t},t.pixelSize=function(e){return console.warn("map.pixelSize() is now DEPRECATED. Please use the z property in map.position({x,y,z}) instead."),t.position_.z=e,t},t.pixSize=function(e){return console.warn("map.pixelSize() is now DEPRECATED. Please use the z property in map.position({x,y,z}) instead."),t.position_.z=e,t},t.tooltipText=function(e){return console.warn("map.tooltipText() is now DEPRECATED. Please use map.tooltip(config.textFunction) instead. See API reference for details."),t.tooltip_.textFunction=e,t},t.classifMethod=function(e){return console.warn("map.classifMethod() is now DEPRECATED. please use map.classificationMethod() instead."),t.classificationMethod_=e,t},t.threshold=function(e){return console.warn("map.threshold() is now DEPRECATED. please use map.thresholds() instead."),t.thresholds_=e,t},t.psThreshold=function(e){return console.warn("map.psThreshold() is now DEPRECATED. please use map.psThresholds() instead."),t.psThresholds_=e,t},t.clnb=function(e){return console.warn("map.clnb() is now DEPRECATED. please use map.numberOfClasses() instead."),t.numberOfClasses_=e,t},t.nutsLvl=function(e){return console.warn("map.nutsLvl() is now DEPRECATED. please use map.nutsLevel() instead."),t.nutsLevel_=e,t},t.lg=function(e){return console.warn("map.lg() is now DEPRECATED. please use map.language() instead."),t.language_=e,t},t.bottomText=function(e){return console.warn("bottomText is now DEPRECATED. Please use the footnote() method and em-footnote CSS class instead."),t.footnote_=e,t},t.botTxtFontSize=function(e){return console.warn("botTxtFontSize is now DEPRECATED. Please use the em-footnote CSS class instead."),t},t.botTxtFill=function(e){return console.warn("botTxtFill is now DEPRECATED. Please use the em-footnote CSS class instead."),t},t.botTxtPadding=function(e){return console.warn("botTxtPadding is now DEPRECATED. Please use the em-footnote CSS class instead."),t},t.botTxtTooltipTxt=function(e){return console.warn("botTxtTooltipTxt is now DEPRECATED. Please use footnoteTooltipText() instead."),t},t.tooltipShowFlags=function(e){return console.warn("tooltipShowFlags is now DEPRECATED. Please use out.tooltip({showFlags}) instead."),t.tooltip_.showFlags=e,t},t.colorFun=function(e){return console.warn("colorFun is now DEPRECATED. Please use out.colorFunction() instead."),t.colorFunction_=e,t},t.filtersDefinitionFun=function(e){return console.warn("filtersDefinitionFun is now DEPRECATED. Please use out.filtersDefinitionFunction() instead."),t.filtersDefinitionFunction_=e,t},t.labelling=function(e){return console.warn("labelling is now DEPRECATED. Please use out.labels({}) configuration object instead. See documentation for details."),t},t.labelsConfig=function(e){return console.warn("labelsConfig is now DEPRECATED. Please use out.labels({config:yourConfig}) configuration object instead. See documentation for details."),t.labels_=Object.assign(t.labels_||{},{config:e}),t},t.statLabelsPositions=function(e){return console.warn("statLabelsPositions is now DEPRECATED. Please use out.labels({statLabelsPositions:yourPositions}) instead. See documentation for details."),t.labels_=Object.assign(t.labels_||{},{statLabelsPositions:e}),t},t.labelsToShow=function(e){return console.warn("labelsToShow is now DEPRECATED. Please use out.labels({labelFilterFunction:yourFunction(region,map)}) function instead. See documentation for details."),t},t.labelShadowsToShow=function(e){return console.warn("labelShadowsToShow is now DEPRECATED. Please use out.labels({labelFilterFunction:yourFunction(region,map)}) function instead. See documentation for details."),t},t.labelShadow=function(e){return console.warn("labelShadow is now DEPRECATED. Please use out.labels({labelShadow:boolean}) instead. See documentation for details."),t},t.labelShadowWidth=function(e){return console.warn("labelShadow is now DEPRECATED. Please use out.labels({labelShadow:boolean}) instead. See documentation for details."),t},t.labelFilterFunction=function(e){return console.warn("labelFilterFunction is now DEPRECATED. Please use out.labels({labelFilterFunction:yourFunction(region,map)}) instead. See documentation for details."),t},t.labelFill=function(e){return console.warn("map.labelFill() is now DEPRECATED. please use the .em-stat-labels CSS class"),t},t.labelStroke=function(e){return console.warn("map.labelStroke() is now DEPRECATED. please use the .em-stat-labels CSS class"),t},t.labelStrokeWidth=function(e){return console.warn("map.labelStrokeWidth() is now DEPRECATED. please use the .em-stat-labels CSS class"),t},t.labelOpacity=function(e){return console.warn("map.labelOpacity() is now DEPRECATED. please use the .em-stat-labels CSS class"),t},t.labelValuesFontSize=function(e){return console.warn("map.labelValuesFontSize() is now DEPRECATED. please use the .em-stat-labels CSS class"),t},t.labelShadowWidth=function(e){return console.warn("map.labelShadowWidth() is now DEPRECATED. please use the .em-stat-labels-shadows CSS class"),t},t.labelShadowColor=function(e){return console.warn("map.labelShadowColor() is now DEPRECATED. please use the .em-stat-labels-shadows CSS class"),t},t.countriesToShow=function(e){return console.warn("map.countriesToShow() is now DEPRECATED. please use the map.filterGeometriesFunction() function if you wish to filter the default geometries."),t},t.bordersToShow=function(e){return console.warn("map.bordersToShow() is now DEPRECATED. please use the map.filterGeometriesFunction() function if you wish to filter the default geometries."),t}}(i),i.geo=function(t){return arguments.length?(i.geo_=t.toUpperCase(),i):i.geo_},["tooltip_","nuts2jsonBaseURL_","processCentroids_"].forEach((function(t){i[t.substring(0,t.length-1)]=function(e){if(!arguments.length)return i[t];if("object"!==ga(e)||null===e||Array.isArray(e))i[t]=e;else for(var n in e)i[t][n]=e[n];return i.insetTemplates_&&ua(i.insetTemplates_,i.svgId_,(function(e,n){e[t.substring(0,t.length-1)](n)}),e),i}})),i.title=function(t){return arguments.length?(i.title_=t,i.svg()&&i.svg().select("#title"+i.geo()).text(t),i):i.title_},i.subtitle=function(t){return arguments.length?(i.subtitle_=t,i.svg()&&i.svg().select("#subtitle"+i.geo()).text(t),i):i.subtitle_},i.insets=function(){return arguments.length?(1==arguments.length&&"default"===arguments[0]?i.insets_="default":1==arguments.length&&!1===arguments[0]?i.insets_=!1:1==arguments.length&&Array.isArray(arguments[0])?i.insets_=arguments[0]:i.insets_=arguments,i):i.insets_},i.drawGraticule=function(t){if(!arguments.length)return i.drawGraticule_;i.drawGraticule_=t;var e=i.svg_?i.svg().select("#em-graticule"):null,n=i.svg_?i.svg_.select("#em-zoom-group-"+i.svgId_):null;return e&&(e._groups[0][0]&&0==t?e.remove():i.Geometries.geoJSONs.graticule&&i._pathFunction&&n&&1==t&&(e.remove(),n.append("g").attr("id","em-graticule").selectAll("path").data(i.Geometries.geoJSONs.graticule).enter().append("path").attr("d",i._pathFunction).attr("class","em-graticule"),i.svg().select("#em-graticule").each((function(){"WORLD"==i.geo_?this.parentNode.insertBefore(this,this.parentNode.childNodes[3]):this.parentNode.insertBefore(this,this.parentNode.childNodes[1])})))),i},i.drawCoastalMargin=function(t){if(!arguments.length)return i.drawCoastalMargin_;if(i.drawCoastalMargin_=t,i.svg_){var e=va("#em-coast-margin"),n=Ft("#em-coastal-blur"),r=Ft("#em-zoom-group-"+i.svgId_)||null;if(e._groups[0][0]&&0==t)e.remove();else if(1==t&&i._pathFunction&&r){e.remove(),n.remove(),i.svg_.append("filter").attr("id","em-coastal-blur").attr("x","-200%").attr("y","-200%").attr("width","400%").attr("height","400%").append("feGaussianBlur").attr("in","SourceGraphic").attr("stdDeviation",i.coastalMarginStdDev_);var a=function(t){var e=Ft("#em-zoom-group-"+t.svgId_).append("g").attr("id","em-coast-margin");t._geom.cntbn&&e.append("g").attr("id","em-coast-margin-cnt").selectAll("path").data(t._geom.cntbn).enter().filter((function(t){return"T"===t.properties.co})).append("path").attr("d",t._pathFunction),t._geom.nutsbn&&e.append("g").attr("id","em-coast-margin-nuts").selectAll("path").data(t._geom.nutsbn).enter().filter((function(t){return"T"===t.properties.co})).append("path").attr("d",t._pathFunction),t._geom.worldbn&&e.append("g").attr("id","em-coast-margin-nuts").selectAll("path").data(t._geom.worldbn).enter().filter((function(t){return"T"===t.properties.COAS_FLAG})).append("path").attr("d",t._pathFunction)};i.insetTemplates_&&i.drawCoastalMargin_&&(ua(i.insetTemplates_,i.svgId_,a),a(i)),va("#em-coast-margin").each((function(){"WORLD"==i.geo_?this.parentNode.insertBefore(this,this.parentNode.childNodes[3]):this.parentNode.insertBefore(this,this.parentNode.childNodes[1])}))}}return i},i.annotations=function(t){return arguments.length?(i.annotations_=t,xf(i),i):i.annotations_},i.stamp=function(t){return arguments.length?(i.stamp_=t,Kf(i.stamp_,i),i):i.stamp_},i.minimap=function(t){return arguments.length?(i.minimap_=t,zm(i),i):i.minimap_},i.labels=function(t){return arguments.length?(i.labels_=t,function(t){if(t.svg_){var e=t.svg_.selectAll("#em-labels > *");if(e&&e.remove(),t.labels_){var n=t.labels_,i=t.svg_.select("#em-zoom-group-"+t.svgId_);bf(t,i),n.values&&t.updateValuesLabels&&t.updateValuesLabels(t),t.insetTemplates_&&ua(t.insetTemplates_,t.svgId_,(function(t){if(n){var e=t.svg_.select("#em-zoom-group-"+t.svgId_);t.labels_&&bf(t,e),n.values&&t.updateValuesLabels&&t.updateValuesLabels(t)}}))}}}(i),i):i.labels_},i.position=function(t){return arguments.length?(i.position_=t,function(t,e){if(t.svg_&&t.__zoomBehavior){var n=t.svg_,i=n.select("#em-zoom-group-"+t.svgId_),r=t.__baseZ/e.z,a=v(t._projection([e.x,e.y]),2),o=a[0],s=a[1],l=t.width_/2-o*r,c=t.height_/2-s*r,u=Hr.translate(l,c).scale(r);t.__programmaticZoom={x:e.x,y:e.y,z:e.z},t.__lastTransform=u,n.call(t.__zoomBehavior.transform,u),i.attr("data-zoom",r),t.position_.x=e.x,t.position_.y=e.y,t.position_.z=e.z}}(i,t),i):i.position_},i.Geometries=$f(i,e),i.updateGeoMapTemplate=function(t){return i.Geometries.defaultGeoData=null,i.Geometries.allNUTSGeoData=null,i.Geometries.centroidsData=null,i.geometries_?(i.Geometries.setUserGeometries(i.geometries_),i.buildMapTemplate(),t&&t()):i.Geometries.getDefaultGeoData(i.geo_,i.filterGeometriesFunction_,i.nutsLevel_).then((function(){i.buildMapTemplate(),t&&t()})),ua(i.insetTemplates_,i.svgId_,(function(e){e.updateGeoMapTemplate(t)})),i};i.buildMapTemplateBase=function(){var t=function(t){var e=Ft("#"+t.svgId());return 0==e.size()&&(e=Ft("body").append("svg").attr("id",t.svgId())),e.attr("class","em-map"),e.classed("em--"+t._mapType,!0),"pie"!==t._mapType&&"coxcomb"!==t._mapType||e.classed("em--ps",!0),e}(i);i.svg_=t,i.containerId_||(i.containerId_=i.svgId_),i.tooltip_.containerId||(i.tooltip_.containerId=i.containerId_),va("#"+i.svgId()+" > *").remove(),"WORLD"==i.geo_.toUpperCase()&&(i.height()||i.height(.55*i.width()),t.attr("width",i.width()).attr("height",i.height()),i.proj_=54030),i.height()||i.height(.85*i.width()),t.attr("width",i.width()).attr("height",i.height()),t.append("defs").attr("class","em-defs").append("clipPath").attr("id",i.svgId_+"-clip-path").append("path").attr("d",function(t,e,n,i){return t=parseFloat(t,10),e=parseFloat(e,10),n=parseFloat(n,10),i=parseFloat(i,10),t<0||e<0||n<0||i<0?"":"M"+t+","+e+"L"+(t+n)+","+e+" "+(t+n)+","+(e+i)+" "+t+","+(e+i)+"z"}(0,0,i.width_,i.height_)),i.drawCoastalMargin_&&t.append("filter").attr("id","em-coastal-blur").attr("x","-200%").attr("y","-200%").attr("width","400%").attr("height","400%").append("feGaussianBlur").attr("in","SourceGraphic").attr("stdDeviation",i.coastalMarginStdDev_);var n=t.insert("g",":first-child").attr("id","em-drawing-"+i.svgId_).attr("class","em-drawing-group").attr("clip-path","url(#"+i.svgId_+"-clip-path)");n.append("g").attr("id","em-zoom-group-"+i.svgId_).attr("class","em-zoom-group");return function(t){if(t.insetTemplates_){for(var e in t.insetTemplates_){var n=Ft("#"+t.insetTemplates_[e].svgId_);n&&n.html("")}t.insetTemplates_={}}}(i),function(t,e){t.insetBoxPosition_||(t.insetBoxPosition_=[t.width_-t.insetBoxWidth_-2*t.insetBoxPadding_,2*t.insetBoxPadding_]);var n=Ft("#"+t.svgId_).select("#em-drawing-"+t.svgId_).append("g").attr("id","em-insets-group").attr("class","em-insets").attr("transform","translate("+t.insetBoxPosition_[0]+","+t.insetBoxPosition_[1]+")");"default"===t.insets_&&(t.insets_=Yf(t.insetBoxWidth_,t.insetBoxPadding_));for(var i=0;i<t.insets_.length;i++){var r=t.insets_[i];if(r.svgId=r.svgId||"inset"+r.geo+Math.random().toString(36).substring(7),0==Ft("#"+r.svgId).size()){var a=null==r.x?t.insetBoxPadding_:r.x,o=null==r.y?t.insetBoxPadding_+i*(t.insetBoxPadding_+t.insetBoxWidth_):r.y;n.append("g").attr("id","em-inset-"+r.svgId).attr("class","em-inset").attr("transform","translate("+a+","+o+")").append("svg").attr("id",r.svgId)}if(t.insetTemplates_[r.geo]){var s=Jf(r,t,e);s.buildMapTemplateBase(),t.insetTemplates_[r.geo]=[t.insetTemplates_[r.geo],s]}else{var l=Jf(r,t,e).buildMapTemplateBase();t.insetTemplates_[r.geo]=l}}}(i,e),n.append("rect").attr("id","em-frame-"+i.geo_).attr("class","em-frame").attr("x",0).attr("y",0).attr("width",i.width_).attr("height",i.height_),i.stamp_&&Kf(i.stamp_,i),i},i.buildMapTemplate=function(){var t,n=i.svg().select("#em-zoom-group-"+i.svgId_);if(n.selectAll("*").remove(),1==i.gridCartogram_?(!function(t){var e=Ft("#em-zoom-group-".concat(t.svgId_)).append("g").attr("id","em-grid-container");t.gridCartogramMargins_=t.gridCartogramMargins_||{top:80,right:80,bottom:80,left:80};var n=fp(t),i=pp(n),r=dp(i,t);"hexagon"===t.gridCartogramShape_?_p(e,r,t):gp(e,r,t),vp(e,t.width_,t.height_,t.gridCartogramMargins_)}(i),i.footnote_=!1):(i.position_.x&&i.position_.y||c(),i.position_.z=i.position_.z||u(),h(),f(),(i.zoomExtent()||i.zoomButtons_)&&(i.zoomExtent_||(console.warn("Zoom buttons are enabled, but no zoom extent is defined. Setting default extent to map.zoomExtent([1,10])."),i.zoomExtent_=[1,10]),function(t){var e=Ft("#"+t.svgId()),n=Hr,i=!t.lockPanUntilZoom_,r=!1,a=t.zoomExtent_||[0,0],o=t.translateExtent_||!t.lockPanUntilZoom_?[[-t.width_,-t.height_],[2*t.width_,2*t.height_]]:[[0,0],[t.width_,t.height_]];if(t.__zoomBehavior=ta().filter((function(t){return!t.target.closest(".em-zoom-buttons")&&!t.target.closest(".em-button")})).extent([[0,0],[t.width_,t.height_]]).scaleExtent(a).translateExtent(o).on("zoom",(function(a){var o=a.transform,s=t.svg_.select("#em-zoom-group-"+t.svgId_);r?r=!1:(t.__lastTransform=o,o.k!==n.k?(t.lockPanUntilZoom_&&(i=!0),Um(a,n,t),s.attr("data-zoom",o.k).attr("transform",o),n=o):!t.lockPanUntilZoom_||i?(qm(a,t),s.attr("transform",o),n=o):(r=!0,e.call(t.__zoomBehavior.transform,n)))})).on("end",(function(e){var n;return null===(n=t.onZoomEnd_)||void 0===n?void 0:n.call(t,e,t)})),t.__lastTransform=n,!t.__baseZ){var s=t.height_/2,l=v(t._projection.invert([0,s]),1)[0],c=v(t._projection.invert([t.width_,s]),1)[0];t.__baseZ=(c-l)/t.width_}e.call(t.__zoomBehavior)}(i)),i.backgroundMap_&&l(i)),e&&o(i),i.labels_&&bf(i,n),i.annotations_&&(xf(i),i.annotationsAdded=!0),i.title()){var r=i.isInset?"em-inset-title":"em-title";i.titlePosition()||i.titlePosition([10,ra(r)+(i.isInset?0:10)]),i.svg().append("text").attr("id","title"+i.geo_).attr("class",r).attr("x",i.titlePosition()[0]).attr("y",i.titlePosition()[1]).html(i.title())}if(i.subtitle()){var a=i.isInset?"em-inset-subtitle":"em-subtitle",s=i.isInset?"em-inset-title":"em-title";i.subtitlePosition()||i.subtitlePosition([10,ra(s)+ra(a)+15]),i.svg().append("text").attr("id","subtitle"+i.geo_).attr("class",a).attr("x",i.subtitlePosition()[0]).attr("y",i.subtitlePosition()[1]).html(i.subtitle())}if((i.footnote_&&d(),i.showSourceLink_)&&((t=e?i.stat("size"):i.stat())&&t.eurostatDatasetCode)){var p=t.eurostatDatasetCode,g="https://ec.europa.eu/eurostat/databrowser/view/".concat(p,"/default/table?lang=en"),m=i.svg().append("a").attr("class","em-source-dataset-link").attr("href",g).attr("target","_blank").append("text").attr("class","em-source-dataset-link-text").attr("x",i.width_).attr("y",i.height_).text("EUROSTAT").attr("text-anchor","end").node().getComputedTextLength();i.svg().append("text").attr("class","em-source-pretext").attr("x",i.width_-m-2).attr("y",i.height_).text("Source:").attr("text-anchor","end")}return i.showScalebar_&&(2!==i.scalebarPosition_.length&&(i.scalebarPosition_[0]=15,i.scalebarPosition_[1]=i.height_-50),_()),i.minimap_&&zm(i),i.zoomButtons_&&function(t){var e=Ft("#"+t.svgId()).append("g").attr("class","em-zoom-buttons").style("pointer-events","all"),n=parseInt(aa("em-button","width"))||30,i=e.append("g").attr("class","em-zoom-in em-button").attr("title","Zoom in").style("cursor","pointer");i.append("rect").attr("width",n).attr("height",n),i.append("text").attr("x",n/2).attr("y",n/2+7).text("+");var r=e.append("g").attr("class","em-zoom-out em-button").attr("title","Zoom out").style("cursor","pointer").attr("transform","translate(0, ".concat(n,")")).style("cursor","pointer");r.append("rect").attr("width",n).attr("height",n),r.append("text").attr("x",n/2).attr("y",n/2+7).text("−"),i.on("click",(function(e){e.preventDefault(),e.stopPropagation(),function(t){t.svg_.transition().call(t.__zoomBehavior.scaleBy,2)}(t)})),r.on("click",(function(e){e.preventDefault(),e.stopPropagation(),function(t){t.svg_.transition().call(t.__zoomBehavior.scaleBy,.5)}(t)}))}(i),i.insetsButton_&&function(t){var e=Ft("#"+t.svgId()),n=parseInt(aa("em-button","width"))||30,i=e.append("g").attr("class","em-insets-button em-button");i.append("rect").attr("width",n).attr("height",n);var r=document.createComment("!Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.");i.node().appendChild(r);var a=n/700;i.append("path").attr("d","M266.3 48.3L232.5 73.6c-5.4 4-8.5 10.4-8.5 17.1l0 9.1c0 6.8 5.5 12.3 12.3 12.3c2.4 0 4.8-.7 6.8-2.1l41.8-27.9c2-1.3 4.4-2.1 6.8-2.1l1 0c6.2 0 11.3 5.1 11.3 11.3c0 3-1.2 5.9-3.3 8l-19.9 19.9c-5.8 5.8-12.9 10.2-20.7 12.8l-26.5 8.8c-5.8 1.9-9.6 7.3-9.6 13.4c0 3.7-1.5 7.3-4.1 10l-17.9 17.9c-6.4 6.4-9.9 15-9.9 24l0 4.3c0 16.4 13.6 29.7 29.9 29.7c11 0 21.2-6.2 26.1-16l4-8.1c2.4-4.8 7.4-7.9 12.8-7.9c4.5 0 8.7 2.1 11.4 5.7l16.3 21.7c2.1 2.9 5.5 4.5 9.1 4.5c8.4 0 13.9-8.9 10.1-16.4l-1.1-2.3c-3.5-7 0-15.5 7.5-18l21.2-7.1c7.6-2.5 12.7-9.6 12.7-17.6c0-10.3 8.3-18.6 18.6-18.6l29.4 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-20.7 0c-7.2 0-14.2 2.9-19.3 8l-4.7 4.7c-2.1 2.1-3.3 5-3.3 8c0 6.2 5.1 11.3 11.3 11.3l11.3 0c6 0 11.8 2.4 16 6.6l6.5 6.5c1.8 1.8 2.8 4.3 2.8 6.8s-1 5-2.8 6.8l-7.5 7.5C386 262 384 266.9 384 272s2 10 5.7 13.7L408 304c10.2 10.2 24.1 16 38.6 16l7.3 0c6.5-20.2 10-41.7 10-64c0-111.4-87.6-202.4-197.7-207.7zm172 307.9c-3.7-2.6-8.2-4.1-13-4.1c-6 0-11.8-2.4-16-6.6L396 332c-7.7-7.7-18-12-28.9-12c-9.7 0-19.2-3.5-26.6-9.8L314 287.4c-11.6-9.9-26.4-15.4-41.7-15.4l-20.9 0c-12.6 0-25 3.7-35.5 10.7L188.5 301c-17.8 11.9-28.5 31.9-28.5 53.3l0 3.2c0 17 6.7 33.3 18.7 45.3l16 16c8.5 8.5 20 13.3 32 13.3l21.3 0c13.3 0 24 10.7 24 24c0 2.5 .4 5 1.1 7.3c71.3-5.8 132.5-47.6 165.2-107.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM187.3 100.7c-6.2-6.2-16.4-6.2-22.6 0l-32 32c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l32-32c6.2-6.2 6.2-16.4 0-22.6z").attr("transform","translate(".concat(n/2,", ").concat(n/2,") scale(").concat(a,") translate(").concat(-256,", ").concat(-256,")")).attr("fill","#333").attr("pointer-events","none"),i.on("click",(function(t){t.preventDefault(),t.stopPropagation();var n=e.select("#em-insets-group");"none"===n.style("display")||""===n.style("display")?n.style("display","block"):n.style("display","none")}))}(i),i};var o=function(t){var e;t.Geometries.centroidsData?e="mixed"==t.nutsLevel_?[].concat(y(t.Geometries.centroidsData[0].features),y(t.Geometries.centroidsData[1].features),y(t.Geometries.centroidsData[2].features),y(t.Geometries.centroidsData[3].features)):t.Geometries.centroidsData.features:"WORLD"==t.geo_&&(e=[],t.Geometries.geoJSONs.worldrg.forEach((function(t){var n=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$m(Object(n),!0).forEach((function(e){ma(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$m(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t);"FR"==t.properties.id?n.geometry={coordinates:[2.2,46.2],type:"Point"}:n.geometry={coordinates:yo(t),type:"Point"},e.push(n)}))),t.processCentroids_&&(e=t.processCentroids_(e));var n=e.map((function(e){var n=t._projection(e.geometry.coordinates);return e.properties.centroid=n,e}));t.Geometries._allCentroidsFeatures=y(n),t.Geometries.centroidsFeatures=n.filter((function(e){return s(e.properties.id,t)})),(i.getCentroidsGroup(t).empty()?t.svg().select("#em-zoom-group-"+t.svgId_).append("g").attr("id","em-centroids-".concat(t.svgId_)).attr("class","em-centroids"):i.getCentroidsGroup(t)).selectAll("g.em-centroid").data(t.Geometries.centroidsFeatures,(function(t){return t.properties.id})).join((function(t){return t.append("g").attr("class","em-centroid").attr("id",(function(t){return"ps"+t.properties.id})).attr("transform",(function(t){return"translate(".concat(t.properties.centroid[0].toFixed(3),",").concat(t.properties.centroid[1].toFixed(3),")")}))}),(function(t){return t}),(function(t){return t.remove()}))};i.getCentroidsGroup=function(t){return t.svg().select("#em-centroids-".concat(t.svgId_))},i.refreshCentroids=function(t){var e=t.Geometries._allCentroidsFeatures;if(e)return t.Geometries.centroidsFeatures=e.filter((function(e){return s(e.properties.id,t)})),i.getCentroidsGroup(t).selectAll("g.em-centroid").data(t.Geometries.centroidsFeatures,(function(t){return t.properties.id})).join((function(t){return t.append("g").attr("class","em-centroid").attr("id",(function(t){return"ps"+t.properties.id})).attr("transform",(function(t){return"translate(".concat(t.properties.centroid[0].toFixed(3),",").concat(t.properties.centroid[1].toFixed(3),")")}))}),(function(t){return t}),(function(t){return t.remove()})),t};var s=function(t,e){return!e.statCodes_||e.statCodes_.some((function(n){var i,r=null===(i=e.statData(n))||void 0===i?void 0:i.get(t);return r&&!isNaN(r.value)&&0!==r.value}))},l=function(t){var e=t.svg().select("#em-zoom-group-"+t.svgId_);e.append("rect").attr("id","sea").attr("class","em-sea").attr("x",-5*t.width_).attr("y",-5*t.height_).attr("width",11*t.width_).attr("height",11*t.height_),"WORLD"==t.geo_&&e.append("path").datum({type:"Sphere"}).attr("id","sphere").attr("d",t._pathFunction).attr("class","em-graticule"),t.drawCoastalMargin_&&g(),t.geometries_?t.Geometries.addUserGeometriesToMap(t.geometries_,e,t._pathFunction):t.Geometries.addDefaultGeometriesToMap(e,t.drawGraticule_,t._pathFunction,t.nutsLevel_,t.nutsYear_,t.geo_,t.proj_,t.scale_)},c=function(){var t,e=Ym[i.geo_+"_"+i.proj_];e?(i.position_.x=i.position_.x||e.geoCenter[0],i.position_.y=i.position_.y||e.geoCenter[1]):null!==(t=i.Geometries.defaultGeoData)&&void 0!==t&&t.bbox&&(i.position_.x=i.position_.x||.5*(i.Geometries.defaultGeoData.bbox[0]+i.Geometries.defaultGeoData.bbox[2]),i.position_.y=i.position_.y||.5*(i.Geometries.defaultGeoData.bbox[1]+i.Geometries.defaultGeoData.bbox[3])),p()},u=function(){var t,e=Ym[i.geo_+"_"+i.proj_];return e?800*e.pixelSize/i.width_:null!==(t=i.Geometries.defaultGeoData)&&void 0!==t&&t.bbox?Math.min((i.Geometries.defaultGeoData.bbox[2]-i.Geometries.defaultGeoData.bbox[0])/i.width_,(i.Geometries.defaultGeoData.bbox[3]-i.Geometries.defaultGeoData.bbox[1])/i.height_):100},h=function(){var t;"WORLD"===i.geo_?i._projection=i.projectionFunction_||ec(fc).scale(152.63).translate([i.width_/2,i.height_/2]).scale((i.width_-20)/(2*Math.PI)):i._projection=i.projectionFunction_||function(){var t,e,n,i,r,a,o,s=1,l=0,c=0,u=1,h=1,f=0,p=null,d=1,g=1,_=Po({point:function(t,e){var n=y([t,e]);this.stream.point(n[0],n[1])}}),m=To;function v(){return d=s*u,g=s*h,a=o=null,y}function y(n){var i=n[0]*d,r=n[1]*g;if(f){var a=r*t-i*e;i=i*t+r*e,r=a}return[i+l,r+c]}return y.invert=function(n){var i=n[0]-l,r=n[1]-c;if(f){var a=r*t+i*e;i=i*t-r*e,r=a}return[i/d,r/g]},y.stream=function(t){return a&&o===t?a:a=_(m(o=t))},y.postclip=function(t){return arguments.length?(m=t,p=n=i=r=null,v()):m},y.clipExtent=function(t){return arguments.length?(m=null==t?(p=n=i=r=null,To):ko(p=+t[0][0],n=+t[0][1],i=+t[1][0],r=+t[1][1]),v()):null==p?null:[[p,n],[i,r]]},y.scale=function(t){return arguments.length?(s=+t,v()):s},y.translate=function(t){return arguments.length?(l=+t[0],c=+t[1],v()):[l,c]},y.angle=function(n){return arguments.length?(e=Oa(f=n%360*Aa),t=Na(f),v()):f*Ca},y.reflectX=function(t){return arguments.length?(u=t?-1:1,v()):u<0},y.reflectY=function(t){return arguments.length?(h=t?-1:1,v()):h<0},y.fitExtent=function(t,e){return Ro(y,t,e)},y.fitSize=function(t,e){return jo(y,t,e)},y.fitWidth=function(t,e){return Bo(y,t,e)},y.fitHeight=function(t,e){return qo(y,t,e)},y}().reflectY(!0).fitSize([i.width_,i.height_],{type:"Feature",geometry:{type:"MultiPoint",coordinates:[[(t=function(t){var e=.5*t.position_.z*t.width_,n=.5*t.position_.z*t.height_;return[t.position_.x-e,t.position_.y-n,t.position_.x+e,t.position_.y+n]}(i))[0],t[1]],[t[2],t[3]]]}})},f=function(){i._pathFunction=qs().projection(i._projection)},p=function(){var t=ha("x"),e=ha("y"),n=ha("z");null==t||null==t||isNaN(+t)||(i.position_.x=+t),null==e||null==e||isNaN(+e)||(i.position_.y=+e),null==n||null==n||isNaN(+n)||(i.position_.z=+n)},d=function(){i.svg().append("text").attr("id","em-footnote").attr("class","em-footnote").attr("x",0).attr("y",i.height_).html(i.footnote_).on("mouseover",(function(){i._tooltip.mw___=i._tooltip.style("max-width"),i._tooltip.style("max-width","400px"),i.footnoteTooltipText_&&i._tooltip.mouseover(i.footnoteTooltipText_)})).on("mousemove",(function(t){i.footnoteTooltipText_&&i._tooltip.mousemove(t)})).on("mouseout",(function(t){i.footnoteTooltipText_&&i._tooltip.mouseout(t),i._tooltip.style("max-width",i._tooltip.mw___)}))},g=function(){var t=i.svg().select("#em-zoom-group-"+i.svgId_).append("g").attr("id","em-coast-margin").attr("class","em-coast-margin");i.Geometries.geoJSONs.cntbn&&t.append("g").attr("id","em-coast-margin-cnt").attr("class","em-coast-margin-cnt").selectAll("path").data(i.Geometries.geoJSONs.cntbn).enter().filter((function(t){return"T"===t.properties.co})).append("path").attr("d",i._pathFunction),i.Geometries.geoJSONs.nutsbn&&t.append("g").attr("id","em-coast-margin-nuts").attr("class","em-coast-margin-nuts").selectAll("path").data(i.Geometries.geoJSONs.nutsbn).enter().filter((function(t){return"T"===t.properties.co})).append("path").attr("d",i._pathFunction),i.Geometries.geoJSONs.worldbn&&t.append("g").attr("id","em-coast-margin-world").attr("class","em-coast-margin-world").selectAll("path").data(i.Geometries.geoJSONs.worldbn).enter().filter((function(t){return"T"===t.properties.COAS_FLAG})).append("path").attr("d",i._pathFunction)},_=function(){var t=i.scalebarMaxWidth_,e=i.scalebarTextOffset_[0],n=i.scalebarTextOffset_[1],r=i.position_.z,a=m(t*r),o=a[0]/r,s=a[1],l=i.svg().append("g").attr("class","em-scalebar").attr("transform","translate(".concat(i.scalebarPosition_[0],",").concat(i.scalebarPosition_[1],")")).attr("width",t+20).attr("height",i.scalebarHeight_);l.append("line").attr("class","em-scalebar-line").attr("x1",5).attr("y1",1).attr("x2",5).attr("y2",i.scalebarTickHeight_),l.append("text").attr("class","em-scalebar-label").attr("x",5+e).attr("y",i.scalebarTickHeight_+n).text("0");var c={1:4,2:2,5:5}[s],u=o/c,h=i.scalebarSegmentHeight_/2+1;if(u>=15){for(var f=1;f<c;f++)if(l.append("line").attr("class","em-scalebar-line").attr("x1",5+i.scalebarStrokeWidth_/2+f*u).attr("y1",1).attr("x2",5+i.scalebarStrokeWidth_/2+f*u).attr("y2",i.scalebarTickHeight_),l.append("text").attr("class","em-scalebar-label").attr("x",5+e+f*u).attr("y",i.scalebarTickHeight_+n).text(x(a[0]/c*f)),1==f)l.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",5+i.scalebarStrokeWidth_-1).attr("y1",h).attr("x2",5+i.scalebarStrokeWidth_/2+f*u).attr("y2",h);else{var p=5+i.scalebarStrokeWidth_/2+(f-1)*u;p>0&&l.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",p).attr("y1",h).attr("x2",5+i.scalebarStrokeWidth_/2+f*u).attr("y2",h)}u>=15&&l.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",5+(c-1)*u).attr("y1",h).attr("x2",5+c*u).attr("y2",h)}else l.append("line").attr("class","em-scalebar-line em-scalebar-midline").attr("x1",5+i.scalebarStrokeWidth_-1).attr("y1",h).attr("x2",5+i.scalebarStrokeWidth_/2+u*c).attr("y2",h);l.append("line").attr("class","em-scalebar-line").attr("x1",o+5).attr("y1",1).attr("x2",o+5).attr("y2",i.scalebarTickHeight_),l.append("text").attr("class","em-scalebar-label").attr("x",o+5+e).attr("y",i.scalebarTickHeight_+n).text(x(a[0])+i.scalebarUnits_)},m=function(t){var e=Math.pow(10,Math.floor(Math.log(t)/Math.log(10)));return 5*e<=t?[5*e,5]:2*e<=t?[2*e,2]:[e,1]},x=function(t){return t<.01?1e3*t+"mm":t<1?100*t+"cm":t<1e3?1*t+"m":t/1e3};return i},Ym={EUR_3035:{geoCenter:[479e4,342e4],pixelSize:6400},IC_32628:{geoCenter:[443468,3145647],pixelSize:1e3},GP_32620:{geoCenter:[669498,1784552],pixelSize:130},MQ_32620:{geoCenter:[716521,1621322],pixelSize:130},GF_32622:{geoCenter:[266852,444074],pixelSize:500},RE_32740:{geoCenter:[348011,7661627],pixelSize:130},YT_32738:{geoCenter:[516549,8583920],pixelSize:70},MT_3035:{geoCenter:[4719755,1441701],pixelSize:70},PT20_32626:{geoCenter:[397418,4271471],pixelSize:1500},PT30_32628:{geoCenter:[333586,3622706],pixelSize:150},LI_3035:{geoCenter:[4287060,2672e3],pixelSize:40},IS_3035:{geoCenter:[3011804,496e4],pixelSize:700},SJ_SV_3035:{geoCenter:[457e4,6160156],pixelSize:800},SJ_JM_3035:{geoCenter:[3647762,5408300],pixelSize:100},CARIB_32620:{geoCenter:[636345,1669439],pixelSize:500},WORLD_54030:{geoCenter:[14,17],pixelSize:9e3}},Xm=lp("\t"),Km=Xm.parse;Xm.parseRows,Xm.format,Xm.formatBody,Xm.formatRows,Xm.formatRow,Xm.formatValue;function Zm(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function Qm(t){return function(e,n,i){return 2===arguments.length&&"function"==typeof n&&(i=n,n=void 0),function(t,e){return fetch(t,e).then(Zm)}(e,n).then((function(e){return t(e,i)}))}}var tv=Qm(up);Qm(Km);function ev(t,e){var n,i,r,a,o=function(t,e,n){if(0===Object.entries(t).length)return null;var i,r=[];if(n&&!iv(n.name)&&(n=null),"string"==typeof t&&(t=[t]),Array.isArray(t)||nv(t)){if(t.length===e)return n&&-1===t.findIndex((function(t){return null==t}))?n.from(t):t;if(1===t.length){for(i=0;i<e;i++)r.push(t[0]);return r}}for(i=0;i<e;i++){var a=void 0===t[i]?null:t[i];r.push(a)}return r};if(this.length=0,this.id=[],null!=t)switch(this.class=t.class||"bundle",this.class){case"bundle":var s=[],l=0;if(this.error=null,this.length=0,null===t||"object"!=typeof t)return void(this.class=null);if(t.hasOwnProperty("error"))return void(this.error=t.error);if("dataset"===t.class||"collection"===t.class||"dimension"===t.class)return new ev(t);for(i in t)l++,s.push(i);this.__tree__=t,this.length=l,this.id=s;break;case"dataset":t.hasOwnProperty("__tree__")?this.__tree__=n=t.__tree__:this.__tree__=n=t,this.label=n.label||null,this.note=n.note||null,this.link=n.link||null,this.href=n.href||null,this.updated=n.updated||null,this.source=n.source||null,this.extension=n.extension||null;var c,u=0,h=n.size||n.dimension&&n.dimension.size;if(this.size=h,this.value=n.hasOwnProperty("value")&&null!==n.value&&0!==n.value.length?n.value:{},Array.isArray(this.value)||nv(this.value))u=this.value.length;else{var f=1;for(c=h.length;c--;)f*=h[c];u=f}if(this.value=o(this.value,u,e),this.status=n.hasOwnProperty("status")&&null!==n.status?o(n.status,u):null,n.hasOwnProperty("dimension")){var p=n.dimension,d=n.role||!n.version&&p.role||null,g=n.id||p.id,_=h.length,m=function(t){d.hasOwnProperty(t)||(d[t]=null)};if(!Array.isArray(g)||!Array.isArray(h)||g.length!=_)return;if(this.length=_,this.id=g,d&&(m("time"),m("geo"),m("metric"),m("classification")),d&&null===d.classification){var v=[],y=["time","geo","metric"],x=function(t,e){for(var n=e.length;n--;)if(t===e[n])return!0;return!1};for(c=0;c<3;c++){var b=d[y[c]];null!==b&&(v=v.concat(b))}for(d.classification=[],c=0;c<_;c++)x(g[c],v)||d.classification.push(g[c]);0===d.classification.length&&(d.classification=null)}this.role=d,this.n=u;for(var w=0,S=this.length;w<S;w++)if(p[g[w]].category.hasOwnProperty("index")){if(Array.isArray(p[g[w]].category.index)){var M={},E=p[g[w]].category.index;for(r=E.length,a=0;a<r;a++)M[E[a]]=a;p[g[w]].category.index=M}}else{var C=0;for(i in p[g[w]].category.index={},p[g[w]].category.label)p[g[w]].category.index[i]=C++}}else this.length=0;break;case"dimension":if(!t.hasOwnProperty("__tree__"))return new ev({version:"2.0",class:"dataset",dimension:{d:t},id:["d"],size:[function(t){var e=void 0===t.index?t.label:t.index;return Array.isArray(e)?e.length:Object.keys(e).length}(t.category)],value:[null]}).Dimension(0);var A=[],k=(n=t.__tree__).category;if(!n.hasOwnProperty("category"))return;if(!k.hasOwnProperty("label"))for(i in k.label={},k.index)k.label[i]=i;for(i in k.index)A[k.index[i]]=i;this.__tree__=n,this.label=n.label||null,this.note=n.note||null,this.link=n.link||null,this.href=n.href||null,this.id=A,this.length=A.length,this.role=t.role,this.hierarchy=k.hasOwnProperty("child"),this.extension=n.extension||null;break;case"category":var T=t.child;this.id=T,this.length=null===T?0:T.length,this.index=t.index,this.label=t.label,this.note=t.note||null,this.unit=t.unit,this.coordinates=t.coord;break;case"collection":if(this.length=0,this.label=t.label||null,this.note=t.note||null,this.link=t.link||null,this.href=t.href||null,this.updated=t.updated||null,this.source=t.source||null,this.extension=t.extension||null,null!==this.link&&t.link.item){var P=t.link.item;if(this.length=Array.isArray(P)?P.length:0,this.length)for(a=0;a<this.length;a++)this.id[a]=P[a].href}}}function nv(t){return"[object ArrayBuffer]"===Object.prototype.toString.call(t.buffer)}function iv(t){return-1!==["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].indexOf(t)}function rv(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.json()}ev.prototype.Item=function(t){if(null===this||"collection"!==this.class||!this.length)return null;if("number"==typeof t)return t>this.length||t<0?null:this.link.item[t];var e,n=[];if("object"==typeof t){if(!t.class&&!t.follow)return null;t.class&&(e="dataset"===t.class&&"boolean"==typeof t.embedded?!0===t.embedded?function(t,e,i){var r=t.link.item[e];i.class===r.class&&r.id&&r.size&&r.dimension&&n.push(r)}:function(t,e,i){var r=t.link.item[e];i.class!==r.class||r.id&&r.size&&r.dimension||n.push(r)}:function(t,e,i){i.class===t.link.item[e].class&&n.push(t.link.item[e])})}else e=function(t,e){n.push(t.link.item[e])};for(var i=0;i<this.length;i++)e(this,i,t);return n},ev.prototype.Dataset=function(t){if(null===this)return null;if("dataset"===this.class)return void 0!==t?this:[this];var e,n=[],i=0;if("collection"===this.class){var r=this.Item({class:"dataset",embedded:!0});if(void 0===t){for(e=r.length;i<e;i++)n.push(new ev(r[i]));return n}if("number"==typeof t&&t>=0&&t<r.length)return new ev(r[t]);if("string"==typeof t)for(e=r.length;i<e;i++)if(r[i].href===t)return new ev(r[i]);return null}if("bundle"!==this.class)return null;if(void 0===t){for(e=this.id.length;i<e;i++)n.push(this.Dataset(this.id[i]));return n}if("number"==typeof t){var a=this.id[t];return void 0!==a?this.Dataset(a):null}var o=this.__tree__[t];return void 0===o?null:new ev({class:"dataset",__tree__:o})},ev.prototype.Dimension=function(t,e){e="boolean"!=typeof e||e;var n,i=[],r=this.id.length,a=function(t,e){if(null!==t)for(var n in t)for(var i=null!==t[n]?t[n].length:0;i--;)if(t[n][i]===e)return n;return null};if(null===this||"dataset"!==this.class)return null;if(void 0===t){for(n=0;n<r;n++)i.push(this.Dimension(this.id[n]));return i}if("number"==typeof t){var o=this.id[t];return void 0!==o?this.Dimension(o,e):null}var s=this.role;if("object"==typeof t){if(t.hasOwnProperty("role")){for(n=0;n<r;n++){var l=this.id[n];a(s,l)===t.role&&i.push(this.Dimension(l,e))}return void 0===i[0]?null:i}return null}var c=this.__tree__.dimension;if(void 0===c)return null;var u=c[t];return void 0===u?null:e?new ev({class:"dimension",__tree__:u,role:a(s,t)}):function(t,e){var n=[];for(var i in t)n[t[i]]=e[i];return n}(u.category.index,u.category.label)},ev.prototype.Category=function(t){if(null===this||"dimension"!==this.class)return null;if(void 0===t){for(var e=[],n=0,i=this.id.length;n<i;n++)e.push(this.Category(this.id[n]));return e}if("number"==typeof t){var r=this.id[t];return void 0!==r?this.Category(r):null}var a=this.__tree__.category;if(void 0===a)return null;var o=a.index[t];if(void 0===o)return null;var s=a.unit&&a.unit[t]||null,l=a.coordinates&&a.coordinates[t]||null,c=a.child&&a.child[t]||null,u=a.note&&a.note[t]||null;return new ev({class:"category",index:o,label:a.label[t],note:u,child:c,unit:s,coord:l})},ev.prototype.Dice=function(t,e,n){var i,r,a,o,s=function(t,e){return t.hasOwnProperty(e)&&!!t[e]};if(null===this||"dataset"!==this.class||null===this.value)return null;if("object"!=typeof t)return this;"object"!=typeof e?("boolean"==typeof e&&!0===e&&(i=!0),"boolean"==typeof n&&!0===n||(n=!1)):(i=s(e,"clone"),n=s(e,"drop"),r=s(e,"stringify"),a=s(e,"ovalue"),o=s(e,"ostatus"));var l,c=this.value,u=i?new ev(JSON.parse(JSON.stringify(this))):this,h=u.status,f=[],p=[],d=function(t,e){var n,i,r,a=(n=t,i=e,r={},Array.isArray(n[i])?(n[i].forEach((function(t,e){null!==t&&(r[String(e)]=t)})),r):n[i]);delete t[e],t[e]=a};Array.isArray(t)&&(t=function(t){var e={};return t.forEach((function(t){e[t[0]]=t[1]})),e}(t)),null===t&&(t={});var g=Object.keys(t);return g.length>0&&(g.forEach((function(e){var n=t[e];Array.isArray(n)||(t[e]=[n]),0===t[e].length&&delete t[e]})),n&&(t=function(t){var e={};return Object.keys(t).forEach((function(n){e[n]=u.Dimension(n).id.filter((function(e){return-1===t[n].indexOf(e)}))})),e}(t)),u.toTable({type:"arrobj",content:"id",status:!0}).forEach((function(e,n){var i=[];g.forEach((function(n){var r=t[n],a=[];r.forEach((function(t){a.push(e[n]===t)})),i.push(-1!==a.indexOf(!0))})),-1===i.indexOf(!1)&&(f.push(e.value),p.push(e.status))})),g.forEach((function(e){var n=u.Dimension(e).id,i=0,r={};u.size[u.id.indexOf(e)]=t[e].length,n.forEach((function(n){-1!==t[e].indexOf(n)&&(r[n]=i,i++)})),u.__tree__.dimension[e].category.index=r})),u.n=f.length,u.value=u.__tree__.value=nv(c)?function(t,e){return e.from(t)}(f,c.constructor):f,u.status=u.__tree__.status=null!==h?p:null),r?((l=u.__tree__).hasOwnProperty("id")||(l.version="2.0",l.hasOwnProperty("class")||(l.class="dataset"),l.id=l.dimension.id,l.size=l.dimension.size,delete l.dimension.id,delete l.dimension.size,l.dimension.hasOwnProperty("role")&&(l.role=l.dimension.role,delete l.dimension.role)),l.hasOwnProperty("status")&&-1!==["null","{}","[]"].indexOf(JSON.stringify(l.status))&&delete l.status,l.hasOwnProperty("role")&&(delete l.role.classification,["geo","time","metric"].forEach((function(t){null===l.role[t]&&delete l.role[t]}))),a&&d(l,"value"),o&&l.hasOwnProperty("status")&&d(l,"status"),JSON.stringify(l)):u},ev.prototype.Slice=function(t){if(null===this||"dataset"!==this.class||0===Object.entries(this.value).length)return null;if(void 0===t)return this;if(!Array.isArray(t)){var e,n=[];for(e in t)n.push([e,t[e]]);t=n}return this.Dice(t.map((function(t){return[t[0],[t[1]]]})))},ev.prototype.Data=function(t,e){var n,i,r=[],a=function(t){for(var e in t)if(t.hasOwnProperty(e))return e};if(null===this||"dataset"!==this.class||null===this.value)return null;if(void 0===t){for(i=this.value.length,n=0;n<i;n++)r.push(this.Data(n));return r}if("boolean"!=typeof e&&(e=!0),"number"==typeof t){var o=this.value[t];return void 0===o?null:e?{value:o,status:this.status?this.status[t]:null}:o}var s="object",l=this.__tree__,c=l.size||l.dimension&&l.dimension.size,u=c.length;if(Array.isArray(t)){if(!Array.isArray(t[0])){if(this.length!==t.length)return null;var h=1,f=0,p=[],d=[];for(n=0;n<u;n++)if(void 0!==t[n]){if("number"!=typeof t[n]||t[n]>=c[n])return null;f+=(h*=n>0?c[u-n]:1)*t[u-n-1]}else p.push(n),d.push(c[n]);if(p.length>1)return null;if(1===p.length){for(var g=0,_=d[0];g<_;g++){var m=[];for(n=0;n<u;n++)n!==p[0]?m.push(t[n]):m.push(g);r.push(this.Data(m,e))}return r}return e?{value:this.value[f],status:this.status?this.status[f]:null}:this.value[f]}s="array"}var v=function(t,e,n){var i,r=[],o={},s=t.dimension,l=t.id||s.id,c=t.size||s&&s.size;if("array"===n){for(i=e.length;i--;)o[e[i][0]]=e[i][1];e=o}for(var u=0,h=l.length;u<h;u++){var f=l[u],p=e[f];r.push("string"==typeof p?p:1===c[u]?a(s[f].category.index):null)}return r}(l,t,s),y=[],x=l.dimension,b=l.id||x.id;for(n=0,i=v.length;n<i;n++)y.push(x[b[n]].category.index[v[n]]);return this.Data(y,e)},ev.prototype.toTable=function(t,e){if(null===this||"dataset"!==this.class||null===this.value)return null;1==arguments.length&&"function"==typeof t&&(e=t,t=null),"arrobj"!==(t=t||{field:"label",content:"label",vlabel:"Value",slabel:"Status",type:"array",status:!1,unit:!1,by:null,prefix:"",drop:[],meta:!1,comma:!1,bylabel:!1}).type&&"objarr"!==t.type||void 0!==t.field||(t.field="id");var n,i,r,a,o,s,l,c,u,h="id"===t.field,f=function(t){return(h?"value":t)||"Value"},p=function(t){return(h?"status":t)||"Status"},d=this.__tree__,g=!0===t.status;if("function"==typeof e){n=this.toTable(t);var _=[],m="array"!==t.type?0:1;for(o=(R="object"!==t.type?n.slice(m):n.rows.slice(0)).length,i=0;i<o;i++){var v=e.call(this,R[i],i);void 0!==v&&_.push(v)}return"object"===t.type?{cols:n.cols,rows:_}:("array"===t.type&&_.unshift(n[0]),_)}if("arrobj"===t.type||"objarr"===t.type){var y=[],x=d.role&&d.role.metric,b=function(){},w={},S=this,M=S.id,E=t.by&&-1!==M.indexOf(t.by)?t.by:null,C=!0===t.meta,A=void 0!==t.drop&&Array.isArray(t.drop)?t.drop:[],k=!0===t.comma,T=!0===t.bylabel,P=S.value.constructor,N=function(e){var n,i={},r=f(t.vlabel);return"objarr"===t.type&&(n=null===E&&iv(P.name)?function(t){i[t]=t===r?P.from(e,(function(e){return e[t]})):e.map((function(e){return e[t]}))}:function(t){i[t]=e.map((function(e){return e[t]}))},Object.keys(e[0]).forEach(n),e=i),C?(i={},M.forEach((function(t){var e=S.Dimension(t);i[t]={label:e.label,role:e.role,categories:{id:e.id,label:S.Dimension(t,!1)}}})),{meta:{label:S.label,source:S.source,updated:S.updated,id:M,status:g,unit:t.unit,by:E,bylabel:T,drop:null!==E&&A.length>0?A:null,prefix:null!==E?B||"":null,comma:k,dimensions:i},data:e}):e};E&&(t.field="id");var L=(n=this.toTable({field:t.field,vlabel:t.vlabel,slabel:t.slabel,content:t.content,status:g})).shift();if(null===E&&t.unit&&x){if("id"!==t.content)for(var F=x.length;F--;){var O=this.Dimension(x[F]);w[x[F]]={};for(var G=O.length;G--;)w[x[F]][O.Category(G).label]=O.id[G]}b=function(e,n){if(-1!==x.indexOf(e)){var i=d.dimension[e].category;i.unit?D.unit=i.unit["id"!==t.content?w[e][n]:n]:D.unit=null}},t.unit=!0}else t.unit=!1;for(o=n.length,i=0;i<o;i++){var D={};for(r=n[i].length;r--;)D[L[r]]=n[i][r],b(L[r],n[i][r]);y.push(D)}if(k&&y.forEach((function(t){null!==t.value&&(t.value=(""+t.value).replace(".",","))})),null!==E){var z,I={},R=[],j={},B=void 0!==t.prefix?t.prefix:"";A.forEach((function(t,e){(!S.Dimension(t)||S.Dimension(t).length>1)&&(A[e]="")}));var q=M.filter((function(t){return t!==E&&-1===A.indexOf(t)})),U=S.Dimension(E);for(var W in"id"!==t.content?T?z=function(t,e,n){t[e][B+n[E]]=n.value}:(U.Category().forEach((function(t,e){j[t.label]=U.id[e]})),z=function(t,e,n){t[e][B+j[n[E]]]=n.value}):z=function(t,e,n){t[e][B+n[E]]=n.value},y.forEach((function(t){var e=function(t,e){var n=[];return e.forEach((function(e){n.push(t[e])})),n.join("\t")}(t,q);void 0===I[e]&&(I[e]=function(t,e){var n={};return e.forEach((function(e){n[e]=t[e]})),n}(t,q)),z(I,e,t,E)})),I)R.push(I[W]);return g=!1,N(R)}return N(y)}if("object"===t.type){var H="number"==typeof this.value[0]||null===this.value[0]?"number":"string";s=function(t,e){var n=h&&t||e||t;nt.push({id:t,label:n,type:"string"})},l=function(t,e,n){var i=f(t),r=p(e);n&&nt.push({id:"status",label:r,type:"string"}),nt.push({id:"value",label:i,type:H})},c=function(t){dt.push({v:t})},u=function(t){dt.push({v:t}),it.push({c:dt})}}else s=function(t,e){var n=h&&t||e||t;nt.push(n)},l=function(t,e,n){var i=f(t),r=p(e);n&&nt.push(r),nt.push(i),et.push(nt)},c=function(t){dt.push(t)},u=function(t){dt.push(t),et.push(dt)};var V=d.dimension,$=d.id||V.id,J=d.size||V.size,Y=$.length;if(Y!=J.length)return!1;var X=[],K=1,Z=(F=1,[]),Q=[],tt=[],et=[],nt=[],it=[];for(i=0;i<Y;i++){var rt=$[i];s(rt,V[rt].label),K*=J[i],F*=J[i];var at=[];for(r=0;r<J[i];r++)for(var ot in V[$[i]].category.index)if(V[$[i]].category.index[ot]===r){var st="id"!==t.content&&V[$[i]].category.label?V[$[i]].category.label[ot]:ot;at.push(st)}X.push(at),Z.push(F)}for(l(t.vlabel,t.slabel,g),o=X.length,i=0;i<o;i++){for(var lt=[],ct=0,ut=X[i].length;ct<ut;ct++)for(var ht=0;ht<K/Z[i];ht++)lt.push(X[i][ct]);Q.push(lt)}for(o=Q.length,i=0;i<o;i++){var ft=[],pt=0;for(a=0;a<K;a++)ft.push(Q[i][pt]),++pt===Q[i].length&&(pt=0);tt.push(ft)}for(a=0;a<K;a++){var dt=[];o=Q.length;for(var gt=0;gt<o;gt++)c(tt[gt][a]);g&&c(this.status?this.status[a]:null),u(this.value[a])}return"object"===t.type?{cols:nt,rows:it}:et},ev.prototype.node=function(){return this.__tree__},ev.prototype.toString=function(){return this.class};var av=function(t){var e={__data:void 0,_data_:void 0,get:function(t){return t?e._data_?e._data_[t]:void 0:e._data_},getValue:function(t){var n=e.get(t);return n?n.value:void 0},set:function(t,n){e._data_=e._data_||{};var i=e._data_[t];return i?n.value?(i.value=n.value,i.status=n.status):i.value=n:e._data_[t]=n.value?n:{value:n},e},setData:function(t){return e.__data=t,e._data_={},Object.keys(t).forEach((function(n){return e.set(n,t[n])})),e},setManualMultiDate:function(t){for(var n in e._data_=e._data_||{},t){var i=t[n];for(var r in e._data_[n]={},i){var a=i[r];e._data_[n][r]={value:a}}}return e},getArray:function(){if(e._data_)return Object.values(e._data_).map((function(t){return t.value})).filter((function(t){return 0==t||t}))},getUniqueValues:function(){return Object.values(e._data_).map((function(t){return t.value})).filter((function(t,e,n){return n.indexOf(t)===e}))},getMin:function(){if(e._data_)return Object.values(e._data_).map((function(t){return t.value})).filter((function(t){return 0==t||t&&":"!==t})).reduce((function(t,e){return Math.min(t,e)}))},getMax:function(){if(e._data_)return Object.values(e._data_).map((function(t){return t.value})).filter((function(t){return 0==t||t&&":"!==t})).reduce((function(t,e){return Math.max(t,e)}))},isReady:function(){return null!=e._data_},metadata:void 0,unitText_:void 0,retrieveFromRemote:function(t,n,a){return e.eurostatDatasetCode_?i(t,n,a):e.csvURL_&&r(a),e},eurostatDatasetCode_:void 0,filters_:{lastTimePeriod:1},precision_:2,label_:void 0},n=function(t,n){return e.filters_.geo||(e.filters_.geoLevel=t+""=="0"?"country":"nuts"+t),Lf(function(t,e,n,i){n=n||"en",i=i||"json";var r=[];if(r.push("https://ec.europa.eu/eurostat/api/dissemination/statistics/1.0/data/",t,"?","format=",i,"&lang=",n),e)for(var a in e){var o=e[a];if(Array.isArray(o))for(var s=0;s<o.length;s++)r.push("&",a,"=",o[s]);else r.push("&",a,"=",o)}return r.join("")}(e.eurostatDatasetCode_,e.filters_,n))},i=function(t,i,r){e._data_=null,n(t,i).then((function(t){var n;if(t.error)return console.error("Error retrieving Eurostat data: "+(null===(n=t.error[0])||void 0===n?void 0:n.label));var i=function(t,e,n){var i="object"==typeof e?e:null;return"function"!=typeof n&&(n=null),n||"function"!=typeof e||(n=e),"object"==typeof t?new ev(t,n):"version"===t?"1.5.3":fetch?fetch(t,i).then(rv).then((function(t){return new ev(t,n)})):void 0}(t);e.metadata={label:i.label,href:i.href,source:i.source,updated:i.updated,extension:i.extension},e.metadata.time=i.Dimension("time").id[0],e._data_=function(t){for(var e={},n=t.Dimension("geo").id,i=0;i<n.length;i++)e[n[i]]=t.Data(i);return e}(i),r&&r()}))};e.getTime=function(){var t=e.filters_.time;return t||(e._data_?e.metadata.time:void 0)},e.csvURL_=void 0,e.geoCol_="geo",e.valueCol_="value";var r=function(t){e._data_=null,tv(e.csvURL_).then((function(n){e._data_=function(t,e,n){for(var i={},r=0;r<t.length;r++){var a=t[r],o=a[n];i[a[e]]=o?{value:isNaN(+o)?o:+o,status:""}:{value:":",status:""}}return i}(n,e.geoCol_,e.valueCol_),e.metadata={href:e.csvURL_},t&&t()}))};if(["unitText_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),t)for(var a in t)e[a+"_"]=t[a];return e};function ov(t,e){var n=t.map;n.patternFill_&&n.patternFill_.forEach((function(i,r){if(i.legendLabel){var a=r*t.shapeHeight+r*t.shapePadding+15,o=e.append("g").attr("class","em-legend-item em-pattern-legend-item"),s=i.color||"#000";("#fff"===s.toLowerCase()||"white"===s.toLowerCase())&&o.append("rect").attr("x",0).attr("y",a).attr("width",t.shapeWidth).attr("height",t.shapeHeight).attr("fill","#ddd"),o.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",a).attr("width",t.shapeWidth).attr("height",t.shapeHeight).attr("fill","url(#".concat(i.patternId||i.pattern,")")).on("mouseover",(function(){sv(n,i.patternId||i.pattern),n.insetTemplates_&&ua(n.insetTemplates_,n.svgId,sv,i.patternId||i.pattern)})).on("mouseout",(function(){lv(n),n.insetTemplates_&&ua(n.insetTemplates_,n.svgId,lv)})),o.append("text").attr("class","em-legend-label").attr("x",t.shapeWidth+t.labelOffsets.x).attr("y",a+t.shapeHeight/2).attr("dominant-baseline","middle").attr("dy","0.35em").text(i.legendLabel)}}))}function sv(t,e){var n="url(#".concat(e,")"),i=da(t);t.svg_.selectAll(i).selectAll("[ecl]").filter((function(){return!Ft(this).classed("pattern-fill-overlay")})).style("fill","white"),t.svg_.selectAll(".pattern-fill-overlay").style("opacity",0),t.svg_.selectAll(".pattern-fill-overlay").filter((function(){return Ft(this).attr("fill")===n})).style("opacity",1)}function lv(t){t.svg_.selectAll(".pattern-fill-overlay").style("opacity",1);var e=da(t);t.svg_.selectAll(e).selectAll("[ecl]").filter((function(){return!Ft(this).classed("pattern-fill-overlay")})).each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}class cv extends Map{constructor(t,e=pv){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(uv(this,t))}has(t){return super.has(uv(this,t))}set(t,e){return super.set(hv(this,t),e)}delete(t){return super.delete(fv(this,t))}}Set;function uv({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function hv({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}function fv({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t.delete(i)),n}function pv(t){return null!==t&&"object"==typeof t?t.valueOf():t}const dv=Symbol("implicit");function gv(){var t=new cv,e=[],n=[],i=dv;function r(r){let a=t.get(r);if(void 0===a){if(i!==dv)return i;t.set(r,a=e.push(r)-1)}return n[a%n.length]}return r.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new cv;for(const i of n)t.has(i)||t.set(i,e.push(i)-1);return r},r.range=function(t){return arguments.length?(n=Array.from(t),r):n.slice()},r.unknown=function(t){return arguments.length?(i=t,r):i},r.copy=function(){return gv(e,n).unknown(i)},Ht.apply(r,arguments),r}function _v(){var t,e,n=gv().unknown(void 0),i=n.domain,r=n.range,a=0,o=1,s=!1,l=0,c=0,u=.5;function h(){var n=i().length,h=o<a,f=h?o:a,p=h?a:o;t=(p-f)/Math.max(1,n-l+2*c),s&&(t=Math.floor(t)),f+=(p-f-t*(n-l))*u,e=t*(1-l),s&&(f=Math.round(f),e=Math.round(e));var d=zf(n).map((function(e){return f+t*e}));return r(h?d.reverse():d)}return delete n.unknown,n.domain=function(t){return arguments.length?(i(t),h()):i()},n.range=function(t){return arguments.length?([a,o]=t,a=+a,o=+o,h()):[a,o]},n.rangeRound=function(t){return[a,o]=t,a=+a,o=+o,s=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(s=!!t,h()):s},n.padding=function(t){return arguments.length?(l=Math.min(1,c=+t),h()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},n.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},n.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),h()):u},n.copy=function(){return _v(i(),[a,o]).round(s).paddingInner(l).paddingOuter(c).align(u)},Ht.apply(h(),arguments)}function mv(t){return t}var vv=1e-6;function yv(t){return"translate("+t+",0)"}function xv(t){return"translate(0,"+t+")"}function bv(t){return e=>+t(e)}function wv(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function Sv(){return!this.__axis}function Mv(t,e){var n=[],i=null,r=null,a=6,o=6,s=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,c=1===t||4===t?-1:1,u=4===t||2===t?"x":"y",h=1===t||3===t?yv:xv;function f(f){var p=null==i?e.ticks?e.ticks.apply(e,n):e.domain():i,d=null==r?e.tickFormat?e.tickFormat.apply(e,n):mv:r,g=Math.max(a,0)+s,_=e.range(),m=+_[0]+l,v=+_[_.length-1]+l,y=(e.bandwidth?wv:bv)(e.copy(),l),x=f.selection?f.selection():f,b=x.selectAll(".domain").data([null]),w=x.selectAll(".tick").data(p,e).order(),S=w.exit(),M=w.enter().append("g").attr("class","tick"),E=w.select("line"),C=w.select("text");b=b.merge(b.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(M),E=E.merge(M.append("line").attr("stroke","currentColor").attr(u+"2",c*a)),C=C.merge(M.append("text").attr("fill","currentColor").attr(u,c*g).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),f!==x&&(b=b.transition(f),w=w.transition(f),E=E.transition(f),C=C.transition(f),S=S.transition(f).attr("opacity",vv).attr("transform",(function(t){return isFinite(t=y(t))?h(t+l):this.getAttribute("transform")})),M.attr("opacity",vv).attr("transform",(function(t){var e=this.parentNode.__axis;return h((e&&isFinite(e=e(t))?e:y(t))+l)}))),S.remove(),b.attr("d",4===t||2===t?o?"M"+c*o+","+m+"H"+l+"V"+v+"H"+c*o:"M"+l+","+m+"V"+v:o?"M"+m+","+c*o+"V"+l+"H"+v+"V"+c*o:"M"+m+","+l+"H"+v),w.attr("opacity",1).attr("transform",(function(t){return h(y(t)+l)})),E.attr(u+"2",c*a),C.attr(u,c*g).text(d),x.filter(Sv).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),x.each((function(){this.__axis=y}))}return f.scale=function(t){return arguments.length?(e=t,f):e},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),f):n.slice()},f.tickValues=function(t){return arguments.length?(i=null==t?null:Array.from(t),f):i&&i.slice()},f.tickFormat=function(t){return arguments.length?(r=t,f):r},f.tickSize=function(t){return arguments.length?(a=o=+t,f):a},f.tickSizeInner=function(t){return arguments.length?(a=+t,f):a},f.tickSizeOuter=function(t){return arguments.length?(o=+t,f):o},f.tickPadding=function(t){return arguments.length?(s=+t,f):s},f.offset=function(t){return arguments.length?(l=+t,f):l},f}function Ev(t){return Mv(3,t)}function Cv(t){return Mv(4,t)}var Av=function(t,e,n){var i=t.histogram.orientation||"horizontal",r=t.histogram.showCounts,a=t.histogram.showPercentages,o=t.histogram.labelRotation||0,s=t.histogram.margin||{top:0,right:0,bottom:0,left:0},l=t.histogram.height||200,c=t.histogram.width||270,u=t.getNumberOfClasses(t),h=t.getLabelFormatter(t),f=t.getColorClassifier(t),p=new Array(u).fill(0),d=function(t){var e=t.map;return Object.values(e.statData()._data_).map((function(t){return t.value}))}(t),g=function(t){var e=t.map;return e.colors_?e.colors_:Array.from({length:e.numberOfClasses_}).map((function(t,n){return e.classToFillStyle()(n,e.numberOfClasses_)}))}(t),_=qv(t);d.forEach((function(t){var e=f(t);"number"==typeof e&&e>=0&&e<p.length&&p[e]++}));var m=p.reduce((function(t,e){return t+e}),0),v=t.lgg.append("g").attr("class","em-legend-histogram").attr("transform","translate(".concat(e,", ").concat(n,")"));function y(e,n){var i=Ft(this).style("stroke","black").attr("ecl"),r=g.length-1-parseInt(i,10);Wv(map,r),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,Wv,i)}function x(e,n){Ft(this).style("stroke","none");Hv(map),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,Hv)}"vertical"===i?function(e){var n=p.slice().reverse(),i=n.map((function(t){return m>0?t/m*100:0})),o=_.slice().reverse(),u=_v().domain(n.map((function(t,e){return e}))).range([s.top,l-s.bottom]).padding(.1),f=En().domain([0,Gt(n)]).nice().range([s.left,c-s.right]);e.selectAll("rect").data(n).join("rect").attr("class","em-legend-histogram-bar").attr("y",(function(t,e){return u(e)})).attr("x",s.left).attr("height",u.bandwidth()).attr("width",(function(t){return f(t)-s.left})).attr("fill",(function(t,e){return g[g.length-e-1]})).attr("ecl",(function(t,e){return e})).on("mouseover",y).on("mouseout",x),(r||a)&&e.selectAll("text.em-histogram-label").data(n).join("text").attr("class","em-legend-label em-histogram-label").attr("x",(function(t){return f(t)+5})).attr("y",(function(t,e){return u(e)+u.bandwidth()/2})).attr("alignment-baseline","middle").text((function(t,e){return a?"".concat(i[e].toFixed(1),"%"):n[e]}));var d=e.append("g").attr("id","em-legend-histogram-y-axis").attr("transform","translate(".concat(s.left,",0)"));if("thresholds"===t.labelType){for(var v=[],b=0;b<o.length;b++){var w=u(b);void 0!==w&&v.push(w+u.bandwidth())}var S=En().domain([0,l]).range([0,l]);d.call(Cv(S).tickValues(v).tickFormat((function(t,e){return h?h(o[e],e):o[e]})).tickSize(4).tickSizeOuter(0))}else"ranges"===t.labelType&&d.call(Cv(u).tickSizeOuter(0).tickSize(0).tickFormat((function(t,e){return h?h(o[e],e):o[e]})));d.selectAll("text").attr("class","em-legend-label em-tick-label").attr("text-anchor","end")}(v):function(e){var n=p.slice().reverse(),i=n.map((function(t){return m>0?t/m*100:0})),u=g.slice().reverse(),f=_v().domain(n.map((function(t,e){return e}))).range([s.left,c-s.right]).padding(.1),d=En().domain([0,Gt(n)]).nice().range([l-s.bottom,s.top]);e.selectAll("rect").data(n).join("rect").attr("class","em-legend-histogram-bar").attr("x",(function(t,e){return f(e)})).attr("y",(function(t){return d(t)})).attr("width",f.bandwidth()).attr("height",(function(t){return l-s.bottom-d(t)})).attr("fill",(function(t,e){return u[e]})).attr("ecl",(function(t,e){return e})).on("mouseover",y).on("mouseout",x),(r||a)&&e.selectAll("text.em-histogram-label").data(n).join("text").attr("class","em-legend-label em-histogram-label").attr("x",(function(t,e){return f(e)+f.bandwidth()/2})).attr("y",(function(t){return d(t)-5})).attr("text-anchor","middle").text((function(t,e){return a?"".concat(i[e].toFixed(1),"%"):t}));var v=e.append("g").attr("id","em-legend-histogram-x-axis").attr("transform","translate(0, ".concat(l-s.bottom,")"));if("thresholds"===t.labelType){for(var b=[],w=0;w<_.length;w++){var S=_.length-w-1,M=f(S);void 0!==M&&b.push(M+f.bandwidth())}var E=En().domain([0,c]).range([0,c]);v.call(Ev(E).tickValues(b).tickFormat((function(t,e){return h?h(_[e],e):_[e]})).tickSize(4).tickSizeOuter(0)),v.selectAll("text").attr("class","em-legend-label em-tick-label").attr("text-anchor","end").attr("dy","0em").attr("dx","-0.45em").attr("transform","rotate(-".concat(o,")"))}else"ranges"===t.labelType&&(v.call(Ev(f).tickSizeOuter(0).tickSize(0).tickFormat((function(t,e){return h?h(_[e],e):_[e]}))),v.selectAll("text").attr("class","em-legend-label em-tick-label").attr("text-anchor","end").attr("dy","0.35em").attr("dx","-0.35em").attr("transform","rotate(-".concat(o,")")))}(v)};function kv(t,e,n){t.map;t._continuousLegendContainer=t.lgg.append("g").attr("class","em-continuous-legend").attr("id","em-continuous-legend").attr("transform","translate(".concat(e,", ").concat(n,")"));var i="ps"==t.map._mapType?t.colorLegend:t,r="vertical"===i.orientation,a="legend-gradient-"+Math.random().toString(36).substr(2,5),o=t.width||6*t.shapeWidth,s=r?t.shapeWidth:t.shapeHeight;if(function(t,e,n){for(var i,r=t.map,a="function"==typeof(null===(i=r.colorFunction_)||void 0===i?void 0:i.domain),o=20,s=function(t){var e=t.valueTransform_||function(t){return t},n=Tv(t);return n.map(e)}(r),l=v(3===s.length?s:[s[0],null,s[1]],3),c=l[0],u=l[1],h=l[2],f=t._continuousLegendContainer.append("defs").append("linearGradient").attr("id",e).attr("x1","0%").attr("x2",n?"0%":"100%").attr("y1",n?"100%":"0%").attr("y2","0%"),p=0;p<=o;p++){var d=p/o,g=void 0;g=3===s.length?d<.5?c+2*d*(u-c):u+2*(d-.5)*(h-u):c+d*(h-c);var _=r.colorFunction_(a?g:d);f.append("stop").attr("offset","".concat(100*d,"%")).attr("stop-color",_)}}(t,a,r),function(t,e,n,i,r){var a=Pv(e),o=e._continuousLegendContainer.append("rect").attr("class","em-legend-gradient").attr("id","em-legend-gradient").attr("x",0).attr("y",a).attr("width",r?i:n).attr("height",r?n:i).style("fill","url(#".concat(t,")"));!function(t,e,n,i){var r=e.map,a=Tv(r),o=r.valueUntransform_||function(t){return t},s=e._continuousLegendContainer,l=Pv(e),c=function(t){return"ps"==t._mapType?Ov:Lv}(r),u=function(t){return"ps"==t._mapType?Gv:Fv}(r);t.on("mousemove",(function(t){var u,h=v(Br(t,this),2),f=h[0],p=h[1],d=i?p-l:f,g=Math.max(0,Math.min(n,d)),_=g/n,m=i?1-_:_;if(3===a.length){var y=v(a,3),x=y[0],b=y[1],w=y[2];if(m<.5)u=x+(b-x)*(m/.5);else u=b+(w-b)*((m-.5)/.5)}else{var S=v(a,2),M=S[0];u=M+m*(S[1]-M)}u=o(u),s.selectAll(".em-hover-line, .em-hover-tick, .em-hover-label").remove();var E=i?0:g,C=i?g+l:0;s.append("line").attr("class","em-hover-line").attr("x1",E).attr("y1",C).attr("x2",i?E+e.shapeWidth:E).attr("y2",i?C:C+e.shapeHeight).attr("stroke","black").attr("stroke-width",1).attr("pointer-events","none"),s.append("circle").attr("class","em-hover-tick").attr("cx",i?E+e.shapeWidth:E).attr("cy",i?C:C+e.shapeHeight).attr("r",3).attr("fill","black").attr("pointer-events","none");var A=Uv(e);s.append("text").attr("class","em-hover-label").attr("x",i?E+e.shapeWidth+5:E).attr("y",i?C:C+e.shapeHeight+12).attr("text-anchor",i?"start":"middle").attr("alignment-baseline","middle").attr("pointer-events","none").text(A(u)),c(r,u)})),t.on("mouseout",(function(){s.selectAll(".em-hover-line, .em-hover-tick, .em-hover-label").remove(),u(r)}))}(o,e,n,r)}(a,t,o,s,r),function(t){return t.ticks>1||t.tickValues}(t)?function(t,e,n,i){var r=t.map,a=Tv(r),o=t._continuousLegendContainer.append("g").attr("class","em-legend-ticks"),s=Uv(t),l=r.valueTransform_||function(t){return t},c=Pv(t),u=Array.isArray(t.tickValues)&&t.tickValues?t.tickValues.map(l):function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(t){return t};if(Array.isArray(t)&&3===t.length){var i=v(t,3),r=i[0],a=i[1],o=i[2];return Array.from({length:e},(function(t,i){var s=i/(e-1);return n(s<.5?r+2*s*(a-r):a+2*(s-.5)*(o-a))}))}var s=v(t,2),l=s[0],c=s[1];return Array.from({length:e},(function(t,i){return n(l+i/(e-1)*(c-l))}))}(a,t.ticks,l);u.forEach((function(l,h){var f=function(t,e){if(3===e.length){var n=v(e,3),i=n[0],r=n[1],a=n[2];return t<r?.5*(t-i)/(r-i):.5+.5*(t-r)/(a-r)}return(t-e[0])/(e[1]-e[0])}(l,a);if(i){var p=n,d=e-f*e+c;o.append("line").attr("class","em-legend-tick").attr("x1",p).attr("y1",d).attr("x2",p+t.tickLength).attr("y2",d);var g=Array.isArray(t.tickLabels)&&null!=t.tickLabels[h]?t.tickLabels[h]:r.valueUntransform_?s(r.valueUntransform_(l)):s(l);o.append("text").attr("class","em-legend-label em-legend-ticklabel").attr("x",p+t.tickLength+3).attr("y",d).attr("dy","0.35em").attr("text-anchor","start").text(g)}else{var _=f*e,m=n+c;o.append("line").attr("class","em-legend-tick").attr("x1",_).attr("y1",m).attr("x2",_).attr("y2",m+t.tickLength);var y=Array.isArray(t.tickLabels)&&null!=t.tickLabels[h]?t.tickLabels[h]:r.valueUntransform_?s(r.valueUntransform_(l)):s(l);o.append("text").attr("class","em-legend-label em-legend-ticklabel").attr("x",_).attr("y",m+t.tickLength+10).attr("dy","0").attr("text-anchor",0===h?"start":h===u.length-1?"end":"middle").text(y)}}))}(t,o,s,r):function(t,e,n,i){var r=Pv(t),a=t.lowLabel,o=t.highLabel,s=t.pointOfDivergenceLabel,l=t._continuousLegendContainer;if(i){var c=e,u=n+5;a&&l.append("text").attr("class","em-legend-label").attr("x",u).attr("y",r+c).attr("dy","-0.2em").attr("text-anchor","start").text(a),o&&l.append("text").attr("class","em-legend-label").attr("x",u).attr("y",r).attr("dy","0.8em").attr("text-anchor","start").text(o),s&&l.append("text").attr("class","em-legend-label").attr("x",u).attr("y",r+c/2).attr("dy","0.35em").attr("text-anchor","start").text(s)}else{var h=n+r+10;a&&l.append("text").attr("class","em-legend-label").attr("x",0).attr("y",h).attr("text-anchor","start").text(a),o&&l.append("text").attr("class","em-legend-label").attr("x",e).attr("y",h).attr("text-anchor","end").text(o),s&&l.append("text").attr("class","em-legend-label").attr("x",e/2).attr("y",h).attr("text-anchor","middle").text(s)}}(t,o,s,r),t.noData){var l=(r?t.width+5:s+30)+Pv(t);i.pointOfDivergence&&i.pointOfDivergencePadding&&(l+=i.pointOfDivergencePadding);var c=t._continuousLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(0,",").concat(l,")"));t.appendNoDataLegend(c,i.noDataText,Lv,Fv)}}function Tv(t){var e;return"function"==typeof(null===(e=t.colorFunction_)||void 0===e?void 0:e.domain)?t.colorFunction_.domain():t.domain_||[0,1]}function Pv(t){return"ps"==t.map._mapType?t.colorLegend.titlePadding:t.titlePadding}function Nv(t){var e,n,i;return t&&t.legend_&&null!==(e=null!==(n=t.legend_.highlightTolerance)&&void 0!==n?n:null===(i=t.legend_.colorLegend)||void 0===i?void 0:i.highlightTolerance)&&void 0!==e?e:1}function Lv(t,e){var n=Nv(t),i=da(t),r=t.svg_.selectAll(i).selectAll("[ecl]");r&&r.each((function(){var t=Ft(this),i=t.attr("ecl");if(i&&"nd"!==i){var r=+i;r>=e-n&&r<=e+n?t.style("fill",Ft(this).attr("fill___")):t.style("fill","white")}else{if("nd"===e)return;t.style("fill","white")}}))}function Fv(t){var e=da(t);t.svg_.selectAll(e).selectAll("[ecl]").each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}function Ov(t,e){var n=Nv(t);t.getCentroidsGroup(t).selectAll("[ecl]").each((function(){var i=Ft(this),r=i.attr("ecl");if(!r||"nd"===r)return"nd"===e?void i.style("opacity",t.psFillOpacity_):void i.style("opacity",0);var a=+r;a>=e-n&&a<=e+n?i.style("opacity",t.psFillOpacity_):i.style("opacity",0)}))}function Gv(t){t.getCentroidsGroup(t).selectAll("[ecl]").each((function(){Ft(this).style("opacity",t.psFillOpacity_)}))}function Dv(t,e,n){var i,r;t._discreteLegendContainer=t.lgg.append("g").attr("class","em-discrete-legend-container").attr("transform","translate(".concat(e,",").concat(n,")")),null!==(i=t.colorLegend)&&void 0!==i&&i.title&&t._discreteLegendContainer.append("text").attr("class","em-legend-title em-color-legend-title").attr("id","em-color-legend-title").attr("x",0).attr("y",0).text(t.colorLegend.title);var a="ps"==t.map._mapType?t.colorLegend:t;if("ranges"===t.labelType||"ranges"===(null===(r=t.colorLegend)||void 0===r?void 0:r.labelType)?function(t,e){for(var n=t.map,i=t._discreteLegendContainer,r=t.getLabelFormatter(t),a=t.getNumberOfClasses(t),o=t.getHighlightFunction(n),s=t.getUnHighlightFunction(n),l=t.getClassToFillStyle(t),c=t.getColorClassifier(t),u=zv(t),h=function(){var n=f*e.shapeHeight+u,h=0,p=t.ascending?a-f-1:f,d=l(p,a),g=i.append("g").attr("class","em-legend-item");e.pointOfDivergenceLabel&&f>=e.pointOfDivergence&&(n+=e.pointOfDivergencePadding),g.append("rect").attr("class","em-legend-rect").attr("x",h).attr("y",n).attr("width",e.shapeWidth).attr("height",e.shapeHeight).style("fill",d).on("mouseover",(function(){Ft(this).raise(),o(t.map,p),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,o,p)})).on("mouseout",(function(){s(t.map),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,s,p)})),f>0&&g.append("line").attr("class","em-legend-separator").attr("x1",0).attr("y1",n).attr("x2",e.sepLineLength).attr("y2",n),g.append("text").attr("class","em-legend-label").attr("x",Math.max(e.shapeWidth,e.sepLineLength+e.tickLength)+(e.labelOffsets.x||0)).attr("y",n+e.shapeHeight/2).attr("dy","0.3em").text(e.labels?e.labels[f]:r(c.invertExtent(p)[t.ascending?0:1],f))},f=0;f<a;f++)h();if(e.pointOfDivergenceLabel)for(var p=0;p<a;p++){var d=p*e.shapeHeight+u;p==e.pointOfDivergence&&Iv(t,d,e)}}(t,a):function(t,e){for(var n=t.map,i=t._discreteLegendContainer,r=t.getNumberOfClasses(t),a=zv(t),o=t.getHighlightFunction(n),s=t.getUnHighlightFunction(n),l=t.getColorClassifier(t),c=t.getClassToFillStyle(t),u=t.getLabelFormatter(t),h=function(h){var f=h*e.shapeHeight+a,p=0,d=t.ascending?r-h-1:h,g=c(d,r);if(i.append("rect").attr("class","em-legend-rect").attr("x",p).attr("y",f).attr("width",e.shapeWidth).attr("height",e.shapeHeight).style("fill",g).on("mouseover",(function(){Ft(this).raise(),o(n,d),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,o,d)})).on("mouseout",(function(){s(n),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,s,d)})),h>0&&i.append("line").attr("class","em-legend-separator").attr("x1",0).attr("y1",f).attr("x2",t.sepLineLength).attr("y2",f),h>0&&i.append("line").attr("class","em-legend-tick").attr("x1",e.sepLineLength).attr("y1",f).attr("x2",e.sepLineLength+e.tickLength).attr("y2",f),h<r-1){var _=i.append("text").attr("class","em-legend-label").attr("x",Math.max(e.shapeWidth,e.sepLineLength+e.tickLength)+(e.labelOffsets.x||0)).attr("y",f+e.shapeHeight).attr("dy","0.3em").text((function(){if(e.labels)return e.labels[h];if(null!=l&&l.invertExtent){var i=l.invertExtent(d);return u(i[t.ascending?0:1])}return n.noDataText_||""}));e.pointOfDivergenceLabel&&h==e.pointOfDivergence-1&&_.attr("class","em-legend-label em-legend-label-divergence")}},f=0;f<r;f++)h(f);if(e.pointOfDivergenceLabel)for(var p=0;p<r;p++){var d=p*e.shapeHeight+a;p==e.pointOfDivergence&&Iv(t,d,e)}}(t,a),a.noData){var o=t.getNumberOfClasses(t)*a.shapeHeight+zv(t)+3;a.pointOfDivergence&&a.pointOfDivergencePadding&&(o+=a.pointOfDivergencePadding);var s=t._discreteLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(0,",").concat(o,")")),l=t.getHighlightFunction(t.map),c=t.getUnHighlightFunction(t.map);t.appendNoDataLegend(s,a.noDataText,l,c)}}function zv(t){return"ps"==t.map._mapType?t.colorLegend.titlePadding:0}function Iv(t,e,n){var i,r,a,o=t._discreteLegendContainer.append("g").attr("class","em-legend-divergence-container");"ranges"==n.labelType&&(e+=n.pointOfDivergencePadding/2);var s=t._discreteLegendContainer.selectAll(".em-legend-label").nodes().reduce((function(t,e){return Math.max(t,e.getBBox().width)}),0),l=t.divergingLineLength||t.shapeWidth+(null===(i=t.labelOffsets)||void 0===i?void 0:i.x)+s+(null===(r=t.labelOffsets)||void 0===r?void 0:r.x)+15;o.append("line").attr("x1",0).attr("y1",e).attr("x2",0+l).attr("y2",e).attr("class","em-legend-diverging-line");var c=t.pointOfDivergenceLabel.split("|");if(c.length>1){var u=t.divergingArrowLength||30,h=0+l;o.append("defs").append("marker").attr("id","arrowhead").attr("markerWidth",6).attr("markerHeight",6).attr("refX",0).attr("refY",3).attr("orient","auto").append("polygon").attr("points","0 0, ".concat(6," ").concat(3,", 0 ").concat(6)).attr("fill","black"),o.append("line").attr("class","em-legend-diverging-line").attr("x1",h).attr("y1",e).attr("x2",h).attr("y2",e-u).attr("marker-end","url(#arrowhead)"),o.append("line").attr("class","em-legend-diverging-line").attr("x1",h).attr("y1",e).attr("x2",h).attr("y2",e+u).attr("marker-end","url(#arrowhead)"),o.append("text").attr("class","em-legend-label").attr("x",h+10).attr("y",e-u+10).attr("dy","0.3em").text(c[0]),o.append("text").attr("class","em-legend-label").attr("x",h+10).attr("y",e+u-10).attr("dy","0.3em").text(c[1])}else o.append("text").attr("class","em-legend-diverging-label em-legend-label").attr("x",0+l+5).attr("y",e).attr("dy","0.3em").text(t.pointOfDivergenceLabel);"thresholds"!=t.labelType&&"thresholds"!=(null===(a=t.colorLegend)||void 0===a?void 0:a.labelType)||(c.length>1?t._discreteLegendContainer.selectAll(".em-legend-label-divergence").attr("x",0+l+10):t._discreteLegendContainer.selectAll(".em-legend-label-divergence").remove())}function Rv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function jv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Rv(Object(n),!0).forEach((function(e){ma(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Rv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Bv=function(t,e){var n=ax(t);if(n.labelType="thresholds",n.sepLineLength=n.shapeWidth,n.tickLength=4,n.decimals=0,n.labelOffsets={x:3,y:0},n.labels=null,n.histogram=null,n.pointOfDivergenceLabel=void 0,n.pointOfDivergence=void 0,n.pointOfDivergencePadding=7,n.divergingLineLength=void 0,n.divergingArrowLength=void 0,n.lowLabel="Low",n.highLabel="High",n.ticks=0,n.tickValues=void 0,n.tickLabels=void 0,n.orientation="vertical",e)for(var i in e)"histogram"===i&&"object"===ga(e[i])?n.histogram=jv({orientation:"horizontal",showCounts:!1,showPercentages:!1,labelRotation:0},e.histogram):n[i]=e[i];return n.update=function(){if(n.updateConfig(),n.updateContainer(),n.lgg.node()){var t=n.map;if(n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle(),!t.classToFillStyle())return;n.pointOfDivergenceLabel&&!n.pointOfDivergence&&(n.pointOfDivergence=t.numberOfClasses_/2);var e=n.getBaseY(),i=n.getBaseX();if(n.histogram?Av(n,i,e):"continuous"===t.colorSchemeType_?kv(n,i,e):Dv(n,i,e),t.opacityScale_){var r=n.lgg.node().getBBox().height+10;!function(t,e,n){var i,r=t.map,a=r.statData("alpha");if(a&&a.isReady()){var o=r.opacityScale_,s=o.domain()[0],l=o.domain()[1],c=Uv(t);t._alphaLegendContainer=t.lgg.append("g").attr("class","alpha-legend-container").attr("transform","translate(".concat(e,",").concat(n,")"));for(var u=0;u<40;u++){var h=s+(l-s)*u/40;t._alphaLegendContainer.append("rect").attr("x",3*u).attr("y",0).attr("width",3).attr("height",10).style("fill","#000").style("opacity",o(h))}t._alphaLegendContainer.append("text").attr("x",0).attr("y",22).attr("class","em-legend-label").text(c(s)),t._alphaLegendContainer.append("text").attr("x",120).attr("y",22).attr("text-anchor","end").attr("class","em-legend-label").text(c(l)),t._alphaLegendContainer.append("text").attr("x",60).attr("y",-5).attr("text-anchor","middle").attr("class","em-legend-label").text((null===(i=a.unitText)||void 0===i?void 0:i.call(a))||"Transparency")}}(n,i,e+r)}if(n.map.patternFill_){var a=n.lgg.node().getBBox().height,o=n.lgg.append("g").attr("class","pattern-fill-legend").attr("transform","translate(".concat(n.getBaseX(),", ").concat(a+n.boxPadding+5,")"));ov(n,o)}n.setBoxDimension()}},n.labelDecNb=function(t){return console.warn("labelDecNb is now DEPRECATED. Please use decimals instead."),n},n};function qv(t){var e=t.map,n=e.thresholds_.length>1?e.thresholds_:Array.from({length:e.numberOfClasses_}).map((function(n,i){return e.classifier().invertExtent(i)[t.ascending?0:1]})).slice(1);return n}function Uv(t){if("ranges"==t.labelType){var e=qv(t);return t.labelFormatter||function(n,i){var r=mn(".".concat(t.decimals,"f"));return 0===i?"> ".concat(r(e[e.length-1])):i===e.length?"< ".concat(r(e[0])):"".concat(r(e[e.length-i-1])," - < ").concat(r(e[e.length-i])," ")}}return t.labelType,t.labelFormatter||mn(".".concat(t.decimals,"f"))}function Wv(t,e){var n=da(t),i=t.svg_.selectAll(n).selectAll("[ecl]");i.style("fill","white"),i.filter("[ecl='"+e+"']").each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}function Hv(t){var e=da(t);t.svg_.selectAll(e).selectAll("[ecl]").each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}function Vv(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function $v(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Jv(t){return t<0?-t*t:t*t}function Yv(t){var e=t(Qe,Qe),n=1;return e.exponent=function(e){return arguments.length?1===(n=+e)?t(Qe,Qe):.5===n?t($v,Jv):t(Vv(n),Vv(1/n)):n},Mn(e)}function Xv(){var t=Yv(an());return t.copy=function(){return rn(t,Xv()).exponent(t.exponent())},Ht.apply(t,arguments),t}function Kv(){return Xv.apply(null,arguments).exponent(.5)}function Zv(t,e){let n,i;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=i=e):(n>e&&(n=e),i<e&&(i=e)));else{let r=-1;for(let a of t)null!=(a=e(a,++r,t))&&(void 0===n?a>=a&&(n=i=a):(n>a&&(n=a),i<a&&(i=a)))}return[n,i]}const Qv=Tn(new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(kn)),ty=(mr(3),{draw(t,e){const n=mr(e/yr);t.moveTo(n,0),t.arc(0,0,n,0,br)}}),ey={draw(t,e){const n=mr(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},ny=mr(1/3),iy=2*ny,ry={draw(t,e){const n=mr(e/iy),i=n*ny;t.moveTo(0,-n),t.lineTo(i,0),t.lineTo(0,n),t.lineTo(-i,0),t.closePath()}},ay={draw(t,e){const n=mr(e),i=-n/2;t.rect(i,i,n,n)}},oy=_r(yr/10)/_r(7*yr/10),sy=_r(br/10)*oy,ly=-pr(br/10)*oy,cy={draw(t,e){const n=mr(.8908130915292852*e),i=sy*n,r=ly*n;t.moveTo(0,-n),t.lineTo(i,r);for(let e=1;e<5;++e){const a=br*e/5,o=pr(a),s=_r(a);t.lineTo(s*n,-o*n),t.lineTo(o*i-s*r,s*i+o*r)}t.closePath()}},uy=mr(3),hy={draw(t,e){const n=-mr(e/(3*uy));t.moveTo(0,2*n),t.lineTo(-uy*n,-n),t.lineTo(uy*n,-n),t.closePath()}},fy=(mr(3),-.5),py=mr(3)/2,dy=1/mr(12),gy=3*(dy/2+1),_y={draw(t,e){const n=mr(e/gy),i=n/2,r=n*dy,a=i,o=n*dy+n,s=-a,l=o;t.moveTo(i,r),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(fy*i-py*r,py*i+fy*r),t.lineTo(fy*a-py*o,py*a+fy*o),t.lineTo(fy*s-py*l,py*s+fy*l),t.lineTo(fy*i+py*r,fy*r-py*i),t.lineTo(fy*a+py*o,fy*o-py*a),t.lineTo(fy*s+py*l,fy*l-py*s),t.closePath()}};function my(t,e){let n=null,i=Tr(r);function r(){let r;if(n||(n=r=i()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return t="function"==typeof t?t:ur(t||ty),e="function"==typeof e?e:ur(void 0===e?64:+e),r.type=function(e){return arguments.length?(t="function"==typeof e?e:ur(e),r):t},r.size=function(t){return arguments.length?(e="function"==typeof t?t:ur(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r}function vy(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(Array.isArray(e)){var n=t.svg().select("defs");n.empty()&&(n=t.svg().append("defs"));var i={};e.forEach((function(e){var r,a=e.pattern,o=void 0===a?"hatching":a,s=e.regionIds,l=void 0===s?[]:s,c=e.color,u=void 0===c?"#000":c,h=e.strokeWidth,f=void 0===h?1:h,p=e.customPattern,d=e.spacing;if(p){var g=p.match(/id=['"]([^'"]+)['"]/);if(!g)return void console.warn("customPattern must include an id attribute.");r=g[1],t.svg().select("#".concat(r)).empty()&&n.node().insertAdjacentHTML("beforeend",p)}else{var _=u.replace("#","").toLowerCase();r="".concat(o,"-").concat(_,"-sw").concat(f),function(t,e,n,i,r){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8,o=t.svg().select("defs");if(t.svg().select("#".concat(CSS.escape(e))).empty()){var s=o.append("pattern").attr("id",e).attr("patternUnits","userSpaceOnUse").attr("width",a).attr("height",a);"hatching"===n?s.append("path").attr("d","M-".concat(a/8,",").concat(a/8," l").concat(a/4,",-").concat(a/4," M0,").concat(a," l").concat(a,",-").concat(a," M").concat(a-a/8,",").concat(a+a/8," l").concat(a/4,",-").concat(a/4)).attr("stroke",i).attr("stroke-width",r):"crosshatch"===n?s.append("path").attr("d","M0,0 l".concat(a,",").concat(a," M").concat(a,",0 l-").concat(a,",").concat(a)).attr("stroke",i).attr("stroke-width",r):"dots"===n?s.append("circle").attr("cx",a/2).attr("cy",a/2).attr("r",r).attr("fill",i):(console.warn('Unknown pattern "'.concat(n,'", defaulting to hatching.')),s.append("path").attr("d","M-".concat(a/8,",").concat(a/8," l").concat(a/4,",-").concat(a/4," M0,").concat(a," l").concat(a,",-").concat(a," M").concat(a-a/8,",").concat(a+a/8," l").concat(a/4,",-").concat(a/4)).attr("stroke",i).attr("stroke-width",r))}}(t,r,o,u,f,d)}e.patternId=r,l.forEach((function(t){i[t]||(i[t]=[]),i[t].push(r)}))})),t.svg().selectAll(pa(t)).each((function(t){var e,n=this,r=null==t||null===(e=t.properties)||void 0===e?void 0:e.id,a=i[r];if(a&&a.length){var o=Ft(this);a.forEach((function(t){var e=o.node().cloneNode(!0);Ft(e).attr("fill","url(#".concat(t,")")).attr("pointer-events","none").attr("class",(o.attr("class")||"")+"pattern-fill-overlay"),Ft(n.parentNode).append((function(){return e}))}))}}))}else console.warn("patternFill expects an array of configs")}const yy=4294967296;var xy=Math.PI*(3-Math.sqrt(5));function by(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),a=0,o=.6,s=new Map,l=gi(h),c=ei("tick","end"),u=function(){let t=1;return()=>(t=(1664525*t+1013904223)%yy)/yy}();function h(){f(),c.call("tick",e),n<i&&(l.stop(),c.call("end",e))}function f(i){var l,c,u=t.length;void 0===i&&(i=1);for(var h=0;h<i;++h)for(n+=(a-n)*r,s.forEach((function(t){t(n)})),l=0;l<u;++l)null==(c=t[l]).fx?c.x+=c.vx*=o:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=o:(c.y=c.fy,c.vy=0);return e}function p(){for(var e,n=0,i=t.length;n<i;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var r=10*Math.sqrt(.5+n),a=n*xy;e.x=r*Math.cos(a),e.y=r*Math.sin(a)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function d(e){return e.initialize&&e.initialize(t,u),e}return null==t&&(t=[]),p(),e={tick:f,restart:function(){return l.restart(h),e},stop:function(){return l.stop(),e},nodes:function(n){return arguments.length?(t=n,p(),s.forEach(d),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(i=+t,e):i},alphaDecay:function(t){return arguments.length?(r=+t,e):+r},alphaTarget:function(t){return arguments.length?(a=+t,e):a},velocityDecay:function(t){return arguments.length?(o=1-t,e):1-o},randomSource:function(t){return arguments.length?(u=t,s.forEach(d),e):u},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,d(n)),e):s.get(t)},find:function(e,n,i){var r,a,o,s,l,c=0,u=t.length;for(null==i?i=1/0:i*=i,c=0;c<u;++c)(o=(r=e-(s=t[c]).x)*r+(a=n-s.y)*a)<i&&(l=s,i=o);return l},on:function(t,n){return arguments.length>1?(c.on(t,n),e):c.on(t)}}}function wy(t){return function(){return t}}function Sy(t){var e,n,i,r=wy(.1);function a(t){for(var r,a=0,o=e.length;a<o;++a)(r=e[a]).vx+=(i[a]-r.x)*n[a]*t}function o(){if(e){var a,o=e.length;for(n=new Array(o),i=new Array(o),a=0;a<o;++a)n[a]=isNaN(i[a]=+t(e[a],a,e))?0:+r(e[a],a,e)}}return"function"!=typeof t&&(t=wy(null==t?0:+t)),a.initialize=function(t){e=t,o()},a.strength=function(t){return arguments.length?(r="function"==typeof t?t:wy(+t),o(),a):r},a.x=function(e){return arguments.length?(t="function"==typeof e?e:wy(+e),o(),a):t},a}function My(t){var e,n,i,r=wy(.1);function a(t){for(var r,a=0,o=e.length;a<o;++a)(r=e[a]).vy+=(i[a]-r.y)*n[a]*t}function o(){if(e){var a,o=e.length;for(n=new Array(o),i=new Array(o),a=0;a<o;++a)n[a]=isNaN(i[a]=+t(e[a],a,e))?0:+r(e[a],a,e)}}return"function"!=typeof t&&(t=wy(null==t?0:+t)),a.initialize=function(t){e=t,o()},a.strength=function(t){return arguments.length?(r="function"==typeof t?t:wy(+t),o(),a):r},a.y=function(e){return arguments.length?(t="function"==typeof e?e:wy(+e),o(),a):t},a}function Ey(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,a,o,s,l,c,u,h,f,p=t._root,d={data:i},g=t._x0,_=t._y0,m=t._x1,v=t._y1;if(!p)return t._root=d,t;for(;p.length;)if((c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(_+v)/2))?_=o:v=o,r=p,!(p=p[h=u<<1|c]))return r[h]=d,t;if(s=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===s&&n===l)return d.next=p,r?r[h]=d:t._root=d,t;do{r=r?r[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(_+v)/2))?_=o:v=o}while((h=u<<1|c)==(f=(l>=o)<<1|s>=a));return r[f]=p,r[h]=d,t}function Cy(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function Ay(t){return t[0]}function ky(t){return t[1]}function Ty(t,e,n){var i=new Py(null==e?Ay:e,null==n?ky:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function Py(t,e,n,i,r,a){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=a,this._root=void 0}function Ny(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Ly=Ty.prototype=Py.prototype;function Fy(t){return 1e-6*(t()-.5)}function Oy(t){return t.x+t.vx}function Gy(t){return t.y+t.vy}function Dy(t){var e,n,i,r=1,a=1;function o(){for(var t,o,l,c,u,h,f,p=e.length,d=0;d<a;++d)for(o=Ty(e,Oy,Gy).visitAfter(s),t=0;t<p;++t)l=e[t],h=n[l.index],f=h*h,c=l.x+l.vx,u=l.y+l.vy,o.visit(g);function g(t,e,n,a,o){var s=t.data,p=t.r,d=h+p;if(!s)return e>c+d||a<c-d||n>u+d||o<u-d;if(s.index>l.index){var g=c-s.x-s.vx,_=u-s.y-s.vy,m=g*g+_*_;m<d*d&&(0===g&&(m+=(g=Fy(i))*g),0===_&&(m+=(_=Fy(i))*_),m=(d-(m=Math.sqrt(m)))/m*r,l.vx+=(g*=m)*(d=(p*=p)/(f+p)),l.vy+=(_*=m)*d,s.vx-=g*(d=1-d),s.vy-=_*d)}}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function l(){if(e){var i,r,a=e.length;for(n=new Array(a),i=0;i<a;++i)r=e[i],n[r.index]=+t(r,i,e)}}return"function"!=typeof t&&(t=wy(null==t?1:+t)),o.initialize=function(t,n){e=t,i=n,l()},o.iterations=function(t){return arguments.length?(a=+t,o):a},o.strength=function(t){return arguments.length?(r=+t,o):r},o.radius=function(e){return arguments.length?(t="function"==typeof e?e:wy(+e),l(),o):t},o}function zy(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Iy(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ry(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ry(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Ry(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function jy(t,e){var i=function(i){var r,a,o,s,l,c=i.Geometries.centroidsFeatures||[];if(c.length){qy(i);var u,h=null!==(r=null===(a=i.dorlingStrength_)||void 0===a?void 0:a.x)&&void 0!==r?r:1,f=null!==(o=null===(s=i.dorlingStrength_)||void 0===s?void 0:s.y)&&void 0!==o?o:1,p=null!==(l=i.dorlingIterations_)&&void 0!==l?l:1,d=!1!==i.dorlingWorker_,g=i.dorlingWorkerD3URL_||"https://unpkg.com/d3@7/dist/d3.min.js",_=Iy(c);try{for(_.s();!(u=_.n()).done;){var m,v=u.value,y=null===(m=i._projection)||void 0===m?void 0:m.call(i,v.geometry.coordinates);y?(v.x=y[0],v.y=y[1]):(v.x=NaN,v.y=NaN)}}catch(t){_.e(t)}finally{_.f()}var x=t.getCentroidsGroup(i).selectAll("g.em-centroid"),b=function(t){t.attr("transform",(function(t){return!t||isNaN(t.x)||isNaN(t.y)?null:"translate(".concat(t.x,",").concat(t.y,")")}))};if(!1===i.animateDorling_){if(d){console.log("Running Dorling simulation asynchronously in a Web Worker");var w=new Worker(new URL(n.p+n.u(222),n.b),{type:void 0});return w.postMessage({nodes:c.map((function(t){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?zy(Object(n),!0).forEach((function(e){ma(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zy(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t)})),radii:c.map((function(t){return e(t)})),strengthX:h,strengthY:f,iterations:p,d3URL:g}),void(w.onmessage=function(t){var e=t.data,n=e.type,r=e.nodes,a=e.progress,o=e.total;"progress"!==n?"end"===n&&r&&(c.forEach((function(t,e){t.x=r[e].x,t.y=r[e].y})),b(x),By(1,i),w.terminate()):By(a/o,i)})}for(var S=by(c).force("x",Sy((function(t){return t.properties.centroid[0]})).strength(h)).force("y",My((function(t){return t.properties.centroid[1]})).strength(f)).force("collide",Dy((function(t){return e(t)})).iterations(p)).stop(),M=Math.ceil(Math.log(S.alphaMin())/Math.log(1-S.alphaDecay())),E=0;E<M;E++)S.tick(),E%10==0&&b(x);return b(x),By(1,i),S}return i.simulation=by(c).force("x",Sy((function(t){return t.properties.centroid[0]})).strength(h)).force("y",My((function(t){return t.properties.centroid[1]})).strength(f)).force("collide",Dy((function(t){return e(t)})).iterations(p)).on("tick",(function(){return b(x)})),i.simulation}};i(t),t.insetTemplates_&&ua(t.insetTemplates_,t.svgId_,(function(t){i(t)}))}function By(t,e){e.onDorlingProgress_&&e.onDorlingProgress_(t,e)}function qy(t){t.simulation&&(t.simulation.stop(),t.simulation.on("tick",null),t.simulation=null)}Ly.copy=function(){var t,e,n=new Py(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=Ny(i),n;for(t=[{source:i,target:n._root=new Array(4)}];i=t.pop();)for(var r=0;r<4;++r)(e=i.source[r])&&(e.length?t.push({source:e,target:i.target[r]=new Array(4)}):i.target[r]=Ny(e));return n},Ly.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return Ey(this.cover(e,n),e,n,t)},Ly.addAll=function(t){var e,n,i,r,a=t.length,o=new Array(a),s=new Array(a),l=1/0,c=1/0,u=-1/0,h=-1/0;for(n=0;n<a;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(r=+this._y.call(null,e))||(o[n]=i,s[n]=r,i<l&&(l=i),i>u&&(u=i),r<c&&(c=r),r>h&&(h=r));if(l>u||c>h)return this;for(this.cover(l,c).cover(u,h),n=0;n<a;++n)Ey(this,o[n],s[n],t[n]);return this},Ly.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,a=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,a=(i=Math.floor(e))+1;else{for(var o,s,l=r-n||1,c=this._root;n>t||t>=r||i>e||e>=a;)switch(s=(e<i)<<1|t<n,(o=new Array(4))[s]=c,c=o,l*=2,s){case 0:r=n+l,a=i+l;break;case 1:n=r-l,a=i+l;break;case 2:r=n+l,i=a-l;break;case 3:n=r-l,i=a-l}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=i,this._x1=r,this._y1=a,this},Ly.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},Ly.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},Ly.find=function(t,e,n){var i,r,a,o,s,l,c,u=this._x0,h=this._y0,f=this._x1,p=this._y1,d=[],g=this._root;for(g&&d.push(new Cy(g,u,h,f,p)),null==n?n=1/0:(u=t-n,h=e-n,f=t+n,p=e+n,n*=n);l=d.pop();)if(!(!(g=l.node)||(r=l.x0)>f||(a=l.y0)>p||(o=l.x1)<u||(s=l.y1)<h))if(g.length){var _=(r+o)/2,m=(a+s)/2;d.push(new Cy(g[3],_,m,o,s),new Cy(g[2],r,m,_,s),new Cy(g[1],_,a,o,m),new Cy(g[0],r,a,_,m)),(c=(e>=m)<<1|t>=_)&&(l=d[d.length-1],d[d.length-1]=d[d.length-1-c],d[d.length-1-c]=l)}else{var v=t-+this._x.call(null,g.data),y=e-+this._y.call(null,g.data),x=v*v+y*y;if(x<n){var b=Math.sqrt(n=x);u=t-b,h=e-b,f=t+b,p=e+b,i=g.data}}return i},Ly.remove=function(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,n,i,r,a,o,s,l,c,u,h,f,p=this._root,d=this._x0,g=this._y0,_=this._x1,m=this._y1;if(!p)return this;if(p.length)for(;;){if((c=a>=(s=(d+_)/2))?d=s:_=s,(u=o>=(l=(g+m)/2))?g=l:m=l,e=p,!(p=p[h=u<<1|c]))return this;if(!p.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(n=e,f=h)}for(;p.data!==t;)if(i=p,!(p=p.next))return this;return(r=p.next)&&delete p.next,i?(r?i.next=r:delete i.next,this):e?(r?e[h]=r:delete e[h],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(n?n[f]=p:this._root=p),this):(this._root=r,this)},Ly.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},Ly.root=function(){return this._root},Ly.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},Ly.visit=function(t){var e,n,i,r,a,o,s=[],l=this._root;for(l&&s.push(new Cy(l,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(l=e.node,i=e.x0,r=e.y0,a=e.x1,o=e.y1)&&l.length){var c=(i+a)/2,u=(r+o)/2;(n=l[3])&&s.push(new Cy(n,c,u,a,o)),(n=l[2])&&s.push(new Cy(n,i,u,c,o)),(n=l[1])&&s.push(new Cy(n,c,r,a,u)),(n=l[0])&&s.push(new Cy(n,i,r,c,u))}return this},Ly.visitAfter=function(t){var e,n=[],i=[];for(this._root&&n.push(new Cy(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var r=e.node;if(r.length){var a,o=e.x0,s=e.y0,l=e.x1,c=e.y1,u=(o+l)/2,h=(s+c)/2;(a=r[0])&&n.push(new Cy(a,o,s,u,h)),(a=r[1])&&n.push(new Cy(a,u,s,l,h)),(a=r[2])&&n.push(new Cy(a,o,h,u,c)),(a=r[3])&&n.push(new Cy(a,u,h,l,c))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},Ly.x=function(t){return arguments.length?(this._x=t,this):this._x},Ly.y=function(t){return arguments.length?(this._y=t,this):this._y};var Uy=function(t){var e=sx(t,!0,"ps");function n(t){if(t.svg_&&e.classifierColor_){var n=t.statData("color");t.svg_.selectAll(".em-centroid").attr("ecl",(function(t){var i=n.get(t.properties.id);if(!i)return"nd";var r=i.value;return 0!==r&&!r||":"==r?"nd":+e.classifierColor_(+r)}))}}function i(t){return t.statData("size").getArray()?t.statData("size"):t.statData()}function r(t){e.psClassToFillStyle()||e.psClassToFillStyle(Wy(e.psColorFun_,e.psColors_));var n=i(t);if(t.svg_){var r,s;t.svg_.selectAll(":not(#em-insets-group) g.em-centroid > *").remove(),e.updateSymbolsDrawOrder(t),s=e.psCustomSVG_?function(t,n){return t.getCentroidsGroup(t).selectAll("g.em-centroid").append("g").filter((function(t){var e=n.get(t.properties.id);if(e&&":"!==e.value)return t})).attr("class","ps").html(e.psCustomSVG_).attr("transform",(function(t){var i=n.get(t.properties.id),r=e.classifierSize_(+i.value);if(r)return"translate(".concat(e.psOffset_.x*r,",").concat(e.psOffset_.y*r,") scale(").concat(r,")")}))}(t,n):"bar"==e.psShape_?function(t,n){return t.getCentroidsGroup(t).selectAll("g.em-centroid").append("rect").filter((function(t){var e=n.get(t.properties.id);if(e&&":"!==e.value)return t})).attr("width",e.psBarWidth_).attr("height",(function(t){var i=n.get(t.properties.id);return i&&i.value?e.classifierSize_(+i.value):0})).attr("transform",(function(){this.getBoundingClientRect();return"translate(".concat(-this.getAttribute("width")/2)+", -".concat(this.getAttribute("height"),")")}))}(t,n):"circle"==e.psShape_?function(t,n){var i=t.svg().selectAll("g.em-centroid").filter((function(t){var e=n.get(t.properties.id);return e&&":"!==e.value&&e.value})).append("circle").attr("stroke-width",e.psStrokeWidth()).attr("stroke",e.psStroke()).attr("fill-opacity",e.psFillOpacity()).attr("stroke-opacity",e.psStrokeOpacity()).style("pointer-events","none").transition().duration(e.transitionDuration()).attr("r",(function(t){var i=n.get(t.properties.id),r=e.classifierSize_(+i.value);return r<0&&console.error("Negative radius for circle:",t.properties.id),isNaN(r)&&console.error("NaN radius for circle:",t.properties.id),r})).on("end",(function(){Ft(this).style("pointer-events",null)}));return i}(t,n):"spike"==e.psShape_?function(t,n){var i=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.psSpikeWidth_;return"M".concat(-n/2,",0L0,").concat(-t,"L").concat(n/2,",0")},r=t.svg().selectAll("g.em-centroid"),a=r.append("path").attr("d",(function(t){var r=n.get(t.properties.id),a=r?e.classifierSize_(+r.value):0;return i(a)})).style("fill",(function(t){return t.color||"steelblue"})).attr("fill-opacity",t.psFillOpacity_).attr("stroke",t.psStroke_).attr("stroke-width",t.psStrokeWidth_);return a}(t,n):function(t,n){return t.svg().selectAll("g.em-centroid").append("path").filter((function(t){var e=n.get(t.properties.id);if(e&&":"!==e.value)return t})).attr("class","ps").attr("d",(function(t){if(n){var i=n.get(t.properties.id);if(0==i||i){var r=e.classifierSize_(+i.value)||0;if(e.psCustomShape_)return e.psCustomShape_.size(r*r)();var a=Hy[e.psShape_]||Hy.circle;return my().type(a).size(r*r)()}}}))}(t,n);var l=pa(t),c=t.svg().selectAll(l);if("WORLD"!==t.geo_){if("mixed"==t.nutsLevel_){!function(t,n,i){i.style("display",(function(e){if(!this.parentNode.classList.contains("em-cntrg")){var i=n.get(e.properties.id);return!i||!i.value&&0!==i&&0!==i.value?"none":"WORLD"==t.geo_?"block":void 0}})),i.style("stroke",(function(t){var e=Ft(this),i=e.attr("lvl"),r=e.style("stroke"),a=n.get(t.properties.id);if(a&&a.value)return"0"!==i?r||"#777":void 0})).style("stroke-width",(function(t){var i=Ft(this),r=i.attr("lvl"),a=i.style("stroke-width"),o=n.get(t.properties.id);if(o&&o.value)return"WORLD"==e.geo_&&"0"!==r?a||"#777":void 0}))}(t,n,c);var u=[];t.svg().selectAll("g.em-centroid").each((function(t){var e;null!==(e=t.properties)&&void 0!==e&&e.centroid&&u.push(t)})),t.Geometries.centroidsFeatures=u}c.attr("ecl",(function(t){var e=n.get(t.properties.id);return!e||!e.value&&0!==e&&0!==e.value?"ni":e&&e.value&&":"==e.value?"nd":void 0}))}!function(t){t.attr("fill-opacity",e.psFillOpacity()).attr("stroke-opacity",e.psStrokeOpacity()).attr("stroke",e.psStroke()).attr("stroke-width",e.psStrokeWidth()).style("fill",(function(){if(e.classifierColor_){var t=Ft(this.parentNode).attr("ecl");return t&&"nd"!==t?e.psClassToFillStyle_(t,e.psClasses_):e.noDataFillStyle_||"gray"}return e.psFill_})).attr("fill___",(function(){return Ft(this).style("fill")}))}(s),a(t,n),o(t),null!==(r=e.labels_)&&void 0!==r&&r.values&&e.updateValuesLabels(t),e.patternFill_&&vy(t,e.patternFill_)}return t}e.psShape_="circle",e.psCustomShape_,e.psCustomSVG_,e.psSpikeWidth_=7,e.psOffset_={x:0,y:0},e.psMaxSize_=30,e.psMinSize_=5,e.psBarWidth_=10,e.psMaxValue_=void 0,e.psMinValue_=void 0,e.psSizeScale_=void 0,e.psFill_="#2d50a0",e.psFillOpacity_=1,e.psStroke_="#ffffff",e.psStrokeWidth_=.2,e.psStrokeOpacity_=1,e.psClasses_=5,e.psColors_=null,e.psColorFun_=Qv,e.psClassToFillStyle_=void 0,e.psThresholds_=[0],e.psClassificationMethod_="quantile",e.makeClassifNice_=!0,e.classifierSize_=void 0,e.classifierColor_=void 0,e.tooltip_.textFunction=Vy,e.psCodeLabels_=!1,["psMaxSize_","psMinSize_","psMaxValue_","psMinValue_","psFill_","psFillOpacity_","psStrokeOpacity_","psStroke_","psStrokeWidth_","classifierSize_","classifierColor_","psShape_","psCustomShape_","psBarWidth_","psClassToFillStyle_","psColorFun_","psSizeScale_","noDataFillStyle_","psThresholds_","psColors_","psCustomSVG_","psOffset_","psClassificationMethod_","psClasses_","dorling_","dorlingStrength_","dorlingIterations_","animateDorling_","psSpikeWidth_","psCodeLabels_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),t&&["psMaxSize","psMinSize","psFill","psFillOpacity","psStroke","psStrokeWidth","classifierSize","classifierColor","psShape","psCustomShape","psBarWidth","psClassToFillStyle","psColorFun","noDataFillStyle","psThreshold","psColors","psCustomSVG","psOffset","psClassificationMethod","psClasses","dorlingIterations_"].forEach((function(n){null!=t[n]&&e[n](t[n])})),e.psColorFun=function(t){return arguments.length?(e.psColorFun_=t,e.psClassToFillStyle_=Wy(e.psColorFun_,e.psColors_),e):e.psColorFun_},e.psThresholds=function(t){return arguments.length?(e.psThresholds_=t,e.psClasses(t.length+1),e):e.psThresholds_},e.updateClassification=function(){try{return function(){var t,n;e.psSizeScale_||("spike"==e.psShape_?e.psSizeScale_="linear":e.psSizeScale_="sqrt");var i=(e.statData("size").getArray()||e.statData().getArray()).map((function(t){return+t})).filter((function(t){return isFinite(t)&&t>0})),r=Zv(i),a=v(r,2),o=a[0],s=a[1],l=null!==(t=e.psMinValue_)&&void 0!==t?t:o,c=null!==(n=e.psMaxValue_)&&void 0!==n?n:s;isFinite(l)&&isFinite(c)||(l=e.statData().getMin(),c=e.statData().getMax());var u=[l,c],h="sqrt"==e.psSizeScale_?Kv:En;e.classifierSize(h().domain(u).range([e.psMinSize_,e.psMaxSize_]))}(),e.statData("color").getArray()&&function(){var t=function(t){return y(Array(t).keys())};if("quantile"===e.psClassificationMethod_){var n=e.statData("color").getArray(),i=t(e.psClasses_);e.classifierColor(Vt().domain(n).range(i))}else if("equinter"===e.psClassificationMethod_){var r=e.statData("color").getArray(),a=t(e.psClasses_);e.classifierColor(Cn().domain([min(r),max(r)]).range(a)),e.makeClassifNice_&&e.classifierColor().nice()}else if("threshold"===e.psClassificationMethod_){e.psClasses(e.psThresholds().length+1);var o=t(e.psClasses_);e.classifierColor(An().domain(e.psThresholds()).range(o))}}(),e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,n),n(e),e}catch(t){console.error("Error in proportional symbols classification: "+t.message),console.error(t)}};var a=function(t,n){var i,r=t.svg().selectAll("g.em-centroid");if(e.psCodeLabels_)r.filter((function(t){var e=n.get(t.properties.id);return":"!==(null==e?void 0:e.value)&&null!=(null==e?void 0:e.value)})).append("text").attr("class","em-circle-code-label").text((function(t){var e=n.get(t.properties.id);return":"===(null==e?void 0:e.value)?"":t.properties.id})).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","sans-serif").style("font-size",(function(t){var i,r,a=n.get(t.properties.id),o=a?e.classifierSize_(+a.value):0,s=null!==(i=e.labels_)&&void 0!==i&&i.values&&null!==(r=n.get(t.properties.id))&&void 0!==r&&r.value?.8:.9;return"square"===e.psShape_&&(s-=.4),"".concat(o*s,"px")})).attr("fill",(function(){var t,e=null===(t=window.getComputedStyle(this.parentNode.firstChild))||void 0===t?void 0:t.fill;return fa(e)})).attr("dy",(function(t){var i,r;return null!==(i=e.labels_)&&void 0!==i&&i.values&&null!==(r=n.get(t.properties.id))&&void 0!==r&&r.value?"-0.3em":"0"}));if(null!==(i=e.labels_)&&void 0!==i&&i.values)r.filter((function(t){var e=n.get(t.properties.id);return":"!==(null==e?void 0:e.value)&&null!=(null==e?void 0:e.value)})).append("text").attr("class","em-circle-stat-label").text((function(t){var e=n.get(t.properties.id);if(null!=e&&e.value)return e.value})).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","sans-serif").style("font-size",(function(t){var i=n.get(t.properties.id),r=i?e.classifierSize_(+i.value):0;return"".concat(.4*r,"px")})).attr("fill",(function(){var t,n=(null===(t=window.getComputedStyle(this.parentNode.firstChild))||void 0===t?void 0:t.fill)||e.psFill_;return fa(n)})).attr("dy",(function(t){return e.psCodeLabels_?"0.8em":"0"}))},o=function(t){t.svg().selectAll("g.em-centroid").on("mouseover",(function(n,i){var r=Ft(this.childNodes[0]);r.attr("fill___",r.style("fill")),r.style("fill",e.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(i,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,i,this,t)})).on("mousemove",(function(n,i){e._tooltip&&e._tooltip.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,i,this,t)})).on("mouseout",(function(n,i){var r=Ft(this.childNodes[0]),a=r.attr("fill___");a&&(r.style("fill",a),e._tooltip&&e._tooltip.mouseout()),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,i,this,t)}))};return e.updateSymbolsDrawOrder=function(t){var r=e.getCentroidsGroup(t),a=i(t);t.Geometries.centroidsFeatures&&t.Geometries.centroidsFeatures.length||(t.Geometries.centroidsFeatures=t.svg().selectAll("g.em-centroid").data().filter((function(t){var e;return null==t||null===(e=t.properties)||void 0===e?void 0:e.centroid})));var o=t.Geometries.centroidsFeatures.filter((function(t){var e,n=null===(e=a.get)||void 0===e||null===(e=e.call(a,t.properties.id))||void 0===e?void 0:e.value;return null!=n&&":"!==n})).sort((function(t,e){return a.get(e.properties.id).value-a.get(t.properties.id).value}));r.selectAll("g.em-centroid").remove(),r.selectAll("g.em-centroid").data(o,(function(t){return t.properties.id})).enter().append("g").attr("class","em-centroid").attr("id",(function(t){return"ps"+t.properties.id})).attr("transform",(function(t){return"translate(".concat(t.properties.centroid[0].toFixed(3),",").concat(t.properties.centroid[1].toFixed(3),")")})),n(t)},e.updateStyle=function(){try{if(r(e),e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,r),e.dorling_){var t=i(e);jy(e,(function(n){var i=t.get(n.properties.id),r=i?e.classifierSize_(+i.value):0;return"square"===e.psShape_?r/2*Math.SQRT2:r}))}else qy(e);return e}catch(t){console.error("Error in proportional symbols styling: "+t.message),console.error(t)}},e.getLegendConstructor=function(){return ex},e},Wy=function(t,e){return t=t||Qv,e?function(t,n){return e[t]}:function(e,n){return t(e/(n-1))}},Hy={cross:ey,square:ay,diamond:ry,triangle:hy,star:cy,wye:_y,circle:ty},Vy=function(t,e){var n;if(e.tooltip_.omitRegions&&e.tooltip_.omitRegions.includes(t.properties.id))return"";var i=t.properties.na,r=t.properties.id,a=e.statData("size").getArray()?e.statData("size"):e.statData(),o=a.get(t.properties.id),s=o&&(0===o.value||!!o.value),l=s?a.unitText():null,c="<tr><td>".concat(s?la(o.value)+" "+(l||""):e.noDataText_,"</td></tr>"),u="",h=null!==(n=e.statData("color"))&&void 0!==n&&n.getArray()?e.statData("color"):null;if(h){var f=h.get(t.properties.id),p=f&&(0===f.value||!!f.value),d=p?h.unitText():null;u="<tr><td>".concat(p?la(f.value)+" "+(d||""):e.noDataText_,"</td></tr>")}return'\n <div class="em-tooltip-bar">\n <b>'.concat(i,"</b>").concat(r?" (".concat(r,")"):"",'\n </div>\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n ').concat(c,"\n ").concat(u,"\n </tbody>\n </table>\n </div>\n ").trim()};function $y(t,e,n,i,r){var a,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:16;if(r){var s=ra("em-size-legend-title");o+=s,e.append("text").attr("class","em-size-legend-title").attr("id","em-size-legend-title").attr("x",0).attr("y",s).text(r)}var l=i.domain();n||(n=[Math.floor(l[1]),Math.floor(l[0])]);var c=i(Gt(n)),u=c,h=2*c+o,f=e.append("g").attr("transform","translate(".concat(u,",").concat(h,")")).attr("class","em-circle-size-legend").attr("id","em-circle-size-legend").attr("text-anchor","right").style("fill","black").selectAll("g").data(n.filter((function(t){return i(t)}))).join("g").attr("class","em-legend-item");f.append("circle").attr("class","em-legend-circle").style("fill","none").attr("stroke","black").attr("cy",(function(t){return-i(t)})).attr("r",i);var p=(null===(a=t.sizeLegend)||void 0===a?void 0:a.labelFormatter)||la;return f.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("y",(function(t,e){return-1-2*i(t)})).attr("x",c+5).text((function(t){return p(t)})),f.append("line").style("stroke-dasharray",2).style("stroke","grey").attr("x1",2).attr("y1",(function(t,e){return-1-2*i(t)})).attr("x2",c+5).attr("y2",(function(t,e){return-1-2*i(t)})),t}function Jy(t,e,n){var i,r=t.map;if(t._sizeLegendContainer=t.lgg.append("g").attr("class","em-size-legend-container").attr("id","em-size-legend-container").attr("transform","translate(".concat(e,",").concat(n,")")),r.psCustomSVG_||"circle"!=r.psShape_)if("spike"!=r.psShape_){var a=(null===(i=t.sizeLegend)||void 0===i?void 0:i.labelFormatter)||la,o=r.classifierSize_.domain()[1];t.sizeLegend.values&&(t.sizeLegend.cellNb=t.sizeLegend.values.length),r.customSymbols={nodeHeights:0};for(var s=1;s<t.sizeLegend.cellNb+1;s++){var l=t.ascending?t.sizeLegend.cellNb-s+1:s,c=t.sizeLegend.values?t.sizeLegend.values[l-1]:o/l,u=r.classifierSize_(c);"bar"==r.psShape_?Ky(t,c,u,s,a):"custom"==r.psShape_||r.psCustomSVG_?Xy(t,c,u,s,a):Yy(t,c,u,s,a)}if(t.sizeLegend.noData){var h=t._sizeLegendContainer.node().getBBox().height,f=t._sizeLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(0,",").concat(h,")"));t.appendNoDataLegend(f,t.sizeLegend.noDataText,Qy,tx)}}else!function(t){var e=t.map,n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.psSpikeWidth_;return"M".concat(-n/2,",0L0,").concat(-t,"L").concat(n/2,",0")},i=e.classifierSize_(e.classifierSize_.domain()[1]),r=t.sizeLegend.values||e.classifierSize_.ticks(4).slice(1),a=ra("em-legend-label"),o=a-2,s=t._sizeLegendContainer.append("g").attr("id","em-spike-legend").attr("transform","translate(".concat(t.boxPadding,",").concat(t.sizeLegend.titlePadding,")")).attr("fill","black").attr("text-anchor","middle").style("font-size","".concat(a,"px")).selectAll().data(r).join("g").attr("transform",(function(e,n){return"translate(".concat(40*n+t.boxPadding,",").concat(i+5,")")}));if(s.append("path").attr("fill",e.psFill_).attr("fill-opacity",e.psFillOpacity_).attr("stroke",e.psStroke_).attr("stroke-width",e.psStrokeWidth_).attr("d",(function(t){return n(e.classifierSize_(t))})),s.append("text").attr("class","em-legend-label").attr("dy",o).text((function(t){return e.classifierSize_.tickFormat(4,"s")(t)})),t.sizeLegend.noData){var l=i+o+a+5,c=t.boxPadding,u=t._sizeLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(c,",").concat(l,")"));t.appendNoDataLegend(u,t.sizeLegend.noDataText,Qy,tx)}}(t);else if($y(t,t._sizeLegendContainer,t.sizeLegend.values,r.classifierSize_,t.sizeLegend.title,t.sizeLegend.titlePadding),t.sizeLegend.noData){var p=t._sizeLegendContainer.node().getBBox().height+15,d=t._sizeLegendContainer.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(0,",").concat(p,")"));t.appendNoDataLegend(d,t.sizeLegend.noDataText,Qy,tx)}}function Yy(t,e,n,i,r){var a=t.map,o="triangle"==a.psShape_||"diamond"==a.psShape_?n:n/2;0==t.sizeLegend._totalD3SymbolsHeight&&(t.sizeLegend._totalD3SymbolsHeight+=o+t.boxPadding);var s=a.classifierSize_(a.classifierSize_.domain()[1]),l=s,c=(t.sizeLegend.title?t.titleFontSize+t.sizeLegend.titlePadding:0)+t.sizeLegend._totalD3SymbolsHeight+(t.sizeLegend.shapePadding*i-1);t.sizeLegend._totalD3SymbolsHeight+=n;var u=t._sizeLegendContainer.append("g").attr("transform","translate(".concat(l,",").concat(c,")")).attr("class","em-size-legend-item"),h=Zy(t).size(n*n)();u.append("g").style("fill",(function(e){return a.classifierColor_?t.sizeLegend.shapeFill:a.psFill_})).style("fill-opacity",a.psFillOpacity()).style("stroke",t.sizeLegend.shapeStroke?t.sizeLegend.shapeStroke:a.psStroke()).style("stroke-width",a.psStrokeWidth()).append("path").attr("d",h).attr("transform",(function(){return"translate(".concat(t.sizeLegend.shapeOffsets.x,",").concat(t.sizeLegend.shapeOffsets.y,")")}));var f=s/2+t.sizeLegend.labelOffsets.x+t.boxPadding;u.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("x",f).attr("y",0).text(r(e))}function Xy(t,e,n,i,r){var a,o=t.map,s=t.boxPadding;if(o.customSymbols.prevSymb||(a=t.boxPadding+(t.sizeLegend.title?t.titleFontSize+t.sizeLegend.titlePadding:0)+20,o.customSymbols.initialTranslateY=a,o.customSymbols.prevScale=n),o.customSymbols.prevSymb){var l=o.customSymbols.prevSymb.node().getBBox();o.customSymbols.nodeHeights=o.customSymbols.nodeHeights+l.height*o.customSymbols.prevScale,a=o.customSymbols.initialTranslateY+o.customSymbols.nodeHeights+t.sizeLegend.shapePadding*(i-1),o.customSymbols.prevScale=n}var c=t._sizeLegendContainer.append("g").attr("transform","translate(".concat(s,",").concat(a,")")).attr("class","em-size-legend-item");o.customSymbols.prevSymb=c.append("g").attr("class","em-size-legend-symbol").style("fill",(function(e){return o.classifierColor_?t.sizeLegend.shapeFill:o.psFill_})).style("fill-opacity",o.psFillOpacity()).style("stroke",t.sizeLegend.shapeStroke?t.sizeLegend.shapeStroke:o.psStroke()).style("stroke-width",o.psStrokeWidth()).attr("stroke","black").attr("stroke-width",.5).append("g").html(o.psCustomSVG_).attr("transform",(function(){return o.psCustomSVG_?"translate(".concat(t.sizeLegend.shapeOffsets.x,",").concat(t.sizeLegend.shapeOffsets.y,") scale(").concat(n,")"):"translate(".concat(t.sizeLegend.shapeOffsets.x,",").concat(t.sizeLegend.shapeOffsets.y,")")}));var u=s+o.classifierSize_(o.classifierSize_.domain()[0])+t.sizeLegend.labelOffsets.x,h=t.sizeLegend.shapeOffsets.y/2+1;c.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("x",u).attr("y",h).text(r(e))}function Ky(t,e,n,i,r){var a=t.map,o=t.boxPadding,s=t.boxPadding+(t.sizeLegend.title?t.titleFontSize+t.sizeLegend.titlePadding:0)+t.sizeLegend._totalBarsHeight+10;t.sizeLegend._totalBarsHeight+=n+10;var l=Zy(t).size(n*n)(),c=t._sizeLegendContainer.append("g").attr("transform","translate(".concat(o,",").concat(s,")")).attr("class","em-size-legend-item");c.append("g").style("fill",(function(e){return a.classifierColor_?t.sizeLegend.shapeFill:a.psFill_})).style("fill-opacity",a.psFillOpacity()).style("stroke",t.sizeLegend.shapeStroke?t.sizeLegend.shapeStroke:a.psStroke()).style("stroke-width",a.psStrokeWidth()).attr("stroke","black").attr("stroke-width",.5).append("path").attr("d",l).attr("transform",(function(){return a.psCustomSVG_?"translate(".concat(t.sizeLegend.shapeOffsets.x,",").concat(t.sizeLegend.shapeOffsets.y,") scale(").concat(n,")"):"translate(".concat(t.sizeLegend.shapeOffsets.x,",").concat(t.sizeLegend.shapeOffsets.y,")")}));var u=o+a.psBarWidth_+t.sizeLegend.labelOffsets.x,h=n/2+t.sizeLegend.labelOffsets.y;c.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("x",u).attr("y",h).text(r(e))}function Zy(t){var e,n=t.map;if(n.psCustomSVG_)e=n.psCustomSVG_;else if(n.psCustomShape_)e=n.psCustomShape_;else if("bar"==n.psShape_){e=my().type({draw:function(t,e){var i=Math.sqrt(e);t.moveTo(0,0),t.lineTo(0,i),t.lineTo(n.psBarWidth_,i),t.lineTo(n.psBarWidth_,0),t.lineTo(0,0),t.closePath()}})}else{var i=Hy[n.psShape_]||Hy.circle;e=my().type(i)}return e}function Qy(t,e){var n=t.getCentroidsGroup(t).selectAll("[ecl]");n.each((function(t,e){Ft(this).style("opacity","0")})),n.filter("[ecl='"+e+"']").each((function(e,n){Ft(this).style("opacity",t.psFillOpacity_)}))}function tx(t){t.getCentroidsGroup(t).selectAll("[ecl]").each((function(e,n){Ft(this).style("opacity",t.psFillOpacity_)}))}var ex=function(t,e){var n=ax(t);if(n.sizeLegend={title:null,titlePadding:15,values:void 0,cellNb:3,shapePadding:5,shapeOffsets:{x:0,y:0},shapeFill:"white",shapeStroke:null,labelOffsets:{x:10,y:0},decimals:0,labelFormatter:void 0,noData:!1,noDataText:"No data",_totalBarsHeight:0,_totalD3SymbolsHeight:0},n.colorLegend={title:null,titlePadding:10,marginTop:30,shapeWidth:25,shapeHeight:20,shapePadding:1,labelOffsets:{x:5,y:0},decimals:0,labelFormatter:void 0,labelType:"thresholds",labels:null,noData:!0,noDataText:"No data",sepLineLength:24,sepLineStroke:"black",sepLineStrokeWidth:1,tickLength:5,pointOfDivergenceLabel:void 0,pointOfDivergence:void 0,pointOfDivergencePadding:7,divergingLineLength:void 0,divergingArrowLength:void 0},e)for(var i in e)if("colorLegend"==i||"sizeLegend"==i){for(var r in n[i])void 0!==e[i][r]&&(n[i][r]=e[i][r]);0==e.colorLegend&&(n.colorLegend=!1)}else n[i]=e[i];return n.update=function(){if(n.updateConfig(),n.updateContainer(),n.lgg.node()){n.lgg.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle(),n.sizeLegend._totalBarsHeight=0,n.sizeLegend._totalD3SymbolsHeight=0;var e=n.getBaseY(),i=n.getBaseX();if(t.classifierSize_&&Jy(n,i,e),t.classifierColor_&&n.colorLegend){var r=i,a=e;n._sizeLegendContainer&&(a+=n._sizeLegendContainer.node().getBBox().height+n.colorLegend.marginTop),Dv(n,r,a)}if(n.map.patternFill_){var o=n.lgg.node().getBBox().height,s=n.lgg.append("g").attr("class","pattern-fill-legend").attr("transform","translate(".concat(i,", ").concat(o+n.boxPadding+5,")"));ov(n,s)}n.setBoxDimension()}},n};function nx(t){if("ranges"==t.colorLegend.labelType){var e=function(t){var e=t.map,n=e.psThresholds_.length>1?e.psThresholds_:Array.from({length:e.psClasses_}).map((function(n,i){return e.classifier().invertExtent(i)[t.ascending?0:1]})).slice(1);return n}(t);return t.colorLegend.labelFormatter||function(n,i){var r=mn(".".concat(t.decimals,"f"));return 0===i?"> ".concat(r(e[e.length-1])):i===e.length?"< ".concat(r(e[0])):"".concat(r(e[e.length-i-1])," - < ").concat(r(e[e.length-i])," ")}}return t.colorLegend.labelType,t.colorLegend.labelFormatter||mn(".".concat(t.decimals,"f"))}function ix(t,e){var n=t.getCentroidsGroup(t).selectAll("[ecl]");n.each((function(t,e){Ft(this).style("opacity","0")})),n.filter("[ecl='"+e+"']").each((function(e,n){Ft(this).style("opacity",t.psFillOpacity_)}))}function rx(t){t.getCentroidsGroup(t).selectAll("[ecl]").each((function(e,n){Ft(this).style("opacity",t.psFillOpacity_)}))}var ax=function(t){var e={};function n(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new WeakSet,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=r.maxDepth||100;if(a.has(t))return t;if(a.add(t),o>s)return console.warn("Max recursion depth (".concat(s,") reached.")),t;for(var l in e)if(e.hasOwnProperty(l)&&t.hasOwnProperty(l)){var c=e[l],u=t[l];"function"==typeof c?t[l]=c:i(c)&&i(u)?n(u,c,r,a,o+1):Array.isArray(c)&&Array.isArray(u)?t[l]=r.mergeArrays?y(new Set([].concat(y(u),y(c)))):y(c):c instanceof Date?t[l]=new Date(c.getTime()):c instanceof RegExp?t[l]=new RegExp(c):c instanceof Map?t[l]=new Map(c):c instanceof Set?t[l]=new Set(c):t[l]=c}return t}function i(t){return"[object Object]"===Object.prototype.toString.call(t)}return e.map=t,e.svgId="legend_"+Math.round(1e16*Math.random()),e.svg=void 0,e.lgg=void 0,e.x=void 0,e.y=void 0,e.boxPadding=7,e.boxOpacity=.7,e.title="",e.titleFontSize=ra("em-legend-title"),e.width=150,e.titlePadding=5,e.shapeWidth=25,e.shapeHeight=20,e.shapePadding=5,e.labelFontSize=ra("em-legend-label"),e.labelOffsets={x:5,y:5},e.labelFormatter=null,wn({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),e.noData=!0,e.noDataText="No data",e.noDataPadding=5,e.noDataShapeWidth=25,e.noDataShapeHeight=20,e.ascending=!0,e.decimals=0,e.build=function(){e.svg=Ft("#"+e.svgId),e.svg.selectAll("#em-legend-"+e.svgId).remove(),e.lgg=e.svg.append("g").attr("id","em-legend-"+e.svgId).attr("class","em-legend")},e.update=function(){return console.log("Legend update function not implemented"),e},e.updateContainer=function(){var t=e.map;e.lgg.selectAll("*").remove(),e.svg.attr("id")!==t.legend_.svgId&&e.build()},e.updateConfig=function(){var t=e.map;t.legend_&&n(e,t.legend_)},e.makeBackgroundBox=function(){e.lgg.append("rect").attr("id","legendBR").attr("class","em-legend-background").style("opacity",e.boxOpacity)},e.addTitle=function(){if(e.title){var t=e.lgg.append("g").attr("id","em-legend-titles"),n=ra("em-legend-title");t.append("text").attr("class","em-legend-title").attr("x",e.boxPadding).attr("y",e.boxPadding+n).text(e.title)}},e.addSubtitle=function(){if(e.subtitle){var t=e.lgg.select("#em-legend-titles"),n=ra("em-legend-title"),i=ra("em-legend-subtitle");t.append("text").attr("class","em-legend-subtitle").attr("x",e.boxPadding).attr("y",e.boxPadding+n+i+3).text(e.subtitle)}},e.getBaseY=function(){return e.boxPadding+(e.title?ra("em-legend-title"):0)+(e.subtitle?ra("em-legend-subtitle"):0)+10},e.getBaseX=function(){return e.boxPadding},e.setBoxDimension=function(){if(e.lgg.node()){var t=e.lgg.node().getBBox({stroke:!0}),n=e.boxPadding;e.svg.select("#legendBR").attr("x",t.x-n).attr("y",t.y-n).attr("width",t.width+2*n).attr("height",t.height+2*n)}},e.appendNoDataLegend=function(t,n,i,r){var a=e.map;t.append("rect").attr("class","em-legend-rect").style("fill",a.noDataFillStyle()).attr("y",e.noDataPadding).attr("width",e.noDataShapeWidth).attr("height",e.noDataShapeHeight).on("mouseover",(function(){i(a,"nd"),a.insetTemplates_&&ua(a.insetTemplates_,a.svgId,i,"nd")})).on("mouseout",(function(){r(a),a.insetTemplates_&&ua(a.insetTemplates_,a.svgId,r,"nd")})),t.append("text").attr("class","em-legend-label").attr("dy","0.35em").attr("x",e.noDataShapeWidth+5).attr("y",e.noDataShapeHeight/2+e.noDataPadding).text(n)},e.getNumberOfClasses=function(t){var e=t.map;return"ps"===e._mapType?e.psClasses_:e.numberOfClasses_},e.getLabelFormatter=function(t){return"ps"===t.map._mapType?nx(t):Uv(t)},e.getClassToFillStyle=function(t){var e=t.map;return"ps"===e._mapType?e.psClassToFillStyle_:e.classToFillStyle_},e.getColorClassifier=function(t){var e=t.map;return"ps"===e._mapType?e.classifierColor_:e.classifier_},e.getHighlightFunction=function(t){return"ps"==t._mapType?ix:Wv},e.getUnHighlightFunction=function(t){return"ps"==t._mapType?rx:Hv},e},ox=function(t){var e,n,i;function r(){i=Ft("#"+t.div),i.empty()&&(i=Ft("body").append("div").attr("id",t.id)),i.attr("class","em-tooltip")}return(t=t||{}).containerId=t.containerId||t.svgId||"map",t.customElement=t.customElement,t.id=t.id||"em-tooltip-".concat(t.containerId),t.offset={x:(null===(e=t.offset)||void 0===e?void 0:e.x)||t.xOffset||30,y:(null===(n=t.offset)||void 0===n?void 0:n.y)||t.yOffset||20},t.transitionDuration=0,r.mouseover=function(e){if(i.html(e),e){var n=event.pageX,a=event.pageY;r.ensureTooltipOnScreen(n,a),i.interrupt().transition().duration(t.transitionDuration).style("opacity",1)}},r.mousemove=function(t){var e=t.pageX,n=t.pageY;this.ensureTooltipOnScreen(e,n)},r.mouseout=function(){i.interrupt().transition().duration(t.transitionDuration).style("opacity",0)},r.style=function(t,e){return 1==arguments.length?i.style(t):(i.style(t,e),r)},r.attr=function(t,e){return 1==arguments.length?i.attr(t):(i.attr(t,e),r)},r.ensureTooltipOnScreen=function(e,n){var r=i.node();r.style.left=e+t.offset.x+"px",r.style.top=n-t.offset.y+"px";var a=document.getElementById(t.containerId).getBoundingClientRect(),o=a.width,s=a.height;if(r.offsetLeft>a.left+o-r.clientWidth){var l=e-r.clientWidth-t.offset.x;if(r.style.left=l+"px",r.offsetLeft+r.clientWidth>e){var c=e-r.clientWidth-t.offset.x;r.style.left=c+"px"}}r.offsetTop+r.clientHeight>a.top+s&&(r.style.top=r.offsetTop-r.clientHeight+"px")},r(),r},sx=function(t,e,n){var i=Jm(t,e,n);if(i.stat_={default:void 0},i.stat=function(t,e){return arguments.length?2==arguments.length?(i.stat_[t]=e,i):"string"==typeof t||t instanceof String?i.stat_[t]:(i.stat_=t.default?t:{default:t},i):i.stat_.default},i.statData_={default:av(),color:av(),size:av(),v1:av(),v2:av(),v3:av()},i.statData=function(t,e){return arguments.length?1===arguments.length?(i.statData_[t]||(i.statData_[t]=av()),i.statData_[t]):(i.statData_[t]=e,i):i.statData_.default},i.noDataText_="No data available",i.language_="en",i.transitionDuration_=500,i.tooltip_.textFunction=void 0,i.filtersDefinitionFunction_=void 0,i.callback_=void 0,i.legend_=void 0,i.legendObj_=void 0,["legend_","legendObj_","noDataText_","language_","transitionDuration_","tooltipText_","filtersDefinitionFunction_","callback_"].forEach((function(t){i[t.substring(0,t.length-1)]=function(e){return arguments.length?(i[t]=e,i):i[t]}})),t)for(var r in t)i[r]&&null!=t[r]&&i[r](t[r]);i.legend=function(t){if(!arguments.length)return i.legend_;if(0==t){var e=i.legendObj();if(e){var n=Ft("#"+e.svgId);n.size()>0&&n.selectAll("*").remove()}return i.legend_=t,i}return i.legend_=t,i.legendObj_&&i.updateLegend(),i},i.updateLegend=function(t){return i.legendObj_&&i.legendObj().update(),i},i.build=function(){return i.projectionFunction_&&i.proj("4326"),i.buildMapTemplateBase(),i.filtersDefinitionFunction_&&i.filtersDefinitionFunction_(i.svg(),i.numberOfClasses_),i.legend()&&i.buildLegend(),i.tooltip_||i.tooltip_||(i.tooltip_={id:i.svgId()}),i._tooltip=ox(i.tooltip_),i.updateGeoData(),i.updateStatData(),i},i.buildLegend=function(){i.legendObj(i.getLegendConstructor()(i,i.legend()));var t=i.legendObj();if(0==Ft("#"+t.svgId).size()){var e=null==t.x?i.width()-100-t.boxPadding:t.x,n=null==t.y?t.boxPadding:t.y;i.svg().append("g").attr("id",t.svgId).attr("class","em-legend").attr("transform","translate("+e+","+n+")")}t.build()};var a=function(){for(var t in i.statData_){var e=!!i.stat_[t],n=!(!i.statData_[t]||!i.statData_[t].get());if((e||n)&&!i.statData_[t].isReady())return!1}return!0};return i.updateGeoData=function(){return i.updateGeoMapTemplate((function(){a()&&(i.updateStatValues(),i.callback()&&i.callback()(i))})),i},i.updateStatData=function(){for(var t in i.stat_){var e,n,r=i.stat(t),o=null===(e=(n=i.statData(t)).get)||void 0===e?void 0:e.call(n);if((r||o)&&r){var s=av(r);i.statData(t,s);var l=i.nutsLevel_;"mixed"===l&&(l=0),s.retrieveFromRemote(l,i.language(),(function(){i.Geometries.isGeoReady()&&a()&&(i.updateStatValues(),i.callback()&&i.callback()(i))}))}}return i},i.updateStatValues=function(){return e&&i.refreshCentroids(i),i.updateClassification(),i.updateStyle(),i.legend_&&i.legendObj()&&i.legendObj().update(),i},i.updateClassification=function(){return console.log("Map updateClassification function not implemented"),i},i.updateStyle=function(){return console.log("Map updateStyle function not implemented"),i},i.getLegendConstructor=function(){return console.log("Map getLegendConstructor function not implemented"),ax},i.getTime=function(){return i.statData("default").getTime()},i.setFromURL=function(){var t=lx();return t.w&&i.width(t.w),t.h&&i.height(t.h),t.x&&t.y&&i.geoCenter([t.x,t.y]),t.z&&i.pixelSize(t.z),t.s&&i.scale(t.s),t.lvl&&i.nutsLevel(t.lvl),t.time&&(i.filters_.time=t.time,delete i.filters_.lastTimePeriod),t.proj&&i.proj(t.proj),t.geo&&i.geo(t.geo),t.ny&&i.nutsYear(t.ny),t.language&&i.language(t.language),t.numberOfClasses&&i.numberOfClasses(+t.numberOfClasses),i},i.exportMapToSVG=function(){var t=i.svg_.node().cloneNode(!0);t.hasAttribute("xmlns")||t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.hasAttribute("xmlns:xlink")||t.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),document.body.appendChild(t),sa(t),document.body.removeChild(t);var e=function(t){var e='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'+t.outerHTML,n=new Blob([e],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(n)}(t),n=document.createElement("a");return n.href=e,n.download="eurostatmap.svg",document.body.appendChild(n),n.click(),document.body.removeChild(n),i},i.exportMapToPNG=function(t,e){var n=i.svg_.node().cloneNode(!0);sa(n);var r=(new XMLSerializer).serializeToString(n),a=new Blob([r],{type:"image/svg+xml;charset=utf-8"}),o=URL.createObjectURL(a);if(t=t||n.getAttribute("width"),e=e||n.getAttribute("height"),!t||!e)throw new Error("SVG width or height attributes are missing or invalid.");var s=new Image;return s.onload=function(){var n=document.createElement("canvas");n.width=parseFloat(t),n.height=parseFloat(e),n.getContext("2d").drawImage(s,0,0,n.width,n.height),n.toBlob((function(t){var e=URL.createObjectURL(t),n=document.createElement("a");n.href=e,n.download="eurostat-map.png",document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(o),URL.revokeObjectURL(e)}),"image/png")},s.src=o,i},i},lx=function(){for(var t={},e=["w","h","x","y","z","s","lvl","time","proj","geo","ny","language","sl","numberOfClasses"],n=0;n<e.length;n++)t[e[n]]=getURLParameterByName(e[n]);return t};function cx(t){return t.slice().sort((function(t,e){return t-e}))}function ux(t,e){for(var n=[],i=0;i<t;i++){for(var r=[],a=0;a<e;a++)r.push(0);n.push(r)}return n}function hx(t,e,n,i){var r;if(t>0){var a=(n[e]-n[t-1])/(e-t+1);r=i[e]-i[t-1]-(e-t+1)*a*a}else r=i[e]-n[e]*n[e]/(e+1);return r<0?0:r}function fx(t,e,n,i,r,a,o){if(!(t>e)){var s=Math.floor((t+e)/2);i[n][s]=i[n-1][s-1],r[n][s]=s;var l=n;t>n&&(l=Math.max(l,r[n][t-1]||0)),l=Math.max(l,r[n-1][s]||0);var c,u,h,f=s-1;e<i[0].length-1&&(f=Math.min(f,r[n][e+1]||0));for(var p=f;p>=l&&!((c=hx(p,s,a,o))+i[n-1][l-1]>=i[n][s]);--p)(u=hx(l,s,a,o)+i[n-1][l-1])<i[n][s]&&(i[n][s]=u,r[n][s]=l),l++,(h=c+i[n-1][p-1])<i[n][s]&&(i[n][s]=h,r[n][s]=p);fx(t,s-1,n,i,r,a,o),fx(s+1,e,n,i,r,a,o)}}function px(t,e){if(e>t.length)throw new Error("cannot generate more classes than there are data values");var n=cx(t),i=function(t){for(var e,n=0,i=0;i<t.length;i++)0!==i&&t[i]===e||(e=t[i],n++);return n}(n);if(1===i)return[n];var r=ux(e,n.length),a=ux(e,n.length);!function(t,e,n){for(var i=e[0].length,r=t[Math.floor(i/2)],a=[],o=[],s=0,l=void 0;s<i;++s)l=t[s]-r,0===s?(a.push(l),o.push(l*l)):(a.push(a[s-1]+l),o.push(o[s-1]+l*l)),e[0][s]=hx(0,s,a,o),n[0][s]=0;for(var c=1;c<e.length;++c)fx(c<e.length-1?c:i-1,i-1,c,e,n,a,o)}(n,r,a);for(var o=[],s=a[0].length-1,l=a.length-1;l>=0;l--){var c=a[l][s];o[l]=n.slice(c,s+1),l>0&&(s=c-1)}return o}function dx(t,e){if(e>t.length)return null;t=t.slice().sort((function(t,e){return t-e}));var n=function(t,e){var n,i,r=[],a=[],o=0;for(n=0;n<t.length+1;n++){var s=[],l=[];for(i=0;i<e+1;i++)s.push(0),l.push(0);r.push(s),a.push(l)}for(n=1;n<e+1;n++)for(r[1][n]=1,a[1][n]=0,i=2;i<t.length+1;i++)a[i][n]=Number.POSITIVE_INFINITY;for(var c=2;c<t.length+1;c++){for(var u=0,h=0,f=0,p=0,d=1;d<c+1;d++){var g=c-d+1,_=t[g-1];if(o=(h+=_*_)-(u+=_)*u/++f,0!=(p=g-1))for(i=2;i<e+1;i++)a[c][i]>=o+a[p][i-1]&&(r[c][i]=g,a[c][i]=o+a[p][i-1])}r[c][1]=1,a[c][1]=o}return{lowerClassLimits:r,varianceCombinations:a}}(t,e);return function(t,e,n){var i=t.length,r=[],a=n;for(r[n]=t[t.length-1];a>0;)r[a-1]=t[e[i][a]-1],i=e[i][a]-1,a--;return r}(t,n.lowerClassLimits,e)}var gx=function(){this.totalCount=0,this.data={}};gx.prototype.train=function(t,e){for(var n in this.data[e]||(this.data[e]={}),t){var i=t[n];void 0===this.data[e][n]&&(this.data[e][n]={}),void 0===this.data[e][n][i]&&(this.data[e][n][i]=0),this.data[e][n][i]++}this.totalCount++},gx.prototype.score=function(t){var e,n={};for(var i in t){var r=t[i];for(e in this.data)n[e]={},this.data[e][i]?n[e][i+"_"+r]=(this.data[e][i][r]||0)/this.totalCount:n[e][i+"_"+r]=0}var a={};for(e in n)for(var o in a[e]=0,n[e])a[e]+=n[e][o];return a};var _x=function(){this.weights=[],this.bias=0};_x.prototype.predict=function(t){if(t.length!==this.weights.length)return null;for(var e=0,n=0;n<this.weights.length;n++)e+=this.weights[n]*t[n];return(e+=this.bias)>0?1:0},_x.prototype.train=function(t,e){if(0!==e&&1!==e)return null;t.length!==this.weights.length&&(this.weights=t,this.bias=1);var n=this.predict(t);if("number"==typeof n&&n!==e){for(var i=e-n,r=0;r<this.weights.length;r++)this.weights[r]+=i*t[r];this.bias+=i}return this};Math.log(Math.sqrt(2*Math.PI));Math.sqrt(2*Math.PI);var mx=Math.sqrt(2*Math.PI);function vx(t){for(var e=t,n=t,i=1;i<15;i++)e+=n*=t*t/(2*i+1);return Math.round(1e4*(.5+e/mx*Math.exp(-t*t/2)))/1e4}for(var yx=[],xx=0;xx<=3.09;xx+=.01)yx.push(vx(xx));var bx=function(t){var e=sx(t,!1,"ch");e.numberOfClasses_=7,e.classificationMethod_="quantile",e.thresholds_=[0],e.colors_=null,e.makeClassifNice_=!0;var n=["#E9ECF6","#D4DAF0","#C1C9EB","#A8B4E6","#93A2DC","#7C90D6","#677CD2","#5169BE","#3C57B0","#2644A7","#15246B","#081132"];function i(t){var n=function(t){return y(Array(t).keys())},i=e.statData().getArray(),r=function(t){t.attr("ecl",(function(t){var n=e.statData().get(t.properties.id);if(n){var i=n.value;return":"===i||null===i?"nd":"continuous"===e.colorSchemeType_?i:null!=i?+e.classifier_(i):void 0}}))};if(function(){var t=n(e.numberOfClasses_);if("continuous"===e.colorSchemeType_){var r,a=e.valueTransform_||function(t){return t},o=i.map(a),s=Ot(o),l=Gt(o),c=function(t){return null!==t.pointOfDivergence_}(e);if(!("function"==typeof(null===(r=e.colorFunction_)||void 0===r?void 0:r.domain)))if(c){var u,h=a(null!==(u=e.pointOfDivergence_)&&void 0!==u?u:0);e.domain_=[s,h,l]}else e.domain_=[s,l];e.classifier((function(t){return t}))}switch(e.classificationMethod_){case"quantile":e.classifier(Vt().domain(i).range(t));break;case"equal-interval":case"equinter":e.classifier(Cn().domain([Ot(i),Gt(i)]).range(t)),e.makeClassifNice_&&e.classifier().nice();break;case"threshold":e.numberOfClasses(e.thresholds_.length+1),e.classifier(An().domain(e.thresholds_).range(n(e.numberOfClasses_)));break;case"jenks":var f=dx(i,e.numberOfClasses_).slice(1,-1);e.classifier(An().domain(f).range(t));break;case"ckmeans":var p=px(i,e.numberOfClasses_).map((function(t){return t.pop()})).slice(0,-1);e.classifier(An().domain(p).range(t))}}(),t.svg_){var a=pa(t);if(r(t.svg().selectAll(a)),"mixed"===t.nutsLevel_)r(t.svg().selectAll("path.em-nutsrg0"))}}function r(t){if(e.filtersDefinitionFunction_?e.classToFillStyle(Sx()):e.classToFillStyle(wx(e.colorFunction_,e.colors_)),t.svg_){var n=pa(t),i=t.svg().selectAll(n);i.style("pointer-events","none").transition().duration(e.transitionDuration()).style("fill",o).end().then((function(){i.style("pointer-events",null),i.each((function(){var t=Ft(this);t.attr("fill___",t.style("fill"))})),s(t,i),e.gridCartogram_&&t.svg().selectAll(".em-grid-text").each((function(){var t=Ft(this.parentNode).style("fill");Ft(this).attr("fill",fa(t))}))})).catch((function(t){})),"mixed"===e.nutsLevel_&&a(t),e.labels_&&e.labels_.values&&e.updateValuesLabels(t),e.patternFill_&&vy(t,e.patternFill_)}}e.colorFunction_=function(t){return function(t,e){void 0===e&&(e=t,t=Ye);for(var n=0,i=e.length-1,r=e[0],a=new Array(i<0?0:i);n<i;)a[n]=t(r,r=e[++n]);return function(t){var e=Math.max(0,Math.min(i-1,Math.floor(t*=i)));return a[e](t-e)}}(Yn,n)(Math.min(Math.max(0,t),1))},e.classToFillStyle_=void 0,e.classifier_=void 0,e.tooltip_.textFunction=Mx,e.colorSchemeType_="discrete",e.valueTransform_=function(t){return t},e.valueUntransform_=function(t){return t},e.pointOfDivergence_=null,["numberOfClasses_","classificationMethod_","thresholds_","makeClassifNice_","colorFunction_","classToFillStyle_","noDataFillStyle_","classifier_","colors_","colorFunction_","colorSchemeType_","valueTransform_","valueUntransform_","pointOfDivergence_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),e.colorFunction=function(t){if(!arguments.length)return e.colorFunction_;if(e.colorFunction_=t,e.filtersDefinitionFunction_)e.classToFillStyle(Sx());else{var n=wx(e.colorFunction_,e.colors_,e.colorSchemeType_);e.classToFillStyle(n)}return e},e.threshold=function(t){return arguments.length?(e.thresholds_=t,e.numberOfClasses(t.length+1),e):e.thresholds_},e.filtersDefinitionFunction=function(t){return arguments.length?(e.filtersDefinitionFunction_=t,e.svg()&&e.filtersDefinitionFunction_(e.svg(),e.numberOfClasses_),e):e.filtersDefinitionFunction_},t&&["numberOfClasses","classificationMethod","threshold","makeClassifNice","colorFunction","classToFillStyle","noDataFillStyle","colors"].forEach((function(n){null!=t[n]&&e[n](t[n])})),e.updateClassification=function(){try{return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,i),i(e),e}catch(t){console.error("Error in updateClassification:",t.message),console.error(t)}},e.updateStyle=function(){try{return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,r),r(e),e}catch(t){console.error("Error in updateStyle:",t.message),console.error(t)}},e.getLegendConstructor=function(){return Bv};var a=function(t){t.svg().selectAll(pa(t)).each((function(){if(!this.parentNode.classList.contains("em-cntrg")){var t=Ft(this),e=t.attr("ecl"),n=t.attr("lvl"),i=e||"0"===n;if(t.style("display",i?"block":"none"),e&&"0"!==n){var r=t.style("stroke")||"#777",a=t.style("stroke-width")||.2;t.style("stroke",r).style("stroke-width",a)}}}))};var o=function(t){var n,i=Ft(this).attr("ecl"),r=e.colorSchemeType_||"discrete";if(i||"0"===i)return"nd"===i?e.noDataFillStyle_||"gray":e.filtersDefinitionFunction_?e.classToFillStyle_(i):"continuous"===r?function(t,e){var n,i=e.colorFunction_,r=e.domain_||[0,1],a="function"==typeof(null==i?void 0:i.domain),o=e.valueTransform_||function(t){return t},s=o(t);if(isNaN(s))return e.noDataFillStyle_||"gray";if(a)return i(s);if(3===r.length){var l,c=v(r,3),u=c[0],h=c[2],f=o(null!==(l=e.pointOfDivergence_)&&void 0!==l?l:0);n=s<f?.5*(s-u)/(f-u):.5+.5*(s-f)/(h-f)}else{var p=v(r,2),d=p[0];n=(s-d)/(p[1]-d)}return i(Math.min(Math.max(n,0),1))}(+i,e):null!==(n=e.Geometries)&&void 0!==n&&n.userGeometries?e.classToFillStyle_(i,e.numberOfClasses_||1):"WORLD"===e.geo_?e.classToFillStyle_(i,e.numberOfClasses_||1)||e.cntrgFillStyle_:e.classToFillStyle_(i,e.numberOfClasses_||1)},s=function(t,n){var i=function(e){var n;return null===(n=t.tooltip_.omitRegions)||void 0===n?void 0:n.includes(e)};n.on("mouseover",(function(n,r){i(r.properties.id)||(Ft(this).style("fill",t.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(r,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,r,this,t))})).on("mousemove",(function(n,r){i(r.properties.id)||(e._tooltip&&e._tooltip.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,r,this,t))})).on("mouseout",(function(n,r){if(!i(r.properties.id)){var a=Ft(this);a.style("fill",a.attr("fill___")),e._tooltip&&e._tooltip.mouseout(),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,r,this,t)}}))};return e.highlightRegion=function(t){if(!e.svg_)return e;var n=pa(e),i=e.svg().selectAll(n).filter((function(e){return e.properties.id===t}));if(!i.empty()){var r=i.datum();if(i.style("fill",e.hoverColor_||"orange"),e._tooltip){var a=e.tooltip_.textFunction(r,e);e._tooltip.mouseover(a);var o=i.node().getBBox(),s=e.__lastTransform||{x:0,y:0,k:1},l=(o.x+o.width/2)*s.k+s.x,c=(o.y+o.height/2)*s.k+s.y,u=e.svg().node().getBoundingClientRect(),h=u.left+l,f=u.top+c;e._tooltip.ensureTooltipOnScreen(h,f)}e.onRegionMouseOver_&&e.onRegionMouseOver_(null,r,i.node(),e)}return e},e.clearHighlight=function(){if(!e.svg_)return e;var t=pa(e);return e.svg().selectAll(t).each((function(){var t=Ft(this),e=t.attr("fill___");e&&t.style("fill",e)})),e._tooltip&&e._tooltip.mouseout(),e},e},wx=function(t,e){return t=t||Pn,"continuous"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"discrete")?function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,1],i=(e-n[0])/(n[1]-n[0]);return t(Math.min(Math.max(i,0),1))}:e?function(t,n){return e[t]}:function(e,n){return t(e/(n-1))}},Sx=function(){return function(t){return"url(#pattern_"+t+")"}},Mx=function(t,e){if(e.tooltip_.omitRegions&&e.tooltip_.omitRegions.includes(t.properties.id))return"";var n=[],i=t.properties.na||t.properties.name,r=t.properties.id;n.push('\n <div class="em-tooltip-bar">\n <b>'.concat(i,"</b>").concat(r?" (".concat(r,")"):"","\n </div>\n "));var a=e.statData(),o=a.get(r),s=a.unitText()||"";if(!o||0!==o.value&&!o.value||":"===o.value)return n.push('\n <div class="em-tooltip-text no-data">\n <table class="em-tooltip-table">\n <tbody>\n <tr><td>'.concat(e.noDataText_,"</td></tr>\n </tbody>\n </table>\n </div>\n ")),n.join("");n.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr><td>'.concat(la(o.value)," ").concat(s,"</td></tr>\n </tbody>\n </table>\n </div>\n "));var l=o.status;if(l&&e.tooltip_.showFlags){var c="short"===e.tooltip_.showFlags?l:flags[l]||l;n.push(' <span class="status-flag">'.concat(c,"</span>"))}return n.join("")};const Ex=kn("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");var Cx=function(t,e){var n=ax(t);if(n.order=void 0,e)for(var i in e)n[i]=e[i];function r(t,e){var n=da(t),i=t.svg_.selectAll(n).selectAll("[ecl]");i.style("fill","white"),i.filter("[ecl='"+e+"']").each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}function a(t){var e=da(t);t.svg_.selectAll(e).selectAll("[ecl]").each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}return n.update=function(){if(n.updateConfig(),n.updateContainer(),n.lgg.node()&&n.map.classifier_){n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle();var t=n.getBaseY(),e=n.getBaseX();if(n._categoricalContainer=n.lgg.append("g").attr("class","em-legend-categorical").attr("transform","translate(".concat(e,", ").concat(t,")")),function(t){for(var e=t._categoricalContainer,n=t.map,i=n.classToFillStyle()?Object.keys(n.classToFillStyle()):n.classifier_.domain(),o=t.order?t.order:i,s=function(){var i=o[l],s=n.classifier_(i),c=n.classToFillStyle_[i],u=t.titlePadding+l*(t.shapeHeight+t.shapePadding);e.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",u).attr("width",t.shapeWidth).attr("height",t.shapeHeight).style("fill",c).on("mouseover",(function(){r(t.map,s),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.svgId_,r,s)})).on("mouseout",(function(){a(t.map),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.svgId_,a,s)})),e.append("text").attr("class","em-legend-label").attr("x",t.shapeWidth+t.labelOffsets.x).attr("y",u+.5*t.shapeHeight).attr("dy","0.35em").text(n.classToText()?n.classToText()[i]:i)},l=0;l<o.length;l++)s()}(n),n.map.patternFill_){var i=n.lgg.node().getBBox().height,o=n.lgg.append("g").attr("class","pattern-fill-legend").attr("transform","translate(".concat(e,", ").concat(i+15,")"));ov(n,o)}if(n.noData){var s=n.lgg.node().getBBox().height+10,l=e,c=n.lgg.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(l,",").concat(s+15,")"));n.appendNoDataLegend(c,n.noDataText,r,a)}n.setBoxDimension()}},n},Ax=function(t,e){var n=[];t.properties.id?n.push('<div class="em-tooltip-bar">'+t.properties.na+" ("+t.properties.id+") </div>"):n.push('<div class="em-tooltip-bar">'+t.properties.na+"</div>");var i=e.statData().get(t.properties.id);if(!i||0!=i.value&&!i.value)return n.push(e.noDataText_),n.join("");var r=i.value;if(e.classToText_){var a=e.classToText_[r];return n.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>\n '.concat(a||r,"\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n")),n.join("")}return n.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>\n '.concat(r,"\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n")),n.join("")},kx=Array.prototype.slice;function Tx(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Px(t){this._context=t}function Nx(t){return new Px(t)}function Lx(t){return t[0]}function Fx(t){return t[1]}function Ox(t,e){var n=ur(!0),i=null,r=Nx,a=null,o=Tr(s);function s(s){var l,c,u,h=(s=Tx(s)).length,f=!1;for(null==i&&(a=r(u=o())),l=0;l<=h;++l)!(l<h&&n(c=s[l],l,s))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+t(c,l,s),+e(c,l,s));if(u)return a=null,u+""||null}return t="function"==typeof t?t:void 0===t?Lx:ur(t),e="function"==typeof e?e:void 0===e?Fx:ur(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:ur(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:ur(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:ur(!!t),s):n},s.curve=function(t){return arguments.length?(r=t,null!=i&&(a=r(i)),s):r},s.context=function(t){return arguments.length?(null==t?i=a=null:a=r(i=t),s):i},s}Px.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var Gx=function(t,e){var n=ax(t);if(n.squareSize=100,n.rotation=0,n.label1="Variable 1",n.label2="Variable 2",n.axisTitleFontSize=ra("em-bivariate-axis-title"),n.breaks1=void 0,n.breaks2=void 0,n.showBreaks=!1,n.tickLength=5,n.yAxisLabelsOffset={x:0,y:0},n.xAxisLabelsOffset={x:0,y:0},n.yAxisTitleOffset={x:0,y:0},n.xAxisTitleOffset={x:0,y:0},n.boxPadding=n.labelFontSize,n.noDataYOffset=30,n.axisArrows=!0,n.arrowHeight=15,n.arrowWidth=14,n.arrowPadding=10,e)for(var i in e)n[i]=e[i];function r(t,e,n){var i=da(t),r=t.svg_.selectAll(i).selectAll("[ecl1]");r.style("fill","white"),r.filter("[ecl1='".concat(e,"']")).filter("[ecl2='".concat(n,"']")).each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}function a(t){var e=da(t);t.svg_.selectAll(e).selectAll("[ecl1]").each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}return n.update=function(){if(n.updateConfig(),n.updateContainer(),n._horizontalOffset=n.axisTitleFontSize+n.arrowPadding,n.lgg.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle(),n._y=n.boxPadding+(n.title?n.titleFontSize+n.boxPadding:0),function(){for(var t=n.lgg,e=n.map.numberOfClasses(),i=n.squareSize/e,o=0===n.rotation?0:.7071*n.squareSize+n.boxPadding,s=0,l=t.append("g").attr("class","bivariate-squares-chart").attr("transform","translate(".concat(n.boxPadding+n._horizontalOffset,",").concat(o+n._y,") rotate(").concat(n.rotation,") translate(").concat(n.boxPadding,",0)")),c=0;c<e;c++)for(var u=function(){var t=e-c-1,o=e-h-1,u=n.map.classToFillStyle()(t,o);l.append("rect").attr("class","em-bivariate-square").attr("x",s+(e-1-c)*i).attr("y",h*i).attr("width",i).attr("height",i).style("fill",u).on("mouseover",(function(){r(n.map,t,o),n.map.insetTemplates_&&ua(n.map.insetTemplates_,n.map.svgId,r,t,o),Ft(this).raise()})).on("mouseout",(function(){a(n.map),n.map.insetTemplates_&&ua(n.map.insetTemplates_,n.map.svgId,a,t,o)}))},h=0;h<e;h++)u();l.append("rect").attr("class","em-bivariate-frame").attr("x",s).attr("y",0).attr("width",n.squareSize).attr("height",n.squareSize).attr("stroke-width",.7)}(),!n.breaks1&&!n.breaks2&&n.showBreaks){var e=t.classifier1_;"function"==typeof e.quantiles?n.breaks1=e.quantiles().map((function(t){return parseFloat(t.toFixed(0))})):e.domain&&(n.breaks1=e.domain().map((function(t){return parseFloat(t.toFixed(0))})));var i=t.classifier2_;"function"==typeof i.quantiles?n.breaks2=i.quantiles().map((function(t){return parseFloat(t.toFixed(0))})):i.domain&&(n.breaks2=i.domain().map((function(t){return parseFloat(t.toFixed(0))})))}var o,s;!function(){var t=0===n.rotation?0:.7071*n.squareSize+n.boxPadding,e=0,i=n.map.numberOfClasses(),r=n.squareSize/i,a=n.lgg.append("g").attr("class","bivariate-break-labels").attr("transform","translate(".concat(n.boxPadding+n._horizontalOffset,",").concat(t+n._y,") rotate(").concat(n.rotation,") translate(").concat(n.boxPadding,",0)"));if(n.breaks1)for(var o=0;o<n.breaks1.length;o++){var s=e+r*(o+1),l=n.squareSize+ra("em-bivariate-tick-label");a.append("text").attr("class","em-bivariate-tick-label").attr("x",s+n.xAxisLabelsOffset.x).attr("y",l+n.xAxisLabelsOffset.y).text(n.breaks1[o]),a.append("line").attr("class","em-bivariate-tick").attr("x1",s).attr("x2",s).attr("y1",n.squareSize).attr("y2",n.squareSize+n.tickLength)}if(n.breaks2)for(var c=0;c<n.breaks2.length;c++){var u=e,h=r*(c+2)-r;a.append("text").attr("class","em-bivariate-tick-label").attr("x",u+n.yAxisLabelsOffset.x).attr("y",h-n.yAxisLabelsOffset.y-(n.tickLength+2)).text(y(n.breaks2).reverse()[c]).attr("text-anchor","middle").attr("transform","rotate(-90, ".concat(u,", ").concat(h,")")),a.append("line").attr("class","em-bivariate-tick").attr("x1",u).attr("x2",u-n.tickLength).attr("y1",h).attr("y2",h)}}(),n._xAxisArrowY=0,n._yAxisArrowX=0,n.axisArrows&&function(){var t=0===n.rotation?0:.7071*n.squareSize+n.boxPadding,e=0,i=n.lgg.append("g").attr("class","bivariate-axis-arrows").attr("transform","translate(".concat(n.boxPadding+n._horizontalOffset,",").concat(t+n._y,") rotate(").concat(n.rotation,") translate(").concat(n.boxPadding,",0)"));n._xAxisArrowY=n.squareSize+n.tickLength+n.arrowPadding,(n.showBreaks||n.breaks1&&n.breaks2)&&(n._xAxisArrowY+=ra("em-bivariate-tick-label")/1.5);i.append("path").attr("class","em-bivariate-axis-arrow").attr("d",Ox()([[e,n._xAxisArrowY],[e+n.squareSize,n._xAxisArrowY]])).attr("stroke","black").attr("marker-end","url(#arrowhead)"),n._yAxisArrowX=-n.tickLength-n.arrowPadding,(n.showBreaks||n.breaks1&&n.breaks2)&&(n._yAxisArrowX-=n.labelFontSize/2);i.append("path").attr("class","em-bivariate-axis-arrow").attr("d",Ox()([[n._yAxisArrowX,n.squareSize],[n._yAxisArrowX,0]])).attr("stroke","black").attr("marker-end","url(#arrowhead)")}(),function(){var t=0===n.rotation?0:.7071*n.squareSize+n.boxPadding,e=0,i=n.lgg.append("g").attr("class","bivariate-axis-titles").attr("transform","translate(".concat(n.boxPadding+n._horizontalOffset,",").concat(t+n._y,") rotate(").concat(n.rotation,") translate(").concat(n.boxPadding,",0)")),r=n.squareSize+n.xAxisLabelsOffset.y+(n.axisArrows?n.arrowPadding+n.arrowHeight:7),a=e;(n.showBreaks||n.breaks1&&n.breaks2)&&(r+=ra("em-bivariate-tick-label"));n.xAxisTitleOffset&&(r+=n.xAxisTitleOffset.y);n.xAxisTitleOffset&&(a+=n.xAxisTitleOffset.x);i.append("text").attr("class","em-bivariate-axis-title em-bivariate-axis-title-x").attr("x",a).attr("y",r).text(n.label1).attr("dominant-baseline","hanging").attr("alignment-baseline","hanging");var o=(n.axisArrows?n._yAxisArrowX-n.arrowPadding:7)+(-45==n.rotation?-4:-10);(n.showBreaks||n.breaks1&&n.breaks2)&&(r+=ra("em-bivariate-tick-label"));var s=-n.squareSize;n.yAxisTitleOffset&&(o+=n.yAxisTitleOffset.y);n.yAxisTitleOffset&&(s+=n.yAxisTitleOffset.x);i.append("text").attr("class","em-bivariate-axis-title em-bivariate-axis-title-y").attr("x",s).attr("y",o).text(n.label2).style("transform",n.rotation<0?"translate(".concat(n.axisArrows?-51:-15,"px, 95px) rotate(90deg)"):"rotate(-90deg)")}(),n.lgg.append("defs").append("marker").attr("viewBox","0 0 ".concat(n.arrowWidth," ").concat(n.arrowHeight)).attr("id","arrowhead").attr("refX",0).attr("refY",5).attr("markerWidth",n.arrowWidth).attr("markerHeight",n.arrowHeight).attr("orient","auto").append("path").attr("d","M 0 0 L 5 5 L 0 10").attr("marker-units","strokeWidth"),n.noData&&(o=0===n.rotation?n.noDataYOffset+n.squareSize/n.map.numberOfClasses_+n.arrowHeight/2:n.noDataYOffset,s=0===n.rotation?n._y+n.squareSize+o:n._y+1.4142*n.squareSize+2*n.boxPadding+o,n.lgg.append("rect").attr("class","em-bivariate-nodata").attr("x",n.boxPadding+n.noDataShapeWidth/2).attr("y",s+(0==n.rotation?0:-10)).attr("width",n.noDataShapeWidth).attr("height",n.noDataShapeHeight).style("fill",n.map.noDataFillStyle()).on("mouseover",(function(){("mixed"==n.map.nutsLevel_?va("#em-nutsrg"):Ft("#em-nutsrg")).selectAll("[nd='nd']").style("fill","red")})).on("mouseout",(function(){("mixed"==n.map.nutsLevel_?va("#em-nutsrg"):Ft("#em-nutsrg")).selectAll("[nd='nd']").style("fill",(function(){return Ft(this).attr("fill___")})),Ft(this).style("fill",n.map.noDataFillStyle())})),n.lgg.append("text").attr("class","em-bivariate-nodata-label").attr("x",n.boxPadding+n.noDataShapeWidth+(n.noDataShapeWidth/2+5)).attr("y",s+.5*n.noDataShapeHeight+1+(0==n.rotation?0:-10)).text(n.noDataText)),n.setBoxDimension()},n},Dx=function(t,e,n,i,r){for(var a=[],o=Ie(e,n),s=Ie(i,r),l=0;l<t;l++){for(var c=l/(t-1),u=Ie(o(c),s(c)),h=[],f=0;f<t;f++)h.push(u(f/(t-1)));a.push(h)}return function(t,e){return a[t][e]}},zx=function(t,e){var n=[],i=t.properties.na||t.properties.name;t.properties.id?n.push('<div class="em-tooltip-bar" >'+i+" ("+t.properties.id+") </div>"):n.push('<div class="em-tooltip-bar" >'+i+"</div>");var r=e.statData("v1").get(t.properties.id),a=e.statData("v1").unitText(),o=e.statData("v2").get(t.properties.id),s=e.statData("v2").unitText();return n.push('\n <div class="em-tooltip-text" style="background: #ffffff;color: #171a22;padding: 4px;font-size:15px;">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>\n '.concat(r&&r.value?la(r.value):""," ").concat(a&&r&&r.value?a:"","\n ").concat(!r||0!=r.value&&!r.value?e.noDataText_:"","\n </td>\n </tr>\n <tr>\n <td>\n ").concat(o&&o.value?la(o.value):""," ").concat(s&&o&&o.value?s:"","\n ").concat(!o||0!=o.value&&!o.value?e.noDataText_:"","\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n ")),n.join("")},Ix=function(t,e){var n=ax(t);if(n.width=(null==e?void 0:e.width)||150,n.fontSize=(null==e?void 0:e.fontSize)||12,n.padding=(null==e?void 0:e.padding)||2,n.topText=(null==e?void 0:e.topText)||"Variable 1",n.leftText=(null==e?void 0:e.leftText)||"Variable 2",n.rightText=(null==e?void 0:e.rightText)||"Variable 3",e)for(var i in e)n[i]=e[i];return n.update=function(){if(n.updateConfig(),n.updateContainer(),n.lgg.node()){if(!n.map.colorClassifier_)return console.error("Trivariate legend: map.colorClassifier_ missing"),n;n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle(),function(){var t,e,i,r,a,o,s=n.lgg,l=n.map,c=l.colorClassifier_,u=.866025,h=n.width,f=h*u,p=n.fontSize,d=n.padding,g=n.selectionColor||"red",_=l._tooltip,m=s.attr("class","em-ternary-legend").attr("width",h).attr("height",f+4*d+2*p);m.append("text").attr("x",h/2).attr("y",d+p).text(n.topText).attr("font-size",p).attr("text-anchor","middle"),m.append("text").attr("x",0).attr("y",3*d+2*p+f).text(n.leftText).attr("font-size",p).attr("text-anchor","start"),m.append("text").attr("x",h).attr("y",3*d+2*p+f).text(n.rightText).attr("font-size",p).attr("text-anchor","end");var v=m.append("g").attr("transform","translate(0,".concat(2*d+p,")")),y=function(t,e,n){t.attr("fill",e).on("mouseover",(function(t){Ft(this).attr("fill",g),_&&n&&_.mouseover(n)})).on("mousemove",(function(t){_&&n&&_.mousemove(t)})).on("mouseout",(function(t){Ft(this).attr("fill",e),_&&_.mouseout(t)}))};null!=n&&n.texts&&(c.texts=n.texts);var x=v.append("polygon").attr("points","\n 0,".concat(f," ").concat(h/3,",").concat(f," ").concat(h/2,",").concat(2*f/3," ").concat(h/6,",").concat(2*f/3,"\n"));y(x,c.colors[0],null===(t=c.texts)||void 0===t?void 0:t[0]);var b=v.append("polygon").attr("points","\n ".concat(h/2,",0 ").concat(2*h/3,",").concat(f/3," ").concat(h/2,",").concat(2*f/3," ").concat(h/3,",").concat(f/3,"\n"));y(b,c.colors[1],null===(e=c.texts)||void 0===e?void 0:e[1]);var w=v.append("polygon").attr("points","\n ".concat(h,",").concat(f," ").concat(5*h/6,",").concat(2*f/3," ").concat(h/2,",").concat(2*f/3," ").concat(2*h/3,",").concat(f,"\n"));y(w,c.colors[2],null===(i=c.texts)||void 0===i?void 0:i[2]);var S=v.append("polygon").attr("points","\n ".concat(h/2,",").concat(2*f/3," ").concat(5*h/6,",").concat(2*f/3," ").concat(2*h/3,",").concat(f/3,"\n"));y(S,c.mixColors[0],null===(r=c.texts)||void 0===r?void 0:r.m12);var M=v.append("polygon").attr("points","\n ".concat(h/2,",").concat(2*f/3," ").concat(h/3,",").concat(f," ").concat(2*h/3,",").concat(f,"\n"));y(M,c.mixColors[1],null===(a=c.texts)||void 0===a?void 0:a.m02);var E=v.append("polygon").attr("points","\n ".concat(h/2,",").concat(2*f/3," ").concat(h/6,",").concat(2*f/3," ").concat(h/3,",").concat(f/3,"\n"));if(y(E,c.mixColors[2],null===(o=c.texts)||void 0===o?void 0:o.m01),c.centerCoefficient){var C;y(v.append("circle").attr("cx",h/2).attr("cy",2*f/3).attr("r",c.centerCoefficient*f/3),c.centerColor,null===(C=c.texts)||void 0===C?void 0:C.center)}}(),n.setBoxDimension()}},n},Rx=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=v(n||["red","green","blue"],3),a=r[0],o=r[1],s=r[2],l=i.colorInterpolation||Yn,c=null==i.withMixedClasses||i.withMixedClasses,u=function(t,e){return l(t,e)(.5)},h=v(i.mixedColors||c?[u(o,s),u(a,s),u(a,o)]:[],3),f=h[0],p=h[1],d=h[2],g=i.centerColor||l(u(a,o),s)(.333),_=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=t[0],r=t[1],a=t[2],o=v(n.center||[1/3,1/3,1/3],3),s=o[0],l=o[1],c=o[2],u=null==n.withMixedClasses||n.withMixedClasses,h=n.centerCoefficient?1-n.centerCoefficient:void 0,f=function(t){var n=e(t);if(n){var o=+t[i]/n,f=+t[r]/n,p=+t[a]/n;return o>=s&&f<=l&&p<=c?null!=h&&(p-c)*(l-h*l)>=(f-h*l)*(h*c-c)?"center":"0":o<=s&&f>=l&&p<=c?null!=h&&(p-c)*(s-h*s)>=(o-h*s)*(h*c-c)?"center":"1":o<=s&&f<=l&&p>=c?null!=h&&(f-l)*(s-h*s)>=(o-h*s)*(h*l-l)?"center":"2":o<=s&&f>=l&&p>=c?null!=h&&o>h*s?"center":u?"m12":f>p?"1":"2":o>=s&&f<=l&&p>=c?null!=h&&f>h*l?"center":u?"m02":o>p?"0":"2":o>=s&&f>=l&&p<=c?null!=h&&p>h*c?"center":u?"m01":f>o?"1":"0":"unknown"}};return f.center=[s,l,c],f.centerCoefficient=n.centerCoefficient,f}(t,e,i),m=function(t){var e=_(t);return"0"==e?a:"1"==e?o:"2"==e?s:"m12"==e?f:"m02"==e?p:"m01"==e?d:"center"==e?g:i.defaultColor||"black"};return m.center=_.center,m.centerCoefficient=i.centerCoefficient,m.colors=[a,o,s],m.mixColors=[f,p,d],m.centerColor=g,m.classifier=_,m},jx=function(t,e){var n,i,r,a=[],o=t.properties.na||"",s=t.properties.id||"";a.push('<div class="em-tooltip-bar">'.concat(o).concat(s?" (".concat(s,")"):"","</div>"));var l=e.statData("v1").get(s),c=e.statData("v2").get(s),u=e.statData("v3").get(s);return a.push('<div class="em-tooltip-text" style="background:#fff;color:#171a22;padding:4px;font-size:15px;">\n <table class="em-tooltip-table"><tbody>\n <tr><td>'.concat(e.statData("v1").label_||"Variable 1",": ").concat(null!=l&&l.value?la(l.value):""," ").concat((null==l||null===(n=l.unitText)||void 0===n?void 0:n.call(l))||"","</td></tr>\n <tr><td>").concat(e.statData("v2").label_||"Variable 2",": ").concat(null!=c&&c.value?la(c.value):""," ").concat((null==c||null===(i=c.unitText)||void 0===i?void 0:i.call(c))||"","</td></tr>\n <tr><td>").concat(e.statData("v3").label_||"Variable 3",": ").concat(null!=u&&u.value?la(u.value):""," ").concat((null==u||null===(r=u.unitText)||void 0===r?void 0:r.call(u))||"","</td></tr>\n </tbody></table></div>")),a.join("")};function Bx(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function qx(t){return t}function Ux(){var t=qx,e=Bx,n=null,i=ur(0),r=ur(br),a=ur(0);function o(o){var s,l,c,u,h,f=(o=Tx(o)).length,p=0,d=new Array(f),g=new Array(f),_=+i.apply(this,arguments),m=Math.min(br,Math.max(-br,r.apply(this,arguments)-_)),v=Math.min(Math.abs(m)/f,a.apply(this,arguments)),y=v*(m<0?-1:1);for(s=0;s<f;++s)(h=g[d[s]=s]=+t(o[s],s,o))>0&&(p+=h);for(null!=e?d.sort((function(t,n){return e(g[t],g[n])})):null!=n&&d.sort((function(t,e){return n(o[t],o[e])})),s=0,c=p?(m-f*y)/p:0;s<f;++s,_=u)l=d[s],u=_+((h=g[l])>0?h*c:0)+y,g[l]={data:o[l],index:s,value:h,startAngle:_,endAngle:u,padAngle:v};return g}return o.value=function(e){return arguments.length?(t="function"==typeof e?e:ur(+e),o):t},o.sortValues=function(t){return arguments.length?(e=t,n=null,o):e},o.sort=function(t){return arguments.length?(n=t,e=null,o):n},o.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:ur(+t),o):i},o.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:ur(+t),o):r},o.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:ur(+t),o):a},o}const Wx=kn("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");var Hx=function(t,e){var n=ax(t);if(e)for(var i in e)n[i]=e[i];function r(t,e){t.svg_.selectAll("pattern").selectAll("rect").each((function(){var t=Ft(this);t.attr("data-original-fill")||t.attr("data-original-fill",t.style("fill")),t.style("fill","white")})),t.svg_.selectAll("pattern").selectAll("rect[code='"+e+"']").each((function(){var t=Ft(this);t.style("fill",t.attr("data-original-fill"))}))}function a(t){t.svg_.selectAll("pattern").selectAll("rect").each((function(){var t=Ft(this),e=t.attr("data-original-fill");e&&t.style("fill",e)}))}return n.update=function(){n.updateConfig(),n.updateContainer();var t=n.map,e=t.svg(),i=n.lgg;i.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle();var o=0,s=t.catColors(),l=function(l){var c=n.boxPadding+(n.title?n.titleFontSize+n.boxPadding:0)+o*(n.shapeHeight+n.shapePadding);t.catColors()[l];i.append("rect").attr("class","em-legend-rect").attr("x",n.boxPadding).attr("y",c).attr("width",n.shapeWidth).attr("height",n.shapeHeight).style("fill",s[l]).attr("stroke","black").attr("stroke-width",.5).on("mouseover",(function(){Ft(this).raise(),r(n.map,l),n.map.insetTemplates_&&ua(n.map.insetTemplates_,n.map.svgId,r,l)})).on("mouseout",(function(){a(n.map),n.map.insetTemplates_&&ua(n.map.insetTemplates_,n.map.svgId,a)})),i.append("text").attr("class","em-legend-label").attr("x",n.boxPadding+n.shapeWidth+n.labelOffsets.x).attr("y",c+.5*n.shapeHeight).text(t.catLabels()[l]||l).on("mouseover",(function(){e.selectAll("pattern").selectAll("rect[code='"+l+"']").style("fill",t.hoverColor())})).on("mouseout",(function(){var n=t.catColors()[l]||"lightgray";e.selectAll("pattern").selectAll("rect[code='"+l+"']").style("fill",n)})),o++};for(var c in s)l(c);if(n.noData){var u=n.boxPadding+(n.title?n.titleFontSize+n.boxPadding:0)+o*(n.shapeHeight+n.shapePadding);i.append("rect").attr("class","em-legend-rect").attr("x",n.boxPadding).attr("y",u).attr("width",n.shapeWidth).attr("height",n.shapeHeight).style("fill",t.noDataFillStyle()).on("mouseover",(function(){e.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",t.hoverColor()),Ft(this).style("fill",t.hoverColor())})).on("mouseout",(function(){e.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",(function(e){t.noDataFillStyle()}));Ft(this).style("fill",t.noDataFillStyle())})),i.append("text").attr("class","em-legend-label").attr("x",n.boxPadding+n.shapeWidth+n.labelOffsets.x).attr("y",u+.5*n.shapeHeight).text(n.noDataText).on("mouseover",(function(){e.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",t.hoverColor())})).on("mouseout",(function(){e.select("#em-nutsrg").selectAll("[nd='nd']").style("fill",(function(e){t.noDataFillStyle()}))}))}n.setBoxDimension()},n};function Vx(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return $x(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$x(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function $x(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}var Jx=function(t,e){var n=ax(t);if(n.sizeLegend={title:null,titlePadding:10,values:null,labelFormatter:void 0,noData:!1,noDataText:"No data"},n.colorLegend={title:null,titlePadding:10,marginTop:33,labelOffsets:{x:5,y:5},shapeWidth:25,shapeHeight:20,shapePadding:1,noData:!0,noDataText:"No data"},n._sizeLegendHeight=0,e)for(var i in e)if("colorLegend"==i||"sizeLegend"==i){for(var r in n[i])void 0!==e[i][r]&&(n[i][r]=e[i][r]);0==e.colorLegend&&(n.colorLegend=!1)}else n[i]=e[i];function a(t,e){var n=t.svg_.selectAll(".piechart").selectAll("path[code]");n.style("opacity",0),n.filter("path[code='"+e+"']").each((function(){Ft(this).style("opacity",1)}))}function o(t){t.svg_.selectAll(".piechart").selectAll("path[code]").each((function(){Ft(this).style("opacity",1)}))}return n.update=function(){n.updateConfig(),n.updateContainer();var t=n.map,e=n.lgg;e.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle();var i=n.getBaseY(),r=n.getBaseX();t.classifierSize_&&(n._sizeLegendContainer=e.append("g").attr("class","em-pie-size-legend").attr("transform","translate(".concat(r,", ").concat(i,")")),$y(n,n._sizeLegendContainer,n.sizeLegend.values,t.classifierSize_,n.sizeLegend.title,n.sizeLegend.titlePadding)),function(t,e,n){var i=t.map,r=t.colorLegend;if(t._colorLegendContainer=t.lgg.append("g").attr("class","em-pie-color-legend"),t._sizeLegendContainer){var s=t._sizeLegendContainer.node().getBBox().height;t._colorLegendContainer.attr("transform","translate(".concat(e,",").concat(s+t.colorLegend.marginTop,")"))}else t._colorLegendContainer.attr("transform","translate(".concat(e,",").concat(n,")"));r.title&&t._colorLegendContainer.append("text").attr("id","em-color-legend-title").attr("class","em-color-legend-title").attr("x",0).attr("y",t.titleFontSize).text(r.title);var l=0,c=i.catColors(),u=function(e){var n=t.colorLegend.titlePadding+(r.title?t.titleFontSize:0)+l*(r.shapeHeight+r.shapePadding);i.catColors()[e];t._colorLegendContainer.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",n).attr("width",r.shapeWidth).attr("height",r.shapeHeight).style("fill",c[e]).attr("stroke","black").attr("stroke-width",.5).on("mouseover",(function(){a(t.map,e),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,a,e)})).on("mouseout",(function(){o(t.map),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,o,e)})),t._colorLegendContainer.append("text").attr("class","em-legend-label").attr("x",r.shapeWidth+r.labelOffsets.x).attr("y",n+.5*r.shapeHeight).attr("dy","0.35em").text(i.catLabels()[e]||e),l++};for(var h in c)u(h);if(r.noData){var f=0;t._sizeLegendContainer&&(f=t._sizeLegendContainer.node().getBBox().height);var p=f+t.colorLegend.marginTop+t.boxPadding+(r.title?t.titleFontSize+t.boxPadding:0)+l*(r.shapeHeight+r.shapePadding),d=t.lgg.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(t.boxPadding,",").concat(p,")"));t.appendNoDataLegend(d,t.noDataText,a,o)}}(n,r,i),n.setBoxDimension()},n};function Yx(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Xx(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xx(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Xx(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}var Kx=function(t){var e=sx(t,!0,"pie");e.dorling_=(null==t?void 0:t.dorling)||!1,e.animateDorling_=!0,e.pieMinRadius_=5,e.pieMaxRadius_=15,e.pieChartInnerRadius_=0,e.pieStrokeFill_="white",e.pieStrokeWidth_=.3,e.tooltipPieRadius_=40,e.tooltipPieInnerRadius_=0,e.catColors_=void 0,e.catLabels_=void 0,e.pieOtherColor_="#FFCC80",e.pieOtherText_="Other",e.showOnlyWhenComplete_=!1,e.classifierSize_=null,e.statPie_=null,e.pieTotalCode_=void 0,e.statCodes_=void 0,["catColors_","catLabels_","showOnlyWhenComplete_","noDataFillStyle_","pieMaxRadius_","pieMinRadius_","pieChartInnerRadius_","pieOtherColor_","pieOtherText_","pieStrokeFill_","pieStrokeWidth_","dorling_","animateDorling_","pieTotalCode_","statCodes_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),t&&["catColors","catLabels","showOnlyWhenComplete","noDataFillStyle","pieMaxRadius","pieMinRadius","pieChartInnerRadius","pieOtherColor","pieOtherText","pieStrokeFill","pieStrokeWidth","statCodes"].forEach((function(n){null!=t[n]&&e[n](t[n])})),e.statPie=function(t,n,i,r,a,o){t.filters=t.filters||{};for(var s=0;s<i.length;s++){var l=i[s];t.filters[n]=l;var c={};for(var u in t)c[u]=t[u];for(var h in c.filters={},t.filters)c.filters[h]=t.filters[h];e.stat(l,c),a&&(e.catColors_=e.catColors_||{},e.catColors_[l]=a[s]),r&&(e.catLabels_=e.catLabels_||{},e.catLabels_[l]=r[s])}if(e.statCodes_=i,o){e.pieTotalCode_=o,t.filters[n]=o;var f={};for(var p in t)f[p]=t[p];for(var d in f.filters={},t.filters)f.filters[d]=t.filters[d];e.stat(o,f)}else e.pieTotalCode_=void 0;return e},e.updateClassification=function(){return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,n),n(e),e};var n=function(t){if(!e.statCodes_){e.statCodes_=Object.keys(e.statData_);var n=e.statCodes_.indexOf("default");n>-1&&e.statCodes_.splice(n,1)}var i,r=(i=[],e.getCentroidsGroup(e).selectAll("g.em-centroid").data().forEach((function(t){var e=t.properties.id,n=a(e);n&&i.push(n)})),Zv(i));return isNaN(r[0])||(e.classifierSize_=Kv().domain(r).range([e.pieMinRadius_,e.pieMaxRadius_])),e};function i(t){var n=[];if(e.svg_){var i=t.getCentroidsGroup(t);if(i){i.selectAll("g.em-centroid").append("g").attr("class","em-pie").attr("id",(function(t){return n.push(t),"pie_"+t.properties.id}));var o=pa(e),s=e.svg().selectAll(o);"WORLD"!==t.geo_&&"mixed"==t.nutsLevel_&&function(t,e){e.each((function(e){var n=Ft(this);if(!this.parentNode.classList.contains("em-cntrg")){var i=n.attr("lvl"),a=r(e.properties.id),o=a?"WORLD"===t.geo_?"block":null:"none",s=null,l=null;a&&"0"!==i&&(s=n.style("stroke")||"#777","WORLD"===t.geo_&&(l=n.style("stroke-width")||"#777")),n.style("display",o).style("stroke",s).style("stroke-width",l)}}))}(t,s),function(t){t.forEach((function(t){var n=t.properties.id,i=[],o=r(n);for(var s in o)i.push({code:s,value:o[s]});if(i&&0!=i.length){var l=e.svg().selectAll("#pie_"+n),c=e.classifierSize_(a(n)),u=e.pieChartInnerRadius_,h=Ux().sort(null).value((function(t){return t.value})),f=Dr().innerRadius(u).outerRadius(c),p=l.append("g").attr("class","piechart").attr("stroke",e.pieStrokeFill_).attr("stroke-width",e.pieStrokeWidth_+"px").style("pointer-events","none");p.transition().duration(e.transitionDuration()).on("end",(function(){Ft(this).style("pointer-events",null)})),p.selectAll("path").data(h(i)).join("path").attr("d",f).attr("code",(function(t){return t.data.code})).attr("fill",(function(t){return e.catColors_[t.data.code]||"lightgray"})).on("mouseover",(function(n,i){Ft(this.parentNode).style("stroke-width","1px").style("stroke","black"),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(t,e))})).on("mousemove",(function(t){e._tooltip&&e._tooltip.mousemove(t)})).on("mouseout",(function(){Ft(this.parentNode).style("stroke-width",e.pieStrokeWidth_).style("stroke",e.pieStrokeFill_),e._tooltip&&e._tooltip.mouseout()}))}}))}(n),function(t,n){n.on("mouseover",(function(t,n){var i=Ft(this);i.attr("fill___",i.style("fill")),i.style("fill",e.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(n,e))})).on("mousemove",(function(t,n){e._tooltip&&e._tooltip.mousemove(t)})).on("mouseout",(function(){var t=Ft(this);t.attr("fill___")&&(t.style("fill",t.attr("fill___")),e._tooltip&&e._tooltip.mouseout())}))}(0,s)}}}e.updateStyle=function(){try{if(!e.catColors_){e.catColors({});for(var t=0;t<e.statCodes_.length;t++)e.catColors_[e.statCodes_[t]]=Wx[t%10]}return e.pieTotalCode_&&(e.catColors_.other=e.pieOtherColor_,e.catLabels_.other=e.pieOtherText_),e.catLabels_=e.catLabels_||{},e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,i),i(e),e.dorling_?jy(e,(function(t){var n=a(t.properties.id)||0;return e.classifierSize_(n)||0})):qy(e),e}catch(t){console.error("Error in pie symbols styling: "+t.message),console.error(t)}};var r=function(t){for(var n={},i=0,r=e.statCodes_,a=0;a<r.length;a++){var o=r[a],s=e.statData(o).get(t),l=null==s?void 0:s.value;if(null==l||isNaN(l)){if(e.showOnlyWhenComplete())return}else n[o]=l,i+=l}if(e.pieTotalCode_){var c=e.statData(e.pieTotalCode_).get(t),u=null==c?void 0:c.value;i=null==u||isNaN(u)?0:u}if(i&&!isNaN(i)){var h,f=Yx(r);try{for(f.s();!(h=f.n()).done;){var p=h.value;void 0!==n[p]&&(n[p]/=i)}}catch(t){f.e(t)}finally{f.f()}if(e.pieTotalCode_){var d=Object.values(n).reduce((function(t,e){return t+e}),0);n.other=Math.max(0,1-d)}return n}};var a=function(t){var n,i=0;if(e.pieTotalCode_)!(n=e.statData(e.pieTotalCode_).get(t))||0!=n.value&&!n.value||isNaN(n.value)?e.showOnlyWhenComplete()&&(i=void 0):i=n.value;else for(var r=0;r<e.statCodes_.length;r++){var a=e.statCodes_[r];if(!(n=e.statData(a).get(t))||0!=n.value&&!n.value||isNaN(n.value)){if(e.showOnlyWhenComplete())return}else i+=n.value}if(0!=i)return i};e.getLegendConstructor=function(){return Jx};var o=150,s=120,l=Math.min(o,s)/2-10,c=Ux().sort(null).value((function(t){return t.value})),u=Dr().innerRadius(0).outerRadius(.8*l),h=Dr().innerRadius(.9*l).outerRadius(.9*l);return e.tooltip_.textFunction=function(t,n){var i=t.properties.na||t.properties.name,f=t.properties.id,p=r(f),d=[];for(var g in p)d.push({code:g,value:p[g]});var _="";if(_+='<div class="em-tooltip-bar">'.concat(i).concat(f?" (".concat(f,")"):"","</div>"),!d||0===d.length)return _+="<div>".concat(e.noDataText(),"</div>");var m,v="",y="",x="",b=Yx(c(d));try{for(b.s();!(m=b.n()).done;){var w=m.value,S=e.catColors()[w.data.code]||"lightgray",M=u(w);if(v+='<path d="'.concat(M,'" fill="').concat(S,'" stroke="white" stroke-width="1" opacity="0.7"></path>'),w.data.value>.1){var E=u.centroid(w),C=h.centroid(w),A=h.centroid(w),k=w.startAngle+(w.endAngle-w.startAngle)/2;A[0]=.95*l*(k<Math.PI?1:-1),y+='<polyline points="'.concat(E.join(",")," ").concat(C.join(",")," ").concat(A.join(","),'"\n stroke="black" fill="none" stroke-width="1" />');var T=h.centroid(w);T[0]=.99*l*(k<Math.PI?1:-1);var P=k<Math.PI?"start":"end",N=(100*w.data.value).toFixed();isNaN(N)||(x+='<text x="'.concat(T[0],'" y="').concat(T[1],'" text-anchor="').concat(P,'" font-size="12px">\n ').concat(N,"%\n </text>"))}}}catch(t){b.e(t)}finally{b.f()}_+="\n <div class='em-tooltip-piechart-container'>\n <svg viewBox=\"".concat(-75," ").concat(-60," ").concat(o," ").concat(s,'" width="').concat(o,'" height="').concat(115,'">\n <g transform="translate(0,0)">\n ').concat(v,"\n ").concat(y,"\n ").concat(x,"\n </g>\n </svg>\n </div>\n "),_+='<div class="em-tooltip-breakdown">';var L,F=e.statCodes_.map((function(t){var n=e.statData(t).get(f);return n&&void 0!==n.value&&null!==n.value?{code:t,label:e.catLabels_[t],value:n.value,color:e.catColors()[t]||"#666"}:null})).filter(Boolean).sort((function(t,e){return e.value-t.value})),O=a(f)||F.reduce((function(t,e){return t+e.value}),0),G=Yx(F);try{for(G.s();!(L=G.n()).done;){var D,z=L.value,I=O?(z.value/O*100).toFixed(0):0;_+='\n <div class="em-breakdown-item">\n <span class="em-breakdown-color" style="background:'.concat(z.color,'"></span>\n <span class="em-breakdown-label">').concat(z.label,'</span>\n <span class="em-breakdown-value">').concat(null!==(D=z.value)&&void 0!==D&&D.toFixed?la(z.value):0," (").concat(isNaN(I)?0:I,"%)</span>\n </div>\n ")}}catch(t){G.e(t)}finally{G.f()}if(null!=O){var R=e.statData(e.statCodes_[0]).unitText()||"";_+='\n <div class="em-breakdown-item em-total">\n <span class="em-breakdown-label">Total</span>\n <span class="em-breakdown-value">'.concat(la(O)," ").concat(R,"</span>\n </div>\n ")}return _+="</div>"},e};function Zx(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Qx(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Zx(Object(n),!0).forEach((function(e){ma(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zx(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var tb=function(t){var e=sx(t,!0,"spark");e.sparkLineColor_="black",e.sparkAreaColor_="#41afaa",e.sparkLineWidth_=30,e.sparkLineHeight_=20,e.sparkLineStrokeWidth_=.4,e.sparkLineOpacity_=.6,e.sparkType_="line",e.sparkLineCircleRadius_=0,e.sparkTooltipChart_={width:100,height:50,margin:{left:60,right:40,top:40,bottom:40},circleRadius:1.5},e.showOnlyWhenComplete_=!1,e.sparkLineChartFunction_=void 0,e.statSpark_=null,e.sparkHeightClassifier_=null,["sparkLineColor_","showOnlyWhenComplete_","sparkType_","sparkLineWidth_","sparkLineHeight_","sparkLineStrokeWidth_","sparkLineOpacity_","sparkLineCircleRadius_","sparkLineAreaColor_","sparkTooltipChart_","sparkLineChartFunction_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),t&&["sparkLineColor","showOnlyWhenComplete","sparkType","sparkLineWidth","sparkLineHeight","sparkLineStrokeWidth","sparkLineOpacity","sparkLineCircleRadius_","sparkLineAreaColor","sparkTooltipChart_","sparkLineChartFunction_"].forEach((function(n){null!=t[n]&&e[n](t[n])})),e.sparklineData_=void 0,e.sparklineData=function(t){var n=Object.keys(t[Object.keys(t)[0]]);return e._statDates=n,n.forEach((function(n){var i=av(),r={};for(var a in t){var o=t[a];r[a]=o[n]}i.setData(r),e.statData(n,i)})),e},e.statSpark=function(t,n,i){t.filters=t.filters||{};for(var r=0;r<n.length;r++){var a=n[r];t.filters.time=a;var o={};for(var s in t)o[s]=t[s];for(var l in o.filters={},t.filters)o.filters[l]=t.filters[l];e.stat(a,o),i&&(e.catLabels_=e.catLabels_||{},e.catLabels_[a]=i[r])}return e._statDates=n,e},e._statDates=void 0;var n=function(t){for(var n=[],i=0,r=0;r<e._statDates.length;r++){var a=e._statDates[r],o=e.statData(a).get(t);if(!o||0!=o.value&&!o.value||isNaN(o.value)){if(e.showOnlyWhenComplete())return}else n.push({date:a,value:o.value}),i+=o.value}if(0!=i){for(var s=1;s<n.length;s++){var l=n[s-1].value,c=n[s].value;n[s].percentageChange=0===l?.001:(c-l)/l*100}return n}};function i(t,n,r,a){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(e.sparkLineChartFunction_&&e.sparkLineChartFunction_!==i)return e.sparkLineChartFunction_(t,n,r,a,o);var s=En().domain([0,e._statDates.length-1]).range([.5,r-.5]),l=Ot(n.map((function(t){return t.value})))||0,c=Gt(n.map((function(t){return t.value})))||1,u=En().domain([l,c]).range([a,0]),h=n.map((function(t,e){return Qx(Qx({},t),{},{scaledXValue:s(e),scaledYValue:u(t.value)})})),f=u(0);o&&(t.append("g").attr("class","axis-x").attr("transform","translate(0, ".concat(a,")")).call(Ev(s).ticks(e._statDates.length).tickFormat((function(t,n){return e._statDates[n]}))).selectAll("text").style("text-anchor","end").attr("dx","-.8em").attr("dy",".15em").attr("transform","rotate(-65)"),t.append("g").attr("class","axis-y").call(Cv(u).ticks(5)),l<0&&c>0&&t.append("line").attr("x1",0).attr("x2",r).attr("y1",f).attr("y2",f).attr("stroke","gray").attr("stroke-dasharray","2,2").attr("stroke-width",1));var p=Ox().x((function(t){return t.scaledXValue})).y((function(t){return t.scaledYValue}));"area"===e.sparkType_&&t.append("path").datum(h).attr("fill","function"==typeof e.sparkAreaColor_?function(t,n){return e.sparkAreaColor_(t,n)}:e.sparkAreaColor_).attr("stroke","none").attr("opacity",e.sparkLineOpacity_).attr("fill-opacity",.3).attr("d",function(t,e,n){var i=null,r=ur(!0),a=null,o=Nx,s=null,l=Tr(c);function c(c){var u,h,f,p,d,g=(c=Tx(c)).length,_=!1,m=new Array(g),v=new Array(g);for(null==a&&(s=o(d=l())),u=0;u<=g;++u){if(!(u<g&&r(p=c[u],u,c))===_)if(_=!_)h=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=h;--f)s.point(m[f],v[f]);s.lineEnd(),s.areaEnd()}_&&(m[u]=+t(p,u,c),v[u]=+e(p,u,c),s.point(i?+i(p,u,c):m[u],n?+n(p,u,c):v[u]))}if(d)return s=null,d+""||null}function u(){return Ox().defined(r).curve(o).context(a)}return t="function"==typeof t?t:void 0===t?Lx:ur(+t),e="function"==typeof e?e:ur(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?Fx:ur(+n),c.x=function(e){return arguments.length?(t="function"==typeof e?e:ur(+e),i=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:ur(+e),c):t},c.x1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:ur(+t),c):i},c.y=function(t){return arguments.length?(e="function"==typeof t?t:ur(+t),n=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:ur(+t),c):e},c.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:ur(+t),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(i).y(e)},c.defined=function(t){return arguments.length?(r="function"==typeof t?t:ur(!!t),c):r},c.curve=function(t){return arguments.length?(o=t,null!=a&&(s=o(a)),c):o},c.context=function(t){return arguments.length?(null==t?a=s=null:s=o(a=t),c):a},c}().x((function(t){return t.scaledXValue})).y0(f).y1((function(t){return t.scaledYValue}))),t.append("path").datum(h).attr("fill","none").attr("opacity",e.sparkLineOpacity_).attr("stroke","function"==typeof e.sparkLineColor_?function(t,n){return e.sparkLineColor_(t,n)}:e.sparkLineColor_).attr("stroke-width","function"==typeof e.sparkLineStrokeWidth_?function(t,n){return e.sparkLineStrokeWidth_(t,n)}:e.sparkLineStrokeWidth_+"px").attr("d",p),t.selectAll("circle").data(h).enter().append("circle").attr("cx",(function(t){return t.scaledXValue})).attr("cy",(function(t){return t.scaledYValue})).attr("r",e.sparkLineCircleRadius_).attr("fill","red").attr("stroke","none")}e.updateClassification=function(){if(!e._statDates){e._statDates=Object.keys(e.statData_);var t=e._statDates.indexOf("default");t>-1&&e._statDates.splice(t,1)}return e.domain=function(){var t=[];if(e.getCentroidsGroup(e).selectAll("g.em-centroid").data().forEach((function(e){var n=e.properties.id,i=r(n);void 0!==i&&t.push(i)})),0===t.length)return[0,1];return Zv(t)}(),e.widthClassifier_=Kv().domain(e.domain).range([0,e.sparkLineWidth_]),e.heightClassifier_=Kv().domain(e.domain).range([0,e.sparkLineHeight_]),e},e.updateStyle=function(){var t=[],r=(e.getCentroidsGroup(e).selectAll("g.em-centroid").attr("id",(function(e){return t.push(e.properties.id),"spark_"+e.properties.id})),pa(e));return e.svg().selectAll(r).on("mouseover",(function(t,i){if(n(i.properties.id)){var r=Ft(this);r.attr("fill___",r.style("fill")),r.style("fill",e.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(i,e))}})).on("mousemove",(function(t,i){n(i.properties.id)&&e._tooltip&&e._tooltip.mousemove(t)})).on("mouseout",(function(){var t=Ft(this);t.style("fill");t.attr("fill___")&&(t.style("fill",t.attr("fill___")),e._tooltip&&e._tooltip.mouseout())})),t.forEach((function(t){var r=e.svg().select("#spark_"+t),a=n(t);a&&i(r,a,e.sparkLineWidth_,e.sparkLineHeight_)})),e},e.tooltip_.textFunction=function(t,r){var a=[],o=t.properties.na,s=t.properties.id;a.push('\n <div class="em-tooltip-bar">\n <b>'.concat(o,"</b>").concat(s?" (".concat(s,")"):"","\n </div>\n "));var l,c=e.sparkTooltipChart_.height,u=e.sparkTooltipChart_.width,h=e.sparkTooltipChart_.margin,f=n(t.properties.id);if(f){var p=u+h.left+h.right,d=c+h.top+h.bottom,g=(l="div",Ft(yt(l).call(document.documentElement))).attr("class","em-tooltip-chart-container");i(g.append("svg").attr("class","em-tooltip-chart-svg").attr("width",p).attr("height",d).append("g").attr("transform","translate(".concat(h.left,", ").concat(h.top,")")),f,u,c,!0),a.push(g.node().outerHTML)}return a.join("")};var r=function(t){for(var n=0,i=0;i<e._statDates.length;i++){var r=e._statDates[i],a=e.statData(r);if(a&&"function"==typeof a.get){var o=a.get(t);if(!o||0!==o.value&&!o.value||isNaN(o.value)){if(e.showOnlyWhenComplete())return}else o.value>n&&(n=o.value)}}if(0!==n)return n};return e.getLegendConstructor=function(){return Bv},e},eb=function(t,e){var n=ax(t);if(n.flowWidthLegend={title:null,titlePadding:17,values:null,marginTop:5},n.donutSizeLegend={title:null,titlePadding:25,values:null,marginTop:20},n.flowColorLegend={title:null,titlePadding:0,marginTop:33},n.regionColorLegend={title:null,titlePadding:15,marginTop:30},e)for(var i in e)if("colorLegend"==i||"flowWidthLegend"==i||"donutSizeLegend"==i||"flowColorLegend"==i||"regionColorLegend"==i){for(var r in n[i])void 0!==e[i][r]&&(n[i][r]=e[i][r]);0==e.colorLegend&&(n.colorLegend=!1)}else n[i]=e[i];return n.update=function(){n.updateConfig(),n.updateContainer();var t=n.map,e=n.lgg;if(t.legend_)for(var i in t.legend_)if("colorLegend"==i||"flowWidthLegend"==i||"donutSizeLegend"==i||"flowColorLegend"==i||"regionColorLegend"==i)for(var r in n[i])void 0!==t.legend_[i][r]&&(n[i][r]=t.legend_[i][r]);else n[i]=t.legend_[i];e.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle(),function(t){var e=t.map,n=t.getBaseX(),i=t.getBaseY();!function(t,e,n){var i=t.map;if(!i.strokeWidthScale)return;t._flowWidthContainer=t.lgg.append("g").attr("class","em-flow-width-legend").attr("transform","translate(".concat(e,", ").concat(n,")")),t.flowWidthLegend.title&&t._flowWidthContainer.append("text").attr("class","em-size-legend-title").text(t.flowWidthLegend.title||"Flow width");var r=i.strokeWidthScale,a=r.domain(),o=t.flowWidthLegend.values||[a[0],a[a.length-1]],s=t.flowWidthLegend.titlePadding||10,l=7,c=0;o.forEach((function(e,n){var i=r(e);if(n>0){var a=r(o[n-1]);s+=a/2+i/n+l}t._flowWidthContainer.append("line").attr("x1",c).attr("x2",c+40).attr("y1",s).attr("y2",s).attr("stroke","#6b6b6b").attr("stroke-width",i),t._flowWidthContainer.append("text").attr("x",c+50).attr("y",s).attr("dy","0.35em").attr("class","em-legend-label").text(la(e))}))}(t,n,i+t.flowWidthLegend.marginTop);var r=t._flowWidthContainer.node().getBBox().height;if(e.flowDonuts_&&e.donutSizeScale){t._donutLegendContainer=t.lgg.append("g").attr("class","em-donut-legend").attr("transform","translate(".concat(n,", ").concat(i+r,")")),t._donutSizeContainer=t._donutLegendContainer.append("g").attr("class","em-donut-size-legend").attr("transform","translate(".concat(0,", ",t.donutSizeLegend.marginTop,")")),$y(t,t._donutSizeContainer,t.donutSizeLegend.values,e.donutSizeScale,t.donutSizeLegend.title,t.donutSizeLegend.titlePadding);var a=t.donutSizeLegend.marginTop+t._donutSizeContainer.node().getBBox().height+t.flowColorLegend.marginTop;!function(t,e,n){var i,r=t.map,a=Array.from(r.topLocationKeys||[]),o=r.locationColorScale;null===(i=t._donutColorContainer)||void 0===i||i.remove(),t._donutColorContainer=t._donutLegendContainer.append("g").attr("class","em-donut-color-legend").attr("transform","translate(".concat(e,", ").concat(n,")"));var s=t._donutColorContainer.append("text").attr("class","em-color-legend-title").attr("id","em-color-legend-title").attr("dy","0.35em").text(t.flowColorLegend.title||"Destination"),l=a.map((function(t){return{label:r.nodeNameMap.get(t)||t,color:o(t)}}));l.push({label:"Other",color:"#ccc"});var c=s.node().getBBox().height+t.flowColorLegend.titlePadding,u=function(t){r.svg_.selectAll("g.em-flow-container line").classed("highlighted",(function(){return this.getAttribute("stroke")===t})).classed("dimmed",(function(){return this.getAttribute("stroke")!==t}))},h=function(){r.svg_.selectAll("g.em-flow-container line").classed("highlighted",!1).classed("dimmed",!1)};l.forEach((function(e,n){var i=t._donutColorContainer.append("g").attr("class","em-donut-color-item").attr("transform","translate(0, ".concat(22*n+c,")")).style("cursor","pointer").on("mouseover",(function(){u(e.color),Ft(this).select("text").style("font-weight","bold"),Ft(this).select("rect").attr("stroke","black").attr("stroke-width",2)})).on("mouseout",(function(){h(),Ft(this).select("text").style("font-weight","normal"),Ft(this).select("rect").attr("stroke","none")}));i.append("rect").attr("width",18).attr("height",18).attr("fill",e.color),i.append("text").attr("x",25).attr("y",14).attr("class","em-legend-label").text(e.label)}))}(t,0,a)}if(e.importerRegionIds.length>0||e.exporterRegionIds.length>0){var o=i+t.flowWidthLegend.marginTop+r+t.regionColorLegend.marginTop;e.flowDonuts_&&e.donutSizeScale&&(o+=t.donutSizeLegend.marginTop,o+=t._donutLegendContainer.node().getBBox().height),function(t,e,n){t._colorLegendContainer||(t._colorLegendContainer=t.lgg.append("g").attr("class","em-color-legend").attr("transform","translate(".concat(e,", ").concat(n,")")));var i=t._colorLegendContainer.append("g").attr("class","em-flow-overlay-color-legend"),r=(i.append("text").attr("class","em-color-legend-title").attr("id","em-color-legend-title").attr("dy","0.35em").text(t.regionColorLegend.title||"Region fill colors"),t.map),a={"Net Exporter":r.flowOverlayColors_[0],"Net Importer":r.flowOverlayColors_[1]},o=t.regionColorLegend.titlePadding;Object.entries(a).forEach((function(e,n){var r=v(e,2),a=r[0],s=r[1];i.append("rect").attr("x",0).attr("y",o+20*n).attr("width",t.shapeWidth).attr("height",t.shapeHeight).attr("fill",s),i.append("text").attr("x",t.shapeWidth+5).attr("y",o+20*n+15).attr("class","em-legend-label").text(a)}))}(t,n,o)}}(n),n.setBoxDimension()},n};class nb{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}function ib(t){return new nb(t,!0)}function rb(t){return t.source}function ab(t){return t.target}function ob(t){let e=rb,n=ab,i=Lx,r=Fx,a=null,o=null,s=Tr(l);function l(){let l;const c=kx.call(arguments),u=e.apply(this,c),h=n.apply(this,c);if(null==a&&(o=t(l=s())),o.lineStart(),c[0]=u,o.point(+i.apply(this,c),+r.apply(this,c)),c[0]=h,o.point(+i.apply(this,c),+r.apply(this,c)),o.lineEnd(),l)return o=null,l+""||null}return l.source=function(t){return arguments.length?(e=t,l):e},l.target=function(t){return arguments.length?(n=t,l):n},l.x=function(t){return arguments.length?(i="function"==typeof t?t:ur(+t),l):i},l.y=function(t){return arguments.length?(r="function"==typeof t?t:ur(+t),l):r},l.context=function(e){return arguments.length?(null==e?a=o=null:o=t(a=e),l):a},l}function sb(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let i=-1;for(let r of t)(r=+e(r,++i,t))&&(n+=r)}return n}function lb(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return cb(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cb(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function cb(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function ub(t,e){var n=t.svg_,i=(t.flowGraph_,function(t){var e=t.flowGraph_;return function(t){var e,n=t.nodes,i=lb(n);try{for(i.s();!(e=i.n()).done;){var r=e.value;r.value=Math.max(sb(r.sourceLinks,(function(t){return t.value})),sb(r.targetLinks,(function(t){return t.value})))}}catch(t){i.e(t)}finally{i.f()}}(e),function(t){var e=t.nodes,n=e.length,i=new Set(e),r=new Set,a=0;for(;i.size;){var o,s=lb(i);try{for(s.s();!(o=s.n()).done;){var l=o.value;l.depth=a;var c,u=lb(l.sourceLinks);try{for(u.s();!(c=u.n()).done;){var h=c.value.target;r.add(h)}}catch(t){u.e(t)}finally{u.f()}}}catch(t){s.e(t)}finally{s.f()}if(++a>n)throw new Error("circular link");i=r,r=new Set}}(e),function(t){var e=t.nodes,n=e.length,i=new Set(e),r=new Set,a=0;for(;i.size;){var o,s=lb(i);try{for(s.s();!(o=s.n()).done;){var l=o.value;l.height=a;var c,u=lb(l.targetLinks);try{for(u.s();!(c=u.n()).done;){var h=c.value.source;r.add(h)}}catch(t){u.e(t)}finally{u.f()}}}catch(t){s.e(t)}finally{s.f()}if(++a>n)throw new Error("circular link");i=r,r=new Set}}(e),function(t,e){var n,i=e.nodes,r=lb(i);try{for(r.s();!(n=r.n()).done;){var a=n.value;a.sourceLinks.forEach((function(e){return e.width=t.strokeWidthScale(e.value)})),a.targetLinks.forEach((function(e){return e.width=t.strokeWidthScale(e.value)}));var o=Math.max(sb(a.sourceLinks,(function(t){return t.width})),sb(a.targetLinks,(function(t){return t.width})));a.x0=a.x1=a.x,a.y0=a.y-o/2,a.y1=a.y+o/2}}catch(t){r.e(t)}finally{r.f()}!function(t){var e,n=lb(t);try{for(n.s();!(e=n.n()).done;){var i=e.value,r=i.sourceLinks,a=i.targetLinks;r.sort(db),a.sort(gb)}}catch(t){n.e(t)}finally{n.f()}}(i)}(t,e),function(t){var e,n=t.nodes,i=lb(n);try{for(i.s();!(e=i.n()).done;){var r,a=e.value,o=a.y0,s=lb(a.sourceLinks);try{for(s.s();!(r=s.n()).done;){var l=r.value;l.y0=o+l.width/2,o+=l.width}}catch(t){s.e(t)}finally{s.f()}var c,u=a.y0,h=lb(a.targetLinks);try{for(h.s();!(c=h.n()).done;){var f=c.value;f.y1=u+f.width/2,u+=f.width}}catch(t){h.e(t)}finally{h.f()}}}catch(t){i.e(t)}finally{i.f()}}(e),e}(t)),r=i.nodes,a=i.links;t.flowStack_||a.forEach((function(t){var e=(t.source.y0+t.source.y1)/2;t.y0=e}));var o=n.append("defs"),s=ca("arrow"),l=ca("arrow-outline"),c=a.map((function(){return ca("gradient")}));return t.flowArrows_&&(hb(t,o,s,t.flowColor_),hb(t,o,l,"#ffffff")),t.flowGradient_&&function(t,e,n,i){var r=i.filter((function(t){var e,n;return null!=(null===(e=t.source)||void 0===e?void 0:e.x1)&&null!=(null===(n=t.target)||void 0===n?void 0:n.x0)&&null!=t.y0&&null!=t.y1}));e.selectAll("linearGradient").data(r).join("linearGradient").attr("id",(function(t,e){return n[e]})).attr("gradientUnits","userSpaceOnUse").attr("x1",(function(t){return t.source.x1})).attr("x2",(function(t){return t.target.x0})).attr("y1",(function(t){return t.y0})).attr("y2",(function(t){return t.y1})).call((function(e){return e.append("stop").attr("offset","5%").attr("stop-color",t.flowOverlayColors_[0])})).call((function(e){return e.append("stop").attr("offset","50%").attr("stop-color",t.flowColor_)}))}(t,o,c,a),function(t,e,n,i,r,a){var o=e.append("g").attr("class","em-flow-lines").attr("id","em-flow-lines");n.forEach((function(e,n){t.flowOutlines_&&o.append("path").attr("d",_b()(e)).attr("fill","none").attr("stroke","#ffffff").attr("class","em-flow-link-outline").attr("stroke-width",e.width+1.5).attr("marker-end","url(#".concat(r,")")),o.append("path").attr("d",_b()(e)).attr("fill","none").attr("class","em-flow-link").attr("stroke",t.flowGradient_?"url(#".concat(a[n],")"):t.flowColor_).attr("stroke-width",e.width).attr("marker-end",t.flowArrows_?"url(#".concat(i,")"):"").on("mouseover",(function(n){var r=t.hoverColor_;Ft(this).attr("stroke",r),t.flowArrows_&&Ft(this).attr("marker-end","url(#".concat(i+"mouseover",")")),t._tooltip&&t._tooltip.mouseover(t.tooltip_.textFunction(e,t))})).on("mousemove",(function(e){t._tooltip&&t._tooltip.mousemove(e)})).on("mouseout",(function(){t.flowGradient_?Ft(this).attr("stroke","url(#".concat(a[n],")")):Ft(this).attr("stroke",t.flowColor_),t.flowArrows_&&Ft(this).attr("marker-end","url(#".concat(i,")")),t._tooltip&&t._tooltip.mouseout()}))}))}(t,e,a,s,l,c),function(t,e,n){e.append("g").attr("class","em-flow-fill-in-gaps").selectAll("rect").data(n).join("rect").filter((function(t){return t.depth&&t.height})).attr("x",(function(t){return t.x0-.5})).attr("y",(function(t){return t.y0})).attr("width",1).attr("height",(function(t){return t.y1-t.y0})).attr("fill",t.flowColor_)}(t,e,r),n.node()}function hb(t,e,n,i){e.append("marker").attr("id",n).attr("markerHeight",7).attr("markerWidth",7).attr("refX",.5).attr("refY",1.5).attr("orient","auto").append("path").attr("fill",i).attr("d","M0,0 q0,1,0.5,1.5 q-0.5,0.5,-0.5,1.5 q0.75,-0.75,2,-1.5 q-1.25,-0.75,-2,-1.5Z"),e.append("marker").attr("id",n+"mouseover").attr("markerHeight",7).attr("markerWidth",7).attr("refX",.5).attr("refY",1.5).attr("orient","auto").append("path").attr("fill",t.hoverColor_).attr("d","M0,0 q0,1,0.5,1.5 q-0.5,0.5,-0.5,1.5 q0.75,-0.75,2,-1.5 q-1.25,-0.75,-2,-1.5Z")}function fb(t){return[t.source.x1,t.y0]}function pb(t){return[t.target.x0,t.y1]}var db=function(t,e){return t.target.y-e.target.y},gb=function(t,e){return t.source.y-e.source.y},_b=function(){return ob(ib).source(fb).target(pb)};function mb(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return vb(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vb(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function vb(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function yb(t,e){!function(t,e){var n=e.append("g").attr("class","em-flow-lines").attr("id","em-flow-lines"),i=t.flowGraph_,r=i.nodes,a=i.links,o=new Map(r.map((function(t){return[t.id,[t.x,t.y]]}))),s=new Map;a.forEach((function(t){var e="object"===ga(t.source)?t.source.id:t.source,n="object"===ga(t.target)?t.target.id:t.target,i=o.get(e),r=o.get(n);if(i&&r){var a=e<n?"".concat(e,"|").concat(n):"".concat(n,"|").concat(e);s.has(a)||s.set(a,{idA:e<n?e:n,idB:e<n?n:e,coordsA:e<n?i:r,coordsB:e<n?r:i,flowAB:0,flowBA:0});var l=s.get(a);e<n?l.flowAB+=t.value:l.flowBA+=t.value}}));var l,c=mb(s.values());try{var u=function(){var e=l.value,i=e.idA,r=e.idB,a=e.coordsA,o=e.coordsB,s=e.flowAB,c=e.flowBA,u=(a[0]+o[0])/2,g=(a[1]+o[1])/2,_=function(){return h(t,i,r)},m=function(){return h(t,r,i)};s>0&&c>0?(n.append("line").attr("data-nb",s).attr("x1",u).attr("y1",g).attr("x2",o[0]).attr("y2",o[1]).attr("data-origin",i).attr("data-dest",r).attr("stroke",_).attr("stroke-width",t.strokeWidthScale(s).toFixed(1)).attr("stroke-opacity",t.flowOpacity_).style("cursor","pointer").on("mouseover",f(t,i,r,s)).on("mousemove",p(t)).on("mouseout",d(t,_)),n.append("line").attr("data-nb",c).attr("x1",u).attr("y1",g).attr("x2",a[0]).attr("y2",a[1]).attr("data-origin",r).attr("data-dest",i).attr("stroke",m).attr("stroke-width",t.strokeWidthScale(c).toFixed(1)).attr("stroke-opacity",t.flowOpacity_).style("cursor","pointer").on("mouseover",f(t,r,i,c)).on("mousemove",p(t)).on("mouseout",d(t,m))):s>0&&0===c?n.append("line").attr("data-nb",s).attr("x1",a[0]).attr("y1",a[1]).attr("x2",o[0]).attr("y2",o[1]).attr("data-origin",i).attr("data-dest",r).attr("stroke",_).attr("stroke-width",t.strokeWidthScale(s).toFixed(1)).attr("stroke-opacity",t.flowOpacity_).style("cursor","pointer").on("mouseover",f(t,i,r,s)).on("mousemove",p(t)).on("mouseout",d(t,_)):c>0&&0===s&&n.append("line").attr("data-nb",c).attr("x1",o[0]).attr("y1",o[1]).attr("x2",a[0]).attr("y2",a[1]).attr("data-origin",r).attr("data-dest",i).attr("stroke",m).attr("stroke-width",t.strokeWidthScale(c).toFixed(1)).attr("stroke-opacity",t.flowOpacity_).style("cursor","pointer").on("mouseover",f(t,r,i,c)).on("mousemove",p(t)).on("mouseout",d(t,m))};for(c.s();!(l=c.n()).done;)u()}catch(t){c.e(t)}finally{c.f()}function h(t,e,n,i){if(!t.topLocationKeys||!t.flowTopLocations_)return t.flowColor_;var r=t.flowTopLocationsType_||"sum";return"origin"===r?t.topLocationKeys.has(e)?t.locationColorScale(e):t.flowColor_:"destination"===r?t.topLocationKeys.has(n)?t.locationColorScale(n):t.flowColor_:t.topLocationKeys.has(n)?t.locationColorScale(n):t.topLocationKeys.has(e)?t.locationColorScale(e):t.flowColor_}function f(t,e,n,i){return function(r){var a=t.hoverColor_||"black";if(Ft(this).attr("stroke",a),t._tooltip){var o=t.flowGraph_.nodes.find((function(t){return t.id===e})),s=t.flowGraph_.nodes.find((function(t){return t.id===n})),l={source:o,target:s,value:i};t._tooltip.mouseover(t.tooltip_.textFunction(l,t))}}}function p(t){return function(e){t._tooltip&&t._tooltip.mousemove(e)}}function d(t,e){return function(){Ft(this).attr("stroke",e()),t._tooltip&&t._tooltip.mouseout()}}}(t,e)}function xb(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return bb(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bb(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function bb(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function wb(t,e){var n=e.data.parent.id;va("g.em-flow-container line").classed("highlighted",(function(){return this.getAttribute("data-origin")===n||this.getAttribute("data-dest")===n})).classed("dimmed",(function(){return this.getAttribute("data-origin")!==n&&this.getAttribute("data-dest")!==n}))}function Sb(t){va("g.em-flow-container line").classed("highlighted",!1).classed("dimmed",!1)}function Mb(t,e){var n,i,r=mn(".0%"),a=t.data.parent,o=sb(a.donutValues,(function(t){return t.value})),s=null===(n=e.statData)||void 0===n?void 0:n.call(e),l=(null==s||null===(i=s.unitText)||void 0===i?void 0:i.call(s))||"",c=[];c.push('\n <div class="em-tooltip-bar">\n <b>'.concat(a.name||a.id||"Unknown location","</b>\n </div>\n ")),c.push('<div class="em-tooltip-text"><table class="em-tooltip-table"><tbody>');var u=Ab(a.id,e),h=sb(u,(function(t){return t.value}));if(h>0){var f=r(h/o);c.push('\n <tr><td style="padding-top:3px;">Incoming:</td>\n <td>'.concat(la(h)," (").concat(f,")</td>\n </tr>\n ")),u.forEach((function(t){var e=r(t.value/o);c.push('\n <tr>\n <td style="padding-left:1.5em;">\n <span style="\n display:inline-block;\n width:10px;\n height:10px;\n border-radius:50%;\n background:'.concat(t.color,';\n margin-right:6px;\n "></span> ').concat(t.name||t.key,'\n </td>\n <td style="text-align:right">\n ').concat(la(t.value)," (").concat(e,")\n </td>\n </tr>\n "))}))}var p=kb(a.id,e),d=sb(p,(function(t){return t.value}));if(d>0){var g=r(d/o);c.push('\n <tr><td style="padding-top:3px;">Outgoing:</td>\n <td>'.concat(la(d)," (").concat(g,")</td>\n </tr>\n ")),p.forEach((function(t){var e=r(t.value/o);c.push('\n <tr>\n <td style="padding-left:1.5em;">\n <span style="\n display:inline-block;\n width:10px;\n height:10px;\n border-radius:50%;\n background:'.concat(t.color,';\n margin-right:6px;\n "></span> ').concat(t.name||t.key,'\n </td>\n <td style="text-align:right">\n ').concat(la(t.value)," (").concat(e,")\n </td>\n </tr>\n "))}))}return c.push('\n <tr class="em-tooltip-total">\n <td colspan="2" style="padding-top:4px; font-weight:bold;">\n Total: '.concat(la(o)," ").concat(l,"\n </td>\n </tr>\n ")),c.push("</tbody></table></div>"),c.join("")}var Eb=function(t,e){var n=+e.attr("data-zoom")||1;Ft(t.target.parentNode).selectAll("path").each((function(){var t=Ft(this),e=+t.attr("stroke-width")||0;t.attr("data-stroke-width",e)})).attr("stroke","black").attr("stroke-width",2/n)},Cb=function(t,e){var n=+e.attr("data-zoom")||1;Ft(t.target.parentNode).selectAll("path").attr("stroke","white").attr("stroke-width",(function(){return(+Ft(this).attr("data-stroke-width")||0)/n}))};function Ab(t,e){var n,i=e.topLocationKeys,r=e.flowTopLocationsType_,a=e.flowInternal_,o={},s=xb(e.flowGraph_.links);try{for(s.s();!(n=s.n()).done;){var l=n.value,c=l.source.id,u=l.target.id;if(u===t)if(c!==u){var h=void 0;o[h="destination"===r?t:"origin"===r?i.has(c)?c:"Other":i.has(c)||i.has(t)?i.has(c)?c:t:"Other"]=(o[h]||0)+l.value}else a&&(o.Internal=(o.Internal||0)+l.value)}}catch(t){s.e(t)}finally{s.f()}return Tb(Object.entries(o).map((function(n){var i,r=v(n,2),a=r[0],o=r[1];return{key:a,name:(null===(i=e.nodeNameMap)||void 0===i?void 0:i.get(a))||a,value:o,color:Pb(a,t,e)}})))}function kb(t,e){var n,i=e.topLocationKeys,r=e.flowTopLocationsType_,a=e.flowInternal_,o={},s=xb(e.flowGraph_.links);try{for(s.s();!(n=s.n()).done;){var l=n.value,c=l.source.id,u=l.target.id;if(c===t)if(c!==u){var h=void 0;o[h="origin"===r?t:"destination"===r?i.has(u)?u:"Other":i.has(u)||i.has(t)?i.has(u)?u:t:"Other"]=(o[h]||0)+l.value}else a&&(o.Internal=(o.Internal||0)+l.value)}}catch(t){s.e(t)}finally{s.f()}return Tb(Object.entries(o).map((function(n){var i,r=v(n,2),a=r[0],o=r[1];return{key:a,name:(null===(i=e.nodeNameMap)||void 0===i?void 0:i.get(a))||a,value:o,color:Pb(a,t,e)}})))}function Tb(t){return t.sort((function(t,e){return"Other"===t.key?1:"Other"===e.key?-1:e.value-t.value}))}function Pb(t,e,n){var i=n.topLocationKeys||new Set,r=n.locationColorScale;return"Other"===t?"#666":"Internal"===t?i.has(e)?r(e):"#999":i.has(t)?r(t):"#666"}function Nb(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Lb(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lb(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function Lb(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}var Fb=function(t){var e=sx(t,!0,"flow");return e.strokeWidthScale=En(),e.labelFormatter=function(t){return mn(".2s")(t)},e.tooltip_.textFunction=Gb,e.flowMapType_="sankey",e.flowDonuts_=!1,e.flowColor_="#848484ff",e.flowOverlayColors_=["#bbd7ee","#c7e3c6"],e.flowMaxWidth_=30,e.flowMinWidth_=1,e.flowArrows_=!0,e.flowOutlines_=!0,e.flowGradient_=!0,e.flowStack_=!1,e.flowLabelOffsets_={x:3,y:0},e.flowOpacity_=.5,e.flowInternal_=!0,e.flowTopLocations_=5,e.flowTopLocationsType_="destination",["flowGraph_","flowColor_","flowOverlayColors_","flowArrows_","flowMaxWidth_","flowMinWidth_","flowOutlines_","flowGradient_","flowStack_","flowDonuts_","flowLabelOffsets_","flowMapType_","flowDonutSizeScale_","flowOpacity_","flowInternal_","flowTopLocations_","flowTopLocationsType_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),e.updateStyle=function(){var t,n=e.flowGraph_.links;e.strokeWidthScale=En().domain([Ot(n,(function(t){return t.value})),Gt(n,(function(t){return t.value}))]).range([e.flowMinWidth_,e.flowMaxWidth_]),e.flowDonuts_&&0==e.flowTopLocations_&&(e.flowTopLocations_=4),function(t){(function(t){t.flowGraph_.nodes.forEach((function(e){if("number"!=typeof e.x||"number"!=typeof e.y)if(t.Geometries.centroidsFeatures){var n=t.Geometries.centroidsFeatures.find((function(t){return e.id==t.properties.id}));if(n){var i=v(n.geometry.coordinates,2),r=i[0],a=i[1];e.x=r,e.y=a}else console.error("could not find coordinates for",e.id)}else{var o,s,l,c=null===(o=(s=t.Geometries).getRegionFeatures)||void 0===o?void 0:o.call(s),u=null==c?void 0:c.find((function(t){return t.properties.id===e.id})),h=v((null==u||null===(l=u.properties)||void 0===l?void 0:l.centroid)||t._pathFunction.centroid(u),2),f=h[0],p=h[1];e.x=f,e.y=p}}))})(t),function(t){var e,n=t.flowGraph_.nodes,i=Nb(n);try{for(i.s();!(e=i.n()).done;){var r=e.value,a=t._projection([r.x,r.y]);r.x=a[0],r.y=a[1]}}catch(t){i.e(t)}finally{i.f()}}(t),function(t){var e=t.flowGraph_,n=e.nodes,i=e.links,r=new Map;i.forEach((function(t){r.set(t.source,(r.get(t.source)||0)+t.value),r.set(t.target,(r.get(t.target)||0)+t.value)})),n.forEach((function(t){t.value=r.get(t.id)||0}))}(t),function(t){var e,n=t.flowGraph_.nodes,i=t.flowGraph_.links,r=function(t){return t.id},a=Nb(n.entries());try{for(a.s();!(e=a.n()).done;){var o=v(e.value,2),s=o[0],l=o[1];l.index=s,l.sourceLinks=[],l.targetLinks=[]}}catch(t){a.e(t)}finally{a.f()}var c,u=new Map(n.map((function(t,e){return[r(t,e,n),t]}))),h=Nb(i.entries());try{for(h.s();!(c=h.n()).done;){var f=v(c.value,2),p=f[0],d=f[1];d.index=p;var g=d.source,_=d.target;"object"!==ga(g)&&(g=d.source=Ob(u,g)),"object"!==ga(_)&&(_=d.target=Ob(u,_)),g.sourceLinks.push(d),_.targetLinks.push(d)}}catch(t){h.e(t)}finally{h.f()}}(t),t.flowTopLocations_&&function(t){var e=t.flowGraph_.nodes,n=t.flowTopLocations_,i=t.flowTopLocationsType_||"sum";e.forEach((function(t){var e=t.sourceLinks.reduce((function(t,e){return t+e.value}),0),n=t.targetLinks.reduce((function(t,e){return t+e.value}),0);t.topScore="origin"===i?e:"destination"===i?n:e+n}));var r=y(e).sort((function(t,e){return e.topScore-t.topScore})).slice(0,n);t.topLocationKeys=new Set(r.map((function(t){return t.id}))),t.locationColorScale=gv().domain(r.map((function(t){return t.id}))).range(["#00B3E3","#FBBA00","#2BA966","#D23142","#005289","#93397F","#E73E11","#4E4084","#056731","#00667E","#B5B900"])}(t);t.nodeNameMap=new Map(t.flowGraph_.nodes.map((function(t){return[t.id,t.name||t.id]})))}(e);var i=Ft("#em-zoom-group-"+e.svgId_).append("g").attr("class","em-flow-container");!function(t){var e=t.flowGraph_,n=[],i=[],r=t.Geometries.getRegionFeatures();if(!r)return;if(e.nodes.forEach((function(t){var e=t.sourceLinks.reduce((function(t,e){return t+e.value}),0),a=t.targetLinks.reduce((function(t,e){return t+e.value}),0);r.find((function(e){return e.properties.id===t.id}))?a>e?n.push(t.id):e>a&&i.push(t.id):console.warn("could not find region geometry for",t.id)})),t.importerRegionIds=n,t.exporterRegionIds=i,0===n.length&&0===i.length)return void console.warn("No importer or exporter regions found in the flow graph.");var a=pa(t),o=t.svg_.selectAll(a);o.each((function(){var e=this.__data__.properties.id;Ft(this).style("fill",(function(){return n.includes(e)?t.flowOverlayColors_[1]:i.includes(e)?t.flowOverlayColors_[0]:null})).attr("class",(function(){return n.includes(e)?"em-flow-importer":i.includes(e)?"em-flow-exporter":null}))}))}(e),"sankey"===e.flowMapType_?ub(e,i):yb(e,i),e.flowDonuts_&&(function(t){var e,n=t.flowGraph_.nodes,i=t.topLocationKeys||new Set,r=(t.locationColorScale,t.flowTopLocationsType_),a=xb(n);try{var o=function(){var n,a=e.value,o=new Map,s=0,l=xb(a.targetLinks);try{for(l.s();!(n=l.n()).done;){var c=n.value,u=c.source.id;if(u!==a.id){var h=void 0;h="origin"===r?i.has(u)?u:"Other":"destination"===r?i.has(a.id)?a.id:"Other":i.has(u)||i.has(a.id)?i.has(a.id)?a.id:u:"Other",o.set(h,(o.get(h)||0)+c.value)}else t.flowInternal_&&(s+=c.value)}}catch(t){l.e(t)}finally{l.f()}var f,p=xb(a.sourceLinks);try{for(p.s();!(f=p.n()).done;){var d=f.value,g=d.target.id;if(g!==a.id){var _=void 0;_="origin"===r?i.has(a.id)?a.id:"Other":"destination"===r?i.has(g)?g:"Other":i.has(g)||i.has(a.id)?i.has(g)?g:a.id:"Other",o.set(_,(o.get(_)||0)+d.value)}else t.flowInternal_&&(s+=d.value)}}catch(t){p.e(t)}finally{p.f()}a.donutValues=Array.from(o.entries()).map((function(e){var n=v(e,2),i=n[0];return{label:i,value:n[1],color:Pb(i,a.id,t)}})),t.flowInternal_&&s>0&&a.donutValues.push({label:"Internal",value:s,color:"#999"})};for(a.s();!(e=a.n()).done;)o()}catch(t){a.e(t)}finally{a.f()}}(e),function(t){var e,n={},i=xb(t.flowGraph_.nodes);try{for(i.s();!(e=i.n()).done;){var r=e.value;n[r.id]={x:r.x,y:r.y,incoming:0,outgoing:0,internal:0}}}catch(t){i.e(t)}finally{i.f()}var a,o=xb(t.flowGraph_.links);try{for(o.s();!(a=o.n()).done;){var s=a.value,l=s.source.id,c=s.target.id;n[l]&&(n[l].outgoing+=s.value),n[c]&&(n[c].incoming+=s.value),l===c&&(n[l].internal+=s.value)}}catch(t){o.e(t)}finally{o.f()}t.locationStats=n}(e),function(t,e){var n=e.append("g").attr("class","donuts").attr("id","donuts"),i=Gt(t.flowGraph_.nodes,(function(t){return sb(t.donutValues,(function(t){return t.value}))}));t.donutSizeScale=t.flowDonutSizeScale_||Kv().domain([0,i]).range([3,10]);var r=Dr().innerRadius(5),a=Ux().value((function(t){return t.value})).sort(null);Object.entries(t.locationStats).forEach((function(e){var i=v(e,2),o=i[0],s=i[1],l=s.x,c=s.y,u=s.incoming,h=s.outgoing,f=s.internal,p=t.flowInternal_?u+h+f:u+h;if(0!==p){var d=Ab(o,t),g=kb(o,t),_=[].concat(y(d),y(g)),m=new Map;_.forEach((function(t){var e=t.color;m.set(e,(m.get(e)||0)+t.value)}));var x=Array.from(m,(function(t){var e=v(t,2),n=e[0];return{label:n,value:e[1],color:n}})),b=a(x);b.forEach((function(e){e.data.parent={id:o,name:t.nodeNameMap.get(o)||o,donutValues:x}}));var w=n.append("g").attr("class","donut-group").attr("transform","translate(".concat(l,",").concat(c,")")).attr("data-total",p);w.selectAll("path").data(b).join("path").attr("d",r.innerRadius(.4*t.donutSizeScale(p)).outerRadius(t.donutSizeScale(p))).attr("fill",(function(t){return t.data.color})).attr("stroke","white").attr("stroke-width",.5).style("cursor","pointer").on("mouseover",(function(e,n){t._tooltip&&t._tooltip.mouseover(Mb(n,t)),Eb(e,t.svg_),wb(0,n)})).on("mousemove",(function(e,n){t._tooltip&&t._tooltip.mousemove(e)})).on("mouseout",(function(e,n){t._tooltip&&t._tooltip.mouseout(),Cb(e,t.svg_),Sb()})),w.append("circle").attr("r",.4*t.donutSizeScale(p)).attr("fill","white").style("cursor","pointer").on("mouseover",(function(e){var n=b[0];t._tooltip&&t._tooltip.mouseover(Mb(n,t)),Eb(e,t.svg_),wb(0,n)})).on("mousemove",(function(e){t._tooltip&&t._tooltip.mousemove(e)})).on("mouseout",(function(e){t._tooltip&&t._tooltip.mouseout(),Cb(e,t.svg_),Sb()}))}}))}(e,i)),null!==(t=e.labels_)&&void 0!==t&&t.values&&function(t,e){var n,i=t.flowGraph_.nodes,r=i.filter((function(t){return t.targetLinks&&0===t.sourceLinks.length})),a=e.append("g").attr("class","em-flow-labels");if(null!==(n=t.labels_)&&void 0!==n&&n.shadows){a.append("g").attr("class","em-flow-label-shadow").selectAll("text").data(r).join("text").attr("text-anchor",(function(t){return t.x>t.targetLinks[0].source.x?"start":"end"})).attr("x",(function(e){return e.x>e.targetLinks[0].source.x?e.x+t.flowLabelOffsets_.x:e.x-t.flowLabelOffsets_.x})).attr("y",(function(e){return e.y+t.flowLabelOffsets_.y})).text((function(e){return t.labelFormatter(e.value)}))}var o=a.append("g").attr("class","em-flow-label").selectAll("g").data(r).join("g").attr("transform",(function(t){return"translate(".concat(t.x,", ").concat(t.y,")")}));o.append("text").attr("class","em-label-text").attr("text-anchor",(function(t){return t.x>t.targetLinks[0].source.x?"start":"end"})).attr("x",(function(e){return e.x>e.targetLinks[0].source.x?t.flowLabelOffsets_.x:-t.flowLabelOffsets_.x})).attr("y",t.flowLabelOffsets_.y).text((function(e){return t.labelFormatter(e.value)})),t.labels_.backgrounds&&o.each((function(){var t=Ft(this).select("text").node().getBBox(),e=5,n=2;Ft(this).insert("rect","text").attr("class","em-label-background").attr("x",t.x-e).attr("y",t.y-n).attr("width",t.width+2*e).attr("height",t.height+2*n)}))}(e,i)},e.updateClassification=function(){},e.getLegendConstructor=function(){return eb},e};function Ob(t,e){var n=t.get(e);if(!n)throw new Error("missing: "+e);return n}var Gb=function(t,e){var n=[],i=e.statData().unitText()||"",r="".concat(t.source.name||t.source.id," to ").concat(t.target.name||t.target.id);return n.push('\n <div class="em-tooltip-bar">\n <b>'.concat(r,"</b>\n </div>\n ")),n.push("<div class='em-tooltip-text'>\n <table class=\"em-tooltip-table\">\n <tbody>\n <tr><td>".concat(la(t.value)," ").concat(i,"</td></tr>\n </tbody>\n </table> \n </div>")),n.join("")};function Db(t){return Math.sign(t)*t*t}function zb(){var t,e=on(),n=[0,1],i=!1;function r(n){var r=function(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}(e(n));return isNaN(r)?t:i?Math.round(r):r}return r.invert=function(t){return e.invert(Db(t))},r.domain=function(t){return arguments.length?(e.domain(t),r):e.domain()},r.range=function(t){return arguments.length?(e.range((n=Array.from(t,Ke)).map(Db)),r):n.slice()},r.rangeRound=function(t){return r.range(t).round(!0)},r.round=function(t){return arguments.length?(i=!!t,r):i},r.clamp=function(t){return arguments.length?(e.clamp(t),r):e.clamp()},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return zb(e.domain(),n).round(i).clamp(e.clamp()).unknown(t)},Ht.apply(r,arguments),Mn(r)}function Ib(t,e){if((r=t.length)>1)for(var n,i,r,a=1,o=t[e[0]],s=o.length;a<r;++a)for(i=o,o=t[e[a]],n=0;n<s;++n)o[n][1]+=o[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Rb(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function jb(t,e){return t[e]}function Bb(t){const e=[];return e.key=t,e}var qb=function(t,e){var n=ax(t);if(n.sizeLegend={title:null,titlePadding:15,values:null},n.colorLegend={title:null,titlePadding:15,marginTop:23,labelOffsets:{x:5,y:5},shapeWidth:25,shapeHeight:20,shapePadding:1,noData:!0,noDataText:"No data"},n.monthLegend={title:null,marginTop:10},n._sizeLegendHeight=0,e)for(var i in e)if("colorLegend"===i||"sizeLegend"===i)for(var r in n[i])void 0!==e[i][r]&&(n[i][r]=e[i][r]);else n[i]=e[i];function a(t,e){var n=t.svg_.selectAll(".em-coxcomb-chart").selectAll("path[code]");n.style("fill","white"),n.filter("path[code='"+e+"']").each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}function o(t){t.svg_.selectAll(".em-coxcomb-chart").selectAll("path[code]").each((function(){Ft(this).style("fill",Ft(this).attr("fill___"))}))}return n.update=function(){n.updateConfig(),n.updateContainer();var e=n.lgg;e.selectAll("*").remove(),n.makeBackgroundBox(),n.title&&n.addTitle(),n.subtitle&&n.addSubtitle();var i=n.getBaseY(),r=n.getBaseX();if(t.classifierSize_){var s=e.append("g").attr("class","em-coxcomb-size-legend").attr("transform","translate(".concat(r,", ").concat(i,")"));n._sizeLegendContainer=s,$y(n,s,n.sizeLegend.values,n.map.classifierSize_,n.sizeLegend.title,n.sizeLegend.titlePadding)}!function(t,e,n){var i=t.map,r=t.colorLegend;t._colorLegendContainer=t.lgg.append("g").attr("class","em-coxcomb-color-legend");var s=0;t._sizeLegendContainer?(s=t._sizeLegendContainer.node().getBBox().height,t._colorLegendContainer.attr("transform","translate(".concat(e,",").concat(s+t.colorLegend.marginTop,")"))):t._colorLegendContainer.attr("transform","translate(".concat(e,",").concat(n,")"));r.title&&t._colorLegendContainer.append("text").attr("class","em-color-legend-title").attr("id","em-color-legend-title").attr("x",0).attr("y",t.titleFontSize).text(r.title);var l=0,c=i.catColors(),u=function(e){var n=t.colorLegend.titlePadding+(r.title?t.titleFontSize:0)+l*(r.shapeHeight+r.shapePadding),s=i.catColors()[e]||"lightgray";t._colorLegendContainer.append("rect").attr("class","em-legend-rect").attr("x",0).attr("y",n).attr("width",r.shapeWidth).attr("height",r.shapeHeight).style("fill",s).attr("stroke","black").attr("stroke-width",.5).on("mouseover",(function(){a(t.map,e),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,a,e)})).on("mouseout",(function(){o(t.map),t.map.insetTemplates_&&ua(t.map.insetTemplates_,t.map.svgId,o,e)})),t._colorLegendContainer.append("text").attr("class","em-legend-label").attr("x",r.shapeWidth+r.labelOffsets.x).attr("y",n+.5*r.shapeHeight).attr("dy","0.35em").text(i.catLabels()[e]||e),l++};for(var h in c)u(h);if(r.noData){var f=s+t.colorLegend.marginTop+(r.title?t.titleFontSize+t.boxPadding:0)+l*(r.shapeHeight+r.shapePadding),p=t.lgg.append("g").attr("class","em-no-data-legend").attr("transform","translate(".concat(t.boxPadding,",").concat(f,")"));t.appendNoDataLegend(p,t.noDataText,a,o)}}(n,r,i),function(t,e,n){var i,r,a=t.map._coxcombMonths||[],o=40;if(!a.length)return;var s=n,l=e;t._sizeLegendContainer&&(s+=t._sizeLegendContainer.node().getBBox().height);t._colorLegendContainer&&(s+=t._colorLegendContainer.node().getBBox().height,s+=t.colorLegend.marginTop||0);s+=(null===(i=t.monthLegend)||void 0===i?void 0:i.marginTop)||0,s+=o;var c=18,u=2*Math.PI/a.length,h=(null===(r=t._colorLegendContainer)||void 0===r||null===(r=r.node())||void 0===r?void 0:r.getBBox().width)||0,f=l+h/2+c,p=t.lgg.append("g").attr("class","em-coxcomb-month-legend").attr("transform","translate(".concat(f,", ").concat(s+o,")")),d=Dr().innerRadius(0).outerRadius(o).startAngle((function(t,e){return e*u})).endAngle((function(t,e){return(e+1)*u}));p.selectAll("path").data(a).join("path").attr("d",(function(t,e){return d(t,e)})).attr("fill","#ccc").attr("class","em-legend-month-segment");var g=o+c,_=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];p.selectAll("text.month-label").data(a).join("text").attr("class","em-legend-label em-month-label").attr("x",(function(t,e){return Math.sin(e*u+u/2)*g})).attr("y",(function(t,e){return-Math.cos(e*u+u/2)*g})).attr("text-anchor","middle").attr("alignment-baseline","middle").text((function(t){var e=t.toString().slice(5,7);return _[parseInt(e,10)-1]||t})),p.selectAll("path").on("mouseover",(function(e,n){var i=n;(t.map.svg_||t.map.svg()).selectAll(".em-coxcomb-chart path").style("opacity",(function(t){return t.data.month===i?1:0})),Ft(this).style("stroke-width",1.5).style("opacity",.8)})).on("mouseout",(function(){(t.map.svg_||t.map.svg()).selectAll(".em-coxcomb-chart path").style("opacity",1),Ft(this).style("stroke-width",.3).style("opacity",.4)}))}(n,r,i),n.setBoxDimension()},n},Ub=function(t){var e=sx(t,!0,"coxcomb");function n(t){var n=e.yearlyTotals;return void 0!==n[t]?n[t]:void 0}function i(t){if(e.catLabels_=e.catLabels_||{},e.svg_){var i=t.getCentroidsGroup(t);if(i){var r=i.selectAll("g.em-centroid"),a=r.data().filter((function(t){return void 0!==n(t.properties.id)}));a.forEach((function(t){r.filter((function(e){return e.properties.id===t.properties.id})).append("g").attr("class","em-coxcomb").attr("id","cox_"+t.properties.id)})),function(t){var i=function(e){var n;return null===(n=t.tooltip_.omitRegions)||void 0===n?void 0:n.includes(e)},r=pa(t),a=t.svg().selectAll(r),o=t.svg().selectAll("g.em-centroid");[a,o].forEach((function(t){t.on("mouseover",(function(t,r){if(!i(r.properties.id)&&n(r.properties.id)){var a=Ft(this);a.attr("fill___",a.style("fill")),a.style("fill",e.hoverColor_),a.select("circle.em-coxcomb-max-outline").attr("stroke-width",2),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(r,e))}})).on("mousemove",(function(t,r){i(r.properties.id)||n(r.properties.id)&&e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(r,e))})).on("mouseout",(function(t,r){if(!i(r.properties.id)&&n(r.properties.id)){var a=Ft(this);a.style("fill",a.attr("fill___")||e.noDataFillStyle_),a.attr("fill___",null),a.select("circle.em-coxcomb-max-outline").attr("stroke-width",.3),e._tooltip&&e._tooltip.mouseout()}})).on("click",(function(t,r){i(r.properties.id)||n(r.properties.id)&&e._tooltip&&e._tooltip.click(r,e)}))}))}(t),function(t){var n=e._coxcombMonths,i=e._coxcombCauses,r=function(t){return _v().domain(t).range([0,2*Math.PI]).align(0)}(n);t.forEach((function(t){var a=t.properties.id,o=function(t,n,i){var r=n.map((function(n){var r={month:n},a=0;if(i.forEach((function(i){var o,s=null===(o=e.statData("".concat(n,":").concat(i)))||void 0===o?void 0:o.get(t),l=(null==s?void 0:s.value)||0;r[i]=l,a+=l})),e.totalCode_){var o,s=null===(o=e.statData("".concat(n,":").concat(e.totalCode_)))||void 0===o?void 0:o.get(t),l=(null==s?void 0:s.value)||0,c=l>a?l-a:0;c>0&&(r.other=c)}return Object.values(r).some((function(t){return t&&t>0}))?r:null})).filter(Boolean),a=r.some((function(t){return(t.other||0)>0}));if(!a){var o,s;r.forEach((function(t){return delete t.other})),null===(o=e.catColors_)||void 0===o||delete o.other,null===(s=e.catLabels_)||void 0===s||delete s.other}return r}(a,n,i);if(o.length){var s=function(t,e){var n=y(e);t.some((function(t){return(t.other||0)>0}))&&n.push("other");return n}(o,i),l=function(){var t=ur([]),e=Rb,n=Ib,i=jb;function r(r){var a,o,s=Array.from(t.apply(this,arguments),Bb),l=s.length,c=-1;for(const t of r)for(a=0,++c;a<l;++a)(s[a][c]=[0,+i(t,s[a].key,c,r)]).data=t;for(a=0,o=Tx(e(s));a<l;++a)s[o[a]].index=a;return n(s,o),s}return r.keys=function(e){return arguments.length?(t="function"==typeof e?e:ur(Array.from(e)),r):t},r.value=function(t){return arguments.length?(i="function"==typeof t?t:ur(+t),r):i},r.order=function(t){return arguments.length?(e=null==t?Rb:"function"==typeof t?t:ur(Array.from(t)),r):e},r.offset=function(t){return arguments.length?(n=null==t?Ib:t,r):n},r}().keys(s);!function(t,n,i,r){var a=e.svg().selectAll("#cox_"+t);if(e.coxcombRings_){var o=e.yearlyTotals[t]||0,s=e.classifierSize_(o);a.append("circle").attr("class","em-coxcomb-max-outline").attr("r",0).attr("fill","none").attr("stroke","#000").attr("stroke-width",.3).attr("opacity",.5).attr("pointer-events","none").transition().duration(e.transitionDuration_/2).attr("r",s)}var l=Dr().startAngle((function(t){return r(t.data.month)})).endAngle((function(t){return r(t.data.month)+r.bandwidth()})).padAngle(.01).padRadius(0);i.forEach((function(r){a.append("g").attr("class","em-coxcomb-chart").attr("stroke","#ffffff").attr("stroke-width",.3).selectAll("path").data(n[i.indexOf(r)]).join("path").attr("fill",e.catColors_[r]||("other"===r?"#FFCC80":"lightgray")).attr("fill___",e.catColors_[r]||("other"===r?"#FFCC80":"lightgray")).attr("code",r).attr("month",(function(t){return t.data.month})).transition().delay((function(t,e){return 120*e})).duration(e.transitionDuration_).attrTween("d",(function(n){var i=Ye(0,e.classifierChartSize_(n[0],t)),r=Ye(0,e.classifierChartSize_(n[1],t));return function(t){return l.innerRadius(i(t)).outerRadius(r(t))(n)}}))}))}(a,l(o),s,r)}}))}(a),e.dorling_?jy(e,(function(t){var i=n(t.properties.id)||0;return e.classifierSize_(i)||0})):stopDorlingSimulation(e)}}}return e.coxcombMinRadius_=10,e.coxcombMaxRadius_=80,e.coxcombStrokeFill_="white",e.coxcombStrokeWidth_=.3,e.coxcombRings_=!0,e.catColors_=void 0,e.catLabels_=void 0,e.classifierSize_=null,["catColors_","catLabels_","noDataFillStyle_","coxcombMaxRadius_","coxcombMinRadius_","coxcombRings_","coxcombStrokeFill_","coxcombStrokeWidth_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),t&&["catColors","catLabels","noDataFillStyle","coxcombMaxRadius","coxcombMinRadius","coxcombInnerRadius","coxcombStrokeFill","coxcombStrokeWidth"].forEach((function(n){null!=t[n]&&e[n](t[n])})),e.statCodes_=void 0,e.totalCode_=void 0,e.statCoxcomb=function(t,n,i,r,a,o,s){return e._coxcombMonths=n,e._coxcombCauses=y(r),e._coxcombDim=i,t.filters=t.filters||{},n.forEach((function(n){if(r.forEach((function(s){t.filters.time=n,t.filters[i]=s;var l={};for(var c in t)l[c]=t[c];for(var u in l.filters={},t.filters)l.filters[u]=t.filters[u];var h="".concat(n,":").concat(s);e.stat(h,l),o&&(e.catColors_=e.catColors_||{},e.catColors_[s]=o[r.indexOf(s)]),a&&(e.catLabels_=e.catLabels_||{},e.catLabels_[s]=a[r.indexOf(s)])})),s){t.filters.time=n,t.filters[i]=s;var l={};for(var c in t)l[c]=t[c];for(var u in l.filters={},t.filters)l.filters[u]=t.filters[u];var h="".concat(n,":").concat(s);e.stat(h,l)}})),s&&(e.totalCode_=s,e.catColors_.other="#FFCC80",e.catLabels_.other="Other"),e},e.updateClassification=function(){if(!e.statCodes_){e.statCodes_=Object.keys(e.statData_);var t=e.statCodes_.indexOf("default");t>-1&&e.statCodes_.splice(t,1)}var n,i,r,a,o,s;return function(){var t={},n={};e.totalCode_?e._coxcombMonths.forEach((function(i){var r=e.statData("".concat(i,":").concat(e.totalCode_));if(r&&r._data_)for(var a in r._data_){var o,s=(null===(o=r._data_[a])||void 0===o?void 0:o.value)||0;n[a]=n[a]||{},n[a][i]=s,t[a]=(t[a]||0)+s}})):e._coxcombMonths.forEach((function(i){var r={};for(var a in e._coxcombCauses.forEach((function(t){var n=e.statData("".concat(i,":").concat(t));if(n&&n._data_)for(var a in n._data_){var o,s=(null===(o=n._data_[a])||void 0===o?void 0:o.value)||0;r[a]=(r[a]||0)+s}})),r)n[a]=n[a]||{},n[a][i]=r[a],t[a]=(t[a]||0)+r[a]}));e.yearlyTotals=t,e.monthlyTotals=n}(),n=Object.values(e.yearlyTotals),i=e.coxcombMinRadius_||0,r=e.coxcombMaxRadius_||80,a=Ot(n)||0,o=Gt(n)||0,s=zb().domain([a,o]).range([i,r]),e.classifierChartSize_=function(t,n){var i=s(e.yearlyTotals[n]||0),r=t/Math.max.apply(Math,y(Object.values(e.monthlyTotals[n]||{0:1})));return Math.sqrt(r)*i},e.classifierSize_=s,e},e.updateStyle=function(){if(!e.catColors_){e.catColors({});for(var t=0;t<e.statCodes_.length;t++)e.catColors_[e.statCodes_[t]]=Wx[t%10]}try{return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,i),i(e),e.dorling_?jy(e,(function(t){var i=n(t.properties.id)||0;return e.classifierSize_(i)||0})):stopDorlingSimulation(e),e}catch(t){console.error("Error in updateStyle:",t.message),console.error(t)}return e},e.getLegendConstructor=function(){return qb},e.tooltip_.textFunction=function(t,n){var i,r=t.properties.na||t.properties.name,a=t.properties.id,o=e._coxcombMonths||[],s=y(e._coxcombCauses),l=o.some((function(t){var n,i=(null===(n=e.statData("".concat(t,":").concat(e.totalCode_)))||void 0===n||null===(n=n.get(a))||void 0===n?void 0:n.value)||0,r=e._coxcombCauses.reduce((function(n,i){var r;return n+((null===(r=e.statData("".concat(t,":").concat(i)))||void 0===r||null===(r=r.get(a))||void 0===r?void 0:r.value)||0)}),0);return i>r}));l&&s.push("other");var c='<div class="em-tooltip-bar">'.concat(r).concat(a?" (".concat(a,")"):"","</div>"),u=['<th class="em-breakdown-label">Month</th>'];s.forEach((function(t){var n=e.catLabels_[t]||t,i=e.catColors_[t]||("other"===t?"#FFCC80":"#999");u.push('<th class="em-breakdown-label" style="color:'.concat(i,'">').concat(n,"</th>"))})),u.push('<th class="em-breakdown-label">Total</th>');var h="<tr>".concat(u.join(""),"</tr>"),f=e.yearlyTotals||{},p=e.monthlyTotals||{},d=f[a]||0,g=o.map((function(t){var n,i=['<td class="em-breakdown-label">'.concat(t,"</td>")],r=(null===(n=p[a])||void 0===n?void 0:n[t])||0;return s.forEach((function(n){var r=0;if("other"===n){var o,l=(null===(o=e.statData("".concat(t,":").concat(e.totalCode_)))||void 0===o||null===(o=o.get(a))||void 0===o?void 0:o.value)||0,c=s.filter((function(t){return"other"!==t})).reduce((function(n,i){var r;return n+((null===(r=e.statData("".concat(t,":").concat(i)))||void 0===r||null===(r=r.get(a))||void 0===r?void 0:r.value)||0)}),0);r=Math.max(l-c,0)}else{var u;r=(null===(u=e.statData("".concat(t,":").concat(n)))||void 0===u||null===(u=u.get(a))||void 0===u?void 0:u.value)||0}i.push(r>0?'<td><span class="em-breakdown-value">'.concat(la(r),"</span></td>"):"<td></td>")})),i.push(r>0?'<td><span class="em-breakdown-value">'.concat(la(r),"</span></td>"):"<td></td>"),"<tr>".concat(i.join(""),"</tr>")})),_=(null===(i=e.statData(e.statCodes_[0]))||void 0===i?void 0:i.unitText())||"";return c+='<div class="em-tooltip-breakdown em-tooltip-cx"><table class="em-tooltip-cx-table">',c+=h+g.join(""),d>0&&(c+='\n <tr class="em-total">\n <td class="em-breakdown-label">Year total</td>\n <td colspan="'.concat(s.length,'"></td>\n <td>\n <span class="em-breakdown-value">').concat(la(d)," ").concat(_,"</span>\n </td>\n </tr>")),c+="</table></div>"},e};var Wb=function(t,e){try{return"choropleth"==t||"ch"==t?bx(e):"categorical"==t||"ct"==t?function(t){var e=sx(t,!1,"ct");e.classToFillStyle_=void 0,e.classToText_=void 0,e.tooltip_.textFunction=Ax,e.classifier_=void 0,["classToFillStyle_","classToText_","noDataFillStyle_","tooltipText_","classifier_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),t&&["classToFillStyle","classToText","noDataFillStyle","tooltipText","classifier"].forEach((function(n){null!=t[n]&&e[n](t[n])})),e.updateClassification=function(){return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,n),n(e),e};var n=function(t){var n=e.statData().getUniqueValues(),i=y(Array(n.length).keys()),r=e.classToFillStyle_?e.classToFillStyle():void 0;if(r){var a=Object.keys(r);e.classifier(gv().domain(a).range(a.map((function(t,e){return e}))))}else e.classifier(gv().domain(n).range(i));var o=function(t){t.attr("ecl",(function(t){var n=e.statData().get(t.properties.id);if(n){var i=n.value;if(":"===i)return"nd";var r=isNaN(i)?i:+i;if(e.classifier().domain().includes(r))return e.classifier()(r)}}))},s=pa(t);o(t.svg().selectAll(s)),"mixed"===t.nutsLevel_&&o(t.svg().selectAll("path.em-nutsrg0"))};function i(t){if(t.svg_){var n=pa(t),i=t.svg().selectAll(n);i.style("pointer-events","none").transition().duration(e.transitionDuration()).style("fill",a).end().then((function(){i.style("pointer-events",null),i.each((function(){var t=Ft(this);t.attr("fill___",t.style("fill"))})),o(t,i),e.gridCartogram_&&t.svg().selectAll(".em-grid-text").each((function(){var t=Ft(this.parentNode).style("fill");Ft(this).attr("fill",fa(t))}))})).catch((function(t){})),"mixed"===e.nutsLevel_&&r(t),e.labels_&&e.labels_.values&&e.updateValuesLabels(t),e.patternFill_&&vy(t,e.patternFill_)}}e.updateStyle=function(){if(!e.classToFillStyle()){for(var t={},n=e.classifier().domain(),r=0;r<n.length;r++)t[n[r]]=Ex[r%12];e.classToFillStyle(t)}return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,i),i(e),e};var r=function(t){t.svg().selectAll(pa(t)).style("display",(function(t){if(!this.parentNode.classList.contains("em-cntrg")){var e=Ft(this),n=e.attr("ecl"),i=e.attr("lvl");return n||"0"===i?"block":"none"}})).style("stroke",(function(){var t=Ft(this),e=t.attr("lvl"),n=t.attr("ecl"),i=t.style("stroke");return n&&"0"!==e?i||"#777":null})).style("stroke-width",(function(){var t=Ft(this),e=t.attr("lvl"),n=t.attr("ecl"),i=t.style("stroke-width");return n&&"0"!==e?i||.2:null}))},a=function(t){var n=Ft(this).attr("ecl");return e.Geometries.userGeometries?n?"nd"===n?e.noDataFillStyle()||"gray":e.classToFillStyle_[e.classifier().domain()[n]]:aa("em-nutsrg","fill"):"WORLD"===e.geo_?n?"nd"===n?e.noDataFillStyle()||"gray":e.classToFillStyle_[e.classifier().domain()[n]]||e.cntrgFillStyle_:e.cntrgFillStyle_:(t.properties.id.slice(0,2),n?"nd"===n?e.noDataFillStyle()||"gray":e.classToFillStyle_[e.classifier().domain()[n]]:aa("em-nutsrg","fill"))},o=function(t,n){var i=function(e){var n;return null===(n=t.tooltip_.omitRegions)||void 0===n?void 0:n.includes(e)};n.on("mouseover",(function(n,r){i(r.properties.id)||(Ft(this).style("fill",t.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(r,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,r,this,t))})).on("mousemove",(function(n,r){i(r.properties.id)||(e._tooltip&&e._tooltip.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,r,this,t))})).on("mouseout",(function(n,r){if(!i(r.properties.id)){var a=Ft(this);a.style("fill",a.attr("fill___")),e._tooltip&&e._tooltip.mouseout(),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,r,this,t)}}))};return e.getLegendConstructor=function(){return Cx},e}(e):"proportionalSymbol"==t||"proportionalSymbols"==t||"ps"==t?Uy(e):"bivariateChoropleth"==t||"chbi"==t?function(t){var e=sx(t,!1,"chbi");function n(t){var n=function(t){t.attr("ecl1",(function(t){var n=e.statData("v1").get(t.properties.id);if(n){var i=n.value;return 0!=i&&!i||":"==i?"nd":+e.classifier1_(+i)}})).attr("ecl2",(function(t){var n=e.statData("v2").get(t.properties.id);if(n){var i=n.value;return 0!=i&&!i||":"==i?"nd":+e.classifier2_(+i)}})).attr("nd",(function(t){var n=e.statData("v1").get(t.properties.id),i=e.statData("v2").get(t.properties.id);if(n&&i){var r=n.value;return 0!=r&&!r||":"==r||0!=(r=i.value)&&!r||":"==r?"nd":""}}))};if(function(){var t=e.statData("v1").getArray(),n=e.statData("v2").getArray(),i=y(Array(e.numberOfClasses()).keys());if(e.classifier1_||(e.breaks1_?e.classifier1(An().domain(e.breaks1_).range(i)):e.classifier1(Vt().domain(t).range(i))),e.classifier2_||(e.breaks2_?e.classifier2(An().domain(e.breaks2_).range(i)):e.classifier2(Vt().domain(n).range(i))),!e.classToFillStyle_){var r=Dx(e.numberOfClasses(),e.startColor(),e.color1(),e.color2(),e.endColor());e.classToFillStyle(r)}}(),t.svg_){var i=pa(t);n(t.svg().selectAll(i)),"mixed"===t.nutsLevel_&&n(t.svg().selectAll("path.em-nutsrg0"))}}function i(t){if(t.svg()){var n=pa(t),i=t.svg().selectAll(n);i.style("pointer-events","none").transition().duration(e.transitionDuration()).style("fill",(function(t){var n=Ft(this).attr("ecl1");if("nd"===n)return e.noDataFillStyle()||"gray";var i=Ft(this).attr("ecl2");return n||i?"nd"===i?e.noDataFillStyle()||"gray":e.classToFillStyle_(+n,+i):aa("em-nutsrg","fill")})).end().then((function(){i.style("pointer-events",null),i.each((function(){var t=Ft(this);t.attr("fill___",t.style("fill"))})),a(t,i),e.gridCartogram_&&t.svg().selectAll(".em-grid-text").each((function(){var t=Ft(this.parentNode).style("fill");Ft(this).attr("fill",fa(t))}))}),(function(t){})),"mixed"==e.nutsLevel_&&r(t)}}e.numberOfClasses_=3,e.startColor_="#e8e8e8",e.color1_="#73ae80",e.color2_="#6c83b5",e.endColor_="#2a5a5b",e.classToFillStyle_=void 0,e.classifier1_=void 0,e.classifier2_=void 0,e.breaks1_=void 0,e.breaks2_=void 0,e.tooltip_.textFunction=zx,["numberOfClasses_","breaks1_","breaks2_","startColor_","color1_","color2_","endColor_","classToFillStyle_","noDataFillStyle_","classifier1_","classifier2_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),t&&["numberOfClasses","startColor","color1","color2","endColor","classToFillStyle","noDataFillStyle"].forEach((function(n){null!=t[n]&&e[n](t[n])})),e.updateClassification=function(){return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,n),n(e),e},e.updateStyle=function(){return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,i),i(e),e};var r=function(t){t.svg().selectAll(pa(t)).each((function(){if(!this.parentNode.classList.contains("em-cntrg")){var t=Ft(this),e=t.attr("ecl1"),n=t.attr("ecl2"),i=t.attr("lvl"),r=e||n||"0"===i;if(t.style("display",r?"block":"none"),(e||n)&&"0"!==i){var a=t.style("stroke")||"#777",o=t.style("stroke-width")||.2;t.style("stroke",a).style("stroke-width",o)}}}))},a=function(t,n){var i=function(e){var n;return null===(n=t.tooltip_.omitRegions)||void 0===n?void 0:n.includes(e)};n.on("mouseover",(function(n,r){var a;i(r.properties.id)||(Ft(this).style("fill",t.hoverColor_),null===(a=e._tooltip)||void 0===a||a.mouseover(e.tooltip_.textFunction(r,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,r,this,t))})).on("mousemove",(function(n,r){var a;i(r.properties.id)||(null===(a=e._tooltip)||void 0===a||a.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,r,this,t))})).on("mouseout",(function(n,r){if(!i(r.properties.id)){var a,o=Ft(this),s=o.attr("fill___");s&&(o.style("fill",s),null===(a=e._tooltip)||void 0===a||a.mouseout()),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,r,this,t)}}))};return e.getLegendConstructor=function(){return Gx},e}(e):"trivariateChoropleth"==t||"chbi"==t?function(t){var e=sx(t,!1,"chtri");function n(t){if(t.svg_){var n=pa(t);t.svg().selectAll(n).each((function(n){var i,r,a,o=+(null===(i=t.statData("v1").get(n.properties.id))||void 0===i?void 0:i.value)||0,s=+(null===(r=t.statData("v2").get(n.properties.id))||void 0===r?void 0:r.value)||0,l=+(null===(a=t.statData("v3").get(n.properties.id))||void 0===a?void 0:a.value)||0,c={value1:o,value2:s,value3:l};if(o+s+l){var u=e.colorClassifier_(c);Ft(this).attr("regionClass","tri").style("fill",u)}else Ft(this).attr("regionClass","nd").style("fill",e.noDataFillStyle())}))}}function i(t){if(t.svg()){var n=pa(t);t.svg().selectAll(n).transition().duration(e.transitionDuration()).style("fill",(function(n){var i,r,a,o=+(null===(i=t.statData("v1").get(n.properties.id))||void 0===i?void 0:i.value)||0,s=+(null===(r=t.statData("v2").get(n.properties.id))||void 0===r?void 0:r.value)||0,l=+(null===(a=t.statData("v3").get(n.properties.id))||void 0===a?void 0:a.value)||0,c={value1:o,value2:s,value3:l};return o+s+l?e.colorClassifier_(c):e.noDataFillStyle()})).end().then((function(){t.svg().selectAll(n).each((function(){var t=Ft(this);t.attr("fill___",t.style("fill"))}))}))}}e.color1_=(null==t?void 0:t.color1)||"#e41a1c",e.color2_=(null==t?void 0:t.color2)||"#4daf4a",e.color3_=(null==t?void 0:t.color3)||"#377eb8",e.startColor_=(null==t?void 0:t.startColor)||"#e8e8e8",e.centerCoefficient_=(null==t?void 0:t.centerCoefficient)||.2,e.noDataFillStyle_=(null==t?void 0:t.noDataFillStyle)||"#ccc",e.colorClassifier_=null,e.tooltip_.textFunction=jx,["color1_","color2_","color3_","centerCoefficient_","noDataFillStyle_","colorClassifier_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),e.updateClassification=function(){return e.statData("v1")&&e.statData("v2")&&e.statData("v3")?(e.colorClassifier_=Rx(["value1","value2","value3"],(function(t){return(+t.value1||0)+(+t.value2||0)+(+t.value3||0)}),[e.color1(),e.color2(),e.color3()],{centerCoefficient:e.centerCoefficient(),withMixedClasses:!0,defaultColor:e.noDataFillStyle()}),e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,n),n(e),e):e},e.updateStyle=function(){return e.insetTemplates_&&ua(e.insetTemplates_,e.svgId_,i),i(e),r(e,e.svg().selectAll(pa(e))),e};var r=function(t,n){var i=function(e){var n;return null===(n=t.tooltip_.omitRegions)||void 0===n?void 0:n.includes(e)};n.on("mouseover",(function(n,r){i(r.properties.id)||(Ft(this).style("fill",t.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(r,e)),e.onRegionMouseOver_&&e.onRegionMouseOver_(n,r,this,t))})).on("mousemove",(function(n,r){i(r.properties.id)||(e._tooltip&&e._tooltip.mousemove(n),e.onRegionMouseMove_&&e.onRegionMouseMove_(n,r,this,t))})).on("mouseout",(function(n,r){if(!i(r.properties.id)){var a=Ft(this);a.style("fill",a.attr("fill___")),e._tooltip&&e._tooltip.mouseout(),e.onRegionMouseOut_&&e.onRegionMouseOut_(n,r,this,t)}}))};return e.getLegendConstructor=function(){return Ix},e}(e):"stripeComposition"==t||"scomp"==t?function(t){var e=sx(t,!1,"scomp");e.stripeWidth_=50,e.stripeOrientation_=0,e.catColors_=void 0,e.catLabels_=void 0,e.showOnlyWhenComplete_=!1,e.pieChartRadius_=40,e.pieChartInnerRadius_=15,["stripeWidth_","stripeOrientation_","catColors_","catLabels_","showOnlyWhenComplete_","noDataFillStyle_","pieChartRadius_","pieChartInnerRadius_"].forEach((function(t){e[t.substring(0,t.length-1)]=function(n){return arguments.length?(e[t]=n,e):e[t]}})),t&&["stripeWidth","stripeOrientation","catColors","catLabels","showOnlyWhenComplete","noDataFillStyle","pieChartRadius","pieChartInnerRadius"].forEach((function(n){null!=t[n]&&e[n](t[n])})),e.statComp=function(t,i,r,a,o){t.filters=t.filters||{};for(var s=0;s<r.length;s++){var l=r[s];t.filters[i]=l;var c={};for(var u in t)c[u]=t[u];for(var h in c.filters={},t.filters)c.filters[h]=t.filters[h];e.stat(l,c),o&&(e.catColors_=e.catColors_||{},e.catColors_[l]=o[s]),a&&(e.catLabels_=e.catLabels_||{},e.catLabels_[l]=a[s])}return n=r,e};var n=void 0,i=function(t){for(var i={},r=0,a=0;a<n.length;a++){var o=n[a],s=e.statData(o).get(t);if(!s||0!=s.value&&!s.value||isNaN(s.value)){if(e.showOnlyWhenComplete())return}else i[o]=s.value,r+=s.value}if(0!=r){for(var l=0;l<n.length;l++)i[n[l]]/=r;return i}};return e.updateClassification=function(){if(!n){var t=(n=Object.keys(e.statData_)).indexOf("default");t>-1&&n.splice(t,1)}return e},e.updateStyle=function(){if(!e.catColors()){e.catColors({});for(var t=0;t<n.length;t++)e.catColors()[n[t]]=Wx[t%10]}e.catLabels_=e.catLabels_||{},e.svg().selectAll(pa(e)).style("fill",(function(t){if(!this.parentNode.classList.contains("em-cntrg")){var n=t.properties.id,r=i(n);if(!r)return e.noDataFillStyle()||"gray";var a=e.svg().append("pattern").attr("id","pattern_"+n).attr("x","0").attr("y","0").attr("width",e.stripeWidth()).attr("height",1).attr("patternUnits","userSpaceOnUse");e.stripeOrientation()&&a.attr("patternTransform","rotate("+e.stripeOrientation()+")"),a.append("rect").attr("x",0).attr("y",0).attr("width",e.stripeWidth()).attr("height",1).style("stroke","none").style("fill","lightgray");var o=0;for(var s in r){var l=r[s];if(l){l*=e.stripeWidth();var c=e.catColors()[s]||"lightgray";a.append("rect").attr("x",o).attr("y",0).attr("height",1).style("stroke","none").attr("code",s).style("fill",c).style("pointer-events","none").transition().duration(e.transitionDuration()).on("end",(function(){Ft(this).style("pointer-events",null)})).attr("width",l),o+=l}}return"url(#pattern_"+n+")"}})).attr("nd",(function(t){return i(t.properties.id)?"":"nd"}));var r=pa(e);return e.svg().selectAll(r).on("mouseover",(function(t,n){var i=Ft(this);i.attr("fill___",i.style("fill")),i.style("fill",e.hoverColor_),e._tooltip&&e._tooltip.mouseover(e.tooltip_.textFunction(n,e))})).on("mousemove",(function(t,n){e._tooltip&&e._tooltip.mousemove(t)})).on("mouseout",(function(){var t=Ft(this);t.style("fill"),t.attr("fill___")&&(t.style("fill",t.attr("fill___")),e._tooltip&&e._tooltip.mouseout())})),e},e.getLegendConstructor=function(){return Hx},e.tooltip_.textFunction=function(t,n){var r=t.properties.na||t.properties.name,a=t.properties.id,o=i(a),s=[];for(var l in o)s.push({code:l,value:o[l]});var c="";if(c+='<div class="em-tooltip-bar">\n <b>'.concat(r,"</b>").concat(a?" (".concat(a,")"):"","\n </div>"),!s||0===s.length)return c+"<div>".concat(e.noDataText(),"</div>");var u,h=e.pieChartRadius(),f=e.pieChartInnerRadius(),p=Ux().sort(null).value((function(t){return t.value})),d=Dr().innerRadius(f).outerRadius(h),g="",_=Vx(p(s));try{for(_.s();!(u=_.n()).done;){var m=u.value,v=e.catColors()[m.data.code]||"lightgray",y=d(m);g+='<path d="'.concat(y,'" fill="').concat(v,'" stroke="darkgray"></path>')}}catch(t){_.e(t)}finally{_.f()}return c+'\n <div style="display: flex; justify-content: center;">\n <svg viewBox="'.concat(-h," ").concat(-h," ").concat(2*h," ").concat(2*h,'" width="').concat(2*h,'">\n <g>').concat(g,"</g>\n </svg>\n </div>\n ")},e}(e):"pieChart"==t||"pie"==t?Kx(e):"sparkline"==t||"spark"==t||"sparklines"==t?tb(e):"flow"==t||"flowmap"==t?Fb(e):"coxcomb"==t||"polar"==t?Ub(e):"alpha"==t||"valueByAlpha"==t?function(t){var e=bx(t);e.alphaData_=null,e.opacityScale_=null,e.opacityScale=function(t){return arguments.length?(e.opacityScale_=t,e):e.opacityScale_};var n=e.updateStatValues;e.updateStatValues=function(){var t=e.statData("alpha");if(!t||!t.isReady())return e.alphaData_=null,e;e.alphaData_=t;var i=t.getArray().filter((function(t){return null!=t&&":"!==t&&!isNaN(+t)}));if(!e.opacityScale_){var r=Ot(i),a=Gt(i);e.opacityScale_=i.length>0?En().domain([r,a]).range([.1,1]):null}return n.call(e),e.updateStyle()};var i=e.updateStyle;return e.updateStyle=function(){if(!e.svg_||!e.opacityScale_)return e;e.svg_.classed("em--alpha",!0);var t=e.statData();if(!t||!t.isReady())return e;var n=e.statData("alpha");if(!n||!n.isReady())return e;var r=pa(e);return e.svg().selectAll(r).each((function(i){var r,a,o=Ft(this),s=null===(r=t.get(i.properties.id))||void 0===r?void 0:r.value,l=null===(a=n.get(i.properties.id))||void 0===a?void 0:a.value;if(null!=s&&":"!==s)if("nd"!==l&&null!=l)o.style("opacity",e.opacityScale_(+l));else{var c=e.noDataFillStyle_||"gray";o.attr("ecl","nd").attr("force-grey","1").style("fill",c).attr("fill","grey").attr("fill___",c).style("opacity",1)}})),i.call(e),e},e.getLegendConstructor=function(){return Bv},e.tooltip_.textFunction=function(t,e){var n,i,r=[],a=t.properties.na||t.properties.name,o=t.properties.id;r.push('<div class="em-tooltip-bar"><b>'.concat(a,"</b>").concat(o?" (".concat(o,")"):"","</div>"));var s=e.statData(),l=e.alphaData_||e.statData("alpha"),c=s.get(o),u=null==l?void 0:l.get(o),h=(null===(n=s.unitText)||void 0===n?void 0:n.call(s))||"",f=(null==l||null===(i=l.unitText)||void 0===i?void 0:i.call(l))||"",p=s.label_?s.label_+": ":"",d=null!=l&&l.label_?(null==l?void 0:l.label_)+": ":"";return!c||0!==c.value&&!c.value||":"===c.value?(r.push('\n <div class="em-tooltip-text no-data">\n <table class="em-tooltip-table">\n <tbody>\n <tr><td>'.concat(e.noDataText_,"</td></tr>\n </tbody>\n </table>\n </div>\n ")),r.join("")):(r.push('\n <div class="em-tooltip-text">\n <table class="em-tooltip-table">\n <tbody>\n <tr>\n <td>'.concat(p).concat(la(c.value)," ").concat(h,"</td>\n </tr>\n <tr>\n <td>").concat(u&&":"!==u.value&&null!=u.value?"".concat(d).concat(la(u.value)," ").concat(f):"".concat(d).concat(e.noDataText_),"</td>\n </tr>\n </tbody>\n </table>\n </div>\n")),r.join(""))},e}(e):(console.log("Unexpected map type: "+t),sx(e,!0,t))}catch(t){console.error("Error in eurostat-map.map: "+t.message),console.error(t)}},Hb=function(t){(t=t||{}).shape=t.shape||"circle";var e=t.patternSize||5,n=t.minSize||1,i=t.maxSize||5.5;return t.bckColor=t.bckColor||"white",t.symbColor=t.symbColor||"black",function(r,a){r.selectAll(".em-fill-pattern").remove();for(var o=0;o<a;o++){var s=n+(i-n)*o/(a-1),l=r.append("pattern").attr("class","em-fill-pattern").attr("id","pattern_"+o).attr("x","0").attr("y","0").attr("width",e).attr("height",e).attr("patternUnits","userSpaceOnUse");l.append("rect").attr("x",0).attr("y",0).attr("width",e).attr("height",e).style("stroke","none").style("fill",t.bckColor),"square"==t.shape?l.append("rect").attr("x",0).attr("y",0).attr("width",s).attr("height",s).style("stroke","none").style("fill",t.symbColor):l.append("circle").attr("cx",.5*e).attr("cy",.5*e).attr("r",.5*s).style("stroke","none").style("fill",t.symbColor)}}},Vb=function(){return Cf},$b="4.3.13"})(),i})()));