gridviz 2.0.10 → 2.0.11

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 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.gviz=e():t.gviz=e()}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(){}function r(t){return null==t?n:function(){return this.querySelector(t)}}function o(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function i(){return[]}function a(t){return null==t?i:function(){return this.querySelectorAll(t)}}function u(t){return function(){return this.matches(t)}}function l(t){return function(e){return e.matches(t)}}t.r(e),t.d(e,{App:()=>jo,BackgroundLayer:()=>fo,BoundaryLayer:()=>xo,CSVGrid:()=>Gr,ColorCategoryLegend:()=>Ru,ColorDiscreteLegend:()=>Cu,ColorLegend:()=>xu,CompositionStyle:()=>ni,ContourStyle:()=>$i,Dataset:()=>hr,DatasetComponent:()=>Fr,DotDensityStyle:()=>ya,JoyPlotStyle:()=>Vo,KernelSmoothingStyle:()=>Pi,LabelLayer:()=>vo,Layer:()=>ar,LegoStyle:()=>$a,MosaicStyle:()=>Qa,PillarStyle:()=>Mi,SegmentStyle:()=>ci,SegmentWidthLegend:()=>$u,ShapeColorSizeStyle:()=>Ro,SideCatStyle:()=>Ji,SideStyle:()=>Di,SizeLegend:()=>Nu,SquareColorCatWGLStyle:()=>Fa,SquareColorWGLStyle:()=>_a,StrokeStyle:()=>Do,TanakaStyle:()=>ja,TextStyle:()=>di,TiledGrid:()=>uo,getClass:()=>Jr,getEuronymeLabelLayer:()=>wc,getEurostatBoundariesLayer:()=>xc,getParameterByName:()=>Sc,goToStraight:()=>Vu,sCircleHigh:()=>Qu,sCircleLow:()=>Ju,sExp:()=>Hu,sExpInverse:()=>tl,sExpRev:()=>Ku,sExpRevInverse:()=>el,sPow:()=>Xu,sPowInverse:()=>nl,sPowRev:()=>qu,sPowRevInverse:()=>rl,zoomTo:()=>Yu});var c=Array.prototype.find;function f(){return this.firstElementChild}var s=Array.prototype.filter;function h(){return Array.from(this.children)}function y(t){return new Array(t.length)}function p(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function v(t){return function(){return t}}function d(t,e,n,r,o,i){for(var a,u=0,l=e.length,c=i.length;u<c;++u)(a=e[u])?(a.__data__=i[u],r[u]=a):n[u]=new p(t,i[u]);for(;u<l;++u)(a=e[u])&&(o[u]=a)}function m(t,e,n,r,o,i,a){var u,l,c,f=new Map,s=e.length,h=i.length,y=new Array(s);for(u=0;u<s;++u)(l=e[u])&&(y[u]=c=a.call(l,l.__data__,u,e)+"",f.has(c)?o[u]=l:f.set(c,l));for(u=0;u<h;++u)c=a.call(t,i[u],u,i)+"",(l=f.get(c))?(r[u]=l,l.__data__=i[u],f.delete(c)):n[u]=new p(t,i[u]);for(u=0;u<s;++u)(l=e[u])&&f.get(y[u])===l&&(o[u]=l)}function b(t){return t.__data__}function g(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function w(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}p.prototype={constructor:p,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 x="http://www.w3.org/1999/xhtml";const S={svg:"http://www.w3.org/2000/svg",xhtml:x,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),S.hasOwnProperty(e)?{space:S[e],local:t}:t}function P(t){return function(){this.removeAttribute(t)}}function O(t){return function(){this.removeAttributeNS(t.space,t.local)}}function j(t,e){return function(){this.setAttribute(t,e)}}function C(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function k(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function E(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(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function A(t){return function(){this.style.removeProperty(t)}}function M(t,e,n){return function(){this.style.setProperty(t,e,n)}}function R(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function z(t,e){return t.style.getPropertyValue(e)||T(t).getComputedStyle(t,null).getPropertyValue(e)}function F(t){return function(){delete this[t]}}function I(t,e){return function(){this[t]=e}}function L(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function B(t){return t.trim().split(/^|\s+/)}function N(t){return t.classList||new D(t)}function D(t){this._node=t,this._names=B(t.getAttribute("class")||"")}function Z(t,e){for(var n=N(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function U(t,e){for(var n=N(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function W(t){return function(){Z(this,t)}}function G(t){return function(){U(this,t)}}function $(t,e){return function(){(e.apply(this,arguments)?Z:U)(this,t)}}function Y(){this.textContent=""}function V(t){return function(){this.textContent=t}}function X(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function q(){this.innerHTML=""}function H(t){return function(){this.innerHTML=t}}function K(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function J(){this.nextSibling&&this.parentNode.appendChild(this)}function Q(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function tt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===x&&e.documentElement.namespaceURI===x?e.createElement(t):e.createElementNS(n,t)}}function et(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function nt(t){var e=_(t);return(e.local?et:tt)(e)}function rt(){return null}function ot(){var t=this.parentNode;t&&t.removeChild(this)}function it(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function at(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ut(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}}))}function lt(t){return function(){var e=this.__on;if(e){for(var n,r=0,o=-1,i=e.length;r<i;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?e.length=o:delete this.__on}}}function ct(t,e,n){return function(){var r,o=this.__on,i=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(o)for(var a=0,u=o.length;a<u;++a)if((r=o[a]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),void(r.value=e);this.addEventListener(t.type,i,n),r={type:t.type,name:t.name,value:e,listener:i,options:n},o?o.push(r):this.__on=[r]}}function ft(t,e,n){var r=T(t),o=r.CustomEvent;"function"==typeof o?o=new o(e,n):(o=r.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function st(t,e){return function(){return ft(this,t,e)}}function ht(t,e){return function(){return ft(this,t,e.apply(this,arguments))}}D.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 yt=[null];function pt(t,e){this._groups=t,this._parents=e}function vt(){return new pt([[document.documentElement]],yt)}pt.prototype=vt.prototype={constructor:pt,select:function(t){"function"!=typeof t&&(t=r(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var a,u,l=e[i],c=l.length,f=o[i]=new Array(c),s=0;s<c;++s)(a=l[s])&&(u=t.call(a,a.__data__,s,l))&&("__data__"in a&&(u.__data__=a.__data__),f[s]=u);return new pt(o,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return o(t.apply(this,arguments))}}(t):a(t);for(var e=this._groups,n=e.length,r=[],i=[],u=0;u<n;++u)for(var l,c=e[u],f=c.length,s=0;s<f;++s)(l=c[s])&&(r.push(t.call(l,l.__data__,s,c)),i.push(l));return new pt(r,i)},selectChild:function(t){return this.select(null==t?f:function(t){return function(){return c.call(this.children,t)}}("function"==typeof t?t:l(t)))},selectChildren:function(t){return this.selectAll(null==t?h:function(t){return function(){return s.call(this.children,t)}}("function"==typeof t?t:l(t)))},filter:function(t){"function"!=typeof t&&(t=u(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,a=e[o],l=a.length,c=r[o]=[],f=0;f<l;++f)(i=a[f])&&t.call(i,i.__data__,f,a)&&c.push(i);return new pt(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,b);var n=e?m:d,r=this._parents,o=this._groups;"function"!=typeof t&&(t=v(t));for(var i=o.length,a=new Array(i),u=new Array(i),l=new Array(i),c=0;c<i;++c){var f=r[c],s=o[c],h=s.length,y=g(t.call(f,f&&f.__data__,c,r)),p=y.length,w=u[c]=new Array(p),x=a[c]=new Array(p),S=l[c]=new Array(h);n(f,s,w,x,S,y,e);for(var _,P,O=0,j=0;O<p;++O)if(_=w[O]){for(O>=j&&(j=O+1);!(P=x[j])&&++j<p;);_._next=P||null}}return(a=new pt(a,r))._enter=u,a._exit=l,a},enter:function(){return new pt(this._enter||this._groups.map(y),this._parents)},exit:function(){return new pt(this._exit||this._groups.map(y),this._parents)},join:function(t,e,n){var r=this.enter(),o=this,i=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=e&&(o=e(o))&&(o=o.selection()),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,o=n.length,i=r.length,a=Math.min(o,i),u=new Array(o),l=0;l<a;++l)for(var c,f=n[l],s=r[l],h=f.length,y=u[l]=new Array(h),p=0;p<h;++p)(c=f[p]||s[p])&&(y[p]=c);for(;l<o;++l)u[l]=n[l];return new pt(u,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,o=t[e],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=w);for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var a,u=n[i],l=u.length,c=o[i]=new Array(l),f=0;f<l;++f)(a=u[f])&&(c[f]=a);c.sort(e)}return new pt(o,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 r=t[e],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}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,r=e.length;n<r;++n)for(var o,i=e[n],a=0,u=i.length;a<u;++a)(o=i[a])&&t.call(o,o.__data__,a,i);return this},attr:function(t,e){var n=_(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?O:P:"function"==typeof e?n.local?E:k:n.local?C:j)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?A:"function"==typeof e?R:M)(t,e,null==n?"":n)):z(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?F:"function"==typeof e?L:I)(t,e)):this.node()[t]},classed:function(t,e){var n=B(t+"");if(arguments.length<2){for(var r=N(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof e?$:e?W:G)(n,e))},text:function(t){return arguments.length?this.each(null==t?Y:("function"==typeof t?X:V)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?q:("function"==typeof t?K:H)(t)):this.node().innerHTML},raise:function(){return this.each(J)},lower:function(){return this.each(Q)},append:function(t){var e="function"==typeof t?t:nt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:nt(t),o=null==e?rt:"function"==typeof e?e:r(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)}))},remove:function(){return this.each(ot)},clone:function(t){return this.select(t?at:it)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,o,i=ut(t+""),a=i.length;if(!(arguments.length<2)){for(u=e?ct:lt,r=0;r<a;++r)this.each(u(i[r],e,n));return this}var u=this.node().__on;if(u)for(var l,c=0,f=u.length;c<f;++c)for(r=0,l=u[c];r<a;++r)if((o=i[r]).type===l.type&&o.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?ht:st)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r,o=t[e],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};const dt=vt;function mt(t){return"string"==typeof t?new pt([[document.querySelector(t)]],[document.documentElement]):new pt([[t]],yt)}var bt={value:()=>{}};function gt(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new wt(r)}function wt(t){this._=t}function xt(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function St(t,e){for(var n,r=0,o=t.length;r<o;++r)if((n=t[r]).name===e)return n.value}function _t(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=bt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}wt.prototype=gt.prototype={constructor:wt,on:function(t,e){var n,r=this._,o=xt(t+"",r),i=-1,a=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++i<a;)if(n=(t=o[i]).type)r[n]=_t(r[n],t.name,e);else if(null==e)for(n in r)r[n]=_t(r[n],t.name,null);return this}for(;++i<a;)if((n=(t=o[i]).type)&&(n=St(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new wt(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,n=(r=this._[t]).length;i<n;++i)r[i].value.apply(e,o)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)}};const Pt=gt,Ot={capture:!0,passive:!1};function jt(t){t.preventDefault(),t.stopImmediatePropagation()}function Ct(t){var e=t.document.documentElement,n=mt(t).on("dragstart.drag",jt,Ot);"onselectstart"in e?n.on("selectstart.drag",jt,Ot):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function kt(t,e){var n=t.document.documentElement,r=mt(t).on("dragstart.drag",null);e&&(r.on("click.drag",jt,Ot),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function Et(t){return((t=Math.exp(t))+1/t)/2}const Tt=function t(e,n,r){function o(t,o){var i,a,u=t[0],l=t[1],c=t[2],f=o[0],s=o[1],h=o[2],y=f-u,p=s-l,v=y*y+p*p;if(v<1e-12)a=Math.log(h/c)/e,i=function(t){return[u+t*y,l+t*p,c*Math.exp(e*t*a)]};else{var d=Math.sqrt(v),m=(h*h-c*c+r*v)/(2*c*n*d),b=(h*h-c*c-r*v)/(2*h*n*d),g=Math.log(Math.sqrt(m*m+1)-m),w=Math.log(Math.sqrt(b*b+1)-b);a=(w-g)/e,i=function(t){var r,o=t*a,i=Et(g),f=c/(n*d)*(i*(r=e*o+g,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[u+f*y,l+f*p,c*i/Et(e*o+g)]}}return i.duration=1e3*a*e/Math.SQRT2,i}return o.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},o}(Math.SQRT2,2,4);function At(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 r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}var Mt,Rt,zt=0,Ft=0,It=0,Lt=0,Bt=0,Nt=0,Dt="object"==typeof performance&&performance.now?performance:Date,Zt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ut(){return Bt||(Zt(Wt),Bt=Dt.now()+Nt)}function Wt(){Bt=0}function Gt(){this._call=this._time=this._next=null}function $t(t,e,n){var r=new Gt;return r.restart(t,e,n),r}function Yt(){Bt=(Lt=Dt.now())+Nt,zt=Ft=0;try{!function(){Ut(),++zt;for(var t,e=Mt;e;)(t=Bt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--zt}()}finally{zt=0,function(){for(var t,e,n=Mt,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Mt=e);Rt=t,Xt(r)}(),Bt=0}}function Vt(){var t=Dt.now(),e=t-Lt;e>1e3&&(Nt-=e,Lt=t)}function Xt(t){zt||(Ft&&(Ft=clearTimeout(Ft)),t-Bt>24?(t<1/0&&(Ft=setTimeout(Yt,t-Dt.now()-Nt)),It&&(It=clearInterval(It))):(It||(Lt=Dt.now(),It=setInterval(Vt,1e3)),zt=1,Zt(Yt)))}function qt(t,e,n){var r=new Gt;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}Gt.prototype=$t.prototype={constructor:Gt,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Ut():+n)+(null==e?0:+e),this._next||Rt===this||(Rt?Rt._next=this:Mt=this,Rt=this),this._call=t,this._time=n,Xt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xt())}};var Ht=Pt("start","end","cancel","interrupt"),Kt=[];function Jt(t,e,n,r,o,i){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,o=t.__transition;function i(l){var c,f,s,h;if(1!==n.state)return u();for(c in o)if((h=o[c]).name===n.name){if(3===h.state)return qt(i);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[c]):+c<e&&(h.state=6,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete o[c])}if(qt((function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(l))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(s=n.tween.length),c=0,f=-1;c<s;++c)(h=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(r[++f]=h);r.length=f+1}}function a(e){for(var o=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(u),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(t,o);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){for(var r in n.state=6,n.timer.stop(),delete o[e],o)return;delete t.__transition}o[e]=n,n.timer=$t((function(t){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=t&&i(t-n.delay)}),0,n.time)}(t,n,{name:e,index:r,group:o,on:Ht,tween:Kt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Qt(t,e){var n=ee(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function te(t,e){var n=ee(t,e);if(n.state>3)throw new Error("too late; already running");return n}function ee(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function ne(t,e){var n,r,o,i=t.__transition,a=!0;if(i){for(o in e=null==e?null:e+"",i)(n=i[o]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete i[o]):a=!1;a&&delete t.__transition}}function re(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var oe,ie=180/Math.PI,ae={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ue(t,e,n,r,o,i){var a,u,l;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,l/=u),t*r<e*n&&(t=-t,e=-e,l=-l,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*ie,skewX:Math.atan(l)*ie,scaleX:a,scaleY:u}}function le(t,e,n,r){function o(t){return t.length?t.pop()+" ":""}return function(i,a){var u=[],l=[];return i=t(i),a=t(a),function(t,r,o,i,a,u){if(t!==o||r!==i){var l=a.push("translate(",null,e,null,n);u.push({i:l-4,x:re(t,o)},{i:l-2,x:re(r,i)})}else(o||i)&&a.push("translate("+o+e+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,u,l),function(t,e,n,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:n.push(o(n)+"rotate(",null,r)-2,x:re(t,e)})):e&&n.push(o(n)+"rotate("+e+r)}(i.rotate,a.rotate,u,l),function(t,e,n,i){t!==e?i.push({i:n.push(o(n)+"skewX(",null,r)-2,x:re(t,e)}):e&&n.push(o(n)+"skewX("+e+r)}(i.skewX,a.skewX,u,l),function(t,e,n,r,i,a){if(t!==n||e!==r){var u=i.push(o(i)+"scale(",null,",",null,")");a.push({i:u-4,x:re(t,n)},{i:u-2,x:re(e,r)})}else 1===n&&1===r||i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,u,l),i=a=null,function(t){for(var e,n=-1,r=l.length;++n<r;)u[(e=l[n]).i]=e.x(t);return u.join("")}}}var ce=le((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?ae:ue(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),fe=le((function(t){return null==t?ae:(oe||(oe=document.createElementNS("http://www.w3.org/2000/svg","g")),oe.setAttribute("transform",t),(t=oe.transform.baseVal.consolidate())?ue((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):ae)}),", ",")",")");function se(t,e){var n,r;return function(){var o=te(this,t),i=o.tween;if(i!==n)for(var a=0,u=(r=n=i).length;a<u;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}o.tween=r}}function he(t,e,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=te(this,t),a=i.tween;if(a!==r){o=(r=a).slice();for(var u={name:e,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===e){o[l]=u;break}l===c&&o.push(u)}i.tween=o}}function ye(t,e,n){var r=t._id;return t.each((function(){var t=te(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return ee(t,r).value[e]}}function pe(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ve(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function de(){}var me=.7,be=1/me,ge="\\s*([+-]?\\d+)\\s*",we="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",xe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Se=/^#([0-9a-f]{3,8})$/,_e=new RegExp(`^rgb\\(${ge},${ge},${ge}\\)$`),Pe=new RegExp(`^rgb\\(${xe},${xe},${xe}\\)$`),Oe=new RegExp(`^rgba\\(${ge},${ge},${ge},${we}\\)$`),je=new RegExp(`^rgba\\(${xe},${xe},${xe},${we}\\)$`),Ce=new RegExp(`^hsl\\(${we},${xe},${xe}\\)$`),ke=new RegExp(`^hsla\\(${we},${xe},${xe},${we}\\)$`),Ee={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 Te(){return this.rgb().formatHex()}function Ae(){return this.rgb().formatRgb()}function Me(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Se.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Re(e):3===n?new Le(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ze(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ze(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=_e.exec(t))?new Le(e[1],e[2],e[3],1):(e=Pe.exec(t))?new Le(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Oe.exec(t))?ze(e[1],e[2],e[3],e[4]):(e=je.exec(t))?ze(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Ce.exec(t))?We(e[1],e[2]/100,e[3]/100,1):(e=ke.exec(t))?We(e[1],e[2]/100,e[3]/100,e[4]):Ee.hasOwnProperty(t)?Re(Ee[t]):"transparent"===t?new Le(NaN,NaN,NaN,0):null}function Re(t){return new Le(t>>16&255,t>>8&255,255&t,1)}function ze(t,e,n,r){return r<=0&&(t=e=n=NaN),new Le(t,e,n,r)}function Fe(t){return t instanceof de||(t=Me(t)),t?new Le((t=t.rgb()).r,t.g,t.b,t.opacity):new Le}function Ie(t,e,n,r){return 1===arguments.length?Fe(t):new Le(t,e,n,null==r?1:r)}function Le(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Be(){return`#${Ue(this.r)}${Ue(this.g)}${Ue(this.b)}`}function Ne(){const t=De(this.opacity);return`${1===t?"rgb(":"rgba("}${Ze(this.r)}, ${Ze(this.g)}, ${Ze(this.b)}${1===t?")":`, ${t})`}`}function De(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ze(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ue(t){return((t=Ze(t))<16?"0":"")+t.toString(16)}function We(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new $e(t,e,n,r)}function Ge(t){if(t instanceof $e)return new $e(t.h,t.s,t.l,t.opacity);if(t instanceof de||(t=Me(t)),!t)return new $e;if(t instanceof $e)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),a=NaN,u=i-o,l=(i+o)/2;return u?(a=e===i?(n-r)/u+6*(n<r):n===i?(r-e)/u+2:(e-n)/u+4,u/=l<.5?i+o:2-i-o,a*=60):u=l>0&&l<1?0:a,new $e(a,u,l,t.opacity)}function $e(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ye(t){return(t=(t||0)%360)<0?t+360:t}function Ve(t){return Math.max(0,Math.min(1,t||0))}function Xe(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 qe(t,e,n,r,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*n+(1+3*t+3*i-3*a)*r+a*o)/6}pe(de,Me,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Te,formatHex:Te,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ge(this).formatHsl()},formatRgb:Ae,toString:Ae}),pe(Le,Ie,ve(de,{brighter(t){return t=null==t?be:Math.pow(be,t),new Le(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?me:Math.pow(me,t),new Le(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Le(Ze(this.r),Ze(this.g),Ze(this.b),De(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:Be,formatHex:Be,formatHex8:function(){return`#${Ue(this.r)}${Ue(this.g)}${Ue(this.b)}${Ue(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ne,toString:Ne})),pe($e,(function(t,e,n,r){return 1===arguments.length?Ge(t):new $e(t,e,n,null==r?1:r)}),ve(de,{brighter(t){return t=null==t?be:Math.pow(be,t),new $e(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?me:Math.pow(me,t),new $e(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,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new Le(Xe(t>=240?t-240:t+120,o,r),Xe(t,o,r),Xe(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new $e(Ye(this.h),Ve(this.s),Ve(this.l),De(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=De(this.opacity);return`${1===t?"hsl(":"hsla("}${Ye(this.h)}, ${100*Ve(this.s)}%, ${100*Ve(this.l)}%${1===t?")":`, ${t})`}`}}));const He=t=>()=>t;function Ke(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):He(isNaN(t)?e:t)}const Je=function t(e){var n=function(t){return 1==(t=+t)?Ke: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(r){return Math.pow(t+r*e,n)}}(e,n,t):He(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=Ie(t)).r,(e=Ie(e)).r),o=n(t.g,e.g),i=n(t.b,e.b),a=Ke(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Qe(t){return function(e){var n,r,o=e.length,i=new Array(o),a=new Array(o),u=new Array(o);for(n=0;n<o;++n)r=Ie(e[n]),i[n]=r.r||0,a[n]=r.g||0,u[n]=r.b||0;return i=t(i),a=t(a),u=t(u),r.opacity=1,function(t){return r.r=i(t),r.g=a(t),r.b=u(t),r+""}}}Qe((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[r],i=t[r+1],a=r>0?t[r-1]:2*o-i,u=r<e-1?t[r+2]:2*i-o;return qe((n-r/e)*e,a,o,i,u)}})),Qe((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),o=t[(r+e-1)%e],i=t[r%e],a=t[(r+1)%e],u=t[(r+2)%e];return qe((n-r/e)*e,o,i,a,u)}}));var tn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,en=new RegExp(tn.source,"g");function nn(t,e){var n,r,o,i=tn.lastIndex=en.lastIndex=0,a=-1,u=[],l=[];for(t+="",e+="";(n=tn.exec(t))&&(r=en.exec(e));)(o=r.index)>i&&(o=e.slice(i,o),u[a]?u[a]+=o:u[++a]=o),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,l.push({i:a,x:re(n,r)})),i=en.lastIndex;return i<e.length&&(o=e.slice(i),u[a]?u[a]+=o:u[++a]=o),u.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,r=0;r<e;++r)u[(n=l[r]).i]=n.x(t);return u.join("")})}function rn(t,e){var n;return("number"==typeof e?re:e instanceof Me?Je:(n=Me(e))?(e=n,Je):nn)(t,e)}function on(t){return function(){this.removeAttribute(t)}}function an(t){return function(){this.removeAttributeNS(t.space,t.local)}}function un(t,e,n){var r,o,i=n+"";return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function ln(t,e,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function cn(t,e,n){var r,o,i;return function(){var a,u,l=n(this);if(null!=l)return(a=this.getAttribute(t))===(u=l+"")?null:a===r&&u===o?i:(o=u,i=e(r=a,l));this.removeAttribute(t)}}function fn(t,e,n){var r,o,i;return function(){var a,u,l=n(this);if(null!=l)return(a=this.getAttributeNS(t.space,t.local))===(u=l+"")?null:a===r&&u===o?i:(o=u,i=e(r=a,l));this.removeAttributeNS(t.space,t.local)}}function sn(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function hn(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function yn(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&hn(t,o)),n}return o._value=e,o}function pn(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&sn(t,o)),n}return o._value=e,o}function vn(t,e){return function(){Qt(this,t).delay=+e.apply(this,arguments)}}function dn(t,e){return e=+e,function(){Qt(this,t).delay=e}}function mn(t,e){return function(){te(this,t).duration=+e.apply(this,arguments)}}function bn(t,e){return e=+e,function(){te(this,t).duration=e}}function gn(t,e){if("function"!=typeof e)throw new Error;return function(){te(this,t).ease=e}}function wn(t,e,n){var r,o,i=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)?Qt:te;return function(){var a=i(this,t),u=a.on;u!==r&&(o=(r=u).copy()).on(e,n),a.on=o}}var xn=dt.prototype.constructor;function Sn(t){return function(){this.style.removeProperty(t)}}function _n(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Pn(t,e,n){var r,o;function i(){var i=e.apply(this,arguments);return i!==o&&(r=(o=i)&&_n(t,i,n)),r}return i._value=e,i}function On(t){return function(e){this.textContent=t.call(this,e)}}function jn(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&On(r)),e}return r._value=t,r}var Cn=0;function kn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function En(){return++Cn}var Tn=dt.prototype;kn.prototype=function(t){return dt().transition(t)}.prototype={constructor:kn,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=r(t));for(var o=this._groups,i=o.length,a=new Array(i),u=0;u<i;++u)for(var l,c,f=o[u],s=f.length,h=a[u]=new Array(s),y=0;y<s;++y)(l=f[y])&&(c=t.call(l,l.__data__,y,f))&&("__data__"in l&&(c.__data__=l.__data__),h[y]=c,Jt(h[y],e,n,y,h,ee(l,n)));return new kn(a,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=a(t));for(var r=this._groups,o=r.length,i=[],u=[],l=0;l<o;++l)for(var c,f=r[l],s=f.length,h=0;h<s;++h)if(c=f[h]){for(var y,p=t.call(c,c.__data__,h,f),v=ee(c,n),d=0,m=p.length;d<m;++d)(y=p[d])&&Jt(y,e,n,d,p,v);i.push(p),u.push(c)}return new kn(i,u,e,n)},selectChild:Tn.selectChild,selectChildren:Tn.selectChildren,filter:function(t){"function"!=typeof t&&(t=u(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,a=e[o],l=a.length,c=r[o]=[],f=0;f<l;++f)(i=a[f])&&t.call(i,i.__data__,f,a)&&c.push(i);return new kn(r,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,r=e.length,o=n.length,i=Math.min(r,o),a=new Array(r),u=0;u<i;++u)for(var l,c=e[u],f=n[u],s=c.length,h=a[u]=new Array(s),y=0;y<s;++y)(l=c[y]||f[y])&&(h[y]=l);for(;u<r;++u)a[u]=e[u];return new kn(a,this._parents,this._name,this._id)},selection:function(){return new xn(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=En(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,u=r[i],l=u.length,c=0;c<l;++c)if(a=u[c]){var f=ee(a,e);Jt(a,t,n,c,u,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new kn(r,this._parents,t,n)},call:Tn.call,nodes:Tn.nodes,node:Tn.node,size:Tn.size,empty:Tn.empty,each:Tn.each,on:function(t,e){var n=this._id;return arguments.length<2?ee(this.node(),n).on.on(t):this.each(wn(n,t,e))},attr:function(t,e){var n=_(t),r="transform"===n?fe:rn;return this.attrTween(t,"function"==typeof e?(n.local?fn:cn)(n,r,ye(this,"attr."+t,e)):null==e?(n.local?an:on)(n):(n.local?ln:un)(n,r,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 r=_(t);return this.tween(n,(r.local?yn:pn)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?ce:rn;return null==e?this.styleTween(t,function(t,e){var n,r,o;return function(){var i=z(this,t),a=(this.style.removeProperty(t),z(this,t));return i===a?null:i===n&&a===r?o:o=e(n=i,r=a)}}(t,r)).on("end.style."+t,Sn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,o,i;return function(){var a=z(this,t),u=n(this),l=u+"";return null==u&&(this.style.removeProperty(t),l=u=z(this,t)),a===l?null:a===r&&l===o?i:(o=l,i=e(r=a,u))}}(t,r,ye(this,"style."+t,e))).each(function(t,e){var n,r,o,i,a="style."+e,u="end."+a;return function(){var l=te(this,t),c=l.on,f=null==l.value[a]?i||(i=Sn(e)):void 0;c===n&&o===f||(r=(n=c).copy()).on(u,o=f),l.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,o,i=n+"";return function(){var a=z(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,Pn(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}}(ye(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,jn(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 r,o=ee(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===t)return r.value;return null}return this.each((null==e?se:he)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?vn:dn)(e,t)):ee(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?mn:bn)(e,t)):ee(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(gn(e,t)):ee(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;te(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,r=n._id,o=n.size();return new Promise((function(i,a){var u={value:a},l={value:function(){0==--o&&i()}};n.each((function(){var n=te(this,r),o=n.on;o!==t&&((e=(t=o).copy())._.cancel.push(u),e._.interrupt.push(u),e._.end.push(l)),n.on=e})),0===o&&i()}))},[Symbol.iterator]:Tn[Symbol.iterator]};var An={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Mn(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}dt.prototype.interrupt=function(t){return this.each((function(){ne(this,t)}))},dt.prototype.transition=function(t){var e,n;t instanceof kn?(e=t._id,t=t._name):(e=En(),(n=An).time=Ut(),t=null==t?null:t+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,u=r[i],l=u.length,c=0;c<l;++c)(a=u[c])&&Jt(a,t,e,c,u,n||Mn(a,e));return new kn(r,this._parents,t,e)};const Rn=t=>()=>t;function zn(t,{sourceEvent:e,target:n,transform:r,dispatch:o}){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:r,enumerable:!0,configurable:!0},_:{value:o}})}function Fn(t,e,n){this.k=t,this.x=e,this.y=n}Fn.prototype={constructor:Fn,scale:function(t){return 1===t?this:new Fn(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Fn(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 In=new Fn(1,0,0);function Ln(t){t.stopImmediatePropagation()}function Bn(t){t.preventDefault(),t.stopImmediatePropagation()}function Nn(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Dn(){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 Zn(){return this.__zoom||In}function Un(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Wn(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gn(t,e,n){var r=t.invertX(e[0][0])-n[0][0],o=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function $n(){var t,e,n,r=Nn,o=Dn,i=Gn,a=Un,u=Wn,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],f=250,s=Tt,h=Pt("start","zoom","end"),y=500,p=0,v=10;function d(t){t.property("__zoom",Zn).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",O).filter(u).on("touchstart.zoom",j).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",k).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new Fn(e,t.x,t.y)}function b(t,e,n){var r=e[0]-n[0]*t.k,o=e[1]-n[1]*t.k;return r===t.x&&o===t.y?t:new Fn(t.k,r,o)}function g(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,e,n,r){t.on("start.zoom",(function(){x(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,i=arguments,a=x(t,i).event(r),u=o.apply(t,i),l=null==n?g(u):"function"==typeof n?n.apply(t,i):n,c=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),f=t.__zoom,h="function"==typeof e?e.apply(t,i):e,y=s(f.invert(l).concat(c/f.k),h.invert(l).concat(c/h.k));return function(t){if(1===t)t=h;else{var e=y(t),n=c/e[2];t=new Fn(n,l[0]-e[0]*n,l[1]-e[1]*n)}a.zoom(null,t)}}))}function x(t,e,n){return!n&&t.__zooming||new S(t,e)}function S(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=o.apply(t,e),this.taps=0}function _(t,...e){if(r.apply(this,arguments)){var n=x(this,e).event(t),o=this.__zoom,u=Math.max(l[0],Math.min(l[1],o.k*Math.pow(2,a.apply(this,arguments)))),f=At(t);if(n.wheel)n.mouse[0][0]===f[0]&&n.mouse[0][1]===f[1]||(n.mouse[1]=o.invert(n.mouse[0]=f)),clearTimeout(n.wheel);else{if(o.k===u)return;n.mouse=[f,o.invert(f)],ne(this),n.start()}Bn(t),n.wheel=setTimeout(s,150),n.zoom("mouse",i(b(m(o,u),n.mouse[0],n.mouse[1]),n.extent,c))}function s(){n.wheel=null,n.end()}}function P(t,...e){if(!n&&r.apply(this,arguments)){var o=t.currentTarget,a=x(this,e,!0).event(t),u=mt(t.view).on("mousemove.zoom",h,!0).on("mouseup.zoom",y,!0),l=At(t,o),f=t.clientX,s=t.clientY;Ct(t.view),Ln(t),a.mouse=[l,this.__zoom.invert(l)],ne(this),a.start()}function h(t){if(Bn(t),!a.moved){var e=t.clientX-f,n=t.clientY-s;a.moved=e*e+n*n>p}a.event(t).zoom("mouse",i(b(a.that.__zoom,a.mouse[0]=At(t,o),a.mouse[1]),a.extent,c))}function y(t){u.on("mousemove.zoom mouseup.zoom",null),kt(t.view,a.moved),Bn(t),a.event(t).end()}}function O(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=At(t.changedTouches?t.changedTouches[0]:t,this),u=n.invert(a),l=n.k*(t.shiftKey?.5:2),s=i(b(m(n,l),a,u),o.apply(this,e),c);Bn(t),f>0?mt(this).transition().duration(f).call(w,s,a,t):mt(this).call(d.transform,s,a,t)}}function j(n,...o){if(r.apply(this,arguments)){var i,a,u,l,c=n.touches,f=c.length,s=x(this,o,n.changedTouches.length===f).event(n);for(Ln(n),a=0;a<f;++a)l=[l=At(u=c[a],this),this.__zoom.invert(l),u.identifier],s.touch0?s.touch1||s.touch0[2]===l[2]||(s.touch1=l,s.taps=0):(s.touch0=l,i=!0,s.taps=1+!!t);t&&(t=clearTimeout(t)),i&&(s.taps<2&&(e=l[0],t=setTimeout((function(){t=null}),y)),ne(this),s.start())}}function C(t,...e){if(this.__zooming){var n,r,o,a,u=x(this,e).event(t),l=t.changedTouches,f=l.length;for(Bn(t),n=0;n<f;++n)o=At(r=l[n],this),u.touch0&&u.touch0[2]===r.identifier?u.touch0[0]=o:u.touch1&&u.touch1[2]===r.identifier&&(u.touch1[0]=o);if(r=u.that.__zoom,u.touch1){var s=u.touch0[0],h=u.touch0[1],y=u.touch1[0],p=u.touch1[1],v=(v=y[0]-s[0])*v+(v=y[1]-s[1])*v,d=(d=p[0]-h[0])*d+(d=p[1]-h[1])*d;r=m(r,Math.sqrt(v/d)),o=[(s[0]+y[0])/2,(s[1]+y[1])/2],a=[(h[0]+p[0])/2,(h[1]+p[1])/2]}else{if(!u.touch0)return;o=u.touch0[0],a=u.touch0[1]}u.zoom("touch",i(b(r,o,a),u.extent,c))}}function k(t,...r){if(this.__zooming){var o,i,a=x(this,r).event(t),u=t.changedTouches,l=u.length;for(Ln(t),n&&clearTimeout(n),n=setTimeout((function(){n=null}),y),o=0;o<l;++o)i=u[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=At(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<v)){var c=mt(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return d.transform=function(t,e,n,r){var o=t.selection?t.selection():t;o.property("__zoom",Zn),t!==o?w(t,e,n,r):o.interrupt().each((function(){x(this,arguments).event(r).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},d.scaleBy=function(t,e,n,r){d.scaleTo(t,(function(){var t=this.__zoom.k,n="function"==typeof e?e.apply(this,arguments):e;return t*n}),n,r)},d.scaleTo=function(t,e,n,r){d.transform(t,(function(){var t=o.apply(this,arguments),r=this.__zoom,a=null==n?g(t):"function"==typeof n?n.apply(this,arguments):n,u=r.invert(a),l="function"==typeof e?e.apply(this,arguments):e;return i(b(m(r,l),a,u),t,c)}),n,r)},d.translateBy=function(t,e,n,r){d.transform(t,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)}),null,r)},d.translateTo=function(t,e,n,r,a){d.transform(t,(function(){var t=o.apply(this,arguments),a=this.__zoom,u=null==r?g(t):"function"==typeof r?r.apply(this,arguments):r;return i(In.translate(u[0],u[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,c)}),r,a)},S.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=mt(this.that).datum();h.call(t,this.that,new zn(t,{sourceEvent:this.sourceEvent,target:d,type:t,transform:this.that.__zoom,dispatch:h}),e)}},d.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:Rn(+t),d):a},d.filter=function(t){return arguments.length?(r="function"==typeof t?t:Rn(!!t),d):r},d.touchable=function(t){return arguments.length?(u="function"==typeof t?t:Rn(!!t),d):u},d.extent=function(t){return arguments.length?(o="function"==typeof t?t:Rn([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),d):o},d.scaleExtent=function(t){return arguments.length?(l[0]=+t[0],l[1]=+t[1],d):[l[0],l[1]]},d.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],d):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},d.constrain=function(t){return arguments.length?(i=t,d):i},d.duration=function(t){return arguments.length?(f=+t,d):f},d.interpolate=function(t){return arguments.length?(s=t,d):s},d.on=function(){var t=h.on.apply(h,arguments);return t===h?d:t},d.clickDistance=function(t){return arguments.length?(p=(t=+t)*t,d):Math.sqrt(p)},d.tapDistance=function(t){return arguments.length?(v=+t,d):v},d}function Yn(t){return Yn="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},Yn(t)}function Vn(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 Xn(t,e);var n=Object.prototype.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)?Xn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function qn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Yn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Yn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Yn(o)?o:String(o)),r)}var o}Fn.prototype;var Kn=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;qn(this,t),i=i||{},this.canvas=e,this.w=this.canvas.offsetWidth,this.h=this.canvas.offsetHeight,this.canvas.width=this.w,this.canvas.height=this.h;var a=this.canvas.getContext("2d");if(!a)throw"Impossible to create canvas 2D context";this.ctx=a,this.center=r||{x:.5*this.w,y:.5*this.h},this.zf=o,this.backgroundColor=i.backgroundColor||"white",this.onZoomStartFun=i.onZoomStartFun,this.onZoomEndFun=i.onZoomEndFun,this.extGeo={xMin:NaN,xMax:NaN,yMin:NaN,yMax:NaN},this.updateExtentGeo();var u=In,l=$n().wheelDelta((function(t){return-t.deltaY*(1===t.deltaMode?.07:t.deltaMode?1:.004)})).on("zoom",(function(t){var e=t.transform,r=u.k/e.k;if(1==r){var o=u.x-e.x,i=u.y-e.y;n.pan(o*n.getZf(),-i*n.getZf())}else{var a=t.sourceEvent;if(a instanceof WheelEvent)n.zoom(r,n.pixToGeoX(t.sourceEvent.offsetX),n.pixToGeoY(t.sourceEvent.offsetY));else if(a instanceof TouchEvent){var l,c=0,f=0,s=Vn(a.targetTouches);try{for(s.s();!(l=s.n()).done;){var h=l.value;c+=h.clientX,f+=h.clientY}}catch(t){s.e(t)}finally{s.f()}c/=a.targetTouches.length,f/=a.targetTouches.length,n.zoom(r,n.pixToGeoX(c),n.pixToGeoY(f))}}u=e})).on("start",(function(t){n.canvasSave.c=document.createElement("canvas"),n.canvasSave.c.setAttribute("width",""+n.w),n.canvasSave.c.setAttribute("height",""+n.h),n.canvasSave.c.getContext("2d").drawImage(n.canvas,0,0),n.canvasSave.dx=0,n.canvasSave.dy=0,n.canvasSave.f=1,n.onZoomStartFun&&n.onZoomStartFun()})).on("end",(function(t){n.redraw(!0),n.canvasSave={c:null,dx:0,dy:0,f:1},n.onZoomEndFun&&n.onZoomEndFun()}));l(mt(this.canvas)),this.zfExtent=[0,1/0],this.canvasSave={c:null,dx:0,dy:0,f:1}}var e,n,r;return e=t,n=[{key:"setCenter",value:function(t){this.center=t}},{key:"getCenter",value:function(){return this.center}},{key:"setZf",value:function(t){this.zf=t,this.slider&&this.slider.attr("value",+this.zf)}},{key:"getZf",value:function(){return this.zf}},{key:"setZfExtent",value:function(t){this.zfExtent=t}},{key:"getZfExtent",value:function(){return this.zfExtent}},{key:"initCanvasTransform",value:function(){this.ctx.setTransform(1,0,0,1,0,0)}},{key:"setCanvasTransform",value:function(){var t=1/this.getZf(),e=-this.center.x/this.getZf()+.5*this.w,n=this.center.y/this.getZf()+.5*this.h;this.ctx.setTransform(t,0,0,-t,e,n)}},{key:"getWebGLTransform",value:function(){var t=2/(this.w*this.getZf()),e=2/(this.h*this.getZf());return[t,0,0,0,e,0,-t*this.center.x,-e*this.center.y,1]}},{key:"redraw",value:function(){throw new Error("Method redraw not implemented.")}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"white";this.ctx&&(this.ctx.fillStyle=t),this.ctx.fillRect(0,0,this.w,this.h)}},{key:"pan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.center.x+=t,this.center.y+=e,this.updateExtentGeo(),this.canvasSave.c&&(this.canvasSave.dx-=t/this.getZf(),this.canvasSave.dy+=e/this.getZf(),this.clear(this.backgroundColor),this.ctx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy))}},{key:"zoom",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.center.x,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.center.y;if(!(this.zfExtent[0]==this.getZf()&&t<=1||this.zfExtent[1]==this.getZf()&&t>=1)){var r=t*this.getZf();r<this.zfExtent[0]&&(t=this.zfExtent[0]/this.getZf()),r>this.zfExtent[1]&&(t=this.zfExtent[1]/this.getZf()),this.setZf(t*this.getZf());var o=(e-this.center.x)*(1-t);this.center.x+=o;var i=(n-this.center.y)*(1-t);this.center.y+=i,this.updateExtentGeo(),this.canvasSave.c&&(this.clear(this.backgroundColor),this.canvasSave.f/=t,this.canvasSave.dx=this.geoToPixX(e)*(1-this.canvasSave.f),this.canvasSave.dy=this.geoToPixY(n)*(1-this.canvasSave.f),this.clear(this.backgroundColor),this.ctx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy,this.canvasSave.f*this.canvasSave.c.width,this.canvasSave.f*this.canvasSave.c.height))}}},{key:"updateExtentGeo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return this.extGeo={xMin:this.pixToGeoX(-t),xMax:this.pixToGeoX(this.w+t),yMin:this.pixToGeoY(this.h+t),yMax:this.pixToGeoY(-t)},this.extGeo}},{key:"toDraw",value:function(t){return!(t.x<this.extGeo.xMin||t.x>this.extGeo.xMax||t.y<this.extGeo.yMin||t.y>this.extGeo.yMax)}},{key:"geoToPixX",value:function(t){return(t-this.center.x)/this.getZf()+.5*this.w}},{key:"geoToPixY",value:function(t){return-(t-this.center.y)/this.getZf()+.5*this.h}},{key:"pixToGeoX",value:function(t){return(t-.5*this.w)*this.getZf()+this.center.x}},{key:"pixToGeoY",value:function(t){return-(t-.5*this.h)*this.getZf()+this.center.y}},{key:"setViewFromURL",value:function(){var e=t.getParameterByName("x"),n=t.getParameterByName("y"),r=t.getParameterByName("z"),o=this.getCenter();null==e||null==e||isNaN(+e)||(o.x=+e),null==n||null==n||isNaN(+n)||(o.y=+n),null==r||null==r||isNaN(+r)||this.setZf(+r)}},{key:"addZoomSlider",value:function(t,e){(e=e||{}).width=e.width||"30px",e.height=e.height||"300px";var n=mt("#"+t);if(n.empty())return console.error("Could not find div element to build zoom slider. Id: "+t),this;var r=this;return this.slider=n.append("input").attr("type","range").attr("min",this.getZfExtent()[0]).attr("max",this.getZfExtent()[1]).attr("value",this.getZf()).on("input",(function(t){if(this&&this.value){var e=+this.value;mt(this).attr("value",e),r.setZf(e),r.redraw()}})).style("width",e.width).style("height",e.height).style("opacity",.7).on("mouseover",(function(t){mt(this).style("opacity",1)})).on("mouseout",(function(t){mt(this).style("opacity",.7)})).style("-webkit-appearance","slider-vertical").style("writing-mode","bt-lr").attr("orient","vertical").style("background","lightgray").style("outline","none").style("-webkit-transition",".2s").style("transition","opacity .2s"),this}}],r=[{key:"getParameterByName",value:function(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(location.search);return e?decodeURIComponent(e[1].replace(/\+/g," ")):null}}],n&&Hn(e.prototype,n),r&&Hn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Jn(t){return Jn="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},Jn(t)}function Qn(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 tr(t,e);var n=Object.prototype.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)?tr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function tr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function er(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Jn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Jn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Jn(o)?o:String(o)),r)}var o}var nr=function(){function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.offset=e.offset||function(t,e,n){return{dx:0,dy:0}},this.minZoom=e.minZoom||0,this.maxZoom=e.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.legends=[]}var e,n,r;return e=t,r=[{key:"getStatistics",value:function(t,e,n){if(t&&0!=t.length){var r,o=1/0,i=-1/0,a=Qn(t);try{for(a.s();!(r=a.n()).done;){var u=+e(r.value);n&&!u||(u<o&&(o=u),u>i&&(i=u))}}catch(t){a.e(t)}finally{a.f()}return{min:o,max:i}}}}],(n=[{key:"draw",value:function(t,e,n){throw new Error("Method draw not implemented.")}},{key:"getOffset",value:function(){return this.offset}},{key:"setOffset",value:function(t){return this.offset=t,this}},{key:"updateLegends",value:function(t){var e,n=Qn(this.legends);try{for(n.s();!(e=n.n()).done;)e.value.update(t)}catch(t){n.e(t)}finally{n.f()}return this}}])&&er(e.prototype,n),r&&er(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function rr(t){return rr="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},rr(t)}function or(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ir(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==rr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==rr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===rr(o)?o:String(o)),r)}var o}var ar=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(or(this,t),r=r||{},this.dataset=e,this.styles=n,this.visible=0!=r.visible,this.minZoom=r.minZoom||0,this.maxZoom=r.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.pixNb=r.pixNb||3,this.cellInfoHTML=r.cellInfoHTML||t.defaultCellInfoHTML}var e,n,r;return e=t,r=[{key:"defaultCellInfoHTML",value:function(t){for(var e=[],n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];"x"!==o&&"y"!==o&&e.push("<b>",o,"</b>"," : ",t[o],"<br>")}return e.join("")}}],(n=[{key:"getDatasetComponent",value:function(t){if(!(t<this.minZoom||t>this.maxZoom)){if(1==this.dataset.datasetComponents.length)return this.dataset.datasetComponents[0];for(var e=this.dataset.resolutions,n=0,r=e[n]/this.pixNb;r<t&&n<e.length;)r=e[++n]/this.pixNb;return n==e.length?this.dataset.datasetComponents[e.length-1]:this.dataset.datasetComponents[n]}}}])&&ir(e.prototype,n),r&&ir(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ur(t){return ur="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},ur(t)}function lr(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 cr(t,e);var n=Object.prototype.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)?cr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function cr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function fr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ur(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ur(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ur(o)?o:String(o)),r)}var o}var hr=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(fr(this,t),r=r||{},this.datasetComponents=e,this.resolutions=n,this.datasetComponents.length>1&&this.datasetComponents.length!=this.resolutions.length)throw new Error("Uncompatible number of datasets and resolutions: "+this.datasetComponents.length+" "+this.resolutions.length);r.preprocess&&this.setPrepocesses(r.preprocess)}var e,n,r;return e=t,r=[{key:"make",value:function(e,n,r){var o,i=[],a=lr(e);try{for(a.s();!(o=a.n()).done;){var u=o.value;i.push(n(u))}}catch(t){a.e(t)}finally{a.f()}return new t(i,e,r)}}],(n=[{key:"setPrepocesses",value:function(t){var e,n=lr(this.datasetComponents);try{for(n.s();!(e=n.n()).done;)e.value.preprocess=t}catch(t){n.e(t)}finally{n.f()}return this}}])&&sr(e.prototype,n),r&&sr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function yr(t){return yr="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},yr(t)}function pr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==yr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==yr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===yr(o)?o:String(o)),r)}var o}var dr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;pr(this,t),e=e||{},this.div=e.div||"tooltip_eurostat",this.maxWidth=e.maxWidth||"20em",this.fontSize=e.fontSize||"1.2em",this.background=e.background||"white",this.padding=e.padding||"5px",this.border=e.border||"0px",this["border-radius"]=e["border-radius"]||"5px",this["box-shadow"]=e["box-shadow"]||"5px 5px 5px grey",this["font-family"]=e["font-family"]||"Helvetica, Arial, sans-serif",this.transitionDuration=e.transitionDuration||100,this.xOffset=e.xOffset||30,this.yOffset=e.yOffset||20,this.tooltip=mt("#"+this.div),this.tooltip.empty()&&(this.tooltip=mt("body").append("div").attr("id",this.div)),this.tooltip.style("max-width",this.maxWidth),this.tooltip.style("overflow","hidden"),this.tooltip.style("font-size",this.fontSize),this.tooltip.style("background",this.background),this.tooltip.style("padding",this.padding),this.tooltip.style("border",this.border),this.tooltip.style("border-radius",this["border-radius"]),this.tooltip.style("box-shadow",this["box-shadow"]),this.tooltip.style("font-family",this["font-family"]),this.tooltip.style("position","absolute"),this.tooltip.style("pointer-events","none"),this.tooltip.style("opacity","0")}var e,n;return e=t,n=[{key:"show",value:function(){this.tooltip.transition().duration(this.transitionDuration).style("opacity",1)}},{key:"hide",value:function(){this.tooltip.transition().duration(this.transitionDuration).style("opacity",0)}},{key:"html",value:function(t){this.tooltip.html(t)}},{key:"setPosition",value:function(t){this.tooltip.style("left",t.pageX+this.xOffset+"px").style("top",t.pageY-this.yOffset+"px")}},{key:"style",value:function(t,e){return 1==arguments.length?this.tooltip.style(t):(this.tooltip.style(t,e),this)}},{key:"attr",value:function(t,e){return 1==arguments.length?this.tooltip.attr(t):(this.tooltip.attr(t,e),this)}}],n&&vr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),mr={},br={};function gr(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function wr(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function xr(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function Sr(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,o=[],i=t.length,a=0,u=0,l=i<=0,c=!1;function f(){if(l)return br;if(c)return c=!1,mr;var e,r,o=a;if(34===t.charCodeAt(o)){for(;a++<i&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=i?l=!0:10===(r=t.charCodeAt(a++))?c=!0:13===r&&(c=!0,10===t.charCodeAt(a)&&++a),t.slice(o+1,e-1).replace(/""/g,'"')}for(;a<i;){if(10===(r=t.charCodeAt(e=a++)))c=!0;else if(13===r)c=!0,10===t.charCodeAt(a)&&++a;else if(r!==n)continue;return t.slice(o,e)}return l=!0,t.slice(o,i)}for(10===t.charCodeAt(i-1)&&--i,13===t.charCodeAt(i-1)&&--i;(r=f())!==br;){for(var s=[];r!==mr&&r!==br;)s.push(r),r=f();e&&null==(s=e(s,u++))||o.push(s)}return o}function o(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function i(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?(o=(n=t).getUTCHours(),i=n.getUTCMinutes(),a=n.getUTCSeconds(),u=n.getUTCMilliseconds(),isNaN(n)?"Invalid Date":((r=n.getUTCFullYear())<0?"-"+xr(-r,6):r>9999?"+"+xr(r,6):xr(r,4))+"-"+xr(n.getUTCMonth()+1,2)+"-"+xr(n.getUTCDate(),2)+(u?"T"+xr(o,2)+":"+xr(i,2)+":"+xr(a,2)+"."+xr(u,3)+"Z":a?"T"+xr(o,2)+":"+xr(i,2)+":"+xr(a,2)+"Z":i||o?"T"+xr(o,2)+":"+xr(i,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t;var n,r,o,i,a,u}return{parse:function(t,e){var n,o,i=r(t,(function(t,r){if(n)return n(t,r-1);o=t,n=e?function(t,e){var n=gr(t);return function(r,o){return e(n(r),o,t)}}(t,e):gr(t)}));return i.columns=o||[],i},parseRows:r,format:function(e,n){return null==n&&(n=wr(e)),[n.map(a).join(t)].concat(o(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=wr(t)),o(t,e).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}}var _r=Sr(","),Pr=_r.parse,Or=(_r.parseRows,_r.format,_r.formatBody,_r.formatRows,_r.formatRow,_r.formatValue,Sr("\t")),jr=Or.parse;function Cr(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function kr(t,e){return fetch(t,e).then(Cr)}function Er(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=void 0),kr(e,n).then((function(e){return t(e,r)}))}}Or.parseRows,Or.format,Or.formatBody,Or.formatRows,Or.formatRow,Or.formatValue;var Tr=Er(Pr);function Ar(t){return Ar="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},Ar(t)}function Mr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Rr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ar(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ar(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ar(o)?o:String(o)),r)}var o}Er(jr);var Fr=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Rr(this,t),r=r||{},this.url=e,this.resolution=n,this.preprocess=r.preprocess||void 0,this.cellsViewCache=[]}var e,n;return e=t,(n=[{key:"getData",value:function(t,e){throw new Error("Method getData not implemented.")}},{key:"updateViewCache",value:function(t){throw new Error("Method updateViewCache not implemented.")}},{key:"getCellFromPosition",value:function(t,e){var n,r=this.getResolution(),o=r*Math.floor(t.x/r),i=r*Math.floor(t.y/r),a=function(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 Mr(t,e);var n=Object.prototype.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)?Mr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e);try{for(a.s();!(n=a.n()).done;){var u=n.value;if(u.x==o&&u.y==i)return u}}catch(t){a.e(t)}finally{a.f()}}},{key:"getResolution",value:function(){return this.resolution}},{key:"getViewCache",value:function(){return this.cellsViewCache}}])&&zr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ir(t){return Ir="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},Ir(t)}function Lr(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 Br(t,e);var n=Object.prototype.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)?Br(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Br(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Nr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ir(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ir(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ir(o)?o:String(o)),r)}var o}function Zr(t,e){return Zr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zr(t,e)}function Ur(t,e){if(e&&("object"===Ir(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Wr(t){return Wr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wr(t)}var Gr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zr(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Wr(r);if(o){var n=Wr(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ur(this,t)});function a(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nr(this,a),(n=i.call(this,t,e,r)).cells=[],n.infoLoadingStatus="notLoaded",n}return e=a,(n=[{key:"getData",value:function(t,e){var n=this;return"notLoaded"!=this.infoLoadingStatus||(this.infoLoadingStatus="loading",Tr(this.url).then((function(t){var r,o=Lr(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;i.x=+i.x,i.y=+i.y}}catch(t){o.e(t)}finally{o.f()}if(n.preprocess){n.cells=[];var a,u=Lr(t);try{for(u.s();!(a=u.n()).done;){var l=a.value;0!=n.preprocess(l)&&n.cells.push(l)}}catch(t){u.e(t)}finally{u.f()}}else n.cells=t;e&&e(),n.infoLoadingStatus="loaded"})).catch((function(){n.infoLoadingStatus="failed",n.cells=[]}))),this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,n=Lr(this.cells);try{for(n.s();!(e=n.n()).done;){var r=e.value;+r.x+this.resolution<t.xMin||+r.x-this.resolution>t.xMax||+r.y+this.resolution<t.yMin||+r.y-this.resolution>t.yMax||this.cellsViewCache.push(r)}}catch(t){n.e(t)}finally{n.f()}}}}])&&Dr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Fr);function $r(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function Yr(t,e){return fetch(t,e).then($r)}function Vr(t){return Vr="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},Vr(t)}function Xr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function qr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Vr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Vr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Vr(o)?o:String(o)),r)}var o}function Hr(t,e,n){return e&&qr(t.prototype,e),n&&qr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var Kr=Hr((function t(e,n,r,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.cells=e,this.x=n,this.y=r;var i=o.resolutionGeo,a=o.tileSizeCell;this.extGeo={xMin:o.originPoint.x+i*a*this.x,xMax:o.originPoint.x+i*a*(this.x+1),yMin:o.originPoint.y+i*a*this.y,yMax:o.originPoint.y+i*a*(this.y+1)};var u,l=function(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 Xr(t,e);var n=Object.prototype.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)?Xr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(this.cells);try{for(l.s();!(u=l.n()).done;){var c=u.value;c.x=this.extGeo.xMin+c.x*i,c.y=this.extGeo.yMin+c.y*i}}catch(t){l.e(t)}finally{l.f()}}));function Jr(t,e){if(e){if(0==e.length)return 0;if(t<=e[0])return 0;for(var n=1;n<e.length;n++)if(e[n-1]<t&&t<=e[n])return n;return e.length}}function Qr(t){return Qr="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},Qr(t)}function to(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 eo(t,e);var n=Object.prototype.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)?eo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function eo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function no(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ro(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Qr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Qr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Qr(o)?o:String(o)),r)}var o}function oo(t,e){return oo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},oo(t,e)}function io(t,e){if(e&&("object"===Qr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ao(t){return ao=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ao(t)}var uo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oo(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ao(r);if(o){var n=ao(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return io(this,t)});function a(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return no(this,a),(n=i.call(this,t,0,r)).app=e,n.info=void 0,n.infoLoadingStatus="notLoaded",n.cache={},n}return e=a,(n=[{key:"loadInfo",value:function(t){var e=this;return this.info||"notLoaded"!==this.infoLoadingStatus?!t||"loaded"!==this.infoLoadingStatus&&"failed"!==this.infoLoadingStatus||t():(this.infoLoadingStatus="loading",Yr(this.url+"info.json").then((function(n){e.info=n,e.resolution=n.resolutionGeo,e.infoLoadingStatus="loaded",t&&t()})).catch((function(){e.infoLoadingStatus="failed"}))),this}},{key:"getTilingEnvelope",value:function(t){if(this.info){var e=this.info.originPoint,n=this.info.resolutionGeo,r=this.info.tileSizeCell;return{xMin:Math.floor((t.xMin-e.x)/(n*r)),xMax:Math.floor((t.xMax-e.x)/(n*r)),yMin:Math.floor((t.yMin-e.y)/(n*r)),yMax:Math.floor((t.yMax-e.y)/(n*r))}}this.loadInfo((function(){}))}},{key:"getData",value:function(t,e){var n=this;if(!this.info)return this;var r=this.getTilingEnvelope(t);if(!r)return this;for(var o=this.info.tilingBounds,i=function(t){for(var i=function(r){if(n.cache[t]||(n.cache[t]={}),n.cache[t][r])return"continue";n.cache[t][r]="loading",Tr(n.url+t+"/"+r+".csv").then((function(o){var i;if(n.preprocess){i=[];var a,u=to(o);try{for(u.s();!(a=u.n()).done;){var l=a.value;0!=n.preprocess(l)&&i.push(l)}}catch(t){u.e(t)}finally{u.f()}}else i=o;if(n.info){var c=new Kr(i,t,r,n.info);if(n.cache[t][r]=c,e){var f,s=!1,h=to(n.app.getActiveLayers());try{for(h.s();!(f=h.n()).done;)if(f.value.getDatasetComponent(n.app.getZoomFactor())==n){s=!0;break}}catch(t){h.e(t)}finally{h.f()}if(s){var y=n.app.updateExtentGeo(),p=c.extGeo;y.xMax<=p.xMin||y.xMin>=p.xMax||y.yMax<=p.yMin||y.yMin>=p.yMax||e()}}}else console.error("Tile info inknown")})).catch((function(){n.cache[t][r]="failed"}))},a=Math.max(r.yMin,o.yMin);a<=Math.min(r.yMax,o.yMax);a++)i(a)},a=Math.max(r.xMin,o.xMin);a<=Math.min(r.xMax,o.xMax);a++)i(a);return this}},{key:"updateViewCache",value:function(t){if(this.cellsViewCache=[],this.info){var e=this.getTilingEnvelope(t);if(e)for(var n=this.info.tilingBounds,r=Math.max(e.xMin,n.xMin);r<=Math.min(e.xMax,n.xMax);r++)if(this.cache[r])for(var o=Math.max(e.yMin,n.yMin);o<=Math.min(e.yMax,n.yMax);o++){var i=this.cache[r][o];if(i&&"string"!=typeof i){var a,u=to(i.cells);try{for(u.s();!(a=u.n()).done;){var l=a.value;+l.x+this.resolution<t.xMin||+l.x-this.resolution>t.xMax||+l.y+this.resolution<t.yMin||+l.y-this.resolution>t.yMax||this.cellsViewCache.push(l)}}catch(t){u.e(t)}finally{u.f()}}}}}}])&&ro(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Fr);function lo(t){return lo="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},lo(t)}function co(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==lo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==lo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===lo(o)?o:String(o)),r)}var o}var fo=function(){function t(e){var n=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.visible=0!=e.visible,this.minZoom=e.minZoom||0,this.maxZoom=e.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");if(this.cache={},this.url=e.url,this.urlFun=e.urlFun||function(t,e,r){return n.url+r+"/"+t+"/"+e+".png"},this.resolutions=e.resolutions,!this.resolutions||0==this.resolutions.length)throw new Error("No resolutions provided for background layer");this.nbPix=e.nbPix||256,this.origin=e.origin||[0,0],this.z0=e.z0||0,this.filterColor=e.filterColor}var e,n;return e=t,n=[{key:"get",value:function(t,e,n){var r=this.cache[t];if(r&&(r=r[e]))return r[n]}},{key:"put",value:function(t,e,n,r){this.cache[e]||(this.cache[e]={}),this.cache[e][n]||(this.cache[e][n]={}),this.cache[e][n][r]=t}},{key:"draw",value:function(t){var e=this;if(this.resolutions&&0!=this.resolutions.length){var n=t.getZf(),r=this.origin[0],o=this.origin[1],i=0;for(i=0;i<this.resolutions.length&&!(this.resolutions[i]<n);i++);i-=1,i=Math.max(0,i),i=Math.min(i,this.resolutions.length-1);var a=this.resolutions[i];i+=this.z0;for(var u=this.nbPix*a,l=u/n,c=function(t){return Math.ceil((t-r)/u)},f=function(t){return Math.ceil(-(t-o)/u)},s=c(t.extGeo.xMin)-1,h=c(t.extGeo.xMax),y=f(t.extGeo.yMin),p=f(t.extGeo.yMax)-1,v=function(n){for(var a=function(a){var c=e.get(i,n,a);if(!c){var f=new Image;return e.put(f,i,n,a),f.onload=function(){t.redraw()},f.onerror=function(){e.put("failed",i,n,a)},f.src=e.urlFun(n,a,i),"continue"}if("failed"===c)return"continue";if(!(c instanceof HTMLImageElement))return console.log(c),"continue";if(0==c.width||0==c.height)return"continue";var s=r+n*u,h=o-a*u;try{t.ctx.drawImage(c,t.geoToPixX(s),t.geoToPixY(h),l,l)}catch(t){console.error(t)}},c=p;c<y;c++)a(c)},d=s;d<h;d++)v(d);if(this.filterColor){var m=this.filterColor(n);m&&"none"!=m&&(t.ctx.fillStyle=m,t.ctx.fillRect(0,0,t.w,t.h))}}else console.error("No resolutions provided for background layer")}}],n&&co(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function so(t){return so="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},so(t)}function ho(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 yo(t,e);var n=Object.prototype.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)?yo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function po(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==so(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==so(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===so(o)?o:String(o)),r)}var o}var vo=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.url=e.url,this.style=e.style||function(){return"bold 1em Arial"},this.color=e.color||(e.dark?function(){return"#ddd"}:function(){return"#222"}),this.haloColor=e.haloColor||(e.dark?function(){return"#000000BB"}:function(){return"#FFFFFFBB"}),this.haloWidth=e.haloWidth||function(){return 4},this.textAlign=e.textAlign||"start",this.offsetPix=e.offsetPix||[5,5],this.preprocess=e.preprocess,this.labels,this.loadingStatus="notLoaded"}var e,n;return e=t,(n=[{key:"draw",value:function(t){if(this.labels){var e=t.getZf();t.ctx.textAlign=this.textAlign||"start",t.ctx.lineJoin="bevel",t.ctx.lineCap="butt",t.initCanvasTransform();var n,r=ho(this.labels);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.style(o,e);if(i&&(t.ctx.font=i,t.toDraw(o))){var a=t.geoToPixX(o.x)+this.offsetPix[0],u=t.geoToPixY(o.y)-this.offsetPix[1];if(this.haloColor&&this.haloWidth){var l=this.haloColor(o,e),c=this.haloWidth(o,e);l&&c&&c>0&&(t.ctx.strokeStyle=l,t.ctx.lineWidth=c,t.ctx.strokeText(o.name,a,u))}if(this.color){var f=this.color(o,e);f&&(t.ctx.fillStyle=f,t.ctx.fillText(o.name,a,u))}}}}catch(t){r.e(t)}finally{r.f()}}else this.load(t.redraw)}},{key:"load",value:function(t){var e=this;if(!this.url)return console.log("Failed loading labels: No URL specified. "+this.url),this.loadingStatus="failed",void(this.labels=[]);"notLoaded"===this.loadingStatus&&(this.loadingStatus="loading",Tr(this.url).then((function(n){if(e.preprocess){e.labels=[];var r,o=ho(n);try{for(o.s();!(r=o.n()).done;){var i=r.value;0!=e.preprocess(i)&&e.labels.push(i)}}catch(t){o.e(t)}finally{o.f()}}else e.labels=n;e.loadingStatus="loaded",t&&t()})).catch((function(){console.log("Failed loading labels from "+e.url),e.labels=[],e.loadingStatus="failed"})))}}])&&po(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function mo(t){return mo="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},mo(t)}function bo(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 go(t,e);var n=Object.prototype.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)?go(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function go(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function wo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==mo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==mo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===mo(o)?o:String(o)),r)}var o}var xo=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.url=e.url,this.preprocess=e.preprocess,this.color=e.color||function(t,e){return"gray"},this.width=e.width||function(t,e){return 2},this.lineDash=e.lineDash||function(t,e){},this.fs,this.loadingStatus="notLoaded"}var e,n;return e=t,(n=[{key:"draw",value:function(t){if(this.fs){var e=t.getZf();t.setCanvasTransform();var n,r=bo(this.fs);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=o.geometry.coordinates;if(!(i.length<2)){var a=this.color(o,e);if(a&&"none"!=a){t.ctx.strokeStyle=a;var u=this.width(o,e);if(u&&!(u<0)){t.ctx.lineWidth=u*e;var l=this.lineDash(o,e);l&&t.ctx.setLineDash(l),t.ctx.beginPath(),t.ctx.moveTo(i[0][0],i[0][1]);for(var c=1;c<i.length;c++)t.ctx.lineTo(i[c][0],i[c][1]);t.ctx.stroke()}}}}}catch(t){r.e(t)}finally{r.f()}t.ctx.setLineDash([])}else this.load(t.redraw)}},{key:"load",value:function(t){var e=this;if(!this.url)return console.log("Failed loading boundaries: No URL specified. "+this.url),this.loadingStatus="failed",void(this.labels=[]);"notLoaded"===this.loadingStatus&&(this.loadingStatus="loading",Yr(this.url).then((function(n){if(n=n.features,e.preprocess){var r,o=bo(n);try{for(o.s();!(r=o.n()).done;){var i=r.value;e.preprocess(i)}}catch(t){o.e(t)}finally{o.f()}}e.fs=n,e.loadingStatus="loaded",t&&t()})).catch((function(){console.log("Failed loading boundaries from "+e.url),e.fs=[],e.loadingStatus="failed"})))}}])&&wo(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function So(t){return So="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},So(t)}function _o(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 Po(t,e);var n=Object.prototype.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)?Po(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Po(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Oo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==So(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==So(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===So(o)?o:String(o)),r)}var o}var jo=function(){function t(e,n){var r=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=n||{},this.layers=[],e=e||document.getElementById("gridviz")){this.w=n.w||e.offsetWidth,this.h=n.h||e.offsetHeight;var o=document.createElement("canvas");o.setAttribute("width",""+this.w),o.setAttribute("height",""+this.h),e.appendChild(o),this.cg=new Kn(o),this.cg.redraw=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];r.legend&&t&&r.legend.selectAll("*").remove(),r.cg.initCanvasTransform(),r.cg.clear(r.cg.backgroundColor);var e=r.getZoomFactor();r.updateExtentGeo();var n,o=_o(r.bgLayers);try{for(o.s();!(n=o.n()).done;){var i=n.value;i.visible&&(e>i.maxZoom||e<i.minZoom||i.draw(r.cg))}}catch(t){o.e(t)}finally{o.f()}var a,u=_o(r.layers);try{for(u.s();!(a=u.n()).done;){var l=a.value;if(l.visible&&!(e>l.maxZoom||e<l.minZoom)){var c=l.getDatasetComponent(e);if(c){if(t&&c.getData(r.cg.extGeo,(function(){r.cg.redraw()})),t&&c.updateViewCache(r.cg.extGeo),t){var f,s=_o(l.styles);try{for(s.s();!(f=s.n()).done;){var h=f.value;e>h.maxZoom||e<h.minZoom||h.draw(c.getViewCache(),c.getResolution(),r.cg)}}catch(t){s.e(t)}finally{s.f()}}if(r.legend&&t){var y,p=_o(l.styles);try{for(p.s();!(y=p.n()).done;){var v=y.value;if(!(e>v.maxZoom||e<v.minZoom)){var d,m=_o(v.legends);try{for(m.s();!(d=m.n()).done;){var b=d.value;r.legend.node().append(b.div.node())}}catch(t){m.e(t)}finally{m.f()}}}}catch(t){p.e(t)}finally{p.f()}}}}}}catch(t){u.e(t)}finally{u.f()}return r.showBoundaries&&r.boundaryLayer&&r.boundaryLayer.draw(r.cg),r.showLabels&&r.labelLayer&&r.labelLayer.draw(r.cg),r.canvasSave=null,r},this.bgLayers=[],this.showBgLayers=!0,this.labelLayer=void 0,this.showLabels=!0,this.boundaryLayer=void 0,this.showBoundaries=!0,this.legendDivId=n.legendDivId||"gvizLegend",this.legend=mt("#"+this.legendDivId),this.legend.empty()&&(this.legend=mt("body").append("div").attr("id",this.legendDivId).style("position","absolute").style("width","auto").style("height","auto").style("background","#FFFFFFCC").style("border","0px").style("border-radius","5px").style("box-shadow","3px 3px 3px grey, -3px -3px 3px #ddd").style("font-family","Helvetica, Arial, sans-serif").style("top","20px").style("right","20px")),this.tooltip=new dr;var i=function(t){var e={x:r.cg.pixToGeoX(t.offsetX),y:r.cg.pixToGeoY(t.offsetY)},n=r.getCellFocusInfo(e);n?(r.tooltip.setPosition(t),r.tooltip.show(),r.tooltip.html(n.html),r.canvasSave?r.cg.ctx.drawImage(r.canvasSave,0,0):(r.canvasSave=document.createElement("canvas"),r.canvasSave.setAttribute("width",""+r.w),r.canvasSave.setAttribute("height",""+r.h),r.canvasSave.getContext("2d").drawImage(r.cg.canvas,0,0)),r.cg.initCanvasTransform(),r.cg.ctx.strokeStyle=r.selectionRectangleColor,r.cg.ctx.lineWidth=r.selectionRectangleWidthPix,r.cg.ctx.beginPath(),r.cg.ctx.rect(r.cg.geoToPixX(n.cell.x)-r.selectionRectangleWidthPix/2,r.cg.geoToPixY(n.cell.y)+r.selectionRectangleWidthPix/2,n.resolution/r.getZoomFactor()+r.selectionRectangleWidthPix,-n.resolution/r.getZoomFactor()-r.selectionRectangleWidthPix),r.cg.ctx.stroke()):(r.tooltip.hide(),r.canvasSave&&r.cg.ctx.drawImage(r.canvasSave,0,0))};e.addEventListener("mouseover",(function(t){i(t)})),e.addEventListener("mousemove",(function(t){i(t)})),e.addEventListener("mouseout",(function(){r.tooltip.hide()})),this.cg.onZoomStartFun=function(){r.tooltip.hide()},this.canvasSave=null,this.selectionRectangleColor=n.selectionRectangleColor||"red",this.selectionRectangleWidthPix=n.selectionRectangleWidthPix||4}else console.error("Cannot find gridviz container element.")}var e,n;return e=t,n=[{key:"getActiveLayers",value:function(){var t,e=[],n=this.getZoomFactor(),r=_o(this.layers);try{for(r.s();!(t=r.n()).done;){var o=t.value;o.visible&&o.getDatasetComponent(n)&&e.push(o)}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"hideAllLayers",value:function(){var t,e=_o(this.layers);try{for(e.s();!(t=e.n()).done;)t.value.visible=!1}catch(t){e.e(t)}finally{e.f()}return this}},{key:"updateExtentGeo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return this.cg.updateExtentGeo(t)}},{key:"getCellFocusInfo",value:function(t){var e=this.getActiveLayers(),n=e[e.length-1];if(n){var r=n.getDatasetComponent(this.getZoomFactor());if(r){var o=r.getCellFromPosition(t,r.getViewCache());if(o)return{cell:o,html:n.cellInfoHTML(o,r.getResolution()),resolution:r.getResolution()}}}}},{key:"getGeoCenter",value:function(){return this.cg.getCenter()}},{key:"setGeoCenter",value:function(t){return this.cg.setCenter(t),this}},{key:"getZoomFactor",value:function(){return this.cg.getZf()}},{key:"setZoomFactor",value:function(t){return this.cg.setZf(t),this}},{key:"getZoomFactorExtent",value:function(){return this.cg.getZfExtent()}},{key:"setZoomFactorExtent",value:function(t){return this.cg.setZfExtent(t),this}},{key:"getBackgroundColor",value:function(){return this.cg.backgroundColor}},{key:"setBackgroundColor",value:function(t){return this.cg.backgroundColor=t,this}},{key:"getBoundaryLayer",value:function(){return this.boundaryLayer}},{key:"setBoundaryLayer",value:function(t){return this.boundaryLayer=new xo(t),this}},{key:"getLabelLayer",value:function(){return this.labelLayer}},{key:"setLabelLayer",value:function(t){return this.labelLayer=new vo(t),this}},{key:"redraw",value:function(){return this.cg.redraw(),this}},{key:"addLayerFromDataset",value:function(t,e,n){var r=new ar(t,e,n);return this.layers.push(r),this}},{key:"makeTiledCSVGridDataset",value:function(t,e){var n=this;return new hr([new uo(t,this,e).loadInfo((function(){n.cg.redraw()}))],[],e)}},{key:"makeMultiScaleCSVGridDataset",value:function(t,e,n){var r=this;return hr.make(t,(function(t){return new Gr(e(t),t,n).getData(void 0,(function(){r.cg.redraw()}))}),n)}},{key:"makeMultiScaleTiledCSVGridDataset",value:function(t,e,n){var r=this;return hr.make(t,(function(t){return new uo(e(t),r,n).loadInfo((function(){r.cg.redraw()}))}),n)}},{key:"addCSVGridLayer",value:function(t,e,n,r){var o=this.makeCSVGridDataset(t,e,r);return this.addLayerFromDataset(o,n,r)}},{key:"addParquetGridLayer",value:function(t,e,n,r){var o=this.makeParquetGridDataset(t,e,r);return this.addLayerFromDataset(o,n,r)}},{key:"addTiledCSVGridLayer",value:function(t,e,n){var r=this.makeTiledCSVGridDataset(t,n);return this.addLayerFromDataset(r,e,n)}},{key:"addMultiScaleCSVGridLayer",value:function(t,e,n,r){var o=this.makeMultiScaleCSVGridDataset(t,e,r);return this.addLayerFromDataset(o,n,r)}},{key:"addMultiScaleTiledCSVGridLayer",value:function(t,e,n,r){var o=this.makeMultiScaleTiledCSVGridDataset(t,e,r);return this.addLayerFromDataset(o,n,r)}},{key:"addBackgroundLayer",value:function(t){return this.bgLayers.push(new fo(t)),this.redraw(),this}},{key:"addZoomSlider",value:function(t,e){return this.cg.addZoomSlider(t,e),this}},{key:"setViewFromURL",value:function(){return this.cg.setViewFromURL(),this}}],n&&Oo(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Co(t){return Co="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},Co(t)}function ko(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Eo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Co(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Co(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Co(o)?o:String(o)),r)}var o}function To(t,e){return To=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},To(t,e)}function Ao(t,e){if(e&&("object"===Co(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Mo(t){return Mo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mo(t)}var Ro=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&To(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Mo(r);if(o){var n=Mo(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ao(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.sizeCol=t.sizeCol,e.size=t.size,e.shape=t.shape||function(){return"square"},e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r,o,i=this,a=n.getZf();this.sizeCol&&(t.sort((function(t,e){return e[i.sizeCol]-t[i.sizeCol]})),r=nr.getStatistics(t,(function(t){return t[i.sizeCol]}),!0)),this.colorCol&&(o=nr.getStatistics(t,(function(t){return t[i.colorCol]}),!0)),n.setCanvasTransform();var u,l=.5*e,c=function(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 ko(t,e);var n=Object.prototype.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)?ko(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(u=c.n()).done;){var f=u.value,s=this.color?this.color(f[this.colorCol],e,o):void 0;if(s&&"none"!==s){n.ctx.fillStyle=s;var h=this.shape?this.shape(f):"square";if("none"!==h){var y=(this.size||function(){return e})(f[this.sizeCol],e,r,a),p=this.offset(f,e,a);if("square"===h){var v=e*(1-y/e)*.5;n.ctx.fillRect(f.x+v+p.dx,f.y+v+p.dy,y,y)}else if("circle"===h)n.ctx.beginPath(),n.ctx.arc(f.x+l+p.dx,f.y+l+p.dy,.5*y,0,2*Math.PI,!1),n.ctx.fill();else if("donut"===h){var d=f.x+l+p.dx,m=f.y+l+p.dy;n.ctx.beginPath(),n.ctx.moveTo(d,m),n.ctx.arc(d,m,l,0,2*Math.PI),n.ctx.arc(d,m,(1-y/e)*l,0,2*Math.PI,!0),n.ctx.closePath(),n.ctx.fill()}else{if("diamond"!==h)throw new Error("Unexpected shape:"+h);var b=.5*y;n.ctx.beginPath(),n.ctx.moveTo(f.x+l-b,f.y+l),n.ctx.lineTo(f.x+l,f.y+l+b),n.ctx.lineTo(f.x+l+b,f.y+l),n.ctx.lineTo(f.x+l,f.y+l-b),n.ctx.fill()}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:a,sSize:r,sColor:o})}}])&&Eo(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function zo(t){return zo="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},zo(t)}function Fo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Io(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==zo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==zo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===zo(o)?o:String(o)),r)}var o}function Lo(t,e){return Lo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Lo(t,e)}function Bo(t,e){if(e&&("object"===zo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function No(t){return No=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},No(t)}var Do=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Lo(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=No(r);if(o){var n=No(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Bo(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.strokeColorCol=t.strokeColorCol,e.strokeColor=t.strokeColor||function(){return"#666"},e.sizeCol=t.sizeCol,e.size=t.size,e.strokeWidthCol=t.strokeWidthCol,e.strokeWidth=t.strokeWidth,e.shape=t.shape||function(){return"square"},e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r,o,i,a=this,u=n.getZf();this.strokeColorCol&&(r=nr.getStatistics(t,(function(t){return t[a.strokeColorCol]}),!0)),this.sizeCol&&(o=nr.getStatistics(t,(function(t){return t[a.sizeCol]}),!0)),this.strokeWidthCol&&(i=nr.getStatistics(t,(function(t){return t[a.strokeWidthCol]}),!0)),n.setCanvasTransform();var l,c=.5*e,f=function(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 Fo(t,e);var n=Object.prototype.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)?Fo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(f.s();!(l=f.n()).done;){var s=l.value,h=this.strokeColor?this.strokeColor(s[this.strokeColorCol],e,r):void 0;if(h&&"none"!==h){n.ctx.strokeStyle=h;var y=(this.size||function(){return e})(s[this.sizeCol],e,o,u),p=this.strokeWidth?this.strokeWidth(s[this.strokeWidthCol],e,i,u):1*u;if(p&&!(p<=0)){n.ctx.lineWidth=p;var v=this.shape?this.shape(s):"square";if("none"!==v){var d=this.offset(s,e,u);if("square"===v){var m=e*(1-y/e)*.5;n.ctx.beginPath(),n.ctx.rect(s.x+m+d.dx,s.y+m+d.dy,y,y),n.ctx.stroke()}else if("circle"===v)n.ctx.beginPath(),n.ctx.arc(s.x+c+d.dx,s.y+c+d.dy,.5*y,0,2*Math.PI,!1),n.ctx.stroke();else if("diamond"===v){var b=.5*y;n.ctx.beginPath(),n.ctx.moveTo(s.x+c-b,s.y+c),n.ctx.lineTo(s.x+c,s.y+c+b),n.ctx.lineTo(s.x+c+b,s.y+c),n.ctx.lineTo(s.x+c,s.y+c-b),n.ctx.lineTo(s.x+c-b,s.y+c),n.ctx.stroke()}else{if("donut"!==v)throw new Error("Unexpected shape:"+v);console.error("Not implemented")}}}}}}catch(t){f.e(t)}finally{f.f()}}}])&&Io(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function Zo(t){return Zo="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},Zo(t)}function Uo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Wo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Zo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Zo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Zo(o)?o:String(o)),r)}var o}function Go(t,e){return Go=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Go(t,e)}function $o(t,e){if(e&&("object"===Zo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Yo(t){return Yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yo(t)}var Vo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Go(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Yo(r);if(o){var n=Yo(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return $o(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.heightCol=t.heightCol,e.height=t.height||function(t){return Math.sqrt(t)},e.lineColor=t.lineColor||function(t,e,n,r){return"#BBB"},e.lineWidth=t.lineWidth||function(t,e,n,r){return r},e.fillColor=t.fillColor||function(t,e,n,r){return"#c08c5968"},e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;n.ctx.lineJoin="round";var o,i=n.getZf(),a=nr.getStatistics(t,(function(t){return t[r.heightCol]}),!0),u={},l=function(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 Uo(t,e);var n=Object.prototype.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)?Uo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(o=l.n()).done;){var c=o.value,f=u[c.y];f||(f={},u[c.y]=f),f[c.x]=this.height(c[this.heightCol],e,a,i)}}catch(t){l.e(t)}finally{l.f()}var s=n.extGeo;if(s){var h=Math.floor(s.xMin/e)*e,y=Math.floor(s.xMax/e)*e,p=Math.floor(s.yMin/e)*e,v=Math.floor(s.yMax/e)*e,d={min:p,max:v};n.setCanvasTransform();for(var m=v;m>=p;m-=e){var b=u[m];if(b){n.ctx.beginPath(),n.ctx.moveTo(h-e/2,m);for(var g=void 0,w=h;w<=y;w+=e){var x=b[w];x||(x=0),x||g?n.ctx.lineTo(w+e/2,m+x):n.ctx.moveTo(w+e/2,m),g=x}g&&n.ctx.lineTo(y+e/2,m);var S=this.fillColor(m,d,e,i);S&&"none"!=S&&(n.ctx.fillStyle=S,n.ctx.fill());var _=this.lineColor(m,d,e,i),P=this.lineWidth(m,d,e,i);_&&"none"!=_&&P>0&&(n.ctx.strokeStyle=_,n.ctx.lineWidth=P,n.ctx.stroke())}}}}}])&&Wo(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function Xo(t){return Xo="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},Xo(t)}function qo(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 r,o,i,a,u=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||Ho(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 Ho(t,e){if(t){if("string"==typeof t)return Ko(t,e);var n=Object.prototype.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)?Ko(t,e):void 0}}function Ko(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Jo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Xo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Xo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Xo(o)?o:String(o)),r)}var o}function Qo(t,e){return Qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qo(t,e)}function ti(t,e){if(e&&("object"===Xo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ei(t){return ei=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ei(t)}var ni=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qo(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ei(r);if(o){var n=ei(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return ti(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.color=t.color,e.type=t.type,e.sizeCol=t.sizeCol,e.size=t.size||function(t,e,n,r){return e},e.stripesOrientation=t.stripesOrientation||function(){return 0},e.offsetAngle=t.offsetAngle||function(){return 0},e.agePyramidHeight=t.agePyramidHeight||function(t,e,n){return e},e.pieChartInternalRadiusFactor=t.pieChartInternalRadiusFactor||0,e}return e=a,n=[{key:"draw",value:function(t,e,n){var r,o=this,i=n.getZf();this.sizeCol&&(t.sort((function(t,e){return e[o.sizeCol]-t[o.sizeCol]})),r=nr.getStatistics(t,(function(t){return t[o.sizeCol]}),!0));var a=Object.entries(this.color).length;n.setCanvasTransform();var u,l=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Ho(t))){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(u=l.n()).done;){var c=u.value,f=(this.size||function(){return e})(c[this.sizeCol],e,r,i),s=this.offset(c,e,i),h=this.type?this.type(c):"flag",y=c.x+s.dx+("agepyramid"===h?0:.5*e),p=c.y+s.dy+("agepyramid"===h?0:.5*e);if("agepyramid"===h||"radar"===h||"halftone"===h){for(var v=-1/0,d=0,m=Object.keys(this.color);d<m.length;d++){var b=+c[m[d]];b>v&&(v=b)}var g=0;"agepyramid"===h&&this.agePyramidHeight&&(g=(e-this.agePyramidHeight(c,e,i))/2),"radar"!==h&&"halftone"!==h||(g=Math.PI/2+(this.offsetAngle?this.offsetAngle(c,e,i)*Math.PI/180:0));var w="agepyramid"===h?(this.agePyramidHeight?this.agePyramidHeight(c,e,i):e)/a:"radar"===h||"halftone"===h?2*Math.PI/a:void 0;if(void 0===w)throw new Error("Unexpected symbol type:"+h);for(var x=0,S=Object.entries(this.color);x<S.length;x++){var _=qo(S[x],2),P=_[0],O=_[1];if("agepyramid"===h){n.ctx.fillStyle=O;var j=f*c[P]/v;n.ctx.fillRect(y+(e-j)/2,p+g,j,w),g+=w}else if("radar"===h){n.ctx.fillStyle=O;var C=c[P],k=f/2*Math.sqrt(C/v);n.ctx.beginPath(),n.ctx.moveTo(y,p),n.ctx.arc(y,p,k,g-w,g),n.ctx.lineTo(y,p),n.ctx.fill(),g+=w}else{if("halftone"!==h)throw new Error("Unexpected symbol type:"+h);n.ctx.fillStyle=O;var E=c[P],T=.333*f*Math.sqrt(E/v);n.ctx.beginPath(),n.ctx.arc(y+.25*e*Math.cos(g),p+.25*e*Math.sin(g),T,0,2*Math.PI),n.ctx.fill(),g+=w}}}else{for(var A=0,M=0,R=Object.keys(this.color);M<R.length;M++){var z=+c[R[M]];z&&(A+=z)}if(!A||isNaN(A))continue;for(var F=0,I=e*(1-f/e)*.5,L=this.stripesOrientation(c,e,i),B=0,N=Object.entries(this.color);B<N.length;B++){var D=qo(N[B],2),Z=D[0],U=D[1],W=c[Z]/A;if(W&&!isNaN(W)){if(n.ctx.fillStyle=U,"flag"===h)0==L?n.ctx.fillRect(c.x+I+s.dx,c.y+I+F*f+s.dy,f,W*f):n.ctx.fillRect(c.x+I+F*f+s.dx,c.y+I+s.dy,W*f,f);else if("piechart"===h){var G=2*F*Math.PI,$=2*(F+W)*Math.PI;n.ctx.beginPath(),n.ctx.moveTo(y,p),n.ctx.arc(y,p,.5*f,G,$),this.pieChartInternalRadiusFactor&&n.ctx.arc(y,p,.5*f*this.pieChartInternalRadiusFactor,G,$,!0),n.ctx.closePath(),n.ctx.fill()}else if("ring"===h)n.ctx.beginPath(),n.ctx.arc(y,p,Math.sqrt(1-F)*f*.5,0,2*Math.PI),n.ctx.fill();else{if("segment"!==h)throw new Error("Unexpected symbol type:"+h);var Y=f*f/e;0==L?n.ctx.fillRect(c.x+s.dx,c.y+(e-Y)/2+F*Y+s.dy,e,W*Y):n.ctx.fillRect(c.x+F*e+s.dx,c.y+(e-Y)/2+s.dy,W*e,Y)}F+=W}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,r:e,zf:i,sSize:r})}}],n&&Jo(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function ri(t){return ri="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},ri(t)}function oi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ii(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ri(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ri(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ri(o)?o:String(o)),r)}var o}function ai(t,e){return ai=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ai(t,e)}function ui(t,e){if(e&&("object"===ri(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function li(t){return li=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},li(t)}var ci=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ai(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=li(r);if(o){var n=li(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return ui(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.orientation=t.orientation||function(){return 0},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.lengthCol=t.lengthCol,e.length=t.length,e.widthCol=t.widthCol,e.width=t.width,e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r,o,i,a=this,u=n.getZf();this.colorCol&&(r=nr.getStatistics(t,(function(t){return t[a.colorCol]}),!0)),this.lengthCol&&(t.sort((function(t,e){return e[a.lengthCol]-t[a.lengthCol]})),o=nr.getStatistics(t,(function(t){return t[a.lengthCol]}),!0)),this.widthCol&&(i=nr.getStatistics(t,(function(t){return t[a.widthCol]}),!0)),n.ctx.lineCap="butt";var l=Math.PI/180;n.setCanvasTransform();var c,f=function(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 oi(t,e);var n=Object.prototype.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)?oi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(f.s();!(c=f.n()).done;){var s=c.value,h=this.color?this.color(s[this.colorCol],e,r):void 0;if(h){var y=this.width?this.width(s[this.widthCol],e,i,u):void 0;if(y&&!(y<0)){var p=this.length?this.length(s[this.lengthCol],e,o,u):void 0;if(p&&!(p<0)){var v=this.orientation(s)*l;if(void 0!==v&&!isNaN(v)){var d=this.offset(s,e,u);n.ctx.strokeStyle=h,n.ctx.lineWidth=y;var m=s.x+e/2+d.dx,b=s.y+e/2+d.dy,g=.5*Math.cos(v)*p,w=.5*Math.sin(v)*p;n.ctx.beginPath(),n.ctx.moveTo(m-g,b-w),n.ctx.lineTo(m+g,b+w),n.ctx.stroke()}}}}}}catch(t){f.e(t)}finally{f.f()}this.updateLegends({style:this,r:e,zf:u,sColor:r,sLength:o,sWidth:i})}}])&&ii(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function fi(t){return fi="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},fi(t)}function si(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function hi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==fi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==fi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===fi(o)?o:String(o)),r)}var o}function yi(t,e){return yi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yi(t,e)}function pi(t,e){if(e&&("object"===fi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function vi(t){return vi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vi(t)}var di=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yi(t,e)}(u,t);var e,n,r,o,i,a=(o=u,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=vi(o);if(i){var n=vi(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return pi(this,t)});function u(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),e=a.call(this,t),t=t||{},e.textCol=t.textCol,e.text=t.text||function(t,e,n,r){return"X"},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.fontSizeCol=t.fontSizeCol,e.fontSize=t.fontSize||function(t,e,n,r){return e-2},e.fontFamily=t.fontFamily||"Arial",e.fontWeight=t.fontWeight||"bold",e}return e=u,r=[{key:"getCharLegendFun",value:function(t){var e=t.length;return function(n){return 0==n?"":1==n?t[e-1]:t[Math.floor(n*e)]}}}],(n=[{key:"draw",value:function(t,e,n){var r,o,i,a=this,u=n.getZf();this.textCol&&(r=nr.getStatistics(t,(function(t){return t[a.textCol]}),!0)),this.colorCol&&(o=nr.getStatistics(t,(function(t){return t[a.colorCol]}),!0)),this.fontSizeCol&&(t.sort((function(t,e){return e[a.fontSizeCol]-t[a.fontSizeCol]})),i=nr.getStatistics(t,(function(t){return t[a.fontSizeCol]}),!0));var l,c=function(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 si(t,e);var n=Object.prototype.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)?si(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(l=c.n()).done;){var f=l.value,s=this.text?this.text(f[this.textCol],e,r):void 0;if(s){var h=this.color?this.color(f[this.colorCol],e,o):void 0;if(h){n.ctx.fillStyle=h;var y=(this.fontSize||function(){return e/u-2})(f[this.fontSizeCol],e,i,u)/u,p=this.fontFamily||"Arial",v=this.fontWeight||"bold";n.ctx.font=v+" "+y+"px "+p;var d=this.offset(f,e,u);n.ctx.textAlign="center";var m=n.geoToPixX(f.x+.5*e+d.dx),b=n.geoToPixY(f.y+.5*e+d.dy)+.5*y;n.ctx.fillText(s,m,b)}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:u,sColor:o})}}])&&hi(e.prototype,n),r&&hi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),u}(nr);function mi(t){return mi="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},mi(t)}function bi(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 gi(t,e);var n=Object.prototype.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)?gi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function gi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function wi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==mi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==mi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===mi(o)?o:String(o)),r)}var o}function xi(t,e){return xi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xi(t,e)}function Si(t,e){if(e&&("object"===mi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _i(t){return _i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_i(t)}var Pi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xi(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=_i(r);if(o){var n=_i(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Si(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.value=t.value,e.sigma=t.sigma,e.styles=t.styles,e}return e=a,(n=[{key:"getKernelMatrix",value:function(t){for(var e,n,r=Math.floor(3*t),o=2*t*t,i=[],a=0;a<=r;a++){for(var u=[],l=0;l<=r;l++){var c=(e=a,n=l,Math.exp(-(e*e+n*n)/o));u.push({w:c,val:0})}i.push(u)}return i}},{key:"kernelSmoothing",value:function(t,e,n,r){var o,i=Math.floor(e.xMin/n)*n,a=Math.floor(e.xMax/n)*n,u=Math.floor(e.yMin/n)*n,l=Math.floor(e.yMax/n)*n,c=(a-i)/n+1,f=(l-u)/n+1,s=bi(t);try{for(s.s();!(o=s.n()).done;)o.value.ksmval=0}catch(t){s.e(t)}finally{s.f()}var h,y={},p=bi(t);try{for(p.s();!(h=p.n()).done;){var v=h.value,d=Math.floor((v.x-i)/n),m=Math.floor((v.y-u)/n);y[d]||(y[d]={}),y[d][m]=v}}catch(t){p.e(t)}finally{p.f()}for(var b=this.getKernelMatrix(r),g=b.length,w=0,x=Object.keys(y);w<x.length;w++)for(var S=x[w],_=+S,P=0,O=Object.keys(y[S]);P<O.length;P++){var j=+O[P],C=y[_][j];if(!C.notInputCell){var k=this.value(C);if(k){for(var E=0,T=0;T<g;T++)for(var A=0;A<g;A++){var M=b[T][A];M.val=M.w*k,E+=M.w}for(var R=function(t,e){return t>=0&&t<c&&e>=0&&e<f},z=function(t,e,r){var o=y[t]?y[t][e]:void 0;o?o.ksmval?o.ksmval+=r:o.ksmval=r:(y[t]||(y[t]={}),y[t][e]={x:i+t*n,y:u+e*n,ksmval:r,notInputCell:!0})},F=0;F<g;F++)for(var I=0;I<g;I++){var L=b[Math.abs(F)][Math.abs(I)];if(L){var B=L.val;B&&(B/=E)&&(R(_+F,j+I)&&z(_+F,j+I,B),0==F&&0==I||(R(_-F,j+I)&&z(_-F,j+I,B),0!=F&&(R(_+F,j-I)&&z(_+F,j-I,B),R(_-F,j-I)&&z(_-F,j-I,B))))}}}}}for(var N=[],D=0,Z=Object.keys(y);D<Z.length;D++)for(var U=Z[D],W=0,G=Object.keys(y[U]);W<G.length;W++){var $=G[W];N.push(y[U][$])}return N}},{key:"draw",value:function(t,e,n){if(t&&0!=t.length){var r=this.sigma(e,n.zf);t=this.kernelSmoothing(t,n.extGeo,e,r/e);var o,i=bi(this.styles);try{for(i.s();!(o=i.n()).done;)o.value.draw(t,e,n)}catch(t){i.e(t)}finally{i.f()}}}}])&&wi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function Oi(t){return Oi="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},Oi(t)}function ji(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 Ci(t,e);var n=Object.prototype.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)?Ci(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ci(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ki(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Oi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Oi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Oi(o)?o:String(o)),r)}var o}function Ei(t,e){return Ei=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ei(t,e)}function Ti(t,e){if(e&&("object"===Oi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ai(t){return Ai=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ai(t)}var Mi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ei(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ai(r);if(o){var n=Ai(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ti(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.heightCol=t.heightCol,e.height=t.height,e.colorCol=t.colorCol,e.color=t.color||function(){return"#c08c59"},e.widthCol=t.widthCol,e.width=t.width||function(t,e){return.5*e},e.simple=null!=t.simple,e.viewHeightFactor=t.viewHeightFactor||1.5,e.viewSX=null==t.viewSX?0:t.viewSX,e.viewSY=null==t.viewSY?-.5:t.viewSY,e.shadowDirection=null==t.shadowDirection?-40.3*Math.PI/180:t.shadowDirection,e.shadowFactor=t.shadowFactor||.3,e.shadowColor=t.shadowColor||"#00000033",e.outlineCol=t.outlineCol||"#FFFFFF",e.outlineWidthPix=null==t.outlineWidthPix?.5:t.outlineWidthPix,e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r,o,i,a=this,u=n.getZf();this.heightCol&&(r=nr.getStatistics(t,(function(t){return t[a.heightCol]}),!0)),this.colorCol&&(o=nr.getStatistics(t,(function(t){return t[a.colorCol]}),!0)),this.widthCol&&(i=nr.getStatistics(t,(function(t){return t[a.widthCol]}),!0));var l=n.getCenter().x+this.viewSX*n.w*u,c=n.getCenter().y+this.viewSY*n.h*u,f=this.viewHeightFactor*(n.w+n.h)*.5*u;t.sort((function(t,e){return 1e8*(e.y-t.y)+t.x-e.x})),n.ctx.lineCap=this.simple?"butt":"round",n.setCanvasTransform(),n.ctx.strokeStyle=this.shadowColor,n.ctx.fillStyle=this.shadowColor;var s,h=ji(t);try{for(h.s();!(s=h.n()).done;){var y=s.value,p=this.width?this.width(y[this.widthCol],e,i,u):void 0;if(p&&!(p<0)){var v=this.height?this.height(y[this.heightCol],e,r,u):void 0;if(v&&!(v<0)){this.offset(y,e,u),n.ctx.lineWidth=p;var d=y.x+e/2,m=y.y+e/2,b=v*this.shadowFactor;n.ctx.beginPath(),n.ctx.moveTo(d,m),n.ctx.lineTo(d+b*Math.cos(this.shadowDirection),m+b*Math.sin(this.shadowDirection)),n.ctx.stroke()}}}}catch(t){h.e(t)}finally{h.f()}var g,w=ji(t);try{for(w.s();!(g=w.n()).done;){var x=g.value,S=this.color?this.color(x[this.colorCol],e,o):void 0;if(S){var _=this.width?this.width(x[this.widthCol],e,i,u):void 0;if(_&&!(_<0)){var P=this.height?this.height(x[this.heightCol],e,r,u):void 0;if(P&&!(P<0)){this.offset(x,e,u);var O=x.x+e/2,j=x.y+e/2,C=O-l,k=j-c,E=Math.atan2(k,C),T=Math.sqrt(C*C+k*k)*P/(f-P);this.simple?(n.ctx.strokeStyle=S,n.ctx.lineWidth=_,n.ctx.beginPath(),n.ctx.moveTo(O,j),n.ctx.lineTo(O+T*Math.cos(E),j+T*Math.sin(E)),n.ctx.stroke()):(n.ctx.strokeStyle=this.outlineCol,n.ctx.lineWidth=_+2*this.outlineWidthPix*u,n.ctx.beginPath(),n.ctx.moveTo(O,j),n.ctx.lineTo(O+T*Math.cos(E),j+T*Math.sin(E)),n.ctx.stroke(),n.ctx.strokeStyle=S,n.ctx.lineWidth=_,n.ctx.beginPath(),n.ctx.moveTo(O,j),n.ctx.lineTo(O+T*Math.cos(E),j+T*Math.sin(E)),n.ctx.stroke(),n.ctx.strokeStyle=this.outlineCol,n.ctx.lineWidth=this.outlineWidthPix*u,n.ctx.beginPath(),n.ctx.arc(O+T*Math.cos(E),j+T*Math.sin(E),.5*_,0,2*Math.PI,!1),n.ctx.stroke())}}}}}catch(t){w.e(t)}finally{w.f()}n.ctx.lineCap="butt",this.updateLegends({style:this,r:e,zf:u,sColor:o})}}])&&ki(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function Ri(t){return Ri="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},Ri(t)}function zi(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 Fi(t,e);var n=Object.prototype.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)?Fi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Fi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ii(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ri(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ri(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ri(o)?o:String(o)),r)}var o}function Li(t,e){return Li=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Li(t,e)}function Bi(t,e){if(e&&("object"===Ri(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ni(t){return Ni=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ni(t)}var Di=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Li(t,e)}(u,t);var e,n,r,o,i,a=(o=u,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ni(o);if(i){var n=Ni(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Bi(this,t)});function u(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),e=a.call(this,t),t=t||{},e.valueCol=t.valueCol,e.value=t.value||function(t,e,n,r,o){return 1},e.color=t.color||function(){return"#EA6BAC"},e.width=t.width||function(t,e,n,r){return e*t.value/5},e.orientation=t.orientation||0,e.fillColor=t.fillColor,e}return e=u,r=[{key:"getSideStatistics",value:function(t,e){if(t&&0!=t.length){var n,r=1/0,o=-1/0,i=zi(t);try{for(i.s();!(n=i.n()).done;){var a=n.value.value;e&&!a||(a<r&&(r=a),a>o&&(o=a))}}catch(t){i.e(t)}finally{i.f()}return{min:r,max:o}}}}],(n=[{key:"draw",value:function(t,e,n){var r,o=this,i=n.getZf();this.valueCol&&(r=nr.getStatistics(t,(function(t){return t[o.valueCol]}),!0));var a=[];t.sort((function(t,e){return e.x==t.x?t.y-e.y:t.x-e.x}));for(var l=t[0],c=1;c<t.length;c++){var f=t[c];l.y+e==f.y&&l.x==f.x?a.push({x:l.x,y:f.y,or:"h",value:this.value(l[this.valueCol],f[this.valueCol],e,r,i)}):(a.push({x:l.x,y:l.y+e,or:"h",value:this.value(l[this.valueCol],void 0,e,r,i)}),a.push({x:f.x,y:f.y,or:"h",value:this.value(void 0,f[this.valueCol],e,r,i)})),l=f}t.sort((function(t,e){return e.y==t.y?t.x-e.x:t.y-e.y})),l=t[0];for(var s=1;s<t.length;s++){var h=t[s];l.x+e==h.x&&l.y==h.y?a.push({x:l.x+e,y:l.y,or:"v",value:this.value(l[this.valueCol],h[this.valueCol],e,r,i)}):(a.push({x:l.x+e,y:l.y,or:"v",value:this.value(l[this.valueCol],void 0,e,r,i)}),a.push({x:h.x,y:h.y,or:"v",value:this.value(void 0,h[this.valueCol],e,r,i)})),l=h}if(0!=a.length){var y=u.getSideStatistics(a,!0);if(n.setCanvasTransform(),this.fillColor){var p,v=zi(t);try{for(v.s();!(p=v.n()).done;){var d=p.value,m=this.fillColor(d);m&&"none"!=m&&(n.ctx.fillStyle=m,n.ctx.fillRect(d.x,d.y,e,e))}}catch(t){v.e(t)}finally{v.f()}}n.ctx.lineCap="butt";for(var b=e/2,g=0,w=a;g<w.length;g++){var x=w[g],S=this.color?this.color(x,e,y,i):void 0;if(S&&"none"!=S){var _=this.width?this.width(x,e,y,i):void 0;!_||_<=0||(n.ctx.strokeStyle=S,n.ctx.lineWidth=_,n.ctx.beginPath(),90==this.orientation?(n.ctx.moveTo(x.x+b,x.y+b),"h"===x.or?n.ctx.lineTo(x.x+b,x.y-b):n.ctx.lineTo(x.x-b,x.y+b)):(n.ctx.moveTo(x.x,x.y),n.ctx.lineTo(x.x+("h"===x.or?e:0),x.y+("v"===x.or?e:0))),n.ctx.stroke())}}this.updateLegends({style:this,r:e,zf:i})}}}])&&Ii(e.prototype,n),r&&Ii(e,r),Object.defineProperty(e,"prototype",{writable:!1}),u}(nr);function Zi(t){return Zi="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},Zi(t)}function Ui(t,e){return Ui=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ui(t,e)}function Wi(t,e){if(e&&("object"===Zi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Gi(t){return Gi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gi(t)}var $i=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ui(t,e)}(i,t);var e,n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Gi(n);if(r){var o=Gi(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return Wi(this,t)});function i(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),(t=t||{}).breaks=t.breaks||[100,1e3,1e4,1e5,1e6],t.width=t.width||function(){return 1},t.color=t.color||function(){return"#E7A935"};var n=function(e){if(null==e)return 0;for(var n=0;n<t.breaks.length;n++)if(e<t.breaks[n])return n;return t.breaks.length};return e.value=function(t,e,r,o,i){return Math.abs(n(e)-n(t))},e.color=function(e,n,r,o){return e.value?t.color(e,n,o):void 0},e.width=function(e,n,r,o){return e.value*o*t.width(e,n,o)},e}return e=i,Object.defineProperty(e,"prototype",{writable:!1}),e}(Di);function Yi(t){return Yi="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},Yi(t)}function Vi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Xi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Yi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Yi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Yi(o)?o:String(o)),r)}var o}function qi(t,e){return qi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qi(t,e)}function Hi(t,e){if(e&&("object"===Yi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ki(t){return Ki=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ki(t)}var Ji=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&qi(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ki(r);if(o){var n=Ki(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Hi(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.col=t.col,e.color=t.color,e.width=t.width||function(t,e,n){return.2*e},e.fillColor=t.fillColor,e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=n.getZf(),o=[];t.sort((function(t,e){return e.x==t.x?t.y-e.y:t.x-e.x}));for(var i=t[0],a=i[this.col],u=1;u<t.length;u++){var l=t[u],c=l[this.col];i.y+e==l.y&&i.x==l.x?a!=c&&o.push({x:i.x,y:l.y,or:"h",v1:a,v2:c}):(o.push({x:i.x,y:i.y+e,or:"h",v1:a,v2:void 0}),o.push({x:l.x,y:l.y,or:"h",v1:void 0,v2:c})),i=l,a=c}t.sort((function(t,e){return e.y==t.y?t.x-e.x:t.y-e.y})),a=(i=t[0])[this.col];for(var f=1;f<t.length;f++){var s=t[f],h=s[this.col];i.x+e==s.x&&i.y==s.y?a!=h&&o.push({x:i.x+e,y:i.y,or:"v",v1:a,v2:h}):(o.push({x:i.x+e,y:i.y,or:"v",v1:a,v2:void 0}),o.push({x:s.x,y:s.y,or:"v",v1:void 0,v2:h})),i=s,a=h}if(0!=o.length){if(n.setCanvasTransform(),this.fillColor){var y,p=function(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 Vi(t,e);var n=Object.prototype.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)?Vi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(p.s();!(y=p.n()).done;){var v=y.value,d=this.fillColor(v);d&&"none"!=d&&(n.ctx.fillStyle=d,n.ctx.fillRect(v.x,v.y,e,e))}}catch(t){p.e(t)}finally{p.f()}}n.ctx.lineCap="butt";for(var m=0,b=o;m<b.length;m++){var g=b[m],w=this.width?this.width(g,e,r):void 0;if(w&&!(w<=0)){var x=.5*w;n.ctx.lineWidth=w,"h"===g.or?(g.v2&&(n.ctx.beginPath(),n.ctx.strokeStyle=this.color[g.v2],n.ctx.moveTo(g.x,g.y+x),n.ctx.lineTo(g.x+e,g.y+x),n.ctx.stroke()),g.v1&&(n.ctx.beginPath(),n.ctx.strokeStyle=this.color[g.v1],n.ctx.moveTo(g.x,g.y-x),n.ctx.lineTo(g.x+e,g.y-x),n.ctx.stroke())):(g.v2&&(n.ctx.beginPath(),n.ctx.strokeStyle=this.color[g.v2],n.ctx.moveTo(g.x+x,g.y),n.ctx.lineTo(g.x+x,g.y+e),n.ctx.stroke()),g.v1&&(n.ctx.beginPath(),n.ctx.strokeStyle=this.color[g.v1],n.ctx.moveTo(g.x-x,g.y),n.ctx.lineTo(g.x-x,g.y+e),n.ctx.stroke()))}}this.updateLegends({style:this,r:e,zf:r})}}}])&&Xi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);const Qi=function t(e){function n(t,n){var r,o;return t=null==t?0:+t,n=null==n?1:+n,function(){var i;if(null!=r)i=r,r=null;else do{r=2*e()-1,i=2*e()-1,o=r*r+i*i}while(!o||o>1);return t+n*i*Math.sqrt(-2*Math.log(o)/o)}}return n.source=t,n}(Math.random);function ta(t,e){var n=document.createElement("canvas");n.setAttribute("width",t),n.setAttribute("height",e);var r=n.getContext("webgl");if(!r)throw new Error("Unable to initialize WebGL. Your browser or machine may not support it.");return{canvas:n,gl:r}}function ea(t){var e=t.createProgram();if(null==e)throw new Error("Cannot create webGL program");for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(var i=0,a=r;i<a.length;i++){var u=a[i];t.attachShader(e,u)}if(t.linkProgram(e),t.getProgramParameter(e,t.LINK_STATUS))return e;throw new Error(t.getProgramInfoLog(e)||"Cannot create webGL program (2)")}function na(t,e){var n=t.createShader(e);if(null==n)throw new Error("Cannot create webGL shader");for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];if(t.shaderSource(n,o.join("\n")),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS))return n;throw new Error(t.getShaderInfoLog(n)||"Cannot create webGL shader (2)")}function ra(t){return ra="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},ra(t)}function oa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ra(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ra(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ra(o)?o:String(o)),r)}var o}var ia=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gl=e,this.sizePix=n||10,this.program=ea(e,na(e,e.VERTEX_SHADER,"\n attribute vec2 pos;\n uniform float sizePix;\n uniform mat3 mat;\n attribute vec4 color;\n varying vec4 vColor;\n void main() {\n gl_Position = vec4(mat * vec3(pos, 1.0), 1.0);\n gl_PointSize = sizePix;\n vColor = color;\n }\n "),na(e,e.FRAGMENT_SHADER,"\n precision mediump float;\n varying vec4 vColor;\n void main(void) {\n vec4 vColor_ = vColor / 255.0;\n vColor_[3] = 255.0 * vColor_[3];\n gl_FragColor = vColor_;\n }")),e.useProgram(this.program),this.verticesBuffer=[],this.colorsBuffer=[]}var e,n;return e=t,(n=[{key:"addPointData",value:function(t,e,n){var r=Me(n);r&&(this.verticesBuffer.push(t,e),this.colorsBuffer.push(r.r,r.g,r.b,r.opacity))}},{key:"addPointData2",value:function(t,e,n,r,o,i){this.verticesBuffer.push(t,e),this.colorsBuffer.push(n,r,o,i)}},{key:"draw",value:function(t){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.verticesBuffer),e.STATIC_DRAW);var n=e.getAttribLocation(this.program,"pos");e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n),e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.colorsBuffer),e.STATIC_DRAW);var r=e.getAttribLocation(this.program,"color");e.vertexAttribPointer(r,4,e.FLOAT,!1,0,0),e.enableVertexAttribArray(r),e.uniform1f(e.getUniformLocation(this.program,"sizePix"),1*this.sizePix),e.uniformMatrix3fv(e.getUniformLocation(this.program,"mat"),!1,new Float32Array(t)),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.POINTS,0,this.verticesBuffer.length/2)}}])&&oa(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function aa(t){return aa="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},aa(t)}function ua(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 la(t,e);var n=Object.prototype.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)?la(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function la(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ca(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==aa(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==aa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===aa(o)?o:String(o)),r)}var o}function fa(t,e){return fa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fa(t,e)}function sa(t,e){if(e&&("object"===aa(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ha(t){return ha=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ha(t)}var ya=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fa(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ha(r);if(o){var n=ha(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return sa(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.nbCol=t.nbCol,e.nb=t.nb||function(t,e,n,r){return.3*e*e/(r*r)*t/n.max},e.color=t.color||function(){return"#FF5733"},e.dotSize=t.dotSize,e.sigma=t.sigma,e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r,o=this,i=n.getZf();if(this.nbCol&&(r=nr.getStatistics(t,(function(t){return t[o.nbCol]}),!0)),r){var a=this.dotSize?this.dotSize(e,i):2*i,u=this.sigma?this.sigma(e,i):.4*e,l=Qi(0,u);if(function(){try{var t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}}()){var c=ta(n.w+"",n.h+"");if(!c)return void console.error("No webGL");var f,s,h,y,p,v,d,m=new ia(c.gl,a/i),b=e/2,g=ua(t);try{for(g.s();!(d=g.n()).done;){var w=d.value;if((f=this.color(w))&&"none"!==f){if(s=this.offset(w,e,i),h=this.nb(w[this.nbCol],e,r,i),y=w.x+s.dx+b,p=w.y+s.dy+b,!(v=Me(f)))return;for(var x=0;x<=h;x++)m.addPointData2(y+l(),p+l(),v.r,v.g,v.b,v.opacity)}}}catch(t){g.e(t)}finally{g.f()}m.draw(n.getWebGLTransform()),n.initCanvasTransform(),n.ctx.drawImage(c.canvas,0,0)}else{n.setCanvasTransform();var S,_=ua(t);try{for(_.s();!(S=_.n()).done;){var P=S.value,O=this.color(P);if(O&&"none"!==O){n.ctx.fillStyle=O;for(var j=this.offset(P,e,i),C=this.nb(P[this.nbCol],e,r,i),k=P.x+j.dx+e/2,E=P.y+j.dy+e/2,T=0;T<=C;T++)n.ctx.fillRect(k+l(),E+l(),a,a)}}}catch(t){_.e(t)}finally{_.f()}}this.updateLegends({style:this,r:e,zf:i})}}}])&&ca(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function pa(t){return pa="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},pa(t)}function va(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function da(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==pa(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==pa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===pa(o)?o:String(o)),r)}var o}var ma=function(){function t(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;va(this,t),this.gl=e;var i=na(e,e.VERTEX_SHADER,"\n attribute vec2 pos;\n uniform float sizePix;\n uniform mat3 mat;\n\n attribute float t;\n varying float vt;\n\n void main() {\n gl_Position = vec4(mat * vec3(pos, 1.0), 1.0);\n gl_PointSize = sizePix;\n vt = t;\n }\n "),a="\n precision mediump float;\n varying float vt;\n uniform float alpha;"+function(){for(var t=[],e=0;e<n.length;e++)t.push("uniform vec4 c"+e+";");return t.join("")}()+"void main(void) {\n ";if(r?"pow"==r.fun?a+="float t = pow(vt, alpha);":"powRev"==r.fun?a+="float t = 1.0-pow(1.0-vt, 1.0/alpha);":"exp"==r.fun?a+=0==r.alpha?"float t = vt;":"float t = (exp(vt * alpha) - 1.0) / (exp(alpha) - 1.0);":"expRev"==r.fun?a+=0==r.alpha?"float t = vt;":"float t = 1.0 - (1.0 / alpha) * log(exp(alpha) * (1.0 - vt) + vt);":"circleLow"==r.fun?0==r.alpha?a+="float t = vt;":1==r.alpha?a+="float t = sqrt(vt * (2.0 - vt));":a+="float a = alpha / (1.0 - alpha);\n float t = sqrt(1.0 / (a * a) + vt * ( 2.0/a + 2.0 - vt )) - 1.0 / a;":"circleHigh"==r.fun?0==r.alpha?a+="float t = vt;":1==r.alpha?a+="float t = 1.0 - sqrt((1.0 - vt) * (1.0 + vt));":a+="float a = alpha / (1.0 - alpha);\n float t = 1.0 - sqrt(1.0 / (a * a) + (1.0-vt) * ( 2.0/a + 1.0 + vt )) + 1.0 / a;":(console.error("Unexpected stretching function code: "+r.fun),a+="float t = vt;"):a+="float t = vt;",1==n.length)a+="\n vec4 cI=c0;\n vec4 cF=c0;";else if(2==n.length)a+="\n vec4 cI=c0;\n vec4 cF=c1;";else{var u=n.length-1,l=u+".0";a+="\n vec4 cI;\n vec4 cF;\n if(t<1.0/"+l+") { cI=c0; cF=c1; t=t*"+l+"; }";for(var c=2;c<u;c++)a+="else if(t<"+c+".0/"+l+") { cI=c"+(c-1)+"; cF=c"+c+"; t="+l+"*t-"+(c-1)+".0; }";a+="else { cI=c"+(u-1)+"; cF=c"+u+"; t="+l+"*t-"+(u-1)+".0; }"}1==n.length?a+="gl_FragColor = vec4(c0[0], c0[1], c0[2], c0[3]);}":a+="gl_FragColor = mix(cI, cF, t);}";var f=na(e,e.FRAGMENT_SHADER,a);this.program=ea(e,i,f),e.useProgram(this.program),e.uniform1f(e.getUniformLocation(this.program,"sizePix"),1*o),e.uniform1f(e.getUniformLocation(this.program,"alpha"),r?1*r.alpha:0);for(var s=0;s<n.length;s++){var h=Me(n[s]);e.uniform4fv(e.getUniformLocation(this.program,"c"+s),[+h.r/255,+h.g/255,+h.b/255,+h.opacity])}}var e,n;return e=t,(n=[{key:"draw",value:function(t,e,n){var r=this.gl,o=this.program;r.bindBuffer(r.ARRAY_BUFFER,r.createBuffer()),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t),r.STATIC_DRAW);var i=r.getAttribLocation(o,"pos");r.vertexAttribPointer(i,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(i),r.bindBuffer(r.ARRAY_BUFFER,r.createBuffer()),r.bufferData(r.ARRAY_BUFFER,new Float32Array(e),r.STATIC_DRAW);var a=r.getAttribLocation(o,"t");r.vertexAttribPointer(a,1,r.FLOAT,!1,0,0),r.enableVertexAttribArray(a),r.uniformMatrix3fv(r.getUniformLocation(o,"mat"),!1,new Float32Array(n)),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.POINTS,0,t.length/2)}}])&&da(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ba(t){return ba="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},ba(t)}function ga(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ba(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ba(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ba(o)?o:String(o)),r)}var o}function wa(t,e){return wa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wa(t,e)}function xa(t,e){if(e&&("object"===ba(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Sa(t){return Sa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sa(t)}var _a=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wa(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Sa(r);if(o){var n=Sa(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return xa(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,e.tFun=t.tFun||function(t,e,n){return t/n.max},e.stretching=t.stretching,e.colors=t.colors||["rgb(158, 1, 66)","rgb(248, 142, 83)","rgb(251, 248, 176)","rgb(137, 207, 165)","rgb(94, 79, 162)"].reverse(),t.color&&(e.colors=[t.color(0),t.color(.2),t.color(.4),t.color(.6),t.color(.8),t.color(1)]),e.size=t.size,e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this,o=n.getZf(),i=nr.getStatistics(t,(function(t){return t[r.colorCol]}),!0);if(i){var a=ta(n.w+"",n.h+"");if(a){for(var u,l=e/2,c=t.length,f=[],s=[],h=0;h<c;h++){u=t[h];var y=this.tFun(u[this.colorCol],e,i);null!=y&&null!=y&&(f.push(u.x+l,u.y+l),s.push(y>1?1:y<0?0:y))}var p=this.size?this.size(e,o):e+.2*o;new ma(a.gl,this.colors,this.stretching,p/o).draw(f,s,n.getWebGLTransform()),n.initCanvasTransform(),n.ctx.drawImage(a.canvas,0,0),this.updateLegends({style:this,r:e,zf:o,sColor:i})}else console.error("No webGL")}}}])&&ga(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function Pa(t){return Pa="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},Pa(t)}function Oa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Pa(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Pa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Pa(o)?o:String(o)),r)}var o}var ja=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n;return e=t,n=[{key:"get",value:function(t,e){if(null!=(e=e||{}).nb){e.nb<2&&(console.error("unexpected number of colors in tanaka (<2): "+e.nb),e.nb=2),e.color||(console.error("color function not defined in tanaka"),e.color=function(){return"gray"}),e.colors=[];for(var n=0;n<e.nb;n++)e.colors.push(e.color(n/(e.nb-1)))}e.colors=e.colors||["#a9bb9e","#c9dcaa","#fde89f","#f9a579","#eb444b"];var r=e.colors.length;e.tFun=e.tFun||function(t,e,n){return(t-n.min)/(n.max-n.min)},e.colDark=e.colDark||"#111",e.colBright=e.colBright||"#ddd",e.widthFactor=e.widthFactor||.08;var o=function(t){if(isNaN(t)||null==t)return console.error("Unexpected t value 1: "+t),-9;for(var e=0;e<r;e++)if(t<=(e+1)/r)return e;return console.error("Unexpected t value 2: "+t),-9};return[new _a({colorCol:t,colors:e.colors,tFun:function(t,n,i){var a=e.tFun(t,n,i);return o(a)/(r-1)},size:function(t,e){return t+.5*e}}),new Di({valueCol:t,value:function(t,n,r,i,a){if(void 0===t&&void 0===n)return 0;if(void 0===n){var u=e.tFun(t,r,i);if(null==u||isNaN(u))throw new Error("Unexpected value: "+t+" - "+u);return o(u)+1}if(void 0===t){var l=e.tFun(n,r,i);if(null==l||isNaN(l))throw new Error("Unexpected value: "+n+" - "+l);return-o(l)-1}var c=e.tFun(t,r,i);if(null==c||isNaN(c))throw new Error("Unexpected value: "+t+" - "+c);var f=e.tFun(n,r,i);if(null==f||isNaN(f))throw new Error("Unexpected value: "+n+" - "+f);var s=o(c);return-o(f)+s},color:function(t,n,r,o){if(0!==t.value)return"v"===t.or?t.value<0?e.colBright:e.colDark:t.value<0?e.colDark:e.colBright},width:function(t,n,r,o){return e.widthFactor*n*Math.abs(t.value)*("v"===t.or?.5:1)}})]}}],null&&Oa(e.prototype,null),n&&Oa(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ca(t){return Ca="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},Ca(t)}function ka(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ca(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ca(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ca(o)?o:String(o)),r)}var o}var Ea=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.colors=e,this.vshString="\n attribute vec2 pos;\n uniform float sizePix;\n uniform mat3 mat;\n\n attribute float i;\n varying float vi;\n\n void main() {\n gl_Position = vec4(mat * vec3(pos, 1.0), 1.0);\n gl_PointSize = sizePix;\n vi = i;\n }\n ";var n=[];n.push("precision mediump float;\nvarying float vi;\n"),n.push("uniform vec4");for(var r=0;r<e.length;r++)r>0&&n.push(","),n.push(" c"+r);n.push(";\n"),n.push("void main(void) {\n");for(var o=0;o<e.length;o++)o>0&&n.push("else "),n.push("if(vi=="),n.push(o),n.push(".0) gl_FragColor = vec4(c"),n.push(o),n.push("[0], c"),n.push(o),n.push("[1], c"),n.push(o),n.push("[2], c"),n.push(o),n.push("[3]);\n");n.push("else gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}"),this.fshString=n.join("")}var e,n;return e=t,n=[{key:"draw",value:function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,i=na(t,t.VERTEX_SHADER,this.vshString),a=na(t,t.FRAGMENT_SHADER,this.fshString),u=ea(t,i,a);t.useProgram(u),t.uniform1f(t.getUniformLocation(u,"sizePix"),1*o);for(var l=0;l<this.colors.length;l++){var c=Me(this.colors[l]);t.uniform4fv(t.getUniformLocation(u,"c"+l),[+c.r/255,+c.g/255,+c.b/255,+c.opacity])}t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array(e),t.STATIC_DRAW);var f=t.getAttribLocation(u,"pos");t.vertexAttribPointer(f,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(f),t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array(n),t.STATIC_DRAW);var s=t.getAttribLocation(u,"i");t.vertexAttribPointer(s,1,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s),t.uniformMatrix3fv(t.getUniformLocation(u,"mat"),!1,new Float32Array(r)),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.POINTS,0,e.length/2)}}],n&&ka(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ta(t){return Ta="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},Ta(t)}function Aa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ta(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ta(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ta(o)?o:String(o)),r)}var o}function Ma(t,e){return Ma=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ma(t,e)}function Ra(t,e){if(e&&("object"===Ta(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function za(t){return za=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},za(t)}var Fa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ma(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=za(r);if(o){var n=za(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ra(this,t)});function a(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,t.color=t.color||void 0;var n=Object.keys(t.color);e.catToI={};for(var r=0;r<n.length;r++)e.catToI[n[r]]=r+"";e.colors=[];for(var o=0;o<n.length;o++)e.colors.push(t.color[""+n[o]]);return e.size=t.size,e.wgp=new Ea(e.colors),e}return e=a,(n=[{key:"draw",value:function(t,e,n){for(var r,o=n.getZf(),i=e/2,a=t.length,u=[],l=[],c=0;c<a;c++){var f=(r=t[c])[this.colorCol];if(null!=f){var s=this.catToI[f];isNaN(+s)?console.log("Unexpected category index: "+f+" "+s):(u.push(r.x+i,r.y+i),l.push(+s))}else console.log("Unexpected category: "+f)}var h=ta(n.w+"",n.h+"");if(h){var y=this.size?this.size(e,o):e+.2*o;this.wgp.draw(h.gl,u,l,n.getWebGLTransform(),y/o),n.initCanvasTransform(),n.ctx.drawImage(h.canvas,0,0),this.updateLegends({style:this,r:e,zf:o})}else console.error("No webGL")}}])&&Aa(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function Ia(t){return Ia="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},Ia(t)}function La(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 Ba(t,e);var n=Object.prototype.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)?Ba(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ba(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Na(t,e){return Na=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Na(t,e)}function Da(t,e){if(e&&("object"===Ia(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Za(t){return Za=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Za(t)}function Ua(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ia(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ia(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ia(o)?o:String(o)),r)}var o}function Ga(t,e,n){return e&&Wa(t.prototype,e),n&&Wa(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var $a=function(){function t(){Ua(this,t)}return Ga(t,null,[{key:"get",value:function(t,e){(e=e||{}).colors=e.colors||["#00852b","#afd246","#fac80a","#d67923","#bb805a","#cb4e29","#b40000","#720012"],e.colDark=e.colDark||"#333",e.colBright=e.colBright||"#aaa",e.widthFactor=e.widthFactor||.12;var n=ja.get(t,e),r=new Do({strokeColor:function(){return"#666"},strokeWidth:function(t,e,n,r){return.2*r}});return[n[0],r,n[1],new Ya({colDark:e.colDark,colBright:e.colBright})]}},{key:"getCat",value:function(t,e){return(e=e||{}).colDark=e.colDark||"#333",e.colBright=e.colBright||"#aaa",[new Fa({colorCol:t,color:e.color}),new Do({strokeColor:function(){return"#666"},strokeWidth:function(t,e,n,r){return.2*r}}),new Ya({colDark:e.colDark,colBright:e.colBright})]}}]),t}(),Ya=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Na(t,e)}(o,t);var e,n,r=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Za(e);if(n){var o=Za(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return Da(this,t)});function o(t){var e;return Ua(this,o),e=r.call(this,t),t=t||{},e.colDark=t.colDark||"#333",e.colBright=t.colBright||"#aaa",e}return Ga(o,[{key:"draw",value:function(t,e,n){n.ctx.lineWidth=.6*n.getZf(),n.ctx.strokeStyle=this.colDark;var r,o=La(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;n.ctx.beginPath(),n.ctx.arc(i.x+.5*e,i.y+.5*e,.55*e*.5,Math.PI/4,-Math.PI*(3/4),!0),n.ctx.stroke()}}catch(t){o.e(t)}finally{o.f()}n.ctx.strokeStyle=this.colBright;var a,u=La(t);try{for(u.s();!(a=u.n()).done;){var l=a.value;n.ctx.beginPath(),n.ctx.arc(l.x+.5*e,l.y+.5*e,.55*e*.5,Math.PI/4,-Math.PI*(3/4),!1),n.ctx.stroke()}}catch(t){u.e(t)}finally{u.f()}}}]),o}(nr);function Va(t){return Va="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},Va(t)}function Xa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function qa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Va(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Va(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Va(o)?o:String(o)),r)}var o}function Ha(t,e){return Ha=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ha(t,e)}function Ka(t,e){if(e&&("object"===Va(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ja(t){return Ja=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ja(t)}var Qa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ha(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ja(r);if(o){var n=Ja(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ka(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.mosaicFactor=t.mosaicFactor||.15,e.shadowFactor=t.shadowFactor||.2,e.shadowColor=t.shadowColor||"#555",e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r,o=this,i=n.getZf();this.colorCol&&(r=nr.getStatistics(t,(function(t){return t[o.colorCol]}),!0)),n.ctx.strokeStyle=this.shadowColor,n.ctx.lineWidth=this.shadowFactor*e,n.ctx.lineJoin="round",n.ctx.lineCap="butt";var a=e*this.mosaicFactor,u=function(){return{x:Math.random()*a,y:Math.random()*a}};n.setCanvasTransform();var l,c=function(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 Xa(t,e);var n=Object.prototype.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)?Xa(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(l=c.n()).done;){var f=l.value,s=this.color?this.color(f[this.colorCol],e,r):void 0;if(s&&"none"!==s){n.ctx.fillStyle=s;var h=this.offset(f,e,i),y=u(),p=u(),v=u(),d=u();this.shadowFactor>0&&(n.ctx.beginPath(),n.ctx.moveTo(f.x+h.dx+y.x,f.y+h.dy+y.y),n.ctx.lineTo(f.x+h.dx+e-v.x,f.y+h.dy+v.y),n.ctx.lineTo(f.x+h.dx+e-d.x,f.y+h.dy+e-d.y),n.ctx.stroke()),n.ctx.beginPath(),n.ctx.moveTo(f.x+h.dx+y.x,f.y+h.dy+y.y),n.ctx.lineTo(f.x+h.dx+e-v.x,f.y+h.dy+v.y),n.ctx.lineTo(f.x+h.dx+e-d.x,f.y+h.dy+e-d.y),n.ctx.lineTo(f.x+h.dx+p.x,f.y+h.dy+e-p.y),n.ctx.fill()}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:i,sColor:r})}}])&&qa(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function tu(t){return tu="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},tu(t)}function eu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==tu(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==tu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===tu(o)?o:String(o)),r)}var o}var nu=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.id=e.id,this.top=e.top,this.bottom=e.bottom,this.left=e.left,this.right=e.right,this.background=e.background||"none",this.padding=e.padding||"5px",this.border=e.border||"0px",this["border-radius"]=e["border-radius"]||"none",this["box-shadow"]=e["box-shadow"]||"none",this["font-family"]=e["font-family"]||"Helvetica, Arial, sans-serif",this.width=e.width,this.height=e.height,this.id&&(this.div=mt("#"+this.id)),this.div&&!this.div.empty()||(this.div=mt(document.createElement("div")),this.id&&this.div.attr("id",this.id)),this.div.style("background",this.background).style("padding",this.padding).style("border",this.border).style("border-radius",this["border-radius"]).style("box-shadow",this["box-shadow"]).style("font-family",this["font-family"]),this.width&&this.div.style("width",this.width),this.height&&this.div.style("height",this.height)}var e,n;return e=t,(n=[{key:"update",value:function(t){console.error("Legend update not implemented yet.")}}])&&eu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ru(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}var ou,iu=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function au(t){if(!(e=iu.exec(t)))throw new Error("invalid format: "+t);var e;return new uu({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 uu(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 lu(t,e){var n=ru(t,e);if(!n)return t+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}au.prototype=uu.prototype,uu.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 cu={"%":(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)=>lu(100*t,e),r:lu,s:function(t,e){var n=ru(t,e);if(!n)return t+"";var r=n[0],o=n[1],i=o-(ou=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+ru(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function fu(t){return t}var su,hu,yu=Array.prototype.map,pu=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function vu(t){return su=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?fu:(e=yu.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var o=t.length,i=[],a=0,u=e[0],l=0;o>0&&u>0&&(l+u+1>r&&(u=Math.max(1,r-l)),i.push(t.substring(o-=u,o+u)),!((l+=u+1)>r));)u=e[a=(a+1)%e.length];return i.reverse().join(n)}),o=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?fu:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(yu.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",f=void 0===t.nan?"NaN":t.nan+"";function s(t){var e=(t=au(t)).fill,n=t.align,s=t.sign,h=t.symbol,y=t.zero,p=t.width,v=t.comma,d=t.precision,m=t.trim,b=t.type;"n"===b?(v=!0,b="g"):cu[b]||(void 0===d&&(d=12),m=!0,b="g"),(y||"0"===e&&"="===n)&&(y=!0,e="0",n="=");var g="$"===h?o:"#"===h&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",w="$"===h?i:/[%p]/.test(b)?l:"",x=cu[b],S=/[defgprs%]/.test(b);function _(t){var o,i,l,h=g,_=w;if("c"===b)_=x(t)+_,t="";else{var P=(t=+t)<0||1/t<0;if(t=isNaN(t)?f:x(Math.abs(t),d),m&&(t=function(t){t:for(var e,n=t.length,r=1,o=-1;r<n;++r)switch(t[r]){case".":o=e=r;break;case"0":0===o&&(o=r),e=r;break;default:if(!+t[r])break t;o>0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),P&&0==+t&&"+"!==s&&(P=!1),h=(P?"("===s?s:c:"-"===s||"("===s?"":s)+h,_=("s"===b?pu[8+ou/3]:"")+_+(P&&"("===s?")":""),S)for(o=-1,i=t.length;++o<i;)if(48>(l=t.charCodeAt(o))||l>57){_=(46===l?a+t.slice(o+1):t.slice(o))+_,t=t.slice(0,o);break}}v&&!y&&(t=r(t,1/0));var O=h.length+t.length+_.length,j=O<p?new Array(p-O+1).join(e):"";switch(v&&y&&(t=r(j+t,j.length?p-_.length:1/0),j=""),n){case"<":t=h+t+_+j;break;case"=":t=h+j+t+_;break;case"^":t=j.slice(0,O=j.length>>1)+h+t+_+j.slice(O);break;default:t=j+h+t+_}return u(t)}return d=void 0===d?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),_.toString=function(){return t+""},_}return{format:s,formatPrefix:function(t,e){var n,r=s(((t=au(t)).type="f",t)),o=3*Math.max(-8,Math.min(8,Math.floor((n=e,((n=ru(Math.abs(n)))?n[1]:NaN)/3)))),i=Math.pow(10,-o),a=pu[8+o/3];return function(t){return r(i*t)+a}}}}(t),hu=su.format,su.formatPrefix,su}function du(t){return du="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},du(t)}function mu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==du(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==du(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===du(o)?o:String(o)),r)}var o}function bu(t,e){return bu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bu(t,e)}function gu(t,e){if(e&&("object"===du(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function wu(t){return wu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wu(t)}vu({thousands:",",grouping:[3],currency:["$",""]});var xu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bu(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=wu(r);if(o){var n=wu(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return gu(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorRamp=t.colorRamp,e.fun=t.fun,e.title=t.title,e.tickSize=t.tickSize||6,e.width=t.width||300,e.height=t.height||15,e.margin=t.margin||5,e.ticks=t.ticks||Math.floor(e.width/50),e.tickFormat=t.tickFormat||",.0f",e.tickUnit=t.tickUnit,e.fontSize=t.fontSize||"0.8em",e.invert=t.invert,e}return e=a,(n=[{key:"update",value:function(t){if(t.sColor){this.div.selectAll("*").remove();var e=this.width+2*this.margin,n=this.height+3*this.margin+12+this.tickSize+10,r=this.div.append("svg").attr("width",e).attr("height",n);r.append("text").attr("x",this.margin).attr("y",this.margin).style("font-size","0.8em").style("font-weight","bold").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none").text(this.title);for(var o=r.append("g").attr("transform","translate("+this.margin+" "+(2*this.margin+12)+")"),i=this.width,a=this.height,u=0;u<i;u+=5){var l=u/(i-1);this.invert&&(l=1-l),o.append("rect").attr("x",u).attr("y",0).attr("width",5).attr("height",a).style("fill",this.colorRamp(l))}for(var c=0;c<this.ticks;c++){var f=c/(this.ticks-1);o.append("line").attr("x1",i*f).attr("y1",0).attr("x2",i*f).attr("y2",a+this.tickSize).style("stroke","black"),o.append("text").attr("id","ticklabel_"+c).attr("x",i*f).attr("y",a+this.tickSize+2).style("font-size",this.fontSize).style("text-anchor",0==c?"start":c==this.ticks-1?"end":"middle").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none")}for(var s=this.tickFormat&&"text"!=this.tickFormat?hu(this.tickFormat):function(t){return t},h=0;h<this.ticks;h++){var y=h/(this.ticks-1),p=this.fun(y,t.r,t.sColor),v=(p?s(p):"0")+(this.tickUnit?this.tickUnit:"");this.div.select("#ticklabel_"+h).text(v)}}}}])&&mu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nu);function Su(t){return Su="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},Su(t)}function _u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Su(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Su(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Su(o)?o:String(o)),r)}var o}function Pu(t,e){return Pu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pu(t,e)}function Ou(t,e){if(e&&("object"===Su(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ju(t){return ju=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ju(t)}var Cu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pu(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ju(r);if(o){var n=ju(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ou(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colors=t.colors,e.breaksText=t.breaksText,e.width=t.width||300,e.height=t.height||15,e.title=t.title,e.titleFontSize=t.titleFontSize||"0.8em",e.titleFontWeight=t.titleFontWeight||"bold",e.tickSize=t.tickSize||3,e.labelFontSize=t.labelFontSize||"0.8em",e.invert=t.invert,e}return e=a,(n=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.title&&this.div.append("div").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).style("margin-bottom","7px").text(this.title);var e=this.colors.length;if(0!=e){for(var n=this.width/e,r=this.div.append("svg").attr("width",this.width).attr("height",this.height+this.tickSize+2+10),o=0;o<e;o++)r.append("rect").attr("x",o*n).attr("y",0).attr("width",n).attr("height",this.height).style("fill",this.colors[o]);for(var i=1;i<e;i++)r.append("line").attr("x1",n*i).attr("y1",0).attr("x2",n*i).attr("y2",this.height+this.tickSize).style("stroke","black");for(var a=1;a<e;a++)r.append("text").attr("id","ticklabel_"+a).attr("x",n*a).attr("y",this.height+this.tickSize+2).style("font-size",this.labelFontSize).style("text-anchor",0==a?"start":a==this.ticks-1?"end":"middle").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none").text(this.breaksText[a-1])}}}])&&_u(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nu);function ku(t){return ku="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},ku(t)}function Eu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ku(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ku(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ku(o)?o:String(o)),r)}var o}function Tu(t,e){return Tu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tu(t,e)}function Au(t,e){if(e&&("object"===ku(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Mu(t){return Mu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mu(t)}var Ru=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tu(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Mu(r);if(o){var n=Mu(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Au(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colCat=t.colCat||[["gray","-"]],e.shape=t.shape||"circle",e.dimension=t.dimension||{r:8},e.strokeColor=t.strokeColor||"gray",e.strokeWidth=t.strokeWidth||1,e.title=t.title,e.titleFontSize=t.titleFontSize||"0.8em",e.titleFontWeight=t.titleFontWeight||"bold",e.labelFontSize=t.labelFontSize||"0.8em",e}return e=a,(n=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.title&&this.div.append("div").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).style("margin-bottom","7px").text(this.title);var e=this.colCat.length;if(0!=e)for(var n=0;n<e;n++){var r=this.colCat[n],o=this.div.append("div"),i=this.strokeWidth;if("square"===this.shape){var a=this.dimension.h||15,u=this.dimension.w||20;o.append("div").style("display","inline").append("svg").attr("width",u+2*i).attr("height",a+2*i).append("rect").attr("x",i).attr("y",i).attr("width",u).attr("height",a).style("fill",r[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}else{if("circle"!==this.shape)throw new Error("Unexpected shape:"+this.shape);var l=this.dimension.r||8,c=2*l+2*i;o.append("div").style("display","inline").append("svg").attr("width",c).attr("height",c).append("circle").attr("cx",l+i).attr("cy",l+i).attr("r",l).style("fill",r[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}o.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(r[1])}}}])&&Eu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nu);function zu(t){return zu="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},zu(t)}function Fu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==zu(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==zu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===zu(o)?o:String(o)),r)}var o}function Iu(t,e){return Iu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Iu(t,e)}function Lu(t,e){if(e&&("object"===zu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Bu(t){return Bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bu(t)}var Nu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Iu(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Bu(r);if(o){var n=Bu(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Lu(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.exaggerationFactor=t.exaggerationFactor||.8,e.value=t.value||void 0,e.shape=t.shape||"circle",e.fillColor=t.fillColor||"none",e.strokeColor=t.strokeColor||"gray",e.strokeWidth=t.strokeWidth||1,e.labelFontSize=t.labelFontSize||"0.8em",e.labelUnitText=t.labelUnitText||"",e.labelFormat=t.labelFormat||",.2r",e}return e=a,(n=[{key:"update",value:function(t){if(t.sSize){this.div.selectAll("*").remove();var e=this.value;if(null==e){var n=t.sSize.max*this.exaggerationFactor,r=Math.log10(n);r=Math.floor(r),8*(e=Math.pow(10,r))<=n?e*=8:6*e<=n?e*=6:5*e<=n?e*=5:4*e<=n?e*=4:2.5*e<=n?e*=2.5:2*e<=n&&(e*=2)}var o=this.div.append("div"),i=t.style.size(e,t.r,t.sSize,t.zf)/t.zf,a=o.append("svg").attr("width",i+this.strokeWidth+2).attr("height",i+this.strokeWidth+2).style("","inline-block");if("square"===this.shape)a.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",i).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth);else if("circle"===this.shape){var u=.5*(i+this.strokeWidth);a.append("circle").attr("cx",u+1).attr("cy",u+1).attr("r",u).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}else if("donut"===this.shape);else if("diamond"!==this.shape)throw new Error("Unexpected shape:"+this.shape);var l=hu(this.labelFormat)(e);o.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(l+(this.labelUnitText?" ":"")+this.labelUnitText)}}}])&&Fu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nu);function Du(t){return Du="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},Du(t)}function Zu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Du(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Du(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Du(o)?o:String(o)),r)}var o}function Uu(t,e){return Uu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Uu(t,e)}function Wu(t,e){if(e&&("object"===Du(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Gu(t){return Gu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gu(t)}var $u=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Uu(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Gu(r);if(o){var n=Gu(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Wu(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.exaggerationFactor=t.exaggerationFactor||.5,e.color=t.color||"gray",e.orientation=t.orientation||0,e.labelFontSize=t.labelFontSize||"0.8em",e.labelUnitText=t.labelUnitText||"",e.div.style("text-align","center"),e}return e=a,(n=[{key:"update",value:function(t){if(t.sWidth){this.div.selectAll("*").remove();var e=t.sWidth.max*this.exaggerationFactor,n=Math.log10(e);n=Math.floor(n);var r=Math.pow(10,n);8*r<=e?r*=8:6*r<=e?r*=6:5*r<=e?r*=5:4*r<=e?r*=4:2.5*r<=e?r*=2.5:2*r<=e&&(r*=2);var o=t.style.width(r,t.r,t.sWidth,t.zf)/t.zf,i=1*t.r/t.zf;this.div.append("svg").attr("width",i).attr("height",o).style("","inline-block").append("line").attr("x1",0).attr("y1",o/2).attr("x2",i).attr("y2",o/2).style("stroke",this.color).style("stroke-width",o);var a=hu(",.2r")(r);this.div.append("div").style("font-size",this.labelFontSize).style("","inline-block").text(a+(this.labelUnitText?" ":"")+this.labelUnitText)}}}])&&Zu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nu);function Yu(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1.01,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;(n=n||1.01)<1&&console.error("Unexpected value for factor: "+n+". Set to default value 1.01");var a=t.getZoomFactor();if(e!=a){e<a&&(n=1/n);var u=a,l=setInterval((function(){u=t.getZoomFactor()*n,e>a&&u>e&&(u=e),e<a&&u<e&&(u=e),t.setZoomFactor(u),t.cg.redraw(),u==e&&(clearInterval(l),o&&setTimeout((function(){o()}),i))}),r);return l}}function Vu(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:NaN,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:5,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6?arguments[6]:void 0,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=t.getZoomFactor(),c=t.getGeoCenter();e=isNaN(e)?c.x:e,n=isNaN(n)?c.y:n,r=isNaN(r)?l:r;var f=e-c.x,s=n-c.y,h=Math.hypot(f,s),y=o*l*f/h,p=o*l*s/h,v=r/l,d=h/(o*l),m=h>0?Math.pow(v,1/d):Math.pow(v,.1),b=setInterval((function(){if(h>0){var o=t.getGeoCenter(),i=o.x+y,l=o.y+p;i<e&&e<o.x&&(i=e),o.x<e&&e<i&&(i=e),l<n&&n<o.y&&(l=n),o.y<n&&n<l&&(l=n),t.setGeoCenter({x:i,y:l}),i==e&&l==n&&(h=0)}if(1!=v){var c=t.getZoomFactor(),f=m*c;f<r&&r<c&&(f=r),c<r&&r<f&&(f=r),t.setZoomFactor(f),f==r&&(v=1)}t.cg.redraw(),0==h&&1==v&&(console.log("OK !"),clearInterval(b),a&&setTimeout((function(){a()}),u))}),i);return b}var Xu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,e)},qu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,1/e)},Hu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:(Math.exp(t*e)-1)/(Math.exp(e)-1)},Ku=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:1-1/e*Math.log(Math.exp(e)*(1-t)+t)},Ju=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.8;if(0==e)return t;if(1==e)return Math.sqrt(t*(2-t));var n=e/(1-e);return Math.sqrt(1/(n*n)+t*(2/n+2-t))-1/n},Qu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.8;return 1-Ju(1-t,e)},tl=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:1/e*Math.log(1-t+t*Math.exp(e))},el=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return(Math.exp(-e*t)-1)/(Math.exp(-e)-1)},nl=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,1/e)},rl=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,e)},ol=1e-6,il=Math.PI,al=il/2,ul=il/4,ll=2*il,cl=180/il,fl=il/180,sl=Math.abs,hl=Math.atan,yl=Math.atan2,pl=Math.cos,vl=(Math.ceil,Math.exp,Math.floor,Math.hypot,Math.log,Math.pow,Math.sin),dl=Math.sign||function(t){return t>0?1:t<0?-1:0},ml=Math.sqrt;function bl(t){return t>1?al:t<-1?-al:Math.asin(t)}function gl(){}function wl(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:gl,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function xl(t,e){return sl(t[0]-e[0])<ol&&sl(t[1]-e[1])<ol}function Sl(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function _l(t,e,n,r,o){var i,a,u=[],l=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(xl(r,a)){if(!r[2]&&!a[2]){for(o.lineStart(),i=0;i<e;++i)o.point((r=t[i])[0],r[1]);return void o.lineEnd()}a[0]+=2e-6}u.push(n=new Sl(r,t,null,!0)),l.push(n.o=new Sl(r,null,n,!1)),u.push(n=new Sl(a,t,null,!1)),l.push(n.o=new Sl(a,null,n,!0))}})),u.length){for(l.sort(e),Pl(u),Pl(l),i=0,a=l.length;i<a;++i)l[i].e=n=!n;for(var c,f,s=u[0];;){for(var h=s,y=!0;h.v;)if((h=h.n)===s)return;c=h.z,o.lineStart();do{if(h.v=h.o.v=!0,h.e){if(y)for(i=0,a=c.length;i<a;++i)o.point((f=c[i])[0],f[1]);else r(h.x,h.n.x,1,o);h=h.n}else{if(y)for(c=h.p.z,i=c.length-1;i>=0;--i)o.point((f=c[i])[0],f[1]);else r(h.x,h.p.x,-1,o);h=h.p}c=(h=h.o).z,y=!y}while(!h.v);o.lineEnd()}}}function Pl(t){if(e=t.length){for(var e,n,r=0,o=t[0];++r<e;)o.n=n=t[r],n.p=o,o=n;o.n=n=t[0],n.p=o}}Math.tan;class Ol{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const o=e[r],i=t+o,a=Math.abs(t)<Math.abs(o)?t-(i-o):o-(i-t);a&&(e[n++]=a),t=i}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,o=this._n,i=0;if(o>0){for(i=t[--o];o>0&&(e=i,n=t[--o],i=e+n,r=n-(i-e),!r););o>0&&(r<0&&t[o-1]<0||r>0&&t[o-1]>0)&&(n=2*r,e=i+n,n==e-i&&(i=e))}return i}}function jl(t){return[yl(t[1],t[0]),bl(t[2])]}function Cl(t){var e=t[0],n=t[1],r=pl(n);return[r*pl(e),r*vl(e),vl(n)]}function kl(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function El(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 Tl(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Al(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Ml(t){var e=ml(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Rl(t){return sl(t[0])<=il?t[0]:dl(t[0])*((sl(t[0])+il)%ll-il)}function zl(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function Fl(t,e,n,r){return function(o){var i,a,u,l=e(o),c=wl(),f=e(c),s=!1,h={point:y,lineStart:v,lineEnd:d,polygonStart:function(){h.point=m,h.lineStart=b,h.lineEnd=g,a=[],i=[]},polygonEnd:function(){h.point=y,h.lineStart=v,h.lineEnd=d,a=zl(a);var t=function(t,e){var n=Rl(e),r=e[1],o=vl(r),i=[vl(n),-pl(n),0],a=0,u=0,l=new Ol;1===o?r=al+ol:-1===o&&(r=-al-ol);for(var c=0,f=t.length;c<f;++c)if(h=(s=t[c]).length)for(var s,h,y=s[h-1],p=Rl(y),v=y[1]/2+ul,d=vl(v),m=pl(v),b=0;b<h;++b,p=w,d=S,m=_,y=g){var g=s[b],w=Rl(g),x=g[1]/2+ul,S=vl(x),_=pl(x),P=w-p,O=P>=0?1:-1,j=O*P,C=j>il,k=d*S;if(l.add(yl(k*O*vl(j),m*_+k*pl(j))),a+=C?P+O*ll:P,C^p>=n^w>=n){var E=El(Cl(y),Cl(g));Ml(E);var T=El(i,E);Ml(T);var A=(C^P>=0?-1:1)*bl(T[2]);(r>A||r===A&&(E[0]||E[1]))&&(u+=C^P>=0?1:-1)}}return(a<-ol||a<ol&&l<-1e-12)^1&u}(i,r);a.length?(s||(o.polygonStart(),s=!0),_l(a,Ll,t,n,o)):t&&(s||(o.polygonStart(),s=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),s&&(o.polygonEnd(),s=!1),a=i=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function y(e,n){t(e,n)&&o.point(e,n)}function p(t,e){l.point(t,e)}function v(){h.point=p,l.lineStart()}function d(){h.point=y,l.lineEnd()}function m(t,e){u.push([t,e]),f.point(t,e)}function b(){f.lineStart(),u=[]}function g(){m(u[0][0],u[0][1]),f.lineEnd();var t,e,n,r,l=f.clean(),h=c.result(),y=h.length;if(u.pop(),i.push(u),u=null,y)if(1&l){if((e=(n=h[0]).length-1)>0){for(s||(o.polygonStart(),s=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}}else y>1&&2&l&&h.push(h.pop().concat(h.shift())),a.push(h.filter(Il))}return h}}function Il(t){return t.length>1}function Ll(t,e){return((t=t.x)[0]<0?t[1]-al-ol:al-t[1])-((e=e.x)[0]<0?e[1]-al-ol:al-e[1])}const Bl=Fl((function(){return!0}),(function(t){var e,n=NaN,r=NaN,o=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,a){var u=i>0?il:-il,l=sl(i-n);sl(l-il)<ol?(t.point(n,r=(r+a)/2>0?al:-al),t.point(o,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(i,r),e=0):o!==u&&l>=il&&(sl(n-o)<ol&&(n-=o*ol),sl(i-u)<ol&&(i-=u*ol),r=function(t,e,n,r){var o,i,a=vl(t-n);return sl(a)>ol?hl((vl(e)*(i=pl(r))*vl(n)-vl(r)*(o=pl(e))*vl(t))/(o*i*a)):(e+r)/2}(n,r,i,a),t.point(o,r),t.lineEnd(),t.lineStart(),t.point(u,r),e=0),t.point(n=i,r=a),o=u},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var o;if(null==t)o=n*al,r.point(-il,o),r.point(0,o),r.point(il,o),r.point(il,0),r.point(il,-o),r.point(0,-o),r.point(-il,-o),r.point(-il,0),r.point(-il,o);else if(sl(t[0]-e[0])>ol){var i=t[0]<e[0]?il:-il;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(e[0],e[1])}),[-il,-al]);function Nl(t,e){(e=Cl(e))[0]-=t,Ml(e);var n,r=(n=-e[1])>1?0:n<-1?il:Math.acos(n);return((-e[2]<0?-r:r)+ll-ol)%ll}function Dl(t){var e=pl(t),n=6*fl,r=e>0,o=sl(e)>ol;function i(t,n){return pl(t)*pl(n)>e}function a(t,n,r){var o=[1,0,0],i=El(Cl(t),Cl(n)),a=kl(i,i),u=i[0],l=a-u*u;if(!l)return!r&&t;var c=e*a/l,f=-e*u/l,s=El(o,i),h=Al(o,c);Tl(h,Al(i,f));var y=s,p=kl(h,y),v=kl(y,y),d=p*p-v*(kl(h,h)-1);if(!(d<0)){var m=ml(d),b=Al(y,(-p-m)/v);if(Tl(b,h),b=jl(b),!r)return b;var g,w=t[0],x=n[0],S=t[1],_=n[1];x<w&&(g=w,w=x,x=g);var P=x-w,O=sl(P-il)<ol;if(!O&&_<S&&(g=S,S=_,_=g),O||P<ol?O?S+_>0^b[1]<(sl(b[0]-w)<ol?S:_):S<=b[1]&&b[1]<=_:P>il^(w<=b[0]&&b[0]<=x)){var j=Al(y,(-p+m)/v);return Tl(j,h),[b,jl(j)]}}}function u(e,n){var o=r?t:il-t,i=0;return e<-o?i|=1:e>o&&(i|=2),n<-o?i|=4:n>o&&(i|=8),i}return Fl(i,(function(t){var e,n,l,c,f;return{lineStart:function(){c=l=!1,f=1},point:function(s,h){var y,p=[s,h],v=i(s,h),d=r?v?0:u(s,h):v?u(s+(s<0?il:-il),h):0;if(!e&&(c=l=v)&&t.lineStart(),v!==l&&(!(y=a(e,p))||xl(e,y)||xl(p,y))&&(p[2]=1),v!==l)f=0,v?(t.lineStart(),y=a(p,e),t.point(y[0],y[1])):(y=a(e,p),t.point(y[0],y[1],2),t.lineEnd()),e=y;else if(o&&e&&r^v){var m;d&n||!(m=a(p,e,!0))||(f=0,r?(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)))}!v||e&&xl(e,p)||t.point(p[0],p[1]),e=p,l=v,n=d},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return f|(c&&l)<<1}}}),(function(e,r,o,i){!function(t,e,n,r,o,i){if(n){var a=pl(e),u=vl(e),l=r*n;null==o?(o=e+r*ll,i=e-l/2):(o=Nl(a,o),i=Nl(a,i),(r>0?o<i:o>i)&&(o+=r*ll));for(var c,f=o;r>0?f>i:f<i;f-=l)c=jl([a,-u*pl(f),-u*vl(f)]),t.point(c[0],c[1])}}(i,t,n,o,e,r)}),r?[0,-t]:[-il,t-il])}var Zl=1e9,Ul=-Zl;function Wl(t,e,n,r){function o(o,i){return t<=o&&o<=n&&e<=i&&i<=r}function i(o,i,u,c){var f=0,s=0;if(null==o||(f=a(o,u))!==(s=a(i,u))||l(o,i)<0^u>0)do{c.point(0===f||3===f?t:n,f>1?r:e)}while((f=(f+u+4)%4)!==s);else c.point(i[0],i[1])}function a(r,o){return sl(r[0]-t)<ol?o>0?0:3:sl(r[0]-n)<ol?o>0?2:1:sl(r[1]-e)<ol?o>0?1:0:o>0?3:2}function u(t,e){return l(t.x,e.x)}function l(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var l,c,f,s,h,y,p,v,d,m,b,g=a,w=wl(),x={point:S,lineStart:function(){x.point=_,c&&c.push(f=[]),m=!0,d=!1,p=v=NaN},lineEnd:function(){l&&(_(s,h),y&&d&&w.rejoin(),l.push(w.result())),x.point=S,d&&g.lineEnd()},polygonStart:function(){g=w,l=[],c=[],b=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,o=c.length;n<o;++n)for(var i,a,u=c[n],l=1,f=u.length,s=u[0],h=s[0],y=s[1];l<f;++l)i=h,a=y,h=(s=u[l])[0],y=s[1],a<=r?y>r&&(h-i)*(r-a)>(y-a)*(t-i)&&++e:y<=r&&(h-i)*(r-a)<(y-a)*(t-i)&&--e;return e}(),n=b&&e,o=(l=zl(l)).length;(n||o)&&(a.polygonStart(),n&&(a.lineStart(),i(null,null,1,a),a.lineEnd()),o&&_l(l,u,e,i,a),a.polygonEnd()),g=a,l=c=f=null}};function S(t,e){o(t,e)&&g.point(t,e)}function _(i,a){var u=o(i,a);if(c&&f.push([i,a]),m)s=i,h=a,y=u,m=!1,u&&(g.lineStart(),g.point(i,a));else if(u&&d)g.point(i,a);else{var l=[p=Math.max(Ul,Math.min(Zl,p)),v=Math.max(Ul,Math.min(Zl,v))],w=[i=Math.max(Ul,Math.min(Zl,i)),a=Math.max(Ul,Math.min(Zl,a))];!function(t,e,n,r,o,i){var a,u=t[0],l=t[1],c=0,f=1,s=e[0]-u,h=e[1]-l;if(a=n-u,s||!(a>0)){if(a/=s,s<0){if(a<c)return;a<f&&(f=a)}else if(s>0){if(a>f)return;a>c&&(c=a)}if(a=o-u,s||!(a<0)){if(a/=s,s<0){if(a>f)return;a>c&&(c=a)}else if(s>0){if(a<c)return;a<f&&(f=a)}if(a=r-l,h||!(a>0)){if(a/=h,h<0){if(a<c)return;a<f&&(f=a)}else if(h>0){if(a>f)return;a>c&&(c=a)}if(a=i-l,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>c&&(c=a)}else if(h>0){if(a<c)return;a<f&&(f=a)}return c>0&&(t[0]=u+c*s,t[1]=l+c*h),f<1&&(e[0]=u+f*s,e[1]=l+f*h),!0}}}}}(l,w,t,e,n,r)?u&&(g.lineStart(),g.point(i,a),b=!1):(d||(g.lineStart(),g.point(l[0],l[1])),g.point(w[0],w[1]),u||g.lineEnd(),b=!1)}p=i,v=a,d=u}return x}}function Gl(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}const $l=t=>t;function Yl(t,e){return[sl(t)>il?t+Math.round(-t/ll)*ll:t,e]}function Vl(t){return function(e,n){return[(e+=t)>il?e-ll:e<-il?e+ll:e,n]}}function Xl(t){var e=Vl(t);return e.invert=Vl(-t),e}function ql(t,e){var n=pl(t),r=vl(t),o=pl(e),i=vl(e);function a(t,e){var a=pl(e),u=pl(t)*a,l=vl(t)*a,c=vl(e),f=c*n+u*r;return[yl(l*o-f*i,u*n-c*r),bl(f*o+l*i)]}return a.invert=function(t,e){var a=pl(e),u=pl(t)*a,l=vl(t)*a,c=vl(e),f=c*o-l*i;return[yl(l*o+c*i,u*n+f*r),bl(f*n-u*r)]},a}function Hl(t){return function(e){var n=new Kl;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Kl(){}function Jl(t,e){t&&tc.hasOwnProperty(t.type)&&tc[t.type](t,e)}Yl.invert=Yl,Kl.prototype={constructor:Kl,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 Ql={Feature:function(t,e){Jl(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,o=n.length;++r<o;)Jl(n[r].geometry,e)}},tc={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,r=-1,o=n.length;++r<o;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){ec(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)ec(n[r],e,0)},Polygon:function(t,e){nc(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)nc(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,o=n.length;++r<o;)Jl(n[r],e)}};function ec(t,e,n){var r,o=-1,i=t.length-n;for(e.lineStart();++o<i;)r=t[o],e.point(r[0],r[1],r[2]);e.lineEnd()}function nc(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)ec(t[n],e,1);e.polygonEnd()}var rc=1/0,oc=rc,ic=-rc,ac=ic,uc={point:function(t,e){t<rc&&(rc=t),t>ic&&(ic=t),e<oc&&(oc=e),e>ac&&(ac=e)},lineStart:gl,lineEnd:gl,polygonStart:gl,polygonEnd:gl,result:function(){var t=[[rc,oc],[ic,ac]];return ic=ac=-(oc=rc=1/0),t}};const lc=uc;function cc(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),function(t,e){t&&Ql.hasOwnProperty(t.type)?Ql[t.type](t,e):Jl(t,e)}(n,t.stream(lc)),e(lc.result()),null!=r&&t.clipExtent(r),t}function fc(t,e,n){return cc(t,(function(n){var r=e[1][0]-e[0][0],o=e[1][1]-e[0][1],i=Math.min(r/(n[1][0]-n[0][0]),o/(n[1][1]-n[0][1])),a=+e[0][0]+(r-i*(n[1][0]+n[0][0]))/2,u=+e[0][1]+(o-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([a,u])}),n)}var sc=pl(30*fl);function hc(t,e){return+e?function(t,e){function n(r,o,i,a,u,l,c,f,s,h,y,p,v,d){var m=c-r,b=f-o,g=m*m+b*b;if(g>4*e&&v--){var w=a+h,x=u+y,S=l+p,_=ml(w*w+x*x+S*S),P=bl(S/=_),O=sl(sl(S)-1)<ol||sl(i-s)<ol?(i+s)/2:yl(x,w),j=t(O,P),C=j[0],k=j[1],E=C-r,T=k-o,A=b*E-m*T;(A*A/g>e||sl((m*E+b*T)/g-.5)>.3||a*h+u*y+l*p<sc)&&(n(r,o,i,a,u,l,C,k,O,w/=_,x/=_,S,v,d),d.point(C,k),n(C,k,O,w,x,S,c,f,s,h,y,p,v,d))}}return function(e){var r,o,i,a,u,l,c,f,s,h,y,p,v={point:d,lineStart:m,lineEnd:g,polygonStart:function(){e.polygonStart(),v.lineStart=w},polygonEnd:function(){e.polygonEnd(),v.lineStart=m}};function d(n,r){n=t(n,r),e.point(n[0],n[1])}function m(){f=NaN,v.point=b,e.lineStart()}function b(r,o){var i=Cl([r,o]),a=t(r,o);n(f,s,c,h,y,p,f=a[0],s=a[1],c=r,h=i[0],y=i[1],p=i[2],16,e),e.point(f,s)}function g(){v.point=d,e.lineEnd()}function w(){m(),v.point=x,v.lineEnd=S}function x(t,e){b(r=t,e),o=f,i=s,a=h,u=y,l=p,v.point=b}function S(){n(f,s,c,h,y,p,o,i,r,a,u,l,16,e),v.lineEnd=g,g()}return v}}(t,e):function(t){return Hl({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var yc=Hl({point:function(t,e){this.stream.point(t*fl,e*fl)}});function pc(t,e,n,r,o,i){if(!i)return function(t,e,n,r,o){function i(i,a){return[e+t*(i*=r),n-t*(a*=o)]}return i.invert=function(i,a){return[(i-e)/t*r,(n-a)/t*o]},i}(t,e,n,r,o);var a=pl(i),u=vl(i),l=a*t,c=u*t,f=a/t,s=u/t,h=(u*n-a*e)/t,y=(u*e+a*n)/t;function p(t,i){return[l*(t*=r)-c*(i*=o)+e,n-c*t-l*i]}return p.invert=function(t,e){return[r*(f*t-s*e+h),o*(y-s*t-f*e)]},p}function vc(t){return function(t){var e,n,r,o,i,a,u,l,c,f,s=150,h=480,y=250,p=0,v=0,d=0,m=0,b=0,g=0,w=1,x=1,S=null,_=Bl,P=null,O=$l,j=.5;function C(t){return l(t[0]*fl,t[1]*fl)}function k(t){return(t=l.invert(t[0],t[1]))&&[t[0]*cl,t[1]*cl]}function E(){var t=pc(s,0,0,w,x,g).apply(null,e(p,v)),r=pc(s,h-t[0],y-t[1],w,x,g);return n=function(t,e,n){return(t%=ll)?e||n?Gl(Xl(t),ql(e,n)):Xl(t):e||n?ql(e,n):Yl}(d,m,b),u=Gl(e,r),l=Gl(n,u),a=hc(u,j),T()}function T(){return c=f=null,C}return C.stream=function(t){return c&&f===t?c:c=yc(function(t){return Hl({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(_(a(O(f=t)))))},C.preclip=function(t){return arguments.length?(_=t,S=void 0,T()):_},C.postclip=function(t){return arguments.length?(O=t,P=r=o=i=null,T()):O},C.clipAngle=function(t){return arguments.length?(_=+t?Dl(S=t*fl):(S=null,Bl),T()):S*cl},C.clipExtent=function(t){return arguments.length?(O=null==t?(P=r=o=i=null,$l):Wl(P=+t[0][0],r=+t[0][1],o=+t[1][0],i=+t[1][1]),T()):null==P?null:[[P,r],[o,i]]},C.scale=function(t){return arguments.length?(s=+t,E()):s},C.translate=function(t){return arguments.length?(h=+t[0],y=+t[1],E()):[h,y]},C.center=function(t){return arguments.length?(p=t[0]%360*fl,v=t[1]%360*fl,E()):[p*cl,v*cl]},C.rotate=function(t){return arguments.length?(d=t[0]%360*fl,m=t[1]%360*fl,b=t.length>2?t[2]%360*fl:0,E()):[d*cl,m*cl,b*cl]},C.angle=function(t){return arguments.length?(g=t%360*fl,E()):g*cl},C.reflectX=function(t){return arguments.length?(w=t?-1:1,E()):w<0},C.reflectY=function(t){return arguments.length?(x=t?-1:1,E()):x<0},C.precision=function(t){return arguments.length?(a=hc(u,j=t*t),T()):ml(j)},C.fitExtent=function(t,e){return fc(C,t,e)},C.fitSize=function(t,e){return function(t,e,n){return fc(t,[[0,0],e],n)}(C,t,e)},C.fitWidth=function(t,e){return function(t,e,n){return cc(t,(function(n){var r=+e,o=r/(n[1][0]-n[0][0]),i=(r-o*(n[1][0]+n[0][0]))/2,a=-o*n[0][1];t.scale(150*o).translate([i,a])}),n)}(C,t,e)},C.fitHeight=function(t,e){return function(t,e,n){return cc(t,(function(n){var r=+e,o=r/(n[1][1]-n[0][1]),i=-o*n[0][0],a=(r-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([i,a])}),n)}(C,t,e)},function(){return e=t.apply(this,arguments),C.invert=e.invert&&k,E()}}((function(){return t}))()}var dc,mc,bc=(dc=function(t){return ml(2/(1+t))},function(t,e){var n=pl(t),r=pl(e),o=dc(n*r);return o===1/0?[2,0]:[o*r*vl(t),o*vl(e)]});function gc(){return vc(bc).scale(124.75).clipAngle(179.999)}bc.invert=(mc=function(t){return 2*bl(t/2)},function(t,e){var n=ml(t*t+e*e),r=mc(n),o=vl(r),i=pl(r);return[yl(t*o,n*i),bl(n&&e*o/n)]});var wc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"EUR",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,n=arguments.length>2?arguments[2]:void 0,r=(n=n||{}).ex||1.2,o=n.fontFamily||"Arial",i=n.exSize||1;return n.style=n.style||function(t,e){if(!(t.rs<r*e))return t.r1<r*e?i+"em "+o:1.5*i+"em "+o},n.proj=n.proj||gc().rotate([-10,-52]).reflectX(!1).reflectY(!0).scale(6378137).translate([4321e3,321e4]),n.preprocess=function(t){if(n.ccIn&&t.cc&&!(n.ccIn.indexOf(t.cc)>=0))return!1;var e=n.proj([t.lon,t.lat]);t.x=e[0],t.y=e[1],delete t.lon,delete t.lat},n.baseURL=n.baseURL||"https://raw.githubusercontent.com/eurostat/euronym/main/pub/v2/UTF/",n.url=n.baseURL+e+"/"+t+".csv",n},xc=function(t){var e=(t=t||{}).nutsYear||"2021",n=t.crs||"3035",r=t.scale||"03M",o=t.nutsLevel||"3",i=t.col||"#888";return t.color=t.color||function(t,e){var n=t.properties;return"T"===n.co||e<400?i:e<1e3?n.lvl>=3?"":i:e<2e3?n.lvl>=2?"":i:n.lvl>=1?"":i},t.width=t.width||function(t,e){var n=t.properties;return"T"===n.co?.5:e<400?3==n.lvl||2==n.lvl||1==n.lvl?2.2:4:e<1e3?2==n.lvl||1==n.lvl?1.8:2.5:e<2e3?1==n.lvl?1.8:2.5:1.2},t.lineDash=t.lineDash||function(t,e){var n=t.properties;return"T"===n.co?[]:e<400?3==n.lvl?[2*e,2*e]:2==n.lvl||1==n.lvl?[5*e,2*e]:[10*e,3*e]:e<1e3?2==n.lvl||1==n.lvl?[5*e,2*e]:[10*e,3*e]:e<2e3&&1==n.lvl?[5*e,2*e]:[10*e,3*e]},t.baseURL=t.baseURL||"https://raw.githubusercontent.com/eurostat/Nuts2json/master/pub/v2/",t.url=t.baseURL+e+"/"+n+"/"+r+"/nutsbn_"+o+".json",t},Sc=Kn.getParameterByName;return vu({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),e})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.gviz=e():t.gviz=e()}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(){}function r(t){return null==t?n:function(){return this.querySelector(t)}}function o(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function i(){return[]}function a(t){return null==t?i:function(){return this.querySelectorAll(t)}}function u(t){return function(){return this.matches(t)}}function l(t){return function(e){return e.matches(t)}}t.r(e),t.d(e,{App:()=>jo,BackgroundLayer:()=>fo,BoundaryLayer:()=>xo,CSVGrid:()=>Gr,ColorCategoryLegend:()=>Ru,ColorDiscreteLegend:()=>Cu,ColorLegend:()=>xu,CompositionStyle:()=>ni,ContourStyle:()=>$i,Dataset:()=>hr,DatasetComponent:()=>Fr,DotDensityStyle:()=>ya,JoyPlotStyle:()=>Vo,KernelSmoothingStyle:()=>Pi,LabelLayer:()=>vo,Layer:()=>ar,LegoStyle:()=>$a,MosaicStyle:()=>Qa,PillarStyle:()=>Mi,SegmentStyle:()=>ci,SegmentWidthLegend:()=>$u,ShapeColorSizeStyle:()=>Ro,SideCatStyle:()=>Ji,SideStyle:()=>Di,SizeLegend:()=>Nu,SquareColorCatWGLStyle:()=>Fa,SquareColorWGLStyle:()=>_a,StrokeStyle:()=>Do,TanakaStyle:()=>ja,TextStyle:()=>di,TiledGrid:()=>uo,getClass:()=>Jr,getEuronymeLabelLayer:()=>wc,getEurostatBoundariesLayer:()=>xc,getParameterByName:()=>Sc,goToStraight:()=>Vu,sCircleHigh:()=>Qu,sCircleLow:()=>Ju,sExp:()=>Hu,sExpInverse:()=>tl,sExpRev:()=>Ku,sExpRevInverse:()=>el,sPow:()=>Xu,sPowInverse:()=>nl,sPowRev:()=>qu,sPowRevInverse:()=>rl,zoomTo:()=>Yu});var c=Array.prototype.find;function f(){return this.firstElementChild}var s=Array.prototype.filter;function h(){return Array.from(this.children)}function y(t){return new Array(t.length)}function p(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function v(t){return function(){return t}}function d(t,e,n,r,o,i){for(var a,u=0,l=e.length,c=i.length;u<c;++u)(a=e[u])?(a.__data__=i[u],r[u]=a):n[u]=new p(t,i[u]);for(;u<l;++u)(a=e[u])&&(o[u]=a)}function m(t,e,n,r,o,i,a){var u,l,c,f=new Map,s=e.length,h=i.length,y=new Array(s);for(u=0;u<s;++u)(l=e[u])&&(y[u]=c=a.call(l,l.__data__,u,e)+"",f.has(c)?o[u]=l:f.set(c,l));for(u=0;u<h;++u)c=a.call(t,i[u],u,i)+"",(l=f.get(c))?(r[u]=l,l.__data__=i[u],f.delete(c)):n[u]=new p(t,i[u]);for(u=0;u<s;++u)(l=e[u])&&f.get(y[u])===l&&(o[u]=l)}function b(t){return t.__data__}function g(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function w(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}p.prototype={constructor:p,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 x="http://www.w3.org/1999/xhtml";const S={svg:"http://www.w3.org/2000/svg",xhtml:x,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),S.hasOwnProperty(e)?{space:S[e],local:t}:t}function P(t){return function(){this.removeAttribute(t)}}function O(t){return function(){this.removeAttributeNS(t.space,t.local)}}function j(t,e){return function(){this.setAttribute(t,e)}}function C(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function k(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function E(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(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function A(t){return function(){this.style.removeProperty(t)}}function M(t,e,n){return function(){this.style.setProperty(t,e,n)}}function R(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function z(t,e){return t.style.getPropertyValue(e)||T(t).getComputedStyle(t,null).getPropertyValue(e)}function F(t){return function(){delete this[t]}}function I(t,e){return function(){this[t]=e}}function L(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function B(t){return t.trim().split(/^|\s+/)}function N(t){return t.classList||new D(t)}function D(t){this._node=t,this._names=B(t.getAttribute("class")||"")}function Z(t,e){for(var n=N(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function U(t,e){for(var n=N(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function W(t){return function(){Z(this,t)}}function G(t){return function(){U(this,t)}}function $(t,e){return function(){(e.apply(this,arguments)?Z:U)(this,t)}}function Y(){this.textContent=""}function V(t){return function(){this.textContent=t}}function X(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function q(){this.innerHTML=""}function H(t){return function(){this.innerHTML=t}}function K(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function J(){this.nextSibling&&this.parentNode.appendChild(this)}function Q(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function tt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===x&&e.documentElement.namespaceURI===x?e.createElement(t):e.createElementNS(n,t)}}function et(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function nt(t){var e=_(t);return(e.local?et:tt)(e)}function rt(){return null}function ot(){var t=this.parentNode;t&&t.removeChild(this)}function it(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function at(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ut(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}}))}function lt(t){return function(){var e=this.__on;if(e){for(var n,r=0,o=-1,i=e.length;r<i;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?e.length=o:delete this.__on}}}function ct(t,e,n){return function(){var r,o=this.__on,i=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(o)for(var a=0,u=o.length;a<u;++a)if((r=o[a]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),void(r.value=e);this.addEventListener(t.type,i,n),r={type:t.type,name:t.name,value:e,listener:i,options:n},o?o.push(r):this.__on=[r]}}function ft(t,e,n){var r=T(t),o=r.CustomEvent;"function"==typeof o?o=new o(e,n):(o=r.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function st(t,e){return function(){return ft(this,t,e)}}function ht(t,e){return function(){return ft(this,t,e.apply(this,arguments))}}D.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 yt=[null];function pt(t,e){this._groups=t,this._parents=e}function vt(){return new pt([[document.documentElement]],yt)}pt.prototype=vt.prototype={constructor:pt,select:function(t){"function"!=typeof t&&(t=r(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var a,u,l=e[i],c=l.length,f=o[i]=new Array(c),s=0;s<c;++s)(a=l[s])&&(u=t.call(a,a.__data__,s,l))&&("__data__"in a&&(u.__data__=a.__data__),f[s]=u);return new pt(o,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return o(t.apply(this,arguments))}}(t):a(t);for(var e=this._groups,n=e.length,r=[],i=[],u=0;u<n;++u)for(var l,c=e[u],f=c.length,s=0;s<f;++s)(l=c[s])&&(r.push(t.call(l,l.__data__,s,c)),i.push(l));return new pt(r,i)},selectChild:function(t){return this.select(null==t?f:function(t){return function(){return c.call(this.children,t)}}("function"==typeof t?t:l(t)))},selectChildren:function(t){return this.selectAll(null==t?h:function(t){return function(){return s.call(this.children,t)}}("function"==typeof t?t:l(t)))},filter:function(t){"function"!=typeof t&&(t=u(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,a=e[o],l=a.length,c=r[o]=[],f=0;f<l;++f)(i=a[f])&&t.call(i,i.__data__,f,a)&&c.push(i);return new pt(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,b);var n=e?m:d,r=this._parents,o=this._groups;"function"!=typeof t&&(t=v(t));for(var i=o.length,a=new Array(i),u=new Array(i),l=new Array(i),c=0;c<i;++c){var f=r[c],s=o[c],h=s.length,y=g(t.call(f,f&&f.__data__,c,r)),p=y.length,w=u[c]=new Array(p),x=a[c]=new Array(p),S=l[c]=new Array(h);n(f,s,w,x,S,y,e);for(var _,P,O=0,j=0;O<p;++O)if(_=w[O]){for(O>=j&&(j=O+1);!(P=x[j])&&++j<p;);_._next=P||null}}return(a=new pt(a,r))._enter=u,a._exit=l,a},enter:function(){return new pt(this._enter||this._groups.map(y),this._parents)},exit:function(){return new pt(this._exit||this._groups.map(y),this._parents)},join:function(t,e,n){var r=this.enter(),o=this,i=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=e&&(o=e(o))&&(o=o.selection()),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,o=n.length,i=r.length,a=Math.min(o,i),u=new Array(o),l=0;l<a;++l)for(var c,f=n[l],s=r[l],h=f.length,y=u[l]=new Array(h),p=0;p<h;++p)(c=f[p]||s[p])&&(y[p]=c);for(;l<o;++l)u[l]=n[l];return new pt(u,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,o=t[e],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=w);for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var a,u=n[i],l=u.length,c=o[i]=new Array(l),f=0;f<l;++f)(a=u[f])&&(c[f]=a);c.sort(e)}return new pt(o,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 r=t[e],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}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,r=e.length;n<r;++n)for(var o,i=e[n],a=0,u=i.length;a<u;++a)(o=i[a])&&t.call(o,o.__data__,a,i);return this},attr:function(t,e){var n=_(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?O:P:"function"==typeof e?n.local?E:k:n.local?C:j)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?A:"function"==typeof e?R:M)(t,e,null==n?"":n)):z(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?F:"function"==typeof e?L:I)(t,e)):this.node()[t]},classed:function(t,e){var n=B(t+"");if(arguments.length<2){for(var r=N(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof e?$:e?W:G)(n,e))},text:function(t){return arguments.length?this.each(null==t?Y:("function"==typeof t?X:V)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?q:("function"==typeof t?K:H)(t)):this.node().innerHTML},raise:function(){return this.each(J)},lower:function(){return this.each(Q)},append:function(t){var e="function"==typeof t?t:nt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:nt(t),o=null==e?rt:"function"==typeof e?e:r(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)}))},remove:function(){return this.each(ot)},clone:function(t){return this.select(t?at:it)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,o,i=ut(t+""),a=i.length;if(!(arguments.length<2)){for(u=e?ct:lt,r=0;r<a;++r)this.each(u(i[r],e,n));return this}var u=this.node().__on;if(u)for(var l,c=0,f=u.length;c<f;++c)for(r=0,l=u[c];r<a;++r)if((o=i[r]).type===l.type&&o.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?ht:st)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r,o=t[e],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};const dt=vt;function mt(t){return"string"==typeof t?new pt([[document.querySelector(t)]],[document.documentElement]):new pt([[t]],yt)}var bt={value:()=>{}};function gt(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new wt(r)}function wt(t){this._=t}function xt(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function St(t,e){for(var n,r=0,o=t.length;r<o;++r)if((n=t[r]).name===e)return n.value}function _t(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=bt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}wt.prototype=gt.prototype={constructor:wt,on:function(t,e){var n,r=this._,o=xt(t+"",r),i=-1,a=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++i<a;)if(n=(t=o[i]).type)r[n]=_t(r[n],t.name,e);else if(null==e)for(n in r)r[n]=_t(r[n],t.name,null);return this}for(;++i<a;)if((n=(t=o[i]).type)&&(n=St(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new wt(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,n=(r=this._[t]).length;i<n;++i)r[i].value.apply(e,o)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)}};const Pt=gt,Ot={capture:!0,passive:!1};function jt(t){t.preventDefault(),t.stopImmediatePropagation()}function Ct(t){var e=t.document.documentElement,n=mt(t).on("dragstart.drag",jt,Ot);"onselectstart"in e?n.on("selectstart.drag",jt,Ot):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function kt(t,e){var n=t.document.documentElement,r=mt(t).on("dragstart.drag",null);e&&(r.on("click.drag",jt,Ot),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function Et(t){return((t=Math.exp(t))+1/t)/2}const Tt=function t(e,n,r){function o(t,o){var i,a,u=t[0],l=t[1],c=t[2],f=o[0],s=o[1],h=o[2],y=f-u,p=s-l,v=y*y+p*p;if(v<1e-12)a=Math.log(h/c)/e,i=function(t){return[u+t*y,l+t*p,c*Math.exp(e*t*a)]};else{var d=Math.sqrt(v),m=(h*h-c*c+r*v)/(2*c*n*d),b=(h*h-c*c-r*v)/(2*h*n*d),g=Math.log(Math.sqrt(m*m+1)-m),w=Math.log(Math.sqrt(b*b+1)-b);a=(w-g)/e,i=function(t){var r,o=t*a,i=Et(g),f=c/(n*d)*(i*(r=e*o+g,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[u+f*y,l+f*p,c*i/Et(e*o+g)]}}return i.duration=1e3*a*e/Math.SQRT2,i}return o.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},o}(Math.SQRT2,2,4);function At(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 r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}var Mt,Rt,zt=0,Ft=0,It=0,Lt=0,Bt=0,Nt=0,Dt="object"==typeof performance&&performance.now?performance:Date,Zt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ut(){return Bt||(Zt(Wt),Bt=Dt.now()+Nt)}function Wt(){Bt=0}function Gt(){this._call=this._time=this._next=null}function $t(t,e,n){var r=new Gt;return r.restart(t,e,n),r}function Yt(){Bt=(Lt=Dt.now())+Nt,zt=Ft=0;try{!function(){Ut(),++zt;for(var t,e=Mt;e;)(t=Bt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--zt}()}finally{zt=0,function(){for(var t,e,n=Mt,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Mt=e);Rt=t,Xt(r)}(),Bt=0}}function Vt(){var t=Dt.now(),e=t-Lt;e>1e3&&(Nt-=e,Lt=t)}function Xt(t){zt||(Ft&&(Ft=clearTimeout(Ft)),t-Bt>24?(t<1/0&&(Ft=setTimeout(Yt,t-Dt.now()-Nt)),It&&(It=clearInterval(It))):(It||(Lt=Dt.now(),It=setInterval(Vt,1e3)),zt=1,Zt(Yt)))}function qt(t,e,n){var r=new Gt;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}Gt.prototype=$t.prototype={constructor:Gt,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Ut():+n)+(null==e?0:+e),this._next||Rt===this||(Rt?Rt._next=this:Mt=this,Rt=this),this._call=t,this._time=n,Xt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xt())}};var Ht=Pt("start","end","cancel","interrupt"),Kt=[];function Jt(t,e,n,r,o,i){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,o=t.__transition;function i(l){var c,f,s,h;if(1!==n.state)return u();for(c in o)if((h=o[c]).name===n.name){if(3===h.state)return qt(i);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[c]):+c<e&&(h.state=6,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete o[c])}if(qt((function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(l))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(s=n.tween.length),c=0,f=-1;c<s;++c)(h=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(r[++f]=h);r.length=f+1}}function a(e){for(var o=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(u),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(t,o);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){for(var r in n.state=6,n.timer.stop(),delete o[e],o)return;delete t.__transition}o[e]=n,n.timer=$t((function(t){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=t&&i(t-n.delay)}),0,n.time)}(t,n,{name:e,index:r,group:o,on:Ht,tween:Kt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Qt(t,e){var n=ee(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function te(t,e){var n=ee(t,e);if(n.state>3)throw new Error("too late; already running");return n}function ee(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function ne(t,e){var n,r,o,i=t.__transition,a=!0;if(i){for(o in e=null==e?null:e+"",i)(n=i[o]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete i[o]):a=!1;a&&delete t.__transition}}function re(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var oe,ie=180/Math.PI,ae={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ue(t,e,n,r,o,i){var a,u,l;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,l/=u),t*r<e*n&&(t=-t,e=-e,l=-l,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*ie,skewX:Math.atan(l)*ie,scaleX:a,scaleY:u}}function le(t,e,n,r){function o(t){return t.length?t.pop()+" ":""}return function(i,a){var u=[],l=[];return i=t(i),a=t(a),function(t,r,o,i,a,u){if(t!==o||r!==i){var l=a.push("translate(",null,e,null,n);u.push({i:l-4,x:re(t,o)},{i:l-2,x:re(r,i)})}else(o||i)&&a.push("translate("+o+e+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,u,l),function(t,e,n,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:n.push(o(n)+"rotate(",null,r)-2,x:re(t,e)})):e&&n.push(o(n)+"rotate("+e+r)}(i.rotate,a.rotate,u,l),function(t,e,n,i){t!==e?i.push({i:n.push(o(n)+"skewX(",null,r)-2,x:re(t,e)}):e&&n.push(o(n)+"skewX("+e+r)}(i.skewX,a.skewX,u,l),function(t,e,n,r,i,a){if(t!==n||e!==r){var u=i.push(o(i)+"scale(",null,",",null,")");a.push({i:u-4,x:re(t,n)},{i:u-2,x:re(e,r)})}else 1===n&&1===r||i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,u,l),i=a=null,function(t){for(var e,n=-1,r=l.length;++n<r;)u[(e=l[n]).i]=e.x(t);return u.join("")}}}var ce=le((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?ae:ue(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),fe=le((function(t){return null==t?ae:(oe||(oe=document.createElementNS("http://www.w3.org/2000/svg","g")),oe.setAttribute("transform",t),(t=oe.transform.baseVal.consolidate())?ue((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):ae)}),", ",")",")");function se(t,e){var n,r;return function(){var o=te(this,t),i=o.tween;if(i!==n)for(var a=0,u=(r=n=i).length;a<u;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}o.tween=r}}function he(t,e,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=te(this,t),a=i.tween;if(a!==r){o=(r=a).slice();for(var u={name:e,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===e){o[l]=u;break}l===c&&o.push(u)}i.tween=o}}function ye(t,e,n){var r=t._id;return t.each((function(){var t=te(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return ee(t,r).value[e]}}function pe(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ve(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function de(){}var me=.7,be=1/me,ge="\\s*([+-]?\\d+)\\s*",we="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",xe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Se=/^#([0-9a-f]{3,8})$/,_e=new RegExp(`^rgb\\(${ge},${ge},${ge}\\)$`),Pe=new RegExp(`^rgb\\(${xe},${xe},${xe}\\)$`),Oe=new RegExp(`^rgba\\(${ge},${ge},${ge},${we}\\)$`),je=new RegExp(`^rgba\\(${xe},${xe},${xe},${we}\\)$`),Ce=new RegExp(`^hsl\\(${we},${xe},${xe}\\)$`),ke=new RegExp(`^hsla\\(${we},${xe},${xe},${we}\\)$`),Ee={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 Te(){return this.rgb().formatHex()}function Ae(){return this.rgb().formatRgb()}function Me(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Se.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Re(e):3===n?new Le(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ze(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ze(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=_e.exec(t))?new Le(e[1],e[2],e[3],1):(e=Pe.exec(t))?new Le(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Oe.exec(t))?ze(e[1],e[2],e[3],e[4]):(e=je.exec(t))?ze(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Ce.exec(t))?We(e[1],e[2]/100,e[3]/100,1):(e=ke.exec(t))?We(e[1],e[2]/100,e[3]/100,e[4]):Ee.hasOwnProperty(t)?Re(Ee[t]):"transparent"===t?new Le(NaN,NaN,NaN,0):null}function Re(t){return new Le(t>>16&255,t>>8&255,255&t,1)}function ze(t,e,n,r){return r<=0&&(t=e=n=NaN),new Le(t,e,n,r)}function Fe(t){return t instanceof de||(t=Me(t)),t?new Le((t=t.rgb()).r,t.g,t.b,t.opacity):new Le}function Ie(t,e,n,r){return 1===arguments.length?Fe(t):new Le(t,e,n,null==r?1:r)}function Le(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Be(){return`#${Ue(this.r)}${Ue(this.g)}${Ue(this.b)}`}function Ne(){const t=De(this.opacity);return`${1===t?"rgb(":"rgba("}${Ze(this.r)}, ${Ze(this.g)}, ${Ze(this.b)}${1===t?")":`, ${t})`}`}function De(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ze(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ue(t){return((t=Ze(t))<16?"0":"")+t.toString(16)}function We(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new $e(t,e,n,r)}function Ge(t){if(t instanceof $e)return new $e(t.h,t.s,t.l,t.opacity);if(t instanceof de||(t=Me(t)),!t)return new $e;if(t instanceof $e)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),a=NaN,u=i-o,l=(i+o)/2;return u?(a=e===i?(n-r)/u+6*(n<r):n===i?(r-e)/u+2:(e-n)/u+4,u/=l<.5?i+o:2-i-o,a*=60):u=l>0&&l<1?0:a,new $e(a,u,l,t.opacity)}function $e(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ye(t){return(t=(t||0)%360)<0?t+360:t}function Ve(t){return Math.max(0,Math.min(1,t||0))}function Xe(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 qe(t,e,n,r,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*n+(1+3*t+3*i-3*a)*r+a*o)/6}pe(de,Me,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Te,formatHex:Te,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ge(this).formatHsl()},formatRgb:Ae,toString:Ae}),pe(Le,Ie,ve(de,{brighter(t){return t=null==t?be:Math.pow(be,t),new Le(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?me:Math.pow(me,t),new Le(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Le(Ze(this.r),Ze(this.g),Ze(this.b),De(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:Be,formatHex:Be,formatHex8:function(){return`#${Ue(this.r)}${Ue(this.g)}${Ue(this.b)}${Ue(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ne,toString:Ne})),pe($e,(function(t,e,n,r){return 1===arguments.length?Ge(t):new $e(t,e,n,null==r?1:r)}),ve(de,{brighter(t){return t=null==t?be:Math.pow(be,t),new $e(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?me:Math.pow(me,t),new $e(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,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new Le(Xe(t>=240?t-240:t+120,o,r),Xe(t,o,r),Xe(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new $e(Ye(this.h),Ve(this.s),Ve(this.l),De(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=De(this.opacity);return`${1===t?"hsl(":"hsla("}${Ye(this.h)}, ${100*Ve(this.s)}%, ${100*Ve(this.l)}%${1===t?")":`, ${t})`}`}}));const He=t=>()=>t;function Ke(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):He(isNaN(t)?e:t)}const Je=function t(e){var n=function(t){return 1==(t=+t)?Ke: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(r){return Math.pow(t+r*e,n)}}(e,n,t):He(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=Ie(t)).r,(e=Ie(e)).r),o=n(t.g,e.g),i=n(t.b,e.b),a=Ke(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Qe(t){return function(e){var n,r,o=e.length,i=new Array(o),a=new Array(o),u=new Array(o);for(n=0;n<o;++n)r=Ie(e[n]),i[n]=r.r||0,a[n]=r.g||0,u[n]=r.b||0;return i=t(i),a=t(a),u=t(u),r.opacity=1,function(t){return r.r=i(t),r.g=a(t),r.b=u(t),r+""}}}Qe((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[r],i=t[r+1],a=r>0?t[r-1]:2*o-i,u=r<e-1?t[r+2]:2*i-o;return qe((n-r/e)*e,a,o,i,u)}})),Qe((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),o=t[(r+e-1)%e],i=t[r%e],a=t[(r+1)%e],u=t[(r+2)%e];return qe((n-r/e)*e,o,i,a,u)}}));var tn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,en=new RegExp(tn.source,"g");function nn(t,e){var n,r,o,i=tn.lastIndex=en.lastIndex=0,a=-1,u=[],l=[];for(t+="",e+="";(n=tn.exec(t))&&(r=en.exec(e));)(o=r.index)>i&&(o=e.slice(i,o),u[a]?u[a]+=o:u[++a]=o),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,l.push({i:a,x:re(n,r)})),i=en.lastIndex;return i<e.length&&(o=e.slice(i),u[a]?u[a]+=o:u[++a]=o),u.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,r=0;r<e;++r)u[(n=l[r]).i]=n.x(t);return u.join("")})}function rn(t,e){var n;return("number"==typeof e?re:e instanceof Me?Je:(n=Me(e))?(e=n,Je):nn)(t,e)}function on(t){return function(){this.removeAttribute(t)}}function an(t){return function(){this.removeAttributeNS(t.space,t.local)}}function un(t,e,n){var r,o,i=n+"";return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function ln(t,e,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function cn(t,e,n){var r,o,i;return function(){var a,u,l=n(this);if(null!=l)return(a=this.getAttribute(t))===(u=l+"")?null:a===r&&u===o?i:(o=u,i=e(r=a,l));this.removeAttribute(t)}}function fn(t,e,n){var r,o,i;return function(){var a,u,l=n(this);if(null!=l)return(a=this.getAttributeNS(t.space,t.local))===(u=l+"")?null:a===r&&u===o?i:(o=u,i=e(r=a,l));this.removeAttributeNS(t.space,t.local)}}function sn(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function hn(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function yn(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&hn(t,o)),n}return o._value=e,o}function pn(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&sn(t,o)),n}return o._value=e,o}function vn(t,e){return function(){Qt(this,t).delay=+e.apply(this,arguments)}}function dn(t,e){return e=+e,function(){Qt(this,t).delay=e}}function mn(t,e){return function(){te(this,t).duration=+e.apply(this,arguments)}}function bn(t,e){return e=+e,function(){te(this,t).duration=e}}function gn(t,e){if("function"!=typeof e)throw new Error;return function(){te(this,t).ease=e}}function wn(t,e,n){var r,o,i=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)?Qt:te;return function(){var a=i(this,t),u=a.on;u!==r&&(o=(r=u).copy()).on(e,n),a.on=o}}var xn=dt.prototype.constructor;function Sn(t){return function(){this.style.removeProperty(t)}}function _n(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Pn(t,e,n){var r,o;function i(){var i=e.apply(this,arguments);return i!==o&&(r=(o=i)&&_n(t,i,n)),r}return i._value=e,i}function On(t){return function(e){this.textContent=t.call(this,e)}}function jn(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&On(r)),e}return r._value=t,r}var Cn=0;function kn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function En(){return++Cn}var Tn=dt.prototype;kn.prototype=function(t){return dt().transition(t)}.prototype={constructor:kn,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=r(t));for(var o=this._groups,i=o.length,a=new Array(i),u=0;u<i;++u)for(var l,c,f=o[u],s=f.length,h=a[u]=new Array(s),y=0;y<s;++y)(l=f[y])&&(c=t.call(l,l.__data__,y,f))&&("__data__"in l&&(c.__data__=l.__data__),h[y]=c,Jt(h[y],e,n,y,h,ee(l,n)));return new kn(a,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=a(t));for(var r=this._groups,o=r.length,i=[],u=[],l=0;l<o;++l)for(var c,f=r[l],s=f.length,h=0;h<s;++h)if(c=f[h]){for(var y,p=t.call(c,c.__data__,h,f),v=ee(c,n),d=0,m=p.length;d<m;++d)(y=p[d])&&Jt(y,e,n,d,p,v);i.push(p),u.push(c)}return new kn(i,u,e,n)},selectChild:Tn.selectChild,selectChildren:Tn.selectChildren,filter:function(t){"function"!=typeof t&&(t=u(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,a=e[o],l=a.length,c=r[o]=[],f=0;f<l;++f)(i=a[f])&&t.call(i,i.__data__,f,a)&&c.push(i);return new kn(r,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,r=e.length,o=n.length,i=Math.min(r,o),a=new Array(r),u=0;u<i;++u)for(var l,c=e[u],f=n[u],s=c.length,h=a[u]=new Array(s),y=0;y<s;++y)(l=c[y]||f[y])&&(h[y]=l);for(;u<r;++u)a[u]=e[u];return new kn(a,this._parents,this._name,this._id)},selection:function(){return new xn(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=En(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,u=r[i],l=u.length,c=0;c<l;++c)if(a=u[c]){var f=ee(a,e);Jt(a,t,n,c,u,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new kn(r,this._parents,t,n)},call:Tn.call,nodes:Tn.nodes,node:Tn.node,size:Tn.size,empty:Tn.empty,each:Tn.each,on:function(t,e){var n=this._id;return arguments.length<2?ee(this.node(),n).on.on(t):this.each(wn(n,t,e))},attr:function(t,e){var n=_(t),r="transform"===n?fe:rn;return this.attrTween(t,"function"==typeof e?(n.local?fn:cn)(n,r,ye(this,"attr."+t,e)):null==e?(n.local?an:on)(n):(n.local?ln:un)(n,r,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 r=_(t);return this.tween(n,(r.local?yn:pn)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?ce:rn;return null==e?this.styleTween(t,function(t,e){var n,r,o;return function(){var i=z(this,t),a=(this.style.removeProperty(t),z(this,t));return i===a?null:i===n&&a===r?o:o=e(n=i,r=a)}}(t,r)).on("end.style."+t,Sn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,o,i;return function(){var a=z(this,t),u=n(this),l=u+"";return null==u&&(this.style.removeProperty(t),l=u=z(this,t)),a===l?null:a===r&&l===o?i:(o=l,i=e(r=a,u))}}(t,r,ye(this,"style."+t,e))).each(function(t,e){var n,r,o,i,a="style."+e,u="end."+a;return function(){var l=te(this,t),c=l.on,f=null==l.value[a]?i||(i=Sn(e)):void 0;c===n&&o===f||(r=(n=c).copy()).on(u,o=f),l.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,o,i=n+"";return function(){var a=z(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,Pn(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}}(ye(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,jn(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 r,o=ee(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===t)return r.value;return null}return this.each((null==e?se:he)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?vn:dn)(e,t)):ee(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?mn:bn)(e,t)):ee(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(gn(e,t)):ee(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;te(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,r=n._id,o=n.size();return new Promise((function(i,a){var u={value:a},l={value:function(){0==--o&&i()}};n.each((function(){var n=te(this,r),o=n.on;o!==t&&((e=(t=o).copy())._.cancel.push(u),e._.interrupt.push(u),e._.end.push(l)),n.on=e})),0===o&&i()}))},[Symbol.iterator]:Tn[Symbol.iterator]};var An={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Mn(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}dt.prototype.interrupt=function(t){return this.each((function(){ne(this,t)}))},dt.prototype.transition=function(t){var e,n;t instanceof kn?(e=t._id,t=t._name):(e=En(),(n=An).time=Ut(),t=null==t?null:t+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,u=r[i],l=u.length,c=0;c<l;++c)(a=u[c])&&Jt(a,t,e,c,u,n||Mn(a,e));return new kn(r,this._parents,t,e)};const Rn=t=>()=>t;function zn(t,{sourceEvent:e,target:n,transform:r,dispatch:o}){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:r,enumerable:!0,configurable:!0},_:{value:o}})}function Fn(t,e,n){this.k=t,this.x=e,this.y=n}Fn.prototype={constructor:Fn,scale:function(t){return 1===t?this:new Fn(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Fn(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 In=new Fn(1,0,0);function Ln(t){t.stopImmediatePropagation()}function Bn(t){t.preventDefault(),t.stopImmediatePropagation()}function Nn(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Dn(){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 Zn(){return this.__zoom||In}function Un(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Wn(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gn(t,e,n){var r=t.invertX(e[0][0])-n[0][0],o=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function $n(){var t,e,n,r=Nn,o=Dn,i=Gn,a=Un,u=Wn,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],f=250,s=Tt,h=Pt("start","zoom","end"),y=500,p=0,v=10;function d(t){t.property("__zoom",Zn).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",O).filter(u).on("touchstart.zoom",j).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",k).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new Fn(e,t.x,t.y)}function b(t,e,n){var r=e[0]-n[0]*t.k,o=e[1]-n[1]*t.k;return r===t.x&&o===t.y?t:new Fn(t.k,r,o)}function g(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,e,n,r){t.on("start.zoom",(function(){x(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,i=arguments,a=x(t,i).event(r),u=o.apply(t,i),l=null==n?g(u):"function"==typeof n?n.apply(t,i):n,c=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),f=t.__zoom,h="function"==typeof e?e.apply(t,i):e,y=s(f.invert(l).concat(c/f.k),h.invert(l).concat(c/h.k));return function(t){if(1===t)t=h;else{var e=y(t),n=c/e[2];t=new Fn(n,l[0]-e[0]*n,l[1]-e[1]*n)}a.zoom(null,t)}}))}function x(t,e,n){return!n&&t.__zooming||new S(t,e)}function S(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=o.apply(t,e),this.taps=0}function _(t,...e){if(r.apply(this,arguments)){var n=x(this,e).event(t),o=this.__zoom,u=Math.max(l[0],Math.min(l[1],o.k*Math.pow(2,a.apply(this,arguments)))),f=At(t);if(n.wheel)n.mouse[0][0]===f[0]&&n.mouse[0][1]===f[1]||(n.mouse[1]=o.invert(n.mouse[0]=f)),clearTimeout(n.wheel);else{if(o.k===u)return;n.mouse=[f,o.invert(f)],ne(this),n.start()}Bn(t),n.wheel=setTimeout(s,150),n.zoom("mouse",i(b(m(o,u),n.mouse[0],n.mouse[1]),n.extent,c))}function s(){n.wheel=null,n.end()}}function P(t,...e){if(!n&&r.apply(this,arguments)){var o=t.currentTarget,a=x(this,e,!0).event(t),u=mt(t.view).on("mousemove.zoom",h,!0).on("mouseup.zoom",y,!0),l=At(t,o),f=t.clientX,s=t.clientY;Ct(t.view),Ln(t),a.mouse=[l,this.__zoom.invert(l)],ne(this),a.start()}function h(t){if(Bn(t),!a.moved){var e=t.clientX-f,n=t.clientY-s;a.moved=e*e+n*n>p}a.event(t).zoom("mouse",i(b(a.that.__zoom,a.mouse[0]=At(t,o),a.mouse[1]),a.extent,c))}function y(t){u.on("mousemove.zoom mouseup.zoom",null),kt(t.view,a.moved),Bn(t),a.event(t).end()}}function O(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=At(t.changedTouches?t.changedTouches[0]:t,this),u=n.invert(a),l=n.k*(t.shiftKey?.5:2),s=i(b(m(n,l),a,u),o.apply(this,e),c);Bn(t),f>0?mt(this).transition().duration(f).call(w,s,a,t):mt(this).call(d.transform,s,a,t)}}function j(n,...o){if(r.apply(this,arguments)){var i,a,u,l,c=n.touches,f=c.length,s=x(this,o,n.changedTouches.length===f).event(n);for(Ln(n),a=0;a<f;++a)l=[l=At(u=c[a],this),this.__zoom.invert(l),u.identifier],s.touch0?s.touch1||s.touch0[2]===l[2]||(s.touch1=l,s.taps=0):(s.touch0=l,i=!0,s.taps=1+!!t);t&&(t=clearTimeout(t)),i&&(s.taps<2&&(e=l[0],t=setTimeout((function(){t=null}),y)),ne(this),s.start())}}function C(t,...e){if(this.__zooming){var n,r,o,a,u=x(this,e).event(t),l=t.changedTouches,f=l.length;for(Bn(t),n=0;n<f;++n)o=At(r=l[n],this),u.touch0&&u.touch0[2]===r.identifier?u.touch0[0]=o:u.touch1&&u.touch1[2]===r.identifier&&(u.touch1[0]=o);if(r=u.that.__zoom,u.touch1){var s=u.touch0[0],h=u.touch0[1],y=u.touch1[0],p=u.touch1[1],v=(v=y[0]-s[0])*v+(v=y[1]-s[1])*v,d=(d=p[0]-h[0])*d+(d=p[1]-h[1])*d;r=m(r,Math.sqrt(v/d)),o=[(s[0]+y[0])/2,(s[1]+y[1])/2],a=[(h[0]+p[0])/2,(h[1]+p[1])/2]}else{if(!u.touch0)return;o=u.touch0[0],a=u.touch0[1]}u.zoom("touch",i(b(r,o,a),u.extent,c))}}function k(t,...r){if(this.__zooming){var o,i,a=x(this,r).event(t),u=t.changedTouches,l=u.length;for(Ln(t),n&&clearTimeout(n),n=setTimeout((function(){n=null}),y),o=0;o<l;++o)i=u[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=At(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<v)){var c=mt(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return d.transform=function(t,e,n,r){var o=t.selection?t.selection():t;o.property("__zoom",Zn),t!==o?w(t,e,n,r):o.interrupt().each((function(){x(this,arguments).event(r).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},d.scaleBy=function(t,e,n,r){d.scaleTo(t,(function(){var t=this.__zoom.k,n="function"==typeof e?e.apply(this,arguments):e;return t*n}),n,r)},d.scaleTo=function(t,e,n,r){d.transform(t,(function(){var t=o.apply(this,arguments),r=this.__zoom,a=null==n?g(t):"function"==typeof n?n.apply(this,arguments):n,u=r.invert(a),l="function"==typeof e?e.apply(this,arguments):e;return i(b(m(r,l),a,u),t,c)}),n,r)},d.translateBy=function(t,e,n,r){d.transform(t,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)}),null,r)},d.translateTo=function(t,e,n,r,a){d.transform(t,(function(){var t=o.apply(this,arguments),a=this.__zoom,u=null==r?g(t):"function"==typeof r?r.apply(this,arguments):r;return i(In.translate(u[0],u[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,c)}),r,a)},S.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=mt(this.that).datum();h.call(t,this.that,new zn(t,{sourceEvent:this.sourceEvent,target:d,type:t,transform:this.that.__zoom,dispatch:h}),e)}},d.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:Rn(+t),d):a},d.filter=function(t){return arguments.length?(r="function"==typeof t?t:Rn(!!t),d):r},d.touchable=function(t){return arguments.length?(u="function"==typeof t?t:Rn(!!t),d):u},d.extent=function(t){return arguments.length?(o="function"==typeof t?t:Rn([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),d):o},d.scaleExtent=function(t){return arguments.length?(l[0]=+t[0],l[1]=+t[1],d):[l[0],l[1]]},d.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],d):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},d.constrain=function(t){return arguments.length?(i=t,d):i},d.duration=function(t){return arguments.length?(f=+t,d):f},d.interpolate=function(t){return arguments.length?(s=t,d):s},d.on=function(){var t=h.on.apply(h,arguments);return t===h?d:t},d.clickDistance=function(t){return arguments.length?(p=(t=+t)*t,d):Math.sqrt(p)},d.tapDistance=function(t){return arguments.length?(v=+t,d):v},d}function Yn(t){return Yn="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},Yn(t)}function Vn(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 Xn(t,e);var n=Object.prototype.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)?Xn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function qn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Yn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Yn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Yn(o)?o:String(o)),r)}var o}Fn.prototype;var Kn=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;qn(this,t),i=i||{},this.canvas=e,this.w=this.canvas.offsetWidth,this.h=this.canvas.offsetHeight,this.canvas.width=this.w,this.canvas.height=this.h;var a=this.canvas.getContext("2d");if(!a)throw"Impossible to create canvas 2D context";this.ctx=a,this.center=r||{x:.5*this.w,y:.5*this.h},this.zf=o,this.backgroundColor=i.backgroundColor||"white",this.onZoomStartFun=i.onZoomStartFun,this.onZoomEndFun=i.onZoomEndFun,this.extGeo={xMin:NaN,xMax:NaN,yMin:NaN,yMax:NaN},this.updateExtentGeo();var u=In,l=$n().wheelDelta((function(t){return-t.deltaY*(1===t.deltaMode?.07:t.deltaMode?1:.004)})).on("zoom",(function(t){var e=t.transform,r=u.k/e.k;if(1==r){var o=u.x-e.x,i=u.y-e.y;n.pan(o*n.getZf(),-i*n.getZf())}else{var a=t.sourceEvent;if(a instanceof WheelEvent)n.zoom(r,n.pixToGeoX(t.sourceEvent.offsetX),n.pixToGeoY(t.sourceEvent.offsetY));else if(a instanceof TouchEvent){var l,c=0,f=0,s=Vn(a.targetTouches);try{for(s.s();!(l=s.n()).done;){var h=l.value;c+=h.clientX,f+=h.clientY}}catch(t){s.e(t)}finally{s.f()}c/=a.targetTouches.length,f/=a.targetTouches.length,n.zoom(r,n.pixToGeoX(c),n.pixToGeoY(f))}}u=e})).on("start",(function(t){n.canvasSave.c=document.createElement("canvas"),n.canvasSave.c.setAttribute("width",""+n.w),n.canvasSave.c.setAttribute("height",""+n.h),n.canvasSave.c.getContext("2d").drawImage(n.canvas,0,0),n.canvasSave.dx=0,n.canvasSave.dy=0,n.canvasSave.f=1,n.onZoomStartFun&&n.onZoomStartFun()})).on("end",(function(t){n.redraw(!0),n.canvasSave={c:null,dx:0,dy:0,f:1},n.onZoomEndFun&&n.onZoomEndFun()}));l(mt(this.canvas)),this.zfExtent=[0,1/0],this.canvasSave={c:null,dx:0,dy:0,f:1}}var e,n,r;return e=t,n=[{key:"setCenter",value:function(t){this.center=t}},{key:"getCenter",value:function(){return this.center}},{key:"setZf",value:function(t){this.zf=t,this.slider&&this.slider.attr("value",+this.zf)}},{key:"getZf",value:function(){return this.zf}},{key:"setZfExtent",value:function(t){this.zfExtent=t}},{key:"getZfExtent",value:function(){return this.zfExtent}},{key:"initCanvasTransform",value:function(){this.ctx.setTransform(1,0,0,1,0,0)}},{key:"setCanvasTransform",value:function(){var t=1/this.getZf(),e=-this.center.x/this.getZf()+.5*this.w,n=this.center.y/this.getZf()+.5*this.h;this.ctx.setTransform(t,0,0,-t,e,n)}},{key:"getWebGLTransform",value:function(){var t=2/(this.w*this.getZf()),e=2/(this.h*this.getZf());return[t,0,0,0,e,0,-t*this.center.x,-e*this.center.y,1]}},{key:"redraw",value:function(){throw new Error("Method redraw not implemented.")}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"white";this.ctx&&(this.ctx.fillStyle=t),this.ctx.fillRect(0,0,this.w,this.h)}},{key:"pan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.center.x+=t,this.center.y+=e,this.updateExtentGeo(),this.canvasSave.c&&(this.canvasSave.dx-=t/this.getZf(),this.canvasSave.dy+=e/this.getZf(),this.clear(this.backgroundColor),this.ctx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy))}},{key:"zoom",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.center.x,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.center.y;if(!(this.zfExtent[0]==this.getZf()&&t<=1||this.zfExtent[1]==this.getZf()&&t>=1)){var r=t*this.getZf();r<this.zfExtent[0]&&(t=this.zfExtent[0]/this.getZf()),r>this.zfExtent[1]&&(t=this.zfExtent[1]/this.getZf()),this.setZf(t*this.getZf());var o=(e-this.center.x)*(1-t);this.center.x+=o;var i=(n-this.center.y)*(1-t);this.center.y+=i,this.updateExtentGeo(),this.canvasSave.c&&(this.clear(this.backgroundColor),this.canvasSave.f/=t,this.canvasSave.dx=this.geoToPixX(e)*(1-this.canvasSave.f),this.canvasSave.dy=this.geoToPixY(n)*(1-this.canvasSave.f),this.clear(this.backgroundColor),this.ctx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy,this.canvasSave.f*this.canvasSave.c.width,this.canvasSave.f*this.canvasSave.c.height))}}},{key:"updateExtentGeo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return this.extGeo={xMin:this.pixToGeoX(-t),xMax:this.pixToGeoX(this.w+t),yMin:this.pixToGeoY(this.h+t),yMax:this.pixToGeoY(-t)},this.extGeo}},{key:"toDraw",value:function(t){return!(t.x<this.extGeo.xMin||t.x>this.extGeo.xMax||t.y<this.extGeo.yMin||t.y>this.extGeo.yMax)}},{key:"geoToPixX",value:function(t){return(t-this.center.x)/this.getZf()+.5*this.w}},{key:"geoToPixY",value:function(t){return-(t-this.center.y)/this.getZf()+.5*this.h}},{key:"pixToGeoX",value:function(t){return(t-.5*this.w)*this.getZf()+this.center.x}},{key:"pixToGeoY",value:function(t){return-(t-.5*this.h)*this.getZf()+this.center.y}},{key:"setViewFromURL",value:function(){var e=t.getParameterByName("x"),n=t.getParameterByName("y"),r=t.getParameterByName("z"),o=this.getCenter();null==e||null==e||isNaN(+e)||(o.x=+e),null==n||null==n||isNaN(+n)||(o.y=+n),null==r||null==r||isNaN(+r)||this.setZf(+r)}},{key:"addZoomSlider",value:function(t,e){(e=e||{}).width=e.width||"30px",e.height=e.height||"300px";var n=mt("#"+t);if(n.empty())return console.error("Could not find div element to build zoom slider. Id: "+t),this;var r=this;return this.slider=n.append("input").attr("type","range").attr("min",this.getZfExtent()[0]).attr("max",this.getZfExtent()[1]).attr("value",this.getZf()).on("input",(function(t){if(this&&this.value){var e=+this.value;mt(this).attr("value",e),r.setZf(e),r.redraw()}})).style("width",e.width).style("height",e.height).style("opacity",.7).on("mouseover",(function(t){mt(this).style("opacity",1)})).on("mouseout",(function(t){mt(this).style("opacity",.7)})).style("-webkit-appearance","slider-vertical").style("writing-mode","bt-lr").attr("orient","vertical").style("background","lightgray").style("outline","none").style("-webkit-transition",".2s").style("transition","opacity .2s"),this}}],r=[{key:"getParameterByName",value:function(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(location.search);return e?decodeURIComponent(e[1].replace(/\+/g," ")):null}}],n&&Hn(e.prototype,n),r&&Hn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Jn(t){return Jn="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},Jn(t)}function Qn(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 tr(t,e);var n=Object.prototype.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)?tr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function tr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function er(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Jn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Jn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Jn(o)?o:String(o)),r)}var o}var nr=function(){function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.offset=e.offset||function(t,e,n){return{dx:0,dy:0}},this.minZoom=e.minZoom||0,this.maxZoom=e.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.legends=[]}var e,n,r;return e=t,r=[{key:"getStatistics",value:function(t,e,n){if(t&&0!=t.length){var r,o=1/0,i=-1/0,a=Qn(t);try{for(a.s();!(r=a.n()).done;){var u=+e(r.value);n&&!u||(u<o&&(o=u),u>i&&(i=u))}}catch(t){a.e(t)}finally{a.f()}return{min:o,max:i}}}}],(n=[{key:"draw",value:function(t,e,n){throw new Error("Method draw not implemented.")}},{key:"getOffset",value:function(){return this.offset}},{key:"setOffset",value:function(t){return this.offset=t,this}},{key:"updateLegends",value:function(t){var e,n=Qn(this.legends);try{for(n.s();!(e=n.n()).done;)e.value.update(t)}catch(t){n.e(t)}finally{n.f()}return this}}])&&er(e.prototype,n),r&&er(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function rr(t){return rr="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},rr(t)}function or(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ir(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==rr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==rr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===rr(o)?o:String(o)),r)}var o}var ar=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(or(this,t),r=r||{},this.dataset=e,this.styles=n,this.visible=0!=r.visible,this.minZoom=r.minZoom||0,this.maxZoom=r.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.pixNb=r.pixNb||3,this.cellInfoHTML=r.cellInfoHTML||t.defaultCellInfoHTML}var e,n,r;return e=t,r=[{key:"defaultCellInfoHTML",value:function(t){for(var e=[],n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];"x"!==o&&"y"!==o&&e.push("<b>",o,"</b>"," : ",t[o],"<br>")}return e.join("")}}],(n=[{key:"getDatasetComponent",value:function(t){if(!(t<this.minZoom||t>this.maxZoom)){if(1==this.dataset.datasetComponents.length)return this.dataset.datasetComponents[0];for(var e=this.dataset.resolutions,n=0,r=e[n]/this.pixNb;r<t&&n<e.length;)r=e[++n]/this.pixNb;return n==e.length?this.dataset.datasetComponents[e.length-1]:this.dataset.datasetComponents[n]}}}])&&ir(e.prototype,n),r&&ir(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ur(t){return ur="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},ur(t)}function lr(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 cr(t,e);var n=Object.prototype.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)?cr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function cr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function fr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ur(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ur(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ur(o)?o:String(o)),r)}var o}var hr=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(fr(this,t),r=r||{},this.datasetComponents=e,this.resolutions=n,this.datasetComponents.length>1&&this.datasetComponents.length!=this.resolutions.length)throw new Error("Uncompatible number of datasets and resolutions: "+this.datasetComponents.length+" "+this.resolutions.length);r.preprocess&&this.setPrepocesses(r.preprocess)}var e,n,r;return e=t,r=[{key:"make",value:function(e,n,r){var o,i=[],a=lr(e);try{for(a.s();!(o=a.n()).done;){var u=o.value;i.push(n(u))}}catch(t){a.e(t)}finally{a.f()}return new t(i,e,r)}}],(n=[{key:"setPrepocesses",value:function(t){var e,n=lr(this.datasetComponents);try{for(n.s();!(e=n.n()).done;)e.value.preprocess=t}catch(t){n.e(t)}finally{n.f()}return this}}])&&sr(e.prototype,n),r&&sr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function yr(t){return yr="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},yr(t)}function pr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==yr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==yr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===yr(o)?o:String(o)),r)}var o}var dr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;pr(this,t),e=e||{},this.div=e.div||"tooltip_eurostat",this.maxWidth=e.maxWidth||"20em",this.fontSize=e.fontSize||"1.2em",this.background=e.background||"white",this.padding=e.padding||"5px",this.border=e.border||"0px",this["border-radius"]=e["border-radius"]||"5px",this["box-shadow"]=e["box-shadow"]||"5px 5px 5px grey",this["font-family"]=e["font-family"]||"Helvetica, Arial, sans-serif",this.transitionDuration=e.transitionDuration||100,this.xOffset=e.xOffset||30,this.yOffset=e.yOffset||20,this.tooltip=mt("#"+this.div),this.tooltip.empty()&&(this.tooltip=mt("body").append("div").attr("id",this.div)),this.tooltip.style("max-width",this.maxWidth),this.tooltip.style("overflow","hidden"),this.tooltip.style("font-size",this.fontSize),this.tooltip.style("background",this.background),this.tooltip.style("padding",this.padding),this.tooltip.style("border",this.border),this.tooltip.style("border-radius",this["border-radius"]),this.tooltip.style("box-shadow",this["box-shadow"]),this.tooltip.style("font-family",this["font-family"]),this.tooltip.style("position","absolute"),this.tooltip.style("pointer-events","none"),this.tooltip.style("opacity","0")}var e,n;return e=t,n=[{key:"show",value:function(){this.tooltip.transition().duration(this.transitionDuration).style("opacity",1)}},{key:"hide",value:function(){this.tooltip.transition().duration(this.transitionDuration).style("opacity",0)}},{key:"html",value:function(t){this.tooltip.html(t)}},{key:"setPosition",value:function(t){this.tooltip.style("left",t.pageX+this.xOffset+"px").style("top",t.pageY-this.yOffset+"px")}},{key:"style",value:function(t,e){return 1==arguments.length?this.tooltip.style(t):(this.tooltip.style(t,e),this)}},{key:"attr",value:function(t,e){return 1==arguments.length?this.tooltip.attr(t):(this.tooltip.attr(t,e),this)}}],n&&vr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),mr={},br={};function gr(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function wr(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function xr(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function Sr(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,o=[],i=t.length,a=0,u=0,l=i<=0,c=!1;function f(){if(l)return br;if(c)return c=!1,mr;var e,r,o=a;if(34===t.charCodeAt(o)){for(;a++<i&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=i?l=!0:10===(r=t.charCodeAt(a++))?c=!0:13===r&&(c=!0,10===t.charCodeAt(a)&&++a),t.slice(o+1,e-1).replace(/""/g,'"')}for(;a<i;){if(10===(r=t.charCodeAt(e=a++)))c=!0;else if(13===r)c=!0,10===t.charCodeAt(a)&&++a;else if(r!==n)continue;return t.slice(o,e)}return l=!0,t.slice(o,i)}for(10===t.charCodeAt(i-1)&&--i,13===t.charCodeAt(i-1)&&--i;(r=f())!==br;){for(var s=[];r!==mr&&r!==br;)s.push(r),r=f();e&&null==(s=e(s,u++))||o.push(s)}return o}function o(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function i(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?(o=(n=t).getUTCHours(),i=n.getUTCMinutes(),a=n.getUTCSeconds(),u=n.getUTCMilliseconds(),isNaN(n)?"Invalid Date":((r=n.getUTCFullYear())<0?"-"+xr(-r,6):r>9999?"+"+xr(r,6):xr(r,4))+"-"+xr(n.getUTCMonth()+1,2)+"-"+xr(n.getUTCDate(),2)+(u?"T"+xr(o,2)+":"+xr(i,2)+":"+xr(a,2)+"."+xr(u,3)+"Z":a?"T"+xr(o,2)+":"+xr(i,2)+":"+xr(a,2)+"Z":i||o?"T"+xr(o,2)+":"+xr(i,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t;var n,r,o,i,a,u}return{parse:function(t,e){var n,o,i=r(t,(function(t,r){if(n)return n(t,r-1);o=t,n=e?function(t,e){var n=gr(t);return function(r,o){return e(n(r),o,t)}}(t,e):gr(t)}));return i.columns=o||[],i},parseRows:r,format:function(e,n){return null==n&&(n=wr(e)),[n.map(a).join(t)].concat(o(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=wr(t)),o(t,e).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}}var _r=Sr(","),Pr=_r.parse,Or=(_r.parseRows,_r.format,_r.formatBody,_r.formatRows,_r.formatRow,_r.formatValue,Sr("\t")),jr=Or.parse;function Cr(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function kr(t,e){return fetch(t,e).then(Cr)}function Er(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=void 0),kr(e,n).then((function(e){return t(e,r)}))}}Or.parseRows,Or.format,Or.formatBody,Or.formatRows,Or.formatRow,Or.formatValue;var Tr=Er(Pr);function Ar(t){return Ar="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},Ar(t)}function Mr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Rr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ar(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ar(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ar(o)?o:String(o)),r)}var o}Er(jr);var Fr=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Rr(this,t),r=r||{},this.url=e,this.resolution=n,this.preprocess=r.preprocess||void 0,this.cellsViewCache=[]}var e,n;return e=t,(n=[{key:"getData",value:function(t,e){throw new Error("Method getData not implemented.")}},{key:"updateViewCache",value:function(t){throw new Error("Method updateViewCache not implemented.")}},{key:"getCellFromPosition",value:function(t,e){var n,r=this.getResolution(),o=r*Math.floor(t.x/r),i=r*Math.floor(t.y/r),a=function(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 Mr(t,e);var n=Object.prototype.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)?Mr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e);try{for(a.s();!(n=a.n()).done;){var u=n.value;if(u.x==o&&u.y==i)return u}}catch(t){a.e(t)}finally{a.f()}}},{key:"getResolution",value:function(){return this.resolution}},{key:"getViewCache",value:function(){return this.cellsViewCache}}])&&zr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ir(t){return Ir="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},Ir(t)}function Lr(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 Br(t,e);var n=Object.prototype.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)?Br(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Br(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Nr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ir(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ir(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ir(o)?o:String(o)),r)}var o}function Zr(t,e){return Zr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zr(t,e)}function Ur(t,e){if(e&&("object"===Ir(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Wr(t){return Wr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wr(t)}var Gr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zr(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Wr(r);if(o){var n=Wr(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ur(this,t)});function a(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Nr(this,a),(n=i.call(this,t,e,r)).cells=[],n.infoLoadingStatus="notLoaded",n}return e=a,(n=[{key:"getData",value:function(t,e){var n=this;return"notLoaded"!=this.infoLoadingStatus||(this.infoLoadingStatus="loading",Tr(this.url).then((function(t){var r,o=Lr(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;i.x=+i.x,i.y=+i.y}}catch(t){o.e(t)}finally{o.f()}if(n.preprocess){n.cells=[];var a,u=Lr(t);try{for(u.s();!(a=u.n()).done;){var l=a.value;0!=n.preprocess(l)&&n.cells.push(l)}}catch(t){u.e(t)}finally{u.f()}}else n.cells=t;e&&e(),n.infoLoadingStatus="loaded"})).catch((function(){n.infoLoadingStatus="failed",n.cells=[]}))),this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,n=Lr(this.cells);try{for(n.s();!(e=n.n()).done;){var r=e.value;+r.x+this.resolution<t.xMin||+r.x-this.resolution>t.xMax||+r.y+this.resolution<t.yMin||+r.y-this.resolution>t.yMax||this.cellsViewCache.push(r)}}catch(t){n.e(t)}finally{n.f()}}}}])&&Dr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Fr);function $r(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function Yr(t,e){return fetch(t,e).then($r)}function Vr(t){return Vr="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},Vr(t)}function Xr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function qr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Vr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Vr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Vr(o)?o:String(o)),r)}var o}function Hr(t,e,n){return e&&qr(t.prototype,e),n&&qr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var Kr=Hr((function t(e,n,r,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.cells=e,this.x=n,this.y=r;var i=o.resolutionGeo,a=o.tileSizeCell;this.extGeo={xMin:o.originPoint.x+i*a*this.x,xMax:o.originPoint.x+i*a*(this.x+1),yMin:o.originPoint.y+i*a*this.y,yMax:o.originPoint.y+i*a*(this.y+1)};var u,l=function(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 Xr(t,e);var n=Object.prototype.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)?Xr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(this.cells);try{for(l.s();!(u=l.n()).done;){var c=u.value;c.x=this.extGeo.xMin+c.x*i,c.y=this.extGeo.yMin+c.y*i}}catch(t){l.e(t)}finally{l.f()}}));function Jr(t,e){if(e){if(0==e.length)return 0;if(t<=e[0])return 0;for(var n=1;n<e.length;n++)if(e[n-1]<t&&t<=e[n])return n;return e.length}}function Qr(t){return Qr="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},Qr(t)}function to(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 eo(t,e);var n=Object.prototype.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)?eo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function eo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function no(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ro(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Qr(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Qr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Qr(o)?o:String(o)),r)}var o}function oo(t,e){return oo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},oo(t,e)}function io(t,e){if(e&&("object"===Qr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ao(t){return ao=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ao(t)}var uo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oo(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ao(r);if(o){var n=ao(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return io(this,t)});function a(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return no(this,a),(n=i.call(this,t,0,r)).app=e,n.info=void 0,n.infoLoadingStatus="notLoaded",n.cache={},n}return e=a,(n=[{key:"loadInfo",value:function(t){var e=this;return this.info||"notLoaded"!==this.infoLoadingStatus?!t||"loaded"!==this.infoLoadingStatus&&"failed"!==this.infoLoadingStatus||t():(this.infoLoadingStatus="loading",Yr(this.url+"info.json").then((function(n){e.info=n,e.resolution=n.resolutionGeo,e.infoLoadingStatus="loaded",t&&t()})).catch((function(){e.infoLoadingStatus="failed"}))),this}},{key:"getTilingEnvelope",value:function(t){if(this.info){var e=this.info.originPoint,n=this.info.resolutionGeo,r=this.info.tileSizeCell;return{xMin:Math.floor((t.xMin-e.x)/(n*r)),xMax:Math.floor((t.xMax-e.x)/(n*r)),yMin:Math.floor((t.yMin-e.y)/(n*r)),yMax:Math.floor((t.yMax-e.y)/(n*r))}}this.loadInfo((function(){}))}},{key:"getData",value:function(t,e){var n=this;if(!this.info)return this;var r=this.getTilingEnvelope(t);if(!r)return this;for(var o=this.info.tilingBounds,i=function(t){for(var i=function(r){if(n.cache[t]||(n.cache[t]={}),n.cache[t][r])return"continue";n.cache[t][r]="loading",Tr(n.url+t+"/"+r+".csv").then((function(o){var i;if(n.preprocess){i=[];var a,u=to(o);try{for(u.s();!(a=u.n()).done;){var l=a.value;0!=n.preprocess(l)&&i.push(l)}}catch(t){u.e(t)}finally{u.f()}}else i=o;if(n.info){var c=new Kr(i,t,r,n.info);if(n.cache[t][r]=c,e){var f,s=!1,h=to(n.app.getActiveLayers());try{for(h.s();!(f=h.n()).done;)if(f.value.getDatasetComponent(n.app.getZoomFactor())==n){s=!0;break}}catch(t){h.e(t)}finally{h.f()}if(s){var y=n.app.updateExtentGeo(),p=c.extGeo;y.xMax<=p.xMin||y.xMin>=p.xMax||y.yMax<=p.yMin||y.yMin>=p.yMax||e()}}}else console.error("Tile info inknown")})).catch((function(){n.cache[t][r]="failed"}))},a=Math.max(r.yMin,o.yMin);a<=Math.min(r.yMax,o.yMax);a++)i(a)},a=Math.max(r.xMin,o.xMin);a<=Math.min(r.xMax,o.xMax);a++)i(a);return this}},{key:"updateViewCache",value:function(t){if(this.cellsViewCache=[],this.info){var e=this.getTilingEnvelope(t);if(e)for(var n=this.info.tilingBounds,r=Math.max(e.xMin,n.xMin);r<=Math.min(e.xMax,n.xMax);r++)if(this.cache[r])for(var o=Math.max(e.yMin,n.yMin);o<=Math.min(e.yMax,n.yMax);o++){var i=this.cache[r][o];if(i&&"string"!=typeof i){var a,u=to(i.cells);try{for(u.s();!(a=u.n()).done;){var l=a.value;+l.x+this.resolution<t.xMin||+l.x-this.resolution>t.xMax||+l.y+this.resolution<t.yMin||+l.y-this.resolution>t.yMax||this.cellsViewCache.push(l)}}catch(t){u.e(t)}finally{u.f()}}}}}}])&&ro(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Fr);function lo(t){return lo="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},lo(t)}function co(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==lo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==lo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===lo(o)?o:String(o)),r)}var o}var fo=function(){function t(e){var n=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.visible=0!=e.visible,this.minZoom=e.minZoom||0,this.maxZoom=e.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");if(this.cache={},this.url=e.url,this.urlFun=e.urlFun||function(t,e,r){return n.url+r+"/"+t+"/"+e+".png"},this.resolutions=e.resolutions,!this.resolutions||0==this.resolutions.length)throw new Error("No resolutions provided for background layer");this.nbPix=e.nbPix||256,this.origin=e.origin||[0,0],this.z0=e.z0||0,this.filterColor=e.filterColor}var e,n;return e=t,n=[{key:"get",value:function(t,e,n){var r=this.cache[t];if(r&&(r=r[e]))return r[n]}},{key:"put",value:function(t,e,n,r){this.cache[e]||(this.cache[e]={}),this.cache[e][n]||(this.cache[e][n]={}),this.cache[e][n][r]=t}},{key:"draw",value:function(t){var e=this;if(this.resolutions&&0!=this.resolutions.length){var n=t.getZf(),r=this.origin[0],o=this.origin[1],i=0;for(i=0;i<this.resolutions.length&&!(this.resolutions[i]<n);i++);i-=1,i=Math.max(0,i),i=Math.min(i,this.resolutions.length-1);var a=this.resolutions[i];i+=this.z0;for(var u=this.nbPix*a,l=u/n,c=function(t){return Math.ceil((t-r)/u)},f=function(t){return Math.ceil(-(t-o)/u)},s=c(t.extGeo.xMin)-1,h=c(t.extGeo.xMax),y=f(t.extGeo.yMin),p=f(t.extGeo.yMax)-1,v=function(n){for(var a=function(a){var c=e.get(i,n,a);if(!c){var f=new Image;return e.put(f,i,n,a),f.onload=function(){t.redraw()},f.onerror=function(){e.put("failed",i,n,a)},f.src=e.urlFun(n,a,i),"continue"}if("failed"===c)return"continue";if(!(c instanceof HTMLImageElement))return console.log(c),"continue";if(0==c.width||0==c.height)return"continue";var s=r+n*u,h=o-a*u;try{t.ctx.drawImage(c,t.geoToPixX(s),t.geoToPixY(h),l,l)}catch(t){console.error(t)}},c=p;c<y;c++)a(c)},d=s;d<h;d++)v(d);if(this.filterColor){var m=this.filterColor(n);m&&"none"!=m&&(t.ctx.fillStyle=m,t.ctx.fillRect(0,0,t.w,t.h))}}else console.error("No resolutions provided for background layer")}}],n&&co(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function so(t){return so="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},so(t)}function ho(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 yo(t,e);var n=Object.prototype.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)?yo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function yo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function po(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==so(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==so(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===so(o)?o:String(o)),r)}var o}var vo=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.url=e.url,this.style=e.style||function(){return"bold 1em Arial"},this.color=e.color||(e.dark?function(){return"#ddd"}:function(){return"#222"}),this.haloColor=e.haloColor||(e.dark?function(){return"#000000BB"}:function(){return"#FFFFFFBB"}),this.haloWidth=e.haloWidth||function(){return 4},this.textAlign=e.textAlign||"start",this.offsetPix=e.offsetPix||[5,5],this.preprocess=e.preprocess,this.labels,this.loadingStatus="notLoaded"}var e,n;return e=t,(n=[{key:"draw",value:function(t){if(this.labels){var e=t.getZf();t.ctx.textAlign=this.textAlign||"start",t.ctx.lineJoin="bevel",t.ctx.lineCap="butt",t.initCanvasTransform();var n,r=ho(this.labels);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.style(o,e);if(i&&(t.ctx.font=i,t.toDraw(o))){var a=t.geoToPixX(o.x)+this.offsetPix[0],u=t.geoToPixY(o.y)-this.offsetPix[1];if(this.haloColor&&this.haloWidth){var l=this.haloColor(o,e),c=this.haloWidth(o,e);l&&c&&c>0&&(t.ctx.strokeStyle=l,t.ctx.lineWidth=c,t.ctx.strokeText(o.name,a,u))}if(this.color){var f=this.color(o,e);f&&(t.ctx.fillStyle=f,t.ctx.fillText(o.name,a,u))}}}}catch(t){r.e(t)}finally{r.f()}}else this.load(t.redraw)}},{key:"load",value:function(t){var e=this;if(!this.url)return console.log("Failed loading labels: No URL specified. "+this.url),this.loadingStatus="failed",void(this.labels=[]);"notLoaded"===this.loadingStatus&&(this.loadingStatus="loading",Tr(this.url).then((function(n){if(e.preprocess){e.labels=[];var r,o=ho(n);try{for(o.s();!(r=o.n()).done;){var i=r.value;0!=e.preprocess(i)&&e.labels.push(i)}}catch(t){o.e(t)}finally{o.f()}}else e.labels=n;e.loadingStatus="loaded",t&&t()})).catch((function(){console.log("Failed loading labels from "+e.url),e.labels=[],e.loadingStatus="failed"})))}}])&&po(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function mo(t){return mo="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},mo(t)}function bo(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 go(t,e);var n=Object.prototype.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)?go(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function go(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function wo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==mo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==mo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===mo(o)?o:String(o)),r)}var o}var xo=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.url=e.url,this.preprocess=e.preprocess,this.color=e.color||function(t,e){return"gray"},this.width=e.width||function(t,e){return 2},this.lineDash=e.lineDash||function(t,e){},this.fs,this.loadingStatus="notLoaded"}var e,n;return e=t,(n=[{key:"draw",value:function(t){if(this.fs){var e=t.getZf();t.setCanvasTransform();var n,r=bo(this.fs);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=o.geometry.coordinates;if(!(i.length<2)){var a=this.color(o,e);if(a&&"none"!=a){t.ctx.strokeStyle=a;var u=this.width(o,e);if(u&&!(u<0)){t.ctx.lineWidth=u*e;var l=this.lineDash(o,e);l&&t.ctx.setLineDash(l),t.ctx.beginPath(),t.ctx.moveTo(i[0][0],i[0][1]);for(var c=1;c<i.length;c++)t.ctx.lineTo(i[c][0],i[c][1]);t.ctx.stroke()}}}}}catch(t){r.e(t)}finally{r.f()}t.ctx.setLineDash([])}else this.load(t.redraw)}},{key:"load",value:function(t){var e=this;if(!this.url)return console.log("Failed loading boundaries: No URL specified. "+this.url),this.loadingStatus="failed",void(this.labels=[]);"notLoaded"===this.loadingStatus&&(this.loadingStatus="loading",Yr(this.url).then((function(n){if(n=n.features,e.preprocess){var r,o=bo(n);try{for(o.s();!(r=o.n()).done;){var i=r.value;e.preprocess(i)}}catch(t){o.e(t)}finally{o.f()}}e.fs=n,e.loadingStatus="loaded",t&&t()})).catch((function(){console.log("Failed loading boundaries from "+e.url),e.fs=[],e.loadingStatus="failed"})))}}])&&wo(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function So(t){return So="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},So(t)}function _o(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 Po(t,e);var n=Object.prototype.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)?Po(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Po(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Oo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==So(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==So(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===So(o)?o:String(o)),r)}var o}var jo=function(){function t(e,n){var r=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=n||{},this.layers=[],e=e||document.getElementById("gridviz")){this.w=n.w||e.offsetWidth,this.h=n.h||e.offsetHeight;var o=document.createElement("canvas");o.setAttribute("width",""+this.w),o.setAttribute("height",""+this.h),e.appendChild(o),this.cg=new Kn(o),this.cg.redraw=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];r.legend&&t&&r.legend.selectAll("*").remove(),r.cg.initCanvasTransform(),r.cg.clear(r.cg.backgroundColor);var e=r.getZoomFactor();r.updateExtentGeo();var n,o=_o(r.bgLayers);try{for(o.s();!(n=o.n()).done;){var i=n.value;i.visible&&(e>i.maxZoom||e<i.minZoom||i.draw(r.cg))}}catch(t){o.e(t)}finally{o.f()}var a,u=_o(r.layers);try{for(u.s();!(a=u.n()).done;){var l=a.value;if(l.visible&&!(e>l.maxZoom||e<l.minZoom)){var c=l.getDatasetComponent(e);if(c){if(t&&c.getData(r.cg.extGeo,(function(){r.cg.redraw()})),t&&c.updateViewCache(r.cg.extGeo),t){var f,s=_o(l.styles);try{for(s.s();!(f=s.n()).done;){var h=f.value;e>h.maxZoom||e<h.minZoom||h.draw(c.getViewCache(),c.getResolution(),r.cg)}}catch(t){s.e(t)}finally{s.f()}}if(r.legend&&t){var y,p=_o(l.styles);try{for(p.s();!(y=p.n()).done;){var v=y.value;if(!(e>v.maxZoom||e<v.minZoom)){var d,m=_o(v.legends);try{for(m.s();!(d=m.n()).done;){var b=d.value;r.legend.node().append(b.div.node())}}catch(t){m.e(t)}finally{m.f()}}}}catch(t){p.e(t)}finally{p.f()}}}}}}catch(t){u.e(t)}finally{u.f()}return r.showBoundaries&&r.boundaryLayer&&r.boundaryLayer.draw(r.cg),r.showLabels&&r.labelLayer&&r.labelLayer.draw(r.cg),r.canvasSave=null,r},this.bgLayers=[],this.showBgLayers=!0,this.labelLayer=void 0,this.showLabels=!0,this.boundaryLayer=void 0,this.showBoundaries=!0,this.legendDivId=n.legendDivId||"gvizLegend",this.legend=mt("#"+this.legendDivId),this.legend.empty()&&(this.legend=mt("body").append("div").attr("id",this.legendDivId).style("position","absolute").style("width","auto").style("height","auto").style("background","#FFFFFFCC").style("border","0px").style("border-radius","5px").style("box-shadow","3px 3px 3px grey, -3px -3px 3px #ddd").style("font-family","Helvetica, Arial, sans-serif").style("top","20px").style("right","20px")),this.tooltip=new dr;var i=function(t){var e={x:r.cg.pixToGeoX(t.offsetX),y:r.cg.pixToGeoY(t.offsetY)},n=r.getCellFocusInfo(e);n?(r.tooltip.setPosition(t),r.tooltip.show(),r.tooltip.html(n.html),r.canvasSave?r.cg.ctx.drawImage(r.canvasSave,0,0):(r.canvasSave=document.createElement("canvas"),r.canvasSave.setAttribute("width",""+r.w),r.canvasSave.setAttribute("height",""+r.h),r.canvasSave.getContext("2d").drawImage(r.cg.canvas,0,0)),r.cg.initCanvasTransform(),r.cg.ctx.strokeStyle=r.selectionRectangleColor,r.cg.ctx.lineWidth=r.selectionRectangleWidthPix,r.cg.ctx.beginPath(),r.cg.ctx.rect(r.cg.geoToPixX(n.cell.x)-r.selectionRectangleWidthPix/2,r.cg.geoToPixY(n.cell.y)+r.selectionRectangleWidthPix/2,n.resolution/r.getZoomFactor()+r.selectionRectangleWidthPix,-n.resolution/r.getZoomFactor()-r.selectionRectangleWidthPix),r.cg.ctx.stroke()):(r.tooltip.hide(),r.canvasSave&&r.cg.ctx.drawImage(r.canvasSave,0,0))};e.addEventListener("mouseover",(function(t){i(t)})),e.addEventListener("mousemove",(function(t){i(t)})),e.addEventListener("mouseout",(function(){r.tooltip.hide()})),this.cg.onZoomStartFun=function(){r.tooltip.hide()},this.canvasSave=null,this.selectionRectangleColor=n.selectionRectangleColor||"red",this.selectionRectangleWidthPix=n.selectionRectangleWidthPix||4}else console.error("Cannot find gridviz container element.")}var e,n;return e=t,n=[{key:"getActiveLayers",value:function(){var t,e=[],n=this.getZoomFactor(),r=_o(this.layers);try{for(r.s();!(t=r.n()).done;){var o=t.value;o.visible&&o.getDatasetComponent(n)&&e.push(o)}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"hideAllLayers",value:function(){var t,e=_o(this.layers);try{for(e.s();!(t=e.n()).done;)t.value.visible=!1}catch(t){e.e(t)}finally{e.f()}return this}},{key:"updateExtentGeo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return this.cg.updateExtentGeo(t)}},{key:"getCellFocusInfo",value:function(t){var e=this.getActiveLayers(),n=e[e.length-1];if(n){var r=n.getDatasetComponent(this.getZoomFactor());if(r){var o=r.getCellFromPosition(t,r.getViewCache());if(o)return{cell:o,html:n.cellInfoHTML(o,r.getResolution()),resolution:r.getResolution()}}}}},{key:"getGeoCenter",value:function(){return this.cg.getCenter()}},{key:"setGeoCenter",value:function(t){return this.cg.setCenter(t),this}},{key:"getZoomFactor",value:function(){return this.cg.getZf()}},{key:"setZoomFactor",value:function(t){return this.cg.setZf(t),this}},{key:"getZoomFactorExtent",value:function(){return this.cg.getZfExtent()}},{key:"setZoomFactorExtent",value:function(t){return this.cg.setZfExtent(t),this}},{key:"getBackgroundColor",value:function(){return this.cg.backgroundColor}},{key:"setBackgroundColor",value:function(t){return this.cg.backgroundColor=t,this}},{key:"getBoundaryLayer",value:function(){return this.boundaryLayer}},{key:"setBoundaryLayer",value:function(t){return this.boundaryLayer=new xo(t),this}},{key:"getLabelLayer",value:function(){return this.labelLayer}},{key:"setLabelLayer",value:function(t){return this.labelLayer=new vo(t),this}},{key:"redraw",value:function(){return this.cg.redraw(),this}},{key:"addLayerFromDataset",value:function(t,e,n){var r=new ar(t,e,n);return this.layers.push(r),this}},{key:"makeTiledCSVGridDataset",value:function(t,e){var n=this;return new hr([new uo(t,this,e).loadInfo((function(){n.cg.redraw()}))],[],e)}},{key:"makeMultiScaleCSVGridDataset",value:function(t,e,n){var r=this;return hr.make(t,(function(t){return new Gr(e(t),t,n).getData(void 0,(function(){r.cg.redraw()}))}),n)}},{key:"makeMultiScaleTiledCSVGridDataset",value:function(t,e,n){var r=this;return hr.make(t,(function(t){return new uo(e(t),r,n).loadInfo((function(){r.cg.redraw()}))}),n)}},{key:"addCSVGridLayer",value:function(t,e,n,r){var o=this.makeCSVGridDataset(t,e,r);return this.addLayerFromDataset(o,n,r)}},{key:"addParquetGridLayer",value:function(t,e,n,r){var o=this.makeParquetGridDataset(t,e,r);return this.addLayerFromDataset(o,n,r)}},{key:"addTiledCSVGridLayer",value:function(t,e,n){var r=this.makeTiledCSVGridDataset(t,n);return this.addLayerFromDataset(r,e,n)}},{key:"addMultiScaleCSVGridLayer",value:function(t,e,n,r){var o=this.makeMultiScaleCSVGridDataset(t,e,r);return this.addLayerFromDataset(o,n,r)}},{key:"addMultiScaleTiledCSVGridLayer",value:function(t,e,n,r){var o=this.makeMultiScaleTiledCSVGridDataset(t,e,r);return this.addLayerFromDataset(o,n,r)}},{key:"addBackgroundLayer",value:function(t){return this.bgLayers.push(new fo(t)),this.redraw(),this}},{key:"addZoomSlider",value:function(t,e){return this.cg.addZoomSlider(t,e),this}},{key:"setViewFromURL",value:function(){return this.cg.setViewFromURL(),this}}],n&&Oo(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Co(t){return Co="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},Co(t)}function ko(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Eo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Co(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Co(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Co(o)?o:String(o)),r)}var o}function To(t,e){return To=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},To(t,e)}function Ao(t,e){if(e&&("object"===Co(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Mo(t){return Mo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mo(t)}var Ro=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&To(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Mo(r);if(o){var n=Mo(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ao(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.sizeCol=t.sizeCol,e.size=t.size,e.shape=t.shape||function(){return"square"},e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r,o,i=this,a=n.getZf();this.sizeCol&&(t.sort((function(t,e){return e[i.sizeCol]-t[i.sizeCol]})),r=nr.getStatistics(t,(function(t){return t[i.sizeCol]}),!0)),this.colorCol&&(o=nr.getStatistics(t,(function(t){return t[i.colorCol]}),!0)),n.setCanvasTransform();var u,l=.5*e,c=function(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 ko(t,e);var n=Object.prototype.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)?ko(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(u=c.n()).done;){var f=u.value,s=this.color?this.color(f[this.colorCol],e,o):void 0;if(s&&"none"!==s){n.ctx.fillStyle=s;var h=this.shape?this.shape(f):"square";if("none"!==h){var y=(this.size||function(){return e})(f[this.sizeCol],e,r,a),p=this.offset(f,e,a);if("square"===h){var v=e*(1-y/e)*.5;n.ctx.fillRect(f.x+v+p.dx,f.y+v+p.dy,y,y)}else if("circle"===h)n.ctx.beginPath(),n.ctx.arc(f.x+l+p.dx,f.y+l+p.dy,.5*y,0,2*Math.PI,!1),n.ctx.fill();else if("donut"===h){var d=f.x+l+p.dx,m=f.y+l+p.dy;n.ctx.beginPath(),n.ctx.moveTo(d,m),n.ctx.arc(d,m,l,0,2*Math.PI),n.ctx.arc(d,m,(1-y/e)*l,0,2*Math.PI,!0),n.ctx.closePath(),n.ctx.fill()}else{if("diamond"!==h)throw new Error("Unexpected shape:"+h);var b=.5*y;n.ctx.beginPath(),n.ctx.moveTo(f.x+l-b,f.y+l),n.ctx.lineTo(f.x+l,f.y+l+b),n.ctx.lineTo(f.x+l+b,f.y+l),n.ctx.lineTo(f.x+l,f.y+l-b),n.ctx.fill()}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:a,sSize:r,sColor:o})}}])&&Eo(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function zo(t){return zo="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},zo(t)}function Fo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Io(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==zo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==zo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===zo(o)?o:String(o)),r)}var o}function Lo(t,e){return Lo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Lo(t,e)}function Bo(t,e){if(e&&("object"===zo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function No(t){return No=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},No(t)}var Do=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Lo(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=No(r);if(o){var n=No(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Bo(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.strokeColorCol=t.strokeColorCol,e.strokeColor=t.strokeColor||function(){return"#666"},e.sizeCol=t.sizeCol,e.size=t.size,e.strokeWidthCol=t.strokeWidthCol,e.strokeWidth=t.strokeWidth,e.shape=t.shape||function(){return"square"},e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r,o,i,a=this,u=n.getZf();this.strokeColorCol&&(r=nr.getStatistics(t,(function(t){return t[a.strokeColorCol]}),!0)),this.sizeCol&&(o=nr.getStatistics(t,(function(t){return t[a.sizeCol]}),!0)),this.strokeWidthCol&&(i=nr.getStatistics(t,(function(t){return t[a.strokeWidthCol]}),!0)),n.setCanvasTransform();var l,c=.5*e,f=function(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 Fo(t,e);var n=Object.prototype.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)?Fo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(f.s();!(l=f.n()).done;){var s=l.value,h=this.strokeColor?this.strokeColor(s[this.strokeColorCol],e,r):void 0;if(h&&"none"!==h){n.ctx.strokeStyle=h;var y=(this.size||function(){return e})(s[this.sizeCol],e,o,u),p=this.strokeWidth?this.strokeWidth(s[this.strokeWidthCol],e,i,u):1*u;if(p&&!(p<=0)){n.ctx.lineWidth=p;var v=this.shape?this.shape(s):"square";if("none"!==v){var d=this.offset(s,e,u);if("square"===v){var m=e*(1-y/e)*.5;n.ctx.beginPath(),n.ctx.rect(s.x+m+d.dx,s.y+m+d.dy,y,y),n.ctx.stroke()}else if("circle"===v)n.ctx.beginPath(),n.ctx.arc(s.x+c+d.dx,s.y+c+d.dy,.5*y,0,2*Math.PI,!1),n.ctx.stroke();else if("diamond"===v){var b=.5*y;n.ctx.beginPath(),n.ctx.moveTo(s.x+c-b,s.y+c),n.ctx.lineTo(s.x+c,s.y+c+b),n.ctx.lineTo(s.x+c+b,s.y+c),n.ctx.lineTo(s.x+c,s.y+c-b),n.ctx.lineTo(s.x+c-b,s.y+c),n.ctx.stroke()}else{if("donut"!==v)throw new Error("Unexpected shape:"+v);console.error("Not implemented")}}}}}}catch(t){f.e(t)}finally{f.f()}}}])&&Io(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function Zo(t){return Zo="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},Zo(t)}function Uo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Wo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Zo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Zo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Zo(o)?o:String(o)),r)}var o}function Go(t,e){return Go=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Go(t,e)}function $o(t,e){if(e&&("object"===Zo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Yo(t){return Yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yo(t)}var Vo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Go(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Yo(r);if(o){var n=Yo(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return $o(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.heightCol=t.heightCol,e.height=t.height||function(t){return Math.sqrt(t)},e.lineColor=t.lineColor||function(t,e,n,r){return"#BBB"},e.lineWidth=t.lineWidth||function(t,e,n,r){return r},e.fillColor=t.fillColor||function(t,e,n,r){return"#c08c5968"},e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this;n.ctx.lineJoin="round";var o,i=n.getZf(),a=nr.getStatistics(t,(function(t){return t[r.heightCol]}),!0),u={},l=function(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 Uo(t,e);var n=Object.prototype.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)?Uo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(o=l.n()).done;){var c=o.value,f=u[c.y];f||(f={},u[c.y]=f),f[c.x]=this.height(c[this.heightCol],e,a,i)}}catch(t){l.e(t)}finally{l.f()}var s=n.extGeo;if(s){var h=Math.floor(s.xMin/e)*e,y=Math.floor(s.xMax/e)*e,p=Math.floor(s.yMin/e)*e,v=Math.floor(s.yMax/e)*e,d={min:p,max:v};n.setCanvasTransform();for(var m=v;m>=p;m-=e){var b=u[m];if(b){n.ctx.beginPath(),n.ctx.moveTo(h-e/2,m);for(var g=void 0,w=h;w<=y;w+=e){var x=b[w];x||(x=0),x||g?n.ctx.lineTo(w+e/2,m+x):n.ctx.moveTo(w+e/2,m),g=x}g&&n.ctx.lineTo(y+e/2,m);var S=this.fillColor(m,d,e,i);S&&"none"!=S&&(n.ctx.fillStyle=S,n.ctx.fill());var _=this.lineColor(m,d,e,i),P=this.lineWidth(m,d,e,i);_&&"none"!=_&&P>0&&(n.ctx.strokeStyle=_,n.ctx.lineWidth=P,n.ctx.stroke())}}}}}])&&Wo(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function Xo(t){return Xo="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},Xo(t)}function qo(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 r,o,i,a,u=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||Ho(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 Ho(t,e){if(t){if("string"==typeof t)return Ko(t,e);var n=Object.prototype.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)?Ko(t,e):void 0}}function Ko(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Jo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Xo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Xo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Xo(o)?o:String(o)),r)}var o}function Qo(t,e){return Qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qo(t,e)}function ti(t,e){if(e&&("object"===Xo(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ei(t){return ei=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ei(t)}var ni=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qo(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ei(r);if(o){var n=ei(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return ti(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.color=t.color,e.type=t.type,e.sizeCol=t.sizeCol,e.size=t.size||function(t,e,n,r){return e},e.stripesOrientation=t.stripesOrientation||function(){return 0},e.offsetAngle=t.offsetAngle||function(){return 0},e.agePyramidHeight=t.agePyramidHeight||function(t,e,n){return e},e.pieChartInternalRadiusFactor=t.pieChartInternalRadiusFactor||0,e}return e=a,n=[{key:"draw",value:function(t,e,n){var r,o=this,i=n.getZf();this.sizeCol&&(t.sort((function(t,e){return e[o.sizeCol]-t[o.sizeCol]})),r=nr.getStatistics(t,(function(t){return t[o.sizeCol]}),!0));var a=Object.entries(this.color).length;n.setCanvasTransform();var u,l=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Ho(t))){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(u=l.n()).done;){var c=u.value,f=(this.size||function(){return e})(c[this.sizeCol],e,r,i),s=this.offset(c,e,i),h=this.type?this.type(c):"flag",y=c.x+s.dx+("agepyramid"===h?0:.5*e),p=c.y+s.dy+("agepyramid"===h?0:.5*e);if("agepyramid"===h||"radar"===h||"halftone"===h){for(var v=-1/0,d=0,m=Object.keys(this.color);d<m.length;d++){var b=+c[m[d]];b>v&&(v=b)}var g=0;"agepyramid"===h&&this.agePyramidHeight&&(g=(e-this.agePyramidHeight(c,e,i))/2),"radar"!==h&&"halftone"!==h||(g=Math.PI/2+(this.offsetAngle?this.offsetAngle(c,e,i)*Math.PI/180:0));var w="agepyramid"===h?(this.agePyramidHeight?this.agePyramidHeight(c,e,i):e)/a:"radar"===h||"halftone"===h?2*Math.PI/a:void 0;if(void 0===w)throw new Error("Unexpected symbol type:"+h);for(var x=0,S=Object.entries(this.color);x<S.length;x++){var _=qo(S[x],2),P=_[0],O=_[1];if("agepyramid"===h){n.ctx.fillStyle=O;var j=f*c[P]/v;n.ctx.fillRect(y+(e-j)/2,p+g,j,w),g+=w}else if("radar"===h){n.ctx.fillStyle=O;var C=c[P],k=f/2*Math.sqrt(C/v);n.ctx.beginPath(),n.ctx.moveTo(y,p),n.ctx.arc(y,p,k,g-w,g),n.ctx.lineTo(y,p),n.ctx.fill(),g+=w}else{if("halftone"!==h)throw new Error("Unexpected symbol type:"+h);n.ctx.fillStyle=O;var E=c[P],T=.333*f*Math.sqrt(E/v);n.ctx.beginPath(),n.ctx.arc(y+.25*e*Math.cos(g),p+.25*e*Math.sin(g),T,0,2*Math.PI),n.ctx.fill(),g+=w}}}else{for(var A=0,M=0,R=Object.keys(this.color);M<R.length;M++){var z=+c[R[M]];z&&(A+=z)}if(!A||isNaN(A))continue;for(var F=0,I=e*(1-f/e)*.5,L=this.stripesOrientation(c,e,i),B=0,N=Object.entries(this.color);B<N.length;B++){var D=qo(N[B],2),Z=D[0],U=D[1],W=c[Z]/A;if(W&&!isNaN(W)){if(n.ctx.fillStyle=U,"flag"===h)0==L?n.ctx.fillRect(c.x+I+s.dx,c.y+I+F*f+s.dy,f,W*f):n.ctx.fillRect(c.x+I+F*f+s.dx,c.y+I+s.dy,W*f,f);else if("piechart"===h){var G=2*F*Math.PI,$=2*(F+W)*Math.PI;n.ctx.beginPath(),n.ctx.moveTo(y,p),n.ctx.arc(y,p,.5*f,G,$),this.pieChartInternalRadiusFactor&&n.ctx.arc(y,p,.5*f*this.pieChartInternalRadiusFactor,G,$,!0),n.ctx.closePath(),n.ctx.fill()}else if("ring"===h)n.ctx.beginPath(),n.ctx.arc(y,p,Math.sqrt(1-F)*f*.5,0,2*Math.PI),n.ctx.fill();else{if("segment"!==h)throw new Error("Unexpected symbol type:"+h);var Y=f*f/e;0==L?n.ctx.fillRect(c.x+s.dx,c.y+(e-Y)/2+F*Y+s.dy,e,W*Y):n.ctx.fillRect(c.x+F*e+s.dx,c.y+(e-Y)/2+s.dy,W*e,Y)}F+=W}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,r:e,zf:i,sSize:r})}}],n&&Jo(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function ri(t){return ri="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},ri(t)}function oi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ii(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ri(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ri(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ri(o)?o:String(o)),r)}var o}function ai(t,e){return ai=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ai(t,e)}function ui(t,e){if(e&&("object"===ri(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function li(t){return li=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},li(t)}var ci=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ai(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=li(r);if(o){var n=li(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return ui(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.orientation=t.orientation||function(){return 0},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.lengthCol=t.lengthCol,e.length=t.length,e.widthCol=t.widthCol,e.width=t.width,e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r,o,i,a=this,u=n.getZf();this.colorCol&&(r=nr.getStatistics(t,(function(t){return t[a.colorCol]}),!0)),this.lengthCol&&(t.sort((function(t,e){return e[a.lengthCol]-t[a.lengthCol]})),o=nr.getStatistics(t,(function(t){return t[a.lengthCol]}),!0)),this.widthCol&&(i=nr.getStatistics(t,(function(t){return t[a.widthCol]}),!0)),n.ctx.lineCap="butt";var l=Math.PI/180;n.setCanvasTransform();var c,f=function(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 oi(t,e);var n=Object.prototype.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)?oi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(f.s();!(c=f.n()).done;){var s=c.value,h=this.color?this.color(s[this.colorCol],e,r):void 0;if(h){var y=this.width?this.width(s[this.widthCol],e,i,u):void 0;if(y&&!(y<0)){var p=this.length?this.length(s[this.lengthCol],e,o,u):void 0;if(p&&!(p<0)){var v=this.orientation(s)*l;if(void 0!==v&&!isNaN(v)){var d=this.offset(s,e,u);n.ctx.strokeStyle=h,n.ctx.lineWidth=y;var m=s.x+e/2+d.dx,b=s.y+e/2+d.dy,g=.5*Math.cos(v)*p,w=.5*Math.sin(v)*p;n.ctx.beginPath(),n.ctx.moveTo(m-g,b-w),n.ctx.lineTo(m+g,b+w),n.ctx.stroke()}}}}}}catch(t){f.e(t)}finally{f.f()}this.updateLegends({style:this,r:e,zf:u,sColor:r,sLength:o,sWidth:i})}}])&&ii(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function fi(t){return fi="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},fi(t)}function si(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function hi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==fi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==fi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===fi(o)?o:String(o)),r)}var o}function yi(t,e){return yi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yi(t,e)}function pi(t,e){if(e&&("object"===fi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function vi(t){return vi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vi(t)}var di=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yi(t,e)}(u,t);var e,n,r,o,i,a=(o=u,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=vi(o);if(i){var n=vi(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return pi(this,t)});function u(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),e=a.call(this,t),t=t||{},e.textCol=t.textCol,e.text=t.text||function(t,e,n,r){return"X"},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.fontSizeCol=t.fontSizeCol,e.fontSize=t.fontSize||function(t,e,n,r){return e-2},e.fontFamily=t.fontFamily||"Arial",e.fontWeight=t.fontWeight||"bold",e}return e=u,r=[{key:"getCharLegendFun",value:function(t){var e=t.length;return function(n){return 0==n?"":1==n?t[e-1]:t[Math.floor(n*e)]}}}],(n=[{key:"draw",value:function(t,e,n){var r,o,i,a=this,u=n.getZf();this.textCol&&(r=nr.getStatistics(t,(function(t){return t[a.textCol]}),!0)),this.colorCol&&(o=nr.getStatistics(t,(function(t){return t[a.colorCol]}),!0)),this.fontSizeCol&&(t.sort((function(t,e){return e[a.fontSizeCol]-t[a.fontSizeCol]})),i=nr.getStatistics(t,(function(t){return t[a.fontSizeCol]}),!0));var l,c=function(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 si(t,e);var n=Object.prototype.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)?si(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(l=c.n()).done;){var f=l.value,s=this.text?this.text(f[this.textCol],e,r):void 0;if(s){var h=this.color?this.color(f[this.colorCol],e,o):void 0;if(h){n.ctx.fillStyle=h;var y=(this.fontSize||function(){return e/u-2})(f[this.fontSizeCol],e,i,u)/u,p=this.fontFamily||"Arial",v=this.fontWeight||"bold";n.ctx.font=v+" "+y+"px "+p;var d=this.offset(f,e,u);n.ctx.textAlign="center";var m=n.geoToPixX(f.x+.5*e+d.dx),b=n.geoToPixY(f.y+.5*e+d.dy)+.5*y;n.ctx.fillText(s,m,b)}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:u,sColor:o})}}])&&hi(e.prototype,n),r&&hi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),u}(nr);function mi(t){return mi="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},mi(t)}function bi(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 gi(t,e);var n=Object.prototype.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)?gi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function gi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function wi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==mi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==mi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===mi(o)?o:String(o)),r)}var o}function xi(t,e){return xi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xi(t,e)}function Si(t,e){if(e&&("object"===mi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _i(t){return _i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_i(t)}var Pi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xi(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=_i(r);if(o){var n=_i(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Si(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.value=t.value,e.sigma=t.sigma,e.styles=t.styles,e}return e=a,(n=[{key:"getKernelMatrix",value:function(t){for(var e,n,r=Math.floor(3*t),o=2*t*t,i=[],a=0;a<=r;a++){for(var u=[],l=0;l<=r;l++){var c=(e=a,n=l,Math.exp(-(e*e+n*n)/o));u.push({w:c,val:0})}i.push(u)}return i}},{key:"kernelSmoothing",value:function(t,e,n,r){var o,i=Math.floor(e.xMin/n)*n,a=Math.floor(e.xMax/n)*n,u=Math.floor(e.yMin/n)*n,l=Math.floor(e.yMax/n)*n,c=(a-i)/n+1,f=(l-u)/n+1,s=bi(t);try{for(s.s();!(o=s.n()).done;)o.value.ksmval=0}catch(t){s.e(t)}finally{s.f()}var h,y={},p=bi(t);try{for(p.s();!(h=p.n()).done;){var v=h.value,d=Math.floor((v.x-i)/n),m=Math.floor((v.y-u)/n);y[d]||(y[d]={}),y[d][m]=v}}catch(t){p.e(t)}finally{p.f()}for(var b=this.getKernelMatrix(r),g=b.length,w=0,x=Object.keys(y);w<x.length;w++)for(var S=x[w],_=+S,P=0,O=Object.keys(y[S]);P<O.length;P++){var j=+O[P],C=y[_][j];if(!C.notInputCell){var k=this.value(C);if(k){for(var E=0,T=0;T<g;T++)for(var A=0;A<g;A++){var M=b[T][A];M.val=M.w*k,E+=M.w}for(var R=function(t,e){return t>=0&&t<c&&e>=0&&e<f},z=function(t,e,r){var o=y[t]?y[t][e]:void 0;o?o.ksmval?o.ksmval+=r:o.ksmval=r:(y[t]||(y[t]={}),y[t][e]={x:i+t*n,y:u+e*n,ksmval:r,notInputCell:!0})},F=0;F<g;F++)for(var I=0;I<g;I++){var L=b[Math.abs(F)][Math.abs(I)];if(L){var B=L.val;B&&(B/=E)&&(R(_+F,j+I)&&z(_+F,j+I,B),0==F&&0==I||(R(_-F,j+I)&&z(_-F,j+I,B),0!=F&&(R(_+F,j-I)&&z(_+F,j-I,B),R(_-F,j-I)&&z(_-F,j-I,B))))}}}}}for(var N=[],D=0,Z=Object.keys(y);D<Z.length;D++)for(var U=Z[D],W=0,G=Object.keys(y[U]);W<G.length;W++){var $=G[W];N.push(y[U][$])}return N}},{key:"draw",value:function(t,e,n){if(t&&0!=t.length){var r=this.sigma(e,n.zf);t=this.kernelSmoothing(t,n.extGeo,e,r/e);var o,i=bi(this.styles);try{for(i.s();!(o=i.n()).done;)o.value.draw(t,e,n)}catch(t){i.e(t)}finally{i.f()}}}}])&&wi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function Oi(t){return Oi="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},Oi(t)}function ji(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 Ci(t,e);var n=Object.prototype.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)?Ci(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ci(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ki(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Oi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Oi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Oi(o)?o:String(o)),r)}var o}function Ei(t,e){return Ei=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ei(t,e)}function Ti(t,e){if(e&&("object"===Oi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ai(t){return Ai=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ai(t)}var Mi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ei(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ai(r);if(o){var n=Ai(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ti(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.heightCol=t.heightCol,e.height=t.height,e.colorCol=t.colorCol,e.color=t.color||function(){return"#c08c59"},e.widthCol=t.widthCol,e.width=t.width||function(t,e){return.5*e},e.simple=null!=t.simple,e.viewHeightFactor=t.viewHeightFactor||1.5,e.viewSX=null==t.viewSX?0:t.viewSX,e.viewSY=null==t.viewSY?-.5:t.viewSY,e.shadowDirection=null==t.shadowDirection?-40.3*Math.PI/180:t.shadowDirection,e.shadowFactor=t.shadowFactor||.3,e.shadowColor=t.shadowColor||"#00000033",e.outlineCol=t.outlineCol||"#FFFFFF",e.outlineWidthPix=null==t.outlineWidthPix?.5:t.outlineWidthPix,e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r,o,i,a=this,u=n.getZf();this.heightCol&&(r=nr.getStatistics(t,(function(t){return t[a.heightCol]}),!0)),this.colorCol&&(o=nr.getStatistics(t,(function(t){return t[a.colorCol]}),!0)),this.widthCol&&(i=nr.getStatistics(t,(function(t){return t[a.widthCol]}),!0));var l=n.getCenter().x+this.viewSX*n.w*u,c=n.getCenter().y+this.viewSY*n.h*u,f=this.viewHeightFactor*(n.w+n.h)*.5*u;t.sort((function(t,e){return 1e8*(e.y-t.y)+t.x-e.x})),n.ctx.lineCap=this.simple?"butt":"round",n.setCanvasTransform(),n.ctx.strokeStyle=this.shadowColor,n.ctx.fillStyle=this.shadowColor;var s,h=ji(t);try{for(h.s();!(s=h.n()).done;){var y=s.value,p=this.width?this.width(y[this.widthCol],e,i,u):void 0;if(p&&!(p<0)){var v=this.height?this.height(y[this.heightCol],e,r,u):void 0;if(v&&!(v<0)){this.offset(y,e,u),n.ctx.lineWidth=p;var d=y.x+e/2,m=y.y+e/2,b=v*this.shadowFactor;n.ctx.beginPath(),n.ctx.moveTo(d,m),n.ctx.lineTo(d+b*Math.cos(this.shadowDirection),m+b*Math.sin(this.shadowDirection)),n.ctx.stroke()}}}}catch(t){h.e(t)}finally{h.f()}var g,w=ji(t);try{for(w.s();!(g=w.n()).done;){var x=g.value,S=this.color?this.color(x[this.colorCol],e,o):void 0;if(S){var _=this.width?this.width(x[this.widthCol],e,i,u):void 0;if(_&&!(_<0)){var P=this.height?this.height(x[this.heightCol],e,r,u):void 0;if(P&&!(P<0)){this.offset(x,e,u);var O=x.x+e/2,j=x.y+e/2,C=O-l,k=j-c,E=Math.atan2(k,C),T=Math.sqrt(C*C+k*k)*P/(f-P);this.simple?(n.ctx.strokeStyle=S,n.ctx.lineWidth=_,n.ctx.beginPath(),n.ctx.moveTo(O,j),n.ctx.lineTo(O+T*Math.cos(E),j+T*Math.sin(E)),n.ctx.stroke()):(n.ctx.strokeStyle=this.outlineCol,n.ctx.lineWidth=_+2*this.outlineWidthPix*u,n.ctx.beginPath(),n.ctx.moveTo(O,j),n.ctx.lineTo(O+T*Math.cos(E),j+T*Math.sin(E)),n.ctx.stroke(),n.ctx.strokeStyle=S,n.ctx.lineWidth=_,n.ctx.beginPath(),n.ctx.moveTo(O,j),n.ctx.lineTo(O+T*Math.cos(E),j+T*Math.sin(E)),n.ctx.stroke(),n.ctx.strokeStyle=this.outlineCol,n.ctx.lineWidth=this.outlineWidthPix*u,n.ctx.beginPath(),n.ctx.arc(O+T*Math.cos(E),j+T*Math.sin(E),.5*_,0,2*Math.PI,!1),n.ctx.stroke())}}}}}catch(t){w.e(t)}finally{w.f()}n.ctx.lineCap="butt",this.updateLegends({style:this,r:e,zf:u,sColor:o})}}])&&ki(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function Ri(t){return Ri="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},Ri(t)}function zi(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 Fi(t,e);var n=Object.prototype.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)?Fi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Fi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ii(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ri(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ri(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ri(o)?o:String(o)),r)}var o}function Li(t,e){return Li=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Li(t,e)}function Bi(t,e){if(e&&("object"===Ri(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ni(t){return Ni=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ni(t)}var Di=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Li(t,e)}(u,t);var e,n,r,o,i,a=(o=u,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ni(o);if(i){var n=Ni(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Bi(this,t)});function u(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),e=a.call(this,t),t=t||{},e.valueCol=t.valueCol,e.value=t.value||function(t,e,n,r,o){return 1},e.color=t.color||function(){return"#EA6BAC"},e.width=t.width||function(t,e,n,r){return e*t.value/5},e.orientation=t.orientation||0,e.fillColor=t.fillColor,e}return e=u,r=[{key:"getSideStatistics",value:function(t,e){if(t&&0!=t.length){var n,r=1/0,o=-1/0,i=zi(t);try{for(i.s();!(n=i.n()).done;){var a=n.value.value;e&&!a||(a<r&&(r=a),a>o&&(o=a))}}catch(t){i.e(t)}finally{i.f()}return{min:r,max:o}}}}],(n=[{key:"draw",value:function(t,e,n){var r,o=this,i=n.getZf();this.valueCol&&(r=nr.getStatistics(t,(function(t){return t[o.valueCol]}),!0));var a=[];t.sort((function(t,e){return e.x==t.x?t.y-e.y:t.x-e.x}));for(var l=t[0],c=1;c<t.length;c++){var f=t[c];l.y+e==f.y&&l.x==f.x?a.push({x:l.x,y:f.y,or:"h",value:this.value(l[this.valueCol],f[this.valueCol],e,r,i)}):(a.push({x:l.x,y:l.y+e,or:"h",value:this.value(l[this.valueCol],void 0,e,r,i)}),a.push({x:f.x,y:f.y,or:"h",value:this.value(void 0,f[this.valueCol],e,r,i)})),l=f}t.sort((function(t,e){return e.y==t.y?t.x-e.x:t.y-e.y})),l=t[0];for(var s=1;s<t.length;s++){var h=t[s];l.x+e==h.x&&l.y==h.y?a.push({x:l.x+e,y:l.y,or:"v",value:this.value(l[this.valueCol],h[this.valueCol],e,r,i)}):(a.push({x:l.x+e,y:l.y,or:"v",value:this.value(l[this.valueCol],void 0,e,r,i)}),a.push({x:h.x,y:h.y,or:"v",value:this.value(void 0,h[this.valueCol],e,r,i)})),l=h}if(0!=a.length){var y=u.getSideStatistics(a,!0);if(n.setCanvasTransform(),this.fillColor){var p,v=zi(t);try{for(v.s();!(p=v.n()).done;){var d=p.value,m=this.fillColor(d);m&&"none"!=m&&(n.ctx.fillStyle=m,n.ctx.fillRect(d.x,d.y,e,e))}}catch(t){v.e(t)}finally{v.f()}}n.ctx.lineCap="butt";for(var b=e/2,g=0,w=a;g<w.length;g++){var x=w[g],S=this.color?this.color(x,e,y,i):void 0;if(S&&"none"!=S){var _=this.width?this.width(x,e,y,i):void 0;!_||_<=0||(n.ctx.strokeStyle=S,n.ctx.lineWidth=_,n.ctx.beginPath(),90==this.orientation?(n.ctx.moveTo(x.x+b,x.y+b),"h"===x.or?n.ctx.lineTo(x.x+b,x.y-b):n.ctx.lineTo(x.x-b,x.y+b)):(n.ctx.moveTo(x.x,x.y),n.ctx.lineTo(x.x+("h"===x.or?e:0),x.y+("v"===x.or?e:0))),n.ctx.stroke())}}this.updateLegends({style:this,r:e,zf:i})}}}])&&Ii(e.prototype,n),r&&Ii(e,r),Object.defineProperty(e,"prototype",{writable:!1}),u}(nr);function Zi(t){return Zi="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},Zi(t)}function Ui(t,e){return Ui=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ui(t,e)}function Wi(t,e){if(e&&("object"===Zi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Gi(t){return Gi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gi(t)}var $i=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ui(t,e)}(i,t);var e,n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Gi(n);if(r){var o=Gi(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return Wi(this,t)});function i(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),(t=t||{}).breaks=t.breaks||[100,1e3,1e4,1e5,1e6],t.width=t.width||function(){return 1},t.color=t.color||function(){return"#E7A935"};var n=function(e){if(null==e)return 0;for(var n=0;n<t.breaks.length;n++)if(e<t.breaks[n])return n;return t.breaks.length};return e.value=function(t,e,r,o,i){return Math.abs(n(e)-n(t))},e.color=function(e,n,r,o){return e.value?t.color(e,n,o):void 0},e.width=function(e,n,r,o){return e.value*o*t.width(e,n,o)},e}return e=i,Object.defineProperty(e,"prototype",{writable:!1}),e}(Di);function Yi(t){return Yi="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},Yi(t)}function Vi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Xi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Yi(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Yi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Yi(o)?o:String(o)),r)}var o}function qi(t,e){return qi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qi(t,e)}function Hi(t,e){if(e&&("object"===Yi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ki(t){return Ki=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ki(t)}var Ji=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&qi(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ki(r);if(o){var n=Ki(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Hi(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.col=t.col,e.color=t.color,e.width=t.width||function(t,e,n){return.2*e},e.fillColor=t.fillColor,e}return e=a,(n=[{key:"draw",value:function(t,e,n){if(t&&0!=t.length){var r=n.getZf(),o=[];t.sort((function(t,e){return e.x==t.x?t.y-e.y:t.x-e.x}));for(var i=t[0],a=i[this.col],u=1;u<t.length;u++){var l=t[u],c=l[this.col];i.y+e==l.y&&i.x==l.x?a!=c&&o.push({x:i.x,y:l.y,or:"h",v1:a,v2:c}):(o.push({x:i.x,y:i.y+e,or:"h",v1:a,v2:void 0}),o.push({x:l.x,y:l.y,or:"h",v1:void 0,v2:c})),i=l,a=c}t.sort((function(t,e){return e.y==t.y?t.x-e.x:t.y-e.y})),a=(i=t[0])[this.col];for(var f=1;f<t.length;f++){var s=t[f],h=s[this.col];i.x+e==s.x&&i.y==s.y?a!=h&&o.push({x:i.x+e,y:i.y,or:"v",v1:a,v2:h}):(o.push({x:i.x+e,y:i.y,or:"v",v1:a,v2:void 0}),o.push({x:s.x,y:s.y,or:"v",v1:void 0,v2:h})),i=s,a=h}if(0!=o.length){if(n.setCanvasTransform(),this.fillColor){var y,p=function(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 Vi(t,e);var n=Object.prototype.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)?Vi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(p.s();!(y=p.n()).done;){var v=y.value,d=this.fillColor(v);d&&"none"!=d&&(n.ctx.fillStyle=d,n.ctx.fillRect(v.x,v.y,e,e))}}catch(t){p.e(t)}finally{p.f()}}n.ctx.lineCap="butt";for(var m=0,b=o;m<b.length;m++){var g=b[m],w=this.width?this.width(g,e,r):void 0;if(w&&!(w<=0)){var x=.5*w;n.ctx.lineWidth=w,"h"===g.or?(g.v2&&(n.ctx.beginPath(),n.ctx.strokeStyle=this.color[g.v2],n.ctx.moveTo(g.x,g.y+x),n.ctx.lineTo(g.x+e,g.y+x),n.ctx.stroke()),g.v1&&(n.ctx.beginPath(),n.ctx.strokeStyle=this.color[g.v1],n.ctx.moveTo(g.x,g.y-x),n.ctx.lineTo(g.x+e,g.y-x),n.ctx.stroke())):(g.v2&&(n.ctx.beginPath(),n.ctx.strokeStyle=this.color[g.v2],n.ctx.moveTo(g.x+x,g.y),n.ctx.lineTo(g.x+x,g.y+e),n.ctx.stroke()),g.v1&&(n.ctx.beginPath(),n.ctx.strokeStyle=this.color[g.v1],n.ctx.moveTo(g.x-x,g.y),n.ctx.lineTo(g.x-x,g.y+e),n.ctx.stroke()))}}this.updateLegends({style:this,r:e,zf:r})}}}}])&&Xi(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);const Qi=function t(e){function n(t,n){var r,o;return t=null==t?0:+t,n=null==n?1:+n,function(){var i;if(null!=r)i=r,r=null;else do{r=2*e()-1,i=2*e()-1,o=r*r+i*i}while(!o||o>1);return t+n*i*Math.sqrt(-2*Math.log(o)/o)}}return n.source=t,n}(Math.random);function ta(t,e){var n=document.createElement("canvas");n.setAttribute("width",t),n.setAttribute("height",e);var r=n.getContext("webgl");if(!r)throw new Error("Unable to initialize WebGL. Your browser or machine may not support it.");return{canvas:n,gl:r}}function ea(t){var e=t.createProgram();if(null==e)throw new Error("Cannot create webGL program");for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(var i=0,a=r;i<a.length;i++){var u=a[i];t.attachShader(e,u)}if(t.linkProgram(e),t.getProgramParameter(e,t.LINK_STATUS))return e;throw new Error(t.getProgramInfoLog(e)||"Cannot create webGL program (2)")}function na(t,e){var n=t.createShader(e);if(null==n)throw new Error("Cannot create webGL shader");for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];if(t.shaderSource(n,o.join("\n")),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS))return n;throw new Error(t.getShaderInfoLog(n)||"Cannot create webGL shader (2)")}function ra(t){return ra="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},ra(t)}function oa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ra(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ra(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ra(o)?o:String(o)),r)}var o}var ia=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gl=e,this.sizePix=n||10,this.program=ea(e,na(e,e.VERTEX_SHADER,"\n attribute vec2 pos;\n uniform float sizePix;\n uniform mat3 mat;\n attribute vec4 color;\n varying vec4 vColor;\n void main() {\n gl_Position = vec4(mat * vec3(pos, 1.0), 1.0);\n gl_PointSize = sizePix;\n vColor = color;\n }\n "),na(e,e.FRAGMENT_SHADER,"\n precision mediump float;\n varying vec4 vColor;\n void main(void) {\n vec4 vColor_ = vColor / 255.0;\n vColor_[3] = 255.0 * vColor_[3];\n gl_FragColor = vColor_;\n }")),e.useProgram(this.program),this.verticesBuffer=[],this.colorsBuffer=[]}var e,n;return e=t,(n=[{key:"addPointData",value:function(t,e,n){var r=Me(n);r&&(this.verticesBuffer.push(t,e),this.colorsBuffer.push(r.r,r.g,r.b,r.opacity))}},{key:"addPointData2",value:function(t,e,n,r,o,i){this.verticesBuffer.push(t,e),this.colorsBuffer.push(n,r,o,i)}},{key:"draw",value:function(t){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.verticesBuffer),e.STATIC_DRAW);var n=e.getAttribLocation(this.program,"pos");e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n),e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.colorsBuffer),e.STATIC_DRAW);var r=e.getAttribLocation(this.program,"color");e.vertexAttribPointer(r,4,e.FLOAT,!1,0,0),e.enableVertexAttribArray(r),e.uniform1f(e.getUniformLocation(this.program,"sizePix"),1*this.sizePix),e.uniformMatrix3fv(e.getUniformLocation(this.program,"mat"),!1,new Float32Array(t)),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.POINTS,0,this.verticesBuffer.length/2)}}])&&oa(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function aa(t){return aa="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},aa(t)}function ua(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 la(t,e);var n=Object.prototype.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)?la(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function la(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ca(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==aa(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==aa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===aa(o)?o:String(o)),r)}var o}function fa(t,e){return fa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fa(t,e)}function sa(t,e){if(e&&("object"===aa(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ha(t){return ha=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ha(t)}var ya=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fa(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ha(r);if(o){var n=ha(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return sa(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.nbCol=t.nbCol,e.nb=t.nb||function(t,e,n,r){return.3*e*e/(r*r)*t/n.max},e.color=t.color||function(){return"#FF5733"},e.dotSize=t.dotSize,e.sigma=t.sigma,e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r,o=this,i=n.getZf();if(this.nbCol&&(r=nr.getStatistics(t,(function(t){return t[o.nbCol]}),!0)),r){var a=this.dotSize?this.dotSize(e,i):2*i,u=this.sigma?this.sigma(e,i):.4*e,l=Qi(0,u);if(function(){try{var t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}}()){var c=ta(n.w+"",n.h+"");if(!c)return void console.error("No webGL");var f,s,h,y,p,v,d,m=new ia(c.gl,a/i),b=e/2,g=ua(t);try{for(g.s();!(d=g.n()).done;){var w=d.value;if((f=this.color(w))&&"none"!==f){if(s=this.offset(w,e,i),h=this.nb(w[this.nbCol],e,r,i),y=w.x+s.dx+b,p=w.y+s.dy+b,!(v=Me(f)))return;for(var x=0;x<=h;x++)m.addPointData2(y+l(),p+l(),v.r,v.g,v.b,v.opacity)}}}catch(t){g.e(t)}finally{g.f()}m.draw(n.getWebGLTransform()),n.initCanvasTransform(),n.ctx.drawImage(c.canvas,0,0)}else{n.setCanvasTransform();var S,_=ua(t);try{for(_.s();!(S=_.n()).done;){var P=S.value,O=this.color(P);if(O&&"none"!==O){n.ctx.fillStyle=O;for(var j=this.offset(P,e,i),C=this.nb(P[this.nbCol],e,r,i),k=P.x+j.dx+e/2,E=P.y+j.dy+e/2,T=0;T<=C;T++)n.ctx.fillRect(k+l(),E+l(),a,a)}}}catch(t){_.e(t)}finally{_.f()}}this.updateLegends({style:this,r:e,zf:i})}}}])&&ca(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function pa(t){return pa="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},pa(t)}function va(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function da(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==pa(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==pa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===pa(o)?o:String(o)),r)}var o}var ma=function(){function t(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;va(this,t),this.gl=e;var i=na(e,e.VERTEX_SHADER,"\n attribute vec2 pos;\n uniform float sizePix;\n uniform mat3 mat;\n\n attribute float t;\n varying float vt;\n\n void main() {\n gl_Position = vec4(mat * vec3(pos, 1.0), 1.0);\n gl_PointSize = sizePix;\n vt = t;\n }\n "),a="\n precision mediump float;\n varying float vt;\n uniform float alpha;"+function(){for(var t=[],e=0;e<n.length;e++)t.push("uniform vec4 c"+e+";");return t.join("")}()+"void main(void) {\n ";if(r?"pow"==r.fun?a+="float t = pow(vt, alpha);":"powRev"==r.fun?a+="float t = 1.0-pow(1.0-vt, 1.0/alpha);":"exp"==r.fun?a+=0==r.alpha?"float t = vt;":"float t = (exp(vt * alpha) - 1.0) / (exp(alpha) - 1.0);":"expRev"==r.fun?a+=0==r.alpha?"float t = vt;":"float t = 1.0 - (1.0 / alpha) * log(exp(alpha) * (1.0 - vt) + vt);":"circleLow"==r.fun?0==r.alpha?a+="float t = vt;":1==r.alpha?a+="float t = sqrt(vt * (2.0 - vt));":a+="float a = alpha / (1.0 - alpha);\n float t = sqrt(1.0 / (a * a) + vt * ( 2.0/a + 2.0 - vt )) - 1.0 / a;":"circleHigh"==r.fun?0==r.alpha?a+="float t = vt;":1==r.alpha?a+="float t = 1.0 - sqrt((1.0 - vt) * (1.0 + vt));":a+="float a = alpha / (1.0 - alpha);\n float t = 1.0 - sqrt(1.0 / (a * a) + (1.0-vt) * ( 2.0/a + 1.0 + vt )) + 1.0 / a;":(console.error("Unexpected stretching function code: "+r.fun),a+="float t = vt;"):a+="float t = vt;",1==n.length)a+="\n vec4 cI=c0;\n vec4 cF=c0;";else if(2==n.length)a+="\n vec4 cI=c0;\n vec4 cF=c1;";else{var u=n.length-1,l=u+".0";a+="\n vec4 cI;\n vec4 cF;\n if(t<1.0/"+l+") { cI=c0; cF=c1; t=t*"+l+"; }";for(var c=2;c<u;c++)a+="else if(t<"+c+".0/"+l+") { cI=c"+(c-1)+"; cF=c"+c+"; t="+l+"*t-"+(c-1)+".0; }";a+="else { cI=c"+(u-1)+"; cF=c"+u+"; t="+l+"*t-"+(u-1)+".0; }"}1==n.length?a+="gl_FragColor = vec4(c0[0], c0[1], c0[2], c0[3]);}":a+="gl_FragColor = mix(cI, cF, t);}";var f=na(e,e.FRAGMENT_SHADER,a);this.program=ea(e,i,f),e.useProgram(this.program),e.uniform1f(e.getUniformLocation(this.program,"sizePix"),1*o),e.uniform1f(e.getUniformLocation(this.program,"alpha"),r?1*r.alpha:0);for(var s=0;s<n.length;s++){var h=Me(n[s]);e.uniform4fv(e.getUniformLocation(this.program,"c"+s),[+h.r/255,+h.g/255,+h.b/255,+h.opacity])}}var e,n;return e=t,(n=[{key:"draw",value:function(t,e,n){var r=this.gl,o=this.program;r.bindBuffer(r.ARRAY_BUFFER,r.createBuffer()),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t),r.STATIC_DRAW);var i=r.getAttribLocation(o,"pos");r.vertexAttribPointer(i,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(i),r.bindBuffer(r.ARRAY_BUFFER,r.createBuffer()),r.bufferData(r.ARRAY_BUFFER,new Float32Array(e),r.STATIC_DRAW);var a=r.getAttribLocation(o,"t");r.vertexAttribPointer(a,1,r.FLOAT,!1,0,0),r.enableVertexAttribArray(a),r.uniformMatrix3fv(r.getUniformLocation(o,"mat"),!1,new Float32Array(n)),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.POINTS,0,t.length/2)}}])&&da(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ba(t){return ba="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},ba(t)}function ga(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ba(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ba(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ba(o)?o:String(o)),r)}var o}function wa(t,e){return wa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wa(t,e)}function xa(t,e){if(e&&("object"===ba(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Sa(t){return Sa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sa(t)}var _a=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wa(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Sa(r);if(o){var n=Sa(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return xa(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,e.tFun=t.tFun||function(t,e,n){return t/n.max},e.stretching=t.stretching,e.colors=t.colors||["rgb(158, 1, 66)","rgb(248, 142, 83)","rgb(251, 248, 176)","rgb(137, 207, 165)","rgb(94, 79, 162)"].reverse(),t.color&&(e.colors=[t.color(0),t.color(.2),t.color(.4),t.color(.6),t.color(.8),t.color(1)]),e.size=t.size,e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r=this,o=n.getZf(),i=nr.getStatistics(t,(function(t){return t[r.colorCol]}),!0);if(i){var a=ta(n.w+"",n.h+"");if(a){for(var u,l=e/2,c=t.length,f=[],s=[],h=0;h<c;h++){u=t[h];var y=this.tFun(u[this.colorCol],e,i);null!=y&&null!=y&&(f.push(u.x+l,u.y+l),s.push(y>1?1:y<0?0:y))}var p=this.size?this.size(e,o):e+.2*o;new ma(a.gl,this.colors,this.stretching,p/o).draw(f,s,n.getWebGLTransform()),n.initCanvasTransform(),n.ctx.drawImage(a.canvas,0,0),this.updateLegends({style:this,r:e,zf:o,sColor:i})}else console.error("No webGL")}}}])&&ga(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function Pa(t){return Pa="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},Pa(t)}function Oa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Pa(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Pa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Pa(o)?o:String(o)),r)}var o}var ja=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n;return e=t,n=[{key:"get",value:function(t,e){if(null!=(e=e||{}).nb){e.nb<2&&(console.error("unexpected number of colors in tanaka (<2): "+e.nb),e.nb=2),e.color||(console.error("color function not defined in tanaka"),e.color=function(){return"gray"}),e.colors=[];for(var n=0;n<e.nb;n++)e.colors.push(e.color(n/(e.nb-1)))}e.colors=e.colors||["#a9bb9e","#c9dcaa","#fde89f","#f9a579","#eb444b"];var r=e.colors.length;e.tFun=e.tFun||function(t,e,n){return(t-n.min)/(n.max-n.min)},e.colDark=e.colDark||"#111",e.colBright=e.colBright||"#ddd",e.widthFactor=e.widthFactor||.08;var o=function(t){if(isNaN(t)||null==t)return console.error("Unexpected t value 1: "+t),-9;for(var e=0;e<r;e++)if(t<=(e+1)/r)return e;return console.error("Unexpected t value 2: "+t),-9};return[new _a({colorCol:t,colors:e.colors,tFun:function(t,n,i){var a=e.tFun(t,n,i);return o(a)/(r-1)},size:function(t,e){return t+.5*e}}),new Di({valueCol:t,value:function(t,n,r,i,a){if(void 0===t&&void 0===n)return 0;if(void 0===n){var u=e.tFun(t,r,i);if(null==u||isNaN(u))throw new Error("Unexpected value: "+t+" - "+u);return o(u)+1}if(void 0===t){var l=e.tFun(n,r,i);if(null==l||isNaN(l))throw new Error("Unexpected value: "+n+" - "+l);return-o(l)-1}var c=e.tFun(t,r,i);if(null==c||isNaN(c))throw new Error("Unexpected value: "+t+" - "+c);var f=e.tFun(n,r,i);if(null==f||isNaN(f))throw new Error("Unexpected value: "+n+" - "+f);var s=o(c);return-o(f)+s},color:function(t,n,r,o){if(0!==t.value)return"v"===t.or?t.value<0?e.colBright:e.colDark:t.value<0?e.colDark:e.colBright},width:function(t,n,r,o){return e.widthFactor*n*Math.abs(t.value)*("v"===t.or?.5:1)}})]}}],null&&Oa(e.prototype,null),n&&Oa(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ca(t){return Ca="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},Ca(t)}function ka(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ca(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ca(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ca(o)?o:String(o)),r)}var o}var Ea=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.colors=e,this.vshString="\n attribute vec2 pos;\n uniform float sizePix;\n uniform mat3 mat;\n\n attribute float i;\n varying float vi;\n\n void main() {\n gl_Position = vec4(mat * vec3(pos, 1.0), 1.0);\n gl_PointSize = sizePix;\n vi = i;\n }\n ";var n=[];n.push("precision mediump float;\nvarying float vi;\n"),n.push("uniform vec4");for(var r=0;r<e.length;r++)r>0&&n.push(","),n.push(" c"+r);n.push(";\n"),n.push("void main(void) {\n");for(var o=0;o<e.length;o++)o>0&&n.push("else "),n.push("if(vi=="),n.push(o),n.push(".0) gl_FragColor = vec4(c"),n.push(o),n.push("[0], c"),n.push(o),n.push("[1], c"),n.push(o),n.push("[2], c"),n.push(o),n.push("[3]);\n");n.push("else gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}"),this.fshString=n.join("")}var e,n;return e=t,n=[{key:"draw",value:function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,i=na(t,t.VERTEX_SHADER,this.vshString),a=na(t,t.FRAGMENT_SHADER,this.fshString),u=ea(t,i,a);t.useProgram(u),t.uniform1f(t.getUniformLocation(u,"sizePix"),1*o);for(var l=0;l<this.colors.length;l++){var c=Me(this.colors[l]);t.uniform4fv(t.getUniformLocation(u,"c"+l),[+c.r/255,+c.g/255,+c.b/255,+c.opacity])}t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array(e),t.STATIC_DRAW);var f=t.getAttribLocation(u,"pos");t.vertexAttribPointer(f,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(f),t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array(n),t.STATIC_DRAW);var s=t.getAttribLocation(u,"i");t.vertexAttribPointer(s,1,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s),t.uniformMatrix3fv(t.getUniformLocation(u,"mat"),!1,new Float32Array(r)),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.POINTS,0,e.length/2)}}],n&&ka(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ta(t){return Ta="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},Ta(t)}function Aa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ta(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ta(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ta(o)?o:String(o)),r)}var o}function Ma(t,e){return Ma=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ma(t,e)}function Ra(t,e){if(e&&("object"===Ta(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function za(t){return za=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},za(t)}var Fa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ma(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=za(r);if(o){var n=za(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ra(this,t)});function a(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,t.color=t.color||void 0;var n=Object.keys(t.color);e.catToI={};for(var r=0;r<n.length;r++)e.catToI[n[r]]=r+"";e.colors=[];for(var o=0;o<n.length;o++)e.colors.push(t.color[""+n[o]]);return e.size=t.size,e.wgp=new Ea(e.colors),e}return e=a,(n=[{key:"draw",value:function(t,e,n){for(var r,o=n.getZf(),i=e/2,a=t.length,u=[],l=[],c=0;c<a;c++){var f=(r=t[c])[this.colorCol];if(null!=f){var s=this.catToI[f];isNaN(+s)?console.log("Unexpected category index: "+f+" "+s):(u.push(r.x+i,r.y+i),l.push(+s))}else console.log("Unexpected category: "+f)}var h=ta(n.w+"",n.h+"");if(h){var y=this.size?this.size(e,o):e+.2*o;this.wgp.draw(h.gl,u,l,n.getWebGLTransform(),y/o),n.initCanvasTransform(),n.ctx.drawImage(h.canvas,0,0),this.updateLegends({style:this,r:e,zf:o})}else console.error("No webGL")}}])&&Aa(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function Ia(t){return Ia="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},Ia(t)}function La(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 Ba(t,e);var n=Object.prototype.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)?Ba(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function Ba(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Na(t,e){return Na=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Na(t,e)}function Da(t,e){if(e&&("object"===Ia(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Za(t){return Za=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Za(t)}function Ua(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ia(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ia(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ia(o)?o:String(o)),r)}var o}function Ga(t,e,n){return e&&Wa(t.prototype,e),n&&Wa(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var $a=function(){function t(){Ua(this,t)}return Ga(t,null,[{key:"get",value:function(t,e){(e=e||{}).colors=e.colors||["#00852b","#afd246","#fac80a","#d67923","#bb805a","#cb4e29","#b40000","#720012"],e.colDark=e.colDark||"#333",e.colBright=e.colBright||"#aaa",e.widthFactor=e.widthFactor||.12;var n=ja.get(t,e),r=new Do({strokeColor:function(){return"#666"},strokeWidth:function(t,e,n,r){return.2*r}});return[n[0],r,n[1],new Ya({colDark:e.colDark,colBright:e.colBright})]}},{key:"getCat",value:function(t,e){return(e=e||{}).colDark=e.colDark||"#333",e.colBright=e.colBright||"#aaa",[new Fa({colorCol:t,color:e.color}),new Do({strokeColor:function(){return"#666"},strokeWidth:function(t,e,n,r){return.2*r}}),new Ya({colDark:e.colDark,colBright:e.colBright})]}}]),t}(),Ya=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Na(t,e)}(o,t);var e,n,r=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=Za(e);if(n){var o=Za(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return Da(this,t)});function o(t){var e;return Ua(this,o),e=r.call(this,t),t=t||{},e.colDark=t.colDark||"#333",e.colBright=t.colBright||"#aaa",e}return Ga(o,[{key:"draw",value:function(t,e,n){n.ctx.lineWidth=.6*n.getZf(),n.ctx.strokeStyle=this.colDark;var r,o=La(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;n.ctx.beginPath(),n.ctx.arc(i.x+.5*e,i.y+.5*e,.55*e*.5,Math.PI/4,-Math.PI*(3/4),!0),n.ctx.stroke()}}catch(t){o.e(t)}finally{o.f()}n.ctx.strokeStyle=this.colBright;var a,u=La(t);try{for(u.s();!(a=u.n()).done;){var l=a.value;n.ctx.beginPath(),n.ctx.arc(l.x+.5*e,l.y+.5*e,.55*e*.5,Math.PI/4,-Math.PI*(3/4),!1),n.ctx.stroke()}}catch(t){u.e(t)}finally{u.f()}}}]),o}(nr);function Va(t){return Va="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},Va(t)}function Xa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function qa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Va(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Va(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Va(o)?o:String(o)),r)}var o}function Ha(t,e){return Ha=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ha(t,e)}function Ka(t,e){if(e&&("object"===Va(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ja(t){return Ja=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ja(t)}var Qa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ha(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ja(r);if(o){var n=Ja(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ka(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.mosaicFactor=t.mosaicFactor||.15,e.shadowFactor=t.shadowFactor||.2,e.shadowColor=t.shadowColor||"#555",e}return e=a,(n=[{key:"draw",value:function(t,e,n){var r,o=this,i=n.getZf();this.colorCol&&(r=nr.getStatistics(t,(function(t){return t[o.colorCol]}),!0)),n.ctx.strokeStyle=this.shadowColor,n.ctx.lineWidth=this.shadowFactor*e,n.ctx.lineJoin="round",n.ctx.lineCap="butt";var a=e*this.mosaicFactor,u=function(){return{x:Math.random()*a,y:Math.random()*a}};n.setCanvasTransform();var l,c=function(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 Xa(t,e);var n=Object.prototype.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)?Xa(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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 i,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(l=c.n()).done;){var f=l.value,s=this.color?this.color(f[this.colorCol],e,r):void 0;if(s&&"none"!==s){n.ctx.fillStyle=s;var h=this.offset(f,e,i),y=u(),p=u(),v=u(),d=u();this.shadowFactor>0&&(n.ctx.beginPath(),n.ctx.moveTo(f.x+h.dx+y.x,f.y+h.dy+y.y),n.ctx.lineTo(f.x+h.dx+e-v.x,f.y+h.dy+v.y),n.ctx.lineTo(f.x+h.dx+e-d.x,f.y+h.dy+e-d.y),n.ctx.stroke()),n.ctx.beginPath(),n.ctx.moveTo(f.x+h.dx+y.x,f.y+h.dy+y.y),n.ctx.lineTo(f.x+h.dx+e-v.x,f.y+h.dy+v.y),n.ctx.lineTo(f.x+h.dx+e-d.x,f.y+h.dy+e-d.y),n.ctx.lineTo(f.x+h.dx+p.x,f.y+h.dy+e-p.y),n.ctx.fill()}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:i,sColor:r})}}])&&qa(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nr);function tu(t){return tu="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},tu(t)}function eu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==tu(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==tu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===tu(o)?o:String(o)),r)}var o}var nu=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.id=e.id,this.top=e.top,this.bottom=e.bottom,this.left=e.left,this.right=e.right,this.background=e.background||"none",this.padding=e.padding||"5px",this.border=e.border||"0px",this["border-radius"]=e["border-radius"]||"none",this["box-shadow"]=e["box-shadow"]||"none",this["font-family"]=e["font-family"]||"Helvetica, Arial, sans-serif",this.width=e.width,this.height=e.height,this.id&&(this.div=mt("#"+this.id)),this.div&&!this.div.empty()||(this.div=mt(document.createElement("div")),this.id&&this.div.attr("id",this.id)),this.div.style("background",this.background).style("padding",this.padding).style("border",this.border).style("border-radius",this["border-radius"]).style("box-shadow",this["box-shadow"]).style("font-family",this["font-family"]),this.width&&this.div.style("width",this.width),this.height&&this.div.style("height",this.height)}var e,n;return e=t,(n=[{key:"update",value:function(t){console.error("Legend update not implemented yet.")}}])&&eu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ru(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}var ou,iu=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function au(t){if(!(e=iu.exec(t)))throw new Error("invalid format: "+t);var e;return new uu({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 uu(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 lu(t,e){var n=ru(t,e);if(!n)return t+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}au.prototype=uu.prototype,uu.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 cu={"%":(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)=>lu(100*t,e),r:lu,s:function(t,e){var n=ru(t,e);if(!n)return t+"";var r=n[0],o=n[1],i=o-(ou=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+ru(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function fu(t){return t}var su,hu,yu=Array.prototype.map,pu=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function vu(t){return su=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?fu:(e=yu.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var o=t.length,i=[],a=0,u=e[0],l=0;o>0&&u>0&&(l+u+1>r&&(u=Math.max(1,r-l)),i.push(t.substring(o-=u,o+u)),!((l+=u+1)>r));)u=e[a=(a+1)%e.length];return i.reverse().join(n)}),o=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?fu:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(yu.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",f=void 0===t.nan?"NaN":t.nan+"";function s(t){var e=(t=au(t)).fill,n=t.align,s=t.sign,h=t.symbol,y=t.zero,p=t.width,v=t.comma,d=t.precision,m=t.trim,b=t.type;"n"===b?(v=!0,b="g"):cu[b]||(void 0===d&&(d=12),m=!0,b="g"),(y||"0"===e&&"="===n)&&(y=!0,e="0",n="=");var g="$"===h?o:"#"===h&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",w="$"===h?i:/[%p]/.test(b)?l:"",x=cu[b],S=/[defgprs%]/.test(b);function _(t){var o,i,l,h=g,_=w;if("c"===b)_=x(t)+_,t="";else{var P=(t=+t)<0||1/t<0;if(t=isNaN(t)?f:x(Math.abs(t),d),m&&(t=function(t){t:for(var e,n=t.length,r=1,o=-1;r<n;++r)switch(t[r]){case".":o=e=r;break;case"0":0===o&&(o=r),e=r;break;default:if(!+t[r])break t;o>0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),P&&0==+t&&"+"!==s&&(P=!1),h=(P?"("===s?s:c:"-"===s||"("===s?"":s)+h,_=("s"===b?pu[8+ou/3]:"")+_+(P&&"("===s?")":""),S)for(o=-1,i=t.length;++o<i;)if(48>(l=t.charCodeAt(o))||l>57){_=(46===l?a+t.slice(o+1):t.slice(o))+_,t=t.slice(0,o);break}}v&&!y&&(t=r(t,1/0));var O=h.length+t.length+_.length,j=O<p?new Array(p-O+1).join(e):"";switch(v&&y&&(t=r(j+t,j.length?p-_.length:1/0),j=""),n){case"<":t=h+t+_+j;break;case"=":t=h+j+t+_;break;case"^":t=j.slice(0,O=j.length>>1)+h+t+_+j.slice(O);break;default:t=j+h+t+_}return u(t)}return d=void 0===d?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),_.toString=function(){return t+""},_}return{format:s,formatPrefix:function(t,e){var n,r=s(((t=au(t)).type="f",t)),o=3*Math.max(-8,Math.min(8,Math.floor((n=e,((n=ru(Math.abs(n)))?n[1]:NaN)/3)))),i=Math.pow(10,-o),a=pu[8+o/3];return function(t){return r(i*t)+a}}}}(t),hu=su.format,su.formatPrefix,su}function du(t){return du="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},du(t)}function mu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==du(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==du(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===du(o)?o:String(o)),r)}var o}function bu(t,e){return bu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bu(t,e)}function gu(t,e){if(e&&("object"===du(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function wu(t){return wu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wu(t)}vu({thousands:",",grouping:[3],currency:["$",""]});var xu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bu(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=wu(r);if(o){var n=wu(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return gu(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colorRamp=t.colorRamp,e.fun=t.fun,e.title=t.title,e.tickSize=t.tickSize||6,e.width=t.width||300,e.height=t.height||15,e.margin=t.margin||5,e.ticks=t.ticks||Math.floor(e.width/50),e.tickFormat=t.tickFormat||",.0f",e.tickUnit=t.tickUnit,e.fontSize=t.fontSize||"0.8em",e.invert=t.invert,e}return e=a,(n=[{key:"update",value:function(t){if(t.sColor){this.div.selectAll("*").remove();var e=this.width+2*this.margin,n=this.height+3*this.margin+12+this.tickSize+10,r=this.div.append("svg").attr("width",e).attr("height",n);r.append("text").attr("x",this.margin).attr("y",this.margin).style("font-size","0.8em").style("font-weight","bold").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none").text(this.title);for(var o=r.append("g").attr("transform","translate("+this.margin+" "+(2*this.margin+12)+")"),i=this.width,a=this.height,u=0;u<i;u+=5){var l=u/(i-1);this.invert&&(l=1-l),o.append("rect").attr("x",u).attr("y",0).attr("width",5).attr("height",a).style("fill",this.colorRamp(l))}for(var c=0;c<this.ticks;c++){var f=c/(this.ticks-1);o.append("line").attr("x1",i*f).attr("y1",0).attr("x2",i*f).attr("y2",a+this.tickSize).style("stroke","black"),o.append("text").attr("id","ticklabel_"+c).attr("x",i*f).attr("y",a+this.tickSize+2).style("font-size",this.fontSize).style("text-anchor",0==c?"start":c==this.ticks-1?"end":"middle").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none")}for(var s=this.tickFormat&&"text"!=this.tickFormat?hu(this.tickFormat):function(t){return t},h=0;h<this.ticks;h++){var y=h/(this.ticks-1),p=this.fun(y,t.r,t.sColor),v=(p?s(p):"0")+(this.tickUnit?this.tickUnit:"");this.div.select("#ticklabel_"+h).text(v)}}}}])&&mu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nu);function Su(t){return Su="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},Su(t)}function _u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Su(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Su(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Su(o)?o:String(o)),r)}var o}function Pu(t,e){return Pu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pu(t,e)}function Ou(t,e){if(e&&("object"===Su(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ju(t){return ju=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ju(t)}var Cu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pu(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ju(r);if(o){var n=ju(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ou(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colors=t.colors,e.breaksText=t.breaksText,e.width=t.width||300,e.height=t.height||15,e.title=t.title,e.titleFontSize=t.titleFontSize||"0.8em",e.titleFontWeight=t.titleFontWeight||"bold",e.tickSize=t.tickSize||3,e.labelFontSize=t.labelFontSize||"0.8em",e.invert=t.invert,e}return e=a,(n=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.title&&this.div.append("div").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).style("margin-bottom","7px").text(this.title);var e=this.colors.length;if(0!=e){for(var n=this.width/e,r=this.div.append("svg").attr("width",this.width).attr("height",this.height+this.tickSize+2+10),o=0;o<e;o++)r.append("rect").attr("x",o*n).attr("y",0).attr("width",n).attr("height",this.height).style("fill",this.colors[o]);for(var i=1;i<e;i++)r.append("line").attr("x1",n*i).attr("y1",0).attr("x2",n*i).attr("y2",this.height+this.tickSize).style("stroke","black");for(var a=1;a<e;a++)r.append("text").attr("id","ticklabel_"+a).attr("x",n*a).attr("y",this.height+this.tickSize+2).style("font-size",this.labelFontSize).style("text-anchor",0==a?"start":a==this.ticks-1?"end":"middle").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none").text(this.breaksText[a-1])}}}])&&_u(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nu);function ku(t){return ku="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},ku(t)}function Eu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ku(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ku(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ku(o)?o:String(o)),r)}var o}function Tu(t,e){return Tu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tu(t,e)}function Au(t,e){if(e&&("object"===ku(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Mu(t){return Mu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mu(t)}var Ru=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tu(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Mu(r);if(o){var n=Mu(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Au(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.colCat=t.colCat||[["gray","-"]],e.shape=t.shape||"circle",e.dimension=t.dimension||{r:8},e.strokeColor=t.strokeColor||"gray",e.strokeWidth=t.strokeWidth||1,e.title=t.title,e.titleFontSize=t.titleFontSize||"0.8em",e.titleFontWeight=t.titleFontWeight||"bold",e.labelFontSize=t.labelFontSize||"0.8em",e}return e=a,(n=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.title&&this.div.append("div").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).style("margin-bottom","7px").text(this.title);var e=this.colCat.length;if(0!=e)for(var n=0;n<e;n++){var r=this.colCat[n],o=this.div.append("div"),i=this.strokeWidth;if("square"===this.shape){var a=this.dimension.h||15,u=this.dimension.w||20;o.append("div").style("display","inline").append("svg").attr("width",u+2*i).attr("height",a+2*i).append("rect").attr("x",i).attr("y",i).attr("width",u).attr("height",a).style("fill",r[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}else{if("circle"!==this.shape)throw new Error("Unexpected shape:"+this.shape);var l=this.dimension.r||8,c=2*l+2*i;o.append("div").style("display","inline").append("svg").attr("width",c).attr("height",c).append("circle").attr("cx",l+i).attr("cy",l+i).attr("r",l).style("fill",r[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}o.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(r[1])}}}])&&Eu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nu);function zu(t){return zu="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},zu(t)}function Fu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==zu(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==zu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===zu(o)?o:String(o)),r)}var o}function Iu(t,e){return Iu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Iu(t,e)}function Lu(t,e){if(e&&("object"===zu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Bu(t){return Bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bu(t)}var Nu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Iu(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Bu(r);if(o){var n=Bu(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Lu(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.exaggerationFactor=t.exaggerationFactor||.8,e.value=t.value||void 0,e.shape=t.shape||"circle",e.fillColor=t.fillColor||"none",e.strokeColor=t.strokeColor||"gray",e.strokeWidth=t.strokeWidth||1,e.labelFontSize=t.labelFontSize||"0.8em",e.labelUnitText=t.labelUnitText||"",e.labelFormat=t.labelFormat||",.2r",e}return e=a,(n=[{key:"update",value:function(t){if(t.sSize){this.div.selectAll("*").remove();var e=this.value;if(null==e){var n=t.sSize.max*this.exaggerationFactor,r=Math.log10(n);r=Math.floor(r),8*(e=Math.pow(10,r))<=n?e*=8:6*e<=n?e*=6:5*e<=n?e*=5:4*e<=n?e*=4:2.5*e<=n?e*=2.5:2*e<=n&&(e*=2)}if(e){var o=this.div.append("div"),i=t.style.size(e,t.r,t.sSize,t.zf)/t.zf,a=o.append("svg").attr("width",i+this.strokeWidth+2).attr("height",i+this.strokeWidth+2).style("","inline-block");if("square"===this.shape)a.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",i).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth);else if("circle"===this.shape){var u=.5*(i+this.strokeWidth);a.append("circle").attr("cx",u+1).attr("cy",u+1).attr("r",u).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}else if("donut"===this.shape);else if("diamond"!==this.shape)throw new Error("Unexpected shape:"+this.shape);var l=hu(this.labelFormat)(e);o.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(l+(this.labelUnitText?" ":"")+this.labelUnitText)}}}}])&&Fu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nu);function Du(t){return Du="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},Du(t)}function Zu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Du(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Du(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Du(o)?o:String(o)),r)}var o}function Uu(t,e){return Uu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Uu(t,e)}function Wu(t,e){if(e&&("object"===Du(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Gu(t){return Gu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gu(t)}var $u=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Uu(t,e)}(a,t);var e,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Gu(r);if(o){var n=Gu(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Wu(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.exaggerationFactor=t.exaggerationFactor||.5,e.color=t.color||"gray",e.orientation=t.orientation||0,e.labelFontSize=t.labelFontSize||"0.8em",e.labelUnitText=t.labelUnitText||"",e.div.style("text-align","center"),e}return e=a,(n=[{key:"update",value:function(t){if(t.sWidth){this.div.selectAll("*").remove();var e=t.sWidth.max*this.exaggerationFactor,n=Math.log10(e);n=Math.floor(n);var r=Math.pow(10,n);8*r<=e?r*=8:6*r<=e?r*=6:5*r<=e?r*=5:4*r<=e?r*=4:2.5*r<=e?r*=2.5:2*r<=e&&(r*=2);var o=t.style.width(r,t.r,t.sWidth,t.zf)/t.zf,i=1*t.r/t.zf;this.div.append("svg").attr("width",i).attr("height",o).style("","inline-block").append("line").attr("x1",0).attr("y1",o/2).attr("x2",i).attr("y2",o/2).style("stroke",this.color).style("stroke-width",o);var a=hu(",.2r")(r);this.div.append("div").style("font-size",this.labelFontSize).style("","inline-block").text(a+(this.labelUnitText?" ":"")+this.labelUnitText)}}}])&&Zu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(nu);function Yu(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1.01,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;(n=n||1.01)<1&&console.error("Unexpected value for factor: "+n+". Set to default value 1.01");var a=t.getZoomFactor();if(e!=a){e<a&&(n=1/n);var u=a,l=setInterval((function(){u=t.getZoomFactor()*n,e>a&&u>e&&(u=e),e<a&&u<e&&(u=e),t.setZoomFactor(u),t.cg.redraw(),u==e&&(clearInterval(l),o&&setTimeout((function(){o()}),i))}),r);return l}}function Vu(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:NaN,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:5,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6?arguments[6]:void 0,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=t.getZoomFactor(),c=t.getGeoCenter();e=isNaN(e)?c.x:e,n=isNaN(n)?c.y:n,r=isNaN(r)?l:r;var f=e-c.x,s=n-c.y,h=Math.hypot(f,s),y=o*l*f/h,p=o*l*s/h,v=r/l,d=h/(o*l),m=h>0?Math.pow(v,1/d):Math.pow(v,.1),b=setInterval((function(){if(h>0){var o=t.getGeoCenter(),i=o.x+y,l=o.y+p;i<e&&e<o.x&&(i=e),o.x<e&&e<i&&(i=e),l<n&&n<o.y&&(l=n),o.y<n&&n<l&&(l=n),t.setGeoCenter({x:i,y:l}),i==e&&l==n&&(h=0)}if(1!=v){var c=t.getZoomFactor(),f=m*c;f<r&&r<c&&(f=r),c<r&&r<f&&(f=r),t.setZoomFactor(f),f==r&&(v=1)}t.cg.redraw(),0==h&&1==v&&(console.log("OK !"),clearInterval(b),a&&setTimeout((function(){a()}),u))}),i);return b}var Xu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,e)},qu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,1/e)},Hu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:(Math.exp(t*e)-1)/(Math.exp(e)-1)},Ku=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:1-1/e*Math.log(Math.exp(e)*(1-t)+t)},Ju=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.8;if(0==e)return t;if(1==e)return Math.sqrt(t*(2-t));var n=e/(1-e);return Math.sqrt(1/(n*n)+t*(2/n+2-t))-1/n},Qu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.8;return 1-Ju(1-t,e)},tl=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 0==e?t:1/e*Math.log(1-t+t*Math.exp(e))},el=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return(Math.exp(-e*t)-1)/(Math.exp(-e)-1)},nl=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return Math.pow(t,1/e)},rl=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return 1-Math.pow(1-t,e)},ol=1e-6,il=Math.PI,al=il/2,ul=il/4,ll=2*il,cl=180/il,fl=il/180,sl=Math.abs,hl=Math.atan,yl=Math.atan2,pl=Math.cos,vl=(Math.ceil,Math.exp,Math.floor,Math.hypot,Math.log,Math.pow,Math.sin),dl=Math.sign||function(t){return t>0?1:t<0?-1:0},ml=Math.sqrt;function bl(t){return t>1?al:t<-1?-al:Math.asin(t)}function gl(){}function wl(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:gl,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function xl(t,e){return sl(t[0]-e[0])<ol&&sl(t[1]-e[1])<ol}function Sl(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function _l(t,e,n,r,o){var i,a,u=[],l=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(xl(r,a)){if(!r[2]&&!a[2]){for(o.lineStart(),i=0;i<e;++i)o.point((r=t[i])[0],r[1]);return void o.lineEnd()}a[0]+=2e-6}u.push(n=new Sl(r,t,null,!0)),l.push(n.o=new Sl(r,null,n,!1)),u.push(n=new Sl(a,t,null,!1)),l.push(n.o=new Sl(a,null,n,!0))}})),u.length){for(l.sort(e),Pl(u),Pl(l),i=0,a=l.length;i<a;++i)l[i].e=n=!n;for(var c,f,s=u[0];;){for(var h=s,y=!0;h.v;)if((h=h.n)===s)return;c=h.z,o.lineStart();do{if(h.v=h.o.v=!0,h.e){if(y)for(i=0,a=c.length;i<a;++i)o.point((f=c[i])[0],f[1]);else r(h.x,h.n.x,1,o);h=h.n}else{if(y)for(c=h.p.z,i=c.length-1;i>=0;--i)o.point((f=c[i])[0],f[1]);else r(h.x,h.p.x,-1,o);h=h.p}c=(h=h.o).z,y=!y}while(!h.v);o.lineEnd()}}}function Pl(t){if(e=t.length){for(var e,n,r=0,o=t[0];++r<e;)o.n=n=t[r],n.p=o,o=n;o.n=n=t[0],n.p=o}}Math.tan;class Ol{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const o=e[r],i=t+o,a=Math.abs(t)<Math.abs(o)?t-(i-o):o-(i-t);a&&(e[n++]=a),t=i}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,o=this._n,i=0;if(o>0){for(i=t[--o];o>0&&(e=i,n=t[--o],i=e+n,r=n-(i-e),!r););o>0&&(r<0&&t[o-1]<0||r>0&&t[o-1]>0)&&(n=2*r,e=i+n,n==e-i&&(i=e))}return i}}function jl(t){return[yl(t[1],t[0]),bl(t[2])]}function Cl(t){var e=t[0],n=t[1],r=pl(n);return[r*pl(e),r*vl(e),vl(n)]}function kl(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function El(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 Tl(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Al(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Ml(t){var e=ml(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Rl(t){return sl(t[0])<=il?t[0]:dl(t[0])*((sl(t[0])+il)%ll-il)}function zl(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function Fl(t,e,n,r){return function(o){var i,a,u,l=e(o),c=wl(),f=e(c),s=!1,h={point:y,lineStart:v,lineEnd:d,polygonStart:function(){h.point=m,h.lineStart=b,h.lineEnd=g,a=[],i=[]},polygonEnd:function(){h.point=y,h.lineStart=v,h.lineEnd=d,a=zl(a);var t=function(t,e){var n=Rl(e),r=e[1],o=vl(r),i=[vl(n),-pl(n),0],a=0,u=0,l=new Ol;1===o?r=al+ol:-1===o&&(r=-al-ol);for(var c=0,f=t.length;c<f;++c)if(h=(s=t[c]).length)for(var s,h,y=s[h-1],p=Rl(y),v=y[1]/2+ul,d=vl(v),m=pl(v),b=0;b<h;++b,p=w,d=S,m=_,y=g){var g=s[b],w=Rl(g),x=g[1]/2+ul,S=vl(x),_=pl(x),P=w-p,O=P>=0?1:-1,j=O*P,C=j>il,k=d*S;if(l.add(yl(k*O*vl(j),m*_+k*pl(j))),a+=C?P+O*ll:P,C^p>=n^w>=n){var E=El(Cl(y),Cl(g));Ml(E);var T=El(i,E);Ml(T);var A=(C^P>=0?-1:1)*bl(T[2]);(r>A||r===A&&(E[0]||E[1]))&&(u+=C^P>=0?1:-1)}}return(a<-ol||a<ol&&l<-1e-12)^1&u}(i,r);a.length?(s||(o.polygonStart(),s=!0),_l(a,Ll,t,n,o)):t&&(s||(o.polygonStart(),s=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),s&&(o.polygonEnd(),s=!1),a=i=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function y(e,n){t(e,n)&&o.point(e,n)}function p(t,e){l.point(t,e)}function v(){h.point=p,l.lineStart()}function d(){h.point=y,l.lineEnd()}function m(t,e){u.push([t,e]),f.point(t,e)}function b(){f.lineStart(),u=[]}function g(){m(u[0][0],u[0][1]),f.lineEnd();var t,e,n,r,l=f.clean(),h=c.result(),y=h.length;if(u.pop(),i.push(u),u=null,y)if(1&l){if((e=(n=h[0]).length-1)>0){for(s||(o.polygonStart(),s=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}}else y>1&&2&l&&h.push(h.pop().concat(h.shift())),a.push(h.filter(Il))}return h}}function Il(t){return t.length>1}function Ll(t,e){return((t=t.x)[0]<0?t[1]-al-ol:al-t[1])-((e=e.x)[0]<0?e[1]-al-ol:al-e[1])}const Bl=Fl((function(){return!0}),(function(t){var e,n=NaN,r=NaN,o=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,a){var u=i>0?il:-il,l=sl(i-n);sl(l-il)<ol?(t.point(n,r=(r+a)/2>0?al:-al),t.point(o,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(i,r),e=0):o!==u&&l>=il&&(sl(n-o)<ol&&(n-=o*ol),sl(i-u)<ol&&(i-=u*ol),r=function(t,e,n,r){var o,i,a=vl(t-n);return sl(a)>ol?hl((vl(e)*(i=pl(r))*vl(n)-vl(r)*(o=pl(e))*vl(t))/(o*i*a)):(e+r)/2}(n,r,i,a),t.point(o,r),t.lineEnd(),t.lineStart(),t.point(u,r),e=0),t.point(n=i,r=a),o=u},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var o;if(null==t)o=n*al,r.point(-il,o),r.point(0,o),r.point(il,o),r.point(il,0),r.point(il,-o),r.point(0,-o),r.point(-il,-o),r.point(-il,0),r.point(-il,o);else if(sl(t[0]-e[0])>ol){var i=t[0]<e[0]?il:-il;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(e[0],e[1])}),[-il,-al]);function Nl(t,e){(e=Cl(e))[0]-=t,Ml(e);var n,r=(n=-e[1])>1?0:n<-1?il:Math.acos(n);return((-e[2]<0?-r:r)+ll-ol)%ll}function Dl(t){var e=pl(t),n=6*fl,r=e>0,o=sl(e)>ol;function i(t,n){return pl(t)*pl(n)>e}function a(t,n,r){var o=[1,0,0],i=El(Cl(t),Cl(n)),a=kl(i,i),u=i[0],l=a-u*u;if(!l)return!r&&t;var c=e*a/l,f=-e*u/l,s=El(o,i),h=Al(o,c);Tl(h,Al(i,f));var y=s,p=kl(h,y),v=kl(y,y),d=p*p-v*(kl(h,h)-1);if(!(d<0)){var m=ml(d),b=Al(y,(-p-m)/v);if(Tl(b,h),b=jl(b),!r)return b;var g,w=t[0],x=n[0],S=t[1],_=n[1];x<w&&(g=w,w=x,x=g);var P=x-w,O=sl(P-il)<ol;if(!O&&_<S&&(g=S,S=_,_=g),O||P<ol?O?S+_>0^b[1]<(sl(b[0]-w)<ol?S:_):S<=b[1]&&b[1]<=_:P>il^(w<=b[0]&&b[0]<=x)){var j=Al(y,(-p+m)/v);return Tl(j,h),[b,jl(j)]}}}function u(e,n){var o=r?t:il-t,i=0;return e<-o?i|=1:e>o&&(i|=2),n<-o?i|=4:n>o&&(i|=8),i}return Fl(i,(function(t){var e,n,l,c,f;return{lineStart:function(){c=l=!1,f=1},point:function(s,h){var y,p=[s,h],v=i(s,h),d=r?v?0:u(s,h):v?u(s+(s<0?il:-il),h):0;if(!e&&(c=l=v)&&t.lineStart(),v!==l&&(!(y=a(e,p))||xl(e,y)||xl(p,y))&&(p[2]=1),v!==l)f=0,v?(t.lineStart(),y=a(p,e),t.point(y[0],y[1])):(y=a(e,p),t.point(y[0],y[1],2),t.lineEnd()),e=y;else if(o&&e&&r^v){var m;d&n||!(m=a(p,e,!0))||(f=0,r?(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)))}!v||e&&xl(e,p)||t.point(p[0],p[1]),e=p,l=v,n=d},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return f|(c&&l)<<1}}}),(function(e,r,o,i){!function(t,e,n,r,o,i){if(n){var a=pl(e),u=vl(e),l=r*n;null==o?(o=e+r*ll,i=e-l/2):(o=Nl(a,o),i=Nl(a,i),(r>0?o<i:o>i)&&(o+=r*ll));for(var c,f=o;r>0?f>i:f<i;f-=l)c=jl([a,-u*pl(f),-u*vl(f)]),t.point(c[0],c[1])}}(i,t,n,o,e,r)}),r?[0,-t]:[-il,t-il])}var Zl=1e9,Ul=-Zl;function Wl(t,e,n,r){function o(o,i){return t<=o&&o<=n&&e<=i&&i<=r}function i(o,i,u,c){var f=0,s=0;if(null==o||(f=a(o,u))!==(s=a(i,u))||l(o,i)<0^u>0)do{c.point(0===f||3===f?t:n,f>1?r:e)}while((f=(f+u+4)%4)!==s);else c.point(i[0],i[1])}function a(r,o){return sl(r[0]-t)<ol?o>0?0:3:sl(r[0]-n)<ol?o>0?2:1:sl(r[1]-e)<ol?o>0?1:0:o>0?3:2}function u(t,e){return l(t.x,e.x)}function l(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var l,c,f,s,h,y,p,v,d,m,b,g=a,w=wl(),x={point:S,lineStart:function(){x.point=_,c&&c.push(f=[]),m=!0,d=!1,p=v=NaN},lineEnd:function(){l&&(_(s,h),y&&d&&w.rejoin(),l.push(w.result())),x.point=S,d&&g.lineEnd()},polygonStart:function(){g=w,l=[],c=[],b=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,o=c.length;n<o;++n)for(var i,a,u=c[n],l=1,f=u.length,s=u[0],h=s[0],y=s[1];l<f;++l)i=h,a=y,h=(s=u[l])[0],y=s[1],a<=r?y>r&&(h-i)*(r-a)>(y-a)*(t-i)&&++e:y<=r&&(h-i)*(r-a)<(y-a)*(t-i)&&--e;return e}(),n=b&&e,o=(l=zl(l)).length;(n||o)&&(a.polygonStart(),n&&(a.lineStart(),i(null,null,1,a),a.lineEnd()),o&&_l(l,u,e,i,a),a.polygonEnd()),g=a,l=c=f=null}};function S(t,e){o(t,e)&&g.point(t,e)}function _(i,a){var u=o(i,a);if(c&&f.push([i,a]),m)s=i,h=a,y=u,m=!1,u&&(g.lineStart(),g.point(i,a));else if(u&&d)g.point(i,a);else{var l=[p=Math.max(Ul,Math.min(Zl,p)),v=Math.max(Ul,Math.min(Zl,v))],w=[i=Math.max(Ul,Math.min(Zl,i)),a=Math.max(Ul,Math.min(Zl,a))];!function(t,e,n,r,o,i){var a,u=t[0],l=t[1],c=0,f=1,s=e[0]-u,h=e[1]-l;if(a=n-u,s||!(a>0)){if(a/=s,s<0){if(a<c)return;a<f&&(f=a)}else if(s>0){if(a>f)return;a>c&&(c=a)}if(a=o-u,s||!(a<0)){if(a/=s,s<0){if(a>f)return;a>c&&(c=a)}else if(s>0){if(a<c)return;a<f&&(f=a)}if(a=r-l,h||!(a>0)){if(a/=h,h<0){if(a<c)return;a<f&&(f=a)}else if(h>0){if(a>f)return;a>c&&(c=a)}if(a=i-l,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>c&&(c=a)}else if(h>0){if(a<c)return;a<f&&(f=a)}return c>0&&(t[0]=u+c*s,t[1]=l+c*h),f<1&&(e[0]=u+f*s,e[1]=l+f*h),!0}}}}}(l,w,t,e,n,r)?u&&(g.lineStart(),g.point(i,a),b=!1):(d||(g.lineStart(),g.point(l[0],l[1])),g.point(w[0],w[1]),u||g.lineEnd(),b=!1)}p=i,v=a,d=u}return x}}function Gl(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}const $l=t=>t;function Yl(t,e){return[sl(t)>il?t+Math.round(-t/ll)*ll:t,e]}function Vl(t){return function(e,n){return[(e+=t)>il?e-ll:e<-il?e+ll:e,n]}}function Xl(t){var e=Vl(t);return e.invert=Vl(-t),e}function ql(t,e){var n=pl(t),r=vl(t),o=pl(e),i=vl(e);function a(t,e){var a=pl(e),u=pl(t)*a,l=vl(t)*a,c=vl(e),f=c*n+u*r;return[yl(l*o-f*i,u*n-c*r),bl(f*o+l*i)]}return a.invert=function(t,e){var a=pl(e),u=pl(t)*a,l=vl(t)*a,c=vl(e),f=c*o-l*i;return[yl(l*o+c*i,u*n+f*r),bl(f*n-u*r)]},a}function Hl(t){return function(e){var n=new Kl;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Kl(){}function Jl(t,e){t&&tc.hasOwnProperty(t.type)&&tc[t.type](t,e)}Yl.invert=Yl,Kl.prototype={constructor:Kl,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 Ql={Feature:function(t,e){Jl(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,o=n.length;++r<o;)Jl(n[r].geometry,e)}},tc={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,r=-1,o=n.length;++r<o;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){ec(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)ec(n[r],e,0)},Polygon:function(t,e){nc(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)nc(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,o=n.length;++r<o;)Jl(n[r],e)}};function ec(t,e,n){var r,o=-1,i=t.length-n;for(e.lineStart();++o<i;)r=t[o],e.point(r[0],r[1],r[2]);e.lineEnd()}function nc(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)ec(t[n],e,1);e.polygonEnd()}var rc=1/0,oc=rc,ic=-rc,ac=ic,uc={point:function(t,e){t<rc&&(rc=t),t>ic&&(ic=t),e<oc&&(oc=e),e>ac&&(ac=e)},lineStart:gl,lineEnd:gl,polygonStart:gl,polygonEnd:gl,result:function(){var t=[[rc,oc],[ic,ac]];return ic=ac=-(oc=rc=1/0),t}};const lc=uc;function cc(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),function(t,e){t&&Ql.hasOwnProperty(t.type)?Ql[t.type](t,e):Jl(t,e)}(n,t.stream(lc)),e(lc.result()),null!=r&&t.clipExtent(r),t}function fc(t,e,n){return cc(t,(function(n){var r=e[1][0]-e[0][0],o=e[1][1]-e[0][1],i=Math.min(r/(n[1][0]-n[0][0]),o/(n[1][1]-n[0][1])),a=+e[0][0]+(r-i*(n[1][0]+n[0][0]))/2,u=+e[0][1]+(o-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([a,u])}),n)}var sc=pl(30*fl);function hc(t,e){return+e?function(t,e){function n(r,o,i,a,u,l,c,f,s,h,y,p,v,d){var m=c-r,b=f-o,g=m*m+b*b;if(g>4*e&&v--){var w=a+h,x=u+y,S=l+p,_=ml(w*w+x*x+S*S),P=bl(S/=_),O=sl(sl(S)-1)<ol||sl(i-s)<ol?(i+s)/2:yl(x,w),j=t(O,P),C=j[0],k=j[1],E=C-r,T=k-o,A=b*E-m*T;(A*A/g>e||sl((m*E+b*T)/g-.5)>.3||a*h+u*y+l*p<sc)&&(n(r,o,i,a,u,l,C,k,O,w/=_,x/=_,S,v,d),d.point(C,k),n(C,k,O,w,x,S,c,f,s,h,y,p,v,d))}}return function(e){var r,o,i,a,u,l,c,f,s,h,y,p,v={point:d,lineStart:m,lineEnd:g,polygonStart:function(){e.polygonStart(),v.lineStart=w},polygonEnd:function(){e.polygonEnd(),v.lineStart=m}};function d(n,r){n=t(n,r),e.point(n[0],n[1])}function m(){f=NaN,v.point=b,e.lineStart()}function b(r,o){var i=Cl([r,o]),a=t(r,o);n(f,s,c,h,y,p,f=a[0],s=a[1],c=r,h=i[0],y=i[1],p=i[2],16,e),e.point(f,s)}function g(){v.point=d,e.lineEnd()}function w(){m(),v.point=x,v.lineEnd=S}function x(t,e){b(r=t,e),o=f,i=s,a=h,u=y,l=p,v.point=b}function S(){n(f,s,c,h,y,p,o,i,r,a,u,l,16,e),v.lineEnd=g,g()}return v}}(t,e):function(t){return Hl({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var yc=Hl({point:function(t,e){this.stream.point(t*fl,e*fl)}});function pc(t,e,n,r,o,i){if(!i)return function(t,e,n,r,o){function i(i,a){return[e+t*(i*=r),n-t*(a*=o)]}return i.invert=function(i,a){return[(i-e)/t*r,(n-a)/t*o]},i}(t,e,n,r,o);var a=pl(i),u=vl(i),l=a*t,c=u*t,f=a/t,s=u/t,h=(u*n-a*e)/t,y=(u*e+a*n)/t;function p(t,i){return[l*(t*=r)-c*(i*=o)+e,n-c*t-l*i]}return p.invert=function(t,e){return[r*(f*t-s*e+h),o*(y-s*t-f*e)]},p}function vc(t){return function(t){var e,n,r,o,i,a,u,l,c,f,s=150,h=480,y=250,p=0,v=0,d=0,m=0,b=0,g=0,w=1,x=1,S=null,_=Bl,P=null,O=$l,j=.5;function C(t){return l(t[0]*fl,t[1]*fl)}function k(t){return(t=l.invert(t[0],t[1]))&&[t[0]*cl,t[1]*cl]}function E(){var t=pc(s,0,0,w,x,g).apply(null,e(p,v)),r=pc(s,h-t[0],y-t[1],w,x,g);return n=function(t,e,n){return(t%=ll)?e||n?Gl(Xl(t),ql(e,n)):Xl(t):e||n?ql(e,n):Yl}(d,m,b),u=Gl(e,r),l=Gl(n,u),a=hc(u,j),T()}function T(){return c=f=null,C}return C.stream=function(t){return c&&f===t?c:c=yc(function(t){return Hl({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(_(a(O(f=t)))))},C.preclip=function(t){return arguments.length?(_=t,S=void 0,T()):_},C.postclip=function(t){return arguments.length?(O=t,P=r=o=i=null,T()):O},C.clipAngle=function(t){return arguments.length?(_=+t?Dl(S=t*fl):(S=null,Bl),T()):S*cl},C.clipExtent=function(t){return arguments.length?(O=null==t?(P=r=o=i=null,$l):Wl(P=+t[0][0],r=+t[0][1],o=+t[1][0],i=+t[1][1]),T()):null==P?null:[[P,r],[o,i]]},C.scale=function(t){return arguments.length?(s=+t,E()):s},C.translate=function(t){return arguments.length?(h=+t[0],y=+t[1],E()):[h,y]},C.center=function(t){return arguments.length?(p=t[0]%360*fl,v=t[1]%360*fl,E()):[p*cl,v*cl]},C.rotate=function(t){return arguments.length?(d=t[0]%360*fl,m=t[1]%360*fl,b=t.length>2?t[2]%360*fl:0,E()):[d*cl,m*cl,b*cl]},C.angle=function(t){return arguments.length?(g=t%360*fl,E()):g*cl},C.reflectX=function(t){return arguments.length?(w=t?-1:1,E()):w<0},C.reflectY=function(t){return arguments.length?(x=t?-1:1,E()):x<0},C.precision=function(t){return arguments.length?(a=hc(u,j=t*t),T()):ml(j)},C.fitExtent=function(t,e){return fc(C,t,e)},C.fitSize=function(t,e){return function(t,e,n){return fc(t,[[0,0],e],n)}(C,t,e)},C.fitWidth=function(t,e){return function(t,e,n){return cc(t,(function(n){var r=+e,o=r/(n[1][0]-n[0][0]),i=(r-o*(n[1][0]+n[0][0]))/2,a=-o*n[0][1];t.scale(150*o).translate([i,a])}),n)}(C,t,e)},C.fitHeight=function(t,e){return function(t,e,n){return cc(t,(function(n){var r=+e,o=r/(n[1][1]-n[0][1]),i=-o*n[0][0],a=(r-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([i,a])}),n)}(C,t,e)},function(){return e=t.apply(this,arguments),C.invert=e.invert&&k,E()}}((function(){return t}))()}var dc,mc,bc=(dc=function(t){return ml(2/(1+t))},function(t,e){var n=pl(t),r=pl(e),o=dc(n*r);return o===1/0?[2,0]:[o*r*vl(t),o*vl(e)]});function gc(){return vc(bc).scale(124.75).clipAngle(179.999)}bc.invert=(mc=function(t){return 2*bl(t/2)},function(t,e){var n=ml(t*t+e*e),r=mc(n),o=vl(r),i=pl(r);return[yl(t*o,n*i),bl(n&&e*o/n)]});var wc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"EUR",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,n=arguments.length>2?arguments[2]:void 0,r=(n=n||{}).ex||1.2,o=n.fontFamily||"Arial",i=n.exSize||1;return n.style=n.style||function(t,e){if(!(t.rs<r*e))return t.r1<r*e?i+"em "+o:1.5*i+"em "+o},n.proj=n.proj||gc().rotate([-10,-52]).reflectX(!1).reflectY(!0).scale(6378137).translate([4321e3,321e4]),n.preprocess=function(t){if(n.ccIn&&t.cc&&!(n.ccIn.indexOf(t.cc)>=0))return!1;var e=n.proj([t.lon,t.lat]);t.x=e[0],t.y=e[1],delete t.lon,delete t.lat},n.baseURL=n.baseURL||"https://raw.githubusercontent.com/eurostat/euronym/main/pub/v2/UTF/",n.url=n.baseURL+e+"/"+t+".csv",n},xc=function(t){var e=(t=t||{}).nutsYear||"2021",n=t.crs||"3035",r=t.scale||"03M",o=t.nutsLevel||"3",i=t.col||"#888",a=t.colKosovo||"#bcbcbc",u=null==t.showOth||t.showOth;return t.color=t.color||function(t,e){var n=t.properties;if(u||"T"==n.eu||"T"==n.cc||"T"==n.efta||"T"!==n.oth)return n.id>=1e5?a:"T"===n.co||e<400?i:e<1e3?n.lvl>=3?"":i:e<2e3?n.lvl>=2?"":i:n.lvl>=1?"":i},t.width=t.width||function(t,e){var n=t.properties;return"T"===n.co?.5:e<400?3==n.lvl||2==n.lvl||1==n.lvl?2.2:4:e<1e3?2==n.lvl||1==n.lvl?1.8:2.5:e<2e3?1==n.lvl?1.8:2.5:1.2},t.lineDash=t.lineDash||function(t,e){var n=t.properties;return"T"===n.co?[]:e<400?3==n.lvl?[2*e,2*e]:2==n.lvl||1==n.lvl?[5*e,2*e]:[10*e,3*e]:e<1e3?2==n.lvl||1==n.lvl?[5*e,2*e]:[10*e,3*e]:e<2e3&&1==n.lvl?[5*e,2*e]:[10*e,3*e]},t.baseURL=t.baseURL||"https://raw.githubusercontent.com/eurostat/Nuts2json/master/pub/v2/",t.url=t.baseURL+e+"/"+n+"/"+r+"/nutsbn_"+o+".json",t},Sc=Kn.getParameterByName;return vu({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),e})()));