@carbon/charts-vue 1.11.1 → 1.11.2

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.
package/dist/index.js CHANGED
@@ -1,17 +1,17 @@
1
- (function(rt,ye){typeof exports=="object"&&typeof module<"u"?ye(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],ye):(rt=typeof globalThis<"u"?globalThis:rt||self,ye(rt.ChartsVue={},rt.Vue))})(this,function(rt,ye){"use strict";function yn(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function nv(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Da(e){let t,n,i;e.length!==2?(t=yn,n=(o,c)=>yn(e(o),c),i=(o,c)=>e(o)-c):(t=e===yn||e===nv?e:iv,n=e,i=e);function r(o,c,l=0,u=o.length){if(l<u){if(t(c,c)!==0)return u;do{const h=l+u>>>1;n(o[h],c)<0?l=h+1:u=h}while(l<u)}return l}function s(o,c,l=0,u=o.length){if(l<u){if(t(c,c)!==0)return u;do{const h=l+u>>>1;n(o[h],c)<=0?l=h+1:u=h}while(l<u)}return l}function a(o,c,l=0,u=o.length){const h=r(o,c,l,u-1);return h>l&&i(o[h-1],c)>-i(o[h],c)?h-1:h}return{left:r,center:a,right:s}}function iv(){return 0}function rv(e){return e===null?NaN:+e}function*sv(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(i=+i)>=i&&(yield i)}}const av=Da(yn).right;Da(rv).center;const ka=av;function ov(e,t){let n=0;if(t===void 0)for(let i of e)i!=null&&(i=+i)>=i&&++n;else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(r=+r)>=r&&++n}return n}function xe(e,t){let n,i;if(t===void 0)for(const r of e)r!=null&&(n===void 0?r>=r&&(n=i=r):(n>r&&(n=r),i<r&&(i=r)));else{let r=-1;for(let s of e)(s=t(s,++r,e))!=null&&(n===void 0?s>=s&&(n=i=s):(n>s&&(n=s),i<s&&(i=s)))}return[n,i]}class xn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r<this._n&&r<32;r++){const s=n[r],a=t+s,o=Math.abs(t)<Math.abs(s)?t-(a-s):s-(a-t);o&&(n[i++]=o),t=a}return n[i]=t,this._n=i+1,this}valueOf(){const t=this._partials;let n=this._n,i,r,s,a=0;if(n>0){for(a=t[--n];n>0&&(i=a,r=t[--n],a=i+r,s=r-(a-i),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(r=s*2,i=a+r,r==i-a&&(a=i))}return a}}class Lc extends Map{constructor(t,n=uv){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(Dc(this,t))}has(t){return super.has(Dc(this,t))}set(t,n){return super.set(lv(this,t),n)}delete(t){return super.delete(cv(this,t))}}function Dc({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function lv({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function cv({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function uv(e){return e!==null&&typeof e=="object"?e.valueOf():e}function hv(e){return e}function dv(e=yn){if(e===yn)return kc;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function kc(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var fv=Array.prototype,pv=fv.slice;function Ra(e){return()=>e}const gv=Math.sqrt(50),mv=Math.sqrt(10),vv=Math.sqrt(2);function Ur(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),a=s>=gv?10:s>=mv?5:s>=vv?2:1;let o,c,l;return r<0?(l=Math.pow(10,-r)/a,o=Math.round(e*l),c=Math.round(t*l),o/l<e&&++o,c/l>t&&--c,l=-l):(l=Math.pow(10,r)*a,o=Math.round(e/l),c=Math.round(t/l),o*l<e&&++o,c*l>t&&--c),c<o&&.5<=n&&n<2?Ur(e,t,n*2):[o,c,l]}function Br(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const i=t<e,[r,s,a]=i?Ur(t,e,n):Ur(e,t,n);if(!(s>=r))return[];const o=s-r+1,c=new Array(o);if(i)if(a<0)for(let l=0;l<o;++l)c[l]=(s-l)/-a;else for(let l=0;l<o;++l)c[l]=(s-l)*a;else if(a<0)for(let l=0;l<o;++l)c[l]=(r+l)/-a;else for(let l=0;l<o;++l)c[l]=(r+l)*a;return c}function jn(e,t,n){return t=+t,e=+e,n=+n,Ur(e,t,n)[2]}function Ia(e,t,n){t=+t,e=+e,n=+n;const i=t<e,r=i?jn(t,e,n):jn(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}function yv(e,t,n){let i;for(;;){const r=jn(e,t,n);if(r===i||r===0||!isFinite(r))return[e,t];r>0?(e=Math.floor(e/r)*r,t=Math.ceil(t/r)*r):r<0&&(e=Math.ceil(e*r)/r,t=Math.floor(t*r)/r),i=r}}function xv(e){return Math.max(1,Math.ceil(Math.log(ov(e))/Math.LN2)+1)}function bv(){var e=hv,t=xe,n=xv;function i(r){Array.isArray(r)||(r=Array.from(r));var s,a=r.length,o,c,l=new Array(a);for(s=0;s<a;++s)l[s]=e(r[s],s,r);var u=t(l),h=u[0],d=u[1],f=n(l,h,d);if(!Array.isArray(f)){const w=d,O=+f;if(t===xe&&([h,d]=yv(h,d,O)),f=Br(h,d,O),f[0]<=h&&(c=jn(h,d,O)),f[f.length-1]>=d)if(w>=d&&t===xe){const _=jn(h,d,O);isFinite(_)&&(_>0?d=(Math.floor(d/_)+1)*_:_<0&&(d=(Math.ceil(d*-_)+1)/-_))}else f.pop()}for(var p=f.length,m=0,g=p;f[m]<=h;)++m;for(;f[g-1]>d;)--g;(m||g<p)&&(f=f.slice(m,g),p=g-m);var v=new Array(p+1),b;for(s=0;s<=p;++s)b=v[s]=[],b.x0=s>0?f[s-1]:h,b.x1=s<p?f[s]:d;if(isFinite(c)){if(c>0)for(s=0;s<a;++s)(o=l[s])!=null&&h<=o&&o<=d&&v[Math.min(p,Math.floor((o-h)/c))].push(r[s]);else if(c<0){for(s=0;s<a;++s)if((o=l[s])!=null&&h<=o&&o<=d){const w=Math.floor((h-o)*c);v[Math.min(p,w+(f[w]<=o))].push(r[s])}}}else for(s=0;s<a;++s)(o=l[s])!=null&&h<=o&&o<=d&&v[ka(f,o,0,p)].push(r[s]);return v}return i.value=function(r){return arguments.length?(e=typeof r=="function"?r:Ra(r),i):e},i.domain=function(r){return arguments.length?(t=typeof r=="function"?r:Ra([r[0],r[1]]),i):t},i.thresholds=function(r){return arguments.length?(n=typeof r=="function"?r:Ra(Array.isArray(r)?pv.call(r):r),i):n},i}function bn(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function ln(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function Rc(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?kc:dv(r);i>n;){if(i-n>600){const c=i-n+1,l=t-n+1,u=Math.log(c),h=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*h*(c-h)/c)*(l-c/2<0?-1:1),f=Math.max(n,Math.floor(t-l*h/c+d)),p=Math.min(i,Math.floor(t+(c-l)*h/c+d));Rc(e,t,f,p,r)}const s=e[t];let a=n,o=i;for($i(e,n,t),r(e[i],s)>0&&$i(e,n,i);a<o;){for($i(e,a,o),++a,--o;r(e[a],s)<0;)++a;for(;r(e[o],s)>0;)--o}r(e[n],s)===0?$i(e,n,o):(++o,$i(e,o,i)),o<=t&&(n=o+1),t<=o&&(i=o-1)}return e}function $i(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function Pa(e,t,n){if(e=Float64Array.from(sv(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return ln(e);if(t>=1)return bn(e);var i,r=(i-1)*t,s=Math.floor(r),a=bn(Rc(e,s).subarray(0,s+1)),o=ln(e.subarray(s+1));return a+(o-a)*(r-s)}}function*wv(e){for(const t of e)yield*t}function Ic(e){return Array.from(wv(e))}function Ev(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(r);++i<r;)s[i]=e+i*n;return s}function _v(e){return e}var Hr=1,Vr=2,Na=3,Li=4,Pc=1e-6;function Sv(e){return"translate("+e+",0)"}function Ov(e){return"translate(0,"+e+")"}function Tv(e){return t=>+e(t)}function Mv(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function Cv(){return!this.__axis}function Gr(e,t){var n=[],i=null,r=null,s=6,a=6,o=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=e===Hr||e===Li?-1:1,u=e===Li||e===Vr?"x":"y",h=e===Hr||e===Na?Sv:Ov;function d(f){var p=i??(t.ticks?t.ticks.apply(t,n):t.domain()),m=r??(t.tickFormat?t.tickFormat.apply(t,n):_v),g=Math.max(s,0)+o,v=t.range(),b=+v[0]+c,w=+v[v.length-1]+c,O=(t.bandwidth?Mv:Tv)(t.copy(),c),_=f.selection?f.selection():f,T=_.selectAll(".domain").data([null]),S=_.selectAll(".tick").data(p,t).order(),$=S.exit(),D=S.enter().append("g").attr("class","tick"),L=S.select("line"),M=S.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),S=S.merge(D),L=L.merge(D.append("line").attr("stroke","currentColor").attr(u+"2",l*s)),M=M.merge(D.append("text").attr("fill","currentColor").attr(u,l*g).attr("dy",e===Hr?"0em":e===Na?"0.71em":"0.32em")),f!==_&&(T=T.transition(f),S=S.transition(f),L=L.transition(f),M=M.transition(f),$=$.transition(f).attr("opacity",Pc).attr("transform",function(B){return isFinite(B=O(B))?h(B+c):this.getAttribute("transform")}),D.attr("opacity",Pc).attr("transform",function(B){var x=this.parentNode.__axis;return h((x&&isFinite(x=x(B))?x:O(B))+c)})),$.remove(),T.attr("d",e===Li||e===Vr?a?"M"+l*a+","+b+"H"+c+"V"+w+"H"+l*a:"M"+c+","+b+"V"+w:a?"M"+b+","+l*a+"V"+c+"H"+w+"V"+l*a:"M"+b+","+c+"H"+w),S.attr("opacity",1).attr("transform",function(B){return h(O(B)+c)}),L.attr(u+"2",l*s),M.attr(u,l*g).text(m),_.filter(Cv).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Vr?"start":e===Li?"end":"middle"),_.each(function(){this.__axis=O})}return d.scale=function(f){return arguments.length?(t=f,d):t},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(f){return arguments.length?(n=f==null?[]:Array.from(f),d):n.slice()},d.tickValues=function(f){return arguments.length?(i=f==null?null:Array.from(f),d):i&&i.slice()},d.tickFormat=function(f){return arguments.length?(r=f,d):r},d.tickSize=function(f){return arguments.length?(s=a=+f,d):s},d.tickSizeInner=function(f){return arguments.length?(s=+f,d):s},d.tickSizeOuter=function(f){return arguments.length?(a=+f,d):a},d.tickPadding=function(f){return arguments.length?(o=+f,d):o},d.offset=function(f){return arguments.length?(c=+f,d):c},d}function Av(e){return Gr(Hr,e)}function $v(e){return Gr(Vr,e)}function Ua(e){return Gr(Na,e)}function Nc(e){return Gr(Li,e)}var Lv={value:()=>{}};function Ba(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new Fr(n)}function Fr(e){this._=e}function Dv(e,t){return e.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&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Fr.prototype=Ba.prototype={constructor:Fr,on:function(e,t){var n=this._,i=Dv(e+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((r=(e=i[s]).type)&&(r=kv(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(r=(e=i[s]).type)n[r]=Uc(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Uc(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Fr(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)}};function kv(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function Uc(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=Lv,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ha="http://www.w3.org/1999/xhtml";const Bc={svg:"http://www.w3.org/2000/svg",xhtml:Ha,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function zr(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Bc.hasOwnProperty(t)?{space:Bc[t],local:e}:e}function Rv(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ha&&t.documentElement.namespaceURI===Ha?t.createElement(e):t.createElementNS(n,e)}}function Iv(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Hc(e){var t=zr(e);return(t.local?Iv:Rv)(t)}function Pv(){}function Va(e){return e==null?Pv:function(){return this.querySelector(e)}}function Nv(e){typeof e!="function"&&(e=Va(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],a=s.length,o=i[r]=new Array(a),c,l,u=0;u<a;++u)(c=s[u])&&(l=e.call(c,c.__data__,u,s))&&("__data__"in c&&(l.__data__=c.__data__),o[u]=l);return new oe(i,this._parents)}function Uv(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Bv(){return[]}function Vc(e){return e==null?Bv:function(){return this.querySelectorAll(e)}}function Hv(e){return function(){return Uv(e.apply(this,arguments))}}function Vv(e){typeof e=="function"?e=Hv(e):e=Vc(e);for(var t=this._groups,n=t.length,i=[],r=[],s=0;s<n;++s)for(var a=t[s],o=a.length,c,l=0;l<o;++l)(c=a[l])&&(i.push(e.call(c,c.__data__,l,a)),r.push(c));return new oe(i,r)}function Gc(e){return function(){return this.matches(e)}}function Fc(e){return function(t){return t.matches(e)}}var Gv=Array.prototype.find;function Fv(e){return function(){return Gv.call(this.children,e)}}function zv(){return this.firstElementChild}function jv(e){return this.select(e==null?zv:Fv(typeof e=="function"?e:Fc(e)))}var Wv=Array.prototype.filter;function qv(){return Array.from(this.children)}function Yv(e){return function(){return Wv.call(this.children,e)}}function Xv(e){return this.selectAll(e==null?qv:Yv(typeof e=="function"?e:Fc(e)))}function Zv(e){typeof e!="function"&&(e=Gc(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],a=s.length,o=i[r]=[],c,l=0;l<a;++l)(c=s[l])&&e.call(c,c.__data__,l,s)&&o.push(c);return new oe(i,this._parents)}function zc(e){return new Array(e.length)}function Kv(){return new oe(this._enter||this._groups.map(zc),this._parents)}function jr(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}jr.prototype={constructor:jr,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Qv(e){return function(){return e}}function Jv(e,t,n,i,r,s){for(var a=0,o,c=t.length,l=s.length;a<l;++a)(o=t[a])?(o.__data__=s[a],i[a]=o):n[a]=new jr(e,s[a]);for(;a<c;++a)(o=t[a])&&(r[a]=o)}function t0(e,t,n,i,r,s,a){var o,c,l=new Map,u=t.length,h=s.length,d=new Array(u),f;for(o=0;o<u;++o)(c=t[o])&&(d[o]=f=a.call(c,c.__data__,o,t)+"",l.has(f)?r[o]=c:l.set(f,c));for(o=0;o<h;++o)f=a.call(e,s[o],o,s)+"",(c=l.get(f))?(i[o]=c,c.__data__=s[o],l.delete(f)):n[o]=new jr(e,s[o]);for(o=0;o<u;++o)(c=t[o])&&l.get(d[o])===c&&(r[o]=c)}function e0(e){return e.__data__}function n0(e,t){if(!arguments.length)return Array.from(this,e0);var n=t?t0:Jv,i=this._parents,r=this._groups;typeof e!="function"&&(e=Qv(e));for(var s=r.length,a=new Array(s),o=new Array(s),c=new Array(s),l=0;l<s;++l){var u=i[l],h=r[l],d=h.length,f=i0(e.call(u,u&&u.__data__,l,i)),p=f.length,m=o[l]=new Array(p),g=a[l]=new Array(p),v=c[l]=new Array(d);n(u,h,m,g,v,f,t);for(var b=0,w=0,O,_;b<p;++b)if(O=m[b]){for(b>=w&&(w=b+1);!(_=g[w])&&++w<p;);O._next=_||null}}return a=new oe(a,i),a._enter=o,a._exit=c,a}function i0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function r0(){return new oe(this._exit||this._groups.map(zc),this._parents)}function s0(e,t,n){var i=this.enter(),r=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?s.remove():n(s),i&&r?i.merge(r).order():r}function a0(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,r=n.length,s=i.length,a=Math.min(r,s),o=new Array(r),c=0;c<a;++c)for(var l=n[c],u=i[c],h=l.length,d=o[c]=new Array(h),f,p=0;p<h;++p)(f=l[p]||u[p])&&(d[p]=f);for(;c<r;++c)o[c]=n[c];return new oe(o,this._parents)}function o0(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i=e[t],r=i.length-1,s=i[r],a;--r>=0;)(a=i[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function l0(e){e||(e=c0);function t(h,d){return h&&d?e(h.__data__,d.__data__):!h-!d}for(var n=this._groups,i=n.length,r=new Array(i),s=0;s<i;++s){for(var a=n[s],o=a.length,c=r[s]=new Array(o),l,u=0;u<o;++u)(l=a[u])&&(c[u]=l);c.sort(t)}return new oe(r,this._parents).order()}function c0(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function u0(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function h0(){return Array.from(this)}function d0(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,s=i.length;r<s;++r){var a=i[r];if(a)return a}return null}function f0(){let e=0;for(const t of this)++e;return e}function p0(){return!this.node()}function g0(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var r=t[n],s=0,a=r.length,o;s<a;++s)(o=r[s])&&e.call(o,o.__data__,s,r);return this}function m0(e){return function(){this.removeAttribute(e)}}function v0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function y0(e,t){return function(){this.setAttribute(e,t)}}function x0(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function b0(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function w0(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function E0(e,t){var n=zr(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((t==null?n.local?v0:m0:typeof t=="function"?n.local?w0:b0:n.local?x0:y0)(n,t))}function jc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function _0(e){return function(){this.style.removeProperty(e)}}function S0(e,t,n){return function(){this.style.setProperty(e,t,n)}}function O0(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function T0(e,t,n){return arguments.length>1?this.each((t==null?_0:typeof t=="function"?O0:S0)(e,t,n??"")):Wn(this.node(),e)}function Wn(e,t){return e.style.getPropertyValue(t)||jc(e).getComputedStyle(e,null).getPropertyValue(t)}function M0(e){return function(){delete this[e]}}function C0(e,t){return function(){this[e]=t}}function A0(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function $0(e,t){return arguments.length>1?this.each((t==null?M0:typeof t=="function"?A0:C0)(e,t)):this.node()[e]}function Wc(e){return e.trim().split(/^|\s+/)}function Ga(e){return e.classList||new qc(e)}function qc(e){this._node=e,this._names=Wc(e.getAttribute("class")||"")}qc.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Yc(e,t){for(var n=Ga(e),i=-1,r=t.length;++i<r;)n.add(t[i])}function Xc(e,t){for(var n=Ga(e),i=-1,r=t.length;++i<r;)n.remove(t[i])}function L0(e){return function(){Yc(this,e)}}function D0(e){return function(){Xc(this,e)}}function k0(e,t){return function(){(t.apply(this,arguments)?Yc:Xc)(this,e)}}function R0(e,t){var n=Wc(e+"");if(arguments.length<2){for(var i=Ga(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?k0:t?L0:D0)(n,t))}function I0(){this.textContent=""}function P0(e){return function(){this.textContent=e}}function N0(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function U0(e){return arguments.length?this.each(e==null?I0:(typeof e=="function"?N0:P0)(e)):this.node().textContent}function B0(){this.innerHTML=""}function H0(e){return function(){this.innerHTML=e}}function V0(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function G0(e){return arguments.length?this.each(e==null?B0:(typeof e=="function"?V0:H0)(e)):this.node().innerHTML}function F0(){this.nextSibling&&this.parentNode.appendChild(this)}function z0(){return this.each(F0)}function j0(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function W0(){return this.each(j0)}function q0(e){var t=typeof e=="function"?e:Hc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Y0(){return null}function X0(e,t){var n=typeof e=="function"?e:Hc(e),i=t==null?Y0:typeof t=="function"?t:Va(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function Z0(){var e=this.parentNode;e&&e.removeChild(this)}function K0(){return this.each(Z0)}function Q0(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function J0(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ty(e){return this.select(e?J0:Q0)}function ey(e){return arguments.length?this.property("__data__",e):this.node().__data__}function ny(e){return function(t){e.call(this,t,this.__data__)}}function iy(e){return e.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function ry(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n<r;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function sy(e,t,n){return function(){var i=this.__on,r,s=ny(t);if(i){for(var a=0,o=i.length;a<o;++a)if((r=i[a]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=n),r.value=t;return}}this.addEventListener(e.type,s,n),r={type:e.type,name:e.name,value:t,listener:s,options:n},i?i.push(r):this.__on=[r]}}function ay(e,t,n){var i=iy(e+""),r,s=i.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var c=0,l=o.length,u;c<l;++c)for(r=0,u=o[c];r<s;++r)if((a=i[r]).type===u.type&&a.name===u.name)return u.value}return}for(o=t?sy:ry,r=0;r<s;++r)this.each(o(i[r],t,n));return this}function Zc(e,t,n){var i=jc(e),r=i.CustomEvent;typeof r=="function"?r=new r(t,n):(r=i.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function oy(e,t){return function(){return Zc(this,e,t)}}function ly(e,t){return function(){return Zc(this,e,t.apply(this,arguments))}}function cy(e,t){return this.each((typeof t=="function"?ly:oy)(e,t))}function*uy(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,s=i.length,a;r<s;++r)(a=i[r])&&(yield a)}var Kc=[null];function oe(e,t){this._groups=e,this._parents=t}function Di(){return new oe([[document.documentElement]],Kc)}function hy(){return this}oe.prototype=Di.prototype={constructor:oe,select:Nv,selectAll:Vv,selectChild:jv,selectChildren:Xv,filter:Zv,data:n0,enter:Kv,exit:r0,join:s0,merge:a0,selection:hy,order:o0,sort:l0,call:u0,nodes:h0,node:d0,size:f0,empty:p0,each:g0,attr:E0,style:T0,property:$0,classed:R0,text:U0,html:G0,raise:z0,lower:W0,append:q0,insert:X0,remove:K0,clone:ty,datum:ey,on:ay,dispatch:cy,[Symbol.iterator]:uy};function P(e){return typeof e=="string"?new oe([[document.querySelector(e)]],[document.documentElement]):new oe([[e]],Kc)}function dy(e){let t;for(;t=e.sourceEvent;)e=t;return e}function wn(e,t){if(e=dy(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const Fa={capture:!0,passive:!1};function za(e){e.preventDefault(),e.stopImmediatePropagation()}function fy(e){var t=e.document.documentElement,n=P(e).on("dragstart.drag",za,Fa);"onselectstart"in t?n.on("selectstart.drag",za,Fa):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function py(e,t){var n=e.document.documentElement,i=P(e).on("dragstart.drag",null);t&&(i.on("click.drag",za,Fa),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function ja(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Qc(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function ki(){}var Ri=.7,Wr=1/Ri,qn="\\s*([+-]?\\d+)\\s*",Ii="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$e="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gy=/^#([0-9a-f]{3,8})$/,my=new RegExp(`^rgb\\(${qn},${qn},${qn}\\)$`),vy=new RegExp(`^rgb\\(${$e},${$e},${$e}\\)$`),yy=new RegExp(`^rgba\\(${qn},${qn},${qn},${Ii}\\)$`),xy=new RegExp(`^rgba\\(${$e},${$e},${$e},${Ii}\\)$`),by=new RegExp(`^hsl\\(${Ii},${$e},${$e}\\)$`),wy=new RegExp(`^hsla\\(${Ii},${$e},${$e},${Ii}\\)$`),Jc={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};ja(ki,Ge,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:tu,formatHex:tu,formatHex8:Ey,formatHsl:_y,formatRgb:eu,toString:eu});function tu(){return this.rgb().formatHex()}function Ey(){return this.rgb().formatHex8()}function _y(){return au(this).formatHsl()}function eu(){return this.rgb().formatRgb()}function Ge(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=gy.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?nu(t):n===3?new ee(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?qr(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?qr(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=my.exec(e))?new ee(t[1],t[2],t[3],1):(t=vy.exec(e))?new ee(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=yy.exec(e))?qr(t[1],t[2],t[3],t[4]):(t=xy.exec(e))?qr(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=by.exec(e))?su(t[1],t[2]/100,t[3]/100,1):(t=wy.exec(e))?su(t[1],t[2]/100,t[3]/100,t[4]):Jc.hasOwnProperty(e)?nu(Jc[e]):e==="transparent"?new ee(NaN,NaN,NaN,0):null}function nu(e){return new ee(e>>16&255,e>>8&255,e&255,1)}function qr(e,t,n,i){return i<=0&&(e=t=n=NaN),new ee(e,t,n,i)}function Sy(e){return e instanceof ki||(e=Ge(e)),e?(e=e.rgb(),new ee(e.r,e.g,e.b,e.opacity)):new ee}function Wa(e,t,n,i){return arguments.length===1?Sy(e):new ee(e,t,n,i??1)}function ee(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}ja(ee,Wa,Qc(ki,{brighter(e){return e=e==null?Wr:Math.pow(Wr,e),new ee(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ri:Math.pow(Ri,e),new ee(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ee(En(this.r),En(this.g),En(this.b),Yr(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:iu,formatHex:iu,formatHex8:Oy,formatRgb:ru,toString:ru}));function iu(){return`#${_n(this.r)}${_n(this.g)}${_n(this.b)}`}function Oy(){return`#${_n(this.r)}${_n(this.g)}${_n(this.b)}${_n((isNaN(this.opacity)?1:this.opacity)*255)}`}function ru(){const e=Yr(this.opacity);return`${e===1?"rgb(":"rgba("}${En(this.r)}, ${En(this.g)}, ${En(this.b)}${e===1?")":`, ${e})`}`}function Yr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function En(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function _n(e){return e=En(e),(e<16?"0":"")+e.toString(16)}function su(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new be(e,t,n,i)}function au(e){if(e instanceof be)return new be(e.h,e.s,e.l,e.opacity);if(e instanceof ki||(e=Ge(e)),!e)return new be;if(e instanceof be)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),a=NaN,o=s-r,c=(s+r)/2;return o?(t===s?a=(n-i)/o+(n<i)*6:n===s?a=(i-t)/o+2:a=(t-n)/o+4,o/=c<.5?s+r:2-s-r,a*=60):o=c>0&&c<1?0:a,new be(a,o,c,e.opacity)}function qa(e,t,n,i){return arguments.length===1?au(e):new be(e,t,n,i??1)}function be(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}ja(be,qa,Qc(ki,{brighter(e){return e=e==null?Wr:Math.pow(Wr,e),new be(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ri:Math.pow(Ri,e),new be(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new ee(Ya(e>=240?e-240:e+120,r,i),Ya(e,r,i),Ya(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new be(ou(this.h),Xr(this.s),Xr(this.l),Yr(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 e=Yr(this.opacity);return`${e===1?"hsl(":"hsla("}${ou(this.h)}, ${Xr(this.s)*100}%, ${Xr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ou(e){return e=(e||0)%360,e<0?e+360:e}function Xr(e){return Math.max(0,Math.min(1,e||0))}function Ya(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Xa=e=>()=>e;function Ty(e,t){return function(n){return e+n*t}}function My(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function Cy(e){return(e=+e)==1?lu:function(t,n){return n-t?My(t,n,e):Xa(isNaN(t)?n:t)}}function lu(e,t){var n=t-e;return n?Ty(e,n):Xa(isNaN(e)?t:e)}const Zr=function e(t){var n=Cy(t);function i(r,s){var a=n((r=Wa(r)).r,(s=Wa(s)).r),o=n(r.g,s.g),c=n(r.b,s.b),l=lu(r.opacity,s.opacity);return function(u){return r.r=a(u),r.g=o(u),r.b=c(u),r.opacity=l(u),r+""}}return i.gamma=e,i}(1);function Ay(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(s){for(r=0;r<n;++r)i[r]=e[r]*(1-s)+t[r]*s;return i}}function $y(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ly(e,t){var n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),s=new Array(n),a;for(a=0;a<i;++a)r[a]=Pi(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<i;++a)s[a]=r[a](o);return s}}function Dy(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function le(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function ky(e,t){var n={},i={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=Pi(e[r],t[r]):i[r]=t[r];return function(s){for(r in n)i[r]=n[r](s);return i}}var Za=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ka=new RegExp(Za.source,"g");function Ry(e){return function(){return e}}function Iy(e){return function(t){return e(t)+""}}function cu(e,t){var n=Za.lastIndex=Ka.lastIndex=0,i,r,s,a=-1,o=[],c=[];for(e=e+"",t=t+"";(i=Za.exec(e))&&(r=Ka.exec(t));)(s=r.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(i=i[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,c.push({i:a,x:le(i,r)})),n=Ka.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?c[0]?Iy(c[0].x):Ry(t):(t=c.length,function(l){for(var u=0,h;u<t;++u)o[(h=c[u]).i]=h.x(l);return o.join("")})}function Pi(e,t){var n=typeof t,i;return t==null||n==="boolean"?Xa(t):(n==="number"?le:n==="string"?(i=Ge(t))?(t=i,Zr):cu:t instanceof Ge?Zr:t instanceof Date?Dy:$y(t)?Ay:Array.isArray(t)?Ly:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?ky:le)(e,t)}function uu(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var hu=180/Math.PI,Qa={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function du(e,t,n,i,r,s){var a,o,c;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(c=e*n+t*i)&&(n-=e*c,i-=t*c),(o=Math.sqrt(n*n+i*i))&&(n/=o,i/=o,c/=o),e*i<t*n&&(e=-e,t=-t,c=-c,a=-a),{translateX:r,translateY:s,rotate:Math.atan2(t,e)*hu,skewX:Math.atan(c)*hu,scaleX:a,scaleY:o}}var Kr;function Py(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Qa:du(t.a,t.b,t.c,t.d,t.e,t.f)}function Ny(e){return e==null||(Kr||(Kr=document.createElementNS("http://www.w3.org/2000/svg","g")),Kr.setAttribute("transform",e),!(e=Kr.transform.baseVal.consolidate()))?Qa:(e=e.matrix,du(e.a,e.b,e.c,e.d,e.e,e.f))}function fu(e,t,n,i){function r(l){return l.length?l.pop()+" ":""}function s(l,u,h,d,f,p){if(l!==h||u!==d){var m=f.push("translate(",null,t,null,n);p.push({i:m-4,x:le(l,h)},{i:m-2,x:le(u,d)})}else(h||d)&&f.push("translate("+h+t+d+n)}function a(l,u,h,d){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),d.push({i:h.push(r(h)+"rotate(",null,i)-2,x:le(l,u)})):u&&h.push(r(h)+"rotate("+u+i)}function o(l,u,h,d){l!==u?d.push({i:h.push(r(h)+"skewX(",null,i)-2,x:le(l,u)}):u&&h.push(r(h)+"skewX("+u+i)}function c(l,u,h,d,f,p){if(l!==h||u!==d){var m=f.push(r(f)+"scale(",null,",",null,")");p.push({i:m-4,x:le(l,h)},{i:m-2,x:le(u,d)})}else(h!==1||d!==1)&&f.push(r(f)+"scale("+h+","+d+")")}return function(l,u){var h=[],d=[];return l=e(l),u=e(u),s(l.translateX,l.translateY,u.translateX,u.translateY,h,d),a(l.rotate,u.rotate,h,d),o(l.skewX,u.skewX,h,d),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,h,d),l=u=null,function(f){for(var p=-1,m=d.length,g;++p<m;)h[(g=d[p]).i]=g.x(f);return h.join("")}}}var Uy=fu(Py,"px, ","px)","deg)"),By=fu(Ny,", ",")",")");function Hy(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}var Yn=0,Ni=0,Ui=0,pu=1e3,Qr,Bi,Jr=0,Sn=0,ts=0,Hi=typeof performance=="object"&&performance.now?performance:Date,gu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ja(){return Sn||(gu(Vy),Sn=Hi.now()+ts)}function Vy(){Sn=0}function es(){this._call=this._time=this._next=null}es.prototype=mu.prototype={constructor:es,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ja():+n)+(t==null?0:+t),!this._next&&Bi!==this&&(Bi?Bi._next=this:Qr=this,Bi=this),this._call=e,this._time=n,to()},stop:function(){this._call&&(this._call=null,this._time=1/0,to())}};function mu(e,t,n){var i=new es;return i.restart(e,t,n),i}function Gy(){Ja(),++Yn;for(var e=Qr,t;e;)(t=Sn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Yn}function vu(){Sn=(Jr=Hi.now())+ts,Yn=Ni=0;try{Gy()}finally{Yn=0,zy(),Sn=0}}function Fy(){var e=Hi.now(),t=e-Jr;t>pu&&(ts-=t,Jr=e)}function zy(){for(var e,t=Qr,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Qr=n);Bi=e,to(i)}function to(e){if(!Yn){Ni&&(Ni=clearTimeout(Ni));var t=e-Sn;t>24?(e<1/0&&(Ni=setTimeout(vu,e-Hi.now()-ts)),Ui&&(Ui=clearInterval(Ui))):(Ui||(Jr=Hi.now(),Ui=setInterval(Fy,pu)),Yn=1,gu(vu))}}function yu(e,t,n){var i=new es;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var jy=Ba("start","end","cancel","interrupt"),Wy=[],xu=0,bu=1,eo=2,ns=3,wu=4,no=5,is=6;function rs(e,t,n,i,r,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;qy(e,n,{name:t,index:i,group:r,on:jy,tween:Wy,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:xu})}function io(e,t){var n=we(e,t);if(n.state>xu)throw new Error("too late; already scheduled");return n}function Le(e,t){var n=we(e,t);if(n.state>ns)throw new Error("too late; already running");return n}function we(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function qy(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=mu(s,0,n.time);function s(l){n.state=bu,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var u,h,d,f;if(n.state!==bu)return c();for(u in i)if(f=i[u],f.name===n.name){if(f.state===ns)return yu(a);f.state===wu?(f.state=is,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[u]):+u<t&&(f.state=is,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[u])}if(yu(function(){n.state===ns&&(n.state=wu,n.timer.restart(o,n.delay,n.time),o(l))}),n.state=eo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===eo){for(n.state=ns,r=new Array(d=n.tween.length),u=0,h=-1;u<d;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++h]=f);r.length=h+1}}function o(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=no,1),h=-1,d=r.length;++h<d;)r[h].call(e,u);n.state===no&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=is,n.timer.stop(),delete i[t];for(var l in i)return;delete e.__transition}}function ro(e,t){var n=e.__transition,i,r,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((i=n[a]).name!==t){s=!1;continue}r=i.state>eo&&i.state<no,i.state=is,i.timer.stop(),i.on.call(r?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[a]}s&&delete e.__transition}}function Yy(e){return this.each(function(){ro(this,e)})}function Xy(e,t){var n,i;return function(){var r=Le(this,e),s=r.tween;if(s!==n){i=n=s;for(var a=0,o=i.length;a<o;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}r.tween=i}}function Zy(e,t,n){var i,r;if(typeof n!="function")throw new Error;return function(){var s=Le(this,e),a=s.tween;if(a!==i){r=(i=a).slice();for(var o={name:t,value:n},c=0,l=r.length;c<l;++c)if(r[c].name===t){r[c]=o;break}c===l&&r.push(o)}s.tween=r}}function Ky(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=we(this.node(),n).tween,r=0,s=i.length,a;r<s;++r)if((a=i[r]).name===e)return a.value;return null}return this.each((t==null?Xy:Zy)(n,e,t))}function so(e,t,n){var i=e._id;return e.each(function(){var r=Le(this,i);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return we(r,i).value[t]}}function Eu(e,t){var n;return(typeof t=="number"?le:t instanceof Ge?Zr:(n=Ge(t))?(t=n,Zr):cu)(e,t)}function Qy(e){return function(){this.removeAttribute(e)}}function Jy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function t1(e,t,n){var i,r=n+"",s;return function(){var a=this.getAttribute(e);return a===r?null:a===i?s:s=t(i=a,n)}}function e1(e,t,n){var i,r=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===r?null:a===i?s:s=t(i=a,n)}}function n1(e,t,n){var i,r,s;return function(){var a,o=n(this),c;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),c=o+"",a===c?null:a===i&&c===r?s:(r=c,s=t(i=a,o)))}}function i1(e,t,n){var i,r,s;return function(){var a,o=n(this),c;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),c=o+"",a===c?null:a===i&&c===r?s:(r=c,s=t(i=a,o)))}}function r1(e,t){var n=zr(e),i=n==="transform"?By:Eu;return this.attrTween(e,typeof t=="function"?(n.local?i1:n1)(n,i,so(this,"attr."+e,t)):t==null?(n.local?Jy:Qy)(n):(n.local?e1:t1)(n,i,t))}function s1(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function a1(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function o1(e,t){var n,i;function r(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&a1(e,s)),n}return r._value=t,r}function l1(e,t){var n,i;function r(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&s1(e,s)),n}return r._value=t,r}function c1(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var i=zr(e);return this.tween(n,(i.local?o1:l1)(i,t))}function u1(e,t){return function(){io(this,e).delay=+t.apply(this,arguments)}}function h1(e,t){return t=+t,function(){io(this,e).delay=t}}function d1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?u1:h1)(t,e)):we(this.node(),t).delay}function f1(e,t){return function(){Le(this,e).duration=+t.apply(this,arguments)}}function p1(e,t){return t=+t,function(){Le(this,e).duration=t}}function g1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?f1:p1)(t,e)):we(this.node(),t).duration}function m1(e,t){if(typeof t!="function")throw new Error;return function(){Le(this,e).ease=t}}function v1(e){var t=this._id;return arguments.length?this.each(m1(t,e)):we(this.node(),t).ease}function y1(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Le(this,e).ease=n}}function x1(e){if(typeof e!="function")throw new Error;return this.each(y1(this._id,e))}function b1(e){typeof e!="function"&&(e=Gc(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],a=s.length,o=i[r]=[],c,l=0;l<a;++l)(c=s[l])&&e.call(c,c.__data__,l,s)&&o.push(c);return new Fe(i,this._parents,this._name,this._id)}function w1(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,r=n.length,s=Math.min(i,r),a=new Array(i),o=0;o<s;++o)for(var c=t[o],l=n[o],u=c.length,h=a[o]=new Array(u),d,f=0;f<u;++f)(d=c[f]||l[f])&&(h[f]=d);for(;o<i;++o)a[o]=t[o];return new Fe(a,this._parents,this._name,this._id)}function E1(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function _1(e,t,n){var i,r,s=E1(t)?io:Le;return function(){var a=s(this,e),o=a.on;o!==i&&(r=(i=o).copy()).on(t,n),a.on=r}}function S1(e,t){var n=this._id;return arguments.length<2?we(this.node(),n).on.on(e):this.each(_1(n,e,t))}function O1(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function T1(){return this.on("end.remove",O1(this._id))}function M1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Va(e));for(var i=this._groups,r=i.length,s=new Array(r),a=0;a<r;++a)for(var o=i[a],c=o.length,l=s[a]=new Array(c),u,h,d=0;d<c;++d)(u=o[d])&&(h=e.call(u,u.__data__,d,o))&&("__data__"in u&&(h.__data__=u.__data__),l[d]=h,rs(l[d],t,n,d,l,we(u,n)));return new Fe(s,this._parents,t,n)}function C1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Vc(e));for(var i=this._groups,r=i.length,s=[],a=[],o=0;o<r;++o)for(var c=i[o],l=c.length,u,h=0;h<l;++h)if(u=c[h]){for(var d=e.call(u,u.__data__,h,c),f,p=we(u,n),m=0,g=d.length;m<g;++m)(f=d[m])&&rs(f,t,n,m,d,p);s.push(d),a.push(u)}return new Fe(s,a,t,n)}var A1=Di.prototype.constructor;function $1(){return new A1(this._groups,this._parents)}function L1(e,t){var n,i,r;return function(){var s=Wn(this,e),a=(this.style.removeProperty(e),Wn(this,e));return s===a?null:s===n&&a===i?r:r=t(n=s,i=a)}}function _u(e){return function(){this.style.removeProperty(e)}}function D1(e,t,n){var i,r=n+"",s;return function(){var a=Wn(this,e);return a===r?null:a===i?s:s=t(i=a,n)}}function k1(e,t,n){var i,r,s;return function(){var a=Wn(this,e),o=n(this),c=o+"";return o==null&&(c=o=(this.style.removeProperty(e),Wn(this,e))),a===c?null:a===i&&c===r?s:(r=c,s=t(i=a,o))}}function R1(e,t){var n,i,r,s="style."+t,a="end."+s,o;return function(){var c=Le(this,e),l=c.on,u=c.value[s]==null?o||(o=_u(t)):void 0;(l!==n||r!==u)&&(i=(n=l).copy()).on(a,r=u),c.on=i}}function I1(e,t,n){var i=(e+="")=="transform"?Uy:Eu;return t==null?this.styleTween(e,L1(e,i)).on("end.style."+e,_u(e)):typeof t=="function"?this.styleTween(e,k1(e,i,so(this,"style."+e,t))).each(R1(this._id,e)):this.styleTween(e,D1(e,i,t),n).on("end.style."+e,null)}function P1(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function N1(e,t,n){var i,r;function s(){var a=t.apply(this,arguments);return a!==r&&(i=(r=a)&&P1(e,a,n)),i}return s._value=t,s}function U1(e,t,n){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,N1(e,t,n??""))}function B1(e){return function(){this.textContent=e}}function H1(e){return function(){var t=e(this);this.textContent=t??""}}function V1(e){return this.tween("text",typeof e=="function"?H1(so(this,"text",e)):B1(e==null?"":e+""))}function G1(e){return function(t){this.textContent=e.call(this,t)}}function F1(e){var t,n;function i(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&G1(r)),t}return i._value=e,i}function z1(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,F1(e))}function j1(){for(var e=this._name,t=this._id,n=Su(),i=this._groups,r=i.length,s=0;s<r;++s)for(var a=i[s],o=a.length,c,l=0;l<o;++l)if(c=a[l]){var u=we(c,t);rs(c,e,n,l,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Fe(i,this._parents,e,n)}function W1(){var e,t,n=this,i=n._id,r=n.size();return new Promise(function(s,a){var o={value:a},c={value:function(){--r===0&&s()}};n.each(function(){var l=Le(this,i),u=l.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(c)),l.on=t}),r===0&&s()})}var q1=0;function Fe(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function Su(){return++q1}var ze=Di.prototype;Fe.prototype={constructor:Fe,select:M1,selectAll:C1,selectChild:ze.selectChild,selectChildren:ze.selectChildren,filter:b1,merge:w1,selection:$1,transition:j1,call:ze.call,nodes:ze.nodes,node:ze.node,size:ze.size,empty:ze.empty,each:ze.each,on:S1,attr:r1,attrTween:c1,style:I1,styleTween:U1,text:V1,textTween:z1,remove:T1,tween:Ky,delay:d1,duration:g1,ease:v1,easeVarying:x1,end:W1,[Symbol.iterator]:ze[Symbol.iterator]};const Y1=e=>+e;function Ou(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var X1={time:null,delay:0,duration:250,ease:Ou};function Z1(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function K1(e){var t,n;e instanceof Fe?(t=e._id,e=e._name):(t=Su(),(n=X1).time=Ja(),e=e==null?null:e+"");for(var i=this._groups,r=i.length,s=0;s<r;++s)for(var a=i[s],o=a.length,c,l=0;l<o;++l)(c=a[l])&&rs(c,e,t,l,a,n||Z1(c,t));return new Fe(i,this._parents,e,t)}Di.prototype.interrupt=Yy,Di.prototype.transition=K1;const ao=e=>()=>e;function Q1(e,{sourceEvent:t,target:n,selection:i,mode:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:i,enumerable:!0,configurable:!0},mode:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function J1(e){e.stopImmediatePropagation()}function oo(e){e.preventDefault(),e.stopImmediatePropagation()}var Tu={name:"drag"},lo={name:"space"},Xn={name:"handle"},Zn={name:"center"};const{abs:Mu,max:Wt,min:qt}=Math;function Cu(e){return[+e[0],+e[1]]}function Au(e){return[Cu(e[0]),Cu(e[1])]}var ss={name:"x",handles:["w","e"].map(as),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},co={name:"y",handles:["n","s"].map(as),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},je={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},$u={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Lu={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},tx={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},ex={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function as(e){return{type:e}}function nx(e){return!e.ctrlKey&&!e.button}function ix(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function rx(){return navigator.maxTouchPoints||"ontouchstart"in this}function uo(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function sx(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function Du(){return ax(ss)}function ax(e){var t=ix,n=nx,i=rx,r=!0,s=Ba("start","brush","end"),a=6,o;function c(g){var v=g.property("__brush",m).selectAll(".overlay").data([as("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",je.overlay).merge(v).each(function(){var w=uo(this).extent;P(this).attr("x",w[0][0]).attr("y",w[0][1]).attr("width",w[1][0]-w[0][0]).attr("height",w[1][1]-w[0][1])}),g.selectAll(".selection").data([as("selection")]).enter().append("rect").attr("class","selection").attr("cursor",je.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var b=g.selectAll(".handle").data(e.handles,function(w){return w.type});b.exit().remove(),b.enter().append("rect").attr("class",function(w){return"handle handle--"+w.type}).attr("cursor",function(w){return je[w.type]}),g.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(i).on("touchstart.brush",d).on("touchmove.brush",f).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}c.move=function(g,v,b){g.tween?g.on("start.brush",function(w){u(this,arguments).beforestart().start(w)}).on("interrupt.brush end.brush",function(w){u(this,arguments).end(w)}).tween("brush",function(){var w=this,O=w.__brush,_=u(w,arguments),T=O.selection,S=e.input(typeof v=="function"?v.apply(this,arguments):v,O.extent),$=Pi(T,S);function D(L){O.selection=L===1&&S===null?null:$(L),l.call(w),_.brush()}return T!==null&&S!==null?D:D(1)}):g.each(function(){var w=this,O=arguments,_=w.__brush,T=e.input(typeof v=="function"?v.apply(w,O):v,_.extent),S=u(w,O).beforestart();ro(w),_.selection=T===null?null:T,l.call(w),S.start(b).brush(b).end(b)})},c.clear=function(g,v){c.move(g,null,v)};function l(){var g=P(this),v=uo(this).selection;v?(g.selectAll(".selection").style("display",null).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1]),g.selectAll(".handle").style("display",null).attr("x",function(b){return b.type[b.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(b){return b.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(b){return b.type==="n"||b.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(b){return b.type==="e"||b.type==="w"?v[1][1]-v[0][1]+a:a})):g.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(g,v,b){var w=g.__brush.emitter;return w&&(!b||!w.clean)?w:new h(g,v,b)}function h(g,v,b){this.that=g,this.args=v,this.state=g.__brush,this.active=0,this.clean=b}h.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(g,v){return this.starting?(this.starting=!1,this.emit("start",g,v)):this.emit("brush",g),this},brush:function(g,v){return this.emit("brush",g,v),this},end:function(g,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",g,v)),this},emit:function(g,v,b){var w=P(this.that).datum();s.call(g,this.that,new Q1(g,{sourceEvent:v,target:c,selection:e.output(this.state.selection),mode:b,dispatch:s}),w)}};function d(g){if(o&&!g.touches||!n.apply(this,arguments))return;var v=this,b=g.target.__data__.type,w=(r&&g.metaKey?b="overlay":b)==="selection"?Tu:r&&g.altKey?Zn:Xn,O=e===co?null:tx[b],_=e===ss?null:ex[b],T=uo(v),S=T.extent,$=T.selection,D=S[0][0],L,M,B=S[0][1],x,A,y=S[1][0],k,R,U=S[1][1],N,F,z=0,G=0,Q,j=O&&_&&r&&g.shiftKey,X,ot,tt=Array.from(g.touches||[g],et=>{const At=et.identifier;return et=wn(et,v),et.point0=et.slice(),et.identifier=At,et});ro(v);var lt=u(v,arguments,!0).beforestart();if(b==="overlay"){$&&(Q=!0);const et=[tt[0],tt[1]||tt[0]];T.selection=$=[[L=e===co?D:qt(et[0][0],et[1][0]),x=e===ss?B:qt(et[0][1],et[1][1])],[k=e===co?y:Wt(et[0][0],et[1][0]),N=e===ss?U:Wt(et[0][1],et[1][1])]],tt.length>1&&xt(g)}else L=$[0][0],x=$[0][1],k=$[1][0],N=$[1][1];M=L,A=x,R=k,F=N;var W=P(v).attr("pointer-events","none"),q=W.selectAll(".overlay").attr("cursor",je[b]);if(g.touches)lt.moved=V,lt.ended=pt;else{var Y=P(g.view).on("mousemove.brush",V,!0).on("mouseup.brush",pt,!0);r&&Y.on("keydown.brush",Gt,!0).on("keyup.brush",jt,!0),fy(g.view)}l.call(v),lt.start(g,w.name);function V(et){for(const At of et.changedTouches||[et])for(const zn of tt)zn.identifier===At.identifier&&(zn.cur=wn(At,v));if(j&&!X&&!ot&&tt.length===1){const At=tt[0];Mu(At.cur[0]-At[0])>Mu(At.cur[1]-At[1])?ot=!0:X=!0}for(const At of tt)At.cur&&(At[0]=At.cur[0],At[1]=At.cur[1]);Q=!0,oo(et),xt(et)}function xt(et){const At=tt[0],zn=At.point0;var Ve;switch(z=At[0]-zn[0],G=At[1]-zn[1],w){case lo:case Tu:{O&&(z=Wt(D-L,qt(y-k,z)),M=L+z,R=k+z),_&&(G=Wt(B-x,qt(U-N,G)),A=x+G,F=N+G);break}case Xn:{tt[1]?(O&&(M=Wt(D,qt(y,tt[0][0])),R=Wt(D,qt(y,tt[1][0])),O=1),_&&(A=Wt(B,qt(U,tt[0][1])),F=Wt(B,qt(U,tt[1][1])),_=1)):(O<0?(z=Wt(D-L,qt(y-L,z)),M=L+z,R=k):O>0&&(z=Wt(D-k,qt(y-k,z)),M=L,R=k+z),_<0?(G=Wt(B-x,qt(U-x,G)),A=x+G,F=N):_>0&&(G=Wt(B-N,qt(U-N,G)),A=x,F=N+G));break}case Zn:{O&&(M=Wt(D,qt(y,L-z*O)),R=Wt(D,qt(y,k+z*O))),_&&(A=Wt(B,qt(U,x-G*_)),F=Wt(B,qt(U,N+G*_)));break}}R<M&&(O*=-1,Ve=L,L=k,k=Ve,Ve=M,M=R,R=Ve,b in $u&&q.attr("cursor",je[b=$u[b]])),F<A&&(_*=-1,Ve=x,x=N,N=Ve,Ve=A,A=F,F=Ve,b in Lu&&q.attr("cursor",je[b=Lu[b]])),T.selection&&($=T.selection),X&&(M=$[0][0],R=$[1][0]),ot&&(A=$[0][1],F=$[1][1]),($[0][0]!==M||$[0][1]!==A||$[1][0]!==R||$[1][1]!==F)&&(T.selection=[[M,A],[R,F]],l.call(v),lt.brush(et,w.name))}function pt(et){if(J1(et),et.touches){if(et.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else py(et.view,Q),Y.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);W.attr("pointer-events","all"),q.attr("cursor",je.overlay),T.selection&&($=T.selection),sx($)&&(T.selection=null,l.call(v)),lt.end(et,w.name)}function Gt(et){switch(et.keyCode){case 16:{j=O&&_;break}case 18:{w===Xn&&(O&&(k=R-z*O,L=M+z*O),_&&(N=F-G*_,x=A+G*_),w=Zn,xt(et));break}case 32:{(w===Xn||w===Zn)&&(O<0?k=R-z:O>0&&(L=M-z),_<0?N=F-G:_>0&&(x=A-G),w=lo,q.attr("cursor",je.selection),xt(et));break}default:return}oo(et)}function jt(et){switch(et.keyCode){case 16:{j&&(X=ot=j=!1,xt(et));break}case 18:{w===Zn&&(O<0?k=R:O>0&&(L=M),_<0?N=F:_>0&&(x=A),w=Xn,xt(et));break}case 32:{w===lo&&(et.altKey?(O&&(k=R-z*O,L=M+z*O),_&&(N=F-G*_,x=A+G*_),w=Zn):(O<0?k=R:O>0&&(L=M),_<0?N=F:_>0&&(x=A),w=Xn),q.attr("cursor",je[b]),xt(et));break}default:return}oo(et)}}function f(g){u(this,arguments).moved(g)}function p(g){u(this,arguments).ended(g)}function m(){var g=this.__brush||{selection:null};return g.extent=Au(t.apply(this,arguments)),g.dim=e,g}return c.extent=function(g){return arguments.length?(t=typeof g=="function"?g:ao(Au(g)),c):t},c.filter=function(g){return arguments.length?(n=typeof g=="function"?g:ao(!!g),c):n},c.touchable=function(g){return arguments.length?(i=typeof g=="function"?g:ao(!!g),c):i},c.handleSize=function(g){return arguments.length?(a=+g,c):a},c.keyModifiers=function(g){return arguments.length?(r=!!g,c):r},c.on=function(){var g=s.on.apply(s,arguments);return g===s?c:g},c}const ho=Math.PI,fo=2*ho,On=1e-6,ox=fo-On;function ku(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function lx(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return ku;const n=10**t;return function(i){this._+=i[0];for(let r=1,s=i.length;r<s;++r)this._+=Math.round(arguments[r]*n)/n+i[r]}}let cx=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?ku:lx(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,i,r){this._append`Q${+t},${+n},${this._x1=+i},${this._y1=+r}`}bezierCurveTo(t,n,i,r,s,a){this._append`C${+t},${+n},${+i},${+r},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,i,r,s){if(t=+t,n=+n,i=+i,r=+r,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,c=i-t,l=r-n,u=a-t,h=o-n,d=u*u+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>On)if(!(Math.abs(h*c-l*u)>On)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=i-a,p=r-o,m=c*c+l*l,g=f*f+p*p,v=Math.sqrt(m),b=Math.sqrt(d),w=s*Math.tan((ho-Math.acos((m+d-g)/(2*v*b)))/2),O=w/b,_=w/v;Math.abs(O-1)>On&&this._append`L${t+O*u},${n+O*h}`,this._append`A${s},${s},0,0,${+(h*f>u*p)},${this._x1=t+_*c},${this._y1=n+_*l}`}}arc(t,n,i,r,s,a){if(t=+t,n=+n,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let o=i*Math.cos(r),c=i*Math.sin(r),l=t+o,u=n+c,h=1^a,d=a?r-s:s-r;this._x1===null?this._append`M${l},${u}`:(Math.abs(this._x1-l)>On||Math.abs(this._y1-u)>On)&&this._append`L${l},${u}`,i&&(d<0&&(d=d%fo+fo),d>ox?this._append`A${i},${i},0,1,${h},${t-o},${n-c}A${i},${i},0,1,${h},${this._x1=l},${this._y1=u}`:d>On&&this._append`A${i},${i},0,${+(d>=ho)},${h},${this._x1=t+i*Math.cos(s)},${this._y1=n+i*Math.sin(s)}`)}rect(t,n,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function ux(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function os(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function Kn(e){return e=os(Math.abs(e)),e?e[1]:NaN}function hx(e,t){return function(n,i){for(var r=n.length,s=[],a=0,o=e[0],c=0;r>0&&o>0&&(c+o+1>i&&(o=Math.max(1,i-c)),s.push(n.substring(r-=o,r+o)),!((c+=o+1)>i));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function dx(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var fx=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Vi(e){if(!(t=fx.exec(e)))throw new Error("invalid format: "+e);var t;return new po({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Vi.prototype=po.prototype;function po(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}po.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 px(e){t:for(var t=e.length,n=1,i=-1,r;n<t;++n)switch(e[n]){case".":i=r=n;break;case"0":i===0&&(i=n),r=n;break;default:if(!+e[n])break t;i>0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(r+1):e}var Ru;function gx(e,t){var n=os(e,t);if(!n)return e+"";var i=n[0],r=n[1],s=r-(Ru=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,a=i.length;return s===a?i:s>a?i+new Array(s-a+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+os(e,Math.max(0,t+s-1))[0]}function Iu(e,t){var n=os(e,t);if(!n)return e+"";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 Pu={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:ux,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Iu(e*100,t),r:Iu,s:gx,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Nu(e){return e}var Uu=Array.prototype.map,Bu=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function mx(e){var t=e.grouping===void 0||e.thousands===void 0?Nu:hx(Uu.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?Nu:dx(Uu.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function l(h){h=Vi(h);var d=h.fill,f=h.align,p=h.sign,m=h.symbol,g=h.zero,v=h.width,b=h.comma,w=h.precision,O=h.trim,_=h.type;_==="n"?(b=!0,_="g"):Pu[_]||(w===void 0&&(w=12),O=!0,_="g"),(g||d==="0"&&f==="=")&&(g=!0,d="0",f="=");var T=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",S=m==="$"?i:/[%p]/.test(_)?a:"",$=Pu[_],D=/[defgprs%]/.test(_);w=w===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function L(M){var B=T,x=S,A,y,k;if(_==="c")x=$(M)+x,M="";else{M=+M;var R=M<0||1/M<0;if(M=isNaN(M)?c:$(Math.abs(M),w),O&&(M=px(M)),R&&+M==0&&p!=="+"&&(R=!1),B=(R?p==="("?p:o:p==="-"||p==="("?"":p)+B,x=(_==="s"?Bu[8+Ru/3]:"")+x+(R&&p==="("?")":""),D){for(A=-1,y=M.length;++A<y;)if(k=M.charCodeAt(A),48>k||k>57){x=(k===46?r+M.slice(A+1):M.slice(A))+x,M=M.slice(0,A);break}}}b&&!g&&(M=t(M,1/0));var U=B.length+M.length+x.length,N=U<v?new Array(v-U+1).join(d):"";switch(b&&g&&(M=t(N+M,N.length?v-x.length:1/0),N=""),f){case"<":M=B+M+x+N;break;case"=":M=B+N+M+x;break;case"^":M=N.slice(0,U=N.length>>1)+B+M+x+N.slice(U);break;default:M=N+B+M+x;break}return s(M)}return L.toString=function(){return h+""},L}function u(h,d){var f=l((h=Vi(h),h.type="f",h)),p=Math.max(-8,Math.min(8,Math.floor(Kn(d)/3)))*3,m=Math.pow(10,-p),g=Bu[8+p/3];return function(v){return f(m*v)+g}}return{format:l,formatPrefix:u}}var ls,go,Hu;vx({thousands:",",grouping:[3],currency:["$",""]});function vx(e){return ls=mx(e),go=ls.format,Hu=ls.formatPrefix,ls}function yx(e){return Math.max(0,-Kn(Math.abs(e)))}function xx(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Kn(t)/3)))*3-Kn(Math.abs(e)))}function bx(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Kn(t)-Kn(e))+1}var mt=1e-6,Vu=1e-12,ut=Math.PI,ne=ut/2,Gu=ut/4,ce=ut*2,Kt=180/ut,Dt=ut/180,vt=Math.abs,Fu=Math.atan,Tn=Math.atan2,bt=Math.cos,wx=Math.exp,Ex=Math.log,gt=Math.sin,cn=Math.sign||function(e){return e>0?1:e<0?-1:0},Ee=Math.sqrt,_x=Math.tan;function Sx(e){return e>1?0:e<-1?ut:Math.acos(e)}function We(e){return e>1?ne:e<-1?-ne:Math.asin(e)}function de(){}function cs(e,t){e&&ju.hasOwnProperty(e.type)&&ju[e.type](e,t)}var zu={Feature:function(e,t){cs(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)cs(n[i].geometry,t)}},ju={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){mo(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)mo(n[i],t,0)},Polygon:function(e,t){Wu(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)Wu(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)cs(n[i],t)}};function mo(e,t,n){var i=-1,r=e.length-n,s;for(t.lineStart();++i<r;)s=e[i],t.point(s[0],s[1],s[2]);t.lineEnd()}function Wu(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)mo(e[n],t,1);t.polygonEnd()}function Qn(e,t){e&&zu.hasOwnProperty(e.type)?zu[e.type](e,t):cs(e,t)}function vo(e){return[Tn(e[1],e[0]),We(e[2])]}function Jn(e){var t=e[0],n=e[1],i=bt(n);return[i*bt(t),i*gt(t),gt(n)]}function us(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function hs(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function yo(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function ds(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function xo(e){var t=Ee(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function bo(e,t){function n(i,r){return i=e(i,r),t(i[0],i[1])}return e.invert&&t.invert&&(n.invert=function(i,r){return i=t.invert(i,r),i&&e.invert(i[0],i[1])}),n}function wo(e,t){return vt(e)>ut&&(e-=Math.round(e/ce)*ce),[e,t]}wo.invert=wo;function qu(e,t,n){return(e%=ce)?t||n?bo(Xu(e),Zu(t,n)):Xu(e):t||n?Zu(t,n):wo}function Yu(e){return function(t,n){return t+=e,vt(t)>ut&&(t-=Math.round(t/ce)*ce),[t,n]}}function Xu(e){var t=Yu(e);return t.invert=Yu(-e),t}function Zu(e,t){var n=bt(e),i=gt(e),r=bt(t),s=gt(t);function a(o,c){var l=bt(c),u=bt(o)*l,h=gt(o)*l,d=gt(c),f=d*n+u*i;return[Tn(h*r-f*s,u*n-d*i),We(f*r+h*s)]}return a.invert=function(o,c){var l=bt(c),u=bt(o)*l,h=gt(o)*l,d=gt(c),f=d*r-h*s;return[Tn(h*r+d*s,u*n+f*i),We(f*n-u*i)]},a}function Ox(e){e=qu(e[0]*Dt,e[1]*Dt,e.length>2?e[2]*Dt:0);function t(n){return n=e(n[0]*Dt,n[1]*Dt),n[0]*=Kt,n[1]*=Kt,n}return t.invert=function(n){return n=e.invert(n[0]*Dt,n[1]*Dt),n[0]*=Kt,n[1]*=Kt,n},t}function Tx(e,t,n,i,r,s){if(n){var a=bt(t),o=gt(t),c=i*n;r==null?(r=t+i*ce,s=t-c/2):(r=Ku(a,r),s=Ku(a,s),(i>0?r<s:r>s)&&(r+=i*ce));for(var l,u=r;i>0?u>s:u<s;u-=c)l=vo([a,-o*bt(u),-o*gt(u)]),e.point(l[0],l[1])}}function Ku(e,t){t=Jn(t),t[0]-=e,xo(t);var n=Sx(-t[1]);return((-t[2]<0?-n:n)+ce-mt)%ce}function Qu(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:de,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function fs(e,t){return vt(e[0]-t[0])<mt&&vt(e[1]-t[1])<mt}function ps(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function Ju(e,t,n,i,r){var s=[],a=[],o,c;if(e.forEach(function(p){if(!((m=p.length-1)<=0)){var m,g=p[0],v=p[m],b;if(fs(g,v)){if(!g[2]&&!v[2]){for(r.lineStart(),o=0;o<m;++o)r.point((g=p[o])[0],g[1]);r.lineEnd();return}v[0]+=2*mt}s.push(b=new ps(g,p,null,!0)),a.push(b.o=new ps(g,null,b,!1)),s.push(b=new ps(v,p,null,!1)),a.push(b.o=new ps(v,null,b,!0))}}),!!s.length){for(a.sort(t),th(s),th(a),o=0,c=a.length;o<c;++o)a[o].e=n=!n;for(var l=s[0],u,h;;){for(var d=l,f=!0;d.v;)if((d=d.n)===l)return;u=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(f)for(o=0,c=u.length;o<c;++o)r.point((h=u[o])[0],h[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(f)for(u=d.p.z,o=u.length-1;o>=0;--o)r.point((h=u[o])[0],h[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,u=d.z,f=!f}while(!d.v);r.lineEnd()}}}function th(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}function Eo(e){return vt(e[0])<=ut?e[0]:cn(e[0])*((vt(e[0])+ut)%ce-ut)}function Mx(e,t){var n=Eo(t),i=t[1],r=gt(i),s=[gt(n),-bt(n),0],a=0,o=0,c=new xn;r===1?i=ne+mt:r===-1&&(i=-ne-mt);for(var l=0,u=e.length;l<u;++l)if(d=(h=e[l]).length)for(var h,d,f=h[d-1],p=Eo(f),m=f[1]/2+Gu,g=gt(m),v=bt(m),b=0;b<d;++b,p=O,g=T,v=S,f=w){var w=h[b],O=Eo(w),_=w[1]/2+Gu,T=gt(_),S=bt(_),$=O-p,D=$>=0?1:-1,L=D*$,M=L>ut,B=g*T;if(c.add(Tn(B*D*gt(L),v*S+B*bt(L))),a+=M?$+D*ce:$,M^p>=n^O>=n){var x=hs(Jn(f),Jn(w));xo(x);var A=hs(s,x);xo(A);var y=(M^$>=0?-1:1)*We(A[2]);(i>y||i===y&&(x[0]||x[1]))&&(o+=M^$>=0?1:-1)}}return(a<-mt||a<mt&&c<-Vu)^o&1}function eh(e,t,n,i){return function(r){var s=t(r),a=Qu(),o=t(a),c=!1,l,u,h,d={point:f,lineStart:m,lineEnd:g,polygonStart:function(){d.point=v,d.lineStart=b,d.lineEnd=w,u=[],l=[]},polygonEnd:function(){d.point=f,d.lineStart=m,d.lineEnd=g,u=Ic(u);var O=Mx(l,i);u.length?(c||(r.polygonStart(),c=!0),Ju(u,Ax,O,n,r)):O&&(c||(r.polygonStart(),c=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),c&&(r.polygonEnd(),c=!1),u=l=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function f(O,_){e(O,_)&&r.point(O,_)}function p(O,_){s.point(O,_)}function m(){d.point=p,s.lineStart()}function g(){d.point=f,s.lineEnd()}function v(O,_){h.push([O,_]),o.point(O,_)}function b(){o.lineStart(),h=[]}function w(){v(h[0][0],h[0][1]),o.lineEnd();var O=o.clean(),_=a.result(),T,S=_.length,$,D,L;if(h.pop(),l.push(h),h=null,!!S){if(O&1){if(D=_[0],($=D.length-1)>0){for(c||(r.polygonStart(),c=!0),r.lineStart(),T=0;T<$;++T)r.point((L=D[T])[0],L[1]);r.lineEnd()}return}S>1&&O&2&&_.push(_.pop().concat(_.shift())),u.push(_.filter(Cx))}}return d}}function Cx(e){return e.length>1}function Ax(e,t){return((e=e.x)[0]<0?e[1]-ne-mt:ne-e[1])-((t=t.x)[0]<0?t[1]-ne-mt:ne-t[1])}const nh=eh(function(){return!0},$x,Dx,[-ut,-ne]);function $x(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(s,a){var o=s>0?ut:-ut,c=vt(s-t);vt(c-ut)<mt?(e.point(t,n=(n+a)/2>0?ne:-ne),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),r=0):i!==o&&c>=ut&&(vt(t-i)<mt&&(t-=i*mt),vt(s-o)<mt&&(s-=o*mt),n=Lx(t,n,s,a),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(o,n),r=0),e.point(t=s,n=a),i=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function Lx(e,t,n,i){var r,s,a=gt(e-n);return vt(a)>mt?Fu((gt(t)*(s=bt(i))*gt(n)-gt(i)*(r=bt(t))*gt(e))/(r*s*a)):(t+i)/2}function Dx(e,t,n,i){var r;if(e==null)r=n*ne,i.point(-ut,r),i.point(0,r),i.point(ut,r),i.point(ut,0),i.point(ut,-r),i.point(0,-r),i.point(-ut,-r),i.point(-ut,0),i.point(-ut,r);else if(vt(e[0]-t[0])>mt){var s=e[0]<t[0]?ut:-ut;r=n*s/2,i.point(-s,r),i.point(0,r),i.point(s,r)}else i.point(t[0],t[1])}function kx(e){var t=bt(e),n=6*Dt,i=t>0,r=vt(t)>mt;function s(u,h,d,f){Tx(f,e,n,d,u,h)}function a(u,h){return bt(u)*bt(h)>t}function o(u){var h,d,f,p,m;return{lineStart:function(){p=f=!1,m=1},point:function(g,v){var b=[g,v],w,O=a(g,v),_=i?O?0:l(g,v):O?l(g+(g<0?ut:-ut),v):0;if(!h&&(p=f=O)&&u.lineStart(),O!==f&&(w=c(h,b),(!w||fs(h,w)||fs(b,w))&&(b[2]=1)),O!==f)m=0,O?(u.lineStart(),w=c(b,h),u.point(w[0],w[1])):(w=c(h,b),u.point(w[0],w[1],2),u.lineEnd()),h=w;else if(r&&h&&i^O){var T;!(_&d)&&(T=c(b,h,!0))&&(m=0,i?(u.lineStart(),u.point(T[0][0],T[0][1]),u.point(T[1][0],T[1][1]),u.lineEnd()):(u.point(T[1][0],T[1][1]),u.lineEnd(),u.lineStart(),u.point(T[0][0],T[0][1],3)))}O&&(!h||!fs(h,b))&&u.point(b[0],b[1]),h=b,f=O,d=_},lineEnd:function(){f&&u.lineEnd(),h=null},clean:function(){return m|(p&&f)<<1}}}function c(u,h,d){var f=Jn(u),p=Jn(h),m=[1,0,0],g=hs(f,p),v=us(g,g),b=g[0],w=v-b*b;if(!w)return!d&&u;var O=t*v/w,_=-t*b/w,T=hs(m,g),S=ds(m,O),$=ds(g,_);yo(S,$);var D=T,L=us(S,D),M=us(D,D),B=L*L-M*(us(S,S)-1);if(!(B<0)){var x=Ee(B),A=ds(D,(-L-x)/M);if(yo(A,S),A=vo(A),!d)return A;var y=u[0],k=h[0],R=u[1],U=h[1],N;k<y&&(N=y,y=k,k=N);var F=k-y,z=vt(F-ut)<mt,G=z||F<mt;if(!z&&U<R&&(N=R,R=U,U=N),G?z?R+U>0^A[1]<(vt(A[0]-y)<mt?R:U):R<=A[1]&&A[1]<=U:F>ut^(y<=A[0]&&A[0]<=k)){var Q=ds(D,(-L+x)/M);return yo(Q,S),[A,vo(Q)]}}}function l(u,h){var d=i?e:ut-e,f=0;return u<-d?f|=1:u>d&&(f|=2),h<-d?f|=4:h>d&&(f|=8),f}return eh(a,o,s,i?[0,-e]:[-ut,e-ut])}function Rx(e,t,n,i,r,s){var a=e[0],o=e[1],c=t[0],l=t[1],u=0,h=1,d=c-a,f=l-o,p;if(p=n-a,!(!d&&p>0)){if(p/=d,d<0){if(p<u)return;p<h&&(h=p)}else if(d>0){if(p>h)return;p>u&&(u=p)}if(p=r-a,!(!d&&p<0)){if(p/=d,d<0){if(p>h)return;p>u&&(u=p)}else if(d>0){if(p<u)return;p<h&&(h=p)}if(p=i-o,!(!f&&p>0)){if(p/=f,f<0){if(p<u)return;p<h&&(h=p)}else if(f>0){if(p>h)return;p>u&&(u=p)}if(p=s-o,!(!f&&p<0)){if(p/=f,f<0){if(p>h)return;p>u&&(u=p)}else if(f>0){if(p<u)return;p<h&&(h=p)}return u>0&&(e[0]=a+u*d,e[1]=o+u*f),h<1&&(t[0]=a+h*d,t[1]=o+h*f),!0}}}}}var Gi=1e9,gs=-Gi;function Ix(e,t,n,i){function r(l,u){return e<=l&&l<=n&&t<=u&&u<=i}function s(l,u,h,d){var f=0,p=0;if(l==null||(f=a(l,h))!==(p=a(u,h))||c(l,u)<0^h>0)do d.point(f===0||f===3?e:n,f>1?i:t);while((f=(f+h+4)%4)!==p);else d.point(u[0],u[1])}function a(l,u){return vt(l[0]-e)<mt?u>0?0:3:vt(l[0]-n)<mt?u>0?2:1:vt(l[1]-t)<mt?u>0?1:0:u>0?3:2}function o(l,u){return c(l.x,u.x)}function c(l,u){var h=a(l,1),d=a(u,1);return h!==d?h-d:h===0?u[1]-l[1]:h===1?l[0]-u[0]:h===2?l[1]-u[1]:u[0]-l[0]}return function(l){var u=l,h=Qu(),d,f,p,m,g,v,b,w,O,_,T,S={point:$,lineStart:B,lineEnd:x,polygonStart:L,polygonEnd:M};function $(y,k){r(y,k)&&u.point(y,k)}function D(){for(var y=0,k=0,R=f.length;k<R;++k)for(var U=f[k],N=1,F=U.length,z=U[0],G,Q,j=z[0],X=z[1];N<F;++N)G=j,Q=X,z=U[N],j=z[0],X=z[1],Q<=i?X>i&&(j-G)*(i-Q)>(X-Q)*(e-G)&&++y:X<=i&&(j-G)*(i-Q)<(X-Q)*(e-G)&&--y;return y}function L(){u=h,d=[],f=[],T=!0}function M(){var y=D(),k=T&&y,R=(d=Ic(d)).length;(k||R)&&(l.polygonStart(),k&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),R&&Ju(d,o,y,s,l),l.polygonEnd()),u=l,d=f=p=null}function B(){S.point=A,f&&f.push(p=[]),_=!0,O=!1,b=w=NaN}function x(){d&&(A(m,g),v&&O&&h.rejoin(),d.push(h.result())),S.point=$,O&&u.lineEnd()}function A(y,k){var R=r(y,k);if(f&&p.push([y,k]),_)m=y,g=k,v=R,_=!1,R&&(u.lineStart(),u.point(y,k));else if(R&&O)u.point(y,k);else{var U=[b=Math.max(gs,Math.min(Gi,b)),w=Math.max(gs,Math.min(Gi,w))],N=[y=Math.max(gs,Math.min(Gi,y)),k=Math.max(gs,Math.min(Gi,k))];Rx(U,N,e,t,n,i)?(O||(u.lineStart(),u.point(U[0],U[1])),u.point(N[0],N[1]),R||u.lineEnd(),T=!1):R&&(u.lineStart(),u.point(y,k),T=!1)}b=y,w=k,O=R}return S}}const _o=e=>e;var So=new xn,Oo=new xn,ih,rh,To,Mo,un={point:de,lineStart:de,lineEnd:de,polygonStart:function(){un.lineStart=Px,un.lineEnd=Ux},polygonEnd:function(){un.lineStart=un.lineEnd=un.point=de,So.add(vt(Oo)),Oo=new xn},result:function(){var e=So/2;return So=new xn,e}};function Px(){un.point=Nx}function Nx(e,t){un.point=sh,ih=To=e,rh=Mo=t}function sh(e,t){Oo.add(Mo*e-To*t),To=e,Mo=t}function Ux(){sh(ih,rh)}const ah=un;var ti=1/0,ms=ti,Fi=-ti,vs=Fi,Bx={point:Hx,lineStart:de,lineEnd:de,polygonStart:de,polygonEnd:de,result:function(){var e=[[ti,ms],[Fi,vs]];return Fi=vs=-(ms=ti=1/0),e}};function Hx(e,t){e<ti&&(ti=e),e>Fi&&(Fi=e),t<ms&&(ms=t),t>vs&&(vs=t)}const ys=Bx;var Co=0,Ao=0,zi=0,xs=0,bs=0,ei=0,$o=0,Lo=0,ji=0,oh,lh,De,ke,_e={point:Mn,lineStart:ch,lineEnd:uh,polygonStart:function(){_e.lineStart=Fx,_e.lineEnd=zx},polygonEnd:function(){_e.point=Mn,_e.lineStart=ch,_e.lineEnd=uh},result:function(){var e=ji?[$o/ji,Lo/ji]:ei?[xs/ei,bs/ei]:zi?[Co/zi,Ao/zi]:[NaN,NaN];return Co=Ao=zi=xs=bs=ei=$o=Lo=ji=0,e}};function Mn(e,t){Co+=e,Ao+=t,++zi}function ch(){_e.point=Vx}function Vx(e,t){_e.point=Gx,Mn(De=e,ke=t)}function Gx(e,t){var n=e-De,i=t-ke,r=Ee(n*n+i*i);xs+=r*(De+e)/2,bs+=r*(ke+t)/2,ei+=r,Mn(De=e,ke=t)}function uh(){_e.point=Mn}function Fx(){_e.point=jx}function zx(){hh(oh,lh)}function jx(e,t){_e.point=hh,Mn(oh=De=e,lh=ke=t)}function hh(e,t){var n=e-De,i=t-ke,r=Ee(n*n+i*i);xs+=r*(De+e)/2,bs+=r*(ke+t)/2,ei+=r,r=ke*e-De*t,$o+=r*(De+e),Lo+=r*(ke+t),ji+=r*3,Mn(De=e,ke=t)}const dh=_e;function fh(e){this._context=e}fh.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,ce);break}}},result:de};var Do=new xn,ko,ph,gh,Wi,qi,ws={point:de,lineStart:function(){ws.point=Wx},lineEnd:function(){ko&&mh(ph,gh),ws.point=de},polygonStart:function(){ko=!0},polygonEnd:function(){ko=null},result:function(){var e=+Do;return Do=new xn,e}};function Wx(e,t){ws.point=mh,ph=Wi=e,gh=qi=t}function mh(e,t){Wi-=e,qi-=t,Do.add(Ee(Wi*Wi+qi*qi)),Wi=e,qi=t}const vh=ws;let yh,Es,xh,bh;class wh{constructor(t){this._append=t==null?Eh:qx(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==xh||this._append!==Es){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,xh=i,Es=this._append,bh=this._,this._=r}this._+=bh;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Eh(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function qx(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Eh;if(t!==yh){const n=10**t;yh=t,Es=function(r){let s=1;this._+=r[0];for(const a=r.length;s<a;++s)this._+=Math.round(arguments[s]*n)/n+r[s]}}return Es}function Yx(e,t){let n=3,i=4.5,r,s;function a(o){return o&&(typeof i=="function"&&s.pointRadius(+i.apply(this,arguments)),Qn(o,r(s))),s.result()}return a.area=function(o){return Qn(o,r(ah)),ah.result()},a.measure=function(o){return Qn(o,r(vh)),vh.result()},a.bounds=function(o){return Qn(o,r(ys)),ys.result()},a.centroid=function(o){return Qn(o,r(dh)),dh.result()},a.projection=function(o){return arguments.length?(r=o==null?(e=null,_o):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new wh(n)):new fh(t=o),typeof i!="function"&&s.pointRadius(i),a):t},a.pointRadius=function(o){return arguments.length?(i=typeof o=="function"?o:(s.pointRadius(+o),+o),a):i},a.digits=function(o){if(!arguments.length)return n;if(o==null)n=null;else{const c=Math.floor(o);if(!(c>=0))throw new RangeError(`invalid digits: ${o}`);n=c}return t===null&&(s=new wh(n)),a},a.projection(e).digits(n).context(t)}function Ro(e){return function(t){var n=new Io;for(var i in e)n[i]=e[i];return n.stream=t,n}}function Io(){}Io.prototype={constructor:Io,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Po(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),Qn(n,e.stream(ys)),t(ys.result()),i!=null&&e.clipExtent(i),e}function _h(e,t,n){return Po(e,function(i){var r=t[1][0]-t[0][0],s=t[1][1]-t[0][1],a=Math.min(r/(i[1][0]-i[0][0]),s/(i[1][1]-i[0][1])),o=+t[0][0]+(r-a*(i[1][0]+i[0][0]))/2,c=+t[0][1]+(s-a*(i[1][1]+i[0][1]))/2;e.scale(150*a).translate([o,c])},n)}function Xx(e,t,n){return _h(e,[[0,0],t],n)}function Zx(e,t,n){return Po(e,function(i){var r=+t,s=r/(i[1][0]-i[0][0]),a=(r-s*(i[1][0]+i[0][0]))/2,o=-s*i[0][1];e.scale(150*s).translate([a,o])},n)}function Kx(e,t,n){return Po(e,function(i){var r=+t,s=r/(i[1][1]-i[0][1]),a=-s*i[0][0],o=(r-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([a,o])},n)}var Sh=16,Qx=bt(30*Dt);function Oh(e,t){return+t?tb(e,t):Jx(e)}function Jx(e){return Ro({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function tb(e,t){function n(i,r,s,a,o,c,l,u,h,d,f,p,m,g){var v=l-i,b=u-r,w=v*v+b*b;if(w>4*t&&m--){var O=a+d,_=o+f,T=c+p,S=Ee(O*O+_*_+T*T),$=We(T/=S),D=vt(vt(T)-1)<mt||vt(s-h)<mt?(s+h)/2:Tn(_,O),L=e(D,$),M=L[0],B=L[1],x=M-i,A=B-r,y=b*x-v*A;(y*y/w>t||vt((v*x+b*A)/w-.5)>.3||a*d+o*f+c*p<Qx)&&(n(i,r,s,a,o,c,M,B,D,O/=S,_/=S,T,m,g),g.point(M,B),n(M,B,D,O,_,T,l,u,h,d,f,p,m,g))}}return function(i){var r,s,a,o,c,l,u,h,d,f,p,m,g={point:v,lineStart:b,lineEnd:O,polygonStart:function(){i.polygonStart(),g.lineStart=_},polygonEnd:function(){i.polygonEnd(),g.lineStart=b}};function v($,D){$=e($,D),i.point($[0],$[1])}function b(){h=NaN,g.point=w,i.lineStart()}function w($,D){var L=Jn([$,D]),M=e($,D);n(h,d,u,f,p,m,h=M[0],d=M[1],u=$,f=L[0],p=L[1],m=L[2],Sh,i),i.point(h,d)}function O(){g.point=v,i.lineEnd()}function _(){b(),g.point=T,g.lineEnd=S}function T($,D){w(r=$,D),s=h,a=d,o=f,c=p,l=m,g.point=w}function S(){n(h,d,u,f,p,m,s,a,r,o,c,l,Sh,i),g.lineEnd=O,O()}return g}}var eb=Ro({point:function(e,t){this.stream.point(e*Dt,t*Dt)}});function nb(e){return Ro({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function ib(e,t,n,i,r){function s(a,o){return a*=i,o*=r,[t+e*a,n-e*o]}return s.invert=function(a,o){return[(a-t)/e*i,(n-o)/e*r]},s}function Th(e,t,n,i,r,s){if(!s)return ib(e,t,n,i,r);var a=bt(s),o=gt(s),c=a*e,l=o*e,u=a/e,h=o/e,d=(o*n-a*t)/e,f=(o*t+a*n)/e;function p(m,g){return m*=i,g*=r,[c*m-l*g+t,n-l*m-c*g]}return p.invert=function(m,g){return[i*(u*m-h*g+d),r*(f-h*m-u*g)]},p}function _s(e){return Mh(function(){return e})()}function Mh(e){var t,n=150,i=480,r=250,s=0,a=0,o=0,c=0,l=0,u,h=0,d=1,f=1,p=null,m=nh,g=null,v,b,w,O=_o,_=.5,T,S,$,D,L;function M(y){return $(y[0]*Dt,y[1]*Dt)}function B(y){return y=$.invert(y[0],y[1]),y&&[y[0]*Kt,y[1]*Kt]}M.stream=function(y){return D&&L===y?D:D=eb(nb(u)(m(T(O(L=y)))))},M.preclip=function(y){return arguments.length?(m=y,p=void 0,A()):m},M.postclip=function(y){return arguments.length?(O=y,g=v=b=w=null,A()):O},M.clipAngle=function(y){return arguments.length?(m=+y?kx(p=y*Dt):(p=null,nh),A()):p*Kt},M.clipExtent=function(y){return arguments.length?(O=y==null?(g=v=b=w=null,_o):Ix(g=+y[0][0],v=+y[0][1],b=+y[1][0],w=+y[1][1]),A()):g==null?null:[[g,v],[b,w]]},M.scale=function(y){return arguments.length?(n=+y,x()):n},M.translate=function(y){return arguments.length?(i=+y[0],r=+y[1],x()):[i,r]},M.center=function(y){return arguments.length?(s=y[0]%360*Dt,a=y[1]%360*Dt,x()):[s*Kt,a*Kt]},M.rotate=function(y){return arguments.length?(o=y[0]%360*Dt,c=y[1]%360*Dt,l=y.length>2?y[2]%360*Dt:0,x()):[o*Kt,c*Kt,l*Kt]},M.angle=function(y){return arguments.length?(h=y%360*Dt,x()):h*Kt},M.reflectX=function(y){return arguments.length?(d=y?-1:1,x()):d<0},M.reflectY=function(y){return arguments.length?(f=y?-1:1,x()):f<0},M.precision=function(y){return arguments.length?(T=Oh(S,_=y*y),A()):Ee(_)},M.fitExtent=function(y,k){return _h(M,y,k)},M.fitSize=function(y,k){return Xx(M,y,k)},M.fitWidth=function(y,k){return Zx(M,y,k)},M.fitHeight=function(y,k){return Kx(M,y,k)};function x(){var y=Th(n,0,0,d,f,h).apply(null,t(s,a)),k=Th(n,i-y[0],r-y[1],d,f,h);return u=qu(o,c,l),S=bo(t,k),$=bo(u,S),T=Oh(S,_),A()}function A(){return D=L=null,M}return function(){return t=e.apply(this,arguments),M.invert=t.invert&&B,x()}}function Ch(e){var t=0,n=ut/3,i=Mh(e),r=i(t,n);return r.parallels=function(s){return arguments.length?i(t=s[0]*Dt,n=s[1]*Dt):[t*Kt,n*Kt]},r}function rb(e){var t=bt(e);function n(i,r){return[i*t,gt(r)/t]}return n.invert=function(i,r){return[i/t,We(r*t)]},n}function sb(e,t){var n=gt(e),i=(n+gt(t))/2;if(vt(i)<mt)return rb(e);var r=1+n*(2*i-n),s=Ee(r)/i;function a(o,c){var l=Ee(r-2*i*gt(c))/i;return[l*gt(o*=i),s-l*bt(o)]}return a.invert=function(o,c){var l=s-c,u=Tn(o,vt(l))*cn(l);return l*i<0&&(u-=ut*cn(o)*cn(l)),[u/i,We((r-(o*o+l*l)*i*i)/(2*i))]},a}function Ah(){return Ch(sb).scale(155.424).center([0,33.6442])}function ab(){return Ah().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function No(e,t){return[e,Ex(_x((ne+t)/2))]}No.invert=function(e,t){return[e,2*Fu(wx(t))-ne]};function ob(){return lb(No).scale(961/ce)}function lb(e){var t=_s(e),n=t.center,i=t.scale,r=t.translate,s=t.clipExtent,a=null,o,c,l;t.scale=function(h){return arguments.length?(i(h),u()):i()},t.translate=function(h){return arguments.length?(r(h),u()):r()},t.center=function(h){return arguments.length?(n(h),u()):n()},t.clipExtent=function(h){return arguments.length?(h==null?a=o=c=l=null:(a=+h[0][0],o=+h[0][1],c=+h[1][0],l=+h[1][1]),u()):a==null?null:[[a,o],[c,l]]};function u(){var h=ut*i(),d=t(Ox(t.rotate()).invert([0,0]));return s(a==null?[[d[0]-h,d[1]-h],[d[0]+h,d[1]+h]]:e===No?[[Math.max(d[0]-h,a),o],[Math.min(d[0]+h,c),l]]:[[a,Math.max(d[1]-h,o)],[c,Math.min(d[1]+h,l)]])}return u()}function Ss(e,t){return[e,t]}Ss.invert=Ss;function cb(){return _s(Ss).scale(152.63)}function ub(e,t){var n=bt(e),i=e===t?gt(e):(n-bt(t))/(t-e),r=n/i+e;if(vt(i)<mt)return Ss;function s(a,o){var c=r-o,l=i*a;return[c*gt(l),r-c*bt(l)]}return s.invert=function(a,o){var c=r-o,l=Tn(a,vt(c))*cn(c);return c*i<0&&(l-=ut*cn(a)*cn(c)),[l/i,r-cn(i)*Ee(a*a+c*c)]},s}function hb(){return Ch(ub).scale(131.154).center([0,13.9389])}var Yi=1.340264,Xi=-.081106,Zi=893e-6,Ki=.003796,Os=Ee(3)/2,db=12;function $h(e,t){var n=We(Os*gt(t)),i=n*n,r=i*i*i;return[e*bt(n)/(Os*(Yi+3*Xi*i+r*(7*Zi+9*Ki*i))),n*(Yi+Xi*i+r*(Zi+Ki*i))]}$h.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,s=0,a,o,c;s<db&&(o=n*(Yi+Xi*i+r*(Zi+Ki*i))-t,c=Yi+3*Xi*i+r*(7*Zi+9*Ki*i),n-=a=o/c,i=n*n,r=i*i*i,!(vt(a)<Vu));++s);return[Os*e*(Yi+3*Xi*i+r*(7*Zi+9*Ki*i))/bt(n),We(gt(n)/Os)]};function fb(){return _s($h).scale(177.158)}function Lh(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),t*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}Lh.invert=function(e,t){var n=t,i=25,r;do{var s=n*n,a=s*s;n-=r=(n*(1.007226+s*(.015085+a*(-.044475+.028874*s-.005916*a)))-t)/(1.007226+s*(.015085*3+a*(-.044475*7+.028874*9*s-.005916*11*a)))}while(vt(r)>mt&&--i>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function pb(){return _s(Lh).scale(175.295)}function gb(e,t){return e.parent===t.parent?1:2}function mb(e){return e.reduce(vb,0)/e.length}function vb(e,t){return e+t.x}function yb(e){return 1+e.reduce(xb,0)}function xb(e,t){return Math.max(e,t.y)}function bb(e){for(var t;t=e.children;)e=t[0];return e}function wb(e){for(var t;t=e.children;)e=t[t.length-1];return e}function Eb(){var e=gb,t=1,n=1,i=!1;function r(s){var a,o=0;s.eachAfter(function(d){var f=d.children;f?(d.x=mb(f),d.y=yb(f)):(d.x=a?o+=e(d,a):0,d.y=0,a=d)});var c=bb(s),l=wb(s),u=c.x-e(c,l)/2,h=l.x+e(l,c)/2;return s.eachAfter(i?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-u)/(h-u)*t,d.y=(1-(s.y?d.y/s.y:1))*n})}return r.separation=function(s){return arguments.length?(e=s,r):e},r.size=function(s){return arguments.length?(i=!1,t=+s[0],n=+s[1],r):i?null:[t,n]},r.nodeSize=function(s){return arguments.length?(i=!0,t=+s[0],n=+s[1],r):i?[t,n]:null},r}function _b(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function Sb(){return this.eachAfter(_b)}function Ob(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function Tb(e,t){for(var n=this,i=[n],r,s,a=-1;n=i.pop();)if(e.call(t,n,++a,this),r=n.children)for(s=r.length-1;s>=0;--s)i.push(r[s]);return this}function Mb(e,t){for(var n=this,i=[n],r=[],s,a,o,c=-1;n=i.pop();)if(r.push(n),s=n.children)for(a=0,o=s.length;a<o;++a)i.push(s[a]);for(;n=r.pop();)e.call(t,n,++c,this);return this}function Cb(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function Ab(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})}function $b(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Lb(e){for(var t=this,n=Db(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function Db(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function kb(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Rb(){return Array.from(this)}function Ib(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Pb(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Nb(){var e=this,t,n=[e],i,r,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,s=i.length;r<s;++r)n.push(i[r]);while(n.length)}function Qi(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Hb)):t===void 0&&(t=Bb);for(var n=new Ji(e),i,r=[n],s,a,o,c;i=r.pop();)if((a=t(i.data))&&(c=(a=Array.from(a)).length))for(i.children=a,o=c-1;o>=0;--o)r.push(s=a[o]=new Ji(a[o])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(Gb)}function Ub(){return Qi(this).eachBefore(Vb)}function Bb(e){return e.children}function Hb(e){return Array.isArray(e)?e[1]:null}function Vb(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Gb(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ji(e){this.data=e,this.depth=this.height=0,this.parent=null}Ji.prototype=Qi.prototype={constructor:Ji,count:Sb,each:Ob,eachAfter:Mb,eachBefore:Tb,find:Cb,sum:Ab,sort:$b,path:Lb,ancestors:kb,descendants:Rb,leaves:Ib,links:Pb,copy:Ub,[Symbol.iterator]:Nb};function Fb(e){return e==null?null:Dh(e)}function Dh(e){if(typeof e!="function")throw new Error;return e}function Cn(){return 0}function ni(e){return function(){return e}}const zb=1664525,jb=1013904223,kh=4294967296;function Wb(){let e=1;return()=>(e=(zb*e+jb)%kh)/kh}function qb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Yb(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function Xb(e,t){for(var n=0,i=(e=Yb(Array.from(e),t)).length,r=[],s,a;n<i;)s=e[n],a&&Rh(a,s)?++n:(a=Kb(r=Zb(r,s)),n=0);return a}function Zb(e,t){var n,i;if(Uo(t,e))return[t];for(n=0;n<e.length;++n)if(Ts(t,e[n])&&Uo(tr(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(Ts(tr(e[n],e[i]),t)&&Ts(tr(e[n],t),e[i])&&Ts(tr(e[i],t),e[n])&&Uo(Ih(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function Ts(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function Rh(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Uo(e,t){for(var n=0;n<t.length;++n)if(!Rh(e,t[n]))return!1;return!0}function Kb(e){switch(e.length){case 1:return Qb(e[0]);case 2:return tr(e[0],e[1]);case 3:return Ih(e[0],e[1],e[2])}}function Qb(e){return{x:e.x,y:e.y,r:e.r}}function tr(e,t){var n=e.x,i=e.y,r=e.r,s=t.x,a=t.y,o=t.r,c=s-n,l=a-i,u=o-r,h=Math.sqrt(c*c+l*l);return{x:(n+s+c/h*u)/2,y:(i+a+l/h*u)/2,r:(h+r+o)/2}}function Ih(e,t,n){var i=e.x,r=e.y,s=e.r,a=t.x,o=t.y,c=t.r,l=n.x,u=n.y,h=n.r,d=i-a,f=i-l,p=r-o,m=r-u,g=c-s,v=h-s,b=i*i+r*r-s*s,w=b-a*a-o*o+c*c,O=b-l*l-u*u+h*h,_=f*p-d*m,T=(p*O-m*w)/(_*2)-i,S=(m*g-p*v)/_,$=(f*w-d*O)/(_*2)-r,D=(d*v-f*g)/_,L=S*S+D*D-1,M=2*(s+T*S+$*D),B=T*T+$*$-s*s,x=-(Math.abs(L)>1e-6?(M+Math.sqrt(M*M-4*L*B))/(2*L):B/M);return{x:i+T+S*x,y:r+$+D*x,r:x}}function Ph(e,t,n){var i=e.x-t.x,r,s,a=e.y-t.y,o,c,l=i*i+a*a;l?(s=t.r+n.r,s*=s,c=e.r+n.r,c*=c,s>c?(r=(l+c-s)/(2*l),o=Math.sqrt(Math.max(0,c/l-r*r)),n.x=e.x-r*i-o*a,n.y=e.y-r*a+o*i):(r=(l+s-c)/(2*l),o=Math.sqrt(Math.max(0,s/l-r*r)),n.x=t.x+r*i-o*a,n.y=t.y+r*a+o*i)):(n.x=t.x+n.r,n.y=t.y)}function Nh(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Uh(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,s=(t.y*n.r+n.y*t.r)/i;return r*r+s*s}function Ms(e){this._=e,this.next=null,this.previous=null}function Jb(e,t){if(!(s=(e=qb(e)).length))return 0;var n,i,r,s,a,o,c,l,u,h,d;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(s>2))return n.r+i.r;Ph(i,n,r=e[2]),n=new Ms(n),i=new Ms(i),r=new Ms(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;t:for(c=3;c<s;++c){Ph(n._,i._,r=e[c]),r=new Ms(r),l=i.next,u=n.previous,h=i._.r,d=n._.r;do if(h<=d){if(Nh(l._,r._)){i=l,n.next=i,i.previous=n,--c;continue t}h+=l._.r,l=l.next}else{if(Nh(u._,r._)){n=u,n.next=i,i.previous=n,--c;continue t}d+=u._.r,u=u.previous}while(l!==u.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,a=Uh(n);(r=r.next)!==i;)(o=Uh(r))<a&&(n=r,a=o);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=Xb(n,t),c=0;c<s;++c)n=e[c],n.x-=r.x,n.y-=r.y;return r.r}function tw(e){return Math.sqrt(e.value)}function ew(){var e=null,t=1,n=1,i=Cn;function r(s){const a=Wb();return s.x=t/2,s.y=n/2,e?s.eachBefore(Bh(e)).eachAfter(Bo(i,.5,a)).eachBefore(Hh(1)):s.eachBefore(Bh(tw)).eachAfter(Bo(Cn,1,a)).eachAfter(Bo(i,s.r/Math.min(t,n),a)).eachBefore(Hh(Math.min(t,n)/(2*s.r))),s}return r.radius=function(s){return arguments.length?(e=Fb(s),r):e},r.size=function(s){return arguments.length?(t=+s[0],n=+s[1],r):[t,n]},r.padding=function(s){return arguments.length?(i=typeof s=="function"?s:ni(+s),r):i},r}function Bh(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Bo(e,t,n){return function(i){if(r=i.children){var r,s,a=r.length,o=e(i)*t||0,c;if(o)for(s=0;s<a;++s)r[s].r+=o;if(c=Jb(r,n),o)for(s=0;s<a;++s)r[s].r-=o;i.r=c+o}}}function Hh(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function nw(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function iw(e,t,n,i,r){for(var s=e.children,a,o=-1,c=s.length,l=e.value&&(i-t)/e.value;++o<c;)a=s[o],a.y0=n,a.y1=r,a.x0=t,a.x1=t+=a.value*l}function rw(e,t){return e.parent===t.parent?1:2}function Ho(e){var t=e.children;return t?t[0]:e.t}function Vo(e){var t=e.children;return t?t[t.length-1]:e.t}function sw(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function aw(e){for(var t=0,n=0,i=e.children,r=i.length,s;--r>=0;)s=i[r],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function ow(e,t,n){return e.a.parent===t.parent?e.a:n}function Cs(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Cs.prototype=Object.create(Ji.prototype);function lw(e){for(var t=new Cs(e,0),n,i=[t],r,s,a,o;n=i.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)i.push(r=n.children[a]=new Cs(s[a],a)),r.parent=n;return(t.parent=new Cs(null,0)).children=[t],t}function cw(){var e=rw,t=1,n=1,i=null;function r(l){var u=lw(l);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),i)l.eachBefore(c);else{var h=l,d=l,f=l;l.eachBefore(function(b){b.x<h.x&&(h=b),b.x>d.x&&(d=b),b.depth>f.depth&&(f=b)});var p=h===d?1:e(h,d)/2,m=p-h.x,g=t/(d.x+p+m),v=n/(f.depth||1);l.eachBefore(function(b){b.x=(b.x+m)*g,b.y=b.depth*v})}return l}function s(l){var u=l.children,h=l.parent.children,d=l.i?h[l.i-1]:null;if(u){aw(l);var f=(u[0].z+u[u.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-f):l.z=f}else d&&(l.z=d.z+e(l._,d._));l.parent.A=o(l,d,l.parent.A||h[0])}function a(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function o(l,u,h){if(u){for(var d=l,f=l,p=u,m=d.parent.children[0],g=d.m,v=f.m,b=p.m,w=m.m,O;p=Vo(p),d=Ho(d),p&&d;)m=Ho(m),f=Vo(f),f.a=l,O=p.z+b-d.z-g+e(p._,d._),O>0&&(sw(ow(p,l,h),l,O),g+=O,v+=O),b+=p.m,g+=d.m,w+=m.m,v+=f.m;p&&!Vo(f)&&(f.t=p,f.m+=b-v),d&&!Ho(m)&&(m.t=d,m.m+=g-w,h=l)}return h}function c(l){l.x*=t,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(e=l,r):e},r.size=function(l){return arguments.length?(i=!1,t=+l[0],n=+l[1],r):i?null:[t,n]},r.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],n=+l[1],r):i?[t,n]:null},r}function uw(e,t,n,i,r){for(var s=e.children,a,o=-1,c=s.length,l=e.value&&(r-n)/e.value;++o<c;)a=s[o],a.x0=t,a.x1=i,a.y0=n,a.y1=n+=a.value*l}var hw=(1+Math.sqrt(5))/2;function dw(e,t,n,i,r,s){for(var a=[],o=t.children,c,l,u=0,h=0,d=o.length,f,p,m=t.value,g,v,b,w,O,_,T;u<d;){f=r-n,p=s-i;do g=o[h++].value;while(!g&&h<d);for(v=b=g,_=Math.max(p/f,f/p)/(m*e),T=g*g*_,O=Math.max(b/T,T/v);h<d;++h){if(g+=l=o[h].value,l<v&&(v=l),l>b&&(b=l),T=g*g*_,w=Math.max(b/T,T/v),w>O){g-=l;break}O=w}a.push(c={value:g,dice:f<p,children:o.slice(u,h)}),c.dice?iw(c,n,i,r,m?i+=p*g/m:s):uw(c,n,i,m?n+=f*g/m:r,s),m-=g,u=h}return a}const fw=function e(t){function n(i,r,s,a,o){dw(t,i,r,s,a,o)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(hw);function pw(){var e=fw,t=!1,n=1,i=1,r=[0],s=Cn,a=Cn,o=Cn,c=Cn,l=Cn;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(h),r=[0],t&&d.eachBefore(nw),d}function h(d){var f=r[d.depth],p=d.x0+f,m=d.y0+f,g=d.x1-f,v=d.y1-f;g<p&&(p=g=(p+g)/2),v<m&&(m=v=(m+v)/2),d.x0=p,d.y0=m,d.x1=g,d.y1=v,d.children&&(f=r[d.depth+1]=s(d)/2,p+=l(d)-f,m+=a(d)-f,g-=o(d)-f,v-=c(d)-f,g<p&&(p=g=(p+g)/2),v<m&&(m=v=(m+v)/2),e(d,p,m,g,v))}return u.round=function(d){return arguments.length?(t=!!d,u):t},u.size=function(d){return arguments.length?(n=+d[0],i=+d[1],u):[n,i]},u.tile=function(d){return arguments.length?(e=Dh(d),u):e},u.padding=function(d){return arguments.length?u.paddingInner(d).paddingOuter(d):u.paddingInner()},u.paddingInner=function(d){return arguments.length?(s=typeof d=="function"?d:ni(+d),u):s},u.paddingOuter=function(d){return arguments.length?u.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):u.paddingTop()},u.paddingTop=function(d){return arguments.length?(a=typeof d=="function"?d:ni(+d),u):a},u.paddingRight=function(d){return arguments.length?(o=typeof d=="function"?d:ni(+d),u):o},u.paddingBottom=function(d){return arguments.length?(c=typeof d=="function"?d:ni(+d),u):c},u.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:ni(+d),u):l},u}function ii(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const Vh=Symbol("implicit");function As(){var e=new Lc,t=[],n=[],i=Vh;function r(s){let a=e.get(s);if(a===void 0){if(i!==Vh)return i;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return r.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new Lc;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return r},r.range=function(s){return arguments.length?(n=Array.from(s),r):n.slice()},r.unknown=function(s){return arguments.length?(i=s,r):i},r.copy=function(){return As(t,n).unknown(i)},ii.apply(r,arguments),r}function er(){var e=As().unknown(void 0),t=e.domain,n=e.range,i=0,r=1,s,a,o=!1,c=0,l=0,u=.5;delete e.unknown;function h(){var d=t().length,f=r<i,p=f?r:i,m=f?i:r;s=(m-p)/Math.max(1,d-c+l*2),o&&(s=Math.floor(s)),p+=(m-p-s*(d-c))*u,a=s*(1-c),o&&(p=Math.round(p),a=Math.round(a));var g=Ev(d).map(function(v){return p+s*v});return n(f?g.reverse():g)}return e.domain=function(d){return arguments.length?(t(d),h()):t()},e.range=function(d){return arguments.length?([i,r]=d,i=+i,r=+r,h()):[i,r]},e.rangeRound=function(d){return[i,r]=d,i=+i,r=+r,o=!0,h()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(d){return arguments.length?(o=!!d,h()):o},e.padding=function(d){return arguments.length?(c=Math.min(1,l=+d),h()):c},e.paddingInner=function(d){return arguments.length?(c=Math.min(1,d),h()):c},e.paddingOuter=function(d){return arguments.length?(l=+d,h()):l},e.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),h()):u},e.copy=function(){return er(t(),[i,r]).round(o).paddingInner(c).paddingOuter(l).align(u)},ii.apply(h(),arguments)}function gw(e){return function(){return e}}function mw(e){return+e}var Gh=[0,1];function ri(e){return e}function Go(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:gw(isNaN(t)?NaN:.5)}function vw(e,t){var n;return e>t&&(n=e,e=t,t=n),function(i){return Math.max(e,Math.min(t,i))}}function yw(e,t,n){var i=e[0],r=e[1],s=t[0],a=t[1];return r<i?(i=Go(r,i),s=n(a,s)):(i=Go(i,r),s=n(s,a)),function(o){return s(i(o))}}function xw(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),s=new Array(i),a=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<i;)r[a]=Go(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var c=ka(e,o,1,i)-1;return s[c](r[c](o))}}function Fo(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Fh(){var e=Gh,t=Gh,n=Pi,i,r,s,a=ri,o,c,l;function u(){var d=Math.min(e.length,t.length);return a!==ri&&(a=vw(e[0],e[d-1])),o=d>2?xw:yw,c=l=null,h}function h(d){return d==null||isNaN(d=+d)?s:(c||(c=o(e.map(i),t,n)))(i(a(d)))}return h.invert=function(d){return a(r((l||(l=o(t,e.map(i),le)))(d)))},h.domain=function(d){return arguments.length?(e=Array.from(d,mw),u()):e.slice()},h.range=function(d){return arguments.length?(t=Array.from(d),u()):t.slice()},h.rangeRound=function(d){return t=Array.from(d),n=uu,u()},h.clamp=function(d){return arguments.length?(a=d?!0:ri,u()):a!==ri},h.interpolate=function(d){return arguments.length?(n=d,u()):n},h.unknown=function(d){return arguments.length?(s=d,h):s},function(d,f){return i=d,r=f,u()}}function zh(){return Fh()(ri,ri)}function bw(e,t,n,i){var r=Ia(e,t,n),s;switch(i=Vi(i??",f"),i.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(s=xx(r,a))&&(i.precision=s),Hu(i,a)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(s=bx(r,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=s-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(s=yx(r))&&(i.precision=s-(i.type==="%")*2);break}}return go(i)}function jh(e){var t=e.domain;return e.ticks=function(n){var i=t();return Br(i[0],i[i.length-1],n??10)},e.tickFormat=function(n,i){var r=t();return bw(r[0],r[r.length-1],n??10,i)},e.nice=function(n){n==null&&(n=10);var i=t(),r=0,s=i.length-1,a=i[r],o=i[s],c,l,u=10;for(o<a&&(l=a,a=o,o=l,l=r,r=s,s=l);u-- >0;){if(l=jn(a,o,n),l===c)return i[r]=a,i[s]=o,t(i);if(l>0)a=Math.floor(a/l)*l,o=Math.ceil(o/l)*l;else if(l<0)a=Math.ceil(a*l)/l,o=Math.floor(o*l)/l;else break;c=l}return e},e}function Se(){var e=zh();return e.copy=function(){return Fo(e,Se())},ii.apply(e,arguments),jh(e)}function Wh(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],s=e[i],a;return s<r&&(a=n,n=i,i=a,a=r,r=s,s=a),e[n]=t.floor(r),e[i]=t.ceil(s),e}function qh(e){return Math.log(e)}function Yh(e){return Math.exp(e)}function ww(e){return-Math.log(-e)}function Ew(e){return-Math.exp(-e)}function _w(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Sw(e){return e===10?_w:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Ow(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Xh(e){return(t,n)=>-e(-t,n)}function Tw(e){const t=e(qh,Yh),n=t.domain;let i=10,r,s;function a(){return r=Ow(i),s=Sw(i),n()[0]<0?(r=Xh(r),s=Xh(s),e(ww,Ew)):e(qh,Yh),t}return t.base=function(o){return arguments.length?(i=+o,a()):i},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const c=n();let l=c[0],u=c[c.length-1];const h=u<l;h&&([l,u]=[u,l]);let d=r(l),f=r(u),p,m;const g=o==null?10:+o;let v=[];if(!(i%1)&&f-d<g){if(d=Math.floor(d),f=Math.ceil(f),l>0){for(;d<=f;++d)for(p=1;p<i;++p)if(m=d<0?p/s(-d):p*s(d),!(m<l)){if(m>u)break;v.push(m)}}else for(;d<=f;++d)for(p=i-1;p>=1;--p)if(m=d>0?p/s(-d):p*s(d),!(m<l)){if(m>u)break;v.push(m)}v.length*2<g&&(v=Br(l,u,g))}else v=Br(d,f,Math.min(f-d,g)).map(s);return h?v.reverse():v},t.tickFormat=(o,c)=>{if(o==null&&(o=10),c==null&&(c=i===10?"s":","),typeof c!="function"&&(!(i%1)&&(c=Vi(c)).precision==null&&(c.trim=!0),c=go(c)),o===1/0)return c;const l=Math.max(1,i*o/t.ticks().length);return u=>{let h=u/s(Math.round(r(u)));return h*i<i-.5&&(h*=i),h<=l?c(u):""}},t.nice=()=>n(Wh(n(),{floor:o=>s(Math.floor(r(o))),ceil:o=>s(Math.ceil(r(o)))})),t}function Zh(){const e=Tw(Fh()).domain([1,10]);return e.copy=()=>Fo(e,Zh()).base(e.base()),ii.apply(e,arguments),e}function zo(){var e=0,t=1,n=1,i=[.5],r=[0,1],s;function a(c){return c!=null&&c<=c?r[ka(i,c,0,n)]:s}function o(){var c=-1;for(i=new Array(n);++c<n;)i[c]=((c+1)*t-(c-n)*e)/(n+1);return a}return a.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,o()):[e,t]},a.range=function(c){return arguments.length?(n=(r=Array.from(c)).length-1,o()):r.slice()},a.invertExtent=function(c){var l=r.indexOf(c);return l<0?[NaN,NaN]:l<1?[e,i[0]]:l>=n?[i[n-1],t]:[i[l-1],i[l]]},a.unknown=function(c){return arguments.length&&(s=c),a},a.thresholds=function(){return i.slice()},a.copy=function(){return zo().domain([e,t]).range(r).unknown(s)},ii.apply(jh(a),arguments)}const jo=new Date,Wo=new Date;function Rt(e,t,n,i){function r(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return r.floor=s=>(e(s=new Date(+s)),s),r.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),r.round=s=>{const a=r(s),o=r.ceil(s);return s-a<o-s?a:o},r.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),r.range=(s,a,o)=>{const c=[];if(s=r.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return c;let l;do c.push(l=new Date(+s)),t(s,o),e(s);while(l<s&&s<a);return c},r.filter=s=>Rt(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),n&&(r.count=(s,a)=>(jo.setTime(+s),Wo.setTime(+a),e(jo),e(Wo),Math.floor(n(jo,Wo))),r.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?r.filter(i?a=>i(a)%s===0:a=>r.count(0,a)%s===0):r)),r}const $s=Rt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);$s.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Rt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):$s),$s.range;const qe=1e3,fe=qe*60,Ye=fe*60,Xe=Ye*24,qo=Xe*7,Kh=Xe*30,Yo=Xe*365,si=Rt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*qe)},(e,t)=>(t-e)/qe,e=>e.getUTCSeconds());si.range;const Xo=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*qe)},(e,t)=>{e.setTime(+e+t*fe)},(e,t)=>(t-e)/fe,e=>e.getMinutes());Xo.range,Rt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*fe)},(e,t)=>(t-e)/fe,e=>e.getUTCMinutes()).range;const Zo=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*qe-e.getMinutes()*fe)},(e,t)=>{e.setTime(+e+t*Ye)},(e,t)=>(t-e)/Ye,e=>e.getHours());Zo.range,Rt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ye)},(e,t)=>(t-e)/Ye,e=>e.getUTCHours()).range;const nr=Rt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*fe)/Xe,e=>e.getDate()-1);nr.range;const Ko=Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Xe,e=>e.getUTCDate()-1);Ko.range,Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Xe,e=>Math.floor(e/Xe)).range;function An(e){return Rt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*fe)/qo)}const Ls=An(0),Ds=An(1),Mw=An(2),Cw=An(3),ai=An(4),Aw=An(5),$w=An(6);Ls.range,Ds.range,Mw.range,Cw.range,ai.range,Aw.range,$w.range;function $n(e){return Rt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/qo)}const Qh=$n(0),ks=$n(1),Lw=$n(2),Dw=$n(3),oi=$n(4),kw=$n(5),Rw=$n(6);Qh.range,ks.range,Lw.range,Dw.range,oi.range,kw.range,Rw.range;const Qo=Rt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Qo.range,Rt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()).range;const Ze=Rt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Ze.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Ze.range;const Ln=Rt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ln.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Ln.range;function Iw(e,t,n,i,r,s){const a=[[si,1,qe],[si,5,5*qe],[si,15,15*qe],[si,30,30*qe],[s,1,fe],[s,5,5*fe],[s,15,15*fe],[s,30,30*fe],[r,1,Ye],[r,3,3*Ye],[r,6,6*Ye],[r,12,12*Ye],[i,1,Xe],[i,2,2*Xe],[n,1,qo],[t,1,Kh],[t,3,3*Kh],[e,1,Yo]];function o(l,u,h){const d=u<l;d&&([l,u]=[u,l]);const f=h&&typeof h.range=="function"?h:c(l,u,h),p=f?f.range(l,+u+1):[];return d?p.reverse():p}function c(l,u,h){const d=Math.abs(u-l)/h,f=Da(([,,g])=>g).right(a,d);if(f===a.length)return e.every(Ia(l/Yo,u/Yo,h));if(f===0)return $s.every(Math.max(Ia(l,u,h),1));const[p,m]=a[d/a[f-1][2]<a[f][2]/d?f-1:f];return p.every(m)}return[o,c]}const[Pw,Nw]=Iw(Ze,Qo,Ls,nr,Zo,Xo);function Jo(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function tl(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ir(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Uw(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,s=e.days,a=e.shortDays,o=e.months,c=e.shortMonths,l=rr(r),u=sr(r),h=rr(s),d=sr(s),f=rr(a),p=sr(a),m=rr(o),g=sr(o),v=rr(c),b=sr(c),w={a:R,A:U,b:N,B:F,c:null,d:rd,e:rd,f:oE,g:vE,G:xE,H:rE,I:sE,j:aE,L:sd,m:lE,M:cE,p:z,q:G,Q:hd,s:dd,S:uE,u:hE,U:dE,V:fE,w:pE,W:gE,x:null,X:null,y:mE,Y:yE,Z:bE,"%":ud},O={a:Q,A:j,b:X,B:ot,c:null,d:od,e:od,f:SE,g:RE,G:PE,H:wE,I:EE,j:_E,L:ld,m:OE,M:TE,p:tt,q:lt,Q:hd,s:dd,S:ME,u:CE,U:AE,V:$E,w:LE,W:DE,x:null,X:null,y:kE,Y:IE,Z:NE,"%":ud},_={a:L,A:M,b:B,B:x,c:A,d:nd,e:nd,f:tE,g:ed,G:td,H:id,I:id,j:Zw,L:Jw,m:Xw,M:Kw,p:D,q:Yw,Q:nE,s:iE,S:Qw,u:Fw,U:zw,V:jw,w:Gw,W:Ww,x:y,X:k,y:ed,Y:td,Z:qw,"%":eE};w.x=T(n,w),w.X=T(i,w),w.c=T(t,w),O.x=T(n,O),O.X=T(i,O),O.c=T(t,O);function T(W,q){return function(Y){var V=[],xt=-1,pt=0,Gt=W.length,jt,et,At;for(Y instanceof Date||(Y=new Date(+Y));++xt<Gt;)W.charCodeAt(xt)===37&&(V.push(W.slice(pt,xt)),(et=Jh[jt=W.charAt(++xt)])!=null?jt=W.charAt(++xt):et=jt==="e"?" ":"0",(At=q[jt])&&(jt=At(Y,et)),V.push(jt),pt=xt+1);return V.push(W.slice(pt,xt)),V.join("")}}function S(W,q){return function(Y){var V=ir(1900,void 0,1),xt=$(V,W,Y+="",0),pt,Gt;if(xt!=Y.length)return null;if("Q"in V)return new Date(V.Q);if("s"in V)return new Date(V.s*1e3+("L"in V?V.L:0));if(q&&!("Z"in V)&&(V.Z=0),"p"in V&&(V.H=V.H%12+V.p*12),V.m===void 0&&(V.m="q"in V?V.q:0),"V"in V){if(V.V<1||V.V>53)return null;"w"in V||(V.w=1),"Z"in V?(pt=tl(ir(V.y,0,1)),Gt=pt.getUTCDay(),pt=Gt>4||Gt===0?ks.ceil(pt):ks(pt),pt=Ko.offset(pt,(V.V-1)*7),V.y=pt.getUTCFullYear(),V.m=pt.getUTCMonth(),V.d=pt.getUTCDate()+(V.w+6)%7):(pt=Jo(ir(V.y,0,1)),Gt=pt.getDay(),pt=Gt>4||Gt===0?Ds.ceil(pt):Ds(pt),pt=nr.offset(pt,(V.V-1)*7),V.y=pt.getFullYear(),V.m=pt.getMonth(),V.d=pt.getDate()+(V.w+6)%7)}else("W"in V||"U"in V)&&("w"in V||(V.w="u"in V?V.u%7:"W"in V?1:0),Gt="Z"in V?tl(ir(V.y,0,1)).getUTCDay():Jo(ir(V.y,0,1)).getDay(),V.m=0,V.d="W"in V?(V.w+6)%7+V.W*7-(Gt+5)%7:V.w+V.U*7-(Gt+6)%7);return"Z"in V?(V.H+=V.Z/100|0,V.M+=V.Z%100,tl(V)):Jo(V)}}function $(W,q,Y,V){for(var xt=0,pt=q.length,Gt=Y.length,jt,et;xt<pt;){if(V>=Gt)return-1;if(jt=q.charCodeAt(xt++),jt===37){if(jt=q.charAt(xt++),et=_[jt in Jh?q.charAt(xt++):jt],!et||(V=et(W,Y,V))<0)return-1}else if(jt!=Y.charCodeAt(V++))return-1}return V}function D(W,q,Y){var V=l.exec(q.slice(Y));return V?(W.p=u.get(V[0].toLowerCase()),Y+V[0].length):-1}function L(W,q,Y){var V=f.exec(q.slice(Y));return V?(W.w=p.get(V[0].toLowerCase()),Y+V[0].length):-1}function M(W,q,Y){var V=h.exec(q.slice(Y));return V?(W.w=d.get(V[0].toLowerCase()),Y+V[0].length):-1}function B(W,q,Y){var V=v.exec(q.slice(Y));return V?(W.m=b.get(V[0].toLowerCase()),Y+V[0].length):-1}function x(W,q,Y){var V=m.exec(q.slice(Y));return V?(W.m=g.get(V[0].toLowerCase()),Y+V[0].length):-1}function A(W,q,Y){return $(W,t,q,Y)}function y(W,q,Y){return $(W,n,q,Y)}function k(W,q,Y){return $(W,i,q,Y)}function R(W){return a[W.getDay()]}function U(W){return s[W.getDay()]}function N(W){return c[W.getMonth()]}function F(W){return o[W.getMonth()]}function z(W){return r[+(W.getHours()>=12)]}function G(W){return 1+~~(W.getMonth()/3)}function Q(W){return a[W.getUTCDay()]}function j(W){return s[W.getUTCDay()]}function X(W){return c[W.getUTCMonth()]}function ot(W){return o[W.getUTCMonth()]}function tt(W){return r[+(W.getUTCHours()>=12)]}function lt(W){return 1+~~(W.getUTCMonth()/3)}return{format:function(W){var q=T(W+="",w);return q.toString=function(){return W},q},parse:function(W){var q=S(W+="",!1);return q.toString=function(){return W},q},utcFormat:function(W){var q=T(W+="",O);return q.toString=function(){return W},q},utcParse:function(W){var q=S(W+="",!0);return q.toString=function(){return W},q}}}var Jh={"-":"",_:" ",0:"0"},Bt=/^\s*\d+/,Bw=/^%/,Hw=/[\\^$*+?|[\]().{}]/g;function dt(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",s=r.length;return i+(s<n?new Array(n-s+1).join(t)+r:r)}function Vw(e){return e.replace(Hw,"\\$&")}function rr(e){return new RegExp("^(?:"+e.map(Vw).join("|")+")","i")}function sr(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Gw(e,t,n){var i=Bt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function Fw(e,t,n){var i=Bt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function zw(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function jw(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function Ww(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function td(e,t,n){var i=Bt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function ed(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function qw(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Yw(e,t,n){var i=Bt.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function Xw(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function nd(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function Zw(e,t,n){var i=Bt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function id(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Kw(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Qw(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function Jw(e,t,n){var i=Bt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function tE(e,t,n){var i=Bt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function eE(e,t,n){var i=Bw.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function nE(e,t,n){var i=Bt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function iE(e,t,n){var i=Bt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function rd(e,t){return dt(e.getDate(),t,2)}function rE(e,t){return dt(e.getHours(),t,2)}function sE(e,t){return dt(e.getHours()%12||12,t,2)}function aE(e,t){return dt(1+nr.count(Ze(e),e),t,3)}function sd(e,t){return dt(e.getMilliseconds(),t,3)}function oE(e,t){return sd(e,t)+"000"}function lE(e,t){return dt(e.getMonth()+1,t,2)}function cE(e,t){return dt(e.getMinutes(),t,2)}function uE(e,t){return dt(e.getSeconds(),t,2)}function hE(e){var t=e.getDay();return t===0?7:t}function dE(e,t){return dt(Ls.count(Ze(e)-1,e),t,2)}function ad(e){var t=e.getDay();return t>=4||t===0?ai(e):ai.ceil(e)}function fE(e,t){return e=ad(e),dt(ai.count(Ze(e),e)+(Ze(e).getDay()===4),t,2)}function pE(e){return e.getDay()}function gE(e,t){return dt(Ds.count(Ze(e)-1,e),t,2)}function mE(e,t){return dt(e.getFullYear()%100,t,2)}function vE(e,t){return e=ad(e),dt(e.getFullYear()%100,t,2)}function yE(e,t){return dt(e.getFullYear()%1e4,t,4)}function xE(e,t){var n=e.getDay();return e=n>=4||n===0?ai(e):ai.ceil(e),dt(e.getFullYear()%1e4,t,4)}function bE(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+dt(t/60|0,"0",2)+dt(t%60,"0",2)}function od(e,t){return dt(e.getUTCDate(),t,2)}function wE(e,t){return dt(e.getUTCHours(),t,2)}function EE(e,t){return dt(e.getUTCHours()%12||12,t,2)}function _E(e,t){return dt(1+Ko.count(Ln(e),e),t,3)}function ld(e,t){return dt(e.getUTCMilliseconds(),t,3)}function SE(e,t){return ld(e,t)+"000"}function OE(e,t){return dt(e.getUTCMonth()+1,t,2)}function TE(e,t){return dt(e.getUTCMinutes(),t,2)}function ME(e,t){return dt(e.getUTCSeconds(),t,2)}function CE(e){var t=e.getUTCDay();return t===0?7:t}function AE(e,t){return dt(Qh.count(Ln(e)-1,e),t,2)}function cd(e){var t=e.getUTCDay();return t>=4||t===0?oi(e):oi.ceil(e)}function $E(e,t){return e=cd(e),dt(oi.count(Ln(e),e)+(Ln(e).getUTCDay()===4),t,2)}function LE(e){return e.getUTCDay()}function DE(e,t){return dt(ks.count(Ln(e)-1,e),t,2)}function kE(e,t){return dt(e.getUTCFullYear()%100,t,2)}function RE(e,t){return e=cd(e),dt(e.getUTCFullYear()%100,t,2)}function IE(e,t){return dt(e.getUTCFullYear()%1e4,t,4)}function PE(e,t){var n=e.getUTCDay();return e=n>=4||n===0?oi(e):oi.ceil(e),dt(e.getUTCFullYear()%1e4,t,4)}function NE(){return"+0000"}function ud(){return"%"}function hd(e){return+e}function dd(e){return Math.floor(+e/1e3)}var li,fd;UE({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function UE(e){return li=Uw(e),fd=li.format,li.parse,li.utcFormat,li.utcParse,li}function BE(e){return new Date(e)}function HE(e){return e instanceof Date?+e:+new Date(+e)}function pd(e,t,n,i,r,s,a,o,c,l){var u=zh(),h=u.invert,d=u.domain,f=l(".%L"),p=l(":%S"),m=l("%I:%M"),g=l("%I %p"),v=l("%a %d"),b=l("%b %d"),w=l("%B"),O=l("%Y");function _(T){return(c(T)<T?f:o(T)<T?p:a(T)<T?m:s(T)<T?g:i(T)<T?r(T)<T?v:b:n(T)<T?w:O)(T)}return u.invert=function(T){return new Date(h(T))},u.domain=function(T){return arguments.length?d(Array.from(T,HE)):d().map(BE)},u.ticks=function(T){var S=d();return e(S[0],S[S.length-1],T??10)},u.tickFormat=function(T,S){return S==null?_:l(S)},u.nice=function(T){var S=d();return(!T||typeof T.range!="function")&&(T=t(S[0],S[S.length-1],T??10)),T?d(Wh(S,T)):u},u.copy=function(){return Fo(u,pd(e,t,n,i,r,s,a,o,c,l))},u}function gd(){return ii.apply(pd(Pw,Nw,Ze,Qo,Ls,nr,Zo,Xo,si,fd).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ct(e){return function(){return e}}const md=Math.abs,Yt=Math.atan2,Dn=Math.cos,VE=Math.max,el=Math.min,Re=Math.sin,ci=Math.sqrt,Xt=1e-12,ar=Math.PI,Rs=ar/2,Is=2*ar;function GE(e){return e>1?0:e<-1?ar:Math.acos(e)}function vd(e){return e>=1?Rs:e<=-1?-Rs:Math.asin(e)}function Ps(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new cx(t)}function FE(e){return e.innerRadius}function zE(e){return e.outerRadius}function jE(e){return e.startAngle}function WE(e){return e.endAngle}function qE(e){return e&&e.padAngle}function YE(e,t,n,i,r,s,a,o){var c=n-e,l=i-t,u=a-r,h=o-s,d=h*c-u*l;if(!(d*d<Xt))return d=(u*(t-s)-h*(e-r))/d,[e+d*c,t+d*l]}function Ns(e,t,n,i,r,s,a){var o=e-n,c=t-i,l=(a?s:-s)/ci(o*o+c*c),u=l*c,h=-l*o,d=e+u,f=t+h,p=n+u,m=i+h,g=(d+p)/2,v=(f+m)/2,b=p-d,w=m-f,O=b*b+w*w,_=r-s,T=d*m-p*f,S=(w<0?-1:1)*ci(VE(0,_*_*O-T*T)),$=(T*w-b*S)/O,D=(-T*b-w*S)/O,L=(T*w+b*S)/O,M=(-T*b+w*S)/O,B=$-g,x=D-v,A=L-g,y=M-v;return B*B+x*x>A*A+y*y&&($=L,D=M),{cx:$,cy:D,x01:-u,y01:-h,x11:$*(r/_-1),y11:D*(r/_-1)}}function or(){var e=FE,t=zE,n=ct(0),i=null,r=jE,s=WE,a=qE,o=null,c=Ps(l);function l(){var u,h,d=+e.apply(this,arguments),f=+t.apply(this,arguments),p=r.apply(this,arguments)-Rs,m=s.apply(this,arguments)-Rs,g=md(m-p),v=m>p;if(o||(o=u=c()),f<d&&(h=f,f=d,d=h),!(f>Xt))o.moveTo(0,0);else if(g>Is-Xt)o.moveTo(f*Dn(p),f*Re(p)),o.arc(0,0,f,p,m,!v),d>Xt&&(o.moveTo(d*Dn(m),d*Re(m)),o.arc(0,0,d,m,p,v));else{var b=p,w=m,O=p,_=m,T=g,S=g,$=a.apply(this,arguments)/2,D=$>Xt&&(i?+i.apply(this,arguments):ci(d*d+f*f)),L=el(md(f-d)/2,+n.apply(this,arguments)),M=L,B=L,x,A;if(D>Xt){var y=vd(D/d*Re($)),k=vd(D/f*Re($));(T-=y*2)>Xt?(y*=v?1:-1,O+=y,_-=y):(T=0,O=_=(p+m)/2),(S-=k*2)>Xt?(k*=v?1:-1,b+=k,w-=k):(S=0,b=w=(p+m)/2)}var R=f*Dn(b),U=f*Re(b),N=d*Dn(_),F=d*Re(_);if(L>Xt){var z=f*Dn(w),G=f*Re(w),Q=d*Dn(O),j=d*Re(O),X;if(g<ar)if(X=YE(R,U,Q,j,z,G,N,F)){var ot=R-X[0],tt=U-X[1],lt=z-X[0],W=G-X[1],q=1/Re(GE((ot*lt+tt*W)/(ci(ot*ot+tt*tt)*ci(lt*lt+W*W)))/2),Y=ci(X[0]*X[0]+X[1]*X[1]);M=el(L,(d-Y)/(q-1)),B=el(L,(f-Y)/(q+1))}else M=B=0}S>Xt?B>Xt?(x=Ns(Q,j,R,U,f,B,v),A=Ns(z,G,N,F,f,B,v),o.moveTo(x.cx+x.x01,x.cy+x.y01),B<L?o.arc(x.cx,x.cy,B,Yt(x.y01,x.x01),Yt(A.y01,A.x01),!v):(o.arc(x.cx,x.cy,B,Yt(x.y01,x.x01),Yt(x.y11,x.x11),!v),o.arc(0,0,f,Yt(x.cy+x.y11,x.cx+x.x11),Yt(A.cy+A.y11,A.cx+A.x11),!v),o.arc(A.cx,A.cy,B,Yt(A.y11,A.x11),Yt(A.y01,A.x01),!v))):(o.moveTo(R,U),o.arc(0,0,f,b,w,!v)):o.moveTo(R,U),!(d>Xt)||!(T>Xt)?o.lineTo(N,F):M>Xt?(x=Ns(N,F,z,G,d,-M,v),A=Ns(R,U,Q,j,d,-M,v),o.lineTo(x.cx+x.x01,x.cy+x.y01),M<L?o.arc(x.cx,x.cy,M,Yt(x.y01,x.x01),Yt(A.y01,A.x01),!v):(o.arc(x.cx,x.cy,M,Yt(x.y01,x.x01),Yt(x.y11,x.x11),!v),o.arc(0,0,d,Yt(x.cy+x.y11,x.cx+x.x11),Yt(A.cy+A.y11,A.cx+A.x11),v),o.arc(A.cx,A.cy,M,Yt(A.y11,A.x11),Yt(A.y01,A.x01),!v))):o.arc(0,0,d,_,O,v)}if(o.closePath(),u)return o=null,u+""||null}return l.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,h=(+r.apply(this,arguments)+ +s.apply(this,arguments))/2-ar/2;return[Dn(h)*u,Re(h)*u]},l.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:ct(+u),l):e},l.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:ct(+u),l):t},l.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:ct(+u),l):n},l.padRadius=function(u){return arguments.length?(i=u==null?null:typeof u=="function"?u:ct(+u),l):i},l.startAngle=function(u){return arguments.length?(r=typeof u=="function"?u:ct(+u),l):r},l.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:ct(+u),l):s},l.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:ct(+u),l):a},l.context=function(u){return arguments.length?(o=u??null,l):o},l}var XE=Array.prototype.slice;function Us(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function yd(e){this._context=e}yd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Bs(e){return new yd(e)}function nl(e){return e[0]}function il(e){return e[1]}function lr(e,t){var n=ct(!0),i=null,r=Bs,s=null,a=Ps(o);e=typeof e=="function"?e:e===void 0?nl:ct(e),t=typeof t=="function"?t:t===void 0?il:ct(t);function o(c){var l,u=(c=Us(c)).length,h,d=!1,f;for(i==null&&(s=r(f=a())),l=0;l<=u;++l)!(l<u&&n(h=c[l],l,c))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+e(h,l,c),+t(h,l,c));if(f)return s=null,f+""||null}return o.x=function(c){return arguments.length?(e=typeof c=="function"?c:ct(+c),o):e},o.y=function(c){return arguments.length?(t=typeof c=="function"?c:ct(+c),o):t},o.defined=function(c){return arguments.length?(n=typeof c=="function"?c:ct(!!c),o):n},o.curve=function(c){return arguments.length?(r=c,i!=null&&(s=r(i)),o):r},o.context=function(c){return arguments.length?(c==null?i=s=null:s=r(i=c),o):i},o}function rl(e,t,n){var i=null,r=ct(!0),s=null,a=Bs,o=null,c=Ps(l);e=typeof e=="function"?e:e===void 0?nl:ct(+e),t=typeof t=="function"?t:ct(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?il:ct(+n);function l(h){var d,f,p,m=(h=Us(h)).length,g,v=!1,b,w=new Array(m),O=new Array(m);for(s==null&&(o=a(b=c())),d=0;d<=m;++d){if(!(d<m&&r(g=h[d],d,h))===v)if(v=!v)f=d,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=d-1;p>=f;--p)o.point(w[p],O[p]);o.lineEnd(),o.areaEnd()}v&&(w[d]=+e(g,d,h),O[d]=+t(g,d,h),o.point(i?+i(g,d,h):w[d],n?+n(g,d,h):O[d]))}if(b)return o=null,b+""||null}function u(){return lr().defined(r).curve(a).context(s)}return l.x=function(h){return arguments.length?(e=typeof h=="function"?h:ct(+h),i=null,l):e},l.x0=function(h){return arguments.length?(e=typeof h=="function"?h:ct(+h),l):e},l.x1=function(h){return arguments.length?(i=h==null?null:typeof h=="function"?h:ct(+h),l):i},l.y=function(h){return arguments.length?(t=typeof h=="function"?h:ct(+h),n=null,l):t},l.y0=function(h){return arguments.length?(t=typeof h=="function"?h:ct(+h),l):t},l.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:ct(+h),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(i).y(t)},l.defined=function(h){return arguments.length?(r=typeof h=="function"?h:ct(!!h),l):r},l.curve=function(h){return arguments.length?(a=h,s!=null&&(o=a(s)),l):a},l.context=function(h){return arguments.length?(h==null?s=o=null:o=a(s=h),l):s},l}function ZE(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function KE(e){return e}function QE(){var e=KE,t=ZE,n=null,i=ct(0),r=ct(Is),s=ct(0);function a(o){var c,l=(o=Us(o)).length,u,h,d=0,f=new Array(l),p=new Array(l),m=+i.apply(this,arguments),g=Math.min(Is,Math.max(-Is,r.apply(this,arguments)-m)),v,b=Math.min(Math.abs(g)/l,s.apply(this,arguments)),w=b*(g<0?-1:1),O;for(c=0;c<l;++c)(O=p[f[c]=c]=+e(o[c],c,o))>0&&(d+=O);for(t!=null?f.sort(function(_,T){return t(p[_],p[T])}):n!=null&&f.sort(function(_,T){return n(o[_],o[T])}),c=0,h=d?(g-l*w)/d:0;c<l;++c,m=v)u=f[c],O=p[u],v=m+(O>0?O*h:0)+w,p[u]={data:o[u],index:c,value:O,startAngle:m,endAngle:v,padAngle:b};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:ct(+o),a):e},a.sortValues=function(o){return arguments.length?(t=o,n=null,a):t},a.sort=function(o){return arguments.length?(n=o,t=null,a):n},a.startAngle=function(o){return arguments.length?(i=typeof o=="function"?o:ct(+o),a):i},a.endAngle=function(o){return arguments.length?(r=typeof o=="function"?o:ct(+o),a):r},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:ct(+o),a):s},a}var JE=bd(Bs);function xd(e){this._curve=e}xd.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function bd(e){function t(n){return new xd(e(n))}return t._curve=e,t}function t_(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(bd(n)):t()._curve},e}function e_(){return t_(lr().curve(JE))}class n_{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function i_(e){return new n_(e,!0)}function r_(e){return e.source}function s_(e){return e.target}function a_(e){let t=r_,n=s_,i=nl,r=il,s=null,a=null,o=Ps(c);function c(){let l;const u=XE.call(arguments),h=t.apply(this,u),d=n.apply(this,u);if(s==null&&(a=e(l=o())),a.lineStart(),u[0]=h,a.point(+i.apply(this,u),+r.apply(this,u)),u[0]=d,a.point(+i.apply(this,u),+r.apply(this,u)),a.lineEnd(),l)return a=null,l+""||null}return c.source=function(l){return arguments.length?(t=l,c):t},c.target=function(l){return arguments.length?(n=l,c):n},c.x=function(l){return arguments.length?(i=typeof l=="function"?l:ct(+l),c):i},c.y=function(l){return arguments.length?(r=typeof l=="function"?l:ct(+l),c):r},c.context=function(l){return arguments.length?(l==null?s=a=null:a=e(s=l),c):s},c}function o_(){return a_(i_)}function hn(){}function Hs(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Vs(e){this._context=e}Vs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Hs(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Hs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function l_(e){return new Vs(e)}function wd(e){this._context=e}wd.prototype={areaStart:hn,areaEnd:hn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Hs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function c_(e){return new wd(e)}function Ed(e){this._context=e}Ed.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Hs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function u_(e){return new Ed(e)}function _d(e,t){this._basis=new Vs(e),this._beta=t}_d.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i=e[0],r=t[0],s=e[n]-i,a=t[n]-r,o=-1,c;++o<=n;)c=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(i+c*s),this._beta*t[o]+(1-this._beta)*(r+c*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const h_=function e(t){function n(i){return t===1?new Vs(i):new _d(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function Gs(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function sl(e,t){this._context=e,this._k=(1-t)/6}sl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Gs(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Gs(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const d_=function e(t){function n(i){return new sl(i,t)}return n.tension=function(i){return e(+i)},n}(0);function al(e,t){this._context=e,this._k=(1-t)/6}al.prototype={areaStart:hn,areaEnd:hn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Gs(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const f_=function e(t){function n(i){return new al(i,t)}return n.tension=function(i){return e(+i)},n}(0);function ol(e,t){this._context=e,this._k=(1-t)/6}ol.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Gs(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const p_=function e(t){function n(i){return new ol(i,t)}return n.tension=function(i){return e(+i)},n}(0);function ll(e,t,n){var i=e._x1,r=e._y1,s=e._x2,a=e._y2;if(e._l01_a>Xt){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,r=(r*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>Xt){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*l+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(i,r,s,a,e._x2,e._y2)}function Sd(e,t){this._context=e,this._alpha=t}Sd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:ll(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const g_=function e(t){function n(i){return t?new Sd(i,t):new sl(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function Od(e,t){this._context=e,this._alpha=t}Od.prototype={areaStart:hn,areaEnd:hn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ll(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const m_=function e(t){function n(i){return t?new Od(i,t):new al(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function Td(e,t){this._context=e,this._alpha=t}Td.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ll(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const v_=function e(t){function n(i){return t?new Td(i,t):new ol(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function Md(e){this._context=e}Md.prototype={areaStart:hn,areaEnd:hn,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Cd(e){return new Md(e)}function Ad(e){return e<0?-1:1}function $d(e,t,n){var i=e._x1-e._x0,r=t-e._x1,s=(e._y1-e._y0)/(i||r<0&&-0),a=(n-e._y1)/(r||i<0&&-0),o=(s*r+a*i)/(i+r);return(Ad(s)+Ad(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Ld(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function cl(e,t,n){var i=e._x0,r=e._y0,s=e._x1,a=e._y1,o=(s-i)/3;e._context.bezierCurveTo(i+o,r+o*t,s-o,a-o*n,s,a)}function Fs(e){this._context=e}Fs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:cl(this,this._t0,Ld(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,cl(this,Ld(this,n=$d(this,e,t)),n);break;default:cl(this,this._t0,n=$d(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Dd(e){this._context=new kd(e)}(Dd.prototype=Object.create(Fs.prototype)).point=function(e,t){Fs.prototype.point.call(this,t,e)};function kd(e){this._context=e}kd.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,s){this._context.bezierCurveTo(t,e,i,n,s,r)}};function y_(e){return new Fs(e)}function x_(e){return new Dd(e)}function Rd(e){this._context=e}Rd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var i=Id(e),r=Id(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(i[0][s],r[0][s],i[1][s],r[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Id(e){var t,n=e.length-1,i,r=new Array(n),s=new Array(n),a=new Array(n);for(r[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)r[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(r[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)i=r[t]/s[t-1],s[t]-=i,a[t]-=i*a[t-1];for(r[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)r[t]=(a[t]-r[t+1])/s[t];for(s[n-1]=(e[n]+r[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-r[t+1];return[r,s]}function b_(e){return new Rd(e)}function zs(e,t){this._context=e,this._t=t}zs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function w_(e){return new zs(e,.5)}function E_(e){return new zs(e,0)}function __(e){return new zs(e,1)}function Pd(e,t){if((a=e.length)>1)for(var n=1,i,r,s=e[t[0]],a,o=s.length;n<a;++n)for(r=s,s=e[t[n]],i=0;i<o;++i)s[i][1]+=s[i][0]=isNaN(r[i][1])?r[i][0]:r[i][1]}function Nd(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function S_(e,t){return e[t]}function O_(e){const t=[];return t.key=e,t}function ul(){var e=ct([]),t=Nd,n=Pd,i=S_;function r(s){var a=Array.from(e.apply(this,arguments),O_),o,c=a.length,l=-1,u;for(const h of s)for(o=0,++l;o<c;++o)(a[o][l]=[0,+i(h,a[o].key,l,s)]).data=h;for(o=0,u=Us(t(a));o<c;++o)a[u[o]].index=o;return n(a,u),a}return r.keys=function(s){return arguments.length?(e=typeof s=="function"?s:ct(Array.from(s)),r):e},r.value=function(s){return arguments.length?(i=typeof s=="function"?s:ct(+s),r):i},r.order=function(s){return arguments.length?(t=s==null?Nd:typeof s=="function"?s:ct(Array.from(s)),r):t},r.offset=function(s){return arguments.length?(n=s??Pd,r):n},r}function T_(e,t){if((c=e.length)>0)for(var n,i=0,r,s,a,o,c,l=e[t[0]].length;i<l;++i)for(a=o=0,n=0;n<c;++n)(s=(r=e[t[n]][i])[1]-r[0])>0?(r[0]=a,r[1]=a+=s):s<0?(r[1]=o,r[0]=o+=s):(r[0]=0,r[1]=s)}function cr(e,t,n){this.k=e,this.x=t,this.y=n}cr.prototype={constructor:cr,scale:function(e){return e===1?this:new cr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new cr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},cr.prototype;var Ud=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Ud||{}),Bd=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(Bd||{}),Hd=(e=>(e.UPDATE="model-update",e))(Hd||{}),Vd=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e))(Vd||{}),Gd=(e=>(e.UPDATE="zoom-bar-update",e.SELECTION_START="zoom-bar-selection-start",e.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",e.SELECTION_END="zoom-bar-selection-end",e))(Gd||{}),Fd=(e=>(e.CHANGE="zoom-domain-change",e))(Fd||{}),zd=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(zd||{}),jd=(e=>(e.LABEL_MOUSEOVER="axis-label-mouseover",e.LABEL_MOUSEMOVE="axis-label-mousemove",e.LABEL_CLICK="axis-label-click",e.LABEL_MOUSEOUT="axis-label-mouseout",e.LABEL_FOCUS="axis-label-focus",e.LABEL_BLUR="axis-label-blur",e.RENDER_COMPLETE="axis-render-complete",e))(jd||{}),Wd=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Wd||{}),qd=(e=>(e.WORD_MOUSEOVER="wordcloud-word-mouseover",e.WORD_MOUSEMOVE="wordcloud-word-mousemove",e.WORD_CLICK="wordcloud-word-click",e.WORD_MOUSEOUT="wordcloud-word-mouseout",e))(qd||{}),Yd=(e=>(e.SLICE_MOUSEOVER="pie-slice-mouseover",e.SLICE_MOUSEMOVE="pie-slice-mousemove",e.SLICE_CLICK="pie-slice-click",e.SLICE_MOUSEOUT="pie-slice-mouseout",e))(Yd||{}),Xd=(e=>(e.ARC_MOUSEOVER="gauge-arc-mouseover",e.ARC_MOUSEMOVE="gauge-arc-mousemove",e.ARC_CLICK="gauge-arc-click",e.ARC_MOUSEOUT="gauge-arc-mouseout",e))(Xd||{}),Zd=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(Zd||{}),Kd=(e=>(e.BOX_MOUSEOVER="box-mouseover",e.BOX_MOUSEMOVE="box-mousemove",e.BOX_CLICK="box-click",e.BOX_MOUSEOUT="box-mouseout",e.OUTLIER_MOUSEOVER="outlier-mouseover",e.OUTLIER_MOUSEMOVE="outlier-mousemove",e.OUTLIER_CLICK="outlier-click",e.OUTLIER_MOUSEOUT="outlier-mouseout",e))(Kd||{}),Qd=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(Qd||{}),Jd=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Jd||{}),tf=(e=>(e.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",e.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",e.X_AXIS_CLICK="radar-x-axis-click",e.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",e))(tf||{}),ef=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(ef||{}),nf=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(nf||{}),ur=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(ur||{}),rf=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(rf||{}),sf=(e=>(e.ITEM_HOVER="legend-item-onhover",e.ITEM_CLICK="legend-item-onclick",e.ITEM_MOUSEOUT="legend-item-onmouseout",e.ITEMS_UPDATE="legend-items-update",e))(sf||{}),af=(e=>(e.CIRCLE_MOUSEOVER="circle-leaf-mouseover",e.CIRCLE_CLICK="circle-leaf-click",e.CIRCLE_MOUSEOUT="circle-leaf-mouseout",e.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",e))(af||{}),of=(e=>(e.NODE_MOUSEOVER="alluvial-node-mouseover",e.NODE_CLICK="alluvial-node-click",e.NODE_MOUSEOUT="alluvial-node-mouseout",e.NODE_MOUSEMOVE="alluvial-node-mousemove",e.LINE_MOUSEOVER="alluvial-line-mouseover",e.LINE_CLICK="alluvial-line-click",e.LINE_MOUSEOUT="alluvial-line-mouseout",e.LINE_MOUSEMOVE="alluvial-line-mousemove",e))(of||{}),lf=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(lf||{}),cf=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(cf||{}),ui=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(ui||{});const M_=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:of,Area:Wd,Axis:jd,Bar:Zd,Boxplot:Kd,CanvasZoom:zd,Chart:Ud,Choropleth:ui,CirclePack:af,Gauge:Xd,Heatmap:cf,Legend:sf,Line:Jd,Meter:lf,Modal:Bd,Model:Hd,Pie:Yd,Radar:tf,Scatter:Qd,Threshold:rf,Toolbar:Vd,Tooltip:ur,Tree:ef,Treemap:nf,WordCloud:qd,ZoomBar:Gd,ZoomDomain:Fd},Symbol.toStringTag,{value:"Module"})),C=M_;var K=(e=>(e.HTML="html",e.SVG="svg",e))(K||{}),uf=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(uf||{}),J=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(J||{}),H=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(H||{}),Ie=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ie||{}),Oe=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Oe||{}),Ht=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Ht||{}),Z=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(Z||{}),hr=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(hr||{}),It=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(It||{}),dr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(dr||{}),hl=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(hl||{}),_t=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(_t||{}),it=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(it||{}),hi=(e=>(e.CENTER="center",e))(hi||{}),js=(e=>(e.LEFT="left",e.RIGHT="right",e))(js||{}),Pt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Pt||{}),Ke=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(Ke||{}),Qe=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(Qe||{}),di=(e=>(e.SEMI="semi",e.FULL="full",e))(di||{}),dl=(e=>(e.UP="up",e.DOWN="down",e))(dl||{}),Ws=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(Ws||{}),qs=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(qs||{}),pe=(e=>(e.SCATTER="scatter",e.LINE="line",e.SIMPLE_BAR="simple-bar",e.STACKED_BAR="stacked-bar",e.GROUPED_BAR="grouped-bar",e.AREA="area",e.STACKED_AREA="stacked-area",e))(pe||{}),$t=(e=>(e.EXPORT_CSV="Export as CSV",e.EXPORT_PNG="Export as PNG",e.EXPORT_JPG="Export as JPG",e.ZOOM_IN="Zoom in",e.ZOOM_OUT="Zoom out",e.RESET_ZOOM="Reset zoom",e.MAKE_FULLSCREEN="Make fullscreen",e.SHOW_AS_DATATABLE="Show as data-table",e.CUSTOM="Custom",e))($t||{}),fl=(e=>(e.LEFT="left",e.RIGHT="right",e))(fl||{}),Nt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(Nt||{}),Ys=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(Ys||{}),fr=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(fr||{}),Xs=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(Xs||{}),Je=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(Je||{});function pl(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,i=e.formats[n]||e.formats[e.defaultWidth];return i}}function pr(e){return function(t,n){var i=n!=null&&n.context?String(n.context):"standalone",r;if(i==="formatting"&&e.formattingValues){var s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;r=e.formattingValues[a]||e.formattingValues[s]}else{var o=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[c]||e.values[o]}var l=e.argumentCallback?e.argumentCallback(t):t;return r[l]}}function gr(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;var a=s[0],o=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(o)?A_(o,function(h){return h.test(a)}):C_(o,function(h){return h.test(a)}),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;var u=t.slice(a.length);return{value:l,rest:u}}}function C_(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function A_(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function $_(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.match(e.matchPattern);if(!i)return null;var r=i[0],s=t.match(e.parsePattern);if(!s)return null;var a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;var o=t.slice(r.length);return{value:a,rest:o}}}function Zs(e){"@babel/helpers - typeof";return Zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zs(e)}function Ut(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function st(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function ft(e){st(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Zs(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Ks(e,t){st(2,arguments);var n=ft(e).getTime(),i=Ut(t);return new Date(n+i)}var L_={};function Qs(){return L_}function gl(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function D_(e){return st(1,arguments),e instanceof Date||Zs(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function k_(e){if(st(1,arguments),!D_(e)&&typeof e!="number")return!1;var t=ft(e);return!isNaN(Number(t))}function R_(e,t){st(2,arguments);var n=Ut(t);return Ks(e,-n)}var I_=864e5;function P_(e){st(1,arguments);var t=ft(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var i=t.getTime(),r=n-i;return Math.floor(r/I_)+1}function Js(e){st(1,arguments);var t=1,n=ft(e),i=n.getUTCDay(),r=(i<t?7:0)+i-t;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n}function hf(e){st(1,arguments);var t=ft(e),n=t.getUTCFullYear(),i=new Date(0);i.setUTCFullYear(n+1,0,4),i.setUTCHours(0,0,0,0);var r=Js(i),s=new Date(0);s.setUTCFullYear(n,0,4),s.setUTCHours(0,0,0,0);var a=Js(s);return t.getTime()>=r.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function N_(e){st(1,arguments);var t=hf(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var i=Js(n);return i}var U_=6048e5;function B_(e){st(1,arguments);var t=ft(e),n=Js(t).getTime()-N_(t).getTime();return Math.round(n/U_)+1}function ta(e,t){var n,i,r,s,a,o,c,l;st(1,arguments);var u=Qs(),h=Ut((n=(i=(r=(s=t==null?void 0:t.weekStartsOn)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(c=u.locale)===null||c===void 0||(l=c.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&n!==void 0?n:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=ft(e),f=d.getUTCDay(),p=(f<h?7:0)+f-h;return d.setUTCDate(d.getUTCDate()-p),d.setUTCHours(0,0,0,0),d}function df(e,t){var n,i,r,s,a,o,c,l;st(1,arguments);var u=ft(e),h=u.getUTCFullYear(),d=Qs(),f=Ut((n=(i=(r=(s=t==null?void 0:t.firstWeekContainsDate)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&r!==void 0?r:d.firstWeekContainsDate)!==null&&i!==void 0?i:(c=d.locale)===null||c===void 0||(l=c.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(h+1,0,f),p.setUTCHours(0,0,0,0);var m=ta(p,t),g=new Date(0);g.setUTCFullYear(h,0,f),g.setUTCHours(0,0,0,0);var v=ta(g,t);return u.getTime()>=m.getTime()?h+1:u.getTime()>=v.getTime()?h:h-1}function H_(e,t){var n,i,r,s,a,o,c,l;st(1,arguments);var u=Qs(),h=Ut((n=(i=(r=(s=t==null?void 0:t.firstWeekContainsDate)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&r!==void 0?r:u.firstWeekContainsDate)!==null&&i!==void 0?i:(c=u.locale)===null||c===void 0||(l=c.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=df(e,t),f=new Date(0);f.setUTCFullYear(d,0,h),f.setUTCHours(0,0,0,0);var p=ta(f,t);return p}var V_=6048e5;function G_(e,t){st(1,arguments);var n=ft(e),i=ta(n,t).getTime()-H_(n,t).getTime();return Math.round(i/V_)+1}function yt(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}var F_={y:function(e,t){var n=e.getUTCFullYear(),i=n>0?n:1-n;return yt(t==="yy"?i%100:i,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):yt(n+1,2)},d:function(e,t){return yt(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(e,t){return yt(e.getUTCHours()%12||12,t.length)},H:function(e,t){return yt(e.getUTCHours(),t.length)},m:function(e,t){return yt(e.getUTCMinutes(),t.length)},s:function(e,t){return yt(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,i=e.getUTCMilliseconds(),r=Math.floor(i*Math.pow(10,n-3));return yt(r,t.length)}};const dn=F_;var fi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},z_={G:function(e,t,n){var i=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){var i=e.getUTCFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return dn.y(e,t)},Y:function(e,t,n,i){var r=df(e,i),s=r>0?r:1-r;if(t==="YY"){var a=s%100;return yt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):yt(s,t.length)},R:function(e,t){var n=hf(e);return yt(n,t.length)},u:function(e,t){var n=e.getUTCFullYear();return yt(n,t.length)},Q:function(e,t,n){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return yt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return yt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){var i=e.getUTCMonth();switch(t){case"M":case"MM":return dn.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){var i=e.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return yt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){var r=G_(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):yt(r,t.length)},I:function(e,t,n){var i=B_(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):yt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):dn.d(e,t)},D:function(e,t,n){var i=P_(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):yt(i,t.length)},E:function(e,t,n){var i=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){var r=e.getUTCDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return yt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){var r=e.getUTCDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return yt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){var i=e.getUTCDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return yt(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){var i=e.getUTCHours(),r=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var i=e.getUTCHours(),r;switch(i===12?r=fi.noon:i===0?r=fi.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var i=e.getUTCHours(),r;switch(i>=17?r=fi.evening:i>=12?r=fi.afternoon:i>=4?r=fi.morning:r=fi.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){var i=e.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return dn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):dn.H(e,t)},K:function(e,t,n){var i=e.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):yt(i,t.length)},k:function(e,t,n){var i=e.getUTCHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):yt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):dn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):dn.s(e,t)},S:function(e,t){return dn.S(e,t)},X:function(e,t,n,i){var r=i._originalDate||e,s=r.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return pf(s);case"XXXX":case"XX":return kn(s);case"XXXXX":case"XXX":default:return kn(s,":")}},x:function(e,t,n,i){var r=i._originalDate||e,s=r.getTimezoneOffset();switch(t){case"x":return pf(s);case"xxxx":case"xx":return kn(s);case"xxxxx":case"xxx":default:return kn(s,":")}},O:function(e,t,n,i){var r=i._originalDate||e,s=r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ff(s,":");case"OOOO":default:return"GMT"+kn(s,":")}},z:function(e,t,n,i){var r=i._originalDate||e,s=r.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ff(s,":");case"zzzz":default:return"GMT"+kn(s,":")}},t:function(e,t,n,i){var r=i._originalDate||e,s=Math.floor(r.getTime()/1e3);return yt(s,t.length)},T:function(e,t,n,i){var r=i._originalDate||e,s=r.getTime();return yt(s,t.length)}};function ff(e,t){var n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),s=i%60;if(s===0)return n+String(r);var a=t||"";return n+String(r)+a+yt(s,2)}function pf(e,t){if(e%60===0){var n=e>0?"-":"+";return n+yt(Math.abs(e)/60,2)}return kn(e,t)}function kn(e,t){var n=t||"",i=e>0?"-":"+",r=Math.abs(e),s=yt(Math.floor(r/60),2),a=yt(r%60,2);return i+s+n+a}const j_=z_;var gf=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},mf=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},W_=function(e,t){var n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return gf(e,t);var s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",gf(i,t)).replace("{{time}}",mf(r,t))},q_={p:mf,P:W_};const Y_=q_;var X_=["D","DD"],Z_=["YY","YYYY"];function K_(e){return X_.indexOf(e)!==-1}function Q_(e){return Z_.indexOf(e)!==-1}function vf(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var J_={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},tS=function(e,t,n){var i,r=J_[e];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};const eS=tS;var nS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},iS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},rS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},sS={date:pl({formats:nS,defaultWidth:"full"}),time:pl({formats:iS,defaultWidth:"full"}),dateTime:pl({formats:rS,defaultWidth:"full"})};const aS=sS;var oS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},lS=function(e,t,n,i){return oS[e]};const cS=lS;var uS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},hS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},dS={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},fS={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},pS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},mS=function(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},vS={ordinalNumber:mS,era:pr({values:uS,defaultWidth:"wide"}),quarter:pr({values:hS,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:pr({values:dS,defaultWidth:"wide"}),day:pr({values:fS,defaultWidth:"wide"}),dayPeriod:pr({values:pS,defaultWidth:"wide",formattingValues:gS,defaultFormattingWidth:"wide"})};const yS=vS;var xS=/^(\d+)(th|st|nd|rd)?/i,bS=/\d+/i,wS={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ES={any:[/^b/i,/^(a|c)/i]},_S={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},SS={any:[/1/i,/2/i,/3/i,/4/i]},OS={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},TS={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},MS={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},CS={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},AS={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},$S={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},LS={ordinalNumber:$_({matchPattern:xS,parsePattern:bS,valueCallback:function(e){return parseInt(e,10)}}),era:gr({matchPatterns:wS,defaultMatchWidth:"wide",parsePatterns:ES,defaultParseWidth:"any"}),quarter:gr({matchPatterns:_S,defaultMatchWidth:"wide",parsePatterns:SS,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:gr({matchPatterns:OS,defaultMatchWidth:"wide",parsePatterns:TS,defaultParseWidth:"any"}),day:gr({matchPatterns:MS,defaultMatchWidth:"wide",parsePatterns:CS,defaultParseWidth:"any"}),dayPeriod:gr({matchPatterns:AS,defaultMatchWidth:"any",parsePatterns:$S,defaultParseWidth:"any"})},DS={code:"en-US",formatDistance:eS,formatLong:aS,formatRelative:cS,localize:yS,match:LS,options:{weekStartsOn:0,firstWeekContainsDate:1}};const yf=DS;var kS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,RS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,IS=/^'([^]*?)'?$/,PS=/''/g,NS=/[a-zA-Z]/;function pi(e,t,n){var i,r,s,a,o,c,l,u,h,d,f,p,m,g,v,b,w,O;st(2,arguments);var _=String(t),T=Qs(),S=(i=(r=n==null?void 0:n.locale)!==null&&r!==void 0?r:T.locale)!==null&&i!==void 0?i:yf,$=Ut((s=(a=(o=(c=n==null?void 0:n.firstWeekContainsDate)!==null&&c!==void 0?c:n==null||(l=n.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:T.firstWeekContainsDate)!==null&&a!==void 0?a:(h=T.locale)===null||h===void 0||(d=h.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!($>=1&&$<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var D=Ut((f=(p=(m=(g=n==null?void 0:n.weekStartsOn)!==null&&g!==void 0?g:n==null||(v=n.locale)===null||v===void 0||(b=v.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&m!==void 0?m:T.weekStartsOn)!==null&&p!==void 0?p:(w=T.locale)===null||w===void 0||(O=w.options)===null||O===void 0?void 0:O.weekStartsOn)!==null&&f!==void 0?f:0);if(!(D>=0&&D<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!S.localize)throw new RangeError("locale must contain localize property");if(!S.formatLong)throw new RangeError("locale must contain formatLong property");var L=ft(e);if(!k_(L))throw new RangeError("Invalid time value");var M=gl(L),B=R_(L,M),x={firstWeekContainsDate:$,weekStartsOn:D,locale:S,_originalDate:L},A=_.match(RS).map(function(y){var k=y[0];if(k==="p"||k==="P"){var R=Y_[k];return R(y,S.formatLong)}return y}).join("").match(kS).map(function(y){if(y==="''")return"'";var k=y[0];if(k==="'")return US(y);var R=j_[k];if(R)return!(n!=null&&n.useAdditionalWeekYearTokens)&&Q_(y)&&vf(y,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&K_(y)&&vf(y,t,String(e)),R(B,y,S.localize,x);if(k.match(NS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return y}).join("");return A}function US(e){var t=e.match(IS);return t?t[1].replace(PS,"'"):e}const Qt="cds",Pe={opacity:{unselected:.05,selected:.4}},gi={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},mi={duration:1e3,ease:Ou,zoomLevel:3},Rn={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},ml={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},ue={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},xf={defaultBins:10},Lt={items:{status:{ACTIVE:1,DISABLED:0},horizontalSpace:12,verticalSpace:24,textYOffset:8,spaceAfter:4},checkbox:{radius:6.5},radius:{iconData:[{cx:7,cy:7,r:6.5},{cx:7,cy:10,r:3.5}],fill:null,stroke:"#8c8c8c"},line:{yPosition:6,width:24,strokeWidth:1.4,fill:null,stroke:"#999999"},area:{width:24,height:14,fill:"#6f6f6f",stroke:null},size:{iconData:[{width:23,height:12},{width:13,height:6}],fill:null,stroke:"#8D8D8D"},quartile:{iconData:[{x:0,y:0,width:24,height:13},{x:11,y:4,width:1,height:4}]},zoom:{iconData:[{x:0,y:0,width:12,height:12}],color:"#8D8D8D"},color:{barWidth:300,barHeight:8,axisYTranslation:10}},Ne={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},Vt={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Et={radiusOffset:-15,innerRadius:2,padAngle:.007,hoverArc:{outerRadiusOffset:3},xOffset:30,yOffset:20,yOffsetCallout:10,callout:{minSliceDegree:5,offsetX:15,offsetY:12,horizontalLineLength:8,textMargin:2}},fn={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},ge={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},vl={minCellDividerDimension:16,chartPadding:.5},yl={default:{size:24}},bf={horizontalOffset:10},xl={default:{duration:300},pie_slice_mouseover:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},BS={buttonSize:32,iconSize:20,height:32,spacerHeight:10,iconPadding:6},ie={height:{[Ie.GRAPH_VIEW]:32,[Ie.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},wf=[{type:Nt.RADIUS,name:"Radius"},{type:Nt.AREA,name:"Poor area"},{type:Nt.AREA,name:"Satisfactory area"},{type:Nt.AREA,name:"Great area"},{type:Nt.QUARTILE,name:"Quartiles"}];var HS=typeof global=="object"&&global&&global.Object===Object&&global;const Ef=HS;var VS=typeof self=="object"&&self&&self.Object===Object&&self,GS=Ef||VS||Function("return this")();const Te=GS;var FS=Te.Symbol;const me=FS;var _f=Object.prototype,zS=_f.hasOwnProperty,jS=_f.toString,mr=me?me.toStringTag:void 0;function WS(e){var t=zS.call(e,mr),n=e[mr];try{e[mr]=void 0;var i=!0}catch{}var r=jS.call(e);return i&&(t?e[mr]=n:delete e[mr]),r}var qS=Object.prototype,YS=qS.toString;function XS(e){return YS.call(e)}var ZS="[object Null]",KS="[object Undefined]",Sf=me?me.toStringTag:void 0;function In(e){return e==null?e===void 0?KS:ZS:Sf&&Sf in Object(e)?WS(e):XS(e)}function Ue(e){return e!=null&&typeof e=="object"}var QS="[object Symbol]";function ea(e){return typeof e=="symbol"||Ue(e)&&In(e)==QS}function Of(e,t){for(var n=-1,i=e==null?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r}var JS=Array.isArray;const Ft=JS;var tO=1/0,Tf=me?me.prototype:void 0,Mf=Tf?Tf.toString:void 0;function Cf(e){if(typeof e=="string")return e;if(Ft(e))return Of(e,Cf)+"";if(ea(e))return Mf?Mf.call(e):"";var t=e+"";return t=="0"&&1/e==-tO?"-0":t}function ve(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function bl(e){return e}var eO="[object AsyncFunction]",nO="[object Function]",iO="[object GeneratorFunction]",rO="[object Proxy]";function wl(e){if(!ve(e))return!1;var t=In(e);return t==nO||t==iO||t==eO||t==rO}var sO=Te["__core-js_shared__"];const El=sO;var Af=function(){var e=/[^.]+$/.exec(El&&El.keys&&El.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function aO(e){return!!Af&&Af in e}var oO=Function.prototype,lO=oO.toString;function Pn(e){if(e!=null){try{return lO.call(e)}catch{}try{return e+""}catch{}}return""}var cO=/[\\^$.*+?()[\]{}|]/g,uO=/^\[object .+?Constructor\]$/,hO=Function.prototype,dO=Object.prototype,fO=hO.toString,pO=dO.hasOwnProperty,gO=RegExp("^"+fO.call(pO).replace(cO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function mO(e){if(!ve(e)||aO(e))return!1;var t=wl(e)?gO:uO;return t.test(Pn(e))}function vO(e,t){return e==null?void 0:e[t]}function Nn(e,t){var n=vO(e,t);return mO(n)?n:void 0}var yO=Nn(Te,"WeakMap");const _l=yO;var $f=Object.create,xO=function(){function e(){}return function(t){if(!ve(t))return{};if($f)return $f(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const bO=xO;function wO(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function EO(){}function Lf(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}var _O=800,SO=16,OO=Date.now;function TO(e){var t=0,n=0;return function(){var i=OO(),r=SO-(i-n);if(n=i,r>0){if(++t>=_O)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function MO(e){return function(){return e}}var CO=function(){try{var e=Nn(Object,"defineProperty");return e({},"",{}),e}catch{}}();const na=CO;var AO=na?function(e,t){return na(e,"toString",{configurable:!0,enumerable:!1,value:MO(t),writable:!0})}:bl,$O=TO(AO);const LO=$O;function DO(e,t){for(var n=-1,i=e==null?0:e.length;++n<i&&t(e[n],n,e)!==!1;);return e}function kO(e,t,n,i){for(var r=e.length,s=n+(i?1:-1);i?s--:++s<r;)if(t(e[s],s,e))return s;return-1}function RO(e){return e!==e}function IO(e,t,n){for(var i=n-1,r=e.length;++i<r;)if(e[i]===t)return i;return-1}function PO(e,t,n){return t===t?IO(e,t,n):kO(e,RO,n)}function NO(e,t){var n=e==null?0:e.length;return!!n&&PO(e,t,0)>-1}var UO=9007199254740991,BO=/^(?:0|[1-9]\d*)$/;function Sl(e,t){var n=typeof e;return t=t??UO,!!t&&(n=="number"||n!="symbol"&&BO.test(e))&&e>-1&&e%1==0&&e<t}function ia(e,t,n){t=="__proto__"&&na?na(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function vr(e,t){return e===t||e!==e&&t!==t}var HO=Object.prototype,VO=HO.hasOwnProperty;function Df(e,t,n){var i=e[t];(!(VO.call(e,t)&&vr(i,n))||n===void 0&&!(t in e))&&ia(e,t,n)}function yr(e,t,n,i){var r=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],c=i?i(n[o],e[o],o,n,e):void 0;c===void 0&&(c=e[o]),r?ia(n,o,c):Df(n,o,c)}return n}var kf=Math.max;function GO(e,t,n){return t=kf(t===void 0?e.length-1:t,0),function(){for(var i=arguments,r=-1,s=kf(i.length-t,0),a=Array(s);++r<s;)a[r]=i[t+r];r=-1;for(var o=Array(t+1);++r<t;)o[r]=i[r];return o[t]=n(a),wO(e,this,o)}}function Rf(e,t){return LO(GO(e,t,bl),e+"")}var FO=9007199254740991;function Ol(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=FO}function Un(e){return e!=null&&Ol(e.length)&&!wl(e)}function If(e,t,n){if(!ve(n))return!1;var i=typeof t;return(i=="number"?Un(n)&&Sl(t,n.length):i=="string"&&t in n)?vr(n[t],e):!1}function zO(e){return Rf(function(t,n){var i=-1,r=n.length,s=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(r--,s):void 0,a&&If(n[0],n[1],a)&&(s=r<3?void 0:s,r=1),t=Object(t);++i<r;){var o=n[i];o&&e(t,o,i,s)}return t})}var jO=Object.prototype;function ra(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||jO;return e===n}function WO(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}var qO="[object Arguments]";function Pf(e){return Ue(e)&&In(e)==qO}var Nf=Object.prototype,YO=Nf.hasOwnProperty,XO=Nf.propertyIsEnumerable,ZO=Pf(function(){return arguments}())?Pf:function(e){return Ue(e)&&YO.call(e,"callee")&&!XO.call(e,"callee")};const vi=ZO;function KO(){return!1}var Uf=typeof rt=="object"&&rt&&!rt.nodeType&&rt,Bf=Uf&&typeof module=="object"&&module&&!module.nodeType&&module,QO=Bf&&Bf.exports===Uf,Hf=QO?Te.Buffer:void 0,JO=Hf?Hf.isBuffer:void 0,tT=JO||KO;const yi=tT;var eT="[object Arguments]",nT="[object Array]",iT="[object Boolean]",rT="[object Date]",sT="[object Error]",aT="[object Function]",oT="[object Map]",lT="[object Number]",cT="[object Object]",uT="[object RegExp]",hT="[object Set]",dT="[object String]",fT="[object WeakMap]",pT="[object ArrayBuffer]",gT="[object DataView]",mT="[object Float32Array]",vT="[object Float64Array]",yT="[object Int8Array]",xT="[object Int16Array]",bT="[object Int32Array]",wT="[object Uint8Array]",ET="[object Uint8ClampedArray]",_T="[object Uint16Array]",ST="[object Uint32Array]",Tt={};Tt[mT]=Tt[vT]=Tt[yT]=Tt[xT]=Tt[bT]=Tt[wT]=Tt[ET]=Tt[_T]=Tt[ST]=!0,Tt[eT]=Tt[nT]=Tt[pT]=Tt[iT]=Tt[gT]=Tt[rT]=Tt[sT]=Tt[aT]=Tt[oT]=Tt[lT]=Tt[cT]=Tt[uT]=Tt[hT]=Tt[dT]=Tt[fT]=!1;function OT(e){return Ue(e)&&Ol(e.length)&&!!Tt[In(e)]}function Tl(e){return function(t){return e(t)}}var Vf=typeof rt=="object"&&rt&&!rt.nodeType&&rt,xr=Vf&&typeof module=="object"&&module&&!module.nodeType&&module,TT=xr&&xr.exports===Vf,Ml=TT&&Ef.process,MT=function(){try{var e=xr&&xr.require&&xr.require("util").types;return e||Ml&&Ml.binding&&Ml.binding("util")}catch{}}();const xi=MT;var Gf=xi&&xi.isTypedArray,CT=Gf?Tl(Gf):OT;const sa=CT;var AT=Object.prototype,$T=AT.hasOwnProperty;function Ff(e,t){var n=Ft(e),i=!n&&vi(e),r=!n&&!i&&yi(e),s=!n&&!i&&!r&&sa(e),a=n||i||r||s,o=a?WO(e.length,String):[],c=o.length;for(var l in e)(t||$T.call(e,l))&&!(a&&(l=="length"||r&&(l=="offset"||l=="parent")||s&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Sl(l,c)))&&o.push(l);return o}function zf(e,t){return function(n){return e(t(n))}}var LT=zf(Object.keys,Object);const DT=LT;var kT=Object.prototype,RT=kT.hasOwnProperty;function jf(e){if(!ra(e))return DT(e);var t=[];for(var n in Object(e))RT.call(e,n)&&n!="constructor"&&t.push(n);return t}function br(e){return Un(e)?Ff(e):jf(e)}function IT(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var PT=Object.prototype,NT=PT.hasOwnProperty;function UT(e){if(!ve(e))return IT(e);var t=ra(e),n=[];for(var i in e)i=="constructor"&&(t||!NT.call(e,i))||n.push(i);return n}function wr(e){return Un(e)?Ff(e,!0):UT(e)}var BT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,HT=/^\w*$/;function Cl(e,t){if(Ft(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||ea(e)?!0:HT.test(e)||!BT.test(e)||t!=null&&e in Object(t)}var VT=Nn(Object,"create");const Er=VT;function GT(){this.__data__=Er?Er(null):{},this.size=0}function FT(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var zT="__lodash_hash_undefined__",jT=Object.prototype,WT=jT.hasOwnProperty;function qT(e){var t=this.__data__;if(Er){var n=t[e];return n===zT?void 0:n}return WT.call(t,e)?t[e]:void 0}var YT=Object.prototype,XT=YT.hasOwnProperty;function ZT(e){var t=this.__data__;return Er?t[e]!==void 0:XT.call(t,e)}var KT="__lodash_hash_undefined__";function QT(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Er&&t===void 0?KT:t,this}function Bn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Bn.prototype.clear=GT,Bn.prototype.delete=FT,Bn.prototype.get=qT,Bn.prototype.has=ZT,Bn.prototype.set=QT;function JT(){this.__data__=[],this.size=0}function aa(e,t){for(var n=e.length;n--;)if(vr(e[n][0],t))return n;return-1}var tM=Array.prototype,eM=tM.splice;function nM(e){var t=this.__data__,n=aa(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():eM.call(t,n,1),--this.size,!0}function iM(e){var t=this.__data__,n=aa(t,e);return n<0?void 0:t[n][1]}function rM(e){return aa(this.__data__,e)>-1}function sM(e,t){var n=this.__data__,i=aa(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}function tn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}tn.prototype.clear=JT,tn.prototype.delete=nM,tn.prototype.get=iM,tn.prototype.has=rM,tn.prototype.set=sM;var aM=Nn(Te,"Map");const _r=aM;function oM(){this.size=0,this.__data__={hash:new Bn,map:new(_r||tn),string:new Bn}}function lM(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function oa(e,t){var n=e.__data__;return lM(t)?n[typeof t=="string"?"string":"hash"]:n.map}function cM(e){var t=oa(this,e).delete(e);return this.size-=t?1:0,t}function uM(e){return oa(this,e).get(e)}function hM(e){return oa(this,e).has(e)}function dM(e,t){var n=oa(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}function en(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}en.prototype.clear=oM,en.prototype.delete=cM,en.prototype.get=uM,en.prototype.has=hM,en.prototype.set=dM;var fM="Expected a function";function Al(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(fM);var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var a=e.apply(this,i);return n.cache=s.set(r,a)||s,a};return n.cache=new(Al.Cache||en),n}Al.Cache=en;var pM=500;function gM(e){var t=Al(e,function(i){return n.size===pM&&n.clear(),i}),n=t.cache;return t}var mM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vM=/\\(\\)?/g,yM=gM(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(mM,function(n,i,r,s){t.push(r?s.replace(vM,"$1"):i||n)}),t});const xM=yM;function Sr(e){return e==null?"":Cf(e)}function Wf(e,t){return Ft(e)?e:Cl(e,t)?[e]:xM(Sr(e))}var bM=1/0;function la(e){if(typeof e=="string"||ea(e))return e;var t=e+"";return t=="0"&&1/e==-bM?"-0":t}function qf(e,t){t=Wf(t,e);for(var n=0,i=t.length;e!=null&&n<i;)e=e[la(t[n++])];return n&&n==i?e:void 0}function St(e,t,n){var i=e==null?void 0:qf(e,t);return i===void 0?n:i}function $l(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}var Yf=me?me.isConcatSpreadable:void 0;function wM(e){return Ft(e)||vi(e)||!!(Yf&&e&&e[Yf])}function ca(e,t,n,i,r){var s=-1,a=e.length;for(n||(n=wM),r||(r=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?ca(o,t-1,n,i,r):$l(r,o):i||(r[r.length]=o)}return r}var EM=zf(Object.getPrototypeOf,Object);const Ll=EM;var _M="[object Object]",SM=Function.prototype,OM=Object.prototype,Xf=SM.toString,TM=OM.hasOwnProperty,MM=Xf.call(Object);function CM(e){if(!Ue(e)||In(e)!=_M)return!1;var t=Ll(e);if(t===null)return!0;var n=TM.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Xf.call(n)==MM}function AM(){this.__data__=new tn,this.size=0}function $M(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function LM(e){return this.__data__.get(e)}function DM(e){return this.__data__.has(e)}var kM=200;function RM(e,t){var n=this.__data__;if(n instanceof tn){var i=n.__data__;if(!_r||i.length<kM-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new en(i)}return n.set(e,t),this.size=n.size,this}function Me(e){var t=this.__data__=new tn(e);this.size=t.size}Me.prototype.clear=AM,Me.prototype.delete=$M,Me.prototype.get=LM,Me.prototype.has=DM,Me.prototype.set=RM;function IM(e,t){return e&&yr(t,br(t),e)}function PM(e,t){return e&&yr(t,wr(t),e)}var Zf=typeof rt=="object"&&rt&&!rt.nodeType&&rt,Kf=Zf&&typeof module=="object"&&module&&!module.nodeType&&module,NM=Kf&&Kf.exports===Zf,Qf=NM?Te.Buffer:void 0,Jf=Qf?Qf.allocUnsafe:void 0;function tp(e,t){if(t)return e.slice();var n=e.length,i=Jf?Jf(n):new e.constructor(n);return e.copy(i),i}function UM(e,t){for(var n=-1,i=e==null?0:e.length,r=0,s=[];++n<i;){var a=e[n];t(a,n,e)&&(s[r++]=a)}return s}function ep(){return[]}var BM=Object.prototype,HM=BM.propertyIsEnumerable,np=Object.getOwnPropertySymbols,VM=np?function(e){return e==null?[]:(e=Object(e),UM(np(e),function(t){return HM.call(e,t)}))}:ep;const Dl=VM;function GM(e,t){return yr(e,Dl(e),t)}var FM=Object.getOwnPropertySymbols,zM=FM?function(e){for(var t=[];e;)$l(t,Dl(e)),e=Ll(e);return t}:ep;const ip=zM;function jM(e,t){return yr(e,ip(e),t)}function rp(e,t,n){var i=t(e);return Ft(e)?i:$l(i,n(e))}function kl(e){return rp(e,br,Dl)}function WM(e){return rp(e,wr,ip)}var qM=Nn(Te,"DataView");const Rl=qM;var YM=Nn(Te,"Promise");const Il=YM;var XM=Nn(Te,"Set");const bi=XM;var sp="[object Map]",ZM="[object Object]",ap="[object Promise]",op="[object Set]",lp="[object WeakMap]",cp="[object DataView]",KM=Pn(Rl),QM=Pn(_r),JM=Pn(Il),tC=Pn(bi),eC=Pn(_l),Hn=In;(Rl&&Hn(new Rl(new ArrayBuffer(1)))!=cp||_r&&Hn(new _r)!=sp||Il&&Hn(Il.resolve())!=ap||bi&&Hn(new bi)!=op||_l&&Hn(new _l)!=lp)&&(Hn=function(e){var t=In(e),n=t==ZM?e.constructor:void 0,i=n?Pn(n):"";if(i)switch(i){case KM:return cp;case QM:return sp;case JM:return ap;case tC:return op;case eC:return lp}return t});const wi=Hn;var nC=Object.prototype,iC=nC.hasOwnProperty;function rC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&iC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var sC=Te.Uint8Array;const ua=sC;function Pl(e){var t=new e.constructor(e.byteLength);return new ua(t).set(new ua(e)),t}function aC(e,t){var n=t?Pl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var oC=/\w*$/;function lC(e){var t=new e.constructor(e.source,oC.exec(e));return t.lastIndex=e.lastIndex,t}var up=me?me.prototype:void 0,hp=up?up.valueOf:void 0;function cC(e){return hp?Object(hp.call(e)):{}}function dp(e,t){var n=t?Pl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var uC="[object Boolean]",hC="[object Date]",dC="[object Map]",fC="[object Number]",pC="[object RegExp]",gC="[object Set]",mC="[object String]",vC="[object Symbol]",yC="[object ArrayBuffer]",xC="[object DataView]",bC="[object Float32Array]",wC="[object Float64Array]",EC="[object Int8Array]",_C="[object Int16Array]",SC="[object Int32Array]",OC="[object Uint8Array]",TC="[object Uint8ClampedArray]",MC="[object Uint16Array]",CC="[object Uint32Array]";function AC(e,t,n){var i=e.constructor;switch(t){case yC:return Pl(e);case uC:case hC:return new i(+e);case xC:return aC(e,n);case bC:case wC:case EC:case _C:case SC:case OC:case TC:case MC:case CC:return dp(e,n);case dC:return new i;case fC:case mC:return new i(e);case pC:return lC(e);case gC:return new i;case vC:return cC(e)}}function fp(e){return typeof e.constructor=="function"&&!ra(e)?bO(Ll(e)):{}}var $C="[object Map]";function LC(e){return Ue(e)&&wi(e)==$C}var pp=xi&&xi.isMap,DC=pp?Tl(pp):LC;const kC=DC;var RC="[object Set]";function IC(e){return Ue(e)&&wi(e)==RC}var gp=xi&&xi.isSet,PC=gp?Tl(gp):IC;const NC=PC;var UC=1,BC=2,HC=4,mp="[object Arguments]",VC="[object Array]",GC="[object Boolean]",FC="[object Date]",zC="[object Error]",vp="[object Function]",jC="[object GeneratorFunction]",WC="[object Map]",qC="[object Number]",yp="[object Object]",YC="[object RegExp]",XC="[object Set]",ZC="[object String]",KC="[object Symbol]",QC="[object WeakMap]",JC="[object ArrayBuffer]",t2="[object DataView]",e2="[object Float32Array]",n2="[object Float64Array]",i2="[object Int8Array]",r2="[object Int16Array]",s2="[object Int32Array]",a2="[object Uint8Array]",o2="[object Uint8ClampedArray]",l2="[object Uint16Array]",c2="[object Uint32Array]",Ot={};Ot[mp]=Ot[VC]=Ot[JC]=Ot[t2]=Ot[GC]=Ot[FC]=Ot[e2]=Ot[n2]=Ot[i2]=Ot[r2]=Ot[s2]=Ot[WC]=Ot[qC]=Ot[yp]=Ot[YC]=Ot[XC]=Ot[ZC]=Ot[KC]=Ot[a2]=Ot[o2]=Ot[l2]=Ot[c2]=!0,Ot[zC]=Ot[vp]=Ot[QC]=!1;function ha(e,t,n,i,r,s){var a,o=t&UC,c=t&BC,l=t&HC;if(n&&(a=r?n(e,i,r,s):n(e)),a!==void 0)return a;if(!ve(e))return e;var u=Ft(e);if(u){if(a=rC(e),!o)return Lf(e,a)}else{var h=wi(e),d=h==vp||h==jC;if(yi(e))return tp(e,o);if(h==yp||h==mp||d&&!r){if(a=c||d?{}:fp(e),!o)return c?jM(e,PM(a,e)):GM(e,IM(a,e))}else{if(!Ot[h])return r?e:{};a=AC(e,h,o)}}s||(s=new Me);var f=s.get(e);if(f)return f;s.set(e,a),NC(e)?e.forEach(function(g){a.add(ha(g,t,n,g,e,s))}):kC(e)&&e.forEach(function(g,v){a.set(v,ha(g,t,n,v,e,s))});var p=l?c?WM:kl:c?wr:br,m=u?void 0:p(e);return DO(m||e,function(g,v){m&&(v=g,g=e[v]),Df(a,v,ha(g,t,n,v,e,s))}),a}var u2=1,h2=4;function d2(e){return ha(e,u2|h2)}var f2="__lodash_hash_undefined__";function p2(e){return this.__data__.set(e,f2),this}function g2(e){return this.__data__.has(e)}function Or(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new en;++t<n;)this.add(e[t])}Or.prototype.add=Or.prototype.push=p2,Or.prototype.has=g2;function xp(e,t){for(var n=-1,i=e==null?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function bp(e,t){return e.has(t)}var m2=1,v2=2;function wp(e,t,n,i,r,s){var a=n&m2,o=e.length,c=t.length;if(o!=c&&!(a&&c>o))return!1;var l=s.get(e),u=s.get(t);if(l&&u)return l==t&&u==e;var h=-1,d=!0,f=n&v2?new Or:void 0;for(s.set(e,t),s.set(t,e);++h<o;){var p=e[h],m=t[h];if(i)var g=a?i(m,p,h,t,e,s):i(p,m,h,e,t,s);if(g!==void 0){if(g)continue;d=!1;break}if(f){if(!xp(t,function(v,b){if(!bp(f,b)&&(p===v||r(p,v,n,i,s)))return f.push(b)})){d=!1;break}}else if(!(p===m||r(p,m,n,i,s))){d=!1;break}}return s.delete(e),s.delete(t),d}function y2(e){var t=-1,n=Array(e.size);return e.forEach(function(i,r){n[++t]=[r,i]}),n}function Nl(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var x2=1,b2=2,w2="[object Boolean]",E2="[object Date]",_2="[object Error]",S2="[object Map]",O2="[object Number]",T2="[object RegExp]",M2="[object Set]",C2="[object String]",A2="[object Symbol]",$2="[object ArrayBuffer]",L2="[object DataView]",Ep=me?me.prototype:void 0,Ul=Ep?Ep.valueOf:void 0;function D2(e,t,n,i,r,s,a){switch(n){case L2:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case $2:return!(e.byteLength!=t.byteLength||!s(new ua(e),new ua(t)));case w2:case E2:case O2:return vr(+e,+t);case _2:return e.name==t.name&&e.message==t.message;case T2:case C2:return e==t+"";case S2:var o=y2;case M2:var c=i&x2;if(o||(o=Nl),e.size!=t.size&&!c)return!1;var l=a.get(e);if(l)return l==t;i|=b2,a.set(e,t);var u=wp(o(e),o(t),i,r,s,a);return a.delete(e),u;case A2:if(Ul)return Ul.call(e)==Ul.call(t)}return!1}var k2=1,R2=Object.prototype,I2=R2.hasOwnProperty;function P2(e,t,n,i,r,s){var a=n&k2,o=kl(e),c=o.length,l=kl(t),u=l.length;if(c!=u&&!a)return!1;for(var h=c;h--;){var d=o[h];if(!(a?d in t:I2.call(t,d)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var m=!0;s.set(e,t),s.set(t,e);for(var g=a;++h<c;){d=o[h];var v=e[d],b=t[d];if(i)var w=a?i(b,v,d,t,e,s):i(v,b,d,e,t,s);if(!(w===void 0?v===b||r(v,b,n,i,s):w)){m=!1;break}g||(g=d=="constructor")}if(m&&!g){var O=e.constructor,_=t.constructor;O!=_&&"constructor"in e&&"constructor"in t&&!(typeof O=="function"&&O instanceof O&&typeof _=="function"&&_ instanceof _)&&(m=!1)}return s.delete(e),s.delete(t),m}var N2=1,_p="[object Arguments]",Sp="[object Array]",da="[object Object]",U2=Object.prototype,Op=U2.hasOwnProperty;function B2(e,t,n,i,r,s){var a=Ft(e),o=Ft(t),c=a?Sp:wi(e),l=o?Sp:wi(t);c=c==_p?da:c,l=l==_p?da:l;var u=c==da,h=l==da,d=c==l;if(d&&yi(e)){if(!yi(t))return!1;a=!0,u=!1}if(d&&!u)return s||(s=new Me),a||sa(e)?wp(e,t,n,i,r,s):D2(e,t,c,n,i,r,s);if(!(n&N2)){var f=u&&Op.call(e,"__wrapped__"),p=h&&Op.call(t,"__wrapped__");if(f||p){var m=f?e.value():e,g=p?t.value():t;return s||(s=new Me),r(m,g,n,i,s)}}return d?(s||(s=new Me),P2(e,t,n,i,r,s)):!1}function fa(e,t,n,i,r){return e===t?!0:e==null||t==null||!Ue(e)&&!Ue(t)?e!==e&&t!==t:B2(e,t,n,i,fa,r)}var H2=1,V2=2;function G2(e,t,n,i){var r=n.length,s=r,a=!i;if(e==null)return!s;for(e=Object(e);r--;){var o=n[r];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++r<s;){o=n[r];var c=o[0],l=e[c],u=o[1];if(a&&o[2]){if(l===void 0&&!(c in e))return!1}else{var h=new Me;if(i)var d=i(l,u,c,e,t,h);if(!(d===void 0?fa(u,l,H2|V2,i,h):d))return!1}}return!0}function Tp(e){return e===e&&!ve(e)}function F2(e){for(var t=br(e),n=t.length;n--;){var i=t[n],r=e[i];t[n]=[i,r,Tp(r)]}return t}function Mp(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function z2(e){var t=F2(e);return t.length==1&&t[0][2]?Mp(t[0][0],t[0][1]):function(n){return n===e||G2(n,e,t)}}function j2(e,t){return e!=null&&t in Object(e)}function W2(e,t,n){t=Wf(t,e);for(var i=-1,r=t.length,s=!1;++i<r;){var a=la(t[i]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++i!=r?s:(r=e==null?0:e.length,!!r&&Ol(r)&&Sl(a,r)&&(Ft(e)||vi(e)))}function q2(e,t){return e!=null&&W2(e,t,j2)}var Y2=1,X2=2;function Z2(e,t){return Cl(e)&&Tp(t)?Mp(la(e),t):function(n){var i=St(n,e);return i===void 0&&i===t?q2(n,e):fa(t,i,Y2|X2)}}function K2(e){return function(t){return t==null?void 0:t[e]}}function Q2(e){return function(t){return qf(t,e)}}function J2(e){return Cl(e)?K2(la(e)):Q2(e)}function pa(e){return typeof e=="function"?e:e==null?bl:typeof e=="object"?Ft(e)?Z2(e[0],e[1]):z2(e):J2(e)}function tA(e){return function(t,n,i){for(var r=-1,s=Object(t),a=i(t),o=a.length;o--;){var c=a[e?o:++r];if(n(s[c],c,s)===!1)break}return t}}var eA=tA();const Cp=eA;function Bl(e,t,n){(n!==void 0&&!vr(e[t],n)||n===void 0&&!(t in e))&&ia(e,t,n)}function Hl(e){return Ue(e)&&Un(e)}function Vl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function nA(e){return yr(e,wr(e))}function iA(e,t,n,i,r,s,a){var o=Vl(e,n),c=Vl(t,n),l=a.get(c);if(l){Bl(e,n,l);return}var u=s?s(o,c,n+"",e,t,a):void 0,h=u===void 0;if(h){var d=Ft(c),f=!d&&yi(c),p=!d&&!f&&sa(c);u=c,d||f||p?Ft(o)?u=o:Hl(o)?u=Lf(o):f?(h=!1,u=tp(c,!0)):p?(h=!1,u=dp(c,!0)):u=[]:CM(c)||vi(c)?(u=o,vi(o)?u=nA(o):(!ve(o)||wl(o))&&(u=fp(c))):h=!1}h&&(a.set(c,u),r(u,c,i,s,a),a.delete(c)),Bl(e,n,u)}function Ap(e,t,n,i,r){e!==t&&Cp(t,function(s,a){if(r||(r=new Me),ve(s))iA(e,t,a,n,Ap,i,r);else{var o=i?i(Vl(e,a),s,a+"",e,t,r):void 0;o===void 0&&(o=s),Bl(e,a,o)}},wr)}function rA(e,t,n){for(var i=-1,r=e==null?0:e.length;++i<r;)if(n(t,e[i]))return!0;return!1}function sA(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var aA="[object Map]",oA="[object Set]",lA=Object.prototype,cA=lA.hasOwnProperty;function Ce(e){if(e==null)return!0;if(Un(e)&&(Ft(e)||typeof e=="string"||typeof e.splice=="function"||yi(e)||sa(e)||vi(e)))return!e.length;var t=wi(e);if(t==aA||t==oA)return!e.size;if(ra(e))return!jf(e).length;for(var n in e)if(cA.call(e,n))return!1;return!0}var uA=zO(function(e,t,n){Ap(e,t,n)});const nt=uA;var hA=1/0,dA=bi&&1/Nl(new bi([,-0]))[1]==hA?function(e){return new bi(e)}:EO;const fA=dA;var pA=200;function $p(e,t,n){var i=-1,r=NO,s=e.length,a=!0,o=[],c=o;if(n)a=!1,r=rA;else if(s>=pA){var l=t?null:fA(e);if(l)return Nl(l);a=!1,r=bp,c=new Or}else c=t?[]:o;t:for(;++i<s;){var u=e[i],h=t?t(u):u;if(u=n||u!==0?u:0,a&&h===h){for(var d=c.length;d--;)if(c[d]===h)continue t;t&&c.push(h),o.push(u)}else r(c,h,n)||(c!==o&&c.push(h),o.push(u))}return o}var gA=Rf(function(e){var t=sA(e);return Hl(t)&&(t=void 0),$p(ca(e,1,Hl,!0),pa(t))});const mA=gA;function vA(e){return e&&e.length?$p(e):[]}const nn=d2,Tr=vA;function yA(e,t,n){let i=null;return(...r)=>{const s=this;s.mousePosition=wn(r[0],n),clearTimeout(i),i=setTimeout(function(){e.apply(s,r)},t)}}function Ct(e,t){var n;const i=nn(e),r=Object.keys(t.axes||{});(n=t==null?void 0:t.toolbar)!=null&&n.controls&&delete i.toolbar.controls,r.length===0&&delete i.axes;for(const s in i.axes)if(r.includes(s)){const a=t.axes[s];if((a.primary||a.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format"),a.mapsTo==null){const c=a.scaleType;c==null?a.mapsTo="value":c===Z.TIME?a.mapsTo="date":c===Z.LABELS&&(a.mapsTo="key")}}else delete i.axes[s];return Gl(i,t),nt(i,t)}function rn(e){if(!e)return;const t=/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/,n=e.getAttribute("transform").match(t);if(!n)return null;if(n[0]){const i=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:i[0],ty:i[1]}}return null}function Mr(e){const t=/\(([^)]+)\)/.exec(e);if(t&&t.length>1){const n=t[1].split(",");if(n.length>1)return{x:parseFloat(n[0]),y:parseFloat(n[1])}}return{x:0,y:0}}function Lp(e,t,n="value"){const i=e/t.reduce((r,s)=>r+s[n],0)*100;return i%1!==0?parseFloat(i.toFixed(1)):i}function Cr(e,t,n){if(n>e.length)return e;if(t===Oe.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Oe.FRONT_LINE)return"..."+e.substr(-n);if(t===Oe.END_LINE)return e.substr(0,n)+"..."}function Gl(e,t){const n=E(e,"legend","additionalItems"),i=E(t,"legend","additionalItems");if(n&&i){const r=i.map(o=>o.type),s=n.map(o=>o.type),a=wf.filter(o=>s.includes(o.type)&&!r.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=mA(a,i,"name")}}const E=(e,...t)=>{let n=e;if(n){for(const i of t)if(n[i]!==null&&n[i]!==void 0)n=n[i];else return null;return n}return null},Dp=(e,t)=>t===Ht.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,Jt=(e,t)=>{const{x0:n,x1:i,y0:r,y1:s}=Dp(e,t);return`M${n},${r}L${n},${s}L${i},${s}L${i},${r}L${n},${r}`};function sn(e,t,n){return n===Ht.VERTICAL?[e,t]:[t,e]}const Ei={type:Oe.END_LINE,threshold:16,numCharacter:14},xA={enabled:!0,position:hr.BOTTOM,clickable:!0,truncation:Ei,alignment:It.LEFT,order:null,additionalItems:[]},kp={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},Rp={enabled:!0},Fl={enabled:!0,showTotal:!0,truncation:Ei,groupLabel:"Group"},Ip={top:{visible:!0,includeZero:!0,truncation:Ei},bottom:{visible:!0,includeZero:!0,truncation:Ei},left:{visible:!0,includeZero:!0,truncation:Ei},right:{visible:!0,includeZero:!0,truncation:Ei}},Ar={addSpaceOnEdges:1,showDayName:!1,localeObject:yf,timeIntervalFormats:{"15seconds":{primary:"MMM d, pp",secondary:"pp"},minute:{primary:"MMM d, p",secondary:"p"},"30minutes":{primary:"MMM d, p",secondary:"p"},hourly:{primary:"MMM d, hh a",secondary:"hh a"},daily:{primary:"MMM d",secondary:"d"},weekly:{primary:"eee, MMM d",secondary:"eee"},monthly:{primary:"MMM yyyy",secondary:"MMM"},quarterly:{primary:"QQQ ''yy",secondary:"QQQ"},yearly:{primary:"yyyy",secondary:"yyyy"}}},bA=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),Zt={width:null,height:null,resizable:!0,theme:uf.WHITE,tooltip:Fl,legend:xA,style:{prefix:"cc"},data:{groupMapsTo:"group",loading:!1,selectedGroups:[]},color:{scale:null,pairing:{numberOfVariants:null,option:1},gradient:{enabled:!1}},toolbar:{enabled:!0,numberOfIcons:3,controls:[{type:$t.SHOW_AS_DATATABLE},...bA?[{type:$t.MAKE_FULLSCREEN}]:[],{type:$t.EXPORT_CSV},{type:$t.EXPORT_PNG},{type:$t.EXPORT_JPG}]}},Pp=nt({},Zt,{thematic:{projection:Je.geoNaturalEarth1}}),$r=nt({},Zt,{axes:Ip,timeScale:Ar,grid:kp,ruler:Rp,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ie.GRAPH_VIEW}}}),Vn=nt({},$r,{bars:{maxWidth:16,spacingFactor:.25},timeScale:nt(Ar,{addSpaceOnEdges:1})}),wA=nt({},Vn,{}),EA=nt({},Vn,{}),_A=nt({},Vn,{bars:nt({},Vn.bars,{dividerSize:1.5})}),SA=nt({},Vn,{}),zl=nt({},$r,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),OA=zl,Np=nt({},zl,{points:{radius:3,filled:!1,enabled:!0}}),Up=nt({},Np,{timeScale:nt(Ar,{addSpaceOnEdges:0})}),TA=Up,MA=nt({},$r,{bubble:{radiusMapsTo:"radius",radiusLabel:"Radius",radiusRange:e=>{const t=Math.min(e.width,e.height);return[t*3/400,t*25/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:Nt.RADIUS,name:"Radius"}]}}),CA=nt({},$r,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Nt.AREA,name:"Poor area"},{type:Nt.AREA,name:"Satisfactory area"},{type:Nt.AREA,name:"Great area"},{type:Nt.QUARTILE,name:"Quartiles"}]}}),AA=nt({},Vn,{bars:{dividerSize:1.5},timeScale:nt(Ar,{addSpaceOnEdges:0})}),$A=nt({},Zt,{tooltip:nt({},Fl,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:e=>{const t=Math.min(e.width,e.height);return[t*20/400,t*75/400]},wordMapsTo:"word"}}),Bp=nt({},Zt,{pie:{labels:{formatter:null,enabled:!0},alignment:It.LEFT,sortFunction:null,valueMapsTo:"value"}}),LA=nt({},Zt,{legend:{enabled:!1},gauge:{type:di.SEMI,arcWidth:16,deltaArrow:{size:e=>e/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:e=>e/8,valueFontSize:e=>e/2.5,numberFormatter:e=>Number(e.toFixed(2))%1!==0?e.toFixed(2).toLocaleString():e.toFixed().toLocaleString(),alignment:It.LEFT}}),DA=nt({},Bp,{donut:{center:{numberFontSize:e=>`${Math.min(e/100*24,24)}px`,titleFontSize:e=>`${Math.min(e/100*15,15)}px`,titleYPosition:e=>Math.min(e/80*20,20),numberFormatter:e=>Math.floor(e).toLocaleString()},alignment:It.LEFT}}),Hp=nt({},Zt,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),kA=nt({},Hp,{legend:{enabled:!0}}),RA=nt({},Zt,{radar:{axes:{angle:"key",value:"value"},alignment:It.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:e=>e??"N/A"}}),IA=nt({},Vn,{comboChartTypes:[]}),PA=nt({tree:{type:hl.TREE}},Zt,{}),NA=nt({},Zt,{data:nt(Zt.data,{groupMapsTo:"name"})}),UA=nt({},Zt,Rn,{data:nt(Zt.data,{groupMapsTo:"name"})}),BA=nt({},Zt,{alluvial:{data:nt(Zt.data,{groupMapsTo:"source"}),nodeAlignment:It.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),HA=nt({},Zt,{axes:Ip,heatmap:{divider:{state:fr.AUTO},colorLegend:{type:"linear"}}}),VA=nt({},Pp,{choropleth:{colorLegend:{type:"linear"}}}),wt={alluvialChart:BA,areaChart:Up,axisChart:$r,boxplotChart:SA,bubbleChart:MA,bulletChart:CA,chart:Zt,circlePackChart:UA,choroplethChart:VA,comboChart:IA,donutChart:DA,gaugeChart:LA,groupedBarChart:EA,heatmapChart:HA,histogramChart:AA,lineChart:Np,lollipopChart:OA,meterChart:Hp,pieChart:Bp,proportionalMeterChart:kA,radarChart:RA,scatterChart:zl,simpleBarChart:wA,stackedAreaChart:TA,stackedBarChart:_A,thematicChart:Pp,treeChart:PA,treemapChart:NA,wordCloudChart:$A},Vp=Object.freeze(Object.defineProperty({__proto__:null,alluvial:ge,area:Pe,axis:gi,baseTooltip:Fl,boxplot:ue,canvasZoomSettings:mi,carbonPrefix:Qt,circlePack:Rn,color:ml,defaultLegendAdditionalItems:wf,grid:kp,heatmap:vl,histogram:xf,legend:Lt,lines:Ne,meter:Vt,options:wt,pie:Et,radar:fn,ruler:Rp,spacers:yl,timeScale:Ar,toolbar:BS,tooltips:bf,transitions:xl,zoomBar:ie},Symbol.toStringTag,{value:"Module"}));var Gp=(e=>(e["15seconds"]="15seconds",e.minute="minute",e["30minutes"]="30minutes",e.hourly="hourly",e.daily="daily",e.weekly="weekly",e.monthly="monthly",e.quarterly="quarterly",e.yearly="yearly",e))(Gp||{});const jl=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",30*60*1e3],["hourly",60*60*1e3],["daily",24*60*60*1e3],["monthly",30*24*60*60*1e3],["quarterly",3*30*24*60*60*1e3],["yearly",12*30*24*60*60*1e3]];function Fp(e,t,n,i,r){const s=t===0,a=Number(pi(new Date(e),"c"))===2,o=Number(pi(new Date(e),"q"))===1,c=t!==0?n[t-1]:null;switch(i){case"15seconds":return s||ma(e)||Lr(e,c)||pn(e);case"minute":return s||ma(e)||Lr(e,c)||pn(e);case"30minutes":return s||ma(e)||Lr(e,c)||pn(e);case"hourly":return s||ma(e)||Lr(e,c)||pn(e);case"daily":return r?s||a||pn(e):s||Lr(e,c)||pn(e);case"weekly":return s||a||pn(e);case"monthly":return s||pn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${i} is not a valid time interval.`)}}function Wl(e,t,n,i,r){const s=r.showDayName,a=i==="daily"&&s?"weekly":i,o=new Date(e),c=E(r,"timeIntervalFormats")[a],l=E(c,"primary"),u=E(c,"secondary");let h=Fp(e,t,n,i,s)?l:u;i==="15seconds"&&o.getMilliseconds()!==0&&(h=h.replace("pp","h:mm:ss.SSS a"));const d=r.localeObject;return pi(o,h,{locale:d})}function ga(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function GA(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function FA(e){const t=jl.reduce((n,[,i],r)=>{const s=jl[n][1],a=Math.abs(s-e),o=Math.abs(i-e);return a<o?n:r},0);return jl[t][0]}function ql(e,t){if(Gp[t])return t;if(e.length===1)return"15seconds";const n=GA(e),i=ln(n);return FA(i)}function ma(e){const{s:t,m:n,H:i}=ga(e);return i===0&&n===0&&t===0}function Lr(e,t){const n=ga(e).M,i=ga(t).M;return n!==i}function pn(e){const{M:t,d:n,s:i,m:r,H:s}=ga(e);return t===1&&n===1&&s===0&&r===0&&i===0}function zp(e){return e===void 0?"":e.toISOString()}var zA=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wp={exports:{}};/*! dom-to-image-more 26-04-2023 */(function(e,t){(function(n){const i=function(){let S=0;return{escape:function(x){return x.replace(/([.*+?^${}()|[]\/\\])/g,"\\$1")},isDataUrl:function(x){return x.search(/^(data:)/)!==-1},canvasToBlob:function(x){return x.toBlob?new Promise(function(A){x.toBlob(A)}):function(A){return new Promise(function(y){var k=f(A.toDataURL().split(",")[1]),R=k.length,U=new Uint8Array(R);for(let N=0;N<R;N++)U[N]=k.charCodeAt(N);y(new Blob([U],{type:"image/png"}))})}(x)},resolveUrl:function(x,A){var y=document.implementation.createHTMLDocument(),k=y.createElement("base"),R=(y.head.appendChild(k),y.createElement("a"));return y.body.appendChild(R),k.href=A,R.href=x,R.href},getAndEncode:function(x){let A=u.impl.urlCache.find(function(y){return y.url===x});return A||(A={url:x,promise:null},u.impl.urlCache.push(A)),A.promise===null&&(u.impl.options.cacheBust&&(x+=(/\?/.test(x)?"&":"?")+new Date().getTime()),A.promise=new Promise(function(y){const k=u.impl.options.httpTimeout,R=new XMLHttpRequest;R.onreadystatechange=function(){if(R.readyState===4)if(R.status!==200)U?y(U):F(`cannot fetch resource: ${x}, status: `+R.status);else{const z=new FileReader;z.onloadend=function(){y(z.result)},z.readAsDataURL(R.response)}},R.ontimeout=function(){U?y(U):F(`timeout of ${k}ms occured while fetching resource: `+x)},R.responseType="blob",R.timeout=k,u.impl.options.useCredentials&&(R.withCredentials=!0),R.open("GET",x,!0),R.send();let U;var N;function F(z){console.error(z),y("")}u.impl.options.imagePlaceholder&&(N=u.impl.options.imagePlaceholder.split(/,/))&&N[1]&&(U=N[1])})),A.promise},uid:function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+S++},delay:function(x){return function(A){return new Promise(function(y){setTimeout(function(){y(A)},x)})}},asArray:function(x){var A=[],y=x.length;for(let k=0;k<y;k++)A.push(x[k]);return A},escapeXhtml:function(x){return x.replace(/%/g,"%25").replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(x){return x!=="data:,"?new Promise(function(A,y){const k=new Image;u.impl.options.useCredentials&&(k.crossOrigin="use-credentials"),k.onload=function(){window&&window.requestAnimationFrame?window.requestAnimationFrame(function(){A(k)}):A(k)},k.onerror=y,k.src=x}):Promise.resolve()},width:function(x){var A=B(x,"width");if(!isNaN(A))return A;var A=B(x,"border-left-width"),y=B(x,"border-right-width");return x.scrollWidth+A+y},height:function(x){var A=B(x,"height");if(!isNaN(A))return A;var A=B(x,"border-top-width"),y=B(x,"border-bottom-width");return x.scrollHeight+A+y},getWindow:$,isElement:M,isElementHostForOpenShadowRoot:function(x){return M(x)&&x.shadowRoot!==null},isShadowRoot:D,isInShadowRoot:L,isHTMLElement:function(x){return x instanceof $(x).HTMLElement},isHTMLCanvasElement:function(x){return x instanceof $(x).HTMLCanvasElement},isHTMLInputElement:function(x){return x instanceof $(x).HTMLInputElement},isHTMLImageElement:function(x){return x instanceof $(x).HTMLImageElement},isHTMLLinkElement:function(x){return x instanceof $(x).HTMLLinkElement},isHTMLScriptElement:function(x){return x instanceof $(x).HTMLScriptElement},isHTMLStyleElement:function(x){return x instanceof $(x).HTMLStyleElement},isHTMLTextAreaElement:function(x){return x instanceof $(x).HTMLTextAreaElement},isShadowSlotElement:function(x){return L(x)&&x instanceof $(x).HTMLSlotElement},isSVGElement:function(x){return x instanceof $(x).SVGElement},isSVGRectElement:function(x){return x instanceof $(x).SVGRectElement},isDimensionMissing:function(x){return isNaN(x)||x<=0}};function $(x){return x=x?x.ownerDocument:void 0,(x?x.defaultView:void 0)||n||window}function D(x){return x instanceof $(x).ShadowRoot}function L(x){return x!==null&&Object.prototype.hasOwnProperty.call(x,"getRootNode")&&D(x.getRootNode())}function M(x){return x instanceof $(x).Element}function B(x,A){if(x.nodeType===h){let y=d(x).getPropertyValue(A);if(y.slice(-2)==="px")return y=y.slice(0,-2),parseFloat(y)}return NaN}}(),r=function(){const S=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(M,B,x){return $(M)?Promise.resolve(M).then(D).then(function(A){let y=Promise.resolve(M);return A.forEach(function(k){y=y.then(function(R){return L(R,k,B,x)})}),y}):Promise.resolve(M)},shouldProcess:$,impl:{readUrls:D,inline:L}};function $(M){return M.search(S)!==-1}function D(M){for(var B,x=[];(B=S.exec(M))!==null;)x.push(B[1]);return x.filter(function(A){return!i.isDataUrl(A)})}function L(M,B,x,A){return Promise.resolve(B).then(function(y){return x?i.resolveUrl(y,x):y}).then(A||i.getAndEncode).then(function(y){return M.replace((k=B,new RegExp(`(url\\(['"]?)(${i.escape(k)})(['"]?\\))`,"g")),`$1${y}$3`);var k})}}(),s={resolveAll:function(){return a().then(function(S){return Promise.all(S.map(function($){return $.resolve()}))}).then(function(S){return S.join(`
2
- `)})},impl:{readAll:a}};function a(){return Promise.resolve(i.asArray(document.styleSheets)).then(function($){const D=[];return $.forEach(function(L){if(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(L),"cssRules"))try{i.asArray(L.cssRules||[]).forEach(D.push.bind(D))}catch(M){console.error("domtoimage: Error while reading CSS rules from "+L.href,M.toString())}}),D}).then(function($){return $.filter(function(D){return D.type===CSSRule.FONT_FACE_RULE}).filter(function(D){return r.shouldProcess(D.style.getPropertyValue("src"))})}).then(function($){return $.map(S)});function S($){return{resolve:function(){var D=($.parentStyleSheet||{}).href;return r.inlineAll($.cssText,D)},src:function(){return $.style.getPropertyValue("src")}}}}const o={inlineAll:function S($){if(!i.isElement($))return Promise.resolve($);return D($).then(function(){return i.isHTMLImageElement($)?c($).inline():Promise.all(i.asArray($.childNodes).map(function(L){return S(L)}))});function D(L){const M=["background","background-image"],B=M.map(function(x){const A=L.style.getPropertyValue(x),y=L.style.getPropertyPriority(x);return A?r.inlineAll(A).then(function(k){L.style.setProperty(x,k,y)}):Promise.resolve()});return Promise.all(B).then(function(){return L})}},impl:{newImage:c}};function c(S){return{inline:function($){return i.isDataUrl(S.src)?Promise.resolve():Promise.resolve(S.src).then($||i.getAndEncode).then(function(D){return new Promise(function(L){S.onload=L,S.onerror=L,S.src=D})})}}}const l={copyDefaultStyles:!0,imagePlaceholder:void 0,cacheBust:!1,useCredentials:!1,httpTimeout:3e4,styleCaching:"strict"},u={toSvg:p,toPng:function(S,$){return m(S,$).then(function(D){return D.toDataURL()})},toJpeg:function(S,$){return m(S,$).then(function(D){return D.toDataURL("image/jpeg",($?$.quality:void 0)||1)})},toBlob:function(S,$){return m(S,$).then(i.canvasToBlob)},toPixelData:function(S,$){return m(S,$).then(function(D){return D.getContext("2d").getImageData(0,0,i.width(S),i.height(S)).data})},toCanvas:m,impl:{fontFaces:s,images:o,util:i,inliner:r,urlCache:[],options:{}}},h=(e.exports=u,(typeof Node<"u"?Node.ELEMENT_NODE:void 0)||1),d=(n!==void 0?n.getComputedStyle:void 0)||(typeof window<"u"?window.getComputedStyle:void 0)||globalThis.getComputedStyle,f=(n!==void 0?n.atob:void 0)||(typeof window<"u"?window.atob:void 0)||globalThis.atob;function p(S,$){u.impl.util.getWindow(S);var D=$=$||{};D.copyDefaultStyles===void 0?u.impl.options.copyDefaultStyles=l.copyDefaultStyles:u.impl.options.copyDefaultStyles=D.copyDefaultStyles,D.imagePlaceholder===void 0?u.impl.options.imagePlaceholder=l.imagePlaceholder:u.impl.options.imagePlaceholder=D.imagePlaceholder,D.cacheBust===void 0?u.impl.options.cacheBust=l.cacheBust:u.impl.options.cacheBust=D.cacheBust,D.useCredentials===void 0?u.impl.options.useCredentials=l.useCredentials:u.impl.options.useCredentials=D.useCredentials,D.httpTimeout===void 0?u.impl.options.httpTimeout=l.httpTimeout:u.impl.options.httpTimeout=D.httpTimeout,D.styleCaching===void 0?u.impl.options.styleCaching=l.styleCaching:u.impl.options.styleCaching=D.styleCaching;let L=[];return Promise.resolve(S).then(function(M){if(M.nodeType===h)return M;var B=M,x=M.parentNode,A=document.createElement("span");return x.replaceChild(A,B),A.append(M),L.push({parent:x,child:B,wrapper:A}),A}).then(function(M){return function B(x,A,y,k){const R=A.filter;if(x===g||i.isHTMLScriptElement(x)||i.isHTMLStyleElement(x)||i.isHTMLLinkElement(x)||y!==null&&R&&!R(x))return Promise.resolve();return Promise.resolve(x).then(U).then(function(G){return F(G,N(x))}).then(function(G){return z(G,x)});function U(G){return i.isHTMLCanvasElement(G)?i.makeImage(G.toDataURL()):G.cloneNode(!1)}function N(G){return i.isElementHostForOpenShadowRoot(G)?G.shadowRoot:G}function F(G,Q){const j=tt(Q);let X=Promise.resolve();if(j.length!==0){const lt=d(ot(Q));i.asArray(j).forEach(function(W){X=X.then(function(){return B(W,A,lt).then(function(q){q&&G.appendChild(q)})})})}return X.then(function(){return G});function ot(lt){return i.isShadowRoot(lt)?lt.host:lt}function tt(lt){return i.isShadowSlotElement(lt)?lt.assignedNodes():lt.childNodes}}function z(G,Q){return!i.isElement(G)||i.isShadowSlotElement(Q)?Promise.resolve(G):Promise.resolve().then(j).then(X).then(ot).then(tt).then(function(){return G});function j(){function lt(q,Y){Y.font=q.font,Y.fontFamily=q.fontFamily,Y.fontFeatureSettings=q.fontFeatureSettings,Y.fontKerning=q.fontKerning,Y.fontSize=q.fontSize,Y.fontStretch=q.fontStretch,Y.fontStyle=q.fontStyle,Y.fontVariant=q.fontVariant,Y.fontVariantCaps=q.fontVariantCaps,Y.fontVariantEastAsian=q.fontVariantEastAsian,Y.fontVariantLigatures=q.fontVariantLigatures,Y.fontVariantNumeric=q.fontVariantNumeric,Y.fontVariationSettings=q.fontVariationSettings,Y.fontWeight=q.fontWeight}function W(q,Y){const V=d(q);V.cssText?(Y.style.cssText=V.cssText,lt(V,Y.style)):(w(A,q,V,y,Y),y===null&&(["inset-block","inset-block-start","inset-block-end"].forEach(xt=>Y.style.removeProperty(xt)),["left","right","top","bottom"].forEach(xt=>{Y.style.getPropertyValue(xt)&&Y.style.setProperty(xt,"0px")})))}W(Q,G)}function X(){const lt=i.uid();function W(q){const Y=d(Q,q),V=Y.getPropertyValue("content");if(V!==""&&V!=="none"){let xt=function(){const jt=`.${lt}:`+q,et=(Y.cssText?At:zn)();return document.createTextNode(jt+`{${et}}`);function At(){return`${Y.cssText} content: ${V};`}function zn(){return i.asArray(Y).map(Ve).join("; ")+";";function Ve($c){const gU=Y.getPropertyValue($c),mU=Y.getPropertyPriority($c)?" !important":"";return $c+": "+gU+mU}}};const pt=G.getAttribute("class")||"",Gt=(G.setAttribute("class",pt+" "+lt),document.createElement("style"));Gt.appendChild(xt()),G.appendChild(Gt)}}[":before",":after"].forEach(function(q){W(q)})}function ot(){i.isHTMLTextAreaElement(Q)&&(G.innerHTML=Q.value),i.isHTMLInputElement(Q)&&G.setAttribute("value",Q.value)}function tt(){i.isSVGElement(G)&&(G.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.isSVGRectElement(G))&&["width","height"].forEach(function(lt){const W=G.getAttribute(lt);W&&G.style.setProperty(lt,W)})}}}(M,$,null)}).then(v).then(b).then(function(M){$.bgcolor&&(M.style.backgroundColor=$.bgcolor),$.width&&(M.style.width=$.width+"px"),$.height&&(M.style.height=$.height+"px"),$.style&&Object.keys($.style).forEach(function(x){M.style[x]=$.style[x]});let B=null;return typeof $.onclone=="function"&&(B=$.onclone(M)),Promise.resolve(B).then(function(){return M})}).then(function(M){let B=$.width||i.width(M),x=$.height||i.height(M);return Promise.resolve(M).then(function(A){return A.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(A)}).then(i.escapeXhtml).then(function(A){var y=(i.isDimensionMissing(B)?' width="100%"':` width="${B}"`)+(i.isDimensionMissing(x)?' height="100%"':` height="${x}"`);return`<svg xmlns="http://www.w3.org/2000/svg"${(i.isDimensionMissing(B)?"":` width="${B}"`)+(i.isDimensionMissing(x)?"":` height="${x}"`)}><foreignObject${y}>${A}</foreignObject></svg>`}).then(function(A){return"data:image/svg+xml;charset=utf-8,"+A})}).then(function(M){for(;0<L.length;){var B=L.pop();B.parent.replaceChild(B.child,B.wrapper)}return M}).then(function(M){return u.impl.urlCache=[],function(){g&&(document.body.removeChild(g),g=null),O&&clearTimeout(O),O=setTimeout(()=>{O=null,_={}},2e4)}(),M})}function m(S,$){return p(S,$=$||{}).then(i.makeImage).then(function(D){var L=typeof $.scale!="number"?1:$.scale,M=function(x,A){let y=$.width||i.width(x),k=$.height||i.height(x);return i.isDimensionMissing(y)&&(y=i.isDimensionMissing(k)?300:2*k),i.isDimensionMissing(k)&&(k=y/2),x=document.createElement("canvas"),x.width=y*A,x.height=k*A,$.bgcolor&&((A=x.getContext("2d")).fillStyle=$.bgcolor,A.fillRect(0,0,x.width,x.height)),x}(S,L),B=M.getContext("2d");return B.msImageSmoothingEnabled=!1,B.imageSmoothingEnabled=!1,D&&(B.scale(L,L),B.drawImage(D,0,0)),M})}let g=null;function v(S){return s.resolveAll().then(function($){var D;return $!==""&&(D=document.createElement("style"),S.appendChild(D),D.appendChild(document.createTextNode($))),S})}function b(S){return o.inlineAll(S).then(function(){return S})}function w(S,$,D,L,M){const B=u.impl.options.copyDefaultStyles?function(A,R){var R=function(N){var F=[];do if(N.nodeType===h){var z=N.tagName;if(F.push(z),T.includes(z))break}while(N=N.parentNode,N);return F}(R),k=function(N){return(A.styleCaching!=="relaxed"?N:N.filter((F,z,G)=>z===0||z===G.length-1)).join(">")}(R);if(_[k])return _[k];var U=function(){if(g)return g.contentWindow;var N=document.characterSet||"UTF-8",F=document.doctype,F=F?(`<!DOCTYPE ${z(F.name)} ${z(F.publicId)} `+z(F.systemId)).trim()+">":"";return(g=document.createElement("iframe")).id="domtoimage-sandbox-"+i.uid(),g.style.visibility="hidden",g.style.position="fixed",document.body.appendChild(g),function(G,Q,j,X){try{return G.contentWindow.document.write(Q+`<html><head><meta charset='${j}'><title>${X}</title></head><body></body></html>`),G.contentWindow}catch{}var ot=document.createElement("meta");ot.setAttribute("charset",j);try{var tt=document.implementation.createHTMLDocument(X),lt=(tt.head.appendChild(ot),Q+tt.documentElement.outerHTML);return G.setAttribute("srcdoc",lt),G.contentWindow}catch{}return G.contentDocument.head.appendChild(ot),G.contentDocument.title=X,G.contentWindow}(g,F,N,"domtoimage-sandbox");function z(G){var Q;return G?((Q=document.createElement("div")).innerText=G,Q.innerHTML):""}}(),R=function(N,F){let z=N.body;do{var G=F.pop(),G=N.createElement(G);z.appendChild(G),z=G}while(0<F.length);return z.textContent="​",z}(U.document,R),U=function(N,F){const z={},G=N.getComputedStyle(F);return i.asArray(G).forEach(function(Q){z[Q]=Q==="width"||Q==="height"?"auto":G.getPropertyValue(Q)}),z}(U,R);return function(N){do{var F=N.parentElement;F!==null&&F.removeChild(N),N=F}while(N&&N.tagName!=="BODY")}(R),_[k]=U}(S,$):{},x=M.style;i.asArray(D).forEach(function(A){var y,k=D.getPropertyValue(A),R=B[A],U=L?L.getPropertyValue(A):void 0;(k!==R||L&&k!==U)&&(R=D.getPropertyPriority(A),U=x,k=k,R=R,y=0<=["background-clip"].indexOf(A=A),R?(U.setProperty(A,k,R),y&&U.setProperty("-webkit-"+A,k,R)):(U.setProperty(A,k),y&&U.setProperty("-webkit-"+A,k)))})}let O=null,_={};const T=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DETAILS","DIALOG","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","SVG","TABLE","UL","math","svg","BODY","HEAD","HTML"]})(zA)})(Wp);var jA=Wp.exports;const qp=jp(jA);function Yp(e){const t=xe(e,i=>i.value),n=Se().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}function Xp(e,t){const n=E(t,"gradient","colors"),i=!Ce(n);let r=E(t,"pairing","option");const s=Yp(e),a=s[0]<0&&s[1]>0?"diverge":"mono";(r<1&&r>4&&a==="mono"||r<1&&r>2&&a==="diverge")&&(r=1);const o=i?n:[];if(!i){const c=a==="diverge"?17:11;for(let l=1;l<c+1;l++)o.push(`fill-${a}-${r}-${l}`)}return zo().domain(s).range(o)}var at=(e=>(e.GRAPHICS_DOCUMENT="graphics-document",e.GRAPHICS_OBJECT="graphics-object",e.GRAPHICS_SYMBOL="graphics-symbol",e.GROUP="group",e.DOCUMENT="document",e.CHECKBOX="checkbox",e.BUTTON="button",e.MENU="menu",e.MENU_ITEM="menuitem",e.IMG="img",e))(at||{});function WA(e,t){return e&&Cp(e,t,br)}function qA(e,t){return function(n,i){if(n==null)return n;if(!Un(n))return e(n,i);for(var r=n.length,s=t?r:-1,a=Object(n);(t?s--:++s<r)&&i(a[s],s,a)!==!1;);return n}}var YA=qA(WA);const Yl=YA;function XA(e,t,n,i){for(var r=-1,s=e==null?0:e.length;++r<s;){var a=e[r];t(i,a,n(a),e)}return i}function ZA(e,t,n,i){return Yl(e,function(r,s,a){t(i,r,n(r),a)}),i}function KA(e,t){return function(n,i){var r=Ft(n)?XA:ZA,s=t?t():{};return r(n,e,pa(i),s)}}function QA(e){for(var t=-1,n=e==null?0:e.length,i={};++t<n;){var r=e[t];i[r[0]]=r[1]}return i}var JA=Object.prototype,t$=JA.hasOwnProperty,e$=KA(function(e,t,n){t$.call(e,n)?e[n].push(t):ia(e,n,[t])});const n$=e$;class Be{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let i=this.getData();const r=this.getDataGroups(),{groupMapsTo:s}=E(n,"data"),a=E(n,"axes");return t&&(i=i.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const c=a[o].mapsTo,l=a[o].scaleType;if((l===Z.LINEAR||l===Z.LOG)&&(i=i.map(u=>({...u,[c]:u[c]===null?u[c]:Number(u[c])}))),c&&a[o].domain)if(l===Z.LABELS)i=i.filter(u=>a[o].domain.includes(u[c]));else{const[u,h]=a[o].domain;i=i.filter(d=>!(c in d)||d[c]>=u&&d[c]<=h)}}),i.filter(o=>r.find(c=>c.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Lt.items.status,i=this.getDataGroups(t),{groupMapsTo:r}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(s=>i.find(a=>a.name===s[r]&&a.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(nn(t)),i=this.generateDataGroups(n);return this.set({data:n,dataGroups:i}),n}getDataGroups(t){return E(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Lt.items.status;return this.getDataGroups(t).filter(i=>i.status===n)}getDataGroupNames(t){return this.getDataGroups(t).map(n=>n.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(n=>n.name)}aggregateBinDataByGroup(t){return n$(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),i=this.services.cartesianScales.getMainXAxisPosition(),r=this.services.cartesianScales.getDomainIdentifier(),s=n.axes[i],{groupMapsTo:a}=n.data,{bins:o=xf.defaultBins}=s,c=Array.isArray(o),l=bv().value(f=>f[r]).thresholds(o)(t);if(c)l[l.length-1].x1=o[o.length-1];else{const f=l[0].x1-l[0].x0;l[l.length-1].x1=+l[l.length-1].x0+f}const u=c?[o[0],o[o.length-1]]:[l[0].x0,l[l.length-1].x1],h=Array.from(new Set(t.map(f=>f[a]))),d=[];return l.forEach(f=>{const p=`${f.x0}-${f.x1}`,m=this.aggregateBinDataByGroup(f);h.forEach(g=>{d.push({group:g,key:p,value:m[g]||0,bin:f.x0})})}),{bins:l,binsDomain:u}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this.getActiveDataGroupNames(),{bins:r}=this.getBinConfigurations(),s=this.getDataValuesGroupedByKeys({bins:r});return ul().keys(i)(s).map((a,o)=>Object.keys(a).filter(c=>!isNaN(c)).map(c=>{const l=a[c];return l[n]=i[o],l}))}getGroupedData(t){const n=this.getDisplayData(t),i={},{groupMapsTo:r}=this.getOptions().data;return n.map(s=>{const a=s[r];i[a]!==null&&i[a]!==void 0?i[a].push(s):i[a]=[s]}),Object.keys(i).map(s=>({name:s,data:i[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const i=this.getOptions(),r=this.getDisplayData(n);let s;t?s=t.map(c=>`${c.x0}-${c.x1}`):s=Tr(r.map(c=>{const l=this.services.cartesianScales.getDomainIdentifier(c);return c[l]instanceof Date?zp(c[l]):c[l]&&typeof c[l].toString=="function"?c[l].toString():c[l]}));const a=this.services.cartesianScales.domainAxisPosition,o=i.axes[a].scaleType;return o===Z.TIME?s.sort((c,l)=>{const u=new Date(c),h=new Date(l);return u-h}):(o===Z.LOG||o===Z.LINEAR)&&s.sort((c,l)=>c-l),s}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const i=this.getOptions(),{groupMapsTo:r}=i.data,s=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:t,groups:n});return t?o.map(c=>{const[l,u]=c.split("-"),h={x0:l,x1:u},d=t.find(f=>f.x0.toString()===l.toString());return a.forEach(f=>{h[f]=d.filter(p=>p[r]===f).length}),h}):o.map(c=>{const l={sharedStackKey:c};return a.forEach(u=>{const h=s.find(f=>{const p=this.services.cartesianScales.getDomainIdentifier(f);return f[r]===u&&Object.prototype.hasOwnProperty.call(f,p)&&(f[p]instanceof Date?zp(f[p])===c:f[p].toString()===c)}),d=this.services.cartesianScales.getRangeIdentifier(l);l[u]=h?h[d]:null}),l})}getStackedData({percentage:t=!1,groups:n=null,divergent:i=!1}){const r=this.getOptions(),{groupMapsTo:s}=r.data,a=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const c=QA(o.map(l=>[l.sharedStackKey,0]));o.forEach(l=>{a.forEach(u=>{c[l.sharedStackKey]+=l[u]})}),o.forEach(l=>{a.forEach(u=>{const h=c[l.sharedStackKey];c[l.sharedStackKey]?l[u]=l[u]/h*100:l[u]=0})})}return(i?ul().offset(T_):ul()).keys(a)(o).map((c,l)=>Object.keys(c).filter(u=>!isNaN(u)).map(u=>{const h=c[u];return h[s]=a[l],h}))}getOptions(){return this.state.options}set(t,n){this.state=Object.assign({},this.state,t);const i=Object.assign({skipUpdate:!1,animate:!0},n);i.skipUpdate||this.update(i.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const n=this.getOptions();Gl(n,t),this.set({options:nt(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(C.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:i}=Lt.items.status,r=this.getDataGroups(),s=r.some(l=>l.status===i),a=r.filter(l=>l.status===n);if(s)if(a.length===1&&a[0].name===t)r.forEach((l,u)=>{r[u].status=n});else{const l=r.findIndex(u=>u.name===t);r[l].status=r[l].status===i?n:i}else r.forEach((l,u)=>{r[u].status=l.name===t?n:i});const o=r.filter(l=>l.status===n),c=this.getOptions();r.some(l=>l.status===i)?c.data.selectedGroups=o.map(l=>l.name):c.data.selectedGroups=[],this.services.events.dispatchEvent(C.Legend.ITEMS_UPDATE,{dataGroups:r}),this.set({dataGroups:r})}getIsFilled(t,n,i,r){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,i,r):r}getFillColor(t,n,i){const r=this.getOptions(),s=E(this.colorScale,t);return r.getFillColor?r.getFillColor(t,n,i,s):s}getStrokeColor(t,n,i){const r=this.getOptions(),s=E(this.colorScale,t);return r.getStrokeColor?r.getStrokeColor(t,n,i,s):s}isUserProvidedColorScaleValid(){const t=E(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(i=>Object.keys(t).includes(i.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let i=t.originalClassName;return t.classNameTypes.forEach(r=>i=t.originalClassName?`${i} ${r}-${n}`:`${r}-${n}`),i||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format");const n=[],{datasets:i,labels:r}=t;return i.forEach(s=>{s.data.forEach((a,o)=>{let c;const l=E(s,"label");if(l===null){const h=E(r,o);h?c=h:c="Ungrouped"}else c=l;const u={group:c,key:r[o]};isNaN(a)?(u.value=a.value,u.date=a.date):u.value=a,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map(r=>r.map(s=>`"${s==="&ndash;"?"–":s}"`));let n="",i="";t.forEach(function(r,s){i=r.join(","),n+=s<t.length?i+`
3
- `:i}),this.services.files.downloadCSV(n,"myChart.csv")}getTabularData(t){return Array.isArray(t)?t:this.transformToTabularData(t)}sanitize(t){return t=this.getTabularData(t),t}updateAllDataGroups(){this.allDataGroups?this.getDataGroupNames().forEach(t=>{this.allDataGroups.indexOf(t)===-1&&this.allDataGroups.push(t)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(t){const{groupMapsTo:n}=this.getOptions().data,{ACTIVE:i,DISABLED:r}=Lt.items.status,s=this.getOptions(),a=Tr(t.map(c=>c[n]));s.data.selectedGroups.length&&(s.data.selectedGroups.every(c=>a.includes(c))||(s.data.selectedGroups=[]));const o=c=>!s.data.selectedGroups.length||s.data.selectedGroups.includes(c)?i:r;return a.map(c=>({name:c,status:o(c)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=E(t,"color","scale");Object.keys(n).forEach(i=>{this.allDataGroups.includes(i)||console.warn(`"${i}" does not exist in data groups.`)}),this.allDataGroups.filter(i=>n[i]).forEach(i=>this.colorScale[i]=n[i])}setColorClassNames(){const t=E(this.getOptions(),"color","pairing");let n=E(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let i=E(t,"option");const r=ml.pairingOptions,s=n>5?14:n,a=`${s}-color`;i=i<=r[a]?i:1;const o=this.allDataGroups.map((c,l)=>`${s}-${i}-${l%14+1}`);this.colorClassNames=As().range(o).domain(this.allDataGroups)}}let Gn=class extends Be{constructor(t){super(t),this.axisFlavor=Xs.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,n=this.getOptions(),i=t.isDualAxes(),r={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return i&&(r.secondaryDomain=t.secondaryDomainAxisPosition,r.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(r).forEach(s=>{const a=r[s];t.scales[a]?r[s]={position:a,label:t.getScaleLabel(a),identifier:E(n,"axes",a,"mapsTo")}:r[s]=null}),r}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,{cartesianScales:r}=this.services,{primaryDomain:s,primaryRange:a,secondaryDomain:o,secondaryRange:c}=this.assignRangeAndDomains(),l=r.getDomainAxisScaleType();let u;return l===Z.TIME&&(u=h=>pi(h,"MMM d, yyyy")),[["Group",s.label,a.label,...o?[o.label]:[],...c?[c.label]:[]],...t.map(h=>[h[i],h[s.identifier]===null?"&ndash;":u?u(h[s.identifier]):h[s.identifier],h[a.identifier]===null||isNaN(h[a.identifier])?"&ndash;":h[a.identifier].toLocaleString(),...o?[h[o.identifier]===null?"&ndash;":h[o.identifier]]:[],...c?[h[c.identifier]===null||isNaN(h[c.identifier])?"&ndash;":h[c.identifier]]:[]])]}setData(t){let n;if(t&&(n=super.setData(t),E(this.getOptions(),"zoomBar",H.TOP,"enabled"))){const i=E(this.getOptions(),"zoomBar",H.TOP,"data");this.setZoomBarData(i)}return n}setZoomBarData(t){const n=t?this.sanitize(nn(t)):this.getDisplayData();let i=n;const{cartesianScales:r}=this.services;if(n&&r.domainAxisPosition&&r.rangeAxisPosition){const s=r.getDomainIdentifier(),a=r.getRangeIdentifier();let o=n.map(c=>c[s].getTime());o=Tr(o).sort(),i=o.map(c=>{let l=0;const u={};return n.forEach(h=>{h[s].getTime()===c&&(l+=h[a])}),u[s]=new Date(c),u[a]=l,u})}this.set({zoomBarData:i})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(t){const n=this.getOptions();if(!n.axes)return t;const i=[];return Object.keys(H).forEach(r=>{const s=H[r],a=n.axes[s];if(a&&a.scaleType===Z.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&i.push(o)}}),i.length>0&&t.forEach(r=>{i.forEach(s=>{E(r,s,"getTime")===null&&(r[s]=new Date(r[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}},i$=class extends Gn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData();return t.sort((n,i)=>n.source.localeCompare(i.source)),[["Source","Target","Value"],...t.map(n=>[n.source,n.target,n.value])]}},r$=class extends Gn{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Pa(t,.25),q_50:Pa(t,.5),q_75:Pa(t,.75)}}getBoxplotData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this.getGroupedData(),r=[];for(const{name:s,data:a}of i){const o=this.services.cartesianScales.getRangeIdentifier(),c=a.map(w=>w[o]).sort(yn),l={[n]:s,counts:c,quartiles:this.getBoxQuartiles(c),outliers:null,whiskers:null},u=l.quartiles.q_25,h=l.quartiles.q_75,d=(h-u)*1.5,f=u-d,p=h+d,m=[],g=[];for(const w of c)w<f||w>p?m.push(w):g.push(w);l.outliers=m;const v=ln(g),b=bn(g);l.whiskers={min:v||ln([l.quartiles.q_25,l.quartiles.q_50,l.quartiles.q_75]),max:b||bn([l.quartiles.q_25,l.quartiles.q_50,l.quartiles.q_75])},r.push(l)}return r}getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this.getBoxplotData();return[["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],...i.map(r=>{let s=E(r,"outliers");return(s===null||s.length===0)&&(s=["&ndash;"]),[r[n],E(r,"whiskers","min")!==null?E(r,"whiskers","min").toLocaleString():"&ndash;",E(r,"quartiles","q_25")!==null?E(r,"quartiles","q_25").toLocaleString():"&ndash;",E(r,"quartiles","q_50")!==null?E(r,"quartiles","q_50").toLocaleString():"&ndash;",E(r,"quartiles","q_75")!==null?E(r,"quartiles","q_75").toLocaleString():"&ndash;",E(r,"whiskers","max")!==null?E(r,"whiskers","max").toLocaleString():"&ndash;",E(r,"quartiles","q_75")!==null&&E(r,"quartiles","q_25")!==null?(E(r,"quartiles","q_75")-E(r,"quartiles","q_25")).toLocaleString():"&ndash;",s.map(a=>a.toLocaleString()).join(",")]})]}setColorClassNames(){const t=E(this.getOptions(),"color","pairing");let n=E(t,"option");const i=ml.pairingOptions;n=n<=i["1-color"]?n:1;const r=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=As().range(r).domain(this.allDataGroups)}},s$=class extends Gn{constructor(t){super(t)}getMatchingRangeIndexForDatapoint(t){let n;for(let i=t.ranges.length-1;i>0;i--){const r=t.ranges[i];if(t.value>=r)return n=i,n}return 0}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.services.cartesianScales.getRangeIdentifier(),s=E(n,"bullet","performanceAreaTitles");return[["Title","Group","Value","Target","Percentage","Performance"],...t.map(a=>[a.title,a[i],a.value===null?"&ndash;":a.value,E(a,"marker")===null?"&ndash;":a.marker,E(a,"marker")===null?"&ndash;":`${Math.floor(a[r]/a.marker*100)}%`,s[this.getMatchingRangeIndexForDatapoint(a)]])]}},a$=class extends Be{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Ce(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Ce(n)&&!Ce(t.geoData.objects.countries)&&(t.geoData.objects.countries.geometries.forEach(i=>{this._matrix[i.properties.NAME]=i}),n.forEach(i=>{this._matrix[i.name]?this._matrix[i.name].value=i.value||null:console.warn(`Data point ${i} is missing geographical data.`)}))}return this._matrix}getTabularDataArray(){const t=this.getDisplayData();return[["Country ID","Country Name","Value"],...t.map(n=>[n.id===null?"&ndash;":n.id,n.name,n.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=E(this.getOptions(),"color");this._colorScale=Xp(this.getDisplayData(),t)}},o$=class extends Be{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),i=nt({},t,this.getZoomOptions(t));Gl(n,i);const r=this.getHierarchyLevel(),s=E(n,"circlePack","hierarchyLevel");this.set({options:nt(n,i),depth:s&&s<4?s:r})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),i=t||this.getOptions(),r=n.length===1&&E(n,0,"children")?E(n,0,"children"):n;let s=this.getHierarchyLevel();return r.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),E(i,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:Nt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:i}=n.data,r=t.map(s=>{const a=s[i];return this.setChildrenDataGroup(s,a)});this.set({data:r},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(i=>this.setChildrenDataGroup(i,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent","Value"]];return t.forEach(i=>{let r=i.value?i.value:0;i.children&&(r+=this.getChildrenDatums(i.children,i.name,n,0)),n.push(["&ndash;",i.name,r])}),n}getChildrenDatums(t,n,i=[],r=0){const s=n;return t.forEach(a=>{const o=a.name;let c=0;if(a.children)a.children.length>0&&(typeof a.value=="number"&&(r+=a.value),c+=this.getChildrenDatums(a.children,o,i,c),i.push([o,s,c]),r+=c);else{let l=0;typeof a.value=="number"&&(l=a.value,r+=a.value),i.push([a.name,s,l])}}),r}},l$=class extends Be{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(i=>{i.key&&i.key!==i.group&&(i.group=i.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data;return[["Group","Value"],...t.map(r=>[r[i],r.value===null?"&ndash;":r.value.toLocaleString()])]}sanitize(t){return this.getTabularData(t).sort((n,i)=>i.value-n.value)}},c$=class extends Be{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data;return[["Group","Value"],...t.map(r=>[r[i],r.value===null?"&ndash;":r.value.toLocaleString()])]}},u$=class extends Gn{constructor(t){super(t),this.axisFlavor=Xs.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=E(this.getOptions(),"axes");if(E(n,"left","scaleType")&&E(n,"left","scaleType")!==Z.LABELS||E(n,"right","scaleType")&&E(n,"right","scaleType")!==Z.LABELS||E(n,"top","scaleType")&&E(n,"top","scaleType")!==Z.LABELS||E(n,"bottom","scaleType")&&E(n,"bottom","scaleType")!==Z.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=xe(this.getDisplayData(),i=>i.value),n=Se().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(Ce(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,i=n.getDomainIdentifier(),r=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(r);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[i])))}return this._domains}getUniqueRanges(){if(Ce(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,i=n.getRangeIdentifier(),r=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(r);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[i])))}return this._ranges}getMatrix(){if(Ce(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),i=this.services.cartesianScales.getDomainIdentifier(),r=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=nn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[i]][a[r]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(nn(t)),i=this.generateDataGroups(n);return this.set({data:n,dataGroups:i}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ce(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),i=this.services.cartesianScales.getDomainIdentifier(),r=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const c={value:this._matrix[a][o].value,index:this._matrix[a][o].index};c[i]=a,c[r]=o,s.push(c)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:i}=this.assignRangeAndDomains();return[[n.label,i.label,"Value"],...t.map(r=>[r[n.identifier]===null?"&ndash;":r[n.identifier],r[i.identifier]===null?"&ndash;":r[i.identifier].toLocaleString(),r.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=E(t,"color","gradient","colors"),i=!Ce(n);let r=E(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(r<1&&r>4&&a==="mono"||r<1&&r>2&&a==="diverge")&&(r=1);const o=i?n:[];if(!i){const l=a==="diverge"?17:11;for(let u=1;u<l+1;u++)o.push(`fill-${a}-${r}-${u}`)}this._colorScale=zo().domain(s).range(o);const c=E(this.getOptions(),"color");this._colorScale=Xp(this.getDisplayData(),c)}},h$=class extends Gn{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this.getBinnedStackedData();return[[St(t,"bins.rangeLabel")||"Range",...i.map(r=>St(r,`0.${n}`))],...St(i,0).map((r,s)=>[`${St(r,"data.x0")} – ${St(r,"data.x1")}`,...i.map(a=>St(a[s],`data.${St(a[s],n)}`))])]}},d$=class extends Be{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,i)=>n+i.value,0)}getFillColor(t){const n=this.getOptions(),i=E(n,"color","scale"),r=this.getStatus();return i||!r?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=E(this.getDisplayData()),{value:i}=n?n.reduce((a,o)=>({value:a.value+o.value})):0,r=E(t,"meter","proportional")?i:i>100?100:i,s=E(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=r&&r<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getStatus(),s=E(n,"meter","proportional");let a=[],o;if(s===null){o=100;const c=t[0];a=[["Group","Value",...r?["Status"]:[]],[c[i],c.value,...r?[r]:[]]]}else o=E(s,"total")||this.getMaximumDomain(t),a=[["Group","Value","Percentage of total"],...t.map(l=>[l[i],l.value,(l.value/o*100).toFixed(2)+" %"])];return a}},f$=class extends Gn{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:i,value:r}=E(t,"radar","axes"),s=E(n,"0","data").map(a=>a[i]);return[["Group",...s],...n.map(a=>[a.name,...s.map((o,c)=>E(a,"data",c,r)!==null?E(a,"data",c,r).toLocaleString():"&ndash;")])]}},p$=class extends Be{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent"]];return t.forEach(i=>{this.getChildrenDatums(i,n),n.push([i.name,"&ndash;"])}),n}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(i=>{this.getChildrenDatums(i,n),n.push([i.name,t.name])})}};class g$ extends Be{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Group","Value"]];return t.forEach(i=>{Array.isArray(i.children)?i.children.forEach(r=>{n.push([r.name,i.name,r.value])}):E(i.name)!==null&&E(i.value)&&n.push(["–",i.name,i.value])}),n}}let m$=class extends Be{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:i,wordMapsTo:r}=n.wordCloud,{groupMapsTo:s}=n.data;return[[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],...t.map(a=>[a[r],a[s],a[i]])]}};var v$=/\s/;function y$(e){for(var t=e.length;t--&&v$.test(e.charAt(t)););return t}var x$=/^\s+/;function b$(e){return e&&e.slice(0,y$(e)+1).replace(x$,"")}var Zp=0/0,w$=/^[-+]0x[0-9a-f]+$/i,E$=/^0b[01]+$/i,_$=/^0o[0-7]+$/i,S$=parseInt;function Dr(e){if(typeof e=="number")return e;if(ea(e))return Zp;if(ve(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ve(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=b$(e);var n=E$.test(e);return n||_$.test(e)?S$(e.slice(2),n?2:8):w$.test(e)?Zp:+e}var O$=function(){return Te.Date.now()};const Xl=O$;var T$="Expected a function",M$=Math.max,C$=Math.min;function va(e,t,n){var i,r,s,a,o,c,l=0,u=!1,h=!1,d=!0;if(typeof e!="function")throw new TypeError(T$);t=Dr(t)||0,ve(n)&&(u=!!n.leading,h="maxWait"in n,s=h?M$(Dr(n.maxWait)||0,t):s,d="trailing"in n?!!n.trailing:d);function f(T){var S=i,$=r;return i=r=void 0,l=T,a=e.apply($,S),a}function p(T){return l=T,o=setTimeout(v,t),u?f(T):a}function m(T){var S=T-c,$=T-l,D=t-S;return h?C$(D,s-$):D}function g(T){var S=T-c,$=T-l;return c===void 0||S>=t||S<0||h&&$>=s}function v(){var T=Xl();if(g(T))return b(T);o=setTimeout(v,m(T))}function b(T){return o=void 0,d&&i?f(T):(i=r=void 0,a)}function w(){o!==void 0&&clearTimeout(o),l=0,i=c=r=o=void 0}function O(){return o===void 0?a:b(Xl())}function _(){var T=Xl(),S=g(T);if(i=arguments,r=this,c=T,S){if(o===void 0)return p(c);if(h)return clearTimeout(o),o=setTimeout(v,t),f(c)}return o===void 0&&(o=setTimeout(v,t)),a}return _.cancel=w,_.flush=O,_}let an=class{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}};const A$="DONT_STYLE_ME_css_styles_verifier";class I extends an{constructor(t,n){super(t,n),this.chartID=""}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=P(t));const i={width:0,height:0},r=d=>{d&&Object.keys(i).forEach(f=>{if(d[f]){const p=d[f],m=parseFloat(p);p&&m>i[f]&&(""+p).indexOf("%")===-1&&(i[f]=m)}})},s={width:t.attr("width"),height:t.attr("height")},a=t.node();let o,c,l,u;try{typeof a.getBBox=="function"&&(o=a.getBBox(),c={width:o.width,height:o.height})}catch(d){console.error(d)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(l=a.getBoundingClientRect(),u={width:l.width,height:l.height})}catch(d){console.error(d)}let h;if(a instanceof SVGSVGElement&&(h={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(r(s),i.width>0&&i.height>0))return i;if(n.useClientDimensions&&(r(h),i.width>0&&i.height>0))return h;if(n.useBBox&&(r(c),i.width>0&&i.height>0))return c;if(n.useBoundingRect&&(r(u),i.width>0&&i.height>0))return u}try{const d={width:E(t.node(),"width","baseVal","value"),height:E(t.node(),"height","baseVal","value")};r(d)}catch{r(h),r(c),r(s)}return i}static appendOrSelect(t,n){const i=t.select(`${n}`);if(i.empty()){let r=n.split("#"),s,a;return r.length===2?(s=r[0],r=r[1].split("."),a=r[0]):(r=n.split("."),s=r[0]),t.append(s).attr("id",a).attr("class",r.slice(1).join(" "))}return i}init(){this.styleHolderElement(),this.initializeID(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const t=this.model.getOptions(),n=E(t,"style","prefix"),i=P(this.getHolder()).append("div").classed(`${Qt}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");i.append("g").attr("class",A$),this.mainContainer=i.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:n,height:i,theme:r}=this.model.getOptions();n!==this.width&&(t.style.width=n,this.width=n),i!==this.height&&(t.style.height=i,this.height=i),P(this.getHolder()).classed(`${Qt}--chart-holder`,!0).attr("data-carbon-theme",r)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.getHolder(),i=P(n);i.classed("filled",!0),qp.toJpeg(this.getMainContainer(),{bgcolor:typeof window<"u"?window.getComputedStyle(n).getPropertyValue("background-color"):void 0,quality:1,filter:r=>!(r.classList&&r.classList.contains("cds--cc--toolbar"))}).then(function(r){var s;(s=t.services.files)==null||s.downloadImage(r,"myChart.jpg"),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.getHolder(),i=P(n);i.classed("filled",!0),qp.toPng(this.getMainContainer(),{bgcolor:typeof window<"u"?window.getComputedStyle(n).getPropertyValue("background-color"):void 0,quality:1,filter:r=>!(r.classList&&r.classList.contains("cds--cc--toolbar"))}).then(function(r){var s;(s=t.services.files)==null||s.downloadImage(r,"myChart.png"),i.classed("filled",!1)}).catch(function(r){console.error("oops, something went wrong!",r)})}toggleFullscreen(){const t=this.getHolder();P(t).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen&&t.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",()=>{const t=P(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=I.getSVGElementSize(P(this.mainContainer),{useBBox:!0}),n=P(this.mainContainer).attr("class"),i=P(this.mainContainer).selectAll(`.${n} > svg`);let r=0;i.nodes().forEach(function(s){r+=Number(I.getSVGElementSize(P(s),{useBBox:!0}).height)}),r<=t?P(this.mainContainer).attr("height",r):P(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&P(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(C.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(C.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,i=t.clientHeight;const r=va(()=>{var s;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(i-t.clientHeight)>1)&&(n=t.clientWidth,i=t.clientHeight,(s=this.services.events)==null||s.dispatchEvent(C.Chart.RESIZE))},12.5);new ResizeObserver(r).observe(t)}}let Zl=class ev extends an{static appendOrUpdateLinearGradient(t){let n=t.svg.select(`defs linearGradient#${t.id}`);n.empty()&&(n=t.svg.append("defs").append("linearGradient").attr("id",t.id).attr("x1",t.x1).attr("x2",t.x2).attr("y1",t.y1).attr("y2",t.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(t.stops).enter().append("stop").attr("offset",i=>i.offset).style("stop-color",i=>i.color).style("stop-opacity",i=>i.opacity)}static getOffsetRatio(t){return(Math.abs(t[1])*100/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(t,n){const i=t[0]<0&&t[1]>0;let r=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return i&&(r=[{offset:"0%",color:n,opacity:"0.6"},{offset:ev.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),r}};function Kp(e){const t=$$(Qp(e),360);return gn(t,[0,10])||gn(t,[350,0])?{textAnchor:Ke.START,dominantBaseline:Qe.MIDDLE}:gn(t,[10,80])?{textAnchor:Ke.START,dominantBaseline:Qe.HANGING}:gn(t,[80,100])?{textAnchor:Ke.MIDDLE,dominantBaseline:Qe.HANGING}:gn(t,[100,170])?{textAnchor:Ke.END,dominantBaseline:Qe.HANGING}:gn(t,[170,190])?{textAnchor:Ke.END,dominantBaseline:Qe.MIDDLE}:gn(t,[190,260])?{textAnchor:Ke.END,dominantBaseline:Qe.BASELINE}:gn(t,[260,280])?{textAnchor:Ke.MIDDLE,dominantBaseline:Qe.BASELINE}:{textAnchor:Ke.START,dominantBaseline:Qe.BASELINE}}function $$(e,t){return(e%t+t)%t}function gn(e,[t,n]){return e>=t&&e<=n}function Qp(e){return e*(180/Math.PI)}function kt(e,t,n={x:0,y:0}){const i=t*Math.cos(e)+n.x,r=t*Math.sin(e)+n.y;return{x:isNaN(i)?0:i,y:isNaN(r)?0:r}}function L$(e,t){return t*Math.sin(e-Math.PI/2)}function Jp(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function D$(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function Kl(e,t){let n=0;if(t===void 0)for(let i of e)(i=+i)&&(n+=i);else{let i=-1;for(let r of e)(r=+t(r,++i,e))&&(n+=r)}return n}function k$(e){return e.depth}function R$(e,t){return t-1-e.height}function tg(e,t){return e.sourceLinks.length?e.depth:t-1}function ya(e){return function(){return e}}function eg(e,t){return xa(e.source,t.source)||e.index-t.index}function ng(e,t){return xa(e.target,t.target)||e.index-t.index}function xa(e,t){return e.y0-t.y0}function Ql(e){return e.value}function I$(e){return e.index}function P$(e){return e.nodes}function N$(e){return e.links}function ig(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function rg({nodes:e}){for(const t of e){let n=t.y0,i=n;for(const r of t.sourceLinks)r.y0=n+r.width/2,n+=r.width;for(const r of t.targetLinks)r.y1=i+r.width/2,i+=r.width}}function U$(){let e=0,t=0,n=1,i=1,r=24,s=8,a,o=I$,c=tg,l,u,h=P$,d=N$,f=6;function p(){const y={nodes:h.apply(null,arguments),links:d.apply(null,arguments)};return m(y),g(y),v(y),b(y),_(y),rg(y),y}p.update=function(y){return rg(y),y},p.nodeId=function(y){return arguments.length?(o=typeof y=="function"?y:ya(y),p):o},p.nodeAlign=function(y){return arguments.length?(c=typeof y=="function"?y:ya(y),p):c},p.nodeSort=function(y){return arguments.length?(l=y,p):l},p.nodeWidth=function(y){return arguments.length?(r=+y,p):r},p.nodePadding=function(y){return arguments.length?(s=a=+y,p):s},p.nodes=function(y){return arguments.length?(h=typeof y=="function"?y:ya(y),p):h},p.links=function(y){return arguments.length?(d=typeof y=="function"?y:ya(y),p):d},p.linkSort=function(y){return arguments.length?(u=y,p):u},p.size=function(y){return arguments.length?(e=t=0,n=+y[0],i=+y[1],p):[n-e,i-t]},p.extent=function(y){return arguments.length?(e=+y[0][0],n=+y[1][0],t=+y[0][1],i=+y[1][1],p):[[e,t],[n,i]]},p.iterations=function(y){return arguments.length?(f=+y,p):f};function m({nodes:y,links:k}){for(const[U,N]of y.entries())N.index=U,N.sourceLinks=[],N.targetLinks=[];const R=new Map(y.map((U,N)=>[o(U,N,y),U]));for(const[U,N]of k.entries()){N.index=U;let{source:F,target:z}=N;typeof F!="object"&&(F=N.source=ig(R,F)),typeof z!="object"&&(z=N.target=ig(R,z)),F.sourceLinks.push(N),z.targetLinks.push(N)}if(u!=null)for(const{sourceLinks:U,targetLinks:N}of y)U.sort(u),N.sort(u)}function g({nodes:y}){for(const k of y)k.value=k.fixedValue===void 0?Math.max(Kl(k.sourceLinks,Ql),Kl(k.targetLinks,Ql)):k.fixedValue}function v({nodes:y}){const k=y.length;let R=new Set(y),U=new Set,N=0;for(;R.size;){for(const F of R){F.depth=N;for(const{target:z}of F.sourceLinks)U.add(z)}if(++N>k)throw new Error("circular link");R=U,U=new Set}}function b({nodes:y}){const k=y.length;let R=new Set(y),U=new Set,N=0;for(;R.size;){for(const F of R){F.height=N;for(const{source:z}of F.targetLinks)U.add(z)}if(++N>k)throw new Error("circular link");R=U,U=new Set}}function w({nodes:y}){const k=Jp(y,N=>N.depth)+1,R=(n-e-r)/(k-1),U=new Array(k);for(const N of y){const F=Math.max(0,Math.min(k-1,Math.floor(c.call(null,N,k))));N.layer=F,N.x0=e+F*R,N.x1=N.x0+r,U[F]?U[F].push(N):U[F]=[N]}if(l)for(const N of U)N.sort(l);return U}function O(y){const k=D$(y,R=>(i-t-(R.length-1)*a)/Kl(R,Ql));for(const R of y){let U=t;for(const N of R){N.y0=U,N.y1=U+N.value*k,U=N.y1+a;for(const F of N.sourceLinks)F.width=F.value*k}U=(i-U+a)/(R.length+1);for(let N=0;N<R.length;++N){const F=R[N];F.y0+=U*(N+1),F.y1+=U*(N+1)}B(R)}}function _(y){const k=w(y);a=Math.min(s,(i-t)/(Jp(k,R=>R.length)-1)),O(k);for(let R=0;R<f;++R){const U=Math.pow(.99,R),N=Math.max(1-U,(R+1)/f);S(k,U,N),T(k,U,N)}}function T(y,k,R){for(let U=1,N=y.length;U<N;++U){const F=y[U];for(const z of F){let G=0,Q=0;for(const{source:X,value:ot}of z.targetLinks){let tt=ot*(z.layer-X.layer);G+=x(X,z)*tt,Q+=tt}if(!(Q>0))continue;let j=(G/Q-z.y0)*k;z.y0+=j,z.y1+=j,M(z)}l===void 0&&F.sort(xa),$(F,R)}}function S(y,k,R){for(let U=y.length,N=U-2;N>=0;--N){const F=y[N];for(const z of F){let G=0,Q=0;for(const{target:X,value:ot}of z.sourceLinks){let tt=ot*(X.layer-z.layer);G+=A(z,X)*tt,Q+=tt}if(!(Q>0))continue;let j=(G/Q-z.y0)*k;z.y0+=j,z.y1+=j,M(z)}l===void 0&&F.sort(xa),$(F,R)}}function $(y,k){const R=y.length>>1,U=y[R];L(y,U.y0-a,R-1,k),D(y,U.y1+a,R+1,k),L(y,i,y.length-1,k),D(y,t,0,k)}function D(y,k,R,U){for(;R<y.length;++R){const N=y[R],F=(k-N.y0)*U;F>1e-6&&(N.y0+=F,N.y1+=F),k=N.y1+a}}function L(y,k,R,U){for(;R>=0;--R){const N=y[R],F=(N.y1-k)*U;F>1e-6&&(N.y0-=F,N.y1-=F),k=N.y0-a}}function M({sourceLinks:y,targetLinks:k}){if(u===void 0){for(const{source:{sourceLinks:R}}of k)R.sort(ng);for(const{target:{targetLinks:R}}of y)R.sort(eg)}}function B(y){if(u===void 0)for(const{sourceLinks:k,targetLinks:R}of y)k.sort(ng),R.sort(eg)}function x(y,k){let R=y.y0-(y.sourceLinks.length-1)*a/2;for(const{target:U,width:N}of y.sourceLinks){if(U===k)break;R+=N+a}for(const{source:U,width:N}of k.targetLinks){if(U===y)break;R-=N}return R}function A(y,k){let R=k.y0-(k.targetLinks.length-1)*a/2;for(const{source:U,width:N}of k.targetLinks){if(U===y)break;R+=N+a}for(const{target:U,width:N}of y.sourceLinks){if(U===k)break;R-=N}return R}return p}var Jl=Math.PI,tc=2*Jl,Fn=1e-6,B$=tc-Fn;function ec(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function sg(){return new ec}ec.prototype=sg.prototype={constructor:ec,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,i){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(e,t,n,i,r,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(e,t,n,i,r){e=+e,t=+t,n=+n,i=+i,r=+r;var s=this._x1,a=this._y1,o=n-e,c=i-t,l=s-e,u=a-t,h=l*l+u*u;if(r<0)throw new Error("negative radius: "+r);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>Fn)if(!(Math.abs(u*o-c*l)>Fn)||!r)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var d=n-s,f=i-a,p=o*o+c*c,m=d*d+f*f,g=Math.sqrt(p),v=Math.sqrt(h),b=r*Math.tan((Jl-Math.acos((p+h-m)/(2*g*v)))/2),w=b/v,O=b/g;Math.abs(w-1)>Fn&&(this._+="L"+(e+w*l)+","+(t+w*u)),this._+="A"+r+","+r+",0,0,"+ +(u*d>l*f)+","+(this._x1=e+O*o)+","+(this._y1=t+O*c)}},arc:function(e,t,n,i,r,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(i),o=n*Math.sin(i),c=e+a,l=t+o,u=1^s,h=s?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+c+","+l:(Math.abs(this._x1-c)>Fn||Math.abs(this._y1-l)>Fn)&&(this._+="L"+c+","+l),n&&(h<0&&(h=h%tc+tc),h>B$?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=c)+","+(this._y1=l):h>Fn&&(this._+="A"+n+","+n+",0,"+ +(h>=Jl)+","+u+","+(this._x1=e+n*Math.cos(r))+","+(this._y1=t+n*Math.sin(r))))},rect:function(e,t,n,i){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};function ag(e){return function(){return e}}function H$(e){return e[0]}function V$(e){return e[1]}var G$=Array.prototype.slice;function F$(e){return e.source}function z$(e){return e.target}function j$(e){var t=F$,n=z$,i=H$,r=V$,s=null;function a(){var o,c=G$.call(arguments),l=t.apply(this,c),u=n.apply(this,c);if(s||(s=o=sg()),e(s,+i.apply(this,(c[0]=l,c)),+r.apply(this,c),+i.apply(this,(c[0]=u,c)),+r.apply(this,c)),o)return s=null,o+""||null}return a.source=function(o){return arguments.length?(t=o,a):t},a.target=function(o){return arguments.length?(n=o,a):n},a.x=function(o){return arguments.length?(i=typeof o=="function"?o:ag(+o),a):i},a.y=function(o){return arguments.length?(r=typeof o=="function"?o:ag(+o),a):r},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function W$(e,t,n,i,r){e.moveTo(t,n),e.bezierCurveTo(t=(t+i)/2,n,t,r,i,r)}function q$(){return j$(W$)}function Y$(e){return[e.source.x1,e.y0]}function X$(e){return[e.target.x0,e.y1]}function Z$(){return q$().source(Y$).target(X$)}function K$(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Q$(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function i(){if(this instanceof i){var r=[null];r.push.apply(r,arguments);var s=Function.bind.apply(t,r);return new s}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return e[i]}})}),n}var J$={value:function(){}};function og(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new ba(n)}function ba(e){this._=e}function tL(e,t){return e.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&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}ba.prototype=og.prototype={constructor:ba,on:function(e,t){var n=this._,i=tL(e+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((r=(e=i[s]).type)&&(r=eL(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(r=(e=i[s]).type)n[r]=lg(n[r],e.name,t);else if(t==null)for(r in n)n[r]=lg(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ba(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)}};function eL(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function lg(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=J$,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var nL=Q$(Object.freeze(Object.defineProperty({__proto__:null,dispatch:og},Symbol.toStringTag,{value:"Module"}))).dispatch,nc=Math.PI/180,kr=64,wa=2048,iL=function(){var e=[256,256],t=rL,n=sL,i=aL,r=cg,s=cg,a=oL,o=lL,c=ug,l=[],u=1/0,h=nL("word","end"),d=null,f=Math.random,p={},m=gL;p.canvas=function(b){return arguments.length?(m=mn(b),p):m},p.start=function(){var b=g(m()),w=pL((e[0]>>5)*e[1]),O=null,_=l.length,T=-1,S=[],$=l.map(function(L,M){return L.text=t.call(this,L,M),L.font=n.call(this,L,M),L.style=r.call(this,L,M),L.weight=s.call(this,L,M),L.rotate=a.call(this,L,M),L.size=~~i.call(this,L,M),L.padding=o.call(this,L,M),L}).sort(function(L,M){return M.size-L.size});return d&&clearInterval(d),d=setInterval(D,0),D(),p;function D(){for(var L=Date.now();Date.now()-L<u&&++T<_&&d;){var M=$[T];M.x=e[0]*(f()+.5)>>1,M.y=e[1]*(f()+.5)>>1,cL(b,M,$,T),M.hasText&&v(w,M,O)&&(S.push(M),h.call("word",p,M),O?hL(O,M):O=[{x:M.x+M.x0,y:M.y+M.y0},{x:M.x+M.x1,y:M.y+M.y1}],M.x-=e[0]>>1,M.y-=e[1]>>1)}T>=_&&(p.stop(),h.call("end",p,S,O))}},p.stop=function(){return d&&(clearInterval(d),d=null),p};function g(b){b.width=b.height=1;var w=Math.sqrt(b.getContext("2d").getImageData(0,0,1,1).data.length>>2);b.width=(kr<<5)/w,b.height=wa/w;var O=b.getContext("2d");return O.fillStyle=O.strokeStyle="red",O.textAlign="center",{context:O,ratio:w}}function v(b,w,O){e[0],e[1];for(var _=w.x,T=w.y,S=Math.sqrt(e[0]*e[0]+e[1]*e[1]),$=c(e),D=f()<.5?1:-1,L=-D,M,B,x;(M=$(L+=D))&&(B=~~M[0],x=~~M[1],!(Math.min(Math.abs(B),Math.abs(x))>=S));)if(w.x=_+B,w.y=T+x,!(w.x+w.x0<0||w.y+w.y0<0||w.x+w.x1>e[0]||w.y+w.y1>e[1])&&(!O||!uL(w,b,e[0]))&&(!O||dL(w,O))){for(var A=w.sprite,y=w.width>>5,k=e[0]>>5,R=w.x-(y<<4),U=R&127,N=32-U,F=w.y1-w.y0,z=(w.y+w.y0)*k+(R>>5),G,Q=0;Q<F;Q++){G=0;for(var j=0;j<=y;j++)b[z+j]|=G<<N|(j<y?(G=A[Q*y+j])>>>U:0);z+=k}return delete w.sprite,!0}return!1}return p.timeInterval=function(b){return arguments.length?(u=b??1/0,p):u},p.words=function(b){return arguments.length?(l=b,p):l},p.size=function(b){return arguments.length?(e=[+b[0],+b[1]],p):e},p.font=function(b){return arguments.length?(n=mn(b),p):n},p.fontStyle=function(b){return arguments.length?(r=mn(b),p):r},p.fontWeight=function(b){return arguments.length?(s=mn(b),p):s},p.rotate=function(b){return arguments.length?(a=mn(b),p):a},p.text=function(b){return arguments.length?(t=mn(b),p):t},p.spiral=function(b){return arguments.length?(c=mL[b]||b,p):c},p.fontSize=function(b){return arguments.length?(i=mn(b),p):i},p.padding=function(b){return arguments.length?(o=mn(b),p):o},p.random=function(b){return arguments.length?(f=b,p):f},p.on=function(){var b=h.on.apply(h,arguments);return b===h?p:b},p};function rL(e){return e.text}function sL(){return"serif"}function cg(){return"normal"}function aL(e){return Math.sqrt(e.value)}function oL(){return(~~(Math.random()*6)-3)*30}function lL(){return 1}function cL(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(kr<<5)/s,wa/s);var a=0,o=0,c=0,l=n.length;for(--i;++i<l;){t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font;var u=r.measureText(t.text+"m").width*s,h=t.size<<1;if(t.rotate){var d=Math.sin(t.rotate*nc),f=Math.cos(t.rotate*nc),p=u*f,m=u*d,g=h*f,v=h*d;u=Math.max(Math.abs(p+v),Math.abs(p-v))+31>>5<<5,h=~~Math.max(Math.abs(m+g),Math.abs(m-g))}else u=u+31>>5<<5;if(h>c&&(c=h),a+u>=kr<<5&&(a=0,o+=c,c=0),o+h>=wa)break;r.translate((a+(u>>1))/s,(o+(h>>1))/s),t.rotate&&r.rotate(t.rotate*nc),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=u,t.height=h,t.xoff=a,t.yoff=o,t.x1=u>>1,t.y1=h>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=u}for(var b=r.getImageData(0,0,(kr<<5)/s,wa/s).data,w=[];--i>=0;)if(t=n[i],!!t.hasText){for(var u=t.width,O=u>>5,h=t.y1-t.y0,_=0;_<h*O;_++)w[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var T=0,S=-1,$=0;$<h;$++){for(var _=0;_<u;_++){var D=O*$+(_>>5),L=b[(o+$)*(kr<<5)+(a+_)<<2]?1<<31-_%32:0;w[D]|=L,T|=L}T?S=$:(t.y0++,h--,$--,o++)}t.y1=t.y0+S,t.sprite=w.slice(0,(t.y1-t.y0)*O)}}}function uL(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,s=e.x-(r<<4),a=s&127,o=32-a,c=e.y1-e.y0,l=(e.y+e.y0)*n+(s>>5),u,h=0;h<c;h++){u=0;for(var d=0;d<=r;d++)if((u<<o|(d<r?(u=i[h*r+d])>>>a:0))&t[l+d])return!0;l+=n}return!1}function hL(e,t){var n=e[0],i=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function dL(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function ug(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function fL(e){var t=4,n=t*e[0]/e[1],i=0,r=0;return function(s){var a=s<0?-1:1;switch(Math.sqrt(1+4*a*s)-a&3){case 0:i+=n;break;case 1:r+=t;break;case 2:i-=n;break;default:r-=t;break}return[i,r]}}function pL(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function gL(){return document.createElement("canvas")}function mn(e){return typeof e=="function"?e:function(){return e}}var mL={archimedean:ug,rectangular:fL};const vL=K$(iL);function yL(e,t,n,i){var r=-1,s=e==null?0:e.length;for(i&&s&&(n=e[++r]);++r<s;)n=t(n,e[r],r,e);return n}function xL(e){return function(t){return e==null?void 0:e[t]}}var bL={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},wL=xL(bL);const EL=wL;var _L=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,SL="\\u0300-\\u036f",OL="\\ufe20-\\ufe2f",TL="\\u20d0-\\u20ff",ML=SL+OL+TL,CL="["+ML+"]",AL=RegExp(CL,"g");function $L(e){return e=Sr(e),e&&e.replace(_L,EL).replace(AL,"")}var LL=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function DL(e){return e.match(LL)||[]}var kL=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function RL(e){return kL.test(e)}var hg="\\ud800-\\udfff",IL="\\u0300-\\u036f",PL="\\ufe20-\\ufe2f",NL="\\u20d0-\\u20ff",UL=IL+PL+NL,dg="\\u2700-\\u27bf",fg="a-z\\xdf-\\xf6\\xf8-\\xff",BL="\\xac\\xb1\\xd7\\xf7",HL="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",VL="\\u2000-\\u206f",GL=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pg="A-Z\\xc0-\\xd6\\xd8-\\xde",FL="\\ufe0e\\ufe0f",gg=BL+HL+VL+GL,mg="['’]",vg="["+gg+"]",zL="["+UL+"]",yg="\\d+",jL="["+dg+"]",xg="["+fg+"]",bg="[^"+hg+gg+yg+dg+fg+pg+"]",WL="\\ud83c[\\udffb-\\udfff]",qL="(?:"+zL+"|"+WL+")",YL="[^"+hg+"]",wg="(?:\\ud83c[\\udde6-\\uddff]){2}",Eg="[\\ud800-\\udbff][\\udc00-\\udfff]",_i="["+pg+"]",XL="\\u200d",_g="(?:"+xg+"|"+bg+")",ZL="(?:"+_i+"|"+bg+")",Sg="(?:"+mg+"(?:d|ll|m|re|s|t|ve))?",Og="(?:"+mg+"(?:D|LL|M|RE|S|T|VE))?",Tg=qL+"?",Mg="["+FL+"]?",KL="(?:"+XL+"(?:"+[YL,wg,Eg].join("|")+")"+Mg+Tg+")*",QL="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",JL="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",tD=Mg+Tg+KL,eD="(?:"+[jL,wg,Eg].join("|")+")"+tD,nD=RegExp([_i+"?"+xg+"+"+Sg+"(?="+[vg,_i,"$"].join("|")+")",ZL+"+"+Og+"(?="+[vg,_i+_g,"$"].join("|")+")",_i+"?"+_g+"+"+Sg,_i+"+"+Og,JL,QL,yg,eD].join("|"),"g");function iD(e){return e.match(nD)||[]}function rD(e,t,n){return e=Sr(e),t=n?void 0:t,t===void 0?RL(e)?iD(e):DL(e):e.match(t)||[]}var sD="['’]",aD=RegExp(sD,"g");function Cg(e){return function(t){return yL(rD($L(t).replace(aD,"")),e,"")}}function oD(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Ag(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Dr(n),n=n===n?n:0),t!==void 0&&(t=Dr(t),t=t===t?t:0),oD(Dr(e),t,n)}function lD(e,t){var n=-1,i=Un(e)?Array(e.length):[];return Yl(e,function(r,s,a){i[++n]=t(r,s,a)}),i}function cD(e,t){var n=Ft(e)?Of:lD;return n(e,pa(t))}var uD=1/0;function hD(e,t){return ca(cD(e,t),uD)}function $g(e,t){return fa(e,t)}var dD=Cg(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Si=dD;function fD(e,t){var n;return Yl(e,function(i,r,s){return n=t(i,r,s),!n}),!!n}function pD(e,t,n){var i=Ft(e)?xp:fD;return n&&If(e,t,n)&&(t=void 0),i(e,pa(t))}class ht{constructor(t,n,i){if(this.type="",this.renderType=K.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,i&&(this.configs=i,this.configs.id)){const r=E(this.model.getOptions(),"style","prefix");this.id=`${r}--${this.configs.id}`}this.parent||this.setParent(P(this.services.domUtils.getMainContainer()))}init(){}render(t=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(t){this.model=t}setServices(t){this.services=t}setParent(t){var n;const i=this.parent;if(this.parent=t,!(i&&i.node()===t.node())&&this.type){const r=E(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${Qt}--${r}--${this.type}`,!0),i&&i.classed(`${Qt}--${r}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={withinChartClip:!1}){if(this.type){const n=E(this.model.getOptions(),"style","prefix"),i=this.id?`#${this.id}`:"",r=I.appendOrSelect(this.parent,`${this.renderType===K.SVG?"svg":"div"}${i}.${Qt}--${n}--${this.type}`);if(t.withinChartClip){const s=this.model.get("chartClipId");if(s){const a=P(`#${s}`).select("rect");a.size()!==0&&parseFloat(a.attr("height"))>0&&r.attr("clip-path",`url(#${s})`)}}return r.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?nt({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const Lg=class extends ht{constructor(){super(...arguments),this.type="toolbar",this.renderType=K.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(C.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(C.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer().attr("role","toolbar").attr("aria-label",`chart-${this.services.domUtils.getChartID()} toolbar`);if(E(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("<ul role='menu'></ul>"));const{buttonList:i,overflowMenuItemList:r}=this.getControlConfigs();r&&i.push(this.getOverflowButtonConfig());const s=n.selectAll("div.toolbar-control").data(i,c=>c.id);s.exit().remove();const a=s.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu").attr("role","button"),o=this;a.merge(s).classed("disabled",c=>c.shouldBeDisabled()).attr("aria-disabled",c=>c.shouldBeDisabled()).attr("aria-label",c=>c.title).html(c=>`
1
+ (function(rt,ve){typeof exports=="object"&&typeof module<"u"?ve(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],ve):(rt=typeof globalThis<"u"?globalThis:rt||self,ve(rt.ChartsVue={},rt.Vue))})(this,function(rt,ve){"use strict";function yn(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Zm(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Da(e){let t,n,i;e.length!==2?(t=yn,n=(o,c)=>yn(e(o),c),i=(o,c)=>e(o)-c):(t=e===yn||e===Zm?e:Km,n=e,i=e);function r(o,c,l=0,u=o.length){if(l<u){if(t(c,c)!==0)return u;do{const h=l+u>>>1;n(o[h],c)<0?l=h+1:u=h}while(l<u)}return l}function s(o,c,l=0,u=o.length){if(l<u){if(t(c,c)!==0)return u;do{const h=l+u>>>1;n(o[h],c)<=0?l=h+1:u=h}while(l<u)}return l}function a(o,c,l=0,u=o.length){const h=r(o,c,l,u-1);return h>l&&i(o[h-1],c)>-i(o[h],c)?h-1:h}return{left:r,center:a,right:s}}function Km(){return 0}function Qm(e){return e===null?NaN:+e}function*Jm(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(i=+i)>=i&&(yield i)}}const tv=Da(yn).right;Da(Qm).center;const ka=tv;function ev(e,t){let n=0;if(t===void 0)for(let i of e)i!=null&&(i=+i)>=i&&++n;else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(r=+r)>=r&&++n}return n}function ye(e,t){let n,i;if(t===void 0)for(const r of e)r!=null&&(n===void 0?r>=r&&(n=i=r):(n>r&&(n=r),i<r&&(i=r)));else{let r=-1;for(let s of e)(s=t(s,++r,e))!=null&&(n===void 0?s>=s&&(n=i=s):(n>s&&(n=s),i<s&&(i=s)))}return[n,i]}class xn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r<this._n&&r<32;r++){const s=n[r],a=t+s,o=Math.abs(t)<Math.abs(s)?t-(a-s):s-(a-t);o&&(n[i++]=o),t=a}return n[i]=t,this._n=i+1,this}valueOf(){const t=this._partials;let n=this._n,i,r,s,a=0;if(n>0){for(a=t[--n];n>0&&(i=a,r=t[--n],a=i+r,s=r-(a-i),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(r=s*2,i=a+r,r==i-a&&(a=i))}return a}}class Tc extends Map{constructor(t,n=rv){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(Mc(this,t))}has(t){return super.has(Mc(this,t))}set(t,n){return super.set(nv(this,t),n)}delete(t){return super.delete(iv(this,t))}}function Mc({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function nv({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function iv({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function rv(e){return e!==null&&typeof e=="object"?e.valueOf():e}function sv(e){return e}function av(e=yn){if(e===yn)return Cc;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function Cc(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var ov=Array.prototype,lv=ov.slice;function Ra(e){return()=>e}const cv=Math.sqrt(50),uv=Math.sqrt(10),hv=Math.sqrt(2);function Nr(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),a=s>=cv?10:s>=uv?5:s>=hv?2:1;let o,c,l;return r<0?(l=Math.pow(10,-r)/a,o=Math.round(e*l),c=Math.round(t*l),o/l<e&&++o,c/l>t&&--c,l=-l):(l=Math.pow(10,r)*a,o=Math.round(e/l),c=Math.round(t/l),o*l<e&&++o,c*l>t&&--c),c<o&&.5<=n&&n<2?Nr(e,t,n*2):[o,c,l]}function Ur(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const i=t<e,[r,s,a]=i?Nr(t,e,n):Nr(e,t,n);if(!(s>=r))return[];const o=s-r+1,c=new Array(o);if(i)if(a<0)for(let l=0;l<o;++l)c[l]=(s-l)/-a;else for(let l=0;l<o;++l)c[l]=(s-l)*a;else if(a<0)for(let l=0;l<o;++l)c[l]=(r+l)/-a;else for(let l=0;l<o;++l)c[l]=(r+l)*a;return c}function jn(e,t,n){return t=+t,e=+e,n=+n,Nr(e,t,n)[2]}function Ia(e,t,n){t=+t,e=+e,n=+n;const i=t<e,r=i?jn(t,e,n):jn(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}function dv(e,t,n){let i;for(;;){const r=jn(e,t,n);if(r===i||r===0||!isFinite(r))return[e,t];r>0?(e=Math.floor(e/r)*r,t=Math.ceil(t/r)*r):r<0&&(e=Math.ceil(e*r)/r,t=Math.floor(t*r)/r),i=r}}function fv(e){return Math.max(1,Math.ceil(Math.log(ev(e))/Math.LN2)+1)}function pv(){var e=sv,t=ye,n=fv;function i(r){Array.isArray(r)||(r=Array.from(r));var s,a=r.length,o,c,l=new Array(a);for(s=0;s<a;++s)l[s]=e(r[s],s,r);var u=t(l),h=u[0],d=u[1],f=n(l,h,d);if(!Array.isArray(f)){const w=d,O=+f;if(t===ye&&([h,d]=dv(h,d,O)),f=Ur(h,d,O),f[0]<=h&&(c=jn(h,d,O)),f[f.length-1]>=d)if(w>=d&&t===ye){const _=jn(h,d,O);isFinite(_)&&(_>0?d=(Math.floor(d/_)+1)*_:_<0&&(d=(Math.ceil(d*-_)+1)/-_))}else f.pop()}for(var p=f.length,m=0,g=p;f[m]<=h;)++m;for(;f[g-1]>d;)--g;(m||g<p)&&(f=f.slice(m,g),p=g-m);var v=new Array(p+1),b;for(s=0;s<=p;++s)b=v[s]=[],b.x0=s>0?f[s-1]:h,b.x1=s<p?f[s]:d;if(isFinite(c)){if(c>0)for(s=0;s<a;++s)(o=l[s])!=null&&h<=o&&o<=d&&v[Math.min(p,Math.floor((o-h)/c))].push(r[s]);else if(c<0){for(s=0;s<a;++s)if((o=l[s])!=null&&h<=o&&o<=d){const w=Math.floor((h-o)*c);v[Math.min(p,w+(f[w]<=o))].push(r[s])}}}else for(s=0;s<a;++s)(o=l[s])!=null&&h<=o&&o<=d&&v[ka(f,o,0,p)].push(r[s]);return v}return i.value=function(r){return arguments.length?(e=typeof r=="function"?r:Ra(r),i):e},i.domain=function(r){return arguments.length?(t=typeof r=="function"?r:Ra([r[0],r[1]]),i):t},i.thresholds=function(r){return arguments.length?(n=typeof r=="function"?r:Ra(Array.isArray(r)?lv.call(r):r),i):n},i}function bn(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function ln(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function Ac(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?Cc:av(r);i>n;){if(i-n>600){const c=i-n+1,l=t-n+1,u=Math.log(c),h=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*h*(c-h)/c)*(l-c/2<0?-1:1),f=Math.max(n,Math.floor(t-l*h/c+d)),p=Math.min(i,Math.floor(t+(c-l)*h/c+d));Ac(e,t,f,p,r)}const s=e[t];let a=n,o=i;for($i(e,n,t),r(e[i],s)>0&&$i(e,n,i);a<o;){for($i(e,a,o),++a,--o;r(e[a],s)<0;)++a;for(;r(e[o],s)>0;)--o}r(e[n],s)===0?$i(e,n,o):(++o,$i(e,o,i)),o<=t&&(n=o+1),t<=o&&(i=o-1)}return e}function $i(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function Pa(e,t,n){if(e=Float64Array.from(Jm(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return ln(e);if(t>=1)return bn(e);var i,r=(i-1)*t,s=Math.floor(r),a=bn(Ac(e,s).subarray(0,s+1)),o=ln(e.subarray(s+1));return a+(o-a)*(r-s)}}function*gv(e){for(const t of e)yield*t}function $c(e){return Array.from(gv(e))}function mv(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(r);++i<r;)s[i]=e+i*n;return s}function vv(e){return e}var Br=1,Hr=2,Na=3,Li=4,Lc=1e-6;function yv(e){return"translate("+e+",0)"}function xv(e){return"translate(0,"+e+")"}function bv(e){return t=>+e(t)}function wv(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function Ev(){return!this.__axis}function Vr(e,t){var n=[],i=null,r=null,s=6,a=6,o=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=e===Br||e===Li?-1:1,u=e===Li||e===Hr?"x":"y",h=e===Br||e===Na?yv:xv;function d(f){var p=i??(t.ticks?t.ticks.apply(t,n):t.domain()),m=r??(t.tickFormat?t.tickFormat.apply(t,n):vv),g=Math.max(s,0)+o,v=t.range(),b=+v[0]+c,w=+v[v.length-1]+c,O=(t.bandwidth?wv:bv)(t.copy(),c),_=f.selection?f.selection():f,T=_.selectAll(".domain").data([null]),S=_.selectAll(".tick").data(p,t).order(),$=S.exit(),D=S.enter().append("g").attr("class","tick"),L=S.select("line"),M=S.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),S=S.merge(D),L=L.merge(D.append("line").attr("stroke","currentColor").attr(u+"2",l*s)),M=M.merge(D.append("text").attr("fill","currentColor").attr(u,l*g).attr("dy",e===Br?"0em":e===Na?"0.71em":"0.32em")),f!==_&&(T=T.transition(f),S=S.transition(f),L=L.transition(f),M=M.transition(f),$=$.transition(f).attr("opacity",Lc).attr("transform",function(B){return isFinite(B=O(B))?h(B+c):this.getAttribute("transform")}),D.attr("opacity",Lc).attr("transform",function(B){var x=this.parentNode.__axis;return h((x&&isFinite(x=x(B))?x:O(B))+c)})),$.remove(),T.attr("d",e===Li||e===Hr?a?"M"+l*a+","+b+"H"+c+"V"+w+"H"+l*a:"M"+c+","+b+"V"+w:a?"M"+b+","+l*a+"V"+c+"H"+w+"V"+l*a:"M"+b+","+c+"H"+w),S.attr("opacity",1).attr("transform",function(B){return h(O(B)+c)}),L.attr(u+"2",l*s),M.attr(u,l*g).text(m),_.filter(Ev).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Hr?"start":e===Li?"end":"middle"),_.each(function(){this.__axis=O})}return d.scale=function(f){return arguments.length?(t=f,d):t},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(f){return arguments.length?(n=f==null?[]:Array.from(f),d):n.slice()},d.tickValues=function(f){return arguments.length?(i=f==null?null:Array.from(f),d):i&&i.slice()},d.tickFormat=function(f){return arguments.length?(r=f,d):r},d.tickSize=function(f){return arguments.length?(s=a=+f,d):s},d.tickSizeInner=function(f){return arguments.length?(s=+f,d):s},d.tickSizeOuter=function(f){return arguments.length?(a=+f,d):a},d.tickPadding=function(f){return arguments.length?(o=+f,d):o},d.offset=function(f){return arguments.length?(c=+f,d):c},d}function _v(e){return Vr(Br,e)}function Sv(e){return Vr(Hr,e)}function Ua(e){return Vr(Na,e)}function Dc(e){return Vr(Li,e)}var Ov={value:()=>{}};function Ba(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new Gr(n)}function Gr(e){this._=e}function Tv(e,t){return e.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&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Gr.prototype=Ba.prototype={constructor:Gr,on:function(e,t){var n=this._,i=Tv(e+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((r=(e=i[s]).type)&&(r=Mv(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(r=(e=i[s]).type)n[r]=kc(n[r],e.name,t);else if(t==null)for(r in n)n[r]=kc(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Gr(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)}};function Mv(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function kc(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=Ov,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ha="http://www.w3.org/1999/xhtml";const Rc={svg:"http://www.w3.org/2000/svg",xhtml:Ha,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Fr(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Rc.hasOwnProperty(t)?{space:Rc[t],local:e}:e}function Cv(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ha&&t.documentElement.namespaceURI===Ha?t.createElement(e):t.createElementNS(n,e)}}function Av(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ic(e){var t=Fr(e);return(t.local?Av:Cv)(t)}function $v(){}function Va(e){return e==null?$v:function(){return this.querySelector(e)}}function Lv(e){typeof e!="function"&&(e=Va(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],a=s.length,o=i[r]=new Array(a),c,l,u=0;u<a;++u)(c=s[u])&&(l=e.call(c,c.__data__,u,s))&&("__data__"in c&&(l.__data__=c.__data__),o[u]=l);return new ae(i,this._parents)}function Dv(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function kv(){return[]}function Pc(e){return e==null?kv:function(){return this.querySelectorAll(e)}}function Rv(e){return function(){return Dv(e.apply(this,arguments))}}function Iv(e){typeof e=="function"?e=Rv(e):e=Pc(e);for(var t=this._groups,n=t.length,i=[],r=[],s=0;s<n;++s)for(var a=t[s],o=a.length,c,l=0;l<o;++l)(c=a[l])&&(i.push(e.call(c,c.__data__,l,a)),r.push(c));return new ae(i,r)}function Nc(e){return function(){return this.matches(e)}}function Uc(e){return function(t){return t.matches(e)}}var Pv=Array.prototype.find;function Nv(e){return function(){return Pv.call(this.children,e)}}function Uv(){return this.firstElementChild}function Bv(e){return this.select(e==null?Uv:Nv(typeof e=="function"?e:Uc(e)))}var Hv=Array.prototype.filter;function Vv(){return Array.from(this.children)}function Gv(e){return function(){return Hv.call(this.children,e)}}function Fv(e){return this.selectAll(e==null?Vv:Gv(typeof e=="function"?e:Uc(e)))}function zv(e){typeof e!="function"&&(e=Nc(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],a=s.length,o=i[r]=[],c,l=0;l<a;++l)(c=s[l])&&e.call(c,c.__data__,l,s)&&o.push(c);return new ae(i,this._parents)}function Bc(e){return new Array(e.length)}function jv(){return new ae(this._enter||this._groups.map(Bc),this._parents)}function zr(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}zr.prototype={constructor:zr,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Wv(e){return function(){return e}}function qv(e,t,n,i,r,s){for(var a=0,o,c=t.length,l=s.length;a<l;++a)(o=t[a])?(o.__data__=s[a],i[a]=o):n[a]=new zr(e,s[a]);for(;a<c;++a)(o=t[a])&&(r[a]=o)}function Yv(e,t,n,i,r,s,a){var o,c,l=new Map,u=t.length,h=s.length,d=new Array(u),f;for(o=0;o<u;++o)(c=t[o])&&(d[o]=f=a.call(c,c.__data__,o,t)+"",l.has(f)?r[o]=c:l.set(f,c));for(o=0;o<h;++o)f=a.call(e,s[o],o,s)+"",(c=l.get(f))?(i[o]=c,c.__data__=s[o],l.delete(f)):n[o]=new zr(e,s[o]);for(o=0;o<u;++o)(c=t[o])&&l.get(d[o])===c&&(r[o]=c)}function Xv(e){return e.__data__}function Zv(e,t){if(!arguments.length)return Array.from(this,Xv);var n=t?Yv:qv,i=this._parents,r=this._groups;typeof e!="function"&&(e=Wv(e));for(var s=r.length,a=new Array(s),o=new Array(s),c=new Array(s),l=0;l<s;++l){var u=i[l],h=r[l],d=h.length,f=Kv(e.call(u,u&&u.__data__,l,i)),p=f.length,m=o[l]=new Array(p),g=a[l]=new Array(p),v=c[l]=new Array(d);n(u,h,m,g,v,f,t);for(var b=0,w=0,O,_;b<p;++b)if(O=m[b]){for(b>=w&&(w=b+1);!(_=g[w])&&++w<p;);O._next=_||null}}return a=new ae(a,i),a._enter=o,a._exit=c,a}function Kv(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Qv(){return new ae(this._exit||this._groups.map(Bc),this._parents)}function Jv(e,t,n){var i=this.enter(),r=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?s.remove():n(s),i&&r?i.merge(r).order():r}function t0(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,r=n.length,s=i.length,a=Math.min(r,s),o=new Array(r),c=0;c<a;++c)for(var l=n[c],u=i[c],h=l.length,d=o[c]=new Array(h),f,p=0;p<h;++p)(f=l[p]||u[p])&&(d[p]=f);for(;c<r;++c)o[c]=n[c];return new ae(o,this._parents)}function e0(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i=e[t],r=i.length-1,s=i[r],a;--r>=0;)(a=i[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function n0(e){e||(e=i0);function t(h,d){return h&&d?e(h.__data__,d.__data__):!h-!d}for(var n=this._groups,i=n.length,r=new Array(i),s=0;s<i;++s){for(var a=n[s],o=a.length,c=r[s]=new Array(o),l,u=0;u<o;++u)(l=a[u])&&(c[u]=l);c.sort(t)}return new ae(r,this._parents).order()}function i0(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function r0(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function s0(){return Array.from(this)}function a0(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,s=i.length;r<s;++r){var a=i[r];if(a)return a}return null}function o0(){let e=0;for(const t of this)++e;return e}function l0(){return!this.node()}function c0(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var r=t[n],s=0,a=r.length,o;s<a;++s)(o=r[s])&&e.call(o,o.__data__,s,r);return this}function u0(e){return function(){this.removeAttribute(e)}}function h0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function d0(e,t){return function(){this.setAttribute(e,t)}}function f0(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function p0(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function g0(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function m0(e,t){var n=Fr(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((t==null?n.local?h0:u0:typeof t=="function"?n.local?g0:p0:n.local?f0:d0)(n,t))}function Hc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function v0(e){return function(){this.style.removeProperty(e)}}function y0(e,t,n){return function(){this.style.setProperty(e,t,n)}}function x0(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function b0(e,t,n){return arguments.length>1?this.each((t==null?v0:typeof t=="function"?x0:y0)(e,t,n??"")):Wn(this.node(),e)}function Wn(e,t){return e.style.getPropertyValue(t)||Hc(e).getComputedStyle(e,null).getPropertyValue(t)}function w0(e){return function(){delete this[e]}}function E0(e,t){return function(){this[e]=t}}function _0(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function S0(e,t){return arguments.length>1?this.each((t==null?w0:typeof t=="function"?_0:E0)(e,t)):this.node()[e]}function Vc(e){return e.trim().split(/^|\s+/)}function Ga(e){return e.classList||new Gc(e)}function Gc(e){this._node=e,this._names=Vc(e.getAttribute("class")||"")}Gc.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Fc(e,t){for(var n=Ga(e),i=-1,r=t.length;++i<r;)n.add(t[i])}function zc(e,t){for(var n=Ga(e),i=-1,r=t.length;++i<r;)n.remove(t[i])}function O0(e){return function(){Fc(this,e)}}function T0(e){return function(){zc(this,e)}}function M0(e,t){return function(){(t.apply(this,arguments)?Fc:zc)(this,e)}}function C0(e,t){var n=Vc(e+"");if(arguments.length<2){for(var i=Ga(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?M0:t?O0:T0)(n,t))}function A0(){this.textContent=""}function $0(e){return function(){this.textContent=e}}function L0(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function D0(e){return arguments.length?this.each(e==null?A0:(typeof e=="function"?L0:$0)(e)):this.node().textContent}function k0(){this.innerHTML=""}function R0(e){return function(){this.innerHTML=e}}function I0(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function P0(e){return arguments.length?this.each(e==null?k0:(typeof e=="function"?I0:R0)(e)):this.node().innerHTML}function N0(){this.nextSibling&&this.parentNode.appendChild(this)}function U0(){return this.each(N0)}function B0(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function H0(){return this.each(B0)}function V0(e){var t=typeof e=="function"?e:Ic(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function G0(){return null}function F0(e,t){var n=typeof e=="function"?e:Ic(e),i=t==null?G0:typeof t=="function"?t:Va(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function z0(){var e=this.parentNode;e&&e.removeChild(this)}function j0(){return this.each(z0)}function W0(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function q0(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Y0(e){return this.select(e?q0:W0)}function X0(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Z0(e){return function(t){e.call(this,t,this.__data__)}}function K0(e){return e.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function Q0(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n<r;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function J0(e,t,n){return function(){var i=this.__on,r,s=Z0(t);if(i){for(var a=0,o=i.length;a<o;++a)if((r=i[a]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=n),r.value=t;return}}this.addEventListener(e.type,s,n),r={type:e.type,name:e.name,value:t,listener:s,options:n},i?i.push(r):this.__on=[r]}}function ty(e,t,n){var i=K0(e+""),r,s=i.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var c=0,l=o.length,u;c<l;++c)for(r=0,u=o[c];r<s;++r)if((a=i[r]).type===u.type&&a.name===u.name)return u.value}return}for(o=t?J0:Q0,r=0;r<s;++r)this.each(o(i[r],t,n));return this}function jc(e,t,n){var i=Hc(e),r=i.CustomEvent;typeof r=="function"?r=new r(t,n):(r=i.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function ey(e,t){return function(){return jc(this,e,t)}}function ny(e,t){return function(){return jc(this,e,t.apply(this,arguments))}}function iy(e,t){return this.each((typeof t=="function"?ny:ey)(e,t))}function*ry(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,s=i.length,a;r<s;++r)(a=i[r])&&(yield a)}var Wc=[null];function ae(e,t){this._groups=e,this._parents=t}function Di(){return new ae([[document.documentElement]],Wc)}function sy(){return this}ae.prototype=Di.prototype={constructor:ae,select:Lv,selectAll:Iv,selectChild:Bv,selectChildren:Fv,filter:zv,data:Zv,enter:jv,exit:Qv,join:Jv,merge:t0,selection:sy,order:e0,sort:n0,call:r0,nodes:s0,node:a0,size:o0,empty:l0,each:c0,attr:m0,style:b0,property:S0,classed:C0,text:D0,html:P0,raise:U0,lower:H0,append:V0,insert:F0,remove:j0,clone:Y0,datum:X0,on:ty,dispatch:iy,[Symbol.iterator]:ry};function P(e){return typeof e=="string"?new ae([[document.querySelector(e)]],[document.documentElement]):new ae([[e]],Wc)}function ay(e){let t;for(;t=e.sourceEvent;)e=t;return e}function wn(e,t){if(e=ay(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const Fa={capture:!0,passive:!1};function za(e){e.preventDefault(),e.stopImmediatePropagation()}function oy(e){var t=e.document.documentElement,n=P(e).on("dragstart.drag",za,Fa);"onselectstart"in t?n.on("selectstart.drag",za,Fa):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ly(e,t){var n=e.document.documentElement,i=P(e).on("dragstart.drag",null);t&&(i.on("click.drag",za,Fa),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function ja(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function qc(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function ki(){}var Ri=.7,jr=1/Ri,qn="\\s*([+-]?\\d+)\\s*",Ii="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$e="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cy=/^#([0-9a-f]{3,8})$/,uy=new RegExp(`^rgb\\(${qn},${qn},${qn}\\)$`),hy=new RegExp(`^rgb\\(${$e},${$e},${$e}\\)$`),dy=new RegExp(`^rgba\\(${qn},${qn},${qn},${Ii}\\)$`),fy=new RegExp(`^rgba\\(${$e},${$e},${$e},${Ii}\\)$`),py=new RegExp(`^hsl\\(${Ii},${$e},${$e}\\)$`),gy=new RegExp(`^hsla\\(${Ii},${$e},${$e},${Ii}\\)$`),Yc={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};ja(ki,He,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Xc,formatHex:Xc,formatHex8:my,formatHsl:vy,formatRgb:Zc,toString:Zc});function Xc(){return this.rgb().formatHex()}function my(){return this.rgb().formatHex8()}function vy(){return eu(this).formatHsl()}function Zc(){return this.rgb().formatRgb()}function He(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=cy.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Kc(t):n===3?new te(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Wr(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Wr(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=uy.exec(e))?new te(t[1],t[2],t[3],1):(t=hy.exec(e))?new te(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=dy.exec(e))?Wr(t[1],t[2],t[3],t[4]):(t=fy.exec(e))?Wr(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=py.exec(e))?tu(t[1],t[2]/100,t[3]/100,1):(t=gy.exec(e))?tu(t[1],t[2]/100,t[3]/100,t[4]):Yc.hasOwnProperty(e)?Kc(Yc[e]):e==="transparent"?new te(NaN,NaN,NaN,0):null}function Kc(e){return new te(e>>16&255,e>>8&255,e&255,1)}function Wr(e,t,n,i){return i<=0&&(e=t=n=NaN),new te(e,t,n,i)}function yy(e){return e instanceof ki||(e=He(e)),e?(e=e.rgb(),new te(e.r,e.g,e.b,e.opacity)):new te}function Wa(e,t,n,i){return arguments.length===1?yy(e):new te(e,t,n,i??1)}function te(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}ja(te,Wa,qc(ki,{brighter(e){return e=e==null?jr:Math.pow(jr,e),new te(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ri:Math.pow(Ri,e),new te(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new te(En(this.r),En(this.g),En(this.b),qr(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:Qc,formatHex:Qc,formatHex8:xy,formatRgb:Jc,toString:Jc}));function Qc(){return`#${_n(this.r)}${_n(this.g)}${_n(this.b)}`}function xy(){return`#${_n(this.r)}${_n(this.g)}${_n(this.b)}${_n((isNaN(this.opacity)?1:this.opacity)*255)}`}function Jc(){const e=qr(this.opacity);return`${e===1?"rgb(":"rgba("}${En(this.r)}, ${En(this.g)}, ${En(this.b)}${e===1?")":`, ${e})`}`}function qr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function En(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function _n(e){return e=En(e),(e<16?"0":"")+e.toString(16)}function tu(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new xe(e,t,n,i)}function eu(e){if(e instanceof xe)return new xe(e.h,e.s,e.l,e.opacity);if(e instanceof ki||(e=He(e)),!e)return new xe;if(e instanceof xe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),a=NaN,o=s-r,c=(s+r)/2;return o?(t===s?a=(n-i)/o+(n<i)*6:n===s?a=(i-t)/o+2:a=(t-n)/o+4,o/=c<.5?s+r:2-s-r,a*=60):o=c>0&&c<1?0:a,new xe(a,o,c,e.opacity)}function qa(e,t,n,i){return arguments.length===1?eu(e):new xe(e,t,n,i??1)}function xe(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}ja(xe,qa,qc(ki,{brighter(e){return e=e==null?jr:Math.pow(jr,e),new xe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ri:Math.pow(Ri,e),new xe(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new te(Ya(e>=240?e-240:e+120,r,i),Ya(e,r,i),Ya(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new xe(nu(this.h),Yr(this.s),Yr(this.l),qr(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 e=qr(this.opacity);return`${e===1?"hsl(":"hsla("}${nu(this.h)}, ${Yr(this.s)*100}%, ${Yr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function nu(e){return e=(e||0)%360,e<0?e+360:e}function Yr(e){return Math.max(0,Math.min(1,e||0))}function Ya(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Xa=e=>()=>e;function by(e,t){return function(n){return e+n*t}}function wy(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function Ey(e){return(e=+e)==1?iu:function(t,n){return n-t?wy(t,n,e):Xa(isNaN(t)?n:t)}}function iu(e,t){var n=t-e;return n?by(e,n):Xa(isNaN(e)?t:e)}const Xr=function e(t){var n=Ey(t);function i(r,s){var a=n((r=Wa(r)).r,(s=Wa(s)).r),o=n(r.g,s.g),c=n(r.b,s.b),l=iu(r.opacity,s.opacity);return function(u){return r.r=a(u),r.g=o(u),r.b=c(u),r.opacity=l(u),r+""}}return i.gamma=e,i}(1);function _y(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(s){for(r=0;r<n;++r)i[r]=e[r]*(1-s)+t[r]*s;return i}}function Sy(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Oy(e,t){var n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),s=new Array(n),a;for(a=0;a<i;++a)r[a]=Pi(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<i;++a)s[a]=r[a](o);return s}}function Ty(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function oe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function My(e,t){var n={},i={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=Pi(e[r],t[r]):i[r]=t[r];return function(s){for(r in n)i[r]=n[r](s);return i}}var Za=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ka=new RegExp(Za.source,"g");function Cy(e){return function(){return e}}function Ay(e){return function(t){return e(t)+""}}function ru(e,t){var n=Za.lastIndex=Ka.lastIndex=0,i,r,s,a=-1,o=[],c=[];for(e=e+"",t=t+"";(i=Za.exec(e))&&(r=Ka.exec(t));)(s=r.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(i=i[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,c.push({i:a,x:oe(i,r)})),n=Ka.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?c[0]?Ay(c[0].x):Cy(t):(t=c.length,function(l){for(var u=0,h;u<t;++u)o[(h=c[u]).i]=h.x(l);return o.join("")})}function Pi(e,t){var n=typeof t,i;return t==null||n==="boolean"?Xa(t):(n==="number"?oe:n==="string"?(i=He(t))?(t=i,Xr):ru:t instanceof He?Xr:t instanceof Date?Ty:Sy(t)?_y:Array.isArray(t)?Oy:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?My:oe)(e,t)}function su(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var au=180/Math.PI,Qa={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ou(e,t,n,i,r,s){var a,o,c;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(c=e*n+t*i)&&(n-=e*c,i-=t*c),(o=Math.sqrt(n*n+i*i))&&(n/=o,i/=o,c/=o),e*i<t*n&&(e=-e,t=-t,c=-c,a=-a),{translateX:r,translateY:s,rotate:Math.atan2(t,e)*au,skewX:Math.atan(c)*au,scaleX:a,scaleY:o}}var Zr;function $y(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Qa:ou(t.a,t.b,t.c,t.d,t.e,t.f)}function Ly(e){return e==null||(Zr||(Zr=document.createElementNS("http://www.w3.org/2000/svg","g")),Zr.setAttribute("transform",e),!(e=Zr.transform.baseVal.consolidate()))?Qa:(e=e.matrix,ou(e.a,e.b,e.c,e.d,e.e,e.f))}function lu(e,t,n,i){function r(l){return l.length?l.pop()+" ":""}function s(l,u,h,d,f,p){if(l!==h||u!==d){var m=f.push("translate(",null,t,null,n);p.push({i:m-4,x:oe(l,h)},{i:m-2,x:oe(u,d)})}else(h||d)&&f.push("translate("+h+t+d+n)}function a(l,u,h,d){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),d.push({i:h.push(r(h)+"rotate(",null,i)-2,x:oe(l,u)})):u&&h.push(r(h)+"rotate("+u+i)}function o(l,u,h,d){l!==u?d.push({i:h.push(r(h)+"skewX(",null,i)-2,x:oe(l,u)}):u&&h.push(r(h)+"skewX("+u+i)}function c(l,u,h,d,f,p){if(l!==h||u!==d){var m=f.push(r(f)+"scale(",null,",",null,")");p.push({i:m-4,x:oe(l,h)},{i:m-2,x:oe(u,d)})}else(h!==1||d!==1)&&f.push(r(f)+"scale("+h+","+d+")")}return function(l,u){var h=[],d=[];return l=e(l),u=e(u),s(l.translateX,l.translateY,u.translateX,u.translateY,h,d),a(l.rotate,u.rotate,h,d),o(l.skewX,u.skewX,h,d),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,h,d),l=u=null,function(f){for(var p=-1,m=d.length,g;++p<m;)h[(g=d[p]).i]=g.x(f);return h.join("")}}}var Dy=lu($y,"px, ","px)","deg)"),ky=lu(Ly,", ",")",")");function Ry(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}var Yn=0,Ni=0,Ui=0,cu=1e3,Kr,Bi,Qr=0,Sn=0,Jr=0,Hi=typeof performance=="object"&&performance.now?performance:Date,uu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ja(){return Sn||(uu(Iy),Sn=Hi.now()+Jr)}function Iy(){Sn=0}function ts(){this._call=this._time=this._next=null}ts.prototype=hu.prototype={constructor:ts,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ja():+n)+(t==null?0:+t),!this._next&&Bi!==this&&(Bi?Bi._next=this:Kr=this,Bi=this),this._call=e,this._time=n,to()},stop:function(){this._call&&(this._call=null,this._time=1/0,to())}};function hu(e,t,n){var i=new ts;return i.restart(e,t,n),i}function Py(){Ja(),++Yn;for(var e=Kr,t;e;)(t=Sn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Yn}function du(){Sn=(Qr=Hi.now())+Jr,Yn=Ni=0;try{Py()}finally{Yn=0,Uy(),Sn=0}}function Ny(){var e=Hi.now(),t=e-Qr;t>cu&&(Jr-=t,Qr=e)}function Uy(){for(var e,t=Kr,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Kr=n);Bi=e,to(i)}function to(e){if(!Yn){Ni&&(Ni=clearTimeout(Ni));var t=e-Sn;t>24?(e<1/0&&(Ni=setTimeout(du,e-Hi.now()-Jr)),Ui&&(Ui=clearInterval(Ui))):(Ui||(Qr=Hi.now(),Ui=setInterval(Ny,cu)),Yn=1,uu(du))}}function fu(e,t,n){var i=new ts;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var By=Ba("start","end","cancel","interrupt"),Hy=[],pu=0,gu=1,eo=2,es=3,mu=4,no=5,ns=6;function is(e,t,n,i,r,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Vy(e,n,{name:t,index:i,group:r,on:By,tween:Hy,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:pu})}function io(e,t){var n=be(e,t);if(n.state>pu)throw new Error("too late; already scheduled");return n}function Le(e,t){var n=be(e,t);if(n.state>es)throw new Error("too late; already running");return n}function be(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Vy(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=hu(s,0,n.time);function s(l){n.state=gu,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var u,h,d,f;if(n.state!==gu)return c();for(u in i)if(f=i[u],f.name===n.name){if(f.state===es)return fu(a);f.state===mu?(f.state=ns,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[u]):+u<t&&(f.state=ns,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[u])}if(fu(function(){n.state===es&&(n.state=mu,n.timer.restart(o,n.delay,n.time),o(l))}),n.state=eo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===eo){for(n.state=es,r=new Array(d=n.tween.length),u=0,h=-1;u<d;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++h]=f);r.length=h+1}}function o(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=no,1),h=-1,d=r.length;++h<d;)r[h].call(e,u);n.state===no&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=ns,n.timer.stop(),delete i[t];for(var l in i)return;delete e.__transition}}function ro(e,t){var n=e.__transition,i,r,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((i=n[a]).name!==t){s=!1;continue}r=i.state>eo&&i.state<no,i.state=ns,i.timer.stop(),i.on.call(r?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[a]}s&&delete e.__transition}}function Gy(e){return this.each(function(){ro(this,e)})}function Fy(e,t){var n,i;return function(){var r=Le(this,e),s=r.tween;if(s!==n){i=n=s;for(var a=0,o=i.length;a<o;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}r.tween=i}}function zy(e,t,n){var i,r;if(typeof n!="function")throw new Error;return function(){var s=Le(this,e),a=s.tween;if(a!==i){r=(i=a).slice();for(var o={name:t,value:n},c=0,l=r.length;c<l;++c)if(r[c].name===t){r[c]=o;break}c===l&&r.push(o)}s.tween=r}}function jy(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=be(this.node(),n).tween,r=0,s=i.length,a;r<s;++r)if((a=i[r]).name===e)return a.value;return null}return this.each((t==null?Fy:zy)(n,e,t))}function so(e,t,n){var i=e._id;return e.each(function(){var r=Le(this,i);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return be(r,i).value[t]}}function vu(e,t){var n;return(typeof t=="number"?oe:t instanceof He?Xr:(n=He(t))?(t=n,Xr):ru)(e,t)}function Wy(e){return function(){this.removeAttribute(e)}}function qy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Yy(e,t,n){var i,r=n+"",s;return function(){var a=this.getAttribute(e);return a===r?null:a===i?s:s=t(i=a,n)}}function Xy(e,t,n){var i,r=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===r?null:a===i?s:s=t(i=a,n)}}function Zy(e,t,n){var i,r,s;return function(){var a,o=n(this),c;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),c=o+"",a===c?null:a===i&&c===r?s:(r=c,s=t(i=a,o)))}}function Ky(e,t,n){var i,r,s;return function(){var a,o=n(this),c;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),c=o+"",a===c?null:a===i&&c===r?s:(r=c,s=t(i=a,o)))}}function Qy(e,t){var n=Fr(e),i=n==="transform"?ky:vu;return this.attrTween(e,typeof t=="function"?(n.local?Ky:Zy)(n,i,so(this,"attr."+e,t)):t==null?(n.local?qy:Wy)(n):(n.local?Xy:Yy)(n,i,t))}function Jy(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function t1(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function e1(e,t){var n,i;function r(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&t1(e,s)),n}return r._value=t,r}function n1(e,t){var n,i;function r(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&Jy(e,s)),n}return r._value=t,r}function i1(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var i=Fr(e);return this.tween(n,(i.local?e1:n1)(i,t))}function r1(e,t){return function(){io(this,e).delay=+t.apply(this,arguments)}}function s1(e,t){return t=+t,function(){io(this,e).delay=t}}function a1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?r1:s1)(t,e)):be(this.node(),t).delay}function o1(e,t){return function(){Le(this,e).duration=+t.apply(this,arguments)}}function l1(e,t){return t=+t,function(){Le(this,e).duration=t}}function c1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?o1:l1)(t,e)):be(this.node(),t).duration}function u1(e,t){if(typeof t!="function")throw new Error;return function(){Le(this,e).ease=t}}function h1(e){var t=this._id;return arguments.length?this.each(u1(t,e)):be(this.node(),t).ease}function d1(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Le(this,e).ease=n}}function f1(e){if(typeof e!="function")throw new Error;return this.each(d1(this._id,e))}function p1(e){typeof e!="function"&&(e=Nc(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s=t[r],a=s.length,o=i[r]=[],c,l=0;l<a;++l)(c=s[l])&&e.call(c,c.__data__,l,s)&&o.push(c);return new Ve(i,this._parents,this._name,this._id)}function g1(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,r=n.length,s=Math.min(i,r),a=new Array(i),o=0;o<s;++o)for(var c=t[o],l=n[o],u=c.length,h=a[o]=new Array(u),d,f=0;f<u;++f)(d=c[f]||l[f])&&(h[f]=d);for(;o<i;++o)a[o]=t[o];return new Ve(a,this._parents,this._name,this._id)}function m1(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function v1(e,t,n){var i,r,s=m1(t)?io:Le;return function(){var a=s(this,e),o=a.on;o!==i&&(r=(i=o).copy()).on(t,n),a.on=r}}function y1(e,t){var n=this._id;return arguments.length<2?be(this.node(),n).on.on(e):this.each(v1(n,e,t))}function x1(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function b1(){return this.on("end.remove",x1(this._id))}function w1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Va(e));for(var i=this._groups,r=i.length,s=new Array(r),a=0;a<r;++a)for(var o=i[a],c=o.length,l=s[a]=new Array(c),u,h,d=0;d<c;++d)(u=o[d])&&(h=e.call(u,u.__data__,d,o))&&("__data__"in u&&(h.__data__=u.__data__),l[d]=h,is(l[d],t,n,d,l,be(u,n)));return new Ve(s,this._parents,t,n)}function E1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Pc(e));for(var i=this._groups,r=i.length,s=[],a=[],o=0;o<r;++o)for(var c=i[o],l=c.length,u,h=0;h<l;++h)if(u=c[h]){for(var d=e.call(u,u.__data__,h,c),f,p=be(u,n),m=0,g=d.length;m<g;++m)(f=d[m])&&is(f,t,n,m,d,p);s.push(d),a.push(u)}return new Ve(s,a,t,n)}var _1=Di.prototype.constructor;function S1(){return new _1(this._groups,this._parents)}function O1(e,t){var n,i,r;return function(){var s=Wn(this,e),a=(this.style.removeProperty(e),Wn(this,e));return s===a?null:s===n&&a===i?r:r=t(n=s,i=a)}}function yu(e){return function(){this.style.removeProperty(e)}}function T1(e,t,n){var i,r=n+"",s;return function(){var a=Wn(this,e);return a===r?null:a===i?s:s=t(i=a,n)}}function M1(e,t,n){var i,r,s;return function(){var a=Wn(this,e),o=n(this),c=o+"";return o==null&&(c=o=(this.style.removeProperty(e),Wn(this,e))),a===c?null:a===i&&c===r?s:(r=c,s=t(i=a,o))}}function C1(e,t){var n,i,r,s="style."+t,a="end."+s,o;return function(){var c=Le(this,e),l=c.on,u=c.value[s]==null?o||(o=yu(t)):void 0;(l!==n||r!==u)&&(i=(n=l).copy()).on(a,r=u),c.on=i}}function A1(e,t,n){var i=(e+="")=="transform"?Dy:vu;return t==null?this.styleTween(e,O1(e,i)).on("end.style."+e,yu(e)):typeof t=="function"?this.styleTween(e,M1(e,i,so(this,"style."+e,t))).each(C1(this._id,e)):this.styleTween(e,T1(e,i,t),n).on("end.style."+e,null)}function $1(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function L1(e,t,n){var i,r;function s(){var a=t.apply(this,arguments);return a!==r&&(i=(r=a)&&$1(e,a,n)),i}return s._value=t,s}function D1(e,t,n){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,L1(e,t,n??""))}function k1(e){return function(){this.textContent=e}}function R1(e){return function(){var t=e(this);this.textContent=t??""}}function I1(e){return this.tween("text",typeof e=="function"?R1(so(this,"text",e)):k1(e==null?"":e+""))}function P1(e){return function(t){this.textContent=e.call(this,t)}}function N1(e){var t,n;function i(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&P1(r)),t}return i._value=e,i}function U1(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,N1(e))}function B1(){for(var e=this._name,t=this._id,n=xu(),i=this._groups,r=i.length,s=0;s<r;++s)for(var a=i[s],o=a.length,c,l=0;l<o;++l)if(c=a[l]){var u=be(c,t);is(c,e,n,l,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ve(i,this._parents,e,n)}function H1(){var e,t,n=this,i=n._id,r=n.size();return new Promise(function(s,a){var o={value:a},c={value:function(){--r===0&&s()}};n.each(function(){var l=Le(this,i),u=l.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(c)),l.on=t}),r===0&&s()})}var V1=0;function Ve(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function xu(){return++V1}var Ge=Di.prototype;Ve.prototype={constructor:Ve,select:w1,selectAll:E1,selectChild:Ge.selectChild,selectChildren:Ge.selectChildren,filter:p1,merge:g1,selection:S1,transition:B1,call:Ge.call,nodes:Ge.nodes,node:Ge.node,size:Ge.size,empty:Ge.empty,each:Ge.each,on:y1,attr:Qy,attrTween:i1,style:A1,styleTween:D1,text:I1,textTween:U1,remove:b1,tween:jy,delay:a1,duration:c1,ease:h1,easeVarying:f1,end:H1,[Symbol.iterator]:Ge[Symbol.iterator]};const G1=e=>+e;function bu(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var F1={time:null,delay:0,duration:250,ease:bu};function z1(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function j1(e){var t,n;e instanceof Ve?(t=e._id,e=e._name):(t=xu(),(n=F1).time=Ja(),e=e==null?null:e+"");for(var i=this._groups,r=i.length,s=0;s<r;++s)for(var a=i[s],o=a.length,c,l=0;l<o;++l)(c=a[l])&&is(c,e,t,l,a,n||z1(c,t));return new Ve(i,this._parents,e,t)}Di.prototype.interrupt=Gy,Di.prototype.transition=j1;const ao=e=>()=>e;function W1(e,{sourceEvent:t,target:n,selection:i,mode:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:i,enumerable:!0,configurable:!0},mode:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function q1(e){e.stopImmediatePropagation()}function oo(e){e.preventDefault(),e.stopImmediatePropagation()}var wu={name:"drag"},lo={name:"space"},Xn={name:"handle"},Zn={name:"center"};const{abs:Eu,max:Wt,min:qt}=Math;function _u(e){return[+e[0],+e[1]]}function Su(e){return[_u(e[0]),_u(e[1])]}var rs={name:"x",handles:["w","e"].map(ss),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},co={name:"y",handles:["n","s"].map(ss),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},Fe={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ou={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Tu={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Y1={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},X1={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function ss(e){return{type:e}}function Z1(e){return!e.ctrlKey&&!e.button}function K1(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function Q1(){return navigator.maxTouchPoints||"ontouchstart"in this}function uo(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function J1(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function Mu(){return tx(rs)}function tx(e){var t=K1,n=Z1,i=Q1,r=!0,s=Ba("start","brush","end"),a=6,o;function c(g){var v=g.property("__brush",m).selectAll(".overlay").data([ss("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Fe.overlay).merge(v).each(function(){var w=uo(this).extent;P(this).attr("x",w[0][0]).attr("y",w[0][1]).attr("width",w[1][0]-w[0][0]).attr("height",w[1][1]-w[0][1])}),g.selectAll(".selection").data([ss("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Fe.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var b=g.selectAll(".handle").data(e.handles,function(w){return w.type});b.exit().remove(),b.enter().append("rect").attr("class",function(w){return"handle handle--"+w.type}).attr("cursor",function(w){return Fe[w.type]}),g.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(i).on("touchstart.brush",d).on("touchmove.brush",f).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}c.move=function(g,v,b){g.tween?g.on("start.brush",function(w){u(this,arguments).beforestart().start(w)}).on("interrupt.brush end.brush",function(w){u(this,arguments).end(w)}).tween("brush",function(){var w=this,O=w.__brush,_=u(w,arguments),T=O.selection,S=e.input(typeof v=="function"?v.apply(this,arguments):v,O.extent),$=Pi(T,S);function D(L){O.selection=L===1&&S===null?null:$(L),l.call(w),_.brush()}return T!==null&&S!==null?D:D(1)}):g.each(function(){var w=this,O=arguments,_=w.__brush,T=e.input(typeof v=="function"?v.apply(w,O):v,_.extent),S=u(w,O).beforestart();ro(w),_.selection=T===null?null:T,l.call(w),S.start(b).brush(b).end(b)})},c.clear=function(g,v){c.move(g,null,v)};function l(){var g=P(this),v=uo(this).selection;v?(g.selectAll(".selection").style("display",null).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1]),g.selectAll(".handle").style("display",null).attr("x",function(b){return b.type[b.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(b){return b.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(b){return b.type==="n"||b.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(b){return b.type==="e"||b.type==="w"?v[1][1]-v[0][1]+a:a})):g.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(g,v,b){var w=g.__brush.emitter;return w&&(!b||!w.clean)?w:new h(g,v,b)}function h(g,v,b){this.that=g,this.args=v,this.state=g.__brush,this.active=0,this.clean=b}h.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(g,v){return this.starting?(this.starting=!1,this.emit("start",g,v)):this.emit("brush",g),this},brush:function(g,v){return this.emit("brush",g,v),this},end:function(g,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",g,v)),this},emit:function(g,v,b){var w=P(this.that).datum();s.call(g,this.that,new W1(g,{sourceEvent:v,target:c,selection:e.output(this.state.selection),mode:b,dispatch:s}),w)}};function d(g){if(o&&!g.touches||!n.apply(this,arguments))return;var v=this,b=g.target.__data__.type,w=(r&&g.metaKey?b="overlay":b)==="selection"?wu:r&&g.altKey?Zn:Xn,O=e===co?null:Y1[b],_=e===rs?null:X1[b],T=uo(v),S=T.extent,$=T.selection,D=S[0][0],L,M,B=S[0][1],x,A,y=S[1][0],k,I,U=S[1][1],N,F,z=0,G=0,Q,j=O&&_&&r&&g.shiftKey,X,ot,tt=Array.from(g.touches||[g],et=>{const At=et.identifier;return et=wn(et,v),et.point0=et.slice(),et.identifier=At,et});ro(v);var lt=u(v,arguments,!0).beforestart();if(b==="overlay"){$&&(Q=!0);const et=[tt[0],tt[1]||tt[0]];T.selection=$=[[L=e===co?D:qt(et[0][0],et[1][0]),x=e===rs?B:qt(et[0][1],et[1][1])],[k=e===co?y:Wt(et[0][0],et[1][0]),N=e===rs?U:Wt(et[0][1],et[1][1])]],tt.length>1&&xt(g)}else L=$[0][0],x=$[0][1],k=$[1][0],N=$[1][1];M=L,A=x,I=k,F=N;var W=P(v).attr("pointer-events","none"),q=W.selectAll(".overlay").attr("cursor",Fe[b]);if(g.touches)lt.moved=V,lt.ended=pt;else{var Y=P(g.view).on("mousemove.brush",V,!0).on("mouseup.brush",pt,!0);r&&Y.on("keydown.brush",Vt,!0).on("keyup.brush",jt,!0),oy(g.view)}l.call(v),lt.start(g,w.name);function V(et){for(const At of et.changedTouches||[et])for(const zn of tt)zn.identifier===At.identifier&&(zn.cur=wn(At,v));if(j&&!X&&!ot&&tt.length===1){const At=tt[0];Eu(At.cur[0]-At[0])>Eu(At.cur[1]-At[1])?ot=!0:X=!0}for(const At of tt)At.cur&&(At[0]=At.cur[0],At[1]=At.cur[1]);Q=!0,oo(et),xt(et)}function xt(et){const At=tt[0],zn=At.point0;var Be;switch(z=At[0]-zn[0],G=At[1]-zn[1],w){case lo:case wu:{O&&(z=Wt(D-L,qt(y-k,z)),M=L+z,I=k+z),_&&(G=Wt(B-x,qt(U-N,G)),A=x+G,F=N+G);break}case Xn:{tt[1]?(O&&(M=Wt(D,qt(y,tt[0][0])),I=Wt(D,qt(y,tt[1][0])),O=1),_&&(A=Wt(B,qt(U,tt[0][1])),F=Wt(B,qt(U,tt[1][1])),_=1)):(O<0?(z=Wt(D-L,qt(y-L,z)),M=L+z,I=k):O>0&&(z=Wt(D-k,qt(y-k,z)),M=L,I=k+z),_<0?(G=Wt(B-x,qt(U-x,G)),A=x+G,F=N):_>0&&(G=Wt(B-N,qt(U-N,G)),A=x,F=N+G));break}case Zn:{O&&(M=Wt(D,qt(y,L-z*O)),I=Wt(D,qt(y,k+z*O))),_&&(A=Wt(B,qt(U,x-G*_)),F=Wt(B,qt(U,N+G*_)));break}}I<M&&(O*=-1,Be=L,L=k,k=Be,Be=M,M=I,I=Be,b in Ou&&q.attr("cursor",Fe[b=Ou[b]])),F<A&&(_*=-1,Be=x,x=N,N=Be,Be=A,A=F,F=Be,b in Tu&&q.attr("cursor",Fe[b=Tu[b]])),T.selection&&($=T.selection),X&&(M=$[0][0],I=$[1][0]),ot&&(A=$[0][1],F=$[1][1]),($[0][0]!==M||$[0][1]!==A||$[1][0]!==I||$[1][1]!==F)&&(T.selection=[[M,A],[I,F]],l.call(v),lt.brush(et,w.name))}function pt(et){if(q1(et),et.touches){if(et.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else ly(et.view,Q),Y.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);W.attr("pointer-events","all"),q.attr("cursor",Fe.overlay),T.selection&&($=T.selection),J1($)&&(T.selection=null,l.call(v)),lt.end(et,w.name)}function Vt(et){switch(et.keyCode){case 16:{j=O&&_;break}case 18:{w===Xn&&(O&&(k=I-z*O,L=M+z*O),_&&(N=F-G*_,x=A+G*_),w=Zn,xt(et));break}case 32:{(w===Xn||w===Zn)&&(O<0?k=I-z:O>0&&(L=M-z),_<0?N=F-G:_>0&&(x=A-G),w=lo,q.attr("cursor",Fe.selection),xt(et));break}default:return}oo(et)}function jt(et){switch(et.keyCode){case 16:{j&&(X=ot=j=!1,xt(et));break}case 18:{w===Zn&&(O<0?k=I:O>0&&(L=M),_<0?N=F:_>0&&(x=A),w=Xn,xt(et));break}case 32:{w===lo&&(et.altKey?(O&&(k=I-z*O,L=M+z*O),_&&(N=F-G*_,x=A+G*_),w=Zn):(O<0?k=I:O>0&&(L=M),_<0?N=F:_>0&&(x=A),w=Xn),q.attr("cursor",Fe[b]),xt(et));break}default:return}oo(et)}}function f(g){u(this,arguments).moved(g)}function p(g){u(this,arguments).ended(g)}function m(){var g=this.__brush||{selection:null};return g.extent=Su(t.apply(this,arguments)),g.dim=e,g}return c.extent=function(g){return arguments.length?(t=typeof g=="function"?g:ao(Su(g)),c):t},c.filter=function(g){return arguments.length?(n=typeof g=="function"?g:ao(!!g),c):n},c.touchable=function(g){return arguments.length?(i=typeof g=="function"?g:ao(!!g),c):i},c.handleSize=function(g){return arguments.length?(a=+g,c):a},c.keyModifiers=function(g){return arguments.length?(r=!!g,c):r},c.on=function(){var g=s.on.apply(s,arguments);return g===s?c:g},c}const ho=Math.PI,fo=2*ho,On=1e-6,ex=fo-On;function Cu(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function nx(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Cu;const n=10**t;return function(i){this._+=i[0];for(let r=1,s=i.length;r<s;++r)this._+=Math.round(arguments[r]*n)/n+i[r]}}let ix=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Cu:nx(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,i,r){this._append`Q${+t},${+n},${this._x1=+i},${this._y1=+r}`}bezierCurveTo(t,n,i,r,s,a){this._append`C${+t},${+n},${+i},${+r},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,i,r,s){if(t=+t,n=+n,i=+i,r=+r,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,c=i-t,l=r-n,u=a-t,h=o-n,d=u*u+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>On)if(!(Math.abs(h*c-l*u)>On)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=i-a,p=r-o,m=c*c+l*l,g=f*f+p*p,v=Math.sqrt(m),b=Math.sqrt(d),w=s*Math.tan((ho-Math.acos((m+d-g)/(2*v*b)))/2),O=w/b,_=w/v;Math.abs(O-1)>On&&this._append`L${t+O*u},${n+O*h}`,this._append`A${s},${s},0,0,${+(h*f>u*p)},${this._x1=t+_*c},${this._y1=n+_*l}`}}arc(t,n,i,r,s,a){if(t=+t,n=+n,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let o=i*Math.cos(r),c=i*Math.sin(r),l=t+o,u=n+c,h=1^a,d=a?r-s:s-r;this._x1===null?this._append`M${l},${u}`:(Math.abs(this._x1-l)>On||Math.abs(this._y1-u)>On)&&this._append`L${l},${u}`,i&&(d<0&&(d=d%fo+fo),d>ex?this._append`A${i},${i},0,1,${h},${t-o},${n-c}A${i},${i},0,1,${h},${this._x1=l},${this._y1=u}`:d>On&&this._append`A${i},${i},0,${+(d>=ho)},${h},${this._x1=t+i*Math.cos(s)},${this._y1=n+i*Math.sin(s)}`)}rect(t,n,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function rx(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function as(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function Kn(e){return e=as(Math.abs(e)),e?e[1]:NaN}function sx(e,t){return function(n,i){for(var r=n.length,s=[],a=0,o=e[0],c=0;r>0&&o>0&&(c+o+1>i&&(o=Math.max(1,i-c)),s.push(n.substring(r-=o,r+o)),!((c+=o+1)>i));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function ax(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var ox=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Vi(e){if(!(t=ox.exec(e)))throw new Error("invalid format: "+e);var t;return new po({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Vi.prototype=po.prototype;function po(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}po.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 lx(e){t:for(var t=e.length,n=1,i=-1,r;n<t;++n)switch(e[n]){case".":i=r=n;break;case"0":i===0&&(i=n),r=n;break;default:if(!+e[n])break t;i>0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(r+1):e}var Au;function cx(e,t){var n=as(e,t);if(!n)return e+"";var i=n[0],r=n[1],s=r-(Au=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,a=i.length;return s===a?i:s>a?i+new Array(s-a+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+as(e,Math.max(0,t+s-1))[0]}function $u(e,t){var n=as(e,t);if(!n)return e+"";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 Lu={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:rx,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>$u(e*100,t),r:$u,s:cx,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Du(e){return e}var ku=Array.prototype.map,Ru=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ux(e){var t=e.grouping===void 0||e.thousands===void 0?Du:sx(ku.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?Du:ax(ku.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function l(h){h=Vi(h);var d=h.fill,f=h.align,p=h.sign,m=h.symbol,g=h.zero,v=h.width,b=h.comma,w=h.precision,O=h.trim,_=h.type;_==="n"?(b=!0,_="g"):Lu[_]||(w===void 0&&(w=12),O=!0,_="g"),(g||d==="0"&&f==="=")&&(g=!0,d="0",f="=");var T=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",S=m==="$"?i:/[%p]/.test(_)?a:"",$=Lu[_],D=/[defgprs%]/.test(_);w=w===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function L(M){var B=T,x=S,A,y,k;if(_==="c")x=$(M)+x,M="";else{M=+M;var I=M<0||1/M<0;if(M=isNaN(M)?c:$(Math.abs(M),w),O&&(M=lx(M)),I&&+M==0&&p!=="+"&&(I=!1),B=(I?p==="("?p:o:p==="-"||p==="("?"":p)+B,x=(_==="s"?Ru[8+Au/3]:"")+x+(I&&p==="("?")":""),D){for(A=-1,y=M.length;++A<y;)if(k=M.charCodeAt(A),48>k||k>57){x=(k===46?r+M.slice(A+1):M.slice(A))+x,M=M.slice(0,A);break}}}b&&!g&&(M=t(M,1/0));var U=B.length+M.length+x.length,N=U<v?new Array(v-U+1).join(d):"";switch(b&&g&&(M=t(N+M,N.length?v-x.length:1/0),N=""),f){case"<":M=B+M+x+N;break;case"=":M=B+N+M+x;break;case"^":M=N.slice(0,U=N.length>>1)+B+M+x+N.slice(U);break;default:M=N+B+M+x;break}return s(M)}return L.toString=function(){return h+""},L}function u(h,d){var f=l((h=Vi(h),h.type="f",h)),p=Math.max(-8,Math.min(8,Math.floor(Kn(d)/3)))*3,m=Math.pow(10,-p),g=Ru[8+p/3];return function(v){return f(m*v)+g}}return{format:l,formatPrefix:u}}var os,go,Iu;hx({thousands:",",grouping:[3],currency:["$",""]});function hx(e){return os=ux(e),go=os.format,Iu=os.formatPrefix,os}function dx(e){return Math.max(0,-Kn(Math.abs(e)))}function fx(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Kn(t)/3)))*3-Kn(Math.abs(e)))}function px(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Kn(t)-Kn(e))+1}var mt=1e-6,Pu=1e-12,ut=Math.PI,ee=ut/2,Nu=ut/4,le=ut*2,Kt=180/ut,Dt=ut/180,vt=Math.abs,Uu=Math.atan,Tn=Math.atan2,bt=Math.cos,gx=Math.exp,mx=Math.log,gt=Math.sin,cn=Math.sign||function(e){return e>0?1:e<0?-1:0},we=Math.sqrt,vx=Math.tan;function yx(e){return e>1?0:e<-1?ut:Math.acos(e)}function ze(e){return e>1?ee:e<-1?-ee:Math.asin(e)}function he(){}function ls(e,t){e&&Hu.hasOwnProperty(e.type)&&Hu[e.type](e,t)}var Bu={Feature:function(e,t){ls(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)ls(n[i].geometry,t)}},Hu={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){mo(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)mo(n[i],t,0)},Polygon:function(e,t){Vu(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)Vu(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)ls(n[i],t)}};function mo(e,t,n){var i=-1,r=e.length-n,s;for(t.lineStart();++i<r;)s=e[i],t.point(s[0],s[1],s[2]);t.lineEnd()}function Vu(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)mo(e[n],t,1);t.polygonEnd()}function Qn(e,t){e&&Bu.hasOwnProperty(e.type)?Bu[e.type](e,t):ls(e,t)}function vo(e){return[Tn(e[1],e[0]),ze(e[2])]}function Jn(e){var t=e[0],n=e[1],i=bt(n);return[i*bt(t),i*gt(t),gt(n)]}function cs(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function us(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function yo(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function hs(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function xo(e){var t=we(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function bo(e,t){function n(i,r){return i=e(i,r),t(i[0],i[1])}return e.invert&&t.invert&&(n.invert=function(i,r){return i=t.invert(i,r),i&&e.invert(i[0],i[1])}),n}function wo(e,t){return vt(e)>ut&&(e-=Math.round(e/le)*le),[e,t]}wo.invert=wo;function Gu(e,t,n){return(e%=le)?t||n?bo(zu(e),ju(t,n)):zu(e):t||n?ju(t,n):wo}function Fu(e){return function(t,n){return t+=e,vt(t)>ut&&(t-=Math.round(t/le)*le),[t,n]}}function zu(e){var t=Fu(e);return t.invert=Fu(-e),t}function ju(e,t){var n=bt(e),i=gt(e),r=bt(t),s=gt(t);function a(o,c){var l=bt(c),u=bt(o)*l,h=gt(o)*l,d=gt(c),f=d*n+u*i;return[Tn(h*r-f*s,u*n-d*i),ze(f*r+h*s)]}return a.invert=function(o,c){var l=bt(c),u=bt(o)*l,h=gt(o)*l,d=gt(c),f=d*r-h*s;return[Tn(h*r+d*s,u*n+f*i),ze(f*n-u*i)]},a}function xx(e){e=Gu(e[0]*Dt,e[1]*Dt,e.length>2?e[2]*Dt:0);function t(n){return n=e(n[0]*Dt,n[1]*Dt),n[0]*=Kt,n[1]*=Kt,n}return t.invert=function(n){return n=e.invert(n[0]*Dt,n[1]*Dt),n[0]*=Kt,n[1]*=Kt,n},t}function bx(e,t,n,i,r,s){if(n){var a=bt(t),o=gt(t),c=i*n;r==null?(r=t+i*le,s=t-c/2):(r=Wu(a,r),s=Wu(a,s),(i>0?r<s:r>s)&&(r+=i*le));for(var l,u=r;i>0?u>s:u<s;u-=c)l=vo([a,-o*bt(u),-o*gt(u)]),e.point(l[0],l[1])}}function Wu(e,t){t=Jn(t),t[0]-=e,xo(t);var n=yx(-t[1]);return((-t[2]<0?-n:n)+le-mt)%le}function qu(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:he,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function ds(e,t){return vt(e[0]-t[0])<mt&&vt(e[1]-t[1])<mt}function fs(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function Yu(e,t,n,i,r){var s=[],a=[],o,c;if(e.forEach(function(p){if(!((m=p.length-1)<=0)){var m,g=p[0],v=p[m],b;if(ds(g,v)){if(!g[2]&&!v[2]){for(r.lineStart(),o=0;o<m;++o)r.point((g=p[o])[0],g[1]);r.lineEnd();return}v[0]+=2*mt}s.push(b=new fs(g,p,null,!0)),a.push(b.o=new fs(g,null,b,!1)),s.push(b=new fs(v,p,null,!1)),a.push(b.o=new fs(v,null,b,!0))}}),!!s.length){for(a.sort(t),Xu(s),Xu(a),o=0,c=a.length;o<c;++o)a[o].e=n=!n;for(var l=s[0],u,h;;){for(var d=l,f=!0;d.v;)if((d=d.n)===l)return;u=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(f)for(o=0,c=u.length;o<c;++o)r.point((h=u[o])[0],h[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(f)for(u=d.p.z,o=u.length-1;o>=0;--o)r.point((h=u[o])[0],h[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,u=d.z,f=!f}while(!d.v);r.lineEnd()}}}function Xu(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}function Eo(e){return vt(e[0])<=ut?e[0]:cn(e[0])*((vt(e[0])+ut)%le-ut)}function wx(e,t){var n=Eo(t),i=t[1],r=gt(i),s=[gt(n),-bt(n),0],a=0,o=0,c=new xn;r===1?i=ee+mt:r===-1&&(i=-ee-mt);for(var l=0,u=e.length;l<u;++l)if(d=(h=e[l]).length)for(var h,d,f=h[d-1],p=Eo(f),m=f[1]/2+Nu,g=gt(m),v=bt(m),b=0;b<d;++b,p=O,g=T,v=S,f=w){var w=h[b],O=Eo(w),_=w[1]/2+Nu,T=gt(_),S=bt(_),$=O-p,D=$>=0?1:-1,L=D*$,M=L>ut,B=g*T;if(c.add(Tn(B*D*gt(L),v*S+B*bt(L))),a+=M?$+D*le:$,M^p>=n^O>=n){var x=us(Jn(f),Jn(w));xo(x);var A=us(s,x);xo(A);var y=(M^$>=0?-1:1)*ze(A[2]);(i>y||i===y&&(x[0]||x[1]))&&(o+=M^$>=0?1:-1)}}return(a<-mt||a<mt&&c<-Pu)^o&1}function Zu(e,t,n,i){return function(r){var s=t(r),a=qu(),o=t(a),c=!1,l,u,h,d={point:f,lineStart:m,lineEnd:g,polygonStart:function(){d.point=v,d.lineStart=b,d.lineEnd=w,u=[],l=[]},polygonEnd:function(){d.point=f,d.lineStart=m,d.lineEnd=g,u=$c(u);var O=wx(l,i);u.length?(c||(r.polygonStart(),c=!0),Yu(u,_x,O,n,r)):O&&(c||(r.polygonStart(),c=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),c&&(r.polygonEnd(),c=!1),u=l=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function f(O,_){e(O,_)&&r.point(O,_)}function p(O,_){s.point(O,_)}function m(){d.point=p,s.lineStart()}function g(){d.point=f,s.lineEnd()}function v(O,_){h.push([O,_]),o.point(O,_)}function b(){o.lineStart(),h=[]}function w(){v(h[0][0],h[0][1]),o.lineEnd();var O=o.clean(),_=a.result(),T,S=_.length,$,D,L;if(h.pop(),l.push(h),h=null,!!S){if(O&1){if(D=_[0],($=D.length-1)>0){for(c||(r.polygonStart(),c=!0),r.lineStart(),T=0;T<$;++T)r.point((L=D[T])[0],L[1]);r.lineEnd()}return}S>1&&O&2&&_.push(_.pop().concat(_.shift())),u.push(_.filter(Ex))}}return d}}function Ex(e){return e.length>1}function _x(e,t){return((e=e.x)[0]<0?e[1]-ee-mt:ee-e[1])-((t=t.x)[0]<0?t[1]-ee-mt:ee-t[1])}const Ku=Zu(function(){return!0},Sx,Tx,[-ut,-ee]);function Sx(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(s,a){var o=s>0?ut:-ut,c=vt(s-t);vt(c-ut)<mt?(e.point(t,n=(n+a)/2>0?ee:-ee),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),r=0):i!==o&&c>=ut&&(vt(t-i)<mt&&(t-=i*mt),vt(s-o)<mt&&(s-=o*mt),n=Ox(t,n,s,a),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(o,n),r=0),e.point(t=s,n=a),i=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function Ox(e,t,n,i){var r,s,a=gt(e-n);return vt(a)>mt?Uu((gt(t)*(s=bt(i))*gt(n)-gt(i)*(r=bt(t))*gt(e))/(r*s*a)):(t+i)/2}function Tx(e,t,n,i){var r;if(e==null)r=n*ee,i.point(-ut,r),i.point(0,r),i.point(ut,r),i.point(ut,0),i.point(ut,-r),i.point(0,-r),i.point(-ut,-r),i.point(-ut,0),i.point(-ut,r);else if(vt(e[0]-t[0])>mt){var s=e[0]<t[0]?ut:-ut;r=n*s/2,i.point(-s,r),i.point(0,r),i.point(s,r)}else i.point(t[0],t[1])}function Mx(e){var t=bt(e),n=6*Dt,i=t>0,r=vt(t)>mt;function s(u,h,d,f){bx(f,e,n,d,u,h)}function a(u,h){return bt(u)*bt(h)>t}function o(u){var h,d,f,p,m;return{lineStart:function(){p=f=!1,m=1},point:function(g,v){var b=[g,v],w,O=a(g,v),_=i?O?0:l(g,v):O?l(g+(g<0?ut:-ut),v):0;if(!h&&(p=f=O)&&u.lineStart(),O!==f&&(w=c(h,b),(!w||ds(h,w)||ds(b,w))&&(b[2]=1)),O!==f)m=0,O?(u.lineStart(),w=c(b,h),u.point(w[0],w[1])):(w=c(h,b),u.point(w[0],w[1],2),u.lineEnd()),h=w;else if(r&&h&&i^O){var T;!(_&d)&&(T=c(b,h,!0))&&(m=0,i?(u.lineStart(),u.point(T[0][0],T[0][1]),u.point(T[1][0],T[1][1]),u.lineEnd()):(u.point(T[1][0],T[1][1]),u.lineEnd(),u.lineStart(),u.point(T[0][0],T[0][1],3)))}O&&(!h||!ds(h,b))&&u.point(b[0],b[1]),h=b,f=O,d=_},lineEnd:function(){f&&u.lineEnd(),h=null},clean:function(){return m|(p&&f)<<1}}}function c(u,h,d){var f=Jn(u),p=Jn(h),m=[1,0,0],g=us(f,p),v=cs(g,g),b=g[0],w=v-b*b;if(!w)return!d&&u;var O=t*v/w,_=-t*b/w,T=us(m,g),S=hs(m,O),$=hs(g,_);yo(S,$);var D=T,L=cs(S,D),M=cs(D,D),B=L*L-M*(cs(S,S)-1);if(!(B<0)){var x=we(B),A=hs(D,(-L-x)/M);if(yo(A,S),A=vo(A),!d)return A;var y=u[0],k=h[0],I=u[1],U=h[1],N;k<y&&(N=y,y=k,k=N);var F=k-y,z=vt(F-ut)<mt,G=z||F<mt;if(!z&&U<I&&(N=I,I=U,U=N),G?z?I+U>0^A[1]<(vt(A[0]-y)<mt?I:U):I<=A[1]&&A[1]<=U:F>ut^(y<=A[0]&&A[0]<=k)){var Q=hs(D,(-L+x)/M);return yo(Q,S),[A,vo(Q)]}}}function l(u,h){var d=i?e:ut-e,f=0;return u<-d?f|=1:u>d&&(f|=2),h<-d?f|=4:h>d&&(f|=8),f}return Zu(a,o,s,i?[0,-e]:[-ut,e-ut])}function Cx(e,t,n,i,r,s){var a=e[0],o=e[1],c=t[0],l=t[1],u=0,h=1,d=c-a,f=l-o,p;if(p=n-a,!(!d&&p>0)){if(p/=d,d<0){if(p<u)return;p<h&&(h=p)}else if(d>0){if(p>h)return;p>u&&(u=p)}if(p=r-a,!(!d&&p<0)){if(p/=d,d<0){if(p>h)return;p>u&&(u=p)}else if(d>0){if(p<u)return;p<h&&(h=p)}if(p=i-o,!(!f&&p>0)){if(p/=f,f<0){if(p<u)return;p<h&&(h=p)}else if(f>0){if(p>h)return;p>u&&(u=p)}if(p=s-o,!(!f&&p<0)){if(p/=f,f<0){if(p>h)return;p>u&&(u=p)}else if(f>0){if(p<u)return;p<h&&(h=p)}return u>0&&(e[0]=a+u*d,e[1]=o+u*f),h<1&&(t[0]=a+h*d,t[1]=o+h*f),!0}}}}}var Gi=1e9,ps=-Gi;function Ax(e,t,n,i){function r(l,u){return e<=l&&l<=n&&t<=u&&u<=i}function s(l,u,h,d){var f=0,p=0;if(l==null||(f=a(l,h))!==(p=a(u,h))||c(l,u)<0^h>0)do d.point(f===0||f===3?e:n,f>1?i:t);while((f=(f+h+4)%4)!==p);else d.point(u[0],u[1])}function a(l,u){return vt(l[0]-e)<mt?u>0?0:3:vt(l[0]-n)<mt?u>0?2:1:vt(l[1]-t)<mt?u>0?1:0:u>0?3:2}function o(l,u){return c(l.x,u.x)}function c(l,u){var h=a(l,1),d=a(u,1);return h!==d?h-d:h===0?u[1]-l[1]:h===1?l[0]-u[0]:h===2?l[1]-u[1]:u[0]-l[0]}return function(l){var u=l,h=qu(),d,f,p,m,g,v,b,w,O,_,T,S={point:$,lineStart:B,lineEnd:x,polygonStart:L,polygonEnd:M};function $(y,k){r(y,k)&&u.point(y,k)}function D(){for(var y=0,k=0,I=f.length;k<I;++k)for(var U=f[k],N=1,F=U.length,z=U[0],G,Q,j=z[0],X=z[1];N<F;++N)G=j,Q=X,z=U[N],j=z[0],X=z[1],Q<=i?X>i&&(j-G)*(i-Q)>(X-Q)*(e-G)&&++y:X<=i&&(j-G)*(i-Q)<(X-Q)*(e-G)&&--y;return y}function L(){u=h,d=[],f=[],T=!0}function M(){var y=D(),k=T&&y,I=(d=$c(d)).length;(k||I)&&(l.polygonStart(),k&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),I&&Yu(d,o,y,s,l),l.polygonEnd()),u=l,d=f=p=null}function B(){S.point=A,f&&f.push(p=[]),_=!0,O=!1,b=w=NaN}function x(){d&&(A(m,g),v&&O&&h.rejoin(),d.push(h.result())),S.point=$,O&&u.lineEnd()}function A(y,k){var I=r(y,k);if(f&&p.push([y,k]),_)m=y,g=k,v=I,_=!1,I&&(u.lineStart(),u.point(y,k));else if(I&&O)u.point(y,k);else{var U=[b=Math.max(ps,Math.min(Gi,b)),w=Math.max(ps,Math.min(Gi,w))],N=[y=Math.max(ps,Math.min(Gi,y)),k=Math.max(ps,Math.min(Gi,k))];Cx(U,N,e,t,n,i)?(O||(u.lineStart(),u.point(U[0],U[1])),u.point(N[0],N[1]),I||u.lineEnd(),T=!1):I&&(u.lineStart(),u.point(y,k),T=!1)}b=y,w=k,O=I}return S}}const _o=e=>e;var So=new xn,Oo=new xn,Qu,Ju,To,Mo,un={point:he,lineStart:he,lineEnd:he,polygonStart:function(){un.lineStart=$x,un.lineEnd=Dx},polygonEnd:function(){un.lineStart=un.lineEnd=un.point=he,So.add(vt(Oo)),Oo=new xn},result:function(){var e=So/2;return So=new xn,e}};function $x(){un.point=Lx}function Lx(e,t){un.point=th,Qu=To=e,Ju=Mo=t}function th(e,t){Oo.add(Mo*e-To*t),To=e,Mo=t}function Dx(){th(Qu,Ju)}const eh=un;var ti=1/0,gs=ti,Fi=-ti,ms=Fi,kx={point:Rx,lineStart:he,lineEnd:he,polygonStart:he,polygonEnd:he,result:function(){var e=[[ti,gs],[Fi,ms]];return Fi=ms=-(gs=ti=1/0),e}};function Rx(e,t){e<ti&&(ti=e),e>Fi&&(Fi=e),t<gs&&(gs=t),t>ms&&(ms=t)}const vs=kx;var Co=0,Ao=0,zi=0,ys=0,xs=0,ei=0,$o=0,Lo=0,ji=0,nh,ih,De,ke,Ee={point:Mn,lineStart:rh,lineEnd:sh,polygonStart:function(){Ee.lineStart=Nx,Ee.lineEnd=Ux},polygonEnd:function(){Ee.point=Mn,Ee.lineStart=rh,Ee.lineEnd=sh},result:function(){var e=ji?[$o/ji,Lo/ji]:ei?[ys/ei,xs/ei]:zi?[Co/zi,Ao/zi]:[NaN,NaN];return Co=Ao=zi=ys=xs=ei=$o=Lo=ji=0,e}};function Mn(e,t){Co+=e,Ao+=t,++zi}function rh(){Ee.point=Ix}function Ix(e,t){Ee.point=Px,Mn(De=e,ke=t)}function Px(e,t){var n=e-De,i=t-ke,r=we(n*n+i*i);ys+=r*(De+e)/2,xs+=r*(ke+t)/2,ei+=r,Mn(De=e,ke=t)}function sh(){Ee.point=Mn}function Nx(){Ee.point=Bx}function Ux(){ah(nh,ih)}function Bx(e,t){Ee.point=ah,Mn(nh=De=e,ih=ke=t)}function ah(e,t){var n=e-De,i=t-ke,r=we(n*n+i*i);ys+=r*(De+e)/2,xs+=r*(ke+t)/2,ei+=r,r=ke*e-De*t,$o+=r*(De+e),Lo+=r*(ke+t),ji+=r*3,Mn(De=e,ke=t)}const oh=Ee;function lh(e){this._context=e}lh.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,le);break}}},result:he};var Do=new xn,ko,ch,uh,Wi,qi,bs={point:he,lineStart:function(){bs.point=Hx},lineEnd:function(){ko&&hh(ch,uh),bs.point=he},polygonStart:function(){ko=!0},polygonEnd:function(){ko=null},result:function(){var e=+Do;return Do=new xn,e}};function Hx(e,t){bs.point=hh,ch=Wi=e,uh=qi=t}function hh(e,t){Wi-=e,qi-=t,Do.add(we(Wi*Wi+qi*qi)),Wi=e,qi=t}const dh=bs;let fh,ws,ph,gh;class mh{constructor(t){this._append=t==null?vh:Vx(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==ph||this._append!==ws){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,ph=i,ws=this._append,gh=this._,this._=r}this._+=gh;break}}}result(){const t=this._;return this._="",t.length?t:null}}function vh(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Vx(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return vh;if(t!==fh){const n=10**t;fh=t,ws=function(r){let s=1;this._+=r[0];for(const a=r.length;s<a;++s)this._+=Math.round(arguments[s]*n)/n+r[s]}}return ws}function Gx(e,t){let n=3,i=4.5,r,s;function a(o){return o&&(typeof i=="function"&&s.pointRadius(+i.apply(this,arguments)),Qn(o,r(s))),s.result()}return a.area=function(o){return Qn(o,r(eh)),eh.result()},a.measure=function(o){return Qn(o,r(dh)),dh.result()},a.bounds=function(o){return Qn(o,r(vs)),vs.result()},a.centroid=function(o){return Qn(o,r(oh)),oh.result()},a.projection=function(o){return arguments.length?(r=o==null?(e=null,_o):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new mh(n)):new lh(t=o),typeof i!="function"&&s.pointRadius(i),a):t},a.pointRadius=function(o){return arguments.length?(i=typeof o=="function"?o:(s.pointRadius(+o),+o),a):i},a.digits=function(o){if(!arguments.length)return n;if(o==null)n=null;else{const c=Math.floor(o);if(!(c>=0))throw new RangeError(`invalid digits: ${o}`);n=c}return t===null&&(s=new mh(n)),a},a.projection(e).digits(n).context(t)}function Ro(e){return function(t){var n=new Io;for(var i in e)n[i]=e[i];return n.stream=t,n}}function Io(){}Io.prototype={constructor:Io,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Po(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),Qn(n,e.stream(vs)),t(vs.result()),i!=null&&e.clipExtent(i),e}function yh(e,t,n){return Po(e,function(i){var r=t[1][0]-t[0][0],s=t[1][1]-t[0][1],a=Math.min(r/(i[1][0]-i[0][0]),s/(i[1][1]-i[0][1])),o=+t[0][0]+(r-a*(i[1][0]+i[0][0]))/2,c=+t[0][1]+(s-a*(i[1][1]+i[0][1]))/2;e.scale(150*a).translate([o,c])},n)}function Fx(e,t,n){return yh(e,[[0,0],t],n)}function zx(e,t,n){return Po(e,function(i){var r=+t,s=r/(i[1][0]-i[0][0]),a=(r-s*(i[1][0]+i[0][0]))/2,o=-s*i[0][1];e.scale(150*s).translate([a,o])},n)}function jx(e,t,n){return Po(e,function(i){var r=+t,s=r/(i[1][1]-i[0][1]),a=-s*i[0][0],o=(r-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([a,o])},n)}var xh=16,Wx=bt(30*Dt);function bh(e,t){return+t?Yx(e,t):qx(e)}function qx(e){return Ro({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Yx(e,t){function n(i,r,s,a,o,c,l,u,h,d,f,p,m,g){var v=l-i,b=u-r,w=v*v+b*b;if(w>4*t&&m--){var O=a+d,_=o+f,T=c+p,S=we(O*O+_*_+T*T),$=ze(T/=S),D=vt(vt(T)-1)<mt||vt(s-h)<mt?(s+h)/2:Tn(_,O),L=e(D,$),M=L[0],B=L[1],x=M-i,A=B-r,y=b*x-v*A;(y*y/w>t||vt((v*x+b*A)/w-.5)>.3||a*d+o*f+c*p<Wx)&&(n(i,r,s,a,o,c,M,B,D,O/=S,_/=S,T,m,g),g.point(M,B),n(M,B,D,O,_,T,l,u,h,d,f,p,m,g))}}return function(i){var r,s,a,o,c,l,u,h,d,f,p,m,g={point:v,lineStart:b,lineEnd:O,polygonStart:function(){i.polygonStart(),g.lineStart=_},polygonEnd:function(){i.polygonEnd(),g.lineStart=b}};function v($,D){$=e($,D),i.point($[0],$[1])}function b(){h=NaN,g.point=w,i.lineStart()}function w($,D){var L=Jn([$,D]),M=e($,D);n(h,d,u,f,p,m,h=M[0],d=M[1],u=$,f=L[0],p=L[1],m=L[2],xh,i),i.point(h,d)}function O(){g.point=v,i.lineEnd()}function _(){b(),g.point=T,g.lineEnd=S}function T($,D){w(r=$,D),s=h,a=d,o=f,c=p,l=m,g.point=w}function S(){n(h,d,u,f,p,m,s,a,r,o,c,l,xh,i),g.lineEnd=O,O()}return g}}var Xx=Ro({point:function(e,t){this.stream.point(e*Dt,t*Dt)}});function Zx(e){return Ro({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function Kx(e,t,n,i,r){function s(a,o){return a*=i,o*=r,[t+e*a,n-e*o]}return s.invert=function(a,o){return[(a-t)/e*i,(n-o)/e*r]},s}function wh(e,t,n,i,r,s){if(!s)return Kx(e,t,n,i,r);var a=bt(s),o=gt(s),c=a*e,l=o*e,u=a/e,h=o/e,d=(o*n-a*t)/e,f=(o*t+a*n)/e;function p(m,g){return m*=i,g*=r,[c*m-l*g+t,n-l*m-c*g]}return p.invert=function(m,g){return[i*(u*m-h*g+d),r*(f-h*m-u*g)]},p}function Es(e){return Eh(function(){return e})()}function Eh(e){var t,n=150,i=480,r=250,s=0,a=0,o=0,c=0,l=0,u,h=0,d=1,f=1,p=null,m=Ku,g=null,v,b,w,O=_o,_=.5,T,S,$,D,L;function M(y){return $(y[0]*Dt,y[1]*Dt)}function B(y){return y=$.invert(y[0],y[1]),y&&[y[0]*Kt,y[1]*Kt]}M.stream=function(y){return D&&L===y?D:D=Xx(Zx(u)(m(T(O(L=y)))))},M.preclip=function(y){return arguments.length?(m=y,p=void 0,A()):m},M.postclip=function(y){return arguments.length?(O=y,g=v=b=w=null,A()):O},M.clipAngle=function(y){return arguments.length?(m=+y?Mx(p=y*Dt):(p=null,Ku),A()):p*Kt},M.clipExtent=function(y){return arguments.length?(O=y==null?(g=v=b=w=null,_o):Ax(g=+y[0][0],v=+y[0][1],b=+y[1][0],w=+y[1][1]),A()):g==null?null:[[g,v],[b,w]]},M.scale=function(y){return arguments.length?(n=+y,x()):n},M.translate=function(y){return arguments.length?(i=+y[0],r=+y[1],x()):[i,r]},M.center=function(y){return arguments.length?(s=y[0]%360*Dt,a=y[1]%360*Dt,x()):[s*Kt,a*Kt]},M.rotate=function(y){return arguments.length?(o=y[0]%360*Dt,c=y[1]%360*Dt,l=y.length>2?y[2]%360*Dt:0,x()):[o*Kt,c*Kt,l*Kt]},M.angle=function(y){return arguments.length?(h=y%360*Dt,x()):h*Kt},M.reflectX=function(y){return arguments.length?(d=y?-1:1,x()):d<0},M.reflectY=function(y){return arguments.length?(f=y?-1:1,x()):f<0},M.precision=function(y){return arguments.length?(T=bh(S,_=y*y),A()):we(_)},M.fitExtent=function(y,k){return yh(M,y,k)},M.fitSize=function(y,k){return Fx(M,y,k)},M.fitWidth=function(y,k){return zx(M,y,k)},M.fitHeight=function(y,k){return jx(M,y,k)};function x(){var y=wh(n,0,0,d,f,h).apply(null,t(s,a)),k=wh(n,i-y[0],r-y[1],d,f,h);return u=Gu(o,c,l),S=bo(t,k),$=bo(u,S),T=bh(S,_),A()}function A(){return D=L=null,M}return function(){return t=e.apply(this,arguments),M.invert=t.invert&&B,x()}}function _h(e){var t=0,n=ut/3,i=Eh(e),r=i(t,n);return r.parallels=function(s){return arguments.length?i(t=s[0]*Dt,n=s[1]*Dt):[t*Kt,n*Kt]},r}function Qx(e){var t=bt(e);function n(i,r){return[i*t,gt(r)/t]}return n.invert=function(i,r){return[i/t,ze(r*t)]},n}function Jx(e,t){var n=gt(e),i=(n+gt(t))/2;if(vt(i)<mt)return Qx(e);var r=1+n*(2*i-n),s=we(r)/i;function a(o,c){var l=we(r-2*i*gt(c))/i;return[l*gt(o*=i),s-l*bt(o)]}return a.invert=function(o,c){var l=s-c,u=Tn(o,vt(l))*cn(l);return l*i<0&&(u-=ut*cn(o)*cn(l)),[u/i,ze((r-(o*o+l*l)*i*i)/(2*i))]},a}function Sh(){return _h(Jx).scale(155.424).center([0,33.6442])}function tb(){return Sh().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function No(e,t){return[e,mx(vx((ee+t)/2))]}No.invert=function(e,t){return[e,2*Uu(gx(t))-ee]};function eb(){return nb(No).scale(961/le)}function nb(e){var t=Es(e),n=t.center,i=t.scale,r=t.translate,s=t.clipExtent,a=null,o,c,l;t.scale=function(h){return arguments.length?(i(h),u()):i()},t.translate=function(h){return arguments.length?(r(h),u()):r()},t.center=function(h){return arguments.length?(n(h),u()):n()},t.clipExtent=function(h){return arguments.length?(h==null?a=o=c=l=null:(a=+h[0][0],o=+h[0][1],c=+h[1][0],l=+h[1][1]),u()):a==null?null:[[a,o],[c,l]]};function u(){var h=ut*i(),d=t(xx(t.rotate()).invert([0,0]));return s(a==null?[[d[0]-h,d[1]-h],[d[0]+h,d[1]+h]]:e===No?[[Math.max(d[0]-h,a),o],[Math.min(d[0]+h,c),l]]:[[a,Math.max(d[1]-h,o)],[c,Math.min(d[1]+h,l)]])}return u()}function _s(e,t){return[e,t]}_s.invert=_s;function ib(){return Es(_s).scale(152.63)}function rb(e,t){var n=bt(e),i=e===t?gt(e):(n-bt(t))/(t-e),r=n/i+e;if(vt(i)<mt)return _s;function s(a,o){var c=r-o,l=i*a;return[c*gt(l),r-c*bt(l)]}return s.invert=function(a,o){var c=r-o,l=Tn(a,vt(c))*cn(c);return c*i<0&&(l-=ut*cn(a)*cn(c)),[l/i,r-cn(i)*we(a*a+c*c)]},s}function sb(){return _h(rb).scale(131.154).center([0,13.9389])}var Yi=1.340264,Xi=-.081106,Zi=893e-6,Ki=.003796,Ss=we(3)/2,ab=12;function Oh(e,t){var n=ze(Ss*gt(t)),i=n*n,r=i*i*i;return[e*bt(n)/(Ss*(Yi+3*Xi*i+r*(7*Zi+9*Ki*i))),n*(Yi+Xi*i+r*(Zi+Ki*i))]}Oh.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,s=0,a,o,c;s<ab&&(o=n*(Yi+Xi*i+r*(Zi+Ki*i))-t,c=Yi+3*Xi*i+r*(7*Zi+9*Ki*i),n-=a=o/c,i=n*n,r=i*i*i,!(vt(a)<Pu));++s);return[Ss*e*(Yi+3*Xi*i+r*(7*Zi+9*Ki*i))/bt(n),ze(gt(n)/Ss)]};function ob(){return Es(Oh).scale(177.158)}function Th(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),t*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}Th.invert=function(e,t){var n=t,i=25,r;do{var s=n*n,a=s*s;n-=r=(n*(1.007226+s*(.015085+a*(-.044475+.028874*s-.005916*a)))-t)/(1.007226+s*(.015085*3+a*(-.044475*7+.028874*9*s-.005916*11*a)))}while(vt(r)>mt&&--i>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function lb(){return Es(Th).scale(175.295)}function cb(e,t){return e.parent===t.parent?1:2}function ub(e){return e.reduce(hb,0)/e.length}function hb(e,t){return e+t.x}function db(e){return 1+e.reduce(fb,0)}function fb(e,t){return Math.max(e,t.y)}function pb(e){for(var t;t=e.children;)e=t[0];return e}function gb(e){for(var t;t=e.children;)e=t[t.length-1];return e}function mb(){var e=cb,t=1,n=1,i=!1;function r(s){var a,o=0;s.eachAfter(function(d){var f=d.children;f?(d.x=ub(f),d.y=db(f)):(d.x=a?o+=e(d,a):0,d.y=0,a=d)});var c=pb(s),l=gb(s),u=c.x-e(c,l)/2,h=l.x+e(l,c)/2;return s.eachAfter(i?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-u)/(h-u)*t,d.y=(1-(s.y?d.y/s.y:1))*n})}return r.separation=function(s){return arguments.length?(e=s,r):e},r.size=function(s){return arguments.length?(i=!1,t=+s[0],n=+s[1],r):i?null:[t,n]},r.nodeSize=function(s){return arguments.length?(i=!0,t=+s[0],n=+s[1],r):i?[t,n]:null},r}function vb(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function yb(){return this.eachAfter(vb)}function xb(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function bb(e,t){for(var n=this,i=[n],r,s,a=-1;n=i.pop();)if(e.call(t,n,++a,this),r=n.children)for(s=r.length-1;s>=0;--s)i.push(r[s]);return this}function wb(e,t){for(var n=this,i=[n],r=[],s,a,o,c=-1;n=i.pop();)if(r.push(n),s=n.children)for(a=0,o=s.length;a<o;++a)i.push(s[a]);for(;n=r.pop();)e.call(t,n,++c,this);return this}function Eb(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function _b(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})}function Sb(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Ob(e){for(var t=this,n=Tb(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function Tb(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function Mb(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Cb(){return Array.from(this)}function Ab(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function $b(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Lb(){var e=this,t,n=[e],i,r,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,s=i.length;r<s;++r)n.push(i[r]);while(n.length)}function Qi(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Rb)):t===void 0&&(t=kb);for(var n=new Ji(e),i,r=[n],s,a,o,c;i=r.pop();)if((a=t(i.data))&&(c=(a=Array.from(a)).length))for(i.children=a,o=c-1;o>=0;--o)r.push(s=a[o]=new Ji(a[o])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(Pb)}function Db(){return Qi(this).eachBefore(Ib)}function kb(e){return e.children}function Rb(e){return Array.isArray(e)?e[1]:null}function Ib(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Pb(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ji(e){this.data=e,this.depth=this.height=0,this.parent=null}Ji.prototype=Qi.prototype={constructor:Ji,count:yb,each:xb,eachAfter:wb,eachBefore:bb,find:Eb,sum:_b,sort:Sb,path:Ob,ancestors:Mb,descendants:Cb,leaves:Ab,links:$b,copy:Db,[Symbol.iterator]:Lb};function Nb(e){return e==null?null:Mh(e)}function Mh(e){if(typeof e!="function")throw new Error;return e}function Cn(){return 0}function ni(e){return function(){return e}}const Ub=1664525,Bb=1013904223,Ch=4294967296;function Hb(){let e=1;return()=>(e=(Ub*e+Bb)%Ch)/Ch}function Vb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Gb(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function Fb(e,t){for(var n=0,i=(e=Gb(Array.from(e),t)).length,r=[],s,a;n<i;)s=e[n],a&&Ah(a,s)?++n:(a=jb(r=zb(r,s)),n=0);return a}function zb(e,t){var n,i;if(Uo(t,e))return[t];for(n=0;n<e.length;++n)if(Os(t,e[n])&&Uo(tr(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(Os(tr(e[n],e[i]),t)&&Os(tr(e[n],t),e[i])&&Os(tr(e[i],t),e[n])&&Uo($h(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function Os(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function Ah(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Uo(e,t){for(var n=0;n<t.length;++n)if(!Ah(e,t[n]))return!1;return!0}function jb(e){switch(e.length){case 1:return Wb(e[0]);case 2:return tr(e[0],e[1]);case 3:return $h(e[0],e[1],e[2])}}function Wb(e){return{x:e.x,y:e.y,r:e.r}}function tr(e,t){var n=e.x,i=e.y,r=e.r,s=t.x,a=t.y,o=t.r,c=s-n,l=a-i,u=o-r,h=Math.sqrt(c*c+l*l);return{x:(n+s+c/h*u)/2,y:(i+a+l/h*u)/2,r:(h+r+o)/2}}function $h(e,t,n){var i=e.x,r=e.y,s=e.r,a=t.x,o=t.y,c=t.r,l=n.x,u=n.y,h=n.r,d=i-a,f=i-l,p=r-o,m=r-u,g=c-s,v=h-s,b=i*i+r*r-s*s,w=b-a*a-o*o+c*c,O=b-l*l-u*u+h*h,_=f*p-d*m,T=(p*O-m*w)/(_*2)-i,S=(m*g-p*v)/_,$=(f*w-d*O)/(_*2)-r,D=(d*v-f*g)/_,L=S*S+D*D-1,M=2*(s+T*S+$*D),B=T*T+$*$-s*s,x=-(Math.abs(L)>1e-6?(M+Math.sqrt(M*M-4*L*B))/(2*L):B/M);return{x:i+T+S*x,y:r+$+D*x,r:x}}function Lh(e,t,n){var i=e.x-t.x,r,s,a=e.y-t.y,o,c,l=i*i+a*a;l?(s=t.r+n.r,s*=s,c=e.r+n.r,c*=c,s>c?(r=(l+c-s)/(2*l),o=Math.sqrt(Math.max(0,c/l-r*r)),n.x=e.x-r*i-o*a,n.y=e.y-r*a+o*i):(r=(l+s-c)/(2*l),o=Math.sqrt(Math.max(0,s/l-r*r)),n.x=t.x+r*i-o*a,n.y=t.y+r*a+o*i)):(n.x=t.x+n.r,n.y=t.y)}function Dh(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function kh(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,s=(t.y*n.r+n.y*t.r)/i;return r*r+s*s}function Ts(e){this._=e,this.next=null,this.previous=null}function qb(e,t){if(!(s=(e=Vb(e)).length))return 0;var n,i,r,s,a,o,c,l,u,h,d;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(s>2))return n.r+i.r;Lh(i,n,r=e[2]),n=new Ts(n),i=new Ts(i),r=new Ts(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;t:for(c=3;c<s;++c){Lh(n._,i._,r=e[c]),r=new Ts(r),l=i.next,u=n.previous,h=i._.r,d=n._.r;do if(h<=d){if(Dh(l._,r._)){i=l,n.next=i,i.previous=n,--c;continue t}h+=l._.r,l=l.next}else{if(Dh(u._,r._)){n=u,n.next=i,i.previous=n,--c;continue t}d+=u._.r,u=u.previous}while(l!==u.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,a=kh(n);(r=r.next)!==i;)(o=kh(r))<a&&(n=r,a=o);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=Fb(n,t),c=0;c<s;++c)n=e[c],n.x-=r.x,n.y-=r.y;return r.r}function Yb(e){return Math.sqrt(e.value)}function Xb(){var e=null,t=1,n=1,i=Cn;function r(s){const a=Hb();return s.x=t/2,s.y=n/2,e?s.eachBefore(Rh(e)).eachAfter(Bo(i,.5,a)).eachBefore(Ih(1)):s.eachBefore(Rh(Yb)).eachAfter(Bo(Cn,1,a)).eachAfter(Bo(i,s.r/Math.min(t,n),a)).eachBefore(Ih(Math.min(t,n)/(2*s.r))),s}return r.radius=function(s){return arguments.length?(e=Nb(s),r):e},r.size=function(s){return arguments.length?(t=+s[0],n=+s[1],r):[t,n]},r.padding=function(s){return arguments.length?(i=typeof s=="function"?s:ni(+s),r):i},r}function Rh(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Bo(e,t,n){return function(i){if(r=i.children){var r,s,a=r.length,o=e(i)*t||0,c;if(o)for(s=0;s<a;++s)r[s].r+=o;if(c=qb(r,n),o)for(s=0;s<a;++s)r[s].r-=o;i.r=c+o}}}function Ih(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function Zb(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Kb(e,t,n,i,r){for(var s=e.children,a,o=-1,c=s.length,l=e.value&&(i-t)/e.value;++o<c;)a=s[o],a.y0=n,a.y1=r,a.x0=t,a.x1=t+=a.value*l}function Qb(e,t){return e.parent===t.parent?1:2}function Ho(e){var t=e.children;return t?t[0]:e.t}function Vo(e){var t=e.children;return t?t[t.length-1]:e.t}function Jb(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function tw(e){for(var t=0,n=0,i=e.children,r=i.length,s;--r>=0;)s=i[r],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function ew(e,t,n){return e.a.parent===t.parent?e.a:n}function Ms(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Ms.prototype=Object.create(Ji.prototype);function nw(e){for(var t=new Ms(e,0),n,i=[t],r,s,a,o;n=i.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)i.push(r=n.children[a]=new Ms(s[a],a)),r.parent=n;return(t.parent=new Ms(null,0)).children=[t],t}function iw(){var e=Qb,t=1,n=1,i=null;function r(l){var u=nw(l);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),i)l.eachBefore(c);else{var h=l,d=l,f=l;l.eachBefore(function(b){b.x<h.x&&(h=b),b.x>d.x&&(d=b),b.depth>f.depth&&(f=b)});var p=h===d?1:e(h,d)/2,m=p-h.x,g=t/(d.x+p+m),v=n/(f.depth||1);l.eachBefore(function(b){b.x=(b.x+m)*g,b.y=b.depth*v})}return l}function s(l){var u=l.children,h=l.parent.children,d=l.i?h[l.i-1]:null;if(u){tw(l);var f=(u[0].z+u[u.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-f):l.z=f}else d&&(l.z=d.z+e(l._,d._));l.parent.A=o(l,d,l.parent.A||h[0])}function a(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function o(l,u,h){if(u){for(var d=l,f=l,p=u,m=d.parent.children[0],g=d.m,v=f.m,b=p.m,w=m.m,O;p=Vo(p),d=Ho(d),p&&d;)m=Ho(m),f=Vo(f),f.a=l,O=p.z+b-d.z-g+e(p._,d._),O>0&&(Jb(ew(p,l,h),l,O),g+=O,v+=O),b+=p.m,g+=d.m,w+=m.m,v+=f.m;p&&!Vo(f)&&(f.t=p,f.m+=b-v),d&&!Ho(m)&&(m.t=d,m.m+=g-w,h=l)}return h}function c(l){l.x*=t,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(e=l,r):e},r.size=function(l){return arguments.length?(i=!1,t=+l[0],n=+l[1],r):i?null:[t,n]},r.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],n=+l[1],r):i?[t,n]:null},r}function rw(e,t,n,i,r){for(var s=e.children,a,o=-1,c=s.length,l=e.value&&(r-n)/e.value;++o<c;)a=s[o],a.x0=t,a.x1=i,a.y0=n,a.y1=n+=a.value*l}var sw=(1+Math.sqrt(5))/2;function aw(e,t,n,i,r,s){for(var a=[],o=t.children,c,l,u=0,h=0,d=o.length,f,p,m=t.value,g,v,b,w,O,_,T;u<d;){f=r-n,p=s-i;do g=o[h++].value;while(!g&&h<d);for(v=b=g,_=Math.max(p/f,f/p)/(m*e),T=g*g*_,O=Math.max(b/T,T/v);h<d;++h){if(g+=l=o[h].value,l<v&&(v=l),l>b&&(b=l),T=g*g*_,w=Math.max(b/T,T/v),w>O){g-=l;break}O=w}a.push(c={value:g,dice:f<p,children:o.slice(u,h)}),c.dice?Kb(c,n,i,r,m?i+=p*g/m:s):rw(c,n,i,m?n+=f*g/m:r,s),m-=g,u=h}return a}const ow=function e(t){function n(i,r,s,a,o){aw(t,i,r,s,a,o)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(sw);function lw(){var e=ow,t=!1,n=1,i=1,r=[0],s=Cn,a=Cn,o=Cn,c=Cn,l=Cn;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(h),r=[0],t&&d.eachBefore(Zb),d}function h(d){var f=r[d.depth],p=d.x0+f,m=d.y0+f,g=d.x1-f,v=d.y1-f;g<p&&(p=g=(p+g)/2),v<m&&(m=v=(m+v)/2),d.x0=p,d.y0=m,d.x1=g,d.y1=v,d.children&&(f=r[d.depth+1]=s(d)/2,p+=l(d)-f,m+=a(d)-f,g-=o(d)-f,v-=c(d)-f,g<p&&(p=g=(p+g)/2),v<m&&(m=v=(m+v)/2),e(d,p,m,g,v))}return u.round=function(d){return arguments.length?(t=!!d,u):t},u.size=function(d){return arguments.length?(n=+d[0],i=+d[1],u):[n,i]},u.tile=function(d){return arguments.length?(e=Mh(d),u):e},u.padding=function(d){return arguments.length?u.paddingInner(d).paddingOuter(d):u.paddingInner()},u.paddingInner=function(d){return arguments.length?(s=typeof d=="function"?d:ni(+d),u):s},u.paddingOuter=function(d){return arguments.length?u.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):u.paddingTop()},u.paddingTop=function(d){return arguments.length?(a=typeof d=="function"?d:ni(+d),u):a},u.paddingRight=function(d){return arguments.length?(o=typeof d=="function"?d:ni(+d),u):o},u.paddingBottom=function(d){return arguments.length?(c=typeof d=="function"?d:ni(+d),u):c},u.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:ni(+d),u):l},u}function ii(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const Ph=Symbol("implicit");function Cs(){var e=new Tc,t=[],n=[],i=Ph;function r(s){let a=e.get(s);if(a===void 0){if(i!==Ph)return i;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return r.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new Tc;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return r},r.range=function(s){return arguments.length?(n=Array.from(s),r):n.slice()},r.unknown=function(s){return arguments.length?(i=s,r):i},r.copy=function(){return Cs(t,n).unknown(i)},ii.apply(r,arguments),r}function er(){var e=Cs().unknown(void 0),t=e.domain,n=e.range,i=0,r=1,s,a,o=!1,c=0,l=0,u=.5;delete e.unknown;function h(){var d=t().length,f=r<i,p=f?r:i,m=f?i:r;s=(m-p)/Math.max(1,d-c+l*2),o&&(s=Math.floor(s)),p+=(m-p-s*(d-c))*u,a=s*(1-c),o&&(p=Math.round(p),a=Math.round(a));var g=mv(d).map(function(v){return p+s*v});return n(f?g.reverse():g)}return e.domain=function(d){return arguments.length?(t(d),h()):t()},e.range=function(d){return arguments.length?([i,r]=d,i=+i,r=+r,h()):[i,r]},e.rangeRound=function(d){return[i,r]=d,i=+i,r=+r,o=!0,h()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(d){return arguments.length?(o=!!d,h()):o},e.padding=function(d){return arguments.length?(c=Math.min(1,l=+d),h()):c},e.paddingInner=function(d){return arguments.length?(c=Math.min(1,d),h()):c},e.paddingOuter=function(d){return arguments.length?(l=+d,h()):l},e.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),h()):u},e.copy=function(){return er(t(),[i,r]).round(o).paddingInner(c).paddingOuter(l).align(u)},ii.apply(h(),arguments)}function cw(e){return function(){return e}}function uw(e){return+e}var Nh=[0,1];function ri(e){return e}function Go(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:cw(isNaN(t)?NaN:.5)}function hw(e,t){var n;return e>t&&(n=e,e=t,t=n),function(i){return Math.max(e,Math.min(t,i))}}function dw(e,t,n){var i=e[0],r=e[1],s=t[0],a=t[1];return r<i?(i=Go(r,i),s=n(a,s)):(i=Go(i,r),s=n(s,a)),function(o){return s(i(o))}}function fw(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),s=new Array(i),a=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<i;)r[a]=Go(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var c=ka(e,o,1,i)-1;return s[c](r[c](o))}}function Fo(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Uh(){var e=Nh,t=Nh,n=Pi,i,r,s,a=ri,o,c,l;function u(){var d=Math.min(e.length,t.length);return a!==ri&&(a=hw(e[0],e[d-1])),o=d>2?fw:dw,c=l=null,h}function h(d){return d==null||isNaN(d=+d)?s:(c||(c=o(e.map(i),t,n)))(i(a(d)))}return h.invert=function(d){return a(r((l||(l=o(t,e.map(i),oe)))(d)))},h.domain=function(d){return arguments.length?(e=Array.from(d,uw),u()):e.slice()},h.range=function(d){return arguments.length?(t=Array.from(d),u()):t.slice()},h.rangeRound=function(d){return t=Array.from(d),n=su,u()},h.clamp=function(d){return arguments.length?(a=d?!0:ri,u()):a!==ri},h.interpolate=function(d){return arguments.length?(n=d,u()):n},h.unknown=function(d){return arguments.length?(s=d,h):s},function(d,f){return i=d,r=f,u()}}function Bh(){return Uh()(ri,ri)}function pw(e,t,n,i){var r=Ia(e,t,n),s;switch(i=Vi(i??",f"),i.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(s=fx(r,a))&&(i.precision=s),Iu(i,a)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(s=px(r,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=s-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(s=dx(r))&&(i.precision=s-(i.type==="%")*2);break}}return go(i)}function Hh(e){var t=e.domain;return e.ticks=function(n){var i=t();return Ur(i[0],i[i.length-1],n??10)},e.tickFormat=function(n,i){var r=t();return pw(r[0],r[r.length-1],n??10,i)},e.nice=function(n){n==null&&(n=10);var i=t(),r=0,s=i.length-1,a=i[r],o=i[s],c,l,u=10;for(o<a&&(l=a,a=o,o=l,l=r,r=s,s=l);u-- >0;){if(l=jn(a,o,n),l===c)return i[r]=a,i[s]=o,t(i);if(l>0)a=Math.floor(a/l)*l,o=Math.ceil(o/l)*l;else if(l<0)a=Math.ceil(a*l)/l,o=Math.floor(o*l)/l;else break;c=l}return e},e}function _e(){var e=Bh();return e.copy=function(){return Fo(e,_e())},ii.apply(e,arguments),Hh(e)}function Vh(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],s=e[i],a;return s<r&&(a=n,n=i,i=a,a=r,r=s,s=a),e[n]=t.floor(r),e[i]=t.ceil(s),e}function Gh(e){return Math.log(e)}function Fh(e){return Math.exp(e)}function gw(e){return-Math.log(-e)}function mw(e){return-Math.exp(-e)}function vw(e){return isFinite(e)?+("1e"+e):e<0?0:e}function yw(e){return e===10?vw:e===Math.E?Math.exp:t=>Math.pow(e,t)}function xw(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function zh(e){return(t,n)=>-e(-t,n)}function bw(e){const t=e(Gh,Fh),n=t.domain;let i=10,r,s;function a(){return r=xw(i),s=yw(i),n()[0]<0?(r=zh(r),s=zh(s),e(gw,mw)):e(Gh,Fh),t}return t.base=function(o){return arguments.length?(i=+o,a()):i},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const c=n();let l=c[0],u=c[c.length-1];const h=u<l;h&&([l,u]=[u,l]);let d=r(l),f=r(u),p,m;const g=o==null?10:+o;let v=[];if(!(i%1)&&f-d<g){if(d=Math.floor(d),f=Math.ceil(f),l>0){for(;d<=f;++d)for(p=1;p<i;++p)if(m=d<0?p/s(-d):p*s(d),!(m<l)){if(m>u)break;v.push(m)}}else for(;d<=f;++d)for(p=i-1;p>=1;--p)if(m=d>0?p/s(-d):p*s(d),!(m<l)){if(m>u)break;v.push(m)}v.length*2<g&&(v=Ur(l,u,g))}else v=Ur(d,f,Math.min(f-d,g)).map(s);return h?v.reverse():v},t.tickFormat=(o,c)=>{if(o==null&&(o=10),c==null&&(c=i===10?"s":","),typeof c!="function"&&(!(i%1)&&(c=Vi(c)).precision==null&&(c.trim=!0),c=go(c)),o===1/0)return c;const l=Math.max(1,i*o/t.ticks().length);return u=>{let h=u/s(Math.round(r(u)));return h*i<i-.5&&(h*=i),h<=l?c(u):""}},t.nice=()=>n(Vh(n(),{floor:o=>s(Math.floor(r(o))),ceil:o=>s(Math.ceil(r(o)))})),t}function jh(){const e=bw(Uh()).domain([1,10]);return e.copy=()=>Fo(e,jh()).base(e.base()),ii.apply(e,arguments),e}function zo(){var e=0,t=1,n=1,i=[.5],r=[0,1],s;function a(c){return c!=null&&c<=c?r[ka(i,c,0,n)]:s}function o(){var c=-1;for(i=new Array(n);++c<n;)i[c]=((c+1)*t-(c-n)*e)/(n+1);return a}return a.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,o()):[e,t]},a.range=function(c){return arguments.length?(n=(r=Array.from(c)).length-1,o()):r.slice()},a.invertExtent=function(c){var l=r.indexOf(c);return l<0?[NaN,NaN]:l<1?[e,i[0]]:l>=n?[i[n-1],t]:[i[l-1],i[l]]},a.unknown=function(c){return arguments.length&&(s=c),a},a.thresholds=function(){return i.slice()},a.copy=function(){return zo().domain([e,t]).range(r).unknown(s)},ii.apply(Hh(a),arguments)}const jo=new Date,Wo=new Date;function Rt(e,t,n,i){function r(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return r.floor=s=>(e(s=new Date(+s)),s),r.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),r.round=s=>{const a=r(s),o=r.ceil(s);return s-a<o-s?a:o},r.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),r.range=(s,a,o)=>{const c=[];if(s=r.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return c;let l;do c.push(l=new Date(+s)),t(s,o),e(s);while(l<s&&s<a);return c},r.filter=s=>Rt(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),n&&(r.count=(s,a)=>(jo.setTime(+s),Wo.setTime(+a),e(jo),e(Wo),Math.floor(n(jo,Wo))),r.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?r.filter(i?a=>i(a)%s===0:a=>r.count(0,a)%s===0):r)),r}const As=Rt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);As.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Rt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):As),As.range;const je=1e3,de=je*60,We=de*60,qe=We*24,qo=qe*7,Wh=qe*30,Yo=qe*365,si=Rt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*je)},(e,t)=>(t-e)/je,e=>e.getUTCSeconds());si.range;const Xo=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*je)},(e,t)=>{e.setTime(+e+t*de)},(e,t)=>(t-e)/de,e=>e.getMinutes());Xo.range,Rt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*de)},(e,t)=>(t-e)/de,e=>e.getUTCMinutes()).range;const Zo=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*je-e.getMinutes()*de)},(e,t)=>{e.setTime(+e+t*We)},(e,t)=>(t-e)/We,e=>e.getHours());Zo.range,Rt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*We)},(e,t)=>(t-e)/We,e=>e.getUTCHours()).range;const nr=Rt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*de)/qe,e=>e.getDate()-1);nr.range;const Ko=Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/qe,e=>e.getUTCDate()-1);Ko.range,Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/qe,e=>Math.floor(e/qe)).range;function An(e){return Rt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*de)/qo)}const $s=An(0),Ls=An(1),ww=An(2),Ew=An(3),ai=An(4),_w=An(5),Sw=An(6);$s.range,Ls.range,ww.range,Ew.range,ai.range,_w.range,Sw.range;function $n(e){return Rt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/qo)}const qh=$n(0),Ds=$n(1),Ow=$n(2),Tw=$n(3),oi=$n(4),Mw=$n(5),Cw=$n(6);qh.range,Ds.range,Ow.range,Tw.range,oi.range,Mw.range,Cw.range;const Qo=Rt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Qo.range,Rt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()).range;const Ye=Rt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Ye.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Ye.range;const Ln=Rt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ln.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Ln.range;function Aw(e,t,n,i,r,s){const a=[[si,1,je],[si,5,5*je],[si,15,15*je],[si,30,30*je],[s,1,de],[s,5,5*de],[s,15,15*de],[s,30,30*de],[r,1,We],[r,3,3*We],[r,6,6*We],[r,12,12*We],[i,1,qe],[i,2,2*qe],[n,1,qo],[t,1,Wh],[t,3,3*Wh],[e,1,Yo]];function o(l,u,h){const d=u<l;d&&([l,u]=[u,l]);const f=h&&typeof h.range=="function"?h:c(l,u,h),p=f?f.range(l,+u+1):[];return d?p.reverse():p}function c(l,u,h){const d=Math.abs(u-l)/h,f=Da(([,,g])=>g).right(a,d);if(f===a.length)return e.every(Ia(l/Yo,u/Yo,h));if(f===0)return As.every(Math.max(Ia(l,u,h),1));const[p,m]=a[d/a[f-1][2]<a[f][2]/d?f-1:f];return p.every(m)}return[o,c]}const[$w,Lw]=Aw(Ye,Qo,$s,nr,Zo,Xo);function Jo(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function tl(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ir(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Dw(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,s=e.days,a=e.shortDays,o=e.months,c=e.shortMonths,l=rr(r),u=sr(r),h=rr(s),d=sr(s),f=rr(a),p=sr(a),m=rr(o),g=sr(o),v=rr(c),b=sr(c),w={a:I,A:U,b:N,B:F,c:null,d:Jh,e:Jh,f:eE,g:hE,G:fE,H:Qw,I:Jw,j:tE,L:td,m:nE,M:iE,p:z,q:G,Q:ad,s:od,S:rE,u:sE,U:aE,V:oE,w:lE,W:cE,x:null,X:null,y:uE,Y:dE,Z:pE,"%":sd},O={a:Q,A:j,b:X,B:ot,c:null,d:nd,e:nd,f:yE,g:CE,G:$E,H:gE,I:mE,j:vE,L:id,m:xE,M:bE,p:tt,q:lt,Q:ad,s:od,S:wE,u:EE,U:_E,V:SE,w:OE,W:TE,x:null,X:null,y:ME,Y:AE,Z:LE,"%":sd},_={a:L,A:M,b:B,B:x,c:A,d:Kh,e:Kh,f:Yw,g:Zh,G:Xh,H:Qh,I:Qh,j:zw,L:qw,m:Fw,M:jw,p:D,q:Gw,Q:Zw,s:Kw,S:Ww,u:Nw,U:Uw,V:Bw,w:Pw,W:Hw,x:y,X:k,y:Zh,Y:Xh,Z:Vw,"%":Xw};w.x=T(n,w),w.X=T(i,w),w.c=T(t,w),O.x=T(n,O),O.X=T(i,O),O.c=T(t,O);function T(W,q){return function(Y){var V=[],xt=-1,pt=0,Vt=W.length,jt,et,At;for(Y instanceof Date||(Y=new Date(+Y));++xt<Vt;)W.charCodeAt(xt)===37&&(V.push(W.slice(pt,xt)),(et=Yh[jt=W.charAt(++xt)])!=null?jt=W.charAt(++xt):et=jt==="e"?" ":"0",(At=q[jt])&&(jt=At(Y,et)),V.push(jt),pt=xt+1);return V.push(W.slice(pt,xt)),V.join("")}}function S(W,q){return function(Y){var V=ir(1900,void 0,1),xt=$(V,W,Y+="",0),pt,Vt;if(xt!=Y.length)return null;if("Q"in V)return new Date(V.Q);if("s"in V)return new Date(V.s*1e3+("L"in V?V.L:0));if(q&&!("Z"in V)&&(V.Z=0),"p"in V&&(V.H=V.H%12+V.p*12),V.m===void 0&&(V.m="q"in V?V.q:0),"V"in V){if(V.V<1||V.V>53)return null;"w"in V||(V.w=1),"Z"in V?(pt=tl(ir(V.y,0,1)),Vt=pt.getUTCDay(),pt=Vt>4||Vt===0?Ds.ceil(pt):Ds(pt),pt=Ko.offset(pt,(V.V-1)*7),V.y=pt.getUTCFullYear(),V.m=pt.getUTCMonth(),V.d=pt.getUTCDate()+(V.w+6)%7):(pt=Jo(ir(V.y,0,1)),Vt=pt.getDay(),pt=Vt>4||Vt===0?Ls.ceil(pt):Ls(pt),pt=nr.offset(pt,(V.V-1)*7),V.y=pt.getFullYear(),V.m=pt.getMonth(),V.d=pt.getDate()+(V.w+6)%7)}else("W"in V||"U"in V)&&("w"in V||(V.w="u"in V?V.u%7:"W"in V?1:0),Vt="Z"in V?tl(ir(V.y,0,1)).getUTCDay():Jo(ir(V.y,0,1)).getDay(),V.m=0,V.d="W"in V?(V.w+6)%7+V.W*7-(Vt+5)%7:V.w+V.U*7-(Vt+6)%7);return"Z"in V?(V.H+=V.Z/100|0,V.M+=V.Z%100,tl(V)):Jo(V)}}function $(W,q,Y,V){for(var xt=0,pt=q.length,Vt=Y.length,jt,et;xt<pt;){if(V>=Vt)return-1;if(jt=q.charCodeAt(xt++),jt===37){if(jt=q.charAt(xt++),et=_[jt in Yh?q.charAt(xt++):jt],!et||(V=et(W,Y,V))<0)return-1}else if(jt!=Y.charCodeAt(V++))return-1}return V}function D(W,q,Y){var V=l.exec(q.slice(Y));return V?(W.p=u.get(V[0].toLowerCase()),Y+V[0].length):-1}function L(W,q,Y){var V=f.exec(q.slice(Y));return V?(W.w=p.get(V[0].toLowerCase()),Y+V[0].length):-1}function M(W,q,Y){var V=h.exec(q.slice(Y));return V?(W.w=d.get(V[0].toLowerCase()),Y+V[0].length):-1}function B(W,q,Y){var V=v.exec(q.slice(Y));return V?(W.m=b.get(V[0].toLowerCase()),Y+V[0].length):-1}function x(W,q,Y){var V=m.exec(q.slice(Y));return V?(W.m=g.get(V[0].toLowerCase()),Y+V[0].length):-1}function A(W,q,Y){return $(W,t,q,Y)}function y(W,q,Y){return $(W,n,q,Y)}function k(W,q,Y){return $(W,i,q,Y)}function I(W){return a[W.getDay()]}function U(W){return s[W.getDay()]}function N(W){return c[W.getMonth()]}function F(W){return o[W.getMonth()]}function z(W){return r[+(W.getHours()>=12)]}function G(W){return 1+~~(W.getMonth()/3)}function Q(W){return a[W.getUTCDay()]}function j(W){return s[W.getUTCDay()]}function X(W){return c[W.getUTCMonth()]}function ot(W){return o[W.getUTCMonth()]}function tt(W){return r[+(W.getUTCHours()>=12)]}function lt(W){return 1+~~(W.getUTCMonth()/3)}return{format:function(W){var q=T(W+="",w);return q.toString=function(){return W},q},parse:function(W){var q=S(W+="",!1);return q.toString=function(){return W},q},utcFormat:function(W){var q=T(W+="",O);return q.toString=function(){return W},q},utcParse:function(W){var q=S(W+="",!0);return q.toString=function(){return W},q}}}var Yh={"-":"",_:" ",0:"0"},Bt=/^\s*\d+/,kw=/^%/,Rw=/[\\^$*+?|[\]().{}]/g;function dt(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",s=r.length;return i+(s<n?new Array(n-s+1).join(t)+r:r)}function Iw(e){return e.replace(Rw,"\\$&")}function rr(e){return new RegExp("^(?:"+e.map(Iw).join("|")+")","i")}function sr(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Pw(e,t,n){var i=Bt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function Nw(e,t,n){var i=Bt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function Uw(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function Bw(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function Hw(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function Xh(e,t,n){var i=Bt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function Zh(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Vw(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Gw(e,t,n){var i=Bt.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function Fw(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function Kh(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function zw(e,t,n){var i=Bt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function Qh(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function jw(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Ww(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function qw(e,t,n){var i=Bt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Yw(e,t,n){var i=Bt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Xw(e,t,n){var i=kw.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Zw(e,t,n){var i=Bt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Kw(e,t,n){var i=Bt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function Jh(e,t){return dt(e.getDate(),t,2)}function Qw(e,t){return dt(e.getHours(),t,2)}function Jw(e,t){return dt(e.getHours()%12||12,t,2)}function tE(e,t){return dt(1+nr.count(Ye(e),e),t,3)}function td(e,t){return dt(e.getMilliseconds(),t,3)}function eE(e,t){return td(e,t)+"000"}function nE(e,t){return dt(e.getMonth()+1,t,2)}function iE(e,t){return dt(e.getMinutes(),t,2)}function rE(e,t){return dt(e.getSeconds(),t,2)}function sE(e){var t=e.getDay();return t===0?7:t}function aE(e,t){return dt($s.count(Ye(e)-1,e),t,2)}function ed(e){var t=e.getDay();return t>=4||t===0?ai(e):ai.ceil(e)}function oE(e,t){return e=ed(e),dt(ai.count(Ye(e),e)+(Ye(e).getDay()===4),t,2)}function lE(e){return e.getDay()}function cE(e,t){return dt(Ls.count(Ye(e)-1,e),t,2)}function uE(e,t){return dt(e.getFullYear()%100,t,2)}function hE(e,t){return e=ed(e),dt(e.getFullYear()%100,t,2)}function dE(e,t){return dt(e.getFullYear()%1e4,t,4)}function fE(e,t){var n=e.getDay();return e=n>=4||n===0?ai(e):ai.ceil(e),dt(e.getFullYear()%1e4,t,4)}function pE(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+dt(t/60|0,"0",2)+dt(t%60,"0",2)}function nd(e,t){return dt(e.getUTCDate(),t,2)}function gE(e,t){return dt(e.getUTCHours(),t,2)}function mE(e,t){return dt(e.getUTCHours()%12||12,t,2)}function vE(e,t){return dt(1+Ko.count(Ln(e),e),t,3)}function id(e,t){return dt(e.getUTCMilliseconds(),t,3)}function yE(e,t){return id(e,t)+"000"}function xE(e,t){return dt(e.getUTCMonth()+1,t,2)}function bE(e,t){return dt(e.getUTCMinutes(),t,2)}function wE(e,t){return dt(e.getUTCSeconds(),t,2)}function EE(e){var t=e.getUTCDay();return t===0?7:t}function _E(e,t){return dt(qh.count(Ln(e)-1,e),t,2)}function rd(e){var t=e.getUTCDay();return t>=4||t===0?oi(e):oi.ceil(e)}function SE(e,t){return e=rd(e),dt(oi.count(Ln(e),e)+(Ln(e).getUTCDay()===4),t,2)}function OE(e){return e.getUTCDay()}function TE(e,t){return dt(Ds.count(Ln(e)-1,e),t,2)}function ME(e,t){return dt(e.getUTCFullYear()%100,t,2)}function CE(e,t){return e=rd(e),dt(e.getUTCFullYear()%100,t,2)}function AE(e,t){return dt(e.getUTCFullYear()%1e4,t,4)}function $E(e,t){var n=e.getUTCDay();return e=n>=4||n===0?oi(e):oi.ceil(e),dt(e.getUTCFullYear()%1e4,t,4)}function LE(){return"+0000"}function sd(){return"%"}function ad(e){return+e}function od(e){return Math.floor(+e/1e3)}var li,ld;DE({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function DE(e){return li=Dw(e),ld=li.format,li.parse,li.utcFormat,li.utcParse,li}function kE(e){return new Date(e)}function RE(e){return e instanceof Date?+e:+new Date(+e)}function cd(e,t,n,i,r,s,a,o,c,l){var u=Bh(),h=u.invert,d=u.domain,f=l(".%L"),p=l(":%S"),m=l("%I:%M"),g=l("%I %p"),v=l("%a %d"),b=l("%b %d"),w=l("%B"),O=l("%Y");function _(T){return(c(T)<T?f:o(T)<T?p:a(T)<T?m:s(T)<T?g:i(T)<T?r(T)<T?v:b:n(T)<T?w:O)(T)}return u.invert=function(T){return new Date(h(T))},u.domain=function(T){return arguments.length?d(Array.from(T,RE)):d().map(kE)},u.ticks=function(T){var S=d();return e(S[0],S[S.length-1],T??10)},u.tickFormat=function(T,S){return S==null?_:l(S)},u.nice=function(T){var S=d();return(!T||typeof T.range!="function")&&(T=t(S[0],S[S.length-1],T??10)),T?d(Vh(S,T)):u},u.copy=function(){return Fo(u,cd(e,t,n,i,r,s,a,o,c,l))},u}function ud(){return ii.apply(cd($w,Lw,Ye,Qo,$s,nr,Zo,Xo,si,ld).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ct(e){return function(){return e}}const hd=Math.abs,Yt=Math.atan2,Dn=Math.cos,IE=Math.max,el=Math.min,Re=Math.sin,ci=Math.sqrt,Xt=1e-12,ar=Math.PI,ks=ar/2,Rs=2*ar;function PE(e){return e>1?0:e<-1?ar:Math.acos(e)}function dd(e){return e>=1?ks:e<=-1?-ks:Math.asin(e)}function Is(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new ix(t)}function NE(e){return e.innerRadius}function UE(e){return e.outerRadius}function BE(e){return e.startAngle}function HE(e){return e.endAngle}function VE(e){return e&&e.padAngle}function GE(e,t,n,i,r,s,a,o){var c=n-e,l=i-t,u=a-r,h=o-s,d=h*c-u*l;if(!(d*d<Xt))return d=(u*(t-s)-h*(e-r))/d,[e+d*c,t+d*l]}function Ps(e,t,n,i,r,s,a){var o=e-n,c=t-i,l=(a?s:-s)/ci(o*o+c*c),u=l*c,h=-l*o,d=e+u,f=t+h,p=n+u,m=i+h,g=(d+p)/2,v=(f+m)/2,b=p-d,w=m-f,O=b*b+w*w,_=r-s,T=d*m-p*f,S=(w<0?-1:1)*ci(IE(0,_*_*O-T*T)),$=(T*w-b*S)/O,D=(-T*b-w*S)/O,L=(T*w+b*S)/O,M=(-T*b+w*S)/O,B=$-g,x=D-v,A=L-g,y=M-v;return B*B+x*x>A*A+y*y&&($=L,D=M),{cx:$,cy:D,x01:-u,y01:-h,x11:$*(r/_-1),y11:D*(r/_-1)}}function or(){var e=NE,t=UE,n=ct(0),i=null,r=BE,s=HE,a=VE,o=null,c=Is(l);function l(){var u,h,d=+e.apply(this,arguments),f=+t.apply(this,arguments),p=r.apply(this,arguments)-ks,m=s.apply(this,arguments)-ks,g=hd(m-p),v=m>p;if(o||(o=u=c()),f<d&&(h=f,f=d,d=h),!(f>Xt))o.moveTo(0,0);else if(g>Rs-Xt)o.moveTo(f*Dn(p),f*Re(p)),o.arc(0,0,f,p,m,!v),d>Xt&&(o.moveTo(d*Dn(m),d*Re(m)),o.arc(0,0,d,m,p,v));else{var b=p,w=m,O=p,_=m,T=g,S=g,$=a.apply(this,arguments)/2,D=$>Xt&&(i?+i.apply(this,arguments):ci(d*d+f*f)),L=el(hd(f-d)/2,+n.apply(this,arguments)),M=L,B=L,x,A;if(D>Xt){var y=dd(D/d*Re($)),k=dd(D/f*Re($));(T-=y*2)>Xt?(y*=v?1:-1,O+=y,_-=y):(T=0,O=_=(p+m)/2),(S-=k*2)>Xt?(k*=v?1:-1,b+=k,w-=k):(S=0,b=w=(p+m)/2)}var I=f*Dn(b),U=f*Re(b),N=d*Dn(_),F=d*Re(_);if(L>Xt){var z=f*Dn(w),G=f*Re(w),Q=d*Dn(O),j=d*Re(O),X;if(g<ar)if(X=GE(I,U,Q,j,z,G,N,F)){var ot=I-X[0],tt=U-X[1],lt=z-X[0],W=G-X[1],q=1/Re(PE((ot*lt+tt*W)/(ci(ot*ot+tt*tt)*ci(lt*lt+W*W)))/2),Y=ci(X[0]*X[0]+X[1]*X[1]);M=el(L,(d-Y)/(q-1)),B=el(L,(f-Y)/(q+1))}else M=B=0}S>Xt?B>Xt?(x=Ps(Q,j,I,U,f,B,v),A=Ps(z,G,N,F,f,B,v),o.moveTo(x.cx+x.x01,x.cy+x.y01),B<L?o.arc(x.cx,x.cy,B,Yt(x.y01,x.x01),Yt(A.y01,A.x01),!v):(o.arc(x.cx,x.cy,B,Yt(x.y01,x.x01),Yt(x.y11,x.x11),!v),o.arc(0,0,f,Yt(x.cy+x.y11,x.cx+x.x11),Yt(A.cy+A.y11,A.cx+A.x11),!v),o.arc(A.cx,A.cy,B,Yt(A.y11,A.x11),Yt(A.y01,A.x01),!v))):(o.moveTo(I,U),o.arc(0,0,f,b,w,!v)):o.moveTo(I,U),!(d>Xt)||!(T>Xt)?o.lineTo(N,F):M>Xt?(x=Ps(N,F,z,G,d,-M,v),A=Ps(I,U,Q,j,d,-M,v),o.lineTo(x.cx+x.x01,x.cy+x.y01),M<L?o.arc(x.cx,x.cy,M,Yt(x.y01,x.x01),Yt(A.y01,A.x01),!v):(o.arc(x.cx,x.cy,M,Yt(x.y01,x.x01),Yt(x.y11,x.x11),!v),o.arc(0,0,d,Yt(x.cy+x.y11,x.cx+x.x11),Yt(A.cy+A.y11,A.cx+A.x11),v),o.arc(A.cx,A.cy,M,Yt(A.y11,A.x11),Yt(A.y01,A.x01),!v))):o.arc(0,0,d,_,O,v)}if(o.closePath(),u)return o=null,u+""||null}return l.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,h=(+r.apply(this,arguments)+ +s.apply(this,arguments))/2-ar/2;return[Dn(h)*u,Re(h)*u]},l.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:ct(+u),l):e},l.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:ct(+u),l):t},l.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:ct(+u),l):n},l.padRadius=function(u){return arguments.length?(i=u==null?null:typeof u=="function"?u:ct(+u),l):i},l.startAngle=function(u){return arguments.length?(r=typeof u=="function"?u:ct(+u),l):r},l.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:ct(+u),l):s},l.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:ct(+u),l):a},l.context=function(u){return arguments.length?(o=u??null,l):o},l}var FE=Array.prototype.slice;function Ns(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function fd(e){this._context=e}fd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Us(e){return new fd(e)}function nl(e){return e[0]}function il(e){return e[1]}function lr(e,t){var n=ct(!0),i=null,r=Us,s=null,a=Is(o);e=typeof e=="function"?e:e===void 0?nl:ct(e),t=typeof t=="function"?t:t===void 0?il:ct(t);function o(c){var l,u=(c=Ns(c)).length,h,d=!1,f;for(i==null&&(s=r(f=a())),l=0;l<=u;++l)!(l<u&&n(h=c[l],l,c))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+e(h,l,c),+t(h,l,c));if(f)return s=null,f+""||null}return o.x=function(c){return arguments.length?(e=typeof c=="function"?c:ct(+c),o):e},o.y=function(c){return arguments.length?(t=typeof c=="function"?c:ct(+c),o):t},o.defined=function(c){return arguments.length?(n=typeof c=="function"?c:ct(!!c),o):n},o.curve=function(c){return arguments.length?(r=c,i!=null&&(s=r(i)),o):r},o.context=function(c){return arguments.length?(c==null?i=s=null:s=r(i=c),o):i},o}function rl(e,t,n){var i=null,r=ct(!0),s=null,a=Us,o=null,c=Is(l);e=typeof e=="function"?e:e===void 0?nl:ct(+e),t=typeof t=="function"?t:ct(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?il:ct(+n);function l(h){var d,f,p,m=(h=Ns(h)).length,g,v=!1,b,w=new Array(m),O=new Array(m);for(s==null&&(o=a(b=c())),d=0;d<=m;++d){if(!(d<m&&r(g=h[d],d,h))===v)if(v=!v)f=d,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=d-1;p>=f;--p)o.point(w[p],O[p]);o.lineEnd(),o.areaEnd()}v&&(w[d]=+e(g,d,h),O[d]=+t(g,d,h),o.point(i?+i(g,d,h):w[d],n?+n(g,d,h):O[d]))}if(b)return o=null,b+""||null}function u(){return lr().defined(r).curve(a).context(s)}return l.x=function(h){return arguments.length?(e=typeof h=="function"?h:ct(+h),i=null,l):e},l.x0=function(h){return arguments.length?(e=typeof h=="function"?h:ct(+h),l):e},l.x1=function(h){return arguments.length?(i=h==null?null:typeof h=="function"?h:ct(+h),l):i},l.y=function(h){return arguments.length?(t=typeof h=="function"?h:ct(+h),n=null,l):t},l.y0=function(h){return arguments.length?(t=typeof h=="function"?h:ct(+h),l):t},l.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:ct(+h),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(i).y(t)},l.defined=function(h){return arguments.length?(r=typeof h=="function"?h:ct(!!h),l):r},l.curve=function(h){return arguments.length?(a=h,s!=null&&(o=a(s)),l):a},l.context=function(h){return arguments.length?(h==null?s=o=null:o=a(s=h),l):s},l}function zE(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function jE(e){return e}function WE(){var e=jE,t=zE,n=null,i=ct(0),r=ct(Rs),s=ct(0);function a(o){var c,l=(o=Ns(o)).length,u,h,d=0,f=new Array(l),p=new Array(l),m=+i.apply(this,arguments),g=Math.min(Rs,Math.max(-Rs,r.apply(this,arguments)-m)),v,b=Math.min(Math.abs(g)/l,s.apply(this,arguments)),w=b*(g<0?-1:1),O;for(c=0;c<l;++c)(O=p[f[c]=c]=+e(o[c],c,o))>0&&(d+=O);for(t!=null?f.sort(function(_,T){return t(p[_],p[T])}):n!=null&&f.sort(function(_,T){return n(o[_],o[T])}),c=0,h=d?(g-l*w)/d:0;c<l;++c,m=v)u=f[c],O=p[u],v=m+(O>0?O*h:0)+w,p[u]={data:o[u],index:c,value:O,startAngle:m,endAngle:v,padAngle:b};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:ct(+o),a):e},a.sortValues=function(o){return arguments.length?(t=o,n=null,a):t},a.sort=function(o){return arguments.length?(n=o,t=null,a):n},a.startAngle=function(o){return arguments.length?(i=typeof o=="function"?o:ct(+o),a):i},a.endAngle=function(o){return arguments.length?(r=typeof o=="function"?o:ct(+o),a):r},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:ct(+o),a):s},a}var qE=gd(Us);function pd(e){this._curve=e}pd.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function gd(e){function t(n){return new pd(e(n))}return t._curve=e,t}function YE(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(gd(n)):t()._curve},e}function XE(){return YE(lr().curve(qE))}class ZE{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function KE(e){return new ZE(e,!0)}function QE(e){return e.source}function JE(e){return e.target}function t_(e){let t=QE,n=JE,i=nl,r=il,s=null,a=null,o=Is(c);function c(){let l;const u=FE.call(arguments),h=t.apply(this,u),d=n.apply(this,u);if(s==null&&(a=e(l=o())),a.lineStart(),u[0]=h,a.point(+i.apply(this,u),+r.apply(this,u)),u[0]=d,a.point(+i.apply(this,u),+r.apply(this,u)),a.lineEnd(),l)return a=null,l+""||null}return c.source=function(l){return arguments.length?(t=l,c):t},c.target=function(l){return arguments.length?(n=l,c):n},c.x=function(l){return arguments.length?(i=typeof l=="function"?l:ct(+l),c):i},c.y=function(l){return arguments.length?(r=typeof l=="function"?l:ct(+l),c):r},c.context=function(l){return arguments.length?(l==null?s=a=null:a=e(s=l),c):s},c}function e_(){return t_(KE)}function hn(){}function Bs(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Hs(e){this._context=e}Hs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Bs(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Bs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function n_(e){return new Hs(e)}function md(e){this._context=e}md.prototype={areaStart:hn,areaEnd:hn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Bs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function i_(e){return new md(e)}function vd(e){this._context=e}vd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Bs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function r_(e){return new vd(e)}function yd(e,t){this._basis=new Hs(e),this._beta=t}yd.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i=e[0],r=t[0],s=e[n]-i,a=t[n]-r,o=-1,c;++o<=n;)c=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(i+c*s),this._beta*t[o]+(1-this._beta)*(r+c*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const s_=function e(t){function n(i){return t===1?new Hs(i):new yd(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function Vs(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function sl(e,t){this._context=e,this._k=(1-t)/6}sl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Vs(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Vs(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const a_=function e(t){function n(i){return new sl(i,t)}return n.tension=function(i){return e(+i)},n}(0);function al(e,t){this._context=e,this._k=(1-t)/6}al.prototype={areaStart:hn,areaEnd:hn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Vs(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const o_=function e(t){function n(i){return new al(i,t)}return n.tension=function(i){return e(+i)},n}(0);function ol(e,t){this._context=e,this._k=(1-t)/6}ol.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Vs(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const l_=function e(t){function n(i){return new ol(i,t)}return n.tension=function(i){return e(+i)},n}(0);function ll(e,t,n){var i=e._x1,r=e._y1,s=e._x2,a=e._y2;if(e._l01_a>Xt){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,r=(r*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>Xt){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*l+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(i,r,s,a,e._x2,e._y2)}function xd(e,t){this._context=e,this._alpha=t}xd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:ll(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const c_=function e(t){function n(i){return t?new xd(i,t):new sl(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function bd(e,t){this._context=e,this._alpha=t}bd.prototype={areaStart:hn,areaEnd:hn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ll(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const u_=function e(t){function n(i){return t?new bd(i,t):new al(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function wd(e,t){this._context=e,this._alpha=t}wd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ll(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const h_=function e(t){function n(i){return t?new wd(i,t):new ol(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function Ed(e){this._context=e}Ed.prototype={areaStart:hn,areaEnd:hn,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function _d(e){return new Ed(e)}function Sd(e){return e<0?-1:1}function Od(e,t,n){var i=e._x1-e._x0,r=t-e._x1,s=(e._y1-e._y0)/(i||r<0&&-0),a=(n-e._y1)/(r||i<0&&-0),o=(s*r+a*i)/(i+r);return(Sd(s)+Sd(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Td(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function cl(e,t,n){var i=e._x0,r=e._y0,s=e._x1,a=e._y1,o=(s-i)/3;e._context.bezierCurveTo(i+o,r+o*t,s-o,a-o*n,s,a)}function Gs(e){this._context=e}Gs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:cl(this,this._t0,Td(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,cl(this,Td(this,n=Od(this,e,t)),n);break;default:cl(this,this._t0,n=Od(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Md(e){this._context=new Cd(e)}(Md.prototype=Object.create(Gs.prototype)).point=function(e,t){Gs.prototype.point.call(this,t,e)};function Cd(e){this._context=e}Cd.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,s){this._context.bezierCurveTo(t,e,i,n,s,r)}};function d_(e){return new Gs(e)}function f_(e){return new Md(e)}function Ad(e){this._context=e}Ad.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var i=$d(e),r=$d(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(i[0][s],r[0][s],i[1][s],r[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function $d(e){var t,n=e.length-1,i,r=new Array(n),s=new Array(n),a=new Array(n);for(r[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)r[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(r[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)i=r[t]/s[t-1],s[t]-=i,a[t]-=i*a[t-1];for(r[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)r[t]=(a[t]-r[t+1])/s[t];for(s[n-1]=(e[n]+r[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-r[t+1];return[r,s]}function p_(e){return new Ad(e)}function Fs(e,t){this._context=e,this._t=t}Fs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function g_(e){return new Fs(e,.5)}function m_(e){return new Fs(e,0)}function v_(e){return new Fs(e,1)}function Ld(e,t){if((a=e.length)>1)for(var n=1,i,r,s=e[t[0]],a,o=s.length;n<a;++n)for(r=s,s=e[t[n]],i=0;i<o;++i)s[i][1]+=s[i][0]=isNaN(r[i][1])?r[i][0]:r[i][1]}function Dd(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function y_(e,t){return e[t]}function x_(e){const t=[];return t.key=e,t}function ul(){var e=ct([]),t=Dd,n=Ld,i=y_;function r(s){var a=Array.from(e.apply(this,arguments),x_),o,c=a.length,l=-1,u;for(const h of s)for(o=0,++l;o<c;++o)(a[o][l]=[0,+i(h,a[o].key,l,s)]).data=h;for(o=0,u=Ns(t(a));o<c;++o)a[u[o]].index=o;return n(a,u),a}return r.keys=function(s){return arguments.length?(e=typeof s=="function"?s:ct(Array.from(s)),r):e},r.value=function(s){return arguments.length?(i=typeof s=="function"?s:ct(+s),r):i},r.order=function(s){return arguments.length?(t=s==null?Dd:typeof s=="function"?s:ct(Array.from(s)),r):t},r.offset=function(s){return arguments.length?(n=s??Ld,r):n},r}function b_(e,t){if((c=e.length)>0)for(var n,i=0,r,s,a,o,c,l=e[t[0]].length;i<l;++i)for(a=o=0,n=0;n<c;++n)(s=(r=e[t[n]][i])[1]-r[0])>0?(r[0]=a,r[1]=a+=s):s<0?(r[1]=o,r[0]=o+=s):(r[0]=0,r[1]=s)}function cr(e,t,n){this.k=e,this.x=t,this.y=n}cr.prototype={constructor:cr,scale:function(e){return e===1?this:new cr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new cr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},cr.prototype;var kd=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(kd||{}),Rd=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(Rd||{}),Id=(e=>(e.UPDATE="model-update",e))(Id||{}),Pd=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e))(Pd||{}),Nd=(e=>(e.UPDATE="zoom-bar-update",e.SELECTION_START="zoom-bar-selection-start",e.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",e.SELECTION_END="zoom-bar-selection-end",e))(Nd||{}),Ud=(e=>(e.CHANGE="zoom-domain-change",e))(Ud||{}),Bd=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(Bd||{}),Hd=(e=>(e.LABEL_MOUSEOVER="axis-label-mouseover",e.LABEL_MOUSEMOVE="axis-label-mousemove",e.LABEL_CLICK="axis-label-click",e.LABEL_MOUSEOUT="axis-label-mouseout",e.LABEL_FOCUS="axis-label-focus",e.LABEL_BLUR="axis-label-blur",e.RENDER_COMPLETE="axis-render-complete",e))(Hd||{}),Vd=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Vd||{}),Gd=(e=>(e.WORD_MOUSEOVER="wordcloud-word-mouseover",e.WORD_MOUSEMOVE="wordcloud-word-mousemove",e.WORD_CLICK="wordcloud-word-click",e.WORD_MOUSEOUT="wordcloud-word-mouseout",e))(Gd||{}),Fd=(e=>(e.SLICE_MOUSEOVER="pie-slice-mouseover",e.SLICE_MOUSEMOVE="pie-slice-mousemove",e.SLICE_CLICK="pie-slice-click",e.SLICE_MOUSEOUT="pie-slice-mouseout",e))(Fd||{}),zd=(e=>(e.ARC_MOUSEOVER="gauge-arc-mouseover",e.ARC_MOUSEMOVE="gauge-arc-mousemove",e.ARC_CLICK="gauge-arc-click",e.ARC_MOUSEOUT="gauge-arc-mouseout",e))(zd||{}),jd=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(jd||{}),Wd=(e=>(e.BOX_MOUSEOVER="box-mouseover",e.BOX_MOUSEMOVE="box-mousemove",e.BOX_CLICK="box-click",e.BOX_MOUSEOUT="box-mouseout",e.OUTLIER_MOUSEOVER="outlier-mouseover",e.OUTLIER_MOUSEMOVE="outlier-mousemove",e.OUTLIER_CLICK="outlier-click",e.OUTLIER_MOUSEOUT="outlier-mouseout",e))(Wd||{}),qd=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(qd||{}),Yd=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Yd||{}),Xd=(e=>(e.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",e.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",e.X_AXIS_CLICK="radar-x-axis-click",e.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",e))(Xd||{}),Zd=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(Zd||{}),Kd=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Kd||{}),ur=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(ur||{}),Qd=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Qd||{}),Jd=(e=>(e.ITEM_HOVER="legend-item-onhover",e.ITEM_CLICK="legend-item-onclick",e.ITEM_MOUSEOUT="legend-item-onmouseout",e.ITEMS_UPDATE="legend-items-update",e))(Jd||{}),tf=(e=>(e.CIRCLE_MOUSEOVER="circle-leaf-mouseover",e.CIRCLE_CLICK="circle-leaf-click",e.CIRCLE_MOUSEOUT="circle-leaf-mouseout",e.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",e))(tf||{}),ef=(e=>(e.NODE_MOUSEOVER="alluvial-node-mouseover",e.NODE_CLICK="alluvial-node-click",e.NODE_MOUSEOUT="alluvial-node-mouseout",e.NODE_MOUSEMOVE="alluvial-node-mousemove",e.LINE_MOUSEOVER="alluvial-line-mouseover",e.LINE_CLICK="alluvial-line-click",e.LINE_MOUSEOUT="alluvial-line-mouseout",e.LINE_MOUSEMOVE="alluvial-line-mousemove",e))(ef||{}),nf=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(nf||{}),rf=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(rf||{}),ui=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(ui||{});const w_=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:ef,Area:Vd,Axis:Hd,Bar:jd,Boxplot:Wd,CanvasZoom:Bd,Chart:kd,Choropleth:ui,CirclePack:tf,Gauge:zd,Heatmap:rf,Legend:Jd,Line:Yd,Meter:nf,Modal:Rd,Model:Id,Pie:Fd,Radar:Xd,Scatter:qd,Threshold:Qd,Toolbar:Pd,Tooltip:ur,Tree:Zd,Treemap:Kd,WordCloud:Gd,ZoomBar:Nd,ZoomDomain:Ud},Symbol.toStringTag,{value:"Module"})),C=w_;var K=(e=>(e.HTML="html",e.SVG="svg",e))(K||{}),sf=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(sf||{}),J=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(J||{}),H=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(H||{}),Ie=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ie||{}),Se=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Se||{}),Ht=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Ht||{}),Z=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(Z||{}),hr=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(hr||{}),It=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(It||{}),dr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(dr||{}),hl=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(hl||{}),Et=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(Et||{}),it=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(it||{}),hi=(e=>(e.CENTER="center",e))(hi||{}),zs=(e=>(e.LEFT="left",e.RIGHT="right",e))(zs||{}),Pt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Pt||{}),Xe=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(Xe||{}),Ze=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(Ze||{}),di=(e=>(e.SEMI="semi",e.FULL="full",e))(di||{}),dl=(e=>(e.UP="up",e.DOWN="down",e))(dl||{}),js=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(js||{}),Ws=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(Ws||{}),fe=(e=>(e.SCATTER="scatter",e.LINE="line",e.SIMPLE_BAR="simple-bar",e.STACKED_BAR="stacked-bar",e.GROUPED_BAR="grouped-bar",e.AREA="area",e.STACKED_AREA="stacked-area",e))(fe||{}),$t=(e=>(e.EXPORT_CSV="Export as CSV",e.EXPORT_PNG="Export as PNG",e.EXPORT_JPG="Export as JPG",e.ZOOM_IN="Zoom in",e.ZOOM_OUT="Zoom out",e.RESET_ZOOM="Reset zoom",e.MAKE_FULLSCREEN="Make fullscreen",e.SHOW_AS_DATATABLE="Show as data-table",e.CUSTOM="Custom",e))($t||{}),fl=(e=>(e.LEFT="left",e.RIGHT="right",e))(fl||{}),Nt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(Nt||{}),qs=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(qs||{}),fr=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(fr||{}),Ys=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(Ys||{}),Ke=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(Ke||{});function pl(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,i=e.formats[n]||e.formats[e.defaultWidth];return i}}function pr(e){return function(t,n){var i=n!=null&&n.context?String(n.context):"standalone",r;if(i==="formatting"&&e.formattingValues){var s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;r=e.formattingValues[a]||e.formattingValues[s]}else{var o=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[c]||e.values[o]}var l=e.argumentCallback?e.argumentCallback(t):t;return r[l]}}function gr(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;var a=s[0],o=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(o)?__(o,function(h){return h.test(a)}):E_(o,function(h){return h.test(a)}),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;var u=t.slice(a.length);return{value:l,rest:u}}}function E_(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function __(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function S_(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.match(e.matchPattern);if(!i)return null;var r=i[0],s=t.match(e.parsePattern);if(!s)return null;var a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;var o=t.slice(r.length);return{value:a,rest:o}}}function Xs(e){"@babel/helpers - typeof";return Xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xs(e)}function Ut(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function st(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function ft(e){st(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Xs(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Zs(e,t){st(2,arguments);var n=ft(e).getTime(),i=Ut(t);return new Date(n+i)}var O_={};function Ks(){return O_}function gl(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function T_(e){return st(1,arguments),e instanceof Date||Xs(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function M_(e){if(st(1,arguments),!T_(e)&&typeof e!="number")return!1;var t=ft(e);return!isNaN(Number(t))}function C_(e,t){st(2,arguments);var n=Ut(t);return Zs(e,-n)}var A_=864e5;function $_(e){st(1,arguments);var t=ft(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var i=t.getTime(),r=n-i;return Math.floor(r/A_)+1}function Qs(e){st(1,arguments);var t=1,n=ft(e),i=n.getUTCDay(),r=(i<t?7:0)+i-t;return n.setUTCDate(n.getUTCDate()-r),n.setUTCHours(0,0,0,0),n}function af(e){st(1,arguments);var t=ft(e),n=t.getUTCFullYear(),i=new Date(0);i.setUTCFullYear(n+1,0,4),i.setUTCHours(0,0,0,0);var r=Qs(i),s=new Date(0);s.setUTCFullYear(n,0,4),s.setUTCHours(0,0,0,0);var a=Qs(s);return t.getTime()>=r.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function L_(e){st(1,arguments);var t=af(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var i=Qs(n);return i}var D_=6048e5;function k_(e){st(1,arguments);var t=ft(e),n=Qs(t).getTime()-L_(t).getTime();return Math.round(n/D_)+1}function Js(e,t){var n,i,r,s,a,o,c,l;st(1,arguments);var u=Ks(),h=Ut((n=(i=(r=(s=t==null?void 0:t.weekStartsOn)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(c=u.locale)===null||c===void 0||(l=c.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&n!==void 0?n:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=ft(e),f=d.getUTCDay(),p=(f<h?7:0)+f-h;return d.setUTCDate(d.getUTCDate()-p),d.setUTCHours(0,0,0,0),d}function of(e,t){var n,i,r,s,a,o,c,l;st(1,arguments);var u=ft(e),h=u.getUTCFullYear(),d=Ks(),f=Ut((n=(i=(r=(s=t==null?void 0:t.firstWeekContainsDate)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&r!==void 0?r:d.firstWeekContainsDate)!==null&&i!==void 0?i:(c=d.locale)===null||c===void 0||(l=c.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(h+1,0,f),p.setUTCHours(0,0,0,0);var m=Js(p,t),g=new Date(0);g.setUTCFullYear(h,0,f),g.setUTCHours(0,0,0,0);var v=Js(g,t);return u.getTime()>=m.getTime()?h+1:u.getTime()>=v.getTime()?h:h-1}function R_(e,t){var n,i,r,s,a,o,c,l;st(1,arguments);var u=Ks(),h=Ut((n=(i=(r=(s=t==null?void 0:t.firstWeekContainsDate)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&r!==void 0?r:u.firstWeekContainsDate)!==null&&i!==void 0?i:(c=u.locale)===null||c===void 0||(l=c.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=of(e,t),f=new Date(0);f.setUTCFullYear(d,0,h),f.setUTCHours(0,0,0,0);var p=Js(f,t);return p}var I_=6048e5;function P_(e,t){st(1,arguments);var n=ft(e),i=Js(n,t).getTime()-R_(n,t).getTime();return Math.round(i/I_)+1}function yt(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}var N_={y:function(e,t){var n=e.getUTCFullYear(),i=n>0?n:1-n;return yt(t==="yy"?i%100:i,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):yt(n+1,2)},d:function(e,t){return yt(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(e,t){return yt(e.getUTCHours()%12||12,t.length)},H:function(e,t){return yt(e.getUTCHours(),t.length)},m:function(e,t){return yt(e.getUTCMinutes(),t.length)},s:function(e,t){return yt(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,i=e.getUTCMilliseconds(),r=Math.floor(i*Math.pow(10,n-3));return yt(r,t.length)}};const dn=N_;var fi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},U_={G:function(e,t,n){var i=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){var i=e.getUTCFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return dn.y(e,t)},Y:function(e,t,n,i){var r=of(e,i),s=r>0?r:1-r;if(t==="YY"){var a=s%100;return yt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):yt(s,t.length)},R:function(e,t){var n=af(e);return yt(n,t.length)},u:function(e,t){var n=e.getUTCFullYear();return yt(n,t.length)},Q:function(e,t,n){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return yt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return yt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){var i=e.getUTCMonth();switch(t){case"M":case"MM":return dn.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){var i=e.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return yt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){var r=P_(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):yt(r,t.length)},I:function(e,t,n){var i=k_(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):yt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):dn.d(e,t)},D:function(e,t,n){var i=$_(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):yt(i,t.length)},E:function(e,t,n){var i=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){var r=e.getUTCDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return yt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){var r=e.getUTCDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return yt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){var i=e.getUTCDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return yt(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){var i=e.getUTCHours(),r=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var i=e.getUTCHours(),r;switch(i===12?r=fi.noon:i===0?r=fi.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var i=e.getUTCHours(),r;switch(i>=17?r=fi.evening:i>=12?r=fi.afternoon:i>=4?r=fi.morning:r=fi.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){var i=e.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return dn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):dn.H(e,t)},K:function(e,t,n){var i=e.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):yt(i,t.length)},k:function(e,t,n){var i=e.getUTCHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):yt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):dn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):dn.s(e,t)},S:function(e,t){return dn.S(e,t)},X:function(e,t,n,i){var r=i._originalDate||e,s=r.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return cf(s);case"XXXX":case"XX":return kn(s);case"XXXXX":case"XXX":default:return kn(s,":")}},x:function(e,t,n,i){var r=i._originalDate||e,s=r.getTimezoneOffset();switch(t){case"x":return cf(s);case"xxxx":case"xx":return kn(s);case"xxxxx":case"xxx":default:return kn(s,":")}},O:function(e,t,n,i){var r=i._originalDate||e,s=r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+lf(s,":");case"OOOO":default:return"GMT"+kn(s,":")}},z:function(e,t,n,i){var r=i._originalDate||e,s=r.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+lf(s,":");case"zzzz":default:return"GMT"+kn(s,":")}},t:function(e,t,n,i){var r=i._originalDate||e,s=Math.floor(r.getTime()/1e3);return yt(s,t.length)},T:function(e,t,n,i){var r=i._originalDate||e,s=r.getTime();return yt(s,t.length)}};function lf(e,t){var n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),s=i%60;if(s===0)return n+String(r);var a=t||"";return n+String(r)+a+yt(s,2)}function cf(e,t){if(e%60===0){var n=e>0?"-":"+";return n+yt(Math.abs(e)/60,2)}return kn(e,t)}function kn(e,t){var n=t||"",i=e>0?"-":"+",r=Math.abs(e),s=yt(Math.floor(r/60),2),a=yt(r%60,2);return i+s+n+a}const B_=U_;var uf=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},hf=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},H_=function(e,t){var n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return uf(e,t);var s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",uf(i,t)).replace("{{time}}",hf(r,t))},V_={p:hf,P:H_};const G_=V_;var F_=["D","DD"],z_=["YY","YYYY"];function j_(e){return F_.indexOf(e)!==-1}function W_(e){return z_.indexOf(e)!==-1}function df(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var q_={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Y_=function(e,t,n){var i,r=q_[e];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};const X_=Y_;var Z_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},K_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Q_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},J_={date:pl({formats:Z_,defaultWidth:"full"}),time:pl({formats:K_,defaultWidth:"full"}),dateTime:pl({formats:Q_,defaultWidth:"full"})};const tS=J_;var eS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},nS=function(e,t,n,i){return eS[e]};const iS=nS;var rS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},sS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},aS={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},oS={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},lS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},cS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},uS=function(e,t){var n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},hS={ordinalNumber:uS,era:pr({values:rS,defaultWidth:"wide"}),quarter:pr({values:sS,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:pr({values:aS,defaultWidth:"wide"}),day:pr({values:oS,defaultWidth:"wide"}),dayPeriod:pr({values:lS,defaultWidth:"wide",formattingValues:cS,defaultFormattingWidth:"wide"})};const dS=hS;var fS=/^(\d+)(th|st|nd|rd)?/i,pS=/\d+/i,gS={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},mS={any:[/^b/i,/^(a|c)/i]},vS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},yS={any:[/1/i,/2/i,/3/i,/4/i]},xS={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},bS={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},wS={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ES={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},_S={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},SS={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},OS={ordinalNumber:S_({matchPattern:fS,parsePattern:pS,valueCallback:function(e){return parseInt(e,10)}}),era:gr({matchPatterns:gS,defaultMatchWidth:"wide",parsePatterns:mS,defaultParseWidth:"any"}),quarter:gr({matchPatterns:vS,defaultMatchWidth:"wide",parsePatterns:yS,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:gr({matchPatterns:xS,defaultMatchWidth:"wide",parsePatterns:bS,defaultParseWidth:"any"}),day:gr({matchPatterns:wS,defaultMatchWidth:"wide",parsePatterns:ES,defaultParseWidth:"any"}),dayPeriod:gr({matchPatterns:_S,defaultMatchWidth:"any",parsePatterns:SS,defaultParseWidth:"any"})},TS={code:"en-US",formatDistance:X_,formatLong:tS,formatRelative:iS,localize:dS,match:OS,options:{weekStartsOn:0,firstWeekContainsDate:1}};const ff=TS;var MS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,CS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,AS=/^'([^]*?)'?$/,$S=/''/g,LS=/[a-zA-Z]/;function pi(e,t,n){var i,r,s,a,o,c,l,u,h,d,f,p,m,g,v,b,w,O;st(2,arguments);var _=String(t),T=Ks(),S=(i=(r=n==null?void 0:n.locale)!==null&&r!==void 0?r:T.locale)!==null&&i!==void 0?i:ff,$=Ut((s=(a=(o=(c=n==null?void 0:n.firstWeekContainsDate)!==null&&c!==void 0?c:n==null||(l=n.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:T.firstWeekContainsDate)!==null&&a!==void 0?a:(h=T.locale)===null||h===void 0||(d=h.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!($>=1&&$<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var D=Ut((f=(p=(m=(g=n==null?void 0:n.weekStartsOn)!==null&&g!==void 0?g:n==null||(v=n.locale)===null||v===void 0||(b=v.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&m!==void 0?m:T.weekStartsOn)!==null&&p!==void 0?p:(w=T.locale)===null||w===void 0||(O=w.options)===null||O===void 0?void 0:O.weekStartsOn)!==null&&f!==void 0?f:0);if(!(D>=0&&D<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!S.localize)throw new RangeError("locale must contain localize property");if(!S.formatLong)throw new RangeError("locale must contain formatLong property");var L=ft(e);if(!M_(L))throw new RangeError("Invalid time value");var M=gl(L),B=C_(L,M),x={firstWeekContainsDate:$,weekStartsOn:D,locale:S,_originalDate:L},A=_.match(CS).map(function(y){var k=y[0];if(k==="p"||k==="P"){var I=G_[k];return I(y,S.formatLong)}return y}).join("").match(MS).map(function(y){if(y==="''")return"'";var k=y[0];if(k==="'")return DS(y);var I=B_[k];if(I)return!(n!=null&&n.useAdditionalWeekYearTokens)&&W_(y)&&df(y,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&j_(y)&&df(y,t,String(e)),I(B,y,S.localize,x);if(k.match(LS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return y}).join("");return A}function DS(e){var t=e.match(AS);return t?t[1].replace($S,"'"):e}const ne="cds",Qe={opacity:{unselected:.05,selected:.4}},fn={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},gi={duration:1e3,ease:bu,zoomLevel:3},mi={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},pf={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},pe={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},kS={defaultBins:10},Lt={items:{status:{ACTIVE:1,DISABLED:0},horizontalSpace:12,verticalSpace:24,textYOffset:8,spaceAfter:4},checkbox:{radius:6.5},radius:{iconData:[{cx:7,cy:7,r:6.5},{cx:7,cy:10,r:3.5}],fill:null,stroke:"#8c8c8c"},line:{yPosition:6,width:24,strokeWidth:1.4,fill:null,stroke:"#999999"},area:{width:24,height:14,fill:"#6f6f6f",stroke:null},size:{iconData:[{width:23,height:12},{width:13,height:6}],fill:null,stroke:"#8D8D8D"},quartile:{iconData:[{x:0,y:0,width:24,height:13},{x:11,y:4,width:1,height:4}]},zoom:{iconData:[{x:0,y:0,width:12,height:12}],color:"#8D8D8D"},color:{barWidth:300,barHeight:8,axisYTranslation:10}},Je={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},Gt={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},_t={radiusOffset:-15,innerRadius:2,padAngle:.007,hoverArc:{outerRadiusOffset:3},xOffset:30,yOffset:20,yOffsetCallout:10,callout:{minSliceDegree:5,offsetX:15,offsetY:12,horizontalLineLength:8,textMargin:2}},Rn={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},Oe={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},gf={minCellDividerDimension:16,chartPadding:.5},mf={default:{size:24}},RS={horizontalOffset:10},vf={default:{duration:300},pie_slice_mouseover:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},ce={height:{[Ie.GRAPH_VIEW]:32,[Ie.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},IS=[{type:Nt.RADIUS,name:"Radius"},{type:Nt.AREA,name:"Poor area"},{type:Nt.AREA,name:"Satisfactory area"},{type:Nt.AREA,name:"Great area"},{type:Nt.QUARTILE,name:"Quartiles"}];var PS=typeof global=="object"&&global&&global.Object===Object&&global;const yf=PS;var NS=typeof self=="object"&&self&&self.Object===Object&&self,US=yf||NS||Function("return this")();const Te=US;var BS=Te.Symbol;const ge=BS;var xf=Object.prototype,HS=xf.hasOwnProperty,VS=xf.toString,mr=ge?ge.toStringTag:void 0;function GS(e){var t=HS.call(e,mr),n=e[mr];try{e[mr]=void 0;var i=!0}catch{}var r=VS.call(e);return i&&(t?e[mr]=n:delete e[mr]),r}var FS=Object.prototype,zS=FS.toString;function jS(e){return zS.call(e)}var WS="[object Null]",qS="[object Undefined]",bf=ge?ge.toStringTag:void 0;function In(e){return e==null?e===void 0?qS:WS:bf&&bf in Object(e)?GS(e):jS(e)}function Pe(e){return e!=null&&typeof e=="object"}var YS="[object Symbol]";function ta(e){return typeof e=="symbol"||Pe(e)&&In(e)==YS}function wf(e,t){for(var n=-1,i=e==null?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r}var XS=Array.isArray;const Ft=XS;var ZS=1/0,Ef=ge?ge.prototype:void 0,_f=Ef?Ef.toString:void 0;function Sf(e){if(typeof e=="string")return e;if(Ft(e))return wf(e,Sf)+"";if(ta(e))return _f?_f.call(e):"";var t=e+"";return t=="0"&&1/e==-ZS?"-0":t}function me(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function ml(e){return e}var KS="[object AsyncFunction]",QS="[object Function]",JS="[object GeneratorFunction]",tO="[object Proxy]";function vl(e){if(!me(e))return!1;var t=In(e);return t==QS||t==JS||t==KS||t==tO}var eO=Te["__core-js_shared__"];const yl=eO;var Of=function(){var e=/[^.]+$/.exec(yl&&yl.keys&&yl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function nO(e){return!!Of&&Of in e}var iO=Function.prototype,rO=iO.toString;function Pn(e){if(e!=null){try{return rO.call(e)}catch{}try{return e+""}catch{}}return""}var sO=/[\\^$.*+?()[\]{}|]/g,aO=/^\[object .+?Constructor\]$/,oO=Function.prototype,lO=Object.prototype,cO=oO.toString,uO=lO.hasOwnProperty,hO=RegExp("^"+cO.call(uO).replace(sO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function dO(e){if(!me(e)||nO(e))return!1;var t=vl(e)?hO:aO;return t.test(Pn(e))}function fO(e,t){return e==null?void 0:e[t]}function Nn(e,t){var n=fO(e,t);return dO(n)?n:void 0}var pO=Nn(Te,"WeakMap");const xl=pO;var Tf=Object.create,gO=function(){function e(){}return function(t){if(!me(t))return{};if(Tf)return Tf(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const mO=gO;function vO(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function yO(){}function Mf(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}var xO=800,bO=16,wO=Date.now;function EO(e){var t=0,n=0;return function(){var i=wO(),r=bO-(i-n);if(n=i,r>0){if(++t>=xO)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function _O(e){return function(){return e}}var SO=function(){try{var e=Nn(Object,"defineProperty");return e({},"",{}),e}catch{}}();const ea=SO;var OO=ea?function(e,t){return ea(e,"toString",{configurable:!0,enumerable:!1,value:_O(t),writable:!0})}:ml,TO=EO(OO);const MO=TO;function CO(e,t){for(var n=-1,i=e==null?0:e.length;++n<i&&t(e[n],n,e)!==!1;);return e}function AO(e,t,n,i){for(var r=e.length,s=n+(i?1:-1);i?s--:++s<r;)if(t(e[s],s,e))return s;return-1}function $O(e){return e!==e}function LO(e,t,n){for(var i=n-1,r=e.length;++i<r;)if(e[i]===t)return i;return-1}function DO(e,t,n){return t===t?LO(e,t,n):AO(e,$O,n)}function kO(e,t){var n=e==null?0:e.length;return!!n&&DO(e,t,0)>-1}var RO=9007199254740991,IO=/^(?:0|[1-9]\d*)$/;function bl(e,t){var n=typeof e;return t=t??RO,!!t&&(n=="number"||n!="symbol"&&IO.test(e))&&e>-1&&e%1==0&&e<t}function na(e,t,n){t=="__proto__"&&ea?ea(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function vr(e,t){return e===t||e!==e&&t!==t}var PO=Object.prototype,NO=PO.hasOwnProperty;function Cf(e,t,n){var i=e[t];(!(NO.call(e,t)&&vr(i,n))||n===void 0&&!(t in e))&&na(e,t,n)}function yr(e,t,n,i){var r=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],c=i?i(n[o],e[o],o,n,e):void 0;c===void 0&&(c=e[o]),r?na(n,o,c):Cf(n,o,c)}return n}var Af=Math.max;function UO(e,t,n){return t=Af(t===void 0?e.length-1:t,0),function(){for(var i=arguments,r=-1,s=Af(i.length-t,0),a=Array(s);++r<s;)a[r]=i[t+r];r=-1;for(var o=Array(t+1);++r<t;)o[r]=i[r];return o[t]=n(a),vO(e,this,o)}}function $f(e,t){return MO(UO(e,t,ml),e+"")}var BO=9007199254740991;function wl(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=BO}function Un(e){return e!=null&&wl(e.length)&&!vl(e)}function Lf(e,t,n){if(!me(n))return!1;var i=typeof t;return(i=="number"?Un(n)&&bl(t,n.length):i=="string"&&t in n)?vr(n[t],e):!1}function HO(e){return $f(function(t,n){var i=-1,r=n.length,s=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(r--,s):void 0,a&&Lf(n[0],n[1],a)&&(s=r<3?void 0:s,r=1),t=Object(t);++i<r;){var o=n[i];o&&e(t,o,i,s)}return t})}var VO=Object.prototype;function ia(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||VO;return e===n}function GO(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}var FO="[object Arguments]";function Df(e){return Pe(e)&&In(e)==FO}var kf=Object.prototype,zO=kf.hasOwnProperty,jO=kf.propertyIsEnumerable,WO=Df(function(){return arguments}())?Df:function(e){return Pe(e)&&zO.call(e,"callee")&&!jO.call(e,"callee")};const vi=WO;function qO(){return!1}var Rf=typeof rt=="object"&&rt&&!rt.nodeType&&rt,If=Rf&&typeof module=="object"&&module&&!module.nodeType&&module,YO=If&&If.exports===Rf,Pf=YO?Te.Buffer:void 0,XO=Pf?Pf.isBuffer:void 0,ZO=XO||qO;const yi=ZO;var KO="[object Arguments]",QO="[object Array]",JO="[object Boolean]",tT="[object Date]",eT="[object Error]",nT="[object Function]",iT="[object Map]",rT="[object Number]",sT="[object Object]",aT="[object RegExp]",oT="[object Set]",lT="[object String]",cT="[object WeakMap]",uT="[object ArrayBuffer]",hT="[object DataView]",dT="[object Float32Array]",fT="[object Float64Array]",pT="[object Int8Array]",gT="[object Int16Array]",mT="[object Int32Array]",vT="[object Uint8Array]",yT="[object Uint8ClampedArray]",xT="[object Uint16Array]",bT="[object Uint32Array]",Tt={};Tt[dT]=Tt[fT]=Tt[pT]=Tt[gT]=Tt[mT]=Tt[vT]=Tt[yT]=Tt[xT]=Tt[bT]=!0,Tt[KO]=Tt[QO]=Tt[uT]=Tt[JO]=Tt[hT]=Tt[tT]=Tt[eT]=Tt[nT]=Tt[iT]=Tt[rT]=Tt[sT]=Tt[aT]=Tt[oT]=Tt[lT]=Tt[cT]=!1;function wT(e){return Pe(e)&&wl(e.length)&&!!Tt[In(e)]}function El(e){return function(t){return e(t)}}var Nf=typeof rt=="object"&&rt&&!rt.nodeType&&rt,xr=Nf&&typeof module=="object"&&module&&!module.nodeType&&module,ET=xr&&xr.exports===Nf,_l=ET&&yf.process,_T=function(){try{var e=xr&&xr.require&&xr.require("util").types;return e||_l&&_l.binding&&_l.binding("util")}catch{}}();const xi=_T;var Uf=xi&&xi.isTypedArray,ST=Uf?El(Uf):wT;const ra=ST;var OT=Object.prototype,TT=OT.hasOwnProperty;function Bf(e,t){var n=Ft(e),i=!n&&vi(e),r=!n&&!i&&yi(e),s=!n&&!i&&!r&&ra(e),a=n||i||r||s,o=a?GO(e.length,String):[],c=o.length;for(var l in e)(t||TT.call(e,l))&&!(a&&(l=="length"||r&&(l=="offset"||l=="parent")||s&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||bl(l,c)))&&o.push(l);return o}function Hf(e,t){return function(n){return e(t(n))}}var MT=Hf(Object.keys,Object);const CT=MT;var AT=Object.prototype,$T=AT.hasOwnProperty;function Vf(e){if(!ia(e))return CT(e);var t=[];for(var n in Object(e))$T.call(e,n)&&n!="constructor"&&t.push(n);return t}function br(e){return Un(e)?Bf(e):Vf(e)}function LT(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var DT=Object.prototype,kT=DT.hasOwnProperty;function RT(e){if(!me(e))return LT(e);var t=ia(e),n=[];for(var i in e)i=="constructor"&&(t||!kT.call(e,i))||n.push(i);return n}function wr(e){return Un(e)?Bf(e,!0):RT(e)}var IT=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,PT=/^\w*$/;function Sl(e,t){if(Ft(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||ta(e)?!0:PT.test(e)||!IT.test(e)||t!=null&&e in Object(t)}var NT=Nn(Object,"create");const Er=NT;function UT(){this.__data__=Er?Er(null):{},this.size=0}function BT(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HT="__lodash_hash_undefined__",VT=Object.prototype,GT=VT.hasOwnProperty;function FT(e){var t=this.__data__;if(Er){var n=t[e];return n===HT?void 0:n}return GT.call(t,e)?t[e]:void 0}var zT=Object.prototype,jT=zT.hasOwnProperty;function WT(e){var t=this.__data__;return Er?t[e]!==void 0:jT.call(t,e)}var qT="__lodash_hash_undefined__";function YT(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Er&&t===void 0?qT:t,this}function Bn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Bn.prototype.clear=UT,Bn.prototype.delete=BT,Bn.prototype.get=FT,Bn.prototype.has=WT,Bn.prototype.set=YT;function XT(){this.__data__=[],this.size=0}function sa(e,t){for(var n=e.length;n--;)if(vr(e[n][0],t))return n;return-1}var ZT=Array.prototype,KT=ZT.splice;function QT(e){var t=this.__data__,n=sa(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():KT.call(t,n,1),--this.size,!0}function JT(e){var t=this.__data__,n=sa(t,e);return n<0?void 0:t[n][1]}function tM(e){return sa(this.__data__,e)>-1}function eM(e,t){var n=this.__data__,i=sa(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}function tn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}tn.prototype.clear=XT,tn.prototype.delete=QT,tn.prototype.get=JT,tn.prototype.has=tM,tn.prototype.set=eM;var nM=Nn(Te,"Map");const _r=nM;function iM(){this.size=0,this.__data__={hash:new Bn,map:new(_r||tn),string:new Bn}}function rM(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function aa(e,t){var n=e.__data__;return rM(t)?n[typeof t=="string"?"string":"hash"]:n.map}function sM(e){var t=aa(this,e).delete(e);return this.size-=t?1:0,t}function aM(e){return aa(this,e).get(e)}function oM(e){return aa(this,e).has(e)}function lM(e,t){var n=aa(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}function en(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}en.prototype.clear=iM,en.prototype.delete=sM,en.prototype.get=aM,en.prototype.has=oM,en.prototype.set=lM;var cM="Expected a function";function Ol(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(cM);var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var a=e.apply(this,i);return n.cache=s.set(r,a)||s,a};return n.cache=new(Ol.Cache||en),n}Ol.Cache=en;var uM=500;function hM(e){var t=Ol(e,function(i){return n.size===uM&&n.clear(),i}),n=t.cache;return t}var dM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fM=/\\(\\)?/g,pM=hM(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(dM,function(n,i,r,s){t.push(r?s.replace(fM,"$1"):i||n)}),t});const gM=pM;function Sr(e){return e==null?"":Sf(e)}function Gf(e,t){return Ft(e)?e:Sl(e,t)?[e]:gM(Sr(e))}var mM=1/0;function oa(e){if(typeof e=="string"||ta(e))return e;var t=e+"";return t=="0"&&1/e==-mM?"-0":t}function Ff(e,t){t=Gf(t,e);for(var n=0,i=t.length;e!=null&&n<i;)e=e[oa(t[n++])];return n&&n==i?e:void 0}function St(e,t,n){var i=e==null?void 0:Ff(e,t);return i===void 0?n:i}function Tl(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}var zf=ge?ge.isConcatSpreadable:void 0;function vM(e){return Ft(e)||vi(e)||!!(zf&&e&&e[zf])}function la(e,t,n,i,r){var s=-1,a=e.length;for(n||(n=vM),r||(r=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?la(o,t-1,n,i,r):Tl(r,o):i||(r[r.length]=o)}return r}var yM=Hf(Object.getPrototypeOf,Object);const Ml=yM;var xM="[object Object]",bM=Function.prototype,wM=Object.prototype,jf=bM.toString,EM=wM.hasOwnProperty,_M=jf.call(Object);function SM(e){if(!Pe(e)||In(e)!=xM)return!1;var t=Ml(e);if(t===null)return!0;var n=EM.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&jf.call(n)==_M}function OM(){this.__data__=new tn,this.size=0}function TM(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function MM(e){return this.__data__.get(e)}function CM(e){return this.__data__.has(e)}var AM=200;function $M(e,t){var n=this.__data__;if(n instanceof tn){var i=n.__data__;if(!_r||i.length<AM-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new en(i)}return n.set(e,t),this.size=n.size,this}function Me(e){var t=this.__data__=new tn(e);this.size=t.size}Me.prototype.clear=OM,Me.prototype.delete=TM,Me.prototype.get=MM,Me.prototype.has=CM,Me.prototype.set=$M;function LM(e,t){return e&&yr(t,br(t),e)}function DM(e,t){return e&&yr(t,wr(t),e)}var Wf=typeof rt=="object"&&rt&&!rt.nodeType&&rt,qf=Wf&&typeof module=="object"&&module&&!module.nodeType&&module,kM=qf&&qf.exports===Wf,Yf=kM?Te.Buffer:void 0,Xf=Yf?Yf.allocUnsafe:void 0;function Zf(e,t){if(t)return e.slice();var n=e.length,i=Xf?Xf(n):new e.constructor(n);return e.copy(i),i}function RM(e,t){for(var n=-1,i=e==null?0:e.length,r=0,s=[];++n<i;){var a=e[n];t(a,n,e)&&(s[r++]=a)}return s}function Kf(){return[]}var IM=Object.prototype,PM=IM.propertyIsEnumerable,Qf=Object.getOwnPropertySymbols,NM=Qf?function(e){return e==null?[]:(e=Object(e),RM(Qf(e),function(t){return PM.call(e,t)}))}:Kf;const Cl=NM;function UM(e,t){return yr(e,Cl(e),t)}var BM=Object.getOwnPropertySymbols,HM=BM?function(e){for(var t=[];e;)Tl(t,Cl(e)),e=Ml(e);return t}:Kf;const Jf=HM;function VM(e,t){return yr(e,Jf(e),t)}function tp(e,t,n){var i=t(e);return Ft(e)?i:Tl(i,n(e))}function Al(e){return tp(e,br,Cl)}function GM(e){return tp(e,wr,Jf)}var FM=Nn(Te,"DataView");const $l=FM;var zM=Nn(Te,"Promise");const Ll=zM;var jM=Nn(Te,"Set");const bi=jM;var ep="[object Map]",WM="[object Object]",np="[object Promise]",ip="[object Set]",rp="[object WeakMap]",sp="[object DataView]",qM=Pn($l),YM=Pn(_r),XM=Pn(Ll),ZM=Pn(bi),KM=Pn(xl),Hn=In;($l&&Hn(new $l(new ArrayBuffer(1)))!=sp||_r&&Hn(new _r)!=ep||Ll&&Hn(Ll.resolve())!=np||bi&&Hn(new bi)!=ip||xl&&Hn(new xl)!=rp)&&(Hn=function(e){var t=In(e),n=t==WM?e.constructor:void 0,i=n?Pn(n):"";if(i)switch(i){case qM:return sp;case YM:return ep;case XM:return np;case ZM:return ip;case KM:return rp}return t});const wi=Hn;var QM=Object.prototype,JM=QM.hasOwnProperty;function tC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&JM.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var eC=Te.Uint8Array;const ca=eC;function Dl(e){var t=new e.constructor(e.byteLength);return new ca(t).set(new ca(e)),t}function nC(e,t){var n=t?Dl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var iC=/\w*$/;function rC(e){var t=new e.constructor(e.source,iC.exec(e));return t.lastIndex=e.lastIndex,t}var ap=ge?ge.prototype:void 0,op=ap?ap.valueOf:void 0;function sC(e){return op?Object(op.call(e)):{}}function lp(e,t){var n=t?Dl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var aC="[object Boolean]",oC="[object Date]",lC="[object Map]",cC="[object Number]",uC="[object RegExp]",hC="[object Set]",dC="[object String]",fC="[object Symbol]",pC="[object ArrayBuffer]",gC="[object DataView]",mC="[object Float32Array]",vC="[object Float64Array]",yC="[object Int8Array]",xC="[object Int16Array]",bC="[object Int32Array]",wC="[object Uint8Array]",EC="[object Uint8ClampedArray]",_C="[object Uint16Array]",SC="[object Uint32Array]";function OC(e,t,n){var i=e.constructor;switch(t){case pC:return Dl(e);case aC:case oC:return new i(+e);case gC:return nC(e,n);case mC:case vC:case yC:case xC:case bC:case wC:case EC:case _C:case SC:return lp(e,n);case lC:return new i;case cC:case dC:return new i(e);case uC:return rC(e);case hC:return new i;case fC:return sC(e)}}function cp(e){return typeof e.constructor=="function"&&!ia(e)?mO(Ml(e)):{}}var TC="[object Map]";function MC(e){return Pe(e)&&wi(e)==TC}var up=xi&&xi.isMap,CC=up?El(up):MC;const AC=CC;var $C="[object Set]";function LC(e){return Pe(e)&&wi(e)==$C}var hp=xi&&xi.isSet,DC=hp?El(hp):LC;const kC=DC;var RC=1,IC=2,PC=4,dp="[object Arguments]",NC="[object Array]",UC="[object Boolean]",BC="[object Date]",HC="[object Error]",fp="[object Function]",VC="[object GeneratorFunction]",GC="[object Map]",FC="[object Number]",pp="[object Object]",zC="[object RegExp]",jC="[object Set]",WC="[object String]",qC="[object Symbol]",YC="[object WeakMap]",XC="[object ArrayBuffer]",ZC="[object DataView]",KC="[object Float32Array]",QC="[object Float64Array]",JC="[object Int8Array]",t2="[object Int16Array]",e2="[object Int32Array]",n2="[object Uint8Array]",i2="[object Uint8ClampedArray]",r2="[object Uint16Array]",s2="[object Uint32Array]",Ot={};Ot[dp]=Ot[NC]=Ot[XC]=Ot[ZC]=Ot[UC]=Ot[BC]=Ot[KC]=Ot[QC]=Ot[JC]=Ot[t2]=Ot[e2]=Ot[GC]=Ot[FC]=Ot[pp]=Ot[zC]=Ot[jC]=Ot[WC]=Ot[qC]=Ot[n2]=Ot[i2]=Ot[r2]=Ot[s2]=!0,Ot[HC]=Ot[fp]=Ot[YC]=!1;function ua(e,t,n,i,r,s){var a,o=t&RC,c=t&IC,l=t&PC;if(n&&(a=r?n(e,i,r,s):n(e)),a!==void 0)return a;if(!me(e))return e;var u=Ft(e);if(u){if(a=tC(e),!o)return Mf(e,a)}else{var h=wi(e),d=h==fp||h==VC;if(yi(e))return Zf(e,o);if(h==pp||h==dp||d&&!r){if(a=c||d?{}:cp(e),!o)return c?VM(e,DM(a,e)):UM(e,LM(a,e))}else{if(!Ot[h])return r?e:{};a=OC(e,h,o)}}s||(s=new Me);var f=s.get(e);if(f)return f;s.set(e,a),kC(e)?e.forEach(function(g){a.add(ua(g,t,n,g,e,s))}):AC(e)&&e.forEach(function(g,v){a.set(v,ua(g,t,n,v,e,s))});var p=l?c?GM:Al:c?wr:br,m=u?void 0:p(e);return CO(m||e,function(g,v){m&&(v=g,g=e[v]),Cf(a,v,ua(g,t,n,v,e,s))}),a}var a2=1,o2=4;function l2(e){return ua(e,a2|o2)}var c2="__lodash_hash_undefined__";function u2(e){return this.__data__.set(e,c2),this}function h2(e){return this.__data__.has(e)}function Or(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new en;++t<n;)this.add(e[t])}Or.prototype.add=Or.prototype.push=u2,Or.prototype.has=h2;function gp(e,t){for(var n=-1,i=e==null?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function mp(e,t){return e.has(t)}var d2=1,f2=2;function vp(e,t,n,i,r,s){var a=n&d2,o=e.length,c=t.length;if(o!=c&&!(a&&c>o))return!1;var l=s.get(e),u=s.get(t);if(l&&u)return l==t&&u==e;var h=-1,d=!0,f=n&f2?new Or:void 0;for(s.set(e,t),s.set(t,e);++h<o;){var p=e[h],m=t[h];if(i)var g=a?i(m,p,h,t,e,s):i(p,m,h,e,t,s);if(g!==void 0){if(g)continue;d=!1;break}if(f){if(!gp(t,function(v,b){if(!mp(f,b)&&(p===v||r(p,v,n,i,s)))return f.push(b)})){d=!1;break}}else if(!(p===m||r(p,m,n,i,s))){d=!1;break}}return s.delete(e),s.delete(t),d}function p2(e){var t=-1,n=Array(e.size);return e.forEach(function(i,r){n[++t]=[r,i]}),n}function kl(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var g2=1,m2=2,v2="[object Boolean]",y2="[object Date]",x2="[object Error]",b2="[object Map]",w2="[object Number]",E2="[object RegExp]",_2="[object Set]",S2="[object String]",O2="[object Symbol]",T2="[object ArrayBuffer]",M2="[object DataView]",yp=ge?ge.prototype:void 0,Rl=yp?yp.valueOf:void 0;function C2(e,t,n,i,r,s,a){switch(n){case M2:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case T2:return!(e.byteLength!=t.byteLength||!s(new ca(e),new ca(t)));case v2:case y2:case w2:return vr(+e,+t);case x2:return e.name==t.name&&e.message==t.message;case E2:case S2:return e==t+"";case b2:var o=p2;case _2:var c=i&g2;if(o||(o=kl),e.size!=t.size&&!c)return!1;var l=a.get(e);if(l)return l==t;i|=m2,a.set(e,t);var u=vp(o(e),o(t),i,r,s,a);return a.delete(e),u;case O2:if(Rl)return Rl.call(e)==Rl.call(t)}return!1}var A2=1,$2=Object.prototype,L2=$2.hasOwnProperty;function D2(e,t,n,i,r,s){var a=n&A2,o=Al(e),c=o.length,l=Al(t),u=l.length;if(c!=u&&!a)return!1;for(var h=c;h--;){var d=o[h];if(!(a?d in t:L2.call(t,d)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var m=!0;s.set(e,t),s.set(t,e);for(var g=a;++h<c;){d=o[h];var v=e[d],b=t[d];if(i)var w=a?i(b,v,d,t,e,s):i(v,b,d,e,t,s);if(!(w===void 0?v===b||r(v,b,n,i,s):w)){m=!1;break}g||(g=d=="constructor")}if(m&&!g){var O=e.constructor,_=t.constructor;O!=_&&"constructor"in e&&"constructor"in t&&!(typeof O=="function"&&O instanceof O&&typeof _=="function"&&_ instanceof _)&&(m=!1)}return s.delete(e),s.delete(t),m}var k2=1,xp="[object Arguments]",bp="[object Array]",ha="[object Object]",R2=Object.prototype,wp=R2.hasOwnProperty;function I2(e,t,n,i,r,s){var a=Ft(e),o=Ft(t),c=a?bp:wi(e),l=o?bp:wi(t);c=c==xp?ha:c,l=l==xp?ha:l;var u=c==ha,h=l==ha,d=c==l;if(d&&yi(e)){if(!yi(t))return!1;a=!0,u=!1}if(d&&!u)return s||(s=new Me),a||ra(e)?vp(e,t,n,i,r,s):C2(e,t,c,n,i,r,s);if(!(n&k2)){var f=u&&wp.call(e,"__wrapped__"),p=h&&wp.call(t,"__wrapped__");if(f||p){var m=f?e.value():e,g=p?t.value():t;return s||(s=new Me),r(m,g,n,i,s)}}return d?(s||(s=new Me),D2(e,t,n,i,r,s)):!1}function da(e,t,n,i,r){return e===t?!0:e==null||t==null||!Pe(e)&&!Pe(t)?e!==e&&t!==t:I2(e,t,n,i,da,r)}var P2=1,N2=2;function U2(e,t,n,i){var r=n.length,s=r,a=!i;if(e==null)return!s;for(e=Object(e);r--;){var o=n[r];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++r<s;){o=n[r];var c=o[0],l=e[c],u=o[1];if(a&&o[2]){if(l===void 0&&!(c in e))return!1}else{var h=new Me;if(i)var d=i(l,u,c,e,t,h);if(!(d===void 0?da(u,l,P2|N2,i,h):d))return!1}}return!0}function Ep(e){return e===e&&!me(e)}function B2(e){for(var t=br(e),n=t.length;n--;){var i=t[n],r=e[i];t[n]=[i,r,Ep(r)]}return t}function _p(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function H2(e){var t=B2(e);return t.length==1&&t[0][2]?_p(t[0][0],t[0][1]):function(n){return n===e||U2(n,e,t)}}function V2(e,t){return e!=null&&t in Object(e)}function G2(e,t,n){t=Gf(t,e);for(var i=-1,r=t.length,s=!1;++i<r;){var a=oa(t[i]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++i!=r?s:(r=e==null?0:e.length,!!r&&wl(r)&&bl(a,r)&&(Ft(e)||vi(e)))}function F2(e,t){return e!=null&&G2(e,t,V2)}var z2=1,j2=2;function W2(e,t){return Sl(e)&&Ep(t)?_p(oa(e),t):function(n){var i=St(n,e);return i===void 0&&i===t?F2(n,e):da(t,i,z2|j2)}}function q2(e){return function(t){return t==null?void 0:t[e]}}function Y2(e){return function(t){return Ff(t,e)}}function X2(e){return Sl(e)?q2(oa(e)):Y2(e)}function fa(e){return typeof e=="function"?e:e==null?ml:typeof e=="object"?Ft(e)?W2(e[0],e[1]):H2(e):X2(e)}function Z2(e){return function(t,n,i){for(var r=-1,s=Object(t),a=i(t),o=a.length;o--;){var c=a[e?o:++r];if(n(s[c],c,s)===!1)break}return t}}var K2=Z2();const Sp=K2;function Il(e,t,n){(n!==void 0&&!vr(e[t],n)||n===void 0&&!(t in e))&&na(e,t,n)}function Pl(e){return Pe(e)&&Un(e)}function Nl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function Q2(e){return yr(e,wr(e))}function J2(e,t,n,i,r,s,a){var o=Nl(e,n),c=Nl(t,n),l=a.get(c);if(l){Il(e,n,l);return}var u=s?s(o,c,n+"",e,t,a):void 0,h=u===void 0;if(h){var d=Ft(c),f=!d&&yi(c),p=!d&&!f&&ra(c);u=c,d||f||p?Ft(o)?u=o:Pl(o)?u=Mf(o):f?(h=!1,u=Zf(c,!0)):p?(h=!1,u=lp(c,!0)):u=[]:SM(c)||vi(c)?(u=o,vi(o)?u=Q2(o):(!me(o)||vl(o))&&(u=cp(c))):h=!1}h&&(a.set(c,u),r(u,c,i,s,a),a.delete(c)),Il(e,n,u)}function Op(e,t,n,i,r){e!==t&&Sp(t,function(s,a){if(r||(r=new Me),me(s))J2(e,t,a,n,Op,i,r);else{var o=i?i(Nl(e,a),s,a+"",e,t,r):void 0;o===void 0&&(o=s),Il(e,a,o)}},wr)}function tA(e,t,n){for(var i=-1,r=e==null?0:e.length;++i<r;)if(n(t,e[i]))return!0;return!1}function eA(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var nA="[object Map]",iA="[object Set]",rA=Object.prototype,sA=rA.hasOwnProperty;function Ce(e){if(e==null)return!0;if(Un(e)&&(Ft(e)||typeof e=="string"||typeof e.splice=="function"||yi(e)||ra(e)||vi(e)))return!e.length;var t=wi(e);if(t==nA||t==iA)return!e.size;if(ia(e))return!Vf(e).length;for(var n in e)if(sA.call(e,n))return!1;return!0}var aA=HO(function(e,t,n){Op(e,t,n)});const nt=aA;var oA=1/0,lA=bi&&1/kl(new bi([,-0]))[1]==oA?function(e){return new bi(e)}:yO;const cA=lA;var uA=200;function Tp(e,t,n){var i=-1,r=kO,s=e.length,a=!0,o=[],c=o;if(n)a=!1,r=tA;else if(s>=uA){var l=t?null:cA(e);if(l)return kl(l);a=!1,r=mp,c=new Or}else c=t?[]:o;t:for(;++i<s;){var u=e[i],h=t?t(u):u;if(u=n||u!==0?u:0,a&&h===h){for(var d=c.length;d--;)if(c[d]===h)continue t;t&&c.push(h),o.push(u)}else r(c,h,n)||(c!==o&&c.push(h),o.push(u))}return o}var hA=$f(function(e){var t=eA(e);return Pl(t)&&(t=void 0),Tp(la(e,1,Pl,!0),fa(t))});const dA=hA;function fA(e){return e&&e.length?Tp(e):[]}const nn=l2,Tr=fA;function pA(e,t,n){let i=null;return(...r)=>{const s=this;s.mousePosition=wn(r[0],n),clearTimeout(i),i=setTimeout(function(){e.apply(s,r)},t)}}function Ct(e,t){var n;const i=nn(e),r=Object.keys(t.axes||{});(n=t==null?void 0:t.toolbar)!=null&&n.controls&&delete i.toolbar.controls,r.length===0&&delete i.axes;for(const s in i.axes)if(r.includes(s)){const a=t.axes[s];if((a.primary||a.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format"),a.mapsTo==null){const c=a.scaleType;c==null?a.mapsTo="value":c===Z.TIME?a.mapsTo="date":c===Z.LABELS&&(a.mapsTo="key")}}else delete i.axes[s];return Ul(i,t),nt(i,t)}function rn(e){if(!e)return;const t=/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/,n=e.getAttribute("transform").match(t);if(!n)return null;if(n[0]){const i=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:i[0],ty:i[1]}}return null}function Mr(e){const t=/\(([^)]+)\)/.exec(e);if(t&&t.length>1){const n=t[1].split(",");if(n.length>1)return{x:parseFloat(n[0]),y:parseFloat(n[1])}}return{x:0,y:0}}function Mp(e,t,n="value"){const i=e/t.reduce((r,s)=>r+s[n],0)*100;return i%1!==0?parseFloat(i.toFixed(1)):i}function Cr(e,t,n){if(n>e.length)return e;if(t===Se.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Se.FRONT_LINE)return"..."+e.substr(-n);if(t===Se.END_LINE)return e.substr(0,n)+"..."}function Ul(e,t){const n=E(e,"legend","additionalItems"),i=E(t,"legend","additionalItems");if(n&&i){const r=i.map(o=>o.type),s=n.map(o=>o.type),a=IS.filter(o=>s.includes(o.type)&&!r.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=dA(a,i,"name")}}const E=(e,...t)=>{let n=e;if(n){for(const i of t)if(n[i]!==null&&n[i]!==void 0)n=n[i];else return null;return n}return null},Cp=(e,t)=>t===Ht.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,Qt=(e,t)=>{const{x0:n,x1:i,y0:r,y1:s}=Cp(e,t);return`M${n},${r}L${n},${s}L${i},${s}L${i},${r}L${n},${r}`};function sn(e,t,n){return n===Ht.VERTICAL?[e,t]:[t,e]}const Ei={type:Se.END_LINE,threshold:16,numCharacter:14},gA={enabled:!0,position:hr.BOTTOM,clickable:!0,truncation:Ei,alignment:It.LEFT,order:null,additionalItems:[]},mA={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},vA={enabled:!0},Ap={enabled:!0,showTotal:!0,truncation:Ei,groupLabel:"Group"},$p={top:{visible:!0,includeZero:!0,truncation:Ei},bottom:{visible:!0,includeZero:!0,truncation:Ei},left:{visible:!0,includeZero:!0,truncation:Ei},right:{visible:!0,includeZero:!0,truncation:Ei}},pa={addSpaceOnEdges:1,showDayName:!1,localeObject:ff,timeIntervalFormats:{"15seconds":{primary:"MMM d, pp",secondary:"pp"},minute:{primary:"MMM d, p",secondary:"p"},"30minutes":{primary:"MMM d, p",secondary:"p"},hourly:{primary:"MMM d, hh a",secondary:"hh a"},daily:{primary:"MMM d",secondary:"d"},weekly:{primary:"eee, MMM d",secondary:"eee"},monthly:{primary:"MMM yyyy",secondary:"MMM"},quarterly:{primary:"QQQ ''yy",secondary:"QQQ"},yearly:{primary:"yyyy",secondary:"yyyy"}}},yA=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),Zt={width:null,height:null,resizable:!0,theme:sf.WHITE,tooltip:Ap,legend:gA,style:{prefix:"cc"},data:{groupMapsTo:"group",loading:!1,selectedGroups:[]},color:{scale:null,pairing:{numberOfVariants:null,option:1},gradient:{enabled:!1}},toolbar:{enabled:!0,numberOfIcons:3,controls:[{type:$t.SHOW_AS_DATATABLE},...yA?[{type:$t.MAKE_FULLSCREEN}]:[],{type:$t.EXPORT_CSV},{type:$t.EXPORT_PNG},{type:$t.EXPORT_JPG}]}},Lp=nt({},Zt,{thematic:{projection:Ke.geoNaturalEarth1}}),Ar=nt({},Zt,{axes:$p,timeScale:pa,grid:mA,ruler:vA,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ie.GRAPH_VIEW}}}),Vn=nt({},Ar,{bars:{maxWidth:16,spacingFactor:.25},timeScale:nt(pa,{addSpaceOnEdges:1})}),xA=nt({},Vn,{}),bA=nt({},Vn,{}),wA=nt({},Vn,{bars:nt({},Vn.bars,{dividerSize:1.5})}),EA=nt({},Vn,{}),Bl=nt({},Ar,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),_A=Bl,Dp=nt({},Bl,{points:{radius:3,filled:!1,enabled:!0}}),kp=nt({},Dp,{timeScale:nt(pa,{addSpaceOnEdges:0})}),SA=kp,OA=nt({},Ar,{bubble:{radiusMapsTo:"radius",radiusLabel:"Radius",radiusRange:e=>{const t=Math.min(e.width,e.height);return[t*3/400,t*25/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:Nt.RADIUS,name:"Radius"}]}}),TA=nt({},Ar,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Nt.AREA,name:"Poor area"},{type:Nt.AREA,name:"Satisfactory area"},{type:Nt.AREA,name:"Great area"},{type:Nt.QUARTILE,name:"Quartiles"}]}}),MA=nt({},Vn,{bars:{dividerSize:1.5},timeScale:nt(pa,{addSpaceOnEdges:0})}),CA=nt({},Zt,{tooltip:nt({},Ap,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:e=>{const t=Math.min(e.width,e.height);return[t*20/400,t*75/400]},wordMapsTo:"word"}}),Rp=nt({},Zt,{pie:{labels:{formatter:null,enabled:!0},alignment:It.LEFT,sortFunction:null,valueMapsTo:"value"}}),AA=nt({},Zt,{legend:{enabled:!1},gauge:{type:di.SEMI,arcWidth:16,deltaArrow:{size:e=>e/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:e=>e/8,valueFontSize:e=>e/2.5,numberFormatter:e=>Number(e.toFixed(2))%1!==0?e.toFixed(2).toLocaleString():e.toFixed().toLocaleString(),alignment:It.LEFT}}),$A=nt({},Rp,{donut:{center:{numberFontSize:e=>`${Math.min(e/100*24,24)}px`,titleFontSize:e=>`${Math.min(e/100*15,15)}px`,titleYPosition:e=>Math.min(e/80*20,20),numberFormatter:e=>Math.floor(e).toLocaleString()},alignment:It.LEFT}}),Ip=nt({},Zt,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),LA=nt({},Ip,{legend:{enabled:!0}}),DA=nt({},Zt,{radar:{axes:{angle:"key",value:"value"},alignment:It.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:e=>e??"N/A"}}),kA=nt({},Vn,{comboChartTypes:[]}),RA=nt({tree:{type:hl.TREE}},Zt,{}),IA=nt({},Zt,{data:nt(Zt.data,{groupMapsTo:"name"})}),PA=nt({},Zt,mi,{data:nt(Zt.data,{groupMapsTo:"name"})}),NA=nt({},Zt,{alluvial:{data:nt(Zt.data,{groupMapsTo:"source"}),nodeAlignment:It.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),UA=nt({},Zt,{axes:$p,heatmap:{divider:{state:fr.AUTO},colorLegend:{type:"linear"}}}),BA=nt({},Lp,{choropleth:{colorLegend:{type:"linear"}}}),wt={alluvialChart:NA,areaChart:kp,axisChart:Ar,boxplotChart:EA,bubbleChart:OA,bulletChart:TA,chart:Zt,circlePackChart:PA,choroplethChart:BA,comboChart:kA,donutChart:$A,gaugeChart:AA,groupedBarChart:bA,heatmapChart:UA,histogramChart:MA,lineChart:Dp,lollipopChart:_A,meterChart:Ip,pieChart:Rp,proportionalMeterChart:LA,radarChart:DA,scatterChart:Bl,simpleBarChart:xA,stackedAreaChart:SA,stackedBarChart:wA,thematicChart:Lp,treeChart:RA,treemapChart:IA,wordCloudChart:CA};var Pp=(e=>(e["15seconds"]="15seconds",e.minute="minute",e["30minutes"]="30minutes",e.hourly="hourly",e.daily="daily",e.weekly="weekly",e.monthly="monthly",e.quarterly="quarterly",e.yearly="yearly",e))(Pp||{});const Hl=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",30*60*1e3],["hourly",60*60*1e3],["daily",24*60*60*1e3],["monthly",30*24*60*60*1e3],["quarterly",3*30*24*60*60*1e3],["yearly",12*30*24*60*60*1e3]];function Np(e,t,n,i,r){const s=t===0,a=Number(pi(new Date(e),"c"))===2,o=Number(pi(new Date(e),"q"))===1,c=t!==0?n[t-1]:null;switch(i){case"15seconds":return s||ma(e)||$r(e,c)||pn(e);case"minute":return s||ma(e)||$r(e,c)||pn(e);case"30minutes":return s||ma(e)||$r(e,c)||pn(e);case"hourly":return s||ma(e)||$r(e,c)||pn(e);case"daily":return r?s||a||pn(e):s||$r(e,c)||pn(e);case"weekly":return s||a||pn(e);case"monthly":return s||pn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${i} is not a valid time interval.`)}}function Vl(e,t,n,i,r){const s=r.showDayName,a=i==="daily"&&s?"weekly":i,o=new Date(e),c=E(r,"timeIntervalFormats")[a],l=E(c,"primary"),u=E(c,"secondary");let h=Np(e,t,n,i,s)?l:u;i==="15seconds"&&o.getMilliseconds()!==0&&(h=h.replace("pp","h:mm:ss.SSS a"));const d=r.localeObject;return pi(o,h,{locale:d})}function ga(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function HA(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function VA(e){const t=Hl.reduce((n,[,i],r)=>{const s=Hl[n][1],a=Math.abs(s-e),o=Math.abs(i-e);return a<o?n:r},0);return Hl[t][0]}function Gl(e,t){if(Pp[t])return t;if(e.length===1)return"15seconds";const n=HA(e),i=ln(n);return VA(i)}function ma(e){const{s:t,m:n,H:i}=ga(e);return i===0&&n===0&&t===0}function $r(e,t){const n=ga(e).M,i=ga(t).M;return n!==i}function pn(e){const{M:t,d:n,s:i,m:r,H:s}=ga(e);return t===1&&n===1&&s===0&&r===0&&i===0}function Up(e){return e===void 0?"":e.toISOString()}var GA=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hp={exports:{}};/*! dom-to-image-more 26-04-2023 */(function(e,t){(function(n){const i=function(){let S=0;return{escape:function(x){return x.replace(/([.*+?^${}()|[]\/\\])/g,"\\$1")},isDataUrl:function(x){return x.search(/^(data:)/)!==-1},canvasToBlob:function(x){return x.toBlob?new Promise(function(A){x.toBlob(A)}):function(A){return new Promise(function(y){var k=f(A.toDataURL().split(",")[1]),I=k.length,U=new Uint8Array(I);for(let N=0;N<I;N++)U[N]=k.charCodeAt(N);y(new Blob([U],{type:"image/png"}))})}(x)},resolveUrl:function(x,A){var y=document.implementation.createHTMLDocument(),k=y.createElement("base"),I=(y.head.appendChild(k),y.createElement("a"));return y.body.appendChild(I),k.href=A,I.href=x,I.href},getAndEncode:function(x){let A=u.impl.urlCache.find(function(y){return y.url===x});return A||(A={url:x,promise:null},u.impl.urlCache.push(A)),A.promise===null&&(u.impl.options.cacheBust&&(x+=(/\?/.test(x)?"&":"?")+new Date().getTime()),A.promise=new Promise(function(y){const k=u.impl.options.httpTimeout,I=new XMLHttpRequest;I.onreadystatechange=function(){if(I.readyState===4)if(I.status!==200)U?y(U):F(`cannot fetch resource: ${x}, status: `+I.status);else{const z=new FileReader;z.onloadend=function(){y(z.result)},z.readAsDataURL(I.response)}},I.ontimeout=function(){U?y(U):F(`timeout of ${k}ms occured while fetching resource: `+x)},I.responseType="blob",I.timeout=k,u.impl.options.useCredentials&&(I.withCredentials=!0),I.open("GET",x,!0),I.send();let U;var N;function F(z){console.error(z),y("")}u.impl.options.imagePlaceholder&&(N=u.impl.options.imagePlaceholder.split(/,/))&&N[1]&&(U=N[1])})),A.promise},uid:function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+S++},delay:function(x){return function(A){return new Promise(function(y){setTimeout(function(){y(A)},x)})}},asArray:function(x){var A=[],y=x.length;for(let k=0;k<y;k++)A.push(x[k]);return A},escapeXhtml:function(x){return x.replace(/%/g,"%25").replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(x){return x!=="data:,"?new Promise(function(A,y){const k=new Image;u.impl.options.useCredentials&&(k.crossOrigin="use-credentials"),k.onload=function(){window&&window.requestAnimationFrame?window.requestAnimationFrame(function(){A(k)}):A(k)},k.onerror=y,k.src=x}):Promise.resolve()},width:function(x){var A=B(x,"width");if(!isNaN(A))return A;var A=B(x,"border-left-width"),y=B(x,"border-right-width");return x.scrollWidth+A+y},height:function(x){var A=B(x,"height");if(!isNaN(A))return A;var A=B(x,"border-top-width"),y=B(x,"border-bottom-width");return x.scrollHeight+A+y},getWindow:$,isElement:M,isElementHostForOpenShadowRoot:function(x){return M(x)&&x.shadowRoot!==null},isShadowRoot:D,isInShadowRoot:L,isHTMLElement:function(x){return x instanceof $(x).HTMLElement},isHTMLCanvasElement:function(x){return x instanceof $(x).HTMLCanvasElement},isHTMLInputElement:function(x){return x instanceof $(x).HTMLInputElement},isHTMLImageElement:function(x){return x instanceof $(x).HTMLImageElement},isHTMLLinkElement:function(x){return x instanceof $(x).HTMLLinkElement},isHTMLScriptElement:function(x){return x instanceof $(x).HTMLScriptElement},isHTMLStyleElement:function(x){return x instanceof $(x).HTMLStyleElement},isHTMLTextAreaElement:function(x){return x instanceof $(x).HTMLTextAreaElement},isShadowSlotElement:function(x){return L(x)&&x instanceof $(x).HTMLSlotElement},isSVGElement:function(x){return x instanceof $(x).SVGElement},isSVGRectElement:function(x){return x instanceof $(x).SVGRectElement},isDimensionMissing:function(x){return isNaN(x)||x<=0}};function $(x){return x=x?x.ownerDocument:void 0,(x?x.defaultView:void 0)||n||window}function D(x){return x instanceof $(x).ShadowRoot}function L(x){return x!==null&&Object.prototype.hasOwnProperty.call(x,"getRootNode")&&D(x.getRootNode())}function M(x){return x instanceof $(x).Element}function B(x,A){if(x.nodeType===h){let y=d(x).getPropertyValue(A);if(y.slice(-2)==="px")return y=y.slice(0,-2),parseFloat(y)}return NaN}}(),r=function(){const S=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(M,B,x){return $(M)?Promise.resolve(M).then(D).then(function(A){let y=Promise.resolve(M);return A.forEach(function(k){y=y.then(function(I){return L(I,k,B,x)})}),y}):Promise.resolve(M)},shouldProcess:$,impl:{readUrls:D,inline:L}};function $(M){return M.search(S)!==-1}function D(M){for(var B,x=[];(B=S.exec(M))!==null;)x.push(B[1]);return x.filter(function(A){return!i.isDataUrl(A)})}function L(M,B,x,A){return Promise.resolve(B).then(function(y){return x?i.resolveUrl(y,x):y}).then(A||i.getAndEncode).then(function(y){return M.replace((k=B,new RegExp(`(url\\(['"]?)(${i.escape(k)})(['"]?\\))`,"g")),`$1${y}$3`);var k})}}(),s={resolveAll:function(){return a().then(function(S){return Promise.all(S.map(function($){return $.resolve()}))}).then(function(S){return S.join(`
2
+ `)})},impl:{readAll:a}};function a(){return Promise.resolve(i.asArray(document.styleSheets)).then(function($){const D=[];return $.forEach(function(L){if(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(L),"cssRules"))try{i.asArray(L.cssRules||[]).forEach(D.push.bind(D))}catch(M){console.error("domtoimage: Error while reading CSS rules from "+L.href,M.toString())}}),D}).then(function($){return $.filter(function(D){return D.type===CSSRule.FONT_FACE_RULE}).filter(function(D){return r.shouldProcess(D.style.getPropertyValue("src"))})}).then(function($){return $.map(S)});function S($){return{resolve:function(){var D=($.parentStyleSheet||{}).href;return r.inlineAll($.cssText,D)},src:function(){return $.style.getPropertyValue("src")}}}}const o={inlineAll:function S($){if(!i.isElement($))return Promise.resolve($);return D($).then(function(){return i.isHTMLImageElement($)?c($).inline():Promise.all(i.asArray($.childNodes).map(function(L){return S(L)}))});function D(L){const M=["background","background-image"],B=M.map(function(x){const A=L.style.getPropertyValue(x),y=L.style.getPropertyPriority(x);return A?r.inlineAll(A).then(function(k){L.style.setProperty(x,k,y)}):Promise.resolve()});return Promise.all(B).then(function(){return L})}},impl:{newImage:c}};function c(S){return{inline:function($){return i.isDataUrl(S.src)?Promise.resolve():Promise.resolve(S.src).then($||i.getAndEncode).then(function(D){return new Promise(function(L){S.onload=L,S.onerror=L,S.src=D})})}}}const l={copyDefaultStyles:!0,imagePlaceholder:void 0,cacheBust:!1,useCredentials:!1,httpTimeout:3e4,styleCaching:"strict"},u={toSvg:p,toPng:function(S,$){return m(S,$).then(function(D){return D.toDataURL()})},toJpeg:function(S,$){return m(S,$).then(function(D){return D.toDataURL("image/jpeg",($?$.quality:void 0)||1)})},toBlob:function(S,$){return m(S,$).then(i.canvasToBlob)},toPixelData:function(S,$){return m(S,$).then(function(D){return D.getContext("2d").getImageData(0,0,i.width(S),i.height(S)).data})},toCanvas:m,impl:{fontFaces:s,images:o,util:i,inliner:r,urlCache:[],options:{}}},h=(e.exports=u,(typeof Node<"u"?Node.ELEMENT_NODE:void 0)||1),d=(n!==void 0?n.getComputedStyle:void 0)||(typeof window<"u"?window.getComputedStyle:void 0)||globalThis.getComputedStyle,f=(n!==void 0?n.atob:void 0)||(typeof window<"u"?window.atob:void 0)||globalThis.atob;function p(S,$){u.impl.util.getWindow(S);var D=$=$||{};D.copyDefaultStyles===void 0?u.impl.options.copyDefaultStyles=l.copyDefaultStyles:u.impl.options.copyDefaultStyles=D.copyDefaultStyles,D.imagePlaceholder===void 0?u.impl.options.imagePlaceholder=l.imagePlaceholder:u.impl.options.imagePlaceholder=D.imagePlaceholder,D.cacheBust===void 0?u.impl.options.cacheBust=l.cacheBust:u.impl.options.cacheBust=D.cacheBust,D.useCredentials===void 0?u.impl.options.useCredentials=l.useCredentials:u.impl.options.useCredentials=D.useCredentials,D.httpTimeout===void 0?u.impl.options.httpTimeout=l.httpTimeout:u.impl.options.httpTimeout=D.httpTimeout,D.styleCaching===void 0?u.impl.options.styleCaching=l.styleCaching:u.impl.options.styleCaching=D.styleCaching;let L=[];return Promise.resolve(S).then(function(M){if(M.nodeType===h)return M;var B=M,x=M.parentNode,A=document.createElement("span");return x.replaceChild(A,B),A.append(M),L.push({parent:x,child:B,wrapper:A}),A}).then(function(M){return function B(x,A,y,k){const I=A.filter;if(x===g||i.isHTMLScriptElement(x)||i.isHTMLStyleElement(x)||i.isHTMLLinkElement(x)||y!==null&&I&&!I(x))return Promise.resolve();return Promise.resolve(x).then(U).then(function(G){return F(G,N(x))}).then(function(G){return z(G,x)});function U(G){return i.isHTMLCanvasElement(G)?i.makeImage(G.toDataURL()):G.cloneNode(!1)}function N(G){return i.isElementHostForOpenShadowRoot(G)?G.shadowRoot:G}function F(G,Q){const j=tt(Q);let X=Promise.resolve();if(j.length!==0){const lt=d(ot(Q));i.asArray(j).forEach(function(W){X=X.then(function(){return B(W,A,lt).then(function(q){q&&G.appendChild(q)})})})}return X.then(function(){return G});function ot(lt){return i.isShadowRoot(lt)?lt.host:lt}function tt(lt){return i.isShadowSlotElement(lt)?lt.assignedNodes():lt.childNodes}}function z(G,Q){return!i.isElement(G)||i.isShadowSlotElement(Q)?Promise.resolve(G):Promise.resolve().then(j).then(X).then(ot).then(tt).then(function(){return G});function j(){function lt(q,Y){Y.font=q.font,Y.fontFamily=q.fontFamily,Y.fontFeatureSettings=q.fontFeatureSettings,Y.fontKerning=q.fontKerning,Y.fontSize=q.fontSize,Y.fontStretch=q.fontStretch,Y.fontStyle=q.fontStyle,Y.fontVariant=q.fontVariant,Y.fontVariantCaps=q.fontVariantCaps,Y.fontVariantEastAsian=q.fontVariantEastAsian,Y.fontVariantLigatures=q.fontVariantLigatures,Y.fontVariantNumeric=q.fontVariantNumeric,Y.fontVariationSettings=q.fontVariationSettings,Y.fontWeight=q.fontWeight}function W(q,Y){const V=d(q);V.cssText?(Y.style.cssText=V.cssText,lt(V,Y.style)):(w(A,q,V,y,Y),y===null&&(["inset-block","inset-block-start","inset-block-end"].forEach(xt=>Y.style.removeProperty(xt)),["left","right","top","bottom"].forEach(xt=>{Y.style.getPropertyValue(xt)&&Y.style.setProperty(xt,"0px")})))}W(Q,G)}function X(){const lt=i.uid();function W(q){const Y=d(Q,q),V=Y.getPropertyValue("content");if(V!==""&&V!=="none"){let xt=function(){const jt=`.${lt}:`+q,et=(Y.cssText?At:zn)();return document.createTextNode(jt+`{${et}}`);function At(){return`${Y.cssText} content: ${V};`}function zn(){return i.asArray(Y).map(Be).join("; ")+";";function Be(Oc){const fU=Y.getPropertyValue(Oc),pU=Y.getPropertyPriority(Oc)?" !important":"";return Oc+": "+fU+pU}}};const pt=G.getAttribute("class")||"",Vt=(G.setAttribute("class",pt+" "+lt),document.createElement("style"));Vt.appendChild(xt()),G.appendChild(Vt)}}[":before",":after"].forEach(function(q){W(q)})}function ot(){i.isHTMLTextAreaElement(Q)&&(G.innerHTML=Q.value),i.isHTMLInputElement(Q)&&G.setAttribute("value",Q.value)}function tt(){i.isSVGElement(G)&&(G.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.isSVGRectElement(G))&&["width","height"].forEach(function(lt){const W=G.getAttribute(lt);W&&G.style.setProperty(lt,W)})}}}(M,$,null)}).then(v).then(b).then(function(M){$.bgcolor&&(M.style.backgroundColor=$.bgcolor),$.width&&(M.style.width=$.width+"px"),$.height&&(M.style.height=$.height+"px"),$.style&&Object.keys($.style).forEach(function(x){M.style[x]=$.style[x]});let B=null;return typeof $.onclone=="function"&&(B=$.onclone(M)),Promise.resolve(B).then(function(){return M})}).then(function(M){let B=$.width||i.width(M),x=$.height||i.height(M);return Promise.resolve(M).then(function(A){return A.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(A)}).then(i.escapeXhtml).then(function(A){var y=(i.isDimensionMissing(B)?' width="100%"':` width="${B}"`)+(i.isDimensionMissing(x)?' height="100%"':` height="${x}"`);return`<svg xmlns="http://www.w3.org/2000/svg"${(i.isDimensionMissing(B)?"":` width="${B}"`)+(i.isDimensionMissing(x)?"":` height="${x}"`)}><foreignObject${y}>${A}</foreignObject></svg>`}).then(function(A){return"data:image/svg+xml;charset=utf-8,"+A})}).then(function(M){for(;0<L.length;){var B=L.pop();B.parent.replaceChild(B.child,B.wrapper)}return M}).then(function(M){return u.impl.urlCache=[],function(){g&&(document.body.removeChild(g),g=null),O&&clearTimeout(O),O=setTimeout(()=>{O=null,_={}},2e4)}(),M})}function m(S,$){return p(S,$=$||{}).then(i.makeImage).then(function(D){var L=typeof $.scale!="number"?1:$.scale,M=function(x,A){let y=$.width||i.width(x),k=$.height||i.height(x);return i.isDimensionMissing(y)&&(y=i.isDimensionMissing(k)?300:2*k),i.isDimensionMissing(k)&&(k=y/2),x=document.createElement("canvas"),x.width=y*A,x.height=k*A,$.bgcolor&&((A=x.getContext("2d")).fillStyle=$.bgcolor,A.fillRect(0,0,x.width,x.height)),x}(S,L),B=M.getContext("2d");return B.msImageSmoothingEnabled=!1,B.imageSmoothingEnabled=!1,D&&(B.scale(L,L),B.drawImage(D,0,0)),M})}let g=null;function v(S){return s.resolveAll().then(function($){var D;return $!==""&&(D=document.createElement("style"),S.appendChild(D),D.appendChild(document.createTextNode($))),S})}function b(S){return o.inlineAll(S).then(function(){return S})}function w(S,$,D,L,M){const B=u.impl.options.copyDefaultStyles?function(A,I){var I=function(N){var F=[];do if(N.nodeType===h){var z=N.tagName;if(F.push(z),T.includes(z))break}while(N=N.parentNode,N);return F}(I),k=function(N){return(A.styleCaching!=="relaxed"?N:N.filter((F,z,G)=>z===0||z===G.length-1)).join(">")}(I);if(_[k])return _[k];var U=function(){if(g)return g.contentWindow;var N=document.characterSet||"UTF-8",F=document.doctype,F=F?(`<!DOCTYPE ${z(F.name)} ${z(F.publicId)} `+z(F.systemId)).trim()+">":"";return(g=document.createElement("iframe")).id="domtoimage-sandbox-"+i.uid(),g.style.visibility="hidden",g.style.position="fixed",document.body.appendChild(g),function(G,Q,j,X){try{return G.contentWindow.document.write(Q+`<html><head><meta charset='${j}'><title>${X}</title></head><body></body></html>`),G.contentWindow}catch{}var ot=document.createElement("meta");ot.setAttribute("charset",j);try{var tt=document.implementation.createHTMLDocument(X),lt=(tt.head.appendChild(ot),Q+tt.documentElement.outerHTML);return G.setAttribute("srcdoc",lt),G.contentWindow}catch{}return G.contentDocument.head.appendChild(ot),G.contentDocument.title=X,G.contentWindow}(g,F,N,"domtoimage-sandbox");function z(G){var Q;return G?((Q=document.createElement("div")).innerText=G,Q.innerHTML):""}}(),I=function(N,F){let z=N.body;do{var G=F.pop(),G=N.createElement(G);z.appendChild(G),z=G}while(0<F.length);return z.textContent="​",z}(U.document,I),U=function(N,F){const z={},G=N.getComputedStyle(F);return i.asArray(G).forEach(function(Q){z[Q]=Q==="width"||Q==="height"?"auto":G.getPropertyValue(Q)}),z}(U,I);return function(N){do{var F=N.parentElement;F!==null&&F.removeChild(N),N=F}while(N&&N.tagName!=="BODY")}(I),_[k]=U}(S,$):{},x=M.style;i.asArray(D).forEach(function(A){var y,k=D.getPropertyValue(A),I=B[A],U=L?L.getPropertyValue(A):void 0;(k!==I||L&&k!==U)&&(I=D.getPropertyPriority(A),U=x,k=k,I=I,y=0<=["background-clip"].indexOf(A=A),I?(U.setProperty(A,k,I),y&&U.setProperty("-webkit-"+A,k,I)):(U.setProperty(A,k),y&&U.setProperty("-webkit-"+A,k)))})}let O=null,_={};const T=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DETAILS","DIALOG","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","SVG","TABLE","UL","math","svg","BODY","HEAD","HTML"]})(GA)})(Hp);var FA=Hp.exports;const Vp=Bp(FA);function Gp(e){const t=ye(e,i=>i.value),n=_e().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}function Fp(e,t){const n=E(t,"gradient","colors"),i=!Ce(n);let r=E(t,"pairing","option");const s=Gp(e),a=s[0]<0&&s[1]>0?"diverge":"mono";(r<1&&r>4&&a==="mono"||r<1&&r>2&&a==="diverge")&&(r=1);const o=i?n:[];if(!i){const c=a==="diverge"?17:11;for(let l=1;l<c+1;l++)o.push(`fill-${a}-${r}-${l}`)}return zo().domain(s).range(o)}var at=(e=>(e.GRAPHICS_DOCUMENT="graphics-document",e.GRAPHICS_OBJECT="graphics-object",e.GRAPHICS_SYMBOL="graphics-symbol",e.GROUP="group",e.DOCUMENT="document",e.CHECKBOX="checkbox",e.BUTTON="button",e.MENU="menu",e.MENU_ITEM="menuitem",e.IMG="img",e))(at||{});function zA(e,t){return e&&Sp(e,t,br)}function jA(e,t){return function(n,i){if(n==null)return n;if(!Un(n))return e(n,i);for(var r=n.length,s=t?r:-1,a=Object(n);(t?s--:++s<r)&&i(a[s],s,a)!==!1;);return n}}var WA=jA(zA);const Fl=WA;function qA(e,t,n,i){for(var r=-1,s=e==null?0:e.length;++r<s;){var a=e[r];t(i,a,n(a),e)}return i}function YA(e,t,n,i){return Fl(e,function(r,s,a){t(i,r,n(r),a)}),i}function XA(e,t){return function(n,i){var r=Ft(n)?qA:YA,s=t?t():{};return r(n,e,fa(i),s)}}function ZA(e){for(var t=-1,n=e==null?0:e.length,i={};++t<n;){var r=e[t];i[r[0]]=r[1]}return i}var KA=Object.prototype,QA=KA.hasOwnProperty,JA=XA(function(e,t,n){QA.call(e,n)?e[n].push(t):na(e,n,[t])});const t$=JA;class Ne{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let i=this.getData();const r=this.getDataGroups(),{groupMapsTo:s}=E(n,"data"),a=E(n,"axes");return t&&(i=i.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const c=a[o].mapsTo,l=a[o].scaleType;if((l===Z.LINEAR||l===Z.LOG)&&(i=i.map(u=>({...u,[c]:u[c]===null?u[c]:Number(u[c])}))),c&&a[o].domain)if(l===Z.LABELS)i=i.filter(u=>a[o].domain.includes(u[c]));else{const[u,h]=a[o].domain;i=i.filter(d=>!(c in d)||d[c]>=u&&d[c]<=h)}}),i.filter(o=>r.find(c=>c.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Lt.items.status,i=this.getDataGroups(t),{groupMapsTo:r}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(s=>i.find(a=>a.name===s[r]&&a.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(nn(t)),i=this.generateDataGroups(n);return this.set({data:n,dataGroups:i}),n}getDataGroups(t){return E(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Lt.items.status;return this.getDataGroups(t).filter(i=>i.status===n)}getDataGroupNames(t){return this.getDataGroups(t).map(n=>n.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(n=>n.name)}aggregateBinDataByGroup(t){return t$(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),i=this.services.cartesianScales.getMainXAxisPosition(),r=this.services.cartesianScales.getDomainIdentifier(),s=n.axes[i],{groupMapsTo:a}=n.data,{bins:o=kS.defaultBins}=s,c=Array.isArray(o),l=pv().value(f=>f[r]).thresholds(o)(t);if(c)l[l.length-1].x1=o[o.length-1];else{const f=l[0].x1-l[0].x0;l[l.length-1].x1=+l[l.length-1].x0+f}const u=c?[o[0],o[o.length-1]]:[l[0].x0,l[l.length-1].x1],h=Array.from(new Set(t.map(f=>f[a]))),d=[];return l.forEach(f=>{const p=`${f.x0}-${f.x1}`,m=this.aggregateBinDataByGroup(f);h.forEach(g=>{d.push({group:g,key:p,value:m[g]||0,bin:f.x0})})}),{bins:l,binsDomain:u}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this.getActiveDataGroupNames(),{bins:r}=this.getBinConfigurations(),s=this.getDataValuesGroupedByKeys({bins:r});return ul().keys(i)(s).map((a,o)=>Object.keys(a).filter(c=>!isNaN(c)).map(c=>{const l=a[c];return l[n]=i[o],l}))}getGroupedData(t){const n=this.getDisplayData(t),i={},{groupMapsTo:r}=this.getOptions().data;return n.map(s=>{const a=s[r];i[a]!==null&&i[a]!==void 0?i[a].push(s):i[a]=[s]}),Object.keys(i).map(s=>({name:s,data:i[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const i=this.getOptions(),r=this.getDisplayData(n);let s;t?s=t.map(c=>`${c.x0}-${c.x1}`):s=Tr(r.map(c=>{const l=this.services.cartesianScales.getDomainIdentifier(c);return c[l]instanceof Date?Up(c[l]):c[l]&&typeof c[l].toString=="function"?c[l].toString():c[l]}));const a=this.services.cartesianScales.domainAxisPosition,o=i.axes[a].scaleType;return o===Z.TIME?s.sort((c,l)=>{const u=new Date(c),h=new Date(l);return u-h}):(o===Z.LOG||o===Z.LINEAR)&&s.sort((c,l)=>c-l),s}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const i=this.getOptions(),{groupMapsTo:r}=i.data,s=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:t,groups:n});return t?o.map(c=>{const[l,u]=c.split("-"),h={x0:l,x1:u},d=t.find(f=>f.x0.toString()===l.toString());return a.forEach(f=>{h[f]=d.filter(p=>p[r]===f).length}),h}):o.map(c=>{const l={sharedStackKey:c};return a.forEach(u=>{const h=s.find(f=>{const p=this.services.cartesianScales.getDomainIdentifier(f);return f[r]===u&&Object.prototype.hasOwnProperty.call(f,p)&&(f[p]instanceof Date?Up(f[p])===c:f[p].toString()===c)}),d=this.services.cartesianScales.getRangeIdentifier(l);l[u]=h?h[d]:null}),l})}getStackedData({percentage:t=!1,groups:n=null,divergent:i=!1}){const r=this.getOptions(),{groupMapsTo:s}=r.data,a=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const c=ZA(o.map(l=>[l.sharedStackKey,0]));o.forEach(l=>{a.forEach(u=>{c[l.sharedStackKey]+=l[u]})}),o.forEach(l=>{a.forEach(u=>{const h=c[l.sharedStackKey];c[l.sharedStackKey]?l[u]=l[u]/h*100:l[u]=0})})}return(i?ul().offset(b_):ul()).keys(a)(o).map((c,l)=>Object.keys(c).filter(u=>!isNaN(u)).map(u=>{const h=c[u];return h[s]=a[l],h}))}getOptions(){return this.state.options}set(t,n){this.state=Object.assign({},this.state,t);const i=Object.assign({skipUpdate:!1,animate:!0},n);i.skipUpdate||this.update(i.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const n=this.getOptions();Ul(n,t),this.set({options:nt(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(C.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:i}=Lt.items.status,r=this.getDataGroups(),s=r.some(l=>l.status===i),a=r.filter(l=>l.status===n);if(s)if(a.length===1&&a[0].name===t)r.forEach((l,u)=>{r[u].status=n});else{const l=r.findIndex(u=>u.name===t);r[l].status=r[l].status===i?n:i}else r.forEach((l,u)=>{r[u].status=l.name===t?n:i});const o=r.filter(l=>l.status===n),c=this.getOptions();r.some(l=>l.status===i)?c.data.selectedGroups=o.map(l=>l.name):c.data.selectedGroups=[],this.services.events.dispatchEvent(C.Legend.ITEMS_UPDATE,{dataGroups:r}),this.set({dataGroups:r})}getIsFilled(t,n,i,r){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,i,r):r}getFillColor(t,n,i){const r=this.getOptions(),s=E(this.colorScale,t);return r.getFillColor?r.getFillColor(t,n,i,s):s}getStrokeColor(t,n,i){const r=this.getOptions(),s=E(this.colorScale,t);return r.getStrokeColor?r.getStrokeColor(t,n,i,s):s}isUserProvidedColorScaleValid(){const t=E(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(i=>Object.keys(t).includes(i.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let i=t.originalClassName;return t.classNameTypes.forEach(r=>i=t.originalClassName?`${i} ${r}-${n}`:`${r}-${n}`),i||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format");const n=[],{datasets:i,labels:r}=t;return i.forEach(s=>{s.data.forEach((a,o)=>{let c;const l=E(s,"label");if(l===null){const h=E(r,o);h?c=h:c="Ungrouped"}else c=l;const u={group:c,key:r[o]};isNaN(a)?(u.value=a.value,u.date=a.date):u.value=a,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map(r=>r.map(s=>`"${s==="&ndash;"?"–":s}"`));let n="",i="";t.forEach(function(r,s){i=r.join(","),n+=s<t.length?i+`
3
+ `:i}),this.services.files.downloadCSV(n,"myChart.csv")}getTabularData(t){return Array.isArray(t)?t:this.transformToTabularData(t)}sanitize(t){return t=this.getTabularData(t),t}updateAllDataGroups(){this.allDataGroups?this.getDataGroupNames().forEach(t=>{this.allDataGroups.indexOf(t)===-1&&this.allDataGroups.push(t)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(t){const{groupMapsTo:n}=this.getOptions().data,{ACTIVE:i,DISABLED:r}=Lt.items.status,s=this.getOptions(),a=Tr(t.map(c=>c[n]));s.data.selectedGroups.length&&(s.data.selectedGroups.every(c=>a.includes(c))||(s.data.selectedGroups=[]));const o=c=>!s.data.selectedGroups.length||s.data.selectedGroups.includes(c)?i:r;return a.map(c=>({name:c,status:o(c)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=E(t,"color","scale");Object.keys(n).forEach(i=>{this.allDataGroups.includes(i)||console.warn(`"${i}" does not exist in data groups.`)}),this.allDataGroups.filter(i=>n[i]).forEach(i=>this.colorScale[i]=n[i])}setColorClassNames(){const t=E(this.getOptions(),"color","pairing");let n=E(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let i=E(t,"option");const r=pf.pairingOptions,s=n>5?14:n,a=`${s}-color`;i=i<=r[a]?i:1;const o=this.allDataGroups.map((c,l)=>`${s}-${i}-${l%14+1}`);this.colorClassNames=Cs().range(o).domain(this.allDataGroups)}}let Gn=class extends Ne{constructor(t){super(t),this.axisFlavor=Ys.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,n=this.getOptions(),i=t.isDualAxes(),r={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return i&&(r.secondaryDomain=t.secondaryDomainAxisPosition,r.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(r).forEach(s=>{const a=r[s];t.scales[a]?r[s]={position:a,label:t.getScaleLabel(a),identifier:E(n,"axes",a,"mapsTo")}:r[s]=null}),r}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,{cartesianScales:r}=this.services,{primaryDomain:s,primaryRange:a,secondaryDomain:o,secondaryRange:c}=this.assignRangeAndDomains(),l=r.getDomainAxisScaleType();let u;return l===Z.TIME&&(u=h=>pi(h,"MMM d, yyyy")),[["Group",s.label,a.label,...o?[o.label]:[],...c?[c.label]:[]],...t.map(h=>[h[i],h[s.identifier]===null?"&ndash;":u?u(h[s.identifier]):h[s.identifier],h[a.identifier]===null||isNaN(h[a.identifier])?"&ndash;":h[a.identifier].toLocaleString(),...o?[h[o.identifier]===null?"&ndash;":h[o.identifier]]:[],...c?[h[c.identifier]===null||isNaN(h[c.identifier])?"&ndash;":h[c.identifier]]:[]])]}setData(t){let n;if(t&&(n=super.setData(t),E(this.getOptions(),"zoomBar",H.TOP,"enabled"))){const i=E(this.getOptions(),"zoomBar",H.TOP,"data");this.setZoomBarData(i)}return n}setZoomBarData(t){const n=t?this.sanitize(nn(t)):this.getDisplayData();let i=n;const{cartesianScales:r}=this.services;if(n&&r.domainAxisPosition&&r.rangeAxisPosition){const s=r.getDomainIdentifier(),a=r.getRangeIdentifier();let o=n.map(c=>c[s].getTime());o=Tr(o).sort(),i=o.map(c=>{let l=0;const u={};return n.forEach(h=>{h[s].getTime()===c&&(l+=h[a])}),u[s]=new Date(c),u[a]=l,u})}this.set({zoomBarData:i})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(t){const n=this.getOptions();if(!n.axes)return t;const i=[];return Object.keys(H).forEach(r=>{const s=H[r],a=n.axes[s];if(a&&a.scaleType===Z.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&i.push(o)}}),i.length>0&&t.forEach(r=>{i.forEach(s=>{E(r,s,"getTime")===null&&(r[s]=new Date(r[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}},e$=class extends Gn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData();return t.sort((n,i)=>n.source.localeCompare(i.source)),[["Source","Target","Value"],...t.map(n=>[n.source,n.target,n.value])]}},n$=class extends Gn{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Pa(t,.25),q_50:Pa(t,.5),q_75:Pa(t,.75)}}getBoxplotData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this.getGroupedData(),r=[];for(const{name:s,data:a}of i){const o=this.services.cartesianScales.getRangeIdentifier(),c=a.map(w=>w[o]).sort(yn),l={[n]:s,counts:c,quartiles:this.getBoxQuartiles(c),outliers:null,whiskers:null},u=l.quartiles.q_25,h=l.quartiles.q_75,d=(h-u)*1.5,f=u-d,p=h+d,m=[],g=[];for(const w of c)w<f||w>p?m.push(w):g.push(w);l.outliers=m;const v=ln(g),b=bn(g);l.whiskers={min:v||ln([l.quartiles.q_25,l.quartiles.q_50,l.quartiles.q_75]),max:b||bn([l.quartiles.q_25,l.quartiles.q_50,l.quartiles.q_75])},r.push(l)}return r}getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this.getBoxplotData();return[["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],...i.map(r=>{let s=E(r,"outliers");return(s===null||s.length===0)&&(s=["&ndash;"]),[r[n],E(r,"whiskers","min")!==null?E(r,"whiskers","min").toLocaleString():"&ndash;",E(r,"quartiles","q_25")!==null?E(r,"quartiles","q_25").toLocaleString():"&ndash;",E(r,"quartiles","q_50")!==null?E(r,"quartiles","q_50").toLocaleString():"&ndash;",E(r,"quartiles","q_75")!==null?E(r,"quartiles","q_75").toLocaleString():"&ndash;",E(r,"whiskers","max")!==null?E(r,"whiskers","max").toLocaleString():"&ndash;",E(r,"quartiles","q_75")!==null&&E(r,"quartiles","q_25")!==null?(E(r,"quartiles","q_75")-E(r,"quartiles","q_25")).toLocaleString():"&ndash;",s.map(a=>a.toLocaleString()).join(",")]})]}setColorClassNames(){const t=E(this.getOptions(),"color","pairing");let n=E(t,"option");const i=pf.pairingOptions;n=n<=i["1-color"]?n:1;const r=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=Cs().range(r).domain(this.allDataGroups)}},i$=class extends Gn{constructor(t){super(t)}getMatchingRangeIndexForDatapoint(t){let n;for(let i=t.ranges.length-1;i>0;i--){const r=t.ranges[i];if(t.value>=r)return n=i,n}return 0}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.services.cartesianScales.getRangeIdentifier(),s=E(n,"bullet","performanceAreaTitles");return[["Title","Group","Value","Target","Percentage","Performance"],...t.map(a=>[a.title,a[i],a.value===null?"&ndash;":a.value,E(a,"marker")===null?"&ndash;":a.marker,E(a,"marker")===null?"&ndash;":`${Math.floor(a[r]/a.marker*100)}%`,s[this.getMatchingRangeIndexForDatapoint(a)]])]}},r$=class extends Ne{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Ce(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Ce(n)&&!Ce(t.geoData.objects.countries)&&(t.geoData.objects.countries.geometries.forEach(i=>{this._matrix[i.properties.NAME]=i}),n.forEach(i=>{this._matrix[i.name]?this._matrix[i.name].value=i.value||null:console.warn(`Data point ${i} is missing geographical data.`)}))}return this._matrix}getTabularDataArray(){const t=this.getDisplayData();return[["Country ID","Country Name","Value"],...t.map(n=>[n.id===null?"&ndash;":n.id,n.name,n.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=E(this.getOptions(),"color");this._colorScale=Fp(this.getDisplayData(),t)}},s$=class extends Ne{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),i=nt({},t,this.getZoomOptions(t));Ul(n,i);const r=this.getHierarchyLevel(),s=E(n,"circlePack","hierarchyLevel");this.set({options:nt(n,i),depth:s&&s<4?s:r})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),i=t||this.getOptions(),r=n.length===1&&E(n,0,"children")?E(n,0,"children"):n;let s=this.getHierarchyLevel();return r.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),E(i,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:Nt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:i}=n.data,r=t.map(s=>{const a=s[i];return this.setChildrenDataGroup(s,a)});this.set({data:r},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(i=>this.setChildrenDataGroup(i,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent","Value"]];return t.forEach(i=>{let r=i.value?i.value:0;i.children&&(r+=this.getChildrenDatums(i.children,i.name,n,0)),n.push(["&ndash;",i.name,r])}),n}getChildrenDatums(t,n,i=[],r=0){const s=n;return t.forEach(a=>{const o=a.name;let c=0;if(a.children)a.children.length>0&&(typeof a.value=="number"&&(r+=a.value),c+=this.getChildrenDatums(a.children,o,i,c),i.push([o,s,c]),r+=c);else{let l=0;typeof a.value=="number"&&(l=a.value,r+=a.value),i.push([a.name,s,l])}}),r}},a$=class extends Ne{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(i=>{i.key&&i.key!==i.group&&(i.group=i.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data;return[["Group","Value"],...t.map(r=>[r[i],r.value===null?"&ndash;":r.value.toLocaleString()])]}sanitize(t){return this.getTabularData(t).sort((n,i)=>i.value-n.value)}},o$=class extends Ne{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data;return[["Group","Value"],...t.map(r=>[r[i],r.value===null?"&ndash;":r.value.toLocaleString()])]}},l$=class extends Gn{constructor(t){super(t),this.axisFlavor=Ys.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=E(this.getOptions(),"axes");if(E(n,"left","scaleType")&&E(n,"left","scaleType")!==Z.LABELS||E(n,"right","scaleType")&&E(n,"right","scaleType")!==Z.LABELS||E(n,"top","scaleType")&&E(n,"top","scaleType")!==Z.LABELS||E(n,"bottom","scaleType")&&E(n,"bottom","scaleType")!==Z.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=ye(this.getDisplayData(),i=>i.value),n=_e().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(Ce(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,i=n.getDomainIdentifier(),r=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(r);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[i])))}return this._domains}getUniqueRanges(){if(Ce(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,i=n.getRangeIdentifier(),r=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(r);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[i])))}return this._ranges}getMatrix(){if(Ce(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),i=this.services.cartesianScales.getDomainIdentifier(),r=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=nn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[i]][a[r]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(nn(t)),i=this.generateDataGroups(n);return this.set({data:n,dataGroups:i}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ce(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),i=this.services.cartesianScales.getDomainIdentifier(),r=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const c={value:this._matrix[a][o].value,index:this._matrix[a][o].index};c[i]=a,c[r]=o,s.push(c)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:i}=this.assignRangeAndDomains();return[[n.label,i.label,"Value"],...t.map(r=>[r[n.identifier]===null?"&ndash;":r[n.identifier],r[i.identifier]===null?"&ndash;":r[i.identifier].toLocaleString(),r.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=E(t,"color","gradient","colors"),i=!Ce(n);let r=E(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(r<1&&r>4&&a==="mono"||r<1&&r>2&&a==="diverge")&&(r=1);const o=i?n:[];if(!i){const l=a==="diverge"?17:11;for(let u=1;u<l+1;u++)o.push(`fill-${a}-${r}-${u}`)}this._colorScale=zo().domain(s).range(o);const c=E(this.getOptions(),"color");this._colorScale=Fp(this.getDisplayData(),c)}},c$=class extends Gn{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this.getBinnedStackedData();return[[St(t,"bins.rangeLabel")||"Range",...i.map(r=>St(r,`0.${n}`))],...St(i,0).map((r,s)=>[`${St(r,"data.x0")} – ${St(r,"data.x1")}`,...i.map(a=>St(a[s],`data.${St(a[s],n)}`))])]}},u$=class extends Ne{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,i)=>n+i.value,0)}getFillColor(t){const n=this.getOptions(),i=E(n,"color","scale"),r=this.getStatus();return i||!r?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=E(this.getDisplayData()),{value:i}=n?n.reduce((a,o)=>({value:a.value+o.value})):0,r=E(t,"meter","proportional")?i:i>100?100:i,s=E(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=r&&r<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getStatus(),s=E(n,"meter","proportional");let a=[],o;if(s===null){o=100;const c=t[0];a=[["Group","Value",...r?["Status"]:[]],[c[i],c.value,...r?[r]:[]]]}else o=E(s,"total")||this.getMaximumDomain(t),a=[["Group","Value","Percentage of total"],...t.map(l=>[l[i],l.value,(l.value/o*100).toFixed(2)+" %"])];return a}},h$=class extends Gn{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:i,value:r}=E(t,"radar","axes"),s=E(n,"0","data").map(a=>a[i]);return[["Group",...s],...n.map(a=>[a.name,...s.map((o,c)=>E(a,"data",c,r)!==null?E(a,"data",c,r).toLocaleString():"&ndash;")])]}},d$=class extends Ne{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent"]];return t.forEach(i=>{this.getChildrenDatums(i,n),n.push([i.name,"&ndash;"])}),n}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(i=>{this.getChildrenDatums(i,n),n.push([i.name,t.name])})}},f$=class extends Ne{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Group","Value"]];return t.forEach(i=>{Array.isArray(i.children)?i.children.forEach(r=>{n.push([r.name,i.name,r.value])}):E(i.name)!==null&&E(i.value)&&n.push(["–",i.name,i.value])}),n}};class p$ extends Ne{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:i,wordMapsTo:r}=n.wordCloud,{groupMapsTo:s}=n.data;return[[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],...t.map(a=>[a[r],a[s],a[i]])]}}var g$=/\s/;function m$(e){for(var t=e.length;t--&&g$.test(e.charAt(t)););return t}var v$=/^\s+/;function y$(e){return e&&e.slice(0,m$(e)+1).replace(v$,"")}var zp=0/0,x$=/^[-+]0x[0-9a-f]+$/i,b$=/^0b[01]+$/i,w$=/^0o[0-7]+$/i,E$=parseInt;function Lr(e){if(typeof e=="number")return e;if(ta(e))return zp;if(me(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=me(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=y$(e);var n=b$.test(e);return n||w$.test(e)?E$(e.slice(2),n?2:8):x$.test(e)?zp:+e}var _$=function(){return Te.Date.now()};const zl=_$;var S$="Expected a function",O$=Math.max,T$=Math.min;function va(e,t,n){var i,r,s,a,o,c,l=0,u=!1,h=!1,d=!0;if(typeof e!="function")throw new TypeError(S$);t=Lr(t)||0,me(n)&&(u=!!n.leading,h="maxWait"in n,s=h?O$(Lr(n.maxWait)||0,t):s,d="trailing"in n?!!n.trailing:d);function f(T){var S=i,$=r;return i=r=void 0,l=T,a=e.apply($,S),a}function p(T){return l=T,o=setTimeout(v,t),u?f(T):a}function m(T){var S=T-c,$=T-l,D=t-S;return h?T$(D,s-$):D}function g(T){var S=T-c,$=T-l;return c===void 0||S>=t||S<0||h&&$>=s}function v(){var T=zl();if(g(T))return b(T);o=setTimeout(v,m(T))}function b(T){return o=void 0,d&&i?f(T):(i=r=void 0,a)}function w(){o!==void 0&&clearTimeout(o),l=0,i=c=r=o=void 0}function O(){return o===void 0?a:b(zl())}function _(){var T=zl(),S=g(T);if(i=arguments,r=this,c=T,S){if(o===void 0)return p(c);if(h)return clearTimeout(o),o=setTimeout(v,t),f(c)}return o===void 0&&(o=setTimeout(v,t)),a}return _.cancel=w,_.flush=O,_}let an=class{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}};const M$="DONT_STYLE_ME_css_styles_verifier";class R extends an{constructor(t,n){super(t,n),this.chartID=""}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=P(t));const i={width:0,height:0},r=d=>{d&&Object.keys(i).forEach(f=>{if(d[f]){const p=d[f],m=parseFloat(p);p&&m>i[f]&&(""+p).indexOf("%")===-1&&(i[f]=m)}})},s={width:t.attr("width"),height:t.attr("height")},a=t.node();let o,c,l,u;try{typeof a.getBBox=="function"&&(o=a.getBBox(),c={width:o.width,height:o.height})}catch(d){console.error(d)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(l=a.getBoundingClientRect(),u={width:l.width,height:l.height})}catch(d){console.error(d)}let h;if(a instanceof SVGSVGElement&&(h={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(r(s),i.width>0&&i.height>0))return i;if(n.useClientDimensions&&(r(h),i.width>0&&i.height>0))return h;if(n.useBBox&&(r(c),i.width>0&&i.height>0))return c;if(n.useBoundingRect&&(r(u),i.width>0&&i.height>0))return u}try{const d={width:E(t.node(),"width","baseVal","value"),height:E(t.node(),"height","baseVal","value")};r(d)}catch{r(h),r(c),r(s)}return i}static appendOrSelect(t,n){const i=t.select(`${n}`);if(i.empty()){let r=n.split("#"),s,a;return r.length===2?(s=r[0],r=r[1].split("."),a=r[0]):(r=n.split("."),s=r[0]),t.append(s).attr("id",a).attr("class",r.slice(1).join(" "))}return i}init(){this.styleHolderElement(),this.initializeID(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const t=this.model.getOptions(),n=E(t,"style","prefix"),i=P(this.getHolder()).append("div").classed(`${ne}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");i.append("g").attr("class",M$),this.mainContainer=i.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:n,height:i,theme:r}=this.model.getOptions();n!==this.width&&(t.style.width=n,this.width=n),i!==this.height&&(t.style.height=i,this.height=i),P(this.getHolder()).classed(`${ne}--chart-holder`,!0).attr("data-carbon-theme",r)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.getHolder(),i=P(n);i.classed("filled",!0),Vp.toJpeg(this.getMainContainer(),{bgcolor:typeof window<"u"?window.getComputedStyle(n).getPropertyValue("background-color"):void 0,quality:1,filter:r=>!(r.classList&&r.classList.contains("cds--cc--toolbar"))}).then(function(r){var s;(s=t.services.files)==null||s.downloadImage(r,"myChart.jpg"),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.getHolder(),i=P(n);i.classed("filled",!0),Vp.toPng(this.getMainContainer(),{bgcolor:typeof window<"u"?window.getComputedStyle(n).getPropertyValue("background-color"):void 0,quality:1,filter:r=>!(r.classList&&r.classList.contains("cds--cc--toolbar"))}).then(function(r){var s;(s=t.services.files)==null||s.downloadImage(r,"myChart.png"),i.classed("filled",!1)}).catch(function(r){console.error("oops, something went wrong!",r)})}toggleFullscreen(){const t=this.getHolder();P(t).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen&&t.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",()=>{const t=P(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=R.getSVGElementSize(P(this.mainContainer),{useBBox:!0}),n=P(this.mainContainer).attr("class"),i=P(this.mainContainer).selectAll(`.${n} > svg`);let r=0;i.nodes().forEach(function(s){r+=Number(R.getSVGElementSize(P(s),{useBBox:!0}).height)}),r<=t?P(this.mainContainer).attr("height",r):P(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&P(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(C.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(C.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,i=t.clientHeight;const r=va(()=>{var s;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(i-t.clientHeight)>1)&&(n=t.clientWidth,i=t.clientHeight,(s=this.services.events)==null||s.dispatchEvent(C.Chart.RESIZE))},12.5);new ResizeObserver(r).observe(t)}}let jl=class Xm extends an{static appendOrUpdateLinearGradient(t){let n=t.svg.select(`defs linearGradient#${t.id}`);n.empty()&&(n=t.svg.append("defs").append("linearGradient").attr("id",t.id).attr("x1",t.x1).attr("x2",t.x2).attr("y1",t.y1).attr("y2",t.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(t.stops).enter().append("stop").attr("offset",i=>i.offset).style("stop-color",i=>i.color).style("stop-opacity",i=>i.opacity)}static getOffsetRatio(t){return(Math.abs(t[1])*100/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(t,n){const i=t[0]<0&&t[1]>0;let r=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return i&&(r=[{offset:"0%",color:n,opacity:"0.6"},{offset:Xm.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),r}};function jp(e){const t=C$(Wp(e),360);return gn(t,[0,10])||gn(t,[350,0])?{textAnchor:Xe.START,dominantBaseline:Ze.MIDDLE}:gn(t,[10,80])?{textAnchor:Xe.START,dominantBaseline:Ze.HANGING}:gn(t,[80,100])?{textAnchor:Xe.MIDDLE,dominantBaseline:Ze.HANGING}:gn(t,[100,170])?{textAnchor:Xe.END,dominantBaseline:Ze.HANGING}:gn(t,[170,190])?{textAnchor:Xe.END,dominantBaseline:Ze.MIDDLE}:gn(t,[190,260])?{textAnchor:Xe.END,dominantBaseline:Ze.BASELINE}:gn(t,[260,280])?{textAnchor:Xe.MIDDLE,dominantBaseline:Ze.BASELINE}:{textAnchor:Xe.START,dominantBaseline:Ze.BASELINE}}function C$(e,t){return(e%t+t)%t}function gn(e,[t,n]){return e>=t&&e<=n}function Wp(e){return e*(180/Math.PI)}function kt(e,t,n={x:0,y:0}){const i=t*Math.cos(e)+n.x,r=t*Math.sin(e)+n.y;return{x:isNaN(i)?0:i,y:isNaN(r)?0:r}}function A$(e,t){return t*Math.sin(e-Math.PI/2)}function qp(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function $$(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function Wl(e,t){let n=0;if(t===void 0)for(let i of e)(i=+i)&&(n+=i);else{let i=-1;for(let r of e)(r=+t(r,++i,e))&&(n+=r)}return n}function L$(e){return e.depth}function D$(e,t){return t-1-e.height}function Yp(e,t){return e.sourceLinks.length?e.depth:t-1}function ya(e){return function(){return e}}function Xp(e,t){return xa(e.source,t.source)||e.index-t.index}function Zp(e,t){return xa(e.target,t.target)||e.index-t.index}function xa(e,t){return e.y0-t.y0}function ql(e){return e.value}function k$(e){return e.index}function R$(e){return e.nodes}function I$(e){return e.links}function Kp(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function Qp({nodes:e}){for(const t of e){let n=t.y0,i=n;for(const r of t.sourceLinks)r.y0=n+r.width/2,n+=r.width;for(const r of t.targetLinks)r.y1=i+r.width/2,i+=r.width}}function P$(){let e=0,t=0,n=1,i=1,r=24,s=8,a,o=k$,c=Yp,l,u,h=R$,d=I$,f=6;function p(){const y={nodes:h.apply(null,arguments),links:d.apply(null,arguments)};return m(y),g(y),v(y),b(y),_(y),Qp(y),y}p.update=function(y){return Qp(y),y},p.nodeId=function(y){return arguments.length?(o=typeof y=="function"?y:ya(y),p):o},p.nodeAlign=function(y){return arguments.length?(c=typeof y=="function"?y:ya(y),p):c},p.nodeSort=function(y){return arguments.length?(l=y,p):l},p.nodeWidth=function(y){return arguments.length?(r=+y,p):r},p.nodePadding=function(y){return arguments.length?(s=a=+y,p):s},p.nodes=function(y){return arguments.length?(h=typeof y=="function"?y:ya(y),p):h},p.links=function(y){return arguments.length?(d=typeof y=="function"?y:ya(y),p):d},p.linkSort=function(y){return arguments.length?(u=y,p):u},p.size=function(y){return arguments.length?(e=t=0,n=+y[0],i=+y[1],p):[n-e,i-t]},p.extent=function(y){return arguments.length?(e=+y[0][0],n=+y[1][0],t=+y[0][1],i=+y[1][1],p):[[e,t],[n,i]]},p.iterations=function(y){return arguments.length?(f=+y,p):f};function m({nodes:y,links:k}){for(const[U,N]of y.entries())N.index=U,N.sourceLinks=[],N.targetLinks=[];const I=new Map(y.map((U,N)=>[o(U,N,y),U]));for(const[U,N]of k.entries()){N.index=U;let{source:F,target:z}=N;typeof F!="object"&&(F=N.source=Kp(I,F)),typeof z!="object"&&(z=N.target=Kp(I,z)),F.sourceLinks.push(N),z.targetLinks.push(N)}if(u!=null)for(const{sourceLinks:U,targetLinks:N}of y)U.sort(u),N.sort(u)}function g({nodes:y}){for(const k of y)k.value=k.fixedValue===void 0?Math.max(Wl(k.sourceLinks,ql),Wl(k.targetLinks,ql)):k.fixedValue}function v({nodes:y}){const k=y.length;let I=new Set(y),U=new Set,N=0;for(;I.size;){for(const F of I){F.depth=N;for(const{target:z}of F.sourceLinks)U.add(z)}if(++N>k)throw new Error("circular link");I=U,U=new Set}}function b({nodes:y}){const k=y.length;let I=new Set(y),U=new Set,N=0;for(;I.size;){for(const F of I){F.height=N;for(const{source:z}of F.targetLinks)U.add(z)}if(++N>k)throw new Error("circular link");I=U,U=new Set}}function w({nodes:y}){const k=qp(y,N=>N.depth)+1,I=(n-e-r)/(k-1),U=new Array(k);for(const N of y){const F=Math.max(0,Math.min(k-1,Math.floor(c.call(null,N,k))));N.layer=F,N.x0=e+F*I,N.x1=N.x0+r,U[F]?U[F].push(N):U[F]=[N]}if(l)for(const N of U)N.sort(l);return U}function O(y){const k=$$(y,I=>(i-t-(I.length-1)*a)/Wl(I,ql));for(const I of y){let U=t;for(const N of I){N.y0=U,N.y1=U+N.value*k,U=N.y1+a;for(const F of N.sourceLinks)F.width=F.value*k}U=(i-U+a)/(I.length+1);for(let N=0;N<I.length;++N){const F=I[N];F.y0+=U*(N+1),F.y1+=U*(N+1)}B(I)}}function _(y){const k=w(y);a=Math.min(s,(i-t)/(qp(k,I=>I.length)-1)),O(k);for(let I=0;I<f;++I){const U=Math.pow(.99,I),N=Math.max(1-U,(I+1)/f);S(k,U,N),T(k,U,N)}}function T(y,k,I){for(let U=1,N=y.length;U<N;++U){const F=y[U];for(const z of F){let G=0,Q=0;for(const{source:X,value:ot}of z.targetLinks){let tt=ot*(z.layer-X.layer);G+=x(X,z)*tt,Q+=tt}if(!(Q>0))continue;let j=(G/Q-z.y0)*k;z.y0+=j,z.y1+=j,M(z)}l===void 0&&F.sort(xa),$(F,I)}}function S(y,k,I){for(let U=y.length,N=U-2;N>=0;--N){const F=y[N];for(const z of F){let G=0,Q=0;for(const{target:X,value:ot}of z.sourceLinks){let tt=ot*(X.layer-z.layer);G+=A(z,X)*tt,Q+=tt}if(!(Q>0))continue;let j=(G/Q-z.y0)*k;z.y0+=j,z.y1+=j,M(z)}l===void 0&&F.sort(xa),$(F,I)}}function $(y,k){const I=y.length>>1,U=y[I];L(y,U.y0-a,I-1,k),D(y,U.y1+a,I+1,k),L(y,i,y.length-1,k),D(y,t,0,k)}function D(y,k,I,U){for(;I<y.length;++I){const N=y[I],F=(k-N.y0)*U;F>1e-6&&(N.y0+=F,N.y1+=F),k=N.y1+a}}function L(y,k,I,U){for(;I>=0;--I){const N=y[I],F=(N.y1-k)*U;F>1e-6&&(N.y0-=F,N.y1-=F),k=N.y0-a}}function M({sourceLinks:y,targetLinks:k}){if(u===void 0){for(const{source:{sourceLinks:I}}of k)I.sort(Zp);for(const{target:{targetLinks:I}}of y)I.sort(Xp)}}function B(y){if(u===void 0)for(const{sourceLinks:k,targetLinks:I}of y)k.sort(Zp),I.sort(Xp)}function x(y,k){let I=y.y0-(y.sourceLinks.length-1)*a/2;for(const{target:U,width:N}of y.sourceLinks){if(U===k)break;I+=N+a}for(const{source:U,width:N}of k.targetLinks){if(U===y)break;I-=N}return I}function A(y,k){let I=k.y0-(k.targetLinks.length-1)*a/2;for(const{source:U,width:N}of k.targetLinks){if(U===y)break;I+=N+a}for(const{target:U,width:N}of y.sourceLinks){if(U===k)break;I-=N}return I}return p}var Yl=Math.PI,Xl=2*Yl,Fn=1e-6,N$=Xl-Fn;function Zl(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Jp(){return new Zl}Zl.prototype=Jp.prototype={constructor:Zl,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,i){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(e,t,n,i,r,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(e,t,n,i,r){e=+e,t=+t,n=+n,i=+i,r=+r;var s=this._x1,a=this._y1,o=n-e,c=i-t,l=s-e,u=a-t,h=l*l+u*u;if(r<0)throw new Error("negative radius: "+r);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>Fn)if(!(Math.abs(u*o-c*l)>Fn)||!r)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var d=n-s,f=i-a,p=o*o+c*c,m=d*d+f*f,g=Math.sqrt(p),v=Math.sqrt(h),b=r*Math.tan((Yl-Math.acos((p+h-m)/(2*g*v)))/2),w=b/v,O=b/g;Math.abs(w-1)>Fn&&(this._+="L"+(e+w*l)+","+(t+w*u)),this._+="A"+r+","+r+",0,0,"+ +(u*d>l*f)+","+(this._x1=e+O*o)+","+(this._y1=t+O*c)}},arc:function(e,t,n,i,r,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(i),o=n*Math.sin(i),c=e+a,l=t+o,u=1^s,h=s?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+c+","+l:(Math.abs(this._x1-c)>Fn||Math.abs(this._y1-l)>Fn)&&(this._+="L"+c+","+l),n&&(h<0&&(h=h%Xl+Xl),h>N$?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=c)+","+(this._y1=l):h>Fn&&(this._+="A"+n+","+n+",0,"+ +(h>=Yl)+","+u+","+(this._x1=e+n*Math.cos(r))+","+(this._y1=t+n*Math.sin(r))))},rect:function(e,t,n,i){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};function tg(e){return function(){return e}}function U$(e){return e[0]}function B$(e){return e[1]}var H$=Array.prototype.slice;function V$(e){return e.source}function G$(e){return e.target}function F$(e){var t=V$,n=G$,i=U$,r=B$,s=null;function a(){var o,c=H$.call(arguments),l=t.apply(this,c),u=n.apply(this,c);if(s||(s=o=Jp()),e(s,+i.apply(this,(c[0]=l,c)),+r.apply(this,c),+i.apply(this,(c[0]=u,c)),+r.apply(this,c)),o)return s=null,o+""||null}return a.source=function(o){return arguments.length?(t=o,a):t},a.target=function(o){return arguments.length?(n=o,a):n},a.x=function(o){return arguments.length?(i=typeof o=="function"?o:tg(+o),a):i},a.y=function(o){return arguments.length?(r=typeof o=="function"?o:tg(+o),a):r},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function z$(e,t,n,i,r){e.moveTo(t,n),e.bezierCurveTo(t=(t+i)/2,n,t,r,i,r)}function j$(){return F$(z$)}function W$(e){return[e.source.x1,e.y0]}function q$(e){return[e.target.x0,e.y1]}function Y$(){return j$().source(W$).target(q$)}function X$(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Z$(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function i(){if(this instanceof i){var r=[null];r.push.apply(r,arguments);var s=Function.bind.apply(t,r);return new s}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return e[i]}})}),n}var K$={value:function(){}};function eg(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new ba(n)}function ba(e){this._=e}function Q$(e,t){return e.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&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}ba.prototype=eg.prototype={constructor:ba,on:function(e,t){var n=this._,i=Q$(e+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((r=(e=i[s]).type)&&(r=J$(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(r=(e=i[s]).type)n[r]=ng(n[r],e.name,t);else if(t==null)for(r in n)n[r]=ng(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ba(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)}};function J$(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function ng(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=K$,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var tL=Z$(Object.freeze(Object.defineProperty({__proto__:null,dispatch:eg},Symbol.toStringTag,{value:"Module"}))).dispatch,Kl=Math.PI/180,Dr=64,wa=2048,eL=function(){var e=[256,256],t=nL,n=iL,i=rL,r=ig,s=ig,a=sL,o=aL,c=rg,l=[],u=1/0,h=tL("word","end"),d=null,f=Math.random,p={},m=fL;p.canvas=function(b){return arguments.length?(m=mn(b),p):m},p.start=function(){var b=g(m()),w=dL((e[0]>>5)*e[1]),O=null,_=l.length,T=-1,S=[],$=l.map(function(L,M){return L.text=t.call(this,L,M),L.font=n.call(this,L,M),L.style=r.call(this,L,M),L.weight=s.call(this,L,M),L.rotate=a.call(this,L,M),L.size=~~i.call(this,L,M),L.padding=o.call(this,L,M),L}).sort(function(L,M){return M.size-L.size});return d&&clearInterval(d),d=setInterval(D,0),D(),p;function D(){for(var L=Date.now();Date.now()-L<u&&++T<_&&d;){var M=$[T];M.x=e[0]*(f()+.5)>>1,M.y=e[1]*(f()+.5)>>1,oL(b,M,$,T),M.hasText&&v(w,M,O)&&(S.push(M),h.call("word",p,M),O?cL(O,M):O=[{x:M.x+M.x0,y:M.y+M.y0},{x:M.x+M.x1,y:M.y+M.y1}],M.x-=e[0]>>1,M.y-=e[1]>>1)}T>=_&&(p.stop(),h.call("end",p,S,O))}},p.stop=function(){return d&&(clearInterval(d),d=null),p};function g(b){b.width=b.height=1;var w=Math.sqrt(b.getContext("2d").getImageData(0,0,1,1).data.length>>2);b.width=(Dr<<5)/w,b.height=wa/w;var O=b.getContext("2d");return O.fillStyle=O.strokeStyle="red",O.textAlign="center",{context:O,ratio:w}}function v(b,w,O){e[0],e[1];for(var _=w.x,T=w.y,S=Math.sqrt(e[0]*e[0]+e[1]*e[1]),$=c(e),D=f()<.5?1:-1,L=-D,M,B,x;(M=$(L+=D))&&(B=~~M[0],x=~~M[1],!(Math.min(Math.abs(B),Math.abs(x))>=S));)if(w.x=_+B,w.y=T+x,!(w.x+w.x0<0||w.y+w.y0<0||w.x+w.x1>e[0]||w.y+w.y1>e[1])&&(!O||!lL(w,b,e[0]))&&(!O||uL(w,O))){for(var A=w.sprite,y=w.width>>5,k=e[0]>>5,I=w.x-(y<<4),U=I&127,N=32-U,F=w.y1-w.y0,z=(w.y+w.y0)*k+(I>>5),G,Q=0;Q<F;Q++){G=0;for(var j=0;j<=y;j++)b[z+j]|=G<<N|(j<y?(G=A[Q*y+j])>>>U:0);z+=k}return delete w.sprite,!0}return!1}return p.timeInterval=function(b){return arguments.length?(u=b??1/0,p):u},p.words=function(b){return arguments.length?(l=b,p):l},p.size=function(b){return arguments.length?(e=[+b[0],+b[1]],p):e},p.font=function(b){return arguments.length?(n=mn(b),p):n},p.fontStyle=function(b){return arguments.length?(r=mn(b),p):r},p.fontWeight=function(b){return arguments.length?(s=mn(b),p):s},p.rotate=function(b){return arguments.length?(a=mn(b),p):a},p.text=function(b){return arguments.length?(t=mn(b),p):t},p.spiral=function(b){return arguments.length?(c=pL[b]||b,p):c},p.fontSize=function(b){return arguments.length?(i=mn(b),p):i},p.padding=function(b){return arguments.length?(o=mn(b),p):o},p.random=function(b){return arguments.length?(f=b,p):f},p.on=function(){var b=h.on.apply(h,arguments);return b===h?p:b},p};function nL(e){return e.text}function iL(){return"serif"}function ig(){return"normal"}function rL(e){return Math.sqrt(e.value)}function sL(){return(~~(Math.random()*6)-3)*30}function aL(){return 1}function oL(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(Dr<<5)/s,wa/s);var a=0,o=0,c=0,l=n.length;for(--i;++i<l;){t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font;var u=r.measureText(t.text+"m").width*s,h=t.size<<1;if(t.rotate){var d=Math.sin(t.rotate*Kl),f=Math.cos(t.rotate*Kl),p=u*f,m=u*d,g=h*f,v=h*d;u=Math.max(Math.abs(p+v),Math.abs(p-v))+31>>5<<5,h=~~Math.max(Math.abs(m+g),Math.abs(m-g))}else u=u+31>>5<<5;if(h>c&&(c=h),a+u>=Dr<<5&&(a=0,o+=c,c=0),o+h>=wa)break;r.translate((a+(u>>1))/s,(o+(h>>1))/s),t.rotate&&r.rotate(t.rotate*Kl),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=u,t.height=h,t.xoff=a,t.yoff=o,t.x1=u>>1,t.y1=h>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=u}for(var b=r.getImageData(0,0,(Dr<<5)/s,wa/s).data,w=[];--i>=0;)if(t=n[i],!!t.hasText){for(var u=t.width,O=u>>5,h=t.y1-t.y0,_=0;_<h*O;_++)w[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var T=0,S=-1,$=0;$<h;$++){for(var _=0;_<u;_++){var D=O*$+(_>>5),L=b[(o+$)*(Dr<<5)+(a+_)<<2]?1<<31-_%32:0;w[D]|=L,T|=L}T?S=$:(t.y0++,h--,$--,o++)}t.y1=t.y0+S,t.sprite=w.slice(0,(t.y1-t.y0)*O)}}}function lL(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,s=e.x-(r<<4),a=s&127,o=32-a,c=e.y1-e.y0,l=(e.y+e.y0)*n+(s>>5),u,h=0;h<c;h++){u=0;for(var d=0;d<=r;d++)if((u<<o|(d<r?(u=i[h*r+d])>>>a:0))&t[l+d])return!0;l+=n}return!1}function cL(e,t){var n=e[0],i=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function uL(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function rg(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function hL(e){var t=4,n=t*e[0]/e[1],i=0,r=0;return function(s){var a=s<0?-1:1;switch(Math.sqrt(1+4*a*s)-a&3){case 0:i+=n;break;case 1:r+=t;break;case 2:i-=n;break;default:r-=t;break}return[i,r]}}function dL(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function fL(){return document.createElement("canvas")}function mn(e){return typeof e=="function"?e:function(){return e}}var pL={archimedean:rg,rectangular:hL};const gL=X$(eL);function mL(e,t,n,i){var r=-1,s=e==null?0:e.length;for(i&&s&&(n=e[++r]);++r<s;)n=t(n,e[r],r,e);return n}function vL(e){return function(t){return e==null?void 0:e[t]}}var yL={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},xL=vL(yL);const bL=xL;var wL=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,EL="\\u0300-\\u036f",_L="\\ufe20-\\ufe2f",SL="\\u20d0-\\u20ff",OL=EL+_L+SL,TL="["+OL+"]",ML=RegExp(TL,"g");function CL(e){return e=Sr(e),e&&e.replace(wL,bL).replace(ML,"")}var AL=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function $L(e){return e.match(AL)||[]}var LL=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function DL(e){return LL.test(e)}var sg="\\ud800-\\udfff",kL="\\u0300-\\u036f",RL="\\ufe20-\\ufe2f",IL="\\u20d0-\\u20ff",PL=kL+RL+IL,ag="\\u2700-\\u27bf",og="a-z\\xdf-\\xf6\\xf8-\\xff",NL="\\xac\\xb1\\xd7\\xf7",UL="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",BL="\\u2000-\\u206f",HL=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",lg="A-Z\\xc0-\\xd6\\xd8-\\xde",VL="\\ufe0e\\ufe0f",cg=NL+UL+BL+HL,ug="['’]",hg="["+cg+"]",GL="["+PL+"]",dg="\\d+",FL="["+ag+"]",fg="["+og+"]",pg="[^"+sg+cg+dg+ag+og+lg+"]",zL="\\ud83c[\\udffb-\\udfff]",jL="(?:"+GL+"|"+zL+")",WL="[^"+sg+"]",gg="(?:\\ud83c[\\udde6-\\uddff]){2}",mg="[\\ud800-\\udbff][\\udc00-\\udfff]",_i="["+lg+"]",qL="\\u200d",vg="(?:"+fg+"|"+pg+")",YL="(?:"+_i+"|"+pg+")",yg="(?:"+ug+"(?:d|ll|m|re|s|t|ve))?",xg="(?:"+ug+"(?:D|LL|M|RE|S|T|VE))?",bg=jL+"?",wg="["+VL+"]?",XL="(?:"+qL+"(?:"+[WL,gg,mg].join("|")+")"+wg+bg+")*",ZL="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",KL="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",QL=wg+bg+XL,JL="(?:"+[FL,gg,mg].join("|")+")"+QL,tD=RegExp([_i+"?"+fg+"+"+yg+"(?="+[hg,_i,"$"].join("|")+")",YL+"+"+xg+"(?="+[hg,_i+vg,"$"].join("|")+")",_i+"?"+vg+"+"+yg,_i+"+"+xg,KL,ZL,dg,JL].join("|"),"g");function eD(e){return e.match(tD)||[]}function nD(e,t,n){return e=Sr(e),t=n?void 0:t,t===void 0?DL(e)?eD(e):$L(e):e.match(t)||[]}var iD="['’]",rD=RegExp(iD,"g");function Eg(e){return function(t){return mL(nD(CL(t).replace(rD,"")),e,"")}}function sD(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function _g(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Lr(n),n=n===n?n:0),t!==void 0&&(t=Lr(t),t=t===t?t:0),sD(Lr(e),t,n)}function aD(e,t){var n=-1,i=Un(e)?Array(e.length):[];return Fl(e,function(r,s,a){i[++n]=t(r,s,a)}),i}function oD(e,t){var n=Ft(e)?wf:aD;return n(e,fa(t))}var lD=1/0;function cD(e,t){return la(oD(e,t),lD)}function Sg(e,t){return da(e,t)}var uD=Eg(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Si=uD;function hD(e,t){var n;return Fl(e,function(i,r,s){return n=t(i,r,s),!n}),!!n}function dD(e,t,n){var i=Ft(e)?gp:hD;return n&&Lf(e,t,n)&&(t=void 0),i(e,fa(t))}class ht{constructor(t,n,i){if(this.type="",this.renderType=K.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,i&&(this.configs=i,this.configs.id)){const r=E(this.model.getOptions(),"style","prefix");this.id=`${r}--${this.configs.id}`}this.parent||this.setParent(P(this.services.domUtils.getMainContainer()))}init(){}render(t=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(t){this.model=t}setServices(t){this.services=t}setParent(t){var n;const i=this.parent;if(this.parent=t,!(i&&i.node()===t.node())&&this.type){const r=E(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${ne}--${r}--${this.type}`,!0),i&&i.classed(`${ne}--${r}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={withinChartClip:!1}){if(this.type){const n=E(this.model.getOptions(),"style","prefix"),i=this.id?`#${this.id}`:"",r=R.appendOrSelect(this.parent,`${this.renderType===K.SVG?"svg":"div"}${i}.${ne}--${n}--${this.type}`);if(t.withinChartClip){const s=this.model.get("chartClipId");if(s){const a=P(`#${s}`).select("rect");a.size()!==0&&parseFloat(a.attr("height"))>0&&r.attr("clip-path",`url(#${s})`)}}return r.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?nt({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const Og=class extends ht{constructor(){super(...arguments),this.type="toolbar",this.renderType=K.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(C.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(C.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer().attr("role","toolbar").attr("aria-label",`chart-${this.services.domUtils.getChartID()} toolbar`);if(E(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("<ul role='menu'></ul>"));const{buttonList:i,overflowMenuItemList:r}=this.getControlConfigs();r&&i.push(this.getOverflowButtonConfig());const s=n.selectAll("div.toolbar-control").data(i,c=>c.id);s.exit().remove();const a=s.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu").attr("role","button"),o=this;a.merge(s).classed("disabled",c=>c.shouldBeDisabled()).attr("aria-disabled",c=>c.shouldBeDisabled()).attr("aria-label",c=>c.title).html(c=>`
4
4
  <button
5
5
  class="cds--overflow-menu__trigger cds--overflow-menu__trigger"
6
6
  aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${c.id}`)}" aria-label="${c.title}">
7
7
  <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" class="cds--overflow-menu__icon cds--overflow-menu__icon" viewBox="0 0 32 32" aria-hidden="true">
8
8
  ${c.iconSVG.content}
9
9
  </svg>
10
- </button>`).each(function(c,l){P(this).select("svg").style("will-change","transform").style("width",c.iconSVG.width!==void 0?c.iconSVG.width:"20px").style("height",c.iconSVG.height!==void 0?c.iconSVG.height:"20px"),P(this).select("button").on("click",u=>{c.shouldBeDisabled()||o.triggerFunctionAndEvent(c,u,this)}).on("keydown",u=>{u.key&&u.key==="Enter"||u.key===" "?(u.preventDefault(),o.triggerFunctionAndEvent(c,u,this)):u.key&&u.key==="ArrowLeft"?o.focusOnPreviousEnabledToolbarItem(l):u.key&&u.key==="ArrowRight"&&o.focusOnNextEnabledToolbarItem(l)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,r=>E(r,"id"));n.exit().remove();const i=n.enter().append("li").attr("id",r=>this.services.domUtils.generateElementIDString(`control-${r.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);i.append("button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),i.merge(n).classed("cds--overflow-menu-options__option--disabled",r=>r.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",r=>r.shouldBeDisabled()).attr("aria-disabled",r=>r.shouldBeDisabled()).selectAll("button").text(r=>r.text)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),P(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(C.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(C.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let i=n.length;for(let r=t-1;r>=0;r--)if(!n[r].shouldBeDisabled()){i=r;break}if(i<n.length){const r=P(`button#${this.services.domUtils.generateElementIDString(`control-${n[i].id}`)}`).node();"focus"in r&&r.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let i=-1;for(let r=t+1;r<n.length;r++)if(!n[r].shouldBeDisabled()){i=r;break}if(i>-1){const r=P(`button#${this.services.domUtils.generateElementIDString(`control-${n[i].id}`)}`).node();"focus"in r&&r.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let i=n.length;for(let r=t-1;r>=0;r--)if(!n[r].shouldBeDisabled()){i=r;break}if(i<n.length){const r=P(`#${this.services.domUtils.generateElementIDString(`control-${n[i].id}`)} button`).node();"focus"in r&&r.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let i=-1;for(let r=t+1;r<n.length;r++)if(!n[r].shouldBeDisabled()){i=r;break}if(i>-1){const r=P(`#${this.services.domUtils.generateElementIDString(`control-${n[i].id}`)} button`).node();"focus"in r&&r.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((i,r)=>{const s=P(`#${this.services.domUtils.generateElementIDString(`control-${i.id}`)}`);s!==null&&(s.on("click",()=>{n.triggerFunctionAndEvent(i,t,s.node()),n.updateOverflowMenu(!1)}),s.on("keydown",a=>{a&&a.key==="Enter"?n.triggerFunctionAndEvent(i,t,s.node()):a&&a.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(r):a&&a.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(r):a&&a.key==="Escape"&&n.updateOverflowMenu(!1),a.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,i){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(C.Toolbar.BUTTON_CLICK,{control:t,event:n,element:i}))}getControlConfigs(){const t=E(this.getOptions(),"toolbar","numberOfIcons")-1,n=E(this.getOptions(),"toolbar","controls"),i=[],r=[],s=[];return n.forEach(a=>{let o=null;a.type===$t.CUSTOM?(E(a,"id")===null&&(a.id=`toolbar-button-${Lg.buttonID++}`),E(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a):o=this.getControlConfigByType(a.type),o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?i.push(o):r.length<t?E(o,"iconSVG","content")===null?s.push(o):r.push(o):s.push(o))}),s.push(...i),s.length?{buttonList:r,overflowMenuItemList:s}:{buttonList:r}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){return{id:"toolbar-overflow-menu",title:"More options",shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
10
+ </button>`).each(function(c,l){P(this).select("svg").style("will-change","transform").style("width",c.iconSVG.width!==void 0?c.iconSVG.width:"20px").style("height",c.iconSVG.height!==void 0?c.iconSVG.height:"20px"),P(this).select("button").on("click",u=>{c.shouldBeDisabled()||o.triggerFunctionAndEvent(c,u,this)}).on("keydown",u=>{u.key&&u.key==="Enter"||u.key===" "?(u.preventDefault(),o.triggerFunctionAndEvent(c,u,this)):u.key&&u.key==="ArrowLeft"?o.focusOnPreviousEnabledToolbarItem(l):u.key&&u.key==="ArrowRight"&&o.focusOnNextEnabledToolbarItem(l)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,r=>E(r,"id"));n.exit().remove();const i=n.enter().append("li").attr("id",r=>this.services.domUtils.generateElementIDString(`control-${r.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);i.append("button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),i.merge(n).classed("cds--overflow-menu-options__option--disabled",r=>r.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",r=>r.shouldBeDisabled()).attr("aria-disabled",r=>r.shouldBeDisabled()).selectAll("button").text(r=>r.text)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),P(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(C.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(C.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let i=n.length;for(let r=t-1;r>=0;r--)if(!n[r].shouldBeDisabled()){i=r;break}if(i<n.length){const r=P(`button#${this.services.domUtils.generateElementIDString(`control-${n[i].id}`)}`).node();"focus"in r&&r.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let i=-1;for(let r=t+1;r<n.length;r++)if(!n[r].shouldBeDisabled()){i=r;break}if(i>-1){const r=P(`button#${this.services.domUtils.generateElementIDString(`control-${n[i].id}`)}`).node();"focus"in r&&r.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let i=n.length;for(let r=t-1;r>=0;r--)if(!n[r].shouldBeDisabled()){i=r;break}if(i<n.length){const r=P(`#${this.services.domUtils.generateElementIDString(`control-${n[i].id}`)} button`).node();"focus"in r&&r.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let i=-1;for(let r=t+1;r<n.length;r++)if(!n[r].shouldBeDisabled()){i=r;break}if(i>-1){const r=P(`#${this.services.domUtils.generateElementIDString(`control-${n[i].id}`)} button`).node();"focus"in r&&r.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((i,r)=>{const s=P(`#${this.services.domUtils.generateElementIDString(`control-${i.id}`)}`);s!==null&&(s.on("click",()=>{n.triggerFunctionAndEvent(i,t,s.node()),n.updateOverflowMenu(!1)}),s.on("keydown",a=>{a&&a.key==="Enter"?n.triggerFunctionAndEvent(i,t,s.node()):a&&a.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(r):a&&a.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(r):a&&a.key==="Escape"&&n.updateOverflowMenu(!1),a.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,i){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(C.Toolbar.BUTTON_CLICK,{control:t,event:n,element:i}))}getControlConfigs(){const t=E(this.getOptions(),"toolbar","numberOfIcons")-1,n=E(this.getOptions(),"toolbar","controls"),i=[],r=[],s=[];return n.forEach(a=>{let o=null;a.type===$t.CUSTOM?(E(a,"id")===null&&(a.id=`toolbar-button-${Og.buttonID++}`),E(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a):o=this.getControlConfigByType(a.type),o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?i.push(o):r.length<t?E(o,"iconSVG","content")===null?s.push(o):r.push(o):s.push(o))}),s.push(...i),s.length?{buttonList:r,overflowMenuItemList:s}:{buttonList:r}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){return{id:"toolbar-overflow-menu",title:"More options",shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
11
11
  <circle cx="16" cy="16" r="2"></circle>
12
12
  <circle cx="16" cy="24" r="2"></circle>`},clickFunction:t=>this.toggleOverflowMenu(t)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),i=this.model.getDisplayData();let r;switch(t){case $t.ZOOM_IN:n&&(r={id:"toolbar-zoomIn",title:"Zoom in",shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case $t.ZOOM_OUT:n&&(r={id:"toolbar-zoomOut",title:"Zoom out",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case $t.RESET_ZOOM:n&&(r={id:"toolbar-resetZoom",title:"Reset zoom",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case $t.MAKE_FULLSCREEN:r={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:"Make fullscreen",shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case $t.SHOW_AS_DATATABLE:r={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:"Show as table",shouldBeDisabled:()=>i.length===0,clickFunction:()=>this.services.events.dispatchEvent(C.Modal.SHOW)};break;case $t.EXPORT_CSV:r={id:"toolbar-export-CSV",title:"Export as CSV",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case $t.EXPORT_PNG:r={id:"toolbar-export-PNG",title:"Export as PNG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case $t.EXPORT_JPG:r={id:"toolbar-export-JPG",title:"Export as JPG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return r}getControlIconByType(t){switch(t){case $t.ZOOM_IN:return`<polygon points="19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13"/>
13
13
  <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case $t.ZOOM_OUT:return`<rect x="9" y="13" width="10" height="2"/>
14
- <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case $t.RESET_ZOOM:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case $t.MAKE_FULLSCREEN:return'<polygon points="21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2"/><polygon points="15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42"/>';case $t.SHOW_AS_DATATABLE:return'<rect x="4" y="6" width="18" height="2"/><rect x="4" y="12" width="18" height="2"/><rect x="4" y="18" width="18" height="2"/><rect x="4" y="24" width="18" height="2"/><rect x="26" y="6" width="2" height="2"/><rect x="26" y="12" width="2" height="2"/><rect x="26" y="18" width="2" height="2"/><rect x="26" y="24" width="2" height="2"/>';case $t.EXPORT_CSV:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case $t.EXPORT_JPG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case $t.EXPORT_PNG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';default:throw Error("Not supported toolbar control type: "+t)}}};let Rr=Lg;Rr.buttonID=0;const Dg=class extends ht{constructor(t,n,i,r){super(t,n,r),this.type="layout",this.configs=r,this.children=i,this._instanceID=Dg.instanceID++,this.init()}init(){this.children.forEach(t=>{t.components.forEach(n=>{n.init()})})}getPreferedAndFixedSizeSum(){const t=this.parent;let n=0;return t.selectAll(`div.layout-child-${this._instanceID}`).filter(i=>{const r=E(i,"growth");return r===it.PREFERRED||r===it.FIXED}).each(function(i){n+=i.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>E(t,"growth")===it.STRETCH).size()}render(t=!0){const n=this.parent,{width:i,height:r}=I.getHTMLElementSize(n.node()),s=this.configs.direction===_t.ROW||this.configs.direction===_t.ROW_REVERSE,a=E(this.model.getOptions(),"style","prefix"),o=n.classed(`${Qt}--${a}--layout-row`,this.configs.direction===_t.ROW).classed(`${Qt}--${a}--layout-row-reverse`,this.configs.direction===_t.ROW_REVERSE).classed(`${Qt}--${a}--layout-column`,this.configs.direction===_t.COLUMN).classed(`${Qt}--${a}--layout-column-reverse`,this.configs.direction===_t.COLUMN_REVERSE).classed(`${Qt}--${a}--layout-alignitems-center`,this.configs.alignItems===hi.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,l=>l.id);o.enter().append("div").merge(n.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",l=>`layout-child layout-child-${this._instanceID} ${l.id}`).each(function(l){l.components.forEach(u=>{const h=P(this),d=E(l,"renderType")===K.SVG;u.setParent(d?I.appendOrSelect(h,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):h);const f=E(l,"growth");(f===it.PREFERRED||f===it.FIXED)&&u.render(t)})}),n.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(l){const u=E(l,"growth"),h=E(l,"renderType")===K.SVG?I.getSVGElementSize(P(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):I.getHTMLElementSize(this);if(u===it.PREFERRED){const d=s?h.width:h.height,f=s?i:r;l.size=d/f*100}}),o.exit().remove(),this.children.filter(l=>E(l,"growth")===it.STRETCH).forEach(l=>{l.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const c=n.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,l=>l.id);s?c.style("width",l=>`${l.size/100*i}px`).style("height","100%"):c.style("height",l=>`${l.size/100*r}px`).style("width","100%"),c.each(function(l){l.components.forEach(u=>{E(l,"growth")===it.STRETCH&&u.render(t)})})}setModel(t){super.setModel(t),this.children.forEach(n=>{n.components.forEach(i=>i.setModel(t))})}setServices(t){super.setServices(t),this.children.forEach(n=>{n.components.forEach(i=>i.setServices(t))})}destroy(){this.children.forEach(t=>{t.components.forEach(n=>n.destroy())})}};let re=Dg;re.instanceID=Math.floor(Math.random()*99999999999);class on extends ht{constructor(){super(...arguments),this.type="spacer"}render(t=!0){this.getComponentContainer().style("width",`${this.configs.size||yl.default.size}px`).style("height",`${this.configs.size||yl.default.size}px`).attr("opacity",0)}}var gD={prefix:"bx",selectorTabbable:`
14
+ <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case $t.RESET_ZOOM:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case $t.MAKE_FULLSCREEN:return'<polygon points="21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2"/><polygon points="15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42"/>';case $t.SHOW_AS_DATATABLE:return'<rect x="4" y="6" width="18" height="2"/><rect x="4" y="12" width="18" height="2"/><rect x="4" y="18" width="18" height="2"/><rect x="4" y="24" width="18" height="2"/><rect x="26" y="6" width="2" height="2"/><rect x="26" y="12" width="2" height="2"/><rect x="26" y="18" width="2" height="2"/><rect x="26" y="24" width="2" height="2"/>';case $t.EXPORT_CSV:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case $t.EXPORT_JPG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case $t.EXPORT_PNG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';default:throw Error("Not supported toolbar control type: "+t)}}};let kr=Og;kr.buttonID=0;const Tg=class extends ht{constructor(t,n,i,r){super(t,n,r),this.type="layout",this.configs=r,this.children=i,this._instanceID=Tg.instanceID++,this.init()}init(){this.children.forEach(t=>{t.components.forEach(n=>{n.init()})})}getPreferedAndFixedSizeSum(){const t=this.parent;let n=0;return t.selectAll(`div.layout-child-${this._instanceID}`).filter(i=>{const r=E(i,"growth");return r===it.PREFERRED||r===it.FIXED}).each(function(i){n+=i.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>E(t,"growth")===it.STRETCH).size()}render(t=!0){const n=this.parent,{width:i,height:r}=R.getHTMLElementSize(n.node()),s=this.configs.direction===Et.ROW||this.configs.direction===Et.ROW_REVERSE,a=E(this.model.getOptions(),"style","prefix"),o=n.classed(`${ne}--${a}--layout-row`,this.configs.direction===Et.ROW).classed(`${ne}--${a}--layout-row-reverse`,this.configs.direction===Et.ROW_REVERSE).classed(`${ne}--${a}--layout-column`,this.configs.direction===Et.COLUMN).classed(`${ne}--${a}--layout-column-reverse`,this.configs.direction===Et.COLUMN_REVERSE).classed(`${ne}--${a}--layout-alignitems-center`,this.configs.alignItems===hi.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,l=>l.id);o.enter().append("div").merge(n.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",l=>`layout-child layout-child-${this._instanceID} ${l.id}`).each(function(l){l.components.forEach(u=>{const h=P(this),d=E(l,"renderType")===K.SVG;u.setParent(d?R.appendOrSelect(h,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):h);const f=E(l,"growth");(f===it.PREFERRED||f===it.FIXED)&&u.render(t)})}),n.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(l){const u=E(l,"growth"),h=E(l,"renderType")===K.SVG?R.getSVGElementSize(P(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):R.getHTMLElementSize(this);if(u===it.PREFERRED){const d=s?h.width:h.height,f=s?i:r;l.size=d/f*100}}),o.exit().remove(),this.children.filter(l=>E(l,"growth")===it.STRETCH).forEach(l=>{l.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const c=n.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,l=>l.id);s?c.style("width",l=>`${l.size/100*i}px`).style("height","100%"):c.style("height",l=>`${l.size/100*r}px`).style("width","100%"),c.each(function(l){l.components.forEach(u=>{E(l,"growth")===it.STRETCH&&u.render(t)})})}setModel(t){super.setModel(t),this.children.forEach(n=>{n.components.forEach(i=>i.setModel(t))})}setServices(t){super.setServices(t),this.children.forEach(n=>{n.components.forEach(i=>i.setServices(t))})}destroy(){this.children.forEach(t=>{t.components.forEach(n=>n.destroy())})}};let ie=Tg;ie.instanceID=Math.floor(Math.random()*99999999999);class on extends ht{constructor(){super(...arguments),this.type="spacer"}render(t=!0){this.getComponentContainer().style("width",`${this.configs.size||mf.default.size}px`).style("height",`${this.configs.size||mf.default.size}px`).attr("opacity",0)}}var fD={prefix:"bx",selectorTabbable:`
15
15
  a[href], area[href], input:not([disabled]):not([tabindex='-1']),
16
16
  button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']),
17
17
  textarea:not([disabled]):not([tabindex='-1']),
@@ -21,9 +21,9 @@
21
21
  button:not([disabled]),select:not([disabled]),
22
22
  textarea:not([disabled]),
23
23
  iframe, object, embed, *[tabindex], *[contenteditable=true]
24
- `},ic=gD;function kg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function mD(e,t,n){return t&&kg(e.prototype,t),n&&kg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function vD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yD(e){return ED(e)||wD(e)||bD(e)||xD()}function xD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
25
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bD(e,t){if(e){if(typeof e=="string")return rc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rc(e,t)}}function wD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ED(e){if(Array.isArray(e))return rc(e)}function rc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Rg(e){return e.reduce(function(t,n){return Array.isArray(n)?t.push.apply(t,yD(Rg(n))):t.push(n),t},[])}function _D(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Rg(t).reduce(function(i,r){return r(i)},function(){function i(){vD(this,i)}return mD(i)}())}function sc(e){"@babel/helpers - typeof";return sc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sc(e)}function SD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ig(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function OD(e,t,n){return t&&Ig(e.prototype,t),n&&Ig(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function TD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ac(e,t)}function ac(e,t){return ac=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ac(e,t)}function MD(e){var t=AD();return function(){var n=Ea(e),i;if(t){var r=Ea(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return CD(this,i)}}function CD(e,t){if(t&&(sc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pg(e)}function Pg(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ea(e){return Ea=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ea(e)}function $D(e){var t=function(n){TD(r,n);var i=MD(r);function r(s){var a,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(SD(this,r),a=i.call(this,s,o),a.children=[],!s||s.nodeType!==Node.ELEMENT_NODE)throw new TypeError("DOM element should be given to initialize this widget.");return a.element=s,a.options=Object.assign(Object.create(a.constructor.options),o),a.constructor.components.set(a.element,Pg(a)),a}return OD(r,[{key:"release",value:function(){for(var s=this.children.pop();s;s=this.children.pop())s.release();return this.constructor.components.delete(this.element),null}}],[{key:"create",value:function(s,a){return this.components.get(s)||new this(s,a)}}]),r}(e);return t}function oc(e){"@babel/helpers - typeof";return oc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oc(e)}function LD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ng(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function DD(e,t,n){return t&&Ng(e.prototype,t),n&&Ng(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _a(){return typeof Reflect<"u"&&Reflect.get?_a=Reflect.get:_a=function(e,t,n){var i=kD(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},_a.apply(this,arguments)}function kD(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Oi(e),e!==null););return e}function RD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lc(e,t)}function lc(e,t){return lc=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},lc(e,t)}function ID(e){var t=UD();return function(){var n=Oi(e),i;if(t){var r=Oi(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return PD(this,i)}}function PD(e,t){if(t&&(oc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ND(e)}function ND(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Oi(e){return Oi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Oi(e)}function BD(e){var t=function(n){RD(r,n);var i=ID(r);function r(){var s;LD(this,r);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return s=i.call.apply(i,[this].concat(o)),s.handles=new Set,s}return DD(r,[{key:"manage",value:function(s){return this.handles.add(s),s}},{key:"unmanage",value:function(s){return this.handles.delete(s),s}},{key:"release",value:function(){var s=this;return this.handles.forEach(function(a){a.release(),s.handles.delete(a)}),_a(Oi(r.prototype),"release",this).call(this)}}]),r}(e);return t}function Ir(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return e.addEventListener.apply(e,n),{release:function(){return e.removeEventListener.apply(e,n),null}}}function cc(e){"@babel/helpers - typeof";return cc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cc(e)}function HD(e){return zD(e)||FD(e)||GD(e)||VD()}function VD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
26
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GD(e,t){if(e){if(typeof e=="string")return uc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uc(e,t)}}function FD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zD(e){if(Array.isArray(e))return uc(e)}function uc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function jD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ug(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function WD(e,t,n){return t&&Ug(e.prototype,t),n&&Ug(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hc(e,t)}function hc(e,t){return hc=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},hc(e,t)}function YD(e){var t=KD();return function(){var n=Sa(e),i;if(t){var r=Sa(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return XD(this,i)}}function XD(e,t){if(t&&(cc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ZD(e)}function ZD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sa(e){return Sa=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Sa(e)}function QD(e){var t=function(n){qD(r,n);var i=YD(r);function r(){return jD(this,r),i.apply(this,arguments)}return WD(r,[{key:"_changeState",value:function(){throw new Error("_changeState() should be overridden to perform actual change in state.")}},{key:"changeState",value:function(){for(var s=this,a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];var l=typeof o[0]=="string"?o.shift():void 0,u=Object(o[0])===o[0]&&typeof o[0]!="function"?o.shift():void 0,h=typeof o[0]=="function"?o.shift():void 0;if(typeof this.shouldStateBeChanged=="function"&&!this.shouldStateBeChanged(l,u)){h&&h(null,!0);return}var d={group:u&&u.group,state:l},f=[d.group,l].filter(Boolean).join("-").split("-").map(function(w){return w[0].toUpperCase()+w.substr(1)}).join(""),p=new CustomEvent(this.options["eventBefore".concat(f)],{bubbles:!0,cancelable:!0,detail:u}),m=u&&u.delegatorNode||this.element,g=!m.dispatchEvent(p);if(g){if(h){var v=new Error("Changing state (".concat(JSON.stringify(d),") has been canceled."));v.canceled=!0,h(v)}}else{var b=[l,u].filter(Boolean);this._changeState.apply(this,HD(b).concat([function(){m.dispatchEvent(new CustomEvent(s.options["eventAfter".concat(f)],{bubbles:!0,cancelable:!0,detail:u})),h&&h()}]))}}}]),r}(e);return t}function dc(e,t){var n=e.target,i=e.currentTarget;if(typeof n.matches=="function"){if(n.matches(t))return n;if(n.matches("".concat(t," *"))){var r=n.closest(t);if((i.nodeType===Node.DOCUMENT_NODE?i.documentElement:i).contains(r))return r}}}function Bg(e){if(!e||typeof e=="function")return{launchingElement:null,launchingEvent:null};var t=e.delegateTarget||e.currentTarget||e,n=e.currentTarget&&e;if(t&&!t.nodeType)throw new TypeError("DOM Node should be given for launching element.");if(n&&!n.type)throw new TypeError("DOM event should be given for launching event.");return{launchingElement:t,launchingEvent:n}}function fc(e){"@babel/helpers - typeof";return fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fc(e)}function JD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function tk(e,t,n){return t&&Hg(e.prototype,t),n&&Hg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ek(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pc(e,t)}function pc(e,t){return pc=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},pc(e,t)}function nk(e){var t=sk();return function(){var n=Oa(e),i;if(t){var r=Oa(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ik(this,i)}}function ik(e,t){if(t&&(fc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rk(e)}function rk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sk(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Oa(e){return Oa=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Oa(e)}function ak(e){var t=function(n){ek(r,n);var i=nk(r);function r(){return JD(this,r),i.apply(this,arguments)}return tk(r,[{key:"show",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("shown",Bg(s),a)}},{key:"hide",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("hidden",Bg(s),a)}}]),r}(e);return t}var ok=[QD,ak];const lk=ok;var Vg=function(){};process.env.NODE_ENV!=="production"&&(Vg=function(e,t,n){var i=arguments.length;n=new Array(i>2?i-2:0);for(var r=2;r<i;r++)n[r-2]=arguments[r];if(t===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(t.length<10||/^[s\W]*$/.test(t))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+t);if(!e){var s=0,a="Warning: "+t.replace(/%s/g,function(){return n[s++]});typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}});var ck=Vg;const uk=jp(ck);function gc(e){"@babel/helpers - typeof";return gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gc(e)}function hk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function dk(e,t,n){return t&&Gg(e.prototype,t),n&&Gg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fk(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mc(e,t)}function mc(e,t){return mc=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},mc(e,t)}function pk(e){var t=vk();return function(){var n=Ta(e),i;if(t){var r=Ta(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return gk(this,i)}}function gk(e,t){if(t&&(gc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mk(e)}function mk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vk(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ta(e){return Ta=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ta(e)}function yk(e){var t=function(n){fk(r,n);var i=pk(r);function r(){return hk(this,r),i.apply(this,arguments)}return dk(r,null,[{key:"init",value:function(){var s=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=Object.assign(Object.create(this.options),o);if(!a||a.nodeType!==Node.ELEMENT_NODE&&a.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.");if(a.nodeType===Node.ELEMENT_NODE&&a.matches(c.selectorInit))this.create(a,o);else{var l=c.initEventNames.map(function(u){return Ir(a,u,function(h){var d=dc(h,"[".concat(c.attribInitTarget,"]"));if(d){h.delegateTarget=d;var f=d.ownerDocument.querySelectorAll(d.getAttribute(c.attribInitTarget));if(f.length>1)throw new Error("Target widget must be unique.");if(f.length===1){d.tagName==="A"&&h.preventDefault();var p=s.create(f[0],o);typeof p.createdByLauncher=="function"&&p.createdByLauncher(h)}}})});return{release:function(){for(var u=l.pop();u;u=l.pop())u.release()}}}return""}}]),r.forLazyInit=!0,r}(e);return t}function vc(e){"@babel/helpers - typeof";return vc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vc(e)}function xk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function bk(e,t,n){return t&&Fg(e.prototype,t),n&&Fg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function wk(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yc(e,t)}function yc(e,t){return yc=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},yc(e,t)}function Ek(e){var t=Ok();return function(){var n=Ma(e),i;if(t){var r=Ma(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return _k(this,i)}}function _k(e,t){if(t&&(vc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sk(e)}function Sk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ok(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ma(e){return Ma=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ma(e)}var Tk=function(e){wk(n,e);var t=Ek(n);function n(i,r){var s;return xk(this,n),s=t.call(this,i,r),s._handleFocusinListener=void 0,s._handleKeydownListener=void 0,s._handleFocusin=function(a){var o=s.element.querySelector(s.options.selectorModalContainer)||s.element;s.element.classList.contains(s.options.classVisible)&&!o.contains(a.target)&&s.options.selectorsFloatingMenus.every(function(c){return!dc(a,c)})&&s.element.querySelector(ic.selectorTabbable).focus()},s._hookCloseActions(),s}return bk(n,[{key:"createdByLauncher",value:function(i){this.show(i)}},{key:"shouldStateBeChanged",value:function(i){return i==="shown"?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(i,r,s){var a=this,o,c=function(){if(o&&(o=a.unmanage(o).release()),i==="shown"&&a.element.offsetWidth>0&&a.element.offsetHeight>0){a.previouslyFocusedNode=a.element.ownerDocument.activeElement;var h=a.element.querySelector(a.options.selectorPrimaryFocus)||a.element.querySelector(ic.selectorTabbable);h.focus(),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&uk(h,"Modals need to contain a focusable element by either using "+"`".concat(a.options.selectorPrimaryFocus,"` or settings.selectorTabbable."))}s()};if(this._handleFocusinListener&&(this._handleFocusinListener=this.unmanage(this._handleFocusinListener).release()),i==="shown"){var l="onfocusin"in this.element.ownerDocument.defaultView,u=l?"focusin":"focus";this._handleFocusinListener=this.manage(Ir(this.element.ownerDocument,u,this._handleFocusin,!l))}i==="hidden"?(this.element.classList.toggle(this.options.classVisible,!1),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!1),(this.options.selectorFocusOnClose||this.previouslyFocusedNode)&&(this.element.ownerDocument.querySelector(this.options.selectorFocusOnClose)||this.previouslyFocusedNode).focus()):i==="shown"&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),o=this.manage(Ir(this.element,"transitionend",c))}},{key:"_hookCloseActions",value:function(){var i=this;this.manage(Ir(this.element,"click",function(r){var s=dc(r,i.options.selectorModalClose);s&&(r.delegateTarget=s),(s||r.target===i.element)&&i.hide(r)})),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(Ir(this.element.ownerDocument.body,"keydown",function(r){r.which===27&&i.shouldStateBeChanged("hidden")&&(r.stopPropagation(),i.hide(r))}))}}],[{key:"options",get:function(){var i=ic.prefix;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(i,"--overflow-menu-options"),".".concat(i,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(i,"--modal-container"),classVisible:"is-visible",classBody:"".concat(i,"--body--with-modal-open"),attribInitTarget:"data-modal-target",initEventNames:["click"],eventBeforeShown:"modal-beingshown",eventAfterShown:"modal-shown",eventBeforeHidden:"modal-beinghidden",eventAfterHidden:"modal-hidden"}}}]),n.components=new WeakMap,n}(_D($D,yk,lk,BD));const Mk=Tk;class Ca extends ht{constructor(t,n,i){super(t,n,i),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),Mk.create(this.modal.node()).show()},this.init()}addEventListeners(){this.services.events.addEventListener(C.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(C.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.model.getOptions(),n=E(t,"style","prefix"),i=this.model.getTabularDataArray();return`
24
+ `},Ql=fD;function Mg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function pD(e,t,n){return t&&Mg(e.prototype,t),n&&Mg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mD(e){return bD(e)||xD(e)||yD(e)||vD()}function vD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
25
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yD(e,t){if(e){if(typeof e=="string")return Jl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jl(e,t)}}function xD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bD(e){if(Array.isArray(e))return Jl(e)}function Jl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Cg(e){return e.reduce(function(t,n){return Array.isArray(n)?t.push.apply(t,mD(Cg(n))):t.push(n),t},[])}function wD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Cg(t).reduce(function(i,r){return r(i)},function(){function i(){gD(this,i)}return pD(i)}())}function tc(e){"@babel/helpers - typeof";return tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tc(e)}function ED(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ag(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _D(e,t,n){return t&&Ag(e.prototype,t),n&&Ag(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function SD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ec(e,t)}function ec(e,t){return ec=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ec(e,t)}function OD(e){var t=MD();return function(){var n=Ea(e),i;if(t){var r=Ea(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return TD(this,i)}}function TD(e,t){if(t&&(tc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $g(e)}function $g(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function MD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ea(e){return Ea=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ea(e)}function CD(e){var t=function(n){SD(r,n);var i=OD(r);function r(s){var a,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(ED(this,r),a=i.call(this,s,o),a.children=[],!s||s.nodeType!==Node.ELEMENT_NODE)throw new TypeError("DOM element should be given to initialize this widget.");return a.element=s,a.options=Object.assign(Object.create(a.constructor.options),o),a.constructor.components.set(a.element,$g(a)),a}return _D(r,[{key:"release",value:function(){for(var s=this.children.pop();s;s=this.children.pop())s.release();return this.constructor.components.delete(this.element),null}}],[{key:"create",value:function(s,a){return this.components.get(s)||new this(s,a)}}]),r}(e);return t}function nc(e){"@babel/helpers - typeof";return nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nc(e)}function AD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function $D(e,t,n){return t&&Lg(e.prototype,t),n&&Lg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _a(){return typeof Reflect<"u"&&Reflect.get?_a=Reflect.get:_a=function(e,t,n){var i=LD(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},_a.apply(this,arguments)}function LD(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Oi(e),e!==null););return e}function DD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ic(e,t)}function ic(e,t){return ic=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ic(e,t)}function kD(e){var t=PD();return function(){var n=Oi(e),i;if(t){var r=Oi(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return RD(this,i)}}function RD(e,t){if(t&&(nc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ID(e)}function ID(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function PD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Oi(e){return Oi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Oi(e)}function ND(e){var t=function(n){DD(r,n);var i=kD(r);function r(){var s;AD(this,r);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return s=i.call.apply(i,[this].concat(o)),s.handles=new Set,s}return $D(r,[{key:"manage",value:function(s){return this.handles.add(s),s}},{key:"unmanage",value:function(s){return this.handles.delete(s),s}},{key:"release",value:function(){var s=this;return this.handles.forEach(function(a){a.release(),s.handles.delete(a)}),_a(Oi(r.prototype),"release",this).call(this)}}]),r}(e);return t}function Rr(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return e.addEventListener.apply(e,n),{release:function(){return e.removeEventListener.apply(e,n),null}}}function rc(e){"@babel/helpers - typeof";return rc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rc(e)}function UD(e){return GD(e)||VD(e)||HD(e)||BD()}function BD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
26
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HD(e,t){if(e){if(typeof e=="string")return sc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sc(e,t)}}function VD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function GD(e){if(Array.isArray(e))return sc(e)}function sc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function FD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function zD(e,t,n){return t&&Dg(e.prototype,t),n&&Dg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ac(e,t)}function ac(e,t){return ac=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ac(e,t)}function WD(e){var t=XD();return function(){var n=Sa(e),i;if(t){var r=Sa(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return qD(this,i)}}function qD(e,t){if(t&&(rc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return YD(e)}function YD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sa(e){return Sa=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Sa(e)}function ZD(e){var t=function(n){jD(r,n);var i=WD(r);function r(){return FD(this,r),i.apply(this,arguments)}return zD(r,[{key:"_changeState",value:function(){throw new Error("_changeState() should be overridden to perform actual change in state.")}},{key:"changeState",value:function(){for(var s=this,a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];var l=typeof o[0]=="string"?o.shift():void 0,u=Object(o[0])===o[0]&&typeof o[0]!="function"?o.shift():void 0,h=typeof o[0]=="function"?o.shift():void 0;if(typeof this.shouldStateBeChanged=="function"&&!this.shouldStateBeChanged(l,u)){h&&h(null,!0);return}var d={group:u&&u.group,state:l},f=[d.group,l].filter(Boolean).join("-").split("-").map(function(w){return w[0].toUpperCase()+w.substr(1)}).join(""),p=new CustomEvent(this.options["eventBefore".concat(f)],{bubbles:!0,cancelable:!0,detail:u}),m=u&&u.delegatorNode||this.element,g=!m.dispatchEvent(p);if(g){if(h){var v=new Error("Changing state (".concat(JSON.stringify(d),") has been canceled."));v.canceled=!0,h(v)}}else{var b=[l,u].filter(Boolean);this._changeState.apply(this,UD(b).concat([function(){m.dispatchEvent(new CustomEvent(s.options["eventAfter".concat(f)],{bubbles:!0,cancelable:!0,detail:u})),h&&h()}]))}}}]),r}(e);return t}function oc(e,t){var n=e.target,i=e.currentTarget;if(typeof n.matches=="function"){if(n.matches(t))return n;if(n.matches("".concat(t," *"))){var r=n.closest(t);if((i.nodeType===Node.DOCUMENT_NODE?i.documentElement:i).contains(r))return r}}}function kg(e){if(!e||typeof e=="function")return{launchingElement:null,launchingEvent:null};var t=e.delegateTarget||e.currentTarget||e,n=e.currentTarget&&e;if(t&&!t.nodeType)throw new TypeError("DOM Node should be given for launching element.");if(n&&!n.type)throw new TypeError("DOM event should be given for launching event.");return{launchingElement:t,launchingEvent:n}}function lc(e){"@babel/helpers - typeof";return lc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lc(e)}function KD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function QD(e,t,n){return t&&Rg(e.prototype,t),n&&Rg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function JD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cc(e,t)}function cc(e,t){return cc=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},cc(e,t)}function tk(e){var t=ik();return function(){var n=Oa(e),i;if(t){var r=Oa(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ek(this,i)}}function ek(e,t){if(t&&(lc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nk(e)}function nk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ik(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Oa(e){return Oa=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Oa(e)}function rk(e){var t=function(n){JD(r,n);var i=tk(r);function r(){return KD(this,r),i.apply(this,arguments)}return QD(r,[{key:"show",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("shown",kg(s),a)}},{key:"hide",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("hidden",kg(s),a)}}]),r}(e);return t}var sk=[ZD,rk];const ak=sk;var Ig=function(){};process.env.NODE_ENV!=="production"&&(Ig=function(e,t,n){var i=arguments.length;n=new Array(i>2?i-2:0);for(var r=2;r<i;r++)n[r-2]=arguments[r];if(t===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(t.length<10||/^[s\W]*$/.test(t))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+t);if(!e){var s=0,a="Warning: "+t.replace(/%s/g,function(){return n[s++]});typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}});var ok=Ig;const lk=Bp(ok);function uc(e){"@babel/helpers - typeof";return uc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uc(e)}function ck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function uk(e,t,n){return t&&Pg(e.prototype,t),n&&Pg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hk(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hc(e,t)}function hc(e,t){return hc=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},hc(e,t)}function dk(e){var t=gk();return function(){var n=Ta(e),i;if(t){var r=Ta(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return fk(this,i)}}function fk(e,t){if(t&&(uc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pk(e)}function pk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gk(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ta(e){return Ta=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ta(e)}function mk(e){var t=function(n){hk(r,n);var i=dk(r);function r(){return ck(this,r),i.apply(this,arguments)}return uk(r,null,[{key:"init",value:function(){var s=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=Object.assign(Object.create(this.options),o);if(!a||a.nodeType!==Node.ELEMENT_NODE&&a.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.");if(a.nodeType===Node.ELEMENT_NODE&&a.matches(c.selectorInit))this.create(a,o);else{var l=c.initEventNames.map(function(u){return Rr(a,u,function(h){var d=oc(h,"[".concat(c.attribInitTarget,"]"));if(d){h.delegateTarget=d;var f=d.ownerDocument.querySelectorAll(d.getAttribute(c.attribInitTarget));if(f.length>1)throw new Error("Target widget must be unique.");if(f.length===1){d.tagName==="A"&&h.preventDefault();var p=s.create(f[0],o);typeof p.createdByLauncher=="function"&&p.createdByLauncher(h)}}})});return{release:function(){for(var u=l.pop();u;u=l.pop())u.release()}}}return""}}]),r.forLazyInit=!0,r}(e);return t}function dc(e){"@babel/helpers - typeof";return dc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dc(e)}function vk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ng(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function yk(e,t,n){return t&&Ng(e.prototype,t),n&&Ng(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xk(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fc(e,t)}function fc(e,t){return fc=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},fc(e,t)}function bk(e){var t=_k();return function(){var n=Ma(e),i;if(t){var r=Ma(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return wk(this,i)}}function wk(e,t){if(t&&(dc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ek(e)}function Ek(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _k(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ma(e){return Ma=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ma(e)}var Sk=function(e){xk(n,e);var t=bk(n);function n(i,r){var s;return vk(this,n),s=t.call(this,i,r),s._handleFocusinListener=void 0,s._handleKeydownListener=void 0,s._handleFocusin=function(a){var o=s.element.querySelector(s.options.selectorModalContainer)||s.element;s.element.classList.contains(s.options.classVisible)&&!o.contains(a.target)&&s.options.selectorsFloatingMenus.every(function(c){return!oc(a,c)})&&s.element.querySelector(Ql.selectorTabbable).focus()},s._hookCloseActions(),s}return yk(n,[{key:"createdByLauncher",value:function(i){this.show(i)}},{key:"shouldStateBeChanged",value:function(i){return i==="shown"?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(i,r,s){var a=this,o,c=function(){if(o&&(o=a.unmanage(o).release()),i==="shown"&&a.element.offsetWidth>0&&a.element.offsetHeight>0){a.previouslyFocusedNode=a.element.ownerDocument.activeElement;var h=a.element.querySelector(a.options.selectorPrimaryFocus)||a.element.querySelector(Ql.selectorTabbable);h.focus(),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&lk(h,"Modals need to contain a focusable element by either using "+"`".concat(a.options.selectorPrimaryFocus,"` or settings.selectorTabbable."))}s()};if(this._handleFocusinListener&&(this._handleFocusinListener=this.unmanage(this._handleFocusinListener).release()),i==="shown"){var l="onfocusin"in this.element.ownerDocument.defaultView,u=l?"focusin":"focus";this._handleFocusinListener=this.manage(Rr(this.element.ownerDocument,u,this._handleFocusin,!l))}i==="hidden"?(this.element.classList.toggle(this.options.classVisible,!1),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!1),(this.options.selectorFocusOnClose||this.previouslyFocusedNode)&&(this.element.ownerDocument.querySelector(this.options.selectorFocusOnClose)||this.previouslyFocusedNode).focus()):i==="shown"&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),o=this.manage(Rr(this.element,"transitionend",c))}},{key:"_hookCloseActions",value:function(){var i=this;this.manage(Rr(this.element,"click",function(r){var s=oc(r,i.options.selectorModalClose);s&&(r.delegateTarget=s),(s||r.target===i.element)&&i.hide(r)})),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(Rr(this.element.ownerDocument.body,"keydown",function(r){r.which===27&&i.shouldStateBeChanged("hidden")&&(r.stopPropagation(),i.hide(r))}))}}],[{key:"options",get:function(){var i=Ql.prefix;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(i,"--overflow-menu-options"),".".concat(i,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(i,"--modal-container"),classVisible:"is-visible",classBody:"".concat(i,"--body--with-modal-open"),attribInitTarget:"data-modal-target",initEventNames:["click"],eventBeforeShown:"modal-beingshown",eventAfterShown:"modal-shown",eventBeforeHidden:"modal-beinghidden",eventAfterHidden:"modal-hidden"}}}]),n.components=new WeakMap,n}(wD(CD,mk,ak,ND));const Ok=Sk;class Ca extends ht{constructor(t,n,i){super(t,n,i),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),Ok.create(this.modal.node()).show()},this.init()}addEventListeners(){this.services.events.addEventListener(C.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(C.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.model.getOptions(),n=E(t,"style","prefix"),i=this.model.getTabularDataArray();return`
27
27
  <div class="cds--modal-container cds--modal-container">
28
28
  <div class="cds--modal-header cds--modal-header">
29
29
  <p class="cds--modal-header__label cds--type-delta cds--modal-header__label cds--type-delta" id="modal-title">Tabular representation</p>
@@ -56,10 +56,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
56
56
  </div>
57
57
 
58
58
  <div class="cds--modal-footer cds--modal-footer">
59
- <div class="${Qt}--${n}-modal-footer-spacer"></div>
59
+ <div class="${ne}--${n}-modal-footer-spacer"></div>
60
60
  <button class="cds--btn cds--btn--primary cds--btn cds--btn--primary" type="button" data-modal-primary-focus>Download as CSV</button>
61
61
  </div>
62
- </div>`}render(t=!0){const n=this.model.getOptions();if(!this.isEventListenerAdded){const i=P(this.services.domUtils.getHolder()),r=E(n,"style","prefix");this.modal=I.appendOrSelect(i,`div.${Qt}--${r}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0,this.modal.attr("data-modal",!0).attr("class","cds--modal cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby","modal-title").attr("aria-describedby","modal-description").attr("tabindex",-1)}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class Pr extends ht{constructor(){super(...arguments),this.type="title",this.renderType=K.HTML}render(t=!0){const n=this.getComponentContainer(),i=E(this.getOptions(),"title"),r=n.selectAll("p.title").data([i]);if(r.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(r).html(s=>s),r.node()&&r.node().offsetWidth<r.node().scrollWidth){const s=this;r.on("mouseover",function(a){s.services.events.dispatchEvent(C.Tooltip.SHOW,{event:a,hoveredElement:r,content:r.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(C.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(C.Tooltip.HIDE)})}r.exit().remove()}truncateTitle(t,n){if(n<=0)return;const i=t.text();if(t.node().getComputedTextLength()>n){t.append("tspan").text("...");const r=I.appendOrSelect(t,"tspan").node().getComputedTextLength(),s=t.text(),a=this.getSubstringIndex(t.node(),0,s.length-1,n-r);t.html(s.substring(0,a-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(c){o.services.events.dispatchEvent(C.Tooltip.SHOW,{event:c,hoveredElement:t,content:i})}).on("mousemove",function(c){o.services.events.dispatchEvent(C.Tooltip.MOVE,{event:c})}).on("mouseout",function(){o.services.events.dispatchEvent(C.Tooltip.HIDE)})}}getMaxTitleWidth(){return I.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,i,r){const s=Math.floor((i+n)/2);return t.getSubStringLength(0,s)>r?this.getSubstringIndex(t,n,s,r):t.getSubStringLength(0,s)<r?t.getSubStringLength(0,s+1)>r?s:this.getSubstringIndex(t,s,i,r):s}}class xc extends ht{constructor(){super(...arguments),this.type="legend",this.renderType=K.HTML}render(t=!0){const n=this.getOptions(),i=E(n,"legend"),r=E(i,"alignment"),s=E(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Lt.items.status,c=a.some(b=>b.status===o),l=E(i,"order"),u=this.getComponentContainer().classed("center-aligned",r===It.CENTER).classed("right-aligned",r===It.RIGHT).classed(s,!0).classed("has-deactivated-items",c).attr("role",at.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");l&&(a=this.sortDataGroups(a,l));const h=u.selectAll("div.legend-item").data(a,b=>b.name),d=h.enter().append("div").attr("class","legend-item");d.merge(u.selectAll("div.legend-item")).classed("active",function(b){return b.status===Lt.items.status.ACTIVE});const f=E(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=Lt.checkbox.radius,m=d.append("div").classed("checkbox",!0),g=m.merge(h.select("div.checkbox")).attr("role",at.CHECKBOX).attr("tabindex",f?0:-1).attr("aria-labelledby",(b,w)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${w}-title`)).attr("aria-checked",({status:b})=>b===Lt.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",b=>this.model.getColorClassName({classNameTypes:[J.BACKGROUND],dataGroupName:b.name,originalClassName:"checkbox"})).style("background",b=>b.status===Lt.items.status.ACTIVE?this.model.getFillColor(b.name)||this.model.getStrokeColor(b.name):null).classed("active",function(b){return b.status===Lt.items.status.ACTIVE});m.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),d.append("p").merge(h.select("p"));const v=E(n,"legend","additionalItems");if(v&&a.length){const b=this,w=u.selectAll("div.additional-item").data(v);w.exit().remove();const O=w.enter().append("div").merge(w).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(S,$)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${g.size()+$}-title`));O.selectAll("*").remove();let _,T=1;O.append("svg").classed("icon",!0).each(function(S){const $=P(this);!_||_!=S.type?(_=S.type,T=1):T++,b.addAdditionalItem($,S,T)}),O.append("p").merge(O.select("p")),this.truncateLegendText()}h.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),f&&d.size()>1&&this.addEventListeners()}sortDataGroups(t,n){if(t.sort((i,r)=>n.indexOf(i.name)-n.indexOf(r.name)),n.length<t.length){const i=t.length-n.length;return t.slice(i).concat(t.slice(0,i))}return t}addAdditionalItem(t,n,i){const{width:r,height:s}=Lt.area;if(n.type===Nt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${r}px`).style("height",`${s}px`),n.type===Nt.RADIUS){const{iconData:a,fill:o,stroke:c}=Lt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",at.IMG).attr("aria-label","radius").attr("cx",l=>l.cx).attr("cy",l=>l.cy).attr("r",l=>l.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:c)}else if(n.type===Nt.LINE){const a=Lt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${i}`,!0).attr("role",at.IMG).attr("aria-label","line").attr("x1",0).attr("y1",a.yPosition).attr("x2",r).attr("y2",a.yPosition).style("stroke",n.stroke?n.stroke:a.stroke).style("stroke-width",a.strokeWidth)}else if(n.type===Nt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${i}`,!0).attr("role",at.IMG).attr("aria-label","area").attr("width",r).attr("height",s).style("fill",i>3&&!n.fill?Lt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===Nt.SIZE){const{iconData:a,fill:o,stroke:c}=Lt.size;t.attr("fill","none").attr("role",at.IMG).attr("aria-label","size").selectAll("rect").data(a).enter().append("rect").classed("size",!0).attr("width",l=>l.width).attr("height",l=>l.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:c).style("stroke-width",1)}else if(n.type===Nt.QUARTILE){const{iconData:a}=Lt.quartile;t.selectAll("rect").attr("role",at.IMG).attr("aria-label","quartile").data(a).enter().append("rect").attr("class",(o,c)=>`quartile-${c===0?"wrapper":"line"}`).attr("x",o=>o.x).attr("y",o=>o.y).attr("width",o=>o.width).attr("height",o=>o.height)}else if(n.type===Nt.ZOOM){const{iconData:a,color:o}=E(Vp,"legend","zoom"),c=t.attr("role",at.IMG).attr("aria-label","zoom").selectAll("g.icon").data(a).enter();c.append("g").attr("x",l=>l.x).attr("y",l=>l.y).attr("width",l=>l.width).attr("height",l=>l.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>n.color?n.color:o),c.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>n.color?n.color:o)}}truncateLegendText(){const t=this.getComponentContainer(),n=E(this.getOptions(),"legend","truncation"),i=E(n,"type"),r=E(n,"threshold"),s=E(n,"numCharacter"),a=t.selectAll("div.legend-item p");a.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),i!==Oe.NONE?a.html(function(o){return o.name.length>r?Cr(o.name,i,s):o.name}):a.html(o=>o.name)}addEventListeners(){const t=this,n=this.getComponentContainer(),i=this.getOptions(),r=E(i,"legend"),s=E(r,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(C.Legend.ITEM_HOVER,{hoveredElement:P(this)});const o=P(this);o.select("div.checkbox").classed("hovered",!0);const c=o.datum();c.name.length>s.threshold&&s.type!==Oe.NONE&&t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:a,hoveredElement:o,content:c.name})}).on("mousemove",function(a){P(this).datum().name.length>s.threshold&&s.type!==Oe.NONE&&t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(C.Legend.ITEM_CLICK,{clickedElement:P(this)});const a=P(this).datum();t.model.toggleDataLabel(a.name)}).on("mouseout",function(){const a=P(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==Oe.NONE&&t.services.events.dispatchEvent(C.Tooltip.HIDE),t.services.events.dispatchEvent(C.Legend.ITEM_MOUSEOUT,{hoveredElement:a})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(a){a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(C.Legend.ITEM_HOVER,{hoveredElement:P(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(a,o){a.key&&a.key===" "?(a.preventDefault(),t.model.toggleDataLabel(o.name)):a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(C.Legend.ITEM_MOUSEOUT,{hoveredElement:P(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=P(this),c=o.datum();c.name.length>s.threshold&&t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:a,hoveredElement:o,content:c.name})})}}class zg extends ht{constructor(t,n,i){super(t,n,i),this.type="chart-clip",this.renderType=K.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const i=n.getMainXScale(),r=n.getMainYScale(),[s,a]=i.range(),[o,c]=r.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=I.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const l=I.appendOrSelect(this.chartClipPath,`rect.${this.type}`);a-s>0&&l.attr("x",s).attr("y",c).attr("width",a-s).attr("height",o-c),this.chartClipPath.merge(l).lower()}}class Ck extends zg{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const t=this.parent,{width:n,height:i}=I.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=I.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const r=I.appendOrSelect(this.chartClipPath,`rect.${this.type}`);r.attr("x",0).attr("y",0).attr("width",n).attr("height",i),this.chartClipPath.merge(r).lower()}}var Ti,zt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(zt||(zt={}));var jg=(Ti={},Ti[zt.LEFT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left-t.offsetWidth)}},Ti[zt.RIGHT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left+n.width)}},Ti[zt.TOP]=function(e,t,n){return{top:Math.round(e.top-t.offsetHeight),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},Ti[zt.BOTTOM]=function(e,t,n){return{top:Math.round(e.top+n.height),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},Ti),Wg=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},Aa=function(){function e(t){t===void 0&&(t={}),this.positions=jg,this.positions=Object.assign({},jg,t)}return e.prototype.getRelativeOffset=function(t){for(var n={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&getComputedStyle(t.offsetParent).position==="static";)n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;return n},e.prototype.getAbsoluteOffset=function(t){for(var n=t,i={top:0,left:0};n.offsetParent;){var r=getComputedStyle(n.offsetParent);r.position==="static"&&r.marginLeft&&r.marginTop&&(parseInt(r.marginTop,10)&&(i.top+=parseInt(r.marginTop,10)),parseInt(r.marginLeft,10)&&(i.left+=parseInt(r.marginLeft,10))),n=n.offsetParent}var s=t.getBoundingClientRect(),a=document.body.getBoundingClientRect();return{top:s.top-a.top+i.top,left:s.left-a.left+i.left}},e.prototype.findRelative=function(t,n,i){var r=this.getRelativeOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(r,s,n,i)},e.prototype.findAbsolute=function(t,n,i){var r=this.getAbsoluteOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(r,s,n,i)},e.prototype.findPosition=function(t,n,i,r){r===void 0&&(r=this.getAbsoluteOffset.bind(this));var s=r(t),a=t.getBoundingClientRect();return this.calculatePosition(s,a,n,i)},e.prototype.findPositionAt=function(t,n,i){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},n,i)},e.prototype.getPlacementBox=function(t,n){var i=t.offsetHeight+n.top,r=t.offsetWidth+n.left;return{top:n.top,bottom:i,left:n.left,right:r}},e.prototype.addOffset=function(t,n,i){return n===void 0&&(n=0),i===void 0&&(i=0),Object.assign({},t,{top:t.top+n,left:t.left+i})},e.prototype.setElement=function(t,n){t.style.top=n.top+"px",t.style.left=n.left+"px"},e.prototype.findBestPlacement=function(t,n,i,r,s){var a=this;r===void 0&&(r=this.defaultContainerFunction.bind(this)),s===void 0&&(s=this.findPosition.bind(this));var o=i.map(function(c){var l=s(t,n,c),u=a.getPlacementBox(n,l),h=0,d=0,f=r();u.top<f.top?h=f.top-u.top:u.bottom>f.height&&(h=u.bottom-f.height),u.left<f.left?d=f.left-u.left:u.right>f.width&&(d=u.right-f.width),h&&!d?d=1:d&&!h&&(h=1);var p=n.offsetHeight*n.offsetWidth,m=h*d,g=p-m,v=g/p;return{placement:c,weight:v}});return o.sort(function(c,l){return l.weight-c.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,i,r){var s=this;r===void 0&&(r=this.defaultContainerFunction.bind(this));var a=function(o,c,l){return s.findPositionAt(t,c,l)};return this.findBestPlacement(null,n,i,r,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Wg.innerHeight,width:Wg.innerWidth}},e.prototype.calculatePosition=function(t,n,i,r){return this.positions[r]?this.positions[r](t,i,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},e}();new Aa;class bc extends ht{constructor(t,n,i){super(t,n,i),this.type="tooltip",this.renderType=K.HTML,this.isEventListenerAdded=!1,this.positionService=new Aa,this.handleShowTooltip=r=>{const s=r.detail.data||r.detail.items;let a;const o=this.formatItems(this.getItems(r));r.detail.content?a=`<div class="title-tooltip"><p>${r.detail.content}</p></div>`:a=this.getTooltipHTML(o);const c=I.appendOrSelect(this.tooltip,"div.content-box");if(E(this.getOptions(),"tooltip","customHTML"))if(r.detail.content){const l=`<div class="title-tooltip"><p>${r.detail.content}</p></div>`;c.html(l)}else c.html(this.model.getOptions().tooltip.customHTML(s,a));else c.html(a);c.selectAll(".datapoint-tooltip").each(function(l,u){const h=o[u];o[u]&&o[u].color&&P(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",h.color)}),this.positionTooltip(r),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1)},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(C.Tooltip.MOVE,t=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(C.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(C.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(C.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(C.Tooltip.MOVE,null),this.services.events.removeEventListener(C.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(C.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(C.Chart.MOUSEOUT,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),i=E(n,"tooltip","truncation","type"),r=E(n,"tooltip","truncation","threshold"),s=E(n,"tooltip","truncation","numCharacter");return i!==Oe.NONE?t.map(a=>{const o=a.labelIcon?12:0;return a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a.label&&a.label.length+o>r&&(a.label=Cr(a.label,i,s)),a.value&&a.value.length>r&&(a.value=Cr(a.value,i,s)),a}):t}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
62
+ </div>`}render(t=!0){const n=this.model.getOptions();if(!this.isEventListenerAdded){const i=P(this.services.domUtils.getHolder()),r=E(n,"style","prefix");this.modal=R.appendOrSelect(i,`div.${ne}--${r}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0,this.modal.attr("data-modal",!0).attr("class","cds--modal cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby","modal-title").attr("aria-describedby","modal-description").attr("tabindex",-1)}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class Ir extends ht{constructor(){super(...arguments),this.type="title",this.renderType=K.HTML}render(t=!0){const n=this.getComponentContainer(),i=E(this.getOptions(),"title"),r=n.selectAll("p.title").data([i]);if(r.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(r).html(s=>s),r.node()&&r.node().offsetWidth<r.node().scrollWidth){const s=this;r.on("mouseover",function(a){s.services.events.dispatchEvent(C.Tooltip.SHOW,{event:a,hoveredElement:r,content:r.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(C.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(C.Tooltip.HIDE)})}r.exit().remove()}truncateTitle(t,n){if(n<=0)return;const i=t.text();if(t.node().getComputedTextLength()>n){t.append("tspan").text("...");const r=R.appendOrSelect(t,"tspan").node().getComputedTextLength(),s=t.text(),a=this.getSubstringIndex(t.node(),0,s.length-1,n-r);t.html(s.substring(0,a-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(c){o.services.events.dispatchEvent(C.Tooltip.SHOW,{event:c,hoveredElement:t,content:i})}).on("mousemove",function(c){o.services.events.dispatchEvent(C.Tooltip.MOVE,{event:c})}).on("mouseout",function(){o.services.events.dispatchEvent(C.Tooltip.HIDE)})}}getMaxTitleWidth(){return R.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,i,r){const s=Math.floor((i+n)/2);return t.getSubStringLength(0,s)>r?this.getSubstringIndex(t,n,s,r):t.getSubStringLength(0,s)<r?t.getSubStringLength(0,s+1)>r?s:this.getSubstringIndex(t,s,i,r):s}}class pc extends ht{constructor(){super(...arguments),this.type="legend",this.renderType=K.HTML}render(t=!0){const n=this.getOptions(),i=E(n,"legend"),r=E(i,"alignment"),s=E(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Lt.items.status,c=a.some(b=>b.status===o),l=E(i,"order"),u=this.getComponentContainer().classed("center-aligned",r===It.CENTER).classed("right-aligned",r===It.RIGHT).classed(s,!0).classed("has-deactivated-items",c).attr("role",at.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");l&&(a=this.sortDataGroups(a,l));const h=u.selectAll("div.legend-item").data(a,b=>b.name),d=h.enter().append("div").attr("class","legend-item");d.merge(u.selectAll("div.legend-item")).classed("active",function(b){return b.status===Lt.items.status.ACTIVE});const f=E(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=Lt.checkbox.radius,m=d.append("div").classed("checkbox",!0),g=m.merge(h.select("div.checkbox")).attr("role",at.CHECKBOX).attr("tabindex",f?0:-1).attr("aria-labelledby",(b,w)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${w}-title`)).attr("aria-checked",({status:b})=>b===Lt.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",b=>this.model.getColorClassName({classNameTypes:[J.BACKGROUND],dataGroupName:b.name,originalClassName:"checkbox"})).style("background",b=>b.status===Lt.items.status.ACTIVE?this.model.getFillColor(b.name)||this.model.getStrokeColor(b.name):null).classed("active",function(b){return b.status===Lt.items.status.ACTIVE});m.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),d.append("p").merge(h.select("p"));const v=E(n,"legend","additionalItems");if(v&&a.length){const b=this,w=u.selectAll("div.additional-item").data(v);w.exit().remove();const O=w.enter().append("div").merge(w).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(S,$)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${g.size()+$}-title`));O.selectAll("*").remove();let _,T=1;O.append("svg").classed("icon",!0).each(function(S){const $=P(this);!_||_!=S.type?(_=S.type,T=1):T++,b.addAdditionalItem($,S,T)}),O.append("p").merge(O.select("p")),this.truncateLegendText()}h.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),f&&d.size()>1&&this.addEventListeners()}sortDataGroups(t,n){if(t.sort((i,r)=>n.indexOf(i.name)-n.indexOf(r.name)),n.length<t.length){const i=t.length-n.length;return t.slice(i).concat(t.slice(0,i))}return t}addAdditionalItem(t,n,i){const{width:r,height:s}=Lt.area;if(n.type===Nt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${r}px`).style("height",`${s}px`),n.type===Nt.RADIUS){const{iconData:a,fill:o,stroke:c}=Lt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",at.IMG).attr("aria-label","radius").attr("cx",l=>l.cx).attr("cy",l=>l.cy).attr("r",l=>l.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:c)}else if(n.type===Nt.LINE){const a=Lt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${i}`,!0).attr("role",at.IMG).attr("aria-label","line").attr("x1",0).attr("y1",a.yPosition).attr("x2",r).attr("y2",a.yPosition).style("stroke",n.stroke?n.stroke:a.stroke).style("stroke-width",a.strokeWidth)}else if(n.type===Nt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${i}`,!0).attr("role",at.IMG).attr("aria-label","area").attr("width",r).attr("height",s).style("fill",i>3&&!n.fill?Lt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===Nt.SIZE){const{iconData:a,fill:o,stroke:c}=Lt.size;t.attr("fill","none").attr("role",at.IMG).attr("aria-label","size").selectAll("rect").data(a).enter().append("rect").classed("size",!0).attr("width",l=>l.width).attr("height",l=>l.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:c).style("stroke-width",1)}else if(n.type===Nt.QUARTILE){const{iconData:a}=Lt.quartile;t.selectAll("rect").attr("role",at.IMG).attr("aria-label","quartile").data(a).enter().append("rect").attr("class",(o,c)=>`quartile-${c===0?"wrapper":"line"}`).attr("x",o=>o.x).attr("y",o=>o.y).attr("width",o=>o.width).attr("height",o=>o.height)}else if(n.type===Nt.ZOOM){const{iconData:a,color:o}=E(Lt,"zoom"),c=t.attr("role",at.IMG).attr("aria-label","zoom").selectAll("g.icon").data(a).enter();c.append("g").attr("x",l=>l.x).attr("y",l=>l.y).attr("width",l=>l.width).attr("height",l=>l.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>n.color?n.color:o),c.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>n.color?n.color:o)}}truncateLegendText(){const t=this.getComponentContainer(),n=E(this.getOptions(),"legend","truncation"),i=E(n,"type"),r=E(n,"threshold"),s=E(n,"numCharacter"),a=t.selectAll("div.legend-item p");a.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),i!==Se.NONE?a.html(function(o){return o.name.length>r?Cr(o.name,i,s):o.name}):a.html(o=>o.name)}addEventListeners(){const t=this,n=this.getComponentContainer(),i=this.getOptions(),r=E(i,"legend"),s=E(r,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(C.Legend.ITEM_HOVER,{hoveredElement:P(this)});const o=P(this);o.select("div.checkbox").classed("hovered",!0);const c=o.datum();c.name.length>s.threshold&&s.type!==Se.NONE&&t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:a,hoveredElement:o,content:c.name})}).on("mousemove",function(a){P(this).datum().name.length>s.threshold&&s.type!==Se.NONE&&t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(C.Legend.ITEM_CLICK,{clickedElement:P(this)});const a=P(this).datum();t.model.toggleDataLabel(a.name)}).on("mouseout",function(){const a=P(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==Se.NONE&&t.services.events.dispatchEvent(C.Tooltip.HIDE),t.services.events.dispatchEvent(C.Legend.ITEM_MOUSEOUT,{hoveredElement:a})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(a){a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(C.Legend.ITEM_HOVER,{hoveredElement:P(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(a,o){a.key&&a.key===" "?(a.preventDefault(),t.model.toggleDataLabel(o.name)):a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(C.Legend.ITEM_MOUSEOUT,{hoveredElement:P(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=P(this),c=o.datum();c.name.length>s.threshold&&t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:a,hoveredElement:o,content:c.name})})}}class Ug extends ht{constructor(t,n,i){super(t,n,i),this.type="chart-clip",this.renderType=K.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const i=n.getMainXScale(),r=n.getMainYScale(),[s,a]=i.range(),[o,c]=r.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=R.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const l=R.appendOrSelect(this.chartClipPath,`rect.${this.type}`);a-s>0&&l.attr("x",s).attr("y",c).attr("width",a-s).attr("height",o-c),this.chartClipPath.merge(l).lower()}}class Tk extends Ug{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const t=this.parent,{width:n,height:i}=R.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=R.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const r=R.appendOrSelect(this.chartClipPath,`rect.${this.type}`);r.attr("x",0).attr("y",0).attr("width",n).attr("height",i),this.chartClipPath.merge(r).lower()}}var Ti,zt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(zt||(zt={}));var Bg=(Ti={},Ti[zt.LEFT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left-t.offsetWidth)}},Ti[zt.RIGHT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left+n.width)}},Ti[zt.TOP]=function(e,t,n){return{top:Math.round(e.top-t.offsetHeight),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},Ti[zt.BOTTOM]=function(e,t,n){return{top:Math.round(e.top+n.height),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},Ti),Hg=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},Aa=function(){function e(t){t===void 0&&(t={}),this.positions=Bg,this.positions=Object.assign({},Bg,t)}return e.prototype.getRelativeOffset=function(t){for(var n={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&getComputedStyle(t.offsetParent).position==="static";)n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;return n},e.prototype.getAbsoluteOffset=function(t){for(var n=t,i={top:0,left:0};n.offsetParent;){var r=getComputedStyle(n.offsetParent);r.position==="static"&&r.marginLeft&&r.marginTop&&(parseInt(r.marginTop,10)&&(i.top+=parseInt(r.marginTop,10)),parseInt(r.marginLeft,10)&&(i.left+=parseInt(r.marginLeft,10))),n=n.offsetParent}var s=t.getBoundingClientRect(),a=document.body.getBoundingClientRect();return{top:s.top-a.top+i.top,left:s.left-a.left+i.left}},e.prototype.findRelative=function(t,n,i){var r=this.getRelativeOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(r,s,n,i)},e.prototype.findAbsolute=function(t,n,i){var r=this.getAbsoluteOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(r,s,n,i)},e.prototype.findPosition=function(t,n,i,r){r===void 0&&(r=this.getAbsoluteOffset.bind(this));var s=r(t),a=t.getBoundingClientRect();return this.calculatePosition(s,a,n,i)},e.prototype.findPositionAt=function(t,n,i){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},n,i)},e.prototype.getPlacementBox=function(t,n){var i=t.offsetHeight+n.top,r=t.offsetWidth+n.left;return{top:n.top,bottom:i,left:n.left,right:r}},e.prototype.addOffset=function(t,n,i){return n===void 0&&(n=0),i===void 0&&(i=0),Object.assign({},t,{top:t.top+n,left:t.left+i})},e.prototype.setElement=function(t,n){t.style.top=n.top+"px",t.style.left=n.left+"px"},e.prototype.findBestPlacement=function(t,n,i,r,s){var a=this;r===void 0&&(r=this.defaultContainerFunction.bind(this)),s===void 0&&(s=this.findPosition.bind(this));var o=i.map(function(c){var l=s(t,n,c),u=a.getPlacementBox(n,l),h=0,d=0,f=r();u.top<f.top?h=f.top-u.top:u.bottom>f.height&&(h=u.bottom-f.height),u.left<f.left?d=f.left-u.left:u.right>f.width&&(d=u.right-f.width),h&&!d?d=1:d&&!h&&(h=1);var p=n.offsetHeight*n.offsetWidth,m=h*d,g=p-m,v=g/p;return{placement:c,weight:v}});return o.sort(function(c,l){return l.weight-c.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,i,r){var s=this;r===void 0&&(r=this.defaultContainerFunction.bind(this));var a=function(o,c,l){return s.findPositionAt(t,c,l)};return this.findBestPlacement(null,n,i,r,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Hg.innerHeight,width:Hg.innerWidth}},e.prototype.calculatePosition=function(t,n,i,r){return this.positions[r]?this.positions[r](t,i,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},e}();new Aa;class gc extends ht{constructor(t,n,i){super(t,n,i),this.type="tooltip",this.renderType=K.HTML,this.isEventListenerAdded=!1,this.positionService=new Aa,this.handleShowTooltip=r=>{const s=r.detail.data||r.detail.items;let a;const o=this.formatItems(this.getItems(r));r.detail.content?a=`<div class="title-tooltip"><p>${r.detail.content}</p></div>`:a=this.getTooltipHTML(o);const c=R.appendOrSelect(this.tooltip,"div.content-box");if(E(this.getOptions(),"tooltip","customHTML"))if(r.detail.content){const l=`<div class="title-tooltip"><p>${r.detail.content}</p></div>`;c.html(l)}else c.html(this.model.getOptions().tooltip.customHTML(s,a));else c.html(a);c.selectAll(".datapoint-tooltip").each(function(l,u){const h=o[u];o[u]&&o[u].color&&P(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",h.color)}),this.positionTooltip(r),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1)},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(C.Tooltip.MOVE,t=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(C.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(C.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(C.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(C.Tooltip.MOVE,null),this.services.events.removeEventListener(C.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(C.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(C.Chart.MOUSEOUT,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),i=E(n,"tooltip","truncation","type"),r=E(n,"tooltip","truncation","threshold"),s=E(n,"tooltip","truncation","numCharacter");return i!==Se.NONE?t.map(a=>{const o=a.labelIcon?12:0;return a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a.label&&a.label.length+o>r&&(a.label=Cr(a.label,i,s)),a.value&&a.value.length>r&&(a.value=Cr(a.value,i,s)),a}):t}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
63
63
  <div class="datapoint-tooltip${n.bold?" bold":""}">
64
64
  ${n.class||n.color?`<div class="tooltip-color ${n.class}"></div>`:""}
65
65
  <div class="label">
@@ -68,17 +68,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
68
68
  </div>
69
69
  ${n.value===void 0||n.value===null?"":`<p class="value"/>${n.value}</p>`}
70
70
  </div>
71
- </li>`).join("")+"</ul>"}valueFormatter(t,n){const i=this.getOptions(),r=E(i,"tooltip","valueFormatter");if(r)return r(t,n);if(typeof t.getTime=="function")return pi(t,"MMM d, yyyy");try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t))return pi(Date.parse(t),"MMM d, yyyy")}catch{}return t.toLocaleString()}render(t=!0){const n=this.getOptions(),i=E(n,"tooltip","enabled");if(i){const r=P(this.services.domUtils.getHolder()),s=E(n,"style","prefix");this.tooltip=I.appendOrSelect(r,`div.${Qt}--${s}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!i&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}positionTooltip(t){const n=this.services.domUtils.getHolder(),i=this.tooltip.node(),r=this.getOptions(),s=E(r,"zoomBar","top","enabled");let a=E(t,"detail","mousePosition");if(!a)a=wn(E(t,"detail","event"),n);else{const d=E(r,"zoomBar","top","type"),f=ie.height[d];s&&(a[1]+=f+ie.spacerHeight)}const o=n.offsetWidth,c=n.offsetHeight;let l;a[0]/o>.9?l=zt.LEFT:a[0]/o<.1?l=zt.RIGHT:l=this.positionService.findBestPlacementAt({left:a[0],top:a[1]},i,[zt.RIGHT,zt.LEFT,zt.TOP,zt.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:c}));let{horizontalOffset:u}=bf;l===zt.LEFT&&(u*=-1);const h=this.positionService.findPositionAt({left:a[0]+u,top:a[1]},i,l);this.positionService.setElement(i,h)}}const $a=class extends ht{constructor(){super(...arguments),this.type="grid-brush",this.renderType=K.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,i=this.getComponentContainer();if(!n)throw new Error("SVG was not defined");const r=I.appendOrSelect(n,"svg.chart-grid-backdrop"),s=I.appendOrSelect(r,`g.${this.type}`),a=I.appendOrSelect(s,this.selectionSelector),{width:o,height:c}=I.getSVGElementSize(r,{useAttrs:!0}),{cartesianScales:l}=this.services,u=l.getMainXScaleType(),h=l.getMainXScale(),[d]=h.range();i.attr("transform",`translate(${d},0)`);const f=I.appendOrSelect(i,this.frontSelectionSelector);if(h&&u===Z.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const m=_=>{const T=_[1]-_[0];let S="0,"+T.toString();const $=Math.floor(c/$a.DASH_LENGTH),D=$*$a.DASH_LENGTH;for(let L=0;L<$;L++)S+=","+$a.DASH_LENGTH;S+=","+(c-D),$%2===1&&(S+=",0"),S+=","+T.toString(),S+=","+c.toString(),f.attr("stroke-dasharray",S)},g=_=>{const T=_.selection;T===null||T[0]===T[1]||(f.attr("x",parseFloat(a.attr("x"))+parseFloat(r.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),m(T))},v=(_,T)=>{const S=gd().range([0,o]).domain(p);let $=[S.invert(_),S.invert(T)];$[0].valueOf()===$[1].valueOf()&&($=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==$[0].valueOf()||p[1].valueOf()!==$[1].valueOf())&&this.services.zoom.handleDomainChange($)};let b;const w=_=>{const T=_.selection;T!==null&&(v(T[0],T[1]),s.call(b.move,null),f.style("display","none"))};c!=0&&o!=0&&(b=Du().extent([[0,0],[o-1,c]]).on("start brush end",g).on("end.brushed",w),s.call(b));const O=this.services.zoom.getZoomRatio();r.on("click",function(_){if(_.shiftKey){const T=this.services.domUtils.getHolder(),S=wn(s.node(),T)[0];let $=S-o*O/2;$<0&&($=0);let D=S+o*O/2;D>o&&(D=o),v($,D)}})}}};let qg=$a;qg.DASH_LENGTH=4;class Ak extends ht{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=K.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=Du(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(C.ZoomBar.UPDATE,this.render.bind(this));const t=E(this.getOptions(),"zoomBar",H.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),i=this.services.zoom.isZoomBarLoading(H.TOP),r=this.services.zoom.isZoomBarLocked(H.TOP),s=E(this.getOptions(),"zoomBar",H.TOP,"type"),a=E(this.getOptions(),"axes",H.BOTTOM,"highlights"),o=ie.height[s],{width:c}=I.getSVGElementSize(this.parent,{useAttrs:!0});if(c===0)return;let l=0;const u=this.model.get("axesMargins");u&&u.left&&(l=u.left);const h=I.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(I.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",ie.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ie.GRAPH_VIEW?I.appendOrSelect(h,"rect.zoom-bg").attr("x",l).attr("y",0).attr("width",c-l).attr("height","100%").classed("zoom-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Ie.SLIDER_VIEW&&I.appendOrSelect(h,"rect.zoom-slider-bg").attr("x",l).attr("y",o/2-1).attr("width",c-l).attr("height",2).classed("zoom-slider-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),i){this.renderSkeleton(h,l,c);return}const{cartesianScales:d}=this.services,f=d.getMainXScale(),p=d.getMainYScale(),m=d.getMainXScaleType();if(f&&m===Z.TIME){let g=this.services.zoom.getZoomBarData();if(Ce(g)||g.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const v=this.services.zoom.getDefaultZoomBarDomain(g);g=this.compensateDataForDefaultDomain(g,v);const b=this.model.get("initialZoomDomain"),w=E(this.getOptions(),"zoomBar",H.TOP,"initialZoomDomain");w&&w[0]&&w[1]&&(w[0]=new Date(w[0]),w[1]=new Date(w[1])),w&&!(b&&b[0].valueOf()===w[0].valueOf()&&b[1].valueOf()===w[1].valueOf())?this.model.set({initialZoomDomain:nt([],w),zoomDomain:w?nt([],w):v},{skipUpdate:!0}):w===null&&b!==null&&this.model.set({initialZoomDomain:null,zoomDomain:nt([],v)},{skipUpdate:!0}),this.xScale.range([l,c]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(xe(g,T=>T.value));const O=this.model.get("zoomDomain");if(s===Ie.GRAPH_VIEW&&(this.renderZoomBarArea(h,"path.zoom-graph-area-unselected",g,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(h,"path.zoom-graph-area",g,this.clipId),this.renderZoomBarBaseline(h,l,c),a)){const T=a.highlightStartMapsTo,S=a.highlightEndMapsTo,$=a.color,D=a.labelMapsTo;a.data.forEach((L,M)=>{I.appendOrSelect(h,`rect.highlight-${M}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(L[T])).attr("width",this.xScale(L[S])-this.xScale(L[T])).style("fill",$&&$.scale[L[D]]?$.scale[L[D]]:null).style("fill-opacity",.1).style("stroke",$&&$.scale[L[D]]?$.scale[L[D]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(O,l,c);const _=I.appendOrSelect(n,this.brushSelector).call(this.brush);if(O!==void 0)if(O[0].valueOf()===O[1].valueOf())_.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const T=O.map(S=>this.xScale(S));T[1]-T[0]<this.MIN_SELECTION_DIFF||(_.call(this.brush.move,T),this.updateBrushHandle(this.getComponentContainer(),T))}r&&(this.brush.filter(()=>!1),_.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,i){const r=o=>{const c=o.selection;c===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):c[0]===c[1]||this.handleBrushedEvent(o,t,this.xScale,c)},s=E(this.getOptions(),"zoomBar",H.TOP,"type"),a=ie.height[s];this.brush.extent([[n,0],[i,a]]).on("start brush end",null).on("start brush end",r)}handleBrushedEvent(t,n,i,r){const s=[i.invert(r[0]),i.invert(r[1])];if(this.updateBrushHandle(this.getComponentContainer(),r),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1});let a;t.type==="start"?a=C.ZoomBar.SELECTION_START:t.type==="brush"?a=C.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=C.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(C.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:r,newDomain:s})}}updateBrushHandle(t,n){const i=this,r=ie.handleWidth,s=E(this.getOptions(),"zoomBar",H.TOP,"type"),a=ie.height[s],o=-r/2,c=ie.handleBarWidth,l=s===Ie.GRAPH_VIEW?ie.handleBarHeight:6,u=-c/2,h=(a-l)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(f){if(f.type==="w")return Math.max(n[0]+o,i.maxSelectionRange[0]);if(f.type==="e")return Math.min(n[1]+o,i.maxSelectionRange[1]-r)}).attr("y",0).attr("width",r).attr("height",a).attr("cursor","ew-resize").style("display",null);const d=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);d.enter().append("rect").attr("class",function(f){return"handle-bar handle-bar--"+f.type}),d.attr("x",function(f){if(f.type==="w")return Math.max(n[0]+u,i.maxSelectionRange[0]-o+u);if(f.type==="e")return Math.min(n[1]+u,i.maxSelectionRange[1]+o+u)}).attr("y",h).attr("width",c).attr("height",l).attr("cursor","ew-resize"),s===Ie.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=E(this.getOptions(),"zoomBar",H.TOP,"type"),i=ie.height[n],r=this.getComponentContainer().select("svg.zoom-container");I.appendOrSelect(r,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",i/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,i,r){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),c=s.getMainXScaleType(),l=s.getMainYScaleType(),u=(v,b,w)=>O=>s.getValueFromScale(v,b,w,O),h=u(this.xScale,c,a),d=u(this.yScale,l,o),f=E(this.getOptions(),"zoomBar",H.TOP,"type"),p=ie.height[f],m=rl().x(v=>h(v)).y0(p).y1(v=>p-d(v)),g=I.appendOrSelect(t,n).datum(i).attr("d",m);r&&g.attr("clip-path",`url(#${r})`)}updateClipPath(t,n,i,r,s,a){const o=I.appendOrSelect(t,"clipPath").attr("id",n);I.appendOrSelect(o,"rect").attr("x",i).attr("y",r).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const i=nn(t),r=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(i[0][r])){const a={};a[r]=n[0],a[s]=0,i.unshift(a)}if(Number(n[1])>Number(i[i.length-1][r])){const a={};a[r]=n[1],a[s]=0,i.push(a)}return i}renderZoomBarBaseline(t,n,i,r=!1){const s=E(this.model.getOptions(),"zoomBar",H.TOP,"type"),a=ie.height[s],o=lr()([[n,a],[i,a]]);I.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,i){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),I.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),E(this.getOptions(),"zoomBar",H.TOP,"type")===Ie.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,i,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(C.ZoomBar.UPDATE,this.render.bind(this))}}class $k extends ht{constructor(t,n){super(t,n),this.type="threshold",this.renderType=K.SVG,this.positionService=new Aa}render(t=!1){const n=E(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(l=>{if(Object.values(H).includes(l)){const u=n[l];u.thresholds&&u.thresholds.length>0&&i.push({axisPosition:l,thresholds:u.thresholds,correspondingDatasets:u==null?void 0:u.correspondingDatasets,mapsTo:u==null?void 0:u.mapsTo})}});const r=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(i,l=>l.axisPosition);r.exit().attr("opacity",0).remove();const s=r.enter().append("g").merge(r);s.attr("class",l=>`axis-thresholds ${l.axisPosition}`);const a=s.selectAll("g.threshold-group").data(l=>l.thresholds.map(u=>(u.axisPosition=l.axisPosition,u.datum=this.constructDatumObj(l,u),u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(a).attr("class","threshold-group");const c=this;s.each(function({axisPosition:l}){const u=c.services.cartesianScales.getScaleByPosition(l),h=c.services.cartesianScales.getScaleTypeByPosition(l);let d=null,f=null;l===H.LEFT||l===H.RIGHT?(f=u,d=c.services.cartesianScales.getMainXScale()):(d=u,f=c.services.cartesianScales.getMainYScale());const p=h===Z.LABELS,[m,g]=d.range(),[v,b]=f.range(),{cartesianScales:w}=c.services,O=w.getOrientation(),_=L=>w.getDomainValue(L),T=L=>w.getRangeValue(L),[S,$]=sn(_,T,O),D=P(this);l===H.TOP||l===H.BOTTOM?(D.selectAll("line.threshold-line").transition().call(L=>c.services.transitions.setupTransition({transition:L,name:"threshold-line-update",animate:t})).attr("y1",b).attr("y2",v).attr("x1",({datum:L})=>S(L)+(p?u.step()/2:0)).attr("x2",({datum:L})=>S(L)+(p?u.step()/2:0)).style("stroke",({fillColor:L})=>L),D.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:L})=>-S(L)).attr("width",Math.abs(v-b)).classed("rotate",!0)):(D.selectAll("line.threshold-line").transition().call(L=>c.services.transitions.setupTransition({transition:L,name:"threshold-line-update",animate:t})).attr("x1",m).attr("x2",g).attr("y1",({datum:L})=>$(L)+(p?u.step()/2:0)).attr("y2",({datum:L})=>$(L)+(p?u.step()/2:0)).style("stroke",({fillColor:L})=>L),D.selectAll("rect.threshold-hoverable-area").attr("x",m).attr("y",({datum:L})=>$(L)).attr("width",Math.abs(g-m)).classed("rotate",!1))}),this.services.events.addEventListener(C.Threshold.SHOW,l=>{this.setThresholdLabelPosition(l.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(C.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:i}=t,r=this.getOptions();if(this.services.cartesianScales.getScaleTypeByPosition(i)===Z.TIME){const s=[H.LEFT,H.RIGHT].includes(i),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),c=s?o:a,l=E(r,"timeScale"),u=ql(c.ticks(),E(l,"timeInterval"));return Wl(n,0,c.ticks(),u,l)}return n.toLocaleString("en")}appendThresholdLabel(){const t=P(this.services.domUtils.getHolder()),n=E(this.getOptions(),"style","prefix");this.label=I.appendOrSelect(t,`div.${Qt}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const i=this.services.domUtils.getHolder(),r=wn(t,i),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(`${n.label||"Threshold"}: ${s}`).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:r[0],top:r[1]},a,[zt.RIGHT,zt.LEFT,zt.TOP,zt.BOTTOM],()=>({top:void 0,left:void 0,width:i.offsetWidth,height:i.offsetHeight})),c=this.positionService.findPositionAt({left:r[0],top:r[1]},a,o);this.positionService.setElement(a,c)}constructDatumObj(t,n){const i={};return t.correspondingDatasets&&(i.group=E(t,"correspondingDatasets",0)),i[t.mapsTo]=n.value,i}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){P(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(C.Threshold.SHOW,{event:n,hoveredElement:P(this),datum:P(this).datum()})}).on("mouseout",function(n){P(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(C.Threshold.HIDE,{event:n,hoveredElement:P(this),datum:P(this).datum()})})}}class Lk extends ht{constructor(t,n){super(t,n),this.type="highlight",this.renderType=K.SVG,this.positionService=new Aa,this.highlightStrokeWidth=1}render(t=!1){const n=E(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(l=>{if(Object.values(H).includes(l)){const u=n[l];u.highlights&&u.highlights.data.length>0&&i.push({axisPosition:l,highlightStartMapsTo:u.highlights.highlightStartMapsTo,highlightEndMapsTo:u.highlights.highlightEndMapsTo,labelMapsTo:u.highlights.labelMapsTo,highlight:u.highlights.data,color:u.highlights.color})}});const r=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(i,l=>l.axisPosition);r.exit().attr("opacity",0).remove();const s=r.enter().append("g").merge(r);s.attr("class",l=>`axis-highlight ${l.axisPosition}`);const a=s.selectAll("g.highlight-group").data(l=>l.highlight.map(u=>(u.axisPosition=l.axisPosition,u.highlightStartMapsTo=l.highlightStartMapsTo,u.labelMapsTo=l.labelMapsTo,u.color=l.color,u.highlightEndMapsTo=l.highlightEndMapsTo,u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(a).attr("class","highlight-group");const c=this;s.each(function({axisPosition:l}){const u=c.services.cartesianScales.getMainXScale(),h=c.services.cartesianScales.getMainYScale(),[d,f]=u.range(),[p,m]=h.range(),{cartesianScales:g}=c.services,v=g.getOrientation(),b=S=>g.getDomainValue(S),w=S=>g.getRangeValue(S),[O,_]=sn(b,w,v),T=P(this);l===H.TOP||l===H.BOTTOM?T.selectAll("rect.highlight-bar").transition().call(S=>c.services.transitions.setupTransition({transition:S,name:"highlight-bar-update",animate:t})).attr("y",Math.max(m+c.highlightStrokeWidth,0)).attr("height",Math.max(p-2*c.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:S,...$})=>O($[S])).attr("width",({highlightStartMapsTo:S,highlightEndMapsTo:$,...D})=>Math.max(O(D[$])-O(D[S]),0)).style("stroke",({color:S,labelMapsTo:$,...D})=>S&&S.scale[D[$]]?S.scale[D[$]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",c.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:S,labelMapsTo:$,...D})=>S&&S.scale[D[$]]?S.scale[D[$]]:null):T.selectAll("rect.highlight-bar").transition().call(S=>c.services.transitions.setupTransition({transition:S,name:"highlight-bar-update",animate:t})).attr("x",d).attr("width",Math.max(f-d,0)).attr("y",({highlightEndMapsTo:S,...$})=>_($[S])).attr("height",({highlightStartMapsTo:S,highlightEndMapsTo:$,...D})=>Math.max(_(D[S])-_(D[$]),0)).style("stroke",({color:S,labelMapsTo:$,...D})=>S&&S.scale[D[$]]?S.scale[D[$]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",c.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:S,labelMapsTo:$,...D})=>S&&S.scale[D[$]]?S.scale[D[$]]:null)})}}class Yg extends bc{getItems(t){if(t.detail.items)return t.detail.items;const n=t.detail.data;if(!n.length||!n[0])return[];const i=this.getOptions(),{cartesianScales:r}=this.services,s=r.getDomainIdentifier(),a=r.isDualAxes(),{groupMapsTo:o}=i.data,c=r.getDomainLabel();let l=r.getRangeLabel();const u=n[0][s];let h;if(n.length===1){const d=n[0],f=r.getRangeIdentifier(d);if(a){const m=r.getRangeAxisPosition({datum:d,groups:[d[o]]});l=r.getScaleLabel(m)}const p=d[f];h=[{label:c,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:l,value:d[f]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(m=>h.push({label:m.label,value:m.value})),h.push({label:i.tooltip.groupLabel,value:d[o],color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[J.TOOLTIP],dataGroupName:d[o]})})}else if(n.length>1&&(h=[{label:c,value:u}],h=h.concat(n.map(d=>{const f=d[r.getRangeIdentifier(d)];return{label:d[o],value:Array.isArray(f)&&f.length===2?`${f[0]} - ${f[1]}`:f,color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[J.TOOLTIP],dataGroupName:d[o]})}}).sort((d,f)=>f.value-d.value)),!a&&E(i,"tooltip","showTotal")===!0)){const d=r.getRangeIdentifier();h.push({label:St(i,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[d],0),bold:!0})}return h}}class Dk extends ht{constructor(){super(...arguments),this.type="alluvial",this.renderType=K.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.html("");const{width:i,height:r}=I.getSVGElementSize(n,{useAttrs:!0});if(i<1||r<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=E(this.getOptions(),"color","gradient","enabled");let c=ge.minNodePadding;s.alluvial.nodePadding>ge.minNodePadding&&(c=s.alluvial.nodePadding);const l=E(s,"alluvial","nodeAlignment");let u=tg;l===It.LEFT?u=k$:l===It.RIGHT&&(u=R$);const h=U$().nodeId(g=>g.name).nodeWidth(ge.nodeWidth).nodePadding(c).nodeAlign(u).extent([[2,30],[i-2,r]]);this.graph=h({nodes:s.alluvial.nodes.map(g=>Object.assign({},g)),links:a.map(g=>Object.assign({},g))}),this.graph.nodes=this.graph.nodes.filter(g=>g.value!==0);const d={};this.graph.nodes.forEach(g=>{const v=g.x0;g.category&&(d[v]=g==null?void 0:g.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(d)).join("g").attr("transform",g=>`translate(${g}, 0)`).append("text").attr("id",(g,v)=>this.services.domUtils.generateElementIDString(`alluvial-category-${v}`)).style("font-size","14px").text(g=>d[g]?d[g]:"").attr("y",20).attr("x",(g,v)=>{const b=this.services.domUtils.generateElementIDString(`alluvial-category-${v}`),{width:w}=I.getSVGElementSize(P(`text#${b}`),{useBBox:!0});let O=0;return g+O>=w&&(O=-w+4),O});const f=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(f.exit().remove(),o){const g=E(this.getOptions(),"color","scale");g&&f.enter().append("linearGradient").attr("id",v=>`${this.gradient_id}-link-${v.index}`).attr("gradientUnits","userSpaceOnUse").call(v=>v.append("stop").attr("offset","0%").attr("stop-color",b=>g[b.source.name])).call(v=>v.append("stop").attr("offset","100%").attr("stop-color",b=>g[b.target.name])),f.exit().remove()}f.enter().append("path").classed("link",!0).attr("d",Z$()).attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-line-${g.index}`)).attr("class",g=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[J.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[J.STROKE],dataGroupName:g.source.index,originalClassName:"link"})).style("stroke",g=>o?`url(#${this.gradient_id}-link-${g.index})`:this.model.getFillColor(g.source.name)).attr("stroke-width",g=>Math.max(1,g.width)).style("stroke-opacity",ge.opacity.default).attr("aria-label",g=>`${g.source.name} → ${g.target.name} (${g.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const p=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-${g.index}`)).classed("node-group",!0).attr("transform",g=>`translate(${g.x0}, ${g.y0})`);p.append("rect").classed("node",!0).attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill","black");const m=p.append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${g.index}`));m.append("text").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${g.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(g=>`${g.name} (${g.value})`).attr("aria-label",g=>`${g.name} (${g.value})`),m.append("rect").classed("node-text-bg",!0).attr("width",(g,v)=>{const b=this.services.domUtils.generateElementIDString(`alluvial-node-text-${v}`),{width:w}=I.getSVGElementSize(P(`text#${b}`),{useBBox:!0});return w+8}).attr("height",18).attr("stroke-width",2).lower(),m.attr("transform",(g,v)=>{const b=this.services.domUtils.generateElementIDString(`alluvial-node-text-${v}`),{width:w}=I.getSVGElementSize(P(`text#${b}`),{useBBox:!0}),O=(g.y1-g.y0)/2-9;let _=g.x1-g.x0;return g.x1>=w?_=_-(w+16):_+=4,`translate(${_}, ${O})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,i=va((r,s="mouseover")=>{const a=n.parent.selectAll("path.link").transition().call(o=>n.services.transitions.setupTransition({transition:o,name:"alluvial-links-mouse-highlight"}));s==="mouseout"?(P(r).lower(),a.style("stroke-opacity",ge.opacity.default)):a.style("stroke-opacity",function(){return r===this?(P(this).raise(),ge.opacity.selected):ge.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(r,s){const a=P(this);i(this,"mouseover"),a.classed("link-hovered",!0);const o=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(C.Alluvial.LINE_MOUSEOVER,{event:r,element:a,datum:s}),n.services.events.dispatchEvent(C.Tooltip.SHOW,{event:r,hoveredElement:a,items:[{label:s.target.name,value:s.value+(t.alluvial.units?` ${t.alluvial.units}`:""),color:o,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(r,s){n.services.events.dispatchEvent(C.Alluvial.LINE_MOUSEMOVE,{event:r,element:P(this),datum:s}),n.services.events.dispatchEvent(C.Tooltip.MOVE,{event:r})}).on("click",function(r,s){n.services.events.dispatchEvent(C.Alluvial.LINE_CLICK,{event:r,element:P(this),datum:s})}).on("mouseout",function(r,s){const a=P(this);i(this,"mouseout"),a.classed("link-hovered",!1),n.services.events.dispatchEvent(C.Alluvial.LINE_MOUSEOUT,{event:r,element:a,datum:s}),n.services.events.dispatchEvent(C.Tooltip.HIDE,{event:r,hoveredElement:a})})}addNodeEventListener(){const t=this,n=va((i=[],r="mouseover")=>{if(r==="mouseout"||i.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,s=>s.index).order().style("stroke-opacity",ge.opacity.default);return}t.parent.selectAll("path.link").transition().call(s=>this.services.transitions.setupTransition({transition:s,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(s){return i.some(a=>a===s.index)?(P(this).classed("link-hovered",!0).raise(),ge.opacity.selected):ge.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(i,r){const s=P(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},r,a),t.traverse({link:"targetLinks",node:"source"},r,a),a.length){const o=Mr(s.attr("transform"));if(s.attr("transform",`translate(${o.x-2}, ${o.y})`),s.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),r.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${r.index}`),u=t.parent.select(`g#${l}`),h=Mr(u.attr("transform"));u.attr("transform",`translate(${h.x+4},${h.y})`)}const c=t.services.domUtils.generateElementIDString(`alluvial-node-text-${r.index}`);t.parent.select(`text#${c}`).style("font-weight","bold"),n(a,"mouseover"),t.services.events.dispatchEvent(C.Alluvial.NODE_MOUSEOVER,{event:i,element:s,datum:r})}}).on("mousemove",function(i,r){t.services.events.dispatchEvent(C.Alluvial.NODE_MOUSEMOVE,{event:i,element:P(this),datum:r}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(C.Alluvial.NODE_CLICK,{event:i,element:P(this),datum:r})}).on("mouseout",function(i,r){const s=P(this),a=Mr(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",ge.nodeWidth),r.x0-2===0){const c=t.services.domUtils.generateElementIDString(`alluvial-node-title-${r.index}`),l=t.parent.select(`g#${c}`),u=Mr(l.attr("transform"));l.attr("transform",`translate(${u.x-4},${u.y})`)}const o=t.services.domUtils.generateElementIDString(`alluvial-node-text-${r.index}`);t.parent.select(`text#${o}`).style("font-weight","normal"),n([],"mouseout"),t.services.events.dispatchEvent(C.Alluvial.NODE_MOUSEOUT,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,i=[]){n[t.link].map(r=>(i.push(r.index),r[t.node])).forEach(r=>this.traverse(t,r,i))}getRightArrowIcon(){return`
71
+ </li>`).join("")+"</ul>"}valueFormatter(t,n){const i=this.getOptions(),r=E(i,"tooltip","valueFormatter");if(r)return r(t,n);if(typeof t.getTime=="function")return pi(t,"MMM d, yyyy");try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t))return pi(Date.parse(t),"MMM d, yyyy")}catch{}return t.toLocaleString()}render(t=!0){const n=this.getOptions(),i=E(n,"tooltip","enabled");if(i){const r=P(this.services.domUtils.getHolder()),s=E(n,"style","prefix");this.tooltip=R.appendOrSelect(r,`div.${ne}--${s}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!i&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}positionTooltip(t){const n=this.services.domUtils.getHolder(),i=this.tooltip.node(),r=this.getOptions(),s=E(r,"zoomBar","top","enabled");let a=E(t,"detail","mousePosition");if(!a)a=wn(E(t,"detail","event"),n);else{const d=E(r,"zoomBar","top","type"),f=ce.height[d];s&&(a[1]+=f+ce.spacerHeight)}const o=n.offsetWidth,c=n.offsetHeight;let l;a[0]/o>.9?l=zt.LEFT:a[0]/o<.1?l=zt.RIGHT:l=this.positionService.findBestPlacementAt({left:a[0],top:a[1]},i,[zt.RIGHT,zt.LEFT,zt.TOP,zt.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:c}));let{horizontalOffset:u}=RS;l===zt.LEFT&&(u*=-1);const h=this.positionService.findPositionAt({left:a[0]+u,top:a[1]},i,l);this.positionService.setElement(i,h)}}const $a=class extends ht{constructor(){super(...arguments),this.type="grid-brush",this.renderType=K.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,i=this.getComponentContainer();if(!n)throw new Error("SVG was not defined");const r=R.appendOrSelect(n,"svg.chart-grid-backdrop"),s=R.appendOrSelect(r,`g.${this.type}`),a=R.appendOrSelect(s,this.selectionSelector),{width:o,height:c}=R.getSVGElementSize(r,{useAttrs:!0}),{cartesianScales:l}=this.services,u=l.getMainXScaleType(),h=l.getMainXScale(),[d]=h.range();i.attr("transform",`translate(${d},0)`);const f=R.appendOrSelect(i,this.frontSelectionSelector);if(h&&u===Z.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const m=_=>{const T=_[1]-_[0];let S="0,"+T.toString();const $=Math.floor(c/$a.DASH_LENGTH),D=$*$a.DASH_LENGTH;for(let L=0;L<$;L++)S+=","+$a.DASH_LENGTH;S+=","+(c-D),$%2===1&&(S+=",0"),S+=","+T.toString(),S+=","+c.toString(),f.attr("stroke-dasharray",S)},g=_=>{const T=_.selection;T===null||T[0]===T[1]||(f.attr("x",parseFloat(a.attr("x"))+parseFloat(r.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),m(T))},v=(_,T)=>{const S=ud().range([0,o]).domain(p);let $=[S.invert(_),S.invert(T)];$[0].valueOf()===$[1].valueOf()&&($=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==$[0].valueOf()||p[1].valueOf()!==$[1].valueOf())&&this.services.zoom.handleDomainChange($)};let b;const w=_=>{const T=_.selection;T!==null&&(v(T[0],T[1]),s.call(b.move,null),f.style("display","none"))};c!=0&&o!=0&&(b=Mu().extent([[0,0],[o-1,c]]).on("start brush end",g).on("end.brushed",w),s.call(b));const O=this.services.zoom.getZoomRatio();r.on("click",function(_){if(_.shiftKey){const T=this.services.domUtils.getHolder(),S=wn(s.node(),T)[0];let $=S-o*O/2;$<0&&($=0);let D=S+o*O/2;D>o&&(D=o),v($,D)}})}}};let Vg=$a;Vg.DASH_LENGTH=4;class Mk extends ht{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=K.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=Mu(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(C.ZoomBar.UPDATE,this.render.bind(this));const t=E(this.getOptions(),"zoomBar",H.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),i=this.services.zoom.isZoomBarLoading(H.TOP),r=this.services.zoom.isZoomBarLocked(H.TOP),s=E(this.getOptions(),"zoomBar",H.TOP,"type"),a=E(this.getOptions(),"axes",H.BOTTOM,"highlights"),o=ce.height[s],{width:c}=R.getSVGElementSize(this.parent,{useAttrs:!0});if(c===0)return;let l=0;const u=this.model.get("axesMargins");u&&u.left&&(l=u.left);const h=R.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(R.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",ce.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ie.GRAPH_VIEW?R.appendOrSelect(h,"rect.zoom-bg").attr("x",l).attr("y",0).attr("width",c-l).attr("height","100%").classed("zoom-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Ie.SLIDER_VIEW&&R.appendOrSelect(h,"rect.zoom-slider-bg").attr("x",l).attr("y",o/2-1).attr("width",c-l).attr("height",2).classed("zoom-slider-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),i){this.renderSkeleton(h,l,c);return}const{cartesianScales:d}=this.services,f=d.getMainXScale(),p=d.getMainYScale(),m=d.getMainXScaleType();if(f&&m===Z.TIME){let g=this.services.zoom.getZoomBarData();if(Ce(g)||g.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const v=this.services.zoom.getDefaultZoomBarDomain(g);g=this.compensateDataForDefaultDomain(g,v);const b=this.model.get("initialZoomDomain"),w=E(this.getOptions(),"zoomBar",H.TOP,"initialZoomDomain");w&&w[0]&&w[1]&&(w[0]=new Date(w[0]),w[1]=new Date(w[1])),w&&!(b&&b[0].valueOf()===w[0].valueOf()&&b[1].valueOf()===w[1].valueOf())?this.model.set({initialZoomDomain:nt([],w),zoomDomain:w?nt([],w):v},{skipUpdate:!0}):w===null&&b!==null&&this.model.set({initialZoomDomain:null,zoomDomain:nt([],v)},{skipUpdate:!0}),this.xScale.range([l,c]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(ye(g,T=>T.value));const O=this.model.get("zoomDomain");if(s===Ie.GRAPH_VIEW&&(this.renderZoomBarArea(h,"path.zoom-graph-area-unselected",g,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(h,"path.zoom-graph-area",g,this.clipId),this.renderZoomBarBaseline(h,l,c),a)){const T=a.highlightStartMapsTo,S=a.highlightEndMapsTo,$=a.color,D=a.labelMapsTo;a.data.forEach((L,M)=>{R.appendOrSelect(h,`rect.highlight-${M}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(L[T])).attr("width",this.xScale(L[S])-this.xScale(L[T])).style("fill",$&&$.scale[L[D]]?$.scale[L[D]]:null).style("fill-opacity",.1).style("stroke",$&&$.scale[L[D]]?$.scale[L[D]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(O,l,c);const _=R.appendOrSelect(n,this.brushSelector).call(this.brush);if(O!==void 0)if(O[0].valueOf()===O[1].valueOf())_.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const T=O.map(S=>this.xScale(S));T[1]-T[0]<this.MIN_SELECTION_DIFF||(_.call(this.brush.move,T),this.updateBrushHandle(this.getComponentContainer(),T))}r&&(this.brush.filter(()=>!1),_.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,i){const r=o=>{const c=o.selection;c===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):c[0]===c[1]||this.handleBrushedEvent(o,t,this.xScale,c)},s=E(this.getOptions(),"zoomBar",H.TOP,"type"),a=ce.height[s];this.brush.extent([[n,0],[i,a]]).on("start brush end",null).on("start brush end",r)}handleBrushedEvent(t,n,i,r){const s=[i.invert(r[0]),i.invert(r[1])];if(this.updateBrushHandle(this.getComponentContainer(),r),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1});let a;t.type==="start"?a=C.ZoomBar.SELECTION_START:t.type==="brush"?a=C.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=C.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(C.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:r,newDomain:s})}}updateBrushHandle(t,n){const i=this,r=ce.handleWidth,s=E(this.getOptions(),"zoomBar",H.TOP,"type"),a=ce.height[s],o=-r/2,c=ce.handleBarWidth,l=s===Ie.GRAPH_VIEW?ce.handleBarHeight:6,u=-c/2,h=(a-l)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(f){if(f.type==="w")return Math.max(n[0]+o,i.maxSelectionRange[0]);if(f.type==="e")return Math.min(n[1]+o,i.maxSelectionRange[1]-r)}).attr("y",0).attr("width",r).attr("height",a).attr("cursor","ew-resize").style("display",null);const d=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);d.enter().append("rect").attr("class",function(f){return"handle-bar handle-bar--"+f.type}),d.attr("x",function(f){if(f.type==="w")return Math.max(n[0]+u,i.maxSelectionRange[0]-o+u);if(f.type==="e")return Math.min(n[1]+u,i.maxSelectionRange[1]+o+u)}).attr("y",h).attr("width",c).attr("height",l).attr("cursor","ew-resize"),s===Ie.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=E(this.getOptions(),"zoomBar",H.TOP,"type"),i=ce.height[n],r=this.getComponentContainer().select("svg.zoom-container");R.appendOrSelect(r,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",i/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,i,r){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),c=s.getMainXScaleType(),l=s.getMainYScaleType(),u=(v,b,w)=>O=>s.getValueFromScale(v,b,w,O),h=u(this.xScale,c,a),d=u(this.yScale,l,o),f=E(this.getOptions(),"zoomBar",H.TOP,"type"),p=ce.height[f],m=rl().x(v=>h(v)).y0(p).y1(v=>p-d(v)),g=R.appendOrSelect(t,n).datum(i).attr("d",m);r&&g.attr("clip-path",`url(#${r})`)}updateClipPath(t,n,i,r,s,a){const o=R.appendOrSelect(t,"clipPath").attr("id",n);R.appendOrSelect(o,"rect").attr("x",i).attr("y",r).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const i=nn(t),r=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(i[0][r])){const a={};a[r]=n[0],a[s]=0,i.unshift(a)}if(Number(n[1])>Number(i[i.length-1][r])){const a={};a[r]=n[1],a[s]=0,i.push(a)}return i}renderZoomBarBaseline(t,n,i,r=!1){const s=E(this.model.getOptions(),"zoomBar",H.TOP,"type"),a=ce.height[s],o=lr()([[n,a],[i,a]]);R.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,i){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),R.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),E(this.getOptions(),"zoomBar",H.TOP,"type")===Ie.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,i,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(C.ZoomBar.UPDATE,this.render.bind(this))}}class Ck extends ht{constructor(t,n){super(t,n),this.type="threshold",this.renderType=K.SVG,this.positionService=new Aa}render(t=!1){const n=E(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(l=>{if(Object.values(H).includes(l)){const u=n[l];u.thresholds&&u.thresholds.length>0&&i.push({axisPosition:l,thresholds:u.thresholds,correspondingDatasets:u==null?void 0:u.correspondingDatasets,mapsTo:u==null?void 0:u.mapsTo})}});const r=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(i,l=>l.axisPosition);r.exit().attr("opacity",0).remove();const s=r.enter().append("g").merge(r);s.attr("class",l=>`axis-thresholds ${l.axisPosition}`);const a=s.selectAll("g.threshold-group").data(l=>l.thresholds.map(u=>(u.axisPosition=l.axisPosition,u.datum=this.constructDatumObj(l,u),u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(a).attr("class","threshold-group");const c=this;s.each(function({axisPosition:l}){const u=c.services.cartesianScales.getScaleByPosition(l),h=c.services.cartesianScales.getScaleTypeByPosition(l);let d=null,f=null;l===H.LEFT||l===H.RIGHT?(f=u,d=c.services.cartesianScales.getMainXScale()):(d=u,f=c.services.cartesianScales.getMainYScale());const p=h===Z.LABELS,[m,g]=d.range(),[v,b]=f.range(),{cartesianScales:w}=c.services,O=w.getOrientation(),_=L=>w.getDomainValue(L),T=L=>w.getRangeValue(L),[S,$]=sn(_,T,O),D=P(this);l===H.TOP||l===H.BOTTOM?(D.selectAll("line.threshold-line").transition().call(L=>c.services.transitions.setupTransition({transition:L,name:"threshold-line-update",animate:t})).attr("y1",b).attr("y2",v).attr("x1",({datum:L})=>S(L)+(p?u.step()/2:0)).attr("x2",({datum:L})=>S(L)+(p?u.step()/2:0)).style("stroke",({fillColor:L})=>L),D.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:L})=>-S(L)).attr("width",Math.abs(v-b)).classed("rotate",!0)):(D.selectAll("line.threshold-line").transition().call(L=>c.services.transitions.setupTransition({transition:L,name:"threshold-line-update",animate:t})).attr("x1",m).attr("x2",g).attr("y1",({datum:L})=>$(L)+(p?u.step()/2:0)).attr("y2",({datum:L})=>$(L)+(p?u.step()/2:0)).style("stroke",({fillColor:L})=>L),D.selectAll("rect.threshold-hoverable-area").attr("x",m).attr("y",({datum:L})=>$(L)).attr("width",Math.abs(g-m)).classed("rotate",!1))}),this.services.events.addEventListener(C.Threshold.SHOW,l=>{this.setThresholdLabelPosition(l.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(C.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:i}=t,r=this.getOptions();if(this.services.cartesianScales.getScaleTypeByPosition(i)===Z.TIME){const s=[H.LEFT,H.RIGHT].includes(i),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),c=s?o:a,l=E(r,"timeScale"),u=Gl(c.ticks(),E(l,"timeInterval"));return Vl(n,0,c.ticks(),u,l)}return n.toLocaleString("en")}appendThresholdLabel(){const t=P(this.services.domUtils.getHolder()),n=E(this.getOptions(),"style","prefix");this.label=R.appendOrSelect(t,`div.${ne}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const i=this.services.domUtils.getHolder(),r=wn(t,i),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(`${n.label||"Threshold"}: ${s}`).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:r[0],top:r[1]},a,[zt.RIGHT,zt.LEFT,zt.TOP,zt.BOTTOM],()=>({top:void 0,left:void 0,width:i.offsetWidth,height:i.offsetHeight})),c=this.positionService.findPositionAt({left:r[0],top:r[1]},a,o);this.positionService.setElement(a,c)}constructDatumObj(t,n){const i={};return t.correspondingDatasets&&(i.group=E(t,"correspondingDatasets",0)),i[t.mapsTo]=n.value,i}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){P(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(C.Threshold.SHOW,{event:n,hoveredElement:P(this),datum:P(this).datum()})}).on("mouseout",function(n){P(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(C.Threshold.HIDE,{event:n,hoveredElement:P(this),datum:P(this).datum()})})}}class Ak extends ht{constructor(t,n){super(t,n),this.type="highlight",this.renderType=K.SVG,this.positionService=new Aa,this.highlightStrokeWidth=1}render(t=!1){const n=E(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(l=>{if(Object.values(H).includes(l)){const u=n[l];u.highlights&&u.highlights.data.length>0&&i.push({axisPosition:l,highlightStartMapsTo:u.highlights.highlightStartMapsTo,highlightEndMapsTo:u.highlights.highlightEndMapsTo,labelMapsTo:u.highlights.labelMapsTo,highlight:u.highlights.data,color:u.highlights.color})}});const r=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(i,l=>l.axisPosition);r.exit().attr("opacity",0).remove();const s=r.enter().append("g").merge(r);s.attr("class",l=>`axis-highlight ${l.axisPosition}`);const a=s.selectAll("g.highlight-group").data(l=>l.highlight.map(u=>(u.axisPosition=l.axisPosition,u.highlightStartMapsTo=l.highlightStartMapsTo,u.labelMapsTo=l.labelMapsTo,u.color=l.color,u.highlightEndMapsTo=l.highlightEndMapsTo,u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(a).attr("class","highlight-group");const c=this;s.each(function({axisPosition:l}){const u=c.services.cartesianScales.getMainXScale(),h=c.services.cartesianScales.getMainYScale(),[d,f]=u.range(),[p,m]=h.range(),{cartesianScales:g}=c.services,v=g.getOrientation(),b=S=>g.getDomainValue(S),w=S=>g.getRangeValue(S),[O,_]=sn(b,w,v),T=P(this);l===H.TOP||l===H.BOTTOM?T.selectAll("rect.highlight-bar").transition().call(S=>c.services.transitions.setupTransition({transition:S,name:"highlight-bar-update",animate:t})).attr("y",Math.max(m+c.highlightStrokeWidth,0)).attr("height",Math.max(p-2*c.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:S,...$})=>O($[S])).attr("width",({highlightStartMapsTo:S,highlightEndMapsTo:$,...D})=>Math.max(O(D[$])-O(D[S]),0)).style("stroke",({color:S,labelMapsTo:$,...D})=>S&&S.scale[D[$]]?S.scale[D[$]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",c.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:S,labelMapsTo:$,...D})=>S&&S.scale[D[$]]?S.scale[D[$]]:null):T.selectAll("rect.highlight-bar").transition().call(S=>c.services.transitions.setupTransition({transition:S,name:"highlight-bar-update",animate:t})).attr("x",d).attr("width",Math.max(f-d,0)).attr("y",({highlightEndMapsTo:S,...$})=>_($[S])).attr("height",({highlightStartMapsTo:S,highlightEndMapsTo:$,...D})=>Math.max(_(D[S])-_(D[$]),0)).style("stroke",({color:S,labelMapsTo:$,...D})=>S&&S.scale[D[$]]?S.scale[D[$]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",c.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:S,labelMapsTo:$,...D})=>S&&S.scale[D[$]]?S.scale[D[$]]:null)})}}class Gg extends gc{getItems(t){if(t.detail.items)return t.detail.items;const n=t.detail.data;if(!n.length||!n[0])return[];const i=this.getOptions(),{cartesianScales:r}=this.services,s=r.getDomainIdentifier(),a=r.isDualAxes(),{groupMapsTo:o}=i.data,c=r.getDomainLabel();let l=r.getRangeLabel();const u=n[0][s];let h;if(n.length===1){const d=n[0],f=r.getRangeIdentifier(d);if(a){const m=r.getRangeAxisPosition({datum:d,groups:[d[o]]});l=r.getScaleLabel(m)}const p=d[f];h=[{label:c,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:l,value:d[f]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(m=>h.push({label:m.label,value:m.value})),h.push({label:i.tooltip.groupLabel,value:d[o],color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[J.TOOLTIP],dataGroupName:d[o]})})}else if(n.length>1&&(h=[{label:c,value:u}],h=h.concat(n.map(d=>{const f=d[r.getRangeIdentifier(d)];return{label:d[o],value:Array.isArray(f)&&f.length===2?`${f[0]} - ${f[1]}`:f,color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[J.TOOLTIP],dataGroupName:d[o]})}}).sort((d,f)=>f.value-d.value)),!a&&E(i,"tooltip","showTotal")===!0)){const d=r.getRangeIdentifier();h.push({label:St(i,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[d],0),bold:!0})}return h}}class $k extends ht{constructor(){super(...arguments),this.type="alluvial",this.renderType=K.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.html("");const{width:i,height:r}=R.getSVGElementSize(n,{useAttrs:!0});if(i<1||r<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=E(this.getOptions(),"color","gradient","enabled");let c=Oe.minNodePadding;s.alluvial.nodePadding>Oe.minNodePadding&&(c=s.alluvial.nodePadding);const l=E(s,"alluvial","nodeAlignment");let u=Yp;l===It.LEFT?u=L$:l===It.RIGHT&&(u=D$);const h=P$().nodeId(g=>g.name).nodeWidth(Oe.nodeWidth).nodePadding(c).nodeAlign(u).extent([[2,30],[i-2,r]]);this.graph=h({nodes:s.alluvial.nodes.map(g=>Object.assign({},g)),links:a.map(g=>Object.assign({},g))}),this.graph.nodes=this.graph.nodes.filter(g=>g.value!==0);const d={};this.graph.nodes.forEach(g=>{const v=g.x0;g.category&&(d[v]=g==null?void 0:g.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(d)).join("g").attr("transform",g=>`translate(${g}, 0)`).append("text").attr("id",(g,v)=>this.services.domUtils.generateElementIDString(`alluvial-category-${v}`)).style("font-size","14px").text(g=>d[g]?d[g]:"").attr("y",20).attr("x",(g,v)=>{const b=this.services.domUtils.generateElementIDString(`alluvial-category-${v}`),{width:w}=R.getSVGElementSize(P(`text#${b}`),{useBBox:!0});let O=0;return g+O>=w&&(O=-w+4),O});const f=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(f.exit().remove(),o){const g=E(this.getOptions(),"color","scale");g&&f.enter().append("linearGradient").attr("id",v=>`${this.gradient_id}-link-${v.index}`).attr("gradientUnits","userSpaceOnUse").call(v=>v.append("stop").attr("offset","0%").attr("stop-color",b=>g[b.source.name])).call(v=>v.append("stop").attr("offset","100%").attr("stop-color",b=>g[b.target.name])),f.exit().remove()}f.enter().append("path").classed("link",!0).attr("d",Y$()).attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-line-${g.index}`)).attr("class",g=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[J.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[J.STROKE],dataGroupName:g.source.index,originalClassName:"link"})).style("stroke",g=>o?`url(#${this.gradient_id}-link-${g.index})`:this.model.getFillColor(g.source.name)).attr("stroke-width",g=>Math.max(1,g.width)).style("stroke-opacity",Oe.opacity.default).attr("aria-label",g=>`${g.source.name} → ${g.target.name} (${g.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const p=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-${g.index}`)).classed("node-group",!0).attr("transform",g=>`translate(${g.x0}, ${g.y0})`);p.append("rect").classed("node",!0).attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill","black");const m=p.append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${g.index}`));m.append("text").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${g.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(g=>`${g.name} (${g.value})`).attr("aria-label",g=>`${g.name} (${g.value})`),m.append("rect").classed("node-text-bg",!0).attr("width",(g,v)=>{const b=this.services.domUtils.generateElementIDString(`alluvial-node-text-${v}`),{width:w}=R.getSVGElementSize(P(`text#${b}`),{useBBox:!0});return w+8}).attr("height",18).attr("stroke-width",2).lower(),m.attr("transform",(g,v)=>{const b=this.services.domUtils.generateElementIDString(`alluvial-node-text-${v}`),{width:w}=R.getSVGElementSize(P(`text#${b}`),{useBBox:!0}),O=(g.y1-g.y0)/2-9;let _=g.x1-g.x0;return g.x1>=w?_=_-(w+16):_+=4,`translate(${_}, ${O})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,i=va((r,s="mouseover")=>{const a=n.parent.selectAll("path.link").transition().call(o=>n.services.transitions.setupTransition({transition:o,name:"alluvial-links-mouse-highlight"}));s==="mouseout"?(P(r).lower(),a.style("stroke-opacity",Oe.opacity.default)):a.style("stroke-opacity",function(){return r===this?(P(this).raise(),Oe.opacity.selected):Oe.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(r,s){const a=P(this);i(this,"mouseover"),a.classed("link-hovered",!0);const o=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(C.Alluvial.LINE_MOUSEOVER,{event:r,element:a,datum:s}),n.services.events.dispatchEvent(C.Tooltip.SHOW,{event:r,hoveredElement:a,items:[{label:s.target.name,value:s.value+(t.alluvial.units?` ${t.alluvial.units}`:""),color:o,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(r,s){n.services.events.dispatchEvent(C.Alluvial.LINE_MOUSEMOVE,{event:r,element:P(this),datum:s}),n.services.events.dispatchEvent(C.Tooltip.MOVE,{event:r})}).on("click",function(r,s){n.services.events.dispatchEvent(C.Alluvial.LINE_CLICK,{event:r,element:P(this),datum:s})}).on("mouseout",function(r,s){const a=P(this);i(this,"mouseout"),a.classed("link-hovered",!1),n.services.events.dispatchEvent(C.Alluvial.LINE_MOUSEOUT,{event:r,element:a,datum:s}),n.services.events.dispatchEvent(C.Tooltip.HIDE,{event:r,hoveredElement:a})})}addNodeEventListener(){const t=this,n=va((i=[],r="mouseover")=>{if(r==="mouseout"||i.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,s=>s.index).order().style("stroke-opacity",Oe.opacity.default);return}t.parent.selectAll("path.link").transition().call(s=>this.services.transitions.setupTransition({transition:s,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(s){return i.some(a=>a===s.index)?(P(this).classed("link-hovered",!0).raise(),Oe.opacity.selected):Oe.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(i,r){const s=P(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},r,a),t.traverse({link:"targetLinks",node:"source"},r,a),a.length){const o=Mr(s.attr("transform"));if(s.attr("transform",`translate(${o.x-2}, ${o.y})`),s.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),r.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${r.index}`),u=t.parent.select(`g#${l}`),h=Mr(u.attr("transform"));u.attr("transform",`translate(${h.x+4},${h.y})`)}const c=t.services.domUtils.generateElementIDString(`alluvial-node-text-${r.index}`);t.parent.select(`text#${c}`).style("font-weight","bold"),n(a,"mouseover"),t.services.events.dispatchEvent(C.Alluvial.NODE_MOUSEOVER,{event:i,element:s,datum:r})}}).on("mousemove",function(i,r){t.services.events.dispatchEvent(C.Alluvial.NODE_MOUSEMOVE,{event:i,element:P(this),datum:r}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(C.Alluvial.NODE_CLICK,{event:i,element:P(this),datum:r})}).on("mouseout",function(i,r){const s=P(this),a=Mr(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",Oe.nodeWidth),r.x0-2===0){const c=t.services.domUtils.generateElementIDString(`alluvial-node-title-${r.index}`),l=t.parent.select(`g#${c}`),u=Mr(l.attr("transform"));l.attr("transform",`translate(${u.x-4},${u.y})`)}const o=t.services.domUtils.generateElementIDString(`alluvial-node-text-${r.index}`);t.parent.select(`text#${o}`).style("font-weight","normal"),n([],"mouseout"),t.services.events.dispatchEvent(C.Alluvial.NODE_MOUSEOUT,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,i=[]){n[t.link].map(r=>(i.push(r.index),r[t.node])).forEach(r=>this.traverse(t,r,i))}getRightArrowIcon(){return`
72
72
  <svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
73
73
  <polygon points="18 6 16.57 7.393 24.15 15 4 15 4 17 24.15 17 16.57 24.573 18 26 28 16 18 6"/>
74
74
  <rect width="32" height="32"/>
75
- </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class he extends ht{constructor(){super(...arguments),this.type="grid",this.renderType=K.SVG}render(t=!0){const n=E(this.getOptions(),"grid","x","enabled"),i=E(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,i),!(!n&&!i)&&(n&&(I.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),i&&(I.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,i=this.backdrop.attr("height"),r=this.services.cartesianScales.getMainXScale(),s=Ua(r).tickSizeInner(-i).tickSizeOuter(0);if(E(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),c=E(this.getOptions(),"axes",o,"ticks","values");c&&s.tickValues(c)}else{const o=E(this.getOptions(),"grid","x","numberOfTicks");s.ticks(o)}const a=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${i})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}drawYGrid(t){const n=this.parent,i=this.backdrop.attr("width"),r=this.services.cartesianScales.getMainYScale(),s=Nc(r).tickSizeInner(-i).tickSizeOuter(0);if(E(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),c=E(this.getOptions(),"axes",o,"ticks","values");c&&s.tickValues(c)}else{const o=E(this.getOptions(),"grid","y","numberOfTicks");s.ticks(o)}const a=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}getGridlineThreshold(t){const n=this.parent,i=n.selectAll(".x.grid .tick").nodes().sort((u,h)=>Number(rn(u).tx)-Number(rn(h).tx));let r=-1;if(!i.length)return;i.forEach(u=>{t[0]>=+rn(u).tx&&r++});const s=r+1<i.length?r+1:i.length,a=i[r],o=i[s];let c;if(!a)c=+rn(o).tx;else if(o)c=+rn(o).tx-+rn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();c=I.getSVGElementSize(u).width-+rn(a).tx}const{threshold:l}=this.getOptions().tooltip.gridline;return c*l}getActiveGridline(t){const n=E(this.getOptions,"tooltip","gridline","threshold"),i=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const r=rn(this),s={min:Number(r.tx)-i,max:Number(r.tx)+i};return s.min<=t[0]&&t[0]<=s.max})}drawBackdrop(t,n){const i=this.parent,r=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=r.range(),[c,l]=s.range();this.backdrop=I.appendOrSelect(i,"svg.chart-grid-backdrop");const u=I.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",l).attr("width",Math.abs(o-a)).attr("height",Math.abs(c-l)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class Xg extends ht{constructor(){super(...arguments),this.type="area",this.renderType=K.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-area"})).attr("opacity",i=>i.name!==n.datum().name?Pe.opacity.unselected:Pe.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",Pe.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions();let r=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=rl().curve(this.services.curves.getD3Curve()).defined(_=>{const T=s.getRangeIdentifier();return _[T]!=null}),c=this.model.getGroupedData(this.configs.groups),l=E(i,"bounds"),u=l&&c&&c.length===1;!u&&l&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${c.length}`);let h=0;const d=(_,T)=>{E(i,"axes",_,"includeZero")===!1&&T[0]>0&&T[1]>0&&(h=T[0])},f=_=>u?s.getBoundedScaledValues(_)[0]:s.getRangeValue(h),p=_=>u?s.getBoundedScaledValues(_)[1]:s.getRangeValue(_);a===Ht.VERTICAL?(r=s.getMainYScale().domain(),d(s.getMainYAxisPosition(),r),o.x(_=>s.getDomainValue(_)).y0(_=>f(_)).y1(_=>p(_))):(r=s.getMainXScale().domain(),d(s.getMainXAxisPosition(),r),o.x0(_=>f(_)).x1(_=>p(_)).y(_=>s.getDomainValue(_)));const m=E(i,"color","gradient","enabled"),g=c&&c.length===1&&m;c.length>1&&m&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(c,_=>_.name),b=P(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!c.length)return;if(g){const _=b.select(`path.${this.model.getColorClassName({classNameTypes:[J.STROKE],dataGroupName:c[0].name})}`).node();let T;if(_)T=getComputedStyle(_,null).getPropertyValue("stroke");else{const S=E(this.model.getOptions(),"color","scale");if(S!==null){const $=Object.keys(S);T=S[$[0]]}}Zl.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${c[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:Zl.getStops(r,T)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const w=this,O=v.enter().append("path");g?O.merge(v).style("fill",_=>`url(#${this.services.domUtils.generateElementIDString(`${_.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:_.name,originalClassName:"area"})).attr("d",_=>{const{data:T}=_;return o(T)}):(O.attr("opacity",0).merge(v).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[J.FILL,J.STROKE],dataGroupName:_.name,originalClassName:"area"})).style("fill",_=>w.model.getFillColor(_.name)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"area-update-enter",animate:t})).attr("opacity",u?1:Pe.opacity.selected).attr("d",_=>{const{data:T}=_;return o(T)}),u&&O.attr("fill-opacity",Pe.opacity.selected).style("stroke",_=>w.model.getStrokeColor(_.name)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Mi extends ht{constructor(){super(...arguments),this.type="line",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-line"})).attr("opacity",i=>i.name!==n.datum().name?Ne.opacity.unselected:Ne.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",Ne.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:i,curves:r}=this.services,s=f=>i.getDomainValue(f),a=f=>i.getRangeValue(f),[o,c]=sn(s,a,i.getOrientation()),l=this.getOptions(),u=lr().x(o).y(c).curve(r.getD3Curve()).defined(f=>{const p=i.getRangeIdentifier(f);return f[p]!=null});let h=[];if(this.configs.stacked){const f=Object.keys(l.axes).some(m=>l.axes[m].percentage),{groupMapsTo:p}=l.data;h=this.model.getStackedData({groups:this.configs.groups,percentage:f}).map(m=>{const g=this.services.cartesianScales.getDomainIdentifier(m),v=this.services.cartesianScales.getRangeIdentifier(m);return{name:E(m,0,p),data:m.map(b=>({[g]:b.data.sharedStackKey,[p]:b[p],[v]:b[1]})),hidden:!pD(m,b=>b[0]!==b[1])}})}else h=this.model.getGroupedData(this.configs.groups);const d=n.selectAll("path.line").data(h,f=>f.name);d.exit().attr("opacity",0).remove(),d.enter().append("path").classed("line",!0).attr("opacity",0).merge(d).data(h,f=>f.name).attr("class",f=>this.model.getColorClassName({classNameTypes:[J.STROKE],dataGroupName:f.name,originalClassName:"line"})).style("stroke",f=>this.model.getStrokeColor(f.name)).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",f=>{const{data:p}=f;return p.map(m=>{const g=this.services.cartesianScales.getRangeIdentifier(m);return m[g]}).join(",")}).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"line-update-enter",animate:t})).attr("opacity",f=>f.hidden?0:1).attr("d",f=>{const{data:p}=f;return u(p)})}destroy(){const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const Zg=5;function kk(e,t){return e>t-Zg&&e<t+Zg}let vn=class extends ht{constructor(){super(...arguments),this.type="ruler",this.renderType=K.SVG,this.isXGridEnabled=E(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=E(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!0){const n=E(this.getOptions(),"ruler","enabled");this.drawBackdrop(),n&&!this.isEventListenerAdded?this.addBackdropEventListeners():!n&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,i]){const r=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[c,l]=o.range(),u=s===Ht.HORIZONTAL?i:n,h=I.appendOrSelect(r,"g.ruler").attr("aria-label","ruler"),d=I.appendOrSelect(h,"line.ruler-line"),f=r.selectAll("[role=graphics-symbol]"),p=a.map(g=>({domainValue:this.services.cartesianScales.getDomainValue(g),originalData:g})).filter(g=>kk(g.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(g=>g.domainValue).join()===this.pointsWithinLine.map(g=>g.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(C.Tooltip.MOVE,{mousePosition:[n,i]});this.pointsWithinLine=p;const m=this.pointsWithinLine.reduce((g,v)=>{if(g.length===0)return g.push(v),g;const b=g[0].domainValue,w=Math.abs(u-v.domainValue),O=Math.abs(u-b);return w>O||(w<O?g=[v]:g.push(v)),g},[]);if(m.length>0){const g=m.map(O=>O.originalData).filter(O=>{const _=this.services.cartesianScales.getRangeIdentifier(O);return O[_]!=null}),v=m.map(O=>O.domainValue),b=f.filter(O=>{const _=this.services.cartesianScales.getDomainValue(O);return v.includes(_)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!$g(this.elementsToHighlight,b)&&this.hideRuler(),b.dispatch("mouseover"),this.elementsToHighlight=b,this.services.events.dispatchEvent(C.Tooltip.SHOW,{mousePosition:[n,i],hoveredElement:d,data:this.formatTooltipData(g)}),h.attr("opacity",1);const w=m[0];s==="horizontal"?d.attr("x1",l).attr("x2",c).attr("y1",w.domainValue).attr("y2",w.domainValue):d.attr("y1",l).attr("y2",c).attr("x1",w.domainValue).attr("x2",w.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=I.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(C.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),i=this.model.getDisplayData();let r=function(s){const a=wn(s,t.parent.node());t.showRuler(s,a)};if(i.length>100){const s=i.length%50*12.5;r=yA(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",r).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=I.appendOrSelect(t,"svg.chart-grid-backdrop")}};class He extends ht{constructor(){super(...arguments),this.type="scatter",this.renderType=K.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(r=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:r,name:"legend-hover-scatter"})}).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(C.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(C.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const i=n.getDomainIdentifier(t),r=this.model.get("zoomDomain");return r!==void 0?t.filter(s=>s[i].getTime()>=r[0].getTime()&&s[i].getTime()<=r[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let i;if(n){const r=Object.keys(t.axes).some(s=>t.axes[s].percentage);i=this.model.getStackedData({groups:this.configs.groups,percentage:r})}else{const{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales are undefined.");i=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=r.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(i)}render(t){if(!(E(this.getOptions(),"points","enabled")||E(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:r}=i.data,{cartesianScales:s}=this.services;if(!s)throw new Error("Services cartesianScales are undefined.");const a=s.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),l=>`${l[r]}-${l[a]}`);o.exit().attr("opacity",0).remove();const c=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(c,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:i}=this.services;if(!i)throw new Error("Cartesian scales service is undefined");const r=i.getOrientation(),[s,a]=sn(i.getHighestDomainThreshold(),i.getHighestRangeThreshold(),r),[o,c]=sn(h=>i.getDomainValue(h),h=>i.getRangeValue(h),r),l=o(t),u=c(t);return a&&s?u<=a.scaleValue&&l>=s.scaleValue:a?u<=a.scaleValue:s?l>=s.scaleValue:!1}styleCircles(t,n){const i=this.getOptions(),{filled:r,fillOpacity:s}=i.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=i.data,c=f=>a.getDomainValue(f),l=f=>a.getRangeValue(f),[u,h]=sn(c,l,a.getOrientation()),{fadeInOnChartHolderMouseover:d}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),m=this.model.getIsFilled(f[o],f[p],f,r)?[J.FILL,J.STROKE]:[J.STROKE];return this.model.getColorClassName({classNameTypes:m,dataGroupName:f[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",f=>this.isDatapointThresholdAnomaly(f)).classed("filled",f=>{const p=a.getDomainIdentifier(f);return this.model.getIsFilled(f[o],f[p],f,r)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,r)}).transition().call(f=>{var p;return(p=this.services.transitions)==null?void 0:p.setupTransition({transition:f,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",h).attr("r",i.points.radius).style("fill",f=>{const p=a.getDomainIdentifier(f);if(this.model.getIsFilled(f[o],f[p],f,r))return this.model.getFillColor(f[o],f[p],f)}).style("stroke",f=>{const p=a.getDomainIdentifier(f);return this.model.getStrokeColor(f[o],f[p],f)}).attr("fill-opacity",r?s:1).attr("opacity",d?0:1).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",f=>{const p=a.getRangeIdentifier(f);return f[p]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(i,r){var s,a;const o=P(this);o.classed("hovered",!0).attr("class",c=>t.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:c[n],originalClassName:o.attr("class")})).style("fill",c=>{var l;const u=(l=t.services.cartesianScales)==null?void 0:l.getDomainIdentifier(c);return t.model.getFillColor(c[n],c[u],c)}).classed("unfilled",!1),(s=t.services.events)==null||s.dispatchEvent(C.Tooltip.SHOW,{event:i,hoveredElement:o,data:[r],additionalItems:t.getTooltipAdditionalItems(r)}),(a=t.services.events)==null||a.dispatchEvent(C.Scatter.SCATTER_MOUSEOVER,{event:i,element:o,datum:r})}).on("mousemove",function(i,r){var s,a;const o=P(this);(s=t.services.events)==null||s.dispatchEvent(C.Scatter.SCATTER_MOUSEMOVE,{event:i,element:o,datum:r}),(a=t.services.events)==null||a.dispatchEvent(C.Tooltip.MOVE,{event:i})}).on("click",function(i,r){var s;(s=t.services.events)==null||s.dispatchEvent(C.Scatter.SCATTER_CLICK,{event:i,element:P(this),datum:r})}).on("mouseout",function(i,r){var s,a,o;const c=P(this);if(c.classed("hovered",!1),!t.configs.filled){const{filled:l}=t.getOptions().points,u=(s=t.services.cartesianScales)==null?void 0:s.getDomainIdentifier(r),h=t.model.getIsFilled(r[n],r[u],r,l);c.classed("unfilled",!h).style("fill",d=>h||l?t.model.getFillColor(d[n],d[u],d):null)}(a=t.services.events)==null||a.dispatchEvent(C.Scatter.SCATTER_MOUSEOUT,{event:i,element:c,datum:r}),(o=t.services.events)==null||o.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:c})})}destroy(){var t;(t=this.parent)==null||t.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:n}=this.services;if(!n)throw new Error("Services events undefined");n.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(C.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(C.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}let Kg=class extends ht{constructor(t,n,i){super(t,n,i),this.type="axes",this.renderType=K.SVG,this.truncation={[H.LEFT]:!1,[H.RIGHT]:!1,[H.TOP]:!1,[H.BOTTOM]:!1},i&&(this.configs=i),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,i=this.getOptions(),r=E(i,"axes",n,"visible"),s=this.getComponentContainer(),{width:a,height:o}=I.getSVGElementSize(s,{useAttrs:!0}),c=I.appendOrSelect(s,`g.axis.${n}`);let l,u;if(n===H.BOTTOM||n===H.TOP?(l=this.configs.axes[H.LEFT]?this.margins.left:0,u=this.configs.axes[H.RIGHT]?a-this.margins.right:a):(l=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefineds");const h=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===Z.LABELS||this.scaleType===Z.LABELS_RATIO?h.rangeRound([l,u]):h.range([l,u]);let d;switch(n){case H.LEFT:d=Nc;break;case H.BOTTOM:d=Ua;break;case H.RIGHT:d=$v;break;case H.TOP:d=Av;break}c.attr("aria-label",`${n} axis`);const f=!c.select("g.ticks").empty();let p=I.appendOrSelect(c,"g.ticks");f||(p.attr("role",`${at.GRAPHICS_OBJECT} ${at.GROUP}`),p.attr("aria-label",`${n} ticks`));const m=I.appendOrSelect(c,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),g=E(i,"axes",n),v=this.scaleType===Z.TIME||g.scaleType===Z.TIME,b=n===H.LEFT||n===H.RIGHT,w=this.model.get("zoomDomain");if(w&&v&&!b&&h.domain(w),!r){p.attr("aria-hidden",!0);return}const O=E(g,"scaleType"),_=E(i,"data","loading"),T=E(g,"ticks","number"),S=E(g,"ticks","values"),$=E(g,"truncation","type"),D=E(g,"truncation","threshold"),L=E(g,"truncation","numCharacter"),M=T!==null,B=E(i,"timeScale"),x=I.appendOrSelect(m,"g.tick"),A=I.appendOrSelect(x,"text").text("0"),y=I.getSVGElementSize(A.node(),{useBBox:!0}).height;x.remove();const k=this.scaleType||g.scaleType||Z.LINEAR,R=d(h).tickSizeOuter(0);if(h.ticks){let j;if(M?j=T:(j=R.ticks.number,b&&(j=this.getNumberOfFittingTicks(o,y,R.ticks.verticalSpaceRatio))),h.ticks().length===1&&h.ticks()[0]===0&&(j=0),R.ticks(j),v)if(!h.ticks(j).length)R.tickValues([]);else{const X=E(i,"timeScale","addSpaceOnEdges"),ot=E(i,"axes",n,"domain"),tt=h.copy();X&&!ot&&tt.nice(j);const lt=tt.ticks(j);X&&lt.length>2&&!ot&&(lt.splice(lt.length-1,1),lt.splice(0,1)),R.tickValues(lt)}}let U;const N=E(g,"ticks","formatter");if(v){const j=ql(R.tickValues(),E(i,"timeScale","timeInterval"));N===null?U=(X,ot)=>Wl(X,ot,R.tickValues(),j,B):U=(X,ot)=>{const tt=Wl(X,ot,R.tickValues(),j,B);return N(X,ot,tt)}}else N===null?k===Z.LINEAR&&(U=j=>j.toLocaleString()):U=N;R.tickFormat(U);const[F,z]=this.services.cartesianScales.getScaleByPosition(n).domain();let G;if(S){if(v)S.forEach((j,X)=>{j.getTime===void 0&&(S[X]=new Date(j))}),G=S.filter(j=>{const X=j.getTime();return X>=new Date(F).getTime()&&X<=new Date(z).getTime()});else if(O===Z.LABELS){const j=this.services.cartesianScales.getScaleByPosition(n).domain();G=S.filter(X=>j.includes(X))}else G=S.filter(j=>j>=F&&j<=z);R.tickValues(G)}switch(n){case H.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case H.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case H.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case H.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const Q=this.model.isDataEmpty();if(g.title){const j=I.appendOrSelect(c,"text.axis-title").html(Q||_?"":g.title),X=E(g,"titleOrientation");let ot;switch(n){case H.LEFT:X===fl.RIGHT?j.attr("transform","rotate(90)").attr("y",0).attr("x",h.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):j.attr("transform","rotate(-90)").attr("y",0).attr("x",-(h.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case H.BOTTOM:j.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case H.RIGHT:X===fl.LEFT?j.attr("transform","rotate(-90)").attr("y",a).attr("x",-(h.range()[0]/2)).style("text-anchor","middle"):j.attr("transform","rotate(90)").attr("y",-a).attr("x",h.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case H.TOP:({height:ot}=I.getSVGElementSize(j,{useBBox:!0})),j.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${ot/2})`).style("text-anchor","middle");break}}if(v){const j=ql(R.tickValues(),E(i,"timeScale","timeInterval")),X=B.showDayName,ot=p;t&&(p=p.transition().call(tt=>this.services.transitions.setupTransition({transition:tt,name:"axis-update",animate:t}))),p=p.call(R),ot.selectAll(".tick").data(R.tickValues(),h).order().select("text").style("font-weight",(tt,lt)=>Fp(tt,lt,R.tickValues(),j,X)?"bold":"normal")}else!t||!f?p=p.call(R):p=p.transition().call(j=>this.services.transitions.setupTransition({transition:j,name:"axis-update",animate:t})).call(R);if(m.call(R),n===H.BOTTOM||n===H.TOP){let j=!1;const X=E(g,"ticks","rotation");if(X===qs.ALWAYS)j=!0;else if(X===qs.NEVER)j=!1;else if(!X||X===qs.AUTO)if(h.step)j=m.selectAll("g.tick text").nodes().some(ot=>I.getSVGElementSize(ot,{useBBox:!0}).width>=h.step());else{j=!1;const ot=m.append("text").text("A"),tt=I.getSVGElementSize(ot.node(),{useBBox:!0}).width;let lt;m.selectAll("g.tick").each(function(){const W=P(this),q=parseFloat(E(rn(this),"tx"));q!==null&&lt+W.text().length*tt*.8>=q&&(j=!0),lt=q}),ot.remove()}j?(M||(R.ticks(this.getNumberOfFittingTicks(a,y,R.ticks.horizontalSpaceRatio)),m.call(R),p.call(R)),c.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===H.TOP?"start":"end")):c.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(_?c.attr("opacity",0):c.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",j=>j),m.selectAll("g.tick").attr("aria-label",j=>j),$!==Oe.NONE&&O===Z.LABELS&&!S){const j=this.services.cartesianScales.getScaleDomain(n);if(j.length>0){const X=s.select(`g.axis.${n} g.ticks g.tick`).html();c.selectAll("g.ticks g.tick").html(X);const ot=this;c.selectAll("g.tick text").data(j).text(function(tt){return tt.length>D?(ot.truncation[n]=!0,Cr(tt,$,L)):tt}),this.getInvisibleAxisRef().selectAll("g.tick text").data(j).text(function(tt){return tt.length>D?Cr(tt,$,L):tt}),c.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),c.selectAll("g.tick text").data(j)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,i=I.appendOrSelect(t,`g.axis.${n}`),r=this.getOptions(),s=E(r,"axes",n),a=E(s,"scaleType"),o=E(s,"truncation","threshold"),c=this;i.selectAll("g.tick text").on("mouseover",function(l,u){c.services.events.dispatchEvent(C.Axis.LABEL_MOUSEOVER,{event:l,element:P(this),datum:u}),a===Z.LABELS&&u.length>o&&c.services.events.dispatchEvent(C.Tooltip.SHOW,{event:l,hoveredElement:P(this),content:u})}).on("mousemove",function(l,u){c.services.events.dispatchEvent(C.Axis.LABEL_MOUSEMOVE,{event:l,element:P(this),datum:u}),a===Z.LABELS&&u.length>o&&c.services.events.dispatchEvent(C.Tooltip.MOVE,{event:l})}).on("click",function(l,u){c.services.events.dispatchEvent(C.Axis.LABEL_CLICK,{event:l,element:P(this),datum:u})}).on("mouseout",function(l,u){c.services.events.dispatchEvent(C.Axis.LABEL_MOUSEOUT,{event:l,element:P(this),datum:u}),a===Z.LABELS&&c.services.events.dispatchEvent(C.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,n,i){const r=Math.floor(t/(n*i));return Ag(r,2,gi.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;I.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}};class Rk extends Kg{constructor(t,n,i){super(t,n,i)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,i=this.getComponentContainer(),r=I.appendOrSelect(i,`g.axis.${n}`),s=this;r.selectAll("g.tick").each(function(a,o){const c=P(this);c.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const l=c.select("text"),{width:u,height:h}=I.getSVGElementSize(l,{useBBox:!0}),d=I.appendOrSelect(c,"rect.axis-holder");let f=0,p=0;switch(n){case H.LEFT:f=-u+Number(l.attr("x")),p=-(h/2);break;case H.RIGHT:f=Math.abs(Number(l.attr("x"))),p=-(h/2);break;case H.TOP:f=-(u/2),p=-h+Number(l.attr("y"))/2,s.truncation[n]&&(f=0,d.attr("transform","rotate(-45)"));break;case H.BOTTOM:f=-(u/2),p=h/2-2,s.truncation[n]&&(f=-u,d.attr("transform","rotate(-45)"));break}d.attr("x",f-gi.hover.rectanglePadding).attr("y",p).attr("width",u+gi.hover.rectanglePadding*2).attr("height",h).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,i=I.appendOrSelect(t,`g.axis.${n}`),r=this.getOptions(),s=E(r,"axes",n),a=E(s,"scaleType"),o=E(s,"truncation","threshold"),c=this;i.selectAll("g.tick.tick-hover").on("mouseover",function(l){const u=P(this).select("text"),h=u.datum();c.services.events.dispatchEvent(C.Axis.LABEL_MOUSEOVER,{event:l,element:u,datum:h}),a===Z.LABELS&&h.length>o&&c.services.events.dispatchEvent(C.Tooltip.SHOW,{event:l,element:u,datum:h})}).on("mousemove",function(l){const u=P(this).select("text"),h=u.datum();c.services.events.dispatchEvent(C.Axis.LABEL_MOUSEMOVE,{event:l,element:u,datum:h}),c.services.events.dispatchEvent(C.Tooltip.MOVE,{event:l})}).on("click",function(l){c.services.events.dispatchEvent(C.Axis.LABEL_CLICK,{event:l,element:P(this).select("text"),datum:P(this).select("text").datum()})}).on("mouseout",function(l){c.services.events.dispatchEvent(C.Axis.LABEL_MOUSEOUT,{event:l,element:P(this).select("text"),datum:P(this).select("text").datum()}),a===Z.LABELS&&c.services.events.dispatchEvent(C.Tooltip.HIDE)}).on("focus",function(l){const u={clientX:0,clientY:0};if(l.target){l.target.focus();const h=l.target.getBoundingClientRect();u.clientX=h.x,u.clientY=h.y}c.services.events.dispatchEvent(C.Axis.LABEL_FOCUS,{event:{...l,...u},element:P(this),datum:P(this).select("text").datum()})}).on("blur",function(l){c.services.events.dispatchEvent(C.Axis.LABEL_BLUR,{event:l,element:P(this),datum:P(this).select("text").datum()})}).on("keydown",function(l){l.key&&l.key==="Escape"&&(c.services.events.dispatchEvent(C.Tooltip.HIDE),c.services.events.dispatchEvent(C.Axis.LABEL_BLUR,{event:l,element:P(this),datum:P(this).select("text").datum()})),n===H.LEFT||n===H.RIGHT?l.key&&l.key==="ArrowUp"?c.goNext(this,l):l.key&&l.key==="ArrowDown"&&c.goPrevious(this,l):l.key&&l.key==="ArrowLeft"?c.goPrevious(this,l):l.key&&l.key==="ArrowRight"&&c.goNext(this,l)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;I.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class se extends ht{constructor(){super(...arguments),this.type="2D-axes",this.renderType=K.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},i=Object.keys(H),r=E(this.getOptions(),"axes");i.forEach(a=>{r[H[a]]&&(n[H[a]]=!0)}),this.configs.axes=n,i.forEach(a=>{const o=H[a];if(this.configs.axes[o]&&!this.children[o]){const c={position:o,axes:this.configs.axes,margins:this.margins},l=this.model.axisFlavor===Xs.DEFAULT?new Kg(this.model,this.services,c):new Rk(this.model,this.services,c);l.setModel(this.model),l.setServices(this.services),l.setParent(this.parent),this.children[o]=l}}),Object.keys(this.children).forEach(a=>{this.children[a].render(t)});const s={};Object.keys(this.children).forEach(a=>{const o=this.children[a],c=o.configs.position,l=o.getInvisibleAxisRef(),{width:u,height:h}=I.getSVGElementSize(l,{useBBox:!0});let d;switch(o.getTitleRef().empty()?d=0:(d=I.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(c===H.LEFT||c===H.RIGHT)&&(d+=5)),c){case H.TOP:s.top=h+d;break;case H.BOTTOM:s.bottom=h+d;break;case H.LEFT:s.left=u+d;break;case H.RIGHT:s.right=u+d;break}}),this.services.events.dispatchEvent(C.Axis.RENDER_COMPLETE),Object.keys(s).some(a=>this.margins[a]!==s[a])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(C.ZoomBar.UPDATE),Object.keys(this.children).forEach(a=>{const o=this.children[a];o.margins=this.margins}),this.render(!0))}}class te extends ht{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=E(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Pt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Pt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Pt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Pt.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Ht.VERTICAL&&this.drawYGrid(t),n===Ht.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius(),i=0;this.drawRing(n,i,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),i=this.computeInnerRadius();this.drawRing(n,i,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=Se().domain([0,1]).range(t),this.yScale=Se().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:i,height:r}=I.getSVGElementSize(n,{useAttrs:!0});this.backdrop=I.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",i).attr("height",r);const s=I.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),i=E(this.getOptions(),"grid","x","numberOfTicks"),r=this.xScale.ticks(i).map(o=>o*n),s=I.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(r);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),i=this.backdrop.attr("width"),r=E(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(r).map(c=>c*n),a=I.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",i).attr("y1",c=>c).attr("y2",c=>c),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,i=!0){const r=this.parent,{width:s,height:a}=I.getSVGElementSize(r,{useAttrs:!0}),o=I.appendOrSelect(r,"svg.chart-skeleton").attr("width",s).attr("height",a),c=n===0?"pie":"donut",l=E(this.getOptions(),c,"alignment");I.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=or().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),h=t+Math.abs(Et.radiusOffset),d=t+(Math.min(s,a)-t*2)/2,f=I.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${h}, ${d})`).attr("d",u).classed("shimmer-effect-areas",i).classed("empty-state-areas",!i).style("fill",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let p=t+Et.xOffset;l===It.CENTER?p=s/2:l===It.RIGHT&&(p=s-t-Et.xOffset);const m=t+Et.yOffset;f.attr("transform",`translate(${p}, ${m})`)}computeOuterRadius(){const{width:t,height:n}=I.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Et.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const n="stop-bg-shimmer",i="stop-shimmer",r=this.parent.select(".chart-skeleton"),{width:s}=I.getSVGElementSize(this.parent,{useAttrs:!0}),a=0,o=s,c=I.appendOrSelect(r,"defs").lower(),l=I.appendOrSelect(c,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",a-3*.2*s).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),u=`
75
+ </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class ue extends ht{constructor(){super(...arguments),this.type="grid",this.renderType=K.SVG}render(t=!0){const n=E(this.getOptions(),"grid","x","enabled"),i=E(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,i),!(!n&&!i)&&(n&&(R.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),i&&(R.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,i=this.backdrop.attr("height"),r=this.services.cartesianScales.getMainXScale(),s=Ua(r).tickSizeInner(-i).tickSizeOuter(0);if(E(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),c=E(this.getOptions(),"axes",o,"ticks","values");c&&s.tickValues(c)}else{const o=E(this.getOptions(),"grid","x","numberOfTicks");s.ticks(o)}const a=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${i})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}drawYGrid(t){const n=this.parent,i=this.backdrop.attr("width"),r=this.services.cartesianScales.getMainYScale(),s=Dc(r).tickSizeInner(-i).tickSizeOuter(0);if(E(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),c=E(this.getOptions(),"axes",o,"ticks","values");c&&s.tickValues(c)}else{const o=E(this.getOptions(),"grid","y","numberOfTicks");s.ticks(o)}const a=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}getGridlineThreshold(t){const n=this.parent,i=n.selectAll(".x.grid .tick").nodes().sort((u,h)=>Number(rn(u).tx)-Number(rn(h).tx));let r=-1;if(!i.length)return;i.forEach(u=>{t[0]>=+rn(u).tx&&r++});const s=r+1<i.length?r+1:i.length,a=i[r],o=i[s];let c;if(!a)c=+rn(o).tx;else if(o)c=+rn(o).tx-+rn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();c=R.getSVGElementSize(u).width-+rn(a).tx}const{threshold:l}=this.getOptions().tooltip.gridline;return c*l}getActiveGridline(t){const n=E(this.getOptions,"tooltip","gridline","threshold"),i=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const r=rn(this),s={min:Number(r.tx)-i,max:Number(r.tx)+i};return s.min<=t[0]&&t[0]<=s.max})}drawBackdrop(t,n){const i=this.parent,r=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=r.range(),[c,l]=s.range();this.backdrop=R.appendOrSelect(i,"svg.chart-grid-backdrop");const u=R.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",l).attr("width",Math.abs(o-a)).attr("height",Math.abs(c-l)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class Fg extends ht{constructor(){super(...arguments),this.type="area",this.renderType=K.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-area"})).attr("opacity",i=>i.name!==n.datum().name?Qe.opacity.unselected:Qe.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",Qe.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions();let r=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=rl().curve(this.services.curves.getD3Curve()).defined(_=>{const T=s.getRangeIdentifier();return _[T]!=null}),c=this.model.getGroupedData(this.configs.groups),l=E(i,"bounds"),u=l&&c&&c.length===1;!u&&l&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${c.length}`);let h=0;const d=(_,T)=>{E(i,"axes",_,"includeZero")===!1&&T[0]>0&&T[1]>0&&(h=T[0])},f=_=>u?s.getBoundedScaledValues(_)[0]:s.getRangeValue(h),p=_=>u?s.getBoundedScaledValues(_)[1]:s.getRangeValue(_);a===Ht.VERTICAL?(r=s.getMainYScale().domain(),d(s.getMainYAxisPosition(),r),o.x(_=>s.getDomainValue(_)).y0(_=>f(_)).y1(_=>p(_))):(r=s.getMainXScale().domain(),d(s.getMainXAxisPosition(),r),o.x0(_=>f(_)).x1(_=>p(_)).y(_=>s.getDomainValue(_)));const m=E(i,"color","gradient","enabled"),g=c&&c.length===1&&m;c.length>1&&m&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(c,_=>_.name),b=P(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!c.length)return;if(g){const _=b.select(`path.${this.model.getColorClassName({classNameTypes:[J.STROKE],dataGroupName:c[0].name})}`).node();let T;if(_)T=getComputedStyle(_,null).getPropertyValue("stroke");else{const S=E(this.model.getOptions(),"color","scale");if(S!==null){const $=Object.keys(S);T=S[$[0]]}}jl.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${c[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:jl.getStops(r,T)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const w=this,O=v.enter().append("path");g?O.merge(v).style("fill",_=>`url(#${this.services.domUtils.generateElementIDString(`${_.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:_.name,originalClassName:"area"})).attr("d",_=>{const{data:T}=_;return o(T)}):(O.attr("opacity",0).merge(v).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[J.FILL,J.STROKE],dataGroupName:_.name,originalClassName:"area"})).style("fill",_=>w.model.getFillColor(_.name)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"area-update-enter",animate:t})).attr("opacity",u?1:Qe.opacity.selected).attr("d",_=>{const{data:T}=_;return o(T)}),u&&O.attr("fill-opacity",Qe.opacity.selected).style("stroke",_=>w.model.getStrokeColor(_.name)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Mi extends ht{constructor(){super(...arguments),this.type="line",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-line"})).attr("opacity",i=>i.name!==n.datum().name?Je.opacity.unselected:Je.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",Je.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:i,curves:r}=this.services,s=f=>i.getDomainValue(f),a=f=>i.getRangeValue(f),[o,c]=sn(s,a,i.getOrientation()),l=this.getOptions(),u=lr().x(o).y(c).curve(r.getD3Curve()).defined(f=>{const p=i.getRangeIdentifier(f);return f[p]!=null});let h=[];if(this.configs.stacked){const f=Object.keys(l.axes).some(m=>l.axes[m].percentage),{groupMapsTo:p}=l.data;h=this.model.getStackedData({groups:this.configs.groups,percentage:f}).map(m=>{const g=this.services.cartesianScales.getDomainIdentifier(m),v=this.services.cartesianScales.getRangeIdentifier(m);return{name:E(m,0,p),data:m.map(b=>({[g]:b.data.sharedStackKey,[p]:b[p],[v]:b[1]})),hidden:!dD(m,b=>b[0]!==b[1])}})}else h=this.model.getGroupedData(this.configs.groups);const d=n.selectAll("path.line").data(h,f=>f.name);d.exit().attr("opacity",0).remove(),d.enter().append("path").classed("line",!0).attr("opacity",0).merge(d).data(h,f=>f.name).attr("class",f=>this.model.getColorClassName({classNameTypes:[J.STROKE],dataGroupName:f.name,originalClassName:"line"})).style("stroke",f=>this.model.getStrokeColor(f.name)).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",f=>{const{data:p}=f;return p.map(m=>{const g=this.services.cartesianScales.getRangeIdentifier(m);return m[g]}).join(",")}).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"line-update-enter",animate:t})).attr("opacity",f=>f.hidden?0:1).attr("d",f=>{const{data:p}=f;return u(p)})}destroy(){const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const zg=5;function Lk(e,t){return e>t-zg&&e<t+zg}let vn=class extends ht{constructor(){super(...arguments),this.type="ruler",this.renderType=K.SVG,this.isXGridEnabled=E(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=E(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!0){const n=E(this.getOptions(),"ruler","enabled");this.drawBackdrop(),n&&!this.isEventListenerAdded?this.addBackdropEventListeners():!n&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,i]){const r=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[c,l]=o.range(),u=s===Ht.HORIZONTAL?i:n,h=R.appendOrSelect(r,"g.ruler").attr("aria-label","ruler"),d=R.appendOrSelect(h,"line.ruler-line"),f=r.selectAll("[role=graphics-symbol]"),p=a.map(g=>({domainValue:this.services.cartesianScales.getDomainValue(g),originalData:g})).filter(g=>Lk(g.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(g=>g.domainValue).join()===this.pointsWithinLine.map(g=>g.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(C.Tooltip.MOVE,{mousePosition:[n,i]});this.pointsWithinLine=p;const m=this.pointsWithinLine.reduce((g,v)=>{if(g.length===0)return g.push(v),g;const b=g[0].domainValue,w=Math.abs(u-v.domainValue),O=Math.abs(u-b);return w>O||(w<O?g=[v]:g.push(v)),g},[]);if(m.length>0){const g=m.map(O=>O.originalData).filter(O=>{const _=this.services.cartesianScales.getRangeIdentifier(O);return O[_]!=null}),v=m.map(O=>O.domainValue),b=f.filter(O=>{const _=this.services.cartesianScales.getDomainValue(O);return v.includes(_)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Sg(this.elementsToHighlight,b)&&this.hideRuler(),b.dispatch("mouseover"),this.elementsToHighlight=b,this.services.events.dispatchEvent(C.Tooltip.SHOW,{mousePosition:[n,i],hoveredElement:d,data:this.formatTooltipData(g)}),h.attr("opacity",1);const w=m[0];s==="horizontal"?d.attr("x1",l).attr("x2",c).attr("y1",w.domainValue).attr("y2",w.domainValue):d.attr("y1",l).attr("y2",c).attr("x1",w.domainValue).attr("x2",w.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=R.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(C.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),i=this.model.getDisplayData();let r=function(s){const a=wn(s,t.parent.node());t.showRuler(s,a)};if(i.length>100){const s=i.length%50*12.5;r=pA(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",r).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=R.appendOrSelect(t,"svg.chart-grid-backdrop")}};class Ue extends ht{constructor(){super(...arguments),this.type="scatter",this.renderType=K.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(r=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:r,name:"legend-hover-scatter"})}).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(C.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(C.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const i=n.getDomainIdentifier(t),r=this.model.get("zoomDomain");return r!==void 0?t.filter(s=>s[i].getTime()>=r[0].getTime()&&s[i].getTime()<=r[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let i;if(n){const r=Object.keys(t.axes).some(s=>t.axes[s].percentage);i=this.model.getStackedData({groups:this.configs.groups,percentage:r})}else{const{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales are undefined.");i=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=r.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(i)}render(t){if(!(E(this.getOptions(),"points","enabled")||E(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:r}=i.data,{cartesianScales:s}=this.services;if(!s)throw new Error("Services cartesianScales are undefined.");const a=s.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),l=>`${l[r]}-${l[a]}`);o.exit().attr("opacity",0).remove();const c=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(c,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:i}=this.services;if(!i)throw new Error("Cartesian scales service is undefined");const r=i.getOrientation(),[s,a]=sn(i.getHighestDomainThreshold(),i.getHighestRangeThreshold(),r),[o,c]=sn(h=>i.getDomainValue(h),h=>i.getRangeValue(h),r),l=o(t),u=c(t);return a&&s?u<=a.scaleValue&&l>=s.scaleValue:a?u<=a.scaleValue:s?l>=s.scaleValue:!1}styleCircles(t,n){const i=this.getOptions(),{filled:r,fillOpacity:s}=i.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=i.data,c=f=>a.getDomainValue(f),l=f=>a.getRangeValue(f),[u,h]=sn(c,l,a.getOrientation()),{fadeInOnChartHolderMouseover:d}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),m=this.model.getIsFilled(f[o],f[p],f,r)?[J.FILL,J.STROKE]:[J.STROKE];return this.model.getColorClassName({classNameTypes:m,dataGroupName:f[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",f=>this.isDatapointThresholdAnomaly(f)).classed("filled",f=>{const p=a.getDomainIdentifier(f);return this.model.getIsFilled(f[o],f[p],f,r)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,r)}).transition().call(f=>{var p;return(p=this.services.transitions)==null?void 0:p.setupTransition({transition:f,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",h).attr("r",i.points.radius).style("fill",f=>{const p=a.getDomainIdentifier(f);if(this.model.getIsFilled(f[o],f[p],f,r))return this.model.getFillColor(f[o],f[p],f)}).style("stroke",f=>{const p=a.getDomainIdentifier(f);return this.model.getStrokeColor(f[o],f[p],f)}).attr("fill-opacity",r?s:1).attr("opacity",d?0:1).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",f=>{const p=a.getRangeIdentifier(f);return f[p]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(i,r){var s,a;const o=P(this);o.classed("hovered",!0).attr("class",c=>t.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:c[n],originalClassName:o.attr("class")})).style("fill",c=>{var l;const u=(l=t.services.cartesianScales)==null?void 0:l.getDomainIdentifier(c);return t.model.getFillColor(c[n],c[u],c)}).classed("unfilled",!1),(s=t.services.events)==null||s.dispatchEvent(C.Tooltip.SHOW,{event:i,hoveredElement:o,data:[r],additionalItems:t.getTooltipAdditionalItems(r)}),(a=t.services.events)==null||a.dispatchEvent(C.Scatter.SCATTER_MOUSEOVER,{event:i,element:o,datum:r})}).on("mousemove",function(i,r){var s,a;const o=P(this);(s=t.services.events)==null||s.dispatchEvent(C.Scatter.SCATTER_MOUSEMOVE,{event:i,element:o,datum:r}),(a=t.services.events)==null||a.dispatchEvent(C.Tooltip.MOVE,{event:i})}).on("click",function(i,r){var s;(s=t.services.events)==null||s.dispatchEvent(C.Scatter.SCATTER_CLICK,{event:i,element:P(this),datum:r})}).on("mouseout",function(i,r){var s,a,o;const c=P(this);if(c.classed("hovered",!1),!t.configs.filled){const{filled:l}=t.getOptions().points,u=(s=t.services.cartesianScales)==null?void 0:s.getDomainIdentifier(r),h=t.model.getIsFilled(r[n],r[u],r,l);c.classed("unfilled",!h).style("fill",d=>h||l?t.model.getFillColor(d[n],d[u],d):null)}(a=t.services.events)==null||a.dispatchEvent(C.Scatter.SCATTER_MOUSEOUT,{event:i,element:c,datum:r}),(o=t.services.events)==null||o.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:c})})}destroy(){var t;(t=this.parent)==null||t.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:n}=this.services;if(!n)throw new Error("Services events undefined");n.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(C.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(C.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}let jg=class extends ht{constructor(t,n,i){super(t,n,i),this.type="axes",this.renderType=K.SVG,this.truncation={[H.LEFT]:!1,[H.RIGHT]:!1,[H.TOP]:!1,[H.BOTTOM]:!1},i&&(this.configs=i),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,i=this.getOptions(),r=E(i,"axes",n,"visible"),s=this.getComponentContainer(),{width:a,height:o}=R.getSVGElementSize(s,{useAttrs:!0}),c=R.appendOrSelect(s,`g.axis.${n}`);let l,u;if(n===H.BOTTOM||n===H.TOP?(l=this.configs.axes[H.LEFT]?this.margins.left:0,u=this.configs.axes[H.RIGHT]?a-this.margins.right:a):(l=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefineds");const h=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===Z.LABELS||this.scaleType===Z.LABELS_RATIO?h.rangeRound([l,u]):h.range([l,u]);let d;switch(n){case H.LEFT:d=Dc;break;case H.BOTTOM:d=Ua;break;case H.RIGHT:d=Sv;break;case H.TOP:d=_v;break}c.attr("aria-label",`${n} axis`);const f=!c.select("g.ticks").empty();let p=R.appendOrSelect(c,"g.ticks");f||(p.attr("role",`${at.GRAPHICS_OBJECT} ${at.GROUP}`),p.attr("aria-label",`${n} ticks`));const m=R.appendOrSelect(c,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),g=E(i,"axes",n),v=this.scaleType===Z.TIME||g.scaleType===Z.TIME,b=n===H.LEFT||n===H.RIGHT,w=this.model.get("zoomDomain");if(w&&v&&!b&&h.domain(w),!r){p.attr("aria-hidden",!0);return}const O=E(g,"scaleType"),_=E(i,"data","loading"),T=E(g,"ticks","number"),S=E(g,"ticks","values"),$=E(g,"truncation","type"),D=E(g,"truncation","threshold"),L=E(g,"truncation","numCharacter"),M=T!==null,B=E(i,"timeScale"),x=R.appendOrSelect(m,"g.tick"),A=R.appendOrSelect(x,"text").text("0"),y=R.getSVGElementSize(A.node(),{useBBox:!0}).height;x.remove();const k=this.scaleType||g.scaleType||Z.LINEAR,I=d(h).tickSizeOuter(0);if(h.ticks){let j;if(M?j=T:(j=fn.ticks.number,b&&(j=this.getNumberOfFittingTicks(o,y,fn.ticks.verticalSpaceRatio))),h.ticks().length===1&&h.ticks()[0]===0&&(j=0),I.ticks(j),v)if(!h.ticks(j).length)I.tickValues([]);else{const X=E(i,"timeScale","addSpaceOnEdges"),ot=E(i,"axes",n,"domain"),tt=h.copy();X&&!ot&&tt.nice(j);const lt=tt.ticks(j);X&&lt.length>2&&!ot&&(lt.splice(lt.length-1,1),lt.splice(0,1)),I.tickValues(lt)}}let U;const N=E(g,"ticks","formatter");if(v){const j=Gl(I.tickValues(),E(i,"timeScale","timeInterval"));N===null?U=(X,ot)=>Vl(X,ot,I.tickValues(),j,B):U=(X,ot)=>{const tt=Vl(X,ot,I.tickValues(),j,B);return N(X,ot,tt)}}else N===null?k===Z.LINEAR&&(U=j=>j.toLocaleString()):U=N;I.tickFormat(U);const[F,z]=this.services.cartesianScales.getScaleByPosition(n).domain();let G;if(S){if(v)S.forEach((j,X)=>{j.getTime===void 0&&(S[X]=new Date(j))}),G=S.filter(j=>{const X=j.getTime();return X>=new Date(F).getTime()&&X<=new Date(z).getTime()});else if(O===Z.LABELS){const j=this.services.cartesianScales.getScaleByPosition(n).domain();G=S.filter(X=>j.includes(X))}else G=S.filter(j=>j>=F&&j<=z);I.tickValues(G)}switch(n){case H.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case H.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case H.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case H.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const Q=this.model.isDataEmpty();if(g.title){const j=R.appendOrSelect(c,"text.axis-title").html(Q||_?"":g.title),X=E(g,"titleOrientation");let ot;switch(n){case H.LEFT:X===fl.RIGHT?j.attr("transform","rotate(90)").attr("y",0).attr("x",h.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):j.attr("transform","rotate(-90)").attr("y",0).attr("x",-(h.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case H.BOTTOM:j.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case H.RIGHT:X===fl.LEFT?j.attr("transform","rotate(-90)").attr("y",a).attr("x",-(h.range()[0]/2)).style("text-anchor","middle"):j.attr("transform","rotate(90)").attr("y",-a).attr("x",h.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case H.TOP:ot=R.getSVGElementSize(j,{useBBox:!0}).height,j.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${ot/2})`).style("text-anchor","middle");break}}if(v){const j=Gl(I.tickValues(),E(i,"timeScale","timeInterval")),X=B.showDayName,ot=p;t&&(p=p.transition().call(tt=>this.services.transitions.setupTransition({transition:tt,name:"axis-update",animate:t}))),p=p.call(I),ot.selectAll(".tick").data(I.tickValues(),h).order().select("text").style("font-weight",(tt,lt)=>Np(tt,lt,I.tickValues(),j,X)?"bold":"normal")}else!t||!f?p=p.call(I):p=p.transition().call(j=>this.services.transitions.setupTransition({transition:j,name:"axis-update",animate:t})).call(I);if(m.call(I),n===H.BOTTOM||n===H.TOP){let j=!1;const X=E(g,"ticks","rotation");if(X===Ws.ALWAYS)j=!0;else if(X===Ws.NEVER)j=!1;else if(!X||X===Ws.AUTO)if(h.step)j=m.selectAll("g.tick text").nodes().some(ot=>R.getSVGElementSize(ot,{useBBox:!0}).width>=h.step());else{j=!1;const ot=m.append("text").text("A"),tt=R.getSVGElementSize(ot.node(),{useBBox:!0}).width;let lt;m.selectAll("g.tick").each(function(){const W=P(this),q=parseFloat(E(rn(this),"tx"));q!==null&&lt+W.text().length*tt*.8>=q&&(j=!0),lt=q}),ot.remove()}j?(M||(I.ticks(this.getNumberOfFittingTicks(a,y,fn.ticks.horizontalSpaceRatio)),m.call(I),p.call(I)),c.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===H.TOP?"start":"end")):c.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(_?c.attr("opacity",0):c.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",j=>j),m.selectAll("g.tick").attr("aria-label",j=>j),$!==Se.NONE&&O===Z.LABELS&&!S){const j=this.services.cartesianScales.getScaleDomain(n);if(j.length>0){const X=s.select(`g.axis.${n} g.ticks g.tick`).html();c.selectAll("g.ticks g.tick").html(X);const ot=this;c.selectAll("g.tick text").data(j).text(function(tt){return tt.length>D?(ot.truncation[n]=!0,Cr(tt,$,L)):tt}),this.getInvisibleAxisRef().selectAll("g.tick text").data(j).text(function(tt){return tt.length>D?Cr(tt,$,L):tt}),c.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),c.selectAll("g.tick text").data(j)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,i=R.appendOrSelect(t,`g.axis.${n}`),r=this.getOptions(),s=E(r,"axes",n),a=E(s,"scaleType"),o=E(s,"truncation","threshold"),c=this;i.selectAll("g.tick text").on("mouseover",function(l,u){c.services.events.dispatchEvent(C.Axis.LABEL_MOUSEOVER,{event:l,element:P(this),datum:u}),a===Z.LABELS&&u.length>o&&c.services.events.dispatchEvent(C.Tooltip.SHOW,{event:l,hoveredElement:P(this),content:u})}).on("mousemove",function(l,u){c.services.events.dispatchEvent(C.Axis.LABEL_MOUSEMOVE,{event:l,element:P(this),datum:u}),a===Z.LABELS&&u.length>o&&c.services.events.dispatchEvent(C.Tooltip.MOVE,{event:l})}).on("click",function(l,u){c.services.events.dispatchEvent(C.Axis.LABEL_CLICK,{event:l,element:P(this),datum:u})}).on("mouseout",function(l,u){c.services.events.dispatchEvent(C.Axis.LABEL_MOUSEOUT,{event:l,element:P(this),datum:u}),a===Z.LABELS&&c.services.events.dispatchEvent(C.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,n,i){const r=Math.floor(t/(n*i));return _g(r,2,fn.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;R.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}};class Dk extends jg{constructor(t,n,i){super(t,n,i)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,i=this.getComponentContainer(),r=R.appendOrSelect(i,`g.axis.${n}`),s=this;r.selectAll("g.tick").each(function(a,o){const c=P(this);c.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const l=c.select("text"),{width:u,height:h}=R.getSVGElementSize(l,{useBBox:!0}),d=R.appendOrSelect(c,"rect.axis-holder");let f=0,p=0;switch(n){case H.LEFT:f=-u+Number(l.attr("x")),p=-(h/2);break;case H.RIGHT:f=Math.abs(Number(l.attr("x"))),p=-(h/2);break;case H.TOP:f=-(u/2),p=-h+Number(l.attr("y"))/2,s.truncation[n]&&(f=0,d.attr("transform","rotate(-45)"));break;case H.BOTTOM:f=-(u/2),p=h/2-2,s.truncation[n]&&(f=-u,d.attr("transform","rotate(-45)"));break}d.attr("x",f-fn.hover.rectanglePadding).attr("y",p).attr("width",u+fn.hover.rectanglePadding*2).attr("height",h).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,i=R.appendOrSelect(t,`g.axis.${n}`),r=this.getOptions(),s=E(r,"axes",n),a=E(s,"scaleType"),o=E(s,"truncation","threshold"),c=this;i.selectAll("g.tick.tick-hover").on("mouseover",function(l){const u=P(this).select("text"),h=u.datum();c.services.events.dispatchEvent(C.Axis.LABEL_MOUSEOVER,{event:l,element:u,datum:h}),a===Z.LABELS&&h.length>o&&c.services.events.dispatchEvent(C.Tooltip.SHOW,{event:l,element:u,datum:h})}).on("mousemove",function(l){const u=P(this).select("text"),h=u.datum();c.services.events.dispatchEvent(C.Axis.LABEL_MOUSEMOVE,{event:l,element:u,datum:h}),c.services.events.dispatchEvent(C.Tooltip.MOVE,{event:l})}).on("click",function(l){c.services.events.dispatchEvent(C.Axis.LABEL_CLICK,{event:l,element:P(this).select("text"),datum:P(this).select("text").datum()})}).on("mouseout",function(l){c.services.events.dispatchEvent(C.Axis.LABEL_MOUSEOUT,{event:l,element:P(this).select("text"),datum:P(this).select("text").datum()}),a===Z.LABELS&&c.services.events.dispatchEvent(C.Tooltip.HIDE)}).on("focus",function(l){const u={clientX:0,clientY:0};if(l.target){l.target.focus();const h=l.target.getBoundingClientRect();u.clientX=h.x,u.clientY=h.y}c.services.events.dispatchEvent(C.Axis.LABEL_FOCUS,{event:{...l,...u},element:P(this),datum:P(this).select("text").datum()})}).on("blur",function(l){c.services.events.dispatchEvent(C.Axis.LABEL_BLUR,{event:l,element:P(this),datum:P(this).select("text").datum()})}).on("keydown",function(l){l.key&&l.key==="Escape"&&(c.services.events.dispatchEvent(C.Tooltip.HIDE),c.services.events.dispatchEvent(C.Axis.LABEL_BLUR,{event:l,element:P(this),datum:P(this).select("text").datum()})),n===H.LEFT||n===H.RIGHT?l.key&&l.key==="ArrowUp"?c.goNext(this,l):l.key&&l.key==="ArrowDown"&&c.goPrevious(this,l):l.key&&l.key==="ArrowLeft"?c.goPrevious(this,l):l.key&&l.key==="ArrowRight"&&c.goNext(this,l)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;R.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class re extends ht{constructor(){super(...arguments),this.type="2D-axes",this.renderType=K.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},i=Object.keys(H),r=E(this.getOptions(),"axes");i.forEach(a=>{r[H[a]]&&(n[H[a]]=!0)}),this.configs.axes=n,i.forEach(a=>{const o=H[a];if(this.configs.axes[o]&&!this.children[o]){const c={position:o,axes:this.configs.axes,margins:this.margins},l=this.model.axisFlavor===Ys.DEFAULT?new jg(this.model,this.services,c):new Dk(this.model,this.services,c);l.setModel(this.model),l.setServices(this.services),l.setParent(this.parent),this.children[o]=l}}),Object.keys(this.children).forEach(a=>{this.children[a].render(t)});const s={};Object.keys(this.children).forEach(a=>{const o=this.children[a],c=o.configs.position,l=o.getInvisibleAxisRef(),{width:u,height:h}=R.getSVGElementSize(l,{useBBox:!0});let d;switch(o.getTitleRef().empty()?d=0:(d=R.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(c===H.LEFT||c===H.RIGHT)&&(d+=5)),c){case H.TOP:s.top=h+d;break;case H.BOTTOM:s.bottom=h+d;break;case H.LEFT:s.left=u+d;break;case H.RIGHT:s.right=u+d;break}}),this.services.events.dispatchEvent(C.Axis.RENDER_COMPLETE),Object.keys(s).some(a=>this.margins[a]!==s[a])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(C.ZoomBar.UPDATE),Object.keys(this.children).forEach(a=>{const o=this.children[a];o.margins=this.margins}),this.render(!0))}}class Jt extends ht{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=E(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Pt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Pt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Pt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Pt.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Ht.VERTICAL&&this.drawYGrid(t),n===Ht.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius(),i=0;this.drawRing(n,i,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),i=this.computeInnerRadius();this.drawRing(n,i,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=_e().domain([0,1]).range(t),this.yScale=_e().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:i,height:r}=R.getSVGElementSize(n,{useAttrs:!0});this.backdrop=R.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",i).attr("height",r);const s=R.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),i=E(this.getOptions(),"grid","x","numberOfTicks"),r=this.xScale.ticks(i).map(o=>o*n),s=R.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(r);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),i=this.backdrop.attr("width"),r=E(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(r).map(c=>c*n),a=R.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",i).attr("y1",c=>c).attr("y2",c=>c),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,i=!0){const r=this.parent,{width:s,height:a}=R.getSVGElementSize(r,{useAttrs:!0}),o=R.appendOrSelect(r,"svg.chart-skeleton").attr("width",s).attr("height",a),c=n===0?"pie":"donut",l=E(this.getOptions(),c,"alignment");R.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=or().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),h=t+Math.abs(_t.radiusOffset),d=t+(Math.min(s,a)-t*2)/2,f=R.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${h}, ${d})`).attr("d",u).classed("shimmer-effect-areas",i).classed("empty-state-areas",!i).style("fill",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let p=t+_t.xOffset;l===It.CENTER?p=s/2:l===It.RIGHT&&(p=s-t-_t.xOffset);const m=t+_t.yOffset;f.attr("transform",`translate(${p}, ${m})`)}computeOuterRadius(){const{width:t,height:n}=R.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+_t.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const n="stop-bg-shimmer",i="stop-shimmer",r=this.parent.select(".chart-skeleton"),{width:s}=R.getSVGElementSize(this.parent,{useAttrs:!0}),a=0,o=s,c=R.appendOrSelect(r,"defs").lower(),l=R.appendOrSelect(c,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",a-3*.2*s).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),u=`
76
76
  <stop class="${n}" offset="${a}"></stop>
77
77
  <stop class="${i}" offset="${a+.2}"></stop>
78
78
  <stop class="${n}" offset="${a+2*.2}"></stop>
79
- `;l.html(u),h();function h(){l.attr("gradientTransform",`translate(${a-3*.2*s}, 0)`).transition().duration(2e3).delay(1e3).ease(Y1).attr("gradientTransform",`translate(${o+3*.2*s}, 0)`).on("end",h)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class Ik extends ht{constructor(){super(...arguments),this.type="boxplot",this.renderType=K.SVG}render(t){const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:r}=i.data,s=this.model.getDataGroupNames(),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[c,l]=a.range(),[u,h]=o.range(),d=l-c,f=u-h;if(d===0)return;const{cartesianScales:p}=this.services,m=p.getOrientation(),g=m===Ht.VERTICAL,[v,b]=sn(M=>this.services.cartesianScales.getDomainValue(M),M=>this.services.cartesianScales.getRangeValue(M),m),w=Math.floor((g?d:f)/s.length),O=Math.min(w/2,16),_=this.model.getBoxplotData(),T=n.selectAll(".box-group").data(_);T.exit().remove();const S=T.enter().append("g").attr("class","box-group"),$=T.merge(S);S.append("path").merge(T.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[J.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",ue.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalstartline",animate:t})).attr("d",M=>{const B=p.getDomainValue(M[r]),x=B,A=p.getRangeValue(M.whiskers.min),y=p.getRangeValue(M.quartiles.q_25);return Jt({x0:B,x1:x,y0:A,y1:y},m)}),S.append("path").merge(T.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[J.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",ue.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalendline",animate:t})).attr("d",M=>{const B=p.getDomainValue(M[r]),x=B,A=p.getRangeValue(M.whiskers.max),y=p.getRangeValue(M.quartiles.q_75);return Jt({x0:B,x1:x,y0:A,y1:y},m)}),S.append("path").merge(T.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[J.FILL,J.STROKE],originalClassName:"box"})).attr("fill-opacity",ue.box.opacity.default).attr("stroke-width",ue.strokeWidth.default).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",M=>M[r]).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-quartiles",animate:t})).attr("d",M=>{const B=p.getDomainValue(M[r])-O/2,x=B+O,A=p.getRangeValue(Math[g?"max":"min"](M.quartiles.q_75,M.quartiles.q_25)),y=A+Math.abs(p.getRangeValue(M.quartiles.q_75)-p.getRangeValue(M.quartiles.q_25));return Jt({x0:B,x1:x,y0:A,y1:y},m)}),S.append("path").merge(T.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",M=>{const B=p.getDomainValue(M[r])-O/2,x=B+O,A=p.getRangeValue(M.whiskers.min),y=p.getRangeValue(M.whiskers.max);return Jt({x0:B,x1:x,y0:A,y1:y},m)}),S.append("path").merge(T.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[J.STROKE],originalClassName:"whisker start"})).attr("stroke-width",ue.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-startingwhisker",animate:t})).attr("d",M=>{const B=p.getDomainValue(M[r])-O/4,x=B+O/2,A=p.getRangeValue(M.whiskers.min),y=p.getRangeValue(M.whiskers.min);return Jt({x0:B,x1:x,y0:A,y1:y},m)}),S.append("path").merge(T.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[J.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-median",animate:t})).attr("d",M=>{const B=p.getDomainValue(M[r])-O/2,x=B+O,A=p.getRangeValue(M.quartiles.q_50);return Jt({x0:B,x1:x,y0:A,y1:A},m)}),S.append("path").merge(T.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[J.STROKE],originalClassName:"whisker end"})).attr("stroke-width",ue.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-endingwhisker",animate:t})).attr("d",M=>{const B=p.getDomainValue(M[r])-O/4,x=B+O/2,A=p.getRangeValue(M.whiskers.max),y=p.getRangeValue(M.whiskers.max);return Jt({x0:B,x1:x,y0:A,y1:y},m)});const D=$.selectAll("circle.outlier").data(M=>M.outliers.map(B=>({min:M.whiskers.min,max:M.whiskers.max,[r]:M[r],value:B})));D.exit().remove();const L=D.enter().append("circle");D.merge(L).attr("r",ue.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[J.FILL,J.STROKE],originalClassName:"outlier"})).attr("fill-opacity",ue.circle.opacity.default).attr("cx",v).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-circles",animate:t})).attr("cy",b),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:i}=n.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(r,s){const a=P(this);P(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",ue.box.opacity.hovered),t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:r,hoveredElement:a,items:[{label:n.tooltip.groupLabel,value:s[i],class:t.model.getColorClassName({classNameTypes:[J.TOOLTIP]})},{label:"Minimum",value:s.whiskers.min},{label:"Q1",value:s.quartiles.q_25},{label:"Median",value:s.quartiles.q_50},{label:"Q3",value:s.quartiles.q_75},{label:"Maximum",value:s.whiskers.max},{label:"IQR",value:s.quartiles.q_75-s.quartiles.q_25}]}),t.services.events.dispatchEvent(C.Boxplot.BOX_MOUSEOVER,{event:r,element:a,datum:s})}).on("mousemove",function(r,s){const a=P(this);t.services.events.dispatchEvent(C.Boxplot.BOX_MOUSEMOVE,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:r})}).on("click",function(r,s){t.services.events.dispatchEvent(C.Boxplot.BOX_CLICK,{event:r,element:P(this),datum:s})}).on("mouseout",function(r,s){const a=P(this);P(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",ue.box.opacity.default),t.services.events.dispatchEvent(C.Boxplot.BOX_MOUSEOUT,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:a})})}addCircleEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(s,a){const o=P(this);o.classed("hovered",!0).attr("fill-opacity",ue.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel,value:a[i],class:t.model.getColorClassName({classNameTypes:[J.TOOLTIP]})},{label:"Outlier",value:a[r]}]}),t.services.events.dispatchEvent(C.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=P(this);t.services.events.dispatchEvent(C.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(C.Boxplot.OUTLIER_CLICK,{event:s,element:P(this),datum:a})}).on("mouseout",function(s,a){const o=P(this);o.classed("hovered",!1).attr("fill-opacity",ue.circle.opacity.default),t.services.events.dispatchEvent(C.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:o})})}}class Ci extends ht{constructor(){super(...arguments),this.type="zero-line",this.renderType=K.SVG}render(t){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),i=this.services.cartesianScales.getScaleByPosition(n),[r,s]=i.domain(),a=r>0&&s<0||r<0&&s>0,o=this.getComponentContainer();if(!a){o.selectAll("line.domain").remove();return}const[c,l]=this.services.cartesianScales.getDomainScale().range();let u=+i(0)+.5;u||(u=i.range()[0]);const h=Dp({x0:c,x1:l,y0:u,y1:u},this.services.cartesianScales.getOrientation());I.appendOrSelect(o,"line.domain").transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"zero-line-update",animate:t})).attr("y1",h.y0).attr("y2",h.y1).attr("x1",h.x0).attr("x2",h.x1)}}class Pk extends He{constructor(){super(...arguments),this.type="bubble",this.renderType=K.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:i}=n.bubble,r=t.data(),s=r.map(l=>l[i]).filter(l=>l),a=I.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,c=o?xe(s):[1,1];return Se().domain(c).range(o?n.bubble.radiusRange(a,r):[4,4])}styleCircles(t,n){const i=this.getOptions(),{radiusMapsTo:r}=i.bubble,s=this.getRadiusScale(t),{groupMapsTo:a}=i.data,{cartesianScales:o}=this.services,c=d=>o.getDomainValue(d),l=d=>o.getRangeValue(d),[u,h]=sn(c,l,o.getOrientation());t.raise().classed("dot",!0).attr("role",at.GRAPHICS_SYMBOL).attr("aria-label",d=>{const f=o.getRangeIdentifier(d);return d[f]}).transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"bubble-update-enter",animate:n})).attr("cx",u).attr("cy",h).attr("r",d=>s(d[r]||1)).attr("class",d=>this.model.getColorClassName({classNameTypes:[J.FILL,J.STROKE],dataGroupName:d[a],originalClassName:"dot"})).style("fill",d=>{const f=this.services.cartesianScales.getDomainIdentifier(d);return this.model.getFillColor(d[a],d[f],d)}).style("stroke",d=>{const f=this.services.cartesianScales.getDomainIdentifier(d);return this.model.getStrokeColor(d[a],d[f],d)}).attr("fill-opacity",i.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=E(this.getOptions(),"bubble");return[{label:E(n,"radiusLabel"),value:t[E(n,"radiusMapsTo")]}]}}class Nk extends ht{constructor(){super(...arguments),this.type="bullet",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-simple-bar"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getComponentContainer({withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[c,l]=a.range(),[,u]=a.domain(),h=()=>{const m=[];s.forEach(v=>{v.ranges?v.ranges.forEach((b,w)=>{b!=null&&b<u&&m.push({datum:v,value:b,order:w+1})}):m.push({datum:v,order:1})});const g=I.appendOrSelect(r,"g.range-boxes").selectAll("path.range-box").data(m,v=>`${v[i]}-${v.order}`);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).attr("class",v=>`range-box order-${v.order}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-range-box-update-enter",animate:t})).attr("d",v=>{let b,w,O,_;return v.order===1?(b=this.services.cartesianScales.getDomainValue(v.datum)-16/2,w=b+16,O=l-2,_=c+1):(b=this.services.cartesianScales.getDomainValue(v.datum)-16/2,w=b+16,O=this.services.cartesianScales.getRangeValue(v.value),_=l),Jt({x0:b,x1:w,y0:O,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},d=()=>{const m=I.appendOrSelect(r,"g.bars").selectAll("path.bar").data(s,g=>g[i]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).classed("bar",!0).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"bullet-bar-update-enter",animate:t})).attr("class",g=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:g[i],originalClassName:"bar"})).style("fill",g=>this.model.getFillColor(g[i])).attr("d",g=>{const v=this.services.cartesianScales.getDomainValue(g)-4,b=v+8,w=this.services.cartesianScales.getRangeValue(0)+1,O=this.services.cartesianScales.getRangeValue(g);return Jt({x0:v,x1:b,y0:w,y1:O},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",g=>g.value)},f=()=>{const m=I.appendOrSelect(r,"g.markers").selectAll("path.marker").data(s.filter(g=>E(g,"marker")!==null),g=>g[i]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).classed("marker",!0).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"bullet-marker-update-enter",animate:t})).attr("d",g=>{const v=this.services.cartesianScales.getDomainValue(g)-12,b=v+24,w=this.services.cartesianScales.getRangeValue(g.marker);return Jt({x0:v,x1:b,y0:w,y1:w},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let m=[];s.filter(v=>E(v,"marker")!==null).forEach(v=>{const b=v.marker,w=v[o];m=m.concat([{datum:v,value:b*.25,barValue:w},{datum:v,value:b*.5,barValue:w},{datum:v,value:b*.75,barValue:w}])});const g=I.appendOrSelect(r,"g.quartiles").selectAll("path.quartile").data(m,v=>v[i]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).attr("class",v=>`quartile ${v.value<=v.barValue?"over-bar":""}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:v,value:b})=>{let w=4;v.ranges&&v.ranges.indexOf(b)!==-1&&(w=8);const O=this.services.cartesianScales.getDomainValue(v)-w/2,_=O+w,T=this.services.cartesianScales.getRangeValue(b);return Jt({x0:O,x1:_,y0:T,y1:T},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};h(),d(),f(),p(),this.addEventListeners()}addEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("path.bar").on("mouseover",function(s,a){const o=P(this);o.classed("hovered",!0),t.services.events.dispatchEvent(C.Bar.BAR_MOUSEOVER,{event:s,element:o,datum:a});const c=E(n,"bullet","performanceAreaTitles"),l=t.model.getMatchingRangeIndexForDatapoint(a);t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel||"Group",value:a[i],class:t.model.getColorClassName({classNameTypes:[J.TOOLTIP],dataGroupName:a[i]})},{label:"Value",value:a[r]},{label:"Target",value:a.marker},{label:"Percentage",value:`${Math.floor(a[r]/a.marker*100)}%`},{label:"Performance",value:c[l]}]})}).on("mousemove",function(s,a){t.services.events.dispatchEvent(C.Bar.BAR_MOUSEMOVE,{event:s,element:P(this),datum:a}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(C.Bar.BAR_CLICK,{event:s,element:P(this),datum:a})}).on("mouseout",function(s,a){const o=P(this);o.classed("hovered",!1),t.services.events.dispatchEvent(C.Bar.BAR_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:o})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function Uk(e){return e}function Bk(e){if(e==null)return Uk;var t,n,i=e.scale[0],r=e.scale[1],s=e.translate[0],a=e.translate[1];return function(o,c){c||(t=n=0);var l=2,u=o.length,h=new Array(u);for(h[0]=(t+=o[0])*i+s,h[1]=(n+=o[1])*r+a;l<u;)h[l]=o[l],++l;return h}}function Hk(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function Vk(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Qg(e,n)})}:Qg(e,t)}function Qg(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,s=wc(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:s}:i==null?{type:"Feature",id:n,properties:r,geometry:s}:{type:"Feature",id:n,bbox:i,properties:r,geometry:s}}function wc(e,t){var n=Bk(e.transform),i=e.arcs;function r(u,h){h.length&&h.pop();for(var d=i[u<0?~u:u],f=0,p=d.length;f<p;++f)h.push(n(d[f],f));u<0&&Hk(h,p)}function s(u){return n(u)}function a(u){for(var h=[],d=0,f=u.length;d<f;++d)r(u[d],h);return h.length<2&&h.push(h[0]),h}function o(u){for(var h=a(u);h.length<4;)h.push(h[0]);return h}function c(u){return u.map(o)}function l(u){var h=u.type,d;switch(h){case"GeometryCollection":return{type:h,geometries:u.geometries.map(l)};case"Point":d=s(u.coordinates);break;case"MultiPoint":d=u.coordinates.map(s);break;case"LineString":d=a(u.arcs);break;case"MultiLineString":d=u.arcs.map(a);break;case"Polygon":d=c(u.arcs);break;case"MultiPolygon":d=u.arcs.map(c);break;default:return null}return{type:h,coordinates:d}}return l(t)}function Gk(e,t){var n={},i={},r={},s=[],a=-1;t.forEach(function(l,u){var h=e.arcs[l<0?~l:l],d;h.length<3&&!h[1][0]&&!h[1][1]&&(d=t[++a],t[a]=l,t[u]=d)}),t.forEach(function(l){var u=o(l),h=u[0],d=u[1],f,p;if(f=r[h])if(delete r[f.end],f.push(l),f.end=d,p=i[d]){delete i[p.start];var m=p===f?f:f.concat(p);i[m.start=f.start]=r[m.end=p.end]=m}else i[f.start]=r[f.end]=f;else if(f=i[d])if(delete i[f.start],f.unshift(l),f.start=h,p=r[h]){delete r[p.end];var g=p===f?f:p.concat(f);i[g.start=p.start]=r[g.end=f.end]=g}else i[f.start]=r[f.end]=f;else f=[l],i[f.start=h]=r[f.end=d]=f});function o(l){var u=e.arcs[l<0?~l:l],h=u[0],d;return e.transform?(d=[0,0],u.forEach(function(f){d[0]+=f[0],d[1]+=f[1]})):d=u[u.length-1],l<0?[d,h]:[h,d]}function c(l,u){for(var h in l){var d=l[h];delete u[d.start],delete d.start,delete d.end,d.forEach(function(f){n[f<0?~f:f]=1}),s.push(d)}}return c(r,i),c(i,r),t.forEach(function(l){n[l<0?~l:l]||s.push([l])}),s}function Fk(e){for(var t=-1,n=e.length,i,r=e[n-1],s=0;++t<n;)i=r,r=e[t],s+=i[0]*r[1]-i[1]*r[0];return Math.abs(s)}function zk(e){return wc(e,jk.apply(this,arguments))}function jk(e,t){var n={},i=[],r=[];t.forEach(s);function s(c){switch(c.type){case"GeometryCollection":c.geometries.forEach(s);break;case"Polygon":a(c.arcs);break;case"MultiPolygon":c.arcs.forEach(a);break}}function a(c){c.forEach(function(l){l.forEach(function(u){(n[u=u<0?~u:u]||(n[u]=[])).push(c)})}),i.push(c)}function o(c){return Fk(wc(e,{type:"Polygon",arcs:[c]}).coordinates[0])}return i.forEach(function(c){if(!c._){var l=[],u=[c];for(c._=1,r.push(l);c=u.pop();)l.push(c),c.forEach(function(h){h.forEach(function(d){n[d<0?~d:d].forEach(function(f){f._||(f._=1,u.push(f))})})})}}),i.forEach(function(c){delete c._}),{type:"MultiPolygon",arcs:r.map(function(c){var l=[],u;if(c.forEach(function(m){m.forEach(function(g){g.forEach(function(v){n[v<0?~v:v].length<2&&l.push(v)})})}),l=Gk(e,l),(u=l.length)>1)for(var h=1,d=o(l[0]),f,p;h<u;++h)(f=o(l[h]))>d&&(p=l[0],l[0]=l[h],l[h]=p,d=f);return l}).filter(function(c){return c.length>0})}}class Wk extends vn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=K.SVG}showRuler(t,[n,i]){const r=this.parent,s=this.model.getOptions(),{cartesianScales:a}=this.services,o=a.getOrientation(),c=a.getRangeScale(),[l,u]=c.range(),h=a.getDomainScale(),d=h.invert(o===Ht.VERTICAL?n:i),f=I.appendOrSelect(r,"g.ruler").attr("aria-label","ruler"),p=I.appendOrSelect(f,"line.ruler-line"),m=r.selectAll("[role=graphics-symbol]").filter(g=>{if(parseFloat(St(g,"data.x0"))<=d&&parseFloat(St(g,"data.x1"))>=d)return!0});if(m.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!$g(this.elementsToHighlight,m)&&this.hideRuler(),m.dispatch("mouseover"),this.elementsToHighlight=m;const g=P(m.nodes()[0]).datum(),v=parseFloat(St(g,"data.x0")),b=parseFloat(St(g,"data.x1")),w=this.model.getActiveDataGroupNames(),O=w.reverse().map(_=>({label:_,value:St(g,`data.${_}`),class:this.model.getColorClassName({classNameTypes:[J.TOOLTIP],dataGroupName:_})})).filter(_=>_.value!==0);if(O.length>0){this.services.events.dispatchEvent(C.Tooltip.SHOW,{mousePosition:[n,i],hoveredElement:p,items:[{label:St(s,"bins.rangeLabel")||"Range",value:`${v} – ${b}`},...O,...E(s,"tooltip","showTotal")===!0?[{label:St(s,"tooltip.totalLabel")||"Total",value:w.reduce((T,S)=>T+parseFloat(St(g,`data.${S}`)),0)}]:[]]}),f.attr("opacity",1);const _=h((v+b)/2);o==="horizontal"?p.attr("x1",u).attr("x2",l).attr("y1",_).attr("y2",_):p.attr("y1",u).attr("y2",l).attr("x1",_).attr("x2",_)}else this.hideRuler()}else this.hideRuler()}}class La extends vn{formatTooltipData(t){return t.reverse()}}class Jg extends xc{constructor(t,n,i){super(t,n,i),this.type="color-legend",this.renderType=K.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const r=this.getComponentContainer(),{width:s}=I.getSVGElementSize(r,{useAttrs:!0}),a=E(this.getOptions(),"data","loading");if(s>Lt.color.barWidth&&!a){const o=E(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:c}=this.services,l=c.getMainXScale().range();if(l[0]>1&&(r.select("g.legend").attr("transform",`translate(${l[0]}, 0)`),o)){const{width:u}=I.getSVGElementSize(r.select("g.legend-title").select("text"),{useBBox:!0}),h=l[0]-u-9;h>1?r.select("g.legend-title").attr("transform",`translate(${h}, 0)`):(r.select("g.legend").attr("transform",`translate(${l[0]}, 16)`),r.select("g.legend-title").attr("transform",`translate(${l[0]}, 0)`))}}else r.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=i.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(C.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!0){const n=this.getOptions(),i=this.getComponentContainer(),{width:r}=I.getSVGElementSize(i,{useAttrs:!0}),s=E(n,"color","gradient","colors"),a=E(n,this.chartType,"colorLegend","type");let o=E(n,"color","pairing","option");const c=E(n,"heatmap","colorLegend","title");if(E(this.getOptions(),"data","loading")){i.html("");return}const l=!Ce(s),u=Yp(this.model.getDisplayData()),h=!(r<=Lt.color.barWidth),d=h?Lt.color.barWidth:r,f=I.appendOrSelect(i,"g.legend"),p=I.appendOrSelect(f,"g.legend-axis");if(c){const S=I.appendOrSelect(i,"g.legend-title");I.appendOrSelect(S,"text").text(c).attr("dy","0.7em"),f.attr("transform","translate(0, 16)")}const m=u[0]<0&&u[1]>0?"diverge":"mono";(o<1&&o>4&&m==="mono"||o<1&&o>2&&m==="diverge")&&(o=1);let g=[];const v=m==="diverge"?17:11;if(l)g=s;else for(let S=1;S<v+1;S++)g.push(a===Ys.LINEAR?`stop-color-${m}-${o}-${S}`:`fill-${m}-${o}-${S}`);const b=le(u[0],u[1]),w=Hy(b,3),O=Se().domain(u).range([0,d]),_=Ua(O).tickSize(0).tickValues(w);let T;switch(a){case Ys.LINEAR:this.drawLinear(g,f,d);break;case Ys.QUANTIZE:T=this.drawQuantize(g,m,l,f,d),O.range([T,d]);break;default:throw Error("Entered color legend type is not supported.")}p.attr("transform",`translate(0,${Lt.color.axisYTranslation})`).call(_),p.select(".domain").remove(),p.select("g.tick:last-of-type text").style("text-anchor",h?"middle":"end"),p.select("g.tick:first-of-type text").style("text-anchor",h&&this.chartType!=="choropleth"?"middle":"start")}drawLinear(t,n,i){const r=100/(t.length-1);I.appendOrSelect(n,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(t).enter().append("stop").attr("offset",(s,a)=>`${a*r}%`).attr("class",(s,a)=>t[a]).attr("stop-color",s=>s),I.appendOrSelect(n,"rect").attr("width",i).attr("height",Lt.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(t,n,i,r,s){!i&&n==="diverge"&&t.splice(t.length/2,1);const a=er().domain(t).range([0,s]);return I.appendOrSelect(r,"g.quantized-rect").selectAll("rect").data(a.domain()).join("rect").attr("x",o=>a(o)).attr("y",0).attr("width",Math.max(0,a.bandwidth()-1)).attr("height",Lt.color.barHeight).attr("class",o=>o).attr("fill",o=>o),(!i&&n)==="mono"?a.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(C.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class qk extends Pr{constructor(){super(...arguments),this.type="meter-title",this.renderType=K.SVG}render(t=!0){const n=E(this.model.getDisplayData(),0),i=this.getOptions(),r=this.getComponentContainer(),{groupMapsTo:s}=i.data;if(E(i,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const c=r.selectAll("text.meter-title").data([n[s]]);c.enter().append("text").classed("meter-title",!0).merge(c).attr("x",0).attr("y","1em").text(l=>l),c.exit().remove(),this.appendPercentage()}this.displayStatus();const a=this.getMaxTitleWidth(),o=I.appendOrSelect(r,"text.meter-title");a>0&&o.node().getComputedTextLength()>a&&this.truncateTitle(o,a)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),i=this.model.getMaximumDomain(this.model.getDisplayData()),r=E(n,"meter","proportional","total"),s=E(n,"meter","proportional","unit")?E(n,"meter","proportional","unit"):"";let a;if(i===r)a=null;else{const u=r!==null?r-i:i,h=E(n,"meter","proportional","breakdownFormatter");a=h!==null?h({datasetsTotal:i,total:r}):`${i} ${s} used (${u} ${s} available)`}const o=t.selectAll("text.proportional-meter-title").data([a]);o.enter().append("text").classed("proportional-meter-title",!0).merge(o).attr("x",0).attr("y","1em").text(u=>u),o.exit().remove();const c=this.getMaxTitleWidth(),l=I.appendOrSelect(t,"text.proportional-meter-title");c>0&&l.node().getComputedTextLength()>c&&this.truncateTitle(l,c)}displayTotal(){const t=this.getComponentContainer(),n=this.getOptions(),i=E(n,"meter","proportional","total"),r=i?E(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=E(n,"meter","proportional","unit")?E(n,"meter","proportional","unit"):"",a=E(n,"meter","proportional","totalFormatter"),o=a!==null?a(r):`${i} ${s} total`,c=I.getHTMLElementSize(this.services.domUtils.getMainContainer()),l=c.width?c.width:this.parent.node().getAttribute("width"),u=t.selectAll("text.proportional-meter-total").data([o]);u.enter().append("text").classed("proportional-meter-total",!0).merge(u).attr("x",this.model.getStatus()&&typeof l!="string"?l-Vt.total.paddingRight:l).attr("y","1em").attr("text-anchor","end").text(h=>h),u.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),i=I.getHTMLElementSize(this.services.domUtils.getMainContainer()),r=i.width?i.width:0,s=this.model.getStatus(),a=Vt.status.indicatorSize/2,o=I.appendOrSelect(n,"g.status-indicator").attr("class",s!==null?`status-indicator status--${s}`:"").attr("transform",`translate(${r-a}, 0)`),c=s?[s]:[],l=o.selectAll("circle.status").data(c);l.enter().append("circle").merge(l).attr("class","status").attr("r",a).attr("cx",0).attr("cy",8);const u=o.selectAll("path.innerFill").data(c);u.enter().append("path").merge(u).attr("d",t.getStatusIconPathString(s)).attr("transform",`translate(-${a}, 0)`).attr("class","innerFill"),u.exit().remove(),l.exit().remove()}appendPercentage(){const t=E(this.model.getDisplayData(),0,"value"),n=this.getComponentContainer(),i=I.appendOrSelect(n,"text.meter-title"),r=E(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],s=n.selectAll("text.percent-value").data(r),a=Vt.statusBar.paddingRight;s.enter().append("text").classed("percent-value",!0).merge(s).text(o=>`${o}%`).attr("x",+i.attr("x")+i.node().getComputedTextLength()+a).attr("y",i.attr("y")),s.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const i=I.appendOrSelect(this.parent,"tspan"),r=Vt.statusBar.paddingRight,s=Math.ceil(i.node().getComputedTextLength());I.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+r)}getMaxTitleWidth(){const t=I.getHTMLElementSize(this.services.domUtils.getMainContainer()),n=E(this.getOptions(),"meter","proportional"),i=t.width?t.width:this.parent.node().getBoundingClientRect().width;if(n!==null){const r=I.appendOrSelect(this.parent,"text.proportional-meter-total").node(),s=I.getSVGElementSize(r,{useBBox:!0}).width;return i-s-Vt.total.paddingLeft}else{const r=I.appendOrSelect(this.parent,"text.percent-value"),s=Vt.statusBar.paddingRight,a=r.node().getComputedTextLength(),o=I.appendOrSelect(this.parent,"g.status-indicator").node(),c=I.getSVGElementSize(o,{useBBox:!0}).width+Vt.status.paddingLeft;return i-a-s-c}}getStatusIconPathString(t){switch(t){case Ws.SUCCESS:return"M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z";case Ws.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case Ws.WARNING:return"M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z"}}}class Ec extends ht{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const n=this.model.getDisplayData().length,i=this.services.cartesianScales.getMainXScale(),r=I.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!i.step){const s=E(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,r*s/n)}return Math.min(t.bars.maxWidth,i.step()/2)}isOutsideZoomedDomain(t,n){if(this.model.getDisplayData().length<=1)return!1;const i=this.model.get("zoomDomain");if(i!==void 0){const r=this.services.cartesianScales.getDomainScale();return t<r(i[0])||n>r(i[1])}return!1}}class Yk extends ht{constructor(){super(...arguments),this.type="circle-pack",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-circlepack"})).attr("opacity",i=>i.data.dataGroupName===n.datum().name?1:Rn.circles.fillOpacity)},this.handleLegendMouseOut=()=>{this.parent.selectAll("circle.node").transition("legend-mouseout-circlepack").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-circlepack"})).attr("opacity",1)}}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),{width:i,height:r}=I.getSVGElementSize(this.parent,{useAttrs:!0});if(i<1||r<1)return;let s=this.model.getDisplayData();const a=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),c=this.getOptions(),l=E(c,"canvasZoom","enabled");a&&E(s,0,"children")&&(s=E(s,0,"children"));const u=Qi({children:s}).sum(p=>p.value).sort((p,m)=>m.value-p.value),h=ew().size([i,r]).padding(p=>p.depth>=1?Rn.padding.children+3:Rn.padding.mainGroup+3)(u).descendants().splice(1).filter(p=>p.depth<=o),d=n.selectAll("circle.node").data(h);d.exit().attr("width",0).attr("height",0).remove();const f=d.enter().append("circle").classed("node",!0);f.merge(d).attr("class",p=>{const m=l&&o===3?this.getZoomClass(p):"";return this.model.getColorClassName({classNameTypes:[J.FILL,J.STROKE],dataGroupName:p.data.dataGroupName,originalClassName:p.children?`node ${m}`:`node node-leaf ${m}`})}).style("fill",p=>this.model.getFillColor(p.data.dataGroupName)).style("stroke",p=>this.model.getFillColor(p.data.dataGroupName)).attr("cx",p=>p.x).attr("cy",p=>p.y).transition("circlepack-leaf-update-enter").call(p=>this.services.transitions.setupTransition({transition:p,name:"circlepack-leaf-update-enter"})).attr("r",p=>p.r).attr("opacity",1).attr("fill-opacity",Rn.circles.fillOpacity),l===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,f,mi),this.setBackgroundListeners()),a||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(t){const n=t.map(i=>i.data);this.parent.selectAll("circle.node").filter(i=>n.some(r=>r===i.data)&&i.depth>1).style("stroke",i=>this.model.getFillColor(i.data.dataGroupName))}highlightChildren(t){const n=t.map(i=>i.data);this.parent.selectAll("circle.node").filter(i=>n.some(r=>r===i.data)&&i.depth>1).style("stroke",Rn.circles.hover.stroke)}getZoomClass(t){return this.model.getHierarchyLevel()===3&&this.focal&&(t.data===this.focal.data||this.focal.children.some(n=>n.data===t.data))?"focal":"non-focal"}addLegendListeners(){const{events:t}=this.services;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){P(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=P(this.services.domUtils.getMainContainer()),n=this,i=this.parent.selectAll("circle.node"),r=E(Vp,"canvasZoomSettings");t.on("click",()=>{n.focal=null,n.model.updateHierarchyLevel(2),t.classed("zoomed-in",!1),n.services.canvasZoom.zoomOut(i,r)})}getZoomIcon(){return`
79
+ `;l.html(u),h();function h(){l.attr("gradientTransform",`translate(${a-3*.2*s}, 0)`).transition().duration(2e3).delay(1e3).ease(G1).attr("gradientTransform",`translate(${o+3*.2*s}, 0)`).on("end",h)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class kk extends ht{constructor(){super(...arguments),this.type="boxplot",this.renderType=K.SVG}render(t){const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:r}=i.data,s=this.model.getDataGroupNames(),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[c,l]=a.range(),[u,h]=o.range(),d=l-c,f=u-h;if(d===0)return;const{cartesianScales:p}=this.services,m=p.getOrientation(),g=m===Ht.VERTICAL,[v,b]=sn(M=>this.services.cartesianScales.getDomainValue(M),M=>this.services.cartesianScales.getRangeValue(M),m),w=Math.floor((g?d:f)/s.length),O=Math.min(w/2,16),_=this.model.getBoxplotData(),T=n.selectAll(".box-group").data(_);T.exit().remove();const S=T.enter().append("g").attr("class","box-group"),$=T.merge(S);S.append("path").merge(T.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[J.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",pe.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalstartline",animate:t})).attr("d",M=>{const B=p.getDomainValue(M[r]),x=B,A=p.getRangeValue(M.whiskers.min),y=p.getRangeValue(M.quartiles.q_25);return Qt({x0:B,x1:x,y0:A,y1:y},m)}),S.append("path").merge(T.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[J.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",pe.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalendline",animate:t})).attr("d",M=>{const B=p.getDomainValue(M[r]),x=B,A=p.getRangeValue(M.whiskers.max),y=p.getRangeValue(M.quartiles.q_75);return Qt({x0:B,x1:x,y0:A,y1:y},m)}),S.append("path").merge(T.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[J.FILL,J.STROKE],originalClassName:"box"})).attr("fill-opacity",pe.box.opacity.default).attr("stroke-width",pe.strokeWidth.default).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",M=>M[r]).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-quartiles",animate:t})).attr("d",M=>{const B=p.getDomainValue(M[r])-O/2,x=B+O,A=p.getRangeValue(Math[g?"max":"min"](M.quartiles.q_75,M.quartiles.q_25)),y=A+Math.abs(p.getRangeValue(M.quartiles.q_75)-p.getRangeValue(M.quartiles.q_25));return Qt({x0:B,x1:x,y0:A,y1:y},m)}),S.append("path").merge(T.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",M=>{const B=p.getDomainValue(M[r])-O/2,x=B+O,A=p.getRangeValue(M.whiskers.min),y=p.getRangeValue(M.whiskers.max);return Qt({x0:B,x1:x,y0:A,y1:y},m)}),S.append("path").merge(T.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[J.STROKE],originalClassName:"whisker start"})).attr("stroke-width",pe.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-startingwhisker",animate:t})).attr("d",M=>{const B=p.getDomainValue(M[r])-O/4,x=B+O/2,A=p.getRangeValue(M.whiskers.min),y=p.getRangeValue(M.whiskers.min);return Qt({x0:B,x1:x,y0:A,y1:y},m)}),S.append("path").merge(T.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[J.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-median",animate:t})).attr("d",M=>{const B=p.getDomainValue(M[r])-O/2,x=B+O,A=p.getRangeValue(M.quartiles.q_50);return Qt({x0:B,x1:x,y0:A,y1:A},m)}),S.append("path").merge(T.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[J.STROKE],originalClassName:"whisker end"})).attr("stroke-width",pe.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-endingwhisker",animate:t})).attr("d",M=>{const B=p.getDomainValue(M[r])-O/4,x=B+O/2,A=p.getRangeValue(M.whiskers.max),y=p.getRangeValue(M.whiskers.max);return Qt({x0:B,x1:x,y0:A,y1:y},m)});const D=$.selectAll("circle.outlier").data(M=>M.outliers.map(B=>({min:M.whiskers.min,max:M.whiskers.max,[r]:M[r],value:B})));D.exit().remove();const L=D.enter().append("circle");D.merge(L).attr("r",pe.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[J.FILL,J.STROKE],originalClassName:"outlier"})).attr("fill-opacity",pe.circle.opacity.default).attr("cx",v).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-circles",animate:t})).attr("cy",b),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:i}=n.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(r,s){const a=P(this);P(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",pe.box.opacity.hovered),t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:r,hoveredElement:a,items:[{label:n.tooltip.groupLabel,value:s[i],class:t.model.getColorClassName({classNameTypes:[J.TOOLTIP]})},{label:"Minimum",value:s.whiskers.min},{label:"Q1",value:s.quartiles.q_25},{label:"Median",value:s.quartiles.q_50},{label:"Q3",value:s.quartiles.q_75},{label:"Maximum",value:s.whiskers.max},{label:"IQR",value:s.quartiles.q_75-s.quartiles.q_25}]}),t.services.events.dispatchEvent(C.Boxplot.BOX_MOUSEOVER,{event:r,element:a,datum:s})}).on("mousemove",function(r,s){const a=P(this);t.services.events.dispatchEvent(C.Boxplot.BOX_MOUSEMOVE,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:r})}).on("click",function(r,s){t.services.events.dispatchEvent(C.Boxplot.BOX_CLICK,{event:r,element:P(this),datum:s})}).on("mouseout",function(r,s){const a=P(this);P(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",pe.box.opacity.default),t.services.events.dispatchEvent(C.Boxplot.BOX_MOUSEOUT,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:a})})}addCircleEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(s,a){const o=P(this);o.classed("hovered",!0).attr("fill-opacity",pe.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel,value:a[i],class:t.model.getColorClassName({classNameTypes:[J.TOOLTIP]})},{label:"Outlier",value:a[r]}]}),t.services.events.dispatchEvent(C.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=P(this);t.services.events.dispatchEvent(C.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(C.Boxplot.OUTLIER_CLICK,{event:s,element:P(this),datum:a})}).on("mouseout",function(s,a){const o=P(this);o.classed("hovered",!1).attr("fill-opacity",pe.circle.opacity.default),t.services.events.dispatchEvent(C.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:o})})}}class Ci extends ht{constructor(){super(...arguments),this.type="zero-line",this.renderType=K.SVG}render(t){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),i=this.services.cartesianScales.getScaleByPosition(n),[r,s]=i.domain(),a=r>0&&s<0||r<0&&s>0,o=this.getComponentContainer();if(!a){o.selectAll("line.domain").remove();return}const[c,l]=this.services.cartesianScales.getDomainScale().range();let u=+i(0)+.5;u||(u=i.range()[0]);const h=Cp({x0:c,x1:l,y0:u,y1:u},this.services.cartesianScales.getOrientation());R.appendOrSelect(o,"line.domain").transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"zero-line-update",animate:t})).attr("y1",h.y0).attr("y2",h.y1).attr("x1",h.x0).attr("x2",h.x1)}}class Rk extends Ue{constructor(){super(...arguments),this.type="bubble",this.renderType=K.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:i}=n.bubble,r=t.data(),s=r.map(l=>l[i]).filter(l=>l),a=R.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,c=o?ye(s):[1,1];return _e().domain(c).range(o?n.bubble.radiusRange(a,r):[4,4])}styleCircles(t,n){const i=this.getOptions(),{radiusMapsTo:r}=i.bubble,s=this.getRadiusScale(t),{groupMapsTo:a}=i.data,{cartesianScales:o}=this.services,c=d=>o.getDomainValue(d),l=d=>o.getRangeValue(d),[u,h]=sn(c,l,o.getOrientation());t.raise().classed("dot",!0).attr("role",at.GRAPHICS_SYMBOL).attr("aria-label",d=>{const f=o.getRangeIdentifier(d);return d[f]}).transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"bubble-update-enter",animate:n})).attr("cx",u).attr("cy",h).attr("r",d=>s(d[r]||1)).attr("class",d=>this.model.getColorClassName({classNameTypes:[J.FILL,J.STROKE],dataGroupName:d[a],originalClassName:"dot"})).style("fill",d=>{const f=this.services.cartesianScales.getDomainIdentifier(d);return this.model.getFillColor(d[a],d[f],d)}).style("stroke",d=>{const f=this.services.cartesianScales.getDomainIdentifier(d);return this.model.getStrokeColor(d[a],d[f],d)}).attr("fill-opacity",i.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=E(this.getOptions(),"bubble");return[{label:E(n,"radiusLabel"),value:t[E(n,"radiusMapsTo")]}]}}class Ik extends ht{constructor(){super(...arguments),this.type="bullet",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-simple-bar"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getComponentContainer({withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[c,l]=a.range(),[,u]=a.domain(),h=()=>{const m=[];s.forEach(v=>{v.ranges?v.ranges.forEach((b,w)=>{b!=null&&b<u&&m.push({datum:v,value:b,order:w+1})}):m.push({datum:v,order:1})});const g=R.appendOrSelect(r,"g.range-boxes").selectAll("path.range-box").data(m,v=>`${v[i]}-${v.order}`);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).attr("class",v=>`range-box order-${v.order}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-range-box-update-enter",animate:t})).attr("d",v=>{let b,w,O,_;return v.order===1?(b=this.services.cartesianScales.getDomainValue(v.datum)-16/2,w=b+16,O=l-2,_=c+1):(b=this.services.cartesianScales.getDomainValue(v.datum)-16/2,w=b+16,O=this.services.cartesianScales.getRangeValue(v.value),_=l),Qt({x0:b,x1:w,y0:O,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},d=()=>{const m=R.appendOrSelect(r,"g.bars").selectAll("path.bar").data(s,g=>g[i]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).classed("bar",!0).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"bullet-bar-update-enter",animate:t})).attr("class",g=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:g[i],originalClassName:"bar"})).style("fill",g=>this.model.getFillColor(g[i])).attr("d",g=>{const v=this.services.cartesianScales.getDomainValue(g)-4,b=v+8,w=this.services.cartesianScales.getRangeValue(0)+1,O=this.services.cartesianScales.getRangeValue(g);return Qt({x0:v,x1:b,y0:w,y1:O},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",g=>g.value)},f=()=>{const m=R.appendOrSelect(r,"g.markers").selectAll("path.marker").data(s.filter(g=>E(g,"marker")!==null),g=>g[i]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).classed("marker",!0).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"bullet-marker-update-enter",animate:t})).attr("d",g=>{const v=this.services.cartesianScales.getDomainValue(g)-12,b=v+24,w=this.services.cartesianScales.getRangeValue(g.marker);return Qt({x0:v,x1:b,y0:w,y1:w},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let m=[];s.filter(v=>E(v,"marker")!==null).forEach(v=>{const b=v.marker,w=v[o];m=m.concat([{datum:v,value:b*.25,barValue:w},{datum:v,value:b*.5,barValue:w},{datum:v,value:b*.75,barValue:w}])});const g=R.appendOrSelect(r,"g.quartiles").selectAll("path.quartile").data(m,v=>v[i]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).attr("class",v=>`quartile ${v.value<=v.barValue?"over-bar":""}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:v,value:b})=>{let w=4;v.ranges&&v.ranges.indexOf(b)!==-1&&(w=8);const O=this.services.cartesianScales.getDomainValue(v)-w/2,_=O+w,T=this.services.cartesianScales.getRangeValue(b);return Qt({x0:O,x1:_,y0:T,y1:T},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};h(),d(),f(),p(),this.addEventListeners()}addEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("path.bar").on("mouseover",function(s,a){const o=P(this);o.classed("hovered",!0),t.services.events.dispatchEvent(C.Bar.BAR_MOUSEOVER,{event:s,element:o,datum:a});const c=E(n,"bullet","performanceAreaTitles"),l=t.model.getMatchingRangeIndexForDatapoint(a);t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel||"Group",value:a[i],class:t.model.getColorClassName({classNameTypes:[J.TOOLTIP],dataGroupName:a[i]})},{label:"Value",value:a[r]},{label:"Target",value:a.marker},{label:"Percentage",value:`${Math.floor(a[r]/a.marker*100)}%`},{label:"Performance",value:c[l]}]})}).on("mousemove",function(s,a){t.services.events.dispatchEvent(C.Bar.BAR_MOUSEMOVE,{event:s,element:P(this),datum:a}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(C.Bar.BAR_CLICK,{event:s,element:P(this),datum:a})}).on("mouseout",function(s,a){const o=P(this);o.classed("hovered",!1),t.services.events.dispatchEvent(C.Bar.BAR_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:o})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function Pk(e){return e}function Nk(e){if(e==null)return Pk;var t,n,i=e.scale[0],r=e.scale[1],s=e.translate[0],a=e.translate[1];return function(o,c){c||(t=n=0);var l=2,u=o.length,h=new Array(u);for(h[0]=(t+=o[0])*i+s,h[1]=(n+=o[1])*r+a;l<u;)h[l]=o[l],++l;return h}}function Uk(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function Bk(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Wg(e,n)})}:Wg(e,t)}function Wg(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,s=mc(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:s}:i==null?{type:"Feature",id:n,properties:r,geometry:s}:{type:"Feature",id:n,bbox:i,properties:r,geometry:s}}function mc(e,t){var n=Nk(e.transform),i=e.arcs;function r(u,h){h.length&&h.pop();for(var d=i[u<0?~u:u],f=0,p=d.length;f<p;++f)h.push(n(d[f],f));u<0&&Uk(h,p)}function s(u){return n(u)}function a(u){for(var h=[],d=0,f=u.length;d<f;++d)r(u[d],h);return h.length<2&&h.push(h[0]),h}function o(u){for(var h=a(u);h.length<4;)h.push(h[0]);return h}function c(u){return u.map(o)}function l(u){var h=u.type,d;switch(h){case"GeometryCollection":return{type:h,geometries:u.geometries.map(l)};case"Point":d=s(u.coordinates);break;case"MultiPoint":d=u.coordinates.map(s);break;case"LineString":d=a(u.arcs);break;case"MultiLineString":d=u.arcs.map(a);break;case"Polygon":d=c(u.arcs);break;case"MultiPolygon":d=u.arcs.map(c);break;default:return null}return{type:h,coordinates:d}}return l(t)}function Hk(e,t){var n={},i={},r={},s=[],a=-1;t.forEach(function(l,u){var h=e.arcs[l<0?~l:l],d;h.length<3&&!h[1][0]&&!h[1][1]&&(d=t[++a],t[a]=l,t[u]=d)}),t.forEach(function(l){var u=o(l),h=u[0],d=u[1],f,p;if(f=r[h])if(delete r[f.end],f.push(l),f.end=d,p=i[d]){delete i[p.start];var m=p===f?f:f.concat(p);i[m.start=f.start]=r[m.end=p.end]=m}else i[f.start]=r[f.end]=f;else if(f=i[d])if(delete i[f.start],f.unshift(l),f.start=h,p=r[h]){delete r[p.end];var g=p===f?f:p.concat(f);i[g.start=p.start]=r[g.end=f.end]=g}else i[f.start]=r[f.end]=f;else f=[l],i[f.start=h]=r[f.end=d]=f});function o(l){var u=e.arcs[l<0?~l:l],h=u[0],d;return e.transform?(d=[0,0],u.forEach(function(f){d[0]+=f[0],d[1]+=f[1]})):d=u[u.length-1],l<0?[d,h]:[h,d]}function c(l,u){for(var h in l){var d=l[h];delete u[d.start],delete d.start,delete d.end,d.forEach(function(f){n[f<0?~f:f]=1}),s.push(d)}}return c(r,i),c(i,r),t.forEach(function(l){n[l<0?~l:l]||s.push([l])}),s}function Vk(e){for(var t=-1,n=e.length,i,r=e[n-1],s=0;++t<n;)i=r,r=e[t],s+=i[0]*r[1]-i[1]*r[0];return Math.abs(s)}function Gk(e){return mc(e,Fk.apply(this,arguments))}function Fk(e,t){var n={},i=[],r=[];t.forEach(s);function s(c){switch(c.type){case"GeometryCollection":c.geometries.forEach(s);break;case"Polygon":a(c.arcs);break;case"MultiPolygon":c.arcs.forEach(a);break}}function a(c){c.forEach(function(l){l.forEach(function(u){(n[u=u<0?~u:u]||(n[u]=[])).push(c)})}),i.push(c)}function o(c){return Vk(mc(e,{type:"Polygon",arcs:[c]}).coordinates[0])}return i.forEach(function(c){if(!c._){var l=[],u=[c];for(c._=1,r.push(l);c=u.pop();)l.push(c),c.forEach(function(h){h.forEach(function(d){n[d<0?~d:d].forEach(function(f){f._||(f._=1,u.push(f))})})})}}),i.forEach(function(c){delete c._}),{type:"MultiPolygon",arcs:r.map(function(c){var l=[],u;if(c.forEach(function(m){m.forEach(function(g){g.forEach(function(v){n[v<0?~v:v].length<2&&l.push(v)})})}),l=Hk(e,l),(u=l.length)>1)for(var h=1,d=o(l[0]),f,p;h<u;++h)(f=o(l[h]))>d&&(p=l[0],l[0]=l[h],l[h]=p,d=f);return l}).filter(function(c){return c.length>0})}}class zk extends vn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=K.SVG}showRuler(t,[n,i]){const r=this.parent,s=this.model.getOptions(),{cartesianScales:a}=this.services,o=a.getOrientation(),c=a.getRangeScale(),[l,u]=c.range(),h=a.getDomainScale(),d=h.invert(o===Ht.VERTICAL?n:i),f=R.appendOrSelect(r,"g.ruler").attr("aria-label","ruler"),p=R.appendOrSelect(f,"line.ruler-line"),m=r.selectAll("[role=graphics-symbol]").filter(g=>{if(parseFloat(St(g,"data.x0"))<=d&&parseFloat(St(g,"data.x1"))>=d)return!0});if(m.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Sg(this.elementsToHighlight,m)&&this.hideRuler(),m.dispatch("mouseover"),this.elementsToHighlight=m;const g=P(m.nodes()[0]).datum(),v=parseFloat(St(g,"data.x0")),b=parseFloat(St(g,"data.x1")),w=this.model.getActiveDataGroupNames(),O=w.reverse().map(_=>({label:_,value:St(g,`data.${_}`),class:this.model.getColorClassName({classNameTypes:[J.TOOLTIP],dataGroupName:_})})).filter(_=>_.value!==0);if(O.length>0){this.services.events.dispatchEvent(C.Tooltip.SHOW,{mousePosition:[n,i],hoveredElement:p,items:[{label:St(s,"bins.rangeLabel")||"Range",value:`${v} – ${b}`},...O,...E(s,"tooltip","showTotal")===!0?[{label:St(s,"tooltip.totalLabel")||"Total",value:w.reduce((T,S)=>T+parseFloat(St(g,`data.${S}`)),0)}]:[]]}),f.attr("opacity",1);const _=h((v+b)/2);o==="horizontal"?p.attr("x1",u).attr("x2",l).attr("y1",_).attr("y2",_):p.attr("y1",u).attr("y2",l).attr("x1",_).attr("x2",_)}else this.hideRuler()}else this.hideRuler()}}class La extends vn{formatTooltipData(t){return t.reverse()}}class qg extends pc{constructor(t,n,i){super(t,n,i),this.type="color-legend",this.renderType=K.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const r=this.getComponentContainer(),{width:s}=R.getSVGElementSize(r,{useAttrs:!0}),a=E(this.getOptions(),"data","loading");if(s>Lt.color.barWidth&&!a){const o=E(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:c}=this.services,l=c.getMainXScale().range();if(l[0]>1&&(r.select("g.legend").attr("transform",`translate(${l[0]}, 0)`),o)){const{width:u}=R.getSVGElementSize(r.select("g.legend-title").select("text"),{useBBox:!0}),h=l[0]-u-9;h>1?r.select("g.legend-title").attr("transform",`translate(${h}, 0)`):(r.select("g.legend").attr("transform",`translate(${l[0]}, 16)`),r.select("g.legend-title").attr("transform",`translate(${l[0]}, 0)`))}}else r.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=i.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(C.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!0){const n=this.getOptions(),i=this.getComponentContainer(),{width:r}=R.getSVGElementSize(i,{useAttrs:!0}),s=E(n,"color","gradient","colors"),a=E(n,this.chartType,"colorLegend","type");let o=E(n,"color","pairing","option");const c=E(n,"heatmap","colorLegend","title");if(E(this.getOptions(),"data","loading")){i.html("");return}const l=!Ce(s),u=Gp(this.model.getDisplayData()),h=!(r<=Lt.color.barWidth),d=h?Lt.color.barWidth:r,f=R.appendOrSelect(i,"g.legend"),p=R.appendOrSelect(f,"g.legend-axis");if(c){const S=R.appendOrSelect(i,"g.legend-title");R.appendOrSelect(S,"text").text(c).attr("dy","0.7em"),f.attr("transform","translate(0, 16)")}const m=u[0]<0&&u[1]>0?"diverge":"mono";(o<1&&o>4&&m==="mono"||o<1&&o>2&&m==="diverge")&&(o=1);let g=[];const v=m==="diverge"?17:11;if(l)g=s;else for(let S=1;S<v+1;S++)g.push(a===qs.LINEAR?`stop-color-${m}-${o}-${S}`:`fill-${m}-${o}-${S}`);const b=oe(u[0],u[1]),w=Ry(b,3),O=_e().domain(u).range([0,d]),_=Ua(O).tickSize(0).tickValues(w);let T;switch(a){case qs.LINEAR:this.drawLinear(g,f,d);break;case qs.QUANTIZE:T=this.drawQuantize(g,m,l,f,d),O.range([T,d]);break;default:throw Error("Entered color legend type is not supported.")}p.attr("transform",`translate(0,${Lt.color.axisYTranslation})`).call(_),p.select(".domain").remove(),p.select("g.tick:last-of-type text").style("text-anchor",h?"middle":"end"),p.select("g.tick:first-of-type text").style("text-anchor",h&&this.chartType!=="choropleth"?"middle":"start")}drawLinear(t,n,i){const r=100/(t.length-1);R.appendOrSelect(n,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(t).enter().append("stop").attr("offset",(s,a)=>`${a*r}%`).attr("class",(s,a)=>t[a]).attr("stop-color",s=>s),R.appendOrSelect(n,"rect").attr("width",i).attr("height",Lt.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(t,n,i,r,s){!i&&n==="diverge"&&t.splice(t.length/2,1);const a=er().domain(t).range([0,s]);return R.appendOrSelect(r,"g.quantized-rect").selectAll("rect").data(a.domain()).join("rect").attr("x",o=>a(o)).attr("y",0).attr("width",Math.max(0,a.bandwidth()-1)).attr("height",Lt.color.barHeight).attr("class",o=>o).attr("fill",o=>o),(!i&&n)==="mono"?a.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(C.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class jk extends Ir{constructor(){super(...arguments),this.type="meter-title",this.renderType=K.SVG}render(t=!0){const n=E(this.model.getDisplayData(),0),i=this.getOptions(),r=this.getComponentContainer(),{groupMapsTo:s}=i.data;if(E(i,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const c=r.selectAll("text.meter-title").data([n[s]]);c.enter().append("text").classed("meter-title",!0).merge(c).attr("x",0).attr("y","1em").text(l=>l),c.exit().remove(),this.appendPercentage()}this.displayStatus();const a=this.getMaxTitleWidth(),o=R.appendOrSelect(r,"text.meter-title");a>0&&o.node().getComputedTextLength()>a&&this.truncateTitle(o,a)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),i=this.model.getMaximumDomain(this.model.getDisplayData()),r=E(n,"meter","proportional","total"),s=E(n,"meter","proportional","unit")?E(n,"meter","proportional","unit"):"";let a;if(i===r)a=null;else{const u=r!==null?r-i:i,h=E(n,"meter","proportional","breakdownFormatter");a=h!==null?h({datasetsTotal:i,total:r}):`${i} ${s} used (${u} ${s} available)`}const o=t.selectAll("text.proportional-meter-title").data([a]);o.enter().append("text").classed("proportional-meter-title",!0).merge(o).attr("x",0).attr("y","1em").text(u=>u),o.exit().remove();const c=this.getMaxTitleWidth(),l=R.appendOrSelect(t,"text.proportional-meter-title");c>0&&l.node().getComputedTextLength()>c&&this.truncateTitle(l,c)}displayTotal(){const t=this.getComponentContainer(),n=this.getOptions(),i=E(n,"meter","proportional","total"),r=i?E(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=E(n,"meter","proportional","unit")?E(n,"meter","proportional","unit"):"",a=E(n,"meter","proportional","totalFormatter"),o=a!==null?a(r):`${i} ${s} total`,c=R.getHTMLElementSize(this.services.domUtils.getMainContainer()),l=c.width?c.width:this.parent.node().getAttribute("width"),u=t.selectAll("text.proportional-meter-total").data([o]);u.enter().append("text").classed("proportional-meter-total",!0).merge(u).attr("x",this.model.getStatus()&&typeof l!="string"?l-Gt.total.paddingRight:l).attr("y","1em").attr("text-anchor","end").text(h=>h),u.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),i=R.getHTMLElementSize(this.services.domUtils.getMainContainer()),r=i.width?i.width:0,s=this.model.getStatus(),a=Gt.status.indicatorSize/2,o=R.appendOrSelect(n,"g.status-indicator").attr("class",s!==null?`status-indicator status--${s}`:"").attr("transform",`translate(${r-a}, 0)`),c=s?[s]:[],l=o.selectAll("circle.status").data(c);l.enter().append("circle").merge(l).attr("class","status").attr("r",a).attr("cx",0).attr("cy",8);const u=o.selectAll("path.innerFill").data(c);u.enter().append("path").merge(u).attr("d",t.getStatusIconPathString(s)).attr("transform",`translate(-${a}, 0)`).attr("class","innerFill"),u.exit().remove(),l.exit().remove()}appendPercentage(){const t=E(this.model.getDisplayData(),0,"value"),n=this.getComponentContainer(),i=R.appendOrSelect(n,"text.meter-title"),r=E(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],s=n.selectAll("text.percent-value").data(r),a=Gt.statusBar.paddingRight;s.enter().append("text").classed("percent-value",!0).merge(s).text(o=>`${o}%`).attr("x",+i.attr("x")+i.node().getComputedTextLength()+a).attr("y",i.attr("y")),s.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const i=R.appendOrSelect(this.parent,"tspan"),r=Gt.statusBar.paddingRight,s=Math.ceil(i.node().getComputedTextLength());R.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+r)}getMaxTitleWidth(){const t=R.getHTMLElementSize(this.services.domUtils.getMainContainer()),n=E(this.getOptions(),"meter","proportional"),i=t.width?t.width:this.parent.node().getBoundingClientRect().width;if(n!==null){const r=R.appendOrSelect(this.parent,"text.proportional-meter-total").node(),s=R.getSVGElementSize(r,{useBBox:!0}).width;return i-s-Gt.total.paddingLeft}else{const r=R.appendOrSelect(this.parent,"text.percent-value"),s=Gt.statusBar.paddingRight,a=r.node().getComputedTextLength(),o=R.appendOrSelect(this.parent,"g.status-indicator").node(),c=R.getSVGElementSize(o,{useBBox:!0}).width+Gt.status.paddingLeft;return i-a-s-c}}getStatusIconPathString(t){switch(t){case js.SUCCESS:return"M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z";case js.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case js.WARNING:return"M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z"}}}class vc extends ht{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const n=this.model.getDisplayData().length,i=this.services.cartesianScales.getMainXScale(),r=R.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!i.step){const s=E(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,r*s/n)}return Math.min(t.bars.maxWidth,i.step()/2)}isOutsideZoomedDomain(t,n){if(this.model.getDisplayData().length<=1)return!1;const i=this.model.get("zoomDomain");if(i!==void 0){const r=this.services.cartesianScales.getDomainScale();return t<r(i[0])||n>r(i[1])}return!1}}class Wk extends ht{constructor(){super(...arguments),this.type="circle-pack",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-circlepack"})).attr("opacity",i=>i.data.dataGroupName===n.datum().name?1:mi.circles.fillOpacity)},this.handleLegendMouseOut=()=>{this.parent.selectAll("circle.node").transition("legend-mouseout-circlepack").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-circlepack"})).attr("opacity",1)}}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),{width:i,height:r}=R.getSVGElementSize(this.parent,{useAttrs:!0});if(i<1||r<1)return;let s=this.model.getDisplayData();const a=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),c=this.getOptions(),l=E(c,"canvasZoom","enabled");a&&E(s,0,"children")&&(s=E(s,0,"children"));const u=Qi({children:s}).sum(p=>p.value).sort((p,m)=>m.value-p.value),h=Xb().size([i,r]).padding(p=>p.depth>=1?mi.padding.children+3:mi.padding.mainGroup+3)(u).descendants().splice(1).filter(p=>p.depth<=o),d=n.selectAll("circle.node").data(h);d.exit().attr("width",0).attr("height",0).remove();const f=d.enter().append("circle").classed("node",!0);f.merge(d).attr("class",p=>{const m=l&&o===3?this.getZoomClass(p):"";return this.model.getColorClassName({classNameTypes:[J.FILL,J.STROKE],dataGroupName:p.data.dataGroupName,originalClassName:p.children?`node ${m}`:`node node-leaf ${m}`})}).style("fill",p=>this.model.getFillColor(p.data.dataGroupName)).style("stroke",p=>this.model.getFillColor(p.data.dataGroupName)).attr("cx",p=>p.x).attr("cy",p=>p.y).transition("circlepack-leaf-update-enter").call(p=>this.services.transitions.setupTransition({transition:p,name:"circlepack-leaf-update-enter"})).attr("r",p=>p.r).attr("opacity",1).attr("fill-opacity",mi.circles.fillOpacity),l===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,f,gi),this.setBackgroundListeners()),a||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(t){const n=t.map(i=>i.data);this.parent.selectAll("circle.node").filter(i=>n.some(r=>r===i.data)&&i.depth>1).style("stroke",i=>this.model.getFillColor(i.data.dataGroupName))}highlightChildren(t){const n=t.map(i=>i.data);this.parent.selectAll("circle.node").filter(i=>n.some(r=>r===i.data)&&i.depth>1).style("stroke",mi.circles.hover.stroke)}getZoomClass(t){return this.model.getHierarchyLevel()===3&&this.focal&&(t.data===this.focal.data||this.focal.children.some(n=>n.data===t.data))?"focal":"non-focal"}addLegendListeners(){const{events:t}=this.services;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){P(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=P(this.services.domUtils.getMainContainer()),n=this,i=this.parent.selectAll("circle.node");t.on("click",()=>{n.focal=null,n.model.updateHierarchyLevel(2),t.classed("zoomed-in",!1),n.services.canvasZoom.zoomOut(i,gi)})}getZoomIcon(){return`
80
80
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
81
81
  <polygon points="5.93 3.71 4.45 3.71 4.45 2.23 3.71 2.23 3.71 3.71 2.23 3.71 2.23 4.45 3.71 4.45 3.71 5.93 4.45 5.93 4.45 4.45 5.93 4.45 5.93 3.71"/>
82
82
  <path d="M7.2,6.67a4,4,0,0,0,1-2.59A4.08,4.08,0,1,0,4.07,8.15h0a4,4,0,0,0,2.59-1L9.48,10,10,9.48Zm-3.12.77A3.34,3.34,0,1,1,7.41,4.08,3.34,3.34,0,0,1,4.08,7.44Z"/>
83
- </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,i){const r=P(this);r.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!r.classed("focal"),o=E(t.model.getOptions(),"canvasZoom","enabled");let c=!1;if(!a){let l=[],u=[],h=null;if(i.children){i.depth>1&&o&&(c=!0,r.classed("clickable",!0)),l=i.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:St(f,"tooltip.totalLabel")||"Total",value:i.value,bold:!0}],t.highlightChildren(i.children)}else h=i.value;const d=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{color:d,label:i.data.name,labelIcon:c&&o&&s<=2?t.getZoomIcon():null,value:h},...l,...u]})}t.services.events.dispatchEvent(C.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:r,datum:i})}).on("mousemove",function(n,i){const r=P(this);t.services.events.dispatchEvent(C.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,i){const r=P(this);r.classed("hovered",!1),i.children&&t.unhighlightChildren(i.children),t.services.events.dispatchEvent(C.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:r})}).on("click",function(n,i){const r=P(this),s=r.classed("non-focal"),a=E(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");P(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,mi)}else if(i.depth===2&&i.children&&!s&&a){const o=t.parent.selectAll("circle.node");P(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=i,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(i,o,mi),n.stopPropagation()}t.services.events.dispatchEvent(C.CirclePack.CIRCLE_CLICK,{event:n,element:r,datum:i})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function Xk(e,t){const n=Pi(this._current,e);return i=>(this._current=n(i),t(this._current))}class tm extends ht{constructor(){super(...arguments),this.type="pie",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r.data[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Et.innerRadius}render(t=!0){const n=this,i=this.getComponentContainer(),r=this.getOptions(),{groupMapsTo:s}=r.data,{valueMapsTo:a}=r.pie,o=this.model.getDisplayData().filter(S=>S[a]>0),c=this.computeRadius();this.arc=or().innerRadius(this.getInnerRadius()).outerRadius(c),this.hoverArc=or().innerRadius(this.getInnerRadius()).outerRadius(c+Et.hoverArc.outerRadiusOffset);const l=QE().value(S=>S[a]).sort(E(r,"pie","sortFunction")).padAngle(Et.padAngle)(o),u=I.appendOrSelect(i,"g.slices").attr("role",at.GROUP).attr("data-name","slices").selectAll("path.slice").data(l,S=>S.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",S=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:S.data[s],originalClassName:"slice"})).style("fill",S=>n.model.getFillColor(S.data[s])).attr("d",this.arc).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",S=>`${S[a]}, ${Lp(S.data[a],o,a)+"%"}`).attrTween("d",function(S){return Xk.bind(this)(S,n.arc)});const h=r.pie.labels.enabled,d=h?l.filter(S=>S.data[a]>0):[],f=I.appendOrSelect(i,"g.labels").attr("role",at.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(d,S=>S.data[s]);f.exit().attr("opacity",0).remove();const p=f.enter().append("text").classed("pie-label",!0),m=[];p.merge(f).style("text-anchor","middle").text(S=>r.pie.labels.formatter?r.pie.labels.formatter(S):Lp(S.data[a],o,a)+"%").datum(function(S){const $=c+7,D=(S.endAngle-S.startAngle)/2+S.startAngle,L=D/Math.PI*180,M=this.getComputedTextLength();return S.textOffsetX=M/2,S.textOffsetY=L>90&&L<270?10:0,S.xPosition=(S.textOffsetX+$)*Math.sin(D),S.yPosition=(S.textOffsetY+$)*-Math.cos(D),S}).attr("transform",function(S,$){const D=d.length,L=(S.endAngle-S.startAngle)*(180/Math.PI);if($>=D-2&&L<Et.callout.minSliceDegree){let M,B;return S.index===D-1?(M=S.xPosition+Et.callout.offsetX+Et.callout.textMargin+S.textOffsetX,B=S.yPosition-Et.callout.offsetY,S.direction=js.RIGHT,m.push(S)):(M=S.xPosition-Et.callout.offsetX-S.textOffsetX-Et.callout.textMargin,B=S.yPosition-Et.callout.offsetY,S.direction=js.LEFT,m.push(S)),`translate(${M}, ${B})`}return`translate(${S.xPosition}, ${S.yPosition})`}),this.renderCallouts(m);const g=E(r,"donut")?"donut":"pie",v=E(r,g,"alignment"),{width:b}=I.getSVGElementSize(this.getParent(),{useAttrs:!0}),w=h?Et.xOffset:0,O=h?Et.yOffset:0;let _=c+w;v===It.CENTER?_=b/2:v===It.RIGHT&&(_=b-c-Et.xOffset);let T=c+O;m.length>0&&(T+=Et.yOffsetCallout),i.attr("x",_+7).attr("y",T),this.addEventListeners()}renderCallouts(t){const n=I.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",at.GROUP).attr("data-name","callouts"),i=n.selectAll("g.callout").data(t);i.exit().remove();const r=i.enter().append("g").classed("callout",!0).attr("role",at.GROUP).attr("aria-roledescription","label callout");r.merge(i).datum(function(s){const{xPosition:a,yPosition:o,direction:c}=s;return c===js.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+Et.callout.offsetX,y:o-Et.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-Et.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-Et.callout.offsetX,y:o-Et.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+Et.callout.horizontalLineLength),s}),r.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return P(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.startPos.x).attr("y1",s=>s.startPos.y).attr("x2",s=>s.intersectPointX).attr("y2",s=>s.endPos.y),r.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return P(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.intersectPointX).attr("y1",s=>s.endPos.y).attr("x2",s=>s.endPos.x).attr("y2",s=>s.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,i){const r=P(this);r.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(C.Pie.SLICE_MOUSEOVER,{event:n,element:P(this),datum:i});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{label:i.data[s],value:i.data[a]}]})}).on("mousemove",function(n,i){const r=P(this);t.services.events.dispatchEvent(C.Pie.SLICE_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(C.Pie.SLICE_CLICK,{event:n,element:P(this),datum:i})}).on("mouseout",function(n,i){const r=P(this);r.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc),t.services.events.dispatchEvent(C.Pie.SLICE_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:r})})}computeRadius(){const{width:t,height:n}=I.getSVGElementSize(this.parent,{useAttrs:!0}),i=this.getOptions(),r=Math.min(t,n)/2;return i.pie.labels.enabled?r+Et.radiusOffset:r}}class Zk extends tm{constructor(){super(...arguments),this.type="donut",this.renderType=K.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const i=I.appendOrSelect(this.getComponentContainer(),"g.center"),r=this.getOptions(),s=this.computeRadius(),a=E(r,"donut","center","label");I.appendOrSelect(i,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>r.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(P(this))}),a!==null&&a!==""&&I.appendOrSelect(i,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>r.donut.center.titleFontSize(s)).attr("y",r.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let i=E(n,"donut","center","number");i===null&&(i=this.model.getDisplayData().reduce((o,c)=>o+c[n.pie.valueMapsTo],0));const r=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;r%1===0&&i%1===0?s=uu:s=le;const a=s(r,i);return o=>{const{numberFormatter:c}=n.donut.center;t.text(c(a(o)))}}}const em="4,10 8,6 12,10",nm="12,6 8,10 4,6";class Kk extends ht{constructor(){super(...arguments),this.type="gauge",this.renderType=K.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return Ag(this.getValue(),0,100)/100}getDelta(){var t;return((t=this.model.getData().find(n=>n.group==="delta"))==null?void 0:t.value)??null}getArcRatio(){const t=this.getOptions();return E(t,"gauge","type")===di.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(E(n,"gauge","deltaArrow","direction")){case dl.UP:return em;case dl.DOWN:return nm;default:return t>0?em:nm}}render(t=!0){const n=this.getComponentContainer().attr("width","100%").attr("height","100%"),i=this.getOptions(),r=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),c=s*a,l=o+c,u=o+a,h=this.computeRadius(),d=this.getInnerRadius();this.backgroundArc=or().innerRadius(d).outerRadius(h).startAngle(l).endAngle(u),this.arc=or().innerRadius(d).outerRadius(h).startAngle(o).endAngle(l),I.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([r]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>E(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",v=>v),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const p=E(i,"gauge","alignment"),{width:m}=I.getSVGElementSize(this.getParent(),{useAttrs:!0});let g=h;p===It.CENTER?g=m/2:p===It.RIGHT&&(g=m-h),n.attr("x",g).attr("y",h),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),i=E(n,"gauge","type"),r=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=E(n,"gauge","valueFontSize"),c=E(n,"gauge","deltaFontSize"),l=E(n,"gauge","numberSpacing"),u=E(n,"gauge","showPercentageSymbol");let h=0;i===di.FULL&&!s?h=c(a):i===di.SEMI&&s&&(h=-(c(a)+l));const d=I.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${h})`),f=o(a),p=I.appendOrSelect(d,"g.gauge-value-number"),m=E(n,"gauge","numberFormatter"),g=p.selectAll("text.gauge-value-number").data([r]);g.enter().append("text").attr("class","gauge-value-number").merge(g).style("font-size",`${f}px`).attr("text-anchor","middle").text(S=>m(S));const{width:v}=I.getSVGElementSize(I.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),b=f/2,w=u?"%":"",O=I.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${b}px`).attr("x",v/2).text(w),{width:_,height:T}=I.getSVGElementSize(O,{useBBox:!0});O.attr("y",`-${T/2}px`),p.attr("transform",`translate(-${_/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),i=this.getOptions(),r=this.getDelta();if(r){const s=this.computeRadius(),a=r?E(i,"gauge","deltaFontSize"):()=>0,o=r?E(i,"gauge","numberFormatter"):()=>null,c=E(i,"gauge","deltaArrow","size"),l=E(i,"gauge","numberSpacing"),u=E(i,"gauge","showPercentageSymbol"),h=I.appendOrSelect(n,"g.gauge-numbers"),d=I.appendOrSelect(h,"g.gauge-delta").attr("transform",`translate(0, ${a(s)+l})`),f=I.appendOrSelect(d,"text.gauge-delta-number"),p=u?"%":"";f.data(r===null?[]:[r]),f.enter().append("text").classed("gauge-delta-number",!0).merge(f).attr("text-anchor","middle").style("font-size",`${a(s)}px`).text(b=>`${o(b)}${p}`);const{width:m}=I.getSVGElementSize(I.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),g=E(i,"gauge","deltaArrow","enabled"),v=d.selectAll("svg.gauge-delta-arrow").data(r!==null&&g?[r]:[]);v.enter().append("svg").merge(v).attr("class","gauge-delta-arrow").attr("x",-c(s)-m/2).attr("y",-c(s)/2-a(s)*.35).attr("width",c(s)).attr("height",c(s)).attr("viewBox","0 0 16 16").each(function(){const b=P(this);I.appendOrSelect(b,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const w=E(i,"gauge","status");I.appendOrSelect(b,"polygon.gauge-delta-arrow").attr("class",w!==null?`gauge-delta-arrow status--${w}`:"").attr("points",t.getArrow(r))}),v.exit().remove(),f.exit().remove()}else{const s=n.select("g.gauge-delta");s.empty()||s.remove()}}getInnerRadius(){const t=this.computeRadius(),n=E(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,i){t.services.events.dispatchEvent(C.Gauge.ARC_MOUSEOVER,{event:n,element:P(this),datum:i})}).on("mousemove",function(n,i){const r=P(this);t.services.events.dispatchEvent(C.Gauge.ARC_MOUSEMOVE,{event:n,element:r,datum:i})}).on("click",function(n,i){t.services.events.dispatchEvent(C.Gauge.ARC_CLICK,{event:n,element:P(this),datum:i})}).on("mouseout",function(n,i){const r=P(this);t.services.events.dispatchEvent(C.Gauge.ARC_MOUSEOUT,{event:n,element:r,datum:i})})}computeRadius(){const t=this.getOptions(),n=E(t,"gauge","type"),{width:i,height:r}=I.getSVGElementSize(this.parent,{useAttrs:!0});return n===di.SEMI?Math.min(i/2,r):Math.min(i/2,r/2)}}class im extends Ec{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=K.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),i=this.getOptions(),{groupMapsTo:r}=i.data;this.setGroupScale();const s=this.getComponentContainer({withinChartClip:!0}),a=Tr(n.map(u=>{const h=this.services.cartesianScales.getDomainIdentifier(u);return u[h]&&typeof u[h].toString=="function"?u[h].toString():u[h]})),o=s.selectAll("g.bars").data(a,u=>u);o.exit().attr("opacity",0).remove();const c=o.enter().append("g").classed("bars",!0).attr("role",at.GROUP).attr("data-name","bars").merge(o);c.transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-group-update-enter",animate:t})).attr("transform",u=>{const h=this.services.cartesianScales.getDomainValue(u)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Ht.VERTICAL?`translate(${h}, 0)`:`translate(0, ${h})`});const l=c.selectAll("path.bar").data(u=>this.getDataCorrespondingToLabel(u),u=>u[r]);l.exit().attr("opacity",0).remove(),l.enter().append("path").attr("opacity",0).merge(l).classed("bar",!0).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:u[r],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[r])).attr("d",u=>{const h=this.groupScale(u[r]),d=this.getBarWidth(),f=h,p=h+d,m=this.services.cartesianScales.getRangeAxisPosition({datum:u}),g=this.services.cartesianScales.getValueThroughAxisPosition(m,0),v=this.services.cartesianScales.getRangeValue(u),b=this.services.cartesianScales.getDomainValue(u)-d/2,w=b+d;if(!this.isOutsideZoomedDomain(b,w))return Jt({x0:f,x1:p,y0:g,y1:v},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,i){const r=P(this);r.classed("hovered",!0),t.services.events.dispatchEvent(C.Bar.BAR_MOUSEOVER,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:n,hoveredElement:r,data:[i]})}).on("mousemove",function(n,i){const r=P(this);t.services.events.dispatchEvent(C.Bar.BAR_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(C.Bar.BAR_CLICK,{event:n,element:P(this),datum:i})}).on("mouseout",function(n,i){const r=P(this);r.classed("hovered",!1),t.services.events.dispatchEvent(C.Bar.BAR_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:r})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(n=>{const i=this.services.cartesianScales.getDomainIdentifier(n);return n[i].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let i=this.defaultStepFactor;if(typeof t.step=="function")i=t.step();else if(n.length>0){const r=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(r){const s=this.services.cartesianScales.getDomainIdentifier(r.data[0]);i=Math.abs(t(r.data[1][s])-t(r.data[0][s]))}}return i}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=E(t,"bars","width"),i=E(t,"bars","maxWidth");if(n!==null&&(i===null||n<=i))return n;const r=this.model.getGroupedData(this.configs.groups).length,s=this.getTotalGroupPadding();return Math.min(i,(this.getDomainScaleStep()-s)/r)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=er().domain(t).rangeRound([0,this.getGroupWidth()])}}class Qk extends ht{constructor(){super(...arguments),this.type="heatmap",this.renderType=K.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:i}=n,r=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),c=this.services.cartesianScales.getMainXScale(),l=this.services.cartesianScales.getMainYScale();let u="",h=null,d=null,f=null;this.matrix[i]!==void 0?(u=a,r.forEach(p=>{if(typeof this.matrix[i][p].value=="number"){const m=this.matrix[i][p].value;if(h===null){h=m,d=m,f=m;return}h+=m,d=m<d?m:d,f=m>f?m:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][i].value=="number"){const m=this.matrix[p][i].value;if(h===null){h=m,d=m,f=m;return}h+=m,d=m<d?m:d,f=m>f?m:f}})),c(i)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${c(i)}, ${ln(l.range())})`):l(i)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${ln(c.range())},${l(i)})`),this.services.events.dispatchEvent(C.Tooltip.SHOW,{event:n.event,hoveredElement:P(t.detail.element),items:[{label:u,value:i,bold:!0},{label:"Min",value:d!==null?d:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:h!==null?h/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(C.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(C.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(C.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(C.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(C.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.lower();const{cartesianScales:i}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),E(this.getOptions(),"data","loading"))return;const r=i.getMainXScale(),s=i.getMainYScale(),a=i.getDomainIdentifier(),o=i.getRangeIdentifier(),c=this.model.getUniqueDomain(),l=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),h=r.range(),d=s.range();this.xBandwidth=Math.abs((h[1]-h[0])/c.length),this.yBandwidth=Math.abs((d[1]-d[0])/l.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const p=n.selectAll().data(u).enter().append("g").attr("class",m=>`heat-${m.index}`).classed("cell",!0).attr("transform",m=>`translate(${r(m[a])}, ${s(m[o])})`).append("rect").attr("class",m=>this.model.getColorClassName({value:m.value,originalClassName:`heat-${m.index}`})).classed("heat",!0).classed("null-state",m=>m.index===-1||m.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",m=>m.index===-1||m.value===null?`url(#${f})`:this.model.getFillColor(Number(m.value))).attr("aria-label",m=>m.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(d[1]-d[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(h[1]-h[0]),this.yBandwidth),this.determineDividerStatus()&&(p.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,i){const r=I.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);I.appendOrSelect(r,"line.top").attr("x1",-1).attr("x2",n+1),I.appendOrSelect(r,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",i+1),I.appendOrSelect(r,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",i).attr("y2",i),I.appendOrSelect(r,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",i+1)}determineDividerStatus(){const t=E(this.getOptions(),"heatmap","divider","state");return t!==fr.OFF&&(t===fr.AUTO&&vl.minCellDividerDimension<=this.xBandwidth&&vl.minCellDividerDimension<=this.yBandwidth||t===fr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,i=this.getOptions(),r=St(i,"tooltip.totalLabel"),s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),c=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(l,u){const h=P(this),d=h.select("rect.heat");if(!d.classed("null-state")){const f=Mr(h.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${f.x+t.translationUnits.x}, ${f.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(C.Heatmap.HEATMAP_MOUSEOVER,{event:l,element:d,datum:u}),t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:l,items:[{label:o,value:u[s]},{label:c,value:u[a]},{label:r||"Total",value:u.value,color:d.style("fill")}]})}}).on("mousemove",function(l,u){t.services.events.dispatchEvent(C.Heatmap.HEATMAP_MOUSEMOVE,{event:l,element:P(this),datum:u}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:l})}).on("click",function(l,u){t.services.events.dispatchEvent(C.Heatmap.HEATMAP_CLICK,{event:l,element:P(this),datum:u})}).on("mouseout",function(l,u){const h=P(this).select("rect.heat"),d=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),d||(t.services.events.dispatchEvent(C.Heatmap.HEATMAP_MOUSEOUT,{event:l,element:h,datum:u}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{event:l,hoveredElement:h}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class Jk extends ht{constructor(){super(...arguments),this.type="histogram",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer(),i=this.model.getOptions(),{groupIdentifier:r}=i,{groupMapsTo:s}=i.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),c=n.selectAll("g.bars").data(a,u=>St(u,`0.${s}`));c.exit().attr("opacity",0).remove(),c.enter().append("g").classed("bars",!0).attr("role",at.GROUP);const l=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).attr(r,(u,h)=>h).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s])).attr("d",u=>{const h=St(u,"data");if(!h)return;const d=o(h.x1)-o(h.x0)-1,f=this.services.cartesianScales.getDomainValue(h.x0),p=f+d,m=this.services.cartesianScales.getRangeValue(u[0]);let g=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(g-m)>0&&Math.abs(g-m)>i.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=1:g-=1),Jt({x0:f,x1:p,y0:m,y1:g},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>E(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,i=this;this.parent.selectAll("path.bar").on("mouseover",function(r,s){const a=P(this);a.classed("hovered",!0);const o=parseFloat(St(s,"data.x0")),c=parseFloat(St(s,"data.x1")),l=i.services.cartesianScales.getRangeAxisPosition(),u=i.services.cartesianScales.getScaleLabel(l);i.services.events.dispatchEvent(C.Tooltip.SHOW,{event:r,hoveredElement:a,items:[{label:St(t,"bins.rangeLabel")||"Range",value:`${o} – ${c}`},{label:t.tooltip.groupLabel||"Group",value:s[n],class:i.model.getColorClassName({classNameTypes:[J.TOOLTIP],dataGroupName:s[n]})},{label:u,value:St(s,`data.${s[n]}`)}]})}).on("mousemove",function(r){i.services.events.dispatchEvent(C.Tooltip.MOVE,{event:r})}).on("mouseout",function(){P(this).classed("hovered",!1),i.services.events.dispatchEvent(C.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class tR extends He{constructor(){super(...arguments),this.type="lollipop",this.renderType=K.SVG,this.handleScatterOnHover=t=>{const n=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[r]!==n.datum[r]?Ne.weight.unselected:Ne.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",Ne.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[r]!==n.datum().name?Ne.opacity.unselected:Ne.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",Ne.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),i=this.model.getOptions(),{groupMapsTo:r}=i.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),c=s.getDomainIdentifier(),l=g=>s.getDomainValue(g),u=g=>s.getRangeValue(g),h=s.getOrientation(),[d,f]=sn(l,u,h),p=n.selectAll("line.line").data(this.getScatterData(),g=>`${g[r]}-${g[c]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",g=>this.model.getColorClassName({classNameTypes:[J.STROKE],dataGroupName:g[r],originalClassName:"line"})).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"lollipop-line-update-enter",animate:t})).style("stroke",g=>this.model.getFillColor(g[r],g[c],g)).attr("opacity",1);h===Ht.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",g=>d(g)-i.points.radius):m.attr("x1",d).attr("x2",d).attr("y1",o.range()[0]).attr("y2",g=>f(g)+i.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(C.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(C.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(C.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(C.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class eR extends ht{constructor(){super(...arguments),this.type="meter",this.renderType=K.SVG}getStackedBounds(t,n){let i=0;return t.map((r,s)=>s!==0?(i+=n(r.value),{...r,width:Math.abs(n(r.value)-Vt.dividerWidth),x:i-n(r.value)}):(i=n(r.value),{...r,width:Math.abs(n(r.value)-Vt.dividerWidth),x:0}))}render(t=!0){const n=this,i=this.getComponentContainer(),r=this.getOptions(),s=E(r,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:c}=I.getSVGElementSize(i,{useAttrs:!0}),{groupMapsTo:l}=r.data;let u;E(r,"meter","proportional")===null?u=100:u=E(r,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const h=Se().domain([0,u]).range([0,c]),d=this.getStackedBounds(a,h),f=E(r,"meter","height");I.appendOrSelect(i,"rect.container").attr("x",0).attr("y",0).attr("width",c).attr("height",f||(s?Vt.height.proportional:Vt.height.default)),I.appendOrSelect(i,"line.rangeIndicator").attr("x1",c).attr("x2",c).attr("y1",0).attr("y2",f||(s?Vt.height.proportional:Vt.height.default));const p=i.selectAll("rect.value").data(d),m=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",w=>w.x).attr("y",0).attr("height",()=>E(r,"meter","height")||(s?Vt.height.proportional:Vt.height.default)).attr("class",w=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:w[l],originalClassName:m})).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"meter-bar-update",animate:t})).attr("width",w=>w.value>u?h(u):w.width).style("fill",w=>n.model.getFillColor(w[l])).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",w=>w.value),p.exit().remove();const g=E(r,"meter","peak");let v=g;g!==null&&(g>u?v=u:g<a[0].value&&(v=a[0].value>u?u:a[0].value));const b=i.selectAll("line.peak").data(v==null?[]:[v]);b.enter().append("line").classed("peak",!0).merge(b).attr("y1",0).attr("y2",()=>E(r,"meter","height")||(s?Vt.height.proportional:Vt.height.default)).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"peak-line-update",animate:t})).attr("x1",w=>h(w)).attr("x2",w=>h(w)).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",w=>w),b.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this,r=E(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=P(this);i.services.events.dispatchEvent(C.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),r&&(o.classed("hovered",!0),i.services.events.dispatchEvent(C.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=P(this);i.services.events.dispatchEvent(C.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),r&&i.services.events.dispatchEvent(C.Tooltip.MOVE,{event:s})}).on("click",function(s,a){i.services.events.dispatchEvent(C.Meter.METER_CLICK,{event:s,element:P(this),datum:a})}).on("mouseout",function(s,a){const o=P(this);i.services.events.dispatchEvent(C.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),r&&(o.classed("hovered",!1),i.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class nR extends ht{constructor(){super(...arguments),this.type="radar",this.renderType=K.SVG,this.getLabelDimensions=t=>{const n=I.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),i=I.appendOrSelect(n,"text").text(t),{width:r,height:s}=I.getSVGElementSize(i.node(),{useBBox:!0});return n.remove(),{width:r,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:i,value:r}=E(n,"radar","axes"),s=E(n,"data","groupMapsTo"),a=hD(this.uniqueKeys.map(o=>this.uniqueGroups.map(c=>({[i]:o,[s]:c,[r]:null}))));return nt(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:i,value:r}=E(n,"radar","axes"),s=E(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const c=this.uniqueKeys.map(l=>({[s]:a,[i]:l,[r]:null}));return{name:a,data:nt(c,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-blob"})).style("fill-opacity",i=>i.name!==n.datum().name?fn.opacity.unselected:fn.opacity.selected).style("stroke-opacity",i=>i.name!==n.datum().name?fn.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",fn.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer(),{width:i,height:r}=I.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),c=E(o,"data","groupMapsTo"),l=E(o,"radar","axes","value"),{angle:u,value:h}=E(o,"radar","axes"),{xLabelPadding:d,yLabelPadding:f,yTicksNumber:p,minRange:m,xAxisRectHeight:g}=fn;this.uniqueKeys=Array.from(new Set(s.map(x=>x[u]))),this.uniqueGroups=Array.from(new Set(s.map(x=>x[c]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const v=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),b=(Math.min(i,r)-v)/2;if(b<=0)return;const w=er().domain(this.fullDataNormalized.map(x=>x[u])).range([0,2*Math.PI].map(x=>x-Math.PI/2)),O=ln(this.fullDataNormalized.map(x=>x[h])),_=Se().domain([O>=0?0:O,bn(this.fullDataNormalized.map(x=>x[h]))]).range([m,b]).nice(p),T=_.ticks(p),S=x=>this.model.getFillColor(x),$=e_().angle(x=>w(x[u])+Math.PI/2).radius(x=>_(x[h])).curve(Cd),D=this.uniqueKeys.map(x=>{const A=this.getLabelDimensions(x).width,y=L$(w(x),b);return A+y}),L={x:bn(D)+d,y:r/2},M=I.appendOrSelect(n,"g.y-axes").attr("role",at.GROUP).selectAll("path").data(T,x=>x),B=x=>this.uniqueKeys.map(A=>({[u]:A,[h]:x}));M.join(x=>x.append("path").attr("opacity",0).attr("transform",`translate(${L.x}, ${L.y})`).attr("fill","none").call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",y=>$(B(y)))),x=>x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${L.x}, ${L.y})`).attr("d",y=>$(B(y)))),x=>x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_axes_exit",animate:t})).attr("d",y=>$(B(y))).attr("opacity",0).remove())),I.appendOrSelect(n,"g.x-axes").attr("role",at.GROUP).selectAll("line").data(this.uniqueKeys,x=>x).join(x=>x.append("line").attr("opacity",0).attr("class",A=>`x-axis-${Si(A)}`).attr("stroke-dasharray","0").attr("x1",A=>kt(w(A),0,L).x).attr("y1",A=>kt(w(A),0,L).y).attr("x2",A=>kt(w(A),0,L).x).attr("y2",A=>kt(w(A),0,L).y).call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",y=>kt(w(y),_.range()[0],L).x).attr("y1",y=>kt(w(y),_.range()[0],L).y).attr("x2",y=>kt(w(y),_.range()[1],L).x).attr("y2",y=>kt(w(y),_.range()[1],L).y)),x=>x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",y=>kt(w(y),_.range()[0],L).x).attr("y1",y=>kt(w(y),_.range()[0],L).y).attr("x2",y=>kt(w(y),_.range()[1],L).x).attr("y2",y=>kt(w(y),_.range()[1],L).y)),x=>x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),I.appendOrSelect(n,"g.x-labels").attr("role",at.GROUP).selectAll("text").data(this.uniqueKeys).join(x=>x.append("text").text(A=>A).attr("opacity",0).attr("x",A=>kt(w(A),_.range()[1]+d,L).x).attr("y",A=>kt(w(A),_.range()[1]+d,L).y).style("text-anchor",A=>Kp(w(A)).textAnchor).style("dominant-baseline",A=>Kp(w(A)).dominantBaseline).call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),x=>x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",y=>kt(w(y),_.range()[1]+d,L).x).attr("y",y=>kt(w(y),_.range()[1]+d,L).y).end().finally(()=>{const y=E(o,"radar","alignment"),k=this.getAlignmentXOffset(y,n,this.getParent());n.attr("x",k)})),x=>x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),I.appendOrSelect(n,"g.blobs").attr("role",at.GROUP).selectAll("path").data(this.groupedDataNormalized,x=>x.name).join(x=>x.append("path").attr("class",A=>this.model.getColorClassName({classNameTypes:[J.FILL,J.STROKE],dataGroupName:A.name,originalClassName:"blob"})).attr("role",at.GRAPHICS_SYMBOL).attr("aria-label",A=>A.name).attr("opacity",0).attr("transform",t?()=>`translate(${L.x}, ${L.y}) scale(${1+Math.random()*.35})`:`translate(${L.x}, ${L.y})`).style("fill",A=>S(A.name)).style("fill-opacity",fn.opacity.selected).style("stroke",A=>S(A.name)).call(A=>{const y=A.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_enter",animate:t}));t&&y.delay(()=>Math.random()*30).attr("transform",`translate(${L.x}, ${L.y})`),y.attr("opacity",1).attr("d",k=>$(k.data))}),x=>(x.attr("class",A=>this.model.getColorClassName({classNameTypes:[J.FILL,J.STROKE],dataGroupName:A.name,originalClassName:"blob"})).style("fill",A=>S(A.name)).style("stroke",A=>S(A.name)),x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${L.x}, ${L.y})`).attr("d",y=>$(y.data))),x),x=>x.call(A=>{const y=A.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_exit",animate:t}));t&&y.delay(()=>Math.random()*30).attr("transform",()=>`translate(${L.x}, ${L.y}) scale(${1+Math.random()*.35})`),y.attr("opacity",0).remove()})),I.appendOrSelect(n,"g.dots").attr("role",at.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(x=>E(x,h)!==null)).join(x=>x.append("circle").attr("role",at.GRAPHICS_SYMBOL).attr("aria-label",A=>A[l]),x=>x,x=>x.remove()).attr("class",x=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:x[c],originalClassName:Si(x[u])})).attr("cx",x=>kt(w(x[u]),_(x[h]),L).x).attr("cy",x=>kt(w(x[u]),_(x[h]),L).y).attr("r",0).attr("opacity",0).style("fill",x=>S(x[c])),I.appendOrSelect(n,"g.x-axes-rect").attr("role",at.GROUP).selectAll("rect").data(this.uniqueKeys).join(x=>x.append("rect"),x=>x,x=>x.remove()).attr("x",L.x).attr("y",L.y-g/2).attr("width",_.range()[1]).attr("height",g).style("fill","red").style("fill-opacity",0).attr("transform",x=>`rotate(${Qp(w(x))}, ${L.x}, ${L.y})`),I.appendOrSelect(n,"g.y-labels").attr("role",at.GROUP).selectAll("text").data(xe(T)).join(x=>x.append("text").attr("opacity",0).text(A=>A).attr("x",A=>kt(-Math.PI/2,_(A),L).x+f).attr("y",A=>kt(-Math.PI/2,_(A),L).y).style("text-anchor","start").style("dominant-baseline","middle").call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),x=>x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_labels_update",animate:t})).text(y=>y).attr("opacity",1).attr("x",y=>kt(-Math.PI/2,_(y),L).x+f).attr("y",y=>kt(-Math.PI/2,_(y),L).y)),x=>x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,i){const r=I.getSVGElementSize(n,{useBBox:!0}),{width:s}=I.getSVGElementSize(i,{useAttrs:!0});let a=0;return t===It.CENTER?a=Math.floor((s-r.width)/2):t===It.RIGHT&&(a=s-r.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=E(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(i,r){const s=P(this);t.services.events.dispatchEvent(C.Radar.X_AXIS_MOUSEOVER,{event:i,element:s,datum:r});const a=t.parent.select(`.x-axes .x-axis-${Si(r)}`),o=t.parent.selectAll(`.dots circle.${Si(r)}`),c=t.model.getActiveDataGroupNames(),l=t.getOptions(),{groupMapsTo:u}=l.data,h=E(l,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>c.indexOf(f[u])!==-1?1:0).attr("r",fn.dotsRadius);const d=t.fullDataNormalized.filter(f=>f[n]===r&&c.indexOf(f[u])!==-1);t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:i,hoveredElement:s,items:d.filter(f=>typeof f[h]=="number").map(f=>({label:f[u],value:f[h],color:t.model.getFillColor(f[u]),class:t.model.getColorClassName({classNameTypes:[J.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(i,r){const s=P(this);t.services.events.dispatchEvent(C.Radar.X_AXIS_MOUSEMOVE,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(C.Radar.X_AXIS_CLICK,{event:i,element:P(this),datum:r})}).on("mouseout",function(i,r){const s=P(this),a=t.parent.select(`.x-axes .x-axis-${Si(r)}`),o=t.parent.selectAll(`.dots circle.${Si(r)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(C.Radar.X_AXIS_MOUSEOUT,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(C.Tooltip.HIDE)})}}class rm extends Ec{constructor(){super(...arguments),this.type="simple-bar",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-simple-bar"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getComponentContainer({withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=r.selectAll("path.bar").data(s,c=>c[i]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i])).attr("d",c=>{const l=this.services.cartesianScales.getRangeIdentifier(),u=this.getBarWidth(),h=c[l],d=this.services.cartesianScales.getDomainValue(c)-u/2,f=d+u;let p,m;if(Array.isArray(h)&&h.length===2)p=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const v=this.services.cartesianScales.getRangeScale().domain()[0];p=this.services.cartesianScales.getRangeValue(Math.max(0,v)),m=this.services.cartesianScales.getRangeValue(c)}const g=Math.abs(m-p);if(g!==0&&g<2&&(h>0&&a===Ht.VERTICAL||h<0&&a===Ht.HORIZONTAL?m=p-2:m=p+2),!this.isOutsideZoomedDomain(d,f))return Jt({x0:d,x1:f,y0:p,y1:m},a)}).attr("opacity",1).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,i){const r=P(this);r.classed("hovered",!0),t.services.events.dispatchEvent(C.Bar.BAR_MOUSEOVER,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:n,hoveredElement:r,data:[i]})}).on("mousemove",function(n,i){t.services.events.dispatchEvent(C.Bar.BAR_MOUSEMOVE,{event:n,element:P(this),datum:i}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(C.Bar.BAR_CLICK,{event:n,element:P(this),datum:i})}).on("mouseout",function(n,i){const r=P(this);r.classed("hovered",!1),t.services.events.dispatchEvent(C.Bar.BAR_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:r})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class iR extends te{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=E(this.getOptions(),"data","loading"),i=!E(this.getOptions(),"grid","x","enabled")&&!E(this.getOptions(),"grid","y","enabled")&&!E(this.getOptions(),"axes","bottom","visible")&&!E(this.getOptions(),"axes","left","visible");n&&!i?super.renderGridSkeleton(n):n&&i?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),i=[100],r=I.appendOrSelect(this.backdrop,"g.y.skeleton"),s=r.selectAll("line").data(i);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),r.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=I.appendOrSelect(t,"svg.chart-skeleton.DAII"),I.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class sm extends ht{constructor(){super(...arguments),this.type="area-stacked",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>E(s,0,r)!==n.datum().name?Pe.opacity.unselected:Pe.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",Pe.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),i=this,r=this.getOptions(),{groupMapsTo:s}=r.data,a=Object.keys(r.axes).some(f=>r.axes[f].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),c=E(o,0,0),l=this.services.cartesianScales.getDomainAxisPosition({datum:c}),u=this.services.cartesianScales.getRangeAxisPosition({datum:c}),h=this.services.cartesianScales.getScaleByPosition(u),d=n.selectAll("path.area").data(o,f=>E(f,0,s));this.areaGenerator=rl().x(f=>this.services.cartesianScales.getValueThroughAxisPosition(l,f.data.sharedStackKey)).y0(f=>h(f[0])).y1(f=>h(f[1])).curve(this.services.curves.getD3Curve()),d.exit().attr("opacity",0).remove(),d.enter().append("path").attr("opacity",0).merge(d).data(o,f=>E(f,0,s)).attr("class","area").attr("class",f=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:E(f,0,s),originalClassName:"area"})).style("fill",f=>i.model.getFillColor(E(f,0,s))).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",f=>E(f,0,s)).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"area-update-enter",animate:t})).attr("opacity",Pe.opacity.selected).attr("d",this.areaGenerator)}}class am extends Ec{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:r}=i.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,l=>E(l,0,r));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",at.GROUP).attr("data-name","bars");const c=n.selectAll("g.bars").selectAll("path.bar").data(l=>l,l=>l.data.sharedStackKey);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"bar-update-enter",animate:t})).attr("class",l=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:l[r],originalClassName:"bar"})).style("fill",l=>this.model.getFillColor(l[r])).attr("d",l=>{const u=l.data.sharedStackKey,h=this.getBarWidth(),d=this.services.cartesianScales.getDomainValue(u)-h/2,f=d+h,p=this.services.cartesianScales.getRangeValue(l[0]);let m=this.services.cartesianScales.getRangeValue(l[1]);if(!this.isOutsideZoomedDomain(d,f)){if(Math.abs(m-p)>0&&Math.abs(m-p)>i.bars.dividerSize){const g=l[0]<0&&l[1]<=0;g&&a.length>1?this.services.cartesianScales.getOrientation()===Ht.VERTICAL?m+=l[1]===0?2:1:m-=1:g||(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?m+=1:m-=1)}return Jt({x0:d,x1:f,y0:p,y1:m},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",l=>l[1]-l[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this;this.parent.selectAll("path.bar").on("mouseover",function(r,s){const a=P(this);a.classed("hovered",!0),i.services.events.dispatchEvent(C.Bar.BAR_MOUSEOVER,{event:r,element:a,datum:s});let o=i.model.getDisplayData(i.configs.groups).find(c=>{const l=i.services.cartesianScales.getDomainIdentifier(c),u=i.services.cartesianScales.getRangeIdentifier(c);return c[u]===s.data[s[n]]&&c[l].toString()===s.data.sharedStackKey&&c[n]===s[n]});if(o===void 0){const c=i.services.cartesianScales.getDomainIdentifier(),l=i.services.cartesianScales.getRangeIdentifier();o={[c]:s.data.sharedStackKey,[l]:s.data[s[n]],[n]:s[n]}}i.services.events.dispatchEvent(C.Tooltip.SHOW,{event:r,hoveredElement:a,data:[o]})}).on("mousemove",function(r,s){const a=P(this);i.services.events.dispatchEvent(C.Bar.BAR_MOUSEMOVE,{event:r,element:a,datum:s}),i.services.events.dispatchEvent(C.Tooltip.MOVE,{event:r})}).on("click",function(r,s){i.services.events.dispatchEvent(C.Bar.BAR_CLICK,{event:r,element:P(this),datum:s})}).on("mouseout",function(r,s){const a=P(this);a.classed("hovered",!1),i.services.events.dispatchEvent(C.Bar.BAR_MOUSEOUT,{event:r,element:a,datum:s}),i.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(E(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),i=I.getSVGElementSize(this.parent,{useAttrs:!0}).width,r=this.model.getStackKeys().length,s=E(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,i*s/r)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class om extends He{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=K.SVG}render(t){if(!E(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:r}=i.data,s=Object.keys(i.axes).some(u=>i.axes[u].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=n.selectAll("g.dots").data(a,u=>E(u,0,r));o.exit().attr("opacity",0).remove();const c=o.enter().append("g").classed("dots",!0).attr("role",at.GROUP).merge(o).selectAll("circle.dot").data(u=>u);c.exit().attr("opacity",0).remove();const l=c.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(c).datum(u=>{const h=u[r],d=this.services.cartesianScales.getDomainIdentifier(u),f=this.services.cartesianScales.getRangeIdentifier(u);return{[r]:h,[d]:u.data.sharedStackKey,[f]:u[1]}});this.styleCircles(l,t),this.addEventListeners()}getTooltipData(t,n){const i=this.getOptions(),{groupMapsTo:r}=i.data,s=Object.keys(i.axes).some(c=>i.axes[c].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((c,l)=>{c.forEach((u,h)=>{const d=u[r],f=u.data.sharedStackKey;let p=u.data[d];const m=u[1],g=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(m)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[l][h].data[d]),p!==null&&o.push({[r]:d,[g]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(c=>{const l=this.services.cartesianScales.getDomainIdentifier(c),u=this.services.cartesianScales.getRangeIdentifier(c);return o.find(h=>h[r]==c[r]&&h[l]==c[l]&&h[u]==c[u])!==void 0})}}const Ai=6;class rR extends ht{constructor(){super(...arguments),this.type="tree",this.renderType=K.SVG}getLongestLabel(t){let n="";return t.forEach(i=>{const r=i.children?this.getLongestLabel(i.children):"";(r.length>n.length||i.name.length>n.length)&&(n=r.length>i.name.length?r:i.name)}),n}getMockLabelWidth(t,n){const i=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:r}=I.getSVGElementSize(i.node(),{useBBox:!0});return i.remove(),r}render(t=!0){const n=this.getComponentContainer();n.html("");const{width:i,height:r}=I.getSVGElementSize(this.parent,{useAttrs:!0});if(i<1||r<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=E(s,"tree","rootTitle")||"Tree",c=this.getMockLabelWidth(n,o),l=this.getLongestLabel(a),u=this.getMockLabelWidth(n,l),h={top:0,right:0,bottom:0,left:c>0?c+Ai:30-Ai},d=Qi({name:o,children:a}),f=10,p=i/6,m=T=>{const S=d.descendants().reverse(),$=d.links();let D=d,L=d;d.eachBefore(U=>{U.x<D.x&&(D=U),U.x>L.x&&(L=U)});const M=L.x-D.x,B=n.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-h.left,D.x,i,M].join(" ")),x=_.selectAll("g").data(S,U=>U.id),A=this,y=x.enter().append("g").attr("transform",()=>`translate(${T.y0},${T.x0})`).attr("class",U=>U.depth!==0&&U.children&&U.children.length>0?"clickable":null).on("mouseover",function(U,N){A.services.events.dispatchEvent(C.Tree.NODE_MOUSEOVER,{event:U,element:P(this),datum:N})}).on("click",function(U,N){N.depth!==0&&(N.children=N.children?null:N._children,m(N)),A.services.events.dispatchEvent(C.Tree.NODE_CLICK,{event:U,element:P(this),datum:N})}).on("mouseout",function(U,N){A.services.events.dispatchEvent(C.Tree.NODE_MOUSEOUT,{event:U,element:P(this),datum:N})});y.append("circle").attr("r",2.5).attr("class",U=>U._children?"parent":"child").attr("stroke-width",10),y.append("text").attr("dy","0.31em").attr("x",U=>U._children?-Ai:Ai).attr("text-anchor",U=>U._children?"end":"start").text(U=>U.data.name).clone(!0).attr("class","text-stroke").lower(),x.merge(y).transition(B).attr("transform",U=>`translate(${U.y},${U.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),x.exit().transition(B).remove().attr("transform",()=>`translate(${T.y},${T.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const k=O.selectAll("path").data($,U=>U.target.id),R=k.enter().append("path").attr("d",()=>{const U={x:T.x0,y:T.y0};return w({source:U,target:U})});k.merge(R).transition(B).attr("d",w),k.exit().transition(B).remove().attr("d",()=>{const U={x:T.x,y:T.y};return w({source:U,target:U})}),d.eachBefore(U=>{U.x0=U.x,U.y0=U.y})},g=d.descendants(),v=g[g.length-1].depth,b=E(s,"tree","type")===hl.DENDROGRAM?Eb().size([r,i-u-v*Ai-c]):cw().nodeSize([f,p]).size([r,i-u-v*Ai-c]),w=o_().x(T=>T.y).y(T=>T.x);d.x0=p/2,d.y0=0,d.descendants().forEach((T,S)=>{T.id=S,T._children=T.children}),b(d),n.attr("viewBox",[-h.left,-h.top,i,f]).style("user-select","none");const O=n.append("g").attr("class","links"),_=n.append("g").attr("class","nodes");m(d)}}var sR="#000000",aR="#ffffff",oR="#fcf4d6",lR="#fddc69",cR="#f1c21b",uR="#d2a106",hR="#b28600",dR="#8e6a00",fR="#684e00",pR="#483700",gR="#302400",mR="#1c1500",vR={10:oR,20:lR,30:cR,40:uR,50:hR,60:dR,70:fR,80:pR,90:gR,100:mR},yR="#fff2e8",xR="#ffd9be",bR="#ffb784",wR="#ff832b",ER="#eb6200",_R="#ba4e00",SR="#8a3800",OR="#5e2900",TR="#3e1a00",MR="#231000",CR={10:yR,20:xR,30:bR,40:wR,50:ER,60:_R,70:SR,80:OR,90:TR,100:MR},AR="#fff1f1",$R="#ffd7d9",LR="#ffb3b8",DR="#ff8389",kR="#fa4d56",RR="#da1e28",IR="#a2191f",PR="#750e13",NR="#520408",UR="#2d0709",BR={10:AR,20:$R,30:LR,40:DR,50:kR,60:RR,70:IR,80:PR,90:NR,100:UR},HR="#fff0f7",VR="#ffd6e8",GR="#ffafd2",FR="#ff7eb6",zR="#ee5396",jR="#d02670",WR="#9f1853",qR="#740937",YR="#510224",XR="#2a0a18",ZR={10:HR,20:VR,30:GR,40:FR,50:zR,60:jR,70:WR,80:qR,90:YR,100:XR},KR="#f6f2ff",QR="#e8daff",JR="#d4bbff",tI="#be95ff",eI="#a56eff",nI="#8a3ffc",iI="#6929c4",rI="#491d8b",sI="#31135e",aI="#1c0f30",oI={10:KR,20:QR,30:JR,40:tI,50:eI,60:nI,70:iI,80:rI,90:sI,100:aI},lI="#edf5ff",cI="#d0e2ff",uI="#a6c8ff",hI="#78a9ff",dI="#4589ff",fI="#0f62fe",pI="#0043ce",gI="#002d9c",mI="#001d6c",vI="#001141",yI={10:lI,20:cI,30:uI,40:hI,50:dI,60:fI,70:pI,80:gI,90:mI,100:vI},xI="#e5f6ff",bI="#bae6ff",wI="#82cfff",EI="#33b1ff",_I="#1192e8",SI="#0072c3",OI="#00539a",TI="#003a6d",MI="#012749",CI="#061727",AI={10:xI,20:bI,30:wI,40:EI,50:_I,60:SI,70:OI,80:TI,90:MI,100:CI},$I="#d9fbfb",LI="#9ef0f0",DI="#3ddbd9",kI="#08bdba",RI="#009d9a",II="#007d79",PI="#005d5d",NI="#004144",UI="#022b30",BI="#081a1c",HI={10:$I,20:LI,30:DI,40:kI,50:RI,60:II,70:PI,80:NI,90:UI,100:BI},VI="#defbe6",GI="#a7f0ba",FI="#6fdc8c",zI="#42be65",jI="#24a148",WI="#198038",qI="#0e6027",YI="#044317",XI="#022d0d",ZI="#071908",KI={10:VI,20:GI,30:FI,40:zI,50:jI,60:WI,70:qI,80:YI,90:XI,100:ZI},QI="#f2f4f8",JI="#dde1e6",tP="#c1c7cd",eP="#a2a9b0",nP="#878d96",iP="#697077",rP="#4d5358",sP="#343a3f",aP="#21272a",oP="#121619",lP={10:QI,20:JI,30:tP,40:eP,50:nP,60:iP,70:rP,80:sP,90:aP,100:oP},cP="#f4f4f4",uP="#e0e0e0",hP="#c6c6c6",dP="#a8a8a8",fP="#8d8d8d",pP="#6f6f6f",gP="#525252",mP="#393939",vP="#262626",yP="#161616",xP={10:cP,20:uP,30:hP,40:dP,50:fP,60:pP,70:gP,80:mP,90:vP,100:yP},bP="#f7f3f2",wP="#e5e0df",EP="#cac5c4",_P="#ada8a8",SP="#8f8b8b",OP="#726e6e",TP="#565151",MP="#3c3838",CP="#272525",AP="#171414",$P={10:bP,20:wP,30:EP,40:_P,50:SP,60:OP,70:TP,80:MP,90:CP,100:AP},lm={black:{100:sR},blue:yI,coolGray:lP,cyan:AI,gray:xP,green:KI,magenta:ZR,orange:CR,purple:oI,red:BR,teal:HI,warmGray:$P,white:{0:aR},yellow:vR};const LP=e=>{if(!e)return null;for(const t of Object.keys(lm)){const n=lm[t];for(const i of Object.keys(n))if(n[+i]===e)return i}return null},cm=function(){const e=P(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=Ge(t);let i;if(n&&(i=LP(n?n.hex():null)),i==null){const r=qa(n).l;i=Math.abs(r*100-100)}return i>50?"white":"black"};let DP=0;class kP extends ht{constructor(){super(...arguments),this.type="treemap",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-treemap"})).attr("opacity",i=>i.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer();this.model.getData();const i=this.model.getDisplayData(),r=this.model.getOptions(),s=E(window,"location"),{width:a,height:o}=I.getSVGElementSize(n,{useAttrs:!0}),c=Qi({name:r.title||"Treemap",children:i}).sum(f=>f.value).sort((f,p)=>p.value-f.value),l=pw().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(c),u=n.selectAll("g[data-name='leaf']").data(l.leaves(),f=>f.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>DP++).merge(u);h.attr("data-name","leaf").transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-group-update",animate:t})).attr("transform",f=>`translate(${f.x0},${f.y0})`);const d=h.selectAll("rect.leaf").data(f=>[f]);d.exit().attr("width",0).attr("height",0).remove(),d.enter().append("rect").classed("leaf",!0).merge(d).attr("width",0).attr("height",0).attr("id",function(){const f=P(this.parentNode).attr("data-uid");return`${r.style.prefix}-leaf-${f}`}).attr("class",f=>{for(;f.depth>1;)f=f.parent;return this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:f.data.name,originalClassName:"leaf"})}).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-leaf-update-enter",animate:t})).attr("width",f=>f.x1-f.x0).attr("height",f=>f.y1-f.y0).style("fill",f=>{for(;f.depth>1;)f=f.parent;return this.model.getFillColor(f.data.name)}),h.selectAll("clipPath").data(f=>f.data.showLabel!==!0?[]:[1],f=>f).join(f=>f.append("clipPath").attr("id",function(){const p=P(this.parentNode).attr("data-uid");return`${r.style.prefix}-clip-${p}`}).append("use").attr("xlink:href",function(){const p=P(this.parentNode.parentNode).attr("data-uid"),m=`${r.style.prefix}-leaf-${p}`;return new URL(`#${m}`,s)+""}),f=>null,f=>f.remove()),h.selectAll("text").data(f=>{if(f.data.showLabel!==!0)return[];let p=f;for(;p.depth>1;)p=p.parent;const m=qa(this.model.getFillColor(p.data.name));return[{text:f.data.name,color:m.l<.5?"white":"black"}]},f=>f).join(f=>{const p=f.append("text").text(m=>m.text).style("fill",cm).attr("x",7).attr("y",18);return s&&p.attr("clip-path",function(){const m=P(this.parentNode).attr("data-uid"),g=`${r.style.prefix}-clip-${m}`;return`url(${new URL(`#${g}`,s)+""})`}),p},f=>f.text(p=>p.text).style("fill",cm),f=>f.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,i){const r=P(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=i;for(;a.depth>1;)a=a.parent;r.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const c=t.model.getFillColor(o.parent.data.name);return c&&(s=c),Ge(s).darker(.7).toString()}),t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{color:s,label:a.data.name,bold:!0},{label:i.data.name,value:i.data.value}]}),t.services.events.dispatchEvent(C.Treemap.LEAF_MOUSEOVER,{event:n,element:r,datum:i})}).on("mousemove",function(n,i){const r=P(this);t.services.events.dispatchEvent(C.Treemap.LEAF_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(C.Treemap.LEAF_CLICK,{event:n,element:P(this),datum:i})}).on("mouseout",function(n,i){const r=P(this);r.classed("hovered",!1);let s=i;for(;s.depth>1;)s=s.parent;r.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name)),t.services.events.dispatchEvent(C.Treemap.LEAF_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:r})})}}class RP extends ht{constructor(){super(...arguments),this.type="wordcloud",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-wordcloud"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,i=this.getComponentContainer().attr("width","100%").attr("height","100%"),r=this.model.getDisplayData(),s=this.getFontSizeScale(r),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:c}=a.wordCloud,{groupMapsTo:l}=a.data,{width:u,height:h}=I.getSVGElementSize(i,{useAttrs:!0});if(u===0||h===0)return;const d=vL().size([u,h]).words(r.map(function(p){const m=p[o];if(typeof p[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[l]:p[l],text:p[c],size:m,value:m}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);d.start();function f(p){const m=I.appendOrSelect(i,"g.words");m.attr("transform",`translate(${d.size()[0]/2}, ${d.size()[1]/2})`);const g=m.selectAll("text").data(p,v=>`${v[l]}-${v.text}`);g.exit().attr("opacity",0).remove(),g.enter().append("text").attr("opacity",0).merge(g).style("font-size",v=>`${v.size}px`).text(function(v){return v.text}).attr("class",v=>n.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:v[l],originalClassName:`word ${v.size>32?"light":""}`})).style("fill",v=>n.model.getFillColor(v[l],v.text,v)).attr("text-anchor","middle").transition().call(v=>n.services.transitions.setupTransition({transition:v,name:"wordcloud-text-update-enter",animate:t})).attr("transform",v=>`translate(${v.x}, ${v.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:i}=n.wordCloud,r=t.map(c=>c[i]).filter(c=>c),s=I.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=r.length>0,o=a?xe(r):[1,1];return Se().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this,r=va(s=>{const a=i.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>i.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;r(o),i.services.events.dispatchEvent(C.WordCloud.WORD_MOUSEOVER,{event:s,element:P(this),datum:a}),i.services.events.dispatchEvent(C.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:t.tooltip.groupLabel,value:a[n],class:i.model.getColorClassName({classNameTypes:[J.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=P(this);i.services.events.dispatchEvent(C.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),i.services.events.dispatchEvent(C.Tooltip.MOVE,{event:s})}).on("click",function(s,a){i.services.events.dispatchEvent(C.WordCloud.WORD_CLICK,{event:s,element:P(this),datum:a})}).on("mouseout",function(s,a){const o=P(this);r(null),i.services.events.dispatchEvent(C.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),i.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:o})})}}class IP extends ht{constructor(){super(...arguments),this.type="geo",this.renderType=K.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:i}=I.getSVGElementSize(t,{useAttrs:!0});if(n<1||i<1)return;const r=this.getProjection(),s=E(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},c={};Object.keys(a).forEach(g=>{typeof a[g].value=="number"?o[g]=a[g]:c[g]=a[g]});const l=zk(s,Object.values(c)),u=Vk(s,{type:"GeometryCollection",geometries:Object.values(o)}),h=r.fitSize([n,i],u),d=Yx().projection(h);I.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",d);const f=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),p=I.appendOrSelect(t,"defs");I.appendOrSelect(p,"pattern").attr("id",f).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",lr()([[0,0],[0,10]]));const m=I.appendOrSelect(t,"g.missing-data");I.appendOrSelect(m,"path").datum(l).attr("d",d).style("fill",`url(#${f})`)}getProjection(){let t=null;switch(E(this.getOptions(),"thematic","projection")){case Je.geoEqualEarth:t=fb();break;case Je.geoAlbers:t=ab();break;case Je.geoConicEqualArea:t=Ah();break;case Je.geoConicEquidistant:t=hb();break;case Je.geoEquirectangular:t=cb();break;case Je.geoMercator:t=ob();break;case Je.geoNaturalEarth1:t=pb();break;default:throw new Error("Projection is not supported.")}return t}}class PP extends IP{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",i=>this.model.getColorClassName({value:n[i.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(i,r){const s=P(this);t.services.events.dispatchEvent(ui.CHOROPLETH_MOUSEOVER,{event:i,element:s,datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(ur.SHOW,{event:i,hoveredElement:s,items:[{label:r.properties.NAME,value:n[r.properties.NAME].value}]})}).on("mousemove",function(i,r){t.services.events.dispatchEvent(ui.CHOROPLETH_MOUSEMOVE,{event:i,element:P(this),datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(ur.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(ui.CHOROPLETH_CLICK,{event:i,element:P(this),datum:n[r.properties.NAME]})}).on("mouseout",function(i,r){const s=P(this);t.services.events.dispatchEvent(ui.CHOROPLETH_MOUSEOUT,{event:i,element:s,datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(ur.HIDE,{event:i,hoveredElement:s})})}}function um(e,t){st(2,arguments);var n=ft(e),i=Ut(t);return isNaN(i)?new Date(NaN):(i&&n.setDate(n.getDate()+i),n)}function _c(e,t){st(2,arguments);var n=ft(e),i=Ut(t);if(isNaN(i))return new Date(NaN);if(!i)return n;var r=n.getDate(),s=new Date(n.getTime());s.setMonth(n.getMonth()+i+1,0);var a=s.getDate();return r>=a?s:(n.setFullYear(s.getFullYear(),s.getMonth(),r),n)}var NP=36e5;function hm(e,t){st(2,arguments);var n=Ut(t);return Ks(e,n*NP)}function dm(e){st(1,arguments);var t=ft(e);return t.setHours(0,0,0,0),t}var UP=864e5;function BP(e,t){st(2,arguments);var n=dm(e),i=dm(t),r=n.getTime()-gl(n),s=i.getTime()-gl(i);return Math.round((r-s)/UP)}var HP=6e4;function Sc(e,t){st(2,arguments);var n=Ut(t);return Ks(e,n*HP)}function Oc(e,t){st(2,arguments);var n=Ut(t);return Ks(e,n*1e3)}function fm(e,t){st(2,arguments);var n=Ut(t);return _c(e,n*12)}function Nr(e,t){st(2,arguments);var n=ft(e),i=ft(t),r=n.getTime()-i.getTime();return r<0?-1:r>0?1:r}var VP=6e4,GP=36e5;function FP(e,t){st(2,arguments);var n=ft(e),i=ft(t),r=n.getFullYear()-i.getFullYear(),s=n.getMonth()-i.getMonth();return r*12+s}function zP(e,t){st(2,arguments);var n=ft(e),i=ft(t);return n.getFullYear()-i.getFullYear()}function pm(e,t){var n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function jP(e,t){st(2,arguments);var n=ft(e),i=ft(t),r=pm(n,i),s=Math.abs(BP(n,i));n.setDate(n.getDate()-r*s);var a=+(pm(n,i)===-r),o=r*(s-a);return o===0?0:o}function Tc(e,t){return st(2,arguments),ft(e).getTime()-ft(t).getTime()}var gm={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},WP="trunc";function Mc(e){return e?gm[e]:gm[WP]}function qP(e,t,n){st(2,arguments);var i=Tc(e,t)/GP;return Mc(n==null?void 0:n.roundingMethod)(i)}function mm(e,t,n){st(2,arguments);var i=Tc(e,t)/VP;return Mc(n==null?void 0:n.roundingMethod)(i)}function YP(e){st(1,arguments);var t=ft(e);return t.setHours(23,59,59,999),t}function XP(e){st(1,arguments);var t=ft(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function ZP(e){st(1,arguments);var t=ft(e);return YP(t).getTime()===XP(t).getTime()}function KP(e,t){st(2,arguments);var n=ft(e),i=ft(t),r=Nr(n,i),s=Math.abs(FP(n,i)),a;if(s<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-r*s);var o=Nr(n,i)===-r;ZP(ft(e))&&s===1&&Nr(e,i)===1&&(o=!1),a=r*(s-Number(o))}return a===0?0:a}function vm(e,t,n){st(2,arguments);var i=Tc(e,t)/1e3;return Mc(n==null?void 0:n.roundingMethod)(i)}function QP(e,t){st(2,arguments);var n=ft(e),i=ft(t),r=Nr(n,i),s=Math.abs(zP(n,i));n.setFullYear(1584),i.setFullYear(1584);var a=Nr(n,i)===-r,o=r*(s-Number(a));return o===0?0:o}function JP(e,t){st(2,arguments);var n=Ut(t);return um(e,-n)}function tN(e,t){st(2,arguments);var n=Ut(t);return _c(e,-n)}function eN(e,t){st(2,arguments);var n=Ut(t);return hm(e,-n)}function ym(e,t){st(2,arguments);var n=Ut(t);return Sc(e,-n)}function xm(e,t){st(2,arguments);var n=Ut(t);return Oc(e,-n)}function nN(e,t){st(2,arguments);var n=Ut(t);return fm(e,-n)}function bm(e){var t=e==null?0:e.length;return t?ca(e,1):[]}class iN extends an{zoomIn(t,n,i){let r,s,a;const o=i||mi;t&&(r=t.x,s=t.y,a=2);const{width:c,height:l}=I.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${c/2}, ${l/2}) scale(${a}) translate(${-r},${-s})`),this.services.events.dispatchEvent(C.CanvasZoom.CANVAS_ZOOM_IN,{element:P(t)})}zoomOut(t,n){const i=n||mi;t.transition().duration(i.duration).ease(i.ease).attr("transform",""),this.services.events.dispatchEvent(C.CanvasZoom.CANVAS_ZOOM_OUT)}}class rN extends an{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,n){this.documentFragment.addEventListener(t,n)}removeEventListener(t,n){this.documentFragment.removeEventListener(t,n)}dispatchEvent(t,n){let i;n?i=new CustomEvent(t,{detail:n}):(i=document.createEvent("Event"),i.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(i)}}class sN extends an{constructor(t,n){super(t,n)}downloadCSV(t,n){const i=document.createElement("a"),r="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:r}),n);else if(URL&&"download"in i){const s=URL.createObjectURL(new Blob([t],{type:r}));i.href=s,i.setAttribute("download",n),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const i=document.createElement("a");i.download=n,i.href=t,document.body.appendChild(i),i.click(),document.body.removeChild(i)}}class aN extends an{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(C.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:i}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||i===!1?t.duration(0):t.duration(E(xl,n,"duration")||xl.default.duration)}getPendingTransitions(){return this.pendingTransitions}}let oN=class extends an{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:i}=n.data,r=E(n,"axes",this.secondaryDomainAxisPosition),s=t[i];if(r!=null&&r.correspondingDatasets&&r.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const i=this.model.getOptions(),{groupMapsTo:r}=i.data,s=E(i,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[r]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return E(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){return this.getAxisOptions(t).title||(t===H.BOTTOM||t===H.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(H).map(t=>H[t]).forEach(t=>{this.scales[t]=this.createScale(t)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),i=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=i.primaryDomainAxisPosition,this.rangeAxisPosition=i.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=i.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=i.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===H.LEFT||this.rangeAxisPosition===H.RIGHT)&&(this.domainAxisPosition===H.BOTTOM||this.domainAxisPosition===H.TOP)?this.orientation=Ht.VERTICAL:this.orientation=Ht.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,i,r;const s=this.model.getOptions(),a=E(s,"axes");((t=a[H.LEFT])!=null&&t.correspondingDatasets&&a[H.RIGHT]||(n=a[H.RIGHT])!=null&&n.correspondingDatasets&&a[H.LEFT]||(i=a[H.TOP])!=null&&i.correspondingDatasets&&a[H.BOTTOM]||(r=a[H.BOTTOM])!=null&&r.correspondingDatasets&&a[H.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=E(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===Z.LINEAR||this.scaleTypes[t]===Z.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[H.BOTTOM,H.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[H.LEFT,H.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,i,r){const s=this.model.getOptions(),a=E(s,"axes")[i],{mapsTo:o}=a,c=E(r,o)!==null?r[o]:r;let l;switch(n){case Z.LABELS:l=t(c)+t.step()/2;break;case Z.TIME:l=t(new Date(c));break;default:l=t(c)}return l}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),i=this.getRangeAxisPosition({datum:t}),r=this.scales[i],s=this.model.getOptions(),a=E(s,"axes")[i],{mapsTo:o}=a,c=t[o]!==void 0?t[o]:t;return[r(E(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:c),r(E(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:c)]}getValueThroughAxisPosition(t,n){const i=this.scaleTypes[t],r=this.scales[t];return this.getValueFromScale(r,i,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return E(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return E(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const i=this.model.getOptions(),r=E(i,"axes",t);if(r.scaleType===Z.TIME){const s=E(i,"timeScale","addSpaceOnEdges");return lN(n,s)}else return cN(n,gi.paddingRatio,r.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=E(t,"axes"),i=this.isDualAxes();return E(n,H.LEFT)===null&&E(n,H.RIGHT)!==null||E(n,H.RIGHT,"main")===!0||i&&E(n,H.LEFT,"correspondingDatasets")?{primary:H.RIGHT,secondary:H.LEFT}:{primary:H.LEFT,secondary:H.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=E(t,"axes"),i=this.isDualAxes();return E(n,H.BOTTOM)===null&&E(n,H.TOP)!==null||E(n,H.TOP,"main")===!0||i&&E(n,H.BOTTOM,"correspondingDatasets")?{primary:H.TOP,secondary:H.BOTTOM}:{primary:H.BOTTOM,secondary:H.TOP}}findDomainAndRangeAxesPositions(t,n){const i=this.model.getOptions(),r=E(i,"axes",t.primary),s=E(i,"axes",n.primary),a=r.scaleType||Z.LINEAR,o=s.scaleType||Z.LINEAR,c={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return c.primaryDomainAxisPosition=n.primary,c.primaryRangeAxisPosition=t.primary,c.secondaryDomainAxisPosition=n.secondary,c.secondaryRangeAxisPosition=t.secondary,(!(o===Z.LABELS||o===Z.TIME)&&a===Z.LABELS||a===Z.TIME)&&(c.primaryDomainAxisPosition=t.primary,c.primaryRangeAxisPosition=n.primary,c.secondaryDomainAxisPosition=t.secondary,c.secondaryRangeAxisPosition=n.secondary),c}getScaleDomain(t){const n=this.model.getOptions(),i=E(n,"axes",t),r=E(n,"bounds"),{includeZero:s}=i,a=E(i,"scaleType")||Z.LINEAR;if(this.model.isDataEmpty())return[];if(i.binned){const{bins:v}=this.model.getBinConfigurations();return[0,bn(v,b=>b.length)]}else if(i.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),b=this.model.getStackKeys({bins:v});return[b[0].split("-")[0],b[b.length-1].split("-")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:c,mapsTo:l,percentage:u,thresholds:h}=i,{reference:d,compareTo:f}=gi.ratio;if(i.domain)return a===Z.LABELS?i.domain:(a===Z.TIME&&(i.domain=i.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,i.domain));if(u)return[0,100];if(i&&a===Z.LABELS)return Tr(o.map(v=>v[l]));let p,m;const g=this.model.getDataGroupNames();if(a===Z.LABELS_RATIO)return o.map(v=>`${v[d]}/${v[f]}`);if(a===Z.TIME)m=o.map(v=>+new Date(v[l]));else if(r&&n.axes)m=[],o.forEach(v=>{m.push(v[l]),v[r.upperBoundMapsTo]&&m.push(v[r.upperBoundMapsTo]),v[r.lowerBoundMapsTo]&&m.push(v[r.lowerBoundMapsTo])});else if(i.stacked===!0&&g&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,b=this.model.getDataValuesGroupedByKeys({groups:g}),w=o.filter(_=>!g.includes(_[v])),O=[];b.forEach(_=>{const{...T}=_;let S=0,$=0;Object.values(T).forEach(D=>{isNaN(D)||(D<0?$+=D:S+=D)}),O.push([$,S])}),m=[...bm(O),...w.map(_=>_[l])]}else m=[],o.forEach(v=>{const b=v[l];Array.isArray(b)&&b.length===2?(m.push(b[0]),m.push(b[1])):(c&&m.push(Math.max(v[l],v[c])),m.push(b))});return a!==Z.TIME&&a!==Z.LOG&&s&&m.push(0),h&&h.length>0&&h.forEach(v=>{const b=E(v,"value");b!==null&&m.push(b)}),p=xe(m),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),i=E(n,"axes",t);if(!i)return null;const r=E(i,"scaleType")||Z.LINEAR;this.scaleTypes[t]=r;let s;return r===Z.TIME?s=gd():r===Z.LOG?s=Zh().base(i.base||10):r===Z.LABELS||r===Z.LABELS_RATIO?s=er():s=Se(),s.domain(this.getScaleDomain(t)),s}getHighestDomainThreshold(){const t=E(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:i}=t[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const r=this.getDomainScale(),s=i.sort((a,o)=>o.value-a.value)[0];return this.getScaleTypeByPosition(n)===Z.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:r(s.value)}}getHighestRangeThreshold(){const t=E(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:i}=t[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const r=this.getRangeScale(),s=i.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:r(s.value)}}};function lN(e,t){const n=new Date(e[0]),i=new Date(e[1]);return QP(i,n)>1?[nN(n,t),fm(i,t)]:KP(i,n)>1?[tN(n,t),_c(i,t)]:jP(i,n)>1?[JP(n,t),um(i,t)]:qP(i,n)>1?[eN(n,t),hm(i,t)]:mm(i,n)>30?[ym(n,t*30),Sc(i,t*30)]:mm(i,n)>1?[ym(n,t),Sc(i,t)]:vm(i,n)>15?[xm(n,t*15),Oc(i,t*15)]:vm(i,n)>1?[xm(n,t),Oc(i,t)]:[n,i]}function cN([e,t],n,i){const r=(t-e)*n,s=t<=0&&t+r>0?0:t+r;let a=e>=0&&e-r<0?0:e-r;if(i===Z.LOG&&a<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");a=e}return[a,s]}let uN=class extends an{constructor(){super(...arguments),this.curveTypes={curveLinear:Bs,curveLinearClosed:Cd,curveBasis:l_,curveBasisClosed:c_,curveBasisOpen:u_,curveBundle:h_,curveCardinal:d_,curveCardinalClosed:f_,curveCardinalOpen:p_,curveCatmullRom:g_,curveCatmullRomClosed:m_,curveCatmullRomOpen:v_,curveMonotoneX:y_,curveMonotoneY:x_,curveNatural:b_,curveStep:w_,curveStepAfter:__,curveStepBefore:E_}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let i=this.curveTypes[t];return n&&Object.keys(n).forEach(r=>{i[r]&&(i=i[r](n[r]))}),i}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}};class hN extends an{isZoomBarEnabled(){if(!this.services.cartesianScales||!E(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=E(this.model.getOptions(),"axes",t,"scaleType");return t===H.BOTTOM&&n===Z.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales undefined");const r=i.getMainXAxisPosition(),s=i.getDomainIdentifier(),a=E(this.model.getOptions(),"axes",r,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!r)throw new Error("Not defined: mainXAxisPosition");return i.extendsDomain(r,xe(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var i;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((i=this.services.events)==null||i.dispatchEvent(C.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return E(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var i;const r=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=E(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&a&&r){const o=s.stacked?"sharedStackKey":(i=this.services.cartesianScales)==null?void 0:i.getDomainIdentifier(),c=t.filter(l=>new Date(l[o])>=r[0]&&new Date(l[o])<=r[1]);if(c.length>0)return c}return t}zoomIn(t=this.getZoomRatio()){var n;const i=this.model.get("zoomDomain"),r=ie.handleWidth,s=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();s.domain(this.getDefaultZoomBarDomain());const a=s(i[0]),o=s(i[1]);if(o-a<r+1)return;const c=s.range(),l=o-a,u=Math.min((c[1]-c[0])/2*(t/2),l/2);let h=a+u,d=o-u;h>=d&&(h=a+l/2-r/2,d=o-l/2+r/2);const f=[s.invert(h),s.invert(d)];(i[0].valueOf()!==f[0].valueOf()||i[1].valueOf()!==f[1].valueOf())&&this.handleDomainChange(f)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const i=this.services.cartesianScales.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const r=i(n[0]),s=i(n[1]),a=i.range(),o=(a[1]-a[0])/2*(t/2),c=Math.max(r-o,a[0]),l=Math.min(s+o,a[1]),u=[i.invert(c),i.invert(l)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const i=t[1].valueOf()-t[0].valueOf(),r=n[1].valueOf()-n[0].valueOf(),s=E(this.model.getOptions(),"zoomBar","minZoomRatio");return i/r<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return E(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return E(this.model.getOptions(),"zoomBar",t,"locked")}}function dN(e,t,n){var i=-1,r=e.length;t<0&&(t=-t>r?0:r+t),n=n>r?r:n,n<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(r);++i<r;)s[i]=e[i+t];return s}function fN(e,t,n){var i=e.length;return n=n===void 0?i:n,!t&&n>=i?e:dN(e,t,n)}var pN="\\ud800-\\udfff",gN="\\u0300-\\u036f",mN="\\ufe20-\\ufe2f",vN="\\u20d0-\\u20ff",yN=gN+mN+vN,xN="\\ufe0e\\ufe0f",bN="\\u200d",wN=RegExp("["+bN+pN+yN+xN+"]");function wm(e){return wN.test(e)}function EN(e){return e.split("")}var Em="\\ud800-\\udfff",_N="\\u0300-\\u036f",SN="\\ufe20-\\ufe2f",ON="\\u20d0-\\u20ff",TN=_N+SN+ON,MN="\\ufe0e\\ufe0f",CN="["+Em+"]",Cc="["+TN+"]",Ac="\\ud83c[\\udffb-\\udfff]",AN="(?:"+Cc+"|"+Ac+")",_m="[^"+Em+"]",Sm="(?:\\ud83c[\\udde6-\\uddff]){2}",Om="[\\ud800-\\udbff][\\udc00-\\udfff]",$N="\\u200d",Tm=AN+"?",Mm="["+MN+"]?",LN="(?:"+$N+"(?:"+[_m,Sm,Om].join("|")+")"+Mm+Tm+")*",DN=Mm+Tm+LN,kN="(?:"+[_m+Cc+"?",Cc,Sm,Om,CN].join("|")+")",RN=RegExp(Ac+"(?="+Ac+")|"+kN+DN,"g");function IN(e){return e.match(RN)||[]}function PN(e){return wm(e)?IN(e):EN(e)}function NN(e){return function(t){t=Sr(t);var n=wm(t)?PN(t):void 0,i=n?n[0]:t.charAt(0),r=n?fN(n,1).join(""):t.slice(1);return i[e]()+r}}var UN=NN("toUpperCase");const BN=UN;function HN(e){return BN(Sr(e).toLowerCase())}var VN=Cg(function(e,t,n){return t=t.toLowerCase(),e+(n?HN(t):t)});const GN=VN;class Ae{constructor(t,n){this.components=[],this.services={canvasZoom:iN,domUtils:I,events:rN,files:sN,gradientUtils:Zl,transitions:aN},this.model=new Be(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(i=>{const r=this.services[i];this.services[i]=new r(this.model,this.services)}),this.services.events.addEventListener(C.Model.UPDATE,()=>{this.update()}),this.model.setData(n.data),this.services.events.addEventListener(C.Chart.RESIZE,()=>{this.update()}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(!0));const t=this.services.transitions.getPendingTransitions(),n=Object.keys(t).map(i=>t[i].end().catch(r=>r));Promise.all(n).then(()=>this.services.events.dispatchEvent(C.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,n){const i=this.model.getOptions(),r=E(i,"toolbar","enabled"),s={id:"legend",components:[new xc(this.model,this.services)],growth:it.PREFERRED},a=E(i,"canvasZoom","enabled");a&&a===!0&&t.push(new Ck(this.model,this.services));const o=!!this.model.getOptions().title,c={id:"title",components:[new Pr(this.model,this.services)],growth:it.STRETCH},l={id:"toolbar",components:[new Rr(this.model,this.services)],growth:it.PREFERRED},u={id:"header",components:[new re(this.model,this.services,[c,...r?[l]:[]],{direction:_t.ROW,alignItems:hi.CENTER})],growth:it.PREFERRED},h={id:"graph-frame",components:t,growth:it.STRETCH,renderType:E(n,"graphFrameRenderType")||K.SVG},d=E(n,"excludeLegend")!==!0&&i.legend.enabled!==!1;let f=_t.COLUMN;if(d){const v=E(i,"legend","position");v==="left"?(f=_t.ROW,i.legend.orientation||(i.legend.orientation=dr.VERTICAL)):v==="right"?(f=_t.ROW_REVERSE,i.legend.orientation||(i.legend.orientation=dr.VERTICAL)):v==="bottom"&&(f=_t.COLUMN_REVERSE)}const p={id:"spacer",components:[new on(this.model,this.services)],growth:it.PREFERRED},m={id:"full-frame",components:[new re(this.model,this.services,[...d?[s]:[],...d?[p]:[],h],{direction:f})],growth:it.STRETCH},g=[];if(o||r){g.push(u);const v={id:"spacer",components:[new on(this.model,this.services,r?{size:15}:void 0)],growth:it.PREFERRED};g.push(v)}return g.push(m),[new bc(this.model,this.services),new Ca(this.model,this.services),new re(this.model,this.services,g,{direction:_t.COLUMN})]}}class ae extends Ae{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:oN,curves:uN,zoom:hN}),this.model=new Gn(this.services)}getAxisChartComponents(t,n){const i=this.model.getOptions(),r=E(i,"zoomBar",H.TOP,"enabled"),s=E(i,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=E(i,"axes",a,"scaleType"),c=r&&a===H.BOTTOM&&o===Z.TIME,l=this.services.zoom.isZoomBarLocked(H.TOP),u=!!this.model.getOptions().title,h={id:"title",components:[new Pr(this.model,this.services)],growth:it.STRETCH},d={id:"toolbar",components:[new Rr(this.model,this.services)],growth:it.PREFERRED},f={id:"header",components:[new re(this.model,this.services,[h,...s?[d]:[]],{direction:_t.ROW,alignItems:hi.CENTER})],growth:it.PREFERRED},p={id:"legend",components:[new xc(this.model,this.services)],growth:it.PREFERRED};c&&!l&&t.push(new zg(this.model,this.services),new qg(this.model,this.services)),t.push(new $k(this.model,this.services)),t.push(new Lk(this.model,this.services));const m={id:"graph-frame",components:t,growth:it.STRETCH,renderType:K.SVG},g=E(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=_t.COLUMN;if(g){const T=E(this.model.getOptions(),"legend","position");T===hr.LEFT?(v=_t.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=dr.VERTICAL)):T===hr.RIGHT?(v=_t.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=dr.VERTICAL)):T===hr.BOTTOM&&(v=_t.COLUMN_REVERSE)}const b={id:"spacer",components:[new on(this.model,this.services)],growth:it.PREFERRED},w={id:"full-frame",components:[new re(this.model,this.services,[...g?[p]:[],...g?[b]:[],m],{direction:v})],growth:it.STRETCH},O={id:"zoom-bar",components:[new Ak(this.model,this.services)],growth:it.PREFERRED,renderType:K.SVG},_=[];if(u||s){_.push(f);const T={id:"spacer",components:[new on(this.model,this.services,s?{size:15}:void 0)],growth:it.PREFERRED};_.push(T)}return c&&_.push(O),_.push(w),[new Yg(this.model,this.services),new Ca(this.model,this.services),new re(this.model,this.services,_,{direction:_t.COLUMN})]}}class FN extends Ae{constructor(t,n){super(t,n),this.model=new i$(this.services),this.model.setOptions(Ct(wt.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new Dk(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class zN extends ae{constructor(t,n){super(t,n),this.model.setOptions(Ct(nn(wt.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new he(this.model,this.services),new vn(this.model,this.services),new Mi(this.model,this.services),new Xg(this.model,this.services),new He(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new te(this.model,this.services,{skeleton:Pt.GRID})];return this.getAxisChartComponents(t)}}class jN extends ae{constructor(t,n){super(t,n),this.model=new r$(this.services),this.model.setOptions(Ct(wt.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new he(this.model,this.services),new Ik(this.model,this.services),new Ci(this.model,this.services),new te(this.model,this.services,{skeleton:Pt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class WN extends ae{constructor(t,n){super(t,n),this.model.setOptions(Ct(wt.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new he(this.model,this.services),new vn(this.model,this.services),new Pk(this.model,this.services),new te(this.model,this.services,{skeleton:Pt.GRID})];return this.getAxisChartComponents(t)}}class qN extends ae{constructor(t,n){super(t,n),this.model=new s$(this.services),this.model.setOptions(Ct(wt.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new he(this.model,this.services),new Nk(this.model,this.services),new te(this.model,this.services,{skeleton:Pt.GRID})];return this.getAxisChartComponents(t)}}class YN extends Ae{constructor(t,n){super(t,n),this.model=new a$(this.services),this.model.setOptions(Ct(wt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const i=this.model.getOptions(),r=E(i,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new Pr(this.model,this.services)],growth:it.STRETCH},o={id:"toolbar",components:[new Rr(this.model,this.services)],growth:it.PREFERRED},c={id:"header",components:[new re(this.model,this.services,[a,...r?[o]:[]],{direction:_t.ROW,alignItems:hi.CENTER})],growth:it.PREFERRED},l={id:"legend",components:[new Jg(this.model,this.services,{chartType:"choropleth"})],growth:it.PREFERRED,renderType:K.SVG},u={id:"graph-frame",components:t,growth:it.STRETCH,renderType:K.SVG},h=E(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,d=_t.COLUMN_REVERSE,f={id:"spacer",components:[new on(this.model,this.services,{size:15})],growth:it.PREFERRED},p={id:"full-frame",components:[new re(this.model,this.services,[...h?[l]:[],...h?[f]:[],u],{direction:d})],growth:it.STRETCH},m=[];if(s||r){m.push(c);const g={id:"spacer",components:[new on(this.model,this.services,r?{size:15}:void 0)],growth:it.PREFERRED};m.push(g)}return m.push(p),[new bc(this.model,this.services),new Ca(this.model,this.services),new re(this.model,this.services,m,{direction:_t.COLUMN})]}getComponents(){const t=[new PP(this.model,this.services)];return this.getChartComponents(t)}}class XN extends Ae{constructor(t,n){super(t,n),this.model=new o$(this.services),this.model.setOptions(Ct(wt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new Yk(this.model,this.services)];return this.getChartComponents(t)}}const Cm={[pe.LINE]:[Mi,He],[pe.SCATTER]:[He],[pe.AREA]:[Xg,Mi,He],[pe.STACKED_AREA]:[sm,Mi,om,La],[pe.SIMPLE_BAR]:[rm],[pe.GROUPED_BAR]:[im,Ci],[pe.STACKED_BAR]:[am,La]};class ZN extends ae{constructor(t,n){super(t,n);const i=Ct(wt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),i.comboChartTypes=[{type:pe.LINE,correspondingDatasets:[]}]),this.model.setOptions(i),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const i=t.map(r=>{const s=r.type;let a;if(typeof r.type=="string"){if(!Object.keys(Cm).includes(r.type))return console.error(`Invalid chart type "${r.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const c=`${GN(r.type)}Chart`;return a=nt({},wt[c],this.model.getOptions(),r.options),r.type===pe.STACKED_AREA&&(o=!0),Cm[r.type].map(l=>new l(this.model,this.services,{groups:r.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=nt({},this.model.getOptions(),r.options),new s(this.model,this.services,{groups:r.correspondingDatasets,id:n++,options:a})}).filter(r=>r!==null);return bm(i)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(r=>r.type===pe.STACKED_BAR||r.type===pe.STACKED_AREA),i=[new se(this.model,this.services),new he(this.model,this.services),new te(this.model,this.services,{skeleton:Pt.GRID}),...n?[]:[new vn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(i)}}class Am extends Ae{constructor(t,n,i=!1){super(t,n),this.model=new l$(this.services),!i&&(this.model.setOptions(Ct(wt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new tm(this.model,this.services),new te(this.model,this.services,{skeleton:Pt.PIE})];return this.getChartComponents(t)}}class KN extends Am{constructor(t,n){super(t,n,!0),this.model.setOptions(Ct(wt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new Zk(this.model,this.services),new te(this.model,this.services,{skeleton:Pt.DONUT})];return this.getChartComponents(t)}}class QN extends Ae{constructor(t,n){super(t,n),this.model=new c$(this.services),this.model.setOptions(Ct(wt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new Kk(this.model,this.services)];return this.getChartComponents(t)}}class JN extends ae{constructor(t,n){super(t,n),this.model.setOptions(Ct(wt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new he(this.model,this.services),new im(this.model,this.services),new Ci(this.model,this.services),new te(this.model,this.services,{skeleton:Pt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class tU extends ae{constructor(t,n){super(t,n),this.model=new u$(this.services),this.model.setOptions(Ct(wt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const i=this.model.getOptions(),r=E(i,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new Pr(this.model,this.services)],growth:it.STRETCH},o={id:"toolbar",components:[new Rr(this.model,this.services)],growth:it.PREFERRED},c={id:"header",components:[new re(this.model,this.services,[a,...r?[o]:[]],{direction:_t.ROW,alignItems:hi.CENTER})],growth:it.PREFERRED},l={id:"legend",components:[new Jg(this.model,this.services,{chartType:"heatmap"})],growth:it.PREFERRED,renderType:K.SVG},u={id:"graph-frame",components:t,growth:it.STRETCH,renderType:K.SVG},h=E(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,d=_t.COLUMN_REVERSE,f={id:"spacer",components:[new on(this.model,this.services,{size:15})],growth:it.PREFERRED},p={id:"full-frame",components:[new re(this.model,this.services,[...h?[l]:[],...h?[f]:[],u],{direction:d})],growth:it.STRETCH},m=[];if(s||r){m.push(c);const g={id:"spacer",components:[new on(this.model,this.services,r?{size:15}:void 0)],growth:it.PREFERRED};m.push(g)}return m.push(p),[new Yg(this.model,this.services),new Ca(this.model,this.services),new re(this.model,this.services,m,{direction:_t.COLUMN})]}getComponents(){const t=[new se(this.model,this.services),new Qk(this.model,this.services)];return this.getAxisChartComponents(t)}}class eU extends ae{constructor(t,n){super(t,n),this.model=new h$(this.services),this.model.setOptions(Ct(wt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new se(this.model,this.services),new he(this.model,this.services),new Wk(this.model,this.services),new Jk(this.model,this.services)];return this.getAxisChartComponents(t)}}class nU extends ae{constructor(t,n){super(t,n),this.model.setOptions(Ct(wt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new he(this.model,this.services),new vn(this.model,this.services),new Mi(this.model,this.services),new He(this.model,this.services,{handleThresholds:!0}),new iR(this.model,this.services),new Ci(this.model,this.services)];return this.getAxisChartComponents(t)}}class iU extends ae{constructor(t,n){super(t,n),this.model.setOptions(Ct(wt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new he(this.model,this.services),new vn(this.model,this.services),new tR(this.model,this.services),new He(this.model,this.services),new te(this.model,this.services,{skeleton:Pt.GRID})];return this.getAxisChartComponents(t)}}class rU extends Ae{constructor(t,n){var i;super(t,n),this.model=new d$(this.services);const r=(i=n.options.meter)!=null&&i.proportional?nt(nn(wt.proportionalMeterChart),n.options):nt(nn(wt.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const t=[...E(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new qk(this.model,this.services)],growth:it.STRETCH,renderType:K.SVG},{id:"spacer",components:[new on(this.model,this.services,{size:8})],growth:it.STRETCH}]:[],{id:"meter-graph",components:[new eR(this.model,this.services)],growth:it.STRETCH,renderType:K.SVG}],n=[new re(this.model,this.services,t,{direction:_t.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:K.HTML})}}class sU extends Ae{constructor(t,n){super(t,n),this.model=new f$(this.services),this.model.setOptions(Ct(wt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new nR(this.model,this.services)];return this.getChartComponents(t)}}class aU extends ae{constructor(t,n){super(t,n),this.model.setOptions(Ct(wt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new he(this.model,this.services),new vn(this.model,this.services),new He(this.model,this.services),new te(this.model,this.services,{skeleton:Pt.GRID})];return this.getAxisChartComponents(t)}}class oU extends Ae{constructor(t,n){super(t,n),this.model=new p$(this.services),this.model.setOptions(Ct(wt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new rR(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class lU extends Ae{constructor(t,n){super(t,n),this.model=new g$(this.services),this.model.setOptions(Ct(wt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new kP(this.model,this.services)];return this.getChartComponents(t)}}class cU extends ae{constructor(t,n){super(t,n),this.model.setOptions(Ct(wt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new he(this.model,this.services),new rm(this.model,this.services),new Ci(this.model,this.services),new te(this.model,this.services,{skeleton:Pt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class uU extends ae{constructor(t,n){super(t,n),this.model.setOptions(Ct(wt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new he(this.model,this.services),new La(this.model,this.services),new sm(this.model,this.services),new Mi(this.model,this.services,{stacked:!0}),new om(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new te(this.model,this.services,{skeleton:Pt.GRID})];return this.getAxisChartComponents(t)}}class hU extends ae{constructor(t,n){super(t,n),this.model.setOptions(Ct(wt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new he(this.model,this.services),new La(this.model,this.services),new am(this.model,this.services),new te(this.model,this.services,{skeleton:Pt.VERT_OR_HORIZ}),new Ci(this.model,this.services)];return this.getAxisChartComponents(t)}}class dU extends Ae{constructor(t,n){super(t,n),this.model=new m$(this.services),this.model.setOptions(Ct(wt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new RP(this.model,this.services),new te(this.model,this.services,{skeleton:Pt.PIE})];return this.getChartComponents(t)}}function Mt(e,t){return ye.defineComponent({name:t,props:{data:{type:Object,required:!0},options:{type:Object,required:!0}},setup(n){const i=ye.ref(null),r=ye.ref(null),{data:s,options:a}=ye.toRefs(n);return ye.onMounted(()=>{r.value=new e(i.value,{data:s.value,options:a.value})}),ye.watch(s,o=>{var c;(c=r.value)==null||c.model.setData(o)},{immediate:!0}),ye.watch(a,o=>{var c;(c=r.value)==null||c.model.setOptions(o)}),{chart:r,chartDiv:i}},template:'<div ref="chartDiv"></div>'})}const $m=Mt(FN,"CcvAlluvialChart"),Lm=Mt(zN,"CcvAreaChart"),Dm=Mt(jN,"CcvBoxplotChart"),km=Mt(WN,"CcvBubbleChart"),Rm=Mt(qN,"CcvBulletChart"),Im=Mt(YN,"ExperimentalCcvChoroplethChart"),Pm=Mt(XN,"CcvCirclePackChart"),Nm=Mt(ZN,"CcvComboChart"),Um=Mt(KN,"CcvDonutChart"),Bm=Mt(QN,"CcvGaugeChart"),Hm=Mt(JN,"CcvGroupedBarChart"),Vm=Mt(tU,"CcvHeatmapChart"),Gm=Mt(eU,"CcvHistogramChart"),Fm=Mt(nU,"CcvLineChart"),zm=Mt(iU,"CcvLollipopChart"),jm=Mt(rU,"CcvMeterChart"),Wm=Mt(Am,"CcvPieChart"),qm=Mt(sU,"CcvRadarChart"),Ym=Mt(aU,"CcvScatterChart"),Xm=Mt(cU,"CcvSimpleBarChart"),Zm=Mt(uU,"CcvStackedAreaChart"),Km=Mt(hU,"CcvStackedBarChart"),Qm=Mt(oU,"CcvTreeChart"),Jm=Mt(lU,"CcvTreemapChart"),tv=Mt(dU,"CcvWordCloudChart"),fU=[$m,Lm,Dm,km,Rm,Im,Pm,Nm,Um,Bm,Hm,Vm,Gm,Fm,zm,jm,Wm,qm,Ym,Xm,Zm,Km,Qm,Jm,tv],pU={install(e,t){for(const n of fU)(!t||t.includes(n.name))&&e.component(n.name,n)}};rt.CcvAlluvialChart=$m,rt.CcvAreaChart=Lm,rt.CcvBoxplotChart=Dm,rt.CcvBubbleChart=km,rt.CcvBulletChart=Rm,rt.CcvCirclePackChart=Pm,rt.CcvComboChart=Nm,rt.CcvDonutChart=Um,rt.CcvGaugeChart=Bm,rt.CcvGroupedBarChart=Hm,rt.CcvHeatmapChart=Vm,rt.CcvHistogramChart=Gm,rt.CcvLineChart=Fm,rt.CcvLollipopChart=zm,rt.CcvMeterChart=jm,rt.CcvPieChart=Wm,rt.CcvRadarChart=qm,rt.CcvScatterChart=Ym,rt.CcvSimpleBarChart=Xm,rt.CcvStackedAreaChart=Zm,rt.CcvStackedBarChart=Km,rt.CcvTreeChart=Qm,rt.CcvTreemapChart=Jm,rt.CcvWordCloudChart=tv,rt.ExperimentalCcvChoroplethChart=Im,rt.default=pU,Object.defineProperties(rt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
83
+ </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,i){const r=P(this);r.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!r.classed("focal"),o=E(t.model.getOptions(),"canvasZoom","enabled");let c=!1;if(!a){let l=[],u=[],h=null;if(i.children){i.depth>1&&o&&(c=!0,r.classed("clickable",!0)),l=i.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:St(f,"tooltip.totalLabel")||"Total",value:i.value,bold:!0}],t.highlightChildren(i.children)}else h=i.value;const d=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{color:d,label:i.data.name,labelIcon:c&&o&&s<=2?t.getZoomIcon():null,value:h},...l,...u]})}t.services.events.dispatchEvent(C.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:r,datum:i})}).on("mousemove",function(n,i){const r=P(this);t.services.events.dispatchEvent(C.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,i){const r=P(this);r.classed("hovered",!1),i.children&&t.unhighlightChildren(i.children),t.services.events.dispatchEvent(C.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:r})}).on("click",function(n,i){const r=P(this),s=r.classed("non-focal"),a=E(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");P(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,gi)}else if(i.depth===2&&i.children&&!s&&a){const o=t.parent.selectAll("circle.node");P(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=i,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(i,o,gi),n.stopPropagation()}t.services.events.dispatchEvent(C.CirclePack.CIRCLE_CLICK,{event:n,element:r,datum:i})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function qk(e,t){const n=Pi(this._current,e);return i=>(this._current=n(i),t(this._current))}class Yg extends ht{constructor(){super(...arguments),this.type="pie",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r.data[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return _t.innerRadius}render(t=!0){const n=this,i=this.getComponentContainer(),r=this.getOptions(),{groupMapsTo:s}=r.data,{valueMapsTo:a}=r.pie,o=this.model.getDisplayData().filter(S=>S[a]>0),c=this.computeRadius();this.arc=or().innerRadius(this.getInnerRadius()).outerRadius(c),this.hoverArc=or().innerRadius(this.getInnerRadius()).outerRadius(c+_t.hoverArc.outerRadiusOffset);const l=WE().value(S=>S[a]).sort(E(r,"pie","sortFunction")).padAngle(_t.padAngle)(o),u=R.appendOrSelect(i,"g.slices").attr("role",at.GROUP).attr("data-name","slices").selectAll("path.slice").data(l,S=>S.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",S=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:S.data[s],originalClassName:"slice"})).style("fill",S=>n.model.getFillColor(S.data[s])).attr("d",this.arc).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",S=>`${S[a]}, ${Mp(S.data[a],o,a)+"%"}`).attrTween("d",function(S){return qk.bind(this)(S,n.arc)});const h=r.pie.labels.enabled,d=h?l.filter(S=>S.data[a]>0):[],f=R.appendOrSelect(i,"g.labels").attr("role",at.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(d,S=>S.data[s]);f.exit().attr("opacity",0).remove();const p=f.enter().append("text").classed("pie-label",!0),m=[];p.merge(f).style("text-anchor","middle").text(S=>r.pie.labels.formatter?r.pie.labels.formatter(S):Mp(S.data[a],o,a)+"%").datum(function(S){const $=c+7,D=(S.endAngle-S.startAngle)/2+S.startAngle,L=D/Math.PI*180,M=this.getComputedTextLength();return S.textOffsetX=M/2,S.textOffsetY=L>90&&L<270?10:0,S.xPosition=(S.textOffsetX+$)*Math.sin(D),S.yPosition=(S.textOffsetY+$)*-Math.cos(D),S}).attr("transform",function(S,$){const D=d.length,L=(S.endAngle-S.startAngle)*(180/Math.PI);if($>=D-2&&L<_t.callout.minSliceDegree){let M,B;return S.index===D-1?(M=S.xPosition+_t.callout.offsetX+_t.callout.textMargin+S.textOffsetX,B=S.yPosition-_t.callout.offsetY,S.direction=zs.RIGHT,m.push(S)):(M=S.xPosition-_t.callout.offsetX-S.textOffsetX-_t.callout.textMargin,B=S.yPosition-_t.callout.offsetY,S.direction=zs.LEFT,m.push(S)),`translate(${M}, ${B})`}return`translate(${S.xPosition}, ${S.yPosition})`}),this.renderCallouts(m);const g=E(r,"donut")?"donut":"pie",v=E(r,g,"alignment"),{width:b}=R.getSVGElementSize(this.getParent(),{useAttrs:!0}),w=h?_t.xOffset:0,O=h?_t.yOffset:0;let _=c+w;v===It.CENTER?_=b/2:v===It.RIGHT&&(_=b-c-_t.xOffset);let T=c+O;m.length>0&&(T+=_t.yOffsetCallout),i.attr("x",_+7).attr("y",T),this.addEventListeners()}renderCallouts(t){const n=R.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",at.GROUP).attr("data-name","callouts"),i=n.selectAll("g.callout").data(t);i.exit().remove();const r=i.enter().append("g").classed("callout",!0).attr("role",at.GROUP).attr("aria-roledescription","label callout");r.merge(i).datum(function(s){const{xPosition:a,yPosition:o,direction:c}=s;return c===zs.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+_t.callout.offsetX,y:o-_t.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-_t.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-_t.callout.offsetX,y:o-_t.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+_t.callout.horizontalLineLength),s}),r.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return P(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.startPos.x).attr("y1",s=>s.startPos.y).attr("x2",s=>s.intersectPointX).attr("y2",s=>s.endPos.y),r.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return P(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.intersectPointX).attr("y1",s=>s.endPos.y).attr("x2",s=>s.endPos.x).attr("y2",s=>s.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,i){const r=P(this);r.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(C.Pie.SLICE_MOUSEOVER,{event:n,element:P(this),datum:i});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{label:i.data[s],value:i.data[a]}]})}).on("mousemove",function(n,i){const r=P(this);t.services.events.dispatchEvent(C.Pie.SLICE_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(C.Pie.SLICE_CLICK,{event:n,element:P(this),datum:i})}).on("mouseout",function(n,i){const r=P(this);r.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc),t.services.events.dispatchEvent(C.Pie.SLICE_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:r})})}computeRadius(){const{width:t,height:n}=R.getSVGElementSize(this.parent,{useAttrs:!0}),i=this.getOptions(),r=Math.min(t,n)/2;return i.pie.labels.enabled?r+_t.radiusOffset:r}}class Yk extends Yg{constructor(){super(...arguments),this.type="donut",this.renderType=K.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const i=R.appendOrSelect(this.getComponentContainer(),"g.center"),r=this.getOptions(),s=this.computeRadius(),a=E(r,"donut","center","label");R.appendOrSelect(i,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>r.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(P(this))}),a!==null&&a!==""&&R.appendOrSelect(i,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>r.donut.center.titleFontSize(s)).attr("y",r.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let i=E(n,"donut","center","number");i===null&&(i=this.model.getDisplayData().reduce((o,c)=>o+c[n.pie.valueMapsTo],0));const r=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;r%1===0&&i%1===0?s=su:s=oe;const a=s(r,i);return o=>{const{numberFormatter:c}=n.donut.center;t.text(c(a(o)))}}}const Xg="4,10 8,6 12,10",Zg="12,6 8,10 4,6";class Xk extends ht{constructor(){super(...arguments),this.type="gauge",this.renderType=K.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return _g(this.getValue(),0,100)/100}getDelta(){var t;return((t=this.model.getData().find(n=>n.group==="delta"))==null?void 0:t.value)??null}getArcRatio(){const t=this.getOptions();return E(t,"gauge","type")===di.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(E(n,"gauge","deltaArrow","direction")){case dl.UP:return Xg;case dl.DOWN:return Zg;default:return t>0?Xg:Zg}}render(t=!0){const n=this.getComponentContainer().attr("width","100%").attr("height","100%"),i=this.getOptions(),r=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),c=s*a,l=o+c,u=o+a,h=this.computeRadius(),d=this.getInnerRadius();this.backgroundArc=or().innerRadius(d).outerRadius(h).startAngle(l).endAngle(u),this.arc=or().innerRadius(d).outerRadius(h).startAngle(o).endAngle(l),R.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([r]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>E(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",v=>v),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const p=E(i,"gauge","alignment"),{width:m}=R.getSVGElementSize(this.getParent(),{useAttrs:!0});let g=h;p===It.CENTER?g=m/2:p===It.RIGHT&&(g=m-h),n.attr("x",g).attr("y",h),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),i=E(n,"gauge","type"),r=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=E(n,"gauge","valueFontSize"),c=E(n,"gauge","deltaFontSize"),l=E(n,"gauge","numberSpacing"),u=E(n,"gauge","showPercentageSymbol");let h=0;i===di.FULL&&!s?h=c(a):i===di.SEMI&&s&&(h=-(c(a)+l));const d=R.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${h})`),f=o(a),p=R.appendOrSelect(d,"g.gauge-value-number"),m=E(n,"gauge","numberFormatter"),g=p.selectAll("text.gauge-value-number").data([r]);g.enter().append("text").attr("class","gauge-value-number").merge(g).style("font-size",`${f}px`).attr("text-anchor","middle").text(S=>m(S));const{width:v}=R.getSVGElementSize(R.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),b=f/2,w=u?"%":"",O=R.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${b}px`).attr("x",v/2).text(w),{width:_,height:T}=R.getSVGElementSize(O,{useBBox:!0});O.attr("y",`-${T/2}px`),p.attr("transform",`translate(-${_/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),i=this.getOptions(),r=this.getDelta();if(r){const s=this.computeRadius(),a=r?E(i,"gauge","deltaFontSize"):()=>0,o=r?E(i,"gauge","numberFormatter"):()=>null,c=E(i,"gauge","deltaArrow","size"),l=E(i,"gauge","numberSpacing"),u=E(i,"gauge","showPercentageSymbol"),h=R.appendOrSelect(n,"g.gauge-numbers"),d=R.appendOrSelect(h,"g.gauge-delta").attr("transform",`translate(0, ${a(s)+l})`),f=R.appendOrSelect(d,"text.gauge-delta-number"),p=u?"%":"";f.data(r===null?[]:[r]),f.enter().append("text").classed("gauge-delta-number",!0).merge(f).attr("text-anchor","middle").style("font-size",`${a(s)}px`).text(b=>`${o(b)}${p}`);const{width:m}=R.getSVGElementSize(R.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),g=E(i,"gauge","deltaArrow","enabled"),v=d.selectAll("svg.gauge-delta-arrow").data(r!==null&&g?[r]:[]);v.enter().append("svg").merge(v).attr("class","gauge-delta-arrow").attr("x",-c(s)-m/2).attr("y",-c(s)/2-a(s)*.35).attr("width",c(s)).attr("height",c(s)).attr("viewBox","0 0 16 16").each(function(){const b=P(this);R.appendOrSelect(b,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const w=E(i,"gauge","status");R.appendOrSelect(b,"polygon.gauge-delta-arrow").attr("class",w!==null?`gauge-delta-arrow status--${w}`:"").attr("points",t.getArrow(r))}),v.exit().remove(),f.exit().remove()}else{const s=n.select("g.gauge-delta");s.empty()||s.remove()}}getInnerRadius(){const t=this.computeRadius(),n=E(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,i){t.services.events.dispatchEvent(C.Gauge.ARC_MOUSEOVER,{event:n,element:P(this),datum:i})}).on("mousemove",function(n,i){const r=P(this);t.services.events.dispatchEvent(C.Gauge.ARC_MOUSEMOVE,{event:n,element:r,datum:i})}).on("click",function(n,i){t.services.events.dispatchEvent(C.Gauge.ARC_CLICK,{event:n,element:P(this),datum:i})}).on("mouseout",function(n,i){const r=P(this);t.services.events.dispatchEvent(C.Gauge.ARC_MOUSEOUT,{event:n,element:r,datum:i})})}computeRadius(){const t=this.getOptions(),n=E(t,"gauge","type"),{width:i,height:r}=R.getSVGElementSize(this.parent,{useAttrs:!0});return n===di.SEMI?Math.min(i/2,r):Math.min(i/2,r/2)}}class Kg extends vc{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=K.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),i=this.getOptions(),{groupMapsTo:r}=i.data;this.setGroupScale();const s=this.getComponentContainer({withinChartClip:!0}),a=Tr(n.map(u=>{const h=this.services.cartesianScales.getDomainIdentifier(u);return u[h]&&typeof u[h].toString=="function"?u[h].toString():u[h]})),o=s.selectAll("g.bars").data(a,u=>u);o.exit().attr("opacity",0).remove();const c=o.enter().append("g").classed("bars",!0).attr("role",at.GROUP).attr("data-name","bars").merge(o);c.transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-group-update-enter",animate:t})).attr("transform",u=>{const h=this.services.cartesianScales.getDomainValue(u)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Ht.VERTICAL?`translate(${h}, 0)`:`translate(0, ${h})`});const l=c.selectAll("path.bar").data(u=>this.getDataCorrespondingToLabel(u),u=>u[r]);l.exit().attr("opacity",0).remove(),l.enter().append("path").attr("opacity",0).merge(l).classed("bar",!0).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:u[r],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[r])).attr("d",u=>{const h=this.groupScale(u[r]),d=this.getBarWidth(),f=h,p=h+d,m=this.services.cartesianScales.getRangeAxisPosition({datum:u}),g=this.services.cartesianScales.getValueThroughAxisPosition(m,0),v=this.services.cartesianScales.getRangeValue(u),b=this.services.cartesianScales.getDomainValue(u)-d/2,w=b+d;if(!this.isOutsideZoomedDomain(b,w))return Qt({x0:f,x1:p,y0:g,y1:v},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,i){const r=P(this);r.classed("hovered",!0),t.services.events.dispatchEvent(C.Bar.BAR_MOUSEOVER,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:n,hoveredElement:r,data:[i]})}).on("mousemove",function(n,i){const r=P(this);t.services.events.dispatchEvent(C.Bar.BAR_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(C.Bar.BAR_CLICK,{event:n,element:P(this),datum:i})}).on("mouseout",function(n,i){const r=P(this);r.classed("hovered",!1),t.services.events.dispatchEvent(C.Bar.BAR_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:r})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(n=>{const i=this.services.cartesianScales.getDomainIdentifier(n);return n[i].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let i=this.defaultStepFactor;if(typeof t.step=="function")i=t.step();else if(n.length>0){const r=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(r){const s=this.services.cartesianScales.getDomainIdentifier(r.data[0]);i=Math.abs(t(r.data[1][s])-t(r.data[0][s]))}}return i}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=E(t,"bars","width"),i=E(t,"bars","maxWidth");if(n!==null&&(i===null||n<=i))return n;const r=this.model.getGroupedData(this.configs.groups).length,s=this.getTotalGroupPadding();return Math.min(i,(this.getDomainScaleStep()-s)/r)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=er().domain(t).rangeRound([0,this.getGroupWidth()])}}class Zk extends ht{constructor(){super(...arguments),this.type="heatmap",this.renderType=K.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:i}=n,r=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),c=this.services.cartesianScales.getMainXScale(),l=this.services.cartesianScales.getMainYScale();let u="",h=null,d=null,f=null;this.matrix[i]!==void 0?(u=a,r.forEach(p=>{if(typeof this.matrix[i][p].value=="number"){const m=this.matrix[i][p].value;if(h===null){h=m,d=m,f=m;return}h+=m,d=m<d?m:d,f=m>f?m:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][i].value=="number"){const m=this.matrix[p][i].value;if(h===null){h=m,d=m,f=m;return}h+=m,d=m<d?m:d,f=m>f?m:f}})),c(i)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${c(i)}, ${ln(l.range())})`):l(i)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${ln(c.range())},${l(i)})`),this.services.events.dispatchEvent(C.Tooltip.SHOW,{event:n.event,hoveredElement:P(t.detail.element),items:[{label:u,value:i,bold:!0},{label:"Min",value:d!==null?d:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:h!==null?h/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(C.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(C.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(C.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(C.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(C.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.lower();const{cartesianScales:i}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),E(this.getOptions(),"data","loading"))return;const r=i.getMainXScale(),s=i.getMainYScale(),a=i.getDomainIdentifier(),o=i.getRangeIdentifier(),c=this.model.getUniqueDomain(),l=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),h=r.range(),d=s.range();this.xBandwidth=Math.abs((h[1]-h[0])/c.length),this.yBandwidth=Math.abs((d[1]-d[0])/l.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const p=n.selectAll().data(u).enter().append("g").attr("class",m=>`heat-${m.index}`).classed("cell",!0).attr("transform",m=>`translate(${r(m[a])}, ${s(m[o])})`).append("rect").attr("class",m=>this.model.getColorClassName({value:m.value,originalClassName:`heat-${m.index}`})).classed("heat",!0).classed("null-state",m=>m.index===-1||m.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",m=>m.index===-1||m.value===null?`url(#${f})`:this.model.getFillColor(Number(m.value))).attr("aria-label",m=>m.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(d[1]-d[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(h[1]-h[0]),this.yBandwidth),this.determineDividerStatus()&&(p.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,i){const r=R.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);R.appendOrSelect(r,"line.top").attr("x1",-1).attr("x2",n+1),R.appendOrSelect(r,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",i+1),R.appendOrSelect(r,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",i).attr("y2",i),R.appendOrSelect(r,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",i+1)}determineDividerStatus(){const t=E(this.getOptions(),"heatmap","divider","state");return t!==fr.OFF&&(t===fr.AUTO&&gf.minCellDividerDimension<=this.xBandwidth&&gf.minCellDividerDimension<=this.yBandwidth||t===fr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,i=this.getOptions(),r=St(i,"tooltip.totalLabel"),s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),c=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(l,u){const h=P(this),d=h.select("rect.heat");if(!d.classed("null-state")){const f=Mr(h.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${f.x+t.translationUnits.x}, ${f.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(C.Heatmap.HEATMAP_MOUSEOVER,{event:l,element:d,datum:u}),t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:l,items:[{label:o,value:u[s]},{label:c,value:u[a]},{label:r||"Total",value:u.value,color:d.style("fill")}]})}}).on("mousemove",function(l,u){t.services.events.dispatchEvent(C.Heatmap.HEATMAP_MOUSEMOVE,{event:l,element:P(this),datum:u}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:l})}).on("click",function(l,u){t.services.events.dispatchEvent(C.Heatmap.HEATMAP_CLICK,{event:l,element:P(this),datum:u})}).on("mouseout",function(l,u){const h=P(this).select("rect.heat"),d=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),d||(t.services.events.dispatchEvent(C.Heatmap.HEATMAP_MOUSEOUT,{event:l,element:h,datum:u}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{event:l,hoveredElement:h}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class Kk extends ht{constructor(){super(...arguments),this.type="histogram",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer(),i=this.model.getOptions(),{groupIdentifier:r}=i,{groupMapsTo:s}=i.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),c=n.selectAll("g.bars").data(a,u=>St(u,`0.${s}`));c.exit().attr("opacity",0).remove(),c.enter().append("g").classed("bars",!0).attr("role",at.GROUP);const l=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).attr(r,(u,h)=>h).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s])).attr("d",u=>{const h=St(u,"data");if(!h)return;const d=o(h.x1)-o(h.x0)-1,f=this.services.cartesianScales.getDomainValue(h.x0),p=f+d,m=this.services.cartesianScales.getRangeValue(u[0]);let g=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(g-m)>0&&Math.abs(g-m)>i.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=1:g-=1),Qt({x0:f,x1:p,y0:m,y1:g},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>E(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,i=this;this.parent.selectAll("path.bar").on("mouseover",function(r,s){const a=P(this);a.classed("hovered",!0);const o=parseFloat(St(s,"data.x0")),c=parseFloat(St(s,"data.x1")),l=i.services.cartesianScales.getRangeAxisPosition(),u=i.services.cartesianScales.getScaleLabel(l);i.services.events.dispatchEvent(C.Tooltip.SHOW,{event:r,hoveredElement:a,items:[{label:St(t,"bins.rangeLabel")||"Range",value:`${o} – ${c}`},{label:t.tooltip.groupLabel||"Group",value:s[n],class:i.model.getColorClassName({classNameTypes:[J.TOOLTIP],dataGroupName:s[n]})},{label:u,value:St(s,`data.${s[n]}`)}]})}).on("mousemove",function(r){i.services.events.dispatchEvent(C.Tooltip.MOVE,{event:r})}).on("mouseout",function(){P(this).classed("hovered",!1),i.services.events.dispatchEvent(C.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Qk extends Ue{constructor(){super(...arguments),this.type="lollipop",this.renderType=K.SVG,this.handleScatterOnHover=t=>{const n=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[r]!==n.datum[r]?Je.weight.unselected:Je.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",Je.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[r]!==n.datum().name?Je.opacity.unselected:Je.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",Je.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),i=this.model.getOptions(),{groupMapsTo:r}=i.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),c=s.getDomainIdentifier(),l=g=>s.getDomainValue(g),u=g=>s.getRangeValue(g),h=s.getOrientation(),[d,f]=sn(l,u,h),p=n.selectAll("line.line").data(this.getScatterData(),g=>`${g[r]}-${g[c]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",g=>this.model.getColorClassName({classNameTypes:[J.STROKE],dataGroupName:g[r],originalClassName:"line"})).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"lollipop-line-update-enter",animate:t})).style("stroke",g=>this.model.getFillColor(g[r],g[c],g)).attr("opacity",1);h===Ht.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",g=>d(g)-i.points.radius):m.attr("x1",d).attr("x2",d).attr("y1",o.range()[0]).attr("y2",g=>f(g)+i.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(C.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(C.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(C.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(C.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class Jk extends ht{constructor(){super(...arguments),this.type="meter",this.renderType=K.SVG}getStackedBounds(t,n){let i=0;return t.map((r,s)=>s!==0?(i+=n(r.value),{...r,width:Math.abs(n(r.value)-Gt.dividerWidth),x:i-n(r.value)}):(i=n(r.value),{...r,width:Math.abs(n(r.value)-Gt.dividerWidth),x:0}))}render(t=!0){const n=this,i=this.getComponentContainer(),r=this.getOptions(),s=E(r,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:c}=R.getSVGElementSize(i,{useAttrs:!0}),{groupMapsTo:l}=r.data;let u;E(r,"meter","proportional")===null?u=100:u=E(r,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const h=_e().domain([0,u]).range([0,c]),d=this.getStackedBounds(a,h),f=E(r,"meter","height");R.appendOrSelect(i,"rect.container").attr("x",0).attr("y",0).attr("width",c).attr("height",f||(s?Gt.height.proportional:Gt.height.default)),R.appendOrSelect(i,"line.rangeIndicator").attr("x1",c).attr("x2",c).attr("y1",0).attr("y2",f||(s?Gt.height.proportional:Gt.height.default));const p=i.selectAll("rect.value").data(d),m=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",w=>w.x).attr("y",0).attr("height",()=>f||(s?Gt.height.proportional:Gt.height.default)).attr("class",w=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:w[l],originalClassName:m})).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"meter-bar-update",animate:t})).attr("width",w=>w.value>u?h(u):w.width).style("fill",w=>n.model.getFillColor(w[l])).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",w=>w.value),p.exit().remove();const g=E(r,"meter","peak");let v=g;g!==null&&(g>u?v=u:g<a[0].value&&(v=a[0].value>u?u:a[0].value));const b=i.selectAll("line.peak").data(v==null?[]:[v]);b.enter().append("line").classed("peak",!0).merge(b).attr("y1",0).attr("y2",()=>f||(s?Gt.height.proportional:Gt.height.default)).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"peak-line-update",animate:t})).attr("x1",w=>h(w)).attr("x2",w=>h(w)).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",w=>w),b.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this,r=E(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=P(this);i.services.events.dispatchEvent(C.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),r&&(o.classed("hovered",!0),i.services.events.dispatchEvent(C.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=P(this);i.services.events.dispatchEvent(C.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),r&&i.services.events.dispatchEvent(C.Tooltip.MOVE,{event:s})}).on("click",function(s,a){i.services.events.dispatchEvent(C.Meter.METER_CLICK,{event:s,element:P(this),datum:a})}).on("mouseout",function(s,a){const o=P(this);i.services.events.dispatchEvent(C.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),r&&(o.classed("hovered",!1),i.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class tR extends ht{constructor(){super(...arguments),this.type="radar",this.renderType=K.SVG,this.getLabelDimensions=t=>{const n=R.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),i=R.appendOrSelect(n,"text").text(t),{width:r,height:s}=R.getSVGElementSize(i.node(),{useBBox:!0});return n.remove(),{width:r,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:i,value:r}=E(n,"radar","axes"),s=E(n,"data","groupMapsTo"),a=cD(this.uniqueKeys.map(o=>this.uniqueGroups.map(c=>({[i]:o,[s]:c,[r]:null}))));return nt(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:i,value:r}=E(n,"radar","axes"),s=E(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const c=this.uniqueKeys.map(l=>({[s]:a,[i]:l,[r]:null}));return{name:a,data:nt(c,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-blob"})).style("fill-opacity",i=>i.name!==n.datum().name?Rn.opacity.unselected:Rn.opacity.selected).style("stroke-opacity",i=>i.name!==n.datum().name?Rn.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",Rn.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer(),{width:i,height:r}=R.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),c=E(o,"data","groupMapsTo"),l=E(o,"radar","axes","value"),{angle:u,value:h}=E(o,"radar","axes"),{xLabelPadding:d,yLabelPadding:f,yTicksNumber:p,minRange:m,xAxisRectHeight:g}=Rn;this.uniqueKeys=Array.from(new Set(s.map(x=>x[u]))),this.uniqueGroups=Array.from(new Set(s.map(x=>x[c]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const v=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),b=(Math.min(i,r)-v)/2;if(b<=0)return;const w=er().domain(this.fullDataNormalized.map(x=>x[u])).range([0,2*Math.PI].map(x=>x-Math.PI/2)),O=ln(this.fullDataNormalized.map(x=>x[h])),_=_e().domain([O>=0?0:O,bn(this.fullDataNormalized.map(x=>x[h]))]).range([m,b]).nice(p),T=_.ticks(p),S=x=>this.model.getFillColor(x),$=XE().angle(x=>w(x[u])+Math.PI/2).radius(x=>_(x[h])).curve(_d),D=this.uniqueKeys.map(x=>{const A=this.getLabelDimensions(x).width,y=A$(w(x),b);return A+y}),L={x:bn(D)+d,y:r/2},M=R.appendOrSelect(n,"g.y-axes").attr("role",at.GROUP).selectAll("path").data(T,x=>x),B=x=>this.uniqueKeys.map(A=>({[u]:A,[h]:x}));M.join(x=>x.append("path").attr("opacity",0).attr("transform",`translate(${L.x}, ${L.y})`).attr("fill","none").call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",y=>$(B(y)))),x=>x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${L.x}, ${L.y})`).attr("d",y=>$(B(y)))),x=>x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_axes_exit",animate:t})).attr("d",y=>$(B(y))).attr("opacity",0).remove())),R.appendOrSelect(n,"g.x-axes").attr("role",at.GROUP).selectAll("line").data(this.uniqueKeys,x=>x).join(x=>x.append("line").attr("opacity",0).attr("class",A=>`x-axis-${Si(A)}`).attr("stroke-dasharray","0").attr("x1",A=>kt(w(A),0,L).x).attr("y1",A=>kt(w(A),0,L).y).attr("x2",A=>kt(w(A),0,L).x).attr("y2",A=>kt(w(A),0,L).y).call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",y=>kt(w(y),_.range()[0],L).x).attr("y1",y=>kt(w(y),_.range()[0],L).y).attr("x2",y=>kt(w(y),_.range()[1],L).x).attr("y2",y=>kt(w(y),_.range()[1],L).y)),x=>x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",y=>kt(w(y),_.range()[0],L).x).attr("y1",y=>kt(w(y),_.range()[0],L).y).attr("x2",y=>kt(w(y),_.range()[1],L).x).attr("y2",y=>kt(w(y),_.range()[1],L).y)),x=>x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),R.appendOrSelect(n,"g.x-labels").attr("role",at.GROUP).selectAll("text").data(this.uniqueKeys).join(x=>x.append("text").text(A=>A).attr("opacity",0).attr("x",A=>kt(w(A),_.range()[1]+d,L).x).attr("y",A=>kt(w(A),_.range()[1]+d,L).y).style("text-anchor",A=>jp(w(A)).textAnchor).style("dominant-baseline",A=>jp(w(A)).dominantBaseline).call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),x=>x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",y=>kt(w(y),_.range()[1]+d,L).x).attr("y",y=>kt(w(y),_.range()[1]+d,L).y).end().finally(()=>{const y=E(o,"radar","alignment"),k=this.getAlignmentXOffset(y,n,this.getParent());n.attr("x",k)})),x=>x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),R.appendOrSelect(n,"g.blobs").attr("role",at.GROUP).selectAll("path").data(this.groupedDataNormalized,x=>x.name).join(x=>x.append("path").attr("class",A=>this.model.getColorClassName({classNameTypes:[J.FILL,J.STROKE],dataGroupName:A.name,originalClassName:"blob"})).attr("role",at.GRAPHICS_SYMBOL).attr("aria-label",A=>A.name).attr("opacity",0).attr("transform",t?()=>`translate(${L.x}, ${L.y}) scale(${1+Math.random()*.35})`:`translate(${L.x}, ${L.y})`).style("fill",A=>S(A.name)).style("fill-opacity",Rn.opacity.selected).style("stroke",A=>S(A.name)).call(A=>{const y=A.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_enter",animate:t}));t&&y.delay(()=>Math.random()*30).attr("transform",`translate(${L.x}, ${L.y})`),y.attr("opacity",1).attr("d",k=>$(k.data))}),x=>(x.attr("class",A=>this.model.getColorClassName({classNameTypes:[J.FILL,J.STROKE],dataGroupName:A.name,originalClassName:"blob"})).style("fill",A=>S(A.name)).style("stroke",A=>S(A.name)),x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${L.x}, ${L.y})`).attr("d",y=>$(y.data))),x),x=>x.call(A=>{const y=A.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_exit",animate:t}));t&&y.delay(()=>Math.random()*30).attr("transform",()=>`translate(${L.x}, ${L.y}) scale(${1+Math.random()*.35})`),y.attr("opacity",0).remove()})),R.appendOrSelect(n,"g.dots").attr("role",at.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(x=>E(x,h)!==null)).join(x=>x.append("circle").attr("role",at.GRAPHICS_SYMBOL).attr("aria-label",A=>A[l]),x=>x,x=>x.remove()).attr("class",x=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:x[c],originalClassName:Si(x[u])})).attr("cx",x=>kt(w(x[u]),_(x[h]),L).x).attr("cy",x=>kt(w(x[u]),_(x[h]),L).y).attr("r",0).attr("opacity",0).style("fill",x=>S(x[c])),R.appendOrSelect(n,"g.x-axes-rect").attr("role",at.GROUP).selectAll("rect").data(this.uniqueKeys).join(x=>x.append("rect"),x=>x,x=>x.remove()).attr("x",L.x).attr("y",L.y-g/2).attr("width",_.range()[1]).attr("height",g).style("fill","red").style("fill-opacity",0).attr("transform",x=>`rotate(${Wp(w(x))}, ${L.x}, ${L.y})`),R.appendOrSelect(n,"g.y-labels").attr("role",at.GROUP).selectAll("text").data(ye(T)).join(x=>x.append("text").attr("opacity",0).text(A=>A).attr("x",A=>kt(-Math.PI/2,_(A),L).x+f).attr("y",A=>kt(-Math.PI/2,_(A),L).y).style("text-anchor","start").style("dominant-baseline","middle").call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),x=>x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_labels_update",animate:t})).text(y=>y).attr("opacity",1).attr("x",y=>kt(-Math.PI/2,_(y),L).x+f).attr("y",y=>kt(-Math.PI/2,_(y),L).y)),x=>x.call(A=>A.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,i){const r=R.getSVGElementSize(n,{useBBox:!0}),{width:s}=R.getSVGElementSize(i,{useAttrs:!0});let a=0;return t===It.CENTER?a=Math.floor((s-r.width)/2):t===It.RIGHT&&(a=s-r.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=E(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(i,r){const s=P(this);t.services.events.dispatchEvent(C.Radar.X_AXIS_MOUSEOVER,{event:i,element:s,datum:r});const a=t.parent.select(`.x-axes .x-axis-${Si(r)}`),o=t.parent.selectAll(`.dots circle.${Si(r)}`),c=t.model.getActiveDataGroupNames(),l=t.getOptions(),{groupMapsTo:u}=l.data,h=E(l,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>c.indexOf(f[u])!==-1?1:0).attr("r",Rn.dotsRadius);const d=t.fullDataNormalized.filter(f=>f[n]===r&&c.indexOf(f[u])!==-1);t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:i,hoveredElement:s,items:d.filter(f=>typeof f[h]=="number").map(f=>({label:f[u],value:f[h],color:t.model.getFillColor(f[u]),class:t.model.getColorClassName({classNameTypes:[J.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(i,r){const s=P(this);t.services.events.dispatchEvent(C.Radar.X_AXIS_MOUSEMOVE,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(C.Radar.X_AXIS_CLICK,{event:i,element:P(this),datum:r})}).on("mouseout",function(i,r){const s=P(this),a=t.parent.select(`.x-axes .x-axis-${Si(r)}`),o=t.parent.selectAll(`.dots circle.${Si(r)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(C.Radar.X_AXIS_MOUSEOUT,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(C.Tooltip.HIDE)})}}class Qg extends vc{constructor(){super(...arguments),this.type="simple-bar",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-simple-bar"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:i}=n.data,r=this.getComponentContainer({withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=r.selectAll("path.bar").data(s,c=>c[i]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i])).attr("d",c=>{const l=this.services.cartesianScales.getRangeIdentifier(),u=this.getBarWidth(),h=c[l],d=this.services.cartesianScales.getDomainValue(c)-u/2,f=d+u;let p,m;if(Array.isArray(h)&&h.length===2)p=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const v=this.services.cartesianScales.getRangeScale().domain()[0];p=this.services.cartesianScales.getRangeValue(Math.max(0,v)),m=this.services.cartesianScales.getRangeValue(c)}const g=Math.abs(m-p);if(g!==0&&g<2&&(h>0&&a===Ht.VERTICAL||h<0&&a===Ht.HORIZONTAL?m=p-2:m=p+2),!this.isOutsideZoomedDomain(d,f))return Qt({x0:d,x1:f,y0:p,y1:m},a)}).attr("opacity",1).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,i){const r=P(this);r.classed("hovered",!0),t.services.events.dispatchEvent(C.Bar.BAR_MOUSEOVER,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:n,hoveredElement:r,data:[i]})}).on("mousemove",function(n,i){t.services.events.dispatchEvent(C.Bar.BAR_MOUSEMOVE,{event:n,element:P(this),datum:i}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(C.Bar.BAR_CLICK,{event:n,element:P(this),datum:i})}).on("mouseout",function(n,i){const r=P(this);r.classed("hovered",!1),t.services.events.dispatchEvent(C.Bar.BAR_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:r})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class eR extends Jt{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=E(this.getOptions(),"data","loading"),i=!E(this.getOptions(),"grid","x","enabled")&&!E(this.getOptions(),"grid","y","enabled")&&!E(this.getOptions(),"axes","bottom","visible")&&!E(this.getOptions(),"axes","left","visible");n&&!i?super.renderGridSkeleton(n):n&&i?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),i=[100],r=R.appendOrSelect(this.backdrop,"g.y.skeleton"),s=r.selectAll("line").data(i);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),r.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=R.appendOrSelect(t,"svg.chart-skeleton.DAII"),R.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Jg extends ht{constructor(){super(...arguments),this.type="area-stacked",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,i=this.getOptions(),{groupMapsTo:r}=i.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>E(s,0,r)!==n.datum().name?Qe.opacity.unselected:Qe.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",Qe.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),i=this,r=this.getOptions(),{groupMapsTo:s}=r.data,a=Object.keys(r.axes).some(f=>r.axes[f].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),c=E(o,0,0),l=this.services.cartesianScales.getDomainAxisPosition({datum:c}),u=this.services.cartesianScales.getRangeAxisPosition({datum:c}),h=this.services.cartesianScales.getScaleByPosition(u),d=n.selectAll("path.area").data(o,f=>E(f,0,s));this.areaGenerator=rl().x(f=>this.services.cartesianScales.getValueThroughAxisPosition(l,f.data.sharedStackKey)).y0(f=>h(f[0])).y1(f=>h(f[1])).curve(this.services.curves.getD3Curve()),d.exit().attr("opacity",0).remove(),d.enter().append("path").attr("opacity",0).merge(d).data(o,f=>E(f,0,s)).attr("class","area").attr("class",f=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:E(f,0,s),originalClassName:"area"})).style("fill",f=>i.model.getFillColor(E(f,0,s))).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",f=>E(f,0,s)).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"area-update-enter",animate:t})).attr("opacity",Qe.opacity.selected).attr("d",this.areaGenerator)}}class tm extends vc{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-bar"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:r}=i.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,l=>E(l,0,r));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",at.GROUP).attr("data-name","bars");const c=n.selectAll("g.bars").selectAll("path.bar").data(l=>l,l=>l.data.sharedStackKey);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"bar-update-enter",animate:t})).attr("class",l=>this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:l[r],originalClassName:"bar"})).style("fill",l=>this.model.getFillColor(l[r])).attr("d",l=>{const u=l.data.sharedStackKey,h=this.getBarWidth(),d=this.services.cartesianScales.getDomainValue(u)-h/2,f=d+h,p=this.services.cartesianScales.getRangeValue(l[0]);let m=this.services.cartesianScales.getRangeValue(l[1]);if(!this.isOutsideZoomedDomain(d,f)){if(Math.abs(m-p)>0&&Math.abs(m-p)>i.bars.dividerSize){const g=l[0]<0&&l[1]<=0;g&&a.length>1?this.services.cartesianScales.getOrientation()===Ht.VERTICAL?m+=l[1]===0?2:1:m-=1:g||(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?m+=1:m-=1)}return Qt({x0:d,x1:f,y0:p,y1:m},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",at.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",l=>l[1]-l[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this;this.parent.selectAll("path.bar").on("mouseover",function(r,s){const a=P(this);a.classed("hovered",!0),i.services.events.dispatchEvent(C.Bar.BAR_MOUSEOVER,{event:r,element:a,datum:s});let o=i.model.getDisplayData(i.configs.groups).find(c=>{const l=i.services.cartesianScales.getDomainIdentifier(c),u=i.services.cartesianScales.getRangeIdentifier(c);return c[u]===s.data[s[n]]&&c[l].toString()===s.data.sharedStackKey&&c[n]===s[n]});if(o===void 0){const c=i.services.cartesianScales.getDomainIdentifier(),l=i.services.cartesianScales.getRangeIdentifier();o={[c]:s.data.sharedStackKey,[l]:s.data[s[n]],[n]:s[n]}}i.services.events.dispatchEvent(C.Tooltip.SHOW,{event:r,hoveredElement:a,data:[o]})}).on("mousemove",function(r,s){const a=P(this);i.services.events.dispatchEvent(C.Bar.BAR_MOUSEMOVE,{event:r,element:a,datum:s}),i.services.events.dispatchEvent(C.Tooltip.MOVE,{event:r})}).on("click",function(r,s){i.services.events.dispatchEvent(C.Bar.BAR_CLICK,{event:r,element:P(this),datum:s})}).on("mouseout",function(r,s){const a=P(this);a.classed("hovered",!1),i.services.events.dispatchEvent(C.Bar.BAR_MOUSEOUT,{event:r,element:a,datum:s}),i.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(E(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),i=R.getSVGElementSize(this.parent,{useAttrs:!0}).width,r=this.model.getStackKeys().length,s=E(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,i*s/r)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class em extends Ue{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=K.SVG}render(t){if(!E(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:r}=i.data,s=Object.keys(i.axes).some(u=>i.axes[u].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=n.selectAll("g.dots").data(a,u=>E(u,0,r));o.exit().attr("opacity",0).remove();const c=o.enter().append("g").classed("dots",!0).attr("role",at.GROUP).merge(o).selectAll("circle.dot").data(u=>u);c.exit().attr("opacity",0).remove();const l=c.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(c).datum(u=>{const h=u[r],d=this.services.cartesianScales.getDomainIdentifier(u),f=this.services.cartesianScales.getRangeIdentifier(u);return{[r]:h,[d]:u.data.sharedStackKey,[f]:u[1]}});this.styleCircles(l,t),this.addEventListeners()}getTooltipData(t,n){const i=this.getOptions(),{groupMapsTo:r}=i.data,s=Object.keys(i.axes).some(c=>i.axes[c].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((c,l)=>{c.forEach((u,h)=>{const d=u[r],f=u.data.sharedStackKey;let p=u.data[d];const m=u[1],g=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(m)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[l][h].data[d]),p!==null&&o.push({[r]:d,[g]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(c=>{const l=this.services.cartesianScales.getDomainIdentifier(c),u=this.services.cartesianScales.getRangeIdentifier(c);return o.find(h=>h[r]==c[r]&&h[l]==c[l]&&h[u]==c[u])!==void 0})}}const Ai=6;class nR extends ht{constructor(){super(...arguments),this.type="tree",this.renderType=K.SVG}getLongestLabel(t){let n="";return t.forEach(i=>{const r=i.children?this.getLongestLabel(i.children):"";(r.length>n.length||i.name.length>n.length)&&(n=r.length>i.name.length?r:i.name)}),n}getMockLabelWidth(t,n){const i=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:r}=R.getSVGElementSize(i.node(),{useBBox:!0});return i.remove(),r}render(t=!0){const n=this.getComponentContainer();n.html("");const{width:i,height:r}=R.getSVGElementSize(this.parent,{useAttrs:!0});if(i<1||r<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=E(s,"tree","rootTitle")||"Tree",c=this.getMockLabelWidth(n,o),l=this.getLongestLabel(a),u=this.getMockLabelWidth(n,l),h={top:0,right:0,bottom:0,left:c>0?c+Ai:30-Ai},d=Qi({name:o,children:a}),f=10,p=i/6,m=T=>{const S=d.descendants().reverse(),$=d.links();let D=d,L=d;d.eachBefore(U=>{U.x<D.x&&(D=U),U.x>L.x&&(L=U)});const M=L.x-D.x,B=n.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-h.left,D.x,i,M].join(" ")),x=_.selectAll("g").data(S,U=>U.id),A=this,y=x.enter().append("g").attr("transform",()=>`translate(${T.y0},${T.x0})`).attr("class",U=>U.depth!==0&&U.children&&U.children.length>0?"clickable":null).on("mouseover",function(U,N){A.services.events.dispatchEvent(C.Tree.NODE_MOUSEOVER,{event:U,element:P(this),datum:N})}).on("click",function(U,N){N.depth!==0&&(N.children=N.children?null:N._children,m(N)),A.services.events.dispatchEvent(C.Tree.NODE_CLICK,{event:U,element:P(this),datum:N})}).on("mouseout",function(U,N){A.services.events.dispatchEvent(C.Tree.NODE_MOUSEOUT,{event:U,element:P(this),datum:N})});y.append("circle").attr("r",2.5).attr("class",U=>U._children?"parent":"child").attr("stroke-width",10),y.append("text").attr("dy","0.31em").attr("x",U=>U._children?-Ai:Ai).attr("text-anchor",U=>U._children?"end":"start").text(U=>U.data.name).clone(!0).attr("class","text-stroke").lower(),x.merge(y).transition(B).attr("transform",U=>`translate(${U.y},${U.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),x.exit().transition(B).remove().attr("transform",()=>`translate(${T.y},${T.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const k=O.selectAll("path").data($,U=>U.target.id),I=k.enter().append("path").attr("d",()=>{const U={x:T.x0,y:T.y0};return w({source:U,target:U})});k.merge(I).transition(B).attr("d",w),k.exit().transition(B).remove().attr("d",()=>{const U={x:T.x,y:T.y};return w({source:U,target:U})}),d.eachBefore(U=>{U.x0=U.x,U.y0=U.y})},g=d.descendants(),v=g[g.length-1].depth,b=E(s,"tree","type")===hl.DENDROGRAM?mb().size([r,i-u-v*Ai-c]):iw().nodeSize([f,p]).size([r,i-u-v*Ai-c]),w=e_().x(T=>T.y).y(T=>T.x);d.x0=p/2,d.y0=0,d.descendants().forEach((T,S)=>{T.id=S,T._children=T.children}),b(d),n.attr("viewBox",[-h.left,-h.top,i,f]).style("user-select","none");const O=n.append("g").attr("class","links"),_=n.append("g").attr("class","nodes");m(d)}}var iR="#000000",rR="#ffffff",sR="#fcf4d6",aR="#fddc69",oR="#f1c21b",lR="#d2a106",cR="#b28600",uR="#8e6a00",hR="#684e00",dR="#483700",fR="#302400",pR="#1c1500",gR={10:sR,20:aR,30:oR,40:lR,50:cR,60:uR,70:hR,80:dR,90:fR,100:pR},mR="#fff2e8",vR="#ffd9be",yR="#ffb784",xR="#ff832b",bR="#eb6200",wR="#ba4e00",ER="#8a3800",_R="#5e2900",SR="#3e1a00",OR="#231000",TR={10:mR,20:vR,30:yR,40:xR,50:bR,60:wR,70:ER,80:_R,90:SR,100:OR},MR="#fff1f1",CR="#ffd7d9",AR="#ffb3b8",$R="#ff8389",LR="#fa4d56",DR="#da1e28",kR="#a2191f",RR="#750e13",IR="#520408",PR="#2d0709",NR={10:MR,20:CR,30:AR,40:$R,50:LR,60:DR,70:kR,80:RR,90:IR,100:PR},UR="#fff0f7",BR="#ffd6e8",HR="#ffafd2",VR="#ff7eb6",GR="#ee5396",FR="#d02670",zR="#9f1853",jR="#740937",WR="#510224",qR="#2a0a18",YR={10:UR,20:BR,30:HR,40:VR,50:GR,60:FR,70:zR,80:jR,90:WR,100:qR},XR="#f6f2ff",ZR="#e8daff",KR="#d4bbff",QR="#be95ff",JR="#a56eff",tI="#8a3ffc",eI="#6929c4",nI="#491d8b",iI="#31135e",rI="#1c0f30",sI={10:XR,20:ZR,30:KR,40:QR,50:JR,60:tI,70:eI,80:nI,90:iI,100:rI},aI="#edf5ff",oI="#d0e2ff",lI="#a6c8ff",cI="#78a9ff",uI="#4589ff",hI="#0f62fe",dI="#0043ce",fI="#002d9c",pI="#001d6c",gI="#001141",mI={10:aI,20:oI,30:lI,40:cI,50:uI,60:hI,70:dI,80:fI,90:pI,100:gI},vI="#e5f6ff",yI="#bae6ff",xI="#82cfff",bI="#33b1ff",wI="#1192e8",EI="#0072c3",_I="#00539a",SI="#003a6d",OI="#012749",TI="#061727",MI={10:vI,20:yI,30:xI,40:bI,50:wI,60:EI,70:_I,80:SI,90:OI,100:TI},CI="#d9fbfb",AI="#9ef0f0",$I="#3ddbd9",LI="#08bdba",DI="#009d9a",kI="#007d79",RI="#005d5d",II="#004144",PI="#022b30",NI="#081a1c",UI={10:CI,20:AI,30:$I,40:LI,50:DI,60:kI,70:RI,80:II,90:PI,100:NI},BI="#defbe6",HI="#a7f0ba",VI="#6fdc8c",GI="#42be65",FI="#24a148",zI="#198038",jI="#0e6027",WI="#044317",qI="#022d0d",YI="#071908",XI={10:BI,20:HI,30:VI,40:GI,50:FI,60:zI,70:jI,80:WI,90:qI,100:YI},ZI="#f2f4f8",KI="#dde1e6",QI="#c1c7cd",JI="#a2a9b0",tP="#878d96",eP="#697077",nP="#4d5358",iP="#343a3f",rP="#21272a",sP="#121619",aP={10:ZI,20:KI,30:QI,40:JI,50:tP,60:eP,70:nP,80:iP,90:rP,100:sP},oP="#f4f4f4",lP="#e0e0e0",cP="#c6c6c6",uP="#a8a8a8",hP="#8d8d8d",dP="#6f6f6f",fP="#525252",pP="#393939",gP="#262626",mP="#161616",vP={10:oP,20:lP,30:cP,40:uP,50:hP,60:dP,70:fP,80:pP,90:gP,100:mP},yP="#f7f3f2",xP="#e5e0df",bP="#cac5c4",wP="#ada8a8",EP="#8f8b8b",_P="#726e6e",SP="#565151",OP="#3c3838",TP="#272525",MP="#171414",CP={10:yP,20:xP,30:bP,40:wP,50:EP,60:_P,70:SP,80:OP,90:TP,100:MP},nm={black:{100:iR},blue:mI,coolGray:aP,cyan:MI,gray:vP,green:XI,magenta:YR,orange:TR,purple:sI,red:NR,teal:UI,warmGray:CP,white:{0:rR},yellow:gR};const AP=e=>{if(!e)return null;for(const t of Object.keys(nm)){const n=nm[t];for(const i of Object.keys(n))if(n[+i]===e)return i}return null},im=function(){const e=P(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=He(t);let i;if(n&&(i=AP(n?n.hex():null)),i==null){const r=qa(n).l;i=Math.abs(r*100-100)}return i>50?"white":"black"};let $P=0;class LP extends ht{constructor(){super(...arguments),this.type="treemap",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-treemap"})).attr("opacity",i=>i.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer();this.model.getData();const i=this.model.getDisplayData(),r=this.model.getOptions(),s=E(window,"location"),{width:a,height:o}=R.getSVGElementSize(n,{useAttrs:!0}),c=Qi({name:r.title||"Treemap",children:i}).sum(f=>f.value).sort((f,p)=>p.value-f.value),l=lw().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(c),u=n.selectAll("g[data-name='leaf']").data(l.leaves(),f=>f.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>$P++).merge(u);h.attr("data-name","leaf").transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-group-update",animate:t})).attr("transform",f=>`translate(${f.x0},${f.y0})`);const d=h.selectAll("rect.leaf").data(f=>[f]);d.exit().attr("width",0).attr("height",0).remove(),d.enter().append("rect").classed("leaf",!0).merge(d).attr("width",0).attr("height",0).attr("id",function(){const f=P(this.parentNode).attr("data-uid");return`${r.style.prefix}-leaf-${f}`}).attr("class",f=>{for(;f.depth>1;)f=f.parent;return this.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:f.data.name,originalClassName:"leaf"})}).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-leaf-update-enter",animate:t})).attr("width",f=>f.x1-f.x0).attr("height",f=>f.y1-f.y0).style("fill",f=>{for(;f.depth>1;)f=f.parent;return this.model.getFillColor(f.data.name)}),h.selectAll("clipPath").data(f=>f.data.showLabel!==!0?[]:[1],f=>f).join(f=>f.append("clipPath").attr("id",function(){const p=P(this.parentNode).attr("data-uid");return`${r.style.prefix}-clip-${p}`}).append("use").attr("xlink:href",function(){const p=P(this.parentNode.parentNode).attr("data-uid"),m=`${r.style.prefix}-leaf-${p}`;return new URL(`#${m}`,s)+""}),f=>null,f=>f.remove()),h.selectAll("text").data(f=>{if(f.data.showLabel!==!0)return[];let p=f;for(;p.depth>1;)p=p.parent;const m=qa(this.model.getFillColor(p.data.name));return[{text:f.data.name,color:m.l<.5?"white":"black"}]},f=>f).join(f=>{const p=f.append("text").text(m=>m.text).style("fill",im).attr("x",7).attr("y",18);return s&&p.attr("clip-path",function(){const m=P(this.parentNode).attr("data-uid"),g=`${r.style.prefix}-clip-${m}`;return`url(${new URL(`#${g}`,s)+""})`}),p},f=>f.text(p=>p.text).style("fill",im),f=>f.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,i){const r=P(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=i;for(;a.depth>1;)a=a.parent;r.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const c=t.model.getFillColor(o.parent.data.name);return c&&(s=c),He(s).darker(.7).toString()}),t.services.events.dispatchEvent(C.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{color:s,label:a.data.name,bold:!0},{label:i.data.name,value:i.data.value}]}),t.services.events.dispatchEvent(C.Treemap.LEAF_MOUSEOVER,{event:n,element:r,datum:i})}).on("mousemove",function(n,i){const r=P(this);t.services.events.dispatchEvent(C.Treemap.LEAF_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(C.Treemap.LEAF_CLICK,{event:n,element:P(this),datum:i})}).on("mouseout",function(n,i){const r=P(this);r.classed("hovered",!1);let s=i;for(;s.depth>1;)s=s.parent;r.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name)),t.services.events.dispatchEvent(C.Treemap.LEAF_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:r})})}}class DP extends ht{constructor(){super(...arguments),this.type="wordcloud",this.renderType=K.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-wordcloud"})).attr("opacity",r=>r[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(C.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(C.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,i=this.getComponentContainer().attr("width","100%").attr("height","100%"),r=this.model.getDisplayData(),s=this.getFontSizeScale(r),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:c}=a.wordCloud,{groupMapsTo:l}=a.data,{width:u,height:h}=R.getSVGElementSize(i,{useAttrs:!0});if(u===0||h===0)return;const d=gL().size([u,h]).words(r.map(function(p){const m=p[o];if(typeof p[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[l]:p[l],text:p[c],size:m,value:m}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);d.start();function f(p){const m=R.appendOrSelect(i,"g.words");m.attr("transform",`translate(${d.size()[0]/2}, ${d.size()[1]/2})`);const g=m.selectAll("text").data(p,v=>`${v[l]}-${v.text}`);g.exit().attr("opacity",0).remove(),g.enter().append("text").attr("opacity",0).merge(g).style("font-size",v=>`${v.size}px`).text(function(v){return v.text}).attr("class",v=>n.model.getColorClassName({classNameTypes:[J.FILL],dataGroupName:v[l],originalClassName:`word ${v.size>32?"light":""}`})).style("fill",v=>n.model.getFillColor(v[l],v.text,v)).attr("text-anchor","middle").transition().call(v=>n.services.transitions.setupTransition({transition:v,name:"wordcloud-text-update-enter",animate:t})).attr("transform",v=>`translate(${v.x}, ${v.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:i}=n.wordCloud,r=t.map(c=>c[i]).filter(c=>c),s=R.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=r.length>0,o=a?ye(r):[1,1];return _e().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this,r=va(s=>{const a=i.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>i.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;r(o),i.services.events.dispatchEvent(C.WordCloud.WORD_MOUSEOVER,{event:s,element:P(this),datum:a}),i.services.events.dispatchEvent(C.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:t.tooltip.groupLabel,value:a[n],class:i.model.getColorClassName({classNameTypes:[J.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=P(this);i.services.events.dispatchEvent(C.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),i.services.events.dispatchEvent(C.Tooltip.MOVE,{event:s})}).on("click",function(s,a){i.services.events.dispatchEvent(C.WordCloud.WORD_CLICK,{event:s,element:P(this),datum:a})}).on("mouseout",function(s,a){const o=P(this);r(null),i.services.events.dispatchEvent(C.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),i.services.events.dispatchEvent(C.Tooltip.HIDE,{hoveredElement:o})})}}class kP extends ht{constructor(){super(...arguments),this.type="geo",this.renderType=K.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:i}=R.getSVGElementSize(t,{useAttrs:!0});if(n<1||i<1)return;const r=this.getProjection(),s=E(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},c={};Object.keys(a).forEach(g=>{typeof a[g].value=="number"?o[g]=a[g]:c[g]=a[g]});const l=Gk(s,Object.values(c)),u=Bk(s,{type:"GeometryCollection",geometries:Object.values(o)}),h=r.fitSize([n,i],u),d=Gx().projection(h);R.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",d);const f=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),p=R.appendOrSelect(t,"defs");R.appendOrSelect(p,"pattern").attr("id",f).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",lr()([[0,0],[0,10]]));const m=R.appendOrSelect(t,"g.missing-data");R.appendOrSelect(m,"path").datum(l).attr("d",d).style("fill",`url(#${f})`)}getProjection(){let t=null;switch(E(this.getOptions(),"thematic","projection")){case Ke.geoEqualEarth:t=ob();break;case Ke.geoAlbers:t=tb();break;case Ke.geoConicEqualArea:t=Sh();break;case Ke.geoConicEquidistant:t=sb();break;case Ke.geoEquirectangular:t=ib();break;case Ke.geoMercator:t=eb();break;case Ke.geoNaturalEarth1:t=lb();break;default:throw new Error("Projection is not supported.")}return t}}class RP extends kP{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",i=>this.model.getColorClassName({value:n[i.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(i,r){const s=P(this);t.services.events.dispatchEvent(ui.CHOROPLETH_MOUSEOVER,{event:i,element:s,datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(ur.SHOW,{event:i,hoveredElement:s,items:[{label:r.properties.NAME,value:n[r.properties.NAME].value}]})}).on("mousemove",function(i,r){t.services.events.dispatchEvent(ui.CHOROPLETH_MOUSEMOVE,{event:i,element:P(this),datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(ur.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(ui.CHOROPLETH_CLICK,{event:i,element:P(this),datum:n[r.properties.NAME]})}).on("mouseout",function(i,r){const s=P(this);t.services.events.dispatchEvent(ui.CHOROPLETH_MOUSEOUT,{event:i,element:s,datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(ur.HIDE,{event:i,hoveredElement:s})})}}function rm(e,t){st(2,arguments);var n=ft(e),i=Ut(t);return isNaN(i)?new Date(NaN):(i&&n.setDate(n.getDate()+i),n)}function yc(e,t){st(2,arguments);var n=ft(e),i=Ut(t);if(isNaN(i))return new Date(NaN);if(!i)return n;var r=n.getDate(),s=new Date(n.getTime());s.setMonth(n.getMonth()+i+1,0);var a=s.getDate();return r>=a?s:(n.setFullYear(s.getFullYear(),s.getMonth(),r),n)}var IP=36e5;function sm(e,t){st(2,arguments);var n=Ut(t);return Zs(e,n*IP)}function am(e){st(1,arguments);var t=ft(e);return t.setHours(0,0,0,0),t}var PP=864e5;function NP(e,t){st(2,arguments);var n=am(e),i=am(t),r=n.getTime()-gl(n),s=i.getTime()-gl(i);return Math.round((r-s)/PP)}var UP=6e4;function xc(e,t){st(2,arguments);var n=Ut(t);return Zs(e,n*UP)}function bc(e,t){st(2,arguments);var n=Ut(t);return Zs(e,n*1e3)}function om(e,t){st(2,arguments);var n=Ut(t);return yc(e,n*12)}function Pr(e,t){st(2,arguments);var n=ft(e),i=ft(t),r=n.getTime()-i.getTime();return r<0?-1:r>0?1:r}var BP=6e4,HP=36e5;function VP(e,t){st(2,arguments);var n=ft(e),i=ft(t),r=n.getFullYear()-i.getFullYear(),s=n.getMonth()-i.getMonth();return r*12+s}function GP(e,t){st(2,arguments);var n=ft(e),i=ft(t);return n.getFullYear()-i.getFullYear()}function lm(e,t){var n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function FP(e,t){st(2,arguments);var n=ft(e),i=ft(t),r=lm(n,i),s=Math.abs(NP(n,i));n.setDate(n.getDate()-r*s);var a=+(lm(n,i)===-r),o=r*(s-a);return o===0?0:o}function wc(e,t){return st(2,arguments),ft(e).getTime()-ft(t).getTime()}var cm={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},zP="trunc";function Ec(e){return e?cm[e]:cm[zP]}function jP(e,t,n){st(2,arguments);var i=wc(e,t)/HP;return Ec(n==null?void 0:n.roundingMethod)(i)}function um(e,t,n){st(2,arguments);var i=wc(e,t)/BP;return Ec(n==null?void 0:n.roundingMethod)(i)}function WP(e){st(1,arguments);var t=ft(e);return t.setHours(23,59,59,999),t}function qP(e){st(1,arguments);var t=ft(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function YP(e){st(1,arguments);var t=ft(e);return WP(t).getTime()===qP(t).getTime()}function XP(e,t){st(2,arguments);var n=ft(e),i=ft(t),r=Pr(n,i),s=Math.abs(VP(n,i)),a;if(s<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-r*s);var o=Pr(n,i)===-r;YP(ft(e))&&s===1&&Pr(e,i)===1&&(o=!1),a=r*(s-Number(o))}return a===0?0:a}function hm(e,t,n){st(2,arguments);var i=wc(e,t)/1e3;return Ec(n==null?void 0:n.roundingMethod)(i)}function ZP(e,t){st(2,arguments);var n=ft(e),i=ft(t),r=Pr(n,i),s=Math.abs(GP(n,i));n.setFullYear(1584),i.setFullYear(1584);var a=Pr(n,i)===-r,o=r*(s-Number(a));return o===0?0:o}function KP(e,t){st(2,arguments);var n=Ut(t);return rm(e,-n)}function QP(e,t){st(2,arguments);var n=Ut(t);return yc(e,-n)}function JP(e,t){st(2,arguments);var n=Ut(t);return sm(e,-n)}function dm(e,t){st(2,arguments);var n=Ut(t);return xc(e,-n)}function fm(e,t){st(2,arguments);var n=Ut(t);return bc(e,-n)}function tN(e,t){st(2,arguments);var n=Ut(t);return om(e,-n)}function pm(e){var t=e==null?0:e.length;return t?la(e,1):[]}class eN extends an{zoomIn(t,n,i){let r,s,a;const o=i||gi;t&&(r=t.x,s=t.y,a=2);const{width:c,height:l}=R.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${c/2}, ${l/2}) scale(${a}) translate(${-r},${-s})`),this.services.events.dispatchEvent(C.CanvasZoom.CANVAS_ZOOM_IN,{element:P(t)})}zoomOut(t,n){const i=n||gi;t.transition().duration(i.duration).ease(i.ease).attr("transform",""),this.services.events.dispatchEvent(C.CanvasZoom.CANVAS_ZOOM_OUT)}}class nN extends an{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,n){this.documentFragment.addEventListener(t,n)}removeEventListener(t,n){this.documentFragment.removeEventListener(t,n)}dispatchEvent(t,n){let i;n?i=new CustomEvent(t,{detail:n}):(i=document.createEvent("Event"),i.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(i)}}class iN extends an{constructor(t,n){super(t,n)}downloadCSV(t,n){const i=document.createElement("a"),r="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:r}),n);else if(URL&&"download"in i){const s=URL.createObjectURL(new Blob([t],{type:r}));i.href=s,i.setAttribute("download",n),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const i=document.createElement("a");i.download=n,i.href=t,document.body.appendChild(i),i.click(),document.body.removeChild(i)}}class rN extends an{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(C.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:i}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||i===!1?t.duration(0):t.duration(E(vf,n,"duration")||vf.default.duration)}getPendingTransitions(){return this.pendingTransitions}}let sN=class extends an{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:i}=n.data,r=E(n,"axes",this.secondaryDomainAxisPosition),s=t[i];if(r!=null&&r.correspondingDatasets&&r.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const i=this.model.getOptions(),{groupMapsTo:r}=i.data,s=E(i,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[r]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return E(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){return this.getAxisOptions(t).title||(t===H.BOTTOM||t===H.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(H).map(t=>H[t]).forEach(t=>{this.scales[t]=this.createScale(t)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),i=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=i.primaryDomainAxisPosition,this.rangeAxisPosition=i.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=i.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=i.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===H.LEFT||this.rangeAxisPosition===H.RIGHT)&&(this.domainAxisPosition===H.BOTTOM||this.domainAxisPosition===H.TOP)?this.orientation=Ht.VERTICAL:this.orientation=Ht.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,i,r;const s=this.model.getOptions(),a=E(s,"axes");((t=a[H.LEFT])!=null&&t.correspondingDatasets&&a[H.RIGHT]||(n=a[H.RIGHT])!=null&&n.correspondingDatasets&&a[H.LEFT]||(i=a[H.TOP])!=null&&i.correspondingDatasets&&a[H.BOTTOM]||(r=a[H.BOTTOM])!=null&&r.correspondingDatasets&&a[H.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=E(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===Z.LINEAR||this.scaleTypes[t]===Z.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[H.BOTTOM,H.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[H.LEFT,H.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,i,r){const s=this.model.getOptions(),a=E(s,"axes")[i],{mapsTo:o}=a,c=E(r,o)!==null?r[o]:r;let l;switch(n){case Z.LABELS:l=t(c)+t.step()/2;break;case Z.TIME:l=t(new Date(c));break;default:l=t(c)}return l}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),i=this.getRangeAxisPosition({datum:t}),r=this.scales[i],s=this.model.getOptions(),a=E(s,"axes")[i],{mapsTo:o}=a,c=t[o]!==void 0?t[o]:t;return[r(E(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:c),r(E(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:c)]}getValueThroughAxisPosition(t,n){const i=this.scaleTypes[t],r=this.scales[t];return this.getValueFromScale(r,i,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return E(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return E(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const i=this.model.getOptions(),r=E(i,"axes",t);if(r.scaleType===Z.TIME){const s=E(i,"timeScale","addSpaceOnEdges");return aN(n,s)}else return oN(n,fn.paddingRatio,r.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=E(t,"axes"),i=this.isDualAxes();return E(n,H.LEFT)===null&&E(n,H.RIGHT)!==null||E(n,H.RIGHT,"main")===!0||i&&E(n,H.LEFT,"correspondingDatasets")?{primary:H.RIGHT,secondary:H.LEFT}:{primary:H.LEFT,secondary:H.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=E(t,"axes"),i=this.isDualAxes();return E(n,H.BOTTOM)===null&&E(n,H.TOP)!==null||E(n,H.TOP,"main")===!0||i&&E(n,H.BOTTOM,"correspondingDatasets")?{primary:H.TOP,secondary:H.BOTTOM}:{primary:H.BOTTOM,secondary:H.TOP}}findDomainAndRangeAxesPositions(t,n){const i=this.model.getOptions(),r=E(i,"axes",t.primary),s=E(i,"axes",n.primary),a=r.scaleType||Z.LINEAR,o=s.scaleType||Z.LINEAR,c={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return c.primaryDomainAxisPosition=n.primary,c.primaryRangeAxisPosition=t.primary,c.secondaryDomainAxisPosition=n.secondary,c.secondaryRangeAxisPosition=t.secondary,(!(o===Z.LABELS||o===Z.TIME)&&a===Z.LABELS||a===Z.TIME)&&(c.primaryDomainAxisPosition=t.primary,c.primaryRangeAxisPosition=n.primary,c.secondaryDomainAxisPosition=t.secondary,c.secondaryRangeAxisPosition=n.secondary),c}getScaleDomain(t){const n=this.model.getOptions(),i=E(n,"axes",t),r=E(n,"bounds"),{includeZero:s}=i,a=E(i,"scaleType")||Z.LINEAR;if(this.model.isDataEmpty())return[];if(i.binned){const{bins:v}=this.model.getBinConfigurations();return[0,bn(v,b=>b.length)]}else if(i.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),b=this.model.getStackKeys({bins:v});return[b[0].split("-")[0],b[b.length-1].split("-")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:c,mapsTo:l,percentage:u,thresholds:h}=i,{reference:d,compareTo:f}=fn.ratio;if(i.domain)return a===Z.LABELS?i.domain:(a===Z.TIME&&(i.domain=i.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,i.domain));if(u)return[0,100];if(i&&a===Z.LABELS)return Tr(o.map(v=>v[l]));let p,m;const g=this.model.getDataGroupNames();if(a===Z.LABELS_RATIO)return o.map(v=>`${v[d]}/${v[f]}`);if(a===Z.TIME)m=o.map(v=>+new Date(v[l]));else if(r&&n.axes)m=[],o.forEach(v=>{m.push(v[l]),v[r.upperBoundMapsTo]&&m.push(v[r.upperBoundMapsTo]),v[r.lowerBoundMapsTo]&&m.push(v[r.lowerBoundMapsTo])});else if(i.stacked===!0&&g&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,b=this.model.getDataValuesGroupedByKeys({groups:g}),w=o.filter(_=>!g.includes(_[v])),O=[];b.forEach(_=>{const{...T}=_;let S=0,$=0;Object.values(T).forEach(D=>{isNaN(D)||(D<0?$+=D:S+=D)}),O.push([$,S])}),m=[...pm(O),...w.map(_=>_[l])]}else m=[],o.forEach(v=>{const b=v[l];Array.isArray(b)&&b.length===2?(m.push(b[0]),m.push(b[1])):(c&&m.push(Math.max(v[l],v[c])),m.push(b))});return a!==Z.TIME&&a!==Z.LOG&&s&&m.push(0),h&&h.length>0&&h.forEach(v=>{const b=E(v,"value");b!==null&&m.push(b)}),p=ye(m),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),i=E(n,"axes",t);if(!i)return null;const r=E(i,"scaleType")||Z.LINEAR;this.scaleTypes[t]=r;let s;return r===Z.TIME?s=ud():r===Z.LOG?s=jh().base(i.base||10):r===Z.LABELS||r===Z.LABELS_RATIO?s=er():s=_e(),s.domain(this.getScaleDomain(t)),s}getHighestDomainThreshold(){const t=E(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:i}=t[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const r=this.getDomainScale(),s=i.sort((a,o)=>o.value-a.value)[0];return this.getScaleTypeByPosition(n)===Z.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:r(s.value)}}getHighestRangeThreshold(){const t=E(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:i}=t[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const r=this.getRangeScale(),s=i.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:r(s.value)}}};function aN(e,t){const n=new Date(e[0]),i=new Date(e[1]);return ZP(i,n)>1?[tN(n,t),om(i,t)]:XP(i,n)>1?[QP(n,t),yc(i,t)]:FP(i,n)>1?[KP(n,t),rm(i,t)]:jP(i,n)>1?[JP(n,t),sm(i,t)]:um(i,n)>30?[dm(n,t*30),xc(i,t*30)]:um(i,n)>1?[dm(n,t),xc(i,t)]:hm(i,n)>15?[fm(n,t*15),bc(i,t*15)]:hm(i,n)>1?[fm(n,t),bc(i,t)]:[n,i]}function oN([e,t],n,i){const r=(t-e)*n,s=t<=0&&t+r>0?0:t+r;let a=e>=0&&e-r<0?0:e-r;if(i===Z.LOG&&a<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");a=e}return[a,s]}let lN=class extends an{constructor(){super(...arguments),this.curveTypes={curveLinear:Us,curveLinearClosed:_d,curveBasis:n_,curveBasisClosed:i_,curveBasisOpen:r_,curveBundle:s_,curveCardinal:a_,curveCardinalClosed:o_,curveCardinalOpen:l_,curveCatmullRom:c_,curveCatmullRomClosed:u_,curveCatmullRomOpen:h_,curveMonotoneX:d_,curveMonotoneY:f_,curveNatural:p_,curveStep:g_,curveStepAfter:v_,curveStepBefore:m_}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let i=this.curveTypes[t];return n&&Object.keys(n).forEach(r=>{i[r]&&(i=i[r](n[r]))}),i}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}};class cN extends an{isZoomBarEnabled(){if(!this.services.cartesianScales||!E(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=E(this.model.getOptions(),"axes",t,"scaleType");return t===H.BOTTOM&&n===Z.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales undefined");const r=i.getMainXAxisPosition(),s=i.getDomainIdentifier(),a=E(this.model.getOptions(),"axes",r,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!r)throw new Error("Not defined: mainXAxisPosition");return i.extendsDomain(r,ye(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var i;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((i=this.services.events)==null||i.dispatchEvent(C.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return E(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var i;const r=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=E(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&a&&r){const o=s.stacked?"sharedStackKey":(i=this.services.cartesianScales)==null?void 0:i.getDomainIdentifier(),c=t.filter(l=>new Date(l[o])>=r[0]&&new Date(l[o])<=r[1]);if(c.length>0)return c}return t}zoomIn(t=this.getZoomRatio()){var n;const i=this.model.get("zoomDomain"),r=ce.handleWidth,s=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();s.domain(this.getDefaultZoomBarDomain());const a=s(i[0]),o=s(i[1]);if(o-a<r+1)return;const c=s.range(),l=o-a,u=Math.min((c[1]-c[0])/2*(t/2),l/2);let h=a+u,d=o-u;h>=d&&(h=a+l/2-r/2,d=o-l/2+r/2);const f=[s.invert(h),s.invert(d)];(i[0].valueOf()!==f[0].valueOf()||i[1].valueOf()!==f[1].valueOf())&&this.handleDomainChange(f)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const i=this.services.cartesianScales.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const r=i(n[0]),s=i(n[1]),a=i.range(),o=(a[1]-a[0])/2*(t/2),c=Math.max(r-o,a[0]),l=Math.min(s+o,a[1]),u=[i.invert(c),i.invert(l)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const i=t[1].valueOf()-t[0].valueOf(),r=n[1].valueOf()-n[0].valueOf(),s=E(this.model.getOptions(),"zoomBar","minZoomRatio");return i/r<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return E(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return E(this.model.getOptions(),"zoomBar",t,"locked")}}function uN(e,t,n){var i=-1,r=e.length;t<0&&(t=-t>r?0:r+t),n=n>r?r:n,n<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(r);++i<r;)s[i]=e[i+t];return s}function hN(e,t,n){var i=e.length;return n=n===void 0?i:n,!t&&n>=i?e:uN(e,t,n)}var dN="\\ud800-\\udfff",fN="\\u0300-\\u036f",pN="\\ufe20-\\ufe2f",gN="\\u20d0-\\u20ff",mN=fN+pN+gN,vN="\\ufe0e\\ufe0f",yN="\\u200d",xN=RegExp("["+yN+dN+mN+vN+"]");function gm(e){return xN.test(e)}function bN(e){return e.split("")}var mm="\\ud800-\\udfff",wN="\\u0300-\\u036f",EN="\\ufe20-\\ufe2f",_N="\\u20d0-\\u20ff",SN=wN+EN+_N,ON="\\ufe0e\\ufe0f",TN="["+mm+"]",_c="["+SN+"]",Sc="\\ud83c[\\udffb-\\udfff]",MN="(?:"+_c+"|"+Sc+")",vm="[^"+mm+"]",ym="(?:\\ud83c[\\udde6-\\uddff]){2}",xm="[\\ud800-\\udbff][\\udc00-\\udfff]",CN="\\u200d",bm=MN+"?",wm="["+ON+"]?",AN="(?:"+CN+"(?:"+[vm,ym,xm].join("|")+")"+wm+bm+")*",$N=wm+bm+AN,LN="(?:"+[vm+_c+"?",_c,ym,xm,TN].join("|")+")",DN=RegExp(Sc+"(?="+Sc+")|"+LN+$N,"g");function kN(e){return e.match(DN)||[]}function RN(e){return gm(e)?kN(e):bN(e)}function IN(e){return function(t){t=Sr(t);var n=gm(t)?RN(t):void 0,i=n?n[0]:t.charAt(0),r=n?hN(n,1).join(""):t.slice(1);return i[e]()+r}}var PN=IN("toUpperCase");const NN=PN;function UN(e){return NN(Sr(e).toLowerCase())}var BN=Eg(function(e,t,n){return t=t.toLowerCase(),e+(n?UN(t):t)});const HN=BN;class Ae{constructor(t,n){this.components=[],this.services={canvasZoom:eN,domUtils:R,events:nN,files:iN,gradientUtils:jl,transitions:rN},this.model=new Ne(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(i=>{const r=this.services[i];this.services[i]=new r(this.model,this.services)}),this.services.events.addEventListener(C.Model.UPDATE,()=>{this.update()}),this.model.setData(n.data),this.services.events.addEventListener(C.Chart.RESIZE,()=>{this.update()}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(!0));const t=this.services.transitions.getPendingTransitions(),n=Object.keys(t).map(i=>t[i].end().catch(r=>r));Promise.all(n).then(()=>this.services.events.dispatchEvent(C.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,n){const i=this.model.getOptions(),r=E(i,"toolbar","enabled"),s={id:"legend",components:[new pc(this.model,this.services)],growth:it.PREFERRED},a=E(i,"canvasZoom","enabled");a&&a===!0&&t.push(new Tk(this.model,this.services));const o=!!this.model.getOptions().title,c={id:"title",components:[new Ir(this.model,this.services)],growth:it.STRETCH},l={id:"toolbar",components:[new kr(this.model,this.services)],growth:it.PREFERRED},u={id:"header",components:[new ie(this.model,this.services,[c,...r?[l]:[]],{direction:Et.ROW,alignItems:hi.CENTER})],growth:it.PREFERRED},h={id:"graph-frame",components:t,growth:it.STRETCH,renderType:E(n,"graphFrameRenderType")||K.SVG},d=E(n,"excludeLegend")!==!0&&i.legend.enabled!==!1;let f=Et.COLUMN;if(d){const v=E(i,"legend","position");v==="left"?(f=Et.ROW,i.legend.orientation||(i.legend.orientation=dr.VERTICAL)):v==="right"?(f=Et.ROW_REVERSE,i.legend.orientation||(i.legend.orientation=dr.VERTICAL)):v==="bottom"&&(f=Et.COLUMN_REVERSE)}const p={id:"spacer",components:[new on(this.model,this.services)],growth:it.PREFERRED},m={id:"full-frame",components:[new ie(this.model,this.services,[...d?[s]:[],...d?[p]:[],h],{direction:f})],growth:it.STRETCH},g=[];if(o||r){g.push(u);const v={id:"spacer",components:[new on(this.model,this.services,r?{size:15}:void 0)],growth:it.PREFERRED};g.push(v)}return g.push(m),[new gc(this.model,this.services),new Ca(this.model,this.services),new ie(this.model,this.services,g,{direction:Et.COLUMN})]}}class se extends Ae{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:sN,curves:lN,zoom:cN}),this.model=new Gn(this.services)}getAxisChartComponents(t,n){const i=this.model.getOptions(),r=E(i,"zoomBar",H.TOP,"enabled"),s=E(i,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=E(i,"axes",a,"scaleType"),c=r&&a===H.BOTTOM&&o===Z.TIME,l=this.services.zoom.isZoomBarLocked(H.TOP),u=!!this.model.getOptions().title,h={id:"title",components:[new Ir(this.model,this.services)],growth:it.STRETCH},d={id:"toolbar",components:[new kr(this.model,this.services)],growth:it.PREFERRED},f={id:"header",components:[new ie(this.model,this.services,[h,...s?[d]:[]],{direction:Et.ROW,alignItems:hi.CENTER})],growth:it.PREFERRED},p={id:"legend",components:[new pc(this.model,this.services)],growth:it.PREFERRED};c&&!l&&t.push(new Ug(this.model,this.services),new Vg(this.model,this.services)),t.push(new Ck(this.model,this.services)),t.push(new Ak(this.model,this.services));const m={id:"graph-frame",components:t,growth:it.STRETCH,renderType:K.SVG},g=E(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=Et.COLUMN;if(g){const T=E(this.model.getOptions(),"legend","position");T===hr.LEFT?(v=Et.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=dr.VERTICAL)):T===hr.RIGHT?(v=Et.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=dr.VERTICAL)):T===hr.BOTTOM&&(v=Et.COLUMN_REVERSE)}const b={id:"spacer",components:[new on(this.model,this.services)],growth:it.PREFERRED},w={id:"full-frame",components:[new ie(this.model,this.services,[...g?[p]:[],...g?[b]:[],m],{direction:v})],growth:it.STRETCH},O={id:"zoom-bar",components:[new Mk(this.model,this.services)],growth:it.PREFERRED,renderType:K.SVG},_=[];if(u||s){_.push(f);const T={id:"spacer",components:[new on(this.model,this.services,s?{size:15}:void 0)],growth:it.PREFERRED};_.push(T)}return c&&_.push(O),_.push(w),[new Gg(this.model,this.services),new Ca(this.model,this.services),new ie(this.model,this.services,_,{direction:Et.COLUMN})]}}class VN extends Ae{constructor(t,n){super(t,n),this.model=new e$(this.services),this.model.setOptions(Ct(wt.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new $k(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class GN extends se{constructor(t,n){super(t,n),this.model.setOptions(Ct(nn(wt.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new vn(this.model,this.services),new Mi(this.model,this.services),new Fg(this.model,this.services),new Ue(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new Jt(this.model,this.services,{skeleton:Pt.GRID})];return this.getAxisChartComponents(t)}}class FN extends se{constructor(t,n){super(t,n),this.model=new n$(this.services),this.model.setOptions(Ct(wt.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new kk(this.model,this.services),new Ci(this.model,this.services),new Jt(this.model,this.services,{skeleton:Pt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class zN extends se{constructor(t,n){super(t,n),this.model.setOptions(Ct(wt.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new vn(this.model,this.services),new Rk(this.model,this.services),new Jt(this.model,this.services,{skeleton:Pt.GRID})];return this.getAxisChartComponents(t)}}class jN extends se{constructor(t,n){super(t,n),this.model=new i$(this.services),this.model.setOptions(Ct(wt.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new Ik(this.model,this.services),new Jt(this.model,this.services,{skeleton:Pt.GRID})];return this.getAxisChartComponents(t)}}class WN extends Ae{constructor(t,n){super(t,n),this.model=new r$(this.services),this.model.setOptions(Ct(wt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const i=this.model.getOptions(),r=E(i,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new Ir(this.model,this.services)],growth:it.STRETCH},o={id:"toolbar",components:[new kr(this.model,this.services)],growth:it.PREFERRED},c={id:"header",components:[new ie(this.model,this.services,[a,...r?[o]:[]],{direction:Et.ROW,alignItems:hi.CENTER})],growth:it.PREFERRED},l={id:"legend",components:[new qg(this.model,this.services,{chartType:"choropleth"})],growth:it.PREFERRED,renderType:K.SVG},u={id:"graph-frame",components:t,growth:it.STRETCH,renderType:K.SVG},h=E(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,d=Et.COLUMN_REVERSE,f={id:"spacer",components:[new on(this.model,this.services,{size:15})],growth:it.PREFERRED},p={id:"full-frame",components:[new ie(this.model,this.services,[...h?[l]:[],...h?[f]:[],u],{direction:d})],growth:it.STRETCH},m=[];if(s||r){m.push(c);const g={id:"spacer",components:[new on(this.model,this.services,r?{size:15}:void 0)],growth:it.PREFERRED};m.push(g)}return m.push(p),[new gc(this.model,this.services),new Ca(this.model,this.services),new ie(this.model,this.services,m,{direction:Et.COLUMN})]}getComponents(){const t=[new RP(this.model,this.services)];return this.getChartComponents(t)}}class qN extends Ae{constructor(t,n){super(t,n),this.model=new s$(this.services),this.model.setOptions(Ct(wt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new Wk(this.model,this.services)];return this.getChartComponents(t)}}const Em={[fe.LINE]:[Mi,Ue],[fe.SCATTER]:[Ue],[fe.AREA]:[Fg,Mi,Ue],[fe.STACKED_AREA]:[Jg,Mi,em,La],[fe.SIMPLE_BAR]:[Qg],[fe.GROUPED_BAR]:[Kg,Ci],[fe.STACKED_BAR]:[tm,La]};class YN extends se{constructor(t,n){super(t,n);const i=Ct(wt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),i.comboChartTypes=[{type:fe.LINE,correspondingDatasets:[]}]),this.model.setOptions(i),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const i=t.map(r=>{const s=r.type;let a;if(typeof r.type=="string"){if(!Object.keys(Em).includes(r.type))return console.error(`Invalid chart type "${r.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const c=`${HN(r.type)}Chart`;return a=nt({},wt[c],this.model.getOptions(),r.options),r.type===fe.STACKED_AREA&&(o=!0),Em[r.type].map(l=>new l(this.model,this.services,{groups:r.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=nt({},this.model.getOptions(),r.options),new s(this.model,this.services,{groups:r.correspondingDatasets,id:n++,options:a})}).filter(r=>r!==null);return pm(i)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(r=>r.type===fe.STACKED_BAR||r.type===fe.STACKED_AREA),i=[new re(this.model,this.services),new ue(this.model,this.services),new Jt(this.model,this.services,{skeleton:Pt.GRID}),...n?[]:[new vn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(i)}}class _m extends Ae{constructor(t,n,i=!1){super(t,n),this.model=new a$(this.services),!i&&(this.model.setOptions(Ct(wt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Yg(this.model,this.services),new Jt(this.model,this.services,{skeleton:Pt.PIE})];return this.getChartComponents(t)}}class XN extends _m{constructor(t,n){super(t,n,!0),this.model.setOptions(Ct(wt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new Yk(this.model,this.services),new Jt(this.model,this.services,{skeleton:Pt.DONUT})];return this.getChartComponents(t)}}class ZN extends Ae{constructor(t,n){super(t,n),this.model=new o$(this.services),this.model.setOptions(Ct(wt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new Xk(this.model,this.services)];return this.getChartComponents(t)}}class KN extends se{constructor(t,n){super(t,n),this.model.setOptions(Ct(wt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new Kg(this.model,this.services),new Ci(this.model,this.services),new Jt(this.model,this.services,{skeleton:Pt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class QN extends se{constructor(t,n){super(t,n),this.model=new l$(this.services),this.model.setOptions(Ct(wt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const i=this.model.getOptions(),r=E(i,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new Ir(this.model,this.services)],growth:it.STRETCH},o={id:"toolbar",components:[new kr(this.model,this.services)],growth:it.PREFERRED},c={id:"header",components:[new ie(this.model,this.services,[a,...r?[o]:[]],{direction:Et.ROW,alignItems:hi.CENTER})],growth:it.PREFERRED},l={id:"legend",components:[new qg(this.model,this.services,{chartType:"heatmap"})],growth:it.PREFERRED,renderType:K.SVG},u={id:"graph-frame",components:t,growth:it.STRETCH,renderType:K.SVG},h=E(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,d=Et.COLUMN_REVERSE,f={id:"spacer",components:[new on(this.model,this.services,{size:15})],growth:it.PREFERRED},p={id:"full-frame",components:[new ie(this.model,this.services,[...h?[l]:[],...h?[f]:[],u],{direction:d})],growth:it.STRETCH},m=[];if(s||r){m.push(c);const g={id:"spacer",components:[new on(this.model,this.services,r?{size:15}:void 0)],growth:it.PREFERRED};m.push(g)}return m.push(p),[new Gg(this.model,this.services),new Ca(this.model,this.services),new ie(this.model,this.services,m,{direction:Et.COLUMN})]}getComponents(){const t=[new re(this.model,this.services),new Zk(this.model,this.services)];return this.getAxisChartComponents(t)}}class JN extends se{constructor(t,n){super(t,n),this.model=new c$(this.services),this.model.setOptions(Ct(wt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new zk(this.model,this.services),new Kk(this.model,this.services)];return this.getAxisChartComponents(t)}}class tU extends se{constructor(t,n){super(t,n),this.model.setOptions(Ct(wt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new vn(this.model,this.services),new Mi(this.model,this.services),new Ue(this.model,this.services,{handleThresholds:!0}),new eR(this.model,this.services),new Ci(this.model,this.services)];return this.getAxisChartComponents(t)}}class eU extends se{constructor(t,n){super(t,n),this.model.setOptions(Ct(wt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new vn(this.model,this.services),new Qk(this.model,this.services),new Ue(this.model,this.services),new Jt(this.model,this.services,{skeleton:Pt.GRID})];return this.getAxisChartComponents(t)}}class nU extends Ae{constructor(t,n){var i;super(t,n),this.model=new u$(this.services);const r=(i=n.options.meter)!=null&&i.proportional?nt(nn(wt.proportionalMeterChart),n.options):nt(nn(wt.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const t=[...E(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new jk(this.model,this.services)],growth:it.STRETCH,renderType:K.SVG},{id:"spacer",components:[new on(this.model,this.services,{size:8})],growth:it.STRETCH}]:[],{id:"meter-graph",components:[new Jk(this.model,this.services)],growth:it.STRETCH,renderType:K.SVG}],n=[new ie(this.model,this.services,t,{direction:Et.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:K.HTML})}}class iU extends Ae{constructor(t,n){super(t,n),this.model=new h$(this.services),this.model.setOptions(Ct(wt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new tR(this.model,this.services)];return this.getChartComponents(t)}}class rU extends se{constructor(t,n){super(t,n),this.model.setOptions(Ct(wt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new vn(this.model,this.services),new Ue(this.model,this.services),new Jt(this.model,this.services,{skeleton:Pt.GRID})];return this.getAxisChartComponents(t)}}class sU extends Ae{constructor(t,n){super(t,n),this.model=new d$(this.services),this.model.setOptions(Ct(wt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new nR(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class aU extends Ae{constructor(t,n){super(t,n),this.model=new f$(this.services),this.model.setOptions(Ct(wt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new LP(this.model,this.services)];return this.getChartComponents(t)}}class oU extends se{constructor(t,n){super(t,n),this.model.setOptions(Ct(wt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new Qg(this.model,this.services),new Ci(this.model,this.services),new Jt(this.model,this.services,{skeleton:Pt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class lU extends se{constructor(t,n){super(t,n),this.model.setOptions(Ct(wt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new La(this.model,this.services),new Jg(this.model,this.services),new Mi(this.model,this.services,{stacked:!0}),new em(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new Jt(this.model,this.services,{skeleton:Pt.GRID})];return this.getAxisChartComponents(t)}}class cU extends se{constructor(t,n){super(t,n),this.model.setOptions(Ct(wt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new re(this.model,this.services),new ue(this.model,this.services),new La(this.model,this.services),new tm(this.model,this.services),new Jt(this.model,this.services,{skeleton:Pt.VERT_OR_HORIZ}),new Ci(this.model,this.services)];return this.getAxisChartComponents(t)}}class uU extends Ae{constructor(t,n){super(t,n),this.model=new p$(this.services),this.model.setOptions(Ct(wt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new DP(this.model,this.services),new Jt(this.model,this.services,{skeleton:Pt.PIE})];return this.getChartComponents(t)}}function Mt(e,t){return ve.defineComponent({name:t,props:{data:{type:Object,required:!0},options:{type:Object,required:!0}},setup(n){const i=ve.ref(null),r=ve.ref(null),{data:s,options:a}=ve.toRefs(n);return ve.onMounted(()=>{r.value=new e(i.value,{data:s.value,options:a.value})}),ve.watch(s,o=>{var c;(c=r.value)==null||c.model.setData(o)},{immediate:!0}),ve.watch(a,o=>{var c;(c=r.value)==null||c.model.setOptions(o)}),{chart:r,chartDiv:i}},template:'<div ref="chartDiv"></div>'})}const Sm=Mt(VN,"CcvAlluvialChart"),Om=Mt(GN,"CcvAreaChart"),Tm=Mt(FN,"CcvBoxplotChart"),Mm=Mt(zN,"CcvBubbleChart"),Cm=Mt(jN,"CcvBulletChart"),Am=Mt(WN,"ExperimentalCcvChoroplethChart"),$m=Mt(qN,"CcvCirclePackChart"),Lm=Mt(YN,"CcvComboChart"),Dm=Mt(XN,"CcvDonutChart"),km=Mt(ZN,"CcvGaugeChart"),Rm=Mt(KN,"CcvGroupedBarChart"),Im=Mt(QN,"CcvHeatmapChart"),Pm=Mt(JN,"CcvHistogramChart"),Nm=Mt(tU,"CcvLineChart"),Um=Mt(eU,"CcvLollipopChart"),Bm=Mt(nU,"CcvMeterChart"),Hm=Mt(_m,"CcvPieChart"),Vm=Mt(iU,"CcvRadarChart"),Gm=Mt(rU,"CcvScatterChart"),Fm=Mt(oU,"CcvSimpleBarChart"),zm=Mt(lU,"CcvStackedAreaChart"),jm=Mt(cU,"CcvStackedBarChart"),Wm=Mt(sU,"CcvTreeChart"),qm=Mt(aU,"CcvTreemapChart"),Ym=Mt(uU,"CcvWordCloudChart"),hU=[Sm,Om,Tm,Mm,Cm,Am,$m,Lm,Dm,km,Rm,Im,Pm,Nm,Um,Bm,Hm,Vm,Gm,Fm,zm,jm,Wm,qm,Ym],dU={install(e,t){for(const n of hU)(!t||t.includes(n.name))&&e.component(n.name,n)}};rt.CcvAlluvialChart=Sm,rt.CcvAreaChart=Om,rt.CcvBoxplotChart=Tm,rt.CcvBubbleChart=Mm,rt.CcvBulletChart=Cm,rt.CcvCirclePackChart=$m,rt.CcvComboChart=Lm,rt.CcvDonutChart=Dm,rt.CcvGaugeChart=km,rt.CcvGroupedBarChart=Rm,rt.CcvHeatmapChart=Im,rt.CcvHistogramChart=Pm,rt.CcvLineChart=Nm,rt.CcvLollipopChart=Um,rt.CcvMeterChart=Bm,rt.CcvPieChart=Hm,rt.CcvRadarChart=Vm,rt.CcvScatterChart=Gm,rt.CcvSimpleBarChart=Fm,rt.CcvStackedAreaChart=zm,rt.CcvStackedBarChart=jm,rt.CcvTreeChart=Wm,rt.CcvTreemapChart=qm,rt.CcvWordCloudChart=Ym,rt.ExperimentalCcvChoroplethChart=Am,rt.default=dU,Object.defineProperties(rt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
84
84
  //# sourceMappingURL=index.js.map