gridviz 3.0.20 → 3.0.21

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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(){}function n(t){return null==t?r: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:()=>Rc,BackgroundLayerImage:()=>Xc,BackgroundLayerWMS:()=>Wc,CSVGrid:()=>Eo,ColorCategoryLegend:()=>Wl,ColorDiscreteLegend:()=>Rl,ColorLegend:()=>El,CompositionStyle:()=>di,Dataset:()=>Rn,DotDensityStyle:()=>wa,GeoCanvas:()=>Lr,GeoJSONLayer:()=>bl,GridLayer:()=>Ec,ImageStyle:()=>gc,IsoFenceStyle:()=>uc,JSGrid:()=>Io,JoyPlotStyle:()=>ai,LabelLayer:()=>al,Layer:()=>Tn,LegoStyle:()=>hu,Map:()=>ln,MosaicStyle:()=>zu,MultiResolutionDataset:()=>Dn,NinjaStarStyle:()=>Gu,OrientationLegend:()=>fs,PillarStyle:()=>Gi,SegmentStyle:()=>_i,ShapeColorSizeStyle:()=>$o,SideCategoryStyle:()=>na,SideStyle:()=>Xi,SizeLegend:()=>Ql,SquareColorCategoryWebGLStyle:()=>Aa,SquareColorWebGLStyle:()=>ju,StrokeStyle:()=>Ko,Style:()=>Sn,TanakaStyle:()=>eu,TernaryLegend:()=>gs,TextStyle:()=>Mi,TiledGrid:()=>vo,TimeSeriesStyle:()=>Zu,circularInverseScale:()=>Ps,circularScale:()=>js,classifier:()=>Xa,colorClassifier:()=>Za,discreteColors:()=>Ja,exponentialScale:()=>xs,getParameterByName:()=>cf,logarithmicScale:()=>Ss,nice:()=>$l,orientationLegend:()=>hs,powerInverseScale:()=>_s,powerScale:()=>Os,sizeDiscreteLegend:()=>rs,sizeDiscreteViewScaleLegend:()=>ns,sizeLegend:()=>ts,sizeLegendViewScale:()=>es,ternaryClassifier:()=>qs,ternaryColorClassifier:()=>Vs,viewScale:()=>$a,viewScaleColor:()=>Ha,viewScaleColorQuantile:()=>qa,viewScaleCombination:()=>Va,viewScaleQuantile:()=>Ya});var c=Array.prototype.find;function l(){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,r,n,o,i){for(var a,u=0,c=e.length,l=i.length;u<l;++u)(a=e[u])?(a.__data__=i[u],n[u]=a):r[u]=new y(t,i[u]);for(;u<c;++u)(a=e[u])&&(o[u]=a)}function v(t,e,r,n,o,i,a){var u,c,l,s=new Map,f=e.length,h=i.length,p=new Array(f);for(u=0;u<f;++u)(c=e[u])&&(p[u]=l=a.call(c,c.__data__,u,e)+"",s.has(l)?o[u]=c:s.set(l,c));for(u=0;u<h;++u)l=a.call(t,i[u],u,i)+"",(c=s.get(l))?(n[u]=c,c.__data__=i[u],s.delete(l)):r[u]=new y(t,i[u]);for(u=0;u<f;++u)(c=e[u])&&s.get(p[u])===c&&(o[u]=c)}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+="",r=e.indexOf(":");return r>=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+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 r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}}function k(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function E(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function T(t){return function(){this.style.removeProperty(t)}}function C(t,e,r){return function(){this.style.setProperty(t,e,r)}}function A(t,e,r){return function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function M(t,e){return t.style.getPropertyValue(e)||E(t).getComputedStyle(t,null).getPropertyValue(e)}function z(t){return function(){delete this[t]}}function L(t,e){return function(){this[t]=e}}function R(t,e){return function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}}function I(t){return t.trim().split(/^|\s+/)}function F(t){return t.classList||new N(t)}function N(t){this._node=t,this._names=I(t.getAttribute("class")||"")}function B(t,e){for(var r=F(t),n=-1,o=e.length;++n<o;)r.add(e[n])}function D(t,e){for(var r=F(t),n=-1,o=e.length;++n<o;)r.remove(e[n])}function G(t){return function(){B(this,t)}}function W(t){return function(){D(this,t)}}function U(t,e){return function(){(e.apply(this,arguments)?B:D)(this,t)}}function $(){this.textContent=""}function Y(t){return function(){this.textContent=t}}function H(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function q(){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,r=this.namespaceURI;return r===g&&e.documentElement.namespaceURI===g?e.createElement(t):e.createElementNS(r,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 rt(){var t=this.parentNode;t&&t.removeChild(this)}function nt(){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 r,n=0,o=-1,i=e.length;n<i;++n)r=e[n],t.type&&r.type!==t.type||r.name!==t.name?e[++o]=r:this.removeEventListener(r.type,r.listener,r.options);++o?e.length=o:delete this.__on}}}function at(t,e,r){return function(){var n,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((n=o[a]).type===t.type&&n.name===t.name)return this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=i,n.options=r),void(n.value=e);this.addEventListener(t.type,i,r),n={type:t.type,name:t.name,value:e,listener:i,options:r},o?o.push(n):this.__on=[n]}}function ut(t,e,r){var n=E(t),o=n.CustomEvent;"function"==typeof o?o=new o(e,r):(o=n.document.createEvent("Event"),r?(o.initEvent(e,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function ct(t,e){return function(){return ut(this,t,e)}}function lt(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=n(t));for(var e=this._groups,r=e.length,o=new Array(r),i=0;i<r;++i)for(var a,u,c=e[i],l=c.length,s=o[i]=new Array(l),f=0;f<l;++f)(a=c[f])&&(u=t.call(a,a.__data__,f,c))&&("__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,r=e.length,n=[],o=[],a=0;a<r;++a)for(var u,c=e[a],l=c.length,s=0;s<l;++s)(u=c[s])&&(n.push(t.call(u,u.__data__,s,c)),o.push(u));return new ft(n,o)},selectChild:function(t){return this.select(null==t?l:function(t){return function(){return c.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,r=e.length,n=new Array(r),o=0;o<r;++o)for(var i,u=e[o],c=u.length,l=n[o]=[],s=0;s<c;++s)(i=u[s])&&t.call(i,i.__data__,s,u)&&l.push(i);return new ft(n,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,d);var r,n=e?v:p,o=this._parents,i=this._groups;"function"!=typeof t&&(r=t,t=function(){return r});for(var a=i.length,u=new Array(a),c=new Array(a),l=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=c[s]=new Array(g),x=u[s]=new Array(g);n(f,h,w,x,l[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=c,u._exit=l,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,r){var n=this.enter(),o=this,i=this.exit();return"function"==typeof t?(n=t(n))&&(n=n.selection()):n=n.append(t+""),null!=e&&(o=e(o))&&(o=o.selection()),null==r?i.remove():r(i),n&&o?n.merge(o).order():o},merge:function(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,o=r.length,i=n.length,a=Math.min(o,i),u=new Array(o),c=0;c<a;++c)for(var l,s=r[c],f=n[c],h=s.length,y=u[c]=new Array(h),p=0;p<h;++p)(l=s[p]||f[p])&&(y[p]=l);for(;c<o;++c)u[c]=r[c];return new ft(u,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var n,o=t[e],i=o.length-1,a=o[i];--i>=0;)(n=o[i])&&(a&&4^n.compareDocumentPosition(a)&&a.parentNode.insertBefore(n,a),a=n);return this},sort:function(t){function e(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}t||(t=m);for(var r=this._groups,n=r.length,o=new Array(n),i=0;i<n;++i){for(var a,u=r[i],c=u.length,l=o[i]=new Array(c),s=0;s<c;++s)(a=u[s])&&(l[s]=a);l.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,r=t.length;e<r;++e)for(var n=t[e],o=0,i=n.length;o<i;++o){var a=n[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,r=0,n=e.length;r<n;++r)for(var o,i=e[r],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 r=x(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((null==e?r.local?O:S:"function"==typeof e?r.local?k:P:r.local?j:_)(r,e))},style:function(t,e,r){return arguments.length>1?this.each((null==e?T:"function"==typeof e?A:C)(t,e,null==r?"":r)):M(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?z:"function"==typeof e?R:L)(t,e)):this.node()[t]},classed:function(t,e){var r=I(t+"");if(arguments.length<2){for(var n=F(this.node()),o=-1,i=r.length;++o<i;)if(!n.contains(r[o]))return!1;return!0}return this.each(("function"==typeof e?U:e?G:W)(r,e))},text:function(t){return arguments.length?this.each(null==t?$:("function"==typeof t?H:Y)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?q:("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 r="function"==typeof t?t:tt(t),o=null==e?et:"function"==typeof e?e:n(e);return this.select((function(){return this.insertBefore(r.apply(this,arguments),o.apply(this,arguments)||null)}))},remove:function(){return this.each(rt)},clone:function(t){return this.select(t?ot:nt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,r){var n,o,i=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");return r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),{type:t,name:e}}))}(t+""),a=i.length;if(!(arguments.length<2)){for(u=e?at:it,n=0;n<a;++n)this.each(u(i[n],e,r));return this}var u=this.node().__on;if(u)for(var c,l=0,s=u.length;l<s;++l)for(n=0,c=u[l];n<a;++n)if((o=i[n]).type===c.type&&o.name===c.name)return c.value},dispatch:function(t,e){return this.each(("function"==typeof e?lt:ct)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n,o=t[e],i=0,a=o.length;i<a;++i)(n=o[i])&&(yield n)}};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,r=arguments.length,n={};e<r;++e){if(!(t=arguments[e]+"")||t in n||/[\s.]/.test(t))throw new Error("illegal type: "+t);n[t]=[]}return new bt(n)}function bt(t){this._=t}function mt(t,e){for(var r,n=0,o=t.length;n<o;++n)if((r=t[n]).name===e)return r.value}function gt(t,e,r){for(var n=0,o=t.length;n<o;++n)if(t[n].name===e){t[n]=vt,t=t.slice(0,n).concat(t.slice(n+1));break}return null!=r&&t.push({name:e,value:r}),t}bt.prototype=dt.prototype={constructor:bt,on:function(t,e){var r,n,o=this._,i=(n=o,(t+"").trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.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(r=(t=i[a]).type)o[r]=gt(o[r],t.name,e);else if(null==e)for(r in o)o[r]=gt(o[r],t.name,null);return this}for(;++a<u;)if((r=(t=i[a]).type)&&(r=mt(o[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new bt(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,o=new Array(r),i=0;i<r;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,r=(n=this._[t]).length;i<r;++i)n[i].value.apply(e,o)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],o=0,i=n.length;o<i;++o)n[o].value.apply(e,r)}};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,r,n){function o(t,o){var i,a,u=t[0],c=t[1],l=t[2],s=o[0],f=o[1],h=o[2],y=s-u,p=f-c,v=y*y+p*p;if(v<1e-12)a=Math.log(h/l)/e,i=function(t){return[u+t*y,c+t*p,l*Math.exp(e*t*a)]};else{var d=Math.sqrt(v),b=(h*h-l*l+n*v)/(2*l*r*d),m=(h*h-l*l-n*v)/(2*h*r*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 n,o=t*a,i=Ot(g),s=l/(r*d)*(i*(n=e*o+g,((n=Math.exp(2*n))-1)/(n+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[u+s*y,c+s*p,l*i/Ot(e*o+g)]}}return i.duration=1e3*a*e/Math.SQRT2,i}return o.rho=function(e){var r=Math.max(.001,+e),n=r*r;return t(r,n,n*n)},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 r=e.ownerSVGElement||e;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,[(n=n.matrixTransform(e.getScreenCTM().inverse())).x,n.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,Et=0,Tt=0,Ct=0,At=0,Mt=0,zt=0,Lt="object"==typeof performance&&performance.now?performance:Date,Rt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function It(){return Mt||(Rt(Ft),Mt=Lt.now()+zt)}function Ft(){Mt=0}function Nt(){this._call=this._time=this._next=null}function Bt(t,e,r){var n=new Nt;return n.restart(t,e,r),n}function Dt(){Mt=(At=Lt.now())+zt,Et=Tt=0;try{!function(){It(),++Et;for(var t,e=Pt;e;)(t=Mt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Et}()}finally{Et=0,function(){for(var t,e,r=Pt,n=1/0;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:Pt=e);kt=t,Wt(n)}(),Mt=0}}function Gt(){var t=Lt.now(),e=t-At;e>1e3&&(zt-=e,At=t)}function Wt(t){Et||(Tt&&(Tt=clearTimeout(Tt)),t-Mt>24?(t<1/0&&(Tt=setTimeout(Dt,t-Lt.now()-zt)),Ct&&(Ct=clearInterval(Ct))):(Ct||(At=Lt.now(),Ct=setInterval(Gt,1e3)),Et=1,Rt(Dt)))}function Ut(t,e,r){var n=new Nt;return e=null==e?0:+e,n.restart((r=>{n.stop(),t(r+e)}),e,r),n}Nt.prototype=Bt.prototype={constructor:Nt,restart:function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?It():+r)+(null==e?0:+e),this._next||kt===this||(kt?kt._next=this:Pt=this,kt=this),this._call=t,this._time=r,Wt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wt())}};var $t=wt("start","end","cancel","interrupt"),Yt=[];function Ht(t,e,r,n,o,i){var a=t.__transition;if(a){if(r in a)return}else t.__transition={};!function(t,e,r){var n,o=t.__transition;function i(c){var l,s,f,h;if(1!==r.state)return u();for(l in o)if((h=o[l]).name===r.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[l]):+l<e&&(h.state=6,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete o[l])}if(Ut((function(){3===r.state&&(r.state=4,r.timer.restart(a,r.delay,r.time),a(c))})),r.state=2,r.on.call("start",t,t.__data__,r.index,r.group),2===r.state){for(r.state=3,n=new Array(f=r.tween.length),l=0,s=-1;l<f;++l)(h=r.tween[l].value.call(t,t.__data__,r.index,r.group))&&(n[++s]=h);n.length=s+1}}function a(e){for(var o=e<r.duration?r.ease.call(null,e/r.duration):(r.timer.restart(u),r.state=5,1),i=-1,a=n.length;++i<a;)n[i].call(t,o);5===r.state&&(r.on.call("end",t,t.__data__,r.index,r.group),u())}function u(){for(var n in r.state=6,r.timer.stop(),delete o[e],o)return;delete t.__transition}o[e]=r,r.timer=Bt((function(t){r.state=1,r.timer.restart(i,r.delay,r.time),r.delay<=t&&i(t-r.delay)}),0,r.time)}(t,r,{name:e,index:n,group:o,on:$t,tween:Yt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function qt(t,e){var r=Xt(t,e);if(r.state>0)throw new Error("too late; already scheduled");return r}function Vt(t,e){var r=Xt(t,e);if(r.state>3)throw new Error("too late; already running");return r}function Xt(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function Zt(t,e){var r,n,o,i=t.__transition,a=!0;if(i){for(o in e=null==e?null:e+"",i)(r=i[o]).name===e?(n=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(n?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete i[o]):a=!1;a&&delete t.__transition}}function Jt(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}var Kt,Qt=180/Math.PI,te={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ee(t,e,r,n,o,i){var a,u,c;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(c=t*r+e*n)&&(r-=t*c,n-=e*c),(u=Math.sqrt(r*r+n*n))&&(r/=u,n/=u,c/=u),t*n<e*r&&(t=-t,e=-e,c=-c,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*Qt,skewX:Math.atan(c)*Qt,scaleX:a,scaleY:u}}function re(t,e,r,n){function o(t){return t.length?t.pop()+" ":""}return function(i,a){var u=[],c=[];return i=t(i),a=t(a),function(t,n,o,i,a,u){if(t!==o||n!==i){var c=a.push("translate(",null,e,null,r);u.push({i:c-4,x:Jt(t,o)},{i:c-2,x:Jt(n,i)})}else(o||i)&&a.push("translate("+o+e+i+r)}(i.translateX,i.translateY,a.translateX,a.translateY,u,c),function(t,e,r,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:r.push(o(r)+"rotate(",null,n)-2,x:Jt(t,e)})):e&&r.push(o(r)+"rotate("+e+n)}(i.rotate,a.rotate,u,c),function(t,e,r,i){t!==e?i.push({i:r.push(o(r)+"skewX(",null,n)-2,x:Jt(t,e)}):e&&r.push(o(r)+"skewX("+e+n)}(i.skewX,a.skewX,u,c),function(t,e,r,n,i,a){if(t!==r||e!==n){var u=i.push(o(i)+"scale(",null,",",null,")");a.push({i:u-4,x:Jt(t,r)},{i:u-2,x:Jt(e,n)})}else 1===r&&1===n||i.push(o(i)+"scale("+r+","+n+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,u,c),i=a=null,function(t){for(var e,r=-1,n=c.length;++r<n;)u[(e=c[r]).i]=e.x(t);return u.join("")}}}var ne=re((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=re((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 r,n;return function(){var o=Vt(this,t),i=o.tween;if(i!==r)for(var a=0,u=(n=r=i).length;a<u;++a)if(n[a].name===e){(n=n.slice()).splice(a,1);break}o.tween=n}}function ae(t,e,r){var n,o;if("function"!=typeof r)throw new Error;return function(){var i=Vt(this,t),a=i.tween;if(a!==n){o=(n=a).slice();for(var u={name:e,value:r},c=0,l=o.length;c<l;++c)if(o[c].name===e){o[c]=u;break}c===l&&o.push(u)}i.tween=o}}function ue(t,e,r){var n=t._id;return t.each((function(){var t=Vt(this,n);(t.value||(t.value={}))[e]=r.apply(this,arguments)})),function(t){return Xt(t,n).value[e]}}function ce(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function le(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}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,r;return t=(t+"").trim().toLowerCase(),(e=de.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?ke(e):3===r?new Ae(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?Ee(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?Ee(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))?Ee(e[1],e[2],e[3],e[4]):(e=we.exec(t))?Ee(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=xe.exec(t))?Fe(e[1],e[2]/100,e[3]/100,1):(e=Se.exec(t))?Fe(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 Ee(t,e,r,n){return n<=0&&(t=e=r=NaN),new Ae(t,e,r,n)}function Te(t){return t instanceof se||(t=Pe(t)),t?new Ae((t=t.rgb()).r,t.g,t.b,t.opacity):new Ae}function Ce(t,e,r,n){return 1===arguments.length?Te(t):new Ae(t,e,r,null==n?1:n)}function Ae(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function Me(){return`#${Ie(this.r)}${Ie(this.g)}${Ie(this.b)}`}function ze(){const t=Le(this.opacity);return`${1===t?"rgb(":"rgba("}${Re(this.r)}, ${Re(this.g)}, ${Re(this.b)}${1===t?")":`, ${t})`}`}function Le(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Re(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ie(t){return((t=Re(t))<16?"0":"")+t.toString(16)}function Fe(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Be(t,e,r,n)}function Ne(t){if(t instanceof Be)return new Be(t.h,t.s,t.l,t.opacity);if(t instanceof se||(t=Pe(t)),!t)return new Be;if(t instanceof Be)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,o=Math.min(e,r,n),i=Math.max(e,r,n),a=NaN,u=i-o,c=(i+o)/2;return u?(a=e===i?(r-n)/u+6*(r<n):r===i?(n-e)/u+2:(e-r)/u+4,u/=c<.5?i+o:2-i-o,a*=60):u=c>0&&c<1?0:a,new Be(a,u,c,t.opacity)}function Be(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}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,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function Ue(t,e,r,n,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*r+(1+3*t+3*i-3*a)*n+a*o)/6}ce(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}),ce(Ae,Ce,le(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(Re(this.r),Re(this.g),Re(this.b),Le(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`#${Ie(this.r)}${Ie(this.g)}${Ie(this.b)}${Ie(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ze,toString:ze})),ce(Be,(function(t,e,r,n){return 1===arguments.length?Ne(t):new Be(t,e,r,null==n?1:n)}),le(se,{brighter(t){return t=null==t?he:Math.pow(he,t),new Be(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?fe:Math.pow(fe,t),new Be(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,r=this.l,n=r+(r<.5?r:1-r)*e,o=2*r-n;return new Ae(We(t>=240?t-240:t+120,o,n),We(t,o,n),We(t<120?t+240:t-120,o,n),this.opacity)},clamp(){return new Be(De(this.h),Ge(this.s),Ge(this.l),Le(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=Le(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 Ye(t,e){var r=e-t;return r?function(t,e){return function(r){return t+r*e}}(t,r):$e(isNaN(t)?e:t)}const He=function t(e){var r=function(t){return 1==(t=+t)?Ye:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):$e(isNaN(e)?r:e)}}(e);function n(t,e){var n=r((t=Ce(t)).r,(e=Ce(e)).r),o=r(t.g,e.g),i=r(t.b,e.b),a=Ye(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return n.gamma=t,n}(1);function qe(t){return function(e){var r,n,o=e.length,i=new Array(o),a=new Array(o),u=new Array(o);for(r=0;r<o;++r)n=Ce(e[r]),i[r]=n.r||0,a[r]=n.g||0,u[r]=n.b||0;return i=t(i),a=t(a),u=t(u),n.opacity=1,function(t){return n.r=i(t),n.g=a(t),n.b=u(t),n+""}}}qe((function(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),o=t[n],i=t[n+1],a=n>0?t[n-1]:2*o-i,u=n<e-1?t[n+2]:2*i-o;return Ue((r-n/e)*e,a,o,i,u)}})),qe((function(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),o=t[(n+e-1)%e],i=t[n%e],a=t[(n+1)%e],u=t[(n+2)%e];return Ue((r-n/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 r,n,o,i=Ve.lastIndex=Xe.lastIndex=0,a=-1,u=[],c=[];for(t+="",e+="";(r=Ve.exec(t))&&(n=Xe.exec(e));)(o=n.index)>i&&(o=e.slice(i,o),u[a]?u[a]+=o:u[++a]=o),(r=r[0])===(n=n[0])?u[a]?u[a]+=n:u[++a]=n:(u[++a]=null,c.push({i:a,x:Jt(r,n)})),i=Xe.lastIndex;return i<e.length&&(o=e.slice(i),u[a]?u[a]+=o:u[++a]=o),u.length<2?c[0]?function(t){return function(e){return t(e)+""}}(c[0].x):function(t){return function(){return t}}(e):(e=c.length,function(t){for(var r,n=0;n<e;++n)u[(r=c[n]).i]=r.x(t);return u.join("")})}function Je(t,e){var r;return("number"==typeof e?Jt:e instanceof Pe?He:(r=Pe(e))?(e=r,He):Ze)(t,e)}function Ke(t){return function(){this.removeAttribute(t)}}function Qe(t){return function(){this.removeAttributeNS(t.space,t.local)}}function tr(t,e,r){var n,o,i=r+"";return function(){var a=this.getAttribute(t);return a===i?null:a===n?o:o=e(n=a,r)}}function er(t,e,r){var n,o,i=r+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===n?o:o=e(n=a,r)}}function rr(t,e,r){var n,o,i;return function(){var a,u,c=r(this);if(null!=c)return(a=this.getAttribute(t))===(u=c+"")?null:a===n&&u===o?i:(o=u,i=e(n=a,c));this.removeAttribute(t)}}function nr(t,e,r){var n,o,i;return function(){var a,u,c=r(this);if(null!=c)return(a=this.getAttributeNS(t.space,t.local))===(u=c+"")?null:a===n&&u===o?i:(o=u,i=e(n=a,c));this.removeAttributeNS(t.space,t.local)}}function or(t,e){var r,n;function o(){var o=e.apply(this,arguments);return o!==n&&(r=(n=o)&&function(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}(t,o)),r}return o._value=e,o}function ir(t,e){var r,n;function o(){var o=e.apply(this,arguments);return o!==n&&(r=(n=o)&&function(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}(t,o)),r}return o._value=e,o}function ar(t,e){return function(){qt(this,t).delay=+e.apply(this,arguments)}}function ur(t,e){return e=+e,function(){qt(this,t).delay=e}}function cr(t,e){return function(){Vt(this,t).duration=+e.apply(this,arguments)}}function lr(t,e){return e=+e,function(){Vt(this,t).duration=e}}var sr=yt.prototype.constructor;function fr(t){return function(){this.style.removeProperty(t)}}var hr=0;function yr(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function pr(){return++hr}var vr=yt.prototype;yr.prototype=function(t){return yt().transition(t)}.prototype={constructor:yr,select:function(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=n(t));for(var o=this._groups,i=o.length,a=new Array(i),u=0;u<i;++u)for(var c,l,s=o[u],f=s.length,h=a[u]=new Array(f),y=0;y<f;++y)(c=s[y])&&(l=t.call(c,c.__data__,y,s))&&("__data__"in c&&(l.__data__=c.__data__),h[y]=l,Ht(h[y],e,r,y,h,Xt(c,r)));return new yr(a,this._parents,e,r)},selectAll:function(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=i(t));for(var n=this._groups,o=n.length,a=[],u=[],c=0;c<o;++c)for(var l,s=n[c],f=s.length,h=0;h<f;++h)if(l=s[h]){for(var y,p=t.call(l,l.__data__,h,s),v=Xt(l,r),d=0,b=p.length;d<b;++d)(y=p[d])&&Ht(y,e,r,d,p,v);a.push(p),u.push(l)}return new yr(a,u,e,r)},selectChild:vr.selectChild,selectChildren:vr.selectChildren,filter:function(t){"function"!=typeof t&&(t=a(t));for(var e=this._groups,r=e.length,n=new Array(r),o=0;o<r;++o)for(var i,u=e[o],c=u.length,l=n[o]=[],s=0;s<c;++s)(i=u[s])&&t.call(i,i.__data__,s,u)&&l.push(i);return new yr(n,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,o=r.length,i=Math.min(n,o),a=new Array(n),u=0;u<i;++u)for(var c,l=e[u],s=r[u],f=l.length,h=a[u]=new Array(f),y=0;y<f;++y)(c=l[y]||s[y])&&(h[y]=c);for(;u<n;++u)a[u]=e[u];return new yr(a,this._parents,this._name,this._id)},selection:function(){return new sr(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,r=pr(),n=this._groups,o=n.length,i=0;i<o;++i)for(var a,u=n[i],c=u.length,l=0;l<c;++l)if(a=u[l]){var s=Xt(a,e);Ht(a,t,r,l,u,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new yr(n,this._parents,t,r)},call:vr.call,nodes:vr.nodes,node:vr.node,size:vr.size,empty:vr.empty,each:vr.each,on:function(t,e){var r=this._id;return arguments.length<2?Xt(this.node(),r).on.on(t):this.each(function(t,e,r){var n,o,i=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?qt:Vt;return function(){var a=i(this,t),u=a.on;u!==n&&(o=(n=u).copy()).on(e,r),a.on=o}}(r,t,e))},attr:function(t,e){var r=x(t),n="transform"===r?oe:Je;return this.attrTween(t,"function"==typeof e?(r.local?nr:rr)(r,n,ue(this,"attr."+t,e)):null==e?(r.local?Qe:Ke)(r):(r.local?er:tr)(r,n,e))},attrTween:function(t,e){var r="attr."+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;var n=x(t);return this.tween(r,(n.local?or:ir)(n,e))},style:function(t,e,r){var n="transform"==(t+="")?ne:Je;return null==e?this.styleTween(t,function(t,e){var r,n,o;return function(){var i=M(this,t),a=(this.style.removeProperty(t),M(this,t));return i===a?null:i===r&&a===n?o:o=e(r=i,n=a)}}(t,n)).on("end.style."+t,fr(t)):"function"==typeof e?this.styleTween(t,function(t,e,r){var n,o,i;return function(){var a=M(this,t),u=r(this),c=u+"";return null==u&&(this.style.removeProperty(t),c=u=M(this,t)),a===c?null:a===n&&c===o?i:(o=c,i=e(n=a,u))}}(t,n,ue(this,"style."+t,e))).each(function(t,e){var r,n,o,i,a="style."+e,u="end."+a;return function(){var c=Vt(this,t),l=c.on,s=null==c.value[a]?i||(i=fr(e)):void 0;l===r&&o===s||(n=(r=l).copy()).on(u,o=s),c.on=n}}(this._id,t)):this.styleTween(t,function(t,e,r){var n,o,i=r+"";return function(){var a=M(this,t);return a===i?null:a===n?o:o=e(n=a,r)}}(t,n,e),r).on("end.style."+t,null)},styleTween:function(t,e,r){var n="style."+(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;return this.tween(n,function(t,e,r){var n,o;function i(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&function(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}(t,i,r)),n}return i._value=e,i}(t,e,null==r?"":r))},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,r;function n(){var n=t.apply(this,arguments);return n!==r&&(e=(r=n)&&function(t){return function(e){this.textContent=t.call(this,e)}}(n)),e}return n._value=t,n}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n,o=Xt(this.node(),r).tween,i=0,a=o.length;i<a;++i)if((n=o[i]).name===t)return n.value;return null}return this.each((null==e?ie:ae)(r,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?ar:ur)(e,t)):Xt(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?cr:lr)(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 r=e.apply(this,arguments);if("function"!=typeof r)throw new Error;Vt(this,t).ease=r}}(this._id,t))},end:function(){var t,e,r=this,n=r._id,o=r.size();return new Promise((function(i,a){var u={value:a},c={value:function(){0==--o&&i()}};r.each((function(){var r=Vt(this,n),o=r.on;o!==t&&((e=(t=o).copy())._.cancel.push(u),e._.interrupt.push(u),e._.end.push(c)),r.on=e})),0===o&&i()}))},[Symbol.iterator]:vr[Symbol.iterator]};var dr={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function br(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}yt.prototype.interrupt=function(t){return this.each((function(){Zt(this,t)}))},yt.prototype.transition=function(t){var e,r;t instanceof yr?(e=t._id,t=t._name):(e=pr(),(r=dr).time=It(),t=null==t?null:t+"");for(var n=this._groups,o=n.length,i=0;i<o;++i)for(var a,u=n[i],c=u.length,l=0;l<c;++l)(a=u[l])&&Ht(a,t,e,l,u,r||br(a,e));return new yr(n,this._parents,t,e)};const mr=t=>()=>t;function gr(t,{sourceEvent:e,target:r,transform:n,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:o}})}function wr(t,e,r){this.k=t,this.x=e,this.y=r}wr.prototype={constructor:wr,scale:function(t){return 1===t?this:new wr(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new wr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var xr=new wr(1,0,0);function Sr(t){t.stopImmediatePropagation()}function Or(t){t.preventDefault(),t.stopImmediatePropagation()}function _r(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function jr(){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 Pr(){return this.__zoom||xr}function kr(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Er(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tr(t,e,r){var n=t.invertX(e[0][0])-r[0][0],o=t.invertX(e[1][0])-r[1][0],i=t.invertY(e[0][1])-r[0][1],a=t.invertY(e[1][1])-r[1][1];return t.translate(o>n?(n+o)/2:Math.min(0,n)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Cr(t){return Cr="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},Cr(t)}function Ar(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Mr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,zr(n.key),n)}}function zr(t){var e=function(t){if("object"!=Cr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Cr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cr(e)?e:e+""}wr.prototype;var Lr=function(){function t(e){var r=this,n=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"),c=this.offscreenCanvas.getContext("2d");if(!u)throw"Impossible to create canvas 2D context";if(!c)throw"Impossible to create canvas 2D context";if(this.ctx=u,this.offscreenCtx=c,this.view={x:n,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 l=xr;(function(){var t,e,r,n=_r,o=jr,i=Tr,a=kr,u=Er,c=[0,1/0],l=[[-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",Pr).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(c[0],Math.min(c[1],e)))===t.k?t:new wr(e,t.x,t.y)}function b(t,e,r){var n=e[0]-r[0]*t.k,o=e[1]-r[1]*t.k;return n===t.x&&o===t.y?t:new wr(t.k,n,o)}function m(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function g(t,e,r,n){t.on("start.zoom",(function(){w(this,arguments).event(n).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).event(n).end()})).tween("zoom",(function(){var t=this,i=arguments,a=w(t,i).event(n),u=o.apply(t,i),c=null==r?m(u):"function"==typeof r?r.apply(t,i):r,l=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(c).concat(l/s.k),h.invert(c).concat(l/h.k));return function(t){if(1===t)t=h;else{var e=y(t),r=l/e[2];t=new wr(r,c[0]-e[0]*r,c[1]-e[1]*r)}a.zoom(null,t)}}))}function w(t,e,r){return!r&&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(n.apply(this,arguments)){var r=w(this,e).event(t),o=this.__zoom,u=Math.max(c[0],Math.min(c[1],o.k*Math.pow(2,a.apply(this,arguments)))),s=jt(t);if(r.wheel)r.mouse[0][0]===s[0]&&r.mouse[0][1]===s[1]||(r.mouse[1]=o.invert(r.mouse[0]=s)),clearTimeout(r.wheel);else{if(o.k===u)return;r.mouse=[s,o.invert(s)],Zt(this),r.start()}Or(t),r.wheel=setTimeout((function(){r.wheel=null,r.end()}),150),r.zoom("mouse",i(b(d(o,u),r.mouse[0],r.mouse[1]),r.extent,l))}}function O(t,...e){if(!r&&n.apply(this,arguments)){var o=t.currentTarget,a=w(this,e,!0).event(t),u=pt(t.view).on("mousemove.zoom",(function(t){if(Or(t),!a.moved){var e=t.clientX-s,r=t.clientY-f;a.moved=e*e+r*r>y}a.event(t).zoom("mouse",i(b(a.that.__zoom,a.mouse[0]=jt(t,o),a.mouse[1]),a.extent,l))}),!0).on("mouseup.zoom",(function(t){u.on("mousemove.zoom mouseup.zoom",null),function(t,e){var r=t.document.documentElement,n=pt(t).on("dragstart.drag",null);e&&(n.on("click.drag",St,xt),setTimeout((function(){n.on("click.drag",null)}),0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}(t.view,a.moved),Or(t),a.event(t).end()}),!0),c=jt(t,o),s=t.clientX,f=t.clientY;!function(t){var e=t.document.documentElement,r=pt(t).on("dragstart.drag",St,xt);"onselectstart"in e?r.on("selectstart.drag",St,xt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),Sr(t),a.mouse=[c,this.__zoom.invert(c)],Zt(this),a.start()}}function _(t,...e){if(n.apply(this,arguments)){var r=this.__zoom,a=jt(t.changedTouches?t.changedTouches[0]:t,this),u=r.invert(a),c=r.k*(t.shiftKey?.5:2),f=i(b(d(r,c),a,u),o.apply(this,e),l);Or(t),s>0?pt(this).transition().duration(s).call(g,f,a,t):pt(this).call(v.transform,f,a,t)}}function j(r,...o){if(n.apply(this,arguments)){var i,a,u,c,l=r.touches,s=l.length,f=w(this,o,r.changedTouches.length===s).event(r);for(Sr(r),a=0;a<s;++a)c=[c=jt(u=l[a],this),this.__zoom.invert(c),u.identifier],f.touch0?f.touch1||f.touch0[2]===c[2]||(f.touch1=c,f.taps=0):(f.touch0=c,i=!0,f.taps=1+!!t);t&&(t=clearTimeout(t)),i&&(f.taps<2&&(e=c[0],t=setTimeout((function(){t=null}),500)),Zt(this),f.start())}}function P(t,...e){if(this.__zooming){var r,n,o,a,u=w(this,e).event(t),c=t.changedTouches,s=c.length;for(Or(t),r=0;r<s;++r)o=jt(n=c[r],this),u.touch0&&u.touch0[2]===n.identifier?u.touch0[0]=o:u.touch1&&u.touch1[2]===n.identifier&&(u.touch1[0]=o);if(n=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;n=d(n,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(n,o,a),u.extent,l))}}function k(t,...n){if(this.__zooming){var o,i,a=w(this,n).event(t),u=t.changedTouches,c=u.length;for(Sr(t),r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),o=0;o<c;++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 l=pt(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return v.transform=function(t,e,r,n){var o=t.selection?t.selection():t;o.property("__zoom",Pr),t!==o?g(t,e,r,n):o.interrupt().each((function(){w(this,arguments).event(n).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},v.scaleBy=function(t,e,r,n){v.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),r,n)},v.scaleTo=function(t,e,r,n){v.transform(t,(function(){var t=o.apply(this,arguments),n=this.__zoom,a=null==r?m(t):"function"==typeof r?r.apply(this,arguments):r,u=n.invert(a),c="function"==typeof e?e.apply(this,arguments):e;return i(b(d(n,c),a,u),t,l)}),r,n)},v.translateBy=function(t,e,r,n){v.transform(t,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof r?r.apply(this,arguments):r),o.apply(this,arguments),l)}),null,n)},v.translateTo=function(t,e,r,n,a){v.transform(t,(function(){var t=o.apply(this,arguments),a=this.__zoom,u=null==n?m(t):"function"==typeof n?n.apply(this,arguments):n;return i(xr.translate(u[0],u[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof r?-r.apply(this,arguments):-r),t,l)}),n,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 gr(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:mr(+t),v):a},v.filter=function(t){return arguments.length?(n="function"==typeof t?t:mr(!!t),v):n},v.touchable=function(t){return arguments.length?(u="function"==typeof t?t:mr(!!t),v):u},v.extent=function(t){return arguments.length?(o="function"==typeof t?t:mr([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),v):o},v.scaleExtent=function(t){return arguments.length?(c[0]=+t[0],c[1]=+t[1],v):[c[0],c[1]]},v.translateExtent=function(t){return arguments.length?(l[0][0]=+t[0][0],l[1][0]=+t[1][0],l[0][1]=+t[0][1],l[1][1]=+t[1][1],v):[[l[0][0],l[0][1]],[l[1][0],l[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,n=l.k/e.k;if(1==n){var o=l.x-e.x,i=l.y-e.y;r.pan(o*r.view.z,-i*r.view.z)}else s(t,n);l=e,r.onZoomFun&&r.onZoomFun(t)})).on("start",(function(t){var e;r.canvasSave.c=document.createElement("canvas"),r.canvasSave.c.setAttribute("width",""+r.w),r.canvasSave.c.setAttribute("height",""+r.h),null===(e=r.canvasSave.c.getContext("2d"))||void 0===e||e.drawImage(r.canvas,0,0),r.canvasSave.dx=0,r.canvasSave.dy=0,r.canvasSave.f=1,r.onZoomStartFun&&r.onZoomStartFun(t)})).on("end",(function(t){r.redraw(),r.canvasSave={c:null,dx:0,dy:0,f:1},r.onZoomEndFun&&r.onZoomEndFun(t)}))(pt(this.canvas));var s=function(t,e){r.cancelCurrentRequests();var n=t.sourceEvent;if(n instanceof WheelEvent)r.zoom(e,r.pixToGeoX(n.offsetX),r.pixToGeoY(n.offsetY));else if(n instanceof TouchEvent){var o,i=0,a=0,u=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ar(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ar(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(n.targetTouches);try{for(u.s();!(o=u.n()).done;){var c=o.value;i+=c.clientX,a+=c.clientY}}catch(t){u.e(t)}finally{u.f()}i/=n.targetTouches.length,a/=n.targetTouches.length,r.zoom(e,r.pixToGeoX(i),r.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,r=[{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,r=this.view.y/this.view.z+.5*this.h;this.ctx.setTransform(t,0,0,-t,e,r),this.offscreenCtx.setTransform(t,0,0,-t,e,r)}},{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:"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:"pan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;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 r=1/this.view.z;this.canvasSave.dx-=t*r,this.canvasSave.dy+=e*r,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:"zoom",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.view.x,r=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 n=t*this.view.z;n<this.zoomExtent[0]&&(t=this.zoomExtent[0]/this.view.z),n>this.zoomExtent[1]&&(t=this.zoomExtent[1]/this.view.z),this.view.z*=t;var o=(e-this.view.x)*(1-t),i=(r-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.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(r)*(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:"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"),r=t.getParameterByName("y"),n=t.getParameterByName("z");null==e||null==e||isNaN(+e)||(this.view.x=+e),null==r||null==r||isNaN(+r)||(this.view.y=+r),null==n||null==n||isNaN(+n)||(this.view.z=+n)}}],n=[{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}}],r&&Mr(e.prototype,r),n&&Mr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Rr(t){return Rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rr(t)}function Ir(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Fr(n.key),n)}}function Fr(t){var e=function(t){if("object"!=Rr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Rr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rr(e)?e:e+""}var Nr=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(),r=t.clientX-e.left+this.xOffset,n=t.clientY-e.top-this.yOffset;this.tooltip.style("left",r+"px").style("top",n+"px"),this.ensureTooltipInsideContainer(t,e,this.tooltip.node())}},{key:"ensureTooltipInsideContainer",value:function(t,e,r){var n=r,o=e.width,i=e.height;if(n.offsetLeft+n.clientWidth>o){var a=t.clientX-n.clientWidth-this.xOffset;n.style.left=a+"px"}n.offsetTop+n.clientHeight>i&&(n.style.top=i-n.clientHeight+"px"),n.offsetTop<0&&(n.style.top="0px"),n.offsetLeft<0&&(n.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&&Ir(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Br(t){return Br="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},Br(t)}function Dr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Gr(n.key),n)}}function Gr(t){var e=function(t){if("object"!=Br(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Br(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Br(e)?e:e+""}var Wr=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}}])&&Dr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Ur(t){return Ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ur(t)}function $r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Yr(n.key),n)}}function Yr(t){var e=function(t){if("object"!=Ur(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ur(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ur(e)?e:e+""}function Hr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Hr=function(){return!!t})()}function qr(t){return qr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qr(t)}function Vr(t,e){return Vr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vr(t,e)}var Xr=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,r){return e=qr(e),function(t,e){if(e&&("object"==Ur(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,Hr()?Reflect.construct(e,r||[],qr(t).constructor):e.apply(t,r))}(this,e,[t])).onZoom=t.onZoom,r.delta=t.delta||.2,r.zoomInBtn=document.createElement("a"),r.zoomInBtn.id="zoom-in",r.zoomInBtn.className="gridviz-zoom-button",r.zoomInBtn.title="Zoom in",r.zoomInBtn.textContent="+",r.zoomInBtn.addEventListener("click",(function(t){r.zoomIn(t)})),r.zoomInBtn.addEventListener("mouseover",(function(){r.zoomInBtn.style.backgroundColor="lightgrey"})),r.zoomInBtn.addEventListener("mouseout",(function(){r.zoomInBtn.style.backgroundColor="#ffffff"})),r.zoomOutBtn=document.createElement("a"),r.zoomOutBtn.id="zoom-out",r.zoomOutBtn.className="gridviz-zoom-button",r.zoomOutBtn.title="Zoom out",r.zoomOutBtn.textContent="-",r.zoomOutBtn.addEventListener("click",(function(t){r.zoomOut(t)})),r.zoomOutBtn.addEventListener("mouseover",(function(){r.zoomOutBtn.style.backgroundColor="lightgrey"})),r.zoomOutBtn.addEventListener("mouseout",(function(){r.zoomOutBtn.style.backgroundColor="#ffffff"})),[r.zoomInBtn,r.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")})),r.style("height","unset"),r.style("display","unset"),t.x?r.style("left",t.x+"px"):r.style("right","10px"),t.y?r.style("top",t.y+"px"):r.style("top","10px"),r.div.node().appendChild(r.zoomInBtn),r.div.node().appendChild(r.zoomOutBtn),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&&Vr(t,e)}(e,t),r=e,n=[{key:"zoomIn",value:function(t){this.map.setZoom(this.map.getZoom()*(1-this.delta)).redraw(),this.onZoom&&this.onZoom(t)}},{key:"zoomOut",value:function(t){this.map.setZoom(this.map.getZoom()*(1+this.delta)).redraw(),this.onZoom&&this.onZoom(t)}}],n&&$r(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Wr);function Zr(t){return Zr="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},Zr(t)}function Jr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,en(n.key),n)}}function Kr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Kr=function(){return!!t})()}function Qr(t){return Qr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qr(t)}function tn(t,e){return tn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},tn(t,e)}function en(t){var e=function(t){if("object"!=Zr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Zr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Zr(e)?e:e+""}var rn=function(t){function e(t){var r,n,o,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Qr(e),function(t,e){if(e&&("object"==Zr(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,Kr()?Reflect.construct(e,r||[],Qr(t).constructor):e.apply(t,r))}(this,e,[t]),n=r,i=!1,(o=en(o="isFullscreen"))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i,r.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 ',r.defaultHeight=r.map.h,r.defaultWidth=r.map.w,r.div.on("click",(function(t){r.onClickFunction(t)})),r.div.on("mouseover",(function(t){r.style("background-color","lightgrey")})),r.div.on("mouseout",(function(t){r.style("background-color","#ffffff")})),t.x?r.style("left",t.x+"px"):r.style("right","10px"),t.y?r.style("top",t.y+"px"):r.style("top","90px"),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&&tn(t,e)}(e,t),r=e,(n=[{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()}}])&&Jr(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Wr);function nn(t){return nn="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},nn(t)}function on(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return an(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?an(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function an(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function un(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,cn(n.key),n)}}function cn(t){var e=function(t){if("object"!=nn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=nn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==nn(e)?e:e+""}var ln=function(){return t=function t(e,r){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=r||{},this.layers=r.layers||[],this.container=e||document.getElementById("gridviz"),this.container?(this.container.style.position="relative",this.w=r.w||this.container.offsetWidth,this.h=r.h||this.container.offsetHeight,this._canvas=r.canvas||this.initialiseCanvas(),this.geoCanvas=new Lr(this._canvas,r.x,r.y,r.z,r),this.geoCanvas.redraw=function(){n.redraw()},this.geoCanvas.cancelCurrentRequests=function(){var t,e=on(n.layers);try{for(e.s();!(t=e.n()).done;){var r,o,i,a=t.value;if(null!==(r=a.dataset)&&void 0!==r&&r.datasets){var u,c,l=on(null===(u=a.dataset)||void 0===u?void 0:u.datasets);try{for(l.s();!(c=l.n()).done;){var s=c.value;null!=s&&s.cancelCurrentRequests&&s.cancelCurrentRequests()}}catch(t){l.e(t)}finally{l.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=r.legendContainer?pt(r.legendContainer):null,this.legend||this.initialiseLegend(),r.tooltip||(r.tooltip={}),r.tooltip.parentElement||(r.tooltip.parentElement=this.container),this.tooltip=new Nr(r.tooltip),this.mouseOverHandler=function(t){return n.focusCell(t)},this.mouseMoveHandler=function(t){return n.focusCell(t)},this.mouseOutHandler=function(t){return n.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){r.onZoomStartFun&&r.onZoomStartFun(t),n.tooltip.hide()},this.canvasSave=null,this.selectionRectangleColor=r.selectionRectangleColor||"#FF6347",this.selectionRectangleWidthPix=r.selectionRectangleWidthPix||function(){return 4},this.transparentBackground=r.transparentBackground,this.defaultGlobalCompositeOperation=r.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,r=on(this.layers);try{for(r.s();!(e=r.n()).done;){var n=e.value;n.visible&&!n.visible(t)||(this.geoCanvas.offscreenCtx.globalAlpha=n.alpha?n.alpha(t):1,n.blendOperation&&(this.geoCanvas.offscreenCtx.globalCompositeOperation=n.blendOperation(t)),this.geoCanvas.setCanvasTransform(),n.draw(this.geoCanvas,this.legend),n.filterColor&&n.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,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){var e,r={x:this.geoCanvas.pixToGeoX(t.offsetX+this.tooltip.xMouseOffset),y:this.geoCanvas.pixToGeoY(t.offsetY+this.tooltip.yMouseOffset)},n=this.getCellFocusInfo(r);if(this.transparentBackground)return n?(this.tooltip.html(n.html),this.tooltip.setPosition(t),this.tooltip.show()):this.tooltip.hide(),this.canvasSave=document.createElement("canvas"),this.canvasSave.setAttribute("width",""+this.w),this.canvasSave.setAttribute("height",""+this.h),null===(e=this.canvasSave.getContext("2d"))||void 0===e||e.drawImage(this.geoCanvas.canvas,0,0),void this.geoCanvas.initCanvasTransform();if(n){var o;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===(o=this.canvasSave.getContext("2d"))||void 0===o||o.drawImage(this.geoCanvas.offscreenCanvas,0,0));var i=this.selectionRectangleWidthPix?this.selectionRectangleWidthPix(n.resolution,this.geoCanvas.view.z):4;this.geoCanvas.initCanvasTransform();var a=this.geoCanvas.offscreenCtx;a.strokeStyle=this.selectionRectangleColor,a.lineWidth=i,a.beginPath(),a.rect(this.geoCanvas.geoToPixX(n.cell.x)-i/2,this.geoCanvas.geoToPixY(n.cell.y)+i/2,n.resolution/this.geoCanvas.view.z+i,-n.resolution/this.geoCanvas.view.z-i),a.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,r=this.layers.length-1;r>=0;r--){var n=this.layers[r];if((!n.visible||n.visible(e))&&"none"!==n.cellInfoHTML&&n.cellInfoHTML&&n.getDataset){var o=n.getDataset(e);if(o){var i=o.getCellFromPosition(t,o.getViewCache());if(!i)return;if(o.mixedResolution){var a=+o.mixedResolution(i),u=n.cellInfoHTML(i,a);if(!u)return;return{cell:i,html:u,resolution:a}}var c=n.cellInfoHTML(i,o.getResolution());if(!c)return;return{cell:i,html:c,resolution:o.getResolution()}}}}}},{key:"setView",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.geoCanvas.view.x=t,this.geoCanvas.view.y=e,null!=r&&(this.geoCanvas.view.z=r),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 Xr({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 rn({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(r){if(Array.isArray(r)&&r.length){var n=t.container;n.clientWidth>0&&n.clientHeight>0&&(e||(e=!0,window.requestAnimationFrame((function(){e=!1,t.h===n.clientHeight&&t.w===n.clientWidth||(t.h=n.clientHeight,t.w=n.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&&un(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function sn(t){return sn="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},sn(t)}function fn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,hn(n.key),n)}}function hn(t){var e=function(t){if("object"!=sn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=sn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==sn(e)?e:e+""}var yn=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},(e=[{key:"drawFilter",value:function(t){if(this.filterColor){var e=this.filterColor(t.view.z);e&&"none"!=e&&(t.offscreenCtx.fillStyle=e,t.offscreenCtx.fillRect(0,0,t.w,t.h))}}}])&&fn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function pn(t){return pn="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},pn(t)}function vn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return dn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function dn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function bn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mn(n.key),n)}}function mn(t){var e=function(t){if("object"!=pn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=pn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pn(e)?e:e+""}function gn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(gn=function(){return!!t})()}function wn(t){return wn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wn(t)}function xn(t,e){return xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xn(t,e)}var Sn=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=wn(e),function(t,e){if(e&&("object"==pn(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,gn()?Reflect.construct(e,r||[],wn(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.viewScale=t.viewScale,r.filter=t.filter||void 0,r.offset=t.offset||function(t,e,r){return{dx:0,dy:0}},r.drawFun=t.drawFun,r.legends=[],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&&xn(t,e)}(e,t),r=e,o=[{key:"updateLegendsRecursive",value:function(t,e){if(Array.isArray(t)){var r,n=vn(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;this.updateLegendsRecursive(o,e)}}catch(t){n.e(t)}finally{n.f()}}else t.update(e)}}],(n=[{key:"draw",value:function(t,e,r){if(!this.drawFun)throw new Error("Method draw not implemented.");this.drawFun(t,e,r)}},{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,r=vn(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;this.legends.push(n)}}catch(t){r.e(t)}finally{r.f()}return this}}])&&bn(r.prototype,n),o&&bn(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(yn);function On(t){return On="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},On(t)}function _n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,jn(n.key),n)}}function jn(t){var e=function(t){if("object"!=On(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=On(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==On(e)?e:e+""}function Pn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Pn=function(){return!!t})()}function kn(t){return kn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kn(t)}function En(t,e){return En=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},En(t,e)}var Tn=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,r){return e=kn(e),function(t,e){if(e&&("object"==On(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,Pn()?Reflect.construct(e,r||[],kn(t).constructor):e.apply(t,r))}(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&&En(t,e)}(e,t),r=e,(n=[{key:"draw",value:function(t){throw new Error("Method draw not implemented.")}}])&&_n(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yn);function Cn(t){return Cn="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},Cn(t)}function An(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Mn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Mn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Mn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function zn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ln(n.key),n)}}function Ln(t){var e=function(t){if("object"!=Cn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Cn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cn(e)?e:e+""}var Rn=function(){return t=function t(e,r,n){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=r,this.resolution=n,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 r,n=An(e);try{for(n.s();!(r=n.n()).done;){var o=r.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){n.e(t)}finally{n.f()}}else{var a,u=this.getResolution(),c=An(e);try{for(c.s();!(a=c.n()).done;){var l=a.value;if(!(t.x<l.x||l.x+u<t.x||t.y<l.y||l.y+u<t.y))return l}}catch(t){c.e(t)}finally{c.f()}}}},{key:"getResolution",value:function(){return this.resolution}},{key:"getViewCache",value:function(){return this.cellsViewCache}},{key:"getDataset",value:function(t,e){return this}}])&&zn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function In(t){return In="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},In(t)}function Fn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Nn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Bn(n.key),n)}}function Bn(t){var e=function(t){if("object"!=In(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=In(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==In(e)?e:e+""}var Dn=function(){return t=function t(e,r){var n=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),n=n||{},this.resolutions=e,this.datasets="function"==typeof r?this.resolutions.map(r):r,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);n.preprocess&&this.setPrepocesses(n.preprocess)},(e=[{key:"getDataset",value:function(t,e){if(1==this.datasets.length)return this.datasets[0];for(var r=this.resolutions,n=0,o=r[n]/e;o<t&&n<r.length;)o=r[++n]/e;return n==r.length?this.datasets[r.length-1]:this.datasets[n]}},{key:"setPrepocesses",value:function(t){var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Fn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Fn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(this.datasets);try{for(r.s();!(e=r.n()).done;)e.value.preprocess=t}catch(t){r.e(t)}finally{r.f()}return this}}])&&Nn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Gn(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function Wn(t,e){return fetch(t,e).then(Gn)}var Un={},$n={};function Yn(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function Hn(t){var e=Object.create(null),r=[];return t.forEach((function(t){for(var n in t)n in e||r.push(e[n]=n)})),r}function qn(t,e){var r=t+"",n=r.length;return n<e?new Array(e-n+1).join(0)+r:r}function Vn(t){var e=new RegExp('["'+t+"\n\r]"),r=t.charCodeAt(0);function n(t,e){var n,o=[],i=t.length,a=0,u=0,c=i<=0,l=!1;function s(){if(c)return $n;if(l)return l=!1,Un;var e,n,o=a;if(34===t.charCodeAt(o)){for(;a++<i&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=i?c=!0:10===(n=t.charCodeAt(a++))?l=!0:13===n&&(l=!0,10===t.charCodeAt(a)&&++a),t.slice(o+1,e-1).replace(/""/g,'"')}for(;a<i;){if(10===(n=t.charCodeAt(e=a++)))l=!0;else if(13===n)l=!0,10===t.charCodeAt(a)&&++a;else if(n!==r)continue;return t.slice(o,e)}return c=!0,t.slice(o,i)}for(10===t.charCodeAt(i-1)&&--i,13===t.charCodeAt(i-1)&&--i;(n=s())!==$n;){for(var f=[];n!==Un&&n!==$n;)f.push(n),n=s();e&&null==(f=e(f,u++))||o.push(f)}return o}function o(e,r){return e.map((function(e){return r.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=(r=t).getUTCHours(),i=r.getUTCMinutes(),a=r.getUTCSeconds(),u=r.getUTCMilliseconds(),isNaN(r)?"Invalid Date":((n=r.getUTCFullYear())<0?"-"+qn(-n,6):n>9999?"+"+qn(n,6):qn(n,4))+"-"+qn(r.getUTCMonth()+1,2)+"-"+qn(r.getUTCDate(),2)+(u?"T"+qn(o,2)+":"+qn(i,2)+":"+qn(a,2)+"."+qn(u,3)+"Z":a?"T"+qn(o,2)+":"+qn(i,2)+":"+qn(a,2)+"Z":i||o?"T"+qn(o,2)+":"+qn(i,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t;var r,n,o,i,a,u}return{parse:function(t,e){var r,o,i=n(t,(function(t,n){if(r)return r(t,n-1);o=t,r=e?function(t,e){var r=Yn(t);return function(n,o){return e(r(n),o,t)}}(t,e):Yn(t)}));return i.columns=o||[],i},parseRows:n,format:function(e,r){return null==r&&(r=Hn(e)),[r.map(a).join(t)].concat(o(e,r)).join("\n")},formatBody:function(t,e){return null==e&&(e=Hn(t)),o(t,e).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}}var Xn=Vn(","),Zn=Xn.parse,Jn=(Xn.parseRows,Xn.format,Xn.formatBody,Xn.formatRows,Xn.formatRow,Xn.formatValue,Vn("\t")),Kn=Jn.parse;function Qn(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function to(t,e){return fetch(t,e).then(Qn)}function eo(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=void 0),to(e,r).then((function(e){return t(e,n)}))}}function ro(t,e,r,n){3===arguments.length&&"function"==typeof r&&(n=r,r=void 0);var o=Vn(t);return to(e,r).then((function(t){return o.parse(t,n)}))}Jn.parseRows,Jn.format,Jn.formatBody,Jn.formatRows,Jn.formatRow,Jn.formatValue;var no=eo(Zn);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 r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ao(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ao(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function ao(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function uo(){uo=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new C(n||[]);return o(a,"_invoke",{value:P(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",y="suspendedYield",p="executing",v="completed",d={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(A([])));S&&S!==r&&n.call(S,a)&&(w=S);var O=g.prototype=b.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==oo(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=k(u,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:y,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(oo(e)+" is not iterable")}return m.prototype=g,o(O,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},_(j.prototype),l(j.prototype,u,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(O),l(O,c,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function co(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function lo(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){co(i,n,o,a,u,"next",t)}function u(t){co(i,n,o,a,u,"throw",t)}a(void 0)}))}}function so(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,fo(n.key),n)}}function fo(t){var e=function(t){if("object"!=oo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=oo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==oo(e)?e:e+""}function ho(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ho=function(){return!!t})()}function yo(t){return yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yo(t)}function po(t,e){return po=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},po(t,e)}eo(Kn);var vo=function(t){function e(t,r){var n,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),(n=function(t,e,r){return e=yo(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,ho()?Reflect.construct(e,r||[],yo(t).constructor):e.apply(t,r))}(this,e,[t,r,0,o])).onlyDrawWhenAllTilesReady=o.onlyDrawWhenAllTilesReady||!1,n.info=void 0,n.infoLoadingStatus="notLoaded",n.cache={},n.loadInfo(),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&&po(t,e)}(e,t),r=e,n=[{key:"loadInfo",value:function(){var t=this;return this.info||"notLoaded"!==this.infoLoadingStatus?"loaded"!==this.infoLoadingStatus&&"failed"!==this.infoLoadingStatus||this.map.redraw():lo(uo().mark((function e(){var r;return uo().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Wn(t.url+"info.json");case 3:r=e.sent,t.info=r,t.resolution=r.resolutionGeo,t.infoLoadingStatus="loaded",t.map.redraw(),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),t.infoLoadingStatus="failed";case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))(),this}},{key:"getTilingEnvelope",value:function(t){if(this.info){var e=this.info.originPoint,r=this.info.resolutionGeo,n=this.info.tileSizeCell;return{xMin:Math.floor((t.xMin-e.x)/(r*n)),xMax:Math.floor((t.xMax-e.x)/(r*n)),yMin:Math.floor((t.yMin-e.y)/(r*n)),yMax:Math.floor((t.yMax-e.y)/(r*n))}}this.loadInfo()}},{key:"getData",value:(i=lo(uo().mark((function t(e){var r,n,o,i,a,u,c,l,s,f,h,y,p,v,d,b,m=this;return uo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.info){t.next=2;break}return t.abrupt("return",this);case 2:if(this.abortController=new AbortController,r=this.abortController.signal,n=this.getTilingEnvelope(e)){t.next=7;break}return t.abrupt("return",this);case 7:o=this.info.tilingBounds,i=o.xMin,a=o.xMax,u=o.yMin,c=o.yMax,l=Math.max(n.xMin,i),s=Math.min(n.xMax,a),f=Math.max(n.yMin,u),h=Math.min(n.yMax,c),y=(s-l+1)*(h-f+1),p=0,v=[],d=uo().mark((function t(e){var n,o;return uo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=uo().mark((function t(n){return uo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(m.cache[e]||(m.cache[e]={}),!m.cache[e][n]||"failed"===m.cache[e][n]){t.next=4;break}return++p,t.abrupt("return",1);case 4:m.cache[e][n]="loading",v.push(m.loadTile(e,n,r).then((function(t){m.cache[e][n]=t;var r=++p===y;m.checkAndRedraw(t,r)})).catch((function(){m.cache[e][n]="failed",++p})));case 6:case"end":return t.stop()}}),t)})),o=f;case 2:if(!(o<=h)){t.next=9;break}return t.delegateYield(n(o),"t0",4);case 4:if(!t.t0){t.next=6;break}return t.abrupt("continue",6);case 6:o++,t.next=2;break;case 9:case"end":return t.stop()}}),t)})),b=l;case 17:if(!(b<=s)){t.next=22;break}return t.delegateYield(d(b),"t0",19);case 19:b++,t.next=17;break;case 22:return t.next=24,Promise.allSettled(v);case 24:return t.abrupt("return",this);case 25:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"loadTile",value:(o=lo(uo().mark((function t(e,r,n){var o,i,a=this;return uo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,no("".concat(this.url).concat(e,"/").concat(r,".csv"),{signal:n});case 3:if(o=t.sent,i=this.preprocess?o.filter((function(t){return!1!==a.preprocess(t)})):o,this.info){t.next=7;break}throw new Error("Tile info unknown");case 7:return t.abrupt("return",bo(i,e,r,this.info));case 10:throw t.prev=10,t.t0=t.catch(0),"AbortError"===t.t0.name&&console.warn("Tile request for ".concat(e,", ").concat(r," was aborted.")),t.t0;case 14:case"end":return t.stop()}}),t,this,[[0,10]])}))),function(t,e,r){return o.apply(this,arguments)})},{key:"cancelCurrentRequests",value:function(){this.abortController&&this.abortController.abort()}},{key:"checkAndRedraw",value:function(t,e){var r,n=!1,o=this.map.getZoom(),i=io(this.map.layers);try{for(i.s();!(r=i.n()).done;){var a=r.value;if((!a.visible||a.visible(o))&&a.getDataset&&a.getDataset(o)==this){n=!0;break}}}catch(t){i.e(t)}finally{i.f()}if(n){var u=this.map.updateExtentGeo(),c=t.extGeo,l=c.xMin,s=c.xMax,f=c.yMin,h=c.yMax;u.xMax<=l||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 r=this.info.tilingBounds,n=Math.max(e.xMin,r.xMin);n<=Math.min(e.xMax,r.xMax);n++)if(this.cache[n])for(var o=Math.max(e.yMin,r.yMin);o<=Math.min(e.yMax,r.yMax);o++){var i=this.cache[n][o];if(i&&"string"!=typeof i){var a,u=io(i.cells);try{for(u.s();!(a=u.n()).done;){var c=a.value;+c.x+this.resolution<t.xMin||+c.x-this.resolution>t.xMax||+c.y+this.resolution<t.yMin||+c.y-this.resolution>t.yMax||this.cellsViewCache.push(c)}}catch(t){u.e(t)}finally{u.f()}}}}}}],n&&so(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i}(Rn);function bo(t,e,r,n){var o={};o.cells=t,o.x=e,o.y=r;var i=n.resolutionGeo,a=n.tileSizeCell;o.extGeo={xMin:n.originPoint.x+i*a*o.x,xMax:n.originPoint.x+i*a*(o.x+1),yMin:n.originPoint.y+i*a*o.y,yMax:n.originPoint.y+i*a*(o.y+1)};var u,c=io(o.cells);try{for(c.s();!(u=c.n()).done;){var l=u.value;l.x=o.extGeo.xMin+l.x*i,l.y=o.extGeo.yMin+l.y*i}}catch(t){c.e(t)}finally{c.f()}return o}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 go(){go=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new C(n||[]);return o(a,"_invoke",{value:P(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",y="suspendedYield",p="executing",v="completed",d={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(A([])));S&&S!==r&&n.call(S,a)&&(w=S);var O=g.prototype=b.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==mo(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=k(u,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:y,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(mo(e)+" is not iterable")}return m.prototype=g,o(O,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},_(j.prototype),l(j.prototype,u,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(O),l(O,c,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function wo(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return xo(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function xo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function So(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function Oo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_o(n.key),n)}}function _o(t){var e=function(t){if("object"!=mo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=mo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mo(e)?e:e+""}function jo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(jo=function(){return!!t})()}function Po(t){return Po=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Po(t)}function ko(t,e){return ko=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ko(t,e)}var Eo=function(t){function e(t,r,n){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,r){return e=Po(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,jo()?Reflect.construct(e,r||[],Po(t).constructor):e.apply(t,r))}(this,e,[t,r,n,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&&ko(t,e)}(e,t),r=e,n=[{key:"getData",value:function(t){var e,r=this;return"notLoaded"!=this.infoLoadingStatus||(this.infoLoadingStatus="loading",(e=go().mark((function t(){var e,n,o,i,a,u,c;return go().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,ro(r.delimiter,r.url);case 3:e=t.sent,n=wo(e);try{for(n.s();!(o=n.n()).done;)(i=o.value).x=+i.x,i.y=+i.y}catch(t){n.e(t)}finally{n.f()}if(!r.preprocess){t.next=29;break}r.cells=[],a=wo(e),t.prev=9,a.s();case 11:if((u=a.n()).done){t.next=19;break}if(c=u.value,0!=r.preprocess(c)){t.next=16;break}return t.abrupt("continue",17);case 16:r.cells.push(c);case 17:t.next=11;break;case 19:t.next=24;break;case 21:t.prev=21,t.t0=t.catch(9),a.e(t.t0);case 24:return t.prev=24,a.f(),t.finish(24);case 27:t.next=30;break;case 29:r.cells=e;case 30:r.map&&r.map.redraw(),r.infoLoadingStatus="loaded",t.next=38;break;case 34:t.prev=34,t.t1=t.catch(0),r.infoLoadingStatus="failed",r.cells=[];case 38:case"end":return t.stop()}}),t,null,[[0,34],[9,21,24,27]])})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){So(i,n,o,a,u,"next",t)}function u(t){So(i,n,o,a,u,"throw",t)}a(void 0)}))})()),this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,r=wo(this.cells);try{for(r.s();!(e=r.n()).done;){var n=e.value;+n.x+this.resolution<t.xMin||+n.x-this.resolution>t.xMax||+n.y+this.resolution<t.yMin||+n.y-this.resolution>t.yMax||this.cellsViewCache.push(n)}}catch(t){r.e(t)}finally{r.f()}}}}],n&&Oo(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Rn);function To(t){return To="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},To(t)}function Co(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ao(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Mo(n.key),n)}}function Mo(t){var e=function(t){if("object"!=To(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=To(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==To(e)?e:e+""}function zo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(zo=function(){return!!t})()}function Lo(t){return Lo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Lo(t)}function Ro(t,e){return Ro=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ro(t,e)}var Io=function(t){function e(t,r){var n,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),(n=function(t,e,r){return e=Lo(e),function(t,e){if(e&&("object"==To(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,zo()?Reflect.construct(e,r||[],Lo(t).constructor):e.apply(t,r))}(this,e,[void 0,"",t,o])).cells=r||[],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&&Ro(t,e)}(e,t),r=e,(n=[{key:"getData",value:function(t){return this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Co(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Co(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(this.cells);try{for(r.s();!(e=r.n()).done;){var n=e.value;+n.x+this.resolution<t.xMin||+n.x-this.resolution>t.xMax||+n.y+this.resolution<t.yMin||+n.y-this.resolution>t.yMax||this.cellsViewCache.push(n)}}catch(t){r.e(t)}finally{r.f()}}}}])&&Ao(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Rn);function Fo(t){return Fo="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},Fo(t)}function No(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Bo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Do(n.key),n)}}function Do(t){var e=function(t){if("object"!=Fo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Fo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fo(e)?e:e+""}function Go(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Go=function(){return!!t})()}function Wo(t){return Wo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wo(t)}function Uo(t,e){return Uo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Uo(t,e)}var $o=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Wo(e),function(t,e){if(e&&("object"==Fo(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,Go()?Reflect.construct(e,r||[],Wo(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.color=t.color||"#EA6BAC",r.size=t.size||function(t,e){return e},r.shape=t.shape||"square",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&&Uo(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n,o=e.view.z,i=this.viewScale?this.viewScale(t,r,o):void 0,a=.5*r,u="function"==typeof this.color,c="function"==typeof this.size,l="function"==typeof this.shape,s=this.color||"black",f=this.size||r,h=this.shape||"square",y=u?this.color:null,p=c?this.size:null,v=l?this.shape:null,d=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return No(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?No(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(d.s();!(n=d.n()).done;){var b=n.value,m=y?y(b,r,o,i):s;if(m&&"none"!==m){var g=p?p(b,r,o,i):f;if(g){var w=v?v(b,r,o,i):h;if("none"!==w){var x=this.offset(b,r,o),S=e.offscreenCtx;if(S.fillStyle=m,"square"===w){var O=r*(1-g/r)*.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/r)*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-r)/2;S.beginPath(),S.moveTo(b.x-k,b.y-k),S.lineTo(b.x+a,b.y+r+k),S.lineTo(b.x+r+k,b.y-k),S.fill()}else if("triangle_down"===w){var E=(g-r)/2;S.beginPath(),S.moveTo(b.x-E,b.y+r+E),S.lineTo(b.x+a,b.y-E),S.lineTo(b.x+r+E,b.y+r+E),S.fill()}else if("triangle_left"===w){var T=(g-r)/2;S.beginPath(),S.moveTo(b.x+r+T,b.y+r+T),S.lineTo(b.x-T,b.y+a),S.lineTo(b.x+r+T,b.y-T),S.fill()}else{if("triangle_right"!==w)throw new Error("Unexpected shape:"+w);var C=(g-r)/2;S.beginPath(),S.moveTo(b.x-C,b.y-C),S.lineTo(b.x+r+C,b.y+a),S.lineTo(b.x-C,b.y+r+C),S.fill()}}}}}}catch(t){d.e(t)}finally{d.f()}this.updateLegends({viewScale:i,resolution:r,z:o,cells:t})}}],n&&Bo(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function Yo(t){return Yo="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},Yo(t)}function Ho(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function qo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Vo(n.key),n)}}function Vo(t){var e=function(t){if("object"!=Yo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Yo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Yo(e)?e:e+""}function Xo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Xo=function(){return!!t})()}function Zo(t){return Zo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zo(t)}function Jo(t,e){return Jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Jo(t,e)}var Ko=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Zo(e),function(t,e){if(e&&("object"==Yo(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,Xo()?Reflect.construct(e,r||[],Zo(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.strokeColor=t.strokeColor||function(){return"#666"},r.size=t.size||function(t,e){return e},r.strokeWidth=t.strokeWidth||function(t,e,r){return 1.5*r},r.shape=t.shape||function(){return"square"},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&&Jo(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n,o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,r,o):void 0,u=.5*r,c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ho(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ho(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(n=c.n()).done;){var l=n.value,s=this.strokeColor?this.strokeColor(l,r,o,a):void 0;if(s&&"none"!==s){i.strokeStyle=s;var f=this.size?this.size(l,r,o,a):r,h=this.strokeWidth?this.strokeWidth(l,r,o,a):1*o;if(h&&!(h<=0)){i.lineWidth=h;var y=this.shape?this.shape(l,r,o,a):"square";if("none"!==y){var p=this.offset(l,r,o);if("square"===y){var v=r*(1-f/r)*.5;i.beginPath(),i.rect(l.x+v+p.dx,l.y+v+p.dy,f,f),i.stroke()}else if("circle"===y)i.beginPath(),i.arc(l.x+u+p.dx,l.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(l.x+u-d,l.y+u),i.lineTo(l.x+u,l.y+u+d),i.lineTo(l.x+u+d,l.y+u),i.lineTo(l.x+u,l.y+u-d),i.lineTo(l.x+u-d,l.y+u),i.stroke()}else if("donut"===y)console.error("Not implemented");else if("triangle_up"===y){var b=(f-r)/2;i.beginPath(),i.moveTo(l.x-b,l.y-b),i.lineTo(l.x+u,l.y+r+b),i.lineTo(l.x+r+b,l.y-b),i.closePath(),i.stroke()}else if("triangle_down"===y){var m=(f-r)/2;i.beginPath(),i.moveTo(l.x-m,l.y+r+m),i.lineTo(l.x+u,l.y-m),i.lineTo(l.x+r+m,l.y+r+m),i.closePath(),i.stroke()}else if("triangle_left"===y){var g=(f-r)/2;i.beginPath(),i.moveTo(l.x+r+g,l.y+r+g),i.lineTo(l.x-g,l.y+u),i.lineTo(l.x+r+g,l.y-g),i.closePath(),i.stroke()}else{if("triangle_right"!==y)throw new Error("Unexpected shape:"+y);var w=(f-r)/2;i.beginPath(),i.moveTo(l.x-w,l.y-w),i.lineTo(l.x+r+w,l.y+u),i.lineTo(l.x-w,l.y+r+w),i.closePath(),i.stroke()}}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,resolution:r,z:o,viewScale:a})}}],n&&qo(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function Qo(t){return Qo="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},Qo(t)}function ti(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ei(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ri(n.key),n)}}function ri(t){var e=function(t){if("object"!=Qo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Qo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Qo(e)?e:e+""}function ni(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ni=function(){return!!t})()}function oi(t){return oi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},oi(t)}function ii(t,e){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ii(t,e)}var ai=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=oi(e),function(t,e){if(e&&("object"==Qo(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,ni()?Reflect.construct(e,r||[],oi(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.height=t.height||function(t,e){return e*Math.random()},r.lineColor=t.lineColor||function(t,e,r,n){return"#BBB"},r.lineWidth=t.lineWidth||function(t,e,r,n){return n},r.fillColor=t.fillColor||function(t,e,r,n){return"#c08c5968"},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&&ii(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n,o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,r,o):void 0,u={},c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ti(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ti(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(n=c.n()).done;){var l=n.value,s=u[l.y];s||(s={},u[l.y]=s),s[l.x]=this.height(l,r,o,a)}}catch(t){c.e(t)}finally{c.f()}var f=e.extGeo;if(f){var h=Math.floor(f.xMin/r)*r,y=Math.floor(f.xMax/r)*r,p=Math.floor(f.yMin/r)*r,v=Math.floor(f.yMax/r)*r,d={min:p,max:v};i.lineJoin="round";for(var b=v;b>=p;b-=r){var m=u[b];if(m){i.beginPath(),i.moveTo(h-r/2,b);for(var g=void 0,w=h;w<=y;w+=r){var x=m[w];x||(x=0),x||g?i.lineTo(w+r/2,b+x):i.moveTo(w+r/2,b),g=x}g&&i.lineTo(y+r/2,b);var S=this.fillColor(b,d,r,o);S&&"none"!=S&&(i.fillStyle=S,i.fill());var O=this.lineColor(b,d,r,o),_=this.lineWidth(b,d,r,o);O&&"none"!=O&&_>0&&(i.strokeStyle=O,i.lineWidth=_,i.stroke())}}}}}],n&&ei(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function ui(t){return ui="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},ui(t)}function ci(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||li(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 li(t,e){if(t){if("string"==typeof t)return si(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?si(t,e):void 0}}function si(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function fi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,hi(n.key),n)}}function hi(t){var e=function(t){if("object"!=ui(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ui(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ui(e)?e:e+""}function yi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(yi=function(){return!!t})()}function pi(t){return pi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pi(t)}function vi(t,e){return vi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vi(t,e)}var di=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=pi(e),function(t,e){if(e&&("object"==ui(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,yi()?Reflect.construct(e,r||[],pi(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.color=t.color,r.type=t.type||function(){return"flag"},r.size=t.size||function(t,e){return e},r.stripesOrientation=t.stripesOrientation||function(){return 0},r.offsetAngle=t.offsetAngle||function(){return 0},r.agePyramidHeight=t.agePyramidHeight||function(t,e){return e},r.pieChartInternalRadiusFactor=t.pieChartInternalRadiusFactor||0,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&&vi(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n,o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,r,o):void 0,u=Object.entries(this.color).length,c=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=li(t))){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}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(c.s();!(n=c.n()).done;){var l=n.value,s=this.size?this.size(l,r,o,a):r;if(s){var f=this.offset(l,r,o),h=this.type?this.type(l,r,o,a):"flag",y=l.x+f.dx+("agepyramid"===h?0:.5*r),p=l.y+f.dy+("agepyramid"===h?0:.5*r),v=this.offsetAngle?this.offsetAngle(l,r,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=+l[m[b]];g>d&&(d=g)}var w=0;"agepyramid"===h&&this.agePyramidHeight&&(w=(r-this.agePyramidHeight(l,r,o,a))/2),"radar"!==h&&"halftone"!==h||(w=Math.PI/2+v);var x="agepyramid"===h?(this.agePyramidHeight?this.agePyramidHeight(l,r,o,a):r)/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 _=ci(O[S],2),j=_[0],P=_[1];if("agepyramid"===h){i.fillStyle=P;var k=s*l[j]/d;i.fillRect(y+(r-k)/2,p+w,k,x),w+=x}else if("radar"===h){i.fillStyle=P;var E=l[j],T=s/2*Math.sqrt(E/d);i.beginPath(),i.moveTo(y,p),i.arc(y,p,T,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 C=l[j],A=.333*s*Math.sqrt(C/d);i.beginPath(),i.arc(y+.25*r*Math.cos(w),p+.25*r*Math.sin(w),A,0,2*Math.PI),i.fill(),w+=x}}}else{for(var M=0,z=0,L=Object.keys(this.color);z<L.length;z++){var R=+l[L[z]];R&&(M+=R)}if(!M||isNaN(M))continue;for(var I=0,F=r*(1-s/r)*.5,N=this.stripesOrientation(l,r,o,a),B=0,D=Object.entries(this.color);B<D.length;B++){var G=ci(D[B],2),W=G[0],U=G[1],$=l[W]/M;if($&&!isNaN($)){if(i.fillStyle=U,"flag"===h)0==N?i.fillRect(l.x+F+f.dx,l.y+F+I*s+f.dy,s,$*s):i.fillRect(l.x+F+I*s+f.dx,l.y+F+f.dy,$*s,s);else if("piechart"===h){var Y=2*I*Math.PI,H=2*(I+$)*Math.PI;i.beginPath(),i.moveTo(y,p),i.arc(y,p,.5*s,Y+v,H+v),this.pieChartInternalRadiusFactor&&i.arc(y,p,.5*s*this.pieChartInternalRadiusFactor,Y+v,H+v,!0),i.closePath(),i.fill()}else if("ring"===h)i.beginPath(),i.arc(y,p,Math.sqrt(1-I)*s*.5,0,2*Math.PI),i.fill();else{if("segment"!==h)throw new Error("Unexpected symbol type:"+h);var q=s*s/r;0==N?i.fillRect(l.x+f.dx,l.y+(r-q)/2+I*q+f.dy,r,$*q):i.fillRect(l.x+I*r+f.dx,l.y+(r-q)/2+f.dy,$*r,q)}I+=$}}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,resolution:r,z:o,viewScale:a})}}],n&&fi(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function bi(t){return bi="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},bi(t)}function mi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function gi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wi(n.key),n)}}function wi(t){var e=function(t){if("object"!=bi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=bi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bi(e)?e:e+""}function xi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(xi=function(){return!!t})()}function Si(t){return Si=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Si(t)}function Oi(t,e){return Oi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Oi(t,e)}var _i=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Si(e),function(t,e){if(e&&("object"==bi(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,r||[],Si(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.color=t.color||function(){return"#EA6BAC"},r.width=t.width||function(t,e){return.1*e},r.length=t.length||function(t,e){return.9*e},r.orientation=t.orientation||function(){return 180*Math.random()},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&&Oi(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=e.offscreenCtx,i=this.viewScale?this.viewScale(t,r,n):void 0;o.lineCap="butt";var a,u=Math.PI/180,c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return mi(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?mi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(a=c.n()).done;){var l=a.value,s=this.color?this.color(l,r,n,i):void 0;if(s){var f=this.width?this.width(l,r,n,i):void 0;if(f&&!(f<0)){var h=this.length?this.length(l,r,n,i):void 0;if(h&&!(h<0)){var y=this.orientation(l,r,n,i)*u;if(void 0!==y&&!isNaN(y)){var p=this.offset(l,r,n);o.strokeStyle=s,o.lineWidth=f;var v=l.x+r/2+p.dx,d=l.y+r/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){c.e(t)}finally{c.f()}this.updateLegends({viewScale:i,resolution:r,z:n,cells:t})}}],n&&gi(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function ji(t){return ji="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},ji(t)}function Pi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ki(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ei(n.key),n)}}function Ei(t){var e=function(t){if("object"!=ji(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ji(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ji(e)?e:e+""}function Ti(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ti=function(){return!!t})()}function Ci(t){return Ci=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ci(t)}function Ai(t,e){return Ai=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ai(t,e)}var Mi=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Ci(e),function(t,e){if(e&&("object"==ji(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,Ti()?Reflect.construct(e,r||[],Ci(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.text=t.text||function(){return"X"},r.color=t.color||function(){return"black"},r.fontSize=t.fontSize||function(t,e){return e},r.fontFamily=t.fontFamily||function(){return"Arial"},r.fontWeight=t.fontWeight||function(){return"bold"},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&&Ai(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=e.offscreenCtx,i=this.viewScale?this.viewScale(t,r,n):void 0;e.initCanvasTransform();var a,u=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Pi(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(u.s();!(a=u.n()).done;){var c=a.value,l=this.text?this.text(c,r,n,i):void 0;if(null!=l&&null!=l&&l+""!=""){var s=this.color?this.color(c,r,n,i):void 0;if(s){o.fillStyle=s;var f=this.fontSize(c,r,n,i)/n;if(f){var h=this.fontFamily?this.fontFamily(c,r,n,i):"Arial",y=this.fontWeight?this.fontWeight(c,r,n,i):"bold";o.font=y+" "+f+"px "+h;var p=this.offset(c,r,n);o.textAlign="center";var v=e.geoToPixX(c.x+.5*r+p.dx),d=e.geoToPixY(c.y+.5*r+p.dy)+.3*f;o.fillText(l,v,d)}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,resolution:r,z:n,viewScale:i})}}],o=[{key:"textScale",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=t.length;return function(n){return e&&(n=e(n)),0==n?"":n>=1?t[r-1]:t[Math.floor(n*r)]}}}],n&&ki(r.prototype,n),o&&ki(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Sn);function zi(t){return zi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zi(t)}function Li(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ri(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ri(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Ri(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ii(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Fi(n.key),n)}}function Fi(t){var e=function(t){if("object"!=zi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=zi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zi(e)?e:e+""}function Ni(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ni=function(){return!!t})()}function Bi(t){return Bi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bi(t)}function Di(t,e){return Di=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Di(t,e)}var Gi=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Bi(e),function(t,e){if(e&&("object"==zi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ni()?Reflect.construct(e,r||[],Bi(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.height=t.height,r.color=t.color||function(){return"#c08c59"},r.width=t.width||function(t,e){return.5*e},r.simple=t.simple||function(){return!1},r.viewHeightFactor=t.viewHeightFactor||1.5,r.viewSX=null==t.viewSX?0:t.viewSX,r.viewSY=null==t.viewSY?-.5:t.viewSY,r.shadowDirection=null==t.shadowDirection?-40.3*Math.PI/180:t.shadowDirection,r.shadowFactor=t.shadowFactor||.3,r.shadowColor=t.shadowColor||"#00000033",r.outlineCol=t.outlineCol||"#FFFFFF",r.outlineWidthPix=null==t.outlineWidthPix?.5:t.outlineWidthPix,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&&Di(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=e.offscreenCtx,i=this.viewScale?this.viewScale(t,r,n):void 0,a=e.view.x+this.viewSX*e.w*n,u=e.view.y+this.viewSY*e.h*n,c=this.viewHeightFactor*(e.w+e.h)*.5*n;t.sort((function(t,e){return 1e8*(e.y-t.y)+t.x-e.x}));var l=this.simple(r,n,i);o.lineCap=l?"butt":"round",o.strokeStyle=this.shadowColor,o.fillStyle=this.shadowColor;var s,f=Li(t);try{for(f.s();!(s=f.n()).done;){var h=s.value,y=this.width?this.width(h,r,n,i):void 0;if(y&&!(y<0)){var p=this.height?this.height(h,r,n,i):void 0;if(p&&!(p<0)){o.lineWidth=y;var v=h.x+r/2,d=h.y+r/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=Li(t);try{for(g.s();!(m=g.n()).done;){var w=m.value,x=this.color?this.color(w,r,n,i):void 0;if(x){var S=this.width?this.width(w,r,n,i):void 0;if(S&&!(S<0)){var O=this.height?this.height(w,r,n,i):void 0;if(O&&!(O<0)){var _=w.x+r/2,j=w.y+r/2,P=_-a,k=j-u,E=Math.atan2(k,P),T=Math.sqrt(P*P+k*k)*O/(c-O);l?(o.strokeStyle=x,o.lineWidth=S,o.beginPath(),o.moveTo(_,j),o.lineTo(_+T*Math.cos(E),j+T*Math.sin(E)),o.stroke()):(o.strokeStyle=this.outlineCol,o.lineWidth=S+2*this.outlineWidthPix*n,o.beginPath(),o.moveTo(_,j),o.lineTo(_+T*Math.cos(E),j+T*Math.sin(E)),o.stroke(),o.strokeStyle=x,o.lineWidth=S,o.beginPath(),o.moveTo(_,j),o.lineTo(_+T*Math.cos(E),j+T*Math.sin(E)),o.stroke(),o.strokeStyle=this.outlineCol,o.lineWidth=this.outlineWidthPix*n,o.beginPath(),o.arc(_+T*Math.cos(E),j+T*Math.sin(E),.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:r,z:n,viewScale:i})}}],n&&Ii(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);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 Ui(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function $i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Yi(n.key),n)}}function Yi(t){var e=function(t){if("object"!=Wi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Wi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Wi(e)?e:e+""}function Hi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Hi=function(){return!!t})()}function qi(t){return qi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qi(t)}function Vi(t,e){return Vi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vi(t,e)}var Xi=function(t){function e(){var t,r=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,r){return e=qi(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,Hi()?Reflect.construct(e,r||[],qi(t).constructor):e.apply(t,r))}(this,e,[r])).color=r.color||function(t,e,r,n){return"#EA6BAC"},t.width=r.width||function(t,e,r,n){return e/5},t.length=r.length||function(t,e,r,n){return e},t.diamond=r.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&&Vi(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,r,n){this.filter&&(t=t.filter(this.filter));var o=r.view.z,i=r.offscreenCtx,a=e.buildSides(t,n);if(0!=a.length){var u=this.viewScale?this.viewScale(a,n,o):void 0;i.lineCap="butt";var c,l=.5*n,s=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ui(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ui(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(a);try{for(s.s();!(c=s.n()).done;){var f=c.value,h=this.color?this.color(f,n,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-l,p),i.lineTo(y,p+l),i.lineTo(y+l,p),i.lineTo(y,p-l),i.closePath(),i.fill()}else{var v=this.width?this.width(f,n,o,u):void 0;if(!v||v<=0)continue;var d=this.length?this.length(f,n,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:n,z:o,viewScale:u})}}}],o=[{key:"buildSides",value:function(t,e){var r=[],n=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?r.push({or:"h",x:o.x+n,y:a.y,c1:o,c2:a}):(r.push({or:"h",x:o.x+n,y:o.y+e,c1:o,c2:void 0}),r.push({or:"h",x:a.x+n,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 c=t[u];o.x+e==c.x&&o.y==c.y?r.push({or:"v",x:o.x+e,y:o.y+n,c1:o,c2:c}):(r.push({or:"v",x:o.x+e,y:o.y+n,c1:o,c2:void 0}),r.push({or:"v",x:c.x,y:c.y+n,c1:void 0,c2:c})),o=c}return r}}],n&&$i(r.prototype,n),o&&$i(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Sn);function Zi(t){return Zi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zi(t)}function Ji(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ki(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qi(n.key),n)}}function Qi(t){var e=function(t){if("object"!=Zi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Zi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Zi(e)?e:e+""}function ta(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ta=function(){return!!t})()}function ea(t){return ea=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ea(t)}function ra(t,e){return ra=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ra(t,e)}var na=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=ea(e),function(t,e){if(e&&("object"==Zi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ta()?Reflect.construct(e,r||[],ea(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.code=t.code,r.color=t.color,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&&ra(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=e.offscreenCtx,i=Xi.buildSides(t,r);if(0!=i.length){var a=this.viewScale?this.viewScale(i,r,n):void 0;o.lineCap="butt";var u,c=.5*r,l=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ji(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ji(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(i);try{for(l.s();!(u=l.n()).done;){var s=u.value,f=s.c1?this.code(s.c1,r,n):void 0,h=s.c2?this.code(s.c2,r,n):void 0;if(f!=h){var y=this.width?this.width(s,r,n,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-c,s.y+p),o.lineTo(s.x+c,s.y+p),o.stroke()),f&&(o.beginPath(),o.strokeStyle=this.color[f],o.moveTo(s.x-c,s.y-p),o.lineTo(s.x+c,s.y-p),o.stroke())):(h&&(o.beginPath(),o.strokeStyle=this.color[h],o.moveTo(s.x+p,s.y-c),o.lineTo(s.x+p,s.y+c),o.stroke()),f&&(o.beginPath(),o.strokeStyle=this.color[f],o.moveTo(s.x-p,s.y-c),o.lineTo(s.x-p,s.y+c),o.stroke()))}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,resolution:r,z:n,viewScale:a})}}}],n&&Ki(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Xi);const oa=function t(e){function r(t,r){var n,o;return t=null==t?0:+t,r=null==r?1:+r,function(){var i;if(null!=n)i=n,n=null;else do{n=2*e()-1,i=2*e()-1,o=n*n+i*i}while(!o||o>1);return t+r*i*Math.sqrt(-2*Math.log(o)/o)}}return r.source=t,r}(Math.random);function ia(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=document.createElement("canvas");n.setAttribute("width",t),n.setAttribute("height",e);var o=n.getContext("webgl",r);if(!o)throw new Error("Unable to initialize WebGL. Your browser or machine may not support it.");return{canvas:n,gl:o}}function aa(t){var e=t.createProgram();if(null==e)throw new Error("Cannot create webGL program");for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];for(var i=0,a=n;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 ua(t,e){var r=t.createShader(e);if(null==r)throw new Error("Cannot create webGL shader");for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];if(t.shaderSource(r,o.join("\n")),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS))return r;throw new Error(t.getShaderInfoLog(r)||"Cannot create webGL shader (2)")}function ca(t){return ca="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ca(t)}function la(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,sa(n.key),n)}}function sa(t){var e=function(t){if("object"!=ca(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ca(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ca(e)?e:e+""}var fa=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gl=e,this.sizePix=r||10,this.program=aa(e,ua(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 "),ua(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,r){var n=Pe(r);n&&(this.verticesBuffer.push(t,e),this.colorsBuffer.push(n.r,n.g,n.b,n.opacity))}},{key:"addPointData2",value:function(t,e,r,n,o,i){this.verticesBuffer.push(t,e),this.colorsBuffer.push(r,n,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 r=e.getAttribLocation(this.program,"pos");e.vertexAttribPointer(r,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(r),e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.colorsBuffer),e.STATIC_DRAW);var n=e.getAttribLocation(this.program,"color");e.vertexAttribPointer(n,4,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n),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)}}])&&la(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function ha(t){return ha="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},ha(t)}function ya(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return pa(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pa(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function pa(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function va(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,da(n.key),n)}}function da(t){var e=function(t){if("object"!=ha(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ha(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ha(e)?e:e+""}function ba(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ba=function(){return!!t})()}function ma(t){return ma=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ma(t)}function ga(t,e){return ga=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ga(t,e)}var wa=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=ma(e),function(t,e){if(e&&("object"==ha(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,ba()?Reflect.construct(e,r||[],ma(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.dotNumber=t.dotNumber||function(t,e){return e/100},r.color=t.color||function(){return"#FF5733"},r.dotSize=t.dotSize||function(t,e){return 1.5*e},r.sigma=t.sigma||function(t,e){return t/2},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&&ga(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=this.viewScale?this.viewScale(t,r,n):void 0,i=this.dotSize?this.dotSize(r,n,o):n,a=this.sigma?this.sigma(r,n,o):.4*r,u=oa(0,a),c=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 l=ia(e.w+"",e.h+"");if(!l)return void console.error("No webGL");var s,f=new fa(l.gl,i/n),h=r/2,y=ya(t);try{for(y.s();!(s=y.n()).done;){var p=s.value,v=this.color(p,r,n,o);if(v&&"none"!==v){var d=this.dotNumber(p,r,n,o),b=this.offset(p,r,n),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(),c.drawImage(l.canvas,0,0)}else{var S,O=ya(t);try{for(O.s();!(S=O.n()).done;){var _=S.value,j=this.color(_,r,n,o);if(j&&"none"!==j){c.fillStyle=j;for(var P=this.dotNumber(_,r,n,o),k=this.offset(_,r,n),E=_.x+k.dx+r/2,T=_.y+k.dy+r/2,C=0;C<=P;C++)c.fillRect(E+u(),T+u(),i,i)}}}catch(t){O.e(t)}finally{O.f()}}this.updateLegends({style:this,resolution:r,z:n,viewScale:o})}}],n&&va(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function xa(t){return xa="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},xa(t)}function Sa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Oa(n.key),n)}}function Oa(t){var e=function(t){if("object"!=xa(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=xa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xa(e)?e:e+""}var _a=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 r=[];r.push("precision mediump float;\nvarying float vi;\n"),r.push("uniform vec4");for(var n=0;n<e.length;n++)n>0&&r.push(","),r.push(" c"+n);r.push(";\n"),r.push("void main(void) {\n");for(var o=0;o<e.length;o++)o>0&&r.push("else "),r.push("if(vi=="),r.push(o),r.push(".0) gl_FragColor = vec4(c"),r.push(o),r.push("[0], c"),r.push(o),r.push("[1], c"),r.push(o),r.push("[2], c"),r.push(o),r.push("[3]);\n");r.push("else gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}"),this.fshString=r.join("")},e=[{key:"draw",value:function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,i=aa(t,ua(t,t.VERTEX_SHADER,this.vshString),ua(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 c=t.getAttribLocation(i,"pos");t.vertexAttribPointer(c,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(c),t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array(r),t.STATIC_DRAW);var l=t.getAttribLocation(i,"i");t.vertexAttribPointer(l,1,t.FLOAT,!1,0,0),t.enableVertexAttribArray(l),t.uniformMatrix3fv(t.getUniformLocation(i,"mat"),!1,new Float32Array(n)),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.POINTS,0,e.length/2)}}],e&&Sa(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function ja(t){return ja="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},ja(t)}function Pa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ka(n.key),n)}}function ka(t){var e=function(t){if("object"!=ja(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ja(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ja(e)?e:e+""}function Ea(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ea=function(){return!!t})()}function Ta(t){return Ta=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ta(t)}function Ca(t,e){return Ca=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ca(t,e)}var Aa=function(t){function e(t){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Ta(e),function(t,e){if(e&&("object"==ja(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,Ea()?Reflect.construct(e,r||[],Ta(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.code=t.code,t.color=t.color||void 0;var n=Object.keys(t.color);r.catToI={};for(var o=0;o<n.length;o++)r.catToI[n[o]]=o+"";r.colors=[];for(var i=0,a=n;i<a.length;i++){var u=a[i];r.colors.push(t.color[""+u])}return r.size=t.size,r.wgp=new _a(r.colors),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&&Ca(t,e)}(e,t),r=e,(n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));for(var n,o=e.view.z,i=r/2,a=t.length,u=[],c=[],l=0;l<a;l++){n=t[l];var s=this.code(n);if(null!=s){var f=this.catToI[s];isNaN(+f)?console.log("Unexpected category index: "+s+" "+f):(u.push(n.x+i,n.y+i),c.push(+f))}else console.log("Unexpected category: "+s)}var h=ia(e.w+"",e.h+"");if(h){var y=this.size?this.size(r,o):r+.2*o;this.wgp.draw(h.gl,u,c,e.getWebGLTransform(),y/o),e.initCanvasTransform(),e.offscreenCtx.drawImage(h.canvas,0,0),this.updateLegends({style:this,resolution:r,z:o})}else console.error("No webGL")}}])&&Pa(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function Ma(t,e){let r;if(void 0===e)for(const e of t)null!=e&&(r<e||void 0===r&&e>=e)&&(r=e);else{let n=-1;for(let o of t)null!=(o=e(o,++n,t))&&(r<o||void 0===r&&o>=o)&&(r=o)}return r}function za(t){return null===t?NaN:+t}function La(t,e,r=za){if((n=t.length)&&!isNaN(e=+e)){if(e<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,o=(n-1)*e,i=Math.floor(o),a=+r(t[i],i,t);return a+(+r(t[i+1],i+1,t)-a)*(o-i)}}function Ra(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ia(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Fa(t){let e,r,n;function o(t,n,o=0,i=t.length){if(o<i){if(0!==e(n,n))return i;do{const e=o+i>>>1;r(t[e],n)<0?o=e+1:i=e}while(o<i)}return o}return 2!==t.length?(e=Ra,r=(e,r)=>Ra(t(e),r),n=(e,r)=>t(e)-r):(e=t===Ra||t===Ia?t:Na,r=t,n=t),{left:o,center:function(t,e,r=0,i=t.length){const a=o(t,e,r,i-1);return a>r&&n(t[a-1],e)>-n(t[a],e)?a-1:a},right:function(t,n,o=0,i=t.length){if(o<i){if(0!==e(n,n))return i;do{const e=o+i>>>1;r(t[e],n)<=0?o=e+1:i=e}while(o<i)}return o}}}function Na(){return 0}const Ba=Fa(Ra),Da=Ba.right,Ga=(Ba.left,Fa(za).center,Da);function Wa(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Ua(){var t,e=[],r=[],n=[];function o(){var t=0,o=Math.max(1,r.length);for(n=new Array(o-1);++t<o;)n[t-1]=La(e,t/o);return i}function i(e){return null==e||isNaN(e=+e)?t:r[Ga(n,e)]}return i.invertExtent=function(t){var o=r.indexOf(t);return o<0?[NaN,NaN]:[o>0?n[o-1]:e[0],o<n.length?n[o]:e[e.length-1]]},i.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let r of t)null==r||isNaN(r=+r)||e.push(r);return e.sort(Ra),o()},i.range=function(t){return arguments.length?(r=Array.from(t),o()):r.slice()},i.unknown=function(e){return arguments.length?(t=e,i):t},i.quantiles=function(){return n.slice()},i.copy=function(){return Ua().domain(e).range(r).unknown(t)},Wa.apply(i,arguments)}var $a=function(t){var e=t.valueFunction,r=t.minValue||0,n=t.minSizePix||0,o=t.maxSizeFactor||1,i=t.stretching,a=t.range,u=t.domain,c=t.classNumber;return function(t,l,s){var f=u||[r,Ma(t,e)],h=a||[n*s,l*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)),c&&(t=1==t?1:Math.floor(t*c)/(c-1)),d+t*v}}},Ya=function(t){var e=t.valueFunction,r=t.classNumber||12,n=t.minSizePix||1,o=t.maxSizeFactor||1,i=Ua();return function(t,a,u){i.domain(t.map(e));var c=n*u,l=a*o;return i.range(Array.from({length:r},(function(t,e){return c+e*(l-c)/(r-1)}))),i.breaks=i.quantiles(),i.values=i.range(),i}},Ha=function(t){var e,r=t.valueFunction,n=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 r,n;if(void 0===e)for(const e of t)null!=e&&(void 0===r?e>=e&&(r=n=e):(r>e&&(r=e),n<e&&(n=e)));else{let o=-1;for(let i of t)null!=(i=e(i,++o,t))&&(void 0===r?i>=i&&(r=n=i):(r>i&&(r=i),n<i&&(n=i)))}return[r,n]}(e,r);if(null!=a[0]){var u=a[1]-a[0],c=function(t){return t=(t-a[0])/u,n&&(t=n(t)),o(t)};if(c.invert=function(t){return n&&(t=n.invert(t)),a[0]+t*u},t.colors&&i){c.breaks=[];for(var l=1;l<i;l++)c.breaks.push(c.invert(l/i))}return c}}}},qa=function(t){var e=t.valueFunction,r=t.classNumber||12,n=t.colors;t.colorScale&&(n=Ja(t.colorScale,r)),n=n||Array.from({length:r},(function(t,e){return"rgb("+Math.floor(255*e/(r-1))+",150,150)"}));var o=Ua().range(n);return function(t){return o.domain(t.map(e)),o.breaks=o.quantiles(),o.colors=n,o}},Va=function(t){return function(e,r,n){var o={};for(var i in t)o[i]=t[i](e,r,n);return o}};function Xa(t){var e=t.length,r=function(r){for(var n=0;n<e;){if(r<=t[n])return n;n++}return n};return r.breaks=t,r}function Za(t,e){var r=Xa(t),n=function(t){return e[r(t)]};return n.breaks=t,n.colors=e,n}function Ja(t,e){if(1==e)return[t(.5)];for(var r=[],n=0;n<e;n++)r.push(t(n/(e-1)));return r}function Ka(t){return Ka="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},Ka(t)}function Qa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,tu(n.key),n)}}function tu(t){var e=function(t){if("object"!=Ka(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ka(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ka(e)?e:e+""}var eu=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,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n.colorDark=n.colorDark||"#111",n.colorBright=n.colorBright||"#ddd",n.width=n.width||function(t,e,r){var n=1*r,o=4*r,i=(o-n)/3;return Math.min(n+(t-1)*i,o)};for(var o=Xa(e),i={},a=0;a<r.length;a++)i[a+""]=r[a];var u=new Aa({code:function(e){return o(t(e))},color:i}),c=function(e){return(e.c1?o(t(e.c1)):-1)-(e.c2?o(t(e.c2)):-1)};return[u,new Xi({color:function(t){var e=c(t);if(0!==e)return"v"===t.or?e<0?n.colorBright:n.colorDark:e<0?n.colorDark:n.colorBright},width:function(t,e,r){return n.width(Math.abs(c(t)),e,r)}})]}}],null&&Qa(t.prototype,null),e&&Qa(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function ru(t){return ru="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},ru(t)}function nu(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ou(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ou(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function ou(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function iu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(iu=function(){return!!t})()}function au(t){return au=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},au(t)}function uu(t,e){return uu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},uu(t,e)}function cu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,fu(n.key),n)}}function su(t,e,r){return e&&lu(t.prototype,e),r&&lu(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function fu(t){var e=function(t){if("object"!=ru(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ru(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ru(e)?e:e+""}var hu=function(){return su((function t(){cu(this,t)}),null,[{key:"get",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};(n=n||{}).colDark=n.colDark||"#333",n.colBright=n.colBright||"#aaa",n.widthFactor=n.widthFactor||.12;var o=eu.get(t,e,r,n),i=new Ko({strokeColor:function(){return"#666"},strokeWidth:function(t,e,r){return.2*r},filter:n.filter});return[o[0],i,o[1],new yu({colDark:n.colDark,colBright:n.colBright,filter:n.filter})]}},{key:"getCategory",value:function(t,e,r){return(r=r||{}).colDark=r.colDark||"#333",r.colBright=r.colBright||"#aaa",[new Aa({code:t,color:e}),new Ko({strokeColor:function(){return"#666"},strokeWidth:function(t,e,r){return.2*r}}),new yu({colDark:r.colDark,colBright:r.colBright})]}}])}(),yu=function(t){function e(t){var r,n,o,i;return cu(this,e),n=this,i=[t],o=au(o=e),r=function(t,e){if(e&&("object"==ru(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)}(n,iu()?Reflect.construct(o,i||[],au(n).constructor):o.apply(n,i)),t=t||{},r.colDark=t.colDark||"#333",r.colBright=t.colBright||"#aaa",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&&uu(t,e)}(e,t),su(e,[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.offscreenCtx;n.lineWidth=.6*e.view.z,n.strokeStyle=this.colDark;var o,i=nu(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;n.beginPath(),n.arc(a.x+.5*r,a.y+.5*r,.55*r*.5,Math.PI/4,-Math.PI*(3/4),!0),n.stroke()}}catch(t){i.e(t)}finally{i.f()}n.strokeStyle=this.colBright;var u,c=nu(t);try{for(c.s();!(u=c.n()).done;){var l=u.value;n.beginPath(),n.arc(l.x+.5*r,l.y+.5*r,.55*r*.5,Math.PI/4,-Math.PI*(3/4),!1),n.stroke()}}catch(t){c.e(t)}finally{c.f()}}}])}(Sn);function pu(t){return pu="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},pu(t)}function vu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,du(n.key),n)}}function du(t){var e=function(t){if("object"!=pu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=pu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pu(e)?e:e+""}var bu=function(){return t=function t(e,r,n){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=ua(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<r.length;e++)t.push("uniform vec4 c"+e+";\n");return t.join("")}()+"void main(void) {\n";if(n?"pow"==n.fun?u+=" float t = pow(vt, alpha);\n":"powInv"==n.fun?u+=" float t = 1.0-pow(1.0-vt, 1.0/alpha);\n":"exp"==n.fun?u+=0==n.alpha?"float t = vt;":" float t = (exp(vt * alpha) - 1.0) / (exp(alpha) - 1.0);\n":"log"==n.fun?u+=0==n.alpha?"float t = vt;":" float t = 1.0 - (1.0 / alpha) * log(exp(alpha) * (1.0 - vt) + vt);\n":"circle"==n.fun?0==n.alpha?u+=" float t = vt;\n":1==n.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"==n.fun?0==n.alpha?u+=" float t = vt;\n":1==n.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: "+n.fun),u+=" float t = vt;\n"):u+=" float t = vt;\n",1==r.length)u+=" vec4 cI=c0;\n vec4 cF=c0;\n";else if(2==r.length)u+=" vec4 cI=c0;\n vec4 cF=c1;\n";else{var c=r.length-1,l=c+".0";u+=" vec4 cI;\n",u+=" vec4 cF;\n",u+=" if(t<1.0/"+l+") { cI=c0; cF=c1; t=t*"+l+"; }\n";for(var s=2;s<c;s++)u+=" else if(t<"+s+".0/"+l+") { cI=c"+(s-1)+"; cF=c"+s+"; t="+l+"*t-"+(s-1)+".0; }\n";u+=" else { cI=c"+(c-1)+"; cF=c"+c+"; t="+l+"*t-"+(c-1)+".0; }\n"}1==r.length?u+=" gl_FragColor = vec4(c0[0], c0[1], c0[2], c0[3]);}\n":u+=" gl_FragColor = mix(cI, cF, t);}\n";var f=ua(e,e.FRAGMENT_SHADER,u);this.program=aa(e,a,f),e.useProgram(this.program),e.uniform1f(e.getUniformLocation(this.program,"sizePix"),1*o),e.uniform1f(e.getUniformLocation(this.program,"alpha"),n?1*n.alpha:0);for(var h=0;h<r.length;h++){var y=Pe(r[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,r){var n=this.gl,o=this.program;n.bindBuffer(n.ARRAY_BUFFER,n.createBuffer()),n.bufferData(n.ARRAY_BUFFER,new Float32Array(t),n.STATIC_DRAW);var i=n.getAttribLocation(o,"pos");n.vertexAttribPointer(i,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(i),n.bindBuffer(n.ARRAY_BUFFER,n.createBuffer()),n.bufferData(n.ARRAY_BUFFER,new Float32Array(e),n.STATIC_DRAW);var a=n.getAttribLocation(o,"t");n.vertexAttribPointer(a,1,n.FLOAT,!1,0,0),n.enableVertexAttribArray(a),n.uniformMatrix3fv(n.getUniformLocation(o,"mat"),!1,new Float32Array(r)),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.POINTS,0,t.length/2)}}],e&&vu(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function mu(t){return mu="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},mu(t)}function gu(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function wu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xu(n.key),n)}}function xu(t){var e=function(t){if("object"!=mu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=mu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mu(e)?e:e+""}function Su(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Su=function(){return!!t})()}function Ou(t){return Ou=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ou(t)}function _u(t,e){return _u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_u(t,e)}var ju=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Ou(e),function(t,e){if(e&&("object"==mu(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,Su()?Reflect.construct(e,r||[],Ou(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.tFun=t.tFun,r.stretching=t.stretching,r.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&&(r.colors=[t.color(0),t.color(.2),t.color(.4),t.color(.6),t.color(.8),t.color(1)]),r.opacity=t.opacity,r.size=t.size,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&&_u(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=this.viewScale?this.viewScale(t,r,n):void 0,i=ia(e.w+"",e.h+"",null!=this.opacity?{premultipliedAlpha:!1}:void 0);if(i){var a,u=r/2,c=[],l=[],s=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return gu(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(s.s();!(a=s.n()).done;){var f=a.value,h=this.tFun(f,r,n,o);null!=h&&null!=h&&(c.push(f.x+u,f.y+u),l.push(h>1?1:h<0?0:h))}}catch(t){s.e(t)}finally{s.f()}var y=this.size?this.size(r,n):r+.2*n,p=this.opacity?this.opacity(r,n):void 0;new bu(i.gl,this.colors,this.stretching,y/n,p).draw(c,l,e.getWebGLTransform()),e.initCanvasTransform(),e.offscreenCtx.drawImage(i.canvas,0,0),this.updateLegends({style:this,resolution:r,z:n,viewScale:o})}else console.error("No webGL")}}],n&&wu(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function Pu(t){return Pu="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},Pu(t)}function ku(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Eu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Tu(n.key),n)}}function Tu(t){var e=function(t){if("object"!=Pu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Pu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pu(e)?e:e+""}function Cu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Cu=function(){return!!t})()}function Au(t){return Au=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Au(t)}function Mu(t,e){return Mu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mu(t,e)}var zu=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Au(e),function(t,e){if(e&&("object"==Pu(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,Cu()?Reflect.construct(e,r||[],Au(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.color=t.color||function(){return"#EA6BAC"},r.mosaicFactor=t.mosaicFactor||.15,r.shadowFactor=t.shadowFactor||.2,r.shadowColor=t.shadowColor||"#555",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&&Mu(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=e.offscreenCtx,i=this.viewScale?this.viewScale(t,r,n):void 0;o.strokeStyle=this.shadowColor,o.lineWidth=this.shadowFactor*r,o.lineJoin="round",o.lineCap="butt";var a,u=r*this.mosaicFactor,c=function(){return{x:Math.random()*u,y:Math.random()*u}},l=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ku(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ku(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(a=l.n()).done;){var s=a.value,f=this.color?this.color(s,r,n,i):void 0;if(f&&"none"!==f){o.fillStyle=f;var h=this.offset(s,r,n),y=c(),p=c(),v=c(),d=c();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+r-v.x,s.y+h.dy+v.y),o.lineTo(s.x+h.dx+r-d.x,s.y+h.dy+r-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+r-v.x,s.y+h.dy+v.y),o.lineTo(s.x+h.dx+r-d.x,s.y+h.dy+r-d.y),o.lineTo(s.x+h.dx+p.x,s.y+h.dy+r-p.y),o.fill()}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,resolution:r,z:n,viewScale:i})}}],n&&Eu(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function Lu(t){return Lu="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},Lu(t)}function Ru(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Iu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Fu(n.key),n)}}function Fu(t){var e=function(t){if("object"!=Lu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Lu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Lu(e)?e:e+""}function Nu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Nu=function(){return!!t})()}function Bu(t){return Bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bu(t)}function Du(t,e){return Du=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Du(t,e)}var Gu=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Bu(e),function(t,e){if(e&&("object"==Lu(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,Nu()?Reflect.construct(e,r||[],Bu(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.color=t.color||function(){return"#EA6BAC"},r.size=t.size||function(t,e){return e},r.shape=t.shape||function(){return"o"},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&&Du(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n,o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,r,o):void 0,u=.5*r,c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ru(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ru(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(n=c.n()).done;){var l=n.value,s=this.color?this.color(l,r,o,a):void 0;if(s&&"none"!==s){i.fillStyle=s;var f=this.size(l,r,o,a),h=(f=f<0?0:f>1?1:f)*u,y=this.shape?this.shape(l):"o";if("none"!==y){var p=l.x+u,v=l.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){c.e(t)}finally{c.f()}this.updateLegends({style:this,resolution:r,z:o,viewScale:a})}}],n&&Iu(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function Wu(t){return Wu="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},Wu(t)}function Uu(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return $u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$u(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function $u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Yu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Hu(n.key),n)}}function Hu(t){var e=function(t){if("object"!=Wu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Wu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Wu(e)?e:e+""}function qu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(qu=function(){return!!t})()}function Vu(t){return Vu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vu(t)}function Xu(t,e){return Xu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xu(t,e)}var Zu=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Vu(e),function(t,e){if(e&&("object"==Wu(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,qu()?Reflect.construct(e,r||[],Vu(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.ts=t.ts,r.noData=t.noData||function(t){return void 0===t||""==t||null===t||isNaN(+t)},r.offsetX=t.offsetX||function(t,e,r){return 0},r.width=t.width||function(t,e,r){return e},r.offsetY=t.offsetY||function(t,e,r){return 0},r.height=t.height||function(t,e,r){return e},r.anchorModeY=t.anchorModeY||function(t,e,r){return"center"},r.lineWidth=t.lineWidth||function(t,e,r,n){return 1.5*n},r.color=t.color||function(){return"black"},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&&Xu(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i,a=e.view.z,u=e.offscreenCtx,c=this.viewScale?this.viewScale(t,r,a):void 0,l=function(t){var e,r,o,i=Uu(n.ts);try{for(i.s();!(o=i.n()).done;){var a=t[o.value];null!=a&&((null==e||a<e)&&(e=a),(null==r||a>r)&&(r=a))}}catch(t){i.e(t)}finally{i.f()}if(null!=e)return r-e},s=Uu(t);try{for(s.s();!(i=s.n()).done;){var f=l(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=Uu(t);try{for(p.s();!(y=p.n()).done;){var v=y.value,d=this.lineWidth?this.lineWidth(v,r,a,c):void 0;if(d&&!(d<0)){var b=this.color?this.color(v,r,a,c):void 0;if(b){var m=this.offsetX?this.offsetX(v,r,a):0;if(null!=m&&!isNaN(m)){var g=this.width?this.width(v,r,a):r;if(null!=g&&!isNaN(g)){var w=this.offsetY?this.offsetY(v,r,a):0;if(null!=w&&!isNaN(w)){var x=this.height?this.height(v,r,a):r;if(null!=x&&!isNaN(x)){var S=this.anchorModeY?this.anchorModeY(v,r,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=Uu(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 E,T=Uu(this.ts);try{for(T.s();!(E=T.n()).done;){var C=+v[E.value];null!=C&&(null==O||C>O)&&(O=C)}}catch(t){T.e(t)}finally{T.f()}_=r}else{if("center"!==S){console.log("Unexpected anchorModeY: "+S);continue}var A,M=void 0,z=void 0,L=Uu(this.ts);try{for(L.s();!(A=L.n()).done;){var R=v[A.value];null!=R&&((null==M||R<M)&&(M=R),(null==z||R>z)&&(z=R))}}catch(t){L.e(t)}finally{L.f()}O=.5*(+z+ +M),_=r/2}var I=g/(h-1),F=v[this.ts[0]];this.noData(F)||(u.beginPath(),u.moveTo(v.x+m,v.y+_+(F-O)*x/o+w));for(var N=void 0,B=1;B<h;B++)N=v[this.ts[B]],this.noData(F)&&this.noData(N)||(!this.noData(F)&&this.noData(N)?u.stroke():this.noData(F)&&!this.noData(N)?(u.beginPath(),u.moveTo(v.x+B*I+m,v.y+_+(N-O)*x/o+w)):(u.lineTo(v.x+B*I+m,v.y+_+(N-O)*x/o+w),B==h-1&&u.stroke())),F=N}}}}}}}}}catch(t){p.e(t)}finally{p.f()}this.updateLegends({style:this,resolution:r,z:a,viewScale:c})}}}],n&&Yu(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function Ju(t){return Ju="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},Ju(t)}function Ku(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||tc(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 Qu(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=tc(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function tc(t,e){if(t){if("string"==typeof t)return ec(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ec(t,e):void 0}}function ec(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function rc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,nc(n.key),n)}}function nc(t){var e=function(t){if("object"!=Ju(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ju(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ju(e)?e:e+""}function oc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(oc=function(){return!!t})()}function ic(t){return ic=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ic(t)}function ac(t,e){return ac=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ac(t,e)}var uc=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=ic(e),function(t,e){if(e&&("object"==Ju(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,oc()?Reflect.construct(e,r||[],ic(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.color=t.color,r.height=t.height||function(t,e,r,n){return.4*e},r.angle=null!=t.angle?t.angle:50,r.cornerLineStrokeColor=t.cornerLineStrokeColor||function(t,e,r,n){return"#999"},r.cornerLineWidth=t.cornerLineWidth||function(t,e,r,n){return n%90==0?0:.8*r},r.sVert=null==t.sVert||t.sVert,r.sHor=null==t.sHor||t.sHor,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&&ac(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,r,o):void 0,u=Object.keys(this.color),c=r/2,l=this.offset(void 0,r,o),s=l.dx,f=l.dy,h=Xi.buildSides(t,r,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=n.cornerLineWidth?n.cornerLineWidth(t,r,o,n.angle):.8*o;if(0!=e){i.strokeStyle=n.cornerLineStrokeColor?n.cornerLineStrokeColor(t,r,o,n.angle):"#333",i.lineWidth=e;var u=n.height(t,r,o,a);i.beginPath(),i.moveTo(t.x+c+s,t.y+c+f),i.lineTo(t.x+c+u*p+s,t.y+c+u*v+f),i.stroke()}}};i.lineCap="round";var g,w=Qu(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,r,o,a):0,k=O?this.height(O,r,o,a):0,E=cc(S,u),T=cc(O,u);if(0!=E||0!=T)for(var C=0,A=0,M=0,z=Object.entries(this.color);M<z.length;M++){var L=Ku(z[M],2),R=L[0],I=L[1],F=S?+S[R]:0,N=O?+O[R]:0;if(0!=F||0!=N){var B=P*C/E||0,D=P*(C+F)/E||0,G=k*A/T||0,W=k*(A+N)/T||0;i.beginPath(),"h"==x.or?(i.moveTo(_+B*p+s,j-c+B*v+f),i.lineTo(_+G*p+s,j+c+G*v+f),i.lineTo(_+W*p+s,j+c+W*v+f),i.lineTo(_+D*p+s,j-c+D*v+f)):(i.moveTo(_-c+B*p+s,j+B*v+f),i.lineTo(_+c+G*p+s,j+G*v+f),i.lineTo(_+c+W*p+s,j+W*v+f),i.lineTo(_-c+D*p+s,j+D*v+f)),i.fillStyle=I,i.fill(),C+=F,A+=N,m(S),m(O)}}}}catch(t){w.e(t)}finally{w.f()}this.updateLegends({style:this,resolution:r,z:o,viewScale:a})}}}],n&&rc(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn),cc=function(t,e){if(!t)return 0;var r,n=0,o=Qu(e);try{for(o.s();!(r=o.n()).done;){var i=t[r.value];i&&(n+=+i)}}catch(t){o.e(t)}finally{o.f()}return n||0};function lc(t){return lc="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},lc(t)}function sc(){sc=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new C(n||[]);return o(a,"_invoke",{value:P(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",y="suspendedYield",p="executing",v="completed",d={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(A([])));S&&S!==r&&n.call(S,a)&&(w=S);var O=g.prototype=b.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==lc(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=k(u,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:y,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(lc(e)+" is not iterable")}return m.prototype=g,o(O,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},_(j.prototype),l(j.prototype,u,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(O),l(O,c,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function fc(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return hc(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?hc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function hc(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function yc(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function pc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,vc(n.key),n)}}function vc(t){var e=function(t){if("object"!=lc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=lc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lc(e)?e:e+""}function dc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(dc=function(){return!!t})()}function bc(t){return bc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bc(t)}function mc(t,e){return mc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mc(t,e)}var gc=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=bc(e),function(t,e){if(e&&("object"==lc(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,dc()?Reflect.construct(e,r||[],bc(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.image=t.image||function(){return""},r.size=t.size||function(t,e){return e},r.cache={},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&&mc(t,e)}(e,t),r=e,n=[{key:"draw",value:(o=sc().mark((function t(e,r,n){var o,i,a,u,c,l,s,f=this;return sc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=r.view.z,i=n/o,a=this.viewScale?this.viewScale(e,n,o):void 0,r.initCanvasTransform(),u=fc(e),t.prev=4,l=sc().mark((function t(){var e,u,l,s,h,y;return sc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.value,u=f.image(e,n,o,a)){t.next=4;break}return t.abrupt("return",0);case 4:if(l=f.size(e,n,o,a)/o){t.next=7;break}return t.abrupt("return",0);case 7:if("loading"!=(s=f.cache[u])){t.next=12;break}return t.abrupt("return",{v:void 0});case 12:if(s){y=(i-l)/2;try{r.offscreenCtx.drawImage(s,r.geoToPixX(e.x)+y,r.geoToPixY(e.y)+y-i,l,l)}catch(t){console.error(t)}}else f.cache[u]="loading",(h=new Image).onload=function(){f.cache[u]=h,r.redraw()},h.onerror=function(){console.warn("Could not retrieve image from",u)},h.src=u;case 13:case"end":return t.stop()}}),t)})),u.s();case 7:if((c=u.n()).done){t.next=16;break}return t.delegateYield(l(),"t0",9);case 9:if(0!==(s=t.t0)){t.next=12;break}return t.abrupt("continue",14);case 12:if(!s){t.next=14;break}return t.abrupt("return",s.v);case 14:t.next=7;break;case 16:t.next=21;break;case 18:t.prev=18,t.t1=t.catch(4),u.e(t.t1);case 21:return t.prev=21,u.f(),t.finish(21);case 24:this.updateLegends({style:this,resolution:n,z:o,viewScale:a});case 25:case"end":return t.stop()}}),t,this,[[4,18,21,24]])})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){yc(i,r,n,a,u,"next",t)}function u(t){yc(i,r,n,a,u,"throw",t)}a(void 0)}))},function(t,e,r){return i.apply(this,arguments)})}],n&&pc(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i}(Sn);function wc(t){return wc="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},wc(t)}function xc(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Sc(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Sc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Sc(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Oc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_c(n.key),n)}}function _c(t){var e=function(t){if("object"!=wc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=wc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wc(e)?e:e+""}function jc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(jc=function(){return!!t})()}function Pc(t){return Pc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pc(t)}function kc(t,e){return kc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kc(t,e)}var Ec=function(t){function e(t,r){var n,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),n=function(t,e,r){return e=Pc(e),function(t,e){if(e&&("object"==wc(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,jc()?Reflect.construct(e,r||[],Pc(t).constructor):e.apply(t,r))}(this,e,[o]),o=o||{},n.dataset=t,n.styles=r,n.minPixelsPerCell=o.minPixelsPerCell||3,n.cellInfoHTML=o.cellInfoHTML||e.defaultCellInfoHTML,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&&kc(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,r){var n=t.view.z,o=t.offscreenCtx,i=this.getDataset(n);if(i){i.getData(t.extGeo),i.updateViewCache(t.extGeo);var a,u=xc(this.styles);try{for(u.s();!(a=u.n()).done;){var c=a.value;c.visible&&!c.visible(n)||(o.globalAlpha=c.alpha?c.alpha(n):1,c.blendOperation&&(o.globalCompositeOperation=c.blendOperation(n)),t.setCanvasTransform(),c.draw(i.getViewCache(),t,i.getResolution()),c.filterColor&&c.drawFilter(t))}}catch(t){u.e(t)}finally{u.f()}if(r){var l,s=xc(this.styles);try{for(s.s();!(l=s.n()).done;){var f=l.value;if((!f.visible||f.visible(n))&&(e.addLegends(r,f.legends),f.styles)){var h,y=xc(f.styles);try{for(y.s();!(h=y.n()).done;){var p=h.value;p.visible&&!p.visible(n)||e.addLegends(r,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 r,n=xc(e);try{for(n.s();!(r=n.n()).done;){var o=r.value;this.addLegends(t,o)}}catch(t){n.e(t)}finally{n.f()}}else t.node().append(e.div.node())}},{key:"defaultCellInfoHTML",value:function(t){for(var e=[],r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];"x"!==o&&"y"!==o&&e.push("<b>",o,"</b>"," : ",t[o],"<br>")}return e.join("")}}],n&&Oc(r.prototype,n),o&&Oc(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Tn);function Tc(t){return Tc="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},Tc(t)}function Cc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ac(n.key),n)}}function Ac(t){var e=function(t){if("object"!=Tc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Tc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tc(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 Lc(t,e){return Lc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Lc(t,e)}var Rc=function(t){function e(t){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=zc(e),function(t,e){if(e&&("object"==Tc(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,r||[],zc(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.cache={},r.url=t.url,r.urlFun=t.urlFun||function(t,e,n){return r.url+n+"/"+t+"/"+e+".png"},r.resolutions=t.resolutions,!r.resolutions||0==r.resolutions.length)throw new Error("No resolutions provided for background layer");return r.nbPix=t.nbPix||256,r.origin=t.origin||[0,0],r.z0=t.z0||0,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&&Lc(t,e)}(e,t),r=e,(n=[{key:"get",value:function(t,e,r){var n=this.cache[t];if(n&&(n=n[e]))return n[r]}},{key:"put",value:function(t,e,r,n){this.cache[e]||(this.cache[e]={}),this.cache[e][r]||(this.cache[e][r]={}),this.cache[e][r][n]=t}},{key:"draw",value:function(t){var e=this;if(this.resolutions&&0!=this.resolutions.length){var r=t.view.z,n=this.origin[0],o=this.origin[1],i=0;for(i=0;i<this.resolutions.length&&!(this.resolutions[i]<r);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,c=u/r,l=function(t){return Math.ceil((t-n)/u)},s=function(t){return Math.ceil(-(t-o)/u)},f=l(t.extGeo.xMin)-1,h=l(t.extGeo.xMax),y=s(t.extGeo.yMin),p=s(t.extGeo.yMax)-1,v=function(r){for(var a=function(a){var l=e.get(i,r,a);if(!l){var s=new Image;return e.put(s,i,r,a),s.onload=function(){t.redraw()},s.onerror=function(){e.put("failed",i,r,a)},s.src=e.urlFun(r,a,i),0}if("failed"===l)return 0;if(!(l instanceof HTMLImageElement))return console.log(l),0;if(0==l.width||0==l.height)return 0;var f=n+r*u,h=o-a*u;try{t.initCanvasTransform(),t.offscreenCtx.drawImage(l,t.geoToPixX(f),t.geoToPixY(h),c,c)}catch(t){console.error(t)}},l=p;l<y;l++)a(l)},d=f;d<h;d++)v(d)}else console.error("No resolutions provided for background layer")}}])&&Cc(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Tn);function Ic(t){return Ic="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},Ic(t)}function Fc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Nc(n.key),n)}}function Nc(t){var e=function(t){if("object"!=Ic(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ic(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ic(e)?e:e+""}function Bc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Bc=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 r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Dc(e),function(t,e){if(e&&("object"==Ic(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,Bc()?Reflect.construct(e,r||[],Dc(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.url=t.url,r.img=void 0,r.xMin=void 0,r.xMax=void 0,r.yMin=void 0,r.yMax=void 0,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&&Gc(t,e)}(e,t),r=e,(n=[{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 r=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",r)}),this.img.src=r}}}])&&Fc(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Tn);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 r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Yc(n.key),n)}}function Yc(t){var e=function(t){if("object"!=Uc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Uc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Uc(e)?e:e+""}function Hc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Hc=function(){return!!t})()}function qc(t){return qc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qc(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 r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=qc(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,Hc()?Reflect.construct(e,r||[],qc(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.url=t.url,r.xMin=t.xMin||0,r.yMax=t.yMax||0,r.width=t.width||2e4,r.height=t.height||2e4,r.img=void 0,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&&Vc(t,e)}(e,t),r=e,(n=[{key:"draw",value:function(t){var e=this;if(this.img){var r=t.geoToPixX(this.xMin),n=t.geoToPixY(this.yMax),o=t.getView().z;t.initCanvasTransform(),t.offscreenCtx.drawImage(this.img,r,n,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}}])&&$c(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Tn);function Zc(t){return Zc="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},Zc(t)}function Jc(){Jc=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new C(n||[]);return o(a,"_invoke",{value:P(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",y="suspendedYield",p="executing",v="completed",d={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(A([])));S&&S!==r&&n.call(S,a)&&(w=S);var O=g.prototype=b.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Zc(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=k(u,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:y,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Zc(e)+" is not iterable")}return m.prototype=g,o(O,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},_(j.prototype),l(j.prototype,u,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(O),l(O,c,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function Kc(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function Qc(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return tl(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?tl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function tl(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function el(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,rl(n.key),n)}}function rl(t){var e=function(t){if("object"!=Zc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Zc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Zc(e)?e:e+""}function nl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(nl=function(){return!!t})()}function ol(t){return ol=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ol(t)}function il(t,e){return il=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},il(t,e)}var al=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=ol(e),function(t,e){if(e&&("object"==Zc(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,nl()?Reflect.construct(e,r||[],ol(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.url=t.url,r.style=t.style||function(){return"1.2em Arial"},r.color=t.color||(t.dark?function(){return"white"}:function(){return"black"}),r.haloColor=t.haloColor||(t.dark?function(){return"black"}:function(){return"white"}),r.haloWidth=t.haloWidth||function(){return 2.5},r.textAlign=t.textAlign||"start",r.offsetPix=t.offsetPix||[5,5],r.preprocess=t.preprocess,r.labels=void 0,r.loadingStatus="notLoaded",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&&il(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t){if(this.labels){var e=t.view.z,r=t.offscreenCtx;r.textAlign=this.textAlign||"start",r.lineJoin="bevel",r.lineCap="butt",t.initCanvasTransform();var n,o=Qc(this.labels);try{for(o.s();!(n=o.n()).done;){var i=n.value,a=this.style(i,e);if(a&&(r.font=a,t.toDraw(i))){var u=t.geoToPixX(i.x)+this.offsetPix[0],c=t.geoToPixY(i.y)-this.offsetPix[1];if(this.haloColor&&this.haloWidth){var l=this.haloColor(i,e),s=this.haloWidth(i,e);l&&s&&s>0&&(r.strokeStyle=l,r.lineWidth=s,r.strokeText(i.name,u,c))}if(this.color){var f=this.color(i,e);f&&(r.fillStyle=f,r.fillText(i.name,u,c))}}}}catch(t){o.e(t)}finally{o.f()}}else this.load(t.redraw)}},{key:"load",value:(o=Jc().mark((function t(e){var r,n,o,i;return Jc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.url){t.next=5;break}return console.log("Failed loading labels: No URL specified. "+this.url),this.loadingStatus="failed",this.labels=[],t.abrupt("return");case 5:if("notLoaded"==this.loadingStatus){t.next=7;break}return t.abrupt("return");case 7:return this.loadingStatus="loading",t.prev=8,t.next=11,no(this.url);case 11:if(r=t.sent,!this.preprocess){t.next=35;break}this.labels=[],n=Qc(r),t.prev=15,n.s();case 17:if((o=n.n()).done){t.next=25;break}if(i=o.value,0!=this.preprocess(i)){t.next=22;break}return t.abrupt("continue",23);case 22:this.labels.push(i);case 23:t.next=17;break;case 25:t.next=30;break;case 27:t.prev=27,t.t0=t.catch(15),n.e(t.t0);case 30:return t.prev=30,n.f(),t.finish(30);case 33:t.next=36;break;case 35:this.labels=r;case 36:this.loadingStatus="loaded",e&&e(),t.next=45;break;case 40:t.prev=40,t.t1=t.catch(8),console.log("Failed loading labels from "+this.url),this.labels=[],this.loadingStatus="failed";case 45:case"end":return t.stop()}}),t,this,[[8,40],[15,27,30,33]])})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){Kc(i,r,n,a,u,"next",t)}function u(t){Kc(i,r,n,a,u,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)})}],n&&el(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i}(Tn);function ul(t){return ul="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},ul(t)}function cl(){cl=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new C(n||[]);return o(a,"_invoke",{value:P(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",y="suspendedYield",p="executing",v="completed",d={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(A([])));S&&S!==r&&n.call(S,a)&&(w=S);var O=g.prototype=b.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==ul(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=k(u,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:y,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(ul(e)+" is not iterable")}return m.prototype=g,o(O,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},_(j.prototype),l(j.prototype,u,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(O),l(O,c,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function ll(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function sl(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return fl(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function fl(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function hl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,yl(n.key),n)}}function yl(t){var e=function(t){if("object"!=ul(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ul(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ul(e)?e:e+""}function pl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(pl=function(){return!!t})()}function vl(t){return vl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vl(t)}function dl(t,e){return dl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},dl(t,e)}var bl=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=vl(e),function(t,e){if(e&&("object"==ul(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,pl()?Reflect.construct(e,r||[],vl(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.url=t.url,r.preprocess=t.preprocess,r.shape=t.shape||function(t,e){return"circle"},r.size=t.size||function(t,e){return 10},r.strokeStyle=t.strokeStyle||function(t,e){return"red"},r.fillStyle=t.fillStyle||function(t,e){return"black"},r.lineWidth=t.lineWidth||function(t,e){return 2},r.color=t.color||function(t,e){return"gray"},r.width=t.width||function(t,e){return 2},r.lineDash=t.lineDash||function(t,e){},r.fs=void 0,r.loadingStatus="notLoaded",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&&dl(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t){if(this.fs){var e,r=t.view.z,n=t.offscreenCtx,o=sl(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,c=this.shape(i,r);if(!c||"none"==c)continue;var l=this.size(i,r)*r;if(!l)continue;var s=this.strokeStyle(i,r),f=this.fillStyle(i,r),h=this.lineWidth(i,r)*r;s&&(n.strokeStyle=s),f&&(n.fillStyle=f),h&&(n.lineWidth=h),"circle"==c?(n.beginPath(),n.arc(u[0],u[1],l/2,0,2*Math.PI,!1),f&&n.fill(),s&&h&&n.stroke()):"square"==c?(n.beginPath(),n.rect(u[0]-l/2,u[1]-l/2,l,l),f&&n.fill(),s&&h&&n.stroke()):console.error("Unexpected shape for point geojson: "+c)}else if("LineString"==a){var y=i.geometry.coordinates;if(y.length<2)continue;var p=this.color(i,r);if(!p||"none"==p)continue;n.strokeStyle=p;var v=this.width(i,r);if(!v||v<0)continue;n.lineWidth=v*r;var d=this.lineDash(i,r);d&&n.setLineDash(d),n.beginPath(),n.moveTo(y[0][0],y[0][1]);for(var b=1;b<y.length;b++)n.lineTo(y[b][0],y[b][1]);n.stroke()}else console.log("Unsupported geometry type in GeoJSONLayer: "+a)}}catch(t){o.e(t)}finally{o.f()}n.setLineDash([])}else this.load(t.redraw)}},{key:"load",value:(o=cl().mark((function t(e){var r,n,o,i,a;return cl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.url){t.next=5;break}return console.log("Failed loading boundaries: No URL specified. "+this.url),this.loadingStatus="failed",this.labels=[],t.abrupt("return");case 5:if("notLoaded"==this.loadingStatus){t.next=7;break}return t.abrupt("return");case 7:return this.loadingStatus="loading",t.prev=8,t.next=11,Wn(this.url);case 11:if(r=t.sent,n=r.features,!this.preprocess){t.next=36;break}this.fs=[],o=sl(n),t.prev=16,o.s();case 18:if((i=o.n()).done){t.next=26;break}if(a=i.value,0!=this.preprocess(a)){t.next=23;break}return t.abrupt("continue",24);case 23:this.fs.push(a);case 24:t.next=18;break;case 26:t.next=31;break;case 28:t.prev=28,t.t0=t.catch(16),o.e(t.t0);case 31:return t.prev=31,o.f(),t.finish(31);case 34:t.next=37;break;case 36:this.fs=n;case 37:this.loadingStatus="loaded",e&&e(),t.next=46;break;case 41:t.prev=41,t.t1=t.catch(8),console.log("Failed loading boundaries from "+this.url),this.fs=[],this.loadingStatus="failed";case 46:case"end":return t.stop()}}),t,this,[[8,41],[16,28,31,34]])})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){ll(i,r,n,a,u,"next",t)}function u(t){ll(i,r,n,a,u,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)})}],n&&hl(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i}(Tn);function ml(t){return ml="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},ml(t)}function gl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wl(n.key),n)}}function wl(t){var e=function(t){if("object"!=ml(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ml(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ml(e)?e:e+""}var xl=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&&gl(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Sl(t){return Sl="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},Sl(t)}function Ol(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_l(n.key),n)}}function _l(t){var e=function(t){if("object"!=Sl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Sl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Sl(e)?e:e+""}function jl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(jl=function(){return!!t})()}function Pl(t){return Pl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pl(t)}function kl(t,e){return kl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kl(t,e)}var El=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Pl(e),function(t,e){if(e&&("object"==Sl(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,r||[],Pl(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.colorScale=t.colorScale,r.textScale=t.textScale||function(t){return t},r.margin=t.margin||5,r.tickSize=t.tickSize||6,r.ticks=t.ticks||Math.floor(r.width/50),r.tickFormat=t.tickFormat,r.tickUnit=t.tickUnit,r.fontSize=t.fontSize||"0.8em",r.invert=t.invert,r.width=t.width||300,r.height=t.height||15,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&&kl(t,e)}(e,t),r=e,n=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();for(var e=this.width+2*this.margin,r=this.height+this.margin+this.tickSize+10,n=this.div.append("svg").attr("width",e).attr("height",r).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),n.append("rect").attr("x",a).attr("y",0).attr("width",5).attr("height",i).style("fill",this.colorScale(u,t.viewScale))}for(var c=0;c<this.ticks;c++){var l=c/(this.ticks-1);n.append("line").attr("x1",o*l).attr("y1",0).attr("x2",o*l).attr("y2",i+this.tickSize).style("stroke","black"),n.append("text").attr("id","ticklabel_"+c).attr("x",o*l).attr("y",i+this.tickSize+2).style("font-size",this.fontSize).style("text-anchor",0==c?"start":c==this.ticks-1?"end":"middle").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none")}for(var s=this.tickFormat&&"text"!=this.tickFormat?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)}}}],n&&Ol(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(xl);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 Cl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Al(n.key),n)}}function Al(t){var e=function(t){if("object"!=Tl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Tl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tl(e)?e:e+""}function Ml(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ml=function(){return!!t})()}function zl(t){return zl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zl(t)}function Ll(t,e){return Ll=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ll(t,e)}var Rl=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=zl(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,Ml()?Reflect.construct(e,r||[],zl(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.colors=t.colors,r.breaks=t.breaks,r.width=t.width||300,r.height=t.height||15,r.tickSize=t.tickSize||3,r.invert=t.invert,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&&Ll(t,e)}(e,t),r=e,(n=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();var e=this.colors(t.viewScale),r=this.breaks(t.viewScale);if(r){var n=e.length;if(0!=n){for(var o=this.width/n,i=this.div.append("svg").attr("width",this.width).attr("height",this.height+this.tickSize+2+10),a=0;a<n;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<n;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 c=1;c<n;c++){var l=r[c-1];isNaN(l)||null==l||(this.labelFormat&&(l=this.labelFormat(l)),i.append("text").attr("id","ticklabel_"+c).attr("x",o*c).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(l))}}}}}])&&Cl(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(xl);function Il(t){return Il="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},Il(t)}function Fl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Nl(n.key),n)}}function Nl(t){var e=function(t){if("object"!=Il(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Il(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Il(e)?e:e+""}function Bl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Bl=function(){return!!t})()}function Dl(t){return Dl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dl(t)}function Gl(t,e){return Gl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gl(t,e)}var Wl=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Dl(e),function(t,e){if(e&&("object"==Il(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,r||[],Dl(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.colorLabel=t.colorLabel||[["gray","-"]],r.shape=t.shape||"circle",r.dimension=t.dimension||{r:8},r.strokeColor=t.strokeColor||"gray",r.strokeWidth=t.strokeWidth||1,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&&Gl(t,e)}(e,t),r=e,(n=[{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 r=this.colorLabel[e],n=this.div.append("div"),o=this.strokeWidth;if("square"===this.shape){var i=this.dimension.h||15,a=this.dimension.w||20;n.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",r[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,c=2*u+2*o;n.append("div").style("display","inline").append("svg").attr("width",c).attr("height",c).append("circle").attr("cx",u+o).attr("cy",u+o).attr("r",u).style("fill",r[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}n.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(r[1])}}}])&&Fl(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(xl);function Ul(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function $l(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[8,6,5,4,2.5,2],n=Math.pow(10,Math.floor(Math.log10(t))),o=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ul(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ul(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(r);try{for(o.s();!(e=o.n()).done;){var i=e.value;if(n*i<=t)return n*i}}catch(t){o.e(t)}finally{o.f()}return n}function Yl(t){return Yl="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},Yl(t)}function Hl(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ql(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ql(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function ql(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Vl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Xl(n.key),n)}}function Xl(t){var e=function(t){if("object"!=Yl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Yl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Yl(e)?e:e+""}function Zl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Zl=function(){return!!t})()}function Jl(t){return Jl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Jl(t)}function Kl(t,e){return Kl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Kl(t,e)}var Ql=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Jl(e),function(t,e){if(e&&("object"==Yl(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,Zl()?Reflect.construct(e,r||[],Jl(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.label=t.label||void 0,r.size=t.size||void 0,r.shape=t.shape||"circle",r.fillColor=t.fillColor||"none",r.strokeColor=t.strokeColor||"gray",r.strokeWidth=t.strokeWidth||1,r.color=t.color||"gray",r.length=t.length||function(t,e,r){return t},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&&Kl(t,e)}(e,t),r=e,(n=[{key:"update",value:function(t){var e=this;this.div.selectAll("*").remove(),this.makeTitle();var r,n=this.label(t.viewScale,t.cells,t.resolution,t.z);if(r=this.size?this.size(t.viewScale,t.resolution,t.z)/t.z:t.viewScale(+n)/t.z){this.labelFormat&&!isNaN(+n)&&(n=this.labelFormat(n));var o=this.div.append("div"),i=function(){return o.append("svg").attr("width",r+e.strokeWidth+2).attr("height",r+e.strokeWidth+2).style("","inline-block")};if("square"===this.shape)i().append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",r).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth);else if("circle"===this.shape){var a=.5*(r+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",r).style("","inline-block").append("line").attr("x1",0).attr("y1",r/2).attr("x2",u).attr("y2",r/2).style("stroke",this.color).style("stroke-width",r)}o.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(n+(this.labelUnitText?" ":"")+this.labelUnitText)}}}])&&Vl(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(xl);function ts(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=[],i=Hl(t);try{var a=function(){var i=r.value;n.title=i==t[0]?n.title:void 0,n.size=function(){return e(i)},n.label=function(){return i},o.push(new Ql(n))};for(i.s();!(r=i.n()).done;)a()}catch(t){i.e(t)}finally{i.f()}return o}function es(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.k||[.9,.5,.2,.05],o=[],i=Hl(n);try{var a=function(){var i=e.value;r.title=i==n[0]?r.title:void 0,r.label=function(e,r){return $l(i*Ma(r,t))},o.push(new Ql(r))};for(i.s();!(e=i.n()).done;)a()}catch(t){i.e(t)}finally{i.f()}return o}function rs(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.labelFormat||function(t){return t},o=r.labelText||os(n),i=[],a=function(n){r.title=n==e.length-1?r.title:void 0,r.size=function(){return e[n]},r.label=function(){return o(t[n-1],t[n])},i.push(new Ql(r))},u=e.length-1;u>=0;u--)a(u);return i}function ns(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.labelFormat||function(t){return t},n=e.labelText||os(r),o=[],i=e.viewScaleFun||function(t){return t},a=function(r){e.title=r==t-1?e.title:void 0,e.size=function(t){return i(t).values[r]},e.label=function(t){return n(i(t).breaks[r-1],i(t).breaks[r])},o.push(new Ql(e))},u=t-1;u>=0;u--)a(u);return o}function os(t){return function(e,r){return null==e&&null==r?"":null==r?"> "+t(e):null==e?"< "+t(r):t(e)+" - "+t(r)}}function is(t){return is="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},is(t)}function as(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,us(n.key),n)}}function us(t){var e=function(t){if("object"!=is(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=is(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==is(e)?e:e+""}function cs(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(cs=function(){return!!t})()}function ls(t){return ls=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ls(t)}function ss(t,e){return ss=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ss(t,e)}var fs=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=ls(e),function(t,e){if(e&&("object"==is(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,cs()?Reflect.construct(e,r||[],ls(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.orientation=t.orientation||0,r.color=t.color||function(t,e,r){return"gray"},r.width=t.width||function(t,e,r){return 3*e},r.length=t.length||function(t,e,r){return t},r.label=t.label||"-",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&&ss(t,e)}(e,t),r=e,n=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();var e=this.div.append("div"),r=this.color(t.resolution,t.z,t.viewScale),n=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,n),a=e.append("svg").attr("width",i).attr("height",i).style("","inline-block"),u=Math.cos(-this.orientation*Math.PI/180),c=Math.sin(-this.orientation*Math.PI/180),l=.5*i,s=.5*o;a.append("line").attr("x1",l-u*s).attr("y1",l-c*s).attr("x2",l+u*s).attr("y2",l+c*s).style("stroke",r).style("stroke-width",n),e.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(this.label+(this.labelUnitText?" ":"")+this.labelUnitText)}}],n&&as(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(xl);function hs(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=[],o=0;o<t.length;o++)r.title=0==o?r.title:void 0,r.orientation=t[o],r.label=e[o],n.push(new fs(r));return n}function ys(t){return ys="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},ys(t)}function ps(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,vs(n.key),n)}}function vs(t){var e=function(t){if("object"!=ys(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ys(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ys(e)?e:e+""}function ds(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ds=function(){return!!t})()}function bs(t){return bs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bs(t)}function ms(t,e){return ms=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ms(t,e)}var gs=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=bs(e),function(t,e){if(e&&("object"==ys(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,ds()?Reflect.construct(e,r||[],bs(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.classifier=t.classifier,r.width=t.width||150,r.selectionColor=r.selectionColor||"red",r.tooltip=t.tooltip,r.texts=t.texts,r.leftText=t.leftText||"Category 0",r.topText=t.topText||"Category 1",r.rightText=t.rightText||"Category 2",r.centerCoefficient=t.centerCoefficient||r.classifier.centerCoefficient,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&&ms(t,e)}(e,t),r=e,n=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();var e=this.width,r=.866025*e,n=this.classifier,o=this.selectionColor,i=this.tooltip,a=this.texts||{},u=this.div.append("svg").attr("width",e+0).attr("height",r+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+r).text(this.leftText).attr("font-size",12).attr("text-anchor","start"),u.append("text").attr("x",e).attr("y",30+r).text(this.rightText).attr("font-size",12).attr("text-anchor","end");var c=u.append("g").attr("transform","translate(0 16)"),l=function(t,e,r){t.attr("fill",e).on("mouseover",(function(t){pt(this).attr("fill",o),i&&r&&(i.html(r),i.setPosition(t),i.show())})).on("mouseout",(function(){pt(this).attr("fill",e),i&&i.hide()})),i&&r&&t.on("mousemove",(function(t){i.setPosition(t)}))};l(c.append("polygon").attr("points","0,"+r+" "+e/3+","+r+" "+e/2+","+2*r/3+" "+e/6+","+2*r/3),n.colors[0],a[0]),l(c.append("polygon").attr("points",e/2+",0 "+2*e/3+","+r/3+" "+e/2+","+2*r/3+" "+e/3+","+r/3),n.colors[1],a[1]),l(c.append("polygon").attr("points",e+","+r+" "+5*e/6+","+2*r/3+" "+e/2+","+2*r/3+" "+2*e/3+","+r),n.colors[2],a[2]),l(c.append("polygon").attr("points",e/2+","+2*r/3+" "+5*e/6+","+2*r/3+" "+2*e/3+","+r/3),n.mixColors[0],a.m12),l(c.append("polygon").attr("points",e/2+","+2*r/3+" "+e/3+","+r+" "+2*e/3+","+r),n.mixColors[1],a.m02),l(c.append("polygon").attr("points",e/2+","+2*r/3+" "+e/6+","+2*r/3+" "+e/3+","+r/3),n.mixColors[2],a.m01),this.centerCoefficient&&l(c.append("circle").attr("cx",e/2).attr("cy",2*r/3).attr("r",this.centerCoefficient*r/3),n.centerColor,a.center)}}],n&&ps(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(xl),ws=function(t){return t};ws.invert=ws;var xs=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(0==t)return ws;var e=Math.exp(t)-1,r=function(r){return(Math.exp(r*t)-1)/e};return r.invert=function(r){return Math.log(e*r+1)/t},r},Ss=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(0==t)return ws;var e=Math.exp(t),r=1-e,n=function(n){return 1-Math.log(e+n*r)/t};return n.invert=function(n){return(Math.exp((1-n)*t)-e)/r},n},Os=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(1==t)return ws;var e=function(e){return Math.pow(e,t)},r=1/t;return e.invert=function(t){return Math.pow(t,r)},e},_s=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(1==t)return ws;var e=1/t,r=function(t){return 1-Math.pow(1-t,e)};return r.invert=function(e){return 1-Math.pow(1-e,t)},r},js=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;if(0==t)return ws;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}},Ps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;if(0==t)return ws;var e=js(t);return function(t){return 1-e(1-t)}};const ks=Math.PI/180,Es=180/Math.PI,Ts=.96422,Cs=.82521,As=4/29,Ms=6/29,zs=3*Ms*Ms,Ls=Ms*Ms*Ms;function Rs(t){if(t instanceof Fs)return new Fs(t.l,t.a,t.b,t.opacity);if(t instanceof Ws)return Us(t);t instanceof Ae||(t=Te(t));var e,r,n=Gs(t.r),o=Gs(t.g),i=Gs(t.b),a=Ns((.2225045*n+.7168786*o+.0606169*i)/1);return n===o&&o===i?e=r=a:(e=Ns((.4360747*n+.3850649*o+.1430804*i)/Ts),r=Ns((.0139322*n+.0971045*o+.7141733*i)/Cs)),new Fs(116*a-16,500*(e-a),200*(a-r),t.opacity)}function Is(t,e,r,n){return 1===arguments.length?Rs(t):new Fs(t,e,r,null==n?1:n)}function Fs(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function Ns(t){return t>Ls?Math.pow(t,1/3):t/zs+As}function Bs(t){return t>Ms?t*t*t:zs*(t-As)}function Ds(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Gs(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ws(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function Us(t){if(isNaN(t.h))return new Fs(t.l,0,0,t.opacity);var e=t.h*ks;return new Fs(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function $s(t,e){var r=Ye((t=Is(t)).l,(e=Is(e)).l),n=Ye(t.a,e.a),o=Ye(t.b,e.b),i=Ye(t.opacity,e.opacity);return function(e){return t.l=r(e),t.a=n(e),t.b=o(e),t.opacity=i(e),t+""}}function Ys(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Hs(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Hs(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 Hs(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}ce(Fs,Is,le(se,{brighter(t){return new Fs(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new Fs(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,r=isNaN(this.b)?t:t-this.b/200;return new Ae(Ds(3.1338561*(e=Ts*Bs(e))-1.6168667*(t=1*Bs(t))-.4906146*(r=Cs*Bs(r))),Ds(-.9787684*e+1.9161415*t+.033454*r),Ds(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),ce(Ws,(function(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof Ws)return new Ws(t.h,t.c,t.l,t.opacity);if(t instanceof Fs||(t=Rs(t)),0===t.a&&0===t.b)return new Ws(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Es;return new Ws(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new Ws(t,e,r,null==n?1:n)}),le(se,{brighter(t){return new Ws(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new Ws(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return Us(this).rgb()}}));var qs=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t[0],o=t[1],i=t[2],a=Ys(r.center||[1/3,1/3,1/3],3),u=a[0],c=a[1],l=a[2],s=null==r.withMixedClasses||r.withMixedClasses,f=r.centerCoefficient?1-r.centerCoefficient:void 0,h=function(t){var r=e(t);if(r){var a=+t[n]/r,h=+t[o]/r,y=+t[i]/r;return a>=u&&h<=c&&y<=l?null!=f&&(y-l)*(c-f*c)>=(h-f*c)*(f*l-l)?"center":"0":a<=u&&h>=c&&y<=l?null!=f&&(y-l)*(u-f*u)>=(a-f*u)*(f*l-l)?"center":"1":a<=u&&h<=c&&y>=l?null!=f&&(h-c)*(u-f*u)>=(a-f*u)*(f*c-c)?"center":"2":a<=u&&h>=c&&y>=l?null!=f&&a>f*u?"center":s?"m12":h>y?"1":"2":a>=u&&h<=c&&y>=l?null!=f&&h>f*c?"center":s?"m02":a>y?"0":"2":a>=u&&h>=c&&y<=l?null!=f&&y>f*l?"center":s?"m01":h>a?"1":"0":"unknown"}};return h.center=[u,c,l],h.centerCoefficient=r.centerCoefficient,h},Vs=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=Ys(r||["red","green","blue"],3),i=o[0],a=o[1],u=o[2],c=n.colorInterpolation||$s,l=null==n.withMixedClasses||n.withMixedClasses,s=function(t,e){return c(t,e)(.5)},f=Ys(n.mixedColors||l?[s(a,u),s(i,u),s(i,a)]:[],3),h=f[0],y=f[1],p=f[2],v=n.centerColor||c(s(i,a),u)(.333),d=qs(t,e,n),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:n.defaultColor||"black"};return b.center=d.center,b.centerCoefficient=n.centerCoefficient,b.colors=[i,a,u],b.mixColors=[h,y,p],b.centerColor=v,b.classifier=d,b};function Xs(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}var Zs,Js=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ks(t){if(!(e=Js.exec(t)))throw new Error("invalid format: "+t);var e;return new Qs({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 Qs(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 tf(t,e){var r=Xs(t,e);if(!r)return t+"";var n=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+n:n.length>o+1?n.slice(0,o+1)+"."+n.slice(o+1):n+new Array(o-n.length+2).join("0")}Ks.prototype=Qs.prototype,Qs.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 ef={"%":(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)=>tf(100*t,e),r:tf,s:function(t,e){var r=Xs(t,e);if(!r)return t+"";var n=r[0],o=r[1],i=o-(Zs=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=n.length;return i===a?n:i>a?n+new Array(i-a+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Xs(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function rf(t){return t}var nf,of=Array.prototype.map,af=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function uf(t){return nf=function(t){var e,r,n=void 0===t.grouping||void 0===t.thousands?rf:(e=of.call(t.grouping,Number),r=t.thousands+"",function(t,n){for(var o=t.length,i=[],a=0,u=e[0],c=0;o>0&&u>0&&(c+u+1>n&&(u=Math.max(1,n-c)),i.push(t.substring(o-=u,o+u)),!((c+=u+1)>n));)u=e[a=(a+1)%e.length];return i.reverse().join(r)}),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?rf:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(of.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=Ks(t)).fill,r=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"):ef[m]||(void 0===d&&(d=12),b=!0,m="g"),(y||"0"===e&&"="===r)&&(y=!0,e="0",r="=");var g="$"===h?o:"#"===h&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",w="$"===h?i:/[%p]/.test(m)?c:"",x=ef[m],S=/[defgprs%]/.test(m);function O(t){var o,i,c,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,r=t.length,n=1,o=-1;n<r;++n)switch(t[n]){case".":o=e=n;break;case"0":0===o&&(o=n),e=n;break;default:if(!+t[n])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:l:"-"===f||"("===f?"":f)+h,O=("s"===m?af[8+Zs/3]:"")+O+(_&&"("===f?")":""),S)for(o=-1,i=t.length;++o<i;)if(48>(c=t.charCodeAt(o))||c>57){O=(46===c?a+t.slice(o+1):t.slice(o))+O,t=t.slice(0,o);break}}v&&!y&&(t=n(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=n(P+t,P.length?p-O.length:1/0),P=""),r){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 r,n=f(((t=Ks(t)).type="f",t)),o=3*Math.max(-8,Math.min(8,Math.floor((r=e,((r=Xs(Math.abs(r)))?r[1]:NaN)/3)))),i=Math.pow(10,-o),a=af[8+o/3];return function(t){return n(i*t)+a}}}}(t),nf.format,nf.formatPrefix,nf}uf({thousands:",",grouping:[3],currency:["$",""]});var cf=Lr.getParameterByName;return uf({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,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 r(){}function n(t){return null==t?r: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:()=>Rc,BackgroundLayerImage:()=>Xc,BackgroundLayerWMS:()=>Wc,CSVGrid:()=>Eo,ColorCategoryLegend:()=>Wl,ColorDiscreteLegend:()=>Rl,ColorLegend:()=>El,CompositionStyle:()=>di,Dataset:()=>Rn,DotDensityStyle:()=>wa,GeoCanvas:()=>Lr,GeoJSONLayer:()=>bl,GridLayer:()=>Ec,ImageStyle:()=>gc,IsoFenceStyle:()=>uc,JSGrid:()=>Io,JoyPlotStyle:()=>ai,LabelLayer:()=>al,Layer:()=>Tn,LegoStyle:()=>hu,Map:()=>ln,MosaicStyle:()=>zu,MultiResolutionDataset:()=>Dn,NinjaStarStyle:()=>Gu,OrientationLegend:()=>fs,PillarStyle:()=>Gi,SegmentStyle:()=>_i,ShapeColorSizeStyle:()=>$o,SideCategoryStyle:()=>na,SideStyle:()=>Xi,SizeLegend:()=>Ql,SquareColorCategoryWebGLStyle:()=>Aa,SquareColorWebGLStyle:()=>ju,StrokeStyle:()=>Ko,Style:()=>Sn,TanakaStyle:()=>eu,TernaryLegend:()=>gs,TextStyle:()=>Mi,TiledGrid:()=>vo,TimeSeriesStyle:()=>Zu,circularInverseScale:()=>Ps,circularScale:()=>js,classifier:()=>Xa,colorClassifier:()=>Za,discreteColors:()=>Ja,exponentialScale:()=>xs,getParameterByName:()=>cf,logarithmicScale:()=>Ss,nice:()=>$l,orientationLegend:()=>hs,powerInverseScale:()=>_s,powerScale:()=>Os,sizeDiscreteLegend:()=>rs,sizeDiscreteViewScaleLegend:()=>ns,sizeLegend:()=>ts,sizeLegendViewScale:()=>es,ternaryClassifier:()=>qs,ternaryColorClassifier:()=>Vs,viewScale:()=>$a,viewScaleColor:()=>Ha,viewScaleColorQuantile:()=>qa,viewScaleCombination:()=>Va,viewScaleQuantile:()=>Ya});var c=Array.prototype.find;function l(){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,r,n,o,i){for(var a,u=0,c=e.length,l=i.length;u<l;++u)(a=e[u])?(a.__data__=i[u],n[u]=a):r[u]=new y(t,i[u]);for(;u<c;++u)(a=e[u])&&(o[u]=a)}function v(t,e,r,n,o,i,a){var u,c,l,s=new Map,f=e.length,h=i.length,p=new Array(f);for(u=0;u<f;++u)(c=e[u])&&(p[u]=l=a.call(c,c.__data__,u,e)+"",s.has(l)?o[u]=c:s.set(l,c));for(u=0;u<h;++u)l=a.call(t,i[u],u,i)+"",(c=s.get(l))?(n[u]=c,c.__data__=i[u],s.delete(l)):r[u]=new y(t,i[u]);for(u=0;u<f;++u)(c=e[u])&&s.get(p[u])===c&&(o[u]=c)}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+="",r=e.indexOf(":");return r>=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+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 r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}}function k(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function E(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function T(t){return function(){this.style.removeProperty(t)}}function C(t,e,r){return function(){this.style.setProperty(t,e,r)}}function A(t,e,r){return function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function M(t,e){return t.style.getPropertyValue(e)||E(t).getComputedStyle(t,null).getPropertyValue(e)}function z(t){return function(){delete this[t]}}function L(t,e){return function(){this[t]=e}}function R(t,e){return function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}}function I(t){return t.trim().split(/^|\s+/)}function F(t){return t.classList||new N(t)}function N(t){this._node=t,this._names=I(t.getAttribute("class")||"")}function B(t,e){for(var r=F(t),n=-1,o=e.length;++n<o;)r.add(e[n])}function D(t,e){for(var r=F(t),n=-1,o=e.length;++n<o;)r.remove(e[n])}function G(t){return function(){B(this,t)}}function W(t){return function(){D(this,t)}}function U(t,e){return function(){(e.apply(this,arguments)?B:D)(this,t)}}function $(){this.textContent=""}function Y(t){return function(){this.textContent=t}}function H(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function q(){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,r=this.namespaceURI;return r===g&&e.documentElement.namespaceURI===g?e.createElement(t):e.createElementNS(r,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 rt(){var t=this.parentNode;t&&t.removeChild(this)}function nt(){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 r,n=0,o=-1,i=e.length;n<i;++n)r=e[n],t.type&&r.type!==t.type||r.name!==t.name?e[++o]=r:this.removeEventListener(r.type,r.listener,r.options);++o?e.length=o:delete this.__on}}}function at(t,e,r){return function(){var n,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((n=o[a]).type===t.type&&n.name===t.name)return this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=i,n.options=r),void(n.value=e);this.addEventListener(t.type,i,r),n={type:t.type,name:t.name,value:e,listener:i,options:r},o?o.push(n):this.__on=[n]}}function ut(t,e,r){var n=E(t),o=n.CustomEvent;"function"==typeof o?o=new o(e,r):(o=n.document.createEvent("Event"),r?(o.initEvent(e,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function ct(t,e){return function(){return ut(this,t,e)}}function lt(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=n(t));for(var e=this._groups,r=e.length,o=new Array(r),i=0;i<r;++i)for(var a,u,c=e[i],l=c.length,s=o[i]=new Array(l),f=0;f<l;++f)(a=c[f])&&(u=t.call(a,a.__data__,f,c))&&("__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,r=e.length,n=[],o=[],a=0;a<r;++a)for(var u,c=e[a],l=c.length,s=0;s<l;++s)(u=c[s])&&(n.push(t.call(u,u.__data__,s,c)),o.push(u));return new ft(n,o)},selectChild:function(t){return this.select(null==t?l:function(t){return function(){return c.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,r=e.length,n=new Array(r),o=0;o<r;++o)for(var i,u=e[o],c=u.length,l=n[o]=[],s=0;s<c;++s)(i=u[s])&&t.call(i,i.__data__,s,u)&&l.push(i);return new ft(n,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,d);var r,n=e?v:p,o=this._parents,i=this._groups;"function"!=typeof t&&(r=t,t=function(){return r});for(var a=i.length,u=new Array(a),c=new Array(a),l=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=c[s]=new Array(g),x=u[s]=new Array(g);n(f,h,w,x,l[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=c,u._exit=l,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,r){var n=this.enter(),o=this,i=this.exit();return"function"==typeof t?(n=t(n))&&(n=n.selection()):n=n.append(t+""),null!=e&&(o=e(o))&&(o=o.selection()),null==r?i.remove():r(i),n&&o?n.merge(o).order():o},merge:function(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,o=r.length,i=n.length,a=Math.min(o,i),u=new Array(o),c=0;c<a;++c)for(var l,s=r[c],f=n[c],h=s.length,y=u[c]=new Array(h),p=0;p<h;++p)(l=s[p]||f[p])&&(y[p]=l);for(;c<o;++c)u[c]=r[c];return new ft(u,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var n,o=t[e],i=o.length-1,a=o[i];--i>=0;)(n=o[i])&&(a&&4^n.compareDocumentPosition(a)&&a.parentNode.insertBefore(n,a),a=n);return this},sort:function(t){function e(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}t||(t=m);for(var r=this._groups,n=r.length,o=new Array(n),i=0;i<n;++i){for(var a,u=r[i],c=u.length,l=o[i]=new Array(c),s=0;s<c;++s)(a=u[s])&&(l[s]=a);l.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,r=t.length;e<r;++e)for(var n=t[e],o=0,i=n.length;o<i;++o){var a=n[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,r=0,n=e.length;r<n;++r)for(var o,i=e[r],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 r=x(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((null==e?r.local?O:S:"function"==typeof e?r.local?k:P:r.local?j:_)(r,e))},style:function(t,e,r){return arguments.length>1?this.each((null==e?T:"function"==typeof e?A:C)(t,e,null==r?"":r)):M(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?z:"function"==typeof e?R:L)(t,e)):this.node()[t]},classed:function(t,e){var r=I(t+"");if(arguments.length<2){for(var n=F(this.node()),o=-1,i=r.length;++o<i;)if(!n.contains(r[o]))return!1;return!0}return this.each(("function"==typeof e?U:e?G:W)(r,e))},text:function(t){return arguments.length?this.each(null==t?$:("function"==typeof t?H:Y)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?q:("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 r="function"==typeof t?t:tt(t),o=null==e?et:"function"==typeof e?e:n(e);return this.select((function(){return this.insertBefore(r.apply(this,arguments),o.apply(this,arguments)||null)}))},remove:function(){return this.each(rt)},clone:function(t){return this.select(t?ot:nt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,r){var n,o,i=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");return r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),{type:t,name:e}}))}(t+""),a=i.length;if(!(arguments.length<2)){for(u=e?at:it,n=0;n<a;++n)this.each(u(i[n],e,r));return this}var u=this.node().__on;if(u)for(var c,l=0,s=u.length;l<s;++l)for(n=0,c=u[l];n<a;++n)if((o=i[n]).type===c.type&&o.name===c.name)return c.value},dispatch:function(t,e){return this.each(("function"==typeof e?lt:ct)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n,o=t[e],i=0,a=o.length;i<a;++i)(n=o[i])&&(yield n)}};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,r=arguments.length,n={};e<r;++e){if(!(t=arguments[e]+"")||t in n||/[\s.]/.test(t))throw new Error("illegal type: "+t);n[t]=[]}return new bt(n)}function bt(t){this._=t}function mt(t,e){for(var r,n=0,o=t.length;n<o;++n)if((r=t[n]).name===e)return r.value}function gt(t,e,r){for(var n=0,o=t.length;n<o;++n)if(t[n].name===e){t[n]=vt,t=t.slice(0,n).concat(t.slice(n+1));break}return null!=r&&t.push({name:e,value:r}),t}bt.prototype=dt.prototype={constructor:bt,on:function(t,e){var r,n,o=this._,i=(n=o,(t+"").trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.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(r=(t=i[a]).type)o[r]=gt(o[r],t.name,e);else if(null==e)for(r in o)o[r]=gt(o[r],t.name,null);return this}for(;++a<u;)if((r=(t=i[a]).type)&&(r=mt(o[r],t.name)))return r},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new bt(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,o=new Array(r),i=0;i<r;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,r=(n=this._[t]).length;i<r;++i)n[i].value.apply(e,o)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],o=0,i=n.length;o<i;++o)n[o].value.apply(e,r)}};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,r,n){function o(t,o){var i,a,u=t[0],c=t[1],l=t[2],s=o[0],f=o[1],h=o[2],y=s-u,p=f-c,v=y*y+p*p;if(v<1e-12)a=Math.log(h/l)/e,i=function(t){return[u+t*y,c+t*p,l*Math.exp(e*t*a)]};else{var d=Math.sqrt(v),b=(h*h-l*l+n*v)/(2*l*r*d),m=(h*h-l*l-n*v)/(2*h*r*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 n,o=t*a,i=Ot(g),s=l/(r*d)*(i*(n=e*o+g,((n=Math.exp(2*n))-1)/(n+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[u+s*y,c+s*p,l*i/Ot(e*o+g)]}}return i.duration=1e3*a*e/Math.SQRT2,i}return o.rho=function(e){var r=Math.max(.001,+e),n=r*r;return t(r,n,n*n)},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 r=e.ownerSVGElement||e;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,[(n=n.matrixTransform(e.getScreenCTM().inverse())).x,n.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,Et=0,Tt=0,Ct=0,At=0,Mt=0,zt=0,Lt="object"==typeof performance&&performance.now?performance:Date,Rt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function It(){return Mt||(Rt(Ft),Mt=Lt.now()+zt)}function Ft(){Mt=0}function Nt(){this._call=this._time=this._next=null}function Bt(t,e,r){var n=new Nt;return n.restart(t,e,r),n}function Dt(){Mt=(At=Lt.now())+zt,Et=Tt=0;try{!function(){It(),++Et;for(var t,e=Pt;e;)(t=Mt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Et}()}finally{Et=0,function(){for(var t,e,r=Pt,n=1/0;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:Pt=e);kt=t,Wt(n)}(),Mt=0}}function Gt(){var t=Lt.now(),e=t-At;e>1e3&&(zt-=e,At=t)}function Wt(t){Et||(Tt&&(Tt=clearTimeout(Tt)),t-Mt>24?(t<1/0&&(Tt=setTimeout(Dt,t-Lt.now()-zt)),Ct&&(Ct=clearInterval(Ct))):(Ct||(At=Lt.now(),Ct=setInterval(Gt,1e3)),Et=1,Rt(Dt)))}function Ut(t,e,r){var n=new Nt;return e=null==e?0:+e,n.restart((r=>{n.stop(),t(r+e)}),e,r),n}Nt.prototype=Bt.prototype={constructor:Nt,restart:function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?It():+r)+(null==e?0:+e),this._next||kt===this||(kt?kt._next=this:Pt=this,kt=this),this._call=t,this._time=r,Wt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wt())}};var $t=wt("start","end","cancel","interrupt"),Yt=[];function Ht(t,e,r,n,o,i){var a=t.__transition;if(a){if(r in a)return}else t.__transition={};!function(t,e,r){var n,o=t.__transition;function i(c){var l,s,f,h;if(1!==r.state)return u();for(l in o)if((h=o[l]).name===r.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[l]):+l<e&&(h.state=6,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete o[l])}if(Ut((function(){3===r.state&&(r.state=4,r.timer.restart(a,r.delay,r.time),a(c))})),r.state=2,r.on.call("start",t,t.__data__,r.index,r.group),2===r.state){for(r.state=3,n=new Array(f=r.tween.length),l=0,s=-1;l<f;++l)(h=r.tween[l].value.call(t,t.__data__,r.index,r.group))&&(n[++s]=h);n.length=s+1}}function a(e){for(var o=e<r.duration?r.ease.call(null,e/r.duration):(r.timer.restart(u),r.state=5,1),i=-1,a=n.length;++i<a;)n[i].call(t,o);5===r.state&&(r.on.call("end",t,t.__data__,r.index,r.group),u())}function u(){for(var n in r.state=6,r.timer.stop(),delete o[e],o)return;delete t.__transition}o[e]=r,r.timer=Bt((function(t){r.state=1,r.timer.restart(i,r.delay,r.time),r.delay<=t&&i(t-r.delay)}),0,r.time)}(t,r,{name:e,index:n,group:o,on:$t,tween:Yt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function qt(t,e){var r=Xt(t,e);if(r.state>0)throw new Error("too late; already scheduled");return r}function Vt(t,e){var r=Xt(t,e);if(r.state>3)throw new Error("too late; already running");return r}function Xt(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function Zt(t,e){var r,n,o,i=t.__transition,a=!0;if(i){for(o in e=null==e?null:e+"",i)(r=i[o]).name===e?(n=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(n?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete i[o]):a=!1;a&&delete t.__transition}}function Jt(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}var Kt,Qt=180/Math.PI,te={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ee(t,e,r,n,o,i){var a,u,c;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(c=t*r+e*n)&&(r-=t*c,n-=e*c),(u=Math.sqrt(r*r+n*n))&&(r/=u,n/=u,c/=u),t*n<e*r&&(t=-t,e=-e,c=-c,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*Qt,skewX:Math.atan(c)*Qt,scaleX:a,scaleY:u}}function re(t,e,r,n){function o(t){return t.length?t.pop()+" ":""}return function(i,a){var u=[],c=[];return i=t(i),a=t(a),function(t,n,o,i,a,u){if(t!==o||n!==i){var c=a.push("translate(",null,e,null,r);u.push({i:c-4,x:Jt(t,o)},{i:c-2,x:Jt(n,i)})}else(o||i)&&a.push("translate("+o+e+i+r)}(i.translateX,i.translateY,a.translateX,a.translateY,u,c),function(t,e,r,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:r.push(o(r)+"rotate(",null,n)-2,x:Jt(t,e)})):e&&r.push(o(r)+"rotate("+e+n)}(i.rotate,a.rotate,u,c),function(t,e,r,i){t!==e?i.push({i:r.push(o(r)+"skewX(",null,n)-2,x:Jt(t,e)}):e&&r.push(o(r)+"skewX("+e+n)}(i.skewX,a.skewX,u,c),function(t,e,r,n,i,a){if(t!==r||e!==n){var u=i.push(o(i)+"scale(",null,",",null,")");a.push({i:u-4,x:Jt(t,r)},{i:u-2,x:Jt(e,n)})}else 1===r&&1===n||i.push(o(i)+"scale("+r+","+n+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,u,c),i=a=null,function(t){for(var e,r=-1,n=c.length;++r<n;)u[(e=c[r]).i]=e.x(t);return u.join("")}}}var ne=re((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=re((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 r,n;return function(){var o=Vt(this,t),i=o.tween;if(i!==r)for(var a=0,u=(n=r=i).length;a<u;++a)if(n[a].name===e){(n=n.slice()).splice(a,1);break}o.tween=n}}function ae(t,e,r){var n,o;if("function"!=typeof r)throw new Error;return function(){var i=Vt(this,t),a=i.tween;if(a!==n){o=(n=a).slice();for(var u={name:e,value:r},c=0,l=o.length;c<l;++c)if(o[c].name===e){o[c]=u;break}c===l&&o.push(u)}i.tween=o}}function ue(t,e,r){var n=t._id;return t.each((function(){var t=Vt(this,n);(t.value||(t.value={}))[e]=r.apply(this,arguments)})),function(t){return Xt(t,n).value[e]}}function ce(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function le(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}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,r;return t=(t+"").trim().toLowerCase(),(e=de.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?ke(e):3===r?new Ae(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?Ee(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?Ee(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))?Ee(e[1],e[2],e[3],e[4]):(e=we.exec(t))?Ee(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=xe.exec(t))?Fe(e[1],e[2]/100,e[3]/100,1):(e=Se.exec(t))?Fe(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 Ee(t,e,r,n){return n<=0&&(t=e=r=NaN),new Ae(t,e,r,n)}function Te(t){return t instanceof se||(t=Pe(t)),t?new Ae((t=t.rgb()).r,t.g,t.b,t.opacity):new Ae}function Ce(t,e,r,n){return 1===arguments.length?Te(t):new Ae(t,e,r,null==n?1:n)}function Ae(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function Me(){return`#${Ie(this.r)}${Ie(this.g)}${Ie(this.b)}`}function ze(){const t=Le(this.opacity);return`${1===t?"rgb(":"rgba("}${Re(this.r)}, ${Re(this.g)}, ${Re(this.b)}${1===t?")":`, ${t})`}`}function Le(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Re(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ie(t){return((t=Re(t))<16?"0":"")+t.toString(16)}function Fe(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Be(t,e,r,n)}function Ne(t){if(t instanceof Be)return new Be(t.h,t.s,t.l,t.opacity);if(t instanceof se||(t=Pe(t)),!t)return new Be;if(t instanceof Be)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,o=Math.min(e,r,n),i=Math.max(e,r,n),a=NaN,u=i-o,c=(i+o)/2;return u?(a=e===i?(r-n)/u+6*(r<n):r===i?(n-e)/u+2:(e-r)/u+4,u/=c<.5?i+o:2-i-o,a*=60):u=c>0&&c<1?0:a,new Be(a,u,c,t.opacity)}function Be(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}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,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function Ue(t,e,r,n,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*r+(1+3*t+3*i-3*a)*n+a*o)/6}ce(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}),ce(Ae,Ce,le(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(Re(this.r),Re(this.g),Re(this.b),Le(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`#${Ie(this.r)}${Ie(this.g)}${Ie(this.b)}${Ie(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ze,toString:ze})),ce(Be,(function(t,e,r,n){return 1===arguments.length?Ne(t):new Be(t,e,r,null==n?1:n)}),le(se,{brighter(t){return t=null==t?he:Math.pow(he,t),new Be(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?fe:Math.pow(fe,t),new Be(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,r=this.l,n=r+(r<.5?r:1-r)*e,o=2*r-n;return new Ae(We(t>=240?t-240:t+120,o,n),We(t,o,n),We(t<120?t+240:t-120,o,n),this.opacity)},clamp(){return new Be(De(this.h),Ge(this.s),Ge(this.l),Le(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=Le(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 Ye(t,e){var r=e-t;return r?function(t,e){return function(r){return t+r*e}}(t,r):$e(isNaN(t)?e:t)}const He=function t(e){var r=function(t){return 1==(t=+t)?Ye:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):$e(isNaN(e)?r:e)}}(e);function n(t,e){var n=r((t=Ce(t)).r,(e=Ce(e)).r),o=r(t.g,e.g),i=r(t.b,e.b),a=Ye(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return n.gamma=t,n}(1);function qe(t){return function(e){var r,n,o=e.length,i=new Array(o),a=new Array(o),u=new Array(o);for(r=0;r<o;++r)n=Ce(e[r]),i[r]=n.r||0,a[r]=n.g||0,u[r]=n.b||0;return i=t(i),a=t(a),u=t(u),n.opacity=1,function(t){return n.r=i(t),n.g=a(t),n.b=u(t),n+""}}}qe((function(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),o=t[n],i=t[n+1],a=n>0?t[n-1]:2*o-i,u=n<e-1?t[n+2]:2*i-o;return Ue((r-n/e)*e,a,o,i,u)}})),qe((function(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),o=t[(n+e-1)%e],i=t[n%e],a=t[(n+1)%e],u=t[(n+2)%e];return Ue((r-n/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 r,n,o,i=Ve.lastIndex=Xe.lastIndex=0,a=-1,u=[],c=[];for(t+="",e+="";(r=Ve.exec(t))&&(n=Xe.exec(e));)(o=n.index)>i&&(o=e.slice(i,o),u[a]?u[a]+=o:u[++a]=o),(r=r[0])===(n=n[0])?u[a]?u[a]+=n:u[++a]=n:(u[++a]=null,c.push({i:a,x:Jt(r,n)})),i=Xe.lastIndex;return i<e.length&&(o=e.slice(i),u[a]?u[a]+=o:u[++a]=o),u.length<2?c[0]?function(t){return function(e){return t(e)+""}}(c[0].x):function(t){return function(){return t}}(e):(e=c.length,function(t){for(var r,n=0;n<e;++n)u[(r=c[n]).i]=r.x(t);return u.join("")})}function Je(t,e){var r;return("number"==typeof e?Jt:e instanceof Pe?He:(r=Pe(e))?(e=r,He):Ze)(t,e)}function Ke(t){return function(){this.removeAttribute(t)}}function Qe(t){return function(){this.removeAttributeNS(t.space,t.local)}}function tr(t,e,r){var n,o,i=r+"";return function(){var a=this.getAttribute(t);return a===i?null:a===n?o:o=e(n=a,r)}}function er(t,e,r){var n,o,i=r+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===n?o:o=e(n=a,r)}}function rr(t,e,r){var n,o,i;return function(){var a,u,c=r(this);if(null!=c)return(a=this.getAttribute(t))===(u=c+"")?null:a===n&&u===o?i:(o=u,i=e(n=a,c));this.removeAttribute(t)}}function nr(t,e,r){var n,o,i;return function(){var a,u,c=r(this);if(null!=c)return(a=this.getAttributeNS(t.space,t.local))===(u=c+"")?null:a===n&&u===o?i:(o=u,i=e(n=a,c));this.removeAttributeNS(t.space,t.local)}}function or(t,e){var r,n;function o(){var o=e.apply(this,arguments);return o!==n&&(r=(n=o)&&function(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}(t,o)),r}return o._value=e,o}function ir(t,e){var r,n;function o(){var o=e.apply(this,arguments);return o!==n&&(r=(n=o)&&function(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}(t,o)),r}return o._value=e,o}function ar(t,e){return function(){qt(this,t).delay=+e.apply(this,arguments)}}function ur(t,e){return e=+e,function(){qt(this,t).delay=e}}function cr(t,e){return function(){Vt(this,t).duration=+e.apply(this,arguments)}}function lr(t,e){return e=+e,function(){Vt(this,t).duration=e}}var sr=yt.prototype.constructor;function fr(t){return function(){this.style.removeProperty(t)}}var hr=0;function yr(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function pr(){return++hr}var vr=yt.prototype;yr.prototype=function(t){return yt().transition(t)}.prototype={constructor:yr,select:function(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=n(t));for(var o=this._groups,i=o.length,a=new Array(i),u=0;u<i;++u)for(var c,l,s=o[u],f=s.length,h=a[u]=new Array(f),y=0;y<f;++y)(c=s[y])&&(l=t.call(c,c.__data__,y,s))&&("__data__"in c&&(l.__data__=c.__data__),h[y]=l,Ht(h[y],e,r,y,h,Xt(c,r)));return new yr(a,this._parents,e,r)},selectAll:function(t){var e=this._name,r=this._id;"function"!=typeof t&&(t=i(t));for(var n=this._groups,o=n.length,a=[],u=[],c=0;c<o;++c)for(var l,s=n[c],f=s.length,h=0;h<f;++h)if(l=s[h]){for(var y,p=t.call(l,l.__data__,h,s),v=Xt(l,r),d=0,b=p.length;d<b;++d)(y=p[d])&&Ht(y,e,r,d,p,v);a.push(p),u.push(l)}return new yr(a,u,e,r)},selectChild:vr.selectChild,selectChildren:vr.selectChildren,filter:function(t){"function"!=typeof t&&(t=a(t));for(var e=this._groups,r=e.length,n=new Array(r),o=0;o<r;++o)for(var i,u=e[o],c=u.length,l=n[o]=[],s=0;s<c;++s)(i=u[s])&&t.call(i,i.__data__,s,u)&&l.push(i);return new yr(n,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,o=r.length,i=Math.min(n,o),a=new Array(n),u=0;u<i;++u)for(var c,l=e[u],s=r[u],f=l.length,h=a[u]=new Array(f),y=0;y<f;++y)(c=l[y]||s[y])&&(h[y]=c);for(;u<n;++u)a[u]=e[u];return new yr(a,this._parents,this._name,this._id)},selection:function(){return new sr(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,r=pr(),n=this._groups,o=n.length,i=0;i<o;++i)for(var a,u=n[i],c=u.length,l=0;l<c;++l)if(a=u[l]){var s=Xt(a,e);Ht(a,t,r,l,u,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new yr(n,this._parents,t,r)},call:vr.call,nodes:vr.nodes,node:vr.node,size:vr.size,empty:vr.empty,each:vr.each,on:function(t,e){var r=this._id;return arguments.length<2?Xt(this.node(),r).on.on(t):this.each(function(t,e,r){var n,o,i=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?qt:Vt;return function(){var a=i(this,t),u=a.on;u!==n&&(o=(n=u).copy()).on(e,r),a.on=o}}(r,t,e))},attr:function(t,e){var r=x(t),n="transform"===r?oe:Je;return this.attrTween(t,"function"==typeof e?(r.local?nr:rr)(r,n,ue(this,"attr."+t,e)):null==e?(r.local?Qe:Ke)(r):(r.local?er:tr)(r,n,e))},attrTween:function(t,e){var r="attr."+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;var n=x(t);return this.tween(r,(n.local?or:ir)(n,e))},style:function(t,e,r){var n="transform"==(t+="")?ne:Je;return null==e?this.styleTween(t,function(t,e){var r,n,o;return function(){var i=M(this,t),a=(this.style.removeProperty(t),M(this,t));return i===a?null:i===r&&a===n?o:o=e(r=i,n=a)}}(t,n)).on("end.style."+t,fr(t)):"function"==typeof e?this.styleTween(t,function(t,e,r){var n,o,i;return function(){var a=M(this,t),u=r(this),c=u+"";return null==u&&(this.style.removeProperty(t),c=u=M(this,t)),a===c?null:a===n&&c===o?i:(o=c,i=e(n=a,u))}}(t,n,ue(this,"style."+t,e))).each(function(t,e){var r,n,o,i,a="style."+e,u="end."+a;return function(){var c=Vt(this,t),l=c.on,s=null==c.value[a]?i||(i=fr(e)):void 0;l===r&&o===s||(n=(r=l).copy()).on(u,o=s),c.on=n}}(this._id,t)):this.styleTween(t,function(t,e,r){var n,o,i=r+"";return function(){var a=M(this,t);return a===i?null:a===n?o:o=e(n=a,r)}}(t,n,e),r).on("end.style."+t,null)},styleTween:function(t,e,r){var n="style."+(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;return this.tween(n,function(t,e,r){var n,o;function i(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&function(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}(t,i,r)),n}return i._value=e,i}(t,e,null==r?"":r))},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,r;function n(){var n=t.apply(this,arguments);return n!==r&&(e=(r=n)&&function(t){return function(e){this.textContent=t.call(this,e)}}(n)),e}return n._value=t,n}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n,o=Xt(this.node(),r).tween,i=0,a=o.length;i<a;++i)if((n=o[i]).name===t)return n.value;return null}return this.each((null==e?ie:ae)(r,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?ar:ur)(e,t)):Xt(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?cr:lr)(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 r=e.apply(this,arguments);if("function"!=typeof r)throw new Error;Vt(this,t).ease=r}}(this._id,t))},end:function(){var t,e,r=this,n=r._id,o=r.size();return new Promise((function(i,a){var u={value:a},c={value:function(){0==--o&&i()}};r.each((function(){var r=Vt(this,n),o=r.on;o!==t&&((e=(t=o).copy())._.cancel.push(u),e._.interrupt.push(u),e._.end.push(c)),r.on=e})),0===o&&i()}))},[Symbol.iterator]:vr[Symbol.iterator]};var dr={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function br(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}yt.prototype.interrupt=function(t){return this.each((function(){Zt(this,t)}))},yt.prototype.transition=function(t){var e,r;t instanceof yr?(e=t._id,t=t._name):(e=pr(),(r=dr).time=It(),t=null==t?null:t+"");for(var n=this._groups,o=n.length,i=0;i<o;++i)for(var a,u=n[i],c=u.length,l=0;l<c;++l)(a=u[l])&&Ht(a,t,e,l,u,r||br(a,e));return new yr(n,this._parents,t,e)};const mr=t=>()=>t;function gr(t,{sourceEvent:e,target:r,transform:n,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:o}})}function wr(t,e,r){this.k=t,this.x=e,this.y=r}wr.prototype={constructor:wr,scale:function(t){return 1===t?this:new wr(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new wr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var xr=new wr(1,0,0);function Sr(t){t.stopImmediatePropagation()}function Or(t){t.preventDefault(),t.stopImmediatePropagation()}function _r(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function jr(){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 Pr(){return this.__zoom||xr}function kr(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Er(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tr(t,e,r){var n=t.invertX(e[0][0])-r[0][0],o=t.invertX(e[1][0])-r[1][0],i=t.invertY(e[0][1])-r[0][1],a=t.invertY(e[1][1])-r[1][1];return t.translate(o>n?(n+o)/2:Math.min(0,n)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Cr(t){return Cr="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},Cr(t)}function Ar(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Mr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,zr(n.key),n)}}function zr(t){var e=function(t){if("object"!=Cr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Cr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cr(e)?e:e+""}wr.prototype;var Lr=function(){function t(e){var r=this,n=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"),c=this.offscreenCanvas.getContext("2d");if(!u)throw"Impossible to create canvas 2D context";if(!c)throw"Impossible to create canvas 2D context";if(this.ctx=u,this.offscreenCtx=c,this.view={x:n,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 l=xr;(function(){var t,e,r,n=_r,o=jr,i=Tr,a=kr,u=Er,c=[0,1/0],l=[[-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",Pr).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(c[0],Math.min(c[1],e)))===t.k?t:new wr(e,t.x,t.y)}function b(t,e,r){var n=e[0]-r[0]*t.k,o=e[1]-r[1]*t.k;return n===t.x&&o===t.y?t:new wr(t.k,n,o)}function m(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function g(t,e,r,n){t.on("start.zoom",(function(){w(this,arguments).event(n).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).event(n).end()})).tween("zoom",(function(){var t=this,i=arguments,a=w(t,i).event(n),u=o.apply(t,i),c=null==r?m(u):"function"==typeof r?r.apply(t,i):r,l=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(c).concat(l/s.k),h.invert(c).concat(l/h.k));return function(t){if(1===t)t=h;else{var e=y(t),r=l/e[2];t=new wr(r,c[0]-e[0]*r,c[1]-e[1]*r)}a.zoom(null,t)}}))}function w(t,e,r){return!r&&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(n.apply(this,arguments)){var r=w(this,e).event(t),o=this.__zoom,u=Math.max(c[0],Math.min(c[1],o.k*Math.pow(2,a.apply(this,arguments)))),s=jt(t);if(r.wheel)r.mouse[0][0]===s[0]&&r.mouse[0][1]===s[1]||(r.mouse[1]=o.invert(r.mouse[0]=s)),clearTimeout(r.wheel);else{if(o.k===u)return;r.mouse=[s,o.invert(s)],Zt(this),r.start()}Or(t),r.wheel=setTimeout((function(){r.wheel=null,r.end()}),150),r.zoom("mouse",i(b(d(o,u),r.mouse[0],r.mouse[1]),r.extent,l))}}function O(t,...e){if(!r&&n.apply(this,arguments)){var o=t.currentTarget,a=w(this,e,!0).event(t),u=pt(t.view).on("mousemove.zoom",(function(t){if(Or(t),!a.moved){var e=t.clientX-s,r=t.clientY-f;a.moved=e*e+r*r>y}a.event(t).zoom("mouse",i(b(a.that.__zoom,a.mouse[0]=jt(t,o),a.mouse[1]),a.extent,l))}),!0).on("mouseup.zoom",(function(t){u.on("mousemove.zoom mouseup.zoom",null),function(t,e){var r=t.document.documentElement,n=pt(t).on("dragstart.drag",null);e&&(n.on("click.drag",St,xt),setTimeout((function(){n.on("click.drag",null)}),0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}(t.view,a.moved),Or(t),a.event(t).end()}),!0),c=jt(t,o),s=t.clientX,f=t.clientY;!function(t){var e=t.document.documentElement,r=pt(t).on("dragstart.drag",St,xt);"onselectstart"in e?r.on("selectstart.drag",St,xt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),Sr(t),a.mouse=[c,this.__zoom.invert(c)],Zt(this),a.start()}}function _(t,...e){if(n.apply(this,arguments)){var r=this.__zoom,a=jt(t.changedTouches?t.changedTouches[0]:t,this),u=r.invert(a),c=r.k*(t.shiftKey?.5:2),f=i(b(d(r,c),a,u),o.apply(this,e),l);Or(t),s>0?pt(this).transition().duration(s).call(g,f,a,t):pt(this).call(v.transform,f,a,t)}}function j(r,...o){if(n.apply(this,arguments)){var i,a,u,c,l=r.touches,s=l.length,f=w(this,o,r.changedTouches.length===s).event(r);for(Sr(r),a=0;a<s;++a)c=[c=jt(u=l[a],this),this.__zoom.invert(c),u.identifier],f.touch0?f.touch1||f.touch0[2]===c[2]||(f.touch1=c,f.taps=0):(f.touch0=c,i=!0,f.taps=1+!!t);t&&(t=clearTimeout(t)),i&&(f.taps<2&&(e=c[0],t=setTimeout((function(){t=null}),500)),Zt(this),f.start())}}function P(t,...e){if(this.__zooming){var r,n,o,a,u=w(this,e).event(t),c=t.changedTouches,s=c.length;for(Or(t),r=0;r<s;++r)o=jt(n=c[r],this),u.touch0&&u.touch0[2]===n.identifier?u.touch0[0]=o:u.touch1&&u.touch1[2]===n.identifier&&(u.touch1[0]=o);if(n=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;n=d(n,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(n,o,a),u.extent,l))}}function k(t,...n){if(this.__zooming){var o,i,a=w(this,n).event(t),u=t.changedTouches,c=u.length;for(Sr(t),r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),o=0;o<c;++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 l=pt(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return v.transform=function(t,e,r,n){var o=t.selection?t.selection():t;o.property("__zoom",Pr),t!==o?g(t,e,r,n):o.interrupt().each((function(){w(this,arguments).event(n).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},v.scaleBy=function(t,e,r,n){v.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),r,n)},v.scaleTo=function(t,e,r,n){v.transform(t,(function(){var t=o.apply(this,arguments),n=this.__zoom,a=null==r?m(t):"function"==typeof r?r.apply(this,arguments):r,u=n.invert(a),c="function"==typeof e?e.apply(this,arguments):e;return i(b(d(n,c),a,u),t,l)}),r,n)},v.translateBy=function(t,e,r,n){v.transform(t,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof r?r.apply(this,arguments):r),o.apply(this,arguments),l)}),null,n)},v.translateTo=function(t,e,r,n,a){v.transform(t,(function(){var t=o.apply(this,arguments),a=this.__zoom,u=null==n?m(t):"function"==typeof n?n.apply(this,arguments):n;return i(xr.translate(u[0],u[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof r?-r.apply(this,arguments):-r),t,l)}),n,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 gr(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:mr(+t),v):a},v.filter=function(t){return arguments.length?(n="function"==typeof t?t:mr(!!t),v):n},v.touchable=function(t){return arguments.length?(u="function"==typeof t?t:mr(!!t),v):u},v.extent=function(t){return arguments.length?(o="function"==typeof t?t:mr([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),v):o},v.scaleExtent=function(t){return arguments.length?(c[0]=+t[0],c[1]=+t[1],v):[c[0],c[1]]},v.translateExtent=function(t){return arguments.length?(l[0][0]=+t[0][0],l[1][0]=+t[1][0],l[0][1]=+t[0][1],l[1][1]=+t[1][1],v):[[l[0][0],l[0][1]],[l[1][0],l[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,n=l.k/e.k;if(1==n){var o=l.x-e.x,i=l.y-e.y;r.pan(o*r.view.z,-i*r.view.z)}else s(t,n);l=e,r.onZoomFun&&r.onZoomFun(t)})).on("start",(function(t){var e;r.canvasSave.c=document.createElement("canvas"),r.canvasSave.c.setAttribute("width",""+r.w),r.canvasSave.c.setAttribute("height",""+r.h),null===(e=r.canvasSave.c.getContext("2d"))||void 0===e||e.drawImage(r.canvas,0,0),r.canvasSave.dx=0,r.canvasSave.dy=0,r.canvasSave.f=1,r.onZoomStartFun&&r.onZoomStartFun(t)})).on("end",(function(t){r.redraw(),r.canvasSave={c:null,dx:0,dy:0,f:1},r.onZoomEndFun&&r.onZoomEndFun(t)}))(pt(this.canvas));var s=function(t,e){r.cancelCurrentRequests();var n=t.sourceEvent;if(n instanceof WheelEvent)r.zoom(e,r.pixToGeoX(n.offsetX),r.pixToGeoY(n.offsetY));else if(n instanceof TouchEvent){var o,i=0,a=0,u=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ar(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ar(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(n.targetTouches);try{for(u.s();!(o=u.n()).done;){var c=o.value;i+=c.clientX,a+=c.clientY}}catch(t){u.e(t)}finally{u.f()}i/=n.targetTouches.length,a/=n.targetTouches.length,r.zoom(e,r.pixToGeoX(i),r.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,r=[{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,r=this.view.y/this.view.z+.5*this.h;this.ctx.setTransform(t,0,0,-t,e,r),this.offscreenCtx.setTransform(t,0,0,-t,e,r)}},{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:"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:"pan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;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 r=1/this.view.z;this.canvasSave.dx-=t*r,this.canvasSave.dy+=e*r,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:"zoom",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.view.x,r=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 n=t*this.view.z;n<this.zoomExtent[0]&&(t=this.zoomExtent[0]/this.view.z),n>this.zoomExtent[1]&&(t=this.zoomExtent[1]/this.view.z),this.view.z*=t;var o=(e-this.view.x)*(1-t),i=(r-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.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(r)*(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:"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"),r=t.getParameterByName("y"),n=t.getParameterByName("z");null==e||null==e||isNaN(+e)||(this.view.x=+e),null==r||null==r||isNaN(+r)||(this.view.y=+r),null==n||null==n||isNaN(+n)||(this.view.z=+n)}}],n=[{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}}],r&&Mr(e.prototype,r),n&&Mr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Rr(t){return Rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rr(t)}function Ir(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Fr(n.key),n)}}function Fr(t){var e=function(t){if("object"!=Rr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Rr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rr(e)?e:e+""}var Nr=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(),r=t.clientX-e.left+this.xOffset,n=t.clientY-e.top-this.yOffset;this.tooltip.style("left",r+"px").style("top",n+"px"),this.ensureTooltipInsideContainer(t,e,this.tooltip.node())}},{key:"ensureTooltipInsideContainer",value:function(t,e,r){var n=r,o=e.width,i=e.height;if(n.offsetLeft+n.clientWidth>o){var a=t.clientX-n.clientWidth-this.xOffset;n.style.left=a+"px"}n.offsetTop+n.clientHeight>i&&(n.style.top=i-n.clientHeight+"px"),n.offsetTop<0&&(n.style.top="0px"),n.offsetLeft<0&&(n.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&&Ir(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Br(t){return Br="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},Br(t)}function Dr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Gr(n.key),n)}}function Gr(t){var e=function(t){if("object"!=Br(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Br(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Br(e)?e:e+""}var Wr=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}}])&&Dr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Ur(t){return Ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ur(t)}function $r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Yr(n.key),n)}}function Yr(t){var e=function(t){if("object"!=Ur(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ur(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ur(e)?e:e+""}function Hr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Hr=function(){return!!t})()}function qr(t){return qr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qr(t)}function Vr(t,e){return Vr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vr(t,e)}var Xr=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,r){return e=qr(e),function(t,e){if(e&&("object"==Ur(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,Hr()?Reflect.construct(e,r||[],qr(t).constructor):e.apply(t,r))}(this,e,[t])).onZoom=t.onZoom,r.delta=t.delta||.2,r.zoomInBtn=document.createElement("a"),r.zoomInBtn.id="zoom-in",r.zoomInBtn.className="gridviz-zoom-button",r.zoomInBtn.title="Zoom in",r.zoomInBtn.textContent="+",r.zoomInBtn.addEventListener("click",(function(t){r.zoomIn(t)})),r.zoomInBtn.addEventListener("mouseover",(function(){r.zoomInBtn.style.backgroundColor="lightgrey"})),r.zoomInBtn.addEventListener("mouseout",(function(){r.zoomInBtn.style.backgroundColor="#ffffff"})),r.zoomOutBtn=document.createElement("a"),r.zoomOutBtn.id="zoom-out",r.zoomOutBtn.className="gridviz-zoom-button",r.zoomOutBtn.title="Zoom out",r.zoomOutBtn.textContent="-",r.zoomOutBtn.addEventListener("click",(function(t){r.zoomOut(t)})),r.zoomOutBtn.addEventListener("mouseover",(function(){r.zoomOutBtn.style.backgroundColor="lightgrey"})),r.zoomOutBtn.addEventListener("mouseout",(function(){r.zoomOutBtn.style.backgroundColor="#ffffff"})),[r.zoomInBtn,r.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")})),r.style("height","unset"),r.style("display","unset"),t.x?r.style("left",t.x+"px"):r.style("right","10px"),t.y?r.style("top",t.y+"px"):r.style("top","10px"),r.div.node().appendChild(r.zoomInBtn),r.div.node().appendChild(r.zoomOutBtn),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&&Vr(t,e)}(e,t),r=e,n=[{key:"zoomIn",value:function(t){this.map.setZoom(this.map.getZoom()*(1-this.delta)).redraw(),this.onZoom&&this.onZoom(t)}},{key:"zoomOut",value:function(t){this.map.setZoom(this.map.getZoom()*(1+this.delta)).redraw(),this.onZoom&&this.onZoom(t)}}],n&&$r(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Wr);function Zr(t){return Zr="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},Zr(t)}function Jr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,en(n.key),n)}}function Kr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Kr=function(){return!!t})()}function Qr(t){return Qr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qr(t)}function tn(t,e){return tn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},tn(t,e)}function en(t){var e=function(t){if("object"!=Zr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Zr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Zr(e)?e:e+""}var rn=function(t){function e(t){var r,n,o,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Qr(e),function(t,e){if(e&&("object"==Zr(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,Kr()?Reflect.construct(e,r||[],Qr(t).constructor):e.apply(t,r))}(this,e,[t]),n=r,i=!1,(o=en(o="isFullscreen"))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i,r.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 ',r.defaultHeight=r.map.h,r.defaultWidth=r.map.w,r.div.on("click",(function(t){r.onClickFunction(t)})),r.div.on("mouseover",(function(t){r.style("background-color","lightgrey")})),r.div.on("mouseout",(function(t){r.style("background-color","#ffffff")})),t.x?r.style("left",t.x+"px"):r.style("right","10px"),t.y?r.style("top",t.y+"px"):r.style("top","90px"),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&&tn(t,e)}(e,t),r=e,(n=[{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()}}])&&Jr(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Wr);function nn(t){return nn="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},nn(t)}function on(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return an(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?an(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function an(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function un(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,cn(n.key),n)}}function cn(t){var e=function(t){if("object"!=nn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=nn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==nn(e)?e:e+""}var ln=function(){return t=function t(e,r){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=r||{},this.layers=r.layers||[],this.container=e||document.getElementById("gridviz"),this.container?(this.container.style.position="relative",this.w=r.w||this.container.offsetWidth,this.h=r.h||this.container.offsetHeight,this._canvas=r.canvas||this.initialiseCanvas(),this.geoCanvas=new Lr(this._canvas,r.x,r.y,r.z,r),this.geoCanvas.redraw=function(){n.redraw()},this.geoCanvas.cancelCurrentRequests=function(){var t,e=on(n.layers);try{for(e.s();!(t=e.n()).done;){var r,o,i,a=t.value;if(null!==(r=a.dataset)&&void 0!==r&&r.datasets){var u,c,l=on(null===(u=a.dataset)||void 0===u?void 0:u.datasets);try{for(l.s();!(c=l.n()).done;){var s=c.value;null!=s&&s.cancelCurrentRequests&&s.cancelCurrentRequests()}}catch(t){l.e(t)}finally{l.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=r.legendContainer?pt(r.legendContainer):null,this.legend||this.initialiseLegend(),r.tooltip||(r.tooltip={}),r.tooltip.parentElement||(r.tooltip.parentElement=this.container),this.tooltip=new Nr(r.tooltip),this.mouseOverHandler=function(t){return n.focusCell(t)},this.mouseMoveHandler=function(t){return n.focusCell(t)},this.mouseOutHandler=function(t){return n.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){r.onZoomStartFun&&r.onZoomStartFun(t),n.tooltip.hide()},this.canvasSave=null,this.selectionRectangleColor=r.selectionRectangleColor||"#FF6347",this.selectionRectangleWidthPix=r.selectionRectangleWidthPix||function(){return 4},this.transparentBackground=r.transparentBackground,this.defaultGlobalCompositeOperation=r.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,r=on(this.layers);try{for(r.s();!(e=r.n()).done;){var n=e.value;n.visible&&!n.visible(t)||(this.geoCanvas.offscreenCtx.globalAlpha=n.alpha?n.alpha(t):1,n.blendOperation&&(this.geoCanvas.offscreenCtx.globalCompositeOperation=n.blendOperation(t)),this.geoCanvas.setCanvasTransform(),n.draw(this.geoCanvas,this.legend),n.filterColor&&n.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,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){var e,r={x:this.geoCanvas.pixToGeoX(t.offsetX+this.tooltip.xMouseOffset),y:this.geoCanvas.pixToGeoY(t.offsetY+this.tooltip.yMouseOffset)},n=this.getCellFocusInfo(r);if(this.transparentBackground)return n?(this.tooltip.html(n.html),this.tooltip.setPosition(t),this.tooltip.show()):this.tooltip.hide(),this.canvasSave=document.createElement("canvas"),this.canvasSave.setAttribute("width",""+this.w),this.canvasSave.setAttribute("height",""+this.h),null===(e=this.canvasSave.getContext("2d"))||void 0===e||e.drawImage(this.geoCanvas.canvas,0,0),void this.geoCanvas.initCanvasTransform();if(n){var o;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===(o=this.canvasSave.getContext("2d"))||void 0===o||o.drawImage(this.geoCanvas.offscreenCanvas,0,0));var i=this.selectionRectangleWidthPix?this.selectionRectangleWidthPix(n.resolution,this.geoCanvas.view.z):4;this.geoCanvas.initCanvasTransform();var a=this.geoCanvas.offscreenCtx;a.strokeStyle=this.selectionRectangleColor,a.lineWidth=i,a.beginPath(),a.rect(this.geoCanvas.geoToPixX(n.cell.x)-i/2,this.geoCanvas.geoToPixY(n.cell.y)+i/2,n.resolution/this.geoCanvas.view.z+i,-n.resolution/this.geoCanvas.view.z-i),a.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,r=this.layers.length-1;r>=0;r--){var n=this.layers[r];if((!n.visible||n.visible(e))&&"none"!==n.cellInfoHTML&&n.cellInfoHTML&&n.getDataset){var o=n.getDataset(e);if(o){var i=o.getCellFromPosition(t,o.getViewCache());if(!i)return;if(o.mixedResolution){var a=+o.mixedResolution(i),u=n.cellInfoHTML(i,a);if(!u)return;return{cell:i,html:u,resolution:a}}var c=n.cellInfoHTML(i,o.getResolution());if(!c)return;return{cell:i,html:c,resolution:o.getResolution()}}}}}},{key:"setView",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.geoCanvas.view.x=t,this.geoCanvas.view.y=e,null!=r&&(this.geoCanvas.view.z=r),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 Xr({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 rn({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(r){if(Array.isArray(r)&&r.length){var n=t.container;n.clientWidth>0&&n.clientHeight>0&&(e||(e=!0,window.requestAnimationFrame((function(){e=!1,t.h===n.clientHeight&&t.w===n.clientWidth||(t.h=n.clientHeight,t.w=n.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&&un(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function sn(t){return sn="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},sn(t)}function fn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,hn(n.key),n)}}function hn(t){var e=function(t){if("object"!=sn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=sn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==sn(e)?e:e+""}var yn=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 r=void 0,n=void 0;this.filterBlendOperation&&(r=t.offscreenCtx.globalCompositeOperation,n=this.filterBlendOperation(t.view.z)),n&&"none"!=n&&(t.offscreenCtx.globalCompositeOperation=n),t.offscreenCtx.fillRect(0,0,t.w,t.h),r&&(t.offscreenCtx.globalCompositeOperation=r)}}}}])&&fn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function pn(t){return pn="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},pn(t)}function vn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return dn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function dn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function bn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mn(n.key),n)}}function mn(t){var e=function(t){if("object"!=pn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=pn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pn(e)?e:e+""}function gn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(gn=function(){return!!t})()}function wn(t){return wn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wn(t)}function xn(t,e){return xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xn(t,e)}var Sn=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=wn(e),function(t,e){if(e&&("object"==pn(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,gn()?Reflect.construct(e,r||[],wn(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.viewScale=t.viewScale,r.filter=t.filter||void 0,r.offset=t.offset||function(t,e,r){return{dx:0,dy:0}},r.drawFun=t.drawFun,r.legends=[],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&&xn(t,e)}(e,t),r=e,o=[{key:"updateLegendsRecursive",value:function(t,e){if(Array.isArray(t)){var r,n=vn(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;this.updateLegendsRecursive(o,e)}}catch(t){n.e(t)}finally{n.f()}}else t.update(e)}}],(n=[{key:"draw",value:function(t,e,r){if(!this.drawFun)throw new Error("Method draw not implemented.");this.drawFun(t,e,r)}},{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,r=vn(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;this.legends.push(n)}}catch(t){r.e(t)}finally{r.f()}return this}}])&&bn(r.prototype,n),o&&bn(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(yn);function On(t){return On="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},On(t)}function _n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,jn(n.key),n)}}function jn(t){var e=function(t){if("object"!=On(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=On(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==On(e)?e:e+""}function Pn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Pn=function(){return!!t})()}function kn(t){return kn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kn(t)}function En(t,e){return En=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},En(t,e)}var Tn=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,r){return e=kn(e),function(t,e){if(e&&("object"==On(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,Pn()?Reflect.construct(e,r||[],kn(t).constructor):e.apply(t,r))}(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&&En(t,e)}(e,t),r=e,(n=[{key:"draw",value:function(t){throw new Error("Method draw not implemented.")}}])&&_n(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(yn);function Cn(t){return Cn="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},Cn(t)}function An(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Mn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Mn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Mn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function zn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ln(n.key),n)}}function Ln(t){var e=function(t){if("object"!=Cn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Cn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cn(e)?e:e+""}var Rn=function(){return t=function t(e,r,n){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=r,this.resolution=n,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 r,n=An(e);try{for(n.s();!(r=n.n()).done;){var o=r.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){n.e(t)}finally{n.f()}}else{var a,u=this.getResolution(),c=An(e);try{for(c.s();!(a=c.n()).done;){var l=a.value;if(!(t.x<l.x||l.x+u<t.x||t.y<l.y||l.y+u<t.y))return l}}catch(t){c.e(t)}finally{c.f()}}}},{key:"getResolution",value:function(){return this.resolution}},{key:"getViewCache",value:function(){return this.cellsViewCache}},{key:"getDataset",value:function(t,e){return this}}])&&zn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function In(t){return In="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},In(t)}function Fn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Nn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Bn(n.key),n)}}function Bn(t){var e=function(t){if("object"!=In(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=In(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==In(e)?e:e+""}var Dn=function(){return t=function t(e,r){var n=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),n=n||{},this.resolutions=e,this.datasets="function"==typeof r?this.resolutions.map(r):r,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);n.preprocess&&this.setPrepocesses(n.preprocess)},(e=[{key:"getDataset",value:function(t,e){if(1==this.datasets.length)return this.datasets[0];for(var r=this.resolutions,n=0,o=r[n]/e;o<t&&n<r.length;)o=r[++n]/e;return n==r.length?this.datasets[r.length-1]:this.datasets[n]}},{key:"setPrepocesses",value:function(t){var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Fn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Fn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(this.datasets);try{for(r.s();!(e=r.n()).done;)e.value.preprocess=t}catch(t){r.e(t)}finally{r.f()}return this}}])&&Nn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Gn(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function Wn(t,e){return fetch(t,e).then(Gn)}var Un={},$n={};function Yn(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function Hn(t){var e=Object.create(null),r=[];return t.forEach((function(t){for(var n in t)n in e||r.push(e[n]=n)})),r}function qn(t,e){var r=t+"",n=r.length;return n<e?new Array(e-n+1).join(0)+r:r}function Vn(t){var e=new RegExp('["'+t+"\n\r]"),r=t.charCodeAt(0);function n(t,e){var n,o=[],i=t.length,a=0,u=0,c=i<=0,l=!1;function s(){if(c)return $n;if(l)return l=!1,Un;var e,n,o=a;if(34===t.charCodeAt(o)){for(;a++<i&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=i?c=!0:10===(n=t.charCodeAt(a++))?l=!0:13===n&&(l=!0,10===t.charCodeAt(a)&&++a),t.slice(o+1,e-1).replace(/""/g,'"')}for(;a<i;){if(10===(n=t.charCodeAt(e=a++)))l=!0;else if(13===n)l=!0,10===t.charCodeAt(a)&&++a;else if(n!==r)continue;return t.slice(o,e)}return c=!0,t.slice(o,i)}for(10===t.charCodeAt(i-1)&&--i,13===t.charCodeAt(i-1)&&--i;(n=s())!==$n;){for(var f=[];n!==Un&&n!==$n;)f.push(n),n=s();e&&null==(f=e(f,u++))||o.push(f)}return o}function o(e,r){return e.map((function(e){return r.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=(r=t).getUTCHours(),i=r.getUTCMinutes(),a=r.getUTCSeconds(),u=r.getUTCMilliseconds(),isNaN(r)?"Invalid Date":((n=r.getUTCFullYear())<0?"-"+qn(-n,6):n>9999?"+"+qn(n,6):qn(n,4))+"-"+qn(r.getUTCMonth()+1,2)+"-"+qn(r.getUTCDate(),2)+(u?"T"+qn(o,2)+":"+qn(i,2)+":"+qn(a,2)+"."+qn(u,3)+"Z":a?"T"+qn(o,2)+":"+qn(i,2)+":"+qn(a,2)+"Z":i||o?"T"+qn(o,2)+":"+qn(i,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t;var r,n,o,i,a,u}return{parse:function(t,e){var r,o,i=n(t,(function(t,n){if(r)return r(t,n-1);o=t,r=e?function(t,e){var r=Yn(t);return function(n,o){return e(r(n),o,t)}}(t,e):Yn(t)}));return i.columns=o||[],i},parseRows:n,format:function(e,r){return null==r&&(r=Hn(e)),[r.map(a).join(t)].concat(o(e,r)).join("\n")},formatBody:function(t,e){return null==e&&(e=Hn(t)),o(t,e).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}}var Xn=Vn(","),Zn=Xn.parse,Jn=(Xn.parseRows,Xn.format,Xn.formatBody,Xn.formatRows,Xn.formatRow,Xn.formatValue,Vn("\t")),Kn=Jn.parse;function Qn(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function to(t,e){return fetch(t,e).then(Qn)}function eo(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=void 0),to(e,r).then((function(e){return t(e,n)}))}}function ro(t,e,r,n){3===arguments.length&&"function"==typeof r&&(n=r,r=void 0);var o=Vn(t);return to(e,r).then((function(t){return o.parse(t,n)}))}Jn.parseRows,Jn.format,Jn.formatBody,Jn.formatRows,Jn.formatRow,Jn.formatValue;var no=eo(Zn);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 r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ao(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ao(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function ao(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function uo(){uo=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new C(n||[]);return o(a,"_invoke",{value:P(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",y="suspendedYield",p="executing",v="completed",d={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(A([])));S&&S!==r&&n.call(S,a)&&(w=S);var O=g.prototype=b.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==oo(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=k(u,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:y,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(oo(e)+" is not iterable")}return m.prototype=g,o(O,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},_(j.prototype),l(j.prototype,u,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(O),l(O,c,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function co(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function lo(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){co(i,n,o,a,u,"next",t)}function u(t){co(i,n,o,a,u,"throw",t)}a(void 0)}))}}function so(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,fo(n.key),n)}}function fo(t){var e=function(t){if("object"!=oo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=oo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==oo(e)?e:e+""}function ho(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ho=function(){return!!t})()}function yo(t){return yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yo(t)}function po(t,e){return po=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},po(t,e)}eo(Kn);var vo=function(t){function e(t,r){var n,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),(n=function(t,e,r){return e=yo(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,ho()?Reflect.construct(e,r||[],yo(t).constructor):e.apply(t,r))}(this,e,[t,r,0,o])).onlyDrawWhenAllTilesReady=o.onlyDrawWhenAllTilesReady||!1,n.info=void 0,n.infoLoadingStatus="notLoaded",n.cache={},n.loadInfo(),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&&po(t,e)}(e,t),r=e,n=[{key:"loadInfo",value:function(){var t=this;return this.info||"notLoaded"!==this.infoLoadingStatus?"loaded"!==this.infoLoadingStatus&&"failed"!==this.infoLoadingStatus||this.map.redraw():lo(uo().mark((function e(){var r;return uo().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Wn(t.url+"info.json");case 3:r=e.sent,t.info=r,t.resolution=r.resolutionGeo,t.infoLoadingStatus="loaded",t.map.redraw(),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),t.infoLoadingStatus="failed";case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))(),this}},{key:"getTilingEnvelope",value:function(t){if(this.info){var e=this.info.originPoint,r=this.info.resolutionGeo,n=this.info.tileSizeCell;return{xMin:Math.floor((t.xMin-e.x)/(r*n)),xMax:Math.floor((t.xMax-e.x)/(r*n)),yMin:Math.floor((t.yMin-e.y)/(r*n)),yMax:Math.floor((t.yMax-e.y)/(r*n))}}this.loadInfo()}},{key:"getData",value:(i=lo(uo().mark((function t(e){var r,n,o,i,a,u,c,l,s,f,h,y,p,v,d,b,m=this;return uo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.info){t.next=2;break}return t.abrupt("return",this);case 2:if(this.abortController=new AbortController,r=this.abortController.signal,n=this.getTilingEnvelope(e)){t.next=7;break}return t.abrupt("return",this);case 7:o=this.info.tilingBounds,i=o.xMin,a=o.xMax,u=o.yMin,c=o.yMax,l=Math.max(n.xMin,i),s=Math.min(n.xMax,a),f=Math.max(n.yMin,u),h=Math.min(n.yMax,c),y=(s-l+1)*(h-f+1),p=0,v=[],d=uo().mark((function t(e){var n,o;return uo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=uo().mark((function t(n){return uo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(m.cache[e]||(m.cache[e]={}),!m.cache[e][n]||"failed"===m.cache[e][n]){t.next=4;break}return++p,t.abrupt("return",1);case 4:m.cache[e][n]="loading",v.push(m.loadTile(e,n,r).then((function(t){m.cache[e][n]=t;var r=++p===y;m.checkAndRedraw(t,r)})).catch((function(){m.cache[e][n]="failed",++p})));case 6:case"end":return t.stop()}}),t)})),o=f;case 2:if(!(o<=h)){t.next=9;break}return t.delegateYield(n(o),"t0",4);case 4:if(!t.t0){t.next=6;break}return t.abrupt("continue",6);case 6:o++,t.next=2;break;case 9:case"end":return t.stop()}}),t)})),b=l;case 17:if(!(b<=s)){t.next=22;break}return t.delegateYield(d(b),"t0",19);case 19:b++,t.next=17;break;case 22:return t.next=24,Promise.allSettled(v);case 24:return t.abrupt("return",this);case 25:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"loadTile",value:(o=lo(uo().mark((function t(e,r,n){var o,i,a=this;return uo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,no("".concat(this.url).concat(e,"/").concat(r,".csv"),{signal:n});case 3:if(o=t.sent,i=this.preprocess?o.filter((function(t){return!1!==a.preprocess(t)})):o,this.info){t.next=7;break}throw new Error("Tile info unknown");case 7:return t.abrupt("return",bo(i,e,r,this.info));case 10:throw t.prev=10,t.t0=t.catch(0),"AbortError"===t.t0.name&&console.warn("Tile request for ".concat(e,", ").concat(r," was aborted.")),t.t0;case 14:case"end":return t.stop()}}),t,this,[[0,10]])}))),function(t,e,r){return o.apply(this,arguments)})},{key:"cancelCurrentRequests",value:function(){this.abortController&&this.abortController.abort()}},{key:"checkAndRedraw",value:function(t,e){var r,n=!1,o=this.map.getZoom(),i=io(this.map.layers);try{for(i.s();!(r=i.n()).done;){var a=r.value;if((!a.visible||a.visible(o))&&a.getDataset&&a.getDataset(o)==this){n=!0;break}}}catch(t){i.e(t)}finally{i.f()}if(n){var u=this.map.updateExtentGeo(),c=t.extGeo,l=c.xMin,s=c.xMax,f=c.yMin,h=c.yMax;u.xMax<=l||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 r=this.info.tilingBounds,n=Math.max(e.xMin,r.xMin);n<=Math.min(e.xMax,r.xMax);n++)if(this.cache[n])for(var o=Math.max(e.yMin,r.yMin);o<=Math.min(e.yMax,r.yMax);o++){var i=this.cache[n][o];if(i&&"string"!=typeof i){var a,u=io(i.cells);try{for(u.s();!(a=u.n()).done;){var c=a.value;+c.x+this.resolution<t.xMin||+c.x-this.resolution>t.xMax||+c.y+this.resolution<t.yMin||+c.y-this.resolution>t.yMax||this.cellsViewCache.push(c)}}catch(t){u.e(t)}finally{u.f()}}}}}}],n&&so(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i}(Rn);function bo(t,e,r,n){var o={};o.cells=t,o.x=e,o.y=r;var i=n.resolutionGeo,a=n.tileSizeCell;o.extGeo={xMin:n.originPoint.x+i*a*o.x,xMax:n.originPoint.x+i*a*(o.x+1),yMin:n.originPoint.y+i*a*o.y,yMax:n.originPoint.y+i*a*(o.y+1)};var u,c=io(o.cells);try{for(c.s();!(u=c.n()).done;){var l=u.value;l.x=o.extGeo.xMin+l.x*i,l.y=o.extGeo.yMin+l.y*i}}catch(t){c.e(t)}finally{c.f()}return o}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 go(){go=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new C(n||[]);return o(a,"_invoke",{value:P(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",y="suspendedYield",p="executing",v="completed",d={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(A([])));S&&S!==r&&n.call(S,a)&&(w=S);var O=g.prototype=b.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==mo(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=k(u,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:y,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(mo(e)+" is not iterable")}return m.prototype=g,o(O,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},_(j.prototype),l(j.prototype,u,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(O),l(O,c,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function wo(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return xo(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function xo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function So(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function Oo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_o(n.key),n)}}function _o(t){var e=function(t){if("object"!=mo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=mo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mo(e)?e:e+""}function jo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(jo=function(){return!!t})()}function Po(t){return Po=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Po(t)}function ko(t,e){return ko=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ko(t,e)}var Eo=function(t){function e(t,r,n){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,r){return e=Po(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,jo()?Reflect.construct(e,r||[],Po(t).constructor):e.apply(t,r))}(this,e,[t,r,n,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&&ko(t,e)}(e,t),r=e,n=[{key:"getData",value:function(t){var e,r=this;return"notLoaded"!=this.infoLoadingStatus||(this.infoLoadingStatus="loading",(e=go().mark((function t(){var e,n,o,i,a,u,c;return go().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,ro(r.delimiter,r.url);case 3:e=t.sent,n=wo(e);try{for(n.s();!(o=n.n()).done;)(i=o.value).x=+i.x,i.y=+i.y}catch(t){n.e(t)}finally{n.f()}if(!r.preprocess){t.next=29;break}r.cells=[],a=wo(e),t.prev=9,a.s();case 11:if((u=a.n()).done){t.next=19;break}if(c=u.value,0!=r.preprocess(c)){t.next=16;break}return t.abrupt("continue",17);case 16:r.cells.push(c);case 17:t.next=11;break;case 19:t.next=24;break;case 21:t.prev=21,t.t0=t.catch(9),a.e(t.t0);case 24:return t.prev=24,a.f(),t.finish(24);case 27:t.next=30;break;case 29:r.cells=e;case 30:r.map&&r.map.redraw(),r.infoLoadingStatus="loaded",t.next=38;break;case 34:t.prev=34,t.t1=t.catch(0),r.infoLoadingStatus="failed",r.cells=[];case 38:case"end":return t.stop()}}),t,null,[[0,34],[9,21,24,27]])})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){So(i,n,o,a,u,"next",t)}function u(t){So(i,n,o,a,u,"throw",t)}a(void 0)}))})()),this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,r=wo(this.cells);try{for(r.s();!(e=r.n()).done;){var n=e.value;+n.x+this.resolution<t.xMin||+n.x-this.resolution>t.xMax||+n.y+this.resolution<t.yMin||+n.y-this.resolution>t.yMax||this.cellsViewCache.push(n)}}catch(t){r.e(t)}finally{r.f()}}}}],n&&Oo(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Rn);function To(t){return To="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},To(t)}function Co(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ao(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Mo(n.key),n)}}function Mo(t){var e=function(t){if("object"!=To(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=To(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==To(e)?e:e+""}function zo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(zo=function(){return!!t})()}function Lo(t){return Lo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Lo(t)}function Ro(t,e){return Ro=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ro(t,e)}var Io=function(t){function e(t,r){var n,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),(n=function(t,e,r){return e=Lo(e),function(t,e){if(e&&("object"==To(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,zo()?Reflect.construct(e,r||[],Lo(t).constructor):e.apply(t,r))}(this,e,[void 0,"",t,o])).cells=r||[],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&&Ro(t,e)}(e,t),r=e,(n=[{key:"getData",value:function(t){return this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Co(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Co(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(this.cells);try{for(r.s();!(e=r.n()).done;){var n=e.value;+n.x+this.resolution<t.xMin||+n.x-this.resolution>t.xMax||+n.y+this.resolution<t.yMin||+n.y-this.resolution>t.yMax||this.cellsViewCache.push(n)}}catch(t){r.e(t)}finally{r.f()}}}}])&&Ao(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Rn);function Fo(t){return Fo="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},Fo(t)}function No(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Bo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Do(n.key),n)}}function Do(t){var e=function(t){if("object"!=Fo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Fo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fo(e)?e:e+""}function Go(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Go=function(){return!!t})()}function Wo(t){return Wo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wo(t)}function Uo(t,e){return Uo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Uo(t,e)}var $o=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Wo(e),function(t,e){if(e&&("object"==Fo(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,Go()?Reflect.construct(e,r||[],Wo(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.color=t.color||"#EA6BAC",r.size=t.size||function(t,e){return e},r.shape=t.shape||"square",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&&Uo(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n,o=e.view.z,i=this.viewScale?this.viewScale(t,r,o):void 0,a=.5*r,u="function"==typeof this.color,c="function"==typeof this.size,l="function"==typeof this.shape,s=this.color||"black",f=this.size||r,h=this.shape||"square",y=u?this.color:null,p=c?this.size:null,v=l?this.shape:null,d=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return No(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?No(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(d.s();!(n=d.n()).done;){var b=n.value,m=y?y(b,r,o,i):s;if(m&&"none"!==m){var g=p?p(b,r,o,i):f;if(g){var w=v?v(b,r,o,i):h;if("none"!==w){var x=this.offset(b,r,o),S=e.offscreenCtx;if(S.fillStyle=m,"square"===w){var O=r*(1-g/r)*.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/r)*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-r)/2;S.beginPath(),S.moveTo(b.x-k,b.y-k),S.lineTo(b.x+a,b.y+r+k),S.lineTo(b.x+r+k,b.y-k),S.fill()}else if("triangle_down"===w){var E=(g-r)/2;S.beginPath(),S.moveTo(b.x-E,b.y+r+E),S.lineTo(b.x+a,b.y-E),S.lineTo(b.x+r+E,b.y+r+E),S.fill()}else if("triangle_left"===w){var T=(g-r)/2;S.beginPath(),S.moveTo(b.x+r+T,b.y+r+T),S.lineTo(b.x-T,b.y+a),S.lineTo(b.x+r+T,b.y-T),S.fill()}else{if("triangle_right"!==w)throw new Error("Unexpected shape:"+w);var C=(g-r)/2;S.beginPath(),S.moveTo(b.x-C,b.y-C),S.lineTo(b.x+r+C,b.y+a),S.lineTo(b.x-C,b.y+r+C),S.fill()}}}}}}catch(t){d.e(t)}finally{d.f()}this.updateLegends({viewScale:i,resolution:r,z:o,cells:t})}}],n&&Bo(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function Yo(t){return Yo="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},Yo(t)}function Ho(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function qo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Vo(n.key),n)}}function Vo(t){var e=function(t){if("object"!=Yo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Yo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Yo(e)?e:e+""}function Xo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Xo=function(){return!!t})()}function Zo(t){return Zo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zo(t)}function Jo(t,e){return Jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Jo(t,e)}var Ko=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Zo(e),function(t,e){if(e&&("object"==Yo(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,Xo()?Reflect.construct(e,r||[],Zo(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.strokeColor=t.strokeColor||function(){return"#666"},r.size=t.size||function(t,e){return e},r.strokeWidth=t.strokeWidth||function(t,e,r){return 1.5*r},r.shape=t.shape||function(){return"square"},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&&Jo(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n,o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,r,o):void 0,u=.5*r,c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ho(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ho(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(n=c.n()).done;){var l=n.value,s=this.strokeColor?this.strokeColor(l,r,o,a):void 0;if(s&&"none"!==s){i.strokeStyle=s;var f=this.size?this.size(l,r,o,a):r,h=this.strokeWidth?this.strokeWidth(l,r,o,a):1*o;if(h&&!(h<=0)){i.lineWidth=h;var y=this.shape?this.shape(l,r,o,a):"square";if("none"!==y){var p=this.offset(l,r,o);if("square"===y){var v=r*(1-f/r)*.5;i.beginPath(),i.rect(l.x+v+p.dx,l.y+v+p.dy,f,f),i.stroke()}else if("circle"===y)i.beginPath(),i.arc(l.x+u+p.dx,l.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(l.x+u-d,l.y+u),i.lineTo(l.x+u,l.y+u+d),i.lineTo(l.x+u+d,l.y+u),i.lineTo(l.x+u,l.y+u-d),i.lineTo(l.x+u-d,l.y+u),i.stroke()}else if("donut"===y)console.error("Not implemented");else if("triangle_up"===y){var b=(f-r)/2;i.beginPath(),i.moveTo(l.x-b,l.y-b),i.lineTo(l.x+u,l.y+r+b),i.lineTo(l.x+r+b,l.y-b),i.closePath(),i.stroke()}else if("triangle_down"===y){var m=(f-r)/2;i.beginPath(),i.moveTo(l.x-m,l.y+r+m),i.lineTo(l.x+u,l.y-m),i.lineTo(l.x+r+m,l.y+r+m),i.closePath(),i.stroke()}else if("triangle_left"===y){var g=(f-r)/2;i.beginPath(),i.moveTo(l.x+r+g,l.y+r+g),i.lineTo(l.x-g,l.y+u),i.lineTo(l.x+r+g,l.y-g),i.closePath(),i.stroke()}else{if("triangle_right"!==y)throw new Error("Unexpected shape:"+y);var w=(f-r)/2;i.beginPath(),i.moveTo(l.x-w,l.y-w),i.lineTo(l.x+r+w,l.y+u),i.lineTo(l.x-w,l.y+r+w),i.closePath(),i.stroke()}}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,resolution:r,z:o,viewScale:a})}}],n&&qo(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function Qo(t){return Qo="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},Qo(t)}function ti(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ei(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ri(n.key),n)}}function ri(t){var e=function(t){if("object"!=Qo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Qo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Qo(e)?e:e+""}function ni(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ni=function(){return!!t})()}function oi(t){return oi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},oi(t)}function ii(t,e){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ii(t,e)}var ai=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=oi(e),function(t,e){if(e&&("object"==Qo(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,ni()?Reflect.construct(e,r||[],oi(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.height=t.height||function(t,e){return e*Math.random()},r.lineColor=t.lineColor||function(t,e,r,n){return"#BBB"},r.lineWidth=t.lineWidth||function(t,e,r,n){return n},r.fillColor=t.fillColor||function(t,e,r,n){return"#c08c5968"},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&&ii(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n,o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,r,o):void 0,u={},c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ti(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ti(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(n=c.n()).done;){var l=n.value,s=u[l.y];s||(s={},u[l.y]=s),s[l.x]=this.height(l,r,o,a)}}catch(t){c.e(t)}finally{c.f()}var f=e.extGeo;if(f){var h=Math.floor(f.xMin/r)*r,y=Math.floor(f.xMax/r)*r,p=Math.floor(f.yMin/r)*r,v=Math.floor(f.yMax/r)*r,d={min:p,max:v};i.lineJoin="round";for(var b=v;b>=p;b-=r){var m=u[b];if(m){i.beginPath(),i.moveTo(h-r/2,b);for(var g=void 0,w=h;w<=y;w+=r){var x=m[w];x||(x=0),x||g?i.lineTo(w+r/2,b+x):i.moveTo(w+r/2,b),g=x}g&&i.lineTo(y+r/2,b);var S=this.fillColor(b,d,r,o);S&&"none"!=S&&(i.fillStyle=S,i.fill());var O=this.lineColor(b,d,r,o),_=this.lineWidth(b,d,r,o);O&&"none"!=O&&_>0&&(i.strokeStyle=O,i.lineWidth=_,i.stroke())}}}}}],n&&ei(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function ui(t){return ui="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},ui(t)}function ci(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||li(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 li(t,e){if(t){if("string"==typeof t)return si(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?si(t,e):void 0}}function si(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function fi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,hi(n.key),n)}}function hi(t){var e=function(t){if("object"!=ui(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ui(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ui(e)?e:e+""}function yi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(yi=function(){return!!t})()}function pi(t){return pi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pi(t)}function vi(t,e){return vi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vi(t,e)}var di=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=pi(e),function(t,e){if(e&&("object"==ui(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,yi()?Reflect.construct(e,r||[],pi(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.color=t.color,r.type=t.type||function(){return"flag"},r.size=t.size||function(t,e){return e},r.stripesOrientation=t.stripesOrientation||function(){return 0},r.offsetAngle=t.offsetAngle||function(){return 0},r.agePyramidHeight=t.agePyramidHeight||function(t,e){return e},r.pieChartInternalRadiusFactor=t.pieChartInternalRadiusFactor||0,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&&vi(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n,o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,r,o):void 0,u=Object.entries(this.color).length,c=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=li(t))){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}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(c.s();!(n=c.n()).done;){var l=n.value,s=this.size?this.size(l,r,o,a):r;if(s){var f=this.offset(l,r,o),h=this.type?this.type(l,r,o,a):"flag",y=l.x+f.dx+("agepyramid"===h?0:.5*r),p=l.y+f.dy+("agepyramid"===h?0:.5*r),v=this.offsetAngle?this.offsetAngle(l,r,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=+l[m[b]];g>d&&(d=g)}var w=0;"agepyramid"===h&&this.agePyramidHeight&&(w=(r-this.agePyramidHeight(l,r,o,a))/2),"radar"!==h&&"halftone"!==h||(w=Math.PI/2+v);var x="agepyramid"===h?(this.agePyramidHeight?this.agePyramidHeight(l,r,o,a):r)/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 _=ci(O[S],2),j=_[0],P=_[1];if("agepyramid"===h){i.fillStyle=P;var k=s*l[j]/d;i.fillRect(y+(r-k)/2,p+w,k,x),w+=x}else if("radar"===h){i.fillStyle=P;var E=l[j],T=s/2*Math.sqrt(E/d);i.beginPath(),i.moveTo(y,p),i.arc(y,p,T,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 C=l[j],A=.333*s*Math.sqrt(C/d);i.beginPath(),i.arc(y+.25*r*Math.cos(w),p+.25*r*Math.sin(w),A,0,2*Math.PI),i.fill(),w+=x}}}else{for(var M=0,z=0,L=Object.keys(this.color);z<L.length;z++){var R=+l[L[z]];R&&(M+=R)}if(!M||isNaN(M))continue;for(var I=0,F=r*(1-s/r)*.5,N=this.stripesOrientation(l,r,o,a),B=0,D=Object.entries(this.color);B<D.length;B++){var G=ci(D[B],2),W=G[0],U=G[1],$=l[W]/M;if($&&!isNaN($)){if(i.fillStyle=U,"flag"===h)0==N?i.fillRect(l.x+F+f.dx,l.y+F+I*s+f.dy,s,$*s):i.fillRect(l.x+F+I*s+f.dx,l.y+F+f.dy,$*s,s);else if("piechart"===h){var Y=2*I*Math.PI,H=2*(I+$)*Math.PI;i.beginPath(),i.moveTo(y,p),i.arc(y,p,.5*s,Y+v,H+v),this.pieChartInternalRadiusFactor&&i.arc(y,p,.5*s*this.pieChartInternalRadiusFactor,Y+v,H+v,!0),i.closePath(),i.fill()}else if("ring"===h)i.beginPath(),i.arc(y,p,Math.sqrt(1-I)*s*.5,0,2*Math.PI),i.fill();else{if("segment"!==h)throw new Error("Unexpected symbol type:"+h);var q=s*s/r;0==N?i.fillRect(l.x+f.dx,l.y+(r-q)/2+I*q+f.dy,r,$*q):i.fillRect(l.x+I*r+f.dx,l.y+(r-q)/2+f.dy,$*r,q)}I+=$}}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,resolution:r,z:o,viewScale:a})}}],n&&fi(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function bi(t){return bi="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},bi(t)}function mi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function gi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wi(n.key),n)}}function wi(t){var e=function(t){if("object"!=bi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=bi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bi(e)?e:e+""}function xi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(xi=function(){return!!t})()}function Si(t){return Si=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Si(t)}function Oi(t,e){return Oi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Oi(t,e)}var _i=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Si(e),function(t,e){if(e&&("object"==bi(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,r||[],Si(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.color=t.color||function(){return"#EA6BAC"},r.width=t.width||function(t,e){return.1*e},r.length=t.length||function(t,e){return.9*e},r.orientation=t.orientation||function(){return 180*Math.random()},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&&Oi(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=e.offscreenCtx,i=this.viewScale?this.viewScale(t,r,n):void 0;o.lineCap="butt";var a,u=Math.PI/180,c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return mi(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?mi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(a=c.n()).done;){var l=a.value,s=this.color?this.color(l,r,n,i):void 0;if(s){var f=this.width?this.width(l,r,n,i):void 0;if(f&&!(f<0)){var h=this.length?this.length(l,r,n,i):void 0;if(h&&!(h<0)){var y=this.orientation(l,r,n,i)*u;if(void 0!==y&&!isNaN(y)){var p=this.offset(l,r,n);o.strokeStyle=s,o.lineWidth=f;var v=l.x+r/2+p.dx,d=l.y+r/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){c.e(t)}finally{c.f()}this.updateLegends({viewScale:i,resolution:r,z:n,cells:t})}}],n&&gi(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function ji(t){return ji="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},ji(t)}function Pi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ki(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ei(n.key),n)}}function Ei(t){var e=function(t){if("object"!=ji(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ji(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ji(e)?e:e+""}function Ti(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ti=function(){return!!t})()}function Ci(t){return Ci=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ci(t)}function Ai(t,e){return Ai=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ai(t,e)}var Mi=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Ci(e),function(t,e){if(e&&("object"==ji(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,Ti()?Reflect.construct(e,r||[],Ci(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.text=t.text||function(){return"X"},r.color=t.color||function(){return"black"},r.fontSize=t.fontSize||function(t,e){return e},r.fontFamily=t.fontFamily||function(){return"Arial"},r.fontWeight=t.fontWeight||function(){return"bold"},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&&Ai(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=e.offscreenCtx,i=this.viewScale?this.viewScale(t,r,n):void 0;e.initCanvasTransform();var a,u=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Pi(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(u.s();!(a=u.n()).done;){var c=a.value,l=this.text?this.text(c,r,n,i):void 0;if(null!=l&&null!=l&&l+""!=""){var s=this.color?this.color(c,r,n,i):void 0;if(s){o.fillStyle=s;var f=this.fontSize(c,r,n,i)/n;if(f){var h=this.fontFamily?this.fontFamily(c,r,n,i):"Arial",y=this.fontWeight?this.fontWeight(c,r,n,i):"bold";o.font=y+" "+f+"px "+h;var p=this.offset(c,r,n);o.textAlign="center";var v=e.geoToPixX(c.x+.5*r+p.dx),d=e.geoToPixY(c.y+.5*r+p.dy)+.3*f;o.fillText(l,v,d)}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,resolution:r,z:n,viewScale:i})}}],o=[{key:"textScale",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=t.length;return function(n){return e&&(n=e(n)),0==n?"":n>=1?t[r-1]:t[Math.floor(n*r)]}}}],n&&ki(r.prototype,n),o&&ki(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Sn);function zi(t){return zi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zi(t)}function Li(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ri(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ri(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Ri(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ii(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Fi(n.key),n)}}function Fi(t){var e=function(t){if("object"!=zi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=zi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zi(e)?e:e+""}function Ni(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ni=function(){return!!t})()}function Bi(t){return Bi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bi(t)}function Di(t,e){return Di=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Di(t,e)}var Gi=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Bi(e),function(t,e){if(e&&("object"==zi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ni()?Reflect.construct(e,r||[],Bi(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.height=t.height,r.color=t.color||function(){return"#c08c59"},r.width=t.width||function(t,e){return.5*e},r.simple=t.simple||function(){return!1},r.viewHeightFactor=t.viewHeightFactor||1.5,r.viewSX=null==t.viewSX?0:t.viewSX,r.viewSY=null==t.viewSY?-.5:t.viewSY,r.shadowDirection=null==t.shadowDirection?-40.3*Math.PI/180:t.shadowDirection,r.shadowFactor=t.shadowFactor||.3,r.shadowColor=t.shadowColor||"#00000033",r.outlineCol=t.outlineCol||"#FFFFFF",r.outlineWidthPix=null==t.outlineWidthPix?.5:t.outlineWidthPix,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&&Di(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=e.offscreenCtx,i=this.viewScale?this.viewScale(t,r,n):void 0,a=e.view.x+this.viewSX*e.w*n,u=e.view.y+this.viewSY*e.h*n,c=this.viewHeightFactor*(e.w+e.h)*.5*n;t.sort((function(t,e){return 1e8*(e.y-t.y)+t.x-e.x}));var l=this.simple(r,n,i);o.lineCap=l?"butt":"round",o.strokeStyle=this.shadowColor,o.fillStyle=this.shadowColor;var s,f=Li(t);try{for(f.s();!(s=f.n()).done;){var h=s.value,y=this.width?this.width(h,r,n,i):void 0;if(y&&!(y<0)){var p=this.height?this.height(h,r,n,i):void 0;if(p&&!(p<0)){o.lineWidth=y;var v=h.x+r/2,d=h.y+r/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=Li(t);try{for(g.s();!(m=g.n()).done;){var w=m.value,x=this.color?this.color(w,r,n,i):void 0;if(x){var S=this.width?this.width(w,r,n,i):void 0;if(S&&!(S<0)){var O=this.height?this.height(w,r,n,i):void 0;if(O&&!(O<0)){var _=w.x+r/2,j=w.y+r/2,P=_-a,k=j-u,E=Math.atan2(k,P),T=Math.sqrt(P*P+k*k)*O/(c-O);l?(o.strokeStyle=x,o.lineWidth=S,o.beginPath(),o.moveTo(_,j),o.lineTo(_+T*Math.cos(E),j+T*Math.sin(E)),o.stroke()):(o.strokeStyle=this.outlineCol,o.lineWidth=S+2*this.outlineWidthPix*n,o.beginPath(),o.moveTo(_,j),o.lineTo(_+T*Math.cos(E),j+T*Math.sin(E)),o.stroke(),o.strokeStyle=x,o.lineWidth=S,o.beginPath(),o.moveTo(_,j),o.lineTo(_+T*Math.cos(E),j+T*Math.sin(E)),o.stroke(),o.strokeStyle=this.outlineCol,o.lineWidth=this.outlineWidthPix*n,o.beginPath(),o.arc(_+T*Math.cos(E),j+T*Math.sin(E),.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:r,z:n,viewScale:i})}}],n&&Ii(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);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 Ui(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function $i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Yi(n.key),n)}}function Yi(t){var e=function(t){if("object"!=Wi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Wi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Wi(e)?e:e+""}function Hi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Hi=function(){return!!t})()}function qi(t){return qi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qi(t)}function Vi(t,e){return Vi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vi(t,e)}var Xi=function(t){function e(){var t,r=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,r){return e=qi(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,Hi()?Reflect.construct(e,r||[],qi(t).constructor):e.apply(t,r))}(this,e,[r])).color=r.color||function(t,e,r,n){return"#EA6BAC"},t.width=r.width||function(t,e,r,n){return e/5},t.length=r.length||function(t,e,r,n){return e},t.diamond=r.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&&Vi(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,r,n){this.filter&&(t=t.filter(this.filter));var o=r.view.z,i=r.offscreenCtx,a=e.buildSides(t,n);if(0!=a.length){var u=this.viewScale?this.viewScale(a,n,o):void 0;i.lineCap="butt";var c,l=.5*n,s=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ui(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ui(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(a);try{for(s.s();!(c=s.n()).done;){var f=c.value,h=this.color?this.color(f,n,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-l,p),i.lineTo(y,p+l),i.lineTo(y+l,p),i.lineTo(y,p-l),i.closePath(),i.fill()}else{var v=this.width?this.width(f,n,o,u):void 0;if(!v||v<=0)continue;var d=this.length?this.length(f,n,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:n,z:o,viewScale:u})}}}],o=[{key:"buildSides",value:function(t,e){var r=[],n=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?r.push({or:"h",x:o.x+n,y:a.y,c1:o,c2:a}):(r.push({or:"h",x:o.x+n,y:o.y+e,c1:o,c2:void 0}),r.push({or:"h",x:a.x+n,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 c=t[u];o.x+e==c.x&&o.y==c.y?r.push({or:"v",x:o.x+e,y:o.y+n,c1:o,c2:c}):(r.push({or:"v",x:o.x+e,y:o.y+n,c1:o,c2:void 0}),r.push({or:"v",x:c.x,y:c.y+n,c1:void 0,c2:c})),o=c}return r}}],n&&$i(r.prototype,n),o&&$i(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Sn);function Zi(t){return Zi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zi(t)}function Ji(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ki(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qi(n.key),n)}}function Qi(t){var e=function(t){if("object"!=Zi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Zi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Zi(e)?e:e+""}function ta(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ta=function(){return!!t})()}function ea(t){return ea=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ea(t)}function ra(t,e){return ra=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ra(t,e)}var na=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=ea(e),function(t,e){if(e&&("object"==Zi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ta()?Reflect.construct(e,r||[],ea(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.code=t.code,r.color=t.color,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&&ra(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=e.offscreenCtx,i=Xi.buildSides(t,r);if(0!=i.length){var a=this.viewScale?this.viewScale(i,r,n):void 0;o.lineCap="butt";var u,c=.5*r,l=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ji(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ji(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(i);try{for(l.s();!(u=l.n()).done;){var s=u.value,f=s.c1?this.code(s.c1,r,n):void 0,h=s.c2?this.code(s.c2,r,n):void 0;if(f!=h){var y=this.width?this.width(s,r,n,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-c,s.y+p),o.lineTo(s.x+c,s.y+p),o.stroke()),f&&(o.beginPath(),o.strokeStyle=this.color[f],o.moveTo(s.x-c,s.y-p),o.lineTo(s.x+c,s.y-p),o.stroke())):(h&&(o.beginPath(),o.strokeStyle=this.color[h],o.moveTo(s.x+p,s.y-c),o.lineTo(s.x+p,s.y+c),o.stroke()),f&&(o.beginPath(),o.strokeStyle=this.color[f],o.moveTo(s.x-p,s.y-c),o.lineTo(s.x-p,s.y+c),o.stroke()))}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,resolution:r,z:n,viewScale:a})}}}],n&&Ki(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Xi);const oa=function t(e){function r(t,r){var n,o;return t=null==t?0:+t,r=null==r?1:+r,function(){var i;if(null!=n)i=n,n=null;else do{n=2*e()-1,i=2*e()-1,o=n*n+i*i}while(!o||o>1);return t+r*i*Math.sqrt(-2*Math.log(o)/o)}}return r.source=t,r}(Math.random);function ia(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=document.createElement("canvas");n.setAttribute("width",t),n.setAttribute("height",e);var o=n.getContext("webgl",r);if(!o)throw new Error("Unable to initialize WebGL. Your browser or machine may not support it.");return{canvas:n,gl:o}}function aa(t){var e=t.createProgram();if(null==e)throw new Error("Cannot create webGL program");for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];for(var i=0,a=n;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 ua(t,e){var r=t.createShader(e);if(null==r)throw new Error("Cannot create webGL shader");for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];if(t.shaderSource(r,o.join("\n")),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS))return r;throw new Error(t.getShaderInfoLog(r)||"Cannot create webGL shader (2)")}function ca(t){return ca="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ca(t)}function la(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,sa(n.key),n)}}function sa(t){var e=function(t){if("object"!=ca(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ca(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ca(e)?e:e+""}var fa=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gl=e,this.sizePix=r||10,this.program=aa(e,ua(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 "),ua(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,r){var n=Pe(r);n&&(this.verticesBuffer.push(t,e),this.colorsBuffer.push(n.r,n.g,n.b,n.opacity))}},{key:"addPointData2",value:function(t,e,r,n,o,i){this.verticesBuffer.push(t,e),this.colorsBuffer.push(r,n,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 r=e.getAttribLocation(this.program,"pos");e.vertexAttribPointer(r,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(r),e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.colorsBuffer),e.STATIC_DRAW);var n=e.getAttribLocation(this.program,"color");e.vertexAttribPointer(n,4,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n),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)}}])&&la(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function ha(t){return ha="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},ha(t)}function ya(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return pa(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pa(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function pa(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function va(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,da(n.key),n)}}function da(t){var e=function(t){if("object"!=ha(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ha(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ha(e)?e:e+""}function ba(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ba=function(){return!!t})()}function ma(t){return ma=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ma(t)}function ga(t,e){return ga=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ga(t,e)}var wa=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=ma(e),function(t,e){if(e&&("object"==ha(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,ba()?Reflect.construct(e,r||[],ma(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.dotNumber=t.dotNumber||function(t,e){return e/100},r.color=t.color||function(){return"#FF5733"},r.dotSize=t.dotSize||function(t,e){return 1.5*e},r.sigma=t.sigma||function(t,e){return t/2},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&&ga(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=this.viewScale?this.viewScale(t,r,n):void 0,i=this.dotSize?this.dotSize(r,n,o):n,a=this.sigma?this.sigma(r,n,o):.4*r,u=oa(0,a),c=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 l=ia(e.w+"",e.h+"");if(!l)return void console.error("No webGL");var s,f=new fa(l.gl,i/n),h=r/2,y=ya(t);try{for(y.s();!(s=y.n()).done;){var p=s.value,v=this.color(p,r,n,o);if(v&&"none"!==v){var d=this.dotNumber(p,r,n,o),b=this.offset(p,r,n),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(),c.drawImage(l.canvas,0,0)}else{var S,O=ya(t);try{for(O.s();!(S=O.n()).done;){var _=S.value,j=this.color(_,r,n,o);if(j&&"none"!==j){c.fillStyle=j;for(var P=this.dotNumber(_,r,n,o),k=this.offset(_,r,n),E=_.x+k.dx+r/2,T=_.y+k.dy+r/2,C=0;C<=P;C++)c.fillRect(E+u(),T+u(),i,i)}}}catch(t){O.e(t)}finally{O.f()}}this.updateLegends({style:this,resolution:r,z:n,viewScale:o})}}],n&&va(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function xa(t){return xa="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},xa(t)}function Sa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Oa(n.key),n)}}function Oa(t){var e=function(t){if("object"!=xa(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=xa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xa(e)?e:e+""}var _a=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 r=[];r.push("precision mediump float;\nvarying float vi;\n"),r.push("uniform vec4");for(var n=0;n<e.length;n++)n>0&&r.push(","),r.push(" c"+n);r.push(";\n"),r.push("void main(void) {\n");for(var o=0;o<e.length;o++)o>0&&r.push("else "),r.push("if(vi=="),r.push(o),r.push(".0) gl_FragColor = vec4(c"),r.push(o),r.push("[0], c"),r.push(o),r.push("[1], c"),r.push(o),r.push("[2], c"),r.push(o),r.push("[3]);\n");r.push("else gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}"),this.fshString=r.join("")},e=[{key:"draw",value:function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,i=aa(t,ua(t,t.VERTEX_SHADER,this.vshString),ua(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 c=t.getAttribLocation(i,"pos");t.vertexAttribPointer(c,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(c),t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array(r),t.STATIC_DRAW);var l=t.getAttribLocation(i,"i");t.vertexAttribPointer(l,1,t.FLOAT,!1,0,0),t.enableVertexAttribArray(l),t.uniformMatrix3fv(t.getUniformLocation(i,"mat"),!1,new Float32Array(n)),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.POINTS,0,e.length/2)}}],e&&Sa(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function ja(t){return ja="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},ja(t)}function Pa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ka(n.key),n)}}function ka(t){var e=function(t){if("object"!=ja(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ja(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ja(e)?e:e+""}function Ea(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ea=function(){return!!t})()}function Ta(t){return Ta=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ta(t)}function Ca(t,e){return Ca=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ca(t,e)}var Aa=function(t){function e(t){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Ta(e),function(t,e){if(e&&("object"==ja(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,Ea()?Reflect.construct(e,r||[],Ta(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.code=t.code,t.color=t.color||void 0;var n=Object.keys(t.color);r.catToI={};for(var o=0;o<n.length;o++)r.catToI[n[o]]=o+"";r.colors=[];for(var i=0,a=n;i<a.length;i++){var u=a[i];r.colors.push(t.color[""+u])}return r.size=t.size,r.wgp=new _a(r.colors),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&&Ca(t,e)}(e,t),r=e,(n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));for(var n,o=e.view.z,i=r/2,a=t.length,u=[],c=[],l=0;l<a;l++){n=t[l];var s=this.code(n);if(null!=s){var f=this.catToI[s];isNaN(+f)?console.log("Unexpected category index: "+s+" "+f):(u.push(n.x+i,n.y+i),c.push(+f))}else console.log("Unexpected category: "+s)}var h=ia(e.w+"",e.h+"");if(h){var y=this.size?this.size(r,o):r+.2*o;this.wgp.draw(h.gl,u,c,e.getWebGLTransform(),y/o),e.initCanvasTransform(),e.offscreenCtx.drawImage(h.canvas,0,0),this.updateLegends({style:this,resolution:r,z:o})}else console.error("No webGL")}}])&&Pa(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function Ma(t,e){let r;if(void 0===e)for(const e of t)null!=e&&(r<e||void 0===r&&e>=e)&&(r=e);else{let n=-1;for(let o of t)null!=(o=e(o,++n,t))&&(r<o||void 0===r&&o>=o)&&(r=o)}return r}function za(t){return null===t?NaN:+t}function La(t,e,r=za){if((n=t.length)&&!isNaN(e=+e)){if(e<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,o=(n-1)*e,i=Math.floor(o),a=+r(t[i],i,t);return a+(+r(t[i+1],i+1,t)-a)*(o-i)}}function Ra(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ia(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Fa(t){let e,r,n;function o(t,n,o=0,i=t.length){if(o<i){if(0!==e(n,n))return i;do{const e=o+i>>>1;r(t[e],n)<0?o=e+1:i=e}while(o<i)}return o}return 2!==t.length?(e=Ra,r=(e,r)=>Ra(t(e),r),n=(e,r)=>t(e)-r):(e=t===Ra||t===Ia?t:Na,r=t,n=t),{left:o,center:function(t,e,r=0,i=t.length){const a=o(t,e,r,i-1);return a>r&&n(t[a-1],e)>-n(t[a],e)?a-1:a},right:function(t,n,o=0,i=t.length){if(o<i){if(0!==e(n,n))return i;do{const e=o+i>>>1;r(t[e],n)<=0?o=e+1:i=e}while(o<i)}return o}}}function Na(){return 0}const Ba=Fa(Ra),Da=Ba.right,Ga=(Ba.left,Fa(za).center,Da);function Wa(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Ua(){var t,e=[],r=[],n=[];function o(){var t=0,o=Math.max(1,r.length);for(n=new Array(o-1);++t<o;)n[t-1]=La(e,t/o);return i}function i(e){return null==e||isNaN(e=+e)?t:r[Ga(n,e)]}return i.invertExtent=function(t){var o=r.indexOf(t);return o<0?[NaN,NaN]:[o>0?n[o-1]:e[0],o<n.length?n[o]:e[e.length-1]]},i.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let r of t)null==r||isNaN(r=+r)||e.push(r);return e.sort(Ra),o()},i.range=function(t){return arguments.length?(r=Array.from(t),o()):r.slice()},i.unknown=function(e){return arguments.length?(t=e,i):t},i.quantiles=function(){return n.slice()},i.copy=function(){return Ua().domain(e).range(r).unknown(t)},Wa.apply(i,arguments)}var $a=function(t){var e=t.valueFunction,r=t.minValue||0,n=t.minSizePix||0,o=t.maxSizeFactor||1,i=t.stretching,a=t.range,u=t.domain,c=t.classNumber;return function(t,l,s){var f=u||[r,Ma(t,e)],h=a||[n*s,l*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)),c&&(t=1==t?1:Math.floor(t*c)/(c-1)),d+t*v}}},Ya=function(t){var e=t.valueFunction,r=t.classNumber||12,n=t.minSizePix||1,o=t.maxSizeFactor||1,i=Ua();return function(t,a,u){i.domain(t.map(e));var c=n*u,l=a*o;return i.range(Array.from({length:r},(function(t,e){return c+e*(l-c)/(r-1)}))),i.breaks=i.quantiles(),i.values=i.range(),i}},Ha=function(t){var e,r=t.valueFunction,n=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 r,n;if(void 0===e)for(const e of t)null!=e&&(void 0===r?e>=e&&(r=n=e):(r>e&&(r=e),n<e&&(n=e)));else{let o=-1;for(let i of t)null!=(i=e(i,++o,t))&&(void 0===r?i>=i&&(r=n=i):(r>i&&(r=i),n<i&&(n=i)))}return[r,n]}(e,r);if(null!=a[0]){var u=a[1]-a[0],c=function(t){return t=(t-a[0])/u,n&&(t=n(t)),o(t)};if(c.invert=function(t){return n&&(t=n.invert(t)),a[0]+t*u},t.colors&&i){c.breaks=[];for(var l=1;l<i;l++)c.breaks.push(c.invert(l/i))}return c}}}},qa=function(t){var e=t.valueFunction,r=t.classNumber||12,n=t.colors;t.colorScale&&(n=Ja(t.colorScale,r)),n=n||Array.from({length:r},(function(t,e){return"rgb("+Math.floor(255*e/(r-1))+",150,150)"}));var o=Ua().range(n);return function(t){return o.domain(t.map(e)),o.breaks=o.quantiles(),o.colors=n,o}},Va=function(t){return function(e,r,n){var o={};for(var i in t)o[i]=t[i](e,r,n);return o}};function Xa(t){var e=t.length,r=function(r){for(var n=0;n<e;){if(r<=t[n])return n;n++}return n};return r.breaks=t,r}function Za(t,e){var r=Xa(t),n=function(t){return e[r(t)]};return n.breaks=t,n.colors=e,n}function Ja(t,e){if(1==e)return[t(.5)];for(var r=[],n=0;n<e;n++)r.push(t(n/(e-1)));return r}function Ka(t){return Ka="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},Ka(t)}function Qa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,tu(n.key),n)}}function tu(t){var e=function(t){if("object"!=Ka(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ka(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ka(e)?e:e+""}var eu=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,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n.colorDark=n.colorDark||"#111",n.colorBright=n.colorBright||"#ddd",n.width=n.width||function(t,e,r){var n=1*r,o=4*r,i=(o-n)/3;return Math.min(n+(t-1)*i,o)};for(var o=Xa(e),i={},a=0;a<r.length;a++)i[a+""]=r[a];var u=new Aa({code:function(e){return o(t(e))},color:i}),c=function(e){return(e.c1?o(t(e.c1)):-1)-(e.c2?o(t(e.c2)):-1)};return[u,new Xi({color:function(t){var e=c(t);if(0!==e)return"v"===t.or?e<0?n.colorBright:n.colorDark:e<0?n.colorDark:n.colorBright},width:function(t,e,r){return n.width(Math.abs(c(t)),e,r)}})]}}],null&&Qa(t.prototype,null),e&&Qa(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function ru(t){return ru="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},ru(t)}function nu(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ou(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ou(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function ou(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function iu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(iu=function(){return!!t})()}function au(t){return au=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},au(t)}function uu(t,e){return uu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},uu(t,e)}function cu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,fu(n.key),n)}}function su(t,e,r){return e&&lu(t.prototype,e),r&&lu(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function fu(t){var e=function(t){if("object"!=ru(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ru(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ru(e)?e:e+""}var hu=function(){return su((function t(){cu(this,t)}),null,[{key:"get",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};(n=n||{}).colDark=n.colDark||"#333",n.colBright=n.colBright||"#aaa",n.widthFactor=n.widthFactor||.12;var o=eu.get(t,e,r,n),i=new Ko({strokeColor:function(){return"#666"},strokeWidth:function(t,e,r){return.2*r},filter:n.filter});return[o[0],i,o[1],new yu({colDark:n.colDark,colBright:n.colBright,filter:n.filter})]}},{key:"getCategory",value:function(t,e,r){return(r=r||{}).colDark=r.colDark||"#333",r.colBright=r.colBright||"#aaa",[new Aa({code:t,color:e}),new Ko({strokeColor:function(){return"#666"},strokeWidth:function(t,e,r){return.2*r}}),new yu({colDark:r.colDark,colBright:r.colBright})]}}])}(),yu=function(t){function e(t){var r,n,o,i;return cu(this,e),n=this,i=[t],o=au(o=e),r=function(t,e){if(e&&("object"==ru(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)}(n,iu()?Reflect.construct(o,i||[],au(n).constructor):o.apply(n,i)),t=t||{},r.colDark=t.colDark||"#333",r.colBright=t.colBright||"#aaa",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&&uu(t,e)}(e,t),su(e,[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.offscreenCtx;n.lineWidth=.6*e.view.z,n.strokeStyle=this.colDark;var o,i=nu(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;n.beginPath(),n.arc(a.x+.5*r,a.y+.5*r,.55*r*.5,Math.PI/4,-Math.PI*(3/4),!0),n.stroke()}}catch(t){i.e(t)}finally{i.f()}n.strokeStyle=this.colBright;var u,c=nu(t);try{for(c.s();!(u=c.n()).done;){var l=u.value;n.beginPath(),n.arc(l.x+.5*r,l.y+.5*r,.55*r*.5,Math.PI/4,-Math.PI*(3/4),!1),n.stroke()}}catch(t){c.e(t)}finally{c.f()}}}])}(Sn);function pu(t){return pu="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},pu(t)}function vu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,du(n.key),n)}}function du(t){var e=function(t){if("object"!=pu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=pu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pu(e)?e:e+""}var bu=function(){return t=function t(e,r,n){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=ua(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<r.length;e++)t.push("uniform vec4 c"+e+";\n");return t.join("")}()+"void main(void) {\n";if(n?"pow"==n.fun?u+=" float t = pow(vt, alpha);\n":"powInv"==n.fun?u+=" float t = 1.0-pow(1.0-vt, 1.0/alpha);\n":"exp"==n.fun?u+=0==n.alpha?"float t = vt;":" float t = (exp(vt * alpha) - 1.0) / (exp(alpha) - 1.0);\n":"log"==n.fun?u+=0==n.alpha?"float t = vt;":" float t = 1.0 - (1.0 / alpha) * log(exp(alpha) * (1.0 - vt) + vt);\n":"circle"==n.fun?0==n.alpha?u+=" float t = vt;\n":1==n.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"==n.fun?0==n.alpha?u+=" float t = vt;\n":1==n.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: "+n.fun),u+=" float t = vt;\n"):u+=" float t = vt;\n",1==r.length)u+=" vec4 cI=c0;\n vec4 cF=c0;\n";else if(2==r.length)u+=" vec4 cI=c0;\n vec4 cF=c1;\n";else{var c=r.length-1,l=c+".0";u+=" vec4 cI;\n",u+=" vec4 cF;\n",u+=" if(t<1.0/"+l+") { cI=c0; cF=c1; t=t*"+l+"; }\n";for(var s=2;s<c;s++)u+=" else if(t<"+s+".0/"+l+") { cI=c"+(s-1)+"; cF=c"+s+"; t="+l+"*t-"+(s-1)+".0; }\n";u+=" else { cI=c"+(c-1)+"; cF=c"+c+"; t="+l+"*t-"+(c-1)+".0; }\n"}1==r.length?u+=" gl_FragColor = vec4(c0[0], c0[1], c0[2], c0[3]);}\n":u+=" gl_FragColor = mix(cI, cF, t);}\n";var f=ua(e,e.FRAGMENT_SHADER,u);this.program=aa(e,a,f),e.useProgram(this.program),e.uniform1f(e.getUniformLocation(this.program,"sizePix"),1*o),e.uniform1f(e.getUniformLocation(this.program,"alpha"),n?1*n.alpha:0);for(var h=0;h<r.length;h++){var y=Pe(r[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,r){var n=this.gl,o=this.program;n.bindBuffer(n.ARRAY_BUFFER,n.createBuffer()),n.bufferData(n.ARRAY_BUFFER,new Float32Array(t),n.STATIC_DRAW);var i=n.getAttribLocation(o,"pos");n.vertexAttribPointer(i,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(i),n.bindBuffer(n.ARRAY_BUFFER,n.createBuffer()),n.bufferData(n.ARRAY_BUFFER,new Float32Array(e),n.STATIC_DRAW);var a=n.getAttribLocation(o,"t");n.vertexAttribPointer(a,1,n.FLOAT,!1,0,0),n.enableVertexAttribArray(a),n.uniformMatrix3fv(n.getUniformLocation(o,"mat"),!1,new Float32Array(r)),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.POINTS,0,t.length/2)}}],e&&vu(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function mu(t){return mu="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},mu(t)}function gu(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function wu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xu(n.key),n)}}function xu(t){var e=function(t){if("object"!=mu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=mu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mu(e)?e:e+""}function Su(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Su=function(){return!!t})()}function Ou(t){return Ou=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ou(t)}function _u(t,e){return _u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_u(t,e)}var ju=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Ou(e),function(t,e){if(e&&("object"==mu(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,Su()?Reflect.construct(e,r||[],Ou(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.tFun=t.tFun,r.stretching=t.stretching,r.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&&(r.colors=[t.color(0),t.color(.2),t.color(.4),t.color(.6),t.color(.8),t.color(1)]),r.opacity=t.opacity,r.size=t.size,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&&_u(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=this.viewScale?this.viewScale(t,r,n):void 0,i=ia(e.w+"",e.h+"",null!=this.opacity?{premultipliedAlpha:!1}:void 0);if(i){var a,u=r/2,c=[],l=[],s=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return gu(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gu(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(s.s();!(a=s.n()).done;){var f=a.value,h=this.tFun(f,r,n,o);null!=h&&null!=h&&(c.push(f.x+u,f.y+u),l.push(h>1?1:h<0?0:h))}}catch(t){s.e(t)}finally{s.f()}var y=this.size?this.size(r,n):r+.2*n,p=this.opacity?this.opacity(r,n):void 0;new bu(i.gl,this.colors,this.stretching,y/n,p).draw(c,l,e.getWebGLTransform()),e.initCanvasTransform(),e.offscreenCtx.drawImage(i.canvas,0,0),this.updateLegends({style:this,resolution:r,z:n,viewScale:o})}else console.error("No webGL")}}],n&&wu(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function Pu(t){return Pu="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},Pu(t)}function ku(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Eu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Tu(n.key),n)}}function Tu(t){var e=function(t){if("object"!=Pu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Pu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pu(e)?e:e+""}function Cu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Cu=function(){return!!t})()}function Au(t){return Au=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Au(t)}function Mu(t,e){return Mu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mu(t,e)}var zu=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Au(e),function(t,e){if(e&&("object"==Pu(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,Cu()?Reflect.construct(e,r||[],Au(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.color=t.color||function(){return"#EA6BAC"},r.mosaicFactor=t.mosaicFactor||.15,r.shadowFactor=t.shadowFactor||.2,r.shadowColor=t.shadowColor||"#555",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&&Mu(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n=e.view.z,o=e.offscreenCtx,i=this.viewScale?this.viewScale(t,r,n):void 0;o.strokeStyle=this.shadowColor,o.lineWidth=this.shadowFactor*r,o.lineJoin="round",o.lineCap="butt";var a,u=r*this.mosaicFactor,c=function(){return{x:Math.random()*u,y:Math.random()*u}},l=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ku(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ku(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(l.s();!(a=l.n()).done;){var s=a.value,f=this.color?this.color(s,r,n,i):void 0;if(f&&"none"!==f){o.fillStyle=f;var h=this.offset(s,r,n),y=c(),p=c(),v=c(),d=c();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+r-v.x,s.y+h.dy+v.y),o.lineTo(s.x+h.dx+r-d.x,s.y+h.dy+r-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+r-v.x,s.y+h.dy+v.y),o.lineTo(s.x+h.dx+r-d.x,s.y+h.dy+r-d.y),o.lineTo(s.x+h.dx+p.x,s.y+h.dy+r-p.y),o.fill()}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,resolution:r,z:n,viewScale:i})}}],n&&Eu(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function Lu(t){return Lu="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},Lu(t)}function Ru(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Iu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Fu(n.key),n)}}function Fu(t){var e=function(t){if("object"!=Lu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Lu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Lu(e)?e:e+""}function Nu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Nu=function(){return!!t})()}function Bu(t){return Bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bu(t)}function Du(t,e){return Du=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Du(t,e)}var Gu=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Bu(e),function(t,e){if(e&&("object"==Lu(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,Nu()?Reflect.construct(e,r||[],Bu(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.color=t.color||function(){return"#EA6BAC"},r.size=t.size||function(t,e){return e},r.shape=t.shape||function(){return"o"},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&&Du(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter));var n,o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,r,o):void 0,u=.5*r,c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ru(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ru(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t);try{for(c.s();!(n=c.n()).done;){var l=n.value,s=this.color?this.color(l,r,o,a):void 0;if(s&&"none"!==s){i.fillStyle=s;var f=this.size(l,r,o,a),h=(f=f<0?0:f>1?1:f)*u,y=this.shape?this.shape(l):"o";if("none"!==y){var p=l.x+u,v=l.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){c.e(t)}finally{c.f()}this.updateLegends({style:this,resolution:r,z:o,viewScale:a})}}],n&&Iu(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function Wu(t){return Wu="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},Wu(t)}function Uu(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return $u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$u(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function $u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Yu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Hu(n.key),n)}}function Hu(t){var e=function(t){if("object"!=Wu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Wu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Wu(e)?e:e+""}function qu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(qu=function(){return!!t})()}function Vu(t){return Vu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vu(t)}function Xu(t,e){return Xu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xu(t,e)}var Zu=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Vu(e),function(t,e){if(e&&("object"==Wu(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,qu()?Reflect.construct(e,r||[],Vu(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.ts=t.ts,r.noData=t.noData||function(t){return void 0===t||""==t||null===t||isNaN(+t)},r.offsetX=t.offsetX||function(t,e,r){return 0},r.width=t.width||function(t,e,r){return e},r.offsetY=t.offsetY||function(t,e,r){return 0},r.height=t.height||function(t,e,r){return e},r.anchorModeY=t.anchorModeY||function(t,e,r){return"center"},r.lineWidth=t.lineWidth||function(t,e,r,n){return 1.5*n},r.color=t.color||function(){return"black"},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&&Xu(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o,i,a=e.view.z,u=e.offscreenCtx,c=this.viewScale?this.viewScale(t,r,a):void 0,l=function(t){var e,r,o,i=Uu(n.ts);try{for(i.s();!(o=i.n()).done;){var a=t[o.value];null!=a&&((null==e||a<e)&&(e=a),(null==r||a>r)&&(r=a))}}catch(t){i.e(t)}finally{i.f()}if(null!=e)return r-e},s=Uu(t);try{for(s.s();!(i=s.n()).done;){var f=l(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=Uu(t);try{for(p.s();!(y=p.n()).done;){var v=y.value,d=this.lineWidth?this.lineWidth(v,r,a,c):void 0;if(d&&!(d<0)){var b=this.color?this.color(v,r,a,c):void 0;if(b){var m=this.offsetX?this.offsetX(v,r,a):0;if(null!=m&&!isNaN(m)){var g=this.width?this.width(v,r,a):r;if(null!=g&&!isNaN(g)){var w=this.offsetY?this.offsetY(v,r,a):0;if(null!=w&&!isNaN(w)){var x=this.height?this.height(v,r,a):r;if(null!=x&&!isNaN(x)){var S=this.anchorModeY?this.anchorModeY(v,r,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=Uu(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 E,T=Uu(this.ts);try{for(T.s();!(E=T.n()).done;){var C=+v[E.value];null!=C&&(null==O||C>O)&&(O=C)}}catch(t){T.e(t)}finally{T.f()}_=r}else{if("center"!==S){console.log("Unexpected anchorModeY: "+S);continue}var A,M=void 0,z=void 0,L=Uu(this.ts);try{for(L.s();!(A=L.n()).done;){var R=v[A.value];null!=R&&((null==M||R<M)&&(M=R),(null==z||R>z)&&(z=R))}}catch(t){L.e(t)}finally{L.f()}O=.5*(+z+ +M),_=r/2}var I=g/(h-1),F=v[this.ts[0]];this.noData(F)||(u.beginPath(),u.moveTo(v.x+m,v.y+_+(F-O)*x/o+w));for(var N=void 0,B=1;B<h;B++)N=v[this.ts[B]],this.noData(F)&&this.noData(N)||(!this.noData(F)&&this.noData(N)?u.stroke():this.noData(F)&&!this.noData(N)?(u.beginPath(),u.moveTo(v.x+B*I+m,v.y+_+(N-O)*x/o+w)):(u.lineTo(v.x+B*I+m,v.y+_+(N-O)*x/o+w),B==h-1&&u.stroke())),F=N}}}}}}}}}catch(t){p.e(t)}finally{p.f()}this.updateLegends({style:this,resolution:r,z:a,viewScale:c})}}}],n&&Yu(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn);function Ju(t){return Ju="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},Ju(t)}function Ku(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||tc(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 Qu(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=tc(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function tc(t,e){if(t){if("string"==typeof t)return ec(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ec(t,e):void 0}}function ec(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function rc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,nc(n.key),n)}}function nc(t){var e=function(t){if("object"!=Ju(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ju(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ju(e)?e:e+""}function oc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(oc=function(){return!!t})()}function ic(t){return ic=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ic(t)}function ac(t,e){return ac=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ac(t,e)}var uc=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=ic(e),function(t,e){if(e&&("object"==Ju(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,oc()?Reflect.construct(e,r||[],ic(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.color=t.color,r.height=t.height||function(t,e,r,n){return.4*e},r.angle=null!=t.angle?t.angle:50,r.cornerLineStrokeColor=t.cornerLineStrokeColor||function(t,e,r,n){return"#999"},r.cornerLineWidth=t.cornerLineWidth||function(t,e,r,n){return n%90==0?0:.8*r},r.sVert=null==t.sVert||t.sVert,r.sHor=null==t.sHor||t.sHor,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&&ac(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,e,r){var n=this;this.filter&&(t=t.filter(this.filter));var o=e.view.z,i=e.offscreenCtx,a=this.viewScale?this.viewScale(t,r,o):void 0,u=Object.keys(this.color),c=r/2,l=this.offset(void 0,r,o),s=l.dx,f=l.dy,h=Xi.buildSides(t,r,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=n.cornerLineWidth?n.cornerLineWidth(t,r,o,n.angle):.8*o;if(0!=e){i.strokeStyle=n.cornerLineStrokeColor?n.cornerLineStrokeColor(t,r,o,n.angle):"#333",i.lineWidth=e;var u=n.height(t,r,o,a);i.beginPath(),i.moveTo(t.x+c+s,t.y+c+f),i.lineTo(t.x+c+u*p+s,t.y+c+u*v+f),i.stroke()}}};i.lineCap="round";var g,w=Qu(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,r,o,a):0,k=O?this.height(O,r,o,a):0,E=cc(S,u),T=cc(O,u);if(0!=E||0!=T)for(var C=0,A=0,M=0,z=Object.entries(this.color);M<z.length;M++){var L=Ku(z[M],2),R=L[0],I=L[1],F=S?+S[R]:0,N=O?+O[R]:0;if(0!=F||0!=N){var B=P*C/E||0,D=P*(C+F)/E||0,G=k*A/T||0,W=k*(A+N)/T||0;i.beginPath(),"h"==x.or?(i.moveTo(_+B*p+s,j-c+B*v+f),i.lineTo(_+G*p+s,j+c+G*v+f),i.lineTo(_+W*p+s,j+c+W*v+f),i.lineTo(_+D*p+s,j-c+D*v+f)):(i.moveTo(_-c+B*p+s,j+B*v+f),i.lineTo(_+c+G*p+s,j+G*v+f),i.lineTo(_+c+W*p+s,j+W*v+f),i.lineTo(_-c+D*p+s,j+D*v+f)),i.fillStyle=I,i.fill(),C+=F,A+=N,m(S),m(O)}}}}catch(t){w.e(t)}finally{w.f()}this.updateLegends({style:this,resolution:r,z:o,viewScale:a})}}}],n&&rc(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Sn),cc=function(t,e){if(!t)return 0;var r,n=0,o=Qu(e);try{for(o.s();!(r=o.n()).done;){var i=t[r.value];i&&(n+=+i)}}catch(t){o.e(t)}finally{o.f()}return n||0};function lc(t){return lc="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},lc(t)}function sc(){sc=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new C(n||[]);return o(a,"_invoke",{value:P(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",y="suspendedYield",p="executing",v="completed",d={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(A([])));S&&S!==r&&n.call(S,a)&&(w=S);var O=g.prototype=b.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==lc(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=k(u,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:y,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(lc(e)+" is not iterable")}return m.prototype=g,o(O,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},_(j.prototype),l(j.prototype,u,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(O),l(O,c,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function fc(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return hc(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?hc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function hc(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function yc(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function pc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,vc(n.key),n)}}function vc(t){var e=function(t){if("object"!=lc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=lc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lc(e)?e:e+""}function dc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(dc=function(){return!!t})()}function bc(t){return bc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bc(t)}function mc(t,e){return mc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mc(t,e)}var gc=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=bc(e),function(t,e){if(e&&("object"==lc(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,dc()?Reflect.construct(e,r||[],bc(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.image=t.image||function(){return""},r.size=t.size||function(t,e){return e},r.cache={},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&&mc(t,e)}(e,t),r=e,n=[{key:"draw",value:(o=sc().mark((function t(e,r,n){var o,i,a,u,c,l,s,f=this;return sc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=r.view.z,i=n/o,a=this.viewScale?this.viewScale(e,n,o):void 0,r.initCanvasTransform(),u=fc(e),t.prev=4,l=sc().mark((function t(){var e,u,l,s,h,y;return sc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=c.value,u=f.image(e,n,o,a)){t.next=4;break}return t.abrupt("return",0);case 4:if(l=f.size(e,n,o,a)/o){t.next=7;break}return t.abrupt("return",0);case 7:if("loading"!=(s=f.cache[u])){t.next=12;break}return t.abrupt("return",{v:void 0});case 12:if(s){y=(i-l)/2;try{r.offscreenCtx.drawImage(s,r.geoToPixX(e.x)+y,r.geoToPixY(e.y)+y-i,l,l)}catch(t){console.error(t)}}else f.cache[u]="loading",(h=new Image).onload=function(){f.cache[u]=h,r.redraw()},h.onerror=function(){console.warn("Could not retrieve image from",u)},h.src=u;case 13:case"end":return t.stop()}}),t)})),u.s();case 7:if((c=u.n()).done){t.next=16;break}return t.delegateYield(l(),"t0",9);case 9:if(0!==(s=t.t0)){t.next=12;break}return t.abrupt("continue",14);case 12:if(!s){t.next=14;break}return t.abrupt("return",s.v);case 14:t.next=7;break;case 16:t.next=21;break;case 18:t.prev=18,t.t1=t.catch(4),u.e(t.t1);case 21:return t.prev=21,u.f(),t.finish(21);case 24:this.updateLegends({style:this,resolution:n,z:o,viewScale:a});case 25:case"end":return t.stop()}}),t,this,[[4,18,21,24]])})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){yc(i,r,n,a,u,"next",t)}function u(t){yc(i,r,n,a,u,"throw",t)}a(void 0)}))},function(t,e,r){return i.apply(this,arguments)})}],n&&pc(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i}(Sn);function wc(t){return wc="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},wc(t)}function xc(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Sc(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Sc(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Sc(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Oc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_c(n.key),n)}}function _c(t){var e=function(t){if("object"!=wc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=wc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wc(e)?e:e+""}function jc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(jc=function(){return!!t})()}function Pc(t){return Pc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pc(t)}function kc(t,e){return kc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kc(t,e)}var Ec=function(t){function e(t,r){var n,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),n=function(t,e,r){return e=Pc(e),function(t,e){if(e&&("object"==wc(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,jc()?Reflect.construct(e,r||[],Pc(t).constructor):e.apply(t,r))}(this,e,[o]),o=o||{},n.dataset=t,n.styles=r,n.minPixelsPerCell=o.minPixelsPerCell||3,n.cellInfoHTML=o.cellInfoHTML||e.defaultCellInfoHTML,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&&kc(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t,r){var n=t.view.z,o=t.offscreenCtx,i=this.getDataset(n);if(i){i.getData(t.extGeo),i.updateViewCache(t.extGeo);var a,u=xc(this.styles);try{for(u.s();!(a=u.n()).done;){var c=a.value;c.visible&&!c.visible(n)||(o.globalAlpha=c.alpha?c.alpha(n):1,c.blendOperation&&(o.globalCompositeOperation=c.blendOperation(n)),t.setCanvasTransform(),c.draw(i.getViewCache(),t,i.getResolution()),c.filterColor&&c.drawFilter(t))}}catch(t){u.e(t)}finally{u.f()}if(r){var l,s=xc(this.styles);try{for(s.s();!(l=s.n()).done;){var f=l.value;if((!f.visible||f.visible(n))&&(e.addLegends(r,f.legends),f.styles)){var h,y=xc(f.styles);try{for(y.s();!(h=y.n()).done;){var p=h.value;p.visible&&!p.visible(n)||e.addLegends(r,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 r,n=xc(e);try{for(n.s();!(r=n.n()).done;){var o=r.value;this.addLegends(t,o)}}catch(t){n.e(t)}finally{n.f()}}else t.node().append(e.div.node())}},{key:"defaultCellInfoHTML",value:function(t){for(var e=[],r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];"x"!==o&&"y"!==o&&e.push("<b>",o,"</b>"," : ",t[o],"<br>")}return e.join("")}}],n&&Oc(r.prototype,n),o&&Oc(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(Tn);function Tc(t){return Tc="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},Tc(t)}function Cc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ac(n.key),n)}}function Ac(t){var e=function(t){if("object"!=Tc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Tc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tc(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 Lc(t,e){return Lc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Lc(t,e)}var Rc=function(t){function e(t){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=zc(e),function(t,e){if(e&&("object"==Tc(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,r||[],zc(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.cache={},r.url=t.url,r.urlFun=t.urlFun||function(t,e,n){return r.url+n+"/"+t+"/"+e+".png"},r.resolutions=t.resolutions,!r.resolutions||0==r.resolutions.length)throw new Error("No resolutions provided for background layer");return r.nbPix=t.nbPix||256,r.origin=t.origin||[0,0],r.z0=t.z0||0,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&&Lc(t,e)}(e,t),r=e,(n=[{key:"get",value:function(t,e,r){var n=this.cache[t];if(n&&(n=n[e]))return n[r]}},{key:"put",value:function(t,e,r,n){this.cache[e]||(this.cache[e]={}),this.cache[e][r]||(this.cache[e][r]={}),this.cache[e][r][n]=t}},{key:"draw",value:function(t){var e=this;if(this.resolutions&&0!=this.resolutions.length){var r=t.view.z,n=this.origin[0],o=this.origin[1],i=0;for(i=0;i<this.resolutions.length&&!(this.resolutions[i]<r);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,c=u/r,l=function(t){return Math.ceil((t-n)/u)},s=function(t){return Math.ceil(-(t-o)/u)},f=l(t.extGeo.xMin)-1,h=l(t.extGeo.xMax),y=s(t.extGeo.yMin),p=s(t.extGeo.yMax)-1,v=function(r){for(var a=function(a){var l=e.get(i,r,a);if(!l){var s=new Image;return e.put(s,i,r,a),s.onload=function(){t.redraw()},s.onerror=function(){e.put("failed",i,r,a)},s.src=e.urlFun(r,a,i),0}if("failed"===l)return 0;if(!(l instanceof HTMLImageElement))return console.log(l),0;if(0==l.width||0==l.height)return 0;var f=n+r*u,h=o-a*u;try{t.initCanvasTransform(),t.offscreenCtx.drawImage(l,t.geoToPixX(f),t.geoToPixY(h),c,c)}catch(t){console.error(t)}},l=p;l<y;l++)a(l)},d=f;d<h;d++)v(d)}else console.error("No resolutions provided for background layer")}}])&&Cc(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Tn);function Ic(t){return Ic="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},Ic(t)}function Fc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Nc(n.key),n)}}function Nc(t){var e=function(t){if("object"!=Ic(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ic(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ic(e)?e:e+""}function Bc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Bc=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 r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Dc(e),function(t,e){if(e&&("object"==Ic(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,Bc()?Reflect.construct(e,r||[],Dc(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.url=t.url,r.img=void 0,r.xMin=void 0,r.xMax=void 0,r.yMin=void 0,r.yMax=void 0,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&&Gc(t,e)}(e,t),r=e,(n=[{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 r=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",r)}),this.img.src=r}}}])&&Fc(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Tn);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 r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Yc(n.key),n)}}function Yc(t){var e=function(t){if("object"!=Uc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Uc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Uc(e)?e:e+""}function Hc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Hc=function(){return!!t})()}function qc(t){return qc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qc(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 r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=qc(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,Hc()?Reflect.construct(e,r||[],qc(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.url=t.url,r.xMin=t.xMin||0,r.yMax=t.yMax||0,r.width=t.width||2e4,r.height=t.height||2e4,r.img=void 0,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&&Vc(t,e)}(e,t),r=e,(n=[{key:"draw",value:function(t){var e=this;if(this.img){var r=t.geoToPixX(this.xMin),n=t.geoToPixY(this.yMax),o=t.getView().z;t.initCanvasTransform(),t.offscreenCtx.drawImage(this.img,r,n,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}}])&&$c(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(Tn);function Zc(t){return Zc="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},Zc(t)}function Jc(){Jc=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new C(n||[]);return o(a,"_invoke",{value:P(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",y="suspendedYield",p="executing",v="completed",d={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(A([])));S&&S!==r&&n.call(S,a)&&(w=S);var O=g.prototype=b.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==Zc(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=k(u,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:y,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Zc(e)+" is not iterable")}return m.prototype=g,o(O,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},_(j.prototype),l(j.prototype,u,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(O),l(O,c,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function Kc(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function Qc(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return tl(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?tl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function tl(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function el(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,rl(n.key),n)}}function rl(t){var e=function(t){if("object"!=Zc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Zc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Zc(e)?e:e+""}function nl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(nl=function(){return!!t})()}function ol(t){return ol=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ol(t)}function il(t,e){return il=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},il(t,e)}var al=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=ol(e),function(t,e){if(e&&("object"==Zc(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,nl()?Reflect.construct(e,r||[],ol(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.url=t.url,r.style=t.style||function(){return"1.2em Arial"},r.color=t.color||(t.dark?function(){return"white"}:function(){return"black"}),r.haloColor=t.haloColor||(t.dark?function(){return"black"}:function(){return"white"}),r.haloWidth=t.haloWidth||function(){return 2.5},r.textAlign=t.textAlign||"start",r.offsetPix=t.offsetPix||[5,5],r.preprocess=t.preprocess,r.labels=void 0,r.loadingStatus="notLoaded",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&&il(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t){if(this.labels){var e=t.view.z,r=t.offscreenCtx;r.textAlign=this.textAlign||"start",r.lineJoin="bevel",r.lineCap="butt",t.initCanvasTransform();var n,o=Qc(this.labels);try{for(o.s();!(n=o.n()).done;){var i=n.value,a=this.style(i,e);if(a&&(r.font=a,t.toDraw(i))){var u=t.geoToPixX(i.x)+this.offsetPix[0],c=t.geoToPixY(i.y)-this.offsetPix[1];if(this.haloColor&&this.haloWidth){var l=this.haloColor(i,e),s=this.haloWidth(i,e);l&&s&&s>0&&(r.strokeStyle=l,r.lineWidth=s,r.strokeText(i.name,u,c))}if(this.color){var f=this.color(i,e);f&&(r.fillStyle=f,r.fillText(i.name,u,c))}}}}catch(t){o.e(t)}finally{o.f()}}else this.load(t.redraw)}},{key:"load",value:(o=Jc().mark((function t(e){var r,n,o,i;return Jc().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.url){t.next=5;break}return console.log("Failed loading labels: No URL specified. "+this.url),this.loadingStatus="failed",this.labels=[],t.abrupt("return");case 5:if("notLoaded"==this.loadingStatus){t.next=7;break}return t.abrupt("return");case 7:return this.loadingStatus="loading",t.prev=8,t.next=11,no(this.url);case 11:if(r=t.sent,!this.preprocess){t.next=35;break}this.labels=[],n=Qc(r),t.prev=15,n.s();case 17:if((o=n.n()).done){t.next=25;break}if(i=o.value,0!=this.preprocess(i)){t.next=22;break}return t.abrupt("continue",23);case 22:this.labels.push(i);case 23:t.next=17;break;case 25:t.next=30;break;case 27:t.prev=27,t.t0=t.catch(15),n.e(t.t0);case 30:return t.prev=30,n.f(),t.finish(30);case 33:t.next=36;break;case 35:this.labels=r;case 36:this.loadingStatus="loaded",e&&e(),t.next=45;break;case 40:t.prev=40,t.t1=t.catch(8),console.log("Failed loading labels from "+this.url),this.labels=[],this.loadingStatus="failed";case 45:case"end":return t.stop()}}),t,this,[[8,40],[15,27,30,33]])})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){Kc(i,r,n,a,u,"next",t)}function u(t){Kc(i,r,n,a,u,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)})}],n&&el(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i}(Tn);function ul(t){return ul="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},ul(t)}function cl(){cl=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),u=new C(n||[]);return o(a,"_invoke",{value:P(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",y="suspendedYield",p="executing",v="completed",d={};function b(){}function m(){}function g(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(A([])));S&&S!==r&&n.call(S,a)&&(w=S);var O=g.prototype=b.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==ul(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=k(u,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:y,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(ul(e)+" is not iterable")}return m.prototype=g,o(O,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=l(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,c,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},_(j.prototype),l(j.prototype,u,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(O),l(O,c,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function ll(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function sl(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return fl(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fl(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function fl(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function hl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,yl(n.key),n)}}function yl(t){var e=function(t){if("object"!=ul(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ul(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ul(e)?e:e+""}function pl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(pl=function(){return!!t})()}function vl(t){return vl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vl(t)}function dl(t,e){return dl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},dl(t,e)}var bl=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=vl(e),function(t,e){if(e&&("object"==ul(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,pl()?Reflect.construct(e,r||[],vl(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.url=t.url,r.preprocess=t.preprocess,r.shape=t.shape||function(t,e){return"circle"},r.size=t.size||function(t,e){return 10},r.strokeStyle=t.strokeStyle||function(t,e){return"red"},r.fillStyle=t.fillStyle||function(t,e){return"black"},r.lineWidth=t.lineWidth||function(t,e){return 2},r.color=t.color||function(t,e){return"gray"},r.width=t.width||function(t,e){return 2},r.lineDash=t.lineDash||function(t,e){},r.fs=void 0,r.loadingStatus="notLoaded",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&&dl(t,e)}(e,t),r=e,n=[{key:"draw",value:function(t){if(this.fs){var e,r=t.view.z,n=t.offscreenCtx,o=sl(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,c=this.shape(i,r);if(!c||"none"==c)continue;var l=this.size(i,r)*r;if(!l)continue;var s=this.strokeStyle(i,r),f=this.fillStyle(i,r),h=this.lineWidth(i,r)*r;s&&(n.strokeStyle=s),f&&(n.fillStyle=f),h&&(n.lineWidth=h),"circle"==c?(n.beginPath(),n.arc(u[0],u[1],l/2,0,2*Math.PI,!1),f&&n.fill(),s&&h&&n.stroke()):"square"==c?(n.beginPath(),n.rect(u[0]-l/2,u[1]-l/2,l,l),f&&n.fill(),s&&h&&n.stroke()):console.error("Unexpected shape for point geojson: "+c)}else if("LineString"==a){var y=i.geometry.coordinates;if(y.length<2)continue;var p=this.color(i,r);if(!p||"none"==p)continue;n.strokeStyle=p;var v=this.width(i,r);if(!v||v<0)continue;n.lineWidth=v*r;var d=this.lineDash(i,r);d&&n.setLineDash(d),n.beginPath(),n.moveTo(y[0][0],y[0][1]);for(var b=1;b<y.length;b++)n.lineTo(y[b][0],y[b][1]);n.stroke()}else console.log("Unsupported geometry type in GeoJSONLayer: "+a)}}catch(t){o.e(t)}finally{o.f()}n.setLineDash([])}else this.load(t.redraw)}},{key:"load",value:(o=cl().mark((function t(e){var r,n,o,i,a;return cl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.url){t.next=5;break}return console.log("Failed loading boundaries: No URL specified. "+this.url),this.loadingStatus="failed",this.labels=[],t.abrupt("return");case 5:if("notLoaded"==this.loadingStatus){t.next=7;break}return t.abrupt("return");case 7:return this.loadingStatus="loading",t.prev=8,t.next=11,Wn(this.url);case 11:if(r=t.sent,n=r.features,!this.preprocess){t.next=36;break}this.fs=[],o=sl(n),t.prev=16,o.s();case 18:if((i=o.n()).done){t.next=26;break}if(a=i.value,0!=this.preprocess(a)){t.next=23;break}return t.abrupt("continue",24);case 23:this.fs.push(a);case 24:t.next=18;break;case 26:t.next=31;break;case 28:t.prev=28,t.t0=t.catch(16),o.e(t.t0);case 31:return t.prev=31,o.f(),t.finish(31);case 34:t.next=37;break;case 36:this.fs=n;case 37:this.loadingStatus="loaded",e&&e(),t.next=46;break;case 41:t.prev=41,t.t1=t.catch(8),console.log("Failed loading boundaries from "+this.url),this.fs=[],this.loadingStatus="failed";case 46:case"end":return t.stop()}}),t,this,[[8,41],[16,28,31,34]])})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){ll(i,r,n,a,u,"next",t)}function u(t){ll(i,r,n,a,u,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)})}],n&&hl(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i}(Tn);function ml(t){return ml="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},ml(t)}function gl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wl(n.key),n)}}function wl(t){var e=function(t){if("object"!=ml(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ml(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ml(e)?e:e+""}var xl=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&&gl(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Sl(t){return Sl="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},Sl(t)}function Ol(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_l(n.key),n)}}function _l(t){var e=function(t){if("object"!=Sl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Sl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Sl(e)?e:e+""}function jl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(jl=function(){return!!t})()}function Pl(t){return Pl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pl(t)}function kl(t,e){return kl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kl(t,e)}var El=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Pl(e),function(t,e){if(e&&("object"==Sl(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,r||[],Pl(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.colorScale=t.colorScale,r.textScale=t.textScale||function(t){return t},r.margin=t.margin||5,r.tickSize=t.tickSize||6,r.ticks=t.ticks||Math.floor(r.width/50),r.tickFormat=t.tickFormat,r.tickUnit=t.tickUnit,r.fontSize=t.fontSize||"0.8em",r.invert=t.invert,r.width=t.width||300,r.height=t.height||15,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&&kl(t,e)}(e,t),r=e,n=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();for(var e=this.width+2*this.margin,r=this.height+this.margin+this.tickSize+10,n=this.div.append("svg").attr("width",e).attr("height",r).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),n.append("rect").attr("x",a).attr("y",0).attr("width",5).attr("height",i).style("fill",this.colorScale(u,t.viewScale))}for(var c=0;c<this.ticks;c++){var l=c/(this.ticks-1);n.append("line").attr("x1",o*l).attr("y1",0).attr("x2",o*l).attr("y2",i+this.tickSize).style("stroke","black"),n.append("text").attr("id","ticklabel_"+c).attr("x",o*l).attr("y",i+this.tickSize+2).style("font-size",this.fontSize).style("text-anchor",0==c?"start":c==this.ticks-1?"end":"middle").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none")}for(var s=this.tickFormat&&"text"!=this.tickFormat?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)}}}],n&&Ol(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(xl);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 Cl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Al(n.key),n)}}function Al(t){var e=function(t){if("object"!=Tl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Tl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tl(e)?e:e+""}function Ml(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ml=function(){return!!t})()}function zl(t){return zl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zl(t)}function Ll(t,e){return Ll=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ll(t,e)}var Rl=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=zl(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,Ml()?Reflect.construct(e,r||[],zl(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.colors=t.colors,r.breaks=t.breaks,r.width=t.width||300,r.height=t.height||15,r.tickSize=t.tickSize||3,r.invert=t.invert,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&&Ll(t,e)}(e,t),r=e,(n=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();var e=this.colors(t.viewScale),r=this.breaks(t.viewScale);if(r){var n=e.length;if(0!=n){for(var o=this.width/n,i=this.div.append("svg").attr("width",this.width).attr("height",this.height+this.tickSize+2+10),a=0;a<n;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<n;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 c=1;c<n;c++){var l=r[c-1];isNaN(l)||null==l||(this.labelFormat&&(l=this.labelFormat(l)),i.append("text").attr("id","ticklabel_"+c).attr("x",o*c).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(l))}}}}}])&&Cl(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(xl);function Il(t){return Il="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},Il(t)}function Fl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Nl(n.key),n)}}function Nl(t){var e=function(t){if("object"!=Il(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Il(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Il(e)?e:e+""}function Bl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Bl=function(){return!!t})()}function Dl(t){return Dl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dl(t)}function Gl(t,e){return Gl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gl(t,e)}var Wl=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Dl(e),function(t,e){if(e&&("object"==Il(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,r||[],Dl(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.colorLabel=t.colorLabel||[["gray","-"]],r.shape=t.shape||"circle",r.dimension=t.dimension||{r:8},r.strokeColor=t.strokeColor||"gray",r.strokeWidth=t.strokeWidth||1,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&&Gl(t,e)}(e,t),r=e,(n=[{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 r=this.colorLabel[e],n=this.div.append("div"),o=this.strokeWidth;if("square"===this.shape){var i=this.dimension.h||15,a=this.dimension.w||20;n.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",r[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,c=2*u+2*o;n.append("div").style("display","inline").append("svg").attr("width",c).attr("height",c).append("circle").attr("cx",u+o).attr("cy",u+o).attr("r",u).style("fill",r[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}n.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(r[1])}}}])&&Fl(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(xl);function Ul(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function $l(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[8,6,5,4,2.5,2],n=Math.pow(10,Math.floor(Math.log10(t))),o=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ul(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ul(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(r);try{for(o.s();!(e=o.n()).done;){var i=e.value;if(n*i<=t)return n*i}}catch(t){o.e(t)}finally{o.f()}return n}function Yl(t){return Yl="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},Yl(t)}function Hl(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ql(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ql(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function ql(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Vl(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Xl(n.key),n)}}function Xl(t){var e=function(t){if("object"!=Yl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Yl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Yl(e)?e:e+""}function Zl(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Zl=function(){return!!t})()}function Jl(t){return Jl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Jl(t)}function Kl(t,e){return Kl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Kl(t,e)}var Ql=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=Jl(e),function(t,e){if(e&&("object"==Yl(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,Zl()?Reflect.construct(e,r||[],Jl(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.label=t.label||void 0,r.size=t.size||void 0,r.shape=t.shape||"circle",r.fillColor=t.fillColor||"none",r.strokeColor=t.strokeColor||"gray",r.strokeWidth=t.strokeWidth||1,r.color=t.color||"gray",r.length=t.length||function(t,e,r){return t},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&&Kl(t,e)}(e,t),r=e,(n=[{key:"update",value:function(t){var e=this;this.div.selectAll("*").remove(),this.makeTitle();var r,n=this.label(t.viewScale,t.cells,t.resolution,t.z);if(r=this.size?this.size(t.viewScale,t.resolution,t.z)/t.z:t.viewScale(+n)/t.z){this.labelFormat&&!isNaN(+n)&&(n=this.labelFormat(n));var o=this.div.append("div"),i=function(){return o.append("svg").attr("width",r+e.strokeWidth+2).attr("height",r+e.strokeWidth+2).style("","inline-block")};if("square"===this.shape)i().append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",r).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth);else if("circle"===this.shape){var a=.5*(r+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",r).style("","inline-block").append("line").attr("x1",0).attr("y1",r/2).attr("x2",u).attr("y2",r/2).style("stroke",this.color).style("stroke-width",r)}o.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(n+(this.labelUnitText?" ":"")+this.labelUnitText)}}}])&&Vl(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(xl);function ts(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=[],i=Hl(t);try{var a=function(){var i=r.value;n.title=i==t[0]?n.title:void 0,n.size=function(){return e(i)},n.label=function(){return i},o.push(new Ql(n))};for(i.s();!(r=i.n()).done;)a()}catch(t){i.e(t)}finally{i.f()}return o}function es(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.k||[.9,.5,.2,.05],o=[],i=Hl(n);try{var a=function(){var i=e.value;r.title=i==n[0]?r.title:void 0,r.label=function(e,r){return $l(i*Ma(r,t))},o.push(new Ql(r))};for(i.s();!(e=i.n()).done;)a()}catch(t){i.e(t)}finally{i.f()}return o}function rs(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.labelFormat||function(t){return t},o=r.labelText||os(n),i=[],a=function(n){r.title=n==e.length-1?r.title:void 0,r.size=function(){return e[n]},r.label=function(){return o(t[n-1],t[n])},i.push(new Ql(r))},u=e.length-1;u>=0;u--)a(u);return i}function ns(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.labelFormat||function(t){return t},n=e.labelText||os(r),o=[],i=e.viewScaleFun||function(t){return t},a=function(r){e.title=r==t-1?e.title:void 0,e.size=function(t){return i(t).values[r]},e.label=function(t){return n(i(t).breaks[r-1],i(t).breaks[r])},o.push(new Ql(e))},u=t-1;u>=0;u--)a(u);return o}function os(t){return function(e,r){return null==e&&null==r?"":null==r?"> "+t(e):null==e?"< "+t(r):t(e)+" - "+t(r)}}function is(t){return is="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},is(t)}function as(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,us(n.key),n)}}function us(t){var e=function(t){if("object"!=is(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=is(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==is(e)?e:e+""}function cs(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(cs=function(){return!!t})()}function ls(t){return ls=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ls(t)}function ss(t,e){return ss=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ss(t,e)}var fs=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=ls(e),function(t,e){if(e&&("object"==is(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,cs()?Reflect.construct(e,r||[],ls(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.orientation=t.orientation||0,r.color=t.color||function(t,e,r){return"gray"},r.width=t.width||function(t,e,r){return 3*e},r.length=t.length||function(t,e,r){return t},r.label=t.label||"-",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&&ss(t,e)}(e,t),r=e,n=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();var e=this.div.append("div"),r=this.color(t.resolution,t.z,t.viewScale),n=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,n),a=e.append("svg").attr("width",i).attr("height",i).style("","inline-block"),u=Math.cos(-this.orientation*Math.PI/180),c=Math.sin(-this.orientation*Math.PI/180),l=.5*i,s=.5*o;a.append("line").attr("x1",l-u*s).attr("y1",l-c*s).attr("x2",l+u*s).attr("y2",l+c*s).style("stroke",r).style("stroke-width",n),e.append("div").style("display","inline").style("padding-left","5px").style("font-size",this.labelFontSize).text(this.label+(this.labelUnitText?" ":"")+this.labelUnitText)}}],n&&as(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(xl);function hs(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=[],o=0;o<t.length;o++)r.title=0==o?r.title:void 0,r.orientation=t[o],r.label=e[o],n.push(new fs(r));return n}function ys(t){return ys="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},ys(t)}function ps(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,vs(n.key),n)}}function vs(t){var e=function(t){if("object"!=ys(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ys(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ys(e)?e:e+""}function ds(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ds=function(){return!!t})()}function bs(t){return bs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bs(t)}function ms(t,e){return ms=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ms(t,e)}var gs=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=function(t,e,r){return e=bs(e),function(t,e){if(e&&("object"==ys(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,ds()?Reflect.construct(e,r||[],bs(t).constructor):e.apply(t,r))}(this,e,[t]),t=t||{},r.classifier=t.classifier,r.width=t.width||150,r.selectionColor=r.selectionColor||"red",r.tooltip=t.tooltip,r.texts=t.texts,r.leftText=t.leftText||"Category 0",r.topText=t.topText||"Category 1",r.rightText=t.rightText||"Category 2",r.centerCoefficient=t.centerCoefficient||r.classifier.centerCoefficient,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&&ms(t,e)}(e,t),r=e,n=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();var e=this.width,r=.866025*e,n=this.classifier,o=this.selectionColor,i=this.tooltip,a=this.texts||{},u=this.div.append("svg").attr("width",e+0).attr("height",r+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+r).text(this.leftText).attr("font-size",12).attr("text-anchor","start"),u.append("text").attr("x",e).attr("y",30+r).text(this.rightText).attr("font-size",12).attr("text-anchor","end");var c=u.append("g").attr("transform","translate(0 16)"),l=function(t,e,r){t.attr("fill",e).on("mouseover",(function(t){pt(this).attr("fill",o),i&&r&&(i.html(r),i.setPosition(t),i.show())})).on("mouseout",(function(){pt(this).attr("fill",e),i&&i.hide()})),i&&r&&t.on("mousemove",(function(t){i.setPosition(t)}))};l(c.append("polygon").attr("points","0,"+r+" "+e/3+","+r+" "+e/2+","+2*r/3+" "+e/6+","+2*r/3),n.colors[0],a[0]),l(c.append("polygon").attr("points",e/2+",0 "+2*e/3+","+r/3+" "+e/2+","+2*r/3+" "+e/3+","+r/3),n.colors[1],a[1]),l(c.append("polygon").attr("points",e+","+r+" "+5*e/6+","+2*r/3+" "+e/2+","+2*r/3+" "+2*e/3+","+r),n.colors[2],a[2]),l(c.append("polygon").attr("points",e/2+","+2*r/3+" "+5*e/6+","+2*r/3+" "+2*e/3+","+r/3),n.mixColors[0],a.m12),l(c.append("polygon").attr("points",e/2+","+2*r/3+" "+e/3+","+r+" "+2*e/3+","+r),n.mixColors[1],a.m02),l(c.append("polygon").attr("points",e/2+","+2*r/3+" "+e/6+","+2*r/3+" "+e/3+","+r/3),n.mixColors[2],a.m01),this.centerCoefficient&&l(c.append("circle").attr("cx",e/2).attr("cy",2*r/3).attr("r",this.centerCoefficient*r/3),n.centerColor,a.center)}}],n&&ps(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(xl),ws=function(t){return t};ws.invert=ws;var xs=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(0==t)return ws;var e=Math.exp(t)-1,r=function(r){return(Math.exp(r*t)-1)/e};return r.invert=function(r){return Math.log(e*r+1)/t},r},Ss=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(0==t)return ws;var e=Math.exp(t),r=1-e,n=function(n){return 1-Math.log(e+n*r)/t};return n.invert=function(n){return(Math.exp((1-n)*t)-e)/r},n},Os=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(1==t)return ws;var e=function(e){return Math.pow(e,t)},r=1/t;return e.invert=function(t){return Math.pow(t,r)},e},_s=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(1==t)return ws;var e=1/t,r=function(t){return 1-Math.pow(1-t,e)};return r.invert=function(e){return 1-Math.pow(1-e,t)},r},js=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;if(0==t)return ws;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}},Ps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;if(0==t)return ws;var e=js(t);return function(t){return 1-e(1-t)}};const ks=Math.PI/180,Es=180/Math.PI,Ts=.96422,Cs=.82521,As=4/29,Ms=6/29,zs=3*Ms*Ms,Ls=Ms*Ms*Ms;function Rs(t){if(t instanceof Fs)return new Fs(t.l,t.a,t.b,t.opacity);if(t instanceof Ws)return Us(t);t instanceof Ae||(t=Te(t));var e,r,n=Gs(t.r),o=Gs(t.g),i=Gs(t.b),a=Ns((.2225045*n+.7168786*o+.0606169*i)/1);return n===o&&o===i?e=r=a:(e=Ns((.4360747*n+.3850649*o+.1430804*i)/Ts),r=Ns((.0139322*n+.0971045*o+.7141733*i)/Cs)),new Fs(116*a-16,500*(e-a),200*(a-r),t.opacity)}function Is(t,e,r,n){return 1===arguments.length?Rs(t):new Fs(t,e,r,null==n?1:n)}function Fs(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function Ns(t){return t>Ls?Math.pow(t,1/3):t/zs+As}function Bs(t){return t>Ms?t*t*t:zs*(t-As)}function Ds(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Gs(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ws(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function Us(t){if(isNaN(t.h))return new Fs(t.l,0,0,t.opacity);var e=t.h*ks;return new Fs(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function $s(t,e){var r=Ye((t=Is(t)).l,(e=Is(e)).l),n=Ye(t.a,e.a),o=Ye(t.b,e.b),i=Ye(t.opacity,e.opacity);return function(e){return t.l=r(e),t.a=n(e),t.b=o(e),t.opacity=i(e),t+""}}function Ys(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Hs(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Hs(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 Hs(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}ce(Fs,Is,le(se,{brighter(t){return new Fs(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new Fs(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,r=isNaN(this.b)?t:t-this.b/200;return new Ae(Ds(3.1338561*(e=Ts*Bs(e))-1.6168667*(t=1*Bs(t))-.4906146*(r=Cs*Bs(r))),Ds(-.9787684*e+1.9161415*t+.033454*r),Ds(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),ce(Ws,(function(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof Ws)return new Ws(t.h,t.c,t.l,t.opacity);if(t instanceof Fs||(t=Rs(t)),0===t.a&&0===t.b)return new Ws(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Es;return new Ws(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new Ws(t,e,r,null==n?1:n)}),le(se,{brighter(t){return new Ws(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new Ws(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return Us(this).rgb()}}));var qs=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t[0],o=t[1],i=t[2],a=Ys(r.center||[1/3,1/3,1/3],3),u=a[0],c=a[1],l=a[2],s=null==r.withMixedClasses||r.withMixedClasses,f=r.centerCoefficient?1-r.centerCoefficient:void 0,h=function(t){var r=e(t);if(r){var a=+t[n]/r,h=+t[o]/r,y=+t[i]/r;return a>=u&&h<=c&&y<=l?null!=f&&(y-l)*(c-f*c)>=(h-f*c)*(f*l-l)?"center":"0":a<=u&&h>=c&&y<=l?null!=f&&(y-l)*(u-f*u)>=(a-f*u)*(f*l-l)?"center":"1":a<=u&&h<=c&&y>=l?null!=f&&(h-c)*(u-f*u)>=(a-f*u)*(f*c-c)?"center":"2":a<=u&&h>=c&&y>=l?null!=f&&a>f*u?"center":s?"m12":h>y?"1":"2":a>=u&&h<=c&&y>=l?null!=f&&h>f*c?"center":s?"m02":a>y?"0":"2":a>=u&&h>=c&&y<=l?null!=f&&y>f*l?"center":s?"m01":h>a?"1":"0":"unknown"}};return h.center=[u,c,l],h.centerCoefficient=r.centerCoefficient,h},Vs=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=Ys(r||["red","green","blue"],3),i=o[0],a=o[1],u=o[2],c=n.colorInterpolation||$s,l=null==n.withMixedClasses||n.withMixedClasses,s=function(t,e){return c(t,e)(.5)},f=Ys(n.mixedColors||l?[s(a,u),s(i,u),s(i,a)]:[],3),h=f[0],y=f[1],p=f[2],v=n.centerColor||c(s(i,a),u)(.333),d=qs(t,e,n),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:n.defaultColor||"black"};return b.center=d.center,b.centerCoefficient=n.centerCoefficient,b.colors=[i,a,u],b.mixColors=[h,y,p],b.centerColor=v,b.classifier=d,b};function Xs(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}var Zs,Js=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ks(t){if(!(e=Js.exec(t)))throw new Error("invalid format: "+t);var e;return new Qs({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 Qs(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 tf(t,e){var r=Xs(t,e);if(!r)return t+"";var n=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+n:n.length>o+1?n.slice(0,o+1)+"."+n.slice(o+1):n+new Array(o-n.length+2).join("0")}Ks.prototype=Qs.prototype,Qs.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 ef={"%":(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)=>tf(100*t,e),r:tf,s:function(t,e){var r=Xs(t,e);if(!r)return t+"";var n=r[0],o=r[1],i=o-(Zs=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=n.length;return i===a?n:i>a?n+new Array(i-a+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Xs(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function rf(t){return t}var nf,of=Array.prototype.map,af=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function uf(t){return nf=function(t){var e,r,n=void 0===t.grouping||void 0===t.thousands?rf:(e=of.call(t.grouping,Number),r=t.thousands+"",function(t,n){for(var o=t.length,i=[],a=0,u=e[0],c=0;o>0&&u>0&&(c+u+1>n&&(u=Math.max(1,n-c)),i.push(t.substring(o-=u,o+u)),!((c+=u+1)>n));)u=e[a=(a+1)%e.length];return i.reverse().join(r)}),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?rf:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(of.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=Ks(t)).fill,r=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"):ef[m]||(void 0===d&&(d=12),b=!0,m="g"),(y||"0"===e&&"="===r)&&(y=!0,e="0",r="=");var g="$"===h?o:"#"===h&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",w="$"===h?i:/[%p]/.test(m)?c:"",x=ef[m],S=/[defgprs%]/.test(m);function O(t){var o,i,c,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,r=t.length,n=1,o=-1;n<r;++n)switch(t[n]){case".":o=e=n;break;case"0":0===o&&(o=n),e=n;break;default:if(!+t[n])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:l:"-"===f||"("===f?"":f)+h,O=("s"===m?af[8+Zs/3]:"")+O+(_&&"("===f?")":""),S)for(o=-1,i=t.length;++o<i;)if(48>(c=t.charCodeAt(o))||c>57){O=(46===c?a+t.slice(o+1):t.slice(o))+O,t=t.slice(0,o);break}}v&&!y&&(t=n(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=n(P+t,P.length?p-O.length:1/0),P=""),r){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 r,n=f(((t=Ks(t)).type="f",t)),o=3*Math.max(-8,Math.min(8,Math.floor((r=e,((r=Xs(Math.abs(r)))?r[1]:NaN)/3)))),i=Math.pow(10,-o),a=af[8+o/3];return function(t){return n(i*t)+a}}}}(t),nf.format,nf.formatPrefix,nf}uf({thousands:",",grouping:[3],currency:["$",""]});var cf=Lr.getParameterByName;return uf({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),e})()));