@orbcharts/plugins-basic 3.0.0-alpha.71 → 3.0.0-alpha.73
Sign up to get free protection for your applications and to get access to all the features.
@@ -1452,7 +1452,7 @@ function Tr(t) {
|
|
1452
1452
|
return Object.prototype.toString.call(t) === "[object Object]";
|
1453
1453
|
}
|
1454
1454
|
function D_(t) {
|
1455
|
-
return
|
1455
|
+
return Object.prototype.toString.call(t) === "[object Function]";
|
1456
1456
|
}
|
1457
1457
|
function Bl(t, e) {
|
1458
1458
|
if (Tr(t) === !1 || Tr(e) === !1)
|
@@ -21884,34 +21884,7 @@ c2.textRenderFn.toString = () => `(eventData) => {
|
|
21884
21884
|
}
|
21885
21885
|
return []
|
21886
21886
|
}`;
|
21887
|
-
const Jh = "Tooltip", c0 = it(Jh, "g"), SE = it(Jh, "box")
|
21888
|
-
function AE(t, e) {
|
21889
|
-
const n = e.textSizePx * 1.5, i = (t == null ? [] : Array.isArray(t) ? t : typeof t == "string" ? t.split(`
|
21890
|
-
`) : [t]).filter((o) => o != "").map((o, a) => `<tspan x="0" y="${a * n}">${o}</tspan>`).join("");
|
21891
|
-
return i ? `<text font-size="${e.textSize}" fill="${e.textColor}" x="0" y="0" style="dominant-baseline:text-before-edge">
|
21892
|
-
${i}
|
21893
|
-
</text>` : "";
|
21894
|
-
}
|
21895
|
-
function TE({ rootSelection: t, pluginName: e, rootWidth: n, rootHeight: r, svgString: i, tooltipStyle: o, event: a }) {
|
21896
|
-
t.interrupt("fadeout");
|
21897
|
-
const s = 5, u = i ? [i] : [], l = i ? [o] : [], f = t.selectAll(`g.${c0}`).data(u).join(
|
21898
|
-
(x) => x.append("g").classed(c0, !0).attr("pointer-events", "none"),
|
21899
|
-
(x) => x,
|
21900
|
-
(x) => x.style("opacity", 0).remove()
|
21901
|
-
).attr("transform", () => `translate(${a.offsetX}, ${a.offsetY})`).selectAll(`g.${SE}`).data(l).join(
|
21902
|
-
(x) => x.append("g").classed(it(e, "box"), !0)
|
21903
|
-
), h = f.selectAll("rect").data(l).join(
|
21904
|
-
(x) => x.append("rect").attr("rx", s).attr("ry", s)
|
21905
|
-
).attr("fill", (x) => x.backgroundColor).attr("stroke", (x) => x.strokeColor).attr("opacity", (x) => x.backgroundOpacity), p = f.selectAll("g").data(u).join(
|
21906
|
-
(x) => x.append("g").classed(it(e, "content"), !0).attr("transform", () => `translate(${o.padding}, ${o.padding})`)
|
21907
|
-
);
|
21908
|
-
u.length && WR(p, u[0]);
|
21909
|
-
const d = p != null && p.node() ? Vg(p) : { width: 0, height: 0 };
|
21910
|
-
h.attr("width", d.width + o.padding * 2).attr("height", d.height + o.padding * 2);
|
21911
|
-
const g = f != null && f.node() ? Vg(f) : { width: 0, height: 0 }, m = n - g.width, y = r - g.height, b = a.offsetX + o.offset[0] > m ? m - a.offsetX : o.offset[0], v = a.offsetY + o.offset[1] > y ? y - a.offsetY : o.offset[1];
|
21912
|
-
f.attr("transform", (x) => `translate(${b}, ${v})`), f.attr("transform", (x) => `translate(${b}, ${v})`);
|
21913
|
-
}
|
21914
|
-
const PE = {
|
21887
|
+
const Jh = "Tooltip", c0 = it(Jh, "g"), SE = it(Jh, "box"), AE = {
|
21915
21888
|
name: Jh,
|
21916
21889
|
defaultParams: c2,
|
21917
21890
|
layerIndex: tI,
|
@@ -21936,13 +21909,40 @@ const PE = {
|
|
21936
21909
|
toBeOption: "ColorType"
|
21937
21910
|
},
|
21938
21911
|
textRenderFn: {
|
21939
|
-
toBeTypes: ["Function"]
|
21912
|
+
toBeTypes: ["Function", "null"]
|
21940
21913
|
},
|
21941
21914
|
svgRenderFn: {
|
21942
|
-
toBeTypes: ["Function"]
|
21915
|
+
toBeTypes: ["Function", "null"]
|
21943
21916
|
}
|
21944
21917
|
})
|
21945
|
-
}
|
21918
|
+
};
|
21919
|
+
function TE(t, e) {
|
21920
|
+
const n = e.textSizePx * 1.5, i = (t == null ? [] : Array.isArray(t) ? t : typeof t == "string" ? t.split(`
|
21921
|
+
`) : [t]).filter((o) => o != "").map((o, a) => `<tspan x="0" y="${a * n}">${o}</tspan>`).join("");
|
21922
|
+
return i ? `<text font-size="${e.textSize}" fill="${e.textColor}" x="0" y="0" style="dominant-baseline:text-before-edge">
|
21923
|
+
${i}
|
21924
|
+
</text>` : "";
|
21925
|
+
}
|
21926
|
+
function PE({ rootSelection: t, pluginName: e, rootWidth: n, rootHeight: r, svgString: i, tooltipStyle: o, event: a }) {
|
21927
|
+
t.interrupt("fadeout");
|
21928
|
+
const s = 5, u = i ? [i] : [], l = i ? [o] : [], f = t.selectAll(`g.${c0}`).data(u).join(
|
21929
|
+
(x) => x.append("g").classed(c0, !0).attr("pointer-events", "none"),
|
21930
|
+
(x) => x,
|
21931
|
+
(x) => x.style("opacity", 0).remove()
|
21932
|
+
).attr("transform", () => `translate(${a.offsetX}, ${a.offsetY})`).selectAll(`g.${SE}`).data(l).join(
|
21933
|
+
(x) => x.append("g").classed(it(e, "box"), !0)
|
21934
|
+
), h = f.selectAll("rect").data(l).join(
|
21935
|
+
(x) => x.append("rect").attr("rx", s).attr("ry", s)
|
21936
|
+
).attr("fill", (x) => x.backgroundColor).attr("stroke", (x) => x.strokeColor).attr("opacity", (x) => x.backgroundOpacity), p = f.selectAll("g").data(u).join(
|
21937
|
+
(x) => x.append("g").classed(it(e, "content"), !0).attr("transform", () => `translate(${o.padding}, ${o.padding})`)
|
21938
|
+
);
|
21939
|
+
u.length && WR(p, u[0]);
|
21940
|
+
const d = p != null && p.node() ? Vg(p) : { width: 0, height: 0 };
|
21941
|
+
h.attr("width", d.width + o.padding * 2).attr("height", d.height + o.padding * 2);
|
21942
|
+
const g = f != null && f.node() ? Vg(f) : { width: 0, height: 0 }, m = n - g.width, y = r - g.height, b = a.offsetX + o.offset[0] > m ? m - a.offsetX : o.offset[0], v = a.offsetY + o.offset[1] > y ? y - a.offsetY : o.offset[1];
|
21943
|
+
f.attr("transform", (x) => `translate(${b}, ${v})`), f.attr("transform", (x) => `translate(${b}, ${v})`);
|
21944
|
+
}
|
21945
|
+
const JN = CT(AE)(({ selection: t, rootSelection: e, name: n, chartType: r, observer: i, subject: o }) => {
|
21946
21946
|
const a = new et(), s = o.event$.pipe(
|
21947
21947
|
E(a),
|
21948
21948
|
Qi((g) => g.eventName === "mouseover" || g.eventName === "mousemove")
|
@@ -21977,8 +21977,8 @@ const PE = {
|
|
21977
21977
|
E(a),
|
21978
21978
|
H(async (g) => g),
|
21979
21979
|
B((g) => g.fullParams.svgRenderFn ? g.fullParams.svgRenderFn : (m) => {
|
21980
|
-
const y = g.fullParams.textRenderFn(m);
|
21981
|
-
return
|
21980
|
+
const y = g.fullParams.textRenderFn ? g.fullParams.textRenderFn(m) : null;
|
21981
|
+
return TE(y, g.tooltipStyle);
|
21982
21982
|
})
|
21983
21983
|
), h = W({
|
21984
21984
|
event: s,
|
@@ -22007,7 +22007,7 @@ const PE = {
|
|
22007
22007
|
E(a),
|
22008
22008
|
H(async (g) => g)
|
22009
22009
|
).subscribe((g) => {
|
22010
|
-
|
22010
|
+
PE({
|
22011
22011
|
rootSelection: e,
|
22012
22012
|
pluginName: n,
|
22013
22013
|
rootWidth: g.layout.rootWidth,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
(function(K,gr){typeof exports=="object"&&typeof module<"u"?gr(exports):typeof define=="function"&&define.amd?define(["exports"],gr):(K=typeof globalThis<"u"?globalThis:K||self,gr(K["orbcharts-plugins-basic"]={}))})(this,function(K){"use strict";const gr={lineCurve:"curveLinear",lineWidth:2},hp={lineCurve:"curveLinear",linearGradientOpacity:[1,0]},pp={radius:4,fillColorType:"white",strokeColorType:"series",strokeWidth:2,onlyShowHighlighted:!1},Yu={showLine:!0,showLabel:!0,lineDashArray:"3, 3",lineColorType:"primary",labelColorType:"primary",labelTextColorType:"background",labelTextFormat:t=>t,labelPadding:20,labelRotate:0};Yu.labelTextFormat.toString=()=>"text => text";const jo={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1},G2={...jo},dp={barWidth:0,barGroupPadding:10,barRadius:!1},gp={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0]},Uu={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!0,axisLineColorType:"primary",ticks:"all",tickFormat:t=>t,tickLineVisible:!0,tickPadding:20,tickFullLine:!1,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"};Uu.tickFormat.toString=()=>"text => text";const Wu={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:null,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"},mp={...Wu},yp={},bp={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"};var Hu=function(t,e){return Hu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Hu(t,e)};function Rn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Hu(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function z2(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(t,e||[])).next())})}function xp(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function mr(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function yr(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function _i(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function br(t){return this instanceof br?(this.v=t,this):new br(t)}function Y2(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(p){return function(d){return Promise.resolve(d).then(p,f)}}function s(p,d){r[p]&&(i[p]=function(g){return new Promise(function(m,y){o.push([p,g,m,y])>1||u(p,g)})},d&&(i[p]=d(i[p])))}function u(p,d){try{l(r[p](d))}catch(g){h(o[0][3],g)}}function l(p){p.value instanceof br?Promise.resolve(p.value.v).then(c,f):h(o[0][2],p)}function c(p){u("next",p)}function f(p){u("throw",p)}function h(p,d){p(d),o.shift(),o.length&&u(o[0][0],o[0][1])}}function U2(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof mr=="function"?mr(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(a){return new Promise(function(s,u){a=t[o](a),i(s,u,a.done,a.value)})}}function i(o,a,s,u){Promise.resolve(u).then(function(l){o({value:l,done:s})},a)}}typeof SuppressedError=="function"&&SuppressedError;function yt(t){return typeof t=="function"}function Xu(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var ju=Xu(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
|
2
2
|
`+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=n}});function Vu(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Vo=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=mr(a),u=s.next();!u.done;u=s.next()){var l=u.value;l.remove(this)}}catch(g){e={error:g}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(yt(c))try{c()}catch(g){o=g instanceof ju?g.errors:[g]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=mr(f),p=h.next();!p.done;p=h.next()){var d=p.value;try{wp(d)}catch(g){o=o??[],g instanceof ju?o=_i(_i([],yr(o)),yr(g.errors)):o.push(g)}}}catch(g){r={error:g}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(o)throw new ju(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)wp(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&Vu(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&Vu(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),vp=Vo.EMPTY;function _p(t){return t instanceof Vo||t&&"closed"in t&&yt(t.remove)&&yt(t.add)&&yt(t.unsubscribe)}function wp(t){yt(t)?t():t.unsubscribe()}var $p={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Sp={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,_i([t,e],yr(n)))},clearTimeout:function(t){var e=Sp.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Ap(t){Sp.setTimeout(function(){throw t})}function qu(){}function qo(t){t()}var Zu=function(t){Rn(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,_p(n)&&n.add(r)):r.destination=j2,r}return e.create=function(n,r,i){return new wi(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Vo),W2=Function.prototype.bind;function Ku(t,e){return W2.call(t,e)}var H2=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){Zo(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){Zo(r)}else Zo(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){Zo(n)}},t}(),wi=function(t){Rn(e,t);function e(n,r,i){var o=t.call(this)||this,a;if(yt(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;o&&$p.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&Ku(n.next,s),error:n.error&&Ku(n.error,s),complete:n.complete&&Ku(n.complete,s)}):a=n}return o.destination=new H2(a),o}return e}(Zu);function Zo(t){Ap(t)}function X2(t){throw t}var j2={closed:!0,next:qu,error:X2,complete:qu},Qu=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function xr(t){return t}function V2(t){return t.length===0?xr:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var dt=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,o=Z2(e)?e:new wi(e,n,r);return qo(function(){var a=i,s=a.operator,u=a.source;o.add(s?s.call(o,u):u?i._subscribe(o):i._trySubscribe(o))}),o},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=Tp(n),new n(function(i,o){var a=new wi({next:function(s){try{e(s)}catch(u){o(u),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[Qu]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return V2(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Tp(e),new e(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},t.create=function(e){return new t(e)},t}();function Tp(t){var e;return(e=t??$p.Promise)!==null&&e!==void 0?e:Promise}function q2(t){return t&&yt(t.next)&&yt(t.error)&&yt(t.complete)}function Z2(t){return t&&t instanceof Zu||q2(t)&&_p(t)}function K2(t){return yt(t==null?void 0:t.lift)}function he(t){return function(e){if(K2(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function se(t,e,n,r,i){return new Q2(t,e,n,r,i)}var Q2=function(t){Rn(e,t);function e(n,r,i,o,a,s){var u=t.call(this,n)||this;return u.onFinalize=a,u.shouldUnsubscribe=s,u._next=r?function(l){try{r(l)}catch(c){n.error(c)}}:t.prototype._next,u._error=o?function(l){try{o(l)}catch(c){n.error(c)}finally{this.unsubscribe()}}:t.prototype._error,u._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,u}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(Zu),J2=Xu(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),nt=function(t){Rn(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new Pp(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new J2},e.prototype.next=function(n){var r=this;qo(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=mr(r.currentObservers),s=a.next();!s.done;s=a.next()){var u=s.value;u.next(n)}}catch(l){i={error:l}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;qo(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;qo(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?vp:(this.currentObservers=null,s.push(n),new Vo(function(){r.currentObservers=null,Vu(s,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},e.prototype.asObservable=function(){var n=new dt;return n.source=this,n},e.create=function(n,r){return new Pp(n,r)},e}(dt),Pp=function(t){Rn(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:vp},e}(nt),t_=function(t){Rn(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,o=n._value;if(r)throw i;return this._throwIfClosed(),o},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(nt),Mp={now:function(){return(Mp.delegate||Date).now()},delegate:void 0},e_=function(t){Rn(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=Mp);var o=t.call(this)||this;return o._bufferSize=n,o._windowTime=r,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,n),o._windowTime=Math.max(1,r),o}return e.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,s=r._timestampProvider,u=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+u)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,o=i._infiniteTimeWindow,a=i._buffer,s=a.slice(),u=0;u<s.length&&!n.closed;u+=o?1:2)n.next(s[u]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,o=n._buffer,a=n._infiniteTimeWindow,s=(a?1:2)*r;if(r<1/0&&s<o.length&&o.splice(0,o.length-s),!a){for(var u=i.now(),l=0,c=1;c<o.length&&o[c]<=u;c+=2)l=c;l&&o.splice(0,l+1)}},e}(nt),Dp=new dt(function(t){return t.complete()});function n_(t){return t&&yt(t.schedule)}function Ju(t){return t[t.length-1]}function r_(t){return yt(Ju(t))?t.pop():void 0}function tl(t){return n_(Ju(t))?t.pop():void 0}function i_(t,e){return typeof Ju(t)=="number"?t.pop():e}var el=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Cp(t){return yt(t==null?void 0:t.then)}function Lp(t){return yt(t[Qu])}function kp(t){return Symbol.asyncIterator&&yt(t==null?void 0:t[Symbol.asyncIterator])}function Rp(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function o_(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Ep=o_();function Ip(t){return yt(t==null?void 0:t[Ep])}function Np(t){return Y2(this,arguments,function(){var n,r,i,o;return xp(this,function(a){switch(a.label){case 0:n=t.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,br(n.read())];case 3:return r=a.sent(),i=r.value,o=r.done,o?[4,br(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,br(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function Bp(t){return yt(t==null?void 0:t.getReader)}function pe(t){if(t instanceof dt)return t;if(t!=null){if(Lp(t))return a_(t);if(el(t))return s_(t);if(Cp(t))return u_(t);if(kp(t))return Fp(t);if(Ip(t))return l_(t);if(Bp(t))return c_(t)}throw Rp(t)}function a_(t){return new dt(function(e){var n=t[Qu]();if(yt(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function s_(t){return new dt(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function u_(t){return new dt(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Ap)})}function l_(t){return new dt(function(e){var n,r;try{for(var i=mr(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function Fp(t){return new dt(function(e){f_(t,e).catch(function(n){return e.error(n)})})}function c_(t){return Fp(Np(t))}function f_(t,e){var n,r,i,o;return z2(this,void 0,void 0,function(){var a,s;return xp(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=U2(t),u.label=1;case 1:return[4,n.next()];case 2:if(r=u.sent(),!!r.done)return[3,4];if(a=r.value,e.next(a),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=u.sent(),i={error:s},[3,11];case 6:return u.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function fn(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(o),!i)return o}function Op(t,e){return e===void 0&&(e=0),he(function(n,r){n.subscribe(se(r,function(i){return fn(r,t,function(){return r.next(i)},e)},function(){return fn(r,t,function(){return r.complete()},e)},function(i){return fn(r,t,function(){return r.error(i)},e)}))})}function Gp(t,e){return e===void 0&&(e=0),he(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function h_(t,e){return pe(t).pipe(Gp(e),Op(e))}function p_(t,e){return pe(t).pipe(Gp(e),Op(e))}function d_(t,e){return new dt(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function g_(t,e){return new dt(function(n){var r;return fn(n,e,function(){r=t[Ep](),fn(n,e,function(){var i,o,a;try{i=r.next(),o=i.value,a=i.done}catch(s){n.error(s);return}a?n.complete():n.next(o)},0,!0)}),function(){return yt(r==null?void 0:r.return)&&r.return()}})}function zp(t,e){if(!t)throw new Error("Iterable cannot be null");return new dt(function(n){fn(n,e,function(){var r=t[Symbol.asyncIterator]();fn(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function m_(t,e){return zp(Np(t),e)}function y_(t,e){if(t!=null){if(Lp(t))return h_(t,e);if(el(t))return d_(t,e);if(Cp(t))return p_(t,e);if(kp(t))return zp(t,e);if(Ip(t))return g_(t,e);if(Bp(t))return m_(t,e)}throw Rp(t)}function Ko(t,e){return e?y_(t,e):pe(t)}function Qo(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=tl(t);return Ko(t,n)}var Yp=Xu(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function B(t,e){return he(function(n,r){var i=0;n.subscribe(se(r,function(o){r.next(t.call(e,o,i++))}))})}var b_=Array.isArray;function x_(t,e){return b_(e)?t.apply(void 0,_i([],yr(e))):t(e)}function Up(t){return B(function(e){return x_(t,e)})}var v_=Array.isArray,__=Object.getPrototypeOf,w_=Object.prototype,$_=Object.keys;function S_(t){if(t.length===1){var e=t[0];if(v_(e))return{args:e,keys:null};if(A_(e)){var n=$_(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function A_(t){return t&&typeof t=="object"&&__(t)===w_}function T_(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function U(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=tl(t),r=r_(t),i=S_(t),o=i.args,a=i.keys;if(o.length===0)return Ko([],n);var s=new dt(P_(o,n,a?function(u){return T_(a,u)}:xr));return r?s.pipe(Up(r)):s}function P_(t,e,n){return n===void 0&&(n=xr),function(r){Wp(e,function(){for(var i=t.length,o=new Array(i),a=i,s=i,u=function(c){Wp(e,function(){var f=Ko(t[c],e),h=!1;f.subscribe(se(r,function(p){o[c]=p,h||(h=!0,s--),s||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},l=0;l<i;l++)u(l)},r)}}function Wp(t,e,n){t?fn(n,t,e):e()}function M_(t,e,n,r,i,o,a,s){var u=[],l=0,c=0,f=!1,h=function(){f&&!u.length&&!l&&e.complete()},p=function(g){return l<r?d(g):u.push(g)},d=function(g){l++;var m=!1;pe(n(g,c++)).subscribe(se(e,function(y){e.next(y)},function(){m=!0},void 0,function(){if(m)try{l--;for(var y=function(){var b=u.shift();a||d(b)};u.length&&l<r;)y();h()}catch(b){e.error(b)}}))};return t.subscribe(se(e,p,function(){f=!0,h()})),function(){}}function nl(t,e,n){return n===void 0&&(n=1/0),yt(e)?nl(function(r,i){return B(function(o,a){return e(r,o,i,a)})(pe(t(r,i)))},n):(typeof e=="number"&&(n=e),he(function(r,i){return M_(r,i,t,n)}))}function D_(t){return t===void 0&&(t=1/0),nl(xr,t)}function C_(t){return new dt(function(e){pe(t()).subscribe(e)})}var L_=["addListener","removeListener"],k_=["addEventListener","removeEventListener"],R_=["on","off"];function rl(t,e,n,r){if(yt(n)&&(r=n,n=void 0),r)return rl(t,e,n).pipe(Up(r));var i=yr(N_(t)?k_.map(function(s){return function(u){return t[s](e,u,n)}}):E_(t)?L_.map(Hp(t,e)):I_(t)?R_.map(Hp(t,e)):[],2),o=i[0],a=i[1];if(!o&&el(t))return nl(function(s){return rl(s,e,n)})(pe(t));if(!o)throw new TypeError("Invalid event target");return new dt(function(s){var u=function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return s.next(1<l.length?l:l[0])};return o(u),function(){return a(u)}})}function Hp(t,e){return function(n){return function(r){return t[n](e,r)}}}function E_(t){return yt(t.addListener)&&yt(t.removeListener)}function I_(t){return yt(t.on)&&yt(t.off)}function N_(t){return yt(t.addEventListener)&&yt(t.removeEventListener)}function Xp(t,e,n){return C_(function(){return t()?e:n})}function il(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=tl(t),r=i_(t,1/0),i=t;return i.length?i.length===1?pe(i[0]):D_(r)(Ko(i,n)):Dp}function $i(t,e){return he(function(n,r){var i=0;n.subscribe(se(r,function(o){return t.call(e,o,i++)&&r.next(o)}))})}function B_(t){return he(function(e,n){var r=!1;e.subscribe(se(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function F_(t){return t<=0?function(){return Dp}:he(function(e,n){var r=0;e.subscribe(se(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function tt(t,e){return e===void 0&&(e=xr),t=t??O_,he(function(n,r){var i,o=!0;n.subscribe(se(r,function(a){var s=e(a);(o||!t(i,s))&&(o=!1,i=s,r.next(a))}))})}function O_(t,e){return t===e}function G_(t){return t===void 0&&(t=z_),he(function(e,n){var r=!1;e.subscribe(se(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function z_(){return new Yp}function Y_(t,e){var n=arguments.length>=2;return function(r){return r.pipe(xr,F_(1),n?B_(e):G_(function(){return new Yp}))}}function U_(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new nt}:e,r=t.resetOnError,i=r===void 0?!0:r,o=t.resetOnComplete,a=o===void 0?!0:o,s=t.resetOnRefCountZero,u=s===void 0?!0:s;return function(l){var c,f,h,p=0,d=!1,g=!1,m=function(){f==null||f.unsubscribe(),f=void 0},y=function(){m(),c=h=void 0,d=g=!1},b=function(){var v=c;y(),v==null||v.unsubscribe()};return he(function(v,x){p++,!g&&!d&&m();var S=h=h??n();x.add(function(){p--,p===0&&!g&&!d&&(f=ol(b,u))}),S.subscribe(x),!c&&p>0&&(c=new wi({next:function($){return S.next($)},error:function($){g=!0,m(),f=ol(y,i,$),S.error($)},complete:function(){d=!0,m(),f=ol(y,a),S.complete()}}),pe(v).subscribe(c))})(l)}}function ol(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new wi({next:function(){i.unsubscribe(),t()}});return pe(e.apply(void 0,_i([],yr(n)))).subscribe(i)}}function St(t,e,n){var r,i=!1;return r=t,U_({connector:function(){return new e_(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function W(t,e){return he(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(se(r,function(u){i==null||i.unsubscribe();var l=0,c=o++;pe(t(u,c)).subscribe(i=se(r,function(f){return r.next(e?e(u,f,c,l++):f)},function(){i=null,s()}))},function(){a=!0,s()}))})}function I(t){return he(function(e,n){pe(t).subscribe(se(n,function(){return n.complete()},qu)),!n.closed&&e.subscribe(n)})}const vr={position:"left",scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""};function _r(t){return Object.prototype.toString.call(t)==="[object Object]"}function W_(t){return!!t&&!t.nodename&&t.constructor!=String&&t.constructor!=RegExp&&t.constructor!=Array&&/function/i.test(t+"")}function al(t,e){if(_r(t)===!1||_r(e)===!1)return Object.assign({},e);const n=(r,i)=>{const o=Object.assign({},i);for(let a of Object.keys(r)){if(!(a in i))continue;let s;_r(r[a])&&_r(i[a])?(s=n(r[a],i[a]),o[a]=s):o[a]=r[a]}return o};return n(t,e)}function H_(t,e){const n={string:i=>typeof i=="string",number:i=>typeof i=="number",boolean:i=>typeof i=="boolean",object:i=>_r(i),"object[]":i=>Array.isArray(i)&&i.every(o=>_r(o)),"string[]":i=>Array.isArray(i)&&i.every(o=>typeof o=="string"),"number[]":i=>Array.isArray(i)&&i.every(o=>typeof o=="number"),Function:i=>W_(i),null:i=>i===null,undefined:i=>i===void 0},r={ColorType:i=>i==="none"||i==="series"||i==="primary"||i==="secondary"||i==="white"||i==="background"};return Object.keys(t).find(i=>{if(e[i]){const o=e[i],a=t[i];if(o.toBeTypes){if(o.toBeTypes.some(s=>n[s](a))===!1)return!0}else if(o.toBe){const{toBe:s,test:u}=o;if(u(a)===!1)return!0}else if(o.toBeOption){const s=o.toBeOption;if(r[s](a)===!1)return!0}}return!1})}function X_(t,e){const n=H_(t,e);if(n){const r=e[n],i=r.toBeTypes?r.toBeTypes.join(" | "):r.toBe?r.toBe:r.toBeOption?r.toBeOption:"";return{status:"error",columnName:n,expectToBe:i}}else return{status:"success",columnName:"",expectToBe:""}}function Jo(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function j_(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function jp(t){let e,n,r;t.length!==2?(e=Jo,n=(s,u)=>Jo(t(s),u),r=(s,u)=>t(s)-u):(e=t===Jo||t===j_?t:V_,n=t,r=t);function i(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;n(s[f],u)<0?l=f+1:c=f}while(l<c)}return l}function o(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;n(s[f],u)<=0?l=f+1:c=f}while(l<c)}return l}function a(s,u,l=0,c=s.length){const f=i(s,u,l,c-1);return f>l&&r(s[f-1],u)>-r(s[f],u)?f-1:f}return{left:i,center:a,right:o}}function V_(){return 0}function q_(t){return t===null?NaN:+t}const Z_=jp(Jo),Vp=Z_.right;jp(q_).center;const K_=Math.sqrt(50),Q_=Math.sqrt(10),J_=Math.sqrt(2);function ta(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=K_?10:o>=Q_?5:o>=J_?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),u=Math.round(e*l),s/l<t&&++s,u/l>e&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),u=Math.round(e/l),s*l<t&&++s,u*l>e&&--u),u<s&&.5<=n&&n<2?ta(t,e,n*2):[s,u,l]}function tw(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?ta(e,t,n):ta(t,e,n);if(!(o>=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let l=0;l<s;++l)u[l]=(o-l)/-a;else for(let l=0;l<s;++l)u[l]=(o-l)*a;else if(a<0)for(let l=0;l<s;++l)u[l]=(i+l)/-a;else for(let l=0;l<s;++l)u[l]=(i+l)*a;return u}function sl(t,e,n){return e=+e,t=+t,n=+n,ta(t,e,n)[2]}function ew(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?sl(e,t,n):sl(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}var nw={value:()=>{}};function qp(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ea(n)}function ea(t){this._=t}function rw(t,e){return t.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&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ea.prototype=qp.prototype={constructor:ea,on:function(t,e){var n=this._,r=rw(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=iw(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<a;)if(i=(t=r[o]).type)n[i]=Zp(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Zp(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ea(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function iw(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Zp(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=nw,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var ul="http://www.w3.org/1999/xhtml";const Kp={svg:"http://www.w3.org/2000/svg",xhtml:ul,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function na(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Kp.hasOwnProperty(e)?{space:Kp[e],local:t}:t}function ow(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===ul&&e.documentElement.namespaceURI===ul?e.createElement(t):e.createElementNS(n,t)}}function aw(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Qp(t){var e=na(t);return(e.local?aw:ow)(e)}function sw(){}function ll(t){return t==null?sw:function(){return this.querySelector(t)}}function uw(t){typeof t!="function"&&(t=ll(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=new Array(a),u,l,c=0;c<a;++c)(u=o[c])&&(l=t.call(u,u.__data__,c,o))&&("__data__"in u&&(l.__data__=u.__data__),s[c]=l);return new we(r,this._parents)}function lw(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function cw(){return[]}function Jp(t){return t==null?cw:function(){return this.querySelectorAll(t)}}function fw(t){return function(){return lw(t.apply(this,arguments))}}function hw(t){typeof t=="function"?t=fw(t):t=Jp(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a=e[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new we(r,i)}function td(t){return function(){return this.matches(t)}}function ed(t){return function(e){return e.matches(t)}}var pw=Array.prototype.find;function dw(t){return function(){return pw.call(this.children,t)}}function gw(){return this.firstElementChild}function mw(t){return this.select(t==null?gw:dw(typeof t=="function"?t:ed(t)))}var yw=Array.prototype.filter;function bw(){return Array.from(this.children)}function xw(t){return function(){return yw.call(this.children,t)}}function vw(t){return this.selectAll(t==null?bw:xw(typeof t=="function"?t:ed(t)))}function _w(t){typeof t!="function"&&(t=td(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new we(r,this._parents)}function nd(t){return new Array(t.length)}function ww(){return new we(this._enter||this._groups.map(nd),this._parents)}function ra(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}ra.prototype={constructor:ra,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function $w(t){return function(){return t}}function Sw(t,e,n,r,i,o){for(var a=0,s,u=e.length,l=o.length;a<l;++a)(s=e[a])?(s.__data__=o[a],r[a]=s):n[a]=new ra(t,o[a]);for(;a<u;++a)(s=e[a])&&(i[a]=s)}function Aw(t,e,n,r,i,o,a){var s,u,l=new Map,c=e.length,f=o.length,h=new Array(c),p;for(s=0;s<c;++s)(u=e[s])&&(h[s]=p=a.call(u,u.__data__,s,e)+"",l.has(p)?i[s]=u:l.set(p,u));for(s=0;s<f;++s)p=a.call(t,o[s],s,o)+"",(u=l.get(p))?(r[s]=u,u.__data__=o[s],l.delete(p)):n[s]=new ra(t,o[s]);for(s=0;s<c;++s)(u=e[s])&&l.get(h[s])===u&&(i[s]=u)}function Tw(t){return t.__data__}function Pw(t,e){if(!arguments.length)return Array.from(this,Tw);var n=e?Aw:Sw,r=this._parents,i=this._groups;typeof t!="function"&&(t=$w(t));for(var o=i.length,a=new Array(o),s=new Array(o),u=new Array(o),l=0;l<o;++l){var c=r[l],f=i[l],h=f.length,p=Mw(t.call(c,c&&c.__data__,l,r)),d=p.length,g=s[l]=new Array(d),m=a[l]=new Array(d),y=u[l]=new Array(h);n(c,f,g,m,y,p,e);for(var b=0,v=0,x,S;b<d;++b)if(x=g[b]){for(b>=v&&(v=b+1);!(S=m[v])&&++v<d;);x._next=S||null}}return a=new we(a,r),a._enter=s,a._exit=u,a}function Mw(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Dw(){return new we(this._exit||this._groups.map(nd),this._parents)}function Cw(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function Lw(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),u=0;u<a;++u)for(var l=n[u],c=r[u],f=l.length,h=s[u]=new Array(f),p,d=0;d<f;++d)(p=l[d]||c[d])&&(h[d]=p);for(;u<i;++u)s[u]=n[u];return new we(s,this._parents)}function kw(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function Rw(t){t||(t=Ew);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,u=i[o]=new Array(s),l,c=0;c<s;++c)(l=a[c])&&(u[c]=l);u.sort(e)}return new we(i,this._parents).order()}function Ew(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Iw(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Nw(){return Array.from(this)}function Bw(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function Fw(){let t=0;for(const e of this)++t;return t}function Ow(){return!this.node()}function Gw(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&t.call(s,s.__data__,o,i);return this}function zw(t){return function(){this.removeAttribute(t)}}function Yw(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Uw(t,e){return function(){this.setAttribute(t,e)}}function Ww(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Hw(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Xw(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function jw(t,e){var n=na(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?Yw:zw:typeof e=="function"?n.local?Xw:Hw:n.local?Ww:Uw)(n,e))}function rd(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Vw(t){return function(){this.style.removeProperty(t)}}function qw(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Zw(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Kw(t,e,n){return arguments.length>1?this.each((e==null?Vw:typeof e=="function"?Zw:qw)(t,e,n??"")):wr(this.node(),t)}function wr(t,e){return t.style.getPropertyValue(e)||rd(t).getComputedStyle(t,null).getPropertyValue(e)}function Qw(t){return function(){delete this[t]}}function Jw(t,e){return function(){this[t]=e}}function t$(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function e$(t,e){return arguments.length>1?this.each((e==null?Qw:typeof e=="function"?t$:Jw)(t,e)):this.node()[t]}function id(t){return t.trim().split(/^|\s+/)}function cl(t){return t.classList||new od(t)}function od(t){this._node=t,this._names=id(t.getAttribute("class")||"")}od.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function ad(t,e){for(var n=cl(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function sd(t,e){for(var n=cl(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function n$(t){return function(){ad(this,t)}}function r$(t){return function(){sd(this,t)}}function i$(t,e){return function(){(e.apply(this,arguments)?ad:sd)(this,t)}}function o$(t,e){var n=id(t+"");if(arguments.length<2){for(var r=cl(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?i$:e?n$:r$)(n,e))}function a$(){this.textContent=""}function s$(t){return function(){this.textContent=t}}function u$(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function l$(t){return arguments.length?this.each(t==null?a$:(typeof t=="function"?u$:s$)(t)):this.node().textContent}function c$(){this.innerHTML=""}function f$(t){return function(){this.innerHTML=t}}function h$(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function p$(t){return arguments.length?this.each(t==null?c$:(typeof t=="function"?h$:f$)(t)):this.node().innerHTML}function d$(){this.nextSibling&&this.parentNode.appendChild(this)}function g$(){return this.each(d$)}function m$(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function y$(){return this.each(m$)}function b$(t){var e=typeof t=="function"?t:Qp(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function x$(){return null}function v$(t,e){var n=typeof t=="function"?t:Qp(t),r=e==null?x$:typeof e=="function"?e:ll(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function _$(){var t=this.parentNode;t&&t.removeChild(this)}function w$(){return this.each(_$)}function $$(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function S$(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function A$(t){return this.select(t?S$:$$)}function T$(t){return arguments.length?this.property("__data__",t):this.node().__data__}function P$(t){return function(e){t.call(this,e,this.__data__)}}function M$(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function D$(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function C$(t,e,n){return function(){var r=this.__on,i,o=P$(e);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function L$(t,e,n){var r=M$(t+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var u=0,l=s.length,c;u<l;++u)for(i=0,c=s[u];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=e?C$:D$,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function ud(t,e,n){var r=rd(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function k$(t,e){return function(){return ud(this,t,e)}}function R$(t,e){return function(){return ud(this,t,e.apply(this,arguments))}}function E$(t,e){return this.each((typeof e=="function"?R$:k$)(t,e))}function*I$(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var N$=[null];function we(t,e){this._groups=t,this._parents=e}function Si(){return new we([[document.documentElement]],N$)}function B$(){return this}we.prototype=Si.prototype={constructor:we,select:uw,selectAll:hw,selectChild:mw,selectChildren:vw,filter:_w,data:Pw,enter:ww,exit:Dw,join:Cw,merge:Lw,selection:B$,order:kw,sort:Rw,call:Iw,nodes:Nw,node:Bw,size:Fw,empty:Ow,each:Gw,attr:jw,style:Kw,property:e$,classed:o$,text:l$,html:p$,raise:g$,lower:y$,append:b$,insert:v$,remove:w$,clone:A$,datum:T$,on:L$,dispatch:E$,[Symbol.iterator]:I$};function fl(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ld(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Ai(){}var Ti=.7,ia=1/Ti,$r="\\s*([+-]?\\d+)\\s*",Pi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ee="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",F$=/^#([0-9a-f]{3,8})$/,O$=new RegExp(`^rgb\\(${$r},${$r},${$r}\\)$`),G$=new RegExp(`^rgb\\(${Ee},${Ee},${Ee}\\)$`),z$=new RegExp(`^rgba\\(${$r},${$r},${$r},${Pi}\\)$`),Y$=new RegExp(`^rgba\\(${Ee},${Ee},${Ee},${Pi}\\)$`),U$=new RegExp(`^hsl\\(${Pi},${Ee},${Ee}\\)$`),W$=new RegExp(`^hsla\\(${Pi},${Ee},${Ee},${Pi}\\)$`),cd={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};fl(Ai,En,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:fd,formatHex:fd,formatHex8:H$,formatHsl:X$,formatRgb:hd,toString:hd});function fd(){return this.rgb().formatHex()}function H$(){return this.rgb().formatHex8()}function X$(){return yd(this).formatHsl()}function hd(){return this.rgb().formatRgb()}function En(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=F$.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?pd(e):n===3?new ne(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?oa(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?oa(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=O$.exec(t))?new ne(e[1],e[2],e[3],1):(e=G$.exec(t))?new ne(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=z$.exec(t))?oa(e[1],e[2],e[3],e[4]):(e=Y$.exec(t))?oa(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=U$.exec(t))?md(e[1],e[2]/100,e[3]/100,1):(e=W$.exec(t))?md(e[1],e[2]/100,e[3]/100,e[4]):cd.hasOwnProperty(t)?pd(cd[t]):t==="transparent"?new ne(NaN,NaN,NaN,0):null}function pd(t){return new ne(t>>16&255,t>>8&255,t&255,1)}function oa(t,e,n,r){return r<=0&&(t=e=n=NaN),new ne(t,e,n,r)}function j$(t){return t instanceof Ai||(t=En(t)),t?(t=t.rgb(),new ne(t.r,t.g,t.b,t.opacity)):new ne}function hl(t,e,n,r){return arguments.length===1?j$(t):new ne(t,e,n,r??1)}function ne(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}fl(ne,hl,ld(Ai,{brighter(t){return t=t==null?ia:Math.pow(ia,t),new ne(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ti:Math.pow(Ti,t),new ne(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ne(In(this.r),In(this.g),In(this.b),aa(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:dd,formatHex:dd,formatHex8:V$,formatRgb:gd,toString:gd}));function dd(){return`#${Nn(this.r)}${Nn(this.g)}${Nn(this.b)}`}function V$(){return`#${Nn(this.r)}${Nn(this.g)}${Nn(this.b)}${Nn((isNaN(this.opacity)?1:this.opacity)*255)}`}function gd(){const t=aa(this.opacity);return`${t===1?"rgb(":"rgba("}${In(this.r)}, ${In(this.g)}, ${In(this.b)}${t===1?")":`, ${t})`}`}function aa(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function In(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Nn(t){return t=In(t),(t<16?"0":"")+t.toString(16)}function md(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new $e(t,e,n,r)}function yd(t){if(t instanceof $e)return new $e(t.h,t.s,t.l,t.opacity);if(t instanceof Ai||(t=En(t)),!t)return new $e;if(t instanceof $e)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(e===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-e)/s+2:a=(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new $e(a,s,u,t.opacity)}function q$(t,e,n,r){return arguments.length===1?yd(t):new $e(t,e,n,r??1)}function $e(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}fl($e,q$,ld(Ai,{brighter(t){return t=t==null?ia:Math.pow(ia,t),new $e(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ti:Math.pow(Ti,t),new $e(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new ne(pl(t>=240?t-240:t+120,i,r),pl(t,i,r),pl(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new $e(bd(this.h),sa(this.s),sa(this.l),aa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=aa(this.opacity);return`${t===1?"hsl(":"hsla("}${bd(this.h)}, ${sa(this.s)*100}%, ${sa(this.l)*100}%${t===1?")":`, ${t})`}`}}));function bd(t){return t=(t||0)%360,t<0?t+360:t}function sa(t){return Math.max(0,Math.min(1,t||0))}function pl(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const dl=t=>()=>t;function Z$(t,e){return function(n){return t+n*e}}function K$(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Q$(t){return(t=+t)==1?xd:function(e,n){return n-e?K$(e,n,t):dl(isNaN(e)?n:e)}}function xd(t,e){var n=e-t;return n?Z$(t,n):dl(isNaN(t)?e:t)}const ua=function t(e){var n=Q$(e);function r(i,o){var a=n((i=hl(i)).r,(o=hl(o)).r),s=n(i.g,o.g),u=n(i.b,o.b),l=xd(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=u(c),i.opacity=l(c),i+""}}return r.gamma=t,r}(1);function J$(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function tS(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function eS(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=yl(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function nS(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Se(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function rS(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=yl(t[i],e[i]):r[i]=e[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var gl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ml=new RegExp(gl.source,"g");function iS(t){return function(){return t}}function oS(t){return function(e){return t(e)+""}}function vd(t,e){var n=gl.lastIndex=ml.lastIndex=0,r,i,o,a=-1,s=[],u=[];for(t=t+"",e=e+"";(r=gl.exec(t))&&(i=ml.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,u.push({i:a,x:Se(r,i)})),n=ml.lastIndex;return n<e.length&&(o=e.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?oS(u[0].x):iS(e):(e=u.length,function(l){for(var c=0,f;c<e;++c)s[(f=u[c]).i]=f.x(l);return s.join("")})}function yl(t,e){var n=typeof e,r;return e==null||n==="boolean"?dl(e):(n==="number"?Se:n==="string"?(r=En(e))?(e=r,ua):vd:e instanceof En?ua:e instanceof Date?nS:tS(e)?J$:Array.isArray(e)?eS:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?rS:Se)(t,e)}function aS(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var _d=180/Math.PI,wd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function $d(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*_d,skewX:Math.atan(u)*_d,scaleX:a,scaleY:s}}var la;function sS(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?wd:$d(e.a,e.b,e.c,e.d,e.e,e.f)}function uS(t){return t==null||(la||(la=document.createElementNS("http://www.w3.org/2000/svg","g")),la.setAttribute("transform",t),!(t=la.transform.baseVal.consolidate()))?wd:(t=t.matrix,$d(t.a,t.b,t.c,t.d,t.e,t.f))}function Sd(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,c,f,h,p,d){if(l!==f||c!==h){var g=p.push("translate(",null,e,null,n);d.push({i:g-4,x:Se(l,f)},{i:g-2,x:Se(c,h)})}else(f||h)&&p.push("translate("+f+e+h+n)}function a(l,c,f,h){l!==c?(l-c>180?c+=360:c-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Se(l,c)})):c&&f.push(i(f)+"rotate("+c+r)}function s(l,c,f,h){l!==c?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Se(l,c)}):c&&f.push(i(f)+"skewX("+c+r)}function u(l,c,f,h,p,d){if(l!==f||c!==h){var g=p.push(i(p)+"scale(",null,",",null,")");d.push({i:g-4,x:Se(l,f)},{i:g-2,x:Se(c,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(l,c){var f=[],h=[];return l=t(l),c=t(c),o(l.translateX,l.translateY,c.translateX,c.translateY,f,h),a(l.rotate,c.rotate,f,h),s(l.skewX,c.skewX,f,h),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,f,h),l=c=null,function(p){for(var d=-1,g=h.length,m;++d<g;)f[(m=h[d]).i]=m.x(p);return f.join("")}}}var lS=Sd(sS,"px, ","px)","deg)"),cS=Sd(uS,", ",")",")"),Sr=0,Mi=0,Di=0,Ad=1e3,ca,Ci,fa=0,Bn=0,ha=0,Li=typeof performance=="object"&&performance.now?performance:Date,Td=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function bl(){return Bn||(Td(fS),Bn=Li.now()+ha)}function fS(){Bn=0}function pa(){this._call=this._time=this._next=null}pa.prototype=Pd.prototype={constructor:pa,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?bl():+n)+(e==null?0:+e),!this._next&&Ci!==this&&(Ci?Ci._next=this:ca=this,Ci=this),this._call=t,this._time=n,xl()},stop:function(){this._call&&(this._call=null,this._time=1/0,xl())}};function Pd(t,e,n){var r=new pa;return r.restart(t,e,n),r}function hS(){bl(),++Sr;for(var t=ca,e;t;)(e=Bn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Sr}function Md(){Bn=(fa=Li.now())+ha,Sr=Mi=0;try{hS()}finally{Sr=0,dS(),Bn=0}}function pS(){var t=Li.now(),e=t-fa;e>Ad&&(ha-=e,fa=t)}function dS(){for(var t,e=ca,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:ca=n);Ci=t,xl(r)}function xl(t){if(!Sr){Mi&&(Mi=clearTimeout(Mi));var e=t-Bn;e>24?(t<1/0&&(Mi=setTimeout(Md,t-Li.now()-ha)),Di&&(Di=clearInterval(Di))):(Di||(fa=Li.now(),Di=setInterval(pS,Ad)),Sr=1,Td(Md))}}function Dd(t,e,n){var r=new pa;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var gS=qp("start","end","cancel","interrupt"),mS=[],Cd=0,Ld=1,vl=2,da=3,kd=4,_l=5,ga=6;function ma(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;yS(t,n,{name:e,index:r,group:i,on:gS,tween:mS,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Cd})}function wl(t,e){var n=Ae(t,e);if(n.state>Cd)throw new Error("too late; already scheduled");return n}function Ie(t,e){var n=Ae(t,e);if(n.state>da)throw new Error("too late; already running");return n}function Ae(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function yS(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Pd(o,0,n.time);function o(l){n.state=Ld,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var c,f,h,p;if(n.state!==Ld)return u();for(c in r)if(p=r[c],p.name===n.name){if(p.state===da)return Dd(a);p.state===kd?(p.state=ga,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete r[c]):+c<e&&(p.state=ga,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete r[c])}if(Dd(function(){n.state===da&&(n.state=kd,n.timer.restart(s,n.delay,n.time),s(l))}),n.state=vl,n.on.call("start",t,t.__data__,n.index,n.group),n.state===vl){for(n.state=da,i=new Array(h=n.tween.length),c=0,f=-1;c<h;++c)(p=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function s(l){for(var c=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(u),n.state=_l,1),f=-1,h=i.length;++f<h;)i[f].call(t,c);n.state===_l&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=ga,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function bS(t,e){var n=t.__transition,r,i,o=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){o=!1;continue}i=r.state>vl&&r.state<_l,r.state=ga,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}o&&delete t.__transition}}function xS(t){return this.each(function(){bS(this,t)})}function vS(t,e){var n,r;return function(){var i=Ie(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function _S(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Ie(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:e,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===e){i[u]=s;break}u===l&&i.push(s)}o.tween=i}}function wS(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Ae(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?vS:_S)(n,t,e))}function $l(t,e,n){var r=t._id;return t.each(function(){var i=Ie(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Ae(i,r).value[e]}}function Rd(t,e){var n;return(typeof e=="number"?Se:e instanceof En?ua:(n=En(e))?(e=n,ua):vd)(t,e)}function $S(t){return function(){this.removeAttribute(t)}}function SS(t){return function(){this.removeAttributeNS(t.space,t.local)}}function AS(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function TS(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function PS(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function MS(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function DS(t,e){var n=na(t),r=n==="transform"?cS:Rd;return this.attrTween(t,typeof e=="function"?(n.local?MS:PS)(n,r,$l(this,"attr."+t,e)):e==null?(n.local?SS:$S)(n):(n.local?TS:AS)(n,r,e))}function CS(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function LS(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function kS(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&LS(t,o)),n}return i._value=e,i}function RS(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&CS(t,o)),n}return i._value=e,i}function ES(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=na(t);return this.tween(n,(r.local?kS:RS)(r,e))}function IS(t,e){return function(){wl(this,t).delay=+e.apply(this,arguments)}}function NS(t,e){return e=+e,function(){wl(this,t).delay=e}}function BS(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?IS:NS)(e,t)):Ae(this.node(),e).delay}function FS(t,e){return function(){Ie(this,t).duration=+e.apply(this,arguments)}}function OS(t,e){return e=+e,function(){Ie(this,t).duration=e}}function GS(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?FS:OS)(e,t)):Ae(this.node(),e).duration}function zS(t,e){if(typeof e!="function")throw new Error;return function(){Ie(this,t).ease=e}}function YS(t){var e=this._id;return arguments.length?this.each(zS(e,t)):Ae(this.node(),e).ease}function US(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Ie(this,t).ease=n}}function WS(t){if(typeof t!="function")throw new Error;return this.each(US(this._id,t))}function HS(t){typeof t!="function"&&(t=td(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new Ve(r,this._parents,this._name,this._id)}function XS(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u=e[s],l=n[s],c=u.length,f=a[s]=new Array(c),h,p=0;p<c;++p)(h=u[p]||l[p])&&(f[p]=h);for(;s<r;++s)a[s]=e[s];return new Ve(a,this._parents,this._name,this._id)}function jS(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function VS(t,e,n){var r,i,o=jS(e)?wl:Ie;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}function qS(t,e){var n=this._id;return arguments.length<2?Ae(this.node(),n).on.on(t):this.each(VS(n,t,e))}function ZS(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function KS(){return this.on("end.remove",ZS(this._id))}function QS(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ll(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],u=s.length,l=o[a]=new Array(u),c,f,h=0;h<u;++h)(c=s[h])&&(f=t.call(c,c.__data__,h,s))&&("__data__"in c&&(f.__data__=c.__data__),l[h]=f,ma(l[h],e,n,h,l,Ae(c,n)));return new Ve(o,this._parents,e,n)}function JS(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Jp(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var u=r[s],l=u.length,c,f=0;f<l;++f)if(c=u[f]){for(var h=t.call(c,c.__data__,f,u),p,d=Ae(c,n),g=0,m=h.length;g<m;++g)(p=h[g])&&ma(p,e,n,g,h,d);o.push(h),a.push(c)}return new Ve(o,a,e,n)}var tA=Si.prototype.constructor;function eA(){return new tA(this._groups,this._parents)}function nA(t,e){var n,r,i;return function(){var o=wr(this,t),a=(this.style.removeProperty(t),wr(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}function Ed(t){return function(){this.style.removeProperty(t)}}function rA(t,e,n){var r,i=n+"",o;return function(){var a=wr(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function iA(t,e,n){var r,i,o;return function(){var a=wr(this,t),s=n(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(t),wr(this,t))),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}function oA(t,e){var n,r,i,o="style."+e,a="end."+o,s;return function(){var u=Ie(this,t),l=u.on,c=u.value[o]==null?s||(s=Ed(e)):void 0;(l!==n||i!==c)&&(r=(n=l).copy()).on(a,i=c),u.on=r}}function aA(t,e,n){var r=(t+="")=="transform"?lS:Rd;return e==null?this.styleTween(t,nA(t,r)).on("end.style."+t,Ed(t)):typeof e=="function"?this.styleTween(t,iA(t,r,$l(this,"style."+t,e))).each(oA(this._id,t)):this.styleTween(t,rA(t,r,e),n).on("end.style."+t,null)}function sA(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function uA(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&sA(t,a,n)),r}return o._value=e,o}function lA(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,uA(t,e,n??""))}function cA(t){return function(){this.textContent=t}}function fA(t){return function(){var e=t(this);this.textContent=e??""}}function hA(t){return this.tween("text",typeof t=="function"?fA($l(this,"text",t)):cA(t==null?"":t+""))}function pA(t){return function(e){this.textContent=t.call(this,e)}}function dA(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&pA(i)),e}return r._value=t,r}function gA(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,dA(t))}function mA(){for(var t=this._name,e=this._id,n=Id(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)if(u=a[l]){var c=Ae(u,e);ma(u,t,n,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Ve(r,this._parents,t,n)}function yA(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},u={value:function(){--i===0&&o()}};n.each(function(){var l=Ie(this,r),c=l.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),l.on=e}),i===0&&o()})}var bA=0;function Ve(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Id(){return++bA}var qe=Si.prototype;Ve.prototype={constructor:Ve,select:QS,selectAll:JS,selectChild:qe.selectChild,selectChildren:qe.selectChildren,filter:HS,merge:XS,selection:eA,transition:mA,call:qe.call,nodes:qe.nodes,node:qe.node,size:qe.size,empty:qe.empty,each:qe.each,on:qS,attr:DS,attrTween:ES,style:aA,styleTween:lA,text:hA,textTween:gA,remove:KS,tween:wS,delay:BS,duration:GS,ease:YS,easeVarying:WS,end:yA,[Symbol.iterator]:qe[Symbol.iterator]};function xA(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var vA={time:null,delay:0,duration:250,ease:xA};function _A(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function wA(t){var e,n;t instanceof Ve?(e=t._id,t=t._name):(e=Id(),(n=vA).time=bl(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&ma(u,t,e,l,a,n||_A(u,e));return new Ve(r,this._parents,t,e)}Si.prototype.interrupt=xS,Si.prototype.transition=wA;function $A(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ya(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Ar(t){return t=ya(Math.abs(t)),t?t[1]:NaN}function SA(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(n.substring(i-=s,i+s)),!((u+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function AA(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var TA=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ba(t){if(!(e=TA.exec(t)))throw new Error("invalid format: "+t);var e;return new Sl({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}ba.prototype=Sl.prototype;function Sl(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Sl.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 PA(t){t:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Nd;function MA(t,e){var n=ya(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Nd=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ya(t,Math.max(0,e+o-1))[0]}function Bd(t,e){var n=ya(t,e);if(!n)return t+"";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 Fd={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:$A,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Bd(t*100,e),r:Bd,s:MA,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Od(t){return t}var Gd=Array.prototype.map,zd=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function DA(t){var e=t.grouping===void 0||t.thousands===void 0?Od:SA(Gd.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?Od:AA(Gd.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function l(f){f=ba(f);var h=f.fill,p=f.align,d=f.sign,g=f.symbol,m=f.zero,y=f.width,b=f.comma,v=f.precision,x=f.trim,S=f.type;S==="n"?(b=!0,S="g"):Fd[S]||(v===void 0&&(v=12),x=!0,S="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var $=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",R=g==="$"?r:/[%p]/.test(S)?a:"",T=Fd[S],w=/[defgprs%]/.test(S);v=v===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function P(_){var N=$,D=R,A,L,M;if(S==="c")D=T(_)+D,_="";else{_=+_;var G=_<0||1/_<0;if(_=isNaN(_)?u:T(Math.abs(_),v),x&&(_=PA(_)),G&&+_==0&&d!=="+"&&(G=!1),N=(G?d==="("?d:s:d==="-"||d==="("?"":d)+N,D=(S==="s"?zd[8+Nd/3]:"")+D+(G&&d==="("?")":""),w){for(A=-1,L=_.length;++A<L;)if(M=_.charCodeAt(A),48>M||M>57){D=(M===46?i+_.slice(A+1):_.slice(A))+D,_=_.slice(0,A);break}}}b&&!m&&(_=e(_,1/0));var O=N.length+_.length+D.length,E=O<y?new Array(y-O+1).join(h):"";switch(b&&m&&(_=e(E+_,E.length?y-D.length:1/0),E=""),p){case"<":_=N+_+D+E;break;case"=":_=N+E+_+D;break;case"^":_=E.slice(0,O=E.length>>1)+N+_+D+E.slice(O);break;default:_=E+N+_+D;break}return o(_)}return P.toString=function(){return f+""},P}function c(f,h){var p=l((f=ba(f),f.type="f",f)),d=Math.max(-8,Math.min(8,Math.floor(Ar(h)/3)))*3,g=Math.pow(10,-d),m=zd[8+d/3];return function(y){return p(g*y)+m}}return{format:l,formatPrefix:c}}var xa,Yd,Ud;CA({thousands:",",grouping:[3],currency:["$",""]});function CA(t){return xa=DA(t),Yd=xa.format,Ud=xa.formatPrefix,xa}function LA(t){return Math.max(0,-Ar(Math.abs(t)))}function kA(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ar(e)/3)))*3-Ar(Math.abs(t)))}function RA(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ar(e)-Ar(t))+1}function Wd(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function EA(t){return function(){return t}}function IA(t){return+t}var Hd=[0,1];function Tr(t){return t}function Al(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:EA(isNaN(e)?NaN:.5)}function NA(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function BA(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=Al(i,r),o=n(a,o)):(r=Al(r,i),o=n(o,a)),function(s){return o(r(s))}}function FA(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=Al(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(s){var u=Vp(t,s,1,r)-1;return o[u](i[u](s))}}function OA(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function GA(){var t=Hd,e=Hd,n=yl,r,i,o,a=Tr,s,u,l;function c(){var h=Math.min(t.length,e.length);return a!==Tr&&(a=NA(t[0],t[h-1])),s=h>2?FA:BA,u=l=null,f}function f(h){return h==null||isNaN(h=+h)?o:(u||(u=s(t.map(r),e,n)))(r(a(h)))}return f.invert=function(h){return a(i((l||(l=s(e,t.map(r),Se)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,IA),c()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),c()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=aS,c()},f.clamp=function(h){return arguments.length?(a=h?!0:Tr,c()):a!==Tr},f.interpolate=function(h){return arguments.length?(n=h,c()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,p){return r=h,i=p,c()}}function zA(){return GA()(Tr,Tr)}function YA(t,e,n,r){var i=ew(t,e,n),o;switch(r=ba(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=kA(i,a))&&(r.precision=o),Ud(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=RA(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=LA(i))&&(r.precision=o-(r.type==="%")*2);break}}return Yd(r)}function Xd(t){var e=t.domain;return t.ticks=function(n){var r=e();return tw(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return YA(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],s=r[o],u,l,c=10;for(s<a&&(l=a,a=s,s=l,l=i,i=o,o=l);c-- >0;){if(l=sl(a,s,n),l===u)return r[i]=a,r[o]=s,e(r);if(l>0)a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l;else if(l<0)a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l;else break;u=l}return t},t}function jd(){var t=zA();return t.copy=function(){return OA(t,jd())},Wd.apply(t,arguments),Xd(t)}function Vd(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function a(u){return u!=null&&u<=u?i[Vp(r,u,0,n)]:o}function s(){var u=-1;for(r=new Array(n);++u<n;)r[u]=((u+1)*e-(u-n)*t)/(n+1);return a}return a.domain=function(u){return arguments.length?([t,e]=u,t=+t,e=+e,s()):[t,e]},a.range=function(u){return arguments.length?(n=(i=Array.from(u)).length-1,s()):i.slice()},a.invertExtent=function(u){var l=i.indexOf(u);return l<0?[NaN,NaN]:l<1?[t,r[0]]:l>=n?[r[n-1],e]:[r[l-1],r[l]]},a.unknown=function(u){return arguments.length&&(o=u),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Vd().domain([t,e]).range(i).unknown(o)},Wd.apply(Xd(a),arguments)}function ki(t,e,n){this.k=t,this.x=e,this.y=n}ki.prototype={constructor:ki,scale:function(t){return t===1?this:new ki(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new ki(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},ki.prototype;function UA(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function qd(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:o}=e.rowAmount*e.columnAmount>=n?e:UA(n);return new Array(n).fill(null).map((a,s)=>{const u=s%o,l=Math.floor(s/o),c=(t.width-r*(o-1))/o,f=(t.height-r*(i-1))/i,h=u*c+u*r,p=l*f+l*r,d=[h,p],g=[c/t.width,f/t.height];return{slotIndex:s,rowIndex:l,columnIndex:u,translate:d,scale:g}})}var Tl=function(t,e){return Tl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Tl(t,e)};function Ne(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Tl(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function WA(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(t,[])).next())})}function Zd(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Pr(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Mr(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function Dr(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function Cr(t){return this instanceof Cr?(this.v=t,this):new Cr(t)}function HA(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(p){return function(d){return Promise.resolve(d).then(p,f)}}function s(p,d){r[p]&&(i[p]=function(g){return new Promise(function(m,y){o.push([p,g,m,y])>1||u(p,g)})},d&&(i[p]=d(i[p])))}function u(p,d){try{l(r[p](d))}catch(g){h(o[0][3],g)}}function l(p){p.value instanceof Cr?Promise.resolve(p.value.v).then(c,f):h(o[0][2],p)}function c(p){u("next",p)}function f(p){u("throw",p)}function h(p,d){p(d),o.shift(),o.length&&u(o[0][0],o[0][1])}}function XA(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof Pr=="function"?Pr(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(a){return new Promise(function(s,u){a=t[o](a),i(s,u,a.done,a.value)})}}function i(o,a,s,u){Promise.resolve(u).then(function(l){o({value:l,done:s})},a)}}function Dt(t){return typeof t=="function"}function Pl(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Ml=Pl(function(t){return function(e){t(this),this.message=e?e.length+` errors occurred during unsubscription:
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=n}});function Vu(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Vo=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=mr(a),u=s.next();!u.done;u=s.next()){var l=u.value;l.remove(this)}}catch(g){e={error:g}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(yt(c))try{c()}catch(g){o=g instanceof ju?g.errors:[g]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=mr(f),p=h.next();!p.done;p=h.next()){var d=p.value;try{wp(d)}catch(g){o=o??[],g instanceof ju?o=_i(_i([],yr(o)),yr(g.errors)):o.push(g)}}}catch(g){r={error:g}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(o)throw new ju(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)wp(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&Vu(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&Vu(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),vp=Vo.EMPTY;function _p(t){return t instanceof Vo||t&&"closed"in t&&yt(t.remove)&&yt(t.add)&&yt(t.unsubscribe)}function wp(t){yt(t)?t():t.unsubscribe()}var $p={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Sp={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,_i([t,e],yr(n)))},clearTimeout:function(t){var e=Sp.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Ap(t){Sp.setTimeout(function(){throw t})}function qu(){}function qo(t){t()}var Zu=function(t){Rn(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,_p(n)&&n.add(r)):r.destination=j2,r}return e.create=function(n,r,i){return new wi(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Vo),W2=Function.prototype.bind;function Ku(t,e){return W2.call(t,e)}var H2=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){Zo(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){Zo(r)}else Zo(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){Zo(n)}},t}(),wi=function(t){Rn(e,t);function e(n,r,i){var o=t.call(this)||this,a;if(yt(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;o&&$p.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&Ku(n.next,s),error:n.error&&Ku(n.error,s),complete:n.complete&&Ku(n.complete,s)}):a=n}return o.destination=new H2(a),o}return e}(Zu);function Zo(t){Ap(t)}function X2(t){throw t}var j2={closed:!0,next:qu,error:X2,complete:qu},Qu=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function xr(t){return t}function V2(t){return t.length===0?xr:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var dt=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,o=Z2(e)?e:new wi(e,n,r);return qo(function(){var a=i,s=a.operator,u=a.source;o.add(s?s.call(o,u):u?i._subscribe(o):i._trySubscribe(o))}),o},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=Tp(n),new n(function(i,o){var a=new wi({next:function(s){try{e(s)}catch(u){o(u),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[Qu]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return V2(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Tp(e),new e(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},t.create=function(e){return new t(e)},t}();function Tp(t){var e;return(e=t??$p.Promise)!==null&&e!==void 0?e:Promise}function q2(t){return t&&yt(t.next)&&yt(t.error)&&yt(t.complete)}function Z2(t){return t&&t instanceof Zu||q2(t)&&_p(t)}function K2(t){return yt(t==null?void 0:t.lift)}function he(t){return function(e){if(K2(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function se(t,e,n,r,i){return new Q2(t,e,n,r,i)}var Q2=function(t){Rn(e,t);function e(n,r,i,o,a,s){var u=t.call(this,n)||this;return u.onFinalize=a,u.shouldUnsubscribe=s,u._next=r?function(l){try{r(l)}catch(c){n.error(c)}}:t.prototype._next,u._error=o?function(l){try{o(l)}catch(c){n.error(c)}finally{this.unsubscribe()}}:t.prototype._error,u._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,u}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(Zu),J2=Xu(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),nt=function(t){Rn(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new Pp(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new J2},e.prototype.next=function(n){var r=this;qo(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=mr(r.currentObservers),s=a.next();!s.done;s=a.next()){var u=s.value;u.next(n)}}catch(l){i={error:l}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;qo(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;qo(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?vp:(this.currentObservers=null,s.push(n),new Vo(function(){r.currentObservers=null,Vu(s,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},e.prototype.asObservable=function(){var n=new dt;return n.source=this,n},e.create=function(n,r){return new Pp(n,r)},e}(dt),Pp=function(t){Rn(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:vp},e}(nt),t_=function(t){Rn(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,o=n._value;if(r)throw i;return this._throwIfClosed(),o},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(nt),Mp={now:function(){return(Mp.delegate||Date).now()},delegate:void 0},e_=function(t){Rn(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=Mp);var o=t.call(this)||this;return o._bufferSize=n,o._windowTime=r,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,n),o._windowTime=Math.max(1,r),o}return e.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,s=r._timestampProvider,u=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+u)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,o=i._infiniteTimeWindow,a=i._buffer,s=a.slice(),u=0;u<s.length&&!n.closed;u+=o?1:2)n.next(s[u]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,o=n._buffer,a=n._infiniteTimeWindow,s=(a?1:2)*r;if(r<1/0&&s<o.length&&o.splice(0,o.length-s),!a){for(var u=i.now(),l=0,c=1;c<o.length&&o[c]<=u;c+=2)l=c;l&&o.splice(0,l+1)}},e}(nt),Dp=new dt(function(t){return t.complete()});function n_(t){return t&&yt(t.schedule)}function Ju(t){return t[t.length-1]}function r_(t){return yt(Ju(t))?t.pop():void 0}function tl(t){return n_(Ju(t))?t.pop():void 0}function i_(t,e){return typeof Ju(t)=="number"?t.pop():e}var el=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Cp(t){return yt(t==null?void 0:t.then)}function Lp(t){return yt(t[Qu])}function kp(t){return Symbol.asyncIterator&&yt(t==null?void 0:t[Symbol.asyncIterator])}function Rp(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function o_(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Ep=o_();function Ip(t){return yt(t==null?void 0:t[Ep])}function Np(t){return Y2(this,arguments,function(){var n,r,i,o;return xp(this,function(a){switch(a.label){case 0:n=t.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,br(n.read())];case 3:return r=a.sent(),i=r.value,o=r.done,o?[4,br(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,br(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function Bp(t){return yt(t==null?void 0:t.getReader)}function pe(t){if(t instanceof dt)return t;if(t!=null){if(Lp(t))return a_(t);if(el(t))return s_(t);if(Cp(t))return u_(t);if(kp(t))return Fp(t);if(Ip(t))return l_(t);if(Bp(t))return c_(t)}throw Rp(t)}function a_(t){return new dt(function(e){var n=t[Qu]();if(yt(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function s_(t){return new dt(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function u_(t){return new dt(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Ap)})}function l_(t){return new dt(function(e){var n,r;try{for(var i=mr(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function Fp(t){return new dt(function(e){f_(t,e).catch(function(n){return e.error(n)})})}function c_(t){return Fp(Np(t))}function f_(t,e){var n,r,i,o;return z2(this,void 0,void 0,function(){var a,s;return xp(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=U2(t),u.label=1;case 1:return[4,n.next()];case 2:if(r=u.sent(),!!r.done)return[3,4];if(a=r.value,e.next(a),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=u.sent(),i={error:s},[3,11];case 6:return u.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function fn(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(o),!i)return o}function Op(t,e){return e===void 0&&(e=0),he(function(n,r){n.subscribe(se(r,function(i){return fn(r,t,function(){return r.next(i)},e)},function(){return fn(r,t,function(){return r.complete()},e)},function(i){return fn(r,t,function(){return r.error(i)},e)}))})}function Gp(t,e){return e===void 0&&(e=0),he(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function h_(t,e){return pe(t).pipe(Gp(e),Op(e))}function p_(t,e){return pe(t).pipe(Gp(e),Op(e))}function d_(t,e){return new dt(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function g_(t,e){return new dt(function(n){var r;return fn(n,e,function(){r=t[Ep](),fn(n,e,function(){var i,o,a;try{i=r.next(),o=i.value,a=i.done}catch(s){n.error(s);return}a?n.complete():n.next(o)},0,!0)}),function(){return yt(r==null?void 0:r.return)&&r.return()}})}function zp(t,e){if(!t)throw new Error("Iterable cannot be null");return new dt(function(n){fn(n,e,function(){var r=t[Symbol.asyncIterator]();fn(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function m_(t,e){return zp(Np(t),e)}function y_(t,e){if(t!=null){if(Lp(t))return h_(t,e);if(el(t))return d_(t,e);if(Cp(t))return p_(t,e);if(kp(t))return zp(t,e);if(Ip(t))return g_(t,e);if(Bp(t))return m_(t,e)}throw Rp(t)}function Ko(t,e){return e?y_(t,e):pe(t)}function Qo(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=tl(t);return Ko(t,n)}var Yp=Xu(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function B(t,e){return he(function(n,r){var i=0;n.subscribe(se(r,function(o){r.next(t.call(e,o,i++))}))})}var b_=Array.isArray;function x_(t,e){return b_(e)?t.apply(void 0,_i([],yr(e))):t(e)}function Up(t){return B(function(e){return x_(t,e)})}var v_=Array.isArray,__=Object.getPrototypeOf,w_=Object.prototype,$_=Object.keys;function S_(t){if(t.length===1){var e=t[0];if(v_(e))return{args:e,keys:null};if(A_(e)){var n=$_(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function A_(t){return t&&typeof t=="object"&&__(t)===w_}function T_(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function U(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=tl(t),r=r_(t),i=S_(t),o=i.args,a=i.keys;if(o.length===0)return Ko([],n);var s=new dt(P_(o,n,a?function(u){return T_(a,u)}:xr));return r?s.pipe(Up(r)):s}function P_(t,e,n){return n===void 0&&(n=xr),function(r){Wp(e,function(){for(var i=t.length,o=new Array(i),a=i,s=i,u=function(c){Wp(e,function(){var f=Ko(t[c],e),h=!1;f.subscribe(se(r,function(p){o[c]=p,h||(h=!0,s--),s||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},l=0;l<i;l++)u(l)},r)}}function Wp(t,e,n){t?fn(n,t,e):e()}function M_(t,e,n,r,i,o,a,s){var u=[],l=0,c=0,f=!1,h=function(){f&&!u.length&&!l&&e.complete()},p=function(g){return l<r?d(g):u.push(g)},d=function(g){l++;var m=!1;pe(n(g,c++)).subscribe(se(e,function(y){e.next(y)},function(){m=!0},void 0,function(){if(m)try{l--;for(var y=function(){var b=u.shift();a||d(b)};u.length&&l<r;)y();h()}catch(b){e.error(b)}}))};return t.subscribe(se(e,p,function(){f=!0,h()})),function(){}}function nl(t,e,n){return n===void 0&&(n=1/0),yt(e)?nl(function(r,i){return B(function(o,a){return e(r,o,i,a)})(pe(t(r,i)))},n):(typeof e=="number"&&(n=e),he(function(r,i){return M_(r,i,t,n)}))}function D_(t){return t===void 0&&(t=1/0),nl(xr,t)}function C_(t){return new dt(function(e){pe(t()).subscribe(e)})}var L_=["addListener","removeListener"],k_=["addEventListener","removeEventListener"],R_=["on","off"];function rl(t,e,n,r){if(yt(n)&&(r=n,n=void 0),r)return rl(t,e,n).pipe(Up(r));var i=yr(N_(t)?k_.map(function(s){return function(u){return t[s](e,u,n)}}):E_(t)?L_.map(Hp(t,e)):I_(t)?R_.map(Hp(t,e)):[],2),o=i[0],a=i[1];if(!o&&el(t))return nl(function(s){return rl(s,e,n)})(pe(t));if(!o)throw new TypeError("Invalid event target");return new dt(function(s){var u=function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return s.next(1<l.length?l:l[0])};return o(u),function(){return a(u)}})}function Hp(t,e){return function(n){return function(r){return t[n](e,r)}}}function E_(t){return yt(t.addListener)&&yt(t.removeListener)}function I_(t){return yt(t.on)&&yt(t.off)}function N_(t){return yt(t.addEventListener)&&yt(t.removeEventListener)}function Xp(t,e,n){return C_(function(){return t()?e:n})}function il(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=tl(t),r=i_(t,1/0),i=t;return i.length?i.length===1?pe(i[0]):D_(r)(Ko(i,n)):Dp}function $i(t,e){return he(function(n,r){var i=0;n.subscribe(se(r,function(o){return t.call(e,o,i++)&&r.next(o)}))})}function B_(t){return he(function(e,n){var r=!1;e.subscribe(se(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function F_(t){return t<=0?function(){return Dp}:he(function(e,n){var r=0;e.subscribe(se(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function tt(t,e){return e===void 0&&(e=xr),t=t??O_,he(function(n,r){var i,o=!0;n.subscribe(se(r,function(a){var s=e(a);(o||!t(i,s))&&(o=!1,i=s,r.next(a))}))})}function O_(t,e){return t===e}function G_(t){return t===void 0&&(t=z_),he(function(e,n){var r=!1;e.subscribe(se(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function z_(){return new Yp}function Y_(t,e){var n=arguments.length>=2;return function(r){return r.pipe(xr,F_(1),n?B_(e):G_(function(){return new Yp}))}}function U_(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new nt}:e,r=t.resetOnError,i=r===void 0?!0:r,o=t.resetOnComplete,a=o===void 0?!0:o,s=t.resetOnRefCountZero,u=s===void 0?!0:s;return function(l){var c,f,h,p=0,d=!1,g=!1,m=function(){f==null||f.unsubscribe(),f=void 0},y=function(){m(),c=h=void 0,d=g=!1},b=function(){var v=c;y(),v==null||v.unsubscribe()};return he(function(v,x){p++,!g&&!d&&m();var S=h=h??n();x.add(function(){p--,p===0&&!g&&!d&&(f=ol(b,u))}),S.subscribe(x),!c&&p>0&&(c=new wi({next:function($){return S.next($)},error:function($){g=!0,m(),f=ol(y,i,$),S.error($)},complete:function(){d=!0,m(),f=ol(y,a),S.complete()}}),pe(v).subscribe(c))})(l)}}function ol(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new wi({next:function(){i.unsubscribe(),t()}});return pe(e.apply(void 0,_i([],yr(n)))).subscribe(i)}}function St(t,e,n){var r,i=!1;return r=t,U_({connector:function(){return new e_(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function W(t,e){return he(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(se(r,function(u){i==null||i.unsubscribe();var l=0,c=o++;pe(t(u,c)).subscribe(i=se(r,function(f){return r.next(e?e(u,f,c,l++):f)},function(){i=null,s()}))},function(){a=!0,s()}))})}function I(t){return he(function(e,n){pe(t).subscribe(se(n,function(){return n.complete()},qu)),!n.closed&&e.subscribe(n)})}const vr={position:"left",scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""};function _r(t){return Object.prototype.toString.call(t)==="[object Object]"}function W_(t){return Object.prototype.toString.call(t)==="[object Function]"}function al(t,e){if(_r(t)===!1||_r(e)===!1)return Object.assign({},e);const n=(r,i)=>{const o=Object.assign({},i);for(let a of Object.keys(r)){if(!(a in i))continue;let s;_r(r[a])&&_r(i[a])?(s=n(r[a],i[a]),o[a]=s):o[a]=r[a]}return o};return n(t,e)}function H_(t,e){const n={string:i=>typeof i=="string",number:i=>typeof i=="number",boolean:i=>typeof i=="boolean",object:i=>_r(i),"object[]":i=>Array.isArray(i)&&i.every(o=>_r(o)),"string[]":i=>Array.isArray(i)&&i.every(o=>typeof o=="string"),"number[]":i=>Array.isArray(i)&&i.every(o=>typeof o=="number"),Function:i=>W_(i),null:i=>i===null,undefined:i=>i===void 0},r={ColorType:i=>i==="none"||i==="series"||i==="primary"||i==="secondary"||i==="white"||i==="background"};return Object.keys(t).find(i=>{if(e[i]){const o=e[i],a=t[i];if(o.toBeTypes){if(o.toBeTypes.some(s=>n[s](a))===!1)return!0}else if(o.toBe){const{toBe:s,test:u}=o;if(u(a)===!1)return!0}else if(o.toBeOption){const s=o.toBeOption;if(r[s](a)===!1)return!0}}return!1})}function X_(t,e){const n=H_(t,e);if(n){const r=e[n],i=r.toBeTypes?r.toBeTypes.join(" | "):r.toBe?r.toBe:r.toBeOption?r.toBeOption:"";return{status:"error",columnName:n,expectToBe:i}}else return{status:"success",columnName:"",expectToBe:""}}function Jo(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function j_(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function jp(t){let e,n,r;t.length!==2?(e=Jo,n=(s,u)=>Jo(t(s),u),r=(s,u)=>t(s)-u):(e=t===Jo||t===j_?t:V_,n=t,r=t);function i(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;n(s[f],u)<0?l=f+1:c=f}while(l<c)}return l}function o(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;n(s[f],u)<=0?l=f+1:c=f}while(l<c)}return l}function a(s,u,l=0,c=s.length){const f=i(s,u,l,c-1);return f>l&&r(s[f-1],u)>-r(s[f],u)?f-1:f}return{left:i,center:a,right:o}}function V_(){return 0}function q_(t){return t===null?NaN:+t}const Z_=jp(Jo),Vp=Z_.right;jp(q_).center;const K_=Math.sqrt(50),Q_=Math.sqrt(10),J_=Math.sqrt(2);function ta(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=K_?10:o>=Q_?5:o>=J_?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),u=Math.round(e*l),s/l<t&&++s,u/l>e&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),u=Math.round(e/l),s*l<t&&++s,u*l>e&&--u),u<s&&.5<=n&&n<2?ta(t,e,n*2):[s,u,l]}function tw(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?ta(e,t,n):ta(t,e,n);if(!(o>=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let l=0;l<s;++l)u[l]=(o-l)/-a;else for(let l=0;l<s;++l)u[l]=(o-l)*a;else if(a<0)for(let l=0;l<s;++l)u[l]=(i+l)/-a;else for(let l=0;l<s;++l)u[l]=(i+l)*a;return u}function sl(t,e,n){return e=+e,t=+t,n=+n,ta(t,e,n)[2]}function ew(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?sl(e,t,n):sl(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}var nw={value:()=>{}};function qp(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ea(n)}function ea(t){this._=t}function rw(t,e){return t.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&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ea.prototype=qp.prototype={constructor:ea,on:function(t,e){var n=this._,r=rw(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=iw(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<a;)if(i=(t=r[o]).type)n[i]=Zp(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Zp(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ea(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function iw(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Zp(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=nw,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var ul="http://www.w3.org/1999/xhtml";const Kp={svg:"http://www.w3.org/2000/svg",xhtml:ul,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function na(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Kp.hasOwnProperty(e)?{space:Kp[e],local:t}:t}function ow(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===ul&&e.documentElement.namespaceURI===ul?e.createElement(t):e.createElementNS(n,t)}}function aw(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Qp(t){var e=na(t);return(e.local?aw:ow)(e)}function sw(){}function ll(t){return t==null?sw:function(){return this.querySelector(t)}}function uw(t){typeof t!="function"&&(t=ll(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=new Array(a),u,l,c=0;c<a;++c)(u=o[c])&&(l=t.call(u,u.__data__,c,o))&&("__data__"in u&&(l.__data__=u.__data__),s[c]=l);return new we(r,this._parents)}function lw(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function cw(){return[]}function Jp(t){return t==null?cw:function(){return this.querySelectorAll(t)}}function fw(t){return function(){return lw(t.apply(this,arguments))}}function hw(t){typeof t=="function"?t=fw(t):t=Jp(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a=e[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new we(r,i)}function td(t){return function(){return this.matches(t)}}function ed(t){return function(e){return e.matches(t)}}var pw=Array.prototype.find;function dw(t){return function(){return pw.call(this.children,t)}}function gw(){return this.firstElementChild}function mw(t){return this.select(t==null?gw:dw(typeof t=="function"?t:ed(t)))}var yw=Array.prototype.filter;function bw(){return Array.from(this.children)}function xw(t){return function(){return yw.call(this.children,t)}}function vw(t){return this.selectAll(t==null?bw:xw(typeof t=="function"?t:ed(t)))}function _w(t){typeof t!="function"&&(t=td(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new we(r,this._parents)}function nd(t){return new Array(t.length)}function ww(){return new we(this._enter||this._groups.map(nd),this._parents)}function ra(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}ra.prototype={constructor:ra,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function $w(t){return function(){return t}}function Sw(t,e,n,r,i,o){for(var a=0,s,u=e.length,l=o.length;a<l;++a)(s=e[a])?(s.__data__=o[a],r[a]=s):n[a]=new ra(t,o[a]);for(;a<u;++a)(s=e[a])&&(i[a]=s)}function Aw(t,e,n,r,i,o,a){var s,u,l=new Map,c=e.length,f=o.length,h=new Array(c),p;for(s=0;s<c;++s)(u=e[s])&&(h[s]=p=a.call(u,u.__data__,s,e)+"",l.has(p)?i[s]=u:l.set(p,u));for(s=0;s<f;++s)p=a.call(t,o[s],s,o)+"",(u=l.get(p))?(r[s]=u,u.__data__=o[s],l.delete(p)):n[s]=new ra(t,o[s]);for(s=0;s<c;++s)(u=e[s])&&l.get(h[s])===u&&(i[s]=u)}function Tw(t){return t.__data__}function Pw(t,e){if(!arguments.length)return Array.from(this,Tw);var n=e?Aw:Sw,r=this._parents,i=this._groups;typeof t!="function"&&(t=$w(t));for(var o=i.length,a=new Array(o),s=new Array(o),u=new Array(o),l=0;l<o;++l){var c=r[l],f=i[l],h=f.length,p=Mw(t.call(c,c&&c.__data__,l,r)),d=p.length,g=s[l]=new Array(d),m=a[l]=new Array(d),y=u[l]=new Array(h);n(c,f,g,m,y,p,e);for(var b=0,v=0,x,S;b<d;++b)if(x=g[b]){for(b>=v&&(v=b+1);!(S=m[v])&&++v<d;);x._next=S||null}}return a=new we(a,r),a._enter=s,a._exit=u,a}function Mw(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Dw(){return new we(this._exit||this._groups.map(nd),this._parents)}function Cw(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function Lw(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),u=0;u<a;++u)for(var l=n[u],c=r[u],f=l.length,h=s[u]=new Array(f),p,d=0;d<f;++d)(p=l[d]||c[d])&&(h[d]=p);for(;u<i;++u)s[u]=n[u];return new we(s,this._parents)}function kw(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function Rw(t){t||(t=Ew);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,u=i[o]=new Array(s),l,c=0;c<s;++c)(l=a[c])&&(u[c]=l);u.sort(e)}return new we(i,this._parents).order()}function Ew(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Iw(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Nw(){return Array.from(this)}function Bw(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function Fw(){let t=0;for(const e of this)++t;return t}function Ow(){return!this.node()}function Gw(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&t.call(s,s.__data__,o,i);return this}function zw(t){return function(){this.removeAttribute(t)}}function Yw(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Uw(t,e){return function(){this.setAttribute(t,e)}}function Ww(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Hw(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Xw(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function jw(t,e){var n=na(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?Yw:zw:typeof e=="function"?n.local?Xw:Hw:n.local?Ww:Uw)(n,e))}function rd(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Vw(t){return function(){this.style.removeProperty(t)}}function qw(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Zw(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Kw(t,e,n){return arguments.length>1?this.each((e==null?Vw:typeof e=="function"?Zw:qw)(t,e,n??"")):wr(this.node(),t)}function wr(t,e){return t.style.getPropertyValue(e)||rd(t).getComputedStyle(t,null).getPropertyValue(e)}function Qw(t){return function(){delete this[t]}}function Jw(t,e){return function(){this[t]=e}}function t$(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function e$(t,e){return arguments.length>1?this.each((e==null?Qw:typeof e=="function"?t$:Jw)(t,e)):this.node()[t]}function id(t){return t.trim().split(/^|\s+/)}function cl(t){return t.classList||new od(t)}function od(t){this._node=t,this._names=id(t.getAttribute("class")||"")}od.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function ad(t,e){for(var n=cl(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function sd(t,e){for(var n=cl(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function n$(t){return function(){ad(this,t)}}function r$(t){return function(){sd(this,t)}}function i$(t,e){return function(){(e.apply(this,arguments)?ad:sd)(this,t)}}function o$(t,e){var n=id(t+"");if(arguments.length<2){for(var r=cl(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?i$:e?n$:r$)(n,e))}function a$(){this.textContent=""}function s$(t){return function(){this.textContent=t}}function u$(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function l$(t){return arguments.length?this.each(t==null?a$:(typeof t=="function"?u$:s$)(t)):this.node().textContent}function c$(){this.innerHTML=""}function f$(t){return function(){this.innerHTML=t}}function h$(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function p$(t){return arguments.length?this.each(t==null?c$:(typeof t=="function"?h$:f$)(t)):this.node().innerHTML}function d$(){this.nextSibling&&this.parentNode.appendChild(this)}function g$(){return this.each(d$)}function m$(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function y$(){return this.each(m$)}function b$(t){var e=typeof t=="function"?t:Qp(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function x$(){return null}function v$(t,e){var n=typeof t=="function"?t:Qp(t),r=e==null?x$:typeof e=="function"?e:ll(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function _$(){var t=this.parentNode;t&&t.removeChild(this)}function w$(){return this.each(_$)}function $$(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function S$(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function A$(t){return this.select(t?S$:$$)}function T$(t){return arguments.length?this.property("__data__",t):this.node().__data__}function P$(t){return function(e){t.call(this,e,this.__data__)}}function M$(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function D$(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function C$(t,e,n){return function(){var r=this.__on,i,o=P$(e);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function L$(t,e,n){var r=M$(t+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var u=0,l=s.length,c;u<l;++u)for(i=0,c=s[u];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=e?C$:D$,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function ud(t,e,n){var r=rd(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function k$(t,e){return function(){return ud(this,t,e)}}function R$(t,e){return function(){return ud(this,t,e.apply(this,arguments))}}function E$(t,e){return this.each((typeof e=="function"?R$:k$)(t,e))}function*I$(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var N$=[null];function we(t,e){this._groups=t,this._parents=e}function Si(){return new we([[document.documentElement]],N$)}function B$(){return this}we.prototype=Si.prototype={constructor:we,select:uw,selectAll:hw,selectChild:mw,selectChildren:vw,filter:_w,data:Pw,enter:ww,exit:Dw,join:Cw,merge:Lw,selection:B$,order:kw,sort:Rw,call:Iw,nodes:Nw,node:Bw,size:Fw,empty:Ow,each:Gw,attr:jw,style:Kw,property:e$,classed:o$,text:l$,html:p$,raise:g$,lower:y$,append:b$,insert:v$,remove:w$,clone:A$,datum:T$,on:L$,dispatch:E$,[Symbol.iterator]:I$};function fl(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ld(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Ai(){}var Ti=.7,ia=1/Ti,$r="\\s*([+-]?\\d+)\\s*",Pi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ee="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",F$=/^#([0-9a-f]{3,8})$/,O$=new RegExp(`^rgb\\(${$r},${$r},${$r}\\)$`),G$=new RegExp(`^rgb\\(${Ee},${Ee},${Ee}\\)$`),z$=new RegExp(`^rgba\\(${$r},${$r},${$r},${Pi}\\)$`),Y$=new RegExp(`^rgba\\(${Ee},${Ee},${Ee},${Pi}\\)$`),U$=new RegExp(`^hsl\\(${Pi},${Ee},${Ee}\\)$`),W$=new RegExp(`^hsla\\(${Pi},${Ee},${Ee},${Pi}\\)$`),cd={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};fl(Ai,En,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:fd,formatHex:fd,formatHex8:H$,formatHsl:X$,formatRgb:hd,toString:hd});function fd(){return this.rgb().formatHex()}function H$(){return this.rgb().formatHex8()}function X$(){return yd(this).formatHsl()}function hd(){return this.rgb().formatRgb()}function En(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=F$.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?pd(e):n===3?new ne(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?oa(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?oa(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=O$.exec(t))?new ne(e[1],e[2],e[3],1):(e=G$.exec(t))?new ne(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=z$.exec(t))?oa(e[1],e[2],e[3],e[4]):(e=Y$.exec(t))?oa(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=U$.exec(t))?md(e[1],e[2]/100,e[3]/100,1):(e=W$.exec(t))?md(e[1],e[2]/100,e[3]/100,e[4]):cd.hasOwnProperty(t)?pd(cd[t]):t==="transparent"?new ne(NaN,NaN,NaN,0):null}function pd(t){return new ne(t>>16&255,t>>8&255,t&255,1)}function oa(t,e,n,r){return r<=0&&(t=e=n=NaN),new ne(t,e,n,r)}function j$(t){return t instanceof Ai||(t=En(t)),t?(t=t.rgb(),new ne(t.r,t.g,t.b,t.opacity)):new ne}function hl(t,e,n,r){return arguments.length===1?j$(t):new ne(t,e,n,r??1)}function ne(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}fl(ne,hl,ld(Ai,{brighter(t){return t=t==null?ia:Math.pow(ia,t),new ne(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ti:Math.pow(Ti,t),new ne(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ne(In(this.r),In(this.g),In(this.b),aa(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:dd,formatHex:dd,formatHex8:V$,formatRgb:gd,toString:gd}));function dd(){return`#${Nn(this.r)}${Nn(this.g)}${Nn(this.b)}`}function V$(){return`#${Nn(this.r)}${Nn(this.g)}${Nn(this.b)}${Nn((isNaN(this.opacity)?1:this.opacity)*255)}`}function gd(){const t=aa(this.opacity);return`${t===1?"rgb(":"rgba("}${In(this.r)}, ${In(this.g)}, ${In(this.b)}${t===1?")":`, ${t})`}`}function aa(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function In(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Nn(t){return t=In(t),(t<16?"0":"")+t.toString(16)}function md(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new $e(t,e,n,r)}function yd(t){if(t instanceof $e)return new $e(t.h,t.s,t.l,t.opacity);if(t instanceof Ai||(t=En(t)),!t)return new $e;if(t instanceof $e)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(e===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-e)/s+2:a=(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new $e(a,s,u,t.opacity)}function q$(t,e,n,r){return arguments.length===1?yd(t):new $e(t,e,n,r??1)}function $e(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}fl($e,q$,ld(Ai,{brighter(t){return t=t==null?ia:Math.pow(ia,t),new $e(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ti:Math.pow(Ti,t),new $e(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new ne(pl(t>=240?t-240:t+120,i,r),pl(t,i,r),pl(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new $e(bd(this.h),sa(this.s),sa(this.l),aa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=aa(this.opacity);return`${t===1?"hsl(":"hsla("}${bd(this.h)}, ${sa(this.s)*100}%, ${sa(this.l)*100}%${t===1?")":`, ${t})`}`}}));function bd(t){return t=(t||0)%360,t<0?t+360:t}function sa(t){return Math.max(0,Math.min(1,t||0))}function pl(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const dl=t=>()=>t;function Z$(t,e){return function(n){return t+n*e}}function K$(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Q$(t){return(t=+t)==1?xd:function(e,n){return n-e?K$(e,n,t):dl(isNaN(e)?n:e)}}function xd(t,e){var n=e-t;return n?Z$(t,n):dl(isNaN(t)?e:t)}const ua=function t(e){var n=Q$(e);function r(i,o){var a=n((i=hl(i)).r,(o=hl(o)).r),s=n(i.g,o.g),u=n(i.b,o.b),l=xd(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=u(c),i.opacity=l(c),i+""}}return r.gamma=t,r}(1);function J$(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function tS(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function eS(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=yl(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function nS(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Se(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function rS(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=yl(t[i],e[i]):r[i]=e[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var gl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ml=new RegExp(gl.source,"g");function iS(t){return function(){return t}}function oS(t){return function(e){return t(e)+""}}function vd(t,e){var n=gl.lastIndex=ml.lastIndex=0,r,i,o,a=-1,s=[],u=[];for(t=t+"",e=e+"";(r=gl.exec(t))&&(i=ml.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,u.push({i:a,x:Se(r,i)})),n=ml.lastIndex;return n<e.length&&(o=e.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?oS(u[0].x):iS(e):(e=u.length,function(l){for(var c=0,f;c<e;++c)s[(f=u[c]).i]=f.x(l);return s.join("")})}function yl(t,e){var n=typeof e,r;return e==null||n==="boolean"?dl(e):(n==="number"?Se:n==="string"?(r=En(e))?(e=r,ua):vd:e instanceof En?ua:e instanceof Date?nS:tS(e)?J$:Array.isArray(e)?eS:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?rS:Se)(t,e)}function aS(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var _d=180/Math.PI,wd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function $d(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*_d,skewX:Math.atan(u)*_d,scaleX:a,scaleY:s}}var la;function sS(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?wd:$d(e.a,e.b,e.c,e.d,e.e,e.f)}function uS(t){return t==null||(la||(la=document.createElementNS("http://www.w3.org/2000/svg","g")),la.setAttribute("transform",t),!(t=la.transform.baseVal.consolidate()))?wd:(t=t.matrix,$d(t.a,t.b,t.c,t.d,t.e,t.f))}function Sd(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,c,f,h,p,d){if(l!==f||c!==h){var g=p.push("translate(",null,e,null,n);d.push({i:g-4,x:Se(l,f)},{i:g-2,x:Se(c,h)})}else(f||h)&&p.push("translate("+f+e+h+n)}function a(l,c,f,h){l!==c?(l-c>180?c+=360:c-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Se(l,c)})):c&&f.push(i(f)+"rotate("+c+r)}function s(l,c,f,h){l!==c?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Se(l,c)}):c&&f.push(i(f)+"skewX("+c+r)}function u(l,c,f,h,p,d){if(l!==f||c!==h){var g=p.push(i(p)+"scale(",null,",",null,")");d.push({i:g-4,x:Se(l,f)},{i:g-2,x:Se(c,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(l,c){var f=[],h=[];return l=t(l),c=t(c),o(l.translateX,l.translateY,c.translateX,c.translateY,f,h),a(l.rotate,c.rotate,f,h),s(l.skewX,c.skewX,f,h),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,f,h),l=c=null,function(p){for(var d=-1,g=h.length,m;++d<g;)f[(m=h[d]).i]=m.x(p);return f.join("")}}}var lS=Sd(sS,"px, ","px)","deg)"),cS=Sd(uS,", ",")",")"),Sr=0,Mi=0,Di=0,Ad=1e3,ca,Ci,fa=0,Bn=0,ha=0,Li=typeof performance=="object"&&performance.now?performance:Date,Td=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function bl(){return Bn||(Td(fS),Bn=Li.now()+ha)}function fS(){Bn=0}function pa(){this._call=this._time=this._next=null}pa.prototype=Pd.prototype={constructor:pa,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?bl():+n)+(e==null?0:+e),!this._next&&Ci!==this&&(Ci?Ci._next=this:ca=this,Ci=this),this._call=t,this._time=n,xl()},stop:function(){this._call&&(this._call=null,this._time=1/0,xl())}};function Pd(t,e,n){var r=new pa;return r.restart(t,e,n),r}function hS(){bl(),++Sr;for(var t=ca,e;t;)(e=Bn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Sr}function Md(){Bn=(fa=Li.now())+ha,Sr=Mi=0;try{hS()}finally{Sr=0,dS(),Bn=0}}function pS(){var t=Li.now(),e=t-fa;e>Ad&&(ha-=e,fa=t)}function dS(){for(var t,e=ca,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:ca=n);Ci=t,xl(r)}function xl(t){if(!Sr){Mi&&(Mi=clearTimeout(Mi));var e=t-Bn;e>24?(t<1/0&&(Mi=setTimeout(Md,t-Li.now()-ha)),Di&&(Di=clearInterval(Di))):(Di||(fa=Li.now(),Di=setInterval(pS,Ad)),Sr=1,Td(Md))}}function Dd(t,e,n){var r=new pa;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var gS=qp("start","end","cancel","interrupt"),mS=[],Cd=0,Ld=1,vl=2,da=3,kd=4,_l=5,ga=6;function ma(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;yS(t,n,{name:e,index:r,group:i,on:gS,tween:mS,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Cd})}function wl(t,e){var n=Ae(t,e);if(n.state>Cd)throw new Error("too late; already scheduled");return n}function Ie(t,e){var n=Ae(t,e);if(n.state>da)throw new Error("too late; already running");return n}function Ae(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function yS(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Pd(o,0,n.time);function o(l){n.state=Ld,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var c,f,h,p;if(n.state!==Ld)return u();for(c in r)if(p=r[c],p.name===n.name){if(p.state===da)return Dd(a);p.state===kd?(p.state=ga,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete r[c]):+c<e&&(p.state=ga,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete r[c])}if(Dd(function(){n.state===da&&(n.state=kd,n.timer.restart(s,n.delay,n.time),s(l))}),n.state=vl,n.on.call("start",t,t.__data__,n.index,n.group),n.state===vl){for(n.state=da,i=new Array(h=n.tween.length),c=0,f=-1;c<h;++c)(p=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function s(l){for(var c=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(u),n.state=_l,1),f=-1,h=i.length;++f<h;)i[f].call(t,c);n.state===_l&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=ga,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function bS(t,e){var n=t.__transition,r,i,o=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){o=!1;continue}i=r.state>vl&&r.state<_l,r.state=ga,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}o&&delete t.__transition}}function xS(t){return this.each(function(){bS(this,t)})}function vS(t,e){var n,r;return function(){var i=Ie(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function _S(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Ie(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:e,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===e){i[u]=s;break}u===l&&i.push(s)}o.tween=i}}function wS(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Ae(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?vS:_S)(n,t,e))}function $l(t,e,n){var r=t._id;return t.each(function(){var i=Ie(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Ae(i,r).value[e]}}function Rd(t,e){var n;return(typeof e=="number"?Se:e instanceof En?ua:(n=En(e))?(e=n,ua):vd)(t,e)}function $S(t){return function(){this.removeAttribute(t)}}function SS(t){return function(){this.removeAttributeNS(t.space,t.local)}}function AS(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function TS(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function PS(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function MS(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function DS(t,e){var n=na(t),r=n==="transform"?cS:Rd;return this.attrTween(t,typeof e=="function"?(n.local?MS:PS)(n,r,$l(this,"attr."+t,e)):e==null?(n.local?SS:$S)(n):(n.local?TS:AS)(n,r,e))}function CS(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function LS(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function kS(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&LS(t,o)),n}return i._value=e,i}function RS(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&CS(t,o)),n}return i._value=e,i}function ES(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=na(t);return this.tween(n,(r.local?kS:RS)(r,e))}function IS(t,e){return function(){wl(this,t).delay=+e.apply(this,arguments)}}function NS(t,e){return e=+e,function(){wl(this,t).delay=e}}function BS(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?IS:NS)(e,t)):Ae(this.node(),e).delay}function FS(t,e){return function(){Ie(this,t).duration=+e.apply(this,arguments)}}function OS(t,e){return e=+e,function(){Ie(this,t).duration=e}}function GS(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?FS:OS)(e,t)):Ae(this.node(),e).duration}function zS(t,e){if(typeof e!="function")throw new Error;return function(){Ie(this,t).ease=e}}function YS(t){var e=this._id;return arguments.length?this.each(zS(e,t)):Ae(this.node(),e).ease}function US(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Ie(this,t).ease=n}}function WS(t){if(typeof t!="function")throw new Error;return this.each(US(this._id,t))}function HS(t){typeof t!="function"&&(t=td(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new Ve(r,this._parents,this._name,this._id)}function XS(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u=e[s],l=n[s],c=u.length,f=a[s]=new Array(c),h,p=0;p<c;++p)(h=u[p]||l[p])&&(f[p]=h);for(;s<r;++s)a[s]=e[s];return new Ve(a,this._parents,this._name,this._id)}function jS(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function VS(t,e,n){var r,i,o=jS(e)?wl:Ie;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}function qS(t,e){var n=this._id;return arguments.length<2?Ae(this.node(),n).on.on(t):this.each(VS(n,t,e))}function ZS(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function KS(){return this.on("end.remove",ZS(this._id))}function QS(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ll(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],u=s.length,l=o[a]=new Array(u),c,f,h=0;h<u;++h)(c=s[h])&&(f=t.call(c,c.__data__,h,s))&&("__data__"in c&&(f.__data__=c.__data__),l[h]=f,ma(l[h],e,n,h,l,Ae(c,n)));return new Ve(o,this._parents,e,n)}function JS(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Jp(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var u=r[s],l=u.length,c,f=0;f<l;++f)if(c=u[f]){for(var h=t.call(c,c.__data__,f,u),p,d=Ae(c,n),g=0,m=h.length;g<m;++g)(p=h[g])&&ma(p,e,n,g,h,d);o.push(h),a.push(c)}return new Ve(o,a,e,n)}var tA=Si.prototype.constructor;function eA(){return new tA(this._groups,this._parents)}function nA(t,e){var n,r,i;return function(){var o=wr(this,t),a=(this.style.removeProperty(t),wr(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}function Ed(t){return function(){this.style.removeProperty(t)}}function rA(t,e,n){var r,i=n+"",o;return function(){var a=wr(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function iA(t,e,n){var r,i,o;return function(){var a=wr(this,t),s=n(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(t),wr(this,t))),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}function oA(t,e){var n,r,i,o="style."+e,a="end."+o,s;return function(){var u=Ie(this,t),l=u.on,c=u.value[o]==null?s||(s=Ed(e)):void 0;(l!==n||i!==c)&&(r=(n=l).copy()).on(a,i=c),u.on=r}}function aA(t,e,n){var r=(t+="")=="transform"?lS:Rd;return e==null?this.styleTween(t,nA(t,r)).on("end.style."+t,Ed(t)):typeof e=="function"?this.styleTween(t,iA(t,r,$l(this,"style."+t,e))).each(oA(this._id,t)):this.styleTween(t,rA(t,r,e),n).on("end.style."+t,null)}function sA(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function uA(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&sA(t,a,n)),r}return o._value=e,o}function lA(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,uA(t,e,n??""))}function cA(t){return function(){this.textContent=t}}function fA(t){return function(){var e=t(this);this.textContent=e??""}}function hA(t){return this.tween("text",typeof t=="function"?fA($l(this,"text",t)):cA(t==null?"":t+""))}function pA(t){return function(e){this.textContent=t.call(this,e)}}function dA(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&pA(i)),e}return r._value=t,r}function gA(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,dA(t))}function mA(){for(var t=this._name,e=this._id,n=Id(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)if(u=a[l]){var c=Ae(u,e);ma(u,t,n,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Ve(r,this._parents,t,n)}function yA(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},u={value:function(){--i===0&&o()}};n.each(function(){var l=Ie(this,r),c=l.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),l.on=e}),i===0&&o()})}var bA=0;function Ve(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Id(){return++bA}var qe=Si.prototype;Ve.prototype={constructor:Ve,select:QS,selectAll:JS,selectChild:qe.selectChild,selectChildren:qe.selectChildren,filter:HS,merge:XS,selection:eA,transition:mA,call:qe.call,nodes:qe.nodes,node:qe.node,size:qe.size,empty:qe.empty,each:qe.each,on:qS,attr:DS,attrTween:ES,style:aA,styleTween:lA,text:hA,textTween:gA,remove:KS,tween:wS,delay:BS,duration:GS,ease:YS,easeVarying:WS,end:yA,[Symbol.iterator]:qe[Symbol.iterator]};function xA(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var vA={time:null,delay:0,duration:250,ease:xA};function _A(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function wA(t){var e,n;t instanceof Ve?(e=t._id,t=t._name):(e=Id(),(n=vA).time=bl(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&ma(u,t,e,l,a,n||_A(u,e));return new Ve(r,this._parents,t,e)}Si.prototype.interrupt=xS,Si.prototype.transition=wA;function $A(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ya(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Ar(t){return t=ya(Math.abs(t)),t?t[1]:NaN}function SA(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(n.substring(i-=s,i+s)),!((u+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function AA(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var TA=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ba(t){if(!(e=TA.exec(t)))throw new Error("invalid format: "+t);var e;return new Sl({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}ba.prototype=Sl.prototype;function Sl(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Sl.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 PA(t){t:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Nd;function MA(t,e){var n=ya(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Nd=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ya(t,Math.max(0,e+o-1))[0]}function Bd(t,e){var n=ya(t,e);if(!n)return t+"";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 Fd={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:$A,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Bd(t*100,e),r:Bd,s:MA,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Od(t){return t}var Gd=Array.prototype.map,zd=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function DA(t){var e=t.grouping===void 0||t.thousands===void 0?Od:SA(Gd.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?Od:AA(Gd.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function l(f){f=ba(f);var h=f.fill,p=f.align,d=f.sign,g=f.symbol,m=f.zero,y=f.width,b=f.comma,v=f.precision,x=f.trim,S=f.type;S==="n"?(b=!0,S="g"):Fd[S]||(v===void 0&&(v=12),x=!0,S="g"),(m||h==="0"&&p==="=")&&(m=!0,h="0",p="=");var $=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",R=g==="$"?r:/[%p]/.test(S)?a:"",T=Fd[S],w=/[defgprs%]/.test(S);v=v===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function P(_){var N=$,D=R,A,L,M;if(S==="c")D=T(_)+D,_="";else{_=+_;var G=_<0||1/_<0;if(_=isNaN(_)?u:T(Math.abs(_),v),x&&(_=PA(_)),G&&+_==0&&d!=="+"&&(G=!1),N=(G?d==="("?d:s:d==="-"||d==="("?"":d)+N,D=(S==="s"?zd[8+Nd/3]:"")+D+(G&&d==="("?")":""),w){for(A=-1,L=_.length;++A<L;)if(M=_.charCodeAt(A),48>M||M>57){D=(M===46?i+_.slice(A+1):_.slice(A))+D,_=_.slice(0,A);break}}}b&&!m&&(_=e(_,1/0));var O=N.length+_.length+D.length,E=O<y?new Array(y-O+1).join(h):"";switch(b&&m&&(_=e(E+_,E.length?y-D.length:1/0),E=""),p){case"<":_=N+_+D+E;break;case"=":_=N+E+_+D;break;case"^":_=E.slice(0,O=E.length>>1)+N+_+D+E.slice(O);break;default:_=E+N+_+D;break}return o(_)}return P.toString=function(){return f+""},P}function c(f,h){var p=l((f=ba(f),f.type="f",f)),d=Math.max(-8,Math.min(8,Math.floor(Ar(h)/3)))*3,g=Math.pow(10,-d),m=zd[8+d/3];return function(y){return p(g*y)+m}}return{format:l,formatPrefix:c}}var xa,Yd,Ud;CA({thousands:",",grouping:[3],currency:["$",""]});function CA(t){return xa=DA(t),Yd=xa.format,Ud=xa.formatPrefix,xa}function LA(t){return Math.max(0,-Ar(Math.abs(t)))}function kA(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ar(e)/3)))*3-Ar(Math.abs(t)))}function RA(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ar(e)-Ar(t))+1}function Wd(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function EA(t){return function(){return t}}function IA(t){return+t}var Hd=[0,1];function Tr(t){return t}function Al(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:EA(isNaN(e)?NaN:.5)}function NA(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function BA(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=Al(i,r),o=n(a,o)):(r=Al(r,i),o=n(o,a)),function(s){return o(r(s))}}function FA(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=Al(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(s){var u=Vp(t,s,1,r)-1;return o[u](i[u](s))}}function OA(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function GA(){var t=Hd,e=Hd,n=yl,r,i,o,a=Tr,s,u,l;function c(){var h=Math.min(t.length,e.length);return a!==Tr&&(a=NA(t[0],t[h-1])),s=h>2?FA:BA,u=l=null,f}function f(h){return h==null||isNaN(h=+h)?o:(u||(u=s(t.map(r),e,n)))(r(a(h)))}return f.invert=function(h){return a(i((l||(l=s(e,t.map(r),Se)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,IA),c()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),c()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=aS,c()},f.clamp=function(h){return arguments.length?(a=h?!0:Tr,c()):a!==Tr},f.interpolate=function(h){return arguments.length?(n=h,c()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,p){return r=h,i=p,c()}}function zA(){return GA()(Tr,Tr)}function YA(t,e,n,r){var i=ew(t,e,n),o;switch(r=ba(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=kA(i,a))&&(r.precision=o),Ud(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=RA(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=LA(i))&&(r.precision=o-(r.type==="%")*2);break}}return Yd(r)}function Xd(t){var e=t.domain;return t.ticks=function(n){var r=e();return tw(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return YA(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],s=r[o],u,l,c=10;for(s<a&&(l=a,a=s,s=l,l=i,i=o,o=l);c-- >0;){if(l=sl(a,s,n),l===u)return r[i]=a,r[o]=s,e(r);if(l>0)a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l;else if(l<0)a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l;else break;u=l}return t},t}function jd(){var t=zA();return t.copy=function(){return OA(t,jd())},Wd.apply(t,arguments),Xd(t)}function Vd(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function a(u){return u!=null&&u<=u?i[Vp(r,u,0,n)]:o}function s(){var u=-1;for(r=new Array(n);++u<n;)r[u]=((u+1)*e-(u-n)*t)/(n+1);return a}return a.domain=function(u){return arguments.length?([t,e]=u,t=+t,e=+e,s()):[t,e]},a.range=function(u){return arguments.length?(n=(i=Array.from(u)).length-1,s()):i.slice()},a.invertExtent=function(u){var l=i.indexOf(u);return l<0?[NaN,NaN]:l<1?[t,r[0]]:l>=n?[r[n-1],e]:[r[l-1],r[l]]},a.unknown=function(u){return arguments.length&&(o=u),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Vd().domain([t,e]).range(i).unknown(o)},Wd.apply(Xd(a),arguments)}function ki(t,e,n){this.k=t,this.x=e,this.y=n}ki.prototype={constructor:ki,scale:function(t){return t===1?this:new ki(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new ki(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},ki.prototype;function UA(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function qd(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:o}=e.rowAmount*e.columnAmount>=n?e:UA(n);return new Array(n).fill(null).map((a,s)=>{const u=s%o,l=Math.floor(s/o),c=(t.width-r*(o-1))/o,f=(t.height-r*(i-1))/i,h=u*c+u*r,p=l*f+l*r,d=[h,p],g=[c/t.width,f/t.height];return{slotIndex:s,rowIndex:l,columnIndex:u,translate:d,scale:g}})}var Tl=function(t,e){return Tl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Tl(t,e)};function Ne(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Tl(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function WA(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(t,[])).next())})}function Zd(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Pr(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Mr(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function Dr(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function Cr(t){return this instanceof Cr?(this.v=t,this):new Cr(t)}function HA(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(p){return function(d){return Promise.resolve(d).then(p,f)}}function s(p,d){r[p]&&(i[p]=function(g){return new Promise(function(m,y){o.push([p,g,m,y])>1||u(p,g)})},d&&(i[p]=d(i[p])))}function u(p,d){try{l(r[p](d))}catch(g){h(o[0][3],g)}}function l(p){p.value instanceof Cr?Promise.resolve(p.value.v).then(c,f):h(o[0][2],p)}function c(p){u("next",p)}function f(p){u("throw",p)}function h(p,d){p(d),o.shift(),o.length&&u(o[0][0],o[0][1])}}function XA(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof Pr=="function"?Pr(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(a){return new Promise(function(s,u){a=t[o](a),i(s,u,a.done,a.value)})}}function i(o,a,s,u){Promise.resolve(u).then(function(l){o({value:l,done:s})},a)}}function Dt(t){return typeof t=="function"}function Pl(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Ml=Pl(function(t){return function(e){t(this),this.message=e?e.length+` errors occurred during unsubscription:
|
4
4
|
`+e.map(function(n,r){return r+1+") "+n.toString()}).join(`
|
5
5
|
`):"",this.name="UnsubscriptionError",this.errors=e}});function va(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Ri=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=Pr(a),u=s.next();!u.done;u=s.next()){var l=u.value;l.remove(this)}}catch(g){e={error:g}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(Dt(c))try{c()}catch(g){o=g instanceof Ml?g.errors:[g]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=Pr(f),p=h.next();!p.done;p=h.next()){var d=p.value;try{Jd(d)}catch(g){o=o??[],g instanceof Ml?o=Dr(Dr([],Mr(o)),Mr(g.errors)):o.push(g)}}}catch(g){r={error:g}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(o)throw new Ml(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Jd(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&va(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&va(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),Kd=Ri.EMPTY;function Qd(t){return t instanceof Ri||t&&"closed"in t&&Dt(t.remove)&&Dt(t.add)&&Dt(t.unsubscribe)}function Jd(t){Dt(t)?t():t.unsubscribe()}var tg={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},jA={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,Dr([t,e],Mr(n)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function eg(t){jA.setTimeout(function(){throw t})}function Dl(){}function _a(t){t()}var Cl=function(t){Ne(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Qd(n)&&n.add(r)):r.destination=KA,r}return e.create=function(n,r,i){return new Ei(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Ri),VA=Function.prototype.bind;function Ll(t,e){return VA.call(t,e)}var qA=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){wa(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){wa(r)}else wa(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){wa(n)}},t}(),Ei=function(t){Ne(e,t);function e(n,r,i){var o=t.call(this)||this,a;if(Dt(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;o&&tg.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&Ll(n.next,s),error:n.error&&Ll(n.error,s),complete:n.complete&&Ll(n.complete,s)}):a=n}return o.destination=new qA(a),o}return e}(Cl);function wa(t){eg(t)}function ZA(t){throw t}var KA={closed:!0,next:Dl,error:ZA,complete:Dl},kl=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function $a(t){return t}function QA(t){return t.length===0?$a:t.length===1?t[0]:function(e){return t.reduce(function(n,r){return r(n)},e)}}var re=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,o=tT(e)?e:new Ei(e,n,r);return _a(function(){var a=i,s=a.operator,u=a.source;o.add(s?s.call(o,u):u?i._subscribe(o):i._trySubscribe(o))}),o},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=ng(n),new n(function(i,o){var a=new Ei({next:function(s){try{e(s)}catch(u){o(u),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[kl]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return QA(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=ng(e),new e(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},t.create=function(e){return new t(e)},t}();function ng(t){var e;return(e=t??tg.Promise)!==null&&e!==void 0?e:Promise}function JA(t){return t&&Dt(t.next)&&Dt(t.error)&&Dt(t.complete)}function tT(t){return t&&t instanceof Cl||JA(t)&&Qd(t)}function eT(t){return Dt(t==null?void 0:t.lift)}function hn(t){return function(e){if(eT(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function pn(t,e,n,r,i){return new nT(t,e,n,r,i)}var nT=function(t){Ne(e,t);function e(n,r,i,o,a,s){var u=t.call(this,n)||this;return u.onFinalize=a,u.shouldUnsubscribe=s,u._next=r?function(l){try{r(l)}catch(c){n.error(c)}}:t.prototype._next,u._error=o?function(l){try{o(l)}catch(c){n.error(c)}finally{this.unsubscribe()}}:t.prototype._error,u._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,u}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(Cl),rT=Pl(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Lr=function(t){Ne(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new rg(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new rT},e.prototype.next=function(n){var r=this;_a(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=Pr(r.currentObservers),s=a.next();!s.done;s=a.next()){var u=s.value;u.next(n)}}catch(l){i={error:l}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;_a(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;_a(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?Kd:(this.currentObservers=null,s.push(n),new Ri(function(){r.currentObservers=null,va(s,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},e.prototype.asObservable=function(){var n=new re;return n.source=this,n},e.create=function(n,r){return new rg(n,r)},e}(re),rg=function(t){Ne(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:Kd},e}(Lr),ig=function(t){Ne(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,o=n._value;if(r)throw i;return this._throwIfClosed(),o},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(Lr),Rl={now:function(){return(Rl.delegate||Date).now()},delegate:void 0},iT=function(t){Ne(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=Rl);var o=t.call(this)||this;return o._bufferSize=n,o._windowTime=r,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,n),o._windowTime=Math.max(1,r),o}return e.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,s=r._timestampProvider,u=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+u)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,o=i._infiniteTimeWindow,a=i._buffer,s=a.slice(),u=0;u<s.length&&!n.closed;u+=o?1:2)n.next(s[u]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,o=n._buffer,a=n._infiniteTimeWindow,s=(a?1:2)*r;if(r<1/0&&s<o.length&&o.splice(0,o.length-s),!a){for(var u=i.now(),l=0,c=1;c<o.length&&o[c]<=u;c+=2)l=c;l&&o.splice(0,l+1)}},e}(Lr),oT=function(t){Ne(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Ri),og={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,Dr([t,e],Mr(n)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},aT=function(t){Ne(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var o=this.id,a=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(a,o,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),og.setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&og.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,o;try{this.work(n)}catch(a){i=!0,o=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,va(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(oT),ag=function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=Rl.now,t}(),sT=function(t){Ne(e,t);function e(n,r){r===void 0&&(r=ag.now);var i=t.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e}(ag);new sT(aT);var uT=new re(function(t){return t.complete()});function lT(t){return t&&Dt(t.schedule)}function sg(t){return t[t.length-1]}function cT(t){return Dt(sg(t))?t.pop():void 0}function fT(t){return lT(sg(t))?t.pop():void 0}var ug=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function lg(t){return Dt(t==null?void 0:t.then)}function cg(t){return Dt(t[kl])}function fg(t){return Symbol.asyncIterator&&Dt(t==null?void 0:t[Symbol.asyncIterator])}function hg(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function hT(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var pg=hT();function dg(t){return Dt(t==null?void 0:t[pg])}function gg(t){return HA(this,arguments,function(){var e,n,r,i;return Zd(this,function(o){switch(o.label){case 0:e=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Cr(e.read())];case 3:return n=o.sent(),r=n.value,i=n.done,i?[4,Cr(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Cr(r)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function mg(t){return Dt(t==null?void 0:t.getReader)}function dn(t){if(t instanceof re)return t;if(t!=null){if(cg(t))return pT(t);if(ug(t))return dT(t);if(lg(t))return gT(t);if(fg(t))return yg(t);if(dg(t))return mT(t);if(mg(t))return yT(t)}throw hg(t)}function pT(t){return new re(function(e){var n=t[kl]();if(Dt(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function dT(t){return new re(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function gT(t){return new re(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,eg)})}function mT(t){return new re(function(e){var n,r;try{for(var i=Pr(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function yg(t){return new re(function(e){bT(t,e).catch(function(n){return e.error(n)})})}function yT(t){return yg(gg(t))}function bT(t,e){var n,r,i,o;return WA(this,void 0,void 0,function(){var a,s;return Zd(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=XA(t),u.label=1;case 1:return[4,n.next()];case 2:if(r=u.sent(),!!r.done)return[3,4];if(a=r.value,e.next(a),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=u.sent(),i={error:s},[3,11];case 6:return u.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function gn(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(o),!i)return o}function bg(t,e){return e===void 0&&(e=0),hn(function(n,r){n.subscribe(pn(r,function(i){return gn(r,t,function(){return r.next(i)},e)},function(){return gn(r,t,function(){return r.complete()},e)},function(i){return gn(r,t,function(){return r.error(i)},e)}))})}function xg(t,e){return e===void 0&&(e=0),hn(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function xT(t,e){return dn(t).pipe(xg(e),bg(e))}function vT(t,e){return dn(t).pipe(xg(e),bg(e))}function _T(t,e){return new re(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function wT(t,e){return new re(function(n){var r;return gn(n,e,function(){r=t[pg](),gn(n,e,function(){var i,o,a;try{i=r.next(),o=i.value,a=i.done}catch(s){n.error(s);return}a?n.complete():n.next(o)},0,!0)}),function(){return Dt(r==null?void 0:r.return)&&r.return()}})}function vg(t,e){if(!t)throw new Error("Iterable cannot be null");return new re(function(n){gn(n,e,function(){var r=t[Symbol.asyncIterator]();gn(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function $T(t,e){return vg(gg(t),e)}function ST(t,e){if(t!=null){if(cg(t))return xT(t,e);if(ug(t))return _T(t,e);if(lg(t))return vT(t,e);if(fg(t))return vg(t,e);if(dg(t))return wT(t,e);if(mg(t))return $T(t,e)}throw hg(t)}function _g(t,e){return e?ST(t,e):dn(t)}Pl(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function kr(t,e){return hn(function(n,r){var i=0;n.subscribe(pn(r,function(o){r.next(t.call(e,o,i++))}))})}var AT=Array.isArray;function TT(t,e){return AT(e)?t.apply(void 0,Dr([],Mr(e))):t(e)}function PT(t){return kr(function(e){return TT(t,e)})}var MT=Array.isArray,DT=Object.getPrototypeOf,CT=Object.prototype,LT=Object.keys;function kT(t){if(t.length===1){var e=t[0];if(MT(e))return{args:e,keys:null};if(RT(e)){var n=LT(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function RT(t){return t&&typeof t=="object"&&DT(t)===CT}function ET(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function wg(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=fT(t),r=cT(t),i=kT(t),o=i.args,a=i.keys;if(o.length===0)return _g([],n);var s=new re(IT(o,n,a?function(u){return ET(a,u)}:$a));return r?s.pipe(PT(r)):s}function IT(t,e,n){return n===void 0&&(n=$a),function(r){$g(e,function(){for(var i=t.length,o=new Array(i),a=i,s=i,u=function(c){$g(e,function(){var f=_g(t[c],e),h=!1;f.subscribe(pn(r,function(p){o[c]=p,h||(h=!0,s--),s||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},l=0;l<i;l++)u(l)},r)}}function $g(t,e,n){t?gn(n,t,e):e()}function Sg(t){return hn(function(e,n){var r=null,i=!1,o;r=e.subscribe(pn(n,void 0,void 0,function(a){o=dn(t(a,Sg(t)(e))),r?(r.unsubscribe(),r=null,o.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(n))})}function NT(t,e){return e===void 0&&(e=$a),t=t??BT,hn(function(n,r){var i,o=!0;n.subscribe(pn(r,function(a){var s=e(a);(o||!t(i,s))&&(o=!1,i=s,r.next(a))}))})}function BT(t,e){return t===e}function FT(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new Lr}:e,r=t.resetOnError,i=r===void 0?!0:r,o=t.resetOnComplete,a=o===void 0?!0:o,s=t.resetOnRefCountZero,u=s===void 0?!0:s;return function(l){var c,f,h,p=0,d=!1,g=!1,m=function(){f==null||f.unsubscribe(),f=void 0},y=function(){m(),c=h=void 0,d=g=!1},b=function(){var v=c;y(),v==null||v.unsubscribe()};return hn(function(v,x){p++,!g&&!d&&m();var S=h=h??n();x.add(function(){p--,p===0&&!g&&!d&&(f=El(b,u))}),S.subscribe(x),!c&&p>0&&(c=new Ei({next:function($){return S.next($)},error:function($){g=!0,m(),f=El(y,i,$),S.error($)},complete:function(){d=!0,m(),f=El(y,a),S.complete()}}),dn(v).subscribe(c))})(l)}}function El(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new Ei({next:function(){i.unsubscribe(),t()}});return dn(e.apply(void 0,Dr([],Mr(n)))).subscribe(i)}}function OT(t,e,n){var r,i=!1;return r=t,FT({connector:function(){return new iT(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function Il(t,e){return hn(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(pn(r,function(u){i==null||i.unsubscribe();var l=0,c=o++;dn(t(u,c)).subscribe(i=pn(r,function(f){return r.next(e?e(u,f,c,l++):f)},function(){i=null,s()}))},function(){a=!0,s()}))})}function Ag(t){return hn(function(e,n){dn(t).subscribe(pn(n,function(){return n.complete()},Dl)),!n.closed&&e.subscribe(n)})}const GT=t=>t.pipe(kr(e=>e.styles.textSize),NT(),kr(e=>{let n=NaN;if(typeof e=="string")if(e.includes("rem")){const r=parseFloat(getComputedStyle(document.documentElement).fontSize);n=parseFloat(e)*r}else e.includes("px")&&(n=parseFloat(e));else if(typeof e=="number")return e;return n||14})),Tg=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=vr.scaleDomain,scaleRange:i=vr.scaleRange})=>{const o=r[0]??vr.scaleDomain[0],a=r[1]??vr.scaleDomain[1],s=i[0]??vr.scaleRange[0],u=i[1]??vr.scaleRange[1];let l=o==="auto"?e<0?e:0:o==="min"?e:o,c=a==="auto"?t>=0?t:0:a==="max"?t:a;const f=t-(t-l)/(1-s),h=c/u;return jd().domain([f,h]).range([0,n])},Pg=({axisLabels:t,axisWidth:e,padding:n=0,reverse:r=!1})=>{let i=t.map((u,l)=>l);r&&i.reverse();const o=i.length-1+n*2,a=e/o,s=a*n-a*.5;return Vd().domain([s,e-s]).range(i)},Mg=({fullDataFormatter$:t,layout$:e})=>{const n=new Lr;function r({xAxis:i,yAxis:o,width:a,height:s}){if(!i||!o)return{translate:[0,0],scale:[1,1],rotate:0,rotateX:0,rotateY:0,value:""};let u=0,l=0,c=0,f=0,h=0;return i.position==="bottom"?o.position==="left"?(f=180,l=s):o.position==="right"?(f=180,h=180,u=a,l=s):(f=180,l=s):i.position==="top"?o.position==="left"||(o.position==="right"?(h=180,u=a):(f=180,l=s)):i.position==="left"?o.position==="bottom"?(c=-90,l=s):o.position==="top"?(c=-90,h=180):(f=180,l=s):i.position==="right"?o.position==="bottom"?(c=-90,f=180,l=s,u=a):o.position==="top"?(c=-90,f=180,h=180,u=a):(f=180,l=s):(f=180,l=s),{translate:[u,l],scale:[1,1],rotate:c,rotateX:f,rotateY:h,value:`translate(${u}px, ${l}px) rotate(${c}deg) rotateX(${f}deg) rotateY(${h}deg)`}}return new re(i=>(wg({fullDataFormatter:t,layout:e}).pipe(Ag(n),Il(async o=>o)).subscribe(o=>{const a=r({xAxis:o.fullDataFormatter.grid.groupAxis,yAxis:o.fullDataFormatter.grid.valueAxis,width:o.layout.width,height:o.layout.height});i.next(a)}),function(){n.next(void 0)}))},Dg=({gridAxesTransform$:t})=>t.pipe(kr(e=>{const n=[0,0],r=[1/e.scale[0],1/e.scale[1]],i=e.rotate*-1,o=e.rotateX*-1,a=e.rotateY*-1;return{translate:n,scale:r,rotate:i,rotateX:o,rotateY:a,value:`translate(${n[0]}px, ${n[1]}px) rotateX(${o}deg) rotateY(${a}deg) rotate(${i}deg)`}})),Cg=({computedData$:t,fullDataFormatter$:e,layout$:n})=>wg({computedData:t,fullDataFormatter:e,layout:n}).pipe(Il(async r=>r),kr(r=>{if(r.fullDataFormatter.grid.separateSeries)return qd(r.layout,r.fullDataFormatter.container,r.computedData.length);{const i=qd(r.layout,r.fullDataFormatter.container,1);return r.computedData.map((o,a)=>i[0])}}));function zT(t){return`[OrbCharts warn]: ${t.message}`}function YT({columnName:t,expectToBe:e,from:n}){return`Invalid value: '${t}' must be '${e}'
|
6
6
|
|
@@ -56,10 +56,10 @@
|
|
56
56
|
return [label, value]
|
57
57
|
}
|
58
58
|
return []
|
59
|
-
}`;const np="Tooltip",A2=ot(np,"g"),RI=ot(np,"box");function
|
59
|
+
}`;const np="Tooltip",A2=ot(np,"g"),RI=ot(np,"box"),EI={name:np,defaultParams:ep,layerIndex:gE,validator:(t,{validateColumns:e})=>e(t,{backgroundColorType:{toBeOption:"ColorType"},backgroundOpacity:{toBeTypes:["number"]},strokeColorType:{toBeOption:"ColorType"},offset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},padding:{toBeTypes:["number"]},textColorType:{toBeOption:"ColorType"},textRenderFn:{toBeTypes:["Function","null"]},svgRenderFn:{toBeTypes:["Function","null"]}})};function II(t,e){const n=e.textSizePx*1.5,i=(t==null?[]:Array.isArray(t)?t:typeof t=="string"?t.split(`
|
60
60
|
`):[t]).filter(o=>o!="").map((o,a)=>`<tspan x="0" y="${a*n}">${o}</tspan>`).join("");return i?`<text font-size="${e.textSize}" fill="${e.textColor}" x="0" y="0" style="dominant-baseline:text-before-edge">
|
61
61
|
${i}
|
62
|
-
</text>`:""}function
|
62
|
+
</text>`:""}function NI({rootSelection:t,pluginName:e,rootWidth:n,rootHeight:r,svgString:i,tooltipStyle:o,event:a}){t.interrupt("fadeout");const s=5,u=i?[i]:[],l=i?[o]:[],f=t.selectAll(`g.${A2}`).data(u).join(x=>x.append("g").classed(A2,!0).attr("pointer-events","none"),x=>x,x=>x.style("opacity",0).remove()).attr("transform",()=>`translate(${a.offsetX}, ${a.offsetY})`).selectAll(`g.${RI}`).data(l).join(x=>x.append("g").classed(ot(e,"box"),!0)),h=f.selectAll("rect").data(l).join(x=>x.append("rect").attr("rx",s).attr("ry",s)).attr("fill",x=>x.backgroundColor).attr("stroke",x=>x.strokeColor).attr("opacity",x=>x.backgroundOpacity),p=f.selectAll("g").data(u).join(x=>x.append("g").classed(ot(e,"content"),!0).attr("transform",()=>`translate(${o.padding}, ${o.padding})`));u.length&&iE(p,u[0]);const d=p!=null&&p.node()?Dv(p):{width:0,height:0};h.attr("width",d.width+o.padding*2).attr("height",d.height+o.padding*2);const g=f!=null&&f.node()?Dv(f):{width:0,height:0},m=n-g.width,y=r-g.height,b=a.offsetX+o.offset[0]>m?m-a.offsetX:o.offset[0],v=a.offsetY+o.offset[1]>y?y-a.offsetY:o.offset[1];f.attr("transform",x=>`translate(${b}, ${v})`),f.attr("transform",x=>`translate(${b}, ${v})`)}const BI=HT(EI)(({selection:t,rootSelection:e,name:n,chartType:r,observer:i,subject:o})=>{const a=new nt,s=o.event$.pipe(I(a),$i(g=>g.eventName==="mouseover"||g.eventName==="mousemove")),u=o.event$.pipe(I(a),$i(g=>g.eventName==="mouseout")),l=GT(i.fullChartParams$),c=U({fullChartParams:i.fullChartParams$,fullParams:i.fullParams$,textSizePx:l}).pipe(I(a),W(async g=>g),B(g=>({backgroundColor:kt(g.fullParams.backgroundColorType,g.fullChartParams),backgroundOpacity:g.fullParams.backgroundOpacity,strokeColor:kt(g.fullParams.strokeColorType,g.fullChartParams),offset:g.fullParams.offset,padding:g.fullParams.padding,textSize:g.fullChartParams.styles.textSize,textSizePx:g.textSizePx,textColor:kt(g.fullParams.textColorType,g.fullChartParams)}))),f=U({fullParams:i.fullParams$,tooltipStyle:c}).pipe(I(a),W(async g=>g),B(g=>g.fullParams.svgRenderFn?g.fullParams.svgRenderFn:m=>{const y=g.fullParams.textRenderFn?g.fullParams.textRenderFn(m):null;return II(y,g.tooltipStyle)})),h=U({event:s,contentRenderFn:f}).pipe(I(a),W(async g=>g),B(g=>g.contentRenderFn(g.event))),p=u.pipe(I(a),B(g=>"")),d=il(s,u).pipe(I(a),B(g=>g.event));return U({svgString:il(h,p),event:d,layout:i.layout$,tooltipStyle:c}).pipe(I(a),W(async g=>g)).subscribe(g=>{NI({rootSelection:e,pluginName:n,rootWidth:g.layout.rootWidth,rootHeight:g.layout.rootHeight,svgString:g.svgString,tooltipStyle:g.tooltipStyle,event:g.event})}),function(){a.next(void 0)}}),T2={force:{strength:.08,velocityDecay:.3,collisionSpacing:2},bubbleText:{fillRate:.6,lineHeight:12,lineLengthMin:4},arcScaleType:"area"},P2={outerRadius:.85,innerRadius:0,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,padAngle:0,strokeColorType:"background",strokeWidth:1,cornerRadius:0},rp={eventFn:(t,e,n)=>e==="mouseover"||e==="mousemove"?[String(t.datum.value)]:[String(Math.round(t.data.reduce((r,i)=>r+i.reduce((o,a)=>o+(a.value??0),0),0)*n))],textAttrs:[{transform:"translate(0, 0)"}],textStyles:[{"font-weight":"bold","text-anchor":"middle","pointer-events":"none","dominant-baseline":"middle","font-size":64,fill:"#000"}]};rp.eventFn.toString=()=>`(eventData: EventSeries, eventName: EventName, t: number) => {
|
63
63
|
if (eventName === 'mouseover' || eventName === 'mousemove') {
|
64
64
|
return [String(eventData.datum!.value)]
|
65
65
|
}
|
@@ -74,6 +74,6 @@
|
|
74
74
|
)
|
75
75
|
)
|
76
76
|
]
|
77
|
-
}`;const ip={outerRadius:.85,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,labelCentroid:2.1,labelColorType:"primary",labelFn:t=>String(t.label)};ip.labelFn.toString=()=>"d => String(d.label)";const M2={outerRadius:.85,padAngle:0,strokeColorType:"background",strokeWidth:0,cornerRadius:0,arcScaleType:"area",angleIncreaseWhileHighlight:.05},op={outerRadius:.85,labelCentroid:2.1,labelFn:t=>String(t.label),labelColorType:"primary",arcScaleType:"area"};op.labelFn.toString=()=>"d => String(d.label)";const D2={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},BI={name:"Bubbles",defaultParams:T2,layerIndex:ke,validator:(t,{validateColumns:e})=>{const n=e(t,{force:{toBeTypes:["object"]},bubbleText:{toBeTypes:["object"]},arcScaleType:{toBe:'"area" | "radius"',test:r=>r==="area"||r==="radius"}});if(t.force){const r=e(t.force,{velocityDecay:{toBeTypes:["number"]},collisionSpacing:{toBeTypes:["number"]},strength:{toBeTypes:["number"]}});if(r.status==="error")return r}if(t.bubbleText){const r=e(t.bubbleText,{fillRate:{toBeTypes:["number"]},lineHeight:{toBeTypes:["number"]},lineLengthMin:{toBeTypes:["number"]}});if(r.status==="error")return r}return n}};let Ln;function FI(t,e){return o1().velocityDecay(e.force.velocityDecay).force("collision",n1().radius(n=>n.r+e.force.collisionSpacing)).force("charge",a1().strength(n=>-Math.pow(n.r,2)*e.force.strength)).on("tick",()=>{t.attr("transform",n=>`translate(${n.x},${n.y})`)})}function OI({visibleComputedLayoutData:t,LastBubbleDataMap:e,graphicWidth:n,graphicHeight:r,SeriesContainerPositionMap:i,scaleType:o}){const a=Math.min(n,r)/2,s=t.flat(),u=s.reduce((h,p)=>h+p.value,0),l=li().domain([0,u]).range([0,a]).exponent(o==="area"?.5:1),c=o==="area"?1:(()=>{const h=a*a*Math.PI;return Math.sqrt(h/e0(s,p=>Math.PI*Math.pow(l(p.value),2)))})(),f=.9;return s.map(h=>{const p=h,d=e.get(p.id);if(d)p.x=d.x,p.y=d.y;else{const m=i.get(p.seriesLabel);p.x=Math.random()*m.width,p.y=Math.random()*m.height}const g=l(p.value??0)*c*f;return p.r=g,p._originR=g,p})}function GI({selection:t,bubblesData:e,fullParams:n,sumSeries:r}){const i=t.selectAll("g").data(e,a=>a.id).join(a=>{const s=a.append("g").attr("cursor","pointer").attr("font-size",12).style("fill","#ffffff").attr("text-anchor","middle");return s.append("circle").attr("class","node").attr("cx",0).attr("cy",0).attr("fill",u=>u.color),s.append("text").style("opacity",.8).attr("pointer-events","none"),s},a=>a,a=>a.remove()).attr("transform",a=>`translate(${a.x},${a.y})`),o=r?"seriesLabel":"label";return i.select("circle").transition().duration(200).attr("r",a=>a.r).attr("fill",a=>a.color),i.each((a,s,u)=>{const l=V(u[s]);let c=!0;a[o].length<=n.bubbleText.lineLengthMin&&(c=!1),l.call(JE,{text:a[o],radius:a.r*n.bubbleText.fillRate,lineHeight:n.bubbleText.lineHeight,isBreakAll:c})}),i}function zI(){return x0().on("start",(t,e)=>{t.active||Ln.alpha(1).restart(),e.fx=e.x,e.fy=e.y}).on("drag",(t,e)=>{t.active||Ln.alphaTarget(0),e.fx=t.x,e.fy=t.y}).on("end",(t,e)=>{e.fx=null,e.fy=null})}function YI({fullParams:t,SeriesContainerPositionMap:e}){Ln.force("x",s1().strength(t.force.strength).x(n=>e.get(n.seriesLabel).centerX)).force("y",u1().strength(t.force.strength).y(n=>e.get(n.seriesLabel).centerY)),Ln.alpha(1).restart()}function UI({bubblesSelection:t,highlightIds:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1);return}t.each((r,i,o)=>{const a=V(o[i]);e.includes(r.id)?a.style("opacity",1).transition("highlight").ease(no).duration(500):a.style("opacity",n.styles.unhighlightedOpacity)})}const WI=Fn(BI)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt;let o=new Map;const a=n.fullDataFormatter$.pipe(B(f=>f.sumSeries),tt()),s=n.fullParams$.pipe(I(i),B(f=>f.arcScaleType),tt()),u=U({layout:n.layout$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,visibleComputedLayoutData:n.visibleComputedLayoutData$,scaleType:s}).pipe(I(i),W(async f=>f),B(f=>OI({visibleComputedLayoutData:f.visibleComputedLayoutData,LastBubbleDataMap:o,graphicWidth:f.layout.width,graphicHeight:f.layout.height,SeriesContainerPositionMap:f.SeriesContainerPositionMap,scaleType:f.scaleType})),St(1));u.subscribe(f=>{o=new Map(f.map(h=>[h.id,h]))});const l=n.fullChartParams$.pipe(I(i),B(f=>f.highlightTarget),tt()),c=U({bubblesData:u,fullParams:n.fullParams$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,sumSeries:a}).pipe(I(i),W(async f=>f),B(f=>{Ln&&Ln.stop();const h=GI({selection:t,bubblesData:f.bubblesData,fullParams:f.fullParams,sumSeries:f.sumSeries});return Ln=FI(h,f.fullParams),Ln.nodes(f.bubblesData),YI({fullParams:f.fullParams,SeriesContainerPositionMap:f.SeriesContainerPositionMap}),h}));return U({bubblesSelection:c,computedData:n.computedData$,SeriesDataMap:n.SeriesDataMap$,highlightTarget:l}).pipe(I(i),W(async f=>f)).subscribe(f=>{f.bubblesSelection.on("mouseover",(h,p)=>{r.event$.next({type:"series",eventName:"mouseover",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("mousemove",(h,p)=>{r.event$.next({type:"series",eventName:"mousemove",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("mouseout",(h,p)=>{r.event$.next({type:"series",eventName:"mouseout",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("click",(h,p)=>{r.event$.next({type:"series",eventName:"click",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).call(zI())}),U({bubblesSelection:c,bubblesData:u,highlight:n.seriesHighlight$.pipe(B(f=>f.map(h=>h.id))),fullChartParams:n.fullChartParams$,fullParams:n.fullParams$,sumSeries:a,SeriesContainerPositionMap:n.SeriesContainerPositionMap$}).pipe(I(i),W(async f=>f)).subscribe(f=>{UI({bubblesSelection:f.bubblesSelection,highlightIds:f.highlight,fullChartParams:f.fullChartParams})}),()=>{i.next(void 0)}});function C2({data:t,startAngle:e,endAngle:n}){return Yx().startAngle(e).endAngle(n).value(o=>o.value).sort((o,a)=>o.seq-a.seq)(t).map((o,a)=>{let s=o;return s.id=o.data.id,s})}function HI({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r}){const i=ot(e,"series");return U({seriesLabels:r,separateSeries:n}).pipe(W(async o=>o),B((o,a)=>{const s=o.separateSeries?o.seriesLabels:[o.seriesLabels.join("")];return t.selectAll(`g.${i}`).data(s,u=>u).join(u=>u.append("g").classed(i,!0),u=>u,u=>u.remove())}),St(1))}const Ho=({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r,seriesContainerPosition$:i})=>{const o=HI({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r});return U({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(W(async a=>a),tt((a,s)=>a.seriesContainerPosition.length===s.seriesContainerPosition.length)).subscribe(a=>{a.seriesCenterSelection.attr("transform",(s,u)=>{const l=a.seriesContainerPosition[u]??a.seriesContainerPosition[0];return`translate(${l.centerX}, ${l.centerY})`})}),U({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(W(async a=>a)).subscribe(a=>{a.seriesCenterSelection.transition().attr("transform",(s,u)=>{const l=a.seriesContainerPosition[u]??a.seriesContainerPosition[0];return`translate(${l.centerX}, ${l.centerY})`})}),{seriesCenterSelection$:o}},ap="Pie",XI={name:ap,defaultParams:P2,layerIndex:ke,validator:(t,{validateColumns:e})=>e(t,{outerRadius:{toBeTypes:["number"]},innerRadius:{toBeTypes:["number"]},outerRadiusWhileHighlight:{toBeTypes:["number"]},startAngle:{toBeTypes:["number"]},endAngle:{toBeTypes:["number"]},padAngle:{toBeTypes:["number"]},strokeColorType:{toBeTypes:["string"]},strokeWidth:{toBeTypes:["number"]},cornerRadius:{toBeTypes:["number"]}})};function jI({enter:t,exit:e,data:n,lastTweenData:r,fullParams:i}){return!t.size()&&!e.size()?o=>{const a=n.map((s,u)=>{const l=r[u]??{startAngle:0,endAngle:0,value:0};return{...s,startAngle:s.startAngle*o+l.startAngle*(1-o),endAngle:s.endAngle*o+l.endAngle*(1-o),value:s.value*o+l.value*(1-o)}});return sp(a,i.startAngle,i.endAngle,1)}:o=>sp(n,i.startAngle,i.endAngle,o)}function sp(t,e,n,r){return t.map((i,o)=>{const a=e+(i.startAngle-e)*r,s=a+(i.endAngle-i.startAngle)*r;return{...i,startAngle:a,endAngle:s}})}function L2({selection:t,data:e,arc:n,pathClassName:r,fullParams:i,fullChartParams:o}){return t.selectAll("path").data(e,s=>s.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(s,u)=>s.data.color).attr("stroke",(s,u)=>Mn({datum:s.data,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("d",(s,u)=>n(s))}function VI({pathSelection:t,ids:e,fullChartParams:n,arc:r,arcHighlight:i}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1).attr("d",o=>r(o));return}t.each((o,a,s)=>{const u=V(s[a]);e.includes(o.data.id)?u.style("opacity",1).transition("highlight").ease(no).duration(500).attr("d",l=>i(l)):u.style("opacity",n.styles.unhighlightedOpacity).transition("highlight").attr("d",l=>r(l))})}function qI(t,e){const n=new nt,r=ot(t,"path");let i=[],o=[];const a=e.seriesContainerPosition$.pipe(I(n),B(h=>h.width<h.height?h.width:h.height),tt()),s=new dt(h=>{U({containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p)).subscribe(p=>{const d=C2({data:p.containerVisibleComputedLayoutData,startAngle:p.fullParams.startAngle,endAngle:p.fullParams.endAngle});h.next(d)})}),u=new dt(h=>{U({shorterSideWith:a,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p)).subscribe(p=>{const d=Nu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadius,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});h.next(d)})}),l=new dt(h=>{U({shorterSideWith:a,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p)).subscribe(p=>{const d=Nu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadiusWhileHighlight,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});h.next(d)})}),c=e.fullChartParams$.pipe(I(n),B(h=>h.highlightTarget),tt()),f=new dt(h=>{U({pieData:s,arc:u,computedData:e.computedData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,highlightTarget:c}).pipe(I(n),W(async p=>p)).subscribe(p=>{e.containerSelection.interrupt("graphicMove");const d=e.containerSelection.selectAll("path").data(p.pieData,b=>b.id),g=d.enter(),m=d.exit(),y=jI({enter:g,exit:m,data:p.pieData,lastTweenData:i,fullParams:p.fullParams});e.containerSelection.transition("graphicMove").duration(p.fullChartParams.transitionDuration).tween("move",(b,v)=>x=>{o=y(x),L2({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams})}).on("end",(b,v)=>{o=sp(p.pieData,p.fullParams.startAngle,p.fullParams.endAngle,1);const x=L2({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams});h.next(x),i=Object.assign([],p.pieData),e.event$.next({type:"series",pluginName:t,eventName:"transitionEnd",event:void 0,highlightTarget:p.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",data:p.computedData})})})}).pipe(St(1));return U({pathSelection:f,SeriesDataMap:e.SeriesDataMap$,computedData:e.computedData$,highlightTarget:c}).pipe(I(n),W(async h=>h)).subscribe(h=>{h.pathSelection.on("mouseover",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mouseover",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("mousemove",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mousemove",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("mouseout",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mouseout",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("click",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"click",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})})}),U({pathSelection:f,highlight:e.seriesHighlight$.pipe(B(h=>h.map(p=>p.id))),fullChartParams:e.fullChartParams$,arc:u,arcHighlight:l}).pipe(I(n),W(async h=>h)).subscribe(h=>{VI({pathSelection:h.pathSelection,ids:h.highlight,fullChartParams:h.fullChartParams,arc:h.arc,arcHighlight:h.arcHighlight})}),()=>{n.next(void 0)}}const ZI=Fn(XI)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,{seriesCenterSelection$:o}=Ho({selection:t,pluginName:ap,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=V(c[l]),h=r.visibleComputedLayoutData$.pipe(I(i),B(d=>d[l]??d[0])),p=r.seriesContainerPosition$.pipe(I(i),B(d=>d[l]??d[0]));a[l]=qI(ap,{containerSelection:f,computedData$:r.computedData$,containerVisibleComputedLayoutData$:h,SeriesDataMap$:r.SeriesDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,event$:n.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),zu="PieEventTexts",k2=ot(zu,"text"),KI={name:zu,defaultParams:rp,layerIndex:Oh,validator:(t,{validateColumns:e})=>e(t,{eventFn:{toBeTypes:["Function"]},textAttrs:{toBeTypes:["object[]"]},textStyles:{toBeTypes:["object[]"]}})};function up(t,e){const n=t.selectAll(`text.${k2}`).data(e),r=n.enter().append("text").classed(k2,!0),i=n.merge(r);return i.each((o,a,s)=>{const u=V(s[a]).text(o.text);Object.keys(o.attr).forEach(l=>{u.attr(l,o.attr[l])}),Object.keys(o.style).forEach(l=>{u.style(l,o.style[l])})}),n.exit().remove(),i}function lp({eventData:t,eventName:e,t:n,eventFn:r,textAttrs:i,textStyles:o}){return r(t,e,n).map((s,u)=>({text:s,attr:i[u],style:o[u]}))}function QI(t,e){const n=new nt;let r;const i=e.fullChartParams$.pipe(I(n),B(o=>o.highlightTarget),tt());return U({computedData:e.computedData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,highlightTarget:i}).pipe(I(n),W(async o=>o)).subscribe(o=>{e.containerSelection.transition("move").duration(o.fullChartParams.transitionDuration).tween("move",(a,s)=>u=>{const l=lp({eventData:{type:"series",pluginName:t,eventName:"transitionMove",event:a,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:u,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});up(e.containerSelection,l)}).on("end",(a,s)=>{const u=lp({eventData:{type:"series",pluginName:t,eventName:"transitionEnd",event:a,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:1,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});up(e.containerSelection,u),r&&r.unsubscribe(),r=e.event$.subscribe(l=>{const c=lp({eventData:l,eventName:l.eventName,t:1,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});up(e.containerSelection,c)})})}),()=>{n.next(void 0)}}const JI=Fn(KI)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,{seriesCenterSelection$:o}=Ho({selection:t,pluginName:zu,separateSeries$:n.separateSeries$,seriesLabels$:n.seriesLabels$,seriesContainerPosition$:n.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=V(c[l]),h=n.computedLayoutData$.pipe(I(i),B(d=>d[l]??d[0])),p=n.seriesContainerPosition$.pipe(I(i),B(d=>d[l]??d[0]));a[l]=QI(zu,{containerSelection:f,computedData$:n.computedData$,containerComputedLayoutData$:h,SeriesDataMap$:n.SeriesDataMap$,fullParams$:n.fullParams$,fullChartParams$:n.fullChartParams$,seriesHighlight$:n.seriesHighlight$,seriesContainerPosition$:p,event$:r.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),xi="PieLabels",tN=ot(xi,"label-g"),eN=ot(xi,"line-g"),nN=ot(xi,"text"),R2=2,rN={name:xi,defaultParams:ip,layerIndex:Oh,validator:(t,{validateColumns:e})=>e(t,{outerRadius:{toBeTypes:["number"]},outerRadiusWhileHighlight:{toBeTypes:["number"]},startAngle:{toBeTypes:["number"]},endAngle:{toBeTypes:["number"]},labelCentroid:{toBeTypes:["number"]},labelFn:{toBeTypes:["Function"]},labelColorType:{toBeOption:"ColorType"}})};function iN({pieData:t,arc:e,arcMouseover:n,labelCentroid:r,lineStartCentroid:i,fullParams:o}){return t.map((a,s)=>{const[u,l]=e.centroid(a),[c,f]=n.centroid(a),h=o.labelFn(a.data);return{pieDatum:a,arcIndex:s,arcLabels:h.split(`
|
78
|
-
`),lineStartX:u*i,lineStartY:l*i,lineStartMouseoverX:c*i,lineStartMouseoverY:f*i,x:u*r,y:l*r,mouseoverX:c*r,mouseoverY:f*r,textWidth:0,collisionShiftX:0,collisionShiftY:0,quadrant:u>=0&&l<=0?1:u<0&&l<=0?2:u<0&&l>0?3:4}}).filter(a=>a.pieDatum.data.visible)}function oN({labelGSelection:t,data:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=t.selectAll("text").data(e,a=>a.pieDatum.id).join("text").classed(nN,!0).attr("font-weight","bold").attr("text-anchor",a=>a.quadrant==1||a.quadrant==4?"start":"end").style("dominant-baseline",a=>a.quadrant==1||a.quadrant==2?"auto":"hanging").style("cursor",a=>r.highlightTarget&&r.highlightTarget!="none"?"pointer":"none").attr("font-size",r.styles.textSize).attr("x",0).attr("y",0).attr("fill",(a,s)=>Mn({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).each((a,s,u)=>{t2(V(u[s]),{textArr:a.arcLabels,textSizePx:i,quadrant:a.quadrant})});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function aN(t,e,n){const r=t.nodes(),i=n,o=r.map((a,s)=>{const u=a.getBBox(),l=[e[s].x,e[s].y];return{node:a,x:l[0],y:l[1],width:u.width,height:u.height}});for(let a=0;a<o.length;a++){const s=o[a];for(let u=a+1;u<o.length;u++){const l=o[u];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=l.x+e[u].collisionShiftX,p=l.y+e[u].collisionShiftY;if(!(c+s.width/2<h-l.width/2||c-s.width/2>h+l.width/2||f+s.height/2<p-l.height/2||f-s.height/2>p+l.height/2)){if(e[u].quadrant==2){const d=p>f?-i*2:-i;e[u].collisionShiftY+=d}else if(e[u].quadrant==4){const d=p>f?i:i*2;e[u].collisionShiftY+=d}}}}for(let a=o.length-1;a>=0;a--){const s=o[a];for(let u=a-1;u>=0;u--){const l=o[u];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=l.x+e[u].collisionShiftX,p=l.y+e[u].collisionShiftY;if(!(c+s.width/2<h-l.width/2||c-s.width/2>h+l.width/2||f+s.height/2<p-l.height/2||f-s.height/2>p+l.height/2)){if(e[u].quadrant==1){const d=p>f?-i*2:-i;e[u].collisionShiftY+=d}else if(e[u].quadrant==3){const d=p>f?i:i*2;e[u].collisionShiftY+=d}}}}t.data(e).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function sN({lineGSelection:t,data:e,fullParams:n,fullChartParams:r}){const i=e.filter(a=>a.collisionShiftX||a.collisionShiftY),o=t.selectAll("polyline").data(i,a=>a.pieDatum.id).join("polyline").attr("stroke",a=>Mn({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).attr("stroke-width",1).attr("fill","none").attr("points",a=>[[a.lineStartX,a.lineStartY],[a.lineStartX,a.lineStartY]]);return o.transition().attr("points",a=>{let s=a.x+a.collisionShiftX,u=a.y+a.collisionShiftY;return[[s,u],[a.lineStartX,a.lineStartY]]}),o}function uN({textSelection:t,lineSelection:e,ids:n,fullChartParams:r}){if(t.interrupt("highlight"),e.interrupt("highlight"),!n.length){t.transition("highlight").duration(200).attr("transform",i=>`translate(${i.x+i.collisionShiftX},${i.y+i.collisionShiftY})`).style("opacity",1),e.transition("highlight").duration(200).style("opacity",1);return}t.each((i,o,a)=>{const s=V(a[o]);n.includes(i.pieDatum.id)?s.style("opacity",1).transition("highlight").duration(200).attr("transform",u=>u.collisionShiftX||u.collisionShiftY?`translate(${u.x+u.collisionShiftX},${u.y+u.collisionShiftY})`:`translate(${u.mouseoverX+u.collisionShiftX},${u.mouseoverY+u.collisionShiftY})`):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200).attr("transform",u=>`translate(${u.x+u.collisionShiftX},${u.y+u.collisionShiftY})`)}),e.each((i,o,a)=>{const s=V(a[o]);n.includes(i.pieDatum.data.id)?s.style("opacity",1).transition("highlight").duration(200):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function lN(t,e){const n=new nt;e.containerSelection.selectAll("g").remove();const r=e.containerSelection.append("g");r.classed(eN,!0);const i=e.containerSelection.append("g");i.classed(tN,!0);const o=new nt,a=new nt;let s=[];const u=e.seriesContainerPosition$.pipe(I(n),B(c=>c.width<c.height?c.width:c.height),tt()),l=e.fullParams$.pipe(I(n),B(c=>c.labelCentroid>=R2?R2:c.labelCentroid));return U({shorterSideWith:u,containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,textSizePx:e.textSizePx$,lineStartCentroid:l}).pipe(I(n),W(async c=>c)).subscribe(c=>{const f=Nu({axisWidth:c.shorterSideWith,innerRadius:0,outerRadius:c.fullParams.outerRadius,padAngle:0,cornerRadius:0}),h=Nu({axisWidth:c.shorterSideWith,innerRadius:0,outerRadius:c.fullParams.outerRadiusWhileHighlight,padAngle:0,cornerRadius:0}),p=C2({data:c.containerVisibleComputedLayoutData,startAngle:c.fullParams.startAngle,endAngle:c.fullParams.endAngle});s=iN({pieData:p,arc:f,arcMouseover:h,labelCentroid:c.fullParams.labelCentroid,lineStartCentroid:c.lineStartCentroid,fullParams:c.fullParams}),r.selectAll("polyline").remove();const d=oN({labelGSelection:i,data:s,fullParams:c.fullParams,fullChartParams:c.fullChartParams,textSizePx:c.textSizePx});setTimeout(()=>{aN(d,s,c.textSizePx);const g=sN({lineGSelection:r,data:s,fullParams:c.fullParams,fullChartParams:c.fullChartParams});a.next(g)},1e3),o.next(d)}),U({textSelection:o,lineSelection:a,highlight:e.seriesHighlight$.pipe(B(c=>c.map(f=>f.id))),fullChartParams:e.fullChartParams$}).pipe(I(n),W(async c=>c)).subscribe(c=>{uN({textSelection:c.textSelection,lineSelection:c.lineSelection,ids:c.highlight,fullChartParams:c.fullChartParams})}),()=>{n.next(void 0)}}const cN=Fn(rN)(({selection:t,observer:e,subject:n})=>{const r=new nt,{seriesCenterSelection$:i}=Ho({selection:t,pluginName:xi,separateSeries$:e.separateSeries$,seriesLabels$:e.seriesLabels$,seriesContainerPosition$:e.seriesContainerPosition$}),o=[];return i.pipe(I(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,u,l)=>{const c=V(l[u]),f=e.visibleComputedLayoutData$.pipe(I(r),B(p=>p[u]??p[0])),h=e.seriesContainerPosition$.pipe(I(r),B(p=>p[u]??p[0]));o[u]=lN(xi,{containerSelection:c,containerVisibleComputedLayoutData$:f,fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,textSizePx$:e.textSizePx$,seriesHighlight$:e.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),cp="Rose",fN=Math.PI*2,hN={name:cp,defaultParams:M2,layerIndex:ke,validator:(t,{validateColumns:e})=>e(t,{outerRadius:{toBeTypes:["number"]},padAngle:{toBeTypes:["number"]},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},cornerRadius:{toBeTypes:["number"]},arcScaleType:{toBe:'"area" | "radius"',test:r=>r==="area"||r==="radius"},angleIncreaseWhileHighlight:{toBeTypes:["number"]}})};function pN({cornerRadius:t,outerRadius:e,axisWidth:n,maxValue:r,arcScaleType:i,fullParams:o}){const a=n/2*e,s=i==="area"?.5:1,u=li().domain([0,r]).range([0,a]).exponent(s);return l=>{const c=u(l.prevValue),f=u(l.value),h=Ze(c,f);return p=>{const d=h(p);return $u().innerRadius(0).outerRadius(d).padAngle(o.padAngle).padRadius(d).cornerRadius(t)(l)}}}function dN({pathSelection:t,ids:e,fullParams:n,fullChartParams:r,tweenArc:i}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1).attr("d",o=>i(o)(1));return}t.each((o,a,s)=>{const u=V(s[a]);e.includes(o.data.id)?u.style("opacity",1).transition("highlight").ease(no).duration(500).attr("d",l=>i({...l,startAngle:l.startAngle-n.angleIncreaseWhileHighlight,endAngle:l.endAngle+n.angleIncreaseWhileHighlight})(1)):u.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").attr("d",l=>i(l)(1))})}function gN(t,e){const n=new nt,r=ot(t,"path");let i=[];const o=e.seriesContainerPosition$.pipe(I(n),B(p=>p.width<p.height?p.width:p.height),tt()),a=U({containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p),B(p=>{const d=fN/p.containerVisibleComputedLayoutData.length;return p.containerVisibleComputedLayoutData.map((g,m)=>({id:g.id,data:g,index:m,value:g.value,startAngle:d*m,endAngle:d*(m+1),padAngle:p.fullParams.padAngle,prevValue:i[m]&&i[m].id===g.id?i[m].value:0}))})),s=e.fullChartParams$.pipe(I(n),B(p=>p.highlightTarget),tt()),u=e.visibleComputedLayoutData$.pipe(B(p=>Math.max(...p.flat().map(d=>d.value))),tt()),l=U({fullParams:e.fullParams$,axisWidth:o,maxValue:u}).pipe(I(n),W(async p=>p),B(p=>pN({cornerRadius:p.fullParams.cornerRadius,outerRadius:p.fullParams.outerRadius,axisWidth:p.axisWidth,maxValue:p.maxValue,arcScaleType:p.fullParams.arcScaleType,fullParams:p.fullParams}))),c=e.fullChartParams$.pipe(I(n),B(p=>p.transitionDuration),tt()),f=new t_(!1),h=new dt(p=>{U({pieData:a,tweenArc:l,transitionDuration:c,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$}).pipe(I(n),W(async d=>d)).subscribe(d=>{const g=d.pieData.map((y,b)=>(y.prevValue=i[b]&&i[b].id===y.id?i[b].value:0,y));f.next(!0);const m=e.containerSelection.selectAll("path").data(g,y=>y.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(y,b)=>y.data.color).attr("stroke",(y,b)=>Mn({datum:y.data,colorType:d.fullParams.strokeColorType,fullChartParams:d.fullChartParams})).attr("stroke-width",d.fullParams.strokeWidth);m.interrupt("graphicMove"),m.transition("graphicMove").duration(d.transitionDuration).attrTween("d",d.tweenArc).on("end",()=>{p.next(m),f.next(!1)}),i=Object.assign([],g)})}).pipe(St(1));return U({pathSelection:h,SeriesDataMap:e.SeriesDataMap$,computedData:e.computedData$,highlightTarget:s}).pipe(I(n),W(async p=>p)).subscribe(p=>{p.pathSelection.on("mouseover",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mouseover",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("mousemove",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mousemove",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("mouseout",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mouseout",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("click",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"click",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})})}),U({pathSelection:h,highlight:e.seriesHighlight$.pipe(B(p=>p.map(d=>d.id))),fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,tweenArc:l,isTransitionMoving:f}).pipe(I(n),W(async p=>p),$i(p=>!p.isTransitionMoving)).subscribe(p=>{dN({pathSelection:p.pathSelection,ids:p.highlight,fullParams:p.fullParams,fullChartParams:p.fullChartParams,tweenArc:p.tweenArc})}),()=>{n.next(void 0)}}const mN=Fn(hN)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,{seriesCenterSelection$:o}=Ho({selection:t,pluginName:cp,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=V(c[l]),h=r.visibleComputedLayoutData$.pipe(I(i),B(d=>JSON.parse(JSON.stringify(d[l]??d[0])))),p=r.seriesContainerPosition$.pipe(I(i),B(d=>JSON.parse(JSON.stringify(d[l]??d[0]))));a[l]=gN(cp,{containerSelection:f,computedData$:r.computedData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,containerVisibleComputedLayoutData$:h,SeriesDataMap$:r.SeriesDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,event$:n.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),vi="RoseLabels",yN=ot(vi,"label-g"),bN=ot(vi,"line-g"),xN=ot(vi,"text"),E2=2,vN={name:vi,defaultParams:op,layerIndex:Oh,validator:(t,{validateColumns:e})=>e(t,{outerRadius:{toBeTypes:["number"]},labelCentroid:{toBeTypes:["number"]},labelFn:{toBeTypes:["Function"]},labelColorType:{toBeOption:"ColorType"},arcScaleType:{toBe:'"area" | "radius"',test:r=>r==="area"||r==="radius"}})};function _N({pieData:t,labelCentroid:e,arcScaleType:n,maxValue:r,axisWidth:i,outerRadius:o,lineStartCentroid:a,fullParams:s}){const u=i/2*o,l=n==="area"?.5:1,c=li().domain([0,r]).range([0,u]).exponent(l);return t.map((f,h)=>{const p=c(f.value),d=$u().innerRadius(0).outerRadius(p).padAngle(0).padRadius(p).cornerRadius(0),[g,m]=d.centroid(f),[y,b]=[g,m],v=s.labelFn(f.data);return{pieDatum:f,arcIndex:h,arcLabels:v.split(`
|
79
|
-
`),lineStartX:g*a,lineStartY:m*a,lineStartMouseoverX:y*a,lineStartMouseoverY:b*a,x:g*e,y:m*e,mouseoverX:y*e,mouseoverY:b*e,textWidth:0,collisionShiftX:0,collisionShiftY:0,quadrant:g>=0&&m<=0?1:g<0&&m<=0?2:g<0&&m>0?3:4}}).filter(f=>f.pieDatum.data.visible)}function wN({labelGSelection:t,data:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=t.selectAll("text").data(e,a=>a.pieDatum.id).join("text").classed(xN,!0).attr("font-weight","bold").attr("text-anchor",a=>a.quadrant==1||a.quadrant==4?"start":"end").style("dominant-baseline",a=>a.quadrant==1||a.quadrant==2?"auto":"hanging").style("cursor",a=>r.highlightTarget&&r.highlightTarget!="none"?"pointer":"none").attr("font-size",r.styles.textSize).attr("fill",(a,s)=>Mn({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).each((a,s,u)=>{t2(V(u[s]),{textArr:a.arcLabels,textSizePx:i,quadrant:a.quadrant})});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function $N(t,e,n){const r=t.nodes(),i=n,o=r.map((a,s)=>{const u=a.getBBox(),l=[e[s].x,e[s].y];return{node:a,x:l[0],y:l[1],width:u.width,height:u.height}});for(let a=0;a<o.length;a++){const s=o[a];for(let u=a+1;u<o.length;u++){const l=o[u];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=l.x+e[u].collisionShiftX,p=l.y+e[u].collisionShiftY;if(!(c+s.width/2<h-l.width/2||c-s.width/2>h+l.width/2||f+s.height/2<p-l.height/2||f-s.height/2>p+l.height/2)){if(e[u].quadrant==2){const d=p>f?-i*2:-i;e[u].collisionShiftY+=d}else if(e[u].quadrant==4){const d=p>f?i:i*2;e[u].collisionShiftY+=d}}}}for(let a=o.length-1;a>=0;a--){const s=o[a];for(let u=a-1;u>=0;u--){const l=o[u];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=l.x+e[u].collisionShiftX,p=l.y+e[u].collisionShiftY;if(!(c+s.width/2<h-l.width/2||c-s.width/2>h+l.width/2||f+s.height/2<p-l.height/2||f-s.height/2>p+l.height/2)){if(e[u].quadrant==1){const d=p>f?-i*2:-i;e[u].collisionShiftY+=d}else if(e[u].quadrant==3){const d=p>f?i:i*2;e[u].collisionShiftY+=d}}}}t.data(e).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function SN({lineGSelection:t,data:e,fullParams:n,fullChartParams:r}){const i=e.filter(a=>a.collisionShiftX||a.collisionShiftY),o=t.selectAll("polyline").data(i,a=>a.pieDatum.id).join("polyline").attr("stroke",a=>Mn({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).attr("stroke-width",1).attr("fill","none").attr("points",a=>[[a.lineStartX,a.lineStartY],[a.lineStartX,a.lineStartY]]);return o.transition().attr("points",a=>{let s=a.x+a.collisionShiftX,u=a.y+a.collisionShiftY;return[[s,u],[a.lineStartX,a.lineStartY]]}),o}function AN({textSelection:t,lineSelection:e,ids:n,fullChartParams:r}){if(t.interrupt("highlight"),e.interrupt("highlight"),!n.length){t.transition("highlight").duration(200).attr("transform",i=>`translate(${i.x+i.collisionShiftX},${i.y+i.collisionShiftY})`).style("opacity",1),e.transition("highlight").duration(200).style("opacity",1);return}t.each((i,o,a)=>{const s=V(a[o]);n.includes(i.pieDatum.data.id)?s.style("opacity",1).transition("highlight").duration(200).attr("transform",u=>`translate(${u.mouseoverX+u.collisionShiftX},${u.mouseoverY+u.collisionShiftY})`):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200).attr("transform",u=>`translate(${u.x+u.collisionShiftX},${u.y+u.collisionShiftY})`)}),e.each((i,o,a)=>{const s=V(a[o]);n.includes(i.pieDatum.data.id)?s.style("opacity",1).transition("highlight").duration(200):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function TN(t,e){const n=new nt;e.containerSelection.selectAll("g").remove();const r=e.containerSelection.append("g");r.classed(bN,!0);const i=e.containerSelection.append("g");i.classed(yN,!0);const o=new nt,a=new nt;let s=[];const u=e.seriesContainerPosition$.pipe(I(n),B(f=>f.width<f.height?f.width:f.height),tt()),l=e.visibleComputedLayoutData$.pipe(B(f=>Math.max(...f.flat().map(h=>h.value))),tt()),c=e.fullParams$.pipe(I(n),B(f=>f.labelCentroid>=E2?E2:f.labelCentroid));return U({shorterSideWith:u,containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,maxValue:l,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,textSizePx:e.textSizePx$,lineStartCentroid:c}).pipe(I(n),W(async f=>f)).subscribe(f=>{const h=Math.PI*2/f.containerVisibleComputedLayoutData.length,p=f.containerVisibleComputedLayoutData.map((g,m)=>({id:g.id,data:g,index:m,value:g.value,startAngle:h*m,endAngle:h*(m+1),padAngle:0}));s=_N({pieData:p,labelCentroid:f.fullParams.labelCentroid,arcScaleType:f.fullParams.arcScaleType,maxValue:f.maxValue,axisWidth:f.shorterSideWith,outerRadius:f.fullParams.outerRadius,lineStartCentroid:f.lineStartCentroid,fullParams:f.fullParams}),r.selectAll("polyline").remove();const d=wN({labelGSelection:i,data:s,fullParams:f.fullParams,fullChartParams:f.fullChartParams,textSizePx:f.textSizePx});setTimeout(()=>{$N(d,s,f.textSizePx);const g=SN({lineGSelection:r,data:s,fullParams:f.fullParams,fullChartParams:f.fullChartParams});a.next(g)},1e3),o.next(d)}),U({textSelection:o,lineSelection:a,highlight:e.seriesHighlight$.pipe(B(f=>f.map(h=>h.id))),fullChartParams:e.fullChartParams$}).pipe(I(n),W(async f=>f)).subscribe(f=>{AN({textSelection:f.textSelection,lineSelection:f.lineSelection,ids:f.highlight,fullChartParams:f.fullChartParams})}),()=>{n.next(void 0)}}const PN=Fn(vN)(({selection:t,observer:e,subject:n})=>{const r=new nt,{seriesCenterSelection$:i}=Ho({selection:t,pluginName:vi,separateSeries$:e.separateSeries$,seriesLabels$:e.seriesLabels$,seriesContainerPosition$:e.seriesContainerPosition$}),o=[];return i.pipe(I(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,u,l)=>{const c=V(l[u]),f=e.visibleComputedLayoutData$.pipe(I(r),B(p=>JSON.parse(JSON.stringify(p[u]??p[0])))),h=e.seriesContainerPosition$.pipe(I(r),B(p=>JSON.parse(JSON.stringify(p[u]??p[0]))));o[u]=TN(vi,{containerSelection:c,visibleComputedLayoutData$:e.visibleComputedLayoutData$,containerVisibleComputedLayoutData$:f,fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,textSizePx$:e.textSizePx$,seriesHighlight$:e.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),I2="SeriesLegend",MN=Fn({name:I2,defaultParams:D2,layerIndex:Bu,validator:(t,{validateColumns:e})=>e(t,{padding:{toBeTypes:["number"]},backgroundFill:{toBeOption:"ColorType"},backgroundStroke:{toBeOption:"ColorType"},gap:{toBeTypes:["number"]},listRectWidth:{toBeTypes:["number"]},listRectHeight:{toBeTypes:["number"]},listRectRadius:{toBeTypes:["number"]},textColorType:{toBeOption:"ColorType"}})})(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new nt,o=n.SeriesDataMap$.pipe(I(i),B(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),B(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Fu(I2,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),fp={paddingInner:2,paddingOuter:2,labelColorType:"primary",squarifyRatio:1.618034,sort:(t,e)=>e.value-t.value};fp.sort.toString=()=>"(a, b) => b.value - a.value";const N2={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},B2="TreeLegend",DN=Lg({name:B2,defaultParams:N2,layerIndex:Bu,validator:(t,{validateColumns:e})=>e(t,{padding:{toBeTypes:["number"]},backgroundFill:{toBeOption:"ColorType"},backgroundStroke:{toBeOption:"ColorType"},gap:{toBeTypes:["number"]},listRectWidth:{toBeTypes:["number"]},listRectHeight:{toBeTypes:["number"]},listRectRadius:{toBeTypes:["number"]},textColorType:{toBeOption:"ColorType"}})})(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new nt,o=n.CategoryDataMap$.pipe(I(i),B(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),B(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Fu(B2,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),dr="TreeMap",F2=ot(dr,"tree"),O2=ot(dr,"tile"),CN={name:dr,defaultParams:fp,layerIndex:ke,validator:(t,{validateColumns:e})=>e(t,{paddingInner:{toBeTypes:["number"]},paddingOuter:{toBeTypes:["number"]},labelColorType:{toBeOption:"ColorType"},squarifyRatio:{toBeTypes:["number"]},sort:{toBeTypes:["Function"]}})};function LN({selection:t,treeData:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=i/2,a=i,s=t.selectAll(`g.${F2}`).data(e,u=>u.data.id).join("g").attr("class",F2);return s.attr("transform",u=>!u.x0||!u.y0?null:`translate(${u.x0},${u.y0})`).each((u,l,c)=>{const f=V(c[l]);f.selectAll(`rect.${O2}`).data([u],h=>h.data.id).join("rect").attr("id",h=>h.data.id).attr("class",O2).attr("cursor","pointer").attr("width",h=>h.x1-h.x0).attr("height",h=>h.y1-h.y0).attr("fill",h=>h.data.color).attr("data-name",h=>h.data.label).attr("data-category",h=>h.data.categoryLabel).attr("data-value",h=>h.data.value),f.selectAll("g").data([u]).join("g").each((h,p,d)=>{V(d[p]).selectAll("text").data([h]).join("text").text(m=>m.data.label).attr("dominant-baseline","hanging").attr("x",o).attr("y",o).attr("font-size",r.styles.textSize).each(function(m){const y=V(this),b=m.data.label.split(/\s+/).reverse();let v,x=[];const S=y.attr("x");let $=y.attr("y"),R=0,T=y.text(null).append("tspan").attr("cursor","pointer").attr("fill",kt(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",S).attr("y",$);for(;v=b.pop();)x.push(v),T.text(x.join(" ")),T.node().getComputedTextLength()>m.x1-m.x0-o&&(x.pop(),T.text(x.join(" ")),x=[v],R+=a,T=y.append("tspan").attr("cursor","pointer").attr("fill",kt(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",S).attr("y",$).attr("dy",R+"px").text(v))})})}),s}function kN({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{e.includes(r.data.id)?V(o[i]).style("opacity",1):V(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const RN=Lg(CN)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=U({layout:r.layout$,visibleComputedData:r.visibleComputedData$,fullParams:r.fullParams$,fullDataFormatter:r.fullDataFormatter$,fullChartParams:r.fullChartParams$}).pipe(I(i),W(async u=>u),B(u=>{const l=Qy().size([u.layout.width,u.layout.height]).paddingInner(u.fullParams.paddingInner).paddingOuter(u.fullParams.paddingOuter).round(!0).tile(Qf.ratio(u.fullParams.squarifyRatio)),c=eu(u.visibleComputedData).sum(h=>h.value).sort(u.fullParams.sort);return l(c),c.leaves()})),a=U({selection:Qo(t),treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,textSizePx:r.textSizePx$}).pipe(I(i),W(async u=>u),B(u=>LN({selection:t,treeData:u.treeData,fullParams:u.fullParams,fullChartParams:u.fullChartParams,textSizePx:u.textSizePx}))),s=r.fullChartParams$.pipe(I(i),B(u=>u.highlightTarget),tt());return U({cellSelection:a,computedData:r.computedData$,treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,highlightTarget:s,CategoryDataMap:r.CategoryDataMap$}).pipe(I(i),W(async u=>u)).subscribe(u=>{u.cellSelection.on("mouseover",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseover",pluginName:dr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("mousemove",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mousemove",pluginName:dr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("mouseout",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseout",pluginName:dr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("click",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"click",pluginName:dr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})})}),U({cellSelection:a,highlight:r.treeHighlight$.pipe(B(u=>u.map(l=>l.id))),fullChartParams:r.fullChartParams$}).pipe(I(i),W(async u=>u)).subscribe(u=>{kN({selection:u.cellSelection,ids:u.highlight,fullChartParams:u.fullChartParams})}),()=>{i.next(void 0)}});K.BarStack=FE,K.Bars=CE,K.BarsPN=LE,K.BarsTriangle=XE,K.Bubbles=WI,K.CONTAINER_PLUGIN_PARAMS=kI,K.DEFAULT_BARS_DIVERGING_PARAMS=G2,K.DEFAULT_BARS_PARAMS=jo,K.DEFAULT_BARS_TRIANGLE_PARAMS=gp,K.DEFAULT_BAR_STACK_PARAMS=dp,K.DEFAULT_BUBBLES_PARAMS=T2,K.DEFAULT_DOTS_PARAMS=pp,K.DEFAULT_GRID_LEGEND_PARAMS=bp,K.DEFAULT_GROUP_AREA_PARAMS=Yu,K.DEFAULT_GROUP_AXIS_PARAMS=Uu,K.DEFAULT_LINES_PARAMS=gr,K.DEFAULT_LINE_AREAS_PARAMS=hp,K.DEFAULT_MULTI_BARS_PARAMS=a2,K.DEFAULT_MULTI_BARS_TRIANGLE_PARAMS=u2,K.DEFAULT_MULTI_BAR_STACK_PARAMS=s2,K.DEFAULT_MULTI_DOTS_PARAMS=f2,K.DEFAULT_MULTI_GRID_LEGEND_PARAMS=o2,K.DEFAULT_MULTI_GROUP_AXIS_PARAMS=Yh,K.DEFAULT_MULTI_LINES_PARAMS=l2,K.DEFAULT_MULTI_LINE_AREAS_PARAMS=c2,K.DEFAULT_MULTI_VALUE_AXIS_PARAMS=Gu,K.DEFAULT_MULTI_VALUE_STACK_AXIS_PARAMS=xI,K.DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS=Uh,K.DEFAULT_OVERLAPPING_VALUE_STACK_AXES_PARAMS=h2,K.DEFAULT_PIE_EVENT_TEXTS_PARAMS=rp,K.DEFAULT_PIE_LABELS_PARAMS=ip,K.DEFAULT_PIE_PARAMS=P2,K.DEFAULT_ROSE_LABELS_PARAMS=op,K.DEFAULT_ROSE_PARAMS=M2,K.DEFAULT_SCALING_AREA_PARAMS=yp,K.DEFAULT_SERIES_LEGEND_PARAMS=D2,K.DEFAULT_TREE_LEGEND_PARAMS=N2,K.DEFAULT_TREE_MAP_PARAMS=fp,K.DEFAULT_VALUE_AXIS_PARAMS=Wu,K.DEFAULT_VALUE_STACK_AXIS_PARAMS=mp,K.Dots=ZE,K.GridLegend=QE,K.GroupAux=bI,K.GroupAxis=iI,K.LineAreas=$E,K.Lines=mE,K.MultiBarStack=wI,K.MultiBars=_I,K.MultiBarsTriangle=$I,K.MultiDots=TI,K.MultiGridLegend=vI,K.MultiGroupAxis=PI,K.MultiLineAreas=AI,K.MultiLines=SI,K.MultiValueAxis=MI,K.MultiValueStackAxis=DI,K.OverlappingValueAxes=CI,K.OverlappingValueStackAxes=LI,K.Pie=ZI,K.PieEventTexts=JI,K.PieLabels=cN,K.Rose=mN,K.RoseLabels=PN,K.ScalingArea=cI,K.SeriesLegend=MN,K.TOOLTIP_PARAMS=ep,K.Tooltip=NI,K.TreeLegend=DN,K.TreeMap=RN,K.ValueAxis=uI,K.ValueStackAxis=lI,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});
|
77
|
+
}`;const ip={outerRadius:.85,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,labelCentroid:2.1,labelColorType:"primary",labelFn:t=>String(t.label)};ip.labelFn.toString=()=>"d => String(d.label)";const M2={outerRadius:.85,padAngle:0,strokeColorType:"background",strokeWidth:0,cornerRadius:0,arcScaleType:"area",angleIncreaseWhileHighlight:.05},op={outerRadius:.85,labelCentroid:2.1,labelFn:t=>String(t.label),labelColorType:"primary",arcScaleType:"area"};op.labelFn.toString=()=>"d => String(d.label)";const D2={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},FI={name:"Bubbles",defaultParams:T2,layerIndex:ke,validator:(t,{validateColumns:e})=>{const n=e(t,{force:{toBeTypes:["object"]},bubbleText:{toBeTypes:["object"]},arcScaleType:{toBe:'"area" | "radius"',test:r=>r==="area"||r==="radius"}});if(t.force){const r=e(t.force,{velocityDecay:{toBeTypes:["number"]},collisionSpacing:{toBeTypes:["number"]},strength:{toBeTypes:["number"]}});if(r.status==="error")return r}if(t.bubbleText){const r=e(t.bubbleText,{fillRate:{toBeTypes:["number"]},lineHeight:{toBeTypes:["number"]},lineLengthMin:{toBeTypes:["number"]}});if(r.status==="error")return r}return n}};let Ln;function OI(t,e){return o1().velocityDecay(e.force.velocityDecay).force("collision",n1().radius(n=>n.r+e.force.collisionSpacing)).force("charge",a1().strength(n=>-Math.pow(n.r,2)*e.force.strength)).on("tick",()=>{t.attr("transform",n=>`translate(${n.x},${n.y})`)})}function GI({visibleComputedLayoutData:t,LastBubbleDataMap:e,graphicWidth:n,graphicHeight:r,SeriesContainerPositionMap:i,scaleType:o}){const a=Math.min(n,r)/2,s=t.flat(),u=s.reduce((h,p)=>h+p.value,0),l=li().domain([0,u]).range([0,a]).exponent(o==="area"?.5:1),c=o==="area"?1:(()=>{const h=a*a*Math.PI;return Math.sqrt(h/e0(s,p=>Math.PI*Math.pow(l(p.value),2)))})(),f=.9;return s.map(h=>{const p=h,d=e.get(p.id);if(d)p.x=d.x,p.y=d.y;else{const m=i.get(p.seriesLabel);p.x=Math.random()*m.width,p.y=Math.random()*m.height}const g=l(p.value??0)*c*f;return p.r=g,p._originR=g,p})}function zI({selection:t,bubblesData:e,fullParams:n,sumSeries:r}){const i=t.selectAll("g").data(e,a=>a.id).join(a=>{const s=a.append("g").attr("cursor","pointer").attr("font-size",12).style("fill","#ffffff").attr("text-anchor","middle");return s.append("circle").attr("class","node").attr("cx",0).attr("cy",0).attr("fill",u=>u.color),s.append("text").style("opacity",.8).attr("pointer-events","none"),s},a=>a,a=>a.remove()).attr("transform",a=>`translate(${a.x},${a.y})`),o=r?"seriesLabel":"label";return i.select("circle").transition().duration(200).attr("r",a=>a.r).attr("fill",a=>a.color),i.each((a,s,u)=>{const l=V(u[s]);let c=!0;a[o].length<=n.bubbleText.lineLengthMin&&(c=!1),l.call(JE,{text:a[o],radius:a.r*n.bubbleText.fillRate,lineHeight:n.bubbleText.lineHeight,isBreakAll:c})}),i}function YI(){return x0().on("start",(t,e)=>{t.active||Ln.alpha(1).restart(),e.fx=e.x,e.fy=e.y}).on("drag",(t,e)=>{t.active||Ln.alphaTarget(0),e.fx=t.x,e.fy=t.y}).on("end",(t,e)=>{e.fx=null,e.fy=null})}function UI({fullParams:t,SeriesContainerPositionMap:e}){Ln.force("x",s1().strength(t.force.strength).x(n=>e.get(n.seriesLabel).centerX)).force("y",u1().strength(t.force.strength).y(n=>e.get(n.seriesLabel).centerY)),Ln.alpha(1).restart()}function WI({bubblesSelection:t,highlightIds:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1);return}t.each((r,i,o)=>{const a=V(o[i]);e.includes(r.id)?a.style("opacity",1).transition("highlight").ease(no).duration(500):a.style("opacity",n.styles.unhighlightedOpacity)})}const HI=Fn(FI)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt;let o=new Map;const a=n.fullDataFormatter$.pipe(B(f=>f.sumSeries),tt()),s=n.fullParams$.pipe(I(i),B(f=>f.arcScaleType),tt()),u=U({layout:n.layout$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,visibleComputedLayoutData:n.visibleComputedLayoutData$,scaleType:s}).pipe(I(i),W(async f=>f),B(f=>GI({visibleComputedLayoutData:f.visibleComputedLayoutData,LastBubbleDataMap:o,graphicWidth:f.layout.width,graphicHeight:f.layout.height,SeriesContainerPositionMap:f.SeriesContainerPositionMap,scaleType:f.scaleType})),St(1));u.subscribe(f=>{o=new Map(f.map(h=>[h.id,h]))});const l=n.fullChartParams$.pipe(I(i),B(f=>f.highlightTarget),tt()),c=U({bubblesData:u,fullParams:n.fullParams$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,sumSeries:a}).pipe(I(i),W(async f=>f),B(f=>{Ln&&Ln.stop();const h=zI({selection:t,bubblesData:f.bubblesData,fullParams:f.fullParams,sumSeries:f.sumSeries});return Ln=OI(h,f.fullParams),Ln.nodes(f.bubblesData),UI({fullParams:f.fullParams,SeriesContainerPositionMap:f.SeriesContainerPositionMap}),h}));return U({bubblesSelection:c,computedData:n.computedData$,SeriesDataMap:n.SeriesDataMap$,highlightTarget:l}).pipe(I(i),W(async f=>f)).subscribe(f=>{f.bubblesSelection.on("mouseover",(h,p)=>{r.event$.next({type:"series",eventName:"mouseover",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("mousemove",(h,p)=>{r.event$.next({type:"series",eventName:"mousemove",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("mouseout",(h,p)=>{r.event$.next({type:"series",eventName:"mouseout",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("click",(h,p)=>{r.event$.next({type:"series",eventName:"click",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).call(YI())}),U({bubblesSelection:c,bubblesData:u,highlight:n.seriesHighlight$.pipe(B(f=>f.map(h=>h.id))),fullChartParams:n.fullChartParams$,fullParams:n.fullParams$,sumSeries:a,SeriesContainerPositionMap:n.SeriesContainerPositionMap$}).pipe(I(i),W(async f=>f)).subscribe(f=>{WI({bubblesSelection:f.bubblesSelection,highlightIds:f.highlight,fullChartParams:f.fullChartParams})}),()=>{i.next(void 0)}});function C2({data:t,startAngle:e,endAngle:n}){return Yx().startAngle(e).endAngle(n).value(o=>o.value).sort((o,a)=>o.seq-a.seq)(t).map((o,a)=>{let s=o;return s.id=o.data.id,s})}function XI({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r}){const i=ot(e,"series");return U({seriesLabels:r,separateSeries:n}).pipe(W(async o=>o),B((o,a)=>{const s=o.separateSeries?o.seriesLabels:[o.seriesLabels.join("")];return t.selectAll(`g.${i}`).data(s,u=>u).join(u=>u.append("g").classed(i,!0),u=>u,u=>u.remove())}),St(1))}const Ho=({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r,seriesContainerPosition$:i})=>{const o=XI({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r});return U({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(W(async a=>a),tt((a,s)=>a.seriesContainerPosition.length===s.seriesContainerPosition.length)).subscribe(a=>{a.seriesCenterSelection.attr("transform",(s,u)=>{const l=a.seriesContainerPosition[u]??a.seriesContainerPosition[0];return`translate(${l.centerX}, ${l.centerY})`})}),U({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(W(async a=>a)).subscribe(a=>{a.seriesCenterSelection.transition().attr("transform",(s,u)=>{const l=a.seriesContainerPosition[u]??a.seriesContainerPosition[0];return`translate(${l.centerX}, ${l.centerY})`})}),{seriesCenterSelection$:o}},ap="Pie",jI={name:ap,defaultParams:P2,layerIndex:ke,validator:(t,{validateColumns:e})=>e(t,{outerRadius:{toBeTypes:["number"]},innerRadius:{toBeTypes:["number"]},outerRadiusWhileHighlight:{toBeTypes:["number"]},startAngle:{toBeTypes:["number"]},endAngle:{toBeTypes:["number"]},padAngle:{toBeTypes:["number"]},strokeColorType:{toBeTypes:["string"]},strokeWidth:{toBeTypes:["number"]},cornerRadius:{toBeTypes:["number"]}})};function VI({enter:t,exit:e,data:n,lastTweenData:r,fullParams:i}){return!t.size()&&!e.size()?o=>{const a=n.map((s,u)=>{const l=r[u]??{startAngle:0,endAngle:0,value:0};return{...s,startAngle:s.startAngle*o+l.startAngle*(1-o),endAngle:s.endAngle*o+l.endAngle*(1-o),value:s.value*o+l.value*(1-o)}});return sp(a,i.startAngle,i.endAngle,1)}:o=>sp(n,i.startAngle,i.endAngle,o)}function sp(t,e,n,r){return t.map((i,o)=>{const a=e+(i.startAngle-e)*r,s=a+(i.endAngle-i.startAngle)*r;return{...i,startAngle:a,endAngle:s}})}function L2({selection:t,data:e,arc:n,pathClassName:r,fullParams:i,fullChartParams:o}){return t.selectAll("path").data(e,s=>s.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(s,u)=>s.data.color).attr("stroke",(s,u)=>Mn({datum:s.data,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("d",(s,u)=>n(s))}function qI({pathSelection:t,ids:e,fullChartParams:n,arc:r,arcHighlight:i}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1).attr("d",o=>r(o));return}t.each((o,a,s)=>{const u=V(s[a]);e.includes(o.data.id)?u.style("opacity",1).transition("highlight").ease(no).duration(500).attr("d",l=>i(l)):u.style("opacity",n.styles.unhighlightedOpacity).transition("highlight").attr("d",l=>r(l))})}function ZI(t,e){const n=new nt,r=ot(t,"path");let i=[],o=[];const a=e.seriesContainerPosition$.pipe(I(n),B(h=>h.width<h.height?h.width:h.height),tt()),s=new dt(h=>{U({containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p)).subscribe(p=>{const d=C2({data:p.containerVisibleComputedLayoutData,startAngle:p.fullParams.startAngle,endAngle:p.fullParams.endAngle});h.next(d)})}),u=new dt(h=>{U({shorterSideWith:a,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p)).subscribe(p=>{const d=Nu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadius,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});h.next(d)})}),l=new dt(h=>{U({shorterSideWith:a,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p)).subscribe(p=>{const d=Nu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadiusWhileHighlight,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});h.next(d)})}),c=e.fullChartParams$.pipe(I(n),B(h=>h.highlightTarget),tt()),f=new dt(h=>{U({pieData:s,arc:u,computedData:e.computedData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,highlightTarget:c}).pipe(I(n),W(async p=>p)).subscribe(p=>{e.containerSelection.interrupt("graphicMove");const d=e.containerSelection.selectAll("path").data(p.pieData,b=>b.id),g=d.enter(),m=d.exit(),y=VI({enter:g,exit:m,data:p.pieData,lastTweenData:i,fullParams:p.fullParams});e.containerSelection.transition("graphicMove").duration(p.fullChartParams.transitionDuration).tween("move",(b,v)=>x=>{o=y(x),L2({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams})}).on("end",(b,v)=>{o=sp(p.pieData,p.fullParams.startAngle,p.fullParams.endAngle,1);const x=L2({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams});h.next(x),i=Object.assign([],p.pieData),e.event$.next({type:"series",pluginName:t,eventName:"transitionEnd",event:void 0,highlightTarget:p.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",data:p.computedData})})})}).pipe(St(1));return U({pathSelection:f,SeriesDataMap:e.SeriesDataMap$,computedData:e.computedData$,highlightTarget:c}).pipe(I(n),W(async h=>h)).subscribe(h=>{h.pathSelection.on("mouseover",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mouseover",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("mousemove",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mousemove",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("mouseout",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mouseout",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("click",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"click",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})})}),U({pathSelection:f,highlight:e.seriesHighlight$.pipe(B(h=>h.map(p=>p.id))),fullChartParams:e.fullChartParams$,arc:u,arcHighlight:l}).pipe(I(n),W(async h=>h)).subscribe(h=>{qI({pathSelection:h.pathSelection,ids:h.highlight,fullChartParams:h.fullChartParams,arc:h.arc,arcHighlight:h.arcHighlight})}),()=>{n.next(void 0)}}const KI=Fn(jI)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,{seriesCenterSelection$:o}=Ho({selection:t,pluginName:ap,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=V(c[l]),h=r.visibleComputedLayoutData$.pipe(I(i),B(d=>d[l]??d[0])),p=r.seriesContainerPosition$.pipe(I(i),B(d=>d[l]??d[0]));a[l]=ZI(ap,{containerSelection:f,computedData$:r.computedData$,containerVisibleComputedLayoutData$:h,SeriesDataMap$:r.SeriesDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,event$:n.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),zu="PieEventTexts",k2=ot(zu,"text"),QI={name:zu,defaultParams:rp,layerIndex:Oh,validator:(t,{validateColumns:e})=>e(t,{eventFn:{toBeTypes:["Function"]},textAttrs:{toBeTypes:["object[]"]},textStyles:{toBeTypes:["object[]"]}})};function up(t,e){const n=t.selectAll(`text.${k2}`).data(e),r=n.enter().append("text").classed(k2,!0),i=n.merge(r);return i.each((o,a,s)=>{const u=V(s[a]).text(o.text);Object.keys(o.attr).forEach(l=>{u.attr(l,o.attr[l])}),Object.keys(o.style).forEach(l=>{u.style(l,o.style[l])})}),n.exit().remove(),i}function lp({eventData:t,eventName:e,t:n,eventFn:r,textAttrs:i,textStyles:o}){return r(t,e,n).map((s,u)=>({text:s,attr:i[u],style:o[u]}))}function JI(t,e){const n=new nt;let r;const i=e.fullChartParams$.pipe(I(n),B(o=>o.highlightTarget),tt());return U({computedData:e.computedData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,highlightTarget:i}).pipe(I(n),W(async o=>o)).subscribe(o=>{e.containerSelection.transition("move").duration(o.fullChartParams.transitionDuration).tween("move",(a,s)=>u=>{const l=lp({eventData:{type:"series",pluginName:t,eventName:"transitionMove",event:a,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:u,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});up(e.containerSelection,l)}).on("end",(a,s)=>{const u=lp({eventData:{type:"series",pluginName:t,eventName:"transitionEnd",event:a,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:1,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});up(e.containerSelection,u),r&&r.unsubscribe(),r=e.event$.subscribe(l=>{const c=lp({eventData:l,eventName:l.eventName,t:1,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});up(e.containerSelection,c)})})}),()=>{n.next(void 0)}}const tN=Fn(QI)(({selection:t,name:e,observer:n,subject:r})=>{const i=new nt,{seriesCenterSelection$:o}=Ho({selection:t,pluginName:zu,separateSeries$:n.separateSeries$,seriesLabels$:n.seriesLabels$,seriesContainerPosition$:n.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=V(c[l]),h=n.computedLayoutData$.pipe(I(i),B(d=>d[l]??d[0])),p=n.seriesContainerPosition$.pipe(I(i),B(d=>d[l]??d[0]));a[l]=JI(zu,{containerSelection:f,computedData$:n.computedData$,containerComputedLayoutData$:h,SeriesDataMap$:n.SeriesDataMap$,fullParams$:n.fullParams$,fullChartParams$:n.fullChartParams$,seriesHighlight$:n.seriesHighlight$,seriesContainerPosition$:p,event$:r.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),xi="PieLabels",eN=ot(xi,"label-g"),nN=ot(xi,"line-g"),rN=ot(xi,"text"),R2=2,iN={name:xi,defaultParams:ip,layerIndex:Oh,validator:(t,{validateColumns:e})=>e(t,{outerRadius:{toBeTypes:["number"]},outerRadiusWhileHighlight:{toBeTypes:["number"]},startAngle:{toBeTypes:["number"]},endAngle:{toBeTypes:["number"]},labelCentroid:{toBeTypes:["number"]},labelFn:{toBeTypes:["Function"]},labelColorType:{toBeOption:"ColorType"}})};function oN({pieData:t,arc:e,arcMouseover:n,labelCentroid:r,lineStartCentroid:i,fullParams:o}){return t.map((a,s)=>{const[u,l]=e.centroid(a),[c,f]=n.centroid(a),h=o.labelFn(a.data);return{pieDatum:a,arcIndex:s,arcLabels:h.split(`
|
78
|
+
`),lineStartX:u*i,lineStartY:l*i,lineStartMouseoverX:c*i,lineStartMouseoverY:f*i,x:u*r,y:l*r,mouseoverX:c*r,mouseoverY:f*r,textWidth:0,collisionShiftX:0,collisionShiftY:0,quadrant:u>=0&&l<=0?1:u<0&&l<=0?2:u<0&&l>0?3:4}}).filter(a=>a.pieDatum.data.visible)}function aN({labelGSelection:t,data:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=t.selectAll("text").data(e,a=>a.pieDatum.id).join("text").classed(rN,!0).attr("font-weight","bold").attr("text-anchor",a=>a.quadrant==1||a.quadrant==4?"start":"end").style("dominant-baseline",a=>a.quadrant==1||a.quadrant==2?"auto":"hanging").style("cursor",a=>r.highlightTarget&&r.highlightTarget!="none"?"pointer":"none").attr("font-size",r.styles.textSize).attr("x",0).attr("y",0).attr("fill",(a,s)=>Mn({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).each((a,s,u)=>{t2(V(u[s]),{textArr:a.arcLabels,textSizePx:i,quadrant:a.quadrant})});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function sN(t,e,n){const r=t.nodes(),i=n,o=r.map((a,s)=>{const u=a.getBBox(),l=[e[s].x,e[s].y];return{node:a,x:l[0],y:l[1],width:u.width,height:u.height}});for(let a=0;a<o.length;a++){const s=o[a];for(let u=a+1;u<o.length;u++){const l=o[u];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=l.x+e[u].collisionShiftX,p=l.y+e[u].collisionShiftY;if(!(c+s.width/2<h-l.width/2||c-s.width/2>h+l.width/2||f+s.height/2<p-l.height/2||f-s.height/2>p+l.height/2)){if(e[u].quadrant==2){const d=p>f?-i*2:-i;e[u].collisionShiftY+=d}else if(e[u].quadrant==4){const d=p>f?i:i*2;e[u].collisionShiftY+=d}}}}for(let a=o.length-1;a>=0;a--){const s=o[a];for(let u=a-1;u>=0;u--){const l=o[u];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=l.x+e[u].collisionShiftX,p=l.y+e[u].collisionShiftY;if(!(c+s.width/2<h-l.width/2||c-s.width/2>h+l.width/2||f+s.height/2<p-l.height/2||f-s.height/2>p+l.height/2)){if(e[u].quadrant==1){const d=p>f?-i*2:-i;e[u].collisionShiftY+=d}else if(e[u].quadrant==3){const d=p>f?i:i*2;e[u].collisionShiftY+=d}}}}t.data(e).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function uN({lineGSelection:t,data:e,fullParams:n,fullChartParams:r}){const i=e.filter(a=>a.collisionShiftX||a.collisionShiftY),o=t.selectAll("polyline").data(i,a=>a.pieDatum.id).join("polyline").attr("stroke",a=>Mn({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).attr("stroke-width",1).attr("fill","none").attr("points",a=>[[a.lineStartX,a.lineStartY],[a.lineStartX,a.lineStartY]]);return o.transition().attr("points",a=>{let s=a.x+a.collisionShiftX,u=a.y+a.collisionShiftY;return[[s,u],[a.lineStartX,a.lineStartY]]}),o}function lN({textSelection:t,lineSelection:e,ids:n,fullChartParams:r}){if(t.interrupt("highlight"),e.interrupt("highlight"),!n.length){t.transition("highlight").duration(200).attr("transform",i=>`translate(${i.x+i.collisionShiftX},${i.y+i.collisionShiftY})`).style("opacity",1),e.transition("highlight").duration(200).style("opacity",1);return}t.each((i,o,a)=>{const s=V(a[o]);n.includes(i.pieDatum.id)?s.style("opacity",1).transition("highlight").duration(200).attr("transform",u=>u.collisionShiftX||u.collisionShiftY?`translate(${u.x+u.collisionShiftX},${u.y+u.collisionShiftY})`:`translate(${u.mouseoverX+u.collisionShiftX},${u.mouseoverY+u.collisionShiftY})`):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200).attr("transform",u=>`translate(${u.x+u.collisionShiftX},${u.y+u.collisionShiftY})`)}),e.each((i,o,a)=>{const s=V(a[o]);n.includes(i.pieDatum.data.id)?s.style("opacity",1).transition("highlight").duration(200):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function cN(t,e){const n=new nt;e.containerSelection.selectAll("g").remove();const r=e.containerSelection.append("g");r.classed(nN,!0);const i=e.containerSelection.append("g");i.classed(eN,!0);const o=new nt,a=new nt;let s=[];const u=e.seriesContainerPosition$.pipe(I(n),B(c=>c.width<c.height?c.width:c.height),tt()),l=e.fullParams$.pipe(I(n),B(c=>c.labelCentroid>=R2?R2:c.labelCentroid));return U({shorterSideWith:u,containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,textSizePx:e.textSizePx$,lineStartCentroid:l}).pipe(I(n),W(async c=>c)).subscribe(c=>{const f=Nu({axisWidth:c.shorterSideWith,innerRadius:0,outerRadius:c.fullParams.outerRadius,padAngle:0,cornerRadius:0}),h=Nu({axisWidth:c.shorterSideWith,innerRadius:0,outerRadius:c.fullParams.outerRadiusWhileHighlight,padAngle:0,cornerRadius:0}),p=C2({data:c.containerVisibleComputedLayoutData,startAngle:c.fullParams.startAngle,endAngle:c.fullParams.endAngle});s=oN({pieData:p,arc:f,arcMouseover:h,labelCentroid:c.fullParams.labelCentroid,lineStartCentroid:c.lineStartCentroid,fullParams:c.fullParams}),r.selectAll("polyline").remove();const d=aN({labelGSelection:i,data:s,fullParams:c.fullParams,fullChartParams:c.fullChartParams,textSizePx:c.textSizePx});setTimeout(()=>{sN(d,s,c.textSizePx);const g=uN({lineGSelection:r,data:s,fullParams:c.fullParams,fullChartParams:c.fullChartParams});a.next(g)},1e3),o.next(d)}),U({textSelection:o,lineSelection:a,highlight:e.seriesHighlight$.pipe(B(c=>c.map(f=>f.id))),fullChartParams:e.fullChartParams$}).pipe(I(n),W(async c=>c)).subscribe(c=>{lN({textSelection:c.textSelection,lineSelection:c.lineSelection,ids:c.highlight,fullChartParams:c.fullChartParams})}),()=>{n.next(void 0)}}const fN=Fn(iN)(({selection:t,observer:e,subject:n})=>{const r=new nt,{seriesCenterSelection$:i}=Ho({selection:t,pluginName:xi,separateSeries$:e.separateSeries$,seriesLabels$:e.seriesLabels$,seriesContainerPosition$:e.seriesContainerPosition$}),o=[];return i.pipe(I(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,u,l)=>{const c=V(l[u]),f=e.visibleComputedLayoutData$.pipe(I(r),B(p=>p[u]??p[0])),h=e.seriesContainerPosition$.pipe(I(r),B(p=>p[u]??p[0]));o[u]=cN(xi,{containerSelection:c,containerVisibleComputedLayoutData$:f,fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,textSizePx$:e.textSizePx$,seriesHighlight$:e.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),cp="Rose",hN=Math.PI*2,pN={name:cp,defaultParams:M2,layerIndex:ke,validator:(t,{validateColumns:e})=>e(t,{outerRadius:{toBeTypes:["number"]},padAngle:{toBeTypes:["number"]},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},cornerRadius:{toBeTypes:["number"]},arcScaleType:{toBe:'"area" | "radius"',test:r=>r==="area"||r==="radius"},angleIncreaseWhileHighlight:{toBeTypes:["number"]}})};function dN({cornerRadius:t,outerRadius:e,axisWidth:n,maxValue:r,arcScaleType:i,fullParams:o}){const a=n/2*e,s=i==="area"?.5:1,u=li().domain([0,r]).range([0,a]).exponent(s);return l=>{const c=u(l.prevValue),f=u(l.value),h=Ze(c,f);return p=>{const d=h(p);return $u().innerRadius(0).outerRadius(d).padAngle(o.padAngle).padRadius(d).cornerRadius(t)(l)}}}function gN({pathSelection:t,ids:e,fullParams:n,fullChartParams:r,tweenArc:i}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1).attr("d",o=>i(o)(1));return}t.each((o,a,s)=>{const u=V(s[a]);e.includes(o.data.id)?u.style("opacity",1).transition("highlight").ease(no).duration(500).attr("d",l=>i({...l,startAngle:l.startAngle-n.angleIncreaseWhileHighlight,endAngle:l.endAngle+n.angleIncreaseWhileHighlight})(1)):u.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").attr("d",l=>i(l)(1))})}function mN(t,e){const n=new nt,r=ot(t,"path");let i=[];const o=e.seriesContainerPosition$.pipe(I(n),B(p=>p.width<p.height?p.width:p.height),tt()),a=U({containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$}).pipe(I(n),W(async p=>p),B(p=>{const d=hN/p.containerVisibleComputedLayoutData.length;return p.containerVisibleComputedLayoutData.map((g,m)=>({id:g.id,data:g,index:m,value:g.value,startAngle:d*m,endAngle:d*(m+1),padAngle:p.fullParams.padAngle,prevValue:i[m]&&i[m].id===g.id?i[m].value:0}))})),s=e.fullChartParams$.pipe(I(n),B(p=>p.highlightTarget),tt()),u=e.visibleComputedLayoutData$.pipe(B(p=>Math.max(...p.flat().map(d=>d.value))),tt()),l=U({fullParams:e.fullParams$,axisWidth:o,maxValue:u}).pipe(I(n),W(async p=>p),B(p=>dN({cornerRadius:p.fullParams.cornerRadius,outerRadius:p.fullParams.outerRadius,axisWidth:p.axisWidth,maxValue:p.maxValue,arcScaleType:p.fullParams.arcScaleType,fullParams:p.fullParams}))),c=e.fullChartParams$.pipe(I(n),B(p=>p.transitionDuration),tt()),f=new t_(!1),h=new dt(p=>{U({pieData:a,tweenArc:l,transitionDuration:c,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$}).pipe(I(n),W(async d=>d)).subscribe(d=>{const g=d.pieData.map((y,b)=>(y.prevValue=i[b]&&i[b].id===y.id?i[b].value:0,y));f.next(!0);const m=e.containerSelection.selectAll("path").data(g,y=>y.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(y,b)=>y.data.color).attr("stroke",(y,b)=>Mn({datum:y.data,colorType:d.fullParams.strokeColorType,fullChartParams:d.fullChartParams})).attr("stroke-width",d.fullParams.strokeWidth);m.interrupt("graphicMove"),m.transition("graphicMove").duration(d.transitionDuration).attrTween("d",d.tweenArc).on("end",()=>{p.next(m),f.next(!1)}),i=Object.assign([],g)})}).pipe(St(1));return U({pathSelection:h,SeriesDataMap:e.SeriesDataMap$,computedData:e.computedData$,highlightTarget:s}).pipe(I(n),W(async p=>p)).subscribe(p=>{p.pathSelection.on("mouseover",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mouseover",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("mousemove",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mousemove",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("mouseout",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mouseout",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})}).on("click",(d,g)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"click",pluginName:t,highlightTarget:p.highlightTarget,datum:g.data,series:p.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:d,data:p.computedData})})}),U({pathSelection:h,highlight:e.seriesHighlight$.pipe(B(p=>p.map(d=>d.id))),fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,tweenArc:l,isTransitionMoving:f}).pipe(I(n),W(async p=>p),$i(p=>!p.isTransitionMoving)).subscribe(p=>{gN({pathSelection:p.pathSelection,ids:p.highlight,fullParams:p.fullParams,fullChartParams:p.fullChartParams,tweenArc:p.tweenArc})}),()=>{n.next(void 0)}}const yN=Fn(pN)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,{seriesCenterSelection$:o}=Ho({selection:t,pluginName:cp,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(I(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const f=V(c[l]),h=r.visibleComputedLayoutData$.pipe(I(i),B(d=>JSON.parse(JSON.stringify(d[l]??d[0])))),p=r.seriesContainerPosition$.pipe(I(i),B(d=>JSON.parse(JSON.stringify(d[l]??d[0]))));a[l]=mN(cp,{containerSelection:f,computedData$:r.computedData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,containerVisibleComputedLayoutData$:h,SeriesDataMap$:r.SeriesDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,event$:n.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),vi="RoseLabels",bN=ot(vi,"label-g"),xN=ot(vi,"line-g"),vN=ot(vi,"text"),E2=2,_N={name:vi,defaultParams:op,layerIndex:Oh,validator:(t,{validateColumns:e})=>e(t,{outerRadius:{toBeTypes:["number"]},labelCentroid:{toBeTypes:["number"]},labelFn:{toBeTypes:["Function"]},labelColorType:{toBeOption:"ColorType"},arcScaleType:{toBe:'"area" | "radius"',test:r=>r==="area"||r==="radius"}})};function wN({pieData:t,labelCentroid:e,arcScaleType:n,maxValue:r,axisWidth:i,outerRadius:o,lineStartCentroid:a,fullParams:s}){const u=i/2*o,l=n==="area"?.5:1,c=li().domain([0,r]).range([0,u]).exponent(l);return t.map((f,h)=>{const p=c(f.value),d=$u().innerRadius(0).outerRadius(p).padAngle(0).padRadius(p).cornerRadius(0),[g,m]=d.centroid(f),[y,b]=[g,m],v=s.labelFn(f.data);return{pieDatum:f,arcIndex:h,arcLabels:v.split(`
|
79
|
+
`),lineStartX:g*a,lineStartY:m*a,lineStartMouseoverX:y*a,lineStartMouseoverY:b*a,x:g*e,y:m*e,mouseoverX:y*e,mouseoverY:b*e,textWidth:0,collisionShiftX:0,collisionShiftY:0,quadrant:g>=0&&m<=0?1:g<0&&m<=0?2:g<0&&m>0?3:4}}).filter(f=>f.pieDatum.data.visible)}function $N({labelGSelection:t,data:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=t.selectAll("text").data(e,a=>a.pieDatum.id).join("text").classed(vN,!0).attr("font-weight","bold").attr("text-anchor",a=>a.quadrant==1||a.quadrant==4?"start":"end").style("dominant-baseline",a=>a.quadrant==1||a.quadrant==2?"auto":"hanging").style("cursor",a=>r.highlightTarget&&r.highlightTarget!="none"?"pointer":"none").attr("font-size",r.styles.textSize).attr("fill",(a,s)=>Mn({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).each((a,s,u)=>{t2(V(u[s]),{textArr:a.arcLabels,textSizePx:i,quadrant:a.quadrant})});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function SN(t,e,n){const r=t.nodes(),i=n,o=r.map((a,s)=>{const u=a.getBBox(),l=[e[s].x,e[s].y];return{node:a,x:l[0],y:l[1],width:u.width,height:u.height}});for(let a=0;a<o.length;a++){const s=o[a];for(let u=a+1;u<o.length;u++){const l=o[u];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=l.x+e[u].collisionShiftX,p=l.y+e[u].collisionShiftY;if(!(c+s.width/2<h-l.width/2||c-s.width/2>h+l.width/2||f+s.height/2<p-l.height/2||f-s.height/2>p+l.height/2)){if(e[u].quadrant==2){const d=p>f?-i*2:-i;e[u].collisionShiftY+=d}else if(e[u].quadrant==4){const d=p>f?i:i*2;e[u].collisionShiftY+=d}}}}for(let a=o.length-1;a>=0;a--){const s=o[a];for(let u=a-1;u>=0;u--){const l=o[u];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=l.x+e[u].collisionShiftX,p=l.y+e[u].collisionShiftY;if(!(c+s.width/2<h-l.width/2||c-s.width/2>h+l.width/2||f+s.height/2<p-l.height/2||f-s.height/2>p+l.height/2)){if(e[u].quadrant==1){const d=p>f?-i*2:-i;e[u].collisionShiftY+=d}else if(e[u].quadrant==3){const d=p>f?i:i*2;e[u].collisionShiftY+=d}}}}t.data(e).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function AN({lineGSelection:t,data:e,fullParams:n,fullChartParams:r}){const i=e.filter(a=>a.collisionShiftX||a.collisionShiftY),o=t.selectAll("polyline").data(i,a=>a.pieDatum.id).join("polyline").attr("stroke",a=>Mn({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).attr("stroke-width",1).attr("fill","none").attr("points",a=>[[a.lineStartX,a.lineStartY],[a.lineStartX,a.lineStartY]]);return o.transition().attr("points",a=>{let s=a.x+a.collisionShiftX,u=a.y+a.collisionShiftY;return[[s,u],[a.lineStartX,a.lineStartY]]}),o}function TN({textSelection:t,lineSelection:e,ids:n,fullChartParams:r}){if(t.interrupt("highlight"),e.interrupt("highlight"),!n.length){t.transition("highlight").duration(200).attr("transform",i=>`translate(${i.x+i.collisionShiftX},${i.y+i.collisionShiftY})`).style("opacity",1),e.transition("highlight").duration(200).style("opacity",1);return}t.each((i,o,a)=>{const s=V(a[o]);n.includes(i.pieDatum.data.id)?s.style("opacity",1).transition("highlight").duration(200).attr("transform",u=>`translate(${u.mouseoverX+u.collisionShiftX},${u.mouseoverY+u.collisionShiftY})`):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200).attr("transform",u=>`translate(${u.x+u.collisionShiftX},${u.y+u.collisionShiftY})`)}),e.each((i,o,a)=>{const s=V(a[o]);n.includes(i.pieDatum.data.id)?s.style("opacity",1).transition("highlight").duration(200):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function PN(t,e){const n=new nt;e.containerSelection.selectAll("g").remove();const r=e.containerSelection.append("g");r.classed(xN,!0);const i=e.containerSelection.append("g");i.classed(bN,!0);const o=new nt,a=new nt;let s=[];const u=e.seriesContainerPosition$.pipe(I(n),B(f=>f.width<f.height?f.width:f.height),tt()),l=e.visibleComputedLayoutData$.pipe(B(f=>Math.max(...f.flat().map(h=>h.value))),tt()),c=e.fullParams$.pipe(I(n),B(f=>f.labelCentroid>=E2?E2:f.labelCentroid));return U({shorterSideWith:u,containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,maxValue:l,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,textSizePx:e.textSizePx$,lineStartCentroid:c}).pipe(I(n),W(async f=>f)).subscribe(f=>{const h=Math.PI*2/f.containerVisibleComputedLayoutData.length,p=f.containerVisibleComputedLayoutData.map((g,m)=>({id:g.id,data:g,index:m,value:g.value,startAngle:h*m,endAngle:h*(m+1),padAngle:0}));s=wN({pieData:p,labelCentroid:f.fullParams.labelCentroid,arcScaleType:f.fullParams.arcScaleType,maxValue:f.maxValue,axisWidth:f.shorterSideWith,outerRadius:f.fullParams.outerRadius,lineStartCentroid:f.lineStartCentroid,fullParams:f.fullParams}),r.selectAll("polyline").remove();const d=$N({labelGSelection:i,data:s,fullParams:f.fullParams,fullChartParams:f.fullChartParams,textSizePx:f.textSizePx});setTimeout(()=>{SN(d,s,f.textSizePx);const g=AN({lineGSelection:r,data:s,fullParams:f.fullParams,fullChartParams:f.fullChartParams});a.next(g)},1e3),o.next(d)}),U({textSelection:o,lineSelection:a,highlight:e.seriesHighlight$.pipe(B(f=>f.map(h=>h.id))),fullChartParams:e.fullChartParams$}).pipe(I(n),W(async f=>f)).subscribe(f=>{TN({textSelection:f.textSelection,lineSelection:f.lineSelection,ids:f.highlight,fullChartParams:f.fullChartParams})}),()=>{n.next(void 0)}}const MN=Fn(_N)(({selection:t,observer:e,subject:n})=>{const r=new nt,{seriesCenterSelection$:i}=Ho({selection:t,pluginName:vi,separateSeries$:e.separateSeries$,seriesLabels$:e.seriesLabels$,seriesContainerPosition$:e.seriesContainerPosition$}),o=[];return i.pipe(I(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,u,l)=>{const c=V(l[u]),f=e.visibleComputedLayoutData$.pipe(I(r),B(p=>JSON.parse(JSON.stringify(p[u]??p[0])))),h=e.seriesContainerPosition$.pipe(I(r),B(p=>JSON.parse(JSON.stringify(p[u]??p[0]))));o[u]=PN(vi,{containerSelection:c,visibleComputedLayoutData$:e.visibleComputedLayoutData$,containerVisibleComputedLayoutData$:f,fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,textSizePx$:e.textSizePx$,seriesHighlight$:e.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),I2="SeriesLegend",DN=Fn({name:I2,defaultParams:D2,layerIndex:Bu,validator:(t,{validateColumns:e})=>e(t,{padding:{toBeTypes:["number"]},backgroundFill:{toBeOption:"ColorType"},backgroundStroke:{toBeOption:"ColorType"},gap:{toBeTypes:["number"]},listRectWidth:{toBeTypes:["number"]},listRectHeight:{toBeTypes:["number"]},listRectRadius:{toBeTypes:["number"]},textColorType:{toBeOption:"ColorType"}})})(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new nt,o=n.SeriesDataMap$.pipe(I(i),B(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),B(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Fu(I2,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),fp={paddingInner:2,paddingOuter:2,labelColorType:"primary",squarifyRatio:1.618034,sort:(t,e)=>e.value-t.value};fp.sort.toString=()=>"(a, b) => b.value - a.value";const N2={position:"right",justify:"end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},B2="TreeLegend",CN=Lg({name:B2,defaultParams:N2,layerIndex:Bu,validator:(t,{validateColumns:e})=>e(t,{padding:{toBeTypes:["number"]},backgroundFill:{toBeOption:"ColorType"},backgroundStroke:{toBeOption:"ColorType"},gap:{toBeTypes:["number"]},listRectWidth:{toBeTypes:["number"]},listRectHeight:{toBeTypes:["number"]},listRectRadius:{toBeTypes:["number"]},textColorType:{toBeOption:"ColorType"}})})(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new nt,o=n.CategoryDataMap$.pipe(I(i),B(u=>Array.from(u.keys()))),a=n.fullParams$.pipe(I(i),B(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,seriesList:l}})),s=Fu(B2,{rootSelection:e,seriesLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),dr="TreeMap",F2=ot(dr,"tree"),O2=ot(dr,"tile"),LN={name:dr,defaultParams:fp,layerIndex:ke,validator:(t,{validateColumns:e})=>e(t,{paddingInner:{toBeTypes:["number"]},paddingOuter:{toBeTypes:["number"]},labelColorType:{toBeOption:"ColorType"},squarifyRatio:{toBeTypes:["number"]},sort:{toBeTypes:["Function"]}})};function kN({selection:t,treeData:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=i/2,a=i,s=t.selectAll(`g.${F2}`).data(e,u=>u.data.id).join("g").attr("class",F2);return s.attr("transform",u=>!u.x0||!u.y0?null:`translate(${u.x0},${u.y0})`).each((u,l,c)=>{const f=V(c[l]);f.selectAll(`rect.${O2}`).data([u],h=>h.data.id).join("rect").attr("id",h=>h.data.id).attr("class",O2).attr("cursor","pointer").attr("width",h=>h.x1-h.x0).attr("height",h=>h.y1-h.y0).attr("fill",h=>h.data.color).attr("data-name",h=>h.data.label).attr("data-category",h=>h.data.categoryLabel).attr("data-value",h=>h.data.value),f.selectAll("g").data([u]).join("g").each((h,p,d)=>{V(d[p]).selectAll("text").data([h]).join("text").text(m=>m.data.label).attr("dominant-baseline","hanging").attr("x",o).attr("y",o).attr("font-size",r.styles.textSize).each(function(m){const y=V(this),b=m.data.label.split(/\s+/).reverse();let v,x=[];const S=y.attr("x");let $=y.attr("y"),R=0,T=y.text(null).append("tspan").attr("cursor","pointer").attr("fill",kt(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",S).attr("y",$);for(;v=b.pop();)x.push(v),T.text(x.join(" ")),T.node().getComputedTextLength()>m.x1-m.x0-o&&(x.pop(),T.text(x.join(" ")),x=[v],R+=a,T=y.append("tspan").attr("cursor","pointer").attr("fill",kt(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",S).attr("y",$).attr("dy",R+"px").text(v))})})}),s}function RN({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{e.includes(r.data.id)?V(o[i]).style("opacity",1):V(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const EN=Lg(LN)(({selection:t,name:e,subject:n,observer:r})=>{const i=new nt,o=U({layout:r.layout$,visibleComputedData:r.visibleComputedData$,fullParams:r.fullParams$,fullDataFormatter:r.fullDataFormatter$,fullChartParams:r.fullChartParams$}).pipe(I(i),W(async u=>u),B(u=>{const l=Qy().size([u.layout.width,u.layout.height]).paddingInner(u.fullParams.paddingInner).paddingOuter(u.fullParams.paddingOuter).round(!0).tile(Qf.ratio(u.fullParams.squarifyRatio)),c=eu(u.visibleComputedData).sum(h=>h.value).sort(u.fullParams.sort);return l(c),c.leaves()})),a=U({selection:Qo(t),treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,textSizePx:r.textSizePx$}).pipe(I(i),W(async u=>u),B(u=>kN({selection:t,treeData:u.treeData,fullParams:u.fullParams,fullChartParams:u.fullChartParams,textSizePx:u.textSizePx}))),s=r.fullChartParams$.pipe(I(i),B(u=>u.highlightTarget),tt());return U({cellSelection:a,computedData:r.computedData$,treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,highlightTarget:s,CategoryDataMap:r.CategoryDataMap$}).pipe(I(i),W(async u=>u)).subscribe(u=>{u.cellSelection.on("mouseover",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseover",pluginName:dr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("mousemove",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mousemove",pluginName:dr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("mouseout",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseout",pluginName:dr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})}).on("click",(l,c)=>{l.stopPropagation(),n.event$.next({type:"tree",eventName:"click",pluginName:dr,highlightTarget:u.highlightTarget,datum:c.data,category:u.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:l,data:u.computedData})})}),U({cellSelection:a,highlight:r.treeHighlight$.pipe(B(u=>u.map(l=>l.id))),fullChartParams:r.fullChartParams$}).pipe(I(i),W(async u=>u)).subscribe(u=>{RN({selection:u.cellSelection,ids:u.highlight,fullChartParams:u.fullChartParams})}),()=>{i.next(void 0)}});K.BarStack=FE,K.Bars=CE,K.BarsPN=LE,K.BarsTriangle=XE,K.Bubbles=HI,K.CONTAINER_PLUGIN_PARAMS=kI,K.DEFAULT_BARS_DIVERGING_PARAMS=G2,K.DEFAULT_BARS_PARAMS=jo,K.DEFAULT_BARS_TRIANGLE_PARAMS=gp,K.DEFAULT_BAR_STACK_PARAMS=dp,K.DEFAULT_BUBBLES_PARAMS=T2,K.DEFAULT_DOTS_PARAMS=pp,K.DEFAULT_GRID_LEGEND_PARAMS=bp,K.DEFAULT_GROUP_AREA_PARAMS=Yu,K.DEFAULT_GROUP_AXIS_PARAMS=Uu,K.DEFAULT_LINES_PARAMS=gr,K.DEFAULT_LINE_AREAS_PARAMS=hp,K.DEFAULT_MULTI_BARS_PARAMS=a2,K.DEFAULT_MULTI_BARS_TRIANGLE_PARAMS=u2,K.DEFAULT_MULTI_BAR_STACK_PARAMS=s2,K.DEFAULT_MULTI_DOTS_PARAMS=f2,K.DEFAULT_MULTI_GRID_LEGEND_PARAMS=o2,K.DEFAULT_MULTI_GROUP_AXIS_PARAMS=Yh,K.DEFAULT_MULTI_LINES_PARAMS=l2,K.DEFAULT_MULTI_LINE_AREAS_PARAMS=c2,K.DEFAULT_MULTI_VALUE_AXIS_PARAMS=Gu,K.DEFAULT_MULTI_VALUE_STACK_AXIS_PARAMS=xI,K.DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS=Uh,K.DEFAULT_OVERLAPPING_VALUE_STACK_AXES_PARAMS=h2,K.DEFAULT_PIE_EVENT_TEXTS_PARAMS=rp,K.DEFAULT_PIE_LABELS_PARAMS=ip,K.DEFAULT_PIE_PARAMS=P2,K.DEFAULT_ROSE_LABELS_PARAMS=op,K.DEFAULT_ROSE_PARAMS=M2,K.DEFAULT_SCALING_AREA_PARAMS=yp,K.DEFAULT_SERIES_LEGEND_PARAMS=D2,K.DEFAULT_TREE_LEGEND_PARAMS=N2,K.DEFAULT_TREE_MAP_PARAMS=fp,K.DEFAULT_VALUE_AXIS_PARAMS=Wu,K.DEFAULT_VALUE_STACK_AXIS_PARAMS=mp,K.Dots=ZE,K.GridLegend=QE,K.GroupAux=bI,K.GroupAxis=iI,K.LineAreas=$E,K.Lines=mE,K.MultiBarStack=wI,K.MultiBars=_I,K.MultiBarsTriangle=$I,K.MultiDots=TI,K.MultiGridLegend=vI,K.MultiGroupAxis=PI,K.MultiLineAreas=AI,K.MultiLines=SI,K.MultiValueAxis=MI,K.MultiValueStackAxis=DI,K.OverlappingValueAxes=CI,K.OverlappingValueStackAxes=LI,K.Pie=KI,K.PieEventTexts=tN,K.PieLabels=fN,K.Rose=yN,K.RoseLabels=MN,K.ScalingArea=cI,K.SeriesLegend=DN,K.TOOLTIP_PARAMS=ep,K.Tooltip=BI,K.TreeLegend=CN,K.TreeMap=EN,K.ValueAxis=uI,K.ValueStackAxis=lI,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});
|
@@ -19,6 +19,6 @@ export type TooltipParams = {
|
|
19
19
|
textColorType: ColorType;
|
20
20
|
offset: [number, number];
|
21
21
|
padding: number;
|
22
|
-
textRenderFn: <T extends ChartType>(eventData: EventTypeMap<T>) => string[] | string | null;
|
22
|
+
textRenderFn: (<T extends ChartType>(eventData: EventTypeMap<T>) => string[] | string) | null;
|
23
23
|
svgRenderFn: (<T extends ChartType>(eventData: EventTypeMap<T>) => string) | null;
|
24
24
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orbcharts/plugins-basic",
|
3
|
-
"version": "3.0.0-alpha.
|
3
|
+
"version": "3.0.0-alpha.73",
|
4
4
|
"description": "plugins for OrbCharts",
|
5
5
|
"author": "Blue Planet Inc.",
|
6
6
|
"license": "Apache-2.0",
|
@@ -35,7 +35,7 @@
|
|
35
35
|
"vite-plugin-dts": "^3.7.3"
|
36
36
|
},
|
37
37
|
"dependencies": {
|
38
|
-
"@orbcharts/core": "^3.0.0-alpha.
|
38
|
+
"@orbcharts/core": "^3.0.0-alpha.65",
|
39
39
|
"@orbcharts/core-types": "^3.0.0-alpha.3",
|
40
40
|
"d3": "^7.8.5",
|
41
41
|
"rxjs": "^7.8.1"
|
@@ -35,6 +35,48 @@ const pluginName = 'Tooltip'
|
|
35
35
|
const gClassName = getClassName(pluginName, 'g')
|
36
36
|
const boxClassName = getClassName(pluginName, 'box')
|
37
37
|
|
38
|
+
const pluginConfig: DefinePluginConfig<typeof pluginName, typeof TOOLTIP_PARAMS> = {
|
39
|
+
name: pluginName,
|
40
|
+
defaultParams: TOOLTIP_PARAMS,
|
41
|
+
layerIndex: LAYER_INDEX_OF_TOOLTIP,
|
42
|
+
validator: (params, { validateColumns }) => {
|
43
|
+
const result = validateColumns(params, {
|
44
|
+
backgroundColorType: {
|
45
|
+
toBeOption: 'ColorType',
|
46
|
+
},
|
47
|
+
backgroundOpacity: {
|
48
|
+
toBeTypes: ['number']
|
49
|
+
},
|
50
|
+
strokeColorType: {
|
51
|
+
toBeOption: 'ColorType',
|
52
|
+
},
|
53
|
+
offset: {
|
54
|
+
toBe: '[number, number]',
|
55
|
+
test: (value: any) => {
|
56
|
+
return Array.isArray(value)
|
57
|
+
&& value.length === 2
|
58
|
+
&& typeof value[0] === 'number'
|
59
|
+
&& typeof value[1] === 'number'
|
60
|
+
}
|
61
|
+
},
|
62
|
+
padding: {
|
63
|
+
toBeTypes: ['number']
|
64
|
+
},
|
65
|
+
textColorType: {
|
66
|
+
toBeOption: 'ColorType',
|
67
|
+
},
|
68
|
+
textRenderFn: {
|
69
|
+
toBeTypes: ['Function', 'null']
|
70
|
+
},
|
71
|
+
svgRenderFn: {
|
72
|
+
toBeTypes: ['Function', 'null']
|
73
|
+
}
|
74
|
+
})
|
75
|
+
return result
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
|
38
80
|
function textToSvg (_textArr: string[] | string | null | undefined, textStyle: TooltipStyle) {
|
39
81
|
const lineHeight = textStyle.textSizePx * 1.5
|
40
82
|
|
@@ -206,46 +248,6 @@ function renderTooltip ({ rootSelection, pluginName, rootWidth, rootHeight, svgS
|
|
206
248
|
|
207
249
|
}
|
208
250
|
|
209
|
-
const pluginConfig: DefinePluginConfig<typeof pluginName, typeof TOOLTIP_PARAMS> = {
|
210
|
-
name: pluginName,
|
211
|
-
defaultParams: TOOLTIP_PARAMS,
|
212
|
-
layerIndex: LAYER_INDEX_OF_TOOLTIP,
|
213
|
-
validator: (params, { validateColumns }) => {
|
214
|
-
const result = validateColumns(params, {
|
215
|
-
backgroundColorType: {
|
216
|
-
toBeOption: 'ColorType',
|
217
|
-
},
|
218
|
-
backgroundOpacity: {
|
219
|
-
toBeTypes: ['number']
|
220
|
-
},
|
221
|
-
strokeColorType: {
|
222
|
-
toBeOption: 'ColorType',
|
223
|
-
},
|
224
|
-
offset: {
|
225
|
-
toBe: '[number, number]',
|
226
|
-
test: (value: any) => {
|
227
|
-
return Array.isArray(value)
|
228
|
-
&& value.length === 2
|
229
|
-
&& typeof value[0] === 'number'
|
230
|
-
&& typeof value[1] === 'number'
|
231
|
-
}
|
232
|
-
},
|
233
|
-
padding: {
|
234
|
-
toBeTypes: ['number']
|
235
|
-
},
|
236
|
-
textColorType: {
|
237
|
-
toBeOption: 'ColorType',
|
238
|
-
},
|
239
|
-
textRenderFn: {
|
240
|
-
toBeTypes: ['Function']
|
241
|
-
},
|
242
|
-
svgRenderFn: {
|
243
|
-
toBeTypes: ['Function']
|
244
|
-
}
|
245
|
-
})
|
246
|
-
return result
|
247
|
-
}
|
248
|
-
}
|
249
251
|
|
250
252
|
export const Tooltip = defineNoneDataPlugin(pluginConfig)(({ selection, rootSelection, name, chartType, observer, subject }) => {
|
251
253
|
const destroy$ = new Subject()
|
@@ -299,7 +301,9 @@ export const Tooltip = defineNoneDataPlugin(pluginConfig)(({ selection, rootSele
|
|
299
301
|
}
|
300
302
|
// 將textRenderFn回傳的資料使用<text>包裝起來
|
301
303
|
return (eventData: EventTypeMap<any>) => {
|
302
|
-
const textArr = data.fullParams.textRenderFn
|
304
|
+
const textArr: string | string[] | null = data.fullParams.textRenderFn
|
305
|
+
? data.fullParams.textRenderFn(eventData as any)
|
306
|
+
: null
|
303
307
|
return textToSvg(textArr, data.tooltipStyle)
|
304
308
|
}
|
305
309
|
})
|
package/src/noneData/types.ts
CHANGED
@@ -20,7 +20,7 @@ export type TooltipParams = {
|
|
20
20
|
textColorType: ColorType
|
21
21
|
offset: [number, number]
|
22
22
|
padding: number
|
23
|
-
textRenderFn: <T extends ChartType>
|
24
|
-
svgRenderFn: (<T extends ChartType>
|
23
|
+
textRenderFn: (<T extends ChartType>(eventData: EventTypeMap<T>) => string[] | string) | null
|
24
|
+
svgRenderFn: (<T extends ChartType>(eventData: EventTypeMap<T>) => string) | null
|
25
25
|
}
|
26
26
|
|