@carbon/charts-vue 1.11.4 → 1.11.6
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/CHANGELOG.md +25 -0
- package/dist/index.js +19 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5841 -5843
- package/dist/index.mjs.map +1 -1
- package/dist/stories/all.stories.d.ts +1 -0
- package/package.json +16 -17
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
(function(nt,xe){typeof exports=="object"&&typeof module<"u"?xe(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],xe):(nt=typeof globalThis<"u"?globalThis:nt||self,xe(nt.ChartsVue={},nt.Vue))})(this,function(nt,xe){"use strict";function wn(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function yv(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ba(e){let t,n,i;e.length!==2?(t=wn,n=(o,l)=>wn(e(o),l),i=(o,l)=>e(o)-l):(t=e===wn||e===yv?e:xv,n=e,i=e);function r(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const h=c+u>>>1;n(o[h],l)<0?c=h+1:u=h}while(c<u)}return c}function s(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const h=c+u>>>1;n(o[h],l)<=0?c=h+1:u=h}while(c<u)}return c}function a(o,l,c=0,u=o.length){const h=r(o,l,c,u-1);return h>c&&i(o[h-1],l)>-i(o[h],l)?h-1:h}return{left:r,center:a,right:s}}function xv(){return 0}function bv(e){return e===null?NaN:+e}function*wv(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 _v=Ba(wn).right;Ba(bv).center;const Va=_v;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 be(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 _n{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 Nc extends Map{constructor(t,n=Tv){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(Pc(this,t))}has(t){return super.has(Pc(this,t))}set(t,n){return super.set(Sv(this,t),n)}delete(t){return super.delete(Ov(this,t))}}function Pc({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function Sv({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function Ov({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function Tv(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Mv(e){return e}function Cv(e=wn){if(e===wn)return Uc;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 Uc(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var $v=Array.prototype,Av=$v.slice;function Ha(e){return()=>e}const Lv=Math.sqrt(50),Dv=Math.sqrt(10),kv=Math.sqrt(2);function Vr(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>=Lv?10:s>=Dv?5:s>=kv?2:1;let o,l,c;return r<0?(c=Math.pow(10,-r)/a,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,r)*a,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?Vr(e,t,n*2):[o,l,c]}function Hr(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?Vr(t,e,n):Vr(e,t,n);if(!(s>=r))return[];const o=s-r+1,l=new Array(o);if(i)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(r+c)/-a;else for(let c=0;c<o;++c)l[c]=(r+c)*a;return l}function qn(e,t,n){return t=+t,e=+e,n=+n,Vr(e,t,n)[2]}function Ga(e,t,n){t=+t,e=+e,n=+n;const i=t<e,r=i?qn(t,e,n):qn(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}function Rv(e,t,n){let i;for(;;){const r=qn(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 Iv(e){return Math.max(1,Math.ceil(Math.log(Ev(e))/Math.LN2)+1)}function Nv(){var e=Mv,t=be,n=Iv;function i(r){Array.isArray(r)||(r=Array.from(r));var s,a=r.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(r[s],s,r);var u=t(c),h=u[0],d=u[1],f=n(c,h,d);if(!Array.isArray(f)){const x=d,S=+f;if(t===be&&([h,d]=Rv(h,d,S)),f=Hr(h,d,S),f[0]<=h&&(l=qn(h,d,S)),f[f.length-1]>=d)if(x>=d&&t===be){const _=qn(h,d,S);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),y;for(s=0;s<=p;++s)y=v[s]=[],y.x0=s>0?f[s-1]:h,y.x1=s<p?f[s]:d;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&h<=o&&o<=d&&v[Math.min(p,Math.floor((o-h)/l))].push(r[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&h<=o&&o<=d){const x=Math.floor((h-o)*l);v[Math.min(p,x+(f[x]<=o))].push(r[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&h<=o&&o<=d&&v[Va(f,o,0,p)].push(r[s]);return v}return i.value=function(r){return arguments.length?(e=typeof r=="function"?r:Ha(r),i):e},i.domain=function(r){return arguments.length?(t=typeof r=="function"?r:Ha([r[0],r[1]]),i):t},i.thresholds=function(r){return arguments.length?(n=typeof r=="function"?r:Ha(Array.isArray(r)?Av.call(r):r),i):n},i}function En(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 un(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 Bc(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?Uc:Cv(r);i>n;){if(i-n>600){const l=i-n+1,c=t-n+1,u=Math.log(l),h=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*h*(l-h)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*h/l+d)),p=Math.min(i,Math.floor(t+(l-c)*h/l+d));Bc(e,t,f,p,r)}const s=e[t];let a=n,o=i;for(Di(e,n,t),r(e[i],s)>0&&Di(e,n,i);a<o;){for(Di(e,a,o),++a,--o;r(e[a],s)<0;)++a;for(;r(e[o],s)>0;)--o}r(e[n],s)===0?Di(e,n,o):(++o,Di(e,o,i)),o<=t&&(n=o+1),t<=o&&(i=o-1)}return e}function Di(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function Fa(e,t,n){if(e=Float64Array.from(wv(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return un(e);if(t>=1)return En(e);var i,r=(i-1)*t,s=Math.floor(r),a=En(Bc(e,s).subarray(0,s+1)),o=un(e.subarray(s+1));return a+(o-a)*(r-s)}}function*Pv(e){for(const t of e)yield*t}function Vc(e){return Array.from(Pv(e))}function Uv(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 Bv(e){return e}var Gr=1,Fr=2,za=3,ki=4,Hc=1e-6;function Vv(e){return"translate("+e+",0)"}function Hv(e){return"translate(0,"+e+")"}function Gv(e){return t=>+e(t)}function Fv(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function zv(){return!this.__axis}function zr(e,t){var n=[],i=null,r=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===Gr||e===ki?-1:1,u=e===ki||e===Fr?"x":"y",h=e===Gr||e===za?Vv:Hv;function d(f){var p=i??(t.ticks?t.ticks.apply(t,n):t.domain()),m=r??(t.tickFormat?t.tickFormat.apply(t,n):Bv),g=Math.max(s,0)+o,v=t.range(),y=+v[0]+l,x=+v[v.length-1]+l,S=(t.bandwidth?Fv:Gv)(t.copy(),l),_=f.selection?f.selection():f,E=_.selectAll(".domain").data([null]),T=_.selectAll(".tick").data(p,t).order(),k=T.exit(),I=T.enter().append("g").attr("class","tick"),$=T.select("line"),M=T.select("text");E=E.merge(E.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),T=T.merge(I),$=$.merge(I.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),M=M.merge(I.append("text").attr("fill","currentColor").attr(u,c*g).attr("dy",e===Gr?"0em":e===za?"0.71em":"0.32em")),f!==_&&(E=E.transition(f),T=T.transition(f),$=$.transition(f),M=M.transition(f),k=k.transition(f).attr("opacity",Hc).attr("transform",function(V){return isFinite(V=S(V))?h(V+l):this.getAttribute("transform")}),I.attr("opacity",Hc).attr("transform",function(V){var C=this.parentNode.__axis;return h((C&&isFinite(C=C(V))?C:S(V))+l)})),k.remove(),E.attr("d",e===ki||e===Fr?a?"M"+c*a+","+y+"H"+l+"V"+x+"H"+c*a:"M"+l+","+y+"V"+x:a?"M"+y+","+c*a+"V"+l+"H"+x+"V"+c*a:"M"+y+","+l+"H"+x),T.attr("opacity",1).attr("transform",function(V){return h(S(V)+l)}),$.attr(u+"2",c*s),M.attr(u,c*g).text(m),_.filter(zv).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Fr?"start":e===ki?"end":"middle"),_.each(function(){this.__axis=S})}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?(l=+f,d):l},d}function jv(e){return zr(Gr,e)}function Wv(e){return zr(Fr,e)}function ja(e){return zr(za,e)}function Gc(e){return zr(ki,e)}var qv={value:()=>{}};function Wa(){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 jr(n)}function jr(e){this._=e}function Yv(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}})}jr.prototype=Wa.prototype={constructor:jr,on:function(e,t){var n=this._,i=Yv(e+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((r=(e=i[s]).type)&&(r=Zv(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]=Fc(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Fc(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 jr(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 Zv(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function Fc(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=qv,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var qa="http://www.w3.org/1999/xhtml";const zc={svg:"http://www.w3.org/2000/svg",xhtml:qa,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Wr(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),zc.hasOwnProperty(t)?{space:zc[t],local:e}:e}function Xv(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===qa&&t.documentElement.namespaceURI===qa?t.createElement(e):t.createElementNS(n,e)}}function Kv(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jc(e){var t=Wr(e);return(t.local?Kv:Xv)(t)}function Qv(){}function Ya(e){return e==null?Qv:function(){return this.querySelector(e)}}function Jv(e){typeof e!="function"&&(e=Ya(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),l,c,u=0;u<a;++u)(l=s[u])&&(c=e.call(l,l.__data__,u,s))&&("__data__"in l&&(c.__data__=l.__data__),o[u]=c);return new oe(i,this._parents)}function t0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function e0(){return[]}function Wc(e){return e==null?e0:function(){return this.querySelectorAll(e)}}function n0(e){return function(){return t0(e.apply(this,arguments))}}function i0(e){typeof e=="function"?e=n0(e):e=Wc(e);for(var t=this._groups,n=t.length,i=[],r=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(i.push(e.call(l,l.__data__,c,a)),r.push(l));return new oe(i,r)}function qc(e){return function(){return this.matches(e)}}function Yc(e){return function(t){return t.matches(e)}}var r0=Array.prototype.find;function s0(e){return function(){return r0.call(this.children,e)}}function a0(){return this.firstElementChild}function o0(e){return this.select(e==null?a0:s0(typeof e=="function"?e:Yc(e)))}var l0=Array.prototype.filter;function c0(){return Array.from(this.children)}function u0(e){return function(){return l0.call(this.children,e)}}function h0(e){return this.selectAll(e==null?c0:u0(typeof e=="function"?e:Yc(e)))}function d0(e){typeof e!="function"&&(e=qc(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]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new oe(i,this._parents)}function Zc(e){return new Array(e.length)}function f0(){return new oe(this._enter||this._groups.map(Zc),this._parents)}function qr(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}qr.prototype={constructor:qr,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 p0(e){return function(){return e}}function g0(e,t,n,i,r,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],i[a]=o):n[a]=new qr(e,s[a]);for(;a<l;++a)(o=t[a])&&(r[a]=o)}function m0(e,t,n,i,r,s,a){var o,l,c=new Map,u=t.length,h=s.length,d=new Array(u),f;for(o=0;o<u;++o)(l=t[o])&&(d[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?r[o]=l:c.set(f,l));for(o=0;o<h;++o)f=a.call(e,s[o],o,s)+"",(l=c.get(f))?(i[o]=l,l.__data__=s[o],c.delete(f)):n[o]=new qr(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(d[o])===l&&(r[o]=l)}function v0(e){return e.__data__}function y0(e,t){if(!arguments.length)return Array.from(this,v0);var n=t?m0:g0,i=this._parents,r=this._groups;typeof e!="function"&&(e=p0(e));for(var s=r.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var u=i[c],h=r[c],d=h.length,f=x0(e.call(u,u&&u.__data__,c,i)),p=f.length,m=o[c]=new Array(p),g=a[c]=new Array(p),v=l[c]=new Array(d);n(u,h,m,g,v,f,t);for(var y=0,x=0,S,_;y<p;++y)if(S=m[y]){for(y>=x&&(x=y+1);!(_=g[x])&&++x<p;);S._next=_||null}}return a=new oe(a,i),a._enter=o,a._exit=l,a}function x0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function b0(){return new oe(this._exit||this._groups.map(Zc),this._parents)}function w0(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 _0(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),l=0;l<a;++l)for(var c=n[l],u=i[l],h=c.length,d=o[l]=new Array(h),f,p=0;p<h;++p)(f=c[p]||u[p])&&(d[p]=f);for(;l<r;++l)o[l]=n[l];return new oe(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 S0(e){e||(e=O0);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,l=r[s]=new Array(o),c,u=0;u<o;++u)(c=a[u])&&(l[u]=c);l.sort(t)}return new oe(r,this._parents).order()}function O0(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function T0(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function M0(){return Array.from(this)}function C0(){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 $0(){let e=0;for(const t of this)++e;return e}function A0(){return!this.node()}function L0(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 D0(e){return function(){this.removeAttribute(e)}}function k0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function R0(e,t){return function(){this.setAttribute(e,t)}}function I0(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function N0(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function P0(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 U0(e,t){var n=Wr(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?k0:D0:typeof t=="function"?n.local?P0:N0:n.local?I0:R0)(n,t))}function Xc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function B0(e){return function(){this.style.removeProperty(e)}}function V0(e,t,n){return function(){this.style.setProperty(e,t,n)}}function H0(e,t,n){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function G0(e,t,n){return arguments.length>1?this.each((t==null?B0:typeof t=="function"?H0:V0)(e,t,n??"")):Yn(this.node(),e)}function Yn(e,t){return e.style.getPropertyValue(t)||Xc(e).getComputedStyle(e,null).getPropertyValue(t)}function F0(e){return function(){delete this[e]}}function z0(e,t){return function(){this[e]=t}}function j0(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function W0(e,t){return arguments.length>1?this.each((t==null?F0:typeof t=="function"?j0:z0)(e,t)):this.node()[e]}function Kc(e){return e.trim().split(/^|\s+/)}function Za(e){return e.classList||new Qc(e)}function Qc(e){this._node=e,this._names=Kc(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 Jc(e,t){for(var n=Za(e),i=-1,r=t.length;++i<r;)n.add(t[i])}function tu(e,t){for(var n=Za(e),i=-1,r=t.length;++i<r;)n.remove(t[i])}function q0(e){return function(){Jc(this,e)}}function Y0(e){return function(){tu(this,e)}}function Z0(e,t){return function(){(t.apply(this,arguments)?Jc:tu)(this,e)}}function X0(e,t){var n=Kc(e+"");if(arguments.length<2){for(var i=Za(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?Z0:t?q0:Y0)(n,t))}function K0(){this.textContent=""}function Q0(e){return function(){this.textContent=e}}function J0(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function ty(e){return arguments.length?this.each(e==null?K0:(typeof e=="function"?J0:Q0)(e)):this.node().textContent}function ey(){this.innerHTML=""}function ny(e){return function(){this.innerHTML=e}}function iy(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function ry(e){return arguments.length?this.each(e==null?ey:(typeof e=="function"?iy:ny)(e)):this.node().innerHTML}function sy(){this.nextSibling&&this.parentNode.appendChild(this)}function ay(){return this.each(sy)}function oy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ly(){return this.each(oy)}function cy(e){var t=typeof e=="function"?e:jc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function uy(){return null}function hy(e,t){var n=typeof e=="function"?e:jc(e),i=t==null?uy:typeof t=="function"?t:Ya(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function dy(){var e=this.parentNode;e&&e.removeChild(this)}function fy(){return this.each(dy)}function py(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function gy(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function my(e){return this.select(e?gy:py)}function vy(e){return arguments.length?this.property("__data__",e):this.node().__data__}function yy(e){return function(t){e.call(this,t,this.__data__)}}function xy(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 by(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 wy(e,t,n){return function(){var i=this.__on,r,s=yy(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 _y(e,t,n){var i=xy(e+""),r,s=i.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,u;l<c;++l)for(r=0,u=o[l];r<s;++r)if((a=i[r]).type===u.type&&a.name===u.name)return u.value}return}for(o=t?wy:by,r=0;r<s;++r)this.each(o(i[r],t,n));return this}function eu(e,t,n){var i=Xc(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 eu(this,e,t)}}function Sy(e,t){return function(){return eu(this,e,t.apply(this,arguments))}}function Oy(e,t){return this.each((typeof t=="function"?Sy:Ey)(e,t))}function*Ty(){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 nu=[null];function oe(e,t){this._groups=e,this._parents=t}function Ri(){return new oe([[document.documentElement]],nu)}function My(){return this}oe.prototype=Ri.prototype={constructor:oe,select:Jv,selectAll:i0,selectChild:o0,selectChildren:h0,filter:d0,data:y0,enter:f0,exit:b0,join:w0,merge:_0,selection:My,order:E0,sort:S0,call:T0,nodes:M0,node:C0,size:$0,empty:A0,each:L0,attr:U0,style:G0,property:W0,classed:X0,text:ty,html:ry,raise:ay,lower:ly,append:cy,insert:hy,remove:fy,clone:my,datum:vy,on:_y,dispatch:Oy,[Symbol.iterator]:Ty};function D(e){return typeof e=="string"?new oe([[document.querySelector(e)]],[document.documentElement]):new oe([[e]],nu)}function Cy(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Sn(e,t){if(e=Cy(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 Xa={capture:!0,passive:!1};function Ka(e){e.preventDefault(),e.stopImmediatePropagation()}function $y(e){var t=e.document.documentElement,n=D(e).on("dragstart.drag",Ka,Xa);"onselectstart"in t?n.on("selectstart.drag",Ka,Xa):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Ay(e,t){var n=e.document.documentElement,i=D(e).on("dragstart.drag",null);t&&(i.on("click.drag",Ka,Xa),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 Qa(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function iu(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Ii(){}var Ni=.7,Yr=1/Ni,Zn="\\s*([+-]?\\d+)\\s*",Pi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",De="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ly=/^#([0-9a-f]{3,8})$/,Dy=new RegExp(`^rgb\\(${Zn},${Zn},${Zn}\\)$`),ky=new RegExp(`^rgb\\(${De},${De},${De}\\)$`),Ry=new RegExp(`^rgba\\(${Zn},${Zn},${Zn},${Pi}\\)$`),Iy=new RegExp(`^rgba\\(${De},${De},${De},${Pi}\\)$`),Ny=new RegExp(`^hsl\\(${Pi},${De},${De}\\)$`),Py=new RegExp(`^hsla\\(${Pi},${De},${De},${Pi}\\)$`),ru={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};Qa(Ii,He,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:su,formatHex:su,formatHex8:Uy,formatHsl:By,formatRgb:au,toString:au});function su(){return this.rgb().formatHex()}function Uy(){return this.rgb().formatHex8()}function By(){return hu(this).formatHsl()}function au(){return this.rgb().formatRgb()}function He(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ly.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ou(t):n===3?new te(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Zr(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Zr(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=Dy.exec(e))?new te(t[1],t[2],t[3],1):(t=ky.exec(e))?new te(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ry.exec(e))?Zr(t[1],t[2],t[3],t[4]):(t=Iy.exec(e))?Zr(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ny.exec(e))?uu(t[1],t[2]/100,t[3]/100,1):(t=Py.exec(e))?uu(t[1],t[2]/100,t[3]/100,t[4]):ru.hasOwnProperty(e)?ou(ru[e]):e==="transparent"?new te(NaN,NaN,NaN,0):null}function ou(e){return new te(e>>16&255,e>>8&255,e&255,1)}function Zr(e,t,n,i){return i<=0&&(e=t=n=NaN),new te(e,t,n,i)}function Vy(e){return e instanceof Ii||(e=He(e)),e?(e=e.rgb(),new te(e.r,e.g,e.b,e.opacity)):new te}function Ja(e,t,n,i){return arguments.length===1?Vy(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}Qa(te,Ja,iu(Ii,{brighter(e){return e=e==null?Yr:Math.pow(Yr,e),new te(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ni:Math.pow(Ni,e),new te(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new te(On(this.r),On(this.g),On(this.b),Xr(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:lu,formatHex:lu,formatHex8:Hy,formatRgb:cu,toString:cu}));function lu(){return`#${Tn(this.r)}${Tn(this.g)}${Tn(this.b)}`}function Hy(){return`#${Tn(this.r)}${Tn(this.g)}${Tn(this.b)}${Tn((isNaN(this.opacity)?1:this.opacity)*255)}`}function cu(){const e=Xr(this.opacity);return`${e===1?"rgb(":"rgba("}${On(this.r)}, ${On(this.g)}, ${On(this.b)}${e===1?")":`, ${e})`}`}function Xr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function On(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Tn(e){return e=On(e),(e<16?"0":"")+e.toString(16)}function uu(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new we(e,t,n,i)}function hu(e){if(e instanceof we)return new we(e.h,e.s,e.l,e.opacity);if(e instanceof Ii||(e=He(e)),!e)return new we;if(e instanceof we)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,l=(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/=l<.5?s+r:2-s-r,a*=60):o=l>0&&l<1?0:a,new we(a,o,l,e.opacity)}function to(e,t,n,i){return arguments.length===1?hu(e):new we(e,t,n,i??1)}function we(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}Qa(we,to,iu(Ii,{brighter(e){return e=e==null?Yr:Math.pow(Yr,e),new we(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ni:Math.pow(Ni,e),new we(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(eo(e>=240?e-240:e+120,r,i),eo(e,r,i),eo(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new we(du(this.h),Kr(this.s),Kr(this.l),Xr(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=Xr(this.opacity);return`${e===1?"hsl(":"hsla("}${du(this.h)}, ${Kr(this.s)*100}%, ${Kr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function du(e){return e=(e||0)%360,e<0?e+360:e}function Kr(e){return Math.max(0,Math.min(1,e||0))}function eo(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 no=e=>()=>e;function Gy(e,t){return function(n){return e+n*t}}function Fy(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 zy(e){return(e=+e)==1?fu:function(t,n){return n-t?Fy(t,n,e):no(isNaN(t)?n:t)}}function fu(e,t){var n=t-e;return n?Gy(e,n):no(isNaN(e)?t:e)}const Qr=function e(t){var n=zy(t);function i(r,s){var a=n((r=Ja(r)).r,(s=Ja(s)).r),o=n(r.g,s.g),l=n(r.b,s.b),c=fu(r.opacity,s.opacity);return function(u){return r.r=a(u),r.g=o(u),r.b=l(u),r.opacity=c(u),r+""}}return i.gamma=e,i}(1);function jy(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 Wy(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function qy(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]=Ui(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 Yy(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 Zy(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]=Ui(e[r],t[r]):i[r]=t[r];return function(s){for(r in n)i[r]=n[r](s);return i}}var io=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ro=new RegExp(io.source,"g");function Xy(e){return function(){return e}}function Ky(e){return function(t){return e(t)+""}}function pu(e,t){var n=io.lastIndex=ro.lastIndex=0,i,r,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(i=io.exec(e))&&(r=ro.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,l.push({i:a,x:le(i,r)})),n=ro.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?Ky(l[0].x):Xy(t):(t=l.length,function(c){for(var u=0,h;u<t;++u)o[(h=l[u]).i]=h.x(c);return o.join("")})}function Ui(e,t){var n=typeof t,i;return t==null||n==="boolean"?no(t):(n==="number"?le:n==="string"?(i=He(t))?(t=i,Qr):pu:t instanceof He?Qr:t instanceof Date?Yy:Wy(t)?jy:Array.isArray(t)?qy:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Zy:le)(e,t)}function gu(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var mu=180/Math.PI,so={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function vu(e,t,n,i,r,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*i)&&(n-=e*l,i-=t*l),(o=Math.sqrt(n*n+i*i))&&(n/=o,i/=o,l/=o),e*i<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:r,translateY:s,rotate:Math.atan2(t,e)*mu,skewX:Math.atan(l)*mu,scaleX:a,scaleY:o}}var Jr;function Qy(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?so:vu(t.a,t.b,t.c,t.d,t.e,t.f)}function Jy(e){return e==null||(Jr||(Jr=document.createElementNS("http://www.w3.org/2000/svg","g")),Jr.setAttribute("transform",e),!(e=Jr.transform.baseVal.consolidate()))?so:(e=e.matrix,vu(e.a,e.b,e.c,e.d,e.e,e.f))}function yu(e,t,n,i){function r(c){return c.length?c.pop()+" ":""}function s(c,u,h,d,f,p){if(c!==h||u!==d){var m=f.push("translate(",null,t,null,n);p.push({i:m-4,x:le(c,h)},{i:m-2,x:le(u,d)})}else(h||d)&&f.push("translate("+h+t+d+n)}function a(c,u,h,d){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),d.push({i:h.push(r(h)+"rotate(",null,i)-2,x:le(c,u)})):u&&h.push(r(h)+"rotate("+u+i)}function o(c,u,h,d){c!==u?d.push({i:h.push(r(h)+"skewX(",null,i)-2,x:le(c,u)}):u&&h.push(r(h)+"skewX("+u+i)}function l(c,u,h,d,f,p){if(c!==h||u!==d){var m=f.push(r(f)+"scale(",null,",",null,")");p.push({i:m-4,x:le(c,h)},{i:m-2,x:le(u,d)})}else(h!==1||d!==1)&&f.push(r(f)+"scale("+h+","+d+")")}return function(c,u){var h=[],d=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,h,d),a(c.rotate,u.rotate,h,d),o(c.skewX,u.skewX,h,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,h,d),c=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 t1=yu(Qy,"px, ","px)","deg)"),e1=yu(Jy,", ",")",")");function n1(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}var Xn=0,Bi=0,Vi=0,xu=1e3,ts,Hi,es=0,Mn=0,ns=0,Gi=typeof performance=="object"&&performance.now?performance:Date,bu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ao(){return Mn||(bu(i1),Mn=Gi.now()+ns)}function i1(){Mn=0}function is(){this._call=this._time=this._next=null}is.prototype=wu.prototype={constructor:is,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ao():+n)+(t==null?0:+t),!this._next&&Hi!==this&&(Hi?Hi._next=this:ts=this,Hi=this),this._call=e,this._time=n,oo()},stop:function(){this._call&&(this._call=null,this._time=1/0,oo())}};function wu(e,t,n){var i=new is;return i.restart(e,t,n),i}function r1(){ao(),++Xn;for(var e=ts,t;e;)(t=Mn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Xn}function _u(){Mn=(es=Gi.now())+ns,Xn=Bi=0;try{r1()}finally{Xn=0,a1(),Mn=0}}function s1(){var e=Gi.now(),t=e-es;t>xu&&(ns-=t,es=e)}function a1(){for(var e,t=ts,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:ts=n);Hi=e,oo(i)}function oo(e){if(!Xn){Bi&&(Bi=clearTimeout(Bi));var t=e-Mn;t>24?(e<1/0&&(Bi=setTimeout(_u,e-Gi.now()-ns)),Vi&&(Vi=clearInterval(Vi))):(Vi||(es=Gi.now(),Vi=setInterval(s1,xu)),Xn=1,bu(_u))}}function Eu(e,t,n){var i=new is;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var o1=Wa("start","end","cancel","interrupt"),l1=[],Su=0,Ou=1,lo=2,rs=3,Tu=4,co=5,ss=6;function as(e,t,n,i,r,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;c1(e,n,{name:t,index:i,group:r,on:o1,tween:l1,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Su})}function uo(e,t){var n=_e(e,t);if(n.state>Su)throw new Error("too late; already scheduled");return n}function ke(e,t){var n=_e(e,t);if(n.state>rs)throw new Error("too late; already running");return n}function _e(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function c1(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=wu(s,0,n.time);function s(c){n.state=Ou,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,h,d,f;if(n.state!==Ou)return l();for(u in i)if(f=i[u],f.name===n.name){if(f.state===rs)return Eu(a);f.state===Tu?(f.state=ss,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[u]):+u<t&&(f.state=ss,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[u])}if(Eu(function(){n.state===rs&&(n.state=Tu,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=lo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===lo){for(n.state=rs,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(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=co,1),h=-1,d=r.length;++h<d;)r[h].call(e,u);n.state===co&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=ss,n.timer.stop(),delete i[t];for(var c in i)return;delete e.__transition}}function ho(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>lo&&i.state<co,i.state=ss,i.timer.stop(),i.on.call(r?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[a]}s&&delete e.__transition}}function u1(e){return this.each(function(){ho(this,e)})}function h1(e,t){var n,i;return function(){var r=ke(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 d1(e,t,n){var i,r;if(typeof n!="function")throw new Error;return function(){var s=ke(this,e),a=s.tween;if(a!==i){r=(i=a).slice();for(var o={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=o;break}l===c&&r.push(o)}s.tween=r}}function f1(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i=_e(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?h1:d1)(n,e,t))}function fo(e,t,n){var i=e._id;return e.each(function(){var r=ke(this,i);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return _e(r,i).value[t]}}function Mu(e,t){var n;return(typeof t=="number"?le:t instanceof He?Qr:(n=He(t))?(t=n,Qr):pu)(e,t)}function p1(e){return function(){this.removeAttribute(e)}}function g1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function m1(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 v1(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 y1(e,t,n){var i,r,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=o+"",a===l?null:a===i&&l===r?s:(r=l,s=t(i=a,o)))}}function x1(e,t,n){var i,r,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=o+"",a===l?null:a===i&&l===r?s:(r=l,s=t(i=a,o)))}}function b1(e,t){var n=Wr(e),i=n==="transform"?e1:Mu;return this.attrTween(e,typeof t=="function"?(n.local?x1:y1)(n,i,fo(this,"attr."+e,t)):t==null?(n.local?g1:p1)(n):(n.local?v1:m1)(n,i,t))}function w1(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function _1(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)&&_1(e,s)),n}return r._value=t,r}function S1(e,t){var n,i;function r(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&w1(e,s)),n}return r._value=t,r}function O1(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=Wr(e);return this.tween(n,(i.local?E1:S1)(i,t))}function T1(e,t){return function(){uo(this,e).delay=+t.apply(this,arguments)}}function M1(e,t){return t=+t,function(){uo(this,e).delay=t}}function C1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?T1:M1)(t,e)):_e(this.node(),t).delay}function $1(e,t){return function(){ke(this,e).duration=+t.apply(this,arguments)}}function A1(e,t){return t=+t,function(){ke(this,e).duration=t}}function L1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$1:A1)(t,e)):_e(this.node(),t).duration}function D1(e,t){if(typeof t!="function")throw new Error;return function(){ke(this,e).ease=t}}function k1(e){var t=this._id;return arguments.length?this.each(D1(t,e)):_e(this.node(),t).ease}function R1(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ke(this,e).ease=n}}function I1(e){if(typeof e!="function")throw new Error;return this.each(R1(this._id,e))}function N1(e){typeof e!="function"&&(e=qc(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]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new Ge(i,this._parents,this._name,this._id)}function P1(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 l=t[o],c=n[o],u=l.length,h=a[o]=new Array(u),d,f=0;f<u;++f)(d=l[f]||c[f])&&(h[f]=d);for(;o<i;++o)a[o]=t[o];return new Ge(a,this._parents,this._name,this._id)}function U1(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 B1(e,t,n){var i,r,s=U1(t)?uo:ke;return function(){var a=s(this,e),o=a.on;o!==i&&(r=(i=o).copy()).on(t,n),a.on=r}}function V1(e,t){var n=this._id;return arguments.length<2?_e(this.node(),n).on.on(e):this.each(B1(n,e,t))}function H1(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function G1(){return this.on("end.remove",H1(this._id))}function F1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ya(e));for(var i=this._groups,r=i.length,s=new Array(r),a=0;a<r;++a)for(var o=i[a],l=o.length,c=s[a]=new Array(l),u,h,d=0;d<l;++d)(u=o[d])&&(h=e.call(u,u.__data__,d,o))&&("__data__"in u&&(h.__data__=u.__data__),c[d]=h,as(c[d],t,n,d,c,_e(u,n)));return new Ge(s,this._parents,t,n)}function z1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wc(e));for(var i=this._groups,r=i.length,s=[],a=[],o=0;o<r;++o)for(var l=i[o],c=l.length,u,h=0;h<c;++h)if(u=l[h]){for(var d=e.call(u,u.__data__,h,l),f,p=_e(u,n),m=0,g=d.length;m<g;++m)(f=d[m])&&as(f,t,n,m,d,p);s.push(d),a.push(u)}return new Ge(s,a,t,n)}var j1=Ri.prototype.constructor;function W1(){return new j1(this._groups,this._parents)}function q1(e,t){var n,i,r;return function(){var s=Yn(this,e),a=(this.style.removeProperty(e),Yn(this,e));return s===a?null:s===n&&a===i?r:r=t(n=s,i=a)}}function Cu(e){return function(){this.style.removeProperty(e)}}function Y1(e,t,n){var i,r=n+"",s;return function(){var a=Yn(this,e);return a===r?null:a===i?s:s=t(i=a,n)}}function Z1(e,t,n){var i,r,s;return function(){var a=Yn(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Yn(this,e))),a===l?null:a===i&&l===r?s:(r=l,s=t(i=a,o))}}function X1(e,t){var n,i,r,s="style."+t,a="end."+s,o;return function(){var l=ke(this,e),c=l.on,u=l.value[s]==null?o||(o=Cu(t)):void 0;(c!==n||r!==u)&&(i=(n=c).copy()).on(a,r=u),l.on=i}}function K1(e,t,n){var i=(e+="")=="transform"?t1:Mu;return t==null?this.styleTween(e,q1(e,i)).on("end.style."+e,Cu(e)):typeof t=="function"?this.styleTween(e,Z1(e,i,fo(this,"style."+e,t))).each(X1(this._id,e)):this.styleTween(e,Y1(e,i,t),n).on("end.style."+e,null)}function Q1(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function J1(e,t,n){var i,r;function s(){var a=t.apply(this,arguments);return a!==r&&(i=(r=a)&&Q1(e,a,n)),i}return s._value=t,s}function tx(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,J1(e,t,n??""))}function ex(e){return function(){this.textContent=e}}function nx(e){return function(){var t=e(this);this.textContent=t??""}}function ix(e){return this.tween("text",typeof e=="function"?nx(fo(this,"text",e)):ex(e==null?"":e+""))}function rx(e){return function(t){this.textContent=e.call(this,t)}}function sx(e){var t,n;function i(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&rx(r)),t}return i._value=e,i}function ax(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,sx(e))}function ox(){for(var e=this._name,t=this._id,n=$u(),i=this._groups,r=i.length,s=0;s<r;++s)for(var a=i[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=_e(l,t);as(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ge(i,this._parents,e,n)}function lx(){var e,t,n=this,i=n._id,r=n.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--r===0&&s()}};n.each(function(){var c=ke(this,i),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),r===0&&s()})}var cx=0;function Ge(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function $u(){return++cx}var Fe=Ri.prototype;Ge.prototype={constructor:Ge,select:F1,selectAll:z1,selectChild:Fe.selectChild,selectChildren:Fe.selectChildren,filter:N1,merge:P1,selection:W1,transition:ox,call:Fe.call,nodes:Fe.nodes,node:Fe.node,size:Fe.size,empty:Fe.empty,each:Fe.each,on:V1,attr:b1,attrTween:O1,style:K1,styleTween:tx,text:ix,textTween:ax,remove:G1,tween:f1,delay:C1,duration:L1,ease:k1,easeVarying:I1,end:lx,[Symbol.iterator]:Fe[Symbol.iterator]};const ux=e=>+e;function Au(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var hx={time:null,delay:0,duration:250,ease:Au};function dx(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 fx(e){var t,n;e instanceof Ge?(t=e._id,e=e._name):(t=$u(),(n=hx).time=ao(),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,l,c=0;c<o;++c)(l=a[c])&&as(l,e,t,c,a,n||dx(l,t));return new Ge(i,this._parents,e,t)}Ri.prototype.interrupt=u1,Ri.prototype.transition=fx;const po=e=>()=>e;function px(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 gx(e){e.stopImmediatePropagation()}function go(e){e.preventDefault(),e.stopImmediatePropagation()}var Lu={name:"drag"},mo={name:"space"},Kn={name:"handle"},Qn={name:"center"};const{abs:Du,max:zt,min:jt}=Math;function ku(e){return[+e[0],+e[1]]}function Ru(e){return[ku(e[0]),ku(e[1])]}var os={name:"x",handles:["w","e"].map(ls),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]]}},vo={name:"y",handles:["n","s"].map(ls),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]]}},ze={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"},Iu={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Nu={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},mx={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},vx={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function ls(e){return{type:e}}function yx(e){return!e.ctrlKey&&!e.button}function xx(){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 bx(){return navigator.maxTouchPoints||"ontouchstart"in this}function yo(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function wx(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function Pu(){return _x(os)}function _x(e){var t=xx,n=yx,i=bx,r=!0,s=Wa("start","brush","end"),a=6,o;function l(g){var v=g.property("__brush",m).selectAll(".overlay").data([ls("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",ze.overlay).merge(v).each(function(){var x=yo(this).extent;D(this).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1])}),g.selectAll(".selection").data([ls("selection")]).enter().append("rect").attr("class","selection").attr("cursor",ze.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=g.selectAll(".handle").data(e.handles,function(x){return x.type});y.exit().remove(),y.enter().append("rect").attr("class",function(x){return"handle handle--"+x.type}).attr("cursor",function(x){return ze[x.type]}),g.each(c).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)")}l.move=function(g,v,y){g.tween?g.on("start.brush",function(x){u(this,arguments).beforestart().start(x)}).on("interrupt.brush end.brush",function(x){u(this,arguments).end(x)}).tween("brush",function(){var x=this,S=x.__brush,_=u(x,arguments),E=S.selection,T=e.input(typeof v=="function"?v.apply(this,arguments):v,S.extent),k=Ui(E,T);function I($){S.selection=$===1&&T===null?null:k($),c.call(x),_.brush()}return E!==null&&T!==null?I:I(1)}):g.each(function(){var x=this,S=arguments,_=x.__brush,E=e.input(typeof v=="function"?v.apply(x,S):v,_.extent),T=u(x,S).beforestart();ho(x),_.selection=E===null?null:E,c.call(x),T.start(y).brush(y).end(y)})},l.clear=function(g,v){l.move(g,null,v)};function c(){var g=D(this),v=yo(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(y){return y.type[y.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(y){return y.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(y){return y.type==="n"||y.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(y){return y.type==="e"||y.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,y){var x=g.__brush.emitter;return x&&(!y||!x.clean)?x:new h(g,v,y)}function h(g,v,y){this.that=g,this.args=v,this.state=g.__brush,this.active=0,this.clean=y}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,y){var x=D(this.that).datum();s.call(g,this.that,new px(g,{sourceEvent:v,target:l,selection:e.output(this.state.selection),mode:y,dispatch:s}),x)}};function d(g){if(o&&!g.touches||!n.apply(this,arguments))return;var v=this,y=g.target.__data__.type,x=(r&&g.metaKey?y="overlay":y)==="selection"?Lu:r&&g.altKey?Qn:Kn,S=e===vo?null:mx[y],_=e===os?null:vx[y],E=yo(v),T=E.extent,k=E.selection,I=T[0][0],$,M,V=T[0][1],C,A,w=T[1][0],N,P,R=T[1][1],U,F,j=0,K=0,ut,G=S&&_&&r&&g.shiftKey,Y,ct,et=Array.from(g.touches||[g],J=>{const kt=J.identifier;return J=Sn(J,v),J.point0=J.slice(),J.identifier=kt,J});ho(v);var Lt=u(v,arguments,!0).beforestart();if(y==="overlay"){k&&(ut=!0);const J=[et[0],et[1]||et[0]];E.selection=k=[[$=e===vo?I:jt(J[0][0],J[1][0]),C=e===os?V:jt(J[0][1],J[1][1])],[N=e===vo?w:zt(J[0][0],J[1][0]),U=e===os?R:zt(J[0][1],J[1][1])]],et.length>1&&Dt(g)}else $=k[0][0],C=k[0][1],N=k[1][0],U=k[1][1];M=$,A=C,P=N,F=U;var z=D(v).attr("pointer-events","none"),Q=z.selectAll(".overlay").attr("cursor",ze[y]);if(g.touches)Lt.moved=H,Lt.ended=vt;else{var at=D(g.view).on("mousemove.brush",H,!0).on("mouseup.brush",vt,!0);r&&at.on("keydown.brush",Qt,!0).on("keyup.brush",Jt,!0),$y(g.view)}c.call(v),Lt.start(g,x.name);function H(J){for(const kt of J.changedTouches||[J])for(const Br of et)Br.identifier===kt.identifier&&(Br.cur=Sn(kt,v));if(G&&!Y&&!ct&&et.length===1){const kt=et[0];Du(kt.cur[0]-kt[0])>Du(kt.cur[1]-kt[1])?ct=!0:Y=!0}for(const kt of et)kt.cur&&(kt[0]=kt.cur[0],kt[1]=kt.cur[1]);ut=!0,go(J),Dt(J)}function Dt(J){const kt=et[0],Br=kt.point0;var bn;switch(j=kt[0]-Br[0],K=kt[1]-Br[1],x){case mo:case Lu:{S&&(j=zt(I-$,jt(w-N,j)),M=$+j,P=N+j),_&&(K=zt(V-C,jt(R-U,K)),A=C+K,F=U+K);break}case Kn:{et[1]?(S&&(M=zt(I,jt(w,et[0][0])),P=zt(I,jt(w,et[1][0])),S=1),_&&(A=zt(V,jt(R,et[0][1])),F=zt(V,jt(R,et[1][1])),_=1)):(S<0?(j=zt(I-$,jt(w-$,j)),M=$+j,P=N):S>0&&(j=zt(I-N,jt(w-N,j)),M=$,P=N+j),_<0?(K=zt(V-C,jt(R-C,K)),A=C+K,F=U):_>0&&(K=zt(V-U,jt(R-U,K)),A=C,F=U+K));break}case Qn:{S&&(M=zt(I,jt(w,$-j*S)),P=zt(I,jt(w,N+j*S))),_&&(A=zt(V,jt(R,C-K*_)),F=zt(V,jt(R,U+K*_)));break}}P<M&&(S*=-1,bn=$,$=N,N=bn,bn=M,M=P,P=bn,y in Iu&&Q.attr("cursor",ze[y=Iu[y]])),F<A&&(_*=-1,bn=C,C=U,U=bn,bn=A,A=F,F=bn,y in Nu&&Q.attr("cursor",ze[y=Nu[y]])),E.selection&&(k=E.selection),Y&&(M=k[0][0],P=k[1][0]),ct&&(A=k[0][1],F=k[1][1]),(k[0][0]!==M||k[0][1]!==A||k[1][0]!==P||k[1][1]!==F)&&(E.selection=[[M,A],[P,F]],c.call(v),Lt.brush(J,x.name))}function vt(J){if(gx(J),J.touches){if(J.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else Ay(J.view,ut),at.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);z.attr("pointer-events","all"),Q.attr("cursor",ze.overlay),E.selection&&(k=E.selection),wx(k)&&(E.selection=null,c.call(v)),Lt.end(J,x.name)}function Qt(J){switch(J.keyCode){case 16:{G=S&&_;break}case 18:{x===Kn&&(S&&(N=P-j*S,$=M+j*S),_&&(U=F-K*_,C=A+K*_),x=Qn,Dt(J));break}case 32:{(x===Kn||x===Qn)&&(S<0?N=P-j:S>0&&($=M-j),_<0?U=F-K:_>0&&(C=A-K),x=mo,Q.attr("cursor",ze.selection),Dt(J));break}default:return}go(J)}function Jt(J){switch(J.keyCode){case 16:{G&&(Y=ct=G=!1,Dt(J));break}case 18:{x===Qn&&(S<0?N=P:S>0&&($=M),_<0?U=F:_>0&&(C=A),x=Kn,Dt(J));break}case 32:{x===mo&&(J.altKey?(S&&(N=P-j*S,$=M+j*S),_&&(U=F-K*_,C=A+K*_),x=Qn):(S<0?N=P:S>0&&($=M),_<0?U=F:_>0&&(C=A),x=Kn),Q.attr("cursor",ze[y]),Dt(J));break}default:return}go(J)}}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=Ru(t.apply(this,arguments)),g.dim=e,g}return l.extent=function(g){return arguments.length?(t=typeof g=="function"?g:po(Ru(g)),l):t},l.filter=function(g){return arguments.length?(n=typeof g=="function"?g:po(!!g),l):n},l.touchable=function(g){return arguments.length?(i=typeof g=="function"?g:po(!!g),l):i},l.handleSize=function(g){return arguments.length?(a=+g,l):a},l.keyModifiers=function(g){return arguments.length?(r=!!g,l):r},l.on=function(){var g=s.on.apply(s,arguments);return g===s?l:g},l}const xo=Math.PI,bo=2*xo,Cn=1e-6,Ex=bo-Cn;function Uu(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Sx(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Uu;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 Ox=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Uu:Sx(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,l=i-t,c=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>Cn)if(!(Math.abs(h*l-c*u)>Cn)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=i-a,p=r-o,m=l*l+c*c,g=f*f+p*p,v=Math.sqrt(m),y=Math.sqrt(d),x=s*Math.tan((xo-Math.acos((m+d-g)/(2*v*y)))/2),S=x/y,_=x/v;Math.abs(S-1)>Cn&&this._append`L${t+S*u},${n+S*h}`,this._append`A${s},${s},0,0,${+(h*f>u*p)},${this._x1=t+_*l},${this._y1=n+_*c}`}}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),l=i*Math.sin(r),c=t+o,u=n+l,h=1^a,d=a?r-s:s-r;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Cn||Math.abs(this._y1-u)>Cn)&&this._append`L${c},${u}`,i&&(d<0&&(d=d%bo+bo),d>Ex?this._append`A${i},${i},0,1,${h},${t-o},${n-l}A${i},${i},0,1,${h},${this._x1=c},${this._y1=u}`:d>Cn&&this._append`A${i},${i},0,${+(d>=xo)},${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 Tx(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function cs(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 Jn(e){return e=cs(Math.abs(e)),e?e[1]:NaN}function Mx(e,t){return function(n,i){for(var r=n.length,s=[],a=0,o=e[0],l=0;r>0&&o>0&&(l+o+1>i&&(o=Math.max(1,i-l)),s.push(n.substring(r-=o,r+o)),!((l+=o+1)>i));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function Cx(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var $x=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Fi(e){if(!(t=$x.exec(e)))throw new Error("invalid format: "+e);var t;return new wo({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]})}Fi.prototype=wo.prototype;function wo(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+""}wo.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 Ax(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 Bu;function Lx(e,t){var n=cs(e,t);if(!n)return e+"";var i=n[0],r=n[1],s=r-(Bu=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")+cs(e,Math.max(0,t+s-1))[0]}function Vu(e,t){var n=cs(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 Hu={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Tx,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)=>Vu(e*100,t),r:Vu,s:Lx,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Gu(e){return e}var Fu=Array.prototype.map,zu=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Dx(e){var t=e.grouping===void 0||e.thousands===void 0?Gu:Mx(Fu.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?Gu:Cx(Fu.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(h){h=Fi(h);var d=h.fill,f=h.align,p=h.sign,m=h.symbol,g=h.zero,v=h.width,y=h.comma,x=h.precision,S=h.trim,_=h.type;_==="n"?(y=!0,_="g"):Hu[_]||(x===void 0&&(x=12),S=!0,_="g"),(g||d==="0"&&f==="=")&&(g=!0,d="0",f="=");var E=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",T=m==="$"?i:/[%p]/.test(_)?a:"",k=Hu[_],I=/[defgprs%]/.test(_);x=x===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function $(M){var V=E,C=T,A,w,N;if(_==="c")C=k(M)+C,M="";else{M=+M;var P=M<0||1/M<0;if(M=isNaN(M)?l:k(Math.abs(M),x),S&&(M=Ax(M)),P&&+M==0&&p!=="+"&&(P=!1),V=(P?p==="("?p:o:p==="-"||p==="("?"":p)+V,C=(_==="s"?zu[8+Bu/3]:"")+C+(P&&p==="("?")":""),I){for(A=-1,w=M.length;++A<w;)if(N=M.charCodeAt(A),48>N||N>57){C=(N===46?r+M.slice(A+1):M.slice(A))+C,M=M.slice(0,A);break}}}y&&!g&&(M=t(M,1/0));var R=V.length+M.length+C.length,U=R<v?new Array(v-R+1).join(d):"";switch(y&&g&&(M=t(U+M,U.length?v-C.length:1/0),U=""),f){case"<":M=V+M+C+U;break;case"=":M=V+U+M+C;break;case"^":M=U.slice(0,R=U.length>>1)+V+M+C+U.slice(R);break;default:M=U+V+M+C;break}return s(M)}return $.toString=function(){return h+""},$}function u(h,d){var f=c((h=Fi(h),h.type="f",h)),p=Math.max(-8,Math.min(8,Math.floor(Jn(d)/3)))*3,m=Math.pow(10,-p),g=zu[8+p/3];return function(v){return f(m*v)+g}}return{format:c,formatPrefix:u}}var us,_o,ju;kx({thousands:",",grouping:[3],currency:["$",""]});function kx(e){return us=Dx(e),_o=us.format,ju=us.formatPrefix,us}function Rx(e){return Math.max(0,-Jn(Math.abs(e)))}function Ix(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Jn(t)/3)))*3-Jn(Math.abs(e)))}function Nx(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Jn(t)-Jn(e))+1}var pt=1e-6,Wu=1e-12,ot=Math.PI,ee=ot/2,qu=ot/4,ce=ot*2,Zt=180/ot,$t=ot/180,gt=Math.abs,Yu=Math.atan,$n=Math.atan2,yt=Math.cos,Px=Math.exp,Ux=Math.log,ft=Math.sin,hn=Math.sign||function(e){return e>0?1:e<0?-1:0},Ee=Math.sqrt,Bx=Math.tan;function Vx(e){return e>1?0:e<-1?ot:Math.acos(e)}function je(e){return e>1?ee:e<-1?-ee:Math.asin(e)}function fe(){}function hs(e,t){e&&Xu.hasOwnProperty(e.type)&&Xu[e.type](e,t)}var Zu={Feature:function(e,t){hs(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)hs(n[i].geometry,t)}},Xu={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){Eo(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)Eo(n[i],t,0)},Polygon:function(e,t){Ku(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)Ku(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)hs(n[i],t)}};function Eo(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 Ku(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)Eo(e[n],t,1);t.polygonEnd()}function ti(e,t){e&&Zu.hasOwnProperty(e.type)?Zu[e.type](e,t):hs(e,t)}function So(e){return[$n(e[1],e[0]),je(e[2])]}function ei(e){var t=e[0],n=e[1],i=yt(n);return[i*yt(t),i*ft(t),ft(n)]}function ds(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function fs(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 Oo(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function ps(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function To(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 Mo(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 Co(e,t){return gt(e)>ot&&(e-=Math.round(e/ce)*ce),[e,t]}Co.invert=Co;function Qu(e,t,n){return(e%=ce)?t||n?Mo(th(e),eh(t,n)):th(e):t||n?eh(t,n):Co}function Ju(e){return function(t,n){return t+=e,gt(t)>ot&&(t-=Math.round(t/ce)*ce),[t,n]}}function th(e){var t=Ju(e);return t.invert=Ju(-e),t}function eh(e,t){var n=yt(e),i=ft(e),r=yt(t),s=ft(t);function a(o,l){var c=yt(l),u=yt(o)*c,h=ft(o)*c,d=ft(l),f=d*n+u*i;return[$n(h*r-f*s,u*n-d*i),je(f*r+h*s)]}return a.invert=function(o,l){var c=yt(l),u=yt(o)*c,h=ft(o)*c,d=ft(l),f=d*r-h*s;return[$n(h*r+d*s,u*n+f*i),je(f*n-u*i)]},a}function Hx(e){e=Qu(e[0]*$t,e[1]*$t,e.length>2?e[2]*$t:0);function t(n){return n=e(n[0]*$t,n[1]*$t),n[0]*=Zt,n[1]*=Zt,n}return t.invert=function(n){return n=e.invert(n[0]*$t,n[1]*$t),n[0]*=Zt,n[1]*=Zt,n},t}function Gx(e,t,n,i,r,s){if(n){var a=yt(t),o=ft(t),l=i*n;r==null?(r=t+i*ce,s=t-l/2):(r=nh(a,r),s=nh(a,s),(i>0?r<s:r>s)&&(r+=i*ce));for(var c,u=r;i>0?u>s:u<s;u-=l)c=So([a,-o*yt(u),-o*ft(u)]),e.point(c[0],c[1])}}function nh(e,t){t=ei(t),t[0]-=e,To(t);var n=Vx(-t[1]);return((-t[2]<0?-n:n)+ce-pt)%ce}function ih(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:fe,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function gs(e,t){return gt(e[0]-t[0])<pt&>(e[1]-t[1])<pt}function ms(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 rh(e,t,n,i,r){var s=[],a=[],o,l;if(e.forEach(function(p){if(!((m=p.length-1)<=0)){var m,g=p[0],v=p[m],y;if(gs(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*pt}s.push(y=new ms(g,p,null,!0)),a.push(y.o=new ms(g,null,y,!1)),s.push(y=new ms(v,p,null,!1)),a.push(y.o=new ms(v,null,y,!0))}}),!!s.length){for(a.sort(t),sh(s),sh(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,h;;){for(var d=c,f=!0;d.v;)if((d=d.n)===c)return;u=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(f)for(o=0,l=u.length;o<l;++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 sh(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 $o(e){return gt(e[0])<=ot?e[0]:hn(e[0])*((gt(e[0])+ot)%ce-ot)}function Fx(e,t){var n=$o(t),i=t[1],r=ft(i),s=[ft(n),-yt(n),0],a=0,o=0,l=new _n;r===1?i=ee+pt:r===-1&&(i=-ee-pt);for(var c=0,u=e.length;c<u;++c)if(d=(h=e[c]).length)for(var h,d,f=h[d-1],p=$o(f),m=f[1]/2+qu,g=ft(m),v=yt(m),y=0;y<d;++y,p=S,g=E,v=T,f=x){var x=h[y],S=$o(x),_=x[1]/2+qu,E=ft(_),T=yt(_),k=S-p,I=k>=0?1:-1,$=I*k,M=$>ot,V=g*E;if(l.add($n(V*I*ft($),v*T+V*yt($))),a+=M?k+I*ce:k,M^p>=n^S>=n){var C=fs(ei(f),ei(x));To(C);var A=fs(s,C);To(A);var w=(M^k>=0?-1:1)*je(A[2]);(i>w||i===w&&(C[0]||C[1]))&&(o+=M^k>=0?1:-1)}}return(a<-pt||a<pt&&l<-Wu)^o&1}function ah(e,t,n,i){return function(r){var s=t(r),a=ih(),o=t(a),l=!1,c,u,h,d={point:f,lineStart:m,lineEnd:g,polygonStart:function(){d.point=v,d.lineStart=y,d.lineEnd=x,u=[],c=[]},polygonEnd:function(){d.point=f,d.lineStart=m,d.lineEnd=g,u=Vc(u);var S=Fx(c,i);u.length?(l||(r.polygonStart(),l=!0),rh(u,jx,S,n,r)):S&&(l||(r.polygonStart(),l=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),l&&(r.polygonEnd(),l=!1),u=c=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function f(S,_){e(S,_)&&r.point(S,_)}function p(S,_){s.point(S,_)}function m(){d.point=p,s.lineStart()}function g(){d.point=f,s.lineEnd()}function v(S,_){h.push([S,_]),o.point(S,_)}function y(){o.lineStart(),h=[]}function x(){v(h[0][0],h[0][1]),o.lineEnd();var S=o.clean(),_=a.result(),E,T=_.length,k,I,$;if(h.pop(),c.push(h),h=null,!!T){if(S&1){if(I=_[0],(k=I.length-1)>0){for(l||(r.polygonStart(),l=!0),r.lineStart(),E=0;E<k;++E)r.point(($=I[E])[0],$[1]);r.lineEnd()}return}T>1&&S&2&&_.push(_.pop().concat(_.shift())),u.push(_.filter(zx))}}return d}}function zx(e){return e.length>1}function jx(e,t){return((e=e.x)[0]<0?e[1]-ee-pt:ee-e[1])-((t=t.x)[0]<0?t[1]-ee-pt:ee-t[1])}const oh=ah(function(){return!0},Wx,Yx,[-ot,-ee]);function Wx(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(s,a){var o=s>0?ot:-ot,l=gt(s-t);gt(l-ot)<pt?(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&&l>=ot&&(gt(t-i)<pt&&(t-=i*pt),gt(s-o)<pt&&(s-=o*pt),n=qx(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 qx(e,t,n,i){var r,s,a=ft(e-n);return gt(a)>pt?Yu((ft(t)*(s=yt(i))*ft(n)-ft(i)*(r=yt(t))*ft(e))/(r*s*a)):(t+i)/2}function Yx(e,t,n,i){var r;if(e==null)r=n*ee,i.point(-ot,r),i.point(0,r),i.point(ot,r),i.point(ot,0),i.point(ot,-r),i.point(0,-r),i.point(-ot,-r),i.point(-ot,0),i.point(-ot,r);else if(gt(e[0]-t[0])>pt){var s=e[0]<t[0]?ot:-ot;r=n*s/2,i.point(-s,r),i.point(0,r),i.point(s,r)}else i.point(t[0],t[1])}function Zx(e){var t=yt(e),n=6*$t,i=t>0,r=gt(t)>pt;function s(u,h,d,f){Gx(f,e,n,d,u,h)}function a(u,h){return yt(u)*yt(h)>t}function o(u){var h,d,f,p,m;return{lineStart:function(){p=f=!1,m=1},point:function(g,v){var y=[g,v],x,S=a(g,v),_=i?S?0:c(g,v):S?c(g+(g<0?ot:-ot),v):0;if(!h&&(p=f=S)&&u.lineStart(),S!==f&&(x=l(h,y),(!x||gs(h,x)||gs(y,x))&&(y[2]=1)),S!==f)m=0,S?(u.lineStart(),x=l(y,h),u.point(x[0],x[1])):(x=l(h,y),u.point(x[0],x[1],2),u.lineEnd()),h=x;else if(r&&h&&i^S){var E;!(_&d)&&(E=l(y,h,!0))&&(m=0,i?(u.lineStart(),u.point(E[0][0],E[0][1]),u.point(E[1][0],E[1][1]),u.lineEnd()):(u.point(E[1][0],E[1][1]),u.lineEnd(),u.lineStart(),u.point(E[0][0],E[0][1],3)))}S&&(!h||!gs(h,y))&&u.point(y[0],y[1]),h=y,f=S,d=_},lineEnd:function(){f&&u.lineEnd(),h=null},clean:function(){return m|(p&&f)<<1}}}function l(u,h,d){var f=ei(u),p=ei(h),m=[1,0,0],g=fs(f,p),v=ds(g,g),y=g[0],x=v-y*y;if(!x)return!d&&u;var S=t*v/x,_=-t*y/x,E=fs(m,g),T=ps(m,S),k=ps(g,_);Oo(T,k);var I=E,$=ds(T,I),M=ds(I,I),V=$*$-M*(ds(T,T)-1);if(!(V<0)){var C=Ee(V),A=ps(I,(-$-C)/M);if(Oo(A,T),A=So(A),!d)return A;var w=u[0],N=h[0],P=u[1],R=h[1],U;N<w&&(U=w,w=N,N=U);var F=N-w,j=gt(F-ot)<pt,K=j||F<pt;if(!j&&R<P&&(U=P,P=R,R=U),K?j?P+R>0^A[1]<(gt(A[0]-w)<pt?P:R):P<=A[1]&&A[1]<=R:F>ot^(w<=A[0]&&A[0]<=N)){var ut=ps(I,(-$+C)/M);return Oo(ut,T),[A,So(ut)]}}}function c(u,h){var d=i?e:ot-e,f=0;return u<-d?f|=1:u>d&&(f|=2),h<-d?f|=4:h>d&&(f|=8),f}return ah(a,o,s,i?[0,-e]:[-ot,e-ot])}function Xx(e,t,n,i,r,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,h=1,d=l-a,f=c-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 zi=1e9,vs=-zi;function Kx(e,t,n,i){function r(c,u){return e<=c&&c<=n&&t<=u&&u<=i}function s(c,u,h,d){var f=0,p=0;if(c==null||(f=a(c,h))!==(p=a(u,h))||l(c,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(c,u){return gt(c[0]-e)<pt?u>0?0:3:gt(c[0]-n)<pt?u>0?2:1:gt(c[1]-t)<pt?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var h=a(c,1),d=a(u,1);return h!==d?h-d:h===0?u[1]-c[1]:h===1?c[0]-u[0]:h===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,h=ih(),d,f,p,m,g,v,y,x,S,_,E,T={point:k,lineStart:V,lineEnd:C,polygonStart:$,polygonEnd:M};function k(w,N){r(w,N)&&u.point(w,N)}function I(){for(var w=0,N=0,P=f.length;N<P;++N)for(var R=f[N],U=1,F=R.length,j=R[0],K,ut,G=j[0],Y=j[1];U<F;++U)K=G,ut=Y,j=R[U],G=j[0],Y=j[1],ut<=i?Y>i&&(G-K)*(i-ut)>(Y-ut)*(e-K)&&++w:Y<=i&&(G-K)*(i-ut)<(Y-ut)*(e-K)&&--w;return w}function $(){u=h,d=[],f=[],E=!0}function M(){var w=I(),N=E&&w,P=(d=Vc(d)).length;(N||P)&&(c.polygonStart(),N&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),P&&rh(d,o,w,s,c),c.polygonEnd()),u=c,d=f=p=null}function V(){T.point=A,f&&f.push(p=[]),_=!0,S=!1,y=x=NaN}function C(){d&&(A(m,g),v&&S&&h.rejoin(),d.push(h.result())),T.point=k,S&&u.lineEnd()}function A(w,N){var P=r(w,N);if(f&&p.push([w,N]),_)m=w,g=N,v=P,_=!1,P&&(u.lineStart(),u.point(w,N));else if(P&&S)u.point(w,N);else{var R=[y=Math.max(vs,Math.min(zi,y)),x=Math.max(vs,Math.min(zi,x))],U=[w=Math.max(vs,Math.min(zi,w)),N=Math.max(vs,Math.min(zi,N))];Xx(R,U,e,t,n,i)?(S||(u.lineStart(),u.point(R[0],R[1])),u.point(U[0],U[1]),P||u.lineEnd(),E=!1):P&&(u.lineStart(),u.point(w,N),E=!1)}y=w,x=N,S=P}return T}}const Ao=e=>e;var Lo=new _n,Do=new _n,lh,ch,ko,Ro,dn={point:fe,lineStart:fe,lineEnd:fe,polygonStart:function(){dn.lineStart=Qx,dn.lineEnd=tb},polygonEnd:function(){dn.lineStart=dn.lineEnd=dn.point=fe,Lo.add(gt(Do)),Do=new _n},result:function(){var e=Lo/2;return Lo=new _n,e}};function Qx(){dn.point=Jx}function Jx(e,t){dn.point=uh,lh=ko=e,ch=Ro=t}function uh(e,t){Do.add(Ro*e-ko*t),ko=e,Ro=t}function tb(){uh(lh,ch)}const hh=dn;var ni=1/0,ys=ni,ji=-ni,xs=ji,eb={point:nb,lineStart:fe,lineEnd:fe,polygonStart:fe,polygonEnd:fe,result:function(){var e=[[ni,ys],[ji,xs]];return ji=xs=-(ys=ni=1/0),e}};function nb(e,t){e<ni&&(ni=e),e>ji&&(ji=e),t<ys&&(ys=t),t>xs&&(xs=t)}const bs=eb;var Io=0,No=0,Wi=0,ws=0,_s=0,ii=0,Po=0,Uo=0,qi=0,dh,fh,Re,Ie,Se={point:An,lineStart:ph,lineEnd:gh,polygonStart:function(){Se.lineStart=sb,Se.lineEnd=ab},polygonEnd:function(){Se.point=An,Se.lineStart=ph,Se.lineEnd=gh},result:function(){var e=qi?[Po/qi,Uo/qi]:ii?[ws/ii,_s/ii]:Wi?[Io/Wi,No/Wi]:[NaN,NaN];return Io=No=Wi=ws=_s=ii=Po=Uo=qi=0,e}};function An(e,t){Io+=e,No+=t,++Wi}function ph(){Se.point=ib}function ib(e,t){Se.point=rb,An(Re=e,Ie=t)}function rb(e,t){var n=e-Re,i=t-Ie,r=Ee(n*n+i*i);ws+=r*(Re+e)/2,_s+=r*(Ie+t)/2,ii+=r,An(Re=e,Ie=t)}function gh(){Se.point=An}function sb(){Se.point=ob}function ab(){mh(dh,fh)}function ob(e,t){Se.point=mh,An(dh=Re=e,fh=Ie=t)}function mh(e,t){var n=e-Re,i=t-Ie,r=Ee(n*n+i*i);ws+=r*(Re+e)/2,_s+=r*(Ie+t)/2,ii+=r,r=Ie*e-Re*t,Po+=r*(Re+e),Uo+=r*(Ie+t),qi+=r*3,An(Re=e,Ie=t)}const vh=Se;function yh(e){this._context=e}yh.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:fe};var Bo=new _n,Vo,xh,bh,Yi,Zi,Es={point:fe,lineStart:function(){Es.point=lb},lineEnd:function(){Vo&&wh(xh,bh),Es.point=fe},polygonStart:function(){Vo=!0},polygonEnd:function(){Vo=null},result:function(){var e=+Bo;return Bo=new _n,e}};function lb(e,t){Es.point=wh,xh=Yi=e,bh=Zi=t}function wh(e,t){Yi-=e,Zi-=t,Bo.add(Ee(Yi*Yi+Zi*Zi)),Yi=e,Zi=t}const _h=Es;let Eh,Ss,Sh,Oh;class Th{constructor(t){this._append=t==null?Mh:cb(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!==Sh||this._append!==Ss){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`,Sh=i,Ss=this._append,Oh=this._,this._=r}this._+=Oh;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Mh(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function cb(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Mh;if(t!==Eh){const n=10**t;Eh=t,Ss=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 Ss}function ub(e,t){let n=3,i=4.5,r,s;function a(o){return o&&(typeof i=="function"&&s.pointRadius(+i.apply(this,arguments)),ti(o,r(s))),s.result()}return a.area=function(o){return ti(o,r(hh)),hh.result()},a.measure=function(o){return ti(o,r(_h)),_h.result()},a.bounds=function(o){return ti(o,r(bs)),bs.result()},a.centroid=function(o){return ti(o,r(vh)),vh.result()},a.projection=function(o){return arguments.length?(r=o==null?(e=null,Ao):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new Th(n)):new yh(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 l=Math.floor(o);if(!(l>=0))throw new RangeError(`invalid digits: ${o}`);n=l}return t===null&&(s=new Th(n)),a},a.projection(e).digits(n).context(t)}function Ho(e){return function(t){var n=new Go;for(var i in e)n[i]=e[i];return n.stream=t,n}}function Go(){}Go.prototype={constructor:Go,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 Fo(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),ti(n,e.stream(bs)),t(bs.result()),i!=null&&e.clipExtent(i),e}function Ch(e,t,n){return Fo(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,l=+t[0][1]+(s-a*(i[1][1]+i[0][1]))/2;e.scale(150*a).translate([o,l])},n)}function hb(e,t,n){return Ch(e,[[0,0],t],n)}function db(e,t,n){return Fo(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 fb(e,t,n){return Fo(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 $h=16,pb=yt(30*$t);function Ah(e,t){return+t?mb(e,t):gb(e)}function gb(e){return Ho({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function mb(e,t){function n(i,r,s,a,o,l,c,u,h,d,f,p,m,g){var v=c-i,y=u-r,x=v*v+y*y;if(x>4*t&&m--){var S=a+d,_=o+f,E=l+p,T=Ee(S*S+_*_+E*E),k=je(E/=T),I=gt(gt(E)-1)<pt||gt(s-h)<pt?(s+h)/2:$n(_,S),$=e(I,k),M=$[0],V=$[1],C=M-i,A=V-r,w=y*C-v*A;(w*w/x>t||gt((v*C+y*A)/x-.5)>.3||a*d+o*f+l*p<pb)&&(n(i,r,s,a,o,l,M,V,I,S/=T,_/=T,E,m,g),g.point(M,V),n(M,V,I,S,_,E,c,u,h,d,f,p,m,g))}}return function(i){var r,s,a,o,l,c,u,h,d,f,p,m,g={point:v,lineStart:y,lineEnd:S,polygonStart:function(){i.polygonStart(),g.lineStart=_},polygonEnd:function(){i.polygonEnd(),g.lineStart=y}};function v(k,I){k=e(k,I),i.point(k[0],k[1])}function y(){h=NaN,g.point=x,i.lineStart()}function x(k,I){var $=ei([k,I]),M=e(k,I);n(h,d,u,f,p,m,h=M[0],d=M[1],u=k,f=$[0],p=$[1],m=$[2],$h,i),i.point(h,d)}function S(){g.point=v,i.lineEnd()}function _(){y(),g.point=E,g.lineEnd=T}function E(k,I){x(r=k,I),s=h,a=d,o=f,l=p,c=m,g.point=x}function T(){n(h,d,u,f,p,m,s,a,r,o,l,c,$h,i),g.lineEnd=S,S()}return g}}var vb=Ho({point:function(e,t){this.stream.point(e*$t,t*$t)}});function yb(e){return Ho({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function xb(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 Lh(e,t,n,i,r,s){if(!s)return xb(e,t,n,i,r);var a=yt(s),o=ft(s),l=a*e,c=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,[l*m-c*g+t,n-c*m-l*g]}return p.invert=function(m,g){return[i*(u*m-h*g+d),r*(f-h*m-u*g)]},p}function Os(e){return Dh(function(){return e})()}function Dh(e){var t,n=150,i=480,r=250,s=0,a=0,o=0,l=0,c=0,u,h=0,d=1,f=1,p=null,m=oh,g=null,v,y,x,S=Ao,_=.5,E,T,k,I,$;function M(w){return k(w[0]*$t,w[1]*$t)}function V(w){return w=k.invert(w[0],w[1]),w&&[w[0]*Zt,w[1]*Zt]}M.stream=function(w){return I&&$===w?I:I=vb(yb(u)(m(E(S($=w)))))},M.preclip=function(w){return arguments.length?(m=w,p=void 0,A()):m},M.postclip=function(w){return arguments.length?(S=w,g=v=y=x=null,A()):S},M.clipAngle=function(w){return arguments.length?(m=+w?Zx(p=w*$t):(p=null,oh),A()):p*Zt},M.clipExtent=function(w){return arguments.length?(S=w==null?(g=v=y=x=null,Ao):Kx(g=+w[0][0],v=+w[0][1],y=+w[1][0],x=+w[1][1]),A()):g==null?null:[[g,v],[y,x]]},M.scale=function(w){return arguments.length?(n=+w,C()):n},M.translate=function(w){return arguments.length?(i=+w[0],r=+w[1],C()):[i,r]},M.center=function(w){return arguments.length?(s=w[0]%360*$t,a=w[1]%360*$t,C()):[s*Zt,a*Zt]},M.rotate=function(w){return arguments.length?(o=w[0]%360*$t,l=w[1]%360*$t,c=w.length>2?w[2]%360*$t:0,C()):[o*Zt,l*Zt,c*Zt]},M.angle=function(w){return arguments.length?(h=w%360*$t,C()):h*Zt},M.reflectX=function(w){return arguments.length?(d=w?-1:1,C()):d<0},M.reflectY=function(w){return arguments.length?(f=w?-1:1,C()):f<0},M.precision=function(w){return arguments.length?(E=Ah(T,_=w*w),A()):Ee(_)},M.fitExtent=function(w,N){return Ch(M,w,N)},M.fitSize=function(w,N){return hb(M,w,N)},M.fitWidth=function(w,N){return db(M,w,N)},M.fitHeight=function(w,N){return fb(M,w,N)};function C(){var w=Lh(n,0,0,d,f,h).apply(null,t(s,a)),N=Lh(n,i-w[0],r-w[1],d,f,h);return u=Qu(o,l,c),T=Mo(t,N),k=Mo(u,T),E=Ah(T,_),A()}function A(){return I=$=null,M}return function(){return t=e.apply(this,arguments),M.invert=t.invert&&V,C()}}function kh(e){var t=0,n=ot/3,i=Dh(e),r=i(t,n);return r.parallels=function(s){return arguments.length?i(t=s[0]*$t,n=s[1]*$t):[t*Zt,n*Zt]},r}function bb(e){var t=yt(e);function n(i,r){return[i*t,ft(r)/t]}return n.invert=function(i,r){return[i/t,je(r*t)]},n}function wb(e,t){var n=ft(e),i=(n+ft(t))/2;if(gt(i)<pt)return bb(e);var r=1+n*(2*i-n),s=Ee(r)/i;function a(o,l){var c=Ee(r-2*i*ft(l))/i;return[c*ft(o*=i),s-c*yt(o)]}return a.invert=function(o,l){var c=s-l,u=$n(o,gt(c))*hn(c);return c*i<0&&(u-=ot*hn(o)*hn(c)),[u/i,je((r-(o*o+c*c)*i*i)/(2*i))]},a}function Rh(){return kh(wb).scale(155.424).center([0,33.6442])}function _b(){return Rh().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function zo(e,t){return[e,Ux(Bx((ee+t)/2))]}zo.invert=function(e,t){return[e,2*Yu(Px(t))-ee]};function Eb(){return Sb(zo).scale(961/ce)}function Sb(e){var t=Os(e),n=t.center,i=t.scale,r=t.translate,s=t.clipExtent,a=null,o,l,c;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=l=c=null:(a=+h[0][0],o=+h[0][1],l=+h[1][0],c=+h[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var h=ot*i(),d=t(Hx(t.rotate()).invert([0,0]));return s(a==null?[[d[0]-h,d[1]-h],[d[0]+h,d[1]+h]]:e===zo?[[Math.max(d[0]-h,a),o],[Math.min(d[0]+h,l),c]]:[[a,Math.max(d[1]-h,o)],[l,Math.min(d[1]+h,c)]])}return u()}function Ts(e,t){return[e,t]}Ts.invert=Ts;function Ob(){return Os(Ts).scale(152.63)}function Tb(e,t){var n=yt(e),i=e===t?ft(e):(n-yt(t))/(t-e),r=n/i+e;if(gt(i)<pt)return Ts;function s(a,o){var l=r-o,c=i*a;return[l*ft(c),r-l*yt(c)]}return s.invert=function(a,o){var l=r-o,c=$n(a,gt(l))*hn(l);return l*i<0&&(c-=ot*hn(a)*hn(l)),[c/i,r-hn(i)*Ee(a*a+l*l)]},s}function Mb(){return kh(Tb).scale(131.154).center([0,13.9389])}var Xi=1.340264,Ki=-.081106,Qi=893e-6,Ji=.003796,Ms=Ee(3)/2,Cb=12;function Ih(e,t){var n=je(Ms*ft(t)),i=n*n,r=i*i*i;return[e*yt(n)/(Ms*(Xi+3*Ki*i+r*(7*Qi+9*Ji*i))),n*(Xi+Ki*i+r*(Qi+Ji*i))]}Ih.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,s=0,a,o,l;s<Cb&&(o=n*(Xi+Ki*i+r*(Qi+Ji*i))-t,l=Xi+3*Ki*i+r*(7*Qi+9*Ji*i),n-=a=o/l,i=n*n,r=i*i*i,!(gt(a)<Wu));++s);return[Ms*e*(Xi+3*Ki*i+r*(7*Qi+9*Ji*i))/yt(n),je(ft(n)/Ms)]};function $b(){return Os(Ih).scale(177.158)}function Nh(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)))]}Nh.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(gt(r)>pt&&--i>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function Ab(){return Os(Nh).scale(175.295)}function Lb(e,t){return e.parent===t.parent?1:2}function Db(e){return e.reduce(kb,0)/e.length}function kb(e,t){return e+t.x}function Rb(e){return 1+e.reduce(Ib,0)}function Ib(e,t){return Math.max(e,t.y)}function Nb(e){for(var t;t=e.children;)e=t[0];return e}function Pb(e){for(var t;t=e.children;)e=t[t.length-1];return e}function Ub(){var e=Lb,t=1,n=1,i=!1;function r(s){var a,o=0;s.eachAfter(function(d){var f=d.children;f?(d.x=Db(f),d.y=Rb(f)):(d.x=a?o+=e(d,a):0,d.y=0,a=d)});var l=Nb(s),c=Pb(s),u=l.x-e(l,c)/2,h=c.x+e(c,l)/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 Bb(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 Vb(){return this.eachAfter(Bb)}function Hb(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function Gb(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 Fb(e,t){for(var n=this,i=[n],r=[],s,a,o,l=-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,++l,this);return this}function zb(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function jb(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 Wb(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function qb(e){for(var t=this,n=Yb(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 Yb(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 Zb(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Xb(){return Array.from(this)}function Kb(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Qb(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Jb(){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 tr(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=nw)):t===void 0&&(t=ew);for(var n=new er(e),i,r=[n],s,a,o,l;i=r.pop();)if((a=t(i.data))&&(l=(a=Array.from(a)).length))for(i.children=a,o=l-1;o>=0;--o)r.push(s=a[o]=new er(a[o])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(rw)}function tw(){return tr(this).eachBefore(iw)}function ew(e){return e.children}function nw(e){return Array.isArray(e)?e[1]:null}function iw(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function rw(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function er(e){this.data=e,this.depth=this.height=0,this.parent=null}er.prototype=tr.prototype={constructor:er,count:Vb,each:Hb,eachAfter:Fb,eachBefore:Gb,find:zb,sum:jb,sort:Wb,path:qb,ancestors:Zb,descendants:Xb,leaves:Kb,links:Qb,copy:tw,[Symbol.iterator]:Jb};function sw(e){return e==null?null:Ph(e)}function Ph(e){if(typeof e!="function")throw new Error;return e}function Ln(){return 0}function ri(e){return function(){return e}}const aw=1664525,ow=1013904223,Uh=4294967296;function lw(){let e=1;return()=>(e=(aw*e+ow)%Uh)/Uh}function cw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function uw(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 hw(e,t){for(var n=0,i=(e=uw(Array.from(e),t)).length,r=[],s,a;n<i;)s=e[n],a&&Bh(a,s)?++n:(a=fw(r=dw(r,s)),n=0);return a}function dw(e,t){var n,i;if(jo(t,e))return[t];for(n=0;n<e.length;++n)if(Cs(t,e[n])&&jo(nr(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(Cs(nr(e[n],e[i]),t)&&Cs(nr(e[n],t),e[i])&&Cs(nr(e[i],t),e[n])&&jo(Vh(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function Cs(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 Bh(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 jo(e,t){for(var n=0;n<t.length;++n)if(!Bh(e,t[n]))return!1;return!0}function fw(e){switch(e.length){case 1:return pw(e[0]);case 2:return nr(e[0],e[1]);case 3:return Vh(e[0],e[1],e[2])}}function pw(e){return{x:e.x,y:e.y,r:e.r}}function nr(e,t){var n=e.x,i=e.y,r=e.r,s=t.x,a=t.y,o=t.r,l=s-n,c=a-i,u=o-r,h=Math.sqrt(l*l+c*c);return{x:(n+s+l/h*u)/2,y:(i+a+c/h*u)/2,r:(h+r+o)/2}}function Vh(e,t,n){var i=e.x,r=e.y,s=e.r,a=t.x,o=t.y,l=t.r,c=n.x,u=n.y,h=n.r,d=i-a,f=i-c,p=r-o,m=r-u,g=l-s,v=h-s,y=i*i+r*r-s*s,x=y-a*a-o*o+l*l,S=y-c*c-u*u+h*h,_=f*p-d*m,E=(p*S-m*x)/(_*2)-i,T=(m*g-p*v)/_,k=(f*x-d*S)/(_*2)-r,I=(d*v-f*g)/_,$=T*T+I*I-1,M=2*(s+E*T+k*I),V=E*E+k*k-s*s,C=-(Math.abs($)>1e-6?(M+Math.sqrt(M*M-4*$*V))/(2*$):V/M);return{x:i+E+T*C,y:r+k+I*C,r:C}}function Hh(e,t,n){var i=e.x-t.x,r,s,a=e.y-t.y,o,l,c=i*i+a*a;c?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(r=(c+l-s)/(2*c),o=Math.sqrt(Math.max(0,l/c-r*r)),n.x=e.x-r*i-o*a,n.y=e.y-r*a+o*i):(r=(c+s-l)/(2*c),o=Math.sqrt(Math.max(0,s/c-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 Gh(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 Fh(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 $s(e){this._=e,this.next=null,this.previous=null}function gw(e,t){if(!(s=(e=cw(e)).length))return 0;var n,i,r,s,a,o,l,c,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;Hh(i,n,r=e[2]),n=new $s(n),i=new $s(i),r=new $s(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;t:for(l=3;l<s;++l){Hh(n._,i._,r=e[l]),r=new $s(r),c=i.next,u=n.previous,h=i._.r,d=n._.r;do if(h<=d){if(Gh(c._,r._)){i=c,n.next=i,i.previous=n,--l;continue t}h+=c._.r,c=c.next}else{if(Gh(u._,r._)){n=u,n.next=i,i.previous=n,--l;continue t}d+=u._.r,u=u.previous}while(c!==u.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,a=Fh(n);(r=r.next)!==i;)(o=Fh(r))<a&&(n=r,a=o);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=hw(n,t),l=0;l<s;++l)n=e[l],n.x-=r.x,n.y-=r.y;return r.r}function mw(e){return Math.sqrt(e.value)}function vw(){var e=null,t=1,n=1,i=Ln;function r(s){const a=lw();return s.x=t/2,s.y=n/2,e?s.eachBefore(zh(e)).eachAfter(Wo(i,.5,a)).eachBefore(jh(1)):s.eachBefore(zh(mw)).eachAfter(Wo(Ln,1,a)).eachAfter(Wo(i,s.r/Math.min(t,n),a)).eachBefore(jh(Math.min(t,n)/(2*s.r))),s}return r.radius=function(s){return arguments.length?(e=sw(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:ri(+s),r):i},r}function zh(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Wo(e,t,n){return function(i){if(r=i.children){var r,s,a=r.length,o=e(i)*t||0,l;if(o)for(s=0;s<a;++s)r[s].r+=o;if(l=gw(r,n),o)for(s=0;s<a;++s)r[s].r-=o;i.r=l+o}}}function jh(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 yw(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 xw(e,t,n,i,r){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(i-t)/e.value;++o<l;)a=s[o],a.y0=n,a.y1=r,a.x0=t,a.x1=t+=a.value*c}function bw(e,t){return e.parent===t.parent?1:2}function qo(e){var t=e.children;return t?t[0]:e.t}function Yo(e){var t=e.children;return t?t[t.length-1]:e.t}function ww(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 _w(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 As(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}As.prototype=Object.create(er.prototype);function Sw(e){for(var t=new As(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 As(s[a],a)),r.parent=n;return(t.parent=new As(null,0)).children=[t],t}function Ow(){var e=bw,t=1,n=1,i=null;function r(c){var u=Sw(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),i)c.eachBefore(l);else{var h=c,d=c,f=c;c.eachBefore(function(y){y.x<h.x&&(h=y),y.x>d.x&&(d=y),y.depth>f.depth&&(f=y)});var p=h===d?1:e(h,d)/2,m=p-h.x,g=t/(d.x+p+m),v=n/(f.depth||1);c.eachBefore(function(y){y.x=(y.x+m)*g,y.y=y.depth*v})}return c}function s(c){var u=c.children,h=c.parent.children,d=c.i?h[c.i-1]:null;if(u){_w(c);var f=(u[0].z+u[u.length-1].z)/2;d?(c.z=d.z+e(c._,d._),c.m=c.z-f):c.z=f}else d&&(c.z=d.z+e(c._,d._));c.parent.A=o(c,d,c.parent.A||h[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,h){if(u){for(var d=c,f=c,p=u,m=d.parent.children[0],g=d.m,v=f.m,y=p.m,x=m.m,S;p=Yo(p),d=qo(d),p&&d;)m=qo(m),f=Yo(f),f.a=c,S=p.z+y-d.z-g+e(p._,d._),S>0&&(ww(Ew(p,c,h),c,S),g+=S,v+=S),y+=p.m,g+=d.m,x+=m.m,v+=f.m;p&&!Yo(f)&&(f.t=p,f.m+=y-v),d&&!qo(m)&&(m.t=d,m.m+=g-x,h=c)}return h}function l(c){c.x*=t,c.y=c.depth*n}return r.separation=function(c){return arguments.length?(e=c,r):e},r.size=function(c){return arguments.length?(i=!1,t=+c[0],n=+c[1],r):i?null:[t,n]},r.nodeSize=function(c){return arguments.length?(i=!0,t=+c[0],n=+c[1],r):i?[t,n]:null},r}function Tw(e,t,n,i,r){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(r-n)/e.value;++o<l;)a=s[o],a.x0=t,a.x1=i,a.y0=n,a.y1=n+=a.value*c}var Mw=(1+Math.sqrt(5))/2;function Cw(e,t,n,i,r,s){for(var a=[],o=t.children,l,c,u=0,h=0,d=o.length,f,p,m=t.value,g,v,y,x,S,_,E;u<d;){f=r-n,p=s-i;do g=o[h++].value;while(!g&&h<d);for(v=y=g,_=Math.max(p/f,f/p)/(m*e),E=g*g*_,S=Math.max(y/E,E/v);h<d;++h){if(g+=c=o[h].value,c<v&&(v=c),c>y&&(y=c),E=g*g*_,x=Math.max(y/E,E/v),x>S){g-=c;break}S=x}a.push(l={value:g,dice:f<p,children:o.slice(u,h)}),l.dice?xw(l,n,i,r,m?i+=p*g/m:s):Tw(l,n,i,m?n+=f*g/m:r,s),m-=g,u=h}return a}const $w=function e(t){function n(i,r,s,a,o){Cw(t,i,r,s,a,o)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(Mw);function Aw(){var e=$w,t=!1,n=1,i=1,r=[0],s=Ln,a=Ln,o=Ln,l=Ln,c=Ln;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(h),r=[0],t&&d.eachBefore(yw),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+=c(d)-f,m+=a(d)-f,g-=o(d)-f,v-=l(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=Ph(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:ri(+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:ri(+d),u):a},u.paddingRight=function(d){return arguments.length?(o=typeof d=="function"?d:ri(+d),u):o},u.paddingBottom=function(d){return arguments.length?(l=typeof d=="function"?d:ri(+d),u):l},u.paddingLeft=function(d){return arguments.length?(c=typeof d=="function"?d:ri(+d),u):c},u}function si(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const Wh=Symbol("implicit");function Ls(){var e=new Nc,t=[],n=[],i=Wh;function r(s){let a=e.get(s);if(a===void 0){if(i!==Wh)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 Nc;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 Ls(t,n).unknown(i)},si.apply(r,arguments),r}function ir(){var e=Ls().unknown(void 0),t=e.domain,n=e.range,i=0,r=1,s,a,o=!1,l=0,c=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-l+c*2),o&&(s=Math.floor(s)),p+=(m-p-s*(d-l))*u,a=s*(1-l),o&&(p=Math.round(p),a=Math.round(a));var g=Uv(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?(l=Math.min(1,c=+d),h()):l},e.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),h()):l},e.paddingOuter=function(d){return arguments.length?(c=+d,h()):c},e.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),h()):u},e.copy=function(){return ir(t(),[i,r]).round(o).paddingInner(l).paddingOuter(c).align(u)},si.apply(h(),arguments)}function Lw(e){return function(){return e}}function Dw(e){return+e}var qh=[0,1];function ai(e){return e}function Zo(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Lw(isNaN(t)?NaN:.5)}function kw(e,t){var n;return e>t&&(n=e,e=t,t=n),function(i){return Math.max(e,Math.min(t,i))}}function Rw(e,t,n){var i=e[0],r=e[1],s=t[0],a=t[1];return r<i?(i=Zo(r,i),s=n(a,s)):(i=Zo(i,r),s=n(s,a)),function(o){return s(i(o))}}function Iw(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]=Zo(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=Va(e,o,1,i)-1;return s[l](r[l](o))}}function Xo(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Yh(){var e=qh,t=qh,n=Ui,i,r,s,a=ai,o,l,c;function u(){var d=Math.min(e.length,t.length);return a!==ai&&(a=kw(e[0],e[d-1])),o=d>2?Iw:Rw,l=c=null,h}function h(d){return d==null||isNaN(d=+d)?s:(l||(l=o(e.map(i),t,n)))(i(a(d)))}return h.invert=function(d){return a(r((c||(c=o(t,e.map(i),le)))(d)))},h.domain=function(d){return arguments.length?(e=Array.from(d,Dw),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=gu,u()},h.clamp=function(d){return arguments.length?(a=d?!0:ai,u()):a!==ai},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 Yh()(ai,ai)}function Nw(e,t,n,i){var r=Ga(e,t,n),s;switch(i=Fi(i??",f"),i.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(s=Ix(r,a))&&(i.precision=s),ju(i,a)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(s=Nx(r,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=s-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(s=Rx(r))&&(i.precision=s-(i.type==="%")*2);break}}return _o(i)}function Xh(e){var t=e.domain;return e.ticks=function(n){var i=t();return Hr(i[0],i[i.length-1],n??10)},e.tickFormat=function(n,i){var r=t();return Nw(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],l,c,u=10;for(o<a&&(c=a,a=o,o=c,c=r,r=s,s=c);u-- >0;){if(c=qn(a,o,n),c===l)return i[r]=a,i[s]=o,t(i);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function Oe(){var e=Zh();return e.copy=function(){return Xo(e,Oe())},si.apply(e,arguments),Xh(e)}function Kh(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 Jh(e){return Math.exp(e)}function Pw(e){return-Math.log(-e)}function Uw(e){return-Math.exp(-e)}function Bw(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Vw(e){return e===10?Bw:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Hw(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 td(e){return(t,n)=>-e(-t,n)}function Gw(e){const t=e(Qh,Jh),n=t.domain;let i=10,r,s;function a(){return r=Hw(i),s=Vw(i),n()[0]<0?(r=td(r),s=td(s),e(Pw,Uw)):e(Qh,Jh),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 l=n();let c=l[0],u=l[l.length-1];const h=u<c;h&&([c,u]=[u,c]);let d=r(c),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),c>0){for(;d<=f;++d)for(p=1;p<i;++p)if(m=d<0?p/s(-d):p*s(d),!(m<c)){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<c)){if(m>u)break;v.push(m)}v.length*2<g&&(v=Hr(c,u,g))}else v=Hr(d,f,Math.min(f-d,g)).map(s);return h?v.reverse():v},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=i===10?"s":","),typeof l!="function"&&(!(i%1)&&(l=Fi(l)).precision==null&&(l.trim=!0),l=_o(l)),o===1/0)return l;const c=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<=c?l(u):""}},t.nice=()=>n(Kh(n(),{floor:o=>s(Math.floor(r(o))),ceil:o=>s(Math.ceil(r(o)))})),t}function ed(){const e=Gw(Yh()).domain([1,10]);return e.copy=()=>Xo(e,ed()).base(e.base()),si.apply(e,arguments),e}function Ko(){var e=0,t=1,n=1,i=[.5],r=[0,1],s;function a(l){return l!=null&&l<=l?r[Va(i,l,0,n)]:s}function o(){var l=-1;for(i=new Array(n);++l<n;)i[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,o()):[e,t]},a.range=function(l){return arguments.length?(n=(r=Array.from(l)).length-1,o()):r.slice()},a.invertExtent=function(l){var c=r.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,i[0]]:c>=n?[i[n-1],t]:[i[c-1],i[c]]},a.unknown=function(l){return arguments.length&&(s=l),a},a.thresholds=function(){return i.slice()},a.copy=function(){return Ko().domain([e,t]).range(r).unknown(s)},si.apply(Xh(a),arguments)}const Qo=new Date,Jo=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 l=[];if(s=r.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;let c;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},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)=>(Qo.setTime(+s),Jo.setTime(+a),e(Qo),e(Jo),Math.floor(n(Qo,Jo))),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 Ds=Rt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ds.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):Ds),Ds.range;const We=1e3,pe=We*60,qe=pe*60,Ye=qe*24,tl=Ye*7,nd=Ye*30,el=Ye*365,oi=Rt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*We)},(e,t)=>(t-e)/We,e=>e.getUTCSeconds());oi.range;const nl=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*We)},(e,t)=>{e.setTime(+e+t*pe)},(e,t)=>(t-e)/pe,e=>e.getMinutes());nl.range,Rt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*pe)},(e,t)=>(t-e)/pe,e=>e.getUTCMinutes()).range;const il=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*We-e.getMinutes()*pe)},(e,t)=>{e.setTime(+e+t*qe)},(e,t)=>(t-e)/qe,e=>e.getHours());il.range,Rt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*qe)},(e,t)=>(t-e)/qe,e=>e.getUTCHours()).range;const rr=Rt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pe)/Ye,e=>e.getDate()-1);rr.range;const rl=Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ye,e=>e.getUTCDate()-1);rl.range,Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ye,e=>Math.floor(e/Ye)).range;function Dn(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())*pe)/tl)}const ks=Dn(0),Rs=Dn(1),Fw=Dn(2),zw=Dn(3),li=Dn(4),jw=Dn(5),Ww=Dn(6);ks.range,Rs.range,Fw.range,zw.range,li.range,jw.range,Ww.range;function kn(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)/tl)}const id=kn(0),Is=kn(1),qw=kn(2),Yw=kn(3),ci=kn(4),Zw=kn(5),Xw=kn(6);id.range,Is.range,qw.range,Yw.range,ci.range,Zw.range,Xw.range;const sl=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());sl.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 Rn=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());Rn.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)}),Rn.range;function Kw(e,t,n,i,r,s){const a=[[oi,1,We],[oi,5,5*We],[oi,15,15*We],[oi,30,30*We],[s,1,pe],[s,5,5*pe],[s,15,15*pe],[s,30,30*pe],[r,1,qe],[r,3,3*qe],[r,6,6*qe],[r,12,12*qe],[i,1,Ye],[i,2,2*Ye],[n,1,tl],[t,1,nd],[t,3,3*nd],[e,1,el]];function o(c,u,h){const d=u<c;d&&([c,u]=[u,c]);const f=h&&typeof h.range=="function"?h:l(c,u,h),p=f?f.range(c,+u+1):[];return d?p.reverse():p}function l(c,u,h){const d=Math.abs(u-c)/h,f=Ba(([,,g])=>g).right(a,d);if(f===a.length)return e.every(Ga(c/el,u/el,h));if(f===0)return Ds.every(Math.max(Ga(c,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,l]}const[Qw,Jw]=Kw(Ze,sl,ks,rr,il,nl);function al(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 ol(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 sr(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function t_(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,s=e.days,a=e.shortDays,o=e.months,l=e.shortMonths,c=ar(r),u=or(r),h=ar(s),d=or(s),f=ar(a),p=or(a),m=ar(o),g=or(o),v=ar(l),y=or(l),x={a:P,A:R,b:U,B:F,c:null,d:cd,e:cd,f:E_,g:k_,G:I_,H:b_,I:w_,j:__,L:ud,m:S_,M:O_,p:j,q:K,Q:md,s:vd,S:T_,u:M_,U:C_,V:$_,w:A_,W:L_,x:null,X:null,y:D_,Y:R_,Z:N_,"%":gd},S={a:ut,A:G,b:Y,B:ct,c:null,d:dd,e:dd,f:V_,g:X_,G:Q_,H:P_,I:U_,j:B_,L:fd,m:H_,M:G_,p:et,q:Lt,Q:md,s:vd,S:F_,u:z_,U:j_,V:W_,w:q_,W:Y_,x:null,X:null,y:Z_,Y:K_,Z:J_,"%":gd},_={a:$,A:M,b:V,B:C,c:A,d:od,e:od,f:m_,g:ad,G:sd,H:ld,I:ld,j:d_,L:g_,m:h_,M:f_,p:I,q:u_,Q:y_,s:x_,S:p_,u:s_,U:a_,V:o_,w:r_,W:l_,x:w,X:N,y:ad,Y:sd,Z:c_,"%":v_};x.x=E(n,x),x.X=E(i,x),x.c=E(t,x),S.x=E(n,S),S.X=E(i,S),S.c=E(t,S);function E(z,Q){return function(at){var H=[],Dt=-1,vt=0,Qt=z.length,Jt,J,kt;for(at instanceof Date||(at=new Date(+at));++Dt<Qt;)z.charCodeAt(Dt)===37&&(H.push(z.slice(vt,Dt)),(J=rd[Jt=z.charAt(++Dt)])!=null?Jt=z.charAt(++Dt):J=Jt==="e"?" ":"0",(kt=Q[Jt])&&(Jt=kt(at,J)),H.push(Jt),vt=Dt+1);return H.push(z.slice(vt,Dt)),H.join("")}}function T(z,Q){return function(at){var H=sr(1900,void 0,1),Dt=k(H,z,at+="",0),vt,Qt;if(Dt!=at.length)return null;if("Q"in H)return new Date(H.Q);if("s"in H)return new Date(H.s*1e3+("L"in H?H.L:0));if(Q&&!("Z"in H)&&(H.Z=0),"p"in H&&(H.H=H.H%12+H.p*12),H.m===void 0&&(H.m="q"in H?H.q:0),"V"in H){if(H.V<1||H.V>53)return null;"w"in H||(H.w=1),"Z"in H?(vt=ol(sr(H.y,0,1)),Qt=vt.getUTCDay(),vt=Qt>4||Qt===0?Is.ceil(vt):Is(vt),vt=rl.offset(vt,(H.V-1)*7),H.y=vt.getUTCFullYear(),H.m=vt.getUTCMonth(),H.d=vt.getUTCDate()+(H.w+6)%7):(vt=al(sr(H.y,0,1)),Qt=vt.getDay(),vt=Qt>4||Qt===0?Rs.ceil(vt):Rs(vt),vt=rr.offset(vt,(H.V-1)*7),H.y=vt.getFullYear(),H.m=vt.getMonth(),H.d=vt.getDate()+(H.w+6)%7)}else("W"in H||"U"in H)&&("w"in H||(H.w="u"in H?H.u%7:"W"in H?1:0),Qt="Z"in H?ol(sr(H.y,0,1)).getUTCDay():al(sr(H.y,0,1)).getDay(),H.m=0,H.d="W"in H?(H.w+6)%7+H.W*7-(Qt+5)%7:H.w+H.U*7-(Qt+6)%7);return"Z"in H?(H.H+=H.Z/100|0,H.M+=H.Z%100,ol(H)):al(H)}}function k(z,Q,at,H){for(var Dt=0,vt=Q.length,Qt=at.length,Jt,J;Dt<vt;){if(H>=Qt)return-1;if(Jt=Q.charCodeAt(Dt++),Jt===37){if(Jt=Q.charAt(Dt++),J=_[Jt in rd?Q.charAt(Dt++):Jt],!J||(H=J(z,at,H))<0)return-1}else if(Jt!=at.charCodeAt(H++))return-1}return H}function I(z,Q,at){var H=c.exec(Q.slice(at));return H?(z.p=u.get(H[0].toLowerCase()),at+H[0].length):-1}function $(z,Q,at){var H=f.exec(Q.slice(at));return H?(z.w=p.get(H[0].toLowerCase()),at+H[0].length):-1}function M(z,Q,at){var H=h.exec(Q.slice(at));return H?(z.w=d.get(H[0].toLowerCase()),at+H[0].length):-1}function V(z,Q,at){var H=v.exec(Q.slice(at));return H?(z.m=y.get(H[0].toLowerCase()),at+H[0].length):-1}function C(z,Q,at){var H=m.exec(Q.slice(at));return H?(z.m=g.get(H[0].toLowerCase()),at+H[0].length):-1}function A(z,Q,at){return k(z,t,Q,at)}function w(z,Q,at){return k(z,n,Q,at)}function N(z,Q,at){return k(z,i,Q,at)}function P(z){return a[z.getDay()]}function R(z){return s[z.getDay()]}function U(z){return l[z.getMonth()]}function F(z){return o[z.getMonth()]}function j(z){return r[+(z.getHours()>=12)]}function K(z){return 1+~~(z.getMonth()/3)}function ut(z){return a[z.getUTCDay()]}function G(z){return s[z.getUTCDay()]}function Y(z){return l[z.getUTCMonth()]}function ct(z){return o[z.getUTCMonth()]}function et(z){return r[+(z.getUTCHours()>=12)]}function Lt(z){return 1+~~(z.getUTCMonth()/3)}return{format:function(z){var Q=E(z+="",x);return Q.toString=function(){return z},Q},parse:function(z){var Q=T(z+="",!1);return Q.toString=function(){return z},Q},utcFormat:function(z){var Q=E(z+="",S);return Q.toString=function(){return z},Q},utcParse:function(z){var Q=T(z+="",!0);return Q.toString=function(){return z},Q}}}var rd={"-":"",_:" ",0:"0"},Bt=/^\s*\d+/,e_=/^%/,n_=/[\\^$*+?|[\]().{}]/g;function ht(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 i_(e){return e.replace(n_,"\\$&")}function ar(e){return new RegExp("^(?:"+e.map(i_).join("|")+")","i")}function or(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function r_(e,t,n){var i=Bt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function s_(e,t,n){var i=Bt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function a_(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function o_(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function l_(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function sd(e,t,n){var i=Bt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function ad(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 c_(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 u_(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 h_(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 od(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function d_(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 ld(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function f_(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function p_(e,t,n){var i=Bt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function g_(e,t,n){var i=Bt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function m_(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 v_(e,t,n){var i=e_.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function y_(e,t,n){var i=Bt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function x_(e,t,n){var i=Bt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function cd(e,t){return ht(e.getDate(),t,2)}function b_(e,t){return ht(e.getHours(),t,2)}function w_(e,t){return ht(e.getHours()%12||12,t,2)}function __(e,t){return ht(1+rr.count(Ze(e),e),t,3)}function ud(e,t){return ht(e.getMilliseconds(),t,3)}function E_(e,t){return ud(e,t)+"000"}function S_(e,t){return ht(e.getMonth()+1,t,2)}function O_(e,t){return ht(e.getMinutes(),t,2)}function T_(e,t){return ht(e.getSeconds(),t,2)}function M_(e){var t=e.getDay();return t===0?7:t}function C_(e,t){return ht(ks.count(Ze(e)-1,e),t,2)}function hd(e){var t=e.getDay();return t>=4||t===0?li(e):li.ceil(e)}function $_(e,t){return e=hd(e),ht(li.count(Ze(e),e)+(Ze(e).getDay()===4),t,2)}function A_(e){return e.getDay()}function L_(e,t){return ht(Rs.count(Ze(e)-1,e),t,2)}function D_(e,t){return ht(e.getFullYear()%100,t,2)}function k_(e,t){return e=hd(e),ht(e.getFullYear()%100,t,2)}function R_(e,t){return ht(e.getFullYear()%1e4,t,4)}function I_(e,t){var n=e.getDay();return e=n>=4||n===0?li(e):li.ceil(e),ht(e.getFullYear()%1e4,t,4)}function N_(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ht(t/60|0,"0",2)+ht(t%60,"0",2)}function dd(e,t){return ht(e.getUTCDate(),t,2)}function P_(e,t){return ht(e.getUTCHours(),t,2)}function U_(e,t){return ht(e.getUTCHours()%12||12,t,2)}function B_(e,t){return ht(1+rl.count(Rn(e),e),t,3)}function fd(e,t){return ht(e.getUTCMilliseconds(),t,3)}function V_(e,t){return fd(e,t)+"000"}function H_(e,t){return ht(e.getUTCMonth()+1,t,2)}function G_(e,t){return ht(e.getUTCMinutes(),t,2)}function F_(e,t){return ht(e.getUTCSeconds(),t,2)}function z_(e){var t=e.getUTCDay();return t===0?7:t}function j_(e,t){return ht(id.count(Rn(e)-1,e),t,2)}function pd(e){var t=e.getUTCDay();return t>=4||t===0?ci(e):ci.ceil(e)}function W_(e,t){return e=pd(e),ht(ci.count(Rn(e),e)+(Rn(e).getUTCDay()===4),t,2)}function q_(e){return e.getUTCDay()}function Y_(e,t){return ht(Is.count(Rn(e)-1,e),t,2)}function Z_(e,t){return ht(e.getUTCFullYear()%100,t,2)}function X_(e,t){return e=pd(e),ht(e.getUTCFullYear()%100,t,2)}function K_(e,t){return ht(e.getUTCFullYear()%1e4,t,4)}function Q_(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ci(e):ci.ceil(e),ht(e.getUTCFullYear()%1e4,t,4)}function J_(){return"+0000"}function gd(){return"%"}function md(e){return+e}function vd(e){return Math.floor(+e/1e3)}var ui,yd;tE({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 tE(e){return ui=t_(e),yd=ui.format,ui.parse,ui.utcFormat,ui.utcParse,ui}function eE(e){return new Date(e)}function nE(e){return e instanceof Date?+e:+new Date(+e)}function xd(e,t,n,i,r,s,a,o,l,c){var u=Zh(),h=u.invert,d=u.domain,f=c(".%L"),p=c(":%S"),m=c("%I:%M"),g=c("%I %p"),v=c("%a %d"),y=c("%b %d"),x=c("%B"),S=c("%Y");function _(E){return(l(E)<E?f:o(E)<E?p:a(E)<E?m:s(E)<E?g:i(E)<E?r(E)<E?v:y:n(E)<E?x:S)(E)}return u.invert=function(E){return new Date(h(E))},u.domain=function(E){return arguments.length?d(Array.from(E,nE)):d().map(eE)},u.ticks=function(E){var T=d();return e(T[0],T[T.length-1],E??10)},u.tickFormat=function(E,T){return T==null?_:c(T)},u.nice=function(E){var T=d();return(!E||typeof E.range!="function")&&(E=t(T[0],T[T.length-1],E??10)),E?d(Kh(T,E)):u},u.copy=function(){return Xo(u,xd(e,t,n,i,r,s,a,o,l,c))},u}function bd(){return si.apply(xd(Qw,Jw,Ze,sl,ks,rr,il,nl,oi,yd).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function st(e){return function(){return e}}const wd=Math.abs,Wt=Math.atan2,In=Math.cos,iE=Math.max,ll=Math.min,Ne=Math.sin,hi=Math.sqrt,qt=1e-12,lr=Math.PI,Ns=lr/2,Ps=2*lr;function rE(e){return e>1?0:e<-1?lr:Math.acos(e)}function _d(e){return e>=1?Ns:e<=-1?-Ns:Math.asin(e)}function Us(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 Ox(t)}function sE(e){return e.innerRadius}function aE(e){return e.outerRadius}function oE(e){return e.startAngle}function lE(e){return e.endAngle}function cE(e){return e&&e.padAngle}function uE(e,t,n,i,r,s,a,o){var l=n-e,c=i-t,u=a-r,h=o-s,d=h*l-u*c;if(!(d*d<qt))return d=(u*(t-s)-h*(e-r))/d,[e+d*l,t+d*c]}function Bs(e,t,n,i,r,s,a){var o=e-n,l=t-i,c=(a?s:-s)/hi(o*o+l*l),u=c*l,h=-c*o,d=e+u,f=t+h,p=n+u,m=i+h,g=(d+p)/2,v=(f+m)/2,y=p-d,x=m-f,S=y*y+x*x,_=r-s,E=d*m-p*f,T=(x<0?-1:1)*hi(iE(0,_*_*S-E*E)),k=(E*x-y*T)/S,I=(-E*y-x*T)/S,$=(E*x+y*T)/S,M=(-E*y+x*T)/S,V=k-g,C=I-v,A=$-g,w=M-v;return V*V+C*C>A*A+w*w&&(k=$,I=M),{cx:k,cy:I,x01:-u,y01:-h,x11:k*(r/_-1),y11:I*(r/_-1)}}function cr(){var e=sE,t=aE,n=st(0),i=null,r=oE,s=lE,a=cE,o=null,l=Us(c);function c(){var u,h,d=+e.apply(this,arguments),f=+t.apply(this,arguments),p=r.apply(this,arguments)-Ns,m=s.apply(this,arguments)-Ns,g=wd(m-p),v=m>p;if(o||(o=u=l()),f<d&&(h=f,f=d,d=h),!(f>qt))o.moveTo(0,0);else if(g>Ps-qt)o.moveTo(f*In(p),f*Ne(p)),o.arc(0,0,f,p,m,!v),d>qt&&(o.moveTo(d*In(m),d*Ne(m)),o.arc(0,0,d,m,p,v));else{var y=p,x=m,S=p,_=m,E=g,T=g,k=a.apply(this,arguments)/2,I=k>qt&&(i?+i.apply(this,arguments):hi(d*d+f*f)),$=ll(wd(f-d)/2,+n.apply(this,arguments)),M=$,V=$,C,A;if(I>qt){var w=_d(I/d*Ne(k)),N=_d(I/f*Ne(k));(E-=w*2)>qt?(w*=v?1:-1,S+=w,_-=w):(E=0,S=_=(p+m)/2),(T-=N*2)>qt?(N*=v?1:-1,y+=N,x-=N):(T=0,y=x=(p+m)/2)}var P=f*In(y),R=f*Ne(y),U=d*In(_),F=d*Ne(_);if($>qt){var j=f*In(x),K=f*Ne(x),ut=d*In(S),G=d*Ne(S),Y;if(g<lr)if(Y=uE(P,R,ut,G,j,K,U,F)){var ct=P-Y[0],et=R-Y[1],Lt=j-Y[0],z=K-Y[1],Q=1/Ne(rE((ct*Lt+et*z)/(hi(ct*ct+et*et)*hi(Lt*Lt+z*z)))/2),at=hi(Y[0]*Y[0]+Y[1]*Y[1]);M=ll($,(d-at)/(Q-1)),V=ll($,(f-at)/(Q+1))}else M=V=0}T>qt?V>qt?(C=Bs(ut,G,P,R,f,V,v),A=Bs(j,K,U,F,f,V,v),o.moveTo(C.cx+C.x01,C.cy+C.y01),V<$?o.arc(C.cx,C.cy,V,Wt(C.y01,C.x01),Wt(A.y01,A.x01),!v):(o.arc(C.cx,C.cy,V,Wt(C.y01,C.x01),Wt(C.y11,C.x11),!v),o.arc(0,0,f,Wt(C.cy+C.y11,C.cx+C.x11),Wt(A.cy+A.y11,A.cx+A.x11),!v),o.arc(A.cx,A.cy,V,Wt(A.y11,A.x11),Wt(A.y01,A.x01),!v))):(o.moveTo(P,R),o.arc(0,0,f,y,x,!v)):o.moveTo(P,R),!(d>qt)||!(E>qt)?o.lineTo(U,F):M>qt?(C=Bs(U,F,j,K,d,-M,v),A=Bs(P,R,ut,G,d,-M,v),o.lineTo(C.cx+C.x01,C.cy+C.y01),M<$?o.arc(C.cx,C.cy,M,Wt(C.y01,C.x01),Wt(A.y01,A.x01),!v):(o.arc(C.cx,C.cy,M,Wt(C.y01,C.x01),Wt(C.y11,C.x11),!v),o.arc(0,0,d,Wt(C.cy+C.y11,C.cx+C.x11),Wt(A.cy+A.y11,A.cx+A.x11),v),o.arc(A.cx,A.cy,M,Wt(A.y11,A.x11),Wt(A.y01,A.x01),!v))):o.arc(0,0,d,_,S,v)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,h=(+r.apply(this,arguments)+ +s.apply(this,arguments))/2-lr/2;return[In(h)*u,Ne(h)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:st(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:st(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:st(+u),c):n},c.padRadius=function(u){return arguments.length?(i=u==null?null:typeof u=="function"?u:st(+u),c):i},c.startAngle=function(u){return arguments.length?(r=typeof u=="function"?u:st(+u),c):r},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:st(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:st(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}var hE=Array.prototype.slice;function Vs(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ed(e){this._context=e}Ed.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 Hs(e){return new Ed(e)}function cl(e){return e[0]}function ul(e){return e[1]}function ur(e,t){var n=st(!0),i=null,r=Hs,s=null,a=Us(o);e=typeof e=="function"?e:e===void 0?cl:st(e),t=typeof t=="function"?t:t===void 0?ul:st(t);function o(l){var c,u=(l=Vs(l)).length,h,d=!1,f;for(i==null&&(s=r(f=a())),c=0;c<=u;++c)!(c<u&&n(h=l[c],c,l))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+e(h,c,l),+t(h,c,l));if(f)return s=null,f+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:st(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:st(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:st(!!l),o):n},o.curve=function(l){return arguments.length?(r=l,i!=null&&(s=r(i)),o):r},o.context=function(l){return arguments.length?(l==null?i=s=null:s=r(i=l),o):i},o}function hl(e,t,n){var i=null,r=st(!0),s=null,a=Hs,o=null,l=Us(c);e=typeof e=="function"?e:e===void 0?cl:st(+e),t=typeof t=="function"?t:st(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?ul:st(+n);function c(h){var d,f,p,m=(h=Vs(h)).length,g,v=!1,y,x=new Array(m),S=new Array(m);for(s==null&&(o=a(y=l())),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(x[p],S[p]);o.lineEnd(),o.areaEnd()}v&&(x[d]=+e(g,d,h),S[d]=+t(g,d,h),o.point(i?+i(g,d,h):x[d],n?+n(g,d,h):S[d]))}if(y)return o=null,y+""||null}function u(){return ur().defined(r).curve(a).context(s)}return c.x=function(h){return arguments.length?(e=typeof h=="function"?h:st(+h),i=null,c):e},c.x0=function(h){return arguments.length?(e=typeof h=="function"?h:st(+h),c):e},c.x1=function(h){return arguments.length?(i=h==null?null:typeof h=="function"?h:st(+h),c):i},c.y=function(h){return arguments.length?(t=typeof h=="function"?h:st(+h),n=null,c):t},c.y0=function(h){return arguments.length?(t=typeof h=="function"?h:st(+h),c):t},c.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:st(+h),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(i).y(t)},c.defined=function(h){return arguments.length?(r=typeof h=="function"?h:st(!!h),c):r},c.curve=function(h){return arguments.length?(a=h,s!=null&&(o=a(s)),c):a},c.context=function(h){return arguments.length?(h==null?s=o=null:o=a(s=h),c):s},c}function dE(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function fE(e){return e}function pE(){var e=fE,t=dE,n=null,i=st(0),r=st(Ps),s=st(0);function a(o){var l,c=(o=Vs(o)).length,u,h,d=0,f=new Array(c),p=new Array(c),m=+i.apply(this,arguments),g=Math.min(Ps,Math.max(-Ps,r.apply(this,arguments)-m)),v,y=Math.min(Math.abs(g)/c,s.apply(this,arguments)),x=y*(g<0?-1:1),S;for(l=0;l<c;++l)(S=p[f[l]=l]=+e(o[l],l,o))>0&&(d+=S);for(t!=null?f.sort(function(_,E){return t(p[_],p[E])}):n!=null&&f.sort(function(_,E){return n(o[_],o[E])}),l=0,h=d?(g-c*x)/d:0;l<c;++l,m=v)u=f[l],S=p[u],v=m+(S>0?S*h:0)+x,p[u]={data:o[u],index:l,value:S,startAngle:m,endAngle:v,padAngle:y};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:st(+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:st(+o),a):i},a.endAngle=function(o){return arguments.length?(r=typeof o=="function"?o:st(+o),a):r},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:st(+o),a):s},a}var gE=Od(Hs);function Sd(e){this._curve=e}Sd.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 Od(e){function t(n){return new Sd(e(n))}return t._curve=e,t}function mE(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(Od(n)):t()._curve},e}function vE(){return mE(ur().curve(gE))}class yE{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 xE(e){return new yE(e,!0)}function bE(e){return e.source}function wE(e){return e.target}function _E(e){let t=bE,n=wE,i=cl,r=ul,s=null,a=null,o=Us(l);function l(){let c;const u=hE.call(arguments),h=t.apply(this,u),d=n.apply(this,u);if(s==null&&(a=e(c=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(),c)return a=null,c+""||null}return l.source=function(c){return arguments.length?(t=c,l):t},l.target=function(c){return arguments.length?(n=c,l):n},l.x=function(c){return arguments.length?(i=typeof c=="function"?c:st(+c),l):i},l.y=function(c){return arguments.length?(r=typeof c=="function"?c:st(+c),l):r},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function EE(){return _E(xE)}function fn(){}function Gs(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 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=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Gs(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:Gs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function SE(e){return new Fs(e)}function Td(e){this._context=e}Td.prototype={areaStart:fn,areaEnd:fn,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:Gs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OE(e){return new Td(e)}function Md(e){this._context=e}Md.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:Gs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function TE(e){return new Md(e)}function Cd(e,t){this._basis=new Fs(e),this._beta=t}Cd.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,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(i+l*s),this._beta*t[o]+(1-this._beta)*(r+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const ME=function e(t){function n(i){return t===1?new Fs(i):new Cd(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function zs(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 dl(e,t){this._context=e,this._k=(1-t)/6}dl.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:zs(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:zs(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 CE=function e(t){function n(i){return new dl(i,t)}return n.tension=function(i){return e(+i)},n}(0);function fl(e,t){this._context=e,this._k=(1-t)/6}fl.prototype={areaStart:fn,areaEnd:fn,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:zs(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 $E=function e(t){function n(i){return new fl(i,t)}return n.tension=function(i){return e(+i)},n}(0);function pl(e,t){this._context=e,this._k=(1-t)/6}pl.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:zs(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 AE=function e(t){function n(i){return new pl(i,t)}return n.tension=function(i){return e(+i)},n}(0);function gl(e,t,n){var i=e._x1,r=e._y1,s=e._x2,a=e._y2;if(e._l01_a>qt){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>qt){var c=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*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(i,r,s,a,e._x2,e._y2)}function $d(e,t){this._context=e,this._alpha=t}$d.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:gl(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 LE=function e(t){function n(i){return t?new $d(i,t):new dl(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function Ad(e,t){this._context=e,this._alpha=t}Ad.prototype={areaStart:fn,areaEnd:fn,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:gl(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 DE=function e(t){function n(i){return t?new Ad(i,t):new fl(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function Ld(e,t){this._context=e,this._alpha=t}Ld.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:gl(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 kE=function e(t){function n(i){return t?new Ld(i,t):new pl(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function Dd(e){this._context=e}Dd.prototype={areaStart:fn,areaEnd:fn,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 kd(e){return new Dd(e)}function Rd(e){return e<0?-1:1}function Id(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(Rd(s)+Rd(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Nd(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ml(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 js(e){this._context=e}js.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:ml(this,this._t0,Nd(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,ml(this,Nd(this,n=Id(this,e,t)),n);break;default:ml(this,this._t0,n=Id(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Pd(e){this._context=new Ud(e)}(Pd.prototype=Object.create(js.prototype)).point=function(e,t){js.prototype.point.call(this,t,e)};function Ud(e){this._context=e}Ud.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 RE(e){return new js(e)}function IE(e){return new Pd(e)}function Bd(e){this._context=e}Bd.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=Vd(e),r=Vd(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 Vd(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 NE(e){return new Bd(e)}function Ws(e,t){this._context=e,this._t=t}Ws.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 PE(e){return new Ws(e,.5)}function UE(e){return new Ws(e,0)}function BE(e){return new Ws(e,1)}function Hd(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 Gd(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function VE(e,t){return e[t]}function HE(e){const t=[];return t.key=e,t}function vl(){var e=st([]),t=Gd,n=Hd,i=VE;function r(s){var a=Array.from(e.apply(this,arguments),HE),o,l=a.length,c=-1,u;for(const h of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+i(h,a[o].key,c,s)]).data=h;for(o=0,u=Vs(t(a));o<l;++o)a[u[o]].index=o;return n(a,u),a}return r.keys=function(s){return arguments.length?(e=typeof s=="function"?s:st(Array.from(s)),r):e},r.value=function(s){return arguments.length?(i=typeof s=="function"?s:st(+s),r):i},r.order=function(s){return arguments.length?(t=s==null?Gd:typeof s=="function"?s:st(Array.from(s)),r):t},r.offset=function(s){return arguments.length?(n=s??Hd,r):n},r}function GE(e,t){if((l=e.length)>0)for(var n,i=0,r,s,a,o,l,c=e[t[0]].length;i<c;++i)for(a=o=0,n=0;n<l;++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 hr(e,t,n){this.k=e,this.x=t,this.y=n}hr.prototype={constructor:hr,scale:function(e){return e===1?this:new hr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new hr(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+")"}},hr.prototype;var Fd=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Fd||{}),zd=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(zd||{}),jd=(e=>(e.UPDATE="model-update",e))(jd||{}),Wd=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e))(Wd||{}),qd=(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))(qd||{}),Yd=(e=>(e.CHANGE="zoom-domain-change",e))(Yd||{}),Zd=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(Zd||{}),Xd=(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))(Xd||{}),Kd=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Kd||{}),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||{}),Jd=(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))(Jd||{}),tf=(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))(tf||{}),ef=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(ef||{}),nf=(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))(nf||{}),rf=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(rf||{}),sf=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(sf||{}),af=(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))(af||{}),of=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(of||{}),lf=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(lf||{}),dr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(dr||{}),cf=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(cf||{}),uf=(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))(uf||{}),hf=(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))(hf||{}),df=(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))(df||{}),ff=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(ff||{}),pf=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(pf||{}),di=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(di||{});const FE=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:df,Area:Kd,Axis:Xd,Bar:ef,Boxplot:nf,CanvasZoom:Zd,Chart:Fd,Choropleth:di,CirclePack:hf,Gauge:tf,Heatmap:pf,Legend:uf,Line:sf,Meter:ff,Modal:zd,Model:jd,Pie:Jd,Radar:af,Scatter:rf,Threshold:cf,Toolbar:Wd,Tooltip:dr,Tree:of,Treemap:lf,WordCloud:Qd,ZoomBar:qd,ZoomDomain:Yd},Symbol.toStringTag,{value:"Module"})),O=FE;var q=(e=>(e.HTML="html",e.SVG="svg",e))(q||{}),gf=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(gf||{}),Z=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(Z||{}),B=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(B||{}),Pe=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Pe||{}),Te=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Te||{}),Vt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Vt||{}),W=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(W||{}),fr=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(fr||{}),It=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(It||{}),pr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(pr||{}),yl=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(yl||{}),bt=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(bt||{}),tt=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(tt||{}),fi=(e=>(e.CENTER="center",e))(fi||{}),qs=(e=>(e.LEFT="left",e.RIGHT="right",e))(qs||{}),Nt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Nt||{}),Xe=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(Xe||{}),Ke=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(Ke||{}),pi=(e=>(e.SEMI="semi",e.FULL="full",e))(pi||{}),xl=(e=>(e.UP="up",e.DOWN="down",e))(xl||{}),Ys=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(Ys||{}),Zs=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(Zs||{}),ge=(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))(ge||{}),Mt=(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))(Mt||{}),bl=(e=>(e.LEFT="left",e.RIGHT="right",e))(bl||{}),Pt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(Pt||{}),Xs=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(Xs||{}),gr=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(gr||{}),Ks=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(Ks||{}),Qe=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(Qe||{});function wl(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 mr(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,l=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[o]}var c=e.argumentCallback?e.argumentCallback(t):t;return r[c]}}function vr(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],l=Array.isArray(o)?jE(o,function(h){return h.test(a)}):zE(o,function(h){return h.test(a)}),c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=t.slice(a.length);return{value:c,rest:u}}}function zE(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function jE(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function WE(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 Qs(e){"@babel/helpers - typeof";return Qs=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},Qs(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 it(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function dt(e){it(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Qs(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 Js(e,t){it(2,arguments);var n=dt(e).getTime(),i=Ut(t);return new Date(n+i)}var qE={};function ta(){return qE}function _l(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 YE(e){return it(1,arguments),e instanceof Date||Qs(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ZE(e){if(it(1,arguments),!YE(e)&&typeof e!="number")return!1;var t=dt(e);return!isNaN(Number(t))}function XE(e,t){it(2,arguments);var n=Ut(t);return Js(e,-n)}var KE=864e5;function QE(e){it(1,arguments);var t=dt(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/KE)+1}function ea(e){it(1,arguments);var t=1,n=dt(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 mf(e){it(1,arguments);var t=dt(e),n=t.getUTCFullYear(),i=new Date(0);i.setUTCFullYear(n+1,0,4),i.setUTCHours(0,0,0,0);var r=ea(i),s=new Date(0);s.setUTCFullYear(n,0,4),s.setUTCHours(0,0,0,0);var a=ea(s);return t.getTime()>=r.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function JE(e){it(1,arguments);var t=mf(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var i=ea(n);return i}var tS=6048e5;function eS(e){it(1,arguments);var t=dt(e),n=ea(t).getTime()-JE(t).getTime();return Math.round(n/tS)+1}function na(e,t){var n,i,r,s,a,o,l,c;it(1,arguments);var u=ta(),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:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.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=dt(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 vf(e,t){var n,i,r,s,a,o,l,c;it(1,arguments);var u=dt(e),h=u.getUTCFullYear(),d=ta(),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:(l=d.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.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=na(p,t),g=new Date(0);g.setUTCFullYear(h,0,f),g.setUTCHours(0,0,0,0);var v=na(g,t);return u.getTime()>=m.getTime()?h+1:u.getTime()>=v.getTime()?h:h-1}function nS(e,t){var n,i,r,s,a,o,l,c;it(1,arguments);var u=ta(),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:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=vf(e,t),f=new Date(0);f.setUTCFullYear(d,0,h),f.setUTCHours(0,0,0,0);var p=na(f,t);return p}var iS=6048e5;function rS(e,t){it(1,arguments);var n=dt(e),i=na(n,t).getTime()-nS(n,t).getTime();return Math.round(i/iS)+1}function mt(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}var sS={y:function(e,t){var n=e.getUTCFullYear(),i=n>0?n:1-n;return mt(t==="yy"?i%100:i,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):mt(n+1,2)},d:function(e,t){return mt(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 mt(e.getUTCHours()%12||12,t.length)},H:function(e,t){return mt(e.getUTCHours(),t.length)},m:function(e,t){return mt(e.getUTCMinutes(),t.length)},s:function(e,t){return mt(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 mt(r,t.length)}};const pn=sS;var gi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},aS={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 pn.y(e,t)},Y:function(e,t,n,i){var r=vf(e,i),s=r>0?r:1-r;if(t==="YY"){var a=s%100;return mt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):mt(s,t.length)},R:function(e,t){var n=mf(e);return mt(n,t.length)},u:function(e,t){var n=e.getUTCFullYear();return mt(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 mt(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 mt(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 pn.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 mt(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=rS(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):mt(r,t.length)},I:function(e,t,n){var i=eS(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):mt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):pn.d(e,t)},D:function(e,t,n){var i=QE(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):mt(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 mt(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 mt(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 mt(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=gi.noon:i===0?r=gi.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=gi.evening:i>=12?r=gi.afternoon:i>=4?r=gi.morning:r=gi.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 pn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):pn.H(e,t)},K:function(e,t,n){var i=e.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):mt(i,t.length)},k:function(e,t,n){var i=e.getUTCHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):mt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):pn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):pn.s(e,t)},S:function(e,t){return pn.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 xf(s);case"XXXX":case"XX":return Nn(s);case"XXXXX":case"XXX":default:return Nn(s,":")}},x:function(e,t,n,i){var r=i._originalDate||e,s=r.getTimezoneOffset();switch(t){case"x":return xf(s);case"xxxx":case"xx":return Nn(s);case"xxxxx":case"xxx":default:return Nn(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"+yf(s,":");case"OOOO":default:return"GMT"+Nn(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"+yf(s,":");case"zzzz":default:return"GMT"+Nn(s,":")}},t:function(e,t,n,i){var r=i._originalDate||e,s=Math.floor(r.getTime()/1e3);return mt(s,t.length)},T:function(e,t,n,i){var r=i._originalDate||e,s=r.getTime();return mt(s,t.length)}};function yf(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+mt(s,2)}function xf(e,t){if(e%60===0){var n=e>0?"-":"+";return n+mt(Math.abs(e)/60,2)}return Nn(e,t)}function Nn(e,t){var n=t||"",i=e>0?"-":"+",r=Math.abs(e),s=mt(Math.floor(r/60),2),a=mt(r%60,2);return i+s+n+a}const oS=aS;var bf=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"})}},wf=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"})}},lS=function(e,t){var n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return bf(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}}",bf(i,t)).replace("{{time}}",wf(r,t))},cS={p:wf,P:lS};const uS=cS;var hS=["D","DD"],dS=["YY","YYYY"];function fS(e){return hS.indexOf(e)!==-1}function pS(e){return dS.indexOf(e)!==-1}function _f(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 gS={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"}},mS=function(e,t,n){var i,r=gS[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 vS=mS;var yS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},bS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},wS={date:wl({formats:yS,defaultWidth:"full"}),time:wl({formats:xS,defaultWidth:"full"}),dateTime:wl({formats:bS,defaultWidth:"full"})};const _S=wS;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"},SS=function(e,t,n,i){return ES[e]};const OS=SS;var TS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},MS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},CS={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"]},$S={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"]},AS={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"}},LS={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"}},DS=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"},kS={ordinalNumber:DS,era:mr({values:TS,defaultWidth:"wide"}),quarter:mr({values:MS,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:mr({values:CS,defaultWidth:"wide"}),day:mr({values:$S,defaultWidth:"wide"}),dayPeriod:mr({values:AS,defaultWidth:"wide",formattingValues:LS,defaultFormattingWidth:"wide"})};const RS=kS;var IS=/^(\d+)(th|st|nd|rd)?/i,NS=/\d+/i,PS={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},US={any:[/^b/i,/^(a|c)/i]},BS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},VS={any:[/1/i,/2/i,/3/i,/4/i]},HS={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},GS={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]},FS={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},zS={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]},jS={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},WS={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}},qS={ordinalNumber:WE({matchPattern:IS,parsePattern:NS,valueCallback:function(e){return parseInt(e,10)}}),era:vr({matchPatterns:PS,defaultMatchWidth:"wide",parsePatterns:US,defaultParseWidth:"any"}),quarter:vr({matchPatterns:BS,defaultMatchWidth:"wide",parsePatterns:VS,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:vr({matchPatterns:HS,defaultMatchWidth:"wide",parsePatterns:GS,defaultParseWidth:"any"}),day:vr({matchPatterns:FS,defaultMatchWidth:"wide",parsePatterns:zS,defaultParseWidth:"any"}),dayPeriod:vr({matchPatterns:jS,defaultMatchWidth:"any",parsePatterns:WS,defaultParseWidth:"any"})},YS={code:"en-US",formatDistance:vS,formatLong:_S,formatRelative:OS,localize:RS,match:qS,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Ef=YS;var ZS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,XS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,KS=/^'([^]*?)'?$/,QS=/''/g,JS=/[a-zA-Z]/;function mi(e,t,n){var i,r,s,a,o,l,c,u,h,d,f,p,m,g,v,y,x,S;it(2,arguments);var _=String(t),E=ta(),T=(i=(r=n==null?void 0:n.locale)!==null&&r!==void 0?r:E.locale)!==null&&i!==void 0?i:Ef,k=Ut((s=(a=(o=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:E.firstWeekContainsDate)!==null&&a!==void 0?a:(h=E.locale)===null||h===void 0||(d=h.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(k>=1&&k<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var I=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||(y=v.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&m!==void 0?m:E.weekStartsOn)!==null&&p!==void 0?p:(x=E.locale)===null||x===void 0||(S=x.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&f!==void 0?f:0);if(!(I>=0&&I<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!T.localize)throw new RangeError("locale must contain localize property");if(!T.formatLong)throw new RangeError("locale must contain formatLong property");var $=dt(e);if(!ZE($))throw new RangeError("Invalid time value");var M=_l($),V=XE($,M),C={firstWeekContainsDate:k,weekStartsOn:I,locale:T,_originalDate:$},A=_.match(XS).map(function(w){var N=w[0];if(N==="p"||N==="P"){var P=uS[N];return P(w,T.formatLong)}return w}).join("").match(ZS).map(function(w){if(w==="''")return"'";var N=w[0];if(N==="'")return tO(w);var P=oS[N];if(P)return!(n!=null&&n.useAdditionalWeekYearTokens)&&pS(w)&&_f(w,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&fS(w)&&_f(w,t,String(e)),P(V,w,T.localize,C);if(N.match(JS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+N+"`");return w}).join("");return A}function tO(e){var t=e.match(KS);return t?t[1].replace(QS,"'"):e}const ne="cds",Je={opacity:{unselected:.05,selected:.4}},gn={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},vi={duration:1e3,ease:Au,zoomLevel:3},yi={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},Sf={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},me={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},eO={defaultBins:10},Ct={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}},tn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},Ht={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},wt={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}},Pn={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},Me={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},Of={minCellDividerDimension:16,chartPadding:.5},Tf={default:{size:24}},nO={horizontalOffset:10},Mf={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}},ue={height:{[Pe.GRAPH_VIEW]:32,[Pe.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},iO=[{type:Pt.RADIUS,name:"Radius"},{type:Pt.AREA,name:"Poor area"},{type:Pt.AREA,name:"Satisfactory area"},{type:Pt.AREA,name:"Great area"},{type:Pt.QUARTILE,name:"Quartiles"}];var rO=typeof global=="object"&&global&&global.Object===Object&&global;const Cf=rO;var sO=typeof self=="object"&&self&&self.Object===Object&&self,aO=Cf||sO||Function("return this")();const Ce=aO;var oO=Ce.Symbol;const ve=oO;var $f=Object.prototype,lO=$f.hasOwnProperty,cO=$f.toString,yr=ve?ve.toStringTag:void 0;function uO(e){var t=lO.call(e,yr),n=e[yr];try{e[yr]=void 0;var i=!0}catch{}var r=cO.call(e);return i&&(t?e[yr]=n:delete e[yr]),r}var hO=Object.prototype,dO=hO.toString;function fO(e){return dO.call(e)}var pO="[object Null]",gO="[object Undefined]",Af=ve?ve.toStringTag:void 0;function Un(e){return e==null?e===void 0?gO:pO:Af&&Af in Object(e)?uO(e):fO(e)}function Ue(e){return e!=null&&typeof e=="object"}var mO="[object Symbol]";function ia(e){return typeof e=="symbol"||Ue(e)&&Un(e)==mO}function Lf(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 vO=Array.isArray;const Gt=vO;var yO=1/0,Df=ve?ve.prototype:void 0,kf=Df?Df.toString:void 0;function Rf(e){if(typeof e=="string")return e;if(Gt(e))return Lf(e,Rf)+"";if(ia(e))return kf?kf.call(e):"";var t=e+"";return t=="0"&&1/e==-yO?"-0":t}function ye(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function El(e){return e}var xO="[object AsyncFunction]",bO="[object Function]",wO="[object GeneratorFunction]",_O="[object Proxy]";function Sl(e){if(!ye(e))return!1;var t=Un(e);return t==bO||t==wO||t==xO||t==_O}var EO=Ce["__core-js_shared__"];const Ol=EO;var If=function(){var e=/[^.]+$/.exec(Ol&&Ol.keys&&Ol.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function SO(e){return!!If&&If in e}var OO=Function.prototype,TO=OO.toString;function Bn(e){if(e!=null){try{return TO.call(e)}catch{}try{return e+""}catch{}}return""}var MO=/[\\^$.*+?()[\]{}|]/g,CO=/^\[object .+?Constructor\]$/,$O=Function.prototype,AO=Object.prototype,LO=$O.toString,DO=AO.hasOwnProperty,kO=RegExp("^"+LO.call(DO).replace(MO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function RO(e){if(!ye(e)||SO(e))return!1;var t=Sl(e)?kO:CO;return t.test(Bn(e))}function IO(e,t){return e==null?void 0:e[t]}function Vn(e,t){var n=IO(e,t);return RO(n)?n:void 0}var NO=Vn(Ce,"WeakMap");const Tl=NO;var Nf=Object.create,PO=function(){function e(){}return function(t){if(!ye(t))return{};if(Nf)return Nf(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const UO=PO;function BO(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 VO(){}function Pf(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}var HO=800,GO=16,FO=Date.now;function zO(e){var t=0,n=0;return function(){var i=FO(),r=GO-(i-n);if(n=i,r>0){if(++t>=HO)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function jO(e){return function(){return e}}var WO=function(){try{var e=Vn(Object,"defineProperty");return e({},"",{}),e}catch{}}();const ra=WO;var qO=ra?function(e,t){return ra(e,"toString",{configurable:!0,enumerable:!1,value:jO(t),writable:!0})}:El,YO=zO(qO);const ZO=YO;function XO(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 QO(e){return e!==e}function JO(e,t,n){for(var i=n-1,r=e.length;++i<r;)if(e[i]===t)return i;return-1}function tT(e,t,n){return t===t?JO(e,t,n):KO(e,QO,n)}function eT(e,t){var n=e==null?0:e.length;return!!n&&tT(e,t,0)>-1}var nT=9007199254740991,iT=/^(?:0|[1-9]\d*)$/;function Ml(e,t){var n=typeof e;return t=t??nT,!!t&&(n=="number"||n!="symbol"&&iT.test(e))&&e>-1&&e%1==0&&e<t}function sa(e,t,n){t=="__proto__"&&ra?ra(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function xr(e,t){return e===t||e!==e&&t!==t}var rT=Object.prototype,sT=rT.hasOwnProperty;function Uf(e,t,n){var i=e[t];(!(sT.call(e,t)&&xr(i,n))||n===void 0&&!(t in e))&&sa(e,t,n)}function br(e,t,n,i){var r=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=i?i(n[o],e[o],o,n,e):void 0;l===void 0&&(l=e[o]),r?sa(n,o,l):Uf(n,o,l)}return n}var Bf=Math.max;function aT(e,t,n){return t=Bf(t===void 0?e.length-1:t,0),function(){for(var i=arguments,r=-1,s=Bf(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),BO(e,this,o)}}function Vf(e,t){return ZO(aT(e,t,El),e+"")}var oT=9007199254740991;function Cl(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=oT}function Hn(e){return e!=null&&Cl(e.length)&&!Sl(e)}function Hf(e,t,n){if(!ye(n))return!1;var i=typeof t;return(i=="number"?Hn(n)&&Ml(t,n.length):i=="string"&&t in n)?xr(n[t],e):!1}function lT(e){return Vf(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&&Hf(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 cT=Object.prototype;function aa(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||cT;return e===n}function uT(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}var hT="[object Arguments]";function Gf(e){return Ue(e)&&Un(e)==hT}var Ff=Object.prototype,dT=Ff.hasOwnProperty,fT=Ff.propertyIsEnumerable,pT=Gf(function(){return arguments}())?Gf:function(e){return Ue(e)&&dT.call(e,"callee")&&!fT.call(e,"callee")};const xi=pT;function gT(){return!1}var zf=typeof nt=="object"&&nt&&!nt.nodeType&&nt,jf=zf&&typeof module=="object"&&module&&!module.nodeType&&module,mT=jf&&jf.exports===zf,Wf=mT?Ce.Buffer:void 0,vT=Wf?Wf.isBuffer:void 0,yT=vT||gT;const bi=yT;var xT="[object Arguments]",bT="[object Array]",wT="[object Boolean]",_T="[object Date]",ET="[object Error]",ST="[object Function]",OT="[object Map]",TT="[object Number]",MT="[object Object]",CT="[object RegExp]",$T="[object Set]",AT="[object String]",LT="[object WeakMap]",DT="[object ArrayBuffer]",kT="[object DataView]",RT="[object Float32Array]",IT="[object Float64Array]",NT="[object Int8Array]",PT="[object Int16Array]",UT="[object Int32Array]",BT="[object Uint8Array]",VT="[object Uint8ClampedArray]",HT="[object Uint16Array]",GT="[object Uint32Array]",St={};St[RT]=St[IT]=St[NT]=St[PT]=St[UT]=St[BT]=St[VT]=St[HT]=St[GT]=!0,St[xT]=St[bT]=St[DT]=St[wT]=St[kT]=St[_T]=St[ET]=St[ST]=St[OT]=St[TT]=St[MT]=St[CT]=St[$T]=St[AT]=St[LT]=!1;function FT(e){return Ue(e)&&Cl(e.length)&&!!St[Un(e)]}function $l(e){return function(t){return e(t)}}var qf=typeof nt=="object"&&nt&&!nt.nodeType&&nt,wr=qf&&typeof module=="object"&&module&&!module.nodeType&&module,zT=wr&&wr.exports===qf,Al=zT&&Cf.process,jT=function(){try{var e=wr&&wr.require&&wr.require("util").types;return e||Al&&Al.binding&&Al.binding("util")}catch{}}();const wi=jT;var Yf=wi&&wi.isTypedArray,WT=Yf?$l(Yf):FT;const oa=WT;var qT=Object.prototype,YT=qT.hasOwnProperty;function Zf(e,t){var n=Gt(e),i=!n&&xi(e),r=!n&&!i&&bi(e),s=!n&&!i&&!r&&oa(e),a=n||i||r||s,o=a?uT(e.length,String):[],l=o.length;for(var c in e)(t||YT.call(e,c))&&!(a&&(c=="length"||r&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ml(c,l)))&&o.push(c);return o}function Xf(e,t){return function(n){return e(t(n))}}var ZT=Xf(Object.keys,Object);const XT=ZT;var KT=Object.prototype,QT=KT.hasOwnProperty;function Kf(e){if(!aa(e))return XT(e);var t=[];for(var n in Object(e))QT.call(e,n)&&n!="constructor"&&t.push(n);return t}function _r(e){return Hn(e)?Zf(e):Kf(e)}function JT(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var tM=Object.prototype,eM=tM.hasOwnProperty;function nM(e){if(!ye(e))return JT(e);var t=aa(e),n=[];for(var i in e)i=="constructor"&&(t||!eM.call(e,i))||n.push(i);return n}function Er(e){return Hn(e)?Zf(e,!0):nM(e)}var iM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rM=/^\w*$/;function Ll(e,t){if(Gt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||ia(e)?!0:rM.test(e)||!iM.test(e)||t!=null&&e in Object(t)}var sM=Vn(Object,"create");const Sr=sM;function aM(){this.__data__=Sr?Sr(null):{},this.size=0}function oM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var lM="__lodash_hash_undefined__",cM=Object.prototype,uM=cM.hasOwnProperty;function hM(e){var t=this.__data__;if(Sr){var n=t[e];return n===lM?void 0:n}return uM.call(t,e)?t[e]:void 0}var dM=Object.prototype,fM=dM.hasOwnProperty;function pM(e){var t=this.__data__;return Sr?t[e]!==void 0:fM.call(t,e)}var gM="__lodash_hash_undefined__";function mM(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Sr&&t===void 0?gM:t,this}function Gn(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])}}Gn.prototype.clear=aM,Gn.prototype.delete=oM,Gn.prototype.get=hM,Gn.prototype.has=pM,Gn.prototype.set=mM;function vM(){this.__data__=[],this.size=0}function la(e,t){for(var n=e.length;n--;)if(xr(e[n][0],t))return n;return-1}var yM=Array.prototype,xM=yM.splice;function bM(e){var t=this.__data__,n=la(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():xM.call(t,n,1),--this.size,!0}function wM(e){var t=this.__data__,n=la(t,e);return n<0?void 0:t[n][1]}function _M(e){return la(this.__data__,e)>-1}function EM(e,t){var n=this.__data__,i=la(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,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=vM,en.prototype.delete=bM,en.prototype.get=wM,en.prototype.has=_M,en.prototype.set=EM;var SM=Vn(Ce,"Map");const Or=SM;function OM(){this.size=0,this.__data__={hash:new Gn,map:new(Or||en),string:new Gn}}function TM(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ca(e,t){var n=e.__data__;return TM(t)?n[typeof t=="string"?"string":"hash"]:n.map}function MM(e){var t=ca(this,e).delete(e);return this.size-=t?1:0,t}function CM(e){return ca(this,e).get(e)}function $M(e){return ca(this,e).has(e)}function AM(e,t){var n=ca(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}function nn(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])}}nn.prototype.clear=OM,nn.prototype.delete=MM,nn.prototype.get=CM,nn.prototype.has=$M,nn.prototype.set=AM;var LM="Expected a function";function Dl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(LM);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(Dl.Cache||nn),n}Dl.Cache=nn;var DM=500;function kM(e){var t=Dl(e,function(i){return n.size===DM&&n.clear(),i}),n=t.cache;return t}var RM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,IM=/\\(\\)?/g,NM=kM(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(RM,function(n,i,r,s){t.push(r?s.replace(IM,"$1"):i||n)}),t});const PM=NM;function Tr(e){return e==null?"":Rf(e)}function Qf(e,t){return Gt(e)?e:Ll(e,t)?[e]:PM(Tr(e))}var UM=1/0;function ua(e){if(typeof e=="string"||ia(e))return e;var t=e+"";return t=="0"&&1/e==-UM?"-0":t}function Jf(e,t){t=Qf(t,e);for(var n=0,i=t.length;e!=null&&n<i;)e=e[ua(t[n++])];return n&&n==i?e:void 0}function _t(e,t,n){var i=e==null?void 0:Jf(e,t);return i===void 0?n:i}function kl(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}var tp=ve?ve.isConcatSpreadable:void 0;function BM(e){return Gt(e)||xi(e)||!!(tp&&e&&e[tp])}function ha(e,t,n,i,r){var s=-1,a=e.length;for(n||(n=BM),r||(r=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?ha(o,t-1,n,i,r):kl(r,o):i||(r[r.length]=o)}return r}var VM=Xf(Object.getPrototypeOf,Object);const Rl=VM;var HM="[object Object]",GM=Function.prototype,FM=Object.prototype,ep=GM.toString,zM=FM.hasOwnProperty,jM=ep.call(Object);function WM(e){if(!Ue(e)||Un(e)!=HM)return!1;var t=Rl(e);if(t===null)return!0;var n=zM.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&ep.call(n)==jM}function qM(){this.__data__=new en,this.size=0}function YM(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function ZM(e){return this.__data__.get(e)}function XM(e){return this.__data__.has(e)}var KM=200;function QM(e,t){var n=this.__data__;if(n instanceof en){var i=n.__data__;if(!Or||i.length<KM-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new nn(i)}return n.set(e,t),this.size=n.size,this}function $e(e){var t=this.__data__=new en(e);this.size=t.size}$e.prototype.clear=qM,$e.prototype.delete=YM,$e.prototype.get=ZM,$e.prototype.has=XM,$e.prototype.set=QM;function JM(e,t){return e&&br(t,_r(t),e)}function tC(e,t){return e&&br(t,Er(t),e)}var np=typeof nt=="object"&&nt&&!nt.nodeType&&nt,ip=np&&typeof module=="object"&&module&&!module.nodeType&&module,eC=ip&&ip.exports===np,rp=eC?Ce.Buffer:void 0,sp=rp?rp.allocUnsafe:void 0;function ap(e,t){if(t)return e.slice();var n=e.length,i=sp?sp(n):new e.constructor(n);return e.copy(i),i}function nC(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 op(){return[]}var iC=Object.prototype,rC=iC.propertyIsEnumerable,lp=Object.getOwnPropertySymbols,sC=lp?function(e){return e==null?[]:(e=Object(e),nC(lp(e),function(t){return rC.call(e,t)}))}:op;const Il=sC;function aC(e,t){return br(e,Il(e),t)}var oC=Object.getOwnPropertySymbols,lC=oC?function(e){for(var t=[];e;)kl(t,Il(e)),e=Rl(e);return t}:op;const cp=lC;function cC(e,t){return br(e,cp(e),t)}function up(e,t,n){var i=t(e);return Gt(e)?i:kl(i,n(e))}function Nl(e){return up(e,_r,Il)}function uC(e){return up(e,Er,cp)}var hC=Vn(Ce,"DataView");const Pl=hC;var dC=Vn(Ce,"Promise");const Ul=dC;var fC=Vn(Ce,"Set");const _i=fC;var hp="[object Map]",pC="[object Object]",dp="[object Promise]",fp="[object Set]",pp="[object WeakMap]",gp="[object DataView]",gC=Bn(Pl),mC=Bn(Or),vC=Bn(Ul),yC=Bn(_i),xC=Bn(Tl),Fn=Un;(Pl&&Fn(new Pl(new ArrayBuffer(1)))!=gp||Or&&Fn(new Or)!=hp||Ul&&Fn(Ul.resolve())!=dp||_i&&Fn(new _i)!=fp||Tl&&Fn(new Tl)!=pp)&&(Fn=function(e){var t=Un(e),n=t==pC?e.constructor:void 0,i=n?Bn(n):"";if(i)switch(i){case gC:return gp;case mC:return hp;case vC:return dp;case yC:return fp;case xC:return pp}return t});const Ei=Fn;var bC=Object.prototype,wC=bC.hasOwnProperty;function _C(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&wC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var EC=Ce.Uint8Array;const da=EC;function Bl(e){var t=new e.constructor(e.byteLength);return new da(t).set(new da(e)),t}function SC(e,t){var n=t?Bl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var OC=/\w*$/;function TC(e){var t=new e.constructor(e.source,OC.exec(e));return t.lastIndex=e.lastIndex,t}var mp=ve?ve.prototype:void 0,vp=mp?mp.valueOf:void 0;function MC(e){return vp?Object(vp.call(e)):{}}function yp(e,t){var n=t?Bl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var CC="[object Boolean]",$C="[object Date]",AC="[object Map]",LC="[object Number]",DC="[object RegExp]",kC="[object Set]",RC="[object String]",IC="[object Symbol]",NC="[object ArrayBuffer]",PC="[object DataView]",UC="[object Float32Array]",BC="[object Float64Array]",VC="[object Int8Array]",HC="[object Int16Array]",GC="[object Int32Array]",FC="[object Uint8Array]",zC="[object Uint8ClampedArray]",jC="[object Uint16Array]",WC="[object Uint32Array]";function qC(e,t,n){var i=e.constructor;switch(t){case NC:return Bl(e);case CC:case $C:return new i(+e);case PC:return SC(e,n);case UC:case BC:case VC:case HC:case GC:case FC:case zC:case jC:case WC:return yp(e,n);case AC:return new i;case LC:case RC:return new i(e);case DC:return TC(e);case kC:return new i;case IC:return MC(e)}}function xp(e){return typeof e.constructor=="function"&&!aa(e)?UO(Rl(e)):{}}var YC="[object Map]";function ZC(e){return Ue(e)&&Ei(e)==YC}var bp=wi&&wi.isMap,XC=bp?$l(bp):ZC;const KC=XC;var QC="[object Set]";function JC(e){return Ue(e)&&Ei(e)==QC}var wp=wi&&wi.isSet,t2=wp?$l(wp):JC;const e2=t2;var n2=1,i2=2,r2=4,_p="[object Arguments]",s2="[object Array]",a2="[object Boolean]",o2="[object Date]",l2="[object Error]",Ep="[object Function]",c2="[object GeneratorFunction]",u2="[object Map]",h2="[object Number]",Sp="[object Object]",d2="[object RegExp]",f2="[object Set]",p2="[object String]",g2="[object Symbol]",m2="[object WeakMap]",v2="[object ArrayBuffer]",y2="[object DataView]",x2="[object Float32Array]",b2="[object Float64Array]",w2="[object Int8Array]",_2="[object Int16Array]",E2="[object Int32Array]",S2="[object Uint8Array]",O2="[object Uint8ClampedArray]",T2="[object Uint16Array]",M2="[object Uint32Array]",Et={};Et[_p]=Et[s2]=Et[v2]=Et[y2]=Et[a2]=Et[o2]=Et[x2]=Et[b2]=Et[w2]=Et[_2]=Et[E2]=Et[u2]=Et[h2]=Et[Sp]=Et[d2]=Et[f2]=Et[p2]=Et[g2]=Et[S2]=Et[O2]=Et[T2]=Et[M2]=!0,Et[l2]=Et[Ep]=Et[m2]=!1;function fa(e,t,n,i,r,s){var a,o=t&n2,l=t&i2,c=t&r2;if(n&&(a=r?n(e,i,r,s):n(e)),a!==void 0)return a;if(!ye(e))return e;var u=Gt(e);if(u){if(a=_C(e),!o)return Pf(e,a)}else{var h=Ei(e),d=h==Ep||h==c2;if(bi(e))return ap(e,o);if(h==Sp||h==_p||d&&!r){if(a=l||d?{}:xp(e),!o)return l?cC(e,tC(a,e)):aC(e,JM(a,e))}else{if(!Et[h])return r?e:{};a=qC(e,h,o)}}s||(s=new $e);var f=s.get(e);if(f)return f;s.set(e,a),e2(e)?e.forEach(function(g){a.add(fa(g,t,n,g,e,s))}):KC(e)&&e.forEach(function(g,v){a.set(v,fa(g,t,n,v,e,s))});var p=c?l?uC:Nl:l?Er:_r,m=u?void 0:p(e);return XO(m||e,function(g,v){m&&(v=g,g=e[v]),Uf(a,v,fa(g,t,n,v,e,s))}),a}var C2=1,$2=4;function A2(e){return fa(e,C2|$2)}var L2="__lodash_hash_undefined__";function D2(e){return this.__data__.set(e,L2),this}function k2(e){return this.__data__.has(e)}function Mr(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new nn;++t<n;)this.add(e[t])}Mr.prototype.add=Mr.prototype.push=D2,Mr.prototype.has=k2;function Op(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 Tp(e,t){return e.has(t)}var R2=1,I2=2;function Mp(e,t,n,i,r,s){var a=n&R2,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var h=-1,d=!0,f=n&I2?new Mr: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(!Op(t,function(v,y){if(!Tp(f,y)&&(p===v||r(p,v,n,i,s)))return f.push(y)})){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 N2(e){var t=-1,n=Array(e.size);return e.forEach(function(i,r){n[++t]=[r,i]}),n}function Vl(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var P2=1,U2=2,B2="[object Boolean]",V2="[object Date]",H2="[object Error]",G2="[object Map]",F2="[object Number]",z2="[object RegExp]",j2="[object Set]",W2="[object String]",q2="[object Symbol]",Y2="[object ArrayBuffer]",Z2="[object DataView]",Cp=ve?ve.prototype:void 0,Hl=Cp?Cp.valueOf:void 0;function X2(e,t,n,i,r,s,a){switch(n){case Z2:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Y2:return!(e.byteLength!=t.byteLength||!s(new da(e),new da(t)));case B2:case V2:case F2:return xr(+e,+t);case H2:return e.name==t.name&&e.message==t.message;case z2:case W2:return e==t+"";case G2:var o=N2;case j2:var l=i&P2;if(o||(o=Vl),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;i|=U2,a.set(e,t);var u=Mp(o(e),o(t),i,r,s,a);return a.delete(e),u;case q2:if(Hl)return Hl.call(e)==Hl.call(t)}return!1}var K2=1,Q2=Object.prototype,J2=Q2.hasOwnProperty;function t$(e,t,n,i,r,s){var a=n&K2,o=Nl(e),l=o.length,c=Nl(t),u=c.length;if(l!=u&&!a)return!1;for(var h=l;h--;){var d=o[h];if(!(a?d in t:J2.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<l;){d=o[h];var v=e[d],y=t[d];if(i)var x=a?i(y,v,d,t,e,s):i(v,y,d,e,t,s);if(!(x===void 0?v===y||r(v,y,n,i,s):x)){m=!1;break}g||(g=d=="constructor")}if(m&&!g){var S=e.constructor,_=t.constructor;S!=_&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof _=="function"&&_ instanceof _)&&(m=!1)}return s.delete(e),s.delete(t),m}var e$=1,$p="[object Arguments]",Ap="[object Array]",pa="[object Object]",n$=Object.prototype,Lp=n$.hasOwnProperty;function i$(e,t,n,i,r,s){var a=Gt(e),o=Gt(t),l=a?Ap:Ei(e),c=o?Ap:Ei(t);l=l==$p?pa:l,c=c==$p?pa:c;var u=l==pa,h=c==pa,d=l==c;if(d&&bi(e)){if(!bi(t))return!1;a=!0,u=!1}if(d&&!u)return s||(s=new $e),a||oa(e)?Mp(e,t,n,i,r,s):X2(e,t,l,n,i,r,s);if(!(n&e$)){var f=u&&Lp.call(e,"__wrapped__"),p=h&&Lp.call(t,"__wrapped__");if(f||p){var m=f?e.value():e,g=p?t.value():t;return s||(s=new $e),r(m,g,n,i,s)}}return d?(s||(s=new $e),t$(e,t,n,i,r,s)):!1}function ga(e,t,n,i,r){return e===t?!0:e==null||t==null||!Ue(e)&&!Ue(t)?e!==e&&t!==t:i$(e,t,n,i,ga,r)}var r$=1,s$=2;function a$(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 l=o[0],c=e[l],u=o[1];if(a&&o[2]){if(c===void 0&&!(l in e))return!1}else{var h=new $e;if(i)var d=i(c,u,l,e,t,h);if(!(d===void 0?ga(u,c,r$|s$,i,h):d))return!1}}return!0}function Dp(e){return e===e&&!ye(e)}function o$(e){for(var t=_r(e),n=t.length;n--;){var i=t[n],r=e[i];t[n]=[i,r,Dp(r)]}return t}function kp(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function l$(e){var t=o$(e);return t.length==1&&t[0][2]?kp(t[0][0],t[0][1]):function(n){return n===e||a$(n,e,t)}}function c$(e,t){return e!=null&&t in Object(e)}function u$(e,t,n){t=Qf(t,e);for(var i=-1,r=t.length,s=!1;++i<r;){var a=ua(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&&Cl(r)&&Ml(a,r)&&(Gt(e)||xi(e)))}function h$(e,t){return e!=null&&u$(e,t,c$)}var d$=1,f$=2;function p$(e,t){return Ll(e)&&Dp(t)?kp(ua(e),t):function(n){var i=_t(n,e);return i===void 0&&i===t?h$(n,e):ga(t,i,d$|f$)}}function g$(e){return function(t){return t==null?void 0:t[e]}}function m$(e){return function(t){return Jf(t,e)}}function v$(e){return Ll(e)?g$(ua(e)):m$(e)}function ma(e){return typeof e=="function"?e:e==null?El:typeof e=="object"?Gt(e)?p$(e[0],e[1]):l$(e):v$(e)}function y$(e){return function(t,n,i){for(var r=-1,s=Object(t),a=i(t),o=a.length;o--;){var l=a[e?o:++r];if(n(s[l],l,s)===!1)break}return t}}var x$=y$();const Rp=x$;function Gl(e,t,n){(n!==void 0&&!xr(e[t],n)||n===void 0&&!(t in e))&&sa(e,t,n)}function Fl(e){return Ue(e)&&Hn(e)}function zl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function b$(e){return br(e,Er(e))}function w$(e,t,n,i,r,s,a){var o=zl(e,n),l=zl(t,n),c=a.get(l);if(c){Gl(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,h=u===void 0;if(h){var d=Gt(l),f=!d&&bi(l),p=!d&&!f&&oa(l);u=l,d||f||p?Gt(o)?u=o:Fl(o)?u=Pf(o):f?(h=!1,u=ap(l,!0)):p?(h=!1,u=yp(l,!0)):u=[]:WM(l)||xi(l)?(u=o,xi(o)?u=b$(o):(!ye(o)||Sl(o))&&(u=xp(l))):h=!1}h&&(a.set(l,u),r(u,l,i,s,a),a.delete(l)),Gl(e,n,u)}function Ip(e,t,n,i,r){e!==t&&Rp(t,function(s,a){if(r||(r=new $e),ye(s))w$(e,t,a,n,Ip,i,r);else{var o=i?i(zl(e,a),s,a+"",e,t,r):void 0;o===void 0&&(o=s),Gl(e,a,o)}},Er)}function _$(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 E$(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var S$="[object Map]",O$="[object Set]",T$=Object.prototype,M$=T$.hasOwnProperty;function Ae(e){if(e==null)return!0;if(Hn(e)&&(Gt(e)||typeof e=="string"||typeof e.splice=="function"||bi(e)||oa(e)||xi(e)))return!e.length;var t=Ei(e);if(t==S$||t==O$)return!e.size;if(aa(e))return!Kf(e).length;for(var n in e)if(M$.call(e,n))return!1;return!0}var C$=lT(function(e,t,n){Ip(e,t,n)});const X=C$;var $$=1/0,A$=_i&&1/Vl(new _i([,-0]))[1]==$$?function(e){return new _i(e)}:VO;const L$=A$;var D$=200;function Np(e,t,n){var i=-1,r=eT,s=e.length,a=!0,o=[],l=o;if(n)a=!1,r=_$;else if(s>=D$){var c=t?null:L$(e);if(c)return Vl(c);a=!1,r=Tp,l=new Mr}else l=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=l.length;d--;)if(l[d]===h)continue t;t&&l.push(h),o.push(u)}else r(l,h,n)||(l!==o&&l.push(h),o.push(u))}return o}var k$=Vf(function(e){var t=E$(e);return Fl(t)&&(t=void 0),Np(ha(e,1,Fl,!0),ma(t))});const R$=k$;function I$(e){return e&&e.length?Np(e):[]}const rn=A2,Cr=I$;function N$(e,t,n){let i=null;return(...r)=>{const s=this;s.mousePosition=Sn(r[0],n),clearTimeout(i),i=setTimeout(function(){e.apply(s,r)},t)}}function Tt(e,t){var n;const i=rn(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 l=a.scaleType;l==null?a.mapsTo="value":l===W.TIME?a.mapsTo="date":l===W.LABELS&&(a.mapsTo="key")}}else delete i.axes[s];return jl(i,t),X(i,t)}function sn(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 $r(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 Pp(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 Ar(e,t,n){if(n>e.length)return e;if(t===Te.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Te.FRONT_LINE)return"..."+e.substr(-n);if(t===Te.END_LINE)return e.substr(0,n)+"..."}function jl(e,t){const n=b(e,"legend","additionalItems"),i=b(t,"legend","additionalItems");if(n&&i){const r=i.map(o=>o.type),s=n.map(o=>o.type),a=iO.filter(o=>s.includes(o.type)&&!r.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=R$(a,i,"name")}}const b=(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},Up=(e,t)=>t===Vt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,Xt=(e,t)=>{const{x0:n,x1:i,y0:r,y1:s}=Up(e,t);return`M${n},${r}L${n},${s}L${i},${s}L${i},${r}L${n},${r}`};function an(e,t,n){return n===Vt.VERTICAL?[e,t]:[t,e]}const Si={type:Te.END_LINE,threshold:16,numCharacter:14},P$={enabled:!0,position:fr.BOTTOM,clickable:!0,truncation:Si,alignment:It.LEFT,order:null,additionalItems:[]},U$={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},B$={enabled:!0},Bp={enabled:!0,showTotal:!0,truncation:Si,groupLabel:"Group"},Vp={top:{visible:!0,includeZero:!0,truncation:Si},bottom:{visible:!0,includeZero:!0,truncation:Si},left:{visible:!0,includeZero:!0,truncation:Si},right:{visible:!0,includeZero:!0,truncation:Si}},va={addSpaceOnEdges:1,showDayName:!1,localeObject:Ef,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"}}},V$=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),Yt={width:null,height:null,resizable:!0,theme:gf.WHITE,tooltip:Bp,legend:P$,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:Mt.SHOW_AS_DATATABLE},...V$?[{type:Mt.MAKE_FULLSCREEN}]:[],{type:Mt.EXPORT_CSV},{type:Mt.EXPORT_PNG},{type:Mt.EXPORT_JPG}]}},Hp=X({},Yt,{thematic:{projection:Qe.geoNaturalEarth1}}),Lr=X({},Yt,{axes:Vp,timeScale:va,grid:U$,ruler:B$,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Pe.GRAPH_VIEW}}}),zn=X({},Lr,{bars:{maxWidth:16,spacingFactor:.25},timeScale:X(va,{addSpaceOnEdges:1})}),H$=X({},zn,{}),G$=X({},zn,{}),F$=X({},zn,{bars:X({},zn.bars,{dividerSize:1.5})}),z$=X({},zn,{}),Wl=X({},Lr,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),j$=Wl,Gp=X({},Wl,{points:{radius:3,filled:!1,enabled:!0}}),Fp=X({},Gp,{timeScale:X(va,{addSpaceOnEdges:0})}),W$=Fp,q$=X({},Lr,{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:Pt.RADIUS,name:"Radius"}]}}),Y$=X({},Lr,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Pt.AREA,name:"Poor area"},{type:Pt.AREA,name:"Satisfactory area"},{type:Pt.AREA,name:"Great area"},{type:Pt.QUARTILE,name:"Quartiles"}]}}),Z$=X({},zn,{bars:{dividerSize:1.5},timeScale:X(va,{addSpaceOnEdges:0})}),X$=X({},Yt,{tooltip:X({},Bp,{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"}}),zp=X({},Yt,{pie:{labels:{formatter:null,enabled:!0},alignment:It.LEFT,sortFunction:null,valueMapsTo:"value"}}),K$=X({},Yt,{legend:{enabled:!1},gauge:{type:pi.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}}),Q$=X({},zp,{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}}),jp=X({},Yt,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),J$=X({},jp,{legend:{enabled:!0}}),tA=X({},Yt,{radar:{axes:{angle:"key",value:"value"},alignment:It.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:e=>e??"N/A"}}),eA=X({},zn,{comboChartTypes:[]}),nA=X({tree:{type:yl.TREE}},Yt,{}),iA=X({},Yt,{data:X(Yt.data,{groupMapsTo:"name"})}),rA=X({},Yt,yi,{data:X(Yt.data,{groupMapsTo:"name"})}),sA=X({},Yt,{alluvial:{data:X(Yt.data,{groupMapsTo:"source"}),nodeAlignment:It.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),aA=X({},Yt,{axes:Vp,heatmap:{divider:{state:gr.AUTO},colorLegend:{type:"linear"}}}),oA=X({},Hp,{choropleth:{colorLegend:{type:"linear"}}}),xt={alluvialChart:sA,areaChart:Fp,axisChart:Lr,boxplotChart:z$,bubbleChart:q$,bulletChart:Y$,chart:Yt,circlePackChart:rA,choroplethChart:oA,comboChart:eA,donutChart:Q$,gaugeChart:K$,groupedBarChart:G$,heatmapChart:aA,histogramChart:Z$,lineChart:Gp,lollipopChart:j$,meterChart:jp,pieChart:zp,proportionalMeterChart:J$,radarChart:tA,scatterChart:Wl,simpleBarChart:H$,stackedAreaChart:W$,stackedBarChart:F$,thematicChart:Hp,treeChart:nA,treemapChart:iA,wordCloudChart:X$};var Wp=(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))(Wp||{});const ql=[["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 qp(e,t,n,i,r){const s=t===0,a=Number(mi(new Date(e),"c"))===2,o=Number(mi(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(i){case"15seconds":return s||xa(e)||Dr(e,l)||mn(e);case"minute":return s||xa(e)||Dr(e,l)||mn(e);case"30minutes":return s||xa(e)||Dr(e,l)||mn(e);case"hourly":return s||xa(e)||Dr(e,l)||mn(e);case"daily":return r?s||a||mn(e):s||Dr(e,l)||mn(e);case"weekly":return s||a||mn(e);case"monthly":return s||mn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${i} is not a valid time interval.`)}}function Yl(e,t,n,i,r){const s=r.showDayName,a=i==="daily"&&s?"weekly":i,o=new Date(e),l=b(r,"timeIntervalFormats")[a],c=b(l,"primary"),u=b(l,"secondary");let h=qp(e,t,n,i,s)?c:u;i==="15seconds"&&o.getMilliseconds()!==0&&(h=h.replace("pp","h:mm:ss.SSS a"));const d=r.localeObject;return mi(o,h,{locale:d})}function ya(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function lA(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function cA(e){const t=ql.reduce((n,[,i],r)=>{const s=ql[n][1],a=Math.abs(s-e),o=Math.abs(i-e);return a<o?n:r},0);return ql[t][0]}function Zl(e,t){if(Wp[t])return t;if(e.length===1)return"15seconds";const n=lA(e),i=un(n);return cA(i)}function xa(e){const{s:t,m:n,H:i}=ya(e);return i===0&&n===0&&t===0}function Dr(e,t){const n=ya(e).M,i=ya(t).M;return n!==i}function mn(e){const{M:t,d:n,s:i,m:r,H:s}=ya(e);return t===1&&n===1&&s===0&&r===0&&i===0}function Yp(e){return e===void 0?"":e.toISOString()}function Zp(e){const t=be(e,i=>i.value),n=Oe().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=b(t,"gradient","colors"),i=!Ae(n);let r=b(t,"pairing","option");const s=Zp(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 l=a==="diverge"?17:11;for(let c=1;c<l+1;c++)o.push(`fill-${a}-${r}-${c}`)}return Ko().domain(s).range(o)}var rt=(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))(rt||{});function uA(e,t){return e&&Rp(e,t,_r)}function hA(e,t){return function(n,i){if(n==null)return n;if(!Hn(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 dA=hA(uA);const Xl=dA;function fA(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 pA(e,t,n,i){return Xl(e,function(r,s,a){t(i,r,n(r),a)}),i}function gA(e,t){return function(n,i){var r=Gt(n)?fA:pA,s=t?t():{};return r(n,e,ma(i),s)}}function mA(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 vA=Object.prototype,yA=vA.hasOwnProperty,xA=gA(function(e,t,n){yA.call(e,n)?e[n].push(t):sa(e,n,[t])});const bA=xA;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}=b(n,"data"),a=b(n,"axes");return t&&(i=i.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===W.LINEAR||c===W.LOG)&&(i=i.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===W.LABELS)i=i.filter(u=>a[o].domain.includes(u[l]));else{const[u,h]=a[o].domain;i=i.filter(d=>!(l in d)||d[l]>=u&&d[l]<=h)}}),i.filter(o=>r.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Ct.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(rn(t)),i=this.generateDataGroups(n);return this.set({data:n,dataGroups:i}),n}getDataGroups(t){return b(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Ct.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 bA(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=eO.defaultBins}=s,l=Array.isArray(o),c=Nv().value(f=>f[r]).thresholds(o)(t);if(l)c[c.length-1].x1=o[o.length-1];else{const f=c[0].x1-c[0].x0;c[c.length-1].x1=+c[c.length-1].x0+f}const u=l?[o[0],o[o.length-1]]:[c[0].x0,c[c.length-1].x1],h=Array.from(new Set(t.map(f=>f[a]))),d=[];return c.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:c,binsDomain:u}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this.getActiveDataGroupNames(),{bins:r}=this.getBinConfigurations(),s=this.getDataValuesGroupedByKeys({bins:r});return vl().keys(i)(s).map((a,o)=>Object.keys(a).filter(l=>!isNaN(l)).map(l=>{const c=a[l];return c[n]=i[o],c}))}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(l=>`${l.x0}-${l.x1}`):s=Cr(r.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Yp(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const a=this.services.cartesianScales.domainAxisPosition,o=i.axes[a].scaleType;return o===W.TIME?s.sort((l,c)=>{const u=new Date(l),h=new Date(c);return u-h}):(o===W.LOG||o===W.LINEAR)&&s.sort((l,c)=>l-c),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(l=>{const[c,u]=l.split("-"),h={x0:c,x1:u},d=t.find(f=>f.x0.toString()===c.toString());return a.forEach(f=>{h[f]=d.filter(p=>p[r]===f).length}),h}):o.map(l=>{const c={sharedStackKey:l};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?Yp(f[p])===l:f[p].toString()===l)}),d=this.services.cartesianScales.getRangeIdentifier(c);c[u]=h?h[d]:null}),c})}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 l=mA(o.map(c=>[c.sharedStackKey,0]));o.forEach(c=>{a.forEach(u=>{l[c.sharedStackKey]+=c[u]})}),o.forEach(c=>{a.forEach(u=>{const h=l[c.sharedStackKey];l[c.sharedStackKey]?c[u]=c[u]/h*100:c[u]=0})})}return(i?vl().offset(GE):vl()).keys(a)(o).map((l,c)=>Object.keys(l).filter(u=>!isNaN(u)).map(u=>{const h=l[u];return h[s]=a[c],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();jl(n,t),this.set({options:X(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(O.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:i}=Ct.items.status,r=this.getDataGroups(),s=r.some(c=>c.status===i),a=r.filter(c=>c.status===n);if(s)if(a.length===1&&a[0].name===t)r.forEach((c,u)=>{r[u].status=n});else{const c=r.findIndex(u=>u.name===t);r[c].status=r[c].status===i?n:i}else r.forEach((c,u)=>{r[u].status=c.name===t?n:i});const o=r.filter(c=>c.status===n),l=this.getOptions();r.some(c=>c.status===i)?l.data.selectedGroups=o.map(c=>c.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(O.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=b(this.colorScale,t);return r.getFillColor?r.getFillColor(t,n,i,s):s}getStrokeColor(t,n,i){const r=this.getOptions(),s=b(this.colorScale,t);return r.getStrokeColor?r.getStrokeColor(t,n,i,s):s}isUserProvidedColorScaleValid(){const t=b(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 l;const c=b(s,"label");if(c===null){const h=b(r,o);h?l=h:l="Ungrouped"}else l=c;const u={group:l,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==="–"?"–":s}"`));let n="",i="";t.forEach(function(r,s){i=r.join(","),n+=s<t.length?i+`
|
|
2
|
-
`: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}=Ct.items.status,s=this.getOptions(),a=Cr(t.map(l=>l[n]));s.data.selectedGroups.length&&(s.data.selectedGroups.every(l=>a.includes(l))||(s.data.selectedGroups=[]));const o=l=>!s.data.selectedGroups.length||s.data.selectedGroups.includes(l)?i:r;return a.map(l=>({name:l,status:o(l)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=b(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=b(this.getOptions(),"color","pairing");let n=b(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let i=b(t,"option");const r=Sf.pairingOptions,s=n>5?14:n,a=`${s}-color`;i=i<=r[a]?i:1;const o=this.allDataGroups.map((l,c)=>`${s}-${i}-${c%14+1}`);this.colorClassNames=Ls().range(o).domain(this.allDataGroups)}}class jn extends Be{constructor(t){super(t),this.axisFlavor=Ks.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:b(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:l}=this.assignRangeAndDomains(),c=r.getDomainAxisScaleType();let u;return c===W.TIME&&(u=h=>mi(h,"MMM d, yyyy")),[["Group",s.label,a.label,...o?[o.label]:[],...l?[l.label]:[]],...t.map(h=>[h[i],h[s.identifier]===null?"–":u?u(h[s.identifier]):h[s.identifier],h[a.identifier]===null||isNaN(h[a.identifier])?"–":h[a.identifier].toLocaleString(),...o?[h[o.identifier]===null?"–":h[o.identifier]]:[],...l?[h[l.identifier]===null||isNaN(h[l.identifier])?"–":h[l.identifier]]:[]])]}setData(t){let n;if(t&&(n=super.setData(t),b(this.getOptions(),"zoomBar",B.TOP,"enabled"))){const i=b(this.getOptions(),"zoomBar",B.TOP,"data");this.setZoomBarData(i)}return n}setZoomBarData(t){const n=t?this.sanitize(rn(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(l=>l[s].getTime());o=Cr(o).sort(),i=o.map(l=>{let c=0;const u={};return n.forEach(h=>{h[s].getTime()===l&&(c+=h[a])}),u[s]=new Date(l),u[a]=c,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(B).forEach(r=>{const s=B[r],a=n.axes[s];if(a&&a.scaleType===W.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&i.push(o)}}),i.length>0&&t.forEach(r=>{i.forEach(s=>{b(r,s,"getTime")===null&&(r[s]=new Date(r[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}}let wA=class extends jn{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])]}},_A=class extends jn{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Fa(t,.25),q_50:Fa(t,.5),q_75:Fa(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(),l=a.map(x=>x[o]).sort(wn),c={[n]:s,counts:l,quartiles:this.getBoxQuartiles(l),outliers:null,whiskers:null},u=c.quartiles.q_25,h=c.quartiles.q_75,d=(h-u)*1.5,f=u-d,p=h+d,m=[],g=[];for(const x of l)x<f||x>p?m.push(x):g.push(x);c.outliers=m;const v=un(g),y=En(g);c.whiskers={min:v||un([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:y||En([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75])},r.push(c)}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=b(r,"outliers");return(s===null||s.length===0)&&(s=["–"]),[r[n],b(r,"whiskers","min")!==null?b(r,"whiskers","min").toLocaleString():"–",b(r,"quartiles","q_25")!==null?b(r,"quartiles","q_25").toLocaleString():"–",b(r,"quartiles","q_50")!==null?b(r,"quartiles","q_50").toLocaleString():"–",b(r,"quartiles","q_75")!==null?b(r,"quartiles","q_75").toLocaleString():"–",b(r,"whiskers","max")!==null?b(r,"whiskers","max").toLocaleString():"–",b(r,"quartiles","q_75")!==null&&b(r,"quartiles","q_25")!==null?(b(r,"quartiles","q_75")-b(r,"quartiles","q_25")).toLocaleString():"–",s.map(a=>a.toLocaleString()).join(",")]})]}setColorClassNames(){const t=b(this.getOptions(),"color","pairing");let n=b(t,"option");const i=Sf.pairingOptions;n=n<=i["1-color"]?n:1;const r=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=Ls().range(r).domain(this.allDataGroups)}},EA=class extends jn{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=b(n,"bullet","performanceAreaTitles");return[["Title","Group","Value","Target","Percentage","Performance"],...t.map(a=>[a.title,a[i],a.value===null?"–":a.value,b(a,"marker")===null?"–":a.marker,b(a,"marker")===null?"–":`${Math.floor(a[r]/a.marker*100)}%`,s[this.getMatchingRangeIndexForDatapoint(a)]])]}},SA=class extends Be{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Ae(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Ae(n)&&!Ae(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?"–":n.id,n.name,n.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=b(this.getOptions(),"color");this._colorScale=Xp(this.getDisplayData(),t)}},OA=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=X({},t,this.getZoomOptions(t));jl(n,i);const r=this.getHierarchyLevel(),s=b(n,"circlePack","hierarchyLevel");this.set({options:X(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&&b(n,0,"children")?b(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}),b(i,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:Pt.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(["–",i.name,r])}),n}getChildrenDatums(t,n,i=[],r=0){const s=n;return t.forEach(a=>{const o=a.name;let l=0;if(a.children)a.children.length>0&&(typeof a.value=="number"&&(r+=a.value),l+=this.getChildrenDatums(a.children,o,i,l),i.push([o,s,l]),r+=l);else{let c=0;typeof a.value=="number"&&(c=a.value,r+=a.value),i.push([a.name,s,c])}}),r}},TA=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?"–":r.value.toLocaleString()])]}sanitize(t){return this.getTabularData(t).sort((n,i)=>i.value-n.value)}},MA=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?"–":r.value.toLocaleString()])]}},CA=class extends jn{constructor(t){super(t),this.axisFlavor=Ks.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=b(this.getOptions(),"axes");if(b(n,"left","scaleType")&&b(n,"left","scaleType")!==W.LABELS||b(n,"right","scaleType")&&b(n,"right","scaleType")!==W.LABELS||b(n,"top","scaleType")&&b(n,"top","scaleType")!==W.LABELS||b(n,"bottom","scaleType")&&b(n,"bottom","scaleType")!==W.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=be(this.getDisplayData(),i=>i.value),n=Oe().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(Ae(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(Ae(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(Ae(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]=rn(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(rn(t)),i=this.generateDataGroups(n);return this.set({data:n,dataGroups:i}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ae(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 l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[i]=a,l[r]=o,s.push(l)})}),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?"–":r[n.identifier],r[i.identifier]===null?"–":r[i.identifier].toLocaleString(),r.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=b(t,"color","gradient","colors"),i=!Ae(n);let r=b(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 c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${r}-${u}`)}this._colorScale=Ko().domain(s).range(o);const l=b(this.getOptions(),"color");this._colorScale=Xp(this.getDisplayData(),l)}},$A=class extends jn{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this.getBinnedStackedData();return[[_t(t,"bins.rangeLabel")||"Range",...i.map(r=>_t(r,`0.${n}`))],..._t(i,0).map((r,s)=>[`${_t(r,"data.x0")} – ${_t(r,"data.x1")}`,...i.map(a=>_t(a[s],`data.${_t(a[s],n)}`))])]}},AA=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=b(n,"color","scale"),r=this.getStatus();return i||!r?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=b(this.getDisplayData()),{value:i}=n?n.reduce((a,o)=>({value:a.value+o.value})):0,r=b(t,"meter","proportional")?i:i>100?100:i,s=b(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=b(n,"meter","proportional");let a=[],o;if(s===null){o=100;const l=t[0];a=[["Group","Value",...r?["Status"]:[]],[l[i],l.value,...r?[r]:[]]]}else o=b(s,"total")||this.getMaximumDomain(t),a=[["Group","Value","Percentage of total"],...t.map(c=>[c[i],c.value,(c.value/o*100).toFixed(2)+" %"])];return a}},LA=class extends jn{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:i,value:r}=b(t,"radar","axes"),s=b(n,"0","data").map(a=>a[i]);return[["Group",...s],...n.map(a=>[a.name,...s.map((o,l)=>b(a,"data",l,r)!==null?b(a,"data",l,r).toLocaleString():"–")])]}},DA=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,"–"])}),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 kA 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])}):b(i.name)!==null&&b(i.value)&&n.push(["–",i.name,i.value])}),n}}let RA=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 IA=/\s/;function NA(e){for(var t=e.length;t--&&IA.test(e.charAt(t)););return t}var PA=/^\s+/;function UA(e){return e&&e.slice(0,NA(e)+1).replace(PA,"")}var Kp=0/0,BA=/^[-+]0x[0-9a-f]+$/i,VA=/^0b[01]+$/i,HA=/^0o[0-7]+$/i,GA=parseInt;function kr(e){if(typeof e=="number")return e;if(ia(e))return Kp;if(ye(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ye(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=UA(e);var n=VA.test(e);return n||HA.test(e)?GA(e.slice(2),n?2:8):BA.test(e)?Kp:+e}var FA=function(){return Ce.Date.now()};const Kl=FA;var zA="Expected a function",jA=Math.max,WA=Math.min;function ba(e,t,n){var i,r,s,a,o,l,c=0,u=!1,h=!1,d=!0;if(typeof e!="function")throw new TypeError(zA);t=kr(t)||0,ye(n)&&(u=!!n.leading,h="maxWait"in n,s=h?jA(kr(n.maxWait)||0,t):s,d="trailing"in n?!!n.trailing:d);function f(E){var T=i,k=r;return i=r=void 0,c=E,a=e.apply(k,T),a}function p(E){return c=E,o=setTimeout(v,t),u?f(E):a}function m(E){var T=E-l,k=E-c,I=t-T;return h?WA(I,s-k):I}function g(E){var T=E-l,k=E-c;return l===void 0||T>=t||T<0||h&&k>=s}function v(){var E=Kl();if(g(E))return y(E);o=setTimeout(v,m(E))}function y(E){return o=void 0,d&&i?f(E):(i=r=void 0,a)}function x(){o!==void 0&&clearTimeout(o),c=0,i=l=r=o=void 0}function S(){return o===void 0?a:y(Kl())}function _(){var E=Kl(),T=g(E);if(i=arguments,r=this,l=E,T){if(o===void 0)return p(l);if(h)return clearTimeout(o),o=setTimeout(v,t),f(l)}return o===void 0&&(o=setTimeout(v,t)),a}return _.cancel=x,_.flush=S,_}function qA(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),i=n.createElement("base"),r=n.createElement("a");return n.head.appendChild(i),n.body.appendChild(r),t&&(i.href=t),r.href=e,r.href}const YA=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function on(e){const t=[];for(let n=0,i=e.length;n<i;n++)t.push(e[n]);return t}function wa(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function ZA(e){const t=wa(e,"border-left-width"),n=wa(e,"border-right-width");return e.clientWidth+t+n}function XA(e){const t=wa(e,"border-top-width"),n=wa(e,"border-bottom-width");return e.clientHeight+t+n}function Qp(e,t={}){const n=t.width||ZA(e),i=t.height||XA(e);return{width:n,height:i}}function KA(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const he=16384;function QA(e){(e.width>he||e.height>he)&&(e.width>he&&e.height>he?e.width>e.height?(e.height*=he/e.width,e.width=he):(e.width*=he/e.height,e.height=he):e.width>he?(e.height*=he/e.width,e.width=he):(e.width*=he/e.height,e.height=he))}function _a(e){return new Promise((t,n)=>{const i=new Image;i.decode=()=>t(i),i.onload=()=>t(i),i.onerror=n,i.crossOrigin="anonymous",i.decoding="async",i.src=e})}async function JA(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function tL(e,t,n){const i="http://www.w3.org/2000/svg",r=document.createElementNS(i,"svg"),s=document.createElementNS(i,"foreignObject");return r.setAttribute("width",`${t}`),r.setAttribute("height",`${n}`),r.setAttribute("viewBox",`0 0 ${t} ${n}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),r.appendChild(s),s.appendChild(e),JA(r)}const ie=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||ie(n,t)};function eL(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function nL(e){return on(e).map(t=>{const n=e.getPropertyValue(t),i=e.getPropertyPriority(t);return`${t}: ${n}${i?" !important":""};`}).join(" ")}function iL(e,t,n){const i=`.${e}:${t}`,r=n.cssText?eL(n):nL(n);return document.createTextNode(`${i}{${r}}`)}function Jp(e,t,n){const i=window.getComputedStyle(e,n),r=i.getPropertyValue("content");if(r===""||r==="none")return;const s=YA();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(iL(s,n,i)),t.appendChild(a)}function rL(e,t){Jp(e,t,":before"),Jp(e,t,":after")}const tg="application/font-woff",eg="image/jpeg",sL={woff:tg,woff2:tg,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:eg,jpeg:eg,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function aL(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Ql(e){const t=aL(e).toLowerCase();return sL[t]||""}function oL(e){return e.split(/,/)[1]}function Jl(e){return e.search(/^(data:)/)!==-1}function ng(e,t){return`data:${t};base64,${e}`}async function ig(e,t,n){const i=await fetch(e,t);if(i.status===404)throw new Error(`Resource "${i.url}" not found`);const r=await i.blob();return new Promise((s,a)=>{const o=new FileReader;o.onerror=a,o.onloadend=()=>{try{s(n({res:i,result:o.result}))}catch(l){a(l)}},o.readAsDataURL(r)})}const tc={};function lL(e,t,n){let i=e.replace(/\?.*/,"");return n&&(i=e),/ttf|otf|eot|woff2?/i.test(i)&&(i=i.replace(/.*\//,"")),t?`[${t}]${i}`:i}async function ec(e,t,n){const i=lL(e,t,n.includeQueryParams);if(tc[i]!=null)return tc[i];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let r;try{const s=await ig(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),oL(o)));r=ng(s,t)}catch(s){r=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return tc[i]=r,r}async function cL(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):_a(t)}async function uL(e,t){if(e.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,a==null||a.drawImage(e,0,0,s.width,s.height);const o=s.toDataURL();return _a(o)}const n=e.poster,i=Ql(n),r=await ec(n,i,t);return _a(r)}async function hL(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await Ea(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function dL(e,t){return ie(e,HTMLCanvasElement)?cL(e):ie(e,HTMLVideoElement)?uL(e,t):ie(e,HTMLIFrameElement)?hL(e):e.cloneNode(!1)}const fL=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function pL(e,t,n){var i,r;let s=[];return fL(e)&&e.assignedNodes?s=on(e.assignedNodes()):ie(e,HTMLIFrameElement)&&!((i=e.contentDocument)===null||i===void 0)&&i.body?s=on(e.contentDocument.body.childNodes):s=on(((r=e.shadowRoot)!==null&&r!==void 0?r:e).childNodes),s.length===0||ie(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>Ea(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function gL(e,t){const n=t.style;if(!n)return;const i=window.getComputedStyle(e);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):on(i).forEach(r=>{let s=i.getPropertyValue(r);r==="font-size"&&s.endsWith("px")&&(s=`${Math.floor(parseFloat(s.substring(0,s.length-2)))-.1}px`),ie(e,HTMLIFrameElement)&&r==="display"&&s==="inline"&&(s="block"),r==="d"&&t.getAttribute("d")&&(s=`path(${t.getAttribute("d")})`),n.setProperty(r,s,i.getPropertyPriority(r))})}function mL(e,t){ie(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),ie(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function vL(e,t){if(ie(e,HTMLSelectElement)){const n=t,i=Array.from(n.children).find(r=>e.value===r.getAttribute("value"));i&&i.setAttribute("selected","")}}function yL(e,t){return ie(t,Element)&&(gL(e,t),rL(e,t),mL(e,t),vL(e,t)),t}async function xL(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const i={};for(let s=0;s<n.length;s++){const a=n[s].getAttribute("xlink:href");if(a){const o=e.querySelector(a),l=document.querySelector(a);!o&&l&&!i[a]&&(i[a]=await Ea(l,t,!0))}}const r=Object.values(i);if(r.length){const s="http://www.w3.org/1999/xhtml",a=document.createElementNS(s,"svg");a.setAttribute("xmlns",s),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";const o=document.createElementNS(s,"defs");a.appendChild(o);for(let l=0;l<r.length;l++)o.appendChild(r[l]);e.appendChild(a)}return e}async function Ea(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(i=>dL(i,t)).then(i=>pL(e,i,t)).then(i=>yL(e,i)).then(i=>xL(i,t))}const rg=/url\((['"]?)([^'"]+?)\1\)/g,bL=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,wL=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function _L(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function EL(e){const t=[];return e.replace(rg,(n,i,r)=>(t.push(r),n)),t.filter(n=>!Jl(n))}async function SL(e,t,n,i,r){try{const s=n?qA(t,n):t,a=Ql(t);let o;if(r){const l=await r(s);o=ng(l,a)}else o=await ec(s,a,i);return e.replace(_L(t),`$1${o}$3`)}catch{}return e}function OL(e,{preferredFontFormat:t}){return t?e.replace(wL,n=>{for(;;){const[i,,r]=bL.exec(n)||[];if(!r)return"";if(r===t)return`src: ${i};`}}):e}function sg(e){return e.search(rg)!==-1}async function ag(e,t,n){if(!sg(e))return e;const i=OL(e,n);return EL(i).reduce((r,s)=>r.then(a=>SL(a,s,t,n)),Promise.resolve(i))}async function Sa(e,t,n){var i;const r=(i=t.style)===null||i===void 0?void 0:i.getPropertyValue(e);if(r){const s=await ag(r,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function TL(e,t){await Sa("background",e,t)||await Sa("background-image",e,t),await Sa("mask",e,t)||await Sa("mask-image",e,t)}async function ML(e,t){const n=ie(e,HTMLImageElement);if(!(n&&!Jl(e.src))&&!(ie(e,SVGImageElement)&&!Jl(e.href.baseVal)))return;const i=n?e.src:e.href.baseVal,r=await ec(i,Ql(i),t);await new Promise((s,a)=>{e.onload=s,e.onerror=a;const o=e;o.decode&&(o.decode=s),o.loading==="lazy"&&(o.loading="eager"),n?(e.srcset="",e.src=r):e.href.baseVal=r})}async function CL(e,t){const n=on(e.childNodes).map(i=>og(i,t));await Promise.all(n).then(()=>e)}async function og(e,t){ie(e,Element)&&(await TL(e,t),await ML(e,t),await CL(e,t))}function $L(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const i=t.style;return i!=null&&Object.keys(i).forEach(r=>{n[r]=i[r]}),e}const lg={};async function cg(e){let t=lg[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},lg[e]=t,t}async function ug(e,t){let n=e.cssText;const i=/url\(["']?([^"')]+)["']?\)/g,r=(n.match(/url\([^)]+\)/g)||[]).map(async s=>{let a=s.replace(i,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),ig(a,t.fetchRequestInit,({result:o})=>(n=n.replace(s,`url(${o})`),[s,o]))});return Promise.all(r).then(()=>n)}function hg(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let i=e.replace(n,"");const r=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=r.exec(i);if(l===null)break;t.push(l[0])}i=i.replace(r,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(a,"gi");for(;;){let l=s.exec(i);if(l===null){if(l=o.exec(i),l===null)break;s.lastIndex=o.lastIndex}else o.lastIndex=s.lastIndex;t.push(l[0])}return t}async function AL(e,t){const n=[],i=[];return e.forEach(r=>{if("cssRules"in r)try{on(r.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=cg(l).then(u=>ug(u,t)).then(u=>hg(u).forEach(h=>{try{r.insertRule(h,h.startsWith("@import")?o+=1:r.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:h,error:d})}})).catch(u=>{console.error("Error loading remote css",u.toString())});i.push(c)}})}catch(s){const a=e.find(o=>o.href==null)||document.styleSheets[0];r.href!=null&&i.push(cg(r.href).then(o=>ug(o,t)).then(o=>hg(o).forEach(l=>{a.insertRule(l,r.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",s)}}),Promise.all(i).then(()=>(e.forEach(r=>{if("cssRules"in r)try{on(r.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${r.href}`,s)}}),n))}function LL(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>sg(t.style.getPropertyValue("src")))}async function DL(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=on(e.ownerDocument.styleSheets),i=await AL(n,t);return LL(i)}async function kL(e,t){const n=await DL(e,t);return(await Promise.all(n.map(i=>{const r=i.parentStyleSheet?i.parentStyleSheet.href:null;return ag(i.cssText,r,t)}))).join(`
|
|
3
|
-
`)}async function RL(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await kL(e,t);if(n){const i=document.createElement("style"),r=document.createTextNode(n);i.appendChild(r),e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}}async function IL(e,t={}){const{width:n,height:i}=Qp(e,t),r=await Ea(e,t,!0);return await RL(r,t),await og(r,t),$L(r,t),await tL(r,n,i)}async function dg(e,t={}){const{width:n,height:i}=Qp(e,t),r=await IL(e,t),s=await _a(r),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||KA(),c=t.canvasWidth||n,u=t.canvasHeight||i;return a.width=c*l,a.height=u*l,t.skipAutoScale||QA(a),a.style.width=`${c}`,a.style.height=`${u}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(s,0,0,a.width,a.height),a}async function NL(e,t={}){return(await dg(e,t)).toDataURL()}async function PL(e,t={}){return(await dg(e,t)).toDataURL("image/jpeg",t.quality||1)}class ln{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const UL="DONT_STYLE_ME_css_styles_verifier";class L extends ln{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=D(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,l,c,u;try{typeof a.getBBox=="function"&&(o=a.getBBox(),l={width:o.width,height:o.height})}catch(d){console.error(d)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.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(l),i.width>0&&i.height>0))return l;if(n.useBoundingRect&&(r(u),i.width>0&&i.height>0))return u}try{const d={width:b(t.node(),"width","baseVal","value"),height:b(t.node(),"height","baseVal","value")};r(d)}catch{r(h),r(l),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=b(t,"style","prefix"),i=D(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",UL),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),D(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=D(n);i.classed("filled",!0),PL(this.getMainContainer(),{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=D(n);i.classed("filled",!0),NL(this.getMainContainer(),{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();D(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=D(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=L.getSVGElementSize(D(this.mainContainer),{useBBox:!0}),n=D(this.mainContainer).attr("class"),i=D(this.mainContainer).selectAll(`.${n} > svg`);let r=0;i.nodes().forEach(function(s){r+=Number(L.getSVGElementSize(D(s),{useBBox:!0}).height)}),r<=t?D(this.mainContainer).attr("height",r):D(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&D(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(O.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(O.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,i=t.clientHeight;const r=ba(()=>{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(O.Chart.RESIZE))},12.5);new ResizeObserver(r).observe(t)}}let nc=class vv extends ln{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:vv.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),r}};function fg(e){const t=BL(pg(e),360);return vn(t,[0,10])||vn(t,[350,0])?{textAnchor:Xe.START,dominantBaseline:Ke.MIDDLE}:vn(t,[10,80])?{textAnchor:Xe.START,dominantBaseline:Ke.HANGING}:vn(t,[80,100])?{textAnchor:Xe.MIDDLE,dominantBaseline:Ke.HANGING}:vn(t,[100,170])?{textAnchor:Xe.END,dominantBaseline:Ke.HANGING}:vn(t,[170,190])?{textAnchor:Xe.END,dominantBaseline:Ke.MIDDLE}:vn(t,[190,260])?{textAnchor:Xe.END,dominantBaseline:Ke.BASELINE}:vn(t,[260,280])?{textAnchor:Xe.MIDDLE,dominantBaseline:Ke.BASELINE}:{textAnchor:Xe.START,dominantBaseline:Ke.BASELINE}}function BL(e,t){return(e%t+t)%t}function vn(e,[t,n]){return e>=t&&e<=n}function pg(e){return e*(180/Math.PI)}function At(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 VL(e,t){return t*Math.sin(e-Math.PI/2)}function gg(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 HL(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 ic(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 GL(e){return e.depth}function FL(e,t){return t-1-e.height}function mg(e,t){return e.sourceLinks.length?e.depth:t-1}function Oa(e){return function(){return e}}function vg(e,t){return Ta(e.source,t.source)||e.index-t.index}function yg(e,t){return Ta(e.target,t.target)||e.index-t.index}function Ta(e,t){return e.y0-t.y0}function rc(e){return e.value}function zL(e){return e.index}function jL(e){return e.nodes}function WL(e){return e.links}function xg(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function bg({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 qL(){let e=0,t=0,n=1,i=1,r=24,s=8,a,o=zL,l=mg,c,u,h=jL,d=WL,f=6;function p(){const w={nodes:h.apply(null,arguments),links:d.apply(null,arguments)};return m(w),g(w),v(w),y(w),_(w),bg(w),w}p.update=function(w){return bg(w),w},p.nodeId=function(w){return arguments.length?(o=typeof w=="function"?w:Oa(w),p):o},p.nodeAlign=function(w){return arguments.length?(l=typeof w=="function"?w:Oa(w),p):l},p.nodeSort=function(w){return arguments.length?(c=w,p):c},p.nodeWidth=function(w){return arguments.length?(r=+w,p):r},p.nodePadding=function(w){return arguments.length?(s=a=+w,p):s},p.nodes=function(w){return arguments.length?(h=typeof w=="function"?w:Oa(w),p):h},p.links=function(w){return arguments.length?(d=typeof w=="function"?w:Oa(w),p):d},p.linkSort=function(w){return arguments.length?(u=w,p):u},p.size=function(w){return arguments.length?(e=t=0,n=+w[0],i=+w[1],p):[n-e,i-t]},p.extent=function(w){return arguments.length?(e=+w[0][0],n=+w[1][0],t=+w[0][1],i=+w[1][1],p):[[e,t],[n,i]]},p.iterations=function(w){return arguments.length?(f=+w,p):f};function m({nodes:w,links:N}){for(const[R,U]of w.entries())U.index=R,U.sourceLinks=[],U.targetLinks=[];const P=new Map(w.map((R,U)=>[o(R,U,w),R]));for(const[R,U]of N.entries()){U.index=R;let{source:F,target:j}=U;typeof F!="object"&&(F=U.source=xg(P,F)),typeof j!="object"&&(j=U.target=xg(P,j)),F.sourceLinks.push(U),j.targetLinks.push(U)}if(u!=null)for(const{sourceLinks:R,targetLinks:U}of w)R.sort(u),U.sort(u)}function g({nodes:w}){for(const N of w)N.value=N.fixedValue===void 0?Math.max(ic(N.sourceLinks,rc),ic(N.targetLinks,rc)):N.fixedValue}function v({nodes:w}){const N=w.length;let P=new Set(w),R=new Set,U=0;for(;P.size;){for(const F of P){F.depth=U;for(const{target:j}of F.sourceLinks)R.add(j)}if(++U>N)throw new Error("circular link");P=R,R=new Set}}function y({nodes:w}){const N=w.length;let P=new Set(w),R=new Set,U=0;for(;P.size;){for(const F of P){F.height=U;for(const{source:j}of F.targetLinks)R.add(j)}if(++U>N)throw new Error("circular link");P=R,R=new Set}}function x({nodes:w}){const N=gg(w,U=>U.depth)+1,P=(n-e-r)/(N-1),R=new Array(N);for(const U of w){const F=Math.max(0,Math.min(N-1,Math.floor(l.call(null,U,N))));U.layer=F,U.x0=e+F*P,U.x1=U.x0+r,R[F]?R[F].push(U):R[F]=[U]}if(c)for(const U of R)U.sort(c);return R}function S(w){const N=HL(w,P=>(i-t-(P.length-1)*a)/ic(P,rc));for(const P of w){let R=t;for(const U of P){U.y0=R,U.y1=R+U.value*N,R=U.y1+a;for(const F of U.sourceLinks)F.width=F.value*N}R=(i-R+a)/(P.length+1);for(let U=0;U<P.length;++U){const F=P[U];F.y0+=R*(U+1),F.y1+=R*(U+1)}V(P)}}function _(w){const N=x(w);a=Math.min(s,(i-t)/(gg(N,P=>P.length)-1)),S(N);for(let P=0;P<f;++P){const R=Math.pow(.99,P),U=Math.max(1-R,(P+1)/f);T(N,R,U),E(N,R,U)}}function E(w,N,P){for(let R=1,U=w.length;R<U;++R){const F=w[R];for(const j of F){let K=0,ut=0;for(const{source:Y,value:ct}of j.targetLinks){let et=ct*(j.layer-Y.layer);K+=C(Y,j)*et,ut+=et}if(!(ut>0))continue;let G=(K/ut-j.y0)*N;j.y0+=G,j.y1+=G,M(j)}c===void 0&&F.sort(Ta),k(F,P)}}function T(w,N,P){for(let R=w.length,U=R-2;U>=0;--U){const F=w[U];for(const j of F){let K=0,ut=0;for(const{target:Y,value:ct}of j.sourceLinks){let et=ct*(Y.layer-j.layer);K+=A(j,Y)*et,ut+=et}if(!(ut>0))continue;let G=(K/ut-j.y0)*N;j.y0+=G,j.y1+=G,M(j)}c===void 0&&F.sort(Ta),k(F,P)}}function k(w,N){const P=w.length>>1,R=w[P];$(w,R.y0-a,P-1,N),I(w,R.y1+a,P+1,N),$(w,i,w.length-1,N),I(w,t,0,N)}function I(w,N,P,R){for(;P<w.length;++P){const U=w[P],F=(N-U.y0)*R;F>1e-6&&(U.y0+=F,U.y1+=F),N=U.y1+a}}function $(w,N,P,R){for(;P>=0;--P){const U=w[P],F=(U.y1-N)*R;F>1e-6&&(U.y0-=F,U.y1-=F),N=U.y0-a}}function M({sourceLinks:w,targetLinks:N}){if(u===void 0){for(const{source:{sourceLinks:P}}of N)P.sort(yg);for(const{target:{targetLinks:P}}of w)P.sort(vg)}}function V(w){if(u===void 0)for(const{sourceLinks:N,targetLinks:P}of w)N.sort(yg),P.sort(vg)}function C(w,N){let P=w.y0-(w.sourceLinks.length-1)*a/2;for(const{target:R,width:U}of w.sourceLinks){if(R===N)break;P+=U+a}for(const{source:R,width:U}of N.targetLinks){if(R===w)break;P-=U}return P}function A(w,N){let P=N.y0-(N.targetLinks.length-1)*a/2;for(const{source:R,width:U}of N.targetLinks){if(R===w)break;P+=U+a}for(const{target:R,width:U}of w.sourceLinks){if(R===N)break;P-=U}return P}return p}var sc=Math.PI,ac=2*sc,Wn=1e-6,YL=ac-Wn;function oc(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function wg(){return new oc}oc.prototype=wg.prototype={constructor:oc,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,l=i-t,c=s-e,u=a-t,h=c*c+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>Wn)if(!(Math.abs(u*o-l*c)>Wn)||!r)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var d=n-s,f=i-a,p=o*o+l*l,m=d*d+f*f,g=Math.sqrt(p),v=Math.sqrt(h),y=r*Math.tan((sc-Math.acos((p+h-m)/(2*g*v)))/2),x=y/v,S=y/g;Math.abs(x-1)>Wn&&(this._+="L"+(e+x*c)+","+(t+x*u)),this._+="A"+r+","+r+",0,0,"+ +(u*d>c*f)+","+(this._x1=e+S*o)+","+(this._y1=t+S*l)}},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),l=e+a,c=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"+l+","+c:(Math.abs(this._x1-l)>Wn||Math.abs(this._y1-c)>Wn)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%ac+ac),h>YL?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>Wn&&(this._+="A"+n+","+n+",0,"+ +(h>=sc)+","+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 _g(e){return function(){return e}}function ZL(e){return e[0]}function XL(e){return e[1]}var KL=Array.prototype.slice;function QL(e){return e.source}function JL(e){return e.target}function tD(e){var t=QL,n=JL,i=ZL,r=XL,s=null;function a(){var o,l=KL.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=wg()),e(s,+i.apply(this,(l[0]=c,l)),+r.apply(this,l),+i.apply(this,(l[0]=u,l)),+r.apply(this,l)),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:_g(+o),a):i},a.y=function(o){return arguments.length?(r=typeof o=="function"?o:_g(+o),a):r},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function eD(e,t,n,i,r){e.moveTo(t,n),e.bezierCurveTo(t=(t+i)/2,n,t,r,i,r)}function nD(){return tD(eD)}function iD(e){return[e.source.x1,e.y0]}function rD(e){return[e.target.x0,e.y1]}function sD(){return nD().source(iD).target(rD)}function aD(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function oD(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 lD={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 Ma(n)}function Ma(e){this._=e}function cD(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}})}Ma.prototype=Eg.prototype={constructor:Ma,on:function(e,t){var n=this._,i=cD(e+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((r=(e=i[s]).type)&&(r=uD(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]=Sg(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Sg(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 Ma(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 uD(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function Sg(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=lD,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var hD=oD(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Eg},Symbol.toStringTag,{value:"Module"}))).dispatch,lc=Math.PI/180,Rr=64,Ca=2048,dD=function(){var e=[256,256],t=fD,n=pD,i=gD,r=Og,s=Og,a=mD,o=vD,l=Tg,c=[],u=1/0,h=hD("word","end"),d=null,f=Math.random,p={},m=SD;p.canvas=function(y){return arguments.length?(m=yn(y),p):m},p.start=function(){var y=g(m()),x=ED((e[0]>>5)*e[1]),S=null,_=c.length,E=-1,T=[],k=c.map(function($,M){return $.text=t.call(this,$,M),$.font=n.call(this,$,M),$.style=r.call(this,$,M),$.weight=s.call(this,$,M),$.rotate=a.call(this,$,M),$.size=~~i.call(this,$,M),$.padding=o.call(this,$,M),$}).sort(function($,M){return M.size-$.size});return d&&clearInterval(d),d=setInterval(I,0),I(),p;function I(){for(var $=Date.now();Date.now()-$<u&&++E<_&&d;){var M=k[E];M.x=e[0]*(f()+.5)>>1,M.y=e[1]*(f()+.5)>>1,yD(y,M,k,E),M.hasText&&v(x,M,S)&&(T.push(M),h.call("word",p,M),S?bD(S,M):S=[{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)}E>=_&&(p.stop(),h.call("end",p,T,S))}},p.stop=function(){return d&&(clearInterval(d),d=null),p};function g(y){y.width=y.height=1;var x=Math.sqrt(y.getContext("2d").getImageData(0,0,1,1).data.length>>2);y.width=(Rr<<5)/x,y.height=Ca/x;var S=y.getContext("2d");return S.fillStyle=S.strokeStyle="red",S.textAlign="center",{context:S,ratio:x}}function v(y,x,S){e[0],e[1];for(var _=x.x,E=x.y,T=Math.sqrt(e[0]*e[0]+e[1]*e[1]),k=l(e),I=f()<.5?1:-1,$=-I,M,V,C;(M=k($+=I))&&(V=~~M[0],C=~~M[1],!(Math.min(Math.abs(V),Math.abs(C))>=T));)if(x.x=_+V,x.y=E+C,!(x.x+x.x0<0||x.y+x.y0<0||x.x+x.x1>e[0]||x.y+x.y1>e[1])&&(!S||!xD(x,y,e[0]))&&(!S||wD(x,S))){for(var A=x.sprite,w=x.width>>5,N=e[0]>>5,P=x.x-(w<<4),R=P&127,U=32-R,F=x.y1-x.y0,j=(x.y+x.y0)*N+(P>>5),K,ut=0;ut<F;ut++){K=0;for(var G=0;G<=w;G++)y[j+G]|=K<<U|(G<w?(K=A[ut*w+G])>>>R:0);j+=N}return delete x.sprite,!0}return!1}return p.timeInterval=function(y){return arguments.length?(u=y??1/0,p):u},p.words=function(y){return arguments.length?(c=y,p):c},p.size=function(y){return arguments.length?(e=[+y[0],+y[1]],p):e},p.font=function(y){return arguments.length?(n=yn(y),p):n},p.fontStyle=function(y){return arguments.length?(r=yn(y),p):r},p.fontWeight=function(y){return arguments.length?(s=yn(y),p):s},p.rotate=function(y){return arguments.length?(a=yn(y),p):a},p.text=function(y){return arguments.length?(t=yn(y),p):t},p.spiral=function(y){return arguments.length?(l=OD[y]||y,p):l},p.fontSize=function(y){return arguments.length?(i=yn(y),p):i},p.padding=function(y){return arguments.length?(o=yn(y),p):o},p.random=function(y){return arguments.length?(f=y,p):f},p.on=function(){var y=h.on.apply(h,arguments);return y===h?p:y},p};function fD(e){return e.text}function pD(){return"serif"}function Og(){return"normal"}function gD(e){return Math.sqrt(e.value)}function mD(){return(~~(Math.random()*6)-3)*30}function vD(){return 1}function yD(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(Rr<<5)/s,Ca/s);var a=0,o=0,l=0,c=n.length;for(--i;++i<c;){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*lc),f=Math.cos(t.rotate*lc),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>l&&(l=h),a+u>=Rr<<5&&(a=0,o+=l,l=0),o+h>=Ca)break;r.translate((a+(u>>1))/s,(o+(h>>1))/s),t.rotate&&r.rotate(t.rotate*lc),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 y=r.getImageData(0,0,(Rr<<5)/s,Ca/s).data,x=[];--i>=0;)if(t=n[i],!!t.hasText){for(var u=t.width,S=u>>5,h=t.y1-t.y0,_=0;_<h*S;_++)x[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var E=0,T=-1,k=0;k<h;k++){for(var _=0;_<u;_++){var I=S*k+(_>>5),$=y[(o+k)*(Rr<<5)+(a+_)<<2]?1<<31-_%32:0;x[I]|=$,E|=$}E?T=k:(t.y0++,h--,k--,o++)}t.y1=t.y0+T,t.sprite=x.slice(0,(t.y1-t.y0)*S)}}}function xD(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,l=e.y1-e.y0,c=(e.y+e.y0)*n+(s>>5),u,h=0;h<l;h++){u=0;for(var d=0;d<=r;d++)if((u<<o|(d<r?(u=i[h*r+d])>>>a:0))&t[c+d])return!0;c+=n}return!1}function bD(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 wD(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 Tg(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function _D(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 ED(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function SD(){return document.createElement("canvas")}function yn(e){return typeof e=="function"?e:function(){return e}}var OD={archimedean:Tg,rectangular:_D};const TD=aD(dD);function MD(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 CD(e){return function(t){return e==null?void 0:e[t]}}var $D={À:"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"},AD=CD($D);const LD=AD;var DD=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,kD="\\u0300-\\u036f",RD="\\ufe20-\\ufe2f",ID="\\u20d0-\\u20ff",ND=kD+RD+ID,PD="["+ND+"]",UD=RegExp(PD,"g");function BD(e){return e=Tr(e),e&&e.replace(DD,LD).replace(UD,"")}var VD=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function HD(e){return e.match(VD)||[]}var GD=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function FD(e){return GD.test(e)}var Mg="\\ud800-\\udfff",zD="\\u0300-\\u036f",jD="\\ufe20-\\ufe2f",WD="\\u20d0-\\u20ff",qD=zD+jD+WD,Cg="\\u2700-\\u27bf",$g="a-z\\xdf-\\xf6\\xf8-\\xff",YD="\\xac\\xb1\\xd7\\xf7",ZD="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",XD="\\u2000-\\u206f",KD=" \\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",Ag="A-Z\\xc0-\\xd6\\xd8-\\xde",QD="\\ufe0e\\ufe0f",Lg=YD+ZD+XD+KD,Dg="['’]",kg="["+Lg+"]",JD="["+qD+"]",Rg="\\d+",tk="["+Cg+"]",Ig="["+$g+"]",Ng="[^"+Mg+Lg+Rg+Cg+$g+Ag+"]",ek="\\ud83c[\\udffb-\\udfff]",nk="(?:"+JD+"|"+ek+")",ik="[^"+Mg+"]",Pg="(?:\\ud83c[\\udde6-\\uddff]){2}",Ug="[\\ud800-\\udbff][\\udc00-\\udfff]",Oi="["+Ag+"]",rk="\\u200d",Bg="(?:"+Ig+"|"+Ng+")",sk="(?:"+Oi+"|"+Ng+")",Vg="(?:"+Dg+"(?:d|ll|m|re|s|t|ve))?",Hg="(?:"+Dg+"(?:D|LL|M|RE|S|T|VE))?",Gg=nk+"?",Fg="["+QD+"]?",ak="(?:"+rk+"(?:"+[ik,Pg,Ug].join("|")+")"+Fg+Gg+")*",ok="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",lk="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ck=Fg+Gg+ak,uk="(?:"+[tk,Pg,Ug].join("|")+")"+ck,hk=RegExp([Oi+"?"+Ig+"+"+Vg+"(?="+[kg,Oi,"$"].join("|")+")",sk+"+"+Hg+"(?="+[kg,Oi+Bg,"$"].join("|")+")",Oi+"?"+Bg+"+"+Vg,Oi+"+"+Hg,lk,ok,Rg,uk].join("|"),"g");function dk(e){return e.match(hk)||[]}function fk(e,t,n){return e=Tr(e),t=n?void 0:t,t===void 0?FD(e)?dk(e):HD(e):e.match(t)||[]}var pk="['’]",gk=RegExp(pk,"g");function zg(e){return function(t){return MD(fk(BD(t).replace(gk,"")),e,"")}}function mk(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function jg(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=kr(n),n=n===n?n:0),t!==void 0&&(t=kr(t),t=t===t?t:0),mk(kr(e),t,n)}function vk(e,t){var n=-1,i=Hn(e)?Array(e.length):[];return Xl(e,function(r,s,a){i[++n]=t(r,s,a)}),i}function yk(e,t){var n=Gt(e)?Lf:vk;return n(e,ma(t))}var xk=1/0;function bk(e,t){return ha(yk(e,t),xk)}function Wg(e,t){return ga(e,t)}var wk=zg(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Ti=wk;function _k(e,t){var n;return Xl(e,function(i,r,s){return n=t(i,r,s),!n}),!!n}function Ek(e,t,n){var i=Gt(e)?Op:_k;return n&&Hf(e,t,n)&&(t=void 0),i(e,ma(t))}class lt{constructor(t,n,i){if(this.type="",this.renderType=q.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,i&&(this.configs=i,this.configs.id)){const r=b(this.model.getOptions(),"style","prefix");this.id=`${r}--${this.configs.id}`}this.parent||this.setParent(D(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=b(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=b(this.model.getOptions(),"style","prefix"),i=this.id?`#${this.id}`:"",r=L.appendOrSelect(this.parent,`${this.renderType===q.SVG?"svg":"div"}${i}.${ne}--${n}--${this.type}`);if(t.withinChartClip){const s=this.model.get("chartClipId");if(s){const a=D(`#${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?X({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const qg=class extends lt{constructor(){super(...arguments),this.type="toolbar",this.renderType=q.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(O.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(O.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(b(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,l=>l.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",l=>l.shouldBeDisabled()).attr("aria-disabled",l=>l.shouldBeDisabled()).attr("aria-label",l=>l.title).html(l=>`
|
|
1
|
+
(function(nt,xe){typeof exports=="object"&&typeof module<"u"?xe(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],xe):(nt=typeof globalThis<"u"?globalThis:nt||self,xe(nt.ChartsVue={},nt.Vue))})(this,function(nt,xe){"use strict";function wn(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function bv(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ba(e){let t,n,r;e.length!==2?(t=wn,n=(o,l)=>wn(e(o),l),r=(o,l)=>e(o)-l):(t=e===wn||e===bv?e:wv,n=e,r=e);function i(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const h=c+u>>>1;n(o[h],l)<0?c=h+1:u=h}while(c<u)}return c}function s(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const h=c+u>>>1;n(o[h],l)<=0?c=h+1:u=h}while(c<u)}return c}function a(o,l,c=0,u=o.length){const h=i(o,l,c,u-1);return h>c&&r(o[h-1],l)>-r(o[h],l)?h-1:h}return{left:i,center:a,right:s}}function wv(){return 0}function _v(e){return e===null?NaN:+e}function*Ev(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const Sv=Ba(wn).right;Ba(_v).center;const Va=Sv;function Ov(e,t){let n=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(i=+i)>=i&&++n}return n}function be(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let s of e)(s=t(s,++i,e))!=null&&(n===void 0?s>=s&&(n=r=s):(n>s&&(n=s),r<s&&(r=s)))}return[n,r]}class _n{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const s=n[i],a=t+s,o=Math.abs(t)<Math.abs(s)?t-(a-s):s-(a-t);o&&(n[r++]=o),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,s,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,i=t[--n],a=r+i,s=i-(a-r),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(i=s*2,r=a+i,i==r-a&&(a=r))}return a}}class Nc extends Map{constructor(t,n=Cv){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(Pc(this,t))}has(t){return super.has(Pc(this,t))}set(t,n){return super.set(Tv(this,t),n)}delete(t){return super.delete(Mv(this,t))}}function Pc({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Tv({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Mv({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Cv(e){return e!==null&&typeof e=="object"?e.valueOf():e}function $v(e){return e}function Av(e=wn){if(e===wn)return Uc;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Uc(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var Lv=Array.prototype,Dv=Lv.slice;function Ha(e){return()=>e}const kv=Math.sqrt(50),Rv=Math.sqrt(10),Iv=Math.sqrt(2);function Bi(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=kv?10:s>=Rv?5:s>=Iv?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/a,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?Bi(e,t,n*2):[o,l,c]}function Vi(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,a]=r?Bi(t,e,n):Bi(e,t,n);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(i+c)/-a;else for(let c=0;c<o;++c)l[c]=(i+c)*a;return l}function qn(e,t,n){return t=+t,e=+e,n=+n,Bi(e,t,n)[2]}function Ga(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?qn(t,e,n):qn(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Nv(e,t,n){let r;for(;;){const i=qn(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function Pv(e){return Math.max(1,Math.ceil(Math.log(Ov(e))/Math.LN2)+1)}function Uv(){var e=$v,t=be,n=Pv;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(i[s],s,i);var u=t(c),h=u[0],d=u[1],f=n(c,h,d);if(!Array.isArray(f)){const x=d,S=+f;if(t===be&&([h,d]=Nv(h,d,S)),f=Vi(h,d,S),f[0]<=h&&(l=qn(h,d,S)),f[f.length-1]>=d)if(x>=d&&t===be){const _=qn(h,d,S);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),y;for(s=0;s<=p;++s)y=v[s]=[],y.x0=s>0?f[s-1]:h,y.x1=s<p?f[s]:d;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&h<=o&&o<=d&&v[Math.min(p,Math.floor((o-h)/l))].push(i[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&h<=o&&o<=d){const x=Math.floor((h-o)*l);v[Math.min(p,x+(f[x]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&h<=o&&o<=d&&v[Va(f,o,0,p)].push(i[s]);return v}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Ha(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Ha([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Ha(Array.isArray(i)?Dv.call(i):i),r):n},r}function En(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function un(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Bc(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Uc:Av(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),h=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*h*(l-h)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*h/l+d)),p=Math.min(r,Math.floor(t+(l-c)*h/l+d));Bc(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(Dr(e,n,t),i(e[r],s)>0&&Dr(e,n,r);a<o;){for(Dr(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?Dr(e,n,o):(++o,Dr(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function Dr(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Fa(e,t,n){if(e=Float64Array.from(Ev(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return un(e);if(t>=1)return En(e);var r,i=(r-1)*t,s=Math.floor(i),a=En(Bc(e,s).subarray(0,s+1)),o=un(e.subarray(s+1));return a+(o-a)*(i-s)}}function*Bv(e){for(const t of e)yield*t}function Vc(e){return Array.from(Bv(e))}function Vv(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function Hv(e){return e}var Hi=1,Gi=2,za=3,kr=4,Hc=1e-6;function Gv(e){return"translate("+e+",0)"}function Fv(e){return"translate(0,"+e+")"}function zv(e){return t=>+e(t)}function jv(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function Wv(){return!this.__axis}function Fi(e,t){var n=[],r=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===Hi||e===kr?-1:1,u=e===kr||e===Gi?"x":"y",h=e===Hi||e===za?Gv:Fv;function d(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):Hv),g=Math.max(s,0)+o,v=t.range(),y=+v[0]+l,x=+v[v.length-1]+l,S=(t.bandwidth?jv:zv)(t.copy(),l),_=f.selection?f.selection():f,E=_.selectAll(".domain").data([null]),T=_.selectAll(".tick").data(p,t).order(),k=T.exit(),I=T.enter().append("g").attr("class","tick"),$=T.select("line"),M=T.select("text");E=E.merge(E.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),T=T.merge(I),$=$.merge(I.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),M=M.merge(I.append("text").attr("fill","currentColor").attr(u,c*g).attr("dy",e===Hi?"0em":e===za?"0.71em":"0.32em")),f!==_&&(E=E.transition(f),T=T.transition(f),$=$.transition(f),M=M.transition(f),k=k.transition(f).attr("opacity",Hc).attr("transform",function(V){return isFinite(V=S(V))?h(V+l):this.getAttribute("transform")}),I.attr("opacity",Hc).attr("transform",function(V){var C=this.parentNode.__axis;return h((C&&isFinite(C=C(V))?C:S(V))+l)})),k.remove(),E.attr("d",e===kr||e===Gi?a?"M"+c*a+","+y+"H"+l+"V"+x+"H"+c*a:"M"+l+","+y+"V"+x:a?"M"+y+","+c*a+"V"+l+"H"+x+"V"+c*a:"M"+y+","+l+"H"+x),T.attr("opacity",1).attr("transform",function(V){return h(S(V)+l)}),$.attr(u+"2",c*s),M.attr(u,c*g).text(m),_.filter(Wv).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Gi?"start":e===kr?"end":"middle"),_.each(function(){this.__axis=S})}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?(r=f==null?null:Array.from(f),d):r&&r.slice()},d.tickFormat=function(f){return arguments.length?(i=f,d):i},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?(l=+f,d):l},d}function qv(e){return Fi(Hi,e)}function Yv(e){return Fi(Gi,e)}function ja(e){return Fi(za,e)}function Gc(e){return Fi(kr,e)}var Xv={value:()=>{}};function Wa(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new zi(n)}function zi(e){this._=e}function Zv(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}zi.prototype=Wa.prototype={constructor:zi,on:function(e,t){var n=this._,r=Zv(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=Kv(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Fc(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Fc(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new zi(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function Kv(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Fc(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Xv,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var qa="http://www.w3.org/1999/xhtml";const zc={svg:"http://www.w3.org/2000/svg",xhtml:qa,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ji(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),zc.hasOwnProperty(t)?{space:zc[t],local:e}:e}function Qv(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===qa&&t.documentElement.namespaceURI===qa?t.createElement(e):t.createElementNS(n,e)}}function Jv(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jc(e){var t=ji(e);return(t.local?Jv:Qv)(t)}function t0(){}function Ya(e){return e==null?t0:function(){return this.querySelector(e)}}function e0(e){typeof e!="function"&&(e=Ya(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=new Array(a),l,c,u=0;u<a;++u)(l=s[u])&&(c=e.call(l,l.__data__,u,s))&&("__data__"in l&&(c.__data__=l.__data__),o[u]=c);return new ae(r,this._parents)}function n0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function r0(){return[]}function Wc(e){return e==null?r0:function(){return this.querySelectorAll(e)}}function i0(e){return function(){return n0(e.apply(this,arguments))}}function s0(e){typeof e=="function"?e=i0(e):e=Wc(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(r.push(e.call(l,l.__data__,c,a)),i.push(l));return new ae(r,i)}function qc(e){return function(){return this.matches(e)}}function Yc(e){return function(t){return t.matches(e)}}var a0=Array.prototype.find;function o0(e){return function(){return a0.call(this.children,e)}}function l0(){return this.firstElementChild}function c0(e){return this.select(e==null?l0:o0(typeof e=="function"?e:Yc(e)))}var u0=Array.prototype.filter;function h0(){return Array.from(this.children)}function d0(e){return function(){return u0.call(this.children,e)}}function f0(e){return this.selectAll(e==null?h0:d0(typeof e=="function"?e:Yc(e)))}function p0(e){typeof e!="function"&&(e=qc(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new ae(r,this._parents)}function Xc(e){return new Array(e.length)}function g0(){return new ae(this._enter||this._groups.map(Xc),this._parents)}function Wi(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Wi.prototype={constructor:Wi,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 m0(e){return function(){return e}}function v0(e,t,n,r,i,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],r[a]=o):n[a]=new Wi(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function y0(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,h=s.length,d=new Array(u),f;for(o=0;o<u;++o)(l=t[o])&&(d[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?i[o]=l:c.set(f,l));for(o=0;o<h;++o)f=a.call(e,s[o],o,s)+"",(l=c.get(f))?(r[o]=l,l.__data__=s[o],c.delete(f)):n[o]=new Wi(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(d[o])===l&&(i[o]=l)}function x0(e){return e.__data__}function b0(e,t){if(!arguments.length)return Array.from(this,x0);var n=t?y0:v0,r=this._parents,i=this._groups;typeof e!="function"&&(e=m0(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var u=r[c],h=i[c],d=h.length,f=w0(e.call(u,u&&u.__data__,c,r)),p=f.length,m=o[c]=new Array(p),g=a[c]=new Array(p),v=l[c]=new Array(d);n(u,h,m,g,v,f,t);for(var y=0,x=0,S,_;y<p;++y)if(S=m[y]){for(y>=x&&(x=y+1);!(_=g[x])&&++x<p;);S._next=_||null}}return a=new ae(a,r),a._enter=o,a._exit=l,a}function w0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function _0(){return new ae(this._exit||this._groups.map(Xc),this._parents)}function E0(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function S0(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var c=n[l],u=r[l],h=c.length,d=o[l]=new Array(h),f,p=0;p<h;++p)(f=c[p]||u[p])&&(d[p]=f);for(;l<i;++l)o[l]=n[l];return new ae(o,this._parents)}function O0(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function T0(e){e||(e=M0);function t(h,d){return h&&d?e(h.__data__,d.__data__):!h-!d}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],o=a.length,l=i[s]=new Array(o),c,u=0;u<o;++u)(c=a[u])&&(l[u]=c);l.sort(t)}return new ae(i,this._parents).order()}function M0(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function C0(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function $0(){return Array.from(this)}function A0(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function L0(){let e=0;for(const t of this)++e;return e}function D0(){return!this.node()}function k0(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,o;s<a;++s)(o=i[s])&&e.call(o,o.__data__,s,i);return this}function R0(e){return function(){this.removeAttribute(e)}}function I0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function N0(e,t){return function(){this.setAttribute(e,t)}}function P0(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function U0(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function B0(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 V0(e,t){var n=ji(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?I0:R0:typeof t=="function"?n.local?B0:U0:n.local?P0:N0)(n,t))}function Zc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function H0(e){return function(){this.style.removeProperty(e)}}function G0(e,t,n){return function(){this.style.setProperty(e,t,n)}}function F0(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function z0(e,t,n){return arguments.length>1?this.each((t==null?H0:typeof t=="function"?F0:G0)(e,t,n??"")):Yn(this.node(),e)}function Yn(e,t){return e.style.getPropertyValue(t)||Zc(e).getComputedStyle(e,null).getPropertyValue(t)}function j0(e){return function(){delete this[e]}}function W0(e,t){return function(){this[e]=t}}function q0(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Y0(e,t){return arguments.length>1?this.each((t==null?j0:typeof t=="function"?q0:W0)(e,t)):this.node()[e]}function Kc(e){return e.trim().split(/^|\s+/)}function Xa(e){return e.classList||new Qc(e)}function Qc(e){this._node=e,this._names=Kc(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 Jc(e,t){for(var n=Xa(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function tu(e,t){for(var n=Xa(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function X0(e){return function(){Jc(this,e)}}function Z0(e){return function(){tu(this,e)}}function K0(e,t){return function(){(t.apply(this,arguments)?Jc:tu)(this,e)}}function Q0(e,t){var n=Kc(e+"");if(arguments.length<2){for(var r=Xa(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?K0:t?X0:Z0)(n,t))}function J0(){this.textContent=""}function ty(e){return function(){this.textContent=e}}function ey(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function ny(e){return arguments.length?this.each(e==null?J0:(typeof e=="function"?ey:ty)(e)):this.node().textContent}function ry(){this.innerHTML=""}function iy(e){return function(){this.innerHTML=e}}function sy(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function ay(e){return arguments.length?this.each(e==null?ry:(typeof e=="function"?sy:iy)(e)):this.node().innerHTML}function oy(){this.nextSibling&&this.parentNode.appendChild(this)}function ly(){return this.each(oy)}function cy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function uy(){return this.each(cy)}function hy(e){var t=typeof e=="function"?e:jc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function dy(){return null}function fy(e,t){var n=typeof e=="function"?e:jc(e),r=t==null?dy:typeof t=="function"?t:Ya(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function py(){var e=this.parentNode;e&&e.removeChild(this)}function gy(){return this.each(py)}function my(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function vy(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function yy(e){return this.select(e?vy:my)}function xy(e){return arguments.length?this.property("__data__",e):this.node().__data__}function by(e){return function(t){e.call(this,t,this.__data__)}}function wy(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function _y(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function Ey(e,t,n){return function(){var r=this.__on,i,s=by(t);if(r){for(var a=0,o=r.length;a<o;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function Sy(e,t,n){var r=wy(e+""),i,s=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,u;l<c;++l)for(i=0,u=o[l];i<s;++i)if((a=r[i]).type===u.type&&a.name===u.name)return u.value}return}for(o=t?Ey:_y,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function eu(e,t,n){var r=Zc(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Oy(e,t){return function(){return eu(this,e,t)}}function Ty(e,t){return function(){return eu(this,e,t.apply(this,arguments))}}function My(e,t){return this.each((typeof t=="function"?Ty:Oy)(e,t))}function*Cy(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var nu=[null];function ae(e,t){this._groups=e,this._parents=t}function Rr(){return new ae([[document.documentElement]],nu)}function $y(){return this}ae.prototype=Rr.prototype={constructor:ae,select:e0,selectAll:s0,selectChild:c0,selectChildren:f0,filter:p0,data:b0,enter:g0,exit:_0,join:E0,merge:S0,selection:$y,order:O0,sort:T0,call:C0,nodes:$0,node:A0,size:L0,empty:D0,each:k0,attr:V0,style:z0,property:Y0,classed:Q0,text:ny,html:ay,raise:ly,lower:uy,append:hy,insert:fy,remove:gy,clone:yy,datum:xy,on:Sy,dispatch:My,[Symbol.iterator]:Cy};function D(e){return typeof e=="string"?new ae([[document.querySelector(e)]],[document.documentElement]):new ae([[e]],nu)}function Ay(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Sn(e,t){if(e=Ay(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Za={capture:!0,passive:!1};function Ka(e){e.preventDefault(),e.stopImmediatePropagation()}function Ly(e){var t=e.document.documentElement,n=D(e).on("dragstart.drag",Ka,Za);"onselectstart"in t?n.on("selectstart.drag",Ka,Za):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Dy(e,t){var n=e.document.documentElement,r=D(e).on("dragstart.drag",null);t&&(r.on("click.drag",Ka,Za),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function Qa(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ru(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ir(){}var Nr=.7,qi=1/Nr,Xn="\\s*([+-]?\\d+)\\s*",Pr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",De="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ky=/^#([0-9a-f]{3,8})$/,Ry=new RegExp(`^rgb\\(${Xn},${Xn},${Xn}\\)$`),Iy=new RegExp(`^rgb\\(${De},${De},${De}\\)$`),Ny=new RegExp(`^rgba\\(${Xn},${Xn},${Xn},${Pr}\\)$`),Py=new RegExp(`^rgba\\(${De},${De},${De},${Pr}\\)$`),Uy=new RegExp(`^hsl\\(${Pr},${De},${De}\\)$`),By=new RegExp(`^hsla\\(${Pr},${De},${De},${Pr}\\)$`),iu={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};Qa(Ir,He,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:su,formatHex:su,formatHex8:Vy,formatHsl:Hy,formatRgb:au,toString:au});function su(){return this.rgb().formatHex()}function Vy(){return this.rgb().formatHex8()}function Hy(){return hu(this).formatHsl()}function au(){return this.rgb().formatRgb()}function He(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ky.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ou(t):n===3?new te(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Yi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Yi(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=Ry.exec(e))?new te(t[1],t[2],t[3],1):(t=Iy.exec(e))?new te(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ny.exec(e))?Yi(t[1],t[2],t[3],t[4]):(t=Py.exec(e))?Yi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Uy.exec(e))?uu(t[1],t[2]/100,t[3]/100,1):(t=By.exec(e))?uu(t[1],t[2]/100,t[3]/100,t[4]):iu.hasOwnProperty(e)?ou(iu[e]):e==="transparent"?new te(NaN,NaN,NaN,0):null}function ou(e){return new te(e>>16&255,e>>8&255,e&255,1)}function Yi(e,t,n,r){return r<=0&&(e=t=n=NaN),new te(e,t,n,r)}function Gy(e){return e instanceof Ir||(e=He(e)),e?(e=e.rgb(),new te(e.r,e.g,e.b,e.opacity)):new te}function Ja(e,t,n,r){return arguments.length===1?Gy(e):new te(e,t,n,r??1)}function te(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Qa(te,Ja,ru(Ir,{brighter(e){return e=e==null?qi:Math.pow(qi,e),new te(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Nr:Math.pow(Nr,e),new te(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new te(On(this.r),On(this.g),On(this.b),Xi(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:lu,formatHex:lu,formatHex8:Fy,formatRgb:cu,toString:cu}));function lu(){return`#${Tn(this.r)}${Tn(this.g)}${Tn(this.b)}`}function Fy(){return`#${Tn(this.r)}${Tn(this.g)}${Tn(this.b)}${Tn((isNaN(this.opacity)?1:this.opacity)*255)}`}function cu(){const e=Xi(this.opacity);return`${e===1?"rgb(":"rgba("}${On(this.r)}, ${On(this.g)}, ${On(this.b)}${e===1?")":`, ${e})`}`}function Xi(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function On(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Tn(e){return e=On(e),(e<16?"0":"")+e.toString(16)}function uu(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new we(e,t,n,r)}function hu(e){if(e instanceof we)return new we(e.h,e.s,e.l,e.opacity);if(e instanceof Ir||(e=He(e)),!e)return new we;if(e instanceof we)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(t===s?a=(n-r)/o+(n<r)*6:n===s?a=(r-t)/o+2:a=(t-n)/o+4,o/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new we(a,o,l,e.opacity)}function to(e,t,n,r){return arguments.length===1?hu(e):new we(e,t,n,r??1)}function we(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Qa(we,to,ru(Ir,{brighter(e){return e=e==null?qi:Math.pow(qi,e),new we(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Nr:Math.pow(Nr,e),new we(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new te(eo(e>=240?e-240:e+120,i,r),eo(e,i,r),eo(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new we(du(this.h),Zi(this.s),Zi(this.l),Xi(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=Xi(this.opacity);return`${e===1?"hsl(":"hsla("}${du(this.h)}, ${Zi(this.s)*100}%, ${Zi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function du(e){return e=(e||0)%360,e<0?e+360:e}function Zi(e){return Math.max(0,Math.min(1,e||0))}function eo(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 no=e=>()=>e;function zy(e,t){return function(n){return e+n*t}}function jy(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Wy(e){return(e=+e)==1?fu:function(t,n){return n-t?jy(t,n,e):no(isNaN(t)?n:t)}}function fu(e,t){var n=t-e;return n?zy(e,n):no(isNaN(e)?t:e)}const Ki=function e(t){var n=Wy(t);function r(i,s){var a=n((i=Ja(i)).r,(s=Ja(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=fu(i.opacity,s.opacity);return function(u){return i.r=a(u),i.g=o(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r}(1);function qy(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function Yy(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Xy(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=Ur(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function Zy(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function oe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Ky(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Ur(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var ro=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,io=new RegExp(ro.source,"g");function Qy(e){return function(){return e}}function Jy(e){return function(t){return e(t)+""}}function pu(e,t){var n=ro.lastIndex=io.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=ro.exec(e))&&(i=io.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:oe(r,i)})),n=io.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?Jy(l[0].x):Qy(t):(t=l.length,function(c){for(var u=0,h;u<t;++u)o[(h=l[u]).i]=h.x(c);return o.join("")})}function Ur(e,t){var n=typeof t,r;return t==null||n==="boolean"?no(t):(n==="number"?oe:n==="string"?(r=He(t))?(t=r,Ki):pu:t instanceof He?Ki:t instanceof Date?Zy:Yy(t)?qy:Array.isArray(t)?Xy:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Ky:oe)(e,t)}function gu(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var mu=180/Math.PI,so={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function vu(e,t,n,r,i,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*mu,skewX:Math.atan(l)*mu,scaleX:a,scaleY:o}}var Qi;function t1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?so:vu(t.a,t.b,t.c,t.d,t.e,t.f)}function e1(e){return e==null||(Qi||(Qi=document.createElementNS("http://www.w3.org/2000/svg","g")),Qi.setAttribute("transform",e),!(e=Qi.transform.baseVal.consolidate()))?so:(e=e.matrix,vu(e.a,e.b,e.c,e.d,e.e,e.f))}function yu(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,h,d,f,p){if(c!==h||u!==d){var m=f.push("translate(",null,t,null,n);p.push({i:m-4,x:oe(c,h)},{i:m-2,x:oe(u,d)})}else(h||d)&&f.push("translate("+h+t+d+n)}function a(c,u,h,d){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),d.push({i:h.push(i(h)+"rotate(",null,r)-2,x:oe(c,u)})):u&&h.push(i(h)+"rotate("+u+r)}function o(c,u,h,d){c!==u?d.push({i:h.push(i(h)+"skewX(",null,r)-2,x:oe(c,u)}):u&&h.push(i(h)+"skewX("+u+r)}function l(c,u,h,d,f,p){if(c!==h||u!==d){var m=f.push(i(f)+"scale(",null,",",null,")");p.push({i:m-4,x:oe(c,h)},{i:m-2,x:oe(u,d)})}else(h!==1||d!==1)&&f.push(i(f)+"scale("+h+","+d+")")}return function(c,u){var h=[],d=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,h,d),a(c.rotate,u.rotate,h,d),o(c.skewX,u.skewX,h,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,h,d),c=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 n1=yu(t1,"px, ","px)","deg)"),r1=yu(e1,", ",")",")");function i1(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var Zn=0,Br=0,Vr=0,xu=1e3,Ji,Hr,ts=0,Mn=0,es=0,Gr=typeof performance=="object"&&performance.now?performance:Date,bu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ao(){return Mn||(bu(s1),Mn=Gr.now()+es)}function s1(){Mn=0}function ns(){this._call=this._time=this._next=null}ns.prototype=wu.prototype={constructor:ns,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ao():+n)+(t==null?0:+t),!this._next&&Hr!==this&&(Hr?Hr._next=this:Ji=this,Hr=this),this._call=e,this._time=n,oo()},stop:function(){this._call&&(this._call=null,this._time=1/0,oo())}};function wu(e,t,n){var r=new ns;return r.restart(e,t,n),r}function a1(){ao(),++Zn;for(var e=Ji,t;e;)(t=Mn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Zn}function _u(){Mn=(ts=Gr.now())+es,Zn=Br=0;try{a1()}finally{Zn=0,l1(),Mn=0}}function o1(){var e=Gr.now(),t=e-ts;t>xu&&(es-=t,ts=e)}function l1(){for(var e,t=Ji,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ji=n);Hr=e,oo(r)}function oo(e){if(!Zn){Br&&(Br=clearTimeout(Br));var t=e-Mn;t>24?(e<1/0&&(Br=setTimeout(_u,e-Gr.now()-es)),Vr&&(Vr=clearInterval(Vr))):(Vr||(ts=Gr.now(),Vr=setInterval(o1,xu)),Zn=1,bu(_u))}}function Eu(e,t,n){var r=new ns;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var c1=Wa("start","end","cancel","interrupt"),u1=[],Su=0,Ou=1,lo=2,rs=3,Tu=4,co=5,is=6;function ss(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;h1(e,n,{name:t,index:r,group:i,on:c1,tween:u1,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Su})}function uo(e,t){var n=_e(e,t);if(n.state>Su)throw new Error("too late; already scheduled");return n}function ke(e,t){var n=_e(e,t);if(n.state>rs)throw new Error("too late; already running");return n}function _e(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function h1(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=wu(s,0,n.time);function s(c){n.state=Ou,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,h,d,f;if(n.state!==Ou)return l();for(u in r)if(f=r[u],f.name===n.name){if(f.state===rs)return Eu(a);f.state===Tu?(f.state=is,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=is,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(Eu(function(){n.state===rs&&(n.state=Tu,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=lo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===lo){for(n.state=rs,i=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))&&(i[++h]=f);i.length=h+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=co,1),h=-1,d=i.length;++h<d;)i[h].call(e,u);n.state===co&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=is,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function ho(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>lo&&r.state<co,r.state=is,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function d1(e){return this.each(function(){ho(this,e)})}function f1(e,t){var n,r;return function(){var i=ke(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,o=r.length;a<o;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function p1(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=ke(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var o={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=o;break}l===c&&i.push(o)}s.tween=i}}function g1(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=_e(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?f1:p1)(n,e,t))}function fo(e,t,n){var r=e._id;return e.each(function(){var i=ke(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return _e(i,r).value[t]}}function Mu(e,t){var n;return(typeof t=="number"?oe:t instanceof He?Ki:(n=He(t))?(t=n,Ki):pu)(e,t)}function m1(e){return function(){this.removeAttribute(e)}}function v1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function y1(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}function x1(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}function b1(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function w1(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function _1(e,t){var n=ji(e),r=n==="transform"?r1:Mu;return this.attrTween(e,typeof t=="function"?(n.local?w1:b1)(n,r,fo(this,"attr."+e,t)):t==null?(n.local?v1:m1)(n):(n.local?x1:y1)(n,r,t))}function E1(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function S1(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function O1(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&S1(e,s)),n}return i._value=t,i}function T1(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&E1(e,s)),n}return i._value=t,i}function M1(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 r=ji(e);return this.tween(n,(r.local?O1:T1)(r,t))}function C1(e,t){return function(){uo(this,e).delay=+t.apply(this,arguments)}}function $1(e,t){return t=+t,function(){uo(this,e).delay=t}}function A1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?C1:$1)(t,e)):_e(this.node(),t).delay}function L1(e,t){return function(){ke(this,e).duration=+t.apply(this,arguments)}}function D1(e,t){return t=+t,function(){ke(this,e).duration=t}}function k1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?L1:D1)(t,e)):_e(this.node(),t).duration}function R1(e,t){if(typeof t!="function")throw new Error;return function(){ke(this,e).ease=t}}function I1(e){var t=this._id;return arguments.length?this.each(R1(t,e)):_e(this.node(),t).ease}function N1(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ke(this,e).ease=n}}function P1(e){if(typeof e!="function")throw new Error;return this.each(N1(this._id,e))}function U1(e){typeof e!="function"&&(e=qc(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new Ge(r,this._parents,this._name,this._id)}function B1(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),o=0;o<s;++o)for(var l=t[o],c=n[o],u=l.length,h=a[o]=new Array(u),d,f=0;f<u;++f)(d=l[f]||c[f])&&(h[f]=d);for(;o<r;++o)a[o]=t[o];return new Ge(a,this._parents,this._name,this._id)}function V1(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 H1(e,t,n){var r,i,s=V1(t)?uo:ke;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function G1(e,t){var n=this._id;return arguments.length<2?_e(this.node(),n).on.on(e):this.each(H1(n,e,t))}function F1(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function z1(){return this.on("end.remove",F1(this._id))}function j1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ya(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var o=r[a],l=o.length,c=s[a]=new Array(l),u,h,d=0;d<l;++d)(u=o[d])&&(h=e.call(u,u.__data__,d,o))&&("__data__"in u&&(h.__data__=u.__data__),c[d]=h,ss(c[d],t,n,d,c,_e(u,n)));return new Ge(s,this._parents,t,n)}function W1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wc(e));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var l=r[o],c=l.length,u,h=0;h<c;++h)if(u=l[h]){for(var d=e.call(u,u.__data__,h,l),f,p=_e(u,n),m=0,g=d.length;m<g;++m)(f=d[m])&&ss(f,t,n,m,d,p);s.push(d),a.push(u)}return new Ge(s,a,t,n)}var q1=Rr.prototype.constructor;function Y1(){return new q1(this._groups,this._parents)}function X1(e,t){var n,r,i;return function(){var s=Yn(this,e),a=(this.style.removeProperty(e),Yn(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Cu(e){return function(){this.style.removeProperty(e)}}function Z1(e,t,n){var r,i=n+"",s;return function(){var a=Yn(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function K1(e,t,n){var r,i,s;return function(){var a=Yn(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Yn(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function Q1(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=ke(this,e),c=l.on,u=l.value[s]==null?o||(o=Cu(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function J1(e,t,n){var r=(e+="")=="transform"?n1:Mu;return t==null?this.styleTween(e,X1(e,r)).on("end.style."+e,Cu(e)):typeof t=="function"?this.styleTween(e,K1(e,r,fo(this,"style."+e,t))).each(Q1(this._id,e)):this.styleTween(e,Z1(e,r,t),n).on("end.style."+e,null)}function tx(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function ex(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&tx(e,a,n)),r}return s._value=t,s}function nx(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,ex(e,t,n??""))}function rx(e){return function(){this.textContent=e}}function ix(e){return function(){var t=e(this);this.textContent=t??""}}function sx(e){return this.tween("text",typeof e=="function"?ix(fo(this,"text",e)):rx(e==null?"":e+""))}function ax(e){return function(t){this.textContent=e.call(this,t)}}function ox(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&ax(i)),t}return r._value=e,r}function lx(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,ox(e))}function cx(){for(var e=this._name,t=this._id,n=$u(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=_e(l,t);ss(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ge(r,this._parents,e,n)}function ux(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--i===0&&s()}};n.each(function(){var c=ke(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),i===0&&s()})}var hx=0;function Ge(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function $u(){return++hx}var Fe=Rr.prototype;Ge.prototype={constructor:Ge,select:j1,selectAll:W1,selectChild:Fe.selectChild,selectChildren:Fe.selectChildren,filter:U1,merge:B1,selection:Y1,transition:cx,call:Fe.call,nodes:Fe.nodes,node:Fe.node,size:Fe.size,empty:Fe.empty,each:Fe.each,on:G1,attr:_1,attrTween:M1,style:J1,styleTween:nx,text:sx,textTween:lx,remove:z1,tween:g1,delay:A1,duration:k1,ease:I1,easeVarying:P1,end:ux,[Symbol.iterator]:Fe[Symbol.iterator]};const dx=e=>+e;function Au(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var fx={time:null,delay:0,duration:250,ease:Au};function px(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 gx(e){var t,n;e instanceof Ge?(t=e._id,e=e._name):(t=$u(),(n=fx).time=ao(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&ss(l,e,t,c,a,n||px(l,t));return new Ge(r,this._parents,e,t)}Rr.prototype.interrupt=d1,Rr.prototype.transition=gx;const po=e=>()=>e;function mx(e,{sourceEvent:t,target:n,selection:r,mode:i,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:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function vx(e){e.stopImmediatePropagation()}function go(e){e.preventDefault(),e.stopImmediatePropagation()}var Lu={name:"drag"},mo={name:"space"},Kn={name:"handle"},Qn={name:"center"};const{abs:Du,max:zt,min:jt}=Math;function ku(e){return[+e[0],+e[1]]}function Ru(e){return[ku(e[0]),ku(e[1])]}var as={name:"x",handles:["w","e"].map(os),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]]}},vo={name:"y",handles:["n","s"].map(os),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]]}},ze={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"},Iu={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Nu={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},yx={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},xx={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function os(e){return{type:e}}function bx(e){return!e.ctrlKey&&!e.button}function wx(){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 _x(){return navigator.maxTouchPoints||"ontouchstart"in this}function yo(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function Ex(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function Pu(){return Sx(as)}function Sx(e){var t=wx,n=bx,r=_x,i=!0,s=Wa("start","brush","end"),a=6,o;function l(g){var v=g.property("__brush",m).selectAll(".overlay").data([os("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",ze.overlay).merge(v).each(function(){var x=yo(this).extent;D(this).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1])}),g.selectAll(".selection").data([os("selection")]).enter().append("rect").attr("class","selection").attr("cursor",ze.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=g.selectAll(".handle").data(e.handles,function(x){return x.type});y.exit().remove(),y.enter().append("rect").attr("class",function(x){return"handle handle--"+x.type}).attr("cursor",function(x){return ze[x.type]}),g.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(r).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)")}l.move=function(g,v,y){g.tween?g.on("start.brush",function(x){u(this,arguments).beforestart().start(x)}).on("interrupt.brush end.brush",function(x){u(this,arguments).end(x)}).tween("brush",function(){var x=this,S=x.__brush,_=u(x,arguments),E=S.selection,T=e.input(typeof v=="function"?v.apply(this,arguments):v,S.extent),k=Ur(E,T);function I($){S.selection=$===1&&T===null?null:k($),c.call(x),_.brush()}return E!==null&&T!==null?I:I(1)}):g.each(function(){var x=this,S=arguments,_=x.__brush,E=e.input(typeof v=="function"?v.apply(x,S):v,_.extent),T=u(x,S).beforestart();ho(x),_.selection=E===null?null:E,c.call(x),T.start(y).brush(y).end(y)})},l.clear=function(g,v){l.move(g,null,v)};function c(){var g=D(this),v=yo(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(y){return y.type[y.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(y){return y.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(y){return y.type==="n"||y.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(y){return y.type==="e"||y.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,y){var x=g.__brush.emitter;return x&&(!y||!x.clean)?x:new h(g,v,y)}function h(g,v,y){this.that=g,this.args=v,this.state=g.__brush,this.active=0,this.clean=y}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,y){var x=D(this.that).datum();s.call(g,this.that,new mx(g,{sourceEvent:v,target:l,selection:e.output(this.state.selection),mode:y,dispatch:s}),x)}};function d(g){if(o&&!g.touches||!n.apply(this,arguments))return;var v=this,y=g.target.__data__.type,x=(i&&g.metaKey?y="overlay":y)==="selection"?Lu:i&&g.altKey?Qn:Kn,S=e===vo?null:yx[y],_=e===as?null:xx[y],E=yo(v),T=E.extent,k=E.selection,I=T[0][0],$,M,V=T[0][1],C,A,w=T[1][0],N,P,R=T[1][1],U,F,j=0,K=0,ut,G=S&&_&&i&&g.shiftKey,Y,ct,et=Array.from(g.touches||[g],J=>{const kt=J.identifier;return J=Sn(J,v),J.point0=J.slice(),J.identifier=kt,J});ho(v);var Lt=u(v,arguments,!0).beforestart();if(y==="overlay"){k&&(ut=!0);const J=[et[0],et[1]||et[0]];E.selection=k=[[$=e===vo?I:jt(J[0][0],J[1][0]),C=e===as?V:jt(J[0][1],J[1][1])],[N=e===vo?w:zt(J[0][0],J[1][0]),U=e===as?R:zt(J[0][1],J[1][1])]],et.length>1&&Dt(g)}else $=k[0][0],C=k[0][1],N=k[1][0],U=k[1][1];M=$,A=C,P=N,F=U;var z=D(v).attr("pointer-events","none"),Q=z.selectAll(".overlay").attr("cursor",ze[y]);if(g.touches)Lt.moved=H,Lt.ended=vt;else{var at=D(g.view).on("mousemove.brush",H,!0).on("mouseup.brush",vt,!0);i&&at.on("keydown.brush",Qt,!0).on("keyup.brush",Jt,!0),Ly(g.view)}c.call(v),Lt.start(g,x.name);function H(J){for(const kt of J.changedTouches||[J])for(const Ui of et)Ui.identifier===kt.identifier&&(Ui.cur=Sn(kt,v));if(G&&!Y&&!ct&&et.length===1){const kt=et[0];Du(kt.cur[0]-kt[0])>Du(kt.cur[1]-kt[1])?ct=!0:Y=!0}for(const kt of et)kt.cur&&(kt[0]=kt.cur[0],kt[1]=kt.cur[1]);ut=!0,go(J),Dt(J)}function Dt(J){const kt=et[0],Ui=kt.point0;var bn;switch(j=kt[0]-Ui[0],K=kt[1]-Ui[1],x){case mo:case Lu:{S&&(j=zt(I-$,jt(w-N,j)),M=$+j,P=N+j),_&&(K=zt(V-C,jt(R-U,K)),A=C+K,F=U+K);break}case Kn:{et[1]?(S&&(M=zt(I,jt(w,et[0][0])),P=zt(I,jt(w,et[1][0])),S=1),_&&(A=zt(V,jt(R,et[0][1])),F=zt(V,jt(R,et[1][1])),_=1)):(S<0?(j=zt(I-$,jt(w-$,j)),M=$+j,P=N):S>0&&(j=zt(I-N,jt(w-N,j)),M=$,P=N+j),_<0?(K=zt(V-C,jt(R-C,K)),A=C+K,F=U):_>0&&(K=zt(V-U,jt(R-U,K)),A=C,F=U+K));break}case Qn:{S&&(M=zt(I,jt(w,$-j*S)),P=zt(I,jt(w,N+j*S))),_&&(A=zt(V,jt(R,C-K*_)),F=zt(V,jt(R,U+K*_)));break}}P<M&&(S*=-1,bn=$,$=N,N=bn,bn=M,M=P,P=bn,y in Iu&&Q.attr("cursor",ze[y=Iu[y]])),F<A&&(_*=-1,bn=C,C=U,U=bn,bn=A,A=F,F=bn,y in Nu&&Q.attr("cursor",ze[y=Nu[y]])),E.selection&&(k=E.selection),Y&&(M=k[0][0],P=k[1][0]),ct&&(A=k[0][1],F=k[1][1]),(k[0][0]!==M||k[0][1]!==A||k[1][0]!==P||k[1][1]!==F)&&(E.selection=[[M,A],[P,F]],c.call(v),Lt.brush(J,x.name))}function vt(J){if(vx(J),J.touches){if(J.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else Dy(J.view,ut),at.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);z.attr("pointer-events","all"),Q.attr("cursor",ze.overlay),E.selection&&(k=E.selection),Ex(k)&&(E.selection=null,c.call(v)),Lt.end(J,x.name)}function Qt(J){switch(J.keyCode){case 16:{G=S&&_;break}case 18:{x===Kn&&(S&&(N=P-j*S,$=M+j*S),_&&(U=F-K*_,C=A+K*_),x=Qn,Dt(J));break}case 32:{(x===Kn||x===Qn)&&(S<0?N=P-j:S>0&&($=M-j),_<0?U=F-K:_>0&&(C=A-K),x=mo,Q.attr("cursor",ze.selection),Dt(J));break}default:return}go(J)}function Jt(J){switch(J.keyCode){case 16:{G&&(Y=ct=G=!1,Dt(J));break}case 18:{x===Qn&&(S<0?N=P:S>0&&($=M),_<0?U=F:_>0&&(C=A),x=Kn,Dt(J));break}case 32:{x===mo&&(J.altKey?(S&&(N=P-j*S,$=M+j*S),_&&(U=F-K*_,C=A+K*_),x=Qn):(S<0?N=P:S>0&&($=M),_<0?U=F:_>0&&(C=A),x=Kn),Q.attr("cursor",ze[y]),Dt(J));break}default:return}go(J)}}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=Ru(t.apply(this,arguments)),g.dim=e,g}return l.extent=function(g){return arguments.length?(t=typeof g=="function"?g:po(Ru(g)),l):t},l.filter=function(g){return arguments.length?(n=typeof g=="function"?g:po(!!g),l):n},l.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:po(!!g),l):r},l.handleSize=function(g){return arguments.length?(a=+g,l):a},l.keyModifiers=function(g){return arguments.length?(i=!!g,l):i},l.on=function(){var g=s.on.apply(s,arguments);return g===s?l:g},l}const xo=Math.PI,bo=2*xo,Cn=1e-6,Ox=bo-Cn;function Uu(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Tx(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Uu;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let Mx=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Uu:Tx(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,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=r-t,c=i-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>Cn)if(!(Math.abs(h*l-c*u)>Cn)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-a,p=i-o,m=l*l+c*c,g=f*f+p*p,v=Math.sqrt(m),y=Math.sqrt(d),x=s*Math.tan((xo-Math.acos((m+d-g)/(2*v*y)))/2),S=x/y,_=x/v;Math.abs(S-1)>Cn&&this._append`L${t+S*u},${n+S*h}`,this._append`A${s},${s},0,0,${+(h*f>u*p)},${this._x1=t+_*l},${this._y1=n+_*c}`}}arc(t,n,r,i,s,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),c=t+o,u=n+l,h=1^a,d=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Cn||Math.abs(this._y1-u)>Cn)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%bo+bo),d>Ox?this._append`A${r},${r},0,1,${h},${t-o},${n-l}A${r},${r},0,1,${h},${this._x1=c},${this._y1=u}`:d>Cn&&this._append`A${r},${r},0,${+(d>=xo)},${h},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function Cx(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ls(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Jn(e){return e=ls(Math.abs(e)),e?e[1]:NaN}function $x(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)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 Lx=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Fr(e){if(!(t=Lx.exec(e)))throw new Error("invalid format: "+e);var t;return new wo({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]})}Fr.prototype=wo.prototype;function wo(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+""}wo.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 Dx(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Bu;function kx(e,t){var n=ls(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(Bu=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+ls(e,Math.max(0,t+s-1))[0]}function Vu(e,t){var n=ls(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Hu={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Cx,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)=>Vu(e*100,t),r:Vu,s:kx,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Gu(e){return e}var Fu=Array.prototype.map,zu=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Rx(e){var t=e.grouping===void 0||e.thousands===void 0?Gu:$x(Fu.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?Gu:Ax(Fu.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(h){h=Fr(h);var d=h.fill,f=h.align,p=h.sign,m=h.symbol,g=h.zero,v=h.width,y=h.comma,x=h.precision,S=h.trim,_=h.type;_==="n"?(y=!0,_="g"):Hu[_]||(x===void 0&&(x=12),S=!0,_="g"),(g||d==="0"&&f==="=")&&(g=!0,d="0",f="=");var E=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",T=m==="$"?r:/[%p]/.test(_)?a:"",k=Hu[_],I=/[defgprs%]/.test(_);x=x===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function $(M){var V=E,C=T,A,w,N;if(_==="c")C=k(M)+C,M="";else{M=+M;var P=M<0||1/M<0;if(M=isNaN(M)?l:k(Math.abs(M),x),S&&(M=Dx(M)),P&&+M==0&&p!=="+"&&(P=!1),V=(P?p==="("?p:o:p==="-"||p==="("?"":p)+V,C=(_==="s"?zu[8+Bu/3]:"")+C+(P&&p==="("?")":""),I){for(A=-1,w=M.length;++A<w;)if(N=M.charCodeAt(A),48>N||N>57){C=(N===46?i+M.slice(A+1):M.slice(A))+C,M=M.slice(0,A);break}}}y&&!g&&(M=t(M,1/0));var R=V.length+M.length+C.length,U=R<v?new Array(v-R+1).join(d):"";switch(y&&g&&(M=t(U+M,U.length?v-C.length:1/0),U=""),f){case"<":M=V+M+C+U;break;case"=":M=V+U+M+C;break;case"^":M=U.slice(0,R=U.length>>1)+V+M+C+U.slice(R);break;default:M=U+V+M+C;break}return s(M)}return $.toString=function(){return h+""},$}function u(h,d){var f=c((h=Fr(h),h.type="f",h)),p=Math.max(-8,Math.min(8,Math.floor(Jn(d)/3)))*3,m=Math.pow(10,-p),g=zu[8+p/3];return function(v){return f(m*v)+g}}return{format:c,formatPrefix:u}}var cs,_o,ju;Ix({thousands:",",grouping:[3],currency:["$",""]});function Ix(e){return cs=Rx(e),_o=cs.format,ju=cs.formatPrefix,cs}function Nx(e){return Math.max(0,-Jn(Math.abs(e)))}function Px(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Jn(t)/3)))*3-Jn(Math.abs(e)))}function Ux(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Jn(t)-Jn(e))+1}var pt=1e-6,Wu=1e-12,ot=Math.PI,ee=ot/2,qu=ot/4,le=ot*2,Xt=180/ot,$t=ot/180,gt=Math.abs,Yu=Math.atan,$n=Math.atan2,yt=Math.cos,Bx=Math.exp,Vx=Math.log,ft=Math.sin,hn=Math.sign||function(e){return e>0?1:e<0?-1:0},Ee=Math.sqrt,Hx=Math.tan;function Gx(e){return e>1?0:e<-1?ot:Math.acos(e)}function je(e){return e>1?ee:e<-1?-ee:Math.asin(e)}function fe(){}function us(e,t){e&&Zu.hasOwnProperty(e.type)&&Zu[e.type](e,t)}var Xu={Feature:function(e,t){us(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)us(n[r].geometry,t)}},Zu={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,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){Eo(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Eo(n[r],t,0)},Polygon:function(e,t){Ku(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Ku(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)us(n[r],t)}};function Eo(e,t,n){var r=-1,i=e.length-n,s;for(t.lineStart();++r<i;)s=e[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function Ku(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Eo(e[n],t,1);t.polygonEnd()}function tr(e,t){e&&Xu.hasOwnProperty(e.type)?Xu[e.type](e,t):us(e,t)}function So(e){return[$n(e[1],e[0]),je(e[2])]}function er(e){var t=e[0],n=e[1],r=yt(n);return[r*yt(t),r*ft(t),ft(n)]}function hs(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ds(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 Oo(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function fs(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function To(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 Mo(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function Co(e,t){return gt(e)>ot&&(e-=Math.round(e/le)*le),[e,t]}Co.invert=Co;function Qu(e,t,n){return(e%=le)?t||n?Mo(th(e),eh(t,n)):th(e):t||n?eh(t,n):Co}function Ju(e){return function(t,n){return t+=e,gt(t)>ot&&(t-=Math.round(t/le)*le),[t,n]}}function th(e){var t=Ju(e);return t.invert=Ju(-e),t}function eh(e,t){var n=yt(e),r=ft(e),i=yt(t),s=ft(t);function a(o,l){var c=yt(l),u=yt(o)*c,h=ft(o)*c,d=ft(l),f=d*n+u*r;return[$n(h*i-f*s,u*n-d*r),je(f*i+h*s)]}return a.invert=function(o,l){var c=yt(l),u=yt(o)*c,h=ft(o)*c,d=ft(l),f=d*i-h*s;return[$n(h*i+d*s,u*n+f*r),je(f*n-u*r)]},a}function Fx(e){e=Qu(e[0]*$t,e[1]*$t,e.length>2?e[2]*$t:0);function t(n){return n=e(n[0]*$t,n[1]*$t),n[0]*=Xt,n[1]*=Xt,n}return t.invert=function(n){return n=e.invert(n[0]*$t,n[1]*$t),n[0]*=Xt,n[1]*=Xt,n},t}function zx(e,t,n,r,i,s){if(n){var a=yt(t),o=ft(t),l=r*n;i==null?(i=t+r*le,s=t-l/2):(i=nh(a,i),s=nh(a,s),(r>0?i<s:i>s)&&(i+=r*le));for(var c,u=i;r>0?u>s:u<s;u-=l)c=So([a,-o*yt(u),-o*ft(u)]),e.point(c[0],c[1])}}function nh(e,t){t=er(t),t[0]-=e,To(t);var n=Gx(-t[1]);return((-t[2]<0?-n:n)+le-pt)%le}function rh(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:fe,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function ps(e,t){return gt(e[0]-t[0])<pt&>(e[1]-t[1])<pt}function gs(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function ih(e,t,n,r,i){var s=[],a=[],o,l;if(e.forEach(function(p){if(!((m=p.length-1)<=0)){var m,g=p[0],v=p[m],y;if(ps(g,v)){if(!g[2]&&!v[2]){for(i.lineStart(),o=0;o<m;++o)i.point((g=p[o])[0],g[1]);i.lineEnd();return}v[0]+=2*pt}s.push(y=new gs(g,p,null,!0)),a.push(y.o=new gs(g,null,y,!1)),s.push(y=new gs(v,p,null,!1)),a.push(y.o=new gs(v,null,y,!0))}}),!!s.length){for(a.sort(t),sh(s),sh(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,h;;){for(var d=c,f=!0;d.v;)if((d=d.n)===c)return;u=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(f)for(o=0,l=u.length;o<l;++o)i.point((h=u[o])[0],h[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(f)for(u=d.p.z,o=u.length-1;o>=0;--o)i.point((h=u[o])[0],h[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,f=!f}while(!d.v);i.lineEnd()}}}function sh(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function $o(e){return gt(e[0])<=ot?e[0]:hn(e[0])*((gt(e[0])+ot)%le-ot)}function jx(e,t){var n=$o(t),r=t[1],i=ft(r),s=[ft(n),-yt(n),0],a=0,o=0,l=new _n;i===1?r=ee+pt:i===-1&&(r=-ee-pt);for(var c=0,u=e.length;c<u;++c)if(d=(h=e[c]).length)for(var h,d,f=h[d-1],p=$o(f),m=f[1]/2+qu,g=ft(m),v=yt(m),y=0;y<d;++y,p=S,g=E,v=T,f=x){var x=h[y],S=$o(x),_=x[1]/2+qu,E=ft(_),T=yt(_),k=S-p,I=k>=0?1:-1,$=I*k,M=$>ot,V=g*E;if(l.add($n(V*I*ft($),v*T+V*yt($))),a+=M?k+I*le:k,M^p>=n^S>=n){var C=ds(er(f),er(x));To(C);var A=ds(s,C);To(A);var w=(M^k>=0?-1:1)*je(A[2]);(r>w||r===w&&(C[0]||C[1]))&&(o+=M^k>=0?1:-1)}}return(a<-pt||a<pt&&l<-Wu)^o&1}function ah(e,t,n,r){return function(i){var s=t(i),a=rh(),o=t(a),l=!1,c,u,h,d={point:f,lineStart:m,lineEnd:g,polygonStart:function(){d.point=v,d.lineStart=y,d.lineEnd=x,u=[],c=[]},polygonEnd:function(){d.point=f,d.lineStart=m,d.lineEnd=g,u=Vc(u);var S=jx(c,r);u.length?(l||(i.polygonStart(),l=!0),ih(u,qx,S,n,i)):S&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function f(S,_){e(S,_)&&i.point(S,_)}function p(S,_){s.point(S,_)}function m(){d.point=p,s.lineStart()}function g(){d.point=f,s.lineEnd()}function v(S,_){h.push([S,_]),o.point(S,_)}function y(){o.lineStart(),h=[]}function x(){v(h[0][0],h[0][1]),o.lineEnd();var S=o.clean(),_=a.result(),E,T=_.length,k,I,$;if(h.pop(),c.push(h),h=null,!!T){if(S&1){if(I=_[0],(k=I.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),E=0;E<k;++E)i.point(($=I[E])[0],$[1]);i.lineEnd()}return}T>1&&S&2&&_.push(_.pop().concat(_.shift())),u.push(_.filter(Wx))}}return d}}function Wx(e){return e.length>1}function qx(e,t){return((e=e.x)[0]<0?e[1]-ee-pt:ee-e[1])-((t=t.x)[0]<0?t[1]-ee-pt:ee-t[1])}const oh=ah(function(){return!0},Yx,Zx,[-ot,-ee]);function Yx(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?ot:-ot,l=gt(s-t);gt(l-ot)<pt?(e.point(t,n=(n+a)/2>0?ee:-ee),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=ot&&(gt(t-r)<pt&&(t-=r*pt),gt(s-o)<pt&&(s-=o*pt),n=Xx(t,n,s,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),i=0),e.point(t=s,n=a),r=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function Xx(e,t,n,r){var i,s,a=ft(e-n);return gt(a)>pt?Yu((ft(t)*(s=yt(r))*ft(n)-ft(r)*(i=yt(t))*ft(e))/(i*s*a)):(t+r)/2}function Zx(e,t,n,r){var i;if(e==null)i=n*ee,r.point(-ot,i),r.point(0,i),r.point(ot,i),r.point(ot,0),r.point(ot,-i),r.point(0,-i),r.point(-ot,-i),r.point(-ot,0),r.point(-ot,i);else if(gt(e[0]-t[0])>pt){var s=e[0]<t[0]?ot:-ot;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function Kx(e){var t=yt(e),n=6*$t,r=t>0,i=gt(t)>pt;function s(u,h,d,f){zx(f,e,n,d,u,h)}function a(u,h){return yt(u)*yt(h)>t}function o(u){var h,d,f,p,m;return{lineStart:function(){p=f=!1,m=1},point:function(g,v){var y=[g,v],x,S=a(g,v),_=r?S?0:c(g,v):S?c(g+(g<0?ot:-ot),v):0;if(!h&&(p=f=S)&&u.lineStart(),S!==f&&(x=l(h,y),(!x||ps(h,x)||ps(y,x))&&(y[2]=1)),S!==f)m=0,S?(u.lineStart(),x=l(y,h),u.point(x[0],x[1])):(x=l(h,y),u.point(x[0],x[1],2),u.lineEnd()),h=x;else if(i&&h&&r^S){var E;!(_&d)&&(E=l(y,h,!0))&&(m=0,r?(u.lineStart(),u.point(E[0][0],E[0][1]),u.point(E[1][0],E[1][1]),u.lineEnd()):(u.point(E[1][0],E[1][1]),u.lineEnd(),u.lineStart(),u.point(E[0][0],E[0][1],3)))}S&&(!h||!ps(h,y))&&u.point(y[0],y[1]),h=y,f=S,d=_},lineEnd:function(){f&&u.lineEnd(),h=null},clean:function(){return m|(p&&f)<<1}}}function l(u,h,d){var f=er(u),p=er(h),m=[1,0,0],g=ds(f,p),v=hs(g,g),y=g[0],x=v-y*y;if(!x)return!d&&u;var S=t*v/x,_=-t*y/x,E=ds(m,g),T=fs(m,S),k=fs(g,_);Oo(T,k);var I=E,$=hs(T,I),M=hs(I,I),V=$*$-M*(hs(T,T)-1);if(!(V<0)){var C=Ee(V),A=fs(I,(-$-C)/M);if(Oo(A,T),A=So(A),!d)return A;var w=u[0],N=h[0],P=u[1],R=h[1],U;N<w&&(U=w,w=N,N=U);var F=N-w,j=gt(F-ot)<pt,K=j||F<pt;if(!j&&R<P&&(U=P,P=R,R=U),K?j?P+R>0^A[1]<(gt(A[0]-w)<pt?P:R):P<=A[1]&&A[1]<=R:F>ot^(w<=A[0]&&A[0]<=N)){var ut=fs(I,(-$+C)/M);return Oo(ut,T),[A,So(ut)]}}}function c(u,h){var d=r?e:ot-e,f=0;return u<-d?f|=1:u>d&&(f|=2),h<-d?f|=4:h>d&&(f|=8),f}return ah(a,o,s,r?[0,-e]:[-ot,e-ot])}function Qx(e,t,n,r,i,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,h=1,d=l-a,f=c-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=i-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=r-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 zr=1e9,ms=-zr;function Jx(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function s(c,u,h,d){var f=0,p=0;if(c==null||(f=a(c,h))!==(p=a(u,h))||l(c,u)<0^h>0)do d.point(f===0||f===3?e:n,f>1?r:t);while((f=(f+h+4)%4)!==p);else d.point(u[0],u[1])}function a(c,u){return gt(c[0]-e)<pt?u>0?0:3:gt(c[0]-n)<pt?u>0?2:1:gt(c[1]-t)<pt?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var h=a(c,1),d=a(u,1);return h!==d?h-d:h===0?u[1]-c[1]:h===1?c[0]-u[0]:h===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,h=rh(),d,f,p,m,g,v,y,x,S,_,E,T={point:k,lineStart:V,lineEnd:C,polygonStart:$,polygonEnd:M};function k(w,N){i(w,N)&&u.point(w,N)}function I(){for(var w=0,N=0,P=f.length;N<P;++N)for(var R=f[N],U=1,F=R.length,j=R[0],K,ut,G=j[0],Y=j[1];U<F;++U)K=G,ut=Y,j=R[U],G=j[0],Y=j[1],ut<=r?Y>r&&(G-K)*(r-ut)>(Y-ut)*(e-K)&&++w:Y<=r&&(G-K)*(r-ut)<(Y-ut)*(e-K)&&--w;return w}function $(){u=h,d=[],f=[],E=!0}function M(){var w=I(),N=E&&w,P=(d=Vc(d)).length;(N||P)&&(c.polygonStart(),N&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),P&&ih(d,o,w,s,c),c.polygonEnd()),u=c,d=f=p=null}function V(){T.point=A,f&&f.push(p=[]),_=!0,S=!1,y=x=NaN}function C(){d&&(A(m,g),v&&S&&h.rejoin(),d.push(h.result())),T.point=k,S&&u.lineEnd()}function A(w,N){var P=i(w,N);if(f&&p.push([w,N]),_)m=w,g=N,v=P,_=!1,P&&(u.lineStart(),u.point(w,N));else if(P&&S)u.point(w,N);else{var R=[y=Math.max(ms,Math.min(zr,y)),x=Math.max(ms,Math.min(zr,x))],U=[w=Math.max(ms,Math.min(zr,w)),N=Math.max(ms,Math.min(zr,N))];Qx(R,U,e,t,n,r)?(S||(u.lineStart(),u.point(R[0],R[1])),u.point(U[0],U[1]),P||u.lineEnd(),E=!1):P&&(u.lineStart(),u.point(w,N),E=!1)}y=w,x=N,S=P}return T}}const Ao=e=>e;var Lo=new _n,Do=new _n,lh,ch,ko,Ro,dn={point:fe,lineStart:fe,lineEnd:fe,polygonStart:function(){dn.lineStart=tb,dn.lineEnd=nb},polygonEnd:function(){dn.lineStart=dn.lineEnd=dn.point=fe,Lo.add(gt(Do)),Do=new _n},result:function(){var e=Lo/2;return Lo=new _n,e}};function tb(){dn.point=eb}function eb(e,t){dn.point=uh,lh=ko=e,ch=Ro=t}function uh(e,t){Do.add(Ro*e-ko*t),ko=e,Ro=t}function nb(){uh(lh,ch)}const hh=dn;var nr=1/0,vs=nr,jr=-nr,ys=jr,rb={point:ib,lineStart:fe,lineEnd:fe,polygonStart:fe,polygonEnd:fe,result:function(){var e=[[nr,vs],[jr,ys]];return jr=ys=-(vs=nr=1/0),e}};function ib(e,t){e<nr&&(nr=e),e>jr&&(jr=e),t<vs&&(vs=t),t>ys&&(ys=t)}const xs=rb;var Io=0,No=0,Wr=0,bs=0,ws=0,rr=0,Po=0,Uo=0,qr=0,dh,fh,Re,Ie,Se={point:An,lineStart:ph,lineEnd:gh,polygonStart:function(){Se.lineStart=ob,Se.lineEnd=lb},polygonEnd:function(){Se.point=An,Se.lineStart=ph,Se.lineEnd=gh},result:function(){var e=qr?[Po/qr,Uo/qr]:rr?[bs/rr,ws/rr]:Wr?[Io/Wr,No/Wr]:[NaN,NaN];return Io=No=Wr=bs=ws=rr=Po=Uo=qr=0,e}};function An(e,t){Io+=e,No+=t,++Wr}function ph(){Se.point=sb}function sb(e,t){Se.point=ab,An(Re=e,Ie=t)}function ab(e,t){var n=e-Re,r=t-Ie,i=Ee(n*n+r*r);bs+=i*(Re+e)/2,ws+=i*(Ie+t)/2,rr+=i,An(Re=e,Ie=t)}function gh(){Se.point=An}function ob(){Se.point=cb}function lb(){mh(dh,fh)}function cb(e,t){Se.point=mh,An(dh=Re=e,fh=Ie=t)}function mh(e,t){var n=e-Re,r=t-Ie,i=Ee(n*n+r*r);bs+=i*(Re+e)/2,ws+=i*(Ie+t)/2,rr+=i,i=Ie*e-Re*t,Po+=i*(Re+e),Uo+=i*(Ie+t),qr+=i*3,An(Re=e,Ie=t)}const vh=Se;function yh(e){this._context=e}yh.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:fe};var Bo=new _n,Vo,xh,bh,Yr,Xr,_s={point:fe,lineStart:function(){_s.point=ub},lineEnd:function(){Vo&&wh(xh,bh),_s.point=fe},polygonStart:function(){Vo=!0},polygonEnd:function(){Vo=null},result:function(){var e=+Bo;return Bo=new _n,e}};function ub(e,t){_s.point=wh,xh=Yr=e,bh=Xr=t}function wh(e,t){Yr-=e,Xr-=t,Bo.add(Ee(Yr*Yr+Xr*Xr)),Yr=e,Xr=t}const _h=_s;let Eh,Es,Sh,Oh;class Th{constructor(t){this._append=t==null?Mh:hb(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!==Sh||this._append!==Es){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,Sh=r,Es=this._append,Oh=this._,this._=i}this._+=Oh;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Mh(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function hb(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Mh;if(t!==Eh){const n=10**t;Eh=t,Es=function(i){let s=1;this._+=i[0];for(const a=i.length;s<a;++s)this._+=Math.round(arguments[s]*n)/n+i[s]}}return Es}function db(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),tr(o,i(s))),s.result()}return a.area=function(o){return tr(o,i(hh)),hh.result()},a.measure=function(o){return tr(o,i(_h)),_h.result()},a.bounds=function(o){return tr(o,i(xs)),xs.result()},a.centroid=function(o){return tr(o,i(vh)),vh.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,Ao):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new Th(n)):new yh(t=o),typeof r!="function"&&s.pointRadius(r),a):t},a.pointRadius=function(o){return arguments.length?(r=typeof o=="function"?o:(s.pointRadius(+o),+o),a):r},a.digits=function(o){if(!arguments.length)return n;if(o==null)n=null;else{const l=Math.floor(o);if(!(l>=0))throw new RangeError(`invalid digits: ${o}`);n=l}return t===null&&(s=new Th(n)),a},a.projection(e).digits(n).context(t)}function Ho(e){return function(t){var n=new Go;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Go(){}Go.prototype={constructor:Go,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 Fo(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),tr(n,e.stream(xs)),t(xs.result()),r!=null&&e.clipExtent(r),e}function Ch(e,t,n){return Fo(e,function(r){var i=t[1][0]-t[0][0],s=t[1][1]-t[0][1],a=Math.min(i/(r[1][0]-r[0][0]),s/(r[1][1]-r[0][1])),o=+t[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(s-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([o,l])},n)}function fb(e,t,n){return Ch(e,[[0,0],t],n)}function pb(e,t,n){return Fo(e,function(r){var i=+t,s=i/(r[1][0]-r[0][0]),a=(i-s*(r[1][0]+r[0][0]))/2,o=-s*r[0][1];e.scale(150*s).translate([a,o])},n)}function gb(e,t,n){return Fo(e,function(r){var i=+t,s=i/(r[1][1]-r[0][1]),a=-s*r[0][0],o=(i-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,o])},n)}var $h=16,mb=yt(30*$t);function Ah(e,t){return+t?yb(e,t):vb(e)}function vb(e){return Ho({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function yb(e,t){function n(r,i,s,a,o,l,c,u,h,d,f,p,m,g){var v=c-r,y=u-i,x=v*v+y*y;if(x>4*t&&m--){var S=a+d,_=o+f,E=l+p,T=Ee(S*S+_*_+E*E),k=je(E/=T),I=gt(gt(E)-1)<pt||gt(s-h)<pt?(s+h)/2:$n(_,S),$=e(I,k),M=$[0],V=$[1],C=M-r,A=V-i,w=y*C-v*A;(w*w/x>t||gt((v*C+y*A)/x-.5)>.3||a*d+o*f+l*p<mb)&&(n(r,i,s,a,o,l,M,V,I,S/=T,_/=T,E,m,g),g.point(M,V),n(M,V,I,S,_,E,c,u,h,d,f,p,m,g))}}return function(r){var i,s,a,o,l,c,u,h,d,f,p,m,g={point:v,lineStart:y,lineEnd:S,polygonStart:function(){r.polygonStart(),g.lineStart=_},polygonEnd:function(){r.polygonEnd(),g.lineStart=y}};function v(k,I){k=e(k,I),r.point(k[0],k[1])}function y(){h=NaN,g.point=x,r.lineStart()}function x(k,I){var $=er([k,I]),M=e(k,I);n(h,d,u,f,p,m,h=M[0],d=M[1],u=k,f=$[0],p=$[1],m=$[2],$h,r),r.point(h,d)}function S(){g.point=v,r.lineEnd()}function _(){y(),g.point=E,g.lineEnd=T}function E(k,I){x(i=k,I),s=h,a=d,o=f,l=p,c=m,g.point=x}function T(){n(h,d,u,f,p,m,s,a,i,o,l,c,$h,r),g.lineEnd=S,S()}return g}}var xb=Ho({point:function(e,t){this.stream.point(e*$t,t*$t)}});function bb(e){return Ho({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function wb(e,t,n,r,i){function s(a,o){return a*=r,o*=i,[t+e*a,n-e*o]}return s.invert=function(a,o){return[(a-t)/e*r,(n-o)/e*i]},s}function Lh(e,t,n,r,i,s){if(!s)return wb(e,t,n,r,i);var a=yt(s),o=ft(s),l=a*e,c=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*=r,g*=i,[l*m-c*g+t,n-c*m-l*g]}return p.invert=function(m,g){return[r*(u*m-h*g+d),i*(f-h*m-u*g)]},p}function Ss(e){return Dh(function(){return e})()}function Dh(e){var t,n=150,r=480,i=250,s=0,a=0,o=0,l=0,c=0,u,h=0,d=1,f=1,p=null,m=oh,g=null,v,y,x,S=Ao,_=.5,E,T,k,I,$;function M(w){return k(w[0]*$t,w[1]*$t)}function V(w){return w=k.invert(w[0],w[1]),w&&[w[0]*Xt,w[1]*Xt]}M.stream=function(w){return I&&$===w?I:I=xb(bb(u)(m(E(S($=w)))))},M.preclip=function(w){return arguments.length?(m=w,p=void 0,A()):m},M.postclip=function(w){return arguments.length?(S=w,g=v=y=x=null,A()):S},M.clipAngle=function(w){return arguments.length?(m=+w?Kx(p=w*$t):(p=null,oh),A()):p*Xt},M.clipExtent=function(w){return arguments.length?(S=w==null?(g=v=y=x=null,Ao):Jx(g=+w[0][0],v=+w[0][1],y=+w[1][0],x=+w[1][1]),A()):g==null?null:[[g,v],[y,x]]},M.scale=function(w){return arguments.length?(n=+w,C()):n},M.translate=function(w){return arguments.length?(r=+w[0],i=+w[1],C()):[r,i]},M.center=function(w){return arguments.length?(s=w[0]%360*$t,a=w[1]%360*$t,C()):[s*Xt,a*Xt]},M.rotate=function(w){return arguments.length?(o=w[0]%360*$t,l=w[1]%360*$t,c=w.length>2?w[2]%360*$t:0,C()):[o*Xt,l*Xt,c*Xt]},M.angle=function(w){return arguments.length?(h=w%360*$t,C()):h*Xt},M.reflectX=function(w){return arguments.length?(d=w?-1:1,C()):d<0},M.reflectY=function(w){return arguments.length?(f=w?-1:1,C()):f<0},M.precision=function(w){return arguments.length?(E=Ah(T,_=w*w),A()):Ee(_)},M.fitExtent=function(w,N){return Ch(M,w,N)},M.fitSize=function(w,N){return fb(M,w,N)},M.fitWidth=function(w,N){return pb(M,w,N)},M.fitHeight=function(w,N){return gb(M,w,N)};function C(){var w=Lh(n,0,0,d,f,h).apply(null,t(s,a)),N=Lh(n,r-w[0],i-w[1],d,f,h);return u=Qu(o,l,c),T=Mo(t,N),k=Mo(u,T),E=Ah(T,_),A()}function A(){return I=$=null,M}return function(){return t=e.apply(this,arguments),M.invert=t.invert&&V,C()}}function kh(e){var t=0,n=ot/3,r=Dh(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*$t,n=s[1]*$t):[t*Xt,n*Xt]},i}function _b(e){var t=yt(e);function n(r,i){return[r*t,ft(i)/t]}return n.invert=function(r,i){return[r/t,je(i*t)]},n}function Eb(e,t){var n=ft(e),r=(n+ft(t))/2;if(gt(r)<pt)return _b(e);var i=1+n*(2*r-n),s=Ee(i)/r;function a(o,l){var c=Ee(i-2*r*ft(l))/r;return[c*ft(o*=r),s-c*yt(o)]}return a.invert=function(o,l){var c=s-l,u=$n(o,gt(c))*hn(c);return c*r<0&&(u-=ot*hn(o)*hn(c)),[u/r,je((i-(o*o+c*c)*r*r)/(2*r))]},a}function Rh(){return kh(Eb).scale(155.424).center([0,33.6442])}function Sb(){return Rh().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function zo(e,t){return[e,Vx(Hx((ee+t)/2))]}zo.invert=function(e,t){return[e,2*Yu(Bx(t))-ee]};function Ob(){return Tb(zo).scale(961/le)}function Tb(e){var t=Ss(e),n=t.center,r=t.scale,i=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(h){return arguments.length?(r(h),u()):r()},t.translate=function(h){return arguments.length?(i(h),u()):i()},t.center=function(h){return arguments.length?(n(h),u()):n()},t.clipExtent=function(h){return arguments.length?(h==null?a=o=l=c=null:(a=+h[0][0],o=+h[0][1],l=+h[1][0],c=+h[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var h=ot*r(),d=t(Fx(t.rotate()).invert([0,0]));return s(a==null?[[d[0]-h,d[1]-h],[d[0]+h,d[1]+h]]:e===zo?[[Math.max(d[0]-h,a),o],[Math.min(d[0]+h,l),c]]:[[a,Math.max(d[1]-h,o)],[l,Math.min(d[1]+h,c)]])}return u()}function Os(e,t){return[e,t]}Os.invert=Os;function Mb(){return Ss(Os).scale(152.63)}function Cb(e,t){var n=yt(e),r=e===t?ft(e):(n-yt(t))/(t-e),i=n/r+e;if(gt(r)<pt)return Os;function s(a,o){var l=i-o,c=r*a;return[l*ft(c),i-l*yt(c)]}return s.invert=function(a,o){var l=i-o,c=$n(a,gt(l))*hn(l);return l*r<0&&(c-=ot*hn(a)*hn(l)),[c/r,i-hn(r)*Ee(a*a+l*l)]},s}function $b(){return kh(Cb).scale(131.154).center([0,13.9389])}var Zr=1.340264,Kr=-.081106,Qr=893e-6,Jr=.003796,Ts=Ee(3)/2,Ab=12;function Ih(e,t){var n=je(Ts*ft(t)),r=n*n,i=r*r*r;return[e*yt(n)/(Ts*(Zr+3*Kr*r+i*(7*Qr+9*Jr*r))),n*(Zr+Kr*r+i*(Qr+Jr*r))]}Ih.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<Ab&&(o=n*(Zr+Kr*r+i*(Qr+Jr*r))-t,l=Zr+3*Kr*r+i*(7*Qr+9*Jr*r),n-=a=o/l,r=n*n,i=r*r*r,!(gt(a)<Wu));++s);return[Ts*e*(Zr+3*Kr*r+i*(7*Qr+9*Jr*r))/yt(n),je(ft(n)/Ts)]};function Lb(){return Ss(Ih).scale(177.158)}function Nh(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}Nh.invert=function(e,t){var n=t,r=25,i;do{var s=n*n,a=s*s;n-=i=(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(gt(i)>pt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function Db(){return Ss(Nh).scale(175.295)}function kb(e,t){return e.parent===t.parent?1:2}function Rb(e){return e.reduce(Ib,0)/e.length}function Ib(e,t){return e+t.x}function Nb(e){return 1+e.reduce(Pb,0)}function Pb(e,t){return Math.max(e,t.y)}function Ub(e){for(var t;t=e.children;)e=t[0];return e}function Bb(e){for(var t;t=e.children;)e=t[t.length-1];return e}function Vb(){var e=kb,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(d){var f=d.children;f?(d.x=Rb(f),d.y=Nb(f)):(d.x=a?o+=e(d,a):0,d.y=0,a=d)});var l=Ub(s),c=Bb(s),u=l.x-e(l,c)/2,h=c.x+e(c,l)/2;return s.eachAfter(r?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 i.separation=function(s){return arguments.length?(e=s,i):e},i.size=function(s){return arguments.length?(r=!1,t=+s[0],n=+s[1],i):r?null:[t,n]},i.nodeSize=function(s){return arguments.length?(r=!0,t=+s[0],n=+s[1],i):r?[t,n]:null},i}function Hb(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function Gb(){return this.eachAfter(Hb)}function Fb(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function zb(e,t){for(var n=this,r=[n],i,s,a=-1;n=r.pop();)if(e.call(t,n,++a,this),i=n.children)for(s=i.length-1;s>=0;--s)r.push(i[s]);return this}function jb(e,t){for(var n=this,r=[n],i=[],s,a,o,l=-1;n=r.pop();)if(i.push(n),s=n.children)for(a=0,o=s.length;a<o;++a)r.push(s[a]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function Wb(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function qb(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function Yb(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Xb(e){for(var t=this,n=Zb(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function Zb(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function Kb(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Qb(){return Array.from(this)}function Jb(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function tw(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*ew(){var e=this,t,n=[e],r,i,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,s=r.length;i<s;++i)n.push(r[i]);while(n.length)}function ti(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=iw)):t===void 0&&(t=rw);for(var n=new ei(e),r,i=[n],s,a,o,l;r=i.pop();)if((a=t(r.data))&&(l=(a=Array.from(a)).length))for(r.children=a,o=l-1;o>=0;--o)i.push(s=a[o]=new ei(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(aw)}function nw(){return ti(this).eachBefore(sw)}function rw(e){return e.children}function iw(e){return Array.isArray(e)?e[1]:null}function sw(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function aw(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function ei(e){this.data=e,this.depth=this.height=0,this.parent=null}ei.prototype=ti.prototype={constructor:ei,count:Gb,each:Fb,eachAfter:jb,eachBefore:zb,find:Wb,sum:qb,sort:Yb,path:Xb,ancestors:Kb,descendants:Qb,leaves:Jb,links:tw,copy:nw,[Symbol.iterator]:ew};function ow(e){return e==null?null:Ph(e)}function Ph(e){if(typeof e!="function")throw new Error;return e}function Ln(){return 0}function ir(e){return function(){return e}}const lw=1664525,cw=1013904223,Uh=4294967296;function uw(){let e=1;return()=>(e=(lw*e+cw)%Uh)/Uh}function hw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function dw(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function fw(e,t){for(var n=0,r=(e=dw(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&Bh(a,s)?++n:(a=gw(i=pw(i,s)),n=0);return a}function pw(e,t){var n,r;if(jo(t,e))return[t];for(n=0;n<e.length;++n)if(Ms(t,e[n])&&jo(ni(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(Ms(ni(e[n],e[r]),t)&&Ms(ni(e[n],t),e[r])&&Ms(ni(e[r],t),e[n])&&jo(Vh(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function Ms(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function Bh(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function jo(e,t){for(var n=0;n<t.length;++n)if(!Bh(e,t[n]))return!1;return!0}function gw(e){switch(e.length){case 1:return mw(e[0]);case 2:return ni(e[0],e[1]);case 3:return Vh(e[0],e[1],e[2])}}function mw(e){return{x:e.x,y:e.y,r:e.r}}function ni(e,t){var n=e.x,r=e.y,i=e.r,s=t.x,a=t.y,o=t.r,l=s-n,c=a-r,u=o-i,h=Math.sqrt(l*l+c*c);return{x:(n+s+l/h*u)/2,y:(r+a+c/h*u)/2,r:(h+i+o)/2}}function Vh(e,t,n){var r=e.x,i=e.y,s=e.r,a=t.x,o=t.y,l=t.r,c=n.x,u=n.y,h=n.r,d=r-a,f=r-c,p=i-o,m=i-u,g=l-s,v=h-s,y=r*r+i*i-s*s,x=y-a*a-o*o+l*l,S=y-c*c-u*u+h*h,_=f*p-d*m,E=(p*S-m*x)/(_*2)-r,T=(m*g-p*v)/_,k=(f*x-d*S)/(_*2)-i,I=(d*v-f*g)/_,$=T*T+I*I-1,M=2*(s+E*T+k*I),V=E*E+k*k-s*s,C=-(Math.abs($)>1e-6?(M+Math.sqrt(M*M-4*$*V))/(2*$):V/M);return{x:r+E+T*C,y:i+k+I*C,r:C}}function Hh(e,t,n){var r=e.x-t.x,i,s,a=e.y-t.y,o,l,c=r*r+a*a;c?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(i=(c+l-s)/(2*c),o=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-o*a,n.y=e.y-i*a+o*r):(i=(c+s-l)/(2*c),o=Math.sqrt(Math.max(0,s/c-i*i)),n.x=t.x+i*r-o*a,n.y=t.y+i*a+o*r)):(n.x=t.x+n.r,n.y=t.y)}function Gh(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function Fh(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,s=(t.y*n.r+n.y*t.r)/r;return i*i+s*s}function Cs(e){this._=e,this.next=null,this.previous=null}function vw(e,t){if(!(s=(e=hw(e)).length))return 0;var n,r,i,s,a,o,l,c,u,h,d;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(s>2))return n.r+r.r;Hh(r,n,i=e[2]),n=new Cs(n),r=new Cs(r),i=new Cs(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){Hh(n._,r._,i=e[l]),i=new Cs(i),c=r.next,u=n.previous,h=r._.r,d=n._.r;do if(h<=d){if(Gh(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}h+=c._.r,c=c.next}else{if(Gh(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}d+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=Fh(n);(i=i.next)!==r;)(o=Fh(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=fw(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function yw(e){return Math.sqrt(e.value)}function xw(){var e=null,t=1,n=1,r=Ln;function i(s){const a=uw();return s.x=t/2,s.y=n/2,e?s.eachBefore(zh(e)).eachAfter(Wo(r,.5,a)).eachBefore(jh(1)):s.eachBefore(zh(yw)).eachAfter(Wo(Ln,1,a)).eachAfter(Wo(r,s.r/Math.min(t,n),a)).eachBefore(jh(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=ow(s),i):e},i.size=function(s){return arguments.length?(t=+s[0],n=+s[1],i):[t,n]},i.padding=function(s){return arguments.length?(r=typeof s=="function"?s:ir(+s),i):r},i}function zh(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Wo(e,t,n){return function(r){if(i=r.children){var i,s,a=i.length,o=e(r)*t||0,l;if(o)for(s=0;s<a;++s)i[s].r+=o;if(l=vw(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function jh(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 bw(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 ww(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(r-t)/e.value;++o<l;)a=s[o],a.y0=n,a.y1=i,a.x0=t,a.x1=t+=a.value*c}function _w(e,t){return e.parent===t.parent?1:2}function qo(e){var t=e.children;return t?t[0]:e.t}function Yo(e){var t=e.children;return t?t[t.length-1]:e.t}function Ew(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function Sw(e){for(var t=0,n=0,r=e.children,i=r.length,s;--i>=0;)s=r[i],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 $s(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}$s.prototype=Object.create(ei.prototype);function Tw(e){for(var t=new $s(e,0),n,r=[t],i,s,a,o;n=r.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)r.push(i=n.children[a]=new $s(s[a],a)),i.parent=n;return(t.parent=new $s(null,0)).children=[t],t}function Mw(){var e=_w,t=1,n=1,r=null;function i(c){var u=Tw(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)c.eachBefore(l);else{var h=c,d=c,f=c;c.eachBefore(function(y){y.x<h.x&&(h=y),y.x>d.x&&(d=y),y.depth>f.depth&&(f=y)});var p=h===d?1:e(h,d)/2,m=p-h.x,g=t/(d.x+p+m),v=n/(f.depth||1);c.eachBefore(function(y){y.x=(y.x+m)*g,y.y=y.depth*v})}return c}function s(c){var u=c.children,h=c.parent.children,d=c.i?h[c.i-1]:null;if(u){Sw(c);var f=(u[0].z+u[u.length-1].z)/2;d?(c.z=d.z+e(c._,d._),c.m=c.z-f):c.z=f}else d&&(c.z=d.z+e(c._,d._));c.parent.A=o(c,d,c.parent.A||h[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,h){if(u){for(var d=c,f=c,p=u,m=d.parent.children[0],g=d.m,v=f.m,y=p.m,x=m.m,S;p=Yo(p),d=qo(d),p&&d;)m=qo(m),f=Yo(f),f.a=c,S=p.z+y-d.z-g+e(p._,d._),S>0&&(Ew(Ow(p,c,h),c,S),g+=S,v+=S),y+=p.m,g+=d.m,x+=m.m,v+=f.m;p&&!Yo(f)&&(f.t=p,f.m+=y-v),d&&!qo(m)&&(m.t=d,m.m+=g-x,h=c)}return h}function l(c){c.x*=t,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(e=c,i):e},i.size=function(c){return arguments.length?(r=!1,t=+c[0],n=+c[1],i):r?null:[t,n]},i.nodeSize=function(c){return arguments.length?(r=!0,t=+c[0],n=+c[1],i):r?[t,n]:null},i}function Cw(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(i-n)/e.value;++o<l;)a=s[o],a.x0=t,a.x1=r,a.y0=n,a.y1=n+=a.value*c}var $w=(1+Math.sqrt(5))/2;function Aw(e,t,n,r,i,s){for(var a=[],o=t.children,l,c,u=0,h=0,d=o.length,f,p,m=t.value,g,v,y,x,S,_,E;u<d;){f=i-n,p=s-r;do g=o[h++].value;while(!g&&h<d);for(v=y=g,_=Math.max(p/f,f/p)/(m*e),E=g*g*_,S=Math.max(y/E,E/v);h<d;++h){if(g+=c=o[h].value,c<v&&(v=c),c>y&&(y=c),E=g*g*_,x=Math.max(y/E,E/v),x>S){g-=c;break}S=x}a.push(l={value:g,dice:f<p,children:o.slice(u,h)}),l.dice?ww(l,n,r,i,m?r+=p*g/m:s):Cw(l,n,r,m?n+=f*g/m:i,s),m-=g,u=h}return a}const Lw=function e(t){function n(r,i,s,a,o){Aw(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}($w);function Dw(){var e=Lw,t=!1,n=1,r=1,i=[0],s=Ln,a=Ln,o=Ln,l=Ln,c=Ln;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(h),i=[0],t&&d.eachBefore(bw),d}function h(d){var f=i[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=i[d.depth+1]=s(d)/2,p+=c(d)-f,m+=a(d)-f,g-=o(d)-f,v-=l(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],r=+d[1],u):[n,r]},u.tile=function(d){return arguments.length?(e=Ph(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:ir(+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:ir(+d),u):a},u.paddingRight=function(d){return arguments.length?(o=typeof d=="function"?d:ir(+d),u):o},u.paddingBottom=function(d){return arguments.length?(l=typeof d=="function"?d:ir(+d),u):l},u.paddingLeft=function(d){return arguments.length?(c=typeof d=="function"?d:ir(+d),u):c},u}function sr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const Wh=Symbol("implicit");function As(){var e=new Nc,t=[],n=[],r=Wh;function i(s){let a=e.get(s);if(a===void 0){if(r!==Wh)return r;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new Nc;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return As(t,n).unknown(r)},sr.apply(i,arguments),i}function ri(){var e=As().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,a,o=!1,l=0,c=0,u=.5;delete e.unknown;function h(){var d=t().length,f=i<r,p=f?i:r,m=f?r:i;s=(m-p)/Math.max(1,d-l+c*2),o&&(s=Math.floor(s)),p+=(m-p-s*(d-l))*u,a=s*(1-l),o&&(p=Math.round(p),a=Math.round(a));var g=Vv(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?([r,i]=d,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(d){return[r,i]=d,r=+r,i=+i,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?(l=Math.min(1,c=+d),h()):l},e.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),h()):l},e.paddingOuter=function(d){return arguments.length?(c=+d,h()):c},e.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),h()):u},e.copy=function(){return ri(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},sr.apply(h(),arguments)}function kw(e){return function(){return e}}function Rw(e){return+e}var qh=[0,1];function ar(e){return e}function Xo(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:kw(isNaN(t)?NaN:.5)}function Iw(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Nw(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=Xo(i,r),s=n(a,s)):(r=Xo(r,i),s=n(s,a)),function(o){return s(r(o))}}function Pw(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Xo(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=Va(e,o,1,r)-1;return s[l](i[l](o))}}function Zo(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Yh(){var e=qh,t=qh,n=Ur,r,i,s,a=ar,o,l,c;function u(){var d=Math.min(e.length,t.length);return a!==ar&&(a=Iw(e[0],e[d-1])),o=d>2?Pw:Nw,l=c=null,h}function h(d){return d==null||isNaN(d=+d)?s:(l||(l=o(e.map(r),t,n)))(r(a(d)))}return h.invert=function(d){return a(i((c||(c=o(t,e.map(r),oe)))(d)))},h.domain=function(d){return arguments.length?(e=Array.from(d,Rw),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=gu,u()},h.clamp=function(d){return arguments.length?(a=d?!0:ar,u()):a!==ar},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 r=d,i=f,u()}}function Xh(){return Yh()(ar,ar)}function Uw(e,t,n,r){var i=Ga(e,t,n),s;switch(r=Fr(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=Px(i,a))&&(r.precision=s),ju(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=Ux(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=Nx(i))&&(r.precision=s-(r.type==="%")*2);break}}return _o(r)}function Zh(e){var t=e.domain;return e.ticks=function(n){var r=t();return Vi(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Uw(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],l,c,u=10;for(o<a&&(c=a,a=o,o=c,c=i,i=s,s=c);u-- >0;){if(c=qn(a,o,n),c===l)return r[i]=a,r[s]=o,t(r);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function Oe(){var e=Xh();return e.copy=function(){return Zo(e,Oe())},sr.apply(e,arguments),Zh(e)}function Kh(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),e[n]=t.floor(i),e[r]=t.ceil(s),e}function Qh(e){return Math.log(e)}function Jh(e){return Math.exp(e)}function Bw(e){return-Math.log(-e)}function Vw(e){return-Math.exp(-e)}function Hw(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Gw(e){return e===10?Hw:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Fw(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 td(e){return(t,n)=>-e(-t,n)}function zw(e){const t=e(Qh,Jh),n=t.domain;let r=10,i,s;function a(){return i=Fw(r),s=Gw(r),n()[0]<0?(i=td(i),s=td(s),e(Bw,Vw)):e(Qh,Jh),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const h=u<c;h&&([c,u]=[u,c]);let d=i(c),f=i(u),p,m;const g=o==null?10:+o;let v=[];if(!(r%1)&&f-d<g){if(d=Math.floor(d),f=Math.ceil(f),c>0){for(;d<=f;++d)for(p=1;p<r;++p)if(m=d<0?p/s(-d):p*s(d),!(m<c)){if(m>u)break;v.push(m)}}else for(;d<=f;++d)for(p=r-1;p>=1;--p)if(m=d>0?p/s(-d):p*s(d),!(m<c)){if(m>u)break;v.push(m)}v.length*2<g&&(v=Vi(c,u,g))}else v=Vi(d,f,Math.min(f-d,g)).map(s);return h?v.reverse():v},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Fr(l)).precision==null&&(l.trim=!0),l=_o(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let h=u/s(Math.round(i(u)));return h*r<r-.5&&(h*=r),h<=c?l(u):""}},t.nice=()=>n(Kh(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function ed(){const e=zw(Yh()).domain([1,10]);return e.copy=()=>Zo(e,ed()).base(e.base()),sr.apply(e,arguments),e}function Ko(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[Va(r,l,0,n)]:s}function o(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,o()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,o()):i.slice()},a.invertExtent=function(l){var c=i.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,r[0]]:c>=n?[r[n-1],t]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(s=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Ko().domain([e,t]).range(i).unknown(s)},sr.apply(Zh(a),arguments)}const Qo=new Date,Jo=new Date;function Rt(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;let c;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.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&&(i.count=(s,a)=>(Qo.setTime(+s),Jo.setTime(+a),e(Qo),e(Jo),Math.floor(n(Qo,Jo))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Ls=Rt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ls.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):Ls),Ls.range;const We=1e3,pe=We*60,qe=pe*60,Ye=qe*24,tl=Ye*7,nd=Ye*30,el=Ye*365,or=Rt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*We)},(e,t)=>(t-e)/We,e=>e.getUTCSeconds());or.range;const nl=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*We)},(e,t)=>{e.setTime(+e+t*pe)},(e,t)=>(t-e)/pe,e=>e.getMinutes());nl.range,Rt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*pe)},(e,t)=>(t-e)/pe,e=>e.getUTCMinutes()).range;const rl=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*We-e.getMinutes()*pe)},(e,t)=>{e.setTime(+e+t*qe)},(e,t)=>(t-e)/qe,e=>e.getHours());rl.range,Rt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*qe)},(e,t)=>(t-e)/qe,e=>e.getUTCHours()).range;const ii=Rt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pe)/Ye,e=>e.getDate()-1);ii.range;const il=Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ye,e=>e.getUTCDate()-1);il.range,Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ye,e=>Math.floor(e/Ye)).range;function Dn(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())*pe)/tl)}const Ds=Dn(0),ks=Dn(1),jw=Dn(2),Ww=Dn(3),lr=Dn(4),qw=Dn(5),Yw=Dn(6);Ds.range,ks.range,jw.range,Ww.range,lr.range,qw.range,Yw.range;function kn(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)/tl)}const rd=kn(0),Rs=kn(1),Xw=kn(2),Zw=kn(3),cr=kn(4),Kw=kn(5),Qw=kn(6);rd.range,Rs.range,Xw.range,Zw.range,cr.range,Kw.range,Qw.range;const sl=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());sl.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 Xe=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());Xe.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)}),Xe.range;const Rn=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());Rn.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)}),Rn.range;function Jw(e,t,n,r,i,s){const a=[[or,1,We],[or,5,5*We],[or,15,15*We],[or,30,30*We],[s,1,pe],[s,5,5*pe],[s,15,15*pe],[s,30,30*pe],[i,1,qe],[i,3,3*qe],[i,6,6*qe],[i,12,12*qe],[r,1,Ye],[r,2,2*Ye],[n,1,tl],[t,1,nd],[t,3,3*nd],[e,1,el]];function o(c,u,h){const d=u<c;d&&([c,u]=[u,c]);const f=h&&typeof h.range=="function"?h:l(c,u,h),p=f?f.range(c,+u+1):[];return d?p.reverse():p}function l(c,u,h){const d=Math.abs(u-c)/h,f=Ba(([,,g])=>g).right(a,d);if(f===a.length)return e.every(Ga(c/el,u/el,h));if(f===0)return Ls.every(Math.max(Ga(c,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,l]}const[t_,e_]=Jw(Xe,sl,Ds,ii,rl,nl);function al(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 ol(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 si(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function n_(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,l=e.shortMonths,c=ai(i),u=oi(i),h=ai(s),d=oi(s),f=ai(a),p=oi(a),m=ai(o),g=oi(o),v=ai(l),y=oi(l),x={a:P,A:R,b:U,B:F,c:null,d:cd,e:cd,f:O_,g:I_,G:P_,H:__,I:E_,j:S_,L:ud,m:T_,M:M_,p:j,q:K,Q:md,s:vd,S:C_,u:$_,U:A_,V:L_,w:D_,W:k_,x:null,X:null,y:R_,Y:N_,Z:U_,"%":gd},S={a:ut,A:G,b:Y,B:ct,c:null,d:dd,e:dd,f:G_,g:Q_,G:tE,H:B_,I:V_,j:H_,L:fd,m:F_,M:z_,p:et,q:Lt,Q:md,s:vd,S:j_,u:W_,U:q_,V:Y_,w:X_,W:Z_,x:null,X:null,y:K_,Y:J_,Z:eE,"%":gd},_={a:$,A:M,b:V,B:C,c:A,d:od,e:od,f:y_,g:ad,G:sd,H:ld,I:ld,j:p_,L:v_,m:f_,M:g_,p:I,q:d_,Q:b_,s:w_,S:m_,u:o_,U:l_,V:c_,w:a_,W:u_,x:w,X:N,y:ad,Y:sd,Z:h_,"%":x_};x.x=E(n,x),x.X=E(r,x),x.c=E(t,x),S.x=E(n,S),S.X=E(r,S),S.c=E(t,S);function E(z,Q){return function(at){var H=[],Dt=-1,vt=0,Qt=z.length,Jt,J,kt;for(at instanceof Date||(at=new Date(+at));++Dt<Qt;)z.charCodeAt(Dt)===37&&(H.push(z.slice(vt,Dt)),(J=id[Jt=z.charAt(++Dt)])!=null?Jt=z.charAt(++Dt):J=Jt==="e"?" ":"0",(kt=Q[Jt])&&(Jt=kt(at,J)),H.push(Jt),vt=Dt+1);return H.push(z.slice(vt,Dt)),H.join("")}}function T(z,Q){return function(at){var H=si(1900,void 0,1),Dt=k(H,z,at+="",0),vt,Qt;if(Dt!=at.length)return null;if("Q"in H)return new Date(H.Q);if("s"in H)return new Date(H.s*1e3+("L"in H?H.L:0));if(Q&&!("Z"in H)&&(H.Z=0),"p"in H&&(H.H=H.H%12+H.p*12),H.m===void 0&&(H.m="q"in H?H.q:0),"V"in H){if(H.V<1||H.V>53)return null;"w"in H||(H.w=1),"Z"in H?(vt=ol(si(H.y,0,1)),Qt=vt.getUTCDay(),vt=Qt>4||Qt===0?Rs.ceil(vt):Rs(vt),vt=il.offset(vt,(H.V-1)*7),H.y=vt.getUTCFullYear(),H.m=vt.getUTCMonth(),H.d=vt.getUTCDate()+(H.w+6)%7):(vt=al(si(H.y,0,1)),Qt=vt.getDay(),vt=Qt>4||Qt===0?ks.ceil(vt):ks(vt),vt=ii.offset(vt,(H.V-1)*7),H.y=vt.getFullYear(),H.m=vt.getMonth(),H.d=vt.getDate()+(H.w+6)%7)}else("W"in H||"U"in H)&&("w"in H||(H.w="u"in H?H.u%7:"W"in H?1:0),Qt="Z"in H?ol(si(H.y,0,1)).getUTCDay():al(si(H.y,0,1)).getDay(),H.m=0,H.d="W"in H?(H.w+6)%7+H.W*7-(Qt+5)%7:H.w+H.U*7-(Qt+6)%7);return"Z"in H?(H.H+=H.Z/100|0,H.M+=H.Z%100,ol(H)):al(H)}}function k(z,Q,at,H){for(var Dt=0,vt=Q.length,Qt=at.length,Jt,J;Dt<vt;){if(H>=Qt)return-1;if(Jt=Q.charCodeAt(Dt++),Jt===37){if(Jt=Q.charAt(Dt++),J=_[Jt in id?Q.charAt(Dt++):Jt],!J||(H=J(z,at,H))<0)return-1}else if(Jt!=at.charCodeAt(H++))return-1}return H}function I(z,Q,at){var H=c.exec(Q.slice(at));return H?(z.p=u.get(H[0].toLowerCase()),at+H[0].length):-1}function $(z,Q,at){var H=f.exec(Q.slice(at));return H?(z.w=p.get(H[0].toLowerCase()),at+H[0].length):-1}function M(z,Q,at){var H=h.exec(Q.slice(at));return H?(z.w=d.get(H[0].toLowerCase()),at+H[0].length):-1}function V(z,Q,at){var H=v.exec(Q.slice(at));return H?(z.m=y.get(H[0].toLowerCase()),at+H[0].length):-1}function C(z,Q,at){var H=m.exec(Q.slice(at));return H?(z.m=g.get(H[0].toLowerCase()),at+H[0].length):-1}function A(z,Q,at){return k(z,t,Q,at)}function w(z,Q,at){return k(z,n,Q,at)}function N(z,Q,at){return k(z,r,Q,at)}function P(z){return a[z.getDay()]}function R(z){return s[z.getDay()]}function U(z){return l[z.getMonth()]}function F(z){return o[z.getMonth()]}function j(z){return i[+(z.getHours()>=12)]}function K(z){return 1+~~(z.getMonth()/3)}function ut(z){return a[z.getUTCDay()]}function G(z){return s[z.getUTCDay()]}function Y(z){return l[z.getUTCMonth()]}function ct(z){return o[z.getUTCMonth()]}function et(z){return i[+(z.getUTCHours()>=12)]}function Lt(z){return 1+~~(z.getUTCMonth()/3)}return{format:function(z){var Q=E(z+="",x);return Q.toString=function(){return z},Q},parse:function(z){var Q=T(z+="",!1);return Q.toString=function(){return z},Q},utcFormat:function(z){var Q=E(z+="",S);return Q.toString=function(){return z},Q},utcParse:function(z){var Q=T(z+="",!0);return Q.toString=function(){return z},Q}}}var id={"-":"",_:" ",0:"0"},Bt=/^\s*\d+/,r_=/^%/,i_=/[\\^$*+?|[\]().{}]/g;function ht(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function s_(e){return e.replace(i_,"\\$&")}function ai(e){return new RegExp("^(?:"+e.map(s_).join("|")+")","i")}function oi(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function a_(e,t,n){var r=Bt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function o_(e,t,n){var r=Bt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function l_(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function c_(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function u_(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function sd(e,t,n){var r=Bt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function ad(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function h_(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function d_(e,t,n){var r=Bt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function f_(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function od(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function p_(e,t,n){var r=Bt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ld(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function g_(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function m_(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function v_(e,t,n){var r=Bt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function y_(e,t,n){var r=Bt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function x_(e,t,n){var r=r_.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function b_(e,t,n){var r=Bt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function w_(e,t,n){var r=Bt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function cd(e,t){return ht(e.getDate(),t,2)}function __(e,t){return ht(e.getHours(),t,2)}function E_(e,t){return ht(e.getHours()%12||12,t,2)}function S_(e,t){return ht(1+ii.count(Xe(e),e),t,3)}function ud(e,t){return ht(e.getMilliseconds(),t,3)}function O_(e,t){return ud(e,t)+"000"}function T_(e,t){return ht(e.getMonth()+1,t,2)}function M_(e,t){return ht(e.getMinutes(),t,2)}function C_(e,t){return ht(e.getSeconds(),t,2)}function $_(e){var t=e.getDay();return t===0?7:t}function A_(e,t){return ht(Ds.count(Xe(e)-1,e),t,2)}function hd(e){var t=e.getDay();return t>=4||t===0?lr(e):lr.ceil(e)}function L_(e,t){return e=hd(e),ht(lr.count(Xe(e),e)+(Xe(e).getDay()===4),t,2)}function D_(e){return e.getDay()}function k_(e,t){return ht(ks.count(Xe(e)-1,e),t,2)}function R_(e,t){return ht(e.getFullYear()%100,t,2)}function I_(e,t){return e=hd(e),ht(e.getFullYear()%100,t,2)}function N_(e,t){return ht(e.getFullYear()%1e4,t,4)}function P_(e,t){var n=e.getDay();return e=n>=4||n===0?lr(e):lr.ceil(e),ht(e.getFullYear()%1e4,t,4)}function U_(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ht(t/60|0,"0",2)+ht(t%60,"0",2)}function dd(e,t){return ht(e.getUTCDate(),t,2)}function B_(e,t){return ht(e.getUTCHours(),t,2)}function V_(e,t){return ht(e.getUTCHours()%12||12,t,2)}function H_(e,t){return ht(1+il.count(Rn(e),e),t,3)}function fd(e,t){return ht(e.getUTCMilliseconds(),t,3)}function G_(e,t){return fd(e,t)+"000"}function F_(e,t){return ht(e.getUTCMonth()+1,t,2)}function z_(e,t){return ht(e.getUTCMinutes(),t,2)}function j_(e,t){return ht(e.getUTCSeconds(),t,2)}function W_(e){var t=e.getUTCDay();return t===0?7:t}function q_(e,t){return ht(rd.count(Rn(e)-1,e),t,2)}function pd(e){var t=e.getUTCDay();return t>=4||t===0?cr(e):cr.ceil(e)}function Y_(e,t){return e=pd(e),ht(cr.count(Rn(e),e)+(Rn(e).getUTCDay()===4),t,2)}function X_(e){return e.getUTCDay()}function Z_(e,t){return ht(Rs.count(Rn(e)-1,e),t,2)}function K_(e,t){return ht(e.getUTCFullYear()%100,t,2)}function Q_(e,t){return e=pd(e),ht(e.getUTCFullYear()%100,t,2)}function J_(e,t){return ht(e.getUTCFullYear()%1e4,t,4)}function tE(e,t){var n=e.getUTCDay();return e=n>=4||n===0?cr(e):cr.ceil(e),ht(e.getUTCFullYear()%1e4,t,4)}function eE(){return"+0000"}function gd(){return"%"}function md(e){return+e}function vd(e){return Math.floor(+e/1e3)}var ur,yd;nE({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 nE(e){return ur=n_(e),yd=ur.format,ur.parse,ur.utcFormat,ur.utcParse,ur}function rE(e){return new Date(e)}function iE(e){return e instanceof Date?+e:+new Date(+e)}function xd(e,t,n,r,i,s,a,o,l,c){var u=Xh(),h=u.invert,d=u.domain,f=c(".%L"),p=c(":%S"),m=c("%I:%M"),g=c("%I %p"),v=c("%a %d"),y=c("%b %d"),x=c("%B"),S=c("%Y");function _(E){return(l(E)<E?f:o(E)<E?p:a(E)<E?m:s(E)<E?g:r(E)<E?i(E)<E?v:y:n(E)<E?x:S)(E)}return u.invert=function(E){return new Date(h(E))},u.domain=function(E){return arguments.length?d(Array.from(E,iE)):d().map(rE)},u.ticks=function(E){var T=d();return e(T[0],T[T.length-1],E??10)},u.tickFormat=function(E,T){return T==null?_:c(T)},u.nice=function(E){var T=d();return(!E||typeof E.range!="function")&&(E=t(T[0],T[T.length-1],E??10)),E?d(Kh(T,E)):u},u.copy=function(){return Zo(u,xd(e,t,n,r,i,s,a,o,l,c))},u}function bd(){return sr.apply(xd(t_,e_,Xe,sl,Ds,ii,rl,nl,or,yd).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function st(e){return function(){return e}}const wd=Math.abs,Wt=Math.atan2,In=Math.cos,sE=Math.max,ll=Math.min,Ne=Math.sin,hr=Math.sqrt,qt=1e-12,li=Math.PI,Is=li/2,Ns=2*li;function aE(e){return e>1?0:e<-1?li:Math.acos(e)}function _d(e){return e>=1?Is:e<=-1?-Is: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 r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Mx(t)}function oE(e){return e.innerRadius}function lE(e){return e.outerRadius}function cE(e){return e.startAngle}function uE(e){return e.endAngle}function hE(e){return e&&e.padAngle}function dE(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,u=a-i,h=o-s,d=h*l-u*c;if(!(d*d<qt))return d=(u*(t-s)-h*(e-i))/d,[e+d*l,t+d*c]}function Us(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/hr(o*o+l*l),u=c*l,h=-c*o,d=e+u,f=t+h,p=n+u,m=r+h,g=(d+p)/2,v=(f+m)/2,y=p-d,x=m-f,S=y*y+x*x,_=i-s,E=d*m-p*f,T=(x<0?-1:1)*hr(sE(0,_*_*S-E*E)),k=(E*x-y*T)/S,I=(-E*y-x*T)/S,$=(E*x+y*T)/S,M=(-E*y+x*T)/S,V=k-g,C=I-v,A=$-g,w=M-v;return V*V+C*C>A*A+w*w&&(k=$,I=M),{cx:k,cy:I,x01:-u,y01:-h,x11:k*(i/_-1),y11:I*(i/_-1)}}function ci(){var e=oE,t=lE,n=st(0),r=null,i=cE,s=uE,a=hE,o=null,l=Ps(c);function c(){var u,h,d=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-Is,m=s.apply(this,arguments)-Is,g=wd(m-p),v=m>p;if(o||(o=u=l()),f<d&&(h=f,f=d,d=h),!(f>qt))o.moveTo(0,0);else if(g>Ns-qt)o.moveTo(f*In(p),f*Ne(p)),o.arc(0,0,f,p,m,!v),d>qt&&(o.moveTo(d*In(m),d*Ne(m)),o.arc(0,0,d,m,p,v));else{var y=p,x=m,S=p,_=m,E=g,T=g,k=a.apply(this,arguments)/2,I=k>qt&&(r?+r.apply(this,arguments):hr(d*d+f*f)),$=ll(wd(f-d)/2,+n.apply(this,arguments)),M=$,V=$,C,A;if(I>qt){var w=_d(I/d*Ne(k)),N=_d(I/f*Ne(k));(E-=w*2)>qt?(w*=v?1:-1,S+=w,_-=w):(E=0,S=_=(p+m)/2),(T-=N*2)>qt?(N*=v?1:-1,y+=N,x-=N):(T=0,y=x=(p+m)/2)}var P=f*In(y),R=f*Ne(y),U=d*In(_),F=d*Ne(_);if($>qt){var j=f*In(x),K=f*Ne(x),ut=d*In(S),G=d*Ne(S),Y;if(g<li)if(Y=dE(P,R,ut,G,j,K,U,F)){var ct=P-Y[0],et=R-Y[1],Lt=j-Y[0],z=K-Y[1],Q=1/Ne(aE((ct*Lt+et*z)/(hr(ct*ct+et*et)*hr(Lt*Lt+z*z)))/2),at=hr(Y[0]*Y[0]+Y[1]*Y[1]);M=ll($,(d-at)/(Q-1)),V=ll($,(f-at)/(Q+1))}else M=V=0}T>qt?V>qt?(C=Us(ut,G,P,R,f,V,v),A=Us(j,K,U,F,f,V,v),o.moveTo(C.cx+C.x01,C.cy+C.y01),V<$?o.arc(C.cx,C.cy,V,Wt(C.y01,C.x01),Wt(A.y01,A.x01),!v):(o.arc(C.cx,C.cy,V,Wt(C.y01,C.x01),Wt(C.y11,C.x11),!v),o.arc(0,0,f,Wt(C.cy+C.y11,C.cx+C.x11),Wt(A.cy+A.y11,A.cx+A.x11),!v),o.arc(A.cx,A.cy,V,Wt(A.y11,A.x11),Wt(A.y01,A.x01),!v))):(o.moveTo(P,R),o.arc(0,0,f,y,x,!v)):o.moveTo(P,R),!(d>qt)||!(E>qt)?o.lineTo(U,F):M>qt?(C=Us(U,F,j,K,d,-M,v),A=Us(P,R,ut,G,d,-M,v),o.lineTo(C.cx+C.x01,C.cy+C.y01),M<$?o.arc(C.cx,C.cy,M,Wt(C.y01,C.x01),Wt(A.y01,A.x01),!v):(o.arc(C.cx,C.cy,M,Wt(C.y01,C.x01),Wt(C.y11,C.x11),!v),o.arc(0,0,d,Wt(C.cy+C.y11,C.cx+C.x11),Wt(A.cy+A.y11,A.cx+A.x11),v),o.arc(A.cx,A.cy,M,Wt(A.y11,A.x11),Wt(A.y01,A.x01),!v))):o.arc(0,0,d,_,S,v)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,h=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-li/2;return[In(h)*u,Ne(h)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:st(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:st(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:st(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:st(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:st(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:st(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:st(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}var fE=Array.prototype.slice;function Bs(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ed(e){this._context=e}Ed.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 Vs(e){return new Ed(e)}function cl(e){return e[0]}function ul(e){return e[1]}function ui(e,t){var n=st(!0),r=null,i=Vs,s=null,a=Ps(o);e=typeof e=="function"?e:e===void 0?cl:st(e),t=typeof t=="function"?t:t===void 0?ul:st(t);function o(l){var c,u=(l=Bs(l)).length,h,d=!1,f;for(r==null&&(s=i(f=a())),c=0;c<=u;++c)!(c<u&&n(h=l[c],c,l))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+e(h,c,l),+t(h,c,l));if(f)return s=null,f+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:st(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:st(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:st(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(s=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=s=null:s=i(r=l),o):r},o}function hl(e,t,n){var r=null,i=st(!0),s=null,a=Vs,o=null,l=Ps(c);e=typeof e=="function"?e:e===void 0?cl:st(+e),t=typeof t=="function"?t:st(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?ul:st(+n);function c(h){var d,f,p,m=(h=Bs(h)).length,g,v=!1,y,x=new Array(m),S=new Array(m);for(s==null&&(o=a(y=l())),d=0;d<=m;++d){if(!(d<m&&i(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(x[p],S[p]);o.lineEnd(),o.areaEnd()}v&&(x[d]=+e(g,d,h),S[d]=+t(g,d,h),o.point(r?+r(g,d,h):x[d],n?+n(g,d,h):S[d]))}if(y)return o=null,y+""||null}function u(){return ui().defined(i).curve(a).context(s)}return c.x=function(h){return arguments.length?(e=typeof h=="function"?h:st(+h),r=null,c):e},c.x0=function(h){return arguments.length?(e=typeof h=="function"?h:st(+h),c):e},c.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:st(+h),c):r},c.y=function(h){return arguments.length?(t=typeof h=="function"?h:st(+h),n=null,c):t},c.y0=function(h){return arguments.length?(t=typeof h=="function"?h:st(+h),c):t},c.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:st(+h),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(h){return arguments.length?(i=typeof h=="function"?h:st(!!h),c):i},c.curve=function(h){return arguments.length?(a=h,s!=null&&(o=a(s)),c):a},c.context=function(h){return arguments.length?(h==null?s=o=null:o=a(s=h),c):s},c}function pE(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function gE(e){return e}function mE(){var e=gE,t=pE,n=null,r=st(0),i=st(Ns),s=st(0);function a(o){var l,c=(o=Bs(o)).length,u,h,d=0,f=new Array(c),p=new Array(c),m=+r.apply(this,arguments),g=Math.min(Ns,Math.max(-Ns,i.apply(this,arguments)-m)),v,y=Math.min(Math.abs(g)/c,s.apply(this,arguments)),x=y*(g<0?-1:1),S;for(l=0;l<c;++l)(S=p[f[l]=l]=+e(o[l],l,o))>0&&(d+=S);for(t!=null?f.sort(function(_,E){return t(p[_],p[E])}):n!=null&&f.sort(function(_,E){return n(o[_],o[E])}),l=0,h=d?(g-c*x)/d:0;l<c;++l,m=v)u=f[l],S=p[u],v=m+(S>0?S*h:0)+x,p[u]={data:o[u],index:l,value:S,startAngle:m,endAngle:v,padAngle:y};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:st(+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?(r=typeof o=="function"?o:st(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:st(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:st(+o),a):s},a}var vE=Od(Vs);function Sd(e){this._curve=e}Sd.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 Od(e){function t(n){return new Sd(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(Od(n)):t()._curve},e}function xE(){return yE(ui().curve(vE))}class bE{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 wE(e){return new bE(e,!0)}function _E(e){return e.source}function EE(e){return e.target}function SE(e){let t=_E,n=EE,r=cl,i=ul,s=null,a=null,o=Ps(l);function l(){let c;const u=fE.call(arguments),h=t.apply(this,u),d=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=h,a.point(+r.apply(this,u),+i.apply(this,u)),u[0]=d,a.point(+r.apply(this,u),+i.apply(this,u)),a.lineEnd(),c)return a=null,c+""||null}return l.source=function(c){return arguments.length?(t=c,l):t},l.target=function(c){return arguments.length?(n=c,l):n},l.x=function(c){return arguments.length?(r=typeof c=="function"?c:st(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:st(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function OE(){return SE(wE)}function fn(){}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 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=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 TE(e){return new Gs(e)}function Td(e){this._context=e}Td.prototype={areaStart:fn,areaEnd:fn,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 ME(e){return new Td(e)}function Md(e){this._context=e}Md.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,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);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 CE(e){return new Md(e)}function Cd(e,t){this._basis=new Gs(e),this._beta=t}Cd.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 r=e[0],i=t[0],s=e[n]-r,a=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const $E=function e(t){function n(r){return t===1?new Gs(r):new Cd(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function Fs(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 dl(e,t){this._context=e,this._k=(1-t)/6}dl.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:Fs(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:Fs(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 AE=function e(t){function n(r){return new dl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function fl(e,t){this._context=e,this._k=(1-t)/6}fl.prototype={areaStart:fn,areaEnd:fn,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:Fs(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 LE=function e(t){function n(r){return new fl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function pl(e,t){this._context=e,this._k=(1-t)/6}pl.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:Fs(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 DE=function e(t){function n(r){return new pl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function gl(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>qt){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>qt){var c=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*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function $d(e,t){this._context=e,this._alpha=t}$d.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,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:gl(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 kE=function e(t){function n(r){return t?new $d(r,t):new dl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Ad(e,t){this._context=e,this._alpha=t}Ad.prototype={areaStart:fn,areaEnd:fn,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,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:gl(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 RE=function e(t){function n(r){return t?new Ad(r,t):new fl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Ld(e,t){this._context=e,this._alpha=t}Ld.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,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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:gl(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 IE=function e(t){function n(r){return t?new Ld(r,t):new pl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Dd(e){this._context=e}Dd.prototype={areaStart:fn,areaEnd:fn,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 kd(e){return new Dd(e)}function Rd(e){return e<0?-1:1}function Id(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(Rd(s)+Rd(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Nd(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ml(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function zs(e){this._context=e}zs.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:ml(this,this._t0,Nd(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,ml(this,Nd(this,n=Id(this,e,t)),n);break;default:ml(this,this._t0,n=Id(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Pd(e){this._context=new Ud(e)}(Pd.prototype=Object.create(zs.prototype)).point=function(e,t){zs.prototype.point.call(this,t,e)};function Ud(e){this._context=e}Ud.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,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function NE(e){return new zs(e)}function PE(e){return new Pd(e)}function Bd(e){this._context=e}Bd.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 r=Vd(e),i=Vd(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[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 Vd(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function UE(e){return new Bd(e)}function js(e,t){this._context=e,this._t=t}js.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 BE(e){return new js(e,.5)}function VE(e){return new js(e,0)}function HE(e){return new js(e,1)}function Hd(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n<a;++n)for(i=s,s=e[t[n]],r=0;r<o;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Gd(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function GE(e,t){return e[t]}function FE(e){const t=[];return t.key=e,t}function vl(){var e=st([]),t=Gd,n=Hd,r=GE;function i(s){var a=Array.from(e.apply(this,arguments),FE),o,l=a.length,c=-1,u;for(const h of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(h,a[o].key,c,s)]).data=h;for(o=0,u=Bs(t(a));o<l;++o)a[u[o]].index=o;return n(a,u),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:st(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:st(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?Gd:typeof s=="function"?s:st(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??Hd,i):n},i}function zE(e,t){if((l=e.length)>0)for(var n,r=0,i,s,a,o,l,c=e[t[0]].length;r<c;++r)for(a=o=0,n=0;n<l;++n)(s=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=s):s<0?(i[1]=o,i[0]=o+=s):(i[0]=0,i[1]=s)}function hi(e,t,n){this.k=e,this.x=t,this.y=n}hi.prototype={constructor:hi,scale:function(e){return e===1?this:new hi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new hi(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+")"}},hi.prototype;var Fd=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Fd||{}),zd=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(zd||{}),jd=(e=>(e.UPDATE="model-update",e))(jd||{}),Wd=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e))(Wd||{}),qd=(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))(qd||{}),Yd=(e=>(e.CHANGE="zoom-domain-change",e))(Yd||{}),Xd=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(Xd||{}),Zd=(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))(Zd||{}),Kd=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Kd||{}),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||{}),Jd=(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))(Jd||{}),tf=(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))(tf||{}),ef=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(ef||{}),nf=(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))(nf||{}),rf=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(rf||{}),sf=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(sf||{}),af=(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))(af||{}),of=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(of||{}),lf=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(lf||{}),di=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(di||{}),cf=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(cf||{}),uf=(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))(uf||{}),hf=(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))(hf||{}),df=(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))(df||{}),ff=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(ff||{}),pf=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(pf||{}),dr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(dr||{});const jE=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:df,Area:Kd,Axis:Zd,Bar:ef,Boxplot:nf,CanvasZoom:Xd,Chart:Fd,Choropleth:dr,CirclePack:hf,Gauge:tf,Heatmap:pf,Legend:uf,Line:sf,Meter:ff,Modal:zd,Model:jd,Pie:Jd,Radar:af,Scatter:rf,Threshold:cf,Toolbar:Wd,Tooltip:di,Tree:of,Treemap:lf,WordCloud:Qd,ZoomBar:qd,ZoomDomain:Yd},Symbol.toStringTag,{value:"Module"})),O=jE;var q=(e=>(e.HTML="html",e.SVG="svg",e))(q||{}),gf=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(gf||{}),X=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(X||{}),B=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(B||{}),Pe=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Pe||{}),Te=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Te||{}),Vt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Vt||{}),W=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(W||{}),fi=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(fi||{}),It=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(It||{}),pi=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(pi||{}),yl=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(yl||{}),bt=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(bt||{}),tt=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(tt||{}),fr=(e=>(e.CENTER="center",e))(fr||{}),Ws=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ws||{}),Nt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Nt||{}),Ze=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(Ze||{}),Ke=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(Ke||{}),pr=(e=>(e.SEMI="semi",e.FULL="full",e))(pr||{}),xl=(e=>(e.UP="up",e.DOWN="down",e))(xl||{}),qs=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(qs||{}),Ys=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(Ys||{}),ge=(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))(ge||{}),Mt=(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))(Mt||{}),bl=(e=>(e.LEFT="left",e.RIGHT="right",e))(bl||{}),Pt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(Pt||{}),Xs=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(Xs||{}),gi=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(gi||{}),Zs=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(Zs||{}),Qe=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(Qe||{});function wl(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}function mi(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",i;if(r==="formatting"&&e.formattingValues){var s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;i=e.formattingValues[a]||e.formattingValues[s]}else{var o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[l]||e.values[o]}var c=e.argumentCallback?e.argumentCallback(t):t;return i[c]}}function vi(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;var a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?qE(o,function(h){return h.test(a)}):WE(o,function(h){return h.test(a)}),c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=t.slice(a.length);return{value:c,rest:u}}}function WE(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function qE(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function YE(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var i=r[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(i.length);return{value:a,rest:o}}}function Ks(e){"@babel/helpers - typeof";return Ks=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},Ks(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 rt(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function dt(e){rt(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Ks(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 Qs(e,t){rt(2,arguments);var n=dt(e).getTime(),r=Ut(t);return new Date(n+r)}var XE={};function Js(){return XE}function _l(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 ZE(e){return rt(1,arguments),e instanceof Date||Ks(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function KE(e){if(rt(1,arguments),!ZE(e)&&typeof e!="number")return!1;var t=dt(e);return!isNaN(Number(t))}function QE(e,t){rt(2,arguments);var n=Ut(t);return Qs(e,-n)}var JE=864e5;function tS(e){rt(1,arguments);var t=dt(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),i=n-r;return Math.floor(i/JE)+1}function ta(e){rt(1,arguments);var t=1,n=dt(e),r=n.getUTCDay(),i=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-i),n.setUTCHours(0,0,0,0),n}function mf(e){rt(1,arguments);var t=dt(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=ta(r),s=new Date(0);s.setUTCFullYear(n,0,4),s.setUTCHours(0,0,0,0);var a=ta(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function eS(e){rt(1,arguments);var t=mf(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=ta(n);return r}var nS=6048e5;function rS(e){rt(1,arguments);var t=dt(e),n=ta(t).getTime()-eS(t).getTime();return Math.round(n/nS)+1}function ea(e,t){var n,r,i,s,a,o,l,c;rt(1,arguments);var u=Js(),h=Ut((n=(r=(i=(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&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.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=dt(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 vf(e,t){var n,r,i,s,a,o,l,c;rt(1,arguments);var u=dt(e),h=u.getUTCFullYear(),d=Js(),f=Ut((n=(r=(i=(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&&i!==void 0?i:d.firstWeekContainsDate)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.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=ea(p,t),g=new Date(0);g.setUTCFullYear(h,0,f),g.setUTCHours(0,0,0,0);var v=ea(g,t);return u.getTime()>=m.getTime()?h+1:u.getTime()>=v.getTime()?h:h-1}function iS(e,t){var n,r,i,s,a,o,l,c;rt(1,arguments);var u=Js(),h=Ut((n=(r=(i=(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&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=vf(e,t),f=new Date(0);f.setUTCFullYear(d,0,h),f.setUTCHours(0,0,0,0);var p=ea(f,t);return p}var sS=6048e5;function aS(e,t){rt(1,arguments);var n=dt(e),r=ea(n,t).getTime()-iS(n,t).getTime();return Math.round(r/sS)+1}function mt(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var oS={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return mt(t==="yy"?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):mt(n+1,2)},d:function(e,t){return mt(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 mt(e.getUTCHours()%12||12,t.length)},H:function(e,t){return mt(e.getUTCHours(),t.length)},m:function(e,t){return mt(e.getUTCMinutes(),t.length)},s:function(e,t){return mt(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds(),i=Math.floor(r*Math.pow(10,n-3));return mt(i,t.length)}};const pn=oS;var gr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lS={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){var r=e.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return pn.y(e,t)},Y:function(e,t,n,r){var i=vf(e,r),s=i>0?i:1-i;if(t==="YY"){var a=s%100;return mt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):mt(s,t.length)},R:function(e,t){var n=mf(e);return mt(n,t.length)},u:function(e,t){var n=e.getUTCFullYear();return mt(n,t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return mt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return mt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return pn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return mt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var i=aS(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):mt(i,t.length)},I:function(e,t,n){var r=rS(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):mt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):pn.d(e,t)},D:function(e,t,n){var r=tS(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):mt(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":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"})}},e:function(e,t,n,r){var i=e.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return mt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});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"})}},c:function(e,t,n,r){var i=e.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return mt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return mt(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours(),i=r/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r=e.getUTCHours(),i;switch(r===12?i=gr.noon:r===0?i=gr.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r=e.getUTCHours(),i;switch(r>=17?i=gr.evening:r>=12?i=gr.afternoon:r>=4?i=gr.morning:i=gr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){var r=e.getUTCHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return pn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):pn.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):mt(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):mt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):pn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):pn.s(e,t)},S:function(e,t){return pn.S(e,t)},X:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return xf(s);case"XXXX":case"XX":return Nn(s);case"XXXXX":case"XXX":default:return Nn(s,":")}},x:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();switch(t){case"x":return xf(s);case"xxxx":case"xx":return Nn(s);case"xxxxx":case"xxx":default:return Nn(s,":")}},O:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+yf(s,":");case"OOOO":default:return"GMT"+Nn(s,":")}},z:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+yf(s,":");case"zzzz":default:return"GMT"+Nn(s,":")}},t:function(e,t,n,r){var i=r._originalDate||e,s=Math.floor(i.getTime()/1e3);return mt(s,t.length)},T:function(e,t,n,r){var i=r._originalDate||e,s=i.getTime();return mt(s,t.length)}};function yf(e,t){var n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),s=r%60;if(s===0)return n+String(i);var a=t||"";return n+String(i)+a+mt(s,2)}function xf(e,t){if(e%60===0){var n=e>0?"-":"+";return n+mt(Math.abs(e)/60,2)}return Nn(e,t)}function Nn(e,t){var n=t||"",r=e>0?"-":"+",i=Math.abs(e),s=mt(Math.floor(i/60),2),a=mt(i%60,2);return r+s+n+a}const cS=lS;var bf=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"})}},wf=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"})}},uS=function(e,t){var n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return bf(e,t);var s;switch(r){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}}",bf(r,t)).replace("{{time}}",wf(i,t))},hS={p:wf,P:uS};const dS=hS;var fS=["D","DD"],pS=["YY","YYYY"];function gS(e){return fS.indexOf(e)!==-1}function mS(e){return pS.indexOf(e)!==-1}function _f(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 vS={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"}},yS=function(e,t,n){var r,i=vS[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};const xS=yS;var bS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},wS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},_S={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ES={date:wl({formats:bS,defaultWidth:"full"}),time:wl({formats:wS,defaultWidth:"full"}),dateTime:wl({formats:_S,defaultWidth:"full"})};const SS=ES;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"},TS=function(e,t,n,r){return OS[e]};const MS=TS;var CS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$S={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"]},LS={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"]},DS={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"}},kS={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"}},RS=function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},IS={ordinalNumber:RS,era:mi({values:CS,defaultWidth:"wide"}),quarter:mi({values:$S,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:mi({values:AS,defaultWidth:"wide"}),day:mi({values:LS,defaultWidth:"wide"}),dayPeriod:mi({values:DS,defaultWidth:"wide",formattingValues:kS,defaultFormattingWidth:"wide"})};const NS=IS;var PS=/^(\d+)(th|st|nd|rd)?/i,US=/\d+/i,BS={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},VS={any:[/^b/i,/^(a|c)/i]},HS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},GS={any:[/1/i,/2/i,/3/i,/4/i]},FS={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},zS={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]},jS={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},WS={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]},qS={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},YS={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}},XS={ordinalNumber:YE({matchPattern:PS,parsePattern:US,valueCallback:function(e){return parseInt(e,10)}}),era:vi({matchPatterns:BS,defaultMatchWidth:"wide",parsePatterns:VS,defaultParseWidth:"any"}),quarter:vi({matchPatterns:HS,defaultMatchWidth:"wide",parsePatterns:GS,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:vi({matchPatterns:FS,defaultMatchWidth:"wide",parsePatterns:zS,defaultParseWidth:"any"}),day:vi({matchPatterns:jS,defaultMatchWidth:"wide",parsePatterns:WS,defaultParseWidth:"any"}),dayPeriod:vi({matchPatterns:qS,defaultMatchWidth:"any",parsePatterns:YS,defaultParseWidth:"any"})},ZS={code:"en-US",formatDistance:xS,formatLong:SS,formatRelative:MS,localize:NS,match:XS,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Ef=ZS;var KS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,QS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,JS=/^'([^]*?)'?$/,tO=/''/g,eO=/[a-zA-Z]/;function mr(e,t,n){var r,i,s,a,o,l,c,u,h,d,f,p,m,g,v,y,x,S;rt(2,arguments);var _=String(t),E=Js(),T=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:E.locale)!==null&&r!==void 0?r:Ef,k=Ut((s=(a=(o=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:E.firstWeekContainsDate)!==null&&a!==void 0?a:(h=E.locale)===null||h===void 0||(d=h.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(k>=1&&k<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var I=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||(y=v.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&m!==void 0?m:E.weekStartsOn)!==null&&p!==void 0?p:(x=E.locale)===null||x===void 0||(S=x.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&f!==void 0?f:0);if(!(I>=0&&I<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!T.localize)throw new RangeError("locale must contain localize property");if(!T.formatLong)throw new RangeError("locale must contain formatLong property");var $=dt(e);if(!KE($))throw new RangeError("Invalid time value");var M=_l($),V=QE($,M),C={firstWeekContainsDate:k,weekStartsOn:I,locale:T,_originalDate:$},A=_.match(QS).map(function(w){var N=w[0];if(N==="p"||N==="P"){var P=dS[N];return P(w,T.formatLong)}return w}).join("").match(KS).map(function(w){if(w==="''")return"'";var N=w[0];if(N==="'")return nO(w);var P=cS[N];if(P)return!(n!=null&&n.useAdditionalWeekYearTokens)&&mS(w)&&_f(w,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&gS(w)&&_f(w,t,String(e)),P(V,w,T.localize,C);if(N.match(eO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+N+"`");return w}).join("");return A}function nO(e){var t=e.match(JS);return t?t[1].replace(tO,"'"):e}const ne="cds",Je={opacity:{unselected:.05,selected:.4}},gn={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},vr={duration:1e3,ease:Au,zoomLevel:3},yr={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},Sf={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},me={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},rO={defaultBins:10},Ct={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}},tn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},Ht={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},wt={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}},Pn={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},Me={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},Of={minCellDividerDimension:16,chartPadding:.5},Tf={default:{size:24}},iO={horizontalOffset:10},Mf={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:{[Pe.GRAPH_VIEW]:32,[Pe.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},sO=[{type:Pt.RADIUS,name:"Radius"},{type:Pt.AREA,name:"Poor area"},{type:Pt.AREA,name:"Satisfactory area"},{type:Pt.AREA,name:"Great area"},{type:Pt.QUARTILE,name:"Quartiles"}];var aO=typeof global=="object"&&global&&global.Object===Object&&global;const Cf=aO;var oO=typeof self=="object"&&self&&self.Object===Object&&self,lO=Cf||oO||Function("return this")();const Ce=lO;var cO=Ce.Symbol;const ve=cO;var $f=Object.prototype,uO=$f.hasOwnProperty,hO=$f.toString,yi=ve?ve.toStringTag:void 0;function dO(e){var t=uO.call(e,yi),n=e[yi];try{e[yi]=void 0;var r=!0}catch{}var i=hO.call(e);return r&&(t?e[yi]=n:delete e[yi]),i}var fO=Object.prototype,pO=fO.toString;function gO(e){return pO.call(e)}var mO="[object Null]",vO="[object Undefined]",Af=ve?ve.toStringTag:void 0;function Un(e){return e==null?e===void 0?vO:mO:Af&&Af in Object(e)?dO(e):gO(e)}function Ue(e){return e!=null&&typeof e=="object"}var yO="[object Symbol]";function na(e){return typeof e=="symbol"||Ue(e)&&Un(e)==yO}function Lf(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var xO=Array.isArray;const Gt=xO;var bO=1/0,Df=ve?ve.prototype:void 0,kf=Df?Df.toString:void 0;function Rf(e){if(typeof e=="string")return e;if(Gt(e))return Lf(e,Rf)+"";if(na(e))return kf?kf.call(e):"";var t=e+"";return t=="0"&&1/e==-bO?"-0":t}function ye(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function El(e){return e}var wO="[object AsyncFunction]",_O="[object Function]",EO="[object GeneratorFunction]",SO="[object Proxy]";function Sl(e){if(!ye(e))return!1;var t=Un(e);return t==_O||t==EO||t==wO||t==SO}var OO=Ce["__core-js_shared__"];const Ol=OO;var If=function(){var e=/[^.]+$/.exec(Ol&&Ol.keys&&Ol.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function TO(e){return!!If&&If in e}var MO=Function.prototype,CO=MO.toString;function Bn(e){if(e!=null){try{return CO.call(e)}catch{}try{return e+""}catch{}}return""}var $O=/[\\^$.*+?()[\]{}|]/g,AO=/^\[object .+?Constructor\]$/,LO=Function.prototype,DO=Object.prototype,kO=LO.toString,RO=DO.hasOwnProperty,IO=RegExp("^"+kO.call(RO).replace($O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function NO(e){if(!ye(e)||TO(e))return!1;var t=Sl(e)?IO:AO;return t.test(Bn(e))}function PO(e,t){return e==null?void 0:e[t]}function Vn(e,t){var n=PO(e,t);return NO(n)?n:void 0}var UO=Vn(Ce,"WeakMap");const Tl=UO;var Nf=Object.create,BO=function(){function e(){}return function(t){if(!ye(t))return{};if(Nf)return Nf(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const VO=BO;function HO(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 GO(){}function Pf(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var FO=800,zO=16,jO=Date.now;function WO(e){var t=0,n=0;return function(){var r=jO(),i=zO-(r-n);if(n=r,i>0){if(++t>=FO)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function qO(e){return function(){return e}}var YO=function(){try{var e=Vn(Object,"defineProperty");return e({},"",{}),e}catch{}}();const ra=YO;var XO=ra?function(e,t){return ra(e,"toString",{configurable:!0,enumerable:!1,value:qO(t),writable:!0})}:El,ZO=WO(XO);const KO=ZO;function QO(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function JO(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}function tT(e){return e!==e}function eT(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function nT(e,t,n){return t===t?eT(e,t,n):JO(e,tT,n)}function rT(e,t){var n=e==null?0:e.length;return!!n&&nT(e,t,0)>-1}var iT=9007199254740991,sT=/^(?:0|[1-9]\d*)$/;function Ml(e,t){var n=typeof e;return t=t??iT,!!t&&(n=="number"||n!="symbol"&&sT.test(e))&&e>-1&&e%1==0&&e<t}function ia(e,t,n){t=="__proto__"&&ra?ra(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function xi(e,t){return e===t||e!==e&&t!==t}var aT=Object.prototype,oT=aT.hasOwnProperty;function Uf(e,t,n){var r=e[t];(!(oT.call(e,t)&&xi(r,n))||n===void 0&&!(t in e))&&ia(e,t,n)}function bi(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=r?r(n[o],e[o],o,n,e):void 0;l===void 0&&(l=e[o]),i?ia(n,o,l):Uf(n,o,l)}return n}var Bf=Math.max;function lT(e,t,n){return t=Bf(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=Bf(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),HO(e,this,o)}}function Vf(e,t){return KO(lT(e,t,El),e+"")}var cT=9007199254740991;function Cl(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=cT}function Hn(e){return e!=null&&Cl(e.length)&&!Sl(e)}function Hf(e,t,n){if(!ye(n))return!1;var r=typeof t;return(r=="number"?Hn(n)&&Ml(t,n.length):r=="string"&&t in n)?xi(n[t],e):!1}function uT(e){return Vf(function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&Hf(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,s)}return t})}var hT=Object.prototype;function sa(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||hT;return e===n}function dT(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var fT="[object Arguments]";function Gf(e){return Ue(e)&&Un(e)==fT}var Ff=Object.prototype,pT=Ff.hasOwnProperty,gT=Ff.propertyIsEnumerable,mT=Gf(function(){return arguments}())?Gf:function(e){return Ue(e)&&pT.call(e,"callee")&&!gT.call(e,"callee")};const xr=mT;function vT(){return!1}var zf=typeof nt=="object"&&nt&&!nt.nodeType&&nt,jf=zf&&typeof module=="object"&&module&&!module.nodeType&&module,yT=jf&&jf.exports===zf,Wf=yT?Ce.Buffer:void 0,xT=Wf?Wf.isBuffer:void 0,bT=xT||vT;const br=bT;var wT="[object Arguments]",_T="[object Array]",ET="[object Boolean]",ST="[object Date]",OT="[object Error]",TT="[object Function]",MT="[object Map]",CT="[object Number]",$T="[object Object]",AT="[object RegExp]",LT="[object Set]",DT="[object String]",kT="[object WeakMap]",RT="[object ArrayBuffer]",IT="[object DataView]",NT="[object Float32Array]",PT="[object Float64Array]",UT="[object Int8Array]",BT="[object Int16Array]",VT="[object Int32Array]",HT="[object Uint8Array]",GT="[object Uint8ClampedArray]",FT="[object Uint16Array]",zT="[object Uint32Array]",St={};St[NT]=St[PT]=St[UT]=St[BT]=St[VT]=St[HT]=St[GT]=St[FT]=St[zT]=!0,St[wT]=St[_T]=St[RT]=St[ET]=St[IT]=St[ST]=St[OT]=St[TT]=St[MT]=St[CT]=St[$T]=St[AT]=St[LT]=St[DT]=St[kT]=!1;function jT(e){return Ue(e)&&Cl(e.length)&&!!St[Un(e)]}function $l(e){return function(t){return e(t)}}var qf=typeof nt=="object"&&nt&&!nt.nodeType&&nt,wi=qf&&typeof module=="object"&&module&&!module.nodeType&&module,WT=wi&&wi.exports===qf,Al=WT&&Cf.process,qT=function(){try{var e=wi&&wi.require&&wi.require("util").types;return e||Al&&Al.binding&&Al.binding("util")}catch{}}();const wr=qT;var Yf=wr&&wr.isTypedArray,YT=Yf?$l(Yf):jT;const aa=YT;var XT=Object.prototype,ZT=XT.hasOwnProperty;function Xf(e,t){var n=Gt(e),r=!n&&xr(e),i=!n&&!r&&br(e),s=!n&&!r&&!i&&aa(e),a=n||r||i||s,o=a?dT(e.length,String):[],l=o.length;for(var c in e)(t||ZT.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ml(c,l)))&&o.push(c);return o}function Zf(e,t){return function(n){return e(t(n))}}var KT=Zf(Object.keys,Object);const QT=KT;var JT=Object.prototype,tM=JT.hasOwnProperty;function Kf(e){if(!sa(e))return QT(e);var t=[];for(var n in Object(e))tM.call(e,n)&&n!="constructor"&&t.push(n);return t}function _i(e){return Hn(e)?Xf(e):Kf(e)}function eM(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var nM=Object.prototype,rM=nM.hasOwnProperty;function iM(e){if(!ye(e))return eM(e);var t=sa(e),n=[];for(var r in e)r=="constructor"&&(t||!rM.call(e,r))||n.push(r);return n}function Ei(e){return Hn(e)?Xf(e,!0):iM(e)}var sM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,aM=/^\w*$/;function Ll(e,t){if(Gt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||na(e)?!0:aM.test(e)||!sM.test(e)||t!=null&&e in Object(t)}var oM=Vn(Object,"create");const Si=oM;function lM(){this.__data__=Si?Si(null):{},this.size=0}function cM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var uM="__lodash_hash_undefined__",hM=Object.prototype,dM=hM.hasOwnProperty;function fM(e){var t=this.__data__;if(Si){var n=t[e];return n===uM?void 0:n}return dM.call(t,e)?t[e]:void 0}var pM=Object.prototype,gM=pM.hasOwnProperty;function mM(e){var t=this.__data__;return Si?t[e]!==void 0:gM.call(t,e)}var vM="__lodash_hash_undefined__";function yM(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Si&&t===void 0?vM:t,this}function Gn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Gn.prototype.clear=lM,Gn.prototype.delete=cM,Gn.prototype.get=fM,Gn.prototype.has=mM,Gn.prototype.set=yM;function xM(){this.__data__=[],this.size=0}function oa(e,t){for(var n=e.length;n--;)if(xi(e[n][0],t))return n;return-1}var bM=Array.prototype,wM=bM.splice;function _M(e){var t=this.__data__,n=oa(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():wM.call(t,n,1),--this.size,!0}function EM(e){var t=this.__data__,n=oa(t,e);return n<0?void 0:t[n][1]}function SM(e){return oa(this.__data__,e)>-1}function OM(e,t){var n=this.__data__,r=oa(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function en(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}en.prototype.clear=xM,en.prototype.delete=_M,en.prototype.get=EM,en.prototype.has=SM,en.prototype.set=OM;var TM=Vn(Ce,"Map");const Oi=TM;function MM(){this.size=0,this.__data__={hash:new Gn,map:new(Oi||en),string:new Gn}}function CM(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function la(e,t){var n=e.__data__;return CM(t)?n[typeof t=="string"?"string":"hash"]:n.map}function $M(e){var t=la(this,e).delete(e);return this.size-=t?1:0,t}function AM(e){return la(this,e).get(e)}function LM(e){return la(this,e).has(e)}function DM(e,t){var n=la(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function nn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}nn.prototype.clear=MM,nn.prototype.delete=$M,nn.prototype.get=AM,nn.prototype.has=LM,nn.prototype.set=DM;var kM="Expected a function";function Dl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(kM);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(Dl.Cache||nn),n}Dl.Cache=nn;var RM=500;function IM(e){var t=Dl(e,function(r){return n.size===RM&&n.clear(),r}),n=t.cache;return t}var NM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,PM=/\\(\\)?/g,UM=IM(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(NM,function(n,r,i,s){t.push(i?s.replace(PM,"$1"):r||n)}),t});const BM=UM;function Ti(e){return e==null?"":Rf(e)}function Qf(e,t){return Gt(e)?e:Ll(e,t)?[e]:BM(Ti(e))}var VM=1/0;function ca(e){if(typeof e=="string"||na(e))return e;var t=e+"";return t=="0"&&1/e==-VM?"-0":t}function Jf(e,t){t=Qf(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ca(t[n++])];return n&&n==r?e:void 0}function _t(e,t,n){var r=e==null?void 0:Jf(e,t);return r===void 0?n:r}function kl(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var tp=ve?ve.isConcatSpreadable:void 0;function HM(e){return Gt(e)||xr(e)||!!(tp&&e&&e[tp])}function ua(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=HM),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?ua(o,t-1,n,r,i):kl(i,o):r||(i[i.length]=o)}return i}var GM=Zf(Object.getPrototypeOf,Object);const Rl=GM;var FM="[object Object]",zM=Function.prototype,jM=Object.prototype,ep=zM.toString,WM=jM.hasOwnProperty,qM=ep.call(Object);function YM(e){if(!Ue(e)||Un(e)!=FM)return!1;var t=Rl(e);if(t===null)return!0;var n=WM.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&ep.call(n)==qM}function XM(){this.__data__=new en,this.size=0}function ZM(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function KM(e){return this.__data__.get(e)}function QM(e){return this.__data__.has(e)}var JM=200;function tC(e,t){var n=this.__data__;if(n instanceof en){var r=n.__data__;if(!Oi||r.length<JM-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new nn(r)}return n.set(e,t),this.size=n.size,this}function $e(e){var t=this.__data__=new en(e);this.size=t.size}$e.prototype.clear=XM,$e.prototype.delete=ZM,$e.prototype.get=KM,$e.prototype.has=QM,$e.prototype.set=tC;function eC(e,t){return e&&bi(t,_i(t),e)}function nC(e,t){return e&&bi(t,Ei(t),e)}var np=typeof nt=="object"&&nt&&!nt.nodeType&&nt,rp=np&&typeof module=="object"&&module&&!module.nodeType&&module,rC=rp&&rp.exports===np,ip=rC?Ce.Buffer:void 0,sp=ip?ip.allocUnsafe:void 0;function ap(e,t){if(t)return e.slice();var n=e.length,r=sp?sp(n):new e.constructor(n);return e.copy(r),r}function iC(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}function op(){return[]}var sC=Object.prototype,aC=sC.propertyIsEnumerable,lp=Object.getOwnPropertySymbols,oC=lp?function(e){return e==null?[]:(e=Object(e),iC(lp(e),function(t){return aC.call(e,t)}))}:op;const Il=oC;function lC(e,t){return bi(e,Il(e),t)}var cC=Object.getOwnPropertySymbols,uC=cC?function(e){for(var t=[];e;)kl(t,Il(e)),e=Rl(e);return t}:op;const cp=uC;function hC(e,t){return bi(e,cp(e),t)}function up(e,t,n){var r=t(e);return Gt(e)?r:kl(r,n(e))}function Nl(e){return up(e,_i,Il)}function dC(e){return up(e,Ei,cp)}var fC=Vn(Ce,"DataView");const Pl=fC;var pC=Vn(Ce,"Promise");const Ul=pC;var gC=Vn(Ce,"Set");const _r=gC;var hp="[object Map]",mC="[object Object]",dp="[object Promise]",fp="[object Set]",pp="[object WeakMap]",gp="[object DataView]",vC=Bn(Pl),yC=Bn(Oi),xC=Bn(Ul),bC=Bn(_r),wC=Bn(Tl),Fn=Un;(Pl&&Fn(new Pl(new ArrayBuffer(1)))!=gp||Oi&&Fn(new Oi)!=hp||Ul&&Fn(Ul.resolve())!=dp||_r&&Fn(new _r)!=fp||Tl&&Fn(new Tl)!=pp)&&(Fn=function(e){var t=Un(e),n=t==mC?e.constructor:void 0,r=n?Bn(n):"";if(r)switch(r){case vC:return gp;case yC:return hp;case xC:return dp;case bC:return fp;case wC:return pp}return t});const Er=Fn;var _C=Object.prototype,EC=_C.hasOwnProperty;function SC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&EC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var OC=Ce.Uint8Array;const ha=OC;function Bl(e){var t=new e.constructor(e.byteLength);return new ha(t).set(new ha(e)),t}function TC(e,t){var n=t?Bl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var MC=/\w*$/;function CC(e){var t=new e.constructor(e.source,MC.exec(e));return t.lastIndex=e.lastIndex,t}var mp=ve?ve.prototype:void 0,vp=mp?mp.valueOf:void 0;function $C(e){return vp?Object(vp.call(e)):{}}function yp(e,t){var n=t?Bl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var AC="[object Boolean]",LC="[object Date]",DC="[object Map]",kC="[object Number]",RC="[object RegExp]",IC="[object Set]",NC="[object String]",PC="[object Symbol]",UC="[object ArrayBuffer]",BC="[object DataView]",VC="[object Float32Array]",HC="[object Float64Array]",GC="[object Int8Array]",FC="[object Int16Array]",zC="[object Int32Array]",jC="[object Uint8Array]",WC="[object Uint8ClampedArray]",qC="[object Uint16Array]",YC="[object Uint32Array]";function XC(e,t,n){var r=e.constructor;switch(t){case UC:return Bl(e);case AC:case LC:return new r(+e);case BC:return TC(e,n);case VC:case HC:case GC:case FC:case zC:case jC:case WC:case qC:case YC:return yp(e,n);case DC:return new r;case kC:case NC:return new r(e);case RC:return CC(e);case IC:return new r;case PC:return $C(e)}}function xp(e){return typeof e.constructor=="function"&&!sa(e)?VO(Rl(e)):{}}var ZC="[object Map]";function KC(e){return Ue(e)&&Er(e)==ZC}var bp=wr&&wr.isMap,QC=bp?$l(bp):KC;const JC=QC;var t2="[object Set]";function e2(e){return Ue(e)&&Er(e)==t2}var wp=wr&&wr.isSet,n2=wp?$l(wp):e2;const r2=n2;var i2=1,s2=2,a2=4,_p="[object Arguments]",o2="[object Array]",l2="[object Boolean]",c2="[object Date]",u2="[object Error]",Ep="[object Function]",h2="[object GeneratorFunction]",d2="[object Map]",f2="[object Number]",Sp="[object Object]",p2="[object RegExp]",g2="[object Set]",m2="[object String]",v2="[object Symbol]",y2="[object WeakMap]",x2="[object ArrayBuffer]",b2="[object DataView]",w2="[object Float32Array]",_2="[object Float64Array]",E2="[object Int8Array]",S2="[object Int16Array]",O2="[object Int32Array]",T2="[object Uint8Array]",M2="[object Uint8ClampedArray]",C2="[object Uint16Array]",$2="[object Uint32Array]",Et={};Et[_p]=Et[o2]=Et[x2]=Et[b2]=Et[l2]=Et[c2]=Et[w2]=Et[_2]=Et[E2]=Et[S2]=Et[O2]=Et[d2]=Et[f2]=Et[Sp]=Et[p2]=Et[g2]=Et[m2]=Et[v2]=Et[T2]=Et[M2]=Et[C2]=Et[$2]=!0,Et[u2]=Et[Ep]=Et[y2]=!1;function da(e,t,n,r,i,s){var a,o=t&i2,l=t&s2,c=t&a2;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!ye(e))return e;var u=Gt(e);if(u){if(a=SC(e),!o)return Pf(e,a)}else{var h=Er(e),d=h==Ep||h==h2;if(br(e))return ap(e,o);if(h==Sp||h==_p||d&&!i){if(a=l||d?{}:xp(e),!o)return l?hC(e,nC(a,e)):lC(e,eC(a,e))}else{if(!Et[h])return i?e:{};a=XC(e,h,o)}}s||(s=new $e);var f=s.get(e);if(f)return f;s.set(e,a),r2(e)?e.forEach(function(g){a.add(da(g,t,n,g,e,s))}):JC(e)&&e.forEach(function(g,v){a.set(v,da(g,t,n,v,e,s))});var p=c?l?dC:Nl:l?Ei:_i,m=u?void 0:p(e);return QO(m||e,function(g,v){m&&(v=g,g=e[v]),Uf(a,v,da(g,t,n,v,e,s))}),a}var A2=1,L2=4;function D2(e){return da(e,A2|L2)}var k2="__lodash_hash_undefined__";function R2(e){return this.__data__.set(e,k2),this}function I2(e){return this.__data__.has(e)}function Mi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new nn;++t<n;)this.add(e[t])}Mi.prototype.add=Mi.prototype.push=R2,Mi.prototype.has=I2;function Op(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Tp(e,t){return e.has(t)}var N2=1,P2=2;function Mp(e,t,n,r,i,s){var a=n&N2,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var h=-1,d=!0,f=n&P2?new Mi:void 0;for(s.set(e,t),s.set(t,e);++h<o;){var p=e[h],m=t[h];if(r)var g=a?r(m,p,h,t,e,s):r(p,m,h,e,t,s);if(g!==void 0){if(g)continue;d=!1;break}if(f){if(!Op(t,function(v,y){if(!Tp(f,y)&&(p===v||i(p,v,n,r,s)))return f.push(y)})){d=!1;break}}else if(!(p===m||i(p,m,n,r,s))){d=!1;break}}return s.delete(e),s.delete(t),d}function U2(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function Vl(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var B2=1,V2=2,H2="[object Boolean]",G2="[object Date]",F2="[object Error]",z2="[object Map]",j2="[object Number]",W2="[object RegExp]",q2="[object Set]",Y2="[object String]",X2="[object Symbol]",Z2="[object ArrayBuffer]",K2="[object DataView]",Cp=ve?ve.prototype:void 0,Hl=Cp?Cp.valueOf:void 0;function Q2(e,t,n,r,i,s,a){switch(n){case K2:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Z2:return!(e.byteLength!=t.byteLength||!s(new ha(e),new ha(t)));case H2:case G2:case j2:return xi(+e,+t);case F2:return e.name==t.name&&e.message==t.message;case W2:case Y2:return e==t+"";case z2:var o=U2;case q2:var l=r&B2;if(o||(o=Vl),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=V2,a.set(e,t);var u=Mp(o(e),o(t),r,i,s,a);return a.delete(e),u;case X2:if(Hl)return Hl.call(e)==Hl.call(t)}return!1}var J2=1,t$=Object.prototype,e$=t$.hasOwnProperty;function n$(e,t,n,r,i,s){var a=n&J2,o=Nl(e),l=o.length,c=Nl(t),u=c.length;if(l!=u&&!a)return!1;for(var h=l;h--;){var d=o[h];if(!(a?d in t:e$.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<l;){d=o[h];var v=e[d],y=t[d];if(r)var x=a?r(y,v,d,t,e,s):r(v,y,d,e,t,s);if(!(x===void 0?v===y||i(v,y,n,r,s):x)){m=!1;break}g||(g=d=="constructor")}if(m&&!g){var S=e.constructor,_=t.constructor;S!=_&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof _=="function"&&_ instanceof _)&&(m=!1)}return s.delete(e),s.delete(t),m}var r$=1,$p="[object Arguments]",Ap="[object Array]",fa="[object Object]",i$=Object.prototype,Lp=i$.hasOwnProperty;function s$(e,t,n,r,i,s){var a=Gt(e),o=Gt(t),l=a?Ap:Er(e),c=o?Ap:Er(t);l=l==$p?fa:l,c=c==$p?fa:c;var u=l==fa,h=c==fa,d=l==c;if(d&&br(e)){if(!br(t))return!1;a=!0,u=!1}if(d&&!u)return s||(s=new $e),a||aa(e)?Mp(e,t,n,r,i,s):Q2(e,t,l,n,r,i,s);if(!(n&r$)){var f=u&&Lp.call(e,"__wrapped__"),p=h&&Lp.call(t,"__wrapped__");if(f||p){var m=f?e.value():e,g=p?t.value():t;return s||(s=new $e),i(m,g,n,r,s)}}return d?(s||(s=new $e),n$(e,t,n,r,i,s)):!1}function pa(e,t,n,r,i){return e===t?!0:e==null||t==null||!Ue(e)&&!Ue(t)?e!==e&&t!==t:s$(e,t,n,r,pa,i)}var a$=1,o$=2;function l$(e,t,n,r){var i=n.length,s=i,a=!r;if(e==null)return!s;for(e=Object(e);i--;){var o=n[i];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){o=n[i];var l=o[0],c=e[l],u=o[1];if(a&&o[2]){if(c===void 0&&!(l in e))return!1}else{var h=new $e;if(r)var d=r(c,u,l,e,t,h);if(!(d===void 0?pa(u,c,a$|o$,r,h):d))return!1}}return!0}function Dp(e){return e===e&&!ye(e)}function c$(e){for(var t=_i(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Dp(i)]}return t}function kp(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function u$(e){var t=c$(e);return t.length==1&&t[0][2]?kp(t[0][0],t[0][1]):function(n){return n===e||l$(n,e,t)}}function h$(e,t){return e!=null&&t in Object(e)}function d$(e,t,n){t=Qf(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=ca(t[r]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&Cl(i)&&Ml(a,i)&&(Gt(e)||xr(e)))}function f$(e,t){return e!=null&&d$(e,t,h$)}var p$=1,g$=2;function m$(e,t){return Ll(e)&&Dp(t)?kp(ca(e),t):function(n){var r=_t(n,e);return r===void 0&&r===t?f$(n,e):pa(t,r,p$|g$)}}function v$(e){return function(t){return t==null?void 0:t[e]}}function y$(e){return function(t){return Jf(t,e)}}function x$(e){return Ll(e)?v$(ca(e)):y$(e)}function ga(e){return typeof e=="function"?e:e==null?El:typeof e=="object"?Gt(e)?m$(e[0],e[1]):u$(e):x$(e)}function b$(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[e?o:++i];if(n(s[l],l,s)===!1)break}return t}}var w$=b$();const Rp=w$;function Gl(e,t,n){(n!==void 0&&!xi(e[t],n)||n===void 0&&!(t in e))&&ia(e,t,n)}function Fl(e){return Ue(e)&&Hn(e)}function zl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function _$(e){return bi(e,Ei(e))}function E$(e,t,n,r,i,s,a){var o=zl(e,n),l=zl(t,n),c=a.get(l);if(c){Gl(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,h=u===void 0;if(h){var d=Gt(l),f=!d&&br(l),p=!d&&!f&&aa(l);u=l,d||f||p?Gt(o)?u=o:Fl(o)?u=Pf(o):f?(h=!1,u=ap(l,!0)):p?(h=!1,u=yp(l,!0)):u=[]:YM(l)||xr(l)?(u=o,xr(o)?u=_$(o):(!ye(o)||Sl(o))&&(u=xp(l))):h=!1}h&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),Gl(e,n,u)}function Ip(e,t,n,r,i){e!==t&&Rp(t,function(s,a){if(i||(i=new $e),ye(s))E$(e,t,a,n,Ip,r,i);else{var o=r?r(zl(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),Gl(e,a,o)}},Ei)}function S$(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function O$(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var T$="[object Map]",M$="[object Set]",C$=Object.prototype,$$=C$.hasOwnProperty;function Ae(e){if(e==null)return!0;if(Hn(e)&&(Gt(e)||typeof e=="string"||typeof e.splice=="function"||br(e)||aa(e)||xr(e)))return!e.length;var t=Er(e);if(t==T$||t==M$)return!e.size;if(sa(e))return!Kf(e).length;for(var n in e)if($$.call(e,n))return!1;return!0}var A$=uT(function(e,t,n){Ip(e,t,n)});const Z=A$;var L$=1/0,D$=_r&&1/Vl(new _r([,-0]))[1]==L$?function(e){return new _r(e)}:GO;const k$=D$;var R$=200;function Np(e,t,n){var r=-1,i=rT,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=S$;else if(s>=R$){var c=t?null:k$(e);if(c)return Vl(c);a=!1,i=Tp,l=new Mi}else l=t?[]:o;t:for(;++r<s;){var u=e[r],h=t?t(u):u;if(u=n||u!==0?u:0,a&&h===h){for(var d=l.length;d--;)if(l[d]===h)continue t;t&&l.push(h),o.push(u)}else i(l,h,n)||(l!==o&&l.push(h),o.push(u))}return o}var I$=Vf(function(e){var t=O$(e);return Fl(t)&&(t=void 0),Np(ua(e,1,Fl,!0),ga(t))});const N$=I$;function P$(e){return e&&e.length?Np(e):[]}const rn=D2,Ci=P$;function U$(e,t,n){let r=null;return(...i)=>{const s=this;s.mousePosition=Sn(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function Tt(e,t){var n;const r=rn(e),i=Object.keys(t.axes||{});(n=t==null?void 0:t.toolbar)!=null&&n.controls&&delete r.toolbar.controls,i.length===0&&delete r.axes;for(const s in r.axes)if(i.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 l=a.scaleType;l==null?a.mapsTo="value":l===W.TIME?a.mapsTo="date":l===W.LABELS&&(a.mapsTo="key")}}else delete r.axes[s];return jl(r,t),Z(r,t)}function sn(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 r=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:r[0],ty:r[1]}}return null}function $i(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 Pp(e,t,n="value"){const r=e/t.reduce((i,s)=>i+s[n],0)*100;return r%1!==0?parseFloat(r.toFixed(1)):r}function Ai(e,t,n){if(n>e.length)return e;if(t===Te.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Te.FRONT_LINE)return"..."+e.substr(-n);if(t===Te.END_LINE)return e.substr(0,n)+"..."}function jl(e,t){const n=b(e,"legend","additionalItems"),r=b(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=sO.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=N$(a,r,"name")}}const b=(e,...t)=>{let n=e;if(n){for(const r of t)if(n[r]!==null&&n[r]!==void 0)n=n[r];else return null;return n}return null},Up=(e,t)=>t===Vt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,Zt=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=Up(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function an(e,t,n){return n===Vt.VERTICAL?[e,t]:[t,e]}const Sr={type:Te.END_LINE,threshold:16,numCharacter:14},B$={enabled:!0,position:fi.BOTTOM,clickable:!0,truncation:Sr,alignment:It.LEFT,order:null,additionalItems:[]},V$={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},H$={enabled:!0},Bp={enabled:!0,showTotal:!0,truncation:Sr,groupLabel:"Group"},Vp={top:{visible:!0,includeZero:!0,truncation:Sr},bottom:{visible:!0,includeZero:!0,truncation:Sr},left:{visible:!0,includeZero:!0,truncation:Sr},right:{visible:!0,includeZero:!0,truncation:Sr}},ma={addSpaceOnEdges:1,showDayName:!1,localeObject:Ef,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"}}},G$=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),Yt={width:null,height:null,resizable:!0,theme:gf.WHITE,tooltip:Bp,legend:B$,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:Mt.SHOW_AS_DATATABLE},...G$?[{type:Mt.MAKE_FULLSCREEN}]:[],{type:Mt.EXPORT_CSV},{type:Mt.EXPORT_PNG},{type:Mt.EXPORT_JPG}]}},Hp=Z({},Yt,{thematic:{projection:Qe.geoNaturalEarth1}}),Li=Z({},Yt,{axes:Vp,timeScale:ma,grid:V$,ruler:H$,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Pe.GRAPH_VIEW}}}),zn=Z({},Li,{bars:{maxWidth:16,spacingFactor:.25},timeScale:Z(ma,{addSpaceOnEdges:1})}),F$=Z({},zn,{}),z$=Z({},zn,{}),j$=Z({},zn,{bars:Z({},zn.bars,{dividerSize:1.5})}),W$=Z({},zn,{}),Wl=Z({},Li,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),q$=Wl,Gp=Z({},Wl,{points:{radius:3,filled:!1,enabled:!0}}),Fp=Z({},Gp,{timeScale:Z(ma,{addSpaceOnEdges:0})}),Y$=Fp,X$=Z({},Li,{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:Pt.RADIUS,name:"Radius"}]}}),Z$=Z({},Li,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Pt.AREA,name:"Poor area"},{type:Pt.AREA,name:"Satisfactory area"},{type:Pt.AREA,name:"Great area"},{type:Pt.QUARTILE,name:"Quartiles"}]}}),K$=Z({},zn,{bars:{dividerSize:1.5},timeScale:Z(ma,{addSpaceOnEdges:0})}),Q$=Z({},Yt,{tooltip:Z({},Bp,{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"}}),zp=Z({},Yt,{pie:{labels:{formatter:null,enabled:!0},alignment:It.LEFT,sortFunction:null,valueMapsTo:"value"}}),J$=Z({},Yt,{legend:{enabled:!1},gauge:{type:pr.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}}),tA=Z({},zp,{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}}),jp=Z({},Yt,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),eA=Z({},jp,{legend:{enabled:!0}}),nA=Z({},Yt,{radar:{axes:{angle:"key",value:"value"},alignment:It.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:e=>e??"N/A"}}),rA=Z({},zn,{comboChartTypes:[]}),iA=Z({tree:{type:yl.TREE}},Yt,{}),sA=Z({},Yt,{data:Z(Yt.data,{groupMapsTo:"name"})}),aA=Z({},Yt,yr,{data:Z(Yt.data,{groupMapsTo:"name"})}),oA=Z({},Yt,{alluvial:{data:Z(Yt.data,{groupMapsTo:"source"}),nodeAlignment:It.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),lA=Z({},Yt,{axes:Vp,heatmap:{divider:{state:gi.AUTO},colorLegend:{type:"linear"}}}),cA=Z({},Hp,{choropleth:{colorLegend:{type:"linear"}}}),xt={alluvialChart:oA,areaChart:Fp,axisChart:Li,boxplotChart:W$,bubbleChart:X$,bulletChart:Z$,chart:Yt,circlePackChart:aA,choroplethChart:cA,comboChart:rA,donutChart:tA,gaugeChart:J$,groupedBarChart:z$,heatmapChart:lA,histogramChart:K$,lineChart:Gp,lollipopChart:q$,meterChart:jp,pieChart:zp,proportionalMeterChart:eA,radarChart:nA,scatterChart:Wl,simpleBarChart:F$,stackedAreaChart:Y$,stackedBarChart:j$,thematicChart:Hp,treeChart:iA,treemapChart:sA,wordCloudChart:Q$};var Wp=(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))(Wp||{});const ql=[["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 qp(e,t,n,r,i){const s=t===0,a=Number(mr(new Date(e),"c"))===2,o=Number(mr(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||ya(e)||Di(e,l)||mn(e);case"minute":return s||ya(e)||Di(e,l)||mn(e);case"30minutes":return s||ya(e)||Di(e,l)||mn(e);case"hourly":return s||ya(e)||Di(e,l)||mn(e);case"daily":return i?s||a||mn(e):s||Di(e,l)||mn(e);case"weekly":return s||a||mn(e);case"monthly":return s||mn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function Yl(e,t,n,r,i){const s=i.showDayName,a=r==="daily"&&s?"weekly":r,o=new Date(e),l=b(i,"timeIntervalFormats")[a],c=b(l,"primary"),u=b(l,"secondary");let h=qp(e,t,n,r,s)?c:u;r==="15seconds"&&o.getMilliseconds()!==0&&(h=h.replace("pp","h:mm:ss.SSS a"));const d=i.localeObject;return mr(o,h,{locale:d})}function va(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function uA(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function hA(e){const t=ql.reduce((n,[,r],i)=>{const s=ql[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return ql[t][0]}function Xl(e,t){if(Wp[t])return t;if(e.length===1)return"15seconds";const n=uA(e),r=un(n);return hA(r)}function ya(e){const{s:t,m:n,H:r}=va(e);return r===0&&n===0&&t===0}function Di(e,t){const n=va(e).M,r=va(t).M;return n!==r}function mn(e){const{M:t,d:n,s:r,m:i,H:s}=va(e);return t===1&&n===1&&s===0&&i===0&&r===0}function Yp(e){return e===void 0?"":e.toISOString()}function Xp(e){const t=be(e,r=>r.value),n=Oe().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 Zp(e,t){const n=b(t,"gradient","colors"),r=!Ae(n);let i=b(t,"pairing","option");const s=Xp(e),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const l=a==="diverge"?17:11;for(let c=1;c<l+1;c++)o.push(`fill-${a}-${i}-${c}`)}return Ko().domain(s).range(o)}var it=(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))(it||{});function dA(e,t){return e&&Rp(e,t,_i)}function fA(e,t){return function(n,r){if(n==null)return n;if(!Hn(n))return e(n,r);for(var i=n.length,s=t?i:-1,a=Object(n);(t?s--:++s<i)&&r(a[s],s,a)!==!1;);return n}}var pA=fA(dA);const Zl=pA;function gA(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;){var a=e[i];t(r,a,n(a),e)}return r}function mA(e,t,n,r){return Zl(e,function(i,s,a){t(r,i,n(i),a)}),r}function vA(e,t){return function(n,r){var i=Gt(n)?gA:mA,s=t?t():{};return i(n,e,ga(r),s)}}function yA(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}var xA=Object.prototype,bA=xA.hasOwnProperty,wA=vA(function(e,t,n){bA.call(e,n)?e[n].push(t):ia(e,n,[t])});const _A=wA;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 r=this.getData();const i=this.getDataGroups(),{groupMapsTo:s}=b(n,"data"),a=b(n,"axes");return t&&(r=r.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===W.LINEAR||c===W.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===W.LABELS)r=r.filter(u=>a[o].domain.includes(u[l]));else{const[u,h]=a[o].domain;r=r.filter(d=>!(l in d)||d[l]>=u&&d[l]<=h)}}),r.filter(o=>i.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Ct.items.status,r=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(s=>r.find(a=>a.name===s[i]&&a.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(rn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return b(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Ct.items.status;return this.getDataGroups(t).filter(r=>r.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 _A(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),r=this.services.cartesianScales.getMainXAxisPosition(),i=this.services.cartesianScales.getDomainIdentifier(),s=n.axes[r],{groupMapsTo:a}=n.data,{bins:o=rO.defaultBins}=s,l=Array.isArray(o),c=Uv().value(f=>f[i]).thresholds(o)(t);if(l)c[c.length-1].x1=o[o.length-1];else{const f=c[0].x1-c[0].x0;c[c.length-1].x1=+c[c.length-1].x0+f}const u=l?[o[0],o[o.length-1]]:[c[0].x0,c[c.length-1].x1],h=Array.from(new Set(t.map(f=>f[a]))),d=[];return c.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:c,binsDomain:u}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getActiveDataGroupNames(),{bins:i}=this.getBinConfigurations(),s=this.getDataValuesGroupedByKeys({bins:i});return vl().keys(r)(s).map((a,o)=>Object.keys(a).filter(l=>!isNaN(l)).map(l=>{const c=a[l];return c[n]=r[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),r={},{groupMapsTo:i}=this.getOptions().data;return n.map(s=>{const a=s[i];r[a]!==null&&r[a]!==void 0?r[a].push(s):r[a]=[s]}),Object.keys(r).map(s=>({name:s,data:r[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const r=this.getOptions(),i=this.getDisplayData(n);let s;t?s=t.map(l=>`${l.x0}-${l.x1}`):s=Ci(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Yp(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const a=this.services.cartesianScales.domainAxisPosition,o=r.axes[a].scaleType;return o===W.TIME?s.sort((l,c)=>{const u=new Date(l),h=new Date(c);return u-h}):(o===W.LOG||o===W.LINEAR)&&s.sort((l,c)=>l-c),s}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:t,groups:n});return t?o.map(l=>{const[c,u]=l.split("-"),h={x0:c,x1:u},d=t.find(f=>f.x0.toString()===c.toString());return a.forEach(f=>{h[f]=d.filter(p=>p[i]===f).length}),h}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const h=s.find(f=>{const p=this.services.cartesianScales.getDomainIdentifier(f);return f[i]===u&&Object.prototype.hasOwnProperty.call(f,p)&&(f[p]instanceof Date?Yp(f[p])===l:f[p].toString()===l)}),d=this.services.cartesianScales.getRangeIdentifier(c);c[u]=h?h[d]:null}),c})}getStackedData({percentage:t=!1,groups:n=null,divergent:r=!1}){const i=this.getOptions(),{groupMapsTo:s}=i.data,a=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const l=yA(o.map(c=>[c.sharedStackKey,0]));o.forEach(c=>{a.forEach(u=>{l[c.sharedStackKey]+=c[u]})}),o.forEach(c=>{a.forEach(u=>{const h=l[c.sharedStackKey];l[c.sharedStackKey]?c[u]=c[u]/h*100:c[u]=0})})}return(r?vl().offset(zE):vl()).keys(a)(o).map((l,c)=>Object.keys(l).filter(u=>!isNaN(u)).map(u=>{const h=l[u];return h[s]=a[c],h}))}getOptions(){return this.state.options}set(t,n){this.state=Object.assign({},this.state,t);const r=Object.assign({skipUpdate:!1,animate:!0},n);r.skipUpdate||this.update(r.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const n=this.getOptions();jl(n,t),this.set({options:Z(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(O.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=Ct.items.status,i=this.getDataGroups(),s=i.some(c=>c.status===r),a=i.filter(c=>c.status===n);if(s)if(a.length===1&&a[0].name===t)i.forEach((c,u)=>{i[u].status=n});else{const c=i.findIndex(u=>u.name===t);i[c].status=i[c].status===r?n:r}else i.forEach((c,u)=>{i[u].status=c.name===t?n:r});const o=i.filter(c=>c.status===n),l=this.getOptions();i.some(c=>c.status===r)?l.data.selectedGroups=o.map(c=>c.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(O.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,n,r,i){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,r,i):i}getFillColor(t,n,r){const i=this.getOptions(),s=b(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=b(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=b(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(r=>Object.keys(t).includes(r.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let r=t.originalClassName;return t.classNameTypes.forEach(i=>r=t.originalClassName?`${r} ${i}-${n}`:`${i}-${n}`),r||""}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:r,labels:i}=t;return r.forEach(s=>{s.data.forEach((a,o)=>{let l;const c=b(s,"label");if(c===null){const h=b(i,o);h?l=h:l="Ungrouped"}else l=c;const u={group:l,key:i[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(i=>i.map(s=>`"${s==="–"?"–":s}"`));let n="",r="";t.forEach(function(i,s){r=i.join(","),n+=s<t.length?r+`
|
|
2
|
+
`:r}),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:r,DISABLED:i}=Ct.items.status,s=this.getOptions(),a=Ci(t.map(l=>l[n]));s.data.selectedGroups.length&&(s.data.selectedGroups.every(l=>a.includes(l))||(s.data.selectedGroups=[]));const o=l=>!s.data.selectedGroups.length||s.data.selectedGroups.includes(l)?r:i;return a.map(l=>({name:l,status:o(l)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=b(t,"color","scale");Object.keys(n).forEach(r=>{this.allDataGroups.includes(r)||console.warn(`"${r}" does not exist in data groups.`)}),this.allDataGroups.filter(r=>n[r]).forEach(r=>this.colorScale[r]=n[r])}setColorClassNames(){const t=b(this.getOptions(),"color","pairing");let n=b(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=b(t,"option");const i=Sf.pairingOptions,s=n>5?14:n,a=`${s}-color`;r=r<=i[a]?r:1;const o=this.allDataGroups.map((l,c)=>`${s}-${r}-${c%14+1}`);this.colorClassNames=As().range(o).domain(this.allDataGroups)}}class jn extends Be{constructor(t){super(t),this.axisFlavor=Zs.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,n=this.getOptions(),r=t.isDualAxes(),i={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return r&&(i.secondaryDomain=t.secondaryDomainAxisPosition,i.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(i).forEach(s=>{const a=i[s];t.scales[a]?i[s]={position:a,label:t.getScaleLabel(a),identifier:b(n,"axes",a,"mapsTo")}:i[s]=null}),i}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{cartesianScales:i}=this.services,{primaryDomain:s,primaryRange:a,secondaryDomain:o,secondaryRange:l}=this.assignRangeAndDomains(),c=i.getDomainAxisScaleType();let u;return c===W.TIME&&(u=h=>mr(h,"MMM d, yyyy")),[["Group",s.label,a.label,...o?[o.label]:[],...l?[l.label]:[]],...t.map(h=>[h[r],h[s.identifier]===null?"–":u?u(h[s.identifier]):h[s.identifier],h[a.identifier]===null||isNaN(h[a.identifier])?"–":h[a.identifier].toLocaleString(),...o?[h[o.identifier]===null?"–":h[o.identifier]]:[],...l?[h[l.identifier]===null||isNaN(h[l.identifier])?"–":h[l.identifier]]:[]])]}setData(t){let n;if(t&&(n=super.setData(t),b(this.getOptions(),"zoomBar",B.TOP,"enabled"))){const r=b(this.getOptions(),"zoomBar",B.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(rn(t)):this.getDisplayData();let r=n;const{cartesianScales:i}=this.services;if(n&&i.domainAxisPosition&&i.rangeAxisPosition){const s=i.getDomainIdentifier(),a=i.getRangeIdentifier();let o=n.map(l=>l[s].getTime());o=Ci(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(h=>{h[s].getTime()===l&&(c+=h[a])}),u[s]=new Date(l),u[a]=c,u})}this.set({zoomBarData:r})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(t){const n=this.getOptions();if(!n.axes)return t;const r=[];return Object.keys(B).forEach(i=>{const s=B[i],a=n.axes[s];if(a&&a.scaleType===W.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&r.push(o)}}),r.length>0&&t.forEach(i=>{r.forEach(s=>{b(i,s,"getTime")===null&&(i[s]=new Date(i[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}}let EA=class extends jn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData();return t.sort((n,r)=>n.source.localeCompare(r.source)),[["Source","Target","Value"],...t.map(n=>[n.source,n.target,n.value])]}},SA=class extends jn{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Fa(t,.25),q_50:Fa(t,.5),q_75:Fa(t,.75)}}getBoxplotData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getGroupedData(),i=[];for(const{name:s,data:a}of r){const o=this.services.cartesianScales.getRangeIdentifier(),l=a.map(x=>x[o]).sort(wn),c={[n]:s,counts:l,quartiles:this.getBoxQuartiles(l),outliers:null,whiskers:null},u=c.quartiles.q_25,h=c.quartiles.q_75,d=(h-u)*1.5,f=u-d,p=h+d,m=[],g=[];for(const x of l)x<f||x>p?m.push(x):g.push(x);c.outliers=m;const v=un(g),y=En(g);c.whiskers={min:v||un([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:y||En([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75])},i.push(c)}return i}getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBoxplotData();return[["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],...r.map(i=>{let s=b(i,"outliers");return(s===null||s.length===0)&&(s=["–"]),[i[n],b(i,"whiskers","min")!==null?b(i,"whiskers","min").toLocaleString():"–",b(i,"quartiles","q_25")!==null?b(i,"quartiles","q_25").toLocaleString():"–",b(i,"quartiles","q_50")!==null?b(i,"quartiles","q_50").toLocaleString():"–",b(i,"quartiles","q_75")!==null?b(i,"quartiles","q_75").toLocaleString():"–",b(i,"whiskers","max")!==null?b(i,"whiskers","max").toLocaleString():"–",b(i,"quartiles","q_75")!==null&&b(i,"quartiles","q_25")!==null?(b(i,"quartiles","q_75")-b(i,"quartiles","q_25")).toLocaleString():"–",s.map(a=>a.toLocaleString()).join(",")]})]}setColorClassNames(){const t=b(this.getOptions(),"color","pairing");let n=b(t,"option");const r=Sf.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=As().range(i).domain(this.allDataGroups)}},OA=class extends jn{constructor(t){super(t)}getMatchingRangeIndexForDatapoint(t){let n;for(let r=t.ranges.length-1;r>0;r--){const i=t.ranges[r];if(t.value>=i)return n=r,n}return 0}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),s=b(n,"bullet","performanceAreaTitles");return[["Title","Group","Value","Target","Percentage","Performance"],...t.map(a=>[a.title,a[r],a.value===null?"–":a.value,b(a,"marker")===null?"–":a.marker,b(a,"marker")===null?"–":`${Math.floor(a[i]/a.marker*100)}%`,s[this.getMatchingRangeIndexForDatapoint(a)]])]}},TA=class extends Be{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Ae(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Ae(n)&&!Ae(t.geoData.objects.countries)&&(t.geoData.objects.countries.geometries.forEach(r=>{this._matrix[r.properties.NAME]=r}),n.forEach(r=>{this._matrix[r.name]?this._matrix[r.name].value=r.value||null:console.warn(`Data point ${r} is missing geographical data.`)}))}return this._matrix}getTabularDataArray(){const t=this.getDisplayData();return[["Country ID","Country Name","Value"],...t.map(n=>[n.id===null?"–":n.id,n.name,n.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=b(this.getOptions(),"color");this._colorScale=Zp(this.getDisplayData(),t)}},MA=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(),r=Z({},t,this.getZoomOptions(t));jl(n,r);const i=this.getHierarchyLevel(),s=b(n,"circlePack","hierarchyLevel");this.set({options:Z(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&b(n,0,"children")?b(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),b(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:Pt.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:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent","Value"]];return t.forEach(r=>{let i=r.value?r.value:0;r.children&&(i+=this.getChildrenDatums(r.children,r.name,n,0)),n.push(["–",r.name,i])}),n}getChildrenDatums(t,n,r=[],i=0){const s=n;return t.forEach(a=>{const o=a.name;let l=0;if(a.children)a.children.length>0&&(typeof a.value=="number"&&(i+=a.value),l+=this.getChildrenDatums(a.children,o,r,l),r.push([o,s,l]),i+=l);else{let c=0;typeof a.value=="number"&&(c=a.value,i+=a.value),r.push([a.name,s,c])}}),i}},CA=class extends Be{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data;return[["Group","Value"],...t.map(i=>[i[r],i.value===null?"–":i.value.toLocaleString()])]}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}},$A=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:r}=n.data;return[["Group","Value"],...t.map(i=>[i[r],i.value===null?"–":i.value.toLocaleString()])]}},AA=class extends jn{constructor(t){super(t),this.axisFlavor=Zs.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=b(this.getOptions(),"axes");if(b(n,"left","scaleType")&&b(n,"left","scaleType")!==W.LABELS||b(n,"right","scaleType")&&b(n,"right","scaleType")!==W.LABELS||b(n,"top","scaleType")&&b(n,"top","scaleType")!==W.LABELS||b(n,"bottom","scaleType")&&b(n,"bottom","scaleType")!==W.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=be(this.getDisplayData(),r=>r.value),n=Oe().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(Ae(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(Ae(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(Ae(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=rn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(rn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ae(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains();return[[n.label,r.label,"Value"],...t.map(i=>[i[n.identifier]===null?"–":i[n.identifier],i[r.identifier]===null?"–":i[r.identifier].toLocaleString(),i.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=b(t,"color","gradient","colors"),r=!Ae(n);let i=b(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=Ko().domain(s).range(o);const l=b(this.getOptions(),"color");this._colorScale=Zp(this.getDisplayData(),l)}},LA=class extends jn{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBinnedStackedData();return[[_t(t,"bins.rangeLabel")||"Range",...r.map(i=>_t(i,`0.${n}`))],..._t(r,0).map((i,s)=>[`${_t(i,"data.x0")} – ${_t(i,"data.x1")}`,...r.map(a=>_t(a[s],`data.${_t(a[s],n)}`))])]}},DA=class extends Be{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,r)=>n+r.value,0)}getFillColor(t){const n=this.getOptions(),r=b(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=b(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=b(t,"meter","proportional")?r:r>100?100:r,s=b(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=b(n,"meter","proportional");let a=[],o;if(s===null){o=100;const l=t[0];a=[["Group","Value",...i?["Status"]:[]],[l[r],l.value,...i?[i]:[]]]}else o=b(s,"total")||this.getMaximumDomain(t),a=[["Group","Value","Percentage of total"],...t.map(c=>[c[r],c.value,(c.value/o*100).toFixed(2)+" %"])];return a}},kA=class extends jn{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=b(t,"radar","axes"),s=b(n,"0","data").map(a=>a[r]);return[["Group",...s],...n.map(a=>[a.name,...s.map((o,l)=>b(a,"data",l,i)!==null?b(a,"data",l,i).toLocaleString():"–")])]}},RA=class extends Be{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent"]];return t.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,"–"])}),n}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}},IA=class extends Be{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Group","Value"]];return t.forEach(r=>{Array.isArray(r.children)?r.children.forEach(i=>{n.push([i.name,r.name,i.value])}):b(r.name)!==null&&b(r.value)&&n.push(["–",r.name,r.value])}),n}},NA=class extends Be{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data;return[[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],...t.map(a=>[a[i],a[s],a[r]])]}};var PA=/\s/;function UA(e){for(var t=e.length;t--&&PA.test(e.charAt(t)););return t}var BA=/^\s+/;function VA(e){return e&&e.slice(0,UA(e)+1).replace(BA,"")}var Kp=0/0,HA=/^[-+]0x[0-9a-f]+$/i,GA=/^0b[01]+$/i,FA=/^0o[0-7]+$/i,zA=parseInt;function ki(e){if(typeof e=="number")return e;if(na(e))return Kp;if(ye(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ye(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=VA(e);var n=GA.test(e);return n||FA.test(e)?zA(e.slice(2),n?2:8):HA.test(e)?Kp:+e}var jA=function(){return Ce.Date.now()};const Kl=jA;var WA="Expected a function",qA=Math.max,YA=Math.min;function xa(e,t,n){var r,i,s,a,o,l,c=0,u=!1,h=!1,d=!0;if(typeof e!="function")throw new TypeError(WA);t=ki(t)||0,ye(n)&&(u=!!n.leading,h="maxWait"in n,s=h?qA(ki(n.maxWait)||0,t):s,d="trailing"in n?!!n.trailing:d);function f(E){var T=r,k=i;return r=i=void 0,c=E,a=e.apply(k,T),a}function p(E){return c=E,o=setTimeout(v,t),u?f(E):a}function m(E){var T=E-l,k=E-c,I=t-T;return h?YA(I,s-k):I}function g(E){var T=E-l,k=E-c;return l===void 0||T>=t||T<0||h&&k>=s}function v(){var E=Kl();if(g(E))return y(E);o=setTimeout(v,m(E))}function y(E){return o=void 0,d&&r?f(E):(r=i=void 0,a)}function x(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function S(){return o===void 0?a:y(Kl())}function _(){var E=Kl(),T=g(E);if(r=arguments,i=this,l=E,T){if(o===void 0)return p(l);if(h)return clearTimeout(o),o=setTimeout(v,t),f(l)}return o===void 0&&(o=setTimeout(v,t)),a}return _.cancel=x,_.flush=S,_}function XA(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const ZA=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function on(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function ba(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function KA(e){const t=ba(e,"border-left-width"),n=ba(e,"border-right-width");return e.clientWidth+t+n}function QA(e){const t=ba(e,"border-top-width"),n=ba(e,"border-bottom-width");return e.clientHeight+t+n}function Qp(e,t={}){const n=t.width||KA(e),r=t.height||QA(e);return{width:n,height:r}}function JA(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const ue=16384;function tL(e){(e.width>ue||e.height>ue)&&(e.width>ue&&e.height>ue?e.width>e.height?(e.height*=ue/e.width,e.width=ue):(e.width*=ue/e.height,e.height=ue):e.width>ue?(e.height*=ue/e.width,e.width=ue):(e.width*=ue/e.height,e.height=ue))}function wa(e){return new Promise((t,n)=>{const r=new Image;r.decode=()=>t(r),r.onload=()=>t(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function eL(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function nL(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),s=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),i.appendChild(s),s.appendChild(e),eL(i)}const re=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||re(n,t)};function rL(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function iL(e){return on(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function sL(e,t,n){const r=`.${e}:${t}`,i=n.cssText?rL(n):iL(n);return document.createTextNode(`${r}{${i}}`)}function Jp(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=ZA();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(sL(s,n,r)),t.appendChild(a)}function aL(e,t){Jp(e,t,":before"),Jp(e,t,":after")}const tg="application/font-woff",eg="image/jpeg",oL={woff:tg,woff2:tg,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:eg,jpeg:eg,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function lL(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Ql(e){const t=lL(e).toLowerCase();return oL[t]||""}function cL(e){return e.split(/,/)[1]}function Jl(e){return e.search(/^(data:)/)!==-1}function ng(e,t){return`data:${t};base64,${e}`}async function rg(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((s,a)=>{const o=new FileReader;o.onerror=a,o.onloadend=()=>{try{s(n({res:r,result:o.result}))}catch(l){a(l)}},o.readAsDataURL(i)})}const tc={};function uL(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function ec(e,t,n){const r=uL(e,t,n.includeQueryParams);if(tc[r]!=null)return tc[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await rg(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),cL(o)));i=ng(s,t)}catch(s){i=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return tc[r]=i,i}async function hL(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):wa(t)}async function dL(e,t){if(e.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,a==null||a.drawImage(e,0,0,s.width,s.height);const o=s.toDataURL();return wa(o)}const n=e.poster,r=Ql(n),i=await ec(n,r,t);return wa(i)}async function fL(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await _a(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function pL(e,t){return re(e,HTMLCanvasElement)?hL(e):re(e,HTMLVideoElement)?dL(e,t):re(e,HTMLIFrameElement)?fL(e):e.cloneNode(!1)}const gL=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function mL(e,t,n){var r,i;let s=[];return gL(e)&&e.assignedNodes?s=on(e.assignedNodes()):re(e,HTMLIFrameElement)&&!((r=e.contentDocument)===null||r===void 0)&&r.body?s=on(e.contentDocument.body.childNodes):s=on(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||re(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>_a(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function vL(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):on(r).forEach(i=>{let s=r.getPropertyValue(i);i==="font-size"&&s.endsWith("px")&&(s=`${Math.floor(parseFloat(s.substring(0,s.length-2)))-.1}px`),re(e,HTMLIFrameElement)&&i==="display"&&s==="inline"&&(s="block"),i==="d"&&t.getAttribute("d")&&(s=`path(${t.getAttribute("d")})`),n.setProperty(i,s,r.getPropertyPriority(i))})}function yL(e,t){re(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),re(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function xL(e,t){if(re(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function bL(e,t){return re(t,Element)&&(vL(e,t),aL(e,t),yL(e,t),xL(e,t)),t}async function wL(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let s=0;s<n.length;s++){const a=n[s].getAttribute("xlink:href");if(a){const o=e.querySelector(a),l=document.querySelector(a);!o&&l&&!r[a]&&(r[a]=await _a(l,t,!0))}}const i=Object.values(r);if(i.length){const s="http://www.w3.org/1999/xhtml",a=document.createElementNS(s,"svg");a.setAttribute("xmlns",s),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";const o=document.createElementNS(s,"defs");a.appendChild(o);for(let l=0;l<i.length;l++)o.appendChild(i[l]);e.appendChild(a)}return e}async function _a(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>pL(r,t)).then(r=>mL(e,r,t)).then(r=>bL(e,r)).then(r=>wL(r,t))}const ig=/url\((['"]?)([^'"]+?)\1\)/g,_L=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,EL=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function SL(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function OL(e){const t=[];return e.replace(ig,(n,r,i)=>(t.push(i),n)),t.filter(n=>!Jl(n))}async function TL(e,t,n,r,i){try{const s=n?XA(t,n):t,a=Ql(t);let o;if(i){const l=await i(s);o=ng(l,a)}else o=await ec(s,a,r);return e.replace(SL(t),`$1${o}$3`)}catch{}return e}function ML(e,{preferredFontFormat:t}){return t?e.replace(EL,n=>{for(;;){const[r,,i]=_L.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function sg(e){return e.search(ig)!==-1}async function ag(e,t,n){if(!sg(e))return e;const r=ML(e,n);return OL(r).reduce((i,s)=>i.then(a=>TL(a,s,t,n)),Promise.resolve(r))}async function Ea(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await ag(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function CL(e,t){await Ea("background",e,t)||await Ea("background-image",e,t),await Ea("mask",e,t)||await Ea("mask-image",e,t)}async function $L(e,t){const n=re(e,HTMLImageElement);if(!(n&&!Jl(e.src))&&!(re(e,SVGImageElement)&&!Jl(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await ec(r,Ql(r),t);await new Promise((s,a)=>{e.onload=s,e.onerror=a;const o=e;o.decode&&(o.decode=s),o.loading==="lazy"&&(o.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function AL(e,t){const n=on(e.childNodes).map(r=>og(r,t));await Promise.all(n).then(()=>e)}async function og(e,t){re(e,Element)&&(await CL(e,t),await $L(e,t),await AL(e,t))}function LL(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const lg={};async function cg(e){let t=lg[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},lg[e]=t,t}async function ug(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async s=>{let a=s.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),rg(a,t.fetchRequestInit,({result:o})=>(n=n.replace(s,`url(${o})`),[s,o]))});return Promise.all(i).then(()=>n)}function hg(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;t.push(l[0])}r=r.replace(i,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(a,"gi");for(;;){let l=s.exec(r);if(l===null){if(l=o.exec(r),l===null)break;s.lastIndex=o.lastIndex}else o.lastIndex=s.lastIndex;t.push(l[0])}return t}async function DL(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{on(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=cg(l).then(u=>ug(u,t)).then(u=>hg(u).forEach(h=>{try{i.insertRule(h,h.startsWith("@import")?o+=1:i.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:h,error:d})}})).catch(u=>{console.error("Error loading remote css",u.toString())});r.push(c)}})}catch(s){const a=e.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&r.push(cg(i.href).then(o=>ug(o,t)).then(o=>hg(o).forEach(l=>{a.insertRule(l,i.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",s)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{on(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function kL(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>sg(t.style.getPropertyValue("src")))}async function RL(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=on(e.ownerDocument.styleSheets),r=await DL(n,t);return kL(r)}async function IL(e,t){const n=await RL(e,t);return(await Promise.all(n.map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return ag(r.cssText,i,t)}))).join(`
|
|
3
|
+
`)}async function NL(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await IL(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function PL(e,t={}){const{width:n,height:r}=Qp(e,t),i=await _a(e,t,!0);return await NL(i,t),await og(i,t),LL(i,t),await nL(i,n,r)}async function dg(e,t={}){const{width:n,height:r}=Qp(e,t),i=await PL(e,t),s=await wa(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||JA(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||tL(a),a.style.width=`${c}`,a.style.height=`${u}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(s,0,0,a.width,a.height),a}async function UL(e,t={}){return(await dg(e,t)).toDataURL()}async function BL(e,t={}){return(await dg(e,t)).toDataURL("image/jpeg",t.quality||1)}class ln{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const VL="DONT_STYLE_ME_css_styles_verifier";class L extends ln{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=D(t));const r={width:0,height:0},i=d=>{d&&Object.keys(r).forEach(f=>{if(d[f]){const p=d[f],m=parseFloat(p);p&&m>r[f]&&(""+p).indexOf("%")===-1&&(r[f]=m)}})},s={width:t.attr("width"),height:t.attr("height")},a=t.node();let o,l,c,u;try{typeof a.getBBox=="function"&&(o=a.getBBox(),l={width:o.width,height:o.height})}catch(d){console.error(d)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(d){console.error(d)}let h;if(a instanceof SVGSVGElement&&(h={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(i(s),r.width>0&&r.height>0))return r;if(n.useClientDimensions&&(i(h),r.width>0&&r.height>0))return h;if(n.useBBox&&(i(l),r.width>0&&r.height>0))return l;if(n.useBoundingRect&&(i(u),r.width>0&&r.height>0))return u}try{const d={width:b(t.node(),"width","baseVal","value"),height:b(t.node(),"height","baseVal","value")};i(d)}catch{i(h),i(l),i(s)}return r}static appendOrSelect(t,n){const r=t.select(`${n}`);if(r.empty()){let i=n.split("#"),s,a;return i.length===2?(s=i[0],i=i[1].split("."),a=i[0]):(i=n.split("."),s=i[0]),t.append(s).attr("id",a).attr("class",i.slice(1).join(" "))}return r}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=b(t,"style","prefix"),r=D(this.getHolder()).append("div").classed(`${ne}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",VL),this.mainContainer=r.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:n,height:r,theme:i}=this.model.getOptions();n!==this.width&&(t.style.width=n,this.width=n),r!==this.height&&(t.style.height=r,this.height=r),D(this.getHolder()).classed(`${ne}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.getHolder(),r=D(n);r.classed("filled",!0),BL(this.getMainContainer(),{quality:1,filter:i=>!(i.classList&&i.classList.contains("cds--cc--toolbar"))}).then(function(i){var s;(s=t.services.files)==null||s.downloadImage(i,"myChart.jpg"),r.classed("filled",!1)})}exportToPNG(){const t=this,n=this.getHolder(),r=D(n);r.classed("filled",!0),UL(this.getMainContainer(),{quality:1,filter:i=>!(i.classList&&i.classList.contains("cds--cc--toolbar"))}).then(function(i){var s;(s=t.services.files)==null||s.downloadImage(i,"myChart.png"),r.classed("filled",!1)}).catch(function(i){console.error("oops, something went wrong!",i)})}toggleFullscreen(){const t=this.getHolder();D(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=D(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=L.getSVGElementSize(D(this.mainContainer),{useBBox:!0}),n=D(this.mainContainer).attr("class"),r=D(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(L.getSVGElementSize(D(s),{useBBox:!0}).height)}),i<=t?D(this.mainContainer).attr("height",i):D(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&D(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(O.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(O.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=xa(()=>{var s;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,(s=this.services.events)==null||s.dispatchEvent(O.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}}let nc=class vv extends ln{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",r=>r.offset).style("stop-color",r=>r.color).style("stop-opacity",r=>r.opacity)}static getOffsetRatio(t){return(Math.abs(t[1])*100/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(t,n){const r=t[0]<0&&t[1]>0;let i=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return r&&(i=[{offset:"0%",color:n,opacity:"0.6"},{offset:vv.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function fg(e){const t=HL(pg(e),360);return vn(t,[0,10])||vn(t,[350,0])?{textAnchor:Ze.START,dominantBaseline:Ke.MIDDLE}:vn(t,[10,80])?{textAnchor:Ze.START,dominantBaseline:Ke.HANGING}:vn(t,[80,100])?{textAnchor:Ze.MIDDLE,dominantBaseline:Ke.HANGING}:vn(t,[100,170])?{textAnchor:Ze.END,dominantBaseline:Ke.HANGING}:vn(t,[170,190])?{textAnchor:Ze.END,dominantBaseline:Ke.MIDDLE}:vn(t,[190,260])?{textAnchor:Ze.END,dominantBaseline:Ke.BASELINE}:vn(t,[260,280])?{textAnchor:Ze.MIDDLE,dominantBaseline:Ke.BASELINE}:{textAnchor:Ze.START,dominantBaseline:Ke.BASELINE}}function HL(e,t){return(e%t+t)%t}function vn(e,[t,n]){return e>=t&&e<=n}function pg(e){return e*(180/Math.PI)}function At(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function GL(e,t){return t*Math.sin(e-Math.PI/2)}function gg(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function FL(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function rc(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function zL(e){return e.depth}function jL(e,t){return t-1-e.height}function mg(e,t){return e.sourceLinks.length?e.depth:t-1}function Sa(e){return function(){return e}}function vg(e,t){return Oa(e.source,t.source)||e.index-t.index}function yg(e,t){return Oa(e.target,t.target)||e.index-t.index}function Oa(e,t){return e.y0-t.y0}function ic(e){return e.value}function WL(e){return e.index}function qL(e){return e.nodes}function YL(e){return e.links}function xg(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function bg({nodes:e}){for(const t of e){let n=t.y0,r=n;for(const i of t.sourceLinks)i.y0=n+i.width/2,n+=i.width;for(const i of t.targetLinks)i.y1=r+i.width/2,r+=i.width}}function XL(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=WL,l=mg,c,u,h=qL,d=YL,f=6;function p(){const w={nodes:h.apply(null,arguments),links:d.apply(null,arguments)};return m(w),g(w),v(w),y(w),_(w),bg(w),w}p.update=function(w){return bg(w),w},p.nodeId=function(w){return arguments.length?(o=typeof w=="function"?w:Sa(w),p):o},p.nodeAlign=function(w){return arguments.length?(l=typeof w=="function"?w:Sa(w),p):l},p.nodeSort=function(w){return arguments.length?(c=w,p):c},p.nodeWidth=function(w){return arguments.length?(i=+w,p):i},p.nodePadding=function(w){return arguments.length?(s=a=+w,p):s},p.nodes=function(w){return arguments.length?(h=typeof w=="function"?w:Sa(w),p):h},p.links=function(w){return arguments.length?(d=typeof w=="function"?w:Sa(w),p):d},p.linkSort=function(w){return arguments.length?(u=w,p):u},p.size=function(w){return arguments.length?(e=t=0,n=+w[0],r=+w[1],p):[n-e,r-t]},p.extent=function(w){return arguments.length?(e=+w[0][0],n=+w[1][0],t=+w[0][1],r=+w[1][1],p):[[e,t],[n,r]]},p.iterations=function(w){return arguments.length?(f=+w,p):f};function m({nodes:w,links:N}){for(const[R,U]of w.entries())U.index=R,U.sourceLinks=[],U.targetLinks=[];const P=new Map(w.map((R,U)=>[o(R,U,w),R]));for(const[R,U]of N.entries()){U.index=R;let{source:F,target:j}=U;typeof F!="object"&&(F=U.source=xg(P,F)),typeof j!="object"&&(j=U.target=xg(P,j)),F.sourceLinks.push(U),j.targetLinks.push(U)}if(u!=null)for(const{sourceLinks:R,targetLinks:U}of w)R.sort(u),U.sort(u)}function g({nodes:w}){for(const N of w)N.value=N.fixedValue===void 0?Math.max(rc(N.sourceLinks,ic),rc(N.targetLinks,ic)):N.fixedValue}function v({nodes:w}){const N=w.length;let P=new Set(w),R=new Set,U=0;for(;P.size;){for(const F of P){F.depth=U;for(const{target:j}of F.sourceLinks)R.add(j)}if(++U>N)throw new Error("circular link");P=R,R=new Set}}function y({nodes:w}){const N=w.length;let P=new Set(w),R=new Set,U=0;for(;P.size;){for(const F of P){F.height=U;for(const{source:j}of F.targetLinks)R.add(j)}if(++U>N)throw new Error("circular link");P=R,R=new Set}}function x({nodes:w}){const N=gg(w,U=>U.depth)+1,P=(n-e-i)/(N-1),R=new Array(N);for(const U of w){const F=Math.max(0,Math.min(N-1,Math.floor(l.call(null,U,N))));U.layer=F,U.x0=e+F*P,U.x1=U.x0+i,R[F]?R[F].push(U):R[F]=[U]}if(c)for(const U of R)U.sort(c);return R}function S(w){const N=FL(w,P=>(r-t-(P.length-1)*a)/rc(P,ic));for(const P of w){let R=t;for(const U of P){U.y0=R,U.y1=R+U.value*N,R=U.y1+a;for(const F of U.sourceLinks)F.width=F.value*N}R=(r-R+a)/(P.length+1);for(let U=0;U<P.length;++U){const F=P[U];F.y0+=R*(U+1),F.y1+=R*(U+1)}V(P)}}function _(w){const N=x(w);a=Math.min(s,(r-t)/(gg(N,P=>P.length)-1)),S(N);for(let P=0;P<f;++P){const R=Math.pow(.99,P),U=Math.max(1-R,(P+1)/f);T(N,R,U),E(N,R,U)}}function E(w,N,P){for(let R=1,U=w.length;R<U;++R){const F=w[R];for(const j of F){let K=0,ut=0;for(const{source:Y,value:ct}of j.targetLinks){let et=ct*(j.layer-Y.layer);K+=C(Y,j)*et,ut+=et}if(!(ut>0))continue;let G=(K/ut-j.y0)*N;j.y0+=G,j.y1+=G,M(j)}c===void 0&&F.sort(Oa),k(F,P)}}function T(w,N,P){for(let R=w.length,U=R-2;U>=0;--U){const F=w[U];for(const j of F){let K=0,ut=0;for(const{target:Y,value:ct}of j.sourceLinks){let et=ct*(Y.layer-j.layer);K+=A(j,Y)*et,ut+=et}if(!(ut>0))continue;let G=(K/ut-j.y0)*N;j.y0+=G,j.y1+=G,M(j)}c===void 0&&F.sort(Oa),k(F,P)}}function k(w,N){const P=w.length>>1,R=w[P];$(w,R.y0-a,P-1,N),I(w,R.y1+a,P+1,N),$(w,r,w.length-1,N),I(w,t,0,N)}function I(w,N,P,R){for(;P<w.length;++P){const U=w[P],F=(N-U.y0)*R;F>1e-6&&(U.y0+=F,U.y1+=F),N=U.y1+a}}function $(w,N,P,R){for(;P>=0;--P){const U=w[P],F=(U.y1-N)*R;F>1e-6&&(U.y0-=F,U.y1-=F),N=U.y0-a}}function M({sourceLinks:w,targetLinks:N}){if(u===void 0){for(const{source:{sourceLinks:P}}of N)P.sort(yg);for(const{target:{targetLinks:P}}of w)P.sort(vg)}}function V(w){if(u===void 0)for(const{sourceLinks:N,targetLinks:P}of w)N.sort(yg),P.sort(vg)}function C(w,N){let P=w.y0-(w.sourceLinks.length-1)*a/2;for(const{target:R,width:U}of w.sourceLinks){if(R===N)break;P+=U+a}for(const{source:R,width:U}of N.targetLinks){if(R===w)break;P-=U}return P}function A(w,N){let P=N.y0-(N.targetLinks.length-1)*a/2;for(const{source:R,width:U}of N.targetLinks){if(R===w)break;P+=U+a}for(const{target:R,width:U}of w.sourceLinks){if(R===N)break;P-=U}return P}return p}var sc=Math.PI,ac=2*sc,Wn=1e-6,ZL=ac-Wn;function oc(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function wg(){return new oc}oc.prototype=wg.prototype={constructor:oc,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,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+s)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var s=this._x1,a=this._y1,o=n-e,l=r-t,c=s-e,u=a-t,h=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>Wn)if(!(Math.abs(u*o-l*c)>Wn)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var d=n-s,f=r-a,p=o*o+l*l,m=d*d+f*f,g=Math.sqrt(p),v=Math.sqrt(h),y=i*Math.tan((sc-Math.acos((p+h-m)/(2*g*v)))/2),x=y/v,S=y/g;Math.abs(x-1)>Wn&&(this._+="L"+(e+x*c)+","+(t+x*u)),this._+="A"+i+","+i+",0,0,"+ +(u*d>c*f)+","+(this._x1=e+S*o)+","+(this._y1=t+S*l)}},arc:function(e,t,n,r,i,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(r),o=n*Math.sin(r),l=e+a,c=t+o,u=1^s,h=s?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+c:(Math.abs(this._x1-l)>Wn||Math.abs(this._y1-c)>Wn)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%ac+ac),h>ZL?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>Wn&&(this._+="A"+n+","+n+",0,"+ +(h>=sc)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function _g(e){return function(){return e}}function KL(e){return e[0]}function QL(e){return e[1]}var JL=Array.prototype.slice;function tD(e){return e.source}function eD(e){return e.target}function nD(e){var t=tD,n=eD,r=KL,i=QL,s=null;function a(){var o,l=JL.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=wg()),e(s,+r.apply(this,(l[0]=c,l)),+i.apply(this,l),+r.apply(this,(l[0]=u,l)),+i.apply(this,l)),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?(r=typeof o=="function"?o:_g(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:_g(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function rD(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function iD(){return nD(rD)}function sD(e){return[e.source.x1,e.y0]}function aD(e){return[e.target.x0,e.y1]}function oD(){return iD().source(sD).target(aD)}function lD(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function cD(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var i=[null];i.push.apply(i,arguments);var s=Function.bind.apply(t,i);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(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var uD={value:function(){}};function Eg(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ta(n)}function Ta(e){this._=e}function hD(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ta.prototype=Eg.prototype={constructor:Ta,on:function(e,t){var n=this._,r=hD(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=dD(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Sg(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Sg(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ta(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function dD(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Sg(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=uD,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var fD=cD(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Eg},Symbol.toStringTag,{value:"Module"}))).dispatch,lc=Math.PI/180,Ri=64,Ma=2048,pD=function(){var e=[256,256],t=gD,n=mD,r=vD,i=Og,s=Og,a=yD,o=xD,l=Tg,c=[],u=1/0,h=fD("word","end"),d=null,f=Math.random,p={},m=TD;p.canvas=function(y){return arguments.length?(m=yn(y),p):m},p.start=function(){var y=g(m()),x=OD((e[0]>>5)*e[1]),S=null,_=c.length,E=-1,T=[],k=c.map(function($,M){return $.text=t.call(this,$,M),$.font=n.call(this,$,M),$.style=i.call(this,$,M),$.weight=s.call(this,$,M),$.rotate=a.call(this,$,M),$.size=~~r.call(this,$,M),$.padding=o.call(this,$,M),$}).sort(function($,M){return M.size-$.size});return d&&clearInterval(d),d=setInterval(I,0),I(),p;function I(){for(var $=Date.now();Date.now()-$<u&&++E<_&&d;){var M=k[E];M.x=e[0]*(f()+.5)>>1,M.y=e[1]*(f()+.5)>>1,bD(y,M,k,E),M.hasText&&v(x,M,S)&&(T.push(M),h.call("word",p,M),S?_D(S,M):S=[{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)}E>=_&&(p.stop(),h.call("end",p,T,S))}},p.stop=function(){return d&&(clearInterval(d),d=null),p};function g(y){y.width=y.height=1;var x=Math.sqrt(y.getContext("2d").getImageData(0,0,1,1).data.length>>2);y.width=(Ri<<5)/x,y.height=Ma/x;var S=y.getContext("2d");return S.fillStyle=S.strokeStyle="red",S.textAlign="center",{context:S,ratio:x}}function v(y,x,S){e[0],e[1];for(var _=x.x,E=x.y,T=Math.sqrt(e[0]*e[0]+e[1]*e[1]),k=l(e),I=f()<.5?1:-1,$=-I,M,V,C;(M=k($+=I))&&(V=~~M[0],C=~~M[1],!(Math.min(Math.abs(V),Math.abs(C))>=T));)if(x.x=_+V,x.y=E+C,!(x.x+x.x0<0||x.y+x.y0<0||x.x+x.x1>e[0]||x.y+x.y1>e[1])&&(!S||!wD(x,y,e[0]))&&(!S||ED(x,S))){for(var A=x.sprite,w=x.width>>5,N=e[0]>>5,P=x.x-(w<<4),R=P&127,U=32-R,F=x.y1-x.y0,j=(x.y+x.y0)*N+(P>>5),K,ut=0;ut<F;ut++){K=0;for(var G=0;G<=w;G++)y[j+G]|=K<<U|(G<w?(K=A[ut*w+G])>>>R:0);j+=N}return delete x.sprite,!0}return!1}return p.timeInterval=function(y){return arguments.length?(u=y??1/0,p):u},p.words=function(y){return arguments.length?(c=y,p):c},p.size=function(y){return arguments.length?(e=[+y[0],+y[1]],p):e},p.font=function(y){return arguments.length?(n=yn(y),p):n},p.fontStyle=function(y){return arguments.length?(i=yn(y),p):i},p.fontWeight=function(y){return arguments.length?(s=yn(y),p):s},p.rotate=function(y){return arguments.length?(a=yn(y),p):a},p.text=function(y){return arguments.length?(t=yn(y),p):t},p.spiral=function(y){return arguments.length?(l=MD[y]||y,p):l},p.fontSize=function(y){return arguments.length?(r=yn(y),p):r},p.padding=function(y){return arguments.length?(o=yn(y),p):o},p.random=function(y){return arguments.length?(f=y,p):f},p.on=function(){var y=h.on.apply(h,arguments);return y===h?p:y},p};function gD(e){return e.text}function mD(){return"serif"}function Og(){return"normal"}function vD(e){return Math.sqrt(e.value)}function yD(){return(~~(Math.random()*6)-3)*30}function xD(){return 1}function bD(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(Ri<<5)/s,Ma/s);var a=0,o=0,l=0,c=n.length;for(--r;++r<c;){t=n[r],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font;var u=i.measureText(t.text+"m").width*s,h=t.size<<1;if(t.rotate){var d=Math.sin(t.rotate*lc),f=Math.cos(t.rotate*lc),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>l&&(l=h),a+u>=Ri<<5&&(a=0,o+=l,l=0),o+h>=Ma)break;i.translate((a+(u>>1))/s,(o+(h>>1))/s),t.rotate&&i.rotate(t.rotate*lc),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.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 y=i.getImageData(0,0,(Ri<<5)/s,Ma/s).data,x=[];--r>=0;)if(t=n[r],!!t.hasText){for(var u=t.width,S=u>>5,h=t.y1-t.y0,_=0;_<h*S;_++)x[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var E=0,T=-1,k=0;k<h;k++){for(var _=0;_<u;_++){var I=S*k+(_>>5),$=y[(o+k)*(Ri<<5)+(a+_)<<2]?1<<31-_%32:0;x[I]|=$,E|=$}E?T=k:(t.y0++,h--,k--,o++)}t.y1=t.y0+T,t.sprite=x.slice(0,(t.y1-t.y0)*S)}}}function wD(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,s=e.x-(i<<4),a=s&127,o=32-a,l=e.y1-e.y0,c=(e.y+e.y0)*n+(s>>5),u,h=0;h<l;h++){u=0;for(var d=0;d<=i;d++)if((u<<o|(d<i?(u=r[h*i+d])>>>a:0))&t[c+d])return!0;c+=n}return!1}function _D(e,t){var n=e[0],r=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>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function ED(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 Tg(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function SD(e){var t=4,n=t*e[0]/e[1],r=0,i=0;return function(s){var a=s<0?-1:1;switch(Math.sqrt(1+4*a*s)-a&3){case 0:r+=n;break;case 1:i+=t;break;case 2:r-=n;break;default:i-=t;break}return[r,i]}}function OD(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function TD(){return document.createElement("canvas")}function yn(e){return typeof e=="function"?e:function(){return e}}var MD={archimedean:Tg,rectangular:SD};const CD=lD(pD);function $D(e,t,n,r){var i=-1,s=e==null?0:e.length;for(r&&s&&(n=e[++i]);++i<s;)n=t(n,e[i],i,e);return n}function AD(e){return function(t){return e==null?void 0:e[t]}}var LD={À:"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"},DD=AD(LD);const kD=DD;var RD=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ID="\\u0300-\\u036f",ND="\\ufe20-\\ufe2f",PD="\\u20d0-\\u20ff",UD=ID+ND+PD,BD="["+UD+"]",VD=RegExp(BD,"g");function HD(e){return e=Ti(e),e&&e.replace(RD,kD).replace(VD,"")}var GD=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function FD(e){return e.match(GD)||[]}var zD=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function jD(e){return zD.test(e)}var Mg="\\ud800-\\udfff",WD="\\u0300-\\u036f",qD="\\ufe20-\\ufe2f",YD="\\u20d0-\\u20ff",XD=WD+qD+YD,Cg="\\u2700-\\u27bf",$g="a-z\\xdf-\\xf6\\xf8-\\xff",ZD="\\xac\\xb1\\xd7\\xf7",KD="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",QD="\\u2000-\\u206f",JD=" \\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",Ag="A-Z\\xc0-\\xd6\\xd8-\\xde",tk="\\ufe0e\\ufe0f",Lg=ZD+KD+QD+JD,Dg="['’]",kg="["+Lg+"]",ek="["+XD+"]",Rg="\\d+",nk="["+Cg+"]",Ig="["+$g+"]",Ng="[^"+Mg+Lg+Rg+Cg+$g+Ag+"]",rk="\\ud83c[\\udffb-\\udfff]",ik="(?:"+ek+"|"+rk+")",sk="[^"+Mg+"]",Pg="(?:\\ud83c[\\udde6-\\uddff]){2}",Ug="[\\ud800-\\udbff][\\udc00-\\udfff]",Or="["+Ag+"]",ak="\\u200d",Bg="(?:"+Ig+"|"+Ng+")",ok="(?:"+Or+"|"+Ng+")",Vg="(?:"+Dg+"(?:d|ll|m|re|s|t|ve))?",Hg="(?:"+Dg+"(?:D|LL|M|RE|S|T|VE))?",Gg=ik+"?",Fg="["+tk+"]?",lk="(?:"+ak+"(?:"+[sk,Pg,Ug].join("|")+")"+Fg+Gg+")*",ck="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",uk="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",hk=Fg+Gg+lk,dk="(?:"+[nk,Pg,Ug].join("|")+")"+hk,fk=RegExp([Or+"?"+Ig+"+"+Vg+"(?="+[kg,Or,"$"].join("|")+")",ok+"+"+Hg+"(?="+[kg,Or+Bg,"$"].join("|")+")",Or+"?"+Bg+"+"+Vg,Or+"+"+Hg,uk,ck,Rg,dk].join("|"),"g");function pk(e){return e.match(fk)||[]}function gk(e,t,n){return e=Ti(e),t=n?void 0:t,t===void 0?jD(e)?pk(e):FD(e):e.match(t)||[]}var mk="['’]",vk=RegExp(mk,"g");function zg(e){return function(t){return $D(gk(HD(t).replace(vk,"")),e,"")}}function yk(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function jg(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=ki(n),n=n===n?n:0),t!==void 0&&(t=ki(t),t=t===t?t:0),yk(ki(e),t,n)}function xk(e,t){var n=-1,r=Hn(e)?Array(e.length):[];return Zl(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function bk(e,t){var n=Gt(e)?Lf:xk;return n(e,ga(t))}var wk=1/0;function _k(e,t){return ua(bk(e,t),wk)}function Wg(e,t){return pa(e,t)}var Ek=zg(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Tr=Ek;function Sk(e,t){var n;return Zl(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function Ok(e,t,n){var r=Gt(e)?Op:Sk;return n&&Hf(e,t,n)&&(t=void 0),r(e,ga(t))}class lt{constructor(t,n,r){if(this.type="",this.renderType=q.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=b(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(D(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 r=this.parent;if(this.parent=t,!(r&&r.node()===t.node())&&this.type){const i=b(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${ne}--${i}--${this.type}`,!0),r&&r.classed(`${ne}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={withinChartClip:!1}){if(this.type){const n=b(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=L.appendOrSelect(this.parent,`${this.renderType===q.SVG?"svg":"div"}${r}.${ne}--${n}--${this.type}`);if(t.withinChartClip){const s=this.model.get("chartClipId");if(s){const a=D(`#${s}`).select("rect");a.size()!==0&&parseFloat(a.attr("height"))>0&&i.attr("clip-path",`url(#${s})`)}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?Z({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const qg=class yv extends lt{constructor(){super(...arguments),this.type="toolbar",this.renderType=q.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(O.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(O.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(b(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:r,overflowMenuItemList:i}=this.getControlConfigs();i&&r.push(this.getOverflowButtonConfig());const s=n.selectAll("div.toolbar-control").data(r,l=>l.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",l=>l.shouldBeDisabled()).attr("aria-disabled",l=>l.shouldBeDisabled()).attr("aria-label",l=>l.title).html(l=>`
|
|
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-${l.id}`)}" aria-label="${l.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
|
${l.iconSVG.content}
|
|
9
9
|
</svg>
|
|
10
|
-
</button>`).each(function(l,c){D(this).select("svg").style("will-change","transform").style("width",l.iconSVG.width!==void 0?l.iconSVG.width:"20px").style("height",l.iconSVG.height!==void 0?l.iconSVG.height:"20px"),D(this).select("button").on("click",u=>{l.shouldBeDisabled()||o.triggerFunctionAndEvent(l,u,this)}).on("keydown",u=>{u.key&&u.key==="Enter"||u.key===" "?(u.preventDefault(),o.triggerFunctionAndEvent(l,u,this)):u.key&&u.key==="ArrowLeft"?o.focusOnPreviousEnabledToolbarItem(c):u.key&&u.key==="ArrowRight"&&o.focusOnNextEnabledToolbarItem(c)})}),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,
|
|
10
|
+
</button>`).each(function(l,c){D(this).select("svg").style("will-change","transform").style("width",l.iconSVG.width!==void 0?l.iconSVG.width:"20px").style("height",l.iconSVG.height!==void 0?l.iconSVG.height:"20px"),D(this).select("button").on("click",u=>{l.shouldBeDisabled()||o.triggerFunctionAndEvent(l,u,this)}).on("keydown",u=>{u.key&&u.key==="Enter"||u.key===" "?(u.preventDefault(),o.triggerFunctionAndEvent(l,u,this)):u.key&&u.key==="ArrowLeft"?o.focusOnPreviousEnabledToolbarItem(c):u.key&&u.key==="ArrowRight"&&o.focusOnNextEnabledToolbarItem(c)})}),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,i=>b(i,"id"));n.exit().remove();const r=n.enter().append("li").attr("id",i=>this.services.domUtils.generateElementIDString(`control-${i.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);r.append("button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),r.merge(n).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).attr("aria-disabled",i=>i.shouldBeDisabled()).selectAll("button").text(i=>i.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),D(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(O.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(O.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=D(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=D(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=D(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=D(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((r,i)=>{const s=D(`#${this.services.domUtils.generateElementIDString(`control-${r.id}`)}`);s!==null&&(s.on("click",()=>{n.triggerFunctionAndEvent(r,t,s.node()),n.updateOverflowMenu(!1)}),s.on("keydown",a=>{a&&a.key==="Enter"?n.triggerFunctionAndEvent(r,t,s.node()):a&&a.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(i):a&&a.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(i):a&&a.key==="Escape"&&n.updateOverflowMenu(!1),a.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,r){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(O.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=b(this.getOptions(),"toolbar","numberOfIcons")-1,n=b(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;a.type===Mt.CUSTOM?(b(a,"id")===null&&(a.id=`toolbar-button-${yv.buttonID++}`),b(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?r.push(o):i.length<t?b(o,"iconSVG","content")===null?s.push(o):i.push(o):s.push(o))}),s.push(...r),s.length?{buttonList:i,overflowMenuItemList:s}:{buttonList:i}}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
|
-
<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(),
|
|
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(),r=this.model.getDisplayData();let i;switch(t){case Mt.ZOOM_IN:n&&(i={id:"toolbar-zoomIn",title:"Zoom in",shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case Mt.ZOOM_OUT:n&&(i={id:"toolbar-zoomOut",title:"Zoom out",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case Mt.RESET_ZOOM:n&&(i={id:"toolbar-resetZoom",title:"Reset zoom",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case Mt.MAKE_FULLSCREEN:i={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:"Make fullscreen",shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case Mt.SHOW_AS_DATATABLE:i={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:"Show as table",shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(O.Modal.SHOW)};break;case Mt.EXPORT_CSV:i={id:"toolbar-export-CSV",title:"Export as CSV",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case Mt.EXPORT_PNG:i={id:"toolbar-export-PNG",title:"Export as PNG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case Mt.EXPORT_JPG:i={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 i}getControlIconByType(t){switch(t){case Mt.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 Mt.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 Mt.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 Mt.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 Mt.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 Mt.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 Mt.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 Mt.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)}}};
|
|
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 Mt.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 Mt.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 Mt.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 Mt.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 Mt.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 Mt.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)}}};qg.buttonID=0;let Ca=qg;const Yg=class xv extends lt{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=xv.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(r=>{const i=b(r,"growth");return i===tt.PREFERRED||i===tt.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>b(t,"growth")===tt.STRETCH).size()}render(t=!0){const n=this.parent,{width:r,height:i}=L.getHTMLElementSize(n.node()),s=this.configs.direction===bt.ROW||this.configs.direction===bt.ROW_REVERSE,a=b(this.model.getOptions(),"style","prefix"),o=n.classed(`${ne}--${a}--layout-row`,this.configs.direction===bt.ROW).classed(`${ne}--${a}--layout-row-reverse`,this.configs.direction===bt.ROW_REVERSE).classed(`${ne}--${a}--layout-column`,this.configs.direction===bt.COLUMN).classed(`${ne}--${a}--layout-column-reverse`,this.configs.direction===bt.COLUMN_REVERSE).classed(`${ne}--${a}--layout-alignitems-center`,this.configs.alignItems===fr.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,c=>c.id);o.enter().append("div").merge(n.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",c=>`layout-child layout-child-${this._instanceID} ${c.id}`).each(function(c){c.components.forEach(u=>{const h=D(this),d=b(c,"renderType")===q.SVG;u.setParent(d?L.appendOrSelect(h,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):h);const f=b(c,"growth");(f===tt.PREFERRED||f===tt.FIXED)&&u.render(t)})}),n.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(c){const u=b(c,"growth"),h=b(c,"renderType")===q.SVG?L.getSVGElementSize(D(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):L.getHTMLElementSize(this);if(u===tt.PREFERRED){const d=s?h.width:h.height,f=s?r:i;c.size=d/f*100}}),o.exit().remove(),this.children.filter(c=>b(c,"growth")===tt.STRETCH).forEach(c=>{c.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const l=n.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,c=>c.id);s?l.style("width",c=>`${c.size/100*r}px`).style("height","100%"):l.style("height",c=>`${c.size/100*i}px`).style("width","100%"),l.each(function(c){c.components.forEach(u=>{b(c,"growth")===tt.STRETCH&&u.render(t)})})}setModel(t){super.setModel(t),this.children.forEach(n=>{n.components.forEach(r=>r.setModel(t))})}setServices(t){super.setServices(t),this.children.forEach(n=>{n.components.forEach(r=>r.setServices(t))})}destroy(){this.children.forEach(t=>{t.components.forEach(n=>n.destroy())})}};Yg.instanceID=Math.floor(Math.random()*99999999999);let he=Yg;class cn extends lt{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer().style("width",`${this.configs.size||Tf.default.size}px`).style("height",`${this.configs.size||Tf.default.size}px`).attr("opacity",0)}}var Tk={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
|
-
`},cc=
|
|
25
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
26
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kk(e,t){if(e){if(typeof e=="string")return mc(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 mc(e,t)}}function Qk(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Jk(e){if(Array.isArray(e))return mc(e)}function mc(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 tR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tm(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 eR(e,t,n){return t&&tm(e.prototype,t),n&&tm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function nR(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&&vc(e,t)}function vc(e,t){return vc=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},vc(e,t)}function iR(e){var t=aR();return function(){var n=La(e),i;if(t){var r=La(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return rR(this,i)}}function rR(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 sR(e)}function sR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aR(){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 La(e){return La=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},La(e)}function oR(e){var t=function(n){nR(r,n);var i=iR(r);function r(){return tR(this,r),i.apply(this,arguments)}return eR(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),l=0;l<a;l++)o[l]=arguments[l];var c=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(c,u)){h&&h(null,!0);return}var d={group:u&&u.group,state:c},f=[d.group,c].filter(Boolean).join("-").split("-").map(function(x){return x[0].toUpperCase()+x.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 y=[c,u].filter(Boolean);this._changeState.apply(this,Zk(y).concat([function(){m.dispatchEvent(new CustomEvent(s.options["eventAfter".concat(f)],{bubbles:!0,cancelable:!0,detail:u})),h&&h()}]))}}}]),r}(e);return t}function yc(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 em(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 xc(e){"@babel/helpers - typeof";return xc=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},xc(e)}function lR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nm(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 cR(e,t,n){return t&&nm(e.prototype,t),n&&nm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function uR(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&&bc(e,t)}function bc(e,t){return bc=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},bc(e,t)}function hR(e){var t=pR();return function(){var n=Da(e),i;if(t){var r=Da(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return dR(this,i)}}function dR(e,t){if(t&&(xc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fR(e)}function fR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pR(){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 Da(e){return Da=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Da(e)}function gR(e){var t=function(n){uR(r,n);var i=hR(r);function r(){return lR(this,r),i.apply(this,arguments)}return cR(r,[{key:"show",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("shown",em(s),a)}},{key:"hide",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("hidden",em(s),a)}}]),r}(e);return t}var mR=[oR,gR];const vR=mR;function yR(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var im=function(){};process.env.NODE_ENV!=="production"&&(im=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 xR=im;const bR=yR(xR);function wc(e){"@babel/helpers - typeof";return wc=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},wc(e)}function wR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rm(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 _R(e,t,n){return t&&rm(e.prototype,t),n&&rm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ER(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&&_c(e,t)}function _c(e,t){return _c=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},_c(e,t)}function SR(e){var t=MR();return function(){var n=ka(e),i;if(t){var r=ka(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return OR(this,i)}}function OR(e,t){if(t&&(wc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return TR(e)}function TR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function MR(){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 ka(e){return ka=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ka(e)}function CR(e){var t=function(n){ER(r,n);var i=SR(r);function r(){return wR(this,r),i.apply(this,arguments)}return _R(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]:{},l=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(l.selectorInit))this.create(a,o);else{var c=l.initEventNames.map(function(u){return Nr(a,u,function(h){var d=yc(h,"[".concat(l.attribInitTarget,"]"));if(d){h.delegateTarget=d;var f=d.ownerDocument.querySelectorAll(d.getAttribute(l.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=c.pop();u;u=c.pop())u.release()}}}return""}}]),r.forLazyInit=!0,r}(e);return t}function Ec(e){"@babel/helpers - typeof";return Ec=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},Ec(e)}function $R(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sm(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 AR(e,t,n){return t&&sm(e.prototype,t),n&&sm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function LR(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&&Sc(e,t)}function Sc(e,t){return Sc=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Sc(e,t)}function DR(e){var t=IR();return function(){var n=Ra(e),i;if(t){var r=Ra(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return kR(this,i)}}function kR(e,t){if(t&&(Ec(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return RR(e)}function RR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function IR(){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 Ra(e){return Ra=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ra(e)}var NR=function(e){LR(n,e);var t=DR(n);function n(i,r){var s;return $R(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(l){return!yc(a,l)})&&s.element.querySelector(cc.selectorTabbable).focus()},s._hookCloseActions(),s}return AR(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,l=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(cc.selectorTabbable);h.focus(),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&bR(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 c="onfocusin"in this.element.ownerDocument.defaultView,u=c?"focusin":"focus";this._handleFocusinListener=this.manage(Nr(this.element.ownerDocument,u,this._handleFocusin,!c))}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(Nr(this.element,"transitionend",l))}},{key:"_hookCloseActions",value:function(){var i=this;this.manage(Nr(this.element,"click",function(r){var s=yc(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(Nr(this.element.ownerDocument.body,"keydown",function(r){r.which===27&&i.shouldStateBeChanged("hidden")&&(r.stopPropagation(),i.hide(r))}))}}],[{key:"options",get:function(){var i=cc.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}(Dk(Bk,CR,vR,Yk));const PR=NR;class Ia extends lt{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()),PR.create(this.modal.node()).show()},this.init()}addEventListeners(){this.services.events.addEventListener(O.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(O.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.model.getOptions(),n=b(t,"style","prefix"),i=this.model.getTabularDataArray();return`
|
|
24
|
+
`},cc=Tk;function Xg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Mk(e,t,n){return t&&Xg(e.prototype,t),n&&Xg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $k(e){return kk(e)||Dk(e)||Lk(e)||Ak()}function Ak(){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 Lk(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 Dk(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kk(e){if(Array.isArray(e))return uc(e)}function uc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zg(e){return e.reduce(function(t,n){return Array.isArray(n)?t.push.apply(t,$k(Zg(n))):t.push(n),t},[])}function Rk(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Zg(t).reduce(function(r,i){return i(r)},function(){function r(){Ck(this,r)}return Mk(r)}())}function hc(e){"@babel/helpers - typeof";return hc=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},hc(e)}function Ik(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Nk(e,t,n){return t&&Kg(e.prototype,t),n&&Kg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pk(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&&dc(e,t)}function dc(e,t){return dc=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},dc(e,t)}function Uk(e){var t=Vk();return function(){var n=$a(e),r;if(t){var i=$a(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Bk(this,r)}}function Bk(e,t){if(t&&(hc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qg(e)}function Qg(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 $a(e){return $a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},$a(e)}function Hk(e){var t=function(n){Pk(i,n);var r=Uk(i);function i(s){var a,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Ik(this,i),a=r.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,Qg(a)),a}return Nk(i,[{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)}}]),i}(e);return t}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 Gk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Fk(e,t,n){return t&&Jg(e.prototype,t),n&&Jg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Aa(){return typeof Reflect<"u"&&Reflect.get?Aa=Reflect.get:Aa=function(e,t,n){var r=zk(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Aa.apply(this,arguments)}function zk(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Mr(e),e!==null););return e}function jk(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,r){return n.__proto__=r,n},pc(e,t)}function Wk(e){var t=Xk();return function(){var n=Mr(e),r;if(t){var i=Mr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return qk(this,r)}}function qk(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 Yk(e)}function Yk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xk(){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 Mr(e){return Mr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Mr(e)}function Zk(e){var t=function(n){jk(i,n);var r=Wk(i);function i(){var s;Gk(this,i);for(var a=arguments.length,o=new Array(a),l=0;l<a;l++)o[l]=arguments[l];return s=r.call.apply(r,[this].concat(o)),s.handles=new Set,s}return Fk(i,[{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)}),Aa(Mr(i.prototype),"release",this).call(this)}}]),i}(e);return t}function Ii(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.addEventListener.apply(e,n),{release:function(){return e.removeEventListener.apply(e,n),null}}}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 Kk(e){return eR(e)||tR(e)||Jk(e)||Qk()}function Qk(){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 Jk(e,t){if(e){if(typeof e=="string")return mc(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 mc(e,t)}}function tR(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function eR(e){if(Array.isArray(e))return mc(e)}function mc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function rR(e,t,n){return t&&tm(e.prototype,t),n&&tm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function iR(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&&vc(e,t)}function vc(e,t){return vc=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},vc(e,t)}function sR(e){var t=lR();return function(){var n=La(e),r;if(t){var i=La(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return aR(this,r)}}function aR(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 oR(e)}function oR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lR(){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 La(e){return La=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},La(e)}function cR(e){var t=function(n){iR(i,n);var r=sR(i);function i(){return nR(this,i),r.apply(this,arguments)}return rR(i,[{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),l=0;l<a;l++)o[l]=arguments[l];var c=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(c,u)){h&&h(null,!0);return}var d={group:u&&u.group,state:c},f=[d.group,c].filter(Boolean).join("-").split("-").map(function(x){return x[0].toUpperCase()+x.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 y=[c,u].filter(Boolean);this._changeState.apply(this,Kk(y).concat([function(){m.dispatchEvent(new CustomEvent(s.options["eventAfter".concat(f)],{bubbles:!0,cancelable:!0,detail:u})),h&&h()}]))}}}]),i}(e);return t}function yc(e,t){var n=e.target,r=e.currentTarget;if(typeof n.matches=="function"){if(n.matches(t))return n;if(n.matches("".concat(t," *"))){var i=n.closest(t);if((r.nodeType===Node.DOCUMENT_NODE?r.documentElement:r).contains(i))return i}}}function em(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 xc(e){"@babel/helpers - typeof";return xc=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},xc(e)}function uR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function hR(e,t,n){return t&&nm(e.prototype,t),n&&nm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function dR(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&&bc(e,t)}function bc(e,t){return bc=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},bc(e,t)}function fR(e){var t=mR();return function(){var n=Da(e),r;if(t){var i=Da(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return pR(this,r)}}function pR(e,t){if(t&&(xc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gR(e)}function gR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mR(){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 Da(e){return Da=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Da(e)}function vR(e){var t=function(n){dR(i,n);var r=fR(i);function i(){return uR(this,i),r.apply(this,arguments)}return hR(i,[{key:"show",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("shown",em(s),a)}},{key:"hide",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("hidden",em(s),a)}}]),i}(e);return t}var yR=[cR,vR];const xR=yR;function bR(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rm=function(){};process.env.NODE_ENV!=="production"&&(rm=function(e,t,n){var r=arguments.length;n=new Array(r>2?r-2:0);for(var i=2;i<r;i++)n[i-2]=arguments[i];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 wR=rm;const _R=bR(wR);function wc(e){"@babel/helpers - typeof";return wc=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},wc(e)}function ER(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function im(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function SR(e,t,n){return t&&im(e.prototype,t),n&&im(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function OR(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&&_c(e,t)}function _c(e,t){return _c=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},_c(e,t)}function TR(e){var t=$R();return function(){var n=ka(e),r;if(t){var i=ka(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return MR(this,r)}}function MR(e,t){if(t&&(wc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return CR(e)}function CR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $R(){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 ka(e){return ka=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ka(e)}function AR(e){var t=function(n){OR(i,n);var r=TR(i);function i(){return ER(this,i),r.apply(this,arguments)}return SR(i,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]:{},l=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(l.selectorInit))this.create(a,o);else{var c=l.initEventNames.map(function(u){return Ii(a,u,function(h){var d=yc(h,"[".concat(l.attribInitTarget,"]"));if(d){h.delegateTarget=d;var f=d.ownerDocument.querySelectorAll(d.getAttribute(l.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=c.pop();u;u=c.pop())u.release()}}}return""}}]),i.forLazyInit=!0,i}(e);return t}function Ec(e){"@babel/helpers - typeof";return Ec=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},Ec(e)}function LR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function DR(e,t,n){return t&&sm(e.prototype,t),n&&sm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function kR(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&&Sc(e,t)}function Sc(e,t){return Sc=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Sc(e,t)}function RR(e){var t=PR();return function(){var n=Ra(e),r;if(t){var i=Ra(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return IR(this,r)}}function IR(e,t){if(t&&(Ec(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NR(e)}function NR(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function PR(){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 Ra(e){return Ra=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ra(e)}var UR=function(e){kR(n,e);var t=RR(n);function n(r,i){var s;return LR(this,n),s=t.call(this,r,i),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(l){return!yc(a,l)})&&s.element.querySelector(cc.selectorTabbable).focus()},s._hookCloseActions(),s}return DR(n,[{key:"createdByLauncher",value:function(r){this.show(r)}},{key:"shouldStateBeChanged",value:function(r){return r==="shown"?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(r,i,s){var a=this,o,l=function(){if(o&&(o=a.unmanage(o).release()),r==="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(cc.selectorTabbable);h.focus(),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&_R(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()),r==="shown"){var c="onfocusin"in this.element.ownerDocument.defaultView,u=c?"focusin":"focus";this._handleFocusinListener=this.manage(Ii(this.element.ownerDocument,u,this._handleFocusin,!c))}r==="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()):r==="shown"&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),o=this.manage(Ii(this.element,"transitionend",l))}},{key:"_hookCloseActions",value:function(){var r=this;this.manage(Ii(this.element,"click",function(i){var s=yc(i,r.options.selectorModalClose);s&&(i.delegateTarget=s),(s||i.target===r.element)&&r.hide(i)})),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(Ii(this.element.ownerDocument.body,"keydown",function(i){i.which===27&&r.shouldStateBeChanged("hidden")&&(i.stopPropagation(),r.hide(i))}))}}],[{key:"options",get:function(){var r=cc.prefix;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(r,"--overflow-menu-options"),".".concat(r,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(r,"--modal-container"),classVisible:"is-visible",classBody:"".concat(r,"--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}(Rk(Hk,AR,xR,Zk));const BR=UR;class Ia extends lt{constructor(t,n,r){super(t,n,r),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()),BR.create(this.modal.node()).show()},this.init()}addEventListeners(){this.services.events.addEventListener(O.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(O.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.model.getOptions(),n=b(t,"style","prefix"),r=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>
|
|
@@ -41,15 +41,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
41
41
|
<table class="cds--data-table cds--data-table--no-border cds--data-table cds--data-table--no-border">
|
|
42
42
|
<thead>
|
|
43
43
|
<tr>
|
|
44
|
-
${_t(
|
|
45
|
-
<div class="cds--table-header-label cds--table-header-label">${
|
|
44
|
+
${_t(r,0).map(i=>`<th scope="col">
|
|
45
|
+
<div class="cds--table-header-label cds--table-header-label">${i}</div>
|
|
46
46
|
</th>`).join("")}
|
|
47
47
|
</tr>
|
|
48
48
|
</thead>
|
|
49
49
|
|
|
50
|
-
<tbody>${
|
|
50
|
+
<tbody>${r.slice(1).map(i=>`
|
|
51
51
|
<tr>
|
|
52
|
-
${
|
|
52
|
+
${i.map(s=>`<td>${s}</td>`).join("")}
|
|
53
53
|
</tr>`).join("")}
|
|
54
54
|
</tbody>
|
|
55
55
|
</table>
|
|
@@ -59,7 +59,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
59
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=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const i=D(this.services.domUtils.getHolder()),r=b(n,"style","prefix");this.modal=L.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 Pr extends lt{constructor(){super(...arguments),this.type="title",this.renderType=q.HTML}render(t=!1){const n=this.getComponentContainer(),i=b(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(O.Tooltip.SHOW,{event:a,hoveredElement:r,content:r.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(O.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=L.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(l){o.services.events.dispatchEvent(O.Tooltip.SHOW,{event:l,hoveredElement:t,content:i})}).on("mousemove",function(l){o.services.events.dispatchEvent(O.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(O.Tooltip.HIDE)})}}getMaxTitleWidth(){return L.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 Oc extends lt{constructor(){super(...arguments),this.type="legend",this.renderType=q.HTML}render(t=!1){const n=this.getOptions(),i=b(n,"legend"),r=b(i,"alignment"),s=b(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Ct.items.status,l=a.some(y=>y.status===o),c=b(i,"order"),u=this.getComponentContainer().classed("center-aligned",r===It.CENTER).classed("right-aligned",r===It.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",rt.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const h=u.selectAll("div.legend-item").data(a,y=>y.name),d=h.enter().append("div").attr("class","legend-item");d.merge(u.selectAll("div.legend-item")).classed("active",function(y){return y.status===Ct.items.status.ACTIVE});const f=b(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=Ct.checkbox.radius,m=d.append("div").classed("checkbox",!0),g=m.merge(h.select("div.checkbox")).attr("role",rt.CHECKBOX).attr("tabindex",f?0:-1).attr("aria-labelledby",(y,x)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${x}-title`)).attr("aria-checked",({status:y})=>y===Ct.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",y=>this.model.getColorClassName({classNameTypes:[Z.BACKGROUND],dataGroupName:y.name,originalClassName:"checkbox"})).style("background",y=>y.status===Ct.items.status.ACTIVE?this.model.getFillColor(y.name)||this.model.getStrokeColor(y.name):null).classed("active",function(y){return y.status===Ct.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=b(n,"legend","additionalItems");if(v&&a.length){const y=this,x=u.selectAll("div.additional-item").data(v);x.exit().remove();const S=x.enter().append("div").merge(x).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(T,k)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${g.size()+k}-title`));S.selectAll("*").remove();let _,E=1;S.append("svg").classed("icon",!0).each(function(T){const k=D(this);!_||_!=T.type?(_=T.type,E=1):E++,y.addAdditionalItem(k,T,E)}),S.append("p").merge(S.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}=Ct.area;if(n.type===Pt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${r}px`).style("height",`${s}px`),n.type===Pt.RADIUS){const{iconData:a,fill:o,stroke:l}=Ct.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",rt.IMG).attr("aria-label","radius").attr("cx",c=>c.cx).attr("cy",c=>c.cy).attr("r",c=>c.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l)}else if(n.type===Pt.LINE){const a=Ct.line;t.select("line.line").empty()&&t.append("line").classed(`line-${i}`,!0).attr("role",rt.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===Pt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${i}`,!0).attr("role",rt.IMG).attr("aria-label","area").attr("width",r).attr("height",s).style("fill",i>3&&!n.fill?Ct.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===Pt.SIZE){const{iconData:a,fill:o,stroke:l}=Ct.size;t.attr("fill","none").attr("role",rt.IMG).attr("aria-label","size").selectAll("rect").data(a).enter().append("rect").classed("size",!0).attr("width",c=>c.width).attr("height",c=>c.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l).style("stroke-width",1)}else if(n.type===Pt.QUARTILE){const{iconData:a}=Ct.quartile;t.selectAll("rect").attr("role",rt.IMG).attr("aria-label","quartile").data(a).enter().append("rect").attr("class",(o,l)=>`quartile-${l===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===Pt.ZOOM){const{iconData:a,color:o}=b(Ct,"zoom"),l=t.attr("role",rt.IMG).attr("aria-label","zoom").selectAll("g.icon").data(a).enter();l.append("g").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.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),l.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=b(this.getOptions(),"legend","truncation"),i=b(n,"type"),r=b(n,"threshold"),s=b(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!==Te.NONE?a.html(function(o){return o.name.length>r?Ar(o.name,i,s):o.name}):a.html(o=>o.name)}addEventListeners(){const t=this,n=this.getComponentContainer(),i=this.getOptions(),r=b(i,"legend"),s=b(r,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(O.Legend.ITEM_HOVER,{hoveredElement:D(this)});const o=D(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.type!==Te.NONE&&t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){D(this).datum().name.length>s.threshold&&s.type!==Te.NONE&&t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(O.Legend.ITEM_CLICK,{clickedElement:D(this)});const a=D(this).datum();t.model.toggleDataLabel(a.name)}).on("mouseout",function(){const a=D(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==Te.NONE&&t.services.events.dispatchEvent(O.Tooltip.HIDE),t.services.events.dispatchEvent(O.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(O.Legend.ITEM_HOVER,{hoveredElement:D(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(O.Legend.ITEM_MOUSEOUT,{hoveredElement:D(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=D(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class am extends lt{constructor(t,n,i){super(t,n,i),this.type="chart-clip",this.renderType=q.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,l]=r.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=L.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=L.appendOrSelect(this.chartClipPath,`rect.${this.type}`);a-s>0&&c.attr("x",s).attr("y",l).attr("width",a-s).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class UR extends am{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}=L.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=L.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const r=L.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 Ci,Ft;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Ft||(Ft={}));var om=(Ci={},Ci[Ft.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)}},Ci[Ft.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)}},Ci[Ft.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)}},Ci[Ft.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)}},Ci),lm=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},Na=function(){function e(t){t===void 0&&(t={}),this.positions=om,this.positions=Object.assign({},om,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(l){var c=s(t,n,l),u=a.getPlacementBox(n,c),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:l,weight:v}});return o.sort(function(l,c){return c.weight-l.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,l,c){return s.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,i,r,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:lm.innerHeight,width:lm.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 Na;class Tc extends lt{constructor(t,n,i){super(t,n,i),this.type="tooltip",this.renderType=q.HTML,this.isEventListenerAdded=!1,this.positionService=new Na,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 l=L.appendOrSelect(this.tooltip,"div.content-box");if(b(this.getOptions(),"tooltip","customHTML"))if(r.detail.content){const c=`<div class="title-tooltip"><p>${r.detail.content}</p></div>`;l.html(c)}else l.html(this.model.getOptions().tooltip.customHTML(s,a));else l.html(a);l.selectAll(".datapoint-tooltip").each(function(c,u){const h=o[u];o[u]&&o[u].color&&D(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(O.Tooltip.MOVE,t=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(O.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(O.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(O.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(O.Tooltip.MOVE,null),this.services.events.removeEventListener(O.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(O.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(O.Chart.MOUSEOUT,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),i=b(n,"tooltip","truncation","type"),r=b(n,"tooltip","truncation","threshold"),s=b(n,"tooltip","truncation","numCharacter");return i!==Te.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=Ar(a.label,i,s)),a.value&&a.value.length>r&&(a.value=Ar(a.value,i,s)),a}):t}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
|
|
62
|
+
</div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=D(this.services.domUtils.getHolder()),i=b(n,"style","prefix");this.modal=L.appendOrSelect(r,`div.${ne}--${i}--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 Ni extends lt{constructor(){super(...arguments),this.type="title",this.renderType=q.HTML}render(t=!1){const n=this.getComponentContainer(),r=b(this.getOptions(),"title"),i=n.selectAll("p.title").data([r]);if(i.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(i).html(s=>s),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const s=this;i.on("mouseover",function(a){s.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:i,content:i.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(O.Tooltip.HIDE)})}i.exit().remove()}truncateTitle(t,n){if(n<=0)return;const r=t.text();if(t.node().getComputedTextLength()>n){t.append("tspan").text("...");const i=L.appendOrSelect(t,"tspan").node().getComputedTextLength(),s=t.text(),a=this.getSubstringIndex(t.node(),0,s.length-1,n-i);t.html(s.substring(0,a-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(l){o.services.events.dispatchEvent(O.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(O.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(O.Tooltip.HIDE)})}}getMaxTitleWidth(){return L.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,r,i){const s=Math.floor((r+n)/2);return t.getSubStringLength(0,s)>i?this.getSubstringIndex(t,n,s,i):t.getSubStringLength(0,s)<i?t.getSubStringLength(0,s+1)>i?s:this.getSubstringIndex(t,s,r,i):s}}class Oc extends lt{constructor(){super(...arguments),this.type="legend",this.renderType=q.HTML}render(t=!1){const n=this.getOptions(),r=b(n,"legend"),i=b(r,"alignment"),s=b(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Ct.items.status,l=a.some(y=>y.status===o),c=b(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===It.CENTER).classed("right-aligned",i===It.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",it.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const h=u.selectAll("div.legend-item").data(a,y=>y.name),d=h.enter().append("div").attr("class","legend-item");d.merge(u.selectAll("div.legend-item")).classed("active",function(y){return y.status===Ct.items.status.ACTIVE});const f=b(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=Ct.checkbox.radius,m=d.append("div").classed("checkbox",!0),g=m.merge(h.select("div.checkbox")).attr("role",it.CHECKBOX).attr("tabindex",f?0:-1).attr("aria-labelledby",(y,x)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${x}-title`)).attr("aria-checked",({status:y})=>y===Ct.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",y=>this.model.getColorClassName({classNameTypes:[X.BACKGROUND],dataGroupName:y.name,originalClassName:"checkbox"})).style("background",y=>y.status===Ct.items.status.ACTIVE?this.model.getFillColor(y.name)||this.model.getStrokeColor(y.name):null).classed("active",function(y){return y.status===Ct.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=b(n,"legend","additionalItems");if(v&&a.length){const y=this,x=u.selectAll("div.additional-item").data(v);x.exit().remove();const S=x.enter().append("div").merge(x).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(T,k)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${g.size()+k}-title`));S.selectAll("*").remove();let _,E=1;S.append("svg").classed("icon",!0).each(function(T){const k=D(this);!_||_!=T.type?(_=T.type,E=1):E++,y.addAdditionalItem(k,T,E)}),S.append("p").merge(S.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((r,i)=>n.indexOf(r.name)-n.indexOf(i.name)),n.length<t.length){const r=t.length-n.length;return t.slice(r).concat(t.slice(0,r))}return t}addAdditionalItem(t,n,r){const{width:i,height:s}=Ct.area;if(n.type===Pt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===Pt.RADIUS){const{iconData:a,fill:o,stroke:l}=Ct.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",it.IMG).attr("aria-label","radius").attr("cx",c=>c.cx).attr("cy",c=>c.cy).attr("r",c=>c.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l)}else if(n.type===Pt.LINE){const a=Ct.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",it.IMG).attr("aria-label","line").attr("x1",0).attr("y1",a.yPosition).attr("x2",i).attr("y2",a.yPosition).style("stroke",n.stroke?n.stroke:a.stroke).style("stroke-width",a.strokeWidth)}else if(n.type===Pt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",it.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?Ct.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===Pt.SIZE){const{iconData:a,fill:o,stroke:l}=Ct.size;t.attr("fill","none").attr("role",it.IMG).attr("aria-label","size").selectAll("rect").data(a).enter().append("rect").classed("size",!0).attr("width",c=>c.width).attr("height",c=>c.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l).style("stroke-width",1)}else if(n.type===Pt.QUARTILE){const{iconData:a}=Ct.quartile;t.selectAll("rect").attr("role",it.IMG).attr("aria-label","quartile").data(a).enter().append("rect").attr("class",(o,l)=>`quartile-${l===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===Pt.ZOOM){const{iconData:a,color:o}=b(Ct,"zoom"),l=t.attr("role",it.IMG).attr("aria-label","zoom").selectAll("g.icon").data(a).enter();l.append("g").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.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),l.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=b(this.getOptions(),"legend","truncation"),r=b(n,"type"),i=b(n,"threshold"),s=b(n,"numCharacter"),a=t.selectAll("div.legend-item p");a.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),r!==Te.NONE?a.html(function(o){return o.name.length>i?Ai(o.name,r,s):o.name}):a.html(o=>o.name)}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=b(r,"legend"),s=b(i,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(O.Legend.ITEM_HOVER,{hoveredElement:D(this)});const o=D(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.type!==Te.NONE&&t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){D(this).datum().name.length>s.threshold&&s.type!==Te.NONE&&t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(O.Legend.ITEM_CLICK,{clickedElement:D(this)});const a=D(this).datum();t.model.toggleDataLabel(a.name)}).on("mouseout",function(){const a=D(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==Te.NONE&&t.services.events.dispatchEvent(O.Tooltip.HIDE),t.services.events.dispatchEvent(O.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(O.Legend.ITEM_HOVER,{hoveredElement:D(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(O.Legend.ITEM_MOUSEOUT,{hoveredElement:D(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=D(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class am extends lt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=q.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 r=n.getMainXScale(),i=n.getMainYScale(),[s,a]=r.range(),[o,l]=i.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=L.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=L.appendOrSelect(this.chartClipPath,`rect.${this.type}`);a-s>0&&c.attr("x",s).attr("y",l).attr("width",a-s).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class VR extends am{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:r}=L.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=L.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=L.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i.attr("x",0).attr("y",0).attr("width",n).attr("height",r),this.chartClipPath.merge(i).lower()}}var Cr,Ft;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Ft||(Ft={}));var om=(Cr={},Cr[Ft.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)}},Cr[Ft.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)}},Cr[Ft.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)}},Cr[Ft.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)}},Cr),lm=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},Na=function(){function e(t){t===void 0&&(t={}),this.positions=om,this.positions=Object.assign({},om,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,r={top:0,left:0};n.offsetParent;){var i=getComputedStyle(n.offsetParent);i.position==="static"&&i.marginLeft&&i.marginTop&&(parseInt(i.marginTop,10)&&(r.top+=parseInt(i.marginTop,10)),parseInt(i.marginLeft,10)&&(r.left+=parseInt(i.marginLeft,10))),n=n.offsetParent}var s=t.getBoundingClientRect(),a=document.body.getBoundingClientRect();return{top:s.top-a.top+r.top,left:s.left-a.left+r.left}},e.prototype.findRelative=function(t,n,r){var i=this.getRelativeOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findAbsolute=function(t,n,r){var i=this.getAbsoluteOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findPosition=function(t,n,r,i){i===void 0&&(i=this.getAbsoluteOffset.bind(this));var s=i(t),a=t.getBoundingClientRect();return this.calculatePosition(s,a,n,r)},e.prototype.findPositionAt=function(t,n,r){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},n,r)},e.prototype.getPlacementBox=function(t,n){var r=t.offsetHeight+n.top,i=t.offsetWidth+n.left;return{top:n.top,bottom:r,left:n.left,right:i}},e.prototype.addOffset=function(t,n,r){return n===void 0&&(n=0),r===void 0&&(r=0),Object.assign({},t,{top:t.top+n,left:t.left+r})},e.prototype.setElement=function(t,n){t.style.top=n.top+"px",t.style.left=n.left+"px"},e.prototype.findBestPlacement=function(t,n,r,i,s){var a=this;i===void 0&&(i=this.defaultContainerFunction.bind(this)),s===void 0&&(s=this.findPosition.bind(this));var o=r.map(function(l){var c=s(t,n,l),u=a.getPlacementBox(n,c),h=0,d=0,f=i();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:l,weight:v}});return o.sort(function(l,c){return c.weight-l.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,r,i){var s=this;i===void 0&&(i=this.defaultContainerFunction.bind(this));var a=function(o,l,c){return s.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,r,i,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:lm.innerHeight,width:lm.innerWidth}},e.prototype.calculatePosition=function(t,n,r,i){return this.positions[i]?this.positions[i](t,r,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},e}();new Na;class Tc extends lt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=q.HTML,this.isEventListenerAdded=!1,this.positionService=new Na,this.handleShowTooltip=i=>{const s=i.detail.data||i.detail.items;let a;const o=this.formatItems(this.getItems(i));i.detail.content?a=`<div class="title-tooltip"><p>${i.detail.content}</p></div>`:a=this.getTooltipHTML(o);const l=L.appendOrSelect(this.tooltip,"div.content-box");if(b(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const c=`<div class="title-tooltip"><p>${i.detail.content}</p></div>`;l.html(c)}else l.html(this.model.getOptions().tooltip.customHTML(s,a));else l.html(a);l.selectAll(".datapoint-tooltip").each(function(c,u){const h=o[u];o[u]&&o[u].color&&D(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",h.color)}),this.positionTooltip(i),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(O.Tooltip.MOVE,t=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(O.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(O.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(O.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(O.Tooltip.MOVE,null),this.services.events.removeEventListener(O.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(O.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(O.Chart.MOUSEOUT,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=b(n,"tooltip","truncation","type"),i=b(n,"tooltip","truncation","threshold"),s=b(n,"tooltip","truncation","numCharacter");return r!==Te.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>i&&(a.label=Ai(a.label,r,s)),a.value&&a.value.length>i&&(a.value=Ai(a.value,r,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=b(i,"tooltip","valueFormatter");if(r)return r(t,n);if(typeof t.getTime=="function")return mi(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 mi(Date.parse(t),"MMM d, yyyy")}catch{}return t.toLocaleString()}render(t=!1){const n=this.getOptions(),i=b(n,"tooltip","enabled");if(i){const r=D(this.services.domUtils.getHolder()),s=b(n,"style","prefix");this.tooltip=L.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=b(r,"zoomBar","top","enabled");let a=b(t,"detail","mousePosition");if(!a)a=Sn(b(t,"detail","event"),n);else{const d=b(r,"zoomBar","top","type"),f=ue.height[d];s&&(a[1]+=f+ue.spacerHeight)}const o=n.offsetWidth,l=n.offsetHeight;let c;a[0]/o>.9?c=Ft.LEFT:a[0]/o<.1?c=Ft.RIGHT:c=this.positionService.findBestPlacementAt({left:a[0],top:a[1]},i,[Ft.RIGHT,Ft.LEFT,Ft.TOP,Ft.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:l}));let{horizontalOffset:u}=nO;c===Ft.LEFT&&(u*=-1);const h=this.positionService.findPositionAt({left:a[0]+u,top:a[1]},i,c);this.positionService.setElement(i,h)}}const Pa=class extends lt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=q.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=L.appendOrSelect(n,"svg.chart-grid-backdrop"),s=L.appendOrSelect(r,`g.${this.type}`),a=L.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=L.getSVGElementSize(r,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),h=c.getMainXScale(),[d]=h.range();i.attr("transform",`translate(${d},0)`);const f=L.appendOrSelect(i,this.frontSelectionSelector);if(h&&u===W.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 E=_[1]-_[0];let T="0,"+E.toString();const k=Math.floor(l/Pa.DASH_LENGTH),I=k*Pa.DASH_LENGTH;for(let $=0;$<k;$++)T+=","+Pa.DASH_LENGTH;T+=","+(l-I),k%2===1&&(T+=",0"),T+=","+E.toString(),T+=","+l.toString(),f.attr("stroke-dasharray",T)},g=_=>{const E=_.selection;E===null||E[0]===E[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(E))},v=(_,E)=>{const T=bd().range([0,o]).domain(p);let k=[T.invert(_),T.invert(E)];k[0].valueOf()===k[1].valueOf()&&(k=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==k[0].valueOf()||p[1].valueOf()!==k[1].valueOf())&&this.services.zoom.handleDomainChange(k)};let y;const x=_=>{const E=_.selection;E!==null&&(v(E[0],E[1]),s.call(y.move,null),f.style("display","none"))};l!=0&&o!=0&&(y=Pu().extent([[0,0],[o-1,l]]).on("start brush end",g).on("end.brushed",x),s.call(y));const S=this.services.zoom.getZoomRatio();r.on("click",function(_){if(_.shiftKey){const E=this.services.domUtils.getHolder(),T=Sn(s.node(),E)[0];let k=T-o*S/2;k<0&&(k=0);let I=T+o*S/2;I>o&&(I=o),v(k,I)}})}}};let cm=Pa;cm.DASH_LENGTH=4;class BR extends lt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=q.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=Pu(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(O.ZoomBar.UPDATE,this.render.bind(this));const t=b(this.getOptions(),"zoomBar",B.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),i=this.services.zoom.isZoomBarLoading(B.TOP),r=this.services.zoom.isZoomBarLocked(B.TOP),s=b(this.getOptions(),"zoomBar",B.TOP,"type"),a=b(this.getOptions(),"axes",B.BOTTOM,"highlights"),o=ue.height[s],{width:l}=L.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const h=L.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(L.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",ue.spacerHeight).attr("opacity",1).attr("fill","none"),s===Pe.GRAPH_VIEW?L.appendOrSelect(h,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Pe.SLIDER_VIEW&&L.appendOrSelect(h,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),i){this.renderSkeleton(h,c,l);return}const{cartesianScales:d}=this.services,f=d.getMainXScale(),p=d.getMainYScale(),m=d.getMainXScaleType();if(f&&m===W.TIME){let g=this.services.zoom.getZoomBarData();if(Ae(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 y=this.model.get("initialZoomDomain"),x=b(this.getOptions(),"zoomBar",B.TOP,"initialZoomDomain");x&&x[0]&&x[1]&&(x[0]=new Date(x[0]),x[1]=new Date(x[1])),x&&!(y&&y[0].valueOf()===x[0].valueOf()&&y[1].valueOf()===x[1].valueOf())?this.model.set({initialZoomDomain:X([],x),zoomDomain:x?X([],x):v},{skipUpdate:!0}):x===null&&y!==null&&this.model.set({initialZoomDomain:null,zoomDomain:X([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(be(g,E=>E.value));const S=this.model.get("zoomDomain");if(s===Pe.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,c,l),a)){const E=a.highlightStartMapsTo,T=a.highlightEndMapsTo,k=a.color,I=a.labelMapsTo;a.data.forEach(($,M)=>{L.appendOrSelect(h,`rect.highlight-${M}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale($[E])).attr("width",this.xScale($[T])-this.xScale($[E])).style("fill",k&&k.scale[$[I]]?k.scale[$[I]]:null).style("fill-opacity",.1).style("stroke",k&&k.scale[$[I]]?k.scale[$[I]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(S,c,l);const _=L.appendOrSelect(n,this.brushSelector).call(this.brush);if(S!==void 0)if(S[0].valueOf()===S[1].valueOf())_.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const E=S.map(T=>this.xScale(T));E[1]-E[0]<this.MIN_SELECTION_DIFF||(_.call(this.brush.move,E),this.updateBrushHandle(this.getComponentContainer(),E))}r&&(this.brush.filter(()=>!1),_.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,i){const r=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=b(this.getOptions(),"zoomBar",B.TOP,"type"),a=ue.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=O.ZoomBar.SELECTION_START:t.type==="brush"?a=O.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=O.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(O.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:r,newDomain:s})}}updateBrushHandle(t,n){const i=this,r=ue.handleWidth,s=b(this.getOptions(),"zoomBar",B.TOP,"type"),a=ue.height[s],o=-r/2,l=ue.handleBarWidth,c=s===Pe.GRAPH_VIEW?ue.handleBarHeight:6,u=-l/2,h=(a-c)/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",l).attr("height",c).attr("cursor","ew-resize"),s===Pe.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=b(this.getOptions(),"zoomBar",B.TOP,"type"),i=ue.height[n],r=this.getComponentContainer().select("svg.zoom-container");L.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(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,y,x)=>S=>s.getValueFromScale(v,y,x,S),h=u(this.xScale,l,a),d=u(this.yScale,c,o),f=b(this.getOptions(),"zoomBar",B.TOP,"type"),p=ue.height[f],m=hl().x(v=>h(v)).y0(p).y1(v=>p-d(v)),g=L.appendOrSelect(t,n).datum(i).attr("d",m);r&&g.attr("clip-path",`url(#${r})`)}updateClipPath(t,n,i,r,s,a){const o=L.appendOrSelect(t,"clipPath").attr("id",n);L.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=rn(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=b(this.model.getOptions(),"zoomBar",B.TOP,"type"),a=ue.height[s],o=ur()([[n,a],[i,a]]);L.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),L.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),b(this.getOptions(),"zoomBar",B.TOP,"type")===Pe.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,i,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(O.ZoomBar.UPDATE,this.render.bind(this))}}class VR extends lt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=q.SVG,this.positionService=new Na}render(t=!1){const n=b(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(c=>{if(Object.values(B).includes(c)){const u=n[c];u.thresholds&&u.thresholds.length>0&&i.push({axisPosition:c,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,c=>c.axisPosition);r.exit().attr("opacity",0).remove();const s=r.enter().append("g").merge(r);s.attr("class",c=>`axis-thresholds ${c.axisPosition}`);const a=s.selectAll("g.threshold-group").data(c=>c.thresholds.map(u=>(u.axisPosition=c.axisPosition,u.datum=this.constructDatumObj(c,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 l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getScaleByPosition(c),h=l.services.cartesianScales.getScaleTypeByPosition(c);let d=null,f=null;c===B.LEFT||c===B.RIGHT?(f=u,d=l.services.cartesianScales.getMainXScale()):(d=u,f=l.services.cartesianScales.getMainYScale());const p=h===W.LABELS,[m,g]=d.range(),[v,y]=f.range(),{cartesianScales:x}=l.services,S=x.getOrientation(),_=$=>x.getDomainValue($),E=$=>x.getRangeValue($),[T,k]=an(_,E,S),I=D(this);c===B.TOP||c===B.BOTTOM?(I.selectAll("line.threshold-line").transition().call($=>l.services.transitions.setupTransition({transition:$,name:"threshold-line-update",animate:t})).attr("y1",y).attr("y2",v).attr("x1",({datum:$})=>T($)+(p?u.step()/2:0)).attr("x2",({datum:$})=>T($)+(p?u.step()/2:0)).style("stroke",({fillColor:$})=>$),I.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:$})=>-T($)).attr("width",Math.abs(v-y)).classed("rotate",!0)):(I.selectAll("line.threshold-line").transition().call($=>l.services.transitions.setupTransition({transition:$,name:"threshold-line-update",animate:t})).attr("x1",m).attr("x2",g).attr("y1",({datum:$})=>k($)+(p?u.step()/2:0)).attr("y2",({datum:$})=>k($)+(p?u.step()/2:0)).style("stroke",({fillColor:$})=>$),I.selectAll("rect.threshold-hoverable-area").attr("x",m).attr("y",({datum:$})=>k($)).attr("width",Math.abs(g-m)).classed("rotate",!1))}),this.services.events.addEventListener(O.Threshold.SHOW,c=>{this.setThresholdLabelPosition(c.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(O.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)===W.TIME){const s=[B.LEFT,B.RIGHT].includes(i),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),l=s?o:a,c=b(r,"timeScale"),u=Zl(l.ticks(),b(c,"timeInterval"));return Yl(n,0,l.ticks(),u,c)}return n.toLocaleString("en")}appendThresholdLabel(){const t=D(this.services.domUtils.getHolder()),n=b(this.getOptions(),"style","prefix");this.label=L.appendOrSelect(t,`div.${ne}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const i=this.services.domUtils.getHolder(),r=Sn(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,[Ft.RIGHT,Ft.LEFT,Ft.TOP,Ft.BOTTOM],()=>({top:void 0,left:void 0,width:i.offsetWidth,height:i.offsetHeight})),l=this.positionService.findPositionAt({left:r[0],top:r[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const i={};return t.correspondingDatasets&&(i.group=b(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){D(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(O.Threshold.SHOW,{event:n,hoveredElement:D(this),datum:D(this).datum()})}).on("mouseout",function(n){D(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(O.Threshold.HIDE,{event:n,hoveredElement:D(this),datum:D(this).datum()})})}}class HR extends lt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=q.SVG,this.positionService=new Na,this.highlightStrokeWidth=1}render(t=!1){const n=b(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(c=>{if(Object.values(B).includes(c)){const u=n[c];u.highlights&&u.highlights.data.length>0&&i.push({axisPosition:c,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,c=>c.axisPosition);r.exit().attr("opacity",0).remove();const s=r.enter().append("g").merge(r);s.attr("class",c=>`axis-highlight ${c.axisPosition}`);const a=s.selectAll("g.highlight-group").data(c=>c.highlight.map(u=>(u.axisPosition=c.axisPosition,u.highlightStartMapsTo=c.highlightStartMapsTo,u.labelMapsTo=c.labelMapsTo,u.color=c.color,u.highlightEndMapsTo=c.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 l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getMainXScale(),h=l.services.cartesianScales.getMainYScale(),[d,f]=u.range(),[p,m]=h.range(),{cartesianScales:g}=l.services,v=g.getOrientation(),y=T=>g.getDomainValue(T),x=T=>g.getRangeValue(T),[S,_]=an(y,x,v),E=D(this);c===B.TOP||c===B.BOTTOM?E.selectAll("rect.highlight-bar").transition().call(T=>l.services.transitions.setupTransition({transition:T,name:"highlight-bar-update",animate:t})).attr("y",Math.max(m+l.highlightStrokeWidth,0)).attr("height",Math.max(p-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:T,...k})=>S(k[T])).attr("width",({highlightStartMapsTo:T,highlightEndMapsTo:k,...I})=>Math.max(S(I[k])-S(I[T]),0)).style("stroke",({color:T,labelMapsTo:k,...I})=>T&&T.scale[I[k]]?T.scale[I[k]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:T,labelMapsTo:k,...I})=>T&&T.scale[I[k]]?T.scale[I[k]]:null):E.selectAll("rect.highlight-bar").transition().call(T=>l.services.transitions.setupTransition({transition:T,name:"highlight-bar-update",animate:t})).attr("x",d).attr("width",Math.max(f-d,0)).attr("y",({highlightEndMapsTo:T,...k})=>_(k[T])).attr("height",({highlightStartMapsTo:T,highlightEndMapsTo:k,...I})=>Math.max(_(I[T])-_(I[k]),0)).style("stroke",({color:T,labelMapsTo:k,...I})=>T&&T.scale[I[k]]?T.scale[I[k]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:T,labelMapsTo:k,...I})=>T&&T.scale[I[k]]?T.scale[I[k]]:null)})}}class um extends Tc{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,l=r.getDomainLabel();let c=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]]});c=r.getScaleLabel(m)}const p=d[f];h=[{label:l,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:c,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:[Z.TOOLTIP],dataGroupName:d[o]})})}else if(n.length>1&&(h=[{label:l,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:[Z.TOOLTIP],dataGroupName:d[o]})}}).sort((d,f)=>f.value-d.value)),!a&&b(i,"tooltip","showTotal")===!0)){const d=r.getRangeIdentifier();h.push({label:_t(i,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[d],0),bold:!0})}return h}}class GR extends lt{constructor(){super(...arguments),this.type="alluvial",this.renderType=q.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}=L.getSVGElementSize(n,{useAttrs:!0});if(i<1||r<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=b(this.getOptions(),"color","gradient","enabled");let l=Me.minNodePadding;s.alluvial.nodePadding>Me.minNodePadding&&(l=s.alluvial.nodePadding);const c=b(s,"alluvial","nodeAlignment");let u=mg;c===It.LEFT?u=GL:c===It.RIGHT&&(u=FL);const h=qL().nodeId(g=>g.name).nodeWidth(Me.nodeWidth).nodePadding(l).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 y=this.services.domUtils.generateElementIDString(`alluvial-category-${v}`),{width:x}=L.getSVGElementSize(D(`text#${y}`),{useBBox:!0});let S=0;return g+S>=x&&(S=-x+4),S});const f=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(f.exit().remove(),o){const g=b(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",y=>g[y.source.name])).call(v=>v.append("stop").attr("offset","100%").attr("stop-color",y=>g[y.target.name])),f.exit().remove()}f.enter().append("path").classed("link",!0).attr("d",sD()).attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-line-${g.index}`)).attr("class",g=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[Z.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[Z.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",Me.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 y=this.services.domUtils.generateElementIDString(`alluvial-node-text-${v}`),{width:x}=L.getSVGElementSize(D(`text#${y}`),{useBBox:!0});return x+8}).attr("height",18).attr("stroke-width",2).lower(),m.attr("transform",(g,v)=>{const y=this.services.domUtils.generateElementIDString(`alluvial-node-text-${v}`),{width:x}=L.getSVGElementSize(D(`text#${y}`),{useBBox:!0}),S=(g.y1-g.y0)/2-9;let _=g.x1-g.x0;return g.x1>=x?_=_-(x+16):_+=4,`translate(${_}, ${S})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,i=ba((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"?(D(r).lower(),a.style("stroke-opacity",Me.opacity.default)):a.style("stroke-opacity",function(){return r===this?(D(this).raise(),Me.opacity.selected):Me.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(r,s){const a=D(this);i(this,"mouseover"),a.classed("link-hovered",!0);const o=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEOVER,{event:r,element:a,datum:s}),n.services.events.dispatchEvent(O.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(O.Alluvial.LINE_MOUSEMOVE,{event:r,element:D(this),datum:s}),n.services.events.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,s){n.services.events.dispatchEvent(O.Alluvial.LINE_CLICK,{event:r,element:D(this),datum:s})}).on("mouseout",function(r,s){const a=D(this);i(this,"mouseout"),a.classed("link-hovered",!1),n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEOUT,{event:r,element:a,datum:s}),n.services.events.dispatchEvent(O.Tooltip.HIDE,{event:r,hoveredElement:a})})}addNodeEventListener(){const t=this,n=ba((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",Me.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)?(D(this).classed("link-hovered",!0).raise(),Me.opacity.selected):Me.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(i,r){const s=D(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},r,a),t.traverse({link:"targetLinks",node:"source"},r,a),a.length){const o=$r(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 c=t.services.domUtils.generateElementIDString(`alluvial-node-title-${r.index}`),u=t.parent.select(`g#${c}`),h=$r(u.attr("transform"));u.attr("transform",`translate(${h.x+4},${h.y})`)}const l=t.services.domUtils.generateElementIDString(`alluvial-node-text-${r.index}`);t.parent.select(`text#${l}`).style("font-weight","bold"),n(a,"mouseover"),t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEOVER,{event:i,element:s,datum:r})}}).on("mousemove",function(i,r){t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEMOVE,{event:i,element:D(this),datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(O.Alluvial.NODE_CLICK,{event:i,element:D(this),datum:r})}).on("mouseout",function(i,r){const s=D(this),a=$r(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",Me.nodeWidth),r.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${r.index}`),c=t.parent.select(`g#${l}`),u=$r(c.attr("transform"));c.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(O.Alluvial.NODE_MOUSEOUT,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(O.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 r=this.getOptions(),i=b(r,"tooltip","valueFormatter");if(i)return i(t,n);if(typeof t.getTime=="function")return mr(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 mr(Date.parse(t),"MMM d, yyyy")}catch{}return t.toLocaleString()}render(t=!1){const n=this.getOptions(),r=b(n,"tooltip","enabled");if(r){const i=D(this.services.domUtils.getHolder()),s=b(n,"style","prefix");this.tooltip=L.appendOrSelect(i,`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!r&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=this.tooltip.node(),i=this.getOptions(),s=b(i,"zoomBar","top","enabled");let a=b(t,"detail","mousePosition");if(!a)a=Sn(b(t,"detail","event"),n);else{const d=b(i,"zoomBar","top","type"),f=ce.height[d];s&&(a[1]+=f+ce.spacerHeight)}const o=n.offsetWidth,l=n.offsetHeight;let c;a[0]/o>.9?c=Ft.LEFT:a[0]/o<.1?c=Ft.RIGHT:c=this.positionService.findBestPlacementAt({left:a[0],top:a[1]},r,[Ft.RIGHT,Ft.LEFT,Ft.TOP,Ft.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:l}));let{horizontalOffset:u}=iO;c===Ft.LEFT&&(u*=-1);const h=this.positionService.findPositionAt({left:a[0]+u,top:a[1]},r,c);this.positionService.setElement(r,h)}}const cm=class Ua extends lt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=q.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer();if(!n)throw new Error("SVG was not defined");const i=L.appendOrSelect(n,"svg.chart-grid-backdrop"),s=L.appendOrSelect(i,`g.${this.type}`),a=L.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=L.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),h=c.getMainXScale(),[d]=h.range();r.attr("transform",`translate(${d},0)`);const f=L.appendOrSelect(r,this.frontSelectionSelector);if(h&&u===W.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 E=_[1]-_[0];let T="0,"+E.toString();const k=Math.floor(l/Ua.DASH_LENGTH),I=k*Ua.DASH_LENGTH;for(let $=0;$<k;$++)T+=","+Ua.DASH_LENGTH;T+=","+(l-I),k%2===1&&(T+=",0"),T+=","+E.toString(),T+=","+l.toString(),f.attr("stroke-dasharray",T)},g=_=>{const E=_.selection;E===null||E[0]===E[1]||(f.attr("x",parseFloat(a.attr("x"))+parseFloat(i.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),m(E))},v=(_,E)=>{const T=bd().range([0,o]).domain(p);let k=[T.invert(_),T.invert(E)];k[0].valueOf()===k[1].valueOf()&&(k=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==k[0].valueOf()||p[1].valueOf()!==k[1].valueOf())&&this.services.zoom.handleDomainChange(k)};let y;const x=_=>{const E=_.selection;E!==null&&(v(E[0],E[1]),s.call(y.move,null),f.style("display","none"))};l!=0&&o!=0&&(y=Pu().extent([[0,0],[o-1,l]]).on("start brush end",g).on("end.brushed",x),s.call(y));const S=this.services.zoom.getZoomRatio();i.on("click",function(_){if(_.shiftKey){const E=this.services.domUtils.getHolder(),T=Sn(s.node(),E)[0];let k=T-o*S/2;k<0&&(k=0);let I=T+o*S/2;I>o&&(I=o),v(k,I)}})}}};cm.DASH_LENGTH=4;let HR=cm;class GR extends lt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=q.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=Pu(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(O.ZoomBar.UPDATE,this.render.bind(this));const t=b(this.getOptions(),"zoomBar",B.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),r=this.services.zoom.isZoomBarLoading(B.TOP),i=this.services.zoom.isZoomBarLocked(B.TOP),s=b(this.getOptions(),"zoomBar",B.TOP,"type"),a=b(this.getOptions(),"axes",B.BOTTOM,"highlights"),o=ce.height[s],{width:l}=L.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const h=L.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(L.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===Pe.GRAPH_VIEW?L.appendOrSelect(h,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Pe.SLIDER_VIEW&&L.appendOrSelect(h,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(h,c,l);return}const{cartesianScales:d}=this.services,f=d.getMainXScale(),p=d.getMainYScale(),m=d.getMainXScaleType();if(f&&m===W.TIME){let g=this.services.zoom.getZoomBarData();if(Ae(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 y=this.model.get("initialZoomDomain"),x=b(this.getOptions(),"zoomBar",B.TOP,"initialZoomDomain");x&&x[0]&&x[1]&&(x[0]=new Date(x[0]),x[1]=new Date(x[1])),x&&!(y&&y[0].valueOf()===x[0].valueOf()&&y[1].valueOf()===x[1].valueOf())?this.model.set({initialZoomDomain:Z([],x),zoomDomain:x?Z([],x):v},{skipUpdate:!0}):x===null&&y!==null&&this.model.set({initialZoomDomain:null,zoomDomain:Z([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(be(g,E=>E.value));const S=this.model.get("zoomDomain");if(s===Pe.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,c,l),a)){const E=a.highlightStartMapsTo,T=a.highlightEndMapsTo,k=a.color,I=a.labelMapsTo;a.data.forEach(($,M)=>{L.appendOrSelect(h,`rect.highlight-${M}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale($[E])).attr("width",this.xScale($[T])-this.xScale($[E])).style("fill",k&&k.scale[$[I]]?k.scale[$[I]]:null).style("fill-opacity",.1).style("stroke",k&&k.scale[$[I]]?k.scale[$[I]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(S,c,l);const _=L.appendOrSelect(n,this.brushSelector).call(this.brush);if(S!==void 0)if(S[0].valueOf()===S[1].valueOf())_.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const E=S.map(T=>this.xScale(T));E[1]-E[0]<this.MIN_SELECTION_DIFF||(_.call(this.brush.move,E),this.updateBrushHandle(this.getComponentContainer(),E))}i&&(this.brush.filter(()=>!1),_.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=b(this.getOptions(),"zoomBar",B.TOP,"type"),a=ce.height[s];this.brush.extent([[n,0],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),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=O.ZoomBar.SELECTION_START:t.type==="brush"?a=O.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=O.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(O.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=ce.handleWidth,s=b(this.getOptions(),"zoomBar",B.TOP,"type"),a=ce.height[s],o=-i/2,l=ce.handleBarWidth,c=s===Pe.GRAPH_VIEW?ce.handleBarHeight:6,u=-l/2,h=(a-c)/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,r.maxSelectionRange[0]);if(f.type==="e")return Math.min(n[1]+o,r.maxSelectionRange[1]-i)}).attr("y",0).attr("width",i).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,r.maxSelectionRange[0]-o+u);if(f.type==="e")return Math.min(n[1]+u,r.maxSelectionRange[1]+o+u)}).attr("y",h).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Pe.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=b(this.getOptions(),"zoomBar",B.TOP,"type"),r=ce.height[n],i=this.getComponentContainer().select("svg.zoom-container");L.appendOrSelect(i,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",r/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,r,i){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,y,x)=>S=>s.getValueFromScale(v,y,x,S),h=u(this.xScale,l,a),d=u(this.yScale,c,o),f=b(this.getOptions(),"zoomBar",B.TOP,"type"),p=ce.height[f],m=hl().x(v=>h(v)).y0(p).y1(v=>p-d(v)),g=L.appendOrSelect(t,n).datum(r).attr("d",m);i&&g.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=L.appendOrSelect(t,"clipPath").attr("id",n);L.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=rn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=b(this.model.getOptions(),"zoomBar",B.TOP,"type"),a=ce.height[s],o=ui()([[n,a],[r,a]]);L.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){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),L.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),b(this.getOptions(),"zoomBar",B.TOP,"type")===Pe.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(O.ZoomBar.UPDATE,this.render.bind(this))}}class FR extends lt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=q.SVG,this.positionService=new Na}render(t=!1){const n=b(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(B).includes(c)){const u=n[c];u.thresholds&&u.thresholds.length>0&&r.push({axisPosition:c,thresholds:u.thresholds,correspondingDatasets:u==null?void 0:u.correspondingDatasets,mapsTo:u==null?void 0:u.mapsTo})}});const i=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-thresholds ${c.axisPosition}`);const a=s.selectAll("g.threshold-group").data(c=>c.thresholds.map(u=>(u.axisPosition=c.axisPosition,u.datum=this.constructDatumObj(c,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 l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getScaleByPosition(c),h=l.services.cartesianScales.getScaleTypeByPosition(c);let d=null,f=null;c===B.LEFT||c===B.RIGHT?(f=u,d=l.services.cartesianScales.getMainXScale()):(d=u,f=l.services.cartesianScales.getMainYScale());const p=h===W.LABELS,[m,g]=d.range(),[v,y]=f.range(),{cartesianScales:x}=l.services,S=x.getOrientation(),_=$=>x.getDomainValue($),E=$=>x.getRangeValue($),[T,k]=an(_,E,S),I=D(this);c===B.TOP||c===B.BOTTOM?(I.selectAll("line.threshold-line").transition().call($=>l.services.transitions.setupTransition({transition:$,name:"threshold-line-update",animate:t})).attr("y1",y).attr("y2",v).attr("x1",({datum:$})=>T($)+(p?u.step()/2:0)).attr("x2",({datum:$})=>T($)+(p?u.step()/2:0)).style("stroke",({fillColor:$})=>$),I.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:$})=>-T($)).attr("width",Math.abs(v-y)).classed("rotate",!0)):(I.selectAll("line.threshold-line").transition().call($=>l.services.transitions.setupTransition({transition:$,name:"threshold-line-update",animate:t})).attr("x1",m).attr("x2",g).attr("y1",({datum:$})=>k($)+(p?u.step()/2:0)).attr("y2",({datum:$})=>k($)+(p?u.step()/2:0)).style("stroke",({fillColor:$})=>$),I.selectAll("rect.threshold-hoverable-area").attr("x",m).attr("y",({datum:$})=>k($)).attr("width",Math.abs(g-m)).classed("rotate",!1))}),this.services.events.addEventListener(O.Threshold.SHOW,c=>{this.setThresholdLabelPosition(c.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(O.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:r}=t,i=this.getOptions();if(this.services.cartesianScales.getScaleTypeByPosition(r)===W.TIME){const s=[B.LEFT,B.RIGHT].includes(r),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),l=s?o:a,c=b(i,"timeScale"),u=Xl(l.ticks(),b(c,"timeInterval"));return Yl(n,0,l.ticks(),u,c)}return n.toLocaleString("en")}appendThresholdLabel(){const t=D(this.services.domUtils.getHolder()),n=b(this.getOptions(),"style","prefix");this.label=L.appendOrSelect(t,`div.${ne}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=Sn(t,r),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:i[0],top:i[1]},a,[Ft.RIGHT,Ft.LEFT,Ft.TOP,Ft.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=b(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){D(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(O.Threshold.SHOW,{event:n,hoveredElement:D(this),datum:D(this).datum()})}).on("mouseout",function(n){D(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(O.Threshold.HIDE,{event:n,hoveredElement:D(this),datum:D(this).datum()})})}}class zR extends lt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=q.SVG,this.positionService=new Na,this.highlightStrokeWidth=1}render(t=!1){const n=b(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(B).includes(c)){const u=n[c];u.highlights&&u.highlights.data.length>0&&r.push({axisPosition:c,highlightStartMapsTo:u.highlights.highlightStartMapsTo,highlightEndMapsTo:u.highlights.highlightEndMapsTo,labelMapsTo:u.highlights.labelMapsTo,highlight:u.highlights.data,color:u.highlights.color})}});const i=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-highlight ${c.axisPosition}`);const a=s.selectAll("g.highlight-group").data(c=>c.highlight.map(u=>(u.axisPosition=c.axisPosition,u.highlightStartMapsTo=c.highlightStartMapsTo,u.labelMapsTo=c.labelMapsTo,u.color=c.color,u.highlightEndMapsTo=c.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 l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getMainXScale(),h=l.services.cartesianScales.getMainYScale(),[d,f]=u.range(),[p,m]=h.range(),{cartesianScales:g}=l.services,v=g.getOrientation(),y=T=>g.getDomainValue(T),x=T=>g.getRangeValue(T),[S,_]=an(y,x,v),E=D(this);c===B.TOP||c===B.BOTTOM?E.selectAll("rect.highlight-bar").transition().call(T=>l.services.transitions.setupTransition({transition:T,name:"highlight-bar-update",animate:t})).attr("y",Math.max(m+l.highlightStrokeWidth,0)).attr("height",Math.max(p-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:T,...k})=>S(k[T])).attr("width",({highlightStartMapsTo:T,highlightEndMapsTo:k,...I})=>Math.max(S(I[k])-S(I[T]),0)).style("stroke",({color:T,labelMapsTo:k,...I})=>T&&T.scale[I[k]]?T.scale[I[k]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:T,labelMapsTo:k,...I})=>T&&T.scale[I[k]]?T.scale[I[k]]:null):E.selectAll("rect.highlight-bar").transition().call(T=>l.services.transitions.setupTransition({transition:T,name:"highlight-bar-update",animate:t})).attr("x",d).attr("width",Math.max(f-d,0)).attr("y",({highlightEndMapsTo:T,...k})=>_(k[T])).attr("height",({highlightStartMapsTo:T,highlightEndMapsTo:k,...I})=>Math.max(_(I[T])-_(I[k]),0)).style("stroke",({color:T,labelMapsTo:k,...I})=>T&&T.scale[I[k]]?T.scale[I[k]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:T,labelMapsTo:k,...I})=>T&&T.scale[I[k]]?T.scale[I[k]]:null)})}}class um extends Tc{getItems(t){if(t.detail.items)return t.detail.items;const n=t.detail.data;if(!n.length||!n[0])return[];const r=this.getOptions(),{cartesianScales:i}=this.services,s=i.getDomainIdentifier(),a=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][s];let h;if(n.length===1){const d=n[0],f=i.getRangeIdentifier(d);if(a){const m=i.getRangeAxisPosition({datum:d,groups:[d[o]]});c=i.getScaleLabel(m)}const p=d[f];h=[{label:l,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:c,value:d[f]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(m=>h.push({label:m.label,value:m.value})),h.push({label:r.tooltip.groupLabel,value:d[o],color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[X.TOOLTIP],dataGroupName:d[o]})})}else if(n.length>1&&(h=[{label:l,value:u}],h=h.concat(n.map(d=>{const f=d[i.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:[X.TOOLTIP],dataGroupName:d[o]})}}).sort((d,f)=>f.value-d.value)),!a&&b(r,"tooltip","showTotal")===!0)){const d=i.getRangeIdentifier();h.push({label:_t(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[d],0),bold:!0})}return h}}class jR extends lt{constructor(){super(...arguments),this.type="alluvial",this.renderType=q.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.html("");const{width:r,height:i}=L.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=b(this.getOptions(),"color","gradient","enabled");let l=Me.minNodePadding;s.alluvial.nodePadding>Me.minNodePadding&&(l=s.alluvial.nodePadding);const c=b(s,"alluvial","nodeAlignment");let u=mg;c===It.LEFT?u=zL:c===It.RIGHT&&(u=jL);const h=XL().nodeId(g=>g.name).nodeWidth(Me.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);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 y=this.services.domUtils.generateElementIDString(`alluvial-category-${v}`),{width:x}=L.getSVGElementSize(D(`text#${y}`),{useBBox:!0});let S=0;return g+S>=x&&(S=-x+4),S});const f=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(f.exit().remove(),o){const g=b(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",y=>g[y.source.name])).call(v=>v.append("stop").attr("offset","100%").attr("stop-color",y=>g[y.target.name])),f.exit().remove()}f.enter().append("path").classed("link",!0).attr("d",oD()).attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-line-${g.index}`)).attr("class",g=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[X.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[X.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",Me.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 y=this.services.domUtils.generateElementIDString(`alluvial-node-text-${v}`),{width:x}=L.getSVGElementSize(D(`text#${y}`),{useBBox:!0});return x+8}).attr("height",18).attr("stroke-width",2).lower(),m.attr("transform",(g,v)=>{const y=this.services.domUtils.generateElementIDString(`alluvial-node-text-${v}`),{width:x}=L.getSVGElementSize(D(`text#${y}`),{useBBox:!0}),S=(g.y1-g.y0)/2-9;let _=g.x1-g.x0;return g.x1>=x?_=_-(x+16):_+=4,`translate(${_}, ${S})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,r=xa((i,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"?(D(i).lower(),a.style("stroke-opacity",Me.opacity.default)):a.style("stroke-opacity",function(){return i===this?(D(this).raise(),Me.opacity.selected):Me.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(i,s){const a=D(this);r(this,"mouseover"),a.classed("link-hovered",!0);const o=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEOVER,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:s.target.name,value:s.value+(t.alluvial.units?` ${t.alluvial.units}`:""),color:o,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(i,s){n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEMOVE,{event:i,element:D(this),datum:s}),n.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,s){n.services.events.dispatchEvent(O.Alluvial.LINE_CLICK,{event:i,element:D(this),datum:s})}).on("mouseout",function(i,s){const a=D(this);r(this,"mouseout"),a.classed("link-hovered",!1),n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEOUT,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(O.Tooltip.HIDE,{event:i,hoveredElement:a})})}addNodeEventListener(){const t=this,n=xa((r=[],i="mouseover")=>{if(i==="mouseout"||r.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,s=>s.index).order().style("stroke-opacity",Me.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 r.some(a=>a===s.index)?(D(this).classed("link-hovered",!0).raise(),Me.opacity.selected):Me.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const s=D(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=$i(s.attr("transform"));if(s.attr("transform",`translate(${o.x-2}, ${o.y})`),s.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),i.x0-2===0){const c=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),u=t.parent.select(`g#${c}`),h=$i(u.attr("transform"));u.attr("transform",`translate(${h.x+4},${h.y})`)}const l=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${l}`).style("font-weight","bold"),n(a,"mouseover"),t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEOVER,{event:r,element:s,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEMOVE,{event:r,element:D(this),datum:i}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(O.Alluvial.NODE_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){const s=D(this),a=$i(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",Me.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=$i(c.attr("transform"));c.attr("transform",`translate(${u.x-4},${u.y})`)}const o=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${o}`).style("font-weight","normal"),n([],"mouseout"),t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,r=[]){n[t.link].map(i=>(r.push(i.index),i[t.node])).forEach(i=>this.traverse(t,i,r))}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 de extends lt{constructor(){super(...arguments),this.type="grid",this.renderType=q.SVG}render(t=!0){const n=b(this.getOptions(),"grid","x","enabled"),i=b(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,i),!(!n&&!i)&&(n&&(L.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),i&&(L.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=ja(r).tickSizeInner(-i).tickSizeOuter(0);if(b(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=b(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=b(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=Gc(r).tickSizeInner(-i).tickSizeOuter(0);if(b(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=b(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=b(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(sn(u).tx)-Number(sn(h).tx));let r=-1;if(!i.length)return;i.forEach(u=>{t[0]>=+sn(u).tx&&r++});const s=r+1<i.length?r+1:i.length,a=i[r],o=i[s];let l;if(!a)l=+sn(o).tx;else if(o)l=+sn(o).tx-+sn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=L.getSVGElementSize(u).width-+sn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=b(this.getOptions,"tooltip","gridline","threshold"),i=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const r=sn(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(),[l,c]=s.range();this.backdrop=L.appendOrSelect(i,"svg.chart-grid-backdrop");const u=L.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class hm extends lt{constructor(){super(...arguments),this.type="area",this.renderType=q.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?Je.opacity.unselected:Je.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",Je.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.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=hl().curve(this.services.curves.getD3Curve()).defined(_=>{const E=s.getRangeIdentifier();return _[E]!=null}),l=this.model.getGroupedData(this.configs.groups),c=b(i,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let h=0;const d=(_,E)=>{b(i,"axes",_,"includeZero")===!1&&E[0]>0&&E[1]>0&&(h=E[0])},f=_=>u?s.getBoundedScaledValues(_)[0]:s.getRangeValue(h),p=_=>u?s.getBoundedScaledValues(_)[1]:s.getRangeValue(_);a===Vt.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=b(i,"color","gradient","enabled"),g=l&&l.length===1&&m;l.length>1&&m&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,_=>_.name),y=D(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(g){const _=y.select(`path.${this.model.getColorClassName({classNameTypes:[Z.STROKE],dataGroupName:l[0].name})}`).node();let E;if(_)E=getComputedStyle(_,null).getPropertyValue("stroke");else{const T=b(this.model.getOptions(),"color","scale");if(T!==null){const k=Object.keys(T);E=T[k[0]]}}nc.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${l[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:nc.getStops(r,E)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const x=this,S=v.enter().append("path");g?S.merge(v).style("fill",_=>`url(#${this.services.domUtils.generateElementIDString(`${_.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[Z.FILL],dataGroupName:_.name,originalClassName:"area"})).attr("d",_=>{const{data:E}=_;return o(E)}):(S.attr("opacity",0).merge(v).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[Z.FILL,Z.STROKE],dataGroupName:_.name,originalClassName:"area"})).style("fill",_=>x.model.getFillColor(_.name)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"area-update-enter",animate:t})).attr("opacity",u?1:Je.opacity.selected).attr("d",_=>{const{data:E}=_;return o(E)}),u&&S.attr("fill-opacity",Je.opacity.selected).style("stroke",_=>x.model.getStrokeColor(_.name)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class $i extends lt{constructor(){super(...arguments),this.type="line",this.renderType=q.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?tn.opacity.unselected:tn.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",tn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.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,l]=an(s,a,i.getOrientation()),c=this.getOptions(),u=ur().x(o).y(l).curve(r.getD3Curve()).defined(f=>{const p=i.getRangeIdentifier(f);return f[p]!=null});let h=[];if(this.configs.stacked){const f=Object.keys(c.axes).some(m=>c.axes[m].percentage),{groupMapsTo:p}=c.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:b(m,0,p),data:m.map(y=>({[g]:y.data.sharedStackKey,[p]:y[p],[v]:y[1]})),hidden:!Ek(m,y=>y[0]!==y[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:[Z.STROKE],dataGroupName:f.name,originalClassName:"line"})).style("stroke",f=>this.model.getStrokeColor(f.name)).attr("role",rt.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const dm=5;function FR(e,t){return e>t-dm&&e<t+dm}let xn=class extends lt{constructor(){super(...arguments),this.type="ruler",this.renderType=q.SVG,this.isXGridEnabled=b(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=b(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=b(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(),[l,c]=o.range(),u=s===Vt.HORIZONTAL?i:n,h=L.appendOrSelect(r,"g.ruler").attr("aria-label","ruler"),d=L.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=>FR(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(O.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 y=g[0].domainValue,x=Math.abs(u-v.domainValue),S=Math.abs(u-y);return x>S||(x<S?g=[v]:g.push(v)),g},[]);if(m.length>0){const g=m.map(S=>S.originalData).filter(S=>{const _=this.services.cartesianScales.getRangeIdentifier(S);return S[_]!=null}),v=m.map(S=>S.domainValue),y=f.filter(S=>{const _=this.services.cartesianScales.getDomainValue(S);return v.includes(_)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Wg(this.elementsToHighlight,y)&&this.hideRuler(),y.dispatch("mouseover"),this.elementsToHighlight=y,this.services.events.dispatchEvent(O.Tooltip.SHOW,{mousePosition:[n,i],hoveredElement:d,data:this.formatTooltipData(g)}),h.attr("opacity",1);const x=m[0];s==="horizontal"?d.attr("x1",c).attr("x2",l).attr("y1",x.domainValue).attr("y2",x.domainValue):d.attr("y1",c).attr("y2",l).attr("x1",x.domainValue).attr("x2",x.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=L.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(O.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=Sn(s,t.parent.node());t.showRuler(s,a)};if(i.length>100){const s=i.length%50*12.5;r=N$(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=L.appendOrSelect(t,"svg.chart-grid-backdrop")}};class Ve extends lt{constructor(){super(...arguments),this.type="scatter",this.renderType=q.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(O.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(O.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(!(b(this.getOptions(),"points","enabled")||b(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(),c=>`${c[r]}-${c[a]}`);o.exit().attr("opacity",0).remove();const l=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(l,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]=an(i.getHighestDomainThreshold(),i.getHighestRangeThreshold(),r),[o,l]=an(h=>i.getDomainValue(h),h=>i.getRangeValue(h),r),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=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,l=f=>a.getDomainValue(f),c=f=>a.getRangeValue(f),[u,h]=an(l,c,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)?[Z.FILL,Z.STROKE]:[Z.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",rt.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=D(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[Z.FILL],dataGroupName:l[n],originalClassName:o.attr("class")})).style("fill",l=>{var c;const u=(c=t.services.cartesianScales)==null?void 0:c.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[u],l)}).classed("unfilled",!1),(s=t.services.events)==null||s.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:o,data:[r],additionalItems:t.getTooltipAdditionalItems(r)}),(a=t.services.events)==null||a.dispatchEvent(O.Scatter.SCATTER_MOUSEOVER,{event:i,element:o,datum:r})}).on("mousemove",function(i,r){var s,a;const o=D(this);(s=t.services.events)==null||s.dispatchEvent(O.Scatter.SCATTER_MOUSEMOVE,{event:i,element:o,datum:r}),(a=t.services.events)==null||a.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,r){var s;(s=t.services.events)==null||s.dispatchEvent(O.Scatter.SCATTER_CLICK,{event:i,element:D(this),datum:r})}).on("mouseout",function(i,r){var s,a,o;const l=D(this);if(l.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(s=t.services.cartesianScales)==null?void 0:s.getDomainIdentifier(r),h=t.model.getIsFilled(r[n],r[u],r,c);l.classed("unfilled",!h).style("fill",d=>h||c?t.model.getFillColor(d[n],d[u],d):null)}(a=t.services.events)==null||a.dispatchEvent(O.Scatter.SCATTER_MOUSEOUT,{event:i,element:l,datum:r}),(o=t.services.events)==null||o.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:l})})}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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(O.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(O.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}let fm=class extends lt{constructor(t,n,i){super(t,n,i),this.type="axes",this.renderType=q.SVG,this.truncation={[B.LEFT]:!1,[B.RIGHT]:!1,[B.TOP]:!1,[B.BOTTOM]:!1},i&&(this.configs=i),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,i=this.getOptions(),r=b(i,"axes",n,"visible"),s=this.getComponentContainer(),{width:a,height:o}=L.getSVGElementSize(s,{useAttrs:!0}),l=L.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===B.BOTTOM||n===B.TOP?(c=this.configs.axes[B.LEFT]?this.margins.left:0,u=this.configs.axes[B.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const h=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===W.LABELS||this.scaleType===W.LABELS_RATIO?h.rangeRound([c,u]):h.range([c,u]);let d;switch(n){case B.LEFT:d=Gc;break;case B.BOTTOM:d=ja;break;case B.RIGHT:d=Wv;break;case B.TOP:d=jv;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=L.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${rt.GRAPHICS_OBJECT} ${rt.GROUP}`),p.attr("aria-label",`${n} ticks`));const m=L.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),g=b(i,"axes",n),v=this.scaleType===W.TIME||g.scaleType===W.TIME,y=n===B.LEFT||n===B.RIGHT,x=this.model.get("zoomDomain");if(x&&v&&!y&&h.domain(x),!r){p.attr("aria-hidden",!0);return}const S=b(g,"scaleType"),_=b(i,"data","loading"),E=b(g,"ticks","number"),T=b(g,"ticks","values"),k=b(g,"truncation","type"),I=b(g,"truncation","threshold"),$=b(g,"truncation","numCharacter"),M=E!==null,V=b(i,"timeScale"),C=L.appendOrSelect(m,"g.tick"),A=L.appendOrSelect(C,"text").text("0"),w=L.getSVGElementSize(A.node(),{useBBox:!0}).height;C.remove();const N=this.scaleType||g.scaleType||W.LINEAR,P=d(h).tickSizeOuter(0);if(h.ticks){let G;if(M?G=E:(G=gn.ticks.number,y&&(G=this.getNumberOfFittingTicks(o,w,gn.ticks.verticalSpaceRatio))),h.ticks().length===1&&h.ticks()[0]===0&&(G=0),P.ticks(G),v)if(!h.ticks(G).length)P.tickValues([]);else{const Y=b(i,"timeScale","addSpaceOnEdges"),ct=b(i,"axes",n,"domain"),et=h.copy();Y&&!ct&&et.nice(G);const Lt=et.ticks(G);Y&&Lt.length>2&&!ct&&(Lt.splice(Lt.length-1,1),Lt.splice(0,1)),P.tickValues(Lt)}}let R;const U=b(g,"ticks","formatter");if(v){const G=Zl(P.tickValues(),b(i,"timeScale","timeInterval"));U===null?R=(Y,ct)=>Yl(Y,ct,P.tickValues(),G,V):R=(Y,ct)=>{const et=Yl(Y,ct,P.tickValues(),G,V);return U(Y,ct,et)}}else U===null?N===W.LINEAR&&(R=G=>G.toLocaleString()):R=U;P.tickFormat(R);const[F,j]=this.services.cartesianScales.getScaleByPosition(n).domain();let K;if(T){if(v)T.forEach((G,Y)=>{G.getTime===void 0&&(T[Y]=new Date(G))}),K=T.filter(G=>{const Y=G.getTime();return Y>=new Date(F).getTime()&&Y<=new Date(j).getTime()});else if(S===W.LABELS){const G=this.services.cartesianScales.getScaleByPosition(n).domain();K=T.filter(Y=>G.includes(Y))}else K=T.filter(G=>G>=F&&G<=j);P.tickValues(K)}switch(n){case B.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case B.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case B.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case B.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const ut=this.model.isDataEmpty();if(g.title){const G=L.appendOrSelect(l,"text.axis-title").html(ut||_?"":g.title),Y=b(g,"titleOrientation");let ct;switch(n){case B.LEFT:Y===bl.RIGHT?G.attr("transform","rotate(90)").attr("y",0).attr("x",h.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):G.attr("transform","rotate(-90)").attr("y",0).attr("x",-(h.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case B.BOTTOM:G.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case B.RIGHT:Y===bl.LEFT?G.attr("transform","rotate(-90)").attr("y",a).attr("x",-(h.range()[0]/2)).style("text-anchor","middle"):G.attr("transform","rotate(90)").attr("y",-a).attr("x",h.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case B.TOP:ct=L.getSVGElementSize(G,{useBBox:!0}).height,G.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${ct/2})`).style("text-anchor","middle");break}}if(v){const G=Zl(P.tickValues(),b(i,"timeScale","timeInterval")),Y=V.showDayName,ct=p;t&&(p=p.transition().call(et=>this.services.transitions.setupTransition({transition:et,name:"axis-update",animate:t}))),p=p.call(P),ct.selectAll(".tick").data(P.tickValues(),h).order().select("text").style("font-weight",(et,Lt)=>qp(et,Lt,P.tickValues(),G,Y)?"bold":"normal")}else!t||!f?p=p.call(P):p=p.transition().call(G=>this.services.transitions.setupTransition({transition:G,name:"axis-update",animate:t})).call(P);if(m.call(P),n===B.BOTTOM||n===B.TOP){let G=!1;const Y=b(g,"ticks","rotation");if(Y===Zs.ALWAYS)G=!0;else if(Y===Zs.NEVER)G=!1;else if(!Y||Y===Zs.AUTO)if(h.step)G=m.selectAll("g.tick text").nodes().some(ct=>L.getSVGElementSize(ct,{useBBox:!0}).width>=h.step());else{G=!1;const ct=m.append("text").text("A"),et=L.getSVGElementSize(ct.node(),{useBBox:!0}).width;let Lt;m.selectAll("g.tick").each(function(){const z=D(this),Q=parseFloat(b(sn(this),"tx"));Q!==null&&Lt+z.text().length*et*.8>=Q&&(G=!0),Lt=Q}),ct.remove()}G?(M||(P.ticks(this.getNumberOfFittingTicks(a,w,gn.ticks.horizontalSpaceRatio)),m.call(P),p.call(P)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===B.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(_?l.attr("opacity",0):l.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",G=>G),m.selectAll("g.tick").attr("aria-label",G=>G),k!==Te.NONE&&S===W.LABELS&&!T){const G=this.services.cartesianScales.getScaleDomain(n);if(G.length>0){const Y=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(Y);const ct=this;l.selectAll("g.tick text").data(G).text(function(et){return et.length>I?(ct.truncation[n]=!0,Ar(et,k,$)):et}),this.getInvisibleAxisRef().selectAll("g.tick text").data(G).text(function(et){return et.length>I?Ar(et,k,$):et}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(G)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,i=L.appendOrSelect(t,`g.axis.${n}`),r=this.getOptions(),s=b(r,"axes",n),a=b(s,"scaleType"),o=b(s,"truncation","threshold"),l=this;i.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:D(this),datum:u}),a===W.LABELS&&u.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,hoveredElement:D(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:D(this),datum:u}),a===W.LABELS&&u.length>o&&l.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:D(this),datum:u}),a===W.LABELS&&l.services.events.dispatchEvent(O.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 jg(r,2,gn.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;L.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}};class zR extends fm{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=L.appendOrSelect(i,`g.axis.${n}`),s=this;r.selectAll("g.tick").each(function(a,o){const l=D(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:h}=L.getSVGElementSize(c,{useBBox:!0}),d=L.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case B.LEFT:f=-u+Number(c.attr("x")),p=-(h/2);break;case B.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(h/2);break;case B.TOP:f=-(u/2),p=-h+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,d.attr("transform","rotate(-45)"));break;case B.BOTTOM:f=-(u/2),p=h/2-2,s.truncation[n]&&(f=-u,d.attr("transform","rotate(-45)"));break}d.attr("x",f-gn.hover.rectanglePadding).attr("y",p).attr("width",u+gn.hover.rectanglePadding*2).attr("height",h).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,i=L.appendOrSelect(t,`g.axis.${n}`),r=this.getOptions(),s=b(r,"axes",n),a=b(s,"scaleType"),o=b(s,"truncation","threshold"),l=this;i.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=D(this).select("text"),h=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:h}),a===W.LABELS&&h.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,element:u,datum:h})}).on("mousemove",function(c){const u=D(this).select("text"),h=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:h}),l.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_CLICK,{event:c,element:D(this).select("text"),datum:D(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:D(this).select("text"),datum:D(this).select("text").datum()}),a===W.LABELS&&l.services.events.dispatchEvent(O.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const h=c.target.getBoundingClientRect();u.clientX=h.x,u.clientY=h.y}l.services.events.dispatchEvent(O.Axis.LABEL_FOCUS,{event:{...c,...u},element:D(this),datum:D(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_BLUR,{event:c,element:D(this),datum:D(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(O.Tooltip.HIDE),l.services.events.dispatchEvent(O.Axis.LABEL_BLUR,{event:c,element:D(this),datum:D(this).select("text").datum()})),n===B.LEFT||n===B.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}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;L.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 lt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=q.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},i=Object.keys(B),r=b(this.getOptions(),"axes");i.forEach(a=>{r[B[a]]&&(n[B[a]]=!0)}),this.configs.axes=n,i.forEach(a=>{const o=B[a];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===Ks.DEFAULT?new fm(this.model,this.services,l):new zR(this.model,this.services,l);c.setModel(this.model),c.setServices(this.services),c.setParent(this.parent),this.children[o]=c}}),Object.keys(this.children).forEach(a=>{this.children[a].render(t)});const s={};Object.keys(this.children).forEach(a=>{const o=this.children[a],l=o.configs.position,c=o.getInvisibleAxisRef(),{width:u,height:h}=L.getSVGElementSize(c,{useBBox:!0});let d;switch(o.getTitleRef().empty()?d=0:(d=L.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(l===B.LEFT||l===B.RIGHT)&&(d+=5)),l){case B.TOP:s.top=h+d;break;case B.BOTTOM:s.bottom=h+d;break;case B.LEFT:s.left=u+d;break;case B.RIGHT:s.right=u+d;break}}),this.services.events.dispatchEvent(O.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(O.ZoomBar.UPDATE),Object.keys(this.children).forEach(a=>{const o=this.children[a];o.margins=this.margins}),this.render(!0))}}class Kt extends lt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=b(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Nt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Nt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Nt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Nt.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===Vt.VERTICAL&&this.drawYGrid(t),n===Vt.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=Oe().domain([0,1]).range(t),this.yScale=Oe().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:i,height:r}=L.getSVGElementSize(n,{useAttrs:!0});this.backdrop=L.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",i).attr("height",r);const s=L.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=b(this.getOptions(),"grid","x","numberOfTicks"),r=this.xScale.ticks(i).map(o=>o*n),s=L.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=b(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(r).map(l=>l*n),a=L.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",l=>l).attr("y2",l=>l),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}=L.getSVGElementSize(r,{useAttrs:!0}),o=L.appendOrSelect(r,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=b(this.getOptions(),l,"alignment");L.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=cr().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),h=t+Math.abs(wt.radiusOffset),d=t+(Math.min(s,a)-t*2)/2,f=L.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+wt.xOffset;c===It.CENTER?p=s/2:c===It.RIGHT&&(p=s-t-wt.xOffset);const m=t+wt.yOffset;f.attr("transform",`translate(${p}, ${m})`)}computeOuterRadius(){const{width:t,height:n}=L.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+wt.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}=L.getSVGElementSize(this.parent,{useAttrs:!0}),a=0,o=s,l=L.appendOrSelect(r,"defs").lower(),c=L.appendOrSelect(l,"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 de extends lt{constructor(){super(...arguments),this.type="grid",this.renderType=q.SVG}render(t=!0){const n=b(this.getOptions(),"grid","x","enabled"),r=b(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(L.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(L.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=ja(i).tickSizeInner(-r).tickSizeOuter(0);if(b(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=b(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=b(this.getOptions(),"grid","x","numberOfTicks");s.ticks(o)}const a=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);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,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=Gc(i).tickSizeInner(-r).tickSizeOuter(0);if(b(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=b(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=b(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,r=n.selectAll(".x.grid .tick").nodes().sort((u,h)=>Number(sn(u).tx)-Number(sn(h).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+sn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+sn(o).tx;else if(o)l=+sn(o).tx-+sn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=L.getSVGElementSize(u).width-+sn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=b(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=sn(this),s={min:Number(i.tx)-r,max:Number(i.tx)+r};return s.min<=t[0]&&t[0]<=s.max})}drawBackdrop(t,n){const r=this.parent,i=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=i.range(),[l,c]=s.range();this.backdrop=L.appendOrSelect(r,"svg.chart-grid-backdrop");const u=L.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class hm extends lt{constructor(){super(...arguments),this.type="area",this.renderType=q.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(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>r.name!==n.datum().name?Je.opacity.unselected:Je.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",Je.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions();let i=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=hl().curve(this.services.curves.getD3Curve()).defined(_=>{const E=s.getRangeIdentifier();return _[E]!=null}),l=this.model.getGroupedData(this.configs.groups),c=b(r,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let h=0;const d=(_,E)=>{b(r,"axes",_,"includeZero")===!1&&E[0]>0&&E[1]>0&&(h=E[0])},f=_=>u?s.getBoundedScaledValues(_)[0]:s.getRangeValue(h),p=_=>u?s.getBoundedScaledValues(_)[1]:s.getRangeValue(_);a===Vt.VERTICAL?(i=s.getMainYScale().domain(),d(s.getMainYAxisPosition(),i),o.x(_=>s.getDomainValue(_)).y0(_=>f(_)).y1(_=>p(_))):(i=s.getMainXScale().domain(),d(s.getMainXAxisPosition(),i),o.x0(_=>f(_)).x1(_=>p(_)).y(_=>s.getDomainValue(_)));const m=b(r,"color","gradient","enabled"),g=l&&l.length===1&&m;l.length>1&&m&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,_=>_.name),y=D(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(g){const _=y.select(`path.${this.model.getColorClassName({classNameTypes:[X.STROKE],dataGroupName:l[0].name})}`).node();let E;if(_)E=getComputedStyle(_,null).getPropertyValue("stroke");else{const T=b(this.model.getOptions(),"color","scale");if(T!==null){const k=Object.keys(T);E=T[k[0]]}}nc.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${l[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:nc.getStops(i,E)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const x=this,S=v.enter().append("path");g?S.merge(v).style("fill",_=>`url(#${this.services.domUtils.generateElementIDString(`${_.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[X.FILL],dataGroupName:_.name,originalClassName:"area"})).attr("d",_=>{const{data:E}=_;return o(E)}):(S.attr("opacity",0).merge(v).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[X.FILL,X.STROKE],dataGroupName:_.name,originalClassName:"area"})).style("fill",_=>x.model.getFillColor(_.name)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"area-update-enter",animate:t})).attr("opacity",u?1:Je.opacity.selected).attr("d",_=>{const{data:E}=_;return o(E)}),u&&S.attr("fill-opacity",Je.opacity.selected).style("stroke",_=>x.model.getStrokeColor(_.name)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class $r extends lt{constructor(){super(...arguments),this.type="line",this.renderType=q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-line"})).attr("opacity",r=>r.name!==n.datum().name?tn.opacity.unselected:tn.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",tn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=f=>r.getDomainValue(f),a=f=>r.getRangeValue(f),[o,l]=an(s,a,r.getOrientation()),c=this.getOptions(),u=ui().x(o).y(l).curve(i.getD3Curve()).defined(f=>{const p=r.getRangeIdentifier(f);return f[p]!=null});let h=[];if(this.configs.stacked){const f=Object.keys(c.axes).some(m=>c.axes[m].percentage),{groupMapsTo:p}=c.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:b(m,0,p),data:m.map(y=>({[g]:y.data.sharedStackKey,[p]:y[p],[v]:y[1]})),hidden:!Ok(m,y=>y[0]!==y[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:[X.STROKE],dataGroupName:f.name,originalClassName:"line"})).style("stroke",f=>this.model.getStrokeColor(f.name)).attr("role",it.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const dm=5;function WR(e,t){return e>t-dm&&e<t+dm}let xn=class extends lt{constructor(){super(...arguments),this.type="ruler",this.renderType=q.SVG,this.isXGridEnabled=b(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=b(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=b(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,r]){const i=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Vt.HORIZONTAL?r:n,h=L.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),d=L.appendOrSelect(h,"line.ruler-line"),f=i.selectAll("[role=graphics-symbol]"),p=a.map(g=>({domainValue:this.services.cartesianScales.getDomainValue(g),originalData:g})).filter(g=>WR(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(O.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=p;const m=this.pointsWithinLine.reduce((g,v)=>{if(g.length===0)return g.push(v),g;const y=g[0].domainValue,x=Math.abs(u-v.domainValue),S=Math.abs(u-y);return x>S||(x<S?g=[v]:g.push(v)),g},[]);if(m.length>0){const g=m.map(S=>S.originalData).filter(S=>{const _=this.services.cartesianScales.getRangeIdentifier(S);return S[_]!=null}),v=m.map(S=>S.domainValue),y=f.filter(S=>{const _=this.services.cartesianScales.getDomainValue(S);return v.includes(_)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Wg(this.elementsToHighlight,y)&&this.hideRuler(),y.dispatch("mouseover"),this.elementsToHighlight=y,this.services.events.dispatchEvent(O.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:d,data:this.formatTooltipData(g)}),h.attr("opacity",1);const x=m[0];s==="horizontal"?d.attr("x1",c).attr("x2",l).attr("y1",x.domainValue).attr("y2",x.domainValue):d.attr("y1",c).attr("y2",l).attr("x1",x.domainValue).attr("x2",x.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=L.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(O.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),r=this.model.getDisplayData();let i=function(s){const a=Sn(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=U$(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",i).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=L.appendOrSelect(t,"svg.chart-grid-backdrop")}};class Ve extends lt{constructor(){super(...arguments),this.type="scatter",this.renderType=q.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:r}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(i=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:i,name:"legend-hover-scatter"})}).attr("opacity",i=>i[r]!==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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(O.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(O.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const r=n.getDomainIdentifier(t),i=this.model.get("zoomDomain");return i!==void 0?t.filter(s=>s[r].getTime()>=i[0].getTime()&&s[r].getTime()<=i[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let r;if(n){const i=Object.keys(t.axes).some(s=>t.axes[s].percentage);r=this.model.getStackedData({groups:this.configs.groups,percentage:i})}else{const{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");r=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=i.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(b(this.getOptions(),"points","enabled")||b(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.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(),c=>`${c[i]}-${c[a]}`);o.exit().attr("opacity",0).remove();const l=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(l,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:r}=this.services;if(!r)throw new Error("Cartesian scales service is undefined");const i=r.getOrientation(),[s,a]=an(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=an(h=>r.getDomainValue(h),h=>r.getRangeValue(h),i),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=s.scaleValue:!1}styleCircles(t,n){const r=this.getOptions(),{filled:i,fillOpacity:s}=r.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=f=>a.getDomainValue(f),c=f=>a.getRangeValue(f),[u,h]=an(l,c,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,i)?[X.FILL,X.STROKE]:[X.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,i)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,i)}).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",r.points.radius).style("fill",f=>{const p=a.getDomainIdentifier(f);if(this.model.getIsFilled(f[o],f[p],f,i))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",i?s:1).attr("opacity",d?0:1).attr("role",it.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(r,i){var s,a;const o=D(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[X.FILL],dataGroupName:l[n],originalClassName:o.attr("class")})).style("fill",l=>{var c;const u=(c=t.services.cartesianScales)==null?void 0:c.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[u],l)}).classed("unfilled",!1),(s=t.services.events)==null||s.dispatchEvent(O.Tooltip.SHOW,{event:r,hoveredElement:o,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(a=t.services.events)==null||a.dispatchEvent(O.Scatter.SCATTER_MOUSEOVER,{event:r,element:o,datum:i})}).on("mousemove",function(r,i){var s,a;const o=D(this);(s=t.services.events)==null||s.dispatchEvent(O.Scatter.SCATTER_MOUSEMOVE,{event:r,element:o,datum:i}),(a=t.services.events)==null||a.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(O.Scatter.SCATTER_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){var s,a,o;const l=D(this);if(l.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(s=t.services.cartesianScales)==null?void 0:s.getDomainIdentifier(i),h=t.model.getIsFilled(i[n],i[u],i,c);l.classed("unfilled",!h).style("fill",d=>h||c?t.model.getFillColor(d[n],d[u],d):null)}(a=t.services.events)==null||a.dispatchEvent(O.Scatter.SCATTER_MOUSEOUT,{event:r,element:l,datum:i}),(o=t.services.events)==null||o.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:l})})}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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(O.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(O.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class fm extends lt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=q.SVG,this.truncation={[B.LEFT]:!1,[B.RIGHT]:!1,[B.TOP]:!1,[B.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=b(r,"axes",n,"visible"),s=this.getComponentContainer(),{width:a,height:o}=L.getSVGElementSize(s,{useAttrs:!0}),l=L.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===B.BOTTOM||n===B.TOP?(c=this.configs.axes[B.LEFT]?this.margins.left:0,u=this.configs.axes[B.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const h=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===W.LABELS||this.scaleType===W.LABELS_RATIO?h.rangeRound([c,u]):h.range([c,u]);let d;switch(n){case B.LEFT:d=Gc;break;case B.BOTTOM:d=ja;break;case B.RIGHT:d=Yv;break;case B.TOP:d=qv;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=L.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${it.GRAPHICS_OBJECT} ${it.GROUP}`),p.attr("aria-label",`${n} ticks`));const m=L.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),g=b(r,"axes",n),v=this.scaleType===W.TIME||g.scaleType===W.TIME,y=n===B.LEFT||n===B.RIGHT,x=this.model.get("zoomDomain");if(x&&v&&!y&&h.domain(x),!i){p.attr("aria-hidden",!0);return}const S=b(g,"scaleType"),_=b(r,"data","loading"),E=b(g,"ticks","number"),T=b(g,"ticks","values"),k=b(g,"truncation","type"),I=b(g,"truncation","threshold"),$=b(g,"truncation","numCharacter"),M=E!==null,V=b(r,"timeScale"),C=L.appendOrSelect(m,"g.tick"),A=L.appendOrSelect(C,"text").text("0"),w=L.getSVGElementSize(A.node(),{useBBox:!0}).height;C.remove();const N=this.scaleType||g.scaleType||W.LINEAR,P=d(h).tickSizeOuter(0);if(h.ticks){let G;if(M?G=E:(G=gn.ticks.number,y&&(G=this.getNumberOfFittingTicks(o,w,gn.ticks.verticalSpaceRatio))),h.ticks().length===1&&h.ticks()[0]===0&&(G=0),P.ticks(G),v)if(!h.ticks(G).length)P.tickValues([]);else{const Y=b(r,"timeScale","addSpaceOnEdges"),ct=b(r,"axes",n,"domain"),et=h.copy();Y&&!ct&&et.nice(G);const Lt=et.ticks(G);Y&&Lt.length>2&&!ct&&(Lt.splice(Lt.length-1,1),Lt.splice(0,1)),P.tickValues(Lt)}}let R;const U=b(g,"ticks","formatter");if(v){const G=Xl(P.tickValues(),b(r,"timeScale","timeInterval"));U===null?R=(Y,ct)=>Yl(Y,ct,P.tickValues(),G,V):R=(Y,ct)=>{const et=Yl(Y,ct,P.tickValues(),G,V);return U(Y,ct,et)}}else U===null?N===W.LINEAR&&(R=G=>G.toLocaleString()):R=U;P.tickFormat(R);const[F,j]=this.services.cartesianScales.getScaleByPosition(n).domain();let K;if(T){if(v)T.forEach((G,Y)=>{G.getTime===void 0&&(T[Y]=new Date(G))}),K=T.filter(G=>{const Y=G.getTime();return Y>=new Date(F).getTime()&&Y<=new Date(j).getTime()});else if(S===W.LABELS){const G=this.services.cartesianScales.getScaleByPosition(n).domain();K=T.filter(Y=>G.includes(Y))}else K=T.filter(G=>G>=F&&G<=j);P.tickValues(K)}switch(n){case B.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case B.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case B.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case B.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const ut=this.model.isDataEmpty();if(g.title){const G=L.appendOrSelect(l,"text.axis-title").html(ut||_?"":g.title),Y=b(g,"titleOrientation");let ct;switch(n){case B.LEFT:Y===bl.RIGHT?G.attr("transform","rotate(90)").attr("y",0).attr("x",h.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):G.attr("transform","rotate(-90)").attr("y",0).attr("x",-(h.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case B.BOTTOM:G.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case B.RIGHT:Y===bl.LEFT?G.attr("transform","rotate(-90)").attr("y",a).attr("x",-(h.range()[0]/2)).style("text-anchor","middle"):G.attr("transform","rotate(90)").attr("y",-a).attr("x",h.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case B.TOP:ct=L.getSVGElementSize(G,{useBBox:!0}).height,G.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${ct/2})`).style("text-anchor","middle");break}}if(v){const G=Xl(P.tickValues(),b(r,"timeScale","timeInterval")),Y=V.showDayName,ct=p;t&&(p=p.transition().call(et=>this.services.transitions.setupTransition({transition:et,name:"axis-update",animate:t}))),p=p.call(P),ct.selectAll(".tick").data(P.tickValues(),h).order().select("text").style("font-weight",(et,Lt)=>qp(et,Lt,P.tickValues(),G,Y)?"bold":"normal")}else!t||!f?p=p.call(P):p=p.transition().call(G=>this.services.transitions.setupTransition({transition:G,name:"axis-update",animate:t})).call(P);if(m.call(P),n===B.BOTTOM||n===B.TOP){let G=!1;const Y=b(g,"ticks","rotation");if(Y===Ys.ALWAYS)G=!0;else if(Y===Ys.NEVER)G=!1;else if(!Y||Y===Ys.AUTO)if(h.step)G=m.selectAll("g.tick text").nodes().some(ct=>L.getSVGElementSize(ct,{useBBox:!0}).width>=h.step());else{G=!1;const ct=m.append("text").text("A"),et=L.getSVGElementSize(ct.node(),{useBBox:!0}).width;let Lt;m.selectAll("g.tick").each(function(){const z=D(this),Q=parseFloat(b(sn(this),"tx"));Q!==null&&Lt+z.text().length*et*.8>=Q&&(G=!0),Lt=Q}),ct.remove()}G?(M||(P.ticks(this.getNumberOfFittingTicks(a,w,gn.ticks.horizontalSpaceRatio)),m.call(P),p.call(P)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===B.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(_?l.attr("opacity",0):l.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",G=>G),m.selectAll("g.tick").attr("aria-label",G=>G),k!==Te.NONE&&S===W.LABELS&&!T){const G=this.services.cartesianScales.getScaleDomain(n);if(G.length>0){const Y=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(Y);const ct=this;l.selectAll("g.tick text").data(G).text(function(et){return et.length>I?(ct.truncation[n]=!0,Ai(et,k,$)):et}),this.getInvisibleAxisRef().selectAll("g.tick text").data(G).text(function(et){return et.length>I?Ai(et,k,$):et}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(G)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=L.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=b(i,"axes",n),a=b(s,"scaleType"),o=b(s,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:D(this),datum:u}),a===W.LABELS&&u.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,hoveredElement:D(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:D(this),datum:u}),a===W.LABELS&&u.length>o&&l.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:D(this),datum:u}),a===W.LABELS&&l.services.events.dispatchEvent(O.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,r){const i=Math.floor(t/(n*r));return jg(i,2,gn.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;L.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class qR extends fm{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer(),i=L.appendOrSelect(r,`g.axis.${n}`),s=this;i.selectAll("g.tick").each(function(a,o){const l=D(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:h}=L.getSVGElementSize(c,{useBBox:!0}),d=L.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case B.LEFT:f=-u+Number(c.attr("x")),p=-(h/2);break;case B.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(h/2);break;case B.TOP:f=-(u/2),p=-h+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,d.attr("transform","rotate(-45)"));break;case B.BOTTOM:f=-(u/2),p=h/2-2,s.truncation[n]&&(f=-u,d.attr("transform","rotate(-45)"));break}d.attr("x",f-gn.hover.rectanglePadding).attr("y",p).attr("width",u+gn.hover.rectanglePadding*2).attr("height",h).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=L.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=b(i,"axes",n),a=b(s,"scaleType"),o=b(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=D(this).select("text"),h=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:h}),a===W.LABELS&&h.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,element:u,datum:h})}).on("mousemove",function(c){const u=D(this).select("text"),h=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:h}),l.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_CLICK,{event:c,element:D(this).select("text"),datum:D(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:D(this).select("text"),datum:D(this).select("text").datum()}),a===W.LABELS&&l.services.events.dispatchEvent(O.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const h=c.target.getBoundingClientRect();u.clientX=h.x,u.clientY=h.y}l.services.events.dispatchEvent(O.Axis.LABEL_FOCUS,{event:{...c,...u},element:D(this),datum:D(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_BLUR,{event:c,element:D(this),datum:D(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(O.Tooltip.HIDE),l.services.events.dispatchEvent(O.Axis.LABEL_BLUR,{event:c,element:D(this),datum:D(this).select("text").datum()})),n===B.LEFT||n===B.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}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;L.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 ie extends lt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=q.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(B),i=b(this.getOptions(),"axes");r.forEach(a=>{i[B[a]]&&(n[B[a]]=!0)}),this.configs.axes=n,r.forEach(a=>{const o=B[a];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===Zs.DEFAULT?new fm(this.model,this.services,l):new qR(this.model,this.services,l);c.setModel(this.model),c.setServices(this.services),c.setParent(this.parent),this.children[o]=c}}),Object.keys(this.children).forEach(a=>{this.children[a].render(t)});const s={};Object.keys(this.children).forEach(a=>{const o=this.children[a],l=o.configs.position,c=o.getInvisibleAxisRef(),{width:u,height:h}=L.getSVGElementSize(c,{useBBox:!0});let d;switch(o.getTitleRef().empty()?d=0:(d=L.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(l===B.LEFT||l===B.RIGHT)&&(d+=5)),l){case B.TOP:s.top=h+d;break;case B.BOTTOM:s.bottom=h+d;break;case B.LEFT:s.left=u+d;break;case B.RIGHT:s.right=u+d;break}}),this.services.events.dispatchEvent(O.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(O.ZoomBar.UPDATE),Object.keys(this.children).forEach(a=>{const o=this.children[a];o.margins=this.margins}),this.render(!0))}}class Kt extends lt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=b(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Nt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Nt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Nt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Nt.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===Vt.VERTICAL&&this.drawYGrid(t),n===Vt.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius(),r=0;this.drawRing(n,r,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),r=this.computeInnerRadius();this.drawRing(n,r,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=Oe().domain([0,1]).range(t),this.yScale=Oe().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=L.getSVGElementSize(n,{useAttrs:!0});this.backdrop=L.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const s=L.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"),r=b(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=L.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(i);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"),r=this.backdrop.attr("width"),i=b(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=L.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",r).attr("y1",l=>l).attr("y2",l=>l),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,r=!0){const i=this.parent,{width:s,height:a}=L.getSVGElementSize(i,{useAttrs:!0}),o=L.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=b(this.getOptions(),l,"alignment");L.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=ci().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),h=t+Math.abs(wt.radiusOffset),d=t+(Math.min(s,a)-t*2)/2,f=L.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${h}, ${d})`).attr("d",u).classed("shimmer-effect-areas",r).classed("empty-state-areas",!r).style("fill",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let p=t+wt.xOffset;c===It.CENTER?p=s/2:c===It.RIGHT&&(p=s-t-wt.xOffset);const m=t+wt.yOffset;f.attr("transform",`translate(${p}, ${m})`)}computeOuterRadius(){const{width:t,height:n}=L.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+wt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const n="stop-bg-shimmer",r="stop-shimmer",i=this.parent.select(".chart-skeleton"),{width:s}=L.getSVGElementSize(this.parent,{useAttrs:!0}),a=0,o=s,l=L.appendOrSelect(i,"defs").lower(),c=L.appendOrSelect(l,"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
|
-
<stop class="${
|
|
77
|
+
<stop class="${r}" offset="${a+.2}"></stop>
|
|
78
78
|
<stop class="${n}" offset="${a+2*.2}"></stop>
|
|
79
|
-
`;c.html(u),h();function h(){c.attr("gradientTransform",`translate(${a-3*.2*s}, 0)`).transition().duration(2e3).delay(1e3).ease(ux).attr("gradientTransform",`translate(${o+3*.2*s}, 0)`).on("end",h)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class jR extends lt{constructor(){super(...arguments),this.type="boxplot",this.renderType=q.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(),[l,c]=a.range(),[u,h]=o.range(),d=c-l,f=u-h;if(d===0)return;const{cartesianScales:p}=this.services,m=p.getOrientation(),g=m===Vt.VERTICAL,[v,y]=an(M=>this.services.cartesianScales.getDomainValue(M),M=>this.services.cartesianScales.getRangeValue(M),m),x=Math.floor((g?d:f)/s.length),S=Math.min(x/2,16),_=this.model.getBoxplotData(),E=n.selectAll(".box-group").data(_);E.exit().remove();const T=E.enter().append("g").attr("class","box-group"),k=E.merge(T);T.append("path").merge(E.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[Z.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",me.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalstartline",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[r]),C=V,A=p.getRangeValue(M.whiskers.min),w=p.getRangeValue(M.quartiles.q_25);return Xt({x0:V,x1:C,y0:A,y1:w},m)}),T.append("path").merge(E.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[Z.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",me.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalendline",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[r]),C=V,A=p.getRangeValue(M.whiskers.max),w=p.getRangeValue(M.quartiles.q_75);return Xt({x0:V,x1:C,y0:A,y1:w},m)}),T.append("path").merge(E.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[Z.FILL,Z.STROKE],originalClassName:"box"})).attr("fill-opacity",me.box.opacity.default).attr("stroke-width",me.strokeWidth.default).attr("role",rt.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 V=p.getDomainValue(M[r])-S/2,C=V+S,A=p.getRangeValue(Math[g?"max":"min"](M.quartiles.q_75,M.quartiles.q_25)),w=A+Math.abs(p.getRangeValue(M.quartiles.q_75)-p.getRangeValue(M.quartiles.q_25));return Xt({x0:V,x1:C,y0:A,y1:w},m)}),T.append("path").merge(E.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",M=>{const V=p.getDomainValue(M[r])-S/2,C=V+S,A=p.getRangeValue(M.whiskers.min),w=p.getRangeValue(M.whiskers.max);return Xt({x0:V,x1:C,y0:A,y1:w},m)}),T.append("path").merge(E.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[Z.STROKE],originalClassName:"whisker start"})).attr("stroke-width",me.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-startingwhisker",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[r])-S/4,C=V+S/2,A=p.getRangeValue(M.whiskers.min),w=p.getRangeValue(M.whiskers.min);return Xt({x0:V,x1:C,y0:A,y1:w},m)}),T.append("path").merge(E.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[Z.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 V=p.getDomainValue(M[r])-S/2,C=V+S,A=p.getRangeValue(M.quartiles.q_50);return Xt({x0:V,x1:C,y0:A,y1:A},m)}),T.append("path").merge(E.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[Z.STROKE],originalClassName:"whisker end"})).attr("stroke-width",me.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-endingwhisker",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[r])-S/4,C=V+S/2,A=p.getRangeValue(M.whiskers.max),w=p.getRangeValue(M.whiskers.max);return Xt({x0:V,x1:C,y0:A,y1:w},m)});const I=k.selectAll("circle.outlier").data(M=>M.outliers.map(V=>({min:M.whiskers.min,max:M.whiskers.max,[r]:M[r],value:V})));I.exit().remove();const $=I.enter().append("circle");I.merge($).attr("r",me.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[Z.FILL,Z.STROKE],originalClassName:"outlier"})).attr("fill-opacity",me.circle.opacity.default).attr("cx",v).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-circles",animate:t})).attr("cy",y),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=D(this);D(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",me.box.opacity.hovered),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:r,hoveredElement:a,items:[{label:n.tooltip.groupLabel,value:s[i],class:t.model.getColorClassName({classNameTypes:[Z.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(O.Boxplot.BOX_MOUSEOVER,{event:r,element:a,datum:s})}).on("mousemove",function(r,s){const a=D(this);t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEMOVE,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,s){t.services.events.dispatchEvent(O.Boxplot.BOX_CLICK,{event:r,element:D(this),datum:s})}).on("mouseout",function(r,s){const a=D(this);D(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",me.box.opacity.default),t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEOUT,{event:r,element:a,datum:s}),t.services.events.dispatchEvent(O.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=D(this);o.classed("hovered",!0).attr("fill-opacity",me.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel,value:a[i],class:t.model.getColorClassName({classNameTypes:[Z.TOOLTIP]})},{label:"Outlier",value:a[r]}]}),t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=D(this);t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(O.Boxplot.OUTLIER_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);o.classed("hovered",!1).attr("fill-opacity",me.circle.opacity.default),t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o})})}}class Ai extends lt{constructor(){super(...arguments),this.type="zero-line",this.renderType=q.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[l,c]=this.services.cartesianScales.getDomainScale().range();let u=+i(0)+.5;u||(u=i.range()[0]);const h=Up({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());L.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 WR extends Ve{constructor(){super(...arguments),this.type="bubble",this.renderType=q.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:i}=n.bubble,r=t.data(),s=r.map(c=>c[i]).filter(c=>c),a=L.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?be(s):[1,1];return Oe().domain(l).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,l=d=>o.getDomainValue(d),c=d=>o.getRangeValue(d),[u,h]=an(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",rt.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:[Z.FILL,Z.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=b(this.getOptions(),"bubble");return[{label:b(n,"radiusLabel"),value:t[b(n,"radiusMapsTo")]}]}}class qR extends lt{constructor(){super(...arguments),this.type="bullet",this.renderType=q.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.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(),[l,c]=a.range(),[,u]=a.domain(),h=()=>{const m=[];s.forEach(v=>{v.ranges?v.ranges.forEach((y,x)=>{y!=null&&y<u&&m.push({datum:v,value:y,order:x+1})}):m.push({datum:v,order:1})});const g=L.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 y,x,S,_;return v.order===1?(y=this.services.cartesianScales.getDomainValue(v.datum)-16/2,x=y+16,S=c-2,_=l+1):(y=this.services.cartesianScales.getDomainValue(v.datum)-16/2,x=y+16,S=this.services.cartesianScales.getRangeValue(v.value),_=c),Xt({x0:y,x1:x,y0:S,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},d=()=>{const m=L.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:[Z.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,y=v+8,x=this.services.cartesianScales.getRangeValue(0)+1,S=this.services.cartesianScales.getRangeValue(g);return Xt({x0:v,x1:y,y0:x,y1:S},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",rt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",g=>g.value)},f=()=>{const m=L.appendOrSelect(r,"g.markers").selectAll("path.marker").data(s.filter(g=>b(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,y=v+24,x=this.services.cartesianScales.getRangeValue(g.marker);return Xt({x0:v,x1:y,y0:x,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let m=[];s.filter(v=>b(v,"marker")!==null).forEach(v=>{const y=v.marker,x=v[o];m=m.concat([{datum:v,value:y*.25,barValue:x},{datum:v,value:y*.5,barValue:x},{datum:v,value:y*.75,barValue:x}])});const g=L.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:y})=>{let x=4;v.ranges&&v.ranges.indexOf(y)!==-1&&(x=8);const S=this.services.cartesianScales.getDomainValue(v)-x/2,_=S+x,E=this.services.cartesianScales.getRangeValue(y);return Xt({x0:S,x1:_,y0:E,y1:E},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=D(this);o.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:s,element:o,datum:a});const l=b(n,"bullet","performanceAreaTitles"),c=t.model.getMatchingRangeIndexForDatapoint(a);t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel||"Group",value:a[i],class:t.model.getColorClassName({classNameTypes:[Z.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:l[c]}]})}).on("mousemove",function(s,a){t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:s,element:D(this),datum:a}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);o.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function YR(e){return e}function ZR(e){if(e==null)return YR;var t,n,i=e.scale[0],r=e.scale[1],s=e.translate[0],a=e.translate[1];return function(o,l){l||(t=n=0);var c=2,u=o.length,h=new Array(u);for(h[0]=(t+=o[0])*i+s,h[1]=(n+=o[1])*r+a;c<u;)h[c]=o[c],++c;return h}}function XR(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function KR(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return pm(e,n)})}:pm(e,t)}function pm(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=ZR(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&&XR(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 l(u){return u.map(o)}function c(u){var h=u.type,d;switch(h){case"GeometryCollection":return{type:h,geometries:u.geometries.map(c)};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=l(u.arcs);break;case"MultiPolygon":d=u.arcs.map(l);break;default:return null}return{type:h,coordinates:d}}return c(t)}function QR(e,t){var n={},i={},r={},s=[],a=-1;t.forEach(function(c,u){var h=e.arcs[c<0?~c:c],d;h.length<3&&!h[1][0]&&!h[1][1]&&(d=t[++a],t[a]=c,t[u]=d)}),t.forEach(function(c){var u=o(c),h=u[0],d=u[1],f,p;if(f=r[h])if(delete r[f.end],f.push(c),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(c),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=[c],i[f.start=h]=r[f.end=d]=f});function o(c){var u=e.arcs[c<0?~c:c],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],c<0?[d,h]:[h,d]}function l(c,u){for(var h in c){var d=c[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 l(r,i),l(i,r),t.forEach(function(c){n[c<0?~c:c]||s.push([c])}),s}function JR(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 tI(e){return Mc(e,eI.apply(this,arguments))}function eI(e,t){var n={},i=[],r=[];t.forEach(s);function s(l){switch(l.type){case"GeometryCollection":l.geometries.forEach(s);break;case"Polygon":a(l.arcs);break;case"MultiPolygon":l.arcs.forEach(a);break}}function a(l){l.forEach(function(c){c.forEach(function(u){(n[u=u<0?~u:u]||(n[u]=[])).push(l)})}),i.push(l)}function o(l){return JR(Mc(e,{type:"Polygon",arcs:[l]}).coordinates[0])}return i.forEach(function(l){if(!l._){var c=[],u=[l];for(l._=1,r.push(c);l=u.pop();)c.push(l),l.forEach(function(h){h.forEach(function(d){n[d<0?~d:d].forEach(function(f){f._||(f._=1,u.push(f))})})})}}),i.forEach(function(l){delete l._}),{type:"MultiPolygon",arcs:r.map(function(l){var c=[],u;if(l.forEach(function(m){m.forEach(function(g){g.forEach(function(v){n[v<0?~v:v].length<2&&c.push(v)})})}),c=QR(e,c),(u=c.length)>1)for(var h=1,d=o(c[0]),f,p;h<u;++h)(f=o(c[h]))>d&&(p=c[0],c[0]=c[h],c[h]=p,d=f);return c}).filter(function(l){return l.length>0})}}class nI extends xn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=q.SVG}showRuler(t,[n,i]){const r=this.parent,s=this.model.getOptions(),{cartesianScales:a}=this.services,o=a.getOrientation(),l=a.getRangeScale(),[c,u]=l.range(),h=a.getDomainScale(),d=h.invert(o===Vt.VERTICAL?n:i),f=L.appendOrSelect(r,"g.ruler").attr("aria-label","ruler"),p=L.appendOrSelect(f,"line.ruler-line"),m=r.selectAll("[role=graphics-symbol]").filter(g=>{if(parseFloat(_t(g,"data.x0"))<=d&&parseFloat(_t(g,"data.x1"))>=d)return!0});if(m.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Wg(this.elementsToHighlight,m)&&this.hideRuler(),m.dispatch("mouseover"),this.elementsToHighlight=m;const g=D(m.nodes()[0]).datum(),v=parseFloat(_t(g,"data.x0")),y=parseFloat(_t(g,"data.x1")),x=this.model.getActiveDataGroupNames(),S=x.reverse().map(_=>({label:_,value:_t(g,`data.${_}`),class:this.model.getColorClassName({classNameTypes:[Z.TOOLTIP],dataGroupName:_})})).filter(_=>_.value!==0);if(S.length>0){this.services.events.dispatchEvent(O.Tooltip.SHOW,{mousePosition:[n,i],hoveredElement:p,items:[{label:_t(s,"bins.rangeLabel")||"Range",value:`${v} – ${y}`},...S,...b(s,"tooltip","showTotal")===!0?[{label:_t(s,"tooltip.totalLabel")||"Total",value:x.reduce((E,T)=>E+parseFloat(_t(g,`data.${T}`)),0)}]:[]]}),f.attr("opacity",1);const _=h((v+y)/2);o==="horizontal"?p.attr("x1",u).attr("x2",c).attr("y1",_).attr("y2",_):p.attr("y1",u).attr("y2",c).attr("x1",_).attr("x2",_)}else this.hideRuler()}else this.hideRuler()}}class Ua extends xn{formatTooltipData(t){return t.reverse()}}class gm extends Oc{constructor(t,n,i){super(t,n,i),this.type="color-legend",this.renderType=q.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const r=this.getComponentContainer(),{width:s}=L.getSVGElementSize(r,{useAttrs:!0}),a=b(this.getOptions(),"data","loading");if(s>Ct.color.barWidth&&!a){const o=b(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:l}=this.services,c=l.getMainXScale().range();if(c[0]>1&&(r.select("g.legend").attr("transform",`translate(${c[0]}, 0)`),o)){const{width:u}=L.getSVGElementSize(r.select("g.legend-title").select("text"),{useBBox:!0}),h=c[0]-u-9;h>1?r.select("g.legend-title").attr("transform",`translate(${h}, 0)`):(r.select("g.legend").attr("transform",`translate(${c[0]}, 16)`),r.select("g.legend-title").attr("transform",`translate(${c[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(O.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),i=this.getComponentContainer(),{width:r}=L.getSVGElementSize(i,{useAttrs:!0}),s=b(n,"color","gradient","colors"),a=b(n,this.chartType,"colorLegend","type");let o=b(n,"color","pairing","option");const l=b(n,"heatmap","colorLegend","title");if(b(this.getOptions(),"data","loading")){i.html("");return}const c=!Ae(s),u=Zp(this.model.getDisplayData()),h=!(r<=Ct.color.barWidth),d=h?Ct.color.barWidth:r,f=L.appendOrSelect(i,"g.legend"),p=L.appendOrSelect(f,"g.legend-axis");if(l){const T=L.appendOrSelect(i,"g.legend-title");L.appendOrSelect(T,"text").text(l).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(c)g=s;else for(let T=1;T<v+1;T++)g.push(a===Xs.LINEAR?`stop-color-${m}-${o}-${T}`:`fill-${m}-${o}-${T}`);const y=le(u[0],u[1]),x=n1(y,3),S=Oe().domain(u).range([0,d]),_=ja(S).tickSize(0).tickValues(x);let E;switch(a){case Xs.LINEAR:this.drawLinear(g,f,d);break;case Xs.QUANTIZE:E=this.drawQuantize(g,m,c,f,d),S.range([E,d]);break;default:throw Error("Entered color legend type is not supported.")}p.attr("transform",`translate(0,${Ct.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);L.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),L.appendOrSelect(n,"rect").attr("width",i).attr("height",Ct.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=ir().domain(t).range([0,s]);return L.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",Ct.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(O.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class iI extends Pr{constructor(){super(...arguments),this.type="meter-title",this.renderType=q.SVG}render(t=!1){const n=b(this.model.getDisplayData(),0),i=this.getOptions(),r=this.getComponentContainer(),{groupMapsTo:s}=i.data;if(b(i,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const l=r.selectAll("text.meter-title").data([n[s]]);l.enter().append("text").classed("meter-title",!0).merge(l).attr("x",0).attr("y","1em").text(c=>c),l.exit().remove(),this.appendPercentage()}this.displayStatus();const a=this.getMaxTitleWidth(),o=L.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=b(n,"meter","proportional","total"),s=b(n,"meter","proportional","unit")?b(n,"meter","proportional","unit"):"";let a;if(i===r)a=null;else{const u=r!==null?r-i:i,h=b(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 l=this.getMaxTitleWidth(),c=L.appendOrSelect(t,"text.proportional-meter-title");l>0&&c.node().getComputedTextLength()>l&&this.truncateTitle(c,l)}displayTotal(){const t=this.getComponentContainer(),n=this.getOptions(),i=b(n,"meter","proportional","total"),r=i?b(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=b(n,"meter","proportional","unit")?b(n,"meter","proportional","unit"):"",a=b(n,"meter","proportional","totalFormatter"),o=a!==null?a(r):`${i} ${s} total`,l=L.getHTMLElementSize(this.services.domUtils.getMainContainer()),c=l.width?l.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 c!="string"?c-Ht.total.paddingRight:c).attr("y","1em").attr("text-anchor","end").text(h=>h),u.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),i=L.getHTMLElementSize(this.services.domUtils.getMainContainer()),r=i.width?i.width:0,s=this.model.getStatus(),a=Ht.status.indicatorSize/2,o=L.appendOrSelect(n,"g.status-indicator").attr("class",s!==null?`status-indicator status--${s}`:"").attr("transform",`translate(${r-a}, 0)`),l=s?[s]:[],c=o.selectAll("circle.status").data(l);c.enter().append("circle").merge(c).attr("class","status").attr("r",a).attr("cx",0).attr("cy",8);const u=o.selectAll("path.innerFill").data(l);u.enter().append("path").merge(u).attr("d",t.getStatusIconPathString(s)).attr("transform",`translate(-${a}, 0)`).attr("class","innerFill"),u.exit().remove(),c.exit().remove()}appendPercentage(){const t=b(this.model.getDisplayData(),0,"value"),n=this.getComponentContainer(),i=L.appendOrSelect(n,"text.meter-title"),r=b(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],s=n.selectAll("text.percent-value").data(r),a=Ht.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=L.appendOrSelect(this.parent,"tspan"),r=Ht.statusBar.paddingRight,s=Math.ceil(i.node().getComputedTextLength());L.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+r)}getMaxTitleWidth(){const t=L.getHTMLElementSize(this.services.domUtils.getMainContainer()),n=b(this.getOptions(),"meter","proportional"),i=t.width?t.width:this.parent.node().getBoundingClientRect().width;if(n!==null){const r=L.appendOrSelect(this.parent,"text.proportional-meter-total").node(),s=L.getSVGElementSize(r,{useBBox:!0}).width;return i-s-Ht.total.paddingLeft}else{const r=L.appendOrSelect(this.parent,"text.percent-value"),s=Ht.statusBar.paddingRight,a=r.node().getComputedTextLength(),o=L.appendOrSelect(this.parent,"g.status-indicator").node(),l=L.getSVGElementSize(o,{useBBox:!0}).width+Ht.status.paddingLeft;return i-a-s-l}}getStatusIconPathString(t){switch(t){case Ys.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 Ys.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case Ys.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 Cc extends lt{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=L.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!i.step){const s=b(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 rI extends lt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=q.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:yi.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}=L.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(),l=this.getOptions(),c=b(l,"canvasZoom","enabled");a&&b(s,0,"children")&&(s=b(s,0,"children"));const u=tr({children:s}).sum(p=>p.value).sort((p,m)=>m.value-p.value),h=vw().size([i,r]).padding(p=>p.depth>=1?yi.padding.children+3:yi.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=c&&o===3?this.getZoomClass(p):"";return this.model.getColorClassName({classNameTypes:[Z.FILL,Z.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",yi.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,f,vi),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",yi.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){D(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=D(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,vi)})}getZoomIcon(){return`
|
|
79
|
+
`;c.html(u),h();function h(){c.attr("gradientTransform",`translate(${a-3*.2*s}, 0)`).transition().duration(2e3).delay(1e3).ease(dx).attr("gradientTransform",`translate(${o+3*.2*s}, 0)`).on("end",h)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class YR extends lt{constructor(){super(...arguments),this.type="boxplot",this.renderType=q.SVG}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getDataGroupNames(),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[l,c]=a.range(),[u,h]=o.range(),d=c-l,f=u-h;if(d===0)return;const{cartesianScales:p}=this.services,m=p.getOrientation(),g=m===Vt.VERTICAL,[v,y]=an(M=>this.services.cartesianScales.getDomainValue(M),M=>this.services.cartesianScales.getRangeValue(M),m),x=Math.floor((g?d:f)/s.length),S=Math.min(x/2,16),_=this.model.getBoxplotData(),E=n.selectAll(".box-group").data(_);E.exit().remove();const T=E.enter().append("g").attr("class","box-group"),k=E.merge(T);T.append("path").merge(E.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[X.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",me.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalstartline",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[i]),C=V,A=p.getRangeValue(M.whiskers.min),w=p.getRangeValue(M.quartiles.q_25);return Zt({x0:V,x1:C,y0:A,y1:w},m)}),T.append("path").merge(E.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[X.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",me.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalendline",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[i]),C=V,A=p.getRangeValue(M.whiskers.max),w=p.getRangeValue(M.quartiles.q_75);return Zt({x0:V,x1:C,y0:A,y1:w},m)}),T.append("path").merge(E.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[X.FILL,X.STROKE],originalClassName:"box"})).attr("fill-opacity",me.box.opacity.default).attr("stroke-width",me.strokeWidth.default).attr("role",it.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",M=>M[i]).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-quartiles",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[i])-S/2,C=V+S,A=p.getRangeValue(Math[g?"max":"min"](M.quartiles.q_75,M.quartiles.q_25)),w=A+Math.abs(p.getRangeValue(M.quartiles.q_75)-p.getRangeValue(M.quartiles.q_25));return Zt({x0:V,x1:C,y0:A,y1:w},m)}),T.append("path").merge(E.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",M=>{const V=p.getDomainValue(M[i])-S/2,C=V+S,A=p.getRangeValue(M.whiskers.min),w=p.getRangeValue(M.whiskers.max);return Zt({x0:V,x1:C,y0:A,y1:w},m)}),T.append("path").merge(E.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[X.STROKE],originalClassName:"whisker start"})).attr("stroke-width",me.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-startingwhisker",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[i])-S/4,C=V+S/2,A=p.getRangeValue(M.whiskers.min),w=p.getRangeValue(M.whiskers.min);return Zt({x0:V,x1:C,y0:A,y1:w},m)}),T.append("path").merge(E.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[X.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 V=p.getDomainValue(M[i])-S/2,C=V+S,A=p.getRangeValue(M.quartiles.q_50);return Zt({x0:V,x1:C,y0:A,y1:A},m)}),T.append("path").merge(E.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[X.STROKE],originalClassName:"whisker end"})).attr("stroke-width",me.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-endingwhisker",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[i])-S/4,C=V+S/2,A=p.getRangeValue(M.whiskers.max),w=p.getRangeValue(M.whiskers.max);return Zt({x0:V,x1:C,y0:A,y1:w},m)});const I=k.selectAll("circle.outlier").data(M=>M.outliers.map(V=>({min:M.whiskers.min,max:M.whiskers.max,[i]:M[i],value:V})));I.exit().remove();const $=I.enter().append("circle");I.merge($).attr("r",me.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[X.FILL,X.STROKE],originalClassName:"outlier"})).attr("fill-opacity",me.circle.opacity.default).attr("cx",v).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-circles",animate:t})).attr("cy",y),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(i,s){const a=D(this);D(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",me.box.opacity.hovered),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:n.tooltip.groupLabel,value:s[r],class:t.model.getColorClassName({classNameTypes:[X.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(O.Boxplot.BOX_MOUSEOVER,{event:i,element:a,datum:s})}).on("mousemove",function(i,s){const a=D(this);t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEMOVE,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(O.Boxplot.BOX_CLICK,{event:i,element:D(this),datum:s})}).on("mouseout",function(i,s){const a=D(this);D(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",me.box.opacity.default),t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:a})})}addCircleEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(s,a){const o=D(this);o.classed("hovered",!0).attr("fill-opacity",me.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel,value:a[r],class:t.model.getColorClassName({classNameTypes:[X.TOOLTIP]})},{label:"Outlier",value:a[i]}]}),t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=D(this);t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(O.Boxplot.OUTLIER_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);o.classed("hovered",!1).attr("fill-opacity",me.circle.opacity.default),t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o})})}}class Ar extends lt{constructor(){super(...arguments),this.type="zero-line",this.renderType=q.SVG}render(t){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),r=this.services.cartesianScales.getScaleByPosition(n),[i,s]=r.domain(),a=i>0&&s<0||i<0&&s>0,o=this.getComponentContainer();if(!a){o.selectAll("line.domain").remove();return}const[l,c]=this.services.cartesianScales.getDomainScale().range();let u=+r(0)+.5;u||(u=r.range()[0]);const h=Up({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());L.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 XR extends Ve{constructor(){super(...arguments),this.type="bubble",this.renderType=q.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:r}=n.bubble,i=t.data(),s=i.map(c=>c[r]).filter(c=>c),a=L.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?be(s):[1,1];return Oe().domain(l).range(o?n.bubble.radiusRange(a,i):[4,4])}styleCircles(t,n){const r=this.getOptions(),{radiusMapsTo:i}=r.bubble,s=this.getRadiusScale(t),{groupMapsTo:a}=r.data,{cartesianScales:o}=this.services,l=d=>o.getDomainValue(d),c=d=>o.getRangeValue(d),[u,h]=an(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",it.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[i]||1)).attr("class",d=>this.model.getColorClassName({classNameTypes:[X.FILL,X.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",r.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=b(this.getOptions(),"bubble");return[{label:b(n,"radiusLabel"),value:t[b(n,"radiusMapsTo")]}]}}class ZR extends lt{constructor(){super(...arguments),this.type="bullet",this.renderType=q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[l,c]=a.range(),[,u]=a.domain(),h=()=>{const m=[];s.forEach(v=>{v.ranges?v.ranges.forEach((y,x)=>{y!=null&&y<u&&m.push({datum:v,value:y,order:x+1})}):m.push({datum:v,order:1})});const g=L.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(m,v=>`${v[r]}-${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 y,x,S,_;return v.order===1?(y=this.services.cartesianScales.getDomainValue(v.datum)-16/2,x=y+16,S=c-2,_=l+1):(y=this.services.cartesianScales.getDomainValue(v.datum)-16/2,x=y+16,S=this.services.cartesianScales.getRangeValue(v.value),_=c),Zt({x0:y,x1:x,y0:S,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},d=()=>{const m=L.appendOrSelect(i,"g.bars").selectAll("path.bar").data(s,g=>g[r]);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:[X.FILL],dataGroupName:g[r],originalClassName:"bar"})).style("fill",g=>this.model.getFillColor(g[r])).attr("d",g=>{const v=this.services.cartesianScales.getDomainValue(g)-4,y=v+8,x=this.services.cartesianScales.getRangeValue(0)+1,S=this.services.cartesianScales.getRangeValue(g);return Zt({x0:v,x1:y,y0:x,y1:S},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",it.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",g=>g.value)},f=()=>{const m=L.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(g=>b(g,"marker")!==null),g=>g[r]);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,y=v+24,x=this.services.cartesianScales.getRangeValue(g.marker);return Zt({x0:v,x1:y,y0:x,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let m=[];s.filter(v=>b(v,"marker")!==null).forEach(v=>{const y=v.marker,x=v[o];m=m.concat([{datum:v,value:y*.25,barValue:x},{datum:v,value:y*.5,barValue:x},{datum:v,value:y*.75,barValue:x}])});const g=L.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(m,v=>v[r]);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:y})=>{let x=4;v.ranges&&v.ranges.indexOf(y)!==-1&&(x=8);const S=this.services.cartesianScales.getDomainValue(v)-x/2,_=S+x,E=this.services.cartesianScales.getRangeValue(y);return Zt({x0:S,x1:_,y0:E,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};h(),d(),f(),p(),this.addEventListeners()}addEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("path.bar").on("mouseover",function(s,a){const o=D(this);o.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:s,element:o,datum:a});const l=b(n,"bullet","performanceAreaTitles"),c=t.model.getMatchingRangeIndexForDatapoint(a);t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[X.TOOLTIP],dataGroupName:a[r]})},{label:"Value",value:a[i]},{label:"Target",value:a.marker},{label:"Percentage",value:`${Math.floor(a[i]/a.marker*100)}%`},{label:"Performance",value:l[c]}]})}).on("mousemove",function(s,a){t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:s,element:D(this),datum:a}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);o.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function KR(e){return e}function QR(e){if(e==null)return KR;var t,n,r=e.scale[0],i=e.scale[1],s=e.translate[0],a=e.translate[1];return function(o,l){l||(t=n=0);var c=2,u=o.length,h=new Array(u);for(h[0]=(t+=o[0])*r+s,h[1]=(n+=o[1])*i+a;c<u;)h[c]=o[c],++c;return h}}function JR(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function tI(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return pm(e,n)})}:pm(e,t)}function pm(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=Mc(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:s}:r==null?{type:"Feature",id:n,properties:i,geometry:s}:{type:"Feature",id:n,bbox:r,properties:i,geometry:s}}function Mc(e,t){var n=QR(e.transform),r=e.arcs;function i(u,h){h.length&&h.pop();for(var d=r[u<0?~u:u],f=0,p=d.length;f<p;++f)h.push(n(d[f],f));u<0&&JR(h,p)}function s(u){return n(u)}function a(u){for(var h=[],d=0,f=u.length;d<f;++d)i(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 l(u){return u.map(o)}function c(u){var h=u.type,d;switch(h){case"GeometryCollection":return{type:h,geometries:u.geometries.map(c)};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=l(u.arcs);break;case"MultiPolygon":d=u.arcs.map(l);break;default:return null}return{type:h,coordinates:d}}return c(t)}function eI(e,t){var n={},r={},i={},s=[],a=-1;t.forEach(function(c,u){var h=e.arcs[c<0?~c:c],d;h.length<3&&!h[1][0]&&!h[1][1]&&(d=t[++a],t[a]=c,t[u]=d)}),t.forEach(function(c){var u=o(c),h=u[0],d=u[1],f,p;if(f=i[h])if(delete i[f.end],f.push(c),f.end=d,p=r[d]){delete r[p.start];var m=p===f?f:f.concat(p);r[m.start=f.start]=i[m.end=p.end]=m}else r[f.start]=i[f.end]=f;else if(f=r[d])if(delete r[f.start],f.unshift(c),f.start=h,p=i[h]){delete i[p.end];var g=p===f?f:p.concat(f);r[g.start=p.start]=i[g.end=f.end]=g}else r[f.start]=i[f.end]=f;else f=[c],r[f.start=h]=i[f.end=d]=f});function o(c){var u=e.arcs[c<0?~c:c],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],c<0?[d,h]:[h,d]}function l(c,u){for(var h in c){var d=c[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 l(i,r),l(r,i),t.forEach(function(c){n[c<0?~c:c]||s.push([c])}),s}function nI(e){for(var t=-1,n=e.length,r,i=e[n-1],s=0;++t<n;)r=i,i=e[t],s+=r[0]*i[1]-r[1]*i[0];return Math.abs(s)}function rI(e){return Mc(e,iI.apply(this,arguments))}function iI(e,t){var n={},r=[],i=[];t.forEach(s);function s(l){switch(l.type){case"GeometryCollection":l.geometries.forEach(s);break;case"Polygon":a(l.arcs);break;case"MultiPolygon":l.arcs.forEach(a);break}}function a(l){l.forEach(function(c){c.forEach(function(u){(n[u=u<0?~u:u]||(n[u]=[])).push(l)})}),r.push(l)}function o(l){return nI(Mc(e,{type:"Polygon",arcs:[l]}).coordinates[0])}return r.forEach(function(l){if(!l._){var c=[],u=[l];for(l._=1,i.push(c);l=u.pop();)c.push(l),l.forEach(function(h){h.forEach(function(d){n[d<0?~d:d].forEach(function(f){f._||(f._=1,u.push(f))})})})}}),r.forEach(function(l){delete l._}),{type:"MultiPolygon",arcs:i.map(function(l){var c=[],u;if(l.forEach(function(m){m.forEach(function(g){g.forEach(function(v){n[v<0?~v:v].length<2&&c.push(v)})})}),c=eI(e,c),(u=c.length)>1)for(var h=1,d=o(c[0]),f,p;h<u;++h)(f=o(c[h]))>d&&(p=c[0],c[0]=c[h],c[h]=p,d=f);return c}).filter(function(l){return l.length>0})}}class sI extends xn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=q.SVG}showRuler(t,[n,r]){const i=this.parent,s=this.model.getOptions(),{cartesianScales:a}=this.services,o=a.getOrientation(),l=a.getRangeScale(),[c,u]=l.range(),h=a.getDomainScale(),d=h.invert(o===Vt.VERTICAL?n:r),f=L.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),p=L.appendOrSelect(f,"line.ruler-line"),m=i.selectAll("[role=graphics-symbol]").filter(g=>{if(parseFloat(_t(g,"data.x0"))<=d&&parseFloat(_t(g,"data.x1"))>=d)return!0});if(m.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Wg(this.elementsToHighlight,m)&&this.hideRuler(),m.dispatch("mouseover"),this.elementsToHighlight=m;const g=D(m.nodes()[0]).datum(),v=parseFloat(_t(g,"data.x0")),y=parseFloat(_t(g,"data.x1")),x=this.model.getActiveDataGroupNames(),S=x.reverse().map(_=>({label:_,value:_t(g,`data.${_}`),class:this.model.getColorClassName({classNameTypes:[X.TOOLTIP],dataGroupName:_})})).filter(_=>_.value!==0);if(S.length>0){this.services.events.dispatchEvent(O.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:p,items:[{label:_t(s,"bins.rangeLabel")||"Range",value:`${v} – ${y}`},...S,...b(s,"tooltip","showTotal")===!0?[{label:_t(s,"tooltip.totalLabel")||"Total",value:x.reduce((E,T)=>E+parseFloat(_t(g,`data.${T}`)),0)}]:[]]}),f.attr("opacity",1);const _=h((v+y)/2);o==="horizontal"?p.attr("x1",u).attr("x2",c).attr("y1",_).attr("y2",_):p.attr("y1",u).attr("y2",c).attr("x1",_).attr("x2",_)}else this.hideRuler()}else this.hideRuler()}}class Pa extends xn{formatTooltipData(t){return t.reverse()}}class gm extends Oc{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=q.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const i=this.getComponentContainer(),{width:s}=L.getSVGElementSize(i,{useAttrs:!0}),a=b(this.getOptions(),"data","loading");if(s>Ct.color.barWidth&&!a){const o=b(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:l}=this.services,c=l.getMainXScale().range();if(c[0]>1&&(i.select("g.legend").attr("transform",`translate(${c[0]}, 0)`),o)){const{width:u}=L.getSVGElementSize(i.select("g.legend-title").select("text"),{useBBox:!0}),h=c[0]-u-9;h>1?i.select("g.legend-title").attr("transform",`translate(${h}, 0)`):(i.select("g.legend").attr("transform",`translate(${c[0]}, 16)`),i.select("g.legend-title").attr("transform",`translate(${c[0]}, 0)`))}}else i.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=r.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(O.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),r=this.getComponentContainer(),{width:i}=L.getSVGElementSize(r,{useAttrs:!0}),s=b(n,"color","gradient","colors"),a=b(n,this.chartType,"colorLegend","type");let o=b(n,"color","pairing","option");const l=b(n,"heatmap","colorLegend","title");if(b(this.getOptions(),"data","loading")){r.html("");return}const c=!Ae(s),u=Xp(this.model.getDisplayData()),h=!(i<=Ct.color.barWidth),d=h?Ct.color.barWidth:i,f=L.appendOrSelect(r,"g.legend"),p=L.appendOrSelect(f,"g.legend-axis");if(l){const T=L.appendOrSelect(r,"g.legend-title");L.appendOrSelect(T,"text").text(l).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(c)g=s;else for(let T=1;T<v+1;T++)g.push(a===Xs.LINEAR?`stop-color-${m}-${o}-${T}`:`fill-${m}-${o}-${T}`);const y=oe(u[0],u[1]),x=i1(y,3),S=Oe().domain(u).range([0,d]),_=ja(S).tickSize(0).tickValues(x);let E;switch(a){case Xs.LINEAR:this.drawLinear(g,f,d);break;case Xs.QUANTIZE:E=this.drawQuantize(g,m,c,f,d),S.range([E,d]);break;default:throw Error("Entered color legend type is not supported.")}p.attr("transform",`translate(0,${Ct.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,r){const i=100/(t.length-1);L.appendOrSelect(n,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(t).enter().append("stop").attr("offset",(s,a)=>`${a*i}%`).attr("class",(s,a)=>t[a]).attr("stop-color",s=>s),L.appendOrSelect(n,"rect").attr("width",r).attr("height",Ct.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(t,n,r,i,s){!r&&n==="diverge"&&t.splice(t.length/2,1);const a=ri().domain(t).range([0,s]);return L.appendOrSelect(i,"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",Ct.color.barHeight).attr("class",o=>o).attr("fill",o=>o),(!r&&n)==="mono"?a.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(O.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class aI extends Ni{constructor(){super(...arguments),this.type="meter-title",this.renderType=q.SVG}render(t=!1){const n=b(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer(),{groupMapsTo:s}=r.data;if(b(r,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const l=i.selectAll("text.meter-title").data([n[s]]);l.enter().append("text").classed("meter-title",!0).merge(l).attr("x",0).attr("y","1em").text(c=>c),l.exit().remove(),this.appendPercentage()}this.displayStatus();const a=this.getMaxTitleWidth(),o=L.appendOrSelect(i,"text.meter-title");a>0&&o.node().getComputedTextLength()>a&&this.truncateTitle(o,a)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),r=this.model.getMaximumDomain(this.model.getDisplayData()),i=b(n,"meter","proportional","total"),s=b(n,"meter","proportional","unit")?b(n,"meter","proportional","unit"):"";let a;if(r===i)a=null;else{const u=i!==null?i-r:r,h=b(n,"meter","proportional","breakdownFormatter");a=h!==null?h({datasetsTotal:r,total:i}):`${r} ${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 l=this.getMaxTitleWidth(),c=L.appendOrSelect(t,"text.proportional-meter-title");l>0&&c.node().getComputedTextLength()>l&&this.truncateTitle(c,l)}displayTotal(){const t=this.getComponentContainer(),n=this.getOptions(),r=b(n,"meter","proportional","total"),i=r?b(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=b(n,"meter","proportional","unit")?b(n,"meter","proportional","unit"):"",a=b(n,"meter","proportional","totalFormatter"),o=a!==null?a(i):`${r} ${s} total`,l=L.getHTMLElementSize(this.services.domUtils.getMainContainer()),c=l.width?l.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 c!="string"?c-Ht.total.paddingRight:c).attr("y","1em").attr("text-anchor","end").text(h=>h),u.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),r=L.getHTMLElementSize(this.services.domUtils.getMainContainer()),i=r.width?r.width:0,s=this.model.getStatus(),a=Ht.status.indicatorSize/2,o=L.appendOrSelect(n,"g.status-indicator").attr("class",s!==null?`status-indicator status--${s}`:"").attr("transform",`translate(${i-a}, 0)`),l=s?[s]:[],c=o.selectAll("circle.status").data(l);c.enter().append("circle").merge(c).attr("class","status").attr("r",a).attr("cx",0).attr("cy",8);const u=o.selectAll("path.innerFill").data(l);u.enter().append("path").merge(u).attr("d",t.getStatusIconPathString(s)).attr("transform",`translate(-${a}, 0)`).attr("class","innerFill"),u.exit().remove(),c.exit().remove()}appendPercentage(){const t=b(this.model.getDisplayData(),0,"value"),n=this.getComponentContainer(),r=L.appendOrSelect(n,"text.meter-title"),i=b(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],s=n.selectAll("text.percent-value").data(i),a=Ht.statusBar.paddingRight;s.enter().append("text").classed("percent-value",!0).merge(s).text(o=>`${o}%`).attr("x",+r.attr("x")+r.node().getComputedTextLength()+a).attr("y",r.attr("y")),s.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const r=L.appendOrSelect(this.parent,"tspan"),i=Ht.statusBar.paddingRight,s=Math.ceil(r.node().getComputedTextLength());L.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+i)}getMaxTitleWidth(){const t=L.getHTMLElementSize(this.services.domUtils.getMainContainer()),n=b(this.getOptions(),"meter","proportional"),r=t.width?t.width:this.parent.node().getBoundingClientRect().width;if(n!==null){const i=L.appendOrSelect(this.parent,"text.proportional-meter-total").node(),s=L.getSVGElementSize(i,{useBBox:!0}).width;return r-s-Ht.total.paddingLeft}else{const i=L.appendOrSelect(this.parent,"text.percent-value"),s=Ht.statusBar.paddingRight,a=i.node().getComputedTextLength(),o=L.appendOrSelect(this.parent,"g.status-indicator").node(),l=L.getSVGElementSize(o,{useBBox:!0}).width+Ht.status.paddingLeft;return r-a-s-l}}getStatusIconPathString(t){switch(t){case qs.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 qs.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case qs.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 Cc extends lt{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const n=this.model.getDisplayData().length,r=this.services.cartesianScales.getMainXScale(),i=L.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!r.step){const s=b(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,i*s/n)}return Math.min(t.bars.maxWidth,r.step()/2)}isOutsideZoomedDomain(t,n){if(this.model.getDisplayData().length<=1)return!1;const r=this.model.get("zoomDomain");if(r!==void 0){const i=this.services.cartesianScales.getDomainScale();return t<i(r[0])||n>i(r[1])}return!1}}class oI extends lt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-circlepack"})).attr("opacity",r=>r.data.dataGroupName===n.datum().name?1:yr.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:r,height:i}=L.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;let s=this.model.getDisplayData();const a=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),l=this.getOptions(),c=b(l,"canvasZoom","enabled");a&&b(s,0,"children")&&(s=b(s,0,"children"));const u=ti({children:s}).sum(p=>p.value).sort((p,m)=>m.value-p.value),h=xw().size([r,i]).padding(p=>p.depth>=1?yr.padding.children+3:yr.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=c&&o===3?this.getZoomClass(p):"";return this.model.getColorClassName({classNameTypes:[X.FILL,X.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",yr.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,f,vr),this.setBackgroundListeners()),a||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",r=>this.model.getFillColor(r.data.dataGroupName))}highlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",yr.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){D(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=D(this.services.domUtils.getMainContainer()),n=this,r=this.parent.selectAll("circle.node");t.on("click",()=>{n.focal=null,n.model.updateHierarchyLevel(2),t.classed("zoomed-in",!1),n.services.canvasZoom.zoomOut(r,vr)})}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=D(this);r.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!r.classed("focal"),o=b(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],h=null;if(i.children){i.depth>1&&o&&(l=!0,r.classed("clickable",!0)),c=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:_t(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(O.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{color:d,label:i.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:h},...c,...u]})}t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:r,datum:i})}).on("mousemove",function(n,i){const r=D(this);t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,i){const r=D(this);r.classed("hovered",!1),i.children&&t.unhighlightChildren(i.children),t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:r})}).on("click",function(n,i){const r=D(this),s=r.classed("non-focal"),a=b(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,vi)}else if(i.depth===2&&i.children&&!s&&a){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=i,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(i,o,vi),n.stopPropagation()}t.services.events.dispatchEvent(O.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function sI(e,t){const n=Ui(this._current,e);return i=>(this._current=n(i),t(this._current))}class mm extends lt{constructor(){super(...arguments),this.type="pie",this.renderType=q.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return wt.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(T=>T[a]>0),l=this.computeRadius();this.arc=cr().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=cr().innerRadius(this.getInnerRadius()).outerRadius(l+wt.hoverArc.outerRadiusOffset);const c=pE().value(T=>T[a]).sort(b(r,"pie","sortFunction")).padAngle(wt.padAngle)(o),u=L.appendOrSelect(i,"g.slices").attr("role",rt.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,T=>T.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",T=>this.model.getColorClassName({classNameTypes:[Z.FILL],dataGroupName:T.data[s],originalClassName:"slice"})).style("fill",T=>n.model.getFillColor(T.data[s])).attr("d",this.arc).transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",rt.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",T=>`${T[a]}, ${Pp(T.data[a],o,a)+"%"}`).attrTween("d",function(T){return sI.bind(this)(T,n.arc)});const h=r.pie.labels.enabled,d=h?c.filter(T=>T.data[a]>0):[],f=L.appendOrSelect(i,"g.labels").attr("role",rt.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(d,T=>T.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(T=>r.pie.labels.formatter?r.pie.labels.formatter(T):Pp(T.data[a],o,a)+"%").datum(function(T){const k=l+7,I=(T.endAngle-T.startAngle)/2+T.startAngle,$=I/Math.PI*180,M=this.getComputedTextLength();return T.textOffsetX=M/2,T.textOffsetY=$>90&&$<270?10:0,T.xPosition=(T.textOffsetX+k)*Math.sin(I),T.yPosition=(T.textOffsetY+k)*-Math.cos(I),T}).attr("transform",function(T,k){const I=d.length,$=(T.endAngle-T.startAngle)*(180/Math.PI);if(k>=I-2&&$<wt.callout.minSliceDegree){let M,V;return T.index===I-1?(M=T.xPosition+wt.callout.offsetX+wt.callout.textMargin+T.textOffsetX,V=T.yPosition-wt.callout.offsetY,T.direction=qs.RIGHT,m.push(T)):(M=T.xPosition-wt.callout.offsetX-T.textOffsetX-wt.callout.textMargin,V=T.yPosition-wt.callout.offsetY,T.direction=qs.LEFT,m.push(T)),`translate(${M}, ${V})`}return`translate(${T.xPosition}, ${T.yPosition})`}),this.renderCallouts(m);const g=b(r,"donut")?"donut":"pie",v=b(r,g,"alignment"),{width:y}=L.getSVGElementSize(this.getParent(),{useAttrs:!0}),x=h?wt.xOffset:0,S=h?wt.yOffset:0;let _=l+x;v===It.CENTER?_=y/2:v===It.RIGHT&&(_=y-l-wt.xOffset);let E=l+S;m.length>0&&(E+=wt.yOffsetCallout),i.attr("x",_+7).attr("y",E),this.addEventListeners()}renderCallouts(t){const n=L.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",rt.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",rt.GROUP).attr("aria-roledescription","label callout");r.merge(i).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===qs.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+wt.callout.offsetX,y:o-wt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-wt.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-wt.callout.offsetX,y:o-wt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+wt.callout.horizontalLineLength),s}),r.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return D(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 D(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=D(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(O.Pie.SLICE_MOUSEOVER,{event:n,element:D(this),datum:i});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:r,items:[{label:i.data[s],value:i.data[a]}]})}).on("mousemove",function(n,i){const r=D(this);t.services.events.dispatchEvent(O.Pie.SLICE_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(O.Pie.SLICE_CLICK,{event:n,element:D(this),datum:i})}).on("mouseout",function(n,i){const r=D(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(O.Pie.SLICE_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:r})})}computeRadius(){const{width:t,height:n}=L.getSVGElementSize(this.parent,{useAttrs:!0}),i=this.getOptions(),r=Math.min(t,n)/2;return i.pie.labels.enabled?r+wt.radiusOffset:r}}class aI extends mm{constructor(){super(...arguments),this.type="donut",this.renderType=q.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const i=L.appendOrSelect(this.getComponentContainer(),"g.center"),r=this.getOptions(),s=this.computeRadius(),a=b(r,"donut","center","label");L.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(D(this))}),a!==null&&a!==""&&L.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=b(n,"donut","center","number");i===null&&(i=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const r=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;r%1===0&&i%1===0?s=gu:s=le;const a=s(r,i);return o=>{const{numberFormatter:l}=n.donut.center;t.text(l(a(o)))}}}const vm="4,10 8,6 12,10",ym="12,6 8,10 4,6";class oI extends lt{constructor(){super(...arguments),this.type="gauge",this.renderType=q.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return jg(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 b(t,"gauge","type")===pi.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(b(n,"gauge","deltaArrow","direction")){case xl.UP:return vm;case xl.DOWN:return ym;default:return t>0?vm:ym}}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(),l=s*a,c=o+l,u=o+a,h=this.computeRadius(),d=this.getInnerRadius();this.backgroundArc=cr().innerRadius(d).outerRadius(h).startAngle(c).endAngle(u),this.arc=cr().innerRadius(d).outerRadius(h).startAngle(o).endAngle(c),L.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:[Z.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>b(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",rt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",v=>v),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const p=b(i,"gauge","alignment"),{width:m}=L.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=b(n,"gauge","type"),r=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=b(n,"gauge","valueFontSize"),l=b(n,"gauge","deltaFontSize"),c=b(n,"gauge","numberSpacing"),u=b(n,"gauge","showPercentageSymbol");let h=0;i===pi.FULL&&!s?h=l(a):i===pi.SEMI&&s&&(h=-(l(a)+c));const d=L.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${h})`),f=o(a),p=L.appendOrSelect(d,"g.gauge-value-number"),m=b(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(T=>m(T));const{width:v}=L.getSVGElementSize(L.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),y=f/2,x=u?"%":"",S=L.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${y}px`).attr("x",v/2).text(x),{width:_,height:E}=L.getSVGElementSize(S,{useBBox:!0});S.attr("y",`-${E/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?b(i,"gauge","deltaFontSize"):()=>0,o=r?b(i,"gauge","numberFormatter"):()=>null,l=b(i,"gauge","deltaArrow","size"),c=b(i,"gauge","numberSpacing"),u=b(i,"gauge","showPercentageSymbol"),h=L.appendOrSelect(n,"g.gauge-numbers"),d=L.appendOrSelect(h,"g.gauge-delta").attr("transform",`translate(0, ${a(s)+c})`),f=L.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(y=>`${o(y)}${p}`);const{width:m}=L.getSVGElementSize(L.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),g=b(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",-l(s)-m/2).attr("y",-l(s)/2-a(s)*.35).attr("width",l(s)).attr("height",l(s)).attr("viewBox","0 0 16 16").each(function(){const y=D(this);L.appendOrSelect(y,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const x=b(i,"gauge","status");L.appendOrSelect(y,"polygon.gauge-delta-arrow").attr("class",x!==null?`gauge-delta-arrow status--${x}`:"").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=b(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(O.Gauge.ARC_MOUSEOVER,{event:n,element:D(this),datum:i})}).on("mousemove",function(n,i){const r=D(this);t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEMOVE,{event:n,element:r,datum:i})}).on("click",function(n,i){t.services.events.dispatchEvent(O.Gauge.ARC_CLICK,{event:n,element:D(this),datum:i})}).on("mouseout",function(n,i){const r=D(this);t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEOUT,{event:n,element:r,datum:i})})}computeRadius(){const t=this.getOptions(),n=b(t,"gauge","type"),{width:i,height:r}=L.getSVGElementSize(this.parent,{useAttrs:!0});return n===pi.SEMI?Math.min(i/2,r):Math.min(i/2,r/2)}}class xm extends Cc{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=q.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.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=Cr(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 l=o.enter().append("g").classed("bars",!0).attr("role",rt.GROUP).attr("data-name","bars").merge(o);l.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()===Vt.VERTICAL?`translate(${h}, 0)`:`translate(0, ${h})`});const c=l.selectAll("path.bar").data(u=>this.getDataCorrespondingToLabel(u),u=>u[r]);c.exit().attr("opacity",0).remove(),c.enter().append("path").attr("opacity",0).merge(c).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:[Z.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),y=this.services.cartesianScales.getDomainValue(u)-d/2,x=y+d;if(!this.isOutsideZoomedDomain(y,x))return Xt({x0:f,x1:p,y0:g,y1:v},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",rt.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=D(this);r.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:r,data:[i]})}).on("mousemove",function(n,i){const r=D(this);t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:n,element:D(this),datum:i})}).on("mouseout",function(n,i){const r=D(this);r.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(O.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.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=b(t,"bars","width"),i=b(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=ir().domain(t).rangeRound([0,this.getGroupWidth()])}}class lI extends lt{constructor(){super(...arguments),this.type="heatmap",this.renderType=q.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(),l=this.services.cartesianScales.getMainXScale(),c=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}})),l(i)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(i)}, ${un(c.range())})`):c(i)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${un(l.range())},${c(i)})`),this.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n.event,hoveredElement:D(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(O.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(O.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(O.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(O.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(O.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(""),b(this.getOptions(),"data","loading"))return;const r=i.getMainXScale(),s=i.getMainYScale(),a=i.getDomainIdentifier(),o=i.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),h=r.range(),d=s.range();this.xBandwidth=Math.abs((h[1]-h[0])/l.length),this.yBandwidth=Math.abs((d[1]-d[0])/c.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=L.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);L.appendOrSelect(r,"line.top").attr("x1",-1).attr("x2",n+1),L.appendOrSelect(r,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",i+1),L.appendOrSelect(r,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",i).attr("y2",i),L.appendOrSelect(r,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",i+1)}determineDividerStatus(){const t=b(this.getOptions(),"heatmap","divider","state");return t!==gr.OFF&&(t===gr.AUTO&&Of.minCellDividerDimension<=this.xBandwidth&&Of.minCellDividerDimension<=this.yBandwidth||t===gr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,i=this.getOptions(),r=_t(i,"tooltip.totalLabel"),s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const h=D(this),d=h.select("rect.heat");if(!d.classed("null-state")){const f=$r(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(O.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:r||"Total",value:u.value,color:d.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:D(this),datum:u}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(O.Heatmap.HEATMAP_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){const h=D(this).select("rect.heat"),d=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),d||(t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{event:c,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(O.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class cI extends lt{constructor(){super(...arguments),this.type="histogram",this.renderType=q.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.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(),l=n.selectAll("g.bars").data(a,u=>_t(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",rt.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).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:[Z.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s])).attr("d",u=>{const h=_t(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()===Vt.VERTICAL?g+=1:g-=1),Xt({x0:f,x1:p,y0:m,y1:g},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",rt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>b(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=D(this);a.classed("hovered",!0);const o=parseFloat(_t(s,"data.x0")),l=parseFloat(_t(s,"data.x1")),c=i.services.cartesianScales.getRangeAxisPosition(),u=i.services.cartesianScales.getScaleLabel(c);i.services.events.dispatchEvent(O.Tooltip.SHOW,{event:r,hoveredElement:a,items:[{label:_t(t,"bins.rangeLabel")||"Range",value:`${o} – ${l}`},{label:t.tooltip.groupLabel||"Group",value:s[n],class:i.model.getColorClassName({classNameTypes:[Z.TOOLTIP],dataGroupName:s[n]})},{label:u,value:_t(s,`data.${s[n]}`)}]})}).on("mousemove",function(r){i.services.events.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("mouseout",function(){D(this).classed("hovered",!1),i.services.events.dispatchEvent(O.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class uI extends Ve{constructor(){super(...arguments),this.type="lollipop",this.renderType=q.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]?tn.weight.unselected:tn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",tn.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?tn.opacity.unselected:tn.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",tn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.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(),l=s.getDomainIdentifier(),c=g=>s.getDomainValue(g),u=g=>s.getRangeValue(g),h=s.getOrientation(),[d,f]=an(c,u,h),p=n.selectAll("line.line").data(this.getScatterData(),g=>`${g[r]}-${g[l]}`);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:[Z.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[l],g)).attr("opacity",1);h===Vt.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(O.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(O.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(O.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(O.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class hI extends lt{constructor(){super(...arguments),this.type="meter",this.renderType=q.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)-Ht.dividerWidth),x:i-n(r.value)}):(i=n(r.value),{...r,width:Math.abs(n(r.value)-Ht.dividerWidth),x:0}))}render(t=!0){const n=this,i=this.getComponentContainer(),r=this.getOptions(),s=b(r,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=L.getSVGElementSize(i,{useAttrs:!0}),{groupMapsTo:c}=r.data;let u;b(r,"meter","proportional")===null?u=100:u=b(r,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const h=Oe().domain([0,u]).range([0,l]),d=this.getStackedBounds(a,h),f=b(r,"meter","height");L.appendOrSelect(i,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?Ht.height.proportional:Ht.height.default)),L.appendOrSelect(i,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?Ht.height.proportional:Ht.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",x=>x.x).attr("y",0).attr("height",()=>f||(s?Ht.height.proportional:Ht.height.default)).attr("class",x=>this.model.getColorClassName({classNameTypes:[Z.FILL],dataGroupName:x[c],originalClassName:m})).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"meter-bar-update",animate:t})).attr("width",x=>x.value>u?h(u):x.width).style("fill",x=>n.model.getFillColor(x[c])).attr("role",rt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",x=>x.value),p.exit().remove();const g=b(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 y=i.selectAll("line.peak").data(v==null?[]:[v]);y.enter().append("line").classed("peak",!0).merge(y).attr("y1",0).attr("y2",()=>f||(s?Ht.height.proportional:Ht.height.default)).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"peak-line-update",animate:t})).attr("x1",x=>h(x)).attr("x2",x=>h(x)).attr("role",rt.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",x=>x),y.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this,r=b(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=D(this);i.services.events.dispatchEvent(O.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),r&&(o.classed("hovered",!0),i.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=D(this);i.services.events.dispatchEvent(O.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),r&&i.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){i.services.events.dispatchEvent(O.Meter.METER_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);i.services.events.dispatchEvent(O.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),r&&(o.classed("hovered",!1),i.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class dI extends lt{constructor(){super(...arguments),this.type="radar",this.renderType=q.SVG,this.getLabelDimensions=t=>{const n=L.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),i=L.appendOrSelect(n,"text").text(t),{width:r,height:s}=L.getSVGElementSize(i.node(),{useBBox:!0});return n.remove(),{width:r,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:i,value:r}=b(n,"radar","axes"),s=b(n,"data","groupMapsTo"),a=bk(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[i]:o,[s]:l,[r]:null}))));return X(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:i,value:r}=b(n,"radar","axes"),s=b(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[i]:c,[r]:null}));return{name:a,data:X(l,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?Pn.opacity.unselected:Pn.opacity.selected).style("stroke-opacity",i=>i.name!==n.datum().name?Pn.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",Pn.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer(),{width:i,height:r}=L.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=b(o,"data","groupMapsTo"),c=b(o,"radar","axes","value"),{angle:u,value:h}=b(o,"radar","axes"),{xLabelPadding:d,yLabelPadding:f,yTicksNumber:p,minRange:m,xAxisRectHeight:g}=Pn;this.uniqueKeys=Array.from(new Set(s.map(C=>C[u]))),this.uniqueGroups=Array.from(new Set(s.map(C=>C[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const v=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),y=(Math.min(i,r)-v)/2;if(y<=0)return;const x=ir().domain(this.fullDataNormalized.map(C=>C[u])).range([0,2*Math.PI].map(C=>C-Math.PI/2)),S=un(this.fullDataNormalized.map(C=>C[h])),_=Oe().domain([S>=0?0:S,En(this.fullDataNormalized.map(C=>C[h]))]).range([m,y]).nice(p),E=_.ticks(p),T=C=>this.model.getFillColor(C),k=vE().angle(C=>x(C[u])+Math.PI/2).radius(C=>_(C[h])).curve(kd),I=this.uniqueKeys.map(C=>{const A=this.getLabelDimensions(C).width,w=VL(x(C),y);return A+w}),$={x:En(I)+d,y:r/2},M=L.appendOrSelect(n,"g.y-axes").attr("role",rt.GROUP).selectAll("path").data(E,C=>C),V=C=>this.uniqueKeys.map(A=>({[u]:A,[h]:C}));M.join(C=>C.append("path").attr("opacity",0).attr("transform",`translate(${$.x}, ${$.y})`).attr("fill","none").call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",w=>k(V(w)))),C=>C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${$.x}, ${$.y})`).attr("d",w=>k(V(w)))),C=>C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_axes_exit",animate:t})).attr("d",w=>k(V(w))).attr("opacity",0).remove())),L.appendOrSelect(n,"g.x-axes").attr("role",rt.GROUP).selectAll("line").data(this.uniqueKeys,C=>C).join(C=>C.append("line").attr("opacity",0).attr("class",A=>`x-axis-${Ti(A)}`).attr("stroke-dasharray","0").attr("x1",A=>At(x(A),0,$).x).attr("y1",A=>At(x(A),0,$).y).attr("x2",A=>At(x(A),0,$).x).attr("y2",A=>At(x(A),0,$).y).call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",w=>At(x(w),_.range()[0],$).x).attr("y1",w=>At(x(w),_.range()[0],$).y).attr("x2",w=>At(x(w),_.range()[1],$).x).attr("y2",w=>At(x(w),_.range()[1],$).y)),C=>C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",w=>At(x(w),_.range()[0],$).x).attr("y1",w=>At(x(w),_.range()[0],$).y).attr("x2",w=>At(x(w),_.range()[1],$).x).attr("y2",w=>At(x(w),_.range()[1],$).y)),C=>C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),L.appendOrSelect(n,"g.x-labels").attr("role",rt.GROUP).selectAll("text").data(this.uniqueKeys).join(C=>C.append("text").text(A=>A).attr("opacity",0).attr("x",A=>At(x(A),_.range()[1]+d,$).x).attr("y",A=>At(x(A),_.range()[1]+d,$).y).style("text-anchor",A=>fg(x(A)).textAnchor).style("dominant-baseline",A=>fg(x(A)).dominantBaseline).call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),C=>C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",w=>At(x(w),_.range()[1]+d,$).x).attr("y",w=>At(x(w),_.range()[1]+d,$).y).end().finally(()=>{const w=b(o,"radar","alignment"),N=this.getAlignmentXOffset(w,n,this.getParent());n.attr("x",N)})),C=>C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),L.appendOrSelect(n,"g.blobs").attr("role",rt.GROUP).selectAll("path").data(this.groupedDataNormalized,C=>C.name).join(C=>C.append("path").attr("class",A=>this.model.getColorClassName({classNameTypes:[Z.FILL,Z.STROKE],dataGroupName:A.name,originalClassName:"blob"})).attr("role",rt.GRAPHICS_SYMBOL).attr("aria-label",A=>A.name).attr("opacity",0).attr("transform",t?()=>`translate(${$.x}, ${$.y}) scale(${1+Math.random()*.35})`:`translate(${$.x}, ${$.y})`).style("fill",A=>T(A.name)).style("fill-opacity",Pn.opacity.selected).style("stroke",A=>T(A.name)).call(A=>{const w=A.transition().call(N=>this.services.transitions.setupTransition({transition:N,name:"radar_blobs_enter",animate:t}));t&&w.delay(()=>Math.random()*30).attr("transform",`translate(${$.x}, ${$.y})`),w.attr("opacity",1).attr("d",N=>k(N.data))}),C=>(C.attr("class",A=>this.model.getColorClassName({classNameTypes:[Z.FILL,Z.STROKE],dataGroupName:A.name,originalClassName:"blob"})).style("fill",A=>T(A.name)).style("stroke",A=>T(A.name)),C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${$.x}, ${$.y})`).attr("d",w=>k(w.data))),C),C=>C.call(A=>{const w=A.transition().call(N=>this.services.transitions.setupTransition({transition:N,name:"radar_blobs_exit",animate:t}));t&&w.delay(()=>Math.random()*30).attr("transform",()=>`translate(${$.x}, ${$.y}) scale(${1+Math.random()*.35})`),w.attr("opacity",0).remove()})),L.appendOrSelect(n,"g.dots").attr("role",rt.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(C=>b(C,h)!==null)).join(C=>C.append("circle").attr("role",rt.GRAPHICS_SYMBOL).attr("aria-label",A=>A[c]),C=>C,C=>C.remove()).attr("class",C=>this.model.getColorClassName({classNameTypes:[Z.FILL],dataGroupName:C[l],originalClassName:Ti(C[u])})).attr("cx",C=>At(x(C[u]),_(C[h]),$).x).attr("cy",C=>At(x(C[u]),_(C[h]),$).y).attr("r",0).attr("opacity",0).style("fill",C=>T(C[l])),L.appendOrSelect(n,"g.x-axes-rect").attr("role",rt.GROUP).selectAll("rect").data(this.uniqueKeys).join(C=>C.append("rect"),C=>C,C=>C.remove()).attr("x",$.x).attr("y",$.y-g/2).attr("width",_.range()[1]).attr("height",g).style("fill","red").style("fill-opacity",0).attr("transform",C=>`rotate(${pg(x(C))}, ${$.x}, ${$.y})`),L.appendOrSelect(n,"g.y-labels").attr("role",rt.GROUP).selectAll("text").data(be(E)).join(C=>C.append("text").attr("opacity",0).text(A=>A).attr("x",A=>At(-Math.PI/2,_(A),$).x+f).attr("y",A=>At(-Math.PI/2,_(A),$).y).style("text-anchor","start").style("dominant-baseline","middle").call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),C=>C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_labels_update",animate:t})).text(w=>w).attr("opacity",1).attr("x",w=>At(-Math.PI/2,_(w),$).x+f).attr("y",w=>At(-Math.PI/2,_(w),$).y)),C=>C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,i){const r=L.getSVGElementSize(n,{useBBox:!0}),{width:s}=L.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=b(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(i,r){const s=D(this);t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEOVER,{event:i,element:s,datum:r});const a=t.parent.select(`.x-axes .x-axis-${Ti(r)}`),o=t.parent.selectAll(`.dots circle.${Ti(r)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,h=b(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",Pn.dotsRadius);const d=t.fullDataNormalized.filter(f=>f[n]===r&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(O.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:[Z.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(i,r){const s=D(this);t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEMOVE,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(O.Radar.X_AXIS_CLICK,{event:i,element:D(this),datum:r})}).on("mouseout",function(i,r){const s=D(this),a=t.parent.select(`.x-axes .x-axis-${Ti(r)}`),o=t.parent.selectAll(`.dots circle.${Ti(r)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEOUT,{event:i,element:s,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE)})}}class bm extends Cc{constructor(){super(...arguments),this.type="simple-bar",this.renderType=q.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.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,l=>l[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(l=>this.services.transitions.setupTransition({transition:l,name:"bar-update-enter",animate:t})).attr("class",l=>this.model.getColorClassName({classNameTypes:[Z.FILL],dataGroupName:l[i],originalClassName:"bar"})).style("fill",l=>this.model.getFillColor(l[i])).attr("d",l=>{const c=this.services.cartesianScales.getRangeIdentifier(),u=this.getBarWidth(),h=l[c],d=this.services.cartesianScales.getDomainValue(l)-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(l)}const g=Math.abs(m-p);if(g!==0&&g<2&&(h>0&&a===Vt.VERTICAL||h<0&&a===Vt.HORIZONTAL?m=p-2:m=p+2),!this.isOutsideZoomedDomain(d,f))return Xt({x0:d,x1:f,y0:p,y1:m},a)}).attr("opacity",1).attr("role",rt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",l=>l.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,i){const r=D(this);r.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:r,data:[i]})}).on("mousemove",function(n,i){t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:n,element:D(this),datum:i}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:n,element:D(this),datum:i})}).on("mouseout",function(n,i){const r=D(this);r.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(O.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class fI extends Kt{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=b(this.getOptions(),"data","loading"),i=!b(this.getOptions(),"grid","x","enabled")&&!b(this.getOptions(),"grid","y","enabled")&&!b(this.getOptions(),"axes","bottom","visible")&&!b(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=L.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=L.appendOrSelect(t,"svg.chart-skeleton.DAII"),L.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class wm extends lt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=q.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=>b(s,0,r)!==n.datum().name?Je.opacity.unselected:Je.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",Je.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.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}),l=b(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),h=this.services.cartesianScales.getScaleByPosition(u),d=n.selectAll("path.area").data(o,f=>b(f,0,s));this.areaGenerator=hl().x(f=>this.services.cartesianScales.getValueThroughAxisPosition(c,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=>b(f,0,s)).attr("class","area").attr("class",f=>this.model.getColorClassName({classNameTypes:[Z.FILL],dataGroupName:b(f,0,s),originalClassName:"area"})).style("fill",f=>i.model.getFillColor(b(f,0,s))).attr("role",rt.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",f=>b(f,0,s)).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"area-update-enter",animate:t})).attr("opacity",Je.opacity.selected).attr("d",this.areaGenerator)}}class _m extends Cc{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=q.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.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,c=>b(c,0,r));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",rt.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[Z.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[r])).attr("d",c=>{const u=c.data.sharedStackKey,h=this.getBarWidth(),d=this.services.cartesianScales.getDomainValue(u)-h/2,f=d+h,p=this.services.cartesianScales.getRangeValue(c[0]);let m=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(d,f)){if(Math.abs(m-p)>0&&Math.abs(m-p)>i.bars.dividerSize){const g=c[0]<0&&c[1]<=0;g&&a.length>1?this.services.cartesianScales.getOrientation()===Vt.VERTICAL?m+=c[1]===0?2:1:m-=1:g||(this.services.cartesianScales.getOrientation()===Vt.VERTICAL?m+=1:m-=1)}return Xt({x0:d,x1:f,y0:p,y1:m},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",rt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[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=D(this);a.classed("hovered",!0),i.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:r,element:a,datum:s});let o=i.model.getDisplayData(i.configs.groups).find(l=>{const c=i.services.cartesianScales.getDomainIdentifier(l),u=i.services.cartesianScales.getRangeIdentifier(l);return l[u]===s.data[s[n]]&&l[c].toString()===s.data.sharedStackKey&&l[n]===s[n]});if(o===void 0){const l=i.services.cartesianScales.getDomainIdentifier(),c=i.services.cartesianScales.getRangeIdentifier();o={[l]:s.data.sharedStackKey,[c]:s.data[s[n]],[n]:s[n]}}i.services.events.dispatchEvent(O.Tooltip.SHOW,{event:r,hoveredElement:a,data:[o]})}).on("mousemove",function(r,s){const a=D(this);i.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:r,element:a,datum:s}),i.services.events.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,s){i.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:r,element:D(this),datum:s})}).on("mouseout",function(r,s){const a=D(this);a.classed("hovered",!1),i.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:r,element:a,datum:s}),i.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(b(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),i=L.getSVGElementSize(this.parent,{useAttrs:!0}).width,r=this.model.getStackKeys().length,s=b(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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Em extends Ve{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=q.SVG}render(t){if(!b(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=>b(u,0,r));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",rt.GROUP).merge(o).selectAll("circle.dot").data(u=>u);l.exit().attr("opacity",0).remove();const c=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l).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(c,t),this.addEventListeners()}getTooltipData(t,n){const i=this.getOptions(),{groupMapsTo:r}=i.data,s=Object.keys(i.axes).some(l=>i.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.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})[c][h].data[d]),p!==null&&o.push({[r]:d,[g]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(h=>h[r]==l[r]&&h[c]==l[c]&&h[u]==l[u])!==void 0})}}const Li=6;class pI extends lt{constructor(){super(...arguments),this.type="tree",this.renderType=q.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}=L.getSVGElementSize(i.node(),{useBBox:!0});return i.remove(),r}render(t=!0){const n=this.getComponentContainer();n.html("");const{width:i,height:r}=L.getSVGElementSize(this.parent,{useAttrs:!0});if(i<1||r<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=b(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),h={top:0,right:0,bottom:0,left:l>0?l+Li:30-Li},d=tr({name:o,children:a}),f=10,p=i/6,m=E=>{const T=d.descendants().reverse(),k=d.links();let I=d,$=d;d.eachBefore(R=>{R.x<I.x&&(I=R),R.x>$.x&&($=R)});const M=$.x-I.x,V=n.transition().call(R=>this.services.transitions.setupTransition({transition:R,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-h.left,I.x,i,M].join(" ")),C=_.selectAll("g").data(T,R=>R.id),A=this,w=C.enter().append("g").attr("transform",()=>`translate(${E.y0},${E.x0})`).attr("class",R=>R.depth!==0&&R.children&&R.children.length>0?"clickable":null).on("mouseover",function(R,U){A.services.events.dispatchEvent(O.Tree.NODE_MOUSEOVER,{event:R,element:D(this),datum:U})}).on("click",function(R,U){U.depth!==0&&(U.children=U.children?null:U._children,m(U)),A.services.events.dispatchEvent(O.Tree.NODE_CLICK,{event:R,element:D(this),datum:U})}).on("mouseout",function(R,U){A.services.events.dispatchEvent(O.Tree.NODE_MOUSEOUT,{event:R,element:D(this),datum:U})});w.append("circle").attr("r",2.5).attr("class",R=>R._children?"parent":"child").attr("stroke-width",10),w.append("text").attr("dy","0.31em").attr("x",R=>R._children?-Li:Li).attr("text-anchor",R=>R._children?"end":"start").text(R=>R.data.name).clone(!0).attr("class","text-stroke").lower(),C.merge(w).transition(V).attr("transform",R=>`translate(${R.y},${R.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),C.exit().transition(V).remove().attr("transform",()=>`translate(${E.y},${E.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const N=S.selectAll("path").data(k,R=>R.target.id),P=N.enter().append("path").attr("d",()=>{const R={x:E.x0,y:E.y0};return x({source:R,target:R})});N.merge(P).transition(V).attr("d",x),N.exit().transition(V).remove().attr("d",()=>{const R={x:E.x,y:E.y};return x({source:R,target:R})}),d.eachBefore(R=>{R.x0=R.x,R.y0=R.y})},g=d.descendants(),v=g[g.length-1].depth,y=b(s,"tree","type")===yl.DENDROGRAM?Ub().size([r,i-u-v*Li-l]):Ow().nodeSize([f,p]).size([r,i-u-v*Li-l]),x=EE().x(E=>E.y).y(E=>E.x);d.x0=p/2,d.y0=0,d.descendants().forEach((E,T)=>{E.id=T,E._children=E.children}),y(d),n.attr("viewBox",[-h.left,-h.top,i,f]).style("user-select","none");const S=n.append("g").attr("class","links"),_=n.append("g").attr("class","nodes");m(d)}}var gI="#000000",mI="#ffffff",vI="#fcf4d6",yI="#fddc69",xI="#f1c21b",bI="#d2a106",wI="#b28600",_I="#8e6a00",EI="#684e00",SI="#483700",OI="#302400",TI="#1c1500",MI={10:vI,20:yI,30:xI,40:bI,50:wI,60:_I,70:EI,80:SI,90:OI,100:TI},CI="#fff2e8",$I="#ffd9be",AI="#ffb784",LI="#ff832b",DI="#eb6200",kI="#ba4e00",RI="#8a3800",II="#5e2900",NI="#3e1a00",PI="#231000",UI={10:CI,20:$I,30:AI,40:LI,50:DI,60:kI,70:RI,80:II,90:NI,100:PI},BI="#fff1f1",VI="#ffd7d9",HI="#ffb3b8",GI="#ff8389",FI="#fa4d56",zI="#da1e28",jI="#a2191f",WI="#750e13",qI="#520408",YI="#2d0709",ZI={10:BI,20:VI,30:HI,40:GI,50:FI,60:zI,70:jI,80:WI,90:qI,100:YI},XI="#fff0f7",KI="#ffd6e8",QI="#ffafd2",JI="#ff7eb6",tN="#ee5396",eN="#d02670",nN="#9f1853",iN="#740937",rN="#510224",sN="#2a0a18",aN={10:XI,20:KI,30:QI,40:JI,50:tN,60:eN,70:nN,80:iN,90:rN,100:sN},oN="#f6f2ff",lN="#e8daff",cN="#d4bbff",uN="#be95ff",hN="#a56eff",dN="#8a3ffc",fN="#6929c4",pN="#491d8b",gN="#31135e",mN="#1c0f30",vN={10:oN,20:lN,30:cN,40:uN,50:hN,60:dN,70:fN,80:pN,90:gN,100:mN},yN="#edf5ff",xN="#d0e2ff",bN="#a6c8ff",wN="#78a9ff",_N="#4589ff",EN="#0f62fe",SN="#0043ce",ON="#002d9c",TN="#001d6c",MN="#001141",CN={10:yN,20:xN,30:bN,40:wN,50:_N,60:EN,70:SN,80:ON,90:TN,100:MN},$N="#e5f6ff",AN="#bae6ff",LN="#82cfff",DN="#33b1ff",kN="#1192e8",RN="#0072c3",IN="#00539a",NN="#003a6d",PN="#012749",UN="#061727",BN={10:$N,20:AN,30:LN,40:DN,50:kN,60:RN,70:IN,80:NN,90:PN,100:UN},VN="#d9fbfb",HN="#9ef0f0",GN="#3ddbd9",FN="#08bdba",zN="#009d9a",jN="#007d79",WN="#005d5d",qN="#004144",YN="#022b30",ZN="#081a1c",XN={10:VN,20:HN,30:GN,40:FN,50:zN,60:jN,70:WN,80:qN,90:YN,100:ZN},KN="#defbe6",QN="#a7f0ba",JN="#6fdc8c",tP="#42be65",eP="#24a148",nP="#198038",iP="#0e6027",rP="#044317",sP="#022d0d",aP="#071908",oP={10:KN,20:QN,30:JN,40:tP,50:eP,60:nP,70:iP,80:rP,90:sP,100:aP},lP="#f2f4f8",cP="#dde1e6",uP="#c1c7cd",hP="#a2a9b0",dP="#878d96",fP="#697077",pP="#4d5358",gP="#343a3f",mP="#21272a",vP="#121619",yP={10:lP,20:cP,30:uP,40:hP,50:dP,60:fP,70:pP,80:gP,90:mP,100:vP},xP="#f4f4f4",bP="#e0e0e0",wP="#c6c6c6",_P="#a8a8a8",EP="#8d8d8d",SP="#6f6f6f",OP="#525252",TP="#393939",MP="#262626",CP="#161616",$P={10:xP,20:bP,30:wP,40:_P,50:EP,60:SP,70:OP,80:TP,90:MP,100:CP},AP="#f7f3f2",LP="#e5e0df",DP="#cac5c4",kP="#ada8a8",RP="#8f8b8b",IP="#726e6e",NP="#565151",PP="#3c3838",UP="#272525",BP="#171414",VP={10:AP,20:LP,30:DP,40:kP,50:RP,60:IP,70:NP,80:PP,90:UP,100:BP},Sm={black:{100:gI},blue:CN,coolGray:yP,cyan:BN,gray:$P,green:oP,magenta:aN,orange:UI,purple:vN,red:ZI,teal:XN,warmGray:VP,white:{0:mI},yellow:MI};const HP=e=>{if(!e)return null;for(const t of Object.keys(Sm)){const n=Sm[t];for(const i of Object.keys(n))if(n[+i]===e)return i}return null},Om=function(){const e=D(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=He(t);let i;if(n&&(i=HP(n?n.hex():null)),i==null){const r=to(n).l;i=Math.abs(r*100-100)}return i>50?"white":"black"};let GP=0;class FP extends lt{constructor(){super(...arguments),this.type="treemap",this.renderType=q.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.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=b(window,"location"),{width:a,height:o}=L.getSVGElementSize(n,{useAttrs:!0}),l=tr({name:r.title||"Treemap",children:i}).sum(f=>f.value).sort((f,p)=>p.value-f.value),c=Aw().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),f=>f.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>GP++).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=D(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:[Z.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=D(this.parentNode).attr("data-uid");return`${r.style.prefix}-clip-${p}`}).append("use").attr("xlink:href",function(){const p=D(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=to(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",Om).attr("x",7).attr("y",18);return s&&p.attr("clip-path",function(){const m=D(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",Om),f=>f.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,i){const r=D(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 l=t.model.getFillColor(o.parent.data.name);return l&&(s=l),He(s).darker(.7).toString()}),t.services.events.dispatchEvent(O.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(O.Treemap.LEAF_MOUSEOVER,{event:n,element:r,datum:i})}).on("mousemove",function(n,i){const r=D(this);t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEMOVE,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,i){t.services.events.dispatchEvent(O.Treemap.LEAF_CLICK,{event:n,element:D(this),datum:i})}).on("mouseout",function(n,i){const r=D(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(O.Treemap.LEAF_MOUSEOUT,{event:n,element:r,datum:i}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:r})})}}class zP extends lt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=q.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.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:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:h}=L.getSVGElementSize(i,{useAttrs:!0});if(u===0||h===0)return;const d=TD().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{[c]:p[c],text:p[l],size:m,value:m}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);d.start();function f(p){const m=L.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[c]}-${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:[Z.FILL],dataGroupName:v[c],originalClassName:`word ${v.size>32?"light":""}`})).style("fill",v=>n.model.getFillColor(v[c],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(l=>l[i]).filter(l=>l),s=L.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=r.length>0,o=a?be(r):[1,1];return Oe().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,i=this,r=ba(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(O.WordCloud.WORD_MOUSEOVER,{event:s,element:D(this),datum:a}),i.services.events.dispatchEvent(O.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:[Z.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=D(this);i.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),i.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){i.services.events.dispatchEvent(O.WordCloud.WORD_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);r(null),i.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),i.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o})})}}class jP extends lt{constructor(){super(...arguments),this.type="geo",this.renderType=q.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:i}=L.getSVGElementSize(t,{useAttrs:!0});if(n<1||i<1)return;const r=this.getProjection(),s=b(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(g=>{typeof a[g].value=="number"?o[g]=a[g]:l[g]=a[g]});const c=tI(s,Object.values(l)),u=KR(s,{type:"GeometryCollection",geometries:Object.values(o)}),h=r.fitSize([n,i],u),d=ub().projection(h);L.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",d);const f=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),p=L.appendOrSelect(t,"defs");L.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",ur()([[0,0],[0,10]]));const m=L.appendOrSelect(t,"g.missing-data");L.appendOrSelect(m,"path").datum(c).attr("d",d).style("fill",`url(#${f})`)}getProjection(){let t=null;switch(b(this.getOptions(),"thematic","projection")){case Qe.geoEqualEarth:t=$b();break;case Qe.geoAlbers:t=_b();break;case Qe.geoConicEqualArea:t=Rh();break;case Qe.geoConicEquidistant:t=Mb();break;case Qe.geoEquirectangular:t=Ob();break;case Qe.geoMercator:t=Eb();break;case Qe.geoNaturalEarth1:t=Ab();break;default:throw new Error("Projection is not supported.")}return t}}class WP extends jP{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=D(this);t.services.events.dispatchEvent(di.CHOROPLETH_MOUSEOVER,{event:i,element:s,datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(dr.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(di.CHOROPLETH_MOUSEMOVE,{event:i,element:D(this),datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(dr.MOVE,{event:i})}).on("click",function(i,r){t.services.events.dispatchEvent(di.CHOROPLETH_CLICK,{event:i,element:D(this),datum:n[r.properties.NAME]})}).on("mouseout",function(i,r){const s=D(this);t.services.events.dispatchEvent(di.CHOROPLETH_MOUSEOUT,{event:i,element:s,datum:n[r.properties.NAME]}),t.services.events.dispatchEvent(dr.HIDE,{event:i,hoveredElement:s})})}}function Tm(e,t){it(2,arguments);var n=dt(e),i=Ut(t);return isNaN(i)?new Date(NaN):(i&&n.setDate(n.getDate()+i),n)}function $c(e,t){it(2,arguments);var n=dt(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 qP=36e5;function Mm(e,t){it(2,arguments);var n=Ut(t);return Js(e,n*qP)}function Cm(e){it(1,arguments);var t=dt(e);return t.setHours(0,0,0,0),t}var YP=864e5;function ZP(e,t){it(2,arguments);var n=Cm(e),i=Cm(t),r=n.getTime()-_l(n),s=i.getTime()-_l(i);return Math.round((r-s)/YP)}var XP=6e4;function Ac(e,t){it(2,arguments);var n=Ut(t);return Js(e,n*XP)}function Lc(e,t){it(2,arguments);var n=Ut(t);return Js(e,n*1e3)}function $m(e,t){it(2,arguments);var n=Ut(t);return $c(e,n*12)}function Ur(e,t){it(2,arguments);var n=dt(e),i=dt(t),r=n.getTime()-i.getTime();return r<0?-1:r>0?1:r}var KP=6e4,QP=36e5;function JP(e,t){it(2,arguments);var n=dt(e),i=dt(t),r=n.getFullYear()-i.getFullYear(),s=n.getMonth()-i.getMonth();return r*12+s}function tU(e,t){it(2,arguments);var n=dt(e),i=dt(t);return n.getFullYear()-i.getFullYear()}function Am(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 eU(e,t){it(2,arguments);var n=dt(e),i=dt(t),r=Am(n,i),s=Math.abs(ZP(n,i));n.setDate(n.getDate()-r*s);var a=+(Am(n,i)===-r),o=r*(s-a);return o===0?0:o}function Dc(e,t){return it(2,arguments),dt(e).getTime()-dt(t).getTime()}var Lm={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},nU="trunc";function kc(e){return e?Lm[e]:Lm[nU]}function iU(e,t,n){it(2,arguments);var i=Dc(e,t)/QP;return kc(n==null?void 0:n.roundingMethod)(i)}function Dm(e,t,n){it(2,arguments);var i=Dc(e,t)/KP;return kc(n==null?void 0:n.roundingMethod)(i)}function rU(e){it(1,arguments);var t=dt(e);return t.setHours(23,59,59,999),t}function sU(e){it(1,arguments);var t=dt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function aU(e){it(1,arguments);var t=dt(e);return rU(t).getTime()===sU(t).getTime()}function oU(e,t){it(2,arguments);var n=dt(e),i=dt(t),r=Ur(n,i),s=Math.abs(JP(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=Ur(n,i)===-r;aU(dt(e))&&s===1&&Ur(e,i)===1&&(o=!1),a=r*(s-Number(o))}return a===0?0:a}function km(e,t,n){it(2,arguments);var i=Dc(e,t)/1e3;return kc(n==null?void 0:n.roundingMethod)(i)}function lU(e,t){it(2,arguments);var n=dt(e),i=dt(t),r=Ur(n,i),s=Math.abs(tU(n,i));n.setFullYear(1584),i.setFullYear(1584);var a=Ur(n,i)===-r,o=r*(s-Number(a));return o===0?0:o}function cU(e,t){it(2,arguments);var n=Ut(t);return Tm(e,-n)}function uU(e,t){it(2,arguments);var n=Ut(t);return $c(e,-n)}function hU(e,t){it(2,arguments);var n=Ut(t);return Mm(e,-n)}function Rm(e,t){it(2,arguments);var n=Ut(t);return Ac(e,-n)}function Im(e,t){it(2,arguments);var n=Ut(t);return Lc(e,-n)}function dU(e,t){it(2,arguments);var n=Ut(t);return $m(e,-n)}function Nm(e){var t=e==null?0:e.length;return t?ha(e,1):[]}class fU extends ln{zoomIn(t,n,i){let r,s,a;const o=i||vi;t&&(r=t.x,s=t.y,a=2);const{width:l,height:c}=L.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${l/2}, ${c/2}) scale(${a}) translate(${-r},${-s})`),this.services.events.dispatchEvent(O.CanvasZoom.CANVAS_ZOOM_IN,{element:D(t)})}zoomOut(t,n){const i=n||vi;t.transition().duration(i.duration).ease(i.ease).attr("transform",""),this.services.events.dispatchEvent(O.CanvasZoom.CANVAS_ZOOM_OUT)}}class pU extends ln{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 gU extends ln{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 mU extends ln{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(O.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(b(Mf,n,"duration")||Mf.default.duration)}getPendingTransitions(){return this.pendingTransitions}}let vU=class extends ln{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=b(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=b(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 b(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===B.BOTTOM||t===B.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(B).map(t=>B[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===B.LEFT||this.rangeAxisPosition===B.RIGHT)&&(this.domainAxisPosition===B.BOTTOM||this.domainAxisPosition===B.TOP)?this.orientation=Vt.VERTICAL:this.orientation=Vt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,i,r;const s=this.model.getOptions(),a=b(s,"axes");((t=a[B.LEFT])!=null&&t.correspondingDatasets&&a[B.RIGHT]||(n=a[B.RIGHT])!=null&&n.correspondingDatasets&&a[B.LEFT]||(i=a[B.TOP])!=null&&i.correspondingDatasets&&a[B.BOTTOM]||(r=a[B.BOTTOM])!=null&&r.correspondingDatasets&&a[B.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=b(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]===W.LINEAR||this.scaleTypes[t]===W.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=[B.BOTTOM,B.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[B.LEFT,B.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=b(s,"axes")[i],{mapsTo:o}=a,l=b(r,o)!==null?r[o]:r;let c;switch(n){case W.LABELS:c=t(l)+t.step()/2;break;case W.TIME:c=t(new Date(l));break;default:c=t(l)}return c}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),i=this.getRangeAxisPosition({datum:t}),r=this.scales[i],s=this.model.getOptions(),a=b(s,"axes")[i],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[r(b(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),r(b(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:l)]}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 b(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return b(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const i=this.model.getOptions(),r=b(i,"axes",t);if(r.scaleType===W.TIME){const s=b(i,"timeScale","addSpaceOnEdges");return yU(n,s)}else return xU(n,gn.paddingRatio,r.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=b(t,"axes"),i=this.isDualAxes();return b(n,B.LEFT)===null&&b(n,B.RIGHT)!==null||b(n,B.RIGHT,"main")===!0||i&&b(n,B.LEFT,"correspondingDatasets")?{primary:B.RIGHT,secondary:B.LEFT}:{primary:B.LEFT,secondary:B.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=b(t,"axes"),i=this.isDualAxes();return b(n,B.BOTTOM)===null&&b(n,B.TOP)!==null||b(n,B.TOP,"main")===!0||i&&b(n,B.BOTTOM,"correspondingDatasets")?{primary:B.TOP,secondary:B.BOTTOM}:{primary:B.BOTTOM,secondary:B.TOP}}findDomainAndRangeAxesPositions(t,n){const i=this.model.getOptions(),r=b(i,"axes",t.primary),s=b(i,"axes",n.primary),a=r.scaleType||W.LINEAR,o=s.scaleType||W.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===W.LABELS||o===W.TIME)&&a===W.LABELS||a===W.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),i=b(n,"axes",t),r=b(n,"bounds"),{includeZero:s}=i,a=b(i,"scaleType")||W.LINEAR;if(this.model.isDataEmpty())return[];if(i.binned){const{bins:v}=this.model.getBinConfigurations();return[0,En(v,y=>y.length)]}else if(i.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),y=this.model.getStackKeys({bins:v});return[y[0].split("-")[0],y[y.length-1].split("-")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:h}=i,{reference:d,compareTo:f}=gn.ratio;if(i.domain)return a===W.LABELS?i.domain:(a===W.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===W.LABELS)return Cr(o.map(v=>v[c]));let p,m;const g=this.model.getDataGroupNames();if(a===W.LABELS_RATIO)return o.map(v=>`${v[d]}/${v[f]}`);if(a===W.TIME)m=o.map(v=>+new Date(v[c]));else if(r&&n.axes)m=[],o.forEach(v=>{m.push(v[c]),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,y=this.model.getDataValuesGroupedByKeys({groups:g}),x=o.filter(_=>!g.includes(_[v])),S=[];y.forEach(_=>{const{...E}=_;let T=0,k=0;Object.values(E).forEach(I=>{isNaN(I)||(I<0?k+=I:T+=I)}),S.push([k,T])}),m=[...Nm(S),...x.map(_=>_[c])]}else m=[],o.forEach(v=>{const y=v[c];Array.isArray(y)&&y.length===2?(m.push(y[0]),m.push(y[1])):(l&&m.push(Math.max(v[c],v[l])),m.push(y))});return a!==W.TIME&&a!==W.LOG&&s&&m.push(0),h&&h.length>0&&h.forEach(v=>{const y=b(v,"value");y!==null&&m.push(y)}),p=be(m),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),i=b(n,"axes",t);if(!i)return null;const r=b(i,"scaleType")||W.LINEAR;this.scaleTypes[t]=r;let s;return r===W.TIME?s=bd():r===W.LOG?s=ed().base(i.base||10):r===W.LABELS||r===W.LABELS_RATIO?s=ir():s=Oe(),s.domain(this.getScaleDomain(t)),s}getHighestDomainThreshold(){const t=b(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)===W.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=b(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 yU(e,t){const n=new Date(e[0]),i=new Date(e[1]);return lU(i,n)>1?[dU(n,t),$m(i,t)]:oU(i,n)>1?[uU(n,t),$c(i,t)]:eU(i,n)>1?[cU(n,t),Tm(i,t)]:iU(i,n)>1?[hU(n,t),Mm(i,t)]:Dm(i,n)>30?[Rm(n,t*30),Ac(i,t*30)]:Dm(i,n)>1?[Rm(n,t),Ac(i,t)]:km(i,n)>15?[Im(n,t*15),Lc(i,t*15)]:km(i,n)>1?[Im(n,t),Lc(i,t)]:[n,i]}function xU([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===W.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 bU=class extends ln{constructor(){super(...arguments),this.curveTypes={curveLinear:Hs,curveLinearClosed:kd,curveBasis:SE,curveBasisClosed:OE,curveBasisOpen:TE,curveBundle:ME,curveCardinal:CE,curveCardinalClosed:$E,curveCardinalOpen:AE,curveCatmullRom:LE,curveCatmullRomClosed:DE,curveCatmullRomOpen:kE,curveMonotoneX:RE,curveMonotoneY:IE,curveNatural:NE,curveStep:PE,curveStepAfter:BE,curveStepBefore:UE}}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 wU extends ln{isZoomBarEnabled(){if(!this.services.cartesianScales||!b(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=b(this.model.getOptions(),"axes",t,"scaleType");return t===B.BOTTOM&&n===W.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=b(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,be(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(O.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return b(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var i;const r=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=b(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&a&&r){const o=s.stacked?"sharedStackKey":(i=this.services.cartesianScales)==null?void 0:i.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=r[0]&&new Date(c[o])<=r[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var n;const i=this.model.get("zoomDomain"),r=ue.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 l=s.range(),c=o-a,u=Math.min((l[1]-l[0])/2*(t/2),c/2);let h=a+u,d=o-u;h>=d&&(h=a+c/2-r/2,d=o-c/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),l=Math.max(r-o,a[0]),c=Math.min(s+o,a[1]),u=[i.invert(l),i.invert(c)];(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=b(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 b(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return b(this.model.getOptions(),"zoomBar",t,"locked")}}function _U(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 EU(e,t,n){var i=e.length;return n=n===void 0?i:n,!t&&n>=i?e:_U(e,t,n)}var SU="\\ud800-\\udfff",OU="\\u0300-\\u036f",TU="\\ufe20-\\ufe2f",MU="\\u20d0-\\u20ff",CU=OU+TU+MU,$U="\\ufe0e\\ufe0f",AU="\\u200d",LU=RegExp("["+AU+SU+CU+$U+"]");function Pm(e){return LU.test(e)}function DU(e){return e.split("")}var Um="\\ud800-\\udfff",kU="\\u0300-\\u036f",RU="\\ufe20-\\ufe2f",IU="\\u20d0-\\u20ff",NU=kU+RU+IU,PU="\\ufe0e\\ufe0f",UU="["+Um+"]",Rc="["+NU+"]",Ic="\\ud83c[\\udffb-\\udfff]",BU="(?:"+Rc+"|"+Ic+")",Bm="[^"+Um+"]",Vm="(?:\\ud83c[\\udde6-\\uddff]){2}",Hm="[\\ud800-\\udbff][\\udc00-\\udfff]",VU="\\u200d",Gm=BU+"?",Fm="["+PU+"]?",HU="(?:"+VU+"(?:"+[Bm,Vm,Hm].join("|")+")"+Fm+Gm+")*",GU=Fm+Gm+HU,FU="(?:"+[Bm+Rc+"?",Rc,Vm,Hm,UU].join("|")+")",zU=RegExp(Ic+"(?="+Ic+")|"+FU+GU,"g");function jU(e){return e.match(zU)||[]}function WU(e){return Pm(e)?jU(e):DU(e)}function qU(e){return function(t){t=Tr(t);var n=Pm(t)?WU(t):void 0,i=n?n[0]:t.charAt(0),r=n?EU(n,1).join(""):t.slice(1);return i[e]()+r}}var YU=qU("toUpperCase");const ZU=YU;function XU(e){return ZU(Tr(e).toLowerCase())}var KU=zg(function(e,t,n){return t=t.toLowerCase(),e+(n?XU(t):t)});const QU=KU;class Le{constructor(t,n){this.components=[],this.services={canvasZoom:fU,domUtils:L,events:pU,files:gU,gradientUtils:nc,transitions:mU},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(O.Model.UPDATE,i=>{const r=!!b(i,"detail","animate");this.update(r)}),this.model.setData(n.data),this.services.events.addEventListener(O.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(r=>{this.services[r].update()}),this.components.forEach(r=>r.render(t));const n=this.services.transitions.getPendingTransitions(),i=Object.keys(n).map(r=>n[r].end().catch(s=>s));Promise.all(i).then(()=>this.services.events.dispatchEvent(O.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=b(i,"toolbar","enabled"),s={id:"legend",components:[new Oc(this.model,this.services)],growth:tt.PREFERRED},a=b(i,"canvasZoom","enabled");a&&a===!0&&t.push(new UR(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new Pr(this.model,this.services)],growth:tt.STRETCH},c={id:"toolbar",components:[new Ir(this.model,this.services)],growth:tt.PREFERRED},u={id:"header",components:[new re(this.model,this.services,[l,...r?[c]:[]],{direction:bt.ROW,alignItems:fi.CENTER})],growth:tt.PREFERRED},h={id:"graph-frame",components:t,growth:tt.STRETCH,renderType:b(n,"graphFrameRenderType")||q.SVG},d=b(n,"excludeLegend")!==!0&&i.legend.enabled!==!1;let f=bt.COLUMN;if(d){const v=b(i,"legend","position");v==="left"?(f=bt.ROW,i.legend.orientation||(i.legend.orientation=pr.VERTICAL)):v==="right"?(f=bt.ROW_REVERSE,i.legend.orientation||(i.legend.orientation=pr.VERTICAL)):v==="bottom"&&(f=bt.COLUMN_REVERSE)}const p={id:"spacer",components:[new cn(this.model,this.services)],growth:tt.PREFERRED},m={id:"full-frame",components:[new re(this.model,this.services,[...d?[s]:[],...d?[p]:[],h],{direction:f})],growth:tt.STRETCH},g=[];if(o||r){g.push(u);const v={id:"spacer",components:[new cn(this.model,this.services,r?{size:15}:void 0)],growth:tt.PREFERRED};g.push(v)}return g.push(m),[new Tc(this.model,this.services),new Ia(this.model,this.services),new re(this.model,this.services,g,{direction:bt.COLUMN})]}}class ae extends Le{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:vU,curves:bU,zoom:wU}),this.model=new jn(this.services)}getAxisChartComponents(t,n){const i=this.model.getOptions(),r=b(i,"zoomBar",B.TOP,"enabled"),s=b(i,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=b(i,"axes",a,"scaleType"),l=r&&a===B.BOTTOM&&o===W.TIME,c=this.services.zoom.isZoomBarLocked(B.TOP),u=!!this.model.getOptions().title,h={id:"title",components:[new Pr(this.model,this.services)],growth:tt.STRETCH},d={id:"toolbar",components:[new Ir(this.model,this.services)],growth:tt.PREFERRED},f={id:"header",components:[new re(this.model,this.services,[h,...s?[d]:[]],{direction:bt.ROW,alignItems:fi.CENTER})],growth:tt.PREFERRED},p={id:"legend",components:[new Oc(this.model,this.services)],growth:tt.PREFERRED};l&&!c&&t.push(new am(this.model,this.services),new cm(this.model,this.services)),t.push(new VR(this.model,this.services)),t.push(new HR(this.model,this.services));const m={id:"graph-frame",components:t,growth:tt.STRETCH,renderType:q.SVG},g=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=bt.COLUMN;if(g){const E=b(this.model.getOptions(),"legend","position");E===fr.LEFT?(v=bt.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=pr.VERTICAL)):E===fr.RIGHT?(v=bt.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=pr.VERTICAL)):E===fr.BOTTOM&&(v=bt.COLUMN_REVERSE)}const y={id:"spacer",components:[new cn(this.model,this.services)],growth:tt.PREFERRED},x={id:"full-frame",components:[new re(this.model,this.services,[...g?[p]:[],...g?[y]:[],m],{direction:v})],growth:tt.STRETCH},S={id:"zoom-bar",components:[new BR(this.model,this.services)],growth:tt.PREFERRED,renderType:q.SVG},_=[];if(u||s){_.push(f);const E={id:"spacer",components:[new cn(this.model,this.services,s?{size:15}:void 0)],growth:tt.PREFERRED};_.push(E)}return l&&_.push(S),_.push(x),[new um(this.model,this.services),new Ia(this.model,this.services),new re(this.model,this.services,_,{direction:bt.COLUMN})]}}class JU extends Le{constructor(t,n){super(t,n),this.model=new wA(this.services),this.model.setOptions(Tt(xt.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new GR(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class tB extends ae{constructor(t,n){super(t,n),this.model.setOptions(Tt(rn(xt.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new xn(this.model,this.services),new $i(this.model,this.services),new hm(this.model,this.services),new Ve(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new Kt(this.model,this.services,{skeleton:Nt.GRID})];return this.getAxisChartComponents(t)}}class eB extends ae{constructor(t,n){super(t,n),this.model=new _A(this.services),this.model.setOptions(Tt(xt.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new jR(this.model,this.services),new Ai(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class nB extends ae{constructor(t,n){super(t,n),this.model.setOptions(Tt(xt.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new xn(this.model,this.services),new WR(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.GRID})];return this.getAxisChartComponents(t)}}class iB extends ae{constructor(t,n){super(t,n),this.model=new EA(this.services),this.model.setOptions(Tt(xt.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new qR(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.GRID})];return this.getAxisChartComponents(t)}}class rB extends Le{constructor(t,n){super(t,n),this.model=new SA(this.services),this.model.setOptions(Tt(xt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const i=this.model.getOptions(),r=b(i,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new Pr(this.model,this.services)],growth:tt.STRETCH},o={id:"toolbar",components:[new Ir(this.model,this.services)],growth:tt.PREFERRED},l={id:"header",components:[new re(this.model,this.services,[a,...r?[o]:[]],{direction:bt.ROW,alignItems:fi.CENTER})],growth:tt.PREFERRED},c={id:"legend",components:[new gm(this.model,this.services,{chartType:"choropleth"})],growth:tt.PREFERRED,renderType:q.SVG},u={id:"graph-frame",components:t,growth:tt.STRETCH,renderType:q.SVG},h=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,d=bt.COLUMN_REVERSE,f={id:"spacer",components:[new cn(this.model,this.services,{size:15})],growth:tt.PREFERRED},p={id:"full-frame",components:[new re(this.model,this.services,[...h?[c]:[],...h?[f]:[],u],{direction:d})],growth:tt.STRETCH},m=[];if(s||r){m.push(l);const g={id:"spacer",components:[new cn(this.model,this.services,r?{size:15}:void 0)],growth:tt.PREFERRED};m.push(g)}return m.push(p),[new Tc(this.model,this.services),new Ia(this.model,this.services),new re(this.model,this.services,m,{direction:bt.COLUMN})]}getComponents(){const t=[new WP(this.model,this.services)];return this.getChartComponents(t)}}class sB extends Le{constructor(t,n){super(t,n),this.model=new OA(this.services),this.model.setOptions(Tt(xt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new rI(this.model,this.services)];return this.getChartComponents(t)}}const zm={[ge.LINE]:[$i,Ve],[ge.SCATTER]:[Ve],[ge.AREA]:[hm,$i,Ve],[ge.STACKED_AREA]:[wm,$i,Em,Ua],[ge.SIMPLE_BAR]:[bm],[ge.GROUPED_BAR]:[xm,Ai],[ge.STACKED_BAR]:[_m,Ua]};class aB extends ae{constructor(t,n){super(t,n);const i=Tt(xt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),i.comboChartTypes=[{type:ge.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(zm).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 l=`${QU(r.type)}Chart`;return a=X({},xt[l],this.model.getOptions(),r.options),r.type===ge.STACKED_AREA&&(o=!0),zm[r.type].map(c=>new c(this.model,this.services,{groups:r.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=X({},this.model.getOptions(),r.options),new s(this.model,this.services,{groups:r.correspondingDatasets,id:n++,options:a})}).filter(r=>r!==null);return Nm(i)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(r=>r.type===ge.STACKED_BAR||r.type===ge.STACKED_AREA),i=[new se(this.model,this.services),new de(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.GRID}),...n?[]:[new xn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(i)}}class jm extends Le{constructor(t,n,i=!1){super(t,n),this.model=new TA(this.services),!i&&(this.model.setOptions(Tt(xt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new mm(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.PIE})];return this.getChartComponents(t)}}class oB extends jm{constructor(t,n){super(t,n,!0),this.model.setOptions(Tt(xt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new aI(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.DONUT})];return this.getChartComponents(t)}}class lB extends Le{constructor(t,n){super(t,n),this.model=new MA(this.services),this.model.setOptions(Tt(xt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new oI(this.model,this.services)];return this.getChartComponents(t)}}class cB extends ae{constructor(t,n){super(t,n),this.model.setOptions(Tt(xt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new xm(this.model,this.services),new Ai(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class uB extends ae{constructor(t,n){super(t,n),this.model=new CA(this.services),this.model.setOptions(Tt(xt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const i=this.model.getOptions(),r=b(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:tt.STRETCH},o={id:"toolbar",components:[new Ir(this.model,this.services)],growth:tt.PREFERRED},l={id:"header",components:[new re(this.model,this.services,[a,...r?[o]:[]],{direction:bt.ROW,alignItems:fi.CENTER})],growth:tt.PREFERRED},c={id:"legend",components:[new gm(this.model,this.services,{chartType:"heatmap"})],growth:tt.PREFERRED,renderType:q.SVG},u={id:"graph-frame",components:t,growth:tt.STRETCH,renderType:q.SVG},h=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,d=bt.COLUMN_REVERSE,f={id:"spacer",components:[new cn(this.model,this.services,{size:15})],growth:tt.PREFERRED},p={id:"full-frame",components:[new re(this.model,this.services,[...h?[c]:[],...h?[f]:[],u],{direction:d})],growth:tt.STRETCH},m=[];if(s||r){m.push(l);const g={id:"spacer",components:[new cn(this.model,this.services,r?{size:15}:void 0)],growth:tt.PREFERRED};m.push(g)}return m.push(p),[new um(this.model,this.services),new Ia(this.model,this.services),new re(this.model,this.services,m,{direction:bt.COLUMN})]}getComponents(){const t=[new se(this.model,this.services),new lI(this.model,this.services)];return this.getAxisChartComponents(t)}}class hB extends ae{constructor(t,n){super(t,n),this.model=new $A(this.services),this.model.setOptions(Tt(xt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new nI(this.model,this.services),new cI(this.model,this.services)];return this.getAxisChartComponents(t)}}class dB extends ae{constructor(t,n){super(t,n),this.model.setOptions(Tt(xt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new xn(this.model,this.services),new $i(this.model,this.services),new Ve(this.model,this.services,{handleThresholds:!0}),new fI(this.model,this.services),new Ai(this.model,this.services)];return this.getAxisChartComponents(t)}}class fB extends ae{constructor(t,n){super(t,n),this.model.setOptions(Tt(xt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new xn(this.model,this.services),new uI(this.model,this.services),new Ve(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.GRID})];return this.getAxisChartComponents(t)}}class pB extends Le{constructor(t,n){var i;super(t,n),this.model=new AA(this.services);const r=(i=n.options.meter)!=null&&i.proportional?X(rn(xt.proportionalMeterChart),n.options):X(rn(xt.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const t=[...b(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new iI(this.model,this.services)],growth:tt.STRETCH,renderType:q.SVG},{id:"spacer",components:[new cn(this.model,this.services,{size:8})],growth:tt.STRETCH}]:[],{id:"meter-graph",components:[new hI(this.model,this.services)],growth:tt.STRETCH,renderType:q.SVG}],n=[new re(this.model,this.services,t,{direction:bt.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:q.HTML})}}class gB extends Le{constructor(t,n){super(t,n),this.model=new LA(this.services),this.model.setOptions(Tt(xt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new dI(this.model,this.services)];return this.getChartComponents(t)}}class mB extends ae{constructor(t,n){super(t,n),this.model.setOptions(Tt(xt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new xn(this.model,this.services),new Ve(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.GRID})];return this.getAxisChartComponents(t)}}class vB extends Le{constructor(t,n){super(t,n),this.model=new DA(this.services),this.model.setOptions(Tt(xt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new pI(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class yB extends Le{constructor(t,n){super(t,n),this.model=new kA(this.services),this.model.setOptions(Tt(xt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new FP(this.model,this.services)];return this.getChartComponents(t)}}class xB extends ae{constructor(t,n){super(t,n),this.model.setOptions(Tt(xt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new bm(this.model,this.services),new Ai(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class bB extends ae{constructor(t,n){super(t,n),this.model.setOptions(Tt(xt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new Ua(this.model,this.services),new wm(this.model,this.services),new $i(this.model,this.services,{stacked:!0}),new Em(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new Kt(this.model,this.services,{skeleton:Nt.GRID})];return this.getAxisChartComponents(t)}}class wB extends ae{constructor(t,n){super(t,n),this.model.setOptions(Tt(xt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new se(this.model,this.services),new de(this.model,this.services),new Ua(this.model,this.services),new _m(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.VERT_OR_HORIZ}),new Ai(this.model,this.services)];return this.getAxisChartComponents(t)}}class _B extends Le{constructor(t,n){super(t,n),this.model=new RA(this.services),this.model.setOptions(Tt(xt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new zP(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.PIE})];return this.getChartComponents(t)}}function Ot(e,t){return xe.defineComponent({name:t,props:{data:{type:Object,required:!0},options:{type:Object,required:!0}},setup(n){const i=xe.ref(null),r=xe.ref(null),{data:s,options:a}=xe.toRefs(n);return xe.onMounted(()=>{r.value=new e(i.value,{data:s.value,options:a.value})}),xe.watch(s,o=>{var l;(l=r.value)==null||l.model.setData(o)},{immediate:!0}),xe.watch(a,o=>{var l;(l=r.value)==null||l.model.setOptions(o)}),{chart:r,chartDiv:i}},template:'<div ref="chartDiv"></div>'})}const Wm=Ot(JU,"CcvAlluvialChart"),qm=Ot(tB,"CcvAreaChart"),Ym=Ot(eB,"CcvBoxplotChart"),Zm=Ot(nB,"CcvBubbleChart"),Xm=Ot(iB,"CcvBulletChart"),Km=Ot(rB,"ExperimentalCcvChoroplethChart"),Qm=Ot(sB,"CcvCirclePackChart"),Jm=Ot(aB,"CcvComboChart"),tv=Ot(oB,"CcvDonutChart"),ev=Ot(lB,"CcvGaugeChart"),nv=Ot(cB,"CcvGroupedBarChart"),iv=Ot(uB,"CcvHeatmapChart"),rv=Ot(hB,"CcvHistogramChart"),sv=Ot(dB,"CcvLineChart"),av=Ot(fB,"CcvLollipopChart"),ov=Ot(pB,"CcvMeterChart"),lv=Ot(jm,"CcvPieChart"),cv=Ot(gB,"CcvRadarChart"),uv=Ot(mB,"CcvScatterChart"),hv=Ot(xB,"CcvSimpleBarChart"),dv=Ot(bB,"CcvStackedAreaChart"),fv=Ot(wB,"CcvStackedBarChart"),pv=Ot(vB,"CcvTreeChart"),gv=Ot(yB,"CcvTreemapChart"),mv=Ot(_B,"CcvWordCloudChart"),EB=[Wm,qm,Ym,Zm,Xm,Km,Qm,Jm,tv,ev,nv,iv,rv,sv,av,ov,lv,cv,uv,hv,dv,fv,pv,gv,mv],SB={install(e,t){for(const n of EB)(!t||t.includes(n.name))&&e.component(n.name,n)}};nt.CcvAlluvialChart=Wm,nt.CcvAreaChart=qm,nt.CcvBoxplotChart=Ym,nt.CcvBubbleChart=Zm,nt.CcvBulletChart=Xm,nt.CcvCirclePackChart=Qm,nt.CcvComboChart=Jm,nt.CcvDonutChart=tv,nt.CcvGaugeChart=ev,nt.CcvGroupedBarChart=nv,nt.CcvHeatmapChart=iv,nt.CcvHistogramChart=rv,nt.CcvLineChart=sv,nt.CcvLollipopChart=av,nt.CcvMeterChart=ov,nt.CcvPieChart=lv,nt.CcvRadarChart=cv,nt.CcvScatterChart=uv,nt.CcvSimpleBarChart=hv,nt.CcvStackedAreaChart=dv,nt.CcvStackedBarChart=fv,nt.CcvTreeChart=pv,nt.CcvTreemapChart=gv,nt.CcvWordCloudChart=mv,nt.ExperimentalCcvChoroplethChart=Km,nt.default=SB,Object.defineProperties(nt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
83
|
+
</svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=b(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],h=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.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:_t(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else h=r.value;const d=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:d,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:h},...c,...u]})}t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=D(this),s=i.classed("non-focal"),a=b(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,vr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,vr),n.stopPropagation()}t.services.events.dispatchEvent(O.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function lI(e,t){const n=Ur(this._current,e);return r=>(this._current=n(r),t(this._current))}class mm extends lt{constructor(){super(...arguments),this.type="pie",this.renderType=q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return wt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie,o=this.model.getDisplayData().filter(T=>T[a]>0),l=this.computeRadius();this.arc=ci().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=ci().innerRadius(this.getInnerRadius()).outerRadius(l+wt.hoverArc.outerRadiusOffset);const c=mE().value(T=>T[a]).sort(b(i,"pie","sortFunction")).padAngle(wt.padAngle)(o),u=L.appendOrSelect(r,"g.slices").attr("role",it.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,T=>T.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",T=>this.model.getColorClassName({classNameTypes:[X.FILL],dataGroupName:T.data[s],originalClassName:"slice"})).style("fill",T=>n.model.getFillColor(T.data[s])).attr("d",this.arc).transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",it.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",T=>`${T[a]}, ${Pp(T.data[a],o,a)+"%"}`).attrTween("d",function(T){return lI.bind(this)(T,n.arc)});const h=i.pie.labels.enabled,d=h?c.filter(T=>T.data[a]>0):[],f=L.appendOrSelect(r,"g.labels").attr("role",it.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(d,T=>T.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(T=>i.pie.labels.formatter?i.pie.labels.formatter(T):Pp(T.data[a],o,a)+"%").datum(function(T){const k=l+7,I=(T.endAngle-T.startAngle)/2+T.startAngle,$=I/Math.PI*180,M=this.getComputedTextLength();return T.textOffsetX=M/2,T.textOffsetY=$>90&&$<270?10:0,T.xPosition=(T.textOffsetX+k)*Math.sin(I),T.yPosition=(T.textOffsetY+k)*-Math.cos(I),T}).attr("transform",function(T,k){const I=d.length,$=(T.endAngle-T.startAngle)*(180/Math.PI);if(k>=I-2&&$<wt.callout.minSliceDegree){let M,V;return T.index===I-1?(M=T.xPosition+wt.callout.offsetX+wt.callout.textMargin+T.textOffsetX,V=T.yPosition-wt.callout.offsetY,T.direction=Ws.RIGHT,m.push(T)):(M=T.xPosition-wt.callout.offsetX-T.textOffsetX-wt.callout.textMargin,V=T.yPosition-wt.callout.offsetY,T.direction=Ws.LEFT,m.push(T)),`translate(${M}, ${V})`}return`translate(${T.xPosition}, ${T.yPosition})`}),this.renderCallouts(m);const g=b(i,"donut")?"donut":"pie",v=b(i,g,"alignment"),{width:y}=L.getSVGElementSize(this.getParent(),{useAttrs:!0}),x=h?wt.xOffset:0,S=h?wt.yOffset:0;let _=l+x;v===It.CENTER?_=y/2:v===It.RIGHT&&(_=y-l-wt.xOffset);let E=l+S;m.length>0&&(E+=wt.yOffsetCallout),r.attr("x",_+7).attr("y",E),this.addEventListeners()}renderCallouts(t){const n=L.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",it.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",it.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===Ws.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+wt.callout.offsetX,y:o-wt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-wt.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-wt.callout.offsetX,y:o-wt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+wt.callout.horizontalLineLength),s}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return D(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),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return D(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,r){const i=D(this);i.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(O.Pie.SLICE_MOUSEOVER,{event:n,element:D(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Pie.SLICE_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.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(O.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=L.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+wt.radiusOffset:i}}class cI extends mm{constructor(){super(...arguments),this.type="donut",this.renderType=q.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const r=L.appendOrSelect(this.getComponentContainer(),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=b(i,"donut","center","label");L.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.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(D(this))}),a!==null&&a!==""&&L.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=b(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=gu:s=oe;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;t.text(l(a(o)))}}}const vm="4,10 8,6 12,10",ym="12,6 8,10 4,6";class uI extends lt{constructor(){super(...arguments),this.type="gauge",this.renderType=q.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return jg(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 b(t,"gauge","type")===pr.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(b(n,"gauge","deltaArrow","direction")){case xl.UP:return vm;case xl.DOWN:return ym;default:return t>0?vm:ym}}render(t=!0){const n=this.getComponentContainer().attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,h=this.computeRadius(),d=this.getInnerRadius();this.backgroundArc=ci().innerRadius(d).outerRadius(h).startAngle(c).endAngle(u),this.arc=ci().innerRadius(d).outerRadius(h).startAngle(o).endAngle(c),L.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([i]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[X.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>b(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",it.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",v=>v),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const p=b(r,"gauge","alignment"),{width:m}=L.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(),r=b(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=b(n,"gauge","valueFontSize"),l=b(n,"gauge","deltaFontSize"),c=b(n,"gauge","numberSpacing"),u=b(n,"gauge","showPercentageSymbol");let h=0;r===pr.FULL&&!s?h=l(a):r===pr.SEMI&&s&&(h=-(l(a)+c));const d=L.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${h})`),f=o(a),p=L.appendOrSelect(d,"g.gauge-value-number"),m=b(n,"gauge","numberFormatter"),g=p.selectAll("text.gauge-value-number").data([i]);g.enter().append("text").attr("class","gauge-value-number").merge(g).style("font-size",`${f}px`).attr("text-anchor","middle").text(T=>m(T));const{width:v}=L.getSVGElementSize(L.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),y=f/2,x=u?"%":"",S=L.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${y}px`).attr("x",v/2).text(x),{width:_,height:E}=L.getSVGElementSize(S,{useBBox:!0});S.attr("y",`-${E/2}px`),p.attr("transform",`translate(-${_/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta();if(i){const s=this.computeRadius(),a=i?b(r,"gauge","deltaFontSize"):()=>0,o=i?b(r,"gauge","numberFormatter"):()=>null,l=b(r,"gauge","deltaArrow","size"),c=b(r,"gauge","numberSpacing"),u=b(r,"gauge","showPercentageSymbol"),h=L.appendOrSelect(n,"g.gauge-numbers"),d=L.appendOrSelect(h,"g.gauge-delta").attr("transform",`translate(0, ${a(s)+c})`),f=L.appendOrSelect(d,"text.gauge-delta-number"),p=u?"%":"";f.data(i===null?[]:[i]),f.enter().append("text").classed("gauge-delta-number",!0).merge(f).attr("text-anchor","middle").style("font-size",`${a(s)}px`).text(y=>`${o(y)}${p}`);const{width:m}=L.getSVGElementSize(L.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),g=b(r,"gauge","deltaArrow","enabled"),v=d.selectAll("svg.gauge-delta-arrow").data(i!==null&&g?[i]:[]);v.enter().append("svg").merge(v).attr("class","gauge-delta-arrow").attr("x",-l(s)-m/2).attr("y",-l(s)/2-a(s)*.35).attr("width",l(s)).attr("height",l(s)).attr("viewBox","0 0 16 16").each(function(){const y=D(this);L.appendOrSelect(y,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const x=b(r,"gauge","status");L.appendOrSelect(y,"polygon.gauge-delta-arrow").attr("class",x!==null?`gauge-delta-arrow status--${x}`:"").attr("points",t.getArrow(i))}),v.exit().remove(),f.exit().remove()}else{const s=n.select("g.gauge-delta");s.empty()||s.remove()}}getInnerRadius(){const t=this.computeRadius(),n=b(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEOVER,{event:n,element:D(this),datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Gauge.ARC_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=b(t,"gauge","type"),{width:r,height:i}=L.getSVGElementSize(this.parent,{useAttrs:!0});return n===pr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class xm extends Cc{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=q.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({withinChartClip:!0}),a=Ci(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 l=o.enter().append("g").classed("bars",!0).attr("role",it.GROUP).attr("data-name","bars").merge(o);l.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()===Vt.VERTICAL?`translate(${h}, 0)`:`translate(0, ${h})`});const c=l.selectAll("path.bar").data(u=>this.getDataCorrespondingToLabel(u),u=>u[i]);c.exit().attr("opacity",0).remove(),c.enter().append("path").attr("opacity",0).merge(c).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:[X.FILL],dataGroupName:u[i],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[i])).attr("d",u=>{const h=this.groupScale(u[i]),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),y=this.services.cartesianScales.getDomainValue(u)-d/2,x=y+d;if(!this.isOutsideZoomedDomain(y,x))return Zt({x0:f,x1:p,y0:g,y1:v},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",it.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,r){const i=D(this);i.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(n=>{const r=this.services.cartesianScales.getDomainIdentifier(n);return n[r].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 r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}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=b(t,"bars","width"),r=b(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const i=this.model.getGroupedData(this.configs.groups).length,s=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-s)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=ri().domain(t).rangeRound([0,this.getGroupWidth()])}}class hI extends lt{constructor(){super(...arguments),this.type="heatmap",this.renderType=q.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",h=null,d=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const m=this.matrix[r][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][r].value=="number"){const m=this.matrix[p][r].value;if(h===null){h=m,d=m,f=m;return}h+=m,d=m<d?m:d,f=m>f?m:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${un(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${un(l.range())},${c(r)})`),this.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n.event,hoveredElement:D(t.detail.element),items:[{label:u,value:r,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(O.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(O.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(O.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(O.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(O.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),b(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),h=i.range(),d=s.range();this.xBandwidth=Math.abs((h[1]-h[0])/l.length),this.yBandwidth=Math.abs((d[1]-d[0])/c.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(${i(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,r){const i=L.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);L.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),L.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),L.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),L.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=b(this.getOptions(),"heatmap","divider","state");return t!==gi.OFF&&(t===gi.AUTO&&Of.minCellDividerDimension<=this.xBandwidth&&Of.minCellDividerDimension<=this.yBandwidth||t===gi.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=_t(r,"tooltip.totalLabel"),s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const h=D(this),d=h.select("rect.heat");if(!d.classed("null-state")){const f=$i(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(O.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i||"Total",value:u.value,color:d.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:D(this),datum:u}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(O.Heatmap.HEATMAP_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){const h=D(this).select("rect.heat"),d=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),d||(t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{event:c,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(O.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class dI extends lt{constructor(){super(...arguments),this.type="histogram",this.renderType=q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.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[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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer(),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>_t(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",it.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(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:[X.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s])).attr("d",u=>{const h=_t(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)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Vt.VERTICAL?g+=1:g-=1),Zt({x0:f,x1:p,y0:m,y1:g},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",it.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>b(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=D(this);a.classed("hovered",!0);const o=parseFloat(_t(s,"data.x0")),l=parseFloat(_t(s,"data.x1")),c=r.services.cartesianScales.getRangeAxisPosition(),u=r.services.cartesianScales.getScaleLabel(c);r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:_t(t,"bins.rangeLabel")||"Range",value:`${o} – ${l}`},{label:t.tooltip.groupLabel||"Group",value:s[n],class:r.model.getColorClassName({classNameTypes:[X.TOOLTIP],dataGroupName:s[n]})},{label:u,value:_t(s,`data.${s[n]}`)}]})}).on("mousemove",function(i){r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("mouseout",function(){D(this).classed("hovered",!1),r.services.events.dispatchEvent(O.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class fI extends Ve{constructor(){super(...arguments),this.type="lollipop",this.renderType=q.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?tn.weight.unselected:tn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",tn.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.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[i]!==n.datum().name?tn.opacity.unselected:tn.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",tn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=g=>s.getDomainValue(g),u=g=>s.getRangeValue(g),h=s.getOrientation(),[d,f]=an(c,u,h),p=n.selectAll("line.line").data(this.getScatterData(),g=>`${g[i]}-${g[l]}`);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:[X.STROKE],dataGroupName:g[i],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[i],g[l],g)).attr("opacity",1);h===Vt.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",g=>d(g)-r.points.radius):m.attr("x1",d).attr("x2",d).attr("y1",o.range()[0]).attr("y2",g=>f(g)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(O.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(O.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(O.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(O.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class pI extends lt{constructor(){super(...arguments),this.type="meter",this.renderType=q.SVG}getStackedBounds(t,n){let r=0;return t.map((i,s)=>s!==0?(r+=n(i.value),{...i,width:Math.abs(n(i.value)-Ht.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-Ht.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),s=b(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=L.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;b(i,"meter","proportional")===null?u=100:u=b(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const h=Oe().domain([0,u]).range([0,l]),d=this.getStackedBounds(a,h),f=b(i,"meter","height");L.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?Ht.height.proportional:Ht.height.default)),L.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?Ht.height.proportional:Ht.height.default));const p=r.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",x=>x.x).attr("y",0).attr("height",()=>f||(s?Ht.height.proportional:Ht.height.default)).attr("class",x=>this.model.getColorClassName({classNameTypes:[X.FILL],dataGroupName:x[c],originalClassName:m})).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"meter-bar-update",animate:t})).attr("width",x=>x.value>u?h(u):x.width).style("fill",x=>n.model.getFillColor(x[c])).attr("role",it.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",x=>x.value),p.exit().remove();const g=b(i,"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 y=r.selectAll("line.peak").data(v==null?[]:[v]);y.enter().append("line").classed("peak",!0).merge(y).attr("y1",0).attr("y2",()=>f||(s?Ht.height.proportional:Ht.height.default)).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"peak-line-update",animate:t})).attr("x1",x=>h(x)).attr("x2",x=>h(x)).attr("role",it.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",x=>x),y.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=b(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=D(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=D(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(O.Meter.METER_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class gI extends lt{constructor(){super(...arguments),this.type="radar",this.renderType=q.SVG,this.getLabelDimensions=t=>{const n=L.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=L.appendOrSelect(n,"text").text(t),{width:i,height:s}=L.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=b(n,"radar","axes"),s=b(n,"data","groupMapsTo"),a=_k(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return Z(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=b(n,"radar","axes"),s=b(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:Z(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?Pn.opacity.unselected:Pn.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?Pn.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",Pn.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer(),{width:r,height:i}=L.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=b(o,"data","groupMapsTo"),c=b(o,"radar","axes","value"),{angle:u,value:h}=b(o,"radar","axes"),{xLabelPadding:d,yLabelPadding:f,yTicksNumber:p,minRange:m,xAxisRectHeight:g}=Pn;this.uniqueKeys=Array.from(new Set(s.map(C=>C[u]))),this.uniqueGroups=Array.from(new Set(s.map(C=>C[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const v=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),y=(Math.min(r,i)-v)/2;if(y<=0)return;const x=ri().domain(this.fullDataNormalized.map(C=>C[u])).range([0,2*Math.PI].map(C=>C-Math.PI/2)),S=un(this.fullDataNormalized.map(C=>C[h])),_=Oe().domain([S>=0?0:S,En(this.fullDataNormalized.map(C=>C[h]))]).range([m,y]).nice(p),E=_.ticks(p),T=C=>this.model.getFillColor(C),k=xE().angle(C=>x(C[u])+Math.PI/2).radius(C=>_(C[h])).curve(kd),I=this.uniqueKeys.map(C=>{const A=this.getLabelDimensions(C).width,w=GL(x(C),y);return A+w}),$={x:En(I)+d,y:i/2},M=L.appendOrSelect(n,"g.y-axes").attr("role",it.GROUP).selectAll("path").data(E,C=>C),V=C=>this.uniqueKeys.map(A=>({[u]:A,[h]:C}));M.join(C=>C.append("path").attr("opacity",0).attr("transform",`translate(${$.x}, ${$.y})`).attr("fill","none").call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",w=>k(V(w)))),C=>C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${$.x}, ${$.y})`).attr("d",w=>k(V(w)))),C=>C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_axes_exit",animate:t})).attr("d",w=>k(V(w))).attr("opacity",0).remove())),L.appendOrSelect(n,"g.x-axes").attr("role",it.GROUP).selectAll("line").data(this.uniqueKeys,C=>C).join(C=>C.append("line").attr("opacity",0).attr("class",A=>`x-axis-${Tr(A)}`).attr("stroke-dasharray","0").attr("x1",A=>At(x(A),0,$).x).attr("y1",A=>At(x(A),0,$).y).attr("x2",A=>At(x(A),0,$).x).attr("y2",A=>At(x(A),0,$).y).call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",w=>At(x(w),_.range()[0],$).x).attr("y1",w=>At(x(w),_.range()[0],$).y).attr("x2",w=>At(x(w),_.range()[1],$).x).attr("y2",w=>At(x(w),_.range()[1],$).y)),C=>C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",w=>At(x(w),_.range()[0],$).x).attr("y1",w=>At(x(w),_.range()[0],$).y).attr("x2",w=>At(x(w),_.range()[1],$).x).attr("y2",w=>At(x(w),_.range()[1],$).y)),C=>C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),L.appendOrSelect(n,"g.x-labels").attr("role",it.GROUP).selectAll("text").data(this.uniqueKeys).join(C=>C.append("text").text(A=>A).attr("opacity",0).attr("x",A=>At(x(A),_.range()[1]+d,$).x).attr("y",A=>At(x(A),_.range()[1]+d,$).y).style("text-anchor",A=>fg(x(A)).textAnchor).style("dominant-baseline",A=>fg(x(A)).dominantBaseline).call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),C=>C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",w=>At(x(w),_.range()[1]+d,$).x).attr("y",w=>At(x(w),_.range()[1]+d,$).y).end().finally(()=>{const w=b(o,"radar","alignment"),N=this.getAlignmentXOffset(w,n,this.getParent());n.attr("x",N)})),C=>C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),L.appendOrSelect(n,"g.blobs").attr("role",it.GROUP).selectAll("path").data(this.groupedDataNormalized,C=>C.name).join(C=>C.append("path").attr("class",A=>this.model.getColorClassName({classNameTypes:[X.FILL,X.STROKE],dataGroupName:A.name,originalClassName:"blob"})).attr("role",it.GRAPHICS_SYMBOL).attr("aria-label",A=>A.name).attr("opacity",0).attr("transform",t?()=>`translate(${$.x}, ${$.y}) scale(${1+Math.random()*.35})`:`translate(${$.x}, ${$.y})`).style("fill",A=>T(A.name)).style("fill-opacity",Pn.opacity.selected).style("stroke",A=>T(A.name)).call(A=>{const w=A.transition().call(N=>this.services.transitions.setupTransition({transition:N,name:"radar_blobs_enter",animate:t}));t&&w.delay(()=>Math.random()*30).attr("transform",`translate(${$.x}, ${$.y})`),w.attr("opacity",1).attr("d",N=>k(N.data))}),C=>(C.attr("class",A=>this.model.getColorClassName({classNameTypes:[X.FILL,X.STROKE],dataGroupName:A.name,originalClassName:"blob"})).style("fill",A=>T(A.name)).style("stroke",A=>T(A.name)),C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${$.x}, ${$.y})`).attr("d",w=>k(w.data))),C),C=>C.call(A=>{const w=A.transition().call(N=>this.services.transitions.setupTransition({transition:N,name:"radar_blobs_exit",animate:t}));t&&w.delay(()=>Math.random()*30).attr("transform",()=>`translate(${$.x}, ${$.y}) scale(${1+Math.random()*.35})`),w.attr("opacity",0).remove()})),L.appendOrSelect(n,"g.dots").attr("role",it.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(C=>b(C,h)!==null)).join(C=>C.append("circle").attr("role",it.GRAPHICS_SYMBOL).attr("aria-label",A=>A[c]),C=>C,C=>C.remove()).attr("class",C=>this.model.getColorClassName({classNameTypes:[X.FILL],dataGroupName:C[l],originalClassName:Tr(C[u])})).attr("cx",C=>At(x(C[u]),_(C[h]),$).x).attr("cy",C=>At(x(C[u]),_(C[h]),$).y).attr("r",0).attr("opacity",0).style("fill",C=>T(C[l])),L.appendOrSelect(n,"g.x-axes-rect").attr("role",it.GROUP).selectAll("rect").data(this.uniqueKeys).join(C=>C.append("rect"),C=>C,C=>C.remove()).attr("x",$.x).attr("y",$.y-g/2).attr("width",_.range()[1]).attr("height",g).style("fill","red").style("fill-opacity",0).attr("transform",C=>`rotate(${pg(x(C))}, ${$.x}, ${$.y})`),L.appendOrSelect(n,"g.y-labels").attr("role",it.GROUP).selectAll("text").data(be(E)).join(C=>C.append("text").attr("opacity",0).text(A=>A).attr("x",A=>At(-Math.PI/2,_(A),$).x+f).attr("y",A=>At(-Math.PI/2,_(A),$).y).style("text-anchor","start").style("dominant-baseline","middle").call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),C=>C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_labels_update",animate:t})).text(w=>w).attr("opacity",1).attr("x",w=>At(-Math.PI/2,_(w),$).x+f).attr("y",w=>At(-Math.PI/2,_(w),$).y)),C=>C.call(A=>A.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=L.getSVGElementSize(n,{useBBox:!0}),{width:s}=L.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===It.CENTER?a=Math.floor((s-i.width)/2):t===It.RIGHT&&(a=s-i.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=b(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=D(this);t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${Tr(i)}`),o=t.parent.selectAll(`.dots circle.${Tr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,h=b(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",Pn.dotsRadius);const d=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:r,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:[X.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=D(this);t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(O.Radar.X_AXIS_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){const s=D(this),a=t.parent.select(`.x-axes .x-axis-${Tr(i)}`),o=t.parent.selectAll(`.dots circle.${Tr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.HIDE)})}}class bm extends Cc{constructor(){super(...arguments),this.type="simple-bar",this.renderType=q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,l=>l[r]);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(l=>this.services.transitions.setupTransition({transition:l,name:"bar-update-enter",animate:t})).attr("class",l=>this.model.getColorClassName({classNameTypes:[X.FILL],dataGroupName:l[r],originalClassName:"bar"})).style("fill",l=>this.model.getFillColor(l[r])).attr("d",l=>{const c=this.services.cartesianScales.getRangeIdentifier(),u=this.getBarWidth(),h=l[c],d=this.services.cartesianScales.getDomainValue(l)-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(l)}const g=Math.abs(m-p);if(g!==0&&g<2&&(h>0&&a===Vt.VERTICAL||h<0&&a===Vt.HORIZONTAL?m=p-2:m=p+2),!this.isOutsideZoomedDomain(d,f))return Zt({x0:d,x1:f,y0:p,y1:m},a)}).attr("opacity",1).attr("role",it.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",l=>l.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:n,element:D(this),datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class mI extends Kt{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=b(this.getOptions(),"data","loading"),r=!b(this.getOptions(),"grid","x","enabled")&&!b(this.getOptions(),"grid","y","enabled")&&!b(this.getOptions(),"axes","bottom","visible")&&!b(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?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"),r=[100],i=L.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.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=L.appendOrSelect(t,"svg.chart-skeleton.DAII"),L.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class wm extends lt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.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=>b(s,0,i)!==n.datum().name?Je.opacity.unselected:Je.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",Je.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=b(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),h=this.services.cartesianScales.getScaleByPosition(u),d=n.selectAll("path.area").data(o,f=>b(f,0,s));this.areaGenerator=hl().x(f=>this.services.cartesianScales.getValueThroughAxisPosition(c,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=>b(f,0,s)).attr("class","area").attr("class",f=>this.model.getColorClassName({classNameTypes:[X.FILL],dataGroupName:b(f,0,s),originalClassName:"area"})).style("fill",f=>r.model.getFillColor(b(f,0,s))).attr("role",it.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",f=>b(f,0,s)).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"area-update-enter",animate:t})).attr("opacity",Je.opacity.selected).attr("d",this.areaGenerator)}}class _m extends Cc{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>b(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",it.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[X.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i])).attr("d",c=>{const u=c.data.sharedStackKey,h=this.getBarWidth(),d=this.services.cartesianScales.getDomainValue(u)-h/2,f=d+h,p=this.services.cartesianScales.getRangeValue(c[0]);let m=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(d,f)){if(Math.abs(m-p)>0&&Math.abs(m-p)>r.bars.dividerSize){const g=c[0]<0&&c[1]<=0;g&&a.length>1?this.services.cartesianScales.getOrientation()===Vt.VERTICAL?m+=c[1]===0?2:1:m-=1:g||(this.services.cartesianScales.getOrientation()===Vt.VERTICAL?m+=1:m-=1)}return Zt({x0:d,x1:f,y0:p,y1:m},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",it.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=D(this);a.classed("hovered",!0),r.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let o=r.model.getDisplayData(r.configs.groups).find(l=>{const c=r.services.cartesianScales.getDomainIdentifier(l),u=r.services.cartesianScales.getRangeIdentifier(l);return l[u]===s.data[s[n]]&&l[c].toString()===s.data.sharedStackKey&&l[n]===s[n]});if(o===void 0){const l=r.services.cartesianScales.getDomainIdentifier(),c=r.services.cartesianScales.getRangeIdentifier();o={[l]:s.data.sharedStackKey,[c]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,data:[o]})}).on("mousemove",function(i,s){const a=D(this);r.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:i,element:D(this),datum:s})}).on("mouseout",function(i,s){const a=D(this);a.classed("hovered",!1),r.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(b(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=L.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=b(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Em extends Ve{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=q.SVG}render(t){if(!b(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(u=>r.axes[u].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=n.selectAll("g.dots").data(a,u=>b(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",it.GROUP).merge(o).selectAll("circle.dot").data(u=>u);l.exit().attr("opacity",0).remove();const c=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l).datum(u=>{const h=u[i],d=this.services.cartesianScales.getDomainIdentifier(u),f=this.services.cartesianScales.getRangeIdentifier(u);return{[i]:h,[d]:u.data.sharedStackKey,[f]:u[1]}});this.styleCircles(c,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,h)=>{const d=u[i],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})[c][h].data[d]),p!==null&&o.push({[i]:d,[g]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(h=>h[i]==l[i]&&h[c]==l[c]&&h[u]==l[u])!==void 0})}}const Lr=6;class vI extends lt{constructor(){super(...arguments),this.type="tree",this.renderType=q.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=L.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer();n.html("");const{width:r,height:i}=L.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=b(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),h={top:0,right:0,bottom:0,left:l>0?l+Lr:30-Lr},d=ti({name:o,children:a}),f=10,p=r/6,m=E=>{const T=d.descendants().reverse(),k=d.links();let I=d,$=d;d.eachBefore(R=>{R.x<I.x&&(I=R),R.x>$.x&&($=R)});const M=$.x-I.x,V=n.transition().call(R=>this.services.transitions.setupTransition({transition:R,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-h.left,I.x,r,M].join(" ")),C=_.selectAll("g").data(T,R=>R.id),A=this,w=C.enter().append("g").attr("transform",()=>`translate(${E.y0},${E.x0})`).attr("class",R=>R.depth!==0&&R.children&&R.children.length>0?"clickable":null).on("mouseover",function(R,U){A.services.events.dispatchEvent(O.Tree.NODE_MOUSEOVER,{event:R,element:D(this),datum:U})}).on("click",function(R,U){U.depth!==0&&(U.children=U.children?null:U._children,m(U)),A.services.events.dispatchEvent(O.Tree.NODE_CLICK,{event:R,element:D(this),datum:U})}).on("mouseout",function(R,U){A.services.events.dispatchEvent(O.Tree.NODE_MOUSEOUT,{event:R,element:D(this),datum:U})});w.append("circle").attr("r",2.5).attr("class",R=>R._children?"parent":"child").attr("stroke-width",10),w.append("text").attr("dy","0.31em").attr("x",R=>R._children?-Lr:Lr).attr("text-anchor",R=>R._children?"end":"start").text(R=>R.data.name).clone(!0).attr("class","text-stroke").lower(),C.merge(w).transition(V).attr("transform",R=>`translate(${R.y},${R.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),C.exit().transition(V).remove().attr("transform",()=>`translate(${E.y},${E.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const N=S.selectAll("path").data(k,R=>R.target.id),P=N.enter().append("path").attr("d",()=>{const R={x:E.x0,y:E.y0};return x({source:R,target:R})});N.merge(P).transition(V).attr("d",x),N.exit().transition(V).remove().attr("d",()=>{const R={x:E.x,y:E.y};return x({source:R,target:R})}),d.eachBefore(R=>{R.x0=R.x,R.y0=R.y})},g=d.descendants(),v=g[g.length-1].depth,y=b(s,"tree","type")===yl.DENDROGRAM?Vb().size([i,r-u-v*Lr-l]):Mw().nodeSize([f,p]).size([i,r-u-v*Lr-l]),x=OE().x(E=>E.y).y(E=>E.x);d.x0=p/2,d.y0=0,d.descendants().forEach((E,T)=>{E.id=T,E._children=E.children}),y(d),n.attr("viewBox",[-h.left,-h.top,r,f]).style("user-select","none");const S=n.append("g").attr("class","links"),_=n.append("g").attr("class","nodes");m(d)}}var yI="#000000",xI="#ffffff",bI="#fcf4d6",wI="#fddc69",_I="#f1c21b",EI="#d2a106",SI="#b28600",OI="#8e6a00",TI="#684e00",MI="#483700",CI="#302400",$I="#1c1500",AI={10:bI,20:wI,30:_I,40:EI,50:SI,60:OI,70:TI,80:MI,90:CI,100:$I},LI="#fff2e8",DI="#ffd9be",kI="#ffb784",RI="#ff832b",II="#eb6200",NI="#ba4e00",PI="#8a3800",UI="#5e2900",BI="#3e1a00",VI="#231000",HI={10:LI,20:DI,30:kI,40:RI,50:II,60:NI,70:PI,80:UI,90:BI,100:VI},GI="#fff1f1",FI="#ffd7d9",zI="#ffb3b8",jI="#ff8389",WI="#fa4d56",qI="#da1e28",YI="#a2191f",XI="#750e13",ZI="#520408",KI="#2d0709",QI={10:GI,20:FI,30:zI,40:jI,50:WI,60:qI,70:YI,80:XI,90:ZI,100:KI},JI="#fff0f7",tN="#ffd6e8",eN="#ffafd2",nN="#ff7eb6",rN="#ee5396",iN="#d02670",sN="#9f1853",aN="#740937",oN="#510224",lN="#2a0a18",cN={10:JI,20:tN,30:eN,40:nN,50:rN,60:iN,70:sN,80:aN,90:oN,100:lN},uN="#f6f2ff",hN="#e8daff",dN="#d4bbff",fN="#be95ff",pN="#a56eff",gN="#8a3ffc",mN="#6929c4",vN="#491d8b",yN="#31135e",xN="#1c0f30",bN={10:uN,20:hN,30:dN,40:fN,50:pN,60:gN,70:mN,80:vN,90:yN,100:xN},wN="#edf5ff",_N="#d0e2ff",EN="#a6c8ff",SN="#78a9ff",ON="#4589ff",TN="#0f62fe",MN="#0043ce",CN="#002d9c",$N="#001d6c",AN="#001141",LN={10:wN,20:_N,30:EN,40:SN,50:ON,60:TN,70:MN,80:CN,90:$N,100:AN},DN="#e5f6ff",kN="#bae6ff",RN="#82cfff",IN="#33b1ff",NN="#1192e8",PN="#0072c3",UN="#00539a",BN="#003a6d",VN="#012749",HN="#061727",GN={10:DN,20:kN,30:RN,40:IN,50:NN,60:PN,70:UN,80:BN,90:VN,100:HN},FN="#d9fbfb",zN="#9ef0f0",jN="#3ddbd9",WN="#08bdba",qN="#009d9a",YN="#007d79",XN="#005d5d",ZN="#004144",KN="#022b30",QN="#081a1c",JN={10:FN,20:zN,30:jN,40:WN,50:qN,60:YN,70:XN,80:ZN,90:KN,100:QN},tP="#defbe6",eP="#a7f0ba",nP="#6fdc8c",rP="#42be65",iP="#24a148",sP="#198038",aP="#0e6027",oP="#044317",lP="#022d0d",cP="#071908",uP={10:tP,20:eP,30:nP,40:rP,50:iP,60:sP,70:aP,80:oP,90:lP,100:cP},hP="#f2f4f8",dP="#dde1e6",fP="#c1c7cd",pP="#a2a9b0",gP="#878d96",mP="#697077",vP="#4d5358",yP="#343a3f",xP="#21272a",bP="#121619",wP={10:hP,20:dP,30:fP,40:pP,50:gP,60:mP,70:vP,80:yP,90:xP,100:bP},_P="#f4f4f4",EP="#e0e0e0",SP="#c6c6c6",OP="#a8a8a8",TP="#8d8d8d",MP="#6f6f6f",CP="#525252",$P="#393939",AP="#262626",LP="#161616",DP={10:_P,20:EP,30:SP,40:OP,50:TP,60:MP,70:CP,80:$P,90:AP,100:LP},kP="#f7f3f2",RP="#e5e0df",IP="#cac5c4",NP="#ada8a8",PP="#8f8b8b",UP="#726e6e",BP="#565151",VP="#3c3838",HP="#272525",GP="#171414",FP={10:kP,20:RP,30:IP,40:NP,50:PP,60:UP,70:BP,80:VP,90:HP,100:GP},Sm={black:{100:yI},blue:LN,coolGray:wP,cyan:GN,gray:DP,green:uP,magenta:cN,orange:HI,purple:bN,red:QI,teal:JN,warmGray:FP,white:{0:xI},yellow:AI};const zP=e=>{if(!e)return null;for(const t of Object.keys(Sm)){const n=Sm[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Om=function(){const e=D(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=He(t);let r;if(n&&(r=zP(n?n.hex():null)),r==null){const i=to(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let jP=0;class WP extends lt{constructor(){super(...arguments),this.type="treemap",this.renderType=q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer();this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=b(window,"location"),{width:a,height:o}=L.getSVGElementSize(n,{useAttrs:!0}),l=ti({name:i.title||"Treemap",children:r}).sum(f=>f.value).sort((f,p)=>p.value-f.value),c=Dw().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),f=>f.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>jP++).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=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${f}`}).attr("class",f=>{for(;f.depth>1;)f=f.parent;return this.model.getColorClassName({classNameTypes:[X.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=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${p}`}).append("use").attr("xlink:href",function(){const p=D(this.parentNode.parentNode).attr("data-uid"),m=`${i.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=to(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",Om).attr("x",7).attr("y",18);return s&&p.attr("clip-path",function(){const m=D(this.parentNode).attr("data-uid"),g=`${i.style.prefix}-clip-${m}`;return`url(${new URL(`#${g}`,s)+""})`}),p},f=>f.text(p=>p.text).style("fill",Om),f=>f.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=D(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name);return l&&(s=l),He(s).darker(.7).toString()}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Treemap.LEAF_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.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(O.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}}class qP extends lt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==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(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer().attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:h}=L.getSVGElementSize(r,{useAttrs:!0});if(u===0||h===0)return;const d=CD().size([u,h]).words(i.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{[c]:p[c],text:p[l],size:m,value:m}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);d.start();function f(p){const m=L.appendOrSelect(r,"g.words");m.attr("transform",`translate(${d.size()[0]/2}, ${d.size()[1]/2})`);const g=m.selectAll("text").data(p,v=>`${v[c]}-${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:[X.FILL],dataGroupName:v[c],originalClassName:`word ${v.size>32?"light":""}`})).style("fill",v=>n.model.getFillColor(v[c],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:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=L.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?be(i):[1,1];return Oe().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=xa(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.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;i(o),r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEOVER,{event:s,element:D(this),datum:a}),r.services.events.dispatchEvent(O.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:r.model.getColorClassName({classNameTypes:[X.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=D(this);r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(O.WordCloud.WORD_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);i(null),r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o})})}}class YP extends lt{constructor(){super(...arguments),this.type="geo",this.renderType=q.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=L.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=b(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(g=>{typeof a[g].value=="number"?o[g]=a[g]:l[g]=a[g]});const c=rI(s,Object.values(l)),u=tI(s,{type:"GeometryCollection",geometries:Object.values(o)}),h=i.fitSize([n,r],u),d=db().projection(h);L.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",d);const f=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),p=L.appendOrSelect(t,"defs");L.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",ui()([[0,0],[0,10]]));const m=L.appendOrSelect(t,"g.missing-data");L.appendOrSelect(m,"path").datum(c).attr("d",d).style("fill",`url(#${f})`)}getProjection(){let t=null;switch(b(this.getOptions(),"thematic","projection")){case Qe.geoEqualEarth:t=Lb();break;case Qe.geoAlbers:t=Sb();break;case Qe.geoConicEqualArea:t=Rh();break;case Qe.geoConicEquidistant:t=$b();break;case Qe.geoEquirectangular:t=Mb();break;case Qe.geoMercator:t=Ob();break;case Qe.geoNaturalEarth1:t=Db();break;default:throw new Error("Projection is not supported.")}return t}}class XP extends YP{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",r=>this.model.getColorClassName({value:n[r.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=D(this);t.services.events.dispatchEvent(dr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(di.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(dr.CHOROPLETH_MOUSEMOVE,{event:r,element:D(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(di.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(dr.CHOROPLETH_CLICK,{event:r,element:D(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=D(this);t.services.events.dispatchEvent(dr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(di.HIDE,{event:r,hoveredElement:s})})}}function Tm(e,t){rt(2,arguments);var n=dt(e),r=Ut(t);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function $c(e,t){rt(2,arguments);var n=dt(e),r=Ut(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var i=n.getDate(),s=new Date(n.getTime());s.setMonth(n.getMonth()+r+1,0);var a=s.getDate();return i>=a?s:(n.setFullYear(s.getFullYear(),s.getMonth(),i),n)}var ZP=36e5;function Mm(e,t){rt(2,arguments);var n=Ut(t);return Qs(e,n*ZP)}function Cm(e){rt(1,arguments);var t=dt(e);return t.setHours(0,0,0,0),t}var KP=864e5;function QP(e,t){rt(2,arguments);var n=Cm(e),r=Cm(t),i=n.getTime()-_l(n),s=r.getTime()-_l(r);return Math.round((i-s)/KP)}var JP=6e4;function Ac(e,t){rt(2,arguments);var n=Ut(t);return Qs(e,n*JP)}function Lc(e,t){rt(2,arguments);var n=Ut(t);return Qs(e,n*1e3)}function $m(e,t){rt(2,arguments);var n=Ut(t);return $c(e,n*12)}function Pi(e,t){rt(2,arguments);var n=dt(e),r=dt(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}var tU=6e4,eU=36e5;function nU(e,t){rt(2,arguments);var n=dt(e),r=dt(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function rU(e,t){rt(2,arguments);var n=dt(e),r=dt(t);return n.getFullYear()-r.getFullYear()}function Am(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 iU(e,t){rt(2,arguments);var n=dt(e),r=dt(t),i=Am(n,r),s=Math.abs(QP(n,r));n.setDate(n.getDate()-i*s);var a=+(Am(n,r)===-i),o=i*(s-a);return o===0?0:o}function Dc(e,t){return rt(2,arguments),dt(e).getTime()-dt(t).getTime()}var Lm={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},sU="trunc";function kc(e){return e?Lm[e]:Lm[sU]}function aU(e,t,n){rt(2,arguments);var r=Dc(e,t)/eU;return kc(n==null?void 0:n.roundingMethod)(r)}function Dm(e,t,n){rt(2,arguments);var r=Dc(e,t)/tU;return kc(n==null?void 0:n.roundingMethod)(r)}function oU(e){rt(1,arguments);var t=dt(e);return t.setHours(23,59,59,999),t}function lU(e){rt(1,arguments);var t=dt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function cU(e){rt(1,arguments);var t=dt(e);return oU(t).getTime()===lU(t).getTime()}function uU(e,t){rt(2,arguments);var n=dt(e),r=dt(t),i=Pi(n,r),s=Math.abs(nU(n,r)),a;if(s<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*s);var o=Pi(n,r)===-i;cU(dt(e))&&s===1&&Pi(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function km(e,t,n){rt(2,arguments);var r=Dc(e,t)/1e3;return kc(n==null?void 0:n.roundingMethod)(r)}function hU(e,t){rt(2,arguments);var n=dt(e),r=dt(t),i=Pi(n,r),s=Math.abs(rU(n,r));n.setFullYear(1584),r.setFullYear(1584);var a=Pi(n,r)===-i,o=i*(s-Number(a));return o===0?0:o}function dU(e,t){rt(2,arguments);var n=Ut(t);return Tm(e,-n)}function fU(e,t){rt(2,arguments);var n=Ut(t);return $c(e,-n)}function pU(e,t){rt(2,arguments);var n=Ut(t);return Mm(e,-n)}function Rm(e,t){rt(2,arguments);var n=Ut(t);return Ac(e,-n)}function Im(e,t){rt(2,arguments);var n=Ut(t);return Lc(e,-n)}function gU(e,t){rt(2,arguments);var n=Ut(t);return $m(e,-n)}function Nm(e){var t=e==null?0:e.length;return t?ua(e,1):[]}class mU extends ln{zoomIn(t,n,r){let i,s,a;const o=r||vr;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=L.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${l/2}, ${c/2}) scale(${a}) translate(${-i},${-s})`),this.services.events.dispatchEvent(O.CanvasZoom.CANVAS_ZOOM_IN,{element:D(t)})}zoomOut(t,n){const r=n||vr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(O.CanvasZoom.CANVAS_ZOOM_OUT)}}class vU extends ln{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 r;n?r=new CustomEvent(t,{detail:n}):(r=document.createEvent("Event"),r.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(r)}}class yU extends ln{constructor(t,n){super(t,n)}downloadCSV(t,n){const r=document.createElement("a"),i="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:i}),n);else if(URL&&"download"in r){const s=URL.createObjectURL(new Blob([t],{type:i}));r.href=s,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const r=document.createElement("a");r.download=n,r.href=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}class xU extends ln{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(O.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:r}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||r===!1?t.duration(0):t.duration(b(Mf,n,"duration")||Mf.default.duration)}getPendingTransitions(){return this.pendingTransitions}}let bU=class extends ln{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:r}=n.data,i=b(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=b(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return b(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===B.BOTTOM||t===B.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(B).map(t=>B[t]).forEach(t=>{this.scales[t]=this.createScale(t)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),r=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=r.primaryDomainAxisPosition,this.rangeAxisPosition=r.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=r.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=r.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===B.LEFT||this.rangeAxisPosition===B.RIGHT)&&(this.domainAxisPosition===B.BOTTOM||this.domainAxisPosition===B.TOP)?this.orientation=Vt.VERTICAL:this.orientation=Vt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const s=this.model.getOptions(),a=b(s,"axes");((t=a[B.LEFT])!=null&&t.correspondingDatasets&&a[B.RIGHT]||(n=a[B.RIGHT])!=null&&n.correspondingDatasets&&a[B.LEFT]||(r=a[B.TOP])!=null&&r.correspondingDatasets&&a[B.BOTTOM]||(i=a[B.BOTTOM])!=null&&i.correspondingDatasets&&a[B.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=b(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]===W.LINEAR||this.scaleTypes[t]===W.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=[B.BOTTOM,B.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[B.LEFT,B.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,r,i){const s=this.model.getOptions(),a=b(s,"axes")[r],{mapsTo:o}=a,l=b(i,o)!==null?i[o]:i;let c;switch(n){case W.LABELS:c=t(l)+t.step()/2;break;case W.TIME:c=t(new Date(l));break;default:c=t(l)}return c}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),a=b(s,"axes")[r],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[i(b(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(b(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:l)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,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 b(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return b(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=b(r,"axes",t);if(i.scaleType===W.TIME){const s=b(r,"timeScale","addSpaceOnEdges");return wU(n,s)}else return _U(n,gn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=b(t,"axes"),r=this.isDualAxes();return b(n,B.LEFT)===null&&b(n,B.RIGHT)!==null||b(n,B.RIGHT,"main")===!0||r&&b(n,B.LEFT,"correspondingDatasets")?{primary:B.RIGHT,secondary:B.LEFT}:{primary:B.LEFT,secondary:B.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=b(t,"axes"),r=this.isDualAxes();return b(n,B.BOTTOM)===null&&b(n,B.TOP)!==null||b(n,B.TOP,"main")===!0||r&&b(n,B.BOTTOM,"correspondingDatasets")?{primary:B.TOP,secondary:B.BOTTOM}:{primary:B.BOTTOM,secondary:B.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=b(r,"axes",t.primary),s=b(r,"axes",n.primary),a=i.scaleType||W.LINEAR,o=s.scaleType||W.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===W.LABELS||o===W.TIME)&&a===W.LABELS||a===W.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),r=b(n,"axes",t),i=b(n,"bounds"),{includeZero:s}=r,a=b(r,"scaleType")||W.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,En(v,y=>y.length)]}else if(r.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),y=this.model.getStackKeys({bins:v});return[y[0].split("-")[0],y[y.length-1].split("-")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:h}=r,{reference:d,compareTo:f}=gn.ratio;if(r.domain)return a===W.LABELS?r.domain:(a===W.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===W.LABELS)return Ci(o.map(v=>v[c]));let p,m;const g=this.model.getDataGroupNames();if(a===W.LABELS_RATIO)return o.map(v=>`${v[d]}/${v[f]}`);if(a===W.TIME)m=o.map(v=>+new Date(v[c]));else if(i&&n.axes)m=[],o.forEach(v=>{m.push(v[c]),v[i.upperBoundMapsTo]&&m.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&m.push(v[i.lowerBoundMapsTo])});else if(r.stacked===!0&&g&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,y=this.model.getDataValuesGroupedByKeys({groups:g}),x=o.filter(_=>!g.includes(_[v])),S=[];y.forEach(_=>{const{...E}=_;let T=0,k=0;Object.values(E).forEach(I=>{isNaN(I)||(I<0?k+=I:T+=I)}),S.push([k,T])}),m=[...Nm(S),...x.map(_=>_[c])]}else m=[],o.forEach(v=>{const y=v[c];Array.isArray(y)&&y.length===2?(m.push(y[0]),m.push(y[1])):(l&&m.push(Math.max(v[c],v[l])),m.push(y))});return a!==W.TIME&&a!==W.LOG&&s&&m.push(0),h&&h.length>0&&h.forEach(v=>{const y=b(v,"value");y!==null&&m.push(y)}),p=be(m),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),r=b(n,"axes",t);if(!r)return null;const i=b(r,"scaleType")||W.LINEAR;this.scaleTypes[t]=i;let s;return i===W.TIME?s=bd():i===W.LOG?s=ed().base(r.base||10):i===W.LABELS||i===W.LABELS_RATIO?s=ri():s=Oe(),s.domain(this.getScaleDomain(t)),s}getHighestDomainThreshold(){const t=b(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((a,o)=>o.value-a.value)[0];return this.getScaleTypeByPosition(n)===W.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=b(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}};function wU(e,t){const n=new Date(e[0]),r=new Date(e[1]);return hU(r,n)>1?[gU(n,t),$m(r,t)]:uU(r,n)>1?[fU(n,t),$c(r,t)]:iU(r,n)>1?[dU(n,t),Tm(r,t)]:aU(r,n)>1?[pU(n,t),Mm(r,t)]:Dm(r,n)>30?[Rm(n,t*30),Ac(r,t*30)]:Dm(r,n)>1?[Rm(n,t),Ac(r,t)]:km(r,n)>15?[Im(n,t*15),Lc(r,t*15)]:km(r,n)>1?[Im(n,t),Lc(r,t)]:[n,r]}function _U([e,t],n,r){const i=(t-e)*n,s=t<=0&&t+i>0?0:t+i;let a=e>=0&&e-i<0?0:e-i;if(r===W.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 EU=class extends ln{constructor(){super(...arguments),this.curveTypes={curveLinear:Vs,curveLinearClosed:kd,curveBasis:TE,curveBasisClosed:ME,curveBasisOpen:CE,curveBundle:$E,curveCardinal:AE,curveCardinalClosed:LE,curveCardinalOpen:DE,curveCatmullRom:kE,curveCatmullRomClosed:RE,curveCatmullRomOpen:IE,curveMonotoneX:NE,curveMonotoneY:PE,curveNatural:UE,curveStep:BE,curveStepAfter:HE,curveStepBefore:VE}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}};class SU extends ln{isZoomBarEnabled(){if(!this.services.cartesianScales||!b(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=b(this.model.getOptions(),"axes",t,"scaleType");return t===B.BOTTOM&&n===W.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:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=b(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,be(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(O.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return b(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=b(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&a&&i){const o=s.stacked?"sharedStackKey":(r=this.services.cartesianScales)==null?void 0:r.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=i[0]&&new Date(c[o])<=i[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var n;const r=this.model.get("zoomDomain"),i=ce.handleWidth,s=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();s.domain(this.getDefaultZoomBarDomain());const a=s(r[0]),o=s(r[1]);if(o-a<i+1)return;const l=s.range(),c=o-a,u=Math.min((l[1]-l[0])/2*(t/2),c/2);let h=a+u,d=o-u;h>=d&&(h=a+c/2-i/2,d=o-c/2+i/2);const f=[s.invert(h),s.invert(d)];(r[0].valueOf()!==f[0].valueOf()||r[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 r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.invert(c)];(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 r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=b(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<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 b(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return b(this.model.getOptions(),"zoomBar",t,"locked")}}function OU(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}function TU(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:OU(e,t,n)}var MU="\\ud800-\\udfff",CU="\\u0300-\\u036f",$U="\\ufe20-\\ufe2f",AU="\\u20d0-\\u20ff",LU=CU+$U+AU,DU="\\ufe0e\\ufe0f",kU="\\u200d",RU=RegExp("["+kU+MU+LU+DU+"]");function Pm(e){return RU.test(e)}function IU(e){return e.split("")}var Um="\\ud800-\\udfff",NU="\\u0300-\\u036f",PU="\\ufe20-\\ufe2f",UU="\\u20d0-\\u20ff",BU=NU+PU+UU,VU="\\ufe0e\\ufe0f",HU="["+Um+"]",Rc="["+BU+"]",Ic="\\ud83c[\\udffb-\\udfff]",GU="(?:"+Rc+"|"+Ic+")",Bm="[^"+Um+"]",Vm="(?:\\ud83c[\\udde6-\\uddff]){2}",Hm="[\\ud800-\\udbff][\\udc00-\\udfff]",FU="\\u200d",Gm=GU+"?",Fm="["+VU+"]?",zU="(?:"+FU+"(?:"+[Bm,Vm,Hm].join("|")+")"+Fm+Gm+")*",jU=Fm+Gm+zU,WU="(?:"+[Bm+Rc+"?",Rc,Vm,Hm,HU].join("|")+")",qU=RegExp(Ic+"(?="+Ic+")|"+WU+jU,"g");function YU(e){return e.match(qU)||[]}function XU(e){return Pm(e)?YU(e):IU(e)}function ZU(e){return function(t){t=Ti(t);var n=Pm(t)?XU(t):void 0,r=n?n[0]:t.charAt(0),i=n?TU(n,1).join(""):t.slice(1);return r[e]()+i}}var KU=ZU("toUpperCase");const QU=KU;function JU(e){return QU(Ti(e).toLowerCase())}var tB=zg(function(e,t,n){return t=t.toLowerCase(),e+(n?JU(t):t)});const eB=tB;class Le{constructor(t,n){this.components=[],this.services={canvasZoom:mU,domUtils:L,events:vU,files:yU,gradientUtils:nc,transitions:xU},this.model=new Be(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(r=>{const i=this.services[r];this.services[r]=new i(this.model,this.services)}),this.services.events.addEventListener(O.Model.UPDATE,r=>{const i=!!b(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(O.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(t));const n=this.services.transitions.getPendingTransitions(),r=Object.keys(n).map(i=>n[i].end().catch(s=>s));Promise.all(r).then(()=>this.services.events.dispatchEvent(O.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 r=this.model.getOptions(),i=b(r,"toolbar","enabled"),s={id:"legend",components:[new Oc(this.model,this.services)],growth:tt.PREFERRED},a=b(r,"canvasZoom","enabled");a&&a===!0&&t.push(new VR(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new Ni(this.model,this.services)],growth:tt.STRETCH},c={id:"toolbar",components:[new Ca(this.model,this.services)],growth:tt.PREFERRED},u={id:"header",components:[new he(this.model,this.services,[l,...i?[c]:[]],{direction:bt.ROW,alignItems:fr.CENTER})],growth:tt.PREFERRED},h={id:"graph-frame",components:t,growth:tt.STRETCH,renderType:b(n,"graphFrameRenderType")||q.SVG},d=b(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let f=bt.COLUMN;if(d){const v=b(r,"legend","position");v==="left"?(f=bt.ROW,r.legend.orientation||(r.legend.orientation=pi.VERTICAL)):v==="right"?(f=bt.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=pi.VERTICAL)):v==="bottom"&&(f=bt.COLUMN_REVERSE)}const p={id:"spacer",components:[new cn(this.model,this.services)],growth:tt.PREFERRED},m={id:"full-frame",components:[new he(this.model,this.services,[...d?[s]:[],...d?[p]:[],h],{direction:f})],growth:tt.STRETCH},g=[];if(o||i){g.push(u);const v={id:"spacer",components:[new cn(this.model,this.services,i?{size:15}:void 0)],growth:tt.PREFERRED};g.push(v)}return g.push(m),[new Tc(this.model,this.services),new Ia(this.model,this.services),new he(this.model,this.services,g,{direction:bt.COLUMN})]}}class se extends Le{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:bU,curves:EU,zoom:SU}),this.model=new jn(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=b(r,"zoomBar",B.TOP,"enabled"),s=b(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=b(r,"axes",a,"scaleType"),l=i&&a===B.BOTTOM&&o===W.TIME,c=this.services.zoom.isZoomBarLocked(B.TOP),u=!!this.model.getOptions().title,h={id:"title",components:[new Ni(this.model,this.services)],growth:tt.STRETCH},d={id:"toolbar",components:[new Ca(this.model,this.services)],growth:tt.PREFERRED},f={id:"header",components:[new he(this.model,this.services,[h,...s?[d]:[]],{direction:bt.ROW,alignItems:fr.CENTER})],growth:tt.PREFERRED},p={id:"legend",components:[new Oc(this.model,this.services)],growth:tt.PREFERRED};l&&!c&&t.push(new am(this.model,this.services),new HR(this.model,this.services)),t.push(new FR(this.model,this.services)),t.push(new zR(this.model,this.services));const m={id:"graph-frame",components:t,growth:tt.STRETCH,renderType:q.SVG},g=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=bt.COLUMN;if(g){const E=b(this.model.getOptions(),"legend","position");E===fi.LEFT?(v=bt.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=pi.VERTICAL)):E===fi.RIGHT?(v=bt.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=pi.VERTICAL)):E===fi.BOTTOM&&(v=bt.COLUMN_REVERSE)}const y={id:"spacer",components:[new cn(this.model,this.services)],growth:tt.PREFERRED},x={id:"full-frame",components:[new he(this.model,this.services,[...g?[p]:[],...g?[y]:[],m],{direction:v})],growth:tt.STRETCH},S={id:"zoom-bar",components:[new GR(this.model,this.services)],growth:tt.PREFERRED,renderType:q.SVG},_=[];if(u||s){_.push(f);const E={id:"spacer",components:[new cn(this.model,this.services,s?{size:15}:void 0)],growth:tt.PREFERRED};_.push(E)}return l&&_.push(S),_.push(x),[new um(this.model,this.services),new Ia(this.model,this.services),new he(this.model,this.services,_,{direction:bt.COLUMN})]}}class nB extends Le{constructor(t,n){super(t,n),this.model=new EA(this.services),this.model.setOptions(Tt(xt.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new jR(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class rB extends se{constructor(t,n){super(t,n),this.model.setOptions(Tt(rn(xt.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new xn(this.model,this.services),new $r(this.model,this.services),new hm(this.model,this.services),new Ve(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new Kt(this.model,this.services,{skeleton:Nt.GRID})];return this.getAxisChartComponents(t)}}class iB extends se{constructor(t,n){super(t,n),this.model=new SA(this.services),this.model.setOptions(Tt(xt.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new YR(this.model,this.services),new Ar(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class sB extends se{constructor(t,n){super(t,n),this.model.setOptions(Tt(xt.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new xn(this.model,this.services),new XR(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.GRID})];return this.getAxisChartComponents(t)}}class aB extends se{constructor(t,n){super(t,n),this.model=new OA(this.services),this.model.setOptions(Tt(xt.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new ZR(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.GRID})];return this.getAxisChartComponents(t)}}class oB extends Le{constructor(t,n){super(t,n),this.model=new TA(this.services),this.model.setOptions(Tt(xt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=b(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new Ni(this.model,this.services)],growth:tt.STRETCH},o={id:"toolbar",components:[new Ca(this.model,this.services)],growth:tt.PREFERRED},l={id:"header",components:[new he(this.model,this.services,[a,...i?[o]:[]],{direction:bt.ROW,alignItems:fr.CENTER})],growth:tt.PREFERRED},c={id:"legend",components:[new gm(this.model,this.services,{chartType:"choropleth"})],growth:tt.PREFERRED,renderType:q.SVG},u={id:"graph-frame",components:t,growth:tt.STRETCH,renderType:q.SVG},h=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,d=bt.COLUMN_REVERSE,f={id:"spacer",components:[new cn(this.model,this.services,{size:15})],growth:tt.PREFERRED},p={id:"full-frame",components:[new he(this.model,this.services,[...h?[c]:[],...h?[f]:[],u],{direction:d})],growth:tt.STRETCH},m=[];if(s||i){m.push(l);const g={id:"spacer",components:[new cn(this.model,this.services,i?{size:15}:void 0)],growth:tt.PREFERRED};m.push(g)}return m.push(p),[new Tc(this.model,this.services),new Ia(this.model,this.services),new he(this.model,this.services,m,{direction:bt.COLUMN})]}getComponents(){const t=[new XP(this.model,this.services)];return this.getChartComponents(t)}}class lB extends Le{constructor(t,n){super(t,n),this.model=new MA(this.services),this.model.setOptions(Tt(xt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new oI(this.model,this.services)];return this.getChartComponents(t)}}const zm={[ge.LINE]:[$r,Ve],[ge.SCATTER]:[Ve],[ge.AREA]:[hm,$r,Ve],[ge.STACKED_AREA]:[wm,$r,Em,Pa],[ge.SIMPLE_BAR]:[bm],[ge.GROUPED_BAR]:[xm,Ar],[ge.STACKED_BAR]:[_m,Pa]};class cB extends se{constructor(t,n){super(t,n);const r=Tt(xt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:ge.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(zm).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${eB(i.type)}Chart`;return a=Z({},xt[l],this.model.getOptions(),i.options),i.type===ge.STACKED_AREA&&(o=!0),zm[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=Z({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return Nm(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===ge.STACKED_BAR||i.type===ge.STACKED_AREA),r=[new ie(this.model,this.services),new de(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.GRID}),...n?[]:[new xn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class jm extends Le{constructor(t,n,r=!1){super(t,n),this.model=new CA(this.services),!r&&(this.model.setOptions(Tt(xt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new mm(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.PIE})];return this.getChartComponents(t)}}class uB extends jm{constructor(t,n){super(t,n,!0),this.model.setOptions(Tt(xt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new cI(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.DONUT})];return this.getChartComponents(t)}}class hB extends Le{constructor(t,n){super(t,n),this.model=new $A(this.services),this.model.setOptions(Tt(xt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new uI(this.model,this.services)];return this.getChartComponents(t)}}class dB extends se{constructor(t,n){super(t,n),this.model.setOptions(Tt(xt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new xm(this.model,this.services),new Ar(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class fB extends se{constructor(t,n){super(t,n),this.model=new AA(this.services),this.model.setOptions(Tt(xt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=b(r,"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 Ni(this.model,this.services)],growth:tt.STRETCH},o={id:"toolbar",components:[new Ca(this.model,this.services)],growth:tt.PREFERRED},l={id:"header",components:[new he(this.model,this.services,[a,...i?[o]:[]],{direction:bt.ROW,alignItems:fr.CENTER})],growth:tt.PREFERRED},c={id:"legend",components:[new gm(this.model,this.services,{chartType:"heatmap"})],growth:tt.PREFERRED,renderType:q.SVG},u={id:"graph-frame",components:t,growth:tt.STRETCH,renderType:q.SVG},h=b(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,d=bt.COLUMN_REVERSE,f={id:"spacer",components:[new cn(this.model,this.services,{size:15})],growth:tt.PREFERRED},p={id:"full-frame",components:[new he(this.model,this.services,[...h?[c]:[],...h?[f]:[],u],{direction:d})],growth:tt.STRETCH},m=[];if(s||i){m.push(l);const g={id:"spacer",components:[new cn(this.model,this.services,i?{size:15}:void 0)],growth:tt.PREFERRED};m.push(g)}return m.push(p),[new um(this.model,this.services),new Ia(this.model,this.services),new he(this.model,this.services,m,{direction:bt.COLUMN})]}getComponents(){const t=[new ie(this.model,this.services),new hI(this.model,this.services)];return this.getAxisChartComponents(t)}}class pB extends se{constructor(t,n){super(t,n),this.model=new LA(this.services),this.model.setOptions(Tt(xt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new sI(this.model,this.services),new dI(this.model,this.services)];return this.getAxisChartComponents(t)}}class gB extends se{constructor(t,n){super(t,n),this.model.setOptions(Tt(xt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new xn(this.model,this.services),new $r(this.model,this.services),new Ve(this.model,this.services,{handleThresholds:!0}),new mI(this.model,this.services),new Ar(this.model,this.services)];return this.getAxisChartComponents(t)}}class mB extends se{constructor(t,n){super(t,n),this.model.setOptions(Tt(xt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new xn(this.model,this.services),new fI(this.model,this.services),new Ve(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.GRID})];return this.getAxisChartComponents(t)}}class vB extends Le{constructor(t,n){var r;super(t,n),this.model=new DA(this.services);const i=(r=n.options.meter)!=null&&r.proportional?Z(rn(xt.proportionalMeterChart),n.options):Z(rn(xt.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...b(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new aI(this.model,this.services)],growth:tt.STRETCH,renderType:q.SVG},{id:"spacer",components:[new cn(this.model,this.services,{size:8})],growth:tt.STRETCH}]:[],{id:"meter-graph",components:[new pI(this.model,this.services)],growth:tt.STRETCH,renderType:q.SVG}],n=[new he(this.model,this.services,t,{direction:bt.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:q.HTML})}}class yB extends Le{constructor(t,n){super(t,n),this.model=new kA(this.services),this.model.setOptions(Tt(xt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new gI(this.model,this.services)];return this.getChartComponents(t)}}class xB extends se{constructor(t,n){super(t,n),this.model.setOptions(Tt(xt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new xn(this.model,this.services),new Ve(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.GRID})];return this.getAxisChartComponents(t)}}class bB extends Le{constructor(t,n){super(t,n),this.model=new RA(this.services),this.model.setOptions(Tt(xt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new vI(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class wB extends Le{constructor(t,n){super(t,n),this.model=new IA(this.services),this.model.setOptions(Tt(xt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new WP(this.model,this.services)];return this.getChartComponents(t)}}class _B extends se{constructor(t,n){super(t,n),this.model.setOptions(Tt(xt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new bm(this.model,this.services),new Ar(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class EB extends se{constructor(t,n){super(t,n),this.model.setOptions(Tt(xt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new Pa(this.model,this.services),new wm(this.model,this.services),new $r(this.model,this.services,{stacked:!0}),new Em(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new Kt(this.model,this.services,{skeleton:Nt.GRID})];return this.getAxisChartComponents(t)}}class SB extends se{constructor(t,n){super(t,n),this.model.setOptions(Tt(xt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new Pa(this.model,this.services),new _m(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.VERT_OR_HORIZ}),new Ar(this.model,this.services)];return this.getAxisChartComponents(t)}}class OB extends Le{constructor(t,n){super(t,n),this.model=new NA(this.services),this.model.setOptions(Tt(xt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new qP(this.model,this.services),new Kt(this.model,this.services,{skeleton:Nt.PIE})];return this.getChartComponents(t)}}function Ot(e,t){return xe.defineComponent({name:t,props:{data:{type:Object,required:!0},options:{type:Object,required:!0}},setup(n){const r=xe.ref(null),i=xe.ref(null),{data:s,options:a}=xe.toRefs(n);return xe.onMounted(()=>{i.value=new e(r.value,{data:s.value,options:a.value})}),xe.watch(s,o=>{var l;(l=i.value)==null||l.model.setData(o)},{immediate:!0}),xe.watch(a,o=>{var l;(l=i.value)==null||l.model.setOptions(o)}),{chart:i,chartDiv:r}},template:'<div ref="chartDiv"></div>'})}const Wm=Ot(nB,"CcvAlluvialChart"),qm=Ot(rB,"CcvAreaChart"),Ym=Ot(iB,"CcvBoxplotChart"),Xm=Ot(sB,"CcvBubbleChart"),Zm=Ot(aB,"CcvBulletChart"),Km=Ot(oB,"ExperimentalCcvChoroplethChart"),Qm=Ot(lB,"CcvCirclePackChart"),Jm=Ot(cB,"CcvComboChart"),tv=Ot(uB,"CcvDonutChart"),ev=Ot(hB,"CcvGaugeChart"),nv=Ot(dB,"CcvGroupedBarChart"),rv=Ot(fB,"CcvHeatmapChart"),iv=Ot(pB,"CcvHistogramChart"),sv=Ot(gB,"CcvLineChart"),av=Ot(mB,"CcvLollipopChart"),ov=Ot(vB,"CcvMeterChart"),lv=Ot(jm,"CcvPieChart"),cv=Ot(yB,"CcvRadarChart"),uv=Ot(xB,"CcvScatterChart"),hv=Ot(_B,"CcvSimpleBarChart"),dv=Ot(EB,"CcvStackedAreaChart"),fv=Ot(SB,"CcvStackedBarChart"),pv=Ot(bB,"CcvTreeChart"),gv=Ot(wB,"CcvTreemapChart"),mv=Ot(OB,"CcvWordCloudChart"),TB=[Wm,qm,Ym,Xm,Zm,Km,Qm,Jm,tv,ev,nv,rv,iv,sv,av,ov,lv,cv,uv,hv,dv,fv,pv,gv,mv],MB={install(e,t){for(const n of TB)(!t||t.includes(n.name))&&e.component(n.name,n)}};nt.CcvAlluvialChart=Wm,nt.CcvAreaChart=qm,nt.CcvBoxplotChart=Ym,nt.CcvBubbleChart=Xm,nt.CcvBulletChart=Zm,nt.CcvCirclePackChart=Qm,nt.CcvComboChart=Jm,nt.CcvDonutChart=tv,nt.CcvGaugeChart=ev,nt.CcvGroupedBarChart=nv,nt.CcvHeatmapChart=rv,nt.CcvHistogramChart=iv,nt.CcvLineChart=sv,nt.CcvLollipopChart=av,nt.CcvMeterChart=ov,nt.CcvPieChart=lv,nt.CcvRadarChart=cv,nt.CcvScatterChart=uv,nt.CcvSimpleBarChart=hv,nt.CcvStackedAreaChart=dv,nt.CcvStackedBarChart=fv,nt.CcvTreeChart=pv,nt.CcvTreemapChart=gv,nt.CcvWordCloudChart=mv,nt.ExperimentalCcvChoroplethChart=Km,nt.default=MB,Object.defineProperties(nt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
84
84
|
//# sourceMappingURL=index.js.map
|