genomefeatures
Version:
A D3 based genome feature rendering
1 lines • 226 kB
JavaScript
(function(ee,he){typeof exports=="object"&&typeof module<"u"?he(exports):typeof define=="function"&&define.amd?define(["exports"],he):(ee=typeof globalThis<"u"?globalThis:ee||self,he(ee.GenomeFeatureComponent={}))})(this,function(ee){"use strict";function he(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function po(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function or(t){let e,n,i;t.length!==2?(e=he,n=(o,c)=>he(t(o),c),i=(o,c)=>t(o)-c):(e=t===he||t===po?t:_o,n=t,i=t);function r(o,c,f=0,u=o.length){if(f<u){if(e(c,c)!==0)return u;do{const m=f+u>>>1;n(o[m],c)<0?f=m+1:u=m}while(f<u)}return f}function a(o,c,f=0,u=o.length){if(f<u){if(e(c,c)!==0)return u;do{const m=f+u>>>1;n(o[m],c)<=0?f=m+1:u=m}while(f<u)}return f}function s(o,c,f=0,u=o.length){const m=r(o,c,f,u-1);return m>f&&i(o[m-1],c)>-i(o[m],c)?m-1:m}return{left:r,center:s,right:a}}function _o(){return 0}function go(t){return t===null?NaN:+t}const mo=or(he).right;or(go).center;const vo=Math.sqrt(50),wo=Math.sqrt(10),yo=Math.sqrt(2);function an(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),a=i/Math.pow(10,r),s=a>=vo?10:a>=wo?5:a>=yo?2:1;let o,c,f;return r<0?(f=Math.pow(10,-r)/s,o=Math.round(t*f),c=Math.round(e*f),o/f<t&&++o,c/f>e&&--c,f=-f):(f=Math.pow(10,r)*s,o=Math.round(t/f),c=Math.round(e/f),o*f<t&&++o,c*f>e&&--c),c<o&&.5<=n&&n<2?an(t,e,n*2):[o,c,f]}function bo(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const i=e<t,[r,a,s]=i?an(e,t,n):an(t,e,n);if(!(a>=r))return[];const o=a-r+1,c=new Array(o);if(i)if(s<0)for(let f=0;f<o;++f)c[f]=(a-f)/-s;else for(let f=0;f<o;++f)c[f]=(a-f)*s;else if(s<0)for(let f=0;f<o;++f)c[f]=(r+f)/-s;else for(let f=0;f<o;++f)c[f]=(r+f)*s;return c}function Wn(t,e,n){return e=+e,t=+t,n=+n,an(t,e,n)[2]}function xo(t,e,n){e=+e,t=+t,n=+n;const i=e<t,r=i?Wn(e,t,n):Wn(t,e,n);return(i?-1:1)*(r<0?1/-r:r)}function ko(t){return t}var sn=1,Xn=2,Yn=3,on=4,lr=1e-6;function To(t){return"translate("+t+",0)"}function Eo(t){return"translate(0,"+t+")"}function So(t){return e=>+t(e)}function Ao(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function $o(){return!this.__axis}function cr(t,e){var n=[],i=null,r=null,a=6,s=6,o=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,f=t===sn||t===on?-1:1,u=t===on||t===Xn?"x":"y",m=t===sn||t===Yn?To:Eo;function p(_){var E=i??(e.ticks?e.ticks.apply(e,n):e.domain()),z=r??(e.tickFormat?e.tickFormat.apply(e,n):ko),I=Math.max(a,0)+o,A=e.range(),T=+A[0]+c,x=+A[A.length-1]+c,b=(e.bandwidth?Ao:So)(e.copy(),c),S=_.selection?_.selection():_,$=S.selectAll(".domain").data([null]),k=S.selectAll(".tick").data(E,e).order(),B=k.exit(),F=k.enter().append("g").attr("class","tick"),O=k.select("line"),v=k.select("text");$=$.merge($.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(F),O=O.merge(F.append("line").attr("stroke","currentColor").attr(u+"2",f*a)),v=v.merge(F.append("text").attr("fill","currentColor").attr(u,f*I).attr("dy",t===sn?"0em":t===Yn?"0.71em":"0.32em")),_!==S&&($=$.transition(_),k=k.transition(_),O=O.transition(_),v=v.transition(_),B=B.transition(_).attr("opacity",lr).attr("transform",function(q){return isFinite(q=b(q))?m(q+c):this.getAttribute("transform")}),F.attr("opacity",lr).attr("transform",function(q){var P=this.parentNode.__axis;return m((P&&isFinite(P=P(q))?P:b(q))+c)})),B.remove(),$.attr("d",t===on||t===Xn?s?"M"+f*s+","+T+"H"+c+"V"+x+"H"+f*s:"M"+c+","+T+"V"+x:s?"M"+T+","+f*s+"V"+c+"H"+x+"V"+f*s:"M"+T+","+c+"H"+x),k.attr("opacity",1).attr("transform",function(q){return m(b(q)+c)}),O.attr(u+"2",f*a),v.attr(u,f*I).text(z),S.filter($o).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Xn?"start":t===on?"end":"middle"),S.each(function(){this.__axis=b})}return p.scale=function(_){return arguments.length?(e=_,p):e},p.ticks=function(){return n=Array.from(arguments),p},p.tickArguments=function(_){return arguments.length?(n=_==null?[]:Array.from(_),p):n.slice()},p.tickValues=function(_){return arguments.length?(i=_==null?null:Array.from(_),p):i&&i.slice()},p.tickFormat=function(_){return arguments.length?(r=_,p):r},p.tickSize=function(_){return arguments.length?(a=s=+_,p):a},p.tickSizeInner=function(_){return arguments.length?(a=+_,p):a},p.tickSizeOuter=function(_){return arguments.length?(s=+_,p):s},p.tickPadding=function(_){return arguments.length?(o=+_,p):o},p.offset=function(_){return arguments.length?(c=+_,p):c},p}function fr(t){return cr(sn,t)}function No(t){return cr(Yn,t)}var Io={value:()=>{}};function ur(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new ln(n)}function ln(t){this._=t}function Do(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}ln.prototype=ur.prototype={constructor:ln,on:function(t,e){var n=this._,i=Do(t+"",n),r,a=-1,s=i.length;if(arguments.length<2){for(;++a<s;)if((r=(t=i[a]).type)&&(r=Ro(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<s;)if(r=(t=i[a]).type)n[r]=hr(n[r],t.name,e);else if(e==null)for(r in n)n[r]=hr(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ln(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,a;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],i=0,r=a.length;i<r;++i)a[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,a=i.length;r<a;++r)i[r].value.apply(e,n)}};function Ro(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function hr(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=Io,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}var Kn="http://www.w3.org/1999/xhtml";const dr={svg:"http://www.w3.org/2000/svg",xhtml:Kn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function cn(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),dr.hasOwnProperty(e)?{space:dr[e],local:t}:t}function Mo(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Kn&&e.documentElement.namespaceURI===Kn?e.createElement(t):e.createElementNS(n,t)}}function Lo(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function pr(t){var e=cn(t);return(e.local?Lo:Mo)(e)}function Oo(){}function Jn(t){return t==null?Oo:function(){return this.querySelector(t)}}function Co(t){typeof t!="function"&&(t=Jn(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a=e[r],s=a.length,o=i[r]=new Array(s),c,f,u=0;u<s;++u)(c=a[u])&&(f=t.call(c,c.__data__,u,a))&&("__data__"in c&&(f.__data__=c.__data__),o[u]=f);return new Vt(i,this._parents)}function _r(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Fo(){return[]}function gr(t){return t==null?Fo:function(){return this.querySelectorAll(t)}}function zo(t){return function(){return _r(t.apply(this,arguments))}}function Bo(t){typeof t=="function"?t=zo(t):t=gr(t);for(var e=this._groups,n=e.length,i=[],r=[],a=0;a<n;++a)for(var s=e[a],o=s.length,c,f=0;f<o;++f)(c=s[f])&&(i.push(t.call(c,c.__data__,f,s)),r.push(c));return new Vt(i,r)}function mr(t){return function(){return this.matches(t)}}function vr(t){return function(e){return e.matches(t)}}var Ho=Array.prototype.find;function Po(t){return function(){return Ho.call(this.children,t)}}function Vo(){return this.firstElementChild}function Uo(t){return this.select(t==null?Vo:Po(typeof t=="function"?t:vr(t)))}var Zo=Array.prototype.filter;function qo(){return Array.from(this.children)}function Go(t){return function(){return Zo.call(this.children,t)}}function Wo(t){return this.selectAll(t==null?qo:Go(typeof t=="function"?t:vr(t)))}function Xo(t){typeof t!="function"&&(t=mr(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a=e[r],s=a.length,o=i[r]=[],c,f=0;f<s;++f)(c=a[f])&&t.call(c,c.__data__,f,a)&&o.push(c);return new Vt(i,this._parents)}function wr(t){return new Array(t.length)}function Yo(){return new Vt(this._enter||this._groups.map(wr),this._parents)}function fn(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}fn.prototype={constructor:fn,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Ko(t){return function(){return t}}function Jo(t,e,n,i,r,a){for(var s=0,o,c=e.length,f=a.length;s<f;++s)(o=e[s])?(o.__data__=a[s],i[s]=o):n[s]=new fn(t,a[s]);for(;s<c;++s)(o=e[s])&&(r[s]=o)}function Qo(t,e,n,i,r,a,s){var o,c,f=new Map,u=e.length,m=a.length,p=new Array(u),_;for(o=0;o<u;++o)(c=e[o])&&(p[o]=_=s.call(c,c.__data__,o,e)+"",f.has(_)?r[o]=c:f.set(_,c));for(o=0;o<m;++o)_=s.call(t,a[o],o,a)+"",(c=f.get(_))?(i[o]=c,c.__data__=a[o],f.delete(_)):n[o]=new fn(t,a[o]);for(o=0;o<u;++o)(c=e[o])&&f.get(p[o])===c&&(r[o]=c)}function jo(t){return t.__data__}function tl(t,e){if(!arguments.length)return Array.from(this,jo);var n=e?Qo:Jo,i=this._parents,r=this._groups;typeof t!="function"&&(t=Ko(t));for(var a=r.length,s=new Array(a),o=new Array(a),c=new Array(a),f=0;f<a;++f){var u=i[f],m=r[f],p=m.length,_=el(t.call(u,u&&u.__data__,f,i)),E=_.length,z=o[f]=new Array(E),I=s[f]=new Array(E),A=c[f]=new Array(p);n(u,m,z,I,A,_,e);for(var T=0,x=0,b,S;T<E;++T)if(b=z[T]){for(T>=x&&(x=T+1);!(S=I[x])&&++x<E;);b._next=S||null}}return s=new Vt(s,i),s._enter=o,s._exit=c,s}function el(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function nl(){return new Vt(this._exit||this._groups.map(wr),this._parents)}function il(t,e,n){var i=this.enter(),r=this,a=this.exit();return typeof t=="function"?(i=t(i),i&&(i=i.selection())):i=i.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),n==null?a.remove():n(a),i&&r?i.merge(r).order():r}function rl(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,a=i.length,s=Math.min(r,a),o=new Array(r),c=0;c<s;++c)for(var f=n[c],u=i[c],m=f.length,p=o[c]=new Array(m),_,E=0;E<m;++E)(_=f[E]||u[E])&&(p[E]=_);for(;c<r;++c)o[c]=n[c];return new Vt(o,this._parents)}function al(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i=t[e],r=i.length-1,a=i[r],s;--r>=0;)(s=i[r])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function sl(t){t||(t=ol);function e(m,p){return m&&p?t(m.__data__,p.__data__):!m-!p}for(var n=this._groups,i=n.length,r=new Array(i),a=0;a<i;++a){for(var s=n[a],o=s.length,c=r[a]=new Array(o),f,u=0;u<o;++u)(f=s[u])&&(c[u]=f);c.sort(e)}return new Vt(r,this._parents).order()}function ol(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ll(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function cl(){return Array.from(this)}function fl(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,a=i.length;r<a;++r){var s=i[r];if(s)return s}return null}function ul(){let t=0;for(const e of this)++t;return t}function hl(){return!this.node()}function dl(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r=e[n],a=0,s=r.length,o;a<s;++a)(o=r[a])&&t.call(o,o.__data__,a,r);return this}function pl(t){return function(){this.removeAttribute(t)}}function _l(t){return function(){this.removeAttributeNS(t.space,t.local)}}function gl(t,e){return function(){this.setAttribute(t,e)}}function ml(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function vl(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function wl(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function yl(t,e){var n=cn(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((e==null?n.local?_l:pl:typeof e=="function"?n.local?wl:vl:n.local?ml:gl)(n,e))}function yr(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function bl(t){return function(){this.style.removeProperty(t)}}function xl(t,e,n){return function(){this.style.setProperty(t,e,n)}}function kl(t,e,n){return function(){var i=e.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function Tl(t,e,n){return arguments.length>1?this.each((e==null?bl:typeof e=="function"?kl:xl)(t,e,n??"")):Ie(this.node(),t)}function Ie(t,e){return t.style.getPropertyValue(e)||yr(t).getComputedStyle(t,null).getPropertyValue(e)}function El(t){return function(){delete this[t]}}function Sl(t,e){return function(){this[t]=e}}function Al(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function $l(t,e){return arguments.length>1?this.each((e==null?El:typeof e=="function"?Al:Sl)(t,e)):this.node()[t]}function br(t){return t.trim().split(/^|\s+/)}function Qn(t){return t.classList||new xr(t)}function xr(t){this._node=t,this._names=br(t.getAttribute("class")||"")}xr.prototype={add:function(t){var e=this._names.indexOf(t);e<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}};function kr(t,e){for(var n=Qn(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function Tr(t,e){for(var n=Qn(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function Nl(t){return function(){kr(this,t)}}function Il(t){return function(){Tr(this,t)}}function Dl(t,e){return function(){(e.apply(this,arguments)?kr:Tr)(this,t)}}function Rl(t,e){var n=br(t+"");if(arguments.length<2){for(var i=Qn(this.node()),r=-1,a=n.length;++r<a;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?Dl:e?Nl:Il)(n,e))}function Ml(){this.textContent=""}function Ll(t){return function(){this.textContent=t}}function Ol(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Cl(t){return arguments.length?this.each(t==null?Ml:(typeof t=="function"?Ol:Ll)(t)):this.node().textContent}function Fl(){this.innerHTML=""}function zl(t){return function(){this.innerHTML=t}}function Bl(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Hl(t){return arguments.length?this.each(t==null?Fl:(typeof t=="function"?Bl:zl)(t)):this.node().innerHTML}function Pl(){this.nextSibling&&this.parentNode.appendChild(this)}function Vl(){return this.each(Pl)}function Ul(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Zl(){return this.each(Ul)}function ql(t){var e=typeof t=="function"?t:pr(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Gl(){return null}function Wl(t,e){var n=typeof t=="function"?t:pr(t),i=e==null?Gl:typeof e=="function"?e:Jn(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function Xl(){var t=this.parentNode;t&&t.removeChild(this)}function Yl(){return this.each(Xl)}function Kl(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Jl(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ql(t){return this.select(t?Jl:Kl)}function jl(t){return arguments.length?this.property("__data__",t):this.node().__data__}function tc(t){return function(e){t.call(this,e,this.__data__)}}function ec(t){return t.trim().split(/^|\s+/).map(function(e){var n="",i=e.indexOf(".");return i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function nc(t){return function(){var e=this.__on;if(e){for(var n=0,i=-1,r=e.length,a;n<r;++n)a=e[n],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++i]=a;++i?e.length=i:delete this.__on}}}function ic(t,e,n){return function(){var i=this.__on,r,a=tc(e);if(i){for(var s=0,o=i.length;s<o;++s)if((r=i[s]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),r.value=e;return}}this.addEventListener(t.type,a,n),r={type:t.type,name:t.name,value:e,listener:a,options:n},i?i.push(r):this.__on=[r]}}function rc(t,e,n){var i=ec(t+""),r,a=i.length,s;if(arguments.length<2){var o=this.node().__on;if(o){for(var c=0,f=o.length,u;c<f;++c)for(r=0,u=o[c];r<a;++r)if((s=i[r]).type===u.type&&s.name===u.name)return u.value}return}for(o=e?ic:nc,r=0;r<a;++r)this.each(o(i[r],e,n));return this}function Er(t,e,n){var i=yr(t),r=i.CustomEvent;typeof r=="function"?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function ac(t,e){return function(){return Er(this,t,e)}}function sc(t,e){return function(){return Er(this,t,e.apply(this,arguments))}}function oc(t,e){return this.each((typeof e=="function"?sc:ac)(t,e))}function*lc(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,a=i.length,s;r<a;++r)(s=i[r])&&(yield s)}var jn=[null];function Vt(t,e){this._groups=t,this._parents=e}function ge(){return new Vt([[document.documentElement]],jn)}function cc(){return this}Vt.prototype=ge.prototype={constructor:Vt,select:Co,selectAll:Bo,selectChild:Uo,selectChildren:Wo,filter:Xo,data:tl,enter:Yo,exit:nl,join:il,merge:rl,selection:cc,order:al,sort:sl,call:ll,nodes:cl,node:fl,size:ul,empty:hl,each:dl,attr:yl,style:Tl,property:$l,classed:Rl,text:Cl,html:Hl,raise:Vl,lower:Zl,append:ql,insert:Wl,remove:Yl,clone:Ql,datum:jl,on:rc,dispatch:oc,[Symbol.iterator]:lc};function At(t){return typeof t=="string"?new Vt([[document.querySelector(t)]],[document.documentElement]):new Vt([[t]],jn)}function Kt(t){return typeof t=="string"?new Vt([document.querySelectorAll(t)],[document.documentElement]):new Vt([_r(t)],jn)}function ti(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Sr(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Ve(){}var Ue=.7,un=1/Ue,De="\\s*([+-]?\\d+)\\s*",Ze="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ne="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fc=/^#([0-9a-f]{3,8})$/,uc=new RegExp(`^rgb\\(${De},${De},${De}\\)$`),hc=new RegExp(`^rgb\\(${ne},${ne},${ne}\\)$`),dc=new RegExp(`^rgba\\(${De},${De},${De},${Ze}\\)$`),pc=new RegExp(`^rgba\\(${ne},${ne},${ne},${Ze}\\)$`),_c=new RegExp(`^hsl\\(${Ze},${ne},${ne}\\)$`),gc=new RegExp(`^hsla\\(${Ze},${ne},${ne},${Ze}\\)$`),Ar={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};ti(Ve,me,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:$r,formatHex:$r,formatHex8:mc,formatHsl:vc,formatRgb:Nr,toString:Nr});function $r(){return this.rgb().formatHex()}function mc(){return this.rgb().formatHex8()}function vc(){return Lr(this).formatHsl()}function Nr(){return this.rgb().formatRgb()}function me(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=fc.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Ir(e):n===3?new Ut(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?hn(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?hn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=uc.exec(t))?new Ut(e[1],e[2],e[3],1):(e=hc.exec(t))?new Ut(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=dc.exec(t))?hn(e[1],e[2],e[3],e[4]):(e=pc.exec(t))?hn(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=_c.exec(t))?Mr(e[1],e[2]/100,e[3]/100,1):(e=gc.exec(t))?Mr(e[1],e[2]/100,e[3]/100,e[4]):Ar.hasOwnProperty(t)?Ir(Ar[t]):t==="transparent"?new Ut(NaN,NaN,NaN,0):null}function Ir(t){return new Ut(t>>16&255,t>>8&255,t&255,1)}function hn(t,e,n,i){return i<=0&&(t=e=n=NaN),new Ut(t,e,n,i)}function wc(t){return t instanceof Ve||(t=me(t)),t?(t=t.rgb(),new Ut(t.r,t.g,t.b,t.opacity)):new Ut}function ei(t,e,n,i){return arguments.length===1?wc(t):new Ut(t,e,n,i??1)}function Ut(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}ti(Ut,ei,Sr(Ve,{brighter(t){return t=t==null?un:Math.pow(un,t),new Ut(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ue:Math.pow(Ue,t),new Ut(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ut(ve(this.r),ve(this.g),ve(this.b),dn(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:Dr,formatHex:Dr,formatHex8:yc,formatRgb:Rr,toString:Rr}));function Dr(){return`#${we(this.r)}${we(this.g)}${we(this.b)}`}function yc(){return`#${we(this.r)}${we(this.g)}${we(this.b)}${we((isNaN(this.opacity)?1:this.opacity)*255)}`}function Rr(){const t=dn(this.opacity);return`${t===1?"rgb(":"rgba("}${ve(this.r)}, ${ve(this.g)}, ${ve(this.b)}${t===1?")":`, ${t})`}`}function dn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ve(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function we(t){return t=ve(t),(t<16?"0":"")+t.toString(16)}function Mr(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Jt(t,e,n,i)}function Lr(t){if(t instanceof Jt)return new Jt(t.h,t.s,t.l,t.opacity);if(t instanceof Ve||(t=me(t)),!t)return new Jt;if(t instanceof Jt)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),a=Math.max(e,n,i),s=NaN,o=a-r,c=(a+r)/2;return o?(e===a?s=(n-i)/o+(n<i)*6:n===a?s=(i-e)/o+2:s=(e-n)/o+4,o/=c<.5?a+r:2-a-r,s*=60):o=c>0&&c<1?0:s,new Jt(s,o,c,t.opacity)}function bc(t,e,n,i){return arguments.length===1?Lr(t):new Jt(t,e,n,i??1)}function Jt(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}ti(Jt,bc,Sr(Ve,{brighter(t){return t=t==null?un:Math.pow(un,t),new Jt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ue:Math.pow(Ue,t),new Jt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Ut(ni(t>=240?t-240:t+120,r,i),ni(t,r,i),ni(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Jt(Or(this.h),pn(this.s),pn(this.l),dn(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=dn(this.opacity);return`${t===1?"hsl(":"hsla("}${Or(this.h)}, ${pn(this.s)*100}%, ${pn(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Or(t){return t=(t||0)%360,t<0?t+360:t}function pn(t){return Math.max(0,Math.min(1,t||0))}function ni(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const ii=t=>()=>t;function xc(t,e){return function(n){return t+n*e}}function kc(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function Tc(t){return(t=+t)==1?Cr:function(e,n){return n-e?kc(e,n,t):ii(isNaN(e)?n:e)}}function Cr(t,e){var n=e-t;return n?xc(t,n):ii(isNaN(t)?e:t)}const _n=function t(e){var n=Tc(e);function i(r,a){var s=n((r=ei(r)).r,(a=ei(a)).r),o=n(r.g,a.g),c=n(r.b,a.b),f=Cr(r.opacity,a.opacity);return function(u){return r.r=s(u),r.g=o(u),r.b=c(u),r.opacity=f(u),r+""}}return i.gamma=t,i}(1);function Ec(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,i=e.slice(),r;return function(a){for(r=0;r<n;++r)i[r]=t[r]*(1-a)+e[r]*a;return i}}function Sc(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Ac(t,e){var n=e?e.length:0,i=t?Math.min(n,t.length):0,r=new Array(i),a=new Array(n),s;for(s=0;s<i;++s)r[s]=si(t[s],e[s]);for(;s<n;++s)a[s]=e[s];return function(o){for(s=0;s<i;++s)a[s]=r[s](o);return a}}function $c(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function Qt(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Nc(t,e){var n={},i={},r;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in t?n[r]=si(t[r],e[r]):i[r]=e[r];return function(a){for(r in n)i[r]=n[r](a);return i}}var ri=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ai=new RegExp(ri.source,"g");function Ic(t){return function(){return t}}function Dc(t){return function(e){return t(e)+""}}function Fr(t,e){var n=ri.lastIndex=ai.lastIndex=0,i,r,a,s=-1,o=[],c=[];for(t=t+"",e=e+"";(i=ri.exec(t))&&(r=ai.exec(e));)(a=r.index)>n&&(a=e.slice(n,a),o[s]?o[s]+=a:o[++s]=a),(i=i[0])===(r=r[0])?o[s]?o[s]+=r:o[++s]=r:(o[++s]=null,c.push({i:s,x:Qt(i,r)})),n=ai.lastIndex;return n<e.length&&(a=e.slice(n),o[s]?o[s]+=a:o[++s]=a),o.length<2?c[0]?Dc(c[0].x):Ic(e):(e=c.length,function(f){for(var u=0,m;u<e;++u)o[(m=c[u]).i]=m.x(f);return o.join("")})}function si(t,e){var n=typeof e,i;return e==null||n==="boolean"?ii(e):(n==="number"?Qt:n==="string"?(i=me(e))?(e=i,_n):Fr:e instanceof me?_n:e instanceof Date?$c:Sc(e)?Ec:Array.isArray(e)?Ac:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Nc:Qt)(t,e)}function Rc(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var zr=180/Math.PI,oi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Br(t,e,n,i,r,a){var s,o,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*n+e*i)&&(n-=t*c,i-=e*c),(o=Math.sqrt(n*n+i*i))&&(n/=o,i/=o,c/=o),t*i<e*n&&(t=-t,e=-e,c=-c,s=-s),{translateX:r,translateY:a,rotate:Math.atan2(e,t)*zr,skewX:Math.atan(c)*zr,scaleX:s,scaleY:o}}var gn;function Mc(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?oi:Br(e.a,e.b,e.c,e.d,e.e,e.f)}function Lc(t){return t==null||(gn||(gn=document.createElementNS("http://www.w3.org/2000/svg","g")),gn.setAttribute("transform",t),!(t=gn.transform.baseVal.consolidate()))?oi:(t=t.matrix,Br(t.a,t.b,t.c,t.d,t.e,t.f))}function Hr(t,e,n,i){function r(f){return f.length?f.pop()+" ":""}function a(f,u,m,p,_,E){if(f!==m||u!==p){var z=_.push("translate(",null,e,null,n);E.push({i:z-4,x:Qt(f,m)},{i:z-2,x:Qt(u,p)})}else(m||p)&&_.push("translate("+m+e+p+n)}function s(f,u,m,p){f!==u?(f-u>180?u+=360:u-f>180&&(f+=360),p.push({i:m.push(r(m)+"rotate(",null,i)-2,x:Qt(f,u)})):u&&m.push(r(m)+"rotate("+u+i)}function o(f,u,m,p){f!==u?p.push({i:m.push(r(m)+"skewX(",null,i)-2,x:Qt(f,u)}):u&&m.push(r(m)+"skewX("+u+i)}function c(f,u,m,p,_,E){if(f!==m||u!==p){var z=_.push(r(_)+"scale(",null,",",null,")");E.push({i:z-4,x:Qt(f,m)},{i:z-2,x:Qt(u,p)})}else(m!==1||p!==1)&&_.push(r(_)+"scale("+m+","+p+")")}return function(f,u){var m=[],p=[];return f=t(f),u=t(u),a(f.translateX,f.translateY,u.translateX,u.translateY,m,p),s(f.rotate,u.rotate,m,p),o(f.skewX,u.skewX,m,p),c(f.scaleX,f.scaleY,u.scaleX,u.scaleY,m,p),f=u=null,function(_){for(var E=-1,z=p.length,I;++E<z;)m[(I=p[E]).i]=I.x(_);return m.join("")}}}var Oc=Hr(Mc,"px, ","px)","deg)"),Cc=Hr(Lc,", ",")",")"),Re=0,qe=0,Ge=0,Pr=1e3,mn,We,vn=0,ye=0,wn=0,Xe=typeof performance=="object"&&performance.now?performance:Date,Vr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function li(){return ye||(Vr(Fc),ye=Xe.now()+wn)}function Fc(){ye=0}function yn(){this._call=this._time=this._next=null}yn.prototype=Ur.prototype={constructor:yn,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?li():+n)+(e==null?0:+e),!this._next&&We!==this&&(We?We._next=this:mn=this,We=this),this._call=t,this._time=n,ci()},stop:function(){this._call&&(this._call=null,this._time=1/0,ci())}};function Ur(t,e,n){var i=new yn;return i.restart(t,e,n),i}function zc(){li(),++Re;for(var t=mn,e;t;)(e=ye-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Re}function Zr(){ye=(vn=Xe.now())+wn,Re=qe=0;try{zc()}finally{Re=0,Hc(),ye=0}}function Bc(){var t=Xe.now(),e=t-vn;e>Pr&&(wn-=e,vn=t)}function Hc(){for(var t,e=mn,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:mn=n);We=t,ci(i)}function ci(t){if(!Re){qe&&(qe=clearTimeout(qe));var e=t-ye;e>24?(t<1/0&&(qe=setTimeout(Zr,t-Xe.now()-wn)),Ge&&(Ge=clearInterval(Ge))):(Ge||(vn=Xe.now(),Ge=setInterval(Bc,Pr)),Re=1,Vr(Zr))}}function qr(t,e,n){var i=new yn;return e=e==null?0:+e,i.restart(r=>{i.stop(),t(r+e)},e,n),i}var Pc=ur("start","end","cancel","interrupt"),Vc=[],Gr=0,Wr=1,fi=2,bn=3,Xr=4,ui=5,xn=6;function kn(t,e,n,i,r,a){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;Uc(t,n,{name:e,index:i,group:r,on:Pc,tween:Vc,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Gr})}function hi(t,e){var n=jt(t,e);if(n.state>Gr)throw new Error("too late; already scheduled");return n}function ie(t,e){var n=jt(t,e);if(n.state>bn)throw new Error("too late; already running");return n}function jt(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Uc(t,e,n){var i=t.__transition,r;i[e]=n,n.timer=Ur(a,0,n.time);function a(f){n.state=Wr,n.timer.restart(s,n.delay,n.time),n.delay<=f&&s(f-n.delay)}function s(f){var u,m,p,_;if(n.state!==Wr)return c();for(u in i)if(_=i[u],_.name===n.name){if(_.state===bn)return qr(s);_.state===Xr?(_.state=xn,_.timer.stop(),_.on.call("interrupt",t,t.__data__,_.index,_.group),delete i[u]):+u<e&&(_.state=xn,_.timer.stop(),_.on.call("cancel",t,t.__data__,_.index,_.group),delete i[u])}if(qr(function(){n.state===bn&&(n.state=Xr,n.timer.restart(o,n.delay,n.time),o(f))}),n.state=fi,n.on.call("start",t,t.__data__,n.index,n.group),n.state===fi){for(n.state=bn,r=new Array(p=n.tween.length),u=0,m=-1;u<p;++u)(_=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(r[++m]=_);r.length=m+1}}function o(f){for(var u=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=ui,1),m=-1,p=r.length;++m<p;)r[m].call(t,u);n.state===ui&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=xn,n.timer.stop(),delete i[e];for(var f in i)return;delete t.__transition}}function Zc(t,e){var n=t.__transition,i,r,a=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((i=n[s]).name!==e){a=!1;continue}r=i.state>fi&&i.state<ui,i.state=xn,i.timer.stop(),i.on.call(r?"interrupt":"cancel",t,t.__data__,i.index,i.group),delete n[s]}a&&delete t.__transition}}function qc(t){return this.each(function(){Zc(this,t)})}function Gc(t,e){var n,i;return function(){var r=ie(this,t),a=r.tween;if(a!==n){i=n=a;for(var s=0,o=i.length;s<o;++s)if(i[s].name===e){i=i.slice(),i.splice(s,1);break}}r.tween=i}}function Wc(t,e,n){var i,r;if(typeof n!="function")throw new Error;return function(){var a=ie(this,t),s=a.tween;if(s!==i){r=(i=s).slice();for(var o={name:e,value:n},c=0,f=r.length;c<f;++c)if(r[c].name===e){r[c]=o;break}c===f&&r.push(o)}a.tween=r}}function Xc(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i=jt(this.node(),n).tween,r=0,a=i.length,s;r<a;++r)if((s=i[r]).name===t)return s.value;return null}return this.each((e==null?Gc:Wc)(n,t,e))}function di(t,e,n){var i=t._id;return t.each(function(){var r=ie(this,i);(r.value||(r.value={}))[e]=n.apply(this,arguments)}),function(r){return jt(r,i).value[e]}}function Yr(t,e){var n;return(typeof e=="number"?Qt:e instanceof me?_n:(n=me(e))?(e=n,_n):Fr)(t,e)}function Yc(t){return function(){this.removeAttribute(t)}}function Kc(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Jc(t,e,n){var i,r=n+"",a;return function(){var s=this.getAttribute(t);return s===r?null:s===i?a:a=e(i=s,n)}}function Qc(t,e,n){var i,r=n+"",a;return function(){var s=this.getAttributeNS(t.space,t.local);return s===r?null:s===i?a:a=e(i=s,n)}}function jc(t,e,n){var i,r,a;return function(){var s,o=n(this),c;return o==null?void this.removeAttribute(t):(s=this.getAttribute(t),c=o+"",s===c?null:s===i&&c===r?a:(r=c,a=e(i=s,o)))}}function tf(t,e,n){var i,r,a;return function(){var s,o=n(this),c;return o==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),c=o+"",s===c?null:s===i&&c===r?a:(r=c,a=e(i=s,o)))}}function ef(t,e){var n=cn(t),i=n==="transform"?Cc:Yr;return this.attrTween(t,typeof e=="function"?(n.local?tf:jc)(n,i,di(this,"attr."+t,e)):e==null?(n.local?Kc:Yc)(n):(n.local?Qc:Jc)(n,i,e))}function nf(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function rf(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function af(t,e){var n,i;function r(){var a=e.apply(this,arguments);return a!==i&&(n=(i=a)&&rf(t,a)),n}return r._value=e,r}function sf(t,e){var n,i;function r(){var a=e.apply(this,arguments);return a!==i&&(n=(i=a)&&nf(t,a)),n}return r._value=e,r}function of(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var i=cn(t);return this.tween(n,(i.local?af:sf)(i,e))}function lf(t,e){return function(){hi(this,t).delay=+e.apply(this,arguments)}}function cf(t,e){return e=+e,function(){hi(this,t).delay=e}}function ff(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?lf:cf)(e,t)):jt(this.node(),e).delay}function uf(t,e){return function(){ie(this,t).duration=+e.apply(this,arguments)}}function hf(t,e){return e=+e,function(){ie(this,t).duration=e}}function df(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?uf:hf)(e,t)):jt(this.node(),e).duration}function pf(t,e){if(typeof e!="function")throw new Error;return function(){ie(this,t).ease=e}}function _f(t){var e=this._id;return arguments.length?this.each(pf(e,t)):jt(this.node(),e).ease}function gf(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;ie(this,t).ease=n}}function mf(t){if(typeof t!="function")throw new Error;return this.each(gf(this._id,t))}function vf(t){typeof t!="function"&&(t=mr(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var a=e[r],s=a.length,o=i[r]=[],c,f=0;f<s;++f)(c=a[f])&&t.call(c,c.__data__,f,a)&&o.push(c);return new se(i,this._parents,this._name,this._id)}function wf(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,a=Math.min(i,r),s=new Array(i),o=0;o<a;++o)for(var c=e[o],f=n[o],u=c.length,m=s[o]=new Array(u),p,_=0;_<u;++_)(p=c[_]||f[_])&&(m[_]=p);for(;o<i;++o)s[o]=e[o];return new se(s,this._parents,this._name,this._id)}function yf(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function bf(t,e,n){var i,r,a=yf(e)?hi:ie;return function(){var s=a(this,t),o=s.on;o!==i&&(r=(i=o).copy()).on(e,n),s.on=r}}function xf(t,e){var n=this._id;return arguments.length<2?jt(this.node(),n).on.on(t):this.each(bf(n,t,e))}function kf(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Tf(){return this.on("end.remove",kf(this._id))}function Ef(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Jn(t));for(var i=this._groups,r=i.length,a=new Array(r),s=0;s<r;++s)for(var o=i[s],c=o.length,f=a[s]=new Array(c),u,m,p=0;p<c;++p)(u=o[p])&&(m=t.call(u,u.__data__,p,o))&&("__data__"in u&&(m.__data__=u.__data__),f[p]=m,kn(f[p],e,n,p,f,jt(u,n)));return new se(a,this._parents,e,n)}function Sf(t){var e=this._name,n=this._id;typeof t!="function"&&(t=gr(t));for(var i=this._groups,r=i.length,a=[],s=[],o=0;o<r;++o)for(var c=i[o],f=c.length,u,m=0;m<f;++m)if(u=c[m]){for(var p=t.call(u,u.__data__,m,c),_,E=jt(u,n),z=0,I=p.length;z<I;++z)(_=p[z])&&kn(_,e,n,z,p,E);a.push(p),s.push(u)}return new se(a,s,e,n)}var Af=ge.prototype.constructor;function $f(){return new Af(this._groups,this._parents)}function Nf(t,e){var n,i,r;return function(){var a=Ie(this,t),s=(this.style.removeProperty(t),Ie(this,t));return a===s?null:a===n&&s===i?r:r=e(n=a,i=s)}}function Kr(t){return function(){this.style.removeProperty(t)}}function If(t,e,n){var i,r=n+"",a;return function(){var s=Ie(this,t);return s===r?null:s===i?a:a=e(i=s,n)}}function Df(t,e,n){var i,r,a;return function(){var s=Ie(this,t),o=n(this),c=o+"";return o==null&&(c=o=(this.style.removeProperty(t),Ie(this,t))),s===c?null:s===i&&c===r?a:(r=c,a=e(i=s,o))}}function Rf(t,e){var n,i,r,a="style."+e,s="end."+a,o;return function(){var c=ie(this,t),f=c.on,u=c.value[a]==null?o||(o=Kr(e)):void 0;(f!==n||r!==u)&&(i=(n=f).copy()).on(s,r=u),c.on=i}}function Mf(t,e,n){var i=(t+="")=="transform"?Oc:Yr;return e==null?this.styleTween(t,Nf(t,i)).on("end.style."+t,Kr(t)):typeof e=="function"?this.styleTween(t,Df(t,i,di(this,"style."+t,e))).each(Rf(this._id,t)):this.styleTween(t,If(t,i,e),n).on("end.style."+t,null)}function Lf(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function Of(t,e,n){var i,r;function a(){var s=e.apply(this,arguments);return s!==r&&(i=(r=s)&&Lf(t,s,n)),i}return a._value=e,a}function Cf(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(e==null)return this.tween(i,null);if(typeof e!="function")throw new Error;return this.tween(i,Of(t,e,n??""))}function Ff(t){return function(){this.textContent=t}}function zf(t){return function(){var e=t(this);this.textContent=e??""}}function Bf(t){return this.tween("text",typeof t=="function"?zf(di(this,"text",t)):Ff(t==null?"":t+""))}function Hf(t){return function(e){this.textContent=t.call(this,e)}}function Pf(t){var e,n;function i(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&Hf(r)),e}return i._value=t,i}function Vf(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,Pf(t))}function Uf(){for(var t=this._name,e=this._id,n=Jr(),i=this._groups,r=i.length,a=0;a<r;++a)for(var s=i[a],o=s.length,c,f=0;f<o;++f)if(c=s[f]){var u=jt(c,e);kn(c,t,n,f,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new se(i,this._parents,t,n)}function Zf(){var t,e,n=this,i=n._id,r=n.size();return new Promise(function(a,s){var o={value:s},c={value:function(){--r===0&&a()}};n.each(function(){var f=ie(this,i),u=f.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(o),e._.interrupt.push(o),e._.end.push(c)),f.on=e}),r===0&&a()})}var qf=0;function se(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Jr(){return++qf}var oe=ge.prototype;se.prototype={constructor:se,select:Ef,selectAll:Sf,selectChild:oe.selectChild,selectChildren:oe.selectChildren,filter:vf,merge:wf,selection:$f,transition:Uf,call:oe.call,nodes:oe.nodes,node:oe.node,size:oe.size,empty:oe.empty,each:oe.each,on:xf,attr:ef,attrTween:of,style:Mf,styleTween:Cf,text:Bf,textTween:Vf,remove:Tf,tween:Xc,delay:ff,duration:df,ease:_f,easeVarying:mf,end:Zf,[Symbol.iterator]:oe[Symbol.iterator]};function Gf(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Wf={time:null,delay:0,duration:250,ease:Gf};function Xf(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Yf(t){var e,n;t instanceof se?(e=t._id,t=t._name):(e=Jr(),(n=Wf).time=li(),t=t==null?null:t+"");for(var i=this._groups,r=i.length,a=0;a<r;++a)for(var s=i[a],o=s.length,c,f=0;f<o;++f)(c=s[f])&&kn(c,t,e,f,s,n||Xf(c,e));return new se(i,this._parents,t,e)}ge.prototype.interrupt=qc,ge.prototype.transition=Yf;const pi=Math.PI,_i=2*pi,be=1e-6,Kf=_i-be;function Qr(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function Jf(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Qr;const n=10**e;return function(i){this._+=i[0];for(let r=1,a=i.length;r<a;++r)this._+=Math.round(arguments[r]*n)/n+i[r]}}class Qf{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?Qr:Jf(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,i,r){this._append`Q${+e},${+n},${this._x1=+i},${this._y1=+r}`}bezierCurveTo(e,n,i,r,a,s){this._append`C${+e},${+n},${+i},${+r},${this._x1=+a},${this._y1=+s}`}arcTo(e,n,i,r,a){if(e=+e,n=+n,i=+i,r=+r,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,o=this._y1,c=i-e,f=r-n,u=s-e,m=o-n,p=u*u+m*m;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(p>be)if(!(Math.abs(m*c-f*u)>be)||!a)this._append`L${this._x1=e},${this._y1=n}`;else{let _=i-s,E=r-o,z=c*c+f*f,I=_*_+E*E,A=Math.sqrt(z),T=Math.sqrt(p),x=a*Math.tan((pi-Math.acos((z+p-I)/(2*A*T)))/2),b=x/T,S=x/A;Math.abs(b-1)>be&&this._append`L${e+b*u},${n+b*m}`,this._append`A${a},${a},0,0,${+(m*_>u*E)},${this._x1=e+S*c},${this._y1=n+S*f}`}}arc(e,n,i,r,a,s){if(e=+e,n=+n,i=+i,s=!!s,i<0)throw new Error(`negative radius: ${i}`);let o=i*Math.cos(r),c=i*Math.sin(r),f=e+o,u=n+c,m=1^s,p=s?r-a:a-r;this._x1===null?this._append`M${f},${u}`:(Math.abs(this._x1-f)>be||Math.abs(this._y1-u)>be)&&this._append`L${f},${u}`,i&&(p<0&&(p=p%_i+_i),p>Kf?this._append`A${i},${i},0,1,${m},${e-o},${n-c}A${i},${i},0,1,${m},${this._x1=f},${this._y1=u}`:p>be&&this._append`A${i},${i},0,${+(p>=pi)},${m},${this._x1=e+i*Math.cos(a)},${this._y1=n+i*Math.sin(a)}`)}rect(e,n,i,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}}function jf(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Tn(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function Me(t){return t=Tn(Math.abs(t)),t?t[1]:NaN}function tu(t,e){return function(n,i){for(var r=n.length,a=[],s=0,o=t[0],c=0;r>0&&o>0&&(c+o+1>i&&(o=Math.max(1,i-c)),a.push(n.substring(r-=o,r+o)),!((c+=o+1)>i));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function eu(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var nu=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function En(t){if(!(e=nu.exec(t)))throw new Error("invalid format: "+t);var e;return new gi({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]})}En.prototype=gi.prototype;function gi(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}gi.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function iu(t){t:for(var e=t.length,n=1,i=-1,r;n<e;++n)switch(t[n]){case".":i=r=n;break;case"0":i===0&&(i=n),r=n;break;default:if(!+t[n])break t;i>0&&(i=0);break}return i>0?t.slice(0,i)+t.slice(r+1):t}var jr;function ru(t,e){var n=Tn(t,e);if(!n)return t+"";var i=n[0],r=n[1],a=r-(jr=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,s=i.length;return a===s?i:a>s?i+new Array(a-s+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+Tn(t,Math.max(0,e+a-1))[0]}function ta(t,e){var n=Tn(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const ea={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:jf,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)=>ta(t*100,e),r:ta,s:ru,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function na(t){return t}var ia=Array.prototype.map,ra=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function au(t){var e=t.grouping===void 0||t.thousands===void 0?na:tu(ia.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",r=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?na:eu(ia.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function f(m){m=En(m);var p=m.fill,_=m.align,E=m.sign,z=m.symbol,I=m.zero,A=m.width,T=m.comma,x=m.precision,b=m.trim,S=m.type;S==="n"?(T=!0,S="g"):ea[S]||(x===void 0&&(x=12),b=!0,S="g"),(I||p==="0"&&_==="=")&&(I=!0,p="0",_="=");var $=z==="$"?n:z==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",k=z==="$"?i:/[%p]/.test(S)?s:"",B=ea[S],F=/[defgprs%]/.test(S);x=x===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function O(v){var q=$,P=k,J,et,lt;if(S==="c")P=B(v)+P,v="";else{v=+v;var U=v<0||1/v<0;if(v=isNaN(v)?c:B(Math.abs(v),x),b&&(v=iu(v)),U&&+v==0&&E!=="+"&&(U=!1),q=(U?E==="("?E:o:E==="-"||E==="("?"":E)+q,P=(S==="s"?ra[8+jr/3]:"")+P+(U&&E==="("?")":""),F){for(J=-1,et=v.length;++J<et;)if(lt=v.charCodeAt(J),48>lt||lt>57){P=(lt===46?r+v.slice(J+1):v.slice(J))+P,v=v.slice(0,J);break}}}T&&!I&&(v=e(v,1/0));var j=q.length+v.length+P.length,G=j<A?new Array(A-j+1).join(p):"";switch(T&&I&&(v=e(G+v,G.length?A-P.length:1/0),G=""),_){case"<":v=q+v+P+G;break;case"=":v=q+G+v+P;break;case"^":v=G.slice(0,j=G.length>>1)+q+v+P+G.slice(j);break;default:v=G+q+v+P;break}return a(v)}return O.toString=function(){return m+""},O}function u(m,p){var _=f((m=En(m),m.type="f",m)),E=Math.max(-8,Math.min(8,Math.floor(Me(p)/3)))*3,z=Math.pow(10,-E),I=ra[8+E/3];return function(A){return _(z*A)+I}}return{format:f,formatPrefix:u}}var Sn,aa,sa;su({thousands:",",grouping:[3],currency:["$",""]});function su(t){return Sn=au(t),aa=Sn.format,sa=Sn.formatPrefix,Sn}function ou(t){return Math.max(0,-Me(Math.abs(t)))}function lu(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Me(e)/3)))*3-Me(Math.abs(t)))}function cu(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Me(e)-Me(t))+1}function fu(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function uu(t){return function(){return t}}function hu(t){return+t}var oa=[0,1];function Le(t){return t}function mi(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:uu(isNaN(e)?NaN:.5)}function du(t,e){var n;return t>e&&(n=t,t=e,e=n),function(i){return Math.max(t,Math.min(e,i))}}function pu(t,e,n){var i=t[0],r=t[1],a=e[0],s=e[1];return r<i?(i=mi(r,i),a=n(s,a)):(i=mi(i,r),a=n(a,s)),function(o){return a(i(o))}}function _u(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),a=new Array(i),s=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<i;)r[s]=mi(t[s],t[s+1]),a[s]=n(e[s],e[s+1]);return function(o){var c=mo(t,o,1,i)-1;return a[c](r[c](o))}}function gu(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function mu(){var t=oa,e=oa,n=si,i,r,a,s=Le,o,c,f;function u(){var p=Math.min(t.length,e.length);return