@orbcharts/plugins-basic 3.0.3 → 3.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/LICENSE +200 -200
  2. package/dist/orbcharts-plugins-basic.es.js +2486 -2453
  3. package/dist/orbcharts-plugins-basic.umd.js +44 -44
  4. package/dist/src/series/seriesObservables.d.ts +5 -7
  5. package/lib/core-types.ts +7 -7
  6. package/lib/core.ts +6 -6
  7. package/lib/gridObservables.ts +6 -6
  8. package/lib/plugins-basic-types.ts +6 -6
  9. package/package.json +48 -48
  10. package/src/base/BaseBars.ts +765 -765
  11. package/src/base/BaseBarsTriangle.ts +676 -676
  12. package/src/base/BaseDots.ts +464 -464
  13. package/src/base/BaseGroupAxis.ts +691 -691
  14. package/src/base/BaseLegend.ts +684 -684
  15. package/src/base/BaseLineAreas.ts +629 -629
  16. package/src/base/BaseLines.ts +706 -706
  17. package/src/base/BaseOrdinalBubbles.ts +729 -727
  18. package/src/base/BaseRacingBars.ts +582 -582
  19. package/src/base/BaseRacingLabels.ts +404 -404
  20. package/src/base/BaseRacingValueLabels.ts +403 -403
  21. package/src/base/BaseStackedBars.ts +782 -782
  22. package/src/base/BaseTooltip.ts +386 -386
  23. package/src/base/BaseValueAxis.ts +600 -600
  24. package/src/base/BaseXAxis.ts +427 -427
  25. package/src/base/BaseXZoom.ts +241 -241
  26. package/src/base/BaseYAxis.ts +389 -389
  27. package/src/base/types.ts +2 -2
  28. package/src/const.ts +30 -30
  29. package/src/grid/defaults.ts +213 -213
  30. package/src/grid/gridObservables.ts +635 -635
  31. package/src/grid/index.ts +16 -16
  32. package/src/grid/plugins/Bars.ts +69 -69
  33. package/src/grid/plugins/BarsPN.ts +66 -66
  34. package/src/grid/plugins/BarsTriangle.ts +73 -73
  35. package/src/grid/plugins/Dots.ts +68 -68
  36. package/src/grid/plugins/GridLegend.ts +107 -107
  37. package/src/grid/plugins/GridTooltip.ts +66 -66
  38. package/src/grid/plugins/GroupAux.ts +1095 -1095
  39. package/src/grid/plugins/GroupAxis.ts +73 -73
  40. package/src/grid/plugins/GroupZoom.ts +218 -218
  41. package/src/grid/plugins/LineAreas.ts +65 -65
  42. package/src/grid/plugins/Lines.ts +59 -59
  43. package/src/grid/plugins/StackedBars.ts +64 -64
  44. package/src/grid/plugins/StackedValueAxis.ts +96 -96
  45. package/src/grid/plugins/ValueAxis.ts +94 -94
  46. package/src/index.ts +6 -6
  47. package/src/multiGrid/defaults.ts +244 -244
  48. package/src/multiGrid/index.ts +14 -14
  49. package/src/multiGrid/multiGridObservables.ts +50 -50
  50. package/src/multiGrid/plugins/MultiBars.ts +108 -108
  51. package/src/multiGrid/plugins/MultiBarsTriangle.ts +114 -114
  52. package/src/multiGrid/plugins/MultiDots.ts +102 -102
  53. package/src/multiGrid/plugins/MultiGridLegend.ts +169 -169
  54. package/src/multiGrid/plugins/MultiGridTooltip.ts +66 -66
  55. package/src/multiGrid/plugins/MultiGroupAxis.ts +137 -137
  56. package/src/multiGrid/plugins/MultiLineAreas.ts +107 -107
  57. package/src/multiGrid/plugins/MultiLines.ts +101 -101
  58. package/src/multiGrid/plugins/MultiStackedBars.ts +106 -106
  59. package/src/multiGrid/plugins/MultiStackedValueAxis.ts +134 -134
  60. package/src/multiGrid/plugins/MultiValueAxis.ts +134 -134
  61. package/src/multiGrid/plugins/OverlappingStackedValueAxes.ts +300 -300
  62. package/src/multiGrid/plugins/OverlappingValueAxes.ts +300 -300
  63. package/src/multiValue/defaults.ts +523 -523
  64. package/src/multiValue/index.ts +16 -16
  65. package/src/multiValue/multiValueObservables.ts +781 -781
  66. package/src/multiValue/plugins/MultiValueLegend.ts +107 -107
  67. package/src/multiValue/plugins/MultiValueTooltip.ts +66 -66
  68. package/src/multiValue/plugins/OrdinalAux.ts +660 -660
  69. package/src/multiValue/plugins/OrdinalAxis.ts +524 -524
  70. package/src/multiValue/plugins/OrdinalBubbles.ts +226 -226
  71. package/src/multiValue/plugins/OrdinalZoom.ts +57 -57
  72. package/src/multiValue/plugins/RacingBars.ts +375 -375
  73. package/src/multiValue/plugins/RacingCounterTexts.ts +300 -300
  74. package/src/multiValue/plugins/RacingValueAxis.ts +114 -114
  75. package/src/multiValue/plugins/Scatter.ts +486 -486
  76. package/src/multiValue/plugins/ScatterBubbles.ts +635 -635
  77. package/src/multiValue/plugins/XAxis.ts +107 -107
  78. package/src/multiValue/plugins/XYAux.ts +683 -683
  79. package/src/multiValue/plugins/XYAxes.ts +194 -194
  80. package/src/multiValue/plugins/XYAxes_legacy.ts +683 -683
  81. package/src/multiValue/plugins/XZoom.ts +40 -40
  82. package/src/noneData/defaults.ts +102 -102
  83. package/src/noneData/index.ts +3 -3
  84. package/src/noneData/plugins/Container.ts +27 -27
  85. package/src/noneData/plugins/Tooltip.ts +373 -373
  86. package/src/relationship/defaults.ts +221 -221
  87. package/src/relationship/index.ts +5 -5
  88. package/src/relationship/plugins/ForceDirected.ts +1056 -1173
  89. package/src/relationship/plugins/ForceDirectedBubbles.ts +1294 -1411
  90. package/src/relationship/plugins/RelationshipLegend.ts +100 -100
  91. package/src/relationship/plugins/RelationshipTooltip.ts +66 -66
  92. package/src/relationship/relationshipObservables.ts +49 -49
  93. package/src/series/defaults.ts +222 -221
  94. package/src/series/index.ts +9 -9
  95. package/src/series/plugins/Bubbles.ts +766 -636
  96. package/src/series/plugins/Pie.ts +622 -623
  97. package/src/series/plugins/PieEventTexts.ts +283 -284
  98. package/src/series/plugins/PieLabels.ts +639 -640
  99. package/src/series/plugins/Rose.ts +515 -516
  100. package/src/series/plugins/RoseLabels.ts +599 -600
  101. package/src/series/plugins/SeriesLegend.ts +107 -107
  102. package/src/series/plugins/SeriesTooltip.ts +66 -66
  103. package/src/series/seriesObservables.ts +168 -145
  104. package/src/series/seriesUtils.ts +51 -51
  105. package/src/tree/defaults.ts +102 -102
  106. package/src/tree/index.ts +4 -4
  107. package/src/tree/plugins/TreeLegend.ts +100 -100
  108. package/src/tree/plugins/TreeMap.ts +341 -341
  109. package/src/tree/plugins/TreeTooltip.ts +66 -66
  110. package/src/utils/commonUtils.ts +31 -31
  111. package/src/utils/d3Graphics.ts +176 -176
  112. package/src/utils/d3Utils.ts +92 -92
  113. package/src/utils/observables.ts +14 -14
  114. package/src/utils/orbchartsUtils.ts +129 -129
  115. package/tsconfig.base.json +13 -13
  116. package/tsconfig.json +2 -2
  117. package/vite.config.js +22 -22
@@ -1,14 +1,14 @@
1
- (function(U,Lr){typeof exports=="object"&&typeof module<"u"?Lr(exports):typeof define=="function"&&define.amd?define(["exports"],Lr):(U=typeof globalThis<"u"?globalThis:U||self,Lr(U["orbcharts-plugins-basic"]={}))})(this,function(U){"use strict";const Lr={lineCurve:"curveLinear",lineWidth:2},Tg={lineCurve:"curveLinear",linearGradientOpacity:[1,0]},_g={radius:4,fillColorType:"background",strokeColorType:"label",strokeWidth:2,onlyShowHighlighted:!1},Au={showLine:!0,showLabel:!0,lineDashArray:"3, 3",lineColorType:"primary",labelColorType:"primary",labelTextColorType:"background",labelTextFormat:e=>e,labelPadding:20,labelRotate:0};Au.labelTextFormat.toString=()=>"text => text";const Sa={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1},d2={...Sa},Ag={barWidth:0,barGroupPadding:10,barRadius:!1},wg={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0]},wu={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!0,axisLineColorType:"primary",ticks:"all",tickFormat:e=>e,tickLineVisible:!0,tickPadding:20,tickFullLine:!1,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"};wu.tickFormat.toString=()=>"text => text";const Ta={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:null,tickFormat:e=>{if(e===null||Number.isNaN(e)==!0)return e||0;const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")},tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"};Ta.tickFormat.toString=()=>`num => {
1
+ (function(U,Lr){typeof exports=="object"&&typeof module<"u"?Lr(exports):typeof define=="function"&&define.amd?define(["exports"],Lr):(U=typeof globalThis<"u"?globalThis:U||self,Lr(U["orbcharts-plugins-basic"]={}))})(this,function(U){"use strict";const Lr={lineCurve:"curveLinear",lineWidth:2},Tg={lineCurve:"curveLinear",linearGradientOpacity:[1,0]},_g={radius:4,fillColorType:"background",strokeColorType:"label",strokeWidth:2,onlyShowHighlighted:!1},Au={showLine:!0,showLabel:!0,lineDashArray:"3, 3",lineColorType:"primary",labelColorType:"primary",labelTextColorType:"background",labelTextFormat:e=>e,labelPadding:20,labelRotate:0};Au.labelTextFormat.toString=()=>"text => text";const Sa={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1},dS={...Sa},Ag={barWidth:0,barGroupPadding:10,barRadius:!1},wg={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0]},wu={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!0,axisLineColorType:"primary",ticks:"all",tickFormat:e=>e,tickLineVisible:!0,tickPadding:20,tickFullLine:!1,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"};wu.tickFormat.toString=()=>"text => text";const Ta={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:null,tickFormat:e=>{if(e===null||Number.isNaN(e)==!0)return e||0;const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")},tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"};Ta.tickFormat.toString=()=>`num => {
2
2
  if (num === null || Number.isNaN(num) == true) {
3
3
  return num || 0
4
4
  }
5
5
  const parts = num.toString().split('.')
6
6
  parts[0] = parts[0].replace(/B(?=(d{3})+(?!d))/g, ',')
7
7
  return parts.join('.')
8
- }`;const Pg={...Ta},Dg={},Cg={placement:"bottom",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},Pu={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(e,{styles:t,utils:n})=>{const r=t.textSizePx*.7,i=t.textSizePx/2-r/2,o=`<g><text dominant-baseline="hanging" font-size="${t.textSizePx}" fill="${t.textColor}">${e.groupLabel}</text></g>`,a=n.measureTextWidth(e.groupLabel,t.textSizePx),s=e.group.reduce((h,f)=>{const p=`${f.seriesLabel}${n.toCurrency(f.value)}`,g=n.measureTextWidth(p,t.textSizePx);return g>h?g:h},0),u=Math.max(a,s)+t.textSizePx*3,c=e.group.map((h,f)=>{const p=f*t.textSizePx*1.5,g=h.id===(e.datum&&e.datum.id);return`<g transform="translate(0, ${t.textSizePx*2})">
8
+ }`;const Pg={...Ta},Dg={},Cg={placement:"bottom",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},Pu={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(e,{styles:t,utils:n})=>{const r=t.textSizePx*.7,i=t.textSizePx/2-r/2,o=`<g><text dominant-baseline="hanging" font-size="${t.textSizePx}" fill="${t.textColor}">${e.groupLabel}</text></g>`,a=n.measureTextWidth(e.groupLabel,t.textSizePx),s=e.group.reduce((h,f)=>{const p=`${f.seriesLabel}${n.toCurrency(f.value)}`,d=n.measureTextWidth(p,t.textSizePx);return d>h?d:h},0),u=Math.max(a,s)+t.textSizePx*3,c=e.group.map((h,f)=>{const p=f*t.textSizePx*1.5,d=h.id===(e.datum&&e.datum.id);return`<g transform="translate(0, ${t.textSizePx*2})">
9
9
  <rect width="${r}" height="${r}" x="${i}" y="${p+i}" rx="${r/2}" fill="${h.color}"></rect>
10
10
  <text x="${t.textSizePx*1.5}" y="${p}" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
11
- <tspan font-weight="${g?"bold":""}">${h.seriesLabel}</tspan>
11
+ <tspan font-weight="${d?"bold":""}">${h.seriesLabel}</tspan>
12
12
  <tspan font-weight="bold" text-anchor="end" x="${u}">${n.toCurrency(h.value)}</tspan>
13
13
  </text>
14
14
  </g>`}).join("");return`${o}
@@ -40,41 +40,41 @@ ${c}`}};Pu.renderFn.toString=()=>`(eventData, { styles, utils }) => {
40
40
  .join('')
41
41
  return \`\${titleSvg}
42
42
  \${contentSvg}\`
43
- }`;var Du=function(e,t){return Du=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])},Du(e,t)};function Wt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Du(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function m2(e,t,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{u(r.next(c))}catch(h){a(h)}}function l(c){try{u(r.throw(c))}catch(h){a(h)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(e,t||[])).next())})}function Lg(e,t){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(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Mr(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Yn(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >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 kr(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function Rr(e){return this instanceof Rr?(this.v=e,this):new Rr(e)}function y2(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),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(g){return Promise.resolve(g).then(p,h)}}function s(p,g){r[p]&&(i[p]=function(m){return new Promise(function(d,y){o.push([p,m,d,y])>1||l(p,m)})},g&&(i[p]=g(i[p])))}function l(p,g){try{u(r[p](g))}catch(m){f(o[0][3],m)}}function u(p){p.value instanceof Rr?Promise.resolve(p.value.v).then(c,h):f(o[0][2],p)}function c(p){l("next",p)}function h(p){l("throw",p)}function f(p,g){p(g),o.shift(),o.length&&l(o[0][0],o[0][1])}}function b2(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Mr=="function"?Mr(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(a){return new Promise(function(s,l){a=e[o](a),i(s,l,a.done,a.value)})}}function i(o,a,s,l){Promise.resolve(l).then(function(u){o({value:u,done:s})},a)}}typeof SuppressedError=="function"&&SuppressedError;function xe(e){return typeof e=="function"}function Cu(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Lu=Cu(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
43
+ }`;var Du=function(e,t){return Du=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])},Du(e,t)};function Wt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Du(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function mS(e,t,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{u(r.next(c))}catch(h){a(h)}}function l(c){try{u(r.throw(c))}catch(h){a(h)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(e,t||[])).next())})}function Lg(e,t){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(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Mr(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Yn(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >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 kr(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function Rr(e){return this instanceof Rr?(this.v=e,this):new Rr(e)}function yS(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),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,h)}}function s(p,d){r[p]&&(i[p]=function(m){return new Promise(function(g,y){o.push([p,m,g,y])>1||l(p,m)})},d&&(i[p]=d(i[p])))}function l(p,d){try{u(r[p](d))}catch(m){f(o[0][3],m)}}function u(p){p.value instanceof Rr?Promise.resolve(p.value.v).then(c,h):f(o[0][2],p)}function c(p){l("next",p)}function h(p){l("throw",p)}function f(p,d){p(d),o.shift(),o.length&&l(o[0][0],o[0][1])}}function bS(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Mr=="function"?Mr(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(a){return new Promise(function(s,l){a=e[o](a),i(s,l,a.done,a.value)})}}function i(o,a,s,l){Promise.resolve(l).then(function(u){o({value:u,done:s})},a)}}typeof SuppressedError=="function"&&SuppressedError;function xe(e){return typeof e=="function"}function Cu(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Lu=Cu(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
44
44
  `+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
45
- `):"",this.name="UnsubscriptionError",this.errors=n}});function _a(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Wi=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,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),l=s.next();!l.done;l=s.next()){var u=l.value;u.remove(this)}}catch(m){t={error:m}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}else a.remove(this);var c=this.initialTeardown;if(xe(c))try{c()}catch(m){o=m instanceof Lu?m.errors:[m]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var f=Mr(h),p=f.next();!p.done;p=f.next()){var g=p.value;try{Rg(g)}catch(m){o=o??[],m instanceof Lu?o=kr(kr([],Yn(o)),Yn(m.errors)):o.push(m)}}}catch(m){r={error:m}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}if(o)throw new Lu(o)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Rg(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&_a(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&_a(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),Mg=Wi.EMPTY;function kg(e){return e instanceof Wi||e&&"closed"in e&&xe(e.remove)&&xe(e.add)&&xe(e.unsubscribe)}function Rg(e){xe(e)?e():e.unsubscribe()}var Ig={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Eg={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,kr([e,t],Yn(n)))},clearTimeout:function(e){var t=Eg.delegate;return((t==null?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Bg(e){Eg.setTimeout(function(){throw e})}function Mu(){}function Aa(e){e()}var ku=function(e){Wt(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,kg(n)&&n.add(r)):r.destination=S2,r}return t.create=function(n,r,i){return new Vi(n,r,i)},t.prototype.next=function(n){this.isStopped||this._next(n)},t.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(n){this.destination.next(n)},t.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Wi),x2=Function.prototype.bind;function Ru(e,t){return x2.call(e,t)}var $2=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(r){wa(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){wa(r)}else wa(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){wa(n)}},e}(),Vi=function(e){Wt(t,e);function t(n,r,i){var o=e.call(this)||this,a;if(xe(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;o&&Ig.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&Ru(n.next,s),error:n.error&&Ru(n.error,s),complete:n.complete&&Ru(n.complete,s)}):a=n}return o.destination=new $2(a),o}return t}(ku);function wa(e){Bg(e)}function v2(e){throw e}var S2={closed:!0,next:Mu,error:v2,complete:Mu},Iu=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ir(e){return e}function T2(e){return e.length===0?Ir:e.length===1?e[0]:function(n){return e.reduce(function(r,i){return i(r)},n)}}var me=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(t,n,r){var i=this,o=A2(t)?t:new Vi(t,n,r);return Aa(function(){var a=i,s=a.operator,l=a.source;o.add(s?s.call(o,l):l?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},e.prototype.forEach=function(t,n){var r=this;return n=Ng(n),new n(function(i,o){var a=new Vi({next:function(s){try{t(s)}catch(l){o(l),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},e.prototype._subscribe=function(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)},e.prototype[Iu]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return T2(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=Ng(t),new t(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},e.create=function(t){return new e(t)},e}();function Ng(e){var t;return(t=e??Ig.Promise)!==null&&t!==void 0?t:Promise}function _2(e){return e&&xe(e.next)&&xe(e.error)&&xe(e.complete)}function A2(e){return e&&e instanceof ku||_2(e)&&kg(e)}function w2(e){return xe(e==null?void 0:e.lift)}function gt(e){return function(t){if(w2(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function lt(e,t,n,r,i){return new P2(e,t,n,r,i)}var P2=function(e){Wt(t,e);function t(n,r,i,o,a,s){var l=e.call(this,n)||this;return l.onFinalize=a,l.shouldUnsubscribe=s,l._next=r?function(u){try{r(u)}catch(c){n.error(c)}}:e.prototype._next,l._error=o?function(u){try{o(u)}catch(c){n.error(c)}finally{this.unsubscribe()}}:e.prototype._error,l._complete=i?function(){try{i()}catch(u){n.error(u)}finally{this.unsubscribe()}}:e.prototype._complete,l}return t.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},t}(ku),D2=Cu(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Q=function(e){Wt(t,e);function t(){var n=e.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return t.prototype.lift=function(n){var r=new Fg(this,this);return r.operator=n,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new D2},t.prototype.next=function(n){var r=this;Aa(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 l=s.value;l.next(n)}}catch(u){i={error:u}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},t.prototype.error=function(n){var r=this;Aa(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)}})},t.prototype.complete=function(){var n=this;Aa(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(n){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,n)},t.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},t.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?Mg:(this.currentObservers=null,s.push(n),new Wi(function(){r.currentObservers=null,_a(s,n)}))},t.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},t.prototype.asObservable=function(){var n=new me;return n.source=this,n},t.create=function(n,r){return new Fg(n,r)},t}(me),Fg=function(e){Wt(t,e);function t(n,r){var i=e.call(this)||this;return i.destination=n,i.source=r,i}return t.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)},t.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)},t.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)},t.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:Mg},t}(Q),Eu=function(e){Wt(t,e);function t(n){var r=e.call(this)||this;return r._value=n,r}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(n){var r=e.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},t.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,o=n._value;if(r)throw i;return this._throwIfClosed(),o},t.prototype.next=function(n){e.prototype.next.call(this,this._value=n)},t}(Q),Bu={now:function(){return(Bu.delegate||Date).now()},delegate:void 0},C2=function(e){Wt(t,e);function t(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=Bu);var o=e.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 t.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,s=r._timestampProvider,l=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+l)),this._trimBuffer(),e.prototype.next.call(this,n)},t.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(),l=0;l<s.length&&!n.closed;l+=o?1:2)n.next(s[l]);return this._checkFinalizedStatuses(n),r},t.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 l=i.now(),u=0,c=1;c<o.length&&o[c]<=l;c+=2)u=c;u&&o.splice(0,u+1)}},t}(Q),L2=function(e){Wt(t,e);function t(n,r){return e.call(this)||this}return t.prototype.schedule=function(n,r){return this},t}(Wi),Nu={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,kr([e,t],Yn(n)))},clearInterval:function(e){var t=Nu.delegate;return((t==null?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},M2=function(e){Wt(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return t.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},t.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),Nu.setInterval(n.flush.bind(n,this),i)},t.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&Nu.clearInterval(r)},t.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))},t.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},t.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,_a(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(L2),zg=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(t,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,t).schedule(r,n)},e.now=Bu.now,e}(),k2=function(e){Wt(t,e);function t(n,r){r===void 0&&(r=zg.now);var i=e.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return t.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}},t}(zg),R2=new k2(M2),Pa=new me(function(e){return e.complete()});function I2(e){return e&&xe(e.schedule)}function Fu(e){return e[e.length-1]}function E2(e){return xe(Fu(e))?e.pop():void 0}function zu(e){return I2(Fu(e))?e.pop():void 0}function B2(e,t){return typeof Fu(e)=="number"?e.pop():t}var Ou=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function Og(e){return xe(e==null?void 0:e.then)}function Gg(e){return xe(e[Iu])}function Wg(e){return Symbol.asyncIterator&&xe(e==null?void 0:e[Symbol.asyncIterator])}function Vg(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function N2(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Yg=N2();function Xg(e){return xe(e==null?void 0:e[Yg])}function Ug(e){return y2(this,arguments,function(){var n,r,i,o;return Lg(this,function(a){switch(a.label){case 0:n=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Rr(n.read())];case 3:return r=a.sent(),i=r.value,o=r.done,o?[4,Rr(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Rr(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 jg(e){return xe(e==null?void 0:e.getReader)}function vt(e){if(e instanceof me)return e;if(e!=null){if(Gg(e))return F2(e);if(Ou(e))return z2(e);if(Og(e))return O2(e);if(Wg(e))return Hg(e);if(Xg(e))return G2(e);if(jg(e))return W2(e)}throw Vg(e)}function F2(e){return new me(function(t){var n=e[Iu]();if(xe(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function z2(e){return new me(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function O2(e){return new me(function(t){e.then(function(n){t.closed||(t.next(n),t.complete())},function(n){return t.error(n)}).then(null,Bg)})}function G2(e){return new me(function(t){var n,r;try{for(var i=Mr(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function Hg(e){return new me(function(t){V2(e,t).catch(function(n){return t.error(n)})})}function W2(e){return Hg(Ug(e))}function V2(e,t){var n,r,i,o;return m2(this,void 0,void 0,function(){var a,s;return Lg(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=b2(e),l.label=1;case 1:return[4,n.next()];case 2:if(r=l.sent(),!!r.done)return[3,4];if(a=r.value,t.next(a),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=l.sent(),i={error:s},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function An(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(o),!i)return o}function qg(e,t){return t===void 0&&(t=0),gt(function(n,r){n.subscribe(lt(r,function(i){return An(r,e,function(){return r.next(i)},t)},function(){return An(r,e,function(){return r.complete()},t)},function(i){return An(r,e,function(){return r.error(i)},t)}))})}function Zg(e,t){return t===void 0&&(t=0),gt(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function Y2(e,t){return vt(e).pipe(Zg(t),qg(t))}function X2(e,t){return vt(e).pipe(Zg(t),qg(t))}function U2(e,t){return new me(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function j2(e,t){return new me(function(n){var r;return An(n,t,function(){r=e[Yg](),An(n,t,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 xe(r==null?void 0:r.return)&&r.return()}})}function Kg(e,t){if(!e)throw new Error("Iterable cannot be null");return new me(function(n){An(n,t,function(){var r=e[Symbol.asyncIterator]();An(n,t,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function H2(e,t){return Kg(Ug(e),t)}function q2(e,t){if(e!=null){if(Gg(e))return Y2(e,t);if(Ou(e))return U2(e,t);if(Og(e))return X2(e,t);if(Wg(e))return Kg(e,t);if(Xg(e))return j2(e,t);if(jg(e))return H2(e,t)}throw Vg(e)}function Da(e,t){return t?q2(e,t):vt(e)}function Ct(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=zu(e);return Da(e,n)}var Qg=Cu(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function L(e,t){return gt(function(n,r){var i=0;n.subscribe(lt(r,function(o){r.next(e.call(t,o,i++))}))})}var Z2=Array.isArray;function K2(e,t){return Z2(t)?e.apply(void 0,kr([],Yn(t))):e(t)}function Jg(e){return L(function(t){return K2(e,t)})}var Q2=Array.isArray,J2=Object.getPrototypeOf,eT=Object.prototype,tT=Object.keys;function nT(e){if(e.length===1){var t=e[0];if(Q2(t))return{args:t,keys:null};if(rT(t)){var n=tT(t);return{args:n.map(function(r){return t[r]}),keys:n}}}return{args:e,keys:null}}function rT(e){return e&&typeof e=="object"&&J2(e)===eT}function iT(e,t){return e.reduce(function(n,r,i){return n[r]=t[i],n},{})}function G(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=zu(e),r=E2(e),i=nT(e),o=i.args,a=i.keys;if(o.length===0)return Da([],n);var s=new me(oT(o,n,a?function(l){return iT(a,l)}:Ir));return r?s.pipe(Jg(r)):s}function oT(e,t,n){return n===void 0&&(n=Ir),function(r){ed(t,function(){for(var i=e.length,o=new Array(i),a=i,s=i,l=function(c){ed(t,function(){var h=Da(e[c],t),f=!1;h.subscribe(lt(r,function(p){o[c]=p,f||(f=!0,s--),s||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},u=0;u<i;u++)l(u)},r)}}function ed(e,t,n){e?An(n,e,t):t()}function aT(e,t,n,r,i,o,a,s){var l=[],u=0,c=0,h=!1,f=function(){h&&!l.length&&!u&&t.complete()},p=function(m){return u<r?g(m):l.push(m)},g=function(m){u++;var d=!1;vt(n(m,c++)).subscribe(lt(t,function(y){t.next(y)},function(){d=!0},void 0,function(){if(d)try{u--;for(var y=function(){var b=l.shift();a||g(b)};l.length&&u<r;)y();f()}catch(b){t.error(b)}}))};return e.subscribe(lt(t,p,function(){h=!0,f()})),function(){}}function Gu(e,t,n){return n===void 0&&(n=1/0),xe(t)?Gu(function(r,i){return L(function(o,a){return t(r,o,i,a)})(vt(e(r,i)))},n):(typeof t=="number"&&(n=t),gt(function(r,i){return aT(r,i,e,n)}))}function sT(e){return e===void 0&&(e=1/0),Gu(Ir,e)}function lT(e){return new me(function(t){vt(e()).subscribe(t)})}var uT=["addListener","removeListener"],cT=["addEventListener","removeEventListener"],fT=["on","off"];function Wu(e,t,n,r){if(xe(n)&&(r=n,n=void 0),r)return Wu(e,t,n).pipe(Jg(r));var i=Yn(gT(e)?cT.map(function(s){return function(l){return e[s](t,l,n)}}):hT(e)?uT.map(td(e,t)):pT(e)?fT.map(td(e,t)):[],2),o=i[0],a=i[1];if(!o&&Ou(e))return Gu(function(s){return Wu(s,t,n)})(vt(e));if(!o)throw new TypeError("Invalid event target");return new me(function(s){var l=function(){for(var u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];return s.next(1<u.length?u:u[0])};return o(l),function(){return a(l)}})}function td(e,t){return function(n){return function(r){return e[n](t,r)}}}function hT(e){return xe(e.addListener)&&xe(e.removeListener)}function pT(e){return xe(e.on)&&xe(e.off)}function gT(e){return xe(e.addEventListener)&&xe(e.removeEventListener)}function wn(e,t,n){return lT(function(){return e()?t:n})}function Vu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=zu(e),r=B2(e,1/0),i=e;return i.length?i.length===1?vt(i[0]):sT(r)(Da(i,n)):Pa}function Er(e,t){return gt(function(n,r){var i=0;n.subscribe(lt(r,function(o){return e.call(t,o,i++)&&r.next(o)}))})}function nd(e,t){return t===void 0&&(t=R2),gt(function(n,r){var i=null,o=null,a=null,s=function(){if(i){i.unsubscribe(),i=null;var u=o;o=null,r.next(u)}};function l(){var u=a+e,c=t.now();if(c<u){i=this.schedule(void 0,u-c),r.add(i);return}s()}n.subscribe(lt(r,function(u){o=u,a=t.now(),i||(i=t.schedule(l,e),r.add(i))},function(){s(),r.complete()},void 0,function(){o=i=null}))})}function dT(e){return gt(function(t,n){var r=!1;t.subscribe(lt(n,function(i){r=!0,n.next(i)},function(){r||n.next(e),n.complete()}))})}function mT(e){return e<=0?function(){return Pa}:gt(function(t,n){var r=0;t.subscribe(lt(n,function(i){++r<=e&&(n.next(i),e<=r&&n.complete())}))})}function Z(e,t){return t===void 0&&(t=Ir),e=e??yT,gt(function(n,r){var i,o=!0;n.subscribe(lt(r,function(a){var s=t(a);(o||!e(i,s))&&(o=!1,i=s,r.next(a))}))})}function yT(e,t){return e===t}function bT(e){return e===void 0&&(e=xT),gt(function(t,n){var r=!1;t.subscribe(lt(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(e())}))})}function xT(){return new Qg}function Yi(e,t){var n=arguments.length>=2;return function(r){return r.pipe(Ir,mT(1),n?dT(t):bT(function(){return new Qg}))}}function $T(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new Q}:t,r=e.resetOnError,i=r===void 0?!0:r,o=e.resetOnComplete,a=o===void 0?!0:o,s=e.resetOnRefCountZero,l=s===void 0?!0:s;return function(u){var c,h,f,p=0,g=!1,m=!1,d=function(){h==null||h.unsubscribe(),h=void 0},y=function(){d(),c=f=void 0,g=m=!1},b=function(){var x=c;y(),x==null||x.unsubscribe()};return gt(function(x,$){p++,!m&&!g&&d();var S=f=f??n();$.add(function(){p--,p===0&&!m&&!g&&(h=Yu(b,l))}),S.subscribe($),!c&&p>0&&(c=new Vi({next:function(_){return S.next(_)},error:function(_){m=!0,d(),h=Yu(y,i,_),S.error(_)},complete:function(){g=!0,d(),h=Yu(y,a),S.complete()}}),vt(x).subscribe(c))})(u)}}function Yu(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(t===!0){e();return}if(t!==!1){var i=new Vi({next:function(){i.unsubscribe(),e()}});return vt(t.apply(void 0,kr([],Yn(n)))).subscribe(i)}}function ie(e,t,n){var r,i=!1;return r=e,$T({connector:function(){return new C2(r,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function z(e,t){return gt(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(lt(r,function(l){i==null||i.unsubscribe();var u=0,c=o++;vt(e(l,c)).subscribe(i=lt(r,function(h){return r.next(t?t(l,h,c,u++):h)},function(){i=null,s()}))},function(){a=!0,s()}))})}function C(e){return gt(function(t,n){vt(e).subscribe(lt(n,function(){return n.complete()},Mu)),!n.closed&&t.subscribe(n)})}const dt={position:"left",scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""},vT={position:"bottom",scaleDomain:[0,"max"],scalePadding:.5,label:""},ST={columnAmount:1,rowAmount:1,columnGap:"auto",rowGap:"auto"},TT={seriesDirection:"row",rowLabels:[],columnLabels:[],valueAxis:{...dt},groupAxis:{...vT},separateSeries:!1},_T={type:"grid",visibleFilter:(e,t)=>!0,...TT,container:{...ST}};_T.visibleFilter.toString=()=>"(datum, context) => true";function Br(e){return Object.prototype.toString.call(e)==="[object Object]"}function AT(e){return Object.prototype.toString.call(e)==="[object Function]"}function Xu(e,t){if(Br(e)===!1||Br(t)===!1)return Object.assign({},t);const n=(r,i)=>{const o=Object.assign({},i);for(let a of Object.keys(r)){if(!(a in i))continue;let s;Br(r[a])&&Br(i[a])?(s=n(r[a],i[a]),o[a]=s):o[a]=r[a]}return o};return n(e,t)}function wT(e,t){const n={string:i=>typeof i=="string",number:i=>typeof i=="number",boolean:i=>typeof i=="boolean",object:i=>Br(i),"object[]":i=>Array.isArray(i)&&i.every(o=>Br(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=>AT(i),null:i=>i===null,undefined:i=>i===void 0},r={ColorType:i=>i==="none"||i==="label"||i==="primary"||i==="secondary"||i==="labelContrast"||i==="background"};return Object.keys(e).find(i=>{if(t[i]){const o=t[i],a=e[i];if(o.toBeTypes){if(o.toBeTypes.some(s=>n[s](a))===!1)return!0}else if(o.toBe){const{toBe:s,test:l}=o;if(l(a)===!1)return!0}else if(o.toBeOption){const s=o.toBeOption;if(r[s](a)===!1)return!0}}return!1})}function PT(e,t){const n=wT(e,t);if(n){const r=t[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 Ca(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function DT(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function rd(e){let t,n,r;e.length!==2?(t=Ca,n=(s,l)=>Ca(e(s),l),r=(s,l)=>e(s)-l):(t=e===Ca||e===DT?e:CT,n=e,r=e);function i(s,l,u=0,c=s.length){if(u<c){if(t(l,l)!==0)return c;do{const h=u+c>>>1;n(s[h],l)<0?u=h+1:c=h}while(u<c)}return u}function o(s,l,u=0,c=s.length){if(u<c){if(t(l,l)!==0)return c;do{const h=u+c>>>1;n(s[h],l)<=0?u=h+1:c=h}while(u<c)}return u}function a(s,l,u=0,c=s.length){const h=i(s,l,u,c-1);return h>u&&r(s[h-1],l)>-r(s[h],l)?h-1:h}return{left:i,center:a,right:o}}function CT(){return 0}function LT(e){return e===null?NaN:+e}const MT=rd(Ca),id=MT.right;rd(LT).center;class od extends Map{constructor(t,n=IT){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(ad(this,t))}has(t){return super.has(ad(this,t))}set(t,n){return super.set(kT(this,t),n)}delete(t){return super.delete(RT(this,t))}}function ad({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function kT({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function RT({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function IT(e){return e!==null&&typeof e=="object"?e.valueOf():e}const ET=Math.sqrt(50),BT=Math.sqrt(10),NT=Math.sqrt(2);function La(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=ET?10:o>=BT?5:o>=NT?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/a,s=Math.round(e*u),l=Math.round(t*u),s/u<e&&++s,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*a,s=Math.round(e/u),l=Math.round(t/u),s*u<e&&++s,l*u>t&&--l),l<s&&.5<=n&&n<2?La(e,t,n*2):[s,l,u]}function FT(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,a]=r?La(t,e,n):La(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let u=0;u<s;++u)l[u]=(o-u)/-a;else for(let u=0;u<s;++u)l[u]=(o-u)*a;else if(a<0)for(let u=0;u<s;++u)l[u]=(i+u)/-a;else for(let u=0;u<s;++u)l[u]=(i+u)*a;return l}function Uu(e,t,n){return t=+t,e=+e,n=+n,La(e,t,n)[2]}function zT(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Uu(t,e,n):Uu(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function OT(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}var GT={value:()=>{}};function sd(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ma(n)}function Ma(e){this._=e}function WT(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ma.prototype=sd.prototype={constructor:Ma,on:function(e,t){var n=this._,r=WT(e+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(e=r[o]).type)&&(i=VT(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(i=(e=r[o]).type)n[i]=ld(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ld(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ma(e)},call:function(e,t){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(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function VT(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function ld(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=GT,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ju="http://www.w3.org/1999/xhtml";const ud={svg:"http://www.w3.org/2000/svg",xhtml:ju,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ka(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ud.hasOwnProperty(t)?{space:ud[t],local:e}:e}function YT(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ju&&t.documentElement.namespaceURI===ju?t.createElement(e):t.createElementNS(n,e)}}function XT(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function cd(e){var t=ka(e);return(t.local?XT:YT)(t)}function UT(){}function Hu(e){return e==null?UT:function(){return this.querySelector(e)}}function jT(e){typeof e!="function"&&(e=Hu(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=new Array(a),l,u,c=0;c<a;++c)(l=o[c])&&(u=e.call(l,l.__data__,c,o))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new Lt(r,this._parents)}function HT(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function qT(){return[]}function fd(e){return e==null?qT:function(){return this.querySelectorAll(e)}}function ZT(e){return function(){return HT(e.apply(this,arguments))}}function KT(e){typeof e=="function"?e=ZT(e):e=fd(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var a=t[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&(r.push(e.call(l,l.__data__,u,a)),i.push(l));return new Lt(r,i)}function hd(e){return function(){return this.matches(e)}}function pd(e){return function(t){return t.matches(e)}}var QT=Array.prototype.find;function JT(e){return function(){return QT.call(this.children,e)}}function e_(){return this.firstElementChild}function t_(e){return this.select(e==null?e_:JT(typeof e=="function"?e:pd(e)))}var n_=Array.prototype.filter;function r_(){return Array.from(this.children)}function i_(e){return function(){return n_.call(this.children,e)}}function o_(e){return this.selectAll(e==null?r_:i_(typeof e=="function"?e:pd(e)))}function a_(e){typeof e!="function"&&(e=hd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&s.push(l);return new Lt(r,this._parents)}function gd(e){return new Array(e.length)}function s_(){return new Lt(this._enter||this._groups.map(gd),this._parents)}function Ra(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ra.prototype={constructor:Ra,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function l_(e){return function(){return e}}function u_(e,t,n,r,i,o){for(var a=0,s,l=t.length,u=o.length;a<u;++a)(s=t[a])?(s.__data__=o[a],r[a]=s):n[a]=new Ra(e,o[a]);for(;a<l;++a)(s=t[a])&&(i[a]=s)}function c_(e,t,n,r,i,o,a){var s,l,u=new Map,c=t.length,h=o.length,f=new Array(c),p;for(s=0;s<c;++s)(l=t[s])&&(f[s]=p=a.call(l,l.__data__,s,t)+"",u.has(p)?i[s]=l:u.set(p,l));for(s=0;s<h;++s)p=a.call(e,o[s],s,o)+"",(l=u.get(p))?(r[s]=l,l.__data__=o[s],u.delete(p)):n[s]=new Ra(e,o[s]);for(s=0;s<c;++s)(l=t[s])&&u.get(f[s])===l&&(i[s]=l)}function f_(e){return e.__data__}function h_(e,t){if(!arguments.length)return Array.from(this,f_);var n=t?c_:u_,r=this._parents,i=this._groups;typeof e!="function"&&(e=l_(e));for(var o=i.length,a=new Array(o),s=new Array(o),l=new Array(o),u=0;u<o;++u){var c=r[u],h=i[u],f=h.length,p=p_(e.call(c,c&&c.__data__,u,r)),g=p.length,m=s[u]=new Array(g),d=a[u]=new Array(g),y=l[u]=new Array(f);n(c,h,m,d,y,p,t);for(var b=0,x=0,$,S;b<g;++b)if($=m[b]){for(b>=x&&(x=b+1);!(S=d[x])&&++x<g;);$._next=S||null}}return a=new Lt(a,r),a._enter=s,a._exit=l,a}function p_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function g_(){return new Lt(this._exit||this._groups.map(gd),this._parents)}function d_(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function m_(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=r[l],h=u.length,f=s[l]=new Array(h),p,g=0;g<h;++g)(p=u[g]||c[g])&&(f[g]=p);for(;l<i;++l)s[l]=n[l];return new Lt(s,this._parents)}function y_(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],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 b_(e){e||(e=x_);function t(h,f){return h&&f?e(h.__data__,f.__data__):!h-!f}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,l=i[o]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(t)}return new Lt(i,this._parents).order()}function x_(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function $_(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function v_(){return Array.from(this)}function S_(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function T_(){let e=0;for(const t of this)++e;return e}function __(){return!this.node()}function A_(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&e.call(s,s.__data__,o,i);return this}function w_(e){return function(){this.removeAttribute(e)}}function P_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function D_(e,t){return function(){this.setAttribute(e,t)}}function C_(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function L_(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function M_(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function k_(e,t){var n=ka(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?P_:w_:typeof t=="function"?n.local?M_:L_:n.local?C_:D_)(n,t))}function dd(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function R_(e){return function(){this.style.removeProperty(e)}}function I_(e,t,n){return function(){this.style.setProperty(e,t,n)}}function E_(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function B_(e,t,n){return arguments.length>1?this.each((t==null?R_:typeof t=="function"?E_:I_)(e,t,n??"")):Nr(this.node(),e)}function Nr(e,t){return e.style.getPropertyValue(t)||dd(e).getComputedStyle(e,null).getPropertyValue(t)}function N_(e){return function(){delete this[e]}}function F_(e,t){return function(){this[e]=t}}function z_(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function O_(e,t){return arguments.length>1?this.each((t==null?N_:typeof t=="function"?z_:F_)(e,t)):this.node()[e]}function md(e){return e.trim().split(/^|\s+/)}function qu(e){return e.classList||new yd(e)}function yd(e){this._node=e,this._names=md(e.getAttribute("class")||"")}yd.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function bd(e,t){for(var n=qu(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function xd(e,t){for(var n=qu(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function G_(e){return function(){bd(this,e)}}function W_(e){return function(){xd(this,e)}}function V_(e,t){return function(){(t.apply(this,arguments)?bd:xd)(this,e)}}function Y_(e,t){var n=md(e+"");if(arguments.length<2){for(var r=qu(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?V_:t?G_:W_)(n,t))}function X_(){this.textContent=""}function U_(e){return function(){this.textContent=e}}function j_(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function H_(e){return arguments.length?this.each(e==null?X_:(typeof e=="function"?j_:U_)(e)):this.node().textContent}function q_(){this.innerHTML=""}function Z_(e){return function(){this.innerHTML=e}}function K_(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Q_(e){return arguments.length?this.each(e==null?q_:(typeof e=="function"?K_:Z_)(e)):this.node().innerHTML}function J_(){this.nextSibling&&this.parentNode.appendChild(this)}function eA(){return this.each(J_)}function tA(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function nA(){return this.each(tA)}function rA(e){var t=typeof e=="function"?e:cd(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function iA(){return null}function oA(e,t){var n=typeof e=="function"?e:cd(e),r=t==null?iA:typeof t=="function"?t:Hu(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function aA(){var e=this.parentNode;e&&e.removeChild(this)}function sA(){return this.each(aA)}function lA(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function uA(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function cA(e){return this.select(e?uA:lA)}function fA(e){return arguments.length?this.property("__data__",e):this.node().__data__}function hA(e){return function(t){e.call(this,t,this.__data__)}}function pA(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function gA(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function dA(e,t,n){return function(){var r=this.__on,i,o=hA(t);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function mA(e,t,n){var r=pA(e+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,c;l<u;++l)for(i=0,c=s[l];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=t?dA:gA,i=0;i<o;++i)this.each(s(r[i],t,n));return this}function $d(e,t,n){var r=dd(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function yA(e,t){return function(){return $d(this,e,t)}}function bA(e,t){return function(){return $d(this,e,t.apply(this,arguments))}}function xA(e,t){return this.each((typeof t=="function"?bA:yA)(e,t))}function*$A(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var vA=[null];function Lt(e,t){this._groups=e,this._parents=t}function Xi(){return new Lt([[document.documentElement]],vA)}function SA(){return this}Lt.prototype=Xi.prototype={constructor:Lt,select:jT,selectAll:KT,selectChild:t_,selectChildren:o_,filter:a_,data:h_,enter:s_,exit:g_,join:d_,merge:m_,selection:SA,order:y_,sort:b_,call:$_,nodes:v_,node:S_,size:T_,empty:__,each:A_,attr:k_,style:B_,property:O_,classed:Y_,text:H_,html:Q_,raise:eA,lower:nA,append:rA,insert:oA,remove:sA,clone:cA,datum:fA,on:mA,dispatch:xA,[Symbol.iterator]:$A};function Zu(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function vd(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ui(){}var ji=.7,Ia=1/ji,Fr="\\s*([+-]?\\d+)\\s*",Hi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Vt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",TA=/^#([0-9a-f]{3,8})$/,_A=new RegExp(`^rgb\\(${Fr},${Fr},${Fr}\\)$`),AA=new RegExp(`^rgb\\(${Vt},${Vt},${Vt}\\)$`),wA=new RegExp(`^rgba\\(${Fr},${Fr},${Fr},${Hi}\\)$`),PA=new RegExp(`^rgba\\(${Vt},${Vt},${Vt},${Hi}\\)$`),DA=new RegExp(`^hsl\\(${Hi},${Vt},${Vt}\\)$`),CA=new RegExp(`^hsla\\(${Hi},${Vt},${Vt},${Hi}\\)$`),Sd={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};Zu(Ui,Xn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Td,formatHex:Td,formatHex8:LA,formatHsl:MA,formatRgb:_d,toString:_d});function Td(){return this.rgb().formatHex()}function LA(){return this.rgb().formatHex8()}function MA(){return Cd(this).formatHsl()}function _d(){return this.rgb().formatRgb()}function Xn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=TA.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ad(t):n===3?new ut(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ea(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ea(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=_A.exec(e))?new ut(t[1],t[2],t[3],1):(t=AA.exec(e))?new ut(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=wA.exec(e))?Ea(t[1],t[2],t[3],t[4]):(t=PA.exec(e))?Ea(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=DA.exec(e))?Dd(t[1],t[2]/100,t[3]/100,1):(t=CA.exec(e))?Dd(t[1],t[2]/100,t[3]/100,t[4]):Sd.hasOwnProperty(e)?Ad(Sd[e]):e==="transparent"?new ut(NaN,NaN,NaN,0):null}function Ad(e){return new ut(e>>16&255,e>>8&255,e&255,1)}function Ea(e,t,n,r){return r<=0&&(e=t=n=NaN),new ut(e,t,n,r)}function kA(e){return e instanceof Ui||(e=Xn(e)),e?(e=e.rgb(),new ut(e.r,e.g,e.b,e.opacity)):new ut}function Ku(e,t,n,r){return arguments.length===1?kA(e):new ut(e,t,n,r??1)}function ut(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Zu(ut,Ku,vd(Ui,{brighter(e){return e=e==null?Ia:Math.pow(Ia,e),new ut(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ji:Math.pow(ji,e),new ut(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ut(Un(this.r),Un(this.g),Un(this.b),Ba(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:wd,formatHex:wd,formatHex8:RA,formatRgb:Pd,toString:Pd}));function wd(){return`#${jn(this.r)}${jn(this.g)}${jn(this.b)}`}function RA(){return`#${jn(this.r)}${jn(this.g)}${jn(this.b)}${jn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Pd(){const e=Ba(this.opacity);return`${e===1?"rgb(":"rgba("}${Un(this.r)}, ${Un(this.g)}, ${Un(this.b)}${e===1?")":`, ${e})`}`}function Ba(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Un(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function jn(e){return e=Un(e),(e<16?"0":"")+e.toString(16)}function Dd(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Mt(e,t,n,r)}function Cd(e){if(e instanceof Mt)return new Mt(e.h,e.s,e.l,e.opacity);if(e instanceof Ui||(e=Xn(e)),!e)return new Mt;if(e instanceof Mt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(t===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-t)/s+2:a=(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Mt(a,s,l,e.opacity)}function IA(e,t,n,r){return arguments.length===1?Cd(e):new Mt(e,t,n,r??1)}function Mt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Zu(Mt,IA,vd(Ui,{brighter(e){return e=e==null?Ia:Math.pow(Ia,e),new Mt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ji:Math.pow(ji,e),new Mt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ut(Qu(e>=240?e-240:e+120,i,r),Qu(e,i,r),Qu(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Mt(Ld(this.h),Na(this.s),Na(this.l),Ba(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ba(this.opacity);return`${e===1?"hsl(":"hsla("}${Ld(this.h)}, ${Na(this.s)*100}%, ${Na(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ld(e){return e=(e||0)%360,e<0?e+360:e}function Na(e){return Math.max(0,Math.min(1,e||0))}function Qu(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ju=e=>()=>e;function EA(e,t){return function(n){return e+n*t}}function BA(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function NA(e){return(e=+e)==1?Md:function(t,n){return n-t?BA(t,n,e):Ju(isNaN(t)?n:t)}}function Md(e,t){var n=t-e;return n?EA(e,n):Ju(isNaN(e)?t:e)}const Fa=function e(t){var n=NA(t);function r(i,o){var a=n((i=Ku(i)).r,(o=Ku(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),u=Md(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function FA(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function zA(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function OA(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=nc(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function GA(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function kt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function WA(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=nc(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var ec=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tc=new RegExp(ec.source,"g");function VA(e){return function(){return e}}function YA(e){return function(t){return e(t)+""}}function kd(e,t){var n=ec.lastIndex=tc.lastIndex=0,r,i,o,a=-1,s=[],l=[];for(e=e+"",t=t+"";(r=ec.exec(e))&&(i=tc.exec(t));)(o=i.index)>n&&(o=t.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,l.push({i:a,x:kt(r,i)})),n=tc.lastIndex;return n<t.length&&(o=t.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?YA(l[0].x):VA(t):(t=l.length,function(u){for(var c=0,h;c<t;++c)s[(h=l[c]).i]=h.x(u);return s.join("")})}function nc(e,t){var n=typeof t,r;return t==null||n==="boolean"?Ju(t):(n==="number"?kt:n==="string"?(r=Xn(t))?(t=r,Fa):kd:t instanceof Xn?Fa:t instanceof Date?GA:zA(t)?FA:Array.isArray(t)?OA:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?WA:kt)(e,t)}function XA(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Rd=180/Math.PI,Id={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ed(e,t,n,r,i,o){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*Rd,skewX:Math.atan(l)*Rd,scaleX:a,scaleY:s}}var za;function UA(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Id:Ed(t.a,t.b,t.c,t.d,t.e,t.f)}function jA(e){return e==null||(za||(za=document.createElementNS("http://www.w3.org/2000/svg","g")),za.setAttribute("transform",e),!(e=za.transform.baseVal.consolidate()))?Id:(e=e.matrix,Ed(e.a,e.b,e.c,e.d,e.e,e.f))}function Bd(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,c,h,f,p,g){if(u!==h||c!==f){var m=p.push("translate(",null,t,null,n);g.push({i:m-4,x:kt(u,h)},{i:m-2,x:kt(c,f)})}else(h||f)&&p.push("translate("+h+t+f+n)}function a(u,c,h,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:h.push(i(h)+"rotate(",null,r)-2,x:kt(u,c)})):c&&h.push(i(h)+"rotate("+c+r)}function s(u,c,h,f){u!==c?f.push({i:h.push(i(h)+"skewX(",null,r)-2,x:kt(u,c)}):c&&h.push(i(h)+"skewX("+c+r)}function l(u,c,h,f,p,g){if(u!==h||c!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:kt(u,h)},{i:m-2,x:kt(c,f)})}else(h!==1||f!==1)&&p.push(i(p)+"scale("+h+","+f+")")}return function(u,c){var h=[],f=[];return u=e(u),c=e(c),o(u.translateX,u.translateY,c.translateX,c.translateY,h,f),a(u.rotate,c.rotate,h,f),s(u.skewX,c.skewX,h,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,h,f),u=c=null,function(p){for(var g=-1,m=f.length,d;++g<m;)h[(d=f[g]).i]=d.x(p);return h.join("")}}}var HA=Bd(UA,"px, ","px)","deg)"),qA=Bd(jA,", ",")",")"),zr=0,qi=0,Zi=0,Nd=1e3,Oa,Ki,Ga=0,Hn=0,Wa=0,Qi=typeof performance=="object"&&performance.now?performance:Date,Fd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function rc(){return Hn||(Fd(ZA),Hn=Qi.now()+Wa)}function ZA(){Hn=0}function Va(){this._call=this._time=this._next=null}Va.prototype=zd.prototype={constructor:Va,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?rc():+n)+(t==null?0:+t),!this._next&&Ki!==this&&(Ki?Ki._next=this:Oa=this,Ki=this),this._call=e,this._time=n,ic()},stop:function(){this._call&&(this._call=null,this._time=1/0,ic())}};function zd(e,t,n){var r=new Va;return r.restart(e,t,n),r}function KA(){rc(),++zr;for(var e=Oa,t;e;)(t=Hn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--zr}function Od(){Hn=(Ga=Qi.now())+Wa,zr=qi=0;try{KA()}finally{zr=0,JA(),Hn=0}}function QA(){var e=Qi.now(),t=e-Ga;t>Nd&&(Wa-=t,Ga=e)}function JA(){for(var e,t=Oa,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Oa=n);Ki=e,ic(r)}function ic(e){if(!zr){qi&&(qi=clearTimeout(qi));var t=e-Hn;t>24?(e<1/0&&(qi=setTimeout(Od,e-Qi.now()-Wa)),Zi&&(Zi=clearInterval(Zi))):(Zi||(Ga=Qi.now(),Zi=setInterval(QA,Nd)),zr=1,Fd(Od))}}function Gd(e,t,n){var r=new Va;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var ew=sd("start","end","cancel","interrupt"),tw=[],Wd=0,Vd=1,oc=2,Ya=3,Yd=4,ac=5,Xa=6;function Ua(e,t,n,r,i,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;nw(e,n,{name:t,index:r,group:i,on:ew,tween:tw,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Wd})}function sc(e,t){var n=Rt(e,t);if(n.state>Wd)throw new Error("too late; already scheduled");return n}function Yt(e,t){var n=Rt(e,t);if(n.state>Ya)throw new Error("too late; already running");return n}function Rt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function nw(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=zd(o,0,n.time);function o(u){n.state=Vd,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,h,f,p;if(n.state!==Vd)return l();for(c in r)if(p=r[c],p.name===n.name){if(p.state===Ya)return Gd(a);p.state===Yd?(p.state=Xa,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[c]):+c<t&&(p.state=Xa,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[c])}if(Gd(function(){n.state===Ya&&(n.state=Yd,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=oc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===oc){for(n.state=Ya,i=new Array(f=n.tween.length),c=0,h=-1;c<f;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=p);i.length=h+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=ac,1),h=-1,f=i.length;++h<f;)i[h].call(e,c);n.state===ac&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Xa,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function rw(e,t){var n=e.__transition,r,i,o=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){o=!1;continue}i=r.state>oc&&r.state<ac,r.state=Xa,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}o&&delete e.__transition}}function iw(e){return this.each(function(){rw(this,e)})}function ow(e,t){var n,r;return function(){var i=Yt(this,e),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function aw(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Yt(this,e),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=s;break}l===u&&i.push(s)}o.tween=i}}function sw(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Rt(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?ow:aw)(n,e,t))}function lc(e,t,n){var r=e._id;return e.each(function(){var i=Yt(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Rt(i,r).value[t]}}function Xd(e,t){var n;return(typeof t=="number"?kt:t instanceof Xn?Fa:(n=Xn(t))?(t=n,Fa):kd)(e,t)}function lw(e){return function(){this.removeAttribute(e)}}function uw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function cw(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function fw(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function hw(e,t,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s)))}}function pw(e,t,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s)))}}function gw(e,t){var n=ka(e),r=n==="transform"?qA:Xd;return this.attrTween(e,typeof t=="function"?(n.local?pw:hw)(n,r,lc(this,"attr."+e,t)):t==null?(n.local?uw:lw)(n):(n.local?fw:cw)(n,r,t))}function dw(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function mw(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function yw(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&mw(e,o)),n}return i._value=t,i}function bw(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&dw(e,o)),n}return i._value=t,i}function xw(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=ka(e);return this.tween(n,(r.local?yw:bw)(r,t))}function $w(e,t){return function(){sc(this,e).delay=+t.apply(this,arguments)}}function vw(e,t){return t=+t,function(){sc(this,e).delay=t}}function Sw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$w:vw)(t,e)):Rt(this.node(),t).delay}function Tw(e,t){return function(){Yt(this,e).duration=+t.apply(this,arguments)}}function _w(e,t){return t=+t,function(){Yt(this,e).duration=t}}function Aw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Tw:_w)(t,e)):Rt(this.node(),t).duration}function ww(e,t){if(typeof t!="function")throw new Error;return function(){Yt(this,e).ease=t}}function Pw(e){var t=this._id;return arguments.length?this.each(ww(t,e)):Rt(this.node(),t).ease}function Dw(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Yt(this,e).ease=n}}function Cw(e){if(typeof e!="function")throw new Error;return this.each(Dw(this._id,e))}function Lw(e){typeof e!="function"&&(e=hd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&s.push(l);return new on(r,this._parents,this._name,this._id)}function Mw(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var l=t[s],u=n[s],c=l.length,h=a[s]=new Array(c),f,p=0;p<c;++p)(f=l[p]||u[p])&&(h[p]=f);for(;s<r;++s)a[s]=t[s];return new on(a,this._parents,this._name,this._id)}function kw(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Rw(e,t,n){var r,i,o=kw(t)?sc:Yt;return function(){var a=o(this,e),s=a.on;s!==r&&(i=(r=s).copy()).on(t,n),a.on=i}}function Iw(e,t){var n=this._id;return arguments.length<2?Rt(this.node(),n).on.on(e):this.each(Rw(n,e,t))}function Ew(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Bw(){return this.on("end.remove",Ew(this._id))}function Nw(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Hu(e));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],l=s.length,u=o[a]=new Array(l),c,h,f=0;f<l;++f)(c=s[f])&&(h=e.call(c,c.__data__,f,s))&&("__data__"in c&&(h.__data__=c.__data__),u[f]=h,Ua(u[f],t,n,f,u,Rt(c,n)));return new on(o,this._parents,t,n)}function Fw(e){var t=this._name,n=this._id;typeof e!="function"&&(e=fd(e));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var l=r[s],u=l.length,c,h=0;h<u;++h)if(c=l[h]){for(var f=e.call(c,c.__data__,h,l),p,g=Rt(c,n),m=0,d=f.length;m<d;++m)(p=f[m])&&Ua(p,t,n,m,f,g);o.push(f),a.push(c)}return new on(o,a,t,n)}var zw=Xi.prototype.constructor;function Ow(){return new zw(this._groups,this._parents)}function Gw(e,t){var n,r,i;return function(){var o=Nr(this,e),a=(this.style.removeProperty(e),Nr(this,e));return o===a?null:o===n&&a===r?i:i=t(n=o,r=a)}}function Ud(e){return function(){this.style.removeProperty(e)}}function Ww(e,t,n){var r,i=n+"",o;return function(){var a=Nr(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}function Vw(e,t,n){var r,i,o;return function(){var a=Nr(this,e),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),Nr(this,e))),a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s))}}function Yw(e,t){var n,r,i,o="style."+t,a="end."+o,s;return function(){var l=Yt(this,e),u=l.on,c=l.value[o]==null?s||(s=Ud(t)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(a,i=c),l.on=r}}function Xw(e,t,n){var r=(e+="")=="transform"?HA:Xd;return t==null?this.styleTween(e,Gw(e,r)).on("end.style."+e,Ud(e)):typeof t=="function"?this.styleTween(e,Vw(e,r,lc(this,"style."+e,t))).each(Yw(this._id,e)):this.styleTween(e,Ww(e,r,t),n).on("end.style."+e,null)}function Uw(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function jw(e,t,n){var r,i;function o(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Uw(e,a,n)),r}return o._value=t,o}function Hw(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,jw(e,t,n??""))}function qw(e){return function(){this.textContent=e}}function Zw(e){return function(){var t=e(this);this.textContent=t??""}}function Kw(e){return this.tween("text",typeof e=="function"?Zw(lc(this,"text",e)):qw(e==null?"":e+""))}function Qw(e){return function(t){this.textContent=e.call(this,t)}}function Jw(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Qw(i)),t}return r._value=e,r}function eP(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Jw(e))}function tP(){for(var e=this._name,t=this._id,n=jd(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)if(l=a[u]){var c=Rt(l,t);Ua(l,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new on(r,this._parents,e,n)}function nP(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},l={value:function(){--i===0&&o()}};n.each(function(){var u=Yt(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),u.on=t}),i===0&&o()})}var rP=0;function on(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function jd(){return++rP}var an=Xi.prototype;on.prototype={constructor:on,select:Nw,selectAll:Fw,selectChild:an.selectChild,selectChildren:an.selectChildren,filter:Lw,merge:Mw,selection:Ow,transition:tP,call:an.call,nodes:an.nodes,node:an.node,size:an.size,empty:an.empty,each:an.each,on:Iw,attr:gw,attrTween:xw,style:Xw,styleTween:Hw,text:Kw,textTween:eP,remove:Bw,tween:sw,delay:Sw,duration:Aw,ease:Pw,easeVarying:Cw,end:nP,[Symbol.iterator]:an[Symbol.iterator]};function iP(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var oP={time:null,delay:0,duration:250,ease:iP};function aP(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function sP(e){var t,n;e instanceof on?(t=e._id,e=e._name):(t=jd(),(n=oP).time=rc(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&Ua(l,e,t,u,a,n||aP(l,t));return new on(r,this._parents,e,t)}Xi.prototype.interrupt=iw,Xi.prototype.transition=sP;function lP(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ja(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Or(e){return e=ja(Math.abs(e)),e?e[1]:NaN}function uP(e,t){return function(n,r){for(var i=n.length,o=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}function cP(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var fP=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ha(e){if(!(t=fP.exec(e)))throw new Error("invalid format: "+e);var t;return new uc({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ha.prototype=uc.prototype;function uc(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}uc.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 hP(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Hd;function pP(e,t){var n=ja(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(Hd=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")+ja(e,Math.max(0,t+o-1))[0]}function qd(e,t){var n=ja(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Zd={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:lP,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>qd(e*100,t),r:qd,s:pP,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Kd(e){return e}var Qd=Array.prototype.map,Jd=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function gP(e){var t=e.grouping===void 0||e.thousands===void 0?Kd:uP(Qd.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?Kd:cP(Qd.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(h){h=Ha(h);var f=h.fill,p=h.align,g=h.sign,m=h.symbol,d=h.zero,y=h.width,b=h.comma,x=h.precision,$=h.trim,S=h.type;S==="n"?(b=!0,S="g"):Zd[S]||(x===void 0&&(x=12),$=!0,S="g"),(d||f==="0"&&p==="=")&&(d=!0,f="0",p="=");var _=m==="$"?n:m==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",A=m==="$"?r:/[%p]/.test(S)?a:"",w=Zd[S],P=/[defgprs%]/.test(S);x=x===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function I(v){var N=_,R=A,D,T,M;if(S==="c")R=w(v)+R,v="";else{v=+v;var O=v<0||1/v<0;if(v=isNaN(v)?l:w(Math.abs(v),x),$&&(v=hP(v)),O&&+v==0&&g!=="+"&&(O=!1),N=(O?g==="("?g:s:g==="-"||g==="("?"":g)+N,R=(S==="s"?Jd[8+Hd/3]:"")+R+(O&&g==="("?")":""),P){for(D=-1,T=v.length;++D<T;)if(M=v.charCodeAt(D),48>M||M>57){R=(M===46?i+v.slice(D+1):v.slice(D))+R,v=v.slice(0,D);break}}}b&&!d&&(v=t(v,1/0));var k=N.length+v.length+R.length,B=k<y?new Array(y-k+1).join(f):"";switch(b&&d&&(v=t(B+v,B.length?y-R.length:1/0),B=""),p){case"<":v=N+v+R+B;break;case"=":v=N+B+v+R;break;case"^":v=B.slice(0,k=B.length>>1)+N+v+R+B.slice(k);break;default:v=B+N+v+R;break}return o(v)}return I.toString=function(){return h+""},I}function c(h,f){var p=u((h=Ha(h),h.type="f",h)),g=Math.max(-8,Math.min(8,Math.floor(Or(f)/3)))*3,m=Math.pow(10,-g),d=Jd[8+g/3];return function(y){return p(m*y)+d}}return{format:u,formatPrefix:c}}var qa,em,tm;dP({thousands:",",grouping:[3],currency:["$",""]});function dP(e){return qa=gP(e),em=qa.format,tm=qa.formatPrefix,qa}function mP(e){return Math.max(0,-Or(Math.abs(e)))}function yP(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Or(t)/3)))*3-Or(Math.abs(e)))}function bP(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Or(t)-Or(e))+1}function Za(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const nm=Symbol("implicit");function rm(){var e=new od,t=[],n=[],r=nm;function i(o){let a=e.get(o);if(a===void 0){if(r!==nm)return r;e.set(o,a=t.push(o)-1)}return n[a%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new od;for(const a of o)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return rm(t,n).unknown(r)},Za.apply(i,arguments),i}function im(){var e=rm().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,a,s=!1,l=0,u=0,c=.5;delete e.unknown;function h(){var f=t().length,p=i<r,g=p?i:r,m=p?r:i;o=(m-g)/Math.max(1,f-l+u*2),s&&(o=Math.floor(o)),g+=(m-g-o*(f-l))*c,a=o*(1-l),s&&(g=Math.round(g),a=Math.round(a));var d=OT(f).map(function(y){return g+o*y});return n(p?d.reverse():d)}return e.domain=function(f){return arguments.length?(t(f),h()):t()},e.range=function(f){return arguments.length?([r,i]=f,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(f){return[r,i]=f,r=+r,i=+i,s=!0,h()},e.bandwidth=function(){return a},e.step=function(){return o},e.round=function(f){return arguments.length?(s=!!f,h()):s},e.padding=function(f){return arguments.length?(l=Math.min(1,u=+f),h()):l},e.paddingInner=function(f){return arguments.length?(l=Math.min(1,f),h()):l},e.paddingOuter=function(f){return arguments.length?(u=+f,h()):u},e.align=function(f){return arguments.length?(c=Math.max(0,Math.min(1,f)),h()):c},e.copy=function(){return im(t(),[r,i]).round(s).paddingInner(l).paddingOuter(u).align(c)},Za.apply(h(),arguments)}function om(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return om(t())},e}function xP(){return om(im.apply(null,arguments).paddingInner(1))}function $P(e){return function(){return e}}function vP(e){return+e}var am=[0,1];function Gr(e){return e}function cc(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:$P(isNaN(t)?NaN:.5)}function SP(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function TP(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=cc(i,r),o=n(a,o)):(r=cc(r,i),o=n(o,a)),function(s){return o(r(s))}}function _P(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=cc(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(s){var l=id(e,s,1,r)-1;return o[l](i[l](s))}}function AP(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function wP(){var e=am,t=am,n=nc,r,i,o,a=Gr,s,l,u;function c(){var f=Math.min(e.length,t.length);return a!==Gr&&(a=SP(e[0],e[f-1])),s=f>2?_P:TP,l=u=null,h}function h(f){return f==null||isNaN(f=+f)?o:(l||(l=s(e.map(r),t,n)))(r(a(f)))}return h.invert=function(f){return a(i((u||(u=s(t,e.map(r),kt)))(f)))},h.domain=function(f){return arguments.length?(e=Array.from(f,vP),c()):e.slice()},h.range=function(f){return arguments.length?(t=Array.from(f),c()):t.slice()},h.rangeRound=function(f){return t=Array.from(f),n=XA,c()},h.clamp=function(f){return arguments.length?(a=f?!0:Gr,c()):a!==Gr},h.interpolate=function(f){return arguments.length?(n=f,c()):n},h.unknown=function(f){return arguments.length?(o=f,h):o},function(f,p){return r=f,i=p,c()}}function PP(){return wP()(Gr,Gr)}function DP(e,t,n,r){var i=zT(e,t,n),o;switch(r=Ha(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=yP(i,a))&&(r.precision=o),tm(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=bP(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=mP(i))&&(r.precision=o-(r.type==="%")*2);break}}return em(r)}function sm(e){var t=e.domain;return e.ticks=function(n){var r=t();return FT(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return DP(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,a=r[i],s=r[o],l,u,c=10;for(s<a&&(u=a,a=s,s=u,u=i,i=o,o=u);c-- >0;){if(u=Uu(a,s,n),u===l)return r[i]=a,r[o]=s,t(r);if(u>0)a=Math.floor(a/u)*u,s=Math.ceil(s/u)*u;else if(u<0)a=Math.ceil(a*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function Ji(){var e=PP();return e.copy=function(){return AP(e,Ji())},Za.apply(e,arguments),sm(e)}function lm(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function a(l){return l!=null&&l<=l?i[id(r,l,0,n)]:o}function s(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,s()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,s()):i.slice()},a.invertExtent=function(l){var u=i.indexOf(l);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return lm().domain([e,t]).range(i).unknown(o)},Za.apply(sm(a),arguments)}function eo(e,t,n){this.k=e,this.x=t,this.y=n}eo.prototype={constructor:eo,scale:function(e){return e===1?this:new eo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new eo(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},eo.prototype;function fc(e){const t=[0,0];return e.length?e.reduce((n,r)=>[r<n[0]?r:n[0],r>n[1]?r:n[1]],[e[0],e[0]]):t}var hc=function(e,t){return hc=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])},hc(e,t)};function Xt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");hc(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function CP(e,t,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{u(r.next(c))}catch(h){a(h)}}function l(c){try{u(r.throw(c))}catch(h){a(h)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(e,[])).next())})}function um(e,t){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(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Wr(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function to(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >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 no(e,t,n){if(arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function Vr(e){return this instanceof Vr?(this.v=e,this):new Vr(e)}function LP(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),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(g){return Promise.resolve(g).then(p,h)}}function s(p,g){r[p]&&(i[p]=function(m){return new Promise(function(d,y){o.push([p,m,d,y])>1||l(p,m)})},g&&(i[p]=g(i[p])))}function l(p,g){try{u(r[p](g))}catch(m){f(o[0][3],m)}}function u(p){p.value instanceof Vr?Promise.resolve(p.value.v).then(c,h):f(o[0][2],p)}function c(p){l("next",p)}function h(p){l("throw",p)}function f(p,g){p(g),o.shift(),o.length&&l(o[0][0],o[0][1])}}function MP(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Wr=="function"?Wr(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(a){return new Promise(function(s,l){a=e[o](a),i(s,l,a.done,a.value)})}}function i(o,a,s,l){Promise.resolve(l).then(function(u){o({value:u,done:s})},a)}}function Ge(e){return typeof e=="function"}function pc(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var gc=pc(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
45
+ `):"",this.name="UnsubscriptionError",this.errors=n}});function _a(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Vi=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,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),l=s.next();!l.done;l=s.next()){var u=l.value;u.remove(this)}}catch(m){t={error:m}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}else a.remove(this);var c=this.initialTeardown;if(xe(c))try{c()}catch(m){o=m instanceof Lu?m.errors:[m]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var f=Mr(h),p=f.next();!p.done;p=f.next()){var d=p.value;try{Rg(d)}catch(m){o=o??[],m instanceof Lu?o=kr(kr([],Yn(o)),Yn(m.errors)):o.push(m)}}}catch(m){r={error:m}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}if(o)throw new Lu(o)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Rg(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&_a(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&_a(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),Mg=Vi.EMPTY;function kg(e){return e instanceof Vi||e&&"closed"in e&&xe(e.remove)&&xe(e.add)&&xe(e.unsubscribe)}function Rg(e){xe(e)?e():e.unsubscribe()}var Ig={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Eg={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,kr([e,t],Yn(n)))},clearTimeout:function(e){var t=Eg.delegate;return((t==null?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Bg(e){Eg.setTimeout(function(){throw e})}function Mu(){}function Aa(e){e()}var ku=function(e){Wt(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,kg(n)&&n.add(r)):r.destination=SS,r}return t.create=function(n,r,i){return new Yi(n,r,i)},t.prototype.next=function(n){this.isStopped||this._next(n)},t.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(n){this.destination.next(n)},t.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Vi),xS=Function.prototype.bind;function Ru(e,t){return xS.call(e,t)}var $S=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(r){wa(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){wa(r)}else wa(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){wa(n)}},e}(),Yi=function(e){Wt(t,e);function t(n,r,i){var o=e.call(this)||this,a;if(xe(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;o&&Ig.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&Ru(n.next,s),error:n.error&&Ru(n.error,s),complete:n.complete&&Ru(n.complete,s)}):a=n}return o.destination=new $S(a),o}return t}(ku);function wa(e){Bg(e)}function vS(e){throw e}var SS={closed:!0,next:Mu,error:vS,complete:Mu},Iu=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ir(e){return e}function TS(e){return e.length===0?Ir:e.length===1?e[0]:function(n){return e.reduce(function(r,i){return i(r)},n)}}var me=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(t,n,r){var i=this,o=AS(t)?t:new Yi(t,n,r);return Aa(function(){var a=i,s=a.operator,l=a.source;o.add(s?s.call(o,l):l?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},e.prototype.forEach=function(t,n){var r=this;return n=Ng(n),new n(function(i,o){var a=new Yi({next:function(s){try{t(s)}catch(l){o(l),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},e.prototype._subscribe=function(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)},e.prototype[Iu]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return TS(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=Ng(t),new t(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},e.create=function(t){return new e(t)},e}();function Ng(e){var t;return(t=e??Ig.Promise)!==null&&t!==void 0?t:Promise}function _S(e){return e&&xe(e.next)&&xe(e.error)&&xe(e.complete)}function AS(e){return e&&e instanceof ku||_S(e)&&kg(e)}function wS(e){return xe(e==null?void 0:e.lift)}function gt(e){return function(t){if(wS(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function lt(e,t,n,r,i){return new PS(e,t,n,r,i)}var PS=function(e){Wt(t,e);function t(n,r,i,o,a,s){var l=e.call(this,n)||this;return l.onFinalize=a,l.shouldUnsubscribe=s,l._next=r?function(u){try{r(u)}catch(c){n.error(c)}}:e.prototype._next,l._error=o?function(u){try{o(u)}catch(c){n.error(c)}finally{this.unsubscribe()}}:e.prototype._error,l._complete=i?function(){try{i()}catch(u){n.error(u)}finally{this.unsubscribe()}}:e.prototype._complete,l}return t.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},t}(ku),DS=Cu(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Q=function(e){Wt(t,e);function t(){var n=e.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return t.prototype.lift=function(n){var r=new Fg(this,this);return r.operator=n,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new DS},t.prototype.next=function(n){var r=this;Aa(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 l=s.value;l.next(n)}}catch(u){i={error:u}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},t.prototype.error=function(n){var r=this;Aa(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)}})},t.prototype.complete=function(){var n=this;Aa(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(n){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,n)},t.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},t.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?Mg:(this.currentObservers=null,s.push(n),new Vi(function(){r.currentObservers=null,_a(s,n)}))},t.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},t.prototype.asObservable=function(){var n=new me;return n.source=this,n},t.create=function(n,r){return new Fg(n,r)},t}(me),Fg=function(e){Wt(t,e);function t(n,r){var i=e.call(this)||this;return i.destination=n,i.source=r,i}return t.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)},t.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)},t.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)},t.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:Mg},t}(Q),Eu=function(e){Wt(t,e);function t(n){var r=e.call(this)||this;return r._value=n,r}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(n){var r=e.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},t.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,o=n._value;if(r)throw i;return this._throwIfClosed(),o},t.prototype.next=function(n){e.prototype.next.call(this,this._value=n)},t}(Q),Bu={now:function(){return(Bu.delegate||Date).now()},delegate:void 0},CS=function(e){Wt(t,e);function t(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=Bu);var o=e.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 t.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,s=r._timestampProvider,l=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+l)),this._trimBuffer(),e.prototype.next.call(this,n)},t.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(),l=0;l<s.length&&!n.closed;l+=o?1:2)n.next(s[l]);return this._checkFinalizedStatuses(n),r},t.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 l=i.now(),u=0,c=1;c<o.length&&o[c]<=l;c+=2)u=c;u&&o.splice(0,u+1)}},t}(Q),LS=function(e){Wt(t,e);function t(n,r){return e.call(this)||this}return t.prototype.schedule=function(n,r){return this},t}(Vi),Nu={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,kr([e,t],Yn(n)))},clearInterval:function(e){var t=Nu.delegate;return((t==null?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},MS=function(e){Wt(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return t.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},t.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),Nu.setInterval(n.flush.bind(n,this),i)},t.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&Nu.clearInterval(r)},t.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))},t.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},t.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,_a(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(LS),zg=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(t,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,t).schedule(r,n)},e.now=Bu.now,e}(),kS=function(e){Wt(t,e);function t(n,r){r===void 0&&(r=zg.now);var i=e.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return t.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}},t}(zg),RS=new kS(MS),Pa=new me(function(e){return e.complete()});function IS(e){return e&&xe(e.schedule)}function Fu(e){return e[e.length-1]}function ES(e){return xe(Fu(e))?e.pop():void 0}function zu(e){return IS(Fu(e))?e.pop():void 0}function BS(e,t){return typeof Fu(e)=="number"?e.pop():t}var Ou=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function Og(e){return xe(e==null?void 0:e.then)}function Gg(e){return xe(e[Iu])}function Wg(e){return Symbol.asyncIterator&&xe(e==null?void 0:e[Symbol.asyncIterator])}function Vg(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function NS(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Yg=NS();function Xg(e){return xe(e==null?void 0:e[Yg])}function Ug(e){return yS(this,arguments,function(){var n,r,i,o;return Lg(this,function(a){switch(a.label){case 0:n=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Rr(n.read())];case 3:return r=a.sent(),i=r.value,o=r.done,o?[4,Rr(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Rr(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 jg(e){return xe(e==null?void 0:e.getReader)}function vt(e){if(e instanceof me)return e;if(e!=null){if(Gg(e))return FS(e);if(Ou(e))return zS(e);if(Og(e))return OS(e);if(Wg(e))return Hg(e);if(Xg(e))return GS(e);if(jg(e))return WS(e)}throw Vg(e)}function FS(e){return new me(function(t){var n=e[Iu]();if(xe(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function zS(e){return new me(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function OS(e){return new me(function(t){e.then(function(n){t.closed||(t.next(n),t.complete())},function(n){return t.error(n)}).then(null,Bg)})}function GS(e){return new me(function(t){var n,r;try{for(var i=Mr(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function Hg(e){return new me(function(t){VS(e,t).catch(function(n){return t.error(n)})})}function WS(e){return Hg(Ug(e))}function VS(e,t){var n,r,i,o;return mS(this,void 0,void 0,function(){var a,s;return Lg(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=bS(e),l.label=1;case 1:return[4,n.next()];case 2:if(r=l.sent(),!!r.done)return[3,4];if(a=r.value,t.next(a),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=l.sent(),i={error:s},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function wn(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(o),!i)return o}function qg(e,t){return t===void 0&&(t=0),gt(function(n,r){n.subscribe(lt(r,function(i){return wn(r,e,function(){return r.next(i)},t)},function(){return wn(r,e,function(){return r.complete()},t)},function(i){return wn(r,e,function(){return r.error(i)},t)}))})}function Zg(e,t){return t===void 0&&(t=0),gt(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function YS(e,t){return vt(e).pipe(Zg(t),qg(t))}function XS(e,t){return vt(e).pipe(Zg(t),qg(t))}function US(e,t){return new me(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function jS(e,t){return new me(function(n){var r;return wn(n,t,function(){r=e[Yg](),wn(n,t,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 xe(r==null?void 0:r.return)&&r.return()}})}function Kg(e,t){if(!e)throw new Error("Iterable cannot be null");return new me(function(n){wn(n,t,function(){var r=e[Symbol.asyncIterator]();wn(n,t,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function HS(e,t){return Kg(Ug(e),t)}function qS(e,t){if(e!=null){if(Gg(e))return YS(e,t);if(Ou(e))return US(e,t);if(Og(e))return XS(e,t);if(Wg(e))return Kg(e,t);if(Xg(e))return jS(e,t);if(jg(e))return HS(e,t)}throw Vg(e)}function Da(e,t){return t?qS(e,t):vt(e)}function St(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=zu(e);return Da(e,n)}var Qg=Cu(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function L(e,t){return gt(function(n,r){var i=0;n.subscribe(lt(r,function(o){r.next(e.call(t,o,i++))}))})}var ZS=Array.isArray;function KS(e,t){return ZS(t)?e.apply(void 0,kr([],Yn(t))):e(t)}function Jg(e){return L(function(t){return KS(e,t)})}var QS=Array.isArray,JS=Object.getPrototypeOf,eT=Object.prototype,tT=Object.keys;function nT(e){if(e.length===1){var t=e[0];if(QS(t))return{args:t,keys:null};if(rT(t)){var n=tT(t);return{args:n.map(function(r){return t[r]}),keys:n}}}return{args:e,keys:null}}function rT(e){return e&&typeof e=="object"&&JS(e)===eT}function iT(e,t){return e.reduce(function(n,r,i){return n[r]=t[i],n},{})}function O(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=zu(e),r=ES(e),i=nT(e),o=i.args,a=i.keys;if(o.length===0)return Da([],n);var s=new me(oT(o,n,a?function(l){return iT(a,l)}:Ir));return r?s.pipe(Jg(r)):s}function oT(e,t,n){return n===void 0&&(n=Ir),function(r){ed(t,function(){for(var i=e.length,o=new Array(i),a=i,s=i,l=function(c){ed(t,function(){var h=Da(e[c],t),f=!1;h.subscribe(lt(r,function(p){o[c]=p,f||(f=!0,s--),s||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},u=0;u<i;u++)l(u)},r)}}function ed(e,t,n){e?wn(n,e,t):t()}function aT(e,t,n,r,i,o,a,s){var l=[],u=0,c=0,h=!1,f=function(){h&&!l.length&&!u&&t.complete()},p=function(m){return u<r?d(m):l.push(m)},d=function(m){u++;var g=!1;vt(n(m,c++)).subscribe(lt(t,function(y){t.next(y)},function(){g=!0},void 0,function(){if(g)try{u--;for(var y=function(){var b=l.shift();a||d(b)};l.length&&u<r;)y();f()}catch(b){t.error(b)}}))};return e.subscribe(lt(t,p,function(){h=!0,f()})),function(){}}function Gu(e,t,n){return n===void 0&&(n=1/0),xe(t)?Gu(function(r,i){return L(function(o,a){return t(r,o,i,a)})(vt(e(r,i)))},n):(typeof t=="number"&&(n=t),gt(function(r,i){return aT(r,i,e,n)}))}function sT(e){return e===void 0&&(e=1/0),Gu(Ir,e)}function lT(e){return new me(function(t){vt(e()).subscribe(t)})}var uT=["addListener","removeListener"],cT=["addEventListener","removeEventListener"],fT=["on","off"];function Wu(e,t,n,r){if(xe(n)&&(r=n,n=void 0),r)return Wu(e,t,n).pipe(Jg(r));var i=Yn(gT(e)?cT.map(function(s){return function(l){return e[s](t,l,n)}}):hT(e)?uT.map(td(e,t)):pT(e)?fT.map(td(e,t)):[],2),o=i[0],a=i[1];if(!o&&Ou(e))return Gu(function(s){return Wu(s,t,n)})(vt(e));if(!o)throw new TypeError("Invalid event target");return new me(function(s){var l=function(){for(var u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];return s.next(1<u.length?u:u[0])};return o(l),function(){return a(l)}})}function td(e,t){return function(n){return function(r){return e[n](t,r)}}}function hT(e){return xe(e.addListener)&&xe(e.removeListener)}function pT(e){return xe(e.on)&&xe(e.off)}function gT(e){return xe(e.addEventListener)&&xe(e.removeEventListener)}function on(e,t,n){return lT(function(){return e()?t:n})}function Vu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=zu(e),r=BS(e,1/0),i=e;return i.length?i.length===1?vt(i[0]):sT(r)(Da(i,n)):Pa}function Er(e,t){return gt(function(n,r){var i=0;n.subscribe(lt(r,function(o){return e.call(t,o,i++)&&r.next(o)}))})}function nd(e,t){return t===void 0&&(t=RS),gt(function(n,r){var i=null,o=null,a=null,s=function(){if(i){i.unsubscribe(),i=null;var u=o;o=null,r.next(u)}};function l(){var u=a+e,c=t.now();if(c<u){i=this.schedule(void 0,u-c),r.add(i);return}s()}n.subscribe(lt(r,function(u){o=u,a=t.now(),i||(i=t.schedule(l,e),r.add(i))},function(){s(),r.complete()},void 0,function(){o=i=null}))})}function dT(e){return gt(function(t,n){var r=!1;t.subscribe(lt(n,function(i){r=!0,n.next(i)},function(){r||n.next(e),n.complete()}))})}function mT(e){return e<=0?function(){return Pa}:gt(function(t,n){var r=0;t.subscribe(lt(n,function(i){++r<=e&&(n.next(i),e<=r&&n.complete())}))})}function q(e,t){return t===void 0&&(t=Ir),e=e??yT,gt(function(n,r){var i,o=!0;n.subscribe(lt(r,function(a){var s=t(a);(o||!e(i,s))&&(o=!1,i=s,r.next(a))}))})}function yT(e,t){return e===t}function bT(e){return e===void 0&&(e=xT),gt(function(t,n){var r=!1;t.subscribe(lt(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(e())}))})}function xT(){return new Qg}function Br(e,t){var n=arguments.length>=2;return function(r){return r.pipe(Ir,mT(1),n?dT(t):bT(function(){return new Qg}))}}function $T(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new Q}:t,r=e.resetOnError,i=r===void 0?!0:r,o=e.resetOnComplete,a=o===void 0?!0:o,s=e.resetOnRefCountZero,l=s===void 0?!0:s;return function(u){var c,h,f,p=0,d=!1,m=!1,g=function(){h==null||h.unsubscribe(),h=void 0},y=function(){g(),c=f=void 0,d=m=!1},b=function(){var x=c;y(),x==null||x.unsubscribe()};return gt(function(x,$){p++,!m&&!d&&g();var S=f=f??n();$.add(function(){p--,p===0&&!m&&!d&&(h=Yu(b,l))}),S.subscribe($),!c&&p>0&&(c=new Yi({next:function(_){return S.next(_)},error:function(_){m=!0,g(),h=Yu(y,i,_),S.error(_)},complete:function(){d=!0,g(),h=Yu(y,a),S.complete()}}),vt(x).subscribe(c))})(u)}}function Yu(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(t===!0){e();return}if(t!==!1){var i=new Yi({next:function(){i.unsubscribe(),e()}});return vt(t.apply(void 0,kr([],Yn(n)))).subscribe(i)}}function ne(e,t,n){var r,i=!1;return r=e,$T({connector:function(){return new CS(r,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function z(e,t){return gt(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(lt(r,function(l){i==null||i.unsubscribe();var u=0,c=o++;vt(e(l,c)).subscribe(i=lt(r,function(h){return r.next(t?t(l,h,c,u++):h)},function(){i=null,s()}))},function(){a=!0,s()}))})}function C(e){return gt(function(t,n){vt(e).subscribe(lt(n,function(){return n.complete()},Mu)),!n.closed&&t.subscribe(n)})}const dt={position:"left",scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""},vT={position:"bottom",scaleDomain:[0,"max"],scalePadding:.5,label:""},ST={columnAmount:1,rowAmount:1,columnGap:"auto",rowGap:"auto"},TT={seriesDirection:"row",rowLabels:[],columnLabels:[],valueAxis:{...dt},groupAxis:{...vT},separateSeries:!1},_T={type:"grid",visibleFilter:(e,t)=>!0,...TT,container:{...ST}};_T.visibleFilter.toString=()=>"(datum, context) => true";function Nr(e){return Object.prototype.toString.call(e)==="[object Object]"}function AT(e){return Object.prototype.toString.call(e)==="[object Function]"}function Xu(e,t){if(Nr(e)===!1||Nr(t)===!1)return Object.assign({},t);const n=(r,i)=>{const o=Object.assign({},i);for(let a of Object.keys(r)){if(!(a in i))continue;let s;Nr(r[a])&&Nr(i[a])?(s=n(r[a],i[a]),o[a]=s):o[a]=r[a]}return o};return n(e,t)}function wT(e,t){const n={string:i=>typeof i=="string",number:i=>typeof i=="number",boolean:i=>typeof i=="boolean",object:i=>Nr(i),"object[]":i=>Array.isArray(i)&&i.every(o=>Nr(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=>AT(i),null:i=>i===null,undefined:i=>i===void 0},r={ColorType:i=>i==="none"||i==="label"||i==="primary"||i==="secondary"||i==="labelContrast"||i==="background"};return Object.keys(e).find(i=>{if(t[i]){const o=t[i],a=e[i];if(o.toBeTypes){if(o.toBeTypes.some(s=>n[s](a))===!1)return!0}else if(o.toBe){const{toBe:s,test:l}=o;if(l(a)===!1)return!0}else if(o.toBeOption){const s=o.toBeOption;if(r[s](a)===!1)return!0}}return!1})}function PT(e,t){const n=wT(e,t);if(n){const r=t[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 Ca(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function DT(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function rd(e){let t,n,r;e.length!==2?(t=Ca,n=(s,l)=>Ca(e(s),l),r=(s,l)=>e(s)-l):(t=e===Ca||e===DT?e:CT,n=e,r=e);function i(s,l,u=0,c=s.length){if(u<c){if(t(l,l)!==0)return c;do{const h=u+c>>>1;n(s[h],l)<0?u=h+1:c=h}while(u<c)}return u}function o(s,l,u=0,c=s.length){if(u<c){if(t(l,l)!==0)return c;do{const h=u+c>>>1;n(s[h],l)<=0?u=h+1:c=h}while(u<c)}return u}function a(s,l,u=0,c=s.length){const h=i(s,l,u,c-1);return h>u&&r(s[h-1],l)>-r(s[h],l)?h-1:h}return{left:i,center:a,right:o}}function CT(){return 0}function LT(e){return e===null?NaN:+e}const MT=rd(Ca),id=MT.right;rd(LT).center;class od extends Map{constructor(t,n=IT){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(ad(this,t))}has(t){return super.has(ad(this,t))}set(t,n){return super.set(kT(this,t),n)}delete(t){return super.delete(RT(this,t))}}function ad({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function kT({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function RT({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function IT(e){return e!==null&&typeof e=="object"?e.valueOf():e}const ET=Math.sqrt(50),BT=Math.sqrt(10),NT=Math.sqrt(2);function La(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=ET?10:o>=BT?5:o>=NT?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/a,s=Math.round(e*u),l=Math.round(t*u),s/u<e&&++s,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*a,s=Math.round(e/u),l=Math.round(t/u),s*u<e&&++s,l*u>t&&--l),l<s&&.5<=n&&n<2?La(e,t,n*2):[s,l,u]}function FT(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,a]=r?La(t,e,n):La(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let u=0;u<s;++u)l[u]=(o-u)/-a;else for(let u=0;u<s;++u)l[u]=(o-u)*a;else if(a<0)for(let u=0;u<s;++u)l[u]=(i+u)/-a;else for(let u=0;u<s;++u)l[u]=(i+u)*a;return l}function Uu(e,t,n){return t=+t,e=+e,n=+n,La(e,t,n)[2]}function zT(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Uu(t,e,n):Uu(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function OT(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}var GT={value:()=>{}};function sd(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ma(n)}function Ma(e){this._=e}function WT(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ma.prototype=sd.prototype={constructor:Ma,on:function(e,t){var n=this._,r=WT(e+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(e=r[o]).type)&&(i=VT(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(i=(e=r[o]).type)n[i]=ld(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ld(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ma(e)},call:function(e,t){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(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function VT(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function ld(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=GT,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ju="http://www.w3.org/1999/xhtml";const ud={svg:"http://www.w3.org/2000/svg",xhtml:ju,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ka(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ud.hasOwnProperty(t)?{space:ud[t],local:e}:e}function YT(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ju&&t.documentElement.namespaceURI===ju?t.createElement(e):t.createElementNS(n,e)}}function XT(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function cd(e){var t=ka(e);return(t.local?XT:YT)(t)}function UT(){}function Hu(e){return e==null?UT:function(){return this.querySelector(e)}}function jT(e){typeof e!="function"&&(e=Hu(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=new Array(a),l,u,c=0;c<a;++c)(l=o[c])&&(u=e.call(l,l.__data__,c,o))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new Lt(r,this._parents)}function HT(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function qT(){return[]}function fd(e){return e==null?qT:function(){return this.querySelectorAll(e)}}function ZT(e){return function(){return HT(e.apply(this,arguments))}}function KT(e){typeof e=="function"?e=ZT(e):e=fd(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var a=t[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&(r.push(e.call(l,l.__data__,u,a)),i.push(l));return new Lt(r,i)}function hd(e){return function(){return this.matches(e)}}function pd(e){return function(t){return t.matches(e)}}var QT=Array.prototype.find;function JT(e){return function(){return QT.call(this.children,e)}}function e_(){return this.firstElementChild}function t_(e){return this.select(e==null?e_:JT(typeof e=="function"?e:pd(e)))}var n_=Array.prototype.filter;function r_(){return Array.from(this.children)}function i_(e){return function(){return n_.call(this.children,e)}}function o_(e){return this.selectAll(e==null?r_:i_(typeof e=="function"?e:pd(e)))}function a_(e){typeof e!="function"&&(e=hd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&s.push(l);return new Lt(r,this._parents)}function gd(e){return new Array(e.length)}function s_(){return new Lt(this._enter||this._groups.map(gd),this._parents)}function Ra(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ra.prototype={constructor:Ra,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function l_(e){return function(){return e}}function u_(e,t,n,r,i,o){for(var a=0,s,l=t.length,u=o.length;a<u;++a)(s=t[a])?(s.__data__=o[a],r[a]=s):n[a]=new Ra(e,o[a]);for(;a<l;++a)(s=t[a])&&(i[a]=s)}function c_(e,t,n,r,i,o,a){var s,l,u=new Map,c=t.length,h=o.length,f=new Array(c),p;for(s=0;s<c;++s)(l=t[s])&&(f[s]=p=a.call(l,l.__data__,s,t)+"",u.has(p)?i[s]=l:u.set(p,l));for(s=0;s<h;++s)p=a.call(e,o[s],s,o)+"",(l=u.get(p))?(r[s]=l,l.__data__=o[s],u.delete(p)):n[s]=new Ra(e,o[s]);for(s=0;s<c;++s)(l=t[s])&&u.get(f[s])===l&&(i[s]=l)}function f_(e){return e.__data__}function h_(e,t){if(!arguments.length)return Array.from(this,f_);var n=t?c_:u_,r=this._parents,i=this._groups;typeof e!="function"&&(e=l_(e));for(var o=i.length,a=new Array(o),s=new Array(o),l=new Array(o),u=0;u<o;++u){var c=r[u],h=i[u],f=h.length,p=p_(e.call(c,c&&c.__data__,u,r)),d=p.length,m=s[u]=new Array(d),g=a[u]=new Array(d),y=l[u]=new Array(f);n(c,h,m,g,y,p,t);for(var b=0,x=0,$,S;b<d;++b)if($=m[b]){for(b>=x&&(x=b+1);!(S=g[x])&&++x<d;);$._next=S||null}}return a=new Lt(a,r),a._enter=s,a._exit=l,a}function p_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function g_(){return new Lt(this._exit||this._groups.map(gd),this._parents)}function d_(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function m_(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=r[l],h=u.length,f=s[l]=new Array(h),p,d=0;d<h;++d)(p=u[d]||c[d])&&(f[d]=p);for(;l<i;++l)s[l]=n[l];return new Lt(s,this._parents)}function y_(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],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 b_(e){e||(e=x_);function t(h,f){return h&&f?e(h.__data__,f.__data__):!h-!f}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,l=i[o]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(t)}return new Lt(i,this._parents).order()}function x_(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function $_(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function v_(){return Array.from(this)}function S_(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function T_(){let e=0;for(const t of this)++e;return e}function __(){return!this.node()}function A_(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&e.call(s,s.__data__,o,i);return this}function w_(e){return function(){this.removeAttribute(e)}}function P_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function D_(e,t){return function(){this.setAttribute(e,t)}}function C_(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function L_(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function M_(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function k_(e,t){var n=ka(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?P_:w_:typeof t=="function"?n.local?M_:L_:n.local?C_:D_)(n,t))}function dd(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function R_(e){return function(){this.style.removeProperty(e)}}function I_(e,t,n){return function(){this.style.setProperty(e,t,n)}}function E_(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function B_(e,t,n){return arguments.length>1?this.each((t==null?R_:typeof t=="function"?E_:I_)(e,t,n??"")):Fr(this.node(),e)}function Fr(e,t){return e.style.getPropertyValue(t)||dd(e).getComputedStyle(e,null).getPropertyValue(t)}function N_(e){return function(){delete this[e]}}function F_(e,t){return function(){this[e]=t}}function z_(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function O_(e,t){return arguments.length>1?this.each((t==null?N_:typeof t=="function"?z_:F_)(e,t)):this.node()[e]}function md(e){return e.trim().split(/^|\s+/)}function qu(e){return e.classList||new yd(e)}function yd(e){this._node=e,this._names=md(e.getAttribute("class")||"")}yd.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function bd(e,t){for(var n=qu(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function xd(e,t){for(var n=qu(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function G_(e){return function(){bd(this,e)}}function W_(e){return function(){xd(this,e)}}function V_(e,t){return function(){(t.apply(this,arguments)?bd:xd)(this,e)}}function Y_(e,t){var n=md(e+"");if(arguments.length<2){for(var r=qu(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?V_:t?G_:W_)(n,t))}function X_(){this.textContent=""}function U_(e){return function(){this.textContent=e}}function j_(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function H_(e){return arguments.length?this.each(e==null?X_:(typeof e=="function"?j_:U_)(e)):this.node().textContent}function q_(){this.innerHTML=""}function Z_(e){return function(){this.innerHTML=e}}function K_(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Q_(e){return arguments.length?this.each(e==null?q_:(typeof e=="function"?K_:Z_)(e)):this.node().innerHTML}function J_(){this.nextSibling&&this.parentNode.appendChild(this)}function eA(){return this.each(J_)}function tA(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function nA(){return this.each(tA)}function rA(e){var t=typeof e=="function"?e:cd(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function iA(){return null}function oA(e,t){var n=typeof e=="function"?e:cd(e),r=t==null?iA:typeof t=="function"?t:Hu(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function aA(){var e=this.parentNode;e&&e.removeChild(this)}function sA(){return this.each(aA)}function lA(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function uA(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function cA(e){return this.select(e?uA:lA)}function fA(e){return arguments.length?this.property("__data__",e):this.node().__data__}function hA(e){return function(t){e.call(this,t,this.__data__)}}function pA(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function gA(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function dA(e,t,n){return function(){var r=this.__on,i,o=hA(t);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function mA(e,t,n){var r=pA(e+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,c;l<u;++l)for(i=0,c=s[l];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=t?dA:gA,i=0;i<o;++i)this.each(s(r[i],t,n));return this}function $d(e,t,n){var r=dd(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function yA(e,t){return function(){return $d(this,e,t)}}function bA(e,t){return function(){return $d(this,e,t.apply(this,arguments))}}function xA(e,t){return this.each((typeof t=="function"?bA:yA)(e,t))}function*$A(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var vA=[null];function Lt(e,t){this._groups=e,this._parents=t}function Xi(){return new Lt([[document.documentElement]],vA)}function SA(){return this}Lt.prototype=Xi.prototype={constructor:Lt,select:jT,selectAll:KT,selectChild:t_,selectChildren:o_,filter:a_,data:h_,enter:s_,exit:g_,join:d_,merge:m_,selection:SA,order:y_,sort:b_,call:$_,nodes:v_,node:S_,size:T_,empty:__,each:A_,attr:k_,style:B_,property:O_,classed:Y_,text:H_,html:Q_,raise:eA,lower:nA,append:rA,insert:oA,remove:sA,clone:cA,datum:fA,on:mA,dispatch:xA,[Symbol.iterator]:$A};function Zu(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function vd(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ui(){}var ji=.7,Ia=1/ji,zr="\\s*([+-]?\\d+)\\s*",Hi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Vt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",TA=/^#([0-9a-f]{3,8})$/,_A=new RegExp(`^rgb\\(${zr},${zr},${zr}\\)$`),AA=new RegExp(`^rgb\\(${Vt},${Vt},${Vt}\\)$`),wA=new RegExp(`^rgba\\(${zr},${zr},${zr},${Hi}\\)$`),PA=new RegExp(`^rgba\\(${Vt},${Vt},${Vt},${Hi}\\)$`),DA=new RegExp(`^hsl\\(${Hi},${Vt},${Vt}\\)$`),CA=new RegExp(`^hsla\\(${Hi},${Vt},${Vt},${Hi}\\)$`),Sd={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};Zu(Ui,Xn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Td,formatHex:Td,formatHex8:LA,formatHsl:MA,formatRgb:_d,toString:_d});function Td(){return this.rgb().formatHex()}function LA(){return this.rgb().formatHex8()}function MA(){return Cd(this).formatHsl()}function _d(){return this.rgb().formatRgb()}function Xn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=TA.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ad(t):n===3?new ut(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ea(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ea(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=_A.exec(e))?new ut(t[1],t[2],t[3],1):(t=AA.exec(e))?new ut(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=wA.exec(e))?Ea(t[1],t[2],t[3],t[4]):(t=PA.exec(e))?Ea(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=DA.exec(e))?Dd(t[1],t[2]/100,t[3]/100,1):(t=CA.exec(e))?Dd(t[1],t[2]/100,t[3]/100,t[4]):Sd.hasOwnProperty(e)?Ad(Sd[e]):e==="transparent"?new ut(NaN,NaN,NaN,0):null}function Ad(e){return new ut(e>>16&255,e>>8&255,e&255,1)}function Ea(e,t,n,r){return r<=0&&(e=t=n=NaN),new ut(e,t,n,r)}function kA(e){return e instanceof Ui||(e=Xn(e)),e?(e=e.rgb(),new ut(e.r,e.g,e.b,e.opacity)):new ut}function Ku(e,t,n,r){return arguments.length===1?kA(e):new ut(e,t,n,r??1)}function ut(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Zu(ut,Ku,vd(Ui,{brighter(e){return e=e==null?Ia:Math.pow(Ia,e),new ut(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ji:Math.pow(ji,e),new ut(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ut(Un(this.r),Un(this.g),Un(this.b),Ba(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:wd,formatHex:wd,formatHex8:RA,formatRgb:Pd,toString:Pd}));function wd(){return`#${jn(this.r)}${jn(this.g)}${jn(this.b)}`}function RA(){return`#${jn(this.r)}${jn(this.g)}${jn(this.b)}${jn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Pd(){const e=Ba(this.opacity);return`${e===1?"rgb(":"rgba("}${Un(this.r)}, ${Un(this.g)}, ${Un(this.b)}${e===1?")":`, ${e})`}`}function Ba(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Un(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function jn(e){return e=Un(e),(e<16?"0":"")+e.toString(16)}function Dd(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Mt(e,t,n,r)}function Cd(e){if(e instanceof Mt)return new Mt(e.h,e.s,e.l,e.opacity);if(e instanceof Ui||(e=Xn(e)),!e)return new Mt;if(e instanceof Mt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(t===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-t)/s+2:a=(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Mt(a,s,l,e.opacity)}function IA(e,t,n,r){return arguments.length===1?Cd(e):new Mt(e,t,n,r??1)}function Mt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Zu(Mt,IA,vd(Ui,{brighter(e){return e=e==null?Ia:Math.pow(Ia,e),new Mt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ji:Math.pow(ji,e),new Mt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ut(Qu(e>=240?e-240:e+120,i,r),Qu(e,i,r),Qu(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Mt(Ld(this.h),Na(this.s),Na(this.l),Ba(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ba(this.opacity);return`${e===1?"hsl(":"hsla("}${Ld(this.h)}, ${Na(this.s)*100}%, ${Na(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ld(e){return e=(e||0)%360,e<0?e+360:e}function Na(e){return Math.max(0,Math.min(1,e||0))}function Qu(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ju=e=>()=>e;function EA(e,t){return function(n){return e+n*t}}function BA(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function NA(e){return(e=+e)==1?Md:function(t,n){return n-t?BA(t,n,e):Ju(isNaN(t)?n:t)}}function Md(e,t){var n=t-e;return n?EA(e,n):Ju(isNaN(e)?t:e)}const Fa=function e(t){var n=NA(t);function r(i,o){var a=n((i=Ku(i)).r,(o=Ku(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),u=Md(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function FA(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function zA(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function OA(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=nc(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function GA(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function kt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function WA(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=nc(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var ec=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tc=new RegExp(ec.source,"g");function VA(e){return function(){return e}}function YA(e){return function(t){return e(t)+""}}function kd(e,t){var n=ec.lastIndex=tc.lastIndex=0,r,i,o,a=-1,s=[],l=[];for(e=e+"",t=t+"";(r=ec.exec(e))&&(i=tc.exec(t));)(o=i.index)>n&&(o=t.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,l.push({i:a,x:kt(r,i)})),n=tc.lastIndex;return n<t.length&&(o=t.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?YA(l[0].x):VA(t):(t=l.length,function(u){for(var c=0,h;c<t;++c)s[(h=l[c]).i]=h.x(u);return s.join("")})}function nc(e,t){var n=typeof t,r;return t==null||n==="boolean"?Ju(t):(n==="number"?kt:n==="string"?(r=Xn(t))?(t=r,Fa):kd:t instanceof Xn?Fa:t instanceof Date?GA:zA(t)?FA:Array.isArray(t)?OA:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?WA:kt)(e,t)}function XA(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Rd=180/Math.PI,Id={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ed(e,t,n,r,i,o){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*Rd,skewX:Math.atan(l)*Rd,scaleX:a,scaleY:s}}var za;function UA(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Id:Ed(t.a,t.b,t.c,t.d,t.e,t.f)}function jA(e){return e==null||(za||(za=document.createElementNS("http://www.w3.org/2000/svg","g")),za.setAttribute("transform",e),!(e=za.transform.baseVal.consolidate()))?Id:(e=e.matrix,Ed(e.a,e.b,e.c,e.d,e.e,e.f))}function Bd(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,c,h,f,p,d){if(u!==h||c!==f){var m=p.push("translate(",null,t,null,n);d.push({i:m-4,x:kt(u,h)},{i:m-2,x:kt(c,f)})}else(h||f)&&p.push("translate("+h+t+f+n)}function a(u,c,h,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:h.push(i(h)+"rotate(",null,r)-2,x:kt(u,c)})):c&&h.push(i(h)+"rotate("+c+r)}function s(u,c,h,f){u!==c?f.push({i:h.push(i(h)+"skewX(",null,r)-2,x:kt(u,c)}):c&&h.push(i(h)+"skewX("+c+r)}function l(u,c,h,f,p,d){if(u!==h||c!==f){var m=p.push(i(p)+"scale(",null,",",null,")");d.push({i:m-4,x:kt(u,h)},{i:m-2,x:kt(c,f)})}else(h!==1||f!==1)&&p.push(i(p)+"scale("+h+","+f+")")}return function(u,c){var h=[],f=[];return u=e(u),c=e(c),o(u.translateX,u.translateY,c.translateX,c.translateY,h,f),a(u.rotate,c.rotate,h,f),s(u.skewX,c.skewX,h,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,h,f),u=c=null,function(p){for(var d=-1,m=f.length,g;++d<m;)h[(g=f[d]).i]=g.x(p);return h.join("")}}}var HA=Bd(UA,"px, ","px)","deg)"),qA=Bd(jA,", ",")",")"),Or=0,qi=0,Zi=0,Nd=1e3,Oa,Ki,Ga=0,Hn=0,Wa=0,Qi=typeof performance=="object"&&performance.now?performance:Date,Fd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function rc(){return Hn||(Fd(ZA),Hn=Qi.now()+Wa)}function ZA(){Hn=0}function Va(){this._call=this._time=this._next=null}Va.prototype=zd.prototype={constructor:Va,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?rc():+n)+(t==null?0:+t),!this._next&&Ki!==this&&(Ki?Ki._next=this:Oa=this,Ki=this),this._call=e,this._time=n,ic()},stop:function(){this._call&&(this._call=null,this._time=1/0,ic())}};function zd(e,t,n){var r=new Va;return r.restart(e,t,n),r}function KA(){rc(),++Or;for(var e=Oa,t;e;)(t=Hn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Or}function Od(){Hn=(Ga=Qi.now())+Wa,Or=qi=0;try{KA()}finally{Or=0,JA(),Hn=0}}function QA(){var e=Qi.now(),t=e-Ga;t>Nd&&(Wa-=t,Ga=e)}function JA(){for(var e,t=Oa,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Oa=n);Ki=e,ic(r)}function ic(e){if(!Or){qi&&(qi=clearTimeout(qi));var t=e-Hn;t>24?(e<1/0&&(qi=setTimeout(Od,e-Qi.now()-Wa)),Zi&&(Zi=clearInterval(Zi))):(Zi||(Ga=Qi.now(),Zi=setInterval(QA,Nd)),Or=1,Fd(Od))}}function Gd(e,t,n){var r=new Va;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var ew=sd("start","end","cancel","interrupt"),tw=[],Wd=0,Vd=1,oc=2,Ya=3,Yd=4,ac=5,Xa=6;function Ua(e,t,n,r,i,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;nw(e,n,{name:t,index:r,group:i,on:ew,tween:tw,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Wd})}function sc(e,t){var n=Rt(e,t);if(n.state>Wd)throw new Error("too late; already scheduled");return n}function Yt(e,t){var n=Rt(e,t);if(n.state>Ya)throw new Error("too late; already running");return n}function Rt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function nw(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=zd(o,0,n.time);function o(u){n.state=Vd,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,h,f,p;if(n.state!==Vd)return l();for(c in r)if(p=r[c],p.name===n.name){if(p.state===Ya)return Gd(a);p.state===Yd?(p.state=Xa,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[c]):+c<t&&(p.state=Xa,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[c])}if(Gd(function(){n.state===Ya&&(n.state=Yd,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=oc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===oc){for(n.state=Ya,i=new Array(f=n.tween.length),c=0,h=-1;c<f;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=p);i.length=h+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=ac,1),h=-1,f=i.length;++h<f;)i[h].call(e,c);n.state===ac&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Xa,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function rw(e,t){var n=e.__transition,r,i,o=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){o=!1;continue}i=r.state>oc&&r.state<ac,r.state=Xa,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}o&&delete e.__transition}}function iw(e){return this.each(function(){rw(this,e)})}function ow(e,t){var n,r;return function(){var i=Yt(this,e),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function aw(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Yt(this,e),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=s;break}l===u&&i.push(s)}o.tween=i}}function sw(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Rt(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?ow:aw)(n,e,t))}function lc(e,t,n){var r=e._id;return e.each(function(){var i=Yt(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Rt(i,r).value[t]}}function Xd(e,t){var n;return(typeof t=="number"?kt:t instanceof Xn?Fa:(n=Xn(t))?(t=n,Fa):kd)(e,t)}function lw(e){return function(){this.removeAttribute(e)}}function uw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function cw(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function fw(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function hw(e,t,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s)))}}function pw(e,t,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s)))}}function gw(e,t){var n=ka(e),r=n==="transform"?qA:Xd;return this.attrTween(e,typeof t=="function"?(n.local?pw:hw)(n,r,lc(this,"attr."+e,t)):t==null?(n.local?uw:lw)(n):(n.local?fw:cw)(n,r,t))}function dw(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function mw(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function yw(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&mw(e,o)),n}return i._value=t,i}function bw(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&dw(e,o)),n}return i._value=t,i}function xw(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=ka(e);return this.tween(n,(r.local?yw:bw)(r,t))}function $w(e,t){return function(){sc(this,e).delay=+t.apply(this,arguments)}}function vw(e,t){return t=+t,function(){sc(this,e).delay=t}}function Sw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$w:vw)(t,e)):Rt(this.node(),t).delay}function Tw(e,t){return function(){Yt(this,e).duration=+t.apply(this,arguments)}}function _w(e,t){return t=+t,function(){Yt(this,e).duration=t}}function Aw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Tw:_w)(t,e)):Rt(this.node(),t).duration}function ww(e,t){if(typeof t!="function")throw new Error;return function(){Yt(this,e).ease=t}}function Pw(e){var t=this._id;return arguments.length?this.each(ww(t,e)):Rt(this.node(),t).ease}function Dw(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Yt(this,e).ease=n}}function Cw(e){if(typeof e!="function")throw new Error;return this.each(Dw(this._id,e))}function Lw(e){typeof e!="function"&&(e=hd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&s.push(l);return new an(r,this._parents,this._name,this._id)}function Mw(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var l=t[s],u=n[s],c=l.length,h=a[s]=new Array(c),f,p=0;p<c;++p)(f=l[p]||u[p])&&(h[p]=f);for(;s<r;++s)a[s]=t[s];return new an(a,this._parents,this._name,this._id)}function kw(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Rw(e,t,n){var r,i,o=kw(t)?sc:Yt;return function(){var a=o(this,e),s=a.on;s!==r&&(i=(r=s).copy()).on(t,n),a.on=i}}function Iw(e,t){var n=this._id;return arguments.length<2?Rt(this.node(),n).on.on(e):this.each(Rw(n,e,t))}function Ew(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Bw(){return this.on("end.remove",Ew(this._id))}function Nw(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Hu(e));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],l=s.length,u=o[a]=new Array(l),c,h,f=0;f<l;++f)(c=s[f])&&(h=e.call(c,c.__data__,f,s))&&("__data__"in c&&(h.__data__=c.__data__),u[f]=h,Ua(u[f],t,n,f,u,Rt(c,n)));return new an(o,this._parents,t,n)}function Fw(e){var t=this._name,n=this._id;typeof e!="function"&&(e=fd(e));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var l=r[s],u=l.length,c,h=0;h<u;++h)if(c=l[h]){for(var f=e.call(c,c.__data__,h,l),p,d=Rt(c,n),m=0,g=f.length;m<g;++m)(p=f[m])&&Ua(p,t,n,m,f,d);o.push(f),a.push(c)}return new an(o,a,t,n)}var zw=Xi.prototype.constructor;function Ow(){return new zw(this._groups,this._parents)}function Gw(e,t){var n,r,i;return function(){var o=Fr(this,e),a=(this.style.removeProperty(e),Fr(this,e));return o===a?null:o===n&&a===r?i:i=t(n=o,r=a)}}function Ud(e){return function(){this.style.removeProperty(e)}}function Ww(e,t,n){var r,i=n+"",o;return function(){var a=Fr(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}function Vw(e,t,n){var r,i,o;return function(){var a=Fr(this,e),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),Fr(this,e))),a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s))}}function Yw(e,t){var n,r,i,o="style."+t,a="end."+o,s;return function(){var l=Yt(this,e),u=l.on,c=l.value[o]==null?s||(s=Ud(t)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(a,i=c),l.on=r}}function Xw(e,t,n){var r=(e+="")=="transform"?HA:Xd;return t==null?this.styleTween(e,Gw(e,r)).on("end.style."+e,Ud(e)):typeof t=="function"?this.styleTween(e,Vw(e,r,lc(this,"style."+e,t))).each(Yw(this._id,e)):this.styleTween(e,Ww(e,r,t),n).on("end.style."+e,null)}function Uw(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function jw(e,t,n){var r,i;function o(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Uw(e,a,n)),r}return o._value=t,o}function Hw(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,jw(e,t,n??""))}function qw(e){return function(){this.textContent=e}}function Zw(e){return function(){var t=e(this);this.textContent=t??""}}function Kw(e){return this.tween("text",typeof e=="function"?Zw(lc(this,"text",e)):qw(e==null?"":e+""))}function Qw(e){return function(t){this.textContent=e.call(this,t)}}function Jw(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Qw(i)),t}return r._value=e,r}function eP(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Jw(e))}function tP(){for(var e=this._name,t=this._id,n=jd(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)if(l=a[u]){var c=Rt(l,t);Ua(l,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new an(r,this._parents,e,n)}function nP(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},l={value:function(){--i===0&&o()}};n.each(function(){var u=Yt(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),u.on=t}),i===0&&o()})}var rP=0;function an(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function jd(){return++rP}var sn=Xi.prototype;an.prototype={constructor:an,select:Nw,selectAll:Fw,selectChild:sn.selectChild,selectChildren:sn.selectChildren,filter:Lw,merge:Mw,selection:Ow,transition:tP,call:sn.call,nodes:sn.nodes,node:sn.node,size:sn.size,empty:sn.empty,each:sn.each,on:Iw,attr:gw,attrTween:xw,style:Xw,styleTween:Hw,text:Kw,textTween:eP,remove:Bw,tween:sw,delay:Sw,duration:Aw,ease:Pw,easeVarying:Cw,end:nP,[Symbol.iterator]:sn[Symbol.iterator]};function iP(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var oP={time:null,delay:0,duration:250,ease:iP};function aP(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function sP(e){var t,n;e instanceof an?(t=e._id,e=e._name):(t=jd(),(n=oP).time=rc(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&Ua(l,e,t,u,a,n||aP(l,t));return new an(r,this._parents,e,t)}Xi.prototype.interrupt=iw,Xi.prototype.transition=sP;function lP(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ja(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Gr(e){return e=ja(Math.abs(e)),e?e[1]:NaN}function uP(e,t){return function(n,r){for(var i=n.length,o=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}function cP(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var fP=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ha(e){if(!(t=fP.exec(e)))throw new Error("invalid format: "+e);var t;return new uc({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ha.prototype=uc.prototype;function uc(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}uc.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 hP(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Hd;function pP(e,t){var n=ja(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(Hd=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")+ja(e,Math.max(0,t+o-1))[0]}function qd(e,t){var n=ja(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Zd={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:lP,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>qd(e*100,t),r:qd,s:pP,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Kd(e){return e}var Qd=Array.prototype.map,Jd=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function gP(e){var t=e.grouping===void 0||e.thousands===void 0?Kd:uP(Qd.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?Kd:cP(Qd.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(h){h=Ha(h);var f=h.fill,p=h.align,d=h.sign,m=h.symbol,g=h.zero,y=h.width,b=h.comma,x=h.precision,$=h.trim,S=h.type;S==="n"?(b=!0,S="g"):Zd[S]||(x===void 0&&(x=12),$=!0,S="g"),(g||f==="0"&&p==="=")&&(g=!0,f="0",p="=");var _=m==="$"?n:m==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",A=m==="$"?r:/[%p]/.test(S)?a:"",w=Zd[S],P=/[defgprs%]/.test(S);x=x===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function I(v){var N=_,R=A,D,T,M;if(S==="c")R=w(v)+R,v="";else{v=+v;var G=v<0||1/v<0;if(v=isNaN(v)?l:w(Math.abs(v),x),$&&(v=hP(v)),G&&+v==0&&d!=="+"&&(G=!1),N=(G?d==="("?d:s:d==="-"||d==="("?"":d)+N,R=(S==="s"?Jd[8+Hd/3]:"")+R+(G&&d==="("?")":""),P){for(D=-1,T=v.length;++D<T;)if(M=v.charCodeAt(D),48>M||M>57){R=(M===46?i+v.slice(D+1):v.slice(D))+R,v=v.slice(0,D);break}}}b&&!g&&(v=t(v,1/0));var k=N.length+v.length+R.length,B=k<y?new Array(y-k+1).join(f):"";switch(b&&g&&(v=t(B+v,B.length?y-R.length:1/0),B=""),p){case"<":v=N+v+R+B;break;case"=":v=N+B+v+R;break;case"^":v=B.slice(0,k=B.length>>1)+N+v+R+B.slice(k);break;default:v=B+N+v+R;break}return o(v)}return I.toString=function(){return h+""},I}function c(h,f){var p=u((h=Ha(h),h.type="f",h)),d=Math.max(-8,Math.min(8,Math.floor(Gr(f)/3)))*3,m=Math.pow(10,-d),g=Jd[8+d/3];return function(y){return p(m*y)+g}}return{format:u,formatPrefix:c}}var qa,em,tm;dP({thousands:",",grouping:[3],currency:["$",""]});function dP(e){return qa=gP(e),em=qa.format,tm=qa.formatPrefix,qa}function mP(e){return Math.max(0,-Gr(Math.abs(e)))}function yP(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Gr(t)/3)))*3-Gr(Math.abs(e)))}function bP(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Gr(t)-Gr(e))+1}function Za(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const nm=Symbol("implicit");function rm(){var e=new od,t=[],n=[],r=nm;function i(o){let a=e.get(o);if(a===void 0){if(r!==nm)return r;e.set(o,a=t.push(o)-1)}return n[a%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new od;for(const a of o)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return rm(t,n).unknown(r)},Za.apply(i,arguments),i}function im(){var e=rm().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,a,s=!1,l=0,u=0,c=.5;delete e.unknown;function h(){var f=t().length,p=i<r,d=p?i:r,m=p?r:i;o=(m-d)/Math.max(1,f-l+u*2),s&&(o=Math.floor(o)),d+=(m-d-o*(f-l))*c,a=o*(1-l),s&&(d=Math.round(d),a=Math.round(a));var g=OT(f).map(function(y){return d+o*y});return n(p?g.reverse():g)}return e.domain=function(f){return arguments.length?(t(f),h()):t()},e.range=function(f){return arguments.length?([r,i]=f,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(f){return[r,i]=f,r=+r,i=+i,s=!0,h()},e.bandwidth=function(){return a},e.step=function(){return o},e.round=function(f){return arguments.length?(s=!!f,h()):s},e.padding=function(f){return arguments.length?(l=Math.min(1,u=+f),h()):l},e.paddingInner=function(f){return arguments.length?(l=Math.min(1,f),h()):l},e.paddingOuter=function(f){return arguments.length?(u=+f,h()):u},e.align=function(f){return arguments.length?(c=Math.max(0,Math.min(1,f)),h()):c},e.copy=function(){return im(t(),[r,i]).round(s).paddingInner(l).paddingOuter(u).align(c)},Za.apply(h(),arguments)}function om(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return om(t())},e}function xP(){return om(im.apply(null,arguments).paddingInner(1))}function $P(e){return function(){return e}}function vP(e){return+e}var am=[0,1];function Wr(e){return e}function cc(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:$P(isNaN(t)?NaN:.5)}function SP(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function TP(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=cc(i,r),o=n(a,o)):(r=cc(r,i),o=n(o,a)),function(s){return o(r(s))}}function _P(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=cc(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(s){var l=id(e,s,1,r)-1;return o[l](i[l](s))}}function AP(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function wP(){var e=am,t=am,n=nc,r,i,o,a=Wr,s,l,u;function c(){var f=Math.min(e.length,t.length);return a!==Wr&&(a=SP(e[0],e[f-1])),s=f>2?_P:TP,l=u=null,h}function h(f){return f==null||isNaN(f=+f)?o:(l||(l=s(e.map(r),t,n)))(r(a(f)))}return h.invert=function(f){return a(i((u||(u=s(t,e.map(r),kt)))(f)))},h.domain=function(f){return arguments.length?(e=Array.from(f,vP),c()):e.slice()},h.range=function(f){return arguments.length?(t=Array.from(f),c()):t.slice()},h.rangeRound=function(f){return t=Array.from(f),n=XA,c()},h.clamp=function(f){return arguments.length?(a=f?!0:Wr,c()):a!==Wr},h.interpolate=function(f){return arguments.length?(n=f,c()):n},h.unknown=function(f){return arguments.length?(o=f,h):o},function(f,p){return r=f,i=p,c()}}function PP(){return wP()(Wr,Wr)}function DP(e,t,n,r){var i=zT(e,t,n),o;switch(r=Ha(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=yP(i,a))&&(r.precision=o),tm(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=bP(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=mP(i))&&(r.precision=o-(r.type==="%")*2);break}}return em(r)}function sm(e){var t=e.domain;return e.ticks=function(n){var r=t();return FT(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return DP(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,a=r[i],s=r[o],l,u,c=10;for(s<a&&(u=a,a=s,s=u,u=i,i=o,o=u);c-- >0;){if(u=Uu(a,s,n),u===l)return r[i]=a,r[o]=s,t(r);if(u>0)a=Math.floor(a/u)*u,s=Math.ceil(s/u)*u;else if(u<0)a=Math.ceil(a*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function Ji(){var e=PP();return e.copy=function(){return AP(e,Ji())},Za.apply(e,arguments),sm(e)}function lm(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function a(l){return l!=null&&l<=l?i[id(r,l,0,n)]:o}function s(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,s()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,s()):i.slice()},a.invertExtent=function(l){var u=i.indexOf(l);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return lm().domain([e,t]).range(i).unknown(o)},Za.apply(sm(a),arguments)}function eo(e,t,n){this.k=e,this.x=t,this.y=n}eo.prototype={constructor:eo,scale:function(e){return e===1?this:new eo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new eo(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},eo.prototype;function fc(e){const t=[0,0];return e.length?e.reduce((n,r)=>[r<n[0]?r:n[0],r>n[1]?r:n[1]],[e[0],e[0]]):t}var hc=function(e,t){return hc=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])},hc(e,t)};function Xt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");hc(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function CP(e,t,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{u(r.next(c))}catch(h){a(h)}}function l(c){try{u(r.throw(c))}catch(h){a(h)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(e,[])).next())})}function um(e,t){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(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Vr(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function to(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >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 no(e,t,n){if(arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function Yr(e){return this instanceof Yr?(this.v=e,this):new Yr(e)}function LP(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),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,h)}}function s(p,d){r[p]&&(i[p]=function(m){return new Promise(function(g,y){o.push([p,m,g,y])>1||l(p,m)})},d&&(i[p]=d(i[p])))}function l(p,d){try{u(r[p](d))}catch(m){f(o[0][3],m)}}function u(p){p.value instanceof Yr?Promise.resolve(p.value.v).then(c,h):f(o[0][2],p)}function c(p){l("next",p)}function h(p){l("throw",p)}function f(p,d){p(d),o.shift(),o.length&&l(o[0][0],o[0][1])}}function MP(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Vr=="function"?Vr(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(a){return new Promise(function(s,l){a=e[o](a),i(s,l,a.done,a.value)})}}function i(o,a,s,l){Promise.resolve(l).then(function(u){o({value:u,done:s})},a)}}function Ge(e){return typeof e=="function"}function pc(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var gc=pc(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
46
46
  `+t.map(function(n,r){return r+1+") "+n.toString()}).join(`
47
- `):"",this.name="UnsubscriptionError",this.errors=t}});function Ka(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var ro=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,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=Wr(a),l=s.next();!l.done;l=s.next()){var u=l.value;u.remove(this)}}catch(m){t={error:m}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}else a.remove(this);var c=this.initialTeardown;if(Ge(c))try{c()}catch(m){o=m instanceof gc?m.errors:[m]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var f=Wr(h),p=f.next();!p.done;p=f.next()){var g=p.value;try{hm(g)}catch(m){o=o??[],m instanceof gc?o=no(no([],to(o)),to(m.errors)):o.push(m)}}}catch(m){r={error:m}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}if(o)throw new gc(o)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)hm(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&Ka(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&Ka(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),cm=ro.EMPTY;function fm(e){return e instanceof ro||e&&"closed"in e&&Ge(e.remove)&&Ge(e.add)&&Ge(e.unsubscribe)}function hm(e){Ge(e)?e():e.unsubscribe()}var pm={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},kP={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,no([e,t],to(n)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function gm(e){kP.setTimeout(function(){throw e})}function dc(){}function Qa(e){e()}var mc=function(e){Xt(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,fm(n)&&n.add(r)):r.destination=BP,r}return t.create=function(n,r,i){return new io(n,r,i)},t.prototype.next=function(n){this.isStopped||this._next(n)},t.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(n){this.destination.next(n)},t.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(ro),RP=Function.prototype.bind;function yc(e,t){return RP.call(e,t)}var IP=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(r){Ja(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){Ja(r)}else Ja(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){Ja(n)}},e}(),io=function(e){Xt(t,e);function t(n,r,i){var o=e.call(this)||this,a;if(Ge(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;o&&pm.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&yc(n.next,s),error:n.error&&yc(n.error,s),complete:n.complete&&yc(n.complete,s)}):a=n}return o.destination=new IP(a),o}return t}(mc);function Ja(e){gm(e)}function EP(e){throw e}var BP={closed:!0,next:dc,error:EP,complete:dc},bc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function dm(e){return e}function NP(e){return e.length===0?dm:e.length===1?e[0]:function(t){return e.reduce(function(n,r){return r(n)},t)}}var Pn=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(t,n,r){var i=this,o=zP(t)?t:new io(t,n,r);return Qa(function(){var a=i,s=a.operator,l=a.source;o.add(s?s.call(o,l):l?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},e.prototype.forEach=function(t,n){var r=this;return n=mm(n),new n(function(i,o){var a=new io({next:function(s){try{t(s)}catch(l){o(l),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},e.prototype._subscribe=function(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)},e.prototype[bc]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return NP(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=mm(t),new t(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},e.create=function(t){return new e(t)},e}();function mm(e){var t;return(t=e??pm.Promise)!==null&&t!==void 0?t:Promise}function FP(e){return e&&Ge(e.next)&&Ge(e.error)&&Ge(e.complete)}function zP(e){return e&&e instanceof mc||FP(e)&&fm(e)}function OP(e){return Ge(e==null?void 0:e.lift)}function oo(e){return function(t){if(OP(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function ao(e,t,n,r,i){return new GP(e,t,n,r,i)}var GP=function(e){Xt(t,e);function t(n,r,i,o,a,s){var l=e.call(this,n)||this;return l.onFinalize=a,l.shouldUnsubscribe=s,l._next=r?function(u){try{r(u)}catch(c){n.error(c)}}:e.prototype._next,l._error=o?function(u){try{o(u)}catch(c){n.error(c)}finally{this.unsubscribe()}}:e.prototype._error,l._complete=i?function(){try{i()}catch(u){n.error(u)}finally{this.unsubscribe()}}:e.prototype._complete,l}return t.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},t}(mc),WP=pc(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),so=function(e){Xt(t,e);function t(){var n=e.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return t.prototype.lift=function(n){var r=new ym(this,this);return r.operator=n,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new WP},t.prototype.next=function(n){var r=this;Qa(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=Wr(r.currentObservers),s=a.next();!s.done;s=a.next()){var l=s.value;l.next(n)}}catch(u){i={error:u}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},t.prototype.error=function(n){var r=this;Qa(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)}})},t.prototype.complete=function(){var n=this;Qa(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(n){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,n)},t.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},t.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?cm:(this.currentObservers=null,s.push(n),new ro(function(){r.currentObservers=null,Ka(s,n)}))},t.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},t.prototype.asObservable=function(){var n=new Pn;return n.source=this,n},t.create=function(n,r){return new ym(n,r)},t}(Pn),ym=function(e){Xt(t,e);function t(n,r){var i=e.call(this)||this;return i.destination=n,i.source=r,i}return t.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)},t.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)},t.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)},t.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:cm},t}(so),bm=function(e){Xt(t,e);function t(n){var r=e.call(this)||this;return r._value=n,r}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(n){var r=e.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},t.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,o=n._value;if(r)throw i;return this._throwIfClosed(),o},t.prototype.next=function(n){e.prototype.next.call(this,this._value=n)},t}(so),xc={now:function(){return(xc.delegate||Date).now()},delegate:void 0},VP=function(e){Xt(t,e);function t(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=xc);var o=e.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 t.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,s=r._timestampProvider,l=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+l)),this._trimBuffer(),e.prototype.next.call(this,n)},t.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(),l=0;l<s.length&&!n.closed;l+=o?1:2)n.next(s[l]);return this._checkFinalizedStatuses(n),r},t.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 l=i.now(),u=0,c=1;c<o.length&&o[c]<=l;c+=2)u=c;u&&o.splice(0,u+1)}},t}(so),YP=function(e){Xt(t,e);function t(n,r){return e.call(this)||this}return t.prototype.schedule=function(n,r){return this},t}(ro),xm={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,no([e,t],to(n)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},XP=function(e){Xt(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return t.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},t.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),xm.setInterval(n.flush.bind(n,this),i)},t.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&xm.clearInterval(r)},t.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))},t.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},t.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,Ka(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(YP),$m=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(t,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,t).schedule(r,n)},e.now=xc.now,e}(),UP=function(e){Xt(t,e);function t(n,r){r===void 0&&(r=$m.now);var i=e.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return t.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}},t}($m);new UP(XP);var jP=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function HP(e){return Ge(e==null?void 0:e.then)}function qP(e){return Ge(e[bc])}function ZP(e){return Symbol.asyncIterator&&Ge(e==null?void 0:e[Symbol.asyncIterator])}function KP(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function QP(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var JP=QP();function eD(e){return Ge(e==null?void 0:e[JP])}function tD(e){return LP(this,arguments,function(){var t,n,r,i;return um(this,function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Vr(t.read())];case 3:return n=o.sent(),r=n.value,i=n.done,i?[4,Vr(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Vr(r)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function nD(e){return Ge(e==null?void 0:e.getReader)}function es(e){if(e instanceof Pn)return e;if(e!=null){if(qP(e))return rD(e);if(jP(e))return iD(e);if(HP(e))return oD(e);if(ZP(e))return vm(e);if(eD(e))return aD(e);if(nD(e))return sD(e)}throw KP(e)}function rD(e){return new Pn(function(t){var n=e[bc]();if(Ge(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function iD(e){return new Pn(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function oD(e){return new Pn(function(t){e.then(function(n){t.closed||(t.next(n),t.complete())},function(n){return t.error(n)}).then(null,gm)})}function aD(e){return new Pn(function(t){var n,r;try{for(var i=Wr(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function vm(e){return new Pn(function(t){lD(e,t).catch(function(n){return t.error(n)})})}function sD(e){return vm(tD(e))}function lD(e,t){var n,r,i,o;return CP(this,void 0,void 0,function(){var a,s;return um(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=MP(e),l.label=1;case 1:return[4,n.next()];case 2:if(r=l.sent(),!!r.done)return[3,4];if(a=r.value,t.next(a),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=l.sent(),i={error:s},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}pc(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function $c(e,t){return oo(function(n,r){var i=0;n.subscribe(ao(r,function(o){r.next(e.call(t,o,i++))}))})}function uD(e,t){return t===void 0&&(t=dm),e=e??cD,oo(function(n,r){var i,o=!0;n.subscribe(ao(r,function(a){var s=t(a);(o||!e(i,s))&&(o=!1,i=s,r.next(a))}))})}function cD(e,t){return e===t}function fD(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new so}:t,r=e.resetOnError,i=r===void 0?!0:r,o=e.resetOnComplete,a=o===void 0?!0:o,s=e.resetOnRefCountZero,l=s===void 0?!0:s;return function(u){var c,h,f,p=0,g=!1,m=!1,d=function(){h==null||h.unsubscribe(),h=void 0},y=function(){d(),c=f=void 0,g=m=!1},b=function(){var x=c;y(),x==null||x.unsubscribe()};return oo(function(x,$){p++,!m&&!g&&d();var S=f=f??n();$.add(function(){p--,p===0&&!m&&!g&&(h=vc(b,l))}),S.subscribe($),!c&&p>0&&(c=new io({next:function(_){return S.next(_)},error:function(_){m=!0,d(),h=vc(y,i,_),S.error(_)},complete:function(){g=!0,d(),h=vc(y,a),S.complete()}}),es(x).subscribe(c))})(u)}}function vc(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(t===!0){e();return}if(t!==!1){var i=new io({next:function(){i.unsubscribe(),e()}});return es(t.apply(void 0,no([],to(n)))).subscribe(i)}}function hD(e,t,n){var r,i=!1;return r=e,fD({connector:function(){return new VP(r,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function pD(e,t){return oo(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(ao(r,function(l){i==null||i.unsubscribe();var u=0,c=o++;es(e(l,c)).subscribe(i=ao(r,function(h){return r.next(t?t(l,h,c,u++):h)},function(){i=null,s()}))},function(){a=!0,s()}))})}function gD(e){return oo(function(t,n){es(e).subscribe(ao(n,function(){return n.complete()},dc)),!n.closed&&t.subscribe(n)})}const dD=e=>e.pipe($c(t=>t.styles.textSize),uD(),$c(t=>{let n=NaN;if(typeof t=="string")if(t.includes("rem")){const r=parseFloat(getComputedStyle(document.documentElement).fontSize);n=parseFloat(t)*r}else t.includes("px")&&(n=parseFloat(t));else if(typeof t=="number")return t;return n||14})),Sc=({maxValue:e=1,minValue:t=0,axisWidth:n,scaleDomain:r=dt.scaleDomain,scaleRange:i=dt.scaleRange,reverse:o=!1})=>{const a=r[0]??dt.scaleDomain[0],s=r[1]??dt.scaleDomain[1],l=i[0]??dt.scaleRange[0],u=i[1]??dt.scaleRange[1];let c=a==="auto"?t<0?t:0:a==="min"?t:a,h=s==="auto"?e>=0?e:0:s==="max"?e:s;const f=e-(e-c)/(1-l),p=h/u;return o?Ji().domain([f,p]).range([n,0]):Ji().domain([f,p]).range([0,n])},Sm=({maxValue:e=1,minValue:t=0,axisWidth:n,scaleDomain:r=dt.scaleDomain,scaleRange:i=dt.scaleRange,reverse:o=!1})=>{t===e&&(e+=1,t-=1);const a=r[0]??dt.scaleDomain[0],s=r[1]??dt.scaleDomain[1],l=i[0]??dt.scaleRange[0],u=i[1]??dt.scaleRange[1];let c=a==="auto"?t<0?t:0:a==="min"?t:a,h=s==="auto"?e>=0?e:0:s==="max"?e:s;const f=e-(e-c)/(1-l),p=h/u;return o?Ji().domain([n,0]).range([f,p]):Ji().domain([0,n]).range([f,p])},mD=({axisLabels:e,axisWidth:t,padding:n=.5})=>{let r=[0,t];return xP().domain(e).range(r).padding(n)},Tc=({axisLabels:e,axisWidth:t,padding:n=0,reverse:r=!1})=>{let i=e.map((l,u)=>u);r&&i.reverse(),i.length||(i=[0]);const o=i.length-1+n*2,a=t/o,s=a*n-a*.5;return lm().domain([s,t-s]).range(i)};function Tm(e){return`[OrbCharts ${e}]:`}function yD(e){return`${Tm("error")} ${e.message}`}function bD({columnName:e,expectToBe:t,from:n}){return`Invalid value: '${e}' must be '${t}'
47
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function Ka(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var ro=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,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=Vr(a),l=s.next();!l.done;l=s.next()){var u=l.value;u.remove(this)}}catch(m){t={error:m}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}else a.remove(this);var c=this.initialTeardown;if(Ge(c))try{c()}catch(m){o=m instanceof gc?m.errors:[m]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var f=Vr(h),p=f.next();!p.done;p=f.next()){var d=p.value;try{hm(d)}catch(m){o=o??[],m instanceof gc?o=no(no([],to(o)),to(m.errors)):o.push(m)}}}catch(m){r={error:m}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}if(o)throw new gc(o)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)hm(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&Ka(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&Ka(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),cm=ro.EMPTY;function fm(e){return e instanceof ro||e&&"closed"in e&&Ge(e.remove)&&Ge(e.add)&&Ge(e.unsubscribe)}function hm(e){Ge(e)?e():e.unsubscribe()}var pm={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},kP={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,no([e,t],to(n)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function gm(e){kP.setTimeout(function(){throw e})}function dc(){}function Qa(e){e()}var mc=function(e){Xt(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,fm(n)&&n.add(r)):r.destination=BP,r}return t.create=function(n,r,i){return new io(n,r,i)},t.prototype.next=function(n){this.isStopped||this._next(n)},t.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(n){this.destination.next(n)},t.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(ro),RP=Function.prototype.bind;function yc(e,t){return RP.call(e,t)}var IP=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(r){Ja(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){Ja(r)}else Ja(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){Ja(n)}},e}(),io=function(e){Xt(t,e);function t(n,r,i){var o=e.call(this)||this,a;if(Ge(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;o&&pm.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&yc(n.next,s),error:n.error&&yc(n.error,s),complete:n.complete&&yc(n.complete,s)}):a=n}return o.destination=new IP(a),o}return t}(mc);function Ja(e){gm(e)}function EP(e){throw e}var BP={closed:!0,next:dc,error:EP,complete:dc},bc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function dm(e){return e}function NP(e){return e.length===0?dm:e.length===1?e[0]:function(t){return e.reduce(function(n,r){return r(n)},t)}}var Pn=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(t,n,r){var i=this,o=zP(t)?t:new io(t,n,r);return Qa(function(){var a=i,s=a.operator,l=a.source;o.add(s?s.call(o,l):l?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},e.prototype.forEach=function(t,n){var r=this;return n=mm(n),new n(function(i,o){var a=new io({next:function(s){try{t(s)}catch(l){o(l),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},e.prototype._subscribe=function(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)},e.prototype[bc]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return NP(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=mm(t),new t(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},e.create=function(t){return new e(t)},e}();function mm(e){var t;return(t=e??pm.Promise)!==null&&t!==void 0?t:Promise}function FP(e){return e&&Ge(e.next)&&Ge(e.error)&&Ge(e.complete)}function zP(e){return e&&e instanceof mc||FP(e)&&fm(e)}function OP(e){return Ge(e==null?void 0:e.lift)}function oo(e){return function(t){if(OP(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function ao(e,t,n,r,i){return new GP(e,t,n,r,i)}var GP=function(e){Xt(t,e);function t(n,r,i,o,a,s){var l=e.call(this,n)||this;return l.onFinalize=a,l.shouldUnsubscribe=s,l._next=r?function(u){try{r(u)}catch(c){n.error(c)}}:e.prototype._next,l._error=o?function(u){try{o(u)}catch(c){n.error(c)}finally{this.unsubscribe()}}:e.prototype._error,l._complete=i?function(){try{i()}catch(u){n.error(u)}finally{this.unsubscribe()}}:e.prototype._complete,l}return t.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},t}(mc),WP=pc(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),so=function(e){Xt(t,e);function t(){var n=e.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return t.prototype.lift=function(n){var r=new ym(this,this);return r.operator=n,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new WP},t.prototype.next=function(n){var r=this;Qa(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=Vr(r.currentObservers),s=a.next();!s.done;s=a.next()){var l=s.value;l.next(n)}}catch(u){i={error:u}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},t.prototype.error=function(n){var r=this;Qa(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)}})},t.prototype.complete=function(){var n=this;Qa(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(n){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,n)},t.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},t.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?cm:(this.currentObservers=null,s.push(n),new ro(function(){r.currentObservers=null,Ka(s,n)}))},t.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},t.prototype.asObservable=function(){var n=new Pn;return n.source=this,n},t.create=function(n,r){return new ym(n,r)},t}(Pn),ym=function(e){Xt(t,e);function t(n,r){var i=e.call(this)||this;return i.destination=n,i.source=r,i}return t.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)},t.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)},t.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)},t.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:cm},t}(so),bm=function(e){Xt(t,e);function t(n){var r=e.call(this)||this;return r._value=n,r}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(n){var r=e.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},t.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,o=n._value;if(r)throw i;return this._throwIfClosed(),o},t.prototype.next=function(n){e.prototype.next.call(this,this._value=n)},t}(so),xc={now:function(){return(xc.delegate||Date).now()},delegate:void 0},VP=function(e){Xt(t,e);function t(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=xc);var o=e.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 t.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,s=r._timestampProvider,l=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+l)),this._trimBuffer(),e.prototype.next.call(this,n)},t.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(),l=0;l<s.length&&!n.closed;l+=o?1:2)n.next(s[l]);return this._checkFinalizedStatuses(n),r},t.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 l=i.now(),u=0,c=1;c<o.length&&o[c]<=l;c+=2)u=c;u&&o.splice(0,u+1)}},t}(so),YP=function(e){Xt(t,e);function t(n,r){return e.call(this)||this}return t.prototype.schedule=function(n,r){return this},t}(ro),xm={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,no([e,t],to(n)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},XP=function(e){Xt(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return t.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},t.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),xm.setInterval(n.flush.bind(n,this),i)},t.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&xm.clearInterval(r)},t.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))},t.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},t.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,Ka(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(YP),$m=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(t,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,t).schedule(r,n)},e.now=xc.now,e}(),UP=function(e){Xt(t,e);function t(n,r){r===void 0&&(r=$m.now);var i=e.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return t.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}},t}($m);new UP(XP);var jP=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function HP(e){return Ge(e==null?void 0:e.then)}function qP(e){return Ge(e[bc])}function ZP(e){return Symbol.asyncIterator&&Ge(e==null?void 0:e[Symbol.asyncIterator])}function KP(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function QP(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var JP=QP();function eD(e){return Ge(e==null?void 0:e[JP])}function tD(e){return LP(this,arguments,function(){var t,n,r,i;return um(this,function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Yr(t.read())];case 3:return n=o.sent(),r=n.value,i=n.done,i?[4,Yr(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Yr(r)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function nD(e){return Ge(e==null?void 0:e.getReader)}function es(e){if(e instanceof Pn)return e;if(e!=null){if(qP(e))return rD(e);if(jP(e))return iD(e);if(HP(e))return oD(e);if(ZP(e))return vm(e);if(eD(e))return aD(e);if(nD(e))return sD(e)}throw KP(e)}function rD(e){return new Pn(function(t){var n=e[bc]();if(Ge(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function iD(e){return new Pn(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function oD(e){return new Pn(function(t){e.then(function(n){t.closed||(t.next(n),t.complete())},function(n){return t.error(n)}).then(null,gm)})}function aD(e){return new Pn(function(t){var n,r;try{for(var i=Vr(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function vm(e){return new Pn(function(t){lD(e,t).catch(function(n){return t.error(n)})})}function sD(e){return vm(tD(e))}function lD(e,t){var n,r,i,o;return CP(this,void 0,void 0,function(){var a,s;return um(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=MP(e),l.label=1;case 1:return[4,n.next()];case 2:if(r=l.sent(),!!r.done)return[3,4];if(a=r.value,t.next(a),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=l.sent(),i={error:s},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}pc(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function $c(e,t){return oo(function(n,r){var i=0;n.subscribe(ao(r,function(o){r.next(e.call(t,o,i++))}))})}function uD(e,t){return t===void 0&&(t=dm),e=e??cD,oo(function(n,r){var i,o=!0;n.subscribe(ao(r,function(a){var s=t(a);(o||!e(i,s))&&(o=!1,i=s,r.next(a))}))})}function cD(e,t){return e===t}function fD(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new so}:t,r=e.resetOnError,i=r===void 0?!0:r,o=e.resetOnComplete,a=o===void 0?!0:o,s=e.resetOnRefCountZero,l=s===void 0?!0:s;return function(u){var c,h,f,p=0,d=!1,m=!1,g=function(){h==null||h.unsubscribe(),h=void 0},y=function(){g(),c=f=void 0,d=m=!1},b=function(){var x=c;y(),x==null||x.unsubscribe()};return oo(function(x,$){p++,!m&&!d&&g();var S=f=f??n();$.add(function(){p--,p===0&&!m&&!d&&(h=vc(b,l))}),S.subscribe($),!c&&p>0&&(c=new io({next:function(_){return S.next(_)},error:function(_){m=!0,g(),h=vc(y,i,_),S.error(_)},complete:function(){d=!0,g(),h=vc(y,a),S.complete()}}),es(x).subscribe(c))})(u)}}function vc(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(t===!0){e();return}if(t!==!1){var i=new io({next:function(){i.unsubscribe(),e()}});return es(t.apply(void 0,no([],to(n)))).subscribe(i)}}function hD(e,t,n){var r,i=!1;return r=e,fD({connector:function(){return new VP(r,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function pD(e,t){return oo(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(ao(r,function(l){i==null||i.unsubscribe();var u=0,c=o++;es(e(l,c)).subscribe(i=ao(r,function(h){return r.next(t?t(l,h,c,u++):h)},function(){i=null,s()}))},function(){a=!0,s()}))})}function gD(e){return oo(function(t,n){es(e).subscribe(ao(n,function(){return n.complete()},dc)),!n.closed&&t.subscribe(n)})}const dD=e=>e.pipe($c(t=>t.styles.textSize),uD(),$c(t=>{let n=NaN;if(typeof t=="string")if(t.includes("rem")){const r=parseFloat(getComputedStyle(document.documentElement).fontSize);n=parseFloat(t)*r}else t.includes("px")&&(n=parseFloat(t));else if(typeof t=="number")return t;return n||14})),Sc=({maxValue:e=1,minValue:t=0,axisWidth:n,scaleDomain:r=dt.scaleDomain,scaleRange:i=dt.scaleRange,reverse:o=!1})=>{const a=r[0]??dt.scaleDomain[0],s=r[1]??dt.scaleDomain[1],l=i[0]??dt.scaleRange[0],u=i[1]??dt.scaleRange[1];let c=a==="auto"?t<0?t:0:a==="min"?t:a,h=s==="auto"?e>=0?e:0:s==="max"?e:s;const f=e-(e-c)/(1-l),p=h/u;return o?Ji().domain([f,p]).range([n,0]):Ji().domain([f,p]).range([0,n])},Sm=({maxValue:e=1,minValue:t=0,axisWidth:n,scaleDomain:r=dt.scaleDomain,scaleRange:i=dt.scaleRange,reverse:o=!1})=>{t===e&&(e+=1,t-=1);const a=r[0]??dt.scaleDomain[0],s=r[1]??dt.scaleDomain[1],l=i[0]??dt.scaleRange[0],u=i[1]??dt.scaleRange[1];let c=a==="auto"?t<0?t:0:a==="min"?t:a,h=s==="auto"?e>=0?e:0:s==="max"?e:s;const f=e-(e-c)/(1-l),p=h/u;return o?Ji().domain([n,0]).range([f,p]):Ji().domain([0,n]).range([f,p])},mD=({axisLabels:e,axisWidth:t,padding:n=.5})=>{let r=[0,t];return xP().domain(e).range(r).padding(n)},Tc=({axisLabels:e,axisWidth:t,padding:n=0,reverse:r=!1})=>{let i=e.map((l,u)=>u);r&&i.reverse(),i.length||(i=[0]);const o=i.length-1+n*2,a=t/o,s=a*n-a*.5;return lm().domain([s,t-s]).range(i)};function Tm(e){return`[OrbCharts ${e}]:`}function yD(e){return`${Tm("error")} ${e.message}`}function bD({columnName:e,expectToBe:t,from:n}){return`Invalid value: '${e}' must be '${t}'
48
48
 
49
49
  ----> find in '${n}'`}function xD({columnName:e,expectToBe:t,from:n}){return`${Tm("warning")} Value is not correct: '${e}' suppose to be '${t}', it may cause unexpected errors.'
50
50
 
51
- ----> find in '${n}'`}function $D({chartType:e,config:t,initFn:n}){const r=new so,i=new WeakMap;let o=()=>{},a;const s=new bm(t.defaultParams),l=new bm({}),u=s.pipe(pD(c=>l.pipe(gD(r),$c(h=>{try{const{status:f,columnName:p,expectToBe:g}=t.validator(h,{validateColumns:PT});if(f==="error")throw new Error(bD({columnName:p,expectToBe:g,from:`${t.name}.params$`}));f==="warning"&&console.warn(xD({columnName:p,expectToBe:g,from:`${t.name}.params$`}))}catch(f){console.error(yD(f))}return Xu(h,c)}))),hD(1));return{params$:l,name:t.name,chartType:e,defaultParams:t.defaultParams,layerIndex:t.layerIndex,init(){a&&(o=n(a)??(()=>{}),i.set(a.selection,a))},destroy(){o(),a&&(a.selection.remove(),a=void 0),r.next(void 0)},setPresetParams:c=>{s.next(Xu(c,t.defaultParams))},setContext:c=>{a=c,a.observer.fullParams$=u}}}const Yr=e=>function(t){return function(n){return class{constructor(){const r=$D({chartType:e,config:t,initFn:n});this.params$=r.params$,this.name=r.name,this.chartType=r.chartType,this.defaultParams=r.defaultParams,this.layerIndex=r.layerIndex,this.init=r.init,this.destroy=r.destroy,this.setPresetParams=r.setPresetParams,this.setContext=r.setContext}}}},Dn=Yr("series"),ct=Yr("grid"),mt=Yr("multiGrid"),He=Yr("multiValue"),ts=Yr("relationship"),_c=Yr("tree");function _e(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function _m(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ns(e){let t,n,r;e.length!==2?(t=_e,n=(s,l)=>_e(e(s),l),r=(s,l)=>e(s)-l):(t=e===_e||e===_m?e:vD,n=e,r=e);function i(s,l,u=0,c=s.length){if(u<c){if(t(l,l)!==0)return c;do{const h=u+c>>>1;n(s[h],l)<0?u=h+1:c=h}while(u<c)}return u}function o(s,l,u=0,c=s.length){if(u<c){if(t(l,l)!==0)return c;do{const h=u+c>>>1;n(s[h],l)<=0?u=h+1:c=h}while(u<c)}return u}function a(s,l,u=0,c=s.length){const h=i(s,l,u,c-1);return h>u&&r(s[h-1],l)>-r(s[h],l)?h-1:h}return{left:i,center:a,right:o}}function vD(){return 0}function rs(e){return e===null?NaN:+e}function*SD(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const Am=ns(_e),wm=Am.right,TD=Am.left,_D=ns(rs).center,qn=wm;function AD(e,t){if(!((t=+t)>=0))throw new RangeError("invalid r");let n=e.length;if(!((n=Math.floor(n))>=0))throw new RangeError("invalid length");if(!n||!t)return e;const r=Ac(t),i=e.slice();return r(e,i,0,n,1),r(i,e,0,n,1),r(e,i,0,n,1),e}const Pm=Dm(Ac),wD=Dm(PD);function Dm(e){return function(t,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:a}=t;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((a=Math.floor(a!==void 0?a:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!a||!n&&!r)return t;const s=n&&e(n),l=r&&e(r),u=i.slice();return s&&l?(Xr(s,u,i,o,a),Xr(s,i,u,o,a),Xr(s,u,i,o,a),Ur(l,i,u,o,a),Ur(l,u,i,o,a),Ur(l,i,u,o,a)):s?(Xr(s,i,u,o,a),Xr(s,u,i,o,a),Xr(s,i,u,o,a)):l&&(Ur(l,i,u,o,a),Ur(l,u,i,o,a),Ur(l,i,u,o,a)),t}}function Xr(e,t,n,r,i){for(let o=0,a=r*i;o<a;)e(t,n,o,o+=r,1)}function Ur(e,t,n,r,i){for(let o=0,a=r*i;o<r;++o)e(t,n,o,o+a,r)}function PD(e){const t=Ac(e);return(n,r,i,o,a)=>{i<<=2,o<<=2,a<<=2,t(n,r,i+0,o+0,a),t(n,r,i+1,o+1,a),t(n,r,i+2,o+2,a),t(n,r,i+3,o+3,a)}}function Ac(e){const t=Math.floor(e);if(t===e)return DD(e);const n=e-t,r=2*e+1;return(i,o,a,s,l)=>{if(!((s-=l)>=a))return;let u=t*o[a];const c=l*t,h=c+l;for(let f=a,p=a+c;f<p;f+=l)u+=o[Math.min(s,f)];for(let f=a,p=s;f<=p;f+=l)u+=o[Math.min(s,f+c)],i[f]=(u+n*(o[Math.max(a,f-h)]+o[Math.min(s,f+h)]))/r,u-=o[Math.max(a,f-c)]}}function DD(e){const t=2*e+1;return(n,r,i,o,a)=>{if(!((o-=a)>=i))return;let s=e*r[i];const l=a*e;for(let u=i,c=i+l;u<c;u+=a)s+=r[Math.min(o,u)];for(let u=i,c=o;u<=c;u+=a)s+=r[Math.min(o,u+l)],n[u]=s/t,s-=r[Math.max(i,u-l)]}}function is(e,t){let n=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(i=+i)>=i&&++n}return n}function CD(e){return e.length|0}function LD(e){return!(e>0)}function MD(e){return typeof e!="object"||"length"in e?e:Array.from(e)}function kD(e){return t=>e(...t)}function RD(...e){const t=typeof e[e.length-1]=="function"&&kD(e.pop());e=e.map(MD);const n=e.map(CD),r=e.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(LD))return o;for(;;){o.push(i.map((s,l)=>e[l][s]));let a=r;for(;++i[a]===n[a];){if(a===0)return t?o.map(t):o;i[a--]=0}}}function ID(e,t){var n=0,r=0;return Float64Array.from(e,t===void 0?i=>n+=+i||0:i=>n+=+t(i,r++,e)||0)}function Cm(e,t){let n=0,r,i=0,o=0;if(t===void 0)for(let a of e)a!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i));else{let a=-1;for(let s of e)(s=t(s,++a,e))!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i))}if(n>1)return o/(n-1)}function Lm(e,t){const n=Cm(e,t);return n&&Math.sqrt(n)}function lo(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class Me{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const o=n[i],a=t+o,s=Math.abs(t)<Math.abs(o)?t-(a-o):o-(a-t);s&&(n[r++]=s),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,o,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,i=t[--n],a=r+i,o=i-(a-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=o*2,r=a+i,i==r-a&&(a=r))}return a}}function ED(e,t){const n=new Me;if(t===void 0)for(let r of e)(r=+r)&&n.add(r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&n.add(i)}return+n}function BD(e,t){const n=new Me;let r=-1;return Float64Array.from(e,t===void 0?i=>n.add(+i||0):i=>n.add(+t(i,++r,e)||0))}class uo extends Map{constructor(t,n=Rm){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(wc(this,t))}has(t){return super.has(wc(this,t))}set(t,n){return super.set(Mm(this,t),n)}delete(t){return super.delete(km(this,t))}}class Zn extends Set{constructor(t,n=Rm){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const r of t)this.add(r)}has(t){return super.has(wc(this,t))}add(t){return super.add(Mm(this,t))}delete(t){return super.delete(km(this,t))}}function wc({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Mm({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function km({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Rm(e){return e!==null&&typeof e=="object"?e.valueOf():e}function jr(e){return e}function Im(e,...t){return Hr(e,jr,jr,t)}function Em(e,...t){return Hr(e,Array.from,jr,t)}function Bm(e,t){for(let n=1,r=t.length;n<r;++n)e=e.flatMap(i=>i.pop().map(([o,a])=>[...i,o,a]));return e}function ND(e,...t){return Bm(Em(e,...t),t)}function FD(e,t,...n){return Bm(Fm(e,t,...n),n)}function Nm(e,t,...n){return Hr(e,jr,t,n)}function Fm(e,t,...n){return Hr(e,Array.from,t,n)}function zD(e,...t){return Hr(e,jr,zm,t)}function OD(e,...t){return Hr(e,Array.from,zm,t)}function zm(e){if(e.length!==1)throw new Error("duplicate key");return e[0]}function Hr(e,t,n,r){return function i(o,a){if(a>=r.length)return n(o);const s=new uo,l=r[a++];let u=-1;for(const c of o){const h=l(c,++u,o),f=s.get(h);f?f.push(c):s.set(h,[c])}for(const[c,h]of s)s.set(c,i(h,a));return t(s)}(e,0)}function Om(e,t){return Array.from(t,n=>e[n])}function Pc(e,...t){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");e=Array.from(e);let[n]=t;if(n&&n.length!==2||t.length>1){const r=Uint32Array.from(e,(i,o)=>o);return t.length>1?(t=t.map(i=>e.map(i)),r.sort((i,o)=>{for(const a of t){const s=qr(a[i],a[o]);if(s)return s}})):(n=e.map(n),r.sort((i,o)=>qr(n[i],n[o]))),Om(e,r)}return e.sort(Dc(n))}function Dc(e=_e){if(e===_e)return qr;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function qr(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function GD(e,t,n){return(t.length!==2?Pc(Nm(e,t,n),([r,i],[o,a])=>_e(i,a)||_e(r,o)):Pc(Im(e,n),([r,i],[o,a])=>t(i,a)||_e(r,o))).map(([r])=>r)}var WD=Array.prototype,VD=WD.slice;function Cc(e){return()=>e}const YD=Math.sqrt(50),XD=Math.sqrt(10),UD=Math.sqrt(2);function os(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=YD?10:o>=XD?5:o>=UD?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/a,s=Math.round(e*u),l=Math.round(t*u),s/u<e&&++s,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*a,s=Math.round(e/u),l=Math.round(t/u),s*u<e&&++s,l*u>t&&--l),l<s&&.5<=n&&n<2?os(e,t,n*2):[s,l,u]}function Kn(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,a]=r?os(t,e,n):os(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let u=0;u<s;++u)l[u]=(o-u)/-a;else for(let u=0;u<s;++u)l[u]=(o-u)*a;else if(a<0)for(let u=0;u<s;++u)l[u]=(i+u)/-a;else for(let u=0;u<s;++u)l[u]=(i+u)*a;return l}function Qn(e,t,n){return t=+t,e=+e,n=+n,os(e,t,n)[2]}function as(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Qn(t,e,n):Qn(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Lc(e,t,n){let r;for(;;){const i=Qn(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function Mc(e){return Math.max(1,Math.ceil(Math.log(is(e))/Math.LN2)+1)}function Gm(){var e=jr,t=lo,n=Mc;function r(i){Array.isArray(i)||(i=Array.from(i));var o,a=i.length,s,l,u=new Array(a);for(o=0;o<a;++o)u[o]=e(i[o],o,i);var c=t(u),h=c[0],f=c[1],p=n(u,h,f);if(!Array.isArray(p)){const x=f,$=+p;if(t===lo&&([h,f]=Lc(h,f,$)),p=Kn(h,f,$),p[0]<=h&&(l=Qn(h,f,$)),p[p.length-1]>=f)if(x>=f&&t===lo){const S=Qn(h,f,$);isFinite(S)&&(S>0?f=(Math.floor(f/S)+1)*S:S<0&&(f=(Math.ceil(f*-S)+1)/-S))}else p.pop()}for(var g=p.length,m=0,d=g;p[m]<=h;)++m;for(;p[d-1]>f;)--d;(m||d<g)&&(p=p.slice(m,d),g=d-m);var y=new Array(g+1),b;for(o=0;o<=g;++o)b=y[o]=[],b.x0=o>0?p[o-1]:h,b.x1=o<g?p[o]:f;if(isFinite(l)){if(l>0)for(o=0;o<a;++o)(s=u[o])!=null&&h<=s&&s<=f&&y[Math.min(g,Math.floor((s-h)/l))].push(i[o]);else if(l<0){for(o=0;o<a;++o)if((s=u[o])!=null&&h<=s&&s<=f){const x=Math.floor((h-s)*l);y[Math.min(g,x+(p[x]<=s))].push(i[o])}}}else for(o=0;o<a;++o)(s=u[o])!=null&&h<=s&&s<=f&&y[qn(p,s,0,g)].push(i[o]);return y}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Cc(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Cc([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Cc(Array.isArray(i)?VD.call(i):i),r):n},r}function co(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function kc(e,t){let n,r=-1,i=-1;if(t===void 0)for(const o of e)++i,o!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of e)(o=t(o,++i,e))!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);return r}function ss(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Rc(e,t){let n,r=-1,i=-1;if(t===void 0)for(const o of e)++i,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of e)(o=t(o,++i,e))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);return r}function ls(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?qr:Dc(i);r>n;){if(r-n>600){const l=r-n+1,u=t-n+1,c=Math.log(l),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1),p=Math.max(n,Math.floor(t-u*h/l+f)),g=Math.min(r,Math.floor(t+(l-u)*h/l+f));ls(e,t,p,g,i)}const o=e[t];let a=n,s=r;for(fo(e,n,t),i(e[r],o)>0&&fo(e,n,r);a<s;){for(fo(e,a,s),++a,--s;i(e[a],o)<0;)++a;for(;i(e[s],o)>0;)--s}i(e[n],o)===0?fo(e,n,s):(++s,fo(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function fo(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Wm(e,t=_e){let n,r=!1;if(t.length===1){let i;for(const o of e){const a=t(o);(r?_e(a,i)>0:_e(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of e)(r?t(i,n)>0:t(i,i)===0)&&(n=i,r=!0);return n}function ho(e,t,n){if(e=Float64Array.from(SD(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return ss(e);if(t>=1)return co(e);var r,i=(r-1)*t,o=Math.floor(i),a=co(ls(e,o).subarray(0,o+1)),s=ss(e.subarray(o+1));return a+(s-a)*(i-o)}}function Vm(e,t,n=rs){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e),s=+n(e[o+1],o+1,e);return a+(s-a)*(i-o)}}function Ym(e,t,n=rs){if(!isNaN(t=+t)){if(r=Float64Array.from(e,(s,l)=>rs(n(e[l],l,e))),t<=0)return Rc(r);if(t>=1)return kc(r);var r,i=Uint32Array.from(e,(s,l)=>l),o=r.length-1,a=Math.floor(o*t);return ls(i,a,0,o,(s,l)=>qr(r[s],r[l])),a=Wm(i.subarray(0,a+1),s=>r[s]),a>=0?a:-1}}function jD(e,t,n){const r=is(e),i=ho(e,.75)-ho(e,.25);return r&&i?Math.ceil((n-t)/(2*i*Math.pow(r,-1/3))):1}function HD(e,t,n){const r=is(e),i=Lm(e);return r&&i?Math.ceil((n-t)*Math.cbrt(r)/(3.49*i)):1}function qD(e,t){let n=0,r=0;if(t===void 0)for(let i of e)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function ZD(e,t){return ho(e,.5,t)}function KD(e,t){return Ym(e,.5,t)}function*QD(e){for(const t of e)yield*t}function Ic(e){return Array.from(QD(e))}function JD(e,t){const n=new uo;if(t===void 0)for(let o of e)o!=null&&o>=o&&n.set(o,(n.get(o)||0)+1);else{let o=-1;for(let a of e)(a=t(a,++o,e))!=null&&a>=a&&n.set(a,(n.get(a)||0)+1)}let r,i=0;for(const[o,a]of n)a>i&&(i=a,r=o);return r}function eC(e,t=tC){const n=[];let r,i=!1;for(const o of e)i&&n.push(t(r,o)),r=o,i=!0;return n}function tC(e,t){return[e,t]}function Cn(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function nC(e,t=_e){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");let n=Array.from(e);const r=new Float64Array(n.length);t.length!==2&&(n=n.map(t),t=_e);const i=(s,l)=>t(n[s],n[l]);let o,a;return e=Uint32Array.from(n,(s,l)=>l),e.sort(t===_e?(s,l)=>qr(n[s],n[l]):Dc(i)),e.forEach((s,l)=>{const u=i(s,o===void 0?s:o);u>=0?((o===void 0||u>0)&&(o=s,a=l),r[s]=a):r[s]=NaN}),r}function rC(e,t=_e){let n,r=!1;if(t.length===1){let i;for(const o of e){const a=t(o);(r?_e(a,i)<0:_e(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of e)(r?t(i,n)<0:t(i,i)===0)&&(n=i,r=!0);return n}function Xm(e,t=_e){if(t.length===1)return Rc(e,t);let n,r=-1,i=-1;for(const o of e)++i,(r<0?t(o,o)===0:t(o,n)<0)&&(n=o,r=i);return r}function iC(e,t=_e){if(t.length===1)return kc(e,t);let n,r=-1,i=-1;for(const o of e)++i,(r<0?t(o,o)===0:t(o,n)>0)&&(n=o,r=i);return r}function oC(e,t){const n=Xm(e,t);return n<0?void 0:n}const aC=Um(Math.random);function Um(e){return function(n,r=0,i=n.length){let o=i-(r=+r);for(;o;){const a=e()*o--|0,s=n[o+r];n[o+r]=n[a+r],n[a+r]=s}return n}}function Ec(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function jm(e){if(!(o=e.length))return[];for(var t=-1,n=ss(e,sC),r=new Array(n);++t<n;)for(var i=-1,o,a=r[t]=new Array(o);++i<o;)a[i]=e[i][t];return r}function sC(e){return e.length}function lC(){return jm(arguments)}function uC(e,t){if(typeof t!="function")throw new TypeError("test is not a function");let n=-1;for(const r of e)if(!t(r,++n,e))return!1;return!0}function cC(e,t){if(typeof t!="function")throw new TypeError("test is not a function");let n=-1;for(const r of e)if(t(r,++n,e))return!0;return!1}function fC(e,t){if(typeof t!="function")throw new TypeError("test is not a function");const n=[];let r=-1;for(const i of e)t(i,++r,e)&&n.push(i);return n}function hC(e,t){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");if(typeof t!="function")throw new TypeError("mapper is not a function");return Array.from(e,(n,r)=>t(n,r,e))}function pC(e,t,n){if(typeof t!="function")throw new TypeError("reducer is not a function");const r=e[Symbol.iterator]();let i,o,a=-1;if(arguments.length<3){if({done:i,value:n}=r.next(),i)return;++a}for(;{done:i,value:o}=r.next(),!i;)n=t(n,o,++a,e);return n}function gC(e){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(e).reverse()}function dC(e,...t){e=new Zn(e);for(const n of t)for(const r of n)e.delete(r);return e}function mC(e,t){const n=t[Symbol.iterator](),r=new Zn;for(const i of e){if(r.has(i))return!1;let o,a;for(;({value:o,done:a}=n.next())&&!a;){if(Object.is(i,o))return!1;r.add(o)}}return!0}function yC(e,...t){e=new Zn(e),t=t.map(bC);e:for(const n of e)for(const r of t)if(!r.has(n)){e.delete(n);continue e}return e}function bC(e){return e instanceof Zn?e:new Zn(e)}function Hm(e,t){const n=e[Symbol.iterator](),r=new Set;for(const i of t){const o=qm(i);if(r.has(o))continue;let a,s;for(;{value:a,done:s}=n.next();){if(s)return!1;const l=qm(a);if(r.add(l),Object.is(o,l))break}}return!0}function qm(e){return e!==null&&typeof e=="object"?e.valueOf():e}function xC(e,t){return Hm(t,e)}function $C(...e){const t=new Zn;for(const n of e)for(const r of n)t.add(r);return t}function vC(e){return e}var us=1,cs=2,Bc=3,po=4,Zm=1e-6;function SC(e){return"translate("+e+",0)"}function TC(e){return"translate(0,"+e+")"}function _C(e){return t=>+e(t)}function AC(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function wC(){return!this.__axis}function fs(e,t){var n=[],r=null,i=null,o=6,a=6,s=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=e===us||e===po?-1:1,c=e===po||e===cs?"x":"y",h=e===us||e===Bc?SC:TC;function f(p){var g=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):vC),d=Math.max(o,0)+s,y=t.range(),b=+y[0]+l,x=+y[y.length-1]+l,$=(t.bandwidth?AC:_C)(t.copy(),l),S=p.selection?p.selection():p,_=S.selectAll(".domain").data([null]),A=S.selectAll(".tick").data(g,t).order(),w=A.exit(),P=A.enter().append("g").attr("class","tick"),I=A.select("line"),v=A.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(P),I=I.merge(P.append("line").attr("stroke","currentColor").attr(c+"2",u*o)),v=v.merge(P.append("text").attr("fill","currentColor").attr(c,u*d).attr("dy",e===us?"0em":e===Bc?"0.71em":"0.32em")),p!==S&&(_=_.transition(p),A=A.transition(p),I=I.transition(p),v=v.transition(p),w=w.transition(p).attr("opacity",Zm).attr("transform",function(N){return isFinite(N=$(N))?h(N+l):this.getAttribute("transform")}),P.attr("opacity",Zm).attr("transform",function(N){var R=this.parentNode.__axis;return h((R&&isFinite(R=R(N))?R:$(N))+l)})),w.remove(),_.attr("d",e===po||e===cs?a?"M"+u*a+","+b+"H"+l+"V"+x+"H"+u*a:"M"+l+","+b+"V"+x:a?"M"+b+","+u*a+"V"+l+"H"+x+"V"+u*a:"M"+b+","+l+"H"+x),A.attr("opacity",1).attr("transform",function(N){return h($(N)+l)}),I.attr(c+"2",u*o),v.attr(c,u*d).text(m),S.filter(wC).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===cs?"start":e===po?"end":"middle"),S.each(function(){this.__axis=$})}return f.scale=function(p){return arguments.length?(t=p,f):t},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),f):n.slice()},f.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),f):r&&r.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(o=a=+p,f):o},f.tickSizeInner=function(p){return arguments.length?(o=+p,f):o},f.tickSizeOuter=function(p){return arguments.length?(a=+p,f):a},f.tickPadding=function(p){return arguments.length?(s=+p,f):s},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function hs(e){return fs(us,e)}function PC(e){return fs(cs,e)}function Km(e){return fs(Bc,e)}function Nc(e){return fs(po,e)}var DC={value:()=>{}};function Jn(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ps(n)}function ps(e){this._=e}function CC(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ps.prototype=Jn.prototype={constructor:ps,on:function(e,t){var n=this._,r=CC(e+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(e=r[o]).type)&&(i=LC(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(i=(e=r[o]).type)n[i]=Qm(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Qm(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ps(e)},call:function(e,t){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(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function LC(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Qm(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=DC,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Fc="http://www.w3.org/1999/xhtml";const zc={svg:"http://www.w3.org/2000/svg",xhtml:Fc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function go(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),zc.hasOwnProperty(t)?{space:zc[t],local:e}:e}function MC(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Fc&&t.documentElement.namespaceURI===Fc?t.createElement(e):t.createElementNS(n,e)}}function kC(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gs(e){var t=go(e);return(t.local?kC:MC)(t)}function RC(){}function ds(e){return e==null?RC:function(){return this.querySelector(e)}}function IC(e){typeof e!="function"&&(e=ds(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=new Array(a),l,u,c=0;c<a;++c)(l=o[c])&&(u=e.call(l,l.__data__,c,o))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new qe(r,this._parents)}function Jm(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function EC(){return[]}function Oc(e){return e==null?EC:function(){return this.querySelectorAll(e)}}function BC(e){return function(){return Jm(e.apply(this,arguments))}}function NC(e){typeof e=="function"?e=BC(e):e=Oc(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var a=t[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&(r.push(e.call(l,l.__data__,u,a)),i.push(l));return new qe(r,i)}function Gc(e){return function(){return this.matches(e)}}function e0(e){return function(t){return t.matches(e)}}var FC=Array.prototype.find;function zC(e){return function(){return FC.call(this.children,e)}}function OC(){return this.firstElementChild}function GC(e){return this.select(e==null?OC:zC(typeof e=="function"?e:e0(e)))}var WC=Array.prototype.filter;function VC(){return Array.from(this.children)}function YC(e){return function(){return WC.call(this.children,e)}}function XC(e){return this.selectAll(e==null?VC:YC(typeof e=="function"?e:e0(e)))}function UC(e){typeof e!="function"&&(e=Gc(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&s.push(l);return new qe(r,this._parents)}function t0(e){return new Array(e.length)}function jC(){return new qe(this._enter||this._groups.map(t0),this._parents)}function ms(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ms.prototype={constructor:ms,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function HC(e){return function(){return e}}function qC(e,t,n,r,i,o){for(var a=0,s,l=t.length,u=o.length;a<u;++a)(s=t[a])?(s.__data__=o[a],r[a]=s):n[a]=new ms(e,o[a]);for(;a<l;++a)(s=t[a])&&(i[a]=s)}function ZC(e,t,n,r,i,o,a){var s,l,u=new Map,c=t.length,h=o.length,f=new Array(c),p;for(s=0;s<c;++s)(l=t[s])&&(f[s]=p=a.call(l,l.__data__,s,t)+"",u.has(p)?i[s]=l:u.set(p,l));for(s=0;s<h;++s)p=a.call(e,o[s],s,o)+"",(l=u.get(p))?(r[s]=l,l.__data__=o[s],u.delete(p)):n[s]=new ms(e,o[s]);for(s=0;s<c;++s)(l=t[s])&&u.get(f[s])===l&&(i[s]=l)}function KC(e){return e.__data__}function QC(e,t){if(!arguments.length)return Array.from(this,KC);var n=t?ZC:qC,r=this._parents,i=this._groups;typeof e!="function"&&(e=HC(e));for(var o=i.length,a=new Array(o),s=new Array(o),l=new Array(o),u=0;u<o;++u){var c=r[u],h=i[u],f=h.length,p=JC(e.call(c,c&&c.__data__,u,r)),g=p.length,m=s[u]=new Array(g),d=a[u]=new Array(g),y=l[u]=new Array(f);n(c,h,m,d,y,p,t);for(var b=0,x=0,$,S;b<g;++b)if($=m[b]){for(b>=x&&(x=b+1);!(S=d[x])&&++x<g;);$._next=S||null}}return a=new qe(a,r),a._enter=s,a._exit=l,a}function JC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function eL(){return new qe(this._exit||this._groups.map(t0),this._parents)}function tL(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function nL(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=r[l],h=u.length,f=s[l]=new Array(h),p,g=0;g<h;++g)(p=u[g]||c[g])&&(f[g]=p);for(;l<i;++l)s[l]=n[l];return new qe(s,this._parents)}function rL(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],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 iL(e){e||(e=oL);function t(h,f){return h&&f?e(h.__data__,f.__data__):!h-!f}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,l=i[o]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(t)}return new qe(i,this._parents).order()}function oL(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function aL(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function sL(){return Array.from(this)}function lL(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function uL(){let e=0;for(const t of this)++e;return e}function cL(){return!this.node()}function fL(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&e.call(s,s.__data__,o,i);return this}function hL(e){return function(){this.removeAttribute(e)}}function pL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function gL(e,t){return function(){this.setAttribute(e,t)}}function dL(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function mL(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function yL(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function bL(e,t){var n=go(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?pL:hL:typeof t=="function"?n.local?yL:mL:n.local?dL:gL)(n,t))}function Wc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function xL(e){return function(){this.style.removeProperty(e)}}function $L(e,t,n){return function(){this.style.setProperty(e,t,n)}}function vL(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function SL(e,t,n){return arguments.length>1?this.each((t==null?xL:typeof t=="function"?vL:$L)(e,t,n??"")):er(this.node(),e)}function er(e,t){return e.style.getPropertyValue(t)||Wc(e).getComputedStyle(e,null).getPropertyValue(t)}function TL(e){return function(){delete this[e]}}function _L(e,t){return function(){this[e]=t}}function AL(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function wL(e,t){return arguments.length>1?this.each((t==null?TL:typeof t=="function"?AL:_L)(e,t)):this.node()[e]}function n0(e){return e.trim().split(/^|\s+/)}function Vc(e){return e.classList||new r0(e)}function r0(e){this._node=e,this._names=n0(e.getAttribute("class")||"")}r0.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function i0(e,t){for(var n=Vc(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function o0(e,t){for(var n=Vc(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function PL(e){return function(){i0(this,e)}}function DL(e){return function(){o0(this,e)}}function CL(e,t){return function(){(t.apply(this,arguments)?i0:o0)(this,e)}}function LL(e,t){var n=n0(e+"");if(arguments.length<2){for(var r=Vc(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?CL:t?PL:DL)(n,t))}function ML(){this.textContent=""}function kL(e){return function(){this.textContent=e}}function RL(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function IL(e){return arguments.length?this.each(e==null?ML:(typeof e=="function"?RL:kL)(e)):this.node().textContent}function EL(){this.innerHTML=""}function BL(e){return function(){this.innerHTML=e}}function NL(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function FL(e){return arguments.length?this.each(e==null?EL:(typeof e=="function"?NL:BL)(e)):this.node().innerHTML}function zL(){this.nextSibling&&this.parentNode.appendChild(this)}function OL(){return this.each(zL)}function GL(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function WL(){return this.each(GL)}function VL(e){var t=typeof e=="function"?e:gs(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function YL(){return null}function XL(e,t){var n=typeof e=="function"?e:gs(e),r=t==null?YL:typeof t=="function"?t:ds(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function UL(){var e=this.parentNode;e&&e.removeChild(this)}function jL(){return this.each(UL)}function HL(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qL(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ZL(e){return this.select(e?qL:HL)}function KL(e){return arguments.length?this.property("__data__",e):this.node().__data__}function QL(e){return function(t){e.call(this,t,this.__data__)}}function JL(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function eM(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function tM(e,t,n){return function(){var r=this.__on,i,o=QL(t);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function nM(e,t,n){var r=JL(e+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,c;l<u;++l)for(i=0,c=s[l];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=t?tM:eM,i=0;i<o;++i)this.each(s(r[i],t,n));return this}function a0(e,t,n){var r=Wc(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function rM(e,t){return function(){return a0(this,e,t)}}function iM(e,t){return function(){return a0(this,e,t.apply(this,arguments))}}function oM(e,t){return this.each((typeof t=="function"?iM:rM)(e,t))}function*aM(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var Yc=[null];function qe(e,t){this._groups=e,this._parents=t}function tr(){return new qe([[document.documentElement]],Yc)}function sM(){return this}qe.prototype=tr.prototype={constructor:qe,select:IC,selectAll:NC,selectChild:GC,selectChildren:XC,filter:UC,data:QC,enter:jC,exit:eL,join:tL,merge:nL,selection:sM,order:rL,sort:iL,call:aL,nodes:sL,node:lL,size:uL,empty:cL,each:fL,attr:bL,style:SL,property:wL,classed:LL,text:IL,html:FL,raise:OL,lower:WL,append:VL,insert:XL,remove:jL,clone:ZL,datum:KL,on:nM,dispatch:oM,[Symbol.iterator]:aM};function X(e){return typeof e=="string"?new qe([[document.querySelector(e)]],[document.documentElement]):new qe([[e]],Yc)}function lM(e){return X(gs(e).call(document.documentElement))}var uM=0;function s0(){return new Xc}function Xc(){this._="@"+(++uM).toString(36)}Xc.prototype=s0.prototype={constructor:Xc,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};function l0(e){let t;for(;t=e.sourceEvent;)e=t;return e}function yt(e,t){if(e=l0(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}function cM(e,t){return e.target&&(e=l0(e),t===void 0&&(t=e.currentTarget),e=e.touches||[e]),Array.from(e,n=>yt(n,t))}function fM(e){return typeof e=="string"?new qe([document.querySelectorAll(e)],[document.documentElement]):new qe([Jm(e)],Yc)}const hM={passive:!1},mo={capture:!0,passive:!1};function Uc(e){e.stopImmediatePropagation()}function Zr(e){e.preventDefault(),e.stopImmediatePropagation()}function ys(e){var t=e.document.documentElement,n=X(e).on("dragstart.drag",Zr,mo);"onselectstart"in t?n.on("selectstart.drag",Zr,mo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function bs(e,t){var n=e.document.documentElement,r=X(e).on("dragstart.drag",null);t&&(r.on("click.drag",Zr,mo),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const xs=e=>()=>e;function jc(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:a,y:s,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}jc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function pM(e){return!e.ctrlKey&&!e.button}function gM(){return this.parentNode}function dM(e,t){return t??{x:e.x,y:e.y}}function mM(){return navigator.maxTouchPoints||"ontouchstart"in this}function $s(){var e=pM,t=gM,n=dM,r=mM,i={},o=Jn("start","drag","end"),a=0,s,l,u,c,h=0;function f($){$.on("mousedown.drag",p).filter(r).on("touchstart.drag",d).on("touchmove.drag",y,hM).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p($,S){if(!(c||!e.call(this,$,S))){var _=x(this,t.call(this,$,S),$,S,"mouse");_&&(X($.view).on("mousemove.drag",g,mo).on("mouseup.drag",m,mo),ys($.view),Uc($),u=!1,s=$.clientX,l=$.clientY,_("start",$))}}function g($){if(Zr($),!u){var S=$.clientX-s,_=$.clientY-l;u=S*S+_*_>h}i.mouse("drag",$)}function m($){X($.view).on("mousemove.drag mouseup.drag",null),bs($.view,u),Zr($),i.mouse("end",$)}function d($,S){if(e.call(this,$,S)){var _=$.changedTouches,A=t.call(this,$,S),w=_.length,P,I;for(P=0;P<w;++P)(I=x(this,A,$,S,_[P].identifier,_[P]))&&(Uc($),I("start",$,_[P]))}}function y($){var S=$.changedTouches,_=S.length,A,w;for(A=0;A<_;++A)(w=i[S[A].identifier])&&(Zr($),w("drag",$,S[A]))}function b($){var S=$.changedTouches,_=S.length,A,w;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),A=0;A<_;++A)(w=i[S[A].identifier])&&(Uc($),w("end",$,S[A]))}function x($,S,_,A,w,P){var I=o.copy(),v=yt(P||_,S),N,R,D;if((D=n.call($,new jc("beforestart",{sourceEvent:_,target:f,identifier:w,active:a,x:v[0],y:v[1],dx:0,dy:0,dispatch:I}),A))!=null)return N=D.x-v[0]||0,R=D.y-v[1]||0,function T(M,O,k){var B=v,F;switch(M){case"start":i[w]=T,F=a++;break;case"end":delete i[w],--a;case"drag":v=yt(k||O,S),F=a;break}I.call(M,$,new jc(M,{sourceEvent:O,subject:D,target:f,identifier:w,active:F,x:v[0]+N,y:v[1]+R,dx:v[0]-B[0],dy:v[1]-B[1],dispatch:I}),A)}}return f.filter=function($){return arguments.length?(e=typeof $=="function"?$:xs(!!$),f):e},f.container=function($){return arguments.length?(t=typeof $=="function"?$:xs($),f):t},f.subject=function($){return arguments.length?(n=typeof $=="function"?$:xs($),f):n},f.touchable=function($){return arguments.length?(r=typeof $=="function"?$:xs(!!$),f):r},f.on=function(){var $=o.on.apply(o,arguments);return $===o?f:$},f.clickDistance=function($){return arguments.length?(h=($=+$)*$,f):Math.sqrt(h)},f}function Kr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function yo(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ln(){}var nr=.7,Qr=1/nr,Jr="\\s*([+-]?\\d+)\\s*",bo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ut="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",yM=/^#([0-9a-f]{3,8})$/,bM=new RegExp(`^rgb\\(${Jr},${Jr},${Jr}\\)$`),xM=new RegExp(`^rgb\\(${Ut},${Ut},${Ut}\\)$`),$M=new RegExp(`^rgba\\(${Jr},${Jr},${Jr},${bo}\\)$`),vM=new RegExp(`^rgba\\(${Ut},${Ut},${Ut},${bo}\\)$`),SM=new RegExp(`^hsl\\(${bo},${Ut},${Ut}\\)$`),TM=new RegExp(`^hsla\\(${bo},${Ut},${Ut},${bo}\\)$`),u0={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};Kr(Ln,Mn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:c0,formatHex:c0,formatHex8:_M,formatHsl:AM,formatRgb:f0,toString:f0});function c0(){return this.rgb().formatHex()}function _M(){return this.rgb().formatHex8()}function AM(){return m0(this).formatHsl()}function f0(){return this.rgb().formatRgb()}function Mn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=yM.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?h0(t):n===3?new Ie(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?vs(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?vs(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=bM.exec(e))?new Ie(t[1],t[2],t[3],1):(t=xM.exec(e))?new Ie(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=$M.exec(e))?vs(t[1],t[2],t[3],t[4]):(t=vM.exec(e))?vs(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=SM.exec(e))?d0(t[1],t[2]/100,t[3]/100,1):(t=TM.exec(e))?d0(t[1],t[2]/100,t[3]/100,t[4]):u0.hasOwnProperty(e)?h0(u0[e]):e==="transparent"?new Ie(NaN,NaN,NaN,0):null}function h0(e){return new Ie(e>>16&255,e>>8&255,e&255,1)}function vs(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ie(e,t,n,r)}function Hc(e){return e instanceof Ln||(e=Mn(e)),e?(e=e.rgb(),new Ie(e.r,e.g,e.b,e.opacity)):new Ie}function ei(e,t,n,r){return arguments.length===1?Hc(e):new Ie(e,t,n,r??1)}function Ie(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Kr(Ie,ei,yo(Ln,{brighter(e){return e=e==null?Qr:Math.pow(Qr,e),new Ie(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?nr:Math.pow(nr,e),new Ie(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ie(rr(this.r),rr(this.g),rr(this.b),Ss(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:p0,formatHex:p0,formatHex8:wM,formatRgb:g0,toString:g0}));function p0(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}`}function wM(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}${ir((isNaN(this.opacity)?1:this.opacity)*255)}`}function g0(){const e=Ss(this.opacity);return`${e===1?"rgb(":"rgba("}${rr(this.r)}, ${rr(this.g)}, ${rr(this.b)}${e===1?")":`, ${e})`}`}function Ss(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function rr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ir(e){return e=rr(e),(e<16?"0":"")+e.toString(16)}function d0(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new It(e,t,n,r)}function m0(e){if(e instanceof It)return new It(e.h,e.s,e.l,e.opacity);if(e instanceof Ln||(e=Mn(e)),!e)return new It;if(e instanceof It)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(t===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-t)/s+2:a=(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new It(a,s,l,e.opacity)}function Ts(e,t,n,r){return arguments.length===1?m0(e):new It(e,t,n,r??1)}function It(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Kr(It,Ts,yo(Ln,{brighter(e){return e=e==null?Qr:Math.pow(Qr,e),new It(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?nr:Math.pow(nr,e),new It(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ie(qc(e>=240?e-240:e+120,i,r),qc(e,i,r),qc(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new It(y0(this.h),_s(this.s),_s(this.l),Ss(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ss(this.opacity);return`${e===1?"hsl(":"hsla("}${y0(this.h)}, ${_s(this.s)*100}%, ${_s(this.l)*100}%${e===1?")":`, ${e})`}`}}));function y0(e){return e=(e||0)%360,e<0?e+360:e}function _s(e){return Math.max(0,Math.min(1,e||0))}function qc(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const b0=Math.PI/180,x0=180/Math.PI,As=18,$0=.96422,v0=1,S0=.82521,T0=4/29,ti=6/29,_0=3*ti*ti,PM=ti*ti*ti;function A0(e){if(e instanceof Et)return new Et(e.l,e.a,e.b,e.opacity);if(e instanceof jt)return P0(e);e instanceof Ie||(e=Hc(e));var t=Jc(e.r),n=Jc(e.g),r=Jc(e.b),i=Zc((.2225045*t+.7168786*n+.0606169*r)/v0),o,a;return t===n&&n===r?o=a=i:(o=Zc((.4360747*t+.3850649*n+.1430804*r)/$0),a=Zc((.0139322*t+.0971045*n+.7141733*r)/S0)),new Et(116*i-16,500*(o-i),200*(i-a),e.opacity)}function DM(e,t){return new Et(e,0,0,t??1)}function xo(e,t,n,r){return arguments.length===1?A0(e):new Et(e,t,n,r??1)}function Et(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}Kr(Et,xo,yo(Ln,{brighter(e){return new Et(this.l+As*(e??1),this.a,this.b,this.opacity)},darker(e){return new Et(this.l-As*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=$0*Kc(t),e=v0*Kc(e),n=S0*Kc(n),new Ie(Qc(3.1338561*t-1.6168667*e-.4906146*n),Qc(-.9787684*t+1.9161415*e+.033454*n),Qc(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Zc(e){return e>PM?Math.pow(e,1/3):e/_0+T0}function Kc(e){return e>ti?e*e*e:_0*(e-T0)}function Qc(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Jc(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function w0(e){if(e instanceof jt)return new jt(e.h,e.c,e.l,e.opacity);if(e instanceof Et||(e=A0(e)),e.a===0&&e.b===0)return new jt(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*x0;return new jt(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function CM(e,t,n,r){return arguments.length===1?w0(e):new jt(n,t,e,r??1)}function ws(e,t,n,r){return arguments.length===1?w0(e):new jt(e,t,n,r??1)}function jt(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function P0(e){if(isNaN(e.h))return new Et(e.l,0,0,e.opacity);var t=e.h*b0;return new Et(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Kr(jt,ws,yo(Ln,{brighter(e){return new jt(this.h,this.c,this.l+As*(e??1),this.opacity)},darker(e){return new jt(this.h,this.c,this.l-As*(e??1),this.opacity)},rgb(){return P0(this).rgb()}}));var D0=-.14861,ef=1.78277,tf=-.29227,Ps=-.90649,$o=1.97294,C0=$o*Ps,L0=$o*ef,M0=ef*tf-Ps*D0;function LM(e){if(e instanceof or)return new or(e.h,e.s,e.l,e.opacity);e instanceof Ie||(e=Hc(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(M0*r+C0*t-L0*n)/(M0+C0-L0),o=r-i,a=($o*(n-i)-tf*o)/Ps,s=Math.sqrt(a*a+o*o)/($o*i*(1-i)),l=s?Math.atan2(a,o)*x0-120:NaN;return new or(l<0?l+360:l,s,i,e.opacity)}function Bt(e,t,n,r){return arguments.length===1?LM(e):new or(e,t,n,r??1)}function or(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Kr(or,Bt,yo(Ln,{brighter(e){return e=e==null?Qr:Math.pow(Qr,e),new or(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?nr:Math.pow(nr,e),new or(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*b0,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Ie(255*(t+n*(D0*r+ef*i)),255*(t+n*(tf*r+Ps*i)),255*(t+n*($o*r)),this.opacity)}}));function k0(e,t,n,r,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*n+(1+3*e+3*o-3*a)*r+a*i)/6}function R0(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],a=r>0?e[r-1]:2*i-o,s=r<t-1?e[r+2]:2*o-i;return k0((n-r/t)*t,a,i,o,s)}}function I0(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],o=e[r%t],a=e[(r+1)%t],s=e[(r+2)%t];return k0((n-r/t)*t,i,o,a,s)}}const Ds=e=>()=>e;function E0(e,t){return function(n){return e+n*t}}function MM(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Cs(e,t){var n=t-e;return n?E0(e,n>180||n<-180?n-360*Math.round(n/360):n):Ds(isNaN(e)?t:e)}function kM(e){return(e=+e)==1?Ee:function(t,n){return n-t?MM(t,n,e):Ds(isNaN(t)?n:t)}}function Ee(e,t){var n=t-e;return n?E0(e,n):Ds(isNaN(e)?t:e)}const vo=function e(t){var n=kM(t);function r(i,o){var a=n((i=ei(i)).r,(o=ei(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),u=Ee(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function B0(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),o=new Array(n),a,s;for(a=0;a<n;++a)s=ei(t[a]),r[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return r=e(r),i=e(i),o=e(o),s.opacity=1,function(l){return s.r=r(l),s.g=i(l),s.b=o(l),s+""}}}var N0=B0(R0),RM=B0(I0);function nf(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function F0(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function IM(e,t){return(F0(t)?nf:z0)(e,t)}function z0(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=sn(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function O0(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function bt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function G0(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=sn(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var rf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,of=new RegExp(rf.source,"g");function EM(e){return function(){return e}}function BM(e){return function(t){return e(t)+""}}function af(e,t){var n=rf.lastIndex=of.lastIndex=0,r,i,o,a=-1,s=[],l=[];for(e=e+"",t=t+"";(r=rf.exec(e))&&(i=of.exec(t));)(o=i.index)>n&&(o=t.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,l.push({i:a,x:bt(r,i)})),n=of.lastIndex;return n<t.length&&(o=t.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?BM(l[0].x):EM(t):(t=l.length,function(u){for(var c=0,h;c<t;++c)s[(h=l[c]).i]=h.x(u);return s.join("")})}function sn(e,t){var n=typeof t,r;return t==null||n==="boolean"?Ds(t):(n==="number"?bt:n==="string"?(r=Mn(t))?(t=r,vo):af:t instanceof Mn?vo:t instanceof Date?O0:F0(t)?nf:Array.isArray(t)?z0:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?G0:bt)(e,t)}function NM(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function FM(e,t){var n=Cs(+e,+t);return function(r){var i=n(r);return i-360*Math.floor(i/360)}}function So(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var W0=180/Math.PI,sf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function V0(e,t,n,r,i,o){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*W0,skewX:Math.atan(l)*W0,scaleX:a,scaleY:s}}var Ls;function zM(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?sf:V0(t.a,t.b,t.c,t.d,t.e,t.f)}function OM(e){return e==null||(Ls||(Ls=document.createElementNS("http://www.w3.org/2000/svg","g")),Ls.setAttribute("transform",e),!(e=Ls.transform.baseVal.consolidate()))?sf:(e=e.matrix,V0(e.a,e.b,e.c,e.d,e.e,e.f))}function Y0(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,c,h,f,p,g){if(u!==h||c!==f){var m=p.push("translate(",null,t,null,n);g.push({i:m-4,x:bt(u,h)},{i:m-2,x:bt(c,f)})}else(h||f)&&p.push("translate("+h+t+f+n)}function a(u,c,h,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:h.push(i(h)+"rotate(",null,r)-2,x:bt(u,c)})):c&&h.push(i(h)+"rotate("+c+r)}function s(u,c,h,f){u!==c?f.push({i:h.push(i(h)+"skewX(",null,r)-2,x:bt(u,c)}):c&&h.push(i(h)+"skewX("+c+r)}function l(u,c,h,f,p,g){if(u!==h||c!==f){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:bt(u,h)},{i:m-2,x:bt(c,f)})}else(h!==1||f!==1)&&p.push(i(p)+"scale("+h+","+f+")")}return function(u,c){var h=[],f=[];return u=e(u),c=e(c),o(u.translateX,u.translateY,c.translateX,c.translateY,h,f),a(u.rotate,c.rotate,h,f),s(u.skewX,c.skewX,h,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,h,f),u=c=null,function(p){for(var g=-1,m=f.length,d;++g<m;)h[(d=f[g]).i]=d.x(p);return h.join("")}}}var X0=Y0(zM,"px, ","px)","deg)"),U0=Y0(OM,", ",")",")"),GM=1e-12;function j0(e){return((e=Math.exp(e))+1/e)/2}function WM(e){return((e=Math.exp(e))-1/e)/2}function VM(e){return((e=Math.exp(2*e))-1)/(e+1)}const H0=function e(t,n,r){function i(o,a){var s=o[0],l=o[1],u=o[2],c=a[0],h=a[1],f=a[2],p=c-s,g=h-l,m=p*p+g*g,d,y;if(m<GM)y=Math.log(f/u)/t,d=function(A){return[s+A*p,l+A*g,u*Math.exp(t*A*y)]};else{var b=Math.sqrt(m),x=(f*f-u*u+r*m)/(2*u*n*b),$=(f*f-u*u-r*m)/(2*f*n*b),S=Math.log(Math.sqrt(x*x+1)-x),_=Math.log(Math.sqrt($*$+1)-$);y=(_-S)/t,d=function(A){var w=A*y,P=j0(S),I=u/(n*b)*(P*VM(t*w+S)-WM(S));return[s+I*p,l+I*g,u*P/j0(t*w+S)]}}return d.duration=y*1e3*t/Math.SQRT2,d}return i.rho=function(o){var a=Math.max(.001,+o),s=a*a,l=s*s;return e(a,s,l)},i}(Math.SQRT2,2,4);function q0(e){return function(t,n){var r=e((t=Ts(t)).h,(n=Ts(n)).h),i=Ee(t.s,n.s),o=Ee(t.l,n.l),a=Ee(t.opacity,n.opacity);return function(s){return t.h=r(s),t.s=i(s),t.l=o(s),t.opacity=a(s),t+""}}}const YM=q0(Cs);var XM=q0(Ee);function UM(e,t){var n=Ee((e=xo(e)).l,(t=xo(t)).l),r=Ee(e.a,t.a),i=Ee(e.b,t.b),o=Ee(e.opacity,t.opacity);return function(a){return e.l=n(a),e.a=r(a),e.b=i(a),e.opacity=o(a),e+""}}function Z0(e){return function(t,n){var r=e((t=ws(t)).h,(n=ws(n)).h),i=Ee(t.c,n.c),o=Ee(t.l,n.l),a=Ee(t.opacity,n.opacity);return function(s){return t.h=r(s),t.c=i(s),t.l=o(s),t.opacity=a(s),t+""}}}const jM=Z0(Cs);var HM=Z0(Ee);function K0(e){return function t(n){n=+n;function r(i,o){var a=e((i=Bt(i)).h,(o=Bt(o)).h),s=Ee(i.s,o.s),l=Ee(i.l,o.l),u=Ee(i.opacity,o.opacity);return function(c){return i.h=a(c),i.s=s(c),i.l=l(Math.pow(c,n)),i.opacity=u(c),i+""}}return r.gamma=t,r}(1)}const qM=K0(Cs);var Ms=K0(Ee);function Q0(e,t){t===void 0&&(t=e,e=sn);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return function(a){var s=Math.max(0,Math.min(r-1,Math.floor(a*=r)));return o[s](a-s)}}function ZM(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var ni=0,To=0,_o=0,J0=1e3,ks,Ao,Rs=0,ar=0,Is=0,wo=typeof performance=="object"&&performance.now?performance:Date,ey=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Po(){return ar||(ey(KM),ar=wo.now()+Is)}function KM(){ar=0}function Do(){this._call=this._time=this._next=null}Do.prototype=Es.prototype={constructor:Do,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Po():+n)+(t==null?0:+t),!this._next&&Ao!==this&&(Ao?Ao._next=this:ks=this,Ao=this),this._call=e,this._time=n,lf()},stop:function(){this._call&&(this._call=null,this._time=1/0,lf())}};function Es(e,t,n){var r=new Do;return r.restart(e,t,n),r}function ty(){Po(),++ni;for(var e=ks,t;e;)(t=ar-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ni}function ny(){ar=(Rs=wo.now())+Is,ni=To=0;try{ty()}finally{ni=0,JM(),ar=0}}function QM(){var e=wo.now(),t=e-Rs;t>J0&&(Is-=t,Rs=e)}function JM(){for(var e,t=ks,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ks=n);Ao=e,lf(r)}function lf(e){if(!ni){To&&(To=clearTimeout(To));var t=e-ar;t>24?(e<1/0&&(To=setTimeout(ny,e-wo.now()-Is)),_o&&(_o=clearInterval(_o))):(_o||(Rs=wo.now(),_o=setInterval(QM,J0)),ni=1,ey(ny))}}function uf(e,t,n){var r=new Do;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}function e3(e,t,n){var r=new Do,i=t;return t==null?(r.restart(e,t,n),r):(r._restart=r.restart,r.restart=function(o,a,s){a=+a,s=s==null?Po():+s,r._restart(function l(u){u+=i,r._restart(l,i+=a,s),o(u)},a,s)},r.restart(e,t,n),r)}var t3=Jn("start","end","cancel","interrupt"),n3=[],ry=0,cf=1,ff=2,Bs=3,iy=4,hf=5,Ns=6;function Fs(e,t,n,r,i,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;r3(e,n,{name:t,index:r,group:i,on:t3,tween:n3,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:ry})}function pf(e,t){var n=Nt(e,t);if(n.state>ry)throw new Error("too late; already scheduled");return n}function Ht(e,t){var n=Nt(e,t);if(n.state>Bs)throw new Error("too late; already running");return n}function Nt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function r3(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Es(o,0,n.time);function o(u){n.state=cf,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,h,f,p;if(n.state!==cf)return l();for(c in r)if(p=r[c],p.name===n.name){if(p.state===Bs)return uf(a);p.state===iy?(p.state=Ns,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[c]):+c<t&&(p.state=Ns,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[c])}if(uf(function(){n.state===Bs&&(n.state=iy,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=ff,n.on.call("start",e,e.__data__,n.index,n.group),n.state===ff){for(n.state=Bs,i=new Array(f=n.tween.length),c=0,h=-1;c<f;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=p);i.length=h+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=hf,1),h=-1,f=i.length;++h<f;)i[h].call(e,c);n.state===hf&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Ns,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function sr(e,t){var n=e.__transition,r,i,o=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){o=!1;continue}i=r.state>ff&&r.state<hf,r.state=Ns,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}o&&delete e.__transition}}function i3(e){return this.each(function(){sr(this,e)})}function o3(e,t){var n,r;return function(){var i=Ht(this,e),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function a3(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Ht(this,e),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=s;break}l===u&&i.push(s)}o.tween=i}}function s3(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Nt(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?o3:a3)(n,e,t))}function gf(e,t,n){var r=e._id;return e.each(function(){var i=Ht(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Nt(i,r).value[t]}}function oy(e,t){var n;return(typeof t=="number"?bt:t instanceof Mn?vo:(n=Mn(t))?(t=n,vo):af)(e,t)}function l3(e){return function(){this.removeAttribute(e)}}function u3(e){return function(){this.removeAttributeNS(e.space,e.local)}}function c3(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function f3(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function h3(e,t,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s)))}}function p3(e,t,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s)))}}function g3(e,t){var n=go(e),r=n==="transform"?U0:oy;return this.attrTween(e,typeof t=="function"?(n.local?p3:h3)(n,r,gf(this,"attr."+e,t)):t==null?(n.local?u3:l3)(n):(n.local?f3:c3)(n,r,t))}function d3(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function m3(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function y3(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&m3(e,o)),n}return i._value=t,i}function b3(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&d3(e,o)),n}return i._value=t,i}function x3(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=go(e);return this.tween(n,(r.local?y3:b3)(r,t))}function $3(e,t){return function(){pf(this,e).delay=+t.apply(this,arguments)}}function v3(e,t){return t=+t,function(){pf(this,e).delay=t}}function S3(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$3:v3)(t,e)):Nt(this.node(),t).delay}function T3(e,t){return function(){Ht(this,e).duration=+t.apply(this,arguments)}}function _3(e,t){return t=+t,function(){Ht(this,e).duration=t}}function A3(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?T3:_3)(t,e)):Nt(this.node(),t).duration}function w3(e,t){if(typeof t!="function")throw new Error;return function(){Ht(this,e).ease=t}}function P3(e){var t=this._id;return arguments.length?this.each(w3(t,e)):Nt(this.node(),t).ease}function D3(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ht(this,e).ease=n}}function C3(e){if(typeof e!="function")throw new Error;return this.each(D3(this._id,e))}function L3(e){typeof e!="function"&&(e=Gc(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&s.push(l);return new qt(r,this._parents,this._name,this._id)}function M3(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var l=t[s],u=n[s],c=l.length,h=a[s]=new Array(c),f,p=0;p<c;++p)(f=l[p]||u[p])&&(h[p]=f);for(;s<r;++s)a[s]=t[s];return new qt(a,this._parents,this._name,this._id)}function k3(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function R3(e,t,n){var r,i,o=k3(t)?pf:Ht;return function(){var a=o(this,e),s=a.on;s!==r&&(i=(r=s).copy()).on(t,n),a.on=i}}function I3(e,t){var n=this._id;return arguments.length<2?Nt(this.node(),n).on.on(e):this.each(R3(n,e,t))}function E3(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function B3(){return this.on("end.remove",E3(this._id))}function N3(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ds(e));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],l=s.length,u=o[a]=new Array(l),c,h,f=0;f<l;++f)(c=s[f])&&(h=e.call(c,c.__data__,f,s))&&("__data__"in c&&(h.__data__=c.__data__),u[f]=h,Fs(u[f],t,n,f,u,Nt(c,n)));return new qt(o,this._parents,t,n)}function F3(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Oc(e));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var l=r[s],u=l.length,c,h=0;h<u;++h)if(c=l[h]){for(var f=e.call(c,c.__data__,h,l),p,g=Nt(c,n),m=0,d=f.length;m<d;++m)(p=f[m])&&Fs(p,t,n,m,f,g);o.push(f),a.push(c)}return new qt(o,a,t,n)}var z3=tr.prototype.constructor;function O3(){return new z3(this._groups,this._parents)}function G3(e,t){var n,r,i;return function(){var o=er(this,e),a=(this.style.removeProperty(e),er(this,e));return o===a?null:o===n&&a===r?i:i=t(n=o,r=a)}}function ay(e){return function(){this.style.removeProperty(e)}}function W3(e,t,n){var r,i=n+"",o;return function(){var a=er(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}function V3(e,t,n){var r,i,o;return function(){var a=er(this,e),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),er(this,e))),a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s))}}function Y3(e,t){var n,r,i,o="style."+t,a="end."+o,s;return function(){var l=Ht(this,e),u=l.on,c=l.value[o]==null?s||(s=ay(t)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(a,i=c),l.on=r}}function X3(e,t,n){var r=(e+="")=="transform"?X0:oy;return t==null?this.styleTween(e,G3(e,r)).on("end.style."+e,ay(e)):typeof t=="function"?this.styleTween(e,V3(e,r,gf(this,"style."+e,t))).each(Y3(this._id,e)):this.styleTween(e,W3(e,r,t),n).on("end.style."+e,null)}function U3(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function j3(e,t,n){var r,i;function o(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&U3(e,a,n)),r}return o._value=t,o}function H3(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,j3(e,t,n??""))}function q3(e){return function(){this.textContent=e}}function Z3(e){return function(){var t=e(this);this.textContent=t??""}}function K3(e){return this.tween("text",typeof e=="function"?Z3(gf(this,"text",e)):q3(e==null?"":e+""))}function Q3(e){return function(t){this.textContent=e.call(this,t)}}function J3(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Q3(i)),t}return r._value=e,r}function e5(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,J3(e))}function t5(){for(var e=this._name,t=this._id,n=ly(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)if(l=a[u]){var c=Nt(l,t);Fs(l,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new qt(r,this._parents,e,n)}function n5(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},l={value:function(){--i===0&&o()}};n.each(function(){var u=Ht(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),u.on=t}),i===0&&o()})}var r5=0;function qt(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function sy(e){return tr().transition(e)}function ly(){return++r5}var ln=tr.prototype;qt.prototype=sy.prototype={constructor:qt,select:N3,selectAll:F3,selectChild:ln.selectChild,selectChildren:ln.selectChildren,filter:L3,merge:M3,selection:O3,transition:t5,call:ln.call,nodes:ln.nodes,node:ln.node,size:ln.size,empty:ln.empty,each:ln.each,on:I3,attr:g3,attrTween:x3,style:X3,styleTween:H3,text:K3,textTween:e5,remove:B3,tween:s3,delay:S3,duration:A3,ease:P3,easeVarying:C3,end:n5,[Symbol.iterator]:ln[Symbol.iterator]};const Ft=e=>+e;function i5(e){return e*e}function o5(e){return e*(2-e)}function uy(e){return((e*=2)<=1?e*e:--e*(2-e)+1)/2}function a5(e){return e*e*e}function s5(e){return--e*e*e+1}function Co(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var df=3,l5=function e(t){t=+t;function n(r){return Math.pow(r,t)}return n.exponent=e,n}(df),u5=function e(t){t=+t;function n(r){return 1-Math.pow(1-r,t)}return n.exponent=e,n}(df),cy=function e(t){t=+t;function n(r){return((r*=2)<=1?Math.pow(r,t):2-Math.pow(2-r,t))/2}return n.exponent=e,n}(df),fy=Math.PI,hy=fy/2;function c5(e){return+e==1?1:1-Math.cos(e*hy)}function f5(e){return Math.sin(e*hy)}function py(e){return(1-Math.cos(fy*e))/2}function kn(e){return(Math.pow(2,-10*e)-.0009765625)*1.0009775171065494}function h5(e){return kn(1-+e)}function p5(e){return 1-kn(e)}function gy(e){return((e*=2)<=1?kn(1-e):2-kn(e-1))/2}function g5(e){return 1-Math.sqrt(1-e*e)}function d5(e){return Math.sqrt(1- --e*e)}function dy(e){return((e*=2)<=1?1-Math.sqrt(1-e*e):Math.sqrt(1-(e-=2)*e)+1)/2}var mf=4/11,m5=6/11,y5=8/11,b5=3/4,x5=9/11,$5=10/11,v5=15/16,S5=21/22,T5=63/64,zs=1/mf/mf;function _5(e){return 1-Lo(1-e)}function Lo(e){return(e=+e)<mf?zs*e*e:e<y5?zs*(e-=m5)*e+b5:e<$5?zs*(e-=x5)*e+v5:zs*(e-=S5)*e+T5}function A5(e){return((e*=2)<=1?1-Lo(1-e):Lo(e-1)+1)/2}var yf=1.70158,w5=function e(t){t=+t;function n(r){return(r=+r)*r*(t*(r-1)+r)}return n.overshoot=e,n}(yf),P5=function e(t){t=+t;function n(r){return--r*r*((r+1)*t+r)+1}return n.overshoot=e,n}(yf),my=function e(t){t=+t;function n(r){return((r*=2)<1?r*r*((t+1)*r-t):(r-=2)*r*((t+1)*r+t)+2)/2}return n.overshoot=e,n}(yf),ri=2*Math.PI,bf=1,xf=.3,D5=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=ri);function i(o){return t*kn(- --o)*Math.sin((r-o)/n)}return i.amplitude=function(o){return e(o,n*ri)},i.period=function(o){return e(t,o)},i}(bf,xf),lr=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=ri);function i(o){return 1-t*kn(o=+o)*Math.sin((o+r)/n)}return i.amplitude=function(o){return e(o,n*ri)},i.period=function(o){return e(t,o)},i}(bf,xf),C5=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=ri);function i(o){return((o=o*2-1)<0?t*kn(-o)*Math.sin((r-o)/n):2-t*kn(o)*Math.sin((r+o)/n))/2}return i.amplitude=function(o){return e(o,n*ri)},i.period=function(o){return e(t,o)},i}(bf,xf),L5={time:null,delay:0,duration:250,ease:Co};function M5(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function k5(e){var t,n;e instanceof qt?(t=e._id,e=e._name):(t=ly(),(n=L5).time=Po(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&Fs(l,e,t,u,a,n||M5(l,t));return new qt(r,this._parents,e,t)}tr.prototype.interrupt=i3,tr.prototype.transition=k5;var R5=[null];function I5(e,t){var n=e.__transition,r,i;if(n){t=t==null?null:t+"";for(i in n)if((r=n[i]).state>cf&&r.name===t)return new qt([[e]],R5,t,+i)}return null}const $f=e=>()=>e;function E5(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function B5(e){e.stopImmediatePropagation()}function vf(e){e.preventDefault(),e.stopImmediatePropagation()}var yy={name:"drag"},Sf={name:"space"},ii={name:"handle"},oi={name:"center"};const{abs:by,max:We,min:Ve}=Math;function xy(e){return[+e[0],+e[1]]}function Tf(e){return[xy(e[0]),xy(e[1])]}var Os={name:"x",handles:["w","e"].map(Mo),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},Gs={name:"y",handles:["n","s"].map(Mo),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},N5={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Mo),input:function(e){return e==null?null:Tf(e)},output:function(e){return e}},un={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},$y={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},vy={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},F5={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},z5={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Mo(e){return{type:e}}function O5(e){return!e.ctrlKey&&!e.button}function G5(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function W5(){return navigator.maxTouchPoints||"ontouchstart"in this}function _f(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function V5(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function Y5(e){var t=e.__brush;return t?t.dim.output(t.selection):null}function X5(){return Af(Os)}function U5(){return Af(Gs)}function j5(){return Af(N5)}function Af(e){var t=G5,n=O5,r=W5,i=!0,o=Jn("start","brush","end"),a=6,s;function l(d){var y=d.property("__brush",m).selectAll(".overlay").data([Mo("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",un.overlay).merge(y).each(function(){var x=_f(this).extent;X(this).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1])}),d.selectAll(".selection").data([Mo("selection")]).enter().append("rect").attr("class","selection").attr("cursor",un.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var b=d.selectAll(".handle").data(e.handles,function(x){return x.type});b.exit().remove(),b.enter().append("rect").attr("class",function(x){return"handle handle--"+x.type}).attr("cursor",function(x){return un[x.type]}),d.each(u).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",f).filter(r).on("touchstart.brush",f).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(d,y,b){d.tween?d.on("start.brush",function(x){c(this,arguments).beforestart().start(x)}).on("interrupt.brush end.brush",function(x){c(this,arguments).end(x)}).tween("brush",function(){var x=this,$=x.__brush,S=c(x,arguments),_=$.selection,A=e.input(typeof y=="function"?y.apply(this,arguments):y,$.extent),w=sn(_,A);function P(I){$.selection=I===1&&A===null?null:w(I),u.call(x),S.brush()}return _!==null&&A!==null?P:P(1)}):d.each(function(){var x=this,$=arguments,S=x.__brush,_=e.input(typeof y=="function"?y.apply(x,$):y,S.extent),A=c(x,$).beforestart();sr(x),S.selection=_===null?null:_,u.call(x),A.start(b).brush(b).end(b)})},l.clear=function(d,y){l.move(d,null,y)};function u(){var d=X(this),y=_f(this).selection;y?(d.selectAll(".selection").style("display",null).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1]),d.selectAll(".handle").style("display",null).attr("x",function(b){return b.type[b.type.length-1]==="e"?y[1][0]-a/2:y[0][0]-a/2}).attr("y",function(b){return b.type[0]==="s"?y[1][1]-a/2:y[0][1]-a/2}).attr("width",function(b){return b.type==="n"||b.type==="s"?y[1][0]-y[0][0]+a:a}).attr("height",function(b){return b.type==="e"||b.type==="w"?y[1][1]-y[0][1]+a:a})):d.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(d,y,b){var x=d.__brush.emitter;return x&&(!b||!x.clean)?x:new h(d,y,b)}function h(d,y,b){this.that=d,this.args=y,this.state=d.__brush,this.active=0,this.clean=b}h.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(d,y){return this.starting?(this.starting=!1,this.emit("start",d,y)):this.emit("brush",d),this},brush:function(d,y){return this.emit("brush",d,y),this},end:function(d,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",d,y)),this},emit:function(d,y,b){var x=X(this.that).datum();o.call(d,this.that,new E5(d,{sourceEvent:y,target:l,selection:e.output(this.state.selection),mode:b,dispatch:o}),x)}};function f(d){if(s&&!d.touches||!n.apply(this,arguments))return;var y=this,b=d.target.__data__.type,x=(i&&d.metaKey?b="overlay":b)==="selection"?yy:i&&d.altKey?oi:ii,$=e===Gs?null:F5[b],S=e===Os?null:z5[b],_=_f(y),A=_.extent,w=_.selection,P=A[0][0],I,v,N=A[0][1],R,D,T=A[1][0],M,O,k=A[1][1],B,F,E=0,W=0,j,te=$&&S&&i&&d.shiftKey,V,ee,Y=Array.from(d.touches||[d],ue=>{const Ce=ue.identifier;return ue=yt(ue,y),ue.point0=ue.slice(),ue.identifier=Ce,ue});sr(y);var J=c(y,arguments,!0).beforestart();if(b==="overlay"){w&&(j=!0);const ue=[Y[0],Y[1]||Y[0]];_.selection=w=[[I=e===Gs?P:Ve(ue[0][0],ue[1][0]),R=e===Os?N:Ve(ue[0][1],ue[1][1])],[M=e===Gs?T:We(ue[0][0],ue[1][0]),B=e===Os?k:We(ue[0][1],ue[1][1])]],Y.length>1&&ye(d)}else I=w[0][0],R=w[0][1],M=w[1][0],B=w[1][1];v=I,D=R,O=M,F=B;var K=X(y).attr("pointer-events","none"),re=K.selectAll(".overlay").attr("cursor",un[b]);if(d.touches)J.moved=q,J.ended=he;else{var le=X(d.view).on("mousemove.brush",q,!0).on("mouseup.brush",he,!0);i&&le.on("keydown.brush",Re,!0).on("keyup.brush",st,!0),ys(d.view)}u.call(y),J.start(d,x.name);function q(ue){for(const Ce of ue.changedTouches||[ue])for(const va of Y)va.identifier===Ce.identifier&&(va.cur=yt(Ce,y));if(te&&!V&&!ee&&Y.length===1){const Ce=Y[0];by(Ce.cur[0]-Ce[0])>by(Ce.cur[1]-Ce[1])?ee=!0:V=!0}for(const Ce of Y)Ce.cur&&(Ce[0]=Ce.cur[0],Ce[1]=Ce.cur[1]);j=!0,vf(ue),ye(ue)}function ye(ue){const Ce=Y[0],va=Ce.point0;var Vn;switch(E=Ce[0]-va[0],W=Ce[1]-va[1],x){case Sf:case yy:{$&&(E=We(P-I,Ve(T-M,E)),v=I+E,O=M+E),S&&(W=We(N-R,Ve(k-B,W)),D=R+W,F=B+W);break}case ii:{Y[1]?($&&(v=We(P,Ve(T,Y[0][0])),O=We(P,Ve(T,Y[1][0])),$=1),S&&(D=We(N,Ve(k,Y[0][1])),F=We(N,Ve(k,Y[1][1])),S=1)):($<0?(E=We(P-I,Ve(T-I,E)),v=I+E,O=M):$>0&&(E=We(P-M,Ve(T-M,E)),v=I,O=M+E),S<0?(W=We(N-R,Ve(k-R,W)),D=R+W,F=B):S>0&&(W=We(N-B,Ve(k-B,W)),D=R,F=B+W));break}case oi:{$&&(v=We(P,Ve(T,I-E*$)),O=We(P,Ve(T,M+E*$))),S&&(D=We(N,Ve(k,R-W*S)),F=We(N,Ve(k,B+W*S)));break}}O<v&&($*=-1,Vn=I,I=M,M=Vn,Vn=v,v=O,O=Vn,b in $y&&re.attr("cursor",un[b=$y[b]])),F<D&&(S*=-1,Vn=R,R=B,B=Vn,Vn=D,D=F,F=Vn,b in vy&&re.attr("cursor",un[b=vy[b]])),_.selection&&(w=_.selection),V&&(v=w[0][0],O=w[1][0]),ee&&(D=w[0][1],F=w[1][1]),(w[0][0]!==v||w[0][1]!==D||w[1][0]!==O||w[1][1]!==F)&&(_.selection=[[v,D],[O,F]],u.call(y),J.brush(ue,x.name))}function he(ue){if(B5(ue),ue.touches){if(ue.touches.length)return;s&&clearTimeout(s),s=setTimeout(function(){s=null},500)}else bs(ue.view,j),le.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);K.attr("pointer-events","all"),re.attr("cursor",un.overlay),_.selection&&(w=_.selection),V5(w)&&(_.selection=null,u.call(y)),J.end(ue,x.name)}function Re(ue){switch(ue.keyCode){case 16:{te=$&&S;break}case 18:{x===ii&&($&&(M=O-E*$,I=v+E*$),S&&(B=F-W*S,R=D+W*S),x=oi,ye(ue));break}case 32:{(x===ii||x===oi)&&($<0?M=O-E:$>0&&(I=v-E),S<0?B=F-W:S>0&&(R=D-W),x=Sf,re.attr("cursor",un.selection),ye(ue));break}default:return}vf(ue)}function st(ue){switch(ue.keyCode){case 16:{te&&(V=ee=te=!1,ye(ue));break}case 18:{x===oi&&($<0?M=O:$>0&&(I=v),S<0?B=F:S>0&&(R=D),x=ii,ye(ue));break}case 32:{x===Sf&&(ue.altKey?($&&(M=O-E*$,I=v+E*$),S&&(B=F-W*S,R=D+W*S),x=oi):($<0?M=O:$>0&&(I=v),S<0?B=F:S>0&&(R=D),x=ii),re.attr("cursor",un[b]),ye(ue));break}default:return}vf(ue)}}function p(d){c(this,arguments).moved(d)}function g(d){c(this,arguments).ended(d)}function m(){var d=this.__brush||{selection:null};return d.extent=Tf(t.apply(this,arguments)),d.dim=e,d}return l.extent=function(d){return arguments.length?(t=typeof d=="function"?d:$f(Tf(d)),l):t},l.filter=function(d){return arguments.length?(n=typeof d=="function"?d:$f(!!d),l):n},l.touchable=function(d){return arguments.length?(r=typeof d=="function"?d:$f(!!d),l):r},l.handleSize=function(d){return arguments.length?(a=+d,l):a},l.keyModifiers=function(d){return arguments.length?(i=!!d,l):i},l.on=function(){var d=o.on.apply(o,arguments);return d===o?l:d},l}var Sy=Math.abs,ai=Math.cos,si=Math.sin,Ty=Math.PI,Ws=Ty/2,_y=Ty*2,Ay=Math.max,wf=1e-12;function Pf(e,t){return Array.from({length:t-e},(n,r)=>e+r)}function H5(e){return function(t,n){return e(t.source.value+t.target.value,n.source.value+n.target.value)}}function q5(){return Df(!1,!1)}function Z5(){return Df(!1,!0)}function K5(){return Df(!0,!1)}function Df(e,t){var n=0,r=null,i=null,o=null;function a(s){var l=s.length,u=new Array(l),c=Pf(0,l),h=new Array(l*l),f=new Array(l),p=0,g;s=Float64Array.from({length:l*l},t?(m,d)=>s[d%l][d/l|0]:(m,d)=>s[d/l|0][d%l]);for(let m=0;m<l;++m){let d=0;for(let y=0;y<l;++y)d+=s[m*l+y]+e*s[y*l+m];p+=u[m]=d}p=Ay(0,_y-n*l)/p,g=p?n:_y/l;{let m=0;r&&c.sort((d,y)=>r(u[d],u[y]));for(const d of c){const y=m;if(e){const b=Pf(~l+1,l).filter(x=>x<0?s[~x*l+d]:s[d*l+x]);i&&b.sort((x,$)=>i(x<0?-s[~x*l+d]:s[d*l+x],$<0?-s[~$*l+d]:s[d*l+$]));for(const x of b)if(x<0){const $=h[~x*l+d]||(h[~x*l+d]={source:null,target:null});$.target={index:d,startAngle:m,endAngle:m+=s[~x*l+d]*p,value:s[~x*l+d]}}else{const $=h[d*l+x]||(h[d*l+x]={source:null,target:null});$.source={index:d,startAngle:m,endAngle:m+=s[d*l+x]*p,value:s[d*l+x]}}f[d]={index:d,startAngle:y,endAngle:m,value:u[d]}}else{const b=Pf(0,l).filter(x=>s[d*l+x]||s[x*l+d]);i&&b.sort((x,$)=>i(s[d*l+x],s[d*l+$]));for(const x of b){let $;if(d<x?($=h[d*l+x]||(h[d*l+x]={source:null,target:null}),$.source={index:d,startAngle:m,endAngle:m+=s[d*l+x]*p,value:s[d*l+x]}):($=h[x*l+d]||(h[x*l+d]={source:null,target:null}),$.target={index:d,startAngle:m,endAngle:m+=s[d*l+x]*p,value:s[d*l+x]},d===x&&($.source=$.target)),$.source&&$.target&&$.source.value<$.target.value){const S=$.source;$.source=$.target,$.target=S}}f[d]={index:d,startAngle:y,endAngle:m,value:u[d]}}m+=g}}return h=Object.values(h),h.groups=f,o?h.sort(o):h}return a.padAngle=function(s){return arguments.length?(n=Ay(0,s),a):n},a.sortGroups=function(s){return arguments.length?(r=s,a):r},a.sortSubgroups=function(s){return arguments.length?(i=s,a):i},a.sortChords=function(s){return arguments.length?(s==null?o=null:(o=H5(s))._=s,a):o&&o._},a}const Cf=Math.PI,Lf=2*Cf,ur=1e-6,Q5=Lf-ur;function wy(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function J5(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return wy;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let ko=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?wy:J5(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,l=r-t,u=i-n,c=a-t,h=s-n,f=c*c+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(f>ur)if(!(Math.abs(h*l-u*c)>ur)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-a,g=i-s,m=l*l+u*u,d=p*p+g*g,y=Math.sqrt(m),b=Math.sqrt(f),x=o*Math.tan((Cf-Math.acos((m+f-d)/(2*y*b)))/2),$=x/b,S=x/y;Math.abs($-1)>ur&&this._append`L${t+$*c},${n+$*h}`,this._append`A${o},${o},0,0,${+(h*p>c*g)},${this._x1=t+S*l},${this._y1=n+S*u}`}}arc(t,n,r,i,o,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),u=t+s,c=n+l,h=1^a,f=a?i-o:o-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>ur||Math.abs(this._y1-c)>ur)&&this._append`L${u},${c}`,r&&(f<0&&(f=f%Lf+Lf),f>Q5?this._append`A${r},${r},0,1,${h},${t-s},${n-l}A${r},${r},0,1,${h},${this._x1=u},${this._y1=c}`:f>ur&&this._append`A${r},${r},0,${+(f>=Cf)},${h},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function Mf(){return new ko}Mf.prototype=ko.prototype;function e6(e=3){return new ko(+e)}var t6=Array.prototype.slice;function cr(e){return function(){return e}}function n6(e){return e.source}function r6(e){return e.target}function Py(e){return e.radius}function i6(e){return e.startAngle}function o6(e){return e.endAngle}function a6(){return 0}function s6(){return 10}function Dy(e){var t=n6,n=r6,r=Py,i=Py,o=i6,a=o6,s=a6,l=null;function u(){var c,h=t.apply(this,arguments),f=n.apply(this,arguments),p=s.apply(this,arguments)/2,g=t6.call(arguments),m=+r.apply(this,(g[0]=h,g)),d=o.apply(this,g)-Ws,y=a.apply(this,g)-Ws,b=+i.apply(this,(g[0]=f,g)),x=o.apply(this,g)-Ws,$=a.apply(this,g)-Ws;if(l||(l=c=Mf()),p>wf&&(Sy(y-d)>p*2+wf?y>d?(d+=p,y-=p):(d-=p,y+=p):d=y=(d+y)/2,Sy($-x)>p*2+wf?$>x?(x+=p,$-=p):(x-=p,$+=p):x=$=(x+$)/2),l.moveTo(m*ai(d),m*si(d)),l.arc(0,0,m,d,y),d!==x||y!==$)if(e){var S=+e.apply(this,arguments),_=b-S,A=(x+$)/2;l.quadraticCurveTo(0,0,_*ai(x),_*si(x)),l.lineTo(b*ai(A),b*si(A)),l.lineTo(_*ai($),_*si($))}else l.quadraticCurveTo(0,0,b*ai(x),b*si(x)),l.arc(0,0,b,x,$);if(l.quadraticCurveTo(0,0,m*ai(d),m*si(d)),l.closePath(),c)return l=null,c+""||null}return e&&(u.headRadius=function(c){return arguments.length?(e=typeof c=="function"?c:cr(+c),u):e}),u.radius=function(c){return arguments.length?(r=i=typeof c=="function"?c:cr(+c),u):r},u.sourceRadius=function(c){return arguments.length?(r=typeof c=="function"?c:cr(+c),u):r},u.targetRadius=function(c){return arguments.length?(i=typeof c=="function"?c:cr(+c),u):i},u.startAngle=function(c){return arguments.length?(o=typeof c=="function"?c:cr(+c),u):o},u.endAngle=function(c){return arguments.length?(a=typeof c=="function"?c:cr(+c),u):a},u.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:cr(+c),u):s},u.source=function(c){return arguments.length?(t=c,u):t},u.target=function(c){return arguments.length?(n=c,u):n},u.context=function(c){return arguments.length?(l=c??null,u):l},u}function l6(){return Dy()}function u6(){return Dy(s6)}var c6=Array.prototype,Cy=c6.slice;function f6(e,t){return e-t}function h6(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)r+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return r}const Rn=e=>()=>e;function p6(e,t){for(var n=-1,r=t.length,i;++n<r;)if(i=g6(e,t[n]))return i;return 0}function g6(e,t){for(var n=t[0],r=t[1],i=-1,o=0,a=e.length,s=a-1;o<a;s=o++){var l=e[o],u=l[0],c=l[1],h=e[s],f=h[0],p=h[1];if(d6(l,h,t))return 0;c>r!=p>r&&n<(f-u)*(r-c)/(p-c)+u&&(i=-i)}return i}function d6(e,t,n){var r;return m6(e,t,n)&&y6(e[r=+(e[0]===t[0])],n[r],t[r])}function m6(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function y6(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function b6(){}var cn=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function kf(){var e=1,t=1,n=Mc,r=l;function i(u){var c=n(u);if(Array.isArray(c))c=c.slice().sort(f6);else{const h=lo(u,x6);for(c=Kn(...Lc(h[0],h[1],c),c);c[c.length-1]>=h[1];)c.pop();for(;c[1]<h[0];)c.shift()}return c.map(h=>o(u,h))}function o(u,c){const h=c==null?NaN:+c;if(isNaN(h))throw new Error(`invalid value: ${c}`);var f=[],p=[];return a(u,h,function(g){r(g,u,h),h6(g)>0?f.push([g]):p.push(g)}),p.forEach(function(g){for(var m=0,d=f.length,y;m<d;++m)if(p6((y=f[m])[0],g)!==-1){y.push(g);return}}),{type:"MultiPolygon",value:c,coordinates:f}}function a(u,c,h){var f=new Array,p=new Array,g,m,d,y,b,x;for(g=m=-1,y=fr(u[0],c),cn[y<<1].forEach($);++g<e-1;)d=y,y=fr(u[g+1],c),cn[d|y<<1].forEach($);for(cn[y<<0].forEach($);++m<t-1;){for(g=-1,y=fr(u[m*e+e],c),b=fr(u[m*e],c),cn[y<<1|b<<2].forEach($);++g<e-1;)d=y,y=fr(u[m*e+e+g+1],c),x=b,b=fr(u[m*e+g+1],c),cn[d|y<<1|b<<2|x<<3].forEach($);cn[y|b<<3].forEach($)}for(g=-1,b=u[m*e]>=c,cn[b<<2].forEach($);++g<e-1;)x=b,b=fr(u[m*e+g+1],c),cn[b<<2|x<<3].forEach($);cn[b<<3].forEach($);function $(S){var _=[S[0][0]+g,S[0][1]+m],A=[S[1][0]+g,S[1][1]+m],w=s(_),P=s(A),I,v;(I=p[w])?(v=f[P])?(delete p[I.end],delete f[v.start],I===v?(I.ring.push(A),h(I.ring)):f[I.start]=p[v.end]={start:I.start,end:v.end,ring:I.ring.concat(v.ring)}):(delete p[I.end],I.ring.push(A),p[I.end=P]=I):(I=f[P])?(v=p[w])?(delete f[I.start],delete p[v.end],I===v?(I.ring.push(A),h(I.ring)):f[v.start]=p[I.end]={start:v.start,end:I.end,ring:v.ring.concat(I.ring)}):(delete f[I.start],I.ring.unshift(_),f[I.start=w]=I):f[w]=p[P]={start:w,end:P,ring:[_,A]}}}function s(u){return u[0]*2+u[1]*(e+1)*4}function l(u,c,h){u.forEach(function(f){var p=f[0],g=f[1],m=p|0,d=g|0,y=Rf(c[d*e+m]);p>0&&p<e&&m===p&&(f[0]=Ly(p,Rf(c[d*e+m-1]),y,h)),g>0&&g<t&&d===g&&(f[1]=Ly(g,Rf(c[(d-1)*e+m]),y,h))})}return i.contour=o,i.size=function(u){if(!arguments.length)return[e,t];var c=Math.floor(u[0]),h=Math.floor(u[1]);if(!(c>=0&&h>=0))throw new Error("invalid size");return e=c,t=h,i},i.thresholds=function(u){return arguments.length?(n=typeof u=="function"?u:Array.isArray(u)?Rn(Cy.call(u)):Rn(u),i):n},i.smooth=function(u){return arguments.length?(r=u?l:b6,i):r===l},i}function x6(e){return isFinite(e)?e:NaN}function fr(e,t){return e==null?!1:+e>=t}function Rf(e){return e==null||isNaN(e=+e)?-1/0:e}function Ly(e,t,n,r){const i=r-t,o=n-t,a=isFinite(i)||isFinite(o)?i/o:Math.sign(i)/Math.sign(o);return isNaN(a)?e:e+a-.5}function $6(e){return e[0]}function v6(e){return e[1]}function S6(){return 1}function T6(){var e=$6,t=v6,n=S6,r=960,i=500,o=20,a=2,s=o*3,l=r+s*2>>a,u=i+s*2>>a,c=Rn(20);function h(b){var x=new Float32Array(l*u),$=Math.pow(2,-a),S=-1;for(const R of b){var _=(e(R,++S,b)+s)*$,A=(t(R,S,b)+s)*$,w=+n(R,S,b);if(w&&_>=0&&_<l&&A>=0&&A<u){var P=Math.floor(_),I=Math.floor(A),v=_-P-.5,N=A-I-.5;x[P+I*l]+=(1-v)*(1-N)*w,x[P+1+I*l]+=v*(1-N)*w,x[P+1+(I+1)*l]+=v*N*w,x[P+(I+1)*l]+=(1-v)*N*w}}return Pm({data:x,width:l,height:u},o*$),x}function f(b){var x=h(b),$=c(x),S=Math.pow(2,2*a);return Array.isArray($)||($=Kn(Number.MIN_VALUE,co(x)/S,$)),kf().size([l,u]).thresholds($.map(_=>_*S))(x).map((_,A)=>(_.value=+$[A],p(_)))}f.contours=function(b){var x=h(b),$=kf().size([l,u]),S=Math.pow(2,2*a),_=A=>{A=+A;var w=p($.contour(x,A*S));return w.value=A,w};return Object.defineProperty(_,"max",{get:()=>co(x)/S}),_};function p(b){return b.coordinates.forEach(g),b}function g(b){b.forEach(m)}function m(b){b.forEach(d)}function d(b){b[0]=b[0]*Math.pow(2,a)-s,b[1]=b[1]*Math.pow(2,a)-s}function y(){return s=o*3,l=r+s*2>>a,u=i+s*2>>a,f}return f.x=function(b){return arguments.length?(e=typeof b=="function"?b:Rn(+b),f):e},f.y=function(b){return arguments.length?(t=typeof b=="function"?b:Rn(+b),f):t},f.weight=function(b){return arguments.length?(n=typeof b=="function"?b:Rn(+b),f):n},f.size=function(b){if(!arguments.length)return[r,i];var x=+b[0],$=+b[1];if(!(x>=0&&$>=0))throw new Error("invalid size");return r=x,i=$,y()},f.cellSize=function(b){if(!arguments.length)return 1<<a;if(!((b=+b)>=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(b)/Math.LN2),y()},f.thresholds=function(b){return arguments.length?(c=typeof b=="function"?b:Array.isArray(b)?Rn(Cy.call(b)):Rn(b),f):c},f.bandwidth=function(b){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((b=+b)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*b*b+1)-1)/2,y()},f}const fn=11102230246251565e-32,Ye=134217729,_6=(3+8*fn)*fn;function If(e,t,n,r,i){let o,a,s,l,u=t[0],c=r[0],h=0,f=0;c>u==c>-u?(o=u,u=t[++h]):(o=c,c=r[++f]);let p=0;if(h<e&&f<n)for(c>u==c>-u?(a=u+o,s=o-(a-u),u=t[++h]):(a=c+o,s=o-(a-c),c=r[++f]),o=a,s!==0&&(i[p++]=s);h<e&&f<n;)c>u==c>-u?(a=o+u,l=a-o,s=o-(a-l)+(u-l),u=t[++h]):(a=o+c,l=a-o,s=o-(a-l)+(c-l),c=r[++f]),o=a,s!==0&&(i[p++]=s);for(;h<e;)a=o+u,l=a-o,s=o-(a-l)+(u-l),u=t[++h],o=a,s!==0&&(i[p++]=s);for(;f<n;)a=o+c,l=a-o,s=o-(a-l)+(c-l),c=r[++f],o=a,s!==0&&(i[p++]=s);return(o!==0||p===0)&&(i[p++]=o),p}function A6(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function Ro(e){return new Float64Array(e)}const w6=(3+16*fn)*fn,P6=(2+12*fn)*fn,D6=(9+64*fn)*fn*fn,li=Ro(4),My=Ro(8),ky=Ro(12),Ry=Ro(16),Ze=Ro(4);function C6(e,t,n,r,i,o,a){let s,l,u,c,h,f,p,g,m,d,y,b,x,$,S,_,A,w;const P=e-i,I=n-i,v=t-o,N=r-o;$=P*N,f=Ye*P,p=f-(f-P),g=P-p,f=Ye*N,m=f-(f-N),d=N-m,S=g*d-($-p*m-g*m-p*d),_=v*I,f=Ye*v,p=f-(f-v),g=v-p,f=Ye*I,m=f-(f-I),d=I-m,A=g*d-(_-p*m-g*m-p*d),y=S-A,h=S-y,li[0]=S-(y+h)+(h-A),b=$+y,h=b-$,x=$-(b-h)+(y-h),y=x-_,h=x-y,li[1]=x-(y+h)+(h-_),w=b+y,h=w-b,li[2]=b-(w-h)+(y-h),li[3]=w;let R=A6(4,li),D=P6*a;if(R>=D||-R>=D||(h=e-P,s=e-(P+h)+(h-i),h=n-I,u=n-(I+h)+(h-i),h=t-v,l=t-(v+h)+(h-o),h=r-N,c=r-(N+h)+(h-o),s===0&&l===0&&u===0&&c===0)||(D=D6*a+_6*Math.abs(R),R+=P*c+N*s-(v*u+I*l),R>=D||-R>=D))return R;$=s*N,f=Ye*s,p=f-(f-s),g=s-p,f=Ye*N,m=f-(f-N),d=N-m,S=g*d-($-p*m-g*m-p*d),_=l*I,f=Ye*l,p=f-(f-l),g=l-p,f=Ye*I,m=f-(f-I),d=I-m,A=g*d-(_-p*m-g*m-p*d),y=S-A,h=S-y,Ze[0]=S-(y+h)+(h-A),b=$+y,h=b-$,x=$-(b-h)+(y-h),y=x-_,h=x-y,Ze[1]=x-(y+h)+(h-_),w=b+y,h=w-b,Ze[2]=b-(w-h)+(y-h),Ze[3]=w;const T=If(4,li,4,Ze,My);$=P*c,f=Ye*P,p=f-(f-P),g=P-p,f=Ye*c,m=f-(f-c),d=c-m,S=g*d-($-p*m-g*m-p*d),_=v*u,f=Ye*v,p=f-(f-v),g=v-p,f=Ye*u,m=f-(f-u),d=u-m,A=g*d-(_-p*m-g*m-p*d),y=S-A,h=S-y,Ze[0]=S-(y+h)+(h-A),b=$+y,h=b-$,x=$-(b-h)+(y-h),y=x-_,h=x-y,Ze[1]=x-(y+h)+(h-_),w=b+y,h=w-b,Ze[2]=b-(w-h)+(y-h),Ze[3]=w;const M=If(T,My,4,Ze,ky);$=s*c,f=Ye*s,p=f-(f-s),g=s-p,f=Ye*c,m=f-(f-c),d=c-m,S=g*d-($-p*m-g*m-p*d),_=l*u,f=Ye*l,p=f-(f-l),g=l-p,f=Ye*u,m=f-(f-u),d=u-m,A=g*d-(_-p*m-g*m-p*d),y=S-A,h=S-y,Ze[0]=S-(y+h)+(h-A),b=$+y,h=b-$,x=$-(b-h)+(y-h),y=x-_,h=x-y,Ze[1]=x-(y+h)+(h-_),w=b+y,h=w-b,Ze[2]=b-(w-h)+(y-h),Ze[3]=w;const O=If(M,ky,4,Ze,Ry);return Ry[O-1]}function Vs(e,t,n,r,i,o){const a=(t-o)*(n-i),s=(e-i)*(r-o),l=a-s,u=Math.abs(a+s);return Math.abs(l)>=w6*u?l:-C6(e,t,n,r,i,o,u)}const Iy=Math.pow(2,-52),Ys=new Uint32Array(512);class Xs{static from(t,n=I6,r=E6){const i=t.length,o=new Float64Array(i*2);for(let a=0;a<i;a++){const s=t[a];o[2*a]=n(s),o[2*a+1]=r(s)}return new Xs(o)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,a=t.length>>1;let s=1/0,l=1/0,u=-1/0,c=-1/0;for(let P=0;P<a;P++){const I=t[2*P],v=t[2*P+1];I<s&&(s=I),v<l&&(l=v),I>u&&(u=I),v>c&&(c=v),this._ids[P]=P}const h=(s+u)/2,f=(l+c)/2;let p,g,m;for(let P=0,I=1/0;P<a;P++){const v=Ef(h,f,t[2*P],t[2*P+1]);v<I&&(p=P,I=v)}const d=t[2*p],y=t[2*p+1];for(let P=0,I=1/0;P<a;P++){if(P===p)continue;const v=Ef(d,y,t[2*P],t[2*P+1]);v<I&&v>0&&(g=P,I=v)}let b=t[2*g],x=t[2*g+1],$=1/0;for(let P=0;P<a;P++){if(P===p||P===g)continue;const I=k6(d,y,b,x,t[2*P],t[2*P+1]);I<$&&(m=P,$=I)}let S=t[2*m],_=t[2*m+1];if($===1/0){for(let v=0;v<a;v++)this._dists[v]=t[2*v]-t[0]||t[2*v+1]-t[1];ui(this._ids,this._dists,0,a-1);const P=new Uint32Array(a);let I=0;for(let v=0,N=-1/0;v<a;v++){const R=this._ids[v],D=this._dists[R];D>N&&(P[I++]=R,N=D)}this.hull=P.subarray(0,I),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Vs(d,y,b,x,S,_)<0){const P=g,I=b,v=x;g=m,b=S,x=_,m=P,S=I,_=v}const A=R6(d,y,b,x,S,_);this._cx=A.x,this._cy=A.y;for(let P=0;P<a;P++)this._dists[P]=Ef(t[2*P],t[2*P+1],A.x,A.y);ui(this._ids,this._dists,0,a-1),this._hullStart=p;let w=3;r[p]=n[m]=g,r[g]=n[p]=m,r[m]=n[g]=p,i[p]=0,i[g]=1,i[m]=2,o.fill(-1),o[this._hashKey(d,y)]=p,o[this._hashKey(b,x)]=g,o[this._hashKey(S,_)]=m,this.trianglesLen=0,this._addTriangle(p,g,m,-1,-1,-1);for(let P=0,I,v;P<this._ids.length;P++){const N=this._ids[P],R=t[2*N],D=t[2*N+1];if(P>0&&Math.abs(R-I)<=Iy&&Math.abs(D-v)<=Iy||(I=R,v=D,N===p||N===g||N===m))continue;let T=0;for(let F=0,E=this._hashKey(R,D);F<this._hashSize&&(T=o[(E+F)%this._hashSize],!(T!==-1&&T!==r[T]));F++);T=n[T];let M=T,O;for(;O=r[M],Vs(R,D,t[2*M],t[2*M+1],t[2*O],t[2*O+1])>=0;)if(M=O,M===T){M=-1;break}if(M===-1)continue;let k=this._addTriangle(M,N,r[M],-1,-1,i[M]);i[N]=this._legalize(k+2),i[M]=k,w++;let B=r[M];for(;O=r[B],Vs(R,D,t[2*B],t[2*B+1],t[2*O],t[2*O+1])<0;)k=this._addTriangle(B,N,O,i[N],-1,i[B]),i[N]=this._legalize(k+2),r[B]=B,w--,B=O;if(M===T)for(;O=n[M],Vs(R,D,t[2*O],t[2*O+1],t[2*M],t[2*M+1])<0;)k=this._addTriangle(O,N,M,-1,i[M],i[O]),this._legalize(k+2),i[O]=k,r[M]=M,w--,M=O;this._hullStart=n[N]=M,r[M]=n[B]=N,r[N]=B,o[this._hashKey(R,D)]=N,o[this._hashKey(t[2*M],t[2*M+1])]=M}this.hull=new Uint32Array(w);for(let P=0,I=this._hullStart;P<w;P++)this.hull[P]=I,I=r[I];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(L6(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:r,coords:i}=this;let o=0,a=0;for(;;){const s=r[t],l=t-t%3;if(a=l+(t+2)%3,s===-1){if(o===0)break;t=Ys[--o];continue}const u=s-s%3,c=l+(t+1)%3,h=u+(s+2)%3,f=n[a],p=n[t],g=n[c],m=n[h];if(M6(i[2*f],i[2*f+1],i[2*p],i[2*p+1],i[2*g],i[2*g+1],i[2*m],i[2*m+1])){n[t]=m,n[s]=f;const y=r[h];if(y===-1){let x=this._hullStart;do{if(this._hullTri[x]===h){this._hullTri[x]=t;break}x=this._hullPrev[x]}while(x!==this._hullStart)}this._link(t,y),this._link(s,r[a]),this._link(a,h);const b=u+(s+1)%3;o<Ys.length&&(Ys[o++]=b)}else{if(o===0)break;t=Ys[--o]}}return a}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,r,i,o,a){const s=this.trianglesLen;return this._triangles[s]=t,this._triangles[s+1]=n,this._triangles[s+2]=r,this._link(s,i),this._link(s+1,o),this._link(s+2,a),this.trianglesLen+=3,s}}function L6(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function Ef(e,t,n,r){const i=e-n,o=t-r;return i*i+o*o}function M6(e,t,n,r,i,o,a,s){const l=e-a,u=t-s,c=n-a,h=r-s,f=i-a,p=o-s,g=l*l+u*u,m=c*c+h*h,d=f*f+p*p;return l*(h*d-m*p)-u*(c*d-m*f)+g*(c*p-h*f)<0}function k6(e,t,n,r,i,o){const a=n-e,s=r-t,l=i-e,u=o-t,c=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l),p=(u*c-s*h)*f,g=(a*h-l*c)*f;return p*p+g*g}function R6(e,t,n,r,i,o){const a=n-e,s=r-t,l=i-e,u=o-t,c=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l),p=e+(u*c-s*h)*f,g=t+(a*h-l*c)*f;return{x:p,y:g}}function ui(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const o=e[i],a=t[o];let s=i-1;for(;s>=n&&t[e[s]]>a;)e[s+1]=e[s--];e[s+1]=o}else{const i=n+r>>1;let o=n+1,a=r;Io(e,i,o),t[e[n]]>t[e[r]]&&Io(e,n,r),t[e[o]]>t[e[r]]&&Io(e,o,r),t[e[n]]>t[e[o]]&&Io(e,n,o);const s=e[o],l=t[s];for(;;){do o++;while(t[e[o]]<l);do a--;while(t[e[a]]>l);if(a<o)break;Io(e,o,a)}e[n+1]=e[a],e[a]=s,r-o+1>=a-n?(ui(e,t,o,r),ui(e,t,n,a-1)):(ui(e,t,n,a-1),ui(e,t,o,r))}}function Io(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function I6(e){return e[0]}function E6(e){return e[1]}const Ey=1e-6;class hr{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,r){t=+t,n=+n,r=+r;const i=t+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>Ey||Math.abs(this._y1-o)>Ey)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${t-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(t,n,r,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class Bf{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}class By{constructor(t,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:r},vectors:i}=this;let o,a;const s=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let m=0,d=0,y=r.length,b,x;m<y;m+=3,d+=2){const $=r[m]*2,S=r[m+1]*2,_=r[m+2]*2,A=t[$],w=t[$+1],P=t[S],I=t[S+1],v=t[_],N=t[_+1],R=P-A,D=I-w,T=v-A,M=N-w,O=(R*M-D*T)*2;if(Math.abs(O)<1e-9){if(o===void 0){o=a=0;for(const B of n)o+=t[B*2],a+=t[B*2+1];o/=n.length,a/=n.length}const k=1e9*Math.sign((o-A)*M-(a-w)*T);b=(A+v)/2-k*M,x=(w+N)/2+k*T}else{const k=1/O,B=R*R+D*D,F=T*T+M*M;b=A+(M*B-D*F)*k,x=w+(R*F-T*B)*k}s[d]=b,s[d+1]=x}let l=n[n.length-1],u,c=l*4,h,f=t[2*l],p,g=t[2*l+1];i.fill(0);for(let m=0;m<n.length;++m)l=n[m],u=c,h=f,p=g,c=l*4,f=t[2*l],g=t[2*l+1],i[u+2]=i[c]=p-g,i[u+3]=i[c+1]=f-h}render(t){const n=t==null?t=new hr:void 0,{delaunay:{halfedges:r,inedges:i,hull:o},circumcenters:a,vectors:s}=this;if(o.length<=1)return null;for(let c=0,h=r.length;c<h;++c){const f=r[c];if(f<c)continue;const p=Math.floor(c/3)*2,g=Math.floor(f/3)*2,m=a[p],d=a[p+1],y=a[g],b=a[g+1];this._renderSegment(m,d,y,b,t)}let l,u=o[o.length-1];for(let c=0;c<o.length;++c){l=u,u=o[c];const h=Math.floor(i[u]/3)*2,f=a[h],p=a[h+1],g=l*4,m=this._project(f,p,s[g+2],s[g+3]);m&&this._renderSegment(f,p,m[0],m[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new hr:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const r=n==null?n=new hr:void 0,i=this._clip(t);if(i===null||!i.length)return;n.moveTo(i[0],i[1]);let o=i.length;for(;i[0]===i[o-2]&&i[1]===i[o-1]&&o>1;)o-=2;for(let a=2;a<o;a+=2)(i[a]!==i[a-2]||i[a+1]!==i[a-1])&&n.lineTo(i[a],i[a+1]);return n.closePath(),r&&r.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,r=t.length/2;n<r;++n){const i=this.cellPolygon(n);i&&(i.index=n,yield i)}}cellPolygon(t){const n=new Bf;return this.renderCell(t,n),n.value()}_renderSegment(t,n,r,i,o){let a;const s=this._regioncode(t,n),l=this._regioncode(r,i);s===0&&l===0?(o.moveTo(t,n),o.lineTo(r,i)):(a=this._clipSegment(t,n,r,i,s,l))&&(o.moveTo(a[0],a[1]),o.lineTo(a[2],a[3]))}contains(t,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(t,n,r)===t}*neighbors(t){const n=this._clip(t);if(n)for(const r of this.delaunay.neighbors(t)){const i=this._clip(r);if(i){e:for(let o=0,a=n.length;o<a;o+=2)for(let s=0,l=i.length;s<l;s+=2)if(n[o]===i[s]&&n[o+1]===i[s+1]&&n[(o+2)%a]===i[(s+l-2)%l]&&n[(o+3)%a]===i[(s+l-1)%l]){yield r;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:o}}=this,a=r[t];if(a===-1)return null;const s=[];let l=a;do{const u=Math.floor(l/3);if(s.push(n[u*2],n[u*2+1]),l=l%3===2?l-2:l+1,o[l]!==t)break;l=i[l]}while(l!==a&&l!==-1);return s}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:r}=this,i=t*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(t,n,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(t,n))}_clipFinite(t,n){const r=n.length;let i=null,o,a,s=n[r-2],l=n[r-1],u,c=this._regioncode(s,l),h,f=0;for(let p=0;p<r;p+=2)if(o=s,a=l,s=n[p],l=n[p+1],u=c,c=this._regioncode(s,l),u===0&&c===0)h=f,f=0,i?i.push(s,l):i=[s,l];else{let g,m,d,y,b;if(u===0){if((g=this._clipSegment(o,a,s,l,u,c))===null)continue;[m,d,y,b]=g}else{if((g=this._clipSegment(s,l,o,a,c,u))===null)continue;[y,b,m,d]=g,h=f,f=this._edgecode(m,d),h&&f&&this._edge(t,h,f,i,i.length),i?i.push(m,d):i=[m,d]}h=f,f=this._edgecode(y,b),h&&f&&this._edge(t,h,f,i,i.length),i?i.push(y,b):i=[y,b]}if(i)h=f,f=this._edgecode(i[0],i[1]),h&&f&&this._edge(t,h,f,i,i.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return i}_clipSegment(t,n,r,i,o,a){const s=o<a;for(s&&([t,n,r,i,o,a]=[r,i,t,n,a,o]);;){if(o===0&&a===0)return s?[r,i,t,n]:[t,n,r,i];if(o&a)return null;let l,u,c=o||a;c&8?(l=t+(r-t)*(this.ymax-n)/(i-n),u=this.ymax):c&4?(l=t+(r-t)*(this.ymin-n)/(i-n),u=this.ymin):c&2?(u=n+(i-n)*(this.xmax-t)/(r-t),l=this.xmax):(u=n+(i-n)*(this.xmin-t)/(r-t),l=this.xmin),o?(t=l,n=u,o=this._regioncode(t,n)):(r=l,i=u,a=this._regioncode(r,i))}}_clipInfinite(t,n,r,i,o,a){let s=Array.from(n),l;if((l=this._project(s[0],s[1],r,i))&&s.unshift(l[0],l[1]),(l=this._project(s[s.length-2],s[s.length-1],o,a))&&s.push(l[0],l[1]),s=this._clipFinite(t,s))for(let u=0,c=s.length,h,f=this._edgecode(s[c-2],s[c-1]);u<c;u+=2)h=f,f=this._edgecode(s[u],s[u+1]),h&&f&&(u=this._edge(t,h,f,s,u),c=s.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(t,n,r,i,o){for(;n!==r;){let a,s;switch(n){case 5:n=4;continue;case 4:n=6,a=this.xmax,s=this.ymin;break;case 6:n=2;continue;case 2:n=10,a=this.xmax,s=this.ymax;break;case 10:n=8;continue;case 8:n=9,a=this.xmin,s=this.ymax;break;case 9:n=1;continue;case 1:n=5,a=this.xmin,s=this.ymin;break}(i[o]!==a||i[o+1]!==s)&&this.contains(t,a,s)&&(i.splice(o,0,a,s),o+=2)}return o}_project(t,n,r,i){let o=1/0,a,s,l;if(i<0){if(n<=this.ymin)return null;(a=(this.ymin-n)/i)<o&&(l=this.ymin,s=t+(o=a)*r)}else if(i>0){if(n>=this.ymax)return null;(a=(this.ymax-n)/i)<o&&(l=this.ymax,s=t+(o=a)*r)}if(r>0){if(t>=this.xmax)return null;(a=(this.xmax-t)/r)<o&&(s=this.xmax,l=n+(o=a)*i)}else if(r<0){if(t<=this.xmin)return null;(a=(this.xmin-t)/r)<o&&(s=this.xmin,l=n+(o=a)*i)}return[s,l]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const r=(n+2)%t.length,i=(n+4)%t.length;(t[n]===t[r]&&t[r]===t[i]||t[n+1]===t[r+1]&&t[r+1]===t[i+1])&&(t.splice(r,2),n-=2)}t.length||(t=null)}return t}}const B6=2*Math.PI,ci=Math.pow;function N6(e){return e[0]}function F6(e){return e[1]}function z6(e){const{triangles:t,coords:n}=e;for(let r=0;r<t.length;r+=3){const i=2*t[r],o=2*t[r+1],a=2*t[r+2];if((n[a]-n[i])*(n[o+1]-n[i+1])-(n[o]-n[i])*(n[a+1]-n[i+1])>1e-10)return!1}return!0}function O6(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class Nf{static from(t,n=N6,r=F6,i){return new Nf("length"in t?G6(t,n,r,i):Float64Array.from(W6(t,n,r,i)))}constructor(t){this._delaunator=new Xs(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&z6(t)){this.collinear=Int32Array.from({length:n.length/2},(f,p)=>p).sort((f,p)=>n[2*f]-n[2*p]||n[2*f+1]-n[2*p+1]);const l=this.collinear[0],u=this.collinear[this.collinear.length-1],c=[n[2*l],n[2*l+1],n[2*u],n[2*u+1]],h=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let f=0,p=n.length/2;f<p;++f){const g=O6(n[2*f],n[2*f+1],h);n[2*f]=g[0],n[2*f+1]=g[1]}this._delaunator=new Xs(n)}else delete this.collinear;const r=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,a=this.inedges.fill(-1),s=this._hullIndex.fill(-1);for(let l=0,u=r.length;l<u;++l){const c=o[l%3===2?l-2:l+1];(r[l]===-1||a[c]===-1)&&(a[c]=l)}for(let l=0,u=i.length;l<u;++l)s[i[l]]=l;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],a[i[0]]=1,i.length===2&&(a[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new By(this,t)}*neighbors(t){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:a,collinear:s}=this;if(s){const h=s.indexOf(t);h>0&&(yield s[h-1]),h<s.length-1&&(yield s[h+1]);return}const l=n[t];if(l===-1)return;let u=l,c=-1;do{if(yield c=a[u],u=u%3===2?u-2:u+1,a[u]!==t)return;if(u=o[u],u===-1){const h=r[(i[t]+1)%r.length];h!==c&&(yield h);return}}while(u!==l)}find(t,n,r=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const i=r;let o;for(;(o=this._step(r,t,n))>=0&&o!==r&&o!==i;)r=o;return o}_step(t,n,r){const{inedges:i,hull:o,_hullIndex:a,halfedges:s,triangles:l,points:u}=this;if(i[t]===-1||!u.length)return(t+1)%(u.length>>1);let c=t,h=ci(n-u[t*2],2)+ci(r-u[t*2+1],2);const f=i[t];let p=f;do{let g=l[p];const m=ci(n-u[g*2],2)+ci(r-u[g*2+1],2);if(m<h&&(h=m,c=g),p=p%3===2?p-2:p+1,l[p]!==t)break;if(p=s[p],p===-1){if(p=o[(a[t]+1)%o.length],p!==g&&ci(n-u[p*2],2)+ci(r-u[p*2+1],2)<h)return p;break}}while(p!==f);return c}render(t){const n=t==null?t=new hr:void 0,{points:r,halfedges:i,triangles:o}=this;for(let a=0,s=i.length;a<s;++a){const l=i[a];if(l<a)continue;const u=o[a]*2,c=o[l]*2;t.moveTo(r[u],r[u+1]),t.lineTo(r[c],r[c+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const r=t==null?t=new hr:void 0,{points:i}=this;for(let o=0,a=i.length;o<a;o+=2){const s=i[o],l=i[o+1];t.moveTo(s+n,l),t.arc(s,l,n,0,B6)}return r&&r.value()}renderHull(t){const n=t==null?t=new hr:void 0,{hull:r,points:i}=this,o=r[0]*2,a=r.length;t.moveTo(i[o],i[o+1]);for(let s=1;s<a;++s){const l=2*r[s];t.lineTo(i[l],i[l+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new Bf;return this.renderHull(t),t.value()}renderTriangle(t,n){const r=n==null?n=new hr:void 0,{points:i,triangles:o}=this,a=o[t*=3]*2,s=o[t+1]*2,l=o[t+2]*2;return n.moveTo(i[a],i[a+1]),n.lineTo(i[s],i[s+1]),n.lineTo(i[l],i[l+1]),n.closePath(),r&&r.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,r=t.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new Bf;return this.renderTriangle(t,n),n.value()}}function G6(e,t,n,r){const i=e.length,o=new Float64Array(i*2);for(let a=0;a<i;++a){const s=e[a];o[a*2]=t.call(r,s,a,e),o[a*2+1]=n.call(r,s,a,e)}return o}function*W6(e,t,n,r){let i=0;for(const o of e)yield t.call(r,o,i,e),yield n.call(r,o,i,e),++i}var Ny={},Ff={},zf=34,Eo=10,Of=13;function Fy(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function V6(e,t){var n=Fy(e);return function(r,i){return t(n(r),i,e)}}function zy(e){var t=Object.create(null),n=[];return e.forEach(function(r){for(var i in r)i in t||n.push(t[i]=i)}),n}function ft(e,t){var n=e+"",r=n.length;return r<t?new Array(t-r+1).join(0)+n:n}function Y6(e){return e<0?"-"+ft(-e,6):e>9999?"+"+ft(e,6):ft(e,4)}function X6(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":Y6(e.getUTCFullYear())+"-"+ft(e.getUTCMonth()+1,2)+"-"+ft(e.getUTCDate(),2)+(i?"T"+ft(t,2)+":"+ft(n,2)+":"+ft(r,2)+"."+ft(i,3)+"Z":r?"T"+ft(t,2)+":"+ft(n,2)+":"+ft(r,2)+"Z":n||t?"T"+ft(t,2)+":"+ft(n,2)+"Z":"")}function Us(e){var t=new RegExp('["'+e+`
52
- \r]`),n=e.charCodeAt(0);function r(h,f){var p,g,m=i(h,function(d,y){if(p)return p(d,y-1);g=d,p=f?V6(d,f):Fy(d)});return m.columns=g||[],m}function i(h,f){var p=[],g=h.length,m=0,d=0,y,b=g<=0,x=!1;h.charCodeAt(g-1)===Eo&&--g,h.charCodeAt(g-1)===Of&&--g;function $(){if(b)return Ff;if(x)return x=!1,Ny;var _,A=m,w;if(h.charCodeAt(A)===zf){for(;m++<g&&h.charCodeAt(m)!==zf||h.charCodeAt(++m)===zf;);return(_=m)>=g?b=!0:(w=h.charCodeAt(m++))===Eo?x=!0:w===Of&&(x=!0,h.charCodeAt(m)===Eo&&++m),h.slice(A+1,_-1).replace(/""/g,'"')}for(;m<g;){if((w=h.charCodeAt(_=m++))===Eo)x=!0;else if(w===Of)x=!0,h.charCodeAt(m)===Eo&&++m;else if(w!==n)continue;return h.slice(A,_)}return b=!0,h.slice(A,g)}for(;(y=$())!==Ff;){for(var S=[];y!==Ny&&y!==Ff;)S.push(y),y=$();f&&(S=f(S,d++))==null||p.push(S)}return p}function o(h,f){return h.map(function(p){return f.map(function(g){return c(p[g])}).join(e)})}function a(h,f){return f==null&&(f=zy(h)),[f.map(c).join(e)].concat(o(h,f)).join(`
51
+ ----> find in '${n}'`}function $D({chartType:e,config:t,initFn:n}){const r=new so,i=new WeakMap;let o=()=>{},a;const s=new bm(t.defaultParams),l=new bm({}),u=s.pipe(pD(c=>l.pipe(gD(r),$c(h=>{try{const{status:f,columnName:p,expectToBe:d}=t.validator(h,{validateColumns:PT});if(f==="error")throw new Error(bD({columnName:p,expectToBe:d,from:`${t.name}.params$`}));f==="warning"&&console.warn(xD({columnName:p,expectToBe:d,from:`${t.name}.params$`}))}catch(f){console.error(yD(f))}return Xu(h,c)}))),hD(1));return{params$:l,name:t.name,chartType:e,defaultParams:t.defaultParams,layerIndex:t.layerIndex,init(){a&&(o=n(a)??(()=>{}),i.set(a.selection,a))},destroy(){o(),a&&(a.selection.remove(),a=void 0),r.next(void 0)},setPresetParams:c=>{s.next(Xu(c,t.defaultParams))},setContext:c=>{a=c,a.observer.fullParams$=u}}}const Xr=e=>function(t){return function(n){return class{constructor(){const r=$D({chartType:e,config:t,initFn:n});this.params$=r.params$,this.name=r.name,this.chartType=r.chartType,this.defaultParams=r.defaultParams,this.layerIndex=r.layerIndex,this.init=r.init,this.destroy=r.destroy,this.setPresetParams=r.setPresetParams,this.setContext=r.setContext}}}},Dn=Xr("series"),ct=Xr("grid"),mt=Xr("multiGrid"),He=Xr("multiValue"),ts=Xr("relationship"),_c=Xr("tree");function _e(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function _m(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ns(e){let t,n,r;e.length!==2?(t=_e,n=(s,l)=>_e(e(s),l),r=(s,l)=>e(s)-l):(t=e===_e||e===_m?e:vD,n=e,r=e);function i(s,l,u=0,c=s.length){if(u<c){if(t(l,l)!==0)return c;do{const h=u+c>>>1;n(s[h],l)<0?u=h+1:c=h}while(u<c)}return u}function o(s,l,u=0,c=s.length){if(u<c){if(t(l,l)!==0)return c;do{const h=u+c>>>1;n(s[h],l)<=0?u=h+1:c=h}while(u<c)}return u}function a(s,l,u=0,c=s.length){const h=i(s,l,u,c-1);return h>u&&r(s[h-1],l)>-r(s[h],l)?h-1:h}return{left:i,center:a,right:o}}function vD(){return 0}function rs(e){return e===null?NaN:+e}function*SD(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const Am=ns(_e),wm=Am.right,TD=Am.left,_D=ns(rs).center,qn=wm;function AD(e,t){if(!((t=+t)>=0))throw new RangeError("invalid r");let n=e.length;if(!((n=Math.floor(n))>=0))throw new RangeError("invalid length");if(!n||!t)return e;const r=Ac(t),i=e.slice();return r(e,i,0,n,1),r(i,e,0,n,1),r(e,i,0,n,1),e}const Pm=Dm(Ac),wD=Dm(PD);function Dm(e){return function(t,n,r=n){if(!((n=+n)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:a}=t;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((a=Math.floor(a!==void 0?a:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!a||!n&&!r)return t;const s=n&&e(n),l=r&&e(r),u=i.slice();return s&&l?(Ur(s,u,i,o,a),Ur(s,i,u,o,a),Ur(s,u,i,o,a),jr(l,i,u,o,a),jr(l,u,i,o,a),jr(l,i,u,o,a)):s?(Ur(s,i,u,o,a),Ur(s,u,i,o,a),Ur(s,i,u,o,a)):l&&(jr(l,i,u,o,a),jr(l,u,i,o,a),jr(l,i,u,o,a)),t}}function Ur(e,t,n,r,i){for(let o=0,a=r*i;o<a;)e(t,n,o,o+=r,1)}function jr(e,t,n,r,i){for(let o=0,a=r*i;o<r;++o)e(t,n,o,o+a,r)}function PD(e){const t=Ac(e);return(n,r,i,o,a)=>{i<<=2,o<<=2,a<<=2,t(n,r,i+0,o+0,a),t(n,r,i+1,o+1,a),t(n,r,i+2,o+2,a),t(n,r,i+3,o+3,a)}}function Ac(e){const t=Math.floor(e);if(t===e)return DD(e);const n=e-t,r=2*e+1;return(i,o,a,s,l)=>{if(!((s-=l)>=a))return;let u=t*o[a];const c=l*t,h=c+l;for(let f=a,p=a+c;f<p;f+=l)u+=o[Math.min(s,f)];for(let f=a,p=s;f<=p;f+=l)u+=o[Math.min(s,f+c)],i[f]=(u+n*(o[Math.max(a,f-h)]+o[Math.min(s,f+h)]))/r,u-=o[Math.max(a,f-c)]}}function DD(e){const t=2*e+1;return(n,r,i,o,a)=>{if(!((o-=a)>=i))return;let s=e*r[i];const l=a*e;for(let u=i,c=i+l;u<c;u+=a)s+=r[Math.min(o,u)];for(let u=i,c=o;u<=c;u+=a)s+=r[Math.min(o,u+l)],n[u]=s/t,s-=r[Math.max(i,u-l)]}}function is(e,t){let n=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(i=+i)>=i&&++n}return n}function CD(e){return e.length|0}function LD(e){return!(e>0)}function MD(e){return typeof e!="object"||"length"in e?e:Array.from(e)}function kD(e){return t=>e(...t)}function RD(...e){const t=typeof e[e.length-1]=="function"&&kD(e.pop());e=e.map(MD);const n=e.map(CD),r=e.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(LD))return o;for(;;){o.push(i.map((s,l)=>e[l][s]));let a=r;for(;++i[a]===n[a];){if(a===0)return t?o.map(t):o;i[a--]=0}}}function ID(e,t){var n=0,r=0;return Float64Array.from(e,t===void 0?i=>n+=+i||0:i=>n+=+t(i,r++,e)||0)}function Cm(e,t){let n=0,r,i=0,o=0;if(t===void 0)for(let a of e)a!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i));else{let a=-1;for(let s of e)(s=t(s,++a,e))!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i))}if(n>1)return o/(n-1)}function Lm(e,t){const n=Cm(e,t);return n&&Math.sqrt(n)}function lo(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class Me{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const o=n[i],a=t+o,s=Math.abs(t)<Math.abs(o)?t-(a-o):o-(a-t);s&&(n[r++]=s),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,o,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,i=t[--n],a=r+i,o=i-(a-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=o*2,r=a+i,i==r-a&&(a=r))}return a}}function ED(e,t){const n=new Me;if(t===void 0)for(let r of e)(r=+r)&&n.add(r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&n.add(i)}return+n}function BD(e,t){const n=new Me;let r=-1;return Float64Array.from(e,t===void 0?i=>n.add(+i||0):i=>n.add(+t(i,++r,e)||0))}class uo extends Map{constructor(t,n=Rm){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(wc(this,t))}has(t){return super.has(wc(this,t))}set(t,n){return super.set(Mm(this,t),n)}delete(t){return super.delete(km(this,t))}}class Zn extends Set{constructor(t,n=Rm){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const r of t)this.add(r)}has(t){return super.has(wc(this,t))}add(t){return super.add(Mm(this,t))}delete(t){return super.delete(km(this,t))}}function wc({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Mm({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function km({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Rm(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Hr(e){return e}function Im(e,...t){return qr(e,Hr,Hr,t)}function Em(e,...t){return qr(e,Array.from,Hr,t)}function Bm(e,t){for(let n=1,r=t.length;n<r;++n)e=e.flatMap(i=>i.pop().map(([o,a])=>[...i,o,a]));return e}function ND(e,...t){return Bm(Em(e,...t),t)}function FD(e,t,...n){return Bm(Fm(e,t,...n),n)}function Nm(e,t,...n){return qr(e,Hr,t,n)}function Fm(e,t,...n){return qr(e,Array.from,t,n)}function zD(e,...t){return qr(e,Hr,zm,t)}function OD(e,...t){return qr(e,Array.from,zm,t)}function zm(e){if(e.length!==1)throw new Error("duplicate key");return e[0]}function qr(e,t,n,r){return function i(o,a){if(a>=r.length)return n(o);const s=new uo,l=r[a++];let u=-1;for(const c of o){const h=l(c,++u,o),f=s.get(h);f?f.push(c):s.set(h,[c])}for(const[c,h]of s)s.set(c,i(h,a));return t(s)}(e,0)}function Om(e,t){return Array.from(t,n=>e[n])}function Pc(e,...t){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");e=Array.from(e);let[n]=t;if(n&&n.length!==2||t.length>1){const r=Uint32Array.from(e,(i,o)=>o);return t.length>1?(t=t.map(i=>e.map(i)),r.sort((i,o)=>{for(const a of t){const s=Zr(a[i],a[o]);if(s)return s}})):(n=e.map(n),r.sort((i,o)=>Zr(n[i],n[o]))),Om(e,r)}return e.sort(Dc(n))}function Dc(e=_e){if(e===_e)return Zr;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Zr(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function GD(e,t,n){return(t.length!==2?Pc(Nm(e,t,n),([r,i],[o,a])=>_e(i,a)||_e(r,o)):Pc(Im(e,n),([r,i],[o,a])=>t(i,a)||_e(r,o))).map(([r])=>r)}var WD=Array.prototype,VD=WD.slice;function Cc(e){return()=>e}const YD=Math.sqrt(50),XD=Math.sqrt(10),UD=Math.sqrt(2);function os(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=YD?10:o>=XD?5:o>=UD?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/a,s=Math.round(e*u),l=Math.round(t*u),s/u<e&&++s,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*a,s=Math.round(e/u),l=Math.round(t/u),s*u<e&&++s,l*u>t&&--l),l<s&&.5<=n&&n<2?os(e,t,n*2):[s,l,u]}function Kn(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,a]=r?os(t,e,n):os(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let u=0;u<s;++u)l[u]=(o-u)/-a;else for(let u=0;u<s;++u)l[u]=(o-u)*a;else if(a<0)for(let u=0;u<s;++u)l[u]=(i+u)/-a;else for(let u=0;u<s;++u)l[u]=(i+u)*a;return l}function Qn(e,t,n){return t=+t,e=+e,n=+n,os(e,t,n)[2]}function as(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Qn(t,e,n):Qn(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Lc(e,t,n){let r;for(;;){const i=Qn(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function Mc(e){return Math.max(1,Math.ceil(Math.log(is(e))/Math.LN2)+1)}function Gm(){var e=Hr,t=lo,n=Mc;function r(i){Array.isArray(i)||(i=Array.from(i));var o,a=i.length,s,l,u=new Array(a);for(o=0;o<a;++o)u[o]=e(i[o],o,i);var c=t(u),h=c[0],f=c[1],p=n(u,h,f);if(!Array.isArray(p)){const x=f,$=+p;if(t===lo&&([h,f]=Lc(h,f,$)),p=Kn(h,f,$),p[0]<=h&&(l=Qn(h,f,$)),p[p.length-1]>=f)if(x>=f&&t===lo){const S=Qn(h,f,$);isFinite(S)&&(S>0?f=(Math.floor(f/S)+1)*S:S<0&&(f=(Math.ceil(f*-S)+1)/-S))}else p.pop()}for(var d=p.length,m=0,g=d;p[m]<=h;)++m;for(;p[g-1]>f;)--g;(m||g<d)&&(p=p.slice(m,g),d=g-m);var y=new Array(d+1),b;for(o=0;o<=d;++o)b=y[o]=[],b.x0=o>0?p[o-1]:h,b.x1=o<d?p[o]:f;if(isFinite(l)){if(l>0)for(o=0;o<a;++o)(s=u[o])!=null&&h<=s&&s<=f&&y[Math.min(d,Math.floor((s-h)/l))].push(i[o]);else if(l<0){for(o=0;o<a;++o)if((s=u[o])!=null&&h<=s&&s<=f){const x=Math.floor((h-s)*l);y[Math.min(d,x+(p[x]<=s))].push(i[o])}}}else for(o=0;o<a;++o)(s=u[o])!=null&&h<=s&&s<=f&&y[qn(p,s,0,d)].push(i[o]);return y}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Cc(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Cc([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Cc(Array.isArray(i)?VD.call(i):i),r):n},r}function co(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function kc(e,t){let n,r=-1,i=-1;if(t===void 0)for(const o of e)++i,o!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of e)(o=t(o,++i,e))!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);return r}function ss(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Rc(e,t){let n,r=-1,i=-1;if(t===void 0)for(const o of e)++i,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of e)(o=t(o,++i,e))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);return r}function ls(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Zr:Dc(i);r>n;){if(r-n>600){const l=r-n+1,u=t-n+1,c=Math.log(l),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1),p=Math.max(n,Math.floor(t-u*h/l+f)),d=Math.min(r,Math.floor(t+(l-u)*h/l+f));ls(e,t,p,d,i)}const o=e[t];let a=n,s=r;for(fo(e,n,t),i(e[r],o)>0&&fo(e,n,r);a<s;){for(fo(e,a,s),++a,--s;i(e[a],o)<0;)++a;for(;i(e[s],o)>0;)--s}i(e[n],o)===0?fo(e,n,s):(++s,fo(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function fo(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Wm(e,t=_e){let n,r=!1;if(t.length===1){let i;for(const o of e){const a=t(o);(r?_e(a,i)>0:_e(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of e)(r?t(i,n)>0:t(i,i)===0)&&(n=i,r=!0);return n}function ho(e,t,n){if(e=Float64Array.from(SD(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return ss(e);if(t>=1)return co(e);var r,i=(r-1)*t,o=Math.floor(i),a=co(ls(e,o).subarray(0,o+1)),s=ss(e.subarray(o+1));return a+(s-a)*(i-o)}}function Vm(e,t,n=rs){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e),s=+n(e[o+1],o+1,e);return a+(s-a)*(i-o)}}function Ym(e,t,n=rs){if(!isNaN(t=+t)){if(r=Float64Array.from(e,(s,l)=>rs(n(e[l],l,e))),t<=0)return Rc(r);if(t>=1)return kc(r);var r,i=Uint32Array.from(e,(s,l)=>l),o=r.length-1,a=Math.floor(o*t);return ls(i,a,0,o,(s,l)=>Zr(r[s],r[l])),a=Wm(i.subarray(0,a+1),s=>r[s]),a>=0?a:-1}}function jD(e,t,n){const r=is(e),i=ho(e,.75)-ho(e,.25);return r&&i?Math.ceil((n-t)/(2*i*Math.pow(r,-1/3))):1}function HD(e,t,n){const r=is(e),i=Lm(e);return r&&i?Math.ceil((n-t)*Math.cbrt(r)/(3.49*i)):1}function qD(e,t){let n=0,r=0;if(t===void 0)for(let i of e)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function ZD(e,t){return ho(e,.5,t)}function KD(e,t){return Ym(e,.5,t)}function*QD(e){for(const t of e)yield*t}function Ic(e){return Array.from(QD(e))}function JD(e,t){const n=new uo;if(t===void 0)for(let o of e)o!=null&&o>=o&&n.set(o,(n.get(o)||0)+1);else{let o=-1;for(let a of e)(a=t(a,++o,e))!=null&&a>=a&&n.set(a,(n.get(a)||0)+1)}let r,i=0;for(const[o,a]of n)a>i&&(i=a,r=o);return r}function eC(e,t=tC){const n=[];let r,i=!1;for(const o of e)i&&n.push(t(r,o)),r=o,i=!0;return n}function tC(e,t){return[e,t]}function Cn(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function nC(e,t=_e){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");let n=Array.from(e);const r=new Float64Array(n.length);t.length!==2&&(n=n.map(t),t=_e);const i=(s,l)=>t(n[s],n[l]);let o,a;return e=Uint32Array.from(n,(s,l)=>l),e.sort(t===_e?(s,l)=>Zr(n[s],n[l]):Dc(i)),e.forEach((s,l)=>{const u=i(s,o===void 0?s:o);u>=0?((o===void 0||u>0)&&(o=s,a=l),r[s]=a):r[s]=NaN}),r}function rC(e,t=_e){let n,r=!1;if(t.length===1){let i;for(const o of e){const a=t(o);(r?_e(a,i)<0:_e(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of e)(r?t(i,n)<0:t(i,i)===0)&&(n=i,r=!0);return n}function Xm(e,t=_e){if(t.length===1)return Rc(e,t);let n,r=-1,i=-1;for(const o of e)++i,(r<0?t(o,o)===0:t(o,n)<0)&&(n=o,r=i);return r}function iC(e,t=_e){if(t.length===1)return kc(e,t);let n,r=-1,i=-1;for(const o of e)++i,(r<0?t(o,o)===0:t(o,n)>0)&&(n=o,r=i);return r}function oC(e,t){const n=Xm(e,t);return n<0?void 0:n}const aC=Um(Math.random);function Um(e){return function(n,r=0,i=n.length){let o=i-(r=+r);for(;o;){const a=e()*o--|0,s=n[o+r];n[o+r]=n[a+r],n[a+r]=s}return n}}function Ec(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function jm(e){if(!(o=e.length))return[];for(var t=-1,n=ss(e,sC),r=new Array(n);++t<n;)for(var i=-1,o,a=r[t]=new Array(o);++i<o;)a[i]=e[i][t];return r}function sC(e){return e.length}function lC(){return jm(arguments)}function uC(e,t){if(typeof t!="function")throw new TypeError("test is not a function");let n=-1;for(const r of e)if(!t(r,++n,e))return!1;return!0}function cC(e,t){if(typeof t!="function")throw new TypeError("test is not a function");let n=-1;for(const r of e)if(t(r,++n,e))return!0;return!1}function fC(e,t){if(typeof t!="function")throw new TypeError("test is not a function");const n=[];let r=-1;for(const i of e)t(i,++r,e)&&n.push(i);return n}function hC(e,t){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");if(typeof t!="function")throw new TypeError("mapper is not a function");return Array.from(e,(n,r)=>t(n,r,e))}function pC(e,t,n){if(typeof t!="function")throw new TypeError("reducer is not a function");const r=e[Symbol.iterator]();let i,o,a=-1;if(arguments.length<3){if({done:i,value:n}=r.next(),i)return;++a}for(;{done:i,value:o}=r.next(),!i;)n=t(n,o,++a,e);return n}function gC(e){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(e).reverse()}function dC(e,...t){e=new Zn(e);for(const n of t)for(const r of n)e.delete(r);return e}function mC(e,t){const n=t[Symbol.iterator](),r=new Zn;for(const i of e){if(r.has(i))return!1;let o,a;for(;({value:o,done:a}=n.next())&&!a;){if(Object.is(i,o))return!1;r.add(o)}}return!0}function yC(e,...t){e=new Zn(e),t=t.map(bC);e:for(const n of e)for(const r of t)if(!r.has(n)){e.delete(n);continue e}return e}function bC(e){return e instanceof Zn?e:new Zn(e)}function Hm(e,t){const n=e[Symbol.iterator](),r=new Set;for(const i of t){const o=qm(i);if(r.has(o))continue;let a,s;for(;{value:a,done:s}=n.next();){if(s)return!1;const l=qm(a);if(r.add(l),Object.is(o,l))break}}return!0}function qm(e){return e!==null&&typeof e=="object"?e.valueOf():e}function xC(e,t){return Hm(t,e)}function $C(...e){const t=new Zn;for(const n of e)for(const r of n)t.add(r);return t}function vC(e){return e}var us=1,cs=2,Bc=3,po=4,Zm=1e-6;function SC(e){return"translate("+e+",0)"}function TC(e){return"translate(0,"+e+")"}function _C(e){return t=>+e(t)}function AC(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function wC(){return!this.__axis}function fs(e,t){var n=[],r=null,i=null,o=6,a=6,s=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=e===us||e===po?-1:1,c=e===po||e===cs?"x":"y",h=e===us||e===Bc?SC:TC;function f(p){var d=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):vC),g=Math.max(o,0)+s,y=t.range(),b=+y[0]+l,x=+y[y.length-1]+l,$=(t.bandwidth?AC:_C)(t.copy(),l),S=p.selection?p.selection():p,_=S.selectAll(".domain").data([null]),A=S.selectAll(".tick").data(d,t).order(),w=A.exit(),P=A.enter().append("g").attr("class","tick"),I=A.select("line"),v=A.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(P),I=I.merge(P.append("line").attr("stroke","currentColor").attr(c+"2",u*o)),v=v.merge(P.append("text").attr("fill","currentColor").attr(c,u*g).attr("dy",e===us?"0em":e===Bc?"0.71em":"0.32em")),p!==S&&(_=_.transition(p),A=A.transition(p),I=I.transition(p),v=v.transition(p),w=w.transition(p).attr("opacity",Zm).attr("transform",function(N){return isFinite(N=$(N))?h(N+l):this.getAttribute("transform")}),P.attr("opacity",Zm).attr("transform",function(N){var R=this.parentNode.__axis;return h((R&&isFinite(R=R(N))?R:$(N))+l)})),w.remove(),_.attr("d",e===po||e===cs?a?"M"+u*a+","+b+"H"+l+"V"+x+"H"+u*a:"M"+l+","+b+"V"+x:a?"M"+b+","+u*a+"V"+l+"H"+x+"V"+u*a:"M"+b+","+l+"H"+x),A.attr("opacity",1).attr("transform",function(N){return h($(N)+l)}),I.attr(c+"2",u*o),v.attr(c,u*g).text(m),S.filter(wC).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===cs?"start":e===po?"end":"middle"),S.each(function(){this.__axis=$})}return f.scale=function(p){return arguments.length?(t=p,f):t},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),f):n.slice()},f.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),f):r&&r.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(o=a=+p,f):o},f.tickSizeInner=function(p){return arguments.length?(o=+p,f):o},f.tickSizeOuter=function(p){return arguments.length?(a=+p,f):a},f.tickPadding=function(p){return arguments.length?(s=+p,f):s},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function hs(e){return fs(us,e)}function PC(e){return fs(cs,e)}function Km(e){return fs(Bc,e)}function Nc(e){return fs(po,e)}var DC={value:()=>{}};function Jn(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ps(n)}function ps(e){this._=e}function CC(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ps.prototype=Jn.prototype={constructor:ps,on:function(e,t){var n=this._,r=CC(e+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(e=r[o]).type)&&(i=LC(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(i=(e=r[o]).type)n[i]=Qm(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Qm(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ps(e)},call:function(e,t){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(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function LC(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Qm(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=DC,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Fc="http://www.w3.org/1999/xhtml";const zc={svg:"http://www.w3.org/2000/svg",xhtml:Fc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function go(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),zc.hasOwnProperty(t)?{space:zc[t],local:e}:e}function MC(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Fc&&t.documentElement.namespaceURI===Fc?t.createElement(e):t.createElementNS(n,e)}}function kC(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gs(e){var t=go(e);return(t.local?kC:MC)(t)}function RC(){}function ds(e){return e==null?RC:function(){return this.querySelector(e)}}function IC(e){typeof e!="function"&&(e=ds(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=new Array(a),l,u,c=0;c<a;++c)(l=o[c])&&(u=e.call(l,l.__data__,c,o))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new qe(r,this._parents)}function Jm(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function EC(){return[]}function Oc(e){return e==null?EC:function(){return this.querySelectorAll(e)}}function BC(e){return function(){return Jm(e.apply(this,arguments))}}function NC(e){typeof e=="function"?e=BC(e):e=Oc(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var a=t[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&(r.push(e.call(l,l.__data__,u,a)),i.push(l));return new qe(r,i)}function Gc(e){return function(){return this.matches(e)}}function e0(e){return function(t){return t.matches(e)}}var FC=Array.prototype.find;function zC(e){return function(){return FC.call(this.children,e)}}function OC(){return this.firstElementChild}function GC(e){return this.select(e==null?OC:zC(typeof e=="function"?e:e0(e)))}var WC=Array.prototype.filter;function VC(){return Array.from(this.children)}function YC(e){return function(){return WC.call(this.children,e)}}function XC(e){return this.selectAll(e==null?VC:YC(typeof e=="function"?e:e0(e)))}function UC(e){typeof e!="function"&&(e=Gc(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&s.push(l);return new qe(r,this._parents)}function t0(e){return new Array(e.length)}function jC(){return new qe(this._enter||this._groups.map(t0),this._parents)}function ms(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ms.prototype={constructor:ms,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function HC(e){return function(){return e}}function qC(e,t,n,r,i,o){for(var a=0,s,l=t.length,u=o.length;a<u;++a)(s=t[a])?(s.__data__=o[a],r[a]=s):n[a]=new ms(e,o[a]);for(;a<l;++a)(s=t[a])&&(i[a]=s)}function ZC(e,t,n,r,i,o,a){var s,l,u=new Map,c=t.length,h=o.length,f=new Array(c),p;for(s=0;s<c;++s)(l=t[s])&&(f[s]=p=a.call(l,l.__data__,s,t)+"",u.has(p)?i[s]=l:u.set(p,l));for(s=0;s<h;++s)p=a.call(e,o[s],s,o)+"",(l=u.get(p))?(r[s]=l,l.__data__=o[s],u.delete(p)):n[s]=new ms(e,o[s]);for(s=0;s<c;++s)(l=t[s])&&u.get(f[s])===l&&(i[s]=l)}function KC(e){return e.__data__}function QC(e,t){if(!arguments.length)return Array.from(this,KC);var n=t?ZC:qC,r=this._parents,i=this._groups;typeof e!="function"&&(e=HC(e));for(var o=i.length,a=new Array(o),s=new Array(o),l=new Array(o),u=0;u<o;++u){var c=r[u],h=i[u],f=h.length,p=JC(e.call(c,c&&c.__data__,u,r)),d=p.length,m=s[u]=new Array(d),g=a[u]=new Array(d),y=l[u]=new Array(f);n(c,h,m,g,y,p,t);for(var b=0,x=0,$,S;b<d;++b)if($=m[b]){for(b>=x&&(x=b+1);!(S=g[x])&&++x<d;);$._next=S||null}}return a=new qe(a,r),a._enter=s,a._exit=l,a}function JC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function eL(){return new qe(this._exit||this._groups.map(t0),this._parents)}function tL(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function nL(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=r[l],h=u.length,f=s[l]=new Array(h),p,d=0;d<h;++d)(p=u[d]||c[d])&&(f[d]=p);for(;l<i;++l)s[l]=n[l];return new qe(s,this._parents)}function rL(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],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 iL(e){e||(e=oL);function t(h,f){return h&&f?e(h.__data__,f.__data__):!h-!f}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,l=i[o]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(t)}return new qe(i,this._parents).order()}function oL(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function aL(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function sL(){return Array.from(this)}function lL(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function uL(){let e=0;for(const t of this)++e;return e}function cL(){return!this.node()}function fL(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&e.call(s,s.__data__,o,i);return this}function hL(e){return function(){this.removeAttribute(e)}}function pL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function gL(e,t){return function(){this.setAttribute(e,t)}}function dL(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function mL(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function yL(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function bL(e,t){var n=go(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?pL:hL:typeof t=="function"?n.local?yL:mL:n.local?dL:gL)(n,t))}function Wc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function xL(e){return function(){this.style.removeProperty(e)}}function $L(e,t,n){return function(){this.style.setProperty(e,t,n)}}function vL(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function SL(e,t,n){return arguments.length>1?this.each((t==null?xL:typeof t=="function"?vL:$L)(e,t,n??"")):er(this.node(),e)}function er(e,t){return e.style.getPropertyValue(t)||Wc(e).getComputedStyle(e,null).getPropertyValue(t)}function TL(e){return function(){delete this[e]}}function _L(e,t){return function(){this[e]=t}}function AL(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function wL(e,t){return arguments.length>1?this.each((t==null?TL:typeof t=="function"?AL:_L)(e,t)):this.node()[e]}function n0(e){return e.trim().split(/^|\s+/)}function Vc(e){return e.classList||new r0(e)}function r0(e){this._node=e,this._names=n0(e.getAttribute("class")||"")}r0.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function i0(e,t){for(var n=Vc(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function o0(e,t){for(var n=Vc(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function PL(e){return function(){i0(this,e)}}function DL(e){return function(){o0(this,e)}}function CL(e,t){return function(){(t.apply(this,arguments)?i0:o0)(this,e)}}function LL(e,t){var n=n0(e+"");if(arguments.length<2){for(var r=Vc(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?CL:t?PL:DL)(n,t))}function ML(){this.textContent=""}function kL(e){return function(){this.textContent=e}}function RL(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function IL(e){return arguments.length?this.each(e==null?ML:(typeof e=="function"?RL:kL)(e)):this.node().textContent}function EL(){this.innerHTML=""}function BL(e){return function(){this.innerHTML=e}}function NL(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function FL(e){return arguments.length?this.each(e==null?EL:(typeof e=="function"?NL:BL)(e)):this.node().innerHTML}function zL(){this.nextSibling&&this.parentNode.appendChild(this)}function OL(){return this.each(zL)}function GL(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function WL(){return this.each(GL)}function VL(e){var t=typeof e=="function"?e:gs(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function YL(){return null}function XL(e,t){var n=typeof e=="function"?e:gs(e),r=t==null?YL:typeof t=="function"?t:ds(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function UL(){var e=this.parentNode;e&&e.removeChild(this)}function jL(){return this.each(UL)}function HL(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qL(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ZL(e){return this.select(e?qL:HL)}function KL(e){return arguments.length?this.property("__data__",e):this.node().__data__}function QL(e){return function(t){e.call(this,t,this.__data__)}}function JL(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function eM(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function tM(e,t,n){return function(){var r=this.__on,i,o=QL(t);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function nM(e,t,n){var r=JL(e+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,c;l<u;++l)for(i=0,c=s[l];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=t?tM:eM,i=0;i<o;++i)this.each(s(r[i],t,n));return this}function a0(e,t,n){var r=Wc(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function rM(e,t){return function(){return a0(this,e,t)}}function iM(e,t){return function(){return a0(this,e,t.apply(this,arguments))}}function oM(e,t){return this.each((typeof t=="function"?iM:rM)(e,t))}function*aM(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var Yc=[null];function qe(e,t){this._groups=e,this._parents=t}function tr(){return new qe([[document.documentElement]],Yc)}function sM(){return this}qe.prototype=tr.prototype={constructor:qe,select:IC,selectAll:NC,selectChild:GC,selectChildren:XC,filter:UC,data:QC,enter:jC,exit:eL,join:tL,merge:nL,selection:sM,order:rL,sort:iL,call:aL,nodes:sL,node:lL,size:uL,empty:cL,each:fL,attr:bL,style:SL,property:wL,classed:LL,text:IL,html:FL,raise:OL,lower:WL,append:VL,insert:XL,remove:jL,clone:ZL,datum:KL,on:nM,dispatch:oM,[Symbol.iterator]:aM};function X(e){return typeof e=="string"?new qe([[document.querySelector(e)]],[document.documentElement]):new qe([[e]],Yc)}function lM(e){return X(gs(e).call(document.documentElement))}var uM=0;function s0(){return new Xc}function Xc(){this._="@"+(++uM).toString(36)}Xc.prototype=s0.prototype={constructor:Xc,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};function l0(e){let t;for(;t=e.sourceEvent;)e=t;return e}function yt(e,t){if(e=l0(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}function cM(e,t){return e.target&&(e=l0(e),t===void 0&&(t=e.currentTarget),e=e.touches||[e]),Array.from(e,n=>yt(n,t))}function fM(e){return typeof e=="string"?new qe([document.querySelectorAll(e)],[document.documentElement]):new qe([Jm(e)],Yc)}const hM={passive:!1},mo={capture:!0,passive:!1};function Uc(e){e.stopImmediatePropagation()}function Kr(e){e.preventDefault(),e.stopImmediatePropagation()}function ys(e){var t=e.document.documentElement,n=X(e).on("dragstart.drag",Kr,mo);"onselectstart"in t?n.on("selectstart.drag",Kr,mo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function bs(e,t){var n=e.document.documentElement,r=X(e).on("dragstart.drag",null);t&&(r.on("click.drag",Kr,mo),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const xs=e=>()=>e;function jc(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:a,y:s,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}jc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function pM(e){return!e.ctrlKey&&!e.button}function gM(){return this.parentNode}function dM(e,t){return t??{x:e.x,y:e.y}}function mM(){return navigator.maxTouchPoints||"ontouchstart"in this}function $s(){var e=pM,t=gM,n=dM,r=mM,i={},o=Jn("start","drag","end"),a=0,s,l,u,c,h=0;function f($){$.on("mousedown.drag",p).filter(r).on("touchstart.drag",g).on("touchmove.drag",y,hM).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p($,S){if(!(c||!e.call(this,$,S))){var _=x(this,t.call(this,$,S),$,S,"mouse");_&&(X($.view).on("mousemove.drag",d,mo).on("mouseup.drag",m,mo),ys($.view),Uc($),u=!1,s=$.clientX,l=$.clientY,_("start",$))}}function d($){if(Kr($),!u){var S=$.clientX-s,_=$.clientY-l;u=S*S+_*_>h}i.mouse("drag",$)}function m($){X($.view).on("mousemove.drag mouseup.drag",null),bs($.view,u),Kr($),i.mouse("end",$)}function g($,S){if(e.call(this,$,S)){var _=$.changedTouches,A=t.call(this,$,S),w=_.length,P,I;for(P=0;P<w;++P)(I=x(this,A,$,S,_[P].identifier,_[P]))&&(Uc($),I("start",$,_[P]))}}function y($){var S=$.changedTouches,_=S.length,A,w;for(A=0;A<_;++A)(w=i[S[A].identifier])&&(Kr($),w("drag",$,S[A]))}function b($){var S=$.changedTouches,_=S.length,A,w;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),A=0;A<_;++A)(w=i[S[A].identifier])&&(Uc($),w("end",$,S[A]))}function x($,S,_,A,w,P){var I=o.copy(),v=yt(P||_,S),N,R,D;if((D=n.call($,new jc("beforestart",{sourceEvent:_,target:f,identifier:w,active:a,x:v[0],y:v[1],dx:0,dy:0,dispatch:I}),A))!=null)return N=D.x-v[0]||0,R=D.y-v[1]||0,function T(M,G,k){var B=v,F;switch(M){case"start":i[w]=T,F=a++;break;case"end":delete i[w],--a;case"drag":v=yt(k||G,S),F=a;break}I.call(M,$,new jc(M,{sourceEvent:G,subject:D,target:f,identifier:w,active:F,x:v[0]+N,y:v[1]+R,dx:v[0]-B[0],dy:v[1]-B[1],dispatch:I}),A)}}return f.filter=function($){return arguments.length?(e=typeof $=="function"?$:xs(!!$),f):e},f.container=function($){return arguments.length?(t=typeof $=="function"?$:xs($),f):t},f.subject=function($){return arguments.length?(n=typeof $=="function"?$:xs($),f):n},f.touchable=function($){return arguments.length?(r=typeof $=="function"?$:xs(!!$),f):r},f.on=function(){var $=o.on.apply(o,arguments);return $===o?f:$},f.clickDistance=function($){return arguments.length?(h=($=+$)*$,f):Math.sqrt(h)},f}function Qr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function yo(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ln(){}var nr=.7,Jr=1/nr,ei="\\s*([+-]?\\d+)\\s*",bo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ut="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",yM=/^#([0-9a-f]{3,8})$/,bM=new RegExp(`^rgb\\(${ei},${ei},${ei}\\)$`),xM=new RegExp(`^rgb\\(${Ut},${Ut},${Ut}\\)$`),$M=new RegExp(`^rgba\\(${ei},${ei},${ei},${bo}\\)$`),vM=new RegExp(`^rgba\\(${Ut},${Ut},${Ut},${bo}\\)$`),SM=new RegExp(`^hsl\\(${bo},${Ut},${Ut}\\)$`),TM=new RegExp(`^hsla\\(${bo},${Ut},${Ut},${bo}\\)$`),u0={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};Qr(Ln,Mn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:c0,formatHex:c0,formatHex8:_M,formatHsl:AM,formatRgb:f0,toString:f0});function c0(){return this.rgb().formatHex()}function _M(){return this.rgb().formatHex8()}function AM(){return m0(this).formatHsl()}function f0(){return this.rgb().formatRgb()}function Mn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=yM.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?h0(t):n===3?new Ie(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?vs(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?vs(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=bM.exec(e))?new Ie(t[1],t[2],t[3],1):(t=xM.exec(e))?new Ie(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=$M.exec(e))?vs(t[1],t[2],t[3],t[4]):(t=vM.exec(e))?vs(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=SM.exec(e))?d0(t[1],t[2]/100,t[3]/100,1):(t=TM.exec(e))?d0(t[1],t[2]/100,t[3]/100,t[4]):u0.hasOwnProperty(e)?h0(u0[e]):e==="transparent"?new Ie(NaN,NaN,NaN,0):null}function h0(e){return new Ie(e>>16&255,e>>8&255,e&255,1)}function vs(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ie(e,t,n,r)}function Hc(e){return e instanceof Ln||(e=Mn(e)),e?(e=e.rgb(),new Ie(e.r,e.g,e.b,e.opacity)):new Ie}function ti(e,t,n,r){return arguments.length===1?Hc(e):new Ie(e,t,n,r??1)}function Ie(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Qr(Ie,ti,yo(Ln,{brighter(e){return e=e==null?Jr:Math.pow(Jr,e),new Ie(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?nr:Math.pow(nr,e),new Ie(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ie(rr(this.r),rr(this.g),rr(this.b),Ss(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:p0,formatHex:p0,formatHex8:wM,formatRgb:g0,toString:g0}));function p0(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}`}function wM(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}${ir((isNaN(this.opacity)?1:this.opacity)*255)}`}function g0(){const e=Ss(this.opacity);return`${e===1?"rgb(":"rgba("}${rr(this.r)}, ${rr(this.g)}, ${rr(this.b)}${e===1?")":`, ${e})`}`}function Ss(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function rr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ir(e){return e=rr(e),(e<16?"0":"")+e.toString(16)}function d0(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new It(e,t,n,r)}function m0(e){if(e instanceof It)return new It(e.h,e.s,e.l,e.opacity);if(e instanceof Ln||(e=Mn(e)),!e)return new It;if(e instanceof It)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(t===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-t)/s+2:a=(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new It(a,s,l,e.opacity)}function Ts(e,t,n,r){return arguments.length===1?m0(e):new It(e,t,n,r??1)}function It(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Qr(It,Ts,yo(Ln,{brighter(e){return e=e==null?Jr:Math.pow(Jr,e),new It(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?nr:Math.pow(nr,e),new It(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ie(qc(e>=240?e-240:e+120,i,r),qc(e,i,r),qc(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new It(y0(this.h),_s(this.s),_s(this.l),Ss(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ss(this.opacity);return`${e===1?"hsl(":"hsla("}${y0(this.h)}, ${_s(this.s)*100}%, ${_s(this.l)*100}%${e===1?")":`, ${e})`}`}}));function y0(e){return e=(e||0)%360,e<0?e+360:e}function _s(e){return Math.max(0,Math.min(1,e||0))}function qc(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const b0=Math.PI/180,x0=180/Math.PI,As=18,$0=.96422,v0=1,S0=.82521,T0=4/29,ni=6/29,_0=3*ni*ni,PM=ni*ni*ni;function A0(e){if(e instanceof Et)return new Et(e.l,e.a,e.b,e.opacity);if(e instanceof jt)return P0(e);e instanceof Ie||(e=Hc(e));var t=Jc(e.r),n=Jc(e.g),r=Jc(e.b),i=Zc((.2225045*t+.7168786*n+.0606169*r)/v0),o,a;return t===n&&n===r?o=a=i:(o=Zc((.4360747*t+.3850649*n+.1430804*r)/$0),a=Zc((.0139322*t+.0971045*n+.7141733*r)/S0)),new Et(116*i-16,500*(o-i),200*(i-a),e.opacity)}function DM(e,t){return new Et(e,0,0,t??1)}function xo(e,t,n,r){return arguments.length===1?A0(e):new Et(e,t,n,r??1)}function Et(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}Qr(Et,xo,yo(Ln,{brighter(e){return new Et(this.l+As*(e??1),this.a,this.b,this.opacity)},darker(e){return new Et(this.l-As*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=$0*Kc(t),e=v0*Kc(e),n=S0*Kc(n),new Ie(Qc(3.1338561*t-1.6168667*e-.4906146*n),Qc(-.9787684*t+1.9161415*e+.033454*n),Qc(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Zc(e){return e>PM?Math.pow(e,1/3):e/_0+T0}function Kc(e){return e>ni?e*e*e:_0*(e-T0)}function Qc(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Jc(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function w0(e){if(e instanceof jt)return new jt(e.h,e.c,e.l,e.opacity);if(e instanceof Et||(e=A0(e)),e.a===0&&e.b===0)return new jt(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*x0;return new jt(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function CM(e,t,n,r){return arguments.length===1?w0(e):new jt(n,t,e,r??1)}function ws(e,t,n,r){return arguments.length===1?w0(e):new jt(e,t,n,r??1)}function jt(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function P0(e){if(isNaN(e.h))return new Et(e.l,0,0,e.opacity);var t=e.h*b0;return new Et(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Qr(jt,ws,yo(Ln,{brighter(e){return new jt(this.h,this.c,this.l+As*(e??1),this.opacity)},darker(e){return new jt(this.h,this.c,this.l-As*(e??1),this.opacity)},rgb(){return P0(this).rgb()}}));var D0=-.14861,ef=1.78277,tf=-.29227,Ps=-.90649,$o=1.97294,C0=$o*Ps,L0=$o*ef,M0=ef*tf-Ps*D0;function LM(e){if(e instanceof or)return new or(e.h,e.s,e.l,e.opacity);e instanceof Ie||(e=Hc(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(M0*r+C0*t-L0*n)/(M0+C0-L0),o=r-i,a=($o*(n-i)-tf*o)/Ps,s=Math.sqrt(a*a+o*o)/($o*i*(1-i)),l=s?Math.atan2(a,o)*x0-120:NaN;return new or(l<0?l+360:l,s,i,e.opacity)}function Bt(e,t,n,r){return arguments.length===1?LM(e):new or(e,t,n,r??1)}function or(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Qr(or,Bt,yo(Ln,{brighter(e){return e=e==null?Jr:Math.pow(Jr,e),new or(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?nr:Math.pow(nr,e),new or(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*b0,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Ie(255*(t+n*(D0*r+ef*i)),255*(t+n*(tf*r+Ps*i)),255*(t+n*($o*r)),this.opacity)}}));function k0(e,t,n,r,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*n+(1+3*e+3*o-3*a)*r+a*i)/6}function R0(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],a=r>0?e[r-1]:2*i-o,s=r<t-1?e[r+2]:2*o-i;return k0((n-r/t)*t,a,i,o,s)}}function I0(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],o=e[r%t],a=e[(r+1)%t],s=e[(r+2)%t];return k0((n-r/t)*t,i,o,a,s)}}const Ds=e=>()=>e;function E0(e,t){return function(n){return e+n*t}}function MM(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Cs(e,t){var n=t-e;return n?E0(e,n>180||n<-180?n-360*Math.round(n/360):n):Ds(isNaN(e)?t:e)}function kM(e){return(e=+e)==1?Ee:function(t,n){return n-t?MM(t,n,e):Ds(isNaN(t)?n:t)}}function Ee(e,t){var n=t-e;return n?E0(e,n):Ds(isNaN(e)?t:e)}const vo=function e(t){var n=kM(t);function r(i,o){var a=n((i=ti(i)).r,(o=ti(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),u=Ee(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function B0(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),o=new Array(n),a,s;for(a=0;a<n;++a)s=ti(t[a]),r[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return r=e(r),i=e(i),o=e(o),s.opacity=1,function(l){return s.r=r(l),s.g=i(l),s.b=o(l),s+""}}}var N0=B0(R0),RM=B0(I0);function nf(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function F0(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function IM(e,t){return(F0(t)?nf:z0)(e,t)}function z0(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=ln(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function O0(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function bt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function G0(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=ln(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var rf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,of=new RegExp(rf.source,"g");function EM(e){return function(){return e}}function BM(e){return function(t){return e(t)+""}}function af(e,t){var n=rf.lastIndex=of.lastIndex=0,r,i,o,a=-1,s=[],l=[];for(e=e+"",t=t+"";(r=rf.exec(e))&&(i=of.exec(t));)(o=i.index)>n&&(o=t.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,l.push({i:a,x:bt(r,i)})),n=of.lastIndex;return n<t.length&&(o=t.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?BM(l[0].x):EM(t):(t=l.length,function(u){for(var c=0,h;c<t;++c)s[(h=l[c]).i]=h.x(u);return s.join("")})}function ln(e,t){var n=typeof t,r;return t==null||n==="boolean"?Ds(t):(n==="number"?bt:n==="string"?(r=Mn(t))?(t=r,vo):af:t instanceof Mn?vo:t instanceof Date?O0:F0(t)?nf:Array.isArray(t)?z0:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?G0:bt)(e,t)}function NM(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function FM(e,t){var n=Cs(+e,+t);return function(r){var i=n(r);return i-360*Math.floor(i/360)}}function So(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var W0=180/Math.PI,sf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function V0(e,t,n,r,i,o){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*W0,skewX:Math.atan(l)*W0,scaleX:a,scaleY:s}}var Ls;function zM(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?sf:V0(t.a,t.b,t.c,t.d,t.e,t.f)}function OM(e){return e==null||(Ls||(Ls=document.createElementNS("http://www.w3.org/2000/svg","g")),Ls.setAttribute("transform",e),!(e=Ls.transform.baseVal.consolidate()))?sf:(e=e.matrix,V0(e.a,e.b,e.c,e.d,e.e,e.f))}function Y0(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,c,h,f,p,d){if(u!==h||c!==f){var m=p.push("translate(",null,t,null,n);d.push({i:m-4,x:bt(u,h)},{i:m-2,x:bt(c,f)})}else(h||f)&&p.push("translate("+h+t+f+n)}function a(u,c,h,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:h.push(i(h)+"rotate(",null,r)-2,x:bt(u,c)})):c&&h.push(i(h)+"rotate("+c+r)}function s(u,c,h,f){u!==c?f.push({i:h.push(i(h)+"skewX(",null,r)-2,x:bt(u,c)}):c&&h.push(i(h)+"skewX("+c+r)}function l(u,c,h,f,p,d){if(u!==h||c!==f){var m=p.push(i(p)+"scale(",null,",",null,")");d.push({i:m-4,x:bt(u,h)},{i:m-2,x:bt(c,f)})}else(h!==1||f!==1)&&p.push(i(p)+"scale("+h+","+f+")")}return function(u,c){var h=[],f=[];return u=e(u),c=e(c),o(u.translateX,u.translateY,c.translateX,c.translateY,h,f),a(u.rotate,c.rotate,h,f),s(u.skewX,c.skewX,h,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,h,f),u=c=null,function(p){for(var d=-1,m=f.length,g;++d<m;)h[(g=f[d]).i]=g.x(p);return h.join("")}}}var X0=Y0(zM,"px, ","px)","deg)"),U0=Y0(OM,", ",")",")"),GM=1e-12;function j0(e){return((e=Math.exp(e))+1/e)/2}function WM(e){return((e=Math.exp(e))-1/e)/2}function VM(e){return((e=Math.exp(2*e))-1)/(e+1)}const H0=function e(t,n,r){function i(o,a){var s=o[0],l=o[1],u=o[2],c=a[0],h=a[1],f=a[2],p=c-s,d=h-l,m=p*p+d*d,g,y;if(m<GM)y=Math.log(f/u)/t,g=function(A){return[s+A*p,l+A*d,u*Math.exp(t*A*y)]};else{var b=Math.sqrt(m),x=(f*f-u*u+r*m)/(2*u*n*b),$=(f*f-u*u-r*m)/(2*f*n*b),S=Math.log(Math.sqrt(x*x+1)-x),_=Math.log(Math.sqrt($*$+1)-$);y=(_-S)/t,g=function(A){var w=A*y,P=j0(S),I=u/(n*b)*(P*VM(t*w+S)-WM(S));return[s+I*p,l+I*d,u*P/j0(t*w+S)]}}return g.duration=y*1e3*t/Math.SQRT2,g}return i.rho=function(o){var a=Math.max(.001,+o),s=a*a,l=s*s;return e(a,s,l)},i}(Math.SQRT2,2,4);function q0(e){return function(t,n){var r=e((t=Ts(t)).h,(n=Ts(n)).h),i=Ee(t.s,n.s),o=Ee(t.l,n.l),a=Ee(t.opacity,n.opacity);return function(s){return t.h=r(s),t.s=i(s),t.l=o(s),t.opacity=a(s),t+""}}}const YM=q0(Cs);var XM=q0(Ee);function UM(e,t){var n=Ee((e=xo(e)).l,(t=xo(t)).l),r=Ee(e.a,t.a),i=Ee(e.b,t.b),o=Ee(e.opacity,t.opacity);return function(a){return e.l=n(a),e.a=r(a),e.b=i(a),e.opacity=o(a),e+""}}function Z0(e){return function(t,n){var r=e((t=ws(t)).h,(n=ws(n)).h),i=Ee(t.c,n.c),o=Ee(t.l,n.l),a=Ee(t.opacity,n.opacity);return function(s){return t.h=r(s),t.c=i(s),t.l=o(s),t.opacity=a(s),t+""}}}const jM=Z0(Cs);var HM=Z0(Ee);function K0(e){return function t(n){n=+n;function r(i,o){var a=e((i=Bt(i)).h,(o=Bt(o)).h),s=Ee(i.s,o.s),l=Ee(i.l,o.l),u=Ee(i.opacity,o.opacity);return function(c){return i.h=a(c),i.s=s(c),i.l=l(Math.pow(c,n)),i.opacity=u(c),i+""}}return r.gamma=t,r}(1)}const qM=K0(Cs);var Ms=K0(Ee);function Q0(e,t){t===void 0&&(t=e,e=ln);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return function(a){var s=Math.max(0,Math.min(r-1,Math.floor(a*=r)));return o[s](a-s)}}function ZM(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var ri=0,To=0,_o=0,J0=1e3,ks,Ao,Rs=0,ar=0,Is=0,wo=typeof performance=="object"&&performance.now?performance:Date,ey=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Po(){return ar||(ey(KM),ar=wo.now()+Is)}function KM(){ar=0}function Do(){this._call=this._time=this._next=null}Do.prototype=Es.prototype={constructor:Do,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Po():+n)+(t==null?0:+t),!this._next&&Ao!==this&&(Ao?Ao._next=this:ks=this,Ao=this),this._call=e,this._time=n,lf()},stop:function(){this._call&&(this._call=null,this._time=1/0,lf())}};function Es(e,t,n){var r=new Do;return r.restart(e,t,n),r}function ty(){Po(),++ri;for(var e=ks,t;e;)(t=ar-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ri}function ny(){ar=(Rs=wo.now())+Is,ri=To=0;try{ty()}finally{ri=0,JM(),ar=0}}function QM(){var e=wo.now(),t=e-Rs;t>J0&&(Is-=t,Rs=e)}function JM(){for(var e,t=ks,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ks=n);Ao=e,lf(r)}function lf(e){if(!ri){To&&(To=clearTimeout(To));var t=e-ar;t>24?(e<1/0&&(To=setTimeout(ny,e-wo.now()-Is)),_o&&(_o=clearInterval(_o))):(_o||(Rs=wo.now(),_o=setInterval(QM,J0)),ri=1,ey(ny))}}function uf(e,t,n){var r=new Do;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}function e3(e,t,n){var r=new Do,i=t;return t==null?(r.restart(e,t,n),r):(r._restart=r.restart,r.restart=function(o,a,s){a=+a,s=s==null?Po():+s,r._restart(function l(u){u+=i,r._restart(l,i+=a,s),o(u)},a,s)},r.restart(e,t,n),r)}var t3=Jn("start","end","cancel","interrupt"),n3=[],ry=0,cf=1,ff=2,Bs=3,iy=4,hf=5,Ns=6;function Fs(e,t,n,r,i,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;r3(e,n,{name:t,index:r,group:i,on:t3,tween:n3,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:ry})}function pf(e,t){var n=Nt(e,t);if(n.state>ry)throw new Error("too late; already scheduled");return n}function Ht(e,t){var n=Nt(e,t);if(n.state>Bs)throw new Error("too late; already running");return n}function Nt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function r3(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Es(o,0,n.time);function o(u){n.state=cf,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,h,f,p;if(n.state!==cf)return l();for(c in r)if(p=r[c],p.name===n.name){if(p.state===Bs)return uf(a);p.state===iy?(p.state=Ns,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[c]):+c<t&&(p.state=Ns,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[c])}if(uf(function(){n.state===Bs&&(n.state=iy,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=ff,n.on.call("start",e,e.__data__,n.index,n.group),n.state===ff){for(n.state=Bs,i=new Array(f=n.tween.length),c=0,h=-1;c<f;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=p);i.length=h+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=hf,1),h=-1,f=i.length;++h<f;)i[h].call(e,c);n.state===hf&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Ns,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function sr(e,t){var n=e.__transition,r,i,o=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){o=!1;continue}i=r.state>ff&&r.state<hf,r.state=Ns,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}o&&delete e.__transition}}function i3(e){return this.each(function(){sr(this,e)})}function o3(e,t){var n,r;return function(){var i=Ht(this,e),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function a3(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Ht(this,e),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=s;break}l===u&&i.push(s)}o.tween=i}}function s3(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Nt(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?o3:a3)(n,e,t))}function gf(e,t,n){var r=e._id;return e.each(function(){var i=Ht(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Nt(i,r).value[t]}}function oy(e,t){var n;return(typeof t=="number"?bt:t instanceof Mn?vo:(n=Mn(t))?(t=n,vo):af)(e,t)}function l3(e){return function(){this.removeAttribute(e)}}function u3(e){return function(){this.removeAttributeNS(e.space,e.local)}}function c3(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function f3(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function h3(e,t,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s)))}}function p3(e,t,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s)))}}function g3(e,t){var n=go(e),r=n==="transform"?U0:oy;return this.attrTween(e,typeof t=="function"?(n.local?p3:h3)(n,r,gf(this,"attr."+e,t)):t==null?(n.local?u3:l3)(n):(n.local?f3:c3)(n,r,t))}function d3(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function m3(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function y3(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&m3(e,o)),n}return i._value=t,i}function b3(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&d3(e,o)),n}return i._value=t,i}function x3(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=go(e);return this.tween(n,(r.local?y3:b3)(r,t))}function $3(e,t){return function(){pf(this,e).delay=+t.apply(this,arguments)}}function v3(e,t){return t=+t,function(){pf(this,e).delay=t}}function S3(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$3:v3)(t,e)):Nt(this.node(),t).delay}function T3(e,t){return function(){Ht(this,e).duration=+t.apply(this,arguments)}}function _3(e,t){return t=+t,function(){Ht(this,e).duration=t}}function A3(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?T3:_3)(t,e)):Nt(this.node(),t).duration}function w3(e,t){if(typeof t!="function")throw new Error;return function(){Ht(this,e).ease=t}}function P3(e){var t=this._id;return arguments.length?this.each(w3(t,e)):Nt(this.node(),t).ease}function D3(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ht(this,e).ease=n}}function C3(e){if(typeof e!="function")throw new Error;return this.each(D3(this._id,e))}function L3(e){typeof e!="function"&&(e=Gc(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&s.push(l);return new qt(r,this._parents,this._name,this._id)}function M3(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var l=t[s],u=n[s],c=l.length,h=a[s]=new Array(c),f,p=0;p<c;++p)(f=l[p]||u[p])&&(h[p]=f);for(;s<r;++s)a[s]=t[s];return new qt(a,this._parents,this._name,this._id)}function k3(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function R3(e,t,n){var r,i,o=k3(t)?pf:Ht;return function(){var a=o(this,e),s=a.on;s!==r&&(i=(r=s).copy()).on(t,n),a.on=i}}function I3(e,t){var n=this._id;return arguments.length<2?Nt(this.node(),n).on.on(e):this.each(R3(n,e,t))}function E3(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function B3(){return this.on("end.remove",E3(this._id))}function N3(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ds(e));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],l=s.length,u=o[a]=new Array(l),c,h,f=0;f<l;++f)(c=s[f])&&(h=e.call(c,c.__data__,f,s))&&("__data__"in c&&(h.__data__=c.__data__),u[f]=h,Fs(u[f],t,n,f,u,Nt(c,n)));return new qt(o,this._parents,t,n)}function F3(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Oc(e));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var l=r[s],u=l.length,c,h=0;h<u;++h)if(c=l[h]){for(var f=e.call(c,c.__data__,h,l),p,d=Nt(c,n),m=0,g=f.length;m<g;++m)(p=f[m])&&Fs(p,t,n,m,f,d);o.push(f),a.push(c)}return new qt(o,a,t,n)}var z3=tr.prototype.constructor;function O3(){return new z3(this._groups,this._parents)}function G3(e,t){var n,r,i;return function(){var o=er(this,e),a=(this.style.removeProperty(e),er(this,e));return o===a?null:o===n&&a===r?i:i=t(n=o,r=a)}}function ay(e){return function(){this.style.removeProperty(e)}}function W3(e,t,n){var r,i=n+"",o;return function(){var a=er(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}function V3(e,t,n){var r,i,o;return function(){var a=er(this,e),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),er(this,e))),a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s))}}function Y3(e,t){var n,r,i,o="style."+t,a="end."+o,s;return function(){var l=Ht(this,e),u=l.on,c=l.value[o]==null?s||(s=ay(t)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(a,i=c),l.on=r}}function X3(e,t,n){var r=(e+="")=="transform"?X0:oy;return t==null?this.styleTween(e,G3(e,r)).on("end.style."+e,ay(e)):typeof t=="function"?this.styleTween(e,V3(e,r,gf(this,"style."+e,t))).each(Y3(this._id,e)):this.styleTween(e,W3(e,r,t),n).on("end.style."+e,null)}function U3(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function j3(e,t,n){var r,i;function o(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&U3(e,a,n)),r}return o._value=t,o}function H3(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,j3(e,t,n??""))}function q3(e){return function(){this.textContent=e}}function Z3(e){return function(){var t=e(this);this.textContent=t??""}}function K3(e){return this.tween("text",typeof e=="function"?Z3(gf(this,"text",e)):q3(e==null?"":e+""))}function Q3(e){return function(t){this.textContent=e.call(this,t)}}function J3(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Q3(i)),t}return r._value=e,r}function e5(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,J3(e))}function t5(){for(var e=this._name,t=this._id,n=ly(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)if(l=a[u]){var c=Nt(l,t);Fs(l,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new qt(r,this._parents,e,n)}function n5(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},l={value:function(){--i===0&&o()}};n.each(function(){var u=Ht(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),u.on=t}),i===0&&o()})}var r5=0;function qt(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function sy(e){return tr().transition(e)}function ly(){return++r5}var un=tr.prototype;qt.prototype=sy.prototype={constructor:qt,select:N3,selectAll:F3,selectChild:un.selectChild,selectChildren:un.selectChildren,filter:L3,merge:M3,selection:O3,transition:t5,call:un.call,nodes:un.nodes,node:un.node,size:un.size,empty:un.empty,each:un.each,on:I3,attr:g3,attrTween:x3,style:X3,styleTween:H3,text:K3,textTween:e5,remove:B3,tween:s3,delay:S3,duration:A3,ease:P3,easeVarying:C3,end:n5,[Symbol.iterator]:un[Symbol.iterator]};const Ft=e=>+e;function i5(e){return e*e}function o5(e){return e*(2-e)}function uy(e){return((e*=2)<=1?e*e:--e*(2-e)+1)/2}function a5(e){return e*e*e}function s5(e){return--e*e*e+1}function Co(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var df=3,l5=function e(t){t=+t;function n(r){return Math.pow(r,t)}return n.exponent=e,n}(df),u5=function e(t){t=+t;function n(r){return 1-Math.pow(1-r,t)}return n.exponent=e,n}(df),cy=function e(t){t=+t;function n(r){return((r*=2)<=1?Math.pow(r,t):2-Math.pow(2-r,t))/2}return n.exponent=e,n}(df),fy=Math.PI,hy=fy/2;function c5(e){return+e==1?1:1-Math.cos(e*hy)}function f5(e){return Math.sin(e*hy)}function py(e){return(1-Math.cos(fy*e))/2}function kn(e){return(Math.pow(2,-10*e)-.0009765625)*1.0009775171065494}function h5(e){return kn(1-+e)}function p5(e){return 1-kn(e)}function gy(e){return((e*=2)<=1?kn(1-e):2-kn(e-1))/2}function g5(e){return 1-Math.sqrt(1-e*e)}function d5(e){return Math.sqrt(1- --e*e)}function dy(e){return((e*=2)<=1?1-Math.sqrt(1-e*e):Math.sqrt(1-(e-=2)*e)+1)/2}var mf=4/11,m5=6/11,y5=8/11,b5=3/4,x5=9/11,$5=10/11,v5=15/16,S5=21/22,T5=63/64,zs=1/mf/mf;function _5(e){return 1-Lo(1-e)}function Lo(e){return(e=+e)<mf?zs*e*e:e<y5?zs*(e-=m5)*e+b5:e<$5?zs*(e-=x5)*e+v5:zs*(e-=S5)*e+T5}function A5(e){return((e*=2)<=1?1-Lo(1-e):Lo(e-1)+1)/2}var yf=1.70158,w5=function e(t){t=+t;function n(r){return(r=+r)*r*(t*(r-1)+r)}return n.overshoot=e,n}(yf),P5=function e(t){t=+t;function n(r){return--r*r*((r+1)*t+r)+1}return n.overshoot=e,n}(yf),my=function e(t){t=+t;function n(r){return((r*=2)<1?r*r*((t+1)*r-t):(r-=2)*r*((t+1)*r+t)+2)/2}return n.overshoot=e,n}(yf),ii=2*Math.PI,bf=1,xf=.3,D5=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=ii);function i(o){return t*kn(- --o)*Math.sin((r-o)/n)}return i.amplitude=function(o){return e(o,n*ii)},i.period=function(o){return e(t,o)},i}(bf,xf),lr=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=ii);function i(o){return 1-t*kn(o=+o)*Math.sin((o+r)/n)}return i.amplitude=function(o){return e(o,n*ii)},i.period=function(o){return e(t,o)},i}(bf,xf),C5=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=ii);function i(o){return((o=o*2-1)<0?t*kn(-o)*Math.sin((r-o)/n):2-t*kn(o)*Math.sin((r+o)/n))/2}return i.amplitude=function(o){return e(o,n*ii)},i.period=function(o){return e(t,o)},i}(bf,xf),L5={time:null,delay:0,duration:250,ease:Co};function M5(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function k5(e){var t,n;e instanceof qt?(t=e._id,e=e._name):(t=ly(),(n=L5).time=Po(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&Fs(l,e,t,u,a,n||M5(l,t));return new qt(r,this._parents,e,t)}tr.prototype.interrupt=i3,tr.prototype.transition=k5;var R5=[null];function I5(e,t){var n=e.__transition,r,i;if(n){t=t==null?null:t+"";for(i in n)if((r=n[i]).state>cf&&r.name===t)return new qt([[e]],R5,t,+i)}return null}const $f=e=>()=>e;function E5(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function B5(e){e.stopImmediatePropagation()}function vf(e){e.preventDefault(),e.stopImmediatePropagation()}var yy={name:"drag"},Sf={name:"space"},oi={name:"handle"},ai={name:"center"};const{abs:by,max:We,min:Ve}=Math;function xy(e){return[+e[0],+e[1]]}function Tf(e){return[xy(e[0]),xy(e[1])]}var Os={name:"x",handles:["w","e"].map(Mo),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},Gs={name:"y",handles:["n","s"].map(Mo),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},N5={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Mo),input:function(e){return e==null?null:Tf(e)},output:function(e){return e}},cn={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},$y={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},vy={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},F5={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},z5={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Mo(e){return{type:e}}function O5(e){return!e.ctrlKey&&!e.button}function G5(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function W5(){return navigator.maxTouchPoints||"ontouchstart"in this}function _f(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function V5(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function Y5(e){var t=e.__brush;return t?t.dim.output(t.selection):null}function X5(){return Af(Os)}function U5(){return Af(Gs)}function j5(){return Af(N5)}function Af(e){var t=G5,n=O5,r=W5,i=!0,o=Jn("start","brush","end"),a=6,s;function l(g){var y=g.property("__brush",m).selectAll(".overlay").data([Mo("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",cn.overlay).merge(y).each(function(){var x=_f(this).extent;X(this).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1])}),g.selectAll(".selection").data([Mo("selection")]).enter().append("rect").attr("class","selection").attr("cursor",cn.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var b=g.selectAll(".handle").data(e.handles,function(x){return x.type});b.exit().remove(),b.enter().append("rect").attr("class",function(x){return"handle handle--"+x.type}).attr("cursor",function(x){return cn[x.type]}),g.each(u).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",f).filter(r).on("touchstart.brush",f).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(g,y,b){g.tween?g.on("start.brush",function(x){c(this,arguments).beforestart().start(x)}).on("interrupt.brush end.brush",function(x){c(this,arguments).end(x)}).tween("brush",function(){var x=this,$=x.__brush,S=c(x,arguments),_=$.selection,A=e.input(typeof y=="function"?y.apply(this,arguments):y,$.extent),w=ln(_,A);function P(I){$.selection=I===1&&A===null?null:w(I),u.call(x),S.brush()}return _!==null&&A!==null?P:P(1)}):g.each(function(){var x=this,$=arguments,S=x.__brush,_=e.input(typeof y=="function"?y.apply(x,$):y,S.extent),A=c(x,$).beforestart();sr(x),S.selection=_===null?null:_,u.call(x),A.start(b).brush(b).end(b)})},l.clear=function(g,y){l.move(g,null,y)};function u(){var g=X(this),y=_f(this).selection;y?(g.selectAll(".selection").style("display",null).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1]),g.selectAll(".handle").style("display",null).attr("x",function(b){return b.type[b.type.length-1]==="e"?y[1][0]-a/2:y[0][0]-a/2}).attr("y",function(b){return b.type[0]==="s"?y[1][1]-a/2:y[0][1]-a/2}).attr("width",function(b){return b.type==="n"||b.type==="s"?y[1][0]-y[0][0]+a:a}).attr("height",function(b){return b.type==="e"||b.type==="w"?y[1][1]-y[0][1]+a:a})):g.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(g,y,b){var x=g.__brush.emitter;return x&&(!b||!x.clean)?x:new h(g,y,b)}function h(g,y,b){this.that=g,this.args=y,this.state=g.__brush,this.active=0,this.clean=b}h.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(g,y){return this.starting?(this.starting=!1,this.emit("start",g,y)):this.emit("brush",g),this},brush:function(g,y){return this.emit("brush",g,y),this},end:function(g,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",g,y)),this},emit:function(g,y,b){var x=X(this.that).datum();o.call(g,this.that,new E5(g,{sourceEvent:y,target:l,selection:e.output(this.state.selection),mode:b,dispatch:o}),x)}};function f(g){if(s&&!g.touches||!n.apply(this,arguments))return;var y=this,b=g.target.__data__.type,x=(i&&g.metaKey?b="overlay":b)==="selection"?yy:i&&g.altKey?ai:oi,$=e===Gs?null:F5[b],S=e===Os?null:z5[b],_=_f(y),A=_.extent,w=_.selection,P=A[0][0],I,v,N=A[0][1],R,D,T=A[1][0],M,G,k=A[1][1],B,F,E=0,W=0,j,te=$&&S&&i&&g.shiftKey,V,ee,Y=Array.from(g.touches||[g],ue=>{const Ce=ue.identifier;return ue=yt(ue,y),ue.point0=ue.slice(),ue.identifier=Ce,ue});sr(y);var J=c(y,arguments,!0).beforestart();if(b==="overlay"){w&&(j=!0);const ue=[Y[0],Y[1]||Y[0]];_.selection=w=[[I=e===Gs?P:Ve(ue[0][0],ue[1][0]),R=e===Os?N:Ve(ue[0][1],ue[1][1])],[M=e===Gs?T:We(ue[0][0],ue[1][0]),B=e===Os?k:We(ue[0][1],ue[1][1])]],Y.length>1&&ye(g)}else I=w[0][0],R=w[0][1],M=w[1][0],B=w[1][1];v=I,D=R,G=M,F=B;var K=X(y).attr("pointer-events","none"),ie=K.selectAll(".overlay").attr("cursor",cn[b]);if(g.touches)J.moved=Z,J.ended=he;else{var le=X(g.view).on("mousemove.brush",Z,!0).on("mouseup.brush",he,!0);i&&le.on("keydown.brush",Re,!0).on("keyup.brush",st,!0),ys(g.view)}u.call(y),J.start(g,x.name);function Z(ue){for(const Ce of ue.changedTouches||[ue])for(const va of Y)va.identifier===Ce.identifier&&(va.cur=yt(Ce,y));if(te&&!V&&!ee&&Y.length===1){const Ce=Y[0];by(Ce.cur[0]-Ce[0])>by(Ce.cur[1]-Ce[1])?ee=!0:V=!0}for(const Ce of Y)Ce.cur&&(Ce[0]=Ce.cur[0],Ce[1]=Ce.cur[1]);j=!0,vf(ue),ye(ue)}function ye(ue){const Ce=Y[0],va=Ce.point0;var Vn;switch(E=Ce[0]-va[0],W=Ce[1]-va[1],x){case Sf:case yy:{$&&(E=We(P-I,Ve(T-M,E)),v=I+E,G=M+E),S&&(W=We(N-R,Ve(k-B,W)),D=R+W,F=B+W);break}case oi:{Y[1]?($&&(v=We(P,Ve(T,Y[0][0])),G=We(P,Ve(T,Y[1][0])),$=1),S&&(D=We(N,Ve(k,Y[0][1])),F=We(N,Ve(k,Y[1][1])),S=1)):($<0?(E=We(P-I,Ve(T-I,E)),v=I+E,G=M):$>0&&(E=We(P-M,Ve(T-M,E)),v=I,G=M+E),S<0?(W=We(N-R,Ve(k-R,W)),D=R+W,F=B):S>0&&(W=We(N-B,Ve(k-B,W)),D=R,F=B+W));break}case ai:{$&&(v=We(P,Ve(T,I-E*$)),G=We(P,Ve(T,M+E*$))),S&&(D=We(N,Ve(k,R-W*S)),F=We(N,Ve(k,B+W*S)));break}}G<v&&($*=-1,Vn=I,I=M,M=Vn,Vn=v,v=G,G=Vn,b in $y&&ie.attr("cursor",cn[b=$y[b]])),F<D&&(S*=-1,Vn=R,R=B,B=Vn,Vn=D,D=F,F=Vn,b in vy&&ie.attr("cursor",cn[b=vy[b]])),_.selection&&(w=_.selection),V&&(v=w[0][0],G=w[1][0]),ee&&(D=w[0][1],F=w[1][1]),(w[0][0]!==v||w[0][1]!==D||w[1][0]!==G||w[1][1]!==F)&&(_.selection=[[v,D],[G,F]],u.call(y),J.brush(ue,x.name))}function he(ue){if(B5(ue),ue.touches){if(ue.touches.length)return;s&&clearTimeout(s),s=setTimeout(function(){s=null},500)}else bs(ue.view,j),le.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);K.attr("pointer-events","all"),ie.attr("cursor",cn.overlay),_.selection&&(w=_.selection),V5(w)&&(_.selection=null,u.call(y)),J.end(ue,x.name)}function Re(ue){switch(ue.keyCode){case 16:{te=$&&S;break}case 18:{x===oi&&($&&(M=G-E*$,I=v+E*$),S&&(B=F-W*S,R=D+W*S),x=ai,ye(ue));break}case 32:{(x===oi||x===ai)&&($<0?M=G-E:$>0&&(I=v-E),S<0?B=F-W:S>0&&(R=D-W),x=Sf,ie.attr("cursor",cn.selection),ye(ue));break}default:return}vf(ue)}function st(ue){switch(ue.keyCode){case 16:{te&&(V=ee=te=!1,ye(ue));break}case 18:{x===ai&&($<0?M=G:$>0&&(I=v),S<0?B=F:S>0&&(R=D),x=oi,ye(ue));break}case 32:{x===Sf&&(ue.altKey?($&&(M=G-E*$,I=v+E*$),S&&(B=F-W*S,R=D+W*S),x=ai):($<0?M=G:$>0&&(I=v),S<0?B=F:S>0&&(R=D),x=oi),ie.attr("cursor",cn[b]),ye(ue));break}default:return}vf(ue)}}function p(g){c(this,arguments).moved(g)}function d(g){c(this,arguments).ended(g)}function m(){var g=this.__brush||{selection:null};return g.extent=Tf(t.apply(this,arguments)),g.dim=e,g}return l.extent=function(g){return arguments.length?(t=typeof g=="function"?g:$f(Tf(g)),l):t},l.filter=function(g){return arguments.length?(n=typeof g=="function"?g:$f(!!g),l):n},l.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:$f(!!g),l):r},l.handleSize=function(g){return arguments.length?(a=+g,l):a},l.keyModifiers=function(g){return arguments.length?(i=!!g,l):i},l.on=function(){var g=o.on.apply(o,arguments);return g===o?l:g},l}var Sy=Math.abs,si=Math.cos,li=Math.sin,Ty=Math.PI,Ws=Ty/2,_y=Ty*2,Ay=Math.max,wf=1e-12;function Pf(e,t){return Array.from({length:t-e},(n,r)=>e+r)}function H5(e){return function(t,n){return e(t.source.value+t.target.value,n.source.value+n.target.value)}}function q5(){return Df(!1,!1)}function Z5(){return Df(!1,!0)}function K5(){return Df(!0,!1)}function Df(e,t){var n=0,r=null,i=null,o=null;function a(s){var l=s.length,u=new Array(l),c=Pf(0,l),h=new Array(l*l),f=new Array(l),p=0,d;s=Float64Array.from({length:l*l},t?(m,g)=>s[g%l][g/l|0]:(m,g)=>s[g/l|0][g%l]);for(let m=0;m<l;++m){let g=0;for(let y=0;y<l;++y)g+=s[m*l+y]+e*s[y*l+m];p+=u[m]=g}p=Ay(0,_y-n*l)/p,d=p?n:_y/l;{let m=0;r&&c.sort((g,y)=>r(u[g],u[y]));for(const g of c){const y=m;if(e){const b=Pf(~l+1,l).filter(x=>x<0?s[~x*l+g]:s[g*l+x]);i&&b.sort((x,$)=>i(x<0?-s[~x*l+g]:s[g*l+x],$<0?-s[~$*l+g]:s[g*l+$]));for(const x of b)if(x<0){const $=h[~x*l+g]||(h[~x*l+g]={source:null,target:null});$.target={index:g,startAngle:m,endAngle:m+=s[~x*l+g]*p,value:s[~x*l+g]}}else{const $=h[g*l+x]||(h[g*l+x]={source:null,target:null});$.source={index:g,startAngle:m,endAngle:m+=s[g*l+x]*p,value:s[g*l+x]}}f[g]={index:g,startAngle:y,endAngle:m,value:u[g]}}else{const b=Pf(0,l).filter(x=>s[g*l+x]||s[x*l+g]);i&&b.sort((x,$)=>i(s[g*l+x],s[g*l+$]));for(const x of b){let $;if(g<x?($=h[g*l+x]||(h[g*l+x]={source:null,target:null}),$.source={index:g,startAngle:m,endAngle:m+=s[g*l+x]*p,value:s[g*l+x]}):($=h[x*l+g]||(h[x*l+g]={source:null,target:null}),$.target={index:g,startAngle:m,endAngle:m+=s[g*l+x]*p,value:s[g*l+x]},g===x&&($.source=$.target)),$.source&&$.target&&$.source.value<$.target.value){const S=$.source;$.source=$.target,$.target=S}}f[g]={index:g,startAngle:y,endAngle:m,value:u[g]}}m+=d}}return h=Object.values(h),h.groups=f,o?h.sort(o):h}return a.padAngle=function(s){return arguments.length?(n=Ay(0,s),a):n},a.sortGroups=function(s){return arguments.length?(r=s,a):r},a.sortSubgroups=function(s){return arguments.length?(i=s,a):i},a.sortChords=function(s){return arguments.length?(s==null?o=null:(o=H5(s))._=s,a):o&&o._},a}const Cf=Math.PI,Lf=2*Cf,ur=1e-6,Q5=Lf-ur;function wy(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function J5(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return wy;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let ko=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?wy:J5(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,l=r-t,u=i-n,c=a-t,h=s-n,f=c*c+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(f>ur)if(!(Math.abs(h*l-u*c)>ur)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-a,d=i-s,m=l*l+u*u,g=p*p+d*d,y=Math.sqrt(m),b=Math.sqrt(f),x=o*Math.tan((Cf-Math.acos((m+f-g)/(2*y*b)))/2),$=x/b,S=x/y;Math.abs($-1)>ur&&this._append`L${t+$*c},${n+$*h}`,this._append`A${o},${o},0,0,${+(h*p>c*d)},${this._x1=t+S*l},${this._y1=n+S*u}`}}arc(t,n,r,i,o,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),u=t+s,c=n+l,h=1^a,f=a?i-o:o-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>ur||Math.abs(this._y1-c)>ur)&&this._append`L${u},${c}`,r&&(f<0&&(f=f%Lf+Lf),f>Q5?this._append`A${r},${r},0,1,${h},${t-s},${n-l}A${r},${r},0,1,${h},${this._x1=u},${this._y1=c}`:f>ur&&this._append`A${r},${r},0,${+(f>=Cf)},${h},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function Mf(){return new ko}Mf.prototype=ko.prototype;function e6(e=3){return new ko(+e)}var t6=Array.prototype.slice;function cr(e){return function(){return e}}function n6(e){return e.source}function r6(e){return e.target}function Py(e){return e.radius}function i6(e){return e.startAngle}function o6(e){return e.endAngle}function a6(){return 0}function s6(){return 10}function Dy(e){var t=n6,n=r6,r=Py,i=Py,o=i6,a=o6,s=a6,l=null;function u(){var c,h=t.apply(this,arguments),f=n.apply(this,arguments),p=s.apply(this,arguments)/2,d=t6.call(arguments),m=+r.apply(this,(d[0]=h,d)),g=o.apply(this,d)-Ws,y=a.apply(this,d)-Ws,b=+i.apply(this,(d[0]=f,d)),x=o.apply(this,d)-Ws,$=a.apply(this,d)-Ws;if(l||(l=c=Mf()),p>wf&&(Sy(y-g)>p*2+wf?y>g?(g+=p,y-=p):(g-=p,y+=p):g=y=(g+y)/2,Sy($-x)>p*2+wf?$>x?(x+=p,$-=p):(x-=p,$+=p):x=$=(x+$)/2),l.moveTo(m*si(g),m*li(g)),l.arc(0,0,m,g,y),g!==x||y!==$)if(e){var S=+e.apply(this,arguments),_=b-S,A=(x+$)/2;l.quadraticCurveTo(0,0,_*si(x),_*li(x)),l.lineTo(b*si(A),b*li(A)),l.lineTo(_*si($),_*li($))}else l.quadraticCurveTo(0,0,b*si(x),b*li(x)),l.arc(0,0,b,x,$);if(l.quadraticCurveTo(0,0,m*si(g),m*li(g)),l.closePath(),c)return l=null,c+""||null}return e&&(u.headRadius=function(c){return arguments.length?(e=typeof c=="function"?c:cr(+c),u):e}),u.radius=function(c){return arguments.length?(r=i=typeof c=="function"?c:cr(+c),u):r},u.sourceRadius=function(c){return arguments.length?(r=typeof c=="function"?c:cr(+c),u):r},u.targetRadius=function(c){return arguments.length?(i=typeof c=="function"?c:cr(+c),u):i},u.startAngle=function(c){return arguments.length?(o=typeof c=="function"?c:cr(+c),u):o},u.endAngle=function(c){return arguments.length?(a=typeof c=="function"?c:cr(+c),u):a},u.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:cr(+c),u):s},u.source=function(c){return arguments.length?(t=c,u):t},u.target=function(c){return arguments.length?(n=c,u):n},u.context=function(c){return arguments.length?(l=c??null,u):l},u}function l6(){return Dy()}function u6(){return Dy(s6)}var c6=Array.prototype,Cy=c6.slice;function f6(e,t){return e-t}function h6(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)r+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return r}const Rn=e=>()=>e;function p6(e,t){for(var n=-1,r=t.length,i;++n<r;)if(i=g6(e,t[n]))return i;return 0}function g6(e,t){for(var n=t[0],r=t[1],i=-1,o=0,a=e.length,s=a-1;o<a;s=o++){var l=e[o],u=l[0],c=l[1],h=e[s],f=h[0],p=h[1];if(d6(l,h,t))return 0;c>r!=p>r&&n<(f-u)*(r-c)/(p-c)+u&&(i=-i)}return i}function d6(e,t,n){var r;return m6(e,t,n)&&y6(e[r=+(e[0]===t[0])],n[r],t[r])}function m6(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function y6(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function b6(){}var fn=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function kf(){var e=1,t=1,n=Mc,r=l;function i(u){var c=n(u);if(Array.isArray(c))c=c.slice().sort(f6);else{const h=lo(u,x6);for(c=Kn(...Lc(h[0],h[1],c),c);c[c.length-1]>=h[1];)c.pop();for(;c[1]<h[0];)c.shift()}return c.map(h=>o(u,h))}function o(u,c){const h=c==null?NaN:+c;if(isNaN(h))throw new Error(`invalid value: ${c}`);var f=[],p=[];return a(u,h,function(d){r(d,u,h),h6(d)>0?f.push([d]):p.push(d)}),p.forEach(function(d){for(var m=0,g=f.length,y;m<g;++m)if(p6((y=f[m])[0],d)!==-1){y.push(d);return}}),{type:"MultiPolygon",value:c,coordinates:f}}function a(u,c,h){var f=new Array,p=new Array,d,m,g,y,b,x;for(d=m=-1,y=fr(u[0],c),fn[y<<1].forEach($);++d<e-1;)g=y,y=fr(u[d+1],c),fn[g|y<<1].forEach($);for(fn[y<<0].forEach($);++m<t-1;){for(d=-1,y=fr(u[m*e+e],c),b=fr(u[m*e],c),fn[y<<1|b<<2].forEach($);++d<e-1;)g=y,y=fr(u[m*e+e+d+1],c),x=b,b=fr(u[m*e+d+1],c),fn[g|y<<1|b<<2|x<<3].forEach($);fn[y|b<<3].forEach($)}for(d=-1,b=u[m*e]>=c,fn[b<<2].forEach($);++d<e-1;)x=b,b=fr(u[m*e+d+1],c),fn[b<<2|x<<3].forEach($);fn[b<<3].forEach($);function $(S){var _=[S[0][0]+d,S[0][1]+m],A=[S[1][0]+d,S[1][1]+m],w=s(_),P=s(A),I,v;(I=p[w])?(v=f[P])?(delete p[I.end],delete f[v.start],I===v?(I.ring.push(A),h(I.ring)):f[I.start]=p[v.end]={start:I.start,end:v.end,ring:I.ring.concat(v.ring)}):(delete p[I.end],I.ring.push(A),p[I.end=P]=I):(I=f[P])?(v=p[w])?(delete f[I.start],delete p[v.end],I===v?(I.ring.push(A),h(I.ring)):f[v.start]=p[I.end]={start:v.start,end:I.end,ring:v.ring.concat(I.ring)}):(delete f[I.start],I.ring.unshift(_),f[I.start=w]=I):f[w]=p[P]={start:w,end:P,ring:[_,A]}}}function s(u){return u[0]*2+u[1]*(e+1)*4}function l(u,c,h){u.forEach(function(f){var p=f[0],d=f[1],m=p|0,g=d|0,y=Rf(c[g*e+m]);p>0&&p<e&&m===p&&(f[0]=Ly(p,Rf(c[g*e+m-1]),y,h)),d>0&&d<t&&g===d&&(f[1]=Ly(d,Rf(c[(g-1)*e+m]),y,h))})}return i.contour=o,i.size=function(u){if(!arguments.length)return[e,t];var c=Math.floor(u[0]),h=Math.floor(u[1]);if(!(c>=0&&h>=0))throw new Error("invalid size");return e=c,t=h,i},i.thresholds=function(u){return arguments.length?(n=typeof u=="function"?u:Array.isArray(u)?Rn(Cy.call(u)):Rn(u),i):n},i.smooth=function(u){return arguments.length?(r=u?l:b6,i):r===l},i}function x6(e){return isFinite(e)?e:NaN}function fr(e,t){return e==null?!1:+e>=t}function Rf(e){return e==null||isNaN(e=+e)?-1/0:e}function Ly(e,t,n,r){const i=r-t,o=n-t,a=isFinite(i)||isFinite(o)?i/o:Math.sign(i)/Math.sign(o);return isNaN(a)?e:e+a-.5}function $6(e){return e[0]}function v6(e){return e[1]}function S6(){return 1}function T6(){var e=$6,t=v6,n=S6,r=960,i=500,o=20,a=2,s=o*3,l=r+s*2>>a,u=i+s*2>>a,c=Rn(20);function h(b){var x=new Float32Array(l*u),$=Math.pow(2,-a),S=-1;for(const R of b){var _=(e(R,++S,b)+s)*$,A=(t(R,S,b)+s)*$,w=+n(R,S,b);if(w&&_>=0&&_<l&&A>=0&&A<u){var P=Math.floor(_),I=Math.floor(A),v=_-P-.5,N=A-I-.5;x[P+I*l]+=(1-v)*(1-N)*w,x[P+1+I*l]+=v*(1-N)*w,x[P+1+(I+1)*l]+=v*N*w,x[P+(I+1)*l]+=(1-v)*N*w}}return Pm({data:x,width:l,height:u},o*$),x}function f(b){var x=h(b),$=c(x),S=Math.pow(2,2*a);return Array.isArray($)||($=Kn(Number.MIN_VALUE,co(x)/S,$)),kf().size([l,u]).thresholds($.map(_=>_*S))(x).map((_,A)=>(_.value=+$[A],p(_)))}f.contours=function(b){var x=h(b),$=kf().size([l,u]),S=Math.pow(2,2*a),_=A=>{A=+A;var w=p($.contour(x,A*S));return w.value=A,w};return Object.defineProperty(_,"max",{get:()=>co(x)/S}),_};function p(b){return b.coordinates.forEach(d),b}function d(b){b.forEach(m)}function m(b){b.forEach(g)}function g(b){b[0]=b[0]*Math.pow(2,a)-s,b[1]=b[1]*Math.pow(2,a)-s}function y(){return s=o*3,l=r+s*2>>a,u=i+s*2>>a,f}return f.x=function(b){return arguments.length?(e=typeof b=="function"?b:Rn(+b),f):e},f.y=function(b){return arguments.length?(t=typeof b=="function"?b:Rn(+b),f):t},f.weight=function(b){return arguments.length?(n=typeof b=="function"?b:Rn(+b),f):n},f.size=function(b){if(!arguments.length)return[r,i];var x=+b[0],$=+b[1];if(!(x>=0&&$>=0))throw new Error("invalid size");return r=x,i=$,y()},f.cellSize=function(b){if(!arguments.length)return 1<<a;if(!((b=+b)>=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(b)/Math.LN2),y()},f.thresholds=function(b){return arguments.length?(c=typeof b=="function"?b:Array.isArray(b)?Rn(Cy.call(b)):Rn(b),f):c},f.bandwidth=function(b){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((b=+b)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*b*b+1)-1)/2,y()},f}const hn=11102230246251565e-32,Ye=134217729,_6=(3+8*hn)*hn;function If(e,t,n,r,i){let o,a,s,l,u=t[0],c=r[0],h=0,f=0;c>u==c>-u?(o=u,u=t[++h]):(o=c,c=r[++f]);let p=0;if(h<e&&f<n)for(c>u==c>-u?(a=u+o,s=o-(a-u),u=t[++h]):(a=c+o,s=o-(a-c),c=r[++f]),o=a,s!==0&&(i[p++]=s);h<e&&f<n;)c>u==c>-u?(a=o+u,l=a-o,s=o-(a-l)+(u-l),u=t[++h]):(a=o+c,l=a-o,s=o-(a-l)+(c-l),c=r[++f]),o=a,s!==0&&(i[p++]=s);for(;h<e;)a=o+u,l=a-o,s=o-(a-l)+(u-l),u=t[++h],o=a,s!==0&&(i[p++]=s);for(;f<n;)a=o+c,l=a-o,s=o-(a-l)+(c-l),c=r[++f],o=a,s!==0&&(i[p++]=s);return(o!==0||p===0)&&(i[p++]=o),p}function A6(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function Ro(e){return new Float64Array(e)}const w6=(3+16*hn)*hn,P6=(2+12*hn)*hn,D6=(9+64*hn)*hn*hn,ui=Ro(4),My=Ro(8),ky=Ro(12),Ry=Ro(16),Ze=Ro(4);function C6(e,t,n,r,i,o,a){let s,l,u,c,h,f,p,d,m,g,y,b,x,$,S,_,A,w;const P=e-i,I=n-i,v=t-o,N=r-o;$=P*N,f=Ye*P,p=f-(f-P),d=P-p,f=Ye*N,m=f-(f-N),g=N-m,S=d*g-($-p*m-d*m-p*g),_=v*I,f=Ye*v,p=f-(f-v),d=v-p,f=Ye*I,m=f-(f-I),g=I-m,A=d*g-(_-p*m-d*m-p*g),y=S-A,h=S-y,ui[0]=S-(y+h)+(h-A),b=$+y,h=b-$,x=$-(b-h)+(y-h),y=x-_,h=x-y,ui[1]=x-(y+h)+(h-_),w=b+y,h=w-b,ui[2]=b-(w-h)+(y-h),ui[3]=w;let R=A6(4,ui),D=P6*a;if(R>=D||-R>=D||(h=e-P,s=e-(P+h)+(h-i),h=n-I,u=n-(I+h)+(h-i),h=t-v,l=t-(v+h)+(h-o),h=r-N,c=r-(N+h)+(h-o),s===0&&l===0&&u===0&&c===0)||(D=D6*a+_6*Math.abs(R),R+=P*c+N*s-(v*u+I*l),R>=D||-R>=D))return R;$=s*N,f=Ye*s,p=f-(f-s),d=s-p,f=Ye*N,m=f-(f-N),g=N-m,S=d*g-($-p*m-d*m-p*g),_=l*I,f=Ye*l,p=f-(f-l),d=l-p,f=Ye*I,m=f-(f-I),g=I-m,A=d*g-(_-p*m-d*m-p*g),y=S-A,h=S-y,Ze[0]=S-(y+h)+(h-A),b=$+y,h=b-$,x=$-(b-h)+(y-h),y=x-_,h=x-y,Ze[1]=x-(y+h)+(h-_),w=b+y,h=w-b,Ze[2]=b-(w-h)+(y-h),Ze[3]=w;const T=If(4,ui,4,Ze,My);$=P*c,f=Ye*P,p=f-(f-P),d=P-p,f=Ye*c,m=f-(f-c),g=c-m,S=d*g-($-p*m-d*m-p*g),_=v*u,f=Ye*v,p=f-(f-v),d=v-p,f=Ye*u,m=f-(f-u),g=u-m,A=d*g-(_-p*m-d*m-p*g),y=S-A,h=S-y,Ze[0]=S-(y+h)+(h-A),b=$+y,h=b-$,x=$-(b-h)+(y-h),y=x-_,h=x-y,Ze[1]=x-(y+h)+(h-_),w=b+y,h=w-b,Ze[2]=b-(w-h)+(y-h),Ze[3]=w;const M=If(T,My,4,Ze,ky);$=s*c,f=Ye*s,p=f-(f-s),d=s-p,f=Ye*c,m=f-(f-c),g=c-m,S=d*g-($-p*m-d*m-p*g),_=l*u,f=Ye*l,p=f-(f-l),d=l-p,f=Ye*u,m=f-(f-u),g=u-m,A=d*g-(_-p*m-d*m-p*g),y=S-A,h=S-y,Ze[0]=S-(y+h)+(h-A),b=$+y,h=b-$,x=$-(b-h)+(y-h),y=x-_,h=x-y,Ze[1]=x-(y+h)+(h-_),w=b+y,h=w-b,Ze[2]=b-(w-h)+(y-h),Ze[3]=w;const G=If(M,ky,4,Ze,Ry);return Ry[G-1]}function Vs(e,t,n,r,i,o){const a=(t-o)*(n-i),s=(e-i)*(r-o),l=a-s,u=Math.abs(a+s);return Math.abs(l)>=w6*u?l:-C6(e,t,n,r,i,o,u)}const Iy=Math.pow(2,-52),Ys=new Uint32Array(512);class Xs{static from(t,n=I6,r=E6){const i=t.length,o=new Float64Array(i*2);for(let a=0;a<i;a++){const s=t[a];o[2*a]=n(s),o[2*a+1]=r(s)}return new Xs(o)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,a=t.length>>1;let s=1/0,l=1/0,u=-1/0,c=-1/0;for(let P=0;P<a;P++){const I=t[2*P],v=t[2*P+1];I<s&&(s=I),v<l&&(l=v),I>u&&(u=I),v>c&&(c=v),this._ids[P]=P}const h=(s+u)/2,f=(l+c)/2;let p,d,m;for(let P=0,I=1/0;P<a;P++){const v=Ef(h,f,t[2*P],t[2*P+1]);v<I&&(p=P,I=v)}const g=t[2*p],y=t[2*p+1];for(let P=0,I=1/0;P<a;P++){if(P===p)continue;const v=Ef(g,y,t[2*P],t[2*P+1]);v<I&&v>0&&(d=P,I=v)}let b=t[2*d],x=t[2*d+1],$=1/0;for(let P=0;P<a;P++){if(P===p||P===d)continue;const I=k6(g,y,b,x,t[2*P],t[2*P+1]);I<$&&(m=P,$=I)}let S=t[2*m],_=t[2*m+1];if($===1/0){for(let v=0;v<a;v++)this._dists[v]=t[2*v]-t[0]||t[2*v+1]-t[1];ci(this._ids,this._dists,0,a-1);const P=new Uint32Array(a);let I=0;for(let v=0,N=-1/0;v<a;v++){const R=this._ids[v],D=this._dists[R];D>N&&(P[I++]=R,N=D)}this.hull=P.subarray(0,I),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Vs(g,y,b,x,S,_)<0){const P=d,I=b,v=x;d=m,b=S,x=_,m=P,S=I,_=v}const A=R6(g,y,b,x,S,_);this._cx=A.x,this._cy=A.y;for(let P=0;P<a;P++)this._dists[P]=Ef(t[2*P],t[2*P+1],A.x,A.y);ci(this._ids,this._dists,0,a-1),this._hullStart=p;let w=3;r[p]=n[m]=d,r[d]=n[p]=m,r[m]=n[d]=p,i[p]=0,i[d]=1,i[m]=2,o.fill(-1),o[this._hashKey(g,y)]=p,o[this._hashKey(b,x)]=d,o[this._hashKey(S,_)]=m,this.trianglesLen=0,this._addTriangle(p,d,m,-1,-1,-1);for(let P=0,I,v;P<this._ids.length;P++){const N=this._ids[P],R=t[2*N],D=t[2*N+1];if(P>0&&Math.abs(R-I)<=Iy&&Math.abs(D-v)<=Iy||(I=R,v=D,N===p||N===d||N===m))continue;let T=0;for(let F=0,E=this._hashKey(R,D);F<this._hashSize&&(T=o[(E+F)%this._hashSize],!(T!==-1&&T!==r[T]));F++);T=n[T];let M=T,G;for(;G=r[M],Vs(R,D,t[2*M],t[2*M+1],t[2*G],t[2*G+1])>=0;)if(M=G,M===T){M=-1;break}if(M===-1)continue;let k=this._addTriangle(M,N,r[M],-1,-1,i[M]);i[N]=this._legalize(k+2),i[M]=k,w++;let B=r[M];for(;G=r[B],Vs(R,D,t[2*B],t[2*B+1],t[2*G],t[2*G+1])<0;)k=this._addTriangle(B,N,G,i[N],-1,i[B]),i[N]=this._legalize(k+2),r[B]=B,w--,B=G;if(M===T)for(;G=n[M],Vs(R,D,t[2*G],t[2*G+1],t[2*M],t[2*M+1])<0;)k=this._addTriangle(G,N,M,-1,i[M],i[G]),this._legalize(k+2),i[G]=k,r[M]=M,w--,M=G;this._hullStart=n[N]=M,r[M]=n[B]=N,r[N]=B,o[this._hashKey(R,D)]=N,o[this._hashKey(t[2*M],t[2*M+1])]=M}this.hull=new Uint32Array(w);for(let P=0,I=this._hullStart;P<w;P++)this.hull[P]=I,I=r[I];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(L6(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:r,coords:i}=this;let o=0,a=0;for(;;){const s=r[t],l=t-t%3;if(a=l+(t+2)%3,s===-1){if(o===0)break;t=Ys[--o];continue}const u=s-s%3,c=l+(t+1)%3,h=u+(s+2)%3,f=n[a],p=n[t],d=n[c],m=n[h];if(M6(i[2*f],i[2*f+1],i[2*p],i[2*p+1],i[2*d],i[2*d+1],i[2*m],i[2*m+1])){n[t]=m,n[s]=f;const y=r[h];if(y===-1){let x=this._hullStart;do{if(this._hullTri[x]===h){this._hullTri[x]=t;break}x=this._hullPrev[x]}while(x!==this._hullStart)}this._link(t,y),this._link(s,r[a]),this._link(a,h);const b=u+(s+1)%3;o<Ys.length&&(Ys[o++]=b)}else{if(o===0)break;t=Ys[--o]}}return a}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,r,i,o,a){const s=this.trianglesLen;return this._triangles[s]=t,this._triangles[s+1]=n,this._triangles[s+2]=r,this._link(s,i),this._link(s+1,o),this._link(s+2,a),this.trianglesLen+=3,s}}function L6(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function Ef(e,t,n,r){const i=e-n,o=t-r;return i*i+o*o}function M6(e,t,n,r,i,o,a,s){const l=e-a,u=t-s,c=n-a,h=r-s,f=i-a,p=o-s,d=l*l+u*u,m=c*c+h*h,g=f*f+p*p;return l*(h*g-m*p)-u*(c*g-m*f)+d*(c*p-h*f)<0}function k6(e,t,n,r,i,o){const a=n-e,s=r-t,l=i-e,u=o-t,c=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l),p=(u*c-s*h)*f,d=(a*h-l*c)*f;return p*p+d*d}function R6(e,t,n,r,i,o){const a=n-e,s=r-t,l=i-e,u=o-t,c=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l),p=e+(u*c-s*h)*f,d=t+(a*h-l*c)*f;return{x:p,y:d}}function ci(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const o=e[i],a=t[o];let s=i-1;for(;s>=n&&t[e[s]]>a;)e[s+1]=e[s--];e[s+1]=o}else{const i=n+r>>1;let o=n+1,a=r;Io(e,i,o),t[e[n]]>t[e[r]]&&Io(e,n,r),t[e[o]]>t[e[r]]&&Io(e,o,r),t[e[n]]>t[e[o]]&&Io(e,n,o);const s=e[o],l=t[s];for(;;){do o++;while(t[e[o]]<l);do a--;while(t[e[a]]>l);if(a<o)break;Io(e,o,a)}e[n+1]=e[a],e[a]=s,r-o+1>=a-n?(ci(e,t,o,r),ci(e,t,n,a-1)):(ci(e,t,n,a-1),ci(e,t,o,r))}}function Io(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function I6(e){return e[0]}function E6(e){return e[1]}const Ey=1e-6;class hr{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,r){t=+t,n=+n,r=+r;const i=t+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>Ey||Math.abs(this._y1-o)>Ey)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${t-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(t,n,r,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class Bf{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}class By{constructor(t,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:r},vectors:i}=this;let o,a;const s=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let m=0,g=0,y=r.length,b,x;m<y;m+=3,g+=2){const $=r[m]*2,S=r[m+1]*2,_=r[m+2]*2,A=t[$],w=t[$+1],P=t[S],I=t[S+1],v=t[_],N=t[_+1],R=P-A,D=I-w,T=v-A,M=N-w,G=(R*M-D*T)*2;if(Math.abs(G)<1e-9){if(o===void 0){o=a=0;for(const B of n)o+=t[B*2],a+=t[B*2+1];o/=n.length,a/=n.length}const k=1e9*Math.sign((o-A)*M-(a-w)*T);b=(A+v)/2-k*M,x=(w+N)/2+k*T}else{const k=1/G,B=R*R+D*D,F=T*T+M*M;b=A+(M*B-D*F)*k,x=w+(R*F-T*B)*k}s[g]=b,s[g+1]=x}let l=n[n.length-1],u,c=l*4,h,f=t[2*l],p,d=t[2*l+1];i.fill(0);for(let m=0;m<n.length;++m)l=n[m],u=c,h=f,p=d,c=l*4,f=t[2*l],d=t[2*l+1],i[u+2]=i[c]=p-d,i[u+3]=i[c+1]=f-h}render(t){const n=t==null?t=new hr:void 0,{delaunay:{halfedges:r,inedges:i,hull:o},circumcenters:a,vectors:s}=this;if(o.length<=1)return null;for(let c=0,h=r.length;c<h;++c){const f=r[c];if(f<c)continue;const p=Math.floor(c/3)*2,d=Math.floor(f/3)*2,m=a[p],g=a[p+1],y=a[d],b=a[d+1];this._renderSegment(m,g,y,b,t)}let l,u=o[o.length-1];for(let c=0;c<o.length;++c){l=u,u=o[c];const h=Math.floor(i[u]/3)*2,f=a[h],p=a[h+1],d=l*4,m=this._project(f,p,s[d+2],s[d+3]);m&&this._renderSegment(f,p,m[0],m[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new hr:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const r=n==null?n=new hr:void 0,i=this._clip(t);if(i===null||!i.length)return;n.moveTo(i[0],i[1]);let o=i.length;for(;i[0]===i[o-2]&&i[1]===i[o-1]&&o>1;)o-=2;for(let a=2;a<o;a+=2)(i[a]!==i[a-2]||i[a+1]!==i[a-1])&&n.lineTo(i[a],i[a+1]);return n.closePath(),r&&r.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,r=t.length/2;n<r;++n){const i=this.cellPolygon(n);i&&(i.index=n,yield i)}}cellPolygon(t){const n=new Bf;return this.renderCell(t,n),n.value()}_renderSegment(t,n,r,i,o){let a;const s=this._regioncode(t,n),l=this._regioncode(r,i);s===0&&l===0?(o.moveTo(t,n),o.lineTo(r,i)):(a=this._clipSegment(t,n,r,i,s,l))&&(o.moveTo(a[0],a[1]),o.lineTo(a[2],a[3]))}contains(t,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(t,n,r)===t}*neighbors(t){const n=this._clip(t);if(n)for(const r of this.delaunay.neighbors(t)){const i=this._clip(r);if(i){e:for(let o=0,a=n.length;o<a;o+=2)for(let s=0,l=i.length;s<l;s+=2)if(n[o]===i[s]&&n[o+1]===i[s+1]&&n[(o+2)%a]===i[(s+l-2)%l]&&n[(o+3)%a]===i[(s+l-1)%l]){yield r;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:o}}=this,a=r[t];if(a===-1)return null;const s=[];let l=a;do{const u=Math.floor(l/3);if(s.push(n[u*2],n[u*2+1]),l=l%3===2?l-2:l+1,o[l]!==t)break;l=i[l]}while(l!==a&&l!==-1);return s}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:r}=this,i=t*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(t,n,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(t,n))}_clipFinite(t,n){const r=n.length;let i=null,o,a,s=n[r-2],l=n[r-1],u,c=this._regioncode(s,l),h,f=0;for(let p=0;p<r;p+=2)if(o=s,a=l,s=n[p],l=n[p+1],u=c,c=this._regioncode(s,l),u===0&&c===0)h=f,f=0,i?i.push(s,l):i=[s,l];else{let d,m,g,y,b;if(u===0){if((d=this._clipSegment(o,a,s,l,u,c))===null)continue;[m,g,y,b]=d}else{if((d=this._clipSegment(s,l,o,a,c,u))===null)continue;[y,b,m,g]=d,h=f,f=this._edgecode(m,g),h&&f&&this._edge(t,h,f,i,i.length),i?i.push(m,g):i=[m,g]}h=f,f=this._edgecode(y,b),h&&f&&this._edge(t,h,f,i,i.length),i?i.push(y,b):i=[y,b]}if(i)h=f,f=this._edgecode(i[0],i[1]),h&&f&&this._edge(t,h,f,i,i.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return i}_clipSegment(t,n,r,i,o,a){const s=o<a;for(s&&([t,n,r,i,o,a]=[r,i,t,n,a,o]);;){if(o===0&&a===0)return s?[r,i,t,n]:[t,n,r,i];if(o&a)return null;let l,u,c=o||a;c&8?(l=t+(r-t)*(this.ymax-n)/(i-n),u=this.ymax):c&4?(l=t+(r-t)*(this.ymin-n)/(i-n),u=this.ymin):c&2?(u=n+(i-n)*(this.xmax-t)/(r-t),l=this.xmax):(u=n+(i-n)*(this.xmin-t)/(r-t),l=this.xmin),o?(t=l,n=u,o=this._regioncode(t,n)):(r=l,i=u,a=this._regioncode(r,i))}}_clipInfinite(t,n,r,i,o,a){let s=Array.from(n),l;if((l=this._project(s[0],s[1],r,i))&&s.unshift(l[0],l[1]),(l=this._project(s[s.length-2],s[s.length-1],o,a))&&s.push(l[0],l[1]),s=this._clipFinite(t,s))for(let u=0,c=s.length,h,f=this._edgecode(s[c-2],s[c-1]);u<c;u+=2)h=f,f=this._edgecode(s[u],s[u+1]),h&&f&&(u=this._edge(t,h,f,s,u),c=s.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(t,n,r,i,o){for(;n!==r;){let a,s;switch(n){case 5:n=4;continue;case 4:n=6,a=this.xmax,s=this.ymin;break;case 6:n=2;continue;case 2:n=10,a=this.xmax,s=this.ymax;break;case 10:n=8;continue;case 8:n=9,a=this.xmin,s=this.ymax;break;case 9:n=1;continue;case 1:n=5,a=this.xmin,s=this.ymin;break}(i[o]!==a||i[o+1]!==s)&&this.contains(t,a,s)&&(i.splice(o,0,a,s),o+=2)}return o}_project(t,n,r,i){let o=1/0,a,s,l;if(i<0){if(n<=this.ymin)return null;(a=(this.ymin-n)/i)<o&&(l=this.ymin,s=t+(o=a)*r)}else if(i>0){if(n>=this.ymax)return null;(a=(this.ymax-n)/i)<o&&(l=this.ymax,s=t+(o=a)*r)}if(r>0){if(t>=this.xmax)return null;(a=(this.xmax-t)/r)<o&&(s=this.xmax,l=n+(o=a)*i)}else if(r<0){if(t<=this.xmin)return null;(a=(this.xmin-t)/r)<o&&(s=this.xmin,l=n+(o=a)*i)}return[s,l]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const r=(n+2)%t.length,i=(n+4)%t.length;(t[n]===t[r]&&t[r]===t[i]||t[n+1]===t[r+1]&&t[r+1]===t[i+1])&&(t.splice(r,2),n-=2)}t.length||(t=null)}return t}}const B6=2*Math.PI,fi=Math.pow;function N6(e){return e[0]}function F6(e){return e[1]}function z6(e){const{triangles:t,coords:n}=e;for(let r=0;r<t.length;r+=3){const i=2*t[r],o=2*t[r+1],a=2*t[r+2];if((n[a]-n[i])*(n[o+1]-n[i+1])-(n[o]-n[i])*(n[a+1]-n[i+1])>1e-10)return!1}return!0}function O6(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class Nf{static from(t,n=N6,r=F6,i){return new Nf("length"in t?G6(t,n,r,i):Float64Array.from(W6(t,n,r,i)))}constructor(t){this._delaunator=new Xs(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&z6(t)){this.collinear=Int32Array.from({length:n.length/2},(f,p)=>p).sort((f,p)=>n[2*f]-n[2*p]||n[2*f+1]-n[2*p+1]);const l=this.collinear[0],u=this.collinear[this.collinear.length-1],c=[n[2*l],n[2*l+1],n[2*u],n[2*u+1]],h=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let f=0,p=n.length/2;f<p;++f){const d=O6(n[2*f],n[2*f+1],h);n[2*f]=d[0],n[2*f+1]=d[1]}this._delaunator=new Xs(n)}else delete this.collinear;const r=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,a=this.inedges.fill(-1),s=this._hullIndex.fill(-1);for(let l=0,u=r.length;l<u;++l){const c=o[l%3===2?l-2:l+1];(r[l]===-1||a[c]===-1)&&(a[c]=l)}for(let l=0,u=i.length;l<u;++l)s[i[l]]=l;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],a[i[0]]=1,i.length===2&&(a[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new By(this,t)}*neighbors(t){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:a,collinear:s}=this;if(s){const h=s.indexOf(t);h>0&&(yield s[h-1]),h<s.length-1&&(yield s[h+1]);return}const l=n[t];if(l===-1)return;let u=l,c=-1;do{if(yield c=a[u],u=u%3===2?u-2:u+1,a[u]!==t)return;if(u=o[u],u===-1){const h=r[(i[t]+1)%r.length];h!==c&&(yield h);return}}while(u!==l)}find(t,n,r=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const i=r;let o;for(;(o=this._step(r,t,n))>=0&&o!==r&&o!==i;)r=o;return o}_step(t,n,r){const{inedges:i,hull:o,_hullIndex:a,halfedges:s,triangles:l,points:u}=this;if(i[t]===-1||!u.length)return(t+1)%(u.length>>1);let c=t,h=fi(n-u[t*2],2)+fi(r-u[t*2+1],2);const f=i[t];let p=f;do{let d=l[p];const m=fi(n-u[d*2],2)+fi(r-u[d*2+1],2);if(m<h&&(h=m,c=d),p=p%3===2?p-2:p+1,l[p]!==t)break;if(p=s[p],p===-1){if(p=o[(a[t]+1)%o.length],p!==d&&fi(n-u[p*2],2)+fi(r-u[p*2+1],2)<h)return p;break}}while(p!==f);return c}render(t){const n=t==null?t=new hr:void 0,{points:r,halfedges:i,triangles:o}=this;for(let a=0,s=i.length;a<s;++a){const l=i[a];if(l<a)continue;const u=o[a]*2,c=o[l]*2;t.moveTo(r[u],r[u+1]),t.lineTo(r[c],r[c+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const r=t==null?t=new hr:void 0,{points:i}=this;for(let o=0,a=i.length;o<a;o+=2){const s=i[o],l=i[o+1];t.moveTo(s+n,l),t.arc(s,l,n,0,B6)}return r&&r.value()}renderHull(t){const n=t==null?t=new hr:void 0,{hull:r,points:i}=this,o=r[0]*2,a=r.length;t.moveTo(i[o],i[o+1]);for(let s=1;s<a;++s){const l=2*r[s];t.lineTo(i[l],i[l+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new Bf;return this.renderHull(t),t.value()}renderTriangle(t,n){const r=n==null?n=new hr:void 0,{points:i,triangles:o}=this,a=o[t*=3]*2,s=o[t+1]*2,l=o[t+2]*2;return n.moveTo(i[a],i[a+1]),n.lineTo(i[s],i[s+1]),n.lineTo(i[l],i[l+1]),n.closePath(),r&&r.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,r=t.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new Bf;return this.renderTriangle(t,n),n.value()}}function G6(e,t,n,r){const i=e.length,o=new Float64Array(i*2);for(let a=0;a<i;++a){const s=e[a];o[a*2]=t.call(r,s,a,e),o[a*2+1]=n.call(r,s,a,e)}return o}function*W6(e,t,n,r){let i=0;for(const o of e)yield t.call(r,o,i,e),yield n.call(r,o,i,e),++i}var Ny={},Ff={},zf=34,Eo=10,Of=13;function Fy(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function V6(e,t){var n=Fy(e);return function(r,i){return t(n(r),i,e)}}function zy(e){var t=Object.create(null),n=[];return e.forEach(function(r){for(var i in r)i in t||n.push(t[i]=i)}),n}function ft(e,t){var n=e+"",r=n.length;return r<t?new Array(t-r+1).join(0)+n:n}function Y6(e){return e<0?"-"+ft(-e,6):e>9999?"+"+ft(e,6):ft(e,4)}function X6(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":Y6(e.getUTCFullYear())+"-"+ft(e.getUTCMonth()+1,2)+"-"+ft(e.getUTCDate(),2)+(i?"T"+ft(t,2)+":"+ft(n,2)+":"+ft(r,2)+"."+ft(i,3)+"Z":r?"T"+ft(t,2)+":"+ft(n,2)+":"+ft(r,2)+"Z":n||t?"T"+ft(t,2)+":"+ft(n,2)+"Z":"")}function Us(e){var t=new RegExp('["'+e+`
52
+ \r]`),n=e.charCodeAt(0);function r(h,f){var p,d,m=i(h,function(g,y){if(p)return p(g,y-1);d=g,p=f?V6(g,f):Fy(g)});return m.columns=d||[],m}function i(h,f){var p=[],d=h.length,m=0,g=0,y,b=d<=0,x=!1;h.charCodeAt(d-1)===Eo&&--d,h.charCodeAt(d-1)===Of&&--d;function $(){if(b)return Ff;if(x)return x=!1,Ny;var _,A=m,w;if(h.charCodeAt(A)===zf){for(;m++<d&&h.charCodeAt(m)!==zf||h.charCodeAt(++m)===zf;);return(_=m)>=d?b=!0:(w=h.charCodeAt(m++))===Eo?x=!0:w===Of&&(x=!0,h.charCodeAt(m)===Eo&&++m),h.slice(A+1,_-1).replace(/""/g,'"')}for(;m<d;){if((w=h.charCodeAt(_=m++))===Eo)x=!0;else if(w===Of)x=!0,h.charCodeAt(m)===Eo&&++m;else if(w!==n)continue;return h.slice(A,_)}return b=!0,h.slice(A,d)}for(;(y=$())!==Ff;){for(var S=[];y!==Ny&&y!==Ff;)S.push(y),y=$();f&&(S=f(S,g++))==null||p.push(S)}return p}function o(h,f){return h.map(function(p){return f.map(function(d){return c(p[d])}).join(e)})}function a(h,f){return f==null&&(f=zy(h)),[f.map(c).join(e)].concat(o(h,f)).join(`
53
53
  `)}function s(h,f){return f==null&&(f=zy(h)),o(h,f).join(`
54
54
  `)}function l(h){return h.map(u).join(`
55
- `)}function u(h){return h.map(c).join(e)}function c(h){return h==null?"":h instanceof Date?X6(h):t.test(h+="")?'"'+h.replace(/"/g,'""')+'"':h}return{parse:r,parseRows:i,format:a,formatBody:s,formatRows:l,formatRow:u,formatValue:c}}var pr=Us(","),Oy=pr.parse,U6=pr.parseRows,j6=pr.format,H6=pr.formatBody,q6=pr.formatRows,Z6=pr.formatRow,K6=pr.formatValue,gr=Us(" "),Gy=gr.parse,Q6=gr.parseRows,J6=gr.format,ek=gr.formatBody,tk=gr.formatRows,nk=gr.formatRow,rk=gr.formatValue;function ik(e){for(var t in e){var n=e[t].trim(),r,i;if(!n)n=null;else if(n==="true")n=!0;else if(n==="false")n=!1;else if(n==="NaN")n=NaN;else if(!isNaN(r=+n))n=r;else if(i=n.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/))ok&&i[4]&&!i[7]&&(n=n.replace(/-/g,"/").replace(/T/," ")),n=new Date(n);else continue;e[t]=n}return e}const ok=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();function ak(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.blob()}function sk(e,t){return fetch(e,t).then(ak)}function lk(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.arrayBuffer()}function uk(e,t){return fetch(e,t).then(lk)}function ck(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.text()}function js(e,t){return fetch(e,t).then(ck)}function Wy(e){return function(t,n,r){return arguments.length===2&&typeof n=="function"&&(r=n,n=void 0),js(t,n).then(function(i){return e(i,r)})}}function fk(e,t,n,r){arguments.length===3&&typeof n=="function"&&(r=n,n=void 0);var i=Us(e);return js(t,n).then(function(o){return i.parse(o,r)})}var hk=Wy(Oy),pk=Wy(Gy);function gk(e,t){return new Promise(function(n,r){var i=new Image;for(var o in t)i[o]=t[o];i.onerror=r,i.onload=function(){n(i)},i.src=e})}function dk(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);if(!(e.status===204||e.status===205))return e.json()}function mk(e,t){return fetch(e,t).then(dk)}function Gf(e){return(t,n)=>js(t,n).then(r=>new DOMParser().parseFromString(r,e))}const yk=Gf("application/xml");var bk=Gf("text/html"),xk=Gf("image/svg+xml");function Wf(e,t){var n,r=1;e==null&&(e=0),t==null&&(t=0);function i(){var o,a=n.length,s,l=0,u=0;for(o=0;o<a;++o)s=n[o],l+=s.x,u+=s.y;for(l=(l/a-e)*r,u=(u/a-t)*r,o=0;o<a;++o)s=n[o],s.x-=l,s.y-=u}return i.initialize=function(o){n=o},i.x=function(o){return arguments.length?(e=+o,i):e},i.y=function(o){return arguments.length?(t=+o,i):t},i.strength=function(o){return arguments.length?(r=+o,i):r},i}function $k(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return Vy(this.cover(t,n),t,n,e)}function Vy(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o=e._root,a={data:r},s=e._x0,l=e._y0,u=e._x1,c=e._y1,h,f,p,g,m,d,y,b;if(!o)return e._root=a,e;for(;o.length;)if((m=t>=(h=(s+u)/2))?s=h:u=h,(d=n>=(f=(l+c)/2))?l=f:c=f,i=o,!(o=o[y=d<<1|m]))return i[y]=a,e;if(p=+e._x.call(null,o.data),g=+e._y.call(null,o.data),t===p&&n===g)return a.next=o,i?i[y]=a:e._root=a,e;do i=i?i[y]=new Array(4):e._root=new Array(4),(m=t>=(h=(s+u)/2))?s=h:u=h,(d=n>=(f=(l+c)/2))?l=f:c=f;while((y=d<<1|m)===(b=(g>=f)<<1|p>=h));return i[b]=o,i[y]=a,e}function vk(e){var t,n,r=e.length,i,o,a=new Array(r),s=new Array(r),l=1/0,u=1/0,c=-1/0,h=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(a[n]=i,s[n]=o,i<l&&(l=i),i>c&&(c=i),o<u&&(u=o),o>h&&(h=o));if(l>c||u>h)return this;for(this.cover(l,u).cover(c,h),n=0;n<r;++n)Vy(this,a[n],s[n],e[n]);return this}function Sk(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,o=(r=Math.floor(t))+1;else{for(var a=i-n||1,s=this._root,l,u;n>e||e>=i||r>t||t>=o;)switch(u=(t<r)<<1|e<n,l=new Array(4),l[u]=s,s=l,a*=2,u){case 0:i=n+a,o=r+a;break;case 1:n=i-a,o=r+a;break;case 2:i=n+a,r=o-a;break;case 3:n=i-a,r=o-a;break}this._root&&this._root.length&&(this._root=s)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this}function Tk(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function _k(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Ke(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function Ak(e,t,n){var r,i=this._x0,o=this._y0,a,s,l,u,c=this._x1,h=this._y1,f=[],p=this._root,g,m;for(p&&f.push(new Ke(p,i,o,c,h)),n==null?n=1/0:(i=e-n,o=t-n,c=e+n,h=t+n,n*=n);g=f.pop();)if(!(!(p=g.node)||(a=g.x0)>c||(s=g.y0)>h||(l=g.x1)<i||(u=g.y1)<o))if(p.length){var d=(a+l)/2,y=(s+u)/2;f.push(new Ke(p[3],d,y,l,u),new Ke(p[2],a,y,d,u),new Ke(p[1],d,s,l,y),new Ke(p[0],a,s,d,y)),(m=(t>=y)<<1|e>=d)&&(g=f[f.length-1],f[f.length-1]=f[f.length-1-m],f[f.length-1-m]=g)}else{var b=e-+this._x.call(null,p.data),x=t-+this._y.call(null,p.data),$=b*b+x*x;if($<n){var S=Math.sqrt(n=$);i=e-S,o=t-S,c=e+S,h=t+S,r=p.data}}return r}function wk(e){if(isNaN(c=+this._x.call(null,e))||isNaN(h=+this._y.call(null,e)))return this;var t,n=this._root,r,i,o,a=this._x0,s=this._y0,l=this._x1,u=this._y1,c,h,f,p,g,m,d,y;if(!n)return this;if(n.length)for(;;){if((g=c>=(f=(a+l)/2))?a=f:l=f,(m=h>=(p=(s+u)/2))?s=p:u=p,t=n,!(n=n[d=m<<1|g]))return this;if(!n.length)break;(t[d+1&3]||t[d+2&3]||t[d+3&3])&&(r=t,y=d)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):t?(o?t[d]=o:delete t[d],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[y]=n:this._root=n),this):(this._root=o,this)}function Pk(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function Dk(){return this._root}function Ck(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function Lk(e){var t=[],n,r=this._root,i,o,a,s,l;for(r&&t.push(new Ke(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,o=n.x0,a=n.y0,s=n.x1,l=n.y1)&&r.length){var u=(o+s)/2,c=(a+l)/2;(i=r[3])&&t.push(new Ke(i,u,c,s,l)),(i=r[2])&&t.push(new Ke(i,o,c,u,l)),(i=r[1])&&t.push(new Ke(i,u,a,s,c)),(i=r[0])&&t.push(new Ke(i,o,a,u,c))}return this}function Mk(e){var t=[],n=[],r;for(this._root&&t.push(new Ke(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var o,a=r.x0,s=r.y0,l=r.x1,u=r.y1,c=(a+l)/2,h=(s+u)/2;(o=i[0])&&t.push(new Ke(o,a,s,c,h)),(o=i[1])&&t.push(new Ke(o,c,s,l,h)),(o=i[2])&&t.push(new Ke(o,a,h,c,u)),(o=i[3])&&t.push(new Ke(o,c,h,l,u))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function kk(e){return e[0]}function Rk(e){return arguments.length?(this._x=e,this):this._x}function Ik(e){return e[1]}function Ek(e){return arguments.length?(this._y=e,this):this._y}function Hs(e,t,n){var r=new Vf(t??kk,n??Ik,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function Vf(e,t,n,r,i,o){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Yy(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var Qe=Hs.prototype=Vf.prototype;Qe.copy=function(){var e=new Vf(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=Yy(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?n.push({source:r,target:t.target[i]=new Array(4)}):t.target[i]=Yy(r));return e},Qe.add=$k,Qe.addAll=vk,Qe.cover=Sk,Qe.data=Tk,Qe.extent=_k,Qe.find=Ak,Qe.remove=wk,Qe.removeAll=Pk,Qe.root=Dk,Qe.size=Ck,Qe.visit=Lk,Qe.visitAfter=Mk,Qe.x=Rk,Qe.y=Ek;function ke(e){return function(){return e}}function In(e){return(e()-.5)*1e-6}function Bk(e){return e.x+e.vx}function Nk(e){return e.y+e.vy}function qs(e){var t,n,r,i=1,o=1;typeof e!="function"&&(e=ke(e==null?1:+e));function a(){for(var u,c=t.length,h,f,p,g,m,d,y=0;y<o;++y)for(h=Hs(t,Bk,Nk).visitAfter(s),u=0;u<c;++u)f=t[u],m=n[f.index],d=m*m,p=f.x+f.vx,g=f.y+f.vy,h.visit(b);function b(x,$,S,_,A){var w=x.data,P=x.r,I=m+P;if(w){if(w.index>f.index){var v=p-w.x-w.vx,N=g-w.y-w.vy,R=v*v+N*N;R<I*I&&(v===0&&(v=In(r),R+=v*v),N===0&&(N=In(r),R+=N*N),R=(I-(R=Math.sqrt(R)))/R*i,f.vx+=(v*=R)*(I=(P*=P)/(d+P)),f.vy+=(N*=R)*I,w.vx-=v*(I=1-I),w.vy-=N*I)}return}return $>p+I||_<p-I||S>g+I||A<g-I}}function s(u){if(u.data)return u.r=n[u.data.index];for(var c=u.r=0;c<4;++c)u[c]&&u[c].r>u.r&&(u.r=u[c].r)}function l(){if(t){var u,c=t.length,h;for(n=new Array(c),u=0;u<c;++u)h=t[u],n[h.index]=+e(h,u,t)}}return a.initialize=function(u,c){t=u,r=c,l()},a.iterations=function(u){return arguments.length?(o=+u,a):o},a.strength=function(u){return arguments.length?(i=+u,a):i},a.radius=function(u){return arguments.length?(e=typeof u=="function"?u:ke(+u),l(),a):e},a}function Fk(e){return e.index}function Xy(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function Yf(e){var t=Fk,n=h,r,i=ke(30),o,a,s,l,u,c=1;e==null&&(e=[]);function h(d){return 1/Math.min(s[d.source.index],s[d.target.index])}function f(d){for(var y=0,b=e.length;y<c;++y)for(var x=0,$,S,_,A,w,P,I;x<b;++x)$=e[x],S=$.source,_=$.target,A=_.x+_.vx-S.x-S.vx||In(u),w=_.y+_.vy-S.y-S.vy||In(u),P=Math.sqrt(A*A+w*w),P=(P-o[x])/P*d*r[x],A*=P,w*=P,_.vx-=A*(I=l[x]),_.vy-=w*I,S.vx+=A*(I=1-I),S.vy+=w*I}function p(){if(a){var d,y=a.length,b=e.length,x=new Map(a.map((S,_)=>[t(S,_,a),S])),$;for(d=0,s=new Array(y);d<b;++d)$=e[d],$.index=d,typeof $.source!="object"&&($.source=Xy(x,$.source)),typeof $.target!="object"&&($.target=Xy(x,$.target)),s[$.source.index]=(s[$.source.index]||0)+1,s[$.target.index]=(s[$.target.index]||0)+1;for(d=0,l=new Array(b);d<b;++d)$=e[d],l[d]=s[$.source.index]/(s[$.source.index]+s[$.target.index]);r=new Array(b),g(),o=new Array(b),m()}}function g(){if(a)for(var d=0,y=e.length;d<y;++d)r[d]=+n(e[d],d,e)}function m(){if(a)for(var d=0,y=e.length;d<y;++d)o[d]=+i(e[d],d,e)}return f.initialize=function(d,y){a=d,u=y,p()},f.links=function(d){return arguments.length?(e=d,p(),f):e},f.id=function(d){return arguments.length?(t=d,f):t},f.iterations=function(d){return arguments.length?(c=+d,f):c},f.strength=function(d){return arguments.length?(n=typeof d=="function"?d:ke(+d),g(),f):n},f.distance=function(d){return arguments.length?(i=typeof d=="function"?d:ke(+d),m(),f):i},f}const zk=1664525,Ok=1013904223,Uy=4294967296;function Gk(){let e=1;return()=>(e=(zk*e+Ok)%Uy)/Uy}function Wk(e){return e.x}function Vk(e){return e.y}var Yk=10,Xk=Math.PI*(3-Math.sqrt(5));function Zs(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,l=Es(h),u=Jn("tick","end"),c=Gk();e==null&&(e=[]);function h(){f(),u.call("tick",t),n<r&&(l.stop(),u.call("end",t))}function f(m){var d,y=e.length,b;m===void 0&&(m=1);for(var x=0;x<m;++x)for(n+=(o-n)*i,s.forEach(function($){$(n)}),d=0;d<y;++d)b=e[d],b.fx==null?b.x+=b.vx*=a:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=a:(b.y=b.fy,b.vy=0);return t}function p(){for(var m=0,d=e.length,y;m<d;++m){if(y=e[m],y.index=m,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=Yk*Math.sqrt(.5+m),x=m*Xk;y.x=b*Math.cos(x),y.y=b*Math.sin(x)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function g(m){return m.initialize&&m.initialize(e,c),m}return p(),t={tick:f,restart:function(){return l.restart(h),t},stop:function(){return l.stop(),t},nodes:function(m){return arguments.length?(e=m,p(),s.forEach(g),t):e},alpha:function(m){return arguments.length?(n=+m,t):n},alphaMin:function(m){return arguments.length?(r=+m,t):r},alphaDecay:function(m){return arguments.length?(i=+m,t):+i},alphaTarget:function(m){return arguments.length?(o=+m,t):o},velocityDecay:function(m){return arguments.length?(a=1-m,t):1-a},randomSource:function(m){return arguments.length?(c=m,s.forEach(g),t):c},force:function(m,d){return arguments.length>1?(d==null?s.delete(m):s.set(m,g(d)),t):s.get(m)},find:function(m,d,y){var b=0,x=e.length,$,S,_,A,w;for(y==null?y=1/0:y*=y,b=0;b<x;++b)A=e[b],$=m-A.x,S=d-A.y,_=$*$+S*S,_<y&&(w=A,y=_);return w},on:function(m,d){return arguments.length>1?(u.on(m,d),t):u.on(m)}}}function Ks(){var e,t,n,r,i=ke(-30),o,a=1,s=1/0,l=.81;function u(p){var g,m=e.length,d=Hs(e,Wk,Vk).visitAfter(h);for(r=p,g=0;g<m;++g)t=e[g],d.visit(f)}function c(){if(e){var p,g=e.length,m;for(o=new Array(g),p=0;p<g;++p)m=e[p],o[m.index]=+i(m,p,e)}}function h(p){var g=0,m,d,y=0,b,x,$;if(p.length){for(b=x=$=0;$<4;++$)(m=p[$])&&(d=Math.abs(m.value))&&(g+=m.value,y+=d,b+=d*m.x,x+=d*m.y);p.x=b/y,p.y=x/y}else{m=p,m.x=m.data.x,m.y=m.data.y;do g+=o[m.data.index];while(m=m.next)}p.value=g}function f(p,g,m,d){if(!p.value)return!0;var y=p.x-t.x,b=p.y-t.y,x=d-g,$=y*y+b*b;if(x*x/l<$)return $<s&&(y===0&&(y=In(n),$+=y*y),b===0&&(b=In(n),$+=b*b),$<a&&($=Math.sqrt(a*$)),t.vx+=y*p.value*r/$,t.vy+=b*p.value*r/$),!0;if(p.length||$>=s)return;(p.data!==t||p.next)&&(y===0&&(y=In(n),$+=y*y),b===0&&(b=In(n),$+=b*b),$<a&&($=Math.sqrt(a*$)));do p.data!==t&&(x=o[p.data.index]*r/$,t.vx+=y*x,t.vy+=b*x);while(p=p.next)}return u.initialize=function(p,g){e=p,n=g,c()},u.strength=function(p){return arguments.length?(i=typeof p=="function"?p:ke(+p),c(),u):i},u.distanceMin=function(p){return arguments.length?(a=p*p,u):Math.sqrt(a)},u.distanceMax=function(p){return arguments.length?(s=p*p,u):Math.sqrt(s)},u.theta=function(p){return arguments.length?(l=p*p,u):Math.sqrt(l)},u}function Uk(e,t,n){var r,i=ke(.1),o,a;typeof e!="function"&&(e=ke(+e)),t==null&&(t=0),n==null&&(n=0);function s(u){for(var c=0,h=r.length;c<h;++c){var f=r[c],p=f.x-t||1e-6,g=f.y-n||1e-6,m=Math.sqrt(p*p+g*g),d=(a[c]-m)*o[c]*u/m;f.vx+=p*d,f.vy+=g*d}}function l(){if(r){var u,c=r.length;for(o=new Array(c),a=new Array(c),u=0;u<c;++u)a[u]=+e(r[u],u,r),o[u]=isNaN(a[u])?0:+i(r[u],u,r)}}return s.initialize=function(u){r=u,l()},s.strength=function(u){return arguments.length?(i=typeof u=="function"?u:ke(+u),l(),s):i},s.radius=function(u){return arguments.length?(e=typeof u=="function"?u:ke(+u),l(),s):e},s.x=function(u){return arguments.length?(t=+u,s):t},s.y=function(u){return arguments.length?(n=+u,s):n},s}function jy(e){var t=ke(.1),n,r,i;typeof e!="function"&&(e=ke(e==null?0:+e));function o(s){for(var l=0,u=n.length,c;l<u;++l)c=n[l],c.vx+=(i[l]-c.x)*r[l]*s}function a(){if(n){var s,l=n.length;for(r=new Array(l),i=new Array(l),s=0;s<l;++s)r[s]=isNaN(i[s]=+e(n[s],s,n))?0:+t(n[s],s,n)}}return o.initialize=function(s){n=s,a()},o.strength=function(s){return arguments.length?(t=typeof s=="function"?s:ke(+s),a(),o):t},o.x=function(s){return arguments.length?(e=typeof s=="function"?s:ke(+s),a(),o):e},o}function Hy(e){var t=ke(.1),n,r,i;typeof e!="function"&&(e=ke(e==null?0:+e));function o(s){for(var l=0,u=n.length,c;l<u;++l)c=n[l],c.vy+=(i[l]-c.y)*r[l]*s}function a(){if(n){var s,l=n.length;for(r=new Array(l),i=new Array(l),s=0;s<l;++s)r[s]=isNaN(i[s]=+e(n[s],s,n))?0:+t(n[s],s,n)}}return o.initialize=function(s){n=s,a()},o.strength=function(s){return arguments.length?(t=typeof s=="function"?s:ke(+s),a(),o):t},o.y=function(s){return arguments.length?(e=typeof s=="function"?s:ke(+s),a(),o):e},o}function jk(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Qs(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function fi(e){return e=Qs(Math.abs(e)),e?e[1]:NaN}function Hk(e,t){return function(n,r){for(var i=n.length,o=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}function qk(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Zk=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function hi(e){if(!(t=Zk.exec(e)))throw new Error("invalid format: "+e);var t;return new Js({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}hi.prototype=Js.prototype;function Js(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Js.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 Kk(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var qy;function Qk(e,t){var n=Qs(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(qy=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")+Qs(e,Math.max(0,t+o-1))[0]}function Zy(e,t){var n=Qs(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Ky={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:jk,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Zy(e*100,t),r:Zy,s:Qk,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Qy(e){return e}var Jy=Array.prototype.map,eb=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tb(e){var t=e.grouping===void 0||e.thousands===void 0?Qy:Hk(Jy.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?Qy:qk(Jy.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(h){h=hi(h);var f=h.fill,p=h.align,g=h.sign,m=h.symbol,d=h.zero,y=h.width,b=h.comma,x=h.precision,$=h.trim,S=h.type;S==="n"?(b=!0,S="g"):Ky[S]||(x===void 0&&(x=12),$=!0,S="g"),(d||f==="0"&&p==="=")&&(d=!0,f="0",p="=");var _=m==="$"?n:m==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",A=m==="$"?r:/[%p]/.test(S)?a:"",w=Ky[S],P=/[defgprs%]/.test(S);x=x===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function I(v){var N=_,R=A,D,T,M;if(S==="c")R=w(v)+R,v="";else{v=+v;var O=v<0||1/v<0;if(v=isNaN(v)?l:w(Math.abs(v),x),$&&(v=Kk(v)),O&&+v==0&&g!=="+"&&(O=!1),N=(O?g==="("?g:s:g==="-"||g==="("?"":g)+N,R=(S==="s"?eb[8+qy/3]:"")+R+(O&&g==="("?")":""),P){for(D=-1,T=v.length;++D<T;)if(M=v.charCodeAt(D),48>M||M>57){R=(M===46?i+v.slice(D+1):v.slice(D))+R,v=v.slice(0,D);break}}}b&&!d&&(v=t(v,1/0));var k=N.length+v.length+R.length,B=k<y?new Array(y-k+1).join(f):"";switch(b&&d&&(v=t(B+v,B.length?y-R.length:1/0),B=""),p){case"<":v=N+v+R+B;break;case"=":v=N+B+v+R;break;case"^":v=B.slice(0,k=B.length>>1)+N+v+R+B.slice(k);break;default:v=B+N+v+R;break}return o(v)}return I.toString=function(){return h+""},I}function c(h,f){var p=u((h=hi(h),h.type="f",h)),g=Math.max(-8,Math.min(8,Math.floor(fi(f)/3)))*3,m=Math.pow(10,-g),d=eb[8+g/3];return function(y){return p(m*y)+d}}return{format:u,formatPrefix:c}}var el,Bo,Xf;nb({thousands:",",grouping:[3],currency:["$",""]});function nb(e){return el=tb(e),Bo=el.format,Xf=el.formatPrefix,el}function rb(e){return Math.max(0,-fi(Math.abs(e)))}function ib(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(fi(t)/3)))*3-fi(Math.abs(e)))}function ob(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,fi(t)-fi(e))+1}var ae=1e-6,No=1e-12,ge=Math.PI,Pe=ge/2,tl=ge/4,Je=ge*2,$e=180/ge,se=ge/180,de=Math.abs,pi=Math.atan,et=Math.atan2,oe=Math.cos,nl=Math.ceil,ab=Math.exp,Uf=Math.hypot,rl=Math.log,jf=Math.pow,ne=Math.sin,St=Math.sign||function(e){return e>0?1:e<0?-1:0},Be=Math.sqrt,Hf=Math.tan;function sb(e){return e>1?0:e<-1?ge:Math.acos(e)}function tt(e){return e>1?Pe:e<-1?-Pe:Math.asin(e)}function lb(e){return(e=ne(e/2))*e}function Ae(){}function il(e,t){e&&cb.hasOwnProperty(e.type)&&cb[e.type](e,t)}var ub={Feature:function(e,t){il(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)il(n[r].geometry,t)}},cb={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){qf(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)qf(n[r],t,0)},Polygon:function(e,t){fb(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)fb(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)il(n[r],t)}};function qf(e,t,n){var r=-1,i=e.length-n,o;for(t.lineStart();++r<i;)o=e[r],t.point(o[0],o[1],o[2]);t.lineEnd()}function fb(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)qf(e[n],t,1);t.polygonEnd()}function zt(e,t){e&&ub.hasOwnProperty(e.type)?ub[e.type](e,t):il(e,t)}var ol=new Me,al=new Me,hb,pb,Zf,Kf,Qf,Zt={point:Ae,lineStart:Ae,lineEnd:Ae,polygonStart:function(){ol=new Me,Zt.lineStart=Jk,Zt.lineEnd=e8},polygonEnd:function(){var e=+ol;al.add(e<0?Je+e:e),this.lineStart=this.lineEnd=this.point=Ae},sphere:function(){al.add(Je)}};function Jk(){Zt.point=t8}function e8(){gb(hb,pb)}function t8(e,t){Zt.point=gb,hb=e,pb=t,e*=se,t*=se,Zf=e,Kf=oe(t=t/2+tl),Qf=ne(t)}function gb(e,t){e*=se,t*=se,t=t/2+tl;var n=e-Zf,r=n>=0?1:-1,i=r*n,o=oe(t),a=ne(t),s=Qf*a,l=Kf*o+s*oe(i),u=s*r*ne(i);ol.add(et(u,l)),Zf=e,Kf=o,Qf=a}function n8(e){return al=new Me,zt(e,Zt),al*2}function sl(e){return[et(e[1],e[0]),tt(e[2])]}function dr(e){var t=e[0],n=e[1],r=oe(n);return[r*oe(t),r*ne(t),ne(n)]}function ll(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function gi(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Jf(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function ul(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function cl(e){var t=Be(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var we,ht,De,xt,mr,db,mb,di,Fo,En,hn,pn={point:eh,lineStart:bb,lineEnd:xb,polygonStart:function(){pn.point=$b,pn.lineStart=r8,pn.lineEnd=i8,Fo=new Me,Zt.polygonStart()},polygonEnd:function(){Zt.polygonEnd(),pn.point=eh,pn.lineStart=bb,pn.lineEnd=xb,ol<0?(we=-(De=180),ht=-(xt=90)):Fo>ae?xt=90:Fo<-ae&&(ht=-90),hn[0]=we,hn[1]=De},sphere:function(){we=-(De=180),ht=-(xt=90)}};function eh(e,t){En.push(hn=[we=e,De=e]),t<ht&&(ht=t),t>xt&&(xt=t)}function yb(e,t){var n=dr([e*se,t*se]);if(di){var r=gi(di,n),i=[r[1],-r[0],0],o=gi(i,r);cl(o),o=sl(o);var a=e-mr,s=a>0?1:-1,l=o[0]*$e*s,u,c=de(a)>180;c^(s*mr<l&&l<s*e)?(u=o[1]*$e,u>xt&&(xt=u)):(l=(l+360)%360-180,c^(s*mr<l&&l<s*e)?(u=-o[1]*$e,u<ht&&(ht=u)):(t<ht&&(ht=t),t>xt&&(xt=t))),c?e<mr?$t(we,e)>$t(we,De)&&(De=e):$t(e,De)>$t(we,De)&&(we=e):De>=we?(e<we&&(we=e),e>De&&(De=e)):e>mr?$t(we,e)>$t(we,De)&&(De=e):$t(e,De)>$t(we,De)&&(we=e)}else En.push(hn=[we=e,De=e]);t<ht&&(ht=t),t>xt&&(xt=t),di=n,mr=e}function bb(){pn.point=yb}function xb(){hn[0]=we,hn[1]=De,pn.point=eh,di=null}function $b(e,t){if(di){var n=e-mr;Fo.add(de(n)>180?n+(n>0?360:-360):n)}else db=e,mb=t;Zt.point(e,t),yb(e,t)}function r8(){Zt.lineStart()}function i8(){$b(db,mb),Zt.lineEnd(),de(Fo)>ae&&(we=-(De=180)),hn[0]=we,hn[1]=De,di=null}function $t(e,t){return(t-=e)<0?t+360:t}function o8(e,t){return e[0]-t[0]}function vb(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function a8(e){var t,n,r,i,o,a,s;if(xt=De=-(we=ht=1/0),En=[],zt(e,pn),n=En.length){for(En.sort(o8),t=1,r=En[0],o=[r];t<n;++t)i=En[t],vb(r,i[0])||vb(r,i[1])?($t(r[0],i[1])>$t(r[0],r[1])&&(r[1]=i[1]),$t(i[0],r[1])>$t(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,n=o.length-1,t=0,r=o[n];t<=n;r=i,++t)i=o[t],(s=$t(r[1],i[0]))>a&&(a=s,we=i[0],De=r[1])}return En=hn=null,we===1/0||ht===1/0?[[NaN,NaN],[NaN,NaN]]:[[we,ht],[De,xt]]}var zo,fl,hl,pl,gl,dl,ml,yl,th,nh,rh,Sb,Tb,nt,rt,it,Ot={sphere:Ae,point:ih,lineStart:_b,lineEnd:Ab,polygonStart:function(){Ot.lineStart=u8,Ot.lineEnd=c8},polygonEnd:function(){Ot.lineStart=_b,Ot.lineEnd=Ab}};function ih(e,t){e*=se,t*=se;var n=oe(t);Oo(n*oe(e),n*ne(e),ne(t))}function Oo(e,t,n){++zo,hl+=(e-hl)/zo,pl+=(t-pl)/zo,gl+=(n-gl)/zo}function _b(){Ot.point=s8}function s8(e,t){e*=se,t*=se;var n=oe(t);nt=n*oe(e),rt=n*ne(e),it=ne(t),Ot.point=l8,Oo(nt,rt,it)}function l8(e,t){e*=se,t*=se;var n=oe(t),r=n*oe(e),i=n*ne(e),o=ne(t),a=et(Be((a=rt*o-it*i)*a+(a=it*r-nt*o)*a+(a=nt*i-rt*r)*a),nt*r+rt*i+it*o);fl+=a,dl+=a*(nt+(nt=r)),ml+=a*(rt+(rt=i)),yl+=a*(it+(it=o)),Oo(nt,rt,it)}function Ab(){Ot.point=ih}function u8(){Ot.point=f8}function c8(){wb(Sb,Tb),Ot.point=ih}function f8(e,t){Sb=e,Tb=t,e*=se,t*=se,Ot.point=wb;var n=oe(t);nt=n*oe(e),rt=n*ne(e),it=ne(t),Oo(nt,rt,it)}function wb(e,t){e*=se,t*=se;var n=oe(t),r=n*oe(e),i=n*ne(e),o=ne(t),a=rt*o-it*i,s=it*r-nt*o,l=nt*i-rt*r,u=Uf(a,s,l),c=tt(u),h=u&&-c/u;th.add(h*a),nh.add(h*s),rh.add(h*l),fl+=c,dl+=c*(nt+(nt=r)),ml+=c*(rt+(rt=i)),yl+=c*(it+(it=o)),Oo(nt,rt,it)}function h8(e){zo=fl=hl=pl=gl=dl=ml=yl=0,th=new Me,nh=new Me,rh=new Me,zt(e,Ot);var t=+th,n=+nh,r=+rh,i=Uf(t,n,r);return i<No&&(t=dl,n=ml,r=yl,fl<ae&&(t=hl,n=pl,r=gl),i=Uf(t,n,r),i<No)?[NaN,NaN]:[et(n,t)*$e,tt(r/i)*$e]}function mi(e){return function(){return e}}function oh(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function ah(e,t){return de(e)>ge&&(e-=Math.round(e/Je)*Je),[e,t]}ah.invert=ah;function sh(e,t,n){return(e%=Je)?t||n?oh(Db(e),Cb(t,n)):Db(e):t||n?Cb(t,n):ah}function Pb(e){return function(t,n){return t+=e,de(t)>ge&&(t-=Math.round(t/Je)*Je),[t,n]}}function Db(e){var t=Pb(e);return t.invert=Pb(-e),t}function Cb(e,t){var n=oe(e),r=ne(e),i=oe(t),o=ne(t);function a(s,l){var u=oe(l),c=oe(s)*u,h=ne(s)*u,f=ne(l),p=f*n+c*r;return[et(h*i-p*o,c*n-f*r),tt(p*i+h*o)]}return a.invert=function(s,l){var u=oe(l),c=oe(s)*u,h=ne(s)*u,f=ne(l),p=f*i-h*o;return[et(h*i+f*o,c*n+p*r),tt(p*n-c*r)]},a}function Lb(e){e=sh(e[0]*se,e[1]*se,e.length>2?e[2]*se:0);function t(n){return n=e(n[0]*se,n[1]*se),n[0]*=$e,n[1]*=$e,n}return t.invert=function(n){return n=e.invert(n[0]*se,n[1]*se),n[0]*=$e,n[1]*=$e,n},t}function Mb(e,t,n,r,i,o){if(n){var a=oe(t),s=ne(t),l=r*n;i==null?(i=t+r*Je,o=t-l/2):(i=kb(a,i),o=kb(a,o),(r>0?i<o:i>o)&&(i+=r*Je));for(var u,c=i;r>0?c>o:c<o;c-=l)u=sl([a,-s*oe(c),-s*ne(c)]),e.point(u[0],u[1])}}function kb(e,t){t=dr(t),t[0]-=e,cl(t);var n=sb(-t[1]);return((-t[2]<0?-n:n)+Je-ae)%Je}function p8(){var e=mi([0,0]),t=mi(90),n=mi(2),r,i,o={point:a};function a(l,u){r.push(l=i(l,u)),l[0]*=$e,l[1]*=$e}function s(){var l=e.apply(this,arguments),u=t.apply(this,arguments)*se,c=n.apply(this,arguments)*se;return r=[],i=sh(-l[0]*se,-l[1]*se,0).invert,Mb(o,u,c,1),l={type:"Polygon",coordinates:[r]},r=i=null,l}return s.center=function(l){return arguments.length?(e=typeof l=="function"?l:mi([+l[0],+l[1]]),s):e},s.radius=function(l){return arguments.length?(t=typeof l=="function"?l:mi(+l),s):t},s.precision=function(l){return arguments.length?(n=typeof l=="function"?l:mi(+l),s):n},s}function Rb(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Ae,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function bl(e,t){return de(e[0]-t[0])<ae&&de(e[1]-t[1])<ae}function xl(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Ib(e,t,n,r,i){var o=[],a=[],s,l;if(e.forEach(function(g){if(!((m=g.length-1)<=0)){var m,d=g[0],y=g[m],b;if(bl(d,y)){if(!d[2]&&!y[2]){for(i.lineStart(),s=0;s<m;++s)i.point((d=g[s])[0],d[1]);i.lineEnd();return}y[0]+=2*ae}o.push(b=new xl(d,g,null,!0)),a.push(b.o=new xl(d,null,b,!1)),o.push(b=new xl(y,g,null,!1)),a.push(b.o=new xl(y,null,b,!0))}}),!!o.length){for(a.sort(t),Eb(o),Eb(a),s=0,l=a.length;s<l;++s)a[s].e=n=!n;for(var u=o[0],c,h;;){for(var f=u,p=!0;f.v;)if((f=f.n)===u)return;c=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(s=0,l=c.length;s<l;++s)i.point((h=c[s])[0],h[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(p)for(c=f.p.z,s=c.length-1;s>=0;--s)i.point((h=c[s])[0],h[1]);else r(f.x,f.p.x,-1,i);f=f.p}f=f.o,c=f.z,p=!p}while(!f.v);i.lineEnd()}}}function Eb(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function lh(e){return de(e[0])<=ge?e[0]:St(e[0])*((de(e[0])+ge)%Je-ge)}function Bb(e,t){var n=lh(t),r=t[1],i=ne(r),o=[ne(n),-oe(n),0],a=0,s=0,l=new Me;i===1?r=Pe+ae:i===-1&&(r=-Pe-ae);for(var u=0,c=e.length;u<c;++u)if(f=(h=e[u]).length)for(var h,f,p=h[f-1],g=lh(p),m=p[1]/2+tl,d=ne(m),y=oe(m),b=0;b<f;++b,g=$,d=_,y=A,p=x){var x=h[b],$=lh(x),S=x[1]/2+tl,_=ne(S),A=oe(S),w=$-g,P=w>=0?1:-1,I=P*w,v=I>ge,N=d*_;if(l.add(et(N*P*ne(I),y*A+N*oe(I))),a+=v?w+P*Je:w,v^g>=n^$>=n){var R=gi(dr(p),dr(x));cl(R);var D=gi(o,R);cl(D);var T=(v^w>=0?-1:1)*tt(D[2]);(r>T||r===T&&(R[0]||R[1]))&&(s+=v^w>=0?1:-1)}}return(a<-ae||a<ae&&l<-No)^s&1}function Nb(e,t,n,r){return function(i){var o=t(i),a=Rb(),s=t(a),l=!1,u,c,h,f={point:p,lineStart:m,lineEnd:d,polygonStart:function(){f.point=y,f.lineStart=b,f.lineEnd=x,c=[],u=[]},polygonEnd:function(){f.point=p,f.lineStart=m,f.lineEnd=d,c=Ic(c);var $=Bb(u,r);c.length?(l||(i.polygonStart(),l=!0),Ib(c,d8,$,n,i)):$&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),c=u=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function p($,S){e($,S)&&i.point($,S)}function g($,S){o.point($,S)}function m(){f.point=g,o.lineStart()}function d(){f.point=p,o.lineEnd()}function y($,S){h.push([$,S]),s.point($,S)}function b(){s.lineStart(),h=[]}function x(){y(h[0][0],h[0][1]),s.lineEnd();var $=s.clean(),S=a.result(),_,A=S.length,w,P,I;if(h.pop(),u.push(h),h=null,!!A){if($&1){if(P=S[0],(w=P.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),_=0;_<w;++_)i.point((I=P[_])[0],I[1]);i.lineEnd()}return}A>1&&$&2&&S.push(S.pop().concat(S.shift())),c.push(S.filter(g8))}}return f}}function g8(e){return e.length>1}function d8(e,t){return((e=e.x)[0]<0?e[1]-Pe-ae:Pe-e[1])-((t=t.x)[0]<0?t[1]-Pe-ae:Pe-t[1])}const uh=Nb(function(){return!0},m8,b8,[-ge,-Pe]);function m8(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,a){var s=o>0?ge:-ge,l=de(o-t);de(l-ge)<ae?(e.point(t,n=(n+a)/2>0?Pe:-Pe),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),e.point(o,n),i=0):r!==s&&l>=ge&&(de(t-r)<ae&&(t-=r*ae),de(o-s)<ae&&(o-=s*ae),n=y8(t,n,o,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),i=0),e.point(t=o,n=a),r=s},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function y8(e,t,n,r){var i,o,a=ne(e-n);return de(a)>ae?pi((ne(t)*(o=oe(r))*ne(n)-ne(r)*(i=oe(t))*ne(e))/(i*o*a)):(t+r)/2}function b8(e,t,n,r){var i;if(e==null)i=n*Pe,r.point(-ge,i),r.point(0,i),r.point(ge,i),r.point(ge,0),r.point(ge,-i),r.point(0,-i),r.point(-ge,-i),r.point(-ge,0),r.point(-ge,i);else if(de(e[0]-t[0])>ae){var o=e[0]<t[0]?ge:-ge;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}function Fb(e){var t=oe(e),n=2*se,r=t>0,i=de(t)>ae;function o(c,h,f,p){Mb(p,e,n,f,c,h)}function a(c,h){return oe(c)*oe(h)>t}function s(c){var h,f,p,g,m;return{lineStart:function(){g=p=!1,m=1},point:function(d,y){var b=[d,y],x,$=a(d,y),S=r?$?0:u(d,y):$?u(d+(d<0?ge:-ge),y):0;if(!h&&(g=p=$)&&c.lineStart(),$!==p&&(x=l(h,b),(!x||bl(h,x)||bl(b,x))&&(b[2]=1)),$!==p)m=0,$?(c.lineStart(),x=l(b,h),c.point(x[0],x[1])):(x=l(h,b),c.point(x[0],x[1],2),c.lineEnd()),h=x;else if(i&&h&&r^$){var _;!(S&f)&&(_=l(b,h,!0))&&(m=0,r?(c.lineStart(),c.point(_[0][0],_[0][1]),c.point(_[1][0],_[1][1]),c.lineEnd()):(c.point(_[1][0],_[1][1]),c.lineEnd(),c.lineStart(),c.point(_[0][0],_[0][1],3)))}$&&(!h||!bl(h,b))&&c.point(b[0],b[1]),h=b,p=$,f=S},lineEnd:function(){p&&c.lineEnd(),h=null},clean:function(){return m|(g&&p)<<1}}}function l(c,h,f){var p=dr(c),g=dr(h),m=[1,0,0],d=gi(p,g),y=ll(d,d),b=d[0],x=y-b*b;if(!x)return!f&&c;var $=t*y/x,S=-t*b/x,_=gi(m,d),A=ul(m,$),w=ul(d,S);Jf(A,w);var P=_,I=ll(A,P),v=ll(P,P),N=I*I-v*(ll(A,A)-1);if(!(N<0)){var R=Be(N),D=ul(P,(-I-R)/v);if(Jf(D,A),D=sl(D),!f)return D;var T=c[0],M=h[0],O=c[1],k=h[1],B;M<T&&(B=T,T=M,M=B);var F=M-T,E=de(F-ge)<ae,W=E||F<ae;if(!E&&k<O&&(B=O,O=k,k=B),W?E?O+k>0^D[1]<(de(D[0]-T)<ae?O:k):O<=D[1]&&D[1]<=k:F>ge^(T<=D[0]&&D[0]<=M)){var j=ul(P,(-I+R)/v);return Jf(j,A),[D,sl(j)]}}}function u(c,h){var f=r?e:ge-e,p=0;return c<-f?p|=1:c>f&&(p|=2),h<-f?p|=4:h>f&&(p|=8),p}return Nb(a,s,o,r?[0,-e]:[-ge,e-ge])}function x8(e,t,n,r,i,o){var a=e[0],s=e[1],l=t[0],u=t[1],c=0,h=1,f=l-a,p=u-s,g;if(g=n-a,!(!f&&g>0)){if(g/=f,f<0){if(g<c)return;g<h&&(h=g)}else if(f>0){if(g>h)return;g>c&&(c=g)}if(g=i-a,!(!f&&g<0)){if(g/=f,f<0){if(g>h)return;g>c&&(c=g)}else if(f>0){if(g<c)return;g<h&&(h=g)}if(g=r-s,!(!p&&g>0)){if(g/=p,p<0){if(g<c)return;g<h&&(h=g)}else if(p>0){if(g>h)return;g>c&&(c=g)}if(g=o-s,!(!p&&g<0)){if(g/=p,p<0){if(g>h)return;g>c&&(c=g)}else if(p>0){if(g<c)return;g<h&&(h=g)}return c>0&&(e[0]=a+c*f,e[1]=s+c*p),h<1&&(t[0]=a+h*f,t[1]=s+h*p),!0}}}}}var Go=1e9,$l=-Go;function vl(e,t,n,r){function i(u,c){return e<=u&&u<=n&&t<=c&&c<=r}function o(u,c,h,f){var p=0,g=0;if(u==null||(p=a(u,h))!==(g=a(c,h))||l(u,c)<0^h>0)do f.point(p===0||p===3?e:n,p>1?r:t);while((p=(p+h+4)%4)!==g);else f.point(c[0],c[1])}function a(u,c){return de(u[0]-e)<ae?c>0?0:3:de(u[0]-n)<ae?c>0?2:1:de(u[1]-t)<ae?c>0?1:0:c>0?3:2}function s(u,c){return l(u.x,c.x)}function l(u,c){var h=a(u,1),f=a(c,1);return h!==f?h-f:h===0?c[1]-u[1]:h===1?u[0]-c[0]:h===2?u[1]-c[1]:c[0]-u[0]}return function(u){var c=u,h=Rb(),f,p,g,m,d,y,b,x,$,S,_,A={point:w,lineStart:N,lineEnd:R,polygonStart:I,polygonEnd:v};function w(T,M){i(T,M)&&c.point(T,M)}function P(){for(var T=0,M=0,O=p.length;M<O;++M)for(var k=p[M],B=1,F=k.length,E=k[0],W,j,te=E[0],V=E[1];B<F;++B)W=te,j=V,E=k[B],te=E[0],V=E[1],j<=r?V>r&&(te-W)*(r-j)>(V-j)*(e-W)&&++T:V<=r&&(te-W)*(r-j)<(V-j)*(e-W)&&--T;return T}function I(){c=h,f=[],p=[],_=!0}function v(){var T=P(),M=_&&T,O=(f=Ic(f)).length;(M||O)&&(u.polygonStart(),M&&(u.lineStart(),o(null,null,1,u),u.lineEnd()),O&&Ib(f,s,T,o,u),u.polygonEnd()),c=u,f=p=g=null}function N(){A.point=D,p&&p.push(g=[]),S=!0,$=!1,b=x=NaN}function R(){f&&(D(m,d),y&&$&&h.rejoin(),f.push(h.result())),A.point=w,$&&c.lineEnd()}function D(T,M){var O=i(T,M);if(p&&g.push([T,M]),S)m=T,d=M,y=O,S=!1,O&&(c.lineStart(),c.point(T,M));else if(O&&$)c.point(T,M);else{var k=[b=Math.max($l,Math.min(Go,b)),x=Math.max($l,Math.min(Go,x))],B=[T=Math.max($l,Math.min(Go,T)),M=Math.max($l,Math.min(Go,M))];x8(k,B,e,t,n,r)?($||(c.lineStart(),c.point(k[0],k[1])),c.point(B[0],B[1]),O||c.lineEnd(),_=!1):O&&(c.lineStart(),c.point(T,M),_=!1)}b=T,x=M,$=O}return A}}function $8(){var e=0,t=0,n=960,r=500,i,o,a;return a={stream:function(s){return i&&o===s?i:i=vl(e,t,n,r)(o=s)},extent:function(s){return arguments.length?(e=+s[0][0],t=+s[0][1],n=+s[1][0],r=+s[1][1],i=o=null,a):[[e,t],[n,r]]}}}var ch,fh,Sl,Tl,yi={sphere:Ae,point:Ae,lineStart:v8,lineEnd:Ae,polygonStart:Ae,polygonEnd:Ae};function v8(){yi.point=T8,yi.lineEnd=S8}function S8(){yi.point=yi.lineEnd=Ae}function T8(e,t){e*=se,t*=se,fh=e,Sl=ne(t),Tl=oe(t),yi.point=_8}function _8(e,t){e*=se,t*=se;var n=ne(t),r=oe(t),i=de(e-fh),o=oe(i),a=ne(i),s=r*a,l=Tl*n-Sl*r*o,u=Sl*n+Tl*r*o;ch.add(et(Be(s*s+l*l),u)),fh=e,Sl=n,Tl=r}function zb(e){return ch=new Me,zt(e,yi),+ch}var hh=[null,null],A8={type:"LineString",coordinates:hh};function _l(e,t){return hh[0]=e,hh[1]=t,zb(A8)}var Ob={Feature:function(e,t){return Al(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)if(Al(n[r].geometry,t))return!0;return!1}},Gb={Sphere:function(){return!0},Point:function(e,t){return Wb(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(Wb(n[r],t))return!0;return!1},LineString:function(e,t){return Vb(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(Vb(n[r],t))return!0;return!1},Polygon:function(e,t){return Yb(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(Yb(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)if(Al(n[r],t))return!0;return!1}};function Al(e,t){return e&&Gb.hasOwnProperty(e.type)?Gb[e.type](e,t):!1}function Wb(e,t){return _l(e,t)===0}function Vb(e,t){for(var n,r,i,o=0,a=e.length;o<a;o++){if(r=_l(e[o],t),r===0||o>0&&(i=_l(e[o],e[o-1]),i>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<No*i))return!0;n=r}return!1}function Yb(e,t){return!!Bb(e.map(w8),Xb(t))}function w8(e){return e=e.map(Xb),e.pop(),e}function Xb(e){return[e[0]*se,e[1]*se]}function P8(e,t){return(e&&Ob.hasOwnProperty(e.type)?Ob[e.type]:Al)(e,t)}function Ub(e,t,n){var r=Cn(e,t-ae,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function jb(e,t,n){var r=Cn(e,t-ae,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function Hb(){var e,t,n,r,i,o,a,s,l=10,u=l,c=90,h=360,f,p,g,m,d=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Cn(nl(r/c)*c,n,c).map(g).concat(Cn(nl(s/h)*h,a,h).map(m)).concat(Cn(nl(t/l)*l,e,l).filter(function(x){return de(x%c)>ae}).map(f)).concat(Cn(nl(o/u)*u,i,u).filter(function(x){return de(x%h)>ae}).map(p))}return y.lines=function(){return b().map(function(x){return{type:"LineString",coordinates:x}})},y.outline=function(){return{type:"Polygon",coordinates:[g(r).concat(m(a).slice(1),g(n).reverse().slice(1),m(s).reverse().slice(1))]}},y.extent=function(x){return arguments.length?y.extentMajor(x).extentMinor(x):y.extentMinor()},y.extentMajor=function(x){return arguments.length?(r=+x[0][0],n=+x[1][0],s=+x[0][1],a=+x[1][1],r>n&&(x=r,r=n,n=x),s>a&&(x=s,s=a,a=x),y.precision(d)):[[r,s],[n,a]]},y.extentMinor=function(x){return arguments.length?(t=+x[0][0],e=+x[1][0],o=+x[0][1],i=+x[1][1],t>e&&(x=t,t=e,e=x),o>i&&(x=o,o=i,i=x),y.precision(d)):[[t,o],[e,i]]},y.step=function(x){return arguments.length?y.stepMajor(x).stepMinor(x):y.stepMinor()},y.stepMajor=function(x){return arguments.length?(c=+x[0],h=+x[1],y):[c,h]},y.stepMinor=function(x){return arguments.length?(l=+x[0],u=+x[1],y):[l,u]},y.precision=function(x){return arguments.length?(d=+x,f=Ub(o,i,90),p=jb(t,e,d),g=Ub(s,a,90),m=jb(r,n,d),y):d},y.extentMajor([[-180,-90+ae],[180,90-ae]]).extentMinor([[-180,-80-ae],[180,80+ae]])}function D8(){return Hb()()}function C8(e,t){var n=e[0]*se,r=e[1]*se,i=t[0]*se,o=t[1]*se,a=oe(r),s=ne(r),l=oe(o),u=ne(o),c=a*oe(n),h=a*ne(n),f=l*oe(i),p=l*ne(i),g=2*tt(Be(lb(o-r)+a*l*lb(i-n))),m=ne(g),d=g?function(y){var b=ne(y*=g)/m,x=ne(g-y)/m,$=x*c+b*f,S=x*h+b*p,_=x*s+b*u;return[et(S,$)*$e,et(_,Be($*$+S*S))*$e]}:function(){return[n*$e,r*$e]};return d.distance=g,d}const Wo=e=>e;var ph=new Me,gh=new Me,qb,Zb,dh,mh,gn={point:Ae,lineStart:Ae,lineEnd:Ae,polygonStart:function(){gn.lineStart=L8,gn.lineEnd=k8},polygonEnd:function(){gn.lineStart=gn.lineEnd=gn.point=Ae,ph.add(de(gh)),gh=new Me},result:function(){var e=ph/2;return ph=new Me,e}};function L8(){gn.point=M8}function M8(e,t){gn.point=Kb,qb=dh=e,Zb=mh=t}function Kb(e,t){gh.add(mh*e-dh*t),dh=e,mh=t}function k8(){Kb(qb,Zb)}var bi=1/0,wl=bi,Vo=-bi,Pl=Vo,Dl={point:R8,lineStart:Ae,lineEnd:Ae,polygonStart:Ae,polygonEnd:Ae,result:function(){var e=[[bi,wl],[Vo,Pl]];return Vo=Pl=-(wl=bi=1/0),e}};function R8(e,t){e<bi&&(bi=e),e>Vo&&(Vo=e),t<wl&&(wl=t),t>Pl&&(Pl=t)}var yh=0,bh=0,Yo=0,Cl=0,Ll=0,xi=0,xh=0,$h=0,Xo=0,Qb,Jb,Kt,Qt,Tt={point:yr,lineStart:e1,lineEnd:t1,polygonStart:function(){Tt.lineStart=B8,Tt.lineEnd=N8},polygonEnd:function(){Tt.point=yr,Tt.lineStart=e1,Tt.lineEnd=t1},result:function(){var e=Xo?[xh/Xo,$h/Xo]:xi?[Cl/xi,Ll/xi]:Yo?[yh/Yo,bh/Yo]:[NaN,NaN];return yh=bh=Yo=Cl=Ll=xi=xh=$h=Xo=0,e}};function yr(e,t){yh+=e,bh+=t,++Yo}function e1(){Tt.point=I8}function I8(e,t){Tt.point=E8,yr(Kt=e,Qt=t)}function E8(e,t){var n=e-Kt,r=t-Qt,i=Be(n*n+r*r);Cl+=i*(Kt+e)/2,Ll+=i*(Qt+t)/2,xi+=i,yr(Kt=e,Qt=t)}function t1(){Tt.point=yr}function B8(){Tt.point=F8}function N8(){n1(Qb,Jb)}function F8(e,t){Tt.point=n1,yr(Qb=Kt=e,Jb=Qt=t)}function n1(e,t){var n=e-Kt,r=t-Qt,i=Be(n*n+r*r);Cl+=i*(Kt+e)/2,Ll+=i*(Qt+t)/2,xi+=i,i=Qt*e-Kt*t,xh+=i*(Kt+e),$h+=i*(Qt+t),Xo+=i*3,yr(Kt=e,Qt=t)}function r1(e){this._context=e}r1.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Je);break}}},result:Ae};var vh=new Me,Sh,i1,o1,Uo,jo,Ho={point:Ae,lineStart:function(){Ho.point=z8},lineEnd:function(){Sh&&a1(i1,o1),Ho.point=Ae},polygonStart:function(){Sh=!0},polygonEnd:function(){Sh=null},result:function(){var e=+vh;return vh=new Me,e}};function z8(e,t){Ho.point=a1,i1=Uo=e,o1=jo=t}function a1(e,t){Uo-=e,jo-=t,vh.add(Be(Uo*Uo+jo*jo)),Uo=e,jo=t}let s1,Ml,l1,u1;class c1{constructor(t){this._append=t==null?f1:O8(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==l1||this._append!==Ml){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,l1=r,Ml=this._append,u1=this._,this._=i}this._+=u1;break}}}result(){const t=this._;return this._="",t.length?t:null}}function f1(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function O8(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return f1;if(t!==s1){const n=10**t;s1=t,Ml=function(i){let o=1;this._+=i[0];for(const a=i.length;o<a;++o)this._+=Math.round(arguments[o]*n)/n+i[o]}}return Ml}function G8(e,t){let n=3,r=4.5,i,o;function a(s){return s&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),zt(s,i(o))),o.result()}return a.area=function(s){return zt(s,i(gn)),gn.result()},a.measure=function(s){return zt(s,i(Ho)),Ho.result()},a.bounds=function(s){return zt(s,i(Dl)),Dl.result()},a.centroid=function(s){return zt(s,i(Tt)),Tt.result()},a.projection=function(s){return arguments.length?(i=s==null?(e=null,Wo):(e=s).stream,a):e},a.context=function(s){return arguments.length?(o=s==null?(t=null,new c1(n)):new r1(t=s),typeof r!="function"&&o.pointRadius(r),a):t},a.pointRadius=function(s){return arguments.length?(r=typeof s=="function"?s:(o.pointRadius(+s),+s),a):r},a.digits=function(s){if(!arguments.length)return n;if(s==null)n=null;else{const l=Math.floor(s);if(!(l>=0))throw new RangeError(`invalid digits: ${s}`);n=l}return t===null&&(o=new c1(n)),a},a.projection(e).digits(n).context(t)}function W8(e){return{stream:qo(e)}}function qo(e){return function(t){var n=new Th;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Th(){}Th.prototype={constructor:Th,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function _h(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),zt(n,e.stream(Dl)),t(Dl.result()),r!=null&&e.clipExtent(r),e}function kl(e,t,n){return _h(e,function(r){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],a=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),s=+t[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(o-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([s,l])},n)}function Ah(e,t,n){return kl(e,[[0,0],t],n)}function wh(e,t,n){return _h(e,function(r){var i=+t,o=i/(r[1][0]-r[0][0]),a=(i-o*(r[1][0]+r[0][0]))/2,s=-o*r[0][1];e.scale(150*o).translate([a,s])},n)}function Ph(e,t,n){return _h(e,function(r){var i=+t,o=i/(r[1][1]-r[0][1]),a=-o*r[0][0],s=(i-o*(r[1][1]+r[0][1]))/2;e.scale(150*o).translate([a,s])},n)}var h1=16,V8=oe(30*se);function p1(e,t){return+t?X8(e,t):Y8(e)}function Y8(e){return qo({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function X8(e,t){function n(r,i,o,a,s,l,u,c,h,f,p,g,m,d){var y=u-r,b=c-i,x=y*y+b*b;if(x>4*t&&m--){var $=a+f,S=s+p,_=l+g,A=Be($*$+S*S+_*_),w=tt(_/=A),P=de(de(_)-1)<ae||de(o-h)<ae?(o+h)/2:et(S,$),I=e(P,w),v=I[0],N=I[1],R=v-r,D=N-i,T=b*R-y*D;(T*T/x>t||de((y*R+b*D)/x-.5)>.3||a*f+s*p+l*g<V8)&&(n(r,i,o,a,s,l,v,N,P,$/=A,S/=A,_,m,d),d.point(v,N),n(v,N,P,$,S,_,u,c,h,f,p,g,m,d))}}return function(r){var i,o,a,s,l,u,c,h,f,p,g,m,d={point:y,lineStart:b,lineEnd:$,polygonStart:function(){r.polygonStart(),d.lineStart=S},polygonEnd:function(){r.polygonEnd(),d.lineStart=b}};function y(w,P){w=e(w,P),r.point(w[0],w[1])}function b(){h=NaN,d.point=x,r.lineStart()}function x(w,P){var I=dr([w,P]),v=e(w,P);n(h,f,c,p,g,m,h=v[0],f=v[1],c=w,p=I[0],g=I[1],m=I[2],h1,r),r.point(h,f)}function $(){d.point=y,r.lineEnd()}function S(){b(),d.point=_,d.lineEnd=A}function _(w,P){x(i=w,P),o=h,a=f,s=p,l=g,u=m,d.point=x}function A(){n(h,f,c,p,g,m,o,a,i,s,l,u,h1,r),d.lineEnd=$,$()}return d}}var U8=qo({point:function(e,t){this.stream.point(e*se,t*se)}});function j8(e){return qo({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function H8(e,t,n,r,i){function o(a,s){return a*=r,s*=i,[t+e*a,n-e*s]}return o.invert=function(a,s){return[(a-t)/e*r,(n-s)/e*i]},o}function g1(e,t,n,r,i,o){if(!o)return H8(e,t,n,r,i);var a=oe(o),s=ne(o),l=a*e,u=s*e,c=a/e,h=s/e,f=(s*n-a*t)/e,p=(s*t+a*n)/e;function g(m,d){return m*=r,d*=i,[l*m-u*d+t,n-u*m-l*d]}return g.invert=function(m,d){return[r*(c*m-h*d+f),i*(p-h*m-c*d)]},g}function Jt(e){return Dh(function(){return e})()}function Dh(e){var t,n=150,r=480,i=250,o=0,a=0,s=0,l=0,u=0,c,h=0,f=1,p=1,g=null,m=uh,d=null,y,b,x,$=Wo,S=.5,_,A,w,P,I;function v(T){return w(T[0]*se,T[1]*se)}function N(T){return T=w.invert(T[0],T[1]),T&&[T[0]*$e,T[1]*$e]}v.stream=function(T){return P&&I===T?P:P=U8(j8(c)(m(_($(I=T)))))},v.preclip=function(T){return arguments.length?(m=T,g=void 0,D()):m},v.postclip=function(T){return arguments.length?($=T,d=y=b=x=null,D()):$},v.clipAngle=function(T){return arguments.length?(m=+T?Fb(g=T*se):(g=null,uh),D()):g*$e},v.clipExtent=function(T){return arguments.length?($=T==null?(d=y=b=x=null,Wo):vl(d=+T[0][0],y=+T[0][1],b=+T[1][0],x=+T[1][1]),D()):d==null?null:[[d,y],[b,x]]},v.scale=function(T){return arguments.length?(n=+T,R()):n},v.translate=function(T){return arguments.length?(r=+T[0],i=+T[1],R()):[r,i]},v.center=function(T){return arguments.length?(o=T[0]%360*se,a=T[1]%360*se,R()):[o*$e,a*$e]},v.rotate=function(T){return arguments.length?(s=T[0]%360*se,l=T[1]%360*se,u=T.length>2?T[2]%360*se:0,R()):[s*$e,l*$e,u*$e]},v.angle=function(T){return arguments.length?(h=T%360*se,R()):h*$e},v.reflectX=function(T){return arguments.length?(f=T?-1:1,R()):f<0},v.reflectY=function(T){return arguments.length?(p=T?-1:1,R()):p<0},v.precision=function(T){return arguments.length?(_=p1(A,S=T*T),D()):Be(S)},v.fitExtent=function(T,M){return kl(v,T,M)},v.fitSize=function(T,M){return Ah(v,T,M)},v.fitWidth=function(T,M){return wh(v,T,M)},v.fitHeight=function(T,M){return Ph(v,T,M)};function R(){var T=g1(n,0,0,f,p,h).apply(null,t(o,a)),M=g1(n,r-T[0],i-T[1],f,p,h);return c=sh(s,l,u),A=oh(t,M),w=oh(c,A),_=p1(A,S),D()}function D(){return P=I=null,v}return function(){return t=e.apply(this,arguments),v.invert=t.invert&&N,R()}}function Ch(e){var t=0,n=ge/3,r=Dh(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*se,n=o[1]*se):[t*$e,n*$e]},i}function q8(e){var t=oe(e);function n(r,i){return[r*t,ne(i)/t]}return n.invert=function(r,i){return[r/t,tt(i*t)]},n}function d1(e,t){var n=ne(e),r=(n+ne(t))/2;if(de(r)<ae)return q8(e);var i=1+n*(2*r-n),o=Be(i)/r;function a(s,l){var u=Be(i-2*r*ne(l))/r;return[u*ne(s*=r),o-u*oe(s)]}return a.invert=function(s,l){var u=o-l,c=et(s,de(u))*St(u);return u*r<0&&(c-=ge*St(s)*St(u)),[c/r,tt((i-(s*s+u*u)*r*r)/(2*r))]},a}function Rl(){return Ch(d1).scale(155.424).center([0,33.6442])}function m1(){return Rl().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Z8(e){var t=e.length;return{point:function(n,r){for(var i=-1;++i<t;)e[i].point(n,r)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function K8(){var e,t,n=m1(),r,i=Rl().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,a=Rl().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s,l,u={point:function(f,p){l=[f,p]}};function c(f){var p=f[0],g=f[1];return l=null,r.point(p,g),l||(o.point(p,g),l)||(s.point(p,g),l)}c.invert=function(f){var p=n.scale(),g=n.translate(),m=(f[0]-g[0])/p,d=(f[1]-g[1])/p;return(d>=.12&&d<.234&&m>=-.425&&m<-.214?i:d>=.166&&d<.234&&m>=-.214&&m<-.115?a:n).invert(f)},c.stream=function(f){return e&&t===f?e:e=Z8([n.stream(t=f),i.stream(f),a.stream(f)])},c.precision=function(f){return arguments.length?(n.precision(f),i.precision(f),a.precision(f),h()):n.precision()},c.scale=function(f){return arguments.length?(n.scale(f),i.scale(f*.35),a.scale(f),c.translate(n.translate())):n.scale()},c.translate=function(f){if(!arguments.length)return n.translate();var p=n.scale(),g=+f[0],m=+f[1];return r=n.translate(f).clipExtent([[g-.455*p,m-.238*p],[g+.455*p,m+.238*p]]).stream(u),o=i.translate([g-.307*p,m+.201*p]).clipExtent([[g-.425*p+ae,m+.12*p+ae],[g-.214*p-ae,m+.234*p-ae]]).stream(u),s=a.translate([g-.205*p,m+.212*p]).clipExtent([[g-.214*p+ae,m+.166*p+ae],[g-.115*p-ae,m+.234*p-ae]]).stream(u),h()},c.fitExtent=function(f,p){return kl(c,f,p)},c.fitSize=function(f,p){return Ah(c,f,p)},c.fitWidth=function(f,p){return wh(c,f,p)},c.fitHeight=function(f,p){return Ph(c,f,p)};function h(){return e=t=null,c}return c.scale(1070)}function y1(e){return function(t,n){var r=oe(t),i=oe(n),o=e(r*i);return o===1/0?[2,0]:[o*i*ne(t),o*ne(n)]}}function Zo(e){return function(t,n){var r=Be(t*t+n*n),i=e(r),o=ne(i),a=oe(i);return[et(t*o,r*a),tt(r&&n*o/r)]}}var Lh=y1(function(e){return Be(2/(1+e))});Lh.invert=Zo(function(e){return 2*tt(e/2)});function Q8(){return Jt(Lh).scale(124.75).clipAngle(180-.001)}var Mh=y1(function(e){return(e=sb(e))&&e/ne(e)});Mh.invert=Zo(function(e){return e});function J8(){return Jt(Mh).scale(79.4188).clipAngle(180-.001)}function Ko(e,t){return[e,rl(Hf((Pe+t)/2))]}Ko.invert=function(e,t){return[e,2*pi(ab(t))-Pe]};function e4(){return b1(Ko).scale(961/Je)}function b1(e){var t=Jt(e),n=t.center,r=t.scale,i=t.translate,o=t.clipExtent,a=null,s,l,u;t.scale=function(h){return arguments.length?(r(h),c()):r()},t.translate=function(h){return arguments.length?(i(h),c()):i()},t.center=function(h){return arguments.length?(n(h),c()):n()},t.clipExtent=function(h){return arguments.length?(h==null?a=s=l=u=null:(a=+h[0][0],s=+h[0][1],l=+h[1][0],u=+h[1][1]),c()):a==null?null:[[a,s],[l,u]]};function c(){var h=ge*r(),f=t(Lb(t.rotate()).invert([0,0]));return o(a==null?[[f[0]-h,f[1]-h],[f[0]+h,f[1]+h]]:e===Ko?[[Math.max(f[0]-h,a),s],[Math.min(f[0]+h,l),u]]:[[a,Math.max(f[1]-h,s)],[l,Math.min(f[1]+h,u)]])}return c()}function Il(e){return Hf((Pe+e)/2)}function x1(e,t){var n=oe(e),r=e===t?ne(e):rl(n/oe(t))/rl(Il(t)/Il(e)),i=n*jf(Il(e),r)/r;if(!r)return Ko;function o(a,s){i>0?s<-Pe+ae&&(s=-Pe+ae):s>Pe-ae&&(s=Pe-ae);var l=i/jf(Il(s),r);return[l*ne(r*a),i-l*oe(r*a)]}return o.invert=function(a,s){var l=i-s,u=St(r)*Be(a*a+l*l),c=et(a,de(l))*St(l);return l*r<0&&(c-=ge*St(a)*St(l)),[c/r,2*pi(jf(i/u,1/r))-Pe]},o}function t4(){return Ch(x1).scale(109.5).parallels([30,30])}function Qo(e,t){return[e,t]}Qo.invert=Qo;function n4(){return Jt(Qo).scale(152.63)}function $1(e,t){var n=oe(e),r=e===t?ne(e):(n-oe(t))/(t-e),i=n/r+e;if(de(r)<ae)return Qo;function o(a,s){var l=i-s,u=r*a;return[l*ne(u),i-l*oe(u)]}return o.invert=function(a,s){var l=i-s,u=et(a,de(l))*St(l);return l*r<0&&(u-=ge*St(a)*St(l)),[u/r,i-St(r)*Be(a*a+l*l)]},o}function r4(){return Ch($1).scale(131.154).center([0,13.9389])}var Jo=1.340264,ea=-.081106,ta=893e-6,na=.003796,El=Be(3)/2,i4=12;function kh(e,t){var n=tt(El*ne(t)),r=n*n,i=r*r*r;return[e*oe(n)/(El*(Jo+3*ea*r+i*(7*ta+9*na*r))),n*(Jo+ea*r+i*(ta+na*r))]}kh.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,o=0,a,s,l;o<i4&&(s=n*(Jo+ea*r+i*(ta+na*r))-t,l=Jo+3*ea*r+i*(7*ta+9*na*r),n-=a=s/l,r=n*n,i=r*r*r,!(de(a)<No));++o);return[El*e*(Jo+3*ea*r+i*(7*ta+9*na*r))/oe(n),tt(ne(n)/El)]};function o4(){return Jt(kh).scale(177.158)}function Rh(e,t){var n=oe(t),r=oe(e)*n;return[n*ne(e)/r,ne(t)/r]}Rh.invert=Zo(pi);function a4(){return Jt(Rh).scale(144.049).clipAngle(60)}function s4(){var e=1,t=0,n=0,r=1,i=1,o=0,a,s,l=null,u,c,h,f=1,p=1,g=qo({point:function($,S){var _=x([$,S]);this.stream.point(_[0],_[1])}}),m=Wo,d,y;function b(){return f=e*r,p=e*i,d=y=null,x}function x($){var S=$[0]*f,_=$[1]*p;if(o){var A=_*a-S*s;S=S*a+_*s,_=A}return[S+t,_+n]}return x.invert=function($){var S=$[0]-t,_=$[1]-n;if(o){var A=_*a+S*s;S=S*a-_*s,_=A}return[S/f,_/p]},x.stream=function($){return d&&y===$?d:d=g(m(y=$))},x.postclip=function($){return arguments.length?(m=$,l=u=c=h=null,b()):m},x.clipExtent=function($){return arguments.length?(m=$==null?(l=u=c=h=null,Wo):vl(l=+$[0][0],u=+$[0][1],c=+$[1][0],h=+$[1][1]),b()):l==null?null:[[l,u],[c,h]]},x.scale=function($){return arguments.length?(e=+$,b()):e},x.translate=function($){return arguments.length?(t=+$[0],n=+$[1],b()):[t,n]},x.angle=function($){return arguments.length?(o=$%360*se,s=ne(o),a=oe(o),b()):o*$e},x.reflectX=function($){return arguments.length?(r=$?-1:1,b()):r<0},x.reflectY=function($){return arguments.length?(i=$?-1:1,b()):i<0},x.fitExtent=function($,S){return kl(x,$,S)},x.fitSize=function($,S){return Ah(x,$,S)},x.fitWidth=function($,S){return wh(x,$,S)},x.fitHeight=function($,S){return Ph(x,$,S)},x}function Ih(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}Ih.invert=function(e,t){var n=t,r=25,i;do{var o=n*n,a=o*o;n-=i=(n*(1.007226+o*(.015085+a*(-.044475+.028874*o-.005916*a)))-t)/(1.007226+o*(.015085*3+a*(-.044475*7+.028874*9*o-.005916*11*a)))}while(de(i)>ae&&--r>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function l4(){return Jt(Ih).scale(175.295)}function Eh(e,t){return[oe(t)*ne(e),ne(t)]}Eh.invert=Zo(tt);function u4(){return Jt(Eh).scale(249.5).clipAngle(90+ae)}function Bh(e,t){var n=oe(t),r=1+oe(e)*n;return[n*ne(e)/r,ne(t)/r]}Bh.invert=Zo(function(e){return 2*pi(e)});function c4(){return Jt(Bh).scale(250).clipAngle(142)}function Nh(e,t){return[rl(Hf((Pe+t)/2)),-e]}Nh.invert=function(e,t){return[-t,2*pi(ab(e))-Pe]};function f4(){var e=b1(Nh),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}function h4(e,t){return e.parent===t.parent?1:2}function p4(e){return e.reduce(g4,0)/e.length}function g4(e,t){return e+t.x}function d4(e){return 1+e.reduce(m4,0)}function m4(e,t){return Math.max(e,t.y)}function y4(e){for(var t;t=e.children;)e=t[0];return e}function b4(e){for(var t;t=e.children;)e=t[t.length-1];return e}function x4(){var e=h4,t=1,n=1,r=!1;function i(o){var a,s=0;o.eachAfter(function(f){var p=f.children;p?(f.x=p4(p),f.y=d4(p)):(f.x=a?s+=e(f,a):0,f.y=0,a=f)});var l=y4(o),u=b4(o),c=l.x-e(l,u)/2,h=u.x+e(u,l)/2;return o.eachAfter(r?function(f){f.x=(f.x-o.x)*t,f.y=(o.y-f.y)*n}:function(f){f.x=(f.x-c)/(h-c)*t,f.y=(1-(o.y?f.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(e=o,i):e},i.size=function(o){return arguments.length?(r=!1,t=+o[0],n=+o[1],i):r?null:[t,n]},i.nodeSize=function(o){return arguments.length?(r=!0,t=+o[0],n=+o[1],i):r?[t,n]:null},i}function $4(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function v4(){return this.eachAfter($4)}function S4(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function T4(e,t){for(var n=this,r=[n],i,o,a=-1;n=r.pop();)if(e.call(t,n,++a,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function _4(e,t){for(var n=this,r=[n],i=[],o,a,s,l=-1;n=r.pop();)if(i.push(n),o=n.children)for(a=0,s=o.length;a<s;++a)r.push(o[a]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function A4(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function w4(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function P4(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function D4(e){for(var t=this,n=C4(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function C4(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function L4(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function M4(){return Array.from(this)}function k4(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function R4(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*I4(){var e=this,t,n=[e],r,i,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,o=r.length;i<o;++i)n.push(r[i]);while(n.length)}function Bl(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=N4)):t===void 0&&(t=B4);for(var n=new br(e),r,i=[n],o,a,s,l;r=i.pop();)if((a=t(r.data))&&(l=(a=Array.from(a)).length))for(r.children=a,s=l-1;s>=0;--s)i.push(o=a[s]=new br(a[s])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(v1)}function E4(){return Bl(this).eachBefore(F4)}function B4(e){return e.children}function N4(e){return Array.isArray(e)?e[1]:null}function F4(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function v1(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function br(e){this.data=e,this.depth=this.height=0,this.parent=null}br.prototype=Bl.prototype={constructor:br,count:v4,each:S4,eachAfter:_4,eachBefore:T4,find:A4,sum:w4,sort:P4,path:D4,ancestors:L4,descendants:M4,leaves:k4,links:R4,copy:E4,[Symbol.iterator]:I4};function Nl(e){return e==null?null:S1(e)}function S1(e){if(typeof e!="function")throw new Error;return e}function xr(){return 0}function $i(e){return function(){return e}}const z4=1664525,O4=1013904223,T1=4294967296;function Fh(){let e=1;return()=>(e=(z4*e+O4)%T1)/T1}function G4(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function W4(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function V4(e){return _1(e,Fh())}function _1(e,t){for(var n=0,r=(e=W4(Array.from(e),t)).length,i=[],o,a;n<r;)o=e[n],a&&A1(a,o)?++n:(a=X4(i=Y4(i,o)),n=0);return a}function Y4(e,t){var n,r;if(zh(t,e))return[t];for(n=0;n<e.length;++n)if(Fl(t,e[n])&&zh(ra(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(Fl(ra(e[n],e[r]),t)&&Fl(ra(e[n],t),e[r])&&Fl(ra(e[r],t),e[n])&&zh(w1(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function Fl(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function A1(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function zh(e,t){for(var n=0;n<t.length;++n)if(!A1(e,t[n]))return!1;return!0}function X4(e){switch(e.length){case 1:return U4(e[0]);case 2:return ra(e[0],e[1]);case 3:return w1(e[0],e[1],e[2])}}function U4(e){return{x:e.x,y:e.y,r:e.r}}function ra(e,t){var n=e.x,r=e.y,i=e.r,o=t.x,a=t.y,s=t.r,l=o-n,u=a-r,c=s-i,h=Math.sqrt(l*l+u*u);return{x:(n+o+l/h*c)/2,y:(r+a+u/h*c)/2,r:(h+i+s)/2}}function w1(e,t,n){var r=e.x,i=e.y,o=e.r,a=t.x,s=t.y,l=t.r,u=n.x,c=n.y,h=n.r,f=r-a,p=r-u,g=i-s,m=i-c,d=l-o,y=h-o,b=r*r+i*i-o*o,x=b-a*a-s*s+l*l,$=b-u*u-c*c+h*h,S=p*g-f*m,_=(g*$-m*x)/(S*2)-r,A=(m*d-g*y)/S,w=(p*x-f*$)/(S*2)-i,P=(f*y-p*d)/S,I=A*A+P*P-1,v=2*(o+_*A+w*P),N=_*_+w*w-o*o,R=-(Math.abs(I)>1e-6?(v+Math.sqrt(v*v-4*I*N))/(2*I):N/v);return{x:r+_+A*R,y:i+w+P*R,r:R}}function P1(e,t,n){var r=e.x-t.x,i,o,a=e.y-t.y,s,l,u=r*r+a*a;u?(o=t.r+n.r,o*=o,l=e.r+n.r,l*=l,o>l?(i=(u+l-o)/(2*u),s=Math.sqrt(Math.max(0,l/u-i*i)),n.x=e.x-i*r-s*a,n.y=e.y-i*a+s*r):(i=(u+o-l)/(2*u),s=Math.sqrt(Math.max(0,o/u-i*i)),n.x=t.x+i*r-s*a,n.y=t.y+i*a+s*r)):(n.x=t.x+n.r,n.y=t.y)}function D1(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function C1(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,o=(t.y*n.r+n.y*t.r)/r;return i*i+o*o}function zl(e){this._=e,this.next=null,this.previous=null}function L1(e,t){if(!(o=(e=G4(e)).length))return 0;var n,r,i,o,a,s,l,u,c,h,f;if(n=e[0],n.x=0,n.y=0,!(o>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;P1(r,n,i=e[2]),n=new zl(n),r=new zl(r),i=new zl(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(l=3;l<o;++l){P1(n._,r._,i=e[l]),i=new zl(i),u=r.next,c=n.previous,h=r._.r,f=n._.r;do if(h<=f){if(D1(u._,i._)){r=u,n.next=r,r.previous=n,--l;continue e}h+=u._.r,u=u.next}else{if(D1(c._,i._)){n=c,n.next=r,r.previous=n,--l;continue e}f+=c._.r,c=c.previous}while(u!==c.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=C1(n);(i=i.next)!==r;)(s=C1(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=_1(n,t),l=0;l<o;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function j4(e){return L1(e,Fh()),e}function H4(e){return Math.sqrt(e.value)}function q4(){var e=null,t=1,n=1,r=xr;function i(o){const a=Fh();return o.x=t/2,o.y=n/2,e?o.eachBefore(M1(e)).eachAfter(Oh(r,.5,a)).eachBefore(k1(1)):o.eachBefore(M1(H4)).eachAfter(Oh(xr,1,a)).eachAfter(Oh(r,o.r/Math.min(t,n),a)).eachBefore(k1(Math.min(t,n)/(2*o.r))),o}return i.radius=function(o){return arguments.length?(e=Nl(o),i):e},i.size=function(o){return arguments.length?(t=+o[0],n=+o[1],i):[t,n]},i.padding=function(o){return arguments.length?(r=typeof o=="function"?o:$i(+o),i):r},i}function M1(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Oh(e,t,n){return function(r){if(i=r.children){var i,o,a=i.length,s=e(r)*t||0,l;if(s)for(o=0;o<a;++o)i[o].r+=s;if(l=L1(i,n),s)for(o=0;o<a;++o)i[o].r-=s;r.r=l+s}}}function k1(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function R1(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ia(e,t,n,r,i){for(var o=e.children,a,s=-1,l=o.length,u=e.value&&(r-t)/e.value;++s<l;)a=o[s],a.y0=n,a.y1=i,a.x0=t,a.x1=t+=a.value*u}function Z4(){var e=1,t=1,n=0,r=!1;function i(a){var s=a.height+1;return a.x0=a.y0=n,a.x1=e,a.y1=t/s,a.eachBefore(o(t,s)),r&&a.eachBefore(R1),a}function o(a,s){return function(l){l.children&&ia(l,l.x0,a*(l.depth+1)/s,l.x1,a*(l.depth+2)/s);var u=l.x0,c=l.y0,h=l.x1-n,f=l.y1-n;h<u&&(u=h=(u+h)/2),f<c&&(c=f=(c+f)/2),l.x0=u,l.y0=c,l.x1=h,l.y1=f}}return i.round=function(a){return arguments.length?(r=!!a,i):r},i.size=function(a){return arguments.length?(e=+a[0],t=+a[1],i):[e,t]},i.padding=function(a){return arguments.length?(n=+a,i):n},i}var K4={depth:-1},I1={},Gh={};function Q4(e){return e.id}function J4(e){return e.parentId}function eR(){var e=Q4,t=J4,n;function r(i){var o=Array.from(i),a=e,s=t,l,u,c,h,f,p,g,m,d=new Map;if(n!=null){const y=o.map(($,S)=>tR(n($,S,i))),b=y.map(E1),x=new Set(y).add("");for(const $ of b)x.has($)||(x.add($),y.push($),b.push(E1($)),o.push(Gh));a=($,S)=>y[S],s=($,S)=>b[S]}for(c=0,l=o.length;c<l;++c)u=o[c],p=o[c]=new br(u),(g=a(u,c,i))!=null&&(g+="")&&(m=p.id=g,d.set(m,d.has(m)?I1:p)),(g=s(u,c,i))!=null&&(g+="")&&(p.parent=g);for(c=0;c<l;++c)if(p=o[c],g=p.parent){if(f=d.get(g),!f)throw new Error("missing: "+g);if(f===I1)throw new Error("ambiguous: "+g);f.children?f.children.push(p):f.children=[p],p.parent=f}else{if(h)throw new Error("multiple roots");h=p}if(!h)throw new Error("no root");if(n!=null){for(;h.data===Gh&&h.children.length===1;)h=h.children[0],--l;for(let y=o.length-1;y>=0&&(p=o[y],p.data===Gh);--y)p.data=null}if(h.parent=K4,h.eachBefore(function(y){y.depth=y.parent.depth+1,--l}).eachBefore(v1),h.parent=null,l>0)throw new Error("cycle");return h}return r.id=function(i){return arguments.length?(e=Nl(i),r):e},r.parentId=function(i){return arguments.length?(t=Nl(i),r):t},r.path=function(i){return arguments.length?(n=Nl(i),r):n},r}function tR(e){e=`${e}`;let t=e.length;return Wh(e,t-1)&&!Wh(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function E1(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Wh(e,t););return e.slice(0,t)}function Wh(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function nR(e,t){return e.parent===t.parent?1:2}function Vh(e){var t=e.children;return t?t[0]:e.t}function Yh(e){var t=e.children;return t?t[t.length-1]:e.t}function rR(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function iR(e){for(var t=0,n=0,r=e.children,i=r.length,o;--i>=0;)o=r[i],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function oR(e,t,n){return e.a.parent===t.parent?e.a:n}function Ol(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Ol.prototype=Object.create(br.prototype);function aR(e){for(var t=new Ol(e,0),n,r=[t],i,o,a,s;n=r.pop();)if(o=n._.children)for(n.children=new Array(s=o.length),a=s-1;a>=0;--a)r.push(i=n.children[a]=new Ol(o[a],a)),i.parent=n;return(t.parent=new Ol(null,0)).children=[t],t}function sR(){var e=nR,t=1,n=1,r=null;function i(u){var c=aR(u);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)u.eachBefore(l);else{var h=u,f=u,p=u;u.eachBefore(function(b){b.x<h.x&&(h=b),b.x>f.x&&(f=b),b.depth>p.depth&&(p=b)});var g=h===f?1:e(h,f)/2,m=g-h.x,d=t/(f.x+g+m),y=n/(p.depth||1);u.eachBefore(function(b){b.x=(b.x+m)*d,b.y=b.depth*y})}return u}function o(u){var c=u.children,h=u.parent.children,f=u.i?h[u.i-1]:null;if(c){iR(u);var p=(c[0].z+c[c.length-1].z)/2;f?(u.z=f.z+e(u._,f._),u.m=u.z-p):u.z=p}else f&&(u.z=f.z+e(u._,f._));u.parent.A=s(u,f,u.parent.A||h[0])}function a(u){u._.x=u.z+u.parent.m,u.m+=u.parent.m}function s(u,c,h){if(c){for(var f=u,p=u,g=c,m=f.parent.children[0],d=f.m,y=p.m,b=g.m,x=m.m,$;g=Yh(g),f=Vh(f),g&&f;)m=Vh(m),p=Yh(p),p.a=u,$=g.z+b-f.z-d+e(g._,f._),$>0&&(rR(oR(g,u,h),u,$),d+=$,y+=$),b+=g.m,d+=f.m,x+=m.m,y+=p.m;g&&!Yh(p)&&(p.t=g,p.m+=b-y),f&&!Vh(m)&&(m.t=f,m.m+=d-x,h=u)}return h}function l(u){u.x*=t,u.y=u.depth*n}return i.separation=function(u){return arguments.length?(e=u,i):e},i.size=function(u){return arguments.length?(r=!1,t=+u[0],n=+u[1],i):r?null:[t,n]},i.nodeSize=function(u){return arguments.length?(r=!0,t=+u[0],n=+u[1],i):r?[t,n]:null},i}function Gl(e,t,n,r,i){for(var o=e.children,a,s=-1,l=o.length,u=e.value&&(i-n)/e.value;++s<l;)a=o[s],a.x0=t,a.x1=r,a.y0=n,a.y1=n+=a.value*u}var B1=(1+Math.sqrt(5))/2;function N1(e,t,n,r,i,o){for(var a=[],s=t.children,l,u,c=0,h=0,f=s.length,p,g,m=t.value,d,y,b,x,$,S,_;c<f;){p=i-n,g=o-r;do d=s[h++].value;while(!d&&h<f);for(y=b=d,S=Math.max(g/p,p/g)/(m*e),_=d*d*S,$=Math.max(b/_,_/y);h<f;++h){if(d+=u=s[h].value,u<y&&(y=u),u>b&&(b=u),_=d*d*S,x=Math.max(b/_,_/y),x>$){d-=u;break}$=x}a.push(l={value:d,dice:p<g,children:s.slice(c,h)}),l.dice?ia(l,n,r,i,m?r+=g*d/m:o):Gl(l,n,r,m?n+=p*d/m:i,o),m-=d,c=h}return a}const Xh=function e(t){function n(r,i,o,a,s){N1(t,r,i,o,a,s)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(B1);function F1(){var e=Xh,t=!1,n=1,r=1,i=[0],o=xr,a=xr,s=xr,l=xr,u=xr;function c(f){return f.x0=f.y0=0,f.x1=n,f.y1=r,f.eachBefore(h),i=[0],t&&f.eachBefore(R1),f}function h(f){var p=i[f.depth],g=f.x0+p,m=f.y0+p,d=f.x1-p,y=f.y1-p;d<g&&(g=d=(g+d)/2),y<m&&(m=y=(m+y)/2),f.x0=g,f.y0=m,f.x1=d,f.y1=y,f.children&&(p=i[f.depth+1]=o(f)/2,g+=u(f)-p,m+=a(f)-p,d-=s(f)-p,y-=l(f)-p,d<g&&(g=d=(g+d)/2),y<m&&(m=y=(m+y)/2),e(f,g,m,d,y))}return c.round=function(f){return arguments.length?(t=!!f,c):t},c.size=function(f){return arguments.length?(n=+f[0],r=+f[1],c):[n,r]},c.tile=function(f){return arguments.length?(e=S1(f),c):e},c.padding=function(f){return arguments.length?c.paddingInner(f).paddingOuter(f):c.paddingInner()},c.paddingInner=function(f){return arguments.length?(o=typeof f=="function"?f:$i(+f),c):o},c.paddingOuter=function(f){return arguments.length?c.paddingTop(f).paddingRight(f).paddingBottom(f).paddingLeft(f):c.paddingTop()},c.paddingTop=function(f){return arguments.length?(a=typeof f=="function"?f:$i(+f),c):a},c.paddingRight=function(f){return arguments.length?(s=typeof f=="function"?f:$i(+f),c):s},c.paddingBottom=function(f){return arguments.length?(l=typeof f=="function"?f:$i(+f),c):l},c.paddingLeft=function(f){return arguments.length?(u=typeof f=="function"?f:$i(+f),c):u},c}function lR(e,t,n,r,i){var o=e.children,a,s=o.length,l,u=new Array(s+1);for(u[0]=l=a=0;a<s;++a)u[a+1]=l+=o[a].value;c(0,s,e.value,t,n,r,i);function c(h,f,p,g,m,d,y){if(h>=f-1){var b=o[h];b.x0=g,b.y0=m,b.x1=d,b.y1=y;return}for(var x=u[h],$=p/2+x,S=h+1,_=f-1;S<_;){var A=S+_>>>1;u[A]<$?S=A+1:_=A}$-u[S-1]<u[S]-$&&h+1<S&&--S;var w=u[S]-x,P=p-w;if(d-g>y-m){var I=p?(g*P+d*w)/p:d;c(h,S,w,g,m,I,y),c(S,f,P,I,m,d,y)}else{var v=p?(m*P+y*w)/p:y;c(h,S,w,g,m,d,v),c(S,f,P,g,v,d,y)}}}function uR(e,t,n,r,i){(e.depth&1?Gl:ia)(e,t,n,r,i)}const cR=function e(t){function n(r,i,o,a,s){if((l=r._squarify)&&l.ratio===t)for(var l,u,c,h,f=-1,p,g=l.length,m=r.value;++f<g;){for(u=l[f],c=u.children,h=u.value=0,p=c.length;h<p;++h)u.value+=c[h].value;u.dice?ia(u,i,o,a,m?o+=(s-o)*u.value/m:s):Gl(u,i,o,m?i+=(a-i)*u.value/m:a,s),m-=u.value}else r._squarify=l=N1(t,r,i,o,a,s),l.ratio=t}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(B1);function fR(e){for(var t=-1,n=e.length,r,i=e[n-1],o=0;++t<n;)r=i,i=e[t],o+=r[1]*i[0]-r[0]*i[1];return o/2}function hR(e){for(var t=-1,n=e.length,r=0,i=0,o,a=e[n-1],s,l=0;++t<n;)o=a,a=e[t],l+=s=o[0]*a[1]-a[0]*o[1],r+=(o[0]+a[0])*s,i+=(o[1]+a[1])*s;return l*=3,[r/l,i/l]}function pR(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function gR(e,t){return e[0]-t[0]||e[1]-t[1]}function z1(e){const t=e.length,n=[0,1];let r=2,i;for(i=2;i<t;++i){for(;r>1&&pR(e[n[r-2]],e[n[r-1]],e[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function dR(e){if((n=e.length)<3)return null;var t,n,r=new Array(n),i=new Array(n);for(t=0;t<n;++t)r[t]=[+e[t][0],+e[t][1],t];for(r.sort(gR),t=0;t<n;++t)i[t]=[r[t][0],-r[t][1]];var o=z1(r),a=z1(i),s=a[0]===o[0],l=a[a.length-1]===o[o.length-1],u=[];for(t=o.length-1;t>=0;--t)u.push(e[r[o[t]][2]]);for(t=+s;t<a.length-l;++t)u.push(e[r[a[t]][2]]);return u}function mR(e,t){for(var n=e.length,r=e[n-1],i=t[0],o=t[1],a=r[0],s=r[1],l,u,c=!1,h=0;h<n;++h)r=e[h],l=r[0],u=r[1],u>o!=s>o&&i<(a-l)*(o-u)/(s-u)+l&&(c=!c),a=l,s=u;return c}function yR(e){for(var t=-1,n=e.length,r=e[n-1],i,o,a=r[0],s=r[1],l=0;++t<n;)i=a,o=s,r=e[t],a=r[0],s=r[1],i-=a,o-=s,l+=Math.hypot(i,o);return l}const ze=Math.random,bR=function e(t){function n(r,i){return r=r==null?0:+r,i=i==null?1:+i,arguments.length===1?(i=r,r=0):i-=r,function(){return t()*i+r}}return n.source=e,n}(ze),xR=function e(t){function n(r,i){return arguments.length<2&&(i=r,r=0),r=Math.floor(r),i=Math.floor(i)-r,function(){return Math.floor(t()*i+r)}}return n.source=e,n}(ze),Uh=function e(t){function n(r,i){var o,a;return r=r==null?0:+r,i=i==null?1:+i,function(){var s;if(o!=null)s=o,o=null;else do o=t()*2-1,s=t()*2-1,a=o*o+s*s;while(!a||a>1);return r+i*s*Math.sqrt(-2*Math.log(a)/a)}}return n.source=e,n}(ze),$R=function e(t){var n=Uh.source(t);function r(){var i=n.apply(this,arguments);return function(){return Math.exp(i())}}return r.source=e,r}(ze),O1=function e(t){function n(r){return(r=+r)<=0?()=>0:function(){for(var i=0,o=r;o>1;--o)i+=t();return i+o*t()}}return n.source=e,n}(ze),vR=function e(t){var n=O1.source(t);function r(i){if((i=+i)==0)return t;var o=n(i);return function(){return o()/i}}return r.source=e,r}(ze),SR=function e(t){function n(r){return function(){return-Math.log1p(-t())/r}}return n.source=e,n}(ze),TR=function e(t){function n(r){if((r=+r)<0)throw new RangeError("invalid alpha");return r=1/-r,function(){return Math.pow(1-t(),r)}}return n.source=e,n}(ze),_R=function e(t){function n(r){if((r=+r)<0||r>1)throw new RangeError("invalid p");return function(){return Math.floor(t()+r)}}return n.source=e,n}(ze),G1=function e(t){function n(r){if((r=+r)<0||r>1)throw new RangeError("invalid p");return r===0?()=>1/0:r===1?()=>1:(r=Math.log1p(-r),function(){return 1+Math.floor(Math.log1p(-t())/r)})}return n.source=e,n}(ze),jh=function e(t){var n=Uh.source(t)();function r(i,o){if((i=+i)<0)throw new RangeError("invalid k");if(i===0)return()=>0;if(o=o==null?1:+o,i===1)return()=>-Math.log1p(-t())*o;var a=(i<1?i+1:i)-1/3,s=1/(3*Math.sqrt(a)),l=i<1?()=>Math.pow(t(),1/i):()=>1;return function(){do{do var u=n(),c=1+s*u;while(c<=0);c*=c*c;var h=1-t()}while(h>=1-.0331*u*u*u*u&&Math.log(h)>=.5*u*u+a*(1-c+Math.log(c)));return a*c*l()*o}}return r.source=e,r}(ze),W1=function e(t){var n=jh.source(t);function r(i,o){var a=n(i),s=n(o);return function(){var l=a();return l===0?0:l/(l+s())}}return r.source=e,r}(ze),V1=function e(t){var n=G1.source(t),r=W1.source(t);function i(o,a){return o=+o,(a=+a)>=1?()=>o:a<=0?()=>0:function(){for(var s=0,l=o,u=a;l*u>16&&l*(1-u)>16;){var c=Math.floor((l+1)*u),h=r(c,l-c+1)();h<=u?(s+=c,l-=c,u=(u-h)/(1-h)):(l=c-1,u/=h)}for(var f=u<.5,p=f?u:1-u,g=n(p),m=g(),d=0;m<=l;++d)m+=g();return s+(f?d:l-d)}}return i.source=e,i}(ze),AR=function e(t){function n(r,i,o){var a;return(r=+r)==0?a=s=>-Math.log(s):(r=1/r,a=s=>Math.pow(s,r)),i=i==null?0:+i,o=o==null?1:+o,function(){return i+o*a(-Math.log1p(-t()))}}return n.source=e,n}(ze),wR=function e(t){function n(r,i){return r=r==null?0:+r,i=i==null?1:+i,function(){return r+i*Math.tan(Math.PI*t())}}return n.source=e,n}(ze),PR=function e(t){function n(r,i){return r=r==null?0:+r,i=i==null?1:+i,function(){var o=t();return r+i*Math.log(o/(1-o))}}return n.source=e,n}(ze),DR=function e(t){var n=jh.source(t),r=V1.source(t);function i(o){return function(){for(var a=0,s=o;s>16;){var l=Math.floor(.875*s),u=n(l)();if(u>s)return a+r(l-1,s/u)();a+=l,s-=u}for(var c=-Math.log1p(-t()),h=0;c<=s;++h)c-=Math.log1p(-t());return a+h}}return i.source=e,i}(ze),CR=1664525,LR=1013904223,Y1=1/4294967296;function MR(e=Math.random()){let t=(0<=e&&e<1?e/Y1:Math.abs(e))|0;return()=>(t=CR*t+LR|0,Y1*(t>>>0))}function _t(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function dn(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Hh=Symbol("implicit");function qh(){var e=new uo,t=[],n=[],r=Hh;function i(o){let a=e.get(o);if(a===void 0){if(r!==Hh)return r;e.set(o,a=t.push(o)-1)}return n[a%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new uo;for(const a of o)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return qh(t,n).unknown(r)},_t.apply(i,arguments),i}function Zh(){var e=qh().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,a,s=!1,l=0,u=0,c=.5;delete e.unknown;function h(){var f=t().length,p=i<r,g=p?i:r,m=p?r:i;o=(m-g)/Math.max(1,f-l+u*2),s&&(o=Math.floor(o)),g+=(m-g-o*(f-l))*c,a=o*(1-l),s&&(g=Math.round(g),a=Math.round(a));var d=Cn(f).map(function(y){return g+o*y});return n(p?d.reverse():d)}return e.domain=function(f){return arguments.length?(t(f),h()):t()},e.range=function(f){return arguments.length?([r,i]=f,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(f){return[r,i]=f,r=+r,i=+i,s=!0,h()},e.bandwidth=function(){return a},e.step=function(){return o},e.round=function(f){return arguments.length?(s=!!f,h()):s},e.padding=function(f){return arguments.length?(l=Math.min(1,u=+f),h()):l},e.paddingInner=function(f){return arguments.length?(l=Math.min(1,f),h()):l},e.paddingOuter=function(f){return arguments.length?(u=+f,h()):u},e.align=function(f){return arguments.length?(c=Math.max(0,Math.min(1,f)),h()):c},e.copy=function(){return Zh(t(),[r,i]).round(s).paddingInner(l).paddingOuter(u).align(c)},_t.apply(h(),arguments)}function X1(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return X1(t())},e}function Kh(){return X1(Zh.apply(null,arguments).paddingInner(1))}function kR(e){return function(){return e}}function Wl(e){return+e}var U1=[0,1];function ot(e){return e}function Qh(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:kR(isNaN(t)?NaN:.5)}function RR(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function IR(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=Qh(i,r),o=n(a,o)):(r=Qh(r,i),o=n(o,a)),function(s){return o(r(s))}}function ER(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Qh(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(s){var l=qn(e,s,1,r)-1;return o[l](i[l](s))}}function oa(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Vl(){var e=U1,t=U1,n=sn,r,i,o,a=ot,s,l,u;function c(){var f=Math.min(e.length,t.length);return a!==ot&&(a=RR(e[0],e[f-1])),s=f>2?ER:IR,l=u=null,h}function h(f){return f==null||isNaN(f=+f)?o:(l||(l=s(e.map(r),t,n)))(r(a(f)))}return h.invert=function(f){return a(i((u||(u=s(t,e.map(r),bt)))(f)))},h.domain=function(f){return arguments.length?(e=Array.from(f,Wl),c()):e.slice()},h.range=function(f){return arguments.length?(t=Array.from(f),c()):t.slice()},h.rangeRound=function(f){return t=Array.from(f),n=So,c()},h.clamp=function(f){return arguments.length?(a=f?!0:ot,c()):a!==ot},h.interpolate=function(f){return arguments.length?(n=f,c()):n},h.unknown=function(f){return arguments.length?(o=f,h):o},function(f,p){return r=f,i=p,c()}}function Jh(){return Vl()(ot,ot)}function j1(e,t,n,r){var i=as(e,t,n),o;switch(r=hi(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=ib(i,a))&&(r.precision=o),Xf(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=ob(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=rb(i))&&(r.precision=o-(r.type==="%")*2);break}}return Bo(r)}function Bn(e){var t=e.domain;return e.ticks=function(n){var r=t();return Kn(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return j1(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,a=r[i],s=r[o],l,u,c=10;for(s<a&&(u=a,a=s,s=u,u=i,i=o,o=u);c-- >0;){if(u=Qn(a,s,n),u===l)return r[i]=a,r[o]=s,t(r);if(u>0)a=Math.floor(a/u)*u,s=Math.ceil(s/u)*u;else if(u<0)a=Math.ceil(a*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function Nn(){var e=Jh();return e.copy=function(){return oa(e,Nn())},_t.apply(e,arguments),Bn(e)}function H1(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Wl),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return H1(e).unknown(t)},e=arguments.length?Array.from(e,Wl):[0,1],Bn(n)}function q1(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],a;return o<i&&(a=n,n=r,r=a,a=i,i=o,o=a),e[n]=t.floor(i),e[r]=t.ceil(o),e}function Z1(e){return Math.log(e)}function K1(e){return Math.exp(e)}function BR(e){return-Math.log(-e)}function NR(e){return-Math.exp(-e)}function FR(e){return isFinite(e)?+("1e"+e):e<0?0:e}function zR(e){return e===10?FR:e===Math.E?Math.exp:t=>Math.pow(e,t)}function OR(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Q1(e){return(t,n)=>-e(-t,n)}function ep(e){const t=e(Z1,K1),n=t.domain;let r=10,i,o;function a(){return i=OR(r),o=zR(r),n()[0]<0?(i=Q1(i),o=Q1(o),e(BR,NR)):e(Z1,K1),t}return t.base=function(s){return arguments.length?(r=+s,a()):r},t.domain=function(s){return arguments.length?(n(s),a()):n()},t.ticks=s=>{const l=n();let u=l[0],c=l[l.length-1];const h=c<u;h&&([u,c]=[c,u]);let f=i(u),p=i(c),g,m;const d=s==null?10:+s;let y=[];if(!(r%1)&&p-f<d){if(f=Math.floor(f),p=Math.ceil(p),u>0){for(;f<=p;++f)for(g=1;g<r;++g)if(m=f<0?g/o(-f):g*o(f),!(m<u)){if(m>c)break;y.push(m)}}else for(;f<=p;++f)for(g=r-1;g>=1;--g)if(m=f>0?g/o(-f):g*o(f),!(m<u)){if(m>c)break;y.push(m)}y.length*2<d&&(y=Kn(u,c,d))}else y=Kn(f,p,Math.min(p-f,d)).map(o);return h?y.reverse():y},t.tickFormat=(s,l)=>{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=hi(l)).precision==null&&(l.trim=!0),l=Bo(l)),s===1/0)return l;const u=Math.max(1,r*s/t.ticks().length);return c=>{let h=c/o(Math.round(i(c)));return h*r<r-.5&&(h*=r),h<=u?l(c):""}},t.nice=()=>n(q1(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),t}function J1(){const e=ep(Vl()).domain([1,10]);return e.copy=()=>oa(e,J1()).base(e.base()),_t.apply(e,arguments),e}function ex(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function tx(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function tp(e){var t=1,n=e(ex(t),tx(t));return n.constant=function(r){return arguments.length?e(ex(t=+r),tx(t)):t},Bn(n)}function nx(){var e=tp(Vl());return e.copy=function(){return oa(e,nx()).constant(e.constant())},_t.apply(e,arguments)}function rx(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function GR(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function WR(e){return e<0?-e*e:e*e}function np(e){var t=e(ot,ot),n=1;function r(){return n===1?e(ot,ot):n===.5?e(GR,WR):e(rx(n),rx(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Bn(t)}function mn(){var e=np(Vl());return e.copy=function(){return oa(e,mn()).exponent(e.exponent())},_t.apply(e,arguments),e}function VR(){return mn.apply(null,arguments).exponent(.5)}function ix(e){return Math.sign(e)*e*e}function YR(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function ox(){var e=Jh(),t=[0,1],n=!1,r;function i(o){var a=YR(e(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return e.invert(ix(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,Wl)).map(ix)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return ox(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},_t.apply(i,arguments),Bn(i)}function ax(){var e=[],t=[],n=[],r;function i(){var a=0,s=Math.max(1,t.length);for(n=new Array(s-1);++a<s;)n[a-1]=Vm(e,a/s);return o}function o(a){return a==null||isNaN(a=+a)?r:t[qn(n,a)]}return o.invertExtent=function(a){var s=t.indexOf(a);return s<0?[NaN,NaN]:[s>0?n[s-1]:e[0],s<n.length?n[s]:e[e.length-1]]},o.domain=function(a){if(!arguments.length)return e.slice();e=[];for(let s of a)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(_e),i()},o.range=function(a){return arguments.length?(t=Array.from(a),i()):t.slice()},o.unknown=function(a){return arguments.length?(r=a,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return ax().domain(e).range(t).unknown(r)},_t.apply(o,arguments)}function sx(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function a(l){return l!=null&&l<=l?i[qn(r,l,0,n)]:o}function s(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,s()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,s()):i.slice()},a.invertExtent=function(l){var u=i.indexOf(l);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return sx().domain([e,t]).range(i).unknown(o)},_t.apply(Bn(a),arguments)}function lx(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[qn(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var a=t.indexOf(o);return[e[a-1],e[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return lx().domain(e).range(t).unknown(n)},_t.apply(i,arguments)}const rp=new Date,ip=new Date;function Le(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a<s-o?a:s},i.offset=(o,a)=>(t(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const l=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o<a)||!(s>0))return l;let u;do l.push(u=new Date(+o)),t(o,s),e(o);while(u<o&&o<a);return l},i.filter=o=>Le(a=>{if(a>=a)for(;e(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;t(a,-1),!o(a););else for(;--s>=0;)for(;t(a,1),!o(a););}),n&&(i.count=(o,a)=>(rp.setTime(+o),ip.setTime(+a),e(rp),e(ip),Math.floor(n(rp,ip))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const vi=Le(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);vi.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Le(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):vi);const ux=vi.range,yn=1e3,At=yn*60,bn=At*60,xn=bn*24,op=xn*7,cx=xn*30,ap=xn*365,$n=Le(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*yn)},(e,t)=>(t-e)/yn,e=>e.getUTCSeconds()),fx=$n.range,Yl=Le(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yn)},(e,t)=>{e.setTime(+e+t*At)},(e,t)=>(t-e)/At,e=>e.getMinutes()),XR=Yl.range,Xl=Le(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*At)},(e,t)=>(t-e)/At,e=>e.getUTCMinutes()),UR=Xl.range,Ul=Le(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yn-e.getMinutes()*At)},(e,t)=>{e.setTime(+e+t*bn)},(e,t)=>(t-e)/bn,e=>e.getHours()),jR=Ul.range,jl=Le(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*bn)},(e,t)=>(t-e)/bn,e=>e.getUTCHours()),HR=jl.range,Si=Le(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*At)/xn,e=>e.getDate()-1),qR=Si.range,aa=Le(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xn,e=>e.getUTCDate()-1),ZR=aa.range,sp=Le(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xn,e=>Math.floor(e/xn)),KR=sp.range;function $r(e){return Le(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*At)/op)}const Ti=$r(0),sa=$r(1),hx=$r(2),px=$r(3),vr=$r(4),gx=$r(5),dx=$r(6),mx=Ti.range,QR=sa.range,JR=hx.range,e7=px.range,t7=vr.range,n7=gx.range,r7=dx.range;function Sr(e){return Le(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/op)}const _i=Sr(0),la=Sr(1),yx=Sr(2),bx=Sr(3),Tr=Sr(4),xx=Sr(5),$x=Sr(6),vx=_i.range,i7=la.range,o7=yx.range,a7=bx.range,s7=Tr.range,l7=xx.range,u7=$x.range,Hl=Le(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth()),c7=Hl.range,ql=Le(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()),f7=ql.range,en=Le(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());en.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Le(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});const h7=en.range,tn=Le(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());tn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Le(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});const p7=tn.range;function Sx(e,t,n,r,i,o){const a=[[$n,1,yn],[$n,5,5*yn],[$n,15,15*yn],[$n,30,30*yn],[o,1,At],[o,5,5*At],[o,15,15*At],[o,30,30*At],[i,1,bn],[i,3,3*bn],[i,6,6*bn],[i,12,12*bn],[r,1,xn],[r,2,2*xn],[n,1,op],[t,1,cx],[t,3,3*cx],[e,1,ap]];function s(u,c,h){const f=c<u;f&&([u,c]=[c,u]);const p=h&&typeof h.range=="function"?h:l(u,c,h),g=p?p.range(u,+c+1):[];return f?g.reverse():g}function l(u,c,h){const f=Math.abs(c-u)/h,p=ns(([,,d])=>d).right(a,f);if(p===a.length)return e.every(as(u/ap,c/ap,h));if(p===0)return vi.every(Math.max(as(u,c,h),1));const[g,m]=a[f/a[p-1][2]<a[p][2]/f?p-1:p];return g.every(m)}return[s,l]}const[Tx,_x]=Sx(tn,ql,_i,sp,jl,Xl),[Ax,wx]=Sx(en,Hl,Ti,Si,Ul,Yl);function lp(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function up(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ua(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Px(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=ca(i),c=fa(i),h=ca(o),f=fa(o),p=ca(a),g=fa(a),m=ca(s),d=fa(s),y=ca(l),b=fa(l),x={a:O,A:k,b:B,B:F,c:null,d:Rx,e:Rx,f:B7,g:U7,G:H7,H:R7,I:I7,j:E7,L:Ix,m:N7,M:F7,p:E,q:W,Q:Ox,s:Gx,S:z7,u:O7,U:G7,V:W7,w:V7,W:Y7,x:null,X:null,y:X7,Y:j7,Z:q7,"%":zx},$={a:j,A:te,b:V,B:ee,c:null,d:Bx,e:Bx,f:J7,g:uI,G:fI,H:Z7,I:K7,j:Q7,L:Nx,m:eI,M:tI,p:Y,q:J,Q:Ox,s:Gx,S:nI,u:rI,U:iI,V:oI,w:aI,W:sI,x:null,X:null,y:lI,Y:cI,Z:hI,"%":zx},S={a:I,A:v,b:N,B:R,c:D,d:Mx,e:Mx,f:C7,g:Lx,G:Cx,H:kx,I:kx,j:A7,L:D7,m:_7,M:w7,p:P,q:T7,Q:M7,s:k7,S:P7,u:b7,U:x7,V:$7,w:y7,W:v7,x:T,X:M,y:Lx,Y:Cx,Z:S7,"%":L7};x.x=_(n,x),x.X=_(r,x),x.c=_(t,x),$.x=_(n,$),$.X=_(r,$),$.c=_(t,$);function _(K,re){return function(le){var q=[],ye=-1,he=0,Re=K.length,st,ue,Ce;for(le instanceof Date||(le=new Date(+le));++ye<Re;)K.charCodeAt(ye)===37&&(q.push(K.slice(he,ye)),(ue=Dx[st=K.charAt(++ye)])!=null?st=K.charAt(++ye):ue=st==="e"?" ":"0",(Ce=re[st])&&(st=Ce(le,ue)),q.push(st),he=ye+1);return q.push(K.slice(he,ye)),q.join("")}}function A(K,re){return function(le){var q=ua(1900,void 0,1),ye=w(q,K,le+="",0),he,Re;if(ye!=le.length)return null;if("Q"in q)return new Date(q.Q);if("s"in q)return new Date(q.s*1e3+("L"in q?q.L:0));if(re&&!("Z"in q)&&(q.Z=0),"p"in q&&(q.H=q.H%12+q.p*12),q.m===void 0&&(q.m="q"in q?q.q:0),"V"in q){if(q.V<1||q.V>53)return null;"w"in q||(q.w=1),"Z"in q?(he=up(ua(q.y,0,1)),Re=he.getUTCDay(),he=Re>4||Re===0?la.ceil(he):la(he),he=aa.offset(he,(q.V-1)*7),q.y=he.getUTCFullYear(),q.m=he.getUTCMonth(),q.d=he.getUTCDate()+(q.w+6)%7):(he=lp(ua(q.y,0,1)),Re=he.getDay(),he=Re>4||Re===0?sa.ceil(he):sa(he),he=Si.offset(he,(q.V-1)*7),q.y=he.getFullYear(),q.m=he.getMonth(),q.d=he.getDate()+(q.w+6)%7)}else("W"in q||"U"in q)&&("w"in q||(q.w="u"in q?q.u%7:"W"in q?1:0),Re="Z"in q?up(ua(q.y,0,1)).getUTCDay():lp(ua(q.y,0,1)).getDay(),q.m=0,q.d="W"in q?(q.w+6)%7+q.W*7-(Re+5)%7:q.w+q.U*7-(Re+6)%7);return"Z"in q?(q.H+=q.Z/100|0,q.M+=q.Z%100,up(q)):lp(q)}}function w(K,re,le,q){for(var ye=0,he=re.length,Re=le.length,st,ue;ye<he;){if(q>=Re)return-1;if(st=re.charCodeAt(ye++),st===37){if(st=re.charAt(ye++),ue=S[st in Dx?re.charAt(ye++):st],!ue||(q=ue(K,le,q))<0)return-1}else if(st!=le.charCodeAt(q++))return-1}return q}function P(K,re,le){var q=u.exec(re.slice(le));return q?(K.p=c.get(q[0].toLowerCase()),le+q[0].length):-1}function I(K,re,le){var q=p.exec(re.slice(le));return q?(K.w=g.get(q[0].toLowerCase()),le+q[0].length):-1}function v(K,re,le){var q=h.exec(re.slice(le));return q?(K.w=f.get(q[0].toLowerCase()),le+q[0].length):-1}function N(K,re,le){var q=y.exec(re.slice(le));return q?(K.m=b.get(q[0].toLowerCase()),le+q[0].length):-1}function R(K,re,le){var q=m.exec(re.slice(le));return q?(K.m=d.get(q[0].toLowerCase()),le+q[0].length):-1}function D(K,re,le){return w(K,t,re,le)}function T(K,re,le){return w(K,n,re,le)}function M(K,re,le){return w(K,r,re,le)}function O(K){return a[K.getDay()]}function k(K){return o[K.getDay()]}function B(K){return l[K.getMonth()]}function F(K){return s[K.getMonth()]}function E(K){return i[+(K.getHours()>=12)]}function W(K){return 1+~~(K.getMonth()/3)}function j(K){return a[K.getUTCDay()]}function te(K){return o[K.getUTCDay()]}function V(K){return l[K.getUTCMonth()]}function ee(K){return s[K.getUTCMonth()]}function Y(K){return i[+(K.getUTCHours()>=12)]}function J(K){return 1+~~(K.getUTCMonth()/3)}return{format:function(K){var re=_(K+="",x);return re.toString=function(){return K},re},parse:function(K){var re=A(K+="",!1);return re.toString=function(){return K},re},utcFormat:function(K){var re=_(K+="",$);return re.toString=function(){return K},re},utcParse:function(K){var re=A(K+="",!0);return re.toString=function(){return K},re}}}var Dx={"-":"",_:" ",0:"0"},Ne=/^\s*\d+/,g7=/^%/,d7=/[\\^$*+?|[\]().{}]/g;function be(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function m7(e){return e.replace(d7,"\\$&")}function ca(e){return new RegExp("^(?:"+e.map(m7).join("|")+")","i")}function fa(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function y7(e,t,n){var r=Ne.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function b7(e,t,n){var r=Ne.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function x7(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function $7(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function v7(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Cx(e,t,n){var r=Ne.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Lx(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function S7(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function T7(e,t,n){var r=Ne.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function _7(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Mx(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function A7(e,t,n){var r=Ne.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function kx(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function w7(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function P7(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function D7(e,t,n){var r=Ne.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function C7(e,t,n){var r=Ne.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function L7(e,t,n){var r=g7.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function M7(e,t,n){var r=Ne.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function k7(e,t,n){var r=Ne.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Rx(e,t){return be(e.getDate(),t,2)}function R7(e,t){return be(e.getHours(),t,2)}function I7(e,t){return be(e.getHours()%12||12,t,2)}function E7(e,t){return be(1+Si.count(en(e),e),t,3)}function Ix(e,t){return be(e.getMilliseconds(),t,3)}function B7(e,t){return Ix(e,t)+"000"}function N7(e,t){return be(e.getMonth()+1,t,2)}function F7(e,t){return be(e.getMinutes(),t,2)}function z7(e,t){return be(e.getSeconds(),t,2)}function O7(e){var t=e.getDay();return t===0?7:t}function G7(e,t){return be(Ti.count(en(e)-1,e),t,2)}function Ex(e){var t=e.getDay();return t>=4||t===0?vr(e):vr.ceil(e)}function W7(e,t){return e=Ex(e),be(vr.count(en(e),e)+(en(e).getDay()===4),t,2)}function V7(e){return e.getDay()}function Y7(e,t){return be(sa.count(en(e)-1,e),t,2)}function X7(e,t){return be(e.getFullYear()%100,t,2)}function U7(e,t){return e=Ex(e),be(e.getFullYear()%100,t,2)}function j7(e,t){return be(e.getFullYear()%1e4,t,4)}function H7(e,t){var n=e.getDay();return e=n>=4||n===0?vr(e):vr.ceil(e),be(e.getFullYear()%1e4,t,4)}function q7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+be(t/60|0,"0",2)+be(t%60,"0",2)}function Bx(e,t){return be(e.getUTCDate(),t,2)}function Z7(e,t){return be(e.getUTCHours(),t,2)}function K7(e,t){return be(e.getUTCHours()%12||12,t,2)}function Q7(e,t){return be(1+aa.count(tn(e),e),t,3)}function Nx(e,t){return be(e.getUTCMilliseconds(),t,3)}function J7(e,t){return Nx(e,t)+"000"}function eI(e,t){return be(e.getUTCMonth()+1,t,2)}function tI(e,t){return be(e.getUTCMinutes(),t,2)}function nI(e,t){return be(e.getUTCSeconds(),t,2)}function rI(e){var t=e.getUTCDay();return t===0?7:t}function iI(e,t){return be(_i.count(tn(e)-1,e),t,2)}function Fx(e){var t=e.getUTCDay();return t>=4||t===0?Tr(e):Tr.ceil(e)}function oI(e,t){return e=Fx(e),be(Tr.count(tn(e),e)+(tn(e).getUTCDay()===4),t,2)}function aI(e){return e.getUTCDay()}function sI(e,t){return be(la.count(tn(e)-1,e),t,2)}function lI(e,t){return be(e.getUTCFullYear()%100,t,2)}function uI(e,t){return e=Fx(e),be(e.getUTCFullYear()%100,t,2)}function cI(e,t){return be(e.getUTCFullYear()%1e4,t,4)}function fI(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Tr(e):Tr.ceil(e),be(e.getUTCFullYear()%1e4,t,4)}function hI(){return"+0000"}function zx(){return"%"}function Ox(e){return+e}function Gx(e){return Math.floor(+e/1e3)}var Ai,cp,Wx,Zl,fp;Vx({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Vx(e){return Ai=Px(e),cp=Ai.format,Wx=Ai.parse,Zl=Ai.utcFormat,fp=Ai.utcParse,Ai}var Yx="%Y-%m-%dT%H:%M:%S.%LZ";function pI(e){return e.toISOString()}var gI=Date.prototype.toISOString?pI:Zl(Yx);const dI=gI;function mI(e){var t=new Date(e);return isNaN(t)?null:t}var yI=+new Date("2000-01-01T00:00:00.000Z")?mI:fp(Yx);const bI=yI;function xI(e){return new Date(e)}function $I(e){return e instanceof Date?+e:+new Date(+e)}function hp(e,t,n,r,i,o,a,s,l,u){var c=Jh(),h=c.invert,f=c.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),d=u("%I %p"),y=u("%a %d"),b=u("%b %d"),x=u("%B"),$=u("%Y");function S(_){return(l(_)<_?p:s(_)<_?g:a(_)<_?m:o(_)<_?d:r(_)<_?i(_)<_?y:b:n(_)<_?x:$)(_)}return c.invert=function(_){return new Date(h(_))},c.domain=function(_){return arguments.length?f(Array.from(_,$I)):f().map(xI)},c.ticks=function(_){var A=f();return e(A[0],A[A.length-1],_??10)},c.tickFormat=function(_,A){return A==null?S:u(A)},c.nice=function(_){var A=f();return(!_||typeof _.range!="function")&&(_=t(A[0],A[A.length-1],_??10)),_?f(q1(A,_)):c},c.copy=function(){return oa(c,hp(e,t,n,r,i,o,a,s,l,u))},c}function vI(){return _t.apply(hp(Ax,wx,en,Hl,Ti,Si,Ul,Yl,$n,cp).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function SI(){return _t.apply(hp(Tx,_x,tn,ql,_i,aa,jl,Xl,$n,Zl).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Kl(){var e=0,t=1,n,r,i,o,a=ot,s=!1,l;function u(h){return h==null||isNaN(h=+h)?l:a(i===0?.5:(h=(o(h)-n)*i,s?Math.max(0,Math.min(1,h)):h))}u.domain=function(h){return arguments.length?([e,t]=h,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(h){return arguments.length?(s=!!h,u):s},u.interpolator=function(h){return arguments.length?(a=h,u):a};function c(h){return function(f){var p,g;return arguments.length?([p,g]=f,a=h(p,g),u):[a(0),a(1)]}}return u.range=c(sn),u.rangeRound=c(So),u.unknown=function(h){return arguments.length?(l=h,u):l},function(h){return o=h,n=h(e),r=h(t),i=n===r?0:1/(r-n),u}}function Fn(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Xx(){var e=Bn(Kl()(ot));return e.copy=function(){return Fn(e,Xx())},dn.apply(e,arguments)}function Ux(){var e=ep(Kl()).domain([1,10]);return e.copy=function(){return Fn(e,Ux()).base(e.base())},dn.apply(e,arguments)}function jx(){var e=tp(Kl());return e.copy=function(){return Fn(e,jx()).constant(e.constant())},dn.apply(e,arguments)}function pp(){var e=np(Kl());return e.copy=function(){return Fn(e,pp()).exponent(e.exponent())},dn.apply(e,arguments)}function TI(){return pp.apply(null,arguments).exponent(.5)}function Hx(){var e=[],t=ot;function n(r){if(r!=null&&!isNaN(r=+r))return t((qn(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(_e),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>ho(e,o/r))},n.copy=function(){return Hx(t).domain(e)},dn.apply(n,arguments)}function Ql(){var e=0,t=.5,n=1,r=1,i,o,a,s,l,u=ot,c,h=!1,f;function p(m){return isNaN(m=+m)?f:(m=.5+((m=+c(m))-o)*(r*m<r*o?s:l),u(h?Math.max(0,Math.min(1,m)):m))}p.domain=function(m){return arguments.length?([e,t,n]=m,i=c(e=+e),o=c(t=+t),a=c(n=+n),s=i===o?0:.5/(o-i),l=o===a?0:.5/(a-o),r=o<i?-1:1,p):[e,t,n]},p.clamp=function(m){return arguments.length?(h=!!m,p):h},p.interpolator=function(m){return arguments.length?(u=m,p):u};function g(m){return function(d){var y,b,x;return arguments.length?([y,b,x]=d,u=Q0(m,[y,b,x]),p):[u(0),u(.5),u(1)]}}return p.range=g(sn),p.rangeRound=g(So),p.unknown=function(m){return arguments.length?(f=m,p):f},function(m){return c=m,i=m(e),o=m(t),a=m(n),s=i===o?0:.5/(o-i),l=o===a?0:.5/(a-o),r=o<i?-1:1,p}}function qx(){var e=Bn(Ql()(ot));return e.copy=function(){return Fn(e,qx())},dn.apply(e,arguments)}function Zx(){var e=ep(Ql()).domain([.1,1,10]);return e.copy=function(){return Fn(e,Zx()).base(e.base())},dn.apply(e,arguments)}function Kx(){var e=tp(Ql());return e.copy=function(){return Fn(e,Kx()).constant(e.constant())},dn.apply(e,arguments)}function gp(){var e=np(Ql());return e.copy=function(){return Fn(e,gp()).exponent(e.exponent())},dn.apply(e,arguments)}function _I(){return gp.apply(null,arguments).exponent(.5)}function fe(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}const AI=fe("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),wI=fe("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),PI=fe("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),DI=fe("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),CI=fe("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),LI=fe("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),MI=fe("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),kI=fe("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),RI=fe("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),II=fe("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),EI=fe("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),ve=e=>N0(e[e.length-1]);var Qx=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(fe);const BI=ve(Qx);var Jx=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(fe);const NI=ve(Jx);var e$=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(fe);const FI=ve(e$);var t$=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(fe);const zI=ve(t$);var n$=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(fe);const OI=ve(n$);var r$=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(fe);const GI=ve(r$);var i$=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(fe);const WI=ve(i$);var o$=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(fe);const VI=ve(o$);var a$=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(fe);const YI=ve(a$);var s$=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(fe);const XI=ve(s$);var l$=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(fe);const UI=ve(l$);var u$=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(fe);const jI=ve(u$);var c$=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(fe);const HI=ve(c$);var f$=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(fe);const qI=ve(f$);var h$=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(fe);const ZI=ve(h$);var p$=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(fe);const KI=ve(p$);var g$=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(fe);const QI=ve(g$);var d$=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(fe);const JI=ve(d$);var m$=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(fe);const e9=ve(m$);var y$=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(fe);const t9=ve(y$);var b$=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(fe);const n9=ve(b$);var x$=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(fe);const r9=ve(x$);var $$=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(fe);const i9=ve($$);var v$=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(fe);const o9=ve(v$);var S$=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(fe);const a9=ve(S$);var T$=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(fe);const s9=ve(T$);var _$=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(fe);const l9=ve(_$);function u9(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+")"}const c9=Ms(Bt(300,.5,0),Bt(-240,.5,1));var f9=Ms(Bt(-100,.75,.35),Bt(80,1.5,.8)),h9=Ms(Bt(260,.75,.35),Bt(80,1.5,.8)),Jl=Bt();function p9(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return Jl.h=360*e-100,Jl.s=1.5-1.5*t,Jl.l=.8-.9*t,Jl+""}var eu=ei(),g9=Math.PI/3,d9=Math.PI*2/3;function m9(e){var t;return e=(.5-e)*Math.PI,eu.r=255*(t=Math.sin(e))*t,eu.g=255*(t=Math.sin(e+g9))*t,eu.b=255*(t=Math.sin(e+d9))*t,eu+""}function y9(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}function tu(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const b9=tu(fe("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var x9=tu(fe("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),$9=tu(fe("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),v9=tu(fe("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function ce(e){return function(){return e}}const A$=Math.abs,Xe=Math.atan2,vn=Math.cos,S9=Math.max,wi=Math.min,pt=Math.sin,Te=Math.sqrt,Ue=1e-12,zn=Math.PI,nu=zn/2,On=2*zn;function T9(e){return e>1?0:e<-1?zn:Math.acos(e)}function w$(e){return e>=1?nu:e<=-1?-nu:Math.asin(e)}function ha(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new ko(t)}function _9(e){return e.innerRadius}function A9(e){return e.outerRadius}function w9(e){return e.startAngle}function P9(e){return e.endAngle}function D9(e){return e&&e.padAngle}function C9(e,t,n,r,i,o,a,s){var l=n-e,u=r-t,c=a-i,h=s-o,f=h*l-c*u;if(!(f*f<Ue))return f=(c*(t-o)-h*(e-i))/f,[e+f*l,t+f*u]}function ru(e,t,n,r,i,o,a){var s=e-n,l=t-r,u=(a?o:-o)/Te(s*s+l*l),c=u*l,h=-u*s,f=e+c,p=t+h,g=n+c,m=r+h,d=(f+g)/2,y=(p+m)/2,b=g-f,x=m-p,$=b*b+x*x,S=i-o,_=f*m-g*p,A=(x<0?-1:1)*Te(S9(0,S*S*$-_*_)),w=(_*x-b*A)/$,P=(-_*b-x*A)/$,I=(_*x+b*A)/$,v=(-_*b+x*A)/$,N=w-d,R=P-y,D=I-d,T=v-y;return N*N+R*R>D*D+T*T&&(w=I,P=v),{cx:w,cy:P,x01:-c,y01:-h,x11:w*(i/S-1),y11:P*(i/S-1)}}function iu(){var e=_9,t=A9,n=ce(0),r=null,i=w9,o=P9,a=D9,s=null,l=ha(u);function u(){var c,h,f=+e.apply(this,arguments),p=+t.apply(this,arguments),g=i.apply(this,arguments)-nu,m=o.apply(this,arguments)-nu,d=A$(m-g),y=m>g;if(s||(s=c=l()),p<f&&(h=p,p=f,f=h),!(p>Ue))s.moveTo(0,0);else if(d>On-Ue)s.moveTo(p*vn(g),p*pt(g)),s.arc(0,0,p,g,m,!y),f>Ue&&(s.moveTo(f*vn(m),f*pt(m)),s.arc(0,0,f,m,g,y));else{var b=g,x=m,$=g,S=m,_=d,A=d,w=a.apply(this,arguments)/2,P=w>Ue&&(r?+r.apply(this,arguments):Te(f*f+p*p)),I=wi(A$(p-f)/2,+n.apply(this,arguments)),v=I,N=I,R,D;if(P>Ue){var T=w$(P/f*pt(w)),M=w$(P/p*pt(w));(_-=T*2)>Ue?(T*=y?1:-1,$+=T,S-=T):(_=0,$=S=(g+m)/2),(A-=M*2)>Ue?(M*=y?1:-1,b+=M,x-=M):(A=0,b=x=(g+m)/2)}var O=p*vn(b),k=p*pt(b),B=f*vn(S),F=f*pt(S);if(I>Ue){var E=p*vn(x),W=p*pt(x),j=f*vn($),te=f*pt($),V;if(d<zn)if(V=C9(O,k,j,te,E,W,B,F)){var ee=O-V[0],Y=k-V[1],J=E-V[0],K=W-V[1],re=1/pt(T9((ee*J+Y*K)/(Te(ee*ee+Y*Y)*Te(J*J+K*K)))/2),le=Te(V[0]*V[0]+V[1]*V[1]);v=wi(I,(f-le)/(re-1)),N=wi(I,(p-le)/(re+1))}else v=N=0}A>Ue?N>Ue?(R=ru(j,te,O,k,p,N,y),D=ru(E,W,B,F,p,N,y),s.moveTo(R.cx+R.x01,R.cy+R.y01),N<I?s.arc(R.cx,R.cy,N,Xe(R.y01,R.x01),Xe(D.y01,D.x01),!y):(s.arc(R.cx,R.cy,N,Xe(R.y01,R.x01),Xe(R.y11,R.x11),!y),s.arc(0,0,p,Xe(R.cy+R.y11,R.cx+R.x11),Xe(D.cy+D.y11,D.cx+D.x11),!y),s.arc(D.cx,D.cy,N,Xe(D.y11,D.x11),Xe(D.y01,D.x01),!y))):(s.moveTo(O,k),s.arc(0,0,p,b,x,!y)):s.moveTo(O,k),!(f>Ue)||!(_>Ue)?s.lineTo(B,F):v>Ue?(R=ru(B,F,E,W,f,-v,y),D=ru(O,k,j,te,f,-v,y),s.lineTo(R.cx+R.x01,R.cy+R.y01),v<I?s.arc(R.cx,R.cy,v,Xe(R.y01,R.x01),Xe(D.y01,D.x01),!y):(s.arc(R.cx,R.cy,v,Xe(R.y01,R.x01),Xe(R.y11,R.x11),!y),s.arc(0,0,f,Xe(R.cy+R.y11,R.cx+R.x11),Xe(D.cy+D.y11,D.cx+D.x11),y),s.arc(D.cx,D.cy,v,Xe(D.y11,D.x11),Xe(D.y01,D.x01),!y))):s.arc(0,0,f,S,$,y)}if(s.closePath(),c)return s=null,c+""||null}return u.centroid=function(){var c=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,h=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-zn/2;return[vn(h)*c,pt(h)*c]},u.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:ce(+c),u):e},u.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:ce(+c),u):t},u.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:ce(+c),u):n},u.padRadius=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:ce(+c),u):r},u.startAngle=function(c){return arguments.length?(i=typeof c=="function"?c:ce(+c),u):i},u.endAngle=function(c){return arguments.length?(o=typeof c=="function"?c:ce(+c),u):o},u.padAngle=function(c){return arguments.length?(a=typeof c=="function"?c:ce(+c),u):a},u.context=function(c){return arguments.length?(s=c??null,u):s},u}var L9=Array.prototype.slice;function ou(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function P$(e){this._context=e}P$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function au(e){return new P$(e)}function dp(e){return e[0]}function mp(e){return e[1]}function su(e,t){var n=ce(!0),r=null,i=au,o=null,a=ha(s);e=typeof e=="function"?e:e===void 0?dp:ce(e),t=typeof t=="function"?t:t===void 0?mp:ce(t);function s(l){var u,c=(l=ou(l)).length,h,f=!1,p;for(r==null&&(o=i(p=a())),u=0;u<=c;++u)!(u<c&&n(h=l[u],u,l))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+e(h,u,l),+t(h,u,l));if(p)return o=null,p+""||null}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:ce(+l),s):e},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:ce(+l),s):t},s.defined=function(l){return arguments.length?(n=typeof l=="function"?l:ce(!!l),s):n},s.curve=function(l){return arguments.length?(i=l,r!=null&&(o=i(r)),s):i},s.context=function(l){return arguments.length?(l==null?r=o=null:o=i(r=l),s):r},s}function yp(e,t,n){var r=null,i=ce(!0),o=null,a=au,s=null,l=ha(u);e=typeof e=="function"?e:e===void 0?dp:ce(+e),t=typeof t=="function"?t:ce(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?mp:ce(+n);function u(h){var f,p,g,m=(h=ou(h)).length,d,y=!1,b,x=new Array(m),$=new Array(m);for(o==null&&(s=a(b=l())),f=0;f<=m;++f){if(!(f<m&&i(d=h[f],f,h))===y)if(y=!y)p=f,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),g=f-1;g>=p;--g)s.point(x[g],$[g]);s.lineEnd(),s.areaEnd()}y&&(x[f]=+e(d,f,h),$[f]=+t(d,f,h),s.point(r?+r(d,f,h):x[f],n?+n(d,f,h):$[f]))}if(b)return s=null,b+""||null}function c(){return su().defined(i).curve(a).context(o)}return u.x=function(h){return arguments.length?(e=typeof h=="function"?h:ce(+h),r=null,u):e},u.x0=function(h){return arguments.length?(e=typeof h=="function"?h:ce(+h),u):e},u.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:ce(+h),u):r},u.y=function(h){return arguments.length?(t=typeof h=="function"?h:ce(+h),n=null,u):t},u.y0=function(h){return arguments.length?(t=typeof h=="function"?h:ce(+h),u):t},u.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:ce(+h),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(r).y(t)},u.defined=function(h){return arguments.length?(i=typeof h=="function"?h:ce(!!h),u):i},u.curve=function(h){return arguments.length?(a=h,o!=null&&(s=a(o)),u):a},u.context=function(h){return arguments.length?(h==null?o=s=null:s=a(o=h),u):o},u}function M9(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function k9(e){return e}function D$(){var e=k9,t=M9,n=null,r=ce(0),i=ce(On),o=ce(0);function a(s){var l,u=(s=ou(s)).length,c,h,f=0,p=new Array(u),g=new Array(u),m=+r.apply(this,arguments),d=Math.min(On,Math.max(-On,i.apply(this,arguments)-m)),y,b=Math.min(Math.abs(d)/u,o.apply(this,arguments)),x=b*(d<0?-1:1),$;for(l=0;l<u;++l)($=g[p[l]=l]=+e(s[l],l,s))>0&&(f+=$);for(t!=null?p.sort(function(S,_){return t(g[S],g[_])}):n!=null&&p.sort(function(S,_){return n(s[S],s[_])}),l=0,h=f?(d-u*x)/f:0;l<u;++l,m=y)c=p[l],$=g[c],y=m+($>0?$*h:0)+x,g[c]={data:s[c],index:l,value:$,startAngle:m,endAngle:y,padAngle:b};return g}return a.value=function(s){return arguments.length?(e=typeof s=="function"?s:ce(+s),a):e},a.sortValues=function(s){return arguments.length?(t=s,n=null,a):t},a.sort=function(s){return arguments.length?(n=s,t=null,a):n},a.startAngle=function(s){return arguments.length?(r=typeof s=="function"?s:ce(+s),a):r},a.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:ce(+s),a):i},a.padAngle=function(s){return arguments.length?(o=typeof s=="function"?s:ce(+s),a):o},a}var C$=bp(au);function L$(e){this._curve=e}L$.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function bp(e){function t(n){return new L$(e(n))}return t._curve=e,t}function pa(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(bp(n)):t()._curve},e}function M$(){return pa(su().curve(C$))}function k$(){var e=yp().curve(C$),t=e.curve,n=e.lineX0,r=e.lineX1,i=e.lineY0,o=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return pa(n())},delete e.lineX0,e.lineEndAngle=function(){return pa(r())},delete e.lineX1,e.lineInnerRadius=function(){return pa(i())},delete e.lineY0,e.lineOuterRadius=function(){return pa(o())},delete e.lineY1,e.curve=function(a){return arguments.length?t(bp(a)):t()._curve},e}function ga(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}class R${constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}class R9{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,n){if(t=+t,n=+n,this._point===0)this._point=1;else{const r=ga(this._x0,this._y0),i=ga(this._x0,this._y0=(this._y0+n)/2),o=ga(t,this._y0),a=ga(t,n);this._context.moveTo(...r),this._context.bezierCurveTo(...i,...o,...a)}this._x0=t,this._y0=n}}function I$(e){return new R$(e,!0)}function E$(e){return new R$(e,!1)}function I9(e){return new R9(e)}function E9(e){return e.source}function B9(e){return e.target}function lu(e){let t=E9,n=B9,r=dp,i=mp,o=null,a=null,s=ha(l);function l(){let u;const c=L9.call(arguments),h=t.apply(this,c),f=n.apply(this,c);if(o==null&&(a=e(u=s())),a.lineStart(),c[0]=h,a.point(+r.apply(this,c),+i.apply(this,c)),c[0]=f,a.point(+r.apply(this,c),+i.apply(this,c)),a.lineEnd(),u)return a=null,u+""||null}return l.source=function(u){return arguments.length?(t=u,l):t},l.target=function(u){return arguments.length?(n=u,l):n},l.x=function(u){return arguments.length?(r=typeof u=="function"?u:ce(+u),l):r},l.y=function(u){return arguments.length?(i=typeof u=="function"?u:ce(+u),l):i},l.context=function(u){return arguments.length?(u==null?o=a=null:a=e(o=u),l):o},l}function N9(){return lu(I$)}function F9(){return lu(E$)}function z9(){const e=lu(I9);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}const O9=Te(3),B$={draw(e,t){const n=Te(t+wi(t/28,.75))*.59436,r=n/2,i=r*O9;e.moveTo(0,n),e.lineTo(0,-n),e.moveTo(-i,-r),e.lineTo(i,r),e.moveTo(-i,r),e.lineTo(i,-r)}},uu={draw(e,t){const n=Te(t/zn);e.moveTo(n,0),e.arc(0,0,n,0,On)}},N$={draw(e,t){const n=Te(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},F$=Te(1/3),G9=F$*2,z$={draw(e,t){const n=Te(t/G9),r=n*F$;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},O$={draw(e,t){const n=Te(t)*.62625;e.moveTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.lineTo(-n,0),e.closePath()}},G$={draw(e,t){const n=Te(t-wi(t/7,2))*.87559;e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}},W$={draw(e,t){const n=Te(t),r=-n/2;e.rect(r,r,n,n)}},V$={draw(e,t){const n=Te(t)*.4431;e.moveTo(n,n),e.lineTo(n,-n),e.lineTo(-n,-n),e.lineTo(-n,n),e.closePath()}},W9=.8908130915292852,Y$=pt(zn/10)/pt(7*zn/10),V9=pt(On/10)*Y$,Y9=-vn(On/10)*Y$,X$={draw(e,t){const n=Te(t*W9),r=V9*n,i=Y9*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const a=On*o/5,s=vn(a),l=pt(a);e.lineTo(l*n,-s*n),e.lineTo(s*r-l*i,l*r+s*i)}e.closePath()}},xp=Te(3),U$={draw(e,t){const n=-Te(t/(xp*3));e.moveTo(0,n*2),e.lineTo(-xp*n,-n),e.lineTo(xp*n,-n),e.closePath()}},X9=Te(3),j$={draw(e,t){const n=Te(t)*.6824,r=n/2,i=n*X9/2;e.moveTo(0,-n),e.lineTo(i,r),e.lineTo(-i,r),e.closePath()}},wt=-.5,Pt=Te(3)/2,$p=1/Te(12),U9=($p/2+1)*3,H$={draw(e,t){const n=Te(t/U9),r=n/2,i=n*$p,o=r,a=n*$p+n,s=-o,l=a;e.moveTo(r,i),e.lineTo(o,a),e.lineTo(s,l),e.lineTo(wt*r-Pt*i,Pt*r+wt*i),e.lineTo(wt*o-Pt*a,Pt*o+wt*a),e.lineTo(wt*s-Pt*l,Pt*s+wt*l),e.lineTo(wt*r+Pt*i,wt*i-Pt*r),e.lineTo(wt*o+Pt*a,wt*a-Pt*o),e.lineTo(wt*s+Pt*l,wt*l-Pt*s),e.closePath()}},vp={draw(e,t){const n=Te(t-wi(t/6,1.7))*.6189;e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}},q$=[uu,N$,z$,W$,X$,U$,H$],j9=[uu,G$,vp,j$,B$,V$,O$];function H9(e,t){let n=null,r=ha(i);e=typeof e=="function"?e:ce(e||uu),t=typeof t=="function"?t:ce(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:ce(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:ce(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function Gn(){}function cu(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function fu(e){this._context=e}fu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:cu(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:cu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function q9(e){return new fu(e)}function Z$(e){this._context=e}Z$.prototype={areaStart:Gn,areaEnd:Gn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:cu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Z9(e){return new Z$(e)}function K$(e){this._context=e}K$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:cu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function K9(e){return new K$(e)}function Q$(e,t){this._basis=new fu(e),this._beta=t}Q$.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],o=e[n]-r,a=t[n]-i,s=-1,l;++s<=n;)l=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+l*o),this._beta*t[s]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const Q9=function e(t){function n(r){return t===1?new fu(r):new Q$(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function hu(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Sp(e,t){this._context=e,this._k=(1-t)/6}Sp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:hu(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:hu(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const J9=function e(t){function n(r){return new Sp(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Tp(e,t){this._context=e,this._k=(1-t)/6}Tp.prototype={areaStart:Gn,areaEnd:Gn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:hu(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const eE=function e(t){function n(r){return new Tp(r,t)}return n.tension=function(r){return e(+r)},n}(0);function _p(e,t){this._context=e,this._k=(1-t)/6}_p.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:hu(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const tE=function e(t){function n(r){return new _p(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Ap(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>Ue){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Ue){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*u+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*u+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}function J$(e,t){this._context=e,this._alpha=t}J$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Ap(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const nE=function e(t){function n(r){return t?new J$(r,t):new Sp(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function ev(e,t){this._context=e,this._alpha=t}ev.prototype={areaStart:Gn,areaEnd:Gn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Ap(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const rE=function e(t){function n(r){return t?new ev(r,t):new Tp(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function tv(e,t){this._context=e,this._alpha=t}tv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ap(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const iE=function e(t){function n(r){return t?new tv(r,t):new _p(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function nv(e){this._context=e}nv.prototype={areaStart:Gn,areaEnd:Gn,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function oE(e){return new nv(e)}function rv(e){return e<0?-1:1}function iv(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(rv(o)+rv(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function ov(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function wp(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function pu(e){this._context=e}pu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:wp(this,this._t0,ov(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,wp(this,ov(this,n=iv(this,e,t)),n);break;default:wp(this,this._t0,n=iv(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function av(e){this._context=new sv(e)}(av.prototype=Object.create(pu.prototype)).point=function(e,t){pu.prototype.point.call(this,t,e)};function sv(e){this._context=e}sv.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function aE(e){return new pu(e)}function sE(e){return new av(e)}function lv(e){this._context=e}lv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=uv(e),i=uv(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function uv(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),a=new Array(n);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function lE(e){return new lv(e)}function gu(e,t){this._context=e,this._t=t}gu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function uE(e){return new gu(e,.5)}function cE(e){return new gu(e,0)}function fE(e){return new gu(e,1)}function Pi(e,t){if((a=e.length)>1)for(var n=1,r,i,o=e[t[0]],a,s=o.length;n<a;++n)for(i=o,o=e[t[n]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Di(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function hE(e,t){return e[t]}function pE(e){const t=[];return t.key=e,t}function gE(){var e=ce([]),t=Di,n=Pi,r=hE;function i(o){var a=Array.from(e.apply(this,arguments),pE),s,l=a.length,u=-1,c;for(const h of o)for(s=0,++u;s<l;++s)(a[s][u]=[0,+r(h,a[s].key,u,o)]).data=h;for(s=0,c=ou(t(a));s<l;++s)a[c[s]].index=s;return n(a,c),a}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:ce(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:ce(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?Di:typeof o=="function"?o:ce(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??Pi,i):n},i}function dE(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,a;i<o;++i){for(a=n=0;n<r;++n)a+=e[n][i][1]||0;if(a)for(n=0;n<r;++n)e[n][i][1]/=a}Pi(e,t)}}function mE(e,t){if((l=e.length)>0)for(var n,r=0,i,o,a,s,l,u=e[t[0]].length;r<u;++r)for(a=s=0,n=0;n<l;++n)(o=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=o):o<0?(i[1]=s,i[0]=s+=o):(i[0]=0,i[1]=o)}function yE(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var a=0,s=0;a<i;++a)s+=e[a][n][1]||0;r[n][1]+=r[n][0]=-s/2}Pi(e,t)}}function bE(e,t){if(!(!((a=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,a;r<o;++r){for(var s=0,l=0,u=0;s<a;++s){for(var c=e[t[s]],h=c[r][1]||0,f=c[r-1][1]||0,p=(h-f)/2,g=0;g<s;++g){var m=e[t[g]],d=m[r][1]||0,y=m[r-1][1]||0;p+=d-y}l+=h,u+=p*h}i[r-1][1]+=i[r-1][0]=n,l&&(n-=u/l)}i[r-1][1]+=i[r-1][0]=n,Pi(e,t)}}function cv(e){var t=e.map(xE);return Di(e).sort(function(n,r){return t[n]-t[r]})}function xE(e){for(var t=-1,n=0,r=e.length,i,o=-1/0;++t<r;)(i=+e[t][1])>o&&(o=i,n=t);return n}function fv(e){var t=e.map(hv);return Di(e).sort(function(n,r){return t[n]-t[r]})}function hv(e){for(var t=0,n=-1,r=e.length,i;++n<r;)(i=+e[n][1])&&(t+=i);return t}function $E(e){return fv(e).reverse()}function vE(e){var t=e.length,n,r,i=e.map(hv),o=cv(e),a=0,s=0,l=[],u=[];for(n=0;n<t;++n)r=o[n],a<s?(a+=i[r],l.push(r)):(s+=i[r],u.push(r));return u.reverse().concat(l)}function SE(e){return Di(e).reverse()}const du=e=>()=>e;function TE(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function nn(e,t,n){this.k=e,this.x=t,this.y=n}nn.prototype={constructor:nn,scale:function(e){return e===1?this:new nn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new nn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ci=new nn(1,0,0);pv.prototype=nn.prototype;function pv(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ci;return e.__zoom}function Pp(e){e.stopImmediatePropagation()}function da(e){e.preventDefault(),e.stopImmediatePropagation()}function _E(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function AE(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function gv(){return this.__zoom||Ci}function wE(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function PE(){return navigator.maxTouchPoints||"ontouchstart"in this}function DE(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function Sn(){var e=_E,t=AE,n=DE,r=wE,i=PE,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,l=H0,u=Jn("start","zoom","end"),c,h,f,p=500,g=150,m=0,d=10;function y(D){D.property("__zoom",gv).on("wheel.zoom",w,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",I).filter(i).on("touchstart.zoom",v).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",R).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(D,T,M,O){var k=D.selection?D.selection():D;k.property("__zoom",gv),D!==k?S(D,T,M,O):k.interrupt().each(function(){_(this,arguments).event(O).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},y.scaleBy=function(D,T,M,O){y.scaleTo(D,function(){var k=this.__zoom.k,B=typeof T=="function"?T.apply(this,arguments):T;return k*B},M,O)},y.scaleTo=function(D,T,M,O){y.transform(D,function(){var k=t.apply(this,arguments),B=this.__zoom,F=M==null?$(k):typeof M=="function"?M.apply(this,arguments):M,E=B.invert(F),W=typeof T=="function"?T.apply(this,arguments):T;return n(x(b(B,W),F,E),k,a)},M,O)},y.translateBy=function(D,T,M,O){y.transform(D,function(){return n(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),a)},null,O)},y.translateTo=function(D,T,M,O,k){y.transform(D,function(){var B=t.apply(this,arguments),F=this.__zoom,E=O==null?$(B):typeof O=="function"?O.apply(this,arguments):O;return n(Ci.translate(E[0],E[1]).scale(F.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof M=="function"?-M.apply(this,arguments):-M),B,a)},O,k)};function b(D,T){return T=Math.max(o[0],Math.min(o[1],T)),T===D.k?D:new nn(T,D.x,D.y)}function x(D,T,M){var O=T[0]-M[0]*D.k,k=T[1]-M[1]*D.k;return O===D.x&&k===D.y?D:new nn(D.k,O,k)}function $(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function S(D,T,M,O){D.on("start.zoom",function(){_(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(O).end()}).tween("zoom",function(){var k=this,B=arguments,F=_(k,B).event(O),E=t.apply(k,B),W=M==null?$(E):typeof M=="function"?M.apply(k,B):M,j=Math.max(E[1][0]-E[0][0],E[1][1]-E[0][1]),te=k.__zoom,V=typeof T=="function"?T.apply(k,B):T,ee=l(te.invert(W).concat(j/te.k),V.invert(W).concat(j/V.k));return function(Y){if(Y===1)Y=V;else{var J=ee(Y),K=j/J[2];Y=new nn(K,W[0]-J[0]*K,W[1]-J[1]*K)}F.zoom(null,Y)}})}function _(D,T,M){return!M&&D.__zooming||new A(D,T)}function A(D,T){this.that=D,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,T),this.taps=0}A.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,T){return this.mouse&&D!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var T=X(this.that).datum();u.call(D,this.that,new TE(D,{sourceEvent:this.sourceEvent,target:y,type:D,transform:this.that.__zoom,dispatch:u}),T)}};function w(D,...T){if(!e.apply(this,arguments))return;var M=_(this,T).event(D),O=this.__zoom,k=Math.max(o[0],Math.min(o[1],O.k*Math.pow(2,r.apply(this,arguments)))),B=yt(D);if(M.wheel)(M.mouse[0][0]!==B[0]||M.mouse[0][1]!==B[1])&&(M.mouse[1]=O.invert(M.mouse[0]=B)),clearTimeout(M.wheel);else{if(O.k===k)return;M.mouse=[B,O.invert(B)],sr(this),M.start()}da(D),M.wheel=setTimeout(F,g),M.zoom("mouse",n(x(b(O,k),M.mouse[0],M.mouse[1]),M.extent,a));function F(){M.wheel=null,M.end()}}function P(D,...T){if(f||!e.apply(this,arguments))return;var M=D.currentTarget,O=_(this,T,!0).event(D),k=X(D.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",j,!0),B=yt(D,M),F=D.clientX,E=D.clientY;ys(D.view),Pp(D),O.mouse=[B,this.__zoom.invert(B)],sr(this),O.start();function W(te){if(da(te),!O.moved){var V=te.clientX-F,ee=te.clientY-E;O.moved=V*V+ee*ee>m}O.event(te).zoom("mouse",n(x(O.that.__zoom,O.mouse[0]=yt(te,M),O.mouse[1]),O.extent,a))}function j(te){k.on("mousemove.zoom mouseup.zoom",null),bs(te.view,O.moved),da(te),O.event(te).end()}}function I(D,...T){if(e.apply(this,arguments)){var M=this.__zoom,O=yt(D.changedTouches?D.changedTouches[0]:D,this),k=M.invert(O),B=M.k*(D.shiftKey?.5:2),F=n(x(b(M,B),O,k),t.apply(this,T),a);da(D),s>0?X(this).transition().duration(s).call(S,F,O,D):X(this).call(y.transform,F,O,D)}}function v(D,...T){if(e.apply(this,arguments)){var M=D.touches,O=M.length,k=_(this,T,D.changedTouches.length===O).event(D),B,F,E,W;for(Pp(D),F=0;F<O;++F)E=M[F],W=yt(E,this),W=[W,this.__zoom.invert(W),E.identifier],k.touch0?!k.touch1&&k.touch0[2]!==W[2]&&(k.touch1=W,k.taps=0):(k.touch0=W,B=!0,k.taps=1+!!c);c&&(c=clearTimeout(c)),B&&(k.taps<2&&(h=W[0],c=setTimeout(function(){c=null},p)),sr(this),k.start())}}function N(D,...T){if(this.__zooming){var M=_(this,T).event(D),O=D.changedTouches,k=O.length,B,F,E,W;for(da(D),B=0;B<k;++B)F=O[B],E=yt(F,this),M.touch0&&M.touch0[2]===F.identifier?M.touch0[0]=E:M.touch1&&M.touch1[2]===F.identifier&&(M.touch1[0]=E);if(F=M.that.__zoom,M.touch1){var j=M.touch0[0],te=M.touch0[1],V=M.touch1[0],ee=M.touch1[1],Y=(Y=V[0]-j[0])*Y+(Y=V[1]-j[1])*Y,J=(J=ee[0]-te[0])*J+(J=ee[1]-te[1])*J;F=b(F,Math.sqrt(Y/J)),E=[(j[0]+V[0])/2,(j[1]+V[1])/2],W=[(te[0]+ee[0])/2,(te[1]+ee[1])/2]}else if(M.touch0)E=M.touch0[0],W=M.touch0[1];else return;M.zoom("touch",n(x(F,E,W),M.extent,a))}}function R(D,...T){if(this.__zooming){var M=_(this,T).event(D),O=D.changedTouches,k=O.length,B,F;for(Pp(D),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),B=0;B<k;++B)F=O[B],M.touch0&&M.touch0[2]===F.identifier?delete M.touch0:M.touch1&&M.touch1[2]===F.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(F=yt(F,this),Math.hypot(h[0]-F[0],h[1]-F[1])<d)){var E=X(this).on("dblclick.zoom");E&&E.apply(this,arguments)}}}return y.wheelDelta=function(D){return arguments.length?(r=typeof D=="function"?D:du(+D),y):r},y.filter=function(D){return arguments.length?(e=typeof D=="function"?D:du(!!D),y):e},y.touchable=function(D){return arguments.length?(i=typeof D=="function"?D:du(!!D),y):i},y.extent=function(D){return arguments.length?(t=typeof D=="function"?D:du([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),y):t},y.scaleExtent=function(D){return arguments.length?(o[0]=+D[0],o[1]=+D[1],y):[o[0],o[1]]},y.translateExtent=function(D){return arguments.length?(a[0][0]=+D[0][0],a[1][0]=+D[1][0],a[0][1]=+D[0][1],a[1][1]=+D[1][1],y):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},y.constrain=function(D){return arguments.length?(n=D,y):n},y.duration=function(D){return arguments.length?(s=+D,y):s},y.interpolate=function(D){return arguments.length?(l=D,y):l},y.on=function(){var D=u.on.apply(u,arguments);return D===u?y:D},y.clickDistance=function(D){return arguments.length?(m=(D=+D)*D,y):Math.sqrt(m)},y.tapDistance=function(D){return arguments.length?(d=+D,y):d},y}const Dp=Object.freeze(Object.defineProperty({__proto__:null,Adder:Me,Delaunay:Nf,FormatSpecifier:Js,InternMap:uo,InternSet:Zn,Node:br,Path:ko,Voronoi:By,ZoomTransform:nn,active:I5,arc:iu,area:yp,areaRadial:k$,ascending:_e,autoType:ik,axisBottom:Km,axisLeft:Nc,axisRight:PC,axisTop:hs,bin:Gm,bisect:qn,bisectCenter:_D,bisectLeft:TD,bisectRight:wm,bisector:ns,blob:sk,blur:AD,blur2:Pm,blurImage:wD,brush:j5,brushSelection:Y5,brushX:X5,brushY:U5,buffer:uk,chord:q5,chordDirected:K5,chordTranspose:Z5,cluster:x4,color:Mn,contourDensity:T6,contours:kf,count:is,create:lM,creator:gs,cross:RD,csv:hk,csvFormat:j6,csvFormatBody:H6,csvFormatRow:Z6,csvFormatRows:q6,csvFormatValue:K6,csvParse:Oy,csvParseRows:U6,cubehelix:Bt,cumsum:ID,curveBasis:q9,curveBasisClosed:Z9,curveBasisOpen:K9,curveBumpX:I$,curveBumpY:E$,curveBundle:Q9,curveCardinal:J9,curveCardinalClosed:eE,curveCardinalOpen:tE,curveCatmullRom:nE,curveCatmullRomClosed:rE,curveCatmullRomOpen:iE,curveLinear:au,curveLinearClosed:oE,curveMonotoneX:aE,curveMonotoneY:sE,curveNatural:lE,curveStep:uE,curveStepAfter:fE,curveStepBefore:cE,descending:_m,deviation:Lm,difference:dC,disjoint:mC,dispatch:Jn,drag:$s,dragDisable:ys,dragEnable:bs,dsv:fk,dsvFormat:Us,easeBack:my,easeBackIn:w5,easeBackInOut:my,easeBackOut:P5,easeBounce:Lo,easeBounceIn:_5,easeBounceInOut:A5,easeBounceOut:Lo,easeCircle:dy,easeCircleIn:g5,easeCircleInOut:dy,easeCircleOut:d5,easeCubic:Co,easeCubicIn:a5,easeCubicInOut:Co,easeCubicOut:s5,easeElastic:lr,easeElasticIn:D5,easeElasticInOut:C5,easeElasticOut:lr,easeExp:gy,easeExpIn:h5,easeExpInOut:gy,easeExpOut:p5,easeLinear:Ft,easePoly:cy,easePolyIn:l5,easePolyInOut:cy,easePolyOut:u5,easeQuad:uy,easeQuadIn:i5,easeQuadInOut:uy,easeQuadOut:o5,easeSin:py,easeSinIn:c5,easeSinInOut:py,easeSinOut:f5,every:uC,extent:lo,fcumsum:BD,filter:fC,flatGroup:ND,flatRollup:FD,forceCenter:Wf,forceCollide:qs,forceLink:Yf,forceManyBody:Ks,forceRadial:Uk,forceSimulation:Zs,forceX:jy,forceY:Hy,get format(){return Bo},formatDefaultLocale:nb,formatLocale:tb,get formatPrefix(){return Xf},formatSpecifier:hi,fsum:ED,geoAlbers:m1,geoAlbersUsa:K8,geoArea:n8,geoAzimuthalEqualArea:Q8,geoAzimuthalEqualAreaRaw:Lh,geoAzimuthalEquidistant:J8,geoAzimuthalEquidistantRaw:Mh,geoBounds:a8,geoCentroid:h8,geoCircle:p8,geoClipAntimeridian:uh,geoClipCircle:Fb,geoClipExtent:$8,geoClipRectangle:vl,geoConicConformal:t4,geoConicConformalRaw:x1,geoConicEqualArea:Rl,geoConicEqualAreaRaw:d1,geoConicEquidistant:r4,geoConicEquidistantRaw:$1,geoContains:P8,geoDistance:_l,geoEqualEarth:o4,geoEqualEarthRaw:kh,geoEquirectangular:n4,geoEquirectangularRaw:Qo,geoGnomonic:a4,geoGnomonicRaw:Rh,geoGraticule:Hb,geoGraticule10:D8,geoIdentity:s4,geoInterpolate:C8,geoLength:zb,geoMercator:e4,geoMercatorRaw:Ko,geoNaturalEarth1:l4,geoNaturalEarth1Raw:Ih,geoOrthographic:u4,geoOrthographicRaw:Eh,geoPath:G8,geoProjection:Jt,geoProjectionMutator:Dh,geoRotation:Lb,geoStereographic:c4,geoStereographicRaw:Bh,geoStream:zt,geoTransform:W8,geoTransverseMercator:f4,geoTransverseMercatorRaw:Nh,gray:DM,greatest:Wm,greatestIndex:iC,group:Im,groupSort:GD,groups:Em,hcl:ws,hierarchy:Bl,histogram:Gm,hsl:Ts,html:bk,image:gk,index:zD,indexes:OD,interpolate:sn,interpolateArray:IM,interpolateBasis:R0,interpolateBasisClosed:I0,interpolateBlues:r9,interpolateBrBG:BI,interpolateBuGn:XI,interpolateBuPu:UI,interpolateCividis:u9,interpolateCool:h9,interpolateCubehelix:qM,interpolateCubehelixDefault:c9,interpolateCubehelixLong:Ms,interpolateDate:O0,interpolateDiscrete:NM,interpolateGnBu:jI,interpolateGreens:i9,interpolateGreys:o9,interpolateHcl:jM,interpolateHclLong:HM,interpolateHsl:YM,interpolateHslLong:XM,interpolateHue:FM,interpolateInferno:$9,interpolateLab:UM,interpolateMagma:x9,interpolateNumber:bt,interpolateNumberArray:nf,interpolateObject:G0,interpolateOrRd:HI,interpolateOranges:l9,interpolatePRGn:NI,interpolatePiYG:FI,interpolatePlasma:v9,interpolatePuBu:ZI,interpolatePuBuGn:qI,interpolatePuOr:zI,interpolatePuRd:KI,interpolatePurples:a9,interpolateRainbow:p9,interpolateRdBu:OI,interpolateRdGy:GI,interpolateRdPu:QI,interpolateRdYlBu:WI,interpolateRdYlGn:VI,interpolateReds:s9,interpolateRgb:vo,interpolateRgbBasis:N0,interpolateRgbBasisClosed:RM,interpolateRound:So,interpolateSinebow:m9,interpolateSpectral:YI,interpolateString:af,interpolateTransformCss:X0,interpolateTransformSvg:U0,interpolateTurbo:y9,interpolateViridis:b9,interpolateWarm:f9,interpolateYlGn:e9,interpolateYlGnBu:JI,interpolateYlOrBr:t9,interpolateYlOrRd:n9,interpolateZoom:H0,interrupt:sr,intersection:yC,interval:e3,isoFormat:dI,isoParse:bI,json:mk,lab:xo,lch:CM,least:rC,leastIndex:Xm,line:su,lineRadial:M$,link:lu,linkHorizontal:N9,linkRadial:z9,linkVertical:F9,local:s0,map:hC,matcher:Gc,max:co,maxIndex:kc,mean:qD,median:ZD,medianIndex:KD,merge:Ic,min:ss,minIndex:Rc,mode:JD,namespace:go,namespaces:zc,nice:Lc,now:Po,pack:q4,packEnclose:V4,packSiblings:j4,pairs:eC,partition:Z4,path:Mf,pathRound:e6,permute:Om,pie:D$,piecewise:Q0,pointRadial:ga,pointer:yt,pointers:cM,polygonArea:fR,polygonCentroid:hR,polygonContains:mR,polygonHull:dR,polygonLength:yR,precisionFixed:rb,precisionPrefix:ib,precisionRound:ob,quadtree:Hs,quantile:ho,quantileIndex:Ym,quantileSorted:Vm,quantize:ZM,quickselect:ls,radialArea:k$,radialLine:M$,randomBates:vR,randomBernoulli:_R,randomBeta:W1,randomBinomial:V1,randomCauchy:wR,randomExponential:SR,randomGamma:jh,randomGeometric:G1,randomInt:xR,randomIrwinHall:O1,randomLcg:MR,randomLogNormal:$R,randomLogistic:PR,randomNormal:Uh,randomPareto:TR,randomPoisson:DR,randomUniform:bR,randomWeibull:AR,range:Cn,rank:nC,reduce:pC,reverse:gC,rgb:ei,ribbon:l6,ribbonArrow:u6,rollup:Nm,rollups:Fm,scaleBand:Zh,scaleDiverging:qx,scaleDivergingLog:Zx,scaleDivergingPow:gp,scaleDivergingSqrt:_I,scaleDivergingSymlog:Kx,scaleIdentity:H1,scaleImplicit:Hh,scaleLinear:Nn,scaleLog:J1,scaleOrdinal:qh,scalePoint:Kh,scalePow:mn,scaleQuantile:ax,scaleQuantize:sx,scaleRadial:ox,scaleSequential:Xx,scaleSequentialLog:Ux,scaleSequentialPow:pp,scaleSequentialQuantile:Hx,scaleSequentialSqrt:TI,scaleSequentialSymlog:jx,scaleSqrt:VR,scaleSymlog:nx,scaleThreshold:lx,scaleTime:vI,scaleUtc:SI,scan:oC,schemeAccent:wI,schemeBlues:x$,schemeBrBG:Qx,schemeBuGn:s$,schemeBuPu:l$,schemeCategory10:AI,schemeDark2:PI,schemeGnBu:u$,schemeGreens:$$,schemeGreys:v$,schemeObservable10:DI,schemeOrRd:c$,schemeOranges:_$,schemePRGn:Jx,schemePaired:CI,schemePastel1:LI,schemePastel2:MI,schemePiYG:e$,schemePuBu:h$,schemePuBuGn:f$,schemePuOr:t$,schemePuRd:p$,schemePurples:S$,schemeRdBu:n$,schemeRdGy:r$,schemeRdPu:g$,schemeRdYlBu:i$,schemeRdYlGn:o$,schemeReds:T$,schemeSet1:kI,schemeSet2:RI,schemeSet3:II,schemeSpectral:a$,schemeTableau10:EI,schemeYlGn:m$,schemeYlGnBu:d$,schemeYlOrBr:y$,schemeYlOrRd:b$,select:X,selectAll:fM,selection:tr,selector:ds,selectorAll:Oc,shuffle:aC,shuffler:Um,some:cC,sort:Pc,stack:gE,stackOffsetDiverging:mE,stackOffsetExpand:dE,stackOffsetNone:Pi,stackOffsetSilhouette:yE,stackOffsetWiggle:bE,stackOrderAppearance:cv,stackOrderAscending:fv,stackOrderDescending:$E,stackOrderInsideOut:vE,stackOrderNone:Di,stackOrderReverse:SE,stratify:eR,style:er,subset:xC,sum:Ec,superset:Hm,svg:xk,symbol:H9,symbolAsterisk:B$,symbolCircle:uu,symbolCross:N$,symbolDiamond:z$,symbolDiamond2:O$,symbolPlus:G$,symbolSquare:W$,symbolSquare2:V$,symbolStar:X$,symbolTimes:vp,symbolTriangle:U$,symbolTriangle2:j$,symbolWye:H$,symbolX:vp,symbols:q$,symbolsFill:q$,symbolsStroke:j9,text:js,thresholdFreedmanDiaconis:jD,thresholdScott:HD,thresholdSturges:Mc,tickFormat:j1,tickIncrement:Qn,tickStep:as,ticks:Kn,timeDay:Si,timeDays:qR,get timeFormat(){return cp},timeFormatDefaultLocale:Vx,timeFormatLocale:Px,timeFriday:gx,timeFridays:n7,timeHour:Ul,timeHours:jR,timeInterval:Le,timeMillisecond:vi,timeMilliseconds:ux,timeMinute:Yl,timeMinutes:XR,timeMonday:sa,timeMondays:QR,timeMonth:Hl,timeMonths:c7,get timeParse(){return Wx},timeSaturday:dx,timeSaturdays:r7,timeSecond:$n,timeSeconds:fx,timeSunday:Ti,timeSundays:mx,timeThursday:vr,timeThursdays:t7,timeTickInterval:wx,timeTicks:Ax,timeTuesday:hx,timeTuesdays:JR,timeWednesday:px,timeWednesdays:e7,timeWeek:Ti,timeWeeks:mx,timeYear:en,timeYears:h7,timeout:uf,timer:Es,timerFlush:ty,transition:sy,transpose:jm,tree:sR,treemap:F1,treemapBinary:lR,treemapDice:ia,treemapResquarify:cR,treemapSlice:Gl,treemapSliceDice:uR,treemapSquarify:Xh,tsv:pk,tsvFormat:J6,tsvFormatBody:ek,tsvFormatRow:nk,tsvFormatRows:tk,tsvFormatValue:rk,tsvParse:Gy,tsvParseRows:Q6,union:$C,unixDay:sp,unixDays:KR,utcDay:aa,utcDays:ZR,get utcFormat(){return Zl},utcFriday:xx,utcFridays:l7,utcHour:jl,utcHours:HR,utcMillisecond:vi,utcMilliseconds:ux,utcMinute:Xl,utcMinutes:UR,utcMonday:la,utcMondays:i7,utcMonth:ql,utcMonths:f7,get utcParse(){return fp},utcSaturday:$x,utcSaturdays:u7,utcSecond:$n,utcSeconds:fx,utcSunday:_i,utcSundays:vx,utcThursday:Tr,utcThursdays:s7,utcTickInterval:_x,utcTicks:Tx,utcTuesday:yx,utcTuesdays:o7,utcWednesday:bx,utcWednesdays:a7,utcWeek:_i,utcWeeks:vx,utcYear:tn,utcYears:p7,variance:Cm,window:Wc,xml:yk,zip:lC,zoom:Sn,zoomIdentity:Ci,zoomTransform:pv},Symbol.toStringTag,{value:"Module"}));function dv(e){try{return e.node().getBBox()}catch(t){throw new Error(t)}}function CE(e,t){function n(i){var s;const o=document.createElementNS("http://www.w3.org/1999/xhtml","div");o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+i+"</svg>";const a=document.createDocumentFragment();for(;a&&((s=o==null?void 0:o.firstChild)!=null&&s.firstChild);)a.appendChild(o.firstChild.firstChild);return a}const r=e.node();for(;r.hasChildNodes();)r.removeChild(r.firstChild);e.node().appendChild(n(t))}function _r(e){return e.substring(0,4)!=="ease"?Co:Dp[e]??Co}function mu({axisWidth:e,innerRadius:t,outerRadius:n,padAngle:r,cornerRadius:i}){const o=Nn().domain([0,1]).range([0,e/2]),a=o(n);return iu().innerRadius(o(t)).outerRadius(a).padAngle(r).padRadius(a).cornerRadius(i)}const rn=(e,t)=>{if(t instanceof Function){const n=t(e);return String(n??"")}return Bo(t)(e)};function Cp(e){return!(xo(e).l<=60)}function Li(e,t=10){var i;const n=document.createElement("canvas").getContext("2d");return(((i=n==null?void 0:n.measureText(e))==null?void 0:i.width)??0)*t/10}function LE(e){if(e===null||Number.isNaN(e)==!0)return String(e||0);const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")}function pe(e,t){const n=t.colors[t.colorScheme];return e==="label"?n.label[0]:e==="labelContrast"?Cp(n.label[0])?n.labelContrast[1]:n.labelContrast[0]:e=="none"?"none":n[e]!=null?n[e]:n.primary}function Se({datum:e,colorType:t,fullChartParams:n}){const r=n.colors[n.colorScheme];if(t==="label"){const i=e.color;return i||r.label[0]}else if(t==="labelContrast"){const i=e.color;return i?Cp(i)?r.labelContrast[1]:r.labelContrast[0]:Cp(r.label[0])?r.labelContrast[1]:r.labelContrast[0]}return t=="none"?"none":r[t]!=null?r[t]:r.primary}function H(e,t,n){const r=n?`--${n}`:"";return`orbcharts-${e}__${t}${r}`}function Oe(e,t){const r=Math.random().toString(36).substr(2,5);return H(e,t,r)}function Ar(e,t){let n=new me(()=>{});return e.each(function(){const r=Wu(this,t);n=Vu(n,r)}),n}const wr=({selection:e,pluginName:t,clipPathID:n,seriesLabels$:r,gridContainerPosition$:i,gridAxesTransform$:o,gridGraphicTransform$:a})=>{const s=H(t,"series"),l=H(t,"axes"),u=H(t,"graphic"),c=r.pipe(L((g,m)=>e.selectAll(`g.${s}`).data(g,d=>d).join(d=>d.append("g").classed(s,!0).each((y,b,x)=>{X(x[b]).selectAll(`g.${l}`).data([b]).join($=>$.append("g").classed(l,!0).attr("clip-path",`url(#${n})`).each((S,_,A)=>{X(A[_]).selectAll("defs").data([_]).join("defs"),X(A[_]).selectAll("g").data([_]).join("g").classed(u,!0)}),$=>$,$=>$.remove())}),d=>d,d=>d.remove())),ie(1));G({seriesSelection:c,gridContainerPosition:i}).pipe(z(async g=>g)).subscribe(g=>{g.seriesSelection.transition().attr("transform",(m,d)=>{const y=g.gridContainerPosition[d]??g.gridContainerPosition[0],b=y.translate,x=y.scale;return`translate(${b[0]}, ${b[1]}) scale(${x[0]}, ${x[1]})`})});const h=G({seriesSelection:c,gridAxesTransform:o}).pipe(z(async g=>g),L(g=>g.seriesSelection.select(`g.${l}`).style("transform",g.gridAxesTransform.value)),ie(1)),f=h.pipe(L(g=>g.select("defs")),ie(1)),p=G({axesSelection:h,gridGraphicTransform:a}).pipe(z(async g=>g),L(g=>{const m=g.axesSelection.select(`g.${u}`);return m.transition().duration(50).style("transform",g.gridGraphicTransform.value),m}),ie(1));return{seriesSelection$:c,axesSelection$:h,defsSelection$:f,graphicGSelection$:p}},ME=({selection:e,pluginName:t,computedData$:n,gridContainerPosition$:r,isSeriesSeprate$:i})=>{const o=H(t,"container"),a=G({computedData:n.pipe(Z((s,l)=>s.length===l.length)),isSeriesSeprate:i}).pipe(z(async s=>s),L(s=>s.isSeriesSeprate?s.computedData:[s.computedData[0]]),L((s,l)=>e.selectAll(`g.${o}`).data(s,u=>u&&u[0]?u[0].seriesIndex:l).join("g").classed(o,!0)),ie(1));return G({containerSelection:a,gridContainerPosition:r}).pipe(z(async s=>s)).subscribe(s=>{s.containerSelection.attr("transform",(l,u)=>{const c=s.gridContainerPosition[u]??s.gridContainerPosition[0],h=c.translate,f=c.scale;return`translate(${h[0]}, ${h[1]}) scale(${f[0]}, ${f[1]})`})}),a},mv=({fullDataFormatter$:e,gridAxesSize$:t,computedData$:n,fullChartParams$:r,gridContainerPosition$:i,layout$:o})=>{const a=new Q,s=G({fullDataFormatter:e,gridAxesSize:t,computedData:n}).pipe(z(async f=>f),L(f=>{const p=f.computedData[0]?f.computedData[0].length-1:0,g=f.fullDataFormatter.groupAxis.scaleDomain[0]-f.fullDataFormatter.groupAxis.scalePadding,m=f.fullDataFormatter.groupAxis.scaleDomain[1]==="max"?p+f.fullDataFormatter.groupAxis.scalePadding:f.fullDataFormatter.groupAxis.scaleDomain[1]+f.fullDataFormatter.groupAxis.scalePadding;return[g,m]}),ie(1)),l=G({fullDataFormatter:e,computedData:n}).pipe(z(async f=>f),L(f=>f.fullDataFormatter.seriesDirection==="row"?(f.computedData[0]??[]).map(p=>p.groupLabel):f.computedData.map(p=>p[0].groupLabel))),u=G({groupScaleDomain:s,groupLabels:l}).pipe(z(async f=>f),L(f=>f.groupLabels.filter((p,g)=>g>=f.groupScaleDomain[0]&&g<=f.groupScaleDomain[1]))),c=i.pipe(L(f=>f.reduce((g,m)=>m.columnIndex>g?m.columnIndex:g,0)+1),Z()),h=i.pipe(L(f=>f.reduce((g,m)=>m.rowIndex>g?m.rowIndex:g,0)+1),Z());return new me(f=>{G({dataFormatter:e,axisSize:t,fullChartParams:r,scaleRangeGroupLabels:u,groupLabels:l,groupScaleDomain:s,columnAmount:c,rowAmount:h,layout:o}).pipe(C(a),z(async p=>p)).subscribe(p=>{const g=p.dataFormatter.valueAxis.position==="right"||p.dataFormatter.valueAxis.position==="bottom",m=Tc({axisLabels:p.scaleRangeGroupLabels,axisWidth:p.axisSize.width,padding:p.dataFormatter.groupAxis.scalePadding,reverse:g}),d=b=>p.dataFormatter.groupAxis.position==="bottom"||p.dataFormatter.groupAxis.position==="top"?b.offsetX-p.fullChartParams.padding.left:b.offsetY-p.fullChartParams.padding.top,y=b=>{const x={offsetX:b.offsetX*p.columnAmount%p.layout.rootWidth,offsetY:b.offsetY*p.rowAmount%p.layout.rootHeight},$=d(x),S=m($),_=Math.ceil(p.groupScaleDomain[0]),A=S+_;return{groupIndex:A,groupLabel:p.groupLabels[A]??""}};return f.next(y),function(){a.next(void 0)}})})},kE=({rootSelection:e,fullDataFormatter$:t,containerSize$:n,gridAxesContainerSize$:r,computedData$:i,gridContainerPosition$:o,layout$:a})=>{const s=Ar(e,"mousemove"),l=G({fullDataFormatter:t,computedData:i}).pipe(z(async d=>d),L(d=>{const y=d.computedData[0]?d.computedData[0].length-1:0,b=d.fullDataFormatter.groupAxis.scaleDomain[0]-d.fullDataFormatter.groupAxis.scalePadding,x=d.fullDataFormatter.groupAxis.scaleDomain[1]==="max"?y+d.fullDataFormatter.groupAxis.scalePadding:d.fullDataFormatter.groupAxis.scaleDomain[1]+d.fullDataFormatter.groupAxis.scalePadding;return[b,x]}),ie(1)),u=G({fullDataFormatter:t,computedData:i}).pipe(z(async d=>d),L(d=>d.fullDataFormatter.seriesDirection==="row"?(d.computedData[0]??[]).map(y=>y.groupLabel):d.computedData.map(y=>y[0].groupLabel))),c=G({groupScaleDomain:l,groupLabels:u}).pipe(z(async d=>d),L(d=>d.groupLabels.filter((y,b)=>b>=d.groupScaleDomain[0]&&b<=d.groupScaleDomain[1]))),h=t.pipe(L(d=>d.valueAxis.position==="right"||d.valueAxis.position==="bottom")),f=G({reverse:h,gridAxesContainerSize:r,scaleRangeGroupLabels:c,fullDataFormatter:t}).pipe(z(async d=>d),L(d=>Tc({axisLabels:d.scaleRangeGroupLabels,axisWidth:d.gridAxesContainerSize.width,padding:d.fullDataFormatter.groupAxis.scalePadding,reverse:d.reverse}))),p=G({fullDataFormatter:t,rootMousemove:s,gridContainerPosition:o,layout:a}).pipe(z(async d=>d),L(d=>{if(d.fullDataFormatter.groupAxis.position==="bottom"||d.fullDataFormatter.groupAxis.position==="top"){let y=d.rootMousemove.offsetX;const x=d.gridContainerPosition.map(($,S)=>{var _;return[$.translate[0],((_=d.gridContainerPosition[S+1])==null?void 0:_.translate[0])??d.layout.rootWidth]}).filter($=>$[0]<$[1]).find($=>y>=$[0]&&y<=$[1]);return x&&(y=y-x[0]),y-d.layout.left}else{let y=d.rootMousemove.offsetY;const x=d.gridContainerPosition.map(($,S)=>{var _;return[$.translate[1],((_=d.gridContainerPosition[S+1])==null?void 0:_.translate[1])??d.layout.rootHeight]}).filter($=>$[0]<$[1]).find($=>y>=$[0]&&y<=$[1]);return x&&(y=y-x[0]),y-d.layout.top}})),g=G({xIndexScale:f,axisValue:p,groupScaleDomain:l}).pipe(z(async d=>d),L(d=>{const y=d.xIndexScale(d.axisValue),b=Math.ceil(d.groupScaleDomain[0]);return y+b})),m=G({groupIndex:g,groupLabels:u}).pipe(z(async d=>d),L(d=>d.groupLabels[d.groupIndex]??""));return G({groupIndex:g,groupLabel:m}).pipe(z(async d=>d),L(d=>({groupIndex:d.groupIndex,groupLabel:d.groupLabel})))};function RE(e="curveLinear"){return su().x(t=>t.axisX).y(t=>t.axisY).curve(Dp[e])}function IE(e){let t=[[]],n=0;for(let r in e){if(e[r].visible==!1||e[r].value===void 0||e[r].value===null){t[n].length&&(n++,t[n]=[]);continue}t[n].push(e[r])}return t}function EE({selection:e,pathClassName:t,segmentData:n,linePath:r,params:i}){return e.selectAll("path").data(n,(a,s)=>a.length?`${a[0].id}_${a[a.length-1].id}`:s).join(a=>a.append("path").classed(t,!0).attr("fill","none").attr("pointer-events","visibleStroke").style("vector-effect","non-scaling-stroke").style("cursor","pointer"),a=>a,a=>a.remove()).attr("stroke-width",i.lineWidth).attr("stroke",(a,s)=>a[0]&&a[0].color).attr("d",a=>r(a))}function BE({selection:e,seriesLabel:t,fullChartParams:n}){if(e.interrupt("highlight"),!t){e.transition("highlight").duration(200).style("opacity",1);return}e.each((r,i,o)=>{r===t?X(o[i]).style("opacity",1):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}function NE({defsSelection:e,clipPathData:t,transitionDuration:n,transitionEase:r}){e.selectAll("clipPath").data(t).join(i=>i.append("clipPath"),i=>i,i=>i.remove()).attr("id",i=>i.id).each((i,o,a)=>{X(a[o]).selectAll("rect").data([i]).join(s=>{const l=s.append("rect");return l.transition().duration(n).ease(_r(r)).tween("tween",(u,c,h)=>f=>{const p=u.width*f;l.attr("x",0).attr("y",0).attr("width",g=>p).attr("height",g=>g.height)}),l},s=>s.attr("x",0).attr("y",0).attr("width",l=>l.width).attr("height",l=>l.height),s=>s.remove())})}const yv=(e,{selection:t,computedData$:n,computedAxesData$:r,visibleComputedData$:i,visibleComputedAxesData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullDataFormatter$:c,fullChartParams$:h,gridAxesTransform$:f,gridGraphicTransform$:p,gridAxesSize$:g,gridHighlight$:m,gridContainerPosition$:d,allContainerPosition$:y,layout$:b,event$:x})=>{const $=new Q,S=Oe(e,"clipPath-box"),_=H(e,"path"),{seriesSelection$:A,axesSelection$:w,defsSelection$:P,graphicGSelection$:I}=wr({selection:t,pluginName:e,clipPathID:S,seriesLabels$:a,gridContainerPosition$:d,gridAxesTransform$:f,gridGraphicTransform$:p}),v=new me(k=>{const B=u.pipe(C($)).subscribe(F=>{if(!F)return;const E=RE(F.lineCurve);k.next(E)});return()=>{B.unsubscribe()}}),N=h.pipe(L(k=>k.transitionDuration),Z()),R=h.pipe(L(k=>k.transitionEase),Z());G({defsSelection:P,seriesLabels:a,axisSize:g,transitionDuration:N,transitionEase:R}).pipe(C($),z(async k=>k)).subscribe(k=>{const F=[{id:S,width:k.axisSize.width,height:k.axisSize.height}].concat(k.seriesLabels.map(E=>({id:`orbcharts__clipPath_${E}`,width:k.axisSize.width,height:k.axisSize.height})));NE({defsSelection:k.defsSelection,clipPathData:F,transitionDuration:k.transitionDuration,transitionEase:k.transitionEase})});const D=n.pipe(L(k=>{const B=new Map;return k.flat().forEach(F=>B.set(F.id,F)),B})),T=mv({fullDataFormatter$:c,gridAxesSize$:g,computedData$:n,fullChartParams$:h,gridContainerPosition$:y,layout$:b}),M=h.pipe(C($),L(k=>k.highlightTarget),Z()),O=G({graphicGSelection:I,visibleComputedAxesData:o,linePath:v,params:u}).pipe(C($),z(async k=>k),L(k=>{let B=[];return k.graphicGSelection.each((F,E,W)=>{const j=IE(k.visibleComputedAxesData[E]??[]);B[E]=EE({selection:X(W[E]),pathClassName:_,linePath:k.linePath,segmentData:j,params:k.params})}),B}));return G({pathSelectionArr:O,computedData:n,SeriesDataMap:s,GroupDataMap:l,highlightTarget:M,gridGroupPositionFn:T}).pipe(C($),z(async k=>k)).subscribe(k=>{k.pathSelectionArr.forEach(B=>{B.on("mouseover",(F,E)=>{const W=E[0]?E[0].seriesLabel:"",{groupIndex:j,groupLabel:te}=k.gridGroupPositionFn(F),Y=k.GroupDataMap.get(te).find(J=>J.seriesLabel===W)??E[0];x.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:k.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:k.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,group:k.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:F,data:k.computedData})}).on("mousemove",(F,E)=>{const W=E[0]?E[0].seriesLabel:"",{groupIndex:j,groupLabel:te}=k.gridGroupPositionFn(F),Y=k.GroupDataMap.get(te).find(J=>J.seriesLabel===W)??E[0];x.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:k.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:k.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,group:k.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:F,data:k.computedData})}).on("mouseout",(F,E)=>{const W=E[0]?E[0].seriesLabel:"",{groupIndex:j,groupLabel:te}=k.gridGroupPositionFn(F),Y=k.GroupDataMap.get(te).find(J=>J.seriesLabel===W)??E[0];x.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:k.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:k.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,group:k.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:F,data:k.computedData})}).on("click",(F,E)=>{const W=E[0]?E[0].seriesLabel:"",{groupIndex:j,groupLabel:te}=k.gridGroupPositionFn(F),Y=k.GroupDataMap.get(te).find(J=>J.seriesLabel===W)??E[0];x.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:k.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:k.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,group:k.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:F,data:k.computedData})})})}),h.pipe(C($),Er(k=>k.highlightTarget==="series"),z(k=>G({graphicGSelection:I,gridHighlight:m,DataMap:D,fullChartParams:h}).pipe(C($),z(async B=>B)))).subscribe(k=>{const B=k.gridHighlight[0]?k.gridHighlight[0].seriesLabel:null;BE({selection:k.graphicGSelection,seriesLabel:B,fullChartParams:k.fullChartParams})}),()=>{$.next(void 0)}},Lp=0,Dt=2,Mp=3,bv=4,at=5,yu=6,bu=7,Mi=8,ki=9,xv="Lines",FE=ct({name:xv,defaultParams:Lr,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{lineCurve:{toBeTypes:["string"]},lineWidth:{toBeTypes:["number"]}})})(({selection:e,rootSelection:t,name:n,observer:r,subject:i})=>{const o=new Q,a=yv(xv,{selection:e,computedData$:r.computedData$,computedAxesData$:r.computedAxesData$,visibleComputedData$:r.visibleComputedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullDataFormatter$:r.fullDataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,allContainerPosition$:r.gridContainerPosition$,layout$:r.layout$,event$:i.event$});return()=>{o.next(void 0),a()}});function zE(e="curveLinear",t){return yp().x(n=>n.axisX).y0(n=>t).y1(n=>n.axisY).curve(Dp[e])}function OE(e){let t=[[]],n=0;for(let r in e){if(e[r].visible==!1||e[r].value===void 0||e[r].value===null){t[n].length&&(n++,t[n]=[]);continue}t[n].push(e[r])}return t}function GE({selection:e,pathClassName:t,segmentData:n,areaPath:r,linearGradientIds:i,params:o}){return e.selectAll("path").data(n,(s,l)=>s.length?`${s[0].id}_${s[s.length-1].id}`:l).join(s=>s.append("path").classed(t,!0).attr("fill","none").style("vector-effect","non-scaling-stroke").style("cursor","pointer"),s=>s,s=>s.remove()).attr("fill",(s,l)=>s[0]?`url(#${i[s[0].seriesIndex]})`:"").attr("d",s=>r(s))}function WE({selection:e,seriesLabel:t,fullChartParams:n}){if(e.interrupt("highlight"),!t){e.transition("highlight").duration(200).style("opacity",1);return}e.each((r,i,o)=>{r===t?X(o[i]).style("opacity",1):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}function VE({defsSelection:e,computedData:t,linearGradientIds:n,params:r}){e.selectAll("linearGradient").data(t??[]).join(i=>i.append("linearGradient").attr("x1","0%").attr("x2","0%").attr("y1","100%").attr("y2","0%").attr("spreadMethod","pad"),i=>i,i=>i.remove()).attr("id",(i,o)=>i[0]?n[i[0].seriesIndex]:"").html((i,o)=>{const a=i[0]?i[0].color:"";return`
55
+ `)}function u(h){return h.map(c).join(e)}function c(h){return h==null?"":h instanceof Date?X6(h):t.test(h+="")?'"'+h.replace(/"/g,'""')+'"':h}return{parse:r,parseRows:i,format:a,formatBody:s,formatRows:l,formatRow:u,formatValue:c}}var pr=Us(","),Oy=pr.parse,U6=pr.parseRows,j6=pr.format,H6=pr.formatBody,q6=pr.formatRows,Z6=pr.formatRow,K6=pr.formatValue,gr=Us(" "),Gy=gr.parse,Q6=gr.parseRows,J6=gr.format,ek=gr.formatBody,tk=gr.formatRows,nk=gr.formatRow,rk=gr.formatValue;function ik(e){for(var t in e){var n=e[t].trim(),r,i;if(!n)n=null;else if(n==="true")n=!0;else if(n==="false")n=!1;else if(n==="NaN")n=NaN;else if(!isNaN(r=+n))n=r;else if(i=n.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/))ok&&i[4]&&!i[7]&&(n=n.replace(/-/g,"/").replace(/T/," ")),n=new Date(n);else continue;e[t]=n}return e}const ok=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();function ak(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.blob()}function sk(e,t){return fetch(e,t).then(ak)}function lk(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.arrayBuffer()}function uk(e,t){return fetch(e,t).then(lk)}function ck(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.text()}function js(e,t){return fetch(e,t).then(ck)}function Wy(e){return function(t,n,r){return arguments.length===2&&typeof n=="function"&&(r=n,n=void 0),js(t,n).then(function(i){return e(i,r)})}}function fk(e,t,n,r){arguments.length===3&&typeof n=="function"&&(r=n,n=void 0);var i=Us(e);return js(t,n).then(function(o){return i.parse(o,r)})}var hk=Wy(Oy),pk=Wy(Gy);function gk(e,t){return new Promise(function(n,r){var i=new Image;for(var o in t)i[o]=t[o];i.onerror=r,i.onload=function(){n(i)},i.src=e})}function dk(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);if(!(e.status===204||e.status===205))return e.json()}function mk(e,t){return fetch(e,t).then(dk)}function Gf(e){return(t,n)=>js(t,n).then(r=>new DOMParser().parseFromString(r,e))}const yk=Gf("application/xml");var bk=Gf("text/html"),xk=Gf("image/svg+xml");function Wf(e,t){var n,r=1;e==null&&(e=0),t==null&&(t=0);function i(){var o,a=n.length,s,l=0,u=0;for(o=0;o<a;++o)s=n[o],l+=s.x,u+=s.y;for(l=(l/a-e)*r,u=(u/a-t)*r,o=0;o<a;++o)s=n[o],s.x-=l,s.y-=u}return i.initialize=function(o){n=o},i.x=function(o){return arguments.length?(e=+o,i):e},i.y=function(o){return arguments.length?(t=+o,i):t},i.strength=function(o){return arguments.length?(r=+o,i):r},i}function $k(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return Vy(this.cover(t,n),t,n,e)}function Vy(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o=e._root,a={data:r},s=e._x0,l=e._y0,u=e._x1,c=e._y1,h,f,p,d,m,g,y,b;if(!o)return e._root=a,e;for(;o.length;)if((m=t>=(h=(s+u)/2))?s=h:u=h,(g=n>=(f=(l+c)/2))?l=f:c=f,i=o,!(o=o[y=g<<1|m]))return i[y]=a,e;if(p=+e._x.call(null,o.data),d=+e._y.call(null,o.data),t===p&&n===d)return a.next=o,i?i[y]=a:e._root=a,e;do i=i?i[y]=new Array(4):e._root=new Array(4),(m=t>=(h=(s+u)/2))?s=h:u=h,(g=n>=(f=(l+c)/2))?l=f:c=f;while((y=g<<1|m)===(b=(d>=f)<<1|p>=h));return i[b]=o,i[y]=a,e}function vk(e){var t,n,r=e.length,i,o,a=new Array(r),s=new Array(r),l=1/0,u=1/0,c=-1/0,h=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(a[n]=i,s[n]=o,i<l&&(l=i),i>c&&(c=i),o<u&&(u=o),o>h&&(h=o));if(l>c||u>h)return this;for(this.cover(l,u).cover(c,h),n=0;n<r;++n)Vy(this,a[n],s[n],e[n]);return this}function Sk(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,o=(r=Math.floor(t))+1;else{for(var a=i-n||1,s=this._root,l,u;n>e||e>=i||r>t||t>=o;)switch(u=(t<r)<<1|e<n,l=new Array(4),l[u]=s,s=l,a*=2,u){case 0:i=n+a,o=r+a;break;case 1:n=i-a,o=r+a;break;case 2:i=n+a,r=o-a;break;case 3:n=i-a,r=o-a;break}this._root&&this._root.length&&(this._root=s)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this}function Tk(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function _k(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Ke(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function Ak(e,t,n){var r,i=this._x0,o=this._y0,a,s,l,u,c=this._x1,h=this._y1,f=[],p=this._root,d,m;for(p&&f.push(new Ke(p,i,o,c,h)),n==null?n=1/0:(i=e-n,o=t-n,c=e+n,h=t+n,n*=n);d=f.pop();)if(!(!(p=d.node)||(a=d.x0)>c||(s=d.y0)>h||(l=d.x1)<i||(u=d.y1)<o))if(p.length){var g=(a+l)/2,y=(s+u)/2;f.push(new Ke(p[3],g,y,l,u),new Ke(p[2],a,y,g,u),new Ke(p[1],g,s,l,y),new Ke(p[0],a,s,g,y)),(m=(t>=y)<<1|e>=g)&&(d=f[f.length-1],f[f.length-1]=f[f.length-1-m],f[f.length-1-m]=d)}else{var b=e-+this._x.call(null,p.data),x=t-+this._y.call(null,p.data),$=b*b+x*x;if($<n){var S=Math.sqrt(n=$);i=e-S,o=t-S,c=e+S,h=t+S,r=p.data}}return r}function wk(e){if(isNaN(c=+this._x.call(null,e))||isNaN(h=+this._y.call(null,e)))return this;var t,n=this._root,r,i,o,a=this._x0,s=this._y0,l=this._x1,u=this._y1,c,h,f,p,d,m,g,y;if(!n)return this;if(n.length)for(;;){if((d=c>=(f=(a+l)/2))?a=f:l=f,(m=h>=(p=(s+u)/2))?s=p:u=p,t=n,!(n=n[g=m<<1|d]))return this;if(!n.length)break;(t[g+1&3]||t[g+2&3]||t[g+3&3])&&(r=t,y=g)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):t?(o?t[g]=o:delete t[g],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[y]=n:this._root=n),this):(this._root=o,this)}function Pk(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function Dk(){return this._root}function Ck(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function Lk(e){var t=[],n,r=this._root,i,o,a,s,l;for(r&&t.push(new Ke(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,o=n.x0,a=n.y0,s=n.x1,l=n.y1)&&r.length){var u=(o+s)/2,c=(a+l)/2;(i=r[3])&&t.push(new Ke(i,u,c,s,l)),(i=r[2])&&t.push(new Ke(i,o,c,u,l)),(i=r[1])&&t.push(new Ke(i,u,a,s,c)),(i=r[0])&&t.push(new Ke(i,o,a,u,c))}return this}function Mk(e){var t=[],n=[],r;for(this._root&&t.push(new Ke(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var o,a=r.x0,s=r.y0,l=r.x1,u=r.y1,c=(a+l)/2,h=(s+u)/2;(o=i[0])&&t.push(new Ke(o,a,s,c,h)),(o=i[1])&&t.push(new Ke(o,c,s,l,h)),(o=i[2])&&t.push(new Ke(o,a,h,c,u)),(o=i[3])&&t.push(new Ke(o,c,h,l,u))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function kk(e){return e[0]}function Rk(e){return arguments.length?(this._x=e,this):this._x}function Ik(e){return e[1]}function Ek(e){return arguments.length?(this._y=e,this):this._y}function Hs(e,t,n){var r=new Vf(t??kk,n??Ik,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function Vf(e,t,n,r,i,o){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Yy(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var Qe=Hs.prototype=Vf.prototype;Qe.copy=function(){var e=new Vf(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=Yy(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?n.push({source:r,target:t.target[i]=new Array(4)}):t.target[i]=Yy(r));return e},Qe.add=$k,Qe.addAll=vk,Qe.cover=Sk,Qe.data=Tk,Qe.extent=_k,Qe.find=Ak,Qe.remove=wk,Qe.removeAll=Pk,Qe.root=Dk,Qe.size=Ck,Qe.visit=Lk,Qe.visitAfter=Mk,Qe.x=Rk,Qe.y=Ek;function ke(e){return function(){return e}}function In(e){return(e()-.5)*1e-6}function Bk(e){return e.x+e.vx}function Nk(e){return e.y+e.vy}function qs(e){var t,n,r,i=1,o=1;typeof e!="function"&&(e=ke(e==null?1:+e));function a(){for(var u,c=t.length,h,f,p,d,m,g,y=0;y<o;++y)for(h=Hs(t,Bk,Nk).visitAfter(s),u=0;u<c;++u)f=t[u],m=n[f.index],g=m*m,p=f.x+f.vx,d=f.y+f.vy,h.visit(b);function b(x,$,S,_,A){var w=x.data,P=x.r,I=m+P;if(w){if(w.index>f.index){var v=p-w.x-w.vx,N=d-w.y-w.vy,R=v*v+N*N;R<I*I&&(v===0&&(v=In(r),R+=v*v),N===0&&(N=In(r),R+=N*N),R=(I-(R=Math.sqrt(R)))/R*i,f.vx+=(v*=R)*(I=(P*=P)/(g+P)),f.vy+=(N*=R)*I,w.vx-=v*(I=1-I),w.vy-=N*I)}return}return $>p+I||_<p-I||S>d+I||A<d-I}}function s(u){if(u.data)return u.r=n[u.data.index];for(var c=u.r=0;c<4;++c)u[c]&&u[c].r>u.r&&(u.r=u[c].r)}function l(){if(t){var u,c=t.length,h;for(n=new Array(c),u=0;u<c;++u)h=t[u],n[h.index]=+e(h,u,t)}}return a.initialize=function(u,c){t=u,r=c,l()},a.iterations=function(u){return arguments.length?(o=+u,a):o},a.strength=function(u){return arguments.length?(i=+u,a):i},a.radius=function(u){return arguments.length?(e=typeof u=="function"?u:ke(+u),l(),a):e},a}function Fk(e){return e.index}function Xy(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function Yf(e){var t=Fk,n=h,r,i=ke(30),o,a,s,l,u,c=1;e==null&&(e=[]);function h(g){return 1/Math.min(s[g.source.index],s[g.target.index])}function f(g){for(var y=0,b=e.length;y<c;++y)for(var x=0,$,S,_,A,w,P,I;x<b;++x)$=e[x],S=$.source,_=$.target,A=_.x+_.vx-S.x-S.vx||In(u),w=_.y+_.vy-S.y-S.vy||In(u),P=Math.sqrt(A*A+w*w),P=(P-o[x])/P*g*r[x],A*=P,w*=P,_.vx-=A*(I=l[x]),_.vy-=w*I,S.vx+=A*(I=1-I),S.vy+=w*I}function p(){if(a){var g,y=a.length,b=e.length,x=new Map(a.map((S,_)=>[t(S,_,a),S])),$;for(g=0,s=new Array(y);g<b;++g)$=e[g],$.index=g,typeof $.source!="object"&&($.source=Xy(x,$.source)),typeof $.target!="object"&&($.target=Xy(x,$.target)),s[$.source.index]=(s[$.source.index]||0)+1,s[$.target.index]=(s[$.target.index]||0)+1;for(g=0,l=new Array(b);g<b;++g)$=e[g],l[g]=s[$.source.index]/(s[$.source.index]+s[$.target.index]);r=new Array(b),d(),o=new Array(b),m()}}function d(){if(a)for(var g=0,y=e.length;g<y;++g)r[g]=+n(e[g],g,e)}function m(){if(a)for(var g=0,y=e.length;g<y;++g)o[g]=+i(e[g],g,e)}return f.initialize=function(g,y){a=g,u=y,p()},f.links=function(g){return arguments.length?(e=g,p(),f):e},f.id=function(g){return arguments.length?(t=g,f):t},f.iterations=function(g){return arguments.length?(c=+g,f):c},f.strength=function(g){return arguments.length?(n=typeof g=="function"?g:ke(+g),d(),f):n},f.distance=function(g){return arguments.length?(i=typeof g=="function"?g:ke(+g),m(),f):i},f}const zk=1664525,Ok=1013904223,Uy=4294967296;function Gk(){let e=1;return()=>(e=(zk*e+Ok)%Uy)/Uy}function Wk(e){return e.x}function Vk(e){return e.y}var Yk=10,Xk=Math.PI*(3-Math.sqrt(5));function Zs(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,l=Es(h),u=Jn("tick","end"),c=Gk();e==null&&(e=[]);function h(){f(),u.call("tick",t),n<r&&(l.stop(),u.call("end",t))}function f(m){var g,y=e.length,b;m===void 0&&(m=1);for(var x=0;x<m;++x)for(n+=(o-n)*i,s.forEach(function($){$(n)}),g=0;g<y;++g)b=e[g],b.fx==null?b.x+=b.vx*=a:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=a:(b.y=b.fy,b.vy=0);return t}function p(){for(var m=0,g=e.length,y;m<g;++m){if(y=e[m],y.index=m,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=Yk*Math.sqrt(.5+m),x=m*Xk;y.x=b*Math.cos(x),y.y=b*Math.sin(x)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function d(m){return m.initialize&&m.initialize(e,c),m}return p(),t={tick:f,restart:function(){return l.restart(h),t},stop:function(){return l.stop(),t},nodes:function(m){return arguments.length?(e=m,p(),s.forEach(d),t):e},alpha:function(m){return arguments.length?(n=+m,t):n},alphaMin:function(m){return arguments.length?(r=+m,t):r},alphaDecay:function(m){return arguments.length?(i=+m,t):+i},alphaTarget:function(m){return arguments.length?(o=+m,t):o},velocityDecay:function(m){return arguments.length?(a=1-m,t):1-a},randomSource:function(m){return arguments.length?(c=m,s.forEach(d),t):c},force:function(m,g){return arguments.length>1?(g==null?s.delete(m):s.set(m,d(g)),t):s.get(m)},find:function(m,g,y){var b=0,x=e.length,$,S,_,A,w;for(y==null?y=1/0:y*=y,b=0;b<x;++b)A=e[b],$=m-A.x,S=g-A.y,_=$*$+S*S,_<y&&(w=A,y=_);return w},on:function(m,g){return arguments.length>1?(u.on(m,g),t):u.on(m)}}}function Ks(){var e,t,n,r,i=ke(-30),o,a=1,s=1/0,l=.81;function u(p){var d,m=e.length,g=Hs(e,Wk,Vk).visitAfter(h);for(r=p,d=0;d<m;++d)t=e[d],g.visit(f)}function c(){if(e){var p,d=e.length,m;for(o=new Array(d),p=0;p<d;++p)m=e[p],o[m.index]=+i(m,p,e)}}function h(p){var d=0,m,g,y=0,b,x,$;if(p.length){for(b=x=$=0;$<4;++$)(m=p[$])&&(g=Math.abs(m.value))&&(d+=m.value,y+=g,b+=g*m.x,x+=g*m.y);p.x=b/y,p.y=x/y}else{m=p,m.x=m.data.x,m.y=m.data.y;do d+=o[m.data.index];while(m=m.next)}p.value=d}function f(p,d,m,g){if(!p.value)return!0;var y=p.x-t.x,b=p.y-t.y,x=g-d,$=y*y+b*b;if(x*x/l<$)return $<s&&(y===0&&(y=In(n),$+=y*y),b===0&&(b=In(n),$+=b*b),$<a&&($=Math.sqrt(a*$)),t.vx+=y*p.value*r/$,t.vy+=b*p.value*r/$),!0;if(p.length||$>=s)return;(p.data!==t||p.next)&&(y===0&&(y=In(n),$+=y*y),b===0&&(b=In(n),$+=b*b),$<a&&($=Math.sqrt(a*$)));do p.data!==t&&(x=o[p.data.index]*r/$,t.vx+=y*x,t.vy+=b*x);while(p=p.next)}return u.initialize=function(p,d){e=p,n=d,c()},u.strength=function(p){return arguments.length?(i=typeof p=="function"?p:ke(+p),c(),u):i},u.distanceMin=function(p){return arguments.length?(a=p*p,u):Math.sqrt(a)},u.distanceMax=function(p){return arguments.length?(s=p*p,u):Math.sqrt(s)},u.theta=function(p){return arguments.length?(l=p*p,u):Math.sqrt(l)},u}function Uk(e,t,n){var r,i=ke(.1),o,a;typeof e!="function"&&(e=ke(+e)),t==null&&(t=0),n==null&&(n=0);function s(u){for(var c=0,h=r.length;c<h;++c){var f=r[c],p=f.x-t||1e-6,d=f.y-n||1e-6,m=Math.sqrt(p*p+d*d),g=(a[c]-m)*o[c]*u/m;f.vx+=p*g,f.vy+=d*g}}function l(){if(r){var u,c=r.length;for(o=new Array(c),a=new Array(c),u=0;u<c;++u)a[u]=+e(r[u],u,r),o[u]=isNaN(a[u])?0:+i(r[u],u,r)}}return s.initialize=function(u){r=u,l()},s.strength=function(u){return arguments.length?(i=typeof u=="function"?u:ke(+u),l(),s):i},s.radius=function(u){return arguments.length?(e=typeof u=="function"?u:ke(+u),l(),s):e},s.x=function(u){return arguments.length?(t=+u,s):t},s.y=function(u){return arguments.length?(n=+u,s):n},s}function jy(e){var t=ke(.1),n,r,i;typeof e!="function"&&(e=ke(e==null?0:+e));function o(s){for(var l=0,u=n.length,c;l<u;++l)c=n[l],c.vx+=(i[l]-c.x)*r[l]*s}function a(){if(n){var s,l=n.length;for(r=new Array(l),i=new Array(l),s=0;s<l;++s)r[s]=isNaN(i[s]=+e(n[s],s,n))?0:+t(n[s],s,n)}}return o.initialize=function(s){n=s,a()},o.strength=function(s){return arguments.length?(t=typeof s=="function"?s:ke(+s),a(),o):t},o.x=function(s){return arguments.length?(e=typeof s=="function"?s:ke(+s),a(),o):e},o}function Hy(e){var t=ke(.1),n,r,i;typeof e!="function"&&(e=ke(e==null?0:+e));function o(s){for(var l=0,u=n.length,c;l<u;++l)c=n[l],c.vy+=(i[l]-c.y)*r[l]*s}function a(){if(n){var s,l=n.length;for(r=new Array(l),i=new Array(l),s=0;s<l;++s)r[s]=isNaN(i[s]=+e(n[s],s,n))?0:+t(n[s],s,n)}}return o.initialize=function(s){n=s,a()},o.strength=function(s){return arguments.length?(t=typeof s=="function"?s:ke(+s),a(),o):t},o.y=function(s){return arguments.length?(e=typeof s=="function"?s:ke(+s),a(),o):e},o}function jk(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Qs(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function hi(e){return e=Qs(Math.abs(e)),e?e[1]:NaN}function Hk(e,t){return function(n,r){for(var i=n.length,o=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}function qk(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Zk=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function pi(e){if(!(t=Zk.exec(e)))throw new Error("invalid format: "+e);var t;return new Js({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}pi.prototype=Js.prototype;function Js(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Js.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 Kk(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var qy;function Qk(e,t){var n=Qs(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(qy=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")+Qs(e,Math.max(0,t+o-1))[0]}function Zy(e,t){var n=Qs(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Ky={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:jk,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Zy(e*100,t),r:Zy,s:Qk,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Qy(e){return e}var Jy=Array.prototype.map,eb=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tb(e){var t=e.grouping===void 0||e.thousands===void 0?Qy:Hk(Jy.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?Qy:qk(Jy.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(h){h=pi(h);var f=h.fill,p=h.align,d=h.sign,m=h.symbol,g=h.zero,y=h.width,b=h.comma,x=h.precision,$=h.trim,S=h.type;S==="n"?(b=!0,S="g"):Ky[S]||(x===void 0&&(x=12),$=!0,S="g"),(g||f==="0"&&p==="=")&&(g=!0,f="0",p="=");var _=m==="$"?n:m==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",A=m==="$"?r:/[%p]/.test(S)?a:"",w=Ky[S],P=/[defgprs%]/.test(S);x=x===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function I(v){var N=_,R=A,D,T,M;if(S==="c")R=w(v)+R,v="";else{v=+v;var G=v<0||1/v<0;if(v=isNaN(v)?l:w(Math.abs(v),x),$&&(v=Kk(v)),G&&+v==0&&d!=="+"&&(G=!1),N=(G?d==="("?d:s:d==="-"||d==="("?"":d)+N,R=(S==="s"?eb[8+qy/3]:"")+R+(G&&d==="("?")":""),P){for(D=-1,T=v.length;++D<T;)if(M=v.charCodeAt(D),48>M||M>57){R=(M===46?i+v.slice(D+1):v.slice(D))+R,v=v.slice(0,D);break}}}b&&!g&&(v=t(v,1/0));var k=N.length+v.length+R.length,B=k<y?new Array(y-k+1).join(f):"";switch(b&&g&&(v=t(B+v,B.length?y-R.length:1/0),B=""),p){case"<":v=N+v+R+B;break;case"=":v=N+B+v+R;break;case"^":v=B.slice(0,k=B.length>>1)+N+v+R+B.slice(k);break;default:v=B+N+v+R;break}return o(v)}return I.toString=function(){return h+""},I}function c(h,f){var p=u((h=pi(h),h.type="f",h)),d=Math.max(-8,Math.min(8,Math.floor(hi(f)/3)))*3,m=Math.pow(10,-d),g=eb[8+d/3];return function(y){return p(m*y)+g}}return{format:u,formatPrefix:c}}var el,Bo,Xf;nb({thousands:",",grouping:[3],currency:["$",""]});function nb(e){return el=tb(e),Bo=el.format,Xf=el.formatPrefix,el}function rb(e){return Math.max(0,-hi(Math.abs(e)))}function ib(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(hi(t)/3)))*3-hi(Math.abs(e)))}function ob(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,hi(t)-hi(e))+1}var ae=1e-6,No=1e-12,ge=Math.PI,Pe=ge/2,tl=ge/4,Je=ge*2,$e=180/ge,se=ge/180,de=Math.abs,gi=Math.atan,et=Math.atan2,oe=Math.cos,nl=Math.ceil,ab=Math.exp,Uf=Math.hypot,rl=Math.log,jf=Math.pow,re=Math.sin,Tt=Math.sign||function(e){return e>0?1:e<0?-1:0},Be=Math.sqrt,Hf=Math.tan;function sb(e){return e>1?0:e<-1?ge:Math.acos(e)}function tt(e){return e>1?Pe:e<-1?-Pe:Math.asin(e)}function lb(e){return(e=re(e/2))*e}function Ae(){}function il(e,t){e&&cb.hasOwnProperty(e.type)&&cb[e.type](e,t)}var ub={Feature:function(e,t){il(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)il(n[r].geometry,t)}},cb={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){qf(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)qf(n[r],t,0)},Polygon:function(e,t){fb(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)fb(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)il(n[r],t)}};function qf(e,t,n){var r=-1,i=e.length-n,o;for(t.lineStart();++r<i;)o=e[r],t.point(o[0],o[1],o[2]);t.lineEnd()}function fb(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)qf(e[n],t,1);t.polygonEnd()}function zt(e,t){e&&ub.hasOwnProperty(e.type)?ub[e.type](e,t):il(e,t)}var ol=new Me,al=new Me,hb,pb,Zf,Kf,Qf,Zt={point:Ae,lineStart:Ae,lineEnd:Ae,polygonStart:function(){ol=new Me,Zt.lineStart=Jk,Zt.lineEnd=e8},polygonEnd:function(){var e=+ol;al.add(e<0?Je+e:e),this.lineStart=this.lineEnd=this.point=Ae},sphere:function(){al.add(Je)}};function Jk(){Zt.point=t8}function e8(){gb(hb,pb)}function t8(e,t){Zt.point=gb,hb=e,pb=t,e*=se,t*=se,Zf=e,Kf=oe(t=t/2+tl),Qf=re(t)}function gb(e,t){e*=se,t*=se,t=t/2+tl;var n=e-Zf,r=n>=0?1:-1,i=r*n,o=oe(t),a=re(t),s=Qf*a,l=Kf*o+s*oe(i),u=s*r*re(i);ol.add(et(u,l)),Zf=e,Kf=o,Qf=a}function n8(e){return al=new Me,zt(e,Zt),al*2}function sl(e){return[et(e[1],e[0]),tt(e[2])]}function dr(e){var t=e[0],n=e[1],r=oe(n);return[r*oe(t),r*re(t),re(n)]}function ll(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function di(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Jf(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function ul(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function cl(e){var t=Be(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var we,ht,De,xt,mr,db,mb,mi,Fo,En,pn,gn={point:eh,lineStart:bb,lineEnd:xb,polygonStart:function(){gn.point=$b,gn.lineStart=r8,gn.lineEnd=i8,Fo=new Me,Zt.polygonStart()},polygonEnd:function(){Zt.polygonEnd(),gn.point=eh,gn.lineStart=bb,gn.lineEnd=xb,ol<0?(we=-(De=180),ht=-(xt=90)):Fo>ae?xt=90:Fo<-ae&&(ht=-90),pn[0]=we,pn[1]=De},sphere:function(){we=-(De=180),ht=-(xt=90)}};function eh(e,t){En.push(pn=[we=e,De=e]),t<ht&&(ht=t),t>xt&&(xt=t)}function yb(e,t){var n=dr([e*se,t*se]);if(mi){var r=di(mi,n),i=[r[1],-r[0],0],o=di(i,r);cl(o),o=sl(o);var a=e-mr,s=a>0?1:-1,l=o[0]*$e*s,u,c=de(a)>180;c^(s*mr<l&&l<s*e)?(u=o[1]*$e,u>xt&&(xt=u)):(l=(l+360)%360-180,c^(s*mr<l&&l<s*e)?(u=-o[1]*$e,u<ht&&(ht=u)):(t<ht&&(ht=t),t>xt&&(xt=t))),c?e<mr?$t(we,e)>$t(we,De)&&(De=e):$t(e,De)>$t(we,De)&&(we=e):De>=we?(e<we&&(we=e),e>De&&(De=e)):e>mr?$t(we,e)>$t(we,De)&&(De=e):$t(e,De)>$t(we,De)&&(we=e)}else En.push(pn=[we=e,De=e]);t<ht&&(ht=t),t>xt&&(xt=t),mi=n,mr=e}function bb(){gn.point=yb}function xb(){pn[0]=we,pn[1]=De,gn.point=eh,mi=null}function $b(e,t){if(mi){var n=e-mr;Fo.add(de(n)>180?n+(n>0?360:-360):n)}else db=e,mb=t;Zt.point(e,t),yb(e,t)}function r8(){Zt.lineStart()}function i8(){$b(db,mb),Zt.lineEnd(),de(Fo)>ae&&(we=-(De=180)),pn[0]=we,pn[1]=De,mi=null}function $t(e,t){return(t-=e)<0?t+360:t}function o8(e,t){return e[0]-t[0]}function vb(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function a8(e){var t,n,r,i,o,a,s;if(xt=De=-(we=ht=1/0),En=[],zt(e,gn),n=En.length){for(En.sort(o8),t=1,r=En[0],o=[r];t<n;++t)i=En[t],vb(r,i[0])||vb(r,i[1])?($t(r[0],i[1])>$t(r[0],r[1])&&(r[1]=i[1]),$t(i[0],r[1])>$t(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,n=o.length-1,t=0,r=o[n];t<=n;r=i,++t)i=o[t],(s=$t(r[1],i[0]))>a&&(a=s,we=i[0],De=r[1])}return En=pn=null,we===1/0||ht===1/0?[[NaN,NaN],[NaN,NaN]]:[[we,ht],[De,xt]]}var zo,fl,hl,pl,gl,dl,ml,yl,th,nh,rh,Sb,Tb,nt,rt,it,Ot={sphere:Ae,point:ih,lineStart:_b,lineEnd:Ab,polygonStart:function(){Ot.lineStart=u8,Ot.lineEnd=c8},polygonEnd:function(){Ot.lineStart=_b,Ot.lineEnd=Ab}};function ih(e,t){e*=se,t*=se;var n=oe(t);Oo(n*oe(e),n*re(e),re(t))}function Oo(e,t,n){++zo,hl+=(e-hl)/zo,pl+=(t-pl)/zo,gl+=(n-gl)/zo}function _b(){Ot.point=s8}function s8(e,t){e*=se,t*=se;var n=oe(t);nt=n*oe(e),rt=n*re(e),it=re(t),Ot.point=l8,Oo(nt,rt,it)}function l8(e,t){e*=se,t*=se;var n=oe(t),r=n*oe(e),i=n*re(e),o=re(t),a=et(Be((a=rt*o-it*i)*a+(a=it*r-nt*o)*a+(a=nt*i-rt*r)*a),nt*r+rt*i+it*o);fl+=a,dl+=a*(nt+(nt=r)),ml+=a*(rt+(rt=i)),yl+=a*(it+(it=o)),Oo(nt,rt,it)}function Ab(){Ot.point=ih}function u8(){Ot.point=f8}function c8(){wb(Sb,Tb),Ot.point=ih}function f8(e,t){Sb=e,Tb=t,e*=se,t*=se,Ot.point=wb;var n=oe(t);nt=n*oe(e),rt=n*re(e),it=re(t),Oo(nt,rt,it)}function wb(e,t){e*=se,t*=se;var n=oe(t),r=n*oe(e),i=n*re(e),o=re(t),a=rt*o-it*i,s=it*r-nt*o,l=nt*i-rt*r,u=Uf(a,s,l),c=tt(u),h=u&&-c/u;th.add(h*a),nh.add(h*s),rh.add(h*l),fl+=c,dl+=c*(nt+(nt=r)),ml+=c*(rt+(rt=i)),yl+=c*(it+(it=o)),Oo(nt,rt,it)}function h8(e){zo=fl=hl=pl=gl=dl=ml=yl=0,th=new Me,nh=new Me,rh=new Me,zt(e,Ot);var t=+th,n=+nh,r=+rh,i=Uf(t,n,r);return i<No&&(t=dl,n=ml,r=yl,fl<ae&&(t=hl,n=pl,r=gl),i=Uf(t,n,r),i<No)?[NaN,NaN]:[et(n,t)*$e,tt(r/i)*$e]}function yi(e){return function(){return e}}function oh(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function ah(e,t){return de(e)>ge&&(e-=Math.round(e/Je)*Je),[e,t]}ah.invert=ah;function sh(e,t,n){return(e%=Je)?t||n?oh(Db(e),Cb(t,n)):Db(e):t||n?Cb(t,n):ah}function Pb(e){return function(t,n){return t+=e,de(t)>ge&&(t-=Math.round(t/Je)*Je),[t,n]}}function Db(e){var t=Pb(e);return t.invert=Pb(-e),t}function Cb(e,t){var n=oe(e),r=re(e),i=oe(t),o=re(t);function a(s,l){var u=oe(l),c=oe(s)*u,h=re(s)*u,f=re(l),p=f*n+c*r;return[et(h*i-p*o,c*n-f*r),tt(p*i+h*o)]}return a.invert=function(s,l){var u=oe(l),c=oe(s)*u,h=re(s)*u,f=re(l),p=f*i-h*o;return[et(h*i+f*o,c*n+p*r),tt(p*n-c*r)]},a}function Lb(e){e=sh(e[0]*se,e[1]*se,e.length>2?e[2]*se:0);function t(n){return n=e(n[0]*se,n[1]*se),n[0]*=$e,n[1]*=$e,n}return t.invert=function(n){return n=e.invert(n[0]*se,n[1]*se),n[0]*=$e,n[1]*=$e,n},t}function Mb(e,t,n,r,i,o){if(n){var a=oe(t),s=re(t),l=r*n;i==null?(i=t+r*Je,o=t-l/2):(i=kb(a,i),o=kb(a,o),(r>0?i<o:i>o)&&(i+=r*Je));for(var u,c=i;r>0?c>o:c<o;c-=l)u=sl([a,-s*oe(c),-s*re(c)]),e.point(u[0],u[1])}}function kb(e,t){t=dr(t),t[0]-=e,cl(t);var n=sb(-t[1]);return((-t[2]<0?-n:n)+Je-ae)%Je}function p8(){var e=yi([0,0]),t=yi(90),n=yi(2),r,i,o={point:a};function a(l,u){r.push(l=i(l,u)),l[0]*=$e,l[1]*=$e}function s(){var l=e.apply(this,arguments),u=t.apply(this,arguments)*se,c=n.apply(this,arguments)*se;return r=[],i=sh(-l[0]*se,-l[1]*se,0).invert,Mb(o,u,c,1),l={type:"Polygon",coordinates:[r]},r=i=null,l}return s.center=function(l){return arguments.length?(e=typeof l=="function"?l:yi([+l[0],+l[1]]),s):e},s.radius=function(l){return arguments.length?(t=typeof l=="function"?l:yi(+l),s):t},s.precision=function(l){return arguments.length?(n=typeof l=="function"?l:yi(+l),s):n},s}function Rb(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Ae,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function bl(e,t){return de(e[0]-t[0])<ae&&de(e[1]-t[1])<ae}function xl(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Ib(e,t,n,r,i){var o=[],a=[],s,l;if(e.forEach(function(d){if(!((m=d.length-1)<=0)){var m,g=d[0],y=d[m],b;if(bl(g,y)){if(!g[2]&&!y[2]){for(i.lineStart(),s=0;s<m;++s)i.point((g=d[s])[0],g[1]);i.lineEnd();return}y[0]+=2*ae}o.push(b=new xl(g,d,null,!0)),a.push(b.o=new xl(g,null,b,!1)),o.push(b=new xl(y,d,null,!1)),a.push(b.o=new xl(y,null,b,!0))}}),!!o.length){for(a.sort(t),Eb(o),Eb(a),s=0,l=a.length;s<l;++s)a[s].e=n=!n;for(var u=o[0],c,h;;){for(var f=u,p=!0;f.v;)if((f=f.n)===u)return;c=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(s=0,l=c.length;s<l;++s)i.point((h=c[s])[0],h[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(p)for(c=f.p.z,s=c.length-1;s>=0;--s)i.point((h=c[s])[0],h[1]);else r(f.x,f.p.x,-1,i);f=f.p}f=f.o,c=f.z,p=!p}while(!f.v);i.lineEnd()}}}function Eb(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function lh(e){return de(e[0])<=ge?e[0]:Tt(e[0])*((de(e[0])+ge)%Je-ge)}function Bb(e,t){var n=lh(t),r=t[1],i=re(r),o=[re(n),-oe(n),0],a=0,s=0,l=new Me;i===1?r=Pe+ae:i===-1&&(r=-Pe-ae);for(var u=0,c=e.length;u<c;++u)if(f=(h=e[u]).length)for(var h,f,p=h[f-1],d=lh(p),m=p[1]/2+tl,g=re(m),y=oe(m),b=0;b<f;++b,d=$,g=_,y=A,p=x){var x=h[b],$=lh(x),S=x[1]/2+tl,_=re(S),A=oe(S),w=$-d,P=w>=0?1:-1,I=P*w,v=I>ge,N=g*_;if(l.add(et(N*P*re(I),y*A+N*oe(I))),a+=v?w+P*Je:w,v^d>=n^$>=n){var R=di(dr(p),dr(x));cl(R);var D=di(o,R);cl(D);var T=(v^w>=0?-1:1)*tt(D[2]);(r>T||r===T&&(R[0]||R[1]))&&(s+=v^w>=0?1:-1)}}return(a<-ae||a<ae&&l<-No)^s&1}function Nb(e,t,n,r){return function(i){var o=t(i),a=Rb(),s=t(a),l=!1,u,c,h,f={point:p,lineStart:m,lineEnd:g,polygonStart:function(){f.point=y,f.lineStart=b,f.lineEnd=x,c=[],u=[]},polygonEnd:function(){f.point=p,f.lineStart=m,f.lineEnd=g,c=Ic(c);var $=Bb(u,r);c.length?(l||(i.polygonStart(),l=!0),Ib(c,d8,$,n,i)):$&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),c=u=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function p($,S){e($,S)&&i.point($,S)}function d($,S){o.point($,S)}function m(){f.point=d,o.lineStart()}function g(){f.point=p,o.lineEnd()}function y($,S){h.push([$,S]),s.point($,S)}function b(){s.lineStart(),h=[]}function x(){y(h[0][0],h[0][1]),s.lineEnd();var $=s.clean(),S=a.result(),_,A=S.length,w,P,I;if(h.pop(),u.push(h),h=null,!!A){if($&1){if(P=S[0],(w=P.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),_=0;_<w;++_)i.point((I=P[_])[0],I[1]);i.lineEnd()}return}A>1&&$&2&&S.push(S.pop().concat(S.shift())),c.push(S.filter(g8))}}return f}}function g8(e){return e.length>1}function d8(e,t){return((e=e.x)[0]<0?e[1]-Pe-ae:Pe-e[1])-((t=t.x)[0]<0?t[1]-Pe-ae:Pe-t[1])}const uh=Nb(function(){return!0},m8,b8,[-ge,-Pe]);function m8(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,a){var s=o>0?ge:-ge,l=de(o-t);de(l-ge)<ae?(e.point(t,n=(n+a)/2>0?Pe:-Pe),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),e.point(o,n),i=0):r!==s&&l>=ge&&(de(t-r)<ae&&(t-=r*ae),de(o-s)<ae&&(o-=s*ae),n=y8(t,n,o,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),i=0),e.point(t=o,n=a),r=s},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function y8(e,t,n,r){var i,o,a=re(e-n);return de(a)>ae?gi((re(t)*(o=oe(r))*re(n)-re(r)*(i=oe(t))*re(e))/(i*o*a)):(t+r)/2}function b8(e,t,n,r){var i;if(e==null)i=n*Pe,r.point(-ge,i),r.point(0,i),r.point(ge,i),r.point(ge,0),r.point(ge,-i),r.point(0,-i),r.point(-ge,-i),r.point(-ge,0),r.point(-ge,i);else if(de(e[0]-t[0])>ae){var o=e[0]<t[0]?ge:-ge;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}function Fb(e){var t=oe(e),n=2*se,r=t>0,i=de(t)>ae;function o(c,h,f,p){Mb(p,e,n,f,c,h)}function a(c,h){return oe(c)*oe(h)>t}function s(c){var h,f,p,d,m;return{lineStart:function(){d=p=!1,m=1},point:function(g,y){var b=[g,y],x,$=a(g,y),S=r?$?0:u(g,y):$?u(g+(g<0?ge:-ge),y):0;if(!h&&(d=p=$)&&c.lineStart(),$!==p&&(x=l(h,b),(!x||bl(h,x)||bl(b,x))&&(b[2]=1)),$!==p)m=0,$?(c.lineStart(),x=l(b,h),c.point(x[0],x[1])):(x=l(h,b),c.point(x[0],x[1],2),c.lineEnd()),h=x;else if(i&&h&&r^$){var _;!(S&f)&&(_=l(b,h,!0))&&(m=0,r?(c.lineStart(),c.point(_[0][0],_[0][1]),c.point(_[1][0],_[1][1]),c.lineEnd()):(c.point(_[1][0],_[1][1]),c.lineEnd(),c.lineStart(),c.point(_[0][0],_[0][1],3)))}$&&(!h||!bl(h,b))&&c.point(b[0],b[1]),h=b,p=$,f=S},lineEnd:function(){p&&c.lineEnd(),h=null},clean:function(){return m|(d&&p)<<1}}}function l(c,h,f){var p=dr(c),d=dr(h),m=[1,0,0],g=di(p,d),y=ll(g,g),b=g[0],x=y-b*b;if(!x)return!f&&c;var $=t*y/x,S=-t*b/x,_=di(m,g),A=ul(m,$),w=ul(g,S);Jf(A,w);var P=_,I=ll(A,P),v=ll(P,P),N=I*I-v*(ll(A,A)-1);if(!(N<0)){var R=Be(N),D=ul(P,(-I-R)/v);if(Jf(D,A),D=sl(D),!f)return D;var T=c[0],M=h[0],G=c[1],k=h[1],B;M<T&&(B=T,T=M,M=B);var F=M-T,E=de(F-ge)<ae,W=E||F<ae;if(!E&&k<G&&(B=G,G=k,k=B),W?E?G+k>0^D[1]<(de(D[0]-T)<ae?G:k):G<=D[1]&&D[1]<=k:F>ge^(T<=D[0]&&D[0]<=M)){var j=ul(P,(-I+R)/v);return Jf(j,A),[D,sl(j)]}}}function u(c,h){var f=r?e:ge-e,p=0;return c<-f?p|=1:c>f&&(p|=2),h<-f?p|=4:h>f&&(p|=8),p}return Nb(a,s,o,r?[0,-e]:[-ge,e-ge])}function x8(e,t,n,r,i,o){var a=e[0],s=e[1],l=t[0],u=t[1],c=0,h=1,f=l-a,p=u-s,d;if(d=n-a,!(!f&&d>0)){if(d/=f,f<0){if(d<c)return;d<h&&(h=d)}else if(f>0){if(d>h)return;d>c&&(c=d)}if(d=i-a,!(!f&&d<0)){if(d/=f,f<0){if(d>h)return;d>c&&(c=d)}else if(f>0){if(d<c)return;d<h&&(h=d)}if(d=r-s,!(!p&&d>0)){if(d/=p,p<0){if(d<c)return;d<h&&(h=d)}else if(p>0){if(d>h)return;d>c&&(c=d)}if(d=o-s,!(!p&&d<0)){if(d/=p,p<0){if(d>h)return;d>c&&(c=d)}else if(p>0){if(d<c)return;d<h&&(h=d)}return c>0&&(e[0]=a+c*f,e[1]=s+c*p),h<1&&(t[0]=a+h*f,t[1]=s+h*p),!0}}}}}var Go=1e9,$l=-Go;function vl(e,t,n,r){function i(u,c){return e<=u&&u<=n&&t<=c&&c<=r}function o(u,c,h,f){var p=0,d=0;if(u==null||(p=a(u,h))!==(d=a(c,h))||l(u,c)<0^h>0)do f.point(p===0||p===3?e:n,p>1?r:t);while((p=(p+h+4)%4)!==d);else f.point(c[0],c[1])}function a(u,c){return de(u[0]-e)<ae?c>0?0:3:de(u[0]-n)<ae?c>0?2:1:de(u[1]-t)<ae?c>0?1:0:c>0?3:2}function s(u,c){return l(u.x,c.x)}function l(u,c){var h=a(u,1),f=a(c,1);return h!==f?h-f:h===0?c[1]-u[1]:h===1?u[0]-c[0]:h===2?u[1]-c[1]:c[0]-u[0]}return function(u){var c=u,h=Rb(),f,p,d,m,g,y,b,x,$,S,_,A={point:w,lineStart:N,lineEnd:R,polygonStart:I,polygonEnd:v};function w(T,M){i(T,M)&&c.point(T,M)}function P(){for(var T=0,M=0,G=p.length;M<G;++M)for(var k=p[M],B=1,F=k.length,E=k[0],W,j,te=E[0],V=E[1];B<F;++B)W=te,j=V,E=k[B],te=E[0],V=E[1],j<=r?V>r&&(te-W)*(r-j)>(V-j)*(e-W)&&++T:V<=r&&(te-W)*(r-j)<(V-j)*(e-W)&&--T;return T}function I(){c=h,f=[],p=[],_=!0}function v(){var T=P(),M=_&&T,G=(f=Ic(f)).length;(M||G)&&(u.polygonStart(),M&&(u.lineStart(),o(null,null,1,u),u.lineEnd()),G&&Ib(f,s,T,o,u),u.polygonEnd()),c=u,f=p=d=null}function N(){A.point=D,p&&p.push(d=[]),S=!0,$=!1,b=x=NaN}function R(){f&&(D(m,g),y&&$&&h.rejoin(),f.push(h.result())),A.point=w,$&&c.lineEnd()}function D(T,M){var G=i(T,M);if(p&&d.push([T,M]),S)m=T,g=M,y=G,S=!1,G&&(c.lineStart(),c.point(T,M));else if(G&&$)c.point(T,M);else{var k=[b=Math.max($l,Math.min(Go,b)),x=Math.max($l,Math.min(Go,x))],B=[T=Math.max($l,Math.min(Go,T)),M=Math.max($l,Math.min(Go,M))];x8(k,B,e,t,n,r)?($||(c.lineStart(),c.point(k[0],k[1])),c.point(B[0],B[1]),G||c.lineEnd(),_=!1):G&&(c.lineStart(),c.point(T,M),_=!1)}b=T,x=M,$=G}return A}}function $8(){var e=0,t=0,n=960,r=500,i,o,a;return a={stream:function(s){return i&&o===s?i:i=vl(e,t,n,r)(o=s)},extent:function(s){return arguments.length?(e=+s[0][0],t=+s[0][1],n=+s[1][0],r=+s[1][1],i=o=null,a):[[e,t],[n,r]]}}}var ch,fh,Sl,Tl,bi={sphere:Ae,point:Ae,lineStart:v8,lineEnd:Ae,polygonStart:Ae,polygonEnd:Ae};function v8(){bi.point=T8,bi.lineEnd=S8}function S8(){bi.point=bi.lineEnd=Ae}function T8(e,t){e*=se,t*=se,fh=e,Sl=re(t),Tl=oe(t),bi.point=_8}function _8(e,t){e*=se,t*=se;var n=re(t),r=oe(t),i=de(e-fh),o=oe(i),a=re(i),s=r*a,l=Tl*n-Sl*r*o,u=Sl*n+Tl*r*o;ch.add(et(Be(s*s+l*l),u)),fh=e,Sl=n,Tl=r}function zb(e){return ch=new Me,zt(e,bi),+ch}var hh=[null,null],A8={type:"LineString",coordinates:hh};function _l(e,t){return hh[0]=e,hh[1]=t,zb(A8)}var Ob={Feature:function(e,t){return Al(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)if(Al(n[r].geometry,t))return!0;return!1}},Gb={Sphere:function(){return!0},Point:function(e,t){return Wb(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(Wb(n[r],t))return!0;return!1},LineString:function(e,t){return Vb(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(Vb(n[r],t))return!0;return!1},Polygon:function(e,t){return Yb(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(Yb(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)if(Al(n[r],t))return!0;return!1}};function Al(e,t){return e&&Gb.hasOwnProperty(e.type)?Gb[e.type](e,t):!1}function Wb(e,t){return _l(e,t)===0}function Vb(e,t){for(var n,r,i,o=0,a=e.length;o<a;o++){if(r=_l(e[o],t),r===0||o>0&&(i=_l(e[o],e[o-1]),i>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<No*i))return!0;n=r}return!1}function Yb(e,t){return!!Bb(e.map(w8),Xb(t))}function w8(e){return e=e.map(Xb),e.pop(),e}function Xb(e){return[e[0]*se,e[1]*se]}function P8(e,t){return(e&&Ob.hasOwnProperty(e.type)?Ob[e.type]:Al)(e,t)}function Ub(e,t,n){var r=Cn(e,t-ae,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function jb(e,t,n){var r=Cn(e,t-ae,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function Hb(){var e,t,n,r,i,o,a,s,l=10,u=l,c=90,h=360,f,p,d,m,g=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Cn(nl(r/c)*c,n,c).map(d).concat(Cn(nl(s/h)*h,a,h).map(m)).concat(Cn(nl(t/l)*l,e,l).filter(function(x){return de(x%c)>ae}).map(f)).concat(Cn(nl(o/u)*u,i,u).filter(function(x){return de(x%h)>ae}).map(p))}return y.lines=function(){return b().map(function(x){return{type:"LineString",coordinates:x}})},y.outline=function(){return{type:"Polygon",coordinates:[d(r).concat(m(a).slice(1),d(n).reverse().slice(1),m(s).reverse().slice(1))]}},y.extent=function(x){return arguments.length?y.extentMajor(x).extentMinor(x):y.extentMinor()},y.extentMajor=function(x){return arguments.length?(r=+x[0][0],n=+x[1][0],s=+x[0][1],a=+x[1][1],r>n&&(x=r,r=n,n=x),s>a&&(x=s,s=a,a=x),y.precision(g)):[[r,s],[n,a]]},y.extentMinor=function(x){return arguments.length?(t=+x[0][0],e=+x[1][0],o=+x[0][1],i=+x[1][1],t>e&&(x=t,t=e,e=x),o>i&&(x=o,o=i,i=x),y.precision(g)):[[t,o],[e,i]]},y.step=function(x){return arguments.length?y.stepMajor(x).stepMinor(x):y.stepMinor()},y.stepMajor=function(x){return arguments.length?(c=+x[0],h=+x[1],y):[c,h]},y.stepMinor=function(x){return arguments.length?(l=+x[0],u=+x[1],y):[l,u]},y.precision=function(x){return arguments.length?(g=+x,f=Ub(o,i,90),p=jb(t,e,g),d=Ub(s,a,90),m=jb(r,n,g),y):g},y.extentMajor([[-180,-90+ae],[180,90-ae]]).extentMinor([[-180,-80-ae],[180,80+ae]])}function D8(){return Hb()()}function C8(e,t){var n=e[0]*se,r=e[1]*se,i=t[0]*se,o=t[1]*se,a=oe(r),s=re(r),l=oe(o),u=re(o),c=a*oe(n),h=a*re(n),f=l*oe(i),p=l*re(i),d=2*tt(Be(lb(o-r)+a*l*lb(i-n))),m=re(d),g=d?function(y){var b=re(y*=d)/m,x=re(d-y)/m,$=x*c+b*f,S=x*h+b*p,_=x*s+b*u;return[et(S,$)*$e,et(_,Be($*$+S*S))*$e]}:function(){return[n*$e,r*$e]};return g.distance=d,g}const Wo=e=>e;var ph=new Me,gh=new Me,qb,Zb,dh,mh,dn={point:Ae,lineStart:Ae,lineEnd:Ae,polygonStart:function(){dn.lineStart=L8,dn.lineEnd=k8},polygonEnd:function(){dn.lineStart=dn.lineEnd=dn.point=Ae,ph.add(de(gh)),gh=new Me},result:function(){var e=ph/2;return ph=new Me,e}};function L8(){dn.point=M8}function M8(e,t){dn.point=Kb,qb=dh=e,Zb=mh=t}function Kb(e,t){gh.add(mh*e-dh*t),dh=e,mh=t}function k8(){Kb(qb,Zb)}var xi=1/0,wl=xi,Vo=-xi,Pl=Vo,Dl={point:R8,lineStart:Ae,lineEnd:Ae,polygonStart:Ae,polygonEnd:Ae,result:function(){var e=[[xi,wl],[Vo,Pl]];return Vo=Pl=-(wl=xi=1/0),e}};function R8(e,t){e<xi&&(xi=e),e>Vo&&(Vo=e),t<wl&&(wl=t),t>Pl&&(Pl=t)}var yh=0,bh=0,Yo=0,Cl=0,Ll=0,$i=0,xh=0,$h=0,Xo=0,Qb,Jb,Kt,Qt,_t={point:yr,lineStart:e1,lineEnd:t1,polygonStart:function(){_t.lineStart=B8,_t.lineEnd=N8},polygonEnd:function(){_t.point=yr,_t.lineStart=e1,_t.lineEnd=t1},result:function(){var e=Xo?[xh/Xo,$h/Xo]:$i?[Cl/$i,Ll/$i]:Yo?[yh/Yo,bh/Yo]:[NaN,NaN];return yh=bh=Yo=Cl=Ll=$i=xh=$h=Xo=0,e}};function yr(e,t){yh+=e,bh+=t,++Yo}function e1(){_t.point=I8}function I8(e,t){_t.point=E8,yr(Kt=e,Qt=t)}function E8(e,t){var n=e-Kt,r=t-Qt,i=Be(n*n+r*r);Cl+=i*(Kt+e)/2,Ll+=i*(Qt+t)/2,$i+=i,yr(Kt=e,Qt=t)}function t1(){_t.point=yr}function B8(){_t.point=F8}function N8(){n1(Qb,Jb)}function F8(e,t){_t.point=n1,yr(Qb=Kt=e,Jb=Qt=t)}function n1(e,t){var n=e-Kt,r=t-Qt,i=Be(n*n+r*r);Cl+=i*(Kt+e)/2,Ll+=i*(Qt+t)/2,$i+=i,i=Qt*e-Kt*t,xh+=i*(Kt+e),$h+=i*(Qt+t),Xo+=i*3,yr(Kt=e,Qt=t)}function r1(e){this._context=e}r1.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Je);break}}},result:Ae};var vh=new Me,Sh,i1,o1,Uo,jo,Ho={point:Ae,lineStart:function(){Ho.point=z8},lineEnd:function(){Sh&&a1(i1,o1),Ho.point=Ae},polygonStart:function(){Sh=!0},polygonEnd:function(){Sh=null},result:function(){var e=+vh;return vh=new Me,e}};function z8(e,t){Ho.point=a1,i1=Uo=e,o1=jo=t}function a1(e,t){Uo-=e,jo-=t,vh.add(Be(Uo*Uo+jo*jo)),Uo=e,jo=t}let s1,Ml,l1,u1;class c1{constructor(t){this._append=t==null?f1:O8(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==l1||this._append!==Ml){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,l1=r,Ml=this._append,u1=this._,this._=i}this._+=u1;break}}}result(){const t=this._;return this._="",t.length?t:null}}function f1(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function O8(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return f1;if(t!==s1){const n=10**t;s1=t,Ml=function(i){let o=1;this._+=i[0];for(const a=i.length;o<a;++o)this._+=Math.round(arguments[o]*n)/n+i[o]}}return Ml}function G8(e,t){let n=3,r=4.5,i,o;function a(s){return s&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),zt(s,i(o))),o.result()}return a.area=function(s){return zt(s,i(dn)),dn.result()},a.measure=function(s){return zt(s,i(Ho)),Ho.result()},a.bounds=function(s){return zt(s,i(Dl)),Dl.result()},a.centroid=function(s){return zt(s,i(_t)),_t.result()},a.projection=function(s){return arguments.length?(i=s==null?(e=null,Wo):(e=s).stream,a):e},a.context=function(s){return arguments.length?(o=s==null?(t=null,new c1(n)):new r1(t=s),typeof r!="function"&&o.pointRadius(r),a):t},a.pointRadius=function(s){return arguments.length?(r=typeof s=="function"?s:(o.pointRadius(+s),+s),a):r},a.digits=function(s){if(!arguments.length)return n;if(s==null)n=null;else{const l=Math.floor(s);if(!(l>=0))throw new RangeError(`invalid digits: ${s}`);n=l}return t===null&&(o=new c1(n)),a},a.projection(e).digits(n).context(t)}function W8(e){return{stream:qo(e)}}function qo(e){return function(t){var n=new Th;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Th(){}Th.prototype={constructor:Th,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function _h(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),zt(n,e.stream(Dl)),t(Dl.result()),r!=null&&e.clipExtent(r),e}function kl(e,t,n){return _h(e,function(r){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],a=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),s=+t[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(o-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([s,l])},n)}function Ah(e,t,n){return kl(e,[[0,0],t],n)}function wh(e,t,n){return _h(e,function(r){var i=+t,o=i/(r[1][0]-r[0][0]),a=(i-o*(r[1][0]+r[0][0]))/2,s=-o*r[0][1];e.scale(150*o).translate([a,s])},n)}function Ph(e,t,n){return _h(e,function(r){var i=+t,o=i/(r[1][1]-r[0][1]),a=-o*r[0][0],s=(i-o*(r[1][1]+r[0][1]))/2;e.scale(150*o).translate([a,s])},n)}var h1=16,V8=oe(30*se);function p1(e,t){return+t?X8(e,t):Y8(e)}function Y8(e){return qo({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function X8(e,t){function n(r,i,o,a,s,l,u,c,h,f,p,d,m,g){var y=u-r,b=c-i,x=y*y+b*b;if(x>4*t&&m--){var $=a+f,S=s+p,_=l+d,A=Be($*$+S*S+_*_),w=tt(_/=A),P=de(de(_)-1)<ae||de(o-h)<ae?(o+h)/2:et(S,$),I=e(P,w),v=I[0],N=I[1],R=v-r,D=N-i,T=b*R-y*D;(T*T/x>t||de((y*R+b*D)/x-.5)>.3||a*f+s*p+l*d<V8)&&(n(r,i,o,a,s,l,v,N,P,$/=A,S/=A,_,m,g),g.point(v,N),n(v,N,P,$,S,_,u,c,h,f,p,d,m,g))}}return function(r){var i,o,a,s,l,u,c,h,f,p,d,m,g={point:y,lineStart:b,lineEnd:$,polygonStart:function(){r.polygonStart(),g.lineStart=S},polygonEnd:function(){r.polygonEnd(),g.lineStart=b}};function y(w,P){w=e(w,P),r.point(w[0],w[1])}function b(){h=NaN,g.point=x,r.lineStart()}function x(w,P){var I=dr([w,P]),v=e(w,P);n(h,f,c,p,d,m,h=v[0],f=v[1],c=w,p=I[0],d=I[1],m=I[2],h1,r),r.point(h,f)}function $(){g.point=y,r.lineEnd()}function S(){b(),g.point=_,g.lineEnd=A}function _(w,P){x(i=w,P),o=h,a=f,s=p,l=d,u=m,g.point=x}function A(){n(h,f,c,p,d,m,o,a,i,s,l,u,h1,r),g.lineEnd=$,$()}return g}}var U8=qo({point:function(e,t){this.stream.point(e*se,t*se)}});function j8(e){return qo({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function H8(e,t,n,r,i){function o(a,s){return a*=r,s*=i,[t+e*a,n-e*s]}return o.invert=function(a,s){return[(a-t)/e*r,(n-s)/e*i]},o}function g1(e,t,n,r,i,o){if(!o)return H8(e,t,n,r,i);var a=oe(o),s=re(o),l=a*e,u=s*e,c=a/e,h=s/e,f=(s*n-a*t)/e,p=(s*t+a*n)/e;function d(m,g){return m*=r,g*=i,[l*m-u*g+t,n-u*m-l*g]}return d.invert=function(m,g){return[r*(c*m-h*g+f),i*(p-h*m-c*g)]},d}function Jt(e){return Dh(function(){return e})()}function Dh(e){var t,n=150,r=480,i=250,o=0,a=0,s=0,l=0,u=0,c,h=0,f=1,p=1,d=null,m=uh,g=null,y,b,x,$=Wo,S=.5,_,A,w,P,I;function v(T){return w(T[0]*se,T[1]*se)}function N(T){return T=w.invert(T[0],T[1]),T&&[T[0]*$e,T[1]*$e]}v.stream=function(T){return P&&I===T?P:P=U8(j8(c)(m(_($(I=T)))))},v.preclip=function(T){return arguments.length?(m=T,d=void 0,D()):m},v.postclip=function(T){return arguments.length?($=T,g=y=b=x=null,D()):$},v.clipAngle=function(T){return arguments.length?(m=+T?Fb(d=T*se):(d=null,uh),D()):d*$e},v.clipExtent=function(T){return arguments.length?($=T==null?(g=y=b=x=null,Wo):vl(g=+T[0][0],y=+T[0][1],b=+T[1][0],x=+T[1][1]),D()):g==null?null:[[g,y],[b,x]]},v.scale=function(T){return arguments.length?(n=+T,R()):n},v.translate=function(T){return arguments.length?(r=+T[0],i=+T[1],R()):[r,i]},v.center=function(T){return arguments.length?(o=T[0]%360*se,a=T[1]%360*se,R()):[o*$e,a*$e]},v.rotate=function(T){return arguments.length?(s=T[0]%360*se,l=T[1]%360*se,u=T.length>2?T[2]%360*se:0,R()):[s*$e,l*$e,u*$e]},v.angle=function(T){return arguments.length?(h=T%360*se,R()):h*$e},v.reflectX=function(T){return arguments.length?(f=T?-1:1,R()):f<0},v.reflectY=function(T){return arguments.length?(p=T?-1:1,R()):p<0},v.precision=function(T){return arguments.length?(_=p1(A,S=T*T),D()):Be(S)},v.fitExtent=function(T,M){return kl(v,T,M)},v.fitSize=function(T,M){return Ah(v,T,M)},v.fitWidth=function(T,M){return wh(v,T,M)},v.fitHeight=function(T,M){return Ph(v,T,M)};function R(){var T=g1(n,0,0,f,p,h).apply(null,t(o,a)),M=g1(n,r-T[0],i-T[1],f,p,h);return c=sh(s,l,u),A=oh(t,M),w=oh(c,A),_=p1(A,S),D()}function D(){return P=I=null,v}return function(){return t=e.apply(this,arguments),v.invert=t.invert&&N,R()}}function Ch(e){var t=0,n=ge/3,r=Dh(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*se,n=o[1]*se):[t*$e,n*$e]},i}function q8(e){var t=oe(e);function n(r,i){return[r*t,re(i)/t]}return n.invert=function(r,i){return[r/t,tt(i*t)]},n}function d1(e,t){var n=re(e),r=(n+re(t))/2;if(de(r)<ae)return q8(e);var i=1+n*(2*r-n),o=Be(i)/r;function a(s,l){var u=Be(i-2*r*re(l))/r;return[u*re(s*=r),o-u*oe(s)]}return a.invert=function(s,l){var u=o-l,c=et(s,de(u))*Tt(u);return u*r<0&&(c-=ge*Tt(s)*Tt(u)),[c/r,tt((i-(s*s+u*u)*r*r)/(2*r))]},a}function Rl(){return Ch(d1).scale(155.424).center([0,33.6442])}function m1(){return Rl().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Z8(e){var t=e.length;return{point:function(n,r){for(var i=-1;++i<t;)e[i].point(n,r)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function K8(){var e,t,n=m1(),r,i=Rl().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,a=Rl().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s,l,u={point:function(f,p){l=[f,p]}};function c(f){var p=f[0],d=f[1];return l=null,r.point(p,d),l||(o.point(p,d),l)||(s.point(p,d),l)}c.invert=function(f){var p=n.scale(),d=n.translate(),m=(f[0]-d[0])/p,g=(f[1]-d[1])/p;return(g>=.12&&g<.234&&m>=-.425&&m<-.214?i:g>=.166&&g<.234&&m>=-.214&&m<-.115?a:n).invert(f)},c.stream=function(f){return e&&t===f?e:e=Z8([n.stream(t=f),i.stream(f),a.stream(f)])},c.precision=function(f){return arguments.length?(n.precision(f),i.precision(f),a.precision(f),h()):n.precision()},c.scale=function(f){return arguments.length?(n.scale(f),i.scale(f*.35),a.scale(f),c.translate(n.translate())):n.scale()},c.translate=function(f){if(!arguments.length)return n.translate();var p=n.scale(),d=+f[0],m=+f[1];return r=n.translate(f).clipExtent([[d-.455*p,m-.238*p],[d+.455*p,m+.238*p]]).stream(u),o=i.translate([d-.307*p,m+.201*p]).clipExtent([[d-.425*p+ae,m+.12*p+ae],[d-.214*p-ae,m+.234*p-ae]]).stream(u),s=a.translate([d-.205*p,m+.212*p]).clipExtent([[d-.214*p+ae,m+.166*p+ae],[d-.115*p-ae,m+.234*p-ae]]).stream(u),h()},c.fitExtent=function(f,p){return kl(c,f,p)},c.fitSize=function(f,p){return Ah(c,f,p)},c.fitWidth=function(f,p){return wh(c,f,p)},c.fitHeight=function(f,p){return Ph(c,f,p)};function h(){return e=t=null,c}return c.scale(1070)}function y1(e){return function(t,n){var r=oe(t),i=oe(n),o=e(r*i);return o===1/0?[2,0]:[o*i*re(t),o*re(n)]}}function Zo(e){return function(t,n){var r=Be(t*t+n*n),i=e(r),o=re(i),a=oe(i);return[et(t*o,r*a),tt(r&&n*o/r)]}}var Lh=y1(function(e){return Be(2/(1+e))});Lh.invert=Zo(function(e){return 2*tt(e/2)});function Q8(){return Jt(Lh).scale(124.75).clipAngle(180-.001)}var Mh=y1(function(e){return(e=sb(e))&&e/re(e)});Mh.invert=Zo(function(e){return e});function J8(){return Jt(Mh).scale(79.4188).clipAngle(180-.001)}function Ko(e,t){return[e,rl(Hf((Pe+t)/2))]}Ko.invert=function(e,t){return[e,2*gi(ab(t))-Pe]};function e4(){return b1(Ko).scale(961/Je)}function b1(e){var t=Jt(e),n=t.center,r=t.scale,i=t.translate,o=t.clipExtent,a=null,s,l,u;t.scale=function(h){return arguments.length?(r(h),c()):r()},t.translate=function(h){return arguments.length?(i(h),c()):i()},t.center=function(h){return arguments.length?(n(h),c()):n()},t.clipExtent=function(h){return arguments.length?(h==null?a=s=l=u=null:(a=+h[0][0],s=+h[0][1],l=+h[1][0],u=+h[1][1]),c()):a==null?null:[[a,s],[l,u]]};function c(){var h=ge*r(),f=t(Lb(t.rotate()).invert([0,0]));return o(a==null?[[f[0]-h,f[1]-h],[f[0]+h,f[1]+h]]:e===Ko?[[Math.max(f[0]-h,a),s],[Math.min(f[0]+h,l),u]]:[[a,Math.max(f[1]-h,s)],[l,Math.min(f[1]+h,u)]])}return c()}function Il(e){return Hf((Pe+e)/2)}function x1(e,t){var n=oe(e),r=e===t?re(e):rl(n/oe(t))/rl(Il(t)/Il(e)),i=n*jf(Il(e),r)/r;if(!r)return Ko;function o(a,s){i>0?s<-Pe+ae&&(s=-Pe+ae):s>Pe-ae&&(s=Pe-ae);var l=i/jf(Il(s),r);return[l*re(r*a),i-l*oe(r*a)]}return o.invert=function(a,s){var l=i-s,u=Tt(r)*Be(a*a+l*l),c=et(a,de(l))*Tt(l);return l*r<0&&(c-=ge*Tt(a)*Tt(l)),[c/r,2*gi(jf(i/u,1/r))-Pe]},o}function t4(){return Ch(x1).scale(109.5).parallels([30,30])}function Qo(e,t){return[e,t]}Qo.invert=Qo;function n4(){return Jt(Qo).scale(152.63)}function $1(e,t){var n=oe(e),r=e===t?re(e):(n-oe(t))/(t-e),i=n/r+e;if(de(r)<ae)return Qo;function o(a,s){var l=i-s,u=r*a;return[l*re(u),i-l*oe(u)]}return o.invert=function(a,s){var l=i-s,u=et(a,de(l))*Tt(l);return l*r<0&&(u-=ge*Tt(a)*Tt(l)),[u/r,i-Tt(r)*Be(a*a+l*l)]},o}function r4(){return Ch($1).scale(131.154).center([0,13.9389])}var Jo=1.340264,ea=-.081106,ta=893e-6,na=.003796,El=Be(3)/2,i4=12;function kh(e,t){var n=tt(El*re(t)),r=n*n,i=r*r*r;return[e*oe(n)/(El*(Jo+3*ea*r+i*(7*ta+9*na*r))),n*(Jo+ea*r+i*(ta+na*r))]}kh.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,o=0,a,s,l;o<i4&&(s=n*(Jo+ea*r+i*(ta+na*r))-t,l=Jo+3*ea*r+i*(7*ta+9*na*r),n-=a=s/l,r=n*n,i=r*r*r,!(de(a)<No));++o);return[El*e*(Jo+3*ea*r+i*(7*ta+9*na*r))/oe(n),tt(re(n)/El)]};function o4(){return Jt(kh).scale(177.158)}function Rh(e,t){var n=oe(t),r=oe(e)*n;return[n*re(e)/r,re(t)/r]}Rh.invert=Zo(gi);function a4(){return Jt(Rh).scale(144.049).clipAngle(60)}function s4(){var e=1,t=0,n=0,r=1,i=1,o=0,a,s,l=null,u,c,h,f=1,p=1,d=qo({point:function($,S){var _=x([$,S]);this.stream.point(_[0],_[1])}}),m=Wo,g,y;function b(){return f=e*r,p=e*i,g=y=null,x}function x($){var S=$[0]*f,_=$[1]*p;if(o){var A=_*a-S*s;S=S*a+_*s,_=A}return[S+t,_+n]}return x.invert=function($){var S=$[0]-t,_=$[1]-n;if(o){var A=_*a+S*s;S=S*a-_*s,_=A}return[S/f,_/p]},x.stream=function($){return g&&y===$?g:g=d(m(y=$))},x.postclip=function($){return arguments.length?(m=$,l=u=c=h=null,b()):m},x.clipExtent=function($){return arguments.length?(m=$==null?(l=u=c=h=null,Wo):vl(l=+$[0][0],u=+$[0][1],c=+$[1][0],h=+$[1][1]),b()):l==null?null:[[l,u],[c,h]]},x.scale=function($){return arguments.length?(e=+$,b()):e},x.translate=function($){return arguments.length?(t=+$[0],n=+$[1],b()):[t,n]},x.angle=function($){return arguments.length?(o=$%360*se,s=re(o),a=oe(o),b()):o*$e},x.reflectX=function($){return arguments.length?(r=$?-1:1,b()):r<0},x.reflectY=function($){return arguments.length?(i=$?-1:1,b()):i<0},x.fitExtent=function($,S){return kl(x,$,S)},x.fitSize=function($,S){return Ah(x,$,S)},x.fitWidth=function($,S){return wh(x,$,S)},x.fitHeight=function($,S){return Ph(x,$,S)},x}function Ih(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}Ih.invert=function(e,t){var n=t,r=25,i;do{var o=n*n,a=o*o;n-=i=(n*(1.007226+o*(.015085+a*(-.044475+.028874*o-.005916*a)))-t)/(1.007226+o*(.015085*3+a*(-.044475*7+.028874*9*o-.005916*11*a)))}while(de(i)>ae&&--r>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function l4(){return Jt(Ih).scale(175.295)}function Eh(e,t){return[oe(t)*re(e),re(t)]}Eh.invert=Zo(tt);function u4(){return Jt(Eh).scale(249.5).clipAngle(90+ae)}function Bh(e,t){var n=oe(t),r=1+oe(e)*n;return[n*re(e)/r,re(t)/r]}Bh.invert=Zo(function(e){return 2*gi(e)});function c4(){return Jt(Bh).scale(250).clipAngle(142)}function Nh(e,t){return[rl(Hf((Pe+t)/2)),-e]}Nh.invert=function(e,t){return[-t,2*gi(ab(e))-Pe]};function f4(){var e=b1(Nh),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}function h4(e,t){return e.parent===t.parent?1:2}function p4(e){return e.reduce(g4,0)/e.length}function g4(e,t){return e+t.x}function d4(e){return 1+e.reduce(m4,0)}function m4(e,t){return Math.max(e,t.y)}function y4(e){for(var t;t=e.children;)e=t[0];return e}function b4(e){for(var t;t=e.children;)e=t[t.length-1];return e}function x4(){var e=h4,t=1,n=1,r=!1;function i(o){var a,s=0;o.eachAfter(function(f){var p=f.children;p?(f.x=p4(p),f.y=d4(p)):(f.x=a?s+=e(f,a):0,f.y=0,a=f)});var l=y4(o),u=b4(o),c=l.x-e(l,u)/2,h=u.x+e(u,l)/2;return o.eachAfter(r?function(f){f.x=(f.x-o.x)*t,f.y=(o.y-f.y)*n}:function(f){f.x=(f.x-c)/(h-c)*t,f.y=(1-(o.y?f.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(e=o,i):e},i.size=function(o){return arguments.length?(r=!1,t=+o[0],n=+o[1],i):r?null:[t,n]},i.nodeSize=function(o){return arguments.length?(r=!0,t=+o[0],n=+o[1],i):r?[t,n]:null},i}function $4(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function v4(){return this.eachAfter($4)}function S4(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function T4(e,t){for(var n=this,r=[n],i,o,a=-1;n=r.pop();)if(e.call(t,n,++a,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function _4(e,t){for(var n=this,r=[n],i=[],o,a,s,l=-1;n=r.pop();)if(i.push(n),o=n.children)for(a=0,s=o.length;a<s;++a)r.push(o[a]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function A4(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function w4(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function P4(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function D4(e){for(var t=this,n=C4(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function C4(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function L4(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function M4(){return Array.from(this)}function k4(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function R4(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*I4(){var e=this,t,n=[e],r,i,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,o=r.length;i<o;++i)n.push(r[i]);while(n.length)}function Bl(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=N4)):t===void 0&&(t=B4);for(var n=new br(e),r,i=[n],o,a,s,l;r=i.pop();)if((a=t(r.data))&&(l=(a=Array.from(a)).length))for(r.children=a,s=l-1;s>=0;--s)i.push(o=a[s]=new br(a[s])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(v1)}function E4(){return Bl(this).eachBefore(F4)}function B4(e){return e.children}function N4(e){return Array.isArray(e)?e[1]:null}function F4(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function v1(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function br(e){this.data=e,this.depth=this.height=0,this.parent=null}br.prototype=Bl.prototype={constructor:br,count:v4,each:S4,eachAfter:_4,eachBefore:T4,find:A4,sum:w4,sort:P4,path:D4,ancestors:L4,descendants:M4,leaves:k4,links:R4,copy:E4,[Symbol.iterator]:I4};function Nl(e){return e==null?null:S1(e)}function S1(e){if(typeof e!="function")throw new Error;return e}function xr(){return 0}function vi(e){return function(){return e}}const z4=1664525,O4=1013904223,T1=4294967296;function Fh(){let e=1;return()=>(e=(z4*e+O4)%T1)/T1}function G4(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function W4(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function V4(e){return _1(e,Fh())}function _1(e,t){for(var n=0,r=(e=W4(Array.from(e),t)).length,i=[],o,a;n<r;)o=e[n],a&&A1(a,o)?++n:(a=X4(i=Y4(i,o)),n=0);return a}function Y4(e,t){var n,r;if(zh(t,e))return[t];for(n=0;n<e.length;++n)if(Fl(t,e[n])&&zh(ra(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(Fl(ra(e[n],e[r]),t)&&Fl(ra(e[n],t),e[r])&&Fl(ra(e[r],t),e[n])&&zh(w1(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function Fl(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function A1(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function zh(e,t){for(var n=0;n<t.length;++n)if(!A1(e,t[n]))return!1;return!0}function X4(e){switch(e.length){case 1:return U4(e[0]);case 2:return ra(e[0],e[1]);case 3:return w1(e[0],e[1],e[2])}}function U4(e){return{x:e.x,y:e.y,r:e.r}}function ra(e,t){var n=e.x,r=e.y,i=e.r,o=t.x,a=t.y,s=t.r,l=o-n,u=a-r,c=s-i,h=Math.sqrt(l*l+u*u);return{x:(n+o+l/h*c)/2,y:(r+a+u/h*c)/2,r:(h+i+s)/2}}function w1(e,t,n){var r=e.x,i=e.y,o=e.r,a=t.x,s=t.y,l=t.r,u=n.x,c=n.y,h=n.r,f=r-a,p=r-u,d=i-s,m=i-c,g=l-o,y=h-o,b=r*r+i*i-o*o,x=b-a*a-s*s+l*l,$=b-u*u-c*c+h*h,S=p*d-f*m,_=(d*$-m*x)/(S*2)-r,A=(m*g-d*y)/S,w=(p*x-f*$)/(S*2)-i,P=(f*y-p*g)/S,I=A*A+P*P-1,v=2*(o+_*A+w*P),N=_*_+w*w-o*o,R=-(Math.abs(I)>1e-6?(v+Math.sqrt(v*v-4*I*N))/(2*I):N/v);return{x:r+_+A*R,y:i+w+P*R,r:R}}function P1(e,t,n){var r=e.x-t.x,i,o,a=e.y-t.y,s,l,u=r*r+a*a;u?(o=t.r+n.r,o*=o,l=e.r+n.r,l*=l,o>l?(i=(u+l-o)/(2*u),s=Math.sqrt(Math.max(0,l/u-i*i)),n.x=e.x-i*r-s*a,n.y=e.y-i*a+s*r):(i=(u+o-l)/(2*u),s=Math.sqrt(Math.max(0,o/u-i*i)),n.x=t.x+i*r-s*a,n.y=t.y+i*a+s*r)):(n.x=t.x+n.r,n.y=t.y)}function D1(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function C1(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,o=(t.y*n.r+n.y*t.r)/r;return i*i+o*o}function zl(e){this._=e,this.next=null,this.previous=null}function L1(e,t){if(!(o=(e=G4(e)).length))return 0;var n,r,i,o,a,s,l,u,c,h,f;if(n=e[0],n.x=0,n.y=0,!(o>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;P1(r,n,i=e[2]),n=new zl(n),r=new zl(r),i=new zl(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(l=3;l<o;++l){P1(n._,r._,i=e[l]),i=new zl(i),u=r.next,c=n.previous,h=r._.r,f=n._.r;do if(h<=f){if(D1(u._,i._)){r=u,n.next=r,r.previous=n,--l;continue e}h+=u._.r,u=u.next}else{if(D1(c._,i._)){n=c,n.next=r,r.previous=n,--l;continue e}f+=c._.r,c=c.previous}while(u!==c.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=C1(n);(i=i.next)!==r;)(s=C1(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=_1(n,t),l=0;l<o;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function j4(e){return L1(e,Fh()),e}function H4(e){return Math.sqrt(e.value)}function q4(){var e=null,t=1,n=1,r=xr;function i(o){const a=Fh();return o.x=t/2,o.y=n/2,e?o.eachBefore(M1(e)).eachAfter(Oh(r,.5,a)).eachBefore(k1(1)):o.eachBefore(M1(H4)).eachAfter(Oh(xr,1,a)).eachAfter(Oh(r,o.r/Math.min(t,n),a)).eachBefore(k1(Math.min(t,n)/(2*o.r))),o}return i.radius=function(o){return arguments.length?(e=Nl(o),i):e},i.size=function(o){return arguments.length?(t=+o[0],n=+o[1],i):[t,n]},i.padding=function(o){return arguments.length?(r=typeof o=="function"?o:vi(+o),i):r},i}function M1(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Oh(e,t,n){return function(r){if(i=r.children){var i,o,a=i.length,s=e(r)*t||0,l;if(s)for(o=0;o<a;++o)i[o].r+=s;if(l=L1(i,n),s)for(o=0;o<a;++o)i[o].r-=s;r.r=l+s}}}function k1(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function R1(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ia(e,t,n,r,i){for(var o=e.children,a,s=-1,l=o.length,u=e.value&&(r-t)/e.value;++s<l;)a=o[s],a.y0=n,a.y1=i,a.x0=t,a.x1=t+=a.value*u}function Z4(){var e=1,t=1,n=0,r=!1;function i(a){var s=a.height+1;return a.x0=a.y0=n,a.x1=e,a.y1=t/s,a.eachBefore(o(t,s)),r&&a.eachBefore(R1),a}function o(a,s){return function(l){l.children&&ia(l,l.x0,a*(l.depth+1)/s,l.x1,a*(l.depth+2)/s);var u=l.x0,c=l.y0,h=l.x1-n,f=l.y1-n;h<u&&(u=h=(u+h)/2),f<c&&(c=f=(c+f)/2),l.x0=u,l.y0=c,l.x1=h,l.y1=f}}return i.round=function(a){return arguments.length?(r=!!a,i):r},i.size=function(a){return arguments.length?(e=+a[0],t=+a[1],i):[e,t]},i.padding=function(a){return arguments.length?(n=+a,i):n},i}var K4={depth:-1},I1={},Gh={};function Q4(e){return e.id}function J4(e){return e.parentId}function eR(){var e=Q4,t=J4,n;function r(i){var o=Array.from(i),a=e,s=t,l,u,c,h,f,p,d,m,g=new Map;if(n!=null){const y=o.map(($,S)=>tR(n($,S,i))),b=y.map(E1),x=new Set(y).add("");for(const $ of b)x.has($)||(x.add($),y.push($),b.push(E1($)),o.push(Gh));a=($,S)=>y[S],s=($,S)=>b[S]}for(c=0,l=o.length;c<l;++c)u=o[c],p=o[c]=new br(u),(d=a(u,c,i))!=null&&(d+="")&&(m=p.id=d,g.set(m,g.has(m)?I1:p)),(d=s(u,c,i))!=null&&(d+="")&&(p.parent=d);for(c=0;c<l;++c)if(p=o[c],d=p.parent){if(f=g.get(d),!f)throw new Error("missing: "+d);if(f===I1)throw new Error("ambiguous: "+d);f.children?f.children.push(p):f.children=[p],p.parent=f}else{if(h)throw new Error("multiple roots");h=p}if(!h)throw new Error("no root");if(n!=null){for(;h.data===Gh&&h.children.length===1;)h=h.children[0],--l;for(let y=o.length-1;y>=0&&(p=o[y],p.data===Gh);--y)p.data=null}if(h.parent=K4,h.eachBefore(function(y){y.depth=y.parent.depth+1,--l}).eachBefore(v1),h.parent=null,l>0)throw new Error("cycle");return h}return r.id=function(i){return arguments.length?(e=Nl(i),r):e},r.parentId=function(i){return arguments.length?(t=Nl(i),r):t},r.path=function(i){return arguments.length?(n=Nl(i),r):n},r}function tR(e){e=`${e}`;let t=e.length;return Wh(e,t-1)&&!Wh(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function E1(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Wh(e,t););return e.slice(0,t)}function Wh(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function nR(e,t){return e.parent===t.parent?1:2}function Vh(e){var t=e.children;return t?t[0]:e.t}function Yh(e){var t=e.children;return t?t[t.length-1]:e.t}function rR(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function iR(e){for(var t=0,n=0,r=e.children,i=r.length,o;--i>=0;)o=r[i],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function oR(e,t,n){return e.a.parent===t.parent?e.a:n}function Ol(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Ol.prototype=Object.create(br.prototype);function aR(e){for(var t=new Ol(e,0),n,r=[t],i,o,a,s;n=r.pop();)if(o=n._.children)for(n.children=new Array(s=o.length),a=s-1;a>=0;--a)r.push(i=n.children[a]=new Ol(o[a],a)),i.parent=n;return(t.parent=new Ol(null,0)).children=[t],t}function sR(){var e=nR,t=1,n=1,r=null;function i(u){var c=aR(u);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)u.eachBefore(l);else{var h=u,f=u,p=u;u.eachBefore(function(b){b.x<h.x&&(h=b),b.x>f.x&&(f=b),b.depth>p.depth&&(p=b)});var d=h===f?1:e(h,f)/2,m=d-h.x,g=t/(f.x+d+m),y=n/(p.depth||1);u.eachBefore(function(b){b.x=(b.x+m)*g,b.y=b.depth*y})}return u}function o(u){var c=u.children,h=u.parent.children,f=u.i?h[u.i-1]:null;if(c){iR(u);var p=(c[0].z+c[c.length-1].z)/2;f?(u.z=f.z+e(u._,f._),u.m=u.z-p):u.z=p}else f&&(u.z=f.z+e(u._,f._));u.parent.A=s(u,f,u.parent.A||h[0])}function a(u){u._.x=u.z+u.parent.m,u.m+=u.parent.m}function s(u,c,h){if(c){for(var f=u,p=u,d=c,m=f.parent.children[0],g=f.m,y=p.m,b=d.m,x=m.m,$;d=Yh(d),f=Vh(f),d&&f;)m=Vh(m),p=Yh(p),p.a=u,$=d.z+b-f.z-g+e(d._,f._),$>0&&(rR(oR(d,u,h),u,$),g+=$,y+=$),b+=d.m,g+=f.m,x+=m.m,y+=p.m;d&&!Yh(p)&&(p.t=d,p.m+=b-y),f&&!Vh(m)&&(m.t=f,m.m+=g-x,h=u)}return h}function l(u){u.x*=t,u.y=u.depth*n}return i.separation=function(u){return arguments.length?(e=u,i):e},i.size=function(u){return arguments.length?(r=!1,t=+u[0],n=+u[1],i):r?null:[t,n]},i.nodeSize=function(u){return arguments.length?(r=!0,t=+u[0],n=+u[1],i):r?[t,n]:null},i}function Gl(e,t,n,r,i){for(var o=e.children,a,s=-1,l=o.length,u=e.value&&(i-n)/e.value;++s<l;)a=o[s],a.x0=t,a.x1=r,a.y0=n,a.y1=n+=a.value*u}var B1=(1+Math.sqrt(5))/2;function N1(e,t,n,r,i,o){for(var a=[],s=t.children,l,u,c=0,h=0,f=s.length,p,d,m=t.value,g,y,b,x,$,S,_;c<f;){p=i-n,d=o-r;do g=s[h++].value;while(!g&&h<f);for(y=b=g,S=Math.max(d/p,p/d)/(m*e),_=g*g*S,$=Math.max(b/_,_/y);h<f;++h){if(g+=u=s[h].value,u<y&&(y=u),u>b&&(b=u),_=g*g*S,x=Math.max(b/_,_/y),x>$){g-=u;break}$=x}a.push(l={value:g,dice:p<d,children:s.slice(c,h)}),l.dice?ia(l,n,r,i,m?r+=d*g/m:o):Gl(l,n,r,m?n+=p*g/m:i,o),m-=g,c=h}return a}const Xh=function e(t){function n(r,i,o,a,s){N1(t,r,i,o,a,s)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(B1);function F1(){var e=Xh,t=!1,n=1,r=1,i=[0],o=xr,a=xr,s=xr,l=xr,u=xr;function c(f){return f.x0=f.y0=0,f.x1=n,f.y1=r,f.eachBefore(h),i=[0],t&&f.eachBefore(R1),f}function h(f){var p=i[f.depth],d=f.x0+p,m=f.y0+p,g=f.x1-p,y=f.y1-p;g<d&&(d=g=(d+g)/2),y<m&&(m=y=(m+y)/2),f.x0=d,f.y0=m,f.x1=g,f.y1=y,f.children&&(p=i[f.depth+1]=o(f)/2,d+=u(f)-p,m+=a(f)-p,g-=s(f)-p,y-=l(f)-p,g<d&&(d=g=(d+g)/2),y<m&&(m=y=(m+y)/2),e(f,d,m,g,y))}return c.round=function(f){return arguments.length?(t=!!f,c):t},c.size=function(f){return arguments.length?(n=+f[0],r=+f[1],c):[n,r]},c.tile=function(f){return arguments.length?(e=S1(f),c):e},c.padding=function(f){return arguments.length?c.paddingInner(f).paddingOuter(f):c.paddingInner()},c.paddingInner=function(f){return arguments.length?(o=typeof f=="function"?f:vi(+f),c):o},c.paddingOuter=function(f){return arguments.length?c.paddingTop(f).paddingRight(f).paddingBottom(f).paddingLeft(f):c.paddingTop()},c.paddingTop=function(f){return arguments.length?(a=typeof f=="function"?f:vi(+f),c):a},c.paddingRight=function(f){return arguments.length?(s=typeof f=="function"?f:vi(+f),c):s},c.paddingBottom=function(f){return arguments.length?(l=typeof f=="function"?f:vi(+f),c):l},c.paddingLeft=function(f){return arguments.length?(u=typeof f=="function"?f:vi(+f),c):u},c}function lR(e,t,n,r,i){var o=e.children,a,s=o.length,l,u=new Array(s+1);for(u[0]=l=a=0;a<s;++a)u[a+1]=l+=o[a].value;c(0,s,e.value,t,n,r,i);function c(h,f,p,d,m,g,y){if(h>=f-1){var b=o[h];b.x0=d,b.y0=m,b.x1=g,b.y1=y;return}for(var x=u[h],$=p/2+x,S=h+1,_=f-1;S<_;){var A=S+_>>>1;u[A]<$?S=A+1:_=A}$-u[S-1]<u[S]-$&&h+1<S&&--S;var w=u[S]-x,P=p-w;if(g-d>y-m){var I=p?(d*P+g*w)/p:g;c(h,S,w,d,m,I,y),c(S,f,P,I,m,g,y)}else{var v=p?(m*P+y*w)/p:y;c(h,S,w,d,m,g,v),c(S,f,P,d,v,g,y)}}}function uR(e,t,n,r,i){(e.depth&1?Gl:ia)(e,t,n,r,i)}const cR=function e(t){function n(r,i,o,a,s){if((l=r._squarify)&&l.ratio===t)for(var l,u,c,h,f=-1,p,d=l.length,m=r.value;++f<d;){for(u=l[f],c=u.children,h=u.value=0,p=c.length;h<p;++h)u.value+=c[h].value;u.dice?ia(u,i,o,a,m?o+=(s-o)*u.value/m:s):Gl(u,i,o,m?i+=(a-i)*u.value/m:a,s),m-=u.value}else r._squarify=l=N1(t,r,i,o,a,s),l.ratio=t}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(B1);function fR(e){for(var t=-1,n=e.length,r,i=e[n-1],o=0;++t<n;)r=i,i=e[t],o+=r[1]*i[0]-r[0]*i[1];return o/2}function hR(e){for(var t=-1,n=e.length,r=0,i=0,o,a=e[n-1],s,l=0;++t<n;)o=a,a=e[t],l+=s=o[0]*a[1]-a[0]*o[1],r+=(o[0]+a[0])*s,i+=(o[1]+a[1])*s;return l*=3,[r/l,i/l]}function pR(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function gR(e,t){return e[0]-t[0]||e[1]-t[1]}function z1(e){const t=e.length,n=[0,1];let r=2,i;for(i=2;i<t;++i){for(;r>1&&pR(e[n[r-2]],e[n[r-1]],e[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function dR(e){if((n=e.length)<3)return null;var t,n,r=new Array(n),i=new Array(n);for(t=0;t<n;++t)r[t]=[+e[t][0],+e[t][1],t];for(r.sort(gR),t=0;t<n;++t)i[t]=[r[t][0],-r[t][1]];var o=z1(r),a=z1(i),s=a[0]===o[0],l=a[a.length-1]===o[o.length-1],u=[];for(t=o.length-1;t>=0;--t)u.push(e[r[o[t]][2]]);for(t=+s;t<a.length-l;++t)u.push(e[r[a[t]][2]]);return u}function mR(e,t){for(var n=e.length,r=e[n-1],i=t[0],o=t[1],a=r[0],s=r[1],l,u,c=!1,h=0;h<n;++h)r=e[h],l=r[0],u=r[1],u>o!=s>o&&i<(a-l)*(o-u)/(s-u)+l&&(c=!c),a=l,s=u;return c}function yR(e){for(var t=-1,n=e.length,r=e[n-1],i,o,a=r[0],s=r[1],l=0;++t<n;)i=a,o=s,r=e[t],a=r[0],s=r[1],i-=a,o-=s,l+=Math.hypot(i,o);return l}const ze=Math.random,bR=function e(t){function n(r,i){return r=r==null?0:+r,i=i==null?1:+i,arguments.length===1?(i=r,r=0):i-=r,function(){return t()*i+r}}return n.source=e,n}(ze),xR=function e(t){function n(r,i){return arguments.length<2&&(i=r,r=0),r=Math.floor(r),i=Math.floor(i)-r,function(){return Math.floor(t()*i+r)}}return n.source=e,n}(ze),Uh=function e(t){function n(r,i){var o,a;return r=r==null?0:+r,i=i==null?1:+i,function(){var s;if(o!=null)s=o,o=null;else do o=t()*2-1,s=t()*2-1,a=o*o+s*s;while(!a||a>1);return r+i*s*Math.sqrt(-2*Math.log(a)/a)}}return n.source=e,n}(ze),$R=function e(t){var n=Uh.source(t);function r(){var i=n.apply(this,arguments);return function(){return Math.exp(i())}}return r.source=e,r}(ze),O1=function e(t){function n(r){return(r=+r)<=0?()=>0:function(){for(var i=0,o=r;o>1;--o)i+=t();return i+o*t()}}return n.source=e,n}(ze),vR=function e(t){var n=O1.source(t);function r(i){if((i=+i)==0)return t;var o=n(i);return function(){return o()/i}}return r.source=e,r}(ze),SR=function e(t){function n(r){return function(){return-Math.log1p(-t())/r}}return n.source=e,n}(ze),TR=function e(t){function n(r){if((r=+r)<0)throw new RangeError("invalid alpha");return r=1/-r,function(){return Math.pow(1-t(),r)}}return n.source=e,n}(ze),_R=function e(t){function n(r){if((r=+r)<0||r>1)throw new RangeError("invalid p");return function(){return Math.floor(t()+r)}}return n.source=e,n}(ze),G1=function e(t){function n(r){if((r=+r)<0||r>1)throw new RangeError("invalid p");return r===0?()=>1/0:r===1?()=>1:(r=Math.log1p(-r),function(){return 1+Math.floor(Math.log1p(-t())/r)})}return n.source=e,n}(ze),jh=function e(t){var n=Uh.source(t)();function r(i,o){if((i=+i)<0)throw new RangeError("invalid k");if(i===0)return()=>0;if(o=o==null?1:+o,i===1)return()=>-Math.log1p(-t())*o;var a=(i<1?i+1:i)-1/3,s=1/(3*Math.sqrt(a)),l=i<1?()=>Math.pow(t(),1/i):()=>1;return function(){do{do var u=n(),c=1+s*u;while(c<=0);c*=c*c;var h=1-t()}while(h>=1-.0331*u*u*u*u&&Math.log(h)>=.5*u*u+a*(1-c+Math.log(c)));return a*c*l()*o}}return r.source=e,r}(ze),W1=function e(t){var n=jh.source(t);function r(i,o){var a=n(i),s=n(o);return function(){var l=a();return l===0?0:l/(l+s())}}return r.source=e,r}(ze),V1=function e(t){var n=G1.source(t),r=W1.source(t);function i(o,a){return o=+o,(a=+a)>=1?()=>o:a<=0?()=>0:function(){for(var s=0,l=o,u=a;l*u>16&&l*(1-u)>16;){var c=Math.floor((l+1)*u),h=r(c,l-c+1)();h<=u?(s+=c,l-=c,u=(u-h)/(1-h)):(l=c-1,u/=h)}for(var f=u<.5,p=f?u:1-u,d=n(p),m=d(),g=0;m<=l;++g)m+=d();return s+(f?g:l-g)}}return i.source=e,i}(ze),AR=function e(t){function n(r,i,o){var a;return(r=+r)==0?a=s=>-Math.log(s):(r=1/r,a=s=>Math.pow(s,r)),i=i==null?0:+i,o=o==null?1:+o,function(){return i+o*a(-Math.log1p(-t()))}}return n.source=e,n}(ze),wR=function e(t){function n(r,i){return r=r==null?0:+r,i=i==null?1:+i,function(){return r+i*Math.tan(Math.PI*t())}}return n.source=e,n}(ze),PR=function e(t){function n(r,i){return r=r==null?0:+r,i=i==null?1:+i,function(){var o=t();return r+i*Math.log(o/(1-o))}}return n.source=e,n}(ze),DR=function e(t){var n=jh.source(t),r=V1.source(t);function i(o){return function(){for(var a=0,s=o;s>16;){var l=Math.floor(.875*s),u=n(l)();if(u>s)return a+r(l-1,s/u)();a+=l,s-=u}for(var c=-Math.log1p(-t()),h=0;c<=s;++h)c-=Math.log1p(-t());return a+h}}return i.source=e,i}(ze),CR=1664525,LR=1013904223,Y1=1/4294967296;function MR(e=Math.random()){let t=(0<=e&&e<1?e/Y1:Math.abs(e))|0;return()=>(t=CR*t+LR|0,Y1*(t>>>0))}function At(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function mn(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Hh=Symbol("implicit");function qh(){var e=new uo,t=[],n=[],r=Hh;function i(o){let a=e.get(o);if(a===void 0){if(r!==Hh)return r;e.set(o,a=t.push(o)-1)}return n[a%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new uo;for(const a of o)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return qh(t,n).unknown(r)},At.apply(i,arguments),i}function Zh(){var e=qh().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,a,s=!1,l=0,u=0,c=.5;delete e.unknown;function h(){var f=t().length,p=i<r,d=p?i:r,m=p?r:i;o=(m-d)/Math.max(1,f-l+u*2),s&&(o=Math.floor(o)),d+=(m-d-o*(f-l))*c,a=o*(1-l),s&&(d=Math.round(d),a=Math.round(a));var g=Cn(f).map(function(y){return d+o*y});return n(p?g.reverse():g)}return e.domain=function(f){return arguments.length?(t(f),h()):t()},e.range=function(f){return arguments.length?([r,i]=f,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(f){return[r,i]=f,r=+r,i=+i,s=!0,h()},e.bandwidth=function(){return a},e.step=function(){return o},e.round=function(f){return arguments.length?(s=!!f,h()):s},e.padding=function(f){return arguments.length?(l=Math.min(1,u=+f),h()):l},e.paddingInner=function(f){return arguments.length?(l=Math.min(1,f),h()):l},e.paddingOuter=function(f){return arguments.length?(u=+f,h()):u},e.align=function(f){return arguments.length?(c=Math.max(0,Math.min(1,f)),h()):c},e.copy=function(){return Zh(t(),[r,i]).round(s).paddingInner(l).paddingOuter(u).align(c)},At.apply(h(),arguments)}function X1(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return X1(t())},e}function Kh(){return X1(Zh.apply(null,arguments).paddingInner(1))}function kR(e){return function(){return e}}function Wl(e){return+e}var U1=[0,1];function ot(e){return e}function Qh(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:kR(isNaN(t)?NaN:.5)}function RR(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function IR(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=Qh(i,r),o=n(a,o)):(r=Qh(r,i),o=n(o,a)),function(s){return o(r(s))}}function ER(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Qh(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(s){var l=qn(e,s,1,r)-1;return o[l](i[l](s))}}function oa(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Vl(){var e=U1,t=U1,n=ln,r,i,o,a=ot,s,l,u;function c(){var f=Math.min(e.length,t.length);return a!==ot&&(a=RR(e[0],e[f-1])),s=f>2?ER:IR,l=u=null,h}function h(f){return f==null||isNaN(f=+f)?o:(l||(l=s(e.map(r),t,n)))(r(a(f)))}return h.invert=function(f){return a(i((u||(u=s(t,e.map(r),bt)))(f)))},h.domain=function(f){return arguments.length?(e=Array.from(f,Wl),c()):e.slice()},h.range=function(f){return arguments.length?(t=Array.from(f),c()):t.slice()},h.rangeRound=function(f){return t=Array.from(f),n=So,c()},h.clamp=function(f){return arguments.length?(a=f?!0:ot,c()):a!==ot},h.interpolate=function(f){return arguments.length?(n=f,c()):n},h.unknown=function(f){return arguments.length?(o=f,h):o},function(f,p){return r=f,i=p,c()}}function Jh(){return Vl()(ot,ot)}function j1(e,t,n,r){var i=as(e,t,n),o;switch(r=pi(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=ib(i,a))&&(r.precision=o),Xf(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=ob(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=rb(i))&&(r.precision=o-(r.type==="%")*2);break}}return Bo(r)}function Bn(e){var t=e.domain;return e.ticks=function(n){var r=t();return Kn(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return j1(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,a=r[i],s=r[o],l,u,c=10;for(s<a&&(u=a,a=s,s=u,u=i,i=o,o=u);c-- >0;){if(u=Qn(a,s,n),u===l)return r[i]=a,r[o]=s,t(r);if(u>0)a=Math.floor(a/u)*u,s=Math.ceil(s/u)*u;else if(u<0)a=Math.ceil(a*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function Nn(){var e=Jh();return e.copy=function(){return oa(e,Nn())},At.apply(e,arguments),Bn(e)}function H1(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Wl),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return H1(e).unknown(t)},e=arguments.length?Array.from(e,Wl):[0,1],Bn(n)}function q1(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],a;return o<i&&(a=n,n=r,r=a,a=i,i=o,o=a),e[n]=t.floor(i),e[r]=t.ceil(o),e}function Z1(e){return Math.log(e)}function K1(e){return Math.exp(e)}function BR(e){return-Math.log(-e)}function NR(e){return-Math.exp(-e)}function FR(e){return isFinite(e)?+("1e"+e):e<0?0:e}function zR(e){return e===10?FR:e===Math.E?Math.exp:t=>Math.pow(e,t)}function OR(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Q1(e){return(t,n)=>-e(-t,n)}function ep(e){const t=e(Z1,K1),n=t.domain;let r=10,i,o;function a(){return i=OR(r),o=zR(r),n()[0]<0?(i=Q1(i),o=Q1(o),e(BR,NR)):e(Z1,K1),t}return t.base=function(s){return arguments.length?(r=+s,a()):r},t.domain=function(s){return arguments.length?(n(s),a()):n()},t.ticks=s=>{const l=n();let u=l[0],c=l[l.length-1];const h=c<u;h&&([u,c]=[c,u]);let f=i(u),p=i(c),d,m;const g=s==null?10:+s;let y=[];if(!(r%1)&&p-f<g){if(f=Math.floor(f),p=Math.ceil(p),u>0){for(;f<=p;++f)for(d=1;d<r;++d)if(m=f<0?d/o(-f):d*o(f),!(m<u)){if(m>c)break;y.push(m)}}else for(;f<=p;++f)for(d=r-1;d>=1;--d)if(m=f>0?d/o(-f):d*o(f),!(m<u)){if(m>c)break;y.push(m)}y.length*2<g&&(y=Kn(u,c,g))}else y=Kn(f,p,Math.min(p-f,g)).map(o);return h?y.reverse():y},t.tickFormat=(s,l)=>{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=pi(l)).precision==null&&(l.trim=!0),l=Bo(l)),s===1/0)return l;const u=Math.max(1,r*s/t.ticks().length);return c=>{let h=c/o(Math.round(i(c)));return h*r<r-.5&&(h*=r),h<=u?l(c):""}},t.nice=()=>n(q1(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),t}function J1(){const e=ep(Vl()).domain([1,10]);return e.copy=()=>oa(e,J1()).base(e.base()),At.apply(e,arguments),e}function ex(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function tx(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function tp(e){var t=1,n=e(ex(t),tx(t));return n.constant=function(r){return arguments.length?e(ex(t=+r),tx(t)):t},Bn(n)}function nx(){var e=tp(Vl());return e.copy=function(){return oa(e,nx()).constant(e.constant())},At.apply(e,arguments)}function rx(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function GR(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function WR(e){return e<0?-e*e:e*e}function np(e){var t=e(ot,ot),n=1;function r(){return n===1?e(ot,ot):n===.5?e(GR,WR):e(rx(n),rx(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Bn(t)}function yn(){var e=np(Vl());return e.copy=function(){return oa(e,yn()).exponent(e.exponent())},At.apply(e,arguments),e}function VR(){return yn.apply(null,arguments).exponent(.5)}function ix(e){return Math.sign(e)*e*e}function YR(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function ox(){var e=Jh(),t=[0,1],n=!1,r;function i(o){var a=YR(e(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return e.invert(ix(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,Wl)).map(ix)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return ox(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},At.apply(i,arguments),Bn(i)}function ax(){var e=[],t=[],n=[],r;function i(){var a=0,s=Math.max(1,t.length);for(n=new Array(s-1);++a<s;)n[a-1]=Vm(e,a/s);return o}function o(a){return a==null||isNaN(a=+a)?r:t[qn(n,a)]}return o.invertExtent=function(a){var s=t.indexOf(a);return s<0?[NaN,NaN]:[s>0?n[s-1]:e[0],s<n.length?n[s]:e[e.length-1]]},o.domain=function(a){if(!arguments.length)return e.slice();e=[];for(let s of a)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(_e),i()},o.range=function(a){return arguments.length?(t=Array.from(a),i()):t.slice()},o.unknown=function(a){return arguments.length?(r=a,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return ax().domain(e).range(t).unknown(r)},At.apply(o,arguments)}function sx(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function a(l){return l!=null&&l<=l?i[qn(r,l,0,n)]:o}function s(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,s()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,s()):i.slice()},a.invertExtent=function(l){var u=i.indexOf(l);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return sx().domain([e,t]).range(i).unknown(o)},At.apply(Bn(a),arguments)}function lx(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[qn(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var a=t.indexOf(o);return[e[a-1],e[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return lx().domain(e).range(t).unknown(n)},At.apply(i,arguments)}const rp=new Date,ip=new Date;function Le(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a<s-o?a:s},i.offset=(o,a)=>(t(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const l=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o<a)||!(s>0))return l;let u;do l.push(u=new Date(+o)),t(o,s),e(o);while(u<o&&o<a);return l},i.filter=o=>Le(a=>{if(a>=a)for(;e(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;t(a,-1),!o(a););else for(;--s>=0;)for(;t(a,1),!o(a););}),n&&(i.count=(o,a)=>(rp.setTime(+o),ip.setTime(+a),e(rp),e(ip),Math.floor(n(rp,ip))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const Si=Le(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Si.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Le(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Si);const ux=Si.range,bn=1e3,wt=bn*60,xn=wt*60,$n=xn*24,op=$n*7,cx=$n*30,ap=$n*365,vn=Le(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*bn)},(e,t)=>(t-e)/bn,e=>e.getUTCSeconds()),fx=vn.range,Yl=Le(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*bn)},(e,t)=>{e.setTime(+e+t*wt)},(e,t)=>(t-e)/wt,e=>e.getMinutes()),XR=Yl.range,Xl=Le(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*wt)},(e,t)=>(t-e)/wt,e=>e.getUTCMinutes()),UR=Xl.range,Ul=Le(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*bn-e.getMinutes()*wt)},(e,t)=>{e.setTime(+e+t*xn)},(e,t)=>(t-e)/xn,e=>e.getHours()),jR=Ul.range,jl=Le(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*xn)},(e,t)=>(t-e)/xn,e=>e.getUTCHours()),HR=jl.range,Ti=Le(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*wt)/$n,e=>e.getDate()-1),qR=Ti.range,aa=Le(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$n,e=>e.getUTCDate()-1),ZR=aa.range,sp=Le(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$n,e=>Math.floor(e/$n)),KR=sp.range;function $r(e){return Le(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*wt)/op)}const _i=$r(0),sa=$r(1),hx=$r(2),px=$r(3),vr=$r(4),gx=$r(5),dx=$r(6),mx=_i.range,QR=sa.range,JR=hx.range,e7=px.range,t7=vr.range,n7=gx.range,r7=dx.range;function Sr(e){return Le(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/op)}const Ai=Sr(0),la=Sr(1),yx=Sr(2),bx=Sr(3),Tr=Sr(4),xx=Sr(5),$x=Sr(6),vx=Ai.range,i7=la.range,o7=yx.range,a7=bx.range,s7=Tr.range,l7=xx.range,u7=$x.range,Hl=Le(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth()),c7=Hl.range,ql=Le(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()),f7=ql.range,en=Le(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());en.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Le(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});const h7=en.range,tn=Le(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());tn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Le(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});const p7=tn.range;function Sx(e,t,n,r,i,o){const a=[[vn,1,bn],[vn,5,5*bn],[vn,15,15*bn],[vn,30,30*bn],[o,1,wt],[o,5,5*wt],[o,15,15*wt],[o,30,30*wt],[i,1,xn],[i,3,3*xn],[i,6,6*xn],[i,12,12*xn],[r,1,$n],[r,2,2*$n],[n,1,op],[t,1,cx],[t,3,3*cx],[e,1,ap]];function s(u,c,h){const f=c<u;f&&([u,c]=[c,u]);const p=h&&typeof h.range=="function"?h:l(u,c,h),d=p?p.range(u,+c+1):[];return f?d.reverse():d}function l(u,c,h){const f=Math.abs(c-u)/h,p=ns(([,,g])=>g).right(a,f);if(p===a.length)return e.every(as(u/ap,c/ap,h));if(p===0)return Si.every(Math.max(as(u,c,h),1));const[d,m]=a[f/a[p-1][2]<a[p][2]/f?p-1:p];return d.every(m)}return[s,l]}const[Tx,_x]=Sx(tn,ql,Ai,sp,jl,Xl),[Ax,wx]=Sx(en,Hl,_i,Ti,Ul,Yl);function lp(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function up(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ua(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Px(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=ca(i),c=fa(i),h=ca(o),f=fa(o),p=ca(a),d=fa(a),m=ca(s),g=fa(s),y=ca(l),b=fa(l),x={a:G,A:k,b:B,B:F,c:null,d:Rx,e:Rx,f:B7,g:U7,G:H7,H:R7,I:I7,j:E7,L:Ix,m:N7,M:F7,p:E,q:W,Q:Ox,s:Gx,S:z7,u:O7,U:G7,V:W7,w:V7,W:Y7,x:null,X:null,y:X7,Y:j7,Z:q7,"%":zx},$={a:j,A:te,b:V,B:ee,c:null,d:Bx,e:Bx,f:J7,g:uI,G:fI,H:Z7,I:K7,j:Q7,L:Nx,m:eI,M:tI,p:Y,q:J,Q:Ox,s:Gx,S:nI,u:rI,U:iI,V:oI,w:aI,W:sI,x:null,X:null,y:lI,Y:cI,Z:hI,"%":zx},S={a:I,A:v,b:N,B:R,c:D,d:Mx,e:Mx,f:C7,g:Lx,G:Cx,H:kx,I:kx,j:A7,L:D7,m:_7,M:w7,p:P,q:T7,Q:M7,s:k7,S:P7,u:b7,U:x7,V:$7,w:y7,W:v7,x:T,X:M,y:Lx,Y:Cx,Z:S7,"%":L7};x.x=_(n,x),x.X=_(r,x),x.c=_(t,x),$.x=_(n,$),$.X=_(r,$),$.c=_(t,$);function _(K,ie){return function(le){var Z=[],ye=-1,he=0,Re=K.length,st,ue,Ce;for(le instanceof Date||(le=new Date(+le));++ye<Re;)K.charCodeAt(ye)===37&&(Z.push(K.slice(he,ye)),(ue=Dx[st=K.charAt(++ye)])!=null?st=K.charAt(++ye):ue=st==="e"?" ":"0",(Ce=ie[st])&&(st=Ce(le,ue)),Z.push(st),he=ye+1);return Z.push(K.slice(he,ye)),Z.join("")}}function A(K,ie){return function(le){var Z=ua(1900,void 0,1),ye=w(Z,K,le+="",0),he,Re;if(ye!=le.length)return null;if("Q"in Z)return new Date(Z.Q);if("s"in Z)return new Date(Z.s*1e3+("L"in Z?Z.L:0));if(ie&&!("Z"in Z)&&(Z.Z=0),"p"in Z&&(Z.H=Z.H%12+Z.p*12),Z.m===void 0&&(Z.m="q"in Z?Z.q:0),"V"in Z){if(Z.V<1||Z.V>53)return null;"w"in Z||(Z.w=1),"Z"in Z?(he=up(ua(Z.y,0,1)),Re=he.getUTCDay(),he=Re>4||Re===0?la.ceil(he):la(he),he=aa.offset(he,(Z.V-1)*7),Z.y=he.getUTCFullYear(),Z.m=he.getUTCMonth(),Z.d=he.getUTCDate()+(Z.w+6)%7):(he=lp(ua(Z.y,0,1)),Re=he.getDay(),he=Re>4||Re===0?sa.ceil(he):sa(he),he=Ti.offset(he,(Z.V-1)*7),Z.y=he.getFullYear(),Z.m=he.getMonth(),Z.d=he.getDate()+(Z.w+6)%7)}else("W"in Z||"U"in Z)&&("w"in Z||(Z.w="u"in Z?Z.u%7:"W"in Z?1:0),Re="Z"in Z?up(ua(Z.y,0,1)).getUTCDay():lp(ua(Z.y,0,1)).getDay(),Z.m=0,Z.d="W"in Z?(Z.w+6)%7+Z.W*7-(Re+5)%7:Z.w+Z.U*7-(Re+6)%7);return"Z"in Z?(Z.H+=Z.Z/100|0,Z.M+=Z.Z%100,up(Z)):lp(Z)}}function w(K,ie,le,Z){for(var ye=0,he=ie.length,Re=le.length,st,ue;ye<he;){if(Z>=Re)return-1;if(st=ie.charCodeAt(ye++),st===37){if(st=ie.charAt(ye++),ue=S[st in Dx?ie.charAt(ye++):st],!ue||(Z=ue(K,le,Z))<0)return-1}else if(st!=le.charCodeAt(Z++))return-1}return Z}function P(K,ie,le){var Z=u.exec(ie.slice(le));return Z?(K.p=c.get(Z[0].toLowerCase()),le+Z[0].length):-1}function I(K,ie,le){var Z=p.exec(ie.slice(le));return Z?(K.w=d.get(Z[0].toLowerCase()),le+Z[0].length):-1}function v(K,ie,le){var Z=h.exec(ie.slice(le));return Z?(K.w=f.get(Z[0].toLowerCase()),le+Z[0].length):-1}function N(K,ie,le){var Z=y.exec(ie.slice(le));return Z?(K.m=b.get(Z[0].toLowerCase()),le+Z[0].length):-1}function R(K,ie,le){var Z=m.exec(ie.slice(le));return Z?(K.m=g.get(Z[0].toLowerCase()),le+Z[0].length):-1}function D(K,ie,le){return w(K,t,ie,le)}function T(K,ie,le){return w(K,n,ie,le)}function M(K,ie,le){return w(K,r,ie,le)}function G(K){return a[K.getDay()]}function k(K){return o[K.getDay()]}function B(K){return l[K.getMonth()]}function F(K){return s[K.getMonth()]}function E(K){return i[+(K.getHours()>=12)]}function W(K){return 1+~~(K.getMonth()/3)}function j(K){return a[K.getUTCDay()]}function te(K){return o[K.getUTCDay()]}function V(K){return l[K.getUTCMonth()]}function ee(K){return s[K.getUTCMonth()]}function Y(K){return i[+(K.getUTCHours()>=12)]}function J(K){return 1+~~(K.getUTCMonth()/3)}return{format:function(K){var ie=_(K+="",x);return ie.toString=function(){return K},ie},parse:function(K){var ie=A(K+="",!1);return ie.toString=function(){return K},ie},utcFormat:function(K){var ie=_(K+="",$);return ie.toString=function(){return K},ie},utcParse:function(K){var ie=A(K+="",!0);return ie.toString=function(){return K},ie}}}var Dx={"-":"",_:" ",0:"0"},Ne=/^\s*\d+/,g7=/^%/,d7=/[\\^$*+?|[\]().{}]/g;function be(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function m7(e){return e.replace(d7,"\\$&")}function ca(e){return new RegExp("^(?:"+e.map(m7).join("|")+")","i")}function fa(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function y7(e,t,n){var r=Ne.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function b7(e,t,n){var r=Ne.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function x7(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function $7(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function v7(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Cx(e,t,n){var r=Ne.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Lx(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function S7(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function T7(e,t,n){var r=Ne.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function _7(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Mx(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function A7(e,t,n){var r=Ne.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function kx(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function w7(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function P7(e,t,n){var r=Ne.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function D7(e,t,n){var r=Ne.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function C7(e,t,n){var r=Ne.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function L7(e,t,n){var r=g7.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function M7(e,t,n){var r=Ne.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function k7(e,t,n){var r=Ne.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Rx(e,t){return be(e.getDate(),t,2)}function R7(e,t){return be(e.getHours(),t,2)}function I7(e,t){return be(e.getHours()%12||12,t,2)}function E7(e,t){return be(1+Ti.count(en(e),e),t,3)}function Ix(e,t){return be(e.getMilliseconds(),t,3)}function B7(e,t){return Ix(e,t)+"000"}function N7(e,t){return be(e.getMonth()+1,t,2)}function F7(e,t){return be(e.getMinutes(),t,2)}function z7(e,t){return be(e.getSeconds(),t,2)}function O7(e){var t=e.getDay();return t===0?7:t}function G7(e,t){return be(_i.count(en(e)-1,e),t,2)}function Ex(e){var t=e.getDay();return t>=4||t===0?vr(e):vr.ceil(e)}function W7(e,t){return e=Ex(e),be(vr.count(en(e),e)+(en(e).getDay()===4),t,2)}function V7(e){return e.getDay()}function Y7(e,t){return be(sa.count(en(e)-1,e),t,2)}function X7(e,t){return be(e.getFullYear()%100,t,2)}function U7(e,t){return e=Ex(e),be(e.getFullYear()%100,t,2)}function j7(e,t){return be(e.getFullYear()%1e4,t,4)}function H7(e,t){var n=e.getDay();return e=n>=4||n===0?vr(e):vr.ceil(e),be(e.getFullYear()%1e4,t,4)}function q7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+be(t/60|0,"0",2)+be(t%60,"0",2)}function Bx(e,t){return be(e.getUTCDate(),t,2)}function Z7(e,t){return be(e.getUTCHours(),t,2)}function K7(e,t){return be(e.getUTCHours()%12||12,t,2)}function Q7(e,t){return be(1+aa.count(tn(e),e),t,3)}function Nx(e,t){return be(e.getUTCMilliseconds(),t,3)}function J7(e,t){return Nx(e,t)+"000"}function eI(e,t){return be(e.getUTCMonth()+1,t,2)}function tI(e,t){return be(e.getUTCMinutes(),t,2)}function nI(e,t){return be(e.getUTCSeconds(),t,2)}function rI(e){var t=e.getUTCDay();return t===0?7:t}function iI(e,t){return be(Ai.count(tn(e)-1,e),t,2)}function Fx(e){var t=e.getUTCDay();return t>=4||t===0?Tr(e):Tr.ceil(e)}function oI(e,t){return e=Fx(e),be(Tr.count(tn(e),e)+(tn(e).getUTCDay()===4),t,2)}function aI(e){return e.getUTCDay()}function sI(e,t){return be(la.count(tn(e)-1,e),t,2)}function lI(e,t){return be(e.getUTCFullYear()%100,t,2)}function uI(e,t){return e=Fx(e),be(e.getUTCFullYear()%100,t,2)}function cI(e,t){return be(e.getUTCFullYear()%1e4,t,4)}function fI(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Tr(e):Tr.ceil(e),be(e.getUTCFullYear()%1e4,t,4)}function hI(){return"+0000"}function zx(){return"%"}function Ox(e){return+e}function Gx(e){return Math.floor(+e/1e3)}var wi,cp,Wx,Zl,fp;Vx({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Vx(e){return wi=Px(e),cp=wi.format,Wx=wi.parse,Zl=wi.utcFormat,fp=wi.utcParse,wi}var Yx="%Y-%m-%dT%H:%M:%S.%LZ";function pI(e){return e.toISOString()}var gI=Date.prototype.toISOString?pI:Zl(Yx);const dI=gI;function mI(e){var t=new Date(e);return isNaN(t)?null:t}var yI=+new Date("2000-01-01T00:00:00.000Z")?mI:fp(Yx);const bI=yI;function xI(e){return new Date(e)}function $I(e){return e instanceof Date?+e:+new Date(+e)}function hp(e,t,n,r,i,o,a,s,l,u){var c=Jh(),h=c.invert,f=c.domain,p=u(".%L"),d=u(":%S"),m=u("%I:%M"),g=u("%I %p"),y=u("%a %d"),b=u("%b %d"),x=u("%B"),$=u("%Y");function S(_){return(l(_)<_?p:s(_)<_?d:a(_)<_?m:o(_)<_?g:r(_)<_?i(_)<_?y:b:n(_)<_?x:$)(_)}return c.invert=function(_){return new Date(h(_))},c.domain=function(_){return arguments.length?f(Array.from(_,$I)):f().map(xI)},c.ticks=function(_){var A=f();return e(A[0],A[A.length-1],_??10)},c.tickFormat=function(_,A){return A==null?S:u(A)},c.nice=function(_){var A=f();return(!_||typeof _.range!="function")&&(_=t(A[0],A[A.length-1],_??10)),_?f(q1(A,_)):c},c.copy=function(){return oa(c,hp(e,t,n,r,i,o,a,s,l,u))},c}function vI(){return At.apply(hp(Ax,wx,en,Hl,_i,Ti,Ul,Yl,vn,cp).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function SI(){return At.apply(hp(Tx,_x,tn,ql,Ai,aa,jl,Xl,vn,Zl).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Kl(){var e=0,t=1,n,r,i,o,a=ot,s=!1,l;function u(h){return h==null||isNaN(h=+h)?l:a(i===0?.5:(h=(o(h)-n)*i,s?Math.max(0,Math.min(1,h)):h))}u.domain=function(h){return arguments.length?([e,t]=h,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(h){return arguments.length?(s=!!h,u):s},u.interpolator=function(h){return arguments.length?(a=h,u):a};function c(h){return function(f){var p,d;return arguments.length?([p,d]=f,a=h(p,d),u):[a(0),a(1)]}}return u.range=c(ln),u.rangeRound=c(So),u.unknown=function(h){return arguments.length?(l=h,u):l},function(h){return o=h,n=h(e),r=h(t),i=n===r?0:1/(r-n),u}}function Fn(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Xx(){var e=Bn(Kl()(ot));return e.copy=function(){return Fn(e,Xx())},mn.apply(e,arguments)}function Ux(){var e=ep(Kl()).domain([1,10]);return e.copy=function(){return Fn(e,Ux()).base(e.base())},mn.apply(e,arguments)}function jx(){var e=tp(Kl());return e.copy=function(){return Fn(e,jx()).constant(e.constant())},mn.apply(e,arguments)}function pp(){var e=np(Kl());return e.copy=function(){return Fn(e,pp()).exponent(e.exponent())},mn.apply(e,arguments)}function TI(){return pp.apply(null,arguments).exponent(.5)}function Hx(){var e=[],t=ot;function n(r){if(r!=null&&!isNaN(r=+r))return t((qn(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(_e),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>ho(e,o/r))},n.copy=function(){return Hx(t).domain(e)},mn.apply(n,arguments)}function Ql(){var e=0,t=.5,n=1,r=1,i,o,a,s,l,u=ot,c,h=!1,f;function p(m){return isNaN(m=+m)?f:(m=.5+((m=+c(m))-o)*(r*m<r*o?s:l),u(h?Math.max(0,Math.min(1,m)):m))}p.domain=function(m){return arguments.length?([e,t,n]=m,i=c(e=+e),o=c(t=+t),a=c(n=+n),s=i===o?0:.5/(o-i),l=o===a?0:.5/(a-o),r=o<i?-1:1,p):[e,t,n]},p.clamp=function(m){return arguments.length?(h=!!m,p):h},p.interpolator=function(m){return arguments.length?(u=m,p):u};function d(m){return function(g){var y,b,x;return arguments.length?([y,b,x]=g,u=Q0(m,[y,b,x]),p):[u(0),u(.5),u(1)]}}return p.range=d(ln),p.rangeRound=d(So),p.unknown=function(m){return arguments.length?(f=m,p):f},function(m){return c=m,i=m(e),o=m(t),a=m(n),s=i===o?0:.5/(o-i),l=o===a?0:.5/(a-o),r=o<i?-1:1,p}}function qx(){var e=Bn(Ql()(ot));return e.copy=function(){return Fn(e,qx())},mn.apply(e,arguments)}function Zx(){var e=ep(Ql()).domain([.1,1,10]);return e.copy=function(){return Fn(e,Zx()).base(e.base())},mn.apply(e,arguments)}function Kx(){var e=tp(Ql());return e.copy=function(){return Fn(e,Kx()).constant(e.constant())},mn.apply(e,arguments)}function gp(){var e=np(Ql());return e.copy=function(){return Fn(e,gp()).exponent(e.exponent())},mn.apply(e,arguments)}function _I(){return gp.apply(null,arguments).exponent(.5)}function fe(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}const AI=fe("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),wI=fe("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),PI=fe("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),DI=fe("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),CI=fe("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),LI=fe("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),MI=fe("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),kI=fe("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),RI=fe("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),II=fe("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),EI=fe("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),ve=e=>N0(e[e.length-1]);var Qx=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(fe);const BI=ve(Qx);var Jx=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(fe);const NI=ve(Jx);var e$=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(fe);const FI=ve(e$);var t$=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(fe);const zI=ve(t$);var n$=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(fe);const OI=ve(n$);var r$=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(fe);const GI=ve(r$);var i$=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(fe);const WI=ve(i$);var o$=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(fe);const VI=ve(o$);var a$=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(fe);const YI=ve(a$);var s$=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(fe);const XI=ve(s$);var l$=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(fe);const UI=ve(l$);var u$=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(fe);const jI=ve(u$);var c$=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(fe);const HI=ve(c$);var f$=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(fe);const qI=ve(f$);var h$=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(fe);const ZI=ve(h$);var p$=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(fe);const KI=ve(p$);var g$=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(fe);const QI=ve(g$);var d$=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(fe);const JI=ve(d$);var m$=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(fe);const e9=ve(m$);var y$=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(fe);const t9=ve(y$);var b$=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(fe);const n9=ve(b$);var x$=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(fe);const r9=ve(x$);var $$=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(fe);const i9=ve($$);var v$=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(fe);const o9=ve(v$);var S$=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(fe);const a9=ve(S$);var T$=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(fe);const s9=ve(T$);var _$=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(fe);const l9=ve(_$);function u9(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+")"}const c9=Ms(Bt(300,.5,0),Bt(-240,.5,1));var f9=Ms(Bt(-100,.75,.35),Bt(80,1.5,.8)),h9=Ms(Bt(260,.75,.35),Bt(80,1.5,.8)),Jl=Bt();function p9(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return Jl.h=360*e-100,Jl.s=1.5-1.5*t,Jl.l=.8-.9*t,Jl+""}var eu=ti(),g9=Math.PI/3,d9=Math.PI*2/3;function m9(e){var t;return e=(.5-e)*Math.PI,eu.r=255*(t=Math.sin(e))*t,eu.g=255*(t=Math.sin(e+g9))*t,eu.b=255*(t=Math.sin(e+d9))*t,eu+""}function y9(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}function tu(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const b9=tu(fe("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var x9=tu(fe("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),$9=tu(fe("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),v9=tu(fe("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function ce(e){return function(){return e}}const A$=Math.abs,Xe=Math.atan2,Sn=Math.cos,S9=Math.max,Pi=Math.min,pt=Math.sin,Te=Math.sqrt,Ue=1e-12,zn=Math.PI,nu=zn/2,On=2*zn;function T9(e){return e>1?0:e<-1?zn:Math.acos(e)}function w$(e){return e>=1?nu:e<=-1?-nu:Math.asin(e)}function ha(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new ko(t)}function _9(e){return e.innerRadius}function A9(e){return e.outerRadius}function w9(e){return e.startAngle}function P9(e){return e.endAngle}function D9(e){return e&&e.padAngle}function C9(e,t,n,r,i,o,a,s){var l=n-e,u=r-t,c=a-i,h=s-o,f=h*l-c*u;if(!(f*f<Ue))return f=(c*(t-o)-h*(e-i))/f,[e+f*l,t+f*u]}function ru(e,t,n,r,i,o,a){var s=e-n,l=t-r,u=(a?o:-o)/Te(s*s+l*l),c=u*l,h=-u*s,f=e+c,p=t+h,d=n+c,m=r+h,g=(f+d)/2,y=(p+m)/2,b=d-f,x=m-p,$=b*b+x*x,S=i-o,_=f*m-d*p,A=(x<0?-1:1)*Te(S9(0,S*S*$-_*_)),w=(_*x-b*A)/$,P=(-_*b-x*A)/$,I=(_*x+b*A)/$,v=(-_*b+x*A)/$,N=w-g,R=P-y,D=I-g,T=v-y;return N*N+R*R>D*D+T*T&&(w=I,P=v),{cx:w,cy:P,x01:-c,y01:-h,x11:w*(i/S-1),y11:P*(i/S-1)}}function iu(){var e=_9,t=A9,n=ce(0),r=null,i=w9,o=P9,a=D9,s=null,l=ha(u);function u(){var c,h,f=+e.apply(this,arguments),p=+t.apply(this,arguments),d=i.apply(this,arguments)-nu,m=o.apply(this,arguments)-nu,g=A$(m-d),y=m>d;if(s||(s=c=l()),p<f&&(h=p,p=f,f=h),!(p>Ue))s.moveTo(0,0);else if(g>On-Ue)s.moveTo(p*Sn(d),p*pt(d)),s.arc(0,0,p,d,m,!y),f>Ue&&(s.moveTo(f*Sn(m),f*pt(m)),s.arc(0,0,f,m,d,y));else{var b=d,x=m,$=d,S=m,_=g,A=g,w=a.apply(this,arguments)/2,P=w>Ue&&(r?+r.apply(this,arguments):Te(f*f+p*p)),I=Pi(A$(p-f)/2,+n.apply(this,arguments)),v=I,N=I,R,D;if(P>Ue){var T=w$(P/f*pt(w)),M=w$(P/p*pt(w));(_-=T*2)>Ue?(T*=y?1:-1,$+=T,S-=T):(_=0,$=S=(d+m)/2),(A-=M*2)>Ue?(M*=y?1:-1,b+=M,x-=M):(A=0,b=x=(d+m)/2)}var G=p*Sn(b),k=p*pt(b),B=f*Sn(S),F=f*pt(S);if(I>Ue){var E=p*Sn(x),W=p*pt(x),j=f*Sn($),te=f*pt($),V;if(g<zn)if(V=C9(G,k,j,te,E,W,B,F)){var ee=G-V[0],Y=k-V[1],J=E-V[0],K=W-V[1],ie=1/pt(T9((ee*J+Y*K)/(Te(ee*ee+Y*Y)*Te(J*J+K*K)))/2),le=Te(V[0]*V[0]+V[1]*V[1]);v=Pi(I,(f-le)/(ie-1)),N=Pi(I,(p-le)/(ie+1))}else v=N=0}A>Ue?N>Ue?(R=ru(j,te,G,k,p,N,y),D=ru(E,W,B,F,p,N,y),s.moveTo(R.cx+R.x01,R.cy+R.y01),N<I?s.arc(R.cx,R.cy,N,Xe(R.y01,R.x01),Xe(D.y01,D.x01),!y):(s.arc(R.cx,R.cy,N,Xe(R.y01,R.x01),Xe(R.y11,R.x11),!y),s.arc(0,0,p,Xe(R.cy+R.y11,R.cx+R.x11),Xe(D.cy+D.y11,D.cx+D.x11),!y),s.arc(D.cx,D.cy,N,Xe(D.y11,D.x11),Xe(D.y01,D.x01),!y))):(s.moveTo(G,k),s.arc(0,0,p,b,x,!y)):s.moveTo(G,k),!(f>Ue)||!(_>Ue)?s.lineTo(B,F):v>Ue?(R=ru(B,F,E,W,f,-v,y),D=ru(G,k,j,te,f,-v,y),s.lineTo(R.cx+R.x01,R.cy+R.y01),v<I?s.arc(R.cx,R.cy,v,Xe(R.y01,R.x01),Xe(D.y01,D.x01),!y):(s.arc(R.cx,R.cy,v,Xe(R.y01,R.x01),Xe(R.y11,R.x11),!y),s.arc(0,0,f,Xe(R.cy+R.y11,R.cx+R.x11),Xe(D.cy+D.y11,D.cx+D.x11),y),s.arc(D.cx,D.cy,v,Xe(D.y11,D.x11),Xe(D.y01,D.x01),!y))):s.arc(0,0,f,S,$,y)}if(s.closePath(),c)return s=null,c+""||null}return u.centroid=function(){var c=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,h=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-zn/2;return[Sn(h)*c,pt(h)*c]},u.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:ce(+c),u):e},u.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:ce(+c),u):t},u.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:ce(+c),u):n},u.padRadius=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:ce(+c),u):r},u.startAngle=function(c){return arguments.length?(i=typeof c=="function"?c:ce(+c),u):i},u.endAngle=function(c){return arguments.length?(o=typeof c=="function"?c:ce(+c),u):o},u.padAngle=function(c){return arguments.length?(a=typeof c=="function"?c:ce(+c),u):a},u.context=function(c){return arguments.length?(s=c??null,u):s},u}var L9=Array.prototype.slice;function ou(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function P$(e){this._context=e}P$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function au(e){return new P$(e)}function dp(e){return e[0]}function mp(e){return e[1]}function su(e,t){var n=ce(!0),r=null,i=au,o=null,a=ha(s);e=typeof e=="function"?e:e===void 0?dp:ce(e),t=typeof t=="function"?t:t===void 0?mp:ce(t);function s(l){var u,c=(l=ou(l)).length,h,f=!1,p;for(r==null&&(o=i(p=a())),u=0;u<=c;++u)!(u<c&&n(h=l[u],u,l))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+e(h,u,l),+t(h,u,l));if(p)return o=null,p+""||null}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:ce(+l),s):e},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:ce(+l),s):t},s.defined=function(l){return arguments.length?(n=typeof l=="function"?l:ce(!!l),s):n},s.curve=function(l){return arguments.length?(i=l,r!=null&&(o=i(r)),s):i},s.context=function(l){return arguments.length?(l==null?r=o=null:o=i(r=l),s):r},s}function yp(e,t,n){var r=null,i=ce(!0),o=null,a=au,s=null,l=ha(u);e=typeof e=="function"?e:e===void 0?dp:ce(+e),t=typeof t=="function"?t:ce(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?mp:ce(+n);function u(h){var f,p,d,m=(h=ou(h)).length,g,y=!1,b,x=new Array(m),$=new Array(m);for(o==null&&(s=a(b=l())),f=0;f<=m;++f){if(!(f<m&&i(g=h[f],f,h))===y)if(y=!y)p=f,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=f-1;d>=p;--d)s.point(x[d],$[d]);s.lineEnd(),s.areaEnd()}y&&(x[f]=+e(g,f,h),$[f]=+t(g,f,h),s.point(r?+r(g,f,h):x[f],n?+n(g,f,h):$[f]))}if(b)return s=null,b+""||null}function c(){return su().defined(i).curve(a).context(o)}return u.x=function(h){return arguments.length?(e=typeof h=="function"?h:ce(+h),r=null,u):e},u.x0=function(h){return arguments.length?(e=typeof h=="function"?h:ce(+h),u):e},u.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:ce(+h),u):r},u.y=function(h){return arguments.length?(t=typeof h=="function"?h:ce(+h),n=null,u):t},u.y0=function(h){return arguments.length?(t=typeof h=="function"?h:ce(+h),u):t},u.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:ce(+h),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(r).y(t)},u.defined=function(h){return arguments.length?(i=typeof h=="function"?h:ce(!!h),u):i},u.curve=function(h){return arguments.length?(a=h,o!=null&&(s=a(o)),u):a},u.context=function(h){return arguments.length?(h==null?o=s=null:s=a(o=h),u):o},u}function M9(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function k9(e){return e}function D$(){var e=k9,t=M9,n=null,r=ce(0),i=ce(On),o=ce(0);function a(s){var l,u=(s=ou(s)).length,c,h,f=0,p=new Array(u),d=new Array(u),m=+r.apply(this,arguments),g=Math.min(On,Math.max(-On,i.apply(this,arguments)-m)),y,b=Math.min(Math.abs(g)/u,o.apply(this,arguments)),x=b*(g<0?-1:1),$;for(l=0;l<u;++l)($=d[p[l]=l]=+e(s[l],l,s))>0&&(f+=$);for(t!=null?p.sort(function(S,_){return t(d[S],d[_])}):n!=null&&p.sort(function(S,_){return n(s[S],s[_])}),l=0,h=f?(g-u*x)/f:0;l<u;++l,m=y)c=p[l],$=d[c],y=m+($>0?$*h:0)+x,d[c]={data:s[c],index:l,value:$,startAngle:m,endAngle:y,padAngle:b};return d}return a.value=function(s){return arguments.length?(e=typeof s=="function"?s:ce(+s),a):e},a.sortValues=function(s){return arguments.length?(t=s,n=null,a):t},a.sort=function(s){return arguments.length?(n=s,t=null,a):n},a.startAngle=function(s){return arguments.length?(r=typeof s=="function"?s:ce(+s),a):r},a.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:ce(+s),a):i},a.padAngle=function(s){return arguments.length?(o=typeof s=="function"?s:ce(+s),a):o},a}var C$=bp(au);function L$(e){this._curve=e}L$.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function bp(e){function t(n){return new L$(e(n))}return t._curve=e,t}function pa(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(bp(n)):t()._curve},e}function M$(){return pa(su().curve(C$))}function k$(){var e=yp().curve(C$),t=e.curve,n=e.lineX0,r=e.lineX1,i=e.lineY0,o=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return pa(n())},delete e.lineX0,e.lineEndAngle=function(){return pa(r())},delete e.lineX1,e.lineInnerRadius=function(){return pa(i())},delete e.lineY0,e.lineOuterRadius=function(){return pa(o())},delete e.lineY1,e.curve=function(a){return arguments.length?t(bp(a)):t()._curve},e}function ga(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}class R${constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}class R9{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,n){if(t=+t,n=+n,this._point===0)this._point=1;else{const r=ga(this._x0,this._y0),i=ga(this._x0,this._y0=(this._y0+n)/2),o=ga(t,this._y0),a=ga(t,n);this._context.moveTo(...r),this._context.bezierCurveTo(...i,...o,...a)}this._x0=t,this._y0=n}}function I$(e){return new R$(e,!0)}function E$(e){return new R$(e,!1)}function I9(e){return new R9(e)}function E9(e){return e.source}function B9(e){return e.target}function lu(e){let t=E9,n=B9,r=dp,i=mp,o=null,a=null,s=ha(l);function l(){let u;const c=L9.call(arguments),h=t.apply(this,c),f=n.apply(this,c);if(o==null&&(a=e(u=s())),a.lineStart(),c[0]=h,a.point(+r.apply(this,c),+i.apply(this,c)),c[0]=f,a.point(+r.apply(this,c),+i.apply(this,c)),a.lineEnd(),u)return a=null,u+""||null}return l.source=function(u){return arguments.length?(t=u,l):t},l.target=function(u){return arguments.length?(n=u,l):n},l.x=function(u){return arguments.length?(r=typeof u=="function"?u:ce(+u),l):r},l.y=function(u){return arguments.length?(i=typeof u=="function"?u:ce(+u),l):i},l.context=function(u){return arguments.length?(u==null?o=a=null:a=e(o=u),l):o},l}function N9(){return lu(I$)}function F9(){return lu(E$)}function z9(){const e=lu(I9);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}const O9=Te(3),B$={draw(e,t){const n=Te(t+Pi(t/28,.75))*.59436,r=n/2,i=r*O9;e.moveTo(0,n),e.lineTo(0,-n),e.moveTo(-i,-r),e.lineTo(i,r),e.moveTo(-i,r),e.lineTo(i,-r)}},uu={draw(e,t){const n=Te(t/zn);e.moveTo(n,0),e.arc(0,0,n,0,On)}},N$={draw(e,t){const n=Te(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},F$=Te(1/3),G9=F$*2,z$={draw(e,t){const n=Te(t/G9),r=n*F$;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},O$={draw(e,t){const n=Te(t)*.62625;e.moveTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.lineTo(-n,0),e.closePath()}},G$={draw(e,t){const n=Te(t-Pi(t/7,2))*.87559;e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}},W$={draw(e,t){const n=Te(t),r=-n/2;e.rect(r,r,n,n)}},V$={draw(e,t){const n=Te(t)*.4431;e.moveTo(n,n),e.lineTo(n,-n),e.lineTo(-n,-n),e.lineTo(-n,n),e.closePath()}},W9=.8908130915292852,Y$=pt(zn/10)/pt(7*zn/10),V9=pt(On/10)*Y$,Y9=-Sn(On/10)*Y$,X$={draw(e,t){const n=Te(t*W9),r=V9*n,i=Y9*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const a=On*o/5,s=Sn(a),l=pt(a);e.lineTo(l*n,-s*n),e.lineTo(s*r-l*i,l*r+s*i)}e.closePath()}},xp=Te(3),U$={draw(e,t){const n=-Te(t/(xp*3));e.moveTo(0,n*2),e.lineTo(-xp*n,-n),e.lineTo(xp*n,-n),e.closePath()}},X9=Te(3),j$={draw(e,t){const n=Te(t)*.6824,r=n/2,i=n*X9/2;e.moveTo(0,-n),e.lineTo(i,r),e.lineTo(-i,r),e.closePath()}},Pt=-.5,Dt=Te(3)/2,$p=1/Te(12),U9=($p/2+1)*3,H$={draw(e,t){const n=Te(t/U9),r=n/2,i=n*$p,o=r,a=n*$p+n,s=-o,l=a;e.moveTo(r,i),e.lineTo(o,a),e.lineTo(s,l),e.lineTo(Pt*r-Dt*i,Dt*r+Pt*i),e.lineTo(Pt*o-Dt*a,Dt*o+Pt*a),e.lineTo(Pt*s-Dt*l,Dt*s+Pt*l),e.lineTo(Pt*r+Dt*i,Pt*i-Dt*r),e.lineTo(Pt*o+Dt*a,Pt*a-Dt*o),e.lineTo(Pt*s+Dt*l,Pt*l-Dt*s),e.closePath()}},vp={draw(e,t){const n=Te(t-Pi(t/6,1.7))*.6189;e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}},q$=[uu,N$,z$,W$,X$,U$,H$],j9=[uu,G$,vp,j$,B$,V$,O$];function H9(e,t){let n=null,r=ha(i);e=typeof e=="function"?e:ce(e||uu),t=typeof t=="function"?t:ce(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:ce(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:ce(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function Gn(){}function cu(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function fu(e){this._context=e}fu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:cu(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:cu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function q9(e){return new fu(e)}function Z$(e){this._context=e}Z$.prototype={areaStart:Gn,areaEnd:Gn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:cu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Z9(e){return new Z$(e)}function K$(e){this._context=e}K$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:cu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function K9(e){return new K$(e)}function Q$(e,t){this._basis=new fu(e),this._beta=t}Q$.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],o=e[n]-r,a=t[n]-i,s=-1,l;++s<=n;)l=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+l*o),this._beta*t[s]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const Q9=function e(t){function n(r){return t===1?new fu(r):new Q$(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function hu(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Sp(e,t){this._context=e,this._k=(1-t)/6}Sp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:hu(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:hu(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const J9=function e(t){function n(r){return new Sp(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Tp(e,t){this._context=e,this._k=(1-t)/6}Tp.prototype={areaStart:Gn,areaEnd:Gn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:hu(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const eE=function e(t){function n(r){return new Tp(r,t)}return n.tension=function(r){return e(+r)},n}(0);function _p(e,t){this._context=e,this._k=(1-t)/6}_p.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:hu(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const tE=function e(t){function n(r){return new _p(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Ap(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>Ue){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Ue){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*u+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*u+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}function J$(e,t){this._context=e,this._alpha=t}J$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Ap(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const nE=function e(t){function n(r){return t?new J$(r,t):new Sp(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function ev(e,t){this._context=e,this._alpha=t}ev.prototype={areaStart:Gn,areaEnd:Gn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Ap(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const rE=function e(t){function n(r){return t?new ev(r,t):new Tp(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function tv(e,t){this._context=e,this._alpha=t}tv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ap(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const iE=function e(t){function n(r){return t?new tv(r,t):new _p(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function nv(e){this._context=e}nv.prototype={areaStart:Gn,areaEnd:Gn,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function oE(e){return new nv(e)}function rv(e){return e<0?-1:1}function iv(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(rv(o)+rv(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function ov(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function wp(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function pu(e){this._context=e}pu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:wp(this,this._t0,ov(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,wp(this,ov(this,n=iv(this,e,t)),n);break;default:wp(this,this._t0,n=iv(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function av(e){this._context=new sv(e)}(av.prototype=Object.create(pu.prototype)).point=function(e,t){pu.prototype.point.call(this,t,e)};function sv(e){this._context=e}sv.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function aE(e){return new pu(e)}function sE(e){return new av(e)}function lv(e){this._context=e}lv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=uv(e),i=uv(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function uv(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),a=new Array(n);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function lE(e){return new lv(e)}function gu(e,t){this._context=e,this._t=t}gu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function uE(e){return new gu(e,.5)}function cE(e){return new gu(e,0)}function fE(e){return new gu(e,1)}function Di(e,t){if((a=e.length)>1)for(var n=1,r,i,o=e[t[0]],a,s=o.length;n<a;++n)for(i=o,o=e[t[n]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Ci(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function hE(e,t){return e[t]}function pE(e){const t=[];return t.key=e,t}function gE(){var e=ce([]),t=Ci,n=Di,r=hE;function i(o){var a=Array.from(e.apply(this,arguments),pE),s,l=a.length,u=-1,c;for(const h of o)for(s=0,++u;s<l;++s)(a[s][u]=[0,+r(h,a[s].key,u,o)]).data=h;for(s=0,c=ou(t(a));s<l;++s)a[c[s]].index=s;return n(a,c),a}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:ce(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:ce(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?Ci:typeof o=="function"?o:ce(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??Di,i):n},i}function dE(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,a;i<o;++i){for(a=n=0;n<r;++n)a+=e[n][i][1]||0;if(a)for(n=0;n<r;++n)e[n][i][1]/=a}Di(e,t)}}function mE(e,t){if((l=e.length)>0)for(var n,r=0,i,o,a,s,l,u=e[t[0]].length;r<u;++r)for(a=s=0,n=0;n<l;++n)(o=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=o):o<0?(i[1]=s,i[0]=s+=o):(i[0]=0,i[1]=o)}function yE(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var a=0,s=0;a<i;++a)s+=e[a][n][1]||0;r[n][1]+=r[n][0]=-s/2}Di(e,t)}}function bE(e,t){if(!(!((a=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,a;r<o;++r){for(var s=0,l=0,u=0;s<a;++s){for(var c=e[t[s]],h=c[r][1]||0,f=c[r-1][1]||0,p=(h-f)/2,d=0;d<s;++d){var m=e[t[d]],g=m[r][1]||0,y=m[r-1][1]||0;p+=g-y}l+=h,u+=p*h}i[r-1][1]+=i[r-1][0]=n,l&&(n-=u/l)}i[r-1][1]+=i[r-1][0]=n,Di(e,t)}}function cv(e){var t=e.map(xE);return Ci(e).sort(function(n,r){return t[n]-t[r]})}function xE(e){for(var t=-1,n=0,r=e.length,i,o=-1/0;++t<r;)(i=+e[t][1])>o&&(o=i,n=t);return n}function fv(e){var t=e.map(hv);return Ci(e).sort(function(n,r){return t[n]-t[r]})}function hv(e){for(var t=0,n=-1,r=e.length,i;++n<r;)(i=+e[n][1])&&(t+=i);return t}function $E(e){return fv(e).reverse()}function vE(e){var t=e.length,n,r,i=e.map(hv),o=cv(e),a=0,s=0,l=[],u=[];for(n=0;n<t;++n)r=o[n],a<s?(a+=i[r],l.push(r)):(s+=i[r],u.push(r));return u.reverse().concat(l)}function SE(e){return Ci(e).reverse()}const du=e=>()=>e;function TE(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function nn(e,t,n){this.k=e,this.x=t,this.y=n}nn.prototype={constructor:nn,scale:function(e){return e===1?this:new nn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new nn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Li=new nn(1,0,0);pv.prototype=nn.prototype;function pv(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Li;return e.__zoom}function Pp(e){e.stopImmediatePropagation()}function da(e){e.preventDefault(),e.stopImmediatePropagation()}function _E(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function AE(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function gv(){return this.__zoom||Li}function wE(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function PE(){return navigator.maxTouchPoints||"ontouchstart"in this}function DE(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function Tn(){var e=_E,t=AE,n=DE,r=wE,i=PE,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,l=H0,u=Jn("start","zoom","end"),c,h,f,p=500,d=150,m=0,g=10;function y(D){D.property("__zoom",gv).on("wheel.zoom",w,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",I).filter(i).on("touchstart.zoom",v).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",R).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(D,T,M,G){var k=D.selection?D.selection():D;k.property("__zoom",gv),D!==k?S(D,T,M,G):k.interrupt().each(function(){_(this,arguments).event(G).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},y.scaleBy=function(D,T,M,G){y.scaleTo(D,function(){var k=this.__zoom.k,B=typeof T=="function"?T.apply(this,arguments):T;return k*B},M,G)},y.scaleTo=function(D,T,M,G){y.transform(D,function(){var k=t.apply(this,arguments),B=this.__zoom,F=M==null?$(k):typeof M=="function"?M.apply(this,arguments):M,E=B.invert(F),W=typeof T=="function"?T.apply(this,arguments):T;return n(x(b(B,W),F,E),k,a)},M,G)},y.translateBy=function(D,T,M,G){y.transform(D,function(){return n(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),a)},null,G)},y.translateTo=function(D,T,M,G,k){y.transform(D,function(){var B=t.apply(this,arguments),F=this.__zoom,E=G==null?$(B):typeof G=="function"?G.apply(this,arguments):G;return n(Li.translate(E[0],E[1]).scale(F.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof M=="function"?-M.apply(this,arguments):-M),B,a)},G,k)};function b(D,T){return T=Math.max(o[0],Math.min(o[1],T)),T===D.k?D:new nn(T,D.x,D.y)}function x(D,T,M){var G=T[0]-M[0]*D.k,k=T[1]-M[1]*D.k;return G===D.x&&k===D.y?D:new nn(D.k,G,k)}function $(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function S(D,T,M,G){D.on("start.zoom",function(){_(this,arguments).event(G).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(G).end()}).tween("zoom",function(){var k=this,B=arguments,F=_(k,B).event(G),E=t.apply(k,B),W=M==null?$(E):typeof M=="function"?M.apply(k,B):M,j=Math.max(E[1][0]-E[0][0],E[1][1]-E[0][1]),te=k.__zoom,V=typeof T=="function"?T.apply(k,B):T,ee=l(te.invert(W).concat(j/te.k),V.invert(W).concat(j/V.k));return function(Y){if(Y===1)Y=V;else{var J=ee(Y),K=j/J[2];Y=new nn(K,W[0]-J[0]*K,W[1]-J[1]*K)}F.zoom(null,Y)}})}function _(D,T,M){return!M&&D.__zooming||new A(D,T)}function A(D,T){this.that=D,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,T),this.taps=0}A.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,T){return this.mouse&&D!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var T=X(this.that).datum();u.call(D,this.that,new TE(D,{sourceEvent:this.sourceEvent,target:y,type:D,transform:this.that.__zoom,dispatch:u}),T)}};function w(D,...T){if(!e.apply(this,arguments))return;var M=_(this,T).event(D),G=this.__zoom,k=Math.max(o[0],Math.min(o[1],G.k*Math.pow(2,r.apply(this,arguments)))),B=yt(D);if(M.wheel)(M.mouse[0][0]!==B[0]||M.mouse[0][1]!==B[1])&&(M.mouse[1]=G.invert(M.mouse[0]=B)),clearTimeout(M.wheel);else{if(G.k===k)return;M.mouse=[B,G.invert(B)],sr(this),M.start()}da(D),M.wheel=setTimeout(F,d),M.zoom("mouse",n(x(b(G,k),M.mouse[0],M.mouse[1]),M.extent,a));function F(){M.wheel=null,M.end()}}function P(D,...T){if(f||!e.apply(this,arguments))return;var M=D.currentTarget,G=_(this,T,!0).event(D),k=X(D.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",j,!0),B=yt(D,M),F=D.clientX,E=D.clientY;ys(D.view),Pp(D),G.mouse=[B,this.__zoom.invert(B)],sr(this),G.start();function W(te){if(da(te),!G.moved){var V=te.clientX-F,ee=te.clientY-E;G.moved=V*V+ee*ee>m}G.event(te).zoom("mouse",n(x(G.that.__zoom,G.mouse[0]=yt(te,M),G.mouse[1]),G.extent,a))}function j(te){k.on("mousemove.zoom mouseup.zoom",null),bs(te.view,G.moved),da(te),G.event(te).end()}}function I(D,...T){if(e.apply(this,arguments)){var M=this.__zoom,G=yt(D.changedTouches?D.changedTouches[0]:D,this),k=M.invert(G),B=M.k*(D.shiftKey?.5:2),F=n(x(b(M,B),G,k),t.apply(this,T),a);da(D),s>0?X(this).transition().duration(s).call(S,F,G,D):X(this).call(y.transform,F,G,D)}}function v(D,...T){if(e.apply(this,arguments)){var M=D.touches,G=M.length,k=_(this,T,D.changedTouches.length===G).event(D),B,F,E,W;for(Pp(D),F=0;F<G;++F)E=M[F],W=yt(E,this),W=[W,this.__zoom.invert(W),E.identifier],k.touch0?!k.touch1&&k.touch0[2]!==W[2]&&(k.touch1=W,k.taps=0):(k.touch0=W,B=!0,k.taps=1+!!c);c&&(c=clearTimeout(c)),B&&(k.taps<2&&(h=W[0],c=setTimeout(function(){c=null},p)),sr(this),k.start())}}function N(D,...T){if(this.__zooming){var M=_(this,T).event(D),G=D.changedTouches,k=G.length,B,F,E,W;for(da(D),B=0;B<k;++B)F=G[B],E=yt(F,this),M.touch0&&M.touch0[2]===F.identifier?M.touch0[0]=E:M.touch1&&M.touch1[2]===F.identifier&&(M.touch1[0]=E);if(F=M.that.__zoom,M.touch1){var j=M.touch0[0],te=M.touch0[1],V=M.touch1[0],ee=M.touch1[1],Y=(Y=V[0]-j[0])*Y+(Y=V[1]-j[1])*Y,J=(J=ee[0]-te[0])*J+(J=ee[1]-te[1])*J;F=b(F,Math.sqrt(Y/J)),E=[(j[0]+V[0])/2,(j[1]+V[1])/2],W=[(te[0]+ee[0])/2,(te[1]+ee[1])/2]}else if(M.touch0)E=M.touch0[0],W=M.touch0[1];else return;M.zoom("touch",n(x(F,E,W),M.extent,a))}}function R(D,...T){if(this.__zooming){var M=_(this,T).event(D),G=D.changedTouches,k=G.length,B,F;for(Pp(D),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),B=0;B<k;++B)F=G[B],M.touch0&&M.touch0[2]===F.identifier?delete M.touch0:M.touch1&&M.touch1[2]===F.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(F=yt(F,this),Math.hypot(h[0]-F[0],h[1]-F[1])<g)){var E=X(this).on("dblclick.zoom");E&&E.apply(this,arguments)}}}return y.wheelDelta=function(D){return arguments.length?(r=typeof D=="function"?D:du(+D),y):r},y.filter=function(D){return arguments.length?(e=typeof D=="function"?D:du(!!D),y):e},y.touchable=function(D){return arguments.length?(i=typeof D=="function"?D:du(!!D),y):i},y.extent=function(D){return arguments.length?(t=typeof D=="function"?D:du([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),y):t},y.scaleExtent=function(D){return arguments.length?(o[0]=+D[0],o[1]=+D[1],y):[o[0],o[1]]},y.translateExtent=function(D){return arguments.length?(a[0][0]=+D[0][0],a[1][0]=+D[1][0],a[0][1]=+D[0][1],a[1][1]=+D[1][1],y):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},y.constrain=function(D){return arguments.length?(n=D,y):n},y.duration=function(D){return arguments.length?(s=+D,y):s},y.interpolate=function(D){return arguments.length?(l=D,y):l},y.on=function(){var D=u.on.apply(u,arguments);return D===u?y:D},y.clickDistance=function(D){return arguments.length?(m=(D=+D)*D,y):Math.sqrt(m)},y.tapDistance=function(D){return arguments.length?(g=+D,y):g},y}const Dp=Object.freeze(Object.defineProperty({__proto__:null,Adder:Me,Delaunay:Nf,FormatSpecifier:Js,InternMap:uo,InternSet:Zn,Node:br,Path:ko,Voronoi:By,ZoomTransform:nn,active:I5,arc:iu,area:yp,areaRadial:k$,ascending:_e,autoType:ik,axisBottom:Km,axisLeft:Nc,axisRight:PC,axisTop:hs,bin:Gm,bisect:qn,bisectCenter:_D,bisectLeft:TD,bisectRight:wm,bisector:ns,blob:sk,blur:AD,blur2:Pm,blurImage:wD,brush:j5,brushSelection:Y5,brushX:X5,brushY:U5,buffer:uk,chord:q5,chordDirected:K5,chordTranspose:Z5,cluster:x4,color:Mn,contourDensity:T6,contours:kf,count:is,create:lM,creator:gs,cross:RD,csv:hk,csvFormat:j6,csvFormatBody:H6,csvFormatRow:Z6,csvFormatRows:q6,csvFormatValue:K6,csvParse:Oy,csvParseRows:U6,cubehelix:Bt,cumsum:ID,curveBasis:q9,curveBasisClosed:Z9,curveBasisOpen:K9,curveBumpX:I$,curveBumpY:E$,curveBundle:Q9,curveCardinal:J9,curveCardinalClosed:eE,curveCardinalOpen:tE,curveCatmullRom:nE,curveCatmullRomClosed:rE,curveCatmullRomOpen:iE,curveLinear:au,curveLinearClosed:oE,curveMonotoneX:aE,curveMonotoneY:sE,curveNatural:lE,curveStep:uE,curveStepAfter:fE,curveStepBefore:cE,descending:_m,deviation:Lm,difference:dC,disjoint:mC,dispatch:Jn,drag:$s,dragDisable:ys,dragEnable:bs,dsv:fk,dsvFormat:Us,easeBack:my,easeBackIn:w5,easeBackInOut:my,easeBackOut:P5,easeBounce:Lo,easeBounceIn:_5,easeBounceInOut:A5,easeBounceOut:Lo,easeCircle:dy,easeCircleIn:g5,easeCircleInOut:dy,easeCircleOut:d5,easeCubic:Co,easeCubicIn:a5,easeCubicInOut:Co,easeCubicOut:s5,easeElastic:lr,easeElasticIn:D5,easeElasticInOut:C5,easeElasticOut:lr,easeExp:gy,easeExpIn:h5,easeExpInOut:gy,easeExpOut:p5,easeLinear:Ft,easePoly:cy,easePolyIn:l5,easePolyInOut:cy,easePolyOut:u5,easeQuad:uy,easeQuadIn:i5,easeQuadInOut:uy,easeQuadOut:o5,easeSin:py,easeSinIn:c5,easeSinInOut:py,easeSinOut:f5,every:uC,extent:lo,fcumsum:BD,filter:fC,flatGroup:ND,flatRollup:FD,forceCenter:Wf,forceCollide:qs,forceLink:Yf,forceManyBody:Ks,forceRadial:Uk,forceSimulation:Zs,forceX:jy,forceY:Hy,get format(){return Bo},formatDefaultLocale:nb,formatLocale:tb,get formatPrefix(){return Xf},formatSpecifier:pi,fsum:ED,geoAlbers:m1,geoAlbersUsa:K8,geoArea:n8,geoAzimuthalEqualArea:Q8,geoAzimuthalEqualAreaRaw:Lh,geoAzimuthalEquidistant:J8,geoAzimuthalEquidistantRaw:Mh,geoBounds:a8,geoCentroid:h8,geoCircle:p8,geoClipAntimeridian:uh,geoClipCircle:Fb,geoClipExtent:$8,geoClipRectangle:vl,geoConicConformal:t4,geoConicConformalRaw:x1,geoConicEqualArea:Rl,geoConicEqualAreaRaw:d1,geoConicEquidistant:r4,geoConicEquidistantRaw:$1,geoContains:P8,geoDistance:_l,geoEqualEarth:o4,geoEqualEarthRaw:kh,geoEquirectangular:n4,geoEquirectangularRaw:Qo,geoGnomonic:a4,geoGnomonicRaw:Rh,geoGraticule:Hb,geoGraticule10:D8,geoIdentity:s4,geoInterpolate:C8,geoLength:zb,geoMercator:e4,geoMercatorRaw:Ko,geoNaturalEarth1:l4,geoNaturalEarth1Raw:Ih,geoOrthographic:u4,geoOrthographicRaw:Eh,geoPath:G8,geoProjection:Jt,geoProjectionMutator:Dh,geoRotation:Lb,geoStereographic:c4,geoStereographicRaw:Bh,geoStream:zt,geoTransform:W8,geoTransverseMercator:f4,geoTransverseMercatorRaw:Nh,gray:DM,greatest:Wm,greatestIndex:iC,group:Im,groupSort:GD,groups:Em,hcl:ws,hierarchy:Bl,histogram:Gm,hsl:Ts,html:bk,image:gk,index:zD,indexes:OD,interpolate:ln,interpolateArray:IM,interpolateBasis:R0,interpolateBasisClosed:I0,interpolateBlues:r9,interpolateBrBG:BI,interpolateBuGn:XI,interpolateBuPu:UI,interpolateCividis:u9,interpolateCool:h9,interpolateCubehelix:qM,interpolateCubehelixDefault:c9,interpolateCubehelixLong:Ms,interpolateDate:O0,interpolateDiscrete:NM,interpolateGnBu:jI,interpolateGreens:i9,interpolateGreys:o9,interpolateHcl:jM,interpolateHclLong:HM,interpolateHsl:YM,interpolateHslLong:XM,interpolateHue:FM,interpolateInferno:$9,interpolateLab:UM,interpolateMagma:x9,interpolateNumber:bt,interpolateNumberArray:nf,interpolateObject:G0,interpolateOrRd:HI,interpolateOranges:l9,interpolatePRGn:NI,interpolatePiYG:FI,interpolatePlasma:v9,interpolatePuBu:ZI,interpolatePuBuGn:qI,interpolatePuOr:zI,interpolatePuRd:KI,interpolatePurples:a9,interpolateRainbow:p9,interpolateRdBu:OI,interpolateRdGy:GI,interpolateRdPu:QI,interpolateRdYlBu:WI,interpolateRdYlGn:VI,interpolateReds:s9,interpolateRgb:vo,interpolateRgbBasis:N0,interpolateRgbBasisClosed:RM,interpolateRound:So,interpolateSinebow:m9,interpolateSpectral:YI,interpolateString:af,interpolateTransformCss:X0,interpolateTransformSvg:U0,interpolateTurbo:y9,interpolateViridis:b9,interpolateWarm:f9,interpolateYlGn:e9,interpolateYlGnBu:JI,interpolateYlOrBr:t9,interpolateYlOrRd:n9,interpolateZoom:H0,interrupt:sr,intersection:yC,interval:e3,isoFormat:dI,isoParse:bI,json:mk,lab:xo,lch:CM,least:rC,leastIndex:Xm,line:su,lineRadial:M$,link:lu,linkHorizontal:N9,linkRadial:z9,linkVertical:F9,local:s0,map:hC,matcher:Gc,max:co,maxIndex:kc,mean:qD,median:ZD,medianIndex:KD,merge:Ic,min:ss,minIndex:Rc,mode:JD,namespace:go,namespaces:zc,nice:Lc,now:Po,pack:q4,packEnclose:V4,packSiblings:j4,pairs:eC,partition:Z4,path:Mf,pathRound:e6,permute:Om,pie:D$,piecewise:Q0,pointRadial:ga,pointer:yt,pointers:cM,polygonArea:fR,polygonCentroid:hR,polygonContains:mR,polygonHull:dR,polygonLength:yR,precisionFixed:rb,precisionPrefix:ib,precisionRound:ob,quadtree:Hs,quantile:ho,quantileIndex:Ym,quantileSorted:Vm,quantize:ZM,quickselect:ls,radialArea:k$,radialLine:M$,randomBates:vR,randomBernoulli:_R,randomBeta:W1,randomBinomial:V1,randomCauchy:wR,randomExponential:SR,randomGamma:jh,randomGeometric:G1,randomInt:xR,randomIrwinHall:O1,randomLcg:MR,randomLogNormal:$R,randomLogistic:PR,randomNormal:Uh,randomPareto:TR,randomPoisson:DR,randomUniform:bR,randomWeibull:AR,range:Cn,rank:nC,reduce:pC,reverse:gC,rgb:ti,ribbon:l6,ribbonArrow:u6,rollup:Nm,rollups:Fm,scaleBand:Zh,scaleDiverging:qx,scaleDivergingLog:Zx,scaleDivergingPow:gp,scaleDivergingSqrt:_I,scaleDivergingSymlog:Kx,scaleIdentity:H1,scaleImplicit:Hh,scaleLinear:Nn,scaleLog:J1,scaleOrdinal:qh,scalePoint:Kh,scalePow:yn,scaleQuantile:ax,scaleQuantize:sx,scaleRadial:ox,scaleSequential:Xx,scaleSequentialLog:Ux,scaleSequentialPow:pp,scaleSequentialQuantile:Hx,scaleSequentialSqrt:TI,scaleSequentialSymlog:jx,scaleSqrt:VR,scaleSymlog:nx,scaleThreshold:lx,scaleTime:vI,scaleUtc:SI,scan:oC,schemeAccent:wI,schemeBlues:x$,schemeBrBG:Qx,schemeBuGn:s$,schemeBuPu:l$,schemeCategory10:AI,schemeDark2:PI,schemeGnBu:u$,schemeGreens:$$,schemeGreys:v$,schemeObservable10:DI,schemeOrRd:c$,schemeOranges:_$,schemePRGn:Jx,schemePaired:CI,schemePastel1:LI,schemePastel2:MI,schemePiYG:e$,schemePuBu:h$,schemePuBuGn:f$,schemePuOr:t$,schemePuRd:p$,schemePurples:S$,schemeRdBu:n$,schemeRdGy:r$,schemeRdPu:g$,schemeRdYlBu:i$,schemeRdYlGn:o$,schemeReds:T$,schemeSet1:kI,schemeSet2:RI,schemeSet3:II,schemeSpectral:a$,schemeTableau10:EI,schemeYlGn:m$,schemeYlGnBu:d$,schemeYlOrBr:y$,schemeYlOrRd:b$,select:X,selectAll:fM,selection:tr,selector:ds,selectorAll:Oc,shuffle:aC,shuffler:Um,some:cC,sort:Pc,stack:gE,stackOffsetDiverging:mE,stackOffsetExpand:dE,stackOffsetNone:Di,stackOffsetSilhouette:yE,stackOffsetWiggle:bE,stackOrderAppearance:cv,stackOrderAscending:fv,stackOrderDescending:$E,stackOrderInsideOut:vE,stackOrderNone:Ci,stackOrderReverse:SE,stratify:eR,style:er,subset:xC,sum:Ec,superset:Hm,svg:xk,symbol:H9,symbolAsterisk:B$,symbolCircle:uu,symbolCross:N$,symbolDiamond:z$,symbolDiamond2:O$,symbolPlus:G$,symbolSquare:W$,symbolSquare2:V$,symbolStar:X$,symbolTimes:vp,symbolTriangle:U$,symbolTriangle2:j$,symbolWye:H$,symbolX:vp,symbols:q$,symbolsFill:q$,symbolsStroke:j9,text:js,thresholdFreedmanDiaconis:jD,thresholdScott:HD,thresholdSturges:Mc,tickFormat:j1,tickIncrement:Qn,tickStep:as,ticks:Kn,timeDay:Ti,timeDays:qR,get timeFormat(){return cp},timeFormatDefaultLocale:Vx,timeFormatLocale:Px,timeFriday:gx,timeFridays:n7,timeHour:Ul,timeHours:jR,timeInterval:Le,timeMillisecond:Si,timeMilliseconds:ux,timeMinute:Yl,timeMinutes:XR,timeMonday:sa,timeMondays:QR,timeMonth:Hl,timeMonths:c7,get timeParse(){return Wx},timeSaturday:dx,timeSaturdays:r7,timeSecond:vn,timeSeconds:fx,timeSunday:_i,timeSundays:mx,timeThursday:vr,timeThursdays:t7,timeTickInterval:wx,timeTicks:Ax,timeTuesday:hx,timeTuesdays:JR,timeWednesday:px,timeWednesdays:e7,timeWeek:_i,timeWeeks:mx,timeYear:en,timeYears:h7,timeout:uf,timer:Es,timerFlush:ty,transition:sy,transpose:jm,tree:sR,treemap:F1,treemapBinary:lR,treemapDice:ia,treemapResquarify:cR,treemapSlice:Gl,treemapSliceDice:uR,treemapSquarify:Xh,tsv:pk,tsvFormat:J6,tsvFormatBody:ek,tsvFormatRow:nk,tsvFormatRows:tk,tsvFormatValue:rk,tsvParse:Gy,tsvParseRows:Q6,union:$C,unixDay:sp,unixDays:KR,utcDay:aa,utcDays:ZR,get utcFormat(){return Zl},utcFriday:xx,utcFridays:l7,utcHour:jl,utcHours:HR,utcMillisecond:Si,utcMilliseconds:ux,utcMinute:Xl,utcMinutes:UR,utcMonday:la,utcMondays:i7,utcMonth:ql,utcMonths:f7,get utcParse(){return fp},utcSaturday:$x,utcSaturdays:u7,utcSecond:vn,utcSeconds:fx,utcSunday:Ai,utcSundays:vx,utcThursday:Tr,utcThursdays:s7,utcTickInterval:_x,utcTicks:Tx,utcTuesday:yx,utcTuesdays:o7,utcWednesday:bx,utcWednesdays:a7,utcWeek:Ai,utcWeeks:vx,utcYear:tn,utcYears:p7,variance:Cm,window:Wc,xml:yk,zip:lC,zoom:Tn,zoomIdentity:Li,zoomTransform:pv},Symbol.toStringTag,{value:"Module"}));function dv(e){try{return e.node().getBBox()}catch(t){throw new Error(t)}}function CE(e,t){function n(i){var s;const o=document.createElementNS("http://www.w3.org/1999/xhtml","div");o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+i+"</svg>";const a=document.createDocumentFragment();for(;a&&((s=o==null?void 0:o.firstChild)!=null&&s.firstChild);)a.appendChild(o.firstChild.firstChild);return a}const r=e.node();for(;r.hasChildNodes();)r.removeChild(r.firstChild);e.node().appendChild(n(t))}function _r(e){return e.substring(0,4)!=="ease"?Co:Dp[e]??Co}function mu({axisWidth:e,innerRadius:t,outerRadius:n,padAngle:r,cornerRadius:i}){const o=Nn().domain([0,1]).range([0,e/2]),a=o(n);return iu().innerRadius(o(t)).outerRadius(a).padAngle(r).padRadius(a).cornerRadius(i)}const rn=(e,t)=>{if(t instanceof Function){const n=t(e);return String(n??"")}return Bo(t)(e)};function Cp(e){return!(xo(e).l<=60)}function Mi(e,t=10){var i;const n=document.createElement("canvas").getContext("2d");return(((i=n==null?void 0:n.measureText(e))==null?void 0:i.width)??0)*t/10}function LE(e){if(e===null||Number.isNaN(e)==!0)return String(e||0);const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")}function pe(e,t){const n=t.colors[t.colorScheme];return e==="label"?n.label[0]:e==="labelContrast"?Cp(n.label[0])?n.labelContrast[1]:n.labelContrast[0]:e=="none"?"none":n[e]!=null?n[e]:n.primary}function Se({datum:e,colorType:t,fullChartParams:n}){const r=n.colors[n.colorScheme];if(t==="label"){const i=e.color;return i||r.label[0]}else if(t==="labelContrast"){const i=e.color;return i?Cp(i)?r.labelContrast[1]:r.labelContrast[0]:Cp(r.label[0])?r.labelContrast[1]:r.labelContrast[0]}return t=="none"?"none":r[t]!=null?r[t]:r.primary}function H(e,t,n){const r=n?`--${n}`:"";return`orbcharts-${e}__${t}${r}`}function Oe(e,t){const r=Math.random().toString(36).substr(2,5);return H(e,t,r)}function Ar(e,t){let n=new me(()=>{});return e.each(function(){const r=Wu(this,t);n=Vu(n,r)}),n}const wr=({selection:e,pluginName:t,clipPathID:n,seriesLabels$:r,gridContainerPosition$:i,gridAxesTransform$:o,gridGraphicTransform$:a})=>{const s=H(t,"series"),l=H(t,"axes"),u=H(t,"graphic"),c=r.pipe(L((d,m)=>e.selectAll(`g.${s}`).data(d,g=>g).join(g=>g.append("g").classed(s,!0).each((y,b,x)=>{X(x[b]).selectAll(`g.${l}`).data([b]).join($=>$.append("g").classed(l,!0).attr("clip-path",`url(#${n})`).each((S,_,A)=>{X(A[_]).selectAll("defs").data([_]).join("defs"),X(A[_]).selectAll("g").data([_]).join("g").classed(u,!0)}),$=>$,$=>$.remove())}),g=>g,g=>g.remove())),ne(1));O({seriesSelection:c,gridContainerPosition:i}).pipe(z(async d=>d)).subscribe(d=>{d.seriesSelection.transition().attr("transform",(m,g)=>{const y=d.gridContainerPosition[g]??d.gridContainerPosition[0],b=y.translate,x=y.scale;return`translate(${b[0]}, ${b[1]}) scale(${x[0]}, ${x[1]})`})});const h=O({seriesSelection:c,gridAxesTransform:o}).pipe(z(async d=>d),L(d=>d.seriesSelection.select(`g.${l}`).style("transform",d.gridAxesTransform.value)),ne(1)),f=h.pipe(L(d=>d.select("defs")),ne(1)),p=O({axesSelection:h,gridGraphicTransform:a}).pipe(z(async d=>d),L(d=>{const m=d.axesSelection.select(`g.${u}`);return m.transition().duration(50).style("transform",d.gridGraphicTransform.value),m}),ne(1));return{seriesSelection$:c,axesSelection$:h,defsSelection$:f,graphicGSelection$:p}},ME=({selection:e,pluginName:t,computedData$:n,gridContainerPosition$:r,isSeriesSeprate$:i})=>{const o=H(t,"container"),a=O({computedData:n.pipe(q((s,l)=>s.length===l.length)),isSeriesSeprate:i}).pipe(z(async s=>s),L(s=>s.isSeriesSeprate?s.computedData:[s.computedData[0]]),L((s,l)=>e.selectAll(`g.${o}`).data(s,u=>u&&u[0]?u[0].seriesIndex:l).join("g").classed(o,!0)),ne(1));return O({containerSelection:a,gridContainerPosition:r}).pipe(z(async s=>s)).subscribe(s=>{s.containerSelection.attr("transform",(l,u)=>{const c=s.gridContainerPosition[u]??s.gridContainerPosition[0],h=c.translate,f=c.scale;return`translate(${h[0]}, ${h[1]}) scale(${f[0]}, ${f[1]})`})}),a},mv=({fullDataFormatter$:e,gridAxesSize$:t,computedData$:n,fullChartParams$:r,gridContainerPosition$:i,layout$:o})=>{const a=new Q,s=O({fullDataFormatter:e,gridAxesSize:t,computedData:n}).pipe(z(async f=>f),L(f=>{const p=f.computedData[0]?f.computedData[0].length-1:0,d=f.fullDataFormatter.groupAxis.scaleDomain[0]-f.fullDataFormatter.groupAxis.scalePadding,m=f.fullDataFormatter.groupAxis.scaleDomain[1]==="max"?p+f.fullDataFormatter.groupAxis.scalePadding:f.fullDataFormatter.groupAxis.scaleDomain[1]+f.fullDataFormatter.groupAxis.scalePadding;return[d,m]}),ne(1)),l=O({fullDataFormatter:e,computedData:n}).pipe(z(async f=>f),L(f=>f.fullDataFormatter.seriesDirection==="row"?(f.computedData[0]??[]).map(p=>p.groupLabel):f.computedData.map(p=>p[0].groupLabel))),u=O({groupScaleDomain:s,groupLabels:l}).pipe(z(async f=>f),L(f=>f.groupLabels.filter((p,d)=>d>=f.groupScaleDomain[0]&&d<=f.groupScaleDomain[1]))),c=i.pipe(L(f=>f.reduce((d,m)=>m.columnIndex>d?m.columnIndex:d,0)+1),q()),h=i.pipe(L(f=>f.reduce((d,m)=>m.rowIndex>d?m.rowIndex:d,0)+1),q());return new me(f=>{O({dataFormatter:e,axisSize:t,fullChartParams:r,scaleRangeGroupLabels:u,groupLabels:l,groupScaleDomain:s,columnAmount:c,rowAmount:h,layout:o}).pipe(C(a),z(async p=>p)).subscribe(p=>{const d=p.dataFormatter.valueAxis.position==="right"||p.dataFormatter.valueAxis.position==="bottom",m=Tc({axisLabels:p.scaleRangeGroupLabels,axisWidth:p.axisSize.width,padding:p.dataFormatter.groupAxis.scalePadding,reverse:d}),g=b=>p.dataFormatter.groupAxis.position==="bottom"||p.dataFormatter.groupAxis.position==="top"?b.offsetX-p.fullChartParams.padding.left:b.offsetY-p.fullChartParams.padding.top,y=b=>{const x={offsetX:b.offsetX*p.columnAmount%p.layout.rootWidth,offsetY:b.offsetY*p.rowAmount%p.layout.rootHeight},$=g(x),S=m($),_=Math.ceil(p.groupScaleDomain[0]),A=S+_;return{groupIndex:A,groupLabel:p.groupLabels[A]??""}};return f.next(y),function(){a.next(void 0)}})})},kE=({rootSelection:e,fullDataFormatter$:t,containerSize$:n,gridAxesContainerSize$:r,computedData$:i,gridContainerPosition$:o,layout$:a})=>{const s=Ar(e,"mousemove"),l=O({fullDataFormatter:t,computedData:i}).pipe(z(async g=>g),L(g=>{const y=g.computedData[0]?g.computedData[0].length-1:0,b=g.fullDataFormatter.groupAxis.scaleDomain[0]-g.fullDataFormatter.groupAxis.scalePadding,x=g.fullDataFormatter.groupAxis.scaleDomain[1]==="max"?y+g.fullDataFormatter.groupAxis.scalePadding:g.fullDataFormatter.groupAxis.scaleDomain[1]+g.fullDataFormatter.groupAxis.scalePadding;return[b,x]}),ne(1)),u=O({fullDataFormatter:t,computedData:i}).pipe(z(async g=>g),L(g=>g.fullDataFormatter.seriesDirection==="row"?(g.computedData[0]??[]).map(y=>y.groupLabel):g.computedData.map(y=>y[0].groupLabel))),c=O({groupScaleDomain:l,groupLabels:u}).pipe(z(async g=>g),L(g=>g.groupLabels.filter((y,b)=>b>=g.groupScaleDomain[0]&&b<=g.groupScaleDomain[1]))),h=t.pipe(L(g=>g.valueAxis.position==="right"||g.valueAxis.position==="bottom")),f=O({reverse:h,gridAxesContainerSize:r,scaleRangeGroupLabels:c,fullDataFormatter:t}).pipe(z(async g=>g),L(g=>Tc({axisLabels:g.scaleRangeGroupLabels,axisWidth:g.gridAxesContainerSize.width,padding:g.fullDataFormatter.groupAxis.scalePadding,reverse:g.reverse}))),p=O({fullDataFormatter:t,rootMousemove:s,gridContainerPosition:o,layout:a}).pipe(z(async g=>g),L(g=>{if(g.fullDataFormatter.groupAxis.position==="bottom"||g.fullDataFormatter.groupAxis.position==="top"){let y=g.rootMousemove.offsetX;const x=g.gridContainerPosition.map(($,S)=>{var _;return[$.translate[0],((_=g.gridContainerPosition[S+1])==null?void 0:_.translate[0])??g.layout.rootWidth]}).filter($=>$[0]<$[1]).find($=>y>=$[0]&&y<=$[1]);return x&&(y=y-x[0]),y-g.layout.left}else{let y=g.rootMousemove.offsetY;const x=g.gridContainerPosition.map(($,S)=>{var _;return[$.translate[1],((_=g.gridContainerPosition[S+1])==null?void 0:_.translate[1])??g.layout.rootHeight]}).filter($=>$[0]<$[1]).find($=>y>=$[0]&&y<=$[1]);return x&&(y=y-x[0]),y-g.layout.top}})),d=O({xIndexScale:f,axisValue:p,groupScaleDomain:l}).pipe(z(async g=>g),L(g=>{const y=g.xIndexScale(g.axisValue),b=Math.ceil(g.groupScaleDomain[0]);return y+b})),m=O({groupIndex:d,groupLabels:u}).pipe(z(async g=>g),L(g=>g.groupLabels[g.groupIndex]??""));return O({groupIndex:d,groupLabel:m}).pipe(z(async g=>g),L(g=>({groupIndex:g.groupIndex,groupLabel:g.groupLabel})))};function RE(e="curveLinear"){return su().x(t=>t.axisX).y(t=>t.axisY).curve(Dp[e])}function IE(e){let t=[[]],n=0;for(let r in e){if(e[r].visible==!1||e[r].value===void 0||e[r].value===null){t[n].length&&(n++,t[n]=[]);continue}t[n].push(e[r])}return t}function EE({selection:e,pathClassName:t,segmentData:n,linePath:r,params:i}){return e.selectAll("path").data(n,(a,s)=>a.length?`${a[0].id}_${a[a.length-1].id}`:s).join(a=>a.append("path").classed(t,!0).attr("fill","none").attr("pointer-events","visibleStroke").style("vector-effect","non-scaling-stroke").style("cursor","pointer"),a=>a,a=>a.remove()).attr("stroke-width",i.lineWidth).attr("stroke",(a,s)=>a[0]&&a[0].color).attr("d",a=>r(a))}function BE({selection:e,seriesLabel:t,fullChartParams:n}){if(e.interrupt("highlight"),!t){e.transition("highlight").duration(200).style("opacity",1);return}e.each((r,i,o)=>{r===t?X(o[i]).style("opacity",1):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}function NE({defsSelection:e,clipPathData:t,transitionDuration:n,transitionEase:r}){e.selectAll("clipPath").data(t).join(i=>i.append("clipPath"),i=>i,i=>i.remove()).attr("id",i=>i.id).each((i,o,a)=>{X(a[o]).selectAll("rect").data([i]).join(s=>{const l=s.append("rect");return l.transition().duration(n).ease(_r(r)).tween("tween",(u,c,h)=>f=>{const p=u.width*f;l.attr("x",0).attr("y",0).attr("width",d=>p).attr("height",d=>d.height)}),l},s=>s.attr("x",0).attr("y",0).attr("width",l=>l.width).attr("height",l=>l.height),s=>s.remove())})}const yv=(e,{selection:t,computedData$:n,computedAxesData$:r,visibleComputedData$:i,visibleComputedAxesData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullDataFormatter$:c,fullChartParams$:h,gridAxesTransform$:f,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:m,gridContainerPosition$:g,allContainerPosition$:y,layout$:b,event$:x})=>{const $=new Q,S=Oe(e,"clipPath-box"),_=H(e,"path"),{seriesSelection$:A,axesSelection$:w,defsSelection$:P,graphicGSelection$:I}=wr({selection:t,pluginName:e,clipPathID:S,seriesLabels$:a,gridContainerPosition$:g,gridAxesTransform$:f,gridGraphicTransform$:p}),v=new me(k=>{const B=u.pipe(C($)).subscribe(F=>{if(!F)return;const E=RE(F.lineCurve);k.next(E)});return()=>{B.unsubscribe()}}),N=h.pipe(L(k=>k.transitionDuration),q()),R=h.pipe(L(k=>k.transitionEase),q());O({defsSelection:P,seriesLabels:a,axisSize:d,transitionDuration:N,transitionEase:R}).pipe(C($),z(async k=>k)).subscribe(k=>{const F=[{id:S,width:k.axisSize.width,height:k.axisSize.height}].concat(k.seriesLabels.map(E=>({id:`orbcharts__clipPath_${E}`,width:k.axisSize.width,height:k.axisSize.height})));NE({defsSelection:k.defsSelection,clipPathData:F,transitionDuration:k.transitionDuration,transitionEase:k.transitionEase})});const D=n.pipe(L(k=>{const B=new Map;return k.flat().forEach(F=>B.set(F.id,F)),B})),T=mv({fullDataFormatter$:c,gridAxesSize$:d,computedData$:n,fullChartParams$:h,gridContainerPosition$:y,layout$:b}),M=h.pipe(C($),L(k=>k.highlightTarget),q()),G=O({graphicGSelection:I,visibleComputedAxesData:o,linePath:v,params:u}).pipe(C($),z(async k=>k),L(k=>{let B=[];return k.graphicGSelection.each((F,E,W)=>{const j=IE(k.visibleComputedAxesData[E]??[]);B[E]=EE({selection:X(W[E]),pathClassName:_,linePath:k.linePath,segmentData:j,params:k.params})}),B}));return O({pathSelectionArr:G,computedData:n,SeriesDataMap:s,GroupDataMap:l,highlightTarget:M,gridGroupPositionFn:T}).pipe(C($),z(async k=>k)).subscribe(k=>{k.pathSelectionArr.forEach(B=>{B.on("mouseover",(F,E)=>{const W=E[0]?E[0].seriesLabel:"",{groupIndex:j,groupLabel:te}=k.gridGroupPositionFn(F),Y=k.GroupDataMap.get(te).find(J=>J.seriesLabel===W)??E[0];x.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:k.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:k.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,group:k.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:F,data:k.computedData})}).on("mousemove",(F,E)=>{const W=E[0]?E[0].seriesLabel:"",{groupIndex:j,groupLabel:te}=k.gridGroupPositionFn(F),Y=k.GroupDataMap.get(te).find(J=>J.seriesLabel===W)??E[0];x.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:k.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:k.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,group:k.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:F,data:k.computedData})}).on("mouseout",(F,E)=>{const W=E[0]?E[0].seriesLabel:"",{groupIndex:j,groupLabel:te}=k.gridGroupPositionFn(F),Y=k.GroupDataMap.get(te).find(J=>J.seriesLabel===W)??E[0];x.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:k.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:k.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,group:k.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:F,data:k.computedData})}).on("click",(F,E)=>{const W=E[0]?E[0].seriesLabel:"",{groupIndex:j,groupLabel:te}=k.gridGroupPositionFn(F),Y=k.GroupDataMap.get(te).find(J=>J.seriesLabel===W)??E[0];x.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:k.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:k.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,group:k.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:F,data:k.computedData})})})}),h.pipe(C($),Er(k=>k.highlightTarget==="series"),z(k=>O({graphicGSelection:I,gridHighlight:m,DataMap:D,fullChartParams:h}).pipe(C($),z(async B=>B)))).subscribe(k=>{const B=k.gridHighlight[0]?k.gridHighlight[0].seriesLabel:null;BE({selection:k.graphicGSelection,seriesLabel:B,fullChartParams:k.fullChartParams})}),()=>{$.next(void 0)}},Lp=0,Ct=2,Mp=3,bv=4,at=5,yu=6,bu=7,ki=8,Ri=9,xv="Lines",FE=ct({name:xv,defaultParams:Lr,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{lineCurve:{toBeTypes:["string"]},lineWidth:{toBeTypes:["number"]}})})(({selection:e,rootSelection:t,name:n,observer:r,subject:i})=>{const o=new Q,a=yv(xv,{selection:e,computedData$:r.computedData$,computedAxesData$:r.computedAxesData$,visibleComputedData$:r.visibleComputedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullDataFormatter$:r.fullDataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,allContainerPosition$:r.gridContainerPosition$,layout$:r.layout$,event$:i.event$});return()=>{o.next(void 0),a()}});function zE(e="curveLinear",t){return yp().x(n=>n.axisX).y0(n=>t).y1(n=>n.axisY).curve(Dp[e])}function OE(e){let t=[[]],n=0;for(let r in e){if(e[r].visible==!1||e[r].value===void 0||e[r].value===null){t[n].length&&(n++,t[n]=[]);continue}t[n].push(e[r])}return t}function GE({selection:e,pathClassName:t,segmentData:n,areaPath:r,linearGradientIds:i,params:o}){return e.selectAll("path").data(n,(s,l)=>s.length?`${s[0].id}_${s[s.length-1].id}`:l).join(s=>s.append("path").classed(t,!0).attr("fill","none").style("vector-effect","non-scaling-stroke").style("cursor","pointer"),s=>s,s=>s.remove()).attr("fill",(s,l)=>s[0]?`url(#${i[s[0].seriesIndex]})`:"").attr("d",s=>r(s))}function WE({selection:e,seriesLabel:t,fullChartParams:n}){if(e.interrupt("highlight"),!t){e.transition("highlight").duration(200).style("opacity",1);return}e.each((r,i,o)=>{r===t?X(o[i]).style("opacity",1):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}function VE({defsSelection:e,computedData:t,linearGradientIds:n,params:r}){e.selectAll("linearGradient").data(t??[]).join(i=>i.append("linearGradient").attr("x1","0%").attr("x2","0%").attr("y1","100%").attr("y2","0%").attr("spreadMethod","pad"),i=>i,i=>i.remove()).attr("id",(i,o)=>i[0]?n[i[0].seriesIndex]:"").html((i,o)=>{const a=i[0]?i[0].color:"";return`
56
56
  <stop offset="0%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[0]}"/>
57
57
  <stop offset="100%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[1]}"/>
58
- `})}function YE({defsSelection:e,clipPathData:t,transitionDuration:n,transitionEase:r}){e.selectAll("clipPath").data(t).join(i=>i.append("clipPath"),i=>i,i=>i.remove()).attr("id",i=>i.id).each((i,o,a)=>{X(a[o]).selectAll("rect").data([i]).join(s=>{const l=s.append("rect");return l.transition().duration(n).ease(_r(r)).tween("tween",(u,c,h)=>f=>{const p=u.width*f;l.attr("x",0).attr("y",0).attr("width",g=>p).attr("height",g=>g.height)}),l},s=>s.attr("x",0).attr("y",0).attr("width",l=>l.width).attr("height",l=>l.height),s=>s.remove())})}const $v=(e,{selection:t,computedData$:n,computedAxesData$:r,visibleComputedData$:i,visibleComputedAxesData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullDataFormatter$:c,fullChartParams$:h,gridAxesTransform$:f,gridGraphicTransform$:p,gridAxesSize$:g,gridHighlight$:m,gridContainerPosition$:d,layout$:y,event$:b})=>{const x=new Q,$=Oe(e,"clipPath-box"),S=H(e,"path"),{seriesSelection$:_,axesSelection$:A,defsSelection$:w,graphicGSelection$:P}=wr({selection:t,pluginName:e,clipPathID:$,seriesLabels$:a,gridContainerPosition$:d,gridAxesTransform$:f,gridGraphicTransform$:p}),I=p.pipe(C(x),L(B=>-B.translate[1]/B.scale[1])),v=new me(B=>{const F=G({fullParams:u,valueAxisStart:I}).pipe(C(x)).subscribe(E=>{const W=zE(E.fullParams.lineCurve,E.valueAxisStart);B.next(W)});return()=>{F.unsubscribe()}}),N=h.pipe(L(B=>B.transitionDuration),Z()),R=h.pipe(L(B=>B.transitionEase),Z());G({defsSelection:w,seriesLabels:a,axisSize:g,transitionDuration:N,transitionEase:R}).pipe(C(x),z(async B=>B)).subscribe(B=>{const E=[{id:$,width:B.axisSize.width,height:B.axisSize.height}].concat(B.seriesLabels.map(W=>({id:`orbcharts__clipPath_${W}`,width:B.axisSize.width,height:B.axisSize.height})));YE({defsSelection:B.defsSelection,clipPathData:E,transitionDuration:B.transitionDuration,transitionEase:B.transitionEase})});const D=n.pipe(L(B=>{const F=new Map;return B.flat().forEach(E=>F.set(E.id,E)),F})),T=mv({fullDataFormatter$:c,gridAxesSize$:g,computedData$:n,fullChartParams$:h,gridContainerPosition$:d,layout$:y}),M=h.pipe(C(x),L(B=>B.highlightTarget),Z()),O=a.pipe(C(x),L(B=>B.map((F,E)=>Oe(e,`lineargradient-${F}`)))),k=G({graphicGSelection:P,defsSelection:w,visibleComputedAxesData:o,linearGradientIds:O,areaPath:v,params:u}).pipe(C(x),z(async B=>B),L(B=>{let F=[];return B.graphicGSelection.each((E,W,j)=>{const te=OE(B.visibleComputedAxesData[W]??[]);F[W]=GE({selection:X(j[W]),pathClassName:S,areaPath:B.areaPath,segmentData:te,linearGradientIds:B.linearGradientIds,params:B.params}),VE({defsSelection:B.defsSelection,computedData:B.visibleComputedAxesData,linearGradientIds:B.linearGradientIds,params:B.params})}),F}));return G({pathSelectionArr:k,computedData:n,SeriesDataMap:s,GroupDataMap:l,highlightTarget:M,gridGroupPositionFn:T}).pipe(C(x),z(async B=>B)).subscribe(B=>{B.pathSelectionArr.forEach(F=>{F.on("mouseover",(E,W)=>{const j=W[0]?W[0].seriesLabel:"",{groupIndex:te,groupLabel:V}=B.gridGroupPositionFn(E),J=B.GroupDataMap.get(V).find(K=>K.seriesLabel===j)??W[0];b.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:B.highlightTarget,datum:J,gridIndex:J.gridIndex,series:B.SeriesDataMap.get(J.seriesLabel),seriesIndex:J.seriesIndex,seriesLabel:J.seriesLabel,group:B.GroupDataMap.get(J.groupLabel),groupIndex:J.groupIndex,groupLabel:J.groupLabel,event:E,data:B.computedData})}).on("mousemove",(E,W)=>{const j=W[0]?W[0].seriesLabel:"",{groupIndex:te,groupLabel:V}=B.gridGroupPositionFn(E),J=B.GroupDataMap.get(V).find(K=>K.seriesLabel===j)??W[0];b.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:B.highlightTarget,datum:J,gridIndex:J.gridIndex,series:B.SeriesDataMap.get(J.seriesLabel),seriesIndex:J.seriesIndex,seriesLabel:J.seriesLabel,group:B.GroupDataMap.get(J.groupLabel),groupIndex:J.groupIndex,groupLabel:J.groupLabel,event:E,data:B.computedData})}).on("mouseout",(E,W)=>{const j=W[0]?W[0].seriesLabel:"",{groupIndex:te,groupLabel:V}=B.gridGroupPositionFn(E),J=B.GroupDataMap.get(V).find(K=>K.seriesLabel===j)??W[0];b.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:B.highlightTarget,datum:J,gridIndex:J.gridIndex,series:B.SeriesDataMap.get(J.seriesLabel),seriesIndex:J.seriesIndex,seriesLabel:J.seriesLabel,group:B.GroupDataMap.get(J.groupLabel),groupIndex:J.groupIndex,groupLabel:J.groupLabel,event:E,data:B.computedData})}).on("click",(E,W)=>{const j=W[0]?W[0].seriesLabel:"",{groupIndex:te,groupLabel:V}=B.gridGroupPositionFn(E),J=B.GroupDataMap.get(V).find(K=>K.seriesLabel===j)??W[0];b.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:B.highlightTarget,datum:J,gridIndex:J.gridIndex,series:B.SeriesDataMap.get(J.seriesLabel),seriesIndex:J.seriesIndex,seriesLabel:J.seriesLabel,group:B.GroupDataMap.get(J.groupLabel),groupIndex:J.groupIndex,groupLabel:J.groupLabel,event:E,data:B.computedData})})})}),h.pipe(C(x),Er(B=>B.highlightTarget==="series"),z(B=>G({graphicGSelection:P,gridHighlight:m,DataMap:D,fullChartParams:h}).pipe(C(x),z(async F=>F)))).subscribe(B=>{const F=B.gridHighlight[0]?B.gridHighlight[0].seriesLabel:null;WE({selection:B.graphicGSelection,seriesLabel:F,fullChartParams:B.fullChartParams})}),()=>{x.next(void 0)}},vv="LineAreas",XE=ct({name:vv,defaultParams:Tg,layerIndex:bv,validator:(e,{validateColumns:t})=>t(e,{lineCurve:{toBeTypes:["string"]},linearGradientOpacity:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}})})(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=$v(vv,{selection:e,computedData$:n.computedData$,visibleComputedData$:n.visibleComputedData$,computedAxesData$:n.computedAxesData$,visibleComputedAxesData$:n.visibleComputedAxesData$,seriesLabels$:n.seriesLabels$,SeriesDataMap$:n.SeriesDataMap$,GroupDataMap$:n.GroupDataMap$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridGraphicTransform$:n.gridGraphicTransform$,gridAxesSize$:n.gridAxesSize$,gridHighlight$:n.gridHighlight$,gridContainerPosition$:n.gridContainerPosition$,allContainerPosition$:n.gridContainerPosition$,layout$:n.layout$,event$:r.event$});return()=>{i.next(void 0),o()}}),Sv=.3;function Tv({axisWidth:e,groupAmount:t,barAmountOfGroup:n,barPadding:r=0,barGroupPadding:i=0}){const a=((t>1?e/(t-1):e)-i)/n-r;return a>1?a:1}function UE(e,t,n){const r=e/2,i=e*t.length+n.barPadding*t.length;return Kh().domain(t).range([-i/2+r,i/2-r])}function jE(e,t){return e<=1?0:t/(e-1)*Sv}function HE(e,t){return e<=1?t:t*(1-Sv)}function qE({graphicGSelection:e,rectClassName:t,visibleComputedAxesData:n,zeroYArr:r,groupLabels:i,barScale:o,params:a,chartParams:s,barWidth:l,transformedBarRadius:u,delayGroup:c,transitionItem:h,isSeriesSeprate:f}){const p=l/2;return e.each((m,d,y)=>{X(y[d]).selectAll(`rect.${t}`).data(n[d]??[],b=>b.id).join(b=>b.append("rect").classed(t,!0).attr("cursor","pointer").attr("height",x=>1),b=>b,b=>b.remove()).attr("transform",(b,x)=>`translate(${(b?b.axisX:0)-p}, 0)`).attr("fill",b=>b.color).attr("y",b=>b.axisY<r[d]?b.axisY:r[d]).attr("x",b=>f?0:o(b.seriesLabel)).attr("width",l).attr("rx",u[d][0]??1).attr("ry",u[d][1]??1).transition().duration(h).ease(_r(s.transitionEase)).delay((b,x)=>b.groupIndex*c).attr("height",b=>Math.abs(b.axisYFromZero)||1)}),e.selectAll(`rect.${t}`)}function ZE({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function KE({selection:e,ids:t,fullChartParams:n}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").duration(200).style("opacity",1);return}e.each((r,i,o)=>{t.includes(r.id)?X(o[i]).style("opacity",1):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const kp=(e,{selection:t,computedData$:n,computedAxesData$:r,visibleComputedData$:i,visibleComputedAxesData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullChartParams$:c,gridAxesTransform$:h,gridGraphicTransform$:f,gridGraphicReverseScale$:p,gridAxesSize$:g,gridHighlight$:m,gridContainerPosition$:d,isSeriesSeprate$:y,event$:b})=>{const x=new Q,$=Oe(e,"clipPath-box"),S=H(e,"rect"),{seriesSelection$:_,axesSelection$:A,defsSelection$:w,graphicGSelection$:P}=wr({selection:t,pluginName:e,clipPathID:$,seriesLabels$:a,gridContainerPosition$:d,gridAxesTransform$:h,gridGraphicTransform$:f}),I=o.pipe(C(x),L(F=>F.map(E=>E[0]?E[0].axisY-E[0].axisYFromZero:0)),Z()),v=G({computedData:n,visibleComputedData:i,params:u,gridAxesSize:g,isSeriesSeprate:y}).pipe(C(x),z(async F=>F),L(F=>F.params.barWidth?F.params.barWidth:F.isSeriesSeprate?Tv({axisWidth:F.gridAxesSize.width,groupAmount:F.computedData[0]?F.computedData[0].length:0,barAmountOfGroup:1,barPadding:F.params.barPadding,barGroupPadding:F.params.barGroupPadding}):Tv({axisWidth:F.gridAxesSize.width,groupAmount:F.computedData[0]?F.computedData[0].length:0,barAmountOfGroup:F.visibleComputedData.length,barPadding:F.params.barPadding,barGroupPadding:F.params.barGroupPadding})),Z()),N=G({computedData:n,barWidth:v,params:u,gridGraphicReverseScale:p}).pipe(C(x),z(async F=>F),L(F=>{const E=F.barWidth/2,W=F.params.barRadius===!0?E:F.params.barRadius===!1?0:typeof F.params.barRadius=="number"?F.params.barRadius:0;return F.computedData.map((j,te)=>{const V=F.gridGraphicReverseScale[te]??F.gridGraphicReverseScale[0];let ee=W*V[0],Y=W*V[1];if(ee>E){const J=E/ee;ee=ee*J,Y=Y*J}return[ee,Y]})})),R=i.pipe(C(x),L(F=>{const E=new Set;return F.forEach(W=>{W.forEach(j=>{E.add(j.groupLabel)})}),Array.from(E)})),D=G({seriesLabels:a,barWidth:v,params:u}).pipe(C(x),z(async F=>F),L(F=>UE(F.barWidth,F.seriesLabels,F.params))),T=c.pipe(C(x),L(F=>F.transitionDuration),Z()),M=new me(F=>{G({groupLabels:R,transitionDuration:T}).pipe(z(async E=>E)).subscribe(E=>{const W=jE(E.groupLabels.length,E.transitionDuration);F.next(W)})}).pipe(C(x),Z()),O=new me(F=>{G({groupLabels:R,transitionDuration:T}).pipe(z(async E=>E)).subscribe(E=>{const W=HE(E.groupLabels.length,E.transitionDuration);F.next(W)})}).pipe(C(x),Z());G({defsSelection:w,gridAxesSize:g}).pipe(C(x),z(async F=>F)).subscribe(F=>{const E=[{id:$,width:F.gridAxesSize.width,height:F.gridAxesSize.height}];ZE({defsSelection:F.defsSelection,clipPathData:E})});const k=c.pipe(C(x),L(F=>F.highlightTarget),Z()),B=G({graphicGSelection:P,visibleComputedAxesData:o,zeroYArr:I,groupLabels:R,barScale:D,params:u,chartParams:c,highlightTarget:k,barWidth:v,transformedBarRadius:N,delayGroup:M,transitionItem:O,isSeriesSeprate:y}).pipe(C(x),z(async F=>F),L(F=>qE({graphicGSelection:F.graphicGSelection,rectClassName:S,visibleComputedAxesData:F.visibleComputedAxesData,zeroYArr:F.zeroYArr,groupLabels:F.groupLabels,barScale:F.barScale,params:F.params,chartParams:F.chartParams,barWidth:F.barWidth,transformedBarRadius:F.transformedBarRadius,delayGroup:F.delayGroup,transitionItem:F.transitionItem,isSeriesSeprate:F.isSeriesSeprate})));return G({barSelection:B,computedData:n,highlightTarget:k,SeriesDataMap:s,GroupDataMap:l}).pipe(C(x),z(async F=>F)).subscribe(F=>{F.barSelection.on("mouseover",(E,W)=>{E.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:F.highlightTarget,datum:W,gridIndex:W.gridIndex,series:F.SeriesDataMap.get(W.seriesLabel),seriesIndex:W.seriesIndex,seriesLabel:W.seriesLabel,group:F.GroupDataMap.get(W.groupLabel),groupIndex:W.groupIndex,groupLabel:W.groupLabel,event:E,data:F.computedData})}).on("mousemove",(E,W)=>{E.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:F.highlightTarget,datum:W,gridIndex:W.gridIndex,series:F.SeriesDataMap.get(W.seriesLabel),seriesIndex:W.seriesIndex,seriesLabel:W.seriesLabel,group:F.GroupDataMap.get(W.groupLabel),groupIndex:W.groupIndex,groupLabel:W.groupLabel,event:E,data:F.computedData})}).on("mouseout",(E,W)=>{E.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:F.highlightTarget,datum:W,gridIndex:W.gridIndex,series:F.SeriesDataMap.get(W.seriesLabel),seriesIndex:W.seriesIndex,seriesLabel:W.seriesLabel,group:F.GroupDataMap.get(W.groupLabel),groupIndex:W.groupIndex,groupLabel:W.groupLabel,event:E,data:F.computedData})}).on("click",(E,W)=>{E.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:F.highlightTarget,datum:W,gridIndex:W.gridIndex,series:F.SeriesDataMap.get(W.seriesLabel),seriesIndex:W.seriesIndex,seriesLabel:W.seriesLabel,group:F.GroupDataMap.get(W.groupLabel),groupIndex:W.groupIndex,groupLabel:W.groupLabel,event:E,data:F.computedData})})}),G({barSelection:B,highlight:m.pipe(L(F=>F.map(E=>E.id))),fullChartParams:c}).pipe(C(x),z(async F=>F)).subscribe(F=>{KE({selection:F.barSelection,ids:F.highlight,fullChartParams:F.fullChartParams})}),()=>{x.next(void 0)}},_v="Bars",QE=ct({name:_v,defaultParams:Sa,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=kp(_v,{selection:e,computedData$:r.computedData$,computedAxesData$:r.computedAxesData$,visibleComputedData$:r.visibleComputedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,event$:n.event$});return()=>{i.next(void 0),o()}}),Av="BarsPN",JE=ct({name:Av,defaultParams:Sa,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=kp(Av,{selection:e,computedData$:r.computedData$,computedAxesData$:r.computedAxesData$,visibleComputedData$:r.visibleComputedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:Ct(!0),event$:n.event$});return()=>{i.next(void 0),o()}}),wv=.3;function eB({axisWidth:e,groupAmount:t,barGroupPadding:n=0}){const i=(t>1?e/(t-1):e)-n;return i>1?i:1}function tB(e,t){return e<=1?0:t/(e-1)*wv}function nB(e,t){return e<=1?t:t*(1-wv)}function rB({graphicGSelection:e,rectClassName:t,barData:n,zeroY:r,groupLabels:i,params:o,chartParams:a,barWidth:s,transformedBarRadius:l,delayGroup:u,transitionItem:c,isSeriesSeprate:h}){const f=s/2;return e.each((g,m,d)=>{X(d[m]).selectAll(`rect.${t}`).data(n[m]??[],y=>y.id).join(y=>y.append("rect").classed(t,!0).attr("cursor","pointer").attr("height",b=>1),y=>y,y=>y.remove()).attr("transform",(y,b)=>`translate(${(y?y.axisX:0)-f}, 0)`).attr("fill",y=>y.color).attr("y",y=>r).attr("x",y=>0).attr("width",s).attr("rx",l[m][0]??1).attr("ry",l[m][1]??1).transition().duration(c).ease(_r(a.transitionEase)).delay((y,b)=>y.groupIndex*u).attr("y",y=>y._barStartY).attr("height",y=>Math.abs(y._barHeight)||1)}),e.selectAll(`rect.${t}`)}function iB({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function oB({selection:e,ids:t,fullChartParams:n}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").duration(200).style("opacity",1);return}e.each((r,i,o)=>{t.includes(r.id)?X(o[i]).style("opacity",1):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const Pv=(e,{selection:t,computedData$:n,computedAxesData$:r,visibleComputedData$:i,visibleComputedAxesData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullDataFormatter$:c,fullChartParams$:h,gridAxesTransform$:f,gridGraphicTransform$:p,gridGraphicReverseScale$:g,gridAxesSize$:m,gridHighlight$:d,gridContainerPosition$:y,isSeriesSeprate$:b,event$:x})=>{const $=new Q,S=Oe(e,"clipPath-box"),_=H(e,"rect"),{seriesSelection$:A,axesSelection$:w,defsSelection$:P,graphicGSelection$:I}=wr({selection:t,pluginName:e,clipPathID:S,seriesLabels$:a,gridContainerPosition$:y,gridAxesTransform$:f,gridGraphicTransform$:p}),v=o.pipe(C($),L(V=>V[0]&&V[0][0]?V[0][0].axisY-V[0][0].axisYFromZero:0),Z()),N=G({computedData:n,params:u,axisSize:m,isSeriesSeprate:b}).pipe(C($),z(async V=>V),L(V=>V.params.barWidth?V.params.barWidth:eB({axisWidth:V.axisSize.width,groupAmount:V.computedData[0]?V.computedData[0].length:0,barGroupPadding:V.params.barGroupPadding})),Z()),R=G({computedData:n,barWidth:N,params:u,gridGraphicReverseScale:g}).pipe(C($),z(async V=>V),L(V=>{const ee=V.barWidth/2,Y=V.params.barRadius===!0?ee:V.params.barRadius===!1?0:typeof V.params.barRadius=="number"?V.params.barRadius:0;return V.computedData.map((J,K)=>{const re=V.gridGraphicReverseScale[K]??V.gridGraphicReverseScale[0],le=Y*re[0],q=Y*re[1];return[le,q]})})),D=i.pipe(C($),L(V=>{const ee=new Set;return V.forEach(Y=>{Y.forEach(J=>{ee.add(J.groupLabel)})}),Array.from(ee)}),ie(1)),T=h.pipe(C($),L(V=>V.transitionDuration),Z()),M=new me(V=>{G({groupLabels:D,transitionDuration:T}).pipe(z(async ee=>ee)).subscribe(ee=>{const Y=tB(ee.groupLabels.length,ee.transitionDuration);V.next(Y)})}).pipe(C($),Z()),O=new me(V=>{G({groupLabels:D,transitionDuration:T}).pipe(z(async ee=>ee)).subscribe(ee=>{const Y=nB(ee.groupLabels.length,ee.transitionDuration);V.next(Y)})}).pipe(C($),Z()),k=G({computedData:n,dataFormatter:c}).pipe(C($),z(async V=>V),L(V=>{const ee=V.computedData[0]?V.computedData[0].length-1:0,Y=V.dataFormatter.groupAxis.scaleDomain[0],J=V.dataFormatter.groupAxis.scaleDomain[1]==="max"?ee:V.dataFormatter.groupAxis.scaleDomain[1];return[Y,J]})),B=G({visibleComputedAxesData:o,groupScaleDomain:k}).pipe(C($),z(async V=>V),L(V=>{const ee=V.groupScaleDomain[0],Y=V.groupScaleDomain[1],K=V.visibleComputedAxesData.map(ye=>ye.filter((he,Re)=>he.groupIndex>=ee&&he.groupIndex<=Y)).flat();if(K.length<=1)return 1;const re=K.reduce((ye,he)=>he.value>ye.value?he:ye,K[0]),le=re.groupIndex,q=K.filter(ye=>ye.groupIndex===le).reduce((ye,he)=>ye+he.value,0);return re.value/q})),F=G({computedAxesData:r,yRatio:B,zeroY:v}).pipe(C($),L(V=>{let ee=V.computedAxesData[0]?V.computedAxesData[0].map(()=>V.zeroY):[];return V.computedAxesData.map((Y,J)=>Y.map((K,re)=>{const le=ee[re];let q=0;return K.visible&&(q=K.axisYFromZero*V.yRatio,ee[re]=ee[re]+q),{...K,_barStartY:le,_barHeight:q}}))})),E=G({computedAxesData:r,zeroY:v}).pipe(C($),L(V=>V.computedAxesData.map((ee,Y)=>ee.map((J,K)=>({...J,_barStartY:V.zeroY,_barHeight:J.axisYFromZero}))))),W=b.pipe(z(V=>wn(()=>V,E,F)));G({defsSelection:P,gridAxesSize:m}).pipe(C($),z(async V=>V)).subscribe(V=>{const ee=[{id:S,width:V.gridAxesSize.width,height:V.gridAxesSize.height}];iB({defsSelection:V.defsSelection,clipPathData:ee})});const j=h.pipe(C($),L(V=>V.highlightTarget),Z()),te=G({graphicGSelection:I,graphicData:W,zeroY:v,groupLabels:D,params:u,chartParams:h,highlightTarget:j,barWidth:N,transformedBarRadius:R,delayGroup:M,transitionItem:O,isSeriesSeprate:b}).pipe(C($),z(async V=>V),L(V=>rB({graphicGSelection:V.graphicGSelection,rectClassName:_,barData:V.graphicData,zeroY:V.zeroY,groupLabels:V.groupLabels,params:V.params,chartParams:V.chartParams,barWidth:V.barWidth,transformedBarRadius:V.transformedBarRadius,delayGroup:V.delayGroup,transitionItem:V.transitionItem,isSeriesSeprate:V.isSeriesSeprate})));return G({barSelection:te,computedData:n,highlightTarget:j,SeriesDataMap:s,GroupDataMap:l}).subscribe(V=>{V.barSelection.on("mouseover",(ee,Y)=>{ee.stopPropagation(),x.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:V.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:V.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,group:V.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:ee,data:V.computedData})}).on("mousemove",(ee,Y)=>{ee.stopPropagation(),x.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:V.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:V.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,group:V.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:ee,data:V.computedData})}).on("mouseout",(ee,Y)=>{ee.stopPropagation(),x.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:V.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:V.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,group:V.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:ee,data:V.computedData})}).on("click",(ee,Y)=>{ee.stopPropagation(),x.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:V.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:V.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,group:V.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:ee,data:V.computedData})})}),G({barSelection:te,highlight:d.pipe(L(V=>V.map(ee=>ee.id))),fullChartParams:h}).pipe(C($),z(async V=>V)).subscribe(V=>{oB({selection:V.barSelection,ids:V.highlight,fullChartParams:V.fullChartParams})}),()=>{$.next(void 0)}},Dv="StackedBars",aB=ct({name:Dv,defaultParams:Ag,layerIndex:5,validator:(e,{validateColumns:t})=>t(e,{barWidth:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=Pv(Dv,{selection:e,computedData$:r.computedData$,computedAxesData$:r.computedAxesData$,visibleComputedData$:r.visibleComputedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullDataFormatter$:r.fullDataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,event$:n.event$});return()=>{i.next(void 0),o()}}),Cv=.3;function Lv({axisWidth:e,groupAmount:t,barAmountOfGroup:n,barPadding:r=0,barGroupPadding:i=0}){const a=((t>1?e/(t-1):e)-i)/n-r;return a>1?a:1}function sB(e,t,n){const r=e/2,i=e*t.length+n.barPadding*t.length;return Kh().domain(t).range([-i/2+r,i/2-r])}function lB(e,t){return e<=1?0:t/(e-1)*Cv}function uB(e,t){return e<=1?t:t*(1-Cv)}function cB({graphicGSelection:e,pathGClassName:t,pathClassName:n,visibleComputedAxesData:r,linearGradientIds:i,zeroYArr:o,groupLabels:a,barScale:s,params:l,chartParams:u,barWidth:c,delayGroup:h,transitionItem:f,isSeriesSeprate:p}){const g=c/2;return e.each((d,y,b)=>{X(b[y]).selectAll(`g.${t}`).data(r[y]??[]).join($=>{const S=$.append("g").classed(t,!0).attr("cursor","pointer");return S.append("path").classed(n,!0).style("vector-effect","non-scaling-stroke").attr("d",_=>{const A=-g,w=o[y],P=o[y];return`M${A},${w} L${A+c/2},${P} ${A+c},${w}`}),S},$=>$,$=>$.remove()).attr("transform",$=>`translate(${p?0:s($.seriesLabel)}, 0)`).select(`path.${n}`).attr("height",$=>Math.abs($.axisYFromZero)||1).attr("y",$=>$.axisY<o[y]?$.axisY:o[y]).attr("x",$=>p?0:s($.seriesLabel)).style("fill",$=>`url(#${i[$.seriesIndex]})`).attr("stroke",$=>$.color).attr("transform",$=>`translate(${$?$.axisX:0}, 0)`).transition().duration(f).ease(_r(u.transitionEase)).delay(($,S)=>$.groupIndex*h).attr("d",$=>{const S=-g,_=o[y],A=$.axisY;return`M${S},${_} L${S+c/2},${A} ${S+c},${_}`})}),e.selectAll(`path.${n}`)}function fB({defsSelection:e,computedData:t,linearGradientIds:n,params:r}){e.selectAll("linearGradient").data(t??[]).join(i=>i.append("linearGradient").attr("x1","0%").attr("x2","0%").attr("y1","100%").attr("y2","0%").attr("spreadMethod","pad"),i=>i,i=>i.remove()).attr("id",(i,o)=>i[0]?n[i[0].seriesIndex]:"").html((i,o)=>{const a=i[0]?i[0].color:"";return`
58
+ `})}function YE({defsSelection:e,clipPathData:t,transitionDuration:n,transitionEase:r}){e.selectAll("clipPath").data(t).join(i=>i.append("clipPath"),i=>i,i=>i.remove()).attr("id",i=>i.id).each((i,o,a)=>{X(a[o]).selectAll("rect").data([i]).join(s=>{const l=s.append("rect");return l.transition().duration(n).ease(_r(r)).tween("tween",(u,c,h)=>f=>{const p=u.width*f;l.attr("x",0).attr("y",0).attr("width",d=>p).attr("height",d=>d.height)}),l},s=>s.attr("x",0).attr("y",0).attr("width",l=>l.width).attr("height",l=>l.height),s=>s.remove())})}const $v=(e,{selection:t,computedData$:n,computedAxesData$:r,visibleComputedData$:i,visibleComputedAxesData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullDataFormatter$:c,fullChartParams$:h,gridAxesTransform$:f,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:m,gridContainerPosition$:g,layout$:y,event$:b})=>{const x=new Q,$=Oe(e,"clipPath-box"),S=H(e,"path"),{seriesSelection$:_,axesSelection$:A,defsSelection$:w,graphicGSelection$:P}=wr({selection:t,pluginName:e,clipPathID:$,seriesLabels$:a,gridContainerPosition$:g,gridAxesTransform$:f,gridGraphicTransform$:p}),I=p.pipe(C(x),L(B=>-B.translate[1]/B.scale[1])),v=new me(B=>{const F=O({fullParams:u,valueAxisStart:I}).pipe(C(x)).subscribe(E=>{const W=zE(E.fullParams.lineCurve,E.valueAxisStart);B.next(W)});return()=>{F.unsubscribe()}}),N=h.pipe(L(B=>B.transitionDuration),q()),R=h.pipe(L(B=>B.transitionEase),q());O({defsSelection:w,seriesLabels:a,axisSize:d,transitionDuration:N,transitionEase:R}).pipe(C(x),z(async B=>B)).subscribe(B=>{const E=[{id:$,width:B.axisSize.width,height:B.axisSize.height}].concat(B.seriesLabels.map(W=>({id:`orbcharts__clipPath_${W}`,width:B.axisSize.width,height:B.axisSize.height})));YE({defsSelection:B.defsSelection,clipPathData:E,transitionDuration:B.transitionDuration,transitionEase:B.transitionEase})});const D=n.pipe(L(B=>{const F=new Map;return B.flat().forEach(E=>F.set(E.id,E)),F})),T=mv({fullDataFormatter$:c,gridAxesSize$:d,computedData$:n,fullChartParams$:h,gridContainerPosition$:g,layout$:y}),M=h.pipe(C(x),L(B=>B.highlightTarget),q()),G=a.pipe(C(x),L(B=>B.map((F,E)=>Oe(e,`lineargradient-${F}`)))),k=O({graphicGSelection:P,defsSelection:w,visibleComputedAxesData:o,linearGradientIds:G,areaPath:v,params:u}).pipe(C(x),z(async B=>B),L(B=>{let F=[];return B.graphicGSelection.each((E,W,j)=>{const te=OE(B.visibleComputedAxesData[W]??[]);F[W]=GE({selection:X(j[W]),pathClassName:S,areaPath:B.areaPath,segmentData:te,linearGradientIds:B.linearGradientIds,params:B.params}),VE({defsSelection:B.defsSelection,computedData:B.visibleComputedAxesData,linearGradientIds:B.linearGradientIds,params:B.params})}),F}));return O({pathSelectionArr:k,computedData:n,SeriesDataMap:s,GroupDataMap:l,highlightTarget:M,gridGroupPositionFn:T}).pipe(C(x),z(async B=>B)).subscribe(B=>{B.pathSelectionArr.forEach(F=>{F.on("mouseover",(E,W)=>{const j=W[0]?W[0].seriesLabel:"",{groupIndex:te,groupLabel:V}=B.gridGroupPositionFn(E),J=B.GroupDataMap.get(V).find(K=>K.seriesLabel===j)??W[0];b.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:B.highlightTarget,datum:J,gridIndex:J.gridIndex,series:B.SeriesDataMap.get(J.seriesLabel),seriesIndex:J.seriesIndex,seriesLabel:J.seriesLabel,group:B.GroupDataMap.get(J.groupLabel),groupIndex:J.groupIndex,groupLabel:J.groupLabel,event:E,data:B.computedData})}).on("mousemove",(E,W)=>{const j=W[0]?W[0].seriesLabel:"",{groupIndex:te,groupLabel:V}=B.gridGroupPositionFn(E),J=B.GroupDataMap.get(V).find(K=>K.seriesLabel===j)??W[0];b.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:B.highlightTarget,datum:J,gridIndex:J.gridIndex,series:B.SeriesDataMap.get(J.seriesLabel),seriesIndex:J.seriesIndex,seriesLabel:J.seriesLabel,group:B.GroupDataMap.get(J.groupLabel),groupIndex:J.groupIndex,groupLabel:J.groupLabel,event:E,data:B.computedData})}).on("mouseout",(E,W)=>{const j=W[0]?W[0].seriesLabel:"",{groupIndex:te,groupLabel:V}=B.gridGroupPositionFn(E),J=B.GroupDataMap.get(V).find(K=>K.seriesLabel===j)??W[0];b.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:B.highlightTarget,datum:J,gridIndex:J.gridIndex,series:B.SeriesDataMap.get(J.seriesLabel),seriesIndex:J.seriesIndex,seriesLabel:J.seriesLabel,group:B.GroupDataMap.get(J.groupLabel),groupIndex:J.groupIndex,groupLabel:J.groupLabel,event:E,data:B.computedData})}).on("click",(E,W)=>{const j=W[0]?W[0].seriesLabel:"",{groupIndex:te,groupLabel:V}=B.gridGroupPositionFn(E),J=B.GroupDataMap.get(V).find(K=>K.seriesLabel===j)??W[0];b.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:B.highlightTarget,datum:J,gridIndex:J.gridIndex,series:B.SeriesDataMap.get(J.seriesLabel),seriesIndex:J.seriesIndex,seriesLabel:J.seriesLabel,group:B.GroupDataMap.get(J.groupLabel),groupIndex:J.groupIndex,groupLabel:J.groupLabel,event:E,data:B.computedData})})})}),h.pipe(C(x),Er(B=>B.highlightTarget==="series"),z(B=>O({graphicGSelection:P,gridHighlight:m,DataMap:D,fullChartParams:h}).pipe(C(x),z(async F=>F)))).subscribe(B=>{const F=B.gridHighlight[0]?B.gridHighlight[0].seriesLabel:null;WE({selection:B.graphicGSelection,seriesLabel:F,fullChartParams:B.fullChartParams})}),()=>{x.next(void 0)}},vv="LineAreas",XE=ct({name:vv,defaultParams:Tg,layerIndex:bv,validator:(e,{validateColumns:t})=>t(e,{lineCurve:{toBeTypes:["string"]},linearGradientOpacity:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}})})(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=$v(vv,{selection:e,computedData$:n.computedData$,visibleComputedData$:n.visibleComputedData$,computedAxesData$:n.computedAxesData$,visibleComputedAxesData$:n.visibleComputedAxesData$,seriesLabels$:n.seriesLabels$,SeriesDataMap$:n.SeriesDataMap$,GroupDataMap$:n.GroupDataMap$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridGraphicTransform$:n.gridGraphicTransform$,gridAxesSize$:n.gridAxesSize$,gridHighlight$:n.gridHighlight$,gridContainerPosition$:n.gridContainerPosition$,allContainerPosition$:n.gridContainerPosition$,layout$:n.layout$,event$:r.event$});return()=>{i.next(void 0),o()}}),Sv=.3;function Tv({axisWidth:e,groupAmount:t,barAmountOfGroup:n,barPadding:r=0,barGroupPadding:i=0}){const a=((t>1?e/(t-1):e)-i)/n-r;return a>1?a:1}function UE(e,t,n){const r=e/2,i=e*t.length+n.barPadding*t.length;return Kh().domain(t).range([-i/2+r,i/2-r])}function jE(e,t){return e<=1?0:t/(e-1)*Sv}function HE(e,t){return e<=1?t:t*(1-Sv)}function qE({graphicGSelection:e,rectClassName:t,visibleComputedAxesData:n,zeroYArr:r,groupLabels:i,barScale:o,params:a,chartParams:s,barWidth:l,transformedBarRadius:u,delayGroup:c,transitionItem:h,isSeriesSeprate:f}){const p=l/2;return e.each((m,g,y)=>{X(y[g]).selectAll(`rect.${t}`).data(n[g]??[],b=>b.id).join(b=>b.append("rect").classed(t,!0).attr("cursor","pointer").attr("height",x=>1),b=>b,b=>b.remove()).attr("transform",(b,x)=>`translate(${(b?b.axisX:0)-p}, 0)`).attr("fill",b=>b.color).attr("y",b=>b.axisY<r[g]?b.axisY:r[g]).attr("x",b=>f?0:o(b.seriesLabel)).attr("width",l).attr("rx",u[g][0]??1).attr("ry",u[g][1]??1).transition().duration(h).ease(_r(s.transitionEase)).delay((b,x)=>b.groupIndex*c).attr("height",b=>Math.abs(b.axisYFromZero)||1)}),e.selectAll(`rect.${t}`)}function ZE({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function KE({selection:e,ids:t,fullChartParams:n}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").duration(200).style("opacity",1);return}e.each((r,i,o)=>{t.includes(r.id)?X(o[i]).style("opacity",1):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const kp=(e,{selection:t,computedData$:n,computedAxesData$:r,visibleComputedData$:i,visibleComputedAxesData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullChartParams$:c,gridAxesTransform$:h,gridGraphicTransform$:f,gridGraphicReverseScale$:p,gridAxesSize$:d,gridHighlight$:m,gridContainerPosition$:g,isSeriesSeprate$:y,event$:b})=>{const x=new Q,$=Oe(e,"clipPath-box"),S=H(e,"rect"),{seriesSelection$:_,axesSelection$:A,defsSelection$:w,graphicGSelection$:P}=wr({selection:t,pluginName:e,clipPathID:$,seriesLabels$:a,gridContainerPosition$:g,gridAxesTransform$:h,gridGraphicTransform$:f}),I=o.pipe(C(x),L(F=>F.map(E=>E[0]?E[0].axisY-E[0].axisYFromZero:0)),q()),v=O({computedData:n,visibleComputedData:i,params:u,gridAxesSize:d,isSeriesSeprate:y}).pipe(C(x),z(async F=>F),L(F=>F.params.barWidth?F.params.barWidth:F.isSeriesSeprate?Tv({axisWidth:F.gridAxesSize.width,groupAmount:F.computedData[0]?F.computedData[0].length:0,barAmountOfGroup:1,barPadding:F.params.barPadding,barGroupPadding:F.params.barGroupPadding}):Tv({axisWidth:F.gridAxesSize.width,groupAmount:F.computedData[0]?F.computedData[0].length:0,barAmountOfGroup:F.visibleComputedData.length,barPadding:F.params.barPadding,barGroupPadding:F.params.barGroupPadding})),q()),N=O({computedData:n,barWidth:v,params:u,gridGraphicReverseScale:p}).pipe(C(x),z(async F=>F),L(F=>{const E=F.barWidth/2,W=F.params.barRadius===!0?E:F.params.barRadius===!1?0:typeof F.params.barRadius=="number"?F.params.barRadius:0;return F.computedData.map((j,te)=>{const V=F.gridGraphicReverseScale[te]??F.gridGraphicReverseScale[0];let ee=W*V[0],Y=W*V[1];if(ee>E){const J=E/ee;ee=ee*J,Y=Y*J}return[ee,Y]})})),R=i.pipe(C(x),L(F=>{const E=new Set;return F.forEach(W=>{W.forEach(j=>{E.add(j.groupLabel)})}),Array.from(E)})),D=O({seriesLabels:a,barWidth:v,params:u}).pipe(C(x),z(async F=>F),L(F=>UE(F.barWidth,F.seriesLabels,F.params))),T=c.pipe(C(x),L(F=>F.transitionDuration),q()),M=new me(F=>{O({groupLabels:R,transitionDuration:T}).pipe(z(async E=>E)).subscribe(E=>{const W=jE(E.groupLabels.length,E.transitionDuration);F.next(W)})}).pipe(C(x),q()),G=new me(F=>{O({groupLabels:R,transitionDuration:T}).pipe(z(async E=>E)).subscribe(E=>{const W=HE(E.groupLabels.length,E.transitionDuration);F.next(W)})}).pipe(C(x),q());O({defsSelection:w,gridAxesSize:d}).pipe(C(x),z(async F=>F)).subscribe(F=>{const E=[{id:$,width:F.gridAxesSize.width,height:F.gridAxesSize.height}];ZE({defsSelection:F.defsSelection,clipPathData:E})});const k=c.pipe(C(x),L(F=>F.highlightTarget),q()),B=O({graphicGSelection:P,visibleComputedAxesData:o,zeroYArr:I,groupLabels:R,barScale:D,params:u,chartParams:c,highlightTarget:k,barWidth:v,transformedBarRadius:N,delayGroup:M,transitionItem:G,isSeriesSeprate:y}).pipe(C(x),z(async F=>F),L(F=>qE({graphicGSelection:F.graphicGSelection,rectClassName:S,visibleComputedAxesData:F.visibleComputedAxesData,zeroYArr:F.zeroYArr,groupLabels:F.groupLabels,barScale:F.barScale,params:F.params,chartParams:F.chartParams,barWidth:F.barWidth,transformedBarRadius:F.transformedBarRadius,delayGroup:F.delayGroup,transitionItem:F.transitionItem,isSeriesSeprate:F.isSeriesSeprate})));return O({barSelection:B,computedData:n,highlightTarget:k,SeriesDataMap:s,GroupDataMap:l}).pipe(C(x),z(async F=>F)).subscribe(F=>{F.barSelection.on("mouseover",(E,W)=>{E.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:F.highlightTarget,datum:W,gridIndex:W.gridIndex,series:F.SeriesDataMap.get(W.seriesLabel),seriesIndex:W.seriesIndex,seriesLabel:W.seriesLabel,group:F.GroupDataMap.get(W.groupLabel),groupIndex:W.groupIndex,groupLabel:W.groupLabel,event:E,data:F.computedData})}).on("mousemove",(E,W)=>{E.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:F.highlightTarget,datum:W,gridIndex:W.gridIndex,series:F.SeriesDataMap.get(W.seriesLabel),seriesIndex:W.seriesIndex,seriesLabel:W.seriesLabel,group:F.GroupDataMap.get(W.groupLabel),groupIndex:W.groupIndex,groupLabel:W.groupLabel,event:E,data:F.computedData})}).on("mouseout",(E,W)=>{E.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:F.highlightTarget,datum:W,gridIndex:W.gridIndex,series:F.SeriesDataMap.get(W.seriesLabel),seriesIndex:W.seriesIndex,seriesLabel:W.seriesLabel,group:F.GroupDataMap.get(W.groupLabel),groupIndex:W.groupIndex,groupLabel:W.groupLabel,event:E,data:F.computedData})}).on("click",(E,W)=>{E.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:F.highlightTarget,datum:W,gridIndex:W.gridIndex,series:F.SeriesDataMap.get(W.seriesLabel),seriesIndex:W.seriesIndex,seriesLabel:W.seriesLabel,group:F.GroupDataMap.get(W.groupLabel),groupIndex:W.groupIndex,groupLabel:W.groupLabel,event:E,data:F.computedData})})}),O({barSelection:B,highlight:m.pipe(L(F=>F.map(E=>E.id))),fullChartParams:c}).pipe(C(x),z(async F=>F)).subscribe(F=>{KE({selection:F.barSelection,ids:F.highlight,fullChartParams:F.fullChartParams})}),()=>{x.next(void 0)}},_v="Bars",QE=ct({name:_v,defaultParams:Sa,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=kp(_v,{selection:e,computedData$:r.computedData$,computedAxesData$:r.computedAxesData$,visibleComputedData$:r.visibleComputedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,event$:n.event$});return()=>{i.next(void 0),o()}}),Av="BarsPN",JE=ct({name:Av,defaultParams:Sa,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=kp(Av,{selection:e,computedData$:r.computedData$,computedAxesData$:r.computedAxesData$,visibleComputedData$:r.visibleComputedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:St(!0),event$:n.event$});return()=>{i.next(void 0),o()}}),wv=.3;function eB({axisWidth:e,groupAmount:t,barGroupPadding:n=0}){const i=(t>1?e/(t-1):e)-n;return i>1?i:1}function tB(e,t){return e<=1?0:t/(e-1)*wv}function nB(e,t){return e<=1?t:t*(1-wv)}function rB({graphicGSelection:e,rectClassName:t,barData:n,zeroY:r,groupLabels:i,params:o,chartParams:a,barWidth:s,transformedBarRadius:l,delayGroup:u,transitionItem:c,isSeriesSeprate:h}){const f=s/2;return e.each((d,m,g)=>{X(g[m]).selectAll(`rect.${t}`).data(n[m]??[],y=>y.id).join(y=>y.append("rect").classed(t,!0).attr("cursor","pointer").attr("height",b=>1),y=>y,y=>y.remove()).attr("transform",(y,b)=>`translate(${(y?y.axisX:0)-f}, 0)`).attr("fill",y=>y.color).attr("y",y=>r).attr("x",y=>0).attr("width",s).attr("rx",l[m][0]??1).attr("ry",l[m][1]??1).transition().duration(c).ease(_r(a.transitionEase)).delay((y,b)=>y.groupIndex*u).attr("y",y=>y._barStartY).attr("height",y=>Math.abs(y._barHeight)||1)}),e.selectAll(`rect.${t}`)}function iB({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function oB({selection:e,ids:t,fullChartParams:n}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").duration(200).style("opacity",1);return}e.each((r,i,o)=>{t.includes(r.id)?X(o[i]).style("opacity",1):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const Pv=(e,{selection:t,computedData$:n,computedAxesData$:r,visibleComputedData$:i,visibleComputedAxesData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullDataFormatter$:c,fullChartParams$:h,gridAxesTransform$:f,gridGraphicTransform$:p,gridGraphicReverseScale$:d,gridAxesSize$:m,gridHighlight$:g,gridContainerPosition$:y,isSeriesSeprate$:b,event$:x})=>{const $=new Q,S=Oe(e,"clipPath-box"),_=H(e,"rect"),{seriesSelection$:A,axesSelection$:w,defsSelection$:P,graphicGSelection$:I}=wr({selection:t,pluginName:e,clipPathID:S,seriesLabels$:a,gridContainerPosition$:y,gridAxesTransform$:f,gridGraphicTransform$:p}),v=o.pipe(C($),L(V=>V[0]&&V[0][0]?V[0][0].axisY-V[0][0].axisYFromZero:0),q()),N=O({computedData:n,params:u,axisSize:m,isSeriesSeprate:b}).pipe(C($),z(async V=>V),L(V=>V.params.barWidth?V.params.barWidth:eB({axisWidth:V.axisSize.width,groupAmount:V.computedData[0]?V.computedData[0].length:0,barGroupPadding:V.params.barGroupPadding})),q()),R=O({computedData:n,barWidth:N,params:u,gridGraphicReverseScale:d}).pipe(C($),z(async V=>V),L(V=>{const ee=V.barWidth/2,Y=V.params.barRadius===!0?ee:V.params.barRadius===!1?0:typeof V.params.barRadius=="number"?V.params.barRadius:0;return V.computedData.map((J,K)=>{const ie=V.gridGraphicReverseScale[K]??V.gridGraphicReverseScale[0],le=Y*ie[0],Z=Y*ie[1];return[le,Z]})})),D=i.pipe(C($),L(V=>{const ee=new Set;return V.forEach(Y=>{Y.forEach(J=>{ee.add(J.groupLabel)})}),Array.from(ee)}),ne(1)),T=h.pipe(C($),L(V=>V.transitionDuration),q()),M=new me(V=>{O({groupLabels:D,transitionDuration:T}).pipe(z(async ee=>ee)).subscribe(ee=>{const Y=tB(ee.groupLabels.length,ee.transitionDuration);V.next(Y)})}).pipe(C($),q()),G=new me(V=>{O({groupLabels:D,transitionDuration:T}).pipe(z(async ee=>ee)).subscribe(ee=>{const Y=nB(ee.groupLabels.length,ee.transitionDuration);V.next(Y)})}).pipe(C($),q()),k=O({computedData:n,dataFormatter:c}).pipe(C($),z(async V=>V),L(V=>{const ee=V.computedData[0]?V.computedData[0].length-1:0,Y=V.dataFormatter.groupAxis.scaleDomain[0],J=V.dataFormatter.groupAxis.scaleDomain[1]==="max"?ee:V.dataFormatter.groupAxis.scaleDomain[1];return[Y,J]})),B=O({visibleComputedAxesData:o,groupScaleDomain:k}).pipe(C($),z(async V=>V),L(V=>{const ee=V.groupScaleDomain[0],Y=V.groupScaleDomain[1],K=V.visibleComputedAxesData.map(ye=>ye.filter((he,Re)=>he.groupIndex>=ee&&he.groupIndex<=Y)).flat();if(K.length<=1)return 1;const ie=K.reduce((ye,he)=>he.value>ye.value?he:ye,K[0]),le=ie.groupIndex,Z=K.filter(ye=>ye.groupIndex===le).reduce((ye,he)=>ye+he.value,0);return ie.value/Z})),F=O({computedAxesData:r,yRatio:B,zeroY:v}).pipe(C($),L(V=>{let ee=V.computedAxesData[0]?V.computedAxesData[0].map(()=>V.zeroY):[];return V.computedAxesData.map((Y,J)=>Y.map((K,ie)=>{const le=ee[ie];let Z=0;return K.visible&&(Z=K.axisYFromZero*V.yRatio,ee[ie]=ee[ie]+Z),{...K,_barStartY:le,_barHeight:Z}}))})),E=O({computedAxesData:r,zeroY:v}).pipe(C($),L(V=>V.computedAxesData.map((ee,Y)=>ee.map((J,K)=>({...J,_barStartY:V.zeroY,_barHeight:J.axisYFromZero}))))),W=b.pipe(z(V=>on(()=>V,E,F)));O({defsSelection:P,gridAxesSize:m}).pipe(C($),z(async V=>V)).subscribe(V=>{const ee=[{id:S,width:V.gridAxesSize.width,height:V.gridAxesSize.height}];iB({defsSelection:V.defsSelection,clipPathData:ee})});const j=h.pipe(C($),L(V=>V.highlightTarget),q()),te=O({graphicGSelection:I,graphicData:W,zeroY:v,groupLabels:D,params:u,chartParams:h,highlightTarget:j,barWidth:N,transformedBarRadius:R,delayGroup:M,transitionItem:G,isSeriesSeprate:b}).pipe(C($),z(async V=>V),L(V=>rB({graphicGSelection:V.graphicGSelection,rectClassName:_,barData:V.graphicData,zeroY:V.zeroY,groupLabels:V.groupLabels,params:V.params,chartParams:V.chartParams,barWidth:V.barWidth,transformedBarRadius:V.transformedBarRadius,delayGroup:V.delayGroup,transitionItem:V.transitionItem,isSeriesSeprate:V.isSeriesSeprate})));return O({barSelection:te,computedData:n,highlightTarget:j,SeriesDataMap:s,GroupDataMap:l}).subscribe(V=>{V.barSelection.on("mouseover",(ee,Y)=>{ee.stopPropagation(),x.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:V.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:V.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,group:V.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:ee,data:V.computedData})}).on("mousemove",(ee,Y)=>{ee.stopPropagation(),x.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:V.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:V.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,group:V.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:ee,data:V.computedData})}).on("mouseout",(ee,Y)=>{ee.stopPropagation(),x.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:V.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:V.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,group:V.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:ee,data:V.computedData})}).on("click",(ee,Y)=>{ee.stopPropagation(),x.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:V.highlightTarget,datum:Y,gridIndex:Y.gridIndex,series:V.SeriesDataMap.get(Y.seriesLabel),seriesIndex:Y.seriesIndex,seriesLabel:Y.seriesLabel,group:V.GroupDataMap.get(Y.groupLabel),groupIndex:Y.groupIndex,groupLabel:Y.groupLabel,event:ee,data:V.computedData})})}),O({barSelection:te,highlight:g.pipe(L(V=>V.map(ee=>ee.id))),fullChartParams:h}).pipe(C($),z(async V=>V)).subscribe(V=>{oB({selection:V.barSelection,ids:V.highlight,fullChartParams:V.fullChartParams})}),()=>{$.next(void 0)}},Dv="StackedBars",aB=ct({name:Dv,defaultParams:Ag,layerIndex:5,validator:(e,{validateColumns:t})=>t(e,{barWidth:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=Pv(Dv,{selection:e,computedData$:r.computedData$,computedAxesData$:r.computedAxesData$,visibleComputedData$:r.visibleComputedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullDataFormatter$:r.fullDataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,event$:n.event$});return()=>{i.next(void 0),o()}}),Cv=.3;function Lv({axisWidth:e,groupAmount:t,barAmountOfGroup:n,barPadding:r=0,barGroupPadding:i=0}){const a=((t>1?e/(t-1):e)-i)/n-r;return a>1?a:1}function sB(e,t,n){const r=e/2,i=e*t.length+n.barPadding*t.length;return Kh().domain(t).range([-i/2+r,i/2-r])}function lB(e,t){return e<=1?0:t/(e-1)*Cv}function uB(e,t){return e<=1?t:t*(1-Cv)}function cB({graphicGSelection:e,pathGClassName:t,pathClassName:n,visibleComputedAxesData:r,linearGradientIds:i,zeroYArr:o,groupLabels:a,barScale:s,params:l,chartParams:u,barWidth:c,delayGroup:h,transitionItem:f,isSeriesSeprate:p}){const d=c/2;return e.each((g,y,b)=>{X(b[y]).selectAll(`g.${t}`).data(r[y]??[]).join($=>{const S=$.append("g").classed(t,!0).attr("cursor","pointer");return S.append("path").classed(n,!0).style("vector-effect","non-scaling-stroke").attr("d",_=>{const A=-d,w=o[y],P=o[y];return`M${A},${w} L${A+c/2},${P} ${A+c},${w}`}),S},$=>$,$=>$.remove()).attr("transform",$=>`translate(${p?0:s($.seriesLabel)}, 0)`).select(`path.${n}`).attr("height",$=>Math.abs($.axisYFromZero)||1).attr("y",$=>$.axisY<o[y]?$.axisY:o[y]).attr("x",$=>p?0:s($.seriesLabel)).style("fill",$=>`url(#${i[$.seriesIndex]})`).attr("stroke",$=>$.color).attr("transform",$=>`translate(${$?$.axisX:0}, 0)`).transition().duration(f).ease(_r(u.transitionEase)).delay(($,S)=>$.groupIndex*h).attr("d",$=>{const S=-d,_=o[y],A=$.axisY;return`M${S},${_} L${S+c/2},${A} ${S+c},${_}`})}),e.selectAll(`path.${n}`)}function fB({defsSelection:e,computedData:t,linearGradientIds:n,params:r}){e.selectAll("linearGradient").data(t??[]).join(i=>i.append("linearGradient").attr("x1","0%").attr("x2","0%").attr("y1","100%").attr("y2","0%").attr("spreadMethod","pad"),i=>i,i=>i.remove()).attr("id",(i,o)=>i[0]?n[i[0].seriesIndex]:"").html((i,o)=>{const a=i[0]?i[0].color:"";return`
59
59
  <stop offset="0%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[0]}"/>
60
60
  <stop offset="100%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[1]}"/>
61
- `})}function hB({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function pB({selection:e,ids:t,fullChartParams:n}){e.interrupt("highlight");const r=()=>{e.transition("highlight").duration(200).style("opacity",1)};if(!t.length){r();return}e.each((i,o,a)=>{t.includes(i.id)?X(a[o]).style("opacity",1):X(a[o]).style("opacity",n.styles.unhighlightedOpacity)})}const Mv=(e,{selection:t,computedData$:n,computedAxesData$:r,visibleComputedData$:i,visibleComputedAxesData$:o,fullDataFormatter$:a,seriesLabels$:s,SeriesDataMap$:l,GroupDataMap$:u,fullParams$:c,fullChartParams$:h,gridAxesTransform$:f,gridGraphicTransform$:p,gridAxesSize$:g,gridHighlight$:m,gridContainerPosition$:d,isSeriesSeprate$:y,event$:b})=>{const x=new Q,$=Oe(e,"clipPath-box"),S=H(e,"pathG"),_=H(e,"path"),{seriesSelection$:A,axesSelection$:w,defsSelection$:P,graphicGSelection$:I}=wr({selection:t,pluginName:e,clipPathID:$,seriesLabels$:s,gridContainerPosition$:d,gridAxesTransform$:f,gridGraphicTransform$:p});p.pipe(C(x),L(E=>-E.translate[1]/E.scale[1]));const v=o.pipe(L(E=>E.map(W=>W[0]?W[0].axisY-W[0].axisYFromZero:0)),Z()),N=G({computedData:n,visibleComputedData:i,params:c,gridAxesSize:g,isSeriesSeprate:y}).pipe(C(x),z(async E=>E),L(E=>E.params.barWidth?E.params.barWidth:E.isSeriesSeprate?Lv({axisWidth:E.gridAxesSize.width,groupAmount:E.computedData[0]?E.computedData[0].length:0,barAmountOfGroup:1,barPadding:E.params.barPadding,barGroupPadding:E.params.barGroupPadding}):Lv({axisWidth:E.gridAxesSize.width,groupAmount:E.computedData[0]?E.computedData[0].length:0,barAmountOfGroup:E.visibleComputedData.length,barPadding:E.params.barPadding,barGroupPadding:E.params.barGroupPadding}))),R=i.pipe(C(x),L(E=>{const W=new Set;return E.forEach(j=>{j.forEach(te=>{W.add(te.groupLabel)})}),Array.from(W)})),D=new me(E=>{G({seriesLabels:s,barWidth:N,params:c}).pipe(C(x),z(async W=>W)).subscribe(W=>{const j=sB(W.barWidth,W.seriesLabels,W.params);E.next(j)})}),T=h.pipe(C(x),L(E=>E.transitionDuration),Z()),M=new me(E=>{G({groupLabels:R,transitionDuration:T}).pipe(z(async W=>W)).subscribe(W=>{const j=lB(W.groupLabels.length,W.transitionDuration);E.next(j)})}).pipe(C(x),Z()),O=new me(E=>{G({groupLabels:R,transitionDuration:T}).pipe(z(async W=>W)).subscribe(W=>{const j=uB(W.groupLabels.length,W.transitionDuration);E.next(j)})}).pipe(C(x),Z());G({defsSelection:P,gridAxesSize:g}).pipe(C(x),z(async E=>E)).subscribe(E=>{const W=[{id:$,width:E.gridAxesSize.width,height:E.gridAxesSize.height}];hB({defsSelection:E.defsSelection,clipPathData:W})});const k=h.pipe(C(x),L(E=>E.highlightTarget),Z()),B=s.pipe(C(x),L(E=>E.map((W,j)=>Oe(e,`lineargradient-${W}`)))),F=G({graphicGSelection:I,defsSelection:P,computedData:n,visibleComputedAxesData:o,linearGradientIds:B,zeroYArr:v,groupLabels:R,barScale:D,params:c,chartParams:h,barWidth:N,delayGroup:M,transitionItem:O,isSeriesSeprate:y}).pipe(C(x),z(async E=>E),L(E=>(fB({defsSelection:E.defsSelection,computedData:E.computedData,linearGradientIds:E.linearGradientIds,params:E.params}),cB({graphicGSelection:E.graphicGSelection,pathGClassName:S,pathClassName:_,visibleComputedAxesData:E.visibleComputedAxesData,linearGradientIds:E.linearGradientIds,zeroYArr:E.zeroYArr,groupLabels:E.groupLabels,barScale:E.barScale,params:E.params,chartParams:E.chartParams,barWidth:E.barWidth,delayGroup:E.delayGroup,transitionItem:E.transitionItem,isSeriesSeprate:E.isSeriesSeprate}))));return G({barSelection:F,computedData:n,highlightTarget:k,SeriesDataMap:l,GroupDataMap:u}).subscribe(E=>{E.barSelection.on("mouseover",(W,j)=>{W.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:E.highlightTarget,datum:j,gridIndex:j.gridIndex,series:E.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,group:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:W,data:E.computedData})}).on("mousemove",(W,j)=>{W.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:E.highlightTarget,datum:j,gridIndex:j.gridIndex,series:E.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,group:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:W,data:E.computedData})}).on("mouseout",(W,j)=>{W.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:E.highlightTarget,datum:j,gridIndex:j.gridIndex,series:E.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,group:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:W,data:E.computedData})}).on("click",(W,j)=>{W.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:E.highlightTarget,datum:j,gridIndex:j.gridIndex,series:E.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,group:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:W,data:E.computedData})})}),G({barSelection:F,highlight:m.pipe(L(E=>E.map(W=>W.id))),fullChartParams:h}).pipe(C(x),z(async E=>E)).subscribe(E=>{pB({selection:E.barSelection,ids:E.highlight,fullChartParams:E.fullChartParams})}),()=>{x.next(void 0)}},kv="BarsTriangle",gB=ct({name:kv,defaultParams:wg,layerIndex:5,validator:(e,{validateColumns:t})=>t(e,{barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},linearGradientOpacity:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=Mv(kv,{selection:e,computedData$:r.computedData$,computedAxesData$:r.computedAxesData$,visibleComputedData$:r.visibleComputedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,fullDataFormatter$:r.fullDataFormatter$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,event$:n.event$});return()=>{i.next(void 0),o()}});function dB({graphicGSelection:e,circleGClassName:t,circleClassName:n,visibleComputedAxesData:r,fullParams:i,fullChartParams:o,graphicReverseScale:a}){const s=c=>{const h=c.size();return o.transitionDuration/h};let l=0;return e.each((c,h,f)=>{X(f[h]).selectAll("g").data(r[h],p=>p.id).join(p=>(l=s(p),p.append("g").classed(t,!0)),p=>p,p=>p.remove()).attr("transform",p=>`translate(${p.axisX}, ${p.axisY})`).each((p,g,m)=>{X(m[g]).selectAll("circle").data([p]).join(d=>d.append("circle").style("cursor","pointer").style("vector-effect","non-scaling-stroke").classed(n,!0).attr("opacity",0).transition().delay((y,b)=>g*l).attr("opacity",1),d=>d.transition().duration(50).attr("opacity",1),d=>d.remove()).attr("r",i.radius).attr("fill",(d,y)=>Se({datum:d,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(d,y)=>Se({datum:d,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${a[h][0]??1}, ${a[h][1]??1})`)})}),e.selectAll(`circle.${n}`)}function mB({selection:e,ids:t,onlyShowHighlighted:n,fullChartParams:r}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").duration(200).style("opacity",n===!0?0:1);return}e.each((i,o,a)=>{t.includes(i.id)?X(a[o]).style("opacity",1).transition("highlight").duration(200):X(a[o]).style("opacity",n===!0?0:r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function yB({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join("rect").attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}const Rv=(e,{selection:t,computedData$:n,computedAxesData$:r,visibleComputedData$:i,visibleComputedAxesData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullChartParams$:c,gridAxesTransform$:h,gridGraphicTransform$:f,gridGraphicReverseScale$:p,gridAxesSize$:g,gridHighlight$:m,gridContainerPosition$:d,event$:y})=>{const b=new Q,x=Oe(e,"clipPath-box"),$=H(e,"circleG"),S=H(e,"circle"),{seriesSelection$:_,axesSelection$:A,defsSelection$:w,graphicGSelection$:P}=wr({selection:t,pluginName:e,clipPathID:x,seriesLabels$:a,gridContainerPosition$:d,gridAxesTransform$:h,gridGraphicTransform$:f}),I=G({computedData:n,gridGraphicReverseScale:p}).pipe(C(b),z(async D=>D),L(D=>D.computedData.map((T,M)=>D.gridGraphicReverseScale[M])));G({defsSelection:w,gridAxesSize:g}).pipe(C(b),z(async D=>D)).subscribe(D=>{const T=[{id:x,width:D.gridAxesSize.width,height:D.gridAxesSize.height}];yB({defsSelection:D.defsSelection,clipPathData:T})});const v=c.pipe(C(b),L(D=>D.highlightTarget),Z()),N=G({graphicGSelection:P,visibleComputedAxesData:o,graphicReverseScale:I,fullChartParams:c,fullParams:u}).pipe(C(b),z(async D=>D),L(D=>dB({graphicGSelection:D.graphicGSelection,circleGClassName:$,circleClassName:S,visibleComputedAxesData:D.visibleComputedAxesData,fullParams:D.fullParams,fullChartParams:D.fullChartParams,graphicReverseScale:D.graphicReverseScale})));G({graphicSelection:N,computedData:n,SeriesDataMap:s,GroupDataMap:l,highlightTarget:v}).pipe(C(b),z(async D=>D)).subscribe(D=>{D.graphicSelection.on("mouseover",(T,M)=>{y.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:D.highlightTarget,datum:M,gridIndex:M.gridIndex,series:D.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,group:D.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:T,data:D.computedData})}).on("mousemove",(T,M)=>{y.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:D.highlightTarget,data:D.computedData,datum:M,gridIndex:M.gridIndex,series:D.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,group:D.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:T})}).on("mouseout",(T,M)=>{y.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:D.highlightTarget,datum:M,gridIndex:M.gridIndex,series:D.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,group:D.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:T,data:D.computedData})}).on("click",(T,M)=>{y.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:D.highlightTarget,datum:M,gridIndex:M.gridIndex,series:D.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,group:D.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:T,data:D.computedData})})});const R=u.pipe(C(b),L(D=>D.onlyShowHighlighted),Z());return G({graphicSelection:N,highlight:m.pipe(L(D=>D.map(T=>T.id))),onlyShowHighlighted:R,fullChartParams:c}).pipe(C(b),z(async D=>D)).subscribe(D=>{mB({selection:D.graphicSelection,ids:D.highlight,onlyShowHighlighted:D.onlyShowHighlighted,fullChartParams:D.fullChartParams})}),()=>{b.next(void 0)}},Iv="Dots",bB=ct({name:Iv,defaultParams:_g,layerIndex:yu,validator:(e,{validateColumns:t})=>t(e,{radius:{toBeTypes:["number"]},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},onlyShowHighlighted:{toBeTypes:["boolean"]}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=Rv(Iv,{selection:e,computedData$:r.computedData$,computedAxesData$:r.computedAxesData$,visibleComputedData$:r.visibleComputedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,event$:n.event$});return()=>{i.next(void 0),o()}}),xB=" - ",$B={listRectWidth:14,listRectHeight:14,listRectRadius:0};function Ev(e,t){const n=e<t.colors[t.colorScheme].label.length?e:e%t.colors[t.colorScheme].label.length;return t.colors[t.colorScheme].label[n]}const Ri=(e,{rootSelection:t,legendLabels$:n,fullParams$:r,layout$:i,fullChartParams$:o,textSizePx$:a})=>{const s=H(e,"root-position"),l=H(e,"legend-card"),u=H(e,"legend-list"),c=H(e,"legend-item"),h=new Q,f=G({legendLabels:n,fullChartParams:o}).pipe(C(h),z(async v=>v),L(v=>{const N=new Map;let R=0;return v.legendLabels.forEach((D,T)=>{if(!N.has(D)){const M=Ev(R,v.fullChartParams);N.set(D,M),R++}}),N})),p=n.pipe(C(h),L(v=>{const N=new Set;let R=[];return v.forEach(D=>{N.has(D)?R.push(!1):R.push(!0),N.add(D)}),R})),g=r.pipe(C(h),L(v=>v.placement==="top"||v.placement==="top-start"||v.placement==="top-end"?"top":v.placement==="bottom"||v.placement==="bottom-start"||v.placement==="bottom-end"?"bottom":v.placement==="left"||v.placement==="left-start"||v.placement==="left-end"?"left":"right"),Z((v,N)=>v===N),ie(1)),m=r.pipe(C(h),L(v=>v.placement==="top-start"||v.placement==="bottom-start"||v.placement==="left-start"||v.placement==="right-start"?"start":v.placement==="top-end"||v.placement==="bottom-end"||v.placement==="left-end"||v.placement==="right-end"?"end":(v.placement==="top"||v.placement==="bottom"||v.placement==="left"||v.placement==="right","center")),Z((v,N)=>v===N),ie(1)),d=g.pipe(C(h),L(v=>v==="bottom"||v==="top"?"row":"column"),Z((v,N)=>v===N),ie(1)),y=G({fullParams:r,position:g,layout:i}).pipe(C(h),z(async v=>v),L(v=>{const N=v.fullParams.padding*2+v.fullParams.gap*2;return v.position==="bottom"||v.position==="top"?v.layout.rootWidth-N:v.layout.rootHeight-N})),x=G({layout:i,position:g,justify:m}).pipe(C(h),z(async v=>v),L(v=>{let N=0,R=0;return v.position==="bottom"?(R=v.layout.rootHeight,v.justify==="start"?N=0:v.justify==="center"?N=v.layout.rootWidth/2:v.justify==="end"&&(N=v.layout.rootWidth)):v.position==="right"?(N=v.layout.rootWidth,v.justify==="start"?R=0:v.justify==="center"?R=v.layout.rootHeight/2:v.justify==="end"&&(R=v.layout.rootHeight)):v.position==="top"?(R=0,v.justify==="start"?N=0:v.justify==="center"?N=v.layout.rootWidth/2:v.justify==="end"&&(N=v.layout.rootWidth)):v.position==="left"&&(N=0,v.justify==="start"?R=0:v.justify==="center"?R=v.layout.rootHeight/2:v.justify==="end"&&(R=v.layout.rootHeight)),{x:N,y:R}})).pipe(C(h),L(v=>t.selectAll(`g.${s}`).data([v]).join(N=>N.append("g").classed(s,!0).attr("transform",R=>`translate(${R.x}, ${R.y})`),N=>N.transition().attr("transform",R=>`translate(${R.x}, ${R.y})`),N=>N.remove()))),$=r.pipe(C(h),L(v=>v.labelList[0]?v.labelList[0]:$B)),S=G({visibleList:p,fullParams:r,fullChartParams:o,legendLabels:n,lineDirection:d,lineMaxSize:y,defaultListStyle:$,SeriesLabelColorMap:f,textSizePx:a}).pipe(C(h),z(async v=>v),L(v=>v.legendLabels.reduce((N,R,D)=>{if(!v.visibleList[D])return N;const T=R!==""?R:xB,M=Li(T,v.textSizePx),O=v.textSizePx*1.5+M,k=v.SeriesLabelColorMap.get(R),B=N[0]&&N[0][0]?N[N.length-1][N[N.length-1].length-1]:null,{translateX:F,translateY:E,lineIndex:W,itemIndex:j}=((V,ee,Y)=>{let J=0,K=0,re=0,le=0;if(V.lineDirection==="column"){let q=Y?Y.translateY+V.textSizePx+V.fullParams.gap:0;if(q+V.textSizePx>V.lineMaxSize){re=Y.lineIndex+1,le=0,K=0;const ye=ee[ee.length-1].reduce((he,Re)=>Re.itemWidth>he?Re.itemWidth:he,0);J=Y.translateX+ye+V.fullParams.gap}else re=Y?Y.lineIndex:0,le=Y?Y.itemIndex+1:0,K=q,J=Y?Y.translateX:0}else{let q=Y?Y.translateX+Y.itemWidth+V.fullParams.gap:0;q+O>V.lineMaxSize?(re=Y.lineIndex+1,le=0,J=0):(re=Y?Y.lineIndex:0,le=Y?Y.itemIndex+1:0,J=q),K=(V.textSizePx+V.fullParams.gap)*re}return{translateX:J,translateY:K,lineIndex:re,itemIndex:le}})(v,N,B);N[W]||(N[W]=[]);const te=v.fullParams.labelList[j]?v.fullParams.labelList[j]:v.defaultListStyle;return N[W].push({id:T,seriesLabel:T,seriesIndex:D,lineIndex:W,itemIndex:j,text:T,itemWidth:O,translateX:F,translateY:E,color:k,listRectWidth:te.listRectWidth,listRectHeight:te.listRectHeight,listRectRadius:te.listRectRadius}),N},[])),ie(1)),_=G({fullParams:r,fullChartParams:o,lineDirection:d,lengendItems:S,textSizePx:a}).pipe(C(h),z(async v=>v),L(v=>{const{width:N,height:R}=((D,T)=>{let M=0,O=0;if(!T.length||!T[0].length)return{width:M,height:O};const k=T[0][T[0].length-1];return D.lineDirection==="column"?(M=T.reduce((B,F)=>{const E=F.reduce((W,j)=>j.itemWidth>W?j.itemWidth:W,0);return B+E},0),M+=D.fullParams.gap*(T.length-1),O=k.translateY+D.textSizePx):(M=k.translateX+k.itemWidth,O=D.textSizePx*T.length+D.fullParams.gap*(T.length-1)),{width:M,height:O}})(v,v.lengendItems);return{direction:v.lineDirection,width:N,height:R,translateX:v.fullParams.gap,translateY:v.fullParams.gap}}),ie(1)),A=G({fullParams:r,position:g,justify:m,lengendList:_}).pipe(C(h),z(async v=>v),L(v=>{const N=v.lengendList.width+v.fullParams.gap*2,R=v.lengendList.height+v.fullParams.gap*2;let D=0,T=0;return v.position==="left"?v.justify==="start"?(D=v.fullParams.padding,T=v.fullParams.padding):v.justify==="center"?(D=v.fullParams.padding,T=-R/2):v.justify==="end"&&(D=v.fullParams.padding,T=-R-v.fullParams.padding):v.position==="right"?v.justify==="start"?(D=-N-v.fullParams.padding,T=v.fullParams.padding):v.justify==="center"?(D=-N-v.fullParams.padding,T=-R/2):v.justify==="end"&&(D=-N-v.fullParams.padding,T=-R-v.fullParams.padding):v.position==="top"?v.justify==="start"?(D=v.fullParams.padding,T=v.fullParams.padding):v.justify==="center"?(D=-N/2,T=v.fullParams.padding):v.justify==="end"&&(D=-N-v.fullParams.padding,T=v.fullParams.padding):v.justify==="start"?(D=v.fullParams.padding,T=-R-v.fullParams.padding):v.justify==="center"?(D=-N/2,T=-R-v.fullParams.padding):v.justify==="end"&&(D=-N-v.fullParams.padding,T=-R-v.fullParams.padding),{width:N,height:R,translateX:D,translateY:T}})),w=G({rootPositionSelection:x,fullParams:r,fullChartParams:o,legendCard:A}).pipe(C(h),z(async v=>v),L(v=>v.rootPositionSelection.selectAll("g").data([v.legendCard]).join(N=>N.append("g").classed(l,!0).attr("transform",R=>`translate(${R.translateX}, ${R.translateY})`),N=>N.transition().attr("transform",R=>`translate(${R.translateX}, ${R.translateY})`),N=>N.remove()).each((N,R,D)=>{X(D[R]).selectAll("rect").data([N]).join("rect").attr("width",T=>T.width).attr("height",T=>T.height).attr("fill",pe(v.fullParams.backgroundFill,v.fullChartParams)).attr("stroke",pe(v.fullParams.backgroundStroke,v.fullChartParams))}))),P=G({lengendCardSelection:w,fullParams:r,lengendList:_}).pipe(C(h),z(async v=>v),L(v=>v.lengendCardSelection.selectAll("g").data([v.lengendList]).join(N=>N.append("g").classed(u,!0).attr("transform",R=>`translate(${R.translateX}, ${R.translateY})`),N=>N.transition().attr("transform",R=>`translate(${R.translateX}, ${R.translateY})`),N=>N.remove())));return G({lengendListSelection:P,fullParams:r,fullChartParams:o,lengendItems:S,textSizePx:a}).pipe(C(h),z(async v=>v),L(v=>{const N=v.lengendItems[0]?v.lengendItems.flat():[];return v.lengendListSelection.selectAll(`g.${c}`).data(N).join(R=>R.append("g").classed(c,!0).attr("cursor","default"),R=>R,R=>R.remove()).attr("transform",(R,D)=>`translate(${R.translateX}, ${R.translateY})`).each((R,D,T)=>{const M=v.textSizePx/2,O=-R.listRectWidth/2,k=-R.listRectHeight/2;X(T[D]).selectAll("rect").data([R]).join("rect").attr("x",M).attr("y",M).attr("width",B=>B.listRectWidth).attr("height",B=>B.listRectHeight).attr("transform",B=>`translate(${O}, ${k})`).attr("fill",B=>B.color).attr("rx",B=>B.listRectRadius),X(T[D]).selectAll("text").data([R]).join(B=>B.append("text").attr("dominant-baseline","hanging"),B=>B,B=>B.remove()).attr("x",v.textSizePx*1.5).attr("font-size",v.fullChartParams.styles.textSize).attr("fill",B=>v.fullParams.textColorType==="label"?Ev(B.seriesIndex,v.fullChartParams):pe(v.fullParams.textColorType,v.fullChartParams)).text(B=>B.text)})})).subscribe(),()=>{t.select(`g.${s}`).remove(),h.next(void 0)}},Bv="GridLegend",vB=ct({name:Bv,defaultParams:Cg,layerIndex:Mi,validator:(e,{validateColumns:t})=>t(e,{placement:{toBe:'"top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end"',test:r=>["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].includes(r)},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:e,rootSelection:t,observer:n,subject:r})=>{const i=new Q,o=n.fullParams$.pipe(C(i),L(s=>{const l=[{listRectWidth:s.listRectWidth,listRectHeight:s.listRectHeight,listRectRadius:s.listRectRadius}];return{...s,labelList:l}})),a=Ri(Bv,{rootSelection:t,legendLabels$:n.seriesLabels$,fullParams$:o,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),a()}});function Nv(e,{text:t,radius:n,lineHeight:r,isBreakAll:i=!1,limit:o=0}){if(e==null||t==null){console.error("selection or text is not defined");return}n==null&&(n=e.node().getBBox().width/2);function a(p){let g;return i?g=p.split(""):g=p.split(/\s+/g),g[g.length-1]||g.pop(),g[0]||g.shift(),g}function s(p,g){return p&&g&&p.length>g&&(p=p.substring(0,g)+"..."),p}function l(p){var m;const g=document.createElement("canvas").getContext("2d");return((m=g==null?void 0:g.measureText(p))==null?void 0:m.width)??0}function u(p){const g=l(p.trim());return Math.sqrt(g*r)}function c(p,g){let m={width:0,text:""},d=1/0;const y=[];let b=" ";i&&(b="");for(let x=0,$=p.length;x<$;++x){const S=(m.text?m.text+b:"")+p[x],_=l(S);(d+_)/2<g?(m.width=d=_,m.text=S):(d=l(p[x]),m={width:d,text:p[x]},y.push(m))}return y}function h(p){let g=0;for(let m=0,d=p.length;m<d;++m){const y=(Math.abs(m-d/2+.5)+.5)*r,b=p[m].width/2;g=Math.max(g,Math.sqrt(b**2+y**2))}return g}function f(p,g){o>0&&(g=s(g,o));const m=a(g),d=u(g),y=c(m,d),b=h(y);let x=p.select("text");x.size()||(x=p.append("text")),x.attr("transform",`translate(0,0) scale(${n/b})`);const $=x.selectAll("tspan").data(y),S=$.enter().append("tspan").attr("x",0).merge($).attr("y",(_,A)=>(A-y.length/2+.8)*r).text(_=>_.text);return $.exit().remove(),$.merge(S)}return f(e,t)}function ma(e,{textArr:t,textSizePx:n,groupAxisPosition:r,isContainerRotated:i}){e.text(null);const o=Number(e.attr("x"));let a=Number(e.attr("y"));i&&r==="top"&&(a-=(t.length-1)*n),e.selectAll("tspan").data(t).join("tspan").attr("x",o).attr("y",(s,l)=>a+l*n).text(s=>s)}function Fv(e,{textArr:t,textSizePx:n,quadrant:r}){e.selectAll("tspan").data(t).join("tspan").attr("x",0).attr("y",(i,o)=>r==1||r==2?-(t.length-1-o)*n:o*n).text(i=>i)}const Rp=6;function SB(e,t){return e.map((n,r)=>{const i=rn(n,t),o=typeof i=="string"?i.split(`
62
- `):[i];return{text:i,textArr:o}})}function TB({selection:e,groupingLabelClassName:t,fullParams:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,textReverseTransform:s}){const l=n.tickPadding+n.labelOffset[0],u=n.tickPadding+n.labelOffset[1];let c=0,h=0;o.groupAxis.position==="bottom"?(h=u,o.valueAxis.position==="left"?c=l:o.valueAxis.position==="right"&&(c=-l)):o.groupAxis.position==="top"?(h=-u,o.valueAxis.position==="left"?c=l:o.valueAxis.position==="right"&&(c=-l)):o.groupAxis.position==="left"?(c=-l,o.valueAxis.position==="bottom"?h=-u:o.valueAxis.position==="top"&&(h=u)):o.groupAxis.position==="right"&&(c=l,o.valueAxis.position==="bottom"?h=-u:o.valueAxis.position==="top"&&(h=u)),e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).each((f,p,g)=>{X(g[p]).selectAll("text").data([f]).join(m=>m.append("text").style("font-weight","bold"),m=>m,m=>m.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("font-size",a.styles.textSize).style("fill",pe(n.labelColorType,a)).style("transform",s).attr("x",c).attr("y",h).text(m=>o.groupAxis.label)}).attr("transform",f=>`translate(${i.width}, 0)`)}function _B({selection:e,xAxisClassName:t,fullParams:n,tickTextAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,groupScale:s,groupScaleDomain:l,groupLabelData:u,textReverseTransformWithRotate:c,textSizePx:h}){const f=e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0),p=Math.floor(l[1])-Math.ceil(l[0])+1;let g=0,m=0;o.groupAxis.position==="left"?(g=0,m=-n.tickPadding):o.groupAxis.position==="right"?(g=0,m=n.tickPadding):o.groupAxis.position==="bottom"?(n.tickFullLine==!0?g=-n.tickPadding:g=-n.tickPadding-Rp,m=0):o.groupAxis.position==="top"&&(n.tickFullLine==!0?g=n.tickPadding:g=n.tickPadding-Rp,m=-0);const d=hs(s).scale(s).ticks(n.ticks==="all"||n.ticks>p?p:n.ticks).tickSize(n.tickFullLine==!0?-i.height:Rp).tickSizeOuter(0).tickFormat(x=>{var $;return(($=u[x])==null?void 0:$.text)??""}).tickPadding(g),y=f.transition().duration(100).ease(Ft).call(d).on("end",(x,$)=>{f.selectAll(".tick text").each((S,_,A)=>{var P;const w=((P=u[S])==null?void 0:P.textArr)??[];ma(X(A[_]),{textArr:w,textSizePx:h,groupAxisPosition:o.groupAxis.position,isContainerRotated:!0})})});return y.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?pe(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).style("vector-effect","non-scaling-stroke").attr("pointer-events","none"),y.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?pe(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges"),f.selectAll("text").attr("font-size",a.styles.textSize).attr("fill",pe(n.tickTextColorType,a)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("x",m).style("transform",c).attr("dy",0),f}const zv=(e,{selection:t,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,gridAxesTransform$:a,gridAxesReverseTransform$:s,gridAxesSize$:l,gridContainerPosition$:u,isSeriesSeprate$:c,textSizePx$:h})=>{const f=new Q,p=H(e,"container"),g=H(e,"xAxisG"),m=H(e,"xAxis"),d=H(e,"groupingLabel"),y=G({computedData:n.pipe(Z((v,N)=>v.length===N.length)),isSeriesSeprate:c}).pipe(C(f),z(async v=>v),L(v=>v.isSeriesSeprate?v.computedData:[v.computedData[0]]),L((v,N)=>t.selectAll(`g.${p}`).data(v,R=>R&&R[0]?R[0].seriesIndex:N).join("g").classed(p,!0))),b=y.pipe(C(f),L((v,N)=>v.selectAll(`g.${g}`).data([g]).join("g").classed(g,!0)));G({containerSelection:y,gridContainerPosition:u}).pipe(C(f),z(async v=>v)).subscribe(v=>{v.containerSelection.attr("transform",(N,R)=>{const D=v.gridContainerPosition[R]??v.gridContainerPosition[0],T=D.translate,M=D.scale;return`translate(${T[0]}, ${T[1]}) scale(${M[0]}, ${M[1]})`})}),G({axisSelection:b,gridAxesTransform:a}).pipe(C(f),z(async v=>v)).subscribe(v=>{v.axisSelection.style("transform",v.gridAxesTransform.value)});const x=G({gridAxesReverseTransform:s,gridContainerPosition:u}).pipe(C(f),z(async v=>v),L(v=>{const N=`rotateX(${v.gridAxesReverseTransform.rotateX}deg) rotateY(${v.gridAxesReverseTransform.rotateY}deg)`,R=`rotate(${v.gridAxesReverseTransform.rotate}deg)`,D=`scale(${1/v.gridContainerPosition[0].scale[0]}, ${1/v.gridContainerPosition[0].scale[1]})`;return`${N} ${R} ${D}`}),Z()),$=G({textReverseTransform:x,fullParams:r}).pipe(C(f),z(async v=>v),L(v=>`${v.textReverseTransform} rotate(${v.fullParams.tickTextRotate}deg)`)),S=G({fullDataFormatter:i,gridAxesSize:l,computedData:n}).pipe(C(f),z(async v=>v),L(v=>{const N=v.computedData[0]?v.computedData[0].length-1:0,R=v.fullDataFormatter.groupAxis.scaleDomain[0]-v.fullDataFormatter.groupAxis.scalePadding,D=v.fullDataFormatter.groupAxis.scaleDomain[1]==="max"?N+v.fullDataFormatter.groupAxis.scalePadding:v.fullDataFormatter.groupAxis.scaleDomain[1]+v.fullDataFormatter.groupAxis.scalePadding;return[R,D]}),ie(1)),_=G({groupScaleDomain:S,gridAxesSize:l}).pipe(C(f),z(async v=>v),L(v=>Nn().domain(v.groupScaleDomain).range([0,v.gridAxesSize.width]))),A=n.pipe(L(v=>(v[0]??[]).map(N=>N.groupLabel))),w=G({fullDataFormatter:i,fullParams:r}).pipe(C(f),z(async v=>v),L(v=>{let N="middle",R="hanging";return v.fullDataFormatter.groupAxis.position==="bottom"?(N=v.fullParams.tickTextRotate?"end":"middle",R="hanging"):v.fullDataFormatter.groupAxis.position==="top"?(N=v.fullParams.tickTextRotate?"start":"middle",R="auto"):v.fullDataFormatter.groupAxis.position==="left"?(N="end",R="middle"):v.fullDataFormatter.groupAxis.position==="right"&&(N="start",R="middle"),{textAnchor:N,dominantBaseline:R}})),P=i.pipe(C(f),L(v=>{let N="start",R="hanging";return v.groupAxis.position==="bottom"?R="hanging":v.groupAxis.position==="top"?R="auto":v.groupAxis.position==="left"?N="end":v.groupAxis.position==="right"&&(N="start"),v.valueAxis.position==="left"?N="start":v.valueAxis.position==="right"?N="end":v.valueAxis.position==="bottom"?R="auto":v.valueAxis.position==="top"&&(R="hanging"),{textAnchor:N,dominantBaseline:R}})),I=G({groupLabels:A,fullParams:r}).pipe(C(f),z(async v=>v),L(v=>SB(v.groupLabels,v.fullParams.tickFormat)));return G({axisSelection:b,fullParams:r,tickTextAlign:w,axisLabelAlign:P,gridAxesSize:l,fullDataFormatter:i,chartParams:o,groupScale:_,groupScaleDomain:S,groupLabelData:I,textReverseTransform:x,textReverseTransformWithRotate:$,textSizePx:h}).pipe(C(f),z(async v=>v)).subscribe(v=>{_B({selection:v.axisSelection,xAxisClassName:m,fullParams:v.fullParams,tickTextAlign:v.tickTextAlign,gridAxesSize:v.gridAxesSize,fullDataFormatter:v.fullDataFormatter,chartParams:v.chartParams,groupScale:v.groupScale,groupScaleDomain:v.groupScaleDomain,groupLabelData:v.groupLabelData,textReverseTransformWithRotate:v.textReverseTransformWithRotate,textSizePx:v.textSizePx}),TB({selection:v.axisSelection,groupingLabelClassName:d,fullParams:v.fullParams,axisLabelAlign:v.axisLabelAlign,gridAxesSize:v.gridAxesSize,fullDataFormatter:v.fullDataFormatter,chartParams:v.chartParams,textReverseTransform:v.textReverseTransform})}),()=>{f.next(void 0)}},Ov="GroupAxis",AB=ct({name:Ov,defaultParams:wu,layerIndex:Dt,validator:(e,{validateColumns:t})=>t(e,{labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBe:'number | null | "all"',test:r=>r===null||r==="all"||typeof r=="number"}})})(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=zv(Ov,{selection:e,computedData$:n.computedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),o()}}),wB=6;function PB({selection:e,textClassName:t,fullParams:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,fullChartParams:a,textReverseTransform:s}){const l=n.tickPadding-n.labelOffset[0],u=n.tickPadding+n.labelOffset[1];let c=0,h=0;o.groupAxis.position==="bottom"?(h=-u,o.valueAxis.position==="left"?c=-l:o.valueAxis.position==="right"&&(c=l)):o.groupAxis.position==="top"?(h=u,o.valueAxis.position==="left"?c=-l:o.valueAxis.position==="right"&&(c=l)):o.groupAxis.position==="left"?(c=l,o.valueAxis.position==="bottom"?h=u:o.valueAxis.position==="top"&&(h=-u)):o.groupAxis.position==="right"&&(c=-l,o.valueAxis.position==="bottom"?h=u:o.valueAxis.position==="top"&&(h=-u)),e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).each((f,p,g)=>{X(g[p]).selectAll("text").data([f]).join(m=>m.append("text").style("font-weight","bold"),m=>m,m=>m.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("font-size",a.styles.textSize).style("fill",pe(n.labelColorType,a)).style("transform",s).attr("x",c).attr("y",h).text(m=>o.valueAxis.label)}).attr("transform",f=>`translate(0, ${i.height})`)}function DB({selection:e,yAxisClassName:t,fullParams:n,tickTextAlign:r,gridAxesSize:i,fullDataFormatter:o,fullChartParams:a,valueScale:s,textReverseTransformWithRotate:l,filteredMinMaxValue:u}){const c=e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0);let h=0,f=0;o.valueAxis.position==="left"?(h=n.tickPadding,f=0):o.valueAxis.position==="right"?(h=-n.tickPadding,f=0):o.valueAxis.position==="bottom"?(h=0,f=n.tickPadding):o.valueAxis.position==="top"&&(h=0,f=-n.tickPadding);const p=Nc(s).scale(s).ticks(n.ticks).tickFormat(d=>rn(d,n.tickFormat)).tickSize(n.tickFullLine==!0?-i.width:wB).tickPadding(h),g=c.transition().duration(100).ease(Ft).call(p);g.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?pe(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).style("vector-effect","non-scaling-stroke").attr("pointer-events","none"),g.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?pe(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges");const m=c.selectAll("text").attr("font-size",a.styles.textSize).style("color",pe(n.tickTextColorType,a)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("y",f).attr("dy",0);return m.style("transform",l),(o.valueAxis.position==="bottom"||o.valueAxis.position==="top")&&m.attr("dy",0),c}const Ii=(e,{selection:t,computedData$:n,filteredMinMaxValue$:r,fullParams$:i,fullDataFormatter$:o,fullChartParams$:a,gridAxesSize$:s,gridAxesTransform$:l,gridAxesReverseTransform$:u,gridContainerPosition$:c,isSeriesSeprate$:h})=>{const f=new Q,p=H(e,"yAxisG"),g=H(e,"yAxis"),m=H(e,"text"),y=ME({selection:t,pluginName:e,computedData$:n,gridContainerPosition$:c,isSeriesSeprate$:h}).pipe(C(f),L((A,w)=>A.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));G({axisSelection:y,gridAxesTransform:l}).pipe(C(f),z(async A=>A)).subscribe(A=>{A.axisSelection.style("transform",A.gridAxesTransform.value)});const b=G({gridAxesReverseTransform:u,gridContainerPosition:c}).pipe(C(f),z(async A=>A),L(A=>{const w=`rotateX(${A.gridAxesReverseTransform.rotateX}deg) rotateY(${A.gridAxesReverseTransform.rotateY}deg)`,P=`rotate(${A.gridAxesReverseTransform.rotate}deg)`,I=`scale(${1/A.gridContainerPosition[0].scale[0]}, ${1/A.gridContainerPosition[0].scale[1]})`;return`${w} ${P} ${I}`}),Z()),x=G({textReverseTransform:b,fullParams:i}).pipe(C(f),z(async A=>A),L(A=>`${A.textReverseTransform} rotate(${A.fullParams.tickTextRotate}deg)`)),$=new me(A=>{G({fullDataFormatter:o,gridAxesSize:s,filteredMinMaxValue:r}).pipe(C(f),z(async w=>w)).subscribe(w=>{let P=w.filteredMinMaxValue[1],I=w.filteredMinMaxValue[0];P===I&&P===0&&(P=1);const v=Sc({maxValue:P,minValue:I,axisWidth:w.gridAxesSize.height,scaleDomain:w.fullDataFormatter.valueAxis.scaleDomain,scaleRange:w.fullDataFormatter.valueAxis.scaleRange});A.next(v)})}),S=G({fullDataFormatter:o,fullParams:i}).pipe(C(f),z(async A=>A),L(A=>{let w="start",P="hanging";return A.fullDataFormatter.valueAxis.position==="left"?(w="end",P="middle"):A.fullDataFormatter.valueAxis.position==="right"?(w="start",P="middle"):A.fullDataFormatter.valueAxis.position==="bottom"?(w=A.fullParams.tickTextRotate?"end":"middle",P="hanging"):A.fullDataFormatter.valueAxis.position==="top"&&(w=A.fullParams.tickTextRotate?"start":"middle",P="auto"),{textAnchor:w,dominantBaseline:P}})),_=o.pipe(C(f),L(A=>{let w="start",P="hanging";return A.groupAxis.position==="bottom"?P="auto":A.groupAxis.position==="top"?P="hanging":A.groupAxis.position==="left"?w="start":A.groupAxis.position==="right"&&(w="end"),A.valueAxis.position==="left"?w="end":A.valueAxis.position==="right"?w="start":A.valueAxis.position==="bottom"?P="hanging":A.valueAxis.position==="top"&&(P="auto"),{textAnchor:w,dominantBaseline:P}}));return G({axisSelection:y,fullParams:i,tickTextAlign:S,axisLabelAlign:_,computedData:n,gridAxesSize:s,fullDataFormatter:o,fullChartParams:a,valueScale:$,textReverseTransform:b,textReverseTransformWithRotate:x,filteredMinMaxValue:r}).pipe(C(f),z(async A=>A)).subscribe(A=>{DB({selection:A.axisSelection,yAxisClassName:g,fullParams:A.fullParams,tickTextAlign:A.tickTextAlign,gridAxesSize:A.gridAxesSize,fullDataFormatter:A.fullDataFormatter,fullChartParams:A.fullChartParams,valueScale:A.valueScale,textReverseTransformWithRotate:A.textReverseTransformWithRotate,filteredMinMaxValue:A.filteredMinMaxValue}),PB({selection:A.axisSelection,textClassName:m,fullParams:A.fullParams,axisLabelAlign:A.axisLabelAlign,gridAxesSize:A.gridAxesSize,fullDataFormatter:A.fullDataFormatter,fullChartParams:A.fullChartParams,textReverseTransform:A.textReverseTransform})}),()=>{f.next(void 0)}},Gv="ValueAxis",CB=ct({name:Gv,defaultParams:Ta,layerIndex:Dt,validator:(e,{validateColumns:t})=>t(e,{labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}})})(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=Ii(Gv,{selection:e,computedData$:n.computedData$,filteredMinMaxValue$:n.filteredMinMaxValue$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$});return()=>{i.next(void 0),o()}}),Wv="StackedValueAxis",LB=ct({name:Wv,defaultParams:Pg,layerIndex:Dt,validator:(e,{validateColumns:t})=>t(e,{labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}})})(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=Ii(Wv,{selection:e,computedData$:n.computedStackedData$,filteredMinMaxValue$:n.filteredMinMaxValue$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$});return()=>{i.next(void 0),o()}});function Vv(e,t){const n=t.textSizePx*1.5,i=(e==null?[]:Array.isArray(e)?e:typeof e=="string"?e.split(`
61
+ `})}function hB({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function pB({selection:e,ids:t,fullChartParams:n}){e.interrupt("highlight");const r=()=>{e.transition("highlight").duration(200).style("opacity",1)};if(!t.length){r();return}e.each((i,o,a)=>{t.includes(i.id)?X(a[o]).style("opacity",1):X(a[o]).style("opacity",n.styles.unhighlightedOpacity)})}const Mv=(e,{selection:t,computedData$:n,computedAxesData$:r,visibleComputedData$:i,visibleComputedAxesData$:o,fullDataFormatter$:a,seriesLabels$:s,SeriesDataMap$:l,GroupDataMap$:u,fullParams$:c,fullChartParams$:h,gridAxesTransform$:f,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:m,gridContainerPosition$:g,isSeriesSeprate$:y,event$:b})=>{const x=new Q,$=Oe(e,"clipPath-box"),S=H(e,"pathG"),_=H(e,"path"),{seriesSelection$:A,axesSelection$:w,defsSelection$:P,graphicGSelection$:I}=wr({selection:t,pluginName:e,clipPathID:$,seriesLabels$:s,gridContainerPosition$:g,gridAxesTransform$:f,gridGraphicTransform$:p});p.pipe(C(x),L(E=>-E.translate[1]/E.scale[1]));const v=o.pipe(L(E=>E.map(W=>W[0]?W[0].axisY-W[0].axisYFromZero:0)),q()),N=O({computedData:n,visibleComputedData:i,params:c,gridAxesSize:d,isSeriesSeprate:y}).pipe(C(x),z(async E=>E),L(E=>E.params.barWidth?E.params.barWidth:E.isSeriesSeprate?Lv({axisWidth:E.gridAxesSize.width,groupAmount:E.computedData[0]?E.computedData[0].length:0,barAmountOfGroup:1,barPadding:E.params.barPadding,barGroupPadding:E.params.barGroupPadding}):Lv({axisWidth:E.gridAxesSize.width,groupAmount:E.computedData[0]?E.computedData[0].length:0,barAmountOfGroup:E.visibleComputedData.length,barPadding:E.params.barPadding,barGroupPadding:E.params.barGroupPadding}))),R=i.pipe(C(x),L(E=>{const W=new Set;return E.forEach(j=>{j.forEach(te=>{W.add(te.groupLabel)})}),Array.from(W)})),D=new me(E=>{O({seriesLabels:s,barWidth:N,params:c}).pipe(C(x),z(async W=>W)).subscribe(W=>{const j=sB(W.barWidth,W.seriesLabels,W.params);E.next(j)})}),T=h.pipe(C(x),L(E=>E.transitionDuration),q()),M=new me(E=>{O({groupLabels:R,transitionDuration:T}).pipe(z(async W=>W)).subscribe(W=>{const j=lB(W.groupLabels.length,W.transitionDuration);E.next(j)})}).pipe(C(x),q()),G=new me(E=>{O({groupLabels:R,transitionDuration:T}).pipe(z(async W=>W)).subscribe(W=>{const j=uB(W.groupLabels.length,W.transitionDuration);E.next(j)})}).pipe(C(x),q());O({defsSelection:P,gridAxesSize:d}).pipe(C(x),z(async E=>E)).subscribe(E=>{const W=[{id:$,width:E.gridAxesSize.width,height:E.gridAxesSize.height}];hB({defsSelection:E.defsSelection,clipPathData:W})});const k=h.pipe(C(x),L(E=>E.highlightTarget),q()),B=s.pipe(C(x),L(E=>E.map((W,j)=>Oe(e,`lineargradient-${W}`)))),F=O({graphicGSelection:I,defsSelection:P,computedData:n,visibleComputedAxesData:o,linearGradientIds:B,zeroYArr:v,groupLabels:R,barScale:D,params:c,chartParams:h,barWidth:N,delayGroup:M,transitionItem:G,isSeriesSeprate:y}).pipe(C(x),z(async E=>E),L(E=>(fB({defsSelection:E.defsSelection,computedData:E.computedData,linearGradientIds:E.linearGradientIds,params:E.params}),cB({graphicGSelection:E.graphicGSelection,pathGClassName:S,pathClassName:_,visibleComputedAxesData:E.visibleComputedAxesData,linearGradientIds:E.linearGradientIds,zeroYArr:E.zeroYArr,groupLabels:E.groupLabels,barScale:E.barScale,params:E.params,chartParams:E.chartParams,barWidth:E.barWidth,delayGroup:E.delayGroup,transitionItem:E.transitionItem,isSeriesSeprate:E.isSeriesSeprate}))));return O({barSelection:F,computedData:n,highlightTarget:k,SeriesDataMap:l,GroupDataMap:u}).subscribe(E=>{E.barSelection.on("mouseover",(W,j)=>{W.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:E.highlightTarget,datum:j,gridIndex:j.gridIndex,series:E.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,group:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:W,data:E.computedData})}).on("mousemove",(W,j)=>{W.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:E.highlightTarget,datum:j,gridIndex:j.gridIndex,series:E.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,group:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:W,data:E.computedData})}).on("mouseout",(W,j)=>{W.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:E.highlightTarget,datum:j,gridIndex:j.gridIndex,series:E.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,group:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:W,data:E.computedData})}).on("click",(W,j)=>{W.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:E.highlightTarget,datum:j,gridIndex:j.gridIndex,series:E.SeriesDataMap.get(j.seriesLabel),seriesIndex:j.seriesIndex,seriesLabel:j.seriesLabel,group:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:W,data:E.computedData})})}),O({barSelection:F,highlight:m.pipe(L(E=>E.map(W=>W.id))),fullChartParams:h}).pipe(C(x),z(async E=>E)).subscribe(E=>{pB({selection:E.barSelection,ids:E.highlight,fullChartParams:E.fullChartParams})}),()=>{x.next(void 0)}},kv="BarsTriangle",gB=ct({name:kv,defaultParams:wg,layerIndex:5,validator:(e,{validateColumns:t})=>t(e,{barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},linearGradientOpacity:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=Mv(kv,{selection:e,computedData$:r.computedData$,computedAxesData$:r.computedAxesData$,visibleComputedData$:r.visibleComputedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,fullDataFormatter$:r.fullDataFormatter$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,event$:n.event$});return()=>{i.next(void 0),o()}});function dB({graphicGSelection:e,circleGClassName:t,circleClassName:n,visibleComputedAxesData:r,fullParams:i,fullChartParams:o,graphicReverseScale:a}){const s=c=>{const h=c.size();return o.transitionDuration/h};let l=0;return e.each((c,h,f)=>{X(f[h]).selectAll("g").data(r[h],p=>p.id).join(p=>(l=s(p),p.append("g").classed(t,!0)),p=>p,p=>p.remove()).attr("transform",p=>`translate(${p.axisX}, ${p.axisY})`).each((p,d,m)=>{X(m[d]).selectAll("circle").data([p]).join(g=>g.append("circle").style("cursor","pointer").style("vector-effect","non-scaling-stroke").classed(n,!0).attr("opacity",0).transition().delay((y,b)=>d*l).attr("opacity",1),g=>g.transition().duration(50).attr("opacity",1),g=>g.remove()).attr("r",i.radius).attr("fill",(g,y)=>Se({datum:g,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(g,y)=>Se({datum:g,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${a[h][0]??1}, ${a[h][1]??1})`)})}),e.selectAll(`circle.${n}`)}function mB({selection:e,ids:t,onlyShowHighlighted:n,fullChartParams:r}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").duration(200).style("opacity",n===!0?0:1);return}e.each((i,o,a)=>{t.includes(i.id)?X(a[o]).style("opacity",1).transition("highlight").duration(200):X(a[o]).style("opacity",n===!0?0:r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function yB({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join("rect").attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}const Rv=(e,{selection:t,computedData$:n,computedAxesData$:r,visibleComputedData$:i,visibleComputedAxesData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullChartParams$:c,gridAxesTransform$:h,gridGraphicTransform$:f,gridGraphicReverseScale$:p,gridAxesSize$:d,gridHighlight$:m,gridContainerPosition$:g,event$:y})=>{const b=new Q,x=Oe(e,"clipPath-box"),$=H(e,"circleG"),S=H(e,"circle"),{seriesSelection$:_,axesSelection$:A,defsSelection$:w,graphicGSelection$:P}=wr({selection:t,pluginName:e,clipPathID:x,seriesLabels$:a,gridContainerPosition$:g,gridAxesTransform$:h,gridGraphicTransform$:f}),I=O({computedData:n,gridGraphicReverseScale:p}).pipe(C(b),z(async D=>D),L(D=>D.computedData.map((T,M)=>D.gridGraphicReverseScale[M])));O({defsSelection:w,gridAxesSize:d}).pipe(C(b),z(async D=>D)).subscribe(D=>{const T=[{id:x,width:D.gridAxesSize.width,height:D.gridAxesSize.height}];yB({defsSelection:D.defsSelection,clipPathData:T})});const v=c.pipe(C(b),L(D=>D.highlightTarget),q()),N=O({graphicGSelection:P,visibleComputedAxesData:o,graphicReverseScale:I,fullChartParams:c,fullParams:u}).pipe(C(b),z(async D=>D),L(D=>dB({graphicGSelection:D.graphicGSelection,circleGClassName:$,circleClassName:S,visibleComputedAxesData:D.visibleComputedAxesData,fullParams:D.fullParams,fullChartParams:D.fullChartParams,graphicReverseScale:D.graphicReverseScale})));O({graphicSelection:N,computedData:n,SeriesDataMap:s,GroupDataMap:l,highlightTarget:v}).pipe(C(b),z(async D=>D)).subscribe(D=>{D.graphicSelection.on("mouseover",(T,M)=>{y.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:D.highlightTarget,datum:M,gridIndex:M.gridIndex,series:D.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,group:D.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:T,data:D.computedData})}).on("mousemove",(T,M)=>{y.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:D.highlightTarget,data:D.computedData,datum:M,gridIndex:M.gridIndex,series:D.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,group:D.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:T})}).on("mouseout",(T,M)=>{y.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:D.highlightTarget,datum:M,gridIndex:M.gridIndex,series:D.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,group:D.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:T,data:D.computedData})}).on("click",(T,M)=>{y.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:D.highlightTarget,datum:M,gridIndex:M.gridIndex,series:D.SeriesDataMap.get(M.seriesLabel),seriesIndex:M.seriesIndex,seriesLabel:M.seriesLabel,group:D.GroupDataMap.get(M.groupLabel),groupIndex:M.groupIndex,groupLabel:M.groupLabel,event:T,data:D.computedData})})});const R=u.pipe(C(b),L(D=>D.onlyShowHighlighted),q());return O({graphicSelection:N,highlight:m.pipe(L(D=>D.map(T=>T.id))),onlyShowHighlighted:R,fullChartParams:c}).pipe(C(b),z(async D=>D)).subscribe(D=>{mB({selection:D.graphicSelection,ids:D.highlight,onlyShowHighlighted:D.onlyShowHighlighted,fullChartParams:D.fullChartParams})}),()=>{b.next(void 0)}},Iv="Dots",bB=ct({name:Iv,defaultParams:_g,layerIndex:yu,validator:(e,{validateColumns:t})=>t(e,{radius:{toBeTypes:["number"]},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},onlyShowHighlighted:{toBeTypes:["boolean"]}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=Rv(Iv,{selection:e,computedData$:r.computedData$,computedAxesData$:r.computedAxesData$,visibleComputedData$:r.visibleComputedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,GroupDataMap$:r.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,event$:n.event$});return()=>{i.next(void 0),o()}}),xB=" - ",$B={listRectWidth:14,listRectHeight:14,listRectRadius:0};function Ev(e,t){const n=e<t.colors[t.colorScheme].label.length?e:e%t.colors[t.colorScheme].label.length;return t.colors[t.colorScheme].label[n]}const Ii=(e,{rootSelection:t,legendLabels$:n,fullParams$:r,layout$:i,fullChartParams$:o,textSizePx$:a})=>{const s=H(e,"root-position"),l=H(e,"legend-card"),u=H(e,"legend-list"),c=H(e,"legend-item"),h=new Q,f=O({legendLabels:n,fullChartParams:o}).pipe(C(h),z(async v=>v),L(v=>{const N=new Map;let R=0;return v.legendLabels.forEach((D,T)=>{if(!N.has(D)){const M=Ev(R,v.fullChartParams);N.set(D,M),R++}}),N})),p=n.pipe(C(h),L(v=>{const N=new Set;let R=[];return v.forEach(D=>{N.has(D)?R.push(!1):R.push(!0),N.add(D)}),R})),d=r.pipe(C(h),L(v=>v.placement==="top"||v.placement==="top-start"||v.placement==="top-end"?"top":v.placement==="bottom"||v.placement==="bottom-start"||v.placement==="bottom-end"?"bottom":v.placement==="left"||v.placement==="left-start"||v.placement==="left-end"?"left":"right"),q((v,N)=>v===N),ne(1)),m=r.pipe(C(h),L(v=>v.placement==="top-start"||v.placement==="bottom-start"||v.placement==="left-start"||v.placement==="right-start"?"start":v.placement==="top-end"||v.placement==="bottom-end"||v.placement==="left-end"||v.placement==="right-end"?"end":(v.placement==="top"||v.placement==="bottom"||v.placement==="left"||v.placement==="right","center")),q((v,N)=>v===N),ne(1)),g=d.pipe(C(h),L(v=>v==="bottom"||v==="top"?"row":"column"),q((v,N)=>v===N),ne(1)),y=O({fullParams:r,position:d,layout:i}).pipe(C(h),z(async v=>v),L(v=>{const N=v.fullParams.padding*2+v.fullParams.gap*2;return v.position==="bottom"||v.position==="top"?v.layout.rootWidth-N:v.layout.rootHeight-N})),x=O({layout:i,position:d,justify:m}).pipe(C(h),z(async v=>v),L(v=>{let N=0,R=0;return v.position==="bottom"?(R=v.layout.rootHeight,v.justify==="start"?N=0:v.justify==="center"?N=v.layout.rootWidth/2:v.justify==="end"&&(N=v.layout.rootWidth)):v.position==="right"?(N=v.layout.rootWidth,v.justify==="start"?R=0:v.justify==="center"?R=v.layout.rootHeight/2:v.justify==="end"&&(R=v.layout.rootHeight)):v.position==="top"?(R=0,v.justify==="start"?N=0:v.justify==="center"?N=v.layout.rootWidth/2:v.justify==="end"&&(N=v.layout.rootWidth)):v.position==="left"&&(N=0,v.justify==="start"?R=0:v.justify==="center"?R=v.layout.rootHeight/2:v.justify==="end"&&(R=v.layout.rootHeight)),{x:N,y:R}})).pipe(C(h),L(v=>t.selectAll(`g.${s}`).data([v]).join(N=>N.append("g").classed(s,!0).attr("transform",R=>`translate(${R.x}, ${R.y})`),N=>N.transition().attr("transform",R=>`translate(${R.x}, ${R.y})`),N=>N.remove()))),$=r.pipe(C(h),L(v=>v.labelList[0]?v.labelList[0]:$B)),S=O({visibleList:p,fullParams:r,fullChartParams:o,legendLabels:n,lineDirection:g,lineMaxSize:y,defaultListStyle:$,SeriesLabelColorMap:f,textSizePx:a}).pipe(C(h),z(async v=>v),L(v=>v.legendLabels.reduce((N,R,D)=>{if(!v.visibleList[D])return N;const T=R!==""?R:xB,M=Mi(T,v.textSizePx),G=v.textSizePx*1.5+M,k=v.SeriesLabelColorMap.get(R),B=N[0]&&N[0][0]?N[N.length-1][N[N.length-1].length-1]:null,{translateX:F,translateY:E,lineIndex:W,itemIndex:j}=((V,ee,Y)=>{let J=0,K=0,ie=0,le=0;if(V.lineDirection==="column"){let Z=Y?Y.translateY+V.textSizePx+V.fullParams.gap:0;if(Z+V.textSizePx>V.lineMaxSize){ie=Y.lineIndex+1,le=0,K=0;const ye=ee[ee.length-1].reduce((he,Re)=>Re.itemWidth>he?Re.itemWidth:he,0);J=Y.translateX+ye+V.fullParams.gap}else ie=Y?Y.lineIndex:0,le=Y?Y.itemIndex+1:0,K=Z,J=Y?Y.translateX:0}else{let Z=Y?Y.translateX+Y.itemWidth+V.fullParams.gap:0;Z+G>V.lineMaxSize?(ie=Y.lineIndex+1,le=0,J=0):(ie=Y?Y.lineIndex:0,le=Y?Y.itemIndex+1:0,J=Z),K=(V.textSizePx+V.fullParams.gap)*ie}return{translateX:J,translateY:K,lineIndex:ie,itemIndex:le}})(v,N,B);N[W]||(N[W]=[]);const te=v.fullParams.labelList[j]?v.fullParams.labelList[j]:v.defaultListStyle;return N[W].push({id:T,seriesLabel:T,seriesIndex:D,lineIndex:W,itemIndex:j,text:T,itemWidth:G,translateX:F,translateY:E,color:k,listRectWidth:te.listRectWidth,listRectHeight:te.listRectHeight,listRectRadius:te.listRectRadius}),N},[])),ne(1)),_=O({fullParams:r,fullChartParams:o,lineDirection:g,lengendItems:S,textSizePx:a}).pipe(C(h),z(async v=>v),L(v=>{const{width:N,height:R}=((D,T)=>{let M=0,G=0;if(!T.length||!T[0].length)return{width:M,height:G};const k=T[0][T[0].length-1];return D.lineDirection==="column"?(M=T.reduce((B,F)=>{const E=F.reduce((W,j)=>j.itemWidth>W?j.itemWidth:W,0);return B+E},0),M+=D.fullParams.gap*(T.length-1),G=k.translateY+D.textSizePx):(M=k.translateX+k.itemWidth,G=D.textSizePx*T.length+D.fullParams.gap*(T.length-1)),{width:M,height:G}})(v,v.lengendItems);return{direction:v.lineDirection,width:N,height:R,translateX:v.fullParams.gap,translateY:v.fullParams.gap}}),ne(1)),A=O({fullParams:r,position:d,justify:m,lengendList:_}).pipe(C(h),z(async v=>v),L(v=>{const N=v.lengendList.width+v.fullParams.gap*2,R=v.lengendList.height+v.fullParams.gap*2;let D=0,T=0;return v.position==="left"?v.justify==="start"?(D=v.fullParams.padding,T=v.fullParams.padding):v.justify==="center"?(D=v.fullParams.padding,T=-R/2):v.justify==="end"&&(D=v.fullParams.padding,T=-R-v.fullParams.padding):v.position==="right"?v.justify==="start"?(D=-N-v.fullParams.padding,T=v.fullParams.padding):v.justify==="center"?(D=-N-v.fullParams.padding,T=-R/2):v.justify==="end"&&(D=-N-v.fullParams.padding,T=-R-v.fullParams.padding):v.position==="top"?v.justify==="start"?(D=v.fullParams.padding,T=v.fullParams.padding):v.justify==="center"?(D=-N/2,T=v.fullParams.padding):v.justify==="end"&&(D=-N-v.fullParams.padding,T=v.fullParams.padding):v.justify==="start"?(D=v.fullParams.padding,T=-R-v.fullParams.padding):v.justify==="center"?(D=-N/2,T=-R-v.fullParams.padding):v.justify==="end"&&(D=-N-v.fullParams.padding,T=-R-v.fullParams.padding),{width:N,height:R,translateX:D,translateY:T}})),w=O({rootPositionSelection:x,fullParams:r,fullChartParams:o,legendCard:A}).pipe(C(h),z(async v=>v),L(v=>v.rootPositionSelection.selectAll("g").data([v.legendCard]).join(N=>N.append("g").classed(l,!0).attr("transform",R=>`translate(${R.translateX}, ${R.translateY})`),N=>N.transition().attr("transform",R=>`translate(${R.translateX}, ${R.translateY})`),N=>N.remove()).each((N,R,D)=>{X(D[R]).selectAll("rect").data([N]).join("rect").attr("width",T=>T.width).attr("height",T=>T.height).attr("fill",pe(v.fullParams.backgroundFill,v.fullChartParams)).attr("stroke",pe(v.fullParams.backgroundStroke,v.fullChartParams))}))),P=O({lengendCardSelection:w,fullParams:r,lengendList:_}).pipe(C(h),z(async v=>v),L(v=>v.lengendCardSelection.selectAll("g").data([v.lengendList]).join(N=>N.append("g").classed(u,!0).attr("transform",R=>`translate(${R.translateX}, ${R.translateY})`),N=>N.transition().attr("transform",R=>`translate(${R.translateX}, ${R.translateY})`),N=>N.remove())));return O({lengendListSelection:P,fullParams:r,fullChartParams:o,lengendItems:S,textSizePx:a}).pipe(C(h),z(async v=>v),L(v=>{const N=v.lengendItems[0]?v.lengendItems.flat():[];return v.lengendListSelection.selectAll(`g.${c}`).data(N).join(R=>R.append("g").classed(c,!0).attr("cursor","default"),R=>R,R=>R.remove()).attr("transform",(R,D)=>`translate(${R.translateX}, ${R.translateY})`).each((R,D,T)=>{const M=v.textSizePx/2,G=-R.listRectWidth/2,k=-R.listRectHeight/2;X(T[D]).selectAll("rect").data([R]).join("rect").attr("x",M).attr("y",M).attr("width",B=>B.listRectWidth).attr("height",B=>B.listRectHeight).attr("transform",B=>`translate(${G}, ${k})`).attr("fill",B=>B.color).attr("rx",B=>B.listRectRadius),X(T[D]).selectAll("text").data([R]).join(B=>B.append("text").attr("dominant-baseline","hanging"),B=>B,B=>B.remove()).attr("x",v.textSizePx*1.5).attr("font-size",v.fullChartParams.styles.textSize).attr("fill",B=>v.fullParams.textColorType==="label"?Ev(B.seriesIndex,v.fullChartParams):pe(v.fullParams.textColorType,v.fullChartParams)).text(B=>B.text)})})).subscribe(),()=>{t.select(`g.${s}`).remove(),h.next(void 0)}},Bv="GridLegend",vB=ct({name:Bv,defaultParams:Cg,layerIndex:ki,validator:(e,{validateColumns:t})=>t(e,{placement:{toBe:'"top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end"',test:r=>["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].includes(r)},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:e,rootSelection:t,observer:n,subject:r})=>{const i=new Q,o=n.fullParams$.pipe(C(i),L(s=>{const l=[{listRectWidth:s.listRectWidth,listRectHeight:s.listRectHeight,listRectRadius:s.listRectRadius}];return{...s,labelList:l}})),a=Ii(Bv,{rootSelection:t,legendLabels$:n.seriesLabels$,fullParams$:o,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),a()}});function Nv(e,{text:t,radius:n,lineHeight:r,isBreakAll:i=!1,limit:o=0}){if(e==null||t==null){console.error("selection or text is not defined");return}n==null&&(n=e.node().getBBox().width/2);function a(p){let d;return i?d=p.split(""):d=p.split(/\s+/g),d[d.length-1]||d.pop(),d[0]||d.shift(),d}function s(p,d){return p&&d&&p.length>d&&(p=p.substring(0,d)+"..."),p}function l(p){var m;const d=document.createElement("canvas").getContext("2d");return((m=d==null?void 0:d.measureText(p))==null?void 0:m.width)??0}function u(p){const d=l(p.trim());return Math.sqrt(d*r)}function c(p,d){let m={width:0,text:""},g=1/0;const y=[];let b=" ";i&&(b="");for(let x=0,$=p.length;x<$;++x){const S=(m.text?m.text+b:"")+p[x],_=l(S);(g+_)/2<d?(m.width=g=_,m.text=S):(g=l(p[x]),m={width:g,text:p[x]},y.push(m))}return y}function h(p){let d=0;for(let m=0,g=p.length;m<g;++m){const y=(Math.abs(m-g/2+.5)+.5)*r,b=p[m].width/2;d=Math.max(d,Math.sqrt(b**2+y**2))}return d}function f(p,d){o>0&&(d=s(d,o));const m=a(d),g=u(d),y=c(m,g),b=h(y);let x=p.select("text");x.size()||(x=p.append("text")),x.attr("transform",`translate(0,0) scale(${n/b})`);const $=x.selectAll("tspan").data(y),S=$.enter().append("tspan").attr("x",0).merge($).attr("y",(_,A)=>(A-y.length/2+.8)*r).text(_=>_.text);return $.exit().remove(),$.merge(S)}return f(e,t)}function ma(e,{textArr:t,textSizePx:n,groupAxisPosition:r,isContainerRotated:i}){e.text(null);const o=Number(e.attr("x"));let a=Number(e.attr("y"));i&&r==="top"&&(a-=(t.length-1)*n),e.selectAll("tspan").data(t).join("tspan").attr("x",o).attr("y",(s,l)=>a+l*n).text(s=>s)}function Fv(e,{textArr:t,textSizePx:n,quadrant:r}){e.selectAll("tspan").data(t).join("tspan").attr("x",0).attr("y",(i,o)=>r==1||r==2?-(t.length-1-o)*n:o*n).text(i=>i)}const Rp=6;function SB(e,t){return e.map((n,r)=>{const i=rn(n,t),o=typeof i=="string"?i.split(`
62
+ `):[i];return{text:i,textArr:o}})}function TB({selection:e,groupingLabelClassName:t,fullParams:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,textReverseTransform:s}){const l=n.tickPadding+n.labelOffset[0],u=n.tickPadding+n.labelOffset[1];let c=0,h=0;o.groupAxis.position==="bottom"?(h=u,o.valueAxis.position==="left"?c=l:o.valueAxis.position==="right"&&(c=-l)):o.groupAxis.position==="top"?(h=-u,o.valueAxis.position==="left"?c=l:o.valueAxis.position==="right"&&(c=-l)):o.groupAxis.position==="left"?(c=-l,o.valueAxis.position==="bottom"?h=-u:o.valueAxis.position==="top"&&(h=u)):o.groupAxis.position==="right"&&(c=l,o.valueAxis.position==="bottom"?h=-u:o.valueAxis.position==="top"&&(h=u)),e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).each((f,p,d)=>{X(d[p]).selectAll("text").data([f]).join(m=>m.append("text").style("font-weight","bold"),m=>m,m=>m.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("font-size",a.styles.textSize).style("fill",pe(n.labelColorType,a)).style("transform",s).attr("x",c).attr("y",h).text(m=>o.groupAxis.label)}).attr("transform",f=>`translate(${i.width}, 0)`)}function _B({selection:e,xAxisClassName:t,fullParams:n,tickTextAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,groupScale:s,groupScaleDomain:l,groupLabelData:u,textReverseTransformWithRotate:c,textSizePx:h}){const f=e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0),p=Math.floor(l[1])-Math.ceil(l[0])+1;let d=0,m=0;o.groupAxis.position==="left"?(d=0,m=-n.tickPadding):o.groupAxis.position==="right"?(d=0,m=n.tickPadding):o.groupAxis.position==="bottom"?(n.tickFullLine==!0?d=-n.tickPadding:d=-n.tickPadding-Rp,m=0):o.groupAxis.position==="top"&&(n.tickFullLine==!0?d=n.tickPadding:d=n.tickPadding-Rp,m=-0);const g=hs(s).scale(s).ticks(n.ticks==="all"||n.ticks>p?p:n.ticks).tickSize(n.tickFullLine==!0?-i.height:Rp).tickSizeOuter(0).tickFormat(x=>{var $;return(($=u[x])==null?void 0:$.text)??""}).tickPadding(d),y=f.transition().duration(100).ease(Ft).call(g).on("end",(x,$)=>{f.selectAll(".tick text").each((S,_,A)=>{var P;const w=((P=u[S])==null?void 0:P.textArr)??[];ma(X(A[_]),{textArr:w,textSizePx:h,groupAxisPosition:o.groupAxis.position,isContainerRotated:!0})})});return y.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?pe(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).style("vector-effect","non-scaling-stroke").attr("pointer-events","none"),y.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?pe(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges"),f.selectAll("text").attr("font-size",a.styles.textSize).attr("fill",pe(n.tickTextColorType,a)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("x",m).style("transform",c).attr("dy",0),f}const zv=(e,{selection:t,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,gridAxesTransform$:a,gridAxesReverseTransform$:s,gridAxesSize$:l,gridContainerPosition$:u,isSeriesSeprate$:c,textSizePx$:h})=>{const f=new Q,p=H(e,"container"),d=H(e,"xAxisG"),m=H(e,"xAxis"),g=H(e,"groupingLabel"),y=O({computedData:n.pipe(q((v,N)=>v.length===N.length)),isSeriesSeprate:c}).pipe(C(f),z(async v=>v),L(v=>v.isSeriesSeprate?v.computedData:[v.computedData[0]]),L((v,N)=>t.selectAll(`g.${p}`).data(v,R=>R&&R[0]?R[0].seriesIndex:N).join("g").classed(p,!0))),b=y.pipe(C(f),L((v,N)=>v.selectAll(`g.${d}`).data([d]).join("g").classed(d,!0)));O({containerSelection:y,gridContainerPosition:u}).pipe(C(f),z(async v=>v)).subscribe(v=>{v.containerSelection.attr("transform",(N,R)=>{const D=v.gridContainerPosition[R]??v.gridContainerPosition[0],T=D.translate,M=D.scale;return`translate(${T[0]}, ${T[1]}) scale(${M[0]}, ${M[1]})`})}),O({axisSelection:b,gridAxesTransform:a}).pipe(C(f),z(async v=>v)).subscribe(v=>{v.axisSelection.style("transform",v.gridAxesTransform.value)});const x=O({gridAxesReverseTransform:s,gridContainerPosition:u}).pipe(C(f),z(async v=>v),L(v=>{const N=`rotateX(${v.gridAxesReverseTransform.rotateX}deg) rotateY(${v.gridAxesReverseTransform.rotateY}deg)`,R=`rotate(${v.gridAxesReverseTransform.rotate}deg)`,D=`scale(${1/v.gridContainerPosition[0].scale[0]}, ${1/v.gridContainerPosition[0].scale[1]})`;return`${N} ${R} ${D}`}),q()),$=O({textReverseTransform:x,fullParams:r}).pipe(C(f),z(async v=>v),L(v=>`${v.textReverseTransform} rotate(${v.fullParams.tickTextRotate}deg)`)),S=O({fullDataFormatter:i,gridAxesSize:l,computedData:n}).pipe(C(f),z(async v=>v),L(v=>{const N=v.computedData[0]?v.computedData[0].length-1:0,R=v.fullDataFormatter.groupAxis.scaleDomain[0]-v.fullDataFormatter.groupAxis.scalePadding,D=v.fullDataFormatter.groupAxis.scaleDomain[1]==="max"?N+v.fullDataFormatter.groupAxis.scalePadding:v.fullDataFormatter.groupAxis.scaleDomain[1]+v.fullDataFormatter.groupAxis.scalePadding;return[R,D]}),ne(1)),_=O({groupScaleDomain:S,gridAxesSize:l}).pipe(C(f),z(async v=>v),L(v=>Nn().domain(v.groupScaleDomain).range([0,v.gridAxesSize.width]))),A=n.pipe(L(v=>(v[0]??[]).map(N=>N.groupLabel))),w=O({fullDataFormatter:i,fullParams:r}).pipe(C(f),z(async v=>v),L(v=>{let N="middle",R="hanging";return v.fullDataFormatter.groupAxis.position==="bottom"?(N=v.fullParams.tickTextRotate?"end":"middle",R="hanging"):v.fullDataFormatter.groupAxis.position==="top"?(N=v.fullParams.tickTextRotate?"start":"middle",R="auto"):v.fullDataFormatter.groupAxis.position==="left"?(N="end",R="middle"):v.fullDataFormatter.groupAxis.position==="right"&&(N="start",R="middle"),{textAnchor:N,dominantBaseline:R}})),P=i.pipe(C(f),L(v=>{let N="start",R="hanging";return v.groupAxis.position==="bottom"?R="hanging":v.groupAxis.position==="top"?R="auto":v.groupAxis.position==="left"?N="end":v.groupAxis.position==="right"&&(N="start"),v.valueAxis.position==="left"?N="start":v.valueAxis.position==="right"?N="end":v.valueAxis.position==="bottom"?R="auto":v.valueAxis.position==="top"&&(R="hanging"),{textAnchor:N,dominantBaseline:R}})),I=O({groupLabels:A,fullParams:r}).pipe(C(f),z(async v=>v),L(v=>SB(v.groupLabels,v.fullParams.tickFormat)));return O({axisSelection:b,fullParams:r,tickTextAlign:w,axisLabelAlign:P,gridAxesSize:l,fullDataFormatter:i,chartParams:o,groupScale:_,groupScaleDomain:S,groupLabelData:I,textReverseTransform:x,textReverseTransformWithRotate:$,textSizePx:h}).pipe(C(f),z(async v=>v)).subscribe(v=>{_B({selection:v.axisSelection,xAxisClassName:m,fullParams:v.fullParams,tickTextAlign:v.tickTextAlign,gridAxesSize:v.gridAxesSize,fullDataFormatter:v.fullDataFormatter,chartParams:v.chartParams,groupScale:v.groupScale,groupScaleDomain:v.groupScaleDomain,groupLabelData:v.groupLabelData,textReverseTransformWithRotate:v.textReverseTransformWithRotate,textSizePx:v.textSizePx}),TB({selection:v.axisSelection,groupingLabelClassName:g,fullParams:v.fullParams,axisLabelAlign:v.axisLabelAlign,gridAxesSize:v.gridAxesSize,fullDataFormatter:v.fullDataFormatter,chartParams:v.chartParams,textReverseTransform:v.textReverseTransform})}),()=>{f.next(void 0)}},Ov="GroupAxis",AB=ct({name:Ov,defaultParams:wu,layerIndex:Ct,validator:(e,{validateColumns:t})=>t(e,{labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBe:'number | null | "all"',test:r=>r===null||r==="all"||typeof r=="number"}})})(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=zv(Ov,{selection:e,computedData$:n.computedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),o()}}),wB=6;function PB({selection:e,textClassName:t,fullParams:n,axisLabelAlign:r,gridAxesSize:i,fullDataFormatter:o,fullChartParams:a,textReverseTransform:s}){const l=n.tickPadding-n.labelOffset[0],u=n.tickPadding+n.labelOffset[1];let c=0,h=0;o.groupAxis.position==="bottom"?(h=-u,o.valueAxis.position==="left"?c=-l:o.valueAxis.position==="right"&&(c=l)):o.groupAxis.position==="top"?(h=u,o.valueAxis.position==="left"?c=-l:o.valueAxis.position==="right"&&(c=l)):o.groupAxis.position==="left"?(c=l,o.valueAxis.position==="bottom"?h=u:o.valueAxis.position==="top"&&(h=-u)):o.groupAxis.position==="right"&&(c=-l,o.valueAxis.position==="bottom"?h=u:o.valueAxis.position==="top"&&(h=-u)),e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).each((f,p,d)=>{X(d[p]).selectAll("text").data([f]).join(m=>m.append("text").style("font-weight","bold"),m=>m,m=>m.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("font-size",a.styles.textSize).style("fill",pe(n.labelColorType,a)).style("transform",s).attr("x",c).attr("y",h).text(m=>o.valueAxis.label)}).attr("transform",f=>`translate(0, ${i.height})`)}function DB({selection:e,yAxisClassName:t,fullParams:n,tickTextAlign:r,gridAxesSize:i,fullDataFormatter:o,fullChartParams:a,valueScale:s,textReverseTransformWithRotate:l,filteredMinMaxValue:u}){const c=e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0);let h=0,f=0;o.valueAxis.position==="left"?(h=n.tickPadding,f=0):o.valueAxis.position==="right"?(h=-n.tickPadding,f=0):o.valueAxis.position==="bottom"?(h=0,f=n.tickPadding):o.valueAxis.position==="top"&&(h=0,f=-n.tickPadding);const p=Nc(s).scale(s).ticks(n.ticks).tickFormat(g=>rn(g,n.tickFormat)).tickSize(n.tickFullLine==!0?-i.width:wB).tickPadding(h),d=c.transition().duration(100).ease(Ft).call(p);d.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?pe(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).style("vector-effect","non-scaling-stroke").attr("pointer-events","none"),d.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?pe(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges");const m=c.selectAll("text").attr("font-size",a.styles.textSize).style("color",pe(n.tickTextColorType,a)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("y",f).attr("dy",0);return m.style("transform",l),(o.valueAxis.position==="bottom"||o.valueAxis.position==="top")&&m.attr("dy",0),c}const Ei=(e,{selection:t,computedData$:n,filteredMinMaxValue$:r,fullParams$:i,fullDataFormatter$:o,fullChartParams$:a,gridAxesSize$:s,gridAxesTransform$:l,gridAxesReverseTransform$:u,gridContainerPosition$:c,isSeriesSeprate$:h})=>{const f=new Q,p=H(e,"yAxisG"),d=H(e,"yAxis"),m=H(e,"text"),y=ME({selection:t,pluginName:e,computedData$:n,gridContainerPosition$:c,isSeriesSeprate$:h}).pipe(C(f),L((A,w)=>A.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));O({axisSelection:y,gridAxesTransform:l}).pipe(C(f),z(async A=>A)).subscribe(A=>{A.axisSelection.style("transform",A.gridAxesTransform.value)});const b=O({gridAxesReverseTransform:u,gridContainerPosition:c}).pipe(C(f),z(async A=>A),L(A=>{const w=`rotateX(${A.gridAxesReverseTransform.rotateX}deg) rotateY(${A.gridAxesReverseTransform.rotateY}deg)`,P=`rotate(${A.gridAxesReverseTransform.rotate}deg)`,I=`scale(${1/A.gridContainerPosition[0].scale[0]}, ${1/A.gridContainerPosition[0].scale[1]})`;return`${w} ${P} ${I}`}),q()),x=O({textReverseTransform:b,fullParams:i}).pipe(C(f),z(async A=>A),L(A=>`${A.textReverseTransform} rotate(${A.fullParams.tickTextRotate}deg)`)),$=new me(A=>{O({fullDataFormatter:o,gridAxesSize:s,filteredMinMaxValue:r}).pipe(C(f),z(async w=>w)).subscribe(w=>{let P=w.filteredMinMaxValue[1],I=w.filteredMinMaxValue[0];P===I&&P===0&&(P=1);const v=Sc({maxValue:P,minValue:I,axisWidth:w.gridAxesSize.height,scaleDomain:w.fullDataFormatter.valueAxis.scaleDomain,scaleRange:w.fullDataFormatter.valueAxis.scaleRange});A.next(v)})}),S=O({fullDataFormatter:o,fullParams:i}).pipe(C(f),z(async A=>A),L(A=>{let w="start",P="hanging";return A.fullDataFormatter.valueAxis.position==="left"?(w="end",P="middle"):A.fullDataFormatter.valueAxis.position==="right"?(w="start",P="middle"):A.fullDataFormatter.valueAxis.position==="bottom"?(w=A.fullParams.tickTextRotate?"end":"middle",P="hanging"):A.fullDataFormatter.valueAxis.position==="top"&&(w=A.fullParams.tickTextRotate?"start":"middle",P="auto"),{textAnchor:w,dominantBaseline:P}})),_=o.pipe(C(f),L(A=>{let w="start",P="hanging";return A.groupAxis.position==="bottom"?P="auto":A.groupAxis.position==="top"?P="hanging":A.groupAxis.position==="left"?w="start":A.groupAxis.position==="right"&&(w="end"),A.valueAxis.position==="left"?w="end":A.valueAxis.position==="right"?w="start":A.valueAxis.position==="bottom"?P="hanging":A.valueAxis.position==="top"&&(P="auto"),{textAnchor:w,dominantBaseline:P}}));return O({axisSelection:y,fullParams:i,tickTextAlign:S,axisLabelAlign:_,computedData:n,gridAxesSize:s,fullDataFormatter:o,fullChartParams:a,valueScale:$,textReverseTransform:b,textReverseTransformWithRotate:x,filteredMinMaxValue:r}).pipe(C(f),z(async A=>A)).subscribe(A=>{DB({selection:A.axisSelection,yAxisClassName:d,fullParams:A.fullParams,tickTextAlign:A.tickTextAlign,gridAxesSize:A.gridAxesSize,fullDataFormatter:A.fullDataFormatter,fullChartParams:A.fullChartParams,valueScale:A.valueScale,textReverseTransformWithRotate:A.textReverseTransformWithRotate,filteredMinMaxValue:A.filteredMinMaxValue}),PB({selection:A.axisSelection,textClassName:m,fullParams:A.fullParams,axisLabelAlign:A.axisLabelAlign,gridAxesSize:A.gridAxesSize,fullDataFormatter:A.fullDataFormatter,fullChartParams:A.fullChartParams,textReverseTransform:A.textReverseTransform})}),()=>{f.next(void 0)}},Gv="ValueAxis",CB=ct({name:Gv,defaultParams:Ta,layerIndex:Ct,validator:(e,{validateColumns:t})=>t(e,{labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}})})(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=Ei(Gv,{selection:e,computedData$:n.computedData$,filteredMinMaxValue$:n.filteredMinMaxValue$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$});return()=>{i.next(void 0),o()}}),Wv="StackedValueAxis",LB=ct({name:Wv,defaultParams:Pg,layerIndex:Ct,validator:(e,{validateColumns:t})=>t(e,{labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}})})(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=Ei(Wv,{selection:e,computedData$:n.computedStackedData$,filteredMinMaxValue$:n.filteredMinMaxValue$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,gridAxesTransform$:n.gridAxesTransform$,gridAxesReverseTransform$:n.gridAxesReverseTransform$,gridAxesSize$:n.gridAxesSize$,gridContainerPosition$:n.gridContainerPosition$,isSeriesSeprate$:n.isSeriesSeprate$});return()=>{i.next(void 0),o()}});function Vv(e,t){const n=t.textSizePx*1.5,i=(e==null?[]:Array.isArray(e)?e:typeof e=="string"?e.split(`
63
63
  `):[e]).filter(o=>o!="").map((o,a)=>`<tspan x="0" y="${a*n}">${o}</tspan>`).join("");return i?`<text font-size="${t.textSize}" fill="${t.textColor}" x="0" y="0" style="dominant-baseline:text-before-edge">
64
64
  ${i}
65
- </text>`:""}function MB({rootSelection:e,pluginName:t,gClassName:n,boxClassName:r,rootWidth:i,rootHeight:o,svgString:a,tooltipStyle:s,event:l}){e.interrupt("fadeout");const u=5,c=a?[a]:[],h=a?[s]:[],p=e.selectAll(`g.${n}`).data(c).join(_=>_.append("g").classed(n,!0).attr("pointer-events","none"),_=>_,_=>_.style("opacity",0).remove()).attr("transform",()=>`translate(${l.offsetX}, ${l.offsetY})`).selectAll(`g.${r}`).data(h).join(_=>_.append("g").classed(H(t,"box"),!0)),g=p.selectAll("rect").data(h).join(_=>_.append("rect").attr("rx",u).attr("ry",u)).attr("fill",_=>_.backgroundColor).attr("stroke",_=>_.strokeColor).attr("opacity",_=>_.backgroundOpacity),m=p.selectAll("g").data(c).join(_=>_.append("g").classed(H(t,"content"),!0).attr("transform",()=>`translate(${s.padding}, ${s.padding})`));c.length&&CE(m,c[0]);const d=m!=null&&m.node()?dv(m):{width:0,height:0};g.attr("width",d.width+s.padding*2).attr("height",d.height+s.padding*2);const y=p!=null&&p.node()?dv(p):{width:0,height:0},b=i-y.width,x=o-y.height,$=l.offsetX+s.offset[0]>b?b-l.offsetX:s.offset[0],S=l.offsetY+s.offset[1]>x?x-l.offsetY:s.offset[1];p.attr("transform",_=>`translate(${$}, ${S})`),p.attr("transform",_=>`translate(${$}, ${S})`)}const Ei=(e,{rootSelection:t,fullParams$:n,fullChartParams$:r,layout$:i,event$:o})=>{const a=new Q,s=H(e,"g"),l=H(e,"box"),u=o.pipe(C(a),Er(b=>b.eventName==="mouseover"||b.eventName==="mousemove")),c=o.pipe(C(a),Er(b=>b.eventName==="mouseout")),h=dD(r),f=G({fullChartParams:r,fullParams:n,textSizePx:h}).pipe(C(a),z(async b=>b),L(b=>({backgroundColor:pe(b.fullParams.backgroundColorType,b.fullChartParams),backgroundOpacity:b.fullParams.backgroundOpacity,strokeColor:pe(b.fullParams.strokeColorType,b.fullChartParams),offset:b.fullParams.offset,padding:b.fullParams.padding,textSize:b.fullChartParams.styles.textSize,textSizePx:b.textSizePx,textColor:pe(b.fullParams.textColorType,b.fullChartParams),seriesColors:b.fullChartParams.colors[b.fullChartParams.colorScheme].label}))),p=G({fullParams:n,tooltipStyle:f}).pipe(C(a),z(async b=>b),L(b=>x=>{const $=b.fullParams.renderFn(x,{utils:{toCurrency:LE,measureTextWidth:Li},styles:b.tooltipStyle});if(typeof $=="string"){const S=$.trim();if(S.slice(0,1)==="<"&&S.slice(S.length-1,S.length)===">")return $;{const A=$.split(`
66
- `);return Vv(A,b.tooltipStyle)}}else if(Array.isArray($))return Vv($,b.tooltipStyle);return""})),g=G({event:u,contentRenderFn:p}).pipe(C(a),z(async b=>b),L(b=>b.contentRenderFn(b.event))),m=c.pipe(C(a),L(b=>"")),d=Vu(g,m).pipe(C(a),Z((b,x)=>b===x)),y=Vu(u,c).pipe(C(a),L(b=>b.event));return G({svgString:d,eventTooltip:y,layout:i,tooltipStyle:f}).pipe(C(a),z(async b=>b)).subscribe(b=>{MB({rootSelection:t,pluginName:e,gClassName:s,boxClassName:l,rootWidth:b.layout.rootWidth,rootHeight:b.layout.rootHeight,svgString:b.svgString,tooltipStyle:b.tooltipStyle,event:b.eventTooltip})}),()=>{a.next(void 0)}},Yv="GridTooltip",kB=ct({name:Yv,defaultParams:Pu,layerIndex:ki,validator:(e,{validateColumns:t})=>t(e,{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"},renderFn:{toBeTypes:["Function"]}})})(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q,a=Ei(Yv,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),RB=ct({name:"GroupZoom",defaultParams:Dg,layerIndex:Lp,validator:(e,{validateColumns:t})=>({status:"success",columnName:"",expectToBe:""})})(({selection:e,rootSelection:t,name:n,observer:r,subject:i})=>{const o=new Q;let a={k:1,x:0,y:0};const s=r.computedData$.pipe(L(c=>c[0]?c[0].length-1:0),Z()),l=r.fullDataFormatter$.pipe(L(c=>c.groupAxis),Yi()),u=G({initGroupAxis:l,groupMaxIndex:s,layout:r.layout$,axisSize:r.gridAxesSize$}).pipe(C(o),z(async c=>c),L(c=>{const h=c.initGroupAxis.scaleDomain[0]-c.initGroupAxis.scalePadding,f=c.initGroupAxis.scaleDomain[1]==="max"?c.groupMaxIndex+c.initGroupAxis.scalePadding:c.initGroupAxis.scaleDomain[1]+c.initGroupAxis.scalePadding;return Sc({maxValue:c.groupMaxIndex,minValue:0,axisWidth:c.axisSize.width,scaleDomain:[h,f],scaleRange:[0,1]})}));return G({initGroupScale:u,fullDataFormatter:r.fullDataFormatter$,groupMaxIndex:s}).pipe(C(o),z(async c=>c)).subscribe(c=>{const f=c.initGroupScale.copy(),p=Sn().on("zoom",function(m){const d=m.transform,y=$=>{const S=Math.round($);return Math.min(c.groupMaxIndex,Math.max(0,S))},b=c.fullDataFormatter.groupAxis.position==="bottom"||c.fullDataFormatter.groupAxis.position==="top"?d.rescaleX(f).domain().map(y):d.rescaleY(f).domain().map(y);b[0]<=0&&b[1]>=c.groupMaxIndex?d.k<a.k&&(d.k=a.k,d.x=a.x,d.y=a.y):b[1]-b[0]<=1&&d.k>a.k&&(d.k=a.k,d.x=a.x,d.y=a.y),a.k=d.k,a.x=d.x,a.y=d.y;const x={...c.fullDataFormatter,groupAxis:{...c.fullDataFormatter.groupAxis,scaleDomain:b}};i.dataFormatter$.next(x)});t.call(p)}),()=>{o.next(void 0),t.call(Sn().on("zoom",null))}}),xu="GroupAux",Ip=H(xu,"label-box"),Ep=6,Xv=3,IB={name:xu,defaultParams:Au,layerIndex:Mp,validator:(e,{validateColumns:t})=>t(e,{showLine:{toBeTypes:["boolean"]},showLabel:{toBeTypes:["boolean"]},lineDashArray:{toBeTypes:["string"]},lineColorType:{toBeOption:"ColorType"},labelColorType:{toBeOption:"ColorType"},labelTextColorType:{toBeOption:"ColorType"},labelTextFormat:{toBeTypes:["string","Function"]},labelPadding:{toBeTypes:["number"]},labelRotate:{toBeTypes:["number"]}})};function EB({groupLabel:e,axisX:t,axisHeight:n,fullParams:r}){return r.showLine&&e?[{id:e,x1:t,x2:t,y1:0,y2:n}]:[]}function BB({groupLabel:e,axisX:t,fullParams:n,textSizePx:r,rowAmount:i}){const o=rn(e,n.labelTextFormat),a=o.split(`
67
- `),s=a.reduce((c,h)=>h.length>c.length?h:c,""),l=Li(s,r),u=r*a.length;return n.showLabel&&e?[{id:e,x:t,y:-n.labelPadding*i,text:o,textArr:a,textWidth:l,textHeight:u}]:[]}function NB({selection:e,pluginName:t,lineData:n,fullParams:r,fullChartParams:i}){const o=H(t,"auxline");return e.selectAll(`line.${o}`).data(n).join(s=>s.append("line").classed(o,!0).style("stroke-width",1).style("pointer-events","none").style("vector-effect","non-scaling-stroke").attr("x1",l=>l.x1).attr("y1",l=>l.y1).attr("x2",l=>l.x2).attr("y2",l=>l.y2),s=>s.transition().duration(50).attr("x1",u=>u.x1).attr("y1",u=>u.y1).attr("x2",u=>u.x2).attr("y2",u=>u.y2),s=>s.remove()).style("stroke",s=>pe(r.lineColorType,i)).style("stroke-dasharray",r.lineDashArray??"none")}function FB(e){e.selectAll("line").data([]).exit().remove()}function zB({selection:e,labelData:t,fullParams:n,fullDataFormatter:r,fullChartParams:i,textReverseTransformWithRotate:o,textSizePx:a}){return e.selectAll(`g.${Ip}`).data(t).join(l=>l.append("g").classed(Ip,!0).style("cursor","pointer").attr("transform",(u,c)=>`translate(${u.x}, ${u.y})`),l=>l.transition().duration(50).attr("transform",(c,h)=>`translate(${c.x}, ${c.y})`),l=>l.remove()).each((l,u,c)=>{const h=X(c[u]),f=l.textWidth+Ep*2,p=l.textHeight+Xv*2;let g=-f/2,m=-2,d=g,y=m-3;r.groupAxis.position==="bottom"?(g=n.labelRotate?-f+p:-f/2,m=2,d=g,y=m-3):r.groupAxis.position==="left"?(g=-f+2,m=-p/2,d=g,y=m-3,n.labelRotate&&(y+=p)):r.groupAxis.position==="right"?(g=-2,m=-p/2,d=g,y=m-3,n.labelRotate&&(y+=p)):r.groupAxis.position==="top"&&(g=n.labelRotate?-f+p:-f/2,m=-p+6,d=-p,y=m-3);const b=h.selectAll("rect").data([l]).join(_=>_.append("rect").style("cursor","pointer").attr("rx",5).attr("ry",5),_=>_,_=>_.remove()).attr("width",_=>`${f}px`).attr("height",`${p}px`).attr("fill",_=>pe(n.labelColorType,i)).attr("x",d).attr("y",y).style("transform",o),x=h.selectAll("text").data([l]).join(_=>_.append("text").style("dominant-baseline","hanging").style("cursor","pointer"),_=>_,_=>_.remove()).style("transform",o).attr("fill",_=>pe(n.labelTextColorType,i)).attr("font-size",i.styles.textSize).attr("x",d+Ep).attr("y",y+Xv).each((_,A,w)=>{ma(X(w[A]),{textArr:l.textArr,textSizePx:a,groupAxisPosition:r.groupAxis.position,isContainerRotated:!1})});let $=[];x.selectAll("tspan").each((_,A,w)=>{const I=X(w[A]).node();I&&I.getBBox()&&$.push(I.getBBox().width)});const S=Math.max(...$);b.attr("width",S+Ep*2)})}function OB(e){e.selectAll(`g.${Ip}`).data([]).exit().remove()}const GB=ct(IB)(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q;let a=!1;const s=t.insert("rect","g").classed(H(xu,"rect"),!0).attr("opacity",0),{seriesSelection$:l,axesSelection$:u,defsSelection$:c,graphicGSelection$:h}=wr({selection:e,pluginName:xu,clipPathID:"test",seriesLabels$:i.isSeriesSeprate$.pipe(z(S=>wn(()=>S,i.seriesLabels$,i.seriesLabels$.pipe(L(_=>[_[0]]))))),gridContainerPosition$:i.gridContainerPosition$,gridAxesTransform$:i.gridAxesTransform$,gridGraphicTransform$:i.gridGraphicTransform$});i.layout$.pipe(C(o)).subscribe(S=>{s.attr("width",S.rootWidth).attr("height",S.rootHeight)});const f=G({groupScaleDomainValue:i.groupScaleDomainValue$,gridAxesSize:i.gridAxesSize$}).pipe(C(o),z(async S=>S),L(S=>Nn().domain(S.groupScaleDomainValue).range([0,S.gridAxesSize.width]))),p=i.fullChartParams$.pipe(C(o),L(S=>S.highlightTarget),Z()),g=Ar(t,"mousemove").pipe(C(o)),m=G({gridAxesReverseTransform:i.gridAxesReverseTransform$,gridContainerPosition:i.gridContainerPosition$}).pipe(C(o),z(async S=>S),L(S=>{const _=`rotateX(${S.gridAxesReverseTransform.rotateX}deg) rotateY(${S.gridAxesReverseTransform.rotateY}deg)`,A=`rotate(${S.gridAxesReverseTransform.rotate}deg)`,w=`scale(${1/S.gridContainerPosition[0].scale[0]}, ${1/S.gridContainerPosition[0].scale[1]})`;return`${_} ${A} ${w}`}),Z()),d=G({textReverseTransform:m,fullParams:i.fullParams$}).pipe(C(o),z(async S=>S),L(S=>`${S.textReverseTransform} rotate(${S.fullParams.labelRotate}deg)`)),y=i.gridContainerPosition$.pipe(C(o),L(S=>S.reduce((A,w)=>w.columnIndex>A?w.columnIndex:A,0)+1),Z()),b=i.gridContainerPosition$.pipe(C(o),L(S=>S.reduce((A,w)=>w.rowIndex>A?w.rowIndex:A,0)+1),Z()),x=kE({rootSelection:t,fullDataFormatter$:i.fullDataFormatter$,containerSize$:i.containerSize$,gridAxesContainerSize$:i.gridAxesContainerSize$,computedData$:i.computedData$,gridContainerPosition$:i.gridContainerPosition$,layout$:i.layout$}).pipe(C(o));G({axesSelection:u,columnAmount:y,rowAmount:b,layout:i.layout$,rootMousemove:g,gridGroupPosition:x,computedData:i.computedData$,groupScale:f,gridAxesSize:i.gridAxesSize$,fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,fullChartParams:i.fullChartParams$,highlightTarget:p,textReverseTransformWithRotate:d,GroupDataMap:i.GroupDataMap$,textSizePx:i.textSizePx$}).pipe(C(o),z(async S=>S)).subscribe(S=>{const{groupIndex:_,groupLabel:A}=S.gridGroupPosition,w=S.groupScale(_)??0,P=EB({groupLabel:A,axisX:w,axisHeight:S.gridAxesSize.height,fullParams:S.fullParams});NB({selection:S.axesSelection,pluginName:n,lineData:P,fullParams:S.fullParams,fullChartParams:S.fullChartParams});const I=BB({groupLabel:A,axisX:w,fullParams:S.fullParams,textSizePx:S.textSizePx,rowAmount:S.rowAmount});zB({selection:S.axesSelection,labelData:I,fullParams:S.fullParams,fullDataFormatter:S.fullDataFormatter,fullChartParams:S.fullChartParams,textReverseTransformWithRotate:S.textReverseTransformWithRotate,textSizePx:S.textSizePx}).on("mouseover",(N,R)=>{N.stopPropagation(),a=!0,r.event$.next({type:"grid",pluginName:n,eventName:"mouseover",highlightTarget:S.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",group:S.GroupDataMap.get(A)??[],groupIndex:_,groupLabel:A,event:N,data:S.computedData})}).on("mousemove",(N,R)=>{N.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:S.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",group:S.GroupDataMap.get(A)??[],groupIndex:_,groupLabel:A,event:N,data:S.computedData})}).on("mouseout",(N,R)=>{N.stopPropagation(),a=!1,r.event$.next({type:"grid",pluginName:n,eventName:"mouseout",highlightTarget:S.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",group:S.GroupDataMap.get(A)??[],groupIndex:_,groupLabel:A,event:N,data:S.computedData})}).on("click",(N,R)=>{N.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:S.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",group:S.GroupDataMap.get(A)??[],groupIndex:_,groupLabel:A,event:N,data:S.computedData})})});const $=Ar(s,"mouseout").pipe(C(o));return G({rootRectMouseout:$,axesSelection:u}).pipe(C(o),z(async S=>S)).subscribe(S=>{setTimeout(()=>{a!=!0&&(FB(S.axesSelection),OB(S.axesSelection))})}),()=>{o.next(void 0),s.remove()}}),Uv={placement:"bottom",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,gridList:[{listRectWidth:14,listRectHeight:14,listRectRadius:0}],textColorType:"primary"},Bp={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!0,axisLineColorType:"primary",ticks:"all",tickFormat:e=>e,tickLineVisible:!0,tickPadding:20,tickFullLine:!1,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary",gridIndexes:[0]};Bp.tickFormat.toString=()=>"text => text";const ya={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:e=>{if(e===null||Number.isNaN(e)==!0)return e||0;const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")},tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary",gridIndexes:"all"};ya.tickFormat.toString=()=>`num => {
65
+ </text>`:""}function MB({rootSelection:e,pluginName:t,gClassName:n,boxClassName:r,rootWidth:i,rootHeight:o,svgString:a,tooltipStyle:s,event:l}){e.interrupt("fadeout");const u=5,c=a?[a]:[],h=a?[s]:[],p=e.selectAll(`g.${n}`).data(c).join(_=>_.append("g").classed(n,!0).attr("pointer-events","none"),_=>_,_=>_.style("opacity",0).remove()).attr("transform",()=>`translate(${l.offsetX}, ${l.offsetY})`).selectAll(`g.${r}`).data(h).join(_=>_.append("g").classed(H(t,"box"),!0)),d=p.selectAll("rect").data(h).join(_=>_.append("rect").attr("rx",u).attr("ry",u)).attr("fill",_=>_.backgroundColor).attr("stroke",_=>_.strokeColor).attr("opacity",_=>_.backgroundOpacity),m=p.selectAll("g").data(c).join(_=>_.append("g").classed(H(t,"content"),!0).attr("transform",()=>`translate(${s.padding}, ${s.padding})`));c.length&&CE(m,c[0]);const g=m!=null&&m.node()?dv(m):{width:0,height:0};d.attr("width",g.width+s.padding*2).attr("height",g.height+s.padding*2);const y=p!=null&&p.node()?dv(p):{width:0,height:0},b=i-y.width,x=o-y.height,$=l.offsetX+s.offset[0]>b?b-l.offsetX:s.offset[0],S=l.offsetY+s.offset[1]>x?x-l.offsetY:s.offset[1];p.attr("transform",_=>`translate(${$}, ${S})`),p.attr("transform",_=>`translate(${$}, ${S})`)}const Bi=(e,{rootSelection:t,fullParams$:n,fullChartParams$:r,layout$:i,event$:o})=>{const a=new Q,s=H(e,"g"),l=H(e,"box"),u=o.pipe(C(a),Er(b=>b.eventName==="mouseover"||b.eventName==="mousemove")),c=o.pipe(C(a),Er(b=>b.eventName==="mouseout")),h=dD(r),f=O({fullChartParams:r,fullParams:n,textSizePx:h}).pipe(C(a),z(async b=>b),L(b=>({backgroundColor:pe(b.fullParams.backgroundColorType,b.fullChartParams),backgroundOpacity:b.fullParams.backgroundOpacity,strokeColor:pe(b.fullParams.strokeColorType,b.fullChartParams),offset:b.fullParams.offset,padding:b.fullParams.padding,textSize:b.fullChartParams.styles.textSize,textSizePx:b.textSizePx,textColor:pe(b.fullParams.textColorType,b.fullChartParams),seriesColors:b.fullChartParams.colors[b.fullChartParams.colorScheme].label}))),p=O({fullParams:n,tooltipStyle:f}).pipe(C(a),z(async b=>b),L(b=>x=>{const $=b.fullParams.renderFn(x,{utils:{toCurrency:LE,measureTextWidth:Mi},styles:b.tooltipStyle});if(typeof $=="string"){const S=$.trim();if(S.slice(0,1)==="<"&&S.slice(S.length-1,S.length)===">")return $;{const A=$.split(`
66
+ `);return Vv(A,b.tooltipStyle)}}else if(Array.isArray($))return Vv($,b.tooltipStyle);return""})),d=O({event:u,contentRenderFn:p}).pipe(C(a),z(async b=>b),L(b=>b.contentRenderFn(b.event))),m=c.pipe(C(a),L(b=>"")),g=Vu(d,m).pipe(C(a),q((b,x)=>b===x)),y=Vu(u,c).pipe(C(a),L(b=>b.event));return O({svgString:g,eventTooltip:y,layout:i,tooltipStyle:f}).pipe(C(a),z(async b=>b)).subscribe(b=>{MB({rootSelection:t,pluginName:e,gClassName:s,boxClassName:l,rootWidth:b.layout.rootWidth,rootHeight:b.layout.rootHeight,svgString:b.svgString,tooltipStyle:b.tooltipStyle,event:b.eventTooltip})}),()=>{a.next(void 0)}},Yv="GridTooltip",kB=ct({name:Yv,defaultParams:Pu,layerIndex:Ri,validator:(e,{validateColumns:t})=>t(e,{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"},renderFn:{toBeTypes:["Function"]}})})(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q,a=Bi(Yv,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),RB=ct({name:"GroupZoom",defaultParams:Dg,layerIndex:Lp,validator:(e,{validateColumns:t})=>({status:"success",columnName:"",expectToBe:""})})(({selection:e,rootSelection:t,name:n,observer:r,subject:i})=>{const o=new Q;let a={k:1,x:0,y:0};const s=r.computedData$.pipe(L(c=>c[0]?c[0].length-1:0),q()),l=r.fullDataFormatter$.pipe(L(c=>c.groupAxis),Br()),u=O({initGroupAxis:l,groupMaxIndex:s,layout:r.layout$,axisSize:r.gridAxesSize$}).pipe(C(o),z(async c=>c),L(c=>{const h=c.initGroupAxis.scaleDomain[0]-c.initGroupAxis.scalePadding,f=c.initGroupAxis.scaleDomain[1]==="max"?c.groupMaxIndex+c.initGroupAxis.scalePadding:c.initGroupAxis.scaleDomain[1]+c.initGroupAxis.scalePadding;return Sc({maxValue:c.groupMaxIndex,minValue:0,axisWidth:c.axisSize.width,scaleDomain:[h,f],scaleRange:[0,1]})}));return O({initGroupScale:u,fullDataFormatter:r.fullDataFormatter$,groupMaxIndex:s}).pipe(C(o),z(async c=>c)).subscribe(c=>{const f=c.initGroupScale.copy(),p=Tn().on("zoom",function(m){const g=m.transform,y=$=>{const S=Math.round($);return Math.min(c.groupMaxIndex,Math.max(0,S))},b=c.fullDataFormatter.groupAxis.position==="bottom"||c.fullDataFormatter.groupAxis.position==="top"?g.rescaleX(f).domain().map(y):g.rescaleY(f).domain().map(y);b[0]<=0&&b[1]>=c.groupMaxIndex?g.k<a.k&&(g.k=a.k,g.x=a.x,g.y=a.y):b[1]-b[0]<=1&&g.k>a.k&&(g.k=a.k,g.x=a.x,g.y=a.y),a.k=g.k,a.x=g.x,a.y=g.y;const x={...c.fullDataFormatter,groupAxis:{...c.fullDataFormatter.groupAxis,scaleDomain:b}};i.dataFormatter$.next(x)});t.call(p)}),()=>{o.next(void 0),t.call(Tn().on("zoom",null))}}),xu="GroupAux",Ip=H(xu,"label-box"),Ep=6,Xv=3,IB={name:xu,defaultParams:Au,layerIndex:Mp,validator:(e,{validateColumns:t})=>t(e,{showLine:{toBeTypes:["boolean"]},showLabel:{toBeTypes:["boolean"]},lineDashArray:{toBeTypes:["string"]},lineColorType:{toBeOption:"ColorType"},labelColorType:{toBeOption:"ColorType"},labelTextColorType:{toBeOption:"ColorType"},labelTextFormat:{toBeTypes:["string","Function"]},labelPadding:{toBeTypes:["number"]},labelRotate:{toBeTypes:["number"]}})};function EB({groupLabel:e,axisX:t,axisHeight:n,fullParams:r}){return r.showLine&&e?[{id:e,x1:t,x2:t,y1:0,y2:n}]:[]}function BB({groupLabel:e,axisX:t,fullParams:n,textSizePx:r,rowAmount:i}){const o=rn(e,n.labelTextFormat),a=o.split(`
67
+ `),s=a.reduce((c,h)=>h.length>c.length?h:c,""),l=Mi(s,r),u=r*a.length;return n.showLabel&&e?[{id:e,x:t,y:-n.labelPadding*i,text:o,textArr:a,textWidth:l,textHeight:u}]:[]}function NB({selection:e,pluginName:t,lineData:n,fullParams:r,fullChartParams:i}){const o=H(t,"auxline");return e.selectAll(`line.${o}`).data(n).join(s=>s.append("line").classed(o,!0).style("stroke-width",1).style("pointer-events","none").style("vector-effect","non-scaling-stroke").attr("x1",l=>l.x1).attr("y1",l=>l.y1).attr("x2",l=>l.x2).attr("y2",l=>l.y2),s=>s.transition().duration(50).attr("x1",u=>u.x1).attr("y1",u=>u.y1).attr("x2",u=>u.x2).attr("y2",u=>u.y2),s=>s.remove()).style("stroke",s=>pe(r.lineColorType,i)).style("stroke-dasharray",r.lineDashArray??"none")}function FB(e){e.selectAll("line").data([]).exit().remove()}function zB({selection:e,labelData:t,fullParams:n,fullDataFormatter:r,fullChartParams:i,textReverseTransformWithRotate:o,textSizePx:a}){return e.selectAll(`g.${Ip}`).data(t).join(l=>l.append("g").classed(Ip,!0).style("cursor","pointer").attr("transform",(u,c)=>`translate(${u.x}, ${u.y})`),l=>l.transition().duration(50).attr("transform",(c,h)=>`translate(${c.x}, ${c.y})`),l=>l.remove()).each((l,u,c)=>{const h=X(c[u]),f=l.textWidth+Ep*2,p=l.textHeight+Xv*2;let d=-f/2,m=-2,g=d,y=m-3;r.groupAxis.position==="bottom"?(d=n.labelRotate?-f+p:-f/2,m=2,g=d,y=m-3):r.groupAxis.position==="left"?(d=-f+2,m=-p/2,g=d,y=m-3,n.labelRotate&&(y+=p)):r.groupAxis.position==="right"?(d=-2,m=-p/2,g=d,y=m-3,n.labelRotate&&(y+=p)):r.groupAxis.position==="top"&&(d=n.labelRotate?-f+p:-f/2,m=-p+6,g=-p,y=m-3);const b=h.selectAll("rect").data([l]).join(_=>_.append("rect").style("cursor","pointer").attr("rx",5).attr("ry",5),_=>_,_=>_.remove()).attr("width",_=>`${f}px`).attr("height",`${p}px`).attr("fill",_=>pe(n.labelColorType,i)).attr("x",g).attr("y",y).style("transform",o),x=h.selectAll("text").data([l]).join(_=>_.append("text").style("dominant-baseline","hanging").style("cursor","pointer"),_=>_,_=>_.remove()).style("transform",o).attr("fill",_=>pe(n.labelTextColorType,i)).attr("font-size",i.styles.textSize).attr("x",g+Ep).attr("y",y+Xv).each((_,A,w)=>{ma(X(w[A]),{textArr:l.textArr,textSizePx:a,groupAxisPosition:r.groupAxis.position,isContainerRotated:!1})});let $=[];x.selectAll("tspan").each((_,A,w)=>{const I=X(w[A]).node();I&&I.getBBox()&&$.push(I.getBBox().width)});const S=Math.max(...$);b.attr("width",S+Ep*2)})}function OB(e){e.selectAll(`g.${Ip}`).data([]).exit().remove()}const GB=ct(IB)(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q;let a=!1;const s=t.insert("rect","g").classed(H(xu,"rect"),!0).attr("opacity",0),{seriesSelection$:l,axesSelection$:u,defsSelection$:c,graphicGSelection$:h}=wr({selection:e,pluginName:xu,clipPathID:"test",seriesLabels$:i.isSeriesSeprate$.pipe(z(S=>on(()=>S,i.seriesLabels$,i.seriesLabels$.pipe(L(_=>[_[0]]))))),gridContainerPosition$:i.gridContainerPosition$,gridAxesTransform$:i.gridAxesTransform$,gridGraphicTransform$:i.gridGraphicTransform$});i.layout$.pipe(C(o)).subscribe(S=>{s.attr("width",S.rootWidth).attr("height",S.rootHeight)});const f=O({groupScaleDomainValue:i.groupScaleDomainValue$,gridAxesSize:i.gridAxesSize$}).pipe(C(o),z(async S=>S),L(S=>Nn().domain(S.groupScaleDomainValue).range([0,S.gridAxesSize.width]))),p=i.fullChartParams$.pipe(C(o),L(S=>S.highlightTarget),q()),d=Ar(t,"mousemove").pipe(C(o)),m=O({gridAxesReverseTransform:i.gridAxesReverseTransform$,gridContainerPosition:i.gridContainerPosition$}).pipe(C(o),z(async S=>S),L(S=>{const _=`rotateX(${S.gridAxesReverseTransform.rotateX}deg) rotateY(${S.gridAxesReverseTransform.rotateY}deg)`,A=`rotate(${S.gridAxesReverseTransform.rotate}deg)`,w=`scale(${1/S.gridContainerPosition[0].scale[0]}, ${1/S.gridContainerPosition[0].scale[1]})`;return`${_} ${A} ${w}`}),q()),g=O({textReverseTransform:m,fullParams:i.fullParams$}).pipe(C(o),z(async S=>S),L(S=>`${S.textReverseTransform} rotate(${S.fullParams.labelRotate}deg)`)),y=i.gridContainerPosition$.pipe(C(o),L(S=>S.reduce((A,w)=>w.columnIndex>A?w.columnIndex:A,0)+1),q()),b=i.gridContainerPosition$.pipe(C(o),L(S=>S.reduce((A,w)=>w.rowIndex>A?w.rowIndex:A,0)+1),q()),x=kE({rootSelection:t,fullDataFormatter$:i.fullDataFormatter$,containerSize$:i.containerSize$,gridAxesContainerSize$:i.gridAxesContainerSize$,computedData$:i.computedData$,gridContainerPosition$:i.gridContainerPosition$,layout$:i.layout$}).pipe(C(o));O({axesSelection:u,columnAmount:y,rowAmount:b,layout:i.layout$,rootMousemove:d,gridGroupPosition:x,computedData:i.computedData$,groupScale:f,gridAxesSize:i.gridAxesSize$,fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,fullChartParams:i.fullChartParams$,highlightTarget:p,textReverseTransformWithRotate:g,GroupDataMap:i.GroupDataMap$,textSizePx:i.textSizePx$}).pipe(C(o),z(async S=>S)).subscribe(S=>{const{groupIndex:_,groupLabel:A}=S.gridGroupPosition,w=S.groupScale(_)??0,P=EB({groupLabel:A,axisX:w,axisHeight:S.gridAxesSize.height,fullParams:S.fullParams});NB({selection:S.axesSelection,pluginName:n,lineData:P,fullParams:S.fullParams,fullChartParams:S.fullChartParams});const I=BB({groupLabel:A,axisX:w,fullParams:S.fullParams,textSizePx:S.textSizePx,rowAmount:S.rowAmount});zB({selection:S.axesSelection,labelData:I,fullParams:S.fullParams,fullDataFormatter:S.fullDataFormatter,fullChartParams:S.fullChartParams,textReverseTransformWithRotate:S.textReverseTransformWithRotate,textSizePx:S.textSizePx}).on("mouseover",(N,R)=>{N.stopPropagation(),a=!0,r.event$.next({type:"grid",pluginName:n,eventName:"mouseover",highlightTarget:S.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",group:S.GroupDataMap.get(A)??[],groupIndex:_,groupLabel:A,event:N,data:S.computedData})}).on("mousemove",(N,R)=>{N.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:S.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",group:S.GroupDataMap.get(A)??[],groupIndex:_,groupLabel:A,event:N,data:S.computedData})}).on("mouseout",(N,R)=>{N.stopPropagation(),a=!1,r.event$.next({type:"grid",pluginName:n,eventName:"mouseout",highlightTarget:S.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",group:S.GroupDataMap.get(A)??[],groupIndex:_,groupLabel:A,event:N,data:S.computedData})}).on("click",(N,R)=>{N.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:S.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",group:S.GroupDataMap.get(A)??[],groupIndex:_,groupLabel:A,event:N,data:S.computedData})})});const $=Ar(s,"mouseout").pipe(C(o));return O({rootRectMouseout:$,axesSelection:u}).pipe(C(o),z(async S=>S)).subscribe(S=>{setTimeout(()=>{a!=!0&&(FB(S.axesSelection),OB(S.axesSelection))})}),()=>{o.next(void 0),s.remove()}}),Uv={placement:"bottom",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,gridList:[{listRectWidth:14,listRectHeight:14,listRectRadius:0}],textColorType:"primary"},Bp={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!0,axisLineColorType:"primary",ticks:"all",tickFormat:e=>e,tickLineVisible:!0,tickPadding:20,tickFullLine:!1,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary",gridIndexes:[0]};Bp.tickFormat.toString=()=>"text => text";const ya={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:e=>{if(e===null||Number.isNaN(e)==!0)return e||0;const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")},tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary",gridIndexes:"all"};ya.tickFormat.toString=()=>`num => {
68
68
  if (num === null || Number.isNaN(num) == true) {
69
69
  return num || 0
70
70
  }
71
71
  const parts = num.toString().split('.')
72
72
  parts[0] = parts[0].replace(/B(?=(d{3})+(?!d))/g, ',')
73
73
  return parts.join('.')
74
- }`;const WB={...ya},jv={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1,gridIndexes:[0]},Hv={barWidth:0,barGroupPadding:10,barRadius:!1,gridIndexes:[0]},qv={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0],gridIndexes:[0]},Zv={lineCurve:"curveLinear",lineWidth:2,gridIndexes:[1]},Kv={lineCurve:"curveLinear",linearGradientOpacity:[1,0],gridIndexes:[1]},Qv={radius:4,fillColorType:"background",strokeColorType:"label",strokeWidth:2,onlyShowHighlighted:!1,gridIndexes:[1]},Np={firstAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"},secondAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"},gridIndexes:[0,1]},Jv={...Np},Fp={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(e,{styles:t,utils:n})=>{const r=t.textSizePx*.7,i=t.textSizePx/2-r/2,o=`<g><text dominant-baseline="hanging" font-size="${t.textSizePx}" fill="${t.textColor}">${e.groupLabel}</text></g>`,a=n.measureTextWidth(e.groupLabel,t.textSizePx),s=e.group.reduce((h,f)=>{const p=`${f.seriesLabel}${n.toCurrency(f.value)}`,g=n.measureTextWidth(p,t.textSizePx);return g>h?g:h},0),u=Math.max(a,s)+t.textSizePx*3,c=e.group.map((h,f)=>{const p=f*t.textSizePx*1.5,g=h.id===(e.datum&&e.datum.id);return`<g transform="translate(0, ${t.textSizePx*2})">
74
+ }`;const WB={...ya},jv={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1,gridIndexes:[0]},Hv={barWidth:0,barGroupPadding:10,barRadius:!1,gridIndexes:[0]},qv={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0],gridIndexes:[0]},Zv={lineCurve:"curveLinear",lineWidth:2,gridIndexes:[1]},Kv={lineCurve:"curveLinear",linearGradientOpacity:[1,0],gridIndexes:[1]},Qv={radius:4,fillColorType:"background",strokeColorType:"label",strokeWidth:2,onlyShowHighlighted:!1,gridIndexes:[1]},Np={firstAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"},secondAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:4,tickFormat:",.0f",tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"},gridIndexes:[0,1]},Jv={...Np},Fp={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(e,{styles:t,utils:n})=>{const r=t.textSizePx*.7,i=t.textSizePx/2-r/2,o=`<g><text dominant-baseline="hanging" font-size="${t.textSizePx}" fill="${t.textColor}">${e.groupLabel}</text></g>`,a=n.measureTextWidth(e.groupLabel,t.textSizePx),s=e.group.reduce((h,f)=>{const p=`${f.seriesLabel}${n.toCurrency(f.value)}`,d=n.measureTextWidth(p,t.textSizePx);return d>h?d:h},0),u=Math.max(a,s)+t.textSizePx*3,c=e.group.map((h,f)=>{const p=f*t.textSizePx*1.5,d=h.id===(e.datum&&e.datum.id);return`<g transform="translate(0, ${t.textSizePx*2})">
75
75
  <rect width="${r}" height="${r}" x="${i}" y="${p+i}" rx="${r/2}" fill="${h.color}"></rect>
76
76
  <text x="${t.textSizePx*1.5}" y="${p}" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
77
- <tspan font-weight="${g?"bold":""}">${h.seriesLabel}</tspan>
77
+ <tspan font-weight="${d?"bold":""}">${h.seriesLabel}</tspan>
78
78
  <tspan font-weight="bold" text-anchor="end" x="${u}">${n.toCurrency(h.value)}</tspan>
79
79
  </text>
80
80
  </g>`}).join("");return`${o}
@@ -106,12 +106,12 @@ ${c}`}};Fp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
106
106
  .join('')
107
107
  return \`\${titleSvg}
108
108
  \${contentSvg}\`
109
- }`;const eS="MultiGridLegend",VB=mt({name:eS,defaultParams:Uv,layerIndex:Mi,validator:(e,{validateColumns:t})=>{const n=t(e,{placement:{toBe:'"top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end"',test:r=>["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].includes(r)},padding:{toBeTypes:["number"]},backgroundFill:{toBeOption:"ColorType"},backgroundStroke:{toBeOption:"ColorType"},gap:{toBeTypes:["number"]},listRectWidth:{toBeTypes:["number"]},listRectHeight:{toBeTypes:["number"]},listRectRadius:{toBeTypes:["number"]},gridList:{toBeTypes:["object[]"]},textColorType:{toBeOption:"ColorType"}});if(e.gridList){const i=e.gridList.map((o,a)=>t(o,{listRectWidth:{toBeTypes:["number"]},listRectHeight:{toBeTypes:["number"]},listRectRadius:{toBeTypes:["number"]}})).find(o=>o.status==="error");if(i)return i}return n}})(({selection:e,rootSelection:t,observer:n,subject:r})=>{const i=new Q,o=n.multiGridEachDetail$.pipe(L(u=>u.map(c=>c.seriesLabels$)),z(u=>G(u).pipe(z(async c=>c))),L(u=>u.flat())),a=G({fullParams:n.fullParams$,computedData:n.computedData$}).pipe(C(i),z(async u=>u),L(u=>u.computedData.map((c,h)=>{const f=Xu(u.fullParams.gridList[h]??{},{listRectWidth:u.fullParams.listRectWidth,listRectHeight:u.fullParams.listRectHeight,listRectRadius:u.fullParams.listRectRadius});return c.map(p=>f)}).flat())),s=G({fullParams:n.fullParams$,seriesList:a}).pipe(C(i),z(async u=>u),L(u=>({...u.fullParams,labelList:u.seriesList}))),l=Ri(eS,{rootSelection:t,legendLabels$:o,fullParams$:s,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),l()}}),Gt=e=>{const t=e.fullParams$.pipe(L(n=>n.gridIndexes),Z(),ie(1));return G({multiGridEachDetail:e.multiGridEachDetail$,gridIndexes:t}).pipe(z(async n=>n),L(n=>n.gridIndexes==="all"?n.multiGridEachDetail:n.gridIndexes.map(r=>n.multiGridEachDetail[r]??n.multiGridEachDetail[0])))},zp="MultiBars",tS=H(zp,"grid"),YB=mt({name:zp,defaultParams:jv,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[];return Gt(r).pipe(C(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${tS}`).data(s).join("g").attr("class",tS).each((l,u,c)=>{const h=X(c[u]),f=l.dataFormatter$.pipe(C(i),L(p=>p.separateSeries),Z(),ie(1));o[u]=kp(zp,{selection:h,computedData$:l.computedData$,visibleComputedData$:l.visibleComputedData$,computedAxesData$:l.computedAxesData$,visibleComputedAxesData$:l.visibleComputedAxesData$,seriesLabels$:l.seriesLabels$,SeriesDataMap$:l.SeriesDataMap$,GroupDataMap$:l.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:l.gridAxesTransform$,gridGraphicTransform$:l.gridGraphicTransform$,gridGraphicReverseScale$:l.gridGraphicReverseScale$,gridAxesSize$:l.gridAxesSize$,gridHighlight$:r.multiGridHighlight$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:f,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Op="MultiStackedBars",nS=H(Op,"grid"),XB=mt({name:Op,defaultParams:Hv,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},barWidth:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[];return Gt(r).pipe(C(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${nS}`).data(s).join("g").attr("class",nS).each((l,u,c)=>{const h=X(c[u]),f=l.dataFormatter$.pipe(C(i),L(p=>p.separateSeries),Z(),ie(1));o[u]=Pv(Op,{selection:h,computedData$:l.computedData$,visibleComputedData$:l.visibleComputedData$,computedAxesData$:l.computedAxesData$,visibleComputedAxesData$:l.visibleComputedAxesData$,seriesLabels$:l.seriesLabels$,SeriesDataMap$:l.SeriesDataMap$,GroupDataMap$:l.GroupDataMap$,fullParams$:r.fullParams$,fullDataFormatter$:l.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:l.gridAxesTransform$,gridGraphicTransform$:l.gridGraphicTransform$,gridGraphicReverseScale$:l.gridGraphicReverseScale$,gridAxesSize$:l.gridAxesSize$,gridHighlight$:r.multiGridHighlight$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:f,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Gp="MultiBarsTriangle",rS=H(Gp,"grid"),UB=mt({name:Gp,defaultParams:qv,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},linearGradientOpacity:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[];return Gt(r).pipe(C(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${rS}`).data(s).join("g").attr("class",rS).each((l,u,c)=>{const h=X(c[u]),f=l.dataFormatter$.pipe(C(i),L(p=>p.separateSeries),Z(),ie(1));o[u]=Mv(Gp,{selection:h,computedData$:l.computedData$,visibleComputedData$:l.visibleComputedData$,computedAxesData$:l.computedAxesData$,visibleComputedAxesData$:l.visibleComputedAxesData$,seriesLabels$:l.seriesLabels$,SeriesDataMap$:l.SeriesDataMap$,GroupDataMap$:l.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,fullDataFormatter$:l.dataFormatter$,gridAxesTransform$:l.gridAxesTransform$,gridGraphicTransform$:l.gridGraphicTransform$,gridAxesSize$:l.gridAxesSize$,gridHighlight$:r.multiGridHighlight$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:f,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Wp="MultiLines",iS=H(Wp,"grid"),jB=mt({name:Wp,defaultParams:Zv,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},lineCurve:{toBeTypes:["string"]},lineWidth:{toBeTypes:["number"]}})})(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q,a=[],s=i.multiGridContainerPosition$.pipe(C(o),L(u=>u.flat()));return Gt(i).pipe(C(o)).subscribe(u=>{a.forEach(c=>c()),e.selectAll(`g.${iS}`).data(u).join("g").attr("class",iS).each((c,h,f)=>{const p=X(f[h]);a[h]=yv(Wp,{selection:p,computedData$:c.computedData$,computedAxesData$:c.computedAxesData$,visibleComputedData$:c.visibleComputedData$,visibleComputedAxesData$:c.visibleComputedAxesData$,seriesLabels$:c.seriesLabels$,SeriesDataMap$:c.SeriesDataMap$,GroupDataMap$:c.GroupDataMap$,fullDataFormatter$:c.dataFormatter$,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,gridAxesTransform$:c.gridAxesTransform$,gridGraphicTransform$:c.gridGraphicTransform$,gridAxesSize$:c.gridAxesSize$,gridHighlight$:i.multiGridHighlight$,gridContainerPosition$:c.gridContainerPosition$,allContainerPosition$:s,layout$:i.layout$,event$:r.event$})})}),()=>{o.next(void 0),a.forEach(u=>u())}}),Vp="MultiLineAreas",oS=H(Vp,"grid"),HB=mt({name:Vp,defaultParams:Kv,layerIndex:bv,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},lineCurve:{toBeTypes:["string"]},linearGradientOpacity:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[],a=r.multiGridContainerPosition$.pipe(C(i),L(l=>l.flat()));return Gt(r).pipe(C(i)).subscribe(l=>{o.forEach(u=>u()),e.selectAll(`g.${oS}`).data(l).join("g").attr("class",oS).each((u,c,h)=>{const f=X(h[c]);o[c]=$v(Vp,{selection:f,computedData$:u.computedData$,computedAxesData$:u.computedAxesData$,visibleComputedData$:u.visibleComputedData$,visibleComputedAxesData$:u.visibleComputedAxesData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullDataFormatter$:u.dataFormatter$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:r.multiGridHighlight$,gridContainerPosition$:u.gridContainerPosition$,allContainerPosition$:a,layout$:r.layout$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(l=>l())}}),Yp="MultiDots",aS=H(Yp,"grid"),qB=mt({name:Yp,defaultParams:Qv,layerIndex:yu,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},radius:{toBeTypes:["number"]},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},onlyShowHighlighted:{toBeTypes:["boolean"]}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[];return Gt(r).pipe(C(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${aS}`).data(s).join("g").attr("class",aS).each((l,u,c)=>{const h=X(c[u]);o[u]=Rv(Yp,{selection:h,computedData$:l.computedData$,visibleComputedData$:l.visibleComputedData$,computedAxesData$:l.computedAxesData$,visibleComputedAxesData$:l.visibleComputedAxesData$,seriesLabels$:l.seriesLabels$,SeriesDataMap$:l.SeriesDataMap$,GroupDataMap$:l.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:l.gridAxesTransform$,gridGraphicTransform$:l.gridGraphicTransform$,gridGraphicReverseScale$:l.gridGraphicReverseScale$,gridAxesSize$:l.gridAxesSize$,gridHighlight$:r.multiGridHighlight$,gridContainerPosition$:l.gridContainerPosition$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Xp="MultiGroupAxis",sS=H(Xp,"grid"),ZB=mt({name:Xp,defaultParams:Bp,layerIndex:Dt,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBe:'number | null | "all"',test:r=>r===null||r==="all"||typeof r=="number"},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[];return Gt(r).pipe(C(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${sS}`).data(s).join("g").attr("class",sS).each((l,u,c)=>{const h=X(c[u]),f=l.dataFormatter$.pipe(C(i),L(p=>p.separateSeries),Z(),ie(1));o[u]=zv(Xp,{selection:h,computedData$:l.computedData$,fullParams$:r.fullParams$,fullDataFormatter$:l.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:l.gridAxesTransform$,gridAxesReverseTransform$:l.gridAxesReverseTransform$,gridAxesSize$:l.gridAxesSize$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:f,textSizePx$:r.textSizePx$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Up="MultiValueAxis",lS=H(Up,"grid"),KB=mt({name:Up,defaultParams:ya,layerIndex:Dt,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[];return Gt(r).pipe(C(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${lS}`).data(s).join("g").attr("class",lS).each((l,u,c)=>{const h=X(c[u]),f=l.dataFormatter$.pipe(C(i),L(p=>p.separateSeries),Z(),ie(1));o[u]=Ii(Up,{selection:h,computedData$:l.computedData$,filteredMinMaxValue$:l.filteredMinMaxValue$,fullParams$:r.fullParams$,fullDataFormatter$:l.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:l.gridAxesTransform$,gridAxesReverseTransform$:l.gridAxesReverseTransform$,gridAxesSize$:l.gridAxesSize$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:f})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),uS="MultiGridTooltip",QB=mt({name:uS,defaultParams:Fp,layerIndex:ki,validator:(e,{validateColumns:t})=>t(e,{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"},renderFn:{toBeTypes:["Function"]}})})(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q,a=Ei(uS,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),jp="MultiStackedValueAxis",cS=H(jp,"grid"),JB=mt({name:jp,defaultParams:ya,layerIndex:Dt,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[];return Gt(r).pipe(C(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${cS}`).data(s).join("g").attr("class",cS).each((l,u,c)=>{const h=X(c[u]),f=l.dataFormatter$.pipe(C(i),L(p=>p.separateSeries),Z(),ie(1));o[u]=Ii(jp,{selection:h,computedData$:l.computedStackedData$,filteredMinMaxValue$:l.filteredMinMaxValue$,fullParams$:r.fullParams$,fullDataFormatter$:l.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:l.gridAxesTransform$,gridAxesReverseTransform$:l.gridAxesReverseTransform$,gridAxesSize$:l.gridAxesSize$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:f})})}),()=>{i.next(void 0),o.forEach(s=>s())}});function eN(e){let t=Math.floor(Math.sqrt(e)),n=Math.ceil(e/t);for(;t*n<e;)n++;return{rowAmount:t,columnAmount:n}}function fS(e,t,n){const r=t.columnGap==="auto"?e.left+e.right:t.columnGap,i=t.rowGap==="auto"?e.top+e.bottom:t.rowGap,{rowAmount:o,columnAmount:a}=t.rowAmount*t.columnAmount>=n?t:eN(n);return new Array(n).fill(null).map((s,l)=>{const u=l%a,c=Math.floor(l/a),h=(e.width-r*(a-1))/a,f=(e.height-i*(o-1))/o,p=u*h+u*r,g=c*f+c*i,m=[p,g],d=[h/e.width,f/e.height];return{slotIndex:l,rowIndex:c,columnIndex:u,translate:m,scale:d}})}const tN={position:"left",scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""},nN={position:"bottom",scaleDomain:[0,"max"],scalePadding:.5,label:""},rN={columnAmount:1,rowAmount:1,columnGap:"auto",rowGap:"auto"},iN={seriesDirection:"row",rowLabels:[],columnLabels:[],valueAxis:{...tN},groupAxis:{...nN},separateSeries:!1},oN={type:"grid",visibleFilter:(e,t)=>!0,...iN,container:{...rN}};oN.visibleFilter.toString=()=>"(datum, context) => true";const hS=({computedData$:e,fullDataFormatter$:t,layout$:n})=>G({computedData:e,fullDataFormatter:t,layout:n}).pipe(z(async i=>i),L(i=>{if(i.computedData.length===0)return[{slotIndex:0,rowIndex:0,columnIndex:0,translate:[0,0],scale:[1,1]}];if(i.fullDataFormatter.separateSeries)return fS(i.layout,i.fullDataFormatter.container,i.computedData.length);{const o=fS(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((a,s)=>o[0])}})),pS=({fullDataFormatter$:e,layout$:t})=>{const n=new Q;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 l=0,u=0,c=0,h=0,f=0;return i.position==="bottom"?o.position==="left"?(h=180,u=s):o.position==="right"?(h=180,f=180,l=a,u=s):(h=180,u=s):i.position==="top"?o.position==="left"||(o.position==="right"?(f=180,l=a):(h=180,u=s)):i.position==="left"?o.position==="bottom"?(c=-90,u=s):o.position==="top"?(c=-90,f=180):(h=180,u=s):i.position==="right"?o.position==="bottom"?(c=-90,h=180,u=s,l=a):o.position==="top"?(c=-90,h=180,f=180,l=a):(h=180,u=s):(h=180,u=s),{translate:[l,u],scale:[1,1],rotate:c,rotateX:h,rotateY:f,value:`translate(${l}px, ${u}px) rotate(${c}deg) rotateX(${h}deg) rotateY(${f}deg)`}}return new me(i=>(G({fullDataFormatter:e,layout:t}).pipe(C(n),z(async o=>o)).subscribe(o=>{const a=r({xAxis:o.fullDataFormatter.groupAxis,yAxis:o.fullDataFormatter.valueAxis,width:o.layout.width,height:o.layout.height});i.next(a)}),function(){n.next(void 0)}))},gS=({gridAxesTransform$:e})=>e.pipe(L(t=>{const n=[0,0],r=[1/t.scale[0],1/t.scale[1]],i=t.rotate*-1,o=t.rotateX*-1,a=t.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)`}})),Hp="OverlappingValueAxes",dS=H(Hp,"grid"),aN=mt({name:Hp,defaultParams:Np,layerIndex:Dt,validator:(e,{validateColumns:t})=>{const n=t(e,{firstAxis:{toBeTypes:["object"]},secondAxis:{toBeTypes:["object"]},gridIndexes:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2}});if(e.firstAxis){const r=t(e.firstAxis,{labelOffset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}if(e.secondAxis){const r=t(e.secondAxis,{labelOffset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}return n}})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[],a=r.fullParams$.pipe(C(i),L(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(C(i),L(c=>c.gridIndexes[1])),l=G({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(C(i),z(async c=>c),L(c=>{c.fullDataFormatter.gridList[c.secondGridIndex]||(c.fullDataFormatter.gridList[c.secondGridIndex]=Object.assign({},c.fullDataFormatter.gridList[c.firstGridIndex]));const h=c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;let f=h;return h==="left"?f="right":h==="bottom"?f="top":h==="top"?f="bottom":h==="right"&&(f="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:f},container:{...c.fullDataFormatter.container}}}));return Ct(r).pipe(C(i),L(c=>({...c,fullParams$:c.fullParams$.pipe(L(h=>(h.gridIndexes.length>2&&(h.gridIndexes.length=2),h)))})),z(c=>Gt(c)),L(c=>c.map((h,f)=>{if(f===0)return h;const p=pS({fullDataFormatter$:l,layout$:r.layout$}),g=gS({gridAxesTransform$:p}),m=hS({computedData$:h.computedData$,fullDataFormatter$:l,layout$:r.layout$});return{...h,dataFormatter$:l,gridAxesTransform$:p,gridAxesReverseTransform$:g,gridContainerPosition$:m}}))).pipe(C(i)).subscribe(c=>{o.forEach(h=>h()),e.selectAll(`g.${dS}`).data(c).join("g").attr("class",dS).each((h,f,p)=>{if(f>1)return;const g=X(p[f]);o[f]=Ii(Hp,{selection:g,computedData$:h.computedData$,filteredMinMaxValue$:h.filteredMinMaxValue$,fullParams$:r.fullParams$.pipe(L(m=>f===0?m.firstAxis:m.secondAxis)),fullDataFormatter$:h.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:h.gridAxesTransform$,gridAxesReverseTransform$:h.gridAxesReverseTransform$,gridAxesSize$:h.gridAxesSize$,gridContainerPosition$:h.gridContainerPosition$,isSeriesSeprate$:h.isSeriesSeprate$})})}),()=>{i.next(void 0),o.forEach(c=>c())}}),qp="OverlappingStackedValueAxes",mS=H(qp,"grid"),sN=mt({name:qp,defaultParams:Jv,layerIndex:Dt,validator:(e,{validateColumns:t})=>{const n=t(e,{firstAxis:{toBeTypes:["object"]},secondAxis:{toBeTypes:["object"]},gridIndexes:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2}});if(e.firstAxis){const r=t(e.firstAxis,{labelOffset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}if(e.secondAxis){const r=t(e.secondAxis,{labelOffset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}return n}})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[],a=r.fullParams$.pipe(C(i),L(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(C(i),L(c=>c.gridIndexes[1])),l=G({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(C(i),z(async c=>c),L(c=>{c.fullDataFormatter.gridList[c.secondGridIndex]||(c.fullDataFormatter.gridList[c.secondGridIndex]=Object.assign({},c.fullDataFormatter.gridList[c.firstGridIndex]));const h=c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;let f=h;return h==="left"?f="right":h==="bottom"?f="top":h==="top"?f="bottom":h==="right"&&(f="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:f},container:{...c.fullDataFormatter.container}}}));return Ct(r).pipe(C(i),L(c=>({...c,fullParams$:c.fullParams$.pipe(L(h=>(h.gridIndexes.length>2&&(h.gridIndexes.length=2),h)))})),z(c=>Gt(c)),L(c=>c.map((h,f)=>{if(f===0)return h;const p=pS({fullDataFormatter$:l,layout$:r.layout$}),g=gS({gridAxesTransform$:p}),m=hS({computedData$:h.computedData$,fullDataFormatter$:l,layout$:r.layout$});return{...h,dataFormatter$:l,gridAxesTransform$:p,gridAxesReverseTransform$:g,gridContainerPosition$:m}}))).pipe(C(i)).subscribe(c=>{o.forEach(h=>h()),e.selectAll(`g.${mS}`).data(c).join("g").attr("class",mS).each((h,f,p)=>{if(f>1)return;const g=X(p[f]);o[f]=Ii(qp,{selection:g,computedData$:f===0?h.computedStackedData$:h.computedData$,filteredMinMaxValue$:h.filteredMinMaxValue$,fullParams$:r.fullParams$.pipe(L(m=>f===0?m.firstAxis:m.secondAxis)),fullDataFormatter$:h.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:h.gridAxesTransform$,gridAxesReverseTransform$:h.gridAxesReverseTransform$,gridAxesSize$:h.gridAxesSize$,gridContainerPosition$:h.gridContainerPosition$,isSeriesSeprate$:h.isSeriesSeprate$})})}),()=>{i.next(void 0),o.forEach(c=>c())}}),yS={placement:"bottom",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},Zp={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(e,{styles:t,utils:n})=>{const r=e.categoryLabel!=="",i=!(e.datum==null||e.datum.label.slice(0,11)==="multiValue_"),o=t.textSizePx*.7,a=t.textSizePx/2-o/2,s=r?`<rect width="${o}" height="${o}" x="${a}" y="${a-1}" rx="${o/2}" fill="${e.datum.color}"></rect>
109
+ }`;const e2="MultiGridLegend",VB=mt({name:e2,defaultParams:Uv,layerIndex:ki,validator:(e,{validateColumns:t})=>{const n=t(e,{placement:{toBe:'"top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end"',test:r=>["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].includes(r)},padding:{toBeTypes:["number"]},backgroundFill:{toBeOption:"ColorType"},backgroundStroke:{toBeOption:"ColorType"},gap:{toBeTypes:["number"]},listRectWidth:{toBeTypes:["number"]},listRectHeight:{toBeTypes:["number"]},listRectRadius:{toBeTypes:["number"]},gridList:{toBeTypes:["object[]"]},textColorType:{toBeOption:"ColorType"}});if(e.gridList){const i=e.gridList.map((o,a)=>t(o,{listRectWidth:{toBeTypes:["number"]},listRectHeight:{toBeTypes:["number"]},listRectRadius:{toBeTypes:["number"]}})).find(o=>o.status==="error");if(i)return i}return n}})(({selection:e,rootSelection:t,observer:n,subject:r})=>{const i=new Q,o=n.multiGridEachDetail$.pipe(L(u=>u.map(c=>c.seriesLabels$)),z(u=>O(u).pipe(z(async c=>c))),L(u=>u.flat())),a=O({fullParams:n.fullParams$,computedData:n.computedData$}).pipe(C(i),z(async u=>u),L(u=>u.computedData.map((c,h)=>{const f=Xu(u.fullParams.gridList[h]??{},{listRectWidth:u.fullParams.listRectWidth,listRectHeight:u.fullParams.listRectHeight,listRectRadius:u.fullParams.listRectRadius});return c.map(p=>f)}).flat())),s=O({fullParams:n.fullParams$,seriesList:a}).pipe(C(i),z(async u=>u),L(u=>({...u.fullParams,labelList:u.seriesList}))),l=Ii(e2,{rootSelection:t,legendLabels$:o,fullParams$:s,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),l()}}),Gt=e=>{const t=e.fullParams$.pipe(L(n=>n.gridIndexes),q(),ne(1));return O({multiGridEachDetail:e.multiGridEachDetail$,gridIndexes:t}).pipe(z(async n=>n),L(n=>n.gridIndexes==="all"?n.multiGridEachDetail:n.gridIndexes.map(r=>n.multiGridEachDetail[r]??n.multiGridEachDetail[0])))},zp="MultiBars",t2=H(zp,"grid"),YB=mt({name:zp,defaultParams:jv,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[];return Gt(r).pipe(C(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${t2}`).data(s).join("g").attr("class",t2).each((l,u,c)=>{const h=X(c[u]),f=l.dataFormatter$.pipe(C(i),L(p=>p.separateSeries),q(),ne(1));o[u]=kp(zp,{selection:h,computedData$:l.computedData$,visibleComputedData$:l.visibleComputedData$,computedAxesData$:l.computedAxesData$,visibleComputedAxesData$:l.visibleComputedAxesData$,seriesLabels$:l.seriesLabels$,SeriesDataMap$:l.SeriesDataMap$,GroupDataMap$:l.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:l.gridAxesTransform$,gridGraphicTransform$:l.gridGraphicTransform$,gridGraphicReverseScale$:l.gridGraphicReverseScale$,gridAxesSize$:l.gridAxesSize$,gridHighlight$:r.multiGridHighlight$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:f,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Op="MultiStackedBars",n2=H(Op,"grid"),XB=mt({name:Op,defaultParams:Hv,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},barWidth:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[];return Gt(r).pipe(C(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${n2}`).data(s).join("g").attr("class",n2).each((l,u,c)=>{const h=X(c[u]),f=l.dataFormatter$.pipe(C(i),L(p=>p.separateSeries),q(),ne(1));o[u]=Pv(Op,{selection:h,computedData$:l.computedData$,visibleComputedData$:l.visibleComputedData$,computedAxesData$:l.computedAxesData$,visibleComputedAxesData$:l.visibleComputedAxesData$,seriesLabels$:l.seriesLabels$,SeriesDataMap$:l.SeriesDataMap$,GroupDataMap$:l.GroupDataMap$,fullParams$:r.fullParams$,fullDataFormatter$:l.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:l.gridAxesTransform$,gridGraphicTransform$:l.gridGraphicTransform$,gridGraphicReverseScale$:l.gridGraphicReverseScale$,gridAxesSize$:l.gridAxesSize$,gridHighlight$:r.multiGridHighlight$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:f,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Gp="MultiBarsTriangle",r2=H(Gp,"grid"),UB=mt({name:Gp,defaultParams:qv,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},linearGradientOpacity:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[];return Gt(r).pipe(C(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${r2}`).data(s).join("g").attr("class",r2).each((l,u,c)=>{const h=X(c[u]),f=l.dataFormatter$.pipe(C(i),L(p=>p.separateSeries),q(),ne(1));o[u]=Mv(Gp,{selection:h,computedData$:l.computedData$,visibleComputedData$:l.visibleComputedData$,computedAxesData$:l.computedAxesData$,visibleComputedAxesData$:l.visibleComputedAxesData$,seriesLabels$:l.seriesLabels$,SeriesDataMap$:l.SeriesDataMap$,GroupDataMap$:l.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,fullDataFormatter$:l.dataFormatter$,gridAxesTransform$:l.gridAxesTransform$,gridGraphicTransform$:l.gridGraphicTransform$,gridAxesSize$:l.gridAxesSize$,gridHighlight$:r.multiGridHighlight$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:f,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Wp="MultiLines",i2=H(Wp,"grid"),jB=mt({name:Wp,defaultParams:Zv,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},lineCurve:{toBeTypes:["string"]},lineWidth:{toBeTypes:["number"]}})})(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q,a=[],s=i.multiGridContainerPosition$.pipe(C(o),L(u=>u.flat()));return Gt(i).pipe(C(o)).subscribe(u=>{a.forEach(c=>c()),e.selectAll(`g.${i2}`).data(u).join("g").attr("class",i2).each((c,h,f)=>{const p=X(f[h]);a[h]=yv(Wp,{selection:p,computedData$:c.computedData$,computedAxesData$:c.computedAxesData$,visibleComputedData$:c.visibleComputedData$,visibleComputedAxesData$:c.visibleComputedAxesData$,seriesLabels$:c.seriesLabels$,SeriesDataMap$:c.SeriesDataMap$,GroupDataMap$:c.GroupDataMap$,fullDataFormatter$:c.dataFormatter$,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,gridAxesTransform$:c.gridAxesTransform$,gridGraphicTransform$:c.gridGraphicTransform$,gridAxesSize$:c.gridAxesSize$,gridHighlight$:i.multiGridHighlight$,gridContainerPosition$:c.gridContainerPosition$,allContainerPosition$:s,layout$:i.layout$,event$:r.event$})})}),()=>{o.next(void 0),a.forEach(u=>u())}}),Vp="MultiLineAreas",o2=H(Vp,"grid"),HB=mt({name:Vp,defaultParams:Kv,layerIndex:bv,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},lineCurve:{toBeTypes:["string"]},linearGradientOpacity:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[],a=r.multiGridContainerPosition$.pipe(C(i),L(l=>l.flat()));return Gt(r).pipe(C(i)).subscribe(l=>{o.forEach(u=>u()),e.selectAll(`g.${o2}`).data(l).join("g").attr("class",o2).each((u,c,h)=>{const f=X(h[c]);o[c]=$v(Vp,{selection:f,computedData$:u.computedData$,computedAxesData$:u.computedAxesData$,visibleComputedData$:u.visibleComputedData$,visibleComputedAxesData$:u.visibleComputedAxesData$,seriesLabels$:u.seriesLabels$,SeriesDataMap$:u.SeriesDataMap$,GroupDataMap$:u.GroupDataMap$,fullDataFormatter$:u.dataFormatter$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:u.gridAxesTransform$,gridGraphicTransform$:u.gridGraphicTransform$,gridAxesSize$:u.gridAxesSize$,gridHighlight$:r.multiGridHighlight$,gridContainerPosition$:u.gridContainerPosition$,allContainerPosition$:a,layout$:r.layout$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(l=>l())}}),Yp="MultiDots",a2=H(Yp,"grid"),qB=mt({name:Yp,defaultParams:Qv,layerIndex:yu,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},radius:{toBeTypes:["number"]},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},onlyShowHighlighted:{toBeTypes:["boolean"]}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[];return Gt(r).pipe(C(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${a2}`).data(s).join("g").attr("class",a2).each((l,u,c)=>{const h=X(c[u]);o[u]=Rv(Yp,{selection:h,computedData$:l.computedData$,visibleComputedData$:l.visibleComputedData$,computedAxesData$:l.computedAxesData$,visibleComputedAxesData$:l.visibleComputedAxesData$,seriesLabels$:l.seriesLabels$,SeriesDataMap$:l.SeriesDataMap$,GroupDataMap$:l.GroupDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:l.gridAxesTransform$,gridGraphicTransform$:l.gridGraphicTransform$,gridGraphicReverseScale$:l.gridGraphicReverseScale$,gridAxesSize$:l.gridAxesSize$,gridHighlight$:r.multiGridHighlight$,gridContainerPosition$:l.gridContainerPosition$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Xp="MultiGroupAxis",s2=H(Xp,"grid"),ZB=mt({name:Xp,defaultParams:Bp,layerIndex:Ct,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBe:'number | null | "all"',test:r=>r===null||r==="all"||typeof r=="number"},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[];return Gt(r).pipe(C(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${s2}`).data(s).join("g").attr("class",s2).each((l,u,c)=>{const h=X(c[u]),f=l.dataFormatter$.pipe(C(i),L(p=>p.separateSeries),q(),ne(1));o[u]=zv(Xp,{selection:h,computedData$:l.computedData$,fullParams$:r.fullParams$,fullDataFormatter$:l.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:l.gridAxesTransform$,gridAxesReverseTransform$:l.gridAxesReverseTransform$,gridAxesSize$:l.gridAxesSize$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:f,textSizePx$:r.textSizePx$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Up="MultiValueAxis",l2=H(Up,"grid"),KB=mt({name:Up,defaultParams:ya,layerIndex:Ct,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[];return Gt(r).pipe(C(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${l2}`).data(s).join("g").attr("class",l2).each((l,u,c)=>{const h=X(c[u]),f=l.dataFormatter$.pipe(C(i),L(p=>p.separateSeries),q(),ne(1));o[u]=Ei(Up,{selection:h,computedData$:l.computedData$,filteredMinMaxValue$:l.filteredMinMaxValue$,fullParams$:r.fullParams$,fullDataFormatter$:l.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:l.gridAxesTransform$,gridAxesReverseTransform$:l.gridAxesReverseTransform$,gridAxesSize$:l.gridAxesSize$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:f})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),u2="MultiGridTooltip",QB=mt({name:u2,defaultParams:Fp,layerIndex:Ri,validator:(e,{validateColumns:t})=>t(e,{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"},renderFn:{toBeTypes:["Function"]}})})(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q,a=Bi(u2,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),jp="MultiStackedValueAxis",c2=H(jp,"grid"),JB=mt({name:jp,defaultParams:ya,layerIndex:Ct,validator:(e,{validateColumns:t})=>t(e,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}})})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[];return Gt(r).pipe(C(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${c2}`).data(s).join("g").attr("class",c2).each((l,u,c)=>{const h=X(c[u]),f=l.dataFormatter$.pipe(C(i),L(p=>p.separateSeries),q(),ne(1));o[u]=Ei(jp,{selection:h,computedData$:l.computedStackedData$,filteredMinMaxValue$:l.filteredMinMaxValue$,fullParams$:r.fullParams$,fullDataFormatter$:l.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:l.gridAxesTransform$,gridAxesReverseTransform$:l.gridAxesReverseTransform$,gridAxesSize$:l.gridAxesSize$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:f})})}),()=>{i.next(void 0),o.forEach(s=>s())}});function eN(e){let t=Math.floor(Math.sqrt(e)),n=Math.ceil(e/t);for(;t*n<e;)n++;return{rowAmount:t,columnAmount:n}}function f2(e,t,n){const r=t.columnGap==="auto"?e.left+e.right:t.columnGap,i=t.rowGap==="auto"?e.top+e.bottom:t.rowGap,{rowAmount:o,columnAmount:a}=t.rowAmount*t.columnAmount>=n?t:eN(n);return new Array(n).fill(null).map((s,l)=>{const u=l%a,c=Math.floor(l/a),h=(e.width-r*(a-1))/a,f=(e.height-i*(o-1))/o,p=u*h+u*r,d=c*f+c*i,m=[p,d],g=[h/e.width,f/e.height];return{slotIndex:l,rowIndex:c,columnIndex:u,translate:m,scale:g}})}const tN={position:"left",scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""},nN={position:"bottom",scaleDomain:[0,"max"],scalePadding:.5,label:""},rN={columnAmount:1,rowAmount:1,columnGap:"auto",rowGap:"auto"},iN={seriesDirection:"row",rowLabels:[],columnLabels:[],valueAxis:{...tN},groupAxis:{...nN},separateSeries:!1},oN={type:"grid",visibleFilter:(e,t)=>!0,...iN,container:{...rN}};oN.visibleFilter.toString=()=>"(datum, context) => true";const h2=({computedData$:e,fullDataFormatter$:t,layout$:n})=>O({computedData:e,fullDataFormatter:t,layout:n}).pipe(z(async i=>i),L(i=>{if(i.computedData.length===0)return[{slotIndex:0,rowIndex:0,columnIndex:0,translate:[0,0],scale:[1,1]}];if(i.fullDataFormatter.separateSeries)return f2(i.layout,i.fullDataFormatter.container,i.computedData.length);{const o=f2(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((a,s)=>o[0])}})),p2=({fullDataFormatter$:e,layout$:t})=>{const n=new Q;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 l=0,u=0,c=0,h=0,f=0;return i.position==="bottom"?o.position==="left"?(h=180,u=s):o.position==="right"?(h=180,f=180,l=a,u=s):(h=180,u=s):i.position==="top"?o.position==="left"||(o.position==="right"?(f=180,l=a):(h=180,u=s)):i.position==="left"?o.position==="bottom"?(c=-90,u=s):o.position==="top"?(c=-90,f=180):(h=180,u=s):i.position==="right"?o.position==="bottom"?(c=-90,h=180,u=s,l=a):o.position==="top"?(c=-90,h=180,f=180,l=a):(h=180,u=s):(h=180,u=s),{translate:[l,u],scale:[1,1],rotate:c,rotateX:h,rotateY:f,value:`translate(${l}px, ${u}px) rotate(${c}deg) rotateX(${h}deg) rotateY(${f}deg)`}}return new me(i=>(O({fullDataFormatter:e,layout:t}).pipe(C(n),z(async o=>o)).subscribe(o=>{const a=r({xAxis:o.fullDataFormatter.groupAxis,yAxis:o.fullDataFormatter.valueAxis,width:o.layout.width,height:o.layout.height});i.next(a)}),function(){n.next(void 0)}))},g2=({gridAxesTransform$:e})=>e.pipe(L(t=>{const n=[0,0],r=[1/t.scale[0],1/t.scale[1]],i=t.rotate*-1,o=t.rotateX*-1,a=t.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)`}})),Hp="OverlappingValueAxes",d2=H(Hp,"grid"),aN=mt({name:Hp,defaultParams:Np,layerIndex:Ct,validator:(e,{validateColumns:t})=>{const n=t(e,{firstAxis:{toBeTypes:["object"]},secondAxis:{toBeTypes:["object"]},gridIndexes:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2}});if(e.firstAxis){const r=t(e.firstAxis,{labelOffset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}if(e.secondAxis){const r=t(e.secondAxis,{labelOffset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}return n}})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[],a=r.fullParams$.pipe(C(i),L(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(C(i),L(c=>c.gridIndexes[1])),l=O({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(C(i),z(async c=>c),L(c=>{c.fullDataFormatter.gridList[c.secondGridIndex]||(c.fullDataFormatter.gridList[c.secondGridIndex]=Object.assign({},c.fullDataFormatter.gridList[c.firstGridIndex]));const h=c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;let f=h;return h==="left"?f="right":h==="bottom"?f="top":h==="top"?f="bottom":h==="right"&&(f="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:f},container:{...c.fullDataFormatter.container}}}));return St(r).pipe(C(i),L(c=>({...c,fullParams$:c.fullParams$.pipe(L(h=>(h.gridIndexes.length>2&&(h.gridIndexes.length=2),h)))})),z(c=>Gt(c)),L(c=>c.map((h,f)=>{if(f===0)return h;const p=p2({fullDataFormatter$:l,layout$:r.layout$}),d=g2({gridAxesTransform$:p}),m=h2({computedData$:h.computedData$,fullDataFormatter$:l,layout$:r.layout$});return{...h,dataFormatter$:l,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:m}}))).pipe(C(i)).subscribe(c=>{o.forEach(h=>h()),e.selectAll(`g.${d2}`).data(c).join("g").attr("class",d2).each((h,f,p)=>{if(f>1)return;const d=X(p[f]);o[f]=Ei(Hp,{selection:d,computedData$:h.computedData$,filteredMinMaxValue$:h.filteredMinMaxValue$,fullParams$:r.fullParams$.pipe(L(m=>f===0?m.firstAxis:m.secondAxis)),fullDataFormatter$:h.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:h.gridAxesTransform$,gridAxesReverseTransform$:h.gridAxesReverseTransform$,gridAxesSize$:h.gridAxesSize$,gridContainerPosition$:h.gridContainerPosition$,isSeriesSeprate$:h.isSeriesSeprate$})})}),()=>{i.next(void 0),o.forEach(c=>c())}}),qp="OverlappingStackedValueAxes",m2=H(qp,"grid"),sN=mt({name:qp,defaultParams:Jv,layerIndex:Ct,validator:(e,{validateColumns:t})=>{const n=t(e,{firstAxis:{toBeTypes:["object"]},secondAxis:{toBeTypes:["object"]},gridIndexes:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2}});if(e.firstAxis){const r=t(e.firstAxis,{labelOffset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}if(e.secondAxis){const r=t(e.secondAxis,{labelOffset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}return n}})(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=[],a=r.fullParams$.pipe(C(i),L(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(C(i),L(c=>c.gridIndexes[1])),l=O({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(C(i),z(async c=>c),L(c=>{c.fullDataFormatter.gridList[c.secondGridIndex]||(c.fullDataFormatter.gridList[c.secondGridIndex]=Object.assign({},c.fullDataFormatter.gridList[c.firstGridIndex]));const h=c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;let f=h;return h==="left"?f="right":h==="bottom"?f="top":h==="top"?f="bottom":h==="right"&&(f="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:f},container:{...c.fullDataFormatter.container}}}));return St(r).pipe(C(i),L(c=>({...c,fullParams$:c.fullParams$.pipe(L(h=>(h.gridIndexes.length>2&&(h.gridIndexes.length=2),h)))})),z(c=>Gt(c)),L(c=>c.map((h,f)=>{if(f===0)return h;const p=p2({fullDataFormatter$:l,layout$:r.layout$}),d=g2({gridAxesTransform$:p}),m=h2({computedData$:h.computedData$,fullDataFormatter$:l,layout$:r.layout$});return{...h,dataFormatter$:l,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:m}}))).pipe(C(i)).subscribe(c=>{o.forEach(h=>h()),e.selectAll(`g.${m2}`).data(c).join("g").attr("class",m2).each((h,f,p)=>{if(f>1)return;const d=X(p[f]);o[f]=Ei(qp,{selection:d,computedData$:f===0?h.computedStackedData$:h.computedData$,filteredMinMaxValue$:h.filteredMinMaxValue$,fullParams$:r.fullParams$.pipe(L(m=>f===0?m.firstAxis:m.secondAxis)),fullDataFormatter$:h.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:h.gridAxesTransform$,gridAxesReverseTransform$:h.gridAxesReverseTransform$,gridAxesSize$:h.gridAxesSize$,gridContainerPosition$:h.gridContainerPosition$,isSeriesSeprate$:h.isSeriesSeprate$})})}),()=>{i.next(void 0),o.forEach(c=>c())}}),y2={placement:"bottom",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},Zp={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(e,{styles:t,utils:n})=>{const r=e.categoryLabel!=="",i=!(e.datum==null||e.datum.label.slice(0,11)==="multiValue_"),o=t.textSizePx*.7,a=t.textSizePx/2-o/2,s=r?`<rect width="${o}" height="${o}" x="${a}" y="${a-1}" rx="${o/2}" fill="${e.datum.color}"></rect>
110
110
  <text x="${t.textSizePx*1.5}" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
111
111
  <tspan>${e.categoryLabel}</tspan>
112
112
  </text>`:"",l=i?`<text font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
113
113
  <tspan>${e.datum.label}</tspan>
114
- </text>`:"",u=(()=>{const f=n.measureTextWidth(e.categoryLabel,t.textSizePx),p=i?n.measureTextWidth(e.datum.label,t.textSizePx):0,g=e.valueDetail.reduce((m,d)=>{const y=`${d.valueLabel}${n.toCurrency(d.value)}`,b=n.measureTextWidth(y,t.textSizePx);return b>m?b:m},0);return Math.max(f,p,g)})(),c=e.valueDetail.map((f,p)=>{const g=p*t.textSizePx*1.5+(l?t.textSizePx*2:0),m=u+t.textSizePx*3;return`<text x="0" y="${g}" font-weight="bold" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
114
+ </text>`:"",u=(()=>{const f=n.measureTextWidth(e.categoryLabel,t.textSizePx),p=i?n.measureTextWidth(e.datum.label,t.textSizePx):0,d=e.valueDetail.reduce((m,g)=>{const y=`${g.valueLabel}${n.toCurrency(g.value)}`,b=n.measureTextWidth(y,t.textSizePx);return b>m?b:m},0);return Math.max(f,p,d)})(),c=e.valueDetail.map((f,p)=>{const d=p*t.textSizePx*1.5+(l?t.textSizePx*2:0),m=u+t.textSizePx*3;return`<text x="0" y="${d}" font-weight="bold" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
115
115
  <tspan>${f.valueLabel}</tspan>
116
116
  <tspan text-anchor="end" x="${m}">${n.toCurrency(f.value)}</tspan>
117
117
  </text>`}).join(""),h=l||c?`<g ${r?`transform="translate(0, ${t.textSizePx*2})"`:""}>
@@ -165,7 +165,7 @@ ${h}`}};Zp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
165
165
 
166
166
  return \`\${categorySvg}
167
167
  \${datumDetailSvg}\`
168
- }`;const bS={bubble:{sizeAdjust:1,arcScaleType:"area",valueLinearOpacity:[.8,.8]},itemLabel:{padding:20,colorType:"primary"},axisLabel:{offset:[0,0],colorType:"primary"},rankingAmount:10},Kp={showLine:!0,showLabel:!0,lineDashArray:"3, 3",lineColorType:"primary",labelColorType:"primary",labelTextColorType:"background",labelTextFormat:e=>e,labelPadding:20};Kp.labelTextFormat.toString=()=>"v => v";const Qp={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"secondary",ticks:4,tickFormat:e=>e,tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"};Qp.tickFormat.toString=()=>"v => v";const lN={},Jp={bar:{barWidth:0,barPadding:8,barRadius:!1},barLabel:{position:"inside",padding:20,colorType:"labelContrast"},valueLabel:{padding:20,colorType:"primary",format:e=>e},axisLabel:{offset:[0,0],colorType:"primary"},rankingAmount:10,autorun:!1,loop:!1};Jp.valueLabel.format.toString=()=>"v => v";const eg={renderFn:(e,t,n)=>e,textAttrs:[{transform:"translate(0, 0)"}],textStyles:[{"font-weight":"bold","text-anchor":"end","pointer-events":"none","dominant-baseline":"auto","font-size":64,fill:"#bebebe"},{"text-anchor":"end","pointer-events":"none","dominant-baseline":"auto","font-size":24,fill:"#bebebe"}],paddingRight:0,paddingBottom:0};eg.renderFn.toString=()=>`(valueLabel, valueIndex, data) => {
168
+ }`;const b2={bubble:{sizeAdjust:1,arcScaleType:"area",valueLinearOpacity:[.8,.8]},itemLabel:{padding:20,colorType:"primary"},axisLabel:{offset:[0,0],colorType:"primary"},rankingAmount:10},Kp={showLine:!0,showLabel:!0,lineDashArray:"3, 3",lineColorType:"primary",labelColorType:"primary",labelTextColorType:"background",labelTextFormat:e=>e,labelPadding:20};Kp.labelTextFormat.toString=()=>"v => v";const Qp={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"secondary",ticks:4,tickFormat:e=>e,tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"};Qp.tickFormat.toString=()=>"v => v";const lN={},Jp={bar:{barWidth:0,barPadding:8,barRadius:!1},barLabel:{position:"inside",padding:20,colorType:"labelContrast"},valueLabel:{padding:20,colorType:"primary",format:e=>e},axisLabel:{offset:[0,0],colorType:"primary"},rankingAmount:10,autorun:!1,loop:!1};Jp.valueLabel.format.toString=()=>"v => v";const eg={renderFn:(e,t,n)=>e,textAttrs:[{transform:"translate(0, 0)"}],textStyles:[{"font-weight":"bold","text-anchor":"end","pointer-events":"none","dominant-baseline":"auto","font-size":64,fill:"#bebebe"},{"text-anchor":"end","pointer-events":"none","dominant-baseline":"auto","font-size":24,fill:"#bebebe"}],paddingRight:0,paddingBottom:0};eg.renderFn.toString=()=>`(valueLabel, valueIndex, data) => {
169
169
  return valueLabel
170
170
  }`;const tg={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"secondary",ticks:null,tickFormat:e=>{if(e===null||Number.isNaN(e)==!0)return e||0;const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")},tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextColorType:"primary"};tg.tickFormat.toString=()=>`num => {
171
171
  if (num === null || Number.isNaN(num) == true) {
@@ -174,7 +174,7 @@ ${h}`}};Zp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
174
174
  const parts = num.toString().split('.')
175
175
  parts[0] = parts[0].replace(/B(?=(d{3})+(?!d))/g, ',')
176
176
  return parts.join('.')
177
- }`;const xS={radius:5,fillColorType:"label",strokeColorType:"label",strokeWidth:0},$S={fillColorType:"label",strokeColorType:"label",strokeWidth:0,valueLinearOpacity:[.8,.8],arcScaleType:"area",sizeAdjust:.5},ng={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"secondary",ticks:null,tickFormat:e=>{if(e===null||Number.isNaN(e)==!0)return e||0;const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")},tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextColorType:"primary"};ng.tickFormat.toString=()=>`num => {
177
+ }`;const x2={radius:5,fillColorType:"label",strokeColorType:"label",strokeWidth:0},$2={fillColorType:"label",strokeColorType:"label",strokeWidth:0,valueLinearOpacity:[.8,.8],arcScaleType:"area",sizeAdjust:.5},ng={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"secondary",ticks:null,tickFormat:e=>{if(e===null||Number.isNaN(e)==!0)return e||0;const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")},tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextColorType:"primary"};ng.tickFormat.toString=()=>`num => {
178
178
  if (num === null || Number.isNaN(num) == true) {
179
179
  return num || 0
180
180
  }
@@ -229,11 +229,11 @@ ${h}`}};Zp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
229
229
  const parts = num.toString().split('.')
230
230
  parts[0] = parts[0].replace(/B(?=(d{3})+(?!d))/g, ',')
231
231
  return parts.join('.')
232
- }`;const rg={},vS="MultiValueLegend",uN=He({name:vS,defaultParams:yS,layerIndex:Mi,validator:(e,{validateColumns:t})=>t(e,{placement:{toBe:'"top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end"',test:r=>["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].includes(r)},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:e,rootSelection:t,observer:n,subject:r})=>{const i=new Q,o=n.CategoryDataMap$.pipe(C(i),L(l=>Array.from(l.keys()))),a=n.fullParams$.pipe(C(i),L(l=>{const u=[{listRectWidth:l.listRectWidth,listRectHeight:l.listRectHeight,listRectRadius:l.listRectRadius}];return{...l,labelList:u}})),s=Ri(vS,{rootSelection:t,legendLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),SS="MultiValueTooltip",cN=He({name:SS,defaultParams:Zp,layerIndex:ki,validator:(e,{validateColumns:t})=>t(e,{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"},renderFn:{toBeTypes:["Function"]}})})(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q,a=Ei(SS,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),Su=({selection:e,pluginName:t,clipPathID:n,categoryLabels$:r,containerPosition$:i,graphicTransform$:o})=>{const a=H(t,"category"),s=H(t,"axes"),l=H(t,"graphic"),u=r.pipe(L((p,g)=>e.selectAll(`g.${a}`).data(p,m=>m).join(m=>m.append("g").classed(a,!0).each((d,y,b)=>{X(b[y]).selectAll(`g.${s}`).data([y]).join(x=>x.append("g").classed(s,!0).attr("clip-path",`url(#${n})`).each(($,S,_)=>{X(_[S]).selectAll("defs").data([S]).join("defs"),X(_[S]).selectAll("g").data([S]).join("g").classed(l,!0)}),x=>x,x=>x.remove())}),m=>m,m=>m.remove())),ie(1));G({categorySelection:u,containerPosition:i}).pipe(z(async p=>p)).subscribe(p=>{p.categorySelection.transition().attr("transform",(g,m)=>{const d=p.containerPosition[m]??p.containerPosition[0],y=d.translate,b=d.scale;return`translate(${y[0]}, ${y[1]}) scale(${b[0]}, ${b[1]})`})});const c=u.pipe(L(p=>p.select(`g.${s}`)),ie(1)),h=c.pipe(L(p=>p.select("defs")),ie(1)),f=G({axesSelection:c,graphicTransform:o}).pipe(z(async p=>p),L(p=>{const g=p.axesSelection.select(`g.${l}`);return g.transition().duration(50).style("transform",p.graphicTransform.value),g}),ie(1));return{categorySelection$:u,axesSelection$:c,defsSelection$:h,graphicGSelection$:f}},Pr=({selection:e,pluginName:t,clipPathID:n,computedData$:r,containerPosition$:i,isCategorySeprate$:o})=>{const a=H(t,"container"),s=G({computedData:r.pipe(Z((l,u)=>l.length===u.length)),isCategorySeprate:o}).pipe(z(async l=>l),L(l=>l.isCategorySeprate?l.computedData:[l.computedData[0]]),L((l,u)=>e.selectAll(`g.${a}`).data(l,c=>c&&c[0]?c[0].categoryIndex:u).join("g").classed(a,!0).attr("clip-path",c=>n?`url(#${n})`:"none")),ie(1));return G({containerSelection:s,gridContainerPosition:i}).pipe(z(async l=>l)).subscribe(l=>{l.containerSelection.attr("transform",(u,c)=>{const h=l.gridContainerPosition[c]??l.gridContainerPosition[0],f=h.translate;return h.scale,`translate(${f[0]}, ${f[1]})`})}),s},fN=({rootSelection:e,fullDataFormatter$:t,filteredXYMinMaxData$:n,containerPosition$:r,containerSize$:i,layout$:o})=>{const a=Ar(e,"mousemove").pipe(nd(2)),s=new me(u=>{G({containerSize:i,filteredXYMinMaxData:n,fullDataFormatter:t}).pipe(z(async c=>c)).subscribe(c=>{const h=c.fullDataFormatter.xAxis.valueIndex,f=c.fullDataFormatter.yAxis.valueIndex;if(!c.filteredXYMinMaxData.minXDatum||!c.filteredXYMinMaxData.maxXDatum||c.filteredXYMinMaxData.minXDatum.value[h]==null||c.filteredXYMinMaxData.maxXDatum.value[h]==null||!c.filteredXYMinMaxData.minYDatum||!c.filteredXYMinMaxData.maxYDatum||c.filteredXYMinMaxData.minYDatum.value[f]==null||c.filteredXYMinMaxData.maxYDatum.value[f]==null)return;const p=Sm({maxValue:c.filteredXYMinMaxData.maxXDatum.value[h],minValue:c.filteredXYMinMaxData.minXDatum.value[h],axisWidth:c.containerSize.width,scaleDomain:c.fullDataFormatter.xAxis.scaleDomain,scaleRange:c.fullDataFormatter.xAxis.scaleRange}),g=Sm({maxValue:c.filteredXYMinMaxData.maxYDatum.value[f],minValue:c.filteredXYMinMaxData.minYDatum.value[f],axisWidth:c.containerSize.height,scaleDomain:c.fullDataFormatter.yAxis.scaleDomain,scaleRange:c.fullDataFormatter.yAxis.scaleRange,reverse:!0});u.next({xScale:p,yScale:g})})}),l=G({rootMousemove:a,layout:o,containerPosition:r}).pipe(z(async u=>u),L(u=>{const c=(()=>{let f=u.rootMousemove.offsetX;const g=u.containerPosition.map((m,d)=>{var y;return[m.translate[0],((y=u.containerPosition[d+1])==null?void 0:y.translate[0])??u.layout.rootWidth]}).filter(m=>m[0]<m[1]).find(m=>f>=m[0]&&f<=m[1]);return g&&(f=f-g[0]),f-u.layout.left})(),h=(()=>{let f=u.rootMousemove.offsetY;const g=u.containerPosition.map((m,d)=>{var y;return[m.translate[1],((y=u.containerPosition[d+1])==null?void 0:y.translate[1])??u.layout.rootHeight]}).filter(m=>m[0]<m[1]).find(m=>f>=m[0]&&f<=m[1]);return g&&(f=f-g[0]),f-u.layout.top})();return{x:c,y:h}}));return G({xyScale:s,axisValue:l,containerPosition:r}).pipe(z(async u=>u),L(u=>({x:u.axisValue.x/u.containerPosition[0].scale[0],y:u.axisValue.y/u.containerPosition[0].scale[1],xValue:u.xyScale.xScale(u.axisValue.x),yValue:u.xyScale.yScale(u.axisValue.y)})))},hN=({rootSelection:e,ordinalScaleDomain$:t,ordinalScale$:n,ordinalPadding$:r,containerSize$:i,containerPosition$:o,layout$:a})=>{const s=Ar(e,"mousemove").pipe(nd(2)),l=G({rootMousemove:s,layout:a,containerPosition:o}).pipe(z(async c=>c),L(c=>{let h=c.rootMousemove.offsetX;const p=c.containerPosition.map((g,m)=>{var d;return[g.translate[0],((d=c.containerPosition[m+1])==null?void 0:d.translate[0])??c.layout.rootWidth]}).filter(g=>g[0]<g[1]).find(g=>h>=g[0]&&h<=g[1]);return p&&(h=h-p[0]),h-c.layout.left})),u=t.pipe(L(c=>{const h=c[1]-c[0]+1;return new Array(h).fill(0).map((f,p)=>String(p+c[0]))}));return G({scaleRangeLabels:u,containerSize:i,axisX:l,ordinalScale:n,ordinalPadding:r,ordinalScaleDomain:t,containerPosition:o}).pipe(z(async c=>c),L(c=>{const p=Tc({axisLabels:c.scaleRangeLabels,axisWidth:c.containerSize.width,padding:.5,reverse:!1})(c.axisX)+c.ordinalScaleDomain[0];return{x:(c.ordinalScale(p)+c.ordinalPadding)/c.containerPosition[0].scale[0],xValue:p}}))},TS=({containerSize$:e,visibleComputedData$:t,textSizePx$:n,rankingAmount$:r})=>{const i=({textSizePx$:c})=>c.pipe(L(h=>h*2),ie(1)),o=({minLineHeight$:c,containerSize$:h})=>G({minLineHeight:c,containerSize:h}).pipe(z(async f=>f),L(f=>f.containerSize.height>f.minLineHeight?f.containerSize.height:f.minLineHeight),Z(),ie(1)),a=({minLineHeight$:c,containerHeight$:h})=>G({minLineHeight:c,containerHeight:h}).pipe(z(async f=>f),L(f=>Math.floor(f.containerHeight/f.minLineHeight)),Z(),ie(1)),s=i({textSizePx$:n}),l=o({minLineHeight$:s,containerSize$:e}),u=a({containerHeight$:l,minLineHeight$:s});return r.pipe(z(c=>wn(()=>c==="auto",G({visibleComputedData:t,rankingAmountLimit:u}).pipe(z(async h=>h),L(h=>{const f=h.visibleComputedData.map(p=>Math.min(h.rankingAmountLimit,p.length));return Math.max(...f)})),r)))},_S=({containerSize$:e,textSizePx$:t,computedRankingAmount$:n})=>{const r=({textSizePx$:s})=>s.pipe(L(l=>l*2),ie(1)),i=({minLineHeight$:s,containerSize$:l})=>G({minLineHeight:s,containerSize:l}).pipe(z(async u=>u),L(u=>u.containerSize.height>u.minLineHeight?u.containerSize.height:u.minLineHeight),Z(),ie(1)),o=r({textSizePx$:t}),a=i({minLineHeight$:o,containerSize$:e});return G({containerHeight:a,computedRankingAmount:n}).pipe(z(async s=>s),L(s=>s.containerHeight/s.computedRankingAmount))},AS=({visibleComputedRankingData$:e,rankingItemHeight$:t})=>G({visibleComputedRankingData:e,rankingItemHeight:t}).pipe(z(async n=>n),L(n=>n.visibleComputedRankingData.map((r,i)=>{const o=r.length,a=n.rankingItemHeight*o;return mD({axisLabels:r.map(s=>s.label),axisWidth:a,padding:.5})}))),Wn="OrdinalAux",ig=H(Wn,"label-box"),og=6,ag=3,pN={name:Wn,defaultParams:Kp,layerIndex:Mp,validator:(e,{validateColumns:t})=>t(e,{showLine:{toBeTypes:["boolean"]},showLabel:{toBeTypes:["boolean"]},lineDashArray:{toBeTypes:["string"]},lineColorType:{toBeOption:"ColorType"},labelColorType:{toBeOption:"ColorType"},labelTextColorType:{toBeOption:"ColorType"},labelTextFormat:{toBeTypes:["Function"]},labelPadding:{toBeTypes:["number"]}})};function gN(e,t){return e.map((n,r)=>{const i=rn(n,t),o=typeof i=="string"?i.split(`
233
- `):[i];return{text:i,textArr:o}})}function dN({axisX:e,layout:t,fullParams:n}){return e>=0&&e<=t.width?[{id:"line-x",x1:e,x2:e,y1:0,y2:t.height,dashArray:n.lineDashArray??"none",colorType:n.lineColorType}]:[]}function mN({valueLabelData:e,axisX:t,xValue:n,fullParams:r,textSizePx:i,layout:o,rowAmount:a}){if(!(t>=0&&t<=o.width))return[];const s=t,l=-r.labelPadding*a,u=e[n]?e[n].text:"",c=e[n]?e[n].textArr:[],h=c.reduce(($,S)=>S.length>$.length?S:$,""),f=Li(h,i),p=i*c.length,g=f+og*2,m=p+ag*2,d=-g/2,y=-ag,b=d+og,x=y+ag;return[{id:"label-x",x:s,y:l-m/2,text:u,textArr:c,textWidth:f,textHeight:p,colorType:r.labelColorType,textColorType:r.labelTextColorType,rectWidth:g,rectHeight:m,rectX:d,rectY:y,textX:b,textY:x}]}function yN({selection:e,pluginName:t,lineData:n,fullParams:r,fullChartParams:i}){const o=H(t,"auxline");return e.selectAll(`line.${o}`).data(n).join(s=>s.append("line").classed(o,!0).style("stroke-width",1).style("pointer-events","none").style("vector-effect","non-scaling-stroke").attr("x1",l=>l.x1).attr("y1",l=>l.y1).attr("x2",l=>l.x2).attr("y2",l=>l.y2),s=>s.transition().duration(50).attr("x1",u=>u.x1).attr("y1",u=>u.y1).attr("x2",u=>u.x2).attr("y2",u=>u.y2),s=>s.remove()).style("stroke",s=>pe(s.colorType,i)).style("stroke-dasharray",s=>s.dashArray)}function bN(e){e.selectAll("line").data([]).exit().remove()}function xN({selection:e,labelData:t,fullParams:n,fullDataFormatter:r,fullChartParams:i,textReverseTransform:o,textSizePx:a}){return e.selectAll(`g.${ig}`).data(t).join(l=>l.append("g").classed(ig,!0).style("cursor","pointer").attr("transform",(u,c)=>`translate(${u.x}, ${u.y})`),l=>l.transition().duration(50).attr("transform",(c,h)=>`translate(${c.x}, ${c.y})`),l=>l.remove()).each((l,u,c)=>{const h=X(c[u]),f=h.selectAll("rect").data([l]).join(d=>d.append("rect").style("cursor","pointer").attr("rx",5).attr("ry",5),d=>d,d=>d.remove()).attr("width",d=>`${d.rectWidth}px`).attr("height",d=>`${d.rectHeight}px`).attr("fill",d=>pe(d.colorType,i)).attr("x",d=>d.rectX).attr("y",d=>d.rectY).style("transform",o),p=h.selectAll("text").data([l]).join(d=>d.append("text").style("dominant-baseline","hanging").style("cursor","pointer").style("pointer-events","none"),d=>d,d=>d.remove()).style("transform",o).attr("fill",d=>pe(d.textColorType,i)).attr("font-size",i.styles.textSize).attr("x",d=>d.textX).attr("y",d=>d.textY).each((d,y,b)=>{ma(X(b[y]),{textArr:l.textArr,textSizePx:a,groupAxisPosition:y===0?"bottom":"left",isContainerRotated:!1})});let g=[];p.selectAll("tspan").each((d,y,b)=>{const $=X(b[y]).node();$&&$.getBBox()&&g.push($.getBBox().width)});const m=Math.max(...g);f.attr("width",m+og*2)})}function $N(e){e.selectAll(`g.${ig}`).data([]).exit().remove()}const vN=He(pN)(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q;let a=!1;const s=t.insert("rect","g").classed(H(Wn,"rect"),!0).attr("opacity",0),{categorySelection$:l,axesSelection$:u,defsSelection$:c,graphicGSelection$:h}=Su({selection:e,pluginName:Wn,clipPathID:"test",categoryLabels$:i.isCategorySeprate$.pipe(z(x=>wn(()=>x,i.categoryLabels$,i.categoryLabels$.pipe(L($=>[$[0]]))))),containerPosition$:i.containerPosition$,graphicTransform$:i.graphicTransform$});i.layout$.pipe(C(o)).subscribe(x=>{s.attr("width",x.rootWidth).attr("height",x.rootHeight)});const f=i.fullChartParams$.pipe(C(o),L(x=>x.highlightTarget),Z()),p=i.containerPosition$.pipe(L(x=>x.reduce((S,_)=>_.columnIndex>S?_.columnIndex:S,0)+1),Z()),g=i.containerPosition$.pipe(L(x=>x.reduce((S,_)=>_.rowIndex>S?_.rowIndex:S,0)+1),Z()),m=i.containerPosition$.pipe(C(o),z(async x=>x),L(x=>`${`scale(${1/x[0].scale[0]}, ${1/x[0].scale[1]})`}`),Z()),d=hN({rootSelection:t,ordinalScaleDomain$:i.ordinalScaleDomain$,ordinalScale$:i.ordinalScale$,ordinalPadding$:i.ordinalPadding$,containerSize$:i.containerSize$,containerPosition$:i.containerPosition$,layout$:i.layout$}),y=G({valueLabels:i.valueLabels$,fullParams:i.fullParams$}).pipe(C(o),z(async x=>x),L(x=>gN(x.valueLabels,x.fullParams.labelTextFormat)),ie(1));G({axesSelection:u,layout:i.layout$,ordinalPosition:d,computedData:i.computedData$,fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,fullChartParams:i.fullChartParams$,highlightTarget:f,textReverseTransform:m,textSizePx:i.textSizePx$,columnAmount:p,rowAmount:g,valueLabelData:y}).pipe(C(o),z(async x=>x)).subscribe(x=>{const{x:$,xValue:S}=x.ordinalPosition,_=dN({axisX:$,layout:x.layout,fullParams:x.fullParams});yN({selection:x.axesSelection,pluginName:n,lineData:_,fullParams:x.fullParams,fullChartParams:x.fullChartParams});const A=mN({valueLabelData:x.valueLabelData,axisX:$,xValue:S,fullParams:x.fullParams,textSizePx:x.textSizePx,layout:x.layout,rowAmount:x.rowAmount});xN({selection:x.axesSelection,labelData:A,fullParams:x.fullParams,fullDataFormatter:x.fullDataFormatter,fullChartParams:x.fullChartParams,textReverseTransform:x.textReverseTransform,textSizePx:x.textSizePx}).on("mouseover",(P,I)=>{P.stopPropagation(),a=!0,r.event$.next({type:"multiValue",eventName:"mouseover",pluginName:Wn,highlightTarget:x.highlightTarget,valueDetail:[],datum:null,category:[],categoryIndex:-1,categoryLabel:"",data:x.computedData,event:P})}).on("mousemove",(P,I)=>{P.stopPropagation(),r.event$.next({type:"multiValue",eventName:"mousemove",pluginName:Wn,highlightTarget:x.highlightTarget,valueDetail:[],datum:null,category:[],categoryIndex:-1,categoryLabel:"",data:x.computedData,event:P})}).on("mouseout",(P,I)=>{P.stopPropagation(),a=!1,r.event$.next({type:"multiValue",eventName:"mouseout",pluginName:Wn,highlightTarget:x.highlightTarget,valueDetail:[],datum:null,category:[],categoryIndex:-1,categoryLabel:"",data:x.computedData,event:P})}).on("click",(P,I)=>{P.stopPropagation(),r.event$.next({type:"multiValue",eventName:"click",pluginName:Wn,highlightTarget:x.highlightTarget,valueDetail:[],datum:null,category:[],categoryIndex:-1,categoryLabel:"",data:x.computedData,event:P})})});const b=Ar(s,"mouseout").pipe(C(o));return G({rootRectMouseout:b,axesSelection:u}).pipe(C(o),z(async x=>x)).subscribe(x=>{setTimeout(()=>{a!=!0&&(bN(x.axesSelection),$N(x.axesSelection))})}),()=>{o.next(void 0),s.remove()}}),Bi="OrdinalAxis",wS=6,SN="start",TN="auto",_N={name:Bi,defaultParams:Qp,layerIndex:Dt,validator:(e,{validateColumns:t})=>{const n=t(e,{labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}});return n.status==="error",n}};function AN(e,t){return e.map((n,r)=>{const i=rn(n,t),o=typeof i=="string"?i.split(`
234
- `):[i];return{text:i,textArr:o}})}function wN({selection:e,axisLabelClassName:t,fullParams:n,containerSize:r,fullDataFormatter:i,fullChartParams:o}){let s=n.tickPadding+n.labelOffset[0],l,u;l=0,u=-n.tickPadding-n.labelOffset[1];let c=u;e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).each((h,f,p)=>{X(p[f]).selectAll("text").data([h]).join(g=>g.append("text").style("font-weight","bold"),g=>g,g=>g.remove()).attr("text-anchor",SN).attr("dominant-baseline",TN).attr("font-size",o.styles.textSize).style("fill",pe(n.labelColorType,o)).attr("x",s).attr("y",c).text(g=>i.xAxis.label)}).attr("transform",h=>`translate(${r.width}, ${l})`)}function PN({selection:e,ordinalXAxisClassName:t,fullParams:n,containerSize:r,fullDataFormatter:i,fullChartParams:o,ordinalScale:a,ordinalScaleDomain:s,valueLabelData:l,textRotateTransform:u,textSizePx:c,ordinalPadding:h}){const f=n.tickTextRotate?"start":"middle",p="auto",g=e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).attr("transform",`translate(${h}, 0)`),m=Math.floor(s[1])-Math.ceil(s[0])+1;let d=0,y=0;n.tickFullLine==!0?d=n.tickPadding:d=n.tickPadding-wS,y=-0;const b=hs(a).scale(a).ticks(n.ticks==="all"?m:n.ticks>m?m-1:n.ticks).tickSize(n.tickFullLine==!0?-r.height:wS).tickSizeOuter(0).tickFormat((S,_)=>{var A;return((A=l[S])==null?void 0:A.text)??""}).tickPadding(d),x=g.transition().duration(100).ease(Ft).call(b).on("end",(S,_)=>{g.selectAll(".tick text").each((A,w,P)=>{var v;const I=((v=l[A])==null?void 0:v.textArr)??[];ma(X(P[w]),{textArr:I,textSizePx:c,groupAxisPosition:"top",isContainerRotated:!0})})});return x.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?pe(n.tickColorType,o):"none").style("stroke-dasharray",n.tickFullLineDasharray).style("vector-effect","non-scaling-stroke").attr("pointer-events","none"),x.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?pe(n.axisLineColorType,o):"none").style("shape-rendering","crispEdges"),g.selectAll("text").attr("font-size",o.styles.textSize).attr("fill",pe(n.tickTextColorType,o)).attr("text-anchor",f).attr("dominant-baseline",p).attr("x",y).style("transform",u).attr("dy",0),g}function DN({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",o=>-o.width).attr("y",0).attr("width",o=>o.width*2).attr("height",o=>o.height)})}const CN=He(_N)(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=H(Bi,"xAxisG"),a=H(Bi,"axis"),s=H(Bi,"axis-label"),l=Oe(Bi,"clipPath-box"),u=Pr({selection:e,pluginName:Bi,clipPathID:null,computedData$:n.computedData$,containerPosition$:n.containerPosition$,isCategorySeprate$:n.isCategorySeprate$}).pipe(C(i));n.containerSize$.subscribe(g=>{const m=e.selectAll("defs").data([l]).join("defs"),d=[{id:l,width:g.width,height:g.height}];DN({defsSelection:m,clipPathData:d})});const c=u.pipe(C(i),L((g,m)=>g.selectAll(`g.${o}`).data([o]).join("g").classed(o,!0))),h=G({valueLabels:n.valueLabels$,fullParams:n.fullParams$}).pipe(C(i),z(async g=>g),L(g=>AN(g.valueLabels,g.fullParams.tickFormat)),ie(1)),f=G({valueLabelData:h,fullDataFormatter:n.fullDataFormatter$}).pipe(C(i),z(async g=>g),L(g=>{const d=g.valueLabelData.length-1,y=g.fullDataFormatter.xAxis.scaleDomain[0]==="min"||g.fullDataFormatter.xAxis.scaleDomain[0]==="auto"?0:g.fullDataFormatter.xAxis.scaleDomain[0],b=g.fullDataFormatter.xAxis.scaleDomain[1]==="max"||g.fullDataFormatter.xAxis.scaleDomain[1]==="auto"?d:g.fullDataFormatter.xAxis.scaleDomain[1];return[y,b]}),ie(1)),p=n.fullParams$.pipe(C(i),L(g=>g.tickTextRotate?`rotate(${g.tickTextRotate})`:""));return G({axisSelection:c,fullParams:n.fullParams$,containerSize:n.containerSize$,fullDataFormatter:n.fullDataFormatter$,fullChartParams:n.fullChartParams$,ordinalScale:n.ordinalScale$,ordinalScaleDomain:f,valueLabelData:h,textRotateTransform:p,textSizePx:n.textSizePx$,ordinalPadding:n.ordinalPadding$}).pipe(C(i),z(async g=>g)).subscribe(g=>{PN({selection:g.axisSelection,ordinalXAxisClassName:a,fullParams:g.fullParams,containerSize:g.containerSize,fullDataFormatter:g.fullDataFormatter,fullChartParams:g.fullChartParams,ordinalScale:g.ordinalScale,ordinalScaleDomain:g.ordinalScaleDomain,valueLabelData:g.valueLabelData,textRotateTransform:g.textRotateTransform,textSizePx:g.textSizePx,ordinalPadding:g.ordinalPadding}),wN({selection:g.axisSelection,axisLabelClassName:s,fullParams:g.fullParams,containerSize:g.containerSize,fullDataFormatter:g.fullDataFormatter,fullChartParams:g.fullChartParams})}),()=>{i.next(void 0)}}),LN="end",MN="middle",kN="end",RN="auto";function IN({selection:e,textClassName:t,fullParams:n,containerSize:r,fullDataFormatter:i,fullChartParams:o}){const a=n.barLabel.padding-n.axisLabel.offset[0],s=-n.barLabel.padding-n.axisLabel.offset[1];let l=-a,u=-s;e.attr("transform",c=>`translate(0, ${r.height})`).selectAll("text").data([n]).join(c=>c.append("text").style("font-weight","bold"),c=>c,c=>c.remove()).attr("text-anchor",kN).attr("dominant-baseline",RN).attr("font-size",o.styles.textSize).style("fill",pe(n.axisLabel.colorType,o)).attr("x",l).attr("y",u).text(c=>i.yAxis.label)}function EN({selection:e,fullParams:t,fullChartParams:n,transitionEase:r,rankingScale:i,valueScale:o,categoryData:a}){const s=t.barLabel.position==="none"?[]:a;return e.selectAll("text").data(s,u=>u.id).join(u=>u.append("text").style("font-weight","bold").style("pointer-events","none").attr("x",c=>o(c.value[c.xValueIndex]??0)-t.barLabel.padding).attr("y",c=>i(c.label)),u=>u.transition().duration(n.transitionDuration).ease(_r(r)).attr("x",c=>o(c.value[c.xValueIndex]??0)-t.barLabel.padding).attr("y",c=>i(c.label)),u=>u.remove()).attr("text-anchor",LN).attr("dominant-baseline",MN).attr("font-size",n.styles.textSize).style("fill",u=>Se({colorType:t.barLabel.colorType,fullChartParams:n,datum:u})).text(u=>u.label)}function BN({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",o=>-o.width).attr("y",0).attr("width",o=>o.width*2).attr("height",o=>o.height)})}const PS=(e,{selection:t,computedData$:n,visibleComputedRankingData$:r,rankingScaleList$:i,xScale$:o,fullParams$:a,fullDataFormatter$:s,fullChartParams$:l,transitionEase$:u,containerPosition$:c,containerSize$:h,isCategorySeprate$:f})=>{const p=new Q,g=H(e,"box"),m=H(e,"text"),d=Oe(e,"clipPath-box"),y=Pr({selection:t,pluginName:e,clipPathID:null,computedData$:n,containerPosition$:c,isCategorySeprate$:f}).pipe(C(p)),b=a.pipe(L(x=>x.barLabel.position),Z(),z(x=>wn(()=>x==="inside",o,Ct(()=>0))));return h.subscribe(x=>{const $=t.selectAll("defs").data([d]).join("defs"),S=[{id:d,width:x.width,height:x.height}];BN({defsSelection:$,clipPathData:S})}),G({containerSelection:y,fullParams:a,containerSize:h,fullDataFormatter:s,fullChartParams:l,transitionEase:u,visibleComputedRankingData:r,rankingScaleList:i,valueScale:b}).pipe(C(p),z(async x=>x)).subscribe(x=>{x.containerSelection.each(($,S,_)=>{const A=X(_[S]),w=x.rankingScaleList[S];if(!w)return;const P=A.selectAll(`g.${g}`).data([S]).join("g").attr("class",g).attr("clip-path",`url(#${d})`),I=A.selectAll(`g.${m}`).data([x.fullParams]).join("g").classed(m,!0);EN({selection:P,fullParams:x.fullParams,fullChartParams:x.fullChartParams,transitionEase:x.transitionEase,rankingScale:w,categoryData:x.visibleComputedRankingData[S],valueScale:x.valueScale}),IN({selection:I,textClassName:m,fullParams:x.fullParams,containerSize:x.containerSize,fullDataFormatter:x.fullDataFormatter,fullChartParams:x.fullChartParams})})}),()=>{p.next(void 0)}};function NN({containerSelection:e,paddingGClassName:t,itemGClassName:n,bubbleData:r,transitionDuration:i,transitionEase:o,ordinalPadding:a}){return e.each((l,u,c)=>{X(c[u]).selectAll(`g.${t}`).data([0]).join(f=>f.append("g").attr("class",t),f=>f,f=>f.remove()).attr("transform",`translate(${a}, 0)`).each((f,p,g)=>{X(g[p]).selectAll(`g.${n}`).data(r[u]??[],d=>d.id).join(d=>d.append("g").attr("class",n).attr("cursor","pointer").attr("transform",y=>`translate(0, ${y.graphicValue[0]?y.graphicValue[0].y:0})`),d=>d.transition().duration(i).ease(_r(o)).attr("transform",y=>`translate(0, ${y.graphicValue[0]?y.graphicValue[0].y:0})`),d=>d.remove())})}),e.selectAll(`g.${n}`)}function FN({graphicGSelection:e,transitionDuration:t}){return e.each((r,i,o)=>{X(o[i]).selectAll("circle").data(r.graphicValue).join("circle").attr("fill",s=>r.color).style("opacity",s=>s.opacity).transition().duration(100).ease(Ft).attr("cx",s=>s.x).attr("r",s=>s.r)}),e.selectAll("circle")}function zN({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function ON({selection:e,ids:t,fullChartParams:n}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").duration(200).style("opacity",(r,i)=>r.opacity);return}e.each((r,i,o)=>{const a=r._refDatum;t.includes(a.id)?X(o[i]).style("opacity",s=>s.opacity):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const GN=(e,{selection:t,computedData$:n,visibleComputedRankingData$:r,CategoryDataMap$:i,valueLabels$:o,fullParams$:a,fullDataFormatter$:s,fullChartParams$:l,highlight$:u,rankingItemHeight$:c,rankingScaleList$:h,containerPosition$:f,containerSize$:p,ordinalScale$:g,ordinalPadding$:m,isCategorySeprate$:d,event$:y})=>{const b=new Q,x=Oe(e,"clipPath-box"),$=H(e,"padding-g"),S=H(e,"item-g"),_=Pr({selection:t,pluginName:e,clipPathID:x,computedData$:n,containerPosition$:f,isCategorySeprate$:d}).pipe(C(b));p.subscribe(k=>{const B=t.selectAll("defs").data([x]).join("defs"),F=[{id:x,width:k.width,height:k.height}];zN({defsSelection:B,clipPathData:F})});const A=G({sizeAdjust:a.pipe(L(k=>k.bubble.sizeAdjust),Z()),rankingItemHeight:c}).pipe(C(b),z(async k=>k),L(k=>k.rankingItemHeight*k.sizeAdjust/2),Z(),ie(1)),w=G({visibleComputedRankingData:r,scaleDomain:s.pipe(L(k=>k.xAxis.scaleDomain))}).pipe(C(b),z(async k=>k),L(k=>{const B=k.visibleComputedRankingData[0]&&k.visibleComputedRankingData[0][0]?k.visibleComputedRankingData[0][0].value:[];let F=k.scaleDomain[0]==="auto"||k.scaleDomain[0]==="min"?0:k.scaleDomain[0],E=k.scaleDomain[1]==="auto"||k.scaleDomain[1]==="max"?B.length-1:k.scaleDomain[1];return[F,E]}),Z((k,B)=>k[0]===B[0]&&k[1]===B[1]),ie(1)),P=G({visibleComputedRankingData:r,scaleDomain:w}).pipe(C(b),z(async k=>k),L(k=>{let B=0,F=0;return k.visibleComputedRankingData.forEach(E=>{E.forEach(W=>{for(let j=k.scaleDomain[0];j<=k.scaleDomain[1];j++){const te=W.value[j];te!=null&&(te>F?F=te:te<B&&(B=te))}})}),[B,F]}),Z(),ie(1)),I=G({minMaxValue:P,fullParams:a}).pipe(C(b),L(k=>Nn().domain(k.minMaxValue).range(k.fullParams.bubble.valueLinearOpacity)),Z(),ie(1)),v=G({maxRadius:A,minMaxValue:P,arcScaleType:a.pipe(L(k=>k.bubble.arcScaleType),Z())}).pipe(C(b),z(async k=>k),L(k=>mn().domain([0,k.minMaxValue[1]]).range([2,k.maxRadius]).exponent(k.arcScaleType==="area"?.5:1)),Z(),ie(1)),N=G({visibleComputedRankingData:r,radiusScale:v,rankingScaleList:h,ordinalScale:g,opacityScale:I,scaleDomain:w,containerSize:p}).pipe(C(b),z(async k=>k),L(k=>k.visibleComputedRankingData.map((B,F)=>{const E=k.rankingScaleList[F];return B.map((W,j)=>{const te=W,V=te.value.map((ee,Y)=>{let J=k.ordinalScale(Y);return k.scaleDomain[0]===k.scaleDomain[1]&&(Y>k.scaleDomain[0]?J+=k.containerSize.width*1.5:Y<k.scaleDomain[0]&&(J-=k.containerSize.width*1.5)),{valueIndex:Y,x:J,y:E(te.label),r:k.radiusScale(ee),opacity:k.opacityScale(ee),_refDatum:te}});return te.graphicValue=V,te})}))),R=l.pipe(C(b),L(k=>k.transitionDuration),Z()),D=l.pipe(C(b),L(k=>k.transitionEase),Z()),T=G({containerSelection:_,bubbleData:N,rankingScaleList:h,transitionDuration:R,transitionEase:D,ordinalPadding:m}).pipe(C(b),z(async k=>k),L(k=>NN({containerSelection:k.containerSelection,paddingGClassName:$,itemGClassName:S,bubbleData:k.bubbleData,transitionDuration:k.transitionDuration,transitionEase:k.transitionEase,ordinalPadding:k.ordinalPadding}))),M=G({graphicGSelection:T,ordinalScale:g,bubbleData:N,transitionDuration:R,fullParams:a}).pipe(C(b),z(async k=>k),L(k=>FN({graphicGSelection:k.graphicGSelection,transitionDuration:k.transitionDuration})),ie(1)),O=l.pipe(C(b),L(k=>k.highlightTarget),Z());return G({graphicSelection:M,computedData:n,CategoryDataMap:i,valueLabels:o,highlightTarget:O,fullDataFormatter:s}).pipe(C(b),z(async k=>k)).subscribe(k=>{k.graphicSelection.on("mouseover",(B,F)=>{const E=F._refDatum;y.next({type:"multiValue",eventName:"mouseover",pluginName:e,highlightTarget:k.highlightTarget,valueDetail:[{value:E.value[F.valueIndex],valueIndex:F.valueIndex,valueLabel:k.valueLabels[F.valueIndex]}],datum:E,category:k.CategoryDataMap.get(E.categoryLabel),categoryIndex:E.categoryIndex,categoryLabel:E.categoryLabel,data:k.computedData,event:B})}).on("mousemove",(B,F)=>{const E=F._refDatum;y.next({type:"multiValue",eventName:"mousemove",pluginName:e,highlightTarget:k.highlightTarget,valueDetail:[{value:E.value[F.valueIndex],valueIndex:F.valueIndex,valueLabel:k.valueLabels[F.valueIndex]}],datum:E,category:k.CategoryDataMap.get(E.categoryLabel),categoryIndex:E.categoryIndex,categoryLabel:E.categoryLabel,data:k.computedData,event:B})}).on("mouseout",(B,F)=>{const E=F._refDatum;y.next({type:"multiValue",eventName:"mouseout",pluginName:e,highlightTarget:k.highlightTarget,valueDetail:[{value:E.value[F.valueIndex],valueIndex:F.valueIndex,valueLabel:k.valueLabels[F.valueIndex]}],datum:E,category:k.CategoryDataMap.get(E.categoryLabel),categoryIndex:E.categoryIndex,categoryLabel:E.categoryLabel,data:k.computedData,event:B})}).on("click",(B,F)=>{const E=F._refDatum;y.next({type:"multiValue",eventName:"click",pluginName:e,highlightTarget:k.highlightTarget,valueDetail:[{value:E.value[F.valueIndex],valueIndex:F.valueIndex,valueLabel:k.valueLabels[F.valueIndex]}],datum:E,category:k.CategoryDataMap.get(E.categoryLabel),categoryIndex:E.categoryIndex,categoryLabel:E.categoryLabel,data:k.computedData,event:B})})}),G({graphicSelection:M,highlight:u.pipe(L(k=>k.map(B=>B.id))),fullChartParams:l}).pipe(C(b),z(async k=>k)).subscribe(k=>{ON({selection:k.graphicSelection,ids:k.highlight,fullChartParams:k.fullChartParams})}),()=>{b.next(void 0)}},ba="OrdinalBubbles",WN=He({name:ba,defaultParams:bS,layerIndex:at,validator:(e,{validateColumns:t})=>{const n=t(e,{bubble:{toBeTypes:["object"]},itemLabel:{toBeTypes:["object"]},axisLabel:{toBeTypes:["object"]},rankingAmount:{toBe:'number | "auto"',test:r=>typeof r=="number"||r==="auto"}});if(e.bubble){const r=t(e.bubble,{sizeAdjust:{toBeTypes:["number"]},arcScaleType:{toBe:'"area" | "radius"',test:i=>i==="area"||i==="radius"},valueLinearOpacity:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"}});if(r.status==="error")return r}if(e.itemLabel){const r=t(e.itemLabel,{padding:{toBeTypes:["number"]},colorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}if(e.axisLabel){const r=t(e.axisLabel,{offset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},colorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}return n}})(({selection:e,name:t,observer:n,subject:r})=>{const i=e.append("g").attr("class",`${ba}-bubbles`),o=e.append("g").attr("class",`${ba}-labels`),a=new Q,s=n.fullParams$.pipe(C(a),L(g=>({barLabel:{...g.itemLabel,position:"outside"},axisLabel:{...g.axisLabel}}))),l=n.fullParams$.pipe(C(a),L(g=>g.rankingAmount),Z()),u=TS({containerSize$:n.containerSize$,visibleComputedData$:n.visibleComputedData$,textSizePx$:n.textSizePx$,rankingAmount$:l}).pipe(C(a),ie(1)),c=_S({containerSize$:n.containerSize$,textSizePx$:n.textSizePx$,computedRankingAmount$:u}).pipe(C(a),ie(1)),h=AS({visibleComputedRankingData$:n.visibleComputedRankingBySumData$,rankingItemHeight$:c}).pipe(C(a),ie(1)),f=PS(`${ba}-labels`,{selection:o,computedData$:n.computedData$,visibleComputedRankingData$:n.visibleComputedRankingBySumData$,rankingScaleList$:h,xScale$:n.xScale$,fullParams$:s,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,transitionEase$:n.fullChartParams$.pipe(L(g=>g.transitionEase),Z()),containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,isCategorySeprate$:n.isCategorySeprate$}),p=GN(`${ba}-bubbles`,{selection:i,computedData$:n.computedData$,visibleComputedRankingData$:n.visibleComputedRankingBySumData$,CategoryDataMap$:n.CategoryDataMap$,valueLabels$:n.valueLabels$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,highlight$:n.highlight$,rankingItemHeight$:c,rankingScaleList$:h,containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,ordinalPadding$:n.ordinalPadding$,ordinalScale$:n.ordinalScale$,isCategorySeprate$:n.isCategorySeprate$,event$:r.event$});return()=>{a.next(void 0),f(),p()}}),DS=(e,{rootSelection:t,dataFormatter$:n,fullDataFormatter$:r,xyMinMax$:i,layout$:o})=>{const a=new Q;let s={k:1,x:0,y:0};const l=r.pipe(L(f=>f.xAxis),Yi()),u=r.pipe(L(f=>f.yAxis),Yi()),c=new me(f=>{G({initXAxis:l,layout:o,xyMinMax:i}).pipe(C(a),z(async p=>p)).subscribe(p=>{const g=Sc({maxValue:p.xyMinMax.maxX,minValue:p.xyMinMax.minX,axisWidth:p.layout.width,scaleDomain:p.initXAxis.scaleDomain,scaleRange:p.initXAxis.scaleRange});f.next(g)})}),h=G({initXAxis:l,initYAxis:u,xyMinMax:i}).pipe(C(a),z(async f=>f),L(f=>{let p=f.xyMinMax.minX,g=f.xyMinMax.maxX,m=f.xyMinMax.minY,d=f.xyMinMax.maxY;return f.initXAxis.scaleDomain[0]==="auto"&&p>0&&(p=0),f.initXAxis.scaleDomain[1]==="auto"&&g<0&&(g=0),f.initYAxis.scaleDomain[0]==="auto"&&m>0&&(m=0),f.initYAxis.scaleDomain[1]==="auto"&&d<0&&(d=0),{minX:p,maxX:g,minY:m,maxY:d}}));return G({initXScale:c,fullDataFormatter:r,minMaxScaleDomain:h}).pipe(C(a),z(async f=>f)).subscribe(f=>{const p=f.initXScale.copy(),g=Sn().on("zoom",function(d){const y=d.transform,b=S=>{const _=Math.round(S);return Math.min(f.minMaxScaleDomain.maxX,Math.max(f.minMaxScaleDomain.minX,_))},x=y.rescaleX(p).domain().map(b);x[0]<=f.minMaxScaleDomain.minX&&x[1]>=f.minMaxScaleDomain.maxX?y.k<s.k&&(y.k=s.k,y.x=s.x,y.y=s.y):x[1]-x[0]<=1&&y.k>s.k&&(y.k=s.k,y.x=s.x,y.y=s.y),s.k=y.k,s.x=y.x,s.y=y.y;const $={...f.fullDataFormatter,xAxis:{...f.fullDataFormatter.xAxis,scaleDomain:x}};n.next($)});t.call(g)}),()=>{a.next(void 0),t.call(Sn().on("zoom",null))}},CS="OrdinalZoom",VN=He({name:CS,defaultParams:rg,layerIndex:Lp,validator:(e,{validateColumns:t})=>({status:"success",columnName:"",expectToBe:""})})(({selection:e,rootSelection:t,name:n,observer:r,subject:i})=>{const o=new Q,a=r.computedData$.pipe(C(o),L(l=>({minX:0,maxX:l[0]&&l[0][0]?l[0][0].value.length-1:0,minY:0,maxY:0}))),s=DS(CS,{rootSelection:t,fullDataFormatter$:r.fullDataFormatter$,xyMinMax$:a,layout$:r.layout$,dataFormatter$:i.dataFormatter$});return()=>{o.next(void 0),s()}}),YN="start",XN="middle";function UN({selection:e,fullParams:t,fullChartParams:n,rankingScale:r,xScale:i,categoryData:o,computedRankingAmount:a}){const s=o.slice(0,a+1);return e.selectAll("g").data(s,c=>c.id).join(c=>c.append("g").attr("transform",h=>`translate(${i(h.value[h.xValueIndex]??0)+t.padding}, ${r(h.label)})`),c=>c.transition().duration(n.transitionDuration).ease(Ft).attr("transform",h=>`translate(${i(h.value[h.xValueIndex]??0)+t.padding}, ${r(h.label)})`),c=>c.remove()).each((c,h,f)=>{X(f[h]).selectAll("text").data([c]).join(g=>g.append("text"),g=>g,g=>g.remove()).attr("text-anchor",YN).attr("dominant-baseline",XN).attr("font-size",n.styles.textSize).style("fill",pe(t.colorType,n)).transition().duration(n.transitionDuration).ease(Ft).textTween(g=>{const m=g.xValueIndex,d=m===0?0:m-1,y=g.value[d],b=g.value[m];return x=>{const $=x===1?bt(y,b)(x):So(y,b)(x);return rn($,t.format)}})}).selectAll("text")}function jN({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",o=>0).attr("y",0).attr("width",o=>o.width*1.5).attr("height",o=>o.height)})}const HN=(e,{selection:t,computedData$:n,visibleComputedRankingData$:r,rankingScaleList$:i,xScale$:o,computedRankingAmount$:a,fullParams$:s,fullChartParams$:l,containerPosition$:u,containerSize$:c,isCategorySeprate$:h})=>{const f=new Q,p=H(e,"box"),g=Oe(e,"clipPath-box"),m=Pr({selection:t,pluginName:e,clipPathID:null,computedData$:n,containerPosition$:u,isCategorySeprate$:h}).pipe(C(f));return c.subscribe(d=>{const y=t.selectAll("defs").data([g]).join("defs"),b=[{id:g,width:d.width,height:d.height}];jN({defsSelection:y,clipPathData:b})}),G({containerSelection:m,fullParams:s,fullChartParams:l,visibleComputedRankingData:r,rankingScaleList:i,xScale:o,computedRankingAmount:a}).pipe(C(f),z(async d=>d)).subscribe(d=>{d.containerSelection.each((y,b,x)=>{const $=X(x[b]),S=d.rankingScaleList[b];if(!S)return;const _=$.selectAll(`g.${p}`).data([b]).join("g").attr("class",p).attr("clip-path",`url(#${g})`);UN({selection:_,fullParams:d.fullParams,fullChartParams:d.fullChartParams,rankingScale:S,categoryData:d.visibleComputedRankingData[b],xScale:d.xScale,computedRankingAmount:d.computedRankingAmount})})}),()=>{f.next(void 0)}};function qN({containerSelection:e,visibleComputedRankingData:t,rankingScaleList:n,transitionDuration:r}){return e.each((o,a,s)=>{X(s[a]).selectAll("g").data(t[a]??[],u=>u.id).join(u=>u.append("g").attr("cursor","pointer").attr("transform",c=>`translate(0, ${n[a]&&n[a](c.label)})`),u=>u.transition().duration(r).ease(Ft).attr("transform",c=>`translate(0, ${n[a]&&n[a](c.label)})`),u=>u.remove())}),e.selectAll("g")}function ZN({graphicGSelection:e,rectClassName:t,xScale:n,fullParams:r,barWidth:i,transitionDuration:o}){return e.each((s,l,u)=>{const c=i/2,h=r.bar.barRadius===!0?c:r.bar.barRadius===!1?0:typeof r.bar.barRadius=="number"?r.bar.barRadius:0;X(u[l]).selectAll(`rect.${t}`).data([s],p=>p.id).join(p=>p.append("rect").classed(t,!0).attr("cursor","pointer").attr("width",g=>n(g.value[g.xValueIndex])??1).attr("height",i),p=>p.transition().duration(o).ease(Ft).attr("width",g=>n(g.value[g.xValueIndex])??1).attr("height",i),p=>p.remove()).attr("transform",`translate(0, ${-c})`).attr("fill",p=>p.color).attr("rx",h).attr("ry",h)}),e.selectAll(`rect.${t}`)}function KN({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function QN({selection:e,ids:t,fullChartParams:n}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").duration(200).style("opacity",1);return}e.each((r,i,o)=>{t.includes(r.id)?X(o[i]).style("opacity",1):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const JN=(e,{selection:t,computedData$:n,visibleComputedRankingData$:r,CategoryDataMap$:i,fullParams$:o,fullDataFormatter$:a,fullChartParams$:s,highlight$:l,rankingItemHeight$:u,rankingScaleList$:c,containerPosition$:h,containerSize$:f,xScale$:p,isCategorySeprate$:g,event$:m})=>{const d=new Q,y=Oe(e,"clipPath-box"),b=H(e,"rect"),x=Pr({selection:t,pluginName:e,clipPathID:y,computedData$:n,containerPosition$:h,isCategorySeprate$:g}).pipe(C(d));f.subscribe(P=>{const I=t.selectAll("defs").data([y]).join("defs"),v=[{id:y,width:P.width,height:P.height}];KN({defsSelection:I,clipPathData:v})});const $=G({fullParams:o,rankingItemHeight:u}).pipe(C(d),z(async P=>P),L(P=>P.fullParams.bar.barWidth?P.fullParams.bar.barWidth:P.rankingItemHeight-P.fullParams.bar.barPadding),Z()),S=s.pipe(C(d),L(P=>P.transitionDuration),Z()),_=G({containerSelection:x,visibleComputedRankingData:r,rankingScaleList:c,transitionDuration:S}).pipe(C(d),z(async P=>P),L(P=>qN({containerSelection:P.containerSelection,visibleComputedRankingData:P.visibleComputedRankingData,rankingScaleList:P.rankingScaleList,transitionDuration:P.transitionDuration}))),A=G({graphicGSelection:_,xScale:p,barWidth:$,transitionDuration:S,fullParams:o}).pipe(C(d),z(async P=>P),L(P=>ZN({graphicGSelection:P.graphicGSelection,rectClassName:b,xScale:P.xScale,fullParams:P.fullParams,barWidth:P.barWidth,transitionDuration:P.transitionDuration})),ie(1)),w=s.pipe(C(d),L(P=>P.highlightTarget),Z());return G({graphicSelection:A,computedData:n,CategoryDataMap:i,highlightTarget:w,fullDataFormatter:a}).pipe(C(d),z(async P=>P)).subscribe(P=>{P.graphicSelection.on("mouseover",(I,v)=>{m.next({type:"multiValue",eventName:"mouseover",pluginName:e,highlightTarget:P.highlightTarget,valueDetail:[{value:v.value[v.xValueIndex],valueIndex:v.xValueIndex,valueLabel:P.fullDataFormatter.valueLabels[v.xValueIndex]??String(v.xValueIndex)}],datum:v,category:P.CategoryDataMap.get(v.categoryLabel),categoryIndex:v.categoryIndex,categoryLabel:v.categoryLabel,data:P.computedData,event:I})}).on("mousemove",(I,v)=>{m.next({type:"multiValue",eventName:"mousemove",pluginName:e,highlightTarget:P.highlightTarget,valueDetail:[{value:v.value[v.xValueIndex],valueIndex:v.xValueIndex,valueLabel:P.fullDataFormatter.valueLabels[v.xValueIndex]??String(v.xValueIndex)}],datum:v,category:P.CategoryDataMap.get(v.categoryLabel),categoryIndex:v.categoryIndex,categoryLabel:v.categoryLabel,data:P.computedData,event:I})}).on("mouseout",(I,v)=>{m.next({type:"multiValue",eventName:"mouseout",pluginName:e,highlightTarget:P.highlightTarget,valueDetail:[{value:v.value[v.xValueIndex],valueIndex:v.xValueIndex,valueLabel:P.fullDataFormatter.valueLabels[v.xValueIndex]??String(v.xValueIndex)}],datum:v,category:P.CategoryDataMap.get(v.categoryLabel),categoryIndex:v.categoryIndex,categoryLabel:v.categoryLabel,data:P.computedData,event:I})}).on("click",(I,v)=>{m.next({type:"multiValue",eventName:"click",pluginName:e,highlightTarget:P.highlightTarget,valueDetail:[{value:v.value[v.xValueIndex],valueIndex:v.xValueIndex,valueLabel:P.fullDataFormatter.valueLabels[v.xValueIndex]??String(v.xValueIndex)}],datum:v,category:P.CategoryDataMap.get(v.categoryLabel),categoryIndex:v.categoryIndex,categoryLabel:v.categoryLabel,data:P.computedData,event:I})})}),G({graphicSelection:A,highlight:l.pipe(L(P=>P.map(I=>I.id))),fullChartParams:s}).pipe(C(d),z(async P=>P)).subscribe(P=>{QN({selection:P.graphicSelection,ids:P.highlight,fullChartParams:P.fullChartParams})}),()=>{d.next(void 0)}},Dr="RacingBars",eF=He({name:Dr,defaultParams:Jp,layerIndex:at,validator:(e,{validateColumns:t})=>{const n=t(e,{bar:{toBeTypes:["object"]},barLabel:{toBeTypes:["object"]},valueLabel:{toBeTypes:["object"]},axisLabel:{toBeTypes:["object"]},rankingAmount:{toBe:'number | "auto"',test:r=>typeof r=="number"||r==="auto"},autorun:{toBeTypes:["boolean"]},loop:{toBeTypes:["boolean"]}});if(e.bar){const r=t(e.bar,{barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}});if(r.status==="error")return r}if(e.barLabel){const r=t(e.barLabel,{position:{toBe:'"inside" | "outside" | "none"',test:i=>i==="inside"||i==="outside"||i==="none"},padding:{toBeTypes:["number"]},colorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}if(e.valueLabel){const r=t(e.valueLabel,{padding:{toBeTypes:["number"]},colorType:{toBeOption:"ColorType"},format:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.axisLabel){const r=t(e.axisLabel,{offset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},colorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}return n}})(({selection:e,name:t,observer:n,subject:r})=>{const i=e.append("g").attr("class",`${Dr}-bars`),o=e.append("g").attr("class",`${Dr}-labels`),a=e.append("g").attr("class",`${Dr}-valueLabels`),s=new Q,l=n.fullParams$.pipe(C(s),L(S=>S.valueLabel)),u=n.fullParams$.pipe(C(s),L(S=>S.rankingAmount),Z()),c=TS({containerSize$:n.containerSize$,visibleComputedData$:n.visibleComputedData$,textSizePx$:n.textSizePx$,rankingAmount$:u}).pipe(C(s),ie(1)),h=_S({containerSize$:n.containerSize$,textSizePx$:n.textSizePx$,computedRankingAmount$:c}).pipe(C(s),ie(1)),f=AS({visibleComputedRankingData$:n.visibleComputedRankingByIndexData$,rankingItemHeight$:h}).pipe(C(s),ie(1)),p=PS(`${Dr}-labels`,{selection:o,computedData$:n.computedData$,visibleComputedRankingData$:n.visibleComputedRankingByIndexData$,rankingScaleList$:f,xScale$:n.xScale$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,transitionEase$:Ct("easeLinear"),containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,isCategorySeprate$:n.isCategorySeprate$}),g=HN(`${Dr}-valueLabels`,{selection:a,computedData$:n.computedData$,visibleComputedRankingData$:n.visibleComputedRankingByIndexData$,rankingScaleList$:f,xScale$:n.xScale$,computedRankingAmount$:c,fullParams$:l,fullChartParams$:n.fullChartParams$,containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,isCategorySeprate$:n.isCategorySeprate$}),m=JN(`${Dr}-bars`,{selection:i,computedData$:n.computedData$,visibleComputedRankingData$:n.visibleComputedRankingByIndexData$,CategoryDataMap$:n.CategoryDataMap$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,highlight$:n.highlight$,rankingItemHeight$:h,rankingScaleList$:f,xScale$:n.xScale$,containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,isCategorySeprate$:n.isCategorySeprate$,event$:r.event$}),d=n.visibleComputedRankingByIndexData$.pipe(C(s),L(S=>(S[0]&&S[0][0]&&S[0][0].value.length)??0),Z()),y=n.fullParams$.pipe(C(s),L(S=>S.autorun),Z()),b=n.fullParams$.pipe(C(s),L(S=>S.loop),Z()),x=n.fullChartParams$.pipe(C(s),L(S=>S.transitionDuration),Z());let $=!0;return G({autorun:y,loop:b,valueAmount:d,tickDurationPeriod:x,fullDataFormatter:n.fullDataFormatter$}).pipe(C(s),z(async S=>S)).subscribe(({autorun:S,loop:_,valueAmount:A,tickDurationPeriod:w,fullDataFormatter:P})=>{if($!=!1&&S){const I=P.xAxis.valueIndex+1;I<A?($=!1,setTimeout(()=>{r.dataFormatter$.next({...P,xAxis:{...P.xAxis,valueIndex:I}}),$=!0},w)):I>=A&&_&&($=!1,setTimeout(()=>{r.dataFormatter$.next({...P,xAxis:{...P.xAxis,valueIndex:0}}),$=!0},w))}}),()=>{s.next(void 0),p(),g(),m()}}),xa="RacingCounterTexts",LS=H(xa,"container"),Ni=H(xa,"box"),sg=H(xa,"text"),tF={name:xa,defaultParams:eg,layerIndex:bu,validator:(e,{validateColumns:t})=>t(e,{renderFn:{toBeTypes:["Function"]},textAttrs:{toBeTypes:["object[]"]},textStyles:{toBeTypes:["object[]"]},paddingRight:{toBeTypes:["number"]},paddingBottom:{toBeTypes:["number"]}})};function nF({selection:e,data:t,fullParams:n,containerSize:r}){const i=r.width-n.paddingRight,o=r.height-n.paddingBottom;return e.selectAll(`g.${Ni}`).data([Ni]).join("g").classed(Ni,!0).attr("transform",`translate(${i}, ${o})`).each((s,l,u)=>{X(u[l]).selectAll(`text.${sg}`).data(t).join("text").classed(sg,!0).each((h,f,p)=>{const g=X(p[f]).text(h.text);Object.keys(h.attr).forEach(m=>{g.attr(m,h.attr[m])}),Object.keys(h.style).forEach(m=>{g.style(m,h.style[m])})})}).selectAll(`text.${sg}`)}function rF({computedData:e,valueLabel:t,valueIndex:n,renderFn:r,textAttrs:i,textStyles:o}){const a=t||String(n),s=r(a,n,e);return(Array.isArray(s)?s:[s]).map((u,c)=>({text:u,attr:i[c],style:o[c]}))}function iF(e,t){const n=new Q;return G({textData:t.textData$,fullParams:t.fullParams$,containerSize:t.containerSize$}).pipe(C(n)).subscribe(r=>{nF({selection:t.containerSelection,data:r.textData,fullParams:r.fullParams,containerSize:r.containerSize})}),()=>{n.next(void 0)}}const oF=He(tF)(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=G({computedData:n.computedData$.pipe(Z((u,c)=>u.length===c.length)),isCategorySeprate:n.isCategorySeprate$}).pipe(C(i),z(async u=>u),L(u=>u.isCategorySeprate?u.computedData:[u.computedData[0]]),L((u,c)=>e.selectAll(`g.${LS}`).data(u,h=>h&&h[0]?h[0].categoryIndex:c).join("g").classed(LS,!0)));o.pipe(C(i),L((u,c)=>u.selectAll(`g.${Ni}`).data([Ni]).join("g").classed(Ni,!0))),G({containerSelection:o,gridContainerPosition:n.containerPosition$}).pipe(C(i),z(async u=>u)).subscribe(u=>{u.containerSelection.attr("transform",(c,h)=>{const f=u.gridContainerPosition[h]??u.gridContainerPosition[0],p=f.translate;return f.scale,`translate(${p[0]}, ${p[1]})`})});const a=G({xyValueIndex:n.xyValueIndex$,fullDataFormatter:n.fullDataFormatter$}).pipe(C(i),z(async u=>u),L(u=>u.fullDataFormatter.valueLabels[u.xyValueIndex[0]]??""),Z(),ie(1)),s=G({xyValueIndex:n.xyValueIndex$,valueLabel:a,computedData:n.computedData$,fullParams:n.fullParams$}).pipe(C(i),z(async u=>u),L(u=>rF({valueIndex:u.xyValueIndex[0],valueLabel:u.valueLabel,computedData:u.computedData,renderFn:u.fullParams.renderFn,textAttrs:u.fullParams.textAttrs,textStyles:u.fullParams.textStyles})),ie(1)),l=[];return o.pipe(C(i)).subscribe(u=>{l.forEach(c=>c()),u.each((c,h,f)=>{const p=X(f[h]);n.visibleComputedRankingByIndexData$.pipe(C(i),L(g=>g[h]??g[0])),n.containerPosition$.pipe(C(i),L(g=>g[h]??g[0])),l[h]=iF(xa,{containerSelection:p,textData$:s,fullParams$:n.fullParams$,valueLabel$:a,xyValueIndex$:n.xyValueIndex$,containerSize$:n.containerSize$})})}),()=>{i.next(void 0),l.forEach(u=>u())}}),aF=6,sF="middle",lF="hanging",uF="start",cF="hanging";function fF({selection:e,position:t,xLabelClassName:n,fullParams:r,containerSize:i,fullDataFormatter:o,fullChartParams:a}){let l=r.tickPadding+r.labelOffset[0],u,c;t==="top"?(u=0,c=-r.tickPadding-r.labelOffset[1]):(u=i.height,c=r.tickPadding+r.labelOffset[1]);let h=c;e.selectAll(`g.${n}`).data([r]).join("g").classed(n,!0).each((f,p,g)=>{X(g[p]).selectAll("text").data([f]).join(m=>m.append("text").style("font-weight","bold"),m=>m,m=>m.remove()).attr("text-anchor",uF).attr("dominant-baseline",cF).attr("font-size",a.styles.textSize).style("fill",pe(r.labelColorType,a)).attr("x",l).attr("y",h).text(m=>o.xAxis.label)}).attr("transform",f=>`translate(${i.width}, ${u})`)}function hF({selection:e,position:t,xAxisClassName:n,fullParams:r,containerSize:i,fullChartParams:o,xScale:a,transitionDuration:s}){let l,u;t==="top"?(l=0,u=hs(a)):(l=i.height,u=Km(a));const c=e.selectAll(`g.${n}`).data([r]).join("g").classed(n,!0).attr("transform",`translate(0, ${l})`);let h=r.tickPadding;const f=u.scale(a).ticks(r.ticks).tickFormat(m=>rn(m,r.tickFormat)).tickSize(r.tickFullLine==!0?-i.height:aF).tickSizeOuter(-i.height).tickPadding(h),p=c.transition().duration(s).ease(Ft).call(f);return p.selectAll("line").style("fill","none").style("stroke",r.tickLineVisible==!0?pe(r.tickColorType,o):"none").style("stroke-dasharray",r.tickFullLineDasharray).attr("pointer-events","none"),p.selectAll("path").style("fill","none").style("stroke",r.axisLineVisible==!0?pe(r.axisLineColorType,o):"none").style("shape-rendering","crispEdges"),c.selectAll("text").attr("font-size",o.styles.textSize).style("color",pe(r.tickTextColorType,o)).attr("text-anchor",sF).attr("dominant-baseline",lF).attr("dy",0),c}const lg=(e,{selection:t,position$:n,computedData$:r,fullParams$:i,fullDataFormatter$:o,fullChartParams$:a,isCategorySeprate$:s,containerPosition$:l,containerSize$:u,xScale$:c,transitionDuration$:h})=>{const f=new Q,p=H(e,"xAxisG"),g=H(e,"xAxis"),m=H(e,"xLabel"),y=Pr({selection:t,pluginName:e,clipPathID:null,computedData$:r,containerPosition$:l,isCategorySeprate$:s}).pipe(C(f)).pipe(C(f),L((b,x)=>b.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));return G({axisSelection:y,position:n,fullParams:i,computedData:r,containerSize:u,fullDataFormatter:o,fullChartParams:a,xScale:c,transitionDuration:h}).pipe(C(f),z(async b=>b)).subscribe(b=>{hF({selection:b.axisSelection,position:b.position,xAxisClassName:g,fullParams:b.fullParams,containerSize:b.containerSize,fullChartParams:b.fullChartParams,xScale:b.xScale,transitionDuration:b.transitionDuration}),fF({selection:b.axisSelection,position:b.position,xLabelClassName:m,fullParams:b.fullParams,containerSize:b.containerSize,fullDataFormatter:b.fullDataFormatter,fullChartParams:b.fullChartParams})}),()=>{f.next(void 0)}},MS="RacingValueAxis",pF=He({name:MS,defaultParams:tg,layerIndex:Dt,validator:(e,{validateColumns:t})=>{const n=t(e,{labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextColorType:{toBeOption:"ColorType"}});return n.status==="error",n}})(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=n.fullChartParams$.pipe(C(i),L(s=>s.transitionDuration),Z()),a=lg(MS,{selection:e,position$:Ct("top"),transitionDuration$:o,computedData$:n.computedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,isCategorySeprate$:n.isCategorySeprate$,containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,xScale$:n.xScale$});return()=>{i.next(void 0),a()}}),Tn="Scatter",gF={name:Tn,defaultParams:xS,layerIndex:yu,validator:(e,{validateColumns:t})=>t(e,{radius:{toBeTypes:["number"]},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]}})};function dF({graphicGSelection:e,circleGClassName:t,circleClassName:n,visibleComputedXYData:r,fullParams:i,fullChartParams:o,graphicReverseScale:a}){const s=c=>{const h=c.size();return o.transitionDuration/h};let l=0;return e.each((c,h,f)=>{X(f[h]).selectAll("g").data(r[h],p=>p.id).join(p=>(l=s(p),p.append("g").classed(t,!0)),p=>p,p=>p.remove()).attr("transform",p=>`translate(${p.axisX}, ${p.axisY})`).each((p,g,m)=>{X(m[g]).selectAll("circle").data([p]).join(d=>d.append("circle").style("cursor","pointer").style("vector-effect","non-scaling-stroke").classed(n,!0).attr("opacity",0).transition().delay((y,b)=>g*l).attr("opacity",1),d=>d.transition().duration(50).attr("opacity",1),d=>d.remove()).attr("r",i.radius).attr("fill",(d,y)=>Se({datum:d,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(d,y)=>Se({datum:d,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${a[h][0]??1}, ${a[h][1]??1})`)})}),e.selectAll(`circle.${n}`)}function mF({selection:e,ids:t,fullChartParams:n}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").duration(200).style("opacity",1);return}e.each((r,i,o)=>{t.includes(r.id)?X(o[i]).style("opacity",1).transition("highlight").duration(200):X(o[i]).style("opacity",n.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function yF({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join("rect").attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}const bF=He(gF)(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=Oe(Tn,"clipPath-box"),a=H(Tn,"circleG"),s=H(Tn,"circle"),{categorySelection$:l,axesSelection$:u,defsSelection$:c,graphicGSelection$:h}=Su({selection:e,pluginName:Tn,clipPathID:o,categoryLabels$:r.categoryLabels$,containerPosition$:r.containerPosition$,graphicTransform$:r.graphicTransform$}),f=G({computedData:r.computedData$,graphicReverseScale:r.graphicReverseScale$}).pipe(C(i),z(async d=>d),L(d=>d.computedData.map((y,b)=>d.graphicReverseScale[b])));G({defsSelection:c,layout:r.layout$}).pipe(C(i),z(async d=>d)).subscribe(d=>{const y=[{id:o,width:d.layout.width,height:d.layout.height}];yF({defsSelection:d.defsSelection,clipPathData:y})});const p=G({graphicGSelection:h,visibleComputedXYData:r.visibleComputedXYData$,graphicReverseScale:f,fullChartParams:r.fullChartParams$,fullParams:r.fullParams$}).pipe(C(i),z(async d=>d),L(d=>dF({graphicGSelection:d.graphicGSelection,circleGClassName:a,circleClassName:s,visibleComputedXYData:d.visibleComputedXYData,fullParams:d.fullParams,fullChartParams:d.fullChartParams,graphicReverseScale:d.graphicReverseScale}))),g=r.fullDataFormatter$.pipe(C(i),L(d=>[d.valueLabels[0]??"X",d.valueLabels[1]??"Y"]),Z((d,y)=>d[0]===y[0]&&d[1]===y[1])),m=r.fullChartParams$.pipe(C(i),L(d=>d.highlightTarget),Z());return G({graphicSelection:p,computedData:r.computedData$,CategoryDataMap:r.CategoryDataMap$,highlightTarget:m,valueLabels:g}).pipe(C(i),z(async d=>d)).subscribe(d=>{d.graphicSelection.on("mouseover",(y,b)=>{n.event$.next({type:"multiValue",eventName:"mouseover",pluginName:Tn,highlightTarget:d.highlightTarget,valueDetail:[{value:b.value[0],valueIndex:0,valueLabel:d.valueLabels[0]},{value:b.value[1],valueIndex:1,valueLabel:d.valueLabels[1]}],datum:b,category:d.CategoryDataMap.get(b.categoryLabel),categoryIndex:b.categoryIndex,categoryLabel:b.categoryLabel,data:d.computedData,event:y})}).on("mousemove",(y,b)=>{n.event$.next({type:"multiValue",eventName:"mousemove",pluginName:Tn,highlightTarget:d.highlightTarget,valueDetail:[{value:b.value[0],valueIndex:0,valueLabel:d.valueLabels[0]},{value:b.value[1],valueIndex:1,valueLabel:d.valueLabels[1]}],datum:b,category:d.CategoryDataMap.get(b.categoryLabel),categoryIndex:b.categoryIndex,categoryLabel:b.categoryLabel,data:d.computedData,event:y})}).on("mouseout",(y,b)=>{n.event$.next({type:"multiValue",eventName:"mouseout",pluginName:Tn,highlightTarget:d.highlightTarget,valueDetail:[{value:b.value[0],valueIndex:0,valueLabel:d.valueLabels[0]},{value:b.value[1],valueIndex:1,valueLabel:d.valueLabels[1]}],datum:b,category:d.CategoryDataMap.get(b.categoryLabel),categoryIndex:b.categoryIndex,categoryLabel:b.categoryLabel,data:d.computedData,event:y})}).on("click",(y,b)=>{n.event$.next({type:"multiValue",eventName:"click",pluginName:Tn,highlightTarget:d.highlightTarget,valueDetail:[{value:b.value[0],valueIndex:0,valueLabel:d.valueLabels[0]},{value:b.value[1],valueIndex:1,valueLabel:d.valueLabels[1]}],datum:b,category:d.CategoryDataMap.get(b.categoryLabel),categoryIndex:b.categoryIndex,categoryLabel:b.categoryLabel,data:d.computedData,event:y})})}),G({graphicSelection:p,highlight:r.highlight$.pipe(L(d=>d.map(y=>y.id))),fullChartParams:r.fullChartParams$}).pipe(C(i),z(async d=>d)).subscribe(d=>{mF({selection:d.graphicSelection,ids:d.highlight,fullChartParams:d.fullChartParams})}),()=>{i.next(void 0)}}),_n="ScatterBubbles",xF=.9,$F={name:_n,defaultParams:$S,layerIndex:yu,validator:(e,{validateColumns:t})=>t(e,{fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},valueLinearOpacity:{toBeTypes:["number[]"]},arcScaleType:{toBe:"ArcScaleType",test:r=>r==="area"||r==="radius"},sizeAdjust:{toBeTypes:["number"]}})};function vF({graphicGSelection:e,circleGClassName:t,circleClassName:n,bubbleData:r,fullParams:i,fullChartParams:o,graphicReverseScale:a}){const s=c=>{const h=c.size();return o.transitionDuration/h};let l=0;return e.each((c,h,f)=>{X(f[h]).selectAll("g").data(r[h],p=>p.id).join(p=>(l=s(p),p.append("g").classed(t,!0)),p=>p,p=>p.remove()).attr("transform",p=>`translate(${p.axisX}, ${p.axisY})`).each((p,g,m)=>{X(m[g]).selectAll("circle").data([p]).join(d=>d.append("circle").style("cursor","pointer").style("vector-effect","non-scaling-stroke").classed(n,!0).attr("opacity",0).transition().delay((y,b)=>g*l).attr("opacity",y=>y.opacity),d=>d.transition().duration(50).attr("opacity",y=>y.opacity),d=>d.remove()).attr("r",d=>d.r).attr("fill",(d,y)=>Se({datum:d,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(d,y)=>Se({datum:d,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${a[h][0]??1}, ${a[h][1]??1})`)})}),e.selectAll(`circle.${n}`)}function SF({selection:e,ids:t,fullChartParams:n}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").duration(200).style("opacity",r=>r.opacity);return}e.each((r,i,o)=>{t.includes(r.id)?X(o[i]).style("opacity",s=>s.opacity).transition("highlight").duration(200):X(o[i]).style("opacity",n.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function TF({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join("rect").attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}const _F=He($F)(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=Oe(_n,"clipPath-box"),a=H(_n,"circleG"),s=H(_n,"circle"),{categorySelection$:l,axesSelection$:u,defsSelection$:c,graphicGSelection$:h}=Su({selection:e,pluginName:_n,clipPathID:o,categoryLabels$:r.categoryLabels$,containerPosition$:r.containerPosition$,graphicTransform$:r.graphicTransform$}),f=G({computedData:r.computedData$,graphicReverseScale:r.graphicReverseScale$}).pipe(C(i),z(async w=>w),L(w=>w.computedData.map((P,I)=>w.graphicReverseScale[I])));G({defsSelection:c,layout:r.layout$}).pipe(C(i),z(async w=>w)).subscribe(w=>{const P=[{id:o,width:w.layout.width,height:w.layout.height}];TF({defsSelection:w.defsSelection,clipPathData:P})});const p=r.filteredXYMinMaxData$.pipe(C(i),L(w=>w.datumList.flat().map(P=>P.value[2]??0)),ie(1)),g=r.filteredXYMinMaxData$.pipe(C(i),L(w=>fc(w.datumList.flat().map(P=>P.value[2]??0)))),m=G({filteredMinMaxValue:g,fullParams:r.fullParams$}).pipe(C(i),z(async w=>w),L(w=>Nn().domain(w.filteredMinMaxValue).range(w.fullParams.valueLinearOpacity))),d=G({layout:r.layout$,fullParams:r.fullParams$}).pipe(C(i),L(w=>Math.min(w.layout.width,w.layout.height)/2*w.fullParams.sizeAdjust)),y=p.pipe(C(i),L(w=>w.reduce((P,I)=>P+I,0)),Er(w=>w>0)),b=G({totalR:d,totalValue:y,fullParams:r.fullParams$}).pipe(C(i),z(async w=>w),L(w=>mn().domain([0,w.totalValue]).range([0,w.totalR]).exponent(w.fullParams.arcScaleType==="area"?.5:1))),x=G({radiusScale:b,fullParams:r.fullParams$,totalR:d,filteredValueList:p}).pipe(C(i),z(async w=>w),L(w=>w.fullParams.arcScaleType==="area"?1:(()=>{const P=w.totalR*w.totalR*Math.PI;return Math.sqrt(P/Ec(w.filteredValueList,I=>Math.PI*Math.pow(w.radiusScale(I),2)))})())),$=G({visibleComputedXYData:r.visibleComputedXYData$,opacityScale:m,radiusScale:b,scaleFactor:x,fullParams:r.fullParams$}).pipe(C(i),z(async w=>w),L(w=>w.visibleComputedXYData.map(P=>P.map(I=>{const v=I;return v.r=w.radiusScale(v.value[2])*w.scaleFactor*xF,v.opacity=w.opacityScale(v.value[2]),v})))),S=G({graphicGSelection:h,bubbleData:$,graphicReverseScale:f,fullChartParams:r.fullChartParams$,fullParams:r.fullParams$}).pipe(C(i),z(async w=>w),L(w=>vF({graphicGSelection:w.graphicGSelection,circleGClassName:a,circleClassName:s,bubbleData:w.bubbleData,fullParams:w.fullParams,fullChartParams:w.fullChartParams,graphicReverseScale:w.graphicReverseScale}))),_=r.fullDataFormatter$.pipe(C(i),L(w=>[w.valueLabels[0]??"X",w.valueLabels[1]??"Y",w.valueLabels[2]??"Value"]),Z((w,P)=>w[0]===P[0]&&w[1]===P[1]&&w[2]===P[2])),A=r.fullChartParams$.pipe(C(i),L(w=>w.highlightTarget),Z());return G({graphicSelection:S,computedData:r.computedData$,CategoryDataMap:r.CategoryDataMap$,highlightTarget:A,valueLabels:_}).pipe(C(i),z(async w=>w)).subscribe(w=>{w.graphicSelection.on("mouseover",(P,I)=>{n.event$.next({type:"multiValue",eventName:"mouseover",pluginName:_n,highlightTarget:w.highlightTarget,valueDetail:[{value:I.value[0],valueIndex:0,valueLabel:w.valueLabels[0]},{value:I.value[1],valueIndex:1,valueLabel:w.valueLabels[1]},{value:I.value[2],valueIndex:2,valueLabel:w.valueLabels[2]}],datum:I,category:w.CategoryDataMap.get(I.categoryLabel),categoryIndex:I.categoryIndex,categoryLabel:I.categoryLabel,data:w.computedData,event:P})}).on("mousemove",(P,I)=>{n.event$.next({type:"multiValue",eventName:"mousemove",pluginName:_n,highlightTarget:w.highlightTarget,valueDetail:[{value:I.value[0],valueIndex:0,valueLabel:w.valueLabels[0]},{value:I.value[1],valueIndex:1,valueLabel:w.valueLabels[1]},{value:I.value[2],valueIndex:2,valueLabel:w.valueLabels[2]}],datum:I,category:w.CategoryDataMap.get(I.categoryLabel),categoryIndex:I.categoryIndex,categoryLabel:I.categoryLabel,data:w.computedData,event:P})}).on("mouseout",(P,I)=>{n.event$.next({type:"multiValue",eventName:"mouseout",pluginName:_n,highlightTarget:w.highlightTarget,valueDetail:[{value:I.value[0],valueIndex:0,valueLabel:w.valueLabels[0]},{value:I.value[1],valueIndex:1,valueLabel:w.valueLabels[1]},{value:I.value[2],valueIndex:2,valueLabel:w.valueLabels[2]}],datum:I,category:w.CategoryDataMap.get(I.categoryLabel),categoryIndex:I.categoryIndex,categoryLabel:I.categoryLabel,data:w.computedData,event:P})}).on("click",(P,I)=>{n.event$.next({type:"multiValue",eventName:"click",pluginName:_n,highlightTarget:w.highlightTarget,valueDetail:[{value:I.value[0],valueIndex:0,valueLabel:w.valueLabels[0]},{value:I.value[1],valueIndex:1,valueLabel:w.valueLabels[1]},{value:I.value[2],valueIndex:2,valueLabel:w.valueLabels[2]}],datum:I,category:w.CategoryDataMap.get(I.categoryLabel),categoryIndex:I.categoryIndex,categoryLabel:I.categoryLabel,data:w.computedData,event:P})})}),G({graphicSelection:S,highlight:r.highlight$.pipe(L(w=>w.map(P=>P.id))),fullChartParams:r.fullChartParams$}).pipe(C(i),z(async w=>w)).subscribe(w=>{SF({selection:w.graphicSelection,ids:w.highlight,fullChartParams:w.fullChartParams})}),()=>{i.next(void 0)}}),kS="XAxis",AF=He({name:kS,defaultParams:ng,layerIndex:Dt,validator:(e,{validateColumns:t})=>{const n=t(e,{labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextColorType:{toBeOption:"ColorType"}});return n.status==="error",n}})(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=lg(kS,{selection:e,position$:Ct("bottom"),transitionDuration$:Ct(100),computedData$:n.computedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,isCategorySeprate$:n.isCategorySeprate$,containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,xScale$:n.xScale$});return()=>{i.next(void 0),o()}}),Tu="XYAux",ug=H(Tu,"label-box"),wF={name:Tu,defaultParams:$u,layerIndex:Mp,validator:(e,{validateColumns:t})=>{const n=t(e,{xAxis:{toBeTypes:["object"]},yAxis:{toBeTypes:["object"]}});if(e.xAxis){const r=t(e.xAxis,{showLine:{toBeTypes:["boolean"]},showLabel:{toBeTypes:["boolean"]},lineDashArray:{toBeTypes:["string"]},lineColorType:{toBeOption:"ColorType"},labelColorType:{toBeOption:"ColorType"},labelTextColorType:{toBeOption:"ColorType"},labelTextFormat:{toBeTypes:["string","Function"]},labelPadding:{toBeTypes:["number"]}});if(r.status==="error")return r}if(e.yAxis){const r=t(e.yAxis,{showLine:{toBeTypes:["boolean"]},showLabel:{toBeTypes:["boolean"]},lineDashArray:{toBeTypes:["string"]},lineColorType:{toBeOption:"ColorType"},labelColorType:{toBeOption:"ColorType"},labelTextColorType:{toBeOption:"ColorType"},labelTextFormat:{toBeTypes:["string","Function"]},labelPadding:{toBeTypes:["number"]}});if(r.status==="error")return r}return n}};function PF({axisX:e,axisY:t,layout:n,fullParams:r}){return e>=0&&e<=n.width&&t>=0&&t<=n.height?[{id:"line-x",x1:e,x2:e,y1:0,y2:n.height,dashArray:r.xAxis.lineDashArray??"none",colorType:r.xAxis.lineColorType},{id:"line-0",x1:0,x2:n.width,y1:t,y2:t,dashArray:r.yAxis.lineDashArray??"none",colorType:r.yAxis.lineColorType}]:[]}function DF({axisX:e,axisY:t,xValue:n,yValue:r,fullParams:i,textSizePx:o,layout:a,columnAmount:s,rowAmount:l}){if(!(e>=0&&e<=a.width&&t>=0&&t<=a.height))return[];const u=6,c=3,h=e,f=a.height+i.xAxis.labelPadding*l,p=rn(n,i.xAxis.labelTextFormat),g=p.split(`
235
- `),m=g.reduce((E,W)=>W.length>E.length?W:E,""),d=Li(m,o),y=o*g.length,b=d+u*2,x=y+c*2,$=-b/2,S=-c,_=$+u,A=S+c,w=-(i.yAxis.labelPadding*s),P=t,I=rn(r,i.yAxis.labelTextFormat),v=I.split(`
236
- `),N=v.reduce((E,W)=>W.length>E.length?W:E,""),R=Li(N,o),D=o*v.length,T=R+u*2,M=D+c*2,O=-R-u,k=-c-D/2,B=O+u,F=k+c;return[{id:"label-x",x:h,y:f,text:p,textArr:g,textWidth:d,textHeight:y,colorType:i.xAxis.labelColorType,textColorType:i.xAxis.labelTextColorType,rectWidth:b,rectHeight:x,rectX:$,rectY:S,textX:_,textY:A},{id:"label-y",x:w,y:P,text:I,textArr:v,textWidth:R,textHeight:D,colorType:i.yAxis.labelColorType,textColorType:i.xAxis.labelTextColorType,rectWidth:T,rectHeight:M,rectX:O,rectY:k,textX:B,textY:F}]}function CF({selection:e,pluginName:t,lineData:n,fullParams:r,fullChartParams:i}){const o=H(t,"auxline");return e.selectAll(`line.${o}`).data(n).join(s=>s.append("line").classed(o,!0).style("stroke-width",1).style("pointer-events","none").style("vector-effect","non-scaling-stroke").attr("x1",l=>l.x1).attr("y1",l=>l.y1).attr("x2",l=>l.x2).attr("y2",l=>l.y2),s=>s.transition().duration(50).attr("x1",u=>u.x1).attr("y1",u=>u.y1).attr("x2",u=>u.x2).attr("y2",u=>u.y2),s=>s.remove()).style("stroke",s=>pe(s.colorType,i)).style("stroke-dasharray",s=>s.dashArray)}function LF(e){e.selectAll("line").data([]).exit().remove()}function MF({selection:e,labelData:t,fullParams:n,fullDataFormatter:r,fullChartParams:i,textReverseTransform:o,textSizePx:a}){return e.selectAll(`g.${ug}`).data(t).join(l=>l.append("g").classed(ug,!0).style("cursor","pointer").attr("transform",(u,c)=>`translate(${u.x}, ${u.y})`),l=>l.transition().duration(50).attr("transform",(c,h)=>`translate(${c.x}, ${c.y})`),l=>l.remove()).each((l,u,c)=>{X(c[u]).selectAll("rect").data([l]).join(h=>h.append("rect").style("cursor","pointer").attr("rx",5).attr("ry",5),h=>h,h=>h.remove()).attr("width",h=>`${h.rectWidth}px`).attr("height",h=>`${h.rectHeight}px`).attr("fill",h=>pe(h.colorType,i)).attr("x",h=>h.rectX).attr("y",h=>h.rectY).style("transform",o),X(c[u]).selectAll("text").data([l]).join(h=>h.append("text").style("dominant-baseline","hanging").style("cursor","pointer").style("pointer-events","none"),h=>h,h=>h.remove()).style("transform",o).attr("fill",h=>pe(h.textColorType,i)).attr("font-size",i.styles.textSize).attr("x",h=>h.textX).attr("y",h=>h.textY).each((h,f,p)=>{ma(X(p[f]),{textArr:l.textArr,textSizePx:a,groupAxisPosition:f===0?"bottom":"left",isContainerRotated:!1})})})}function kF(e){e.selectAll(`g.${ug}`).data([]).exit().remove()}const RF=He(wF)(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q,a=t.insert("rect","g").classed(H(Tu,"rect"),!0).attr("opacity",0),{categorySelection$:s,axesSelection$:l,defsSelection$:u,graphicGSelection$:c}=Su({selection:e,pluginName:Tu,clipPathID:"test",categoryLabels$:i.isCategorySeprate$.pipe(z(d=>wn(()=>d,i.categoryLabels$,i.categoryLabels$.pipe(L(y=>[y[0]]))))),containerPosition$:i.containerPosition$,graphicTransform$:i.graphicTransform$});i.layout$.pipe(C(o)).subscribe(d=>{a.attr("width",d.rootWidth).attr("height",d.rootHeight)});const h=i.containerPosition$.pipe(L(d=>d.reduce((b,x)=>x.columnIndex>b?x.columnIndex:b,0)+1),Z()),f=i.containerPosition$.pipe(L(d=>d.reduce((b,x)=>x.rowIndex>b?x.rowIndex:b,0)+1),Z()),p=i.containerPosition$.pipe(C(o),z(async d=>d),L(d=>`${`scale(${1/d[0].scale[0]}, ${1/d[0].scale[1]})`}`),Z()),g=fN({rootSelection:t,fullDataFormatter$:i.fullDataFormatter$,filteredXYMinMaxData$:i.filteredXYMinMaxData$,containerPosition$:i.containerPosition$,containerSize$:i.containerSize$,layout$:i.layout$}).pipe(C(o));G({axesSelection:l,layout:i.layout$,xyPosition:g,fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,fullChartParams:i.fullChartParams$,textReverseTransform:p,textSizePx:i.textSizePx$,columnAmount:h,rowAmount:f}).pipe(C(o),z(async d=>d)).subscribe(d=>{const{x:y,y:b,xValue:x,yValue:$}=d.xyPosition,S=PF({axisX:y,axisY:b,layout:d.layout,fullParams:d.fullParams});CF({selection:d.axesSelection,pluginName:n,lineData:S,fullParams:d.fullParams,fullChartParams:d.fullChartParams});const _=DF({axisX:y,axisY:b,xValue:x,yValue:$,fullParams:d.fullParams,textSizePx:d.textSizePx,layout:d.layout,columnAmount:d.columnAmount,rowAmount:d.rowAmount});MF({selection:d.axesSelection,labelData:_,fullParams:d.fullParams,fullDataFormatter:d.fullDataFormatter,fullChartParams:d.fullChartParams,textReverseTransform:d.textReverseTransform,textSizePx:d.textSizePx})});const m=Ar(a,"mouseout").pipe(C(o));return G({rootRectMouseout:m,axesSelection:l}).pipe(C(o),z(async d=>d)).subscribe(d=>{setTimeout(()=>{LF(d.axesSelection),kF(d.axesSelection)})}),()=>{o.next(void 0),a.remove()}}),IF=6,EF="end",BF="middle",NF="end",FF="auto";function zF({selection:e,yLabelClassName:t,fullParams:n,containerSize:r,fullDataFormatter:i,fullChartParams:o}){const a=n.tickPadding-n.labelOffset[0],s=n.tickPadding+n.labelOffset[1];let l=-a,u=-s;e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).each((c,h,f)=>{X(f[h]).selectAll("text").data([c]).join(p=>p.append("text").style("font-weight","bold"),p=>p,p=>p.remove()).attr("text-anchor",NF).attr("dominant-baseline",FF).attr("font-size",o.styles.textSize).style("fill",pe(n.labelColorType,o)).attr("x",l).attr("y",u).text(p=>i.yAxis.label)})}function OF({selection:e,yAxisClassName:t,fullParams:n,containerSize:r,fullDataFormatter:i,fullChartParams:o,yScale:a}){const s=e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0);let l=n.tickPadding;const u=Nc(a).scale(a).ticks(n.ticks).tickFormat(h=>rn(h,n.tickFormat)).tickSize(n.tickFullLine==!0?-r.width:IF).tickPadding(l),c=s.transition().duration(100).ease(Ft).call(u);return c.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?pe(n.tickColorType,o):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),c.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?pe(n.axisLineColorType,o):"none").style("shape-rendering","crispEdges"),s.selectAll("text").attr("font-size",o.styles.textSize).style("color",pe(n.tickTextColorType,o)).attr("text-anchor",EF).attr("dominant-baseline",BF).attr("x",-l).attr("dy",0),s}const GF=(e,{selection:t,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,isCategorySeprate$:a,containerPosition$:s,containerSize$:l,yScale$:u})=>{const c=new Q,h=H(e,"yAxisG"),f=H(e,"yAxis"),p=H(e,"yLabel"),m=Pr({selection:t,pluginName:e,clipPathID:null,computedData$:n,containerPosition$:s,isCategorySeprate$:a}).pipe(C(c)).pipe(C(c),L((d,y)=>d.selectAll(`g.${h}`).data([h]).join("g").classed(h,!0)));return G({axisSelection:m,fullParams:r,computedData:n,containerSize:l,fullDataFormatter:i,fullChartParams:o,yScale:u}).pipe(C(c),z(async d=>d)).subscribe(d=>{OF({selection:d.axisSelection,yAxisClassName:f,fullParams:d.fullParams,containerSize:d.containerSize,fullDataFormatter:d.fullDataFormatter,fullChartParams:d.fullChartParams,yScale:d.yScale}),zF({selection:d.axisSelection,yLabelClassName:p,fullParams:d.fullParams,containerSize:d.containerSize,fullDataFormatter:d.fullDataFormatter,fullChartParams:d.fullChartParams})}),()=>{c.next(void 0)}},cg="XYAxes",WF=He({name:cg,defaultParams:vu,layerIndex:Dt,validator:(e,{validateColumns:t})=>{const n=t(e,{xAxis:{toBeTypes:["object"]},yAxis:{toBeTypes:["object"]}});if(e.xAxis){const r=t(e.xAxis,{labelOffset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextColorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}if(e.yAxis){const r=t(e.yAxis,{labelOffset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextColorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}return n}})(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=n.fullParams$.pipe(C(i),L(u=>u.xAxis),Z((u,c)=>JSON.stringify(u)===JSON.stringify(c))),a=n.fullParams$.pipe(C(i),L(u=>u.xAxis),Z((u,c)=>JSON.stringify(u)===JSON.stringify(c))),s=lg(`${cg}-x`,{selection:e,position$:Ct("bottom"),transitionDuration$:Ct(100),computedData$:n.computedData$,fullParams$:o,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,isCategorySeprate$:n.isCategorySeprate$,containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,xScale$:n.xScale$}),l=GF(`${cg}-y`,{selection:e,computedData$:n.computedData$,fullParams$:a,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,isCategorySeprate$:n.isCategorySeprate$,containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,yScale$:n.yScale$});return()=>{i.next(void 0),s(),l()}}),RS="XZoom",VF=He({name:RS,defaultParams:rg,layerIndex:Lp,validator:(e,{validateColumns:t})=>({status:"success",columnName:"",expectToBe:""})})(({selection:e,rootSelection:t,name:n,observer:r,subject:i})=>{const o=new Q,a=DS(RS,{rootSelection:t,fullDataFormatter$:r.fullDataFormatter$,xyMinMax$:r.xyMinMax$,layout$:r.layout$,dataFormatter$:i.dataFormatter$});return()=>{o.next(void 0),a()}}),YF={header:{height:36,text:[],textStyle:[]},footer:{height:0,text:[],textStyle:[]}},IS={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,textRenderFn:e=>{if(e.highlightTarget==="datum"&&e.datum)return[`${e.datum.label}: ${e.datum.value}`];if(e.highlightTarget==="series"){const t=e.seriesLabel,n=e.series.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[t,r]}else if(e.highlightTarget==="group"){const t=e.groupLabel,n=e.series.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[t,r]}else if(e.highlightTarget==="category"){const t=e.categoryLabel,n=e.category.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[t,r]}return[]},svgRenderFn:null};IS.textRenderFn.toString=()=>`(eventData) => {
232
+ }`;const rg={},v2="MultiValueLegend",uN=He({name:v2,defaultParams:y2,layerIndex:ki,validator:(e,{validateColumns:t})=>t(e,{placement:{toBe:'"top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end"',test:r=>["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].includes(r)},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:e,rootSelection:t,observer:n,subject:r})=>{const i=new Q,o=n.CategoryDataMap$.pipe(C(i),L(l=>Array.from(l.keys()))),a=n.fullParams$.pipe(C(i),L(l=>{const u=[{listRectWidth:l.listRectWidth,listRectHeight:l.listRectHeight,listRectRadius:l.listRectRadius}];return{...l,labelList:u}})),s=Ii(v2,{rootSelection:t,legendLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),S2="MultiValueTooltip",cN=He({name:S2,defaultParams:Zp,layerIndex:Ri,validator:(e,{validateColumns:t})=>t(e,{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"},renderFn:{toBeTypes:["Function"]}})})(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q,a=Bi(S2,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),Su=({selection:e,pluginName:t,clipPathID:n,categoryLabels$:r,containerPosition$:i,graphicTransform$:o})=>{const a=H(t,"category"),s=H(t,"axes"),l=H(t,"graphic"),u=r.pipe(L((p,d)=>e.selectAll(`g.${a}`).data(p,m=>m).join(m=>m.append("g").classed(a,!0).each((g,y,b)=>{X(b[y]).selectAll(`g.${s}`).data([y]).join(x=>x.append("g").classed(s,!0).attr("clip-path",`url(#${n})`).each(($,S,_)=>{X(_[S]).selectAll("defs").data([S]).join("defs"),X(_[S]).selectAll("g").data([S]).join("g").classed(l,!0)}),x=>x,x=>x.remove())}),m=>m,m=>m.remove())),ne(1));O({categorySelection:u,containerPosition:i}).pipe(z(async p=>p)).subscribe(p=>{p.categorySelection.transition().attr("transform",(d,m)=>{const g=p.containerPosition[m]??p.containerPosition[0],y=g.translate,b=g.scale;return`translate(${y[0]}, ${y[1]}) scale(${b[0]}, ${b[1]})`})});const c=u.pipe(L(p=>p.select(`g.${s}`)),ne(1)),h=c.pipe(L(p=>p.select("defs")),ne(1)),f=O({axesSelection:c,graphicTransform:o}).pipe(z(async p=>p),L(p=>{const d=p.axesSelection.select(`g.${l}`);return d.transition().duration(50).style("transform",p.graphicTransform.value),d}),ne(1));return{categorySelection$:u,axesSelection$:c,defsSelection$:h,graphicGSelection$:f}},Pr=({selection:e,pluginName:t,clipPathID:n,computedData$:r,containerPosition$:i,isCategorySeprate$:o})=>{const a=H(t,"container"),s=O({computedData:r.pipe(q((l,u)=>l.length===u.length)),isCategorySeprate:o}).pipe(z(async l=>l),L(l=>l.isCategorySeprate?l.computedData:[l.computedData[0]]),L((l,u)=>e.selectAll(`g.${a}`).data(l,c=>c&&c[0]?c[0].categoryIndex:u).join("g").classed(a,!0).attr("clip-path",c=>n?`url(#${n})`:"none")),ne(1));return O({containerSelection:s,gridContainerPosition:i}).pipe(z(async l=>l)).subscribe(l=>{l.containerSelection.attr("transform",(u,c)=>{const h=l.gridContainerPosition[c]??l.gridContainerPosition[0],f=h.translate;return h.scale,`translate(${f[0]}, ${f[1]})`})}),s},fN=({rootSelection:e,fullDataFormatter$:t,filteredXYMinMaxData$:n,containerPosition$:r,containerSize$:i,layout$:o})=>{const a=Ar(e,"mousemove").pipe(nd(2)),s=new me(u=>{O({containerSize:i,filteredXYMinMaxData:n,fullDataFormatter:t}).pipe(z(async c=>c)).subscribe(c=>{const h=c.fullDataFormatter.xAxis.valueIndex,f=c.fullDataFormatter.yAxis.valueIndex;if(!c.filteredXYMinMaxData.minXDatum||!c.filteredXYMinMaxData.maxXDatum||c.filteredXYMinMaxData.minXDatum.value[h]==null||c.filteredXYMinMaxData.maxXDatum.value[h]==null||!c.filteredXYMinMaxData.minYDatum||!c.filteredXYMinMaxData.maxYDatum||c.filteredXYMinMaxData.minYDatum.value[f]==null||c.filteredXYMinMaxData.maxYDatum.value[f]==null)return;const p=Sm({maxValue:c.filteredXYMinMaxData.maxXDatum.value[h],minValue:c.filteredXYMinMaxData.minXDatum.value[h],axisWidth:c.containerSize.width,scaleDomain:c.fullDataFormatter.xAxis.scaleDomain,scaleRange:c.fullDataFormatter.xAxis.scaleRange}),d=Sm({maxValue:c.filteredXYMinMaxData.maxYDatum.value[f],minValue:c.filteredXYMinMaxData.minYDatum.value[f],axisWidth:c.containerSize.height,scaleDomain:c.fullDataFormatter.yAxis.scaleDomain,scaleRange:c.fullDataFormatter.yAxis.scaleRange,reverse:!0});u.next({xScale:p,yScale:d})})}),l=O({rootMousemove:a,layout:o,containerPosition:r}).pipe(z(async u=>u),L(u=>{const c=(()=>{let f=u.rootMousemove.offsetX;const d=u.containerPosition.map((m,g)=>{var y;return[m.translate[0],((y=u.containerPosition[g+1])==null?void 0:y.translate[0])??u.layout.rootWidth]}).filter(m=>m[0]<m[1]).find(m=>f>=m[0]&&f<=m[1]);return d&&(f=f-d[0]),f-u.layout.left})(),h=(()=>{let f=u.rootMousemove.offsetY;const d=u.containerPosition.map((m,g)=>{var y;return[m.translate[1],((y=u.containerPosition[g+1])==null?void 0:y.translate[1])??u.layout.rootHeight]}).filter(m=>m[0]<m[1]).find(m=>f>=m[0]&&f<=m[1]);return d&&(f=f-d[0]),f-u.layout.top})();return{x:c,y:h}}));return O({xyScale:s,axisValue:l,containerPosition:r}).pipe(z(async u=>u),L(u=>({x:u.axisValue.x/u.containerPosition[0].scale[0],y:u.axisValue.y/u.containerPosition[0].scale[1],xValue:u.xyScale.xScale(u.axisValue.x),yValue:u.xyScale.yScale(u.axisValue.y)})))},hN=({rootSelection:e,ordinalScaleDomain$:t,ordinalScale$:n,ordinalPadding$:r,containerSize$:i,containerPosition$:o,layout$:a})=>{const s=Ar(e,"mousemove").pipe(nd(2)),l=O({rootMousemove:s,layout:a,containerPosition:o}).pipe(z(async c=>c),L(c=>{let h=c.rootMousemove.offsetX;const p=c.containerPosition.map((d,m)=>{var g;return[d.translate[0],((g=c.containerPosition[m+1])==null?void 0:g.translate[0])??c.layout.rootWidth]}).filter(d=>d[0]<d[1]).find(d=>h>=d[0]&&h<=d[1]);return p&&(h=h-p[0]),h-c.layout.left})),u=t.pipe(L(c=>{const h=c[1]-c[0]+1;return new Array(h).fill(0).map((f,p)=>String(p+c[0]))}));return O({scaleRangeLabels:u,containerSize:i,axisX:l,ordinalScale:n,ordinalPadding:r,ordinalScaleDomain:t,containerPosition:o}).pipe(z(async c=>c),L(c=>{const p=Tc({axisLabels:c.scaleRangeLabels,axisWidth:c.containerSize.width,padding:.5,reverse:!1})(c.axisX)+c.ordinalScaleDomain[0];return{x:(c.ordinalScale(p)+c.ordinalPadding)/c.containerPosition[0].scale[0],xValue:p}}))},T2=({containerSize$:e,visibleComputedData$:t,textSizePx$:n,rankingAmount$:r})=>{const i=({textSizePx$:c})=>c.pipe(L(h=>h*2),ne(1)),o=({minLineHeight$:c,containerSize$:h})=>O({minLineHeight:c,containerSize:h}).pipe(z(async f=>f),L(f=>f.containerSize.height>f.minLineHeight?f.containerSize.height:f.minLineHeight),q(),ne(1)),a=({minLineHeight$:c,containerHeight$:h})=>O({minLineHeight:c,containerHeight:h}).pipe(z(async f=>f),L(f=>Math.floor(f.containerHeight/f.minLineHeight)),q(),ne(1)),s=i({textSizePx$:n}),l=o({minLineHeight$:s,containerSize$:e}),u=a({containerHeight$:l,minLineHeight$:s});return r.pipe(z(c=>on(()=>c==="auto",O({visibleComputedData:t,rankingAmountLimit:u}).pipe(z(async h=>h),L(h=>{const f=h.visibleComputedData.map(p=>Math.min(h.rankingAmountLimit,p.length));return Math.max(...f)})),r)))},_2=({containerSize$:e,textSizePx$:t,computedRankingAmount$:n})=>{const r=({textSizePx$:s})=>s.pipe(L(l=>l*2),ne(1)),i=({minLineHeight$:s,containerSize$:l})=>O({minLineHeight:s,containerSize:l}).pipe(z(async u=>u),L(u=>u.containerSize.height>u.minLineHeight?u.containerSize.height:u.minLineHeight),q(),ne(1)),o=r({textSizePx$:t}),a=i({minLineHeight$:o,containerSize$:e});return O({containerHeight:a,computedRankingAmount:n}).pipe(z(async s=>s),L(s=>s.containerHeight/s.computedRankingAmount))},A2=({visibleComputedRankingData$:e,rankingItemHeight$:t})=>O({visibleComputedRankingData:e,rankingItemHeight:t}).pipe(z(async n=>n),L(n=>n.visibleComputedRankingData.map((r,i)=>{const o=r.length,a=n.rankingItemHeight*o;return mD({axisLabels:r.map(s=>s.label),axisWidth:a,padding:.5})}))),Wn="OrdinalAux",ig=H(Wn,"label-box"),og=6,ag=3,pN={name:Wn,defaultParams:Kp,layerIndex:Mp,validator:(e,{validateColumns:t})=>t(e,{showLine:{toBeTypes:["boolean"]},showLabel:{toBeTypes:["boolean"]},lineDashArray:{toBeTypes:["string"]},lineColorType:{toBeOption:"ColorType"},labelColorType:{toBeOption:"ColorType"},labelTextColorType:{toBeOption:"ColorType"},labelTextFormat:{toBeTypes:["Function"]},labelPadding:{toBeTypes:["number"]}})};function gN(e,t){return e.map((n,r)=>{const i=rn(n,t),o=typeof i=="string"?i.split(`
233
+ `):[i];return{text:i,textArr:o}})}function dN({axisX:e,layout:t,fullParams:n}){return e>=0&&e<=t.width?[{id:"line-x",x1:e,x2:e,y1:0,y2:t.height,dashArray:n.lineDashArray??"none",colorType:n.lineColorType}]:[]}function mN({valueLabelData:e,axisX:t,xValue:n,fullParams:r,textSizePx:i,layout:o,rowAmount:a}){if(!(t>=0&&t<=o.width))return[];const s=t,l=-r.labelPadding*a,u=e[n]?e[n].text:"",c=e[n]?e[n].textArr:[],h=c.reduce(($,S)=>S.length>$.length?S:$,""),f=Mi(h,i),p=i*c.length,d=f+og*2,m=p+ag*2,g=-d/2,y=-ag,b=g+og,x=y+ag;return[{id:"label-x",x:s,y:l-m/2,text:u,textArr:c,textWidth:f,textHeight:p,colorType:r.labelColorType,textColorType:r.labelTextColorType,rectWidth:d,rectHeight:m,rectX:g,rectY:y,textX:b,textY:x}]}function yN({selection:e,pluginName:t,lineData:n,fullParams:r,fullChartParams:i}){const o=H(t,"auxline");return e.selectAll(`line.${o}`).data(n).join(s=>s.append("line").classed(o,!0).style("stroke-width",1).style("pointer-events","none").style("vector-effect","non-scaling-stroke").attr("x1",l=>l.x1).attr("y1",l=>l.y1).attr("x2",l=>l.x2).attr("y2",l=>l.y2),s=>s.transition().duration(50).attr("x1",u=>u.x1).attr("y1",u=>u.y1).attr("x2",u=>u.x2).attr("y2",u=>u.y2),s=>s.remove()).style("stroke",s=>pe(s.colorType,i)).style("stroke-dasharray",s=>s.dashArray)}function bN(e){e.selectAll("line").data([]).exit().remove()}function xN({selection:e,labelData:t,fullParams:n,fullDataFormatter:r,fullChartParams:i,textReverseTransform:o,textSizePx:a}){return e.selectAll(`g.${ig}`).data(t).join(l=>l.append("g").classed(ig,!0).style("cursor","pointer").attr("transform",(u,c)=>`translate(${u.x}, ${u.y})`),l=>l.transition().duration(50).attr("transform",(c,h)=>`translate(${c.x}, ${c.y})`),l=>l.remove()).each((l,u,c)=>{const h=X(c[u]),f=h.selectAll("rect").data([l]).join(g=>g.append("rect").style("cursor","pointer").attr("rx",5).attr("ry",5),g=>g,g=>g.remove()).attr("width",g=>`${g.rectWidth}px`).attr("height",g=>`${g.rectHeight}px`).attr("fill",g=>pe(g.colorType,i)).attr("x",g=>g.rectX).attr("y",g=>g.rectY).style("transform",o),p=h.selectAll("text").data([l]).join(g=>g.append("text").style("dominant-baseline","hanging").style("cursor","pointer").style("pointer-events","none"),g=>g,g=>g.remove()).style("transform",o).attr("fill",g=>pe(g.textColorType,i)).attr("font-size",i.styles.textSize).attr("x",g=>g.textX).attr("y",g=>g.textY).each((g,y,b)=>{ma(X(b[y]),{textArr:l.textArr,textSizePx:a,groupAxisPosition:y===0?"bottom":"left",isContainerRotated:!1})});let d=[];p.selectAll("tspan").each((g,y,b)=>{const $=X(b[y]).node();$&&$.getBBox()&&d.push($.getBBox().width)});const m=Math.max(...d);f.attr("width",m+og*2)})}function $N(e){e.selectAll(`g.${ig}`).data([]).exit().remove()}const vN=He(pN)(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q;let a=!1;const s=t.insert("rect","g").classed(H(Wn,"rect"),!0).attr("opacity",0),{categorySelection$:l,axesSelection$:u,defsSelection$:c,graphicGSelection$:h}=Su({selection:e,pluginName:Wn,clipPathID:"test",categoryLabels$:i.isCategorySeprate$.pipe(z(x=>on(()=>x,i.categoryLabels$,i.categoryLabels$.pipe(L($=>[$[0]]))))),containerPosition$:i.containerPosition$,graphicTransform$:i.graphicTransform$});i.layout$.pipe(C(o)).subscribe(x=>{s.attr("width",x.rootWidth).attr("height",x.rootHeight)});const f=i.fullChartParams$.pipe(C(o),L(x=>x.highlightTarget),q()),p=i.containerPosition$.pipe(L(x=>x.reduce((S,_)=>_.columnIndex>S?_.columnIndex:S,0)+1),q()),d=i.containerPosition$.pipe(L(x=>x.reduce((S,_)=>_.rowIndex>S?_.rowIndex:S,0)+1),q()),m=i.containerPosition$.pipe(C(o),z(async x=>x),L(x=>`${`scale(${1/x[0].scale[0]}, ${1/x[0].scale[1]})`}`),q()),g=hN({rootSelection:t,ordinalScaleDomain$:i.ordinalScaleDomain$,ordinalScale$:i.ordinalScale$,ordinalPadding$:i.ordinalPadding$,containerSize$:i.containerSize$,containerPosition$:i.containerPosition$,layout$:i.layout$}),y=O({valueLabels:i.valueLabels$,fullParams:i.fullParams$}).pipe(C(o),z(async x=>x),L(x=>gN(x.valueLabels,x.fullParams.labelTextFormat)),ne(1));O({axesSelection:u,layout:i.layout$,ordinalPosition:g,computedData:i.computedData$,fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,fullChartParams:i.fullChartParams$,highlightTarget:f,textReverseTransform:m,textSizePx:i.textSizePx$,columnAmount:p,rowAmount:d,valueLabelData:y}).pipe(C(o),z(async x=>x)).subscribe(x=>{const{x:$,xValue:S}=x.ordinalPosition,_=dN({axisX:$,layout:x.layout,fullParams:x.fullParams});yN({selection:x.axesSelection,pluginName:n,lineData:_,fullParams:x.fullParams,fullChartParams:x.fullChartParams});const A=mN({valueLabelData:x.valueLabelData,axisX:$,xValue:S,fullParams:x.fullParams,textSizePx:x.textSizePx,layout:x.layout,rowAmount:x.rowAmount});xN({selection:x.axesSelection,labelData:A,fullParams:x.fullParams,fullDataFormatter:x.fullDataFormatter,fullChartParams:x.fullChartParams,textReverseTransform:x.textReverseTransform,textSizePx:x.textSizePx}).on("mouseover",(P,I)=>{P.stopPropagation(),a=!0,r.event$.next({type:"multiValue",eventName:"mouseover",pluginName:Wn,highlightTarget:x.highlightTarget,valueDetail:[],datum:null,category:[],categoryIndex:-1,categoryLabel:"",data:x.computedData,event:P})}).on("mousemove",(P,I)=>{P.stopPropagation(),r.event$.next({type:"multiValue",eventName:"mousemove",pluginName:Wn,highlightTarget:x.highlightTarget,valueDetail:[],datum:null,category:[],categoryIndex:-1,categoryLabel:"",data:x.computedData,event:P})}).on("mouseout",(P,I)=>{P.stopPropagation(),a=!1,r.event$.next({type:"multiValue",eventName:"mouseout",pluginName:Wn,highlightTarget:x.highlightTarget,valueDetail:[],datum:null,category:[],categoryIndex:-1,categoryLabel:"",data:x.computedData,event:P})}).on("click",(P,I)=>{P.stopPropagation(),r.event$.next({type:"multiValue",eventName:"click",pluginName:Wn,highlightTarget:x.highlightTarget,valueDetail:[],datum:null,category:[],categoryIndex:-1,categoryLabel:"",data:x.computedData,event:P})})});const b=Ar(s,"mouseout").pipe(C(o));return O({rootRectMouseout:b,axesSelection:u}).pipe(C(o),z(async x=>x)).subscribe(x=>{setTimeout(()=>{a!=!0&&(bN(x.axesSelection),$N(x.axesSelection))})}),()=>{o.next(void 0),s.remove()}}),Ni="OrdinalAxis",w2=6,SN="start",TN="auto",_N={name:Ni,defaultParams:Qp,layerIndex:Ct,validator:(e,{validateColumns:t})=>{const n=t(e,{labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextRotate:{toBeTypes:["number"]},tickTextColorType:{toBeOption:"ColorType"}});return n.status==="error",n}};function AN(e,t){return e.map((n,r)=>{const i=rn(n,t),o=typeof i=="string"?i.split(`
234
+ `):[i];return{text:i,textArr:o}})}function wN({selection:e,axisLabelClassName:t,fullParams:n,containerSize:r,fullDataFormatter:i,fullChartParams:o}){let s=n.tickPadding+n.labelOffset[0],l,u;l=0,u=-n.tickPadding-n.labelOffset[1];let c=u;e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).each((h,f,p)=>{X(p[f]).selectAll("text").data([h]).join(d=>d.append("text").style("font-weight","bold"),d=>d,d=>d.remove()).attr("text-anchor",SN).attr("dominant-baseline",TN).attr("font-size",o.styles.textSize).style("fill",pe(n.labelColorType,o)).attr("x",s).attr("y",c).text(d=>i.xAxis.label)}).attr("transform",h=>`translate(${r.width}, ${l})`)}function PN({selection:e,ordinalXAxisClassName:t,fullParams:n,containerSize:r,fullDataFormatter:i,fullChartParams:o,ordinalScale:a,ordinalScaleDomain:s,valueLabelData:l,textRotateTransform:u,textSizePx:c,ordinalPadding:h}){const f=n.tickTextRotate?"start":"middle",p="auto",d=e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).attr("transform",`translate(${h}, 0)`),m=Math.floor(s[1])-Math.ceil(s[0])+1;let g=0,y=0;n.tickFullLine==!0?g=n.tickPadding:g=n.tickPadding-w2,y=-0;const b=hs(a).scale(a).ticks(n.ticks==="all"?m:n.ticks>m?m-1:n.ticks).tickSize(n.tickFullLine==!0?-r.height:w2).tickSizeOuter(0).tickFormat((S,_)=>{var A;return((A=l[S])==null?void 0:A.text)??""}).tickPadding(g),x=d.transition().duration(100).ease(Ft).call(b).on("end",(S,_)=>{d.selectAll(".tick text").each((A,w,P)=>{var v;const I=((v=l[A])==null?void 0:v.textArr)??[];ma(X(P[w]),{textArr:I,textSizePx:c,groupAxisPosition:"top",isContainerRotated:!0})})});return x.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?pe(n.tickColorType,o):"none").style("stroke-dasharray",n.tickFullLineDasharray).style("vector-effect","non-scaling-stroke").attr("pointer-events","none"),x.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?pe(n.axisLineColorType,o):"none").style("shape-rendering","crispEdges"),d.selectAll("text").attr("font-size",o.styles.textSize).attr("fill",pe(n.tickTextColorType,o)).attr("text-anchor",f).attr("dominant-baseline",p).attr("x",y).style("transform",u).attr("dy",0),d}function DN({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",o=>-o.width).attr("y",0).attr("width",o=>o.width*2).attr("height",o=>o.height)})}const CN=He(_N)(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=H(Ni,"xAxisG"),a=H(Ni,"axis"),s=H(Ni,"axis-label"),l=Oe(Ni,"clipPath-box"),u=Pr({selection:e,pluginName:Ni,clipPathID:null,computedData$:n.computedData$,containerPosition$:n.containerPosition$,isCategorySeprate$:n.isCategorySeprate$}).pipe(C(i));n.containerSize$.subscribe(d=>{const m=e.selectAll("defs").data([l]).join("defs"),g=[{id:l,width:d.width,height:d.height}];DN({defsSelection:m,clipPathData:g})});const c=u.pipe(C(i),L((d,m)=>d.selectAll(`g.${o}`).data([o]).join("g").classed(o,!0))),h=O({valueLabels:n.valueLabels$,fullParams:n.fullParams$}).pipe(C(i),z(async d=>d),L(d=>AN(d.valueLabels,d.fullParams.tickFormat)),ne(1)),f=O({valueLabelData:h,fullDataFormatter:n.fullDataFormatter$}).pipe(C(i),z(async d=>d),L(d=>{const g=d.valueLabelData.length-1,y=d.fullDataFormatter.xAxis.scaleDomain[0]==="min"||d.fullDataFormatter.xAxis.scaleDomain[0]==="auto"?0:d.fullDataFormatter.xAxis.scaleDomain[0],b=d.fullDataFormatter.xAxis.scaleDomain[1]==="max"||d.fullDataFormatter.xAxis.scaleDomain[1]==="auto"?g:d.fullDataFormatter.xAxis.scaleDomain[1];return[y,b]}),ne(1)),p=n.fullParams$.pipe(C(i),L(d=>d.tickTextRotate?`rotate(${d.tickTextRotate})`:""));return O({axisSelection:c,fullParams:n.fullParams$,containerSize:n.containerSize$,fullDataFormatter:n.fullDataFormatter$,fullChartParams:n.fullChartParams$,ordinalScale:n.ordinalScale$,ordinalScaleDomain:f,valueLabelData:h,textRotateTransform:p,textSizePx:n.textSizePx$,ordinalPadding:n.ordinalPadding$}).pipe(C(i),z(async d=>d)).subscribe(d=>{PN({selection:d.axisSelection,ordinalXAxisClassName:a,fullParams:d.fullParams,containerSize:d.containerSize,fullDataFormatter:d.fullDataFormatter,fullChartParams:d.fullChartParams,ordinalScale:d.ordinalScale,ordinalScaleDomain:d.ordinalScaleDomain,valueLabelData:d.valueLabelData,textRotateTransform:d.textRotateTransform,textSizePx:d.textSizePx,ordinalPadding:d.ordinalPadding}),wN({selection:d.axisSelection,axisLabelClassName:s,fullParams:d.fullParams,containerSize:d.containerSize,fullDataFormatter:d.fullDataFormatter,fullChartParams:d.fullChartParams})}),()=>{i.next(void 0)}}),LN="end",MN="middle",kN="end",RN="auto";function IN({selection:e,textClassName:t,fullParams:n,containerSize:r,fullDataFormatter:i,fullChartParams:o}){const a=n.barLabel.padding-n.axisLabel.offset[0],s=-n.barLabel.padding-n.axisLabel.offset[1];let l=-a,u=-s;e.attr("transform",c=>`translate(0, ${r.height})`).selectAll("text").data([n]).join(c=>c.append("text").style("font-weight","bold"),c=>c,c=>c.remove()).attr("text-anchor",kN).attr("dominant-baseline",RN).attr("font-size",o.styles.textSize).style("fill",pe(n.axisLabel.colorType,o)).attr("x",l).attr("y",u).text(c=>i.yAxis.label)}function EN({selection:e,fullParams:t,fullChartParams:n,transitionEase:r,rankingScale:i,valueScale:o,categoryData:a}){const s=t.barLabel.position==="none"?[]:a;return e.selectAll("text").data(s,u=>u.id).join(u=>u.append("text").style("font-weight","bold").style("pointer-events","none").attr("x",c=>o(c.value[c.xValueIndex]??0)-t.barLabel.padding).attr("y",c=>i(c.label)),u=>u.transition().duration(n.transitionDuration).ease(_r(r)).attr("x",c=>o(c.value[c.xValueIndex]??0)-t.barLabel.padding).attr("y",c=>i(c.label)),u=>u.remove()).attr("text-anchor",LN).attr("dominant-baseline",MN).attr("font-size",n.styles.textSize).style("fill",u=>Se({colorType:t.barLabel.colorType,fullChartParams:n,datum:u})).text(u=>u.label)}function BN({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",o=>-o.width).attr("y",0).attr("width",o=>o.width*2).attr("height",o=>o.height)})}const P2=(e,{selection:t,computedData$:n,visibleComputedRankingData$:r,rankingScaleList$:i,xScale$:o,fullParams$:a,fullDataFormatter$:s,fullChartParams$:l,transitionEase$:u,containerPosition$:c,containerSize$:h,isCategorySeprate$:f})=>{const p=new Q,d=H(e,"box"),m=H(e,"text"),g=Oe(e,"clipPath-box"),y=Pr({selection:t,pluginName:e,clipPathID:null,computedData$:n,containerPosition$:c,isCategorySeprate$:f}).pipe(C(p)),b=a.pipe(L(x=>x.barLabel.position),q(),z(x=>on(()=>x==="inside",o,St(()=>0))));return h.subscribe(x=>{const $=t.selectAll("defs").data([g]).join("defs"),S=[{id:g,width:x.width,height:x.height}];BN({defsSelection:$,clipPathData:S})}),O({containerSelection:y,fullParams:a,containerSize:h,fullDataFormatter:s,fullChartParams:l,transitionEase:u,visibleComputedRankingData:r,rankingScaleList:i,valueScale:b}).pipe(C(p),z(async x=>x)).subscribe(x=>{x.containerSelection.each(($,S,_)=>{const A=X(_[S]),w=x.rankingScaleList[S];if(!w)return;const P=A.selectAll(`g.${d}`).data([S]).join("g").attr("class",d).attr("clip-path",`url(#${g})`),I=A.selectAll(`g.${m}`).data([x.fullParams]).join("g").classed(m,!0);EN({selection:P,fullParams:x.fullParams,fullChartParams:x.fullChartParams,transitionEase:x.transitionEase,rankingScale:w,categoryData:x.visibleComputedRankingData[S],valueScale:x.valueScale}),IN({selection:I,textClassName:m,fullParams:x.fullParams,containerSize:x.containerSize,fullDataFormatter:x.fullDataFormatter,fullChartParams:x.fullChartParams})})}),()=>{p.next(void 0)}};function NN({containerSelection:e,paddingGClassName:t,itemGClassName:n,bubbleData:r,transitionDuration:i,transitionEase:o,ordinalPadding:a}){return e.each((l,u,c)=>{X(c[u]).selectAll(`g.${t}`).data([0]).join(f=>f.append("g").attr("class",t),f=>f,f=>f.remove()).attr("transform",`translate(${a}, 0)`).each((f,p,d)=>{X(d[p]).selectAll(`g.${n}`).data(r[u]??[],g=>g.id).join(g=>g.append("g").attr("class",n).attr("cursor","pointer").attr("transform",y=>`translate(0, ${y.graphicValue[0]?y.graphicValue[0].y:0})`),g=>g.transition().duration(i).ease(_r(o)).attr("transform",y=>`translate(0, ${y.graphicValue[0]?y.graphicValue[0].y:0})`),g=>g.remove())})}),e.selectAll(`g.${n}`)}function FN({graphicGSelection:e,transitionDuration:t}){return e.each((r,i,o)=>{X(o[i]).selectAll("circle").data(r.graphicValue).join("circle").attr("fill",s=>r.color).style("opacity",s=>s.opacity).transition().duration(100).ease(Ft).attr("cx",s=>s.x).attr("r",s=>s.r)}),e.selectAll("circle")}function zN({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function ON({selection:e,ids:t,fullChartParams:n}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").duration(200).style("opacity",(r,i)=>r.opacity);return}e.each((r,i,o)=>{const a=r._refDatum;t.includes(a.id)?X(o[i]).style("opacity",s=>s.opacity):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const GN=(e,{selection:t,computedData$:n,visibleComputedRankingData$:r,CategoryDataMap$:i,valueLabels$:o,fullParams$:a,fullDataFormatter$:s,fullChartParams$:l,highlight$:u,rankingItemHeight$:c,rankingScaleList$:h,containerPosition$:f,containerSize$:p,ordinalScale$:d,ordinalPadding$:m,isCategorySeprate$:g,event$:y})=>{const b=new Q,x=Oe(e,"clipPath-box"),$=H(e,"padding-g"),S=H(e,"item-g"),_=Pr({selection:t,pluginName:e,clipPathID:x,computedData$:n,containerPosition$:f,isCategorySeprate$:g}).pipe(C(b));p.subscribe(k=>{const B=t.selectAll("defs").data([x]).join("defs"),F=[{id:x,width:k.width,height:k.height}];zN({defsSelection:B,clipPathData:F})});const A=O({sizeAdjust:a.pipe(L(k=>k.bubble.sizeAdjust),q()),rankingItemHeight:c}).pipe(C(b),z(async k=>k),L(k=>k.rankingItemHeight*k.sizeAdjust/2),q(),ne(1)),w=O({visibleComputedRankingData:r,scaleDomain:s.pipe(L(k=>k.xAxis.scaleDomain))}).pipe(C(b),z(async k=>k),L(k=>{const B=k.visibleComputedRankingData[0]&&k.visibleComputedRankingData[0][0]?k.visibleComputedRankingData[0][0].value:[];let F=k.scaleDomain[0]==="auto"||k.scaleDomain[0]==="min"?0:k.scaleDomain[0],E=k.scaleDomain[1]==="auto"||k.scaleDomain[1]==="max"?B.length-1:k.scaleDomain[1];return[F,E]}),q((k,B)=>k[0]===B[0]&&k[1]===B[1]),ne(1)),P=O({visibleComputedRankingData:r,scaleDomain:w}).pipe(C(b),z(async k=>k),L(k=>{let B=0,F=0;return k.visibleComputedRankingData.forEach(E=>{E.forEach(W=>{for(let j=k.scaleDomain[0];j<=k.scaleDomain[1];j++){const te=W.value[j];te!=null&&(te>F?F=te:te<B&&(B=te))}})}),[B,F]}),q(),ne(1)),I=O({minMaxValue:P,fullParams:a}).pipe(C(b),L(k=>Nn().domain(k.minMaxValue).range(k.fullParams.bubble.valueLinearOpacity)),q(),ne(1)),v=O({maxRadius:A,minMaxValue:P,arcScaleType:a.pipe(L(k=>k.bubble.arcScaleType),q())}).pipe(C(b),z(async k=>k),L(k=>yn().domain([0,k.minMaxValue[1]]).range([2,k.maxRadius]).exponent(k.arcScaleType==="area"?.5:1)),q(),ne(1)),N=O({visibleComputedRankingData:r,radiusScale:v,rankingScaleList:h,ordinalScale:d,opacityScale:I,scaleDomain:w,containerSize:p}).pipe(C(b),z(async k=>k),L(k=>k.visibleComputedRankingData.map((B,F)=>{const E=k.rankingScaleList[F];return B.map((W,j)=>{const te=W,V=te.value.map((ee,Y)=>{let J=k.ordinalScale(Y);return k.scaleDomain[0]===k.scaleDomain[1]&&(Y>k.scaleDomain[0]?J+=k.containerSize.width*1.5:Y<k.scaleDomain[0]&&(J-=k.containerSize.width*1.5)),{valueIndex:Y,x:J,y:E(te.label),r:k.radiusScale(ee),opacity:k.opacityScale(ee),_refDatum:te}});return{...te,graphicValue:V}})}))),R=l.pipe(C(b),L(k=>k.transitionDuration),q()),D=l.pipe(C(b),L(k=>k.transitionEase),q()),T=O({containerSelection:_,bubbleData:N,rankingScaleList:h,transitionDuration:R,transitionEase:D,ordinalPadding:m}).pipe(C(b),z(async k=>k),L(k=>NN({containerSelection:k.containerSelection,paddingGClassName:$,itemGClassName:S,bubbleData:k.bubbleData,transitionDuration:k.transitionDuration,transitionEase:k.transitionEase,ordinalPadding:k.ordinalPadding}))),M=O({graphicGSelection:T,ordinalScale:d,bubbleData:N,transitionDuration:R,fullParams:a}).pipe(C(b),z(async k=>k),L(k=>FN({graphicGSelection:k.graphicGSelection,transitionDuration:k.transitionDuration})),ne(1)),G=l.pipe(C(b),L(k=>k.highlightTarget),q());return O({graphicSelection:M,computedData:n,CategoryDataMap:i,valueLabels:o,highlightTarget:G,fullDataFormatter:s}).pipe(C(b),z(async k=>k)).subscribe(k=>{k.graphicSelection.on("mouseover",(B,F)=>{const E=F._refDatum;y.next({type:"multiValue",eventName:"mouseover",pluginName:e,highlightTarget:k.highlightTarget,valueDetail:[{value:E.value[F.valueIndex],valueIndex:F.valueIndex,valueLabel:k.valueLabels[F.valueIndex]}],datum:E,category:k.CategoryDataMap.get(E.categoryLabel),categoryIndex:E.categoryIndex,categoryLabel:E.categoryLabel,data:k.computedData,event:B})}).on("mousemove",(B,F)=>{const E=F._refDatum;y.next({type:"multiValue",eventName:"mousemove",pluginName:e,highlightTarget:k.highlightTarget,valueDetail:[{value:E.value[F.valueIndex],valueIndex:F.valueIndex,valueLabel:k.valueLabels[F.valueIndex]}],datum:E,category:k.CategoryDataMap.get(E.categoryLabel),categoryIndex:E.categoryIndex,categoryLabel:E.categoryLabel,data:k.computedData,event:B})}).on("mouseout",(B,F)=>{const E=F._refDatum;y.next({type:"multiValue",eventName:"mouseout",pluginName:e,highlightTarget:k.highlightTarget,valueDetail:[{value:E.value[F.valueIndex],valueIndex:F.valueIndex,valueLabel:k.valueLabels[F.valueIndex]}],datum:E,category:k.CategoryDataMap.get(E.categoryLabel),categoryIndex:E.categoryIndex,categoryLabel:E.categoryLabel,data:k.computedData,event:B})}).on("click",(B,F)=>{const E=F._refDatum;y.next({type:"multiValue",eventName:"click",pluginName:e,highlightTarget:k.highlightTarget,valueDetail:[{value:E.value[F.valueIndex],valueIndex:F.valueIndex,valueLabel:k.valueLabels[F.valueIndex]}],datum:E,category:k.CategoryDataMap.get(E.categoryLabel),categoryIndex:E.categoryIndex,categoryLabel:E.categoryLabel,data:k.computedData,event:B})})}),O({graphicSelection:M,highlight:u.pipe(L(k=>k.map(B=>B.id))),fullChartParams:l}).pipe(C(b),z(async k=>k)).subscribe(k=>{ON({selection:k.graphicSelection,ids:k.highlight,fullChartParams:k.fullChartParams})}),()=>{b.next(void 0)}},ba="OrdinalBubbles",WN=He({name:ba,defaultParams:b2,layerIndex:at,validator:(e,{validateColumns:t})=>{const n=t(e,{bubble:{toBeTypes:["object"]},itemLabel:{toBeTypes:["object"]},axisLabel:{toBeTypes:["object"]},rankingAmount:{toBe:'number | "auto"',test:r=>typeof r=="number"||r==="auto"}});if(e.bubble){const r=t(e.bubble,{sizeAdjust:{toBeTypes:["number"]},arcScaleType:{toBe:'"area" | "radius"',test:i=>i==="area"||i==="radius"},valueLinearOpacity:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"}});if(r.status==="error")return r}if(e.itemLabel){const r=t(e.itemLabel,{padding:{toBeTypes:["number"]},colorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}if(e.axisLabel){const r=t(e.axisLabel,{offset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},colorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}return n}})(({selection:e,name:t,observer:n,subject:r})=>{const i=e.append("g").attr("class",`${ba}-bubbles`),o=e.append("g").attr("class",`${ba}-labels`),a=new Q,s=n.fullParams$.pipe(C(a),L(d=>({barLabel:{...d.itemLabel,position:"outside"},axisLabel:{...d.axisLabel}}))),l=n.fullParams$.pipe(C(a),L(d=>d.rankingAmount),q()),u=T2({containerSize$:n.containerSize$,visibleComputedData$:n.visibleComputedData$,textSizePx$:n.textSizePx$,rankingAmount$:l}).pipe(C(a),ne(1)),c=_2({containerSize$:n.containerSize$,textSizePx$:n.textSizePx$,computedRankingAmount$:u}).pipe(C(a),ne(1)),h=A2({visibleComputedRankingData$:n.visibleComputedRankingBySumData$,rankingItemHeight$:c}).pipe(C(a),ne(1)),f=P2(`${ba}-labels`,{selection:o,computedData$:n.computedData$,visibleComputedRankingData$:n.visibleComputedRankingBySumData$,rankingScaleList$:h,xScale$:n.xScale$,fullParams$:s,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,transitionEase$:n.fullChartParams$.pipe(L(d=>d.transitionEase),q()),containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,isCategorySeprate$:n.isCategorySeprate$}),p=GN(`${ba}-bubbles`,{selection:i,computedData$:n.computedData$,visibleComputedRankingData$:n.visibleComputedRankingBySumData$,CategoryDataMap$:n.CategoryDataMap$,valueLabels$:n.valueLabels$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,highlight$:n.highlight$,rankingItemHeight$:c,rankingScaleList$:h,containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,ordinalPadding$:n.ordinalPadding$,ordinalScale$:n.ordinalScale$,isCategorySeprate$:n.isCategorySeprate$,event$:r.event$});return()=>{a.next(void 0),f(),p()}}),D2=(e,{rootSelection:t,dataFormatter$:n,fullDataFormatter$:r,xyMinMax$:i,layout$:o})=>{const a=new Q;let s={k:1,x:0,y:0};const l=r.pipe(L(f=>f.xAxis),Br()),u=r.pipe(L(f=>f.yAxis),Br()),c=new me(f=>{O({initXAxis:l,layout:o,xyMinMax:i}).pipe(C(a),z(async p=>p)).subscribe(p=>{const d=Sc({maxValue:p.xyMinMax.maxX,minValue:p.xyMinMax.minX,axisWidth:p.layout.width,scaleDomain:p.initXAxis.scaleDomain,scaleRange:p.initXAxis.scaleRange});f.next(d)})}),h=O({initXAxis:l,initYAxis:u,xyMinMax:i}).pipe(C(a),z(async f=>f),L(f=>{let p=f.xyMinMax.minX,d=f.xyMinMax.maxX,m=f.xyMinMax.minY,g=f.xyMinMax.maxY;return f.initXAxis.scaleDomain[0]==="auto"&&p>0&&(p=0),f.initXAxis.scaleDomain[1]==="auto"&&d<0&&(d=0),f.initYAxis.scaleDomain[0]==="auto"&&m>0&&(m=0),f.initYAxis.scaleDomain[1]==="auto"&&g<0&&(g=0),{minX:p,maxX:d,minY:m,maxY:g}}));return O({initXScale:c,fullDataFormatter:r,minMaxScaleDomain:h}).pipe(C(a),z(async f=>f)).subscribe(f=>{const p=f.initXScale.copy(),d=Tn().on("zoom",function(g){const y=g.transform,b=S=>{const _=Math.round(S);return Math.min(f.minMaxScaleDomain.maxX,Math.max(f.minMaxScaleDomain.minX,_))},x=y.rescaleX(p).domain().map(b);x[0]<=f.minMaxScaleDomain.minX&&x[1]>=f.minMaxScaleDomain.maxX?y.k<s.k&&(y.k=s.k,y.x=s.x,y.y=s.y):x[1]-x[0]<=1&&y.k>s.k&&(y.k=s.k,y.x=s.x,y.y=s.y),s.k=y.k,s.x=y.x,s.y=y.y;const $={...f.fullDataFormatter,xAxis:{...f.fullDataFormatter.xAxis,scaleDomain:x}};n.next($)});t.call(d)}),()=>{a.next(void 0),t.call(Tn().on("zoom",null))}},C2="OrdinalZoom",VN=He({name:C2,defaultParams:rg,layerIndex:Lp,validator:(e,{validateColumns:t})=>({status:"success",columnName:"",expectToBe:""})})(({selection:e,rootSelection:t,name:n,observer:r,subject:i})=>{const o=new Q,a=r.computedData$.pipe(C(o),L(l=>({minX:0,maxX:l[0]&&l[0][0]?l[0][0].value.length-1:0,minY:0,maxY:0}))),s=D2(C2,{rootSelection:t,fullDataFormatter$:r.fullDataFormatter$,xyMinMax$:a,layout$:r.layout$,dataFormatter$:i.dataFormatter$});return()=>{o.next(void 0),s()}}),YN="start",XN="middle";function UN({selection:e,fullParams:t,fullChartParams:n,rankingScale:r,xScale:i,categoryData:o,computedRankingAmount:a}){const s=o.slice(0,a+1);return e.selectAll("g").data(s,c=>c.id).join(c=>c.append("g").attr("transform",h=>`translate(${i(h.value[h.xValueIndex]??0)+t.padding}, ${r(h.label)})`),c=>c.transition().duration(n.transitionDuration).ease(Ft).attr("transform",h=>`translate(${i(h.value[h.xValueIndex]??0)+t.padding}, ${r(h.label)})`),c=>c.remove()).each((c,h,f)=>{X(f[h]).selectAll("text").data([c]).join(d=>d.append("text"),d=>d,d=>d.remove()).attr("text-anchor",YN).attr("dominant-baseline",XN).attr("font-size",n.styles.textSize).style("fill",pe(t.colorType,n)).transition().duration(n.transitionDuration).ease(Ft).textTween(d=>{const m=d.xValueIndex,g=m===0?0:m-1,y=d.value[g],b=d.value[m];return x=>{const $=x===1?bt(y,b)(x):So(y,b)(x);return rn($,t.format)}})}).selectAll("text")}function jN({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",o=>0).attr("y",0).attr("width",o=>o.width*1.5).attr("height",o=>o.height)})}const HN=(e,{selection:t,computedData$:n,visibleComputedRankingData$:r,rankingScaleList$:i,xScale$:o,computedRankingAmount$:a,fullParams$:s,fullChartParams$:l,containerPosition$:u,containerSize$:c,isCategorySeprate$:h})=>{const f=new Q,p=H(e,"box"),d=Oe(e,"clipPath-box"),m=Pr({selection:t,pluginName:e,clipPathID:null,computedData$:n,containerPosition$:u,isCategorySeprate$:h}).pipe(C(f));return c.subscribe(g=>{const y=t.selectAll("defs").data([d]).join("defs"),b=[{id:d,width:g.width,height:g.height}];jN({defsSelection:y,clipPathData:b})}),O({containerSelection:m,fullParams:s,fullChartParams:l,visibleComputedRankingData:r,rankingScaleList:i,xScale:o,computedRankingAmount:a}).pipe(C(f),z(async g=>g)).subscribe(g=>{g.containerSelection.each((y,b,x)=>{const $=X(x[b]),S=g.rankingScaleList[b];if(!S)return;const _=$.selectAll(`g.${p}`).data([b]).join("g").attr("class",p).attr("clip-path",`url(#${d})`);UN({selection:_,fullParams:g.fullParams,fullChartParams:g.fullChartParams,rankingScale:S,categoryData:g.visibleComputedRankingData[b],xScale:g.xScale,computedRankingAmount:g.computedRankingAmount})})}),()=>{f.next(void 0)}};function qN({containerSelection:e,visibleComputedRankingData:t,rankingScaleList:n,transitionDuration:r}){return e.each((o,a,s)=>{X(s[a]).selectAll("g").data(t[a]??[],u=>u.id).join(u=>u.append("g").attr("cursor","pointer").attr("transform",c=>`translate(0, ${n[a]&&n[a](c.label)})`),u=>u.transition().duration(r).ease(Ft).attr("transform",c=>`translate(0, ${n[a]&&n[a](c.label)})`),u=>u.remove())}),e.selectAll("g")}function ZN({graphicGSelection:e,rectClassName:t,xScale:n,fullParams:r,barWidth:i,transitionDuration:o}){return e.each((s,l,u)=>{const c=i/2,h=r.bar.barRadius===!0?c:r.bar.barRadius===!1?0:typeof r.bar.barRadius=="number"?r.bar.barRadius:0;X(u[l]).selectAll(`rect.${t}`).data([s],p=>p.id).join(p=>p.append("rect").classed(t,!0).attr("cursor","pointer").attr("width",d=>n(d.value[d.xValueIndex])??1).attr("height",i),p=>p.transition().duration(o).ease(Ft).attr("width",d=>n(d.value[d.xValueIndex])??1).attr("height",i),p=>p.remove()).attr("transform",`translate(0, ${-c})`).attr("fill",p=>p.color).attr("rx",h).attr("ry",h)}),e.selectAll(`rect.${t}`)}function KN({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join(o=>o.append("rect"),o=>o,o=>o.remove()).attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}function QN({selection:e,ids:t,fullChartParams:n}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").duration(200).style("opacity",1);return}e.each((r,i,o)=>{t.includes(r.id)?X(o[i]).style("opacity",1):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const JN=(e,{selection:t,computedData$:n,visibleComputedRankingData$:r,CategoryDataMap$:i,fullParams$:o,fullDataFormatter$:a,fullChartParams$:s,highlight$:l,rankingItemHeight$:u,rankingScaleList$:c,containerPosition$:h,containerSize$:f,xScale$:p,isCategorySeprate$:d,event$:m})=>{const g=new Q,y=Oe(e,"clipPath-box"),b=H(e,"rect"),x=Pr({selection:t,pluginName:e,clipPathID:y,computedData$:n,containerPosition$:h,isCategorySeprate$:d}).pipe(C(g));f.subscribe(P=>{const I=t.selectAll("defs").data([y]).join("defs"),v=[{id:y,width:P.width,height:P.height}];KN({defsSelection:I,clipPathData:v})});const $=O({fullParams:o,rankingItemHeight:u}).pipe(C(g),z(async P=>P),L(P=>P.fullParams.bar.barWidth?P.fullParams.bar.barWidth:P.rankingItemHeight-P.fullParams.bar.barPadding),q()),S=s.pipe(C(g),L(P=>P.transitionDuration),q()),_=O({containerSelection:x,visibleComputedRankingData:r,rankingScaleList:c,transitionDuration:S}).pipe(C(g),z(async P=>P),L(P=>qN({containerSelection:P.containerSelection,visibleComputedRankingData:P.visibleComputedRankingData,rankingScaleList:P.rankingScaleList,transitionDuration:P.transitionDuration}))),A=O({graphicGSelection:_,xScale:p,barWidth:$,transitionDuration:S,fullParams:o}).pipe(C(g),z(async P=>P),L(P=>ZN({graphicGSelection:P.graphicGSelection,rectClassName:b,xScale:P.xScale,fullParams:P.fullParams,barWidth:P.barWidth,transitionDuration:P.transitionDuration})),ne(1)),w=s.pipe(C(g),L(P=>P.highlightTarget),q());return O({graphicSelection:A,computedData:n,CategoryDataMap:i,highlightTarget:w,fullDataFormatter:a}).pipe(C(g),z(async P=>P)).subscribe(P=>{P.graphicSelection.on("mouseover",(I,v)=>{m.next({type:"multiValue",eventName:"mouseover",pluginName:e,highlightTarget:P.highlightTarget,valueDetail:[{value:v.value[v.xValueIndex],valueIndex:v.xValueIndex,valueLabel:P.fullDataFormatter.valueLabels[v.xValueIndex]??String(v.xValueIndex)}],datum:v,category:P.CategoryDataMap.get(v.categoryLabel),categoryIndex:v.categoryIndex,categoryLabel:v.categoryLabel,data:P.computedData,event:I})}).on("mousemove",(I,v)=>{m.next({type:"multiValue",eventName:"mousemove",pluginName:e,highlightTarget:P.highlightTarget,valueDetail:[{value:v.value[v.xValueIndex],valueIndex:v.xValueIndex,valueLabel:P.fullDataFormatter.valueLabels[v.xValueIndex]??String(v.xValueIndex)}],datum:v,category:P.CategoryDataMap.get(v.categoryLabel),categoryIndex:v.categoryIndex,categoryLabel:v.categoryLabel,data:P.computedData,event:I})}).on("mouseout",(I,v)=>{m.next({type:"multiValue",eventName:"mouseout",pluginName:e,highlightTarget:P.highlightTarget,valueDetail:[{value:v.value[v.xValueIndex],valueIndex:v.xValueIndex,valueLabel:P.fullDataFormatter.valueLabels[v.xValueIndex]??String(v.xValueIndex)}],datum:v,category:P.CategoryDataMap.get(v.categoryLabel),categoryIndex:v.categoryIndex,categoryLabel:v.categoryLabel,data:P.computedData,event:I})}).on("click",(I,v)=>{m.next({type:"multiValue",eventName:"click",pluginName:e,highlightTarget:P.highlightTarget,valueDetail:[{value:v.value[v.xValueIndex],valueIndex:v.xValueIndex,valueLabel:P.fullDataFormatter.valueLabels[v.xValueIndex]??String(v.xValueIndex)}],datum:v,category:P.CategoryDataMap.get(v.categoryLabel),categoryIndex:v.categoryIndex,categoryLabel:v.categoryLabel,data:P.computedData,event:I})})}),O({graphicSelection:A,highlight:l.pipe(L(P=>P.map(I=>I.id))),fullChartParams:s}).pipe(C(g),z(async P=>P)).subscribe(P=>{QN({selection:P.graphicSelection,ids:P.highlight,fullChartParams:P.fullChartParams})}),()=>{g.next(void 0)}},Dr="RacingBars",eF=He({name:Dr,defaultParams:Jp,layerIndex:at,validator:(e,{validateColumns:t})=>{const n=t(e,{bar:{toBeTypes:["object"]},barLabel:{toBeTypes:["object"]},valueLabel:{toBeTypes:["object"]},axisLabel:{toBeTypes:["object"]},rankingAmount:{toBe:'number | "auto"',test:r=>typeof r=="number"||r==="auto"},autorun:{toBeTypes:["boolean"]},loop:{toBeTypes:["boolean"]}});if(e.bar){const r=t(e.bar,{barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}});if(r.status==="error")return r}if(e.barLabel){const r=t(e.barLabel,{position:{toBe:'"inside" | "outside" | "none"',test:i=>i==="inside"||i==="outside"||i==="none"},padding:{toBeTypes:["number"]},colorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}if(e.valueLabel){const r=t(e.valueLabel,{padding:{toBeTypes:["number"]},colorType:{toBeOption:"ColorType"},format:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.axisLabel){const r=t(e.axisLabel,{offset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},colorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}return n}})(({selection:e,name:t,observer:n,subject:r})=>{const i=e.append("g").attr("class",`${Dr}-bars`),o=e.append("g").attr("class",`${Dr}-labels`),a=e.append("g").attr("class",`${Dr}-valueLabels`),s=new Q,l=n.fullParams$.pipe(C(s),L(S=>S.valueLabel)),u=n.fullParams$.pipe(C(s),L(S=>S.rankingAmount),q()),c=T2({containerSize$:n.containerSize$,visibleComputedData$:n.visibleComputedData$,textSizePx$:n.textSizePx$,rankingAmount$:u}).pipe(C(s),ne(1)),h=_2({containerSize$:n.containerSize$,textSizePx$:n.textSizePx$,computedRankingAmount$:c}).pipe(C(s),ne(1)),f=A2({visibleComputedRankingData$:n.visibleComputedRankingByIndexData$,rankingItemHeight$:h}).pipe(C(s),ne(1)),p=P2(`${Dr}-labels`,{selection:o,computedData$:n.computedData$,visibleComputedRankingData$:n.visibleComputedRankingByIndexData$,rankingScaleList$:f,xScale$:n.xScale$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,transitionEase$:St("easeLinear"),containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,isCategorySeprate$:n.isCategorySeprate$}),d=HN(`${Dr}-valueLabels`,{selection:a,computedData$:n.computedData$,visibleComputedRankingData$:n.visibleComputedRankingByIndexData$,rankingScaleList$:f,xScale$:n.xScale$,computedRankingAmount$:c,fullParams$:l,fullChartParams$:n.fullChartParams$,containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,isCategorySeprate$:n.isCategorySeprate$}),m=JN(`${Dr}-bars`,{selection:i,computedData$:n.computedData$,visibleComputedRankingData$:n.visibleComputedRankingByIndexData$,CategoryDataMap$:n.CategoryDataMap$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,highlight$:n.highlight$,rankingItemHeight$:h,rankingScaleList$:f,xScale$:n.xScale$,containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,isCategorySeprate$:n.isCategorySeprate$,event$:r.event$}),g=n.visibleComputedRankingByIndexData$.pipe(C(s),L(S=>(S[0]&&S[0][0]&&S[0][0].value.length)??0),q()),y=n.fullParams$.pipe(C(s),L(S=>S.autorun),q()),b=n.fullParams$.pipe(C(s),L(S=>S.loop),q()),x=n.fullChartParams$.pipe(C(s),L(S=>S.transitionDuration),q());let $=!0;return O({autorun:y,loop:b,valueAmount:g,tickDurationPeriod:x,fullDataFormatter:n.fullDataFormatter$}).pipe(C(s),z(async S=>S)).subscribe(({autorun:S,loop:_,valueAmount:A,tickDurationPeriod:w,fullDataFormatter:P})=>{if($!=!1&&S){const I=P.xAxis.valueIndex+1;I<A?($=!1,setTimeout(()=>{r.dataFormatter$.next({...P,xAxis:{...P.xAxis,valueIndex:I}}),$=!0},w)):I>=A&&_&&($=!1,setTimeout(()=>{r.dataFormatter$.next({...P,xAxis:{...P.xAxis,valueIndex:0}}),$=!0},w))}}),()=>{s.next(void 0),p(),d(),m()}}),xa="RacingCounterTexts",L2=H(xa,"container"),Fi=H(xa,"box"),sg=H(xa,"text"),tF={name:xa,defaultParams:eg,layerIndex:bu,validator:(e,{validateColumns:t})=>t(e,{renderFn:{toBeTypes:["Function"]},textAttrs:{toBeTypes:["object[]"]},textStyles:{toBeTypes:["object[]"]},paddingRight:{toBeTypes:["number"]},paddingBottom:{toBeTypes:["number"]}})};function nF({selection:e,data:t,fullParams:n,containerSize:r}){const i=r.width-n.paddingRight,o=r.height-n.paddingBottom;return e.selectAll(`g.${Fi}`).data([Fi]).join("g").classed(Fi,!0).attr("transform",`translate(${i}, ${o})`).each((s,l,u)=>{X(u[l]).selectAll(`text.${sg}`).data(t).join("text").classed(sg,!0).each((h,f,p)=>{const d=X(p[f]).text(h.text);Object.keys(h.attr).forEach(m=>{d.attr(m,h.attr[m])}),Object.keys(h.style).forEach(m=>{d.style(m,h.style[m])})})}).selectAll(`text.${sg}`)}function rF({computedData:e,valueLabel:t,valueIndex:n,renderFn:r,textAttrs:i,textStyles:o}){const a=t||String(n),s=r(a,n,e);return(Array.isArray(s)?s:[s]).map((u,c)=>({text:u,attr:i[c],style:o[c]}))}function iF(e,t){const n=new Q;return O({textData:t.textData$,fullParams:t.fullParams$,containerSize:t.containerSize$}).pipe(C(n)).subscribe(r=>{nF({selection:t.containerSelection,data:r.textData,fullParams:r.fullParams,containerSize:r.containerSize})}),()=>{n.next(void 0)}}const oF=He(tF)(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=O({computedData:n.computedData$.pipe(q((u,c)=>u.length===c.length)),isCategorySeprate:n.isCategorySeprate$}).pipe(C(i),z(async u=>u),L(u=>u.isCategorySeprate?u.computedData:[u.computedData[0]]),L((u,c)=>e.selectAll(`g.${L2}`).data(u,h=>h&&h[0]?h[0].categoryIndex:c).join("g").classed(L2,!0)));o.pipe(C(i),L((u,c)=>u.selectAll(`g.${Fi}`).data([Fi]).join("g").classed(Fi,!0))),O({containerSelection:o,gridContainerPosition:n.containerPosition$}).pipe(C(i),z(async u=>u)).subscribe(u=>{u.containerSelection.attr("transform",(c,h)=>{const f=u.gridContainerPosition[h]??u.gridContainerPosition[0],p=f.translate;return f.scale,`translate(${p[0]}, ${p[1]})`})});const a=O({xyValueIndex:n.xyValueIndex$,fullDataFormatter:n.fullDataFormatter$}).pipe(C(i),z(async u=>u),L(u=>u.fullDataFormatter.valueLabels[u.xyValueIndex[0]]??""),q(),ne(1)),s=O({xyValueIndex:n.xyValueIndex$,valueLabel:a,computedData:n.computedData$,fullParams:n.fullParams$}).pipe(C(i),z(async u=>u),L(u=>rF({valueIndex:u.xyValueIndex[0],valueLabel:u.valueLabel,computedData:u.computedData,renderFn:u.fullParams.renderFn,textAttrs:u.fullParams.textAttrs,textStyles:u.fullParams.textStyles})),ne(1)),l=[];return o.pipe(C(i)).subscribe(u=>{l.forEach(c=>c()),u.each((c,h,f)=>{const p=X(f[h]);n.visibleComputedRankingByIndexData$.pipe(C(i),L(d=>d[h]??d[0])),n.containerPosition$.pipe(C(i),L(d=>d[h]??d[0])),l[h]=iF(xa,{containerSelection:p,textData$:s,fullParams$:n.fullParams$,valueLabel$:a,xyValueIndex$:n.xyValueIndex$,containerSize$:n.containerSize$})})}),()=>{i.next(void 0),l.forEach(u=>u())}}),aF=6,sF="middle",lF="hanging",uF="start",cF="hanging";function fF({selection:e,position:t,xLabelClassName:n,fullParams:r,containerSize:i,fullDataFormatter:o,fullChartParams:a}){let l=r.tickPadding+r.labelOffset[0],u,c;t==="top"?(u=0,c=-r.tickPadding-r.labelOffset[1]):(u=i.height,c=r.tickPadding+r.labelOffset[1]);let h=c;e.selectAll(`g.${n}`).data([r]).join("g").classed(n,!0).each((f,p,d)=>{X(d[p]).selectAll("text").data([f]).join(m=>m.append("text").style("font-weight","bold"),m=>m,m=>m.remove()).attr("text-anchor",uF).attr("dominant-baseline",cF).attr("font-size",a.styles.textSize).style("fill",pe(r.labelColorType,a)).attr("x",l).attr("y",h).text(m=>o.xAxis.label)}).attr("transform",f=>`translate(${i.width}, ${u})`)}function hF({selection:e,position:t,xAxisClassName:n,fullParams:r,containerSize:i,fullChartParams:o,xScale:a,transitionDuration:s}){let l,u;t==="top"?(l=0,u=hs(a)):(l=i.height,u=Km(a));const c=e.selectAll(`g.${n}`).data([r]).join("g").classed(n,!0).attr("transform",`translate(0, ${l})`);let h=r.tickPadding;const f=u.scale(a).ticks(r.ticks).tickFormat(m=>rn(m,r.tickFormat)).tickSize(r.tickFullLine==!0?-i.height:aF).tickSizeOuter(-i.height).tickPadding(h),p=c.transition().duration(s).ease(Ft).call(f);return p.selectAll("line").style("fill","none").style("stroke",r.tickLineVisible==!0?pe(r.tickColorType,o):"none").style("stroke-dasharray",r.tickFullLineDasharray).attr("pointer-events","none"),p.selectAll("path").style("fill","none").style("stroke",r.axisLineVisible==!0?pe(r.axisLineColorType,o):"none").style("shape-rendering","crispEdges"),c.selectAll("text").attr("font-size",o.styles.textSize).style("color",pe(r.tickTextColorType,o)).attr("text-anchor",sF).attr("dominant-baseline",lF).attr("dy",0),c}const lg=(e,{selection:t,position$:n,computedData$:r,fullParams$:i,fullDataFormatter$:o,fullChartParams$:a,isCategorySeprate$:s,containerPosition$:l,containerSize$:u,xScale$:c,transitionDuration$:h})=>{const f=new Q,p=H(e,"xAxisG"),d=H(e,"xAxis"),m=H(e,"xLabel"),y=Pr({selection:t,pluginName:e,clipPathID:null,computedData$:r,containerPosition$:l,isCategorySeprate$:s}).pipe(C(f)).pipe(C(f),L((b,x)=>b.selectAll(`g.${p}`).data([p]).join("g").classed(p,!0)));return O({axisSelection:y,position:n,fullParams:i,computedData:r,containerSize:u,fullDataFormatter:o,fullChartParams:a,xScale:c,transitionDuration:h}).pipe(C(f),z(async b=>b)).subscribe(b=>{hF({selection:b.axisSelection,position:b.position,xAxisClassName:d,fullParams:b.fullParams,containerSize:b.containerSize,fullChartParams:b.fullChartParams,xScale:b.xScale,transitionDuration:b.transitionDuration}),fF({selection:b.axisSelection,position:b.position,xLabelClassName:m,fullParams:b.fullParams,containerSize:b.containerSize,fullDataFormatter:b.fullDataFormatter,fullChartParams:b.fullChartParams})}),()=>{f.next(void 0)}},M2="RacingValueAxis",pF=He({name:M2,defaultParams:tg,layerIndex:Ct,validator:(e,{validateColumns:t})=>{const n=t(e,{labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextColorType:{toBeOption:"ColorType"}});return n.status==="error",n}})(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=n.fullChartParams$.pipe(C(i),L(s=>s.transitionDuration),q()),a=lg(M2,{selection:e,position$:St("top"),transitionDuration$:o,computedData$:n.computedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,isCategorySeprate$:n.isCategorySeprate$,containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,xScale$:n.xScale$});return()=>{i.next(void 0),a()}}),_n="Scatter",gF={name:_n,defaultParams:x2,layerIndex:yu,validator:(e,{validateColumns:t})=>t(e,{radius:{toBeTypes:["number"]},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]}})};function dF({graphicGSelection:e,circleGClassName:t,circleClassName:n,visibleComputedXYData:r,fullParams:i,fullChartParams:o,graphicReverseScale:a}){const s=c=>{const h=c.size();return o.transitionDuration/h};let l=0;return e.each((c,h,f)=>{X(f[h]).selectAll("g").data(r[h],p=>p.id).join(p=>(l=s(p),p.append("g").classed(t,!0)),p=>p,p=>p.remove()).attr("transform",p=>`translate(${p.axisX}, ${p.axisY})`).each((p,d,m)=>{X(m[d]).selectAll("circle").data([p]).join(g=>g.append("circle").style("cursor","pointer").style("vector-effect","non-scaling-stroke").classed(n,!0).attr("opacity",0).transition().delay((y,b)=>d*l).attr("opacity",1),g=>g.transition().duration(50).attr("opacity",1),g=>g.remove()).attr("r",i.radius).attr("fill",(g,y)=>Se({datum:g,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(g,y)=>Se({datum:g,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${a[h][0]??1}, ${a[h][1]??1})`)})}),e.selectAll(`circle.${n}`)}function mF({selection:e,ids:t,fullChartParams:n}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").duration(200).style("opacity",1);return}e.each((r,i,o)=>{t.includes(r.id)?X(o[i]).style("opacity",1).transition("highlight").duration(200):X(o[i]).style("opacity",n.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function yF({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join("rect").attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}const bF=He(gF)(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=Oe(_n,"clipPath-box"),a=H(_n,"circleG"),s=H(_n,"circle"),{categorySelection$:l,axesSelection$:u,defsSelection$:c,graphicGSelection$:h}=Su({selection:e,pluginName:_n,clipPathID:o,categoryLabels$:r.categoryLabels$,containerPosition$:r.containerPosition$,graphicTransform$:r.graphicTransform$}),f=O({computedData:r.computedData$,graphicReverseScale:r.graphicReverseScale$}).pipe(C(i),z(async g=>g),L(g=>g.computedData.map((y,b)=>g.graphicReverseScale[b])));O({defsSelection:c,layout:r.layout$}).pipe(C(i),z(async g=>g)).subscribe(g=>{const y=[{id:o,width:g.layout.width,height:g.layout.height}];yF({defsSelection:g.defsSelection,clipPathData:y})});const p=O({graphicGSelection:h,visibleComputedXYData:r.visibleComputedXYData$,graphicReverseScale:f,fullChartParams:r.fullChartParams$,fullParams:r.fullParams$}).pipe(C(i),z(async g=>g),L(g=>dF({graphicGSelection:g.graphicGSelection,circleGClassName:a,circleClassName:s,visibleComputedXYData:g.visibleComputedXYData,fullParams:g.fullParams,fullChartParams:g.fullChartParams,graphicReverseScale:g.graphicReverseScale}))),d=r.fullDataFormatter$.pipe(C(i),L(g=>[g.valueLabels[0]??"X",g.valueLabels[1]??"Y"]),q((g,y)=>g[0]===y[0]&&g[1]===y[1])),m=r.fullChartParams$.pipe(C(i),L(g=>g.highlightTarget),q());return O({graphicSelection:p,computedData:r.computedData$,CategoryDataMap:r.CategoryDataMap$,highlightTarget:m,valueLabels:d}).pipe(C(i),z(async g=>g)).subscribe(g=>{g.graphicSelection.on("mouseover",(y,b)=>{n.event$.next({type:"multiValue",eventName:"mouseover",pluginName:_n,highlightTarget:g.highlightTarget,valueDetail:[{value:b.value[0],valueIndex:0,valueLabel:g.valueLabels[0]},{value:b.value[1],valueIndex:1,valueLabel:g.valueLabels[1]}],datum:b,category:g.CategoryDataMap.get(b.categoryLabel),categoryIndex:b.categoryIndex,categoryLabel:b.categoryLabel,data:g.computedData,event:y})}).on("mousemove",(y,b)=>{n.event$.next({type:"multiValue",eventName:"mousemove",pluginName:_n,highlightTarget:g.highlightTarget,valueDetail:[{value:b.value[0],valueIndex:0,valueLabel:g.valueLabels[0]},{value:b.value[1],valueIndex:1,valueLabel:g.valueLabels[1]}],datum:b,category:g.CategoryDataMap.get(b.categoryLabel),categoryIndex:b.categoryIndex,categoryLabel:b.categoryLabel,data:g.computedData,event:y})}).on("mouseout",(y,b)=>{n.event$.next({type:"multiValue",eventName:"mouseout",pluginName:_n,highlightTarget:g.highlightTarget,valueDetail:[{value:b.value[0],valueIndex:0,valueLabel:g.valueLabels[0]},{value:b.value[1],valueIndex:1,valueLabel:g.valueLabels[1]}],datum:b,category:g.CategoryDataMap.get(b.categoryLabel),categoryIndex:b.categoryIndex,categoryLabel:b.categoryLabel,data:g.computedData,event:y})}).on("click",(y,b)=>{n.event$.next({type:"multiValue",eventName:"click",pluginName:_n,highlightTarget:g.highlightTarget,valueDetail:[{value:b.value[0],valueIndex:0,valueLabel:g.valueLabels[0]},{value:b.value[1],valueIndex:1,valueLabel:g.valueLabels[1]}],datum:b,category:g.CategoryDataMap.get(b.categoryLabel),categoryIndex:b.categoryIndex,categoryLabel:b.categoryLabel,data:g.computedData,event:y})})}),O({graphicSelection:p,highlight:r.highlight$.pipe(L(g=>g.map(y=>y.id))),fullChartParams:r.fullChartParams$}).pipe(C(i),z(async g=>g)).subscribe(g=>{mF({selection:g.graphicSelection,ids:g.highlight,fullChartParams:g.fullChartParams})}),()=>{i.next(void 0)}}),An="ScatterBubbles",xF=.9,$F={name:An,defaultParams:$2,layerIndex:yu,validator:(e,{validateColumns:t})=>t(e,{fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},valueLinearOpacity:{toBeTypes:["number[]"]},arcScaleType:{toBe:"ArcScaleType",test:r=>r==="area"||r==="radius"},sizeAdjust:{toBeTypes:["number"]}})};function vF({graphicGSelection:e,circleGClassName:t,circleClassName:n,bubbleData:r,fullParams:i,fullChartParams:o,graphicReverseScale:a}){const s=c=>{const h=c.size();return o.transitionDuration/h};let l=0;return e.each((c,h,f)=>{X(f[h]).selectAll("g").data(r[h],p=>p.id).join(p=>(l=s(p),p.append("g").classed(t,!0)),p=>p,p=>p.remove()).attr("transform",p=>`translate(${p.axisX}, ${p.axisY})`).each((p,d,m)=>{X(m[d]).selectAll("circle").data([p]).join(g=>g.append("circle").style("cursor","pointer").style("vector-effect","non-scaling-stroke").classed(n,!0).attr("opacity",0).transition().delay((y,b)=>d*l).attr("opacity",y=>y.opacity),g=>g.transition().duration(50).attr("opacity",y=>y.opacity),g=>g.remove()).attr("r",g=>g.r).attr("fill",(g,y)=>Se({datum:g,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(g,y)=>Se({datum:g,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${a[h][0]??1}, ${a[h][1]??1})`)})}),e.selectAll(`circle.${n}`)}function SF({selection:e,ids:t,fullChartParams:n}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").duration(200).style("opacity",r=>r.opacity);return}e.each((r,i,o)=>{t.includes(r.id)?X(o[i]).style("opacity",s=>s.opacity).transition("highlight").duration(200):X(o[i]).style("opacity",n.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function TF({defsSelection:e,clipPathData:t}){e.selectAll("clipPath").data(t).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{X(i[r]).selectAll("rect").data([n]).join("rect").attr("x",0).attr("y",0).attr("width",o=>o.width).attr("height",o=>o.height)})}const _F=He($F)(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=Oe(An,"clipPath-box"),a=H(An,"circleG"),s=H(An,"circle"),{categorySelection$:l,axesSelection$:u,defsSelection$:c,graphicGSelection$:h}=Su({selection:e,pluginName:An,clipPathID:o,categoryLabels$:r.categoryLabels$,containerPosition$:r.containerPosition$,graphicTransform$:r.graphicTransform$}),f=O({computedData:r.computedData$,graphicReverseScale:r.graphicReverseScale$}).pipe(C(i),z(async w=>w),L(w=>w.computedData.map((P,I)=>w.graphicReverseScale[I])));O({defsSelection:c,layout:r.layout$}).pipe(C(i),z(async w=>w)).subscribe(w=>{const P=[{id:o,width:w.layout.width,height:w.layout.height}];TF({defsSelection:w.defsSelection,clipPathData:P})});const p=r.filteredXYMinMaxData$.pipe(C(i),L(w=>w.datumList.flat().map(P=>P.value[2]??0)),ne(1)),d=r.filteredXYMinMaxData$.pipe(C(i),L(w=>fc(w.datumList.flat().map(P=>P.value[2]??0)))),m=O({filteredMinMaxValue:d,fullParams:r.fullParams$}).pipe(C(i),z(async w=>w),L(w=>Nn().domain(w.filteredMinMaxValue).range(w.fullParams.valueLinearOpacity))),g=O({layout:r.layout$,fullParams:r.fullParams$}).pipe(C(i),L(w=>Math.min(w.layout.width,w.layout.height)/2*w.fullParams.sizeAdjust)),y=p.pipe(C(i),L(w=>w.reduce((P,I)=>P+I,0)),Er(w=>w>0)),b=O({totalR:g,totalValue:y,fullParams:r.fullParams$}).pipe(C(i),z(async w=>w),L(w=>yn().domain([0,w.totalValue]).range([0,w.totalR]).exponent(w.fullParams.arcScaleType==="area"?.5:1))),x=O({radiusScale:b,fullParams:r.fullParams$,totalR:g,filteredValueList:p}).pipe(C(i),z(async w=>w),L(w=>w.fullParams.arcScaleType==="area"?1:(()=>{const P=w.totalR*w.totalR*Math.PI;return Math.sqrt(P/Ec(w.filteredValueList,I=>Math.PI*Math.pow(w.radiusScale(I),2)))})())),$=O({visibleComputedXYData:r.visibleComputedXYData$,opacityScale:m,radiusScale:b,scaleFactor:x,fullParams:r.fullParams$}).pipe(C(i),z(async w=>w),L(w=>w.visibleComputedXYData.map(P=>P.map(I=>{const v=I;return v.r=w.radiusScale(v.value[2])*w.scaleFactor*xF,v.opacity=w.opacityScale(v.value[2]),v})))),S=O({graphicGSelection:h,bubbleData:$,graphicReverseScale:f,fullChartParams:r.fullChartParams$,fullParams:r.fullParams$}).pipe(C(i),z(async w=>w),L(w=>vF({graphicGSelection:w.graphicGSelection,circleGClassName:a,circleClassName:s,bubbleData:w.bubbleData,fullParams:w.fullParams,fullChartParams:w.fullChartParams,graphicReverseScale:w.graphicReverseScale}))),_=r.fullDataFormatter$.pipe(C(i),L(w=>[w.valueLabels[0]??"X",w.valueLabels[1]??"Y",w.valueLabels[2]??"Value"]),q((w,P)=>w[0]===P[0]&&w[1]===P[1]&&w[2]===P[2])),A=r.fullChartParams$.pipe(C(i),L(w=>w.highlightTarget),q());return O({graphicSelection:S,computedData:r.computedData$,CategoryDataMap:r.CategoryDataMap$,highlightTarget:A,valueLabels:_}).pipe(C(i),z(async w=>w)).subscribe(w=>{w.graphicSelection.on("mouseover",(P,I)=>{n.event$.next({type:"multiValue",eventName:"mouseover",pluginName:An,highlightTarget:w.highlightTarget,valueDetail:[{value:I.value[0],valueIndex:0,valueLabel:w.valueLabels[0]},{value:I.value[1],valueIndex:1,valueLabel:w.valueLabels[1]},{value:I.value[2],valueIndex:2,valueLabel:w.valueLabels[2]}],datum:I,category:w.CategoryDataMap.get(I.categoryLabel),categoryIndex:I.categoryIndex,categoryLabel:I.categoryLabel,data:w.computedData,event:P})}).on("mousemove",(P,I)=>{n.event$.next({type:"multiValue",eventName:"mousemove",pluginName:An,highlightTarget:w.highlightTarget,valueDetail:[{value:I.value[0],valueIndex:0,valueLabel:w.valueLabels[0]},{value:I.value[1],valueIndex:1,valueLabel:w.valueLabels[1]},{value:I.value[2],valueIndex:2,valueLabel:w.valueLabels[2]}],datum:I,category:w.CategoryDataMap.get(I.categoryLabel),categoryIndex:I.categoryIndex,categoryLabel:I.categoryLabel,data:w.computedData,event:P})}).on("mouseout",(P,I)=>{n.event$.next({type:"multiValue",eventName:"mouseout",pluginName:An,highlightTarget:w.highlightTarget,valueDetail:[{value:I.value[0],valueIndex:0,valueLabel:w.valueLabels[0]},{value:I.value[1],valueIndex:1,valueLabel:w.valueLabels[1]},{value:I.value[2],valueIndex:2,valueLabel:w.valueLabels[2]}],datum:I,category:w.CategoryDataMap.get(I.categoryLabel),categoryIndex:I.categoryIndex,categoryLabel:I.categoryLabel,data:w.computedData,event:P})}).on("click",(P,I)=>{n.event$.next({type:"multiValue",eventName:"click",pluginName:An,highlightTarget:w.highlightTarget,valueDetail:[{value:I.value[0],valueIndex:0,valueLabel:w.valueLabels[0]},{value:I.value[1],valueIndex:1,valueLabel:w.valueLabels[1]},{value:I.value[2],valueIndex:2,valueLabel:w.valueLabels[2]}],datum:I,category:w.CategoryDataMap.get(I.categoryLabel),categoryIndex:I.categoryIndex,categoryLabel:I.categoryLabel,data:w.computedData,event:P})})}),O({graphicSelection:S,highlight:r.highlight$.pipe(L(w=>w.map(P=>P.id))),fullChartParams:r.fullChartParams$}).pipe(C(i),z(async w=>w)).subscribe(w=>{SF({selection:w.graphicSelection,ids:w.highlight,fullChartParams:w.fullChartParams})}),()=>{i.next(void 0)}}),k2="XAxis",AF=He({name:k2,defaultParams:ng,layerIndex:Ct,validator:(e,{validateColumns:t})=>{const n=t(e,{labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextColorType:{toBeOption:"ColorType"}});return n.status==="error",n}})(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=lg(k2,{selection:e,position$:St("bottom"),transitionDuration$:St(100),computedData$:n.computedData$,fullParams$:n.fullParams$,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,isCategorySeprate$:n.isCategorySeprate$,containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,xScale$:n.xScale$});return()=>{i.next(void 0),o()}}),Tu="XYAux",ug=H(Tu,"label-box"),wF={name:Tu,defaultParams:$u,layerIndex:Mp,validator:(e,{validateColumns:t})=>{const n=t(e,{xAxis:{toBeTypes:["object"]},yAxis:{toBeTypes:["object"]}});if(e.xAxis){const r=t(e.xAxis,{showLine:{toBeTypes:["boolean"]},showLabel:{toBeTypes:["boolean"]},lineDashArray:{toBeTypes:["string"]},lineColorType:{toBeOption:"ColorType"},labelColorType:{toBeOption:"ColorType"},labelTextColorType:{toBeOption:"ColorType"},labelTextFormat:{toBeTypes:["string","Function"]},labelPadding:{toBeTypes:["number"]}});if(r.status==="error")return r}if(e.yAxis){const r=t(e.yAxis,{showLine:{toBeTypes:["boolean"]},showLabel:{toBeTypes:["boolean"]},lineDashArray:{toBeTypes:["string"]},lineColorType:{toBeOption:"ColorType"},labelColorType:{toBeOption:"ColorType"},labelTextColorType:{toBeOption:"ColorType"},labelTextFormat:{toBeTypes:["string","Function"]},labelPadding:{toBeTypes:["number"]}});if(r.status==="error")return r}return n}};function PF({axisX:e,axisY:t,layout:n,fullParams:r}){return e>=0&&e<=n.width&&t>=0&&t<=n.height?[{id:"line-x",x1:e,x2:e,y1:0,y2:n.height,dashArray:r.xAxis.lineDashArray??"none",colorType:r.xAxis.lineColorType},{id:"line-0",x1:0,x2:n.width,y1:t,y2:t,dashArray:r.yAxis.lineDashArray??"none",colorType:r.yAxis.lineColorType}]:[]}function DF({axisX:e,axisY:t,xValue:n,yValue:r,fullParams:i,textSizePx:o,layout:a,columnAmount:s,rowAmount:l}){if(!(e>=0&&e<=a.width&&t>=0&&t<=a.height))return[];const u=6,c=3,h=e,f=a.height+i.xAxis.labelPadding*l,p=rn(n,i.xAxis.labelTextFormat),d=p.split(`
235
+ `),m=d.reduce((E,W)=>W.length>E.length?W:E,""),g=Mi(m,o),y=o*d.length,b=g+u*2,x=y+c*2,$=-b/2,S=-c,_=$+u,A=S+c,w=-(i.yAxis.labelPadding*s),P=t,I=rn(r,i.yAxis.labelTextFormat),v=I.split(`
236
+ `),N=v.reduce((E,W)=>W.length>E.length?W:E,""),R=Mi(N,o),D=o*v.length,T=R+u*2,M=D+c*2,G=-R-u,k=-c-D/2,B=G+u,F=k+c;return[{id:"label-x",x:h,y:f,text:p,textArr:d,textWidth:g,textHeight:y,colorType:i.xAxis.labelColorType,textColorType:i.xAxis.labelTextColorType,rectWidth:b,rectHeight:x,rectX:$,rectY:S,textX:_,textY:A},{id:"label-y",x:w,y:P,text:I,textArr:v,textWidth:R,textHeight:D,colorType:i.yAxis.labelColorType,textColorType:i.xAxis.labelTextColorType,rectWidth:T,rectHeight:M,rectX:G,rectY:k,textX:B,textY:F}]}function CF({selection:e,pluginName:t,lineData:n,fullParams:r,fullChartParams:i}){const o=H(t,"auxline");return e.selectAll(`line.${o}`).data(n).join(s=>s.append("line").classed(o,!0).style("stroke-width",1).style("pointer-events","none").style("vector-effect","non-scaling-stroke").attr("x1",l=>l.x1).attr("y1",l=>l.y1).attr("x2",l=>l.x2).attr("y2",l=>l.y2),s=>s.transition().duration(50).attr("x1",u=>u.x1).attr("y1",u=>u.y1).attr("x2",u=>u.x2).attr("y2",u=>u.y2),s=>s.remove()).style("stroke",s=>pe(s.colorType,i)).style("stroke-dasharray",s=>s.dashArray)}function LF(e){e.selectAll("line").data([]).exit().remove()}function MF({selection:e,labelData:t,fullParams:n,fullDataFormatter:r,fullChartParams:i,textReverseTransform:o,textSizePx:a}){return e.selectAll(`g.${ug}`).data(t).join(l=>l.append("g").classed(ug,!0).style("cursor","pointer").attr("transform",(u,c)=>`translate(${u.x}, ${u.y})`),l=>l.transition().duration(50).attr("transform",(c,h)=>`translate(${c.x}, ${c.y})`),l=>l.remove()).each((l,u,c)=>{X(c[u]).selectAll("rect").data([l]).join(h=>h.append("rect").style("cursor","pointer").attr("rx",5).attr("ry",5),h=>h,h=>h.remove()).attr("width",h=>`${h.rectWidth}px`).attr("height",h=>`${h.rectHeight}px`).attr("fill",h=>pe(h.colorType,i)).attr("x",h=>h.rectX).attr("y",h=>h.rectY).style("transform",o),X(c[u]).selectAll("text").data([l]).join(h=>h.append("text").style("dominant-baseline","hanging").style("cursor","pointer").style("pointer-events","none"),h=>h,h=>h.remove()).style("transform",o).attr("fill",h=>pe(h.textColorType,i)).attr("font-size",i.styles.textSize).attr("x",h=>h.textX).attr("y",h=>h.textY).each((h,f,p)=>{ma(X(p[f]),{textArr:l.textArr,textSizePx:a,groupAxisPosition:f===0?"bottom":"left",isContainerRotated:!1})})})}function kF(e){e.selectAll(`g.${ug}`).data([]).exit().remove()}const RF=He(wF)(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q,a=t.insert("rect","g").classed(H(Tu,"rect"),!0).attr("opacity",0),{categorySelection$:s,axesSelection$:l,defsSelection$:u,graphicGSelection$:c}=Su({selection:e,pluginName:Tu,clipPathID:"test",categoryLabels$:i.isCategorySeprate$.pipe(z(g=>on(()=>g,i.categoryLabels$,i.categoryLabels$.pipe(L(y=>[y[0]]))))),containerPosition$:i.containerPosition$,graphicTransform$:i.graphicTransform$});i.layout$.pipe(C(o)).subscribe(g=>{a.attr("width",g.rootWidth).attr("height",g.rootHeight)});const h=i.containerPosition$.pipe(L(g=>g.reduce((b,x)=>x.columnIndex>b?x.columnIndex:b,0)+1),q()),f=i.containerPosition$.pipe(L(g=>g.reduce((b,x)=>x.rowIndex>b?x.rowIndex:b,0)+1),q()),p=i.containerPosition$.pipe(C(o),z(async g=>g),L(g=>`${`scale(${1/g[0].scale[0]}, ${1/g[0].scale[1]})`}`),q()),d=fN({rootSelection:t,fullDataFormatter$:i.fullDataFormatter$,filteredXYMinMaxData$:i.filteredXYMinMaxData$,containerPosition$:i.containerPosition$,containerSize$:i.containerSize$,layout$:i.layout$}).pipe(C(o));O({axesSelection:l,layout:i.layout$,xyPosition:d,fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,fullChartParams:i.fullChartParams$,textReverseTransform:p,textSizePx:i.textSizePx$,columnAmount:h,rowAmount:f}).pipe(C(o),z(async g=>g)).subscribe(g=>{const{x:y,y:b,xValue:x,yValue:$}=g.xyPosition,S=PF({axisX:y,axisY:b,layout:g.layout,fullParams:g.fullParams});CF({selection:g.axesSelection,pluginName:n,lineData:S,fullParams:g.fullParams,fullChartParams:g.fullChartParams});const _=DF({axisX:y,axisY:b,xValue:x,yValue:$,fullParams:g.fullParams,textSizePx:g.textSizePx,layout:g.layout,columnAmount:g.columnAmount,rowAmount:g.rowAmount});MF({selection:g.axesSelection,labelData:_,fullParams:g.fullParams,fullDataFormatter:g.fullDataFormatter,fullChartParams:g.fullChartParams,textReverseTransform:g.textReverseTransform,textSizePx:g.textSizePx})});const m=Ar(a,"mouseout").pipe(C(o));return O({rootRectMouseout:m,axesSelection:l}).pipe(C(o),z(async g=>g)).subscribe(g=>{setTimeout(()=>{LF(g.axesSelection),kF(g.axesSelection)})}),()=>{o.next(void 0),a.remove()}}),IF=6,EF="end",BF="middle",NF="end",FF="auto";function zF({selection:e,yLabelClassName:t,fullParams:n,containerSize:r,fullDataFormatter:i,fullChartParams:o}){const a=n.tickPadding-n.labelOffset[0],s=n.tickPadding+n.labelOffset[1];let l=-a,u=-s;e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).each((c,h,f)=>{X(f[h]).selectAll("text").data([c]).join(p=>p.append("text").style("font-weight","bold"),p=>p,p=>p.remove()).attr("text-anchor",NF).attr("dominant-baseline",FF).attr("font-size",o.styles.textSize).style("fill",pe(n.labelColorType,o)).attr("x",l).attr("y",u).text(p=>i.yAxis.label)})}function OF({selection:e,yAxisClassName:t,fullParams:n,containerSize:r,fullDataFormatter:i,fullChartParams:o,yScale:a}){const s=e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0);let l=n.tickPadding;const u=Nc(a).scale(a).ticks(n.ticks).tickFormat(h=>rn(h,n.tickFormat)).tickSize(n.tickFullLine==!0?-r.width:IF).tickPadding(l),c=s.transition().duration(100).ease(Ft).call(u);return c.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?pe(n.tickColorType,o):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),c.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?pe(n.axisLineColorType,o):"none").style("shape-rendering","crispEdges"),s.selectAll("text").attr("font-size",o.styles.textSize).style("color",pe(n.tickTextColorType,o)).attr("text-anchor",EF).attr("dominant-baseline",BF).attr("x",-l).attr("dy",0),s}const GF=(e,{selection:t,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,isCategorySeprate$:a,containerPosition$:s,containerSize$:l,yScale$:u})=>{const c=new Q,h=H(e,"yAxisG"),f=H(e,"yAxis"),p=H(e,"yLabel"),m=Pr({selection:t,pluginName:e,clipPathID:null,computedData$:n,containerPosition$:s,isCategorySeprate$:a}).pipe(C(c)).pipe(C(c),L((g,y)=>g.selectAll(`g.${h}`).data([h]).join("g").classed(h,!0)));return O({axisSelection:m,fullParams:r,computedData:n,containerSize:l,fullDataFormatter:i,fullChartParams:o,yScale:u}).pipe(C(c),z(async g=>g)).subscribe(g=>{OF({selection:g.axisSelection,yAxisClassName:f,fullParams:g.fullParams,containerSize:g.containerSize,fullDataFormatter:g.fullDataFormatter,fullChartParams:g.fullChartParams,yScale:g.yScale}),zF({selection:g.axisSelection,yLabelClassName:p,fullParams:g.fullParams,containerSize:g.containerSize,fullDataFormatter:g.fullDataFormatter,fullChartParams:g.fullChartParams})}),()=>{c.next(void 0)}},cg="XYAxes",WF=He({name:cg,defaultParams:vu,layerIndex:Ct,validator:(e,{validateColumns:t})=>{const n=t(e,{xAxis:{toBeTypes:["object"]},yAxis:{toBeTypes:["object"]}});if(e.xAxis){const r=t(e.xAxis,{labelOffset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextColorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}if(e.yAxis){const r=t(e.yAxis,{labelOffset:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextColorType:{toBeOption:"ColorType"}});if(r.status==="error")return r}return n}})(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,o=n.fullParams$.pipe(C(i),L(u=>u.xAxis),q((u,c)=>JSON.stringify(u)===JSON.stringify(c))),a=n.fullParams$.pipe(C(i),L(u=>u.xAxis),q((u,c)=>JSON.stringify(u)===JSON.stringify(c))),s=lg(`${cg}-x`,{selection:e,position$:St("bottom"),transitionDuration$:St(100),computedData$:n.computedData$,fullParams$:o,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,isCategorySeprate$:n.isCategorySeprate$,containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,xScale$:n.xScale$}),l=GF(`${cg}-y`,{selection:e,computedData$:n.computedData$,fullParams$:a,fullDataFormatter$:n.fullDataFormatter$,fullChartParams$:n.fullChartParams$,isCategorySeprate$:n.isCategorySeprate$,containerPosition$:n.containerPosition$,containerSize$:n.containerSize$,yScale$:n.yScale$});return()=>{i.next(void 0),s(),l()}}),R2="XZoom",VF=He({name:R2,defaultParams:rg,layerIndex:Lp,validator:(e,{validateColumns:t})=>({status:"success",columnName:"",expectToBe:""})})(({selection:e,rootSelection:t,name:n,observer:r,subject:i})=>{const o=new Q,a=D2(R2,{rootSelection:t,fullDataFormatter$:r.fullDataFormatter$,xyMinMax$:r.xyMinMax$,layout$:r.layout$,dataFormatter$:i.dataFormatter$});return()=>{o.next(void 0),a()}}),YF={header:{height:36,text:[],textStyle:[]},footer:{height:0,text:[],textStyle:[]}},I2={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,textRenderFn:e=>{if(e.highlightTarget==="datum"&&e.datum)return[`${e.datum.label}: ${e.datum.value}`];if(e.highlightTarget==="series"){const t=e.seriesLabel,n=e.series.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[t,r]}else if(e.highlightTarget==="group"){const t=e.groupLabel,n=e.series.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[t,r]}else if(e.highlightTarget==="category"){const t=e.categoryLabel,n=e.category.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[t,r]}return[]},svgRenderFn:null};I2.textRenderFn.toString=()=>`(eventData) => {
237
237
  if (eventData.highlightTarget === 'datum' && eventData.datum) {
238
238
  return [\`\${eventData.datum.label}: \${eventData.datum.value}\`]
239
239
  } else if (eventData.highlightTarget === 'series') {
@@ -271,11 +271,11 @@ ${h}`}};Zp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
271
271
  return [label, value]
272
272
  }
273
273
  return []
274
- }`;const Fi={dot:{radius:10,fillColorType:"label",strokeColorType:"label",strokeWidth:1,styleFn:e=>""},dotLabel:{colorType:"primary",sizeFixed:!1,styleFn:e=>""},arrow:{colorType:"primary",strokeWidth:1.5,pointerWidth:5,pointerHeight:5,styleFn:e=>""},arrowLabel:{colorType:"primary",sizeFixed:!1,styleFn:e=>""},force:{nodeStrength:-500,linkDistance:100,velocityDecay:.1,alphaDecay:.05},zoomable:!0,transform:{x:0,y:0,k:1},scaleExtent:{min:0,max:1/0}};Fi.dot.styleFn.toString=()=>"(node) => ''",Fi.dotLabel.styleFn.toString=()=>"(node) => ''",Fi.arrow.styleFn.toString=()=>"(edge) => ''",Fi.arrowLabel.styleFn.toString=()=>"(edge) => ''";const zi={bubble:{radiusMin:15,radiusMax:45,arcScaleType:"area",fillColorType:"label",strokeColorType:"label",strokeWidth:1,styleFn:e=>""},bubbleLabel:{fillRate:.9,lineHeight:1,maxLineLength:6,wordBreakAll:!0,colorType:"labelContrast",styleFn:e=>""},arrow:{colorType:"primary",strokeWidthMin:1.5,strokeWidthMax:4.5,pointerWidth:5,pointerHeight:5,styleFn:e=>""},arrowLabel:{colorType:"primary",sizeFixed:!1,styleFn:e=>""},force:{nodeStrength:-500,linkDistance:130,velocityDecay:.1,alphaDecay:.05},zoomable:!0,transform:{x:0,y:0,k:1},scaleExtent:{min:0,max:1/0}};zi.bubble.styleFn.toString=()=>"(node) => ''",zi.bubbleLabel.styleFn.toString=()=>"(node) => ''",zi.arrow.styleFn.toString=()=>"(edge) => ''",zi.arrowLabel.styleFn.toString=()=>"(edge) => ''";const ES={placement:"right-end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},fg={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(e,{styles:t,utils:n})=>{const r=!!e.categoryLabel,i=!!e.datum.label,o=n.toCurrency(e.datum.value),a=t.textSizePx*.7,s=t.textSizePx/2-a/2,l=r?`<rect width="${a}" height="${a}" x="${s}" y="${s-1}" rx="${a/2}" fill="${e.datum.color}"></rect>
274
+ }`;const zi={dot:{radius:10,fillColorType:"label",strokeColorType:"label",strokeWidth:1,styleFn:e=>""},dotLabel:{colorType:"primary",sizeFixed:!1,styleFn:e=>""},arrow:{colorType:"primary",strokeWidth:1.5,pointerWidth:5,pointerHeight:5,styleFn:e=>""},arrowLabel:{colorType:"primary",sizeFixed:!1,styleFn:e=>""},force:{nodeStrength:-500,linkDistance:100,velocityDecay:.1,alphaDecay:.05},zoomable:!0,transform:{x:0,y:0,k:1},scaleExtent:{min:0,max:1/0}};zi.dot.styleFn.toString=()=>"(node) => ''",zi.dotLabel.styleFn.toString=()=>"(node) => ''",zi.arrow.styleFn.toString=()=>"(edge) => ''",zi.arrowLabel.styleFn.toString=()=>"(edge) => ''";const Oi={bubble:{radiusMin:15,radiusMax:45,arcScaleType:"area",fillColorType:"label",strokeColorType:"label",strokeWidth:1,styleFn:e=>""},bubbleLabel:{fillRate:.9,lineHeight:1,maxLineLength:6,wordBreakAll:!0,colorType:"labelContrast",styleFn:e=>""},arrow:{colorType:"primary",strokeWidthMin:1.5,strokeWidthMax:4.5,pointerWidth:5,pointerHeight:5,styleFn:e=>""},arrowLabel:{colorType:"primary",sizeFixed:!1,styleFn:e=>""},force:{nodeStrength:-500,linkDistance:130,velocityDecay:.1,alphaDecay:.05},zoomable:!0,transform:{x:0,y:0,k:1},scaleExtent:{min:0,max:1/0}};Oi.bubble.styleFn.toString=()=>"(node) => ''",Oi.bubbleLabel.styleFn.toString=()=>"(node) => ''",Oi.arrow.styleFn.toString=()=>"(edge) => ''",Oi.arrowLabel.styleFn.toString=()=>"(edge) => ''";const E2={placement:"right-end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},fg={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(e,{styles:t,utils:n})=>{const r=!!e.categoryLabel,i=!!e.datum.label,o=n.toCurrency(e.datum.value),a=t.textSizePx*.7,s=t.textSizePx/2-a/2,l=r?`<rect width="${a}" height="${a}" x="${s}" y="${s-1}" rx="${a/2}" fill="${e.datum.color}"></rect>
275
275
  <text x="${t.textSizePx*1.5}" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
276
276
  <tspan>${e.categoryLabel}</tspan>
277
- </text>`:"",u=i?`<tspan>${e.datum.label}</tspan> `:"",c=r?n.measureTextWidth(`${e.categoryLabel}${o}`,t.textSizePx)+t.textSizePx*1.5:0,h=i?n.measureTextWidth(`${e.datum.label}${o}`,t.textSizePx):0,f=Math.max(c,h),p=i?f+t.textSizePx*.5:0,g=i?"end":"start",m=`<text font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
278
- ${u}<tspan font-weight="bold" text-anchor="${g}" x="${p}">${o}</tspan>
277
+ </text>`:"",u=i?`<tspan>${e.datum.label}</tspan> `:"",c=r?n.measureTextWidth(`${e.categoryLabel}${o}`,t.textSizePx)+t.textSizePx*1.5:0,h=i?n.measureTextWidth(`${e.datum.label}${o}`,t.textSizePx):0,f=Math.max(c,h),p=i?f+t.textSizePx*.5:0,d=i?"end":"start",m=`<text font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
278
+ ${u}<tspan font-weight="bold" text-anchor="${d}" x="${p}">${o}</tspan>
279
279
  </text>`;return`${l}
280
280
  <g ${r?`transform="translate(0, ${t.textSizePx*2})"`:""}>
281
281
  ${m}
@@ -313,17 +313,17 @@ ${h}`}};Zp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
313
313
  <g \${hasCategoryLabel ? \`transform="translate(0, \${styles.textSizePx * 2})"\` : ''}>
314
314
  \${datumSvg}
315
315
  </g>\`
316
- }`;const Fe="ForceDirected",XF=H(Fe,"zoom-area"),BS=Oe(Fe,"arrow"),NS=H(Fe,"arrow-marker"),UF=H(Fe,"edge-list-g"),jF=H(Fe,"edge-g"),FS=H(Fe,"edge-arrow-path"),zS=H(Fe,"edge-label-g"),OS=H(Fe,"edge-label"),HF=H(Fe,"node-list-g"),qF=H(Fe,"node-g"),GS=H(Fe,"node-circle"),WS=H(Fe,"node-label-g"),VS=H(Fe,"node-label"),ZF={name:Fe,defaultParams:Fi,layerIndex:at,validator:(e,{validateColumns:t})=>{const n=t(e,{dot:{toBeTypes:["object"]},dotLabel:{toBeTypes:["object"]},arrow:{toBeTypes:["object"]},arrowLabel:{toBeTypes:["object"]},force:{toBeTypes:["object"]},zoomable:{toBeTypes:["boolean"]},transform:{toBeTypes:["object"]},scaleExtent:{toBeTypes:["object"]}});if(e.dot){const r=t(e.dot,{radius:{toBeTypes:["number"]},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},styleFn:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.dotLabel){const r=t(e.dotLabel,{colorType:{toBeOption:"ColorType"},sizeFixed:{toBeTypes:["boolean"]},styleFn:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.arrow){const r=t(e.arrow,{colorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},pointerWidth:{toBeTypes:["number"]},pointerHeight:{toBeTypes:["number"]},styleFn:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.arrowLabel){const r=t(e.arrowLabel,{colorType:{toBeOption:"ColorType"},sizeFixed:{toBeTypes:["boolean"]},styleFn:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.force){const r=t(e.force,{nodeStrength:{toBeTypes:["number"]},linkDistance:{toBeTypes:["number"]},velocityDecay:{toBeTypes:["number"]},alphaDecay:{toBeTypes:["number"]}});if(r.status==="error")return r}if(e.transform){const r=t(e.transform,{x:{toBeTypes:["number"]},y:{toBeTypes:["number"]},k:{toBeTypes:["number"]}});if(r.status==="error")return r}if(e.scaleExtent){const r=t(e.scaleExtent,{min:{toBeTypes:["number"]},max:{toBeTypes:["number"]}});if(r.status==="error")return r}return n}};function KF(e,t){return Zs().velocityDecay(t.force.velocityDecay).alphaDecay(t.force.alphaDecay).force("link",Yf().id(n=>n.id).strength(1).distance(n=>t.force.linkDistance)).force("charge",Ks().strength(t.force.nodeStrength)).force("collision",qs(t.dot.radius).strength(1)).force("center",Wf(e.width/2,e.height/2))}function QF(e){return"translate("+e.x+","+e.y+")"}function JF(e){const t=e.source.x+(e.target.x-e.source.x)/2,n=e.source.y+(e.target.y-e.source.y)/2;return"translate("+t+","+n+")"}function ez(e){return"M"+e.source.x+","+e.source.y+" L"+e.target.x+","+e.target.y}function tz(e,t,n){return e.selectAll(`marker.${NS}`).data([t]).join(r=>{const i=r.append("marker").classed(NS,!0).attr("id",BS).attr("fill",o=>pe(t.arrow.colorType,n)).attr("viewBox",o=>`-${o.arrow.pointerWidth} -${o.arrow.pointerHeight/2} ${o.arrow.pointerWidth} ${o.arrow.pointerHeight}`).attr("orient","auto");return i.append("path").attr("d",o=>`M${-o.arrow.pointerWidth},${-o.arrow.pointerHeight/2}L0,0L${-o.arrow.pointerWidth},${o.arrow.pointerHeight/2}`),i},r=>r,r=>r.remove()).attr("markerWidth",r=>r.arrow.pointerWidth).attr("markerHeight",r=>r.arrow.pointerHeight).attr("refX",r=>(r.dot.radius+t.dot.strokeWidth/2)/r.arrow.strokeWidth-1).attr("refY",0)}function nz(e,t){function n(o,a){o.active||e.alphaTarget(.3).restart(),o.subject.fx=o.x,o.subject.fy=o.y,t.next("start")}function r(o,a){o.subject.fx=o.x,o.subject.fy=o.y,t.next("drag")}function i(o,a){o.active||e.alphaTarget(0),o.subject.fx=null,o.subject.fy=null,t.next("end")}return $s().on("start",n).on("drag",r).on("end",i)}function rz({nodeListGSelection:e,nodes:t}){return e.selectAll("g").data(t,n=>n.id).join(n=>n.append("g").classed(qF,!0),n=>n,n=>n.remove())}function iz({nodeGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{X(o[i]).selectAll("circle").data([r]).join(s=>s.append("circle").classed(GS,!0).attr("cursor","pointer"),s=>s,s=>s.remove()).attr("r",t.dot.radius).attr("fill",s=>Se({datum:s,colorType:t.dot.fillColorType,fullChartParams:n})).attr("stroke",s=>Se({datum:s,colorType:t.dot.strokeColorType,fullChartParams:n})).attr("stroke-width",t.dot.strokeWidth).attr("style",s=>t.dot.styleFn(s))}),e.select(`circle.${GS}`)}function oz({nodeGSelection:e,fullParams:t}){return e.each((n,r,i)=>{X(i[r]).selectAll("g").data([n]).join(a=>a.append("g").classed(WS,!0),a=>a,a=>a.remove()).attr("transform",`translate(0, ${-t.dot.radius-10})`)}),e.select(`g.${WS}`)}function az({nodeLabelGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{X(o[i]).selectAll("text").data([r],s=>s.id).join(s=>s.append("text").classed(VS,!0).attr("text-anchor","middle").attr("pointer-events","none"),s=>s,s=>s.remove()).text(s=>s.label).attr("fill",s=>Se({datum:s,colorType:t.dotLabel.colorType,fullChartParams:n})).attr("font-size",n.styles.textSize).attr("style",s=>t.dotLabel.styleFn(s))}),e.select(`text.${VS}`)}function sz({edgeListGSelection:e,edges:t}){return e.selectAll("g").data(t,n=>n.id).join(n=>n.append("g").classed(jF,!0),n=>n,n=>n.remove())}function lz({edgeGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{X(o[i]).selectAll("path").data([r]).join(s=>s.append("path").classed(FS,!0).attr("marker-end",`url(#${BS})`),s=>s,s=>s.remove()).attr("stroke",s=>Se({datum:s.data,colorType:t.arrow.colorType,fullChartParams:n})).attr("stroke-width",t.arrow.strokeWidth).attr("style",s=>t.arrow.styleFn(s))}),e.select(`path.${FS}`)}function uz({edgeGSelection:e}){return e.each((t,n,r)=>{X(r[n]).selectAll("g").data([t]).join(o=>o.append("g").classed(zS,!0),o=>o,o=>o.remove())}),e.select(`g.${zS}`)}function cz({edgeLabelGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{X(o[i]).selectAll("text").data([r],s=>s.id).join(s=>s.append("text").classed(OS,!0).attr("text-anchor","middle").attr("pointer-events","none"),s=>s,s=>s.remove()).text(s=>s.label).attr("fill",s=>Se({datum:s,colorType:t.arrowLabel.colorType,fullChartParams:n})).attr("font-size",n.styles.textSize).attr("style",s=>t.arrowLabel.styleFn(s))}),e.select(`text.${OS}`)}function fz({nodeGSelection:e,edgeGSelection:t,highlightIds:n,fullChartParams:r}){if(e.interrupt("highlight"),t.interrupt("highlight"),!n.length){e.transition("highlight").style("opacity",1),t.transition("highlight").style("opacity",1);return}t.style("opacity",r.styles.unhighlightedOpacity),e.each((i,o,a)=>{const s=X(a[o]);n.includes(i.id)?s.style("opacity",1).transition("highlight").ease(lr).duration(500):s.style("opacity",r.styles.unhighlightedOpacity)})}const hz=ts(ZF)(({selection:e,rootSelection:t,name:n,observer:r,subject:i})=>{const o=new Q,a=e.append("g").classed(XF,!0),s=a.append("defs"),l=a.append("g").classed(UF,!0),u=a.append("g").classed(HF,!0);let c,h,f,p,g,m,d,y;const b=new Eu("end"),x=new Q;G({fullParams:r.fullParams$,fullChartParams:r.fullChartParams$}).pipe(C(o),z(async A=>A),L(({fullParams:A,fullChartParams:w})=>tz(s,A,w))).subscribe();const $=r.fullParams$.pipe(C(o),L(A=>{let w=A.zoomable?Sn().on("zoom",P=>{a.attr("transform",`translate(
316
+ }`;const Fe="ForceDirected",XF=H(Fe,"zoom-area"),B2=Oe(Fe,"arrow"),N2=H(Fe,"arrow-marker"),UF=H(Fe,"edge-list-g"),jF=H(Fe,"edge-g"),F2=H(Fe,"edge-arrow-path"),z2=H(Fe,"edge-label-g"),O2=H(Fe,"edge-label"),HF=H(Fe,"node-list-g"),qF=H(Fe,"node-g"),G2=H(Fe,"node-circle"),W2=H(Fe,"node-label-g"),V2=H(Fe,"node-label"),ZF={name:Fe,defaultParams:zi,layerIndex:at,validator:(e,{validateColumns:t})=>{const n=t(e,{dot:{toBeTypes:["object"]},dotLabel:{toBeTypes:["object"]},arrow:{toBeTypes:["object"]},arrowLabel:{toBeTypes:["object"]},force:{toBeTypes:["object"]},zoomable:{toBeTypes:["boolean"]},transform:{toBeTypes:["object"]},scaleExtent:{toBeTypes:["object"]}});if(e.dot){const r=t(e.dot,{radius:{toBeTypes:["number"]},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},styleFn:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.dotLabel){const r=t(e.dotLabel,{colorType:{toBeOption:"ColorType"},sizeFixed:{toBeTypes:["boolean"]},styleFn:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.arrow){const r=t(e.arrow,{colorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},pointerWidth:{toBeTypes:["number"]},pointerHeight:{toBeTypes:["number"]},styleFn:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.arrowLabel){const r=t(e.arrowLabel,{colorType:{toBeOption:"ColorType"},sizeFixed:{toBeTypes:["boolean"]},styleFn:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.force){const r=t(e.force,{nodeStrength:{toBeTypes:["number"]},linkDistance:{toBeTypes:["number"]},velocityDecay:{toBeTypes:["number"]},alphaDecay:{toBeTypes:["number"]}});if(r.status==="error")return r}if(e.transform){const r=t(e.transform,{x:{toBeTypes:["number"]},y:{toBeTypes:["number"]},k:{toBeTypes:["number"]}});if(r.status==="error")return r}if(e.scaleExtent){const r=t(e.scaleExtent,{min:{toBeTypes:["number"]},max:{toBeTypes:["number"]}});if(r.status==="error")return r}return n}};function KF(e,t){return Zs().velocityDecay(t.force.velocityDecay).alphaDecay(t.force.alphaDecay).force("link",Yf().id(n=>n.id).strength(1).distance(n=>t.force.linkDistance)).force("charge",Ks().strength(t.force.nodeStrength)).force("collision",qs(t.dot.radius).strength(1)).force("center",Wf(e.width/2,e.height/2))}function QF(e){return"translate("+e.x+","+e.y+")"}function JF(e){const t=e.source.x+(e.target.x-e.source.x)/2,n=e.source.y+(e.target.y-e.source.y)/2;return"translate("+t+","+n+")"}function ez(e){return"M"+e.source.x+","+e.source.y+" L"+e.target.x+","+e.target.y}function tz(e,t,n){return e.selectAll(`marker.${N2}`).data([t]).join(r=>{const i=r.append("marker").classed(N2,!0).attr("id",B2).attr("fill",o=>pe(t.arrow.colorType,n)).attr("viewBox",o=>`-${o.arrow.pointerWidth} -${o.arrow.pointerHeight/2} ${o.arrow.pointerWidth} ${o.arrow.pointerHeight}`).attr("orient","auto");return i.append("path").attr("d",o=>`M${-o.arrow.pointerWidth},${-o.arrow.pointerHeight/2}L0,0L${-o.arrow.pointerWidth},${o.arrow.pointerHeight/2}`),i},r=>r,r=>r.remove()).attr("markerWidth",r=>r.arrow.pointerWidth).attr("markerHeight",r=>r.arrow.pointerHeight).attr("refX",r=>(r.dot.radius+t.dot.strokeWidth/2)/r.arrow.strokeWidth-1).attr("refY",0)}function nz(e,t){function n(o,a){o.active||e.alphaTarget(.3).restart(),o.subject.fx=o.x,o.subject.fy=o.y,t.next("start")}function r(o,a){o.subject.fx=o.x,o.subject.fy=o.y,t.next("drag")}function i(o,a){o.active||e.alphaTarget(0),o.subject.fx=null,o.subject.fy=null,t.next("end")}return $s().on("start",n).on("drag",r).on("end",i)}function rz({nodeListGSelection:e,nodes:t}){return e.selectAll("g").data(t,n=>n.id).join(n=>n.append("g").classed(qF,!0),n=>n,n=>n.remove())}function iz({nodeGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{X(o[i]).selectAll("circle").data([r]).join(s=>s.append("circle").classed(G2,!0).attr("cursor","pointer"),s=>s,s=>s.remove()).attr("r",t.dot.radius).attr("fill",s=>Se({datum:s,colorType:t.dot.fillColorType,fullChartParams:n})).attr("stroke",s=>Se({datum:s,colorType:t.dot.strokeColorType,fullChartParams:n})).attr("stroke-width",t.dot.strokeWidth).attr("style",s=>t.dot.styleFn(s))}),e.select(`circle.${G2}`)}function oz({nodeGSelection:e,fullParams:t}){return e.each((n,r,i)=>{X(i[r]).selectAll("g").data([n]).join(a=>a.append("g").classed(W2,!0),a=>a,a=>a.remove()).attr("transform",`translate(0, ${-t.dot.radius-10})`)}),e.select(`g.${W2}`)}function az({nodeLabelGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{X(o[i]).selectAll("text").data([r],s=>s.id).join(s=>s.append("text").classed(V2,!0).attr("text-anchor","middle").attr("pointer-events","none"),s=>s,s=>s.remove()).text(s=>s.label).attr("fill",s=>Se({datum:s,colorType:t.dotLabel.colorType,fullChartParams:n})).attr("font-size",n.styles.textSize).attr("style",s=>t.dotLabel.styleFn(s))}),e.select(`text.${V2}`)}function sz({edgeListGSelection:e,edges:t}){return e.selectAll("g").data(t,n=>n.id).join(n=>n.append("g").classed(jF,!0),n=>n,n=>n.remove())}function lz({edgeGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{X(o[i]).selectAll("path").data([r]).join(s=>s.append("path").classed(F2,!0).attr("marker-end",`url(#${B2})`),s=>s,s=>s.remove()).attr("stroke",s=>Se({datum:s.data,colorType:t.arrow.colorType,fullChartParams:n})).attr("stroke-width",t.arrow.strokeWidth).attr("style",s=>t.arrow.styleFn(s))}),e.select(`path.${F2}`)}function uz({edgeGSelection:e}){return e.each((t,n,r)=>{X(r[n]).selectAll("g").data([t]).join(o=>o.append("g").classed(z2,!0),o=>o,o=>o.remove())}),e.select(`g.${z2}`)}function cz({edgeLabelGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{X(o[i]).selectAll("text").data([r],s=>s.id).join(s=>s.append("text").classed(O2,!0).attr("text-anchor","middle").attr("pointer-events","none"),s=>s,s=>s.remove()).text(s=>s.label).attr("fill",s=>Se({datum:s,colorType:t.arrowLabel.colorType,fullChartParams:n})).attr("font-size",n.styles.textSize).attr("style",s=>t.arrowLabel.styleFn(s))}),e.select(`text.${O2}`)}function fz({nodeGSelection:e,edgeGSelection:t,highlightIds:n,fullChartParams:r}){if(e.interrupt("highlight"),t.interrupt("highlight"),!n.length){e.transition("highlight").style("opacity",1),t.transition("highlight").style("opacity",1);return}t.style("opacity",r.styles.unhighlightedOpacity),e.each((i,o,a)=>{const s=X(a[o]);n.includes(i.id)?s.style("opacity",1).transition("highlight").ease(lr).duration(500):s.style("opacity",r.styles.unhighlightedOpacity)})}const hz=ts(ZF)(({selection:e,rootSelection:t,name:n,observer:r,subject:i})=>{const o=new Q,a=e.append("g").classed(XF,!0),s=a.append("defs"),l=a.append("g").classed(UF,!0),u=a.append("g").classed(HF,!0);let c,h,f,p,d,m,g,y;const b=new Eu("end"),x=new Q;O({fullParams:r.fullParams$,fullChartParams:r.fullChartParams$}).pipe(C(o),z(async A=>A),L(({fullParams:A,fullChartParams:w})=>tz(s,A,w))).subscribe();const $=r.fullParams$.pipe(C(o),L(A=>{let w=A.zoomable?Tn().on("zoom",P=>{a.attr("transform",`translate(
317
317
  ${P.transform.x},
318
318
  ${P.transform.y}
319
319
  ) scale(
320
320
  ${P.transform.k}
321
- )`),A.dotLabel.sizeFixed&&p&&p.attr("transform",`scale(${1/P.transform.k})`),A.arrowLabel.sizeFixed&&y&&y.attr("transform",`scale(${1/P.transform.k})`)}):Sn().on("zoom",null);return A.scaleExtent&&w.scaleExtent([A.scaleExtent.min,A.scaleExtent.max]),t.call(w),w}));G({d3Zoom:$,transform:r.fullParams$.pipe(C(o),L(A=>A.transform))}).pipe(C(o),z(async A=>A)).subscribe(A=>{e.call(A.d3Zoom.transform,Ci.translate(A.transform.x,A.transform.y).scale(A.transform.k))});const S=G({layout:r.layout$.pipe(Yi()),fullParams:r.fullParams$}).pipe(C(o),z(async A=>A),L(A=>KF(A.layout,A.fullParams)),ie(1)),_=r.visibleComputedData$.pipe(C(o),L(A=>({nodes:A.nodes,edges:A.edges.map(w=>{let P=w;return P.source=w.startNode,P.target=w.endNode,P})})),ie(1));return G({renderData:_,computedData:r.computedData$,CategoryNodeMap:r.CategoryNodeMap$,simulation:S,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$}).pipe(C(o),z(async A=>A)).subscribe(A=>{c=rz({nodeListGSelection:u,nodes:A.renderData.nodes}),h=iz({nodeGSelection:c,fullParams:A.fullParams,fullChartParams:A.fullChartParams}),c.call(nz(A.simulation,b)),f=oz({nodeGSelection:c,fullParams:A.fullParams}),p=az({nodeLabelGSelection:f,fullParams:A.fullParams,fullChartParams:A.fullChartParams}),g=sz({edgeListGSelection:l,edges:A.renderData.edges}),m=lz({edgeGSelection:g,fullParams:A.fullParams,fullChartParams:A.fullChartParams}),d=uz({edgeGSelection:g}),y=cz({edgeLabelGSelection:d,fullParams:A.fullParams,fullChartParams:A.fullChartParams}),A.simulation.nodes(A.renderData.nodes).on("tick",()=>{m.attr("d",ez),c.attr("transform",QF),d.attr("transform",w=>JF(w))}),A.simulation.force("link").links(A.renderData.edges),A.simulation.alpha(.3).restart(),h.on("mouseover",(w,P)=>{w.stopPropagation(),x.next({type:"relationship",eventName:"mouseover",pluginName:Fe,highlightTarget:A.fullChartParams.highlightTarget,datum:P,category:A.CategoryNodeMap.get(P.categoryLabel),categoryIndex:P.categoryIndex,categoryLabel:P.categoryLabel,event:w,data:A.computedData})}).on("mousemove",(w,P)=>{w.stopPropagation(),x.next({type:"relationship",eventName:"mousemove",pluginName:Fe,highlightTarget:A.fullChartParams.highlightTarget,datum:P,category:A.CategoryNodeMap.get(P.categoryLabel),categoryIndex:P.categoryIndex,categoryLabel:P.categoryLabel,event:w,data:A.computedData})}).on("mouseout",(w,P)=>{w.stopPropagation(),x.next({type:"relationship",eventName:"mouseout",pluginName:Fe,highlightTarget:A.fullChartParams.highlightTarget,datum:P,category:A.CategoryNodeMap.get(P.categoryLabel),categoryIndex:P.categoryIndex,categoryLabel:P.categoryLabel,event:w,data:A.computedData})}).on("click",(w,P)=>{w.stopPropagation(),x.next({type:"relationship",eventName:"click",pluginName:Fe,highlightTarget:A.fullChartParams.highlightTarget,datum:P,category:A.CategoryNodeMap.get(P.categoryLabel),categoryIndex:P.categoryIndex,categoryLabel:P.categoryLabel,event:w,data:A.computedData})})}),b.pipe(Z((A,w)=>A===w),z(A=>wn(()=>A==="end",x,Pa))).subscribe(A=>{i.event$.next(A)}),G({renderData:_,highlightNodes:r.relationshipHighlightNodes$.pipe(L(A=>A.map(w=>w.id))),highlightEdges:r.relationshipHighlightEdges$.pipe(L(A=>A.map(w=>w.id))),fullChartParams:r.fullChartParams$,fullParams:r.fullParams$}).pipe(C(o),z(async A=>A)).subscribe(A=>{!c||!g||fz({nodeGSelection:c,edgeGSelection:g,highlightIds:A.highlightNodes,fullChartParams:A.fullChartParams})}),()=>{o.next(void 0)}}),je="ForceDirectedBubbles",YS=12,pz=H(je,"zoom-area"),gz=Oe(je,"arrow"),XS=H(je,"arrow-marker"),dz=H(je,"edge-list-g"),mz=H(je,"edge-g"),US=H(je,"edge-arrow-path"),jS=H(je,"edge-label-g"),HS=H(je,"edge-label"),yz=H(je,"node-list-g"),bz=H(je,"node-g"),qS=H(je,"node-circle"),xz={name:je,defaultParams:zi,layerIndex:at,validator:(e,{validateColumns:t})=>{const n=t(e,{bubble:{toBeTypes:["object"]},bubbleLabel:{toBeTypes:["object"]},arrow:{toBeTypes:["object"]},arrowLabel:{toBeTypes:["object"]},force:{toBeTypes:["object"]},zoomable:{toBeTypes:["boolean"]},transform:{toBeTypes:["object"]},scaleExtent:{toBeTypes:["object"]}});if(e.bubble){const r=t(e.bubble,{radiusMin:{toBeTypes:["number"]},radiusMax:{toBeTypes:["number"]},arcScaleType:{toBe:'"area" | "radius"',test:i=>i==="area"||i==="radius"},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},styleFn:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.bubbleLabel){const r=t(e.bubbleLabel,{fillRate:{toBeTypes:["number"]},lineHeight:{toBeTypes:["number"]},maxLineLength:{toBeTypes:["number"]},colorType:{toBeOption:"ColorType"},styleFn:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.arrow){const r=t(e.arrow,{colorType:{toBeOption:"ColorType"},strokeWidthMin:{toBeTypes:["number"]},strokeWidthMax:{toBeTypes:["number"]},pointerWidth:{toBeTypes:["number"]},pointerHeight:{toBeTypes:["number"]},styleFn:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.arrowLabel){const r=t(e.arrowLabel,{colorType:{toBeOption:"ColorType"},sizeFixed:{toBeTypes:["boolean"]},styleFn:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.force){const r=t(e.force,{nodeStrength:{toBeTypes:["number"]},linkDistance:{toBeTypes:["number"]},velocityDecay:{toBeTypes:["number"]},alphaDecay:{toBeTypes:["number"]}});if(r.status==="error")return r}if(e.transform){const r=t(e.transform,{x:{toBeTypes:["number"]},y:{toBeTypes:["number"]},k:{toBeTypes:["number"]}});if(r.status==="error")return r}if(e.scaleExtent){const r=t(e.scaleExtent,{min:{toBeTypes:["number"]},max:{toBeTypes:["number"]}});if(r.status==="error")return r}return n}};function $z(e,t){return Zs().velocityDecay(t.force.velocityDecay).alphaDecay(t.force.alphaDecay).force("link",Yf().id(n=>n.id).strength(1).distance(n=>t.force.linkDistance)).force("charge",Ks().strength(t.force.nodeStrength)).force("collision",qs(t.bubble.radiusMax).strength(1)).force("center",Wf(e.width/2,e.height/2))}function vz(e){return"translate("+e.x+","+e.y+")"}function Sz(e){const t=e.source.x+(e.target.x-e.source.x)/2,n=e.source.y+(e.target.y-e.source.y)/2;return"translate("+t+","+n+")"}function Tz(e){return"M"+e.source.x+","+e.source.y+" L"+e.target.x+","+e.target.y}function _z({defsSelection:e,markerParams:t,markerData:n,fullParams:r,fullChartParams:i}){return e.selectAll(`marker.${XS}`).data(n).join(o=>{const a=o.append("marker").classed(XS,!0).attr("viewBox",t.viewBox).attr("orient","auto");return a.append("path").attr("d",t.d),a},o=>o,o=>o.remove()).attr("id",o=>o.id).attr("fill",o=>pe(r.arrow.colorType,i)).attr("markerWidth",t.pointerWidth).attr("markerHeight",t.pointerHeight).attr("refX",o=>o.refX).attr("refY",0)}function Az(e,t){function n(o,a){o.active||e.alphaTarget(.3).restart(),o.subject.fx=o.subject.x,o.subject.fy=o.subject.y,t.next("start")}function r(o,a){o.subject.fx=o.x,o.subject.fy=o.y,t.next("drag")}function i(o,a){o.active||e.alphaTarget(0),o.subject.fx=null,o.subject.fy=null,t.next("end")}return $s().on("start",n).on("drag",r).on("end",i)}function wz({nodeListGSelection:e,nodes:t}){return e.selectAll("g").data(t,n=>n.id).join(n=>n.append("g").classed(bz,!0),n=>n,n=>n.remove())}function Pz({nodeGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{X(o[i]).selectAll("circle").data([r]).join(s=>s.append("circle").classed(qS,!0).attr("cursor","pointer"),s=>s,s=>s.remove()).attr("r",s=>s.r).attr("fill",s=>Se({datum:s,colorType:t.bubble.fillColorType,fullChartParams:n})).attr("stroke",s=>Se({datum:s,colorType:t.bubble.strokeColorType,fullChartParams:n})).attr("stroke-width",t.bubble.strokeWidth).attr("style",s=>t.bubble.styleFn(s))}).attr("text-anchor","middle").attr("font-size",YS).each((r,i,o)=>{const a=X(o[i]);a.call(Nv,{text:r.label,radius:r.r*t.bubbleLabel.fillRate,lineHeight:YS*t.bubbleLabel.lineHeight,isBreakAll:r.label.length<=t.bubbleLabel.maxLineLength?!1:t.bubbleLabel.wordBreakAll}),a.select("text").attr("fill",s=>Se({datum:r,colorType:t.bubbleLabel.colorType,fullChartParams:n}))}),e.select("text").attr("pointer-events","none").attr("style",r=>t.bubbleLabel.styleFn(r)),e.select(`circle.${qS}`)}function Dz({edgeListGSelection:e,edges:t}){return e.selectAll("g").data(t,n=>n.id).join(n=>n.append("g").classed(mz,!0),n=>n,n=>n.remove())}function Cz({edgeGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{X(o[i]).selectAll("path").data([r]).join(s=>s.append("path").classed(US,!0),s=>s,s=>s.remove()).attr("marker-end",s=>`url(#${s.markerId})`).attr("stroke",s=>Se({datum:s.data,colorType:t.arrow.colorType,fullChartParams:n})).attr("stroke-width",s=>s.strokeWidth).attr("style",s=>t.arrow.styleFn(s))}),e.select(`path.${US}`)}function Lz({edgeGSelection:e}){return e.each((t,n,r)=>{X(r[n]).selectAll("g").data([t]).join(o=>o.append("g").classed(jS,!0),o=>o,o=>o.remove())}),e.select(`g.${jS}`)}function Mz({edgeLabelGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{X(o[i]).selectAll("text").data([r],s=>s.id).join(s=>s.append("text").classed(HS,!0).attr("text-anchor","middle").attr("pointer-events","none"),s=>s,s=>s.remove()).text(s=>s.label).attr("fill",s=>Se({datum:s,colorType:t.arrowLabel.colorType,fullChartParams:n})).attr("font-size",n.styles.textSize).attr("style",s=>t.arrowLabel.styleFn(s))}),e.select(`text.${HS}`)}function kz({nodeGSelection:e,edgeGSelection:t,highlightIds:n,fullChartParams:r}){if(e.interrupt("highlight"),t.interrupt("highlight"),!n.length){e.transition("highlight").style("opacity",1),t.transition("highlight").style("opacity",1);return}t.style("opacity",r.styles.unhighlightedOpacity),e.each((i,o,a)=>{const s=X(a[o]);n.includes(i.id)?s.style("opacity",1).transition("highlight").ease(lr).duration(500):s.style("opacity",r.styles.unhighlightedOpacity)})}const Rz=ts(xz)(({selection:e,rootSelection:t,name:n,observer:r,subject:i})=>{const o=new Q,a=e.append("g").classed(pz,!0),s=a.append("defs"),l=a.append("g").classed(dz,!0),u=a.append("g").classed(yz,!0);let c,h,f,p,g,m;const d=new Eu("end"),y=new Q,b=r.fullParams$.pipe(C(o),L(T=>{let M=T.zoomable?Sn().on("zoom",O=>{a.attr("transform",`translate(
322
- ${O.transform.x},
323
- ${O.transform.y}
321
+ )`),A.dotLabel.sizeFixed&&p&&p.attr("transform",`scale(${1/P.transform.k})`),A.arrowLabel.sizeFixed&&y&&y.attr("transform",`scale(${1/P.transform.k})`)}):Tn().on("zoom",null);return A.scaleExtent&&w.scaleExtent([A.scaleExtent.min,A.scaleExtent.max]),t.call(w),w}));O({d3Zoom:$,transform:r.fullParams$.pipe(C(o),L(A=>A.transform))}).pipe(C(o),z(async A=>A)).subscribe(A=>{e.call(A.d3Zoom.transform,Li.translate(A.transform.x,A.transform.y).scale(A.transform.k))});const S=O({layout:r.layout$.pipe(Br()),fullParams:r.fullParams$}).pipe(C(o),z(async A=>A),L(A=>KF(A.layout,A.fullParams)),ne(1)),_=r.visibleComputedData$.pipe(C(o),L(A=>({nodes:A.nodes,edges:A.edges.map(w=>{let P=w;return P.source=w.startNode,P.target=w.endNode,P})})),ne(1));return O({renderData:_,computedData:r.computedData$,CategoryNodeMap:r.CategoryNodeMap$,simulation:S,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$}).pipe(C(o),z(async A=>A)).subscribe(A=>{c=rz({nodeListGSelection:u,nodes:A.renderData.nodes}),h=iz({nodeGSelection:c,fullParams:A.fullParams,fullChartParams:A.fullChartParams}),c.call(nz(A.simulation,b)),f=oz({nodeGSelection:c,fullParams:A.fullParams}),p=az({nodeLabelGSelection:f,fullParams:A.fullParams,fullChartParams:A.fullChartParams}),d=sz({edgeListGSelection:l,edges:A.renderData.edges}),m=lz({edgeGSelection:d,fullParams:A.fullParams,fullChartParams:A.fullChartParams}),g=uz({edgeGSelection:d}),y=cz({edgeLabelGSelection:g,fullParams:A.fullParams,fullChartParams:A.fullChartParams}),A.simulation.nodes(A.renderData.nodes).on("tick",()=>{m.attr("d",ez),c.attr("transform",QF),g.attr("transform",w=>JF(w))}),A.simulation.force("link").links(A.renderData.edges),A.simulation.alpha(.3).restart(),h.on("mouseover",(w,P)=>{w.stopPropagation(),x.next({type:"relationship",eventName:"mouseover",pluginName:Fe,highlightTarget:A.fullChartParams.highlightTarget,datum:P,category:A.CategoryNodeMap.get(P.categoryLabel),categoryIndex:P.categoryIndex,categoryLabel:P.categoryLabel,event:w,data:A.computedData})}).on("mousemove",(w,P)=>{w.stopPropagation(),x.next({type:"relationship",eventName:"mousemove",pluginName:Fe,highlightTarget:A.fullChartParams.highlightTarget,datum:P,category:A.CategoryNodeMap.get(P.categoryLabel),categoryIndex:P.categoryIndex,categoryLabel:P.categoryLabel,event:w,data:A.computedData})}).on("mouseout",(w,P)=>{w.stopPropagation(),x.next({type:"relationship",eventName:"mouseout",pluginName:Fe,highlightTarget:A.fullChartParams.highlightTarget,datum:P,category:A.CategoryNodeMap.get(P.categoryLabel),categoryIndex:P.categoryIndex,categoryLabel:P.categoryLabel,event:w,data:A.computedData})}).on("click",(w,P)=>{w.stopPropagation(),x.next({type:"relationship",eventName:"click",pluginName:Fe,highlightTarget:A.fullChartParams.highlightTarget,datum:P,category:A.CategoryNodeMap.get(P.categoryLabel),categoryIndex:P.categoryIndex,categoryLabel:P.categoryLabel,event:w,data:A.computedData})})}),b.pipe(q((A,w)=>A===w),z(A=>on(()=>A==="end",x,Pa))).subscribe(A=>{i.event$.next(A)}),O({renderData:_,highlightNodes:r.relationshipHighlightNodes$.pipe(L(A=>A.map(w=>w.id))),highlightEdges:r.relationshipHighlightEdges$.pipe(L(A=>A.map(w=>w.id))),fullChartParams:r.fullChartParams$,fullParams:r.fullParams$}).pipe(C(o),z(async A=>A)).subscribe(A=>{!c||!d||fz({nodeGSelection:c,edgeGSelection:d,highlightIds:A.highlightNodes,fullChartParams:A.fullChartParams})}),()=>{o.next(void 0)}}),je="ForceDirectedBubbles",Y2=12,pz=H(je,"zoom-area"),gz=Oe(je,"arrow"),X2=H(je,"arrow-marker"),dz=H(je,"edge-list-g"),mz=H(je,"edge-g"),U2=H(je,"edge-arrow-path"),j2=H(je,"edge-label-g"),H2=H(je,"edge-label"),yz=H(je,"node-list-g"),bz=H(je,"node-g"),q2=H(je,"node-circle"),xz={name:je,defaultParams:Oi,layerIndex:at,validator:(e,{validateColumns:t})=>{const n=t(e,{bubble:{toBeTypes:["object"]},bubbleLabel:{toBeTypes:["object"]},arrow:{toBeTypes:["object"]},arrowLabel:{toBeTypes:["object"]},force:{toBeTypes:["object"]},zoomable:{toBeTypes:["boolean"]},transform:{toBeTypes:["object"]},scaleExtent:{toBeTypes:["object"]}});if(e.bubble){const r=t(e.bubble,{radiusMin:{toBeTypes:["number"]},radiusMax:{toBeTypes:["number"]},arcScaleType:{toBe:'"area" | "radius"',test:i=>i==="area"||i==="radius"},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},styleFn:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.bubbleLabel){const r=t(e.bubbleLabel,{fillRate:{toBeTypes:["number"]},lineHeight:{toBeTypes:["number"]},maxLineLength:{toBeTypes:["number"]},colorType:{toBeOption:"ColorType"},styleFn:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.arrow){const r=t(e.arrow,{colorType:{toBeOption:"ColorType"},strokeWidthMin:{toBeTypes:["number"]},strokeWidthMax:{toBeTypes:["number"]},pointerWidth:{toBeTypes:["number"]},pointerHeight:{toBeTypes:["number"]},styleFn:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.arrowLabel){const r=t(e.arrowLabel,{colorType:{toBeOption:"ColorType"},sizeFixed:{toBeTypes:["boolean"]},styleFn:{toBeTypes:["Function"]}});if(r.status==="error")return r}if(e.force){const r=t(e.force,{nodeStrength:{toBeTypes:["number"]},linkDistance:{toBeTypes:["number"]},velocityDecay:{toBeTypes:["number"]},alphaDecay:{toBeTypes:["number"]}});if(r.status==="error")return r}if(e.transform){const r=t(e.transform,{x:{toBeTypes:["number"]},y:{toBeTypes:["number"]},k:{toBeTypes:["number"]}});if(r.status==="error")return r}if(e.scaleExtent){const r=t(e.scaleExtent,{min:{toBeTypes:["number"]},max:{toBeTypes:["number"]}});if(r.status==="error")return r}return n}};function $z(e,t){return Zs().velocityDecay(t.force.velocityDecay).alphaDecay(t.force.alphaDecay).force("link",Yf().id(n=>n.id).strength(1).distance(n=>t.force.linkDistance)).force("charge",Ks().strength(t.force.nodeStrength)).force("collision",qs(t.bubble.radiusMax).strength(1)).force("center",Wf(e.width/2,e.height/2))}function vz(e){return"translate("+e.x+","+e.y+")"}function Sz(e){const t=e.source.x+(e.target.x-e.source.x)/2,n=e.source.y+(e.target.y-e.source.y)/2;return"translate("+t+","+n+")"}function Tz(e){return"M"+e.source.x+","+e.source.y+" L"+e.target.x+","+e.target.y}function _z({defsSelection:e,markerParams:t,markerData:n,fullParams:r,fullChartParams:i}){return e.selectAll(`marker.${X2}`).data(n).join(o=>{const a=o.append("marker").classed(X2,!0).attr("viewBox",t.viewBox).attr("orient","auto");return a.append("path").attr("d",t.d),a},o=>o,o=>o.remove()).attr("id",o=>o.id).attr("fill",o=>pe(r.arrow.colorType,i)).attr("markerWidth",t.pointerWidth).attr("markerHeight",t.pointerHeight).attr("refX",o=>o.refX).attr("refY",0)}function Az(e,t){function n(o,a){o.active||e.alphaTarget(.3).restart(),o.subject.fx=o.subject.x,o.subject.fy=o.subject.y,t.next("start")}function r(o,a){o.subject.fx=o.x,o.subject.fy=o.y,t.next("drag")}function i(o,a){o.active||e.alphaTarget(0),o.subject.fx=null,o.subject.fy=null,t.next("end")}return $s().on("start",n).on("drag",r).on("end",i)}function wz({nodeListGSelection:e,nodes:t}){return e.selectAll("g").data(t,n=>n.id).join(n=>n.append("g").classed(bz,!0),n=>n,n=>n.remove())}function Pz({nodeGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{X(o[i]).selectAll("circle").data([r]).join(s=>s.append("circle").classed(q2,!0).attr("cursor","pointer"),s=>s,s=>s.remove()).attr("r",s=>s.r).attr("fill",s=>Se({datum:s,colorType:t.bubble.fillColorType,fullChartParams:n})).attr("stroke",s=>Se({datum:s,colorType:t.bubble.strokeColorType,fullChartParams:n})).attr("stroke-width",t.bubble.strokeWidth).attr("style",s=>t.bubble.styleFn(s))}).attr("text-anchor","middle").attr("font-size",Y2).each((r,i,o)=>{const a=X(o[i]);a.call(Nv,{text:r.label,radius:r.r*t.bubbleLabel.fillRate,lineHeight:Y2*t.bubbleLabel.lineHeight,isBreakAll:r.label.length<=t.bubbleLabel.maxLineLength?!1:t.bubbleLabel.wordBreakAll}),a.select("text").attr("fill",s=>Se({datum:r,colorType:t.bubbleLabel.colorType,fullChartParams:n}))}),e.select("text").attr("pointer-events","none").attr("style",r=>t.bubbleLabel.styleFn(r)),e.select(`circle.${q2}`)}function Dz({edgeListGSelection:e,edges:t}){return e.selectAll("g").data(t,n=>n.id).join(n=>n.append("g").classed(mz,!0),n=>n,n=>n.remove())}function Cz({edgeGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{X(o[i]).selectAll("path").data([r]).join(s=>s.append("path").classed(U2,!0),s=>s,s=>s.remove()).attr("marker-end",s=>`url(#${s.markerId})`).attr("stroke",s=>Se({datum:s.data,colorType:t.arrow.colorType,fullChartParams:n})).attr("stroke-width",s=>s.strokeWidth).attr("style",s=>t.arrow.styleFn(s))}),e.select(`path.${U2}`)}function Lz({edgeGSelection:e}){return e.each((t,n,r)=>{X(r[n]).selectAll("g").data([t]).join(o=>o.append("g").classed(j2,!0),o=>o,o=>o.remove())}),e.select(`g.${j2}`)}function Mz({edgeLabelGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{X(o[i]).selectAll("text").data([r],s=>s.id).join(s=>s.append("text").classed(H2,!0).attr("text-anchor","middle").attr("pointer-events","none"),s=>s,s=>s.remove()).text(s=>s.label).attr("fill",s=>Se({datum:s,colorType:t.arrowLabel.colorType,fullChartParams:n})).attr("font-size",n.styles.textSize).attr("style",s=>t.arrowLabel.styleFn(s))}),e.select(`text.${H2}`)}function kz({nodeGSelection:e,edgeGSelection:t,highlightIds:n,fullChartParams:r}){if(e.interrupt("highlight"),t.interrupt("highlight"),!n.length){e.transition("highlight").style("opacity",1),t.transition("highlight").style("opacity",1);return}t.style("opacity",r.styles.unhighlightedOpacity),e.each((i,o,a)=>{const s=X(a[o]);n.includes(i.id)?s.style("opacity",1).transition("highlight").ease(lr).duration(500):s.style("opacity",r.styles.unhighlightedOpacity)})}const Rz=ts(xz)(({selection:e,rootSelection:t,name:n,observer:r,subject:i})=>{const o=new Q,a=e.append("g").classed(pz,!0),s=a.append("defs"),l=a.append("g").classed(dz,!0),u=a.append("g").classed(yz,!0);let c,h,f,p,d,m;const g=new Eu("end"),y=new Q,b=r.fullParams$.pipe(C(o),L(T=>{let M=T.zoomable?Tn().on("zoom",G=>{a.attr("transform",`translate(
322
+ ${G.transform.x},
323
+ ${G.transform.y}
324
324
  ) scale(
325
- ${O.transform.k}
326
- )`),T.arrowLabel.sizeFixed&&m&&m.attr("transform",`scale(${1/O.transform.k})`)}):Sn().on("zoom",null);return T.scaleExtent&&M.scaleExtent([T.scaleExtent.min,T.scaleExtent.max]),t.call(M),M}));G({d3Zoom:b,transform:r.fullParams$.pipe(C(o),L(T=>T.transform))}).pipe(C(o),z(async T=>T)).subscribe(T=>{e.call(T.d3Zoom.transform,Ci.translate(T.transform.x,T.transform.y).scale(T.transform.k))});const x=G({layout:r.layout$.pipe(Yi()),fullParams:r.fullParams$}).pipe(C(o),z(async T=>T),L(T=>$z(T.layout,T.fullParams)),ie(1)),$=r.computedData$.pipe(C(o),L(T=>{const M=T.nodes.filter(k=>k.value!=null);if(!M.length)return[0,2];const O=fc(T.nodes.map(k=>k.value));return M.length==1||O[0]===O[1]?[O[0]-1,O[1]+1]:O}),ie(1)),S=r.computedData$.pipe(C(o),L(T=>{const M=T.edges.filter(k=>k.value!=null);if(!M.length)return[0,2];const O=fc(T.edges.map(k=>k.value));return M.length==1||O[0]===O[1]?[O[0]-1,O[1]+1]:O}),ie(1)),_=$.pipe(C(o),L(T=>(T[1]-T[0])/2)),A=S.pipe(C(o),L(T=>(T[1]-T[0])/2)),w=G({nodeMinMaxValue:$,fullParams:r.fullParams$}).pipe(C(o),z(async T=>T),L(T=>mn().domain(T.nodeMinMaxValue).range([T.fullParams.bubble.radiusMin,T.fullParams.bubble.radiusMax]).exponent(T.fullParams.bubble.arcScaleType==="area"?.5:1))),P=G({edgeMinMaxValue:S,fullParams:r.fullParams$}).pipe(C(o),z(async T=>T),L(T=>Nn().domain(T.edgeMinMaxValue).range([T.fullParams.arrow.strokeWidthMin,T.fullParams.arrow.strokeWidthMax]))),I=G({computedData:r.computedData$,radiusScale:w,defaultNodeValue:_}).pipe(C(o),z(async T=>T),L(T=>new Map(T.computedData.nodes.map(M=>{let O=M;return O.r=T.radiusScale(O.value??T.defaultNodeValue),[O.id,O]})))),v=G({computedData:r.computedData$,strokeWidthScale:P,defaultEdgeValue:A}).pipe(C(o),z(async T=>T),L(T=>new Map(T.computedData.edges.map(M=>{let O=M;return O.source=M.startNode,O.target=M.endNode,O.strokeWidth=T.strokeWidthScale(O.value??T.defaultEdgeValue),O.markerId=`${gz}__${O.id}`,[O.id,O]})))),N=G({visibleComputedData:r.visibleComputedData$,RenderNodeMap:I,RenderEdgeMap:v}).pipe(C(o),z(async T=>T),L(T=>({nodes:T.visibleComputedData.nodes.map(M=>T.RenderNodeMap.get(M.id)),edges:T.visibleComputedData.edges.map(M=>T.RenderEdgeMap.get(M.id))})),ie(1)),R=r.fullParams$.pipe(C(o),L(T=>({viewBox:`-${T.arrow.pointerWidth} -${T.arrow.pointerHeight/2} ${T.arrow.pointerWidth} ${T.arrow.pointerHeight}`,d:`M${-T.arrow.pointerWidth},${-T.arrow.pointerHeight/2}L0,0L${-T.arrow.pointerWidth},${T.arrow.pointerHeight/2}`,pointerWidth:T.arrow.pointerWidth,pointerHeight:T.arrow.pointerHeight}))),D=G({computedData:r.computedData$,fullParams:r.fullParams$,RenderNodeMap:I,RenderEdgeMap:v}).pipe(C(o),z(async T=>T),L(T=>T.computedData.edges.map(M=>{const O=T.RenderEdgeMap.get(M.id),k=T.RenderNodeMap.get(M.endNode.id);return{id:O.markerId,edgeId:M.id,strokeWidth:O.strokeWidth,refX:(k.r+T.fullParams.bubble.strokeWidth/2)/O.strokeWidth-1}})));return G({defsSelection:s,markerParams:R,markerData:D,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$}).pipe(C(o),z(async T=>T),L(T=>_z({defsSelection:s,markerParams:T.markerParams,markerData:T.markerData,fullParams:T.fullParams,fullChartParams:T.fullChartParams}))).subscribe(),G({renderData:N,computedData:r.computedData$,CategoryNodeMap:r.CategoryNodeMap$,simulation:x,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$}).pipe(C(o),z(async T=>T)).subscribe(T=>{c=wz({nodeListGSelection:u,nodes:T.renderData.nodes}),h=Pz({nodeGSelection:c,fullParams:T.fullParams,fullChartParams:T.fullChartParams}),c.call(Az(T.simulation,d)),f=Dz({edgeListGSelection:l,edges:T.renderData.edges}),p=Cz({edgeGSelection:f,fullParams:T.fullParams,fullChartParams:T.fullChartParams}),g=Lz({edgeGSelection:f}),m=Mz({edgeLabelGSelection:g,fullParams:T.fullParams,fullChartParams:T.fullChartParams}),T.simulation.nodes(T.renderData.nodes).on("tick",()=>{p.attr("d",Tz),c.attr("transform",vz),g.attr("transform",M=>Sz(M))}),T.simulation.force("link").links(T.renderData.edges),T.simulation.alpha(.3).restart(),h.on("mouseover",(M,O)=>{M.stopPropagation(),y.next({type:"relationship",eventName:"mouseover",pluginName:je,highlightTarget:T.fullChartParams.highlightTarget,datum:O,category:T.CategoryNodeMap.get(O.categoryLabel),categoryIndex:O.categoryIndex,categoryLabel:O.categoryLabel,event:M,data:T.computedData})}).on("mousemove",(M,O)=>{M.stopPropagation(),y.next({type:"relationship",eventName:"mousemove",pluginName:je,highlightTarget:T.fullChartParams.highlightTarget,datum:O,category:T.CategoryNodeMap.get(O.categoryLabel),categoryIndex:O.categoryIndex,categoryLabel:O.categoryLabel,event:M,data:T.computedData})}).on("mouseout",(M,O)=>{M.stopPropagation(),y.next({type:"relationship",eventName:"mouseout",pluginName:je,highlightTarget:T.fullChartParams.highlightTarget,datum:O,category:T.CategoryNodeMap.get(O.categoryLabel),categoryIndex:O.categoryIndex,categoryLabel:O.categoryLabel,event:M,data:T.computedData})}).on("click",(M,O)=>{M.stopPropagation(),y.next({type:"relationship",eventName:"click",pluginName:je,highlightTarget:T.fullChartParams.highlightTarget,datum:O,category:T.CategoryNodeMap.get(O.categoryLabel),categoryIndex:O.categoryIndex,categoryLabel:O.categoryLabel,event:M,data:T.computedData})})}),d.pipe(Z((T,M)=>T===M),z(T=>wn(()=>T==="end",y,Pa))).subscribe(T=>{i.event$.next(T)}),G({renderData:N,highlightNodes:r.relationshipHighlightNodes$.pipe(L(T=>T.map(M=>M.id))),highlightEdges:r.relationshipHighlightEdges$.pipe(L(T=>T.map(M=>M.id))),fullChartParams:r.fullChartParams$,fullParams:r.fullParams$}).pipe(C(o),z(async T=>T)).subscribe(T=>{!c||!f||kz({nodeGSelection:c,edgeGSelection:f,highlightIds:T.highlightNodes,fullChartParams:T.fullChartParams})}),()=>{o.next(void 0)}}),ZS="RelationshipLegend",Iz=ts({name:ZS,defaultParams:ES,layerIndex:Mi,validator:(e,{validateColumns:t})=>t(e,{placement:{toBe:'"top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end"',test:r=>["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].includes(r)},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:e,rootSelection:t,observer:n,subject:r})=>{const i=new Q,o=n.fullParams$.pipe(C(i),L(s=>{const l=[{listRectWidth:s.listRectWidth,listRectHeight:s.listRectHeight,listRectRadius:s.listRectRadius}];return{...s,labelList:l}})),a=Ri(ZS,{rootSelection:t,legendLabels$:n.categoryLabels$,fullParams$:o,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),a()}}),KS="RelationshipTooltip",Ez=ts({name:KS,defaultParams:fg,layerIndex:ki,validator:(e,{validateColumns:t})=>t(e,{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"},renderFn:{toBeTypes:["Function"]}})})(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q,a=Ei(KS,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),QS={force:{strength:.08,velocityDecay:.3,collisionSpacing:2},bubbleLabel:{colorType:"labelContrast",fillRate:.6,lineHeight:1,maxLineLength:6,wordBreakAll:!0},arcScaleType:"area"},JS={outerRadius:.85,innerRadius:0,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,padAngle:0,strokeColorType:"background",strokeWidth:1,cornerRadius:0},hg={renderFn:e=>e.eventName==="mouseover"||e.eventName==="mousemove"?[String(e.datum.value)]:[String(Math.round(e.data.reduce((t,n)=>t+n.reduce((r,i)=>r+(i.value??0),0),0)*(e.tween??1)))],textAttrs:[{transform:"translate(0, 0)"}],textStyles:[{"font-weight":"bold","text-anchor":"middle","pointer-events":"none","dominant-baseline":"middle","font-size":64,fill:"#000"}]};hg.renderFn.toString=()=>`(eventData) => {
325
+ ${G.transform.k}
326
+ )`),T.arrowLabel.sizeFixed&&m&&m.attr("transform",`scale(${1/G.transform.k})`)}):Tn().on("zoom",null);return T.scaleExtent&&M.scaleExtent([T.scaleExtent.min,T.scaleExtent.max]),t.call(M),M}));O({d3Zoom:b,transform:r.fullParams$.pipe(C(o),L(T=>T.transform))}).pipe(C(o),z(async T=>T)).subscribe(T=>{e.call(T.d3Zoom.transform,Li.translate(T.transform.x,T.transform.y).scale(T.transform.k))});const x=O({layout:r.layout$.pipe(Br()),fullParams:r.fullParams$}).pipe(C(o),z(async T=>T),L(T=>$z(T.layout,T.fullParams)),ne(1)),$=r.computedData$.pipe(C(o),L(T=>{const M=T.nodes.filter(k=>k.value!=null);if(!M.length)return[0,2];const G=fc(T.nodes.map(k=>k.value));return M.length==1||G[0]===G[1]?[G[0]-1,G[1]+1]:G}),ne(1)),S=r.computedData$.pipe(C(o),L(T=>{const M=T.edges.filter(k=>k.value!=null);if(!M.length)return[0,2];const G=fc(T.edges.map(k=>k.value));return M.length==1||G[0]===G[1]?[G[0]-1,G[1]+1]:G}),ne(1)),_=$.pipe(C(o),L(T=>(T[1]-T[0])/2)),A=S.pipe(C(o),L(T=>(T[1]-T[0])/2)),w=O({nodeMinMaxValue:$,fullParams:r.fullParams$}).pipe(C(o),z(async T=>T),L(T=>yn().domain(T.nodeMinMaxValue).range([T.fullParams.bubble.radiusMin,T.fullParams.bubble.radiusMax]).exponent(T.fullParams.bubble.arcScaleType==="area"?.5:1))),P=O({edgeMinMaxValue:S,fullParams:r.fullParams$}).pipe(C(o),z(async T=>T),L(T=>Nn().domain(T.edgeMinMaxValue).range([T.fullParams.arrow.strokeWidthMin,T.fullParams.arrow.strokeWidthMax]))),I=O({computedData:r.computedData$,radiusScale:w,defaultNodeValue:_}).pipe(C(o),z(async T=>T),L(T=>new Map(T.computedData.nodes.map(M=>{let G=M;return G.r=T.radiusScale(G.value??T.defaultNodeValue),[G.id,G]})))),v=O({computedData:r.computedData$,strokeWidthScale:P,defaultEdgeValue:A}).pipe(C(o),z(async T=>T),L(T=>new Map(T.computedData.edges.map(M=>{let G=M;return G.source=M.startNode,G.target=M.endNode,G.strokeWidth=T.strokeWidthScale(G.value??T.defaultEdgeValue),G.markerId=`${gz}__${G.id}`,[G.id,G]})))),N=O({visibleComputedData:r.visibleComputedData$,RenderNodeMap:I,RenderEdgeMap:v}).pipe(C(o),z(async T=>T),L(T=>({nodes:T.visibleComputedData.nodes.map(M=>T.RenderNodeMap.get(M.id)),edges:T.visibleComputedData.edges.map(M=>T.RenderEdgeMap.get(M.id))})),ne(1)),R=r.fullParams$.pipe(C(o),L(T=>({viewBox:`-${T.arrow.pointerWidth} -${T.arrow.pointerHeight/2} ${T.arrow.pointerWidth} ${T.arrow.pointerHeight}`,d:`M${-T.arrow.pointerWidth},${-T.arrow.pointerHeight/2}L0,0L${-T.arrow.pointerWidth},${T.arrow.pointerHeight/2}`,pointerWidth:T.arrow.pointerWidth,pointerHeight:T.arrow.pointerHeight}))),D=O({computedData:r.computedData$,fullParams:r.fullParams$,RenderNodeMap:I,RenderEdgeMap:v}).pipe(C(o),z(async T=>T),L(T=>T.computedData.edges.map(M=>{const G=T.RenderEdgeMap.get(M.id),k=T.RenderNodeMap.get(M.endNode.id);return{id:G.markerId,edgeId:M.id,strokeWidth:G.strokeWidth,refX:(k.r+T.fullParams.bubble.strokeWidth/2)/G.strokeWidth-1}})));return O({defsSelection:s,markerParams:R,markerData:D,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$}).pipe(C(o),z(async T=>T),L(T=>_z({defsSelection:s,markerParams:T.markerParams,markerData:T.markerData,fullParams:T.fullParams,fullChartParams:T.fullChartParams}))).subscribe(),O({renderData:N,computedData:r.computedData$,CategoryNodeMap:r.CategoryNodeMap$,simulation:x,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$}).pipe(C(o),z(async T=>T)).subscribe(T=>{c=wz({nodeListGSelection:u,nodes:T.renderData.nodes}),h=Pz({nodeGSelection:c,fullParams:T.fullParams,fullChartParams:T.fullChartParams}),c.call(Az(T.simulation,g)),f=Dz({edgeListGSelection:l,edges:T.renderData.edges}),p=Cz({edgeGSelection:f,fullParams:T.fullParams,fullChartParams:T.fullChartParams}),d=Lz({edgeGSelection:f}),m=Mz({edgeLabelGSelection:d,fullParams:T.fullParams,fullChartParams:T.fullChartParams}),T.simulation.nodes(T.renderData.nodes).on("tick",()=>{p.attr("d",Tz),c.attr("transform",vz),d.attr("transform",M=>Sz(M))}),T.simulation.force("link").links(T.renderData.edges),T.simulation.alpha(.3).restart(),h.on("mouseover",(M,G)=>{M.stopPropagation(),y.next({type:"relationship",eventName:"mouseover",pluginName:je,highlightTarget:T.fullChartParams.highlightTarget,datum:G,category:T.CategoryNodeMap.get(G.categoryLabel),categoryIndex:G.categoryIndex,categoryLabel:G.categoryLabel,event:M,data:T.computedData})}).on("mousemove",(M,G)=>{M.stopPropagation(),y.next({type:"relationship",eventName:"mousemove",pluginName:je,highlightTarget:T.fullChartParams.highlightTarget,datum:G,category:T.CategoryNodeMap.get(G.categoryLabel),categoryIndex:G.categoryIndex,categoryLabel:G.categoryLabel,event:M,data:T.computedData})}).on("mouseout",(M,G)=>{M.stopPropagation(),y.next({type:"relationship",eventName:"mouseout",pluginName:je,highlightTarget:T.fullChartParams.highlightTarget,datum:G,category:T.CategoryNodeMap.get(G.categoryLabel),categoryIndex:G.categoryIndex,categoryLabel:G.categoryLabel,event:M,data:T.computedData})}).on("click",(M,G)=>{M.stopPropagation(),y.next({type:"relationship",eventName:"click",pluginName:je,highlightTarget:T.fullChartParams.highlightTarget,datum:G,category:T.CategoryNodeMap.get(G.categoryLabel),categoryIndex:G.categoryIndex,categoryLabel:G.categoryLabel,event:M,data:T.computedData})})}),g.pipe(q((T,M)=>T===M),z(T=>on(()=>T==="end",y,Pa))).subscribe(T=>{i.event$.next(T)}),O({renderData:N,highlightNodes:r.relationshipHighlightNodes$.pipe(L(T=>T.map(M=>M.id))),highlightEdges:r.relationshipHighlightEdges$.pipe(L(T=>T.map(M=>M.id))),fullChartParams:r.fullChartParams$,fullParams:r.fullParams$}).pipe(C(o),z(async T=>T)).subscribe(T=>{!c||!f||kz({nodeGSelection:c,edgeGSelection:f,highlightIds:T.highlightNodes,fullChartParams:T.fullChartParams})}),()=>{o.next(void 0)}}),Z2="RelationshipLegend",Iz=ts({name:Z2,defaultParams:E2,layerIndex:ki,validator:(e,{validateColumns:t})=>t(e,{placement:{toBe:'"top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end"',test:r=>["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].includes(r)},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:e,rootSelection:t,observer:n,subject:r})=>{const i=new Q,o=n.fullParams$.pipe(C(i),L(s=>{const l=[{listRectWidth:s.listRectWidth,listRectHeight:s.listRectHeight,listRectRadius:s.listRectRadius}];return{...s,labelList:l}})),a=Ii(Z2,{rootSelection:t,legendLabels$:n.categoryLabels$,fullParams$:o,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),a()}}),K2="RelationshipTooltip",Ez=ts({name:K2,defaultParams:fg,layerIndex:Ri,validator:(e,{validateColumns:t})=>t(e,{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"},renderFn:{toBeTypes:["Function"]}})})(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q,a=Bi(K2,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),Q2={force:{strength:.08,velocityDecay:.3,collisionSpacing:2},bubbleLabel:{labelFn:e=>String(e.label),colorType:"labelContrast",fillRate:.6,lineHeight:1,maxLineLength:6,wordBreakAll:!0},arcScaleType:"area"},J2={outerRadius:.85,innerRadius:0,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,padAngle:0,strokeColorType:"background",strokeWidth:1,cornerRadius:0},hg={renderFn:e=>e.eventName==="mouseover"||e.eventName==="mousemove"?[String(e.datum.value)]:[String(Math.round(e.data.reduce((t,n)=>t+n.reduce((r,i)=>r+(i.value??0),0),0)*(e.tween??1)))],textAttrs:[{transform:"translate(0, 0)"}],textStyles:[{"font-weight":"bold","text-anchor":"middle","pointer-events":"none","dominant-baseline":"middle","font-size":64,fill:"#000"}]};hg.renderFn.toString=()=>`(eventData) => {
327
327
  if (eventData.eventName === 'mouseover' || eventData.eventName === 'mousemove') {
328
328
  return [String(eventData.datum.value)]
329
329
  }
@@ -338,11 +338,11 @@ ${h}`}};Zp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
338
338
  )
339
339
  )
340
340
  ]
341
- }`;const pg={outerRadius:.85,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,labelCentroid:2.1,labelColorType:"primary",labelFn:e=>String(e.label)};pg.labelFn.toString=()=>"d => String(d.label)";const e2={outerRadius:.95,padAngle:0,strokeColorType:"background",strokeWidth:.5,cornerRadius:0,arcScaleType:"area",angleIncreaseWhileHighlight:.05},gg={outerRadius:.95,labelCentroid:2.1,labelFn:e=>String(e.label),labelColorType:"primary",arcScaleType:"area"};gg.labelFn.toString=()=>"d => String(d.label)";const t2={placement:"right-end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},dg={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(e,{styles:t,utils:n})=>{const r=e.seriesLabel.slice(0,7)!=="series_",i=e.datum.label.slice(0,7)!=="series_",o=n.toCurrency(e.datum.value),a=t.textSizePx*.7,s=t.textSizePx/2-a/2,l=r?`<rect width="${a}" height="${a}" x="${s}" y="${s-1}" rx="${a/2}" fill="${e.datum.color}"></rect>
341
+ }`;const pg={outerRadius:.85,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,labelCentroid:2.1,labelColorType:"primary",labelFn:e=>String(e.label)};pg.labelFn.toString=()=>"d => String(d.label)";const eS={outerRadius:.95,padAngle:0,strokeColorType:"background",strokeWidth:.5,cornerRadius:0,arcScaleType:"area",angleIncreaseWhileHighlight:.05},gg={outerRadius:.95,labelCentroid:2.1,labelFn:e=>String(e.label),labelColorType:"primary",arcScaleType:"area"};gg.labelFn.toString=()=>"d => String(d.label)";const tS={placement:"right-end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},dg={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(e,{styles:t,utils:n})=>{const r=e.seriesLabel.slice(0,7)!=="series_",i=e.datum.label.slice(0,7)!=="series_",o=n.toCurrency(e.datum.value),a=t.textSizePx*.7,s=t.textSizePx/2-a/2,l=r?`<rect width="${a}" height="${a}" x="${s}" y="${s-1}" rx="${a/2}" fill="${e.datum.color}"></rect>
342
342
  <text x="${t.textSizePx*1.5}" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
343
343
  <tspan>${e.seriesLabel}</tspan>
344
- </text>`:"",u=i?`<tspan>${e.datum.label}</tspan> `:"",c=r?n.measureTextWidth(`${e.seriesLabel}${o}`,t.textSizePx)+t.textSizePx*1.5:0,h=i?n.measureTextWidth(`${e.datum.label}${o}`,t.textSizePx):0,f=Math.max(c,h),p=i?f+t.textSizePx*1.5:0,g=i?"end":"start",m=`<text font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
345
- ${u}<tspan font-weight="bold" text-anchor="${g}" x="${p}">${o}</tspan>
344
+ </text>`:"",u=i?`<tspan>${e.datum.label}</tspan> `:"",c=r?n.measureTextWidth(`${e.seriesLabel}${o}`,t.textSizePx)+t.textSizePx*1.5:0,h=i?n.measureTextWidth(`${e.datum.label}${o}`,t.textSizePx):0,f=Math.max(c,h),p=i?f+t.textSizePx*1.5:0,d=i?"end":"start",m=`<text font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
345
+ ${u}<tspan font-weight="bold" text-anchor="${d}" x="${p}">${o}</tspan>
346
346
  </text>`;return`${l}
347
347
  <g ${r?`transform="translate(0, ${t.textSizePx*2})"`:""}>
348
348
  ${m}
@@ -380,13 +380,13 @@ ${h}`}};Zp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
380
380
  <g \${hasSeriesLabel ? \`transform="translate(0, \${styles.textSizePx * 2})"\` : ''}>
381
381
  \${datumSvg}
382
382
  </g>\`
383
- }`;const Bz="Bubbles",n2=12,Nz={name:Bz,defaultParams:QS,layerIndex:at,validator:(e,{validateColumns:t})=>{const n=t(e,{force:{toBeTypes:["object"]},bubbleLabel:{toBeTypes:["object"]},arcScaleType:{toBe:'"area" | "radius"',test:r=>r==="area"||r==="radius"}});if(e.force){const r=t(e.force,{velocityDecay:{toBeTypes:["number"]},collisionSpacing:{toBeTypes:["number"]},strength:{toBeTypes:["number"]}});if(r.status==="error")return r}if(e.bubbleLabel){const r=t(e.bubbleLabel,{colorType:{toBeOption:"ColorType"},fillRate:{toBeTypes:["number"]},lineHeight:{toBeTypes:["number"]},maxLineLength:{toBeTypes:["number"]}});if(r.status==="error")return r}return n}};function Fz(e,t){return Zs().velocityDecay(t.force.velocityDecay).force("collision",qs().radius(n=>n.r+t.force.collisionSpacing)).force("charge",Ks().strength(n=>-Math.pow(n.r,2)*t.force.strength)).on("tick",()=>{e.attr("transform",n=>`translate(${n.x},${n.y})`)})}function zz({visibleComputedSortedData:e,LastBubbleDataMap:t,graphicWidth:n,graphicHeight:r,SeriesContainerPositionMap:i,scaleType:o}){const a=Math.min(n,r)/2,s=e.flat(),l=s.reduce((f,p)=>f+p.value,0),u=mn().domain([0,l]).range([0,a]).exponent(o==="area"?.5:1),c=o==="area"?1:(()=>{const f=a*a*Math.PI;return Math.sqrt(f/Ec(s,p=>Math.PI*Math.pow(u(p.value),2)))})(),h=.9;return s.map(f=>{const p=f,g=t.get(p.id);if(g)p.x=g.x,p.y=g.y;else{const d=i.get(p.seriesLabel);p.x=Math.random()*d.width,p.y=Math.random()*d.height}const m=u(p.value??0)*c*h;return p.r=m,p._originR=m,p})}function Oz({selection:e,bubblesData:t,fullParams:n,fullChartParams:r,sumSeries:i}){const o=e.selectAll("g").data(t,s=>s.id).join(s=>{const l=s.append("g").attr("cursor","pointer").attr("font-size",n2).style("fill","#ffffff").attr("text-anchor","middle");return l.append("circle").attr("class","node").attr("cx",0).attr("cy",0).attr("fill",u=>u.color),l.append("text").style("opacity",.8).attr("pointer-events","none"),l},s=>s,s=>s.remove()).attr("transform",s=>`translate(${s.x},${s.y})`),a=i?"seriesLabel":"label";return o.select("circle").transition().duration(200).attr("r",s=>s.r).attr("fill",s=>s.color),o.each((s,l,u)=>{const c=X(u[l]),h=s[a]??"";c.call(Nv,{text:h,radius:s.r*n.bubbleLabel.fillRate,lineHeight:n2*n.bubbleLabel.lineHeight,isBreakAll:h.length<=n.bubbleLabel.maxLineLength?!1:n.bubbleLabel.wordBreakAll}),c.select("text").attr("fill",f=>Se({datum:s,colorType:n.bubbleLabel.colorType,fullChartParams:r}))}),o}function Gz(e){return $s().on("start",(t,n)=>{t.active||e.alpha(1).restart(),n.fx=n.x,n.fy=n.y}).on("drag",(t,n)=>{t.active||e.alphaTarget(0),n.fx=t.x,n.fy=t.y}).on("end",(t,n)=>{n.fx=null,n.fy=null,e.alpha(1).restart()})}function Wz({_simulation:e,fullParams:t,SeriesContainerPositionMap:n}){e.force("x",jy().strength(t.force.strength).x(r=>n.get(r.seriesLabel).centerX)).force("y",Hy().strength(t.force.strength).y(r=>n.get(r.seriesLabel).centerY))}function Vz({bubblesSelection:e,highlightIds:t,fullChartParams:n}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").style("opacity",1);return}e.each((r,i,o)=>{const a=X(o[i]);t.includes(r.id)?a.style("opacity",1).transition("highlight").ease(lr).duration(500):a.style("opacity",n.styles.unhighlightedOpacity)})}const Yz=Dn(Nz)(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q;let o,a=new Map;const s=n.fullDataFormatter$.pipe(L(f=>f.sumSeries),Z()),l=n.fullParams$.pipe(C(i),L(f=>f.arcScaleType),Z()),u=G({layout:n.layout$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,visibleComputedSortedData:n.visibleComputedSortedData$,scaleType:l}).pipe(C(i),z(async f=>f),L(f=>zz({visibleComputedSortedData:f.visibleComputedSortedData,LastBubbleDataMap:a,graphicWidth:f.layout.width,graphicHeight:f.layout.height,SeriesContainerPositionMap:f.SeriesContainerPositionMap,scaleType:f.scaleType})),ie(1));u.subscribe(f=>{a=new Map(f.map(p=>[p.id,p]))});const c=n.fullChartParams$.pipe(C(i),L(f=>f.highlightTarget),Z()),h=G({bubblesData:u,fullParams:n.fullParams$,fullChartParams:n.fullChartParams$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,sumSeries:s}).pipe(C(i),z(async f=>f),L(f=>{o&&o.stop();const p=Oz({selection:e,bubblesData:f.bubblesData,fullParams:f.fullParams,fullChartParams:f.fullChartParams,sumSeries:f.sumSeries});return o=Fz(p,f.fullParams),o.nodes(f.bubblesData),Wz({_simulation:o,fullParams:f.fullParams,SeriesContainerPositionMap:f.SeriesContainerPositionMap}),o.alpha(1).restart(),p}),ie(1));return G({bubblesSelection:h,computedData:n.computedData$,SeriesDataMap:n.SeriesDataMap$,highlightTarget:c}).pipe(C(i),z(async f=>f)).subscribe(f=>{f.bubblesSelection.on("mouseover",(p,g)=>{r.event$.next({type:"series",eventName:"mouseover",pluginName:t,highlightTarget:f.highlightTarget,datum:g,series:f.SeriesDataMap.get(g.seriesLabel),seriesIndex:g.seriesIndex,seriesLabel:g.seriesLabel,event:p,data:f.computedData})}).on("mousemove",(p,g)=>{r.event$.next({type:"series",eventName:"mousemove",pluginName:t,highlightTarget:f.highlightTarget,datum:g,series:f.SeriesDataMap.get(g.seriesLabel),seriesIndex:g.seriesIndex,seriesLabel:g.seriesLabel,event:p,data:f.computedData})}).on("mouseout",(p,g)=>{r.event$.next({type:"series",eventName:"mouseout",pluginName:t,highlightTarget:f.highlightTarget,datum:g,series:f.SeriesDataMap.get(g.seriesLabel),seriesIndex:g.seriesIndex,seriesLabel:g.seriesLabel,event:p,data:f.computedData})}).on("click",(p,g)=>{r.event$.next({type:"series",eventName:"click",pluginName:t,highlightTarget:f.highlightTarget,datum:g,series:f.SeriesDataMap.get(g.seriesLabel),seriesIndex:g.seriesIndex,seriesLabel:g.seriesLabel,event:p,data:f.computedData})}).call(Gz(o))}),G({bubblesSelection:h,highlight:n.seriesHighlight$.pipe(L(f=>f.map(p=>p.id))),fullChartParams:n.fullChartParams$}).pipe(C(i),z(async f=>f)).subscribe(f=>{Vz({bubblesSelection:f.bubblesSelection,highlightIds:f.highlight,fullChartParams:f.fullChartParams})}),()=>{i.next(void 0),o&&(o.stop(),o=void 0)}});function r2({data:e,startAngle:t,endAngle:n}){return D$().startAngle(t).endAngle(n).value(o=>o.value).sort((o,a)=>o.seq-a.seq)(e).map((o,a)=>{let s=o;return s.id=o.data.id,s})}function Xz({selection:e,pluginName:t,separateSeries$:n,seriesLabels$:r}){const i=H(t,"series");return G({seriesLabels:r,separateSeries:n}).pipe(z(async o=>o),L((o,a)=>{const s=o.separateSeries?o.seriesLabels:[o.seriesLabels.join("")];return e.selectAll(`g.${i}`).data(s,l=>l).join(l=>l.append("g").classed(i,!0),l=>l,l=>l.remove())}),ie(1))}const $a=({selection:e,pluginName:t,separateSeries$:n,seriesLabels$:r,seriesContainerPosition$:i})=>{const o=Xz({selection:e,pluginName:t,separateSeries$:n,seriesLabels$:r});return G({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(z(async a=>a),Z((a,s)=>a.seriesContainerPosition.length===s.seriesContainerPosition.length)).subscribe(a=>{a.seriesCenterSelection.attr("transform",(s,l)=>{const u=a.seriesContainerPosition[l]??a.seriesContainerPosition[0];return`translate(${u.centerX}, ${u.centerY})`})}),G({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(z(async a=>a)).subscribe(a=>{a.seriesCenterSelection.transition().attr("transform",(s,l)=>{const u=a.seriesContainerPosition[l]??a.seriesContainerPosition[0];return`translate(${u.centerX}, ${u.centerY})`})}),{seriesCenterSelection$:o}},mg="Pie",Uz={name:mg,defaultParams:JS,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{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 jz({enter:e,exit:t,data:n,lastTweenData:r,fullParams:i}){return!e.size()&&!t.size()?o=>{const a=n.map((s,l)=>{const u=r[l]??{startAngle:0,endAngle:0,value:0};return{...s,startAngle:s.startAngle*o+u.startAngle*(1-o),endAngle:s.endAngle*o+u.endAngle*(1-o),value:s.value*o+u.value*(1-o)}});return yg(a,i.startAngle,i.endAngle,1)}:o=>yg(n,i.startAngle,i.endAngle,o)}function yg(e,t,n,r){return e.map((i,o)=>{const a=t+(i.startAngle-t)*r,s=a+(i.endAngle-i.startAngle)*r;return{...i,startAngle:a,endAngle:s}})}function i2({selection:e,data:t,arc:n,pathClassName:r,fullParams:i,fullChartParams:o}){return e.selectAll("path").data(t,s=>s.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(s,l)=>s.data.color).attr("stroke",(s,l)=>Se({datum:s.data,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("d",(s,l)=>n(s))}function Hz({pathSelection:e,ids:t,fullChartParams:n,arc:r,arcHighlight:i}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").style("opacity",1).attr("d",o=>r(o));return}e.each((o,a,s)=>{const l=X(s[a]);t.includes(o.data.id)?l.style("opacity",1).transition("highlight").ease(lr).duration(500).attr("d",u=>i(u)):l.style("opacity",n.styles.unhighlightedOpacity).transition("highlight").attr("d",u=>r(u))})}function qz(e,t){const n=new Q,r=H(e,"path");let i=[],o=[];const a=t.seriesContainerPosition$.pipe(C(n),L(f=>f.width<f.height?f.width:f.height),Z()),s=new me(f=>{G({containerVisibleComputedSortedData:t.containerVisibleComputedSortedData$,fullParams:t.fullParams$}).pipe(C(n),z(async p=>p)).subscribe(p=>{const g=r2({data:p.containerVisibleComputedSortedData,startAngle:p.fullParams.startAngle,endAngle:p.fullParams.endAngle});f.next(g)})}),l=new me(f=>{G({shorterSideWith:a,fullParams:t.fullParams$}).pipe(C(n),z(async p=>p)).subscribe(p=>{const g=mu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadius,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});f.next(g)})}),u=new me(f=>{G({shorterSideWith:a,fullParams:t.fullParams$}).pipe(C(n),z(async p=>p)).subscribe(p=>{const g=mu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadiusWhileHighlight,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});f.next(g)})}),c=t.fullChartParams$.pipe(C(n),L(f=>f.highlightTarget),Z()),h=new me(f=>{G({pieData:s,arc:l,computedData:t.computedData$,fullParams:t.fullParams$,fullChartParams:t.fullChartParams$,highlightTarget:c}).pipe(C(n),z(async p=>p)).subscribe(p=>{t.containerSelection.interrupt("graphicMove");const g=t.containerSelection.selectAll("path").data(p.pieData,b=>b.id),m=g.enter(),d=g.exit(),y=jz({enter:m,exit:d,data:p.pieData,lastTweenData:i,fullParams:p.fullParams});t.containerSelection.transition("graphicMove").duration(p.fullChartParams.transitionDuration).tween("move",(b,x)=>$=>{o=y($),i2({selection:t.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams})}).on("end",(b,x)=>{o=yg(p.pieData,p.fullParams.startAngle,p.fullParams.endAngle,1);const $=i2({selection:t.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams});f.next($),i=Object.assign([],p.pieData),t.event$.next({type:"series",pluginName:e,eventName:"transitionEnd",event:void 0,highlightTarget:p.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",data:p.computedData})})})}).pipe(ie(1));return G({pathSelection:h,SeriesDataMap:t.SeriesDataMap$,computedData:t.computedData$,highlightTarget:c}).pipe(C(n),z(async f=>f)).subscribe(f=>{f.pathSelection.on("mouseover",(p,g)=>{p.stopPropagation(),t.event$.next({type:"series",eventName:"mouseover",pluginName:e,highlightTarget:f.highlightTarget,datum:g.data,series:f.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:p,data:f.computedData})}).on("mousemove",(p,g)=>{p.stopPropagation(),t.event$.next({type:"series",eventName:"mousemove",pluginName:e,highlightTarget:f.highlightTarget,datum:g.data,series:f.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:p,data:f.computedData})}).on("mouseout",(p,g)=>{p.stopPropagation(),t.event$.next({type:"series",eventName:"mouseout",pluginName:e,highlightTarget:f.highlightTarget,datum:g.data,series:f.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:p,data:f.computedData})}).on("click",(p,g)=>{p.stopPropagation(),t.event$.next({type:"series",eventName:"click",pluginName:e,highlightTarget:f.highlightTarget,datum:g.data,series:f.SeriesDataMap.get(g.data.seriesLabel),seriesIndex:g.data.seriesIndex,seriesLabel:g.data.seriesLabel,event:p,data:f.computedData})})}),G({pathSelection:h,highlight:t.seriesHighlight$.pipe(L(f=>f.map(p=>p.id))),fullChartParams:t.fullChartParams$,arc:l,arcHighlight:u}).pipe(C(n),z(async f=>f)).subscribe(f=>{Hz({pathSelection:f.pathSelection,ids:f.highlight,fullChartParams:f.fullChartParams,arc:f.arc,arcHighlight:f.arcHighlight})}),()=>{n.next(void 0)}}const Zz=Dn(Uz)(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,{seriesCenterSelection$:o}=$a({selection:e,pluginName:mg,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(C(i)).subscribe(s=>{a.forEach(l=>l()),s.each((l,u,c)=>{const h=X(c[u]),f=r.visibleComputedSortedData$.pipe(C(i),L(g=>g[u]??g[0])),p=r.seriesContainerPosition$.pipe(C(i),L(g=>g[u]??g[0]));a[u]=qz(mg,{containerSelection:h,computedData$:r.computedData$,containerVisibleComputedSortedData$:f,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())}}),_u="PieEventTexts",o2=H(_u,"text"),Kz={name:_u,defaultParams:hg,layerIndex:bu,validator:(e,{validateColumns:t})=>t(e,{renderFn:{toBeTypes:["Function"]},textAttrs:{toBeTypes:["object[]"]},textStyles:{toBeTypes:["object[]"]}})};function bg(e,t){const n=e.selectAll(`text.${o2}`).data(t),r=n.enter().append("text").classed(o2,!0),i=n.merge(r);return i.each((o,a,s)=>{const l=X(s[a]).text(o.text);Object.keys(o.attr).forEach(u=>{l.attr(u,o.attr[u])}),Object.keys(o.style).forEach(u=>{l.style(u,o.style[u])})}),n.exit().remove(),i}function xg({eventData:e,renderFn:t,textAttrs:n,textStyles:r}){const i=t(e);return(Array.isArray(i)?i:[i]).map((a,s)=>({text:a,attr:n[s],style:r[s]}))}function Qz(e,t){const n=new Q;let r;const i=t.fullChartParams$.pipe(C(n),L(o=>o.highlightTarget),Z());return G({computedData:t.computedData$,fullParams:t.fullParams$,fullChartParams:t.fullChartParams$,highlightTarget:i}).pipe(C(n),z(async o=>o)).subscribe(o=>{t.containerSelection.transition("move").duration(o.fullChartParams.transitionDuration).tween("move",(a,s)=>l=>{const u=xg({eventData:{type:"series",pluginName:e,eventName:"transitionMove",event:a,tween:l,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},renderFn:o.fullParams.renderFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});bg(t.containerSelection,u)}).on("end",(a,s)=>{const l=xg({eventData:{type:"series",pluginName:e,eventName:"transitionEnd",event:a,tween:1,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},renderFn:o.fullParams.renderFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});bg(t.containerSelection,l),r&&r.unsubscribe(),r=t.event$.subscribe(u=>{const c=xg({eventData:u,renderFn:o.fullParams.renderFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});bg(t.containerSelection,c)})})}),()=>{n.next(void 0)}}const Jz=Dn(Kz)(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,{seriesCenterSelection$:o}=$a({selection:e,pluginName:_u,separateSeries$:n.separateSeries$,seriesLabels$:n.seriesLabels$,seriesContainerPosition$:n.seriesContainerPosition$}),a=[];return o.pipe(C(i)).subscribe(s=>{a.forEach(l=>l()),s.each((l,u,c)=>{const h=X(c[u]),f=n.computedSortedData$.pipe(C(i),L(g=>g[u]??g[0])),p=n.seriesContainerPosition$.pipe(C(i),L(g=>g[u]??g[0]));a[u]=Qz(_u,{containerSelection:h,computedData$:n.computedData$,containerComputedSortedData$:f,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())}}),Oi="PieLabels",eO=H(Oi,"label-g"),tO=H(Oi,"line-g"),nO=H(Oi,"text"),a2=2,rO={name:Oi,defaultParams:pg,layerIndex:bu,validator:(e,{validateColumns:t})=>t(e,{outerRadius:{toBeTypes:["number"]},outerRadiusWhileHighlight:{toBeTypes:["number"]},startAngle:{toBeTypes:["number"]},endAngle:{toBeTypes:["number"]},labelCentroid:{toBeTypes:["number"]},labelFn:{toBeTypes:["Function"]},labelColorType:{toBeOption:"ColorType"}})};function iO({pieData:e,arc:t,arcMouseover:n,labelCentroid:r,lineStartCentroid:i,fullParams:o}){return e.map((a,s)=>{const[l,u]=t.centroid(a),[c,h]=n.centroid(a),f=o.labelFn(a.data);return{pieDatum:a,arcIndex:s,arcLabels:f.split(`
384
- `),lineStartX:l*i,lineStartY:u*i,lineStartMouseoverX:c*i,lineStartMouseoverY:h*i,x:l*r,y:u*r,mouseoverX:c*r,mouseoverY:h*r,textWidth:0,collisionShiftX:0,collisionShiftY:0,quadrant:l>=0&&u<=0?1:l<0&&u<=0?2:l<0&&u>0?3:4}}).filter(a=>a.pieDatum.data.visible)}function oO({labelGSelection:e,data:t,fullParams:n,fullChartParams:r,textSizePx:i}){const o=e.selectAll("text").data(t,a=>a.pieDatum.id).join("text").classed(nO,!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)=>Se({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).each((a,s,l)=>{Fv(X(l[s]),{textArr:a.arcLabels,textSizePx:i,quadrant:a.quadrant})});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function aO(e,t,n){const r=e.nodes(),i=n,o=r.map((a,s)=>{const l=a.getBBox(),u=[t[s].x,t[s].y];return{node:a,x:u[0],y:u[1],width:l.width,height:l.height}});for(let a=0;a<o.length;a++){const s=o[a];for(let l=a+1;l<o.length;l++){const u=o[l];t[a].textWidth=s.width;const c=s.x+t[a].collisionShiftX,h=s.y+t[a].collisionShiftY,f=u.x+t[l].collisionShiftX,p=u.y+t[l].collisionShiftY;if(!(c+s.width/2<f-u.width/2||c-s.width/2>f+u.width/2||h+s.height/2<p-u.height/2||h-s.height/2>p+u.height/2)){if(t[l].quadrant==2){const g=p>h?-i*2:-i;t[l].collisionShiftY+=g}else if(t[l].quadrant==4){const g=p>h?i:i*2;t[l].collisionShiftY+=g}}}}for(let a=o.length-1;a>=0;a--){const s=o[a];for(let l=a-1;l>=0;l--){const u=o[l];t[a].textWidth=s.width;const c=s.x+t[a].collisionShiftX,h=s.y+t[a].collisionShiftY,f=u.x+t[l].collisionShiftX,p=u.y+t[l].collisionShiftY;if(!(c+s.width/2<f-u.width/2||c-s.width/2>f+u.width/2||h+s.height/2<p-u.height/2||h-s.height/2>p+u.height/2)){if(t[l].quadrant==1){const g=p>h?-i*2:-i;t[l].collisionShiftY+=g}else if(t[l].quadrant==3){const g=p>h?i:i*2;t[l].collisionShiftY+=g}}}}e.data(t).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function sO({lineGSelection:e,data:t,fullParams:n,fullChartParams:r}){const i=t.filter(a=>a.collisionShiftX||a.collisionShiftY),o=e.selectAll("polyline").data(i,a=>a.pieDatum.id).join("polyline").attr("stroke",a=>Se({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,l=a.y+a.collisionShiftY;return[[s,l],[a.lineStartX,a.lineStartY]]}),o}function lO({textSelection:e,lineSelection:t,ids:n,fullChartParams:r}){if(e.interrupt("highlight"),t.interrupt("highlight"),!n.length){e.transition("highlight").duration(200).attr("transform",i=>`translate(${i.x+i.collisionShiftX},${i.y+i.collisionShiftY})`).style("opacity",1),t.transition("highlight").duration(200).style("opacity",1);return}e.each((i,o,a)=>{const s=X(a[o]);n.includes(i.pieDatum.id)?s.style("opacity",1).transition("highlight").duration(200).attr("transform",l=>l.collisionShiftX||l.collisionShiftY?`translate(${l.x+l.collisionShiftX},${l.y+l.collisionShiftY})`:`translate(${l.mouseoverX+l.collisionShiftX},${l.mouseoverY+l.collisionShiftY})`):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200).attr("transform",l=>`translate(${l.x+l.collisionShiftX},${l.y+l.collisionShiftY})`)}),t.each((i,o,a)=>{const s=X(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 uO(e,t){const n=new Q;t.containerSelection.selectAll("g").remove();const r=t.containerSelection.append("g");r.classed(tO,!0);const i=t.containerSelection.append("g");i.classed(eO,!0);const o=new Q,a=new Q;let s=[];const l=t.seriesContainerPosition$.pipe(C(n),L(c=>c.width<c.height?c.width:c.height),Z()),u=t.fullParams$.pipe(C(n),L(c=>c.labelCentroid>=a2?a2:c.labelCentroid));return G({shorterSideWith:l,containerVisibleComputedSortedData:t.containerVisibleComputedSortedData$,fullParams:t.fullParams$,fullChartParams:t.fullChartParams$,textSizePx:t.textSizePx$,lineStartCentroid:u}).pipe(C(n),z(async c=>c)).subscribe(c=>{const h=mu({axisWidth:c.shorterSideWith,innerRadius:0,outerRadius:c.fullParams.outerRadius,padAngle:0,cornerRadius:0}),f=mu({axisWidth:c.shorterSideWith,innerRadius:0,outerRadius:c.fullParams.outerRadiusWhileHighlight,padAngle:0,cornerRadius:0}),p=r2({data:c.containerVisibleComputedSortedData,startAngle:c.fullParams.startAngle,endAngle:c.fullParams.endAngle});s=iO({pieData:p,arc:h,arcMouseover:f,labelCentroid:c.fullParams.labelCentroid,lineStartCentroid:c.lineStartCentroid,fullParams:c.fullParams}),r.selectAll("polyline").remove();const g=oO({labelGSelection:i,data:s,fullParams:c.fullParams,fullChartParams:c.fullChartParams,textSizePx:c.textSizePx});setTimeout(()=>{aO(g,s,c.textSizePx);const m=sO({lineGSelection:r,data:s,fullParams:c.fullParams,fullChartParams:c.fullChartParams});a.next(m)},1e3),o.next(g)}),G({textSelection:o,lineSelection:a,highlight:t.seriesHighlight$.pipe(L(c=>c.map(h=>h.id))),fullChartParams:t.fullChartParams$}).pipe(C(n),z(async c=>c)).subscribe(c=>{lO({textSelection:c.textSelection,lineSelection:c.lineSelection,ids:c.highlight,fullChartParams:c.fullChartParams})}),()=>{n.next(void 0)}}const cO=Dn(rO)(({selection:e,observer:t,subject:n})=>{const r=new Q,{seriesCenterSelection$:i}=$a({selection:e,pluginName:Oi,separateSeries$:t.separateSeries$,seriesLabels$:t.seriesLabels$,seriesContainerPosition$:t.seriesContainerPosition$}),o=[];return i.pipe(C(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,l,u)=>{const c=X(u[l]),h=t.visibleComputedSortedData$.pipe(C(r),L(p=>p[l]??p[0])),f=t.seriesContainerPosition$.pipe(C(r),L(p=>p[l]??p[0]));o[l]=uO(Oi,{containerSelection:c,containerVisibleComputedSortedData$:h,fullParams$:t.fullParams$,fullChartParams$:t.fullChartParams$,textSizePx$:t.textSizePx$,seriesHighlight$:t.seriesHighlight$,seriesContainerPosition$:f,event$:n.event$})})}),()=>{r.next(void 0)}}),$g="Rose",fO=Math.PI*2,hO={name:$g,defaultParams:e2,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{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 pO({cornerRadius:e,outerRadius:t,axisWidth:n,maxValue:r,arcScaleType:i,fullParams:o}){const a=n/2*t,s=i==="area"?.5:1,l=mn().domain([0,r]).range([0,a]).exponent(s);return u=>{const c=l(u.prevValue),h=l(u.value),f=sn(c,h);return p=>{const g=f(p);return iu().innerRadius(0).outerRadius(g).padAngle(o.padAngle).padRadius(g).cornerRadius(e)(u)}}}function gO({pathSelection:e,ids:t,fullParams:n,fullChartParams:r,tweenArc:i}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").style("opacity",1).attr("d",o=>i(o)(1));return}e.each((o,a,s)=>{const l=X(s[a]);t.includes(o.data.id)?l.style("opacity",1).transition("highlight").ease(lr).duration(500).attr("d",u=>i({...u,startAngle:u.startAngle-n.angleIncreaseWhileHighlight,endAngle:u.endAngle+n.angleIncreaseWhileHighlight})(1)):l.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").attr("d",u=>i(u)(1))})}function dO(e,t){const n=new Q,r=H(e,"path");let i=[];const o=t.seriesContainerPosition$.pipe(C(n),L(p=>p.width<p.height?p.width:p.height),Z()),a=G({containerVisibleComputedSortedData:t.containerVisibleComputedSortedData$,fullParams:t.fullParams$}).pipe(C(n),z(async p=>p),L(p=>{const g=fO/p.containerVisibleComputedSortedData.length;return p.containerVisibleComputedSortedData.map((m,d)=>({id:m.id,data:m,index:d,value:m.value,startAngle:g*d,endAngle:g*(d+1),padAngle:p.fullParams.padAngle,prevValue:i[d]&&i[d].id===m.id?i[d].value:0}))})),s=t.fullChartParams$.pipe(C(n),L(p=>p.highlightTarget),Z()),l=t.visibleComputedSortedData$.pipe(L(p=>Math.max(...p.flat().map(g=>g.value))),Z()),u=G({fullParams:t.fullParams$,axisWidth:o,maxValue:l}).pipe(C(n),z(async p=>p),L(p=>pO({cornerRadius:p.fullParams.cornerRadius,outerRadius:p.fullParams.outerRadius,axisWidth:p.axisWidth,maxValue:p.maxValue,arcScaleType:p.fullParams.arcScaleType,fullParams:p.fullParams}))),c=t.fullChartParams$.pipe(C(n),L(p=>p.transitionDuration),Z()),h=new Eu(!1),f=new me(p=>{G({pieData:a,tweenArc:u,transitionDuration:c,fullParams:t.fullParams$,fullChartParams:t.fullChartParams$}).pipe(C(n),z(async g=>g)).subscribe(g=>{const m=g.pieData.map((y,b)=>(y.prevValue=i[b]&&i[b].id===y.id?i[b].value:0,y));h.next(!0);const d=t.containerSelection.selectAll("path").data(m,y=>y.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(y,b)=>y.data.color).attr("stroke",(y,b)=>Se({datum:y.data,colorType:g.fullParams.strokeColorType,fullChartParams:g.fullChartParams})).attr("stroke-width",g.fullParams.strokeWidth);d.interrupt("graphicMove"),d.transition("graphicMove").duration(g.transitionDuration).attrTween("d",g.tweenArc).on("end",()=>{p.next(d),h.next(!1)}),i=Object.assign([],m)})}).pipe(ie(1));return G({pathSelection:f,SeriesDataMap:t.SeriesDataMap$,computedData:t.computedData$,highlightTarget:s}).pipe(C(n),z(async p=>p)).subscribe(p=>{p.pathSelection.on("mouseover",(g,m)=>{g.stopPropagation(),t.event$.next({type:"series",eventName:"mouseover",pluginName:e,highlightTarget:p.highlightTarget,datum:m.data,series:p.SeriesDataMap.get(m.data.seriesLabel),seriesIndex:m.data.seriesIndex,seriesLabel:m.data.seriesLabel,event:g,data:p.computedData})}).on("mousemove",(g,m)=>{g.stopPropagation(),t.event$.next({type:"series",eventName:"mousemove",pluginName:e,highlightTarget:p.highlightTarget,datum:m.data,series:p.SeriesDataMap.get(m.data.seriesLabel),seriesIndex:m.data.seriesIndex,seriesLabel:m.data.seriesLabel,event:g,data:p.computedData})}).on("mouseout",(g,m)=>{g.stopPropagation(),t.event$.next({type:"series",eventName:"mouseout",pluginName:e,highlightTarget:p.highlightTarget,datum:m.data,series:p.SeriesDataMap.get(m.data.seriesLabel),seriesIndex:m.data.seriesIndex,seriesLabel:m.data.seriesLabel,event:g,data:p.computedData})}).on("click",(g,m)=>{g.stopPropagation(),t.event$.next({type:"series",eventName:"click",pluginName:e,highlightTarget:p.highlightTarget,datum:m.data,series:p.SeriesDataMap.get(m.data.seriesLabel),seriesIndex:m.data.seriesIndex,seriesLabel:m.data.seriesLabel,event:g,data:p.computedData})})}),G({pathSelection:f,highlight:t.seriesHighlight$.pipe(L(p=>p.map(g=>g.id))),fullParams:t.fullParams$,fullChartParams:t.fullChartParams$,tweenArc:u,isTransitionMoving:h}).pipe(C(n),z(async p=>p),Er(p=>!p.isTransitionMoving)).subscribe(p=>{gO({pathSelection:p.pathSelection,ids:p.highlight,fullParams:p.fullParams,fullChartParams:p.fullChartParams,tweenArc:p.tweenArc})}),()=>{n.next(void 0)}}const mO=Dn(hO)(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,{seriesCenterSelection$:o}=$a({selection:e,pluginName:$g,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(C(i)).subscribe(s=>{a.forEach(l=>l()),s.each((l,u,c)=>{const h=X(c[u]),f=r.visibleComputedSortedData$.pipe(C(i),L(g=>JSON.parse(JSON.stringify(g[u]??g[0])))),p=r.seriesContainerPosition$.pipe(C(i),L(g=>JSON.parse(JSON.stringify(g[u]??g[0]))));a[u]=dO($g,{containerSelection:h,computedData$:r.computedData$,visibleComputedData$:r.visibleComputedData$,visibleComputedSortedData$:r.visibleComputedSortedData$,containerVisibleComputedSortedData$:f,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())}}),Gi="RoseLabels",yO=H(Gi,"label-g"),bO=H(Gi,"line-g"),xO=H(Gi,"text"),s2=2,$O={name:Gi,defaultParams:gg,layerIndex:bu,validator:(e,{validateColumns:t})=>t(e,{outerRadius:{toBeTypes:["number"]},labelCentroid:{toBeTypes:["number"]},labelFn:{toBeTypes:["Function"]},labelColorType:{toBeOption:"ColorType"},arcScaleType:{toBe:'"area" | "radius"',test:r=>r==="area"||r==="radius"}})};function vO({pieData:e,labelCentroid:t,arcScaleType:n,maxValue:r,axisWidth:i,outerRadius:o,lineStartCentroid:a,fullParams:s}){const l=i/2*o,u=n==="area"?.5:1,c=mn().domain([0,r]).range([0,l]).exponent(u);return e.map((h,f)=>{const p=c(h.value),g=iu().innerRadius(0).outerRadius(p).padAngle(0).padRadius(p).cornerRadius(0),[m,d]=g.centroid(h),[y,b]=[m,d],x=s.labelFn(h.data);return{pieDatum:h,arcIndex:f,arcLabels:x.split(`
385
- `),lineStartX:m*a,lineStartY:d*a,lineStartMouseoverX:y*a,lineStartMouseoverY:b*a,x:m*t,y:d*t,mouseoverX:y*t,mouseoverY:b*t,textWidth:0,collisionShiftX:0,collisionShiftY:0,quadrant:m>=0&&d<=0?1:m<0&&d<=0?2:m<0&&d>0?3:4}}).filter(h=>h.pieDatum.data.visible)}function SO({labelGSelection:e,data:t,fullParams:n,fullChartParams:r,textSizePx:i}){const o=e.selectAll("text").data(t,a=>a.pieDatum.id).join("text").classed(xO,!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)=>Se({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).each((a,s,l)=>{Fv(X(l[s]),{textArr:a.arcLabels,textSizePx:i,quadrant:a.quadrant})});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function TO(e,t,n){const r=e.nodes(),i=n,o=r.map((a,s)=>{const l=a.getBBox(),u=[t[s].x,t[s].y];return{node:a,x:u[0],y:u[1],width:l.width,height:l.height}});for(let a=0;a<o.length;a++){const s=o[a];for(let l=a+1;l<o.length;l++){const u=o[l];t[a].textWidth=s.width;const c=s.x+t[a].collisionShiftX,h=s.y+t[a].collisionShiftY,f=u.x+t[l].collisionShiftX,p=u.y+t[l].collisionShiftY;if(!(c+s.width/2<f-u.width/2||c-s.width/2>f+u.width/2||h+s.height/2<p-u.height/2||h-s.height/2>p+u.height/2)){if(t[l].quadrant==2){const g=p>h?-i*2:-i;t[l].collisionShiftY+=g}else if(t[l].quadrant==4){const g=p>h?i:i*2;t[l].collisionShiftY+=g}}}}for(let a=o.length-1;a>=0;a--){const s=o[a];for(let l=a-1;l>=0;l--){const u=o[l];t[a].textWidth=s.width;const c=s.x+t[a].collisionShiftX,h=s.y+t[a].collisionShiftY,f=u.x+t[l].collisionShiftX,p=u.y+t[l].collisionShiftY;if(!(c+s.width/2<f-u.width/2||c-s.width/2>f+u.width/2||h+s.height/2<p-u.height/2||h-s.height/2>p+u.height/2)){if(t[l].quadrant==1){const g=p>h?-i*2:-i;t[l].collisionShiftY+=g}else if(t[l].quadrant==3){const g=p>h?i:i*2;t[l].collisionShiftY+=g}}}}e.data(t).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function _O({lineGSelection:e,data:t,fullParams:n,fullChartParams:r}){const i=t.filter(a=>a.collisionShiftX||a.collisionShiftY),o=e.selectAll("polyline").data(i,a=>a.pieDatum.id).join("polyline").attr("stroke",a=>Se({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,l=a.y+a.collisionShiftY;return[[s,l],[a.lineStartX,a.lineStartY]]}),o}function AO({textSelection:e,lineSelection:t,ids:n,fullChartParams:r}){if(e.interrupt("highlight"),t.interrupt("highlight"),!n.length){e.transition("highlight").duration(200).attr("transform",i=>`translate(${i.x+i.collisionShiftX},${i.y+i.collisionShiftY})`).style("opacity",1),t.transition("highlight").duration(200).style("opacity",1);return}e.each((i,o,a)=>{const s=X(a[o]);n.includes(i.pieDatum.data.id)?s.style("opacity",1).transition("highlight").duration(200).attr("transform",l=>`translate(${l.mouseoverX+l.collisionShiftX},${l.mouseoverY+l.collisionShiftY})`):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200).attr("transform",l=>`translate(${l.x+l.collisionShiftX},${l.y+l.collisionShiftY})`)}),t.each((i,o,a)=>{const s=X(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 wO(e,t){const n=new Q;t.containerSelection.selectAll("g").remove();const r=t.containerSelection.append("g");r.classed(bO,!0);const i=t.containerSelection.append("g");i.classed(yO,!0);const o=new Q,a=new Q;let s=[];const l=t.seriesContainerPosition$.pipe(C(n),L(h=>h.width<h.height?h.width:h.height),Z()),u=t.visibleComputedSortedData$.pipe(L(h=>Math.max(...h.flat().map(f=>f.value))),Z()),c=t.fullParams$.pipe(C(n),L(h=>h.labelCentroid>=s2?s2:h.labelCentroid));return G({shorterSideWith:l,containerVisibleComputedSortedData:t.containerVisibleComputedSortedData$,maxValue:u,fullParams:t.fullParams$,fullChartParams:t.fullChartParams$,textSizePx:t.textSizePx$,lineStartCentroid:c}).pipe(C(n),z(async h=>h)).subscribe(h=>{const f=Math.PI*2/h.containerVisibleComputedSortedData.length,p=h.containerVisibleComputedSortedData.map((m,d)=>({id:m.id,data:m,index:d,value:m.value,startAngle:f*d,endAngle:f*(d+1),padAngle:0}));s=vO({pieData:p,labelCentroid:h.fullParams.labelCentroid,arcScaleType:h.fullParams.arcScaleType,maxValue:h.maxValue,axisWidth:h.shorterSideWith,outerRadius:h.fullParams.outerRadius,lineStartCentroid:h.lineStartCentroid,fullParams:h.fullParams}),r.selectAll("polyline").remove();const g=SO({labelGSelection:i,data:s,fullParams:h.fullParams,fullChartParams:h.fullChartParams,textSizePx:h.textSizePx});setTimeout(()=>{TO(g,s,h.textSizePx);const m=_O({lineGSelection:r,data:s,fullParams:h.fullParams,fullChartParams:h.fullChartParams});a.next(m)},1e3),o.next(g)}),G({textSelection:o,lineSelection:a,highlight:t.seriesHighlight$.pipe(L(h=>h.map(f=>f.id))),fullChartParams:t.fullChartParams$}).pipe(C(n),z(async h=>h)).subscribe(h=>{AO({textSelection:h.textSelection,lineSelection:h.lineSelection,ids:h.highlight,fullChartParams:h.fullChartParams})}),()=>{n.next(void 0)}}const PO=Dn($O)(({selection:e,observer:t,subject:n})=>{const r=new Q,{seriesCenterSelection$:i}=$a({selection:e,pluginName:Gi,separateSeries$:t.separateSeries$,seriesLabels$:t.seriesLabels$,seriesContainerPosition$:t.seriesContainerPosition$}),o=[];return i.pipe(C(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,l,u)=>{const c=X(u[l]),h=t.visibleComputedSortedData$.pipe(C(r),L(p=>JSON.parse(JSON.stringify(p[l]??p[0])))),f=t.seriesContainerPosition$.pipe(C(r),L(p=>JSON.parse(JSON.stringify(p[l]??p[0]))));o[l]=wO(Gi,{containerSelection:c,visibleComputedSortedData$:t.visibleComputedSortedData$,containerVisibleComputedSortedData$:h,fullParams$:t.fullParams$,fullChartParams$:t.fullChartParams$,textSizePx$:t.textSizePx$,seriesHighlight$:t.seriesHighlight$,seriesContainerPosition$:f,event$:n.event$})})}),()=>{r.next(void 0)}}),l2="SeriesLegend",DO=Dn({name:l2,defaultParams:t2,layerIndex:Mi,validator:(e,{validateColumns:t})=>t(e,{placement:{toBe:'"top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end"',test:r=>["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].includes(r)},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:e,rootSelection:t,observer:n,subject:r})=>{const i=new Q,o=n.SeriesDataMap$.pipe(C(i),L(l=>Array.from(l.keys()))),a=n.fullParams$.pipe(C(i),L(l=>{const u=[{listRectWidth:l.listRectWidth,listRectHeight:l.listRectHeight,listRectRadius:l.listRectRadius}];return{...l,labelList:u}})),s=Ri(l2,{rootSelection:t,legendLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),u2="SeriesTooltip",CO=Dn({name:u2,defaultParams:dg,layerIndex:ki,validator:(e,{validateColumns:t})=>t(e,{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"},renderFn:{toBeTypes:["Function"]}})})(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q,a=Ei(u2,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),vg={paddingInner:2,paddingOuter:2,labelColorType:"labelContrast",squarifyRatio:1.618034,sort:(e,t)=>t.value-e.value};vg.sort.toString=()=>"(a, b) => b.value - a.value";const c2={placement:"right-end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},Sg={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(e,{styles:t,utils:n})=>{const r=!!e.categoryLabel,i=!!e.datum.label,o=n.toCurrency(e.datum.value),a=t.textSizePx*.7,s=t.textSizePx/2-a/2,l=r?`<rect width="${a}" height="${a}" x="${s}" y="${s-1}" rx="${a/2}" fill="${e.datum.color}"></rect>
383
+ }`;const Bz="Bubbles",nS=12,Nz={name:Bz,defaultParams:Q2,layerIndex:at,validator:(e,{validateColumns:t})=>{const n=t(e,{force:{toBeTypes:["object"]},bubbleLabel:{toBeTypes:["object"]},arcScaleType:{toBe:'"area" | "radius"',test:r=>r==="area"||r==="radius"}});if(e.force){const r=t(e.force,{velocityDecay:{toBeTypes:["number"]},collisionSpacing:{toBeTypes:["number"]},strength:{toBeTypes:["number"]}});if(r.status==="error")return r}if(e.bubbleLabel){const r=t(e.bubbleLabel,{labelFn:{toBeTypes:["Function"]},colorType:{toBeOption:"ColorType"},fillRate:{toBeTypes:["number"]},lineHeight:{toBeTypes:["number"]},maxLineLength:{toBeTypes:["number"]}});if(r.status==="error")return r}return n}};function Fz(e,t){return Zs().velocityDecay(t.force.velocityDecay).force("collision",qs().radius(n=>n.r+t.force.collisionSpacing)).force("charge",Ks().strength(n=>-Math.pow(n.r,2)*t.force.strength)).on("tick",()=>{e.attr("transform",n=>`translate(${n.x},${n.y})`)})}function zz({selection:e,bubblesData:t,fullParams:n,fullChartParams:r}){const i=e.selectAll("g").data(t,o=>o.id).join(o=>{const a=o.append("g").attr("cursor","pointer").attr("font-size",nS).style("fill","#ffffff").attr("text-anchor","middle");return a.append("circle").attr("class","node").attr("cx",0).attr("cy",0).attr("fill",s=>s.color),a.append("text").style("opacity",.8).attr("pointer-events","none"),a},o=>o,o=>o.remove()).attr("transform",o=>`translate(${o.x},${o.y})`);return i.select("circle").transition().duration(200).attr("r",o=>o.r).attr("fill",o=>o.color),i.each((o,a,s)=>{const l=X(s[a]),u=o.renderLabel;l.call(Nv,{text:u,radius:o.r*n.bubbleLabel.fillRate,lineHeight:nS*n.bubbleLabel.lineHeight,isBreakAll:u.length<=n.bubbleLabel.maxLineLength?!1:n.bubbleLabel.wordBreakAll}),l.select("text").attr("fill",c=>Se({datum:o,colorType:n.bubbleLabel.colorType,fullChartParams:r}))}),i}function Oz(e){return $s().on("start",(t,n)=>{t.active||e.alpha(1).restart(),n.fx=n.x,n.fy=n.y}).on("drag",(t,n)=>{t.active||e.alphaTarget(0),n.fx=t.x,n.fy=t.y}).on("end",(t,n)=>{n.fx=null,n.fy=null,e.alpha(1).restart()})}function Gz({_simulation:e,fullParams:t,DatumContainerPositionMap:n}){e.force("x",jy().strength(t.force.strength).x(r=>n.get(r.id).centerX)).force("y",Hy().strength(t.force.strength).y(r=>n.get(r.id).centerY))}function Wz({bubblesSelection:e,highlightIds:t,fullChartParams:n}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").style("opacity",1);return}e.each((r,i,o)=>{const a=X(o[i]);t.includes(r.id)?a.style("opacity",1).transition("highlight").ease(lr).duration(500):a.style("opacity",n.styles.unhighlightedOpacity)})}const Vz=Dn(Nz)(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q;let o;const a=n.fullParams$.pipe(C(i),L(g=>g.arcScaleType),q(),ne(1)),s=n.layout$.pipe(C(i),L(g=>Math.min(g.width,g.height)/2),q(),ne(1)),l=n.visibleComputedSortedData$.pipe(C(i),L(g=>g.flat().reduce((y,b)=>y+b.value,0)),q(),ne(1)),u=O({totalR:s,totalValue:l,scaleType:a}).pipe(C(i),z(async g=>g),L(g=>yn().domain([0,g.totalValue]).range([0,g.totalR]).exponent(g.scaleType==="area"?.5:1)),ne(1)),c=a.pipe(C(i),z(g=>on(()=>g==="area",St(1),O({totalR:s,radiusScale:u,visibleComputedSortedData:n.visibleComputedSortedData$}).pipe(z(async y=>y),L(y=>{const b=y.totalR*y.totalR*Math.PI;return Math.sqrt(b/Ec(y.visibleComputedSortedData.flat(),x=>Math.PI*Math.pow(y.radiusScale(x.value),2)))}))))),h=O({visibleComputedSortedData:n.visibleComputedSortedData$,radiusScale:u,scaleFactor:c}).pipe(C(i),z(async g=>g),L(g=>new Map(g.visibleComputedSortedData.flat().map(b=>[b.id,g.radiusScale(b.value??0)*g.scaleFactor*.9]))),ne(1)),f=n.DatumContainerPositionMap$.pipe(C(i),L(g=>new Map(Array.from(g).map(([y,b])=>[y,{x:b.startX+b.width*Math.random(),y:b.startY+b.height*Math.random()}]))),Br(),ne(1)),p=O({visibleComputedSortedData:n.visibleComputedSortedData$,DatumRMap:h,DatumInitXYMap:f,fullParams:n.fullParams$}).pipe(C(i),z(async g=>g),L(g=>g.visibleComputedSortedData.flat().map(y=>{const b=y;if(b.x===void 0||b.y===void 0){const{x,y:$}=g.DatumInitXYMap.get(b.id);b.x=x,b.y=$}return b.r=g.DatumRMap.get(b.id),b._originR=b.r,b.renderLabel=g.fullParams.bubbleLabel.labelFn(b),b})),ne(1)),d=n.fullChartParams$.pipe(C(i),L(g=>g.highlightTarget),q()),m=O({bubblesData:p,fullParams:n.fullParams$,fullChartParams:n.fullChartParams$,DatumContainerPositionMap:n.DatumContainerPositionMap$}).pipe(C(i),z(async g=>g),L(g=>{o&&o.stop();const y=zz({selection:e,bubblesData:g.bubblesData,fullParams:g.fullParams,fullChartParams:g.fullChartParams});return o=Fz(y,g.fullParams),o.nodes(g.bubblesData),Gz({_simulation:o,fullParams:g.fullParams,DatumContainerPositionMap:g.DatumContainerPositionMap}),o.alpha(1).restart(),y}),ne(1));return O({bubblesSelection:m,computedData:n.computedData$,SeriesDataMap:n.SeriesDataMap$,highlightTarget:d}).pipe(C(i),z(async g=>g)).subscribe(g=>{g.bubblesSelection.on("mouseover",(y,b)=>{r.event$.next({type:"series",eventName:"mouseover",pluginName:t,highlightTarget:g.highlightTarget,datum:b,series:g.SeriesDataMap.get(b.seriesLabel),seriesIndex:b.seriesIndex,seriesLabel:b.seriesLabel,event:y,data:g.computedData})}).on("mousemove",(y,b)=>{r.event$.next({type:"series",eventName:"mousemove",pluginName:t,highlightTarget:g.highlightTarget,datum:b,series:g.SeriesDataMap.get(b.seriesLabel),seriesIndex:b.seriesIndex,seriesLabel:b.seriesLabel,event:y,data:g.computedData})}).on("mouseout",(y,b)=>{r.event$.next({type:"series",eventName:"mouseout",pluginName:t,highlightTarget:g.highlightTarget,datum:b,series:g.SeriesDataMap.get(b.seriesLabel),seriesIndex:b.seriesIndex,seriesLabel:b.seriesLabel,event:y,data:g.computedData})}).on("click",(y,b)=>{r.event$.next({type:"series",eventName:"click",pluginName:t,highlightTarget:g.highlightTarget,datum:b,series:g.SeriesDataMap.get(b.seriesLabel),seriesIndex:b.seriesIndex,seriesLabel:b.seriesLabel,event:y,data:g.computedData})}).call(Oz(o))}),O({bubblesSelection:m,highlight:n.seriesHighlight$.pipe(L(g=>g.map(y=>y.id))),fullChartParams:n.fullChartParams$}).pipe(C(i),z(async g=>g)).subscribe(g=>{Wz({bubblesSelection:g.bubblesSelection,highlightIds:g.highlight,fullChartParams:g.fullChartParams})}),()=>{i.next(void 0),o&&(o.stop(),o=void 0)}});function rS({data:e,startAngle:t,endAngle:n}){return D$().startAngle(t).endAngle(n).value(o=>o.value).sort((o,a)=>o.seq-a.seq)(e).map((o,a)=>{let s=o;return s.id=o.data.id,s})}function Yz({selection:e,pluginName:t,visibleComputedSortedData$:n}){const r=H(t,"series");return n.pipe(L(i=>i.map(o=>o[0]?`${o[0].seriesLabel}_${o[0].label}`:"")),q((i,o)=>JSON.stringify(i)===JSON.stringify(o)),L(i=>e.selectAll(`g.${r}`).data(i,o=>o).join(o=>o.append("g").classed(r,!0),o=>o,o=>o.remove())),ne(1))}const $a=({selection:e,pluginName:t,visibleComputedSortedData$:n,seriesContainerPosition$:r})=>{const i=Yz({selection:e,pluginName:t,visibleComputedSortedData$:n});return O({seriesCenterSelection:i,seriesContainerPosition:r}).pipe(z(async o=>o),q((o,a)=>o.seriesContainerPosition.length===a.seriesContainerPosition.length)).subscribe(o=>{o.seriesCenterSelection.attr("transform",(a,s)=>{const l=o.seriesContainerPosition[s]??o.seriesContainerPosition[0];return`translate(${l.centerX}, ${l.centerY})`})}),O({seriesCenterSelection:i,seriesContainerPosition:r}).pipe(z(async o=>o)).subscribe(o=>{o.seriesCenterSelection.transition().attr("transform",(a,s)=>{const l=o.seriesContainerPosition[s]??o.seriesContainerPosition[0];return`translate(${l.centerX}, ${l.centerY})`})}),{seriesCenterSelection$:i}},mg="Pie",Xz={name:mg,defaultParams:J2,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{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 Uz({enter:e,exit:t,data:n,lastTweenData:r,fullParams:i}){return!e.size()&&!t.size()?o=>{const a=n.map((s,l)=>{const u=r[l]??{startAngle:0,endAngle:0,value:0};return{...s,startAngle:s.startAngle*o+u.startAngle*(1-o),endAngle:s.endAngle*o+u.endAngle*(1-o),value:s.value*o+u.value*(1-o)}});return yg(a,i.startAngle,i.endAngle,1)}:o=>yg(n,i.startAngle,i.endAngle,o)}function yg(e,t,n,r){return e.map((i,o)=>{const a=t+(i.startAngle-t)*r,s=a+(i.endAngle-i.startAngle)*r;return{...i,startAngle:a,endAngle:s}})}function iS({selection:e,data:t,arc:n,pathClassName:r,fullParams:i,fullChartParams:o}){return e.selectAll("path").data(t,s=>s.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(s,l)=>s.data.color).attr("stroke",(s,l)=>Se({datum:s.data,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("d",(s,l)=>n(s))}function jz({pathSelection:e,ids:t,fullChartParams:n,arc:r,arcHighlight:i}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").style("opacity",1).attr("d",o=>r(o));return}e.each((o,a,s)=>{const l=X(s[a]);t.includes(o.data.id)?l.style("opacity",1).transition("highlight").ease(lr).duration(500).attr("d",u=>i(u)):l.style("opacity",n.styles.unhighlightedOpacity).transition("highlight").attr("d",u=>r(u))})}function Hz(e,t){const n=new Q,r=H(e,"path");let i=[],o=[];const a=t.seriesContainerPosition$.pipe(C(n),L(f=>f.width<f.height?f.width:f.height),q()),s=new me(f=>{O({containerVisibleComputedSortedData:t.containerVisibleComputedSortedData$,fullParams:t.fullParams$}).pipe(C(n),z(async p=>p)).subscribe(p=>{const d=rS({data:p.containerVisibleComputedSortedData,startAngle:p.fullParams.startAngle,endAngle:p.fullParams.endAngle});f.next(d)})}),l=new me(f=>{O({shorterSideWith:a,fullParams:t.fullParams$}).pipe(C(n),z(async p=>p)).subscribe(p=>{const d=mu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadius,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});f.next(d)})}),u=new me(f=>{O({shorterSideWith:a,fullParams:t.fullParams$}).pipe(C(n),z(async p=>p)).subscribe(p=>{const d=mu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadiusWhileHighlight,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});f.next(d)})}),c=t.fullChartParams$.pipe(C(n),L(f=>f.highlightTarget),q()),h=new me(f=>{O({pieData:s,arc:l,computedData:t.computedData$,fullParams:t.fullParams$,fullChartParams:t.fullChartParams$,highlightTarget:c}).pipe(C(n),z(async p=>p)).subscribe(p=>{t.containerSelection.interrupt("graphicMove");const d=t.containerSelection.selectAll("path").data(p.pieData,b=>b.id),m=d.enter(),g=d.exit(),y=Uz({enter:m,exit:g,data:p.pieData,lastTweenData:i,fullParams:p.fullParams});t.containerSelection.transition("graphicMove").duration(p.fullChartParams.transitionDuration).tween("move",(b,x)=>$=>{o=y($),iS({selection:t.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams})}).on("end",(b,x)=>{o=yg(p.pieData,p.fullParams.startAngle,p.fullParams.endAngle,1);const $=iS({selection:t.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams});f.next($),i=Object.assign([],p.pieData),t.event$.next({type:"series",pluginName:e,eventName:"transitionEnd",event:void 0,highlightTarget:p.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",data:p.computedData})})})}).pipe(ne(1));return O({pathSelection:h,SeriesDataMap:t.SeriesDataMap$,computedData:t.computedData$,highlightTarget:c}).pipe(C(n),z(async f=>f)).subscribe(f=>{f.pathSelection.on("mouseover",(p,d)=>{p.stopPropagation(),t.event$.next({type:"series",eventName:"mouseover",pluginName:e,highlightTarget:f.highlightTarget,datum:d.data,series:f.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:f.computedData})}).on("mousemove",(p,d)=>{p.stopPropagation(),t.event$.next({type:"series",eventName:"mousemove",pluginName:e,highlightTarget:f.highlightTarget,datum:d.data,series:f.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:f.computedData})}).on("mouseout",(p,d)=>{p.stopPropagation(),t.event$.next({type:"series",eventName:"mouseout",pluginName:e,highlightTarget:f.highlightTarget,datum:d.data,series:f.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:f.computedData})}).on("click",(p,d)=>{p.stopPropagation(),t.event$.next({type:"series",eventName:"click",pluginName:e,highlightTarget:f.highlightTarget,datum:d.data,series:f.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:f.computedData})})}),O({pathSelection:h,highlight:t.seriesHighlight$.pipe(L(f=>f.map(p=>p.id))),fullChartParams:t.fullChartParams$,arc:l,arcHighlight:u}).pipe(C(n),z(async f=>f)).subscribe(f=>{jz({pathSelection:f.pathSelection,ids:f.highlight,fullChartParams:f.fullChartParams,arc:f.arc,arcHighlight:f.arcHighlight})}),()=>{n.next(void 0)}}const qz=Dn(Xz)(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,{seriesCenterSelection$:o}=$a({selection:e,pluginName:mg,visibleComputedSortedData$:r.visibleComputedSortedData$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(C(i)).subscribe(s=>{a.forEach(l=>l()),s.each((l,u,c)=>{const h=X(c[u]),f=r.visibleComputedSortedData$.pipe(C(i),L(d=>d[u]??d[0])),p=r.seriesContainerPosition$.pipe(C(i),L(d=>d[u]??d[0]));a[u]=Hz(mg,{containerSelection:h,computedData$:r.computedData$,containerVisibleComputedSortedData$:f,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())}}),_u="PieEventTexts",oS=H(_u,"text"),Zz={name:_u,defaultParams:hg,layerIndex:bu,validator:(e,{validateColumns:t})=>t(e,{renderFn:{toBeTypes:["Function"]},textAttrs:{toBeTypes:["object[]"]},textStyles:{toBeTypes:["object[]"]}})};function bg(e,t){const n=e.selectAll(`text.${oS}`).data(t),r=n.enter().append("text").classed(oS,!0),i=n.merge(r);return i.each((o,a,s)=>{const l=X(s[a]).text(o.text);Object.keys(o.attr).forEach(u=>{l.attr(u,o.attr[u])}),Object.keys(o.style).forEach(u=>{l.style(u,o.style[u])})}),n.exit().remove(),i}function xg({eventData:e,renderFn:t,textAttrs:n,textStyles:r}){const i=t(e);return(Array.isArray(i)?i:[i]).map((a,s)=>({text:a,attr:n[s],style:r[s]}))}function Kz(e,t){const n=new Q;let r;const i=t.fullChartParams$.pipe(C(n),L(o=>o.highlightTarget),q());return O({computedData:t.computedData$,fullParams:t.fullParams$,fullChartParams:t.fullChartParams$,highlightTarget:i}).pipe(C(n),z(async o=>o)).subscribe(o=>{t.containerSelection.transition("move").duration(o.fullChartParams.transitionDuration).tween("move",(a,s)=>l=>{const u=xg({eventData:{type:"series",pluginName:e,eventName:"transitionMove",event:a,tween:l,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},renderFn:o.fullParams.renderFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});bg(t.containerSelection,u)}).on("end",(a,s)=>{const l=xg({eventData:{type:"series",pluginName:e,eventName:"transitionEnd",event:a,tween:1,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},renderFn:o.fullParams.renderFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});bg(t.containerSelection,l),r&&r.unsubscribe(),r=t.event$.subscribe(u=>{const c=xg({eventData:u,renderFn:o.fullParams.renderFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});bg(t.containerSelection,c)})})}),()=>{n.next(void 0)}}const Qz=Dn(Zz)(({selection:e,name:t,observer:n,subject:r})=>{const i=new Q,{seriesCenterSelection$:o}=$a({selection:e,pluginName:_u,visibleComputedSortedData$:n.visibleComputedSortedData$,seriesContainerPosition$:n.seriesContainerPosition$}),a=[];return o.pipe(C(i)).subscribe(s=>{a.forEach(l=>l()),s.each((l,u,c)=>{const h=X(c[u]),f=n.computedSortedData$.pipe(C(i),L(d=>d[u]??d[0])),p=n.seriesContainerPosition$.pipe(C(i),L(d=>d[u]??d[0]));a[u]=Kz(_u,{containerSelection:h,computedData$:n.computedData$,containerComputedSortedData$:f,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())}}),Gi="PieLabels",Jz=H(Gi,"label-g"),eO=H(Gi,"line-g"),tO=H(Gi,"text"),aS=2,nO={name:Gi,defaultParams:pg,layerIndex:bu,validator:(e,{validateColumns:t})=>t(e,{outerRadius:{toBeTypes:["number"]},outerRadiusWhileHighlight:{toBeTypes:["number"]},startAngle:{toBeTypes:["number"]},endAngle:{toBeTypes:["number"]},labelCentroid:{toBeTypes:["number"]},labelFn:{toBeTypes:["Function"]},labelColorType:{toBeOption:"ColorType"}})};function rO({pieData:e,arc:t,arcMouseover:n,labelCentroid:r,lineStartCentroid:i,fullParams:o}){return e.map((a,s)=>{const[l,u]=t.centroid(a),[c,h]=n.centroid(a),f=o.labelFn(a.data);return{pieDatum:a,arcIndex:s,arcLabels:f.split(`
384
+ `),lineStartX:l*i,lineStartY:u*i,lineStartMouseoverX:c*i,lineStartMouseoverY:h*i,x:l*r,y:u*r,mouseoverX:c*r,mouseoverY:h*r,textWidth:0,collisionShiftX:0,collisionShiftY:0,quadrant:l>=0&&u<=0?1:l<0&&u<=0?2:l<0&&u>0?3:4}}).filter(a=>a.pieDatum.data.visible)}function iO({labelGSelection:e,data:t,fullParams:n,fullChartParams:r,textSizePx:i}){const o=e.selectAll("text").data(t,a=>a.pieDatum.id).join("text").classed(tO,!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)=>Se({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).each((a,s,l)=>{Fv(X(l[s]),{textArr:a.arcLabels,textSizePx:i,quadrant:a.quadrant})});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function oO(e,t,n){const r=e.nodes(),i=n,o=r.map((a,s)=>{const l=a.getBBox(),u=[t[s].x,t[s].y];return{node:a,x:u[0],y:u[1],width:l.width,height:l.height}});for(let a=0;a<o.length;a++){const s=o[a];for(let l=a+1;l<o.length;l++){const u=o[l];t[a].textWidth=s.width;const c=s.x+t[a].collisionShiftX,h=s.y+t[a].collisionShiftY,f=u.x+t[l].collisionShiftX,p=u.y+t[l].collisionShiftY;if(!(c+s.width/2<f-u.width/2||c-s.width/2>f+u.width/2||h+s.height/2<p-u.height/2||h-s.height/2>p+u.height/2)){if(t[l].quadrant==2){const d=p>h?-i*2:-i;t[l].collisionShiftY+=d}else if(t[l].quadrant==4){const d=p>h?i:i*2;t[l].collisionShiftY+=d}}}}for(let a=o.length-1;a>=0;a--){const s=o[a];for(let l=a-1;l>=0;l--){const u=o[l];t[a].textWidth=s.width;const c=s.x+t[a].collisionShiftX,h=s.y+t[a].collisionShiftY,f=u.x+t[l].collisionShiftX,p=u.y+t[l].collisionShiftY;if(!(c+s.width/2<f-u.width/2||c-s.width/2>f+u.width/2||h+s.height/2<p-u.height/2||h-s.height/2>p+u.height/2)){if(t[l].quadrant==1){const d=p>h?-i*2:-i;t[l].collisionShiftY+=d}else if(t[l].quadrant==3){const d=p>h?i:i*2;t[l].collisionShiftY+=d}}}}e.data(t).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function aO({lineGSelection:e,data:t,fullParams:n,fullChartParams:r}){const i=t.filter(a=>a.collisionShiftX||a.collisionShiftY),o=e.selectAll("polyline").data(i,a=>a.pieDatum.id).join("polyline").attr("stroke",a=>Se({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,l=a.y+a.collisionShiftY;return[[s,l],[a.lineStartX,a.lineStartY]]}),o}function sO({textSelection:e,lineSelection:t,ids:n,fullChartParams:r}){if(e.interrupt("highlight"),t.interrupt("highlight"),!n.length){e.transition("highlight").duration(200).attr("transform",i=>`translate(${i.x+i.collisionShiftX},${i.y+i.collisionShiftY})`).style("opacity",1),t.transition("highlight").duration(200).style("opacity",1);return}e.each((i,o,a)=>{const s=X(a[o]);n.includes(i.pieDatum.id)?s.style("opacity",1).transition("highlight").duration(200).attr("transform",l=>l.collisionShiftX||l.collisionShiftY?`translate(${l.x+l.collisionShiftX},${l.y+l.collisionShiftY})`:`translate(${l.mouseoverX+l.collisionShiftX},${l.mouseoverY+l.collisionShiftY})`):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200).attr("transform",l=>`translate(${l.x+l.collisionShiftX},${l.y+l.collisionShiftY})`)}),t.each((i,o,a)=>{const s=X(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 lO(e,t){const n=new Q;t.containerSelection.selectAll("g").remove();const r=t.containerSelection.append("g");r.classed(eO,!0);const i=t.containerSelection.append("g");i.classed(Jz,!0);const o=new Q,a=new Q;let s=[];const l=t.seriesContainerPosition$.pipe(C(n),L(c=>c.width<c.height?c.width:c.height),q()),u=t.fullParams$.pipe(C(n),L(c=>c.labelCentroid>=aS?aS:c.labelCentroid));return O({shorterSideWith:l,containerVisibleComputedSortedData:t.containerVisibleComputedSortedData$,fullParams:t.fullParams$,fullChartParams:t.fullChartParams$,textSizePx:t.textSizePx$,lineStartCentroid:u}).pipe(C(n),z(async c=>c)).subscribe(c=>{const h=mu({axisWidth:c.shorterSideWith,innerRadius:0,outerRadius:c.fullParams.outerRadius,padAngle:0,cornerRadius:0}),f=mu({axisWidth:c.shorterSideWith,innerRadius:0,outerRadius:c.fullParams.outerRadiusWhileHighlight,padAngle:0,cornerRadius:0}),p=rS({data:c.containerVisibleComputedSortedData,startAngle:c.fullParams.startAngle,endAngle:c.fullParams.endAngle});s=rO({pieData:p,arc:h,arcMouseover:f,labelCentroid:c.fullParams.labelCentroid,lineStartCentroid:c.lineStartCentroid,fullParams:c.fullParams}),r.selectAll("polyline").remove();const d=iO({labelGSelection:i,data:s,fullParams:c.fullParams,fullChartParams:c.fullChartParams,textSizePx:c.textSizePx});setTimeout(()=>{oO(d,s,c.textSizePx);const m=aO({lineGSelection:r,data:s,fullParams:c.fullParams,fullChartParams:c.fullChartParams});a.next(m)},1e3),o.next(d)}),O({textSelection:o,lineSelection:a,highlight:t.seriesHighlight$.pipe(L(c=>c.map(h=>h.id))),fullChartParams:t.fullChartParams$}).pipe(C(n),z(async c=>c)).subscribe(c=>{sO({textSelection:c.textSelection,lineSelection:c.lineSelection,ids:c.highlight,fullChartParams:c.fullChartParams})}),()=>{n.next(void 0)}}const uO=Dn(nO)(({selection:e,observer:t,subject:n})=>{const r=new Q,{seriesCenterSelection$:i}=$a({selection:e,pluginName:Gi,visibleComputedSortedData$:t.visibleComputedSortedData$,seriesContainerPosition$:t.seriesContainerPosition$}),o=[];return i.pipe(C(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,l,u)=>{const c=X(u[l]),h=t.visibleComputedSortedData$.pipe(C(r),L(p=>p[l]??p[0])),f=t.seriesContainerPosition$.pipe(C(r),L(p=>p[l]??p[0]));o[l]=lO(Gi,{containerSelection:c,containerVisibleComputedSortedData$:h,fullParams$:t.fullParams$,fullChartParams$:t.fullChartParams$,textSizePx$:t.textSizePx$,seriesHighlight$:t.seriesHighlight$,seriesContainerPosition$:f,event$:n.event$})})}),()=>{r.next(void 0)}}),$g="Rose",cO=Math.PI*2,fO={name:$g,defaultParams:eS,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{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 hO({cornerRadius:e,outerRadius:t,axisWidth:n,maxValue:r,arcScaleType:i,fullParams:o}){const a=n/2*t,s=i==="area"?.5:1,l=yn().domain([0,r]).range([0,a]).exponent(s);return u=>{const c=l(u.prevValue),h=l(u.value),f=ln(c,h);return p=>{const d=f(p);return iu().innerRadius(0).outerRadius(d).padAngle(o.padAngle).padRadius(d).cornerRadius(e)(u)}}}function pO({pathSelection:e,ids:t,fullParams:n,fullChartParams:r,tweenArc:i}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").style("opacity",1).attr("d",o=>i(o)(1));return}e.each((o,a,s)=>{const l=X(s[a]);t.includes(o.data.id)?l.style("opacity",1).transition("highlight").ease(lr).duration(500).attr("d",u=>i({...u,startAngle:u.startAngle-n.angleIncreaseWhileHighlight,endAngle:u.endAngle+n.angleIncreaseWhileHighlight})(1)):l.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").attr("d",u=>i(u)(1))})}function gO(e,t){const n=new Q,r=H(e,"path");let i=[];const o=t.seriesContainerPosition$.pipe(C(n),L(p=>p.width<p.height?p.width:p.height),q()),a=O({containerVisibleComputedSortedData:t.containerVisibleComputedSortedData$,fullParams:t.fullParams$}).pipe(C(n),z(async p=>p),L(p=>{const d=cO/p.containerVisibleComputedSortedData.length;return p.containerVisibleComputedSortedData.map((m,g)=>({id:m.id,data:m,index:g,value:m.value,startAngle:d*g,endAngle:d*(g+1),padAngle:p.fullParams.padAngle,prevValue:i[g]&&i[g].id===m.id?i[g].value:0}))})),s=t.fullChartParams$.pipe(C(n),L(p=>p.highlightTarget),q()),l=t.visibleComputedSortedData$.pipe(L(p=>Math.max(...p.flat().map(d=>d.value))),q()),u=O({fullParams:t.fullParams$,axisWidth:o,maxValue:l}).pipe(C(n),z(async p=>p),L(p=>hO({cornerRadius:p.fullParams.cornerRadius,outerRadius:p.fullParams.outerRadius,axisWidth:p.axisWidth,maxValue:p.maxValue,arcScaleType:p.fullParams.arcScaleType,fullParams:p.fullParams}))),c=t.fullChartParams$.pipe(C(n),L(p=>p.transitionDuration),q()),h=new Eu(!1),f=new me(p=>{O({pieData:a,tweenArc:u,transitionDuration:c,fullParams:t.fullParams$,fullChartParams:t.fullChartParams$}).pipe(C(n),z(async d=>d)).subscribe(d=>{const m=d.pieData.map((y,b)=>(y.prevValue=i[b]&&i[b].id===y.id?i[b].value:0,y));h.next(!0);const g=t.containerSelection.selectAll("path").data(m,y=>y.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(y,b)=>y.data.color).attr("stroke",(y,b)=>Se({datum:y.data,colorType:d.fullParams.strokeColorType,fullChartParams:d.fullChartParams})).attr("stroke-width",d.fullParams.strokeWidth);g.interrupt("graphicMove"),g.transition("graphicMove").duration(d.transitionDuration).attrTween("d",d.tweenArc).on("end",()=>{p.next(g),h.next(!1)}),i=Object.assign([],m)})}).pipe(ne(1));return O({pathSelection:f,SeriesDataMap:t.SeriesDataMap$,computedData:t.computedData$,highlightTarget:s}).pipe(C(n),z(async p=>p)).subscribe(p=>{p.pathSelection.on("mouseover",(d,m)=>{d.stopPropagation(),t.event$.next({type:"series",eventName:"mouseover",pluginName:e,highlightTarget:p.highlightTarget,datum:m.data,series:p.SeriesDataMap.get(m.data.seriesLabel),seriesIndex:m.data.seriesIndex,seriesLabel:m.data.seriesLabel,event:d,data:p.computedData})}).on("mousemove",(d,m)=>{d.stopPropagation(),t.event$.next({type:"series",eventName:"mousemove",pluginName:e,highlightTarget:p.highlightTarget,datum:m.data,series:p.SeriesDataMap.get(m.data.seriesLabel),seriesIndex:m.data.seriesIndex,seriesLabel:m.data.seriesLabel,event:d,data:p.computedData})}).on("mouseout",(d,m)=>{d.stopPropagation(),t.event$.next({type:"series",eventName:"mouseout",pluginName:e,highlightTarget:p.highlightTarget,datum:m.data,series:p.SeriesDataMap.get(m.data.seriesLabel),seriesIndex:m.data.seriesIndex,seriesLabel:m.data.seriesLabel,event:d,data:p.computedData})}).on("click",(d,m)=>{d.stopPropagation(),t.event$.next({type:"series",eventName:"click",pluginName:e,highlightTarget:p.highlightTarget,datum:m.data,series:p.SeriesDataMap.get(m.data.seriesLabel),seriesIndex:m.data.seriesIndex,seriesLabel:m.data.seriesLabel,event:d,data:p.computedData})})}),O({pathSelection:f,highlight:t.seriesHighlight$.pipe(L(p=>p.map(d=>d.id))),fullParams:t.fullParams$,fullChartParams:t.fullChartParams$,tweenArc:u,isTransitionMoving:h}).pipe(C(n),z(async p=>p),Er(p=>!p.isTransitionMoving)).subscribe(p=>{pO({pathSelection:p.pathSelection,ids:p.highlight,fullParams:p.fullParams,fullChartParams:p.fullChartParams,tweenArc:p.tweenArc})}),()=>{n.next(void 0)}}const dO=Dn(fO)(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,{seriesCenterSelection$:o}=$a({selection:e,pluginName:$g,visibleComputedSortedData$:r.visibleComputedSortedData$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(C(i)).subscribe(s=>{a.forEach(l=>l()),s.each((l,u,c)=>{const h=X(c[u]),f=r.visibleComputedSortedData$.pipe(C(i),L(d=>JSON.parse(JSON.stringify(d[u]??d[0])))),p=r.seriesContainerPosition$.pipe(C(i),L(d=>JSON.parse(JSON.stringify(d[u]??d[0]))));a[u]=gO($g,{containerSelection:h,computedData$:r.computedData$,visibleComputedSortedData$:r.visibleComputedSortedData$,containerVisibleComputedSortedData$:f,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())}}),Wi="RoseLabels",mO=H(Wi,"label-g"),yO=H(Wi,"line-g"),bO=H(Wi,"text"),sS=2,xO={name:Wi,defaultParams:gg,layerIndex:bu,validator:(e,{validateColumns:t})=>t(e,{outerRadius:{toBeTypes:["number"]},labelCentroid:{toBeTypes:["number"]},labelFn:{toBeTypes:["Function"]},labelColorType:{toBeOption:"ColorType"},arcScaleType:{toBe:'"area" | "radius"',test:r=>r==="area"||r==="radius"}})};function $O({pieData:e,labelCentroid:t,arcScaleType:n,maxValue:r,axisWidth:i,outerRadius:o,lineStartCentroid:a,fullParams:s}){const l=i/2*o,u=n==="area"?.5:1,c=yn().domain([0,r]).range([0,l]).exponent(u);return e.map((h,f)=>{const p=c(h.value),d=iu().innerRadius(0).outerRadius(p).padAngle(0).padRadius(p).cornerRadius(0),[m,g]=d.centroid(h),[y,b]=[m,g],x=s.labelFn(h.data);return{pieDatum:h,arcIndex:f,arcLabels:x.split(`
385
+ `),lineStartX:m*a,lineStartY:g*a,lineStartMouseoverX:y*a,lineStartMouseoverY:b*a,x:m*t,y:g*t,mouseoverX:y*t,mouseoverY:b*t,textWidth:0,collisionShiftX:0,collisionShiftY:0,quadrant:m>=0&&g<=0?1:m<0&&g<=0?2:m<0&&g>0?3:4}}).filter(h=>h.pieDatum.data.visible)}function vO({labelGSelection:e,data:t,fullParams:n,fullChartParams:r,textSizePx:i}){const o=e.selectAll("text").data(t,a=>a.pieDatum.id).join("text").classed(bO,!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)=>Se({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).each((a,s,l)=>{Fv(X(l[s]),{textArr:a.arcLabels,textSizePx:i,quadrant:a.quadrant})});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function SO(e,t,n){const r=e.nodes(),i=n,o=r.map((a,s)=>{const l=a.getBBox(),u=[t[s].x,t[s].y];return{node:a,x:u[0],y:u[1],width:l.width,height:l.height}});for(let a=0;a<o.length;a++){const s=o[a];for(let l=a+1;l<o.length;l++){const u=o[l];t[a].textWidth=s.width;const c=s.x+t[a].collisionShiftX,h=s.y+t[a].collisionShiftY,f=u.x+t[l].collisionShiftX,p=u.y+t[l].collisionShiftY;if(!(c+s.width/2<f-u.width/2||c-s.width/2>f+u.width/2||h+s.height/2<p-u.height/2||h-s.height/2>p+u.height/2)){if(t[l].quadrant==2){const d=p>h?-i*2:-i;t[l].collisionShiftY+=d}else if(t[l].quadrant==4){const d=p>h?i:i*2;t[l].collisionShiftY+=d}}}}for(let a=o.length-1;a>=0;a--){const s=o[a];for(let l=a-1;l>=0;l--){const u=o[l];t[a].textWidth=s.width;const c=s.x+t[a].collisionShiftX,h=s.y+t[a].collisionShiftY,f=u.x+t[l].collisionShiftX,p=u.y+t[l].collisionShiftY;if(!(c+s.width/2<f-u.width/2||c-s.width/2>f+u.width/2||h+s.height/2<p-u.height/2||h-s.height/2>p+u.height/2)){if(t[l].quadrant==1){const d=p>h?-i*2:-i;t[l].collisionShiftY+=d}else if(t[l].quadrant==3){const d=p>h?i:i*2;t[l].collisionShiftY+=d}}}}e.data(t).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function TO({lineGSelection:e,data:t,fullParams:n,fullChartParams:r}){const i=t.filter(a=>a.collisionShiftX||a.collisionShiftY),o=e.selectAll("polyline").data(i,a=>a.pieDatum.id).join("polyline").attr("stroke",a=>Se({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,l=a.y+a.collisionShiftY;return[[s,l],[a.lineStartX,a.lineStartY]]}),o}function _O({textSelection:e,lineSelection:t,ids:n,fullChartParams:r}){if(e.interrupt("highlight"),t.interrupt("highlight"),!n.length){e.transition("highlight").duration(200).attr("transform",i=>`translate(${i.x+i.collisionShiftX},${i.y+i.collisionShiftY})`).style("opacity",1),t.transition("highlight").duration(200).style("opacity",1);return}e.each((i,o,a)=>{const s=X(a[o]);n.includes(i.pieDatum.data.id)?s.style("opacity",1).transition("highlight").duration(200).attr("transform",l=>`translate(${l.mouseoverX+l.collisionShiftX},${l.mouseoverY+l.collisionShiftY})`):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200).attr("transform",l=>`translate(${l.x+l.collisionShiftX},${l.y+l.collisionShiftY})`)}),t.each((i,o,a)=>{const s=X(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 AO(e,t){const n=new Q;t.containerSelection.selectAll("g").remove();const r=t.containerSelection.append("g");r.classed(yO,!0);const i=t.containerSelection.append("g");i.classed(mO,!0);const o=new Q,a=new Q;let s=[];const l=t.seriesContainerPosition$.pipe(C(n),L(h=>h.width<h.height?h.width:h.height),q()),u=t.visibleComputedSortedData$.pipe(L(h=>Math.max(...h.flat().map(f=>f.value))),q()),c=t.fullParams$.pipe(C(n),L(h=>h.labelCentroid>=sS?sS:h.labelCentroid));return O({shorterSideWith:l,containerVisibleComputedSortedData:t.containerVisibleComputedSortedData$,maxValue:u,fullParams:t.fullParams$,fullChartParams:t.fullChartParams$,textSizePx:t.textSizePx$,lineStartCentroid:c}).pipe(C(n),z(async h=>h)).subscribe(h=>{const f=Math.PI*2/h.containerVisibleComputedSortedData.length,p=h.containerVisibleComputedSortedData.map((m,g)=>({id:m.id,data:m,index:g,value:m.value,startAngle:f*g,endAngle:f*(g+1),padAngle:0}));s=$O({pieData:p,labelCentroid:h.fullParams.labelCentroid,arcScaleType:h.fullParams.arcScaleType,maxValue:h.maxValue,axisWidth:h.shorterSideWith,outerRadius:h.fullParams.outerRadius,lineStartCentroid:h.lineStartCentroid,fullParams:h.fullParams}),r.selectAll("polyline").remove();const d=vO({labelGSelection:i,data:s,fullParams:h.fullParams,fullChartParams:h.fullChartParams,textSizePx:h.textSizePx});setTimeout(()=>{SO(d,s,h.textSizePx);const m=TO({lineGSelection:r,data:s,fullParams:h.fullParams,fullChartParams:h.fullChartParams});a.next(m)},1e3),o.next(d)}),O({textSelection:o,lineSelection:a,highlight:t.seriesHighlight$.pipe(L(h=>h.map(f=>f.id))),fullChartParams:t.fullChartParams$}).pipe(C(n),z(async h=>h)).subscribe(h=>{_O({textSelection:h.textSelection,lineSelection:h.lineSelection,ids:h.highlight,fullChartParams:h.fullChartParams})}),()=>{n.next(void 0)}}const wO=Dn(xO)(({selection:e,observer:t,subject:n})=>{const r=new Q,{seriesCenterSelection$:i}=$a({selection:e,pluginName:Wi,visibleComputedSortedData$:t.visibleComputedSortedData$,seriesContainerPosition$:t.seriesContainerPosition$}),o=[];return i.pipe(C(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,l,u)=>{const c=X(u[l]),h=t.visibleComputedSortedData$.pipe(C(r),L(p=>JSON.parse(JSON.stringify(p[l]??p[0])))),f=t.seriesContainerPosition$.pipe(C(r),L(p=>JSON.parse(JSON.stringify(p[l]??p[0]))));o[l]=AO(Wi,{containerSelection:c,visibleComputedSortedData$:t.visibleComputedSortedData$,containerVisibleComputedSortedData$:h,fullParams$:t.fullParams$,fullChartParams$:t.fullChartParams$,textSizePx$:t.textSizePx$,seriesHighlight$:t.seriesHighlight$,seriesContainerPosition$:f,event$:n.event$})})}),()=>{r.next(void 0)}}),lS="SeriesLegend",PO=Dn({name:lS,defaultParams:tS,layerIndex:ki,validator:(e,{validateColumns:t})=>t(e,{placement:{toBe:'"top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end"',test:r=>["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].includes(r)},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:e,rootSelection:t,observer:n,subject:r})=>{const i=new Q,o=n.SeriesDataMap$.pipe(C(i),L(l=>Array.from(l.keys()))),a=n.fullParams$.pipe(C(i),L(l=>{const u=[{listRectWidth:l.listRectWidth,listRectHeight:l.listRectHeight,listRectRadius:l.listRectRadius}];return{...l,labelList:u}})),s=Ii(lS,{rootSelection:t,legendLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),uS="SeriesTooltip",DO=Dn({name:uS,defaultParams:dg,layerIndex:Ri,validator:(e,{validateColumns:t})=>t(e,{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"},renderFn:{toBeTypes:["Function"]}})})(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q,a=Bi(uS,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),vg={paddingInner:2,paddingOuter:2,labelColorType:"labelContrast",squarifyRatio:1.618034,sort:(e,t)=>t.value-e.value};vg.sort.toString=()=>"(a, b) => b.value - a.value";const cS={placement:"right-end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},Sg={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(e,{styles:t,utils:n})=>{const r=!!e.categoryLabel,i=!!e.datum.label,o=n.toCurrency(e.datum.value),a=t.textSizePx*.7,s=t.textSizePx/2-a/2,l=r?`<rect width="${a}" height="${a}" x="${s}" y="${s-1}" rx="${a/2}" fill="${e.datum.color}"></rect>
386
386
  <text x="${t.textSizePx*1.5}" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
387
387
  <tspan>${e.categoryLabel}</tspan>
388
- </text>`:"",u=i?`<tspan>${e.datum.label}</tspan> `:"",c=r?n.measureTextWidth(`${e.categoryLabel}${o}`,t.textSizePx)+t.textSizePx*1.5:0,h=i?n.measureTextWidth(`${e.datum.label}${o}`,t.textSizePx):0,f=Math.max(c,h),p=i?f+t.textSizePx*.5:0,g=i?"end":"start",m=`<text font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
389
- ${u}<tspan font-weight="bold" text-anchor="${g}" x="${p}">${o}</tspan>
388
+ </text>`:"",u=i?`<tspan>${e.datum.label}</tspan> `:"",c=r?n.measureTextWidth(`${e.categoryLabel}${o}`,t.textSizePx)+t.textSizePx*1.5:0,h=i?n.measureTextWidth(`${e.datum.label}${o}`,t.textSizePx):0,f=Math.max(c,h),p=i?f+t.textSizePx*.5:0,d=i?"end":"start",m=`<text font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
389
+ ${u}<tspan font-weight="bold" text-anchor="${d}" x="${p}">${o}</tspan>
390
390
  </text>`;return`${l}
391
391
  <g ${r?`transform="translate(0, ${t.textSizePx*2})"`:""}>
392
392
  ${m}
@@ -424,4 +424,4 @@ ${h}`}};Zp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
424
424
  <g \${hasCategoryLabel ? \`transform="translate(0, \${styles.textSizePx * 2})"\` : ''}>
425
425
  \${datumSvg}
426
426
  </g>\`
427
- }`;const f2="TreeLegend",LO=_c({name:f2,defaultParams:c2,layerIndex:Mi,validator:(e,{validateColumns:t})=>t(e,{placement:{toBe:'"top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end"',test:r=>["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].includes(r)},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:e,rootSelection:t,observer:n,subject:r})=>{const i=new Q,o=n.fullParams$.pipe(C(i),L(s=>{const l=[{listRectWidth:s.listRectWidth,listRectHeight:s.listRectHeight,listRectRadius:s.listRectRadius}];return{...s,labelList:l}})),a=Ri(f2,{rootSelection:t,legendLabels$:n.categoryLabels$,fullParams$:o,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),a()}}),Cr="TreeMap",h2=H(Cr,"tree"),p2=H(Cr,"tile"),MO={name:Cr,defaultParams:vg,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{paddingInner:{toBeTypes:["number"]},paddingOuter:{toBeTypes:["number"]},labelColorType:{toBeOption:"ColorType"},squarifyRatio:{toBeTypes:["number"]},sort:{toBeTypes:["Function"]}})};function kO({selection:e,treeData:t,fullParams:n,fullChartParams:r,textSizePx:i}){const o=i/2,a=i,s=e.selectAll(`g.${h2}`).data(t,l=>l.data.id).join("g").attr("class",h2);return s.attr("transform",l=>!l.x0||!l.y0?null:`translate(${l.x0},${l.y0})`).each((l,u,c)=>{const h=X(c[u]);h.selectAll(`rect.${p2}`).data([l],f=>f.data.id).join("rect").attr("id",f=>f.data.id).attr("class",p2).attr("cursor","pointer").attr("width",f=>f.x1-f.x0).attr("height",f=>f.y1-f.y0).attr("fill",f=>f.data.color).attr("data-name",f=>f.data.label).attr("data-category",f=>f.data.categoryLabel).attr("data-value",f=>f.data.value),h.selectAll("g").data([l]).join("g").each((f,p,g)=>{X(g[p]).selectAll("text").data([f]).join("text").text(d=>d.data.label).attr("dominant-baseline","hanging").attr("x",o).attr("y",o).attr("font-size",r.styles.textSize).each(function(d){const y=X(this),b=d.data.label.split(/\s+/).reverse();let x,$=[];const S=y.attr("x");let _=y.attr("y"),A=0,w=y.text(null).append("tspan").attr("cursor","pointer").attr("fill",Se({colorType:n.labelColorType,datum:d.data,fullChartParams:r})).attr("font-size",r.styles.textSize).attr("x",S).attr("y",_);for(;x=b.pop();)$.push(x),w.text($.join(" ")),w.node().getComputedTextLength()>d.x1-d.x0-o&&($.pop(),w.text($.join(" ")),$=[x],A+=a,w=y.append("tspan").attr("cursor","pointer").attr("fill",Se({colorType:n.labelColorType,datum:d.data,fullChartParams:r})).attr("font-size",r.styles.textSize).attr("x",S).attr("y",_).attr("dy",A+"px").text(x))})})}),s}function RO({selection:e,ids:t,fullChartParams:n}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").duration(200).style("opacity",1);return}e.each((r,i,o)=>{t.includes(r.data.id)?X(o[i]).style("opacity",1):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const IO=_c(MO)(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=G({layout:r.layout$,visibleComputedData:r.visibleComputedData$,fullParams:r.fullParams$,fullDataFormatter:r.fullDataFormatter$,fullChartParams:r.fullChartParams$}).pipe(C(i),z(async l=>l),L(l=>{const u=F1().size([l.layout.width,l.layout.height]).paddingInner(l.fullParams.paddingInner).paddingOuter(l.fullParams.paddingOuter).round(!0).tile(Xh.ratio(l.fullParams.squarifyRatio)),c=Bl(l.visibleComputedData).sum(f=>f.value).sort(l.fullParams.sort);return u(c),c.leaves()})),a=G({selection:Ct(e),treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,textSizePx:r.textSizePx$}).pipe(C(i),z(async l=>l),L(l=>kO({selection:e,treeData:l.treeData,fullParams:l.fullParams,fullChartParams:l.fullChartParams,textSizePx:l.textSizePx}))),s=r.fullChartParams$.pipe(C(i),L(l=>l.highlightTarget),Z());return G({cellSelection:a,computedData:r.computedData$,treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,highlightTarget:s,CategoryDataMap:r.CategoryDataMap$}).pipe(C(i),z(async l=>l)).subscribe(l=>{l.cellSelection.on("mouseover",(u,c)=>{u.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseover",pluginName:Cr,highlightTarget:l.highlightTarget,datum:c.data,category:l.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:u,data:l.computedData})}).on("mousemove",(u,c)=>{u.stopPropagation(),n.event$.next({type:"tree",eventName:"mousemove",pluginName:Cr,highlightTarget:l.highlightTarget,datum:c.data,category:l.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:u,data:l.computedData})}).on("mouseout",(u,c)=>{u.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseout",pluginName:Cr,highlightTarget:l.highlightTarget,datum:c.data,category:l.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:u,data:l.computedData})}).on("click",(u,c)=>{u.stopPropagation(),n.event$.next({type:"tree",eventName:"click",pluginName:Cr,highlightTarget:l.highlightTarget,datum:c.data,category:l.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:u,data:l.computedData})})}),G({cellSelection:a,highlight:r.treeHighlight$.pipe(L(l=>l.map(u=>u.id))),fullChartParams:r.fullChartParams$}).pipe(C(i),z(async l=>l)).subscribe(l=>{RO({selection:l.cellSelection,ids:l.highlight,fullChartParams:l.fullChartParams})}),()=>{i.next(void 0)}}),g2="TreeTooltip",EO=_c({name:g2,defaultParams:Sg,layerIndex:ki,validator:(e,{validateColumns:t})=>t(e,{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"},renderFn:{toBeTypes:["Function"]}})})(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q,a=Ei(g2,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}});U.Bars=QE,U.BarsPN=JE,U.BarsTriangle=gB,U.Bubbles=Yz,U.CONTAINER_PLUGIN_PARAMS=YF,U.DEFAULT_BARS_DIVERGING_PARAMS=d2,U.DEFAULT_BARS_PARAMS=Sa,U.DEFAULT_BARS_TRIANGLE_PARAMS=wg,U.DEFAULT_BUBBLES_PARAMS=QS,U.DEFAULT_DOTS_PARAMS=_g,U.DEFAULT_FORCE_DIRECTED_BUBBLES_PARAMS=zi,U.DEFAULT_FORCE_DIRECTED_PARAMS=Fi,U.DEFAULT_GRID_LEGEND_PARAMS=Cg,U.DEFAULT_GRID_TOOLTIP_PARAMS=Pu,U.DEFAULT_GROUP_AUX_PARAMS=Au,U.DEFAULT_GROUP_AXIS_PARAMS=wu,U.DEFAULT_GROUP_ZOOM_PARAMS=Dg,U.DEFAULT_LINES_PARAMS=Lr,U.DEFAULT_LINE_AREAS_PARAMS=Tg,U.DEFAULT_MULTI_BARS_PARAMS=jv,U.DEFAULT_MULTI_BARS_TRIANGLE_PARAMS=qv,U.DEFAULT_MULTI_DOTS_PARAMS=Qv,U.DEFAULT_MULTI_GRID_LEGEND_PARAMS=Uv,U.DEFAULT_MULTI_GRID_TOOLTIP_PARAMS=Fp,U.DEFAULT_MULTI_GROUP_AXIS_PARAMS=Bp,U.DEFAULT_MULTI_LINES_PARAMS=Zv,U.DEFAULT_MULTI_LINE_AREAS_PARAMS=Kv,U.DEFAULT_MULTI_STACKED_BARS_PARAMS=Hv,U.DEFAULT_MULTI_STACKED_VALUE_AXIS_PARAMS=WB,U.DEFAULT_MULTI_VALUE_AXIS_PARAMS=ya,U.DEFAULT_MULTI_VALUE_LEGEND_PARAMS=yS,U.DEFAULT_MULTI_VALUE_TOOLTIP_PARAMS=Zp,U.DEFAULT_ORDINAL_AUX_PARAMS=Kp,U.DEFAULT_ORDINAL_AXIS_PARAMS=Qp,U.DEFAULT_ORDINAL_BUBBLES_PARAMS=bS,U.DEFAULT_ORDINAL_ZOOM_PARAMS=lN,U.DEFAULT_OVERLAPPING_STACKED_VALUE_AXES_PARAMS=Jv,U.DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS=Np,U.DEFAULT_PIE_EVENT_TEXTS_PARAMS=hg,U.DEFAULT_PIE_LABELS_PARAMS=pg,U.DEFAULT_PIE_PARAMS=JS,U.DEFAULT_RACING_BARS_PARAMS=Jp,U.DEFAULT_RACING_COUNTER_TEXTS_PARAMS=eg,U.DEFAULT_RACING_VALUE_AXIS_PARAMS=tg,U.DEFAULT_RELATIONSHIP_LEGEND_PARAMS=ES,U.DEFAULT_RELATIONSHIP_TOOLTIP_PARAMS=fg,U.DEFAULT_ROSE_LABELS_PARAMS=gg,U.DEFAULT_ROSE_PARAMS=e2,U.DEFAULT_SCATTER_BUBBLES_PARAMS=$S,U.DEFAULT_SCATTER_PARAMS=xS,U.DEFAULT_SERIES_LEGEND_PARAMS=t2,U.DEFAULT_SERIES_TOOLTIP_PARAMS=dg,U.DEFAULT_STACKED_BARS_PARAMS=Ag,U.DEFAULT_STACKED_VALUE_AXIS_PARAMS=Pg,U.DEFAULT_TREE_LEGEND_PARAMS=c2,U.DEFAULT_TREE_MAP_PARAMS=vg,U.DEFAULT_TREE_TOOLTIP_PARAMS=Sg,U.DEFAULT_VALUE_AXIS_PARAMS=Ta,U.DEFAULT_X_AXIS_PARAMS=ng,U.DEFAULT_X_Y_AUX_PARAMS=$u,U.DEFAULT_X_Y_AXES_PARAMS=vu,U.DEFAULT_X_ZOOM_PARAMS=rg,U.Dots=bB,U.ForceDirected=hz,U.ForceDirectedBubbles=Rz,U.GridLegend=vB,U.GridTooltip=kB,U.GroupAux=GB,U.GroupAxis=AB,U.GroupZoom=RB,U.LineAreas=XE,U.Lines=FE,U.MultiBars=YB,U.MultiBarsTriangle=UB,U.MultiDots=qB,U.MultiGridLegend=VB,U.MultiGridTooltip=QB,U.MultiGroupAxis=ZB,U.MultiLineAreas=HB,U.MultiLines=jB,U.MultiStackedBars=XB,U.MultiStackedValueAxis=JB,U.MultiValueAxis=KB,U.MultiValueLegend=uN,U.MultiValueTooltip=cN,U.OrdinalAux=vN,U.OrdinalAxis=CN,U.OrdinalBubbles=WN,U.OrdinalZoom=VN,U.OverlappingStackedValueAxes=sN,U.OverlappingValueAxes=aN,U.Pie=Zz,U.PieEventTexts=Jz,U.PieLabels=cO,U.RacingBars=eF,U.RacingCounterTexts=oF,U.RacingValueAxis=pF,U.RelationshipLegend=Iz,U.RelationshipTooltip=Ez,U.Rose=mO,U.RoseLabels=PO,U.Scatter=bF,U.ScatterBubbles=_F,U.SeriesLegend=DO,U.SeriesTooltip=CO,U.StackedBars=aB,U.StackedValueAxis=LB,U.TOOLTIP_PARAMS=IS,U.TreeLegend=LO,U.TreeMap=IO,U.TreeTooltip=EO,U.ValueAxis=CB,U.XAxis=AF,U.XYAux=RF,U.XYAxes=WF,U.XZoom=VF,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"})});
427
+ }`;const fS="TreeLegend",CO=_c({name:fS,defaultParams:cS,layerIndex:ki,validator:(e,{validateColumns:t})=>t(e,{placement:{toBe:'"top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end"',test:r=>["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].includes(r)},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:e,rootSelection:t,observer:n,subject:r})=>{const i=new Q,o=n.fullParams$.pipe(C(i),L(s=>{const l=[{listRectWidth:s.listRectWidth,listRectHeight:s.listRectHeight,listRectRadius:s.listRectRadius}];return{...s,labelList:l}})),a=Ii(fS,{rootSelection:t,legendLabels$:n.categoryLabels$,fullParams$:o,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),a()}}),Cr="TreeMap",hS=H(Cr,"tree"),pS=H(Cr,"tile"),LO={name:Cr,defaultParams:vg,layerIndex:at,validator:(e,{validateColumns:t})=>t(e,{paddingInner:{toBeTypes:["number"]},paddingOuter:{toBeTypes:["number"]},labelColorType:{toBeOption:"ColorType"},squarifyRatio:{toBeTypes:["number"]},sort:{toBeTypes:["Function"]}})};function MO({selection:e,treeData:t,fullParams:n,fullChartParams:r,textSizePx:i}){const o=i/2,a=i,s=e.selectAll(`g.${hS}`).data(t,l=>l.data.id).join("g").attr("class",hS);return s.attr("transform",l=>!l.x0||!l.y0?null:`translate(${l.x0},${l.y0})`).each((l,u,c)=>{const h=X(c[u]);h.selectAll(`rect.${pS}`).data([l],f=>f.data.id).join("rect").attr("id",f=>f.data.id).attr("class",pS).attr("cursor","pointer").attr("width",f=>f.x1-f.x0).attr("height",f=>f.y1-f.y0).attr("fill",f=>f.data.color).attr("data-name",f=>f.data.label).attr("data-category",f=>f.data.categoryLabel).attr("data-value",f=>f.data.value),h.selectAll("g").data([l]).join("g").each((f,p,d)=>{X(d[p]).selectAll("text").data([f]).join("text").text(g=>g.data.label).attr("dominant-baseline","hanging").attr("x",o).attr("y",o).attr("font-size",r.styles.textSize).each(function(g){const y=X(this),b=g.data.label.split(/\s+/).reverse();let x,$=[];const S=y.attr("x");let _=y.attr("y"),A=0,w=y.text(null).append("tspan").attr("cursor","pointer").attr("fill",Se({colorType:n.labelColorType,datum:g.data,fullChartParams:r})).attr("font-size",r.styles.textSize).attr("x",S).attr("y",_);for(;x=b.pop();)$.push(x),w.text($.join(" ")),w.node().getComputedTextLength()>g.x1-g.x0-o&&($.pop(),w.text($.join(" ")),$=[x],A+=a,w=y.append("tspan").attr("cursor","pointer").attr("fill",Se({colorType:n.labelColorType,datum:g.data,fullChartParams:r})).attr("font-size",r.styles.textSize).attr("x",S).attr("y",_).attr("dy",A+"px").text(x))})})}),s}function kO({selection:e,ids:t,fullChartParams:n}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").duration(200).style("opacity",1);return}e.each((r,i,o)=>{t.includes(r.data.id)?X(o[i]).style("opacity",1):X(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const RO=_c(LO)(({selection:e,name:t,subject:n,observer:r})=>{const i=new Q,o=O({layout:r.layout$,visibleComputedData:r.visibleComputedData$,fullParams:r.fullParams$,fullDataFormatter:r.fullDataFormatter$,fullChartParams:r.fullChartParams$}).pipe(C(i),z(async l=>l),L(l=>{const u=F1().size([l.layout.width,l.layout.height]).paddingInner(l.fullParams.paddingInner).paddingOuter(l.fullParams.paddingOuter).round(!0).tile(Xh.ratio(l.fullParams.squarifyRatio)),c=Bl(l.visibleComputedData).sum(f=>f.value).sort(l.fullParams.sort);return u(c),c.leaves()})),a=O({selection:St(e),treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,textSizePx:r.textSizePx$}).pipe(C(i),z(async l=>l),L(l=>MO({selection:e,treeData:l.treeData,fullParams:l.fullParams,fullChartParams:l.fullChartParams,textSizePx:l.textSizePx}))),s=r.fullChartParams$.pipe(C(i),L(l=>l.highlightTarget),q());return O({cellSelection:a,computedData:r.computedData$,treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,highlightTarget:s,CategoryDataMap:r.CategoryDataMap$}).pipe(C(i),z(async l=>l)).subscribe(l=>{l.cellSelection.on("mouseover",(u,c)=>{u.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseover",pluginName:Cr,highlightTarget:l.highlightTarget,datum:c.data,category:l.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:u,data:l.computedData})}).on("mousemove",(u,c)=>{u.stopPropagation(),n.event$.next({type:"tree",eventName:"mousemove",pluginName:Cr,highlightTarget:l.highlightTarget,datum:c.data,category:l.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:u,data:l.computedData})}).on("mouseout",(u,c)=>{u.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseout",pluginName:Cr,highlightTarget:l.highlightTarget,datum:c.data,category:l.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:u,data:l.computedData})}).on("click",(u,c)=>{u.stopPropagation(),n.event$.next({type:"tree",eventName:"click",pluginName:Cr,highlightTarget:l.highlightTarget,datum:c.data,category:l.CategoryDataMap.get(c.data.categoryLabel),categoryIndex:c.data.categoryIndex,categoryLabel:c.data.categoryLabel,event:u,data:l.computedData})})}),O({cellSelection:a,highlight:r.treeHighlight$.pipe(L(l=>l.map(u=>u.id))),fullChartParams:r.fullChartParams$}).pipe(C(i),z(async l=>l)).subscribe(l=>{kO({selection:l.cellSelection,ids:l.highlight,fullChartParams:l.fullChartParams})}),()=>{i.next(void 0)}}),gS="TreeTooltip",IO=_c({name:gS,defaultParams:Sg,layerIndex:Ri,validator:(e,{validateColumns:t})=>t(e,{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"},renderFn:{toBeTypes:["Function"]}})})(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new Q,a=Bi(gS,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}});U.Bars=QE,U.BarsPN=JE,U.BarsTriangle=gB,U.Bubbles=Vz,U.CONTAINER_PLUGIN_PARAMS=YF,U.DEFAULT_BARS_DIVERGING_PARAMS=dS,U.DEFAULT_BARS_PARAMS=Sa,U.DEFAULT_BARS_TRIANGLE_PARAMS=wg,U.DEFAULT_BUBBLES_PARAMS=Q2,U.DEFAULT_DOTS_PARAMS=_g,U.DEFAULT_FORCE_DIRECTED_BUBBLES_PARAMS=Oi,U.DEFAULT_FORCE_DIRECTED_PARAMS=zi,U.DEFAULT_GRID_LEGEND_PARAMS=Cg,U.DEFAULT_GRID_TOOLTIP_PARAMS=Pu,U.DEFAULT_GROUP_AUX_PARAMS=Au,U.DEFAULT_GROUP_AXIS_PARAMS=wu,U.DEFAULT_GROUP_ZOOM_PARAMS=Dg,U.DEFAULT_LINES_PARAMS=Lr,U.DEFAULT_LINE_AREAS_PARAMS=Tg,U.DEFAULT_MULTI_BARS_PARAMS=jv,U.DEFAULT_MULTI_BARS_TRIANGLE_PARAMS=qv,U.DEFAULT_MULTI_DOTS_PARAMS=Qv,U.DEFAULT_MULTI_GRID_LEGEND_PARAMS=Uv,U.DEFAULT_MULTI_GRID_TOOLTIP_PARAMS=Fp,U.DEFAULT_MULTI_GROUP_AXIS_PARAMS=Bp,U.DEFAULT_MULTI_LINES_PARAMS=Zv,U.DEFAULT_MULTI_LINE_AREAS_PARAMS=Kv,U.DEFAULT_MULTI_STACKED_BARS_PARAMS=Hv,U.DEFAULT_MULTI_STACKED_VALUE_AXIS_PARAMS=WB,U.DEFAULT_MULTI_VALUE_AXIS_PARAMS=ya,U.DEFAULT_MULTI_VALUE_LEGEND_PARAMS=y2,U.DEFAULT_MULTI_VALUE_TOOLTIP_PARAMS=Zp,U.DEFAULT_ORDINAL_AUX_PARAMS=Kp,U.DEFAULT_ORDINAL_AXIS_PARAMS=Qp,U.DEFAULT_ORDINAL_BUBBLES_PARAMS=b2,U.DEFAULT_ORDINAL_ZOOM_PARAMS=lN,U.DEFAULT_OVERLAPPING_STACKED_VALUE_AXES_PARAMS=Jv,U.DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS=Np,U.DEFAULT_PIE_EVENT_TEXTS_PARAMS=hg,U.DEFAULT_PIE_LABELS_PARAMS=pg,U.DEFAULT_PIE_PARAMS=J2,U.DEFAULT_RACING_BARS_PARAMS=Jp,U.DEFAULT_RACING_COUNTER_TEXTS_PARAMS=eg,U.DEFAULT_RACING_VALUE_AXIS_PARAMS=tg,U.DEFAULT_RELATIONSHIP_LEGEND_PARAMS=E2,U.DEFAULT_RELATIONSHIP_TOOLTIP_PARAMS=fg,U.DEFAULT_ROSE_LABELS_PARAMS=gg,U.DEFAULT_ROSE_PARAMS=eS,U.DEFAULT_SCATTER_BUBBLES_PARAMS=$2,U.DEFAULT_SCATTER_PARAMS=x2,U.DEFAULT_SERIES_LEGEND_PARAMS=tS,U.DEFAULT_SERIES_TOOLTIP_PARAMS=dg,U.DEFAULT_STACKED_BARS_PARAMS=Ag,U.DEFAULT_STACKED_VALUE_AXIS_PARAMS=Pg,U.DEFAULT_TREE_LEGEND_PARAMS=cS,U.DEFAULT_TREE_MAP_PARAMS=vg,U.DEFAULT_TREE_TOOLTIP_PARAMS=Sg,U.DEFAULT_VALUE_AXIS_PARAMS=Ta,U.DEFAULT_X_AXIS_PARAMS=ng,U.DEFAULT_X_Y_AUX_PARAMS=$u,U.DEFAULT_X_Y_AXES_PARAMS=vu,U.DEFAULT_X_ZOOM_PARAMS=rg,U.Dots=bB,U.ForceDirected=hz,U.ForceDirectedBubbles=Rz,U.GridLegend=vB,U.GridTooltip=kB,U.GroupAux=GB,U.GroupAxis=AB,U.GroupZoom=RB,U.LineAreas=XE,U.Lines=FE,U.MultiBars=YB,U.MultiBarsTriangle=UB,U.MultiDots=qB,U.MultiGridLegend=VB,U.MultiGridTooltip=QB,U.MultiGroupAxis=ZB,U.MultiLineAreas=HB,U.MultiLines=jB,U.MultiStackedBars=XB,U.MultiStackedValueAxis=JB,U.MultiValueAxis=KB,U.MultiValueLegend=uN,U.MultiValueTooltip=cN,U.OrdinalAux=vN,U.OrdinalAxis=CN,U.OrdinalBubbles=WN,U.OrdinalZoom=VN,U.OverlappingStackedValueAxes=sN,U.OverlappingValueAxes=aN,U.Pie=qz,U.PieEventTexts=Qz,U.PieLabels=uO,U.RacingBars=eF,U.RacingCounterTexts=oF,U.RacingValueAxis=pF,U.RelationshipLegend=Iz,U.RelationshipTooltip=Ez,U.Rose=dO,U.RoseLabels=wO,U.Scatter=bF,U.ScatterBubbles=_F,U.SeriesLegend=PO,U.SeriesTooltip=DO,U.StackedBars=aB,U.StackedValueAxis=LB,U.TOOLTIP_PARAMS=I2,U.TreeLegend=CO,U.TreeMap=RO,U.TreeTooltip=IO,U.ValueAxis=CB,U.XAxis=AF,U.XYAux=RF,U.XYAxes=WF,U.XZoom=VF,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"})});