gridviz 3.0.24 → 3.0.25

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,2 +1,2 @@
1
1
  /*! For license information please see gridviz.min.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.gridviz=e():t.gridviz=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(){return[]}function i(t){return null==t?o:function(){return this.querySelectorAll(t)}}function a(t){return function(){return this.matches(t)}}function u(t){return function(e){return e.matches(t)}}t.r(e),t.d(e,{BackgroundLayer:()=>Dl,BackgroundLayerImage:()=>tc,BackgroundLayerWMS:()=>Yl,CSVGrid:()=>Ao,ColorCategoryLegend:()=>Xc,ColorDiscreteLegend:()=>Wc,ColorLegend:()=>Ic,CompositionStyle:()=>gi,Dataset:()=>Ir,DotDensityStyle:()=>Oa,GeoCanvas:()=>In,GeoJSONLayer:()=>_c,GridLayer:()=>zl,ImageStyle:()=>_l,IsoFenceStyle:()=>sl,JSGrid:()=>Lo,JoyPlotStyle:()=>ci,LabelLayer:()=>hc,Layer:()=>Cr,LegoStyle:()=>vu,Map:()=>cr,MosaicStyle:()=>Fu,MultiResolutionDataset:()=>Dr,NinjaStarStyle:()=>$u,OrientationLegend:()=>ms,PillarStyle:()=>$i,SegmentStyle:()=>ki,ShapeColorSizeStyle:()=>Yo,SideCategoryStyle:()=>aa,SideStyle:()=>Ki,SizeLegend:()=>as,SquareColorCategoryWebGLStyle:()=>Ra,SquareColorWebGLStyle:()=>Tu,StrokeStyle:()=>ei,Style:()=>Sr,TanakaStyle:()=>ou,TernaryLegend:()=>Ps,TextStyle:()=>Ii,TiledGrid:()=>mo,TimeSeriesStyle:()=>Qu,circularInverseScale:()=>zs,circularScale:()=>Ms,classifier:()=>Ka,colorClassifier:()=>Qa,discreteColors:()=>tu,exponentialScale:()=>Ts,getParameterByName:()=>vf,logarithmicScale:()=>Cs,nice:()=>Jc,orientationLegend:()=>gs,powerInverseScale:()=>As,powerScale:()=>Es,sizeDiscreteLegend:()=>cs,sizeDiscreteViewScaleLegend:()=>ss,sizeLegend:()=>us,sizeLegendViewScale:()=>ls,ternaryClassifier:()=>tf,ternaryColorClassifier:()=>ef,viewScale:()=>Ya,viewScaleColor:()=>Xa,viewScaleColorQuantile:()=>Za,viewScaleCombination:()=>Ja,viewScaleQuantile:()=>Va});var l=Array.prototype.find;function c(){return this.firstElementChild}var s=Array.prototype.filter;function f(){return Array.from(this.children)}function h(t){return new Array(t.length)}function y(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function p(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 y(t,i[u]);for(;u<l;++u)(a=e[u])&&(o[u]=a)}function v(t,e,n,r,o,i,a){var u,l,c,s=new Map,f=e.length,h=i.length,p=new Array(f);for(u=0;u<f;++u)(l=e[u])&&(p[u]=c=a.call(l,l.__data__,u,e)+"",s.has(c)?o[u]=l:s.set(c,l));for(u=0;u<h;++u)c=a.call(t,i[u],u,i)+"",(l=s.get(c))?(r[u]=l,l.__data__=i[u],s.delete(c)):n[u]=new y(t,i[u]);for(u=0;u<f;++u)(l=e[u])&&s.get(p[u])===l&&(o[u]=l)}function d(t){return t.__data__}function b(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function m(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}y.prototype={constructor:y,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 g="http://www.w3.org/1999/xhtml";const w={svg:"http://www.w3.org/2000/svg",xhtml:g,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function x(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),w.hasOwnProperty(e)?{space:w[e],local:t}:t}function S(t){return function(){this.removeAttribute(t)}}function O(t){return function(){this.removeAttributeNS(t.space,t.local)}}function _(t,e){return function(){this.setAttribute(t,e)}}function j(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function P(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function k(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 C(t){return function(){this.style.removeProperty(t)}}function E(t,e,n){return function(){this.style.setProperty(t,e,n)}}function A(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function M(t,e){return t.style.getPropertyValue(e)||T(t).getComputedStyle(t,null).getPropertyValue(e)}function z(t){return function(){delete this[t]}}function R(t,e){return function(){this[t]=e}}function I(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function F(t){return t.trim().split(/^|\s+/)}function B(t){return t.classList||new N(t)}function N(t){this._node=t,this._names=F(t.getAttribute("class")||"")}function L(t,e){for(var n=B(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function D(t,e){for(var n=B(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function G(t){return function(){L(this,t)}}function W(t){return function(){D(this,t)}}function U(t,e){return function(){(e.apply(this,arguments)?L:D)(this,t)}}function $(){this.textContent=""}function H(t){return function(){this.textContent=t}}function q(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function Y(){this.innerHTML=""}function V(t){return function(){this.innerHTML=t}}function X(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function Z(){this.nextSibling&&this.parentNode.appendChild(this)}function J(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function K(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===g&&e.documentElement.namespaceURI===g?e.createElement(t):e.createElementNS(n,t)}}function Q(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function tt(t){var e=x(t);return(e.local?Q:K)(e)}function et(){return null}function nt(){var t=this.parentNode;t&&t.removeChild(this)}function rt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ot(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function it(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 at(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 ut(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 lt(t,e){return function(){return ut(this,t,e)}}function ct(t,e){return function(){return ut(this,t,e.apply(this,arguments))}}N.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 st=[null];function ft(t,e){this._groups=t,this._parents=e}function ht(){return new ft([[document.documentElement]],st)}ft.prototype=ht.prototype={constructor:ft,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,s=o[i]=new Array(c),f=0;f<c;++f)(a=l[f])&&(u=t.call(a,a.__data__,f,l))&&("__data__"in a&&(u.__data__=a.__data__),s[f]=u);return new ft(o,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}(t):i(t);for(var e=this._groups,n=e.length,r=[],o=[],a=0;a<n;++a)for(var u,l=e[a],c=l.length,s=0;s<c;++s)(u=l[s])&&(r.push(t.call(u,u.__data__,s,l)),o.push(u));return new ft(r,o)},selectChild:function(t){return this.select(null==t?c:function(t){return function(){return l.call(this.children,t)}}("function"==typeof t?t:u(t)))},selectChildren:function(t){return this.selectAll(null==t?f:function(t){return function(){return s.call(this.children,t)}}("function"==typeof t?t:u(t)))},filter:function(t){"function"!=typeof t&&(t=a(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,u=e[o],l=u.length,c=r[o]=[],s=0;s<l;++s)(i=u[s])&&t.call(i,i.__data__,s,u)&&c.push(i);return new ft(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,d);var n,r=e?v:p,o=this._parents,i=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var a=i.length,u=new Array(a),l=new Array(a),c=new Array(a),s=0;s<a;++s){var f=o[s],h=i[s],y=h.length,m=b(t.call(f,f&&f.__data__,s,o)),g=m.length,w=l[s]=new Array(g),x=u[s]=new Array(g);r(f,h,w,x,c[s]=new Array(y),m,e);for(var S,O,_=0,j=0;_<g;++_)if(S=w[_]){for(_>=j&&(j=_+1);!(O=x[j])&&++j<g;);S._next=O||null}}return(u=new ft(u,o))._enter=l,u._exit=c,u},enter:function(){return new ft(this._enter||this._groups.map(h),this._parents)},exit:function(){return new ft(this._exit||this._groups.map(h),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,s=n[l],f=r[l],h=s.length,y=u[l]=new Array(h),p=0;p<h;++p)(c=s[p]||f[p])&&(y[p]=c);for(;l<o;++l)u[l]=n[l];return new ft(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=m);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),s=0;s<l;++s)(a=u[s])&&(c[s]=a);c.sort(e)}return new ft(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=x(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:S:"function"==typeof e?n.local?k:P:n.local?j:_)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?C:"function"==typeof e?A:E)(t,e,null==n?"":n)):M(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?z:"function"==typeof e?I:R)(t,e)):this.node()[t]},classed:function(t,e){var n=F(t+"");if(arguments.length<2){for(var r=B(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof e?U:e?G:W)(n,e))},text:function(t){return arguments.length?this.each(null==t?$:("function"==typeof t?q:H)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Y:("function"==typeof t?X:V)(t)):this.node().innerHTML},raise:function(){return this.each(Z)},lower:function(){return this.each(J)},append:function(t){var e="function"==typeof t?t:tt(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:tt(t),o=null==e?et:"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(nt)},clone:function(t){return this.select(t?ot:rt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,o,i=function(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}(t+""),a=i.length;if(!(arguments.length<2)){for(u=e?at:it,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,s=u.length;c<s;++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?ct:lt)(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 yt=ht;function pt(t){return"string"==typeof t?new ft([[document.querySelector(t)]],[document.documentElement]):new ft([[t]],st)}var vt={value:()=>{}};function dt(){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 bt(r)}function bt(t){this._=t}function mt(t,e){for(var n,r=0,o=t.length;r<o;++r)if((n=t[r]).name===e)return n.value}function gt(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=vt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}bt.prototype=dt.prototype={constructor:bt,on:function(t,e){var n,r,o=this._,i=(r=o,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),a=-1,u=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<u;)if(n=(t=i[a]).type)o[n]=gt(o[n],t.name,e);else if(null==e)for(n in o)o[n]=gt(o[n],t.name,null);return this}for(;++a<u;)if((n=(t=i[a]).type)&&(n=mt(o[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new bt(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 wt=dt,xt={capture:!0,passive:!1};function St(t){t.preventDefault(),t.stopImmediatePropagation()}function Ot(t){return((t=Math.exp(t))+1/t)/2}const _t=function t(e,n,r){function o(t,o){var i,a,u=t[0],l=t[1],c=t[2],s=o[0],f=o[1],h=o[2],y=s-u,p=f-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),b=(h*h-c*c+r*v)/(2*c*n*d),m=(h*h-c*c-r*v)/(2*h*n*d),g=Math.log(Math.sqrt(b*b+1)-b),w=Math.log(Math.sqrt(m*m+1)-m);a=(w-g)/e,i=function(t){var r,o=t*a,i=Ot(g),s=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+s*y,l+s*p,c*i/Ot(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 jt(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 Pt,kt,Tt=0,Ct=0,Et=0,At=0,Mt=0,zt=0,Rt="object"==typeof performance&&performance.now?performance:Date,It="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ft(){return Mt||(It(Bt),Mt=Rt.now()+zt)}function Bt(){Mt=0}function Nt(){this._call=this._time=this._next=null}function Lt(t,e,n){var r=new Nt;return r.restart(t,e,n),r}function Dt(){Mt=(At=Rt.now())+zt,Tt=Ct=0;try{!function(){Ft(),++Tt;for(var t,e=Pt;e;)(t=Mt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Tt}()}finally{Tt=0,function(){for(var t,e,n=Pt,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:Pt=e);kt=t,Wt(r)}(),Mt=0}}function Gt(){var t=Rt.now(),e=t-At;e>1e3&&(zt-=e,At=t)}function Wt(t){Tt||(Ct&&(Ct=clearTimeout(Ct)),t-Mt>24?(t<1/0&&(Ct=setTimeout(Dt,t-Rt.now()-zt)),Et&&(Et=clearInterval(Et))):(Et||(At=Rt.now(),Et=setInterval(Gt,1e3)),Tt=1,It(Dt)))}function Ut(t,e,n){var r=new Nt;return e=null==e?0:+e,r.restart(n=>{r.stop(),t(n+e)},e,n),r}Nt.prototype=Lt.prototype={constructor:Nt,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Ft():+n)+(null==e?0:+e),this._next||kt===this||(kt?kt._next=this:Pt=this,kt=this),this._call=t,this._time=n,Wt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wt())}};var $t=wt("start","end","cancel","interrupt"),Ht=[];function qt(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,s,f,h;if(1!==n.state)return u();for(c in o)if((h=o[c]).name===n.name){if(3===h.state)return Ut(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(Ut(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(f=n.tween.length),c=0,s=-1;c<f;++c)(h=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(r[++s]=h);r.length=s+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=Lt(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:$t,tween:Ht,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Yt(t,e){var n=Xt(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function Vt(t,e){var n=Xt(t,e);if(n.state>3)throw new Error("too late; already running");return n}function Xt(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Zt(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 Jt(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Kt,Qt=180/Math.PI,te={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ee(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)*Qt,skewX:Math.atan(l)*Qt,scaleX:a,scaleY:u}}function ne(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:Jt(t,o)},{i:l-2,x:Jt(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:Jt(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:Jt(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:Jt(t,n)},{i:u-2,x:Jt(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 re=ne(function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?te:ee(e.a,e.b,e.c,e.d,e.e,e.f)},"px, ","px)","deg)"),oe=ne(function(t){return null==t?te:(Kt||(Kt=document.createElementNS("http://www.w3.org/2000/svg","g")),Kt.setAttribute("transform",t),(t=Kt.transform.baseVal.consolidate())?ee((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):te)},", ",")",")");function ie(t,e){var n,r;return function(){var o=Vt(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 ae(t,e,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=Vt(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 ue(t,e,n){var r=t._id;return t.each(function(){var t=Vt(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)}),function(t){return Xt(t,r).value[e]}}function le(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ce(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function se(){}var fe=.7,he=1/fe,ye="\\s*([+-]?\\d+)\\s*",pe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ve="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",de=/^#([0-9a-f]{3,8})$/,be=new RegExp(`^rgb\\(${ye},${ye},${ye}\\)$`),me=new RegExp(`^rgb\\(${ve},${ve},${ve}\\)$`),ge=new RegExp(`^rgba\\(${ye},${ye},${ye},${pe}\\)$`),we=new RegExp(`^rgba\\(${ve},${ve},${ve},${pe}\\)$`),xe=new RegExp(`^hsl\\(${pe},${ve},${ve}\\)$`),Se=new RegExp(`^hsla\\(${pe},${ve},${ve},${pe}\\)$`),Oe={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 _e(){return this.rgb().formatHex()}function je(){return this.rgb().formatRgb()}function Pe(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=de.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ke(e):3===n?new Ae(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Te(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Te(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=be.exec(t))?new Ae(e[1],e[2],e[3],1):(e=me.exec(t))?new Ae(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ge.exec(t))?Te(e[1],e[2],e[3],e[4]):(e=we.exec(t))?Te(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=xe.exec(t))?Be(e[1],e[2]/100,e[3]/100,1):(e=Se.exec(t))?Be(e[1],e[2]/100,e[3]/100,e[4]):Oe.hasOwnProperty(t)?ke(Oe[t]):"transparent"===t?new Ae(NaN,NaN,NaN,0):null}function ke(t){return new Ae(t>>16&255,t>>8&255,255&t,1)}function Te(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ae(t,e,n,r)}function Ce(t){return t instanceof se||(t=Pe(t)),t?new Ae((t=t.rgb()).r,t.g,t.b,t.opacity):new Ae}function Ee(t,e,n,r){return 1===arguments.length?Ce(t):new Ae(t,e,n,null==r?1:r)}function Ae(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Me(){return`#${Fe(this.r)}${Fe(this.g)}${Fe(this.b)}`}function ze(){const t=Re(this.opacity);return`${1===t?"rgb(":"rgba("}${Ie(this.r)}, ${Ie(this.g)}, ${Ie(this.b)}${1===t?")":`, ${t})`}`}function Re(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ie(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Fe(t){return((t=Ie(t))<16?"0":"")+t.toString(16)}function Be(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Le(t,e,n,r)}function Ne(t){if(t instanceof Le)return new Le(t.h,t.s,t.l,t.opacity);if(t instanceof se||(t=Pe(t)),!t)return new Le;if(t instanceof Le)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 Le(a,u,l,t.opacity)}function Le(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function De(t){return(t=(t||0)%360)<0?t+360:t}function Ge(t){return Math.max(0,Math.min(1,t||0))}function We(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 Ue(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}le(se,Pe,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:_e,formatHex:_e,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ne(this).formatHsl()},formatRgb:je,toString:je}),le(Ae,Ee,ce(se,{brighter(t){return t=null==t?he:Math.pow(he,t),new Ae(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?fe:Math.pow(fe,t),new Ae(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ae(Ie(this.r),Ie(this.g),Ie(this.b),Re(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:Me,formatHex:Me,formatHex8:function(){return`#${Fe(this.r)}${Fe(this.g)}${Fe(this.b)}${Fe(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ze,toString:ze})),le(Le,function(t,e,n,r){return 1===arguments.length?Ne(t):new Le(t,e,n,null==r?1:r)},ce(se,{brighter(t){return t=null==t?he:Math.pow(he,t),new Le(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?fe:Math.pow(fe,t),new Le(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 Ae(We(t>=240?t-240:t+120,o,r),We(t,o,r),We(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new Le(De(this.h),Ge(this.s),Ge(this.l),Re(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=Re(this.opacity);return`${1===t?"hsl(":"hsla("}${De(this.h)}, ${100*Ge(this.s)}%, ${100*Ge(this.l)}%${1===t?")":`, ${t})`}`}}));const $e=t=>()=>t;function He(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):$e(isNaN(t)?e:t)}const qe=function t(e){var n=function(t){return 1===(t=+t)?He: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):$e(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=Ee(t)).r,(e=Ee(e)).r),o=n(t.g,e.g),i=n(t.b,e.b),a=He(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 Ye(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=Ee(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+""}}}Ye(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 Ue((n-r/e)*e,a,o,i,u)}}),Ye(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 Ue((n-r/e)*e,o,i,a,u)}});var Ve=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xe=new RegExp(Ve.source,"g");function Ze(t,e){var n,r,o,i=Ve.lastIndex=Xe.lastIndex=0,a=-1,u=[],l=[];for(t+="",e+="";(n=Ve.exec(t))&&(r=Xe.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:Jt(n,r)})),i=Xe.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 Je(t,e){var n;return("number"==typeof e?Jt:e instanceof Pe?qe:(n=Pe(e))?(e=n,qe):Ze)(t,e)}function Ke(t){return function(){this.removeAttribute(t)}}function Qe(t){return function(){this.removeAttributeNS(t.space,t.local)}}function tn(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 en(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 nn(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 rn(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 on(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,o)),n}return o._value=e,o}function an(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,o)),n}return o._value=e,o}function un(t,e){return function(){Yt(this,t).delay=+e.apply(this,arguments)}}function ln(t,e){return e=+e,function(){Yt(this,t).delay=e}}function cn(t,e){return function(){Vt(this,t).duration=+e.apply(this,arguments)}}function sn(t,e){return e=+e,function(){Vt(this,t).duration=e}}var fn=yt.prototype.constructor;function hn(t){return function(){this.style.removeProperty(t)}}var yn=0;function pn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function vn(){return++yn}var dn=yt.prototype;pn.prototype=function(t){return yt().transition(t)}.prototype={constructor:pn,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,s=o[u],f=s.length,h=a[u]=new Array(f),y=0;y<f;++y)(l=s[y])&&(c=t.call(l,l.__data__,y,s))&&("__data__"in l&&(c.__data__=l.__data__),h[y]=c,qt(h[y],e,n,y,h,Xt(l,n)));return new pn(a,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=i(t));for(var r=this._groups,o=r.length,a=[],u=[],l=0;l<o;++l)for(var c,s=r[l],f=s.length,h=0;h<f;++h)if(c=s[h]){for(var y,p=t.call(c,c.__data__,h,s),v=Xt(c,n),d=0,b=p.length;d<b;++d)(y=p[d])&&qt(y,e,n,d,p,v);a.push(p),u.push(c)}return new pn(a,u,e,n)},selectChild:dn.selectChild,selectChildren:dn.selectChildren,filter:function(t){"function"!=typeof t&&(t=a(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,u=e[o],l=u.length,c=r[o]=[],s=0;s<l;++s)(i=u[s])&&t.call(i,i.__data__,s,u)&&c.push(i);return new pn(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],s=n[u],f=c.length,h=a[u]=new Array(f),y=0;y<f;++y)(l=c[y]||s[y])&&(h[y]=l);for(;u<r;++u)a[u]=e[u];return new pn(a,this._parents,this._name,this._id)},selection:function(){return new fn(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=vn(),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 s=Xt(a,e);qt(a,t,n,c,u,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new pn(r,this._parents,t,n)},call:dn.call,nodes:dn.nodes,node:dn.node,size:dn.size,empty:dn.empty,each:dn.each,on:function(t,e){var n=this._id;return arguments.length<2?Xt(this.node(),n).on.on(t):this.each(function(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)?Yt:Vt;return function(){var a=i(this,t),u=a.on;u!==r&&(o=(r=u).copy()).on(e,n),a.on=o}}(n,t,e))},attr:function(t,e){var n=x(t),r="transform"===n?oe:Je;return this.attrTween(t,"function"==typeof e?(n.local?rn:nn)(n,r,ue(this,"attr."+t,e)):null==e?(n.local?Qe:Ke)(n):(n.local?en:tn)(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=x(t);return this.tween(n,(r.local?on:an)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?re:Je;return null==e?this.styleTween(t,function(t,e){var n,r,o;return function(){var i=M(this,t),a=(this.style.removeProperty(t),M(this,t));return i===a?null:i===n&&a===r?o:o=e(n=i,r=a)}}(t,r)).on("end.style."+t,hn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,o,i;return function(){var a=M(this,t),u=n(this),l=u+"";return null==u&&(this.style.removeProperty(t),l=u=M(this,t)),a===l?null:a===r&&l===o?i:(o=l,i=e(r=a,u))}}(t,r,ue(this,"style."+t,e))).each(function(t,e){var n,r,o,i,a="style."+e,u="end."+a;return function(){var l=Vt(this,t),c=l.on,s=null==l.value[a]?i||(i=hn(e)):void 0;c===n&&o===s||(r=(n=c).copy()).on(u,o=s),l.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,o,i=n+"";return function(){var a=M(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,function(t,e,n){var r,o;function i(){var i=e.apply(this,arguments);return i!==o&&(r=(o=i)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,i,n)),r}return i._value=e,i}(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}}(ue(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(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=Xt(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?ie:ae)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?un:ln)(e,t)):Xt(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?cn:sn)(e,t)):Xt(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){Vt(this,t).ease=e}}(e,t)):Xt(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;Vt(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=Vt(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]:dn[Symbol.iterator]};var bn={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}yt.prototype.interrupt=function(t){return this.each(function(){Zt(this,t)})},yt.prototype.transition=function(t){var e,n;t instanceof pn?(e=t._id,t=t._name):(e=vn(),(n=bn).time=Ft(),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])&&qt(a,t,e,c,u,n||mn(a,e));return new pn(r,this._parents,t,e)};const gn=t=>()=>t;function wn(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 xn(t,e,n){this.k=t,this.x=e,this.y=n}xn.prototype={constructor:xn,scale:function(t){return 1===t?this:new xn(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new xn(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 Sn=new xn(1,0,0);function On(t){t.stopImmediatePropagation()}function _n(t){t.preventDefault(),t.stopImmediatePropagation()}function jn(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Pn(){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 kn(){return this.__zoom||Sn}function Tn(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Cn(){return navigator.maxTouchPoints||"ontouchstart"in this}function En(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 An(t){return An="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},An(t)}function Mn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function zn(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,Rn(r.key),r)}}function Rn(t){var e=function(t){if("object"!=An(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=An(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==An(e)?e:e+""}xn.prototype;var In=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.opts=a||{},this.canvas=e,this.w=this.canvas.offsetWidth,this.h=this.canvas.offsetHeight,this.offscreenCanvas=document.createElement("canvas"),this.offscreenCanvas.width=this.w,this.offscreenCanvas.height=this.h;var u=this.canvas.getContext("2d"),l=this.offscreenCanvas.getContext("2d");if(!u)throw"Impossible to create canvas 2D context";if(!l)throw"Impossible to create canvas 2D context";if(this.ctx=u,this.offscreenCtx=l,this.view={x:r,y:o,z:i},this.backgroundColor=a.backgroundColor||"white",this.onZoomStartFun=a.onZoomStartFun,this.onZoomEndFun=a.onZoomEndFun,this.onZoomFun=a.onZoomFun,this.extGeo={xMin:NaN,xMax:NaN,yMin:NaN,yMax:NaN},this.updateExtentGeo(),!a.disableZoom){var c=Sn;(function(){var t,e,n,r=jn,o=Pn,i=En,a=Tn,u=Cn,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],s=250,f=_t,h=wt("start","zoom","end"),y=0,p=10;function v(t){t.property("__zoom",kn).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",_).filter(u).on("touchstart.zoom",j).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",k).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new xn(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 xn(t.k,r,o)}function m(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function g(t,e,n,r){t.on("start.zoom",function(){w(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(r).end()}).tween("zoom",function(){var t=this,i=arguments,a=w(t,i).event(r),u=o.apply(t,i),l=null==n?m(u):"function"==typeof n?n.apply(t,i):n,c=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),s=t.__zoom,h="function"==typeof e?e.apply(t,i):e,y=f(s.invert(l).concat(c/s.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 xn(n,l[0]-e[0]*n,l[1]-e[1]*n)}a.zoom(null,t)}})}function w(t,e,n){return!n&&t.__zooming||new x(t,e)}function x(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=o.apply(t,e),this.taps=0}function S(t,...e){if(r.apply(this,arguments)){var n=w(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)))),s=jt(t);if(n.wheel)n.mouse[0][0]===s[0]&&n.mouse[0][1]===s[1]||(n.mouse[1]=o.invert(n.mouse[0]=s)),clearTimeout(n.wheel);else{if(o.k===u)return;n.mouse=[s,o.invert(s)],Zt(this),n.start()}_n(t),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",i(b(d(o,u),n.mouse[0],n.mouse[1]),n.extent,c))}}function O(t,...e){if(!n&&r.apply(this,arguments)){var o=t.currentTarget,a=w(this,e,!0).event(t),u=pt(t.view).on("mousemove.zoom",function(t){if(_n(t),!a.moved){var e=t.clientX-s,n=t.clientY-f;a.moved=e*e+n*n>y}a.event(t).zoom("mouse",i(b(a.that.__zoom,a.mouse[0]=jt(t,o),a.mouse[1]),a.extent,c))},!0).on("mouseup.zoom",function(t){u.on("mousemove.zoom mouseup.zoom",null),function(t,e){var n=t.document.documentElement,r=pt(t).on("dragstart.drag",null);e&&(r.on("click.drag",St,xt),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(t.view,a.moved),_n(t),a.event(t).end()},!0),l=jt(t,o),s=t.clientX,f=t.clientY;!function(t){var e=t.document.documentElement,n=pt(t).on("dragstart.drag",St,xt);"onselectstart"in e?n.on("selectstart.drag",St,xt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),On(t),a.mouse=[l,this.__zoom.invert(l)],Zt(this),a.start()}}function _(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=jt(t.changedTouches?t.changedTouches[0]:t,this),u=n.invert(a),l=n.k*(t.shiftKey?.5:2),f=i(b(d(n,l),a,u),o.apply(this,e),c);_n(t),s>0?pt(this).transition().duration(s).call(g,f,a,t):pt(this).call(v.transform,f,a,t)}}function j(n,...o){if(r.apply(this,arguments)){var i,a,u,l,c=n.touches,s=c.length,f=w(this,o,n.changedTouches.length===s).event(n);for(On(n),a=0;a<s;++a)l=[l=jt(u=c[a],this),this.__zoom.invert(l),u.identifier],f.touch0?f.touch1||f.touch0[2]===l[2]||(f.touch1=l,f.taps=0):(f.touch0=l,i=!0,f.taps=1+!!t);t&&(t=clearTimeout(t)),i&&(f.taps<2&&(e=l[0],t=setTimeout(function(){t=null},500)),Zt(this),f.start())}}function P(t,...e){if(this.__zooming){var n,r,o,a,u=w(this,e).event(t),l=t.changedTouches,s=l.length;for(_n(t),n=0;n<s;++n)o=jt(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 f=u.touch0[0],h=u.touch0[1],y=u.touch1[0],p=u.touch1[1],v=(v=y[0]-f[0])*v+(v=y[1]-f[1])*v,m=(m=p[0]-h[0])*m+(m=p[1]-h[1])*m;r=d(r,Math.sqrt(v/m)),o=[(f[0]+y[0])/2,(f[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=w(this,r).event(t),u=t.changedTouches,l=u.length;for(On(t),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),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=jt(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<p)){var c=pt(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return v.transform=function(t,e,n,r){var o=t.selection?t.selection():t;o.property("__zoom",kn),t!==o?g(t,e,n,r):o.interrupt().each(function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()})},v.scaleBy=function(t,e,n,r){v.scaleTo(t,function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)},n,r)},v.scaleTo=function(t,e,n,r){v.transform(t,function(){var t=o.apply(this,arguments),r=this.__zoom,a=null==n?m(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(d(r,l),a,u),t,c)},n,r)},v.translateBy=function(t,e,n,r){v.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)},v.translateTo=function(t,e,n,r,a){v.transform(t,function(){var t=o.apply(this,arguments),a=this.__zoom,u=null==r?m(t):"function"==typeof r?r.apply(this,arguments):r;return i(Sn.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)},x.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=pt(this.that).datum();h.call(t,this.that,new wn(t,{sourceEvent:this.sourceEvent,target:v,type:t,transform:this.that.__zoom,dispatch:h}),e)}},v.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:gn(+t),v):a},v.filter=function(t){return arguments.length?(r="function"==typeof t?t:gn(!!t),v):r},v.touchable=function(t){return arguments.length?(u="function"==typeof t?t:gn(!!t),v):u},v.extent=function(t){return arguments.length?(o="function"==typeof t?t:gn([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),v):o},v.scaleExtent=function(t){return arguments.length?(l[0]=+t[0],l[1]=+t[1],v):[l[0],l[1]]},v.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],v):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},v.constrain=function(t){return arguments.length?(i=t,v):i},v.duration=function(t){return arguments.length?(s=+t,v):s},v.interpolate=function(t){return arguments.length?(f=t,v):f},v.on=function(){var t=h.on.apply(h,arguments);return t===h?v:t},v.clickDistance=function(t){return arguments.length?(y=(t=+t)*t,v):Math.sqrt(y)},v.tapDistance=function(t){return arguments.length?(p=+t,v):p},v})().wheelDelta(function(t){return-t.deltaY*(1===t.deltaMode?.07:t.deltaMode?1:.004)}).on("zoom",function(t){var e=t.transform,r=c.k/e.k;if(1==r){var o=c.x-e.x,i=c.y-e.y;n.applyPan(o*n.view.z,-i*n.view.z)}else s(t,r);c=e,n.onZoomFun&&n.onZoomFun(t)}).on("start",function(t){var e;n._isZooming=!0,n.canvasSave.c=document.createElement("canvas"),n.canvasSave.c.setAttribute("width",""+n.w),n.canvasSave.c.setAttribute("height",""+n.h),null===(e=n.canvasSave.c.getContext("2d"))||void 0===e||e.drawImage(n.canvas,0,0),n.canvasSave.dx=0,n.canvasSave.dy=0,n.canvasSave.f=1,n.onZoomStartFun&&n.onZoomStartFun(t)}).on("end",function(t){n._isZooming=!1,n.redraw(),n.canvasSave={c:null,dx:0,dy:0,f:1},n.onZoomEndFun&&n.onZoomEndFun(t)})(pt(this.canvas));var s=function(t,e){n.cancelCurrentRequests();var r=t.sourceEvent;if(r instanceof WheelEvent)n.applyZoom(e,n.pixToGeoX(r.offsetX),n.pixToGeoY(r.offsetY));else if(r instanceof TouchEvent){var o,i=0,a=0,u=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 Mn(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mn(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}}}}(r.targetTouches);try{for(u.s();!(o=u.n()).done;){var l=o.value;i+=l.clientX,a+=l.clientY}}catch(t){u.e(t)}finally{u.f()}i/=r.targetTouches.length,a/=r.targetTouches.length,n.applyZoom(e,n.pixToGeoX(i),n.pixToGeoY(a))}}}this.xMin=a.centerExtent?a.centerExtent[0]:void 0,this.yMin=a.centerExtent?a.centerExtent[1]:void 0,this.xMax=a.centerExtent?a.centerExtent[2]:void 0,this.yMax=a.centerExtent?a.centerExtent[3]:void 0,this.zoomExtent=a.zoomExtent||[0,1/0],this.canvasSave={c:null,dx:0,dy:0,f:1}}return e=t,n=[{key:"applyPan",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;if(null!=this.xMin&&this.view.x+t<this.xMin&&(t=this.xMin-this.view.x),null!=this.yMin&&this.view.y+e<this.yMin&&(e=this.yMin-this.view.y),null!=this.xMax&&this.view.x+t>this.xMax&&(t=this.xMax-this.view.x),null!=this.yMax&&this.view.y+e>this.yMax&&(e=this.yMax-this.view.y),this.view.x+=t,this.view.y+=e,this.updateExtentGeo(),this.canvasSave.c){var n=1/this.view.z;this.canvasSave.dx-=t*n,this.canvasSave.dy+=e*n,this.clear(this.backgroundColor),this.offscreenCtx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy),this.ctx.drawImage(this.offscreenCtx.canvas,0,0)}else console.log("no canvas save")}},{key:"applyZoom",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.view.x,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.view.y;if(!(this.zoomExtent[0]==this.view.z&&t<=1||this.zoomExtent[1]==this.view.z&&t>=1)){var r=t*this.view.z;r<this.zoomExtent[0]&&(t=this.zoomExtent[0]/this.view.z),r>this.zoomExtent[1]&&(t=this.zoomExtent[1]/this.view.z),this.view.z*=t;var o=(e-this.view.x)*(1-t),i=(n-this.view.y)*(1-t);null!=this.xMin&&this.view.x+o<this.xMin&&(o=this.xMin-this.view.x),null!=this.yMin&&this.view.y+i<this.yMin&&(i=this.yMin-this.view.y),null!=this.xMax&&this.view.x+o>this.xMax&&(o=this.xMax-this.view.x),null!=this.yMax&&this.view.y+i>this.yMax&&(i=this.yMax-this.view.y),this.view.x+=o,this.view.y+=i,this.updateExtentGeo(),this._drawZoomFrame(t,e,n)}}},{key:"_drawZoomFrame",value:function(t,e,n){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.offscreenCtx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy,this.canvasSave.f*this.canvasSave.c.width,this.canvasSave.f*this.canvasSave.c.height),this.ctx.drawImage(this.offscreenCanvas,0,0,this.canvas.width,this.canvas.height))}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"white";this.opts.transparentBackground?(this.ctx.clearRect(0,0,this.w,this.h),this.offscreenCtx.clearRect(0,0,this.w,this.h)):(this.ctx&&(this.ctx.fillStyle=t),this.offscreenCtx&&(this.offscreenCtx.fillStyle=t),this.ctx.fillRect(0,0,this.w,this.h),this.offscreenCtx.fillRect(0,0,this.w,this.h))}},{key:"getView",value:function(){return this.view}},{key:"setCenterExtent",value:function(t){this.xMin=t[0],this.yMin=t[1],this.xMax=t[2],this.yMax=t[3]}},{key:"getCenterExtent",value:function(){return[this.xMin,this.yMin,this.xMax,this.yMax]}},{key:"setZoomExtent",value:function(t){this.zoomExtent=t}},{key:"getZoomExtent",value:function(){return this.zoomExtent}},{key:"initCanvasTransform",value:function(){this.ctx.setTransform(1,0,0,1,0,0),this.offscreenCtx.setTransform(1,0,0,1,0,0)}},{key:"setCanvasTransform",value:function(){var t=1/this.view.z,e=-this.view.x/this.view.z+.5*this.w,n=this.view.y/this.view.z+.5*this.h;this.ctx.setTransform(t,0,0,-t,e,n),this.offscreenCtx.setTransform(t,0,0,-t,e,n)}},{key:"getWebGLTransform",value:function(){var t=2/(this.w*this.view.z),e=2/(this.h*this.view.z);return[t,0,0,0,e,0,-t*this.view.x,-e*this.view.y,1]}},{key:"redraw",value:function(){throw new Error("Method redraw not implemented.")}},{key:"cancelCurrentRequests",value:function(){throw new Error("Method cancelCurrentRequests not implemented.")}},{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.view.x)/this.view.z+.5*this.w}},{key:"geoToPixY",value:function(t){return-(t-this.view.y)/this.view.z+.5*this.h}},{key:"pixToGeoX",value:function(t){return(t-.5*this.w)*this.view.z+this.view.x}},{key:"pixToGeoY",value:function(t){return-(t-.5*this.h)*this.view.z+this.view.y}},{key:"setViewFromURL",value:function(){var e=t.getParameterByName("x"),n=t.getParameterByName("y"),r=t.getParameterByName("z");null==e||null==e||isNaN(+e)||(this.view.x=+e),null==n||null==n||isNaN(+n)||(this.view.y=+n),null==r||null==r||isNaN(+r)||(this.view.z=+r)}}],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&&zn(e.prototype,n),r&&zn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r}();function Fn(t){return Fn="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},Fn(t)}function Bn(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,Nn(r.key),r)}}function Nn(t){var e=function(t){if("object"!=Fn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fn(e)?e:e+""}var Ln=function(){return t=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.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"]||"0px",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.yMouseOffset=e.yMouseOffset||0,this.xMouseOffset=e.xMouseOffset||0,this.parentElement=e.parentElement||document.body,this.tooltipElement=e.tooltipElement||null,this.tooltip=e.tooltipElement?pt(e.tooltipElement):pt(this.parentElement).append("div").attr("id","gridviz-tooltip").attr("class","gridviz-tooltip"),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"),this.tooltip.style("text-wrap","nowrap"),this.tooltip.style("z-index",99999999),this.tooltip.style("left","0"),this.tooltip.style("top","0"),this.tooltip.attr("role","tooltip").attr("aria-live","polite")},e=[{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){var e=this.parentElement.getBoundingClientRect(),n=t.clientX-e.left+this.xOffset,r=t.clientY-e.top-this.yOffset;this.tooltip.style("left",n+"px").style("top",r+"px"),this.ensureTooltipInsideContainer(t,e,this.tooltip.node())}},{key:"ensureTooltipInsideContainer",value:function(t,e,n){var r=n,o=e.width,i=e.height;if(r.offsetLeft+r.clientWidth>o){var a=t.clientX-r.clientWidth-this.xOffset;r.style.left=a+"px"}r.offsetTop+r.clientHeight>i&&(r.style.top=i-r.clientHeight+"px"),r.offsetTop<0&&(r.style.top="0px"),r.offsetLeft<0&&(r.style.left="0px")}},{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)}}],e&&Bn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Dn(t){return Dn="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},Dn(t)}function Gn(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,Wn(r.key),r)}}function Wn(t){var e=function(t){if("object"!=Dn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Dn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Dn(e)?e:e+""}var Un=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.map=e.map,this.parentNode=e.parentNode||e.map.container,e.id&&(this.div=pt("#"+e.id)),this.div&&!this.div.empty()||(this.div=pt(document.createElement("div")),e.id&&this.div.attr("id",e.id)),e.title&&this.div.attr("title",e.title),e.class&&this.div.attr("class",e.class),e.onClickFunction&&this.div.on("click",e.onClickFunction),this.style("box-shadow","0 7px 8px rgba(0,47,103,.08), 0 0 22px rgba(0,47,103,.04), 0 12px 17px rgba(0,47,103,.04), 0 -4px 4px rgba(0,47,103,.04)"),this.style("background-color","#ffffff"),this.style("position","absolute"),this.style("cursor","pointer"),this.style("display","flex"),this.style("justify-content","center"),this.style("align-items","center"),this.style("width","35px"),this.style("height","30px"),this.parentNode.appendChild(this.div.node())},(e=[{key:"style",value:function(t,e){return this.div.style(t,e),this}}])&&Gn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function $n(t){return $n="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},$n(t)}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,qn(r.key),r)}}function qn(t){var e=function(t){if("object"!=$n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=$n(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$n(e)?e:e+""}function Yn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Yn=function(){return!!t})()}function Vn(t){return Vn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vn(t)}function Xn(t,e){return Xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xn(t,e)}var Zn=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=Vn(e),function(t,e){if(e&&("object"==$n(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)}(t,Yn()?Reflect.construct(e,n||[],Vn(t).constructor):e.apply(t,n))}(this,e,[t])).onZoom=t.onZoom,n.delta=t.delta||.2,n.zoomInBtn=document.createElement("a"),n.zoomInBtn.id="zoom-in",n.zoomInBtn.className="gridviz-zoom-button",n.zoomInBtn.title="Zoom in",n.zoomInBtn.textContent="+",n.zoomInBtn.addEventListener("click",function(t){n.zoomIn(t)}),n.zoomInBtn.addEventListener("mouseover",function(){n.zoomInBtn.style.backgroundColor="lightgrey"}),n.zoomInBtn.addEventListener("mouseout",function(){n.zoomInBtn.style.backgroundColor="#ffffff"}),n.zoomOutBtn=document.createElement("a"),n.zoomOutBtn.id="zoom-out",n.zoomOutBtn.className="gridviz-zoom-button",n.zoomOutBtn.title="Zoom out",n.zoomOutBtn.textContent="-",n.zoomOutBtn.addEventListener("click",function(t){n.zoomOut(t)}),n.zoomOutBtn.addEventListener("mouseover",function(){n.zoomOutBtn.style.backgroundColor="lightgrey"}),n.zoomOutBtn.addEventListener("mouseout",function(){n.zoomOutBtn.style.backgroundColor="#ffffff"}),[n.zoomInBtn,n.zoomOutBtn].forEach(function(t,e){t.style.alignItems="center",t.style.justifyContent="center",t.style.display="flex",t.style.border="none",t.style.color="black",t.style.textAlign="center",t.style.textDecoration="none",t.style.padding="4px",t.style.fontSize="24px",t.style.fontWeight="bold",t.style.userSelect="none",t.style.backgroundColor="#ffffff",0===e&&(t.style.borderBottom="1px solid grey")}),n.style("height","unset"),n.style("display","unset"),t.x?n.style("left",t.x+"px"):n.style("right","10px"),t.y?n.style("top",t.y+"px"):n.style("top","10px"),n.div.node().appendChild(n.zoomInBtn),n.div.node().appendChild(n.zoomOutBtn),n}return 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&&Xn(t,e)}(e,t),n=e,r=[{key:"zoomIn",value:function(t){this.map.setZoom(this.map.getZoom()*(1-this.delta)).redraw(),this.onZoom&&this.onZoom(t),this.map.geoCanvas.onZoomFun&&this.map.geoCanvas.onZoomFun(t)}},{key:"zoomOut",value:function(t){this.map.setZoom(this.map.getZoom()*(1+this.delta)).redraw(),this.onZoom&&this.onZoom(t),this.map.geoCanvas.onZoomFun&&this.map.geoCanvas.onZoomFun(t)}}],r&&Hn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Un);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 Kn(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,nr(r.key),r)}}function Qn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Qn=function(){return!!t})()}function tr(t){return tr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tr(t)}function er(t,e){return er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},er(t,e)}function nr(t){var e=function(t){if("object"!=Jn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Jn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Jn(e)?e:e+""}var rr=function(t){function e(t){var n,r,o,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=tr(e),function(t,e){if(e&&("object"==Jn(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)}(t,Qn()?Reflect.construct(e,n||[],tr(t).constructor):e.apply(t,n))}(this,e,[t]),r=n,i=!1,(o=nr(o="isFullscreen"))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,n.div.node().innerHTML='\n <svg\n style="height: 1.2rem; width: 1.2rem; fill:black; margin:0;"\n focusable="false"\n aria-hidden="true"\n >\n <svg fill="#000000" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg">\n <title/>\n <g>\n <path d="M30,0H6A5.9966,5.9966,0,0,0,0,6V30a6,6,0,0,0,12,0V12H30A6,6,0,0,0,30,0Z"/>\n <path d="M90,0H66a6,6,0,0,0,0,12H84V30a6,6,0,0,0,12,0V6A5.9966,5.9966,0,0,0,90,0Z"/>\n <path d="M30,84H12V66A6,6,0,0,0,0,66V90a5.9966,5.9966,0,0,0,6,6H30a6,6,0,0,0,0-12Z"/>\n <path d="M90,60a5.9966,5.9966,0,0,0-6,6V84H66a6,6,0,0,0,0,12H90a5.9966,5.9966,0,0,0,6-6V66A5.9966,5.9966,0,0,0,90,60Z"/>\n </g>\n </svg>\n </svg>\n ',n.defaultHeight=n.map.h,n.defaultWidth=n.map.w,n.div.on("click",function(t){n.onClickFunction(t)}),n.div.on("mouseover",function(t){n.style("background-color","lightgrey")}),n.div.on("mouseout",function(t){n.style("background-color","#ffffff")}),t.x?n.style("left",t.x+"px"):n.style("right","10px"),t.y?n.style("top",t.y+"px"):n.style("top","90px"),n}return 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&&er(t,e)}(e,t),n=e,(r=[{key:"onClickFunction",value:function(t){this.isFullscreen?(this.closeFullscreen(this.map.container),this.map.h=this.defaultHeight,this.map.w=this.defaultWidth,this.map.geoCanvas.h=this.defaultHeight,this.map.geoCanvas.w=this.defaultWidth,this.map.geoCanvas.canvas.setAttribute("width",""+this.defaultWidth),this.map.geoCanvas.canvas.setAttribute("height",""+this.defaultHeight),this.map.redraw(),this.isFullscreen=!1):(this.openFullscreen(this.map.container),this.map.h=window.screen.height,this.map.w=window.screen.width,this.isFullscreen=!0)}},{key:"openFullscreen",value:function(t){t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen()}},{key:"closeFullscreen",value:function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()}}])&&Kn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Un);function or(t){return or="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},or(t)}function ir(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 ar(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ar(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 ar(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ur(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,lr(r.key),r)}}function lr(t){var e=function(t){if("object"!=or(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=or(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==or(e)?e:e+""}var cr=function(){return t=function t(e,n){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=n||{},this.layers=n.layers||[],this.container=e||document.getElementById("gridviz"),this.container?(this.container.style.position="relative",this.w=n.w||this.container.offsetWidth,this.h=n.h||this.container.offsetHeight,this._canvas=n.canvas||this.initialiseCanvas(),this.geoCanvas=new In(this._canvas,n.x,n.y,n.z,n),this.geoCanvas.redraw=function(){r.redraw()},this.geoCanvas.cancelCurrentRequests=function(){var t,e=ir(r.layers);try{for(e.s();!(t=e.n()).done;){var n,o,i,a=t.value;if(null!==(n=a.dataset)&&void 0!==n&&n.datasets){var u,l,c=ir(null===(u=a.dataset)||void 0===u?void 0:u.datasets);try{for(c.s();!(l=c.n()).done;){var s=l.value;null!=s&&s.cancelCurrentRequests&&s.cancelCurrentRequests()}}catch(t){c.e(t)}finally{c.f()}}null!==(o=a.dataset)&&void 0!==o&&o.cancelCurrentRequests&&(null===(i=a.dataset)||void 0===i||i.cancelCurrentRequests())}}catch(t){e.e(t)}finally{e.f()}},this.legend=n.legendContainer?pt(n.legendContainer):null,this.legend||this.initialiseLegend(),n.tooltip||(n.tooltip={}),n.tooltip.parentElement||(n.tooltip.parentElement=this.container),this.tooltip=new Ln(n.tooltip),this.mouseOverHandler=function(t){return r.focusCell(t)},this.mouseMoveHandler=function(t){return r.focusCell(t)},this.mouseOutHandler=function(t){return r.tooltip.hide()},this.geoCanvas.canvas.addEventListener("mouseover",this.mouseOverHandler),this.geoCanvas.canvas.addEventListener("mousemove",this.mouseMoveHandler),this.geoCanvas.canvas.addEventListener("mouseout",this.mouseOutHandler),this.defineResizeObserver(),this.geoCanvas.onZoomStartFun=function(t){n.onZoomStartFun&&n.onZoomStartFun(t),r.tooltip.hide()},this.canvasSave=null,this.selectionRectangleColor=n.selectionRectangleColor||"#FF6347",this.selectionRectangleWidthPix=n.selectionRectangleWidthPix||function(){return 4},this.transparentBackground=n.transparentBackground,this.defaultGlobalCompositeOperation=n.defaultGlobalCompositeOperation||this.geoCanvas.ctx.globalCompositeOperation):console.error("Cannot find gridviz container element.")},e=[{key:"initialiseCanvas",value:function(){var t=document.createElement("canvas");return t.setAttribute("width",""+this.w),t.setAttribute("height",""+this.h),this.container.appendChild(t),t}},{key:"initialiseLegend",value:function(){this.legend=pt(this.container).append("div").attr("id","gridviz-legend").style("position","absolute").style("width","auto").style("height","auto").style("background","#FFFFFF").style("border","0px").style("box-shadow","3px 3px 3px grey, -3px -3px 3px #ddd").style("font-family","Helvetica, Arial, sans-serif").style("bottom","15px").style("right","15px")}},{key:"layers_",value:function(t){return 0===arguments.length?this.layers:(1===arguments.length?Array.isArray(t)?this.layers=t:this.layers=[t]:this.layers=arguments,this)}},{key:"redraw",value:function(){console.log("%cMap.redraw START","color:orange","z=",this.geoCanvas.view.z);var t=performance.now();this.legend&&this.legend.selectAll("*").remove(),this.geoCanvas.initCanvasTransform(),this.geoCanvas.clear(this.geoCanvas.backgroundColor);var e=this.geoCanvas.view.z;this.updateExtentGeo();var n,r=ir(this.layers);try{for(r.s();!(n=r.n()).done;){var o=n.value;console.log("%cDrawing layer","color:gray","z=",this.geoCanvas.view.z),o.visible&&!o.visible(e)||(this.geoCanvas.offscreenCtx.globalAlpha=o.alpha?o.alpha(e):1,o.blendOperation&&(this.geoCanvas.offscreenCtx.globalCompositeOperation=o.blendOperation(e)),this.geoCanvas.setCanvasTransform(),o.draw(this.geoCanvas,this.legend),o.filterColor&&o.drawFilter(this.geoCanvas),this.geoCanvas.offscreenCtx.globalAlpha=1,this.geoCanvas.offscreenCtx.globalCompositeOperation=this.defaultGlobalCompositeOperation)}}catch(t){r.e(t)}finally{r.f()}return this.geoCanvas.initCanvasTransform(),this.geoCanvas.ctx.drawImage(this.geoCanvas.offscreenCanvas,0,0),this.canvasSave=null,console.log("%cMap.redraw END","color:orange","elapsed=",(performance.now()-t).toFixed(1),"ms"),this}},{key:"updateExtentGeo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return this.geoCanvas.updateExtentGeo(t)}},{key:"focusCell",value:function(t){if(!this.geoCanvas._isZooming){var e={x:this.geoCanvas.pixToGeoX(t.offsetX+this.tooltip.xMouseOffset),y:this.geoCanvas.pixToGeoY(t.offsetY+this.tooltip.yMouseOffset)},n=this.getCellFocusInfo(e);if(this.transparentBackground)if(this.geoCanvas.initCanvasTransform(),this.geoCanvas.ctx.clearRect(0,0,this.w,this.h),this.geoCanvas.ctx.drawImage(this.geoCanvas.offscreenCanvas,0,0),n){this.tooltip.html(n.html),this.tooltip.setPosition(t),this.tooltip.show();var r=this.selectionRectangleWidthPix?this.selectionRectangleWidthPix(n.resolution,this.geoCanvas.view.z):4,o=this.geoCanvas.ctx;o.save(),o.strokeStyle=this.selectionRectangleColor,o.lineWidth=r,o.beginPath();var i=this.geoCanvas.geoToPixX(n.cell.x),a=this.geoCanvas.geoToPixY(n.cell.y),u=n.resolution/this.geoCanvas.view.z,l=-u;o.rect(i-r/2,a+r/2,u+r,l-r),o.stroke(),o.restore()}else this.tooltip.hide();else if(n){var c;this.tooltip.html(n.html),this.tooltip.setPosition(t),this.tooltip.show(),this.canvasSave?this.geoCanvas.offscreenCtx.drawImage(this.canvasSave,0,0):(this.canvasSave=document.createElement("canvas"),this.canvasSave.setAttribute("width",""+this.w),this.canvasSave.setAttribute("height",""+this.h),null===(c=this.canvasSave.getContext("2d"))||void 0===c||c.drawImage(this.geoCanvas.offscreenCanvas,0,0));var s=this.selectionRectangleWidthPix?this.selectionRectangleWidthPix(n.resolution,this.geoCanvas.view.z):4;this.geoCanvas.initCanvasTransform();var f=this.geoCanvas.offscreenCtx;f.strokeStyle=this.selectionRectangleColor,f.lineWidth=s,f.beginPath(),f.rect(this.geoCanvas.geoToPixX(n.cell.x)-s/2,this.geoCanvas.geoToPixY(n.cell.y)+s/2,n.resolution/this.geoCanvas.view.z+s,-n.resolution/this.geoCanvas.view.z-s),f.stroke(),this.geoCanvas.ctx.drawImage(this.geoCanvas.offscreenCanvas,0,0)}else this.tooltip.hide(),this.canvasSave&&this.geoCanvas.ctx.drawImage(this.canvasSave,0,0)}}},{key:"getCellFocusInfo",value:function(t){for(var e=this.geoCanvas.view.z,n=this.layers.length-1;n>=0;n--){var r=this.layers[n];if((!r.visible||r.visible(e))&&"none"!==r.cellInfoHTML&&r.cellInfoHTML&&r.getDataset){var o=r.getDataset(e);if(o){var i=o.getCellFromPosition(t,o.getViewCache());if(!i)return;if(o.mixedResolution){var a=+o.mixedResolution(i),u=r.cellInfoHTML(i,a);if(!u)return;return{cell:i,html:u,resolution:a}}var l=r.cellInfoHTML(i,o.getResolution());if(!l)return;return{cell:i,html:l,resolution:o.getResolution()}}}}}},{key:"setView",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.geoCanvas.view.x=t,this.geoCanvas.view.y=e,null!=n&&(this.geoCanvas.view.z=n),this}},{key:"getView",value:function(){return this.geoCanvas.view}},{key:"getZoom",value:function(){return this.geoCanvas.view.z}},{key:"setZoom",value:function(t){return this.geoCanvas.view.z=t,this}},{key:"getCenterExtent",value:function(){return this.geoCanvas.getCenterExtent()}},{key:"setCenterExtent",value:function(t){return this.geoCanvas.setCenterExtent(t),this}},{key:"getZoomExtent",value:function(){return this.geoCanvas.getZoomExtent()}},{key:"setZoomExtent",value:function(t){return this.geoCanvas.setZoomExtent(t),this}},{key:"getBackgroundColor",value:function(){return this.geoCanvas.backgroundColor}},{key:"setBackgroundColor",value:function(t){return this.geoCanvas.backgroundColor=t,this}},{key:"addZoomButtons",value:function(t){return this.zoomButtons=new Zn({map:this,id:(null==t?void 0:t.id)||"gridviz-zoom-buttons-"+this.container.id,class:null==t?void 0:t.class,x:null==t?void 0:t.x,y:null==t?void 0:t.y,onZoom:null==t?void 0:t.onZoom,delta:(null==t?void 0:t.delta)||.2}),this}},{key:"addFullscreenButton",value:function(t){return this.fullscreenButton=new rr({map:this,id:(null==t?void 0:t.id)||"gridviz-fullscreen-button",class:null==t?void 0:t.class,x:null==t?void 0:t.x,y:null==t?void 0:t.y}),this}},{key:"setViewFromURL",value:function(){return this.geoCanvas.setViewFromURL(),this}},{key:"defineResizeObserver",value:function(){var t=this,e=!1;new ResizeObserver(function(n){if(Array.isArray(n)&&n.length){var r=t.container;r.clientWidth>0&&r.clientHeight>0&&(e||(e=!0,window.requestAnimationFrame(function(){e=!1,t.h===r.clientHeight&&t.w===r.clientWidth||(t.h=r.clientHeight,t.w=r.clientWidth,t.geoCanvas.h=t.h,t.geoCanvas.w=t.w,t.geoCanvas.canvas.setAttribute("width",String(t.w)),t.geoCanvas.canvas.setAttribute("height",String(t.h)),t.geoCanvas.offscreenCanvas.setAttribute("width",String(t.w)),t.geoCanvas.offscreenCanvas.setAttribute("height",String(t.h)),t.redraw())})))}}).observe(this.container)}},{key:"destroy",value:function(){var t,e;this.layers=[],this.bgLayers=[],this.container.removeEventListener("mouseover",this.mouseOverHandler),this.container.removeEventListener("mousemove",this.mouseMoveHandler),this.container.removeEventListener("mouseout",this.mouseOutHandler),this.geoCanvas.canvas.remove(),null===(t=this.legend)||void 0===t||t.remove(),null===(e=this.tooltip.tooltip)||void 0===e||e.remove()}}],e&&ur(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function sr(t){return sr="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},sr(t)}function fr(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,hr(r.key),r)}}function hr(t){var e=function(t){if("object"!=sr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=sr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==sr(e)?e:e+""}var yr=function(){return t=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.visible=e.visible,this.alpha=e.alpha,this.blendOperation=e.blendOperation||function(t){return"source-over"},this.filterColor=e.filterColor,this.filterBlendOperation=e.filterBlendOperation},(e=[{key:"drawFilter",value:function(t){if(this.filterColor){var e=this.filterColor(t.view.z);if(e&&"none"!=e){t.offscreenCtx.fillStyle=e;var n=void 0,r=void 0;this.filterBlendOperation&&(n=t.offscreenCtx.globalCompositeOperation,r=this.filterBlendOperation(t.view.z)),r&&"none"!=r&&(t.offscreenCtx.globalCompositeOperation=r),t.offscreenCtx.fillRect(0,0,t.w,t.h),n&&(t.offscreenCtx.globalCompositeOperation=n)}}}}])&&fr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function pr(t){return pr="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},pr(t)}function vr(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 dr(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dr(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 dr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function br(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,mr(r.key),r)}}function mr(t){var e=function(t){if("object"!=pr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=pr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pr(e)?e:e+""}function gr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(gr=function(){return!!t})()}function wr(t){return wr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wr(t)}function xr(t,e){return xr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xr(t,e)}var Sr=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=wr(e),function(t,e){if(e&&("object"==pr(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)}(t,gr()?Reflect.construct(e,n||[],wr(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.viewScale=t.viewScale,n.filter=t.filter||void 0,n.offset=t.offset||function(t,e,n){return{dx:0,dy:0}},n.drawFun=t.drawFun,n.legends=[],n}return 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&&xr(t,e)}(e,t),n=e,o=[{key:"updateLegendsRecursive",value:function(t,e){if(Array.isArray(t)){var n,r=vr(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;this.updateLegendsRecursive(o,e)}}catch(t){r.e(t)}finally{r.f()}}else t.update(e)}}],(r=[{key:"draw",value:function(t,e,n){if(!this.drawFun)throw new Error("Method draw not implemented.");this.drawFun(t,e,n)}},{key:"getOffset",value:function(){return this.offset}},{key:"setOffset",value:function(t){return this.offset=t,this}},{key:"updateLegends",value:function(t){return e.updateLegendsRecursive(this.legends,t),this}},{key:"addLegends",value:function(t){var e,n=vr(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.legends.push(r)}}catch(t){n.e(t)}finally{n.f()}return this}}])&&br(n.prototype,r),o&&br(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(yr);function Or(t){return Or="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},Or(t)}function _r(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,jr(r.key),r)}}function jr(t){var e=function(t){if("object"!=Or(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Or(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Or(e)?e:e+""}function Pr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Pr=function(){return!!t})()}function kr(t){return kr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kr(t)}function Tr(t,e){return Tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tr(t,e)}var Cr=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=kr(e),function(t,e){if(e&&("object"==Or(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)}(t,Pr()?Reflect.construct(e,n||[],kr(t).constructor):e.apply(t,n))}(this,e,arguments)}return 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&&Tr(t,e)}(e,t),n=e,(r=[{key:"draw",value:function(t){throw new Error("Method draw not implemented.")}}])&&_r(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yr);function Er(t){return Er="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},Er(t)}function Ar(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={}.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}}}}function Mr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}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,Rr(r.key),r)}}function Rr(t){var e=function(t){if("object"!=Er(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Er(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Er(e)?e:e+""}var Ir=function(){return t=function t(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.map=e,this.url=n,this.resolution=r,this.mixedResolution=o.mixedResolution,this.preprocess=o.preprocess||void 0,this.cellsViewCache=[]},(e=[{key:"getData",value:function(){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){if(this.mixedResolution){var n,r=Ar(e);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=+this.mixedResolution(o);if(!(t.x<o.x||o.x+i<t.x||t.y<o.y||o.y+i<t.y))return o}}catch(t){r.e(t)}finally{r.f()}}else{var a,u=this.getResolution(),l=Ar(e);try{for(l.s();!(a=l.n()).done;){var c=a.value;if(!(t.x<c.x||c.x+u<t.x||t.y<c.y||c.y+u<t.y))return c}}catch(t){l.e(t)}finally{l.f()}}}},{key:"getResolution",value:function(){return this.resolution}},{key:"getViewCache",value:function(){return this.cellsViewCache}},{key:"getDataset",value:function(t,e){return this}}])&&zr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Fr(t){return Fr="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},Fr(t)}function Br(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Nr(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,Lr(r.key),r)}}function Lr(t){var e=function(t){if("object"!=Fr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fr(e)?e:e+""}var Dr=function(){return t=function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=r||{},this.resolutions=e,this.datasets="function"==typeof n?this.resolutions.map(n):n,this.datasets.length>1&&this.datasets.length!=this.resolutions.length)throw new Error("Uncompatible number of datasets and resolutions: "+this.datasets.length+" "+this.resolutions.length);r.preprocess&&this.setPrepocesses(r.preprocess)},(e=[{key:"getDataset",value:function(t,e){if(1==this.datasets.length)return this.datasets[0];for(var n=this.resolutions,r=0,o=n[r]/e;o<t&&r<n.length;)o=n[++r]/e;return r==n.length?this.datasets[n.length-1]:this.datasets[r]}},{key:"setPrepocesses",value:function(t){var e,n=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 Br(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?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}}}}(this.datasets);try{for(n.s();!(e=n.n()).done;)e.value.preprocess=t}catch(t){n.e(t)}finally{n.f()}return this}}])&&Nr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Gr(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function Wr(t,e){return fetch(t,e).then(Gr)}var Ur={},$r={};function Hr(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function qr(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 Yr(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function Vr(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 s(){if(l)return $r;if(c)return c=!1,Ur;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=s())!==$r;){for(var f=[];r!==Ur&&r!==$r;)f.push(r),r=s();e&&null==(f=e(f,u++))||o.push(f)}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?"-"+Yr(-r,6):r>9999?"+"+Yr(r,6):Yr(r,4))+"-"+Yr(n.getUTCMonth()+1,2)+"-"+Yr(n.getUTCDate(),2)+(u?"T"+Yr(o,2)+":"+Yr(i,2)+":"+Yr(a,2)+"."+Yr(u,3)+"Z":a?"T"+Yr(o,2)+":"+Yr(i,2)+":"+Yr(a,2)+"Z":i||o?"T"+Yr(o,2)+":"+Yr(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=Hr(t);return function(r,o){return e(n(r),o,t)}}(t,e):Hr(t)});return i.columns=o||[],i},parseRows:r,format:function(e,n){return null==n&&(n=qr(e)),[n.map(a).join(t)].concat(o(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=qr(t)),o(t,e).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}}var Xr=Vr(","),Zr=Xr.parse,Jr=(Xr.parseRows,Xr.format,Xr.formatBody,Xr.formatRows,Xr.formatRow,Xr.formatValue,Vr("\t")),Kr=Jr.parse;function Qr(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function to(t,e){return fetch(t,e).then(Qr)}function eo(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=void 0),to(e,n).then(function(e){return t(e,r)})}}function no(t,e,n,r){3===arguments.length&&"function"==typeof n&&(r=n,n=void 0);var o=Vr(t);return to(e,n).then(function(t){return o.parse(t,r)})}Jr.parseRows,Jr.format,Jr.formatBody,Jr.formatRows,Jr.formatRow,Jr.formatValue;var ro=eo(Zr);function oo(t){return oo="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},oo(t)}function io(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 ao(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ao(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 ao(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function uo(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(oo(t)+" is not iterable")}function lo(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof u?r:u,c=Object.create(l.prototype);return co(c,"_invoke",function(n,r,o){var i,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(e,n){return i=e,u=0,l=t,h.n=n,a}};function y(n,r){for(u=n,l=r,e=0;!f&&c&&!o&&e<s.length;e++){var o,i=s[e],y=h.p,p=i[2];n>3?(o=p===r)&&(l=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=n<2&&y<i[1])?(u=0,h.v=r,h.n=i[1]):y<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,u=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&y(s,p),u=s,l=p;(e=u<2?t:l)||!f;){i||(u?u<3?(u>1&&(h.n=-1),y(u,l)):h.n=l:h.v=l);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=h.n<0)?l:n.call(r,h))!==a)break}catch(e){i=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),c}var a={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(co(e={},r,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,co(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,co(f,"constructor",c),co(c,"constructor",l),l.displayName="GeneratorFunction",co(c,o,"GeneratorFunction"),co(f),co(f,o,"Generator"),co(f,r,function(){return this}),co(f,"toString",function(){return"[object Generator]"}),(lo=function(){return{w:i,m:h}})()}function co(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}co=function(t,e,n,r){function i(e,n){co(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},co(t,e,n,r)}function so(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function fo(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){so(i,r,o,a,u,"next",t)}function u(t){so(i,r,o,a,u,"throw",t)}a(void 0)})}}function ho(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,yo(r.key),r)}}function yo(t){var e=function(t){if("object"!=oo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=oo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==oo(e)?e:e+""}function po(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(po=function(){return!!t})()}function vo(t){return vo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vo(t)}function bo(t,e){return bo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bo(t,e)}eo(Kr);var mo=function(t){function e(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=vo(e),function(t,e){if(e&&("object"==oo(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)}(t,po()?Reflect.construct(e,n||[],vo(t).constructor):e.apply(t,n))}(this,e,[t,n,0,o])).onlyDrawWhenAllTilesReady=o.onlyDrawWhenAllTilesReady||!1,r.info=void 0,r.infoLoadingStatus="notLoaded",r.cache={},r.loadInfo(),r}return 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&&bo(t,e)}(e,t),n=e,r=[{key:"loadInfo",value:function(){var t=this;return this.info||"notLoaded"!==this.infoLoadingStatus?"loaded"!==this.infoLoadingStatus&&"failed"!==this.infoLoadingStatus||this.map.redraw():fo(lo().m(function e(){var n;return lo().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Wr(t.url+"info.json");case 1:n=e.v,t.info=n,t.resolution=n.resolutionGeo,t.infoLoadingStatus="loaded",t.map.redraw(),e.n=3;break;case 2:e.p=2,e.v,t.infoLoadingStatus="failed";case 3:return e.a(2)}},e,null,[[0,2]])}))(),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()}},{key:"getData",value:(i=fo(lo().m(function t(e){var n,r,o,i,a,u,l,c,s,f,h,y,p,v,d,b,m=this;return lo().w(function(t){for(;;)switch(t.n){case 0:if(this.info){t.n=1;break}return t.a(2,this);case 1:if(this.abortController=new AbortController,n=this.abortController.signal,r=this.getTilingEnvelope(e)){t.n=2;break}return t.a(2,this);case 2:o=this.info.tilingBounds,i=o.xMin,a=o.xMax,u=o.yMin,l=o.yMax,c=Math.max(r.xMin,i),s=Math.min(r.xMax,a),f=Math.max(r.yMin,u),h=Math.min(r.yMax,l),y=(s-c+1)*(h-f+1),p=0,v=[],d=lo().m(function t(e){var r,o;return lo().w(function(t){for(;;)switch(t.n){case 0:r=lo().m(function t(r){return lo().w(function(t){for(;;)switch(t.n){case 0:if(m.cache[e]||(m.cache[e]={}),!m.cache[e][r]||"failed"===m.cache[e][r]){t.n=1;break}return++p,t.a(2,1);case 1:m.cache[e][r]="loading",v.push(m.loadTile(e,r,n).then(function(t){m.cache[e][r]=t;var n=++p===y;m.checkAndRedraw(t,n)}).catch(function(){m.cache[e][r]="failed",++p}));case 2:return t.a(2)}},t)}),o=f;case 1:if(!(o<=h)){t.n=4;break}return t.d(uo(r(o)),2);case 2:if(!t.v){t.n=3;break}return t.a(3,3);case 3:o++,t.n=1;break;case 4:return t.a(2)}},t)}),b=c;case 3:if(!(b<=s)){t.n=5;break}return t.d(uo(d(b)),4);case 4:b++,t.n=3;break;case 5:return t.n=6,Promise.allSettled(v);case 6:return t.a(2,this)}},t,this)})),function(t){return i.apply(this,arguments)})},{key:"loadTile",value:(o=fo(lo().m(function t(e,n,r){var o,i,a,u=this;return lo().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,ro("".concat(this.url).concat(e,"/").concat(n,".csv"),{signal:r});case 1:if(o=t.v,i=this.preprocess?o.filter(function(t){return!1!==u.preprocess(t)}):o,this.info){t.n=2;break}throw new Error("Tile info unknown");case 2:return t.a(2,go(i,e,n,this.info));case 3:throw t.p=3,"AbortError"===(a=t.v).name&&console.warn("Tile request for ".concat(e,", ").concat(n," was aborted.")),a;case 4:return t.a(2)}},t,this,[[0,3]])})),function(t,e,n){return o.apply(this,arguments)})},{key:"cancelCurrentRequests",value:function(){this.abortController&&this.abortController.abort()}},{key:"checkAndRedraw",value:function(t,e){var n,r=!1,o=this.map.getZoom(),i=io(this.map.layers);try{for(i.s();!(n=i.n()).done;){var a=n.value;if((!a.visible||a.visible(o))&&a.getDataset&&a.getDataset(o)==this){r=!0;break}}}catch(t){i.e(t)}finally{i.f()}if(r){var u=this.map.updateExtentGeo(),l=t.extGeo,c=l.xMin,s=l.xMax,f=l.yMin,h=l.yMax;u.xMax<=c||u.xMin>=s||u.yMax<=f||u.yMin>=h||(this.onlyDrawWhenAllTilesReady?e&&this.map.redraw():this.map.redraw())}}},{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=io(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()}}}}}}],r&&ho(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o,i}(Ir);function go(t,e,n,r){var o={};o.cells=t,o.x=e,o.y=n;var i=r.resolutionGeo,a=r.tileSizeCell;o.extGeo={xMin:r.originPoint.x+i*a*o.x,xMax:r.originPoint.x+i*a*(o.x+1),yMin:r.originPoint.y+i*a*o.y,yMax:r.originPoint.y+i*a*(o.y+1)};var u,l=io(o.cells);try{for(l.s();!(u=l.n()).done;){var c=u.value;c.x=o.extGeo.xMin+c.x*i,c.y=o.extGeo.yMin+c.y*i}}catch(t){l.e(t)}finally{l.f()}return o}function wo(t){return wo="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},wo(t)}function xo(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof u?r:u,c=Object.create(l.prototype);return So(c,"_invoke",function(n,r,o){var i,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(e,n){return i=e,u=0,l=t,h.n=n,a}};function y(n,r){for(u=n,l=r,e=0;!f&&c&&!o&&e<s.length;e++){var o,i=s[e],y=h.p,p=i[2];n>3?(o=p===r)&&(l=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=n<2&&y<i[1])?(u=0,h.v=r,h.n=i[1]):y<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,u=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&y(s,p),u=s,l=p;(e=u<2?t:l)||!f;){i||(u?u<3?(u>1&&(h.n=-1),y(u,l)):h.n=l:h.v=l);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=h.n<0)?l:n.call(r,h))!==a)break}catch(e){i=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),c}var a={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(So(e={},r,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,So(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,So(f,"constructor",c),So(c,"constructor",l),l.displayName="GeneratorFunction",So(c,o,"GeneratorFunction"),So(f),So(f,o,"Generator"),So(f,r,function(){return this}),So(f,"toString",function(){return"[object Generator]"}),(xo=function(){return{w:i,m:h}})()}function So(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}So=function(t,e,n,r){function i(e,n){So(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},So(t,e,n,r)}function Oo(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 _o(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_o(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 _o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function jo(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}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,ko(r.key),r)}}function ko(t){var e=function(t){if("object"!=wo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wo(e)?e:e+""}function To(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(To=function(){return!!t})()}function Co(t){return Co=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Co(t)}function Eo(t,e){return Eo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Eo(t,e)}var Ao=function(t){function e(t,n,r){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(o=function(t,e,n){return e=Co(e),function(t,e){if(e&&("object"==wo(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)}(t,To()?Reflect.construct(e,n||[],Co(t).constructor):e.apply(t,n))}(this,e,[t,n,r,i])).cells=[],o.delimiter=i.delimiter||",",o.infoLoadingStatus="notLoaded",o.getData(void 0),o}return 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&&Eo(t,e)}(e,t),n=e,r=[{key:"getData",value:function(t){var e,n=this;return"notLoaded"!=this.infoLoadingStatus||(this.infoLoadingStatus="loading",(e=xo().m(function t(){var e,r,o,i,a,u,l,c;return xo().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,no(n.delimiter,n.url);case 1:e=t.v,r=Oo(e);try{for(r.s();!(o=r.n()).done;)(i=o.value).x=+i.x,i.y=+i.y}catch(t){r.e(t)}finally{r.f()}if(!n.preprocess){t.n=10;break}n.cells=[],a=Oo(e),t.p=2,a.s();case 3:if((u=a.n()).done){t.n=6;break}if(l=u.value,0!=n.preprocess(l)){t.n=4;break}return t.a(3,5);case 4:n.cells.push(l);case 5:t.n=3;break;case 6:t.n=8;break;case 7:t.p=7,c=t.v,a.e(c);case 8:return t.p=8,a.f(),t.f(8);case 9:t.n=11;break;case 10:n.cells=e;case 11:n.map&&n.map.redraw(),n.infoLoadingStatus="loaded",t.n=13;break;case 12:t.p=12,t.v,n.infoLoadingStatus="failed",n.cells=[];case 13:return t.a(2)}},t,null,[[2,7,8,9],[0,12]])}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(t){jo(i,r,o,a,u,"next",t)}function u(t){jo(i,r,o,a,u,"throw",t)}a(void 0)})})()),this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,n=Oo(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()}}}}],r&&Po(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ir);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 zo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}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,Io(r.key),r)}}function Io(t){var e=function(t){if("object"!=Mo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Mo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Mo(e)?e:e+""}function Fo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Fo=function(){return!!t})()}function Bo(t){return Bo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bo(t)}function No(t,e){return No=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},No(t,e)}var Lo=function(t){function e(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Bo(e),function(t,e){if(e&&("object"==Mo(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)}(t,Fo()?Reflect.construct(e,n||[],Bo(t).constructor):e.apply(t,n))}(this,e,[void 0,"",t,o])).cells=n||[],r}return 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&&No(t,e)}(e,t),n=e,(r=[{key:"getData",value:function(t){return this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,n=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 zo(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zo(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(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()}}}}])&&Ro(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ir);function Do(t){return Do="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},Do(t)}function Go(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=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,Uo(r.key),r)}}function Uo(t){var e=function(t){if("object"!=Do(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Do(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Do(e)?e:e+""}function $o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return($o=function(){return!!t})()}function Ho(t){return Ho=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ho(t)}function qo(t,e){return qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qo(t,e)}var Yo=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Ho(e),function(t,e){if(e&&("object"==Do(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)}(t,$o()?Reflect.construct(e,n||[],Ho(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.color=t.color||"#EA6BAC",n.size=t.size||function(t,e){return e},n.shape=t.shape||"square",n}return 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)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r,o=e.view.z,i=this.viewScale?this.viewScale(t,n,o):void 0,a=.5*n,u="function"==typeof this.color,l="function"==typeof this.size,c="function"==typeof this.shape,s=this.color||"black",f=this.size||n,h=this.shape||"square",y=u?this.color:null,p=l?this.size:null,v=c?this.shape:null,d=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 Go(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?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}}}}(t);try{for(d.s();!(r=d.n()).done;){var b=r.value,m=y?y(b,n,o,i):s;if(m&&"none"!==m){var g=p?p(b,n,o,i):f;if(g){var w=v?v(b,n,o,i):h;if("none"!==w){var x=this.offset(b,n,o),S=e.offscreenCtx;if(S.fillStyle=m,"square"===w){var O=n*(1-g/n)*.5;S.fillRect(b.x+O+x.dx,b.y+O+x.dy,g,g)}else if("circle"===w)S.beginPath(),S.arc(b.x+a+x.dx,b.y+a+x.dy,.5*g,0,2*Math.PI,!1),S.fill();else if("donut"===w){var _=b.x+a+x.dx,j=b.y+a+x.dy;S.beginPath(),S.moveTo(_,j),S.arc(_,j,a,0,2*Math.PI),S.arc(_,j,(1-g/n)*a,0,2*Math.PI,!0),S.closePath(),S.fill()}else if("diamond"===w){var P=.5*g;S.beginPath(),S.moveTo(b.x+a-P,b.y+a),S.lineTo(b.x+a,b.y+a+P),S.lineTo(b.x+a+P,b.y+a),S.lineTo(b.x+a,b.y+a-P),S.fill()}else if("triangle_up"===w){var k=(g-n)/2;S.beginPath(),S.moveTo(b.x-k,b.y-k),S.lineTo(b.x+a,b.y+n+k),S.lineTo(b.x+n+k,b.y-k),S.fill()}else if("triangle_down"===w){var T=(g-n)/2;S.beginPath(),S.moveTo(b.x-T,b.y+n+T),S.lineTo(b.x+a,b.y-T),S.lineTo(b.x+n+T,b.y+n+T),S.fill()}else if("triangle_left"===w){var C=(g-n)/2;S.beginPath(),S.moveTo(b.x+n+C,b.y+n+C),S.lineTo(b.x-C,b.y+a),S.lineTo(b.x+n+C,b.y-C),S.fill()}else{if("triangle_right"!==w)throw new Error("Unexpected shape:"+w);var E=(g-n)/2;S.beginPath(),S.moveTo(b.x-E,b.y-E),S.lineTo(b.x+n+E,b.y+a),S.lineTo(b.x-E,b.y+n+E),S.fill()}}}}}}catch(t){d.e(t)}finally{d.f()}this.updateLegends({viewScale:i,resolution:n,z:o,cells:t})}}],r&&Wo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function Vo(t){return Vo="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},Vo(t)}function Xo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Zo(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,Jo(r.key),r)}}function Jo(t){var e=function(t){if("object"!=Vo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vo(e)?e:e+""}function Ko(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ko=function(){return!!t})()}function Qo(t){return Qo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qo(t)}function ti(t,e){return ti=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ti(t,e)}var ei=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Qo(e),function(t,e){if(e&&("object"==Vo(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)}(t,Ko()?Reflect.construct(e,n||[],Qo(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.strokeColor=t.strokeColor||function(){return"#666"},n.size=t.size||function(t,e){return e},n.strokeWidth=t.strokeWidth||function(t,e,n){return 1.5*n},n.shape=t.shape||function(){return"square"},n}return 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&&ti(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r,o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,n,o):void 0,u=.5*n,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 Xo(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xo(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();!(r=l.n()).done;){var c=r.value,s=this.strokeColor?this.strokeColor(c,n,o,a):void 0;if(s&&"none"!==s){i.strokeStyle=s;var f=this.size?this.size(c,n,o,a):n,h=this.strokeWidth?this.strokeWidth(c,n,o,a):1*o;if(h&&!(h<=0)){i.lineWidth=h;var y=this.shape?this.shape(c,n,o,a):"square";if("none"!==y){var p=this.offset(c,n,o);if("square"===y){var v=n*(1-f/n)*.5;i.beginPath(),i.rect(c.x+v+p.dx,c.y+v+p.dy,f,f),i.stroke()}else if("circle"===y)i.beginPath(),i.arc(c.x+u+p.dx,c.y+u+p.dy,.5*f,0,2*Math.PI,!1),i.stroke();else if("diamond"===y){var d=.5*f;i.beginPath(),i.moveTo(c.x+u-d,c.y+u),i.lineTo(c.x+u,c.y+u+d),i.lineTo(c.x+u+d,c.y+u),i.lineTo(c.x+u,c.y+u-d),i.lineTo(c.x+u-d,c.y+u),i.stroke()}else if("donut"===y)console.error("Not implemented");else if("triangle_up"===y){var b=(f-n)/2;i.beginPath(),i.moveTo(c.x-b,c.y-b),i.lineTo(c.x+u,c.y+n+b),i.lineTo(c.x+n+b,c.y-b),i.closePath(),i.stroke()}else if("triangle_down"===y){var m=(f-n)/2;i.beginPath(),i.moveTo(c.x-m,c.y+n+m),i.lineTo(c.x+u,c.y-m),i.lineTo(c.x+n+m,c.y+n+m),i.closePath(),i.stroke()}else if("triangle_left"===y){var g=(f-n)/2;i.beginPath(),i.moveTo(c.x+n+g,c.y+n+g),i.lineTo(c.x-g,c.y+u),i.lineTo(c.x+n+g,c.y-g),i.closePath(),i.stroke()}else{if("triangle_right"!==y)throw new Error("Unexpected shape:"+y);var w=(f-n)/2;i.beginPath(),i.moveTo(c.x-w,c.y-w),i.lineTo(c.x+n+w,c.y+u),i.lineTo(c.x-w,c.y+n+w),i.closePath(),i.stroke()}}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,resolution:n,z:o,viewScale:a})}}],r&&Zo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function ni(t){return ni="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},ni(t)}function ri(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function oi(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,ii(r.key),r)}}function ii(t){var e=function(t){if("object"!=ni(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ni(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ni(e)?e:e+""}function ai(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ai=function(){return!!t})()}function ui(t){return ui=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ui(t)}function li(t,e){return li=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},li(t,e)}var ci=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=ui(e),function(t,e){if(e&&("object"==ni(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)}(t,ai()?Reflect.construct(e,n||[],ui(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.height=t.height||function(t,e){return e*Math.random()},n.lineColor=t.lineColor||function(t,e,n,r){return"#BBB"},n.lineWidth=t.lineWidth||function(t,e,n,r){return r},n.fillColor=t.fillColor||function(t,e,n,r){return"#c08c5968"},n}return 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)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r,o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,n,o):void 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 ri(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ri(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();!(r=l.n()).done;){var c=r.value,s=u[c.y];s||(s={},u[c.y]=s),s[c.x]=this.height(c,n,o,a)}}catch(t){l.e(t)}finally{l.f()}var f=e.extGeo;if(f){var h=Math.floor(f.xMin/n)*n,y=Math.floor(f.xMax/n)*n,p=Math.floor(f.yMin/n)*n,v=Math.floor(f.yMax/n)*n,d={min:p,max:v};i.lineJoin="round";for(var b=v;b>=p;b-=n){var m=u[b];if(m){i.beginPath(),i.moveTo(h-n/2,b);for(var g=void 0,w=h;w<=y;w+=n){var x=m[w];x||(x=0),x||g?i.lineTo(w+n/2,b+x):i.moveTo(w+n/2,b),g=x}g&&i.lineTo(y+n/2,b);var S=this.fillColor(b,d,n,o);S&&"none"!=S&&(i.fillStyle=S,i.fill());var O=this.lineColor(b,d,n,o),_=this.lineWidth(b,d,n,o);O&&"none"!=O&&_>0&&(i.strokeStyle=O,i.lineWidth=_,i.stroke())}}}}}],r&&oi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function si(t){return si="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},si(t)}function fi(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)||hi(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 hi(t,e){if(t){if("string"==typeof t)return yi(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yi(t,e):void 0}}function yi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function pi(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,vi(r.key),r)}}function vi(t){var e=function(t){if("object"!=si(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=si(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==si(e)?e:e+""}function di(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(di=function(){return!!t})()}function bi(t){return bi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bi(t)}function mi(t,e){return mi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mi(t,e)}var gi=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=bi(e),function(t,e){if(e&&("object"==si(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)}(t,di()?Reflect.construct(e,n||[],bi(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.color=t.color,n.type=t.type||function(){return"flag"},n.size=t.size||function(t,e){return e},n.stripesOrientation=t.stripesOrientation||function(){return 0},n.offsetAngle=t.offsetAngle||function(){return 0},n.agePyramidHeight=t.agePyramidHeight||function(t,e){return e},n.pieChartInternalRadiusFactor=t.pieChartInternalRadiusFactor||0,n}return 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&&mi(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r,o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,n,o):void 0,u=Object.entries(this.color).length,l=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=hi(t))){e&&(t=e);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==e.return||e.return()}finally{if(a)throw o}}}}(t);try{for(l.s();!(r=l.n()).done;){var c=r.value,s=this.size?this.size(c,n,o,a):n;if(s){var f=this.offset(c,n,o),h=this.type?this.type(c,n,o,a):"flag",y=c.x+f.dx+("agepyramid"===h?0:.5*n),p=c.y+f.dy+("agepyramid"===h?0:.5*n),v=this.offsetAngle?this.offsetAngle(c,n,o,a)*Math.PI/180:0;if("agepyramid"===h||"radar"===h||"halftone"===h){for(var d=-1/0,b=0,m=Object.keys(this.color);b<m.length;b++){var g=+c[m[b]];g>d&&(d=g)}var w=0;"agepyramid"===h&&this.agePyramidHeight&&(w=(n-this.agePyramidHeight(c,n,o,a))/2),"radar"!==h&&"halftone"!==h||(w=Math.PI/2+v);var x="agepyramid"===h?(this.agePyramidHeight?this.agePyramidHeight(c,n,o,a):n)/u:"radar"===h||"halftone"===h?2*Math.PI/u:void 0;if(void 0===x)throw new Error("Unexpected symbol type:"+h);for(var S=0,O=Object.entries(this.color);S<O.length;S++){var _=fi(O[S],2),j=_[0],P=_[1];if("agepyramid"===h){i.fillStyle=P;var k=s*c[j]/d;i.fillRect(y+(n-k)/2,p+w,k,x),w+=x}else if("radar"===h){i.fillStyle=P;var T=c[j],C=s/2*Math.sqrt(T/d);i.beginPath(),i.moveTo(y,p),i.arc(y,p,C,w-x,w),i.lineTo(y,p),i.fill(),w+=x}else{if("halftone"!==h)throw new Error("Unexpected symbol type:"+h);i.fillStyle=P;var E=c[j],A=.333*s*Math.sqrt(E/d);i.beginPath(),i.arc(y+.25*n*Math.cos(w),p+.25*n*Math.sin(w),A,0,2*Math.PI),i.fill(),w+=x}}}else{for(var M=0,z=0,R=Object.keys(this.color);z<R.length;z++){var I=+c[R[z]];I&&(M+=I)}if(!M||isNaN(M))continue;for(var F=0,B=n*(1-s/n)*.5,N=this.stripesOrientation(c,n,o,a),L=0,D=Object.entries(this.color);L<D.length;L++){var G=fi(D[L],2),W=G[0],U=G[1],$=c[W]/M;if($&&!isNaN($)){if(i.fillStyle=U,"flag"===h)0==N?i.fillRect(c.x+B+f.dx,c.y+B+F*s+f.dy,s,$*s):i.fillRect(c.x+B+F*s+f.dx,c.y+B+f.dy,$*s,s);else if("piechart"===h){var H=2*F*Math.PI,q=2*(F+$)*Math.PI;i.beginPath(),i.moveTo(y,p),i.arc(y,p,.5*s,H+v,q+v),this.pieChartInternalRadiusFactor&&i.arc(y,p,.5*s*this.pieChartInternalRadiusFactor,H+v,q+v,!0),i.closePath(),i.fill()}else if("ring"===h)i.beginPath(),i.arc(y,p,Math.sqrt(1-F)*s*.5,0,2*Math.PI),i.fill();else{if("segment"!==h)throw new Error("Unexpected symbol type:"+h);var Y=s*s/n;0==N?i.fillRect(c.x+f.dx,c.y+(n-Y)/2+F*Y+f.dy,n,$*Y):i.fillRect(c.x+F*n+f.dx,c.y+(n-Y)/2+f.dy,$*n,Y)}F+=$}}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,resolution:n,z:o,viewScale:a})}}],r&&pi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function wi(t){return wi="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},wi(t)}function xi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Si(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,Oi(r.key),r)}}function Oi(t){var e=function(t){if("object"!=wi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wi(e)?e:e+""}function _i(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_i=function(){return!!t})()}function ji(t){return ji=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ji(t)}function Pi(t,e){return Pi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pi(t,e)}var ki=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=ji(e),function(t,e){if(e&&("object"==wi(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)}(t,_i()?Reflect.construct(e,n||[],ji(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.color=t.color||function(){return"#EA6BAC"},n.width=t.width||function(t,e){return.1*e},n.length=t.length||function(t,e){return.9*e},n.orientation=t.orientation||function(){return 180*Math.random()},n}return 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&&Pi(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r=e.view.z,o=e.offscreenCtx,i=this.viewScale?this.viewScale(t,n,r):void 0;o.lineCap="butt";var a,u=Math.PI/180,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 xi(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xi(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();!(a=l.n()).done;){var c=a.value,s=this.color?this.color(c,n,r,i):void 0;if(s){var f=this.width?this.width(c,n,r,i):void 0;if(f&&!(f<0)){var h=this.length?this.length(c,n,r,i):void 0;if(h&&!(h<0)){var y=this.orientation(c,n,r,i)*u;if(void 0!==y&&!isNaN(y)){var p=this.offset(c,n,r);o.strokeStyle=s,o.lineWidth=f;var v=c.x+n/2+p.dx,d=c.y+n/2+p.dy,b=.5*Math.cos(y)*h,m=.5*Math.sin(y)*h;o.beginPath(),o.moveTo(v-b,d-m),o.lineTo(v+b,d+m),o.stroke()}}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({viewScale:i,resolution:n,z:r,cells:t})}}],r&&Si(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function Ti(t){return Ti="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},Ti(t)}function Ci(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ei(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,Ai(r.key),r)}}function Ai(t){var e=function(t){if("object"!=Ti(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ti(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ti(e)?e:e+""}function Mi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Mi=function(){return!!t})()}function zi(t){return zi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zi(t)}function Ri(t,e){return Ri=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ri(t,e)}var Ii=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=zi(e),function(t,e){if(e&&("object"==Ti(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)}(t,Mi()?Reflect.construct(e,n||[],zi(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.text=t.text||function(){return"X"},n.color=t.color||function(){return"black"},n.fontSize=t.fontSize||function(t,e){return e},n.fontFamily=t.fontFamily||function(){return"Arial"},n.fontWeight=t.fontWeight||function(){return"bold"},n}return 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&&Ri(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r=e.view.z,o=e.offscreenCtx,i=this.viewScale?this.viewScale(t,n,r):void 0;e.initCanvasTransform();var a,u=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 Ci(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?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}}}}(t);try{for(u.s();!(a=u.n()).done;){var l=a.value,c=this.text?this.text(l,n,r,i):void 0;if(null!=c&&null!=c&&c+""!=""){var s=this.color?this.color(l,n,r,i):void 0;if(s){o.fillStyle=s;var f=this.fontSize(l,n,r,i)/r;if(f){var h=this.fontFamily?this.fontFamily(l,n,r,i):"Arial",y=this.fontWeight?this.fontWeight(l,n,r,i):"bold";o.font=y+" "+f+"px "+h;var p=this.offset(l,n,r);o.textAlign="center";var v=e.geoToPixX(l.x+.5*n+p.dx),d=e.geoToPixY(l.y+.5*n+p.dy)+.3*f;o.fillText(c,v,d)}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,resolution:n,z:r,viewScale:i})}}],o=[{key:"textScale",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=t.length;return function(r){return e&&(r=e(r)),0==r?"":r>=1?t[n-1]:t[Math.floor(r*n)]}}}],r&&Ei(n.prototype,r),o&&Ei(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Sr);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 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 Ni(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ni(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 Ni(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Li(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,Di(r.key),r)}}function Di(t){var e=function(t){if("object"!=Fi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fi(e)?e:e+""}function Gi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Gi=function(){return!!t})()}function Wi(t){return Wi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wi(t)}function Ui(t,e){return Ui=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ui(t,e)}var $i=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Wi(e),function(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)}(t,Gi()?Reflect.construct(e,n||[],Wi(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.height=t.height,n.color=t.color||function(){return"#c08c59"},n.width=t.width||function(t,e){return.5*e},n.simple=t.simple||function(){return!1},n.viewHeightFactor=t.viewHeightFactor||1.5,n.viewSX=null==t.viewSX?0:t.viewSX,n.viewSY=null==t.viewSY?-.5:t.viewSY,n.shadowDirection=null==t.shadowDirection?-40.3*Math.PI/180:t.shadowDirection,n.shadowFactor=t.shadowFactor||.3,n.shadowColor=t.shadowColor||"#00000033",n.outlineCol=t.outlineCol||"#FFFFFF",n.outlineWidthPix=null==t.outlineWidthPix?.5:t.outlineWidthPix,n}return 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)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r=e.view.z,o=e.offscreenCtx,i=this.viewScale?this.viewScale(t,n,r):void 0,a=e.view.x+this.viewSX*e.w*r,u=e.view.y+this.viewSY*e.h*r,l=this.viewHeightFactor*(e.w+e.h)*.5*r;t.sort(function(t,e){return 1e8*(e.y-t.y)+t.x-e.x});var c=this.simple(n,r,i);o.lineCap=c?"butt":"round",o.strokeStyle=this.shadowColor,o.fillStyle=this.shadowColor;var s,f=Bi(t);try{for(f.s();!(s=f.n()).done;){var h=s.value,y=this.width?this.width(h,n,r,i):void 0;if(y&&!(y<0)){var p=this.height?this.height(h,n,r,i):void 0;if(p&&!(p<0)){o.lineWidth=y;var v=h.x+n/2,d=h.y+n/2,b=p*this.shadowFactor;o.beginPath(),o.moveTo(v,d),o.lineTo(v+b*Math.cos(this.shadowDirection),d+b*Math.sin(this.shadowDirection)),o.stroke()}}}}catch(t){f.e(t)}finally{f.f()}var m,g=Bi(t);try{for(g.s();!(m=g.n()).done;){var w=m.value,x=this.color?this.color(w,n,r,i):void 0;if(x){var S=this.width?this.width(w,n,r,i):void 0;if(S&&!(S<0)){var O=this.height?this.height(w,n,r,i):void 0;if(O&&!(O<0)){var _=w.x+n/2,j=w.y+n/2,P=_-a,k=j-u,T=Math.atan2(k,P),C=Math.sqrt(P*P+k*k)*O/(l-O);c?(o.strokeStyle=x,o.lineWidth=S,o.beginPath(),o.moveTo(_,j),o.lineTo(_+C*Math.cos(T),j+C*Math.sin(T)),o.stroke()):(o.strokeStyle=this.outlineCol,o.lineWidth=S+2*this.outlineWidthPix*r,o.beginPath(),o.moveTo(_,j),o.lineTo(_+C*Math.cos(T),j+C*Math.sin(T)),o.stroke(),o.strokeStyle=x,o.lineWidth=S,o.beginPath(),o.moveTo(_,j),o.lineTo(_+C*Math.cos(T),j+C*Math.sin(T)),o.stroke(),o.strokeStyle=this.outlineCol,o.lineWidth=this.outlineWidthPix*r,o.beginPath(),o.arc(_+C*Math.cos(T),j+C*Math.sin(T),.5*S,0,2*Math.PI,!1),o.stroke())}}}}}catch(t){g.e(t)}finally{g.f()}o.lineCap="butt",this.updateLegends({style:this,resolution:n,z:r,viewScale:i})}}],r&&Li(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function Hi(t){return Hi="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},Hi(t)}function qi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Yi(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,Vi(r.key),r)}}function Vi(t){var e=function(t){if("object"!=Hi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Hi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Hi(e)?e:e+""}function Xi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Xi=function(){return!!t})()}function Zi(t){return Zi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zi(t)}function Ji(t,e){return Ji=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ji(t,e)}var Ki=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=Zi(e),function(t,e){if(e&&("object"==Hi(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)}(t,Xi()?Reflect.construct(e,n||[],Zi(t).constructor):e.apply(t,n))}(this,e,[n])).color=n.color||function(t,e,n,r){return"#EA6BAC"},t.width=n.width||function(t,e,n,r){return e/5},t.length=n.length||function(t,e,n,r){return e},t.diamond=n.diamond,t}return 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&&Ji(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,n,r){this.filter&&(t=t.filter(this.filter));var o=n.view.z,i=n.offscreenCtx,a=e.buildSides(t,r);if(0!=a.length){var u=this.viewScale?this.viewScale(a,r,o):void 0;i.lineCap="butt";var l,c=.5*r,s=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 qi(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qi(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}}}}(a);try{for(s.s();!(l=s.n()).done;){var f=l.value,h=this.color?this.color(f,r,o,u):void 0;if(h&&"none"!=h)if(this.diamond){i.fillStyle=h;var y=f.x,p=f.y;i.beginPath(),i.moveTo(y-c,p),i.lineTo(y,p+c),i.lineTo(y+c,p),i.lineTo(y,p-c),i.closePath(),i.fill()}else{var v=this.width?this.width(f,r,o,u):void 0;if(!v||v<=0)continue;var d=this.length?this.length(f,r,o,u):void 0;if(!d||d<=0)continue;var b=.5*d;i.lineWidth=v,i.strokeStyle=h;var m=f.x,g=f.y;i.beginPath(),"v"===f.or?(i.moveTo(m,g-b),i.lineTo(m,g+b)):(i.moveTo(m-b,g),i.lineTo(m+b,g)),i.stroke()}}}catch(t){s.e(t)}finally{s.f()}this.updateLegends({style:this,resolution:r,z:o,viewScale:u})}}}],o=[{key:"buildSides",value:function(t,e){var n=[],r=arguments.length>4&&void 0!==arguments[4]&&!arguments[4]?0:e/2;t.sort(function(t,e){return e.x==t.x?t.y-e.y:t.x-e.x});for(var o=t[0],i=1;i<t.length;i++){var a=t[i];o.y+e==a.y&&o.x==a.x?n.push({or:"h",x:o.x+r,y:a.y,c1:o,c2:a}):(n.push({or:"h",x:o.x+r,y:o.y+e,c1:o,c2:void 0}),n.push({or:"h",x:a.x+r,y:a.y,c1:void 0,c2:a})),o=a}t.sort(function(t,e){return e.y==t.y?t.x-e.x:t.y-e.y}),o=t[0];for(var u=1;u<t.length;u++){var l=t[u];o.x+e==l.x&&o.y==l.y?n.push({or:"v",x:o.x+e,y:o.y+r,c1:o,c2:l}):(n.push({or:"v",x:o.x+e,y:o.y+r,c1:o,c2:void 0}),n.push({or:"v",x:l.x,y:l.y+r,c1:void 0,c2:l})),o=l}return n}}],r&&Yi(n.prototype,r),o&&Yi(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Sr);function Qi(t){return Qi="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},Qi(t)}function ta(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ea(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,na(r.key),r)}}function na(t){var e=function(t){if("object"!=Qi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Qi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Qi(e)?e:e+""}function ra(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ra=function(){return!!t})()}function oa(t){return oa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},oa(t)}function ia(t,e){return ia=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ia(t,e)}var aa=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=oa(e),function(t,e){if(e&&("object"==Qi(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)}(t,ra()?Reflect.construct(e,n||[],oa(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.code=t.code,n.color=t.color,n}return 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&&ia(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r=e.view.z,o=e.offscreenCtx,i=Ki.buildSides(t,n);if(0!=i.length){var a=this.viewScale?this.viewScale(i,n,r):void 0;o.lineCap="butt";var u,l=.5*n,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 ta(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ta(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}}}}(i);try{for(c.s();!(u=c.n()).done;){var s=u.value,f=s.c1?this.code(s.c1,n,r):void 0,h=s.c2?this.code(s.c2,n,r):void 0;if(f!=h){var y=this.width?this.width(s,n,r,a):void 0;if(y&&!(y<=0)){var p=.5*y;o.lineWidth=y,"h"===s.or?(h&&(o.beginPath(),o.strokeStyle=this.color[h],o.moveTo(s.x-l,s.y+p),o.lineTo(s.x+l,s.y+p),o.stroke()),f&&(o.beginPath(),o.strokeStyle=this.color[f],o.moveTo(s.x-l,s.y-p),o.lineTo(s.x+l,s.y-p),o.stroke())):(h&&(o.beginPath(),o.strokeStyle=this.color[h],o.moveTo(s.x+p,s.y-l),o.lineTo(s.x+p,s.y+l),o.stroke()),f&&(o.beginPath(),o.strokeStyle=this.color[f],o.moveTo(s.x-p,s.y-l),o.lineTo(s.x-p,s.y+l),o.stroke()))}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,resolution:n,z:r,viewScale:a})}}}],r&&ea(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ki);const ua=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 la(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=document.createElement("canvas");r.setAttribute("width",t),r.setAttribute("height",e);var o=r.getContext("webgl",n);if(!o)throw new Error("Unable to initialize WebGL. Your browser or machine may not support it.");return{canvas:r,gl:o}}function ca(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 sa(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 fa(t){return fa="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},fa(t)}function ha(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,ya(r.key),r)}}function ya(t){var e=function(t){if("object"!=fa(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=fa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fa(e)?e:e+""}var pa=function(){return t=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=ca(e,sa(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 "),sa(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=[]},(e=[{key:"addPointData",value:function(t,e,n){var r=Pe(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)}}])&&ha(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();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 da(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={}.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=Array(e);n<e;n++)r[n]=t[n];return r}function ma(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,ga(r.key),r)}}function ga(t){var e=function(t){if("object"!=va(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=va(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==va(e)?e:e+""}function wa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(wa=function(){return!!t})()}function xa(t){return xa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xa(t)}function Sa(t,e){return Sa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Sa(t,e)}var Oa=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=xa(e),function(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)}(t,wa()?Reflect.construct(e,n||[],xa(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.dotNumber=t.dotNumber||function(t,e){return e/100},n.color=t.color||function(){return"#FF5733"},n.dotSize=t.dotSize||function(t,e){return 1.5*e},n.sigma=t.sigma||function(t,e){return t/2},n}return 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&&Sa(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r=e.view.z,o=this.viewScale?this.viewScale(t,n,r):void 0,i=this.dotSize?this.dotSize(n,r,o):r,a=this.sigma?this.sigma(n,r,o):.4*n,u=ua(0,a),l=e.offscreenCtx;if(function(){try{var t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}}()){var c=la(e.w+"",e.h+"");if(!c)return void console.error("No webGL");var s,f=new pa(c.gl,i/r),h=n/2,y=da(t);try{for(y.s();!(s=y.n()).done;){var p=s.value,v=this.color(p,n,r,o);if(v&&"none"!==v){var d=this.dotNumber(p,n,r,o),b=this.offset(p,n,r),m=p.x+b.dx+h,g=p.y+b.dy+h,w=Pe(v);if(!w)return;for(var x=0;x<=d;x++)f.addPointData2(m+u(),g+u(),w.r,w.g,w.b,w.opacity)}}}catch(t){y.e(t)}finally{y.f()}f.draw(e.getWebGLTransform()),e.initCanvasTransform(),l.drawImage(c.canvas,0,0)}else{var S,O=da(t);try{for(O.s();!(S=O.n()).done;){var _=S.value,j=this.color(_,n,r,o);if(j&&"none"!==j){l.fillStyle=j;for(var P=this.dotNumber(_,n,r,o),k=this.offset(_,n,r),T=_.x+k.dx+n/2,C=_.y+k.dy+n/2,E=0;E<=P;E++)l.fillRect(T+u(),C+u(),i,i)}}}catch(t){O.e(t)}finally{O.f()}}this.updateLegends({style:this,resolution:n,z:r,viewScale:o})}}],r&&ma(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function _a(t){return _a="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},_a(t)}function ja(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,Pa(r.key),r)}}function Pa(t){var e=function(t){if("object"!=_a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=_a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_a(e)?e:e+""}var ka=function(){return t=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("")},e=[{key:"draw",value:function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,i=ca(t,sa(t,t.VERTEX_SHADER,this.vshString),sa(t,t.FRAGMENT_SHADER,this.fshString));t.useProgram(i),t.uniform1f(t.getUniformLocation(i,"sizePix"),1*o);for(var a=0;a<this.colors.length;a++){var u=Pe(this.colors[a]);t.uniform4fv(t.getUniformLocation(i,"c"+a),[+u.r/255,+u.g/255,+u.b/255,+u.opacity])}t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array(e),t.STATIC_DRAW);var l=t.getAttribLocation(i,"pos");t.vertexAttribPointer(l,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(l),t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array(n),t.STATIC_DRAW);var c=t.getAttribLocation(i,"i");t.vertexAttribPointer(c,1,t.FLOAT,!1,0,0),t.enableVertexAttribArray(c),t.uniformMatrix3fv(t.getUniformLocation(i,"mat"),!1,new Float32Array(r)),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.POINTS,0,e.length/2)}}],e&&ja(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();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 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,Ea(r.key),r)}}function Ea(t){var e=function(t){if("object"!=Ta(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ta(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ta(e)?e:e+""}function Aa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Aa=function(){return!!t})()}function Ma(t){return Ma=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ma(t)}function za(t,e){return za=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},za(t,e)}var Ra=function(t){function e(t){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Ma(e),function(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)}(t,Aa()?Reflect.construct(e,n||[],Ma(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.code=t.code,t.color=t.color||void 0;var r=Object.keys(t.color);n.catToI={};for(var o=0;o<r.length;o++)n.catToI[r[o]]=o+"";n.colors=[];for(var i=0,a=r;i<a.length;i++){var u=a[i];n.colors.push(t.color[""+u])}return n.size=t.size,n.wgp=new ka(n.colors),n}return 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&&za(t,e)}(e,t),n=e,(r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));for(var r,o=e.view.z,i=n/2,a=t.length,u=[],l=[],c=0;c<a;c++){r=t[c];var s=this.code(r);if(null!=s){var f=this.catToI[s];isNaN(+f)?console.log("Unexpected category index: "+s+" "+f):(u.push(r.x+i,r.y+i),l.push(+f))}else console.log("Unexpected category: "+s)}var h=la(e.w+"",e.h+"");if(h){var y=this.size?this.size(n,o):n+.2*o;this.wgp.draw(h.gl,u,l,e.getWebGLTransform(),y/o),e.initCanvasTransform(),e.offscreenCtx.drawImage(h.canvas,0,0),this.updateLegends({style:this,resolution:n,z:o})}else console.error("No webGL")}}])&&Ca(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function Ia(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(n<o||void 0===n&&o>=o)&&(n=o)}return n}function Fa(t){return null===t?NaN:+t}function Ba(t,e,n=Fa){if((r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,o=(r-1)*e,i=Math.floor(o),a=+n(t[i],i,t);return a+(+n(t[i+1],i+1,t)-a)*(o-i)}}function Na(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function La(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Da(t){let e,n,r;function o(t,r,o=0,i=t.length){if(o<i){if(0!==e(r,r))return i;do{const e=o+i>>>1;n(t[e],r)<0?o=e+1:i=e}while(o<i)}return o}return 2!==t.length?(e=Na,n=(e,n)=>Na(t(e),n),r=(e,n)=>t(e)-n):(e=t===Na||t===La?t:Ga,n=t,r=t),{left:o,center:function(t,e,n=0,i=t.length){const a=o(t,e,n,i-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,o=0,i=t.length){if(o<i){if(0!==e(r,r))return i;do{const e=o+i>>>1;n(t[e],r)<=0?o=e+1:i=e}while(o<i)}return o}}}function Ga(){return 0}const Wa=Da(Na),Ua=Wa.right,$a=(Wa.left,Da(Fa).center,Ua);function Ha(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function qa(){var t,e=[],n=[],r=[];function o(){var t=0,o=Math.max(1,n.length);for(r=new Array(o-1);++t<o;)r[t-1]=Ba(e,t/o);return i}function i(e){return null==e||isNaN(e=+e)?t:n[$a(r,e)]}return i.invertExtent=function(t){var o=n.indexOf(t);return o<0?[NaN,NaN]:[o>0?r[o-1]:e[0],o<r.length?r[o]:e[e.length-1]]},i.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(Na),o()},i.range=function(t){return arguments.length?(n=Array.from(t),o()):n.slice()},i.unknown=function(e){return arguments.length?(t=e,i):t},i.quantiles=function(){return r.slice()},i.copy=function(){return qa().domain(e).range(n).unknown(t)},Ha.apply(i,arguments)}var Ya=function(t){var e=t.valueFunction,n=t.minValue||0,r=t.minSizePix||0,o=t.maxSizeFactor||1,i=t.stretching,a=t.range,u=t.domain,l=t.classNumber;return function(t,c,s){var f=u||[n,Ia(t,e)],h=a||[r*s,c*o],y=f[1]-f[0],p=f[0],v=h[1]-h[0],d=h[0];return function(t){return t=(t-p)/y,i&&(t=i(t)),l&&(t=1==t?1:Math.floor(t*l)/(l-1)),d+t*v}}},Va=function(t){var e=t.valueFunction,n=t.classNumber||12,r=t.minSizePix||1,o=t.maxSizeFactor||1,i=qa();return function(t,a,u){i.domain(t.map(e));var l=r*u,c=a*o;return i.range(Array.from({length:n},function(t,e){return l+e*(c-l)/(n-1)})),i.breaks=i.quantiles(),i.values=i.range(),i}},Xa=function(t){var e,n=t.valueFunction,r=t.stretching,o=t.colorScale||function(){return"purple"},i=null===(e=t.colors)||void 0===e?void 0:e.length;return t.colors&&i&&(o=function(e){return t.colors[1==e?i-1:Math.floor(e*i)]}),function(e){if(0!=e.length&&e){var a=function(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let o=-1;for(let i of t)null!=(i=e(i,++o,t))&&(void 0===n?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)))}return[n,r]}(e,n);if(null!=a[0]){var u=a[1]-a[0],l=function(t){return t=(t-a[0])/u,r&&(t=r(t)),o(t)};if(l.invert=function(t){return r&&(t=r.invert(t)),a[0]+t*u},t.colors&&i){l.breaks=[];for(var c=1;c<i;c++)l.breaks.push(l.invert(c/i))}return l}}}},Za=function(t){var e=t.valueFunction,n=t.classNumber||12,r=t.colors;t.colorScale&&(r=tu(t.colorScale,n)),r=r||Array.from({length:n},function(t,e){return"rgb("+Math.floor(255*e/(n-1))+",150,150)"});var o=qa().range(r);return function(t){return o.domain(t.map(e)),o.breaks=o.quantiles(),o.colors=r,o}},Ja=function(t){return function(e,n,r){var o={};for(var i in t)o[i]=t[i](e,n,r);return o}};function Ka(t){var e=t.length,n=function(n){for(var r=0;r<e;){if(n<=t[r])return r;r++}return r};return n.breaks=t,n}function Qa(t,e){var n=Ka(t),r=function(t){return e[n(t)]};return r.breaks=t,r.colors=e,r}function tu(t,e){if(1==e)return[t(.5)];for(var n=[],r=0;r<e;r++)n.push(t(r/(e-1)));return n}function eu(t){return eu="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},eu(t)}function nu(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,ru(r.key),r)}}function ru(t){var e=function(t){if("object"!=eu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=eu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==eu(e)?e:e+""}var ou=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"get",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};r.colorDark=r.colorDark||"#111",r.colorBright=r.colorBright||"#ddd",r.width=r.width||function(t,e,n){var r=1*n,o=4*n,i=(o-r)/3;return Math.min(r+(t-1)*i,o)};for(var o=Ka(e),i={},a=0;a<n.length;a++)i[a+""]=n[a];var u=new Ra({code:function(e){return o(t(e))},color:i}),l=function(e){return(e.c1?o(t(e.c1)):-1)-(e.c2?o(t(e.c2)):-1)};return[u,new Ki({color:function(t){var e=l(t);if(0!==e)return"v"===t.or?e<0?r.colorBright:r.colorDark:e<0?r.colorDark:r.colorBright},width:function(t,e,n){return r.width(Math.abs(l(t)),e,n)}})]}}],null&&nu(t.prototype,null),e&&nu(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function iu(t){return iu="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},iu(t)}function au(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 uu(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uu(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 uu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function lu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(lu=function(){return!!t})()}function cu(t){return cu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cu(t)}function su(t,e){return su=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},su(t,e)}function fu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hu(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,pu(r.key),r)}}function yu(t,e,n){return e&&hu(t.prototype,e),n&&hu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function pu(t){var e=function(t){if("object"!=iu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=iu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==iu(e)?e:e+""}var vu=function(){return yu(function t(){fu(this,t)},null,[{key:"get",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};(r=r||{}).colDark=r.colDark||"#333",r.colBright=r.colBright||"#aaa",r.widthFactor=r.widthFactor||.12;var o=ou.get(t,e,n,r),i=new ei({strokeColor:function(){return"#666"},strokeWidth:function(t,e,n){return.2*n},filter:r.filter});return[o[0],i,o[1],new du({colDark:r.colDark,colBright:r.colBright,filter:r.filter})]}},{key:"getCategory",value:function(t,e,n){return(n=n||{}).colDark=n.colDark||"#333",n.colBright=n.colBright||"#aaa",[new Ra({code:t,color:e}),new ei({strokeColor:function(){return"#666"},strokeWidth:function(t,e,n){return.2*n}}),new du({colDark:n.colDark,colBright:n.colBright})]}}])}(),du=function(t){function e(t){var n,r,o,i;return fu(this,e),r=this,i=[t],o=cu(o=e),n=function(t,e){if(e&&("object"==iu(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)}(r,lu()?Reflect.construct(o,i||[],cu(r).constructor):o.apply(r,i)),t=t||{},n.colDark=t.colDark||"#333",n.colBright=t.colBright||"#aaa",n}return 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&&su(t,e)}(e,t),yu(e,[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r=e.offscreenCtx;r.lineWidth=.6*e.view.z,r.strokeStyle=this.colDark;var o,i=au(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;r.beginPath(),r.arc(a.x+.5*n,a.y+.5*n,.55*n*.5,Math.PI/4,-Math.PI*(3/4),!0),r.stroke()}}catch(t){i.e(t)}finally{i.f()}r.strokeStyle=this.colBright;var u,l=au(t);try{for(l.s();!(u=l.n()).done;){var c=u.value;r.beginPath(),r.arc(c.x+.5*n,c.y+.5*n,.55*n*.5,Math.PI/4,-Math.PI*(3/4),!1),r.stroke()}}catch(t){l.e(t)}finally{l.f()}}}])}(Sr);function bu(t){return bu="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},bu(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,gu(r.key),r)}}function gu(t){var e=function(t){if("object"!=bu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=bu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bu(e)?e:e+""}var wu=function(){return t=function t(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gl=e;var a=sa(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 "),u="precision mediump float;\nvarying float vt;\nuniform float alpha;\n"+function(){for(var t=[],e=0;e<n.length;e++)t.push("uniform vec4 c"+e+";\n");return t.join("")}()+"void main(void) {\n";if(r?"pow"==r.fun?u+=" float t = pow(vt, alpha);\n":"powInv"==r.fun?u+=" float t = 1.0-pow(1.0-vt, 1.0/alpha);\n":"exp"==r.fun?u+=0==r.alpha?"float t = vt;":" float t = (exp(vt * alpha) - 1.0) / (exp(alpha) - 1.0);\n":"log"==r.fun?u+=0==r.alpha?"float t = vt;":" float t = 1.0 - (1.0 / alpha) * log(exp(alpha) * (1.0 - vt) + vt);\n":"circle"==r.fun?0==r.alpha?u+=" float t = vt;\n":1==r.alpha?u+=" float t = sqrt(vt * (2.0 - vt));\n":u+=" float a = alpha / (1.0 - alpha);\n float t = sqrt(1.0 / (a * a) + vt * ( 2.0/a + 2.0 - vt )) - 1.0 / a;\n":"circleInv"==r.fun?0==r.alpha?u+=" float t = vt;\n":1==r.alpha?u+=" float t = 1.0 - sqrt((1.0 - vt) * (1.0 + vt));\n":u+=" 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;\n":(console.error("Unexpected stretching function code: "+r.fun),u+=" float t = vt;\n"):u+=" float t = vt;\n",1==n.length)u+=" vec4 cI=c0;\n vec4 cF=c0;\n";else if(2==n.length)u+=" vec4 cI=c0;\n vec4 cF=c1;\n";else{var l=n.length-1,c=l+".0";u+=" vec4 cI;\n",u+=" vec4 cF;\n",u+=" if(t<1.0/"+c+") { cI=c0; cF=c1; t=t*"+c+"; }\n";for(var s=2;s<l;s++)u+=" else if(t<"+s+".0/"+c+") { cI=c"+(s-1)+"; cF=c"+s+"; t="+c+"*t-"+(s-1)+".0; }\n";u+=" else { cI=c"+(l-1)+"; cF=c"+l+"; t="+c+"*t-"+(l-1)+".0; }\n"}1==n.length?u+=" gl_FragColor = vec4(c0[0], c0[1], c0[2], c0[3]);}\n":u+=" gl_FragColor = mix(cI, cF, t);}\n";var f=sa(e,e.FRAGMENT_SHADER,u);this.program=ca(e,a,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 h=0;h<n.length;h++){var y=Pe(n[h]),p=y.opacity;1==y.opacity&&null!=i&&(p=i),e.uniform4fv(e.getUniformLocation(this.program,"c"+h),[+y.r/255,+y.g/255,+y.b/255,+p])}},e=[{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)}}],e&&mu(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function xu(t){return xu="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},xu(t)}function Su(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ou(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,_u(r.key),r)}}function _u(t){var e=function(t){if("object"!=xu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=xu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xu(e)?e:e+""}function ju(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ju=function(){return!!t})()}function Pu(t){return Pu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pu(t)}function ku(t,e){return ku=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ku(t,e)}var Tu=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Pu(e),function(t,e){if(e&&("object"==xu(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)}(t,ju()?Reflect.construct(e,n||[],Pu(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.tFun=t.tFun,n.stretching=t.stretching,n.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&&(n.colors=[t.color(0),t.color(.2),t.color(.4),t.color(.6),t.color(.8),t.color(1)]),n.opacity=t.opacity,n.size=t.size,n}return 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&&ku(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r=e.view.z,o=this.viewScale?this.viewScale(t,n,r):void 0,i=la(e.w+"",e.h+"",null!=this.opacity?{premultipliedAlpha:!1}:void 0);if(i){var a,u=n/2,l=[],c=[],s=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 Su(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Su(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(s.s();!(a=s.n()).done;){var f=a.value,h=this.tFun(f,n,r,o);null!=h&&null!=h&&(l.push(f.x+u,f.y+u),c.push(h>1?1:h<0?0:h))}}catch(t){s.e(t)}finally{s.f()}var y=this.size?this.size(n,r):n+.2*r,p=this.opacity?this.opacity(n,r):void 0;new wu(i.gl,this.colors,this.stretching,y/r,p).draw(l,c,e.getWebGLTransform()),e.initCanvasTransform(),e.offscreenCtx.drawImage(i.canvas,0,0),this.updateLegends({style:this,resolution:n,z:r,viewScale:o})}else console.error("No webGL")}}],r&&Ou(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function Cu(t){return Cu="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},Cu(t)}function Eu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Au(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,Mu(r.key),r)}}function Mu(t){var e=function(t){if("object"!=Cu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Cu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cu(e)?e:e+""}function zu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(zu=function(){return!!t})()}function Ru(t){return Ru=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ru(t)}function Iu(t,e){return Iu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Iu(t,e)}var Fu=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Ru(e),function(t,e){if(e&&("object"==Cu(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)}(t,zu()?Reflect.construct(e,n||[],Ru(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.color=t.color||function(){return"#EA6BAC"},n.mosaicFactor=t.mosaicFactor||.15,n.shadowFactor=t.shadowFactor||.2,n.shadowColor=t.shadowColor||"#555",n}return 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)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r=e.view.z,o=e.offscreenCtx,i=this.viewScale?this.viewScale(t,n,r):void 0;o.strokeStyle=this.shadowColor,o.lineWidth=this.shadowFactor*n,o.lineJoin="round",o.lineCap="butt";var a,u=n*this.mosaicFactor,l=function(){return{x:Math.random()*u,y:Math.random()*u}},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 Eu(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Eu(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();!(a=c.n()).done;){var s=a.value,f=this.color?this.color(s,n,r,i):void 0;if(f&&"none"!==f){o.fillStyle=f;var h=this.offset(s,n,r),y=l(),p=l(),v=l(),d=l();this.shadowFactor>0&&(o.beginPath(),o.moveTo(s.x+h.dx+y.x,s.y+h.dy+y.y),o.lineTo(s.x+h.dx+n-v.x,s.y+h.dy+v.y),o.lineTo(s.x+h.dx+n-d.x,s.y+h.dy+n-d.y),o.stroke()),o.beginPath(),o.moveTo(s.x+h.dx+y.x,s.y+h.dy+y.y),o.lineTo(s.x+h.dx+n-v.x,s.y+h.dy+v.y),o.lineTo(s.x+h.dx+n-d.x,s.y+h.dy+n-d.y),o.lineTo(s.x+h.dx+p.x,s.y+h.dy+n-p.y),o.fill()}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,resolution:n,z:r,viewScale:i})}}],r&&Au(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function Bu(t){return Bu="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},Bu(t)}function Nu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Lu(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,Du(r.key),r)}}function Du(t){var e=function(t){if("object"!=Bu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Bu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Bu(e)?e:e+""}function Gu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Gu=function(){return!!t})()}function Wu(t){return Wu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wu(t)}function Uu(t,e){return Uu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Uu(t,e)}var $u=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Wu(e),function(t,e){if(e&&("object"==Bu(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)}(t,Gu()?Reflect.construct(e,n||[],Wu(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.color=t.color||function(){return"#EA6BAC"},n.size=t.size||function(t,e){return e},n.shape=t.shape||function(){return"o"},n}return 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)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r,o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,n,o):void 0,u=.5*n,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 Nu(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nu(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();!(r=l.n()).done;){var c=r.value,s=this.color?this.color(c,n,o,a):void 0;if(s&&"none"!==s){i.fillStyle=s;var f=this.size(c,n,o,a),h=(f=f<0?0:f>1?1:f)*u,y=this.shape?this.shape(c):"o";if("none"!==y){var p=c.x+u,v=c.y+u;if("p"===y)i.beginPath(),i.moveTo(p,v+u),i.lineTo(p+h,v+h),i.lineTo(p+u,v),i.lineTo(p+h,v-h),i.lineTo(p,v-u),i.lineTo(p-h,v-h),i.lineTo(p-u,v),i.lineTo(p-h,v+h),i.fill();else{if("o"!==y)throw new Error("Unexpected shape:"+y);i.beginPath(),i.moveTo(p,v+h),i.lineTo(p+u,v+u),i.lineTo(p+h,v),i.lineTo(p+u,v-u),i.lineTo(p,v-h),i.lineTo(p-u,v-u),i.lineTo(p-h,v),i.lineTo(p-u,v+u),i.fill()}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,resolution:n,z:o,viewScale:a})}}],r&&Lu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function Hu(t){return Hu="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},Hu(t)}function qu(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 Yu(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yu(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 Yu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Vu(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,Xu(r.key),r)}}function Xu(t){var e=function(t){if("object"!=Hu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Hu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Hu(e)?e:e+""}function Zu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Zu=function(){return!!t})()}function Ju(t){return Ju=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ju(t)}function Ku(t,e){return Ku=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ku(t,e)}var Qu=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Ju(e),function(t,e){if(e&&("object"==Hu(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)}(t,Zu()?Reflect.construct(e,n||[],Ju(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.ts=t.ts,n.noData=t.noData||function(t){return void 0===t||""==t||null===t||isNaN(+t)},n.offsetX=t.offsetX||function(t,e,n){return 0},n.width=t.width||function(t,e,n){return e},n.offsetY=t.offsetY||function(t,e,n){return 0},n.height=t.height||function(t,e,n){return e},n.anchorModeY=t.anchorModeY||function(t,e,n){return"center"},n.lineWidth=t.lineWidth||function(t,e,n,r){return 1.5*r},n.color=t.color||function(){return"black"},n}return 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&&Ku(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i,a=e.view.z,u=e.offscreenCtx,l=this.viewScale?this.viewScale(t,n,a):void 0,c=function(t){var e,n,o,i=qu(r.ts);try{for(i.s();!(o=i.n()).done;){var a=t[o.value];null!=a&&((null==e||a<e)&&(e=a),(null==n||a>n)&&(n=a))}}catch(t){i.e(t)}finally{i.f()}if(null!=e)return n-e},s=qu(t);try{for(s.s();!(i=s.n()).done;){var f=c(i.value);null!=f&&(null==o||f>o)&&(o=f)}}catch(t){s.e(t)}finally{s.f()}if(o){var h=this.ts.length;u.lineCap="butt";var y,p=qu(t);try{for(p.s();!(y=p.n()).done;){var v=y.value,d=this.lineWidth?this.lineWidth(v,n,a,l):void 0;if(d&&!(d<0)){var b=this.color?this.color(v,n,a,l):void 0;if(b){var m=this.offsetX?this.offsetX(v,n,a):0;if(null!=m&&!isNaN(m)){var g=this.width?this.width(v,n,a):n;if(null!=g&&!isNaN(g)){var w=this.offsetY?this.offsetY(v,n,a):0;if(null!=w&&!isNaN(w)){var x=this.height?this.height(v,n,a):n;if(null!=x&&!isNaN(x)){var S=this.anchorModeY?this.anchorModeY(v,n,a):"center";if(S){u.lineWidth=d,u.strokeStyle=b;var O=void 0,_=void 0;if("first"===S)O=v[this.ts[0]],_=0;else if("last"===S)O=v[this.ts[this.ts.length-1]],_=0;else if("bottom"===S){var j,P=qu(this.ts);try{for(P.s();!(j=P.n()).done;){var k=+v[j.value];null!=k&&(null==O||k<O)&&(O=k)}}catch(t){P.e(t)}finally{P.f()}_=0}else if("top"===S){var T,C=qu(this.ts);try{for(C.s();!(T=C.n()).done;){var E=+v[T.value];null!=E&&(null==O||E>O)&&(O=E)}}catch(t){C.e(t)}finally{C.f()}_=n}else{if("center"!==S){console.log("Unexpected anchorModeY: "+S);continue}var A,M=void 0,z=void 0,R=qu(this.ts);try{for(R.s();!(A=R.n()).done;){var I=v[A.value];null!=I&&((null==M||I<M)&&(M=I),(null==z||I>z)&&(z=I))}}catch(t){R.e(t)}finally{R.f()}O=.5*(+z+ +M),_=n/2}var F=g/(h-1),B=v[this.ts[0]];this.noData(B)||(u.beginPath(),u.moveTo(v.x+m,v.y+_+(B-O)*x/o+w));for(var N=void 0,L=1;L<h;L++)N=v[this.ts[L]],this.noData(B)&&this.noData(N)||(!this.noData(B)&&this.noData(N)?u.stroke():this.noData(B)&&!this.noData(N)?(u.beginPath(),u.moveTo(v.x+L*F+m,v.y+_+(N-O)*x/o+w)):(u.lineTo(v.x+L*F+m,v.y+_+(N-O)*x/o+w),L==h-1&&u.stroke())),B=N}}}}}}}}}catch(t){p.e(t)}finally{p.f()}this.updateLegends({style:this,resolution:n,z:a,viewScale:l})}}}],r&&Vu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function tl(t){return tl="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},tl(t)}function el(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)||rl(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 nl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=rl(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 rl(t,e){if(t){if("string"==typeof t)return ol(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ol(t,e):void 0}}function ol(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function il(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,al(r.key),r)}}function al(t){var e=function(t){if("object"!=tl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=tl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==tl(e)?e:e+""}function ul(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ul=function(){return!!t})()}function ll(t){return ll=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ll(t)}function cl(t,e){return cl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},cl(t,e)}var sl=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=ll(e),function(t,e){if(e&&("object"==tl(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)}(t,ul()?Reflect.construct(e,n||[],ll(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.color=t.color,n.height=t.height||function(t,e,n,r){return.4*e},n.angle=null!=t.angle?t.angle:50,n.cornerLineStrokeColor=t.cornerLineStrokeColor||function(t,e,n,r){return"#999"},n.cornerLineWidth=t.cornerLineWidth||function(t,e,n,r){return r%90==0?0:.8*n},n.sVert=null==t.sVert||t.sVert,n.sHor=null==t.sHor||t.sHor,n}return 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&&cl(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,n,o):void 0,u=Object.keys(this.color),l=n/2,c=this.offset(void 0,n,o),s=c.dx,f=c.dy,h=Ki.buildSides(t,n,this.angle%180!=90&&this.sVert,this.angle%180!=0&&this.sHor);if(0!=h.length){var y=this.angle*Math.PI/180,p=Math.cos(y),v=Math.sin(y),d=Math.abs(this.angle)<90?e.extGeo.xMin:e.extGeo.xMax,b=this.angle<0?e.extGeo.yMax:e.extGeo.yMin;h.sort(function(t,e){return Math.hypot(e.x-d,e.y-b)-Math.hypot(t.x-d,t.y-b)});var m=function(t){if(t){var e=r.cornerLineWidth?r.cornerLineWidth(t,n,o,r.angle):.8*o;if(0!=e){i.strokeStyle=r.cornerLineStrokeColor?r.cornerLineStrokeColor(t,n,o,r.angle):"#333",i.lineWidth=e;var u=r.height(t,n,o,a);i.beginPath(),i.moveTo(t.x+l+s,t.y+l+f),i.lineTo(t.x+l+u*p+s,t.y+l+u*v+f),i.stroke()}}};i.lineCap="round";var g,w=nl(h);try{for(w.s();!(g=w.n()).done;){var x=g.value,S=x.c1,O=x.c2,_=x.x,j=x.y,P=S?this.height(S,n,o,a):0,k=O?this.height(O,n,o,a):0,T=fl(S,u),C=fl(O,u);if(0!=T||0!=C)for(var E=0,A=0,M=0,z=Object.entries(this.color);M<z.length;M++){var R=el(z[M],2),I=R[0],F=R[1],B=S?+S[I]:0,N=O?+O[I]:0;if(0!=B||0!=N){var L=P*E/T||0,D=P*(E+B)/T||0,G=k*A/C||0,W=k*(A+N)/C||0;i.beginPath(),"h"==x.or?(i.moveTo(_+L*p+s,j-l+L*v+f),i.lineTo(_+G*p+s,j+l+G*v+f),i.lineTo(_+W*p+s,j+l+W*v+f),i.lineTo(_+D*p+s,j-l+D*v+f)):(i.moveTo(_-l+L*p+s,j+L*v+f),i.lineTo(_+l+G*p+s,j+G*v+f),i.lineTo(_+l+W*p+s,j+W*v+f),i.lineTo(_-l+D*p+s,j+D*v+f)),i.fillStyle=F,i.fill(),E+=B,A+=N,m(S),m(O)}}}}catch(t){w.e(t)}finally{w.f()}this.updateLegends({style:this,resolution:n,z:o,viewScale:a})}}}],r&&il(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr),fl=function(t,e){if(!t)return 0;var n,r=0,o=nl(e);try{for(o.s();!(n=o.n()).done;){var i=t[n.value];i&&(r+=+i)}}catch(t){o.e(t)}finally{o.f()}return r||0};function hl(t){return hl="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},hl(t)}function yl(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(hl(t)+" is not iterable")}function pl(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof u?r:u,c=Object.create(l.prototype);return vl(c,"_invoke",function(n,r,o){var i,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(e,n){return i=e,u=0,l=t,h.n=n,a}};function y(n,r){for(u=n,l=r,e=0;!f&&c&&!o&&e<s.length;e++){var o,i=s[e],y=h.p,p=i[2];n>3?(o=p===r)&&(l=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=n<2&&y<i[1])?(u=0,h.v=r,h.n=i[1]):y<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,u=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&y(s,p),u=s,l=p;(e=u<2?t:l)||!f;){i||(u?u<3?(u>1&&(h.n=-1),y(u,l)):h.n=l:h.v=l);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=h.n<0)?l:n.call(r,h))!==a)break}catch(e){i=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),c}var a={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(vl(e={},r,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,vl(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,vl(f,"constructor",c),vl(c,"constructor",l),l.displayName="GeneratorFunction",vl(c,o,"GeneratorFunction"),vl(f),vl(f,o,"Generator"),vl(f,r,function(){return this}),vl(f,"toString",function(){return"[object Generator]"}),(pl=function(){return{w:i,m:h}})()}function vl(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}vl=function(t,e,n,r){function i(e,n){vl(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},vl(t,e,n,r)}function dl(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 bl(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bl(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 bl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ml(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function gl(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,wl(r.key),r)}}function wl(t){var e=function(t){if("object"!=hl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=hl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==hl(e)?e:e+""}function xl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(xl=function(){return!!t})()}function Sl(t){return Sl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sl(t)}function Ol(t,e){return Ol=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ol(t,e)}var _l=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Sl(e),function(t,e){if(e&&("object"==hl(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)}(t,xl()?Reflect.construct(e,n||[],Sl(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.image=t.image||function(){return""},n.size=t.size||function(t,e){return e},n.cache={},n}return 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&&Ol(t,e)}(e,t),n=e,r=[{key:"draw",value:(o=pl().m(function t(e,n,r){var o,i,a,u,l,c,s,f,h=this;return pl().w(function(t){for(;;)switch(t.p=t.n){case 0:o=n.view.z,i=r/o,a=this.viewScale?this.viewScale(e,r,o):void 0,n.initCanvasTransform(),u=dl(e),t.p=1,c=pl().m(function t(){var e,u,c,s,f,y;return pl().w(function(t){for(;;)switch(t.n){case 0:if(e=l.value,u=h.image(e,r,o,a)){t.n=1;break}return t.a(2,0);case 1:if(c=h.size(e,r,o,a)/o){t.n=2;break}return t.a(2,0);case 2:if("loading"!=(s=h.cache[u])){t.n=3;break}return t.a(2,{v:void 0});case 3:if(s){y=(i-c)/2;try{n.offscreenCtx.drawImage(s,n.geoToPixX(e.x)+y,n.geoToPixY(e.y)+y-i,c,c)}catch(t){console.error(t)}}else h.cache[u]="loading",(f=new Image).onload=function(){h.cache[u]=f,n.redraw()},f.onerror=function(){console.warn("Could not retrieve image from",u)},f.src=u;case 4:return t.a(2)}},t)}),u.s();case 2:if((l=u.n()).done){t.n=6;break}return t.d(yl(c()),3);case 3:if(0!==(s=t.v)){t.n=4;break}return t.a(3,5);case 4:if(!s){t.n=5;break}return t.a(2,s.v);case 5:t.n=2;break;case 6:t.n=8;break;case 7:t.p=7,f=t.v,u.e(f);case 8:return t.p=8,u.f(),t.f(8);case 9:this.updateLegends({style:this,resolution:r,z:o,viewScale:a});case 10:return t.a(2)}},t,this,[[1,7,8,9]])}),i=function(){var t=this,e=arguments;return new Promise(function(n,r){var i=o.apply(t,e);function a(t){ml(i,n,r,a,u,"next",t)}function u(t){ml(i,n,r,a,u,"throw",t)}a(void 0)})},function(t,e,n){return i.apply(this,arguments)})}],r&&gl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o,i}(Sr);function jl(t){return jl="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},jl(t)}function Pl(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 kl(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kl(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 kl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Tl(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,Cl(r.key),r)}}function Cl(t){var e=function(t){if("object"!=jl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=jl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==jl(e)?e:e+""}function El(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(El=function(){return!!t})()}function Al(t){return Al=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Al(t)}function Ml(t,e){return Ml=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ml(t,e)}var zl=function(t){function e(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,n){return e=Al(e),function(t,e){if(e&&("object"==jl(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)}(t,El()?Reflect.construct(e,n||[],Al(t).constructor):e.apply(t,n))}(this,e,[o]),o=o||{},r.dataset=t,r.styles=n,r.minPixelsPerCell=o.minPixelsPerCell||3,r.cellInfoHTML=o.cellInfoHTML||e.defaultCellInfoHTML,r}return 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&&Ml(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,n){var r=t.view.z,o=t.offscreenCtx,i=this.getDataset(r);if(i){i.getData(t.extGeo),i.updateViewCache(t.extGeo);var a,u=Pl(this.styles);try{for(u.s();!(a=u.n()).done;){var l=a.value;l.visible&&!l.visible(r)||(o.globalAlpha=l.alpha?l.alpha(r):1,l.blendOperation&&(o.globalCompositeOperation=l.blendOperation(r)),t.setCanvasTransform(),l.draw(i.getViewCache(),t,i.getResolution()),l.filterColor&&l.drawFilter(t))}}catch(t){u.e(t)}finally{u.f()}if(n){var c,s=Pl(this.styles);try{for(s.s();!(c=s.n()).done;){var f=c.value;if((!f.visible||f.visible(r))&&(e.addLegends(n,f.legends),f.styles)){var h,y=Pl(f.styles);try{for(y.s();!(h=y.n()).done;){var p=h.value;p.visible&&!p.visible(r)||e.addLegends(n,p.legends)}}catch(t){y.e(t)}finally{y.f()}}}}catch(t){s.e(t)}finally{s.f()}}}}},{key:"getDataset",value:function(t){return this.dataset.getDataset(t,this.minPixelsPerCell)}},{key:"styles_",value:function(t){return 0===arguments.length?this.styles:(1===arguments.length?Array.isArray(t)?this.styles=t:this.styles=[t]:this.styles=arguments,this)}}],o=[{key:"addLegends",value:function(t,e){if(Array.isArray(e)){var n,r=Pl(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;this.addLegends(t,o)}}catch(t){r.e(t)}finally{r.f()}}else t.node().append(e.div.node())}},{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("")}}],r&&Tl(n.prototype,r),o&&Tl(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Cr);function Rl(t){return Rl="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},Rl(t)}function Il(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,Fl(r.key),r)}}function Fl(t){var e=function(t){if("object"!=Rl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Rl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rl(e)?e:e+""}function Bl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Bl=function(){return!!t})()}function Nl(t){return Nl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Nl(t)}function Ll(t,e){return Ll=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ll(t,e)}var Dl=function(t){function e(t){var n;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Nl(e),function(t,e){if(e&&("object"==Rl(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)}(t,Bl()?Reflect.construct(e,n||[],Nl(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.cache={},n.url=t.url,n.urlFun=t.urlFun||function(t,e,r){return n.url+r+"/"+t+"/"+e+".png"},n.resolutions=t.resolutions,!n.resolutions||0==n.resolutions.length)throw new Error("No resolutions provided for background layer");return n.nbPix=t.nbPix||256,n.origin=t.origin||[0,0],n.z0=t.z0||0,n.pixelationCoefficient=t.pixelationCoefficient||1,n}return 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&&Ll(t,e)}(e,t),n=e,(r=[{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.view.z,r=this.origin[0],o=this.origin[1],i=0;for(i=0;i<this.resolutions.length&&!(this.resolutions[i]<n*this.pixelationCoefficient);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)},s=function(t){return Math.ceil(-(t-o)/u)},f=c(t.extGeo.xMin)-1,h=c(t.extGeo.xMax),y=s(t.extGeo.yMin),p=s(t.extGeo.yMax)-1,v=function(n){for(var a=function(a){var c=e.get(i,n,a);if(!c){var s=new Image;return e.put(s,i,n,a),s.onload=function(){t.redraw()},s.onerror=function(){e.put("failed",i,n,a)},s.src=e.urlFun(n,a,i),0}if("failed"===c)return 0;if(!(c instanceof HTMLImageElement))return console.log(c),0;if(0==c.width||0==c.height)return 0;var f=r+n*u,h=o-a*u;try{t.initCanvasTransform(),t.offscreenCtx.drawImage(c,t.geoToPixX(f),t.geoToPixY(h),l,l)}catch(t){console.error(t)}},c=p;c<y;c++)a(c)},d=f;d<h;d++)v(d)}else console.error("No resolutions provided for background layer")}}])&&Il(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Cr);function Gl(t){return Gl="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},Gl(t)}function Wl(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,Ul(r.key),r)}}function Ul(t){var e=function(t){if("object"!=Gl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Gl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Gl(e)?e:e+""}function $l(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return($l=function(){return!!t})()}function Hl(t){return Hl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hl(t)}function ql(t,e){return ql=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ql(t,e)}var Yl=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Hl(e),function(t,e){if(e&&("object"==Gl(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)}(t,$l()?Reflect.construct(e,n||[],Hl(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.url=t.url,n.img=void 0,n.xMin=void 0,n.xMax=void 0,n.yMin=void 0,n.yMax=void 0,n}return 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&&ql(t,e)}(e,t),n=e,(r=[{key:"hasMoved",value:function(t){return t.xMin!=this.xMin||t.xMax!=this.xMax||t.yMin!=this.yMin||t.yMax!=this.yMax}},{key:"draw",value:function(t){if(t.updateExtentGeo(0),!this.hasMoved(t.extGeo)&&this.img)t.initCanvasTransform(),t.offscreenCtx.drawImage(this.img,0,0,t.w,t.h);else{this.xMin=t.extGeo.xMin,this.xMax=t.extGeo.xMax,this.yMin=t.extGeo.yMin,this.yMax=t.extGeo.yMax;var e=[];e.push(this.url),e.push("&width="),e.push(t.w),e.push("&height="),e.push(t.h),e.push("&bbox="),e.push(t.extGeo.xMin),e.push(","),e.push(t.extGeo.yMin),e.push(","),e.push(t.extGeo.xMax),e.push(","),e.push(t.extGeo.yMax);var n=e.join("");this.img||(this.img=new Image,this.img.onload=function(){t.redraw()},this.img.onerror=function(){console.warn("Could not retrieve WMS background image from",n)}),this.img.src=n}}}])&&Wl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Cr);function Vl(t){return Vl="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},Vl(t)}function Xl(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,Zl(r.key),r)}}function Zl(t){var e=function(t){if("object"!=Vl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vl(e)?e:e+""}function Jl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Jl=function(){return!!t})()}function Kl(t){return Kl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Kl(t)}function Ql(t,e){return Ql=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ql(t,e)}var tc=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Kl(e),function(t,e){if(e&&("object"==Vl(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)}(t,Jl()?Reflect.construct(e,n||[],Kl(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.url=t.url,n.xMin=t.xMin||0,n.yMax=t.yMax||0,n.width=t.width||2e4,n.height=t.height||2e4,n.img=void 0,n}return 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&&Ql(t,e)}(e,t),n=e,(r=[{key:"draw",value:function(t){var e=this;if(this.img){var n=t.geoToPixX(this.xMin),r=t.geoToPixY(this.yMax),o=t.getView().z;t.initCanvasTransform(),t.offscreenCtx.drawImage(this.img,n,r,this.width/o,this.height/o)}else this.img||(this.img=new Image,this.img.onload=function(){t.redraw()},this.img.onerror=function(){console.warn("Could not retrieve background image from",e.url)}),this.img.src=this.url}}])&&Xl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Cr);function ec(t){return ec="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},ec(t)}function nc(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof u?r:u,c=Object.create(l.prototype);return rc(c,"_invoke",function(n,r,o){var i,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(e,n){return i=e,u=0,l=t,h.n=n,a}};function y(n,r){for(u=n,l=r,e=0;!f&&c&&!o&&e<s.length;e++){var o,i=s[e],y=h.p,p=i[2];n>3?(o=p===r)&&(l=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=n<2&&y<i[1])?(u=0,h.v=r,h.n=i[1]):y<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,u=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&y(s,p),u=s,l=p;(e=u<2?t:l)||!f;){i||(u?u<3?(u>1&&(h.n=-1),y(u,l)):h.n=l:h.v=l);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=h.n<0)?l:n.call(r,h))!==a)break}catch(e){i=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),c}var a={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(rc(e={},r,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,rc(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,rc(f,"constructor",c),rc(c,"constructor",l),l.displayName="GeneratorFunction",rc(c,o,"GeneratorFunction"),rc(f),rc(f,o,"Generator"),rc(f,r,function(){return this}),rc(f,"toString",function(){return"[object Generator]"}),(nc=function(){return{w:i,m:h}})()}function rc(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}rc=function(t,e,n,r){function i(e,n){rc(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},rc(t,e,n,r)}function oc(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function ic(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 ac(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ac(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 ac(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function uc(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,lc(r.key),r)}}function lc(t){var e=function(t){if("object"!=ec(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ec(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ec(e)?e:e+""}function cc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(cc=function(){return!!t})()}function sc(t){return sc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sc(t)}function fc(t,e){return fc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fc(t,e)}var hc=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=sc(e),function(t,e){if(e&&("object"==ec(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)}(t,cc()?Reflect.construct(e,n||[],sc(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.url=t.url,n.style=t.style||function(){return"1.2em Arial"},n.color=t.color||(t.dark?function(){return"white"}:function(){return"black"}),n.haloColor=t.haloColor||(t.dark?function(){return"black"}:function(){return"white"}),n.haloWidth=t.haloWidth||function(){return 2.5},n.textAlign=t.textAlign||"start",n.offsetPix=t.offsetPix||[5,5],n.preprocess=t.preprocess,n.labels=void 0,n.loadingStatus="notLoaded",n}return 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&&fc(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t){if(this.labels){var e=t.view.z,n=t.offscreenCtx;n.textAlign=this.textAlign||"start",n.lineJoin="bevel",n.lineCap="butt",t.initCanvasTransform();var r,o=ic(this.labels);try{for(o.s();!(r=o.n()).done;){var i=r.value,a=this.style(i,e);if(a&&(n.font=a,t.toDraw(i))){var u=t.geoToPixX(i.x)+this.offsetPix[0],l=t.geoToPixY(i.y)-this.offsetPix[1];if(this.haloColor&&this.haloWidth){var c=this.haloColor(i,e),s=this.haloWidth(i,e);c&&s&&s>0&&(n.strokeStyle=c,n.lineWidth=s,n.strokeText(i.name,u,l))}if(this.color){var f=this.color(i,e);f&&(n.fillStyle=f,n.fillText(i.name,u,l))}}}}catch(t){o.e(t)}finally{o.f()}}else this.load(t.redraw)}},{key:"load",value:(o=nc().m(function t(e){var n,r,o,i,a;return nc().w(function(t){for(;;)switch(t.p=t.n){case 0:if(this.url){t.n=1;break}return console.log("Failed loading labels: No URL specified. "+this.url),this.loadingStatus="failed",this.labels=[],t.a(2);case 1:if("notLoaded"==this.loadingStatus){t.n=2;break}return t.a(2);case 2:return this.loadingStatus="loading",t.p=3,t.n=4,ro(this.url);case 4:if(n=t.v,!this.preprocess){t.n=13;break}this.labels=[],r=ic(n),t.p=5,r.s();case 6:if((o=r.n()).done){t.n=9;break}if(i=o.value,0!=this.preprocess(i)){t.n=7;break}return t.a(3,8);case 7:this.labels.push(i);case 8:t.n=6;break;case 9:t.n=11;break;case 10:t.p=10,a=t.v,r.e(a);case 11:return t.p=11,r.f(),t.f(11);case 12:t.n=14;break;case 13:this.labels=n;case 14:this.loadingStatus="loaded",e&&e(),t.n=16;break;case 15:t.p=15,t.v,console.log("Failed loading labels from "+this.url),this.labels=[],this.loadingStatus="failed";case 16:return t.a(2)}},t,this,[[5,10,11,12],[3,15]])}),i=function(){var t=this,e=arguments;return new Promise(function(n,r){var i=o.apply(t,e);function a(t){oc(i,n,r,a,u,"next",t)}function u(t){oc(i,n,r,a,u,"throw",t)}a(void 0)})},function(t){return i.apply(this,arguments)})}],r&&uc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o,i}(Cr);function yc(t){return yc="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},yc(t)}function pc(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof u?r:u,c=Object.create(l.prototype);return vc(c,"_invoke",function(n,r,o){var i,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(e,n){return i=e,u=0,l=t,h.n=n,a}};function y(n,r){for(u=n,l=r,e=0;!f&&c&&!o&&e<s.length;e++){var o,i=s[e],y=h.p,p=i[2];n>3?(o=p===r)&&(l=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=n<2&&y<i[1])?(u=0,h.v=r,h.n=i[1]):y<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,u=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&y(s,p),u=s,l=p;(e=u<2?t:l)||!f;){i||(u?u<3?(u>1&&(h.n=-1),y(u,l)):h.n=l:h.v=l);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=h.n<0)?l:n.call(r,h))!==a)break}catch(e){i=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),c}var a={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(vc(e={},r,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,vc(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,vc(f,"constructor",c),vc(c,"constructor",l),l.displayName="GeneratorFunction",vc(c,o,"GeneratorFunction"),vc(f),vc(f,o,"Generator"),vc(f,r,function(){return this}),vc(f,"toString",function(){return"[object Generator]"}),(pc=function(){return{w:i,m:h}})()}function vc(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}vc=function(t,e,n,r){function i(e,n){vc(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},vc(t,e,n,r)}function dc(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function bc(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 mc(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mc(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 mc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function gc(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,wc(r.key),r)}}function wc(t){var e=function(t){if("object"!=yc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=yc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yc(e)?e:e+""}function xc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(xc=function(){return!!t})()}function Sc(t){return Sc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sc(t)}function Oc(t,e){return Oc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Oc(t,e)}var _c=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Sc(e),function(t,e){if(e&&("object"==yc(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)}(t,xc()?Reflect.construct(e,n||[],Sc(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.url=t.url,n.preprocess=t.preprocess,n.shape=t.shape||function(t,e){return"circle"},n.size=t.size||function(t,e){return 10},n.strokeStyle=t.strokeStyle||function(t,e){return"red"},n.fillStyle=t.fillStyle||function(t,e){return"black"},n.lineWidth=t.lineWidth||function(t,e){return 2},n.color=t.color||function(t,e){return"gray"},n.width=t.width||function(t,e){return 2},n.lineDash=t.lineDash||function(t,e){},n.fs=void 0,n.loadingStatus="notLoaded",n}return 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&&Oc(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t){if(this.fs){var e,n=t.view.z,r=t.offscreenCtx,o=bc(this.fs);try{for(o.s();!(e=o.n()).done;){var i=e.value,a=i.geometry.type;if("Point"==a){var u=i.geometry.coordinates,l=this.shape(i,n);if(!l||"none"==l)continue;var c=this.size(i,n)*n;if(!c)continue;var s=this.strokeStyle(i,n),f=this.fillStyle(i,n),h=this.lineWidth(i,n)*n;s&&(r.strokeStyle=s),f&&(r.fillStyle=f),h&&(r.lineWidth=h),"circle"==l?(r.beginPath(),r.arc(u[0],u[1],c/2,0,2*Math.PI,!1),f&&r.fill(),s&&h&&r.stroke()):"square"==l?(r.beginPath(),r.rect(u[0]-c/2,u[1]-c/2,c,c),f&&r.fill(),s&&h&&r.stroke()):console.error("Unexpected shape for point geojson: "+l)}else if("LineString"==a){var y=i.geometry.coordinates;if(y.length<2)continue;var p=this.color(i,n);if(!p||"none"==p)continue;r.strokeStyle=p;var v=this.width(i,n);if(!v||v<0)continue;r.lineWidth=v*n;var d=this.lineDash(i,n);d&&r.setLineDash(d),r.beginPath(),r.moveTo(y[0][0],y[0][1]);for(var b=1;b<y.length;b++)r.lineTo(y[b][0],y[b][1]);r.stroke()}else console.log("Unsupported geometry type in GeoJSONLayer: "+a)}}catch(t){o.e(t)}finally{o.f()}r.setLineDash([])}else this.load(t.redraw)}},{key:"load",value:(o=pc().m(function t(e){var n,r,o,i,a,u;return pc().w(function(t){for(;;)switch(t.p=t.n){case 0:if(this.url){t.n=1;break}return console.log("Failed loading boundaries: No URL specified. "+this.url),this.loadingStatus="failed",this.labels=[],t.a(2);case 1:if("notLoaded"==this.loadingStatus){t.n=2;break}return t.a(2);case 2:return this.loadingStatus="loading",t.p=3,t.n=4,Wr(this.url);case 4:if(n=t.v,r=n.features,!this.preprocess){t.n=13;break}this.fs=[],o=bc(r),t.p=5,o.s();case 6:if((i=o.n()).done){t.n=9;break}if(a=i.value,0!=this.preprocess(a)){t.n=7;break}return t.a(3,8);case 7:this.fs.push(a);case 8:t.n=6;break;case 9:t.n=11;break;case 10:t.p=10,u=t.v,o.e(u);case 11:return t.p=11,o.f(),t.f(11);case 12:t.n=14;break;case 13:this.fs=r;case 14:this.loadingStatus="loaded",e&&e(),t.n=16;break;case 15:t.p=15,t.v,console.log("Failed loading boundaries from "+this.url),this.fs=[],this.loadingStatus="failed";case 16:return t.a(2)}},t,this,[[5,10,11,12],[3,15]])}),i=function(){var t=this,e=arguments;return new Promise(function(n,r){var i=o.apply(t,e);function a(t){dc(i,n,r,a,u,"next",t)}function u(t){dc(i,n,r,a,u,"throw",t)}a(void 0)})},function(t){return i.apply(this,arguments)})}],r&&gc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o,i}(Cr);function jc(t){return jc="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},jc(t)}function Pc(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,kc(r.key),r)}}function kc(t){var e=function(t){if("object"!=jc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=jc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==jc(e)?e:e+""}var Tc=function(){return t=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.id&&(this.div=pt("#"+this.id)),this.div&&!this.div.empty()||(this.div=pt(document.createElement("div")),this.id&&this.div.attr("id",this.id)),this.div.style("background",this.background),this.div.style("padding",this.padding),this.div.style("border",this.border),this.div.style("border-radius",this["border-radius"]),this.div.style("box-shadow",this["box-shadow"]),this.div.style("font-family",this["font-family"]),this.title=e.title,this.titleFontSize=e.titleFontSize||"0.8em",this.titleFontWeight=e.titleFontWeight||"bold",this.labelFontSize=e.labelFontSize||"0.8em",this.labelUnitText=e.labelUnitText||"",this.labelFormat=e.labelFormat},e=[{key:"makeTitle",value:function(){this.title&&this.div.append("div").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).style("margin-bottom","7px").text(this.title)}},{key:"style",value:function(t,e){return 1==arguments.length?this.div.style(t):(this.div.style(t,e),this)}},{key:"update",value:function(){console.error("Legend update not implemented yet.")}}],e&&Pc(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Cc(t){return Cc="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},Cc(t)}function Ec(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,Ac(r.key),r)}}function Ac(t){var e=function(t){if("object"!=Cc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Cc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cc(e)?e:e+""}function Mc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Mc=function(){return!!t})()}function zc(t){return zc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zc(t)}function Rc(t,e){return Rc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Rc(t,e)}var Ic=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=zc(e),function(t,e){if(e&&("object"==Cc(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)}(t,Mc()?Reflect.construct(e,n||[],zc(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.colorScale=t.colorScale,n.textScale=t.textScale||function(t){return t},n.margin=t.margin||5,n.tickSize=t.tickSize||6,n.ticks=t.ticks||Math.floor(n.width/50),n.tickFormat=t.tickFormat,n.tickUnit=t.tickUnit,n.fontSize=t.fontSize||"0.8em",n.invert=t.invert,n.width=t.width||300,n.height=t.height||15,n}return 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&&Rc(t,e)}(e,t),n=e,r=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();for(var e=this.width+2*this.margin,n=this.height+this.margin+this.tickSize+10,r=this.div.append("svg").attr("width",e).attr("height",n).append("g").attr("transform","translate("+this.margin+" 0)"),o=this.width,i=this.height,a=0;a<o;a+=5){var u=a/(o-1);this.invert&&(u=1-u),r.append("rect").attr("x",a).attr("y",0).attr("width",5).attr("height",i).style("fill",this.colorScale(u,t.viewScale))}for(var l=0;l<this.ticks;l++){var c=l/(this.ticks-1);r.append("line").attr("x1",o*c).attr("y1",0).attr("x2",o*c).attr("y2",i+this.tickSize).style("stroke","black"),r.append("text").attr("id","ticklabel_"+l).attr("x",o*c).attr("y",i+this.tickSize+2).style("font-size",this.fontSize).style("text-anchor",0==l?"start":l==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?this.tickFormat:function(t){return t},f=0;f<this.ticks;f++){var h=f/(this.ticks-1),y=this.textScale(h,t.viewScale),p=(y?s(y):"0")+(this.tickUnit?this.tickUnit:"");null!=p&&this.div.select("#ticklabel_"+f).text(p)}}}],r&&Ec(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tc);function Fc(t){return Fc="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},Fc(t)}function Bc(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,Nc(r.key),r)}}function Nc(t){var e=function(t){if("object"!=Fc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fc(e)?e:e+""}function Lc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Lc=function(){return!!t})()}function Dc(t){return Dc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dc(t)}function Gc(t,e){return Gc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gc(t,e)}var Wc=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Dc(e),function(t,e){if(e&&("object"==Fc(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)}(t,Lc()?Reflect.construct(e,n||[],Dc(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.colors=t.colors,n.breaks=t.breaks,n.width=t.width||300,n.height=t.height||15,n.tickSize=t.tickSize||3,n.invert=t.invert,n}return 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&&Gc(t,e)}(e,t),n=e,(r=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();var e=this.colors(t.viewScale),n=this.breaks(t.viewScale);if(n){var r=e.length;if(0!=r){for(var o=this.width/r,i=this.div.append("svg").attr("width",this.width).attr("height",this.height+this.tickSize+2+10),a=0;a<r;a++)i.append("rect").attr("x",a*o).attr("y",0).attr("width",o).attr("height",this.height).style("fill",e[a]);for(var u=1;u<r;u++)i.append("line").attr("x1",o*u).attr("y1",0).attr("x2",o*u).attr("y2",this.height+this.tickSize).style("stroke","black");for(var l=1;l<r;l++){var c=n[l-1];isNaN(c)||null==c||(this.labelFormat&&(c=this.labelFormat(c,l)),i.append("text").attr("id","ticklabel_"+l).attr("x",o*l).attr("y",this.height+this.tickSize+2).style("font-size",this.labelFontSize).style("text-anchor","middle").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none").text(c))}}}}}])&&Bc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tc);function Uc(t){return Uc="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},Uc(t)}function $c(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,Hc(r.key),r)}}function Hc(t){var e=function(t){if("object"!=Uc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Uc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Uc(e)?e:e+""}function qc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(qc=function(){return!!t})()}function Yc(t){return Yc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yc(t)}function Vc(t,e){return Vc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vc(t,e)}var Xc=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Yc(e),function(t,e){if(e&&("object"==Uc(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)}(t,qc()?Reflect.construct(e,n||[],Yc(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.colorLabel=t.colorLabel||[["gray","-"]],n.shape=t.shape||"circle",n.dimension=t.dimension||{r:8},n.strokeColor=t.strokeColor||"gray",n.strokeWidth=t.strokeWidth||1,n}return 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&&Vc(t,e)}(e,t),n=e,(r=[{key:"update",value:function(){this.div.selectAll("*").remove(),this.makeTitle();var t=this.colorLabel.length;if(0!=t)for(var e=0;e<t;e++){var n=this.colorLabel[e],r=this.div.append("div"),o=this.strokeWidth;if("square"===this.shape){var i=this.dimension.h||15,a=this.dimension.w||20;r.append("div").style("display","inline").append("svg").attr("width",a+2*o).attr("height",i+2*o).append("rect").attr("x",o).attr("y",o).attr("width",a).attr("height",i).style("fill",n[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}else{if("circle"!==this.shape)throw new Error("Unexpected shape:"+this.shape);var u=this.dimension.r||8,l=2*u+2*o;r.append("div").style("display","inline").append("svg").attr("width",l).attr("height",l).append("circle").attr("cx",u+o).attr("cy",u+o).attr("r",u).style("fill",n[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}r.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(n[1])}}}])&&$c(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tc);function Zc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Jc(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[8,6,5,4,2.5,2],r=Math.pow(10,Math.floor(Math.log10(t))),o=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 Zc(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zc(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}}}}(n);try{for(o.s();!(e=o.n()).done;){var i=e.value;if(r*i<=t)return r*i}}catch(t){o.e(t)}finally{o.f()}return r}function Kc(t){return Kc="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},Kc(t)}function Qc(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 ts(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ts(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 ts(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function es(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,ns(r.key),r)}}function ns(t){var e=function(t){if("object"!=Kc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Kc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Kc(e)?e:e+""}function rs(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(rs=function(){return!!t})()}function os(t){return os=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},os(t)}function is(t,e){return is=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},is(t,e)}var as=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=os(e),function(t,e){if(e&&("object"==Kc(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)}(t,rs()?Reflect.construct(e,n||[],os(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.label=t.label||void 0,n.size=t.size||void 0,n.shape=t.shape||"circle",n.fillColor=t.fillColor||"none",n.strokeColor=t.strokeColor||"gray",n.strokeWidth=t.strokeWidth||1,n.color=t.color||"gray",n.length=t.length||function(t,e,n){return t},n}return 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&&is(t,e)}(e,t),n=e,(r=[{key:"update",value:function(t){var e=this;this.div.selectAll("*").remove(),this.makeTitle();var n,r=this.label(t.viewScale,t.cells,t.resolution,t.z);if(n=this.size?this.size(t.viewScale,t.resolution,t.z)/t.z:t.viewScale(+r)/t.z){this.labelFormat&&!isNaN(+r)&&(r=this.labelFormat(r));var o=this.div.append("div"),i=function(){return o.append("svg").attr("width",n+e.strokeWidth+2).attr("height",n+e.strokeWidth+2).style("","inline-block")};if("square"===this.shape)i().append("rect").attr("x",0).attr("y",0).attr("width",n).attr("height",n).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth);else if("circle"===this.shape){var a=.5*(n+this.strokeWidth);i().append("circle").attr("cx",a+1).attr("cy",a+1).attr("r",a).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}else if("donut"===this.shape);else if("diamond"===this.shape);else{if("line"!==this.shape)throw new Error("Unexpected shape:"+this.shape);var u=this.length?this.length(t.resolution,t.z,t.viewScale):t.resolution;u/=t.z,o.append("svg").attr("width",u).attr("height",n).style("","inline-block").append("line").attr("x1",0).attr("y1",n/2).attr("x2",u).attr("y2",n/2).style("stroke",this.color).style("stroke-width",n)}o.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(r+(this.labelUnitText?" ":"")+this.labelUnitText)}}}])&&es(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tc);function us(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=[],i=Qc(t);try{var a=function(){var i=n.value;r.title=i==t[0]?r.title:void 0,r.size=function(){return e(i)},r.label=function(){return i},o.push(new as(r))};for(i.s();!(n=i.n()).done;)a()}catch(t){i.e(t)}finally{i.f()}return o}function ls(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.k||[.9,.5,.2,.05],o=[],i=Qc(r);try{var a=function(){var i=e.value;n.title=i==r[0]?n.title:void 0,n.label=function(e,n){return Jc(i*Ia(n,t))},o.push(new as(n))};for(i.s();!(e=i.n()).done;)a()}catch(t){i.e(t)}finally{i.f()}return o}function cs(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.labelFormat||function(t){return t},o=n.labelText||fs(r),i=[],a=function(r){n.title=r==e.length-1?n.title:void 0,n.size=function(){return e[r]},n.label=function(){return o(t[r-1],t[r])},i.push(new as(n))},u=e.length-1;u>=0;u--)a(u);return i}function ss(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.labelFormat||function(t){return t},r=e.labelText||fs(n),o=[],i=e.viewScaleFun||function(t){return t},a=function(n){e.title=n==t-1?e.title:void 0,e.size=function(t){return i(t).values[n]},e.label=function(t){return r(i(t).breaks[n-1],i(t).breaks[n])},o.push(new as(e))},u=t-1;u>=0;u--)a(u);return o}function fs(t){return function(e,n){return null==e&&null==n?"":null==n?"> "+t(e):null==e?"< "+t(n):t(e)+" - "+t(n)}}function hs(t){return hs="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},hs(t)}function ys(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,ps(r.key),r)}}function ps(t){var e=function(t){if("object"!=hs(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=hs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==hs(e)?e:e+""}function vs(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(vs=function(){return!!t})()}function ds(t){return ds=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ds(t)}function bs(t,e){return bs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bs(t,e)}var ms=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=ds(e),function(t,e){if(e&&("object"==hs(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)}(t,vs()?Reflect.construct(e,n||[],ds(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.orientation=t.orientation||0,n.color=t.color||function(t,e,n){return"gray"},n.width=t.width||function(t,e,n){return 3*e},n.length=t.length||function(t,e,n){return t},n.label=t.label||"-",n}return 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&&bs(t,e)}(e,t),n=e,r=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();var e=this.div.append("div"),n=this.color(t.resolution,t.z,t.viewScale),r=this.width(t.resolution,t.z,t.viewScale)/t.z,o=this.length(t.resolution,t.z,t.viewScale)/t.z,i=Math.max(o,r),a=e.append("svg").attr("width",i).attr("height",i).style("","inline-block"),u=Math.cos(-this.orientation*Math.PI/180),l=Math.sin(-this.orientation*Math.PI/180),c=.5*i,s=.5*o;a.append("line").attr("x1",c-u*s).attr("y1",c-l*s).attr("x2",c+u*s).attr("y2",c+l*s).style("stroke",n).style("stroke-width",r),e.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(this.label+(this.labelUnitText?" ":"")+this.labelUnitText)}}],r&&ys(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tc);function gs(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[],o=0;o<t.length;o++)n.title=0==o?n.title:void 0,n.orientation=t[o],n.label=e[o],r.push(new ms(n));return r}function ws(t){return ws="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},ws(t)}function xs(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,Ss(r.key),r)}}function Ss(t){var e=function(t){if("object"!=ws(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ws(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ws(e)?e:e+""}function Os(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Os=function(){return!!t})()}function _s(t){return _s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_s(t)}function js(t,e){return js=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},js(t,e)}var Ps=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=_s(e),function(t,e){if(e&&("object"==ws(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)}(t,Os()?Reflect.construct(e,n||[],_s(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.classifier=t.classifier,n.width=t.width||150,n.selectionColor=n.selectionColor||"red",n.tooltip=t.tooltip,n.texts=t.texts,n.leftText=t.leftText||"Category 0",n.topText=t.topText||"Category 1",n.rightText=t.rightText||"Category 2",n.centerCoefficient=t.centerCoefficient||n.classifier.centerCoefficient,n}return 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&&js(t,e)}(e,t),n=e,r=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();var e=this.width,n=.866025*e,r=this.classifier,o=this.selectionColor,i=this.tooltip,a=this.texts||{},u=this.div.append("svg").attr("width",e+0).attr("height",n+8+24);u.append("text").attr("x",e/2).attr("y",14).text(this.topText).attr("font-size",12).attr("text-anchor","middle"),u.append("text").attr("x",0).attr("y",30+n).text(this.leftText).attr("font-size",12).attr("text-anchor","start"),u.append("text").attr("x",e).attr("y",30+n).text(this.rightText).attr("font-size",12).attr("text-anchor","end");var l=u.append("g").attr("transform","translate(0 16)"),c=function(t,e,n){t.attr("fill",e).on("mouseover",function(t){pt(this).attr("fill",o),i&&n&&(i.html(n),i.setPosition(t),i.show())}).on("mouseout",function(){pt(this).attr("fill",e),i&&i.hide()}),i&&n&&t.on("mousemove",function(t){i.setPosition(t)})};c(l.append("polygon").attr("points","0,"+n+" "+e/3+","+n+" "+e/2+","+2*n/3+" "+e/6+","+2*n/3),r.colors[0],a[0]),c(l.append("polygon").attr("points",e/2+",0 "+2*e/3+","+n/3+" "+e/2+","+2*n/3+" "+e/3+","+n/3),r.colors[1],a[1]),c(l.append("polygon").attr("points",e+","+n+" "+5*e/6+","+2*n/3+" "+e/2+","+2*n/3+" "+2*e/3+","+n),r.colors[2],a[2]),c(l.append("polygon").attr("points",e/2+","+2*n/3+" "+5*e/6+","+2*n/3+" "+2*e/3+","+n/3),r.mixColors[0],a.m12),c(l.append("polygon").attr("points",e/2+","+2*n/3+" "+e/3+","+n+" "+2*e/3+","+n),r.mixColors[1],a.m02),c(l.append("polygon").attr("points",e/2+","+2*n/3+" "+e/6+","+2*n/3+" "+e/3+","+n/3),r.mixColors[2],a.m01),this.centerCoefficient&&c(l.append("circle").attr("cx",e/2).attr("cy",2*n/3).attr("r",this.centerCoefficient*n/3),r.centerColor,a.center)}}],r&&xs(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tc),ks=function(t){return t};ks.invert=ks;var Ts=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(0==t)return ks;var e=Math.exp(t)-1,n=function(n){return(Math.exp(n*t)-1)/e};return n.invert=function(n){return Math.log(e*n+1)/t},n},Cs=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(0==t)return ks;var e=Math.exp(t),n=1-e,r=function(r){return 1-Math.log(e+r*n)/t};return r.invert=function(r){return(Math.exp((1-r)*t)-e)/n},r},Es=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(1==t)return ks;var e=function(e){return Math.pow(e,t)},n=1/t;return e.invert=function(t){return Math.pow(t,n)},e},As=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(1==t)return ks;var e=1/t,n=function(t){return 1-Math.pow(1-t,e)};return n.invert=function(e){return 1-Math.pow(1-e,t)},n},Ms=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;if(0==t)return ks;if(1==t)return function(t){return Math.sqrt(t*(2-t))};var e=t/(1-t);return function(t){return Math.sqrt(1/(e*e)+t*(2/e+2-t))-1/e}},zs=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;if(0==t)return ks;var e=Ms(t);return function(t){return 1-e(1-t)}};const Rs=Math.PI/180,Is=180/Math.PI,Fs=.96422,Bs=.82521,Ns=4/29,Ls=6/29,Ds=3*Ls*Ls,Gs=Ls*Ls*Ls;function Ws(t){if(t instanceof $s)return new $s(t.l,t.a,t.b,t.opacity);if(t instanceof Xs)return Zs(t);t instanceof Ae||(t=Ce(t));var e,n,r=Vs(t.r),o=Vs(t.g),i=Vs(t.b),a=Hs((.2225045*r+.7168786*o+.0606169*i)/1);return r===o&&o===i?e=n=a:(e=Hs((.4360747*r+.3850649*o+.1430804*i)/Fs),n=Hs((.0139322*r+.0971045*o+.7141733*i)/Bs)),new $s(116*a-16,500*(e-a),200*(a-n),t.opacity)}function Us(t,e,n,r){return 1===arguments.length?Ws(t):new $s(t,e,n,null==r?1:r)}function $s(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Hs(t){return t>Gs?Math.pow(t,1/3):t/Ds+Ns}function qs(t){return t>Ls?t*t*t:Ds*(t-Ns)}function Ys(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Vs(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Xs(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function Zs(t){if(isNaN(t.h))return new $s(t.l,0,0,t.opacity);var e=t.h*Rs;return new $s(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function Js(t,e){var n=He((t=Us(t)).l,(e=Us(e)).l),r=He(t.a,e.a),o=He(t.b,e.b),i=He(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=o(e),t.opacity=i(e),t+""}}function Ks(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)||function(t,e){if(t){if("string"==typeof t)return Qs(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qs(t,e):void 0}}(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 Qs(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}le($s,Us,ce(se,{brighter(t){return new $s(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new $s(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new Ae(Ys(3.1338561*(e=Fs*qs(e))-1.6168667*(t=1*qs(t))-.4906146*(n=Bs*qs(n))),Ys(-.9787684*e+1.9161415*t+.033454*n),Ys(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),le(Xs,function(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof Xs)return new Xs(t.h,t.c,t.l,t.opacity);if(t instanceof $s||(t=Ws(t)),0===t.a&&0===t.b)return new Xs(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Is;return new Xs(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new Xs(t,e,n,null==r?1:r)},ce(se,{brighter(t){return new Xs(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new Xs(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return Zs(this).rgb()}}));var tf=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t[0],o=t[1],i=t[2],a=Ks(n.center||[1/3,1/3,1/3],3),u=a[0],l=a[1],c=a[2],s=null==n.withMixedClasses||n.withMixedClasses,f=n.centerCoefficient?1-n.centerCoefficient:void 0,h=function(t){var n=e(t);if(n){var a=+t[r]/n,h=+t[o]/n,y=+t[i]/n;return a>=u&&h<=l&&y<=c?null!=f&&(y-c)*(l-f*l)>=(h-f*l)*(f*c-c)?"center":"0":a<=u&&h>=l&&y<=c?null!=f&&(y-c)*(u-f*u)>=(a-f*u)*(f*c-c)?"center":"1":a<=u&&h<=l&&y>=c?null!=f&&(h-l)*(u-f*u)>=(a-f*u)*(f*l-l)?"center":"2":a<=u&&h>=l&&y>=c?null!=f&&a>f*u?"center":s?"m12":h>y?"1":"2":a>=u&&h<=l&&y>=c?null!=f&&h>f*l?"center":s?"m02":a>y?"0":"2":a>=u&&h>=l&&y<=c?null!=f&&y>f*c?"center":s?"m01":h>a?"1":"0":"unknown"}};return h.center=[u,l,c],h.centerCoefficient=n.centerCoefficient,h},ef=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=Ks(n||["red","green","blue"],3),i=o[0],a=o[1],u=o[2],l=r.colorInterpolation||Js,c=null==r.withMixedClasses||r.withMixedClasses,s=function(t,e){return l(t,e)(.5)},f=Ks(r.mixedColors||c?[s(a,u),s(i,u),s(i,a)]:[],3),h=f[0],y=f[1],p=f[2],v=r.centerColor||l(s(i,a),u)(.333),d=tf(t,e,r),b=function(t){var e=d(t);return"0"==e?i:"1"==e?a:"2"==e?u:"m12"==e?h:"m02"==e?y:"m01"==e?p:"center"==e?v:r.defaultColor||"black"};return b.center=d.center,b.centerCoefficient=r.centerCoefficient,b.colors=[i,a,u],b.mixColors=[h,y,p],b.centerColor=v,b.classifier=d,b};function nf(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 rf,of=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function af(t){if(!(e=of.exec(t)))throw new Error("invalid format: "+t);var e;return new uf({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 uf(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 lf(t,e){var n=nf(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")}af.prototype=uf.prototype,uf.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 cf={"%":(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)=>lf(100*t,e),r:lf,s:function(t,e){var n=nf(t,e);if(!n)return t+"";var r=n[0],o=n[1],i=o-(rf=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")+nf(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function sf(t){return t}var ff,hf=Array.prototype.map,yf=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function pf(t){return ff=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?sf:(e=hf.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?sf:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(hf.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=af(t)).fill,n=t.align,f=t.sign,h=t.symbol,y=t.zero,p=t.width,v=t.comma,d=t.precision,b=t.trim,m=t.type;"n"===m?(v=!0,m="g"):cf[m]||(void 0===d&&(d=12),b=!0,m="g"),(y||"0"===e&&"="===n)&&(y=!0,e="0",n="=");var g="$"===h?o:"#"===h&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",w="$"===h?i:/[%p]/.test(m)?l:"",x=cf[m],S=/[defgprs%]/.test(m);function O(t){var o,i,l,h=g,O=w;if("c"===m)O=x(t)+O,t="";else{var _=(t=+t)<0||1/t<0;if(t=isNaN(t)?s:x(Math.abs(t),d),b&&(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)),_&&0===+t&&"+"!==f&&(_=!1),h=(_?"("===f?f:c:"-"===f||"("===f?"":f)+h,O=("s"===m?yf[8+rf/3]:"")+O+(_&&"("===f?")":""),S)for(o=-1,i=t.length;++o<i;)if(48>(l=t.charCodeAt(o))||l>57){O=(46===l?a+t.slice(o+1):t.slice(o))+O,t=t.slice(0,o);break}}v&&!y&&(t=r(t,1/0));var j=h.length+t.length+O.length,P=j<p?new Array(p-j+1).join(e):"";switch(v&&y&&(t=r(P+t,P.length?p-O.length:1/0),P=""),n){case"<":t=h+t+O+P;break;case"=":t=h+P+t+O;break;case"^":t=P.slice(0,j=P.length>>1)+h+t+O+P.slice(j);break;default:t=P+h+t+O}return u(t)}return d=void 0===d?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),O.toString=function(){return t+""},O}return{format:f,formatPrefix:function(t,e){var n,r=f(((t=af(t)).type="f",t)),o=3*Math.max(-8,Math.min(8,Math.floor((n=e,((n=nf(Math.abs(n)))?n[1]:NaN)/3)))),i=Math.pow(10,-o),a=yf[8+o/3];return function(t){return r(i*t)+a}}}}(t),ff.format,ff.formatPrefix,ff}pf({thousands:",",grouping:[3],currency:["$",""]});var vf=In.getParameterByName;return pf({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),e})());
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.gridviz=e():t.gridviz=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(){return[]}function i(t){return null==t?o:function(){return this.querySelectorAll(t)}}function a(t){return function(){return this.matches(t)}}function u(t){return function(e){return e.matches(t)}}t.r(e),t.d(e,{BackgroundLayer:()=>Dl,BackgroundLayerImage:()=>tc,BackgroundLayerWMS:()=>Yl,CSVGrid:()=>Ao,ColorCategoryLegend:()=>Zc,ColorDiscreteLegend:()=>Wc,ColorLegend:()=>Ic,CompositionStyle:()=>gi,Dataset:()=>Ir,DotDensityStyle:()=>Oa,GeoCanvas:()=>In,GeoJSONLayer:()=>_c,GridLayer:()=>zl,ImageStyle:()=>_l,IsoFenceStyle:()=>sl,JSGrid:()=>Lo,JoyPlotStyle:()=>ci,LabelLayer:()=>hc,Layer:()=>Cr,LegoStyle:()=>vu,Map:()=>cr,MosaicStyle:()=>Fu,MultiResolutionDataset:()=>Dr,NinjaStarStyle:()=>$u,OrientationLegend:()=>ms,PillarStyle:()=>$i,SegmentStyle:()=>ki,ShapeColorSizeStyle:()=>Yo,SideCategoryStyle:()=>aa,SideStyle:()=>Ki,SizeLegend:()=>as,SquareColorCategoryWebGLStyle:()=>Ra,SquareColorWebGLStyle:()=>Tu,StrokeStyle:()=>ei,Style:()=>Sr,TanakaStyle:()=>ou,TernaryLegend:()=>Ps,TextStyle:()=>Ii,TiledGrid:()=>mo,TimeSeriesStyle:()=>Qu,circularInverseScale:()=>zs,circularScale:()=>Ms,classifier:()=>Ka,colorClassifier:()=>Qa,discreteColors:()=>tu,exponentialScale:()=>Ts,getParameterByName:()=>vf,logarithmicScale:()=>Cs,nice:()=>Jc,orientationLegend:()=>gs,powerInverseScale:()=>As,powerScale:()=>Es,sizeDiscreteLegend:()=>cs,sizeDiscreteViewScaleLegend:()=>ss,sizeLegend:()=>us,sizeLegendViewScale:()=>ls,ternaryClassifier:()=>tf,ternaryColorClassifier:()=>ef,viewScale:()=>Ya,viewScaleColor:()=>Za,viewScaleColorQuantile:()=>Xa,viewScaleCombination:()=>Ja,viewScaleQuantile:()=>Va});var l=Array.prototype.find;function c(){return this.firstElementChild}var s=Array.prototype.filter;function f(){return Array.from(this.children)}function h(t){return new Array(t.length)}function y(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function p(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 y(t,i[u]);for(;u<l;++u)(a=e[u])&&(o[u]=a)}function v(t,e,n,r,o,i,a){var u,l,c,s=new Map,f=e.length,h=i.length,p=new Array(f);for(u=0;u<f;++u)(l=e[u])&&(p[u]=c=a.call(l,l.__data__,u,e)+"",s.has(c)?o[u]=l:s.set(c,l));for(u=0;u<h;++u)c=a.call(t,i[u],u,i)+"",(l=s.get(c))?(r[u]=l,l.__data__=i[u],s.delete(c)):n[u]=new y(t,i[u]);for(u=0;u<f;++u)(l=e[u])&&s.get(p[u])===l&&(o[u]=l)}function d(t){return t.__data__}function b(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function m(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}y.prototype={constructor:y,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 g="http://www.w3.org/1999/xhtml";const w={svg:"http://www.w3.org/2000/svg",xhtml:g,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function x(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),w.hasOwnProperty(e)?{space:w[e],local:t}:t}function S(t){return function(){this.removeAttribute(t)}}function O(t){return function(){this.removeAttributeNS(t.space,t.local)}}function _(t,e){return function(){this.setAttribute(t,e)}}function j(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function P(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function k(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 C(t){return function(){this.style.removeProperty(t)}}function E(t,e,n){return function(){this.style.setProperty(t,e,n)}}function A(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function M(t,e){return t.style.getPropertyValue(e)||T(t).getComputedStyle(t,null).getPropertyValue(e)}function z(t){return function(){delete this[t]}}function R(t,e){return function(){this[t]=e}}function I(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function F(t){return t.trim().split(/^|\s+/)}function B(t){return t.classList||new N(t)}function N(t){this._node=t,this._names=F(t.getAttribute("class")||"")}function L(t,e){for(var n=B(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function D(t,e){for(var n=B(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function G(t){return function(){L(this,t)}}function W(t){return function(){D(this,t)}}function U(t,e){return function(){(e.apply(this,arguments)?L:D)(this,t)}}function $(){this.textContent=""}function H(t){return function(){this.textContent=t}}function q(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function Y(){this.innerHTML=""}function V(t){return function(){this.innerHTML=t}}function Z(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function X(){this.nextSibling&&this.parentNode.appendChild(this)}function J(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function K(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===g&&e.documentElement.namespaceURI===g?e.createElement(t):e.createElementNS(n,t)}}function Q(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function tt(t){var e=x(t);return(e.local?Q:K)(e)}function et(){return null}function nt(){var t=this.parentNode;t&&t.removeChild(this)}function rt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ot(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function it(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 at(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 ut(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 lt(t,e){return function(){return ut(this,t,e)}}function ct(t,e){return function(){return ut(this,t,e.apply(this,arguments))}}N.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 st=[null];function ft(t,e){this._groups=t,this._parents=e}function ht(){return new ft([[document.documentElement]],st)}ft.prototype=ht.prototype={constructor:ft,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,s=o[i]=new Array(c),f=0;f<c;++f)(a=l[f])&&(u=t.call(a,a.__data__,f,l))&&("__data__"in a&&(u.__data__=a.__data__),s[f]=u);return new ft(o,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}(t):i(t);for(var e=this._groups,n=e.length,r=[],o=[],a=0;a<n;++a)for(var u,l=e[a],c=l.length,s=0;s<c;++s)(u=l[s])&&(r.push(t.call(u,u.__data__,s,l)),o.push(u));return new ft(r,o)},selectChild:function(t){return this.select(null==t?c:function(t){return function(){return l.call(this.children,t)}}("function"==typeof t?t:u(t)))},selectChildren:function(t){return this.selectAll(null==t?f:function(t){return function(){return s.call(this.children,t)}}("function"==typeof t?t:u(t)))},filter:function(t){"function"!=typeof t&&(t=a(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,u=e[o],l=u.length,c=r[o]=[],s=0;s<l;++s)(i=u[s])&&t.call(i,i.__data__,s,u)&&c.push(i);return new ft(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,d);var n,r=e?v:p,o=this._parents,i=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var a=i.length,u=new Array(a),l=new Array(a),c=new Array(a),s=0;s<a;++s){var f=o[s],h=i[s],y=h.length,m=b(t.call(f,f&&f.__data__,s,o)),g=m.length,w=l[s]=new Array(g),x=u[s]=new Array(g);r(f,h,w,x,c[s]=new Array(y),m,e);for(var S,O,_=0,j=0;_<g;++_)if(S=w[_]){for(_>=j&&(j=_+1);!(O=x[j])&&++j<g;);S._next=O||null}}return(u=new ft(u,o))._enter=l,u._exit=c,u},enter:function(){return new ft(this._enter||this._groups.map(h),this._parents)},exit:function(){return new ft(this._exit||this._groups.map(h),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,s=n[l],f=r[l],h=s.length,y=u[l]=new Array(h),p=0;p<h;++p)(c=s[p]||f[p])&&(y[p]=c);for(;l<o;++l)u[l]=n[l];return new ft(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=m);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),s=0;s<l;++s)(a=u[s])&&(c[s]=a);c.sort(e)}return new ft(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=x(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:S:"function"==typeof e?n.local?k:P:n.local?j:_)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?C:"function"==typeof e?A:E)(t,e,null==n?"":n)):M(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?z:"function"==typeof e?I:R)(t,e)):this.node()[t]},classed:function(t,e){var n=F(t+"");if(arguments.length<2){for(var r=B(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof e?U:e?G:W)(n,e))},text:function(t){return arguments.length?this.each(null==t?$:("function"==typeof t?q:H)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Y:("function"==typeof t?Z:V)(t)):this.node().innerHTML},raise:function(){return this.each(X)},lower:function(){return this.each(J)},append:function(t){var e="function"==typeof t?t:tt(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:tt(t),o=null==e?et:"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(nt)},clone:function(t){return this.select(t?ot:rt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,o,i=function(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}(t+""),a=i.length;if(!(arguments.length<2)){for(u=e?at:it,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,s=u.length;c<s;++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?ct:lt)(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 yt=ht;function pt(t){return"string"==typeof t?new ft([[document.querySelector(t)]],[document.documentElement]):new ft([[t]],st)}var vt={value:()=>{}};function dt(){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 bt(r)}function bt(t){this._=t}function mt(t,e){for(var n,r=0,o=t.length;r<o;++r)if((n=t[r]).name===e)return n.value}function gt(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=vt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}bt.prototype=dt.prototype={constructor:bt,on:function(t,e){var n,r,o=this._,i=(r=o,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),a=-1,u=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<u;)if(n=(t=i[a]).type)o[n]=gt(o[n],t.name,e);else if(null==e)for(n in o)o[n]=gt(o[n],t.name,null);return this}for(;++a<u;)if((n=(t=i[a]).type)&&(n=mt(o[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new bt(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 wt=dt,xt={capture:!0,passive:!1};function St(t){t.preventDefault(),t.stopImmediatePropagation()}function Ot(t){return((t=Math.exp(t))+1/t)/2}const _t=function t(e,n,r){function o(t,o){var i,a,u=t[0],l=t[1],c=t[2],s=o[0],f=o[1],h=o[2],y=s-u,p=f-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),b=(h*h-c*c+r*v)/(2*c*n*d),m=(h*h-c*c-r*v)/(2*h*n*d),g=Math.log(Math.sqrt(b*b+1)-b),w=Math.log(Math.sqrt(m*m+1)-m);a=(w-g)/e,i=function(t){var r,o=t*a,i=Ot(g),s=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+s*y,l+s*p,c*i/Ot(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 jt(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 Pt,kt,Tt=0,Ct=0,Et=0,At=0,Mt=0,zt=0,Rt="object"==typeof performance&&performance.now?performance:Date,It="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ft(){return Mt||(It(Bt),Mt=Rt.now()+zt)}function Bt(){Mt=0}function Nt(){this._call=this._time=this._next=null}function Lt(t,e,n){var r=new Nt;return r.restart(t,e,n),r}function Dt(){Mt=(At=Rt.now())+zt,Tt=Ct=0;try{!function(){Ft(),++Tt;for(var t,e=Pt;e;)(t=Mt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Tt}()}finally{Tt=0,function(){for(var t,e,n=Pt,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:Pt=e);kt=t,Wt(r)}(),Mt=0}}function Gt(){var t=Rt.now(),e=t-At;e>1e3&&(zt-=e,At=t)}function Wt(t){Tt||(Ct&&(Ct=clearTimeout(Ct)),t-Mt>24?(t<1/0&&(Ct=setTimeout(Dt,t-Rt.now()-zt)),Et&&(Et=clearInterval(Et))):(Et||(At=Rt.now(),Et=setInterval(Gt,1e3)),Tt=1,It(Dt)))}function Ut(t,e,n){var r=new Nt;return e=null==e?0:+e,r.restart(n=>{r.stop(),t(n+e)},e,n),r}Nt.prototype=Lt.prototype={constructor:Nt,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Ft():+n)+(null==e?0:+e),this._next||kt===this||(kt?kt._next=this:Pt=this,kt=this),this._call=t,this._time=n,Wt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wt())}};var $t=wt("start","end","cancel","interrupt"),Ht=[];function qt(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,s,f,h;if(1!==n.state)return u();for(c in o)if((h=o[c]).name===n.name){if(3===h.state)return Ut(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(Ut(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(f=n.tween.length),c=0,s=-1;c<f;++c)(h=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(r[++s]=h);r.length=s+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=Lt(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:$t,tween:Ht,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Yt(t,e){var n=Zt(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function Vt(t,e){var n=Zt(t,e);if(n.state>3)throw new Error("too late; already running");return n}function Zt(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Xt(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 Jt(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Kt,Qt=180/Math.PI,te={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ee(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)*Qt,skewX:Math.atan(l)*Qt,scaleX:a,scaleY:u}}function ne(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:Jt(t,o)},{i:l-2,x:Jt(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:Jt(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:Jt(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:Jt(t,n)},{i:u-2,x:Jt(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 re=ne(function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?te:ee(e.a,e.b,e.c,e.d,e.e,e.f)},"px, ","px)","deg)"),oe=ne(function(t){return null==t?te:(Kt||(Kt=document.createElementNS("http://www.w3.org/2000/svg","g")),Kt.setAttribute("transform",t),(t=Kt.transform.baseVal.consolidate())?ee((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):te)},", ",")",")");function ie(t,e){var n,r;return function(){var o=Vt(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 ae(t,e,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=Vt(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 ue(t,e,n){var r=t._id;return t.each(function(){var t=Vt(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)}),function(t){return Zt(t,r).value[e]}}function le(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ce(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function se(){}var fe=.7,he=1/fe,ye="\\s*([+-]?\\d+)\\s*",pe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ve="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",de=/^#([0-9a-f]{3,8})$/,be=new RegExp(`^rgb\\(${ye},${ye},${ye}\\)$`),me=new RegExp(`^rgb\\(${ve},${ve},${ve}\\)$`),ge=new RegExp(`^rgba\\(${ye},${ye},${ye},${pe}\\)$`),we=new RegExp(`^rgba\\(${ve},${ve},${ve},${pe}\\)$`),xe=new RegExp(`^hsl\\(${pe},${ve},${ve}\\)$`),Se=new RegExp(`^hsla\\(${pe},${ve},${ve},${pe}\\)$`),Oe={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 _e(){return this.rgb().formatHex()}function je(){return this.rgb().formatRgb()}function Pe(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=de.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ke(e):3===n?new Ae(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Te(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Te(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=be.exec(t))?new Ae(e[1],e[2],e[3],1):(e=me.exec(t))?new Ae(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ge.exec(t))?Te(e[1],e[2],e[3],e[4]):(e=we.exec(t))?Te(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=xe.exec(t))?Be(e[1],e[2]/100,e[3]/100,1):(e=Se.exec(t))?Be(e[1],e[2]/100,e[3]/100,e[4]):Oe.hasOwnProperty(t)?ke(Oe[t]):"transparent"===t?new Ae(NaN,NaN,NaN,0):null}function ke(t){return new Ae(t>>16&255,t>>8&255,255&t,1)}function Te(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ae(t,e,n,r)}function Ce(t){return t instanceof se||(t=Pe(t)),t?new Ae((t=t.rgb()).r,t.g,t.b,t.opacity):new Ae}function Ee(t,e,n,r){return 1===arguments.length?Ce(t):new Ae(t,e,n,null==r?1:r)}function Ae(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Me(){return`#${Fe(this.r)}${Fe(this.g)}${Fe(this.b)}`}function ze(){const t=Re(this.opacity);return`${1===t?"rgb(":"rgba("}${Ie(this.r)}, ${Ie(this.g)}, ${Ie(this.b)}${1===t?")":`, ${t})`}`}function Re(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ie(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Fe(t){return((t=Ie(t))<16?"0":"")+t.toString(16)}function Be(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Le(t,e,n,r)}function Ne(t){if(t instanceof Le)return new Le(t.h,t.s,t.l,t.opacity);if(t instanceof se||(t=Pe(t)),!t)return new Le;if(t instanceof Le)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 Le(a,u,l,t.opacity)}function Le(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function De(t){return(t=(t||0)%360)<0?t+360:t}function Ge(t){return Math.max(0,Math.min(1,t||0))}function We(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 Ue(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}le(se,Pe,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:_e,formatHex:_e,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ne(this).formatHsl()},formatRgb:je,toString:je}),le(Ae,Ee,ce(se,{brighter(t){return t=null==t?he:Math.pow(he,t),new Ae(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?fe:Math.pow(fe,t),new Ae(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ae(Ie(this.r),Ie(this.g),Ie(this.b),Re(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:Me,formatHex:Me,formatHex8:function(){return`#${Fe(this.r)}${Fe(this.g)}${Fe(this.b)}${Fe(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ze,toString:ze})),le(Le,function(t,e,n,r){return 1===arguments.length?Ne(t):new Le(t,e,n,null==r?1:r)},ce(se,{brighter(t){return t=null==t?he:Math.pow(he,t),new Le(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?fe:Math.pow(fe,t),new Le(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 Ae(We(t>=240?t-240:t+120,o,r),We(t,o,r),We(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new Le(De(this.h),Ge(this.s),Ge(this.l),Re(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=Re(this.opacity);return`${1===t?"hsl(":"hsla("}${De(this.h)}, ${100*Ge(this.s)}%, ${100*Ge(this.l)}%${1===t?")":`, ${t})`}`}}));const $e=t=>()=>t;function He(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):$e(isNaN(t)?e:t)}const qe=function t(e){var n=function(t){return 1===(t=+t)?He: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):$e(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=Ee(t)).r,(e=Ee(e)).r),o=n(t.g,e.g),i=n(t.b,e.b),a=He(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 Ye(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=Ee(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+""}}}Ye(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 Ue((n-r/e)*e,a,o,i,u)}}),Ye(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 Ue((n-r/e)*e,o,i,a,u)}});var Ve=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ze=new RegExp(Ve.source,"g");function Xe(t,e){var n,r,o,i=Ve.lastIndex=Ze.lastIndex=0,a=-1,u=[],l=[];for(t+="",e+="";(n=Ve.exec(t))&&(r=Ze.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:Jt(n,r)})),i=Ze.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 Je(t,e){var n;return("number"==typeof e?Jt:e instanceof Pe?qe:(n=Pe(e))?(e=n,qe):Xe)(t,e)}function Ke(t){return function(){this.removeAttribute(t)}}function Qe(t){return function(){this.removeAttributeNS(t.space,t.local)}}function tn(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 en(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 nn(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 rn(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 on(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,o)),n}return o._value=e,o}function an(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,o)),n}return o._value=e,o}function un(t,e){return function(){Yt(this,t).delay=+e.apply(this,arguments)}}function ln(t,e){return e=+e,function(){Yt(this,t).delay=e}}function cn(t,e){return function(){Vt(this,t).duration=+e.apply(this,arguments)}}function sn(t,e){return e=+e,function(){Vt(this,t).duration=e}}var fn=yt.prototype.constructor;function hn(t){return function(){this.style.removeProperty(t)}}var yn=0;function pn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function vn(){return++yn}var dn=yt.prototype;pn.prototype=function(t){return yt().transition(t)}.prototype={constructor:pn,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,s=o[u],f=s.length,h=a[u]=new Array(f),y=0;y<f;++y)(l=s[y])&&(c=t.call(l,l.__data__,y,s))&&("__data__"in l&&(c.__data__=l.__data__),h[y]=c,qt(h[y],e,n,y,h,Zt(l,n)));return new pn(a,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=i(t));for(var r=this._groups,o=r.length,a=[],u=[],l=0;l<o;++l)for(var c,s=r[l],f=s.length,h=0;h<f;++h)if(c=s[h]){for(var y,p=t.call(c,c.__data__,h,s),v=Zt(c,n),d=0,b=p.length;d<b;++d)(y=p[d])&&qt(y,e,n,d,p,v);a.push(p),u.push(c)}return new pn(a,u,e,n)},selectChild:dn.selectChild,selectChildren:dn.selectChildren,filter:function(t){"function"!=typeof t&&(t=a(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,u=e[o],l=u.length,c=r[o]=[],s=0;s<l;++s)(i=u[s])&&t.call(i,i.__data__,s,u)&&c.push(i);return new pn(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],s=n[u],f=c.length,h=a[u]=new Array(f),y=0;y<f;++y)(l=c[y]||s[y])&&(h[y]=l);for(;u<r;++u)a[u]=e[u];return new pn(a,this._parents,this._name,this._id)},selection:function(){return new fn(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=vn(),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 s=Zt(a,e);qt(a,t,n,c,u,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new pn(r,this._parents,t,n)},call:dn.call,nodes:dn.nodes,node:dn.node,size:dn.size,empty:dn.empty,each:dn.each,on:function(t,e){var n=this._id;return arguments.length<2?Zt(this.node(),n).on.on(t):this.each(function(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)?Yt:Vt;return function(){var a=i(this,t),u=a.on;u!==r&&(o=(r=u).copy()).on(e,n),a.on=o}}(n,t,e))},attr:function(t,e){var n=x(t),r="transform"===n?oe:Je;return this.attrTween(t,"function"==typeof e?(n.local?rn:nn)(n,r,ue(this,"attr."+t,e)):null==e?(n.local?Qe:Ke)(n):(n.local?en:tn)(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=x(t);return this.tween(n,(r.local?on:an)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?re:Je;return null==e?this.styleTween(t,function(t,e){var n,r,o;return function(){var i=M(this,t),a=(this.style.removeProperty(t),M(this,t));return i===a?null:i===n&&a===r?o:o=e(n=i,r=a)}}(t,r)).on("end.style."+t,hn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,o,i;return function(){var a=M(this,t),u=n(this),l=u+"";return null==u&&(this.style.removeProperty(t),l=u=M(this,t)),a===l?null:a===r&&l===o?i:(o=l,i=e(r=a,u))}}(t,r,ue(this,"style."+t,e))).each(function(t,e){var n,r,o,i,a="style."+e,u="end."+a;return function(){var l=Vt(this,t),c=l.on,s=null==l.value[a]?i||(i=hn(e)):void 0;c===n&&o===s||(r=(n=c).copy()).on(u,o=s),l.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,o,i=n+"";return function(){var a=M(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,function(t,e,n){var r,o;function i(){var i=e.apply(this,arguments);return i!==o&&(r=(o=i)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,i,n)),r}return i._value=e,i}(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}}(ue(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(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=Zt(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?ie:ae)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?un:ln)(e,t)):Zt(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?cn:sn)(e,t)):Zt(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){Vt(this,t).ease=e}}(e,t)):Zt(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;Vt(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=Vt(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]:dn[Symbol.iterator]};var bn={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}yt.prototype.interrupt=function(t){return this.each(function(){Xt(this,t)})},yt.prototype.transition=function(t){var e,n;t instanceof pn?(e=t._id,t=t._name):(e=vn(),(n=bn).time=Ft(),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])&&qt(a,t,e,c,u,n||mn(a,e));return new pn(r,this._parents,t,e)};const gn=t=>()=>t;function wn(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 xn(t,e,n){this.k=t,this.x=e,this.y=n}xn.prototype={constructor:xn,scale:function(t){return 1===t?this:new xn(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new xn(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 Sn=new xn(1,0,0);function On(t){t.stopImmediatePropagation()}function _n(t){t.preventDefault(),t.stopImmediatePropagation()}function jn(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Pn(){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 kn(){return this.__zoom||Sn}function Tn(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Cn(){return navigator.maxTouchPoints||"ontouchstart"in this}function En(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 An(t){return An="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},An(t)}function Mn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function zn(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,Rn(r.key),r)}}function Rn(t){var e=function(t){if("object"!=An(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=An(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==An(e)?e:e+""}xn.prototype;var In=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.opts=a||{},this.canvas=e,this.w=this.canvas.offsetWidth,this.h=this.canvas.offsetHeight,this.offscreenCanvas=document.createElement("canvas"),this.offscreenCanvas.width=this.w,this.offscreenCanvas.height=this.h;var u=this.canvas.getContext("2d"),l=this.offscreenCanvas.getContext("2d");if(!u)throw"Impossible to create canvas 2D context";if(!l)throw"Impossible to create canvas 2D context";if(this.ctx=u,this.offscreenCtx=l,this.view={x:r,y:o,z:i},this.backgroundColor=a.backgroundColor||"white",this.onZoomStartFun=a.onZoomStartFun,this.onZoomEndFun=a.onZoomEndFun,this.onZoomFun=a.onZoomFun,this.extGeo={xMin:NaN,xMax:NaN,yMin:NaN,yMax:NaN},this.updateExtentGeo(),!a.disableZoom){var c=Sn;(function(){var t,e,n,r=jn,o=Pn,i=En,a=Tn,u=Cn,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],s=250,f=_t,h=wt("start","zoom","end"),y=0,p=10;function v(t){t.property("__zoom",kn).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",_).filter(u).on("touchstart.zoom",j).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",k).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new xn(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 xn(t.k,r,o)}function m(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function g(t,e,n,r){t.on("start.zoom",function(){w(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(r).end()}).tween("zoom",function(){var t=this,i=arguments,a=w(t,i).event(r),u=o.apply(t,i),l=null==n?m(u):"function"==typeof n?n.apply(t,i):n,c=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),s=t.__zoom,h="function"==typeof e?e.apply(t,i):e,y=f(s.invert(l).concat(c/s.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 xn(n,l[0]-e[0]*n,l[1]-e[1]*n)}a.zoom(null,t)}})}function w(t,e,n){return!n&&t.__zooming||new x(t,e)}function x(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=o.apply(t,e),this.taps=0}function S(t,...e){if(r.apply(this,arguments)){var n=w(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)))),s=jt(t);if(n.wheel)n.mouse[0][0]===s[0]&&n.mouse[0][1]===s[1]||(n.mouse[1]=o.invert(n.mouse[0]=s)),clearTimeout(n.wheel);else{if(o.k===u)return;n.mouse=[s,o.invert(s)],Xt(this),n.start()}_n(t),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",i(b(d(o,u),n.mouse[0],n.mouse[1]),n.extent,c))}}function O(t,...e){if(!n&&r.apply(this,arguments)){var o=t.currentTarget,a=w(this,e,!0).event(t),u=pt(t.view).on("mousemove.zoom",function(t){if(_n(t),!a.moved){var e=t.clientX-s,n=t.clientY-f;a.moved=e*e+n*n>y}a.event(t).zoom("mouse",i(b(a.that.__zoom,a.mouse[0]=jt(t,o),a.mouse[1]),a.extent,c))},!0).on("mouseup.zoom",function(t){u.on("mousemove.zoom mouseup.zoom",null),function(t,e){var n=t.document.documentElement,r=pt(t).on("dragstart.drag",null);e&&(r.on("click.drag",St,xt),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(t.view,a.moved),_n(t),a.event(t).end()},!0),l=jt(t,o),s=t.clientX,f=t.clientY;!function(t){var e=t.document.documentElement,n=pt(t).on("dragstart.drag",St,xt);"onselectstart"in e?n.on("selectstart.drag",St,xt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),On(t),a.mouse=[l,this.__zoom.invert(l)],Xt(this),a.start()}}function _(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=jt(t.changedTouches?t.changedTouches[0]:t,this),u=n.invert(a),l=n.k*(t.shiftKey?.5:2),f=i(b(d(n,l),a,u),o.apply(this,e),c);_n(t),s>0?pt(this).transition().duration(s).call(g,f,a,t):pt(this).call(v.transform,f,a,t)}}function j(n,...o){if(r.apply(this,arguments)){var i,a,u,l,c=n.touches,s=c.length,f=w(this,o,n.changedTouches.length===s).event(n);for(On(n),a=0;a<s;++a)l=[l=jt(u=c[a],this),this.__zoom.invert(l),u.identifier],f.touch0?f.touch1||f.touch0[2]===l[2]||(f.touch1=l,f.taps=0):(f.touch0=l,i=!0,f.taps=1+!!t);t&&(t=clearTimeout(t)),i&&(f.taps<2&&(e=l[0],t=setTimeout(function(){t=null},500)),Xt(this),f.start())}}function P(t,...e){if(this.__zooming){var n,r,o,a,u=w(this,e).event(t),l=t.changedTouches,s=l.length;for(_n(t),n=0;n<s;++n)o=jt(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 f=u.touch0[0],h=u.touch0[1],y=u.touch1[0],p=u.touch1[1],v=(v=y[0]-f[0])*v+(v=y[1]-f[1])*v,m=(m=p[0]-h[0])*m+(m=p[1]-h[1])*m;r=d(r,Math.sqrt(v/m)),o=[(f[0]+y[0])/2,(f[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=w(this,r).event(t),u=t.changedTouches,l=u.length;for(On(t),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),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=jt(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<p)){var c=pt(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return v.transform=function(t,e,n,r){var o=t.selection?t.selection():t;o.property("__zoom",kn),t!==o?g(t,e,n,r):o.interrupt().each(function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()})},v.scaleBy=function(t,e,n,r){v.scaleTo(t,function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)},n,r)},v.scaleTo=function(t,e,n,r){v.transform(t,function(){var t=o.apply(this,arguments),r=this.__zoom,a=null==n?m(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(d(r,l),a,u),t,c)},n,r)},v.translateBy=function(t,e,n,r){v.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)},v.translateTo=function(t,e,n,r,a){v.transform(t,function(){var t=o.apply(this,arguments),a=this.__zoom,u=null==r?m(t):"function"==typeof r?r.apply(this,arguments):r;return i(Sn.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)},x.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=pt(this.that).datum();h.call(t,this.that,new wn(t,{sourceEvent:this.sourceEvent,target:v,type:t,transform:this.that.__zoom,dispatch:h}),e)}},v.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:gn(+t),v):a},v.filter=function(t){return arguments.length?(r="function"==typeof t?t:gn(!!t),v):r},v.touchable=function(t){return arguments.length?(u="function"==typeof t?t:gn(!!t),v):u},v.extent=function(t){return arguments.length?(o="function"==typeof t?t:gn([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),v):o},v.scaleExtent=function(t){return arguments.length?(l[0]=+t[0],l[1]=+t[1],v):[l[0],l[1]]},v.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],v):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},v.constrain=function(t){return arguments.length?(i=t,v):i},v.duration=function(t){return arguments.length?(s=+t,v):s},v.interpolate=function(t){return arguments.length?(f=t,v):f},v.on=function(){var t=h.on.apply(h,arguments);return t===h?v:t},v.clickDistance=function(t){return arguments.length?(y=(t=+t)*t,v):Math.sqrt(y)},v.tapDistance=function(t){return arguments.length?(p=+t,v):p},v})().wheelDelta(function(t){return-t.deltaY*(1===t.deltaMode?.07:t.deltaMode?1:.004)}).on("zoom",function(t){n._isZooming=!0;var e=t.transform,r=c.k/e.k;if(1==r){var o=c.x-e.x,i=c.y-e.y;n.applyPan(o*n.view.z,-i*n.view.z)}else s(t,r);c=e,n.onZoomFun&&n.onZoomFun(t)}).on("start",function(t){var e;n._isZooming=!0,n.canvasSave.c=document.createElement("canvas"),n.canvasSave.c.setAttribute("width",""+n.w),n.canvasSave.c.setAttribute("height",""+n.h),null===(e=n.canvasSave.c.getContext("2d"))||void 0===e||e.drawImage(n.canvas,0,0),n.canvasSave.dx=0,n.canvasSave.dy=0,n.canvasSave.f=1,n.onZoomStartFun&&n.onZoomStartFun(t)}).on("end",function(t){n._isZooming=!1,n.redraw(),n.canvasSave={c:null,dx:0,dy:0,f:1},n.onZoomEndFun&&n.onZoomEndFun(t)})(pt(this.canvas));var s=function(t,e){n.cancelCurrentRequests();var r=t.sourceEvent;if(r instanceof WheelEvent)n.applyZoom(e,n.pixToGeoX(r.offsetX),n.pixToGeoY(r.offsetY));else if(r instanceof TouchEvent){var o,i=0,a=0,u=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 Mn(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mn(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}}}}(r.targetTouches);try{for(u.s();!(o=u.n()).done;){var l=o.value;i+=l.clientX,a+=l.clientY}}catch(t){u.e(t)}finally{u.f()}i/=r.targetTouches.length,a/=r.targetTouches.length,n.applyZoom(e,n.pixToGeoX(i),n.pixToGeoY(a))}}}this.xMin=a.centerExtent?a.centerExtent[0]:void 0,this.yMin=a.centerExtent?a.centerExtent[1]:void 0,this.xMax=a.centerExtent?a.centerExtent[2]:void 0,this.yMax=a.centerExtent?a.centerExtent[3]:void 0,this.zoomExtent=a.zoomExtent||[0,1/0],this.canvasSave={c:null,dx:0,dy:0,f:1}}return e=t,n=[{key:"applyPan",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;if(null!=this.xMin&&this.view.x+t<this.xMin&&(t=this.xMin-this.view.x),null!=this.yMin&&this.view.y+e<this.yMin&&(e=this.yMin-this.view.y),null!=this.xMax&&this.view.x+t>this.xMax&&(t=this.xMax-this.view.x),null!=this.yMax&&this.view.y+e>this.yMax&&(e=this.yMax-this.view.y),this.view.x+=t,this.view.y+=e,this.updateExtentGeo(),this.canvasSave.c){var n=1/this.view.z;this.canvasSave.dx-=t*n,this.canvasSave.dy+=e*n,this.clear(this.backgroundColor),this.offscreenCtx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy),this.ctx.drawImage(this.offscreenCtx.canvas,0,0)}else console.log("no canvas save")}},{key:"applyZoom",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.view.x,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.view.y;if(!(this.zoomExtent[0]==this.view.z&&t<=1||this.zoomExtent[1]==this.view.z&&t>=1)){var r=t*this.view.z;r<this.zoomExtent[0]&&(t=this.zoomExtent[0]/this.view.z),r>this.zoomExtent[1]&&(t=this.zoomExtent[1]/this.view.z),this.view.z*=t;var o=(e-this.view.x)*(1-t),i=(n-this.view.y)*(1-t);null!=this.xMin&&this.view.x+o<this.xMin&&(o=this.xMin-this.view.x),null!=this.yMin&&this.view.y+i<this.yMin&&(i=this.yMin-this.view.y),null!=this.xMax&&this.view.x+o>this.xMax&&(o=this.xMax-this.view.x),null!=this.yMax&&this.view.y+i>this.yMax&&(i=this.yMax-this.view.y),this.view.x+=o,this.view.y+=i,this.updateExtentGeo(),this._drawZoomFrame(t,e,n)}}},{key:"_drawZoomFrame",value:function(t,e,n){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.offscreenCtx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy,this.canvasSave.f*this.canvasSave.c.width,this.canvasSave.f*this.canvasSave.c.height),this.ctx.drawImage(this.offscreenCanvas,0,0,this.canvas.width,this.canvas.height))}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"white";this.opts.transparentBackground?(this.ctx.clearRect(0,0,this.w,this.h),this.offscreenCtx.clearRect(0,0,this.w,this.h)):(this.ctx&&(this.ctx.fillStyle=t),this.offscreenCtx&&(this.offscreenCtx.fillStyle=t),this.ctx.fillRect(0,0,this.w,this.h),this.offscreenCtx.fillRect(0,0,this.w,this.h))}},{key:"getView",value:function(){return this.view}},{key:"setCenterExtent",value:function(t){this.xMin=t[0],this.yMin=t[1],this.xMax=t[2],this.yMax=t[3]}},{key:"getCenterExtent",value:function(){return[this.xMin,this.yMin,this.xMax,this.yMax]}},{key:"setZoomExtent",value:function(t){this.zoomExtent=t}},{key:"getZoomExtent",value:function(){return this.zoomExtent}},{key:"initCanvasTransform",value:function(){this.ctx.setTransform(1,0,0,1,0,0),this.offscreenCtx.setTransform(1,0,0,1,0,0)}},{key:"setCanvasTransform",value:function(){var t=1/this.view.z,e=-this.view.x/this.view.z+.5*this.w,n=this.view.y/this.view.z+.5*this.h;this.ctx.setTransform(t,0,0,-t,e,n),this.offscreenCtx.setTransform(t,0,0,-t,e,n)}},{key:"getWebGLTransform",value:function(){var t=2/(this.w*this.view.z),e=2/(this.h*this.view.z);return[t,0,0,0,e,0,-t*this.view.x,-e*this.view.y,1]}},{key:"redraw",value:function(){throw new Error("Method redraw not implemented.")}},{key:"cancelCurrentRequests",value:function(){throw new Error("Method cancelCurrentRequests not implemented.")}},{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.view.x)/this.view.z+.5*this.w}},{key:"geoToPixY",value:function(t){return-(t-this.view.y)/this.view.z+.5*this.h}},{key:"pixToGeoX",value:function(t){return(t-.5*this.w)*this.view.z+this.view.x}},{key:"pixToGeoY",value:function(t){return-(t-.5*this.h)*this.view.z+this.view.y}},{key:"setViewFromURL",value:function(){var e=t.getParameterByName("x"),n=t.getParameterByName("y"),r=t.getParameterByName("z");null==e||null==e||isNaN(+e)||(this.view.x=+e),null==n||null==n||isNaN(+n)||(this.view.y=+n),null==r||null==r||isNaN(+r)||(this.view.z=+r)}}],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&&zn(e.prototype,n),r&&zn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r}();function Fn(t){return Fn="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},Fn(t)}function Bn(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,Nn(r.key),r)}}function Nn(t){var e=function(t){if("object"!=Fn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fn(e)?e:e+""}var Ln=function(){return t=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.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"]||"0px",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.yMouseOffset=e.yMouseOffset||0,this.xMouseOffset=e.xMouseOffset||0,this.parentElement=e.parentElement||document.body,this.tooltipElement=e.tooltipElement||null,this.tooltip=e.tooltipElement?pt(e.tooltipElement):pt(this.parentElement).append("div").attr("id","gridviz-tooltip").attr("class","gridviz-tooltip"),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"),this.tooltip.style("text-wrap","nowrap"),this.tooltip.style("z-index",99999999),this.tooltip.style("left","0"),this.tooltip.style("top","0"),this.tooltip.attr("role","tooltip").attr("aria-live","polite")},e=[{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){var e=this.parentElement.getBoundingClientRect(),n=t.clientX-e.left+this.xOffset,r=t.clientY-e.top-this.yOffset;this.tooltip.style("left",n+"px").style("top",r+"px"),this.ensureTooltipInsideContainer(t,e,this.tooltip.node())}},{key:"ensureTooltipInsideContainer",value:function(t,e,n){var r=n,o=e.width,i=e.height;if(r.offsetLeft+r.clientWidth>o){var a=t.clientX-r.clientWidth-this.xOffset;r.style.left=a+"px"}r.offsetTop+r.clientHeight>i&&(r.style.top=i-r.clientHeight+"px"),r.offsetTop<0&&(r.style.top="0px"),r.offsetLeft<0&&(r.style.left="0px")}},{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)}}],e&&Bn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Dn(t){return Dn="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},Dn(t)}function Gn(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,Wn(r.key),r)}}function Wn(t){var e=function(t){if("object"!=Dn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Dn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Dn(e)?e:e+""}var Un=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.map=e.map,this.parentNode=e.parentNode||e.map.container,e.id&&(this.div=pt("#"+e.id)),this.div&&!this.div.empty()||(this.div=pt(document.createElement("div")),e.id&&this.div.attr("id",e.id)),e.title&&this.div.attr("title",e.title),e.class&&this.div.attr("class",e.class),e.onClickFunction&&this.div.on("click",e.onClickFunction),this.style("box-shadow","0 7px 8px rgba(0,47,103,.08), 0 0 22px rgba(0,47,103,.04), 0 12px 17px rgba(0,47,103,.04), 0 -4px 4px rgba(0,47,103,.04)"),this.style("background-color","#ffffff"),this.style("position","absolute"),this.style("cursor","pointer"),this.style("display","flex"),this.style("justify-content","center"),this.style("align-items","center"),this.style("width","35px"),this.style("height","30px"),this.parentNode.appendChild(this.div.node())},(e=[{key:"style",value:function(t,e){return this.div.style(t,e),this}}])&&Gn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function $n(t){return $n="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},$n(t)}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,qn(r.key),r)}}function qn(t){var e=function(t){if("object"!=$n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=$n(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$n(e)?e:e+""}function Yn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Yn=function(){return!!t})()}function Vn(t){return Vn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vn(t)}function Zn(t,e){return Zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zn(t,e)}var Xn=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,n){return e=Vn(e),function(t,e){if(e&&("object"==$n(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)}(t,Yn()?Reflect.construct(e,n||[],Vn(t).constructor):e.apply(t,n))}(this,e,[t])).onZoom=t.onZoom,n.delta=t.delta||.2,n.zoomInBtn=document.createElement("a"),n.zoomInBtn.id="zoom-in",n.zoomInBtn.className="gridviz-zoom-button",n.zoomInBtn.title="Zoom in",n.zoomInBtn.textContent="+",n.zoomInBtn.addEventListener("click",function(t){n.zoomIn(t)}),n.zoomInBtn.addEventListener("mouseover",function(){n.zoomInBtn.style.backgroundColor="lightgrey"}),n.zoomInBtn.addEventListener("mouseout",function(){n.zoomInBtn.style.backgroundColor="#ffffff"}),n.zoomOutBtn=document.createElement("a"),n.zoomOutBtn.id="zoom-out",n.zoomOutBtn.className="gridviz-zoom-button",n.zoomOutBtn.title="Zoom out",n.zoomOutBtn.textContent="-",n.zoomOutBtn.addEventListener("click",function(t){n.zoomOut(t)}),n.zoomOutBtn.addEventListener("mouseover",function(){n.zoomOutBtn.style.backgroundColor="lightgrey"}),n.zoomOutBtn.addEventListener("mouseout",function(){n.zoomOutBtn.style.backgroundColor="#ffffff"}),[n.zoomInBtn,n.zoomOutBtn].forEach(function(t,e){t.style.alignItems="center",t.style.justifyContent="center",t.style.display="flex",t.style.border="none",t.style.color="black",t.style.textAlign="center",t.style.textDecoration="none",t.style.padding="4px",t.style.fontSize="24px",t.style.fontWeight="bold",t.style.userSelect="none",t.style.backgroundColor="#ffffff",0===e&&(t.style.borderBottom="1px solid grey")}),n.style("height","unset"),n.style("display","unset"),t.x?n.style("left",t.x+"px"):n.style("right","10px"),t.y?n.style("top",t.y+"px"):n.style("top","10px"),n.div.node().appendChild(n.zoomInBtn),n.div.node().appendChild(n.zoomOutBtn),n}return 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&&Zn(t,e)}(e,t),n=e,r=[{key:"zoomIn",value:function(t){this.map.setZoom(this.map.getZoom()*(1-this.delta)).redraw(),this.onZoom&&this.onZoom(t),this.map.geoCanvas.onZoomFun&&this.map.geoCanvas.onZoomFun(t)}},{key:"zoomOut",value:function(t){this.map.setZoom(this.map.getZoom()*(1+this.delta)).redraw(),this.onZoom&&this.onZoom(t),this.map.geoCanvas.onZoomFun&&this.map.geoCanvas.onZoomFun(t)}}],r&&Hn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Un);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 Kn(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,nr(r.key),r)}}function Qn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Qn=function(){return!!t})()}function tr(t){return tr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tr(t)}function er(t,e){return er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},er(t,e)}function nr(t){var e=function(t){if("object"!=Jn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Jn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Jn(e)?e:e+""}var rr=function(t){function e(t){var n,r,o,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=tr(e),function(t,e){if(e&&("object"==Jn(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)}(t,Qn()?Reflect.construct(e,n||[],tr(t).constructor):e.apply(t,n))}(this,e,[t]),r=n,i=!1,(o=nr(o="isFullscreen"))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,n.div.node().innerHTML='\n <svg\n style="height: 1.2rem; width: 1.2rem; fill:black; margin:0;"\n focusable="false"\n aria-hidden="true"\n >\n <svg fill="#000000" viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg">\n <title/>\n <g>\n <path d="M30,0H6A5.9966,5.9966,0,0,0,0,6V30a6,6,0,0,0,12,0V12H30A6,6,0,0,0,30,0Z"/>\n <path d="M90,0H66a6,6,0,0,0,0,12H84V30a6,6,0,0,0,12,0V6A5.9966,5.9966,0,0,0,90,0Z"/>\n <path d="M30,84H12V66A6,6,0,0,0,0,66V90a5.9966,5.9966,0,0,0,6,6H30a6,6,0,0,0,0-12Z"/>\n <path d="M90,60a5.9966,5.9966,0,0,0-6,6V84H66a6,6,0,0,0,0,12H90a5.9966,5.9966,0,0,0,6-6V66A5.9966,5.9966,0,0,0,90,60Z"/>\n </g>\n </svg>\n </svg>\n ',n.defaultHeight=n.map.h,n.defaultWidth=n.map.w,n.div.on("click",function(t){n.onClickFunction(t)}),n.div.on("mouseover",function(t){n.style("background-color","lightgrey")}),n.div.on("mouseout",function(t){n.style("background-color","#ffffff")}),t.x?n.style("left",t.x+"px"):n.style("right","10px"),t.y?n.style("top",t.y+"px"):n.style("top","90px"),n}return 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&&er(t,e)}(e,t),n=e,(r=[{key:"onClickFunction",value:function(t){this.isFullscreen?(this.closeFullscreen(this.map.container),this.map.h=this.defaultHeight,this.map.w=this.defaultWidth,this.map.geoCanvas.h=this.defaultHeight,this.map.geoCanvas.w=this.defaultWidth,this.map.geoCanvas.canvas.setAttribute("width",""+this.defaultWidth),this.map.geoCanvas.canvas.setAttribute("height",""+this.defaultHeight),this.map.redraw(),this.isFullscreen=!1):(this.openFullscreen(this.map.container),this.map.h=window.screen.height,this.map.w=window.screen.width,this.isFullscreen=!0)}},{key:"openFullscreen",value:function(t){t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen()}},{key:"closeFullscreen",value:function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()}}])&&Kn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Un);function or(t){return or="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},or(t)}function ir(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 ar(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ar(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 ar(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ur(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,lr(r.key),r)}}function lr(t){var e=function(t){if("object"!=or(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=or(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==or(e)?e:e+""}var cr=function(){return t=function t(e,n){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=n||{},this.layers=n.layers||[],this.container=e||document.getElementById("gridviz"),this.container?(this.container.style.position="relative",this.w=n.w||this.container.offsetWidth,this.h=n.h||this.container.offsetHeight,this._canvas=n.canvas||this.initialiseCanvas(),this.geoCanvas=new In(this._canvas,n.x,n.y,n.z,n),this.geoCanvas.redraw=function(){r.redraw()},this.geoCanvas.cancelCurrentRequests=function(){var t,e=ir(r.layers);try{for(e.s();!(t=e.n()).done;){var n,o,i,a=t.value;if(null!==(n=a.dataset)&&void 0!==n&&n.datasets){var u,l,c=ir(null===(u=a.dataset)||void 0===u?void 0:u.datasets);try{for(c.s();!(l=c.n()).done;){var s=l.value;null!=s&&s.cancelCurrentRequests&&s.cancelCurrentRequests()}}catch(t){c.e(t)}finally{c.f()}}null!==(o=a.dataset)&&void 0!==o&&o.cancelCurrentRequests&&(null===(i=a.dataset)||void 0===i||i.cancelCurrentRequests())}}catch(t){e.e(t)}finally{e.f()}},this.legend=n.legendContainer?pt(n.legendContainer):null,this.legend||this.initialiseLegend(),n.tooltip||(n.tooltip={}),n.tooltip.parentElement||(n.tooltip.parentElement=this.container),this.tooltip=new Ln(n.tooltip),this.mouseOverHandler=function(t){return r.focusCell(t)},this.mouseMoveHandler=function(t){return r.focusCell(t)},this.mouseOutHandler=function(t){return r.tooltip.hide()},this.geoCanvas.canvas.addEventListener("mouseover",this.mouseOverHandler),this.geoCanvas.canvas.addEventListener("mousemove",this.mouseMoveHandler),this.geoCanvas.canvas.addEventListener("mouseout",this.mouseOutHandler),this.defineResizeObserver(),this.geoCanvas.onZoomStartFun=function(t){n.onZoomStartFun&&n.onZoomStartFun(t),r.tooltip.hide()},this.canvasSave=null,this.selectionRectangleColor=n.selectionRectangleColor||"#FF6347",this.selectionRectangleWidthPix=n.selectionRectangleWidthPix||function(){return 4},this.transparentBackground=n.transparentBackground,this.defaultGlobalCompositeOperation=n.defaultGlobalCompositeOperation||this.geoCanvas.ctx.globalCompositeOperation):console.error("Cannot find gridviz container element.")},e=[{key:"initialiseCanvas",value:function(){var t=document.createElement("canvas");return t.setAttribute("width",""+this.w),t.setAttribute("height",""+this.h),this.container.appendChild(t),t}},{key:"initialiseLegend",value:function(){this.legend=pt(this.container).append("div").attr("id","gridviz-legend").style("position","absolute").style("width","auto").style("height","auto").style("background","#FFFFFF").style("border","0px").style("box-shadow","3px 3px 3px grey, -3px -3px 3px #ddd").style("font-family","Helvetica, Arial, sans-serif").style("bottom","15px").style("right","15px")}},{key:"layers_",value:function(t){return 0===arguments.length?this.layers:(1===arguments.length?Array.isArray(t)?this.layers=t:this.layers=[t]:this.layers=arguments,this)}},{key:"redraw",value:function(){this.legend&&this.legend.selectAll("*").remove(),this.geoCanvas.initCanvasTransform(),this.geoCanvas.clear(this.geoCanvas.backgroundColor);var t=this.geoCanvas.view.z;this.updateExtentGeo();var e,n=ir(this.layers);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.visible&&!r.visible(t)||(this.geoCanvas.offscreenCtx.globalAlpha=r.alpha?r.alpha(t):1,r.blendOperation&&(this.geoCanvas.offscreenCtx.globalCompositeOperation=r.blendOperation(t)),this.geoCanvas.setCanvasTransform(),r.draw(this.geoCanvas,this.legend),r.filterColor&&r.drawFilter(this.geoCanvas),this.geoCanvas.offscreenCtx.globalAlpha=1,this.geoCanvas.offscreenCtx.globalCompositeOperation=this.defaultGlobalCompositeOperation)}}catch(t){n.e(t)}finally{n.f()}return this.geoCanvas.initCanvasTransform(),this.geoCanvas.ctx.drawImage(this.geoCanvas.offscreenCanvas,0,0),this.canvasSave=null,this}},{key:"updateExtentGeo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return this.geoCanvas.updateExtentGeo(t)}},{key:"focusCell",value:function(t){if(!this.geoCanvas._isZooming){var e={x:this.geoCanvas.pixToGeoX(t.offsetX+this.tooltip.xMouseOffset),y:this.geoCanvas.pixToGeoY(t.offsetY+this.tooltip.yMouseOffset)},n=this.getCellFocusInfo(e);if(this.transparentBackground)if(this.geoCanvas.initCanvasTransform(),this.geoCanvas.ctx.clearRect(0,0,this.w,this.h),this.geoCanvas.ctx.drawImage(this.geoCanvas.offscreenCanvas,0,0),n){this.tooltip.html(n.html),this.tooltip.setPosition(t),this.tooltip.show();var r=this.selectionRectangleWidthPix?this.selectionRectangleWidthPix(n.resolution,this.geoCanvas.view.z):4,o=this.geoCanvas.ctx;o.save(),o.strokeStyle=this.selectionRectangleColor,o.lineWidth=r,o.beginPath();var i=this.geoCanvas.geoToPixX(n.cell.x),a=this.geoCanvas.geoToPixY(n.cell.y),u=n.resolution/this.geoCanvas.view.z,l=-u;o.rect(i-r/2,a+r/2,u+r,l-r),o.stroke(),o.restore()}else this.tooltip.hide();else if(n){var c;this.geoCanvas.canvas.style.cursor="pointer",this.tooltip.html(n.html),this.tooltip.setPosition(t),this.tooltip.show(),this.canvasSave?this.geoCanvas.offscreenCtx.drawImage(this.canvasSave,0,0):(this.canvasSave=document.createElement("canvas"),this.canvasSave.setAttribute("width",""+this.w),this.canvasSave.setAttribute("height",""+this.h),null===(c=this.canvasSave.getContext("2d"))||void 0===c||c.drawImage(this.geoCanvas.offscreenCanvas,0,0));var s=this.selectionRectangleWidthPix?this.selectionRectangleWidthPix(n.resolution,this.geoCanvas.view.z):4;this.geoCanvas.initCanvasTransform();var f=this.geoCanvas.offscreenCtx;f.strokeStyle=this.selectionRectangleColor,f.lineWidth=s,f.beginPath(),f.rect(this.geoCanvas.geoToPixX(n.cell.x)-s/2,this.geoCanvas.geoToPixY(n.cell.y)+s/2,n.resolution/this.geoCanvas.view.z+s,-n.resolution/this.geoCanvas.view.z-s),f.stroke(),this.geoCanvas.ctx.drawImage(this.geoCanvas.offscreenCanvas,0,0)}else this.geoCanvas.canvas.style.cursor="default",this.tooltip.hide(),this.canvasSave&&this.geoCanvas.ctx.drawImage(this.canvasSave,0,0)}}},{key:"getCellFocusInfo",value:function(t){for(var e=this.geoCanvas.view.z,n=this.layers.length-1;n>=0;n--){var r=this.layers[n];if((!r.visible||r.visible(e))&&"none"!==r.cellInfoHTML&&r.cellInfoHTML&&r.getDataset){var o=r.getDataset(e);if(o){var i=o.getCellFromPosition(t,o.getViewCache());if(!i)return;if(o.mixedResolution){var a=+o.mixedResolution(i),u=r.cellInfoHTML(i,a);if(!u)return;return{cell:i,html:u,resolution:a}}var l=r.cellInfoHTML(i,o.getResolution());if(!l)return;return{cell:i,html:l,resolution:o.getResolution()}}}}}},{key:"setView",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.geoCanvas.view.x=t,this.geoCanvas.view.y=e,null!=n&&(this.geoCanvas.view.z=n),this}},{key:"getView",value:function(){return this.geoCanvas.view}},{key:"getZoom",value:function(){return this.geoCanvas.view.z}},{key:"setZoom",value:function(t){return this.geoCanvas.view.z=t,this}},{key:"getCenterExtent",value:function(){return this.geoCanvas.getCenterExtent()}},{key:"setCenterExtent",value:function(t){return this.geoCanvas.setCenterExtent(t),this}},{key:"getZoomExtent",value:function(){return this.geoCanvas.getZoomExtent()}},{key:"setZoomExtent",value:function(t){return this.geoCanvas.setZoomExtent(t),this}},{key:"getBackgroundColor",value:function(){return this.geoCanvas.backgroundColor}},{key:"setBackgroundColor",value:function(t){return this.geoCanvas.backgroundColor=t,this}},{key:"addZoomButtons",value:function(t){return this.zoomButtons=new Xn({map:this,id:(null==t?void 0:t.id)||"gridviz-zoom-buttons-"+this.container.id,class:null==t?void 0:t.class,x:null==t?void 0:t.x,y:null==t?void 0:t.y,onZoom:null==t?void 0:t.onZoom,delta:(null==t?void 0:t.delta)||.2}),this}},{key:"addFullscreenButton",value:function(t){return this.fullscreenButton=new rr({map:this,id:(null==t?void 0:t.id)||"gridviz-fullscreen-button",class:null==t?void 0:t.class,x:null==t?void 0:t.x,y:null==t?void 0:t.y}),this}},{key:"setViewFromURL",value:function(){return this.geoCanvas.setViewFromURL(),this}},{key:"defineResizeObserver",value:function(){var t=this,e=!1;new ResizeObserver(function(n){if(Array.isArray(n)&&n.length){var r=t.container;r.clientWidth>0&&r.clientHeight>0&&(e||(e=!0,window.requestAnimationFrame(function(){e=!1,t.h===r.clientHeight&&t.w===r.clientWidth||(t.h=r.clientHeight,t.w=r.clientWidth,t.geoCanvas.h=t.h,t.geoCanvas.w=t.w,t.geoCanvas.canvas.setAttribute("width",String(t.w)),t.geoCanvas.canvas.setAttribute("height",String(t.h)),t.geoCanvas.offscreenCanvas.setAttribute("width",String(t.w)),t.geoCanvas.offscreenCanvas.setAttribute("height",String(t.h)),t.redraw())})))}}).observe(this.container)}},{key:"destroy",value:function(){var t,e;this.layers=[],this.bgLayers=[],this.container.removeEventListener("mouseover",this.mouseOverHandler),this.container.removeEventListener("mousemove",this.mouseMoveHandler),this.container.removeEventListener("mouseout",this.mouseOutHandler),this.geoCanvas.canvas.remove(),null===(t=this.legend)||void 0===t||t.remove(),null===(e=this.tooltip.tooltip)||void 0===e||e.remove()}}],e&&ur(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function sr(t){return sr="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},sr(t)}function fr(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,hr(r.key),r)}}function hr(t){var e=function(t){if("object"!=sr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=sr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==sr(e)?e:e+""}var yr=function(){return t=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.visible=e.visible,this.alpha=e.alpha,this.blendOperation=e.blendOperation||function(t){return"source-over"},this.filterColor=e.filterColor,this.filterBlendOperation=e.filterBlendOperation},(e=[{key:"drawFilter",value:function(t){if(this.filterColor){var e=this.filterColor(t.view.z);if(e&&"none"!=e){t.offscreenCtx.fillStyle=e;var n=void 0,r=void 0;this.filterBlendOperation&&(n=t.offscreenCtx.globalCompositeOperation,r=this.filterBlendOperation(t.view.z)),r&&"none"!=r&&(t.offscreenCtx.globalCompositeOperation=r),t.offscreenCtx.fillRect(0,0,t.w,t.h),n&&(t.offscreenCtx.globalCompositeOperation=n)}}}}])&&fr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function pr(t){return pr="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},pr(t)}function vr(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 dr(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dr(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 dr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function br(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,mr(r.key),r)}}function mr(t){var e=function(t){if("object"!=pr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=pr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pr(e)?e:e+""}function gr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(gr=function(){return!!t})()}function wr(t){return wr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wr(t)}function xr(t,e){return xr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xr(t,e)}var Sr=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=wr(e),function(t,e){if(e&&("object"==pr(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)}(t,gr()?Reflect.construct(e,n||[],wr(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.viewScale=t.viewScale,n.filter=t.filter||void 0,n.offset=t.offset||function(t,e,n){return{dx:0,dy:0}},n.drawFun=t.drawFun,n.legends=[],n}return 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&&xr(t,e)}(e,t),n=e,o=[{key:"updateLegendsRecursive",value:function(t,e){if(Array.isArray(t)){var n,r=vr(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;this.updateLegendsRecursive(o,e)}}catch(t){r.e(t)}finally{r.f()}}else t.update(e)}}],(r=[{key:"draw",value:function(t,e,n){if(!this.drawFun)throw new Error("Method draw not implemented.");this.drawFun(t,e,n)}},{key:"getOffset",value:function(){return this.offset}},{key:"setOffset",value:function(t){return this.offset=t,this}},{key:"updateLegends",value:function(t){return e.updateLegendsRecursive(this.legends,t),this}},{key:"addLegends",value:function(t){var e,n=vr(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.legends.push(r)}}catch(t){n.e(t)}finally{n.f()}return this}}])&&br(n.prototype,r),o&&br(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(yr);function Or(t){return Or="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},Or(t)}function _r(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,jr(r.key),r)}}function jr(t){var e=function(t){if("object"!=Or(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Or(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Or(e)?e:e+""}function Pr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Pr=function(){return!!t})()}function kr(t){return kr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kr(t)}function Tr(t,e){return Tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tr(t,e)}var Cr=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=kr(e),function(t,e){if(e&&("object"==Or(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)}(t,Pr()?Reflect.construct(e,n||[],kr(t).constructor):e.apply(t,n))}(this,e,arguments)}return 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&&Tr(t,e)}(e,t),n=e,(r=[{key:"draw",value:function(t){throw new Error("Method draw not implemented.")}}])&&_r(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(yr);function Er(t){return Er="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},Er(t)}function Ar(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={}.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}}}}function Mr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}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,Rr(r.key),r)}}function Rr(t){var e=function(t){if("object"!=Er(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Er(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Er(e)?e:e+""}var Ir=function(){return t=function t(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.map=e,this.url=n,this.resolution=r,this.mixedResolution=o.mixedResolution,this.preprocess=o.preprocess||void 0,this.cellsViewCache=[]},(e=[{key:"getData",value:function(){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){if(this.mixedResolution){var n,r=Ar(e);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=+this.mixedResolution(o);if(!(t.x<o.x||o.x+i<t.x||t.y<o.y||o.y+i<t.y))return o}}catch(t){r.e(t)}finally{r.f()}}else{var a,u=this.getResolution(),l=Ar(e);try{for(l.s();!(a=l.n()).done;){var c=a.value;if(!(t.x<c.x||c.x+u<t.x||t.y<c.y||c.y+u<t.y))return c}}catch(t){l.e(t)}finally{l.f()}}}},{key:"getResolution",value:function(){return this.resolution}},{key:"getViewCache",value:function(){return this.cellsViewCache}},{key:"getDataset",value:function(t,e){return this}}])&&zr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Fr(t){return Fr="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},Fr(t)}function Br(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Nr(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,Lr(r.key),r)}}function Lr(t){var e=function(t){if("object"!=Fr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fr(e)?e:e+""}var Dr=function(){return t=function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=r||{},this.resolutions=e,this.datasets="function"==typeof n?this.resolutions.map(n):n,this.datasets.length>1&&this.datasets.length!=this.resolutions.length)throw new Error("Uncompatible number of datasets and resolutions: "+this.datasets.length+" "+this.resolutions.length);r.preprocess&&this.setPrepocesses(r.preprocess)},(e=[{key:"getDataset",value:function(t,e){if(1==this.datasets.length)return this.datasets[0];for(var n=this.resolutions,r=0,o=n[r]/e;o<t&&r<n.length;)o=n[++r]/e;return r==n.length?this.datasets[n.length-1]:this.datasets[r]}},{key:"setPrepocesses",value:function(t){var e,n=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 Br(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?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}}}}(this.datasets);try{for(n.s();!(e=n.n()).done;)e.value.preprocess=t}catch(t){n.e(t)}finally{n.f()}return this}}])&&Nr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Gr(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function Wr(t,e){return fetch(t,e).then(Gr)}var Ur={},$r={};function Hr(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function qr(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 Yr(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function Vr(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 s(){if(l)return $r;if(c)return c=!1,Ur;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=s())!==$r;){for(var f=[];r!==Ur&&r!==$r;)f.push(r),r=s();e&&null==(f=e(f,u++))||o.push(f)}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?"-"+Yr(-r,6):r>9999?"+"+Yr(r,6):Yr(r,4))+"-"+Yr(n.getUTCMonth()+1,2)+"-"+Yr(n.getUTCDate(),2)+(u?"T"+Yr(o,2)+":"+Yr(i,2)+":"+Yr(a,2)+"."+Yr(u,3)+"Z":a?"T"+Yr(o,2)+":"+Yr(i,2)+":"+Yr(a,2)+"Z":i||o?"T"+Yr(o,2)+":"+Yr(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=Hr(t);return function(r,o){return e(n(r),o,t)}}(t,e):Hr(t)});return i.columns=o||[],i},parseRows:r,format:function(e,n){return null==n&&(n=qr(e)),[n.map(a).join(t)].concat(o(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=qr(t)),o(t,e).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}}var Zr=Vr(","),Xr=Zr.parse,Jr=(Zr.parseRows,Zr.format,Zr.formatBody,Zr.formatRows,Zr.formatRow,Zr.formatValue,Vr("\t")),Kr=Jr.parse;function Qr(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function to(t,e){return fetch(t,e).then(Qr)}function eo(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=void 0),to(e,n).then(function(e){return t(e,r)})}}function no(t,e,n,r){3===arguments.length&&"function"==typeof n&&(r=n,n=void 0);var o=Vr(t);return to(e,n).then(function(t){return o.parse(t,r)})}Jr.parseRows,Jr.format,Jr.formatBody,Jr.formatRows,Jr.formatRow,Jr.formatValue;var ro=eo(Xr);function oo(t){return oo="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},oo(t)}function io(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 ao(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ao(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 ao(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function uo(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(oo(t)+" is not iterable")}function lo(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof u?r:u,c=Object.create(l.prototype);return co(c,"_invoke",function(n,r,o){var i,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(e,n){return i=e,u=0,l=t,h.n=n,a}};function y(n,r){for(u=n,l=r,e=0;!f&&c&&!o&&e<s.length;e++){var o,i=s[e],y=h.p,p=i[2];n>3?(o=p===r)&&(l=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=n<2&&y<i[1])?(u=0,h.v=r,h.n=i[1]):y<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,u=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&y(s,p),u=s,l=p;(e=u<2?t:l)||!f;){i||(u?u<3?(u>1&&(h.n=-1),y(u,l)):h.n=l:h.v=l);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=h.n<0)?l:n.call(r,h))!==a)break}catch(e){i=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),c}var a={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(co(e={},r,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,co(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,co(f,"constructor",c),co(c,"constructor",l),l.displayName="GeneratorFunction",co(c,o,"GeneratorFunction"),co(f),co(f,o,"Generator"),co(f,r,function(){return this}),co(f,"toString",function(){return"[object Generator]"}),(lo=function(){return{w:i,m:h}})()}function co(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}co=function(t,e,n,r){function i(e,n){co(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},co(t,e,n,r)}function so(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function fo(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){so(i,r,o,a,u,"next",t)}function u(t){so(i,r,o,a,u,"throw",t)}a(void 0)})}}function ho(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,yo(r.key),r)}}function yo(t){var e=function(t){if("object"!=oo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=oo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==oo(e)?e:e+""}function po(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(po=function(){return!!t})()}function vo(t){return vo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vo(t)}function bo(t,e){return bo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bo(t,e)}eo(Kr);var mo=function(t){function e(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=vo(e),function(t,e){if(e&&("object"==oo(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)}(t,po()?Reflect.construct(e,n||[],vo(t).constructor):e.apply(t,n))}(this,e,[t,n,0,o])).onlyDrawWhenAllTilesReady=o.onlyDrawWhenAllTilesReady||!1,r.info=void 0,r.infoLoadingStatus="notLoaded",r.cache={},r.loadInfo(),r}return 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&&bo(t,e)}(e,t),n=e,r=[{key:"loadInfo",value:function(){var t=this;return this.info||"notLoaded"!==this.infoLoadingStatus?"loaded"!==this.infoLoadingStatus&&"failed"!==this.infoLoadingStatus||this.map.redraw():fo(lo().m(function e(){var n;return lo().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Wr(t.url+"info.json");case 1:n=e.v,t.info=n,t.resolution=n.resolutionGeo,t.infoLoadingStatus="loaded",t.map.redraw(),e.n=3;break;case 2:e.p=2,e.v,t.infoLoadingStatus="failed";case 3:return e.a(2)}},e,null,[[0,2]])}))(),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()}},{key:"getData",value:(i=fo(lo().m(function t(e){var n,r,o,i,a,u,l,c,s,f,h,y,p,v,d,b,m=this;return lo().w(function(t){for(;;)switch(t.n){case 0:if(this.info){t.n=1;break}return t.a(2,this);case 1:if(this.abortController=new AbortController,n=this.abortController.signal,r=this.getTilingEnvelope(e)){t.n=2;break}return t.a(2,this);case 2:o=this.info.tilingBounds,i=o.xMin,a=o.xMax,u=o.yMin,l=o.yMax,c=Math.max(r.xMin,i),s=Math.min(r.xMax,a),f=Math.max(r.yMin,u),h=Math.min(r.yMax,l),y=(s-c+1)*(h-f+1),p=0,v=[],d=lo().m(function t(e){var r,o;return lo().w(function(t){for(;;)switch(t.n){case 0:r=lo().m(function t(r){return lo().w(function(t){for(;;)switch(t.n){case 0:if(m.cache[e]||(m.cache[e]={}),!m.cache[e][r]||"failed"===m.cache[e][r]){t.n=1;break}return++p,t.a(2,1);case 1:m.cache[e][r]="loading",v.push(m.loadTile(e,r,n).then(function(t){m.cache[e][r]=t;var n=++p===y;m.checkAndRedraw(t,n)}).catch(function(){m.cache[e][r]="failed",++p}));case 2:return t.a(2)}},t)}),o=f;case 1:if(!(o<=h)){t.n=4;break}return t.d(uo(r(o)),2);case 2:if(!t.v){t.n=3;break}return t.a(3,3);case 3:o++,t.n=1;break;case 4:return t.a(2)}},t)}),b=c;case 3:if(!(b<=s)){t.n=5;break}return t.d(uo(d(b)),4);case 4:b++,t.n=3;break;case 5:return t.n=6,Promise.allSettled(v);case 6:return t.a(2,this)}},t,this)})),function(t){return i.apply(this,arguments)})},{key:"loadTile",value:(o=fo(lo().m(function t(e,n,r){var o,i,a,u=this;return lo().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,ro("".concat(this.url).concat(e,"/").concat(n,".csv"),{signal:r});case 1:if(o=t.v,i=this.preprocess?o.filter(function(t){return!1!==u.preprocess(t)}):o,this.info){t.n=2;break}throw new Error("Tile info unknown");case 2:return t.a(2,go(i,e,n,this.info));case 3:throw t.p=3,"AbortError"===(a=t.v).name&&console.warn("Tile request for ".concat(e,", ").concat(n," was aborted.")),a;case 4:return t.a(2)}},t,this,[[0,3]])})),function(t,e,n){return o.apply(this,arguments)})},{key:"cancelCurrentRequests",value:function(){this.abortController&&this.abortController.abort()}},{key:"checkAndRedraw",value:function(t,e){var n,r=!1,o=this.map.getZoom(),i=io(this.map.layers);try{for(i.s();!(n=i.n()).done;){var a=n.value;if((!a.visible||a.visible(o))&&a.getDataset&&a.getDataset(o)==this){r=!0;break}}}catch(t){i.e(t)}finally{i.f()}if(r){var u=this.map.updateExtentGeo(),l=t.extGeo,c=l.xMin,s=l.xMax,f=l.yMin,h=l.yMax;u.xMax<=c||u.xMin>=s||u.yMax<=f||u.yMin>=h||(this.onlyDrawWhenAllTilesReady?e&&this.map.redraw():this.map.redraw())}}},{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=io(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()}}}}}}],r&&ho(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o,i}(Ir);function go(t,e,n,r){var o={};o.cells=t,o.x=e,o.y=n;var i=r.resolutionGeo,a=r.tileSizeCell;o.extGeo={xMin:r.originPoint.x+i*a*o.x,xMax:r.originPoint.x+i*a*(o.x+1),yMin:r.originPoint.y+i*a*o.y,yMax:r.originPoint.y+i*a*(o.y+1)};var u,l=io(o.cells);try{for(l.s();!(u=l.n()).done;){var c=u.value;c.x=o.extGeo.xMin+c.x*i,c.y=o.extGeo.yMin+c.y*i}}catch(t){l.e(t)}finally{l.f()}return o}function wo(t){return wo="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},wo(t)}function xo(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof u?r:u,c=Object.create(l.prototype);return So(c,"_invoke",function(n,r,o){var i,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(e,n){return i=e,u=0,l=t,h.n=n,a}};function y(n,r){for(u=n,l=r,e=0;!f&&c&&!o&&e<s.length;e++){var o,i=s[e],y=h.p,p=i[2];n>3?(o=p===r)&&(l=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=n<2&&y<i[1])?(u=0,h.v=r,h.n=i[1]):y<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,u=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&y(s,p),u=s,l=p;(e=u<2?t:l)||!f;){i||(u?u<3?(u>1&&(h.n=-1),y(u,l)):h.n=l:h.v=l);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=h.n<0)?l:n.call(r,h))!==a)break}catch(e){i=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),c}var a={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(So(e={},r,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,So(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,So(f,"constructor",c),So(c,"constructor",l),l.displayName="GeneratorFunction",So(c,o,"GeneratorFunction"),So(f),So(f,o,"Generator"),So(f,r,function(){return this}),So(f,"toString",function(){return"[object Generator]"}),(xo=function(){return{w:i,m:h}})()}function So(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}So=function(t,e,n,r){function i(e,n){So(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},So(t,e,n,r)}function Oo(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 _o(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_o(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 _o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function jo(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}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,ko(r.key),r)}}function ko(t){var e=function(t){if("object"!=wo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wo(e)?e:e+""}function To(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(To=function(){return!!t})()}function Co(t){return Co=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Co(t)}function Eo(t,e){return Eo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Eo(t,e)}var Ao=function(t){function e(t,n,r){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(o=function(t,e,n){return e=Co(e),function(t,e){if(e&&("object"==wo(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)}(t,To()?Reflect.construct(e,n||[],Co(t).constructor):e.apply(t,n))}(this,e,[t,n,r,i])).cells=[],o.delimiter=i.delimiter||",",o.infoLoadingStatus="notLoaded",o.getData(void 0),o}return 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&&Eo(t,e)}(e,t),n=e,r=[{key:"getData",value:function(t){var e,n=this;return"notLoaded"!=this.infoLoadingStatus||(this.infoLoadingStatus="loading",(e=xo().m(function t(){var e,r,o,i,a,u,l,c;return xo().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,no(n.delimiter,n.url);case 1:e=t.v,r=Oo(e);try{for(r.s();!(o=r.n()).done;)(i=o.value).x=+i.x,i.y=+i.y}catch(t){r.e(t)}finally{r.f()}if(!n.preprocess){t.n=10;break}n.cells=[],a=Oo(e),t.p=2,a.s();case 3:if((u=a.n()).done){t.n=6;break}if(l=u.value,0!=n.preprocess(l)){t.n=4;break}return t.a(3,5);case 4:n.cells.push(l);case 5:t.n=3;break;case 6:t.n=8;break;case 7:t.p=7,c=t.v,a.e(c);case 8:return t.p=8,a.f(),t.f(8);case 9:t.n=11;break;case 10:n.cells=e;case 11:n.map&&n.map.redraw(),n.infoLoadingStatus="loaded",t.n=13;break;case 12:t.p=12,t.v,n.infoLoadingStatus="failed",n.cells=[];case 13:return t.a(2)}},t,null,[[2,7,8,9],[0,12]])}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(t){jo(i,r,o,a,u,"next",t)}function u(t){jo(i,r,o,a,u,"throw",t)}a(void 0)})})()),this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,n=Oo(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()}}}}],r&&Po(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ir);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 zo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}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,Io(r.key),r)}}function Io(t){var e=function(t){if("object"!=Mo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Mo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Mo(e)?e:e+""}function Fo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Fo=function(){return!!t})()}function Bo(t){return Bo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bo(t)}function No(t,e){return No=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},No(t,e)}var Lo=function(t){function e(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Bo(e),function(t,e){if(e&&("object"==Mo(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)}(t,Fo()?Reflect.construct(e,n||[],Bo(t).constructor):e.apply(t,n))}(this,e,[void 0,"",t,o])).cells=n||[],r}return 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&&No(t,e)}(e,t),n=e,(r=[{key:"getData",value:function(t){return this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,n=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 zo(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zo(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(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()}}}}])&&Ro(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ir);function Do(t){return Do="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},Do(t)}function Go(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=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,Uo(r.key),r)}}function Uo(t){var e=function(t){if("object"!=Do(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Do(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Do(e)?e:e+""}function $o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return($o=function(){return!!t})()}function Ho(t){return Ho=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ho(t)}function qo(t,e){return qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qo(t,e)}var Yo=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Ho(e),function(t,e){if(e&&("object"==Do(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)}(t,$o()?Reflect.construct(e,n||[],Ho(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.color=t.color||"#EA6BAC",n.size=t.size||function(t,e){return e},n.shape=t.shape||"square",n}return 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)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r,o=e.view.z,i=this.viewScale?this.viewScale(t,n,o):void 0,a=.5*n,u="function"==typeof this.color,l="function"==typeof this.size,c="function"==typeof this.shape,s=this.color||"black",f=this.size||n,h=this.shape||"square",y=u?this.color:null,p=l?this.size:null,v=c?this.shape:null,d=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 Go(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?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}}}}(t);try{for(d.s();!(r=d.n()).done;){var b=r.value,m=y?y(b,n,o,i):s;if(m&&"none"!==m){var g=p?p(b,n,o,i):f;if(g){var w=v?v(b,n,o,i):h;if("none"!==w){var x=this.offset(b,n,o),S=e.offscreenCtx;if(S.fillStyle=m,"square"===w){var O=n*(1-g/n)*.5;S.fillRect(b.x+O+x.dx,b.y+O+x.dy,g,g)}else if("circle"===w)S.beginPath(),S.arc(b.x+a+x.dx,b.y+a+x.dy,.5*g,0,2*Math.PI,!1),S.fill();else if("donut"===w){var _=b.x+a+x.dx,j=b.y+a+x.dy;S.beginPath(),S.moveTo(_,j),S.arc(_,j,a,0,2*Math.PI),S.arc(_,j,(1-g/n)*a,0,2*Math.PI,!0),S.closePath(),S.fill()}else if("diamond"===w){var P=.5*g;S.beginPath(),S.moveTo(b.x+a-P,b.y+a),S.lineTo(b.x+a,b.y+a+P),S.lineTo(b.x+a+P,b.y+a),S.lineTo(b.x+a,b.y+a-P),S.fill()}else if("triangle_up"===w){var k=(g-n)/2;S.beginPath(),S.moveTo(b.x-k,b.y-k),S.lineTo(b.x+a,b.y+n+k),S.lineTo(b.x+n+k,b.y-k),S.fill()}else if("triangle_down"===w){var T=(g-n)/2;S.beginPath(),S.moveTo(b.x-T,b.y+n+T),S.lineTo(b.x+a,b.y-T),S.lineTo(b.x+n+T,b.y+n+T),S.fill()}else if("triangle_left"===w){var C=(g-n)/2;S.beginPath(),S.moveTo(b.x+n+C,b.y+n+C),S.lineTo(b.x-C,b.y+a),S.lineTo(b.x+n+C,b.y-C),S.fill()}else{if("triangle_right"!==w)throw new Error("Unexpected shape:"+w);var E=(g-n)/2;S.beginPath(),S.moveTo(b.x-E,b.y-E),S.lineTo(b.x+n+E,b.y+a),S.lineTo(b.x-E,b.y+n+E),S.fill()}}}}}}catch(t){d.e(t)}finally{d.f()}this.updateLegends({viewScale:i,resolution:n,z:o,cells:t})}}],r&&Wo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function Vo(t){return Vo="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},Vo(t)}function Zo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Xo(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,Jo(r.key),r)}}function Jo(t){var e=function(t){if("object"!=Vo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vo(e)?e:e+""}function Ko(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ko=function(){return!!t})()}function Qo(t){return Qo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qo(t)}function ti(t,e){return ti=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ti(t,e)}var ei=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Qo(e),function(t,e){if(e&&("object"==Vo(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)}(t,Ko()?Reflect.construct(e,n||[],Qo(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.strokeColor=t.strokeColor||function(){return"#666"},n.size=t.size||function(t,e){return e},n.strokeWidth=t.strokeWidth||function(t,e,n){return 1.5*n},n.shape=t.shape||function(){return"square"},n}return 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&&ti(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r,o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,n,o):void 0,u=.5*n,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 Zo(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zo(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();!(r=l.n()).done;){var c=r.value,s=this.strokeColor?this.strokeColor(c,n,o,a):void 0;if(s&&"none"!==s){i.strokeStyle=s;var f=this.size?this.size(c,n,o,a):n,h=this.strokeWidth?this.strokeWidth(c,n,o,a):1*o;if(h&&!(h<=0)){i.lineWidth=h;var y=this.shape?this.shape(c,n,o,a):"square";if("none"!==y){var p=this.offset(c,n,o);if("square"===y){var v=n*(1-f/n)*.5;i.beginPath(),i.rect(c.x+v+p.dx,c.y+v+p.dy,f,f),i.stroke()}else if("circle"===y)i.beginPath(),i.arc(c.x+u+p.dx,c.y+u+p.dy,.5*f,0,2*Math.PI,!1),i.stroke();else if("diamond"===y){var d=.5*f;i.beginPath(),i.moveTo(c.x+u-d,c.y+u),i.lineTo(c.x+u,c.y+u+d),i.lineTo(c.x+u+d,c.y+u),i.lineTo(c.x+u,c.y+u-d),i.lineTo(c.x+u-d,c.y+u),i.stroke()}else if("donut"===y)console.error("Not implemented");else if("triangle_up"===y){var b=(f-n)/2;i.beginPath(),i.moveTo(c.x-b,c.y-b),i.lineTo(c.x+u,c.y+n+b),i.lineTo(c.x+n+b,c.y-b),i.closePath(),i.stroke()}else if("triangle_down"===y){var m=(f-n)/2;i.beginPath(),i.moveTo(c.x-m,c.y+n+m),i.lineTo(c.x+u,c.y-m),i.lineTo(c.x+n+m,c.y+n+m),i.closePath(),i.stroke()}else if("triangle_left"===y){var g=(f-n)/2;i.beginPath(),i.moveTo(c.x+n+g,c.y+n+g),i.lineTo(c.x-g,c.y+u),i.lineTo(c.x+n+g,c.y-g),i.closePath(),i.stroke()}else{if("triangle_right"!==y)throw new Error("Unexpected shape:"+y);var w=(f-n)/2;i.beginPath(),i.moveTo(c.x-w,c.y-w),i.lineTo(c.x+n+w,c.y+u),i.lineTo(c.x-w,c.y+n+w),i.closePath(),i.stroke()}}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,resolution:n,z:o,viewScale:a})}}],r&&Xo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function ni(t){return ni="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},ni(t)}function ri(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function oi(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,ii(r.key),r)}}function ii(t){var e=function(t){if("object"!=ni(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ni(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ni(e)?e:e+""}function ai(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ai=function(){return!!t})()}function ui(t){return ui=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ui(t)}function li(t,e){return li=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},li(t,e)}var ci=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=ui(e),function(t,e){if(e&&("object"==ni(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)}(t,ai()?Reflect.construct(e,n||[],ui(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.height=t.height||function(t,e){return e*Math.random()},n.lineColor=t.lineColor||function(t,e,n,r){return"#BBB"},n.lineWidth=t.lineWidth||function(t,e,n,r){return r},n.fillColor=t.fillColor||function(t,e,n,r){return"#c08c5968"},n}return 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)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r,o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,n,o):void 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 ri(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ri(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();!(r=l.n()).done;){var c=r.value,s=u[c.y];s||(s={},u[c.y]=s),s[c.x]=this.height(c,n,o,a)}}catch(t){l.e(t)}finally{l.f()}var f=e.extGeo;if(f){var h=Math.floor(f.xMin/n)*n,y=Math.floor(f.xMax/n)*n,p=Math.floor(f.yMin/n)*n,v=Math.floor(f.yMax/n)*n,d={min:p,max:v};i.lineJoin="round";for(var b=v;b>=p;b-=n){var m=u[b];if(m){i.beginPath(),i.moveTo(h-n/2,b);for(var g=void 0,w=h;w<=y;w+=n){var x=m[w];x||(x=0),x||g?i.lineTo(w+n/2,b+x):i.moveTo(w+n/2,b),g=x}g&&i.lineTo(y+n/2,b);var S=this.fillColor(b,d,n,o);S&&"none"!=S&&(i.fillStyle=S,i.fill());var O=this.lineColor(b,d,n,o),_=this.lineWidth(b,d,n,o);O&&"none"!=O&&_>0&&(i.strokeStyle=O,i.lineWidth=_,i.stroke())}}}}}],r&&oi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function si(t){return si="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},si(t)}function fi(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)||hi(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 hi(t,e){if(t){if("string"==typeof t)return yi(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yi(t,e):void 0}}function yi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function pi(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,vi(r.key),r)}}function vi(t){var e=function(t){if("object"!=si(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=si(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==si(e)?e:e+""}function di(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(di=function(){return!!t})()}function bi(t){return bi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bi(t)}function mi(t,e){return mi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mi(t,e)}var gi=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=bi(e),function(t,e){if(e&&("object"==si(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)}(t,di()?Reflect.construct(e,n||[],bi(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.color=t.color,n.type=t.type||function(){return"flag"},n.size=t.size||function(t,e){return e},n.stripesOrientation=t.stripesOrientation||function(){return 0},n.offsetAngle=t.offsetAngle||function(){return 0},n.agePyramidHeight=t.agePyramidHeight||function(t,e){return e},n.pieChartInternalRadiusFactor=t.pieChartInternalRadiusFactor||0,n}return 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&&mi(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r,o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,n,o):void 0,u=Object.entries(this.color).length,l=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=hi(t))){e&&(t=e);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==e.return||e.return()}finally{if(a)throw o}}}}(t);try{for(l.s();!(r=l.n()).done;){var c=r.value,s=this.size?this.size(c,n,o,a):n;if(s){var f=this.offset(c,n,o),h=this.type?this.type(c,n,o,a):"flag",y=c.x+f.dx+("agepyramid"===h?0:.5*n),p=c.y+f.dy+("agepyramid"===h?0:.5*n),v=this.offsetAngle?this.offsetAngle(c,n,o,a)*Math.PI/180:0;if("agepyramid"===h||"radar"===h||"halftone"===h){for(var d=-1/0,b=0,m=Object.keys(this.color);b<m.length;b++){var g=+c[m[b]];g>d&&(d=g)}var w=0;"agepyramid"===h&&this.agePyramidHeight&&(w=(n-this.agePyramidHeight(c,n,o,a))/2),"radar"!==h&&"halftone"!==h||(w=Math.PI/2+v);var x="agepyramid"===h?(this.agePyramidHeight?this.agePyramidHeight(c,n,o,a):n)/u:"radar"===h||"halftone"===h?2*Math.PI/u:void 0;if(void 0===x)throw new Error("Unexpected symbol type:"+h);for(var S=0,O=Object.entries(this.color);S<O.length;S++){var _=fi(O[S],2),j=_[0],P=_[1];if("agepyramid"===h){i.fillStyle=P;var k=s*c[j]/d;i.fillRect(y+(n-k)/2,p+w,k,x),w+=x}else if("radar"===h){i.fillStyle=P;var T=c[j],C=s/2*Math.sqrt(T/d);i.beginPath(),i.moveTo(y,p),i.arc(y,p,C,w-x,w),i.lineTo(y,p),i.fill(),w+=x}else{if("halftone"!==h)throw new Error("Unexpected symbol type:"+h);i.fillStyle=P;var E=c[j],A=.333*s*Math.sqrt(E/d);i.beginPath(),i.arc(y+.25*n*Math.cos(w),p+.25*n*Math.sin(w),A,0,2*Math.PI),i.fill(),w+=x}}}else{for(var M=0,z=0,R=Object.keys(this.color);z<R.length;z++){var I=+c[R[z]];I&&(M+=I)}if(!M||isNaN(M))continue;for(var F=0,B=n*(1-s/n)*.5,N=this.stripesOrientation(c,n,o,a),L=0,D=Object.entries(this.color);L<D.length;L++){var G=fi(D[L],2),W=G[0],U=G[1],$=c[W]/M;if($&&!isNaN($)){if(i.fillStyle=U,"flag"===h)0==N?i.fillRect(c.x+B+f.dx,c.y+B+F*s+f.dy,s,$*s):i.fillRect(c.x+B+F*s+f.dx,c.y+B+f.dy,$*s,s);else if("piechart"===h){var H=2*F*Math.PI,q=2*(F+$)*Math.PI;i.beginPath(),i.moveTo(y,p),i.arc(y,p,.5*s,H+v,q+v),this.pieChartInternalRadiusFactor&&i.arc(y,p,.5*s*this.pieChartInternalRadiusFactor,H+v,q+v,!0),i.closePath(),i.fill()}else if("ring"===h)i.beginPath(),i.arc(y,p,Math.sqrt(1-F)*s*.5,0,2*Math.PI),i.fill();else{if("segment"!==h)throw new Error("Unexpected symbol type:"+h);var Y=s*s/n;0==N?i.fillRect(c.x+f.dx,c.y+(n-Y)/2+F*Y+f.dy,n,$*Y):i.fillRect(c.x+F*n+f.dx,c.y+(n-Y)/2+f.dy,$*n,Y)}F+=$}}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,resolution:n,z:o,viewScale:a})}}],r&&pi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function wi(t){return wi="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},wi(t)}function xi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Si(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,Oi(r.key),r)}}function Oi(t){var e=function(t){if("object"!=wi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wi(e)?e:e+""}function _i(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_i=function(){return!!t})()}function ji(t){return ji=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ji(t)}function Pi(t,e){return Pi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pi(t,e)}var ki=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=ji(e),function(t,e){if(e&&("object"==wi(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)}(t,_i()?Reflect.construct(e,n||[],ji(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.color=t.color||function(){return"#EA6BAC"},n.width=t.width||function(t,e){return.1*e},n.length=t.length||function(t,e){return.9*e},n.orientation=t.orientation||function(){return 180*Math.random()},n}return 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&&Pi(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r=e.view.z,o=e.offscreenCtx,i=this.viewScale?this.viewScale(t,n,r):void 0;o.lineCap="butt";var a,u=Math.PI/180,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 xi(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xi(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();!(a=l.n()).done;){var c=a.value,s=this.color?this.color(c,n,r,i):void 0;if(s){var f=this.width?this.width(c,n,r,i):void 0;if(f&&!(f<0)){var h=this.length?this.length(c,n,r,i):void 0;if(h&&!(h<0)){var y=this.orientation(c,n,r,i)*u;if(void 0!==y&&!isNaN(y)){var p=this.offset(c,n,r);o.strokeStyle=s,o.lineWidth=f;var v=c.x+n/2+p.dx,d=c.y+n/2+p.dy,b=.5*Math.cos(y)*h,m=.5*Math.sin(y)*h;o.beginPath(),o.moveTo(v-b,d-m),o.lineTo(v+b,d+m),o.stroke()}}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({viewScale:i,resolution:n,z:r,cells:t})}}],r&&Si(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function Ti(t){return Ti="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},Ti(t)}function Ci(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ei(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,Ai(r.key),r)}}function Ai(t){var e=function(t){if("object"!=Ti(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ti(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ti(e)?e:e+""}function Mi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Mi=function(){return!!t})()}function zi(t){return zi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zi(t)}function Ri(t,e){return Ri=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ri(t,e)}var Ii=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=zi(e),function(t,e){if(e&&("object"==Ti(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)}(t,Mi()?Reflect.construct(e,n||[],zi(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.text=t.text||function(){return"X"},n.color=t.color||function(){return"black"},n.fontSize=t.fontSize||function(t,e){return e},n.fontFamily=t.fontFamily||function(){return"Arial"},n.fontWeight=t.fontWeight||function(){return"bold"},n}return 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&&Ri(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r=e.view.z,o=e.offscreenCtx,i=this.viewScale?this.viewScale(t,n,r):void 0;e.initCanvasTransform();var a,u=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 Ci(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?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}}}}(t);try{for(u.s();!(a=u.n()).done;){var l=a.value,c=this.text?this.text(l,n,r,i):void 0;if(null!=c&&null!=c&&c+""!=""){var s=this.color?this.color(l,n,r,i):void 0;if(s){o.fillStyle=s;var f=this.fontSize(l,n,r,i)/r;if(f){var h=this.fontFamily?this.fontFamily(l,n,r,i):"Arial",y=this.fontWeight?this.fontWeight(l,n,r,i):"bold";o.font=y+" "+f+"px "+h;var p=this.offset(l,n,r);o.textAlign="center";var v=e.geoToPixX(l.x+.5*n+p.dx),d=e.geoToPixY(l.y+.5*n+p.dy)+.3*f;o.fillText(c,v,d)}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,resolution:n,z:r,viewScale:i})}}],o=[{key:"textScale",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=t.length;return function(r){return e&&(r=e(r)),0==r?"":r>=1?t[n-1]:t[Math.floor(r*n)]}}}],r&&Ei(n.prototype,r),o&&Ei(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Sr);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 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 Ni(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ni(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 Ni(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Li(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,Di(r.key),r)}}function Di(t){var e=function(t){if("object"!=Fi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fi(e)?e:e+""}function Gi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Gi=function(){return!!t})()}function Wi(t){return Wi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wi(t)}function Ui(t,e){return Ui=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ui(t,e)}var $i=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Wi(e),function(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)}(t,Gi()?Reflect.construct(e,n||[],Wi(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.height=t.height,n.color=t.color||function(){return"#c08c59"},n.width=t.width||function(t,e){return.5*e},n.simple=t.simple||function(){return!1},n.viewHeightFactor=t.viewHeightFactor||1.5,n.viewSX=null==t.viewSX?0:t.viewSX,n.viewSY=null==t.viewSY?-.5:t.viewSY,n.shadowDirection=null==t.shadowDirection?-40.3*Math.PI/180:t.shadowDirection,n.shadowFactor=t.shadowFactor||.3,n.shadowColor=t.shadowColor||"#00000033",n.outlineCol=t.outlineCol||"#FFFFFF",n.outlineWidthPix=null==t.outlineWidthPix?.5:t.outlineWidthPix,n}return 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)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r=e.view.z,o=e.offscreenCtx,i=this.viewScale?this.viewScale(t,n,r):void 0,a=e.view.x+this.viewSX*e.w*r,u=e.view.y+this.viewSY*e.h*r,l=this.viewHeightFactor*(e.w+e.h)*.5*r;t.sort(function(t,e){return 1e8*(e.y-t.y)+t.x-e.x});var c=this.simple(n,r,i);o.lineCap=c?"butt":"round",o.strokeStyle=this.shadowColor,o.fillStyle=this.shadowColor;var s,f=Bi(t);try{for(f.s();!(s=f.n()).done;){var h=s.value,y=this.width?this.width(h,n,r,i):void 0;if(y&&!(y<0)){var p=this.height?this.height(h,n,r,i):void 0;if(p&&!(p<0)){o.lineWidth=y;var v=h.x+n/2,d=h.y+n/2,b=p*this.shadowFactor;o.beginPath(),o.moveTo(v,d),o.lineTo(v+b*Math.cos(this.shadowDirection),d+b*Math.sin(this.shadowDirection)),o.stroke()}}}}catch(t){f.e(t)}finally{f.f()}var m,g=Bi(t);try{for(g.s();!(m=g.n()).done;){var w=m.value,x=this.color?this.color(w,n,r,i):void 0;if(x){var S=this.width?this.width(w,n,r,i):void 0;if(S&&!(S<0)){var O=this.height?this.height(w,n,r,i):void 0;if(O&&!(O<0)){var _=w.x+n/2,j=w.y+n/2,P=_-a,k=j-u,T=Math.atan2(k,P),C=Math.sqrt(P*P+k*k)*O/(l-O);c?(o.strokeStyle=x,o.lineWidth=S,o.beginPath(),o.moveTo(_,j),o.lineTo(_+C*Math.cos(T),j+C*Math.sin(T)),o.stroke()):(o.strokeStyle=this.outlineCol,o.lineWidth=S+2*this.outlineWidthPix*r,o.beginPath(),o.moveTo(_,j),o.lineTo(_+C*Math.cos(T),j+C*Math.sin(T)),o.stroke(),o.strokeStyle=x,o.lineWidth=S,o.beginPath(),o.moveTo(_,j),o.lineTo(_+C*Math.cos(T),j+C*Math.sin(T)),o.stroke(),o.strokeStyle=this.outlineCol,o.lineWidth=this.outlineWidthPix*r,o.beginPath(),o.arc(_+C*Math.cos(T),j+C*Math.sin(T),.5*S,0,2*Math.PI,!1),o.stroke())}}}}}catch(t){g.e(t)}finally{g.f()}o.lineCap="butt",this.updateLegends({style:this,resolution:n,z:r,viewScale:i})}}],r&&Li(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function Hi(t){return Hi="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},Hi(t)}function qi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Yi(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,Vi(r.key),r)}}function Vi(t){var e=function(t){if("object"!=Hi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Hi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Hi(e)?e:e+""}function Zi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Zi=function(){return!!t})()}function Xi(t){return Xi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xi(t)}function Ji(t,e){return Ji=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ji(t,e)}var Ki=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=Xi(e),function(t,e){if(e&&("object"==Hi(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)}(t,Zi()?Reflect.construct(e,n||[],Xi(t).constructor):e.apply(t,n))}(this,e,[n])).color=n.color||function(t,e,n,r){return"#EA6BAC"},t.width=n.width||function(t,e,n,r){return e/5},t.length=n.length||function(t,e,n,r){return e},t.diamond=n.diamond,t}return 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&&Ji(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,n,r){this.filter&&(t=t.filter(this.filter));var o=n.view.z,i=n.offscreenCtx,a=e.buildSides(t,r);if(0!=a.length){var u=this.viewScale?this.viewScale(a,r,o):void 0;i.lineCap="butt";var l,c=.5*r,s=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 qi(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qi(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}}}}(a);try{for(s.s();!(l=s.n()).done;){var f=l.value,h=this.color?this.color(f,r,o,u):void 0;if(h&&"none"!=h)if(this.diamond){i.fillStyle=h;var y=f.x,p=f.y;i.beginPath(),i.moveTo(y-c,p),i.lineTo(y,p+c),i.lineTo(y+c,p),i.lineTo(y,p-c),i.closePath(),i.fill()}else{var v=this.width?this.width(f,r,o,u):void 0;if(!v||v<=0)continue;var d=this.length?this.length(f,r,o,u):void 0;if(!d||d<=0)continue;var b=.5*d;i.lineWidth=v,i.strokeStyle=h;var m=f.x,g=f.y;i.beginPath(),"v"===f.or?(i.moveTo(m,g-b),i.lineTo(m,g+b)):(i.moveTo(m-b,g),i.lineTo(m+b,g)),i.stroke()}}}catch(t){s.e(t)}finally{s.f()}this.updateLegends({style:this,resolution:r,z:o,viewScale:u})}}}],o=[{key:"buildSides",value:function(t,e){var n=[],r=arguments.length>4&&void 0!==arguments[4]&&!arguments[4]?0:e/2;t.sort(function(t,e){return e.x==t.x?t.y-e.y:t.x-e.x});for(var o=t[0],i=1;i<t.length;i++){var a=t[i];o.y+e==a.y&&o.x==a.x?n.push({or:"h",x:o.x+r,y:a.y,c1:o,c2:a}):(n.push({or:"h",x:o.x+r,y:o.y+e,c1:o,c2:void 0}),n.push({or:"h",x:a.x+r,y:a.y,c1:void 0,c2:a})),o=a}t.sort(function(t,e){return e.y==t.y?t.x-e.x:t.y-e.y}),o=t[0];for(var u=1;u<t.length;u++){var l=t[u];o.x+e==l.x&&o.y==l.y?n.push({or:"v",x:o.x+e,y:o.y+r,c1:o,c2:l}):(n.push({or:"v",x:o.x+e,y:o.y+r,c1:o,c2:void 0}),n.push({or:"v",x:l.x,y:l.y+r,c1:void 0,c2:l})),o=l}return n}}],r&&Yi(n.prototype,r),o&&Yi(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Sr);function Qi(t){return Qi="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},Qi(t)}function ta(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ea(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,na(r.key),r)}}function na(t){var e=function(t){if("object"!=Qi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Qi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Qi(e)?e:e+""}function ra(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ra=function(){return!!t})()}function oa(t){return oa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},oa(t)}function ia(t,e){return ia=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ia(t,e)}var aa=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=oa(e),function(t,e){if(e&&("object"==Qi(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)}(t,ra()?Reflect.construct(e,n||[],oa(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.code=t.code,n.color=t.color,n}return 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&&ia(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r=e.view.z,o=e.offscreenCtx,i=Ki.buildSides(t,n);if(0!=i.length){var a=this.viewScale?this.viewScale(i,n,r):void 0;o.lineCap="butt";var u,l=.5*n,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 ta(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ta(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}}}}(i);try{for(c.s();!(u=c.n()).done;){var s=u.value,f=s.c1?this.code(s.c1,n,r):void 0,h=s.c2?this.code(s.c2,n,r):void 0;if(f!=h){var y=this.width?this.width(s,n,r,a):void 0;if(y&&!(y<=0)){var p=.5*y;o.lineWidth=y,"h"===s.or?(h&&(o.beginPath(),o.strokeStyle=this.color[h],o.moveTo(s.x-l,s.y+p),o.lineTo(s.x+l,s.y+p),o.stroke()),f&&(o.beginPath(),o.strokeStyle=this.color[f],o.moveTo(s.x-l,s.y-p),o.lineTo(s.x+l,s.y-p),o.stroke())):(h&&(o.beginPath(),o.strokeStyle=this.color[h],o.moveTo(s.x+p,s.y-l),o.lineTo(s.x+p,s.y+l),o.stroke()),f&&(o.beginPath(),o.strokeStyle=this.color[f],o.moveTo(s.x-p,s.y-l),o.lineTo(s.x-p,s.y+l),o.stroke()))}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,resolution:n,z:r,viewScale:a})}}}],r&&ea(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ki);const ua=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 la(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=document.createElement("canvas");r.setAttribute("width",t),r.setAttribute("height",e);var o=r.getContext("webgl",n);if(!o)throw new Error("Unable to initialize WebGL. Your browser or machine may not support it.");return{canvas:r,gl:o}}function ca(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 sa(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 fa(t){return fa="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},fa(t)}function ha(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,ya(r.key),r)}}function ya(t){var e=function(t){if("object"!=fa(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=fa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fa(e)?e:e+""}var pa=function(){return t=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=ca(e,sa(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 "),sa(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=[]},(e=[{key:"addPointData",value:function(t,e,n){var r=Pe(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)}}])&&ha(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();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 da(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={}.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=Array(e);n<e;n++)r[n]=t[n];return r}function ma(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,ga(r.key),r)}}function ga(t){var e=function(t){if("object"!=va(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=va(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==va(e)?e:e+""}function wa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(wa=function(){return!!t})()}function xa(t){return xa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xa(t)}function Sa(t,e){return Sa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Sa(t,e)}var Oa=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=xa(e),function(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)}(t,wa()?Reflect.construct(e,n||[],xa(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.dotNumber=t.dotNumber||function(t,e){return e/100},n.color=t.color||function(){return"#FF5733"},n.dotSize=t.dotSize||function(t,e){return 1.5*e},n.sigma=t.sigma||function(t,e){return t/2},n}return 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&&Sa(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r=e.view.z,o=this.viewScale?this.viewScale(t,n,r):void 0,i=this.dotSize?this.dotSize(n,r,o):r,a=this.sigma?this.sigma(n,r,o):.4*n,u=ua(0,a),l=e.offscreenCtx;if(function(){try{var t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}}()){var c=la(e.w+"",e.h+"");if(!c)return void console.error("No webGL");var s,f=new pa(c.gl,i/r),h=n/2,y=da(t);try{for(y.s();!(s=y.n()).done;){var p=s.value,v=this.color(p,n,r,o);if(v&&"none"!==v){var d=this.dotNumber(p,n,r,o),b=this.offset(p,n,r),m=p.x+b.dx+h,g=p.y+b.dy+h,w=Pe(v);if(!w)return;for(var x=0;x<=d;x++)f.addPointData2(m+u(),g+u(),w.r,w.g,w.b,w.opacity)}}}catch(t){y.e(t)}finally{y.f()}f.draw(e.getWebGLTransform()),e.initCanvasTransform(),l.drawImage(c.canvas,0,0)}else{var S,O=da(t);try{for(O.s();!(S=O.n()).done;){var _=S.value,j=this.color(_,n,r,o);if(j&&"none"!==j){l.fillStyle=j;for(var P=this.dotNumber(_,n,r,o),k=this.offset(_,n,r),T=_.x+k.dx+n/2,C=_.y+k.dy+n/2,E=0;E<=P;E++)l.fillRect(T+u(),C+u(),i,i)}}}catch(t){O.e(t)}finally{O.f()}}this.updateLegends({style:this,resolution:n,z:r,viewScale:o})}}],r&&ma(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function _a(t){return _a="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},_a(t)}function ja(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,Pa(r.key),r)}}function Pa(t){var e=function(t){if("object"!=_a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=_a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_a(e)?e:e+""}var ka=function(){return t=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("")},e=[{key:"draw",value:function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,i=ca(t,sa(t,t.VERTEX_SHADER,this.vshString),sa(t,t.FRAGMENT_SHADER,this.fshString));t.useProgram(i),t.uniform1f(t.getUniformLocation(i,"sizePix"),1*o);for(var a=0;a<this.colors.length;a++){var u=Pe(this.colors[a]);t.uniform4fv(t.getUniformLocation(i,"c"+a),[+u.r/255,+u.g/255,+u.b/255,+u.opacity])}t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array(e),t.STATIC_DRAW);var l=t.getAttribLocation(i,"pos");t.vertexAttribPointer(l,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(l),t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array(n),t.STATIC_DRAW);var c=t.getAttribLocation(i,"i");t.vertexAttribPointer(c,1,t.FLOAT,!1,0,0),t.enableVertexAttribArray(c),t.uniformMatrix3fv(t.getUniformLocation(i,"mat"),!1,new Float32Array(r)),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.POINTS,0,e.length/2)}}],e&&ja(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();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 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,Ea(r.key),r)}}function Ea(t){var e=function(t){if("object"!=Ta(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ta(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ta(e)?e:e+""}function Aa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Aa=function(){return!!t})()}function Ma(t){return Ma=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ma(t)}function za(t,e){return za=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},za(t,e)}var Ra=function(t){function e(t){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Ma(e),function(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)}(t,Aa()?Reflect.construct(e,n||[],Ma(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.code=t.code,t.color=t.color||void 0;var r=Object.keys(t.color);n.catToI={};for(var o=0;o<r.length;o++)n.catToI[r[o]]=o+"";n.colors=[];for(var i=0,a=r;i<a.length;i++){var u=a[i];n.colors.push(t.color[""+u])}return n.size=t.size,n.wgp=new ka(n.colors),n}return 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&&za(t,e)}(e,t),n=e,(r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));for(var r,o=e.view.z,i=n/2,a=t.length,u=[],l=[],c=0;c<a;c++){r=t[c];var s=this.code(r);if(null!=s){var f=this.catToI[s];isNaN(+f)?console.log("Unexpected category index: "+s+" "+f):(u.push(r.x+i,r.y+i),l.push(+f))}else console.log("Unexpected category: "+s)}var h=la(e.w+"",e.h+"");if(h){var y=this.size?this.size(n,o):n+.2*o;this.wgp.draw(h.gl,u,l,e.getWebGLTransform(),y/o),e.initCanvasTransform(),e.offscreenCtx.drawImage(h.canvas,0,0),this.updateLegends({style:this,resolution:n,z:o})}else console.error("No webGL")}}])&&Ca(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function Ia(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(n<o||void 0===n&&o>=o)&&(n=o)}return n}function Fa(t){return null===t?NaN:+t}function Ba(t,e,n=Fa){if((r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,o=(r-1)*e,i=Math.floor(o),a=+n(t[i],i,t);return a+(+n(t[i+1],i+1,t)-a)*(o-i)}}function Na(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function La(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Da(t){let e,n,r;function o(t,r,o=0,i=t.length){if(o<i){if(0!==e(r,r))return i;do{const e=o+i>>>1;n(t[e],r)<0?o=e+1:i=e}while(o<i)}return o}return 2!==t.length?(e=Na,n=(e,n)=>Na(t(e),n),r=(e,n)=>t(e)-n):(e=t===Na||t===La?t:Ga,n=t,r=t),{left:o,center:function(t,e,n=0,i=t.length){const a=o(t,e,n,i-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,o=0,i=t.length){if(o<i){if(0!==e(r,r))return i;do{const e=o+i>>>1;n(t[e],r)<=0?o=e+1:i=e}while(o<i)}return o}}}function Ga(){return 0}const Wa=Da(Na),Ua=Wa.right,$a=(Wa.left,Da(Fa).center,Ua);function Ha(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function qa(){var t,e=[],n=[],r=[];function o(){var t=0,o=Math.max(1,n.length);for(r=new Array(o-1);++t<o;)r[t-1]=Ba(e,t/o);return i}function i(e){return null==e||isNaN(e=+e)?t:n[$a(r,e)]}return i.invertExtent=function(t){var o=n.indexOf(t);return o<0?[NaN,NaN]:[o>0?r[o-1]:e[0],o<r.length?r[o]:e[e.length-1]]},i.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(Na),o()},i.range=function(t){return arguments.length?(n=Array.from(t),o()):n.slice()},i.unknown=function(e){return arguments.length?(t=e,i):t},i.quantiles=function(){return r.slice()},i.copy=function(){return qa().domain(e).range(n).unknown(t)},Ha.apply(i,arguments)}var Ya=function(t){var e=t.valueFunction,n=t.minValue||0,r=t.minSizePix||0,o=t.maxSizeFactor||1,i=t.stretching,a=t.range,u=t.domain,l=t.classNumber;return function(t,c,s){var f=u||[n,Ia(t,e)],h=a||[r*s,c*o],y=f[1]-f[0],p=f[0],v=h[1]-h[0],d=h[0];return function(t){return t=(t-p)/y,i&&(t=i(t)),l&&(t=1==t?1:Math.floor(t*l)/(l-1)),d+t*v}}},Va=function(t){var e=t.valueFunction,n=t.classNumber||12,r=t.minSizePix||1,o=t.maxSizeFactor||1,i=qa();return function(t,a,u){i.domain(t.map(e));var l=r*u,c=a*o;return i.range(Array.from({length:n},function(t,e){return l+e*(c-l)/(n-1)})),i.breaks=i.quantiles(),i.values=i.range(),i}},Za=function(t){var e,n=t.valueFunction,r=t.stretching,o=t.colorScale||function(){return"purple"},i=null===(e=t.colors)||void 0===e?void 0:e.length;return t.colors&&i&&(o=function(e){return t.colors[1==e?i-1:Math.floor(e*i)]}),function(e){if(0!=e.length&&e){var a=function(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let o=-1;for(let i of t)null!=(i=e(i,++o,t))&&(void 0===n?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)))}return[n,r]}(e,n);if(null!=a[0]){var u=a[1]-a[0],l=function(t){return t=(t-a[0])/u,r&&(t=r(t)),o(t)};if(l.invert=function(t){return r&&(t=r.invert(t)),a[0]+t*u},t.colors&&i){l.breaks=[];for(var c=1;c<i;c++)l.breaks.push(l.invert(c/i))}return l}}}},Xa=function(t){var e=t.valueFunction,n=t.classNumber||12,r=t.colors;t.colorScale&&(r=tu(t.colorScale,n)),r=r||Array.from({length:n},function(t,e){return"rgb("+Math.floor(255*e/(n-1))+",150,150)"});var o=qa().range(r);return function(t){return o.domain(t.map(e)),o.breaks=o.quantiles(),o.colors=r,o}},Ja=function(t){return function(e,n,r){var o={};for(var i in t)o[i]=t[i](e,n,r);return o}};function Ka(t){var e=t.length,n=function(n){for(var r=0;r<e;){if(n<=t[r])return r;r++}return r};return n.breaks=t,n}function Qa(t,e){var n=Ka(t),r=function(t){return e[n(t)]};return r.breaks=t,r.colors=e,r}function tu(t,e){if(1==e)return[t(.5)];for(var n=[],r=0;r<e;r++)n.push(t(r/(e-1)));return n}function eu(t){return eu="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},eu(t)}function nu(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,ru(r.key),r)}}function ru(t){var e=function(t){if("object"!=eu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=eu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==eu(e)?e:e+""}var ou=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"get",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};r.colorDark=r.colorDark||"#111",r.colorBright=r.colorBright||"#ddd",r.width=r.width||function(t,e,n){var r=1*n,o=4*n,i=(o-r)/3;return Math.min(r+(t-1)*i,o)};for(var o=Ka(e),i={},a=0;a<n.length;a++)i[a+""]=n[a];var u=new Ra({code:function(e){return o(t(e))},color:i}),l=function(e){return(e.c1?o(t(e.c1)):-1)-(e.c2?o(t(e.c2)):-1)};return[u,new Ki({color:function(t){var e=l(t);if(0!==e)return"v"===t.or?e<0?r.colorBright:r.colorDark:e<0?r.colorDark:r.colorBright},width:function(t,e,n){return r.width(Math.abs(l(t)),e,n)}})]}}],null&&nu(t.prototype,null),e&&nu(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function iu(t){return iu="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},iu(t)}function au(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 uu(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uu(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 uu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function lu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(lu=function(){return!!t})()}function cu(t){return cu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cu(t)}function su(t,e){return su=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},su(t,e)}function fu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hu(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,pu(r.key),r)}}function yu(t,e,n){return e&&hu(t.prototype,e),n&&hu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function pu(t){var e=function(t){if("object"!=iu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=iu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==iu(e)?e:e+""}var vu=function(){return yu(function t(){fu(this,t)},null,[{key:"get",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};(r=r||{}).colDark=r.colDark||"#333",r.colBright=r.colBright||"#aaa",r.widthFactor=r.widthFactor||.12;var o=ou.get(t,e,n,r),i=new ei({strokeColor:function(){return"#666"},strokeWidth:function(t,e,n){return.2*n},filter:r.filter});return[o[0],i,o[1],new du({colDark:r.colDark,colBright:r.colBright,filter:r.filter})]}},{key:"getCategory",value:function(t,e,n){return(n=n||{}).colDark=n.colDark||"#333",n.colBright=n.colBright||"#aaa",[new Ra({code:t,color:e}),new ei({strokeColor:function(){return"#666"},strokeWidth:function(t,e,n){return.2*n}}),new du({colDark:n.colDark,colBright:n.colBright})]}}])}(),du=function(t){function e(t){var n,r,o,i;return fu(this,e),r=this,i=[t],o=cu(o=e),n=function(t,e){if(e&&("object"==iu(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)}(r,lu()?Reflect.construct(o,i||[],cu(r).constructor):o.apply(r,i)),t=t||{},n.colDark=t.colDark||"#333",n.colBright=t.colBright||"#aaa",n}return 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&&su(t,e)}(e,t),yu(e,[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r=e.offscreenCtx;r.lineWidth=.6*e.view.z,r.strokeStyle=this.colDark;var o,i=au(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;r.beginPath(),r.arc(a.x+.5*n,a.y+.5*n,.55*n*.5,Math.PI/4,-Math.PI*(3/4),!0),r.stroke()}}catch(t){i.e(t)}finally{i.f()}r.strokeStyle=this.colBright;var u,l=au(t);try{for(l.s();!(u=l.n()).done;){var c=u.value;r.beginPath(),r.arc(c.x+.5*n,c.y+.5*n,.55*n*.5,Math.PI/4,-Math.PI*(3/4),!1),r.stroke()}}catch(t){l.e(t)}finally{l.f()}}}])}(Sr);function bu(t){return bu="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},bu(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,gu(r.key),r)}}function gu(t){var e=function(t){if("object"!=bu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=bu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bu(e)?e:e+""}var wu=function(){return t=function t(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gl=e;var a=sa(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 "),u="precision mediump float;\nvarying float vt;\nuniform float alpha;\n"+function(){for(var t=[],e=0;e<n.length;e++)t.push("uniform vec4 c"+e+";\n");return t.join("")}()+"void main(void) {\n";if(r?"pow"==r.fun?u+=" float t = pow(vt, alpha);\n":"powInv"==r.fun?u+=" float t = 1.0-pow(1.0-vt, 1.0/alpha);\n":"exp"==r.fun?u+=0==r.alpha?"float t = vt;":" float t = (exp(vt * alpha) - 1.0) / (exp(alpha) - 1.0);\n":"log"==r.fun?u+=0==r.alpha?"float t = vt;":" float t = 1.0 - (1.0 / alpha) * log(exp(alpha) * (1.0 - vt) + vt);\n":"circle"==r.fun?0==r.alpha?u+=" float t = vt;\n":1==r.alpha?u+=" float t = sqrt(vt * (2.0 - vt));\n":u+=" float a = alpha / (1.0 - alpha);\n float t = sqrt(1.0 / (a * a) + vt * ( 2.0/a + 2.0 - vt )) - 1.0 / a;\n":"circleInv"==r.fun?0==r.alpha?u+=" float t = vt;\n":1==r.alpha?u+=" float t = 1.0 - sqrt((1.0 - vt) * (1.0 + vt));\n":u+=" 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;\n":(console.error("Unexpected stretching function code: "+r.fun),u+=" float t = vt;\n"):u+=" float t = vt;\n",1==n.length)u+=" vec4 cI=c0;\n vec4 cF=c0;\n";else if(2==n.length)u+=" vec4 cI=c0;\n vec4 cF=c1;\n";else{var l=n.length-1,c=l+".0";u+=" vec4 cI;\n",u+=" vec4 cF;\n",u+=" if(t<1.0/"+c+") { cI=c0; cF=c1; t=t*"+c+"; }\n";for(var s=2;s<l;s++)u+=" else if(t<"+s+".0/"+c+") { cI=c"+(s-1)+"; cF=c"+s+"; t="+c+"*t-"+(s-1)+".0; }\n";u+=" else { cI=c"+(l-1)+"; cF=c"+l+"; t="+c+"*t-"+(l-1)+".0; }\n"}1==n.length?u+=" gl_FragColor = vec4(c0[0], c0[1], c0[2], c0[3]);}\n":u+=" gl_FragColor = mix(cI, cF, t);}\n";var f=sa(e,e.FRAGMENT_SHADER,u);this.program=ca(e,a,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 h=0;h<n.length;h++){var y=Pe(n[h]),p=y.opacity;1==y.opacity&&null!=i&&(p=i),e.uniform4fv(e.getUniformLocation(this.program,"c"+h),[+y.r/255,+y.g/255,+y.b/255,+p])}},e=[{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)}}],e&&mu(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function xu(t){return xu="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},xu(t)}function Su(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ou(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,_u(r.key),r)}}function _u(t){var e=function(t){if("object"!=xu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=xu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xu(e)?e:e+""}function ju(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ju=function(){return!!t})()}function Pu(t){return Pu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pu(t)}function ku(t,e){return ku=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ku(t,e)}var Tu=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Pu(e),function(t,e){if(e&&("object"==xu(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)}(t,ju()?Reflect.construct(e,n||[],Pu(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.tFun=t.tFun,n.stretching=t.stretching,n.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&&(n.colors=[t.color(0),t.color(.2),t.color(.4),t.color(.6),t.color(.8),t.color(1)]),n.opacity=t.opacity,n.size=t.size,n}return 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&&ku(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r=e.view.z,o=this.viewScale?this.viewScale(t,n,r):void 0,i=la(e.w+"",e.h+"",null!=this.opacity?{premultipliedAlpha:!1}:void 0);if(i){var a,u=n/2,l=[],c=[],s=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 Su(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Su(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(s.s();!(a=s.n()).done;){var f=a.value,h=this.tFun(f,n,r,o);null!=h&&null!=h&&(l.push(f.x+u,f.y+u),c.push(h>1?1:h<0?0:h))}}catch(t){s.e(t)}finally{s.f()}var y=this.size?this.size(n,r):n+.2*r,p=this.opacity?this.opacity(n,r):void 0;new wu(i.gl,this.colors,this.stretching,y/r,p).draw(l,c,e.getWebGLTransform()),e.initCanvasTransform(),e.offscreenCtx.drawImage(i.canvas,0,0),this.updateLegends({style:this,resolution:n,z:r,viewScale:o})}else console.error("No webGL")}}],r&&Ou(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function Cu(t){return Cu="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},Cu(t)}function Eu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Au(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,Mu(r.key),r)}}function Mu(t){var e=function(t){if("object"!=Cu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Cu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cu(e)?e:e+""}function zu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(zu=function(){return!!t})()}function Ru(t){return Ru=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ru(t)}function Iu(t,e){return Iu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Iu(t,e)}var Fu=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Ru(e),function(t,e){if(e&&("object"==Cu(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)}(t,zu()?Reflect.construct(e,n||[],Ru(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.color=t.color||function(){return"#EA6BAC"},n.mosaicFactor=t.mosaicFactor||.15,n.shadowFactor=t.shadowFactor||.2,n.shadowColor=t.shadowColor||"#555",n}return 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)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r=e.view.z,o=e.offscreenCtx,i=this.viewScale?this.viewScale(t,n,r):void 0;o.strokeStyle=this.shadowColor,o.lineWidth=this.shadowFactor*n,o.lineJoin="round",o.lineCap="butt";var a,u=n*this.mosaicFactor,l=function(){return{x:Math.random()*u,y:Math.random()*u}},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 Eu(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Eu(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();!(a=c.n()).done;){var s=a.value,f=this.color?this.color(s,n,r,i):void 0;if(f&&"none"!==f){o.fillStyle=f;var h=this.offset(s,n,r),y=l(),p=l(),v=l(),d=l();this.shadowFactor>0&&(o.beginPath(),o.moveTo(s.x+h.dx+y.x,s.y+h.dy+y.y),o.lineTo(s.x+h.dx+n-v.x,s.y+h.dy+v.y),o.lineTo(s.x+h.dx+n-d.x,s.y+h.dy+n-d.y),o.stroke()),o.beginPath(),o.moveTo(s.x+h.dx+y.x,s.y+h.dy+y.y),o.lineTo(s.x+h.dx+n-v.x,s.y+h.dy+v.y),o.lineTo(s.x+h.dx+n-d.x,s.y+h.dy+n-d.y),o.lineTo(s.x+h.dx+p.x,s.y+h.dy+n-p.y),o.fill()}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,resolution:n,z:r,viewScale:i})}}],r&&Au(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function Bu(t){return Bu="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},Bu(t)}function Nu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Lu(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,Du(r.key),r)}}function Du(t){var e=function(t){if("object"!=Bu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Bu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Bu(e)?e:e+""}function Gu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Gu=function(){return!!t})()}function Wu(t){return Wu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wu(t)}function Uu(t,e){return Uu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Uu(t,e)}var $u=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Wu(e),function(t,e){if(e&&("object"==Bu(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)}(t,Gu()?Reflect.construct(e,n||[],Wu(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.color=t.color||function(){return"#EA6BAC"},n.size=t.size||function(t,e){return e},n.shape=t.shape||function(){return"o"},n}return 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)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){this.filter&&(t=t.filter(this.filter));var r,o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,n,o):void 0,u=.5*n,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 Nu(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nu(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();!(r=l.n()).done;){var c=r.value,s=this.color?this.color(c,n,o,a):void 0;if(s&&"none"!==s){i.fillStyle=s;var f=this.size(c,n,o,a),h=(f=f<0?0:f>1?1:f)*u,y=this.shape?this.shape(c):"o";if("none"!==y){var p=c.x+u,v=c.y+u;if("p"===y)i.beginPath(),i.moveTo(p,v+u),i.lineTo(p+h,v+h),i.lineTo(p+u,v),i.lineTo(p+h,v-h),i.lineTo(p,v-u),i.lineTo(p-h,v-h),i.lineTo(p-u,v),i.lineTo(p-h,v+h),i.fill();else{if("o"!==y)throw new Error("Unexpected shape:"+y);i.beginPath(),i.moveTo(p,v+h),i.lineTo(p+u,v+u),i.lineTo(p+h,v),i.lineTo(p+u,v-u),i.lineTo(p,v-h),i.lineTo(p-u,v-u),i.lineTo(p-h,v),i.lineTo(p-u,v+u),i.fill()}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,resolution:n,z:o,viewScale:a})}}],r&&Lu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function Hu(t){return Hu="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},Hu(t)}function qu(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 Yu(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yu(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 Yu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Vu(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,Zu(r.key),r)}}function Zu(t){var e=function(t){if("object"!=Hu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Hu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Hu(e)?e:e+""}function Xu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Xu=function(){return!!t})()}function Ju(t){return Ju=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ju(t)}function Ku(t,e){return Ku=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ku(t,e)}var Qu=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Ju(e),function(t,e){if(e&&("object"==Hu(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)}(t,Xu()?Reflect.construct(e,n||[],Ju(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.ts=t.ts,n.noData=t.noData||function(t){return void 0===t||""==t||null===t||isNaN(+t)},n.offsetX=t.offsetX||function(t,e,n){return 0},n.width=t.width||function(t,e,n){return e},n.offsetY=t.offsetY||function(t,e,n){return 0},n.height=t.height||function(t,e,n){return e},n.anchorModeY=t.anchorModeY||function(t,e,n){return"center"},n.lineWidth=t.lineWidth||function(t,e,n,r){return 1.5*r},n.color=t.color||function(){return"black"},n}return 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&&Ku(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o,i,a=e.view.z,u=e.offscreenCtx,l=this.viewScale?this.viewScale(t,n,a):void 0,c=function(t){var e,n,o,i=qu(r.ts);try{for(i.s();!(o=i.n()).done;){var a=t[o.value];null!=a&&((null==e||a<e)&&(e=a),(null==n||a>n)&&(n=a))}}catch(t){i.e(t)}finally{i.f()}if(null!=e)return n-e},s=qu(t);try{for(s.s();!(i=s.n()).done;){var f=c(i.value);null!=f&&(null==o||f>o)&&(o=f)}}catch(t){s.e(t)}finally{s.f()}if(o){var h=this.ts.length;u.lineCap="butt";var y,p=qu(t);try{for(p.s();!(y=p.n()).done;){var v=y.value,d=this.lineWidth?this.lineWidth(v,n,a,l):void 0;if(d&&!(d<0)){var b=this.color?this.color(v,n,a,l):void 0;if(b){var m=this.offsetX?this.offsetX(v,n,a):0;if(null!=m&&!isNaN(m)){var g=this.width?this.width(v,n,a):n;if(null!=g&&!isNaN(g)){var w=this.offsetY?this.offsetY(v,n,a):0;if(null!=w&&!isNaN(w)){var x=this.height?this.height(v,n,a):n;if(null!=x&&!isNaN(x)){var S=this.anchorModeY?this.anchorModeY(v,n,a):"center";if(S){u.lineWidth=d,u.strokeStyle=b;var O=void 0,_=void 0;if("first"===S)O=v[this.ts[0]],_=0;else if("last"===S)O=v[this.ts[this.ts.length-1]],_=0;else if("bottom"===S){var j,P=qu(this.ts);try{for(P.s();!(j=P.n()).done;){var k=+v[j.value];null!=k&&(null==O||k<O)&&(O=k)}}catch(t){P.e(t)}finally{P.f()}_=0}else if("top"===S){var T,C=qu(this.ts);try{for(C.s();!(T=C.n()).done;){var E=+v[T.value];null!=E&&(null==O||E>O)&&(O=E)}}catch(t){C.e(t)}finally{C.f()}_=n}else{if("center"!==S){console.log("Unexpected anchorModeY: "+S);continue}var A,M=void 0,z=void 0,R=qu(this.ts);try{for(R.s();!(A=R.n()).done;){var I=v[A.value];null!=I&&((null==M||I<M)&&(M=I),(null==z||I>z)&&(z=I))}}catch(t){R.e(t)}finally{R.f()}O=.5*(+z+ +M),_=n/2}var F=g/(h-1),B=v[this.ts[0]];this.noData(B)||(u.beginPath(),u.moveTo(v.x+m,v.y+_+(B-O)*x/o+w));for(var N=void 0,L=1;L<h;L++)N=v[this.ts[L]],this.noData(B)&&this.noData(N)||(!this.noData(B)&&this.noData(N)?u.stroke():this.noData(B)&&!this.noData(N)?(u.beginPath(),u.moveTo(v.x+L*F+m,v.y+_+(N-O)*x/o+w)):(u.lineTo(v.x+L*F+m,v.y+_+(N-O)*x/o+w),L==h-1&&u.stroke())),B=N}}}}}}}}}catch(t){p.e(t)}finally{p.f()}this.updateLegends({style:this,resolution:n,z:a,viewScale:l})}}}],r&&Vu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr);function tl(t){return tl="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},tl(t)}function el(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)||rl(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 nl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=rl(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 rl(t,e){if(t){if("string"==typeof t)return ol(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ol(t,e):void 0}}function ol(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function il(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,al(r.key),r)}}function al(t){var e=function(t){if("object"!=tl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=tl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==tl(e)?e:e+""}function ul(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ul=function(){return!!t})()}function ll(t){return ll=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ll(t)}function cl(t,e){return cl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},cl(t,e)}var sl=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=ll(e),function(t,e){if(e&&("object"==tl(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)}(t,ul()?Reflect.construct(e,n||[],ll(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.color=t.color,n.height=t.height||function(t,e,n,r){return.4*e},n.angle=null!=t.angle?t.angle:50,n.cornerLineStrokeColor=t.cornerLineStrokeColor||function(t,e,n,r){return"#999"},n.cornerLineWidth=t.cornerLineWidth||function(t,e,n,r){return r%90==0?0:.8*n},n.sVert=null==t.sVert||t.sVert,n.sHor=null==t.sHor||t.sHor,n}return 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&&cl(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,e,n){var r=this;this.filter&&(t=t.filter(this.filter));var o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,n,o):void 0,u=Object.keys(this.color),l=n/2,c=this.offset(void 0,n,o),s=c.dx,f=c.dy,h=Ki.buildSides(t,n,this.angle%180!=90&&this.sVert,this.angle%180!=0&&this.sHor);if(0!=h.length){var y=this.angle*Math.PI/180,p=Math.cos(y),v=Math.sin(y),d=Math.abs(this.angle)<90?e.extGeo.xMin:e.extGeo.xMax,b=this.angle<0?e.extGeo.yMax:e.extGeo.yMin;h.sort(function(t,e){return Math.hypot(e.x-d,e.y-b)-Math.hypot(t.x-d,t.y-b)});var m=function(t){if(t){var e=r.cornerLineWidth?r.cornerLineWidth(t,n,o,r.angle):.8*o;if(0!=e){i.strokeStyle=r.cornerLineStrokeColor?r.cornerLineStrokeColor(t,n,o,r.angle):"#333",i.lineWidth=e;var u=r.height(t,n,o,a);i.beginPath(),i.moveTo(t.x+l+s,t.y+l+f),i.lineTo(t.x+l+u*p+s,t.y+l+u*v+f),i.stroke()}}};i.lineCap="round";var g,w=nl(h);try{for(w.s();!(g=w.n()).done;){var x=g.value,S=x.c1,O=x.c2,_=x.x,j=x.y,P=S?this.height(S,n,o,a):0,k=O?this.height(O,n,o,a):0,T=fl(S,u),C=fl(O,u);if(0!=T||0!=C)for(var E=0,A=0,M=0,z=Object.entries(this.color);M<z.length;M++){var R=el(z[M],2),I=R[0],F=R[1],B=S?+S[I]:0,N=O?+O[I]:0;if(0!=B||0!=N){var L=P*E/T||0,D=P*(E+B)/T||0,G=k*A/C||0,W=k*(A+N)/C||0;i.beginPath(),"h"==x.or?(i.moveTo(_+L*p+s,j-l+L*v+f),i.lineTo(_+G*p+s,j+l+G*v+f),i.lineTo(_+W*p+s,j+l+W*v+f),i.lineTo(_+D*p+s,j-l+D*v+f)):(i.moveTo(_-l+L*p+s,j+L*v+f),i.lineTo(_+l+G*p+s,j+G*v+f),i.lineTo(_+l+W*p+s,j+W*v+f),i.lineTo(_-l+D*p+s,j+D*v+f)),i.fillStyle=F,i.fill(),E+=B,A+=N,m(S),m(O)}}}}catch(t){w.e(t)}finally{w.f()}this.updateLegends({style:this,resolution:n,z:o,viewScale:a})}}}],r&&il(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Sr),fl=function(t,e){if(!t)return 0;var n,r=0,o=nl(e);try{for(o.s();!(n=o.n()).done;){var i=t[n.value];i&&(r+=+i)}}catch(t){o.e(t)}finally{o.f()}return r||0};function hl(t){return hl="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},hl(t)}function yl(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(hl(t)+" is not iterable")}function pl(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof u?r:u,c=Object.create(l.prototype);return vl(c,"_invoke",function(n,r,o){var i,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(e,n){return i=e,u=0,l=t,h.n=n,a}};function y(n,r){for(u=n,l=r,e=0;!f&&c&&!o&&e<s.length;e++){var o,i=s[e],y=h.p,p=i[2];n>3?(o=p===r)&&(l=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=n<2&&y<i[1])?(u=0,h.v=r,h.n=i[1]):y<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,u=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&y(s,p),u=s,l=p;(e=u<2?t:l)||!f;){i||(u?u<3?(u>1&&(h.n=-1),y(u,l)):h.n=l:h.v=l);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=h.n<0)?l:n.call(r,h))!==a)break}catch(e){i=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),c}var a={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(vl(e={},r,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,vl(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,vl(f,"constructor",c),vl(c,"constructor",l),l.displayName="GeneratorFunction",vl(c,o,"GeneratorFunction"),vl(f),vl(f,o,"Generator"),vl(f,r,function(){return this}),vl(f,"toString",function(){return"[object Generator]"}),(pl=function(){return{w:i,m:h}})()}function vl(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}vl=function(t,e,n,r){function i(e,n){vl(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},vl(t,e,n,r)}function dl(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 bl(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bl(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 bl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ml(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function gl(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,wl(r.key),r)}}function wl(t){var e=function(t){if("object"!=hl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=hl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==hl(e)?e:e+""}function xl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(xl=function(){return!!t})()}function Sl(t){return Sl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sl(t)}function Ol(t,e){return Ol=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ol(t,e)}var _l=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Sl(e),function(t,e){if(e&&("object"==hl(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)}(t,xl()?Reflect.construct(e,n||[],Sl(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.image=t.image||function(){return""},n.size=t.size||function(t,e){return e},n.cache={},n}return 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&&Ol(t,e)}(e,t),n=e,r=[{key:"draw",value:(o=pl().m(function t(e,n,r){var o,i,a,u,l,c,s,f,h=this;return pl().w(function(t){for(;;)switch(t.p=t.n){case 0:o=n.view.z,i=r/o,a=this.viewScale?this.viewScale(e,r,o):void 0,n.initCanvasTransform(),u=dl(e),t.p=1,c=pl().m(function t(){var e,u,c,s,f,y;return pl().w(function(t){for(;;)switch(t.n){case 0:if(e=l.value,u=h.image(e,r,o,a)){t.n=1;break}return t.a(2,0);case 1:if(c=h.size(e,r,o,a)/o){t.n=2;break}return t.a(2,0);case 2:if("loading"!=(s=h.cache[u])){t.n=3;break}return t.a(2,{v:void 0});case 3:if(s){y=(i-c)/2;try{n.offscreenCtx.drawImage(s,n.geoToPixX(e.x)+y,n.geoToPixY(e.y)+y-i,c,c)}catch(t){console.error(t)}}else h.cache[u]="loading",(f=new Image).onload=function(){h.cache[u]=f,n.redraw()},f.onerror=function(){console.warn("Could not retrieve image from",u)},f.src=u;case 4:return t.a(2)}},t)}),u.s();case 2:if((l=u.n()).done){t.n=6;break}return t.d(yl(c()),3);case 3:if(0!==(s=t.v)){t.n=4;break}return t.a(3,5);case 4:if(!s){t.n=5;break}return t.a(2,s.v);case 5:t.n=2;break;case 6:t.n=8;break;case 7:t.p=7,f=t.v,u.e(f);case 8:return t.p=8,u.f(),t.f(8);case 9:this.updateLegends({style:this,resolution:r,z:o,viewScale:a});case 10:return t.a(2)}},t,this,[[1,7,8,9]])}),i=function(){var t=this,e=arguments;return new Promise(function(n,r){var i=o.apply(t,e);function a(t){ml(i,n,r,a,u,"next",t)}function u(t){ml(i,n,r,a,u,"throw",t)}a(void 0)})},function(t,e,n){return i.apply(this,arguments)})}],r&&gl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o,i}(Sr);function jl(t){return jl="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},jl(t)}function Pl(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 kl(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kl(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 kl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Tl(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,Cl(r.key),r)}}function Cl(t){var e=function(t){if("object"!=jl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=jl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==jl(e)?e:e+""}function El(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(El=function(){return!!t})()}function Al(t){return Al=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Al(t)}function Ml(t,e){return Ml=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ml(t,e)}var zl=function(t){function e(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,n){return e=Al(e),function(t,e){if(e&&("object"==jl(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)}(t,El()?Reflect.construct(e,n||[],Al(t).constructor):e.apply(t,n))}(this,e,[o]),o=o||{},r.dataset=t,r.styles=n,r.minPixelsPerCell=o.minPixelsPerCell||3,r.cellInfoHTML=o.cellInfoHTML||e.defaultCellInfoHTML,r}return 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&&Ml(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t,n){var r=t.view.z,o=t.offscreenCtx,i=this.getDataset(r);if(i){i.getData(t.extGeo),i.updateViewCache(t.extGeo);var a,u=Pl(this.styles);try{for(u.s();!(a=u.n()).done;){var l=a.value;l.visible&&!l.visible(r)||(o.globalAlpha=l.alpha?l.alpha(r):1,l.blendOperation&&(o.globalCompositeOperation=l.blendOperation(r)),t.setCanvasTransform(),l.draw(i.getViewCache(),t,i.getResolution()),l.filterColor&&l.drawFilter(t))}}catch(t){u.e(t)}finally{u.f()}if(n){var c,s=Pl(this.styles);try{for(s.s();!(c=s.n()).done;){var f=c.value;if((!f.visible||f.visible(r))&&(e.addLegends(n,f.legends),f.styles)){var h,y=Pl(f.styles);try{for(y.s();!(h=y.n()).done;){var p=h.value;p.visible&&!p.visible(r)||e.addLegends(n,p.legends)}}catch(t){y.e(t)}finally{y.f()}}}}catch(t){s.e(t)}finally{s.f()}}}}},{key:"getDataset",value:function(t){return this.dataset.getDataset(t,this.minPixelsPerCell)}},{key:"styles_",value:function(t){return 0===arguments.length?this.styles:(1===arguments.length?Array.isArray(t)?this.styles=t:this.styles=[t]:this.styles=arguments,this)}}],o=[{key:"addLegends",value:function(t,e){if(Array.isArray(e)){var n,r=Pl(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;this.addLegends(t,o)}}catch(t){r.e(t)}finally{r.f()}}else t.node().append(e.div.node())}},{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("")}}],r&&Tl(n.prototype,r),o&&Tl(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Cr);function Rl(t){return Rl="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},Rl(t)}function Il(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,Fl(r.key),r)}}function Fl(t){var e=function(t){if("object"!=Rl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Rl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rl(e)?e:e+""}function Bl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Bl=function(){return!!t})()}function Nl(t){return Nl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Nl(t)}function Ll(t,e){return Ll=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ll(t,e)}var Dl=function(t){function e(t){var n;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Nl(e),function(t,e){if(e&&("object"==Rl(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)}(t,Bl()?Reflect.construct(e,n||[],Nl(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.cache={},n.url=t.url,n.urlFun=t.urlFun||function(t,e,r){return n.url+r+"/"+t+"/"+e+".png"},n.resolutions=t.resolutions,!n.resolutions||0==n.resolutions.length)throw new Error("No resolutions provided for background layer");return n.nbPix=t.nbPix||256,n.origin=t.origin||[0,0],n.z0=t.z0||0,n.pixelationCoefficient=t.pixelationCoefficient||1,n}return 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&&Ll(t,e)}(e,t),n=e,(r=[{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.view.z,r=this.origin[0],o=this.origin[1],i=0;for(i=0;i<this.resolutions.length&&!(this.resolutions[i]<n*this.pixelationCoefficient);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)},s=function(t){return Math.ceil(-(t-o)/u)},f=c(t.extGeo.xMin)-1,h=c(t.extGeo.xMax),y=s(t.extGeo.yMin),p=s(t.extGeo.yMax)-1,v=function(n){for(var a=function(a){var c=e.get(i,n,a);if(!c){var s=new Image;return e.put(s,i,n,a),s.onload=function(){t.redraw()},s.onerror=function(){e.put("failed",i,n,a)},s.src=e.urlFun(n,a,i),0}if("failed"===c)return 0;if(!(c instanceof HTMLImageElement))return console.log(c),0;if(0==c.width||0==c.height)return 0;var f=r+n*u,h=o-a*u;try{t.initCanvasTransform(),t.offscreenCtx.drawImage(c,t.geoToPixX(f),t.geoToPixY(h),l,l)}catch(t){console.error(t)}},c=p;c<y;c++)a(c)},d=f;d<h;d++)v(d)}else console.error("No resolutions provided for background layer")}}])&&Il(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Cr);function Gl(t){return Gl="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},Gl(t)}function Wl(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,Ul(r.key),r)}}function Ul(t){var e=function(t){if("object"!=Gl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Gl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Gl(e)?e:e+""}function $l(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return($l=function(){return!!t})()}function Hl(t){return Hl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hl(t)}function ql(t,e){return ql=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ql(t,e)}var Yl=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Hl(e),function(t,e){if(e&&("object"==Gl(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)}(t,$l()?Reflect.construct(e,n||[],Hl(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.url=t.url,n.img=void 0,n.xMin=void 0,n.xMax=void 0,n.yMin=void 0,n.yMax=void 0,n}return 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&&ql(t,e)}(e,t),n=e,(r=[{key:"hasMoved",value:function(t){return t.xMin!=this.xMin||t.xMax!=this.xMax||t.yMin!=this.yMin||t.yMax!=this.yMax}},{key:"draw",value:function(t){if(t.updateExtentGeo(0),!this.hasMoved(t.extGeo)&&this.img)t.initCanvasTransform(),t.offscreenCtx.drawImage(this.img,0,0,t.w,t.h);else{this.xMin=t.extGeo.xMin,this.xMax=t.extGeo.xMax,this.yMin=t.extGeo.yMin,this.yMax=t.extGeo.yMax;var e=[];e.push(this.url),e.push("&width="),e.push(t.w),e.push("&height="),e.push(t.h),e.push("&bbox="),e.push(t.extGeo.xMin),e.push(","),e.push(t.extGeo.yMin),e.push(","),e.push(t.extGeo.xMax),e.push(","),e.push(t.extGeo.yMax);var n=e.join("");this.img||(this.img=new Image,this.img.onload=function(){t.redraw()},this.img.onerror=function(){console.warn("Could not retrieve WMS background image from",n)}),this.img.src=n}}}])&&Wl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Cr);function Vl(t){return Vl="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},Vl(t)}function Zl(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,Xl(r.key),r)}}function Xl(t){var e=function(t){if("object"!=Vl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vl(e)?e:e+""}function Jl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Jl=function(){return!!t})()}function Kl(t){return Kl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Kl(t)}function Ql(t,e){return Ql=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ql(t,e)}var tc=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Kl(e),function(t,e){if(e&&("object"==Vl(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)}(t,Jl()?Reflect.construct(e,n||[],Kl(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.url=t.url,n.xMin=t.xMin||0,n.yMax=t.yMax||0,n.width=t.width||2e4,n.height=t.height||2e4,n.img=void 0,n}return 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&&Ql(t,e)}(e,t),n=e,(r=[{key:"draw",value:function(t){var e=this;if(this.img){var n=t.geoToPixX(this.xMin),r=t.geoToPixY(this.yMax),o=t.getView().z;t.initCanvasTransform(),t.offscreenCtx.drawImage(this.img,n,r,this.width/o,this.height/o)}else this.img||(this.img=new Image,this.img.onload=function(){t.redraw()},this.img.onerror=function(){console.warn("Could not retrieve background image from",e.url)}),this.img.src=this.url}}])&&Zl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Cr);function ec(t){return ec="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},ec(t)}function nc(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof u?r:u,c=Object.create(l.prototype);return rc(c,"_invoke",function(n,r,o){var i,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(e,n){return i=e,u=0,l=t,h.n=n,a}};function y(n,r){for(u=n,l=r,e=0;!f&&c&&!o&&e<s.length;e++){var o,i=s[e],y=h.p,p=i[2];n>3?(o=p===r)&&(l=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=n<2&&y<i[1])?(u=0,h.v=r,h.n=i[1]):y<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,u=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&y(s,p),u=s,l=p;(e=u<2?t:l)||!f;){i||(u?u<3?(u>1&&(h.n=-1),y(u,l)):h.n=l:h.v=l);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=h.n<0)?l:n.call(r,h))!==a)break}catch(e){i=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),c}var a={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(rc(e={},r,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,rc(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,rc(f,"constructor",c),rc(c,"constructor",l),l.displayName="GeneratorFunction",rc(c,o,"GeneratorFunction"),rc(f),rc(f,o,"Generator"),rc(f,r,function(){return this}),rc(f,"toString",function(){return"[object Generator]"}),(nc=function(){return{w:i,m:h}})()}function rc(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}rc=function(t,e,n,r){function i(e,n){rc(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},rc(t,e,n,r)}function oc(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function ic(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 ac(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ac(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 ac(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function uc(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,lc(r.key),r)}}function lc(t){var e=function(t){if("object"!=ec(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ec(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ec(e)?e:e+""}function cc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(cc=function(){return!!t})()}function sc(t){return sc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sc(t)}function fc(t,e){return fc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fc(t,e)}var hc=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=sc(e),function(t,e){if(e&&("object"==ec(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)}(t,cc()?Reflect.construct(e,n||[],sc(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.url=t.url,n.style=t.style||function(){return"1.2em Arial"},n.color=t.color||(t.dark?function(){return"white"}:function(){return"black"}),n.haloColor=t.haloColor||(t.dark?function(){return"black"}:function(){return"white"}),n.haloWidth=t.haloWidth||function(){return 2.5},n.textAlign=t.textAlign||"start",n.offsetPix=t.offsetPix||[5,5],n.preprocess=t.preprocess,n.labels=void 0,n.loadingStatus="notLoaded",n}return 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&&fc(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t){if(this.labels){var e=t.view.z,n=t.offscreenCtx;n.textAlign=this.textAlign||"start",n.lineJoin="bevel",n.lineCap="butt",t.initCanvasTransform();var r,o=ic(this.labels);try{for(o.s();!(r=o.n()).done;){var i=r.value,a=this.style(i,e);if(a&&(n.font=a,t.toDraw(i))){var u=t.geoToPixX(i.x)+this.offsetPix[0],l=t.geoToPixY(i.y)-this.offsetPix[1];if(this.haloColor&&this.haloWidth){var c=this.haloColor(i,e),s=this.haloWidth(i,e);c&&s&&s>0&&(n.strokeStyle=c,n.lineWidth=s,n.strokeText(i.name,u,l))}if(this.color){var f=this.color(i,e);f&&(n.fillStyle=f,n.fillText(i.name,u,l))}}}}catch(t){o.e(t)}finally{o.f()}}else this.load(t.redraw)}},{key:"load",value:(o=nc().m(function t(e){var n,r,o,i,a;return nc().w(function(t){for(;;)switch(t.p=t.n){case 0:if(this.url){t.n=1;break}return console.log("Failed loading labels: No URL specified. "+this.url),this.loadingStatus="failed",this.labels=[],t.a(2);case 1:if("notLoaded"==this.loadingStatus){t.n=2;break}return t.a(2);case 2:return this.loadingStatus="loading",t.p=3,t.n=4,ro(this.url);case 4:if(n=t.v,!this.preprocess){t.n=13;break}this.labels=[],r=ic(n),t.p=5,r.s();case 6:if((o=r.n()).done){t.n=9;break}if(i=o.value,0!=this.preprocess(i)){t.n=7;break}return t.a(3,8);case 7:this.labels.push(i);case 8:t.n=6;break;case 9:t.n=11;break;case 10:t.p=10,a=t.v,r.e(a);case 11:return t.p=11,r.f(),t.f(11);case 12:t.n=14;break;case 13:this.labels=n;case 14:this.loadingStatus="loaded",e&&e(),t.n=16;break;case 15:t.p=15,t.v,console.log("Failed loading labels from "+this.url),this.labels=[],this.loadingStatus="failed";case 16:return t.a(2)}},t,this,[[5,10,11,12],[3,15]])}),i=function(){var t=this,e=arguments;return new Promise(function(n,r){var i=o.apply(t,e);function a(t){oc(i,n,r,a,u,"next",t)}function u(t){oc(i,n,r,a,u,"throw",t)}a(void 0)})},function(t){return i.apply(this,arguments)})}],r&&uc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o,i}(Cr);function yc(t){return yc="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},yc(t)}function pc(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof u?r:u,c=Object.create(l.prototype);return vc(c,"_invoke",function(n,r,o){var i,u,l,c=0,s=o||[],f=!1,h={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(e,n){return i=e,u=0,l=t,h.n=n,a}};function y(n,r){for(u=n,l=r,e=0;!f&&c&&!o&&e<s.length;e++){var o,i=s[e],y=h.p,p=i[2];n>3?(o=p===r)&&(l=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=n<2&&y<i[1])?(u=0,h.v=r,h.n=i[1]):y<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,u=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&y(s,p),u=s,l=p;(e=u<2?t:l)||!f;){i||(u?u<3?(u>1&&(h.n=-1),y(u,l)):h.n=l:h.v=l);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=h.n<0)?l:n.call(r,h))!==a)break}catch(e){i=t,u=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),c}var a={};function u(){}function l(){}function c(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(vc(e={},r,function(){return this}),e),f=c.prototype=u.prototype=Object.create(s);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,vc(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,vc(f,"constructor",c),vc(c,"constructor",l),l.displayName="GeneratorFunction",vc(c,o,"GeneratorFunction"),vc(f),vc(f,o,"Generator"),vc(f,r,function(){return this}),vc(f,"toString",function(){return"[object Generator]"}),(pc=function(){return{w:i,m:h}})()}function vc(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}vc=function(t,e,n,r){function i(e,n){vc(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},vc(t,e,n,r)}function dc(t,e,n,r,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void n(t)}u.done?e(l):Promise.resolve(l).then(r,o)}function bc(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 mc(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mc(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 mc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function gc(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,wc(r.key),r)}}function wc(t){var e=function(t){if("object"!=yc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=yc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yc(e)?e:e+""}function xc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(xc=function(){return!!t})()}function Sc(t){return Sc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sc(t)}function Oc(t,e){return Oc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Oc(t,e)}var _c=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Sc(e),function(t,e){if(e&&("object"==yc(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)}(t,xc()?Reflect.construct(e,n||[],Sc(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.url=t.url,n.preprocess=t.preprocess,n.shape=t.shape||function(t,e){return"circle"},n.size=t.size||function(t,e){return 10},n.strokeStyle=t.strokeStyle||function(t,e){return"red"},n.fillStyle=t.fillStyle||function(t,e){return"black"},n.lineWidth=t.lineWidth||function(t,e){return 2},n.color=t.color||function(t,e){return"gray"},n.width=t.width||function(t,e){return 2},n.lineDash=t.lineDash||function(t,e){},n.fs=void 0,n.loadingStatus="notLoaded",n}return 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&&Oc(t,e)}(e,t),n=e,r=[{key:"draw",value:function(t){if(this.fs){var e,n=t.view.z,r=t.offscreenCtx,o=bc(this.fs);try{for(o.s();!(e=o.n()).done;){var i=e.value,a=i.geometry.type;if("Point"==a){var u=i.geometry.coordinates,l=this.shape(i,n);if(!l||"none"==l)continue;var c=this.size(i,n)*n;if(!c)continue;var s=this.strokeStyle(i,n),f=this.fillStyle(i,n),h=this.lineWidth(i,n)*n;s&&(r.strokeStyle=s),f&&(r.fillStyle=f),h&&(r.lineWidth=h),"circle"==l?(r.beginPath(),r.arc(u[0],u[1],c/2,0,2*Math.PI,!1),f&&r.fill(),s&&h&&r.stroke()):"square"==l?(r.beginPath(),r.rect(u[0]-c/2,u[1]-c/2,c,c),f&&r.fill(),s&&h&&r.stroke()):console.error("Unexpected shape for point geojson: "+l)}else if("LineString"==a){var y=i.geometry.coordinates;if(y.length<2)continue;var p=this.color(i,n);if(!p||"none"==p)continue;r.strokeStyle=p;var v=this.width(i,n);if(!v||v<0)continue;r.lineWidth=v*n;var d=this.lineDash(i,n);d&&r.setLineDash(d),r.beginPath(),r.moveTo(y[0][0],y[0][1]);for(var b=1;b<y.length;b++)r.lineTo(y[b][0],y[b][1]);r.stroke()}else console.log("Unsupported geometry type in GeoJSONLayer: "+a)}}catch(t){o.e(t)}finally{o.f()}r.setLineDash([])}else this.load(t.redraw)}},{key:"load",value:(o=pc().m(function t(e){var n,r,o,i,a,u;return pc().w(function(t){for(;;)switch(t.p=t.n){case 0:if(this.url){t.n=1;break}return console.log("Failed loading boundaries: No URL specified. "+this.url),this.loadingStatus="failed",this.labels=[],t.a(2);case 1:if("notLoaded"==this.loadingStatus){t.n=2;break}return t.a(2);case 2:return this.loadingStatus="loading",t.p=3,t.n=4,Wr(this.url);case 4:if(n=t.v,r=n.features,!this.preprocess){t.n=13;break}this.fs=[],o=bc(r),t.p=5,o.s();case 6:if((i=o.n()).done){t.n=9;break}if(a=i.value,0!=this.preprocess(a)){t.n=7;break}return t.a(3,8);case 7:this.fs.push(a);case 8:t.n=6;break;case 9:t.n=11;break;case 10:t.p=10,u=t.v,o.e(u);case 11:return t.p=11,o.f(),t.f(11);case 12:t.n=14;break;case 13:this.fs=r;case 14:this.loadingStatus="loaded",e&&e(),t.n=16;break;case 15:t.p=15,t.v,console.log("Failed loading boundaries from "+this.url),this.fs=[],this.loadingStatus="failed";case 16:return t.a(2)}},t,this,[[5,10,11,12],[3,15]])}),i=function(){var t=this,e=arguments;return new Promise(function(n,r){var i=o.apply(t,e);function a(t){dc(i,n,r,a,u,"next",t)}function u(t){dc(i,n,r,a,u,"throw",t)}a(void 0)})},function(t){return i.apply(this,arguments)})}],r&&gc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o,i}(Cr);function jc(t){return jc="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},jc(t)}function Pc(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,kc(r.key),r)}}function kc(t){var e=function(t){if("object"!=jc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=jc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==jc(e)?e:e+""}var Tc=function(){return t=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.id&&(this.div=pt("#"+this.id)),this.div&&!this.div.empty()||(this.div=pt(document.createElement("div")),this.id&&this.div.attr("id",this.id)),this.div.style("background",this.background),this.div.style("padding",this.padding),this.div.style("border",this.border),this.div.style("border-radius",this["border-radius"]),this.div.style("box-shadow",this["box-shadow"]),this.div.style("font-family",this["font-family"]),this.title=e.title,this.titleFontSize=e.titleFontSize||"0.8em",this.titleFontWeight=e.titleFontWeight||"bold",this.labelFontSize=e.labelFontSize||"0.8em",this.labelUnitText=e.labelUnitText||"",this.labelFormat=e.labelFormat},e=[{key:"makeTitle",value:function(){this.title&&this.div.append("div").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).style("margin-bottom","7px").text(this.title)}},{key:"style",value:function(t,e){return 1==arguments.length?this.div.style(t):(this.div.style(t,e),this)}},{key:"update",value:function(){console.error("Legend update not implemented yet.")}}],e&&Pc(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Cc(t){return Cc="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},Cc(t)}function Ec(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,Ac(r.key),r)}}function Ac(t){var e=function(t){if("object"!=Cc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Cc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cc(e)?e:e+""}function Mc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Mc=function(){return!!t})()}function zc(t){return zc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zc(t)}function Rc(t,e){return Rc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Rc(t,e)}var Ic=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=zc(e),function(t,e){if(e&&("object"==Cc(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)}(t,Mc()?Reflect.construct(e,n||[],zc(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.colorScale=t.colorScale,n.textScale=t.textScale||function(t){return t},n.margin=t.margin||5,n.tickSize=t.tickSize||6,n.ticks=t.ticks||Math.floor(n.width/50),n.tickFormat=t.tickFormat,n.tickUnit=t.tickUnit,n.fontSize=t.fontSize||"0.8em",n.invert=t.invert,n.width=t.width||300,n.height=t.height||15,n}return 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&&Rc(t,e)}(e,t),n=e,r=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();for(var e=this.width+2*this.margin,n=this.height+this.margin+this.tickSize+10,r=this.div.append("svg").attr("width",e).attr("height",n).append("g").attr("transform","translate("+this.margin+" 0)"),o=this.width,i=this.height,a=0;a<o;a+=5){var u=a/(o-1);this.invert&&(u=1-u),r.append("rect").attr("x",a).attr("y",0).attr("width",5).attr("height",i).style("fill",this.colorScale(u,t.viewScale))}for(var l=0;l<this.ticks;l++){var c=l/(this.ticks-1);r.append("line").attr("x1",o*c).attr("y1",0).attr("x2",o*c).attr("y2",i+this.tickSize).style("stroke","black"),r.append("text").attr("id","ticklabel_"+l).attr("x",o*c).attr("y",i+this.tickSize+2).style("font-size",this.fontSize).style("text-anchor",0==l?"start":l==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?this.tickFormat:function(t){return t},f=0;f<this.ticks;f++){var h=f/(this.ticks-1),y=this.textScale(h,t.viewScale),p=(y?s(y):"0")+(this.tickUnit?this.tickUnit:"");null!=p&&this.div.select("#ticklabel_"+f).text(p)}}}],r&&Ec(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tc);function Fc(t){return Fc="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},Fc(t)}function Bc(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,Nc(r.key),r)}}function Nc(t){var e=function(t){if("object"!=Fc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fc(e)?e:e+""}function Lc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Lc=function(){return!!t})()}function Dc(t){return Dc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dc(t)}function Gc(t,e){return Gc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gc(t,e)}var Wc=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Dc(e),function(t,e){if(e&&("object"==Fc(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)}(t,Lc()?Reflect.construct(e,n||[],Dc(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.colors=t.colors,n.breaks=t.breaks,n.width=t.width||300,n.height=t.height||15,n.tickSize=t.tickSize||3,n.invert=t.invert,n}return 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&&Gc(t,e)}(e,t),n=e,(r=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();var e=this.colors(t.viewScale),n=this.breaks(t.viewScale);if(n){var r=e.length;if(0!=r){for(var o=this.width/r,i=this.div.append("svg").attr("width",this.width).attr("height",this.height+this.tickSize+2+10),a=0;a<r;a++)i.append("rect").attr("x",a*o).attr("y",0).attr("width",o).attr("height",this.height).style("fill",e[a]);for(var u=1;u<r;u++)i.append("line").attr("x1",o*u).attr("y1",0).attr("x2",o*u).attr("y2",this.height+this.tickSize).style("stroke","black");for(var l=1;l<r;l++){var c=n[l-1];isNaN(c)||null==c||(this.labelFormat&&(c=this.labelFormat(c,l)),i.append("text").attr("id","ticklabel_"+l).attr("x",o*l).attr("y",this.height+this.tickSize+2).style("font-size",this.labelFontSize).style("text-anchor","middle").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none").text(c))}}}}}])&&Bc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tc);function Uc(t){return Uc="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},Uc(t)}function $c(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,Hc(r.key),r)}}function Hc(t){var e=function(t){if("object"!=Uc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Uc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Uc(e)?e:e+""}function qc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(qc=function(){return!!t})()}function Yc(t){return Yc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yc(t)}function Vc(t,e){return Vc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vc(t,e)}var Zc=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=Yc(e),function(t,e){if(e&&("object"==Uc(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)}(t,qc()?Reflect.construct(e,n||[],Yc(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.colorLabel=t.colorLabel||[["gray","-"]],n.shape=t.shape||"circle",n.dimension=t.dimension||{r:8},n.strokeColor=t.strokeColor||"gray",n.strokeWidth=t.strokeWidth||1,n}return 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&&Vc(t,e)}(e,t),n=e,(r=[{key:"update",value:function(){this.div.selectAll("*").remove(),this.makeTitle();var t=this.colorLabel.length;if(0!=t)for(var e=0;e<t;e++){var n=this.colorLabel[e],r=this.div.append("div"),o=this.strokeWidth;if("square"===this.shape){var i=this.dimension.h||15,a=this.dimension.w||20;r.append("div").style("display","inline").append("svg").attr("width",a+2*o).attr("height",i+2*o).append("rect").attr("x",o).attr("y",o).attr("width",a).attr("height",i).style("fill",n[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}else{if("circle"!==this.shape)throw new Error("Unexpected shape:"+this.shape);var u=this.dimension.r||8,l=2*u+2*o;r.append("div").style("display","inline").append("svg").attr("width",l).attr("height",l).append("circle").attr("cx",u+o).attr("cy",u+o).attr("r",u).style("fill",n[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}r.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(n[1])}}}])&&$c(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tc);function Xc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Jc(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[8,6,5,4,2.5,2],r=Math.pow(10,Math.floor(Math.log10(t))),o=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 Xc(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xc(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}}}}(n);try{for(o.s();!(e=o.n()).done;){var i=e.value;if(r*i<=t)return r*i}}catch(t){o.e(t)}finally{o.f()}return r}function Kc(t){return Kc="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},Kc(t)}function Qc(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 ts(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ts(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 ts(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function es(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,ns(r.key),r)}}function ns(t){var e=function(t){if("object"!=Kc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Kc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Kc(e)?e:e+""}function rs(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(rs=function(){return!!t})()}function os(t){return os=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},os(t)}function is(t,e){return is=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},is(t,e)}var as=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=os(e),function(t,e){if(e&&("object"==Kc(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)}(t,rs()?Reflect.construct(e,n||[],os(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.label=t.label||void 0,n.size=t.size||void 0,n.shape=t.shape||"circle",n.fillColor=t.fillColor||"none",n.strokeColor=t.strokeColor||"gray",n.strokeWidth=t.strokeWidth||1,n.color=t.color||"gray",n.length=t.length||function(t,e,n){return t},n}return 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&&is(t,e)}(e,t),n=e,(r=[{key:"update",value:function(t){var e=this;this.div.selectAll("*").remove(),this.makeTitle();var n,r=this.label(t.viewScale,t.cells,t.resolution,t.z);if(n=this.size?this.size(t.viewScale,t.resolution,t.z)/t.z:t.viewScale(+r)/t.z){this.labelFormat&&!isNaN(+r)&&(r=this.labelFormat(r));var o=this.div.append("div"),i=function(){return o.append("svg").attr("width",n+e.strokeWidth+2).attr("height",n+e.strokeWidth+2).style("","inline-block")};if("square"===this.shape)i().append("rect").attr("x",0).attr("y",0).attr("width",n).attr("height",n).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth);else if("circle"===this.shape){var a=.5*(n+this.strokeWidth);i().append("circle").attr("cx",a+1).attr("cy",a+1).attr("r",a).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}else if("donut"===this.shape);else if("diamond"===this.shape);else{if("line"!==this.shape)throw new Error("Unexpected shape:"+this.shape);var u=this.length?this.length(t.resolution,t.z,t.viewScale):t.resolution;u/=t.z,o.append("svg").attr("width",u).attr("height",n).style("","inline-block").append("line").attr("x1",0).attr("y1",n/2).attr("x2",u).attr("y2",n/2).style("stroke",this.color).style("stroke-width",n)}o.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(r+(this.labelUnitText?" ":"")+this.labelUnitText)}}}])&&es(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tc);function us(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=[],i=Qc(t);try{var a=function(){var i=n.value;r.title=i==t[0]?r.title:void 0,r.size=function(){return e(i)},r.label=function(){return i},o.push(new as(r))};for(i.s();!(n=i.n()).done;)a()}catch(t){i.e(t)}finally{i.f()}return o}function ls(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.k||[.9,.5,.2,.05],o=[],i=Qc(r);try{var a=function(){var i=e.value;n.title=i==r[0]?n.title:void 0,n.label=function(e,n){return Jc(i*Ia(n,t))},o.push(new as(n))};for(i.s();!(e=i.n()).done;)a()}catch(t){i.e(t)}finally{i.f()}return o}function cs(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.labelFormat||function(t){return t},o=n.labelText||fs(r),i=[],a=function(r){n.title=r==e.length-1?n.title:void 0,n.size=function(){return e[r]},n.label=function(){return o(t[r-1],t[r])},i.push(new as(n))},u=e.length-1;u>=0;u--)a(u);return i}function ss(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.labelFormat||function(t){return t},r=e.labelText||fs(n),o=[],i=e.viewScaleFun||function(t){return t},a=function(n){e.title=n==t-1?e.title:void 0,e.size=function(t){return i(t).values[n]},e.label=function(t){return r(i(t).breaks[n-1],i(t).breaks[n])},o.push(new as(e))},u=t-1;u>=0;u--)a(u);return o}function fs(t){return function(e,n){return null==e&&null==n?"":null==n?"> "+t(e):null==e?"< "+t(n):t(e)+" - "+t(n)}}function hs(t){return hs="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},hs(t)}function ys(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,ps(r.key),r)}}function ps(t){var e=function(t){if("object"!=hs(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=hs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==hs(e)?e:e+""}function vs(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(vs=function(){return!!t})()}function ds(t){return ds=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ds(t)}function bs(t,e){return bs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bs(t,e)}var ms=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=ds(e),function(t,e){if(e&&("object"==hs(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)}(t,vs()?Reflect.construct(e,n||[],ds(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.orientation=t.orientation||0,n.color=t.color||function(t,e,n){return"gray"},n.width=t.width||function(t,e,n){return 3*e},n.length=t.length||function(t,e,n){return t},n.label=t.label||"-",n}return 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&&bs(t,e)}(e,t),n=e,r=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();var e=this.div.append("div"),n=this.color(t.resolution,t.z,t.viewScale),r=this.width(t.resolution,t.z,t.viewScale)/t.z,o=this.length(t.resolution,t.z,t.viewScale)/t.z,i=Math.max(o,r),a=e.append("svg").attr("width",i).attr("height",i).style("","inline-block"),u=Math.cos(-this.orientation*Math.PI/180),l=Math.sin(-this.orientation*Math.PI/180),c=.5*i,s=.5*o;a.append("line").attr("x1",c-u*s).attr("y1",c-l*s).attr("x2",c+u*s).attr("y2",c+l*s).style("stroke",n).style("stroke-width",r),e.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(this.label+(this.labelUnitText?" ":"")+this.labelUnitText)}}],r&&ys(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tc);function gs(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[],o=0;o<t.length;o++)n.title=0==o?n.title:void 0,n.orientation=t[o],n.label=e[o],r.push(new ms(n));return r}function ws(t){return ws="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},ws(t)}function xs(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,Ss(r.key),r)}}function Ss(t){var e=function(t){if("object"!=ws(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ws(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ws(e)?e:e+""}function Os(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Os=function(){return!!t})()}function _s(t){return _s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_s(t)}function js(t,e){return js=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},js(t,e)}var Ps=function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),n=function(t,e,n){return e=_s(e),function(t,e){if(e&&("object"==ws(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)}(t,Os()?Reflect.construct(e,n||[],_s(t).constructor):e.apply(t,n))}(this,e,[t]),t=t||{},n.classifier=t.classifier,n.width=t.width||150,n.selectionColor=n.selectionColor||"red",n.tooltip=t.tooltip,n.texts=t.texts,n.leftText=t.leftText||"Category 0",n.topText=t.topText||"Category 1",n.rightText=t.rightText||"Category 2",n.centerCoefficient=t.centerCoefficient||n.classifier.centerCoefficient,n}return 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&&js(t,e)}(e,t),n=e,r=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();var e=this.width,n=.866025*e,r=this.classifier,o=this.selectionColor,i=this.tooltip,a=this.texts||{},u=this.div.append("svg").attr("width",e+0).attr("height",n+8+24);u.append("text").attr("x",e/2).attr("y",14).text(this.topText).attr("font-size",12).attr("text-anchor","middle"),u.append("text").attr("x",0).attr("y",30+n).text(this.leftText).attr("font-size",12).attr("text-anchor","start"),u.append("text").attr("x",e).attr("y",30+n).text(this.rightText).attr("font-size",12).attr("text-anchor","end");var l=u.append("g").attr("transform","translate(0 16)"),c=function(t,e,n){t.attr("fill",e).on("mouseover",function(t){pt(this).attr("fill",o),i&&n&&(i.html(n),i.setPosition(t),i.show())}).on("mouseout",function(){pt(this).attr("fill",e),i&&i.hide()}),i&&n&&t.on("mousemove",function(t){i.setPosition(t)})};c(l.append("polygon").attr("points","0,"+n+" "+e/3+","+n+" "+e/2+","+2*n/3+" "+e/6+","+2*n/3),r.colors[0],a[0]),c(l.append("polygon").attr("points",e/2+",0 "+2*e/3+","+n/3+" "+e/2+","+2*n/3+" "+e/3+","+n/3),r.colors[1],a[1]),c(l.append("polygon").attr("points",e+","+n+" "+5*e/6+","+2*n/3+" "+e/2+","+2*n/3+" "+2*e/3+","+n),r.colors[2],a[2]),c(l.append("polygon").attr("points",e/2+","+2*n/3+" "+5*e/6+","+2*n/3+" "+2*e/3+","+n/3),r.mixColors[0],a.m12),c(l.append("polygon").attr("points",e/2+","+2*n/3+" "+e/3+","+n+" "+2*e/3+","+n),r.mixColors[1],a.m02),c(l.append("polygon").attr("points",e/2+","+2*n/3+" "+e/6+","+2*n/3+" "+e/3+","+n/3),r.mixColors[2],a.m01),this.centerCoefficient&&c(l.append("circle").attr("cx",e/2).attr("cy",2*n/3).attr("r",this.centerCoefficient*n/3),r.centerColor,a.center)}}],r&&xs(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tc),ks=function(t){return t};ks.invert=ks;var Ts=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(0==t)return ks;var e=Math.exp(t)-1,n=function(n){return(Math.exp(n*t)-1)/e};return n.invert=function(n){return Math.log(e*n+1)/t},n},Cs=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(0==t)return ks;var e=Math.exp(t),n=1-e,r=function(r){return 1-Math.log(e+r*n)/t};return r.invert=function(r){return(Math.exp((1-r)*t)-e)/n},r},Es=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(1==t)return ks;var e=function(e){return Math.pow(e,t)},n=1/t;return e.invert=function(t){return Math.pow(t,n)},e},As=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(1==t)return ks;var e=1/t,n=function(t){return 1-Math.pow(1-t,e)};return n.invert=function(e){return 1-Math.pow(1-e,t)},n},Ms=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;if(0==t)return ks;if(1==t)return function(t){return Math.sqrt(t*(2-t))};var e=t/(1-t);return function(t){return Math.sqrt(1/(e*e)+t*(2/e+2-t))-1/e}},zs=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;if(0==t)return ks;var e=Ms(t);return function(t){return 1-e(1-t)}};const Rs=Math.PI/180,Is=180/Math.PI,Fs=.96422,Bs=.82521,Ns=4/29,Ls=6/29,Ds=3*Ls*Ls,Gs=Ls*Ls*Ls;function Ws(t){if(t instanceof $s)return new $s(t.l,t.a,t.b,t.opacity);if(t instanceof Zs)return Xs(t);t instanceof Ae||(t=Ce(t));var e,n,r=Vs(t.r),o=Vs(t.g),i=Vs(t.b),a=Hs((.2225045*r+.7168786*o+.0606169*i)/1);return r===o&&o===i?e=n=a:(e=Hs((.4360747*r+.3850649*o+.1430804*i)/Fs),n=Hs((.0139322*r+.0971045*o+.7141733*i)/Bs)),new $s(116*a-16,500*(e-a),200*(a-n),t.opacity)}function Us(t,e,n,r){return 1===arguments.length?Ws(t):new $s(t,e,n,null==r?1:r)}function $s(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Hs(t){return t>Gs?Math.pow(t,1/3):t/Ds+Ns}function qs(t){return t>Ls?t*t*t:Ds*(t-Ns)}function Ys(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Vs(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Zs(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function Xs(t){if(isNaN(t.h))return new $s(t.l,0,0,t.opacity);var e=t.h*Rs;return new $s(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function Js(t,e){var n=He((t=Us(t)).l,(e=Us(e)).l),r=He(t.a,e.a),o=He(t.b,e.b),i=He(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=o(e),t.opacity=i(e),t+""}}function Ks(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)||function(t,e){if(t){if("string"==typeof t)return Qs(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qs(t,e):void 0}}(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 Qs(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}le($s,Us,ce(se,{brighter(t){return new $s(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new $s(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new Ae(Ys(3.1338561*(e=Fs*qs(e))-1.6168667*(t=1*qs(t))-.4906146*(n=Bs*qs(n))),Ys(-.9787684*e+1.9161415*t+.033454*n),Ys(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),le(Zs,function(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof Zs)return new Zs(t.h,t.c,t.l,t.opacity);if(t instanceof $s||(t=Ws(t)),0===t.a&&0===t.b)return new Zs(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Is;return new Zs(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new Zs(t,e,n,null==r?1:r)},ce(se,{brighter(t){return new Zs(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new Zs(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return Xs(this).rgb()}}));var tf=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t[0],o=t[1],i=t[2],a=Ks(n.center||[1/3,1/3,1/3],3),u=a[0],l=a[1],c=a[2],s=null==n.withMixedClasses||n.withMixedClasses,f=n.centerCoefficient?1-n.centerCoefficient:void 0,h=function(t){var n=e(t);if(n){var a=+t[r]/n,h=+t[o]/n,y=+t[i]/n;return a>=u&&h<=l&&y<=c?null!=f&&(y-c)*(l-f*l)>=(h-f*l)*(f*c-c)?"center":"0":a<=u&&h>=l&&y<=c?null!=f&&(y-c)*(u-f*u)>=(a-f*u)*(f*c-c)?"center":"1":a<=u&&h<=l&&y>=c?null!=f&&(h-l)*(u-f*u)>=(a-f*u)*(f*l-l)?"center":"2":a<=u&&h>=l&&y>=c?null!=f&&a>f*u?"center":s?"m12":h>y?"1":"2":a>=u&&h<=l&&y>=c?null!=f&&h>f*l?"center":s?"m02":a>y?"0":"2":a>=u&&h>=l&&y<=c?null!=f&&y>f*c?"center":s?"m01":h>a?"1":"0":"unknown"}};return h.center=[u,l,c],h.centerCoefficient=n.centerCoefficient,h},ef=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=Ks(n||["red","green","blue"],3),i=o[0],a=o[1],u=o[2],l=r.colorInterpolation||Js,c=null==r.withMixedClasses||r.withMixedClasses,s=function(t,e){return l(t,e)(.5)},f=Ks(r.mixedColors||c?[s(a,u),s(i,u),s(i,a)]:[],3),h=f[0],y=f[1],p=f[2],v=r.centerColor||l(s(i,a),u)(.333),d=tf(t,e,r),b=function(t){var e=d(t);return"0"==e?i:"1"==e?a:"2"==e?u:"m12"==e?h:"m02"==e?y:"m01"==e?p:"center"==e?v:r.defaultColor||"black"};return b.center=d.center,b.centerCoefficient=r.centerCoefficient,b.colors=[i,a,u],b.mixColors=[h,y,p],b.centerColor=v,b.classifier=d,b};function nf(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 rf,of=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function af(t){if(!(e=of.exec(t)))throw new Error("invalid format: "+t);var e;return new uf({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 uf(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 lf(t,e){var n=nf(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")}af.prototype=uf.prototype,uf.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 cf={"%":(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)=>lf(100*t,e),r:lf,s:function(t,e){var n=nf(t,e);if(!n)return t+"";var r=n[0],o=n[1],i=o-(rf=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")+nf(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function sf(t){return t}var ff,hf=Array.prototype.map,yf=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function pf(t){return ff=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?sf:(e=hf.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?sf:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(hf.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=af(t)).fill,n=t.align,f=t.sign,h=t.symbol,y=t.zero,p=t.width,v=t.comma,d=t.precision,b=t.trim,m=t.type;"n"===m?(v=!0,m="g"):cf[m]||(void 0===d&&(d=12),b=!0,m="g"),(y||"0"===e&&"="===n)&&(y=!0,e="0",n="=");var g="$"===h?o:"#"===h&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",w="$"===h?i:/[%p]/.test(m)?l:"",x=cf[m],S=/[defgprs%]/.test(m);function O(t){var o,i,l,h=g,O=w;if("c"===m)O=x(t)+O,t="";else{var _=(t=+t)<0||1/t<0;if(t=isNaN(t)?s:x(Math.abs(t),d),b&&(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)),_&&0===+t&&"+"!==f&&(_=!1),h=(_?"("===f?f:c:"-"===f||"("===f?"":f)+h,O=("s"===m?yf[8+rf/3]:"")+O+(_&&"("===f?")":""),S)for(o=-1,i=t.length;++o<i;)if(48>(l=t.charCodeAt(o))||l>57){O=(46===l?a+t.slice(o+1):t.slice(o))+O,t=t.slice(0,o);break}}v&&!y&&(t=r(t,1/0));var j=h.length+t.length+O.length,P=j<p?new Array(p-j+1).join(e):"";switch(v&&y&&(t=r(P+t,P.length?p-O.length:1/0),P=""),n){case"<":t=h+t+O+P;break;case"=":t=h+P+t+O;break;case"^":t=P.slice(0,j=P.length>>1)+h+t+O+P.slice(j);break;default:t=P+h+t+O}return u(t)}return d=void 0===d?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),O.toString=function(){return t+""},O}return{format:f,formatPrefix:function(t,e){var n,r=f(((t=af(t)).type="f",t)),o=3*Math.max(-8,Math.min(8,Math.floor((n=e,((n=nf(Math.abs(n)))?n[1]:NaN)/3)))),i=Math.pow(10,-o),a=yf[8+o/3];return function(t){return r(i*t)+a}}}}(t),ff.format,ff.formatPrefix,ff}pf({thousands:",",grouping:[3],currency:["$",""]});var vf=In.getParameterByName;return pf({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),e})());