@orbcharts/plugins-basic 3.0.0-beta.7 → 3.0.0-beta.9

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 (169) hide show
  1. package/LICENSE +200 -200
  2. package/dist/orbcharts-plugins-basic/lib/plugins-basic-types.d.ts +1 -1
  3. package/dist/orbcharts-plugins-basic/src/base/{BaseBarStack.d.ts → BaseStackedBar.d.ts} +4 -4
  4. package/dist/orbcharts-plugins-basic/src/grid/defaults.d.ts +3 -3
  5. package/dist/orbcharts-plugins-basic/src/grid/index.d.ts +2 -2
  6. package/dist/orbcharts-plugins-basic/src/grid/plugins/Bars.d.ts +1 -1
  7. package/dist/orbcharts-plugins-basic/src/grid/plugins/BarsPN.d.ts +1 -1
  8. package/dist/orbcharts-plugins-basic/src/grid/plugins/BarsTriangle.d.ts +1 -1
  9. package/dist/orbcharts-plugins-basic/src/grid/plugins/Dots.d.ts +1 -1
  10. package/dist/orbcharts-plugins-basic/src/grid/plugins/GridLegend.d.ts +1 -1
  11. package/dist/orbcharts-plugins-basic/src/grid/plugins/GridTooltip.d.ts +1 -1
  12. package/dist/orbcharts-plugins-basic/src/grid/plugins/GridZoom.d.ts +1 -1
  13. package/dist/orbcharts-plugins-basic/src/grid/plugins/GroupAux.d.ts +1 -1
  14. package/dist/orbcharts-plugins-basic/src/grid/plugins/GroupAxis.d.ts +1 -1
  15. package/dist/orbcharts-plugins-basic/src/grid/plugins/LineAreas.d.ts +1 -1
  16. package/dist/orbcharts-plugins-basic/src/grid/plugins/Lines.d.ts +1 -1
  17. package/dist/orbcharts-plugins-basic/src/grid/plugins/StackedBar.d.ts +1 -0
  18. package/dist/orbcharts-plugins-basic/src/grid/plugins/StackedValueAxis.d.ts +1 -0
  19. package/dist/orbcharts-plugins-basic/src/grid/plugins/ValueAxis.d.ts +1 -1
  20. package/dist/orbcharts-plugins-basic/src/index.d.ts +1 -0
  21. package/dist/orbcharts-plugins-basic/src/multiGrid/defaults.d.ts +4 -4
  22. package/dist/orbcharts-plugins-basic/src/multiGrid/index.d.ts +3 -3
  23. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiBars.d.ts +1 -1
  24. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiBarsTriangle.d.ts +1 -1
  25. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiDots.d.ts +1 -1
  26. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiGridLegend.d.ts +1 -1
  27. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiGridTooltip.d.ts +1 -1
  28. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiGroupAxis.d.ts +1 -1
  29. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiLineAreas.d.ts +1 -1
  30. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiLines.d.ts +1 -1
  31. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiStackedBar.d.ts +1 -0
  32. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiStackedValueAxis.d.ts +1 -0
  33. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiValueAxis.d.ts +1 -1
  34. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/OverlappingStackedValueAxes.d.ts +1 -0
  35. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/OverlappingValueAxes.d.ts +1 -1
  36. package/dist/orbcharts-plugins-basic/src/multiValue/plugins/MultiValueLegend.d.ts +1 -1
  37. package/dist/orbcharts-plugins-basic/src/multiValue/plugins/MultiValueTooltip.d.ts +1 -1
  38. package/dist/orbcharts-plugins-basic/src/multiValue/plugins/Scatter.d.ts +1 -1
  39. package/dist/orbcharts-plugins-basic/src/multiValue/plugins/ScatterBubbles.d.ts +1 -1
  40. package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYAux.d.ts +1 -1
  41. package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYAxes.d.ts +1 -1
  42. package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYZoom.d.ts +1 -1
  43. package/dist/orbcharts-plugins-basic/src/noneData/plugins/Container.d.ts +0 -1
  44. package/dist/orbcharts-plugins-basic/src/noneData/plugins/Tooltip.d.ts +0 -3
  45. package/dist/orbcharts-plugins-basic/src/relationship/defaults.d.ts +6 -0
  46. package/dist/orbcharts-plugins-basic/src/relationship/index.d.ts +5 -0
  47. package/dist/orbcharts-plugins-basic/src/relationship/plugins/ForceDirected.d.ts +3 -0
  48. package/dist/orbcharts-plugins-basic/src/relationship/plugins/ForceDirectedBubbles.d.ts +3 -0
  49. package/dist/orbcharts-plugins-basic/src/relationship/plugins/RelationshipLegend.d.ts +1 -0
  50. package/dist/orbcharts-plugins-basic/src/relationship/plugins/RelationshipTooltip.d.ts +1 -0
  51. package/dist/orbcharts-plugins-basic/src/relationship/relationshipObservables.d.ts +1 -0
  52. package/dist/orbcharts-plugins-basic/src/series/plugins/Bubbles.d.ts +1 -1
  53. package/dist/orbcharts-plugins-basic/src/series/plugins/Pie.d.ts +1 -1
  54. package/dist/orbcharts-plugins-basic/src/series/plugins/PieEventTexts.d.ts +1 -1
  55. package/dist/orbcharts-plugins-basic/src/series/plugins/PieLabels.d.ts +1 -1
  56. package/dist/orbcharts-plugins-basic/src/series/plugins/Rose.d.ts +1 -1
  57. package/dist/orbcharts-plugins-basic/src/series/plugins/RoseLabels.d.ts +1 -1
  58. package/dist/orbcharts-plugins-basic/src/series/plugins/SeriesLegend.d.ts +1 -1
  59. package/dist/orbcharts-plugins-basic/src/series/plugins/SeriesTooltip.d.ts +1 -1
  60. package/dist/orbcharts-plugins-basic/src/tree/plugins/TreeLegend.d.ts +1 -1
  61. package/dist/orbcharts-plugins-basic/src/tree/plugins/TreeMap.d.ts +1 -1
  62. package/dist/orbcharts-plugins-basic/src/tree/plugins/TreeTooltip.d.ts +1 -1
  63. package/dist/orbcharts-plugins-basic/src/utils/commonUtils.d.ts +1 -1
  64. package/dist/orbcharts-plugins-basic/src/utils/orbchartsUtils.d.ts +1 -1
  65. package/dist/orbcharts-plugins-basic.es.js +9421 -8102
  66. package/dist/orbcharts-plugins-basic.umd.js +69 -51
  67. package/lib/core-types.ts +7 -7
  68. package/lib/core.ts +6 -6
  69. package/lib/plugins-basic-types.ts +6 -6
  70. package/package.json +44 -44
  71. package/src/base/BaseBars.ts +765 -765
  72. package/src/base/BaseBarsTriangle.ts +676 -676
  73. package/src/base/BaseDots.ts +464 -464
  74. package/src/base/BaseGroupAxis.ts +679 -679
  75. package/src/base/BaseLegend.ts +684 -684
  76. package/src/base/BaseLineAreas.ts +629 -629
  77. package/src/base/BaseLines.ts +706 -706
  78. package/src/base/{BaseBarStack.ts → BaseStackedBar.ts} +782 -782
  79. package/src/base/BaseTooltip.ts +385 -385
  80. package/src/base/BaseValueAxis.ts +583 -583
  81. package/src/base/types.ts +2 -2
  82. package/src/const.ts +30 -30
  83. package/src/grid/defaults.ts +246 -246
  84. package/src/grid/gridObservables.ts +554 -554
  85. package/src/grid/index.ts +16 -16
  86. package/src/grid/plugins/Bars.ts +69 -69
  87. package/src/grid/plugins/BarsPN.ts +66 -66
  88. package/src/grid/plugins/BarsTriangle.ts +73 -73
  89. package/src/grid/plugins/Dots.ts +68 -68
  90. package/src/grid/plugins/GridLegend.ts +107 -107
  91. package/src/grid/plugins/GridTooltip.ts +66 -66
  92. package/src/grid/plugins/GridZoom.ts +218 -218
  93. package/src/grid/plugins/GroupAux.ts +1103 -1103
  94. package/src/grid/plugins/GroupAxis.ts +97 -97
  95. package/src/grid/plugins/LineAreas.ts +65 -65
  96. package/src/grid/plugins/Lines.ts +59 -59
  97. package/src/grid/plugins/{BarStack.ts → StackedBar.ts} +64 -64
  98. package/src/grid/plugins/{ValueStackAxis.ts → StackedValueAxis.ts} +96 -96
  99. package/src/grid/plugins/ValueAxis.ts +94 -94
  100. package/src/index.ts +6 -10
  101. package/src/multiGrid/defaults.ts +224 -224
  102. package/src/multiGrid/index.ts +15 -15
  103. package/src/multiGrid/multiGridObservables.ts +49 -49
  104. package/src/multiGrid/plugins/MultiBars.ts +108 -108
  105. package/src/multiGrid/plugins/MultiBarsTriangle.ts +114 -114
  106. package/src/multiGrid/plugins/MultiDots.ts +102 -102
  107. package/src/multiGrid/plugins/MultiGridLegend.ts +159 -159
  108. package/src/multiGrid/plugins/MultiGridTooltip.ts +66 -66
  109. package/src/multiGrid/plugins/MultiGroupAxis.ts +137 -137
  110. package/src/multiGrid/plugins/MultiLineAreas.ts +107 -107
  111. package/src/multiGrid/plugins/MultiLines.ts +101 -101
  112. package/src/multiGrid/plugins/{MultiBarStack.ts → MultiStackedBar.ts} +106 -106
  113. package/src/multiGrid/plugins/{MultiValueStackAxis.ts → MultiStackedValueAxis.ts} +134 -134
  114. package/src/multiGrid/plugins/MultiValueAxis.ts +134 -134
  115. package/src/multiGrid/plugins/{OverlappingValueStackAxes.ts → OverlappingStackedValueAxes.ts} +299 -299
  116. package/src/multiGrid/plugins/OverlappingValueAxes.ts +300 -300
  117. package/src/multiValue/defaults.ts +166 -166
  118. package/src/multiValue/index.ts +8 -8
  119. package/src/multiValue/multiValueObservables.ts +297 -297
  120. package/src/multiValue/plugins/MultiValueLegend.ts +107 -107
  121. package/src/multiValue/plugins/MultiValueTooltip.ts +66 -66
  122. package/src/multiValue/plugins/Scatter.ts +426 -426
  123. package/src/multiValue/plugins/ScatterBubbles.ts +554 -554
  124. package/src/multiValue/plugins/XYAux.ts +681 -681
  125. package/src/multiValue/plugins/XYAxes.ts +684 -684
  126. package/src/multiValue/plugins/XYZoom.ts +299 -299
  127. package/src/noneData/defaults.ts +102 -102
  128. package/src/noneData/index.ts +3 -3
  129. package/src/noneData/plugins/Container.ts +28 -28
  130. package/src/noneData/plugins/Tooltip.ts +374 -374
  131. package/src/relationship/defaults.ts +196 -0
  132. package/src/relationship/index.ts +5 -0
  133. package/src/relationship/plugins/ForceDirected.ts +1167 -0
  134. package/src/relationship/plugins/ForceDirectedBubbles.ts +1391 -0
  135. package/src/relationship/plugins/RelationshipLegend.ts +100 -0
  136. package/src/relationship/plugins/RelationshipTooltip.ts +66 -0
  137. package/src/relationship/relationshipObservables.ts +50 -0
  138. package/src/series/defaults.ts +206 -206
  139. package/src/series/index.ts +9 -9
  140. package/src/series/plugins/Bubbles.ts +606 -603
  141. package/src/series/plugins/Pie.ts +623 -623
  142. package/src/series/plugins/PieEventTexts.ts +284 -283
  143. package/src/series/plugins/PieLabels.ts +640 -640
  144. package/src/series/plugins/Rose.ts +516 -516
  145. package/src/series/plugins/RoseLabels.ts +600 -600
  146. package/src/series/plugins/SeriesLegend.ts +107 -107
  147. package/src/series/plugins/SeriesTooltip.ts +66 -66
  148. package/src/series/seriesObservables.ts +145 -145
  149. package/src/series/seriesUtils.ts +51 -51
  150. package/src/tree/defaults.ts +78 -78
  151. package/src/tree/index.ts +4 -4
  152. package/src/tree/plugins/TreeLegend.ts +100 -100
  153. package/src/tree/plugins/TreeMap.ts +333 -333
  154. package/src/tree/plugins/TreeTooltip.ts +66 -66
  155. package/src/utils/commonUtils.ts +21 -21
  156. package/src/utils/d3Graphics.ts +174 -174
  157. package/src/utils/d3Utils.ts +74 -74
  158. package/src/utils/observables.ts +14 -14
  159. package/src/utils/orbchartsUtils.ts +115 -115
  160. package/tsconfig.base.json +13 -13
  161. package/tsconfig.json +2 -2
  162. package/vite.config.js +22 -22
  163. package/dist/orbcharts-plugins-basic/src/grid/plugins/BarStack.d.ts +0 -1
  164. package/dist/orbcharts-plugins-basic/src/grid/plugins/ValueStackAxis.d.ts +0 -1
  165. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiBarStack.d.ts +0 -1
  166. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiValueStackAxis.d.ts +0 -1
  167. package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/OverlappingValueStackAxes.d.ts +0 -1
  168. package/dist/orbcharts-plugins-basic/src/relationship/plugins/Relationship.d.ts +0 -0
  169. package/src/relationship/plugins/Relationship.ts +0 -0
@@ -1,11 +1,11 @@
1
- (function(q,wr){typeof exports=="object"&&typeof module<"u"?wr(exports):typeof define=="function"&&define.amd?define(["exports"],wr):(q=typeof globalThis<"u"?globalThis:q||self,wr(q["orbcharts-plugins-basic"]={}))})(this,function(q){"use strict";const wr={lineCurve:"curveLinear",lineWidth:2},Op={lineCurve:"curveLinear",linearGradientOpacity:[1,0]},zp={radius:4,fillColorType:"white",strokeColorType:"series",strokeWidth:2,onlyShowHighlighted:!1},au={showLine:!0,showLabel:!0,lineDashArray:"3, 3",lineColorType:"primary",labelColorType:"primary",labelTextColorType:"background",labelTextFormat:t=>t,labelPadding:20,labelRotate:0};au.labelTextFormat.toString=()=>"text => text";const la={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1},y$={...la},Gp={barWidth:0,barGroupPadding:10,barRadius:!1},Yp={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0]},su={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!0,axisLineColorType:"primary",ticks:"all",tickFormat:t=>t,tickLineVisible:!0,tickPadding:20,tickFullLine:!1,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"};su.tickFormat.toString=()=>"text => text";const ua={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:null,tickFormat:t=>t,tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"};ua.tickFormat.toString=()=>"v => v";const Xp={...ua},Vp={},Wp={placement:"bottom",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},lu={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(t,{styles:e,utils:n})=>{const r=e.textSizePx*.7,i=e.textSizePx/2-r/2,o=`<g><text dominant-baseline="hanging" font-size="${e.textSizePx}">${t.groupLabel}</text></g>`,a=t.groups.reduce((c,f)=>{const h=`${f.seriesLabel}${f.value}`;return h.length>c.length?h:c},""),l=n.measureTextWidth(a,e.textSizePx)+e.textSizePx*2,u=t.groups.map((c,f)=>{const h=f*e.textSizePx*1.5,p=c.id===(t.datum&&t.datum.id);return`<g transform="translate(0, ${e.textSizePx*2})">
1
+ (function(H,Dr){typeof exports=="object"&&typeof module<"u"?Dr(exports):typeof define=="function"&&define.amd?define(["exports"],Dr):(H=typeof globalThis<"u"?globalThis:H||self,Dr(H["orbcharts-plugins-basic"]={}))})(this,function(H){"use strict";const Dr={lineCurve:"curveLinear",lineWidth:2},ed={lineCurve:"curveLinear",linearGradientOpacity:[1,0]},td={radius:4,fillColorType:"white",strokeColorType:"label",strokeWidth:2,onlyShowHighlighted:!1},bu={showLine:!0,showLabel:!0,lineDashArray:"3, 3",lineColorType:"primary",labelColorType:"primary",labelTextColorType:"background",labelTextFormat:e=>e,labelPadding:20,labelRotate:0};bu.labelTextFormat.toString=()=>"text => text";const ga={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1},U2={...ga},nd={barWidth:0,barGroupPadding:10,barRadius:!1},rd={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0]},xu={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"};xu.tickFormat.toString=()=>"text => text";const ma={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:null,tickFormat:e=>e,tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"};ma.tickFormat.toString=()=>"v => v";const id={...ma},od={},ad={placement:"bottom",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},vu={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}">${e.groupLabel}</text></g>`,a=e.groups.reduce((c,f)=>{const h=`${f.seriesLabel}${f.value}`;return h.length>c.length?h:c},""),l=n.measureTextWidth(a,t.textSizePx)+t.textSizePx*2,u=e.groups.map((c,f)=>{const h=f*t.textSizePx*1.5,p=c.id===(e.datum&&e.datum.id);return`<g transform="translate(0, ${t.textSizePx*2})">
2
2
  <rect width="${r}" height="${r}" x="${i}" y="${h+i}" rx="${r/2}" fill="${c.color}"></rect>
3
- <text x="${e.textSizePx*1.5}" y="${h}" font-size="${e.textSizePx}" dominant-baseline="hanging" fill="${e.textColor}">
3
+ <text x="${t.textSizePx*1.5}" y="${h}" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
4
4
  <tspan font-weight="${p?"bold":""}">${c.seriesLabel}</tspan>
5
5
  <tspan font-weight="bold" text-anchor="end" x="${l}">${c.value}</tspan>
6
6
  </text>
7
7
  </g>`}).join("");return`${o}
8
- ${u}`}};lu.renderFn.toString=()=>`(eventData, { styles, utils }) => {
8
+ ${u}`}};vu.renderFn.toString=()=>`(eventData, { styles, utils }) => {
9
9
  const bulletWidth = styles.textSizePx * 0.7
10
10
  const offset = (styles.textSizePx / 2) - (bulletWidth / 2)
11
11
 
@@ -31,38 +31,38 @@ ${u}`}};lu.renderFn.toString=()=>`(eventData, { styles, utils }) => {
31
31
  .join('')
32
32
  return \`\${titleSvg}
33
33
  \${contentSvg}\`
34
- }`;var uu=function(t,e){return uu=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])},uu(t,e)};function Be(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");uu(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function b$(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{u(r.next(c))}catch(f){a(f)}}function l(c){try{u(r.throw(c))}catch(f){a(f)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(t,e||[])).next())})}function Up(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(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=e.call(t,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 Sr(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function In(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function Ar(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function Tr(t){return this instanceof Tr?(this.v=t,this):new Tr(t)}function x$(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(p){return function(d){return Promise.resolve(d).then(p,f)}}function s(p,d){r[p]&&(i[p]=function(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){h(o[0][3],m)}}function u(p){p.value instanceof Tr?Promise.resolve(p.value.v).then(c,f):h(o[0][2],p)}function c(p){l("next",p)}function f(p){l("throw",p)}function h(p,d){p(d),o.shift(),o.length&&l(o[0][0],o[0][1])}}function v$(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof Sr=="function"?Sr(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(a){return new Promise(function(s,l){a=t[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 xt(t){return typeof t=="function"}function cu(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var fu=cu(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
34
+ }`;var $u=function(e,t){return $u=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])},$u(e,t)};function zt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");$u(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function H2(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(f){a(f)}}function l(c){try{u(r.throw(c))}catch(f){a(f)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(e,t||[])).next())})}function sd(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 zn(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 Cr(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 Lr(e){return this instanceof Lr?(this.v=e,this):new Lr(e)}function j2(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,f)}}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){h(o[0][3],m)}}function u(p){p.value instanceof Lr?Promise.resolve(p.value.v).then(c,f):h(o[0][2],p)}function c(p){l("next",p)}function f(p){l("throw",p)}function h(p,d){p(d),o.shift(),o.length&&l(o[0][0],o[0][1])}}function q2(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 _u(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 Su=_u(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
35
35
  `+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
36
- `):"",this.name="UnsubscriptionError",this.errors=n}});function ca(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Mi=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=Sr(a),l=s.next();!l.done;l=s.next()){var u=l.value;u.remove(this)}}catch(m){e={error:m}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(xt(c))try{c()}catch(m){o=m instanceof fu?m.errors:[m]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=Sr(f),p=h.next();!p.done;p=h.next()){var d=p.value;try{qp(d)}catch(m){o=o??[],m instanceof fu?o=Ar(Ar([],In(o)),In(m.errors)):o.push(m)}}}catch(m){r={error:m}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(o)throw new fu(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)qp(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&ca(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&ca(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),Hp=Mi.EMPTY;function jp(t){return t instanceof Mi||t&&"closed"in t&&xt(t.remove)&&xt(t.add)&&xt(t.unsubscribe)}function qp(t){xt(t)?t():t.unsubscribe()}var Zp={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Kp={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,Ar([t,e],In(n)))},clearTimeout:function(t){var e=Kp.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Qp(t){Kp.setTimeout(function(){throw t})}function hu(){}function fa(t){t()}var pu=function(t){Be(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,jp(n)&&n.add(r)):r.destination=S$,r}return e.create=function(n,r,i){return new Ci(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Mi),$$=Function.prototype.bind;function du(t,e){return $$.call(t,e)}var _$=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){ha(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){ha(r)}else ha(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){ha(n)}},t}(),Ci=function(t){Be(e,t);function e(n,r,i){var o=t.call(this)||this,a;if(xt(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;o&&Zp.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&du(n.next,s),error:n.error&&du(n.error,s),complete:n.complete&&du(n.complete,s)}):a=n}return o.destination=new _$(a),o}return e}(pu);function ha(t){Qp(t)}function w$(t){throw t}var S$={closed:!0,next:hu,error:w$,complete:hu},gu=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Pr(t){return t}function A$(t){return t.length===0?Pr:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var pt=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,o=P$(e)?e:new Ci(e,n,r);return fa(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},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=Jp(n),new n(function(i,o){var a=new Ci({next:function(s){try{e(s)}catch(l){o(l),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[gu]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return A$(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Jp(e),new e(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},t.create=function(e){return new t(e)},t}();function Jp(t){var e;return(e=t??Zp.Promise)!==null&&e!==void 0?e:Promise}function T$(t){return t&&xt(t.next)&&xt(t.error)&&xt(t.complete)}function P$(t){return t&&t instanceof pu||T$(t)&&jp(t)}function D$(t){return xt(t==null?void 0:t.lift)}function le(t){return function(e){if(D$(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function ne(t,e,n,r,i){return new M$(t,e,n,r,i)}var M$=function(t){Be(e,t);function e(n,r,i,o,a,s){var l=t.call(this,n)||this;return l.onFinalize=a,l.shouldUnsubscribe=s,l._next=r?function(u){try{r(u)}catch(c){n.error(c)}}:t.prototype._next,l._error=o?function(u){try{o(u)}catch(c){n.error(c)}finally{this.unsubscribe()}}:t.prototype._error,l._complete=i?function(){try{i()}catch(u){n.error(u)}finally{this.unsubscribe()}}:t.prototype._complete,l}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(pu),C$=cu(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),tt=function(t){Be(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new td(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new C$},e.prototype.next=function(n){var r=this;fa(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=Sr(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}}}})},e.prototype.error=function(n){var r=this;fa(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;fa(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?Hp:(this.currentObservers=null,s.push(n),new Mi(function(){r.currentObservers=null,ca(s,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},e.prototype.asObservable=function(){var n=new pt;return n.source=this,n},e.create=function(n,r){return new td(n,r)},e}(pt),td=function(t){Be(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:Hp},e}(tt),L$=function(t){Be(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,o=n._value;if(r)throw i;return this._throwIfClosed(),o},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(tt),mu={now:function(){return(mu.delegate||Date).now()},delegate:void 0},k$=function(t){Be(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=mu);var o=t.call(this)||this;return o._bufferSize=n,o._windowTime=r,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,n),o._windowTime=Math.max(1,r),o}return e.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,s=r._timestampProvider,l=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+l)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,o=i._infiniteTimeWindow,a=i._buffer,s=a.slice(),l=0;l<s.length&&!n.closed;l+=o?1:2)n.next(s[l]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,o=n._buffer,a=n._infiniteTimeWindow,s=(a?1:2)*r;if(r<1/0&&s<o.length&&o.splice(0,o.length-s),!a){for(var l=i.now(),u=0,c=1;c<o.length&&o[c]<=l;c+=2)u=c;u&&o.splice(0,u+1)}},e}(tt),R$=function(t){Be(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Mi),yu={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,Ar([t,e],In(n)))},clearInterval:function(t){var e=yu.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},E$=function(t){Be(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var o=this.id,a=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(a,o,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),yu.setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&yu.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,o;try{this.work(n)}catch(a){i=!0,o=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ca(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(R$),ed=function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=mu.now,t}(),I$=function(t){Be(e,t);function e(n,r){r===void 0&&(r=ed.now);var i=t.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e}(ed),B$=new I$(E$),nd=new pt(function(t){return t.complete()});function N$(t){return t&&xt(t.schedule)}function bu(t){return t[t.length-1]}function F$(t){return xt(bu(t))?t.pop():void 0}function xu(t){return N$(bu(t))?t.pop():void 0}function O$(t,e){return typeof bu(t)=="number"?t.pop():e}var vu=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function rd(t){return xt(t==null?void 0:t.then)}function id(t){return xt(t[gu])}function od(t){return Symbol.asyncIterator&&xt(t==null?void 0:t[Symbol.asyncIterator])}function ad(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function z$(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var sd=z$();function ld(t){return xt(t==null?void 0:t[sd])}function ud(t){return x$(this,arguments,function(){var n,r,i,o;return Up(this,function(a){switch(a.label){case 0:n=t.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Tr(n.read())];case 3:return r=a.sent(),i=r.value,o=r.done,o?[4,Tr(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Tr(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 cd(t){return xt(t==null?void 0:t.getReader)}function de(t){if(t instanceof pt)return t;if(t!=null){if(id(t))return G$(t);if(vu(t))return Y$(t);if(rd(t))return X$(t);if(od(t))return fd(t);if(ld(t))return V$(t);if(cd(t))return W$(t)}throw ad(t)}function G$(t){return new pt(function(e){var n=t[gu]();if(xt(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Y$(t){return new pt(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function X$(t){return new pt(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Qp)})}function V$(t){return new pt(function(e){var n,r;try{for(var i=Sr(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function fd(t){return new pt(function(e){U$(t,e).catch(function(n){return e.error(n)})})}function W$(t){return fd(ud(t))}function U$(t,e){var n,r,i,o;return b$(this,void 0,void 0,function(){var a,s;return Up(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=v$(t),l.label=1;case 1:return[4,n.next()];case 2:if(r=l.sent(),!!r.done)return[3,4];if(a=r.value,e.next(a),e.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 e.complete(),[2]}})})}function bn(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(o),!i)return o}function hd(t,e){return e===void 0&&(e=0),le(function(n,r){n.subscribe(ne(r,function(i){return bn(r,t,function(){return r.next(i)},e)},function(){return bn(r,t,function(){return r.complete()},e)},function(i){return bn(r,t,function(){return r.error(i)},e)}))})}function pd(t,e){return e===void 0&&(e=0),le(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function H$(t,e){return de(t).pipe(pd(e),hd(e))}function j$(t,e){return de(t).pipe(pd(e),hd(e))}function q$(t,e){return new pt(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function Z$(t,e){return new pt(function(n){var r;return bn(n,e,function(){r=t[sd](),bn(n,e,function(){var i,o,a;try{i=r.next(),o=i.value,a=i.done}catch(s){n.error(s);return}a?n.complete():n.next(o)},0,!0)}),function(){return xt(r==null?void 0:r.return)&&r.return()}})}function dd(t,e){if(!t)throw new Error("Iterable cannot be null");return new pt(function(n){bn(n,e,function(){var r=t[Symbol.asyncIterator]();bn(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function K$(t,e){return dd(ud(t),e)}function Q$(t,e){if(t!=null){if(id(t))return H$(t,e);if(vu(t))return q$(t,e);if(rd(t))return j$(t,e);if(od(t))return dd(t,e);if(ld(t))return Z$(t,e);if(cd(t))return K$(t,e)}throw ad(t)}function pa(t,e){return e?Q$(t,e):de(t)}function da(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=xu(t);return pa(t,n)}var gd=cu(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function B(t,e){return le(function(n,r){var i=0;n.subscribe(ne(r,function(o){r.next(t.call(e,o,i++))}))})}var J$=Array.isArray;function t_(t,e){return J$(e)?t.apply(void 0,Ar([],In(e))):t(e)}function md(t){return B(function(e){return t_(t,e)})}var e_=Array.isArray,n_=Object.getPrototypeOf,r_=Object.prototype,i_=Object.keys;function o_(t){if(t.length===1){var e=t[0];if(e_(e))return{args:e,keys:null};if(a_(e)){var n=i_(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function a_(t){return t&&typeof t=="object"&&n_(t)===r_}function s_(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function Y(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=xu(t),r=F$(t),i=o_(t),o=i.args,a=i.keys;if(o.length===0)return pa([],n);var s=new pt(l_(o,n,a?function(l){return s_(a,l)}:Pr));return r?s.pipe(md(r)):s}function l_(t,e,n){return n===void 0&&(n=Pr),function(r){yd(e,function(){for(var i=t.length,o=new Array(i),a=i,s=i,l=function(c){yd(e,function(){var f=pa(t[c],e),h=!1;f.subscribe(ne(r,function(p){o[c]=p,h||(h=!0,s--),s||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},u=0;u<i;u++)l(u)},r)}}function yd(t,e,n){t?bn(n,t,e):e()}function u_(t,e,n,r,i,o,a,s){var l=[],u=0,c=0,f=!1,h=function(){f&&!l.length&&!u&&e.complete()},p=function(m){return u<r?d(m):l.push(m)},d=function(m){u++;var g=!1;de(n(m,c++)).subscribe(ne(e,function(y){e.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();h()}catch(b){e.error(b)}}))};return t.subscribe(ne(e,p,function(){f=!0,h()})),function(){}}function $u(t,e,n){return n===void 0&&(n=1/0),xt(e)?$u(function(r,i){return B(function(o,a){return e(r,o,i,a)})(de(t(r,i)))},n):(typeof e=="number"&&(n=e),le(function(r,i){return u_(r,i,t,n)}))}function c_(t){return t===void 0&&(t=1/0),$u(Pr,t)}function f_(t){return new pt(function(e){de(t()).subscribe(e)})}var h_=["addListener","removeListener"],p_=["addEventListener","removeEventListener"],d_=["on","off"];function _u(t,e,n,r){if(xt(n)&&(r=n,n=void 0),r)return _u(t,e,n).pipe(md(r));var i=In(y_(t)?p_.map(function(s){return function(l){return t[s](e,l,n)}}):g_(t)?h_.map(bd(t,e)):m_(t)?d_.map(bd(t,e)):[],2),o=i[0],a=i[1];if(!o&&vu(t))return $u(function(s){return _u(s,e,n)})(de(t));if(!o)throw new TypeError("Invalid event target");return new pt(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 bd(t,e){return function(n){return function(r){return t[n](e,r)}}}function g_(t){return xt(t.addListener)&&xt(t.removeListener)}function m_(t){return xt(t.on)&&xt(t.off)}function y_(t){return xt(t.addEventListener)&&xt(t.removeEventListener)}function wu(t,e,n){return f_(function(){return t()?e:n})}function Su(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=xu(t),r=O$(t,1/0),i=t;return i.length?i.length===1?de(i[0]):c_(r)(pa(i,n)):nd}function Dr(t,e){return le(function(n,r){var i=0;n.subscribe(ne(r,function(o){return t.call(e,o,i++)&&r.next(o)}))})}function b_(t,e){return e===void 0&&(e=B$),le(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+t,c=e.now();if(c<u){i=this.schedule(void 0,u-c),r.add(i);return}s()}n.subscribe(ne(r,function(u){o=u,a=e.now(),i||(i=e.schedule(l,t),r.add(i))},function(){s(),r.complete()},void 0,function(){o=i=null}))})}function x_(t){return le(function(e,n){var r=!1;e.subscribe(ne(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function v_(t){return t<=0?function(){return nd}:le(function(e,n){var r=0;e.subscribe(ne(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function Q(t,e){return e===void 0&&(e=Pr),t=t??$_,le(function(n,r){var i,o=!0;n.subscribe(ne(r,function(a){var s=e(a);(o||!t(i,s))&&(o=!1,i=s,r.next(a))}))})}function $_(t,e){return t===e}function __(t){return t===void 0&&(t=w_),le(function(e,n){var r=!1;e.subscribe(ne(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function w_(){return new gd}function Au(t,e){var n=arguments.length>=2;return function(r){return r.pipe(Pr,v_(1),n?x_(e):__(function(){return new gd}))}}function S_(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new tt}:e,r=t.resetOnError,i=r===void 0?!0:r,o=t.resetOnComplete,a=o===void 0?!0:o,s=t.resetOnRefCountZero,l=s===void 0?!0:s;return function(u){var c,f,h,p=0,d=!1,m=!1,g=function(){f==null||f.unsubscribe(),f=void 0},y=function(){g(),c=h=void 0,d=m=!1},b=function(){var v=c;y(),v==null||v.unsubscribe()};return le(function(v,x){p++,!m&&!d&&g();var _=h=h??n();x.add(function(){p--,p===0&&!m&&!d&&(f=Tu(b,l))}),_.subscribe(x),!c&&p>0&&(c=new Ci({next:function(S){return _.next(S)},error:function(S){m=!0,g(),f=Tu(y,i,S),_.error(S)},complete:function(){d=!0,g(),f=Tu(y,a),_.complete()}}),de(v).subscribe(c))})(u)}}function Tu(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new Ci({next:function(){i.unsubscribe(),t()}});return de(e.apply(void 0,Ar([],In(n)))).subscribe(i)}}function yt(t,e,n){var r,i=!1;return r=t,S_({connector:function(){return new k$(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function G(t,e){return le(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(ne(r,function(l){i==null||i.unsubscribe();var u=0,c=o++;de(t(l,c)).subscribe(i=ne(r,function(f){return r.next(e?e(l,f,c,u++):f)},function(){i=null,s()}))},function(){a=!0,s()}))})}function k(t){return le(function(e,n){de(t).subscribe(ne(n,function(){return n.complete()},hu)),!n.closed&&e.subscribe(n)})}const ge={position:"left",scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""};function Mr(t){return Object.prototype.toString.call(t)==="[object Object]"}function A_(t){return Object.prototype.toString.call(t)==="[object Function]"}function Pu(t,e){if(Mr(t)===!1||Mr(e)===!1)return Object.assign({},e);const n=(r,i)=>{const o=Object.assign({},i);for(let a of Object.keys(r)){if(!(a in i))continue;let s;Mr(r[a])&&Mr(i[a])?(s=n(r[a],i[a]),o[a]=s):o[a]=r[a]}return o};return n(t,e)}function T_(t,e){const n={string:i=>typeof i=="string",number:i=>typeof i=="number",boolean:i=>typeof i=="boolean",object:i=>Mr(i),"object[]":i=>Array.isArray(i)&&i.every(o=>Mr(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=>A_(i),null:i=>i===null,undefined:i=>i===void 0},r={ColorType:i=>i==="none"||i==="series"||i==="primary"||i==="secondary"||i==="white"||i==="background"};return Object.keys(t).find(i=>{if(e[i]){const o=e[i],a=t[i];if(o.toBeTypes){if(o.toBeTypes.some(s=>n[s](a))===!1)return!0}else if(o.toBe){const{toBe:s,test: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 P_(t,e){const n=T_(t,e);if(n){const r=e[n],i=r.toBeTypes?r.toBeTypes.join(" | "):r.toBe?r.toBe:r.toBeOption?r.toBeOption:"";return{status:"error",columnName:n,expectToBe:i}}else return{status:"success",columnName:"",expectToBe:""}}function ga(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function D_(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function xd(t){let e,n,r;t.length!==2?(e=ga,n=(s,l)=>ga(t(s),l),r=(s,l)=>t(s)-l):(e=t===ga||t===D_?t:M_,n=t,r=t);function i(s,l,u=0,c=s.length){if(u<c){if(e(l,l)!==0)return c;do{const f=u+c>>>1;n(s[f],l)<0?u=f+1:c=f}while(u<c)}return u}function o(s,l,u=0,c=s.length){if(u<c){if(e(l,l)!==0)return c;do{const f=u+c>>>1;n(s[f],l)<=0?u=f+1:c=f}while(u<c)}return u}function a(s,l,u=0,c=s.length){const f=i(s,l,u,c-1);return f>u&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:a,right:o}}function M_(){return 0}function C_(t){return t===null?NaN:+t}const L_=xd(ga),vd=L_.right;xd(C_).center;const k_=Math.sqrt(50),R_=Math.sqrt(10),E_=Math.sqrt(2);function ma(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=k_?10:o>=R_?5:o>=E_?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/a,s=Math.round(t*u),l=Math.round(e*u),s/u<t&&++s,l/u>e&&--l,u=-u):(u=Math.pow(10,i)*a,s=Math.round(t/u),l=Math.round(e/u),s*u<t&&++s,l*u>e&&--l),l<s&&.5<=n&&n<2?ma(t,e,n*2):[s,l,u]}function I_(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?ma(e,t,n):ma(t,e,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 Du(t,e,n){return e=+e,t=+t,n=+n,ma(t,e,n)[2]}function B_(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?Du(e,t,n):Du(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}var N_={value:()=>{}};function $d(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ya(n)}function ya(t){this._=t}function F_(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ya.prototype=$d.prototype={constructor:ya,on:function(t,e){var n=this._,r=F_(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=O_(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<a;)if(i=(t=r[o]).type)n[i]=_d(n[i],t.name,e);else if(e==null)for(i in n)n[i]=_d(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ya(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function O_(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function _d(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=N_,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Mu="http://www.w3.org/1999/xhtml";const wd={svg:"http://www.w3.org/2000/svg",xhtml:Mu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ba(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),wd.hasOwnProperty(e)?{space:wd[e],local:t}:t}function z_(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Mu&&e.documentElement.namespaceURI===Mu?e.createElement(t):e.createElementNS(n,t)}}function G_(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Sd(t){var e=ba(t);return(e.local?G_:z_)(e)}function Y_(){}function Cu(t){return t==null?Y_:function(){return this.querySelector(t)}}function X_(t){typeof t!="function"&&(t=Cu(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=new Array(a),l,u,c=0;c<a;++c)(l=o[c])&&(u=t.call(l,l.__data__,c,o))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new Se(r,this._parents)}function V_(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function W_(){return[]}function Ad(t){return t==null?W_:function(){return this.querySelectorAll(t)}}function U_(t){return function(){return V_(t.apply(this,arguments))}}function H_(t){typeof t=="function"?t=U_(t):t=Ad(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a=e[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&(r.push(t.call(l,l.__data__,u,a)),i.push(l));return new Se(r,i)}function Td(t){return function(){return this.matches(t)}}function Pd(t){return function(e){return e.matches(t)}}var j_=Array.prototype.find;function q_(t){return function(){return j_.call(this.children,t)}}function Z_(){return this.firstElementChild}function K_(t){return this.select(t==null?Z_:q_(typeof t=="function"?t:Pd(t)))}var Q_=Array.prototype.filter;function J_(){return Array.from(this.children)}function tw(t){return function(){return Q_.call(this.children,t)}}function ew(t){return this.selectAll(t==null?J_:tw(typeof t=="function"?t:Pd(t)))}function nw(t){typeof t!="function"&&(t=Td(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&t.call(l,l.__data__,u,o)&&s.push(l);return new Se(r,this._parents)}function Dd(t){return new Array(t.length)}function rw(){return new Se(this._enter||this._groups.map(Dd),this._parents)}function xa(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}xa.prototype={constructor:xa,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function iw(t){return function(){return t}}function ow(t,e,n,r,i,o){for(var a=0,s,l=e.length,u=o.length;a<u;++a)(s=e[a])?(s.__data__=o[a],r[a]=s):n[a]=new xa(t,o[a]);for(;a<l;++a)(s=e[a])&&(i[a]=s)}function aw(t,e,n,r,i,o,a){var s,l,u=new Map,c=e.length,f=o.length,h=new Array(c),p;for(s=0;s<c;++s)(l=e[s])&&(h[s]=p=a.call(l,l.__data__,s,e)+"",u.has(p)?i[s]=l:u.set(p,l));for(s=0;s<f;++s)p=a.call(t,o[s],s,o)+"",(l=u.get(p))?(r[s]=l,l.__data__=o[s],u.delete(p)):n[s]=new xa(t,o[s]);for(s=0;s<c;++s)(l=e[s])&&u.get(h[s])===l&&(i[s]=l)}function sw(t){return t.__data__}function lw(t,e){if(!arguments.length)return Array.from(this,sw);var n=e?aw:ow,r=this._parents,i=this._groups;typeof t!="function"&&(t=iw(t));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],f=i[u],h=f.length,p=uw(t.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(h);n(c,f,m,g,y,p,e);for(var b=0,v=0,x,_;b<d;++b)if(x=m[b]){for(b>=v&&(v=b+1);!(_=g[v])&&++v<d;);x._next=_||null}}return a=new Se(a,r),a._enter=s,a._exit=l,a}function uw(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function cw(){return new Se(this._exit||this._groups.map(Dd),this._parents)}function fw(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function hw(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=r[l],f=u.length,h=s[l]=new Array(f),p,d=0;d<f;++d)(p=u[d]||c[d])&&(h[d]=p);for(;l<i;++l)s[l]=n[l];return new Se(s,this._parents)}function pw(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function dw(t){t||(t=gw);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,l=i[o]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(e)}return new Se(i,this._parents).order()}function gw(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function mw(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function yw(){return Array.from(this)}function bw(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function xw(){let t=0;for(const e of this)++t;return t}function vw(){return!this.node()}function $w(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&t.call(s,s.__data__,o,i);return this}function _w(t){return function(){this.removeAttribute(t)}}function ww(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Sw(t,e){return function(){this.setAttribute(t,e)}}function Aw(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Tw(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Pw(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Dw(t,e){var n=ba(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?ww:_w:typeof e=="function"?n.local?Pw:Tw:n.local?Aw:Sw)(n,e))}function Md(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Mw(t){return function(){this.style.removeProperty(t)}}function Cw(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Lw(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function kw(t,e,n){return arguments.length>1?this.each((e==null?Mw:typeof e=="function"?Lw:Cw)(t,e,n??"")):Cr(this.node(),t)}function Cr(t,e){return t.style.getPropertyValue(e)||Md(t).getComputedStyle(t,null).getPropertyValue(e)}function Rw(t){return function(){delete this[t]}}function Ew(t,e){return function(){this[t]=e}}function Iw(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Bw(t,e){return arguments.length>1?this.each((e==null?Rw:typeof e=="function"?Iw:Ew)(t,e)):this.node()[t]}function Cd(t){return t.trim().split(/^|\s+/)}function Lu(t){return t.classList||new Ld(t)}function Ld(t){this._node=t,this._names=Cd(t.getAttribute("class")||"")}Ld.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function kd(t,e){for(var n=Lu(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Rd(t,e){for(var n=Lu(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Nw(t){return function(){kd(this,t)}}function Fw(t){return function(){Rd(this,t)}}function Ow(t,e){return function(){(e.apply(this,arguments)?kd:Rd)(this,t)}}function zw(t,e){var n=Cd(t+"");if(arguments.length<2){for(var r=Lu(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Ow:e?Nw:Fw)(n,e))}function Gw(){this.textContent=""}function Yw(t){return function(){this.textContent=t}}function Xw(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Vw(t){return arguments.length?this.each(t==null?Gw:(typeof t=="function"?Xw:Yw)(t)):this.node().textContent}function Ww(){this.innerHTML=""}function Uw(t){return function(){this.innerHTML=t}}function Hw(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function jw(t){return arguments.length?this.each(t==null?Ww:(typeof t=="function"?Hw:Uw)(t)):this.node().innerHTML}function qw(){this.nextSibling&&this.parentNode.appendChild(this)}function Zw(){return this.each(qw)}function Kw(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Qw(){return this.each(Kw)}function Jw(t){var e=typeof t=="function"?t:Sd(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function tS(){return null}function eS(t,e){var n=typeof t=="function"?t:Sd(t),r=e==null?tS:typeof e=="function"?e:Cu(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function nS(){var t=this.parentNode;t&&t.removeChild(this)}function rS(){return this.each(nS)}function iS(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function oS(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function aS(t){return this.select(t?oS:iS)}function sS(t){return arguments.length?this.property("__data__",t):this.node().__data__}function lS(t){return function(e){t.call(this,e,this.__data__)}}function uS(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function cS(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function fS(t,e,n){return function(){var r=this.__on,i,o=lS(e);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function hS(t,e,n){var r=uS(t+""),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=e?fS:cS,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function Ed(t,e,n){var r=Md(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function pS(t,e){return function(){return Ed(this,t,e)}}function dS(t,e){return function(){return Ed(this,t,e.apply(this,arguments))}}function gS(t,e){return this.each((typeof e=="function"?dS:pS)(t,e))}function*mS(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var yS=[null];function Se(t,e){this._groups=t,this._parents=e}function Li(){return new Se([[document.documentElement]],yS)}function bS(){return this}Se.prototype=Li.prototype={constructor:Se,select:X_,selectAll:H_,selectChild:K_,selectChildren:ew,filter:nw,data:lw,enter:rw,exit:cw,join:fw,merge:hw,selection:bS,order:pw,sort:dw,call:mw,nodes:yw,node:bw,size:xw,empty:vw,each:$w,attr:Dw,style:kw,property:Bw,classed:zw,text:Vw,html:jw,raise:Zw,lower:Qw,append:Jw,insert:eS,remove:rS,clone:aS,datum:sS,on:hS,dispatch:gS,[Symbol.iterator]:mS};function ku(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Id(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ki(){}var Ri=.7,va=1/Ri,Lr="\\s*([+-]?\\d+)\\s*",Ei="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ne="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xS=/^#([0-9a-f]{3,8})$/,vS=new RegExp(`^rgb\\(${Lr},${Lr},${Lr}\\)$`),$S=new RegExp(`^rgb\\(${Ne},${Ne},${Ne}\\)$`),_S=new RegExp(`^rgba\\(${Lr},${Lr},${Lr},${Ei}\\)$`),wS=new RegExp(`^rgba\\(${Ne},${Ne},${Ne},${Ei}\\)$`),SS=new RegExp(`^hsl\\(${Ei},${Ne},${Ne}\\)$`),AS=new RegExp(`^hsla\\(${Ei},${Ne},${Ne},${Ei}\\)$`),Bd={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};ku(ki,Bn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Nd,formatHex:Nd,formatHex8:TS,formatHsl:PS,formatRgb:Fd,toString:Fd});function Nd(){return this.rgb().formatHex()}function TS(){return this.rgb().formatHex8()}function PS(){return Xd(this).formatHsl()}function Fd(){return this.rgb().formatRgb()}function Bn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=xS.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Od(e):n===3?new re(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?$a(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?$a(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=vS.exec(t))?new re(e[1],e[2],e[3],1):(e=$S.exec(t))?new re(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=_S.exec(t))?$a(e[1],e[2],e[3],e[4]):(e=wS.exec(t))?$a(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=SS.exec(t))?Yd(e[1],e[2]/100,e[3]/100,1):(e=AS.exec(t))?Yd(e[1],e[2]/100,e[3]/100,e[4]):Bd.hasOwnProperty(t)?Od(Bd[t]):t==="transparent"?new re(NaN,NaN,NaN,0):null}function Od(t){return new re(t>>16&255,t>>8&255,t&255,1)}function $a(t,e,n,r){return r<=0&&(t=e=n=NaN),new re(t,e,n,r)}function DS(t){return t instanceof ki||(t=Bn(t)),t?(t=t.rgb(),new re(t.r,t.g,t.b,t.opacity)):new re}function Ru(t,e,n,r){return arguments.length===1?DS(t):new re(t,e,n,r??1)}function re(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}ku(re,Ru,Id(ki,{brighter(t){return t=t==null?va:Math.pow(va,t),new re(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ri:Math.pow(Ri,t),new re(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new re(Nn(this.r),Nn(this.g),Nn(this.b),_a(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:zd,formatHex:zd,formatHex8:MS,formatRgb:Gd,toString:Gd}));function zd(){return`#${Fn(this.r)}${Fn(this.g)}${Fn(this.b)}`}function MS(){return`#${Fn(this.r)}${Fn(this.g)}${Fn(this.b)}${Fn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Gd(){const t=_a(this.opacity);return`${t===1?"rgb(":"rgba("}${Nn(this.r)}, ${Nn(this.g)}, ${Nn(this.b)}${t===1?")":`, ${t})`}`}function _a(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Nn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Fn(t){return t=Nn(t),(t<16?"0":"")+t.toString(16)}function Yd(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ae(t,e,n,r)}function Xd(t){if(t instanceof Ae)return new Ae(t.h,t.s,t.l,t.opacity);if(t instanceof ki||(t=Bn(t)),!t)return new Ae;if(t instanceof Ae)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(e===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-e)/s+2:a=(e-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Ae(a,s,l,t.opacity)}function CS(t,e,n,r){return arguments.length===1?Xd(t):new Ae(t,e,n,r??1)}function Ae(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}ku(Ae,CS,Id(ki,{brighter(t){return t=t==null?va:Math.pow(va,t),new Ae(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ri:Math.pow(Ri,t),new Ae(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new re(Eu(t>=240?t-240:t+120,i,r),Eu(t,i,r),Eu(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Ae(Vd(this.h),wa(this.s),wa(this.l),_a(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=_a(this.opacity);return`${t===1?"hsl(":"hsla("}${Vd(this.h)}, ${wa(this.s)*100}%, ${wa(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Vd(t){return t=(t||0)%360,t<0?t+360:t}function wa(t){return Math.max(0,Math.min(1,t||0))}function Eu(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Iu=t=>()=>t;function LS(t,e){return function(n){return t+n*e}}function kS(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function RS(t){return(t=+t)==1?Wd:function(e,n){return n-e?kS(e,n,t):Iu(isNaN(e)?n:e)}}function Wd(t,e){var n=e-t;return n?LS(t,n):Iu(isNaN(t)?e:t)}const Sa=function t(e){var n=RS(e);function r(i,o){var a=n((i=Ru(i)).r,(o=Ru(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),u=Wd(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=t,r}(1);function ES(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function IS(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function BS(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=Fu(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function NS(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Te(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function FS(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=Fu(t[i],e[i]):r[i]=e[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var Bu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Nu=new RegExp(Bu.source,"g");function OS(t){return function(){return t}}function zS(t){return function(e){return t(e)+""}}function Ud(t,e){var n=Bu.lastIndex=Nu.lastIndex=0,r,i,o,a=-1,s=[],l=[];for(t=t+"",e=e+"";(r=Bu.exec(t))&&(i=Nu.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:Te(r,i)})),n=Nu.lastIndex;return n<e.length&&(o=e.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?zS(l[0].x):OS(e):(e=l.length,function(u){for(var c=0,f;c<e;++c)s[(f=l[c]).i]=f.x(u);return s.join("")})}function Fu(t,e){var n=typeof e,r;return e==null||n==="boolean"?Iu(e):(n==="number"?Te:n==="string"?(r=Bn(e))?(e=r,Sa):Ud:e instanceof Bn?Sa:e instanceof Date?NS:IS(e)?ES:Array.isArray(e)?BS:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?FS:Te)(t,e)}function GS(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Hd=180/Math.PI,jd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function qd(t,e,n,r,i,o){var a,s,l;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),t*r<e*n&&(t=-t,e=-e,l=-l,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*Hd,skewX:Math.atan(l)*Hd,scaleX:a,scaleY:s}}var Aa;function YS(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?jd:qd(e.a,e.b,e.c,e.d,e.e,e.f)}function XS(t){return t==null||(Aa||(Aa=document.createElementNS("http://www.w3.org/2000/svg","g")),Aa.setAttribute("transform",t),!(t=Aa.transform.baseVal.consolidate()))?jd:(t=t.matrix,qd(t.a,t.b,t.c,t.d,t.e,t.f))}function Zd(t,e,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,c,f,h,p,d){if(u!==f||c!==h){var m=p.push("translate(",null,e,null,n);d.push({i:m-4,x:Te(u,f)},{i:m-2,x:Te(c,h)})}else(f||h)&&p.push("translate("+f+e+h+n)}function a(u,c,f,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Te(u,c)})):c&&f.push(i(f)+"rotate("+c+r)}function s(u,c,f,h){u!==c?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Te(u,c)}):c&&f.push(i(f)+"skewX("+c+r)}function l(u,c,f,h,p,d){if(u!==f||c!==h){var m=p.push(i(p)+"scale(",null,",",null,")");d.push({i:m-4,x:Te(u,f)},{i:m-2,x:Te(c,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(u,c){var f=[],h=[];return u=t(u),c=t(c),o(u.translateX,u.translateY,c.translateX,c.translateY,f,h),a(u.rotate,c.rotate,f,h),s(u.skewX,c.skewX,f,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,h),u=c=null,function(p){for(var d=-1,m=h.length,g;++d<m;)f[(g=h[d]).i]=g.x(p);return f.join("")}}}var VS=Zd(YS,"px, ","px)","deg)"),WS=Zd(XS,", ",")",")"),kr=0,Ii=0,Bi=0,Kd=1e3,Ta,Ni,Pa=0,On=0,Da=0,Fi=typeof performance=="object"&&performance.now?performance:Date,Qd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ou(){return On||(Qd(US),On=Fi.now()+Da)}function US(){On=0}function Ma(){this._call=this._time=this._next=null}Ma.prototype=Jd.prototype={constructor:Ma,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Ou():+n)+(e==null?0:+e),!this._next&&Ni!==this&&(Ni?Ni._next=this:Ta=this,Ni=this),this._call=t,this._time=n,zu()},stop:function(){this._call&&(this._call=null,this._time=1/0,zu())}};function Jd(t,e,n){var r=new Ma;return r.restart(t,e,n),r}function HS(){Ou(),++kr;for(var t=Ta,e;t;)(e=On-t._time)>=0&&t._call.call(void 0,e),t=t._next;--kr}function tg(){On=(Pa=Fi.now())+Da,kr=Ii=0;try{HS()}finally{kr=0,qS(),On=0}}function jS(){var t=Fi.now(),e=t-Pa;e>Kd&&(Da-=e,Pa=t)}function qS(){for(var t,e=Ta,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Ta=n);Ni=t,zu(r)}function zu(t){if(!kr){Ii&&(Ii=clearTimeout(Ii));var e=t-On;e>24?(t<1/0&&(Ii=setTimeout(tg,t-Fi.now()-Da)),Bi&&(Bi=clearInterval(Bi))):(Bi||(Pa=Fi.now(),Bi=setInterval(jS,Kd)),kr=1,Qd(tg))}}function eg(t,e,n){var r=new Ma;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var ZS=$d("start","end","cancel","interrupt"),KS=[],ng=0,rg=1,Gu=2,Ca=3,ig=4,Yu=5,La=6;function ka(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;QS(t,n,{name:e,index:r,group:i,on:ZS,tween:KS,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:ng})}function Xu(t,e){var n=Pe(t,e);if(n.state>ng)throw new Error("too late; already scheduled");return n}function Fe(t,e){var n=Pe(t,e);if(n.state>Ca)throw new Error("too late; already running");return n}function Pe(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function QS(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Jd(o,0,n.time);function o(u){n.state=rg,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,f,h,p;if(n.state!==rg)return l();for(c in r)if(p=r[c],p.name===n.name){if(p.state===Ca)return eg(a);p.state===ig?(p.state=La,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete r[c]):+c<e&&(p.state=La,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete r[c])}if(eg(function(){n.state===Ca&&(n.state=ig,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=Gu,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Gu){for(n.state=Ca,i=new Array(h=n.tween.length),c=0,f=-1;c<h;++c)(p=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Yu,1),f=-1,h=i.length;++f<h;)i[f].call(t,c);n.state===Yu&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){n.state=La,n.timer.stop(),delete r[e];for(var u in r)return;delete t.__transition}}function JS(t,e){var n=t.__transition,r,i,o=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){o=!1;continue}i=r.state>Gu&&r.state<Yu,r.state=La,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}o&&delete t.__transition}}function tA(t){return this.each(function(){JS(this,t)})}function eA(t,e){var n,r;return function(){var i=Fe(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function nA(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Fe(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:e,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===e){i[l]=s;break}l===u&&i.push(s)}o.tween=i}}function rA(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Pe(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?eA:nA)(n,t,e))}function Vu(t,e,n){var r=t._id;return t.each(function(){var i=Fe(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Pe(i,r).value[e]}}function og(t,e){var n;return(typeof e=="number"?Te:e instanceof Bn?Sa:(n=Bn(e))?(e=n,Sa):Ud)(t,e)}function iA(t){return function(){this.removeAttribute(t)}}function oA(t){return function(){this.removeAttributeNS(t.space,t.local)}}function aA(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function sA(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function lA(t,e,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttribute(t):(a=this.getAttribute(t),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=e(r=a,s)))}}function uA(t,e,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=e(r=a,s)))}}function cA(t,e){var n=ba(t),r=n==="transform"?WS:og;return this.attrTween(t,typeof e=="function"?(n.local?uA:lA)(n,r,Vu(this,"attr."+t,e)):e==null?(n.local?oA:iA)(n):(n.local?sA:aA)(n,r,e))}function fA(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function hA(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function pA(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&hA(t,o)),n}return i._value=e,i}function dA(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&fA(t,o)),n}return i._value=e,i}function gA(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=ba(t);return this.tween(n,(r.local?pA:dA)(r,e))}function mA(t,e){return function(){Xu(this,t).delay=+e.apply(this,arguments)}}function yA(t,e){return e=+e,function(){Xu(this,t).delay=e}}function bA(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?mA:yA)(e,t)):Pe(this.node(),e).delay}function xA(t,e){return function(){Fe(this,t).duration=+e.apply(this,arguments)}}function vA(t,e){return e=+e,function(){Fe(this,t).duration=e}}function $A(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?xA:vA)(e,t)):Pe(this.node(),e).duration}function _A(t,e){if(typeof e!="function")throw new Error;return function(){Fe(this,t).ease=e}}function wA(t){var e=this._id;return arguments.length?this.each(_A(e,t)):Pe(this.node(),e).ease}function SA(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Fe(this,t).ease=n}}function AA(t){if(typeof t!="function")throw new Error;return this.each(SA(this._id,t))}function TA(t){typeof t!="function"&&(t=Td(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&t.call(l,l.__data__,u,o)&&s.push(l);return new Qe(r,this._parents,this._name,this._id)}function PA(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var l=e[s],u=n[s],c=l.length,f=a[s]=new Array(c),h,p=0;p<c;++p)(h=l[p]||u[p])&&(f[p]=h);for(;s<r;++s)a[s]=e[s];return new Qe(a,this._parents,this._name,this._id)}function DA(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function MA(t,e,n){var r,i,o=DA(e)?Xu:Fe;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}function CA(t,e){var n=this._id;return arguments.length<2?Pe(this.node(),n).on.on(t):this.each(MA(n,t,e))}function LA(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function kA(){return this.on("end.remove",LA(this._id))}function RA(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Cu(t));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,f,h=0;h<l;++h)(c=s[h])&&(f=t.call(c,c.__data__,h,s))&&("__data__"in c&&(f.__data__=c.__data__),u[h]=f,ka(u[h],e,n,h,u,Pe(c,n)));return new Qe(o,this._parents,e,n)}function EA(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ad(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var l=r[s],u=l.length,c,f=0;f<u;++f)if(c=l[f]){for(var h=t.call(c,c.__data__,f,l),p,d=Pe(c,n),m=0,g=h.length;m<g;++m)(p=h[m])&&ka(p,e,n,m,h,d);o.push(h),a.push(c)}return new Qe(o,a,e,n)}var IA=Li.prototype.constructor;function BA(){return new IA(this._groups,this._parents)}function NA(t,e){var n,r,i;return function(){var o=Cr(this,t),a=(this.style.removeProperty(t),Cr(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}function ag(t){return function(){this.style.removeProperty(t)}}function FA(t,e,n){var r,i=n+"",o;return function(){var a=Cr(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function OA(t,e,n){var r,i,o;return function(){var a=Cr(this,t),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(t),Cr(this,t))),a===l?null:a===r&&l===i?o:(i=l,o=e(r=a,s))}}function zA(t,e){var n,r,i,o="style."+e,a="end."+o,s;return function(){var l=Fe(this,t),u=l.on,c=l.value[o]==null?s||(s=ag(e)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(a,i=c),l.on=r}}function GA(t,e,n){var r=(t+="")=="transform"?VS:og;return e==null?this.styleTween(t,NA(t,r)).on("end.style."+t,ag(t)):typeof e=="function"?this.styleTween(t,OA(t,r,Vu(this,"style."+t,e))).each(zA(this._id,t)):this.styleTween(t,FA(t,r,e),n).on("end.style."+t,null)}function YA(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function XA(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&YA(t,a,n)),r}return o._value=e,o}function VA(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,XA(t,e,n??""))}function WA(t){return function(){this.textContent=t}}function UA(t){return function(){var e=t(this);this.textContent=e??""}}function HA(t){return this.tween("text",typeof t=="function"?UA(Vu(this,"text",t)):WA(t==null?"":t+""))}function jA(t){return function(e){this.textContent=t.call(this,e)}}function qA(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&jA(i)),e}return r._value=t,r}function ZA(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,qA(t))}function KA(){for(var t=this._name,e=this._id,n=sg(),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=Pe(l,e);ka(l,t,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Qe(r,this._parents,t,n)}function QA(){var t,e,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=Fe(this,r),c=u.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(l)),u.on=e}),i===0&&o()})}var JA=0;function Qe(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function sg(){return++JA}var Je=Li.prototype;Qe.prototype={constructor:Qe,select:RA,selectAll:EA,selectChild:Je.selectChild,selectChildren:Je.selectChildren,filter:TA,merge:PA,selection:BA,transition:KA,call:Je.call,nodes:Je.nodes,node:Je.node,size:Je.size,empty:Je.empty,each:Je.each,on:CA,attr:cA,attrTween:gA,style:GA,styleTween:VA,text:HA,textTween:ZA,remove:kA,tween:rA,delay:bA,duration:$A,ease:wA,easeVarying:AA,end:QA,[Symbol.iterator]:Je[Symbol.iterator]};function tT(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var eT={time:null,delay:0,duration:250,ease:tT};function nT(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function rT(t){var e,n;t instanceof Qe?(e=t._id,t=t._name):(e=sg(),(n=eT).time=Ou(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&ka(l,t,e,u,a,n||nT(l,e));return new Qe(r,this._parents,t,e)}Li.prototype.interrupt=tA,Li.prototype.transition=rT;function iT(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Ra(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Rr(t){return t=Ra(Math.abs(t)),t?t[1]:NaN}function oT(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[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=t[a=(a+1)%t.length];return o.reverse().join(e)}}function aT(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var sT=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ea(t){if(!(e=sT.exec(t)))throw new Error("invalid format: "+t);var e;return new Wu({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Ea.prototype=Wu.prototype;function Wu(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Wu.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 lT(t){t:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var lg;function uT(t,e){var n=Ra(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(lg=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")+Ra(t,Math.max(0,e+o-1))[0]}function ug(t,e){var n=Ra(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const cg={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:iT,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>ug(t*100,e),r:ug,s:uT,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function fg(t){return t}var hg=Array.prototype.map,pg=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function cT(t){var e=t.grouping===void 0||t.thousands===void 0?fg:oT(hg.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?fg:aT(hg.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(f){f=Ea(f);var h=f.fill,p=f.align,d=f.sign,m=f.symbol,g=f.zero,y=f.width,b=f.comma,v=f.precision,x=f.trim,_=f.type;_==="n"?(b=!0,_="g"):cg[_]||(v===void 0&&(v=12),x=!0,_="g"),(g||h==="0"&&p==="=")&&(g=!0,h="0",p="=");var S=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",A=m==="$"?r:/[%p]/.test(_)?a:"",T=cg[_],C=/[defgprs%]/.test(_);v=v===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function I($){var L=S,P=A,w,M,D;if(_==="c")P=T($)+P,$="";else{$=+$;var X=$<0||1/$<0;if($=isNaN($)?l:T(Math.abs($),v),x&&($=lT($)),X&&+$==0&&d!=="+"&&(X=!1),L=(X?d==="("?d:s:d==="-"||d==="("?"":d)+L,P=(_==="s"?pg[8+lg/3]:"")+P+(X&&d==="("?")":""),C){for(w=-1,M=$.length;++w<M;)if(D=$.charCodeAt(w),48>D||D>57){P=(D===46?i+$.slice(w+1):$.slice(w))+P,$=$.slice(0,w);break}}}b&&!g&&($=e($,1/0));var O=L.length+$.length+P.length,E=O<y?new Array(y-O+1).join(h):"";switch(b&&g&&($=e(E+$,E.length?y-P.length:1/0),E=""),p){case"<":$=L+$+P+E;break;case"=":$=L+E+$+P;break;case"^":$=E.slice(0,O=E.length>>1)+L+$+P+E.slice(O);break;default:$=E+L+$+P;break}return o($)}return I.toString=function(){return f+""},I}function c(f,h){var p=u((f=Ea(f),f.type="f",f)),d=Math.max(-8,Math.min(8,Math.floor(Rr(h)/3)))*3,m=Math.pow(10,-d),g=pg[8+d/3];return function(y){return p(m*y)+g}}return{format:u,formatPrefix:c}}var Ia,dg,gg;fT({thousands:",",grouping:[3],currency:["$",""]});function fT(t){return Ia=cT(t),dg=Ia.format,gg=Ia.formatPrefix,Ia}function hT(t){return Math.max(0,-Rr(Math.abs(t)))}function pT(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Rr(e)/3)))*3-Rr(Math.abs(t)))}function dT(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Rr(e)-Rr(t))+1}function mg(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function gT(t){return function(){return t}}function mT(t){return+t}var yg=[0,1];function Er(t){return t}function Uu(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:gT(isNaN(e)?NaN:.5)}function yT(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function bT(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=Uu(i,r),o=n(a,o)):(r=Uu(r,i),o=n(o,a)),function(s){return o(r(s))}}function xT(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=Uu(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(s){var l=vd(t,s,1,r)-1;return o[l](i[l](s))}}function vT(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function $T(){var t=yg,e=yg,n=Fu,r,i,o,a=Er,s,l,u;function c(){var h=Math.min(t.length,e.length);return a!==Er&&(a=yT(t[0],t[h-1])),s=h>2?xT:bT,l=u=null,f}function f(h){return h==null||isNaN(h=+h)?o:(l||(l=s(t.map(r),e,n)))(r(a(h)))}return f.invert=function(h){return a(i((u||(u=s(e,t.map(r),Te)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,mT),c()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),c()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=GS,c()},f.clamp=function(h){return arguments.length?(a=h?!0:Er,c()):a!==Er},f.interpolate=function(h){return arguments.length?(n=h,c()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,p){return r=h,i=p,c()}}function _T(){return $T()(Er,Er)}function wT(t,e,n,r){var i=B_(t,e,n),o;switch(r=Ea(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=pT(i,a))&&(r.precision=o),gg(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=dT(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=hT(i))&&(r.precision=o-(r.type==="%")*2);break}}return dg(r)}function bg(t){var e=t.domain;return t.ticks=function(n){var r=e();return I_(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return wT(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],s=r[o],l,u,c=10;for(s<a&&(u=a,a=s,s=u,u=i,i=o,o=u);c-- >0;){if(u=Du(a,s,n),u===l)return r[i]=a,r[o]=s,e(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 t},t}function Oi(){var t=_T();return t.copy=function(){return vT(t,Oi())},mg.apply(t,arguments),bg(t)}function xg(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function a(l){return l!=null&&l<=l?i[vd(r,l,0,n)]:o}function s(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*e-(l-n)*t)/(n+1);return a}return a.domain=function(l){return arguments.length?([t,e]=l,t=+t,e=+e,s()):[t,e]},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?[t,r[0]]:u>=n?[r[n-1],e]:[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 xg().domain([t,e]).range(i).unknown(o)},mg.apply(bg(a),arguments)}function zi(t,e,n){this.k=t,this.x=e,this.y=n}zi.prototype={constructor:zi,scale:function(t){return t===1?this:new zi(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new zi(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},zi.prototype;function ST(t){const e=[0,0];return t.length?t.reduce((n,r)=>[r<n[0]?r:n[0],r>n[1]?r:n[1]],[t[0],t[0]]):e}function AT(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function vg(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:o}=e.rowAmount*e.columnAmount>=n?e:AT(n);return new Array(n).fill(null).map((a,s)=>{const l=s%o,u=Math.floor(s/o),c=(t.width-r*(o-1))/o,f=(t.height-r*(i-1))/i,h=l*c+l*r,p=u*f+u*r,d=[h,p],m=[c/t.width,f/t.height];return{slotIndex:s,rowIndex:u,columnIndex:l,translate:d,scale:m}})}var Hu=function(t,e){return Hu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Hu(t,e)};function Oe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Hu(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function TT(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{u(r.next(c))}catch(f){a(f)}}function l(c){try{u(r.throw(c))}catch(f){a(f)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(t,[])).next())})}function $g(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(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=e.call(t,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 Ir(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Br(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function Nr(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function Fr(t){return this instanceof Fr?(this.v=t,this):new Fr(t)}function PT(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(p){return function(d){return Promise.resolve(d).then(p,f)}}function s(p,d){r[p]&&(i[p]=function(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){h(o[0][3],m)}}function u(p){p.value instanceof Fr?Promise.resolve(p.value.v).then(c,f):h(o[0][2],p)}function c(p){l("next",p)}function f(p){l("throw",p)}function h(p,d){p(d),o.shift(),o.length&&l(o[0][0],o[0][1])}}function DT(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof Ir=="function"?Ir(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(a){return new Promise(function(s,l){a=t[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 Ct(t){return typeof t=="function"}function ju(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var qu=ju(function(t){return function(e){t(this),this.message=e?e.length+` errors occurred during unsubscription:
37
- `+e.map(function(n,r){return r+1+") "+n.toString()}).join(`
38
- `):"",this.name="UnsubscriptionError",this.errors=e}});function Ba(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Gi=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=Ir(a),l=s.next();!l.done;l=s.next()){var u=l.value;u.remove(this)}}catch(m){e={error:m}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(Ct(c))try{c()}catch(m){o=m instanceof qu?m.errors:[m]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=Ir(f),p=h.next();!p.done;p=h.next()){var d=p.value;try{Sg(d)}catch(m){o=o??[],m instanceof qu?o=Nr(Nr([],Br(o)),Br(m.errors)):o.push(m)}}}catch(m){r={error:m}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(o)throw new qu(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Sg(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&Ba(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&Ba(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),_g=Gi.EMPTY;function wg(t){return t instanceof Gi||t&&"closed"in t&&Ct(t.remove)&&Ct(t.add)&&Ct(t.unsubscribe)}function Sg(t){Ct(t)?t():t.unsubscribe()}var Ag={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},MT={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,Nr([t,e],Br(n)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function Tg(t){MT.setTimeout(function(){throw t})}function Zu(){}function Na(t){t()}var Ku=function(t){Oe(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,wg(n)&&n.add(r)):r.destination=RT,r}return e.create=function(n,r,i){return new Yi(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Gi),CT=Function.prototype.bind;function Qu(t,e){return CT.call(t,e)}var LT=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){Fa(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){Fa(r)}else Fa(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){Fa(n)}},t}(),Yi=function(t){Oe(e,t);function e(n,r,i){var o=t.call(this)||this,a;if(Ct(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;o&&Ag.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&Qu(n.next,s),error:n.error&&Qu(n.error,s),complete:n.complete&&Qu(n.complete,s)}):a=n}return o.destination=new LT(a),o}return e}(Ku);function Fa(t){Tg(t)}function kT(t){throw t}var RT={closed:!0,next:Zu,error:kT,complete:Zu},Ju=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Oa(t){return t}function ET(t){return t.length===0?Oa:t.length===1?t[0]:function(e){return t.reduce(function(n,r){return r(n)},e)}}var ue=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,o=BT(e)?e:new Yi(e,n,r);return Na(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},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=Pg(n),new n(function(i,o){var a=new Yi({next:function(s){try{e(s)}catch(l){o(l),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[Ju]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return ET(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Pg(e),new e(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},t.create=function(e){return new t(e)},t}();function Pg(t){var e;return(e=t??Ag.Promise)!==null&&e!==void 0?e:Promise}function IT(t){return t&&Ct(t.next)&&Ct(t.error)&&Ct(t.complete)}function BT(t){return t&&t instanceof Ku||IT(t)&&wg(t)}function NT(t){return Ct(t==null?void 0:t.lift)}function zn(t){return function(e){if(NT(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function Gn(t,e,n,r,i){return new FT(t,e,n,r,i)}var FT=function(t){Oe(e,t);function e(n,r,i,o,a,s){var l=t.call(this,n)||this;return l.onFinalize=a,l.shouldUnsubscribe=s,l._next=r?function(u){try{r(u)}catch(c){n.error(c)}}:t.prototype._next,l._error=o?function(u){try{o(u)}catch(c){n.error(c)}finally{this.unsubscribe()}}:t.prototype._error,l._complete=i?function(){try{i()}catch(u){n.error(u)}finally{this.unsubscribe()}}:t.prototype._complete,l}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(Ku),OT=ju(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Or=function(t){Oe(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new Dg(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new OT},e.prototype.next=function(n){var r=this;Na(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=Ir(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}}}})},e.prototype.error=function(n){var r=this;Na(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;Na(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?_g:(this.currentObservers=null,s.push(n),new Gi(function(){r.currentObservers=null,Ba(s,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},e.prototype.asObservable=function(){var n=new ue;return n.source=this,n},e.create=function(n,r){return new Dg(n,r)},e}(ue),Dg=function(t){Oe(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:_g},e}(Or),Mg=function(t){Oe(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,o=n._value;if(r)throw i;return this._throwIfClosed(),o},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(Or),tc={now:function(){return(tc.delegate||Date).now()},delegate:void 0},zT=function(t){Oe(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=tc);var o=t.call(this)||this;return o._bufferSize=n,o._windowTime=r,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,n),o._windowTime=Math.max(1,r),o}return e.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,s=r._timestampProvider,l=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+l)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,o=i._infiniteTimeWindow,a=i._buffer,s=a.slice(),l=0;l<s.length&&!n.closed;l+=o?1:2)n.next(s[l]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,o=n._buffer,a=n._infiniteTimeWindow,s=(a?1:2)*r;if(r<1/0&&s<o.length&&o.splice(0,o.length-s),!a){for(var l=i.now(),u=0,c=1;c<o.length&&o[c]<=l;c+=2)u=c;u&&o.splice(0,u+1)}},e}(Or),GT=function(t){Oe(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Gi),Cg={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,Nr([t,e],Br(n)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},YT=function(t){Oe(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var o=this.id,a=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(a,o,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),Cg.setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&Cg.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,o;try{this.work(n)}catch(a){i=!0,o=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Ba(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(GT),Lg=function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=tc.now,t}(),XT=function(t){Oe(e,t);function e(n,r){r===void 0&&(r=Lg.now);var i=t.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e}(Lg);new XT(YT);function VT(t){return t&&Ct(t.schedule)}function kg(t){return t[t.length-1]}function WT(t){return Ct(kg(t))?t.pop():void 0}function UT(t){return VT(kg(t))?t.pop():void 0}var Rg=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Eg(t){return Ct(t==null?void 0:t.then)}function Ig(t){return Ct(t[Ju])}function Bg(t){return Symbol.asyncIterator&&Ct(t==null?void 0:t[Symbol.asyncIterator])}function Ng(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function HT(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Fg=HT();function Og(t){return Ct(t==null?void 0:t[Fg])}function zg(t){return PT(this,arguments,function(){var e,n,r,i;return $g(this,function(o){switch(o.label){case 0:e=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Fr(e.read())];case 3:return n=o.sent(),r=n.value,i=n.done,i?[4,Fr(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Fr(r)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function Gg(t){return Ct(t==null?void 0:t.getReader)}function Yn(t){if(t instanceof ue)return t;if(t!=null){if(Ig(t))return jT(t);if(Rg(t))return qT(t);if(Eg(t))return ZT(t);if(Bg(t))return Yg(t);if(Og(t))return KT(t);if(Gg(t))return QT(t)}throw Ng(t)}function jT(t){return new ue(function(e){var n=t[Ju]();if(Ct(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function qT(t){return new ue(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function ZT(t){return new ue(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Tg)})}function KT(t){return new ue(function(e){var n,r;try{for(var i=Ir(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function Yg(t){return new ue(function(e){JT(t,e).catch(function(n){return e.error(n)})})}function QT(t){return Yg(zg(t))}function JT(t,e){var n,r,i,o;return TT(this,void 0,void 0,function(){var a,s;return $g(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=DT(t),l.label=1;case 1:return[4,n.next()];case 2:if(r=l.sent(),!!r.done)return[3,4];if(a=r.value,e.next(a),e.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 e.complete(),[2]}})})}function xn(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(o),!i)return o}function Xg(t,e){return e===void 0&&(e=0),zn(function(n,r){n.subscribe(Gn(r,function(i){return xn(r,t,function(){return r.next(i)},e)},function(){return xn(r,t,function(){return r.complete()},e)},function(i){return xn(r,t,function(){return r.error(i)},e)}))})}function Vg(t,e){return e===void 0&&(e=0),zn(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function tP(t,e){return Yn(t).pipe(Vg(e),Xg(e))}function eP(t,e){return Yn(t).pipe(Vg(e),Xg(e))}function nP(t,e){return new ue(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function rP(t,e){return new ue(function(n){var r;return xn(n,e,function(){r=t[Fg](),xn(n,e,function(){var i,o,a;try{i=r.next(),o=i.value,a=i.done}catch(s){n.error(s);return}a?n.complete():n.next(o)},0,!0)}),function(){return Ct(r==null?void 0:r.return)&&r.return()}})}function Wg(t,e){if(!t)throw new Error("Iterable cannot be null");return new ue(function(n){xn(n,e,function(){var r=t[Symbol.asyncIterator]();xn(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function iP(t,e){return Wg(zg(t),e)}function oP(t,e){if(t!=null){if(Ig(t))return tP(t,e);if(Rg(t))return nP(t,e);if(Eg(t))return eP(t,e);if(Bg(t))return Wg(t,e);if(Og(t))return rP(t,e);if(Gg(t))return iP(t,e)}throw Ng(t)}function Ug(t,e){return e?oP(t,e):Yn(t)}ju(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function zr(t,e){return zn(function(n,r){var i=0;n.subscribe(Gn(r,function(o){r.next(t.call(e,o,i++))}))})}var aP=Array.isArray;function sP(t,e){return aP(e)?t.apply(void 0,Nr([],Br(e))):t(e)}function lP(t){return zr(function(e){return sP(t,e)})}var uP=Array.isArray,cP=Object.getPrototypeOf,fP=Object.prototype,hP=Object.keys;function pP(t){if(t.length===1){var e=t[0];if(uP(e))return{args:e,keys:null};if(dP(e)){var n=hP(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function dP(t){return t&&typeof t=="object"&&cP(t)===fP}function gP(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function Hg(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=UT(t),r=WT(t),i=pP(t),o=i.args,a=i.keys;if(o.length===0)return Ug([],n);var s=new ue(mP(o,n,a?function(l){return gP(a,l)}:Oa));return r?s.pipe(lP(r)):s}function mP(t,e,n){return n===void 0&&(n=Oa),function(r){jg(e,function(){for(var i=t.length,o=new Array(i),a=i,s=i,l=function(c){jg(e,function(){var f=Ug(t[c],e),h=!1;f.subscribe(Gn(r,function(p){o[c]=p,h||(h=!0,s--),s||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},u=0;u<i;u++)l(u)},r)}}function jg(t,e,n){t?xn(n,t,e):e()}function yP(t,e){return e===void 0&&(e=Oa),t=t??bP,zn(function(n,r){var i,o=!0;n.subscribe(Gn(r,function(a){var s=e(a);(o||!t(i,s))&&(o=!1,i=s,r.next(a))}))})}function bP(t,e){return t===e}function xP(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new Or}:e,r=t.resetOnError,i=r===void 0?!0:r,o=t.resetOnComplete,a=o===void 0?!0:o,s=t.resetOnRefCountZero,l=s===void 0?!0:s;return function(u){var c,f,h,p=0,d=!1,m=!1,g=function(){f==null||f.unsubscribe(),f=void 0},y=function(){g(),c=h=void 0,d=m=!1},b=function(){var v=c;y(),v==null||v.unsubscribe()};return zn(function(v,x){p++,!m&&!d&&g();var _=h=h??n();x.add(function(){p--,p===0&&!m&&!d&&(f=ec(b,l))}),_.subscribe(x),!c&&p>0&&(c=new Yi({next:function(S){return _.next(S)},error:function(S){m=!0,g(),f=ec(y,i,S),_.error(S)},complete:function(){d=!0,g(),f=ec(y,a),_.complete()}}),Yn(v).subscribe(c))})(u)}}function ec(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new Yi({next:function(){i.unsubscribe(),t()}});return Yn(e.apply(void 0,Nr([],Br(n)))).subscribe(i)}}function vP(t,e,n){var r,i=!1;return r=t,xP({connector:function(){return new zT(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function nc(t,e){return zn(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(Gn(r,function(l){i==null||i.unsubscribe();var u=0,c=o++;Yn(t(l,c)).subscribe(i=Gn(r,function(f){return r.next(e?e(l,f,c,u++):f)},function(){i=null,s()}))},function(){a=!0,s()}))})}function qg(t){return zn(function(e,n){Yn(t).subscribe(Gn(n,function(){return n.complete()},Zu)),!n.closed&&e.subscribe(n)})}const $P=t=>t.pipe(zr(e=>e.styles.textSize),yP(),zr(e=>{let n=NaN;if(typeof e=="string")if(e.includes("rem")){const r=parseFloat(getComputedStyle(document.documentElement).fontSize);n=parseFloat(e)*r}else e.includes("px")&&(n=parseFloat(e));else if(typeof e=="number")return e;return n||14})),Xi=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=ge.scaleDomain,scaleRange:i=ge.scaleRange,reverse:o=!1})=>{const a=r[0]??ge.scaleDomain[0],s=r[1]??ge.scaleDomain[1],l=i[0]??ge.scaleRange[0],u=i[1]??ge.scaleRange[1];let c=a==="auto"?e<0?e:0:a==="min"?e:a,f=s==="auto"?t>=0?t:0:s==="max"?t:s;const h=t-(t-c)/(1-l),p=f/u;return o?Oi().domain([h,p]).range([n,0]):Oi().domain([h,p]).range([0,n])},Zg=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=ge.scaleDomain,scaleRange:i=ge.scaleRange,reverse:o=!1})=>{e===t&&(t+=1,e-=1);const a=r[0]??ge.scaleDomain[0],s=r[1]??ge.scaleDomain[1],l=i[0]??ge.scaleRange[0],u=i[1]??ge.scaleRange[1];let c=a==="auto"?e<0?e:0:a==="min"?e:a,f=s==="auto"?t>=0?t:0:s==="max"?t:s;const h=t-(t-c)/(1-l),p=f/u;return o?Oi().domain([n,0]).range([h,p]):Oi().domain([0,n]).range([h,p])},Kg=({axisLabels:t,axisWidth:e,padding:n=0,reverse:r=!1})=>{let i=t.map((l,u)=>u);r&&i.reverse();const o=i.length-1+n*2,a=e/o,s=a*n-a*.5;return xg().domain([s,e-s]).range(i)},Qg=({computedData$:t,fullDataFormatter$:e,layout$:n})=>Hg({computedData:t,fullDataFormatter:e,layout:n}).pipe(nc(async r=>r),zr(r=>{if(r.fullDataFormatter.grid.separateSeries)return vg(r.layout,r.fullDataFormatter.container,r.computedData.length);{const i=vg(r.layout,r.fullDataFormatter.container,1);return r.computedData.map((o,a)=>i[0])}})),Jg=({fullDataFormatter$:t,layout$:e})=>{const n=new Or;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,f=0,h=0;return i.position==="bottom"?o.position==="left"?(f=180,u=s):o.position==="right"?(f=180,h=180,l=a,u=s):(f=180,u=s):i.position==="top"?o.position==="left"||(o.position==="right"?(h=180,l=a):(f=180,u=s)):i.position==="left"?o.position==="bottom"?(c=-90,u=s):o.position==="top"?(c=-90,h=180):(f=180,u=s):i.position==="right"?o.position==="bottom"?(c=-90,f=180,u=s,l=a):o.position==="top"?(c=-90,f=180,h=180,l=a):(f=180,u=s):(f=180,u=s),{translate:[l,u],scale:[1,1],rotate:c,rotateX:f,rotateY:h,value:`translate(${l}px, ${u}px) rotate(${c}deg) rotateX(${f}deg) rotateY(${h}deg)`}}return new ue(i=>(Hg({fullDataFormatter:t,layout:e}).pipe(qg(n),nc(async o=>o)).subscribe(o=>{const a=r({xAxis:o.fullDataFormatter.grid.groupAxis,yAxis:o.fullDataFormatter.grid.valueAxis,width:o.layout.width,height:o.layout.height});i.next(a)}),function(){n.next(void 0)}))},t0=({gridAxesTransform$:t})=>t.pipe(zr(e=>{const n=[0,0],r=[1/e.scale[0],1/e.scale[1]],i=e.rotate*-1,o=e.rotateX*-1,a=e.rotateY*-1;return{translate:n,scale:r,rotate:i,rotateX:o,rotateY:a,value:`translate(${n[0]}px, ${n[1]}px) rotateX(${o}deg) rotateY(${a}deg) rotate(${i}deg)`}}));function _P(t){return`[OrbCharts warn]: ${t.message}`}function wP({columnName:t,expectToBe:e,from:n}){return`Invalid value: '${t}' must be '${e}'
36
+ `):"",this.name="UnsubscriptionError",this.errors=n}});function ya(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Gi=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 Su?m.errors:[m]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=Mr(f),p=h.next();!p.done;p=h.next()){var d=p.value;try{cd(d)}catch(m){o=o??[],m instanceof Su?o=Cr(Cr([],zn(o)),zn(m.errors)):o.push(m)}}}catch(m){r={error:m}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(o)throw new Su(o)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)cd(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)&&ya(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&ya(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),ld=Gi.EMPTY;function ud(e){return e instanceof Gi||e&&"closed"in e&&xe(e.remove)&&xe(e.add)&&xe(e.unsubscribe)}function cd(e){xe(e)?e():e.unsubscribe()}var fd={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},hd={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,Cr([e,t],zn(n)))},clearTimeout:function(e){var t=hd.delegate;return((t==null?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function pd(e){hd.setTimeout(function(){throw e})}function wu(){}function ba(e){e()}var Tu=function(e){zt(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,ud(n)&&n.add(r)):r.destination=J2,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}(Gi),Z2=Function.prototype.bind;function Au(e,t){return Z2.call(e,t)}var K2=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){xa(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){xa(r)}else xa(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){xa(n)}},e}(),Yi=function(e){zt(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&&fd.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&Au(n.next,s),error:n.error&&Au(n.error,s),complete:n.complete&&Au(n.complete,s)}):a=n}return o.destination=new K2(a),o}return t}(Tu);function xa(e){pd(e)}function Q2(e){throw e}var J2={closed:!0,next:wu,error:Q2,complete:wu},Pu=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function kr(e){return e}function e_(e){return e.length===0?kr:e.length===1?e[0]:function(n){return e.reduce(function(r,i){return i(r)},n)}}var de=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=n_(t)?t:new Yi(t,n,r);return ba(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=dd(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[Pu]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e_(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=dd(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 dd(e){var t;return(t=e??fd.Promise)!==null&&t!==void 0?t:Promise}function t_(e){return e&&xe(e.next)&&xe(e.error)&&xe(e.complete)}function n_(e){return e&&e instanceof Tu||t_(e)&&ud(e)}function r_(e){return xe(e==null?void 0:e.lift)}function ft(e){return function(t){if(r_(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 ot(e,t,n,r,i){return new i_(e,t,n,r,i)}var i_=function(e){zt(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}(Tu),o_=_u(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),J=function(e){zt(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 gd(this,this);return r.operator=n,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new o_},t.prototype.next=function(n){var r=this;ba(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;ba(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;ba(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?ld:(this.currentObservers=null,s.push(n),new Gi(function(){r.currentObservers=null,ya(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 de;return n.source=this,n},t.create=function(n,r){return new gd(n,r)},t}(de),gd=function(e){zt(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:ld},t}(J),Du=function(e){zt(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}(J),Mu={now:function(){return(Mu.delegate||Date).now()},delegate:void 0},a_=function(e){zt(t,e);function t(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=Mu);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}(J),s_=function(e){zt(t,e);function t(n,r){return e.call(this)||this}return t.prototype.schedule=function(n,r){return this},t}(Gi),Cu={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,Cr([e,t],zn(n)))},clearInterval:function(e){var t=Cu.delegate;return((t==null?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},l_=function(e){zt(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),Cu.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&&Cu.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,ya(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(s_),md=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=Mu.now,e}(),u_=function(e){zt(t,e);function t(n,r){r===void 0&&(r=md.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}(md),c_=new u_(l_),va=new de(function(e){return e.complete()});function f_(e){return e&&xe(e.schedule)}function Lu(e){return e[e.length-1]}function h_(e){return xe(Lu(e))?e.pop():void 0}function ku(e){return f_(Lu(e))?e.pop():void 0}function p_(e,t){return typeof Lu(e)=="number"?e.pop():t}var Ru=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function yd(e){return xe(e==null?void 0:e.then)}function bd(e){return xe(e[Pu])}function xd(e){return Symbol.asyncIterator&&xe(e==null?void 0:e[Symbol.asyncIterator])}function vd(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 d_(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var $d=d_();function _d(e){return xe(e==null?void 0:e[$d])}function Sd(e){return j2(this,arguments,function(){var n,r,i,o;return sd(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,Lr(n.read())];case 3:return r=a.sent(),i=r.value,o=r.done,o?[4,Lr(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Lr(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 wd(e){return xe(e==null?void 0:e.getReader)}function xt(e){if(e instanceof de)return e;if(e!=null){if(bd(e))return g_(e);if(Ru(e))return m_(e);if(yd(e))return y_(e);if(xd(e))return Td(e);if(_d(e))return b_(e);if(wd(e))return x_(e)}throw vd(e)}function g_(e){return new de(function(t){var n=e[Pu]();if(xe(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function m_(e){return new de(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function y_(e){return new de(function(t){e.then(function(n){t.closed||(t.next(n),t.complete())},function(n){return t.error(n)}).then(null,pd)})}function b_(e){return new de(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 Td(e){return new de(function(t){v_(e,t).catch(function(n){return t.error(n)})})}function x_(e){return Td(Sd(e))}function v_(e,t){var n,r,i,o;return H2(this,void 0,void 0,function(){var a,s;return sd(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=q2(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 $n(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 Ad(e,t){return t===void 0&&(t=0),ft(function(n,r){n.subscribe(ot(r,function(i){return $n(r,e,function(){return r.next(i)},t)},function(){return $n(r,e,function(){return r.complete()},t)},function(i){return $n(r,e,function(){return r.error(i)},t)}))})}function Pd(e,t){return t===void 0&&(t=0),ft(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function $_(e,t){return xt(e).pipe(Pd(t),Ad(t))}function __(e,t){return xt(e).pipe(Pd(t),Ad(t))}function S_(e,t){return new de(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function w_(e,t){return new de(function(n){var r;return $n(n,t,function(){r=e[$d](),$n(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 Dd(e,t){if(!e)throw new Error("Iterable cannot be null");return new de(function(n){$n(n,t,function(){var r=e[Symbol.asyncIterator]();$n(n,t,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function T_(e,t){return Dd(Sd(e),t)}function A_(e,t){if(e!=null){if(bd(e))return $_(e,t);if(Ru(e))return S_(e,t);if(yd(e))return __(e,t);if(xd(e))return Dd(e,t);if(_d(e))return w_(e,t);if(wd(e))return T_(e,t)}throw vd(e)}function $a(e,t){return t?A_(e,t):xt(e)}function _a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=ku(e);return $a(e,n)}var Md=_u(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function R(e,t){return ft(function(n,r){var i=0;n.subscribe(ot(r,function(o){r.next(e.call(t,o,i++))}))})}var P_=Array.isArray;function D_(e,t){return P_(t)?e.apply(void 0,Cr([],zn(t))):e(t)}function Cd(e){return R(function(t){return D_(e,t)})}var M_=Array.isArray,C_=Object.getPrototypeOf,L_=Object.prototype,k_=Object.keys;function R_(e){if(e.length===1){var t=e[0];if(M_(t))return{args:t,keys:null};if(E_(t)){var n=k_(t);return{args:n.map(function(r){return t[r]}),keys:n}}}return{args:e,keys:null}}function E_(e){return e&&typeof e=="object"&&C_(e)===L_}function I_(e,t){return e.reduce(function(n,r,i){return n[r]=t[i],n},{})}function Y(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=ku(e),r=h_(e),i=R_(e),o=i.args,a=i.keys;if(o.length===0)return $a([],n);var s=new de(B_(o,n,a?function(l){return I_(a,l)}:kr));return r?s.pipe(Cd(r)):s}function B_(e,t,n){return n===void 0&&(n=kr),function(r){Ld(t,function(){for(var i=e.length,o=new Array(i),a=i,s=i,l=function(c){Ld(t,function(){var f=$a(e[c],t),h=!1;f.subscribe(ot(r,function(p){o[c]=p,h||(h=!0,s--),s||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},u=0;u<i;u++)l(u)},r)}}function Ld(e,t,n){e?$n(n,e,t):t()}function N_(e,t,n,r,i,o,a,s){var l=[],u=0,c=0,f=!1,h=function(){f&&!l.length&&!u&&t.complete()},p=function(m){return u<r?d(m):l.push(m)},d=function(m){u++;var g=!1;xt(n(m,c++)).subscribe(ot(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();h()}catch(b){t.error(b)}}))};return e.subscribe(ot(t,p,function(){f=!0,h()})),function(){}}function Eu(e,t,n){return n===void 0&&(n=1/0),xe(t)?Eu(function(r,i){return R(function(o,a){return t(r,o,i,a)})(xt(e(r,i)))},n):(typeof t=="number"&&(n=t),ft(function(r,i){return N_(r,i,e,n)}))}function F_(e){return e===void 0&&(e=1/0),Eu(kr,e)}function z_(e){return new de(function(t){xt(e()).subscribe(t)})}var O_=["addListener","removeListener"],G_=["addEventListener","removeEventListener"],Y_=["on","off"];function Iu(e,t,n,r){if(xe(n)&&(r=n,n=void 0),r)return Iu(e,t,n).pipe(Cd(r));var i=zn(V_(e)?G_.map(function(s){return function(l){return e[s](t,l,n)}}):W_(e)?O_.map(kd(e,t)):X_(e)?Y_.map(kd(e,t)):[],2),o=i[0],a=i[1];if(!o&&Ru(e))return Eu(function(s){return Iu(s,t,n)})(xt(e));if(!o)throw new TypeError("Invalid event target");return new de(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 kd(e,t){return function(n){return function(r){return e[n](t,r)}}}function W_(e){return xe(e.addListener)&&xe(e.removeListener)}function X_(e){return xe(e.on)&&xe(e.off)}function V_(e){return xe(e.addEventListener)&&xe(e.removeEventListener)}function Wi(e,t,n){return z_(function(){return e()?t:n})}function Bu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=ku(e),r=p_(e,1/0),i=e;return i.length?i.length===1?xt(i[0]):F_(r)($a(i,n)):va}function Rr(e,t){return ft(function(n,r){var i=0;n.subscribe(ot(r,function(o){return e.call(t,o,i++)&&r.next(o)}))})}function U_(e,t){return t===void 0&&(t=c_),ft(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(ot(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 H_(e){return ft(function(t,n){var r=!1;t.subscribe(ot(n,function(i){r=!0,n.next(i)},function(){r||n.next(e),n.complete()}))})}function j_(e){return e<=0?function(){return va}:ft(function(t,n){var r=0;t.subscribe(ot(n,function(i){++r<=e&&(n.next(i),e<=r&&n.complete())}))})}function ee(e,t){return t===void 0&&(t=kr),e=e??q_,ft(function(n,r){var i,o=!0;n.subscribe(ot(r,function(a){var s=t(a);(o||!e(i,s))&&(o=!1,i=s,r.next(a))}))})}function q_(e,t){return e===t}function Z_(e){return e===void 0&&(e=K_),ft(function(t,n){var r=!1;t.subscribe(ot(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(e())}))})}function K_(){return new Md}function Xi(e,t){var n=arguments.length>=2;return function(r){return r.pipe(kr,j_(1),n?H_(t):Z_(function(){return new Md}))}}function Q_(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new J}: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,f,h,p=0,d=!1,m=!1,g=function(){f==null||f.unsubscribe(),f=void 0},y=function(){g(),c=h=void 0,d=m=!1},b=function(){var v=c;y(),v==null||v.unsubscribe()};return ft(function(v,x){p++,!m&&!d&&g();var _=h=h??n();x.add(function(){p--,p===0&&!m&&!d&&(f=Nu(b,l))}),_.subscribe(x),!c&&p>0&&(c=new Yi({next:function(A){return _.next(A)},error:function(A){m=!0,g(),f=Nu(y,i,A),_.error(A)},complete:function(){d=!0,g(),f=Nu(y,a),_.complete()}}),xt(v).subscribe(c))})(u)}}function Nu(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 xt(t.apply(void 0,Cr([],zn(n)))).subscribe(i)}}function pe(e,t,n){var r,i=!1;return r=e,Q_({connector:function(){return new a_(r,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function G(e,t){return ft(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(ot(r,function(l){i==null||i.unsubscribe();var u=0,c=o++;xt(e(l,c)).subscribe(i=ot(r,function(f){return r.next(t?t(l,f,c,u++):f)},function(){i=null,s()}))},function(){a=!0,s()}))})}function L(e){return ft(function(t,n){xt(e).subscribe(ot(n,function(){return n.complete()},wu)),!n.closed&&t.subscribe(n)})}const ht={position:"left",scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""},J_={position:"bottom",scaleDomain:[0,"max"],scalePadding:.5,label:""},eS={gap:120,rowAmount:1,columnAmount:1},tS={seriesDirection:"row",rowLabels:[],columnLabels:[],valueAxis:{...ht},groupAxis:{...J_},separateSeries:!1},nS={type:"grid",visibleFilter:(e,t)=>!0,...tS,container:{...eS}};nS.visibleFilter.toString=()=>"(datum, context) => true";function Er(e){return Object.prototype.toString.call(e)==="[object Object]"}function rS(e){return Object.prototype.toString.call(e)==="[object Function]"}function Fu(e,t){if(Er(e)===!1||Er(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;Er(r[a])&&Er(i[a])?(s=n(r[a],i[a]),o[a]=s):o[a]=r[a]}return o};return n(e,t)}function iS(e,t){const n={string:i=>typeof i=="string",number:i=>typeof i=="number",boolean:i=>typeof i=="boolean",object:i=>Er(i),"object[]":i=>Array.isArray(i)&&i.every(o=>Er(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=>rS(i),null:i=>i===null,undefined:i=>i===void 0},r={ColorType:i=>i==="none"||i==="label"||i==="primary"||i==="secondary"||i==="white"||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 oS(e,t){const n=iS(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 Sa(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function aS(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=Sa,n=(s,l)=>Sa(e(s),l),r=(s,l)=>e(s)-l):(t=e===Sa||e===aS?e:sS,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 f=u+c>>>1;n(s[f],l)<0?u=f+1:c=f}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 f=u+c>>>1;n(s[f],l)<=0?u=f+1:c=f}while(u<c)}return u}function a(s,l,u=0,c=s.length){const f=i(s,l,u,c-1);return f>u&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:a,right:o}}function sS(){return 0}function lS(e){return e===null?NaN:+e}const uS=Rd(Sa),Ed=uS.right;Rd(lS).center;const cS=Math.sqrt(50),fS=Math.sqrt(10),hS=Math.sqrt(2);function wa(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>=cS?10:o>=fS?5:o>=hS?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?wa(e,t,n*2):[s,l,u]}function pS(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?wa(t,e,n):wa(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 zu(e,t,n){return t=+t,e=+e,n=+n,wa(e,t,n)[2]}function dS(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?zu(t,e,n):zu(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}var gS={value:()=>{}};function Id(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ta(n)}function Ta(e){this._=e}function mS(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ta.prototype=Id.prototype={constructor:Ta,on:function(e,t){var n=this._,r=mS(e+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(e=r[o]).type)&&(i=yS(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]=Bd(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Bd(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ta(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,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 yS(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Bd(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=gS,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ou="http://www.w3.org/1999/xhtml";const Nd={svg:"http://www.w3.org/2000/svg",xhtml:Ou,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Aa(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Nd.hasOwnProperty(t)?{space:Nd[t],local:e}:e}function bS(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ou&&t.documentElement.namespaceURI===Ou?t.createElement(e):t.createElementNS(n,e)}}function xS(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Fd(e){var t=Aa(e);return(t.local?xS:bS)(t)}function vS(){}function Gu(e){return e==null?vS:function(){return this.querySelector(e)}}function $S(e){typeof e!="function"&&(e=Gu(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 Dt(r,this._parents)}function _S(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function SS(){return[]}function zd(e){return e==null?SS:function(){return this.querySelectorAll(e)}}function wS(e){return function(){return _S(e.apply(this,arguments))}}function TS(e){typeof e=="function"?e=wS(e):e=zd(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 Dt(r,i)}function Od(e){return function(){return this.matches(e)}}function Gd(e){return function(t){return t.matches(e)}}var AS=Array.prototype.find;function PS(e){return function(){return AS.call(this.children,e)}}function DS(){return this.firstElementChild}function MS(e){return this.select(e==null?DS:PS(typeof e=="function"?e:Gd(e)))}var CS=Array.prototype.filter;function LS(){return Array.from(this.children)}function kS(e){return function(){return CS.call(this.children,e)}}function RS(e){return this.selectAll(e==null?LS:kS(typeof e=="function"?e:Gd(e)))}function ES(e){typeof e!="function"&&(e=Od(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 Dt(r,this._parents)}function Yd(e){return new Array(e.length)}function IS(){return new Dt(this._enter||this._groups.map(Yd),this._parents)}function Pa(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Pa.prototype={constructor:Pa,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 BS(e){return function(){return e}}function NS(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 Pa(e,o[a]);for(;a<l;++a)(s=t[a])&&(i[a]=s)}function FS(e,t,n,r,i,o,a){var s,l,u=new Map,c=t.length,f=o.length,h=new Array(c),p;for(s=0;s<c;++s)(l=t[s])&&(h[s]=p=a.call(l,l.__data__,s,t)+"",u.has(p)?i[s]=l:u.set(p,l));for(s=0;s<f;++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 Pa(e,o[s]);for(s=0;s<c;++s)(l=t[s])&&u.get(h[s])===l&&(i[s]=l)}function zS(e){return e.__data__}function OS(e,t){if(!arguments.length)return Array.from(this,zS);var n=t?FS:NS,r=this._parents,i=this._groups;typeof e!="function"&&(e=BS(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],f=i[u],h=f.length,p=GS(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(h);n(c,f,m,g,y,p,t);for(var b=0,v=0,x,_;b<d;++b)if(x=m[b]){for(b>=v&&(v=b+1);!(_=g[v])&&++v<d;);x._next=_||null}}return a=new Dt(a,r),a._enter=s,a._exit=l,a}function GS(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function YS(){return new Dt(this._exit||this._groups.map(Yd),this._parents)}function WS(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 XS(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],f=u.length,h=s[l]=new Array(f),p,d=0;d<f;++d)(p=u[d]||c[d])&&(h[d]=p);for(;l<i;++l)s[l]=n[l];return new Dt(s,this._parents)}function VS(){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 US(e){e||(e=HS);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,l=i[o]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(t)}return new Dt(i,this._parents).order()}function HS(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function jS(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function qS(){return Array.from(this)}function ZS(){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 KS(){let e=0;for(const t of this)++e;return e}function QS(){return!this.node()}function JS(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 ew(e){return function(){this.removeAttribute(e)}}function tw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function nw(e,t){return function(){this.setAttribute(e,t)}}function rw(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function iw(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function ow(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 aw(e,t){var n=Aa(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?tw:ew:typeof t=="function"?n.local?ow:iw:n.local?rw:nw)(n,t))}function Wd(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function sw(e){return function(){this.style.removeProperty(e)}}function lw(e,t,n){return function(){this.style.setProperty(e,t,n)}}function uw(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function cw(e,t,n){return arguments.length>1?this.each((t==null?sw:typeof t=="function"?uw:lw)(e,t,n??"")):Ir(this.node(),e)}function Ir(e,t){return e.style.getPropertyValue(t)||Wd(e).getComputedStyle(e,null).getPropertyValue(t)}function fw(e){return function(){delete this[e]}}function hw(e,t){return function(){this[e]=t}}function pw(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function dw(e,t){return arguments.length>1?this.each((t==null?fw:typeof t=="function"?pw:hw)(e,t)):this.node()[e]}function Xd(e){return e.trim().split(/^|\s+/)}function Yu(e){return e.classList||new Vd(e)}function Vd(e){this._node=e,this._names=Xd(e.getAttribute("class")||"")}Vd.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 Ud(e,t){for(var n=Yu(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Hd(e,t){for(var n=Yu(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function gw(e){return function(){Ud(this,e)}}function mw(e){return function(){Hd(this,e)}}function yw(e,t){return function(){(t.apply(this,arguments)?Ud:Hd)(this,e)}}function bw(e,t){var n=Xd(e+"");if(arguments.length<2){for(var r=Yu(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?yw:t?gw:mw)(n,t))}function xw(){this.textContent=""}function vw(e){return function(){this.textContent=e}}function $w(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function _w(e){return arguments.length?this.each(e==null?xw:(typeof e=="function"?$w:vw)(e)):this.node().textContent}function Sw(){this.innerHTML=""}function ww(e){return function(){this.innerHTML=e}}function Tw(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Aw(e){return arguments.length?this.each(e==null?Sw:(typeof e=="function"?Tw:ww)(e)):this.node().innerHTML}function Pw(){this.nextSibling&&this.parentNode.appendChild(this)}function Dw(){return this.each(Pw)}function Mw(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Cw(){return this.each(Mw)}function Lw(e){var t=typeof e=="function"?e:Fd(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function kw(){return null}function Rw(e,t){var n=typeof e=="function"?e:Fd(e),r=t==null?kw:typeof t=="function"?t:Gu(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Ew(){var e=this.parentNode;e&&e.removeChild(this)}function Iw(){return this.each(Ew)}function Bw(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Nw(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Fw(e){return this.select(e?Nw:Bw)}function zw(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Ow(e){return function(t){e.call(this,t,this.__data__)}}function Gw(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 Yw(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 Ww(e,t,n){return function(){var r=this.__on,i,o=Ow(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 Xw(e,t,n){var r=Gw(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?Ww:Yw,i=0;i<o;++i)this.each(s(r[i],t,n));return this}function jd(e,t,n){var r=Wd(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 Vw(e,t){return function(){return jd(this,e,t)}}function Uw(e,t){return function(){return jd(this,e,t.apply(this,arguments))}}function Hw(e,t){return this.each((typeof t=="function"?Uw:Vw)(e,t))}function*jw(){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 qw=[null];function Dt(e,t){this._groups=e,this._parents=t}function Vi(){return new Dt([[document.documentElement]],qw)}function Zw(){return this}Dt.prototype=Vi.prototype={constructor:Dt,select:$S,selectAll:TS,selectChild:MS,selectChildren:RS,filter:ES,data:OS,enter:IS,exit:YS,join:WS,merge:XS,selection:Zw,order:VS,sort:US,call:jS,nodes:qS,node:ZS,size:KS,empty:QS,each:JS,attr:aw,style:cw,property:dw,classed:bw,text:_w,html:Aw,raise:Dw,lower:Cw,append:Lw,insert:Rw,remove:Iw,clone:Fw,datum:zw,on:Xw,dispatch:Hw,[Symbol.iterator]:jw};function Wu(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function qd(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ui(){}var Hi=.7,Da=1/Hi,Br="\\s*([+-]?\\d+)\\s*",ji="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ot="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Kw=/^#([0-9a-f]{3,8})$/,Qw=new RegExp(`^rgb\\(${Br},${Br},${Br}\\)$`),Jw=new RegExp(`^rgb\\(${Ot},${Ot},${Ot}\\)$`),eT=new RegExp(`^rgba\\(${Br},${Br},${Br},${ji}\\)$`),tT=new RegExp(`^rgba\\(${Ot},${Ot},${Ot},${ji}\\)$`),nT=new RegExp(`^hsl\\(${ji},${Ot},${Ot}\\)$`),rT=new RegExp(`^hsla\\(${ji},${Ot},${Ot},${ji}\\)$`),Zd={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};Wu(Ui,On,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Kd,formatHex:Kd,formatHex8:iT,formatHsl:oT,formatRgb:Qd,toString:Qd});function Kd(){return this.rgb().formatHex()}function iT(){return this.rgb().formatHex8()}function oT(){return rg(this).formatHsl()}function Qd(){return this.rgb().formatRgb()}function On(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Kw.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Jd(t):n===3?new at(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ma(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ma(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=Qw.exec(e))?new at(t[1],t[2],t[3],1):(t=Jw.exec(e))?new at(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=eT.exec(e))?Ma(t[1],t[2],t[3],t[4]):(t=tT.exec(e))?Ma(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=nT.exec(e))?ng(t[1],t[2]/100,t[3]/100,1):(t=rT.exec(e))?ng(t[1],t[2]/100,t[3]/100,t[4]):Zd.hasOwnProperty(e)?Jd(Zd[e]):e==="transparent"?new at(NaN,NaN,NaN,0):null}function Jd(e){return new at(e>>16&255,e>>8&255,e&255,1)}function Ma(e,t,n,r){return r<=0&&(e=t=n=NaN),new at(e,t,n,r)}function aT(e){return e instanceof Ui||(e=On(e)),e?(e=e.rgb(),new at(e.r,e.g,e.b,e.opacity)):new at}function Xu(e,t,n,r){return arguments.length===1?aT(e):new at(e,t,n,r??1)}function at(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Wu(at,Xu,qd(Ui,{brighter(e){return e=e==null?Da:Math.pow(Da,e),new at(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Hi:Math.pow(Hi,e),new at(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new at(Gn(this.r),Gn(this.g),Gn(this.b),Ca(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:eg,formatHex:eg,formatHex8:sT,formatRgb:tg,toString:tg}));function eg(){return`#${Yn(this.r)}${Yn(this.g)}${Yn(this.b)}`}function sT(){return`#${Yn(this.r)}${Yn(this.g)}${Yn(this.b)}${Yn((isNaN(this.opacity)?1:this.opacity)*255)}`}function tg(){const e=Ca(this.opacity);return`${e===1?"rgb(":"rgba("}${Gn(this.r)}, ${Gn(this.g)}, ${Gn(this.b)}${e===1?")":`, ${e})`}`}function Ca(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Gn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Yn(e){return e=Gn(e),(e<16?"0":"")+e.toString(16)}function ng(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 rg(e){if(e instanceof Mt)return new Mt(e.h,e.s,e.l,e.opacity);if(e instanceof Ui||(e=On(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 lT(e,t,n,r){return arguments.length===1?rg(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}Wu(Mt,lT,qd(Ui,{brighter(e){return e=e==null?Da:Math.pow(Da,e),new Mt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Hi:Math.pow(Hi,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 at(Vu(e>=240?e-240:e+120,i,r),Vu(e,i,r),Vu(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Mt(ig(this.h),La(this.s),La(this.l),Ca(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=Ca(this.opacity);return`${e===1?"hsl(":"hsla("}${ig(this.h)}, ${La(this.s)*100}%, ${La(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ig(e){return e=(e||0)%360,e<0?e+360:e}function La(e){return Math.max(0,Math.min(1,e||0))}function Vu(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 Uu=e=>()=>e;function uT(e,t){return function(n){return e+n*t}}function cT(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 fT(e){return(e=+e)==1?og:function(t,n){return n-t?cT(t,n,e):Uu(isNaN(t)?n:t)}}function og(e,t){var n=t-e;return n?uT(e,n):Uu(isNaN(e)?t:e)}const ka=function e(t){var n=fT(t);function r(i,o){var a=n((i=Xu(i)).r,(o=Xu(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),u=og(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 hT(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 pT(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function dT(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]=qu(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 gT(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ct(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function mT(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]=qu(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var Hu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ju=new RegExp(Hu.source,"g");function yT(e){return function(){return e}}function bT(e){return function(t){return e(t)+""}}function ag(e,t){var n=Hu.lastIndex=ju.lastIndex=0,r,i,o,a=-1,s=[],l=[];for(e=e+"",t=t+"";(r=Hu.exec(e))&&(i=ju.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:Ct(r,i)})),n=ju.lastIndex;return n<t.length&&(o=t.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?bT(l[0].x):yT(t):(t=l.length,function(u){for(var c=0,f;c<t;++c)s[(f=l[c]).i]=f.x(u);return s.join("")})}function qu(e,t){var n=typeof t,r;return t==null||n==="boolean"?Uu(t):(n==="number"?Ct:n==="string"?(r=On(t))?(t=r,ka):ag:t instanceof On?ka:t instanceof Date?gT:pT(t)?hT:Array.isArray(t)?dT:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?mT:Ct)(e,t)}function xT(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var sg=180/Math.PI,lg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ug(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)*sg,skewX:Math.atan(l)*sg,scaleX:a,scaleY:s}}var Ra;function vT(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?lg:ug(t.a,t.b,t.c,t.d,t.e,t.f)}function $T(e){return e==null||(Ra||(Ra=document.createElementNS("http://www.w3.org/2000/svg","g")),Ra.setAttribute("transform",e),!(e=Ra.transform.baseVal.consolidate()))?lg:(e=e.matrix,ug(e.a,e.b,e.c,e.d,e.e,e.f))}function cg(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,c,f,h,p,d){if(u!==f||c!==h){var m=p.push("translate(",null,t,null,n);d.push({i:m-4,x:Ct(u,f)},{i:m-2,x:Ct(c,h)})}else(f||h)&&p.push("translate("+f+t+h+n)}function a(u,c,f,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Ct(u,c)})):c&&f.push(i(f)+"rotate("+c+r)}function s(u,c,f,h){u!==c?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Ct(u,c)}):c&&f.push(i(f)+"skewX("+c+r)}function l(u,c,f,h,p,d){if(u!==f||c!==h){var m=p.push(i(p)+"scale(",null,",",null,")");d.push({i:m-4,x:Ct(u,f)},{i:m-2,x:Ct(c,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(u,c){var f=[],h=[];return u=e(u),c=e(c),o(u.translateX,u.translateY,c.translateX,c.translateY,f,h),a(u.rotate,c.rotate,f,h),s(u.skewX,c.skewX,f,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,h),u=c=null,function(p){for(var d=-1,m=h.length,g;++d<m;)f[(g=h[d]).i]=g.x(p);return f.join("")}}}var _T=cg(vT,"px, ","px)","deg)"),ST=cg($T,", ",")",")"),Nr=0,qi=0,Zi=0,fg=1e3,Ea,Ki,Ia=0,Wn=0,Ba=0,Qi=typeof performance=="object"&&performance.now?performance:Date,hg=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Zu(){return Wn||(hg(wT),Wn=Qi.now()+Ba)}function wT(){Wn=0}function Na(){this._call=this._time=this._next=null}Na.prototype=pg.prototype={constructor:Na,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Zu():+n)+(t==null?0:+t),!this._next&&Ki!==this&&(Ki?Ki._next=this:Ea=this,Ki=this),this._call=e,this._time=n,Ku()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ku())}};function pg(e,t,n){var r=new Na;return r.restart(e,t,n),r}function TT(){Zu(),++Nr;for(var e=Ea,t;e;)(t=Wn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Nr}function dg(){Wn=(Ia=Qi.now())+Ba,Nr=qi=0;try{TT()}finally{Nr=0,PT(),Wn=0}}function AT(){var e=Qi.now(),t=e-Ia;t>fg&&(Ba-=t,Ia=e)}function PT(){for(var e,t=Ea,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:Ea=n);Ki=e,Ku(r)}function Ku(e){if(!Nr){qi&&(qi=clearTimeout(qi));var t=e-Wn;t>24?(e<1/0&&(qi=setTimeout(dg,e-Qi.now()-Ba)),Zi&&(Zi=clearInterval(Zi))):(Zi||(Ia=Qi.now(),Zi=setInterval(AT,fg)),Nr=1,hg(dg))}}function gg(e,t,n){var r=new Na;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var DT=Id("start","end","cancel","interrupt"),MT=[],mg=0,yg=1,Qu=2,Fa=3,bg=4,Ju=5,za=6;function Oa(e,t,n,r,i,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;CT(e,n,{name:t,index:r,group:i,on:DT,tween:MT,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:mg})}function ec(e,t){var n=Lt(e,t);if(n.state>mg)throw new Error("too late; already scheduled");return n}function Gt(e,t){var n=Lt(e,t);if(n.state>Fa)throw new Error("too late; already running");return n}function Lt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function CT(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=pg(o,0,n.time);function o(u){n.state=yg,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,f,h,p;if(n.state!==yg)return l();for(c in r)if(p=r[c],p.name===n.name){if(p.state===Fa)return gg(a);p.state===bg?(p.state=za,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[c]):+c<t&&(p.state=za,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[c])}if(gg(function(){n.state===Fa&&(n.state=bg,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=Qu,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Qu){for(n.state=Fa,i=new Array(h=n.tween.length),c=0,f=-1;c<h;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Ju,1),f=-1,h=i.length;++f<h;)i[f].call(e,c);n.state===Ju&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=za,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function LT(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>Qu&&r.state<Ju,r.state=za,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}o&&delete e.__transition}}function kT(e){return this.each(function(){LT(this,e)})}function RT(e,t){var n,r;return function(){var i=Gt(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 ET(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Gt(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 IT(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Lt(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?RT:ET)(n,e,t))}function tc(e,t,n){var r=e._id;return e.each(function(){var i=Gt(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Lt(i,r).value[t]}}function xg(e,t){var n;return(typeof t=="number"?Ct:t instanceof On?ka:(n=On(t))?(t=n,ka):ag)(e,t)}function BT(e){return function(){this.removeAttribute(e)}}function NT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function FT(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 zT(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 OT(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 GT(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 YT(e,t){var n=Aa(e),r=n==="transform"?ST:xg;return this.attrTween(e,typeof t=="function"?(n.local?GT:OT)(n,r,tc(this,"attr."+e,t)):t==null?(n.local?NT:BT)(n):(n.local?zT:FT)(n,r,t))}function WT(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function XT(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function VT(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&XT(e,o)),n}return i._value=t,i}function UT(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&WT(e,o)),n}return i._value=t,i}function HT(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=Aa(e);return this.tween(n,(r.local?VT:UT)(r,t))}function jT(e,t){return function(){ec(this,e).delay=+t.apply(this,arguments)}}function qT(e,t){return t=+t,function(){ec(this,e).delay=t}}function ZT(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?jT:qT)(t,e)):Lt(this.node(),t).delay}function KT(e,t){return function(){Gt(this,e).duration=+t.apply(this,arguments)}}function QT(e,t){return t=+t,function(){Gt(this,e).duration=t}}function JT(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?KT:QT)(t,e)):Lt(this.node(),t).duration}function eA(e,t){if(typeof t!="function")throw new Error;return function(){Gt(this,e).ease=t}}function tA(e){var t=this._id;return arguments.length?this.each(eA(t,e)):Lt(this.node(),t).ease}function nA(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Gt(this,e).ease=n}}function rA(e){if(typeof e!="function")throw new Error;return this.each(nA(this._id,e))}function iA(e){typeof e!="function"&&(e=Od(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 en(r,this._parents,this._name,this._id)}function oA(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,f=a[s]=new Array(c),h,p=0;p<c;++p)(h=l[p]||u[p])&&(f[p]=h);for(;s<r;++s)a[s]=t[s];return new en(a,this._parents,this._name,this._id)}function aA(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 sA(e,t,n){var r,i,o=aA(t)?ec:Gt;return function(){var a=o(this,e),s=a.on;s!==r&&(i=(r=s).copy()).on(t,n),a.on=i}}function lA(e,t){var n=this._id;return arguments.length<2?Lt(this.node(),n).on.on(e):this.each(sA(n,e,t))}function uA(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function cA(){return this.on("end.remove",uA(this._id))}function fA(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Gu(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,f,h=0;h<l;++h)(c=s[h])&&(f=e.call(c,c.__data__,h,s))&&("__data__"in c&&(f.__data__=c.__data__),u[h]=f,Oa(u[h],t,n,h,u,Lt(c,n)));return new en(o,this._parents,t,n)}function hA(e){var t=this._name,n=this._id;typeof e!="function"&&(e=zd(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,f=0;f<u;++f)if(c=l[f]){for(var h=e.call(c,c.__data__,f,l),p,d=Lt(c,n),m=0,g=h.length;m<g;++m)(p=h[m])&&Oa(p,t,n,m,h,d);o.push(h),a.push(c)}return new en(o,a,t,n)}var pA=Vi.prototype.constructor;function dA(){return new pA(this._groups,this._parents)}function gA(e,t){var n,r,i;return function(){var o=Ir(this,e),a=(this.style.removeProperty(e),Ir(this,e));return o===a?null:o===n&&a===r?i:i=t(n=o,r=a)}}function vg(e){return function(){this.style.removeProperty(e)}}function mA(e,t,n){var r,i=n+"",o;return function(){var a=Ir(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}function yA(e,t,n){var r,i,o;return function(){var a=Ir(this,e),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),Ir(this,e))),a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s))}}function bA(e,t){var n,r,i,o="style."+t,a="end."+o,s;return function(){var l=Gt(this,e),u=l.on,c=l.value[o]==null?s||(s=vg(t)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(a,i=c),l.on=r}}function xA(e,t,n){var r=(e+="")=="transform"?_T:xg;return t==null?this.styleTween(e,gA(e,r)).on("end.style."+e,vg(e)):typeof t=="function"?this.styleTween(e,yA(e,r,tc(this,"style."+e,t))).each(bA(this._id,e)):this.styleTween(e,mA(e,r,t),n).on("end.style."+e,null)}function vA(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function $A(e,t,n){var r,i;function o(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&vA(e,a,n)),r}return o._value=t,o}function _A(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,$A(e,t,n??""))}function SA(e){return function(){this.textContent=e}}function wA(e){return function(){var t=e(this);this.textContent=t??""}}function TA(e){return this.tween("text",typeof e=="function"?wA(tc(this,"text",e)):SA(e==null?"":e+""))}function AA(e){return function(t){this.textContent=e.call(this,t)}}function PA(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&AA(i)),t}return r._value=e,r}function DA(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,PA(e))}function MA(){for(var e=this._name,t=this._id,n=$g(),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=Lt(l,t);Oa(l,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new en(r,this._parents,e,n)}function CA(){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=Gt(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 LA=0;function en(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function $g(){return++LA}var tn=Vi.prototype;en.prototype={constructor:en,select:fA,selectAll:hA,selectChild:tn.selectChild,selectChildren:tn.selectChildren,filter:iA,merge:oA,selection:dA,transition:MA,call:tn.call,nodes:tn.nodes,node:tn.node,size:tn.size,empty:tn.empty,each:tn.each,on:lA,attr:YT,attrTween:HT,style:xA,styleTween:_A,text:TA,textTween:DA,remove:cA,tween:IT,delay:ZT,duration:JT,ease:tA,easeVarying:rA,end:CA,[Symbol.iterator]:tn[Symbol.iterator]};function kA(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var RA={time:null,delay:0,duration:250,ease:kA};function EA(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 IA(e){var t,n;e instanceof en?(t=e._id,e=e._name):(t=$g(),(n=RA).time=Zu(),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])&&Oa(l,e,t,u,a,n||EA(l,t));return new en(r,this._parents,e,t)}Vi.prototype.interrupt=kT,Vi.prototype.transition=IA;function BA(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ga(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 Fr(e){return e=Ga(Math.abs(e)),e?e[1]:NaN}function NA(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 FA(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var zA=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ya(e){if(!(t=zA.exec(e)))throw new Error("invalid format: "+e);var t;return new nc({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]})}Ya.prototype=nc.prototype;function nc(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+""}nc.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 OA(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 _g;function GA(e,t){var n=Ga(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(_g=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")+Ga(e,Math.max(0,t+o-1))[0]}function Sg(e,t){var n=Ga(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 wg={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:BA,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)=>Sg(e*100,t),r:Sg,s:GA,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Tg(e){return e}var Ag=Array.prototype.map,Pg=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function YA(e){var t=e.grouping===void 0||e.thousands===void 0?Tg:NA(Ag.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?Tg:FA(Ag.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(f){f=Ya(f);var h=f.fill,p=f.align,d=f.sign,m=f.symbol,g=f.zero,y=f.width,b=f.comma,v=f.precision,x=f.trim,_=f.type;_==="n"?(b=!0,_="g"):wg[_]||(v===void 0&&(v=12),x=!0,_="g"),(g||h==="0"&&p==="=")&&(g=!0,h="0",p="=");var A=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",S=m==="$"?r:/[%p]/.test(_)?a:"",P=wg[_],M=/[defgprs%]/.test(_);v=v===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function B($){var k=A,C=S,T,w,D;if(_==="c")C=P($)+C,$="";else{$=+$;var F=$<0||1/$<0;if($=isNaN($)?l:P(Math.abs($),v),x&&($=OA($)),F&&+$==0&&d!=="+"&&(F=!1),k=(F?d==="("?d:s:d==="-"||d==="("?"":d)+k,C=(_==="s"?Pg[8+_g/3]:"")+C+(F&&d==="("?")":""),M){for(T=-1,w=$.length;++T<w;)if(D=$.charCodeAt(T),48>D||D>57){C=(D===46?i+$.slice(T+1):$.slice(T))+C,$=$.slice(0,T);break}}}b&&!g&&($=t($,1/0));var z=k.length+$.length+C.length,I=z<y?new Array(y-z+1).join(h):"";switch(b&&g&&($=t(I+$,I.length?y-C.length:1/0),I=""),p){case"<":$=k+$+C+I;break;case"=":$=k+I+$+C;break;case"^":$=I.slice(0,z=I.length>>1)+k+$+C+I.slice(z);break;default:$=I+k+$+C;break}return o($)}return B.toString=function(){return f+""},B}function c(f,h){var p=u((f=Ya(f),f.type="f",f)),d=Math.max(-8,Math.min(8,Math.floor(Fr(h)/3)))*3,m=Math.pow(10,-d),g=Pg[8+d/3];return function(y){return p(m*y)+g}}return{format:u,formatPrefix:c}}var Wa,Dg,Mg;WA({thousands:",",grouping:[3],currency:["$",""]});function WA(e){return Wa=YA(e),Dg=Wa.format,Mg=Wa.formatPrefix,Wa}function XA(e){return Math.max(0,-Fr(Math.abs(e)))}function VA(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Fr(t)/3)))*3-Fr(Math.abs(e)))}function UA(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Fr(t)-Fr(e))+1}function Cg(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function HA(e){return function(){return e}}function jA(e){return+e}var Lg=[0,1];function zr(e){return e}function rc(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:HA(isNaN(t)?NaN:.5)}function qA(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function ZA(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=rc(i,r),o=n(a,o)):(r=rc(r,i),o=n(o,a)),function(s){return o(r(s))}}function KA(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]=rc(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(s){var l=Ed(e,s,1,r)-1;return o[l](i[l](s))}}function QA(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function JA(){var e=Lg,t=Lg,n=qu,r,i,o,a=zr,s,l,u;function c(){var h=Math.min(e.length,t.length);return a!==zr&&(a=qA(e[0],e[h-1])),s=h>2?KA:ZA,l=u=null,f}function f(h){return h==null||isNaN(h=+h)?o:(l||(l=s(e.map(r),t,n)))(r(a(h)))}return f.invert=function(h){return a(i((u||(u=s(t,e.map(r),Ct)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,jA),c()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),c()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=xT,c()},f.clamp=function(h){return arguments.length?(a=h?!0:zr,c()):a!==zr},f.interpolate=function(h){return arguments.length?(n=h,c()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,p){return r=h,i=p,c()}}function eP(){return JA()(zr,zr)}function tP(e,t,n,r){var i=dS(e,t,n),o;switch(r=Ya(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=VA(i,a))&&(r.precision=o),Mg(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=UA(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=XA(i))&&(r.precision=o-(r.type==="%")*2);break}}return Dg(r)}function kg(e){var t=e.domain;return e.ticks=function(n){var r=t();return pS(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return tP(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=zu(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=eP();return e.copy=function(){return QA(e,Ji())},Cg.apply(e,arguments),kg(e)}function Rg(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function a(l){return l!=null&&l<=l?i[Ed(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 Rg().domain([e,t]).range(i).unknown(o)},Cg.apply(kg(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 ic(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}function nP(e){let t=Math.floor(Math.sqrt(e)),n=Math.ceil(e/t);for(;t*n<e;)n++;return{rowAmount:t,columnAmount:n}}function Eg(e,t,n){const{gap:r}=t,{rowAmount:i,columnAmount:o}=t.rowAmount*t.columnAmount>=n?t:nP(n);return new Array(n).fill(null).map((a,s)=>{const l=s%o,u=Math.floor(s/o),c=(e.width-r*(o-1))/o,f=(e.height-r*(i-1))/i,h=l*c+l*r,p=u*f+u*r,d=[h,p],m=[c/e.width,f/e.height];return{slotIndex:s,rowIndex:u,columnIndex:l,translate:d,scale:m}})}var oc=function(e,t){return oc=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])},oc(e,t)};function Yt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");oc(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function rP(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(f){a(f)}}function l(c){try{u(r.throw(c))}catch(f){a(f)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(e,[])).next())})}function Ig(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 Or(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 Gr(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 Yr(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 Wr(e){return this instanceof Wr?(this.v=e,this):new Wr(e)}function iP(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,f)}}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){h(o[0][3],m)}}function u(p){p.value instanceof Wr?Promise.resolve(p.value.v).then(c,f):h(o[0][2],p)}function c(p){l("next",p)}function f(p){l("throw",p)}function h(p,d){p(d),o.shift(),o.length&&l(o[0][0],o[0][1])}}function oP(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 Or=="function"?Or(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 Le(e){return typeof e=="function"}function ac(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 sc=ac(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
37
+ `+t.map(function(n,r){return r+1+") "+n.toString()}).join(`
38
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function Xa(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var to=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=Or(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(Le(c))try{c()}catch(m){o=m instanceof sc?m.errors:[m]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=Or(f),p=h.next();!p.done;p=h.next()){var d=p.value;try{Fg(d)}catch(m){o=o??[],m instanceof sc?o=Yr(Yr([],Gr(o)),Gr(m.errors)):o.push(m)}}}catch(m){r={error:m}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(o)throw new sc(o)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Fg(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)&&Xa(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&Xa(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),Bg=to.EMPTY;function Ng(e){return e instanceof to||e&&"closed"in e&&Le(e.remove)&&Le(e.add)&&Le(e.unsubscribe)}function Fg(e){Le(e)?e():e.unsubscribe()}var zg={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},aP={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,Yr([e,t],Gr(n)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function Og(e){aP.setTimeout(function(){throw e})}function lc(){}function Va(e){e()}var uc=function(e){Yt(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Ng(n)&&n.add(r)):r.destination=cP,r}return t.create=function(n,r,i){return new no(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}(to),sP=Function.prototype.bind;function cc(e,t){return sP.call(e,t)}var lP=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){Ua(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){Ua(r)}else Ua(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){Ua(n)}},e}(),no=function(e){Yt(t,e);function t(n,r,i){var o=e.call(this)||this,a;if(Le(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;o&&zg.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&cc(n.next,s),error:n.error&&cc(n.error,s),complete:n.complete&&cc(n.complete,s)}):a=n}return o.destination=new lP(a),o}return t}(uc);function Ua(e){Og(e)}function uP(e){throw e}var cP={closed:!0,next:lc,error:uP,complete:lc},fc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ha(e){return e}function fP(e){return e.length===0?Ha:e.length===1?e[0]:function(t){return e.reduce(function(n,r){return r(n)},t)}}var pt=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=pP(t)?t:new no(t,n,r);return Va(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=Gg(n),new n(function(i,o){var a=new no({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[fc]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return fP(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=Gg(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 Gg(e){var t;return(t=e??zg.Promise)!==null&&t!==void 0?t:Promise}function hP(e){return e&&Le(e.next)&&Le(e.error)&&Le(e.complete)}function pP(e){return e&&e instanceof uc||hP(e)&&Ng(e)}function dP(e){return Le(e==null?void 0:e.lift)}function Xn(e){return function(t){if(dP(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 Vn(e,t,n,r,i){return new gP(e,t,n,r,i)}var gP=function(e){Yt(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}(uc),mP=ac(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Xr=function(e){Yt(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 Yg(this,this);return r.operator=n,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new mP},t.prototype.next=function(n){var r=this;Va(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=Or(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;Va(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;Va(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?Bg:(this.currentObservers=null,s.push(n),new to(function(){r.currentObservers=null,Xa(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 pt;return n.source=this,n},t.create=function(n,r){return new Yg(n,r)},t}(pt),Yg=function(e){Yt(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:Bg},t}(Xr),Wg=function(e){Yt(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}(Xr),hc={now:function(){return(hc.delegate||Date).now()},delegate:void 0},yP=function(e){Yt(t,e);function t(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=hc);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}(Xr),bP=function(e){Yt(t,e);function t(n,r){return e.call(this)||this}return t.prototype.schedule=function(n,r){return this},t}(to),Xg={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,Yr([e,t],Gr(n)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},xP=function(e){Yt(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),Xg.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&&Xg.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,Xa(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(bP),Vg=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=hc.now,e}(),vP=function(e){Yt(t,e);function t(n,r){r===void 0&&(r=Vg.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}(Vg);new vP(xP);function $P(e){return e&&Le(e.schedule)}function Ug(e){return e[e.length-1]}function _P(e){return Le(Ug(e))?e.pop():void 0}function SP(e){return $P(Ug(e))?e.pop():void 0}var Hg=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function jg(e){return Le(e==null?void 0:e.then)}function qg(e){return Le(e[fc])}function Zg(e){return Symbol.asyncIterator&&Le(e==null?void 0:e[Symbol.asyncIterator])}function Kg(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 wP(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Qg=wP();function Jg(e){return Le(e==null?void 0:e[Qg])}function e0(e){return iP(this,arguments,function(){var t,n,r,i;return Ig(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,Wr(t.read())];case 3:return n=o.sent(),r=n.value,i=n.done,i?[4,Wr(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Wr(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 t0(e){return Le(e==null?void 0:e.getReader)}function Un(e){if(e instanceof pt)return e;if(e!=null){if(qg(e))return TP(e);if(Hg(e))return AP(e);if(jg(e))return PP(e);if(Zg(e))return n0(e);if(Jg(e))return DP(e);if(t0(e))return MP(e)}throw Kg(e)}function TP(e){return new pt(function(t){var n=e[fc]();if(Le(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function AP(e){return new pt(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function PP(e){return new pt(function(t){e.then(function(n){t.closed||(t.next(n),t.complete())},function(n){return t.error(n)}).then(null,Og)})}function DP(e){return new pt(function(t){var n,r;try{for(var i=Or(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 n0(e){return new pt(function(t){CP(e,t).catch(function(n){return t.error(n)})})}function MP(e){return n0(e0(e))}function CP(e,t){var n,r,i,o;return rP(this,void 0,void 0,function(){var a,s;return Ig(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=oP(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 _n(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 r0(e,t){return t===void 0&&(t=0),Xn(function(n,r){n.subscribe(Vn(r,function(i){return _n(r,e,function(){return r.next(i)},t)},function(){return _n(r,e,function(){return r.complete()},t)},function(i){return _n(r,e,function(){return r.error(i)},t)}))})}function i0(e,t){return t===void 0&&(t=0),Xn(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function LP(e,t){return Un(e).pipe(i0(t),r0(t))}function kP(e,t){return Un(e).pipe(i0(t),r0(t))}function RP(e,t){return new pt(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function EP(e,t){return new pt(function(n){var r;return _n(n,t,function(){r=e[Qg](),_n(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 Le(r==null?void 0:r.return)&&r.return()}})}function o0(e,t){if(!e)throw new Error("Iterable cannot be null");return new pt(function(n){_n(n,t,function(){var r=e[Symbol.asyncIterator]();_n(n,t,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function IP(e,t){return o0(e0(e),t)}function BP(e,t){if(e!=null){if(qg(e))return LP(e,t);if(Hg(e))return RP(e,t);if(jg(e))return kP(e,t);if(Zg(e))return o0(e,t);if(Jg(e))return EP(e,t);if(t0(e))return IP(e,t)}throw Kg(e)}function a0(e,t){return t?BP(e,t):Un(e)}ac(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function Vr(e,t){return Xn(function(n,r){var i=0;n.subscribe(Vn(r,function(o){r.next(e.call(t,o,i++))}))})}var NP=Array.isArray;function FP(e,t){return NP(t)?e.apply(void 0,Yr([],Gr(t))):e(t)}function zP(e){return Vr(function(t){return FP(e,t)})}var OP=Array.isArray,GP=Object.getPrototypeOf,YP=Object.prototype,WP=Object.keys;function XP(e){if(e.length===1){var t=e[0];if(OP(t))return{args:t,keys:null};if(VP(t)){var n=WP(t);return{args:n.map(function(r){return t[r]}),keys:n}}}return{args:e,keys:null}}function VP(e){return e&&typeof e=="object"&&GP(e)===YP}function UP(e,t){return e.reduce(function(n,r,i){return n[r]=t[i],n},{})}function s0(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=SP(e),r=_P(e),i=XP(e),o=i.args,a=i.keys;if(o.length===0)return a0([],n);var s=new pt(HP(o,n,a?function(l){return UP(a,l)}:Ha));return r?s.pipe(zP(r)):s}function HP(e,t,n){return n===void 0&&(n=Ha),function(r){l0(t,function(){for(var i=e.length,o=new Array(i),a=i,s=i,l=function(c){l0(t,function(){var f=a0(e[c],t),h=!1;f.subscribe(Vn(r,function(p){o[c]=p,h||(h=!0,s--),s||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},u=0;u<i;u++)l(u)},r)}}function l0(e,t,n){e?_n(n,e,t):t()}function jP(e,t){return t===void 0&&(t=Ha),e=e??qP,Xn(function(n,r){var i,o=!0;n.subscribe(Vn(r,function(a){var s=t(a);(o||!e(i,s))&&(o=!1,i=s,r.next(a))}))})}function qP(e,t){return e===t}function ZP(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new Xr}: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,f,h,p=0,d=!1,m=!1,g=function(){f==null||f.unsubscribe(),f=void 0},y=function(){g(),c=h=void 0,d=m=!1},b=function(){var v=c;y(),v==null||v.unsubscribe()};return Xn(function(v,x){p++,!m&&!d&&g();var _=h=h??n();x.add(function(){p--,p===0&&!m&&!d&&(f=pc(b,l))}),_.subscribe(x),!c&&p>0&&(c=new no({next:function(A){return _.next(A)},error:function(A){m=!0,g(),f=pc(y,i,A),_.error(A)},complete:function(){d=!0,g(),f=pc(y,a),_.complete()}}),Un(v).subscribe(c))})(u)}}function pc(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 no({next:function(){i.unsubscribe(),e()}});return Un(t.apply(void 0,Yr([],Gr(n)))).subscribe(i)}}function KP(e,t,n){var r,i=!1;return r=e,ZP({connector:function(){return new yP(r,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function dc(e,t){return Xn(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(Vn(r,function(l){i==null||i.unsubscribe();var u=0,c=o++;Un(e(l,c)).subscribe(i=Vn(r,function(f){return r.next(t?t(l,f,c,u++):f)},function(){i=null,s()}))},function(){a=!0,s()}))})}function u0(e){return Xn(function(t,n){Un(e).subscribe(Vn(n,function(){return n.complete()},lc)),!n.closed&&t.subscribe(n)})}const QP=e=>e.pipe(Vr(t=>t.styles.textSize),jP(),Vr(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})),ro=({maxValue:e=1,minValue:t=0,axisWidth:n,scaleDomain:r=ht.scaleDomain,scaleRange:i=ht.scaleRange,reverse:o=!1})=>{const a=r[0]??ht.scaleDomain[0],s=r[1]??ht.scaleDomain[1],l=i[0]??ht.scaleRange[0],u=i[1]??ht.scaleRange[1];let c=a==="auto"?t<0?t:0:a==="min"?t:a,f=s==="auto"?e>=0?e:0:s==="max"?e:s;const h=e-(e-c)/(1-l),p=f/u;return o?Ji().domain([h,p]).range([n,0]):Ji().domain([h,p]).range([0,n])},c0=({maxValue:e=1,minValue:t=0,axisWidth:n,scaleDomain:r=ht.scaleDomain,scaleRange:i=ht.scaleRange,reverse:o=!1})=>{t===e&&(e+=1,t-=1);const a=r[0]??ht.scaleDomain[0],s=r[1]??ht.scaleDomain[1],l=i[0]??ht.scaleRange[0],u=i[1]??ht.scaleRange[1];let c=a==="auto"?t<0?t:0:a==="min"?t:a,f=s==="auto"?e>=0?e:0:s==="max"?e:s;const h=e-(e-c)/(1-l),p=f/u;return o?Ji().domain([n,0]).range([h,p]):Ji().domain([0,n]).range([h,p])},f0=({axisLabels:e,axisWidth:t,padding:n=0,reverse:r=!1})=>{let i=e.map((l,u)=>u);r&&i.reverse();const o=i.length-1+n*2,a=t/o,s=a*n-a*.5;return Rg().domain([s,t-s]).range(i)},h0=({computedData$:e,fullDataFormatter$:t,layout$:n})=>s0({computedData:e,fullDataFormatter:t,layout:n}).pipe(dc(async r=>r),Vr(r=>{if(r.fullDataFormatter.separateSeries)return Eg(r.layout,r.fullDataFormatter.container,r.computedData.length);{const i=Eg(r.layout,r.fullDataFormatter.container,1);return r.computedData.map((o,a)=>i[0])}})),p0=({fullDataFormatter$:e,layout$:t})=>{const n=new Xr;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,f=0,h=0;return i.position==="bottom"?o.position==="left"?(f=180,u=s):o.position==="right"?(f=180,h=180,l=a,u=s):(f=180,u=s):i.position==="top"?o.position==="left"||(o.position==="right"?(h=180,l=a):(f=180,u=s)):i.position==="left"?o.position==="bottom"?(c=-90,u=s):o.position==="top"?(c=-90,h=180):(f=180,u=s):i.position==="right"?o.position==="bottom"?(c=-90,f=180,u=s,l=a):o.position==="top"?(c=-90,f=180,h=180,l=a):(f=180,u=s):(f=180,u=s),{translate:[l,u],scale:[1,1],rotate:c,rotateX:f,rotateY:h,value:`translate(${l}px, ${u}px) rotate(${c}deg) rotateX(${f}deg) rotateY(${h}deg)`}}return new pt(i=>(s0({fullDataFormatter:e,layout:t}).pipe(u0(n),dc(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)}))},d0=({gridAxesTransform$:e})=>e.pipe(Vr(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)`}}));function JP(e){return`[OrbCharts warn]: ${e.message}`}function eD({columnName:e,expectToBe:t,from:n}){return`Invalid value: '${e}' must be '${t}'
39
39
 
40
- ----> find in '${n}'`}function SP({columnName:t,expectToBe:e,from:n}){return`Value is not correct: '${t}' suppose to be '${e}', it may cause unexpected errors.'
40
+ ----> find in '${n}'`}function tD({columnName:e,expectToBe:t,from:n}){return`Value is not correct: '${e}' suppose to be '${t}', it may cause unexpected errors.'
41
41
 
42
- ----> find in '${n}'`}function AP({chartType:t,config:e,initFn:n}){const r=new Or,i=new WeakMap;let o=()=>{},a;const s=new Mg(e.defaultParams),l=new Mg({}),u=s.pipe(nc(c=>l.pipe(qg(r),zr(f=>{try{const{status:h,columnName:p,expectToBe:d}=e.validator(f,{validateColumns:P_});if(h==="error")throw new Error(wP({columnName:p,expectToBe:d,from:`${e.name}.params$`}));h==="warning"&&console.warn(SP({columnName:p,expectToBe:d,from:`${e.name}.params$`}))}catch(h){console.error(_P(h))}return Pu(f,c)}))),vP(1));return{params$:l,name:e.name,chartType:t,defaultParams:e.defaultParams,layerIndex:e.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(Pu(c,e.defaultParams))},setContext:c=>{a=c,a.observer.fullParams$=u}}}const Vi=t=>function(e){return function(n){return class{constructor(){const r=AP({chartType:t,config:e,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}}}},vn=Vi("series"),ie=Vi("grid"),ce=Vi("multiGrid"),Xn=Vi("multiValue"),rc=Vi("tree");function wt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function e0(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function za(t){let e,n,r;t.length!==2?(e=wt,n=(s,l)=>wt(t(s),l),r=(s,l)=>t(s)-l):(e=t===wt||t===e0?t:TP,n=t,r=t);function i(s,l,u=0,c=s.length){if(u<c){if(e(l,l)!==0)return c;do{const f=u+c>>>1;n(s[f],l)<0?u=f+1:c=f}while(u<c)}return u}function o(s,l,u=0,c=s.length){if(u<c){if(e(l,l)!==0)return c;do{const f=u+c>>>1;n(s[f],l)<=0?u=f+1:c=f}while(u<c)}return u}function a(s,l,u=0,c=s.length){const f=i(s,l,u,c-1);return f>u&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:a,right:o}}function TP(){return 0}function Ga(t){return t===null?NaN:+t}function*PP(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}const n0=za(wt),r0=n0.right,DP=n0.left,MP=za(Ga).center,Vn=r0;function CP(t,e){if(!((e=+e)>=0))throw new RangeError("invalid r");let n=t.length;if(!((n=Math.floor(n))>=0))throw new RangeError("invalid length");if(!n||!e)return t;const r=ic(e),i=t.slice();return r(t,i,0,n,1),r(i,t,0,n,1),r(t,i,0,n,1),t}const i0=o0(ic),LP=o0(kP);function o0(t){return function(e,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}=e;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 e;const s=n&&t(n),l=r&&t(r),u=i.slice();return s&&l?(Gr(s,u,i,o,a),Gr(s,i,u,o,a),Gr(s,u,i,o,a),Yr(l,i,u,o,a),Yr(l,u,i,o,a),Yr(l,i,u,o,a)):s?(Gr(s,i,u,o,a),Gr(s,u,i,o,a),Gr(s,i,u,o,a)):l&&(Yr(l,i,u,o,a),Yr(l,u,i,o,a),Yr(l,i,u,o,a)),e}}function Gr(t,e,n,r,i){for(let o=0,a=r*i;o<a;)t(e,n,o,o+=r,1)}function Yr(t,e,n,r,i){for(let o=0,a=r*i;o<r;++o)t(e,n,o,o+a,r)}function kP(t){const e=ic(t);return(n,r,i,o,a)=>{i<<=2,o<<=2,a<<=2,e(n,r,i+0,o+0,a),e(n,r,i+1,o+1,a),e(n,r,i+2,o+2,a),e(n,r,i+3,o+3,a)}}function ic(t){const e=Math.floor(t);if(e===t)return RP(t);const n=t-e,r=2*t+1;return(i,o,a,s,l)=>{if(!((s-=l)>=a))return;let u=e*o[a];const c=l*e,f=c+l;for(let h=a,p=a+c;h<p;h+=l)u+=o[Math.min(s,h)];for(let h=a,p=s;h<=p;h+=l)u+=o[Math.min(s,h+c)],i[h]=(u+n*(o[Math.max(a,h-f)]+o[Math.min(s,h+f)]))/r,u-=o[Math.max(a,h-c)]}}function RP(t){const e=2*t+1;return(n,r,i,o,a)=>{if(!((o-=a)>=i))return;let s=t*r[i];const l=a*t;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/e,s-=r[Math.max(i,u-l)]}}function Ya(t,e){let n=0;if(e===void 0)for(let r of t)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(i=+i)>=i&&++n}return n}function EP(t){return t.length|0}function IP(t){return!(t>0)}function BP(t){return typeof t!="object"||"length"in t?t:Array.from(t)}function NP(t){return e=>t(...e)}function FP(...t){const e=typeof t[t.length-1]=="function"&&NP(t.pop());t=t.map(BP);const n=t.map(EP),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(IP))return o;for(;;){o.push(i.map((s,l)=>t[l][s]));let a=r;for(;++i[a]===n[a];){if(a===0)return e?o.map(e):o;i[a--]=0}}}function OP(t,e){var n=0,r=0;return Float64Array.from(t,e===void 0?i=>n+=+i||0:i=>n+=+e(i,r++,t)||0)}function a0(t,e){let n=0,r,i=0,o=0;if(e===void 0)for(let a of t)a!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i));else{let a=-1;for(let s of t)(s=e(s,++a,t))!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i))}if(n>1)return o/(n-1)}function s0(t,e){const n=a0(t,e);return n&&Math.sqrt(n)}function Wi(t,e){let n,r;if(e===void 0)for(const i of t)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 t)(o=e(o,++i,t))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class Lt{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const o=n[i],a=e+o,s=Math.abs(e)<Math.abs(o)?e-(a-o):o-(a-e);s&&(n[r++]=s),e=a}return n[r]=e,this._n=r+1,this}valueOf(){const e=this._partials;let n=this._n,r,i,o,a=0;if(n>0){for(a=e[--n];n>0&&(r=a,i=e[--n],a=r+i,o=i-(a-r),!o););n>0&&(o<0&&e[n-1]<0||o>0&&e[n-1]>0)&&(i=o*2,r=a+i,i==r-a&&(a=r))}return a}}function zP(t,e){const n=new Lt;if(e===void 0)for(let r of t)(r=+r)&&n.add(r);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&n.add(i)}return+n}function GP(t,e){const n=new Lt;let r=-1;return Float64Array.from(t,e===void 0?i=>n.add(+i||0):i=>n.add(+e(i,++r,t)||0))}class Ui extends Map{constructor(e,n=c0){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(oc(this,e))}has(e){return super.has(oc(this,e))}set(e,n){return super.set(l0(this,e),n)}delete(e){return super.delete(u0(this,e))}}class Wn extends Set{constructor(e,n=c0){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const r of e)this.add(r)}has(e){return super.has(oc(this,e))}add(e){return super.add(l0(this,e))}delete(e){return super.delete(u0(this,e))}}function oc({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function l0({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function u0({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function c0(t){return t!==null&&typeof t=="object"?t.valueOf():t}function Xr(t){return t}function f0(t,...e){return Vr(t,Xr,Xr,e)}function h0(t,...e){return Vr(t,Array.from,Xr,e)}function p0(t,e){for(let n=1,r=e.length;n<r;++n)t=t.flatMap(i=>i.pop().map(([o,a])=>[...i,o,a]));return t}function YP(t,...e){return p0(h0(t,...e),e)}function XP(t,e,...n){return p0(g0(t,e,...n),n)}function d0(t,e,...n){return Vr(t,Xr,e,n)}function g0(t,e,...n){return Vr(t,Array.from,e,n)}function VP(t,...e){return Vr(t,Xr,m0,e)}function WP(t,...e){return Vr(t,Array.from,m0,e)}function m0(t){if(t.length!==1)throw new Error("duplicate key");return t[0]}function Vr(t,e,n,r){return function i(o,a){if(a>=r.length)return n(o);const s=new Ui,l=r[a++];let u=-1;for(const c of o){const f=l(c,++u,o),h=s.get(f);h?h.push(c):s.set(f,[c])}for(const[c,f]of s)s.set(c,i(f,a));return e(s)}(t,0)}function y0(t,e){return Array.from(e,n=>t[n])}function ac(t,...e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&n.length!==2||e.length>1){const r=Uint32Array.from(t,(i,o)=>o);return e.length>1?(e=e.map(i=>t.map(i)),r.sort((i,o)=>{for(const a of e){const s=Wr(a[i],a[o]);if(s)return s}})):(n=t.map(n),r.sort((i,o)=>Wr(n[i],n[o]))),y0(t,r)}return t.sort(sc(n))}function sc(t=wt){if(t===wt)return Wr;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function Wr(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}function UP(t,e,n){return(e.length!==2?ac(d0(t,e,n),([r,i],[o,a])=>wt(i,a)||wt(r,o)):ac(f0(t,n),([r,i],[o,a])=>e(i,a)||wt(r,o))).map(([r])=>r)}var HP=Array.prototype,jP=HP.slice;function lc(t){return()=>t}const qP=Math.sqrt(50),ZP=Math.sqrt(10),KP=Math.sqrt(2);function Xa(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=qP?10:o>=ZP?5:o>=KP?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/a,s=Math.round(t*u),l=Math.round(e*u),s/u<t&&++s,l/u>e&&--l,u=-u):(u=Math.pow(10,i)*a,s=Math.round(t/u),l=Math.round(e/u),s*u<t&&++s,l*u>e&&--l),l<s&&.5<=n&&n<2?Xa(t,e,n*2):[s,l,u]}function Un(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?Xa(e,t,n):Xa(t,e,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 Hn(t,e,n){return e=+e,t=+t,n=+n,Xa(t,e,n)[2]}function Va(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?Hn(e,t,n):Hn(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function uc(t,e,n){let r;for(;;){const i=Hn(t,e,n);if(i===r||i===0||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}function cc(t){return Math.max(1,Math.ceil(Math.log(Ya(t))/Math.LN2)+1)}function b0(){var t=Xr,e=Wi,n=cc;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]=t(i[o],o,i);var c=e(u),f=c[0],h=c[1],p=n(u,f,h);if(!Array.isArray(p)){const v=h,x=+p;if(e===Wi&&([f,h]=uc(f,h,x)),p=Un(f,h,x),p[0]<=f&&(l=Hn(f,h,x)),p[p.length-1]>=h)if(v>=h&&e===Wi){const _=Hn(f,h,x);isFinite(_)&&(_>0?h=(Math.floor(h/_)+1)*_:_<0&&(h=(Math.ceil(h*-_)+1)/-_))}else p.pop()}for(var d=p.length,m=0,g=d;p[m]<=f;)++m;for(;p[g-1]>h;)--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]:f,b.x1=o<d?p[o]:h;if(isFinite(l)){if(l>0)for(o=0;o<a;++o)(s=u[o])!=null&&f<=s&&s<=h&&y[Math.min(d,Math.floor((s-f)/l))].push(i[o]);else if(l<0){for(o=0;o<a;++o)if((s=u[o])!=null&&f<=s&&s<=h){const v=Math.floor((f-s)*l);y[Math.min(d,v+(p[v]<=s))].push(i[o])}}}else for(o=0;o<a;++o)(s=u[o])!=null&&f<=s&&s<=h&&y[Vn(p,s,0,d)].push(i[o]);return y}return r.value=function(i){return arguments.length?(t=typeof i=="function"?i:lc(i),r):t},r.domain=function(i){return arguments.length?(e=typeof i=="function"?i:lc([i[0],i[1]]),r):e},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:lc(Array.isArray(i)?jP.call(i):i),r):n},r}function Hi(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function fc(t,e){let n,r=-1,i=-1;if(e===void 0)for(const o of t)++i,o!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of t)(o=e(o,++i,t))!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);return r}function Wa(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function hc(t,e){let n,r=-1,i=-1;if(e===void 0)for(const o of t)++i,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of t)(o=e(o,++i,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);return r}function Ua(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?Wr:sc(i);r>n;){if(r-n>600){const l=r-n+1,u=e-n+1,c=Math.log(l),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),p=Math.max(n,Math.floor(e-u*f/l+h)),d=Math.min(r,Math.floor(e+(l-u)*f/l+h));Ua(t,e,p,d,i)}const o=t[e];let a=n,s=r;for(ji(t,n,e),i(t[r],o)>0&&ji(t,n,r);a<s;){for(ji(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}i(t[n],o)===0?ji(t,n,s):(++s,ji(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function ji(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function x0(t,e=wt){let n,r=!1;if(e.length===1){let i;for(const o of t){const a=e(o);(r?wt(a,i)>0:wt(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of t)(r?e(i,n)>0:e(i,i)===0)&&(n=i,r=!0);return n}function qi(t,e,n){if(t=Float64Array.from(PP(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return Wa(t);if(e>=1)return Hi(t);var r,i=(r-1)*e,o=Math.floor(i),a=Hi(Ua(t,o).subarray(0,o+1)),s=Wa(t.subarray(o+1));return a+(s-a)*(i-o)}}function v0(t,e,n=Ga){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t),s=+n(t[o+1],o+1,t);return a+(s-a)*(i-o)}}function $0(t,e,n=Ga){if(!isNaN(e=+e)){if(r=Float64Array.from(t,(s,l)=>Ga(n(t[l],l,t))),e<=0)return hc(r);if(e>=1)return fc(r);var r,i=Uint32Array.from(t,(s,l)=>l),o=r.length-1,a=Math.floor(o*e);return Ua(i,a,0,o,(s,l)=>Wr(r[s],r[l])),a=x0(i.subarray(0,a+1),s=>r[s]),a>=0?a:-1}}function QP(t,e,n){const r=Ya(t),i=qi(t,.75)-qi(t,.25);return r&&i?Math.ceil((n-e)/(2*i*Math.pow(r,-1/3))):1}function JP(t,e,n){const r=Ya(t),i=s0(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}function tD(t,e){let n=0,r=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function eD(t,e){return qi(t,.5,e)}function nD(t,e){return $0(t,.5,e)}function*rD(t){for(const e of t)yield*e}function pc(t){return Array.from(rD(t))}function iD(t,e){const n=new Ui;if(e===void 0)for(let o of t)o!=null&&o>=o&&n.set(o,(n.get(o)||0)+1);else{let o=-1;for(let a of t)(a=e(a,++o,t))!=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 oD(t,e=aD){const n=[];let r,i=!1;for(const o of t)i&&n.push(e(r,o)),r=o,i=!0;return n}function aD(t,e){return[t,e]}function $n(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r<i;)o[r]=t+r*n;return o}function sD(t,e=wt){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");let n=Array.from(t);const r=new Float64Array(n.length);e.length!==2&&(n=n.map(e),e=wt);const i=(s,l)=>e(n[s],n[l]);let o,a;return t=Uint32Array.from(n,(s,l)=>l),t.sort(e===wt?(s,l)=>Wr(n[s],n[l]):sc(i)),t.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 lD(t,e=wt){let n,r=!1;if(e.length===1){let i;for(const o of t){const a=e(o);(r?wt(a,i)<0:wt(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of t)(r?e(i,n)<0:e(i,i)===0)&&(n=i,r=!0);return n}function _0(t,e=wt){if(e.length===1)return hc(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?e(o,o)===0:e(o,n)<0)&&(n=o,r=i);return r}function uD(t,e=wt){if(e.length===1)return fc(t,e);let n,r=-1,i=-1;for(const o of t)++i,(r<0?e(o,o)===0:e(o,n)>0)&&(n=o,r=i);return r}function cD(t,e){const n=_0(t,e);return n<0?void 0:n}const fD=w0(Math.random);function w0(t){return function(n,r=0,i=n.length){let o=i-(r=+r);for(;o;){const a=t()*o--|0,s=n[o+r];n[o+r]=n[a+r],n[a+r]=s}return n}}function dc(t,e){let n=0;if(e===void 0)for(let r of t)(r=+r)&&(n+=r);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function S0(t){if(!(o=t.length))return[];for(var e=-1,n=Wa(t,hD),r=new Array(n);++e<n;)for(var i=-1,o,a=r[e]=new Array(o);++i<o;)a[i]=t[i][e];return r}function hD(t){return t.length}function pD(){return S0(arguments)}function dD(t,e){if(typeof e!="function")throw new TypeError("test is not a function");let n=-1;for(const r of t)if(!e(r,++n,t))return!1;return!0}function gD(t,e){if(typeof e!="function")throw new TypeError("test is not a function");let n=-1;for(const r of t)if(e(r,++n,t))return!0;return!1}function mD(t,e){if(typeof e!="function")throw new TypeError("test is not a function");const n=[];let r=-1;for(const i of t)e(i,++r,t)&&n.push(i);return n}function yD(t,e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");if(typeof e!="function")throw new TypeError("mapper is not a function");return Array.from(t,(n,r)=>e(n,r,t))}function bD(t,e,n){if(typeof e!="function")throw new TypeError("reducer is not a function");const r=t[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=e(n,o,++a,t);return n}function xD(t){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(t).reverse()}function vD(t,...e){t=new Wn(t);for(const n of e)for(const r of n)t.delete(r);return t}function $D(t,e){const n=e[Symbol.iterator](),r=new Wn;for(const i of t){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 _D(t,...e){t=new Wn(t),e=e.map(wD);t:for(const n of t)for(const r of e)if(!r.has(n)){t.delete(n);continue t}return t}function wD(t){return t instanceof Wn?t:new Wn(t)}function A0(t,e){const n=t[Symbol.iterator](),r=new Set;for(const i of e){const o=T0(i);if(r.has(o))continue;let a,s;for(;{value:a,done:s}=n.next();){if(s)return!1;const l=T0(a);if(r.add(l),Object.is(o,l))break}}return!0}function T0(t){return t!==null&&typeof t=="object"?t.valueOf():t}function SD(t,e){return A0(e,t)}function AD(...t){const e=new Wn;for(const n of t)for(const r of n)e.add(r);return e}function TD(t){return t}var Ha=1,ja=2,gc=3,Zi=4,P0=1e-6;function PD(t){return"translate("+t+",0)"}function DD(t){return"translate(0,"+t+")"}function MD(t){return e=>+t(e)}function CD(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function LD(){return!this.__axis}function qa(t,e){var n=[],r=null,i=null,o=6,a=6,s=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===Ha||t===Zi?-1:1,c=t===Zi||t===ja?"x":"y",f=t===Ha||t===gc?PD:DD;function h(p){var d=r??(e.ticks?e.ticks.apply(e,n):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,n):TD),g=Math.max(o,0)+s,y=e.range(),b=+y[0]+l,v=+y[y.length-1]+l,x=(e.bandwidth?CD:MD)(e.copy(),l),_=p.selection?p.selection():p,S=_.selectAll(".domain").data([null]),A=_.selectAll(".tick").data(d,e).order(),T=A.exit(),C=A.enter().append("g").attr("class","tick"),I=A.select("line"),$=A.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(C),I=I.merge(C.append("line").attr("stroke","currentColor").attr(c+"2",u*o)),$=$.merge(C.append("text").attr("fill","currentColor").attr(c,u*g).attr("dy",t===Ha?"0em":t===gc?"0.71em":"0.32em")),p!==_&&(S=S.transition(p),A=A.transition(p),I=I.transition(p),$=$.transition(p),T=T.transition(p).attr("opacity",P0).attr("transform",function(L){return isFinite(L=x(L))?f(L+l):this.getAttribute("transform")}),C.attr("opacity",P0).attr("transform",function(L){var P=this.parentNode.__axis;return f((P&&isFinite(P=P(L))?P:x(L))+l)})),T.remove(),S.attr("d",t===Zi||t===ja?a?"M"+u*a+","+b+"H"+l+"V"+v+"H"+u*a:"M"+l+","+b+"V"+v:a?"M"+b+","+u*a+"V"+l+"H"+v+"V"+u*a:"M"+b+","+l+"H"+v),A.attr("opacity",1).attr("transform",function(L){return f(x(L)+l)}),I.attr(c+"2",u*o),$.attr(c,u*g).text(m),_.filter(LD).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===ja?"start":t===Zi?"end":"middle"),_.each(function(){this.__axis=x})}return h.scale=function(p){return arguments.length?(e=p,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),h):n.slice()},h.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),h):r&&r.slice()},h.tickFormat=function(p){return arguments.length?(i=p,h):i},h.tickSize=function(p){return arguments.length?(o=a=+p,h):o},h.tickSizeInner=function(p){return arguments.length?(o=+p,h):o},h.tickSizeOuter=function(p){return arguments.length?(a=+p,h):a},h.tickPadding=function(p){return arguments.length?(s=+p,h):s},h.offset=function(p){return arguments.length?(l=+p,h):l},h}function kD(t){return qa(Ha,t)}function RD(t){return qa(ja,t)}function mc(t){return qa(gc,t)}function yc(t){return qa(Zi,t)}var ED={value:()=>{}};function jn(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Za(n)}function Za(t){this._=t}function ID(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Za.prototype=jn.prototype={constructor:Za,on:function(t,e){var n=this._,r=ID(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=BD(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<a;)if(i=(t=r[o]).type)n[i]=D0(n[i],t.name,e);else if(e==null)for(i in n)n[i]=D0(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Za(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function BD(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function D0(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=ED,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var bc="http://www.w3.org/1999/xhtml";const xc={svg:"http://www.w3.org/2000/svg",xhtml:bc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ki(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),xc.hasOwnProperty(e)?{space:xc[e],local:t}:t}function ND(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===bc&&e.documentElement.namespaceURI===bc?e.createElement(t):e.createElementNS(n,t)}}function FD(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ka(t){var e=Ki(t);return(e.local?FD:ND)(e)}function OD(){}function Qa(t){return t==null?OD:function(){return this.querySelector(t)}}function zD(t){typeof t!="function"&&(t=Qa(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=new Array(a),l,u,c=0;c<a;++c)(l=o[c])&&(u=t.call(l,l.__data__,c,o))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new Vt(r,this._parents)}function M0(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function GD(){return[]}function vc(t){return t==null?GD:function(){return this.querySelectorAll(t)}}function YD(t){return function(){return M0(t.apply(this,arguments))}}function XD(t){typeof t=="function"?t=YD(t):t=vc(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a=e[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&(r.push(t.call(l,l.__data__,u,a)),i.push(l));return new Vt(r,i)}function $c(t){return function(){return this.matches(t)}}function C0(t){return function(e){return e.matches(t)}}var VD=Array.prototype.find;function WD(t){return function(){return VD.call(this.children,t)}}function UD(){return this.firstElementChild}function HD(t){return this.select(t==null?UD:WD(typeof t=="function"?t:C0(t)))}var jD=Array.prototype.filter;function qD(){return Array.from(this.children)}function ZD(t){return function(){return jD.call(this.children,t)}}function KD(t){return this.selectAll(t==null?qD:ZD(typeof t=="function"?t:C0(t)))}function QD(t){typeof t!="function"&&(t=$c(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&t.call(l,l.__data__,u,o)&&s.push(l);return new Vt(r,this._parents)}function L0(t){return new Array(t.length)}function JD(){return new Vt(this._enter||this._groups.map(L0),this._parents)}function Ja(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Ja.prototype={constructor:Ja,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function tM(t){return function(){return t}}function eM(t,e,n,r,i,o){for(var a=0,s,l=e.length,u=o.length;a<u;++a)(s=e[a])?(s.__data__=o[a],r[a]=s):n[a]=new Ja(t,o[a]);for(;a<l;++a)(s=e[a])&&(i[a]=s)}function nM(t,e,n,r,i,o,a){var s,l,u=new Map,c=e.length,f=o.length,h=new Array(c),p;for(s=0;s<c;++s)(l=e[s])&&(h[s]=p=a.call(l,l.__data__,s,e)+"",u.has(p)?i[s]=l:u.set(p,l));for(s=0;s<f;++s)p=a.call(t,o[s],s,o)+"",(l=u.get(p))?(r[s]=l,l.__data__=o[s],u.delete(p)):n[s]=new Ja(t,o[s]);for(s=0;s<c;++s)(l=e[s])&&u.get(h[s])===l&&(i[s]=l)}function rM(t){return t.__data__}function iM(t,e){if(!arguments.length)return Array.from(this,rM);var n=e?nM:eM,r=this._parents,i=this._groups;typeof t!="function"&&(t=tM(t));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],f=i[u],h=f.length,p=oM(t.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(h);n(c,f,m,g,y,p,e);for(var b=0,v=0,x,_;b<d;++b)if(x=m[b]){for(b>=v&&(v=b+1);!(_=g[v])&&++v<d;);x._next=_||null}}return a=new Vt(a,r),a._enter=s,a._exit=l,a}function oM(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function aM(){return new Vt(this._exit||this._groups.map(L0),this._parents)}function sM(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function lM(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=r[l],f=u.length,h=s[l]=new Array(f),p,d=0;d<f;++d)(p=u[d]||c[d])&&(h[d]=p);for(;l<i;++l)s[l]=n[l];return new Vt(s,this._parents)}function uM(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function cM(t){t||(t=fM);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,l=i[o]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(e)}return new Vt(i,this._parents).order()}function fM(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function hM(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function pM(){return Array.from(this)}function dM(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function gM(){let t=0;for(const e of this)++t;return t}function mM(){return!this.node()}function yM(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&t.call(s,s.__data__,o,i);return this}function bM(t){return function(){this.removeAttribute(t)}}function xM(t){return function(){this.removeAttributeNS(t.space,t.local)}}function vM(t,e){return function(){this.setAttribute(t,e)}}function $M(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function _M(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function wM(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function SM(t,e){var n=Ki(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?xM:bM:typeof e=="function"?n.local?wM:_M:n.local?$M:vM)(n,e))}function _c(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function AM(t){return function(){this.style.removeProperty(t)}}function TM(t,e,n){return function(){this.style.setProperty(t,e,n)}}function PM(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function DM(t,e,n){return arguments.length>1?this.each((e==null?AM:typeof e=="function"?PM:TM)(t,e,n??"")):qn(this.node(),t)}function qn(t,e){return t.style.getPropertyValue(e)||_c(t).getComputedStyle(t,null).getPropertyValue(e)}function MM(t){return function(){delete this[t]}}function CM(t,e){return function(){this[t]=e}}function LM(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function kM(t,e){return arguments.length>1?this.each((e==null?MM:typeof e=="function"?LM:CM)(t,e)):this.node()[t]}function k0(t){return t.trim().split(/^|\s+/)}function wc(t){return t.classList||new R0(t)}function R0(t){this._node=t,this._names=k0(t.getAttribute("class")||"")}R0.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function E0(t,e){for(var n=wc(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function I0(t,e){for(var n=wc(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function RM(t){return function(){E0(this,t)}}function EM(t){return function(){I0(this,t)}}function IM(t,e){return function(){(e.apply(this,arguments)?E0:I0)(this,t)}}function BM(t,e){var n=k0(t+"");if(arguments.length<2){for(var r=wc(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?IM:e?RM:EM)(n,e))}function NM(){this.textContent=""}function FM(t){return function(){this.textContent=t}}function OM(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function zM(t){return arguments.length?this.each(t==null?NM:(typeof t=="function"?OM:FM)(t)):this.node().textContent}function GM(){this.innerHTML=""}function YM(t){return function(){this.innerHTML=t}}function XM(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function VM(t){return arguments.length?this.each(t==null?GM:(typeof t=="function"?XM:YM)(t)):this.node().innerHTML}function WM(){this.nextSibling&&this.parentNode.appendChild(this)}function UM(){return this.each(WM)}function HM(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function jM(){return this.each(HM)}function qM(t){var e=typeof t=="function"?t:Ka(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function ZM(){return null}function KM(t,e){var n=typeof t=="function"?t:Ka(t),r=e==null?ZM:typeof e=="function"?e:Qa(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function QM(){var t=this.parentNode;t&&t.removeChild(this)}function JM(){return this.each(QM)}function t3(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function e3(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function n3(t){return this.select(t?e3:t3)}function r3(t){return arguments.length?this.property("__data__",t):this.node().__data__}function i3(t){return function(e){t.call(this,e,this.__data__)}}function o3(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function a3(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function s3(t,e,n){return function(){var r=this.__on,i,o=i3(e);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function l3(t,e,n){var r=o3(t+""),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=e?s3:a3,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function B0(t,e,n){var r=_c(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function u3(t,e){return function(){return B0(this,t,e)}}function c3(t,e){return function(){return B0(this,t,e.apply(this,arguments))}}function f3(t,e){return this.each((typeof e=="function"?c3:u3)(t,e))}function*h3(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var Sc=[null];function Vt(t,e){this._groups=t,this._parents=e}function Zn(){return new Vt([[document.documentElement]],Sc)}function p3(){return this}Vt.prototype=Zn.prototype={constructor:Vt,select:zD,selectAll:XD,selectChild:HD,selectChildren:KD,filter:QD,data:iM,enter:JD,exit:aM,join:sM,merge:lM,selection:p3,order:uM,sort:cM,call:hM,nodes:pM,node:dM,size:gM,empty:mM,each:yM,attr:SM,style:DM,property:kM,classed:BM,text:zM,html:VM,raise:UM,lower:jM,append:qM,insert:KM,remove:JM,clone:n3,datum:r3,on:l3,dispatch:f3,[Symbol.iterator]:h3};function H(t){return typeof t=="string"?new Vt([[document.querySelector(t)]],[document.documentElement]):new Vt([[t]],Sc)}function d3(t){return H(Ka(t).call(document.documentElement))}var g3=0;function N0(){return new Ac}function Ac(){this._="@"+(++g3).toString(36)}Ac.prototype=N0.prototype={constructor:Ac,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};function F0(t){let e;for(;e=t.sourceEvent;)t=e;return t}function fe(t,e){if(t=F0(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}function m3(t,e){return t.target&&(t=F0(t),e===void 0&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,n=>fe(n,e))}function y3(t){return typeof t=="string"?new Vt([document.querySelectorAll(t)],[document.documentElement]):new Vt([M0(t)],Sc)}const b3={passive:!1},Qi={capture:!0,passive:!1};function Tc(t){t.stopImmediatePropagation()}function Ur(t){t.preventDefault(),t.stopImmediatePropagation()}function ts(t){var e=t.document.documentElement,n=H(t).on("dragstart.drag",Ur,Qi);"onselectstart"in e?n.on("selectstart.drag",Ur,Qi):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function es(t,e){var n=t.document.documentElement,r=H(t).on("dragstart.drag",null);e&&(r.on("click.drag",Ur,Qi),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 ns=t=>()=>t;function Pc(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:a,y:s,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,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}})}Pc.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function x3(t){return!t.ctrlKey&&!t.button}function v3(){return this.parentNode}function $3(t,e){return e??{x:t.x,y:t.y}}function _3(){return navigator.maxTouchPoints||"ontouchstart"in this}function O0(){var t=x3,e=v3,n=$3,r=_3,i={},o=jn("start","drag","end"),a=0,s,l,u,c,f=0;function h(x){x.on("mousedown.drag",p).filter(r).on("touchstart.drag",g).on("touchmove.drag",y,b3).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(x,_){if(!(c||!t.call(this,x,_))){var S=v(this,e.call(this,x,_),x,_,"mouse");S&&(H(x.view).on("mousemove.drag",d,Qi).on("mouseup.drag",m,Qi),ts(x.view),Tc(x),u=!1,s=x.clientX,l=x.clientY,S("start",x))}}function d(x){if(Ur(x),!u){var _=x.clientX-s,S=x.clientY-l;u=_*_+S*S>f}i.mouse("drag",x)}function m(x){H(x.view).on("mousemove.drag mouseup.drag",null),es(x.view,u),Ur(x),i.mouse("end",x)}function g(x,_){if(t.call(this,x,_)){var S=x.changedTouches,A=e.call(this,x,_),T=S.length,C,I;for(C=0;C<T;++C)(I=v(this,A,x,_,S[C].identifier,S[C]))&&(Tc(x),I("start",x,S[C]))}}function y(x){var _=x.changedTouches,S=_.length,A,T;for(A=0;A<S;++A)(T=i[_[A].identifier])&&(Ur(x),T("drag",x,_[A]))}function b(x){var _=x.changedTouches,S=_.length,A,T;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),A=0;A<S;++A)(T=i[_[A].identifier])&&(Tc(x),T("end",x,_[A]))}function v(x,_,S,A,T,C){var I=o.copy(),$=fe(C||S,_),L,P,w;if((w=n.call(x,new Pc("beforestart",{sourceEvent:S,target:h,identifier:T,active:a,x:$[0],y:$[1],dx:0,dy:0,dispatch:I}),A))!=null)return L=w.x-$[0]||0,P=w.y-$[1]||0,function M(D,X,O){var E=$,N;switch(D){case"start":i[T]=M,N=a++;break;case"end":delete i[T],--a;case"drag":$=fe(O||X,_),N=a;break}I.call(D,x,new Pc(D,{sourceEvent:X,subject:w,target:h,identifier:T,active:N,x:$[0]+L,y:$[1]+P,dx:$[0]-E[0],dy:$[1]-E[1],dispatch:I}),A)}}return h.filter=function(x){return arguments.length?(t=typeof x=="function"?x:ns(!!x),h):t},h.container=function(x){return arguments.length?(e=typeof x=="function"?x:ns(x),h):e},h.subject=function(x){return arguments.length?(n=typeof x=="function"?x:ns(x),h):n},h.touchable=function(x){return arguments.length?(r=typeof x=="function"?x:ns(!!x),h):r},h.on=function(){var x=o.on.apply(o,arguments);return x===o?h:x},h.clickDistance=function(x){return arguments.length?(f=(x=+x)*x,h):Math.sqrt(f)},h}function Hr(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Ji(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function _n(){}var Kn=.7,jr=1/Kn,qr="\\s*([+-]?\\d+)\\s*",to="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ze="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",w3=/^#([0-9a-f]{3,8})$/,S3=new RegExp(`^rgb\\(${qr},${qr},${qr}\\)$`),A3=new RegExp(`^rgb\\(${ze},${ze},${ze}\\)$`),T3=new RegExp(`^rgba\\(${qr},${qr},${qr},${to}\\)$`),P3=new RegExp(`^rgba\\(${ze},${ze},${ze},${to}\\)$`),D3=new RegExp(`^hsl\\(${to},${ze},${ze}\\)$`),M3=new RegExp(`^hsla\\(${to},${ze},${ze},${to}\\)$`),z0={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};Hr(_n,wn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:G0,formatHex:G0,formatHex8:C3,formatHsl:L3,formatRgb:Y0,toString:Y0});function G0(){return this.rgb().formatHex()}function C3(){return this.rgb().formatHex8()}function L3(){return H0(this).formatHsl()}function Y0(){return this.rgb().formatRgb()}function wn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=w3.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?X0(e):n===3?new Et(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?rs(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?rs(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=S3.exec(t))?new Et(e[1],e[2],e[3],1):(e=A3.exec(t))?new Et(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=T3.exec(t))?rs(e[1],e[2],e[3],e[4]):(e=P3.exec(t))?rs(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=D3.exec(t))?U0(e[1],e[2]/100,e[3]/100,1):(e=M3.exec(t))?U0(e[1],e[2]/100,e[3]/100,e[4]):z0.hasOwnProperty(t)?X0(z0[t]):t==="transparent"?new Et(NaN,NaN,NaN,0):null}function X0(t){return new Et(t>>16&255,t>>8&255,t&255,1)}function rs(t,e,n,r){return r<=0&&(t=e=n=NaN),new Et(t,e,n,r)}function Dc(t){return t instanceof _n||(t=wn(t)),t?(t=t.rgb(),new Et(t.r,t.g,t.b,t.opacity)):new Et}function Zr(t,e,n,r){return arguments.length===1?Dc(t):new Et(t,e,n,r??1)}function Et(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Hr(Et,Zr,Ji(_n,{brighter(t){return t=t==null?jr:Math.pow(jr,t),new Et(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Kn:Math.pow(Kn,t),new Et(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Et(Qn(this.r),Qn(this.g),Qn(this.b),is(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:V0,formatHex:V0,formatHex8:k3,formatRgb:W0,toString:W0}));function V0(){return`#${Jn(this.r)}${Jn(this.g)}${Jn(this.b)}`}function k3(){return`#${Jn(this.r)}${Jn(this.g)}${Jn(this.b)}${Jn((isNaN(this.opacity)?1:this.opacity)*255)}`}function W0(){const t=is(this.opacity);return`${t===1?"rgb(":"rgba("}${Qn(this.r)}, ${Qn(this.g)}, ${Qn(this.b)}${t===1?")":`, ${t})`}`}function is(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Qn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Jn(t){return t=Qn(t),(t<16?"0":"")+t.toString(16)}function U0(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new De(t,e,n,r)}function H0(t){if(t instanceof De)return new De(t.h,t.s,t.l,t.opacity);if(t instanceof _n||(t=wn(t)),!t)return new De;if(t instanceof De)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(e===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-e)/s+2:a=(e-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new De(a,s,l,t.opacity)}function os(t,e,n,r){return arguments.length===1?H0(t):new De(t,e,n,r??1)}function De(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Hr(De,os,Ji(_n,{brighter(t){return t=t==null?jr:Math.pow(jr,t),new De(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Kn:Math.pow(Kn,t),new De(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Et(Mc(t>=240?t-240:t+120,i,r),Mc(t,i,r),Mc(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new De(j0(this.h),as(this.s),as(this.l),is(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=is(this.opacity);return`${t===1?"hsl(":"hsla("}${j0(this.h)}, ${as(this.s)*100}%, ${as(this.l)*100}%${t===1?")":`, ${t})`}`}}));function j0(t){return t=(t||0)%360,t<0?t+360:t}function as(t){return Math.max(0,Math.min(1,t||0))}function Mc(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const q0=Math.PI/180,Z0=180/Math.PI,ss=18,K0=.96422,Q0=1,J0=.82521,tm=4/29,Kr=6/29,em=3*Kr*Kr,R3=Kr*Kr*Kr;function nm(t){if(t instanceof Me)return new Me(t.l,t.a,t.b,t.opacity);if(t instanceof Ge)return im(t);t instanceof Et||(t=Dc(t));var e=Rc(t.r),n=Rc(t.g),r=Rc(t.b),i=Cc((.2225045*e+.7168786*n+.0606169*r)/Q0),o,a;return e===n&&n===r?o=a=i:(o=Cc((.4360747*e+.3850649*n+.1430804*r)/K0),a=Cc((.0139322*e+.0971045*n+.7141733*r)/J0)),new Me(116*i-16,500*(o-i),200*(i-a),t.opacity)}function E3(t,e){return new Me(t,0,0,e??1)}function ls(t,e,n,r){return arguments.length===1?nm(t):new Me(t,e,n,r??1)}function Me(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}Hr(Me,ls,Ji(_n,{brighter(t){return new Me(this.l+ss*(t??1),this.a,this.b,this.opacity)},darker(t){return new Me(this.l-ss*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=K0*Lc(e),t=Q0*Lc(t),n=J0*Lc(n),new Et(kc(3.1338561*e-1.6168667*t-.4906146*n),kc(-.9787684*e+1.9161415*t+.033454*n),kc(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function Cc(t){return t>R3?Math.pow(t,1/3):t/em+tm}function Lc(t){return t>Kr?t*t*t:em*(t-tm)}function kc(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Rc(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function rm(t){if(t instanceof Ge)return new Ge(t.h,t.c,t.l,t.opacity);if(t instanceof Me||(t=nm(t)),t.a===0&&t.b===0)return new Ge(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Z0;return new Ge(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function I3(t,e,n,r){return arguments.length===1?rm(t):new Ge(n,e,t,r??1)}function us(t,e,n,r){return arguments.length===1?rm(t):new Ge(t,e,n,r??1)}function Ge(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function im(t){if(isNaN(t.h))return new Me(t.l,0,0,t.opacity);var e=t.h*q0;return new Me(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}Hr(Ge,us,Ji(_n,{brighter(t){return new Ge(this.h,this.c,this.l+ss*(t??1),this.opacity)},darker(t){return new Ge(this.h,this.c,this.l-ss*(t??1),this.opacity)},rgb(){return im(this).rgb()}}));var om=-.14861,Ec=1.78277,Ic=-.29227,cs=-.90649,eo=1.97294,am=eo*cs,sm=eo*Ec,lm=Ec*Ic-cs*om;function B3(t){if(t instanceof tr)return new tr(t.h,t.s,t.l,t.opacity);t instanceof Et||(t=Dc(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(lm*r+am*e-sm*n)/(lm+am-sm),o=r-i,a=(eo*(n-i)-Ic*o)/cs,s=Math.sqrt(a*a+o*o)/(eo*i*(1-i)),l=s?Math.atan2(a,o)*Z0-120:NaN;return new tr(l<0?l+360:l,s,i,t.opacity)}function Ce(t,e,n,r){return arguments.length===1?B3(t):new tr(t,e,n,r??1)}function tr(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Hr(tr,Ce,Ji(_n,{brighter(t){return t=t==null?jr:Math.pow(jr,t),new tr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Kn:Math.pow(Kn,t),new tr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*q0,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new Et(255*(e+n*(om*r+Ec*i)),255*(e+n*(Ic*r+cs*i)),255*(e+n*(eo*r)),this.opacity)}}));function um(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}function cm(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return um((n-r/e)*e,a,i,o,s)}}function fm(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return um((n-r/e)*e,i,o,a,s)}}const fs=t=>()=>t;function hm(t,e){return function(n){return t+n*e}}function N3(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function hs(t,e){var n=e-t;return n?hm(t,n>180||n<-180?n-360*Math.round(n/360):n):fs(isNaN(t)?e:t)}function F3(t){return(t=+t)==1?It:function(e,n){return n-e?N3(e,n,t):fs(isNaN(e)?n:e)}}function It(t,e){var n=e-t;return n?hm(t,n):fs(isNaN(t)?e:t)}const no=function t(e){var n=F3(e);function r(i,o){var a=n((i=Zr(i)).r,(o=Zr(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),u=It(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=t,r}(1);function pm(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),a,s;for(a=0;a<n;++a)s=Zr(e[a]),r[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return r=t(r),i=t(i),o=t(o),s.opacity=1,function(l){return s.r=r(l),s.g=i(l),s.b=o(l),s+""}}}var dm=pm(cm),O3=pm(fm);function Bc(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function gm(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function z3(t,e){return(gm(e)?Bc:mm)(t,e)}function mm(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=tn(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function ym(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function me(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function bm(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=tn(t[i],e[i]):r[i]=e[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var Nc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Fc=new RegExp(Nc.source,"g");function G3(t){return function(){return t}}function Y3(t){return function(e){return t(e)+""}}function Oc(t,e){var n=Nc.lastIndex=Fc.lastIndex=0,r,i,o,a=-1,s=[],l=[];for(t=t+"",e=e+"";(r=Nc.exec(t))&&(i=Fc.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:me(r,i)})),n=Fc.lastIndex;return n<e.length&&(o=e.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?Y3(l[0].x):G3(e):(e=l.length,function(u){for(var c=0,f;c<e;++c)s[(f=l[c]).i]=f.x(u);return s.join("")})}function tn(t,e){var n=typeof e,r;return e==null||n==="boolean"?fs(e):(n==="number"?me:n==="string"?(r=wn(e))?(e=r,no):Oc:e instanceof wn?no:e instanceof Date?ym:gm(e)?Bc:Array.isArray(e)?mm:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?bm:me)(t,e)}function X3(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function V3(t,e){var n=hs(+t,+e);return function(r){var i=n(r);return i-360*Math.floor(i/360)}}function ps(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var xm=180/Math.PI,zc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function vm(t,e,n,r,i,o){var a,s,l;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),t*r<e*n&&(t=-t,e=-e,l=-l,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*xm,skewX:Math.atan(l)*xm,scaleX:a,scaleY:s}}var ds;function W3(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?zc:vm(e.a,e.b,e.c,e.d,e.e,e.f)}function U3(t){return t==null||(ds||(ds=document.createElementNS("http://www.w3.org/2000/svg","g")),ds.setAttribute("transform",t),!(t=ds.transform.baseVal.consolidate()))?zc:(t=t.matrix,vm(t.a,t.b,t.c,t.d,t.e,t.f))}function $m(t,e,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,c,f,h,p,d){if(u!==f||c!==h){var m=p.push("translate(",null,e,null,n);d.push({i:m-4,x:me(u,f)},{i:m-2,x:me(c,h)})}else(f||h)&&p.push("translate("+f+e+h+n)}function a(u,c,f,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:me(u,c)})):c&&f.push(i(f)+"rotate("+c+r)}function s(u,c,f,h){u!==c?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:me(u,c)}):c&&f.push(i(f)+"skewX("+c+r)}function l(u,c,f,h,p,d){if(u!==f||c!==h){var m=p.push(i(p)+"scale(",null,",",null,")");d.push({i:m-4,x:me(u,f)},{i:m-2,x:me(c,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(u,c){var f=[],h=[];return u=t(u),c=t(c),o(u.translateX,u.translateY,c.translateX,c.translateY,f,h),a(u.rotate,c.rotate,f,h),s(u.skewX,c.skewX,f,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,h),u=c=null,function(p){for(var d=-1,m=h.length,g;++d<m;)f[(g=h[d]).i]=g.x(p);return f.join("")}}}var _m=$m(W3,"px, ","px)","deg)"),wm=$m(U3,", ",")",")"),H3=1e-12;function Sm(t){return((t=Math.exp(t))+1/t)/2}function j3(t){return((t=Math.exp(t))-1/t)/2}function q3(t){return((t=Math.exp(2*t))-1)/(t+1)}const Am=function t(e,n,r){function i(o,a){var s=o[0],l=o[1],u=o[2],c=a[0],f=a[1],h=a[2],p=c-s,d=f-l,m=p*p+d*d,g,y;if(m<H3)y=Math.log(h/u)/e,g=function(A){return[s+A*p,l+A*d,u*Math.exp(e*A*y)]};else{var b=Math.sqrt(m),v=(h*h-u*u+r*m)/(2*u*n*b),x=(h*h-u*u-r*m)/(2*h*n*b),_=Math.log(Math.sqrt(v*v+1)-v),S=Math.log(Math.sqrt(x*x+1)-x);y=(S-_)/e,g=function(A){var T=A*y,C=Sm(_),I=u/(n*b)*(C*q3(e*T+_)-j3(_));return[s+I*p,l+I*d,u*C/Sm(e*T+_)]}}return g.duration=y*1e3*e/Math.SQRT2,g}return i.rho=function(o){var a=Math.max(.001,+o),s=a*a,l=s*s;return t(a,s,l)},i}(Math.SQRT2,2,4);function Tm(t){return function(e,n){var r=t((e=os(e)).h,(n=os(n)).h),i=It(e.s,n.s),o=It(e.l,n.l),a=It(e.opacity,n.opacity);return function(s){return e.h=r(s),e.s=i(s),e.l=o(s),e.opacity=a(s),e+""}}}const Z3=Tm(hs);var K3=Tm(It);function Q3(t,e){var n=It((t=ls(t)).l,(e=ls(e)).l),r=It(t.a,e.a),i=It(t.b,e.b),o=It(t.opacity,e.opacity);return function(a){return t.l=n(a),t.a=r(a),t.b=i(a),t.opacity=o(a),t+""}}function Pm(t){return function(e,n){var r=t((e=us(e)).h,(n=us(n)).h),i=It(e.c,n.c),o=It(e.l,n.l),a=It(e.opacity,n.opacity);return function(s){return e.h=r(s),e.c=i(s),e.l=o(s),e.opacity=a(s),e+""}}}const J3=Pm(hs);var tC=Pm(It);function Dm(t){return function e(n){n=+n;function r(i,o){var a=t((i=Ce(i)).h,(o=Ce(o)).h),s=It(i.s,o.s),l=It(i.l,o.l),u=It(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=e,r}(1)}const eC=Dm(hs);var gs=Dm(It);function Mm(t,e){e===void 0&&(e=t,t=tn);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(a){var s=Math.max(0,Math.min(r-1,Math.floor(a*=r)));return o[s](a-s)}}function nC(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}var Qr=0,ro=0,io=0,Cm=1e3,ms,oo,ys=0,er=0,bs=0,ao=typeof performance=="object"&&performance.now?performance:Date,Lm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function so(){return er||(Lm(rC),er=ao.now()+bs)}function rC(){er=0}function lo(){this._call=this._time=this._next=null}lo.prototype=xs.prototype={constructor:lo,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?so():+n)+(e==null?0:+e),!this._next&&oo!==this&&(oo?oo._next=this:ms=this,oo=this),this._call=t,this._time=n,Gc()},stop:function(){this._call&&(this._call=null,this._time=1/0,Gc())}};function xs(t,e,n){var r=new lo;return r.restart(t,e,n),r}function km(){so(),++Qr;for(var t=ms,e;t;)(e=er-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Qr}function Rm(){er=(ys=ao.now())+bs,Qr=ro=0;try{km()}finally{Qr=0,oC(),er=0}}function iC(){var t=ao.now(),e=t-ys;e>Cm&&(bs-=e,ys=t)}function oC(){for(var t,e=ms,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:ms=n);oo=t,Gc(r)}function Gc(t){if(!Qr){ro&&(ro=clearTimeout(ro));var e=t-er;e>24?(t<1/0&&(ro=setTimeout(Rm,t-ao.now()-bs)),io&&(io=clearInterval(io))):(io||(ys=ao.now(),io=setInterval(iC,Cm)),Qr=1,Lm(Rm))}}function Yc(t,e,n){var r=new lo;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}function aC(t,e,n){var r=new lo,i=e;return e==null?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(o,a,s){a=+a,s=s==null?so():+s,r._restart(function l(u){u+=i,r._restart(l,i+=a,s),o(u)},a,s)},r.restart(t,e,n),r)}var sC=jn("start","end","cancel","interrupt"),lC=[],Em=0,Xc=1,Vc=2,vs=3,Im=4,Wc=5,$s=6;function _s(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;uC(t,n,{name:e,index:r,group:i,on:sC,tween:lC,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Em})}function Uc(t,e){var n=Le(t,e);if(n.state>Em)throw new Error("too late; already scheduled");return n}function Ye(t,e){var n=Le(t,e);if(n.state>vs)throw new Error("too late; already running");return n}function Le(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function uC(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=xs(o,0,n.time);function o(u){n.state=Xc,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,f,h,p;if(n.state!==Xc)return l();for(c in r)if(p=r[c],p.name===n.name){if(p.state===vs)return Yc(a);p.state===Im?(p.state=$s,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete r[c]):+c<e&&(p.state=$s,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete r[c])}if(Yc(function(){n.state===vs&&(n.state=Im,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=Vc,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Vc){for(n.state=vs,i=new Array(h=n.tween.length),c=0,f=-1;c<h;++c)(p=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Wc,1),f=-1,h=i.length;++f<h;)i[f].call(t,c);n.state===Wc&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){n.state=$s,n.timer.stop(),delete r[e];for(var u in r)return;delete t.__transition}}function nr(t,e){var n=t.__transition,r,i,o=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){o=!1;continue}i=r.state>Vc&&r.state<Wc,r.state=$s,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}o&&delete t.__transition}}function cC(t){return this.each(function(){nr(this,t)})}function fC(t,e){var n,r;return function(){var i=Ye(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function hC(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Ye(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:e,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===e){i[l]=s;break}l===u&&i.push(s)}o.tween=i}}function pC(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Le(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?fC:hC)(n,t,e))}function Hc(t,e,n){var r=t._id;return t.each(function(){var i=Ye(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Le(i,r).value[e]}}function Bm(t,e){var n;return(typeof e=="number"?me:e instanceof wn?no:(n=wn(e))?(e=n,no):Oc)(t,e)}function dC(t){return function(){this.removeAttribute(t)}}function gC(t){return function(){this.removeAttributeNS(t.space,t.local)}}function mC(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function yC(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function bC(t,e,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttribute(t):(a=this.getAttribute(t),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=e(r=a,s)))}}function xC(t,e,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=e(r=a,s)))}}function vC(t,e){var n=Ki(t),r=n==="transform"?wm:Bm;return this.attrTween(t,typeof e=="function"?(n.local?xC:bC)(n,r,Hc(this,"attr."+t,e)):e==null?(n.local?gC:dC)(n):(n.local?yC:mC)(n,r,e))}function $C(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function _C(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function wC(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&_C(t,o)),n}return i._value=e,i}function SC(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&$C(t,o)),n}return i._value=e,i}function AC(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Ki(t);return this.tween(n,(r.local?wC:SC)(r,e))}function TC(t,e){return function(){Uc(this,t).delay=+e.apply(this,arguments)}}function PC(t,e){return e=+e,function(){Uc(this,t).delay=e}}function DC(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?TC:PC)(e,t)):Le(this.node(),e).delay}function MC(t,e){return function(){Ye(this,t).duration=+e.apply(this,arguments)}}function CC(t,e){return e=+e,function(){Ye(this,t).duration=e}}function LC(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?MC:CC)(e,t)):Le(this.node(),e).duration}function kC(t,e){if(typeof e!="function")throw new Error;return function(){Ye(this,t).ease=e}}function RC(t){var e=this._id;return arguments.length?this.each(kC(e,t)):Le(this.node(),e).ease}function EC(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Ye(this,t).ease=n}}function IC(t){if(typeof t!="function")throw new Error;return this.each(EC(this._id,t))}function BC(t){typeof t!="function"&&(t=$c(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&t.call(l,l.__data__,u,o)&&s.push(l);return new Xe(r,this._parents,this._name,this._id)}function NC(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var l=e[s],u=n[s],c=l.length,f=a[s]=new Array(c),h,p=0;p<c;++p)(h=l[p]||u[p])&&(f[p]=h);for(;s<r;++s)a[s]=e[s];return new Xe(a,this._parents,this._name,this._id)}function FC(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function OC(t,e,n){var r,i,o=FC(e)?Uc:Ye;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}function zC(t,e){var n=this._id;return arguments.length<2?Le(this.node(),n).on.on(t):this.each(OC(n,t,e))}function GC(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function YC(){return this.on("end.remove",GC(this._id))}function XC(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Qa(t));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,f,h=0;h<l;++h)(c=s[h])&&(f=t.call(c,c.__data__,h,s))&&("__data__"in c&&(f.__data__=c.__data__),u[h]=f,_s(u[h],e,n,h,u,Le(c,n)));return new Xe(o,this._parents,e,n)}function VC(t){var e=this._name,n=this._id;typeof t!="function"&&(t=vc(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var l=r[s],u=l.length,c,f=0;f<u;++f)if(c=l[f]){for(var h=t.call(c,c.__data__,f,l),p,d=Le(c,n),m=0,g=h.length;m<g;++m)(p=h[m])&&_s(p,e,n,m,h,d);o.push(h),a.push(c)}return new Xe(o,a,e,n)}var WC=Zn.prototype.constructor;function UC(){return new WC(this._groups,this._parents)}function HC(t,e){var n,r,i;return function(){var o=qn(this,t),a=(this.style.removeProperty(t),qn(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}function Nm(t){return function(){this.style.removeProperty(t)}}function jC(t,e,n){var r,i=n+"",o;return function(){var a=qn(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function qC(t,e,n){var r,i,o;return function(){var a=qn(this,t),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(t),qn(this,t))),a===l?null:a===r&&l===i?o:(i=l,o=e(r=a,s))}}function ZC(t,e){var n,r,i,o="style."+e,a="end."+o,s;return function(){var l=Ye(this,t),u=l.on,c=l.value[o]==null?s||(s=Nm(e)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(a,i=c),l.on=r}}function KC(t,e,n){var r=(t+="")=="transform"?_m:Bm;return e==null?this.styleTween(t,HC(t,r)).on("end.style."+t,Nm(t)):typeof e=="function"?this.styleTween(t,qC(t,r,Hc(this,"style."+t,e))).each(ZC(this._id,t)):this.styleTween(t,jC(t,r,e),n).on("end.style."+t,null)}function QC(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function JC(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&QC(t,a,n)),r}return o._value=e,o}function t5(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,JC(t,e,n??""))}function e5(t){return function(){this.textContent=t}}function n5(t){return function(){var e=t(this);this.textContent=e??""}}function r5(t){return this.tween("text",typeof t=="function"?n5(Hc(this,"text",t)):e5(t==null?"":t+""))}function i5(t){return function(e){this.textContent=t.call(this,e)}}function o5(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&i5(i)),e}return r._value=t,r}function a5(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,o5(t))}function s5(){for(var t=this._name,e=this._id,n=Om(),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=Le(l,e);_s(l,t,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Xe(r,this._parents,t,n)}function l5(){var t,e,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=Ye(this,r),c=u.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(l)),u.on=e}),i===0&&o()})}var u5=0;function Xe(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Fm(t){return Zn().transition(t)}function Om(){return++u5}var en=Zn.prototype;Xe.prototype=Fm.prototype={constructor:Xe,select:XC,selectAll:VC,selectChild:en.selectChild,selectChildren:en.selectChildren,filter:BC,merge:NC,selection:UC,transition:s5,call:en.call,nodes:en.nodes,node:en.node,size:en.size,empty:en.empty,each:en.each,on:zC,attr:vC,attrTween:AC,style:KC,styleTween:t5,text:r5,textTween:a5,remove:YC,tween:pC,delay:DC,duration:LC,ease:RC,easeVarying:IC,end:l5,[Symbol.iterator]:en[Symbol.iterator]};const c5=t=>+t;function f5(t){return t*t}function h5(t){return t*(2-t)}function zm(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function p5(t){return t*t*t}function d5(t){return--t*t*t+1}function uo(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var jc=3,g5=function t(e){e=+e;function n(r){return Math.pow(r,e)}return n.exponent=t,n}(jc),m5=function t(e){e=+e;function n(r){return 1-Math.pow(1-r,e)}return n.exponent=t,n}(jc),Gm=function t(e){e=+e;function n(r){return((r*=2)<=1?Math.pow(r,e):2-Math.pow(2-r,e))/2}return n.exponent=t,n}(jc),Ym=Math.PI,Xm=Ym/2;function y5(t){return+t==1?1:1-Math.cos(t*Xm)}function b5(t){return Math.sin(t*Xm)}function Vm(t){return(1-Math.cos(Ym*t))/2}function Sn(t){return(Math.pow(2,-10*t)-.0009765625)*1.0009775171065494}function x5(t){return Sn(1-+t)}function v5(t){return 1-Sn(t)}function Wm(t){return((t*=2)<=1?Sn(1-t):2-Sn(t-1))/2}function $5(t){return 1-Math.sqrt(1-t*t)}function _5(t){return Math.sqrt(1- --t*t)}function Um(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var qc=4/11,w5=6/11,S5=8/11,A5=3/4,T5=9/11,P5=10/11,D5=15/16,M5=21/22,C5=63/64,ws=1/qc/qc;function L5(t){return 1-co(1-t)}function co(t){return(t=+t)<qc?ws*t*t:t<S5?ws*(t-=w5)*t+A5:t<P5?ws*(t-=T5)*t+D5:ws*(t-=M5)*t+C5}function k5(t){return((t*=2)<=1?1-co(1-t):co(t-1)+1)/2}var Zc=1.70158,R5=function t(e){e=+e;function n(r){return(r=+r)*r*(e*(r-1)+r)}return n.overshoot=t,n}(Zc),E5=function t(e){e=+e;function n(r){return--r*r*((r+1)*e+r)+1}return n.overshoot=t,n}(Zc),Hm=function t(e){e=+e;function n(r){return((r*=2)<1?r*r*((e+1)*r-e):(r-=2)*r*((e+1)*r+e)+2)/2}return n.overshoot=t,n}(Zc),Jr=2*Math.PI,Kc=1,Qc=.3,I5=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Jr);function i(o){return e*Sn(- --o)*Math.sin((r-o)/n)}return i.amplitude=function(o){return t(o,n*Jr)},i.period=function(o){return t(e,o)},i}(Kc,Qc),fo=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Jr);function i(o){return 1-e*Sn(o=+o)*Math.sin((o+r)/n)}return i.amplitude=function(o){return t(o,n*Jr)},i.period=function(o){return t(e,o)},i}(Kc,Qc),B5=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Jr);function i(o){return((o=o*2-1)<0?e*Sn(-o)*Math.sin((r-o)/n):2-e*Sn(o)*Math.sin((r+o)/n))/2}return i.amplitude=function(o){return t(o,n*Jr)},i.period=function(o){return t(e,o)},i}(Kc,Qc),N5={time:null,delay:0,duration:250,ease:uo};function F5(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function O5(t){var e,n;t instanceof Xe?(e=t._id,t=t._name):(e=Om(),(n=N5).time=so(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&_s(l,t,e,u,a,n||F5(l,e));return new Xe(r,this._parents,t,e)}Zn.prototype.interrupt=cC,Zn.prototype.transition=O5;var z5=[null];function G5(t,e){var n=t.__transition,r,i;if(n){e=e==null?null:e+"";for(i in n)if((r=n[i]).state>Xc&&r.name===e)return new Xe([[t]],z5,e,+i)}return null}const Jc=t=>()=>t;function Y5(t,{sourceEvent:e,target:n,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,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 X5(t){t.stopImmediatePropagation()}function tf(t){t.preventDefault(),t.stopImmediatePropagation()}var jm={name:"drag"},ef={name:"space"},ti={name:"handle"},ei={name:"center"};const{abs:qm,max:Ot,min:zt}=Math;function Zm(t){return[+t[0],+t[1]]}function nf(t){return[Zm(t[0]),Zm(t[1])]}var Ss={name:"x",handles:["w","e"].map(ho),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},As={name:"y",handles:["n","s"].map(ho),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},V5={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(ho),input:function(t){return t==null?null:nf(t)},output:function(t){return t}},nn={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"},Km={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Qm={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},W5={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},U5={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function ho(t){return{type:t}}function H5(t){return!t.ctrlKey&&!t.button}function j5(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function q5(){return navigator.maxTouchPoints||"ontouchstart"in this}function rf(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Z5(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function K5(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function Q5(){return of(Ss)}function J5(){return of(As)}function t6(){return of(V5)}function of(t){var e=j5,n=H5,r=q5,i=!0,o=jn("start","brush","end"),a=6,s;function l(g){var y=g.property("__brush",m).selectAll(".overlay").data([ho("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",nn.overlay).merge(y).each(function(){var v=rf(this).extent;H(this).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1])}),g.selectAll(".selection").data([ho("selection")]).enter().append("rect").attr("class","selection").attr("cursor",nn.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var b=g.selectAll(".handle").data(t.handles,function(v){return v.type});b.exit().remove(),b.enter().append("rect").attr("class",function(v){return"handle handle--"+v.type}).attr("cursor",function(v){return nn[v.type]}),g.each(u).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).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(v){c(this,arguments).beforestart().start(v)}).on("interrupt.brush end.brush",function(v){c(this,arguments).end(v)}).tween("brush",function(){var v=this,x=v.__brush,_=c(v,arguments),S=x.selection,A=t.input(typeof y=="function"?y.apply(this,arguments):y,x.extent),T=tn(S,A);function C(I){x.selection=I===1&&A===null?null:T(I),u.call(v),_.brush()}return S!==null&&A!==null?C:C(1)}):g.each(function(){var v=this,x=arguments,_=v.__brush,S=t.input(typeof y=="function"?y.apply(v,x):y,_.extent),A=c(v,x).beforestart();nr(v),_.selection=S===null?null:S,u.call(v),A.start(b).brush(b).end(b)})},l.clear=function(g,y){l.move(g,null,y)};function u(){var g=H(this),y=rf(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 v=g.__brush.emitter;return v&&(!b||!v.clean)?v:new f(g,y,b)}function f(g,y,b){this.that=g,this.args=y,this.state=g.__brush,this.active=0,this.clean=b}f.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 v=H(this.that).datum();o.call(g,this.that,new Y5(g,{sourceEvent:y,target:l,selection:t.output(this.state.selection),mode:b,dispatch:o}),v)}};function h(g){if(s&&!g.touches||!n.apply(this,arguments))return;var y=this,b=g.target.__data__.type,v=(i&&g.metaKey?b="overlay":b)==="selection"?jm:i&&g.altKey?ei:ti,x=t===As?null:W5[b],_=t===Ss?null:U5[b],S=rf(y),A=S.extent,T=S.selection,C=A[0][0],I,$,L=A[0][1],P,w,M=A[1][0],D,X,O=A[1][1],E,N,R=0,F=0,U,it=x&&_&&i&&g.shiftKey,z,K,V=Array.from(g.touches||[g],lt=>{const Dt=lt.identifier;return lt=fe(lt,y),lt.point0=lt.slice(),lt.identifier=Dt,lt});nr(y);var Z=c(y,arguments,!0).beforestart();if(b==="overlay"){T&&(U=!0);const lt=[V[0],V[1]||V[0]];S.selection=T=[[I=t===As?C:zt(lt[0][0],lt[1][0]),P=t===Ss?L:zt(lt[0][1],lt[1][1])],[D=t===As?M:Ot(lt[0][0],lt[1][0]),E=t===Ss?O:Ot(lt[0][1],lt[1][1])]],V.length>1&&gt(g)}else I=T[0][0],P=T[0][1],D=T[1][0],E=T[1][1];$=I,w=P,X=D,N=E;var j=H(y).attr("pointer-events","none"),nt=j.selectAll(".overlay").attr("cursor",nn[b]);if(g.touches)Z.moved=W,Z.ended=ft;else{var st=H(g.view).on("mousemove.brush",W,!0).on("mouseup.brush",ft,!0);i&&st.on("keydown.brush",Rt,!0).on("keyup.brush",ee,!0),ts(g.view)}u.call(y),Z.start(g,v.name);function W(lt){for(const Dt of lt.changedTouches||[lt])for(const sa of V)sa.identifier===Dt.identifier&&(sa.cur=fe(Dt,y));if(it&&!z&&!K&&V.length===1){const Dt=V[0];qm(Dt.cur[0]-Dt[0])>qm(Dt.cur[1]-Dt[1])?K=!0:z=!0}for(const Dt of V)Dt.cur&&(Dt[0]=Dt.cur[0],Dt[1]=Dt.cur[1]);U=!0,tf(lt),gt(lt)}function gt(lt){const Dt=V[0],sa=Dt.point0;var En;switch(R=Dt[0]-sa[0],F=Dt[1]-sa[1],v){case ef:case jm:{x&&(R=Ot(C-I,zt(M-D,R)),$=I+R,X=D+R),_&&(F=Ot(L-P,zt(O-E,F)),w=P+F,N=E+F);break}case ti:{V[1]?(x&&($=Ot(C,zt(M,V[0][0])),X=Ot(C,zt(M,V[1][0])),x=1),_&&(w=Ot(L,zt(O,V[0][1])),N=Ot(L,zt(O,V[1][1])),_=1)):(x<0?(R=Ot(C-I,zt(M-I,R)),$=I+R,X=D):x>0&&(R=Ot(C-D,zt(M-D,R)),$=I,X=D+R),_<0?(F=Ot(L-P,zt(O-P,F)),w=P+F,N=E):_>0&&(F=Ot(L-E,zt(O-E,F)),w=P,N=E+F));break}case ei:{x&&($=Ot(C,zt(M,I-R*x)),X=Ot(C,zt(M,D+R*x))),_&&(w=Ot(L,zt(O,P-F*_)),N=Ot(L,zt(O,E+F*_)));break}}X<$&&(x*=-1,En=I,I=D,D=En,En=$,$=X,X=En,b in Km&&nt.attr("cursor",nn[b=Km[b]])),N<w&&(_*=-1,En=P,P=E,E=En,En=w,w=N,N=En,b in Qm&&nt.attr("cursor",nn[b=Qm[b]])),S.selection&&(T=S.selection),z&&($=T[0][0],X=T[1][0]),K&&(w=T[0][1],N=T[1][1]),(T[0][0]!==$||T[0][1]!==w||T[1][0]!==X||T[1][1]!==N)&&(S.selection=[[$,w],[X,N]],u.call(y),Z.brush(lt,v.name))}function ft(lt){if(X5(lt),lt.touches){if(lt.touches.length)return;s&&clearTimeout(s),s=setTimeout(function(){s=null},500)}else es(lt.view,U),st.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);j.attr("pointer-events","all"),nt.attr("cursor",nn.overlay),S.selection&&(T=S.selection),Z5(T)&&(S.selection=null,u.call(y)),Z.end(lt,v.name)}function Rt(lt){switch(lt.keyCode){case 16:{it=x&&_;break}case 18:{v===ti&&(x&&(D=X-R*x,I=$+R*x),_&&(E=N-F*_,P=w+F*_),v=ei,gt(lt));break}case 32:{(v===ti||v===ei)&&(x<0?D=X-R:x>0&&(I=$-R),_<0?E=N-F:_>0&&(P=w-F),v=ef,nt.attr("cursor",nn.selection),gt(lt));break}default:return}tf(lt)}function ee(lt){switch(lt.keyCode){case 16:{it&&(z=K=it=!1,gt(lt));break}case 18:{v===ei&&(x<0?D=X:x>0&&(I=$),_<0?E=N:_>0&&(P=w),v=ti,gt(lt));break}case 32:{v===ef&&(lt.altKey?(x&&(D=X-R*x,I=$+R*x),_&&(E=N-F*_,P=w+F*_),v=ei):(x<0?D=X:x>0&&(I=$),_<0?E=N:_>0&&(P=w),v=ti),nt.attr("cursor",nn[b]),gt(lt));break}default:return}tf(lt)}}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=nf(e.apply(this,arguments)),g.dim=t,g}return l.extent=function(g){return arguments.length?(e=typeof g=="function"?g:Jc(nf(g)),l):e},l.filter=function(g){return arguments.length?(n=typeof g=="function"?g:Jc(!!g),l):n},l.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:Jc(!!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 Jm=Math.abs,ni=Math.cos,ri=Math.sin,ty=Math.PI,Ts=ty/2,ey=ty*2,ny=Math.max,af=1e-12;function sf(t,e){return Array.from({length:e-t},(n,r)=>t+r)}function e6(t){return function(e,n){return t(e.source.value+e.target.value,n.source.value+n.target.value)}}function n6(){return lf(!1,!1)}function r6(){return lf(!1,!0)}function i6(){return lf(!0,!1)}function lf(t,e){var n=0,r=null,i=null,o=null;function a(s){var l=s.length,u=new Array(l),c=sf(0,l),f=new Array(l*l),h=new Array(l),p=0,d;s=Float64Array.from({length:l*l},e?(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]+t*s[y*l+m];p+=u[m]=g}p=ny(0,ey-n*l)/p,d=p?n:ey/l;{let m=0;r&&c.sort((g,y)=>r(u[g],u[y]));for(const g of c){const y=m;if(t){const b=sf(~l+1,l).filter(v=>v<0?s[~v*l+g]:s[g*l+v]);i&&b.sort((v,x)=>i(v<0?-s[~v*l+g]:s[g*l+v],x<0?-s[~x*l+g]:s[g*l+x]));for(const v of b)if(v<0){const x=f[~v*l+g]||(f[~v*l+g]={source:null,target:null});x.target={index:g,startAngle:m,endAngle:m+=s[~v*l+g]*p,value:s[~v*l+g]}}else{const x=f[g*l+v]||(f[g*l+v]={source:null,target:null});x.source={index:g,startAngle:m,endAngle:m+=s[g*l+v]*p,value:s[g*l+v]}}h[g]={index:g,startAngle:y,endAngle:m,value:u[g]}}else{const b=sf(0,l).filter(v=>s[g*l+v]||s[v*l+g]);i&&b.sort((v,x)=>i(s[g*l+v],s[g*l+x]));for(const v of b){let x;if(g<v?(x=f[g*l+v]||(f[g*l+v]={source:null,target:null}),x.source={index:g,startAngle:m,endAngle:m+=s[g*l+v]*p,value:s[g*l+v]}):(x=f[v*l+g]||(f[v*l+g]={source:null,target:null}),x.target={index:g,startAngle:m,endAngle:m+=s[g*l+v]*p,value:s[g*l+v]},g===v&&(x.source=x.target)),x.source&&x.target&&x.source.value<x.target.value){const _=x.source;x.source=x.target,x.target=_}}h[g]={index:g,startAngle:y,endAngle:m,value:u[g]}}m+=d}}return f=Object.values(f),f.groups=h,o?f.sort(o):f}return a.padAngle=function(s){return arguments.length?(n=ny(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=e6(s))._=s,a):o&&o._},a}const uf=Math.PI,cf=2*uf,rr=1e-6,o6=cf-rr;function ry(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function a6(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return ry;const n=10**e;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 po=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?ry:a6(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,i){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,n,r,i,o,a){this._append`C${+e},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(e,n,r,i,o){if(e=+e,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-e,u=i-n,c=a-e,f=s-n,h=c*c+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(h>rr)if(!(Math.abs(f*l-u*c)>rr)||!o)this._append`L${this._x1=e},${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(h),v=o*Math.tan((uf-Math.acos((m+h-g)/(2*y*b)))/2),x=v/b,_=v/y;Math.abs(x-1)>rr&&this._append`L${e+x*c},${n+x*f}`,this._append`A${o},${o},0,0,${+(f*p>c*d)},${this._x1=e+_*l},${this._y1=n+_*u}`}}arc(e,n,r,i,o,a){if(e=+e,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=e+s,c=n+l,f=1^a,h=a?i-o:o-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>rr||Math.abs(this._y1-c)>rr)&&this._append`L${u},${c}`,r&&(h<0&&(h=h%cf+cf),h>o6?this._append`A${r},${r},0,1,${f},${e-s},${n-l}A${r},${r},0,1,${f},${this._x1=u},${this._y1=c}`:h>rr&&this._append`A${r},${r},0,${+(h>=uf)},${f},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function ff(){return new po}ff.prototype=po.prototype;function s6(t=3){return new po(+t)}var l6=Array.prototype.slice;function ir(t){return function(){return t}}function u6(t){return t.source}function c6(t){return t.target}function iy(t){return t.radius}function f6(t){return t.startAngle}function h6(t){return t.endAngle}function p6(){return 0}function d6(){return 10}function oy(t){var e=u6,n=c6,r=iy,i=iy,o=f6,a=h6,s=p6,l=null;function u(){var c,f=e.apply(this,arguments),h=n.apply(this,arguments),p=s.apply(this,arguments)/2,d=l6.call(arguments),m=+r.apply(this,(d[0]=f,d)),g=o.apply(this,d)-Ts,y=a.apply(this,d)-Ts,b=+i.apply(this,(d[0]=h,d)),v=o.apply(this,d)-Ts,x=a.apply(this,d)-Ts;if(l||(l=c=ff()),p>af&&(Jm(y-g)>p*2+af?y>g?(g+=p,y-=p):(g-=p,y+=p):g=y=(g+y)/2,Jm(x-v)>p*2+af?x>v?(v+=p,x-=p):(v-=p,x+=p):v=x=(v+x)/2),l.moveTo(m*ni(g),m*ri(g)),l.arc(0,0,m,g,y),g!==v||y!==x)if(t){var _=+t.apply(this,arguments),S=b-_,A=(v+x)/2;l.quadraticCurveTo(0,0,S*ni(v),S*ri(v)),l.lineTo(b*ni(A),b*ri(A)),l.lineTo(S*ni(x),S*ri(x))}else l.quadraticCurveTo(0,0,b*ni(v),b*ri(v)),l.arc(0,0,b,v,x);if(l.quadraticCurveTo(0,0,m*ni(g),m*ri(g)),l.closePath(),c)return l=null,c+""||null}return t&&(u.headRadius=function(c){return arguments.length?(t=typeof c=="function"?c:ir(+c),u):t}),u.radius=function(c){return arguments.length?(r=i=typeof c=="function"?c:ir(+c),u):r},u.sourceRadius=function(c){return arguments.length?(r=typeof c=="function"?c:ir(+c),u):r},u.targetRadius=function(c){return arguments.length?(i=typeof c=="function"?c:ir(+c),u):i},u.startAngle=function(c){return arguments.length?(o=typeof c=="function"?c:ir(+c),u):o},u.endAngle=function(c){return arguments.length?(a=typeof c=="function"?c:ir(+c),u):a},u.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:ir(+c),u):s},u.source=function(c){return arguments.length?(e=c,u):e},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 g6(){return oy()}function m6(){return oy(d6)}var y6=Array.prototype,ay=y6.slice;function b6(t,e){return t-e}function x6(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}const An=t=>()=>t;function v6(t,e){for(var n=-1,r=e.length,i;++n<r;)if(i=$6(t,e[n]))return i;return 0}function $6(t,e){for(var n=e[0],r=e[1],i=-1,o=0,a=t.length,s=a-1;o<a;s=o++){var l=t[o],u=l[0],c=l[1],f=t[s],h=f[0],p=f[1];if(_6(l,f,e))return 0;c>r!=p>r&&n<(h-u)*(r-c)/(p-c)+u&&(i=-i)}return i}function _6(t,e,n){var r;return w6(t,e,n)&&S6(t[r=+(t[0]===e[0])],n[r],e[r])}function w6(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function S6(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function A6(){}var rn=[[],[[[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 hf(){var t=1,e=1,n=cc,r=l;function i(u){var c=n(u);if(Array.isArray(c))c=c.slice().sort(b6);else{const f=Wi(u,T6);for(c=Un(...uc(f[0],f[1],c),c);c[c.length-1]>=f[1];)c.pop();for(;c[1]<f[0];)c.shift()}return c.map(f=>o(u,f))}function o(u,c){const f=c==null?NaN:+c;if(isNaN(f))throw new Error(`invalid value: ${c}`);var h=[],p=[];return a(u,f,function(d){r(d,u,f),x6(d)>0?h.push([d]):p.push(d)}),p.forEach(function(d){for(var m=0,g=h.length,y;m<g;++m)if(v6((y=h[m])[0],d)!==-1){y.push(d);return}}),{type:"MultiPolygon",value:c,coordinates:h}}function a(u,c,f){var h=new Array,p=new Array,d,m,g,y,b,v;for(d=m=-1,y=or(u[0],c),rn[y<<1].forEach(x);++d<t-1;)g=y,y=or(u[d+1],c),rn[g|y<<1].forEach(x);for(rn[y<<0].forEach(x);++m<e-1;){for(d=-1,y=or(u[m*t+t],c),b=or(u[m*t],c),rn[y<<1|b<<2].forEach(x);++d<t-1;)g=y,y=or(u[m*t+t+d+1],c),v=b,b=or(u[m*t+d+1],c),rn[g|y<<1|b<<2|v<<3].forEach(x);rn[y|b<<3].forEach(x)}for(d=-1,b=u[m*t]>=c,rn[b<<2].forEach(x);++d<t-1;)v=b,b=or(u[m*t+d+1],c),rn[b<<2|v<<3].forEach(x);rn[b<<3].forEach(x);function x(_){var S=[_[0][0]+d,_[0][1]+m],A=[_[1][0]+d,_[1][1]+m],T=s(S),C=s(A),I,$;(I=p[T])?($=h[C])?(delete p[I.end],delete h[$.start],I===$?(I.ring.push(A),f(I.ring)):h[I.start]=p[$.end]={start:I.start,end:$.end,ring:I.ring.concat($.ring)}):(delete p[I.end],I.ring.push(A),p[I.end=C]=I):(I=h[C])?($=p[T])?(delete h[I.start],delete p[$.end],I===$?(I.ring.push(A),f(I.ring)):h[$.start]=p[I.end]={start:$.start,end:I.end,ring:$.ring.concat(I.ring)}):(delete h[I.start],I.ring.unshift(S),h[I.start=T]=I):h[T]=p[C]={start:T,end:C,ring:[S,A]}}}function s(u){return u[0]*2+u[1]*(t+1)*4}function l(u,c,f){u.forEach(function(h){var p=h[0],d=h[1],m=p|0,g=d|0,y=pf(c[g*t+m]);p>0&&p<t&&m===p&&(h[0]=sy(p,pf(c[g*t+m-1]),y,f)),d>0&&d<e&&g===d&&(h[1]=sy(d,pf(c[(g-1)*t+m]),y,f))})}return i.contour=o,i.size=function(u){if(!arguments.length)return[t,e];var c=Math.floor(u[0]),f=Math.floor(u[1]);if(!(c>=0&&f>=0))throw new Error("invalid size");return t=c,e=f,i},i.thresholds=function(u){return arguments.length?(n=typeof u=="function"?u:Array.isArray(u)?An(ay.call(u)):An(u),i):n},i.smooth=function(u){return arguments.length?(r=u?l:A6,i):r===l},i}function T6(t){return isFinite(t)?t:NaN}function or(t,e){return t==null?!1:+t>=e}function pf(t){return t==null||isNaN(t=+t)?-1/0:t}function sy(t,e,n,r){const i=r-e,o=n-e,a=isFinite(i)||isFinite(o)?i/o:Math.sign(i)/Math.sign(o);return isNaN(a)?t:t+a-.5}function P6(t){return t[0]}function D6(t){return t[1]}function M6(){return 1}function C6(){var t=P6,e=D6,n=M6,r=960,i=500,o=20,a=2,s=o*3,l=r+s*2>>a,u=i+s*2>>a,c=An(20);function f(b){var v=new Float32Array(l*u),x=Math.pow(2,-a),_=-1;for(const P of b){var S=(t(P,++_,b)+s)*x,A=(e(P,_,b)+s)*x,T=+n(P,_,b);if(T&&S>=0&&S<l&&A>=0&&A<u){var C=Math.floor(S),I=Math.floor(A),$=S-C-.5,L=A-I-.5;v[C+I*l]+=(1-$)*(1-L)*T,v[C+1+I*l]+=$*(1-L)*T,v[C+1+(I+1)*l]+=$*L*T,v[C+(I+1)*l]+=(1-$)*L*T}}return i0({data:v,width:l,height:u},o*x),v}function h(b){var v=f(b),x=c(v),_=Math.pow(2,2*a);return Array.isArray(x)||(x=Un(Number.MIN_VALUE,Hi(v)/_,x)),hf().size([l,u]).thresholds(x.map(S=>S*_))(v).map((S,A)=>(S.value=+x[A],p(S)))}h.contours=function(b){var v=f(b),x=hf().size([l,u]),_=Math.pow(2,2*a),S=A=>{A=+A;var T=p(x.contour(v,A*_));return T.value=A,T};return Object.defineProperty(S,"max",{get:()=>Hi(v)/_}),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,h}return h.x=function(b){return arguments.length?(t=typeof b=="function"?b:An(+b),h):t},h.y=function(b){return arguments.length?(e=typeof b=="function"?b:An(+b),h):e},h.weight=function(b){return arguments.length?(n=typeof b=="function"?b:An(+b),h):n},h.size=function(b){if(!arguments.length)return[r,i];var v=+b[0],x=+b[1];if(!(v>=0&&x>=0))throw new Error("invalid size");return r=v,i=x,y()},h.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()},h.thresholds=function(b){return arguments.length?(c=typeof b=="function"?b:Array.isArray(b)?An(ay.call(b)):An(b),h):c},h.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()},h}const on=11102230246251565e-32,Gt=134217729,L6=(3+8*on)*on;function df(t,e,n,r,i){let o,a,s,l,u=e[0],c=r[0],f=0,h=0;c>u==c>-u?(o=u,u=e[++f]):(o=c,c=r[++h]);let p=0;if(f<t&&h<n)for(c>u==c>-u?(a=u+o,s=o-(a-u),u=e[++f]):(a=c+o,s=o-(a-c),c=r[++h]),o=a,s!==0&&(i[p++]=s);f<t&&h<n;)c>u==c>-u?(a=o+u,l=a-o,s=o-(a-l)+(u-l),u=e[++f]):(a=o+c,l=a-o,s=o-(a-l)+(c-l),c=r[++h]),o=a,s!==0&&(i[p++]=s);for(;f<t;)a=o+u,l=a-o,s=o-(a-l)+(u-l),u=e[++f],o=a,s!==0&&(i[p++]=s);for(;h<n;)a=o+c,l=a-o,s=o-(a-l)+(c-l),c=r[++h],o=a,s!==0&&(i[p++]=s);return(o!==0||p===0)&&(i[p++]=o),p}function k6(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}function go(t){return new Float64Array(t)}const R6=(3+16*on)*on,E6=(2+12*on)*on,I6=(9+64*on)*on*on,ii=go(4),ly=go(8),uy=go(12),cy=go(16),Wt=go(4);function B6(t,e,n,r,i,o,a){let s,l,u,c,f,h,p,d,m,g,y,b,v,x,_,S,A,T;const C=t-i,I=n-i,$=e-o,L=r-o;x=C*L,h=Gt*C,p=h-(h-C),d=C-p,h=Gt*L,m=h-(h-L),g=L-m,_=d*g-(x-p*m-d*m-p*g),S=$*I,h=Gt*$,p=h-(h-$),d=$-p,h=Gt*I,m=h-(h-I),g=I-m,A=d*g-(S-p*m-d*m-p*g),y=_-A,f=_-y,ii[0]=_-(y+f)+(f-A),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,ii[1]=v-(y+f)+(f-S),T=b+y,f=T-b,ii[2]=b-(T-f)+(y-f),ii[3]=T;let P=k6(4,ii),w=E6*a;if(P>=w||-P>=w||(f=t-C,s=t-(C+f)+(f-i),f=n-I,u=n-(I+f)+(f-i),f=e-$,l=e-($+f)+(f-o),f=r-L,c=r-(L+f)+(f-o),s===0&&l===0&&u===0&&c===0)||(w=I6*a+L6*Math.abs(P),P+=C*c+L*s-($*u+I*l),P>=w||-P>=w))return P;x=s*L,h=Gt*s,p=h-(h-s),d=s-p,h=Gt*L,m=h-(h-L),g=L-m,_=d*g-(x-p*m-d*m-p*g),S=l*I,h=Gt*l,p=h-(h-l),d=l-p,h=Gt*I,m=h-(h-I),g=I-m,A=d*g-(S-p*m-d*m-p*g),y=_-A,f=_-y,Wt[0]=_-(y+f)+(f-A),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Wt[1]=v-(y+f)+(f-S),T=b+y,f=T-b,Wt[2]=b-(T-f)+(y-f),Wt[3]=T;const M=df(4,ii,4,Wt,ly);x=C*c,h=Gt*C,p=h-(h-C),d=C-p,h=Gt*c,m=h-(h-c),g=c-m,_=d*g-(x-p*m-d*m-p*g),S=$*u,h=Gt*$,p=h-(h-$),d=$-p,h=Gt*u,m=h-(h-u),g=u-m,A=d*g-(S-p*m-d*m-p*g),y=_-A,f=_-y,Wt[0]=_-(y+f)+(f-A),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Wt[1]=v-(y+f)+(f-S),T=b+y,f=T-b,Wt[2]=b-(T-f)+(y-f),Wt[3]=T;const D=df(M,ly,4,Wt,uy);x=s*c,h=Gt*s,p=h-(h-s),d=s-p,h=Gt*c,m=h-(h-c),g=c-m,_=d*g-(x-p*m-d*m-p*g),S=l*u,h=Gt*l,p=h-(h-l),d=l-p,h=Gt*u,m=h-(h-u),g=u-m,A=d*g-(S-p*m-d*m-p*g),y=_-A,f=_-y,Wt[0]=_-(y+f)+(f-A),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Wt[1]=v-(y+f)+(f-S),T=b+y,f=T-b,Wt[2]=b-(T-f)+(y-f),Wt[3]=T;const X=df(D,uy,4,Wt,cy);return cy[X-1]}function Ps(t,e,n,r,i,o){const a=(e-o)*(n-i),s=(t-i)*(r-o),l=a-s,u=Math.abs(a+s);return Math.abs(l)>=R6*u?l:-B6(t,e,n,r,i,o,u)}const fy=Math.pow(2,-52),Ds=new Uint32Array(512);class Ms{static from(e,n=G6,r=Y6){const i=e.length,o=new Float64Array(i*2);for(let a=0;a<i;a++){const s=e[a];o[2*a]=n(s),o[2*a+1]=r(s)}return new Ms(o)}constructor(e){const n=e.length>>1;if(n>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;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:e,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,a=e.length>>1;let s=1/0,l=1/0,u=-1/0,c=-1/0;for(let C=0;C<a;C++){const I=e[2*C],$=e[2*C+1];I<s&&(s=I),$<l&&(l=$),I>u&&(u=I),$>c&&(c=$),this._ids[C]=C}const f=(s+u)/2,h=(l+c)/2;let p,d,m;for(let C=0,I=1/0;C<a;C++){const $=gf(f,h,e[2*C],e[2*C+1]);$<I&&(p=C,I=$)}const g=e[2*p],y=e[2*p+1];for(let C=0,I=1/0;C<a;C++){if(C===p)continue;const $=gf(g,y,e[2*C],e[2*C+1]);$<I&&$>0&&(d=C,I=$)}let b=e[2*d],v=e[2*d+1],x=1/0;for(let C=0;C<a;C++){if(C===p||C===d)continue;const I=O6(g,y,b,v,e[2*C],e[2*C+1]);I<x&&(m=C,x=I)}let _=e[2*m],S=e[2*m+1];if(x===1/0){for(let $=0;$<a;$++)this._dists[$]=e[2*$]-e[0]||e[2*$+1]-e[1];oi(this._ids,this._dists,0,a-1);const C=new Uint32Array(a);let I=0;for(let $=0,L=-1/0;$<a;$++){const P=this._ids[$],w=this._dists[P];w>L&&(C[I++]=P,L=w)}this.hull=C.subarray(0,I),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Ps(g,y,b,v,_,S)<0){const C=d,I=b,$=v;d=m,b=_,v=S,m=C,_=I,S=$}const A=z6(g,y,b,v,_,S);this._cx=A.x,this._cy=A.y;for(let C=0;C<a;C++)this._dists[C]=gf(e[2*C],e[2*C+1],A.x,A.y);oi(this._ids,this._dists,0,a-1),this._hullStart=p;let T=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,v)]=d,o[this._hashKey(_,S)]=m,this.trianglesLen=0,this._addTriangle(p,d,m,-1,-1,-1);for(let C=0,I,$;C<this._ids.length;C++){const L=this._ids[C],P=e[2*L],w=e[2*L+1];if(C>0&&Math.abs(P-I)<=fy&&Math.abs(w-$)<=fy||(I=P,$=w,L===p||L===d||L===m))continue;let M=0;for(let N=0,R=this._hashKey(P,w);N<this._hashSize&&(M=o[(R+N)%this._hashSize],!(M!==-1&&M!==r[M]));N++);M=n[M];let D=M,X;for(;X=r[D],Ps(P,w,e[2*D],e[2*D+1],e[2*X],e[2*X+1])>=0;)if(D=X,D===M){D=-1;break}if(D===-1)continue;let O=this._addTriangle(D,L,r[D],-1,-1,i[D]);i[L]=this._legalize(O+2),i[D]=O,T++;let E=r[D];for(;X=r[E],Ps(P,w,e[2*E],e[2*E+1],e[2*X],e[2*X+1])<0;)O=this._addTriangle(E,L,X,i[L],-1,i[E]),i[L]=this._legalize(O+2),r[E]=E,T--,E=X;if(D===M)for(;X=n[D],Ps(P,w,e[2*X],e[2*X+1],e[2*D],e[2*D+1])<0;)O=this._addTriangle(X,L,D,-1,i[D],i[X]),this._legalize(O+2),i[X]=O,r[D]=D,T--,D=X;this._hullStart=n[L]=D,r[D]=n[E]=L,r[L]=E,o[this._hashKey(P,w)]=L,o[this._hashKey(e[2*D],e[2*D+1])]=D}this.hull=new Uint32Array(T);for(let C=0,I=this._hullStart;C<T;C++)this.hull[C]=I,I=r[I];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,n){return Math.floor(N6(e-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:n,_halfedges:r,coords:i}=this;let o=0,a=0;for(;;){const s=r[e],l=e-e%3;if(a=l+(e+2)%3,s===-1){if(o===0)break;e=Ds[--o];continue}const u=s-s%3,c=l+(e+1)%3,f=u+(s+2)%3,h=n[a],p=n[e],d=n[c],m=n[f];if(F6(i[2*h],i[2*h+1],i[2*p],i[2*p+1],i[2*d],i[2*d+1],i[2*m],i[2*m+1])){n[e]=m,n[s]=h;const y=r[f];if(y===-1){let v=this._hullStart;do{if(this._hullTri[v]===f){this._hullTri[v]=e;break}v=this._hullPrev[v]}while(v!==this._hullStart)}this._link(e,y),this._link(s,r[a]),this._link(a,f);const b=u+(s+1)%3;o<Ds.length&&(Ds[o++]=b)}else{if(o===0)break;e=Ds[--o]}}return a}_link(e,n){this._halfedges[e]=n,n!==-1&&(this._halfedges[n]=e)}_addTriangle(e,n,r,i,o,a){const s=this.trianglesLen;return this._triangles[s]=e,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 N6(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}function gf(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}function F6(t,e,n,r,i,o,a,s){const l=t-a,u=e-s,c=n-a,f=r-s,h=i-a,p=o-s,d=l*l+u*u,m=c*c+f*f,g=h*h+p*p;return l*(f*g-m*p)-u*(c*g-m*h)+d*(c*p-f*h)<0}function O6(t,e,n,r,i,o){const a=n-t,s=r-e,l=i-t,u=o-e,c=a*a+s*s,f=l*l+u*u,h=.5/(a*u-s*l),p=(u*c-s*f)*h,d=(a*f-l*c)*h;return p*p+d*d}function z6(t,e,n,r,i,o){const a=n-t,s=r-e,l=i-t,u=o-e,c=a*a+s*s,f=l*l+u*u,h=.5/(a*u-s*l),p=t+(u*c-s*f)*h,d=e+(a*f-l*c)*h;return{x:p,y:d}}function oi(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const o=t[i],a=e[o];let s=i-1;for(;s>=n&&e[t[s]]>a;)t[s+1]=t[s--];t[s+1]=o}else{const i=n+r>>1;let o=n+1,a=r;mo(t,i,o),e[t[n]]>e[t[r]]&&mo(t,n,r),e[t[o]]>e[t[r]]&&mo(t,o,r),e[t[n]]>e[t[o]]&&mo(t,n,o);const s=t[o],l=e[s];for(;;){do o++;while(e[t[o]]<l);do a--;while(e[t[a]]>l);if(a<o)break;mo(t,o,a)}t[n+1]=t[a],t[a]=s,r-o+1>=a-n?(oi(t,e,o,r),oi(t,e,n,a-1)):(oi(t,e,n,a-1),oi(t,e,o,r))}}function mo(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function G6(t){return t[0]}function Y6(t){return t[1]}const hy=1e-6;class ar{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,n){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,n){this._+=`L${this._x1=+e},${this._y1=+n}`}arc(e,n,r){e=+e,n=+n,r=+r;const i=e+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>hy||Math.abs(this._y1-o)>hy)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${e-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(e,n,r,i){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class mf{constructor(){this._=[]}moveTo(e,n){this._.push([e,n])}closePath(){this._.push(this._[0].slice())}lineTo(e,n){this._.push([e,n])}value(){return this._.length?this._:null}}class py{constructor(e,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.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:e,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,v;m<y;m+=3,g+=2){const x=r[m]*2,_=r[m+1]*2,S=r[m+2]*2,A=e[x],T=e[x+1],C=e[_],I=e[_+1],$=e[S],L=e[S+1],P=C-A,w=I-T,M=$-A,D=L-T,X=(P*D-w*M)*2;if(Math.abs(X)<1e-9){if(o===void 0){o=a=0;for(const E of n)o+=e[E*2],a+=e[E*2+1];o/=n.length,a/=n.length}const O=1e9*Math.sign((o-A)*D-(a-T)*M);b=(A+$)/2-O*D,v=(T+L)/2+O*M}else{const O=1/X,E=P*P+w*w,N=M*M+D*D;b=A+(D*E-w*N)*O,v=T+(P*N-M*E)*O}s[g]=b,s[g+1]=v}let l=n[n.length-1],u,c=l*4,f,h=e[2*l],p,d=e[2*l+1];i.fill(0);for(let m=0;m<n.length;++m)l=n[m],u=c,f=h,p=d,c=l*4,h=e[2*l],d=e[2*l+1],i[u+2]=i[c]=p-d,i[u+3]=i[c+1]=h-f}render(e){const n=e==null?e=new ar:void 0,{delaunay:{halfedges:r,inedges:i,hull:o},circumcenters:a,vectors:s}=this;if(o.length<=1)return null;for(let c=0,f=r.length;c<f;++c){const h=r[c];if(h<c)continue;const p=Math.floor(c/3)*2,d=Math.floor(h/3)*2,m=a[p],g=a[p+1],y=a[d],b=a[d+1];this._renderSegment(m,g,y,b,e)}let l,u=o[o.length-1];for(let c=0;c<o.length;++c){l=u,u=o[c];const f=Math.floor(i[u]/3)*2,h=a[f],p=a[f+1],d=l*4,m=this._project(h,p,s[d+2],s[d+3]);m&&this._renderSegment(h,p,m[0],m[1],e)}return n&&n.value()}renderBounds(e){const n=e==null?e=new ar:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(e,n){const r=n==null?n=new ar:void 0,i=this._clip(e);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:e}}=this;for(let n=0,r=e.length/2;n<r;++n){const i=this.cellPolygon(n);i&&(i.index=n,yield i)}}cellPolygon(e){const n=new mf;return this.renderCell(e,n),n.value()}_renderSegment(e,n,r,i,o){let a;const s=this._regioncode(e,n),l=this._regioncode(r,i);s===0&&l===0?(o.moveTo(e,n),o.lineTo(r,i)):(a=this._clipSegment(e,n,r,i,s,l))&&(o.moveTo(a[0],a[1]),o.lineTo(a[2],a[3]))}contains(e,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(e,n,r)===e}*neighbors(e){const n=this._clip(e);if(n)for(const r of this.delaunay.neighbors(e)){const i=this._clip(r);if(i){t: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 t}}}}_cell(e){const{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:o}}=this,a=r[e];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]!==e)break;l=i[l]}while(l!==a&&l!==-1);return s}_clip(e){if(e===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(e);if(n===null)return null;const{vectors:r}=this,i=e*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(e,n,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(e,n))}_clipFinite(e,n){const r=n.length;let i=null,o,a,s=n[r-2],l=n[r-1],u,c=this._regioncode(s,l),f,h=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)f=h,h=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,f=h,h=this._edgecode(m,g),f&&h&&this._edge(e,f,h,i,i.length),i?i.push(m,g):i=[m,g]}f=h,h=this._edgecode(y,b),f&&h&&this._edge(e,f,h,i,i.length),i?i.push(y,b):i=[y,b]}if(i)f=h,h=this._edgecode(i[0],i[1]),f&&h&&this._edge(e,f,h,i,i.length);else if(this.contains(e,(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(e,n,r,i,o,a){const s=o<a;for(s&&([e,n,r,i,o,a]=[r,i,e,n,a,o]);;){if(o===0&&a===0)return s?[r,i,e,n]:[e,n,r,i];if(o&a)return null;let l,u,c=o||a;c&8?(l=e+(r-e)*(this.ymax-n)/(i-n),u=this.ymax):c&4?(l=e+(r-e)*(this.ymin-n)/(i-n),u=this.ymin):c&2?(u=n+(i-n)*(this.xmax-e)/(r-e),l=this.xmax):(u=n+(i-n)*(this.xmin-e)/(r-e),l=this.xmin),o?(e=l,n=u,o=this._regioncode(e,n)):(r=l,i=u,a=this._regioncode(r,i))}}_clipInfinite(e,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(e,s))for(let u=0,c=s.length,f,h=this._edgecode(s[c-2],s[c-1]);u<c;u+=2)f=h,h=this._edgecode(s[u],s[u+1]),f&&h&&(u=this._edge(e,f,h,s,u),c=s.length);else this.contains(e,(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(e,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(e,a,s)&&(i.splice(o,0,a,s),o+=2)}return o}_project(e,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=e+(o=a)*r)}else if(i>0){if(n>=this.ymax)return null;(a=(this.ymax-n)/i)<o&&(l=this.ymax,s=e+(o=a)*r)}if(r>0){if(e>=this.xmax)return null;(a=(this.xmax-e)/r)<o&&(s=this.xmax,l=n+(o=a)*i)}else if(r<0){if(e<=this.xmin)return null;(a=(this.xmin-e)/r)<o&&(s=this.xmin,l=n+(o=a)*i)}return[s,l]}_edgecode(e,n){return(e===this.xmin?1:e===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(e,n){return(e<this.xmin?1:e>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let n=0;n<e.length;n+=2){const r=(n+2)%e.length,i=(n+4)%e.length;(e[n]===e[r]&&e[r]===e[i]||e[n+1]===e[r+1]&&e[r+1]===e[i+1])&&(e.splice(r,2),n-=2)}e.length||(e=null)}return e}}const X6=2*Math.PI,ai=Math.pow;function V6(t){return t[0]}function W6(t){return t[1]}function U6(t){const{triangles:e,coords:n}=t;for(let r=0;r<e.length;r+=3){const i=2*e[r],o=2*e[r+1],a=2*e[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 H6(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class yf{static from(e,n=V6,r=W6,i){return new yf("length"in e?j6(e,n,r,i):Float64Array.from(q6(e,n,r,i)))}constructor(e){this._delaunator=new Ms(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,n=this.points;if(e.hull&&e.hull.length>2&&U6(e)){this.collinear=Int32Array.from({length:n.length/2},(h,p)=>p).sort((h,p)=>n[2*h]-n[2*p]||n[2*h+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]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let h=0,p=n.length/2;h<p;++h){const d=H6(n[2*h],n[2*h+1],f);n[2*h]=d[0],n[2*h+1]=d[1]}this._delaunator=new Ms(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(e){return new py(this,e)}*neighbors(e){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:a,collinear:s}=this;if(s){const f=s.indexOf(e);f>0&&(yield s[f-1]),f<s.length-1&&(yield s[f+1]);return}const l=n[e];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]!==e)return;if(u=o[u],u===-1){const f=r[(i[e]+1)%r.length];f!==c&&(yield f);return}}while(u!==l)}find(e,n,r=0){if(e=+e,e!==e||(n=+n,n!==n))return-1;const i=r;let o;for(;(o=this._step(r,e,n))>=0&&o!==r&&o!==i;)r=o;return o}_step(e,n,r){const{inedges:i,hull:o,_hullIndex:a,halfedges:s,triangles:l,points:u}=this;if(i[e]===-1||!u.length)return(e+1)%(u.length>>1);let c=e,f=ai(n-u[e*2],2)+ai(r-u[e*2+1],2);const h=i[e];let p=h;do{let d=l[p];const m=ai(n-u[d*2],2)+ai(r-u[d*2+1],2);if(m<f&&(f=m,c=d),p=p%3===2?p-2:p+1,l[p]!==e)break;if(p=s[p],p===-1){if(p=o[(a[e]+1)%o.length],p!==d&&ai(n-u[p*2],2)+ai(r-u[p*2+1],2)<f)return p;break}}while(p!==h);return c}render(e){const n=e==null?e=new ar: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;e.moveTo(r[u],r[u+1]),e.lineTo(r[c],r[c+1])}return this.renderHull(e),n&&n.value()}renderPoints(e,n){n===void 0&&(!e||typeof e.moveTo!="function")&&(n=e,e=null),n=n==null?2:+n;const r=e==null?e=new ar:void 0,{points:i}=this;for(let o=0,a=i.length;o<a;o+=2){const s=i[o],l=i[o+1];e.moveTo(s+n,l),e.arc(s,l,n,0,X6)}return r&&r.value()}renderHull(e){const n=e==null?e=new ar:void 0,{hull:r,points:i}=this,o=r[0]*2,a=r.length;e.moveTo(i[o],i[o+1]);for(let s=1;s<a;++s){const l=2*r[s];e.lineTo(i[l],i[l+1])}return e.closePath(),n&&n.value()}hullPolygon(){const e=new mf;return this.renderHull(e),e.value()}renderTriangle(e,n){const r=n==null?n=new ar:void 0,{points:i,triangles:o}=this,a=o[e*=3]*2,s=o[e+1]*2,l=o[e+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:e}=this;for(let n=0,r=e.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(e){const n=new mf;return this.renderTriangle(e,n),n.value()}}function j6(t,e,n,r){const i=t.length,o=new Float64Array(i*2);for(let a=0;a<i;++a){const s=t[a];o[a*2]=e.call(r,s,a,t),o[a*2+1]=n.call(r,s,a,t)}return o}function*q6(t,e,n,r){let i=0;for(const o of t)yield e.call(r,o,i,t),yield n.call(r,o,i,t),++i}var dy={},bf={},xf=34,yo=10,vf=13;function gy(t){return new Function("d","return {"+t.map(function(e,n){return JSON.stringify(e)+": d["+n+'] || ""'}).join(",")+"}")}function Z6(t,e){var n=gy(t);return function(r,i){return e(n(r),i,t)}}function my(t){var e=Object.create(null),n=[];return t.forEach(function(r){for(var i in r)i in e||n.push(e[i]=i)}),n}function oe(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function K6(t){return t<0?"-"+oe(-t,6):t>9999?"+"+oe(t,6):oe(t,4)}function Q6(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":K6(t.getUTCFullYear())+"-"+oe(t.getUTCMonth()+1,2)+"-"+oe(t.getUTCDate(),2)+(i?"T"+oe(e,2)+":"+oe(n,2)+":"+oe(r,2)+"."+oe(i,3)+"Z":r?"T"+oe(e,2)+":"+oe(n,2)+":"+oe(r,2)+"Z":n||e?"T"+oe(e,2)+":"+oe(n,2)+"Z":"")}function Cs(t){var e=new RegExp('["'+t+`
43
- \r]`),n=t.charCodeAt(0);function r(f,h){var p,d,m=i(f,function(g,y){if(p)return p(g,y-1);d=g,p=h?Z6(g,h):gy(g)});return m.columns=d||[],m}function i(f,h){var p=[],d=f.length,m=0,g=0,y,b=d<=0,v=!1;f.charCodeAt(d-1)===yo&&--d,f.charCodeAt(d-1)===vf&&--d;function x(){if(b)return bf;if(v)return v=!1,dy;var S,A=m,T;if(f.charCodeAt(A)===xf){for(;m++<d&&f.charCodeAt(m)!==xf||f.charCodeAt(++m)===xf;);return(S=m)>=d?b=!0:(T=f.charCodeAt(m++))===yo?v=!0:T===vf&&(v=!0,f.charCodeAt(m)===yo&&++m),f.slice(A+1,S-1).replace(/""/g,'"')}for(;m<d;){if((T=f.charCodeAt(S=m++))===yo)v=!0;else if(T===vf)v=!0,f.charCodeAt(m)===yo&&++m;else if(T!==n)continue;return f.slice(A,S)}return b=!0,f.slice(A,d)}for(;(y=x())!==bf;){for(var _=[];y!==dy&&y!==bf;)_.push(y),y=x();h&&(_=h(_,g++))==null||p.push(_)}return p}function o(f,h){return f.map(function(p){return h.map(function(d){return c(p[d])}).join(t)})}function a(f,h){return h==null&&(h=my(f)),[h.map(c).join(t)].concat(o(f,h)).join(`
44
- `)}function s(f,h){return h==null&&(h=my(f)),o(f,h).join(`
42
+ ----> find in '${n}'`}function nD({chartType:e,config:t,initFn:n}){const r=new Xr,i=new WeakMap;let o=()=>{},a;const s=new Wg(t.defaultParams),l=new Wg({}),u=s.pipe(dc(c=>l.pipe(u0(r),Vr(f=>{try{const{status:h,columnName:p,expectToBe:d}=t.validator(f,{validateColumns:oS});if(h==="error")throw new Error(eD({columnName:p,expectToBe:d,from:`${t.name}.params$`}));h==="warning"&&console.warn(tD({columnName:p,expectToBe:d,from:`${t.name}.params$`}))}catch(h){console.error(JP(h))}return Fu(f,c)}))),KP(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(Fu(c,t.defaultParams))},setContext:c=>{a=c,a.observer.fullParams$=u}}}const Ur=e=>function(t){return function(n){return class{constructor(){const r=nD({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}}}},Sn=Ur("series"),st=Ur("grid"),dt=Ur("multiGrid"),Hn=Ur("multiValue"),ja=Ur("relationship"),gc=Ur("tree");function Se(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function g0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function qa(e){let t,n,r;e.length!==2?(t=Se,n=(s,l)=>Se(e(s),l),r=(s,l)=>e(s)-l):(t=e===Se||e===g0?e:rD,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 f=u+c>>>1;n(s[f],l)<0?u=f+1:c=f}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 f=u+c>>>1;n(s[f],l)<=0?u=f+1:c=f}while(u<c)}return u}function a(s,l,u=0,c=s.length){const f=i(s,l,u,c-1);return f>u&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:a,right:o}}function rD(){return 0}function Za(e){return e===null?NaN:+e}function*iD(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 m0=qa(Se),y0=m0.right,oD=m0.left,aD=qa(Za).center,jn=y0;function sD(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=mc(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 b0=x0(mc),lD=x0(uD);function x0(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?(Hr(s,u,i,o,a),Hr(s,i,u,o,a),Hr(s,u,i,o,a),jr(l,i,u,o,a),jr(l,u,i,o,a),jr(l,i,u,o,a)):s?(Hr(s,i,u,o,a),Hr(s,u,i,o,a),Hr(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 Hr(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 uD(e){const t=mc(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 mc(e){const t=Math.floor(e);if(t===e)return cD(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,f=c+l;for(let h=a,p=a+c;h<p;h+=l)u+=o[Math.min(s,h)];for(let h=a,p=s;h<=p;h+=l)u+=o[Math.min(s,h+c)],i[h]=(u+n*(o[Math.max(a,h-f)]+o[Math.min(s,h+f)]))/r,u-=o[Math.max(a,h-c)]}}function cD(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 Ka(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 fD(e){return e.length|0}function hD(e){return!(e>0)}function pD(e){return typeof e!="object"||"length"in e?e:Array.from(e)}function dD(e){return t=>e(...t)}function gD(...e){const t=typeof e[e.length-1]=="function"&&dD(e.pop());e=e.map(pD);const n=e.map(fD),r=e.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(hD))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 mD(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 v0(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 $0(e,t){const n=v0(e,t);return n&&Math.sqrt(n)}function io(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 ke{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 yD(e,t){const n=new ke;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 ke;let r=-1;return Float64Array.from(e,t===void 0?i=>n.add(+i||0):i=>n.add(+t(i,++r,e)||0))}class oo extends Map{constructor(t,n=w0){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(yc(this,t))}has(t){return super.has(yc(this,t))}set(t,n){return super.set(_0(this,t),n)}delete(t){return super.delete(S0(this,t))}}class qn extends Set{constructor(t,n=w0){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(yc(this,t))}add(t){return super.add(_0(this,t))}delete(t){return super.delete(S0(this,t))}}function yc({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function _0({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function S0({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function w0(e){return e!==null&&typeof e=="object"?e.valueOf():e}function qr(e){return e}function T0(e,...t){return Zr(e,qr,qr,t)}function A0(e,...t){return Zr(e,Array.from,qr,t)}function P0(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 xD(e,...t){return P0(A0(e,...t),t)}function vD(e,t,...n){return P0(M0(e,t,...n),n)}function D0(e,t,...n){return Zr(e,qr,t,n)}function M0(e,t,...n){return Zr(e,Array.from,t,n)}function $D(e,...t){return Zr(e,qr,C0,t)}function _D(e,...t){return Zr(e,Array.from,C0,t)}function C0(e){if(e.length!==1)throw new Error("duplicate key");return e[0]}function Zr(e,t,n,r){return function i(o,a){if(a>=r.length)return n(o);const s=new oo,l=r[a++];let u=-1;for(const c of o){const f=l(c,++u,o),h=s.get(f);h?h.push(c):s.set(f,[c])}for(const[c,f]of s)s.set(c,i(f,a));return t(s)}(e,0)}function L0(e,t){return Array.from(t,n=>e[n])}function bc(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=Kr(a[i],a[o]);if(s)return s}})):(n=e.map(n),r.sort((i,o)=>Kr(n[i],n[o]))),L0(e,r)}return e.sort(xc(n))}function xc(e=Se){if(e===Se)return Kr;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 Kr(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function SD(e,t,n){return(t.length!==2?bc(D0(e,t,n),([r,i],[o,a])=>Se(i,a)||Se(r,o)):bc(T0(e,n),([r,i],[o,a])=>t(i,a)||Se(r,o))).map(([r])=>r)}var wD=Array.prototype,TD=wD.slice;function vc(e){return()=>e}const AD=Math.sqrt(50),PD=Math.sqrt(10),DD=Math.sqrt(2);function Qa(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>=AD?10:o>=PD?5:o>=DD?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?Qa(e,t,n*2):[s,l,u]}function Zn(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?Qa(t,e,n):Qa(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 Kn(e,t,n){return t=+t,e=+e,n=+n,Qa(e,t,n)[2]}function Ja(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Kn(t,e,n):Kn(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function $c(e,t,n){let r;for(;;){const i=Kn(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 _c(e){return Math.max(1,Math.ceil(Math.log(Ka(e))/Math.LN2)+1)}function k0(){var e=qr,t=io,n=_c;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),f=c[0],h=c[1],p=n(u,f,h);if(!Array.isArray(p)){const v=h,x=+p;if(t===io&&([f,h]=$c(f,h,x)),p=Zn(f,h,x),p[0]<=f&&(l=Kn(f,h,x)),p[p.length-1]>=h)if(v>=h&&t===io){const _=Kn(f,h,x);isFinite(_)&&(_>0?h=(Math.floor(h/_)+1)*_:_<0&&(h=(Math.ceil(h*-_)+1)/-_))}else p.pop()}for(var d=p.length,m=0,g=d;p[m]<=f;)++m;for(;p[g-1]>h;)--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]:f,b.x1=o<d?p[o]:h;if(isFinite(l)){if(l>0)for(o=0;o<a;++o)(s=u[o])!=null&&f<=s&&s<=h&&y[Math.min(d,Math.floor((s-f)/l))].push(i[o]);else if(l<0){for(o=0;o<a;++o)if((s=u[o])!=null&&f<=s&&s<=h){const v=Math.floor((f-s)*l);y[Math.min(d,v+(p[v]<=s))].push(i[o])}}}else for(o=0;o<a;++o)(s=u[o])!=null&&f<=s&&s<=h&&y[jn(p,s,0,d)].push(i[o]);return y}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:vc(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:vc([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:vc(Array.isArray(i)?TD.call(i):i),r):n},r}function ao(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 Sc(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 es(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 wc(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 ts(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?Kr:xc(i);r>n;){if(r-n>600){const l=r-n+1,u=t-n+1,c=Math.log(l),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),p=Math.max(n,Math.floor(t-u*f/l+h)),d=Math.min(r,Math.floor(t+(l-u)*f/l+h));ts(e,t,p,d,i)}const o=e[t];let a=n,s=r;for(so(e,n,t),i(e[r],o)>0&&so(e,n,r);a<s;){for(so(e,a,s),++a,--s;i(e[a],o)<0;)++a;for(;i(e[s],o)>0;)--s}i(e[n],o)===0?so(e,n,s):(++s,so(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function so(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function R0(e,t=Se){let n,r=!1;if(t.length===1){let i;for(const o of e){const a=t(o);(r?Se(a,i)>0:Se(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 lo(e,t,n){if(e=Float64Array.from(iD(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return es(e);if(t>=1)return ao(e);var r,i=(r-1)*t,o=Math.floor(i),a=ao(ts(e,o).subarray(0,o+1)),s=es(e.subarray(o+1));return a+(s-a)*(i-o)}}function E0(e,t,n=Za){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 I0(e,t,n=Za){if(!isNaN(t=+t)){if(r=Float64Array.from(e,(s,l)=>Za(n(e[l],l,e))),t<=0)return wc(r);if(t>=1)return Sc(r);var r,i=Uint32Array.from(e,(s,l)=>l),o=r.length-1,a=Math.floor(o*t);return ts(i,a,0,o,(s,l)=>Kr(r[s],r[l])),a=R0(i.subarray(0,a+1),s=>r[s]),a>=0?a:-1}}function MD(e,t,n){const r=Ka(e),i=lo(e,.75)-lo(e,.25);return r&&i?Math.ceil((n-t)/(2*i*Math.pow(r,-1/3))):1}function CD(e,t,n){const r=Ka(e),i=$0(e);return r&&i?Math.ceil((n-t)*Math.cbrt(r)/(3.49*i)):1}function LD(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 kD(e,t){return lo(e,.5,t)}function RD(e,t){return I0(e,.5,t)}function*ED(e){for(const t of e)yield*t}function Tc(e){return Array.from(ED(e))}function ID(e,t){const n=new oo;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 BD(e,t=ND){const n=[];let r,i=!1;for(const o of e)i&&n.push(t(r,o)),r=o,i=!0;return n}function ND(e,t){return[e,t]}function wn(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 FD(e,t=Se){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=Se);const i=(s,l)=>t(n[s],n[l]);let o,a;return e=Uint32Array.from(n,(s,l)=>l),e.sort(t===Se?(s,l)=>Kr(n[s],n[l]):xc(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 zD(e,t=Se){let n,r=!1;if(t.length===1){let i;for(const o of e){const a=t(o);(r?Se(a,i)<0:Se(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 B0(e,t=Se){if(t.length===1)return wc(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 OD(e,t=Se){if(t.length===1)return Sc(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 GD(e,t){const n=B0(e,t);return n<0?void 0:n}const YD=N0(Math.random);function N0(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 Ac(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 F0(e){if(!(o=e.length))return[];for(var t=-1,n=es(e,WD),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 WD(e){return e.length}function XD(){return F0(arguments)}function VD(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 UD(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 HD(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 jD(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 qD(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 ZD(e){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(e).reverse()}function KD(e,...t){e=new qn(e);for(const n of t)for(const r of n)e.delete(r);return e}function QD(e,t){const n=t[Symbol.iterator](),r=new qn;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 JD(e,...t){e=new qn(e),t=t.map(eM);e:for(const n of e)for(const r of t)if(!r.has(n)){e.delete(n);continue e}return e}function eM(e){return e instanceof qn?e:new qn(e)}function z0(e,t){const n=e[Symbol.iterator](),r=new Set;for(const i of t){const o=O0(i);if(r.has(o))continue;let a,s;for(;{value:a,done:s}=n.next();){if(s)return!1;const l=O0(a);if(r.add(l),Object.is(o,l))break}}return!0}function O0(e){return e!==null&&typeof e=="object"?e.valueOf():e}function tM(e,t){return z0(t,e)}function nM(...e){const t=new qn;for(const n of e)for(const r of n)t.add(r);return t}function rM(e){return e}var ns=1,rs=2,Pc=3,uo=4,G0=1e-6;function iM(e){return"translate("+e+",0)"}function oM(e){return"translate(0,"+e+")"}function aM(e){return t=>+e(t)}function sM(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function lM(){return!this.__axis}function is(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===ns||e===uo?-1:1,c=e===uo||e===rs?"x":"y",f=e===ns||e===Pc?iM:oM;function h(p){var d=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):rM),g=Math.max(o,0)+s,y=t.range(),b=+y[0]+l,v=+y[y.length-1]+l,x=(t.bandwidth?sM:aM)(t.copy(),l),_=p.selection?p.selection():p,A=_.selectAll(".domain").data([null]),S=_.selectAll(".tick").data(d,t).order(),P=S.exit(),M=S.enter().append("g").attr("class","tick"),B=S.select("line"),$=S.select("text");A=A.merge(A.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),S=S.merge(M),B=B.merge(M.append("line").attr("stroke","currentColor").attr(c+"2",u*o)),$=$.merge(M.append("text").attr("fill","currentColor").attr(c,u*g).attr("dy",e===ns?"0em":e===Pc?"0.71em":"0.32em")),p!==_&&(A=A.transition(p),S=S.transition(p),B=B.transition(p),$=$.transition(p),P=P.transition(p).attr("opacity",G0).attr("transform",function(k){return isFinite(k=x(k))?f(k+l):this.getAttribute("transform")}),M.attr("opacity",G0).attr("transform",function(k){var C=this.parentNode.__axis;return f((C&&isFinite(C=C(k))?C:x(k))+l)})),P.remove(),A.attr("d",e===uo||e===rs?a?"M"+u*a+","+b+"H"+l+"V"+v+"H"+u*a:"M"+l+","+b+"V"+v:a?"M"+b+","+u*a+"V"+l+"H"+v+"V"+u*a:"M"+b+","+l+"H"+v),S.attr("opacity",1).attr("transform",function(k){return f(x(k)+l)}),B.attr(c+"2",u*o),$.attr(c,u*g).text(m),_.filter(lM).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===rs?"start":e===uo?"end":"middle"),_.each(function(){this.__axis=x})}return h.scale=function(p){return arguments.length?(t=p,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),h):n.slice()},h.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),h):r&&r.slice()},h.tickFormat=function(p){return arguments.length?(i=p,h):i},h.tickSize=function(p){return arguments.length?(o=a=+p,h):o},h.tickSizeInner=function(p){return arguments.length?(o=+p,h):o},h.tickSizeOuter=function(p){return arguments.length?(a=+p,h):a},h.tickPadding=function(p){return arguments.length?(s=+p,h):s},h.offset=function(p){return arguments.length?(l=+p,h):l},h}function uM(e){return is(ns,e)}function cM(e){return is(rs,e)}function Dc(e){return is(Pc,e)}function Mc(e){return is(uo,e)}var fM={value:()=>{}};function Qn(){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 os(n)}function os(e){this._=e}function hM(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}})}os.prototype=Qn.prototype={constructor:os,on:function(e,t){var n=this._,r=hM(e+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(e=r[o]).type)&&(i=pM(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]=Y0(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Y0(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 os(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 pM(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Y0(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=fM,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Cc="http://www.w3.org/1999/xhtml";const Lc={svg:"http://www.w3.org/2000/svg",xhtml:Cc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function co(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Lc.hasOwnProperty(t)?{space:Lc[t],local:e}:e}function dM(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Cc&&t.documentElement.namespaceURI===Cc?t.createElement(e):t.createElementNS(n,e)}}function gM(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function as(e){var t=co(e);return(t.local?gM:dM)(t)}function mM(){}function ss(e){return e==null?mM:function(){return this.querySelector(e)}}function yM(e){typeof e!="function"&&(e=ss(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 He(r,this._parents)}function W0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function bM(){return[]}function kc(e){return e==null?bM:function(){return this.querySelectorAll(e)}}function xM(e){return function(){return W0(e.apply(this,arguments))}}function vM(e){typeof e=="function"?e=xM(e):e=kc(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 He(r,i)}function Rc(e){return function(){return this.matches(e)}}function X0(e){return function(t){return t.matches(e)}}var $M=Array.prototype.find;function _M(e){return function(){return $M.call(this.children,e)}}function SM(){return this.firstElementChild}function wM(e){return this.select(e==null?SM:_M(typeof e=="function"?e:X0(e)))}var TM=Array.prototype.filter;function AM(){return Array.from(this.children)}function PM(e){return function(){return TM.call(this.children,e)}}function DM(e){return this.selectAll(e==null?AM:PM(typeof e=="function"?e:X0(e)))}function MM(e){typeof e!="function"&&(e=Rc(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 He(r,this._parents)}function V0(e){return new Array(e.length)}function CM(){return new He(this._enter||this._groups.map(V0),this._parents)}function ls(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ls.prototype={constructor:ls,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 LM(e){return function(){return e}}function kM(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 ls(e,o[a]);for(;a<l;++a)(s=t[a])&&(i[a]=s)}function RM(e,t,n,r,i,o,a){var s,l,u=new Map,c=t.length,f=o.length,h=new Array(c),p;for(s=0;s<c;++s)(l=t[s])&&(h[s]=p=a.call(l,l.__data__,s,t)+"",u.has(p)?i[s]=l:u.set(p,l));for(s=0;s<f;++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 ls(e,o[s]);for(s=0;s<c;++s)(l=t[s])&&u.get(h[s])===l&&(i[s]=l)}function EM(e){return e.__data__}function IM(e,t){if(!arguments.length)return Array.from(this,EM);var n=t?RM:kM,r=this._parents,i=this._groups;typeof e!="function"&&(e=LM(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],f=i[u],h=f.length,p=BM(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(h);n(c,f,m,g,y,p,t);for(var b=0,v=0,x,_;b<d;++b)if(x=m[b]){for(b>=v&&(v=b+1);!(_=g[v])&&++v<d;);x._next=_||null}}return a=new He(a,r),a._enter=s,a._exit=l,a}function BM(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function NM(){return new He(this._exit||this._groups.map(V0),this._parents)}function FM(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 zM(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],f=u.length,h=s[l]=new Array(f),p,d=0;d<f;++d)(p=u[d]||c[d])&&(h[d]=p);for(;l<i;++l)s[l]=n[l];return new He(s,this._parents)}function OM(){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 GM(e){e||(e=YM);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,l=i[o]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(t)}return new He(i,this._parents).order()}function YM(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function WM(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function XM(){return Array.from(this)}function VM(){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 UM(){let e=0;for(const t of this)++e;return e}function HM(){return!this.node()}function jM(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 qM(e){return function(){this.removeAttribute(e)}}function ZM(e){return function(){this.removeAttributeNS(e.space,e.local)}}function KM(e,t){return function(){this.setAttribute(e,t)}}function QM(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function JM(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function eC(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 tC(e,t){var n=co(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?ZM:qM:typeof t=="function"?n.local?eC:JM:n.local?QM:KM)(n,t))}function Ec(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function nC(e){return function(){this.style.removeProperty(e)}}function rC(e,t,n){return function(){this.style.setProperty(e,t,n)}}function iC(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function oC(e,t,n){return arguments.length>1?this.each((t==null?nC:typeof t=="function"?iC:rC)(e,t,n??"")):Jn(this.node(),e)}function Jn(e,t){return e.style.getPropertyValue(t)||Ec(e).getComputedStyle(e,null).getPropertyValue(t)}function aC(e){return function(){delete this[e]}}function sC(e,t){return function(){this[e]=t}}function lC(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function uC(e,t){return arguments.length>1?this.each((t==null?aC:typeof t=="function"?lC:sC)(e,t)):this.node()[e]}function U0(e){return e.trim().split(/^|\s+/)}function Ic(e){return e.classList||new H0(e)}function H0(e){this._node=e,this._names=U0(e.getAttribute("class")||"")}H0.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 j0(e,t){for(var n=Ic(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function q0(e,t){for(var n=Ic(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function cC(e){return function(){j0(this,e)}}function fC(e){return function(){q0(this,e)}}function hC(e,t){return function(){(t.apply(this,arguments)?j0:q0)(this,e)}}function pC(e,t){var n=U0(e+"");if(arguments.length<2){for(var r=Ic(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?hC:t?cC:fC)(n,t))}function dC(){this.textContent=""}function gC(e){return function(){this.textContent=e}}function mC(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function yC(e){return arguments.length?this.each(e==null?dC:(typeof e=="function"?mC:gC)(e)):this.node().textContent}function bC(){this.innerHTML=""}function xC(e){return function(){this.innerHTML=e}}function vC(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function $C(e){return arguments.length?this.each(e==null?bC:(typeof e=="function"?vC:xC)(e)):this.node().innerHTML}function _C(){this.nextSibling&&this.parentNode.appendChild(this)}function SC(){return this.each(_C)}function wC(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function TC(){return this.each(wC)}function AC(e){var t=typeof e=="function"?e:as(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function PC(){return null}function DC(e,t){var n=typeof e=="function"?e:as(e),r=t==null?PC:typeof t=="function"?t:ss(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function MC(){var e=this.parentNode;e&&e.removeChild(this)}function CC(){return this.each(MC)}function LC(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function kC(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function RC(e){return this.select(e?kC:LC)}function EC(e){return arguments.length?this.property("__data__",e):this.node().__data__}function IC(e){return function(t){e.call(this,t,this.__data__)}}function BC(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 NC(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 FC(e,t,n){return function(){var r=this.__on,i,o=IC(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 zC(e,t,n){var r=BC(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?FC:NC,i=0;i<o;++i)this.each(s(r[i],t,n));return this}function Z0(e,t,n){var r=Ec(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 OC(e,t){return function(){return Z0(this,e,t)}}function GC(e,t){return function(){return Z0(this,e,t.apply(this,arguments))}}function YC(e,t){return this.each((typeof t=="function"?GC:OC)(e,t))}function*WC(){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 Bc=[null];function He(e,t){this._groups=e,this._parents=t}function er(){return new He([[document.documentElement]],Bc)}function XC(){return this}He.prototype=er.prototype={constructor:He,select:yM,selectAll:vM,selectChild:wM,selectChildren:DM,filter:MM,data:IM,enter:CM,exit:NM,join:FM,merge:zM,selection:XC,order:OM,sort:GM,call:WM,nodes:XM,node:VM,size:UM,empty:HM,each:jM,attr:tC,style:oC,property:uC,classed:pC,text:yC,html:$C,raise:SC,lower:TC,append:AC,insert:DC,remove:CC,clone:RC,datum:EC,on:zC,dispatch:YC,[Symbol.iterator]:WC};function V(e){return typeof e=="string"?new He([[document.querySelector(e)]],[document.documentElement]):new He([[e]],Bc)}function VC(e){return V(as(e).call(document.documentElement))}var UC=0;function K0(){return new Nc}function Nc(){this._="@"+(++UC).toString(36)}Nc.prototype=K0.prototype={constructor:Nc,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 Q0(e){let t;for(;t=e.sourceEvent;)e=t;return e}function gt(e,t){if(e=Q0(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 HC(e,t){return e.target&&(e=Q0(e),t===void 0&&(t=e.currentTarget),e=e.touches||[e]),Array.from(e,n=>gt(n,t))}function jC(e){return typeof e=="string"?new He([document.querySelectorAll(e)],[document.documentElement]):new He([W0(e)],Bc)}const qC={passive:!1},fo={capture:!0,passive:!1};function Fc(e){e.stopImmediatePropagation()}function Qr(e){e.preventDefault(),e.stopImmediatePropagation()}function us(e){var t=e.document.documentElement,n=V(e).on("dragstart.drag",Qr,fo);"onselectstart"in t?n.on("selectstart.drag",Qr,fo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function cs(e,t){var n=e.document.documentElement,r=V(e).on("dragstart.drag",null);t&&(r.on("click.drag",Qr,fo),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 fs=e=>()=>e;function zc(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}})}zc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ZC(e){return!e.ctrlKey&&!e.button}function KC(){return this.parentNode}function QC(e,t){return t??{x:e.x,y:e.y}}function JC(){return navigator.maxTouchPoints||"ontouchstart"in this}function hs(){var e=ZC,t=KC,n=QC,r=JC,i={},o=Qn("start","drag","end"),a=0,s,l,u,c,f=0;function h(x){x.on("mousedown.drag",p).filter(r).on("touchstart.drag",g).on("touchmove.drag",y,qC).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(x,_){if(!(c||!e.call(this,x,_))){var A=v(this,t.call(this,x,_),x,_,"mouse");A&&(V(x.view).on("mousemove.drag",d,fo).on("mouseup.drag",m,fo),us(x.view),Fc(x),u=!1,s=x.clientX,l=x.clientY,A("start",x))}}function d(x){if(Qr(x),!u){var _=x.clientX-s,A=x.clientY-l;u=_*_+A*A>f}i.mouse("drag",x)}function m(x){V(x.view).on("mousemove.drag mouseup.drag",null),cs(x.view,u),Qr(x),i.mouse("end",x)}function g(x,_){if(e.call(this,x,_)){var A=x.changedTouches,S=t.call(this,x,_),P=A.length,M,B;for(M=0;M<P;++M)(B=v(this,S,x,_,A[M].identifier,A[M]))&&(Fc(x),B("start",x,A[M]))}}function y(x){var _=x.changedTouches,A=_.length,S,P;for(S=0;S<A;++S)(P=i[_[S].identifier])&&(Qr(x),P("drag",x,_[S]))}function b(x){var _=x.changedTouches,A=_.length,S,P;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),S=0;S<A;++S)(P=i[_[S].identifier])&&(Fc(x),P("end",x,_[S]))}function v(x,_,A,S,P,M){var B=o.copy(),$=gt(M||A,_),k,C,T;if((T=n.call(x,new zc("beforestart",{sourceEvent:A,target:h,identifier:P,active:a,x:$[0],y:$[1],dx:0,dy:0,dispatch:B}),S))!=null)return k=T.x-$[0]||0,C=T.y-$[1]||0,function w(D,F,z){var I=$,N;switch(D){case"start":i[P]=w,N=a++;break;case"end":delete i[P],--a;case"drag":$=gt(z||F,_),N=a;break}B.call(D,x,new zc(D,{sourceEvent:F,subject:T,target:h,identifier:P,active:N,x:$[0]+k,y:$[1]+C,dx:$[0]-I[0],dy:$[1]-I[1],dispatch:B}),S)}}return h.filter=function(x){return arguments.length?(e=typeof x=="function"?x:fs(!!x),h):e},h.container=function(x){return arguments.length?(t=typeof x=="function"?x:fs(x),h):t},h.subject=function(x){return arguments.length?(n=typeof x=="function"?x:fs(x),h):n},h.touchable=function(x){return arguments.length?(r=typeof x=="function"?x:fs(!!x),h):r},h.on=function(){var x=o.on.apply(o,arguments);return x===o?h:x},h.clickDistance=function(x){return arguments.length?(f=(x=+x)*x,h):Math.sqrt(f)},h}function Jr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ho(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Tn(){}var tr=.7,ei=1/tr,ti="\\s*([+-]?\\d+)\\s*",po="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Wt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",eL=/^#([0-9a-f]{3,8})$/,tL=new RegExp(`^rgb\\(${ti},${ti},${ti}\\)$`),nL=new RegExp(`^rgb\\(${Wt},${Wt},${Wt}\\)$`),rL=new RegExp(`^rgba\\(${ti},${ti},${ti},${po}\\)$`),iL=new RegExp(`^rgba\\(${Wt},${Wt},${Wt},${po}\\)$`),oL=new RegExp(`^hsl\\(${po},${Wt},${Wt}\\)$`),aL=new RegExp(`^hsla\\(${po},${Wt},${Wt},${po}\\)$`),J0={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};Jr(Tn,An,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:em,formatHex:em,formatHex8:sL,formatHsl:lL,formatRgb:tm,toString:tm});function em(){return this.rgb().formatHex()}function sL(){return this.rgb().formatHex8()}function lL(){return am(this).formatHsl()}function tm(){return this.rgb().formatRgb()}function An(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=eL.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?nm(t):n===3?new Ie(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ps(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ps(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=tL.exec(e))?new Ie(t[1],t[2],t[3],1):(t=nL.exec(e))?new Ie(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=rL.exec(e))?ps(t[1],t[2],t[3],t[4]):(t=iL.exec(e))?ps(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=oL.exec(e))?om(t[1],t[2]/100,t[3]/100,1):(t=aL.exec(e))?om(t[1],t[2]/100,t[3]/100,t[4]):J0.hasOwnProperty(e)?nm(J0[e]):e==="transparent"?new Ie(NaN,NaN,NaN,0):null}function nm(e){return new Ie(e>>16&255,e>>8&255,e&255,1)}function ps(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ie(e,t,n,r)}function Oc(e){return e instanceof Tn||(e=An(e)),e?(e=e.rgb(),new Ie(e.r,e.g,e.b,e.opacity)):new Ie}function ni(e,t,n,r){return arguments.length===1?Oc(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}Jr(Ie,ni,ho(Tn,{brighter(e){return e=e==null?ei:Math.pow(ei,e),new Ie(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?tr:Math.pow(tr,e),new Ie(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ie(nr(this.r),nr(this.g),nr(this.b),ds(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:rm,formatHex:rm,formatHex8:uL,formatRgb:im,toString:im}));function rm(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}`}function uL(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}${rr((isNaN(this.opacity)?1:this.opacity)*255)}`}function im(){const e=ds(this.opacity);return`${e===1?"rgb(":"rgba("}${nr(this.r)}, ${nr(this.g)}, ${nr(this.b)}${e===1?")":`, ${e})`}`}function ds(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rr(e){return e=nr(e),(e<16?"0":"")+e.toString(16)}function om(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new kt(e,t,n,r)}function am(e){if(e instanceof kt)return new kt(e.h,e.s,e.l,e.opacity);if(e instanceof Tn||(e=An(e)),!e)return new kt;if(e instanceof kt)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 kt(a,s,l,e.opacity)}function gs(e,t,n,r){return arguments.length===1?am(e):new kt(e,t,n,r??1)}function kt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Jr(kt,gs,ho(Tn,{brighter(e){return e=e==null?ei:Math.pow(ei,e),new kt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?tr:Math.pow(tr,e),new kt(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(Gc(e>=240?e-240:e+120,i,r),Gc(e,i,r),Gc(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new kt(sm(this.h),ms(this.s),ms(this.l),ds(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=ds(this.opacity);return`${e===1?"hsl(":"hsla("}${sm(this.h)}, ${ms(this.s)*100}%, ${ms(this.l)*100}%${e===1?")":`, ${e})`}`}}));function sm(e){return e=(e||0)%360,e<0?e+360:e}function ms(e){return Math.max(0,Math.min(1,e||0))}function Gc(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 lm=Math.PI/180,um=180/Math.PI,ys=18,cm=.96422,fm=1,hm=.82521,pm=4/29,ri=6/29,dm=3*ri*ri,cL=ri*ri*ri;function gm(e){if(e instanceof Rt)return new Rt(e.l,e.a,e.b,e.opacity);if(e instanceof Xt)return ym(e);e instanceof Ie||(e=Oc(e));var t=Vc(e.r),n=Vc(e.g),r=Vc(e.b),i=Yc((.2225045*t+.7168786*n+.0606169*r)/fm),o,a;return t===n&&n===r?o=a=i:(o=Yc((.4360747*t+.3850649*n+.1430804*r)/cm),a=Yc((.0139322*t+.0971045*n+.7141733*r)/hm)),new Rt(116*i-16,500*(o-i),200*(i-a),e.opacity)}function fL(e,t){return new Rt(e,0,0,t??1)}function bs(e,t,n,r){return arguments.length===1?gm(e):new Rt(e,t,n,r??1)}function Rt(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}Jr(Rt,bs,ho(Tn,{brighter(e){return new Rt(this.l+ys*(e??1),this.a,this.b,this.opacity)},darker(e){return new Rt(this.l-ys*(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=cm*Wc(t),e=fm*Wc(e),n=hm*Wc(n),new Ie(Xc(3.1338561*t-1.6168667*e-.4906146*n),Xc(-.9787684*t+1.9161415*e+.033454*n),Xc(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Yc(e){return e>cL?Math.pow(e,1/3):e/dm+pm}function Wc(e){return e>ri?e*e*e:dm*(e-pm)}function Xc(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Vc(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function mm(e){if(e instanceof Xt)return new Xt(e.h,e.c,e.l,e.opacity);if(e instanceof Rt||(e=gm(e)),e.a===0&&e.b===0)return new Xt(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*um;return new Xt(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function hL(e,t,n,r){return arguments.length===1?mm(e):new Xt(n,t,e,r??1)}function xs(e,t,n,r){return arguments.length===1?mm(e):new Xt(e,t,n,r??1)}function Xt(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function ym(e){if(isNaN(e.h))return new Rt(e.l,0,0,e.opacity);var t=e.h*lm;return new Rt(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Jr(Xt,xs,ho(Tn,{brighter(e){return new Xt(this.h,this.c,this.l+ys*(e??1),this.opacity)},darker(e){return new Xt(this.h,this.c,this.l-ys*(e??1),this.opacity)},rgb(){return ym(this).rgb()}}));var bm=-.14861,Uc=1.78277,Hc=-.29227,vs=-.90649,go=1.97294,xm=go*vs,vm=go*Uc,$m=Uc*Hc-vs*bm;function pL(e){if(e instanceof ir)return new ir(e.h,e.s,e.l,e.opacity);e instanceof Ie||(e=Oc(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=($m*r+xm*t-vm*n)/($m+xm-vm),o=r-i,a=(go*(n-i)-Hc*o)/vs,s=Math.sqrt(a*a+o*o)/(go*i*(1-i)),l=s?Math.atan2(a,o)*um-120:NaN;return new ir(l<0?l+360:l,s,i,e.opacity)}function Et(e,t,n,r){return arguments.length===1?pL(e):new ir(e,t,n,r??1)}function ir(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Jr(ir,Et,ho(Tn,{brighter(e){return e=e==null?ei:Math.pow(ei,e),new ir(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?tr:Math.pow(tr,e),new ir(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*lm,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*(bm*r+Uc*i)),255*(t+n*(Hc*r+vs*i)),255*(t+n*(go*r)),this.opacity)}}));function _m(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 Sm(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 _m((n-r/t)*t,a,i,o,s)}}function wm(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 _m((n-r/t)*t,i,o,a,s)}}const $s=e=>()=>e;function Tm(e,t){return function(n){return e+n*t}}function dL(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 _s(e,t){var n=t-e;return n?Tm(e,n>180||n<-180?n-360*Math.round(n/360):n):$s(isNaN(e)?t:e)}function gL(e){return(e=+e)==1?Be:function(t,n){return n-t?dL(t,n,e):$s(isNaN(t)?n:t)}}function Be(e,t){var n=t-e;return n?Tm(e,n):$s(isNaN(e)?t:e)}const mo=function e(t){var n=gL(t);function r(i,o){var a=n((i=ni(i)).r,(o=ni(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),u=Be(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 Am(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=ni(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 Pm=Am(Sm),mL=Am(wm);function jc(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 Dm(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function yL(e,t){return(Dm(t)?jc:Mm)(e,t)}function Mm(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]=nn(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 Cm(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function vt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Lm(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]=nn(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var qc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Zc=new RegExp(qc.source,"g");function bL(e){return function(){return e}}function xL(e){return function(t){return e(t)+""}}function Kc(e,t){var n=qc.lastIndex=Zc.lastIndex=0,r,i,o,a=-1,s=[],l=[];for(e=e+"",t=t+"";(r=qc.exec(e))&&(i=Zc.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:vt(r,i)})),n=Zc.lastIndex;return n<t.length&&(o=t.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?xL(l[0].x):bL(t):(t=l.length,function(u){for(var c=0,f;c<t;++c)s[(f=l[c]).i]=f.x(u);return s.join("")})}function nn(e,t){var n=typeof t,r;return t==null||n==="boolean"?$s(t):(n==="number"?vt:n==="string"?(r=An(t))?(t=r,mo):Kc:t instanceof An?mo:t instanceof Date?Cm:Dm(t)?jc:Array.isArray(t)?Mm:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Lm:vt)(e,t)}function vL(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function $L(e,t){var n=_s(+e,+t);return function(r){var i=n(r);return i-360*Math.floor(i/360)}}function Ss(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var km=180/Math.PI,Qc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Rm(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)*km,skewX:Math.atan(l)*km,scaleX:a,scaleY:s}}var ws;function _L(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Qc:Rm(t.a,t.b,t.c,t.d,t.e,t.f)}function SL(e){return e==null||(ws||(ws=document.createElementNS("http://www.w3.org/2000/svg","g")),ws.setAttribute("transform",e),!(e=ws.transform.baseVal.consolidate()))?Qc:(e=e.matrix,Rm(e.a,e.b,e.c,e.d,e.e,e.f))}function Em(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,c,f,h,p,d){if(u!==f||c!==h){var m=p.push("translate(",null,t,null,n);d.push({i:m-4,x:vt(u,f)},{i:m-2,x:vt(c,h)})}else(f||h)&&p.push("translate("+f+t+h+n)}function a(u,c,f,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:vt(u,c)})):c&&f.push(i(f)+"rotate("+c+r)}function s(u,c,f,h){u!==c?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:vt(u,c)}):c&&f.push(i(f)+"skewX("+c+r)}function l(u,c,f,h,p,d){if(u!==f||c!==h){var m=p.push(i(p)+"scale(",null,",",null,")");d.push({i:m-4,x:vt(u,f)},{i:m-2,x:vt(c,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(u,c){var f=[],h=[];return u=e(u),c=e(c),o(u.translateX,u.translateY,c.translateX,c.translateY,f,h),a(u.rotate,c.rotate,f,h),s(u.skewX,c.skewX,f,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,h),u=c=null,function(p){for(var d=-1,m=h.length,g;++d<m;)f[(g=h[d]).i]=g.x(p);return f.join("")}}}var Im=Em(_L,"px, ","px)","deg)"),Bm=Em(SL,", ",")",")"),wL=1e-12;function Nm(e){return((e=Math.exp(e))+1/e)/2}function TL(e){return((e=Math.exp(e))-1/e)/2}function AL(e){return((e=Math.exp(2*e))-1)/(e+1)}const Fm=function e(t,n,r){function i(o,a){var s=o[0],l=o[1],u=o[2],c=a[0],f=a[1],h=a[2],p=c-s,d=f-l,m=p*p+d*d,g,y;if(m<wL)y=Math.log(h/u)/t,g=function(S){return[s+S*p,l+S*d,u*Math.exp(t*S*y)]};else{var b=Math.sqrt(m),v=(h*h-u*u+r*m)/(2*u*n*b),x=(h*h-u*u-r*m)/(2*h*n*b),_=Math.log(Math.sqrt(v*v+1)-v),A=Math.log(Math.sqrt(x*x+1)-x);y=(A-_)/t,g=function(S){var P=S*y,M=Nm(_),B=u/(n*b)*(M*AL(t*P+_)-TL(_));return[s+B*p,l+B*d,u*M/Nm(t*P+_)]}}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 zm(e){return function(t,n){var r=e((t=gs(t)).h,(n=gs(n)).h),i=Be(t.s,n.s),o=Be(t.l,n.l),a=Be(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 PL=zm(_s);var DL=zm(Be);function ML(e,t){var n=Be((e=bs(e)).l,(t=bs(t)).l),r=Be(e.a,t.a),i=Be(e.b,t.b),o=Be(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 Om(e){return function(t,n){var r=e((t=xs(t)).h,(n=xs(n)).h),i=Be(t.c,n.c),o=Be(t.l,n.l),a=Be(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 CL=Om(_s);var LL=Om(Be);function Gm(e){return function t(n){n=+n;function r(i,o){var a=e((i=Et(i)).h,(o=Et(o)).h),s=Be(i.s,o.s),l=Be(i.l,o.l),u=Be(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 kL=Gm(_s);var Ts=Gm(Be);function Ym(e,t){t===void 0&&(t=e,e=nn);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 RL(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var ii=0,yo=0,bo=0,Wm=1e3,As,xo,Ps=0,or=0,Ds=0,vo=typeof performance=="object"&&performance.now?performance:Date,Xm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $o(){return or||(Xm(EL),or=vo.now()+Ds)}function EL(){or=0}function _o(){this._call=this._time=this._next=null}_o.prototype=Ms.prototype={constructor:_o,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?$o():+n)+(t==null?0:+t),!this._next&&xo!==this&&(xo?xo._next=this:As=this,xo=this),this._call=e,this._time=n,Jc()},stop:function(){this._call&&(this._call=null,this._time=1/0,Jc())}};function Ms(e,t,n){var r=new _o;return r.restart(e,t,n),r}function Vm(){$o(),++ii;for(var e=As,t;e;)(t=or-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ii}function Um(){or=(Ps=vo.now())+Ds,ii=yo=0;try{Vm()}finally{ii=0,BL(),or=0}}function IL(){var e=vo.now(),t=e-Ps;t>Wm&&(Ds-=t,Ps=e)}function BL(){for(var e,t=As,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:As=n);xo=e,Jc(r)}function Jc(e){if(!ii){yo&&(yo=clearTimeout(yo));var t=e-or;t>24?(e<1/0&&(yo=setTimeout(Um,e-vo.now()-Ds)),bo&&(bo=clearInterval(bo))):(bo||(Ps=vo.now(),bo=setInterval(IL,Wm)),ii=1,Xm(Um))}}function ef(e,t,n){var r=new _o;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}function NL(e,t,n){var r=new _o,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?$o():+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 FL=Qn("start","end","cancel","interrupt"),zL=[],Hm=0,tf=1,nf=2,Cs=3,jm=4,rf=5,Ls=6;function ks(e,t,n,r,i,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;OL(e,n,{name:t,index:r,group:i,on:FL,tween:zL,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Hm})}function of(e,t){var n=It(e,t);if(n.state>Hm)throw new Error("too late; already scheduled");return n}function Vt(e,t){var n=It(e,t);if(n.state>Cs)throw new Error("too late; already running");return n}function It(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function OL(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Ms(o,0,n.time);function o(u){n.state=tf,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,f,h,p;if(n.state!==tf)return l();for(c in r)if(p=r[c],p.name===n.name){if(p.state===Cs)return ef(a);p.state===jm?(p.state=Ls,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[c]):+c<t&&(p.state=Ls,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[c])}if(ef(function(){n.state===Cs&&(n.state=jm,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=nf,n.on.call("start",e,e.__data__,n.index,n.group),n.state===nf){for(n.state=Cs,i=new Array(h=n.tween.length),c=0,f=-1;c<h;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=rf,1),f=-1,h=i.length;++f<h;)i[f].call(e,c);n.state===rf&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Ls,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function ar(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>nf&&r.state<rf,r.state=Ls,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}o&&delete e.__transition}}function GL(e){return this.each(function(){ar(this,e)})}function YL(e,t){var n,r;return function(){var i=Vt(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 WL(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Vt(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 XL(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=It(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?YL:WL)(n,e,t))}function af(e,t,n){var r=e._id;return e.each(function(){var i=Vt(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return It(i,r).value[t]}}function qm(e,t){var n;return(typeof t=="number"?vt:t instanceof An?mo:(n=An(t))?(t=n,mo):Kc)(e,t)}function VL(e){return function(){this.removeAttribute(e)}}function UL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function HL(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 jL(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 qL(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 ZL(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 KL(e,t){var n=co(e),r=n==="transform"?Bm:qm;return this.attrTween(e,typeof t=="function"?(n.local?ZL:qL)(n,r,af(this,"attr."+e,t)):t==null?(n.local?UL:VL)(n):(n.local?jL:HL)(n,r,t))}function QL(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function JL(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function e3(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&JL(e,o)),n}return i._value=t,i}function t3(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&QL(e,o)),n}return i._value=t,i}function n3(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=co(e);return this.tween(n,(r.local?e3:t3)(r,t))}function r3(e,t){return function(){of(this,e).delay=+t.apply(this,arguments)}}function i3(e,t){return t=+t,function(){of(this,e).delay=t}}function o3(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?r3:i3)(t,e)):It(this.node(),t).delay}function a3(e,t){return function(){Vt(this,e).duration=+t.apply(this,arguments)}}function s3(e,t){return t=+t,function(){Vt(this,e).duration=t}}function l3(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?a3:s3)(t,e)):It(this.node(),t).duration}function u3(e,t){if(typeof t!="function")throw new Error;return function(){Vt(this,e).ease=t}}function c3(e){var t=this._id;return arguments.length?this.each(u3(t,e)):It(this.node(),t).ease}function f3(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Vt(this,e).ease=n}}function h3(e){if(typeof e!="function")throw new Error;return this.each(f3(this._id,e))}function p3(e){typeof e!="function"&&(e=Rc(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 Ut(r,this._parents,this._name,this._id)}function d3(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,f=a[s]=new Array(c),h,p=0;p<c;++p)(h=l[p]||u[p])&&(f[p]=h);for(;s<r;++s)a[s]=t[s];return new Ut(a,this._parents,this._name,this._id)}function g3(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 m3(e,t,n){var r,i,o=g3(t)?of:Vt;return function(){var a=o(this,e),s=a.on;s!==r&&(i=(r=s).copy()).on(t,n),a.on=i}}function y3(e,t){var n=this._id;return arguments.length<2?It(this.node(),n).on.on(e):this.each(m3(n,e,t))}function b3(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function x3(){return this.on("end.remove",b3(this._id))}function v3(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ss(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,f,h=0;h<l;++h)(c=s[h])&&(f=e.call(c,c.__data__,h,s))&&("__data__"in c&&(f.__data__=c.__data__),u[h]=f,ks(u[h],t,n,h,u,It(c,n)));return new Ut(o,this._parents,t,n)}function $3(e){var t=this._name,n=this._id;typeof e!="function"&&(e=kc(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,f=0;f<u;++f)if(c=l[f]){for(var h=e.call(c,c.__data__,f,l),p,d=It(c,n),m=0,g=h.length;m<g;++m)(p=h[m])&&ks(p,t,n,m,h,d);o.push(h),a.push(c)}return new Ut(o,a,t,n)}var _3=er.prototype.constructor;function S3(){return new _3(this._groups,this._parents)}function w3(e,t){var n,r,i;return function(){var o=Jn(this,e),a=(this.style.removeProperty(e),Jn(this,e));return o===a?null:o===n&&a===r?i:i=t(n=o,r=a)}}function Zm(e){return function(){this.style.removeProperty(e)}}function T3(e,t,n){var r,i=n+"",o;return function(){var a=Jn(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}function A3(e,t,n){var r,i,o;return function(){var a=Jn(this,e),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),Jn(this,e))),a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s))}}function P3(e,t){var n,r,i,o="style."+t,a="end."+o,s;return function(){var l=Vt(this,e),u=l.on,c=l.value[o]==null?s||(s=Zm(t)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(a,i=c),l.on=r}}function D3(e,t,n){var r=(e+="")=="transform"?Im:qm;return t==null?this.styleTween(e,w3(e,r)).on("end.style."+e,Zm(e)):typeof t=="function"?this.styleTween(e,A3(e,r,af(this,"style."+e,t))).each(P3(this._id,e)):this.styleTween(e,T3(e,r,t),n).on("end.style."+e,null)}function M3(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function C3(e,t,n){var r,i;function o(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&M3(e,a,n)),r}return o._value=t,o}function L3(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,C3(e,t,n??""))}function k3(e){return function(){this.textContent=e}}function R3(e){return function(){var t=e(this);this.textContent=t??""}}function E3(e){return this.tween("text",typeof e=="function"?R3(af(this,"text",e)):k3(e==null?"":e+""))}function I3(e){return function(t){this.textContent=e.call(this,t)}}function B3(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&I3(i)),t}return r._value=e,r}function N3(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,B3(e))}function F3(){for(var e=this._name,t=this._id,n=Qm(),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=It(l,t);ks(l,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Ut(r,this._parents,e,n)}function z3(){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=Vt(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 O3=0;function Ut(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Km(e){return er().transition(e)}function Qm(){return++O3}var rn=er.prototype;Ut.prototype=Km.prototype={constructor:Ut,select:v3,selectAll:$3,selectChild:rn.selectChild,selectChildren:rn.selectChildren,filter:p3,merge:d3,selection:S3,transition:F3,call:rn.call,nodes:rn.nodes,node:rn.node,size:rn.size,empty:rn.empty,each:rn.each,on:y3,attr:KL,attrTween:n3,style:D3,styleTween:L3,text:E3,textTween:N3,remove:x3,tween:XL,delay:o3,duration:l3,ease:c3,easeVarying:h3,end:z3,[Symbol.iterator]:rn[Symbol.iterator]};const G3=e=>+e;function Y3(e){return e*e}function W3(e){return e*(2-e)}function Jm(e){return((e*=2)<=1?e*e:--e*(2-e)+1)/2}function X3(e){return e*e*e}function V3(e){return--e*e*e+1}function So(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var sf=3,U3=function e(t){t=+t;function n(r){return Math.pow(r,t)}return n.exponent=e,n}(sf),H3=function e(t){t=+t;function n(r){return 1-Math.pow(1-r,t)}return n.exponent=e,n}(sf),ey=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}(sf),ty=Math.PI,ny=ty/2;function j3(e){return+e==1?1:1-Math.cos(e*ny)}function q3(e){return Math.sin(e*ny)}function ry(e){return(1-Math.cos(ty*e))/2}function Pn(e){return(Math.pow(2,-10*e)-.0009765625)*1.0009775171065494}function Z3(e){return Pn(1-+e)}function K3(e){return 1-Pn(e)}function iy(e){return((e*=2)<=1?Pn(1-e):2-Pn(e-1))/2}function Q3(e){return 1-Math.sqrt(1-e*e)}function J3(e){return Math.sqrt(1- --e*e)}function oy(e){return((e*=2)<=1?1-Math.sqrt(1-e*e):Math.sqrt(1-(e-=2)*e)+1)/2}var lf=4/11,e5=6/11,t5=8/11,n5=3/4,r5=9/11,i5=10/11,o5=15/16,a5=21/22,s5=63/64,Rs=1/lf/lf;function l5(e){return 1-wo(1-e)}function wo(e){return(e=+e)<lf?Rs*e*e:e<t5?Rs*(e-=e5)*e+n5:e<i5?Rs*(e-=r5)*e+o5:Rs*(e-=a5)*e+s5}function u5(e){return((e*=2)<=1?1-wo(1-e):wo(e-1)+1)/2}var uf=1.70158,c5=function e(t){t=+t;function n(r){return(r=+r)*r*(t*(r-1)+r)}return n.overshoot=e,n}(uf),f5=function e(t){t=+t;function n(r){return--r*r*((r+1)*t+r)+1}return n.overshoot=e,n}(uf),ay=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}(uf),oi=2*Math.PI,cf=1,ff=.3,h5=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=oi);function i(o){return t*Pn(- --o)*Math.sin((r-o)/n)}return i.amplitude=function(o){return e(o,n*oi)},i.period=function(o){return e(t,o)},i}(cf,ff),sr=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=oi);function i(o){return 1-t*Pn(o=+o)*Math.sin((o+r)/n)}return i.amplitude=function(o){return e(o,n*oi)},i.period=function(o){return e(t,o)},i}(cf,ff),p5=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=oi);function i(o){return((o=o*2-1)<0?t*Pn(-o)*Math.sin((r-o)/n):2-t*Pn(o)*Math.sin((r+o)/n))/2}return i.amplitude=function(o){return e(o,n*oi)},i.period=function(o){return e(t,o)},i}(cf,ff),d5={time:null,delay:0,duration:250,ease:So};function g5(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 m5(e){var t,n;e instanceof Ut?(t=e._id,e=e._name):(t=Qm(),(n=d5).time=$o(),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])&&ks(l,e,t,u,a,n||g5(l,t));return new Ut(r,this._parents,e,t)}er.prototype.interrupt=GL,er.prototype.transition=m5;var y5=[null];function b5(e,t){var n=e.__transition,r,i;if(n){t=t==null?null:t+"";for(i in n)if((r=n[i]).state>tf&&r.name===t)return new Ut([[e]],y5,t,+i)}return null}const hf=e=>()=>e;function x5(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 v5(e){e.stopImmediatePropagation()}function pf(e){e.preventDefault(),e.stopImmediatePropagation()}var sy={name:"drag"},df={name:"space"},ai={name:"handle"},si={name:"center"};const{abs:ly,max:Ge,min:Ye}=Math;function uy(e){return[+e[0],+e[1]]}function gf(e){return[uy(e[0]),uy(e[1])]}var Es={name:"x",handles:["w","e"].map(To),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]]}},Is={name:"y",handles:["n","s"].map(To),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]]}},$5={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(To),input:function(e){return e==null?null:gf(e)},output:function(e){return e}},on={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"},cy={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},fy={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},_5={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},S5={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function To(e){return{type:e}}function w5(e){return!e.ctrlKey&&!e.button}function T5(){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 A5(){return navigator.maxTouchPoints||"ontouchstart"in this}function mf(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function P5(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function D5(e){var t=e.__brush;return t?t.dim.output(t.selection):null}function M5(){return yf(Es)}function C5(){return yf(Is)}function L5(){return yf($5)}function yf(e){var t=T5,n=w5,r=A5,i=!0,o=Qn("start","brush","end"),a=6,s;function l(g){var y=g.property("__brush",m).selectAll(".overlay").data([To("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",on.overlay).merge(y).each(function(){var v=mf(this).extent;V(this).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1])}),g.selectAll(".selection").data([To("selection")]).enter().append("rect").attr("class","selection").attr("cursor",on.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var b=g.selectAll(".handle").data(e.handles,function(v){return v.type});b.exit().remove(),b.enter().append("rect").attr("class",function(v){return"handle handle--"+v.type}).attr("cursor",function(v){return on[v.type]}),g.each(u).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).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(v){c(this,arguments).beforestart().start(v)}).on("interrupt.brush end.brush",function(v){c(this,arguments).end(v)}).tween("brush",function(){var v=this,x=v.__brush,_=c(v,arguments),A=x.selection,S=e.input(typeof y=="function"?y.apply(this,arguments):y,x.extent),P=nn(A,S);function M(B){x.selection=B===1&&S===null?null:P(B),u.call(v),_.brush()}return A!==null&&S!==null?M:M(1)}):g.each(function(){var v=this,x=arguments,_=v.__brush,A=e.input(typeof y=="function"?y.apply(v,x):y,_.extent),S=c(v,x).beforestart();ar(v),_.selection=A===null?null:A,u.call(v),S.start(b).brush(b).end(b)})},l.clear=function(g,y){l.move(g,null,y)};function u(){var g=V(this),y=mf(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 v=g.__brush.emitter;return v&&(!b||!v.clean)?v:new f(g,y,b)}function f(g,y,b){this.that=g,this.args=y,this.state=g.__brush,this.active=0,this.clean=b}f.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 v=V(this.that).datum();o.call(g,this.that,new x5(g,{sourceEvent:y,target:l,selection:e.output(this.state.selection),mode:b,dispatch:o}),v)}};function h(g){if(s&&!g.touches||!n.apply(this,arguments))return;var y=this,b=g.target.__data__.type,v=(i&&g.metaKey?b="overlay":b)==="selection"?sy:i&&g.altKey?si:ai,x=e===Is?null:_5[b],_=e===Es?null:S5[b],A=mf(y),S=A.extent,P=A.selection,M=S[0][0],B,$,k=S[0][1],C,T,w=S[1][0],D,F,z=S[1][1],I,N,E=0,O=0,j,ie=x&&_&&i&&g.shiftKey,W,Q,X=Array.from(g.touches||[g],le=>{const De=le.identifier;return le=gt(le,y),le.point0=le.slice(),le.identifier=De,le});ar(y);var K=c(y,arguments,!0).beforestart();if(b==="overlay"){P&&(j=!0);const le=[X[0],X[1]||X[0]];A.selection=P=[[B=e===Is?M:Ye(le[0][0],le[1][0]),C=e===Es?k:Ye(le[0][1],le[1][1])],[D=e===Is?w:Ge(le[0][0],le[1][0]),I=e===Es?z:Ge(le[0][1],le[1][1])]],X.length>1&&me(g)}else B=P[0][0],C=P[0][1],D=P[1][0],I=P[1][1];$=B,T=C,F=D,N=I;var q=V(y).attr("pointer-events","none"),ne=q.selectAll(".overlay").attr("cursor",on[b]);if(g.touches)K.moved=U,K.ended=fe;else{var se=V(g.view).on("mousemove.brush",U,!0).on("mouseup.brush",fe,!0);i&&se.on("keydown.brush",Ee,!0).on("keyup.brush",it,!0),us(g.view)}u.call(y),K.start(g,v.name);function U(le){for(const De of le.changedTouches||[le])for(const da of X)da.identifier===De.identifier&&(da.cur=gt(De,y));if(ie&&!W&&!Q&&X.length===1){const De=X[0];ly(De.cur[0]-De[0])>ly(De.cur[1]-De[1])?Q=!0:W=!0}for(const De of X)De.cur&&(De[0]=De.cur[0],De[1]=De.cur[1]);j=!0,pf(le),me(le)}function me(le){const De=X[0],da=De.point0;var Fn;switch(E=De[0]-da[0],O=De[1]-da[1],v){case df:case sy:{x&&(E=Ge(M-B,Ye(w-D,E)),$=B+E,F=D+E),_&&(O=Ge(k-C,Ye(z-I,O)),T=C+O,N=I+O);break}case ai:{X[1]?(x&&($=Ge(M,Ye(w,X[0][0])),F=Ge(M,Ye(w,X[1][0])),x=1),_&&(T=Ge(k,Ye(z,X[0][1])),N=Ge(k,Ye(z,X[1][1])),_=1)):(x<0?(E=Ge(M-B,Ye(w-B,E)),$=B+E,F=D):x>0&&(E=Ge(M-D,Ye(w-D,E)),$=B,F=D+E),_<0?(O=Ge(k-C,Ye(z-C,O)),T=C+O,N=I):_>0&&(O=Ge(k-I,Ye(z-I,O)),T=C,N=I+O));break}case si:{x&&($=Ge(M,Ye(w,B-E*x)),F=Ge(M,Ye(w,D+E*x))),_&&(T=Ge(k,Ye(z,C-O*_)),N=Ge(k,Ye(z,I+O*_)));break}}F<$&&(x*=-1,Fn=B,B=D,D=Fn,Fn=$,$=F,F=Fn,b in cy&&ne.attr("cursor",on[b=cy[b]])),N<T&&(_*=-1,Fn=C,C=I,I=Fn,Fn=T,T=N,N=Fn,b in fy&&ne.attr("cursor",on[b=fy[b]])),A.selection&&(P=A.selection),W&&($=P[0][0],F=P[1][0]),Q&&(T=P[0][1],N=P[1][1]),(P[0][0]!==$||P[0][1]!==T||P[1][0]!==F||P[1][1]!==N)&&(A.selection=[[$,T],[F,N]],u.call(y),K.brush(le,v.name))}function fe(le){if(v5(le),le.touches){if(le.touches.length)return;s&&clearTimeout(s),s=setTimeout(function(){s=null},500)}else cs(le.view,j),se.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);q.attr("pointer-events","all"),ne.attr("cursor",on.overlay),A.selection&&(P=A.selection),P5(P)&&(A.selection=null,u.call(y)),K.end(le,v.name)}function Ee(le){switch(le.keyCode){case 16:{ie=x&&_;break}case 18:{v===ai&&(x&&(D=F-E*x,B=$+E*x),_&&(I=N-O*_,C=T+O*_),v=si,me(le));break}case 32:{(v===ai||v===si)&&(x<0?D=F-E:x>0&&(B=$-E),_<0?I=N-O:_>0&&(C=T-O),v=df,ne.attr("cursor",on.selection),me(le));break}default:return}pf(le)}function it(le){switch(le.keyCode){case 16:{ie&&(W=Q=ie=!1,me(le));break}case 18:{v===si&&(x<0?D=F:x>0&&(B=$),_<0?I=N:_>0&&(C=T),v=ai,me(le));break}case 32:{v===df&&(le.altKey?(x&&(D=F-E*x,B=$+E*x),_&&(I=N-O*_,C=T+O*_),v=si):(x<0?D=F:x>0&&(B=$),_<0?I=N:_>0&&(C=T),v=ai),ne.attr("cursor",on[b]),me(le));break}default:return}pf(le)}}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=gf(t.apply(this,arguments)),g.dim=e,g}return l.extent=function(g){return arguments.length?(t=typeof g=="function"?g:hf(gf(g)),l):t},l.filter=function(g){return arguments.length?(n=typeof g=="function"?g:hf(!!g),l):n},l.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:hf(!!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 hy=Math.abs,li=Math.cos,ui=Math.sin,py=Math.PI,Bs=py/2,dy=py*2,gy=Math.max,bf=1e-12;function xf(e,t){return Array.from({length:t-e},(n,r)=>e+r)}function k5(e){return function(t,n){return e(t.source.value+t.target.value,n.source.value+n.target.value)}}function R5(){return vf(!1,!1)}function E5(){return vf(!1,!0)}function I5(){return vf(!0,!1)}function vf(e,t){var n=0,r=null,i=null,o=null;function a(s){var l=s.length,u=new Array(l),c=xf(0,l),f=new Array(l*l),h=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=gy(0,dy-n*l)/p,d=p?n:dy/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=xf(~l+1,l).filter(v=>v<0?s[~v*l+g]:s[g*l+v]);i&&b.sort((v,x)=>i(v<0?-s[~v*l+g]:s[g*l+v],x<0?-s[~x*l+g]:s[g*l+x]));for(const v of b)if(v<0){const x=f[~v*l+g]||(f[~v*l+g]={source:null,target:null});x.target={index:g,startAngle:m,endAngle:m+=s[~v*l+g]*p,value:s[~v*l+g]}}else{const x=f[g*l+v]||(f[g*l+v]={source:null,target:null});x.source={index:g,startAngle:m,endAngle:m+=s[g*l+v]*p,value:s[g*l+v]}}h[g]={index:g,startAngle:y,endAngle:m,value:u[g]}}else{const b=xf(0,l).filter(v=>s[g*l+v]||s[v*l+g]);i&&b.sort((v,x)=>i(s[g*l+v],s[g*l+x]));for(const v of b){let x;if(g<v?(x=f[g*l+v]||(f[g*l+v]={source:null,target:null}),x.source={index:g,startAngle:m,endAngle:m+=s[g*l+v]*p,value:s[g*l+v]}):(x=f[v*l+g]||(f[v*l+g]={source:null,target:null}),x.target={index:g,startAngle:m,endAngle:m+=s[g*l+v]*p,value:s[g*l+v]},g===v&&(x.source=x.target)),x.source&&x.target&&x.source.value<x.target.value){const _=x.source;x.source=x.target,x.target=_}}h[g]={index:g,startAngle:y,endAngle:m,value:u[g]}}m+=d}}return f=Object.values(f),f.groups=h,o?f.sort(o):f}return a.padAngle=function(s){return arguments.length?(n=gy(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=k5(s))._=s,a):o&&o._},a}const $f=Math.PI,_f=2*$f,lr=1e-6,B5=_f-lr;function my(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function N5(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return my;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 Ao=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?my:N5(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,f=s-n,h=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>lr)if(!(Math.abs(f*l-u*c)>lr)||!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(h),v=o*Math.tan(($f-Math.acos((m+h-g)/(2*y*b)))/2),x=v/b,_=v/y;Math.abs(x-1)>lr&&this._append`L${t+x*c},${n+x*f}`,this._append`A${o},${o},0,0,${+(f*p>c*d)},${this._x1=t+_*l},${this._y1=n+_*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,f=1^a,h=a?i-o:o-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>lr||Math.abs(this._y1-c)>lr)&&this._append`L${u},${c}`,r&&(h<0&&(h=h%_f+_f),h>B5?this._append`A${r},${r},0,1,${f},${t-s},${n-l}A${r},${r},0,1,${f},${this._x1=u},${this._y1=c}`:h>lr&&this._append`A${r},${r},0,${+(h>=$f)},${f},${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 Sf(){return new Ao}Sf.prototype=Ao.prototype;function F5(e=3){return new Ao(+e)}var z5=Array.prototype.slice;function ur(e){return function(){return e}}function O5(e){return e.source}function G5(e){return e.target}function yy(e){return e.radius}function Y5(e){return e.startAngle}function W5(e){return e.endAngle}function X5(){return 0}function V5(){return 10}function by(e){var t=O5,n=G5,r=yy,i=yy,o=Y5,a=W5,s=X5,l=null;function u(){var c,f=t.apply(this,arguments),h=n.apply(this,arguments),p=s.apply(this,arguments)/2,d=z5.call(arguments),m=+r.apply(this,(d[0]=f,d)),g=o.apply(this,d)-Bs,y=a.apply(this,d)-Bs,b=+i.apply(this,(d[0]=h,d)),v=o.apply(this,d)-Bs,x=a.apply(this,d)-Bs;if(l||(l=c=Sf()),p>bf&&(hy(y-g)>p*2+bf?y>g?(g+=p,y-=p):(g-=p,y+=p):g=y=(g+y)/2,hy(x-v)>p*2+bf?x>v?(v+=p,x-=p):(v-=p,x+=p):v=x=(v+x)/2),l.moveTo(m*li(g),m*ui(g)),l.arc(0,0,m,g,y),g!==v||y!==x)if(e){var _=+e.apply(this,arguments),A=b-_,S=(v+x)/2;l.quadraticCurveTo(0,0,A*li(v),A*ui(v)),l.lineTo(b*li(S),b*ui(S)),l.lineTo(A*li(x),A*ui(x))}else l.quadraticCurveTo(0,0,b*li(v),b*ui(v)),l.arc(0,0,b,v,x);if(l.quadraticCurveTo(0,0,m*li(g),m*ui(g)),l.closePath(),c)return l=null,c+""||null}return e&&(u.headRadius=function(c){return arguments.length?(e=typeof c=="function"?c:ur(+c),u):e}),u.radius=function(c){return arguments.length?(r=i=typeof c=="function"?c:ur(+c),u):r},u.sourceRadius=function(c){return arguments.length?(r=typeof c=="function"?c:ur(+c),u):r},u.targetRadius=function(c){return arguments.length?(i=typeof c=="function"?c:ur(+c),u):i},u.startAngle=function(c){return arguments.length?(o=typeof c=="function"?c:ur(+c),u):o},u.endAngle=function(c){return arguments.length?(a=typeof c=="function"?c:ur(+c),u):a},u.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:ur(+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 U5(){return by()}function H5(){return by(V5)}var j5=Array.prototype,xy=j5.slice;function q5(e,t){return e-t}function Z5(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 Dn=e=>()=>e;function K5(e,t){for(var n=-1,r=t.length,i;++n<r;)if(i=Q5(e,t[n]))return i;return 0}function Q5(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],f=e[s],h=f[0],p=f[1];if(J5(l,f,t))return 0;c>r!=p>r&&n<(h-u)*(r-c)/(p-c)+u&&(i=-i)}return i}function J5(e,t,n){var r;return e6(e,t,n)&&t6(e[r=+(e[0]===t[0])],n[r],t[r])}function e6(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function t6(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function n6(){}var an=[[],[[[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 wf(){var e=1,t=1,n=_c,r=l;function i(u){var c=n(u);if(Array.isArray(c))c=c.slice().sort(q5);else{const f=io(u,r6);for(c=Zn(...$c(f[0],f[1],c),c);c[c.length-1]>=f[1];)c.pop();for(;c[1]<f[0];)c.shift()}return c.map(f=>o(u,f))}function o(u,c){const f=c==null?NaN:+c;if(isNaN(f))throw new Error(`invalid value: ${c}`);var h=[],p=[];return a(u,f,function(d){r(d,u,f),Z5(d)>0?h.push([d]):p.push(d)}),p.forEach(function(d){for(var m=0,g=h.length,y;m<g;++m)if(K5((y=h[m])[0],d)!==-1){y.push(d);return}}),{type:"MultiPolygon",value:c,coordinates:h}}function a(u,c,f){var h=new Array,p=new Array,d,m,g,y,b,v;for(d=m=-1,y=cr(u[0],c),an[y<<1].forEach(x);++d<e-1;)g=y,y=cr(u[d+1],c),an[g|y<<1].forEach(x);for(an[y<<0].forEach(x);++m<t-1;){for(d=-1,y=cr(u[m*e+e],c),b=cr(u[m*e],c),an[y<<1|b<<2].forEach(x);++d<e-1;)g=y,y=cr(u[m*e+e+d+1],c),v=b,b=cr(u[m*e+d+1],c),an[g|y<<1|b<<2|v<<3].forEach(x);an[y|b<<3].forEach(x)}for(d=-1,b=u[m*e]>=c,an[b<<2].forEach(x);++d<e-1;)v=b,b=cr(u[m*e+d+1],c),an[b<<2|v<<3].forEach(x);an[b<<3].forEach(x);function x(_){var A=[_[0][0]+d,_[0][1]+m],S=[_[1][0]+d,_[1][1]+m],P=s(A),M=s(S),B,$;(B=p[P])?($=h[M])?(delete p[B.end],delete h[$.start],B===$?(B.ring.push(S),f(B.ring)):h[B.start]=p[$.end]={start:B.start,end:$.end,ring:B.ring.concat($.ring)}):(delete p[B.end],B.ring.push(S),p[B.end=M]=B):(B=h[M])?($=p[P])?(delete h[B.start],delete p[$.end],B===$?(B.ring.push(S),f(B.ring)):h[$.start]=p[B.end]={start:$.start,end:B.end,ring:$.ring.concat(B.ring)}):(delete h[B.start],B.ring.unshift(A),h[B.start=P]=B):h[P]=p[M]={start:P,end:M,ring:[A,S]}}}function s(u){return u[0]*2+u[1]*(e+1)*4}function l(u,c,f){u.forEach(function(h){var p=h[0],d=h[1],m=p|0,g=d|0,y=Tf(c[g*e+m]);p>0&&p<e&&m===p&&(h[0]=vy(p,Tf(c[g*e+m-1]),y,f)),d>0&&d<t&&g===d&&(h[1]=vy(d,Tf(c[(g-1)*e+m]),y,f))})}return i.contour=o,i.size=function(u){if(!arguments.length)return[e,t];var c=Math.floor(u[0]),f=Math.floor(u[1]);if(!(c>=0&&f>=0))throw new Error("invalid size");return e=c,t=f,i},i.thresholds=function(u){return arguments.length?(n=typeof u=="function"?u:Array.isArray(u)?Dn(xy.call(u)):Dn(u),i):n},i.smooth=function(u){return arguments.length?(r=u?l:n6,i):r===l},i}function r6(e){return isFinite(e)?e:NaN}function cr(e,t){return e==null?!1:+e>=t}function Tf(e){return e==null||isNaN(e=+e)?-1/0:e}function vy(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 i6(e){return e[0]}function o6(e){return e[1]}function a6(){return 1}function s6(){var e=i6,t=o6,n=a6,r=960,i=500,o=20,a=2,s=o*3,l=r+s*2>>a,u=i+s*2>>a,c=Dn(20);function f(b){var v=new Float32Array(l*u),x=Math.pow(2,-a),_=-1;for(const C of b){var A=(e(C,++_,b)+s)*x,S=(t(C,_,b)+s)*x,P=+n(C,_,b);if(P&&A>=0&&A<l&&S>=0&&S<u){var M=Math.floor(A),B=Math.floor(S),$=A-M-.5,k=S-B-.5;v[M+B*l]+=(1-$)*(1-k)*P,v[M+1+B*l]+=$*(1-k)*P,v[M+1+(B+1)*l]+=$*k*P,v[M+(B+1)*l]+=(1-$)*k*P}}return b0({data:v,width:l,height:u},o*x),v}function h(b){var v=f(b),x=c(v),_=Math.pow(2,2*a);return Array.isArray(x)||(x=Zn(Number.MIN_VALUE,ao(v)/_,x)),wf().size([l,u]).thresholds(x.map(A=>A*_))(v).map((A,S)=>(A.value=+x[S],p(A)))}h.contours=function(b){var v=f(b),x=wf().size([l,u]),_=Math.pow(2,2*a),A=S=>{S=+S;var P=p(x.contour(v,S*_));return P.value=S,P};return Object.defineProperty(A,"max",{get:()=>ao(v)/_}),A};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,h}return h.x=function(b){return arguments.length?(e=typeof b=="function"?b:Dn(+b),h):e},h.y=function(b){return arguments.length?(t=typeof b=="function"?b:Dn(+b),h):t},h.weight=function(b){return arguments.length?(n=typeof b=="function"?b:Dn(+b),h):n},h.size=function(b){if(!arguments.length)return[r,i];var v=+b[0],x=+b[1];if(!(v>=0&&x>=0))throw new Error("invalid size");return r=v,i=x,y()},h.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()},h.thresholds=function(b){return arguments.length?(c=typeof b=="function"?b:Array.isArray(b)?Dn(xy.call(b)):Dn(b),h):c},h.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()},h}const sn=11102230246251565e-32,We=134217729,l6=(3+8*sn)*sn;function Af(e,t,n,r,i){let o,a,s,l,u=t[0],c=r[0],f=0,h=0;c>u==c>-u?(o=u,u=t[++f]):(o=c,c=r[++h]);let p=0;if(f<e&&h<n)for(c>u==c>-u?(a=u+o,s=o-(a-u),u=t[++f]):(a=c+o,s=o-(a-c),c=r[++h]),o=a,s!==0&&(i[p++]=s);f<e&&h<n;)c>u==c>-u?(a=o+u,l=a-o,s=o-(a-l)+(u-l),u=t[++f]):(a=o+c,l=a-o,s=o-(a-l)+(c-l),c=r[++h]),o=a,s!==0&&(i[p++]=s);for(;f<e;)a=o+u,l=a-o,s=o-(a-l)+(u-l),u=t[++f],o=a,s!==0&&(i[p++]=s);for(;h<n;)a=o+c,l=a-o,s=o-(a-l)+(c-l),c=r[++h],o=a,s!==0&&(i[p++]=s);return(o!==0||p===0)&&(i[p++]=o),p}function u6(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function Po(e){return new Float64Array(e)}const c6=(3+16*sn)*sn,f6=(2+12*sn)*sn,h6=(9+64*sn)*sn*sn,ci=Po(4),$y=Po(8),_y=Po(12),Sy=Po(16),je=Po(4);function p6(e,t,n,r,i,o,a){let s,l,u,c,f,h,p,d,m,g,y,b,v,x,_,A,S,P;const M=e-i,B=n-i,$=t-o,k=r-o;x=M*k,h=We*M,p=h-(h-M),d=M-p,h=We*k,m=h-(h-k),g=k-m,_=d*g-(x-p*m-d*m-p*g),A=$*B,h=We*$,p=h-(h-$),d=$-p,h=We*B,m=h-(h-B),g=B-m,S=d*g-(A-p*m-d*m-p*g),y=_-S,f=_-y,ci[0]=_-(y+f)+(f-S),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-A,f=v-y,ci[1]=v-(y+f)+(f-A),P=b+y,f=P-b,ci[2]=b-(P-f)+(y-f),ci[3]=P;let C=u6(4,ci),T=f6*a;if(C>=T||-C>=T||(f=e-M,s=e-(M+f)+(f-i),f=n-B,u=n-(B+f)+(f-i),f=t-$,l=t-($+f)+(f-o),f=r-k,c=r-(k+f)+(f-o),s===0&&l===0&&u===0&&c===0)||(T=h6*a+l6*Math.abs(C),C+=M*c+k*s-($*u+B*l),C>=T||-C>=T))return C;x=s*k,h=We*s,p=h-(h-s),d=s-p,h=We*k,m=h-(h-k),g=k-m,_=d*g-(x-p*m-d*m-p*g),A=l*B,h=We*l,p=h-(h-l),d=l-p,h=We*B,m=h-(h-B),g=B-m,S=d*g-(A-p*m-d*m-p*g),y=_-S,f=_-y,je[0]=_-(y+f)+(f-S),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-A,f=v-y,je[1]=v-(y+f)+(f-A),P=b+y,f=P-b,je[2]=b-(P-f)+(y-f),je[3]=P;const w=Af(4,ci,4,je,$y);x=M*c,h=We*M,p=h-(h-M),d=M-p,h=We*c,m=h-(h-c),g=c-m,_=d*g-(x-p*m-d*m-p*g),A=$*u,h=We*$,p=h-(h-$),d=$-p,h=We*u,m=h-(h-u),g=u-m,S=d*g-(A-p*m-d*m-p*g),y=_-S,f=_-y,je[0]=_-(y+f)+(f-S),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-A,f=v-y,je[1]=v-(y+f)+(f-A),P=b+y,f=P-b,je[2]=b-(P-f)+(y-f),je[3]=P;const D=Af(w,$y,4,je,_y);x=s*c,h=We*s,p=h-(h-s),d=s-p,h=We*c,m=h-(h-c),g=c-m,_=d*g-(x-p*m-d*m-p*g),A=l*u,h=We*l,p=h-(h-l),d=l-p,h=We*u,m=h-(h-u),g=u-m,S=d*g-(A-p*m-d*m-p*g),y=_-S,f=_-y,je[0]=_-(y+f)+(f-S),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-A,f=v-y,je[1]=v-(y+f)+(f-A),P=b+y,f=P-b,je[2]=b-(P-f)+(y-f),je[3]=P;const F=Af(D,_y,4,je,Sy);return Sy[F-1]}function Ns(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)>=c6*u?l:-p6(e,t,n,r,i,o,u)}const wy=Math.pow(2,-52),Fs=new Uint32Array(512);class zs{static from(t,n=b6,r=x6){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 zs(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 M=0;M<a;M++){const B=t[2*M],$=t[2*M+1];B<s&&(s=B),$<l&&(l=$),B>u&&(u=B),$>c&&(c=$),this._ids[M]=M}const f=(s+u)/2,h=(l+c)/2;let p,d,m;for(let M=0,B=1/0;M<a;M++){const $=Pf(f,h,t[2*M],t[2*M+1]);$<B&&(p=M,B=$)}const g=t[2*p],y=t[2*p+1];for(let M=0,B=1/0;M<a;M++){if(M===p)continue;const $=Pf(g,y,t[2*M],t[2*M+1]);$<B&&$>0&&(d=M,B=$)}let b=t[2*d],v=t[2*d+1],x=1/0;for(let M=0;M<a;M++){if(M===p||M===d)continue;const B=m6(g,y,b,v,t[2*M],t[2*M+1]);B<x&&(m=M,x=B)}let _=t[2*m],A=t[2*m+1];if(x===1/0){for(let $=0;$<a;$++)this._dists[$]=t[2*$]-t[0]||t[2*$+1]-t[1];fi(this._ids,this._dists,0,a-1);const M=new Uint32Array(a);let B=0;for(let $=0,k=-1/0;$<a;$++){const C=this._ids[$],T=this._dists[C];T>k&&(M[B++]=C,k=T)}this.hull=M.subarray(0,B),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Ns(g,y,b,v,_,A)<0){const M=d,B=b,$=v;d=m,b=_,v=A,m=M,_=B,A=$}const S=y6(g,y,b,v,_,A);this._cx=S.x,this._cy=S.y;for(let M=0;M<a;M++)this._dists[M]=Pf(t[2*M],t[2*M+1],S.x,S.y);fi(this._ids,this._dists,0,a-1),this._hullStart=p;let P=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,v)]=d,o[this._hashKey(_,A)]=m,this.trianglesLen=0,this._addTriangle(p,d,m,-1,-1,-1);for(let M=0,B,$;M<this._ids.length;M++){const k=this._ids[M],C=t[2*k],T=t[2*k+1];if(M>0&&Math.abs(C-B)<=wy&&Math.abs(T-$)<=wy||(B=C,$=T,k===p||k===d||k===m))continue;let w=0;for(let N=0,E=this._hashKey(C,T);N<this._hashSize&&(w=o[(E+N)%this._hashSize],!(w!==-1&&w!==r[w]));N++);w=n[w];let D=w,F;for(;F=r[D],Ns(C,T,t[2*D],t[2*D+1],t[2*F],t[2*F+1])>=0;)if(D=F,D===w){D=-1;break}if(D===-1)continue;let z=this._addTriangle(D,k,r[D],-1,-1,i[D]);i[k]=this._legalize(z+2),i[D]=z,P++;let I=r[D];for(;F=r[I],Ns(C,T,t[2*I],t[2*I+1],t[2*F],t[2*F+1])<0;)z=this._addTriangle(I,k,F,i[k],-1,i[I]),i[k]=this._legalize(z+2),r[I]=I,P--,I=F;if(D===w)for(;F=n[D],Ns(C,T,t[2*F],t[2*F+1],t[2*D],t[2*D+1])<0;)z=this._addTriangle(F,k,D,-1,i[D],i[F]),this._legalize(z+2),i[F]=z,r[D]=D,P--,D=F;this._hullStart=n[k]=D,r[D]=n[I]=k,r[k]=I,o[this._hashKey(C,T)]=k,o[this._hashKey(t[2*D],t[2*D+1])]=D}this.hull=new Uint32Array(P);for(let M=0,B=this._hullStart;M<P;M++)this.hull[M]=B,B=r[B];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(d6(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=Fs[--o];continue}const u=s-s%3,c=l+(t+1)%3,f=u+(s+2)%3,h=n[a],p=n[t],d=n[c],m=n[f];if(g6(i[2*h],i[2*h+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]=h;const y=r[f];if(y===-1){let v=this._hullStart;do{if(this._hullTri[v]===f){this._hullTri[v]=t;break}v=this._hullPrev[v]}while(v!==this._hullStart)}this._link(t,y),this._link(s,r[a]),this._link(a,f);const b=u+(s+1)%3;o<Fs.length&&(Fs[o++]=b)}else{if(o===0)break;t=Fs[--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 d6(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function Pf(e,t,n,r){const i=e-n,o=t-r;return i*i+o*o}function g6(e,t,n,r,i,o,a,s){const l=e-a,u=t-s,c=n-a,f=r-s,h=i-a,p=o-s,d=l*l+u*u,m=c*c+f*f,g=h*h+p*p;return l*(f*g-m*p)-u*(c*g-m*h)+d*(c*p-f*h)<0}function m6(e,t,n,r,i,o){const a=n-e,s=r-t,l=i-e,u=o-t,c=a*a+s*s,f=l*l+u*u,h=.5/(a*u-s*l),p=(u*c-s*f)*h,d=(a*f-l*c)*h;return p*p+d*d}function y6(e,t,n,r,i,o){const a=n-e,s=r-t,l=i-e,u=o-t,c=a*a+s*s,f=l*l+u*u,h=.5/(a*u-s*l),p=e+(u*c-s*f)*h,d=t+(a*f-l*c)*h;return{x:p,y:d}}function fi(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;Do(e,i,o),t[e[n]]>t[e[r]]&&Do(e,n,r),t[e[o]]>t[e[r]]&&Do(e,o,r),t[e[n]]>t[e[o]]&&Do(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;Do(e,o,a)}e[n+1]=e[a],e[a]=s,r-o+1>=a-n?(fi(e,t,o,r),fi(e,t,n,a-1)):(fi(e,t,n,a-1),fi(e,t,o,r))}}function Do(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function b6(e){return e[0]}function x6(e){return e[1]}const Ty=1e-6;class fr{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)>Ty||Math.abs(this._y1-o)>Ty)&&(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 Df{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 Ay{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,v;m<y;m+=3,g+=2){const x=r[m]*2,_=r[m+1]*2,A=r[m+2]*2,S=t[x],P=t[x+1],M=t[_],B=t[_+1],$=t[A],k=t[A+1],C=M-S,T=B-P,w=$-S,D=k-P,F=(C*D-T*w)*2;if(Math.abs(F)<1e-9){if(o===void 0){o=a=0;for(const I of n)o+=t[I*2],a+=t[I*2+1];o/=n.length,a/=n.length}const z=1e9*Math.sign((o-S)*D-(a-P)*w);b=(S+$)/2-z*D,v=(P+k)/2+z*w}else{const z=1/F,I=C*C+T*T,N=w*w+D*D;b=S+(D*I-T*N)*z,v=P+(C*N-w*I)*z}s[g]=b,s[g+1]=v}let l=n[n.length-1],u,c=l*4,f,h=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,f=h,p=d,c=l*4,h=t[2*l],d=t[2*l+1],i[u+2]=i[c]=p-d,i[u+3]=i[c+1]=h-f}render(t){const n=t==null?t=new fr:void 0,{delaunay:{halfedges:r,inedges:i,hull:o},circumcenters:a,vectors:s}=this;if(o.length<=1)return null;for(let c=0,f=r.length;c<f;++c){const h=r[c];if(h<c)continue;const p=Math.floor(c/3)*2,d=Math.floor(h/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 f=Math.floor(i[u]/3)*2,h=a[f],p=a[f+1],d=l*4,m=this._project(h,p,s[d+2],s[d+3]);m&&this._renderSegment(h,p,m[0],m[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new fr: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 fr: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 Df;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),f,h=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)f=h,h=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,f=h,h=this._edgecode(m,g),f&&h&&this._edge(t,f,h,i,i.length),i?i.push(m,g):i=[m,g]}f=h,h=this._edgecode(y,b),f&&h&&this._edge(t,f,h,i,i.length),i?i.push(y,b):i=[y,b]}if(i)f=h,h=this._edgecode(i[0],i[1]),f&&h&&this._edge(t,f,h,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,f,h=this._edgecode(s[c-2],s[c-1]);u<c;u+=2)f=h,h=this._edgecode(s[u],s[u+1]),f&&h&&(u=this._edge(t,f,h,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 v6=2*Math.PI,hi=Math.pow;function $6(e){return e[0]}function _6(e){return e[1]}function S6(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 w6(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class Mf{static from(t,n=$6,r=_6,i){return new Mf("length"in t?T6(t,n,r,i):Float64Array.from(A6(t,n,r,i)))}constructor(t){this._delaunator=new zs(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&&S6(t)){this.collinear=Int32Array.from({length:n.length/2},(h,p)=>p).sort((h,p)=>n[2*h]-n[2*p]||n[2*h+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]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let h=0,p=n.length/2;h<p;++h){const d=w6(n[2*h],n[2*h+1],f);n[2*h]=d[0],n[2*h+1]=d[1]}this._delaunator=new zs(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 Ay(this,t)}*neighbors(t){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:a,collinear:s}=this;if(s){const f=s.indexOf(t);f>0&&(yield s[f-1]),f<s.length-1&&(yield s[f+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 f=r[(i[t]+1)%r.length];f!==c&&(yield f);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,f=hi(n-u[t*2],2)+hi(r-u[t*2+1],2);const h=i[t];let p=h;do{let d=l[p];const m=hi(n-u[d*2],2)+hi(r-u[d*2+1],2);if(m<f&&(f=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&&hi(n-u[p*2],2)+hi(r-u[p*2+1],2)<f)return p;break}}while(p!==h);return c}render(t){const n=t==null?t=new fr: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 fr: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,v6)}return r&&r.value()}renderHull(t){const n=t==null?t=new fr: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 Df;return this.renderHull(t),t.value()}renderTriangle(t,n){const r=n==null?n=new fr: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 Df;return this.renderTriangle(t,n),n.value()}}function T6(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*A6(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 Py={},Cf={},Lf=34,Mo=10,kf=13;function Dy(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function P6(e,t){var n=Dy(e);return function(r,i){return t(n(r),i,e)}}function My(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 lt(e,t){var n=e+"",r=n.length;return r<t?new Array(t-r+1).join(0)+n:n}function D6(e){return e<0?"-"+lt(-e,6):e>9999?"+"+lt(e,6):lt(e,4)}function M6(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":D6(e.getUTCFullYear())+"-"+lt(e.getUTCMonth()+1,2)+"-"+lt(e.getUTCDate(),2)+(i?"T"+lt(t,2)+":"+lt(n,2)+":"+lt(r,2)+"."+lt(i,3)+"Z":r?"T"+lt(t,2)+":"+lt(n,2)+":"+lt(r,2)+"Z":n||t?"T"+lt(t,2)+":"+lt(n,2)+"Z":"")}function Os(e){var t=new RegExp('["'+e+`
43
+ \r]`),n=e.charCodeAt(0);function r(f,h){var p,d,m=i(f,function(g,y){if(p)return p(g,y-1);d=g,p=h?P6(g,h):Dy(g)});return m.columns=d||[],m}function i(f,h){var p=[],d=f.length,m=0,g=0,y,b=d<=0,v=!1;f.charCodeAt(d-1)===Mo&&--d,f.charCodeAt(d-1)===kf&&--d;function x(){if(b)return Cf;if(v)return v=!1,Py;var A,S=m,P;if(f.charCodeAt(S)===Lf){for(;m++<d&&f.charCodeAt(m)!==Lf||f.charCodeAt(++m)===Lf;);return(A=m)>=d?b=!0:(P=f.charCodeAt(m++))===Mo?v=!0:P===kf&&(v=!0,f.charCodeAt(m)===Mo&&++m),f.slice(S+1,A-1).replace(/""/g,'"')}for(;m<d;){if((P=f.charCodeAt(A=m++))===Mo)v=!0;else if(P===kf)v=!0,f.charCodeAt(m)===Mo&&++m;else if(P!==n)continue;return f.slice(S,A)}return b=!0,f.slice(S,d)}for(;(y=x())!==Cf;){for(var _=[];y!==Py&&y!==Cf;)_.push(y),y=x();h&&(_=h(_,g++))==null||p.push(_)}return p}function o(f,h){return f.map(function(p){return h.map(function(d){return c(p[d])}).join(e)})}function a(f,h){return h==null&&(h=My(f)),[h.map(c).join(e)].concat(o(f,h)).join(`
44
+ `)}function s(f,h){return h==null&&(h=My(f)),o(f,h).join(`
45
45
  `)}function l(f){return f.map(u).join(`
46
- `)}function u(f){return f.map(c).join(t)}function c(f){return f==null?"":f instanceof Date?Q6(f):e.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:r,parseRows:i,format:a,formatBody:s,formatRows:l,formatRow:u,formatValue:c}}var sr=Cs(","),yy=sr.parse,J6=sr.parseRows,t8=sr.format,e8=sr.formatBody,n8=sr.formatRows,r8=sr.formatRow,i8=sr.formatValue,lr=Cs(" "),by=lr.parse,o8=lr.parseRows,a8=lr.format,s8=lr.formatBody,l8=lr.formatRows,u8=lr.formatRow,c8=lr.formatValue;function f8(t){for(var e in t){var n=t[e].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})?)?$/))h8&&i[4]&&!i[7]&&(n=n.replace(/-/g,"/").replace(/T/," ")),n=new Date(n);else continue;t[e]=n}return t}const h8=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();function p8(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}function d8(t,e){return fetch(t,e).then(p8)}function g8(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}function m8(t,e){return fetch(t,e).then(g8)}function y8(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function Ls(t,e){return fetch(t,e).then(y8)}function xy(t){return function(e,n,r){return arguments.length===2&&typeof n=="function"&&(r=n,n=void 0),Ls(e,n).then(function(i){return t(i,r)})}}function b8(t,e,n,r){arguments.length===3&&typeof n=="function"&&(r=n,n=void 0);var i=Cs(t);return Ls(e,n).then(function(o){return i.parse(o,r)})}var x8=xy(yy),v8=xy(by);function $8(t,e){return new Promise(function(n,r){var i=new Image;for(var o in e)i[o]=e[o];i.onerror=r,i.onload=function(){n(i)},i.src=t})}function _8(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(!(t.status===204||t.status===205))return t.json()}function w8(t,e){return fetch(t,e).then(_8)}function $f(t){return(e,n)=>Ls(e,n).then(r=>new DOMParser().parseFromString(r,t))}const S8=$f("application/xml");var A8=$f("text/html"),T8=$f("image/svg+xml");function P8(t,e){var n,r=1;t==null&&(t=0),e==null&&(e=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-t)*r,u=(u/a-e)*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?(t=+o,i):t},i.y=function(o){return arguments.length?(e=+o,i):e},i.strength=function(o){return arguments.length?(r=+o,i):r},i}function D8(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return vy(this.cover(e,n),e,n,t)}function vy(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o=t._root,a={data:r},s=t._x0,l=t._y0,u=t._x1,c=t._y1,f,h,p,d,m,g,y,b;if(!o)return t._root=a,t;for(;o.length;)if((m=e>=(f=(s+u)/2))?s=f:u=f,(g=n>=(h=(l+c)/2))?l=h:c=h,i=o,!(o=o[y=g<<1|m]))return i[y]=a,t;if(p=+t._x.call(null,o.data),d=+t._y.call(null,o.data),e===p&&n===d)return a.next=o,i?i[y]=a:t._root=a,t;do i=i?i[y]=new Array(4):t._root=new Array(4),(m=e>=(f=(s+u)/2))?s=f:u=f,(g=n>=(h=(l+c)/2))?l=h:c=h;while((y=g<<1|m)===(b=(d>=h)<<1|p>=f));return i[b]=o,i[y]=a,t}function M8(t){var e,n,r=t.length,i,o,a=new Array(r),s=new Array(r),l=1/0,u=1/0,c=-1/0,f=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(o=+this._y.call(null,e))||(a[n]=i,s[n]=o,i<l&&(l=i),i>c&&(c=i),o<u&&(u=o),o>f&&(f=o));if(l>c||u>f)return this;for(this.cover(l,u).cover(c,f),n=0;n<r;++n)vy(this,a[n],s[n],t[n]);return this}function C8(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a=i-n||1,s=this._root,l,u;n>t||t>=i||r>e||e>=o;)switch(u=(e<r)<<1|t<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 L8(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function k8(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Ut(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function R8(t,e,n){var r,i=this._x0,o=this._y0,a,s,l,u,c=this._x1,f=this._y1,h=[],p=this._root,d,m;for(p&&h.push(new Ut(p,i,o,c,f)),n==null?n=1/0:(i=t-n,o=e-n,c=t+n,f=e+n,n*=n);d=h.pop();)if(!(!(p=d.node)||(a=d.x0)>c||(s=d.y0)>f||(l=d.x1)<i||(u=d.y1)<o))if(p.length){var g=(a+l)/2,y=(s+u)/2;h.push(new Ut(p[3],g,y,l,u),new Ut(p[2],a,y,g,u),new Ut(p[1],g,s,l,y),new Ut(p[0],a,s,g,y)),(m=(e>=y)<<1|t>=g)&&(d=h[h.length-1],h[h.length-1]=h[h.length-1-m],h[h.length-1-m]=d)}else{var b=t-+this._x.call(null,p.data),v=e-+this._y.call(null,p.data),x=b*b+v*v;if(x<n){var _=Math.sqrt(n=x);i=t-_,o=e-_,c=t+_,f=e+_,r=p.data}}return r}function E8(t){if(isNaN(c=+this._x.call(null,t))||isNaN(f=+this._y.call(null,t)))return this;var e,n=this._root,r,i,o,a=this._x0,s=this._y0,l=this._x1,u=this._y1,c,f,h,p,d,m,g,y;if(!n)return this;if(n.length)for(;;){if((d=c>=(h=(a+l)/2))?a=h:l=h,(m=f>=(p=(s+u)/2))?s=p:u=p,e=n,!(n=n[g=m<<1|d]))return this;if(!n.length)break;(e[g+1&3]||e[g+2&3]||e[g+3&3])&&(r=e,y=g)}for(;n.data!==t;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):e?(o?e[g]=o:delete e[g],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(r?r[y]=n:this._root=n),this):(this._root=o,this)}function I8(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function B8(){return this._root}function N8(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function F8(t){var e=[],n,r=this._root,i,o,a,s,l;for(r&&e.push(new Ut(r,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(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])&&e.push(new Ut(i,u,c,s,l)),(i=r[2])&&e.push(new Ut(i,o,c,u,l)),(i=r[1])&&e.push(new Ut(i,u,a,s,c)),(i=r[0])&&e.push(new Ut(i,o,a,u,c))}return this}function O8(t){var e=[],n=[],r;for(this._root&&e.push(new Ut(this._root,this._x0,this._y0,this._x1,this._y1));r=e.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,f=(s+u)/2;(o=i[0])&&e.push(new Ut(o,a,s,c,f)),(o=i[1])&&e.push(new Ut(o,c,s,l,f)),(o=i[2])&&e.push(new Ut(o,a,f,c,u)),(o=i[3])&&e.push(new Ut(o,c,f,l,u))}n.push(r)}for(;r=n.pop();)t(r.node,r.x0,r.y0,r.x1,r.y1);return this}function z8(t){return t[0]}function G8(t){return arguments.length?(this._x=t,this):this._x}function Y8(t){return t[1]}function X8(t){return arguments.length?(this._y=t,this):this._y}function ks(t,e,n){var r=new _f(e??z8,n??Y8,NaN,NaN,NaN,NaN);return t==null?r:r.addAll(t)}function _f(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function $y(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Ht=ks.prototype=_f.prototype;Ht.copy=function(){var t=new _f(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,r;if(!e)return t;if(!e.length)return t._root=$y(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var i=0;i<4;++i)(r=e.source[i])&&(r.length?n.push({source:r,target:e.target[i]=new Array(4)}):e.target[i]=$y(r));return t},Ht.add=D8,Ht.addAll=M8,Ht.cover=C8,Ht.data=L8,Ht.extent=k8,Ht.find=R8,Ht.remove=E8,Ht.removeAll=I8,Ht.root=B8,Ht.size=N8,Ht.visit=F8,Ht.visitAfter=O8,Ht.x=G8,Ht.y=X8;function kt(t){return function(){return t}}function Tn(t){return(t()-.5)*1e-6}function V8(t){return t.x+t.vx}function W8(t){return t.y+t.vy}function _y(t){var e,n,r,i=1,o=1;typeof t!="function"&&(t=kt(t==null?1:+t));function a(){for(var u,c=e.length,f,h,p,d,m,g,y=0;y<o;++y)for(f=ks(e,V8,W8).visitAfter(s),u=0;u<c;++u)h=e[u],m=n[h.index],g=m*m,p=h.x+h.vx,d=h.y+h.vy,f.visit(b);function b(v,x,_,S,A){var T=v.data,C=v.r,I=m+C;if(T){if(T.index>h.index){var $=p-T.x-T.vx,L=d-T.y-T.vy,P=$*$+L*L;P<I*I&&($===0&&($=Tn(r),P+=$*$),L===0&&(L=Tn(r),P+=L*L),P=(I-(P=Math.sqrt(P)))/P*i,h.vx+=($*=P)*(I=(C*=C)/(g+C)),h.vy+=(L*=P)*I,T.vx-=$*(I=1-I),T.vy-=L*I)}return}return x>p+I||S<p-I||_>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(e){var u,c=e.length,f;for(n=new Array(c),u=0;u<c;++u)f=e[u],n[f.index]=+t(f,u,e)}}return a.initialize=function(u,c){e=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?(t=typeof u=="function"?u:kt(+u),l(),a):t},a}function U8(t){return t.index}function wy(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function H8(t){var e=U8,n=f,r,i=kt(30),o,a,s,l,u,c=1;t==null&&(t=[]);function f(g){return 1/Math.min(s[g.source.index],s[g.target.index])}function h(g){for(var y=0,b=t.length;y<c;++y)for(var v=0,x,_,S,A,T,C,I;v<b;++v)x=t[v],_=x.source,S=x.target,A=S.x+S.vx-_.x-_.vx||Tn(u),T=S.y+S.vy-_.y-_.vy||Tn(u),C=Math.sqrt(A*A+T*T),C=(C-o[v])/C*g*r[v],A*=C,T*=C,S.vx-=A*(I=l[v]),S.vy-=T*I,_.vx+=A*(I=1-I),_.vy+=T*I}function p(){if(a){var g,y=a.length,b=t.length,v=new Map(a.map((_,S)=>[e(_,S,a),_])),x;for(g=0,s=new Array(y);g<b;++g)x=t[g],x.index=g,typeof x.source!="object"&&(x.source=wy(v,x.source)),typeof x.target!="object"&&(x.target=wy(v,x.target)),s[x.source.index]=(s[x.source.index]||0)+1,s[x.target.index]=(s[x.target.index]||0)+1;for(g=0,l=new Array(b);g<b;++g)x=t[g],l[g]=s[x.source.index]/(s[x.source.index]+s[x.target.index]);r=new Array(b),d(),o=new Array(b),m()}}function d(){if(a)for(var g=0,y=t.length;g<y;++g)r[g]=+n(t[g],g,t)}function m(){if(a)for(var g=0,y=t.length;g<y;++g)o[g]=+i(t[g],g,t)}return h.initialize=function(g,y){a=g,u=y,p()},h.links=function(g){return arguments.length?(t=g,p(),h):t},h.id=function(g){return arguments.length?(e=g,h):e},h.iterations=function(g){return arguments.length?(c=+g,h):c},h.strength=function(g){return arguments.length?(n=typeof g=="function"?g:kt(+g),d(),h):n},h.distance=function(g){return arguments.length?(i=typeof g=="function"?g:kt(+g),m(),h):i},h}const j8=1664525,q8=1013904223,Sy=4294967296;function Z8(){let t=1;return()=>(t=(j8*t+q8)%Sy)/Sy}function K8(t){return t.x}function Q8(t){return t.y}var J8=10,tL=Math.PI*(3-Math.sqrt(5));function Ay(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,l=xs(f),u=jn("tick","end"),c=Z8();t==null&&(t=[]);function f(){h(),u.call("tick",e),n<r&&(l.stop(),u.call("end",e))}function h(m){var g,y=t.length,b;m===void 0&&(m=1);for(var v=0;v<m;++v)for(n+=(o-n)*i,s.forEach(function(x){x(n)}),g=0;g<y;++g)b=t[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 e}function p(){for(var m=0,g=t.length,y;m<g;++m){if(y=t[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=J8*Math.sqrt(.5+m),v=m*tL;y.x=b*Math.cos(v),y.y=b*Math.sin(v)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function d(m){return m.initialize&&m.initialize(t,c),m}return p(),e={tick:h,restart:function(){return l.restart(f),e},stop:function(){return l.stop(),e},nodes:function(m){return arguments.length?(t=m,p(),s.forEach(d),e):t},alpha:function(m){return arguments.length?(n=+m,e):n},alphaMin:function(m){return arguments.length?(r=+m,e):r},alphaDecay:function(m){return arguments.length?(i=+m,e):+i},alphaTarget:function(m){return arguments.length?(o=+m,e):o},velocityDecay:function(m){return arguments.length?(a=1-m,e):1-a},randomSource:function(m){return arguments.length?(c=m,s.forEach(d),e):c},force:function(m,g){return arguments.length>1?(g==null?s.delete(m):s.set(m,d(g)),e):s.get(m)},find:function(m,g,y){var b=0,v=t.length,x,_,S,A,T;for(y==null?y=1/0:y*=y,b=0;b<v;++b)A=t[b],x=m-A.x,_=g-A.y,S=x*x+_*_,S<y&&(T=A,y=S);return T},on:function(m,g){return arguments.length>1?(u.on(m,g),e):u.on(m)}}}function Ty(){var t,e,n,r,i=kt(-30),o,a=1,s=1/0,l=.81;function u(p){var d,m=t.length,g=ks(t,K8,Q8).visitAfter(f);for(r=p,d=0;d<m;++d)e=t[d],g.visit(h)}function c(){if(t){var p,d=t.length,m;for(o=new Array(d),p=0;p<d;++p)m=t[p],o[m.index]=+i(m,p,t)}}function f(p){var d=0,m,g,y=0,b,v,x;if(p.length){for(b=v=x=0;x<4;++x)(m=p[x])&&(g=Math.abs(m.value))&&(d+=m.value,y+=g,b+=g*m.x,v+=g*m.y);p.x=b/y,p.y=v/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 h(p,d,m,g){if(!p.value)return!0;var y=p.x-e.x,b=p.y-e.y,v=g-d,x=y*y+b*b;if(v*v/l<x)return x<s&&(y===0&&(y=Tn(n),x+=y*y),b===0&&(b=Tn(n),x+=b*b),x<a&&(x=Math.sqrt(a*x)),e.vx+=y*p.value*r/x,e.vy+=b*p.value*r/x),!0;if(p.length||x>=s)return;(p.data!==e||p.next)&&(y===0&&(y=Tn(n),x+=y*y),b===0&&(b=Tn(n),x+=b*b),x<a&&(x=Math.sqrt(a*x)));do p.data!==e&&(v=o[p.data.index]*r/x,e.vx+=y*v,e.vy+=b*v);while(p=p.next)}return u.initialize=function(p,d){t=p,n=d,c()},u.strength=function(p){return arguments.length?(i=typeof p=="function"?p:kt(+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 eL(t,e,n){var r,i=kt(.1),o,a;typeof t!="function"&&(t=kt(+t)),e==null&&(e=0),n==null&&(n=0);function s(u){for(var c=0,f=r.length;c<f;++c){var h=r[c],p=h.x-e||1e-6,d=h.y-n||1e-6,m=Math.sqrt(p*p+d*d),g=(a[c]-m)*o[c]*u/m;h.vx+=p*g,h.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]=+t(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:kt(+u),l(),s):i},s.radius=function(u){return arguments.length?(t=typeof u=="function"?u:kt(+u),l(),s):t},s.x=function(u){return arguments.length?(e=+u,s):e},s.y=function(u){return arguments.length?(n=+u,s):n},s}function Py(t){var e=kt(.1),n,r,i;typeof t!="function"&&(t=kt(t==null?0:+t));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]=+t(n[s],s,n))?0:+e(n[s],s,n)}}return o.initialize=function(s){n=s,a()},o.strength=function(s){return arguments.length?(e=typeof s=="function"?s:kt(+s),a(),o):e},o.x=function(s){return arguments.length?(t=typeof s=="function"?s:kt(+s),a(),o):t},o}function Dy(t){var e=kt(.1),n,r,i;typeof t!="function"&&(t=kt(t==null?0:+t));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]=+t(n[s],s,n))?0:+e(n[s],s,n)}}return o.initialize=function(s){n=s,a()},o.strength=function(s){return arguments.length?(e=typeof s=="function"?s:kt(+s),a(),o):e},o.y=function(s){return arguments.length?(t=typeof s=="function"?s:kt(+s),a(),o):t},o}function nL(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Rs(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function si(t){return t=Rs(Math.abs(t)),t?t[1]:NaN}function rL(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[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=t[a=(a+1)%t.length];return o.reverse().join(e)}}function iL(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var oL=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function li(t){if(!(e=oL.exec(t)))throw new Error("invalid format: "+t);var e;return new Es({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}li.prototype=Es.prototype;function Es(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Es.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 aL(t){t:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var My;function sL(t,e){var n=Rs(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(My=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")+Rs(t,Math.max(0,e+o-1))[0]}function Cy(t,e){var n=Rs(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Ly={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:nL,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Cy(t*100,e),r:Cy,s:sL,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function ky(t){return t}var Ry=Array.prototype.map,Ey=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Iy(t){var e=t.grouping===void 0||t.thousands===void 0?ky:rL(Ry.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?ky:iL(Ry.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(f){f=li(f);var h=f.fill,p=f.align,d=f.sign,m=f.symbol,g=f.zero,y=f.width,b=f.comma,v=f.precision,x=f.trim,_=f.type;_==="n"?(b=!0,_="g"):Ly[_]||(v===void 0&&(v=12),x=!0,_="g"),(g||h==="0"&&p==="=")&&(g=!0,h="0",p="=");var S=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",A=m==="$"?r:/[%p]/.test(_)?a:"",T=Ly[_],C=/[defgprs%]/.test(_);v=v===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function I($){var L=S,P=A,w,M,D;if(_==="c")P=T($)+P,$="";else{$=+$;var X=$<0||1/$<0;if($=isNaN($)?l:T(Math.abs($),v),x&&($=aL($)),X&&+$==0&&d!=="+"&&(X=!1),L=(X?d==="("?d:s:d==="-"||d==="("?"":d)+L,P=(_==="s"?Ey[8+My/3]:"")+P+(X&&d==="("?")":""),C){for(w=-1,M=$.length;++w<M;)if(D=$.charCodeAt(w),48>D||D>57){P=(D===46?i+$.slice(w+1):$.slice(w))+P,$=$.slice(0,w);break}}}b&&!g&&($=e($,1/0));var O=L.length+$.length+P.length,E=O<y?new Array(y-O+1).join(h):"";switch(b&&g&&($=e(E+$,E.length?y-P.length:1/0),E=""),p){case"<":$=L+$+P+E;break;case"=":$=L+E+$+P;break;case"^":$=E.slice(0,O=E.length>>1)+L+$+P+E.slice(O);break;default:$=E+L+$+P;break}return o($)}return I.toString=function(){return f+""},I}function c(f,h){var p=u((f=li(f),f.type="f",f)),d=Math.max(-8,Math.min(8,Math.floor(si(h)/3)))*3,m=Math.pow(10,-d),g=Ey[8+d/3];return function(y){return p(m*y)+g}}return{format:u,formatPrefix:c}}var Is,bo,wf;By({thousands:",",grouping:[3],currency:["$",""]});function By(t){return Is=Iy(t),bo=Is.format,wf=Is.formatPrefix,Is}function Ny(t){return Math.max(0,-si(Math.abs(t)))}function Fy(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(si(e)/3)))*3-si(Math.abs(t)))}function Oy(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,si(e)-si(t))+1}var ot=1e-6,xo=1e-12,ht=Math.PI,Tt=ht/2,Bs=ht/4,jt=ht*2,vt=180/ht,at=ht/180,dt=Math.abs,ui=Math.atan,qt=Math.atan2,rt=Math.cos,Ns=Math.ceil,zy=Math.exp,Sf=Math.hypot,Fs=Math.log,Af=Math.pow,et=Math.sin,ye=Math.sign||function(t){return t>0?1:t<0?-1:0},Bt=Math.sqrt,Tf=Math.tan;function Gy(t){return t>1?0:t<-1?ht:Math.acos(t)}function Zt(t){return t>1?Tt:t<-1?-Tt:Math.asin(t)}function Yy(t){return(t=et(t/2))*t}function St(){}function Os(t,e){t&&Vy.hasOwnProperty(t.type)&&Vy[t.type](t,e)}var Xy={Feature:function(t,e){Os(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)Os(n[r].geometry,e)}},Vy={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Pf(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Pf(n[r],e,0)},Polygon:function(t,e){Wy(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Wy(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)Os(n[r],e)}};function Pf(t,e,n){var r=-1,i=t.length-n,o;for(e.lineStart();++r<i;)o=t[r],e.point(o[0],o[1],o[2]);e.lineEnd()}function Wy(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Pf(t[n],e,1);e.polygonEnd()}function ke(t,e){t&&Xy.hasOwnProperty(t.type)?Xy[t.type](t,e):Os(t,e)}var zs=new Lt,Gs=new Lt,Uy,Hy,Df,Mf,Cf,Ve={point:St,lineStart:St,lineEnd:St,polygonStart:function(){zs=new Lt,Ve.lineStart=lL,Ve.lineEnd=uL},polygonEnd:function(){var t=+zs;Gs.add(t<0?jt+t:t),this.lineStart=this.lineEnd=this.point=St},sphere:function(){Gs.add(jt)}};function lL(){Ve.point=cL}function uL(){jy(Uy,Hy)}function cL(t,e){Ve.point=jy,Uy=t,Hy=e,t*=at,e*=at,Df=t,Mf=rt(e=e/2+Bs),Cf=et(e)}function jy(t,e){t*=at,e*=at,e=e/2+Bs;var n=t-Df,r=n>=0?1:-1,i=r*n,o=rt(e),a=et(e),s=Cf*a,l=Mf*o+s*rt(i),u=s*r*et(i);zs.add(qt(u,l)),Df=t,Mf=o,Cf=a}function fL(t){return Gs=new Lt,ke(t,Ve),Gs*2}function Ys(t){return[qt(t[1],t[0]),Zt(t[2])]}function ur(t){var e=t[0],n=t[1],r=rt(n);return[r*rt(e),r*et(e),et(n)]}function Xs(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ci(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Lf(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Vs(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Ws(t){var e=Bt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var At,ae,Pt,he,cr,qy,Zy,fi,vo,Pn,an,sn={point:kf,lineStart:Qy,lineEnd:Jy,polygonStart:function(){sn.point=t1,sn.lineStart=hL,sn.lineEnd=pL,vo=new Lt,Ve.polygonStart()},polygonEnd:function(){Ve.polygonEnd(),sn.point=kf,sn.lineStart=Qy,sn.lineEnd=Jy,zs<0?(At=-(Pt=180),ae=-(he=90)):vo>ot?he=90:vo<-ot&&(ae=-90),an[0]=At,an[1]=Pt},sphere:function(){At=-(Pt=180),ae=-(he=90)}};function kf(t,e){Pn.push(an=[At=t,Pt=t]),e<ae&&(ae=e),e>he&&(he=e)}function Ky(t,e){var n=ur([t*at,e*at]);if(fi){var r=ci(fi,n),i=[r[1],-r[0],0],o=ci(i,r);Ws(o),o=Ys(o);var a=t-cr,s=a>0?1:-1,l=o[0]*vt*s,u,c=dt(a)>180;c^(s*cr<l&&l<s*t)?(u=o[1]*vt,u>he&&(he=u)):(l=(l+360)%360-180,c^(s*cr<l&&l<s*t)?(u=-o[1]*vt,u<ae&&(ae=u)):(e<ae&&(ae=e),e>he&&(he=e))),c?t<cr?pe(At,t)>pe(At,Pt)&&(Pt=t):pe(t,Pt)>pe(At,Pt)&&(At=t):Pt>=At?(t<At&&(At=t),t>Pt&&(Pt=t)):t>cr?pe(At,t)>pe(At,Pt)&&(Pt=t):pe(t,Pt)>pe(At,Pt)&&(At=t)}else Pn.push(an=[At=t,Pt=t]);e<ae&&(ae=e),e>he&&(he=e),fi=n,cr=t}function Qy(){sn.point=Ky}function Jy(){an[0]=At,an[1]=Pt,sn.point=kf,fi=null}function t1(t,e){if(fi){var n=t-cr;vo.add(dt(n)>180?n+(n>0?360:-360):n)}else qy=t,Zy=e;Ve.point(t,e),Ky(t,e)}function hL(){Ve.lineStart()}function pL(){t1(qy,Zy),Ve.lineEnd(),dt(vo)>ot&&(At=-(Pt=180)),an[0]=At,an[1]=Pt,fi=null}function pe(t,e){return(e-=t)<0?e+360:e}function dL(t,e){return t[0]-e[0]}function e1(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}function gL(t){var e,n,r,i,o,a,s;if(he=Pt=-(At=ae=1/0),Pn=[],ke(t,sn),n=Pn.length){for(Pn.sort(dL),e=1,r=Pn[0],o=[r];e<n;++e)i=Pn[e],e1(r,i[0])||e1(r,i[1])?(pe(r[0],i[1])>pe(r[0],r[1])&&(r[1]=i[1]),pe(i[0],r[1])>pe(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,n=o.length-1,e=0,r=o[n];e<=n;r=i,++e)i=o[e],(s=pe(r[1],i[0]))>a&&(a=s,At=i[0],Pt=r[1])}return Pn=an=null,At===1/0||ae===1/0?[[NaN,NaN],[NaN,NaN]]:[[At,ae],[Pt,he]]}var $o,Us,Hs,js,qs,Zs,Ks,Qs,Rf,Ef,If,n1,r1,Kt,Qt,Jt,Re={sphere:St,point:Bf,lineStart:i1,lineEnd:o1,polygonStart:function(){Re.lineStart=bL,Re.lineEnd=xL},polygonEnd:function(){Re.lineStart=i1,Re.lineEnd=o1}};function Bf(t,e){t*=at,e*=at;var n=rt(e);_o(n*rt(t),n*et(t),et(e))}function _o(t,e,n){++$o,Hs+=(t-Hs)/$o,js+=(e-js)/$o,qs+=(n-qs)/$o}function i1(){Re.point=mL}function mL(t,e){t*=at,e*=at;var n=rt(e);Kt=n*rt(t),Qt=n*et(t),Jt=et(e),Re.point=yL,_o(Kt,Qt,Jt)}function yL(t,e){t*=at,e*=at;var n=rt(e),r=n*rt(t),i=n*et(t),o=et(e),a=qt(Bt((a=Qt*o-Jt*i)*a+(a=Jt*r-Kt*o)*a+(a=Kt*i-Qt*r)*a),Kt*r+Qt*i+Jt*o);Us+=a,Zs+=a*(Kt+(Kt=r)),Ks+=a*(Qt+(Qt=i)),Qs+=a*(Jt+(Jt=o)),_o(Kt,Qt,Jt)}function o1(){Re.point=Bf}function bL(){Re.point=vL}function xL(){a1(n1,r1),Re.point=Bf}function vL(t,e){n1=t,r1=e,t*=at,e*=at,Re.point=a1;var n=rt(e);Kt=n*rt(t),Qt=n*et(t),Jt=et(e),_o(Kt,Qt,Jt)}function a1(t,e){t*=at,e*=at;var n=rt(e),r=n*rt(t),i=n*et(t),o=et(e),a=Qt*o-Jt*i,s=Jt*r-Kt*o,l=Kt*i-Qt*r,u=Sf(a,s,l),c=Zt(u),f=u&&-c/u;Rf.add(f*a),Ef.add(f*s),If.add(f*l),Us+=c,Zs+=c*(Kt+(Kt=r)),Ks+=c*(Qt+(Qt=i)),Qs+=c*(Jt+(Jt=o)),_o(Kt,Qt,Jt)}function $L(t){$o=Us=Hs=js=qs=Zs=Ks=Qs=0,Rf=new Lt,Ef=new Lt,If=new Lt,ke(t,Re);var e=+Rf,n=+Ef,r=+If,i=Sf(e,n,r);return i<xo&&(e=Zs,n=Ks,r=Qs,Us<ot&&(e=Hs,n=js,r=qs),i=Sf(e,n,r),i<xo)?[NaN,NaN]:[qt(n,e)*vt,Zt(r/i)*vt]}function hi(t){return function(){return t}}function Nf(t,e){function n(r,i){return r=t(r,i),e(r[0],r[1])}return t.invert&&e.invert&&(n.invert=function(r,i){return r=e.invert(r,i),r&&t.invert(r[0],r[1])}),n}function Ff(t,e){return dt(t)>ht&&(t-=Math.round(t/jt)*jt),[t,e]}Ff.invert=Ff;function Of(t,e,n){return(t%=jt)?e||n?Nf(l1(t),u1(e,n)):l1(t):e||n?u1(e,n):Ff}function s1(t){return function(e,n){return e+=t,dt(e)>ht&&(e-=Math.round(e/jt)*jt),[e,n]}}function l1(t){var e=s1(t);return e.invert=s1(-t),e}function u1(t,e){var n=rt(t),r=et(t),i=rt(e),o=et(e);function a(s,l){var u=rt(l),c=rt(s)*u,f=et(s)*u,h=et(l),p=h*n+c*r;return[qt(f*i-p*o,c*n-h*r),Zt(p*i+f*o)]}return a.invert=function(s,l){var u=rt(l),c=rt(s)*u,f=et(s)*u,h=et(l),p=h*i-f*o;return[qt(f*i+h*o,c*n+p*r),Zt(p*n-c*r)]},a}function c1(t){t=Of(t[0]*at,t[1]*at,t.length>2?t[2]*at:0);function e(n){return n=t(n[0]*at,n[1]*at),n[0]*=vt,n[1]*=vt,n}return e.invert=function(n){return n=t.invert(n[0]*at,n[1]*at),n[0]*=vt,n[1]*=vt,n},e}function f1(t,e,n,r,i,o){if(n){var a=rt(e),s=et(e),l=r*n;i==null?(i=e+r*jt,o=e-l/2):(i=h1(a,i),o=h1(a,o),(r>0?i<o:i>o)&&(i+=r*jt));for(var u,c=i;r>0?c>o:c<o;c-=l)u=Ys([a,-s*rt(c),-s*et(c)]),t.point(u[0],u[1])}}function h1(t,e){e=ur(e),e[0]-=t,Ws(e);var n=Gy(-e[1]);return((-e[2]<0?-n:n)+jt-ot)%jt}function _L(){var t=hi([0,0]),e=hi(90),n=hi(2),r,i,o={point:a};function a(l,u){r.push(l=i(l,u)),l[0]*=vt,l[1]*=vt}function s(){var l=t.apply(this,arguments),u=e.apply(this,arguments)*at,c=n.apply(this,arguments)*at;return r=[],i=Of(-l[0]*at,-l[1]*at,0).invert,f1(o,u,c,1),l={type:"Polygon",coordinates:[r]},r=i=null,l}return s.center=function(l){return arguments.length?(t=typeof l=="function"?l:hi([+l[0],+l[1]]),s):t},s.radius=function(l){return arguments.length?(e=typeof l=="function"?l:hi(+l),s):e},s.precision=function(l){return arguments.length?(n=typeof l=="function"?l:hi(+l),s):n},s}function p1(){var t=[],e;return{point:function(n,r,i){e.push([n,r,i])},lineStart:function(){t.push(e=[])},lineEnd:St,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function Js(t,e){return dt(t[0]-e[0])<ot&&dt(t[1]-e[1])<ot}function tl(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function d1(t,e,n,r,i){var o=[],a=[],s,l;if(t.forEach(function(d){if(!((m=d.length-1)<=0)){var m,g=d[0],y=d[m],b;if(Js(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*ot}o.push(b=new tl(g,d,null,!0)),a.push(b.o=new tl(g,null,b,!1)),o.push(b=new tl(y,d,null,!1)),a.push(b.o=new tl(y,null,b,!0))}}),!!o.length){for(a.sort(e),g1(o),g1(a),s=0,l=a.length;s<l;++s)a[s].e=n=!n;for(var u=o[0],c,f;;){for(var h=u,p=!0;h.v;)if((h=h.n)===u)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(s=0,l=c.length;s<l;++s)i.point((f=c[s])[0],f[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(p)for(c=h.p.z,s=c.length-1;s>=0;--s)i.point((f=c[s])[0],f[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,c=h.z,p=!p}while(!h.v);i.lineEnd()}}}function g1(t){if(e=t.length){for(var e,n=0,r=t[0],i;++n<e;)r.n=i=t[n],i.p=r,r=i;r.n=i=t[0],i.p=r}}function zf(t){return dt(t[0])<=ht?t[0]:ye(t[0])*((dt(t[0])+ht)%jt-ht)}function m1(t,e){var n=zf(e),r=e[1],i=et(r),o=[et(n),-rt(n),0],a=0,s=0,l=new Lt;i===1?r=Tt+ot:i===-1&&(r=-Tt-ot);for(var u=0,c=t.length;u<c;++u)if(h=(f=t[u]).length)for(var f,h,p=f[h-1],d=zf(p),m=p[1]/2+Bs,g=et(m),y=rt(m),b=0;b<h;++b,d=x,g=S,y=A,p=v){var v=f[b],x=zf(v),_=v[1]/2+Bs,S=et(_),A=rt(_),T=x-d,C=T>=0?1:-1,I=C*T,$=I>ht,L=g*S;if(l.add(qt(L*C*et(I),y*A+L*rt(I))),a+=$?T+C*jt:T,$^d>=n^x>=n){var P=ci(ur(p),ur(v));Ws(P);var w=ci(o,P);Ws(w);var M=($^T>=0?-1:1)*Zt(w[2]);(r>M||r===M&&(P[0]||P[1]))&&(s+=$^T>=0?1:-1)}}return(a<-ot||a<ot&&l<-xo)^s&1}function y1(t,e,n,r){return function(i){var o=e(i),a=p1(),s=e(a),l=!1,u,c,f,h={point:p,lineStart:m,lineEnd:g,polygonStart:function(){h.point=y,h.lineStart=b,h.lineEnd=v,c=[],u=[]},polygonEnd:function(){h.point=p,h.lineStart=m,h.lineEnd=g,c=pc(c);var x=m1(u,r);c.length?(l||(i.polygonStart(),l=!0),d1(c,SL,x,n,i)):x&&(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(x,_){t(x,_)&&i.point(x,_)}function d(x,_){o.point(x,_)}function m(){h.point=d,o.lineStart()}function g(){h.point=p,o.lineEnd()}function y(x,_){f.push([x,_]),s.point(x,_)}function b(){s.lineStart(),f=[]}function v(){y(f[0][0],f[0][1]),s.lineEnd();var x=s.clean(),_=a.result(),S,A=_.length,T,C,I;if(f.pop(),u.push(f),f=null,!!A){if(x&1){if(C=_[0],(T=C.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),S=0;S<T;++S)i.point((I=C[S])[0],I[1]);i.lineEnd()}return}A>1&&x&2&&_.push(_.pop().concat(_.shift())),c.push(_.filter(wL))}}return h}}function wL(t){return t.length>1}function SL(t,e){return((t=t.x)[0]<0?t[1]-Tt-ot:Tt-t[1])-((e=e.x)[0]<0?e[1]-Tt-ot:Tt-e[1])}const Gf=y1(function(){return!0},AL,PL,[-ht,-Tt]);function AL(t){var e=NaN,n=NaN,r=NaN,i;return{lineStart:function(){t.lineStart(),i=1},point:function(o,a){var s=o>0?ht:-ht,l=dt(o-e);dt(l-ht)<ot?(t.point(e,n=(n+a)/2>0?Tt:-Tt),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(o,n),i=0):r!==s&&l>=ht&&(dt(e-r)<ot&&(e-=r*ot),dt(o-s)<ot&&(o-=s*ot),n=TL(e,n,o,a),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(s,n),i=0),t.point(e=o,n=a),r=s},lineEnd:function(){t.lineEnd(),e=n=NaN},clean:function(){return 2-i}}}function TL(t,e,n,r){var i,o,a=et(t-n);return dt(a)>ot?ui((et(e)*(o=rt(r))*et(n)-et(r)*(i=rt(e))*et(t))/(i*o*a)):(e+r)/2}function PL(t,e,n,r){var i;if(t==null)i=n*Tt,r.point(-ht,i),r.point(0,i),r.point(ht,i),r.point(ht,0),r.point(ht,-i),r.point(0,-i),r.point(-ht,-i),r.point(-ht,0),r.point(-ht,i);else if(dt(t[0]-e[0])>ot){var o=t[0]<e[0]?ht:-ht;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}function b1(t){var e=rt(t),n=2*at,r=e>0,i=dt(e)>ot;function o(c,f,h,p){f1(p,t,n,h,c,f)}function a(c,f){return rt(c)*rt(f)>e}function s(c){var f,h,p,d,m;return{lineStart:function(){d=p=!1,m=1},point:function(g,y){var b=[g,y],v,x=a(g,y),_=r?x?0:u(g,y):x?u(g+(g<0?ht:-ht),y):0;if(!f&&(d=p=x)&&c.lineStart(),x!==p&&(v=l(f,b),(!v||Js(f,v)||Js(b,v))&&(b[2]=1)),x!==p)m=0,x?(c.lineStart(),v=l(b,f),c.point(v[0],v[1])):(v=l(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(i&&f&&r^x){var S;!(_&h)&&(S=l(b,f,!0))&&(m=0,r?(c.lineStart(),c.point(S[0][0],S[0][1]),c.point(S[1][0],S[1][1]),c.lineEnd()):(c.point(S[1][0],S[1][1]),c.lineEnd(),c.lineStart(),c.point(S[0][0],S[0][1],3)))}x&&(!f||!Js(f,b))&&c.point(b[0],b[1]),f=b,p=x,h=_},lineEnd:function(){p&&c.lineEnd(),f=null},clean:function(){return m|(d&&p)<<1}}}function l(c,f,h){var p=ur(c),d=ur(f),m=[1,0,0],g=ci(p,d),y=Xs(g,g),b=g[0],v=y-b*b;if(!v)return!h&&c;var x=e*y/v,_=-e*b/v,S=ci(m,g),A=Vs(m,x),T=Vs(g,_);Lf(A,T);var C=S,I=Xs(A,C),$=Xs(C,C),L=I*I-$*(Xs(A,A)-1);if(!(L<0)){var P=Bt(L),w=Vs(C,(-I-P)/$);if(Lf(w,A),w=Ys(w),!h)return w;var M=c[0],D=f[0],X=c[1],O=f[1],E;D<M&&(E=M,M=D,D=E);var N=D-M,R=dt(N-ht)<ot,F=R||N<ot;if(!R&&O<X&&(E=X,X=O,O=E),F?R?X+O>0^w[1]<(dt(w[0]-M)<ot?X:O):X<=w[1]&&w[1]<=O:N>ht^(M<=w[0]&&w[0]<=D)){var U=Vs(C,(-I+P)/$);return Lf(U,A),[w,Ys(U)]}}}function u(c,f){var h=r?t:ht-t,p=0;return c<-h?p|=1:c>h&&(p|=2),f<-h?p|=4:f>h&&(p|=8),p}return y1(a,s,o,r?[0,-t]:[-ht,t-ht])}function DL(t,e,n,r,i,o){var a=t[0],s=t[1],l=e[0],u=e[1],c=0,f=1,h=l-a,p=u-s,d;if(d=n-a,!(!h&&d>0)){if(d/=h,h<0){if(d<c)return;d<f&&(f=d)}else if(h>0){if(d>f)return;d>c&&(c=d)}if(d=i-a,!(!h&&d<0)){if(d/=h,h<0){if(d>f)return;d>c&&(c=d)}else if(h>0){if(d<c)return;d<f&&(f=d)}if(d=r-s,!(!p&&d>0)){if(d/=p,p<0){if(d<c)return;d<f&&(f=d)}else if(p>0){if(d>f)return;d>c&&(c=d)}if(d=o-s,!(!p&&d<0)){if(d/=p,p<0){if(d>f)return;d>c&&(c=d)}else if(p>0){if(d<c)return;d<f&&(f=d)}return c>0&&(t[0]=a+c*h,t[1]=s+c*p),f<1&&(e[0]=a+f*h,e[1]=s+f*p),!0}}}}}var wo=1e9,el=-wo;function nl(t,e,n,r){function i(u,c){return t<=u&&u<=n&&e<=c&&c<=r}function o(u,c,f,h){var p=0,d=0;if(u==null||(p=a(u,f))!==(d=a(c,f))||l(u,c)<0^f>0)do h.point(p===0||p===3?t:n,p>1?r:e);while((p=(p+f+4)%4)!==d);else h.point(c[0],c[1])}function a(u,c){return dt(u[0]-t)<ot?c>0?0:3:dt(u[0]-n)<ot?c>0?2:1:dt(u[1]-e)<ot?c>0?1:0:c>0?3:2}function s(u,c){return l(u.x,c.x)}function l(u,c){var f=a(u,1),h=a(c,1);return f!==h?f-h:f===0?c[1]-u[1]:f===1?u[0]-c[0]:f===2?u[1]-c[1]:c[0]-u[0]}return function(u){var c=u,f=p1(),h,p,d,m,g,y,b,v,x,_,S,A={point:T,lineStart:L,lineEnd:P,polygonStart:I,polygonEnd:$};function T(M,D){i(M,D)&&c.point(M,D)}function C(){for(var M=0,D=0,X=p.length;D<X;++D)for(var O=p[D],E=1,N=O.length,R=O[0],F,U,it=R[0],z=R[1];E<N;++E)F=it,U=z,R=O[E],it=R[0],z=R[1],U<=r?z>r&&(it-F)*(r-U)>(z-U)*(t-F)&&++M:z<=r&&(it-F)*(r-U)<(z-U)*(t-F)&&--M;return M}function I(){c=f,h=[],p=[],S=!0}function $(){var M=C(),D=S&&M,X=(h=pc(h)).length;(D||X)&&(u.polygonStart(),D&&(u.lineStart(),o(null,null,1,u),u.lineEnd()),X&&d1(h,s,M,o,u),u.polygonEnd()),c=u,h=p=d=null}function L(){A.point=w,p&&p.push(d=[]),_=!0,x=!1,b=v=NaN}function P(){h&&(w(m,g),y&&x&&f.rejoin(),h.push(f.result())),A.point=T,x&&c.lineEnd()}function w(M,D){var X=i(M,D);if(p&&d.push([M,D]),_)m=M,g=D,y=X,_=!1,X&&(c.lineStart(),c.point(M,D));else if(X&&x)c.point(M,D);else{var O=[b=Math.max(el,Math.min(wo,b)),v=Math.max(el,Math.min(wo,v))],E=[M=Math.max(el,Math.min(wo,M)),D=Math.max(el,Math.min(wo,D))];DL(O,E,t,e,n,r)?(x||(c.lineStart(),c.point(O[0],O[1])),c.point(E[0],E[1]),X||c.lineEnd(),S=!1):X&&(c.lineStart(),c.point(M,D),S=!1)}b=M,v=D,x=X}return A}}function ML(){var t=0,e=0,n=960,r=500,i,o,a;return a={stream:function(s){return i&&o===s?i:i=nl(t,e,n,r)(o=s)},extent:function(s){return arguments.length?(t=+s[0][0],e=+s[0][1],n=+s[1][0],r=+s[1][1],i=o=null,a):[[t,e],[n,r]]}}}var Yf,Xf,rl,il,pi={sphere:St,point:St,lineStart:CL,lineEnd:St,polygonStart:St,polygonEnd:St};function CL(){pi.point=kL,pi.lineEnd=LL}function LL(){pi.point=pi.lineEnd=St}function kL(t,e){t*=at,e*=at,Xf=t,rl=et(e),il=rt(e),pi.point=RL}function RL(t,e){t*=at,e*=at;var n=et(e),r=rt(e),i=dt(t-Xf),o=rt(i),a=et(i),s=r*a,l=il*n-rl*r*o,u=rl*n+il*r*o;Yf.add(qt(Bt(s*s+l*l),u)),Xf=t,rl=n,il=r}function x1(t){return Yf=new Lt,ke(t,pi),+Yf}var Vf=[null,null],EL={type:"LineString",coordinates:Vf};function ol(t,e){return Vf[0]=t,Vf[1]=e,x1(EL)}var v1={Feature:function(t,e){return al(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)if(al(n[r].geometry,e))return!0;return!1}},$1={Sphere:function(){return!0},Point:function(t,e){return _1(t.coordinates,e)},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(_1(n[r],e))return!0;return!1},LineString:function(t,e){return w1(t.coordinates,e)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(w1(n[r],e))return!0;return!1},Polygon:function(t,e){return S1(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(S1(n[r],e))return!0;return!1},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)if(al(n[r],e))return!0;return!1}};function al(t,e){return t&&$1.hasOwnProperty(t.type)?$1[t.type](t,e):!1}function _1(t,e){return ol(t,e)===0}function w1(t,e){for(var n,r,i,o=0,a=t.length;o<a;o++){if(r=ol(t[o],e),r===0||o>0&&(i=ol(t[o],t[o-1]),i>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<xo*i))return!0;n=r}return!1}function S1(t,e){return!!m1(t.map(IL),A1(e))}function IL(t){return t=t.map(A1),t.pop(),t}function A1(t){return[t[0]*at,t[1]*at]}function BL(t,e){return(t&&v1.hasOwnProperty(t.type)?v1[t.type]:al)(t,e)}function T1(t,e,n){var r=$n(t,e-ot,n).concat(e);return function(i){return r.map(function(o){return[i,o]})}}function P1(t,e,n){var r=$n(t,e-ot,n).concat(e);return function(i){return r.map(function(o){return[o,i]})}}function D1(){var t,e,n,r,i,o,a,s,l=10,u=l,c=90,f=360,h,p,d,m,g=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return $n(Ns(r/c)*c,n,c).map(d).concat($n(Ns(s/f)*f,a,f).map(m)).concat($n(Ns(e/l)*l,t,l).filter(function(v){return dt(v%c)>ot}).map(h)).concat($n(Ns(o/u)*u,i,u).filter(function(v){return dt(v%f)>ot}).map(p))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},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(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(r=+v[0][0],n=+v[1][0],s=+v[0][1],a=+v[1][1],r>n&&(v=r,r=n,n=v),s>a&&(v=s,s=a,a=v),y.precision(g)):[[r,s],[n,a]]},y.extentMinor=function(v){return arguments.length?(e=+v[0][0],t=+v[1][0],o=+v[0][1],i=+v[1][1],e>t&&(v=e,e=t,t=v),o>i&&(v=o,o=i,i=v),y.precision(g)):[[e,o],[t,i]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(l=+v[0],u=+v[1],y):[l,u]},y.precision=function(v){return arguments.length?(g=+v,h=T1(o,i,90),p=P1(e,t,g),d=T1(s,a,90),m=P1(r,n,g),y):g},y.extentMajor([[-180,-90+ot],[180,90-ot]]).extentMinor([[-180,-80-ot],[180,80+ot]])}function NL(){return D1()()}function FL(t,e){var n=t[0]*at,r=t[1]*at,i=e[0]*at,o=e[1]*at,a=rt(r),s=et(r),l=rt(o),u=et(o),c=a*rt(n),f=a*et(n),h=l*rt(i),p=l*et(i),d=2*Zt(Bt(Yy(o-r)+a*l*Yy(i-n))),m=et(d),g=d?function(y){var b=et(y*=d)/m,v=et(d-y)/m,x=v*c+b*h,_=v*f+b*p,S=v*s+b*u;return[qt(_,x)*vt,qt(S,Bt(x*x+_*_))*vt]}:function(){return[n*vt,r*vt]};return g.distance=d,g}const So=t=>t;var Wf=new Lt,Uf=new Lt,M1,C1,Hf,jf,ln={point:St,lineStart:St,lineEnd:St,polygonStart:function(){ln.lineStart=OL,ln.lineEnd=GL},polygonEnd:function(){ln.lineStart=ln.lineEnd=ln.point=St,Wf.add(dt(Uf)),Uf=new Lt},result:function(){var t=Wf/2;return Wf=new Lt,t}};function OL(){ln.point=zL}function zL(t,e){ln.point=L1,M1=Hf=t,C1=jf=e}function L1(t,e){Uf.add(jf*t-Hf*e),Hf=t,jf=e}function GL(){L1(M1,C1)}var di=1/0,sl=di,Ao=-di,ll=Ao,ul={point:YL,lineStart:St,lineEnd:St,polygonStart:St,polygonEnd:St,result:function(){var t=[[di,sl],[Ao,ll]];return Ao=ll=-(sl=di=1/0),t}};function YL(t,e){t<di&&(di=t),t>Ao&&(Ao=t),e<sl&&(sl=e),e>ll&&(ll=e)}var qf=0,Zf=0,To=0,cl=0,fl=0,gi=0,Kf=0,Qf=0,Po=0,k1,R1,We,Ue,be={point:fr,lineStart:E1,lineEnd:I1,polygonStart:function(){be.lineStart=WL,be.lineEnd=UL},polygonEnd:function(){be.point=fr,be.lineStart=E1,be.lineEnd=I1},result:function(){var t=Po?[Kf/Po,Qf/Po]:gi?[cl/gi,fl/gi]:To?[qf/To,Zf/To]:[NaN,NaN];return qf=Zf=To=cl=fl=gi=Kf=Qf=Po=0,t}};function fr(t,e){qf+=t,Zf+=e,++To}function E1(){be.point=XL}function XL(t,e){be.point=VL,fr(We=t,Ue=e)}function VL(t,e){var n=t-We,r=e-Ue,i=Bt(n*n+r*r);cl+=i*(We+t)/2,fl+=i*(Ue+e)/2,gi+=i,fr(We=t,Ue=e)}function I1(){be.point=fr}function WL(){be.point=HL}function UL(){B1(k1,R1)}function HL(t,e){be.point=B1,fr(k1=We=t,R1=Ue=e)}function B1(t,e){var n=t-We,r=e-Ue,i=Bt(n*n+r*r);cl+=i*(We+t)/2,fl+=i*(Ue+e)/2,gi+=i,i=Ue*t-We*e,Kf+=i*(We+t),Qf+=i*(Ue+e),Po+=i*3,fr(We=t,Ue=e)}function N1(t){this._context=t}N1.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,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(t,e){switch(this._point){case 0:{this._context.moveTo(t,e),this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,jt);break}}},result:St};var Jf=new Lt,th,F1,O1,Do,Mo,Co={point:St,lineStart:function(){Co.point=jL},lineEnd:function(){th&&z1(F1,O1),Co.point=St},polygonStart:function(){th=!0},polygonEnd:function(){th=null},result:function(){var t=+Jf;return Jf=new Lt,t}};function jL(t,e){Co.point=z1,F1=Do=t,O1=Mo=e}function z1(t,e){Do-=t,Mo-=e,Jf.add(Bt(Do*Do+Mo*Mo)),Do=t,Mo=e}let G1,hl,Y1,X1;class V1{constructor(e){this._append=e==null?W1:qL(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(e,n){switch(this._point){case 0:{this._append`M${e},${n}`,this._point=1;break}case 1:{this._append`L${e},${n}`;break}default:{if(this._append`M${e},${n}`,this._radius!==Y1||this._append!==hl){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`,Y1=r,hl=this._append,X1=this._,this._=i}this._+=X1;break}}}result(){const e=this._;return this._="",e.length?e:null}}function W1(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function qL(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return W1;if(e!==G1){const n=10**e;G1=e,hl=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 hl}function ZL(t,e){let n=3,r=4.5,i,o;function a(s){return s&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),ke(s,i(o))),o.result()}return a.area=function(s){return ke(s,i(ln)),ln.result()},a.measure=function(s){return ke(s,i(Co)),Co.result()},a.bounds=function(s){return ke(s,i(ul)),ul.result()},a.centroid=function(s){return ke(s,i(be)),be.result()},a.projection=function(s){return arguments.length?(i=s==null?(t=null,So):(t=s).stream,a):t},a.context=function(s){return arguments.length?(o=s==null?(e=null,new V1(n)):new N1(e=s),typeof r!="function"&&o.pointRadius(r),a):e},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 e===null&&(o=new V1(n)),a},a.projection(t).digits(n).context(e)}function KL(t){return{stream:Lo(t)}}function Lo(t){return function(e){var n=new eh;for(var r in t)n[r]=t[r];return n.stream=e,n}}function eh(){}eh.prototype={constructor:eh,point:function(t,e){this.stream.point(t,e)},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 nh(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),ke(n,t.stream(ul)),e(ul.result()),r!=null&&t.clipExtent(r),t}function pl(t,e,n){return nh(t,function(r){var i=e[1][0]-e[0][0],o=e[1][1]-e[0][1],a=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),s=+e[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+e[0][1]+(o-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([s,l])},n)}function rh(t,e,n){return pl(t,[[0,0],e],n)}function ih(t,e,n){return nh(t,function(r){var i=+e,o=i/(r[1][0]-r[0][0]),a=(i-o*(r[1][0]+r[0][0]))/2,s=-o*r[0][1];t.scale(150*o).translate([a,s])},n)}function oh(t,e,n){return nh(t,function(r){var i=+e,o=i/(r[1][1]-r[0][1]),a=-o*r[0][0],s=(i-o*(r[1][1]+r[0][1]))/2;t.scale(150*o).translate([a,s])},n)}var U1=16,QL=rt(30*at);function H1(t,e){return+e?t4(t,e):JL(t)}function JL(t){return Lo({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function t4(t,e){function n(r,i,o,a,s,l,u,c,f,h,p,d,m,g){var y=u-r,b=c-i,v=y*y+b*b;if(v>4*e&&m--){var x=a+h,_=s+p,S=l+d,A=Bt(x*x+_*_+S*S),T=Zt(S/=A),C=dt(dt(S)-1)<ot||dt(o-f)<ot?(o+f)/2:qt(_,x),I=t(C,T),$=I[0],L=I[1],P=$-r,w=L-i,M=b*P-y*w;(M*M/v>e||dt((y*P+b*w)/v-.5)>.3||a*h+s*p+l*d<QL)&&(n(r,i,o,a,s,l,$,L,C,x/=A,_/=A,S,m,g),g.point($,L),n($,L,C,x,_,S,u,c,f,h,p,d,m,g))}}return function(r){var i,o,a,s,l,u,c,f,h,p,d,m,g={point:y,lineStart:b,lineEnd:x,polygonStart:function(){r.polygonStart(),g.lineStart=_},polygonEnd:function(){r.polygonEnd(),g.lineStart=b}};function y(T,C){T=t(T,C),r.point(T[0],T[1])}function b(){f=NaN,g.point=v,r.lineStart()}function v(T,C){var I=ur([T,C]),$=t(T,C);n(f,h,c,p,d,m,f=$[0],h=$[1],c=T,p=I[0],d=I[1],m=I[2],U1,r),r.point(f,h)}function x(){g.point=y,r.lineEnd()}function _(){b(),g.point=S,g.lineEnd=A}function S(T,C){v(i=T,C),o=f,a=h,s=p,l=d,u=m,g.point=v}function A(){n(f,h,c,p,d,m,o,a,i,s,l,u,U1,r),g.lineEnd=x,x()}return g}}var e4=Lo({point:function(t,e){this.stream.point(t*at,e*at)}});function n4(t){return Lo({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}function r4(t,e,n,r,i){function o(a,s){return a*=r,s*=i,[e+t*a,n-t*s]}return o.invert=function(a,s){return[(a-e)/t*r,(n-s)/t*i]},o}function j1(t,e,n,r,i,o){if(!o)return r4(t,e,n,r,i);var a=rt(o),s=et(o),l=a*t,u=s*t,c=a/t,f=s/t,h=(s*n-a*e)/t,p=(s*e+a*n)/t;function d(m,g){return m*=r,g*=i,[l*m-u*g+e,n-u*m-l*g]}return d.invert=function(m,g){return[r*(c*m-f*g+h),i*(p-f*m-c*g)]},d}function He(t){return ah(function(){return t})()}function ah(t){var e,n=150,r=480,i=250,o=0,a=0,s=0,l=0,u=0,c,f=0,h=1,p=1,d=null,m=Gf,g=null,y,b,v,x=So,_=.5,S,A,T,C,I;function $(M){return T(M[0]*at,M[1]*at)}function L(M){return M=T.invert(M[0],M[1]),M&&[M[0]*vt,M[1]*vt]}$.stream=function(M){return C&&I===M?C:C=e4(n4(c)(m(S(x(I=M)))))},$.preclip=function(M){return arguments.length?(m=M,d=void 0,w()):m},$.postclip=function(M){return arguments.length?(x=M,g=y=b=v=null,w()):x},$.clipAngle=function(M){return arguments.length?(m=+M?b1(d=M*at):(d=null,Gf),w()):d*vt},$.clipExtent=function(M){return arguments.length?(x=M==null?(g=y=b=v=null,So):nl(g=+M[0][0],y=+M[0][1],b=+M[1][0],v=+M[1][1]),w()):g==null?null:[[g,y],[b,v]]},$.scale=function(M){return arguments.length?(n=+M,P()):n},$.translate=function(M){return arguments.length?(r=+M[0],i=+M[1],P()):[r,i]},$.center=function(M){return arguments.length?(o=M[0]%360*at,a=M[1]%360*at,P()):[o*vt,a*vt]},$.rotate=function(M){return arguments.length?(s=M[0]%360*at,l=M[1]%360*at,u=M.length>2?M[2]%360*at:0,P()):[s*vt,l*vt,u*vt]},$.angle=function(M){return arguments.length?(f=M%360*at,P()):f*vt},$.reflectX=function(M){return arguments.length?(h=M?-1:1,P()):h<0},$.reflectY=function(M){return arguments.length?(p=M?-1:1,P()):p<0},$.precision=function(M){return arguments.length?(S=H1(A,_=M*M),w()):Bt(_)},$.fitExtent=function(M,D){return pl($,M,D)},$.fitSize=function(M,D){return rh($,M,D)},$.fitWidth=function(M,D){return ih($,M,D)},$.fitHeight=function(M,D){return oh($,M,D)};function P(){var M=j1(n,0,0,h,p,f).apply(null,e(o,a)),D=j1(n,r-M[0],i-M[1],h,p,f);return c=Of(s,l,u),A=Nf(e,D),T=Nf(c,A),S=H1(A,_),w()}function w(){return C=I=null,$}return function(){return e=t.apply(this,arguments),$.invert=e.invert&&L,P()}}function sh(t){var e=0,n=ht/3,r=ah(t),i=r(e,n);return i.parallels=function(o){return arguments.length?r(e=o[0]*at,n=o[1]*at):[e*vt,n*vt]},i}function i4(t){var e=rt(t);function n(r,i){return[r*e,et(i)/e]}return n.invert=function(r,i){return[r/e,Zt(i*e)]},n}function q1(t,e){var n=et(t),r=(n+et(e))/2;if(dt(r)<ot)return i4(t);var i=1+n*(2*r-n),o=Bt(i)/r;function a(s,l){var u=Bt(i-2*r*et(l))/r;return[u*et(s*=r),o-u*rt(s)]}return a.invert=function(s,l){var u=o-l,c=qt(s,dt(u))*ye(u);return u*r<0&&(c-=ht*ye(s)*ye(u)),[c/r,Zt((i-(s*s+u*u)*r*r)/(2*r))]},a}function dl(){return sh(q1).scale(155.424).center([0,33.6442])}function Z1(){return dl().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function o4(t){var e=t.length;return{point:function(n,r){for(var i=-1;++i<e;)t[i].point(n,r)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}function a4(){var t,e,n=Z1(),r,i=dl().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,a=dl().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s,l,u={point:function(h,p){l=[h,p]}};function c(h){var p=h[0],d=h[1];return l=null,r.point(p,d),l||(o.point(p,d),l)||(s.point(p,d),l)}c.invert=function(h){var p=n.scale(),d=n.translate(),m=(h[0]-d[0])/p,g=(h[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(h)},c.stream=function(h){return t&&e===h?t:t=o4([n.stream(e=h),i.stream(h),a.stream(h)])},c.precision=function(h){return arguments.length?(n.precision(h),i.precision(h),a.precision(h),f()):n.precision()},c.scale=function(h){return arguments.length?(n.scale(h),i.scale(h*.35),a.scale(h),c.translate(n.translate())):n.scale()},c.translate=function(h){if(!arguments.length)return n.translate();var p=n.scale(),d=+h[0],m=+h[1];return r=n.translate(h).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+ot,m+.12*p+ot],[d-.214*p-ot,m+.234*p-ot]]).stream(u),s=a.translate([d-.205*p,m+.212*p]).clipExtent([[d-.214*p+ot,m+.166*p+ot],[d-.115*p-ot,m+.234*p-ot]]).stream(u),f()},c.fitExtent=function(h,p){return pl(c,h,p)},c.fitSize=function(h,p){return rh(c,h,p)},c.fitWidth=function(h,p){return ih(c,h,p)},c.fitHeight=function(h,p){return oh(c,h,p)};function f(){return t=e=null,c}return c.scale(1070)}function K1(t){return function(e,n){var r=rt(e),i=rt(n),o=t(r*i);return o===1/0?[2,0]:[o*i*et(e),o*et(n)]}}function ko(t){return function(e,n){var r=Bt(e*e+n*n),i=t(r),o=et(i),a=rt(i);return[qt(e*o,r*a),Zt(r&&n*o/r)]}}var lh=K1(function(t){return Bt(2/(1+t))});lh.invert=ko(function(t){return 2*Zt(t/2)});function s4(){return He(lh).scale(124.75).clipAngle(180-.001)}var uh=K1(function(t){return(t=Gy(t))&&t/et(t)});uh.invert=ko(function(t){return t});function l4(){return He(uh).scale(79.4188).clipAngle(180-.001)}function Ro(t,e){return[t,Fs(Tf((Tt+e)/2))]}Ro.invert=function(t,e){return[t,2*ui(zy(e))-Tt]};function u4(){return Q1(Ro).scale(961/jt)}function Q1(t){var e=He(t),n=e.center,r=e.scale,i=e.translate,o=e.clipExtent,a=null,s,l,u;e.scale=function(f){return arguments.length?(r(f),c()):r()},e.translate=function(f){return arguments.length?(i(f),c()):i()},e.center=function(f){return arguments.length?(n(f),c()):n()},e.clipExtent=function(f){return arguments.length?(f==null?a=s=l=u=null:(a=+f[0][0],s=+f[0][1],l=+f[1][0],u=+f[1][1]),c()):a==null?null:[[a,s],[l,u]]};function c(){var f=ht*r(),h=e(c1(e.rotate()).invert([0,0]));return o(a==null?[[h[0]-f,h[1]-f],[h[0]+f,h[1]+f]]:t===Ro?[[Math.max(h[0]-f,a),s],[Math.min(h[0]+f,l),u]]:[[a,Math.max(h[1]-f,s)],[l,Math.min(h[1]+f,u)]])}return c()}function gl(t){return Tf((Tt+t)/2)}function J1(t,e){var n=rt(t),r=t===e?et(t):Fs(n/rt(e))/Fs(gl(e)/gl(t)),i=n*Af(gl(t),r)/r;if(!r)return Ro;function o(a,s){i>0?s<-Tt+ot&&(s=-Tt+ot):s>Tt-ot&&(s=Tt-ot);var l=i/Af(gl(s),r);return[l*et(r*a),i-l*rt(r*a)]}return o.invert=function(a,s){var l=i-s,u=ye(r)*Bt(a*a+l*l),c=qt(a,dt(l))*ye(l);return l*r<0&&(c-=ht*ye(a)*ye(l)),[c/r,2*ui(Af(i/u,1/r))-Tt]},o}function c4(){return sh(J1).scale(109.5).parallels([30,30])}function Eo(t,e){return[t,e]}Eo.invert=Eo;function f4(){return He(Eo).scale(152.63)}function tb(t,e){var n=rt(t),r=t===e?et(t):(n-rt(e))/(e-t),i=n/r+t;if(dt(r)<ot)return Eo;function o(a,s){var l=i-s,u=r*a;return[l*et(u),i-l*rt(u)]}return o.invert=function(a,s){var l=i-s,u=qt(a,dt(l))*ye(l);return l*r<0&&(u-=ht*ye(a)*ye(l)),[u/r,i-ye(r)*Bt(a*a+l*l)]},o}function h4(){return sh(tb).scale(131.154).center([0,13.9389])}var Io=1.340264,Bo=-.081106,No=893e-6,Fo=.003796,ml=Bt(3)/2,p4=12;function ch(t,e){var n=Zt(ml*et(e)),r=n*n,i=r*r*r;return[t*rt(n)/(ml*(Io+3*Bo*r+i*(7*No+9*Fo*r))),n*(Io+Bo*r+i*(No+Fo*r))]}ch.invert=function(t,e){for(var n=e,r=n*n,i=r*r*r,o=0,a,s,l;o<p4&&(s=n*(Io+Bo*r+i*(No+Fo*r))-e,l=Io+3*Bo*r+i*(7*No+9*Fo*r),n-=a=s/l,r=n*n,i=r*r*r,!(dt(a)<xo));++o);return[ml*t*(Io+3*Bo*r+i*(7*No+9*Fo*r))/rt(n),Zt(et(n)/ml)]};function d4(){return He(ch).scale(177.158)}function fh(t,e){var n=rt(e),r=rt(t)*n;return[n*et(t)/r,et(e)/r]}fh.invert=ko(ui);function g4(){return He(fh).scale(144.049).clipAngle(60)}function m4(){var t=1,e=0,n=0,r=1,i=1,o=0,a,s,l=null,u,c,f,h=1,p=1,d=Lo({point:function(x,_){var S=v([x,_]);this.stream.point(S[0],S[1])}}),m=So,g,y;function b(){return h=t*r,p=t*i,g=y=null,v}function v(x){var _=x[0]*h,S=x[1]*p;if(o){var A=S*a-_*s;_=_*a+S*s,S=A}return[_+e,S+n]}return v.invert=function(x){var _=x[0]-e,S=x[1]-n;if(o){var A=S*a+_*s;_=_*a-S*s,S=A}return[_/h,S/p]},v.stream=function(x){return g&&y===x?g:g=d(m(y=x))},v.postclip=function(x){return arguments.length?(m=x,l=u=c=f=null,b()):m},v.clipExtent=function(x){return arguments.length?(m=x==null?(l=u=c=f=null,So):nl(l=+x[0][0],u=+x[0][1],c=+x[1][0],f=+x[1][1]),b()):l==null?null:[[l,u],[c,f]]},v.scale=function(x){return arguments.length?(t=+x,b()):t},v.translate=function(x){return arguments.length?(e=+x[0],n=+x[1],b()):[e,n]},v.angle=function(x){return arguments.length?(o=x%360*at,s=et(o),a=rt(o),b()):o*vt},v.reflectX=function(x){return arguments.length?(r=x?-1:1,b()):r<0},v.reflectY=function(x){return arguments.length?(i=x?-1:1,b()):i<0},v.fitExtent=function(x,_){return pl(v,x,_)},v.fitSize=function(x,_){return rh(v,x,_)},v.fitWidth=function(x,_){return ih(v,x,_)},v.fitHeight=function(x,_){return oh(v,x,_)},v}function hh(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),e*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}hh.invert=function(t,e){var n=e,r=25,i;do{var o=n*n,a=o*o;n-=i=(n*(1.007226+o*(.015085+a*(-.044475+.028874*o-.005916*a)))-e)/(1.007226+o*(.015085*3+a*(-.044475*7+.028874*9*o-.005916*11*a)))}while(dt(i)>ot&&--r>0);return[t/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function y4(){return He(hh).scale(175.295)}function ph(t,e){return[rt(e)*et(t),et(e)]}ph.invert=ko(Zt);function b4(){return He(ph).scale(249.5).clipAngle(90+ot)}function dh(t,e){var n=rt(e),r=1+rt(t)*n;return[n*et(t)/r,et(e)/r]}dh.invert=ko(function(t){return 2*ui(t)});function x4(){return He(dh).scale(250).clipAngle(142)}function gh(t,e){return[Fs(Tf((Tt+e)/2)),-t]}gh.invert=function(t,e){return[-e,2*ui(zy(t))-Tt]};function v4(){var t=Q1(gh),e=t.center,n=t.rotate;return t.center=function(r){return arguments.length?e([-r[1],r[0]]):(r=e(),[r[1],-r[0]])},t.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 $4(t,e){return t.parent===e.parent?1:2}function _4(t){return t.reduce(w4,0)/t.length}function w4(t,e){return t+e.x}function S4(t){return 1+t.reduce(A4,0)}function A4(t,e){return Math.max(t,e.y)}function T4(t){for(var e;e=t.children;)t=e[0];return t}function P4(t){for(var e;e=t.children;)t=e[e.length-1];return t}function D4(){var t=$4,e=1,n=1,r=!1;function i(o){var a,s=0;o.eachAfter(function(h){var p=h.children;p?(h.x=_4(p),h.y=S4(p)):(h.x=a?s+=t(h,a):0,h.y=0,a=h)});var l=T4(o),u=P4(o),c=l.x-t(l,u)/2,f=u.x+t(u,l)/2;return o.eachAfter(r?function(h){h.x=(h.x-o.x)*e,h.y=(o.y-h.y)*n}:function(h){h.x=(h.x-c)/(f-c)*e,h.y=(1-(o.y?h.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(t=o,i):t},i.size=function(o){return arguments.length?(r=!1,e=+o[0],n=+o[1],i):r?null:[e,n]},i.nodeSize=function(o){return arguments.length?(r=!0,e=+o[0],n=+o[1],i):r?[e,n]:null},i}function M4(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function C4(){return this.eachAfter(M4)}function L4(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this}function k4(t,e){for(var n=this,r=[n],i,o,a=-1;n=r.pop();)if(t.call(e,n,++a,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function R4(t,e){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();)t.call(e,n,++l,this);return this}function E4(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r}function I4(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})}function B4(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function N4(t){for(var e=this,n=F4(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r}function F4(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}function O4(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function z4(){return Array.from(this)}function G4(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function Y4(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*X4(){var t=this,e,n=[t],r,i,o;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(i=0,o=r.length;i<o;++i)n.push(r[i]);while(n.length)}function yl(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=U4)):e===void 0&&(e=W4);for(var n=new hr(t),r,i=[n],o,a,s,l;r=i.pop();)if((a=e(r.data))&&(l=(a=Array.from(a)).length))for(r.children=a,s=l-1;s>=0;--s)i.push(o=a[s]=new hr(a[s])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(eb)}function V4(){return yl(this).eachBefore(H4)}function W4(t){return t.children}function U4(t){return Array.isArray(t)?t[1]:null}function H4(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function eb(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function hr(t){this.data=t,this.depth=this.height=0,this.parent=null}hr.prototype=yl.prototype={constructor:hr,count:C4,each:L4,eachAfter:R4,eachBefore:k4,find:E4,sum:I4,sort:B4,path:N4,ancestors:O4,descendants:z4,leaves:G4,links:Y4,copy:V4,[Symbol.iterator]:X4};function bl(t){return t==null?null:nb(t)}function nb(t){if(typeof t!="function")throw new Error;return t}function pr(){return 0}function mi(t){return function(){return t}}const j4=1664525,q4=1013904223,rb=4294967296;function mh(){let t=1;return()=>(t=(j4*t+q4)%rb)/rb}function Z4(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function K4(t,e){let n=t.length,r,i;for(;n;)i=e()*n--|0,r=t[n],t[n]=t[i],t[i]=r;return t}function Q4(t){return ib(t,mh())}function ib(t,e){for(var n=0,r=(t=K4(Array.from(t),e)).length,i=[],o,a;n<r;)o=t[n],a&&ob(a,o)?++n:(a=t7(i=J4(i,o)),n=0);return a}function J4(t,e){var n,r;if(yh(e,t))return[e];for(n=0;n<t.length;++n)if(xl(e,t[n])&&yh(Oo(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(xl(Oo(t[n],t[r]),e)&&xl(Oo(t[n],e),t[r])&&xl(Oo(t[r],e),t[n])&&yh(ab(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function xl(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function ob(t,e){var n=t.r-e.r+Math.max(t.r,e.r,1)*1e-9,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function yh(t,e){for(var n=0;n<e.length;++n)if(!ob(t,e[n]))return!1;return!0}function t7(t){switch(t.length){case 1:return e7(t[0]);case 2:return Oo(t[0],t[1]);case 3:return ab(t[0],t[1],t[2])}}function e7(t){return{x:t.x,y:t.y,r:t.r}}function Oo(t,e){var n=t.x,r=t.y,i=t.r,o=e.x,a=e.y,s=e.r,l=o-n,u=a-r,c=s-i,f=Math.sqrt(l*l+u*u);return{x:(n+o+l/f*c)/2,y:(r+a+u/f*c)/2,r:(f+i+s)/2}}function ab(t,e,n){var r=t.x,i=t.y,o=t.r,a=e.x,s=e.y,l=e.r,u=n.x,c=n.y,f=n.r,h=r-a,p=r-u,d=i-s,m=i-c,g=l-o,y=f-o,b=r*r+i*i-o*o,v=b-a*a-s*s+l*l,x=b-u*u-c*c+f*f,_=p*d-h*m,S=(d*x-m*v)/(_*2)-r,A=(m*g-d*y)/_,T=(p*v-h*x)/(_*2)-i,C=(h*y-p*g)/_,I=A*A+C*C-1,$=2*(o+S*A+T*C),L=S*S+T*T-o*o,P=-(Math.abs(I)>1e-6?($+Math.sqrt($*$-4*I*L))/(2*I):L/$);return{x:r+S+A*P,y:i+T+C*P,r:P}}function sb(t,e,n){var r=t.x-e.x,i,o,a=t.y-e.y,s,l,u=r*r+a*a;u?(o=e.r+n.r,o*=o,l=t.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=t.x-i*r-s*a,n.y=t.y-i*a+s*r):(i=(u+o-l)/(2*u),s=Math.sqrt(Math.max(0,o/u-i*i)),n.x=e.x+i*r-s*a,n.y=e.y+i*a+s*r)):(n.x=e.x+n.r,n.y=e.y)}function lb(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function ub(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function vl(t){this._=t,this.next=null,this.previous=null}function cb(t,e){if(!(o=(t=Z4(t)).length))return 0;var n,r,i,o,a,s,l,u,c,f,h;if(n=t[0],n.x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;sb(r,n,i=t[2]),n=new vl(n),r=new vl(r),i=new vl(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<o;++l){sb(n._,r._,i=t[l]),i=new vl(i),u=r.next,c=n.previous,f=r._.r,h=n._.r;do if(f<=h){if(lb(u._,i._)){r=u,n.next=r,r.previous=n,--l;continue t}f+=u._.r,u=u.next}else{if(lb(c._,i._)){n=c,n.next=r,r.previous=n,--l;continue t}h+=c._.r,c=c.previous}while(u!==c.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=ub(n);(i=i.next)!==r;)(s=ub(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=ib(n,e),l=0;l<o;++l)n=t[l],n.x-=i.x,n.y-=i.y;return i.r}function n7(t){return cb(t,mh()),t}function r7(t){return Math.sqrt(t.value)}function i7(){var t=null,e=1,n=1,r=pr;function i(o){const a=mh();return o.x=e/2,o.y=n/2,t?o.eachBefore(fb(t)).eachAfter(bh(r,.5,a)).eachBefore(hb(1)):o.eachBefore(fb(r7)).eachAfter(bh(pr,1,a)).eachAfter(bh(r,o.r/Math.min(e,n),a)).eachBefore(hb(Math.min(e,n)/(2*o.r))),o}return i.radius=function(o){return arguments.length?(t=bl(o),i):t},i.size=function(o){return arguments.length?(e=+o[0],n=+o[1],i):[e,n]},i.padding=function(o){return arguments.length?(r=typeof o=="function"?o:mi(+o),i):r},i}function fb(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function bh(t,e,n){return function(r){if(i=r.children){var i,o,a=i.length,s=t(r)*e||0,l;if(s)for(o=0;o<a;++o)i[o].r+=s;if(l=cb(i,n),s)for(o=0;o<a;++o)i[o].r-=s;r.r=l+s}}}function hb(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}function pb(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function zo(t,e,n,r,i){for(var o=t.children,a,s=-1,l=o.length,u=t.value&&(r-e)/t.value;++s<l;)a=o[s],a.y0=n,a.y1=i,a.x0=e,a.x1=e+=a.value*u}function o7(){var t=1,e=1,n=0,r=!1;function i(a){var s=a.height+1;return a.x0=a.y0=n,a.x1=t,a.y1=e/s,a.eachBefore(o(e,s)),r&&a.eachBefore(pb),a}function o(a,s){return function(l){l.children&&zo(l,l.x0,a*(l.depth+1)/s,l.x1,a*(l.depth+2)/s);var u=l.x0,c=l.y0,f=l.x1-n,h=l.y1-n;f<u&&(u=f=(u+f)/2),h<c&&(c=h=(c+h)/2),l.x0=u,l.y0=c,l.x1=f,l.y1=h}}return i.round=function(a){return arguments.length?(r=!!a,i):r},i.size=function(a){return arguments.length?(t=+a[0],e=+a[1],i):[t,e]},i.padding=function(a){return arguments.length?(n=+a,i):n},i}var a7={depth:-1},db={},xh={};function s7(t){return t.id}function l7(t){return t.parentId}function u7(){var t=s7,e=l7,n;function r(i){var o=Array.from(i),a=t,s=e,l,u,c,f,h,p,d,m,g=new Map;if(n!=null){const y=o.map((x,_)=>c7(n(x,_,i))),b=y.map(gb),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(gb(x)),o.push(xh));a=(x,_)=>y[_],s=(x,_)=>b[_]}for(c=0,l=o.length;c<l;++c)u=o[c],p=o[c]=new hr(u),(d=a(u,c,i))!=null&&(d+="")&&(m=p.id=d,g.set(m,g.has(m)?db: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(h=g.get(d),!h)throw new Error("missing: "+d);if(h===db)throw new Error("ambiguous: "+d);h.children?h.children.push(p):h.children=[p],p.parent=h}else{if(f)throw new Error("multiple roots");f=p}if(!f)throw new Error("no root");if(n!=null){for(;f.data===xh&&f.children.length===1;)f=f.children[0],--l;for(let y=o.length-1;y>=0&&(p=o[y],p.data===xh);--y)p.data=null}if(f.parent=a7,f.eachBefore(function(y){y.depth=y.parent.depth+1,--l}).eachBefore(eb),f.parent=null,l>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(t=bl(i),r):t},r.parentId=function(i){return arguments.length?(e=bl(i),r):e},r.path=function(i){return arguments.length?(n=bl(i),r):n},r}function c7(t){t=`${t}`;let e=t.length;return vh(t,e-1)&&!vh(t,e-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:`/${t}`}function gb(t){let e=t.length;if(e<2)return"";for(;--e>1&&!vh(t,e););return t.slice(0,e)}function vh(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}function f7(t,e){return t.parent===e.parent?1:2}function $h(t){var e=t.children;return e?e[0]:t.t}function _h(t){var e=t.children;return e?e[e.length-1]:t.t}function h7(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function p7(t){for(var e=0,n=0,r=t.children,i=r.length,o;--i>=0;)o=r[i],o.z+=e,o.m+=e,e+=o.s+(n+=o.c)}function d7(t,e,n){return t.a.parent===e.parent?t.a:n}function $l(t,e){this._=t,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=e}$l.prototype=Object.create(hr.prototype);function g7(t){for(var e=new $l(t,0),n,r=[e],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 $l(o[a],a)),i.parent=n;return(e.parent=new $l(null,0)).children=[e],e}function m7(){var t=f7,e=1,n=1,r=null;function i(u){var c=g7(u);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)u.eachBefore(l);else{var f=u,h=u,p=u;u.eachBefore(function(b){b.x<f.x&&(f=b),b.x>h.x&&(h=b),b.depth>p.depth&&(p=b)});var d=f===h?1:t(f,h)/2,m=d-f.x,g=e/(h.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,f=u.parent.children,h=u.i?f[u.i-1]:null;if(c){p7(u);var p=(c[0].z+c[c.length-1].z)/2;h?(u.z=h.z+t(u._,h._),u.m=u.z-p):u.z=p}else h&&(u.z=h.z+t(u._,h._));u.parent.A=s(u,h,u.parent.A||f[0])}function a(u){u._.x=u.z+u.parent.m,u.m+=u.parent.m}function s(u,c,f){if(c){for(var h=u,p=u,d=c,m=h.parent.children[0],g=h.m,y=p.m,b=d.m,v=m.m,x;d=_h(d),h=$h(h),d&&h;)m=$h(m),p=_h(p),p.a=u,x=d.z+b-h.z-g+t(d._,h._),x>0&&(h7(d7(d,u,f),u,x),g+=x,y+=x),b+=d.m,g+=h.m,v+=m.m,y+=p.m;d&&!_h(p)&&(p.t=d,p.m+=b-y),h&&!$h(m)&&(m.t=h,m.m+=g-v,f=u)}return f}function l(u){u.x*=e,u.y=u.depth*n}return i.separation=function(u){return arguments.length?(t=u,i):t},i.size=function(u){return arguments.length?(r=!1,e=+u[0],n=+u[1],i):r?null:[e,n]},i.nodeSize=function(u){return arguments.length?(r=!0,e=+u[0],n=+u[1],i):r?[e,n]:null},i}function _l(t,e,n,r,i){for(var o=t.children,a,s=-1,l=o.length,u=t.value&&(i-n)/t.value;++s<l;)a=o[s],a.x0=e,a.x1=r,a.y0=n,a.y1=n+=a.value*u}var mb=(1+Math.sqrt(5))/2;function yb(t,e,n,r,i,o){for(var a=[],s=e.children,l,u,c=0,f=0,h=s.length,p,d,m=e.value,g,y,b,v,x,_,S;c<h;){p=i-n,d=o-r;do g=s[f++].value;while(!g&&f<h);for(y=b=g,_=Math.max(d/p,p/d)/(m*t),S=g*g*_,x=Math.max(b/S,S/y);f<h;++f){if(g+=u=s[f].value,u<y&&(y=u),u>b&&(b=u),S=g*g*_,v=Math.max(b/S,S/y),v>x){g-=u;break}x=v}a.push(l={value:g,dice:p<d,children:s.slice(c,f)}),l.dice?zo(l,n,r,i,m?r+=d*g/m:o):_l(l,n,r,m?n+=p*g/m:i,o),m-=g,c=f}return a}const wh=function t(e){function n(r,i,o,a,s){yb(e,r,i,o,a,s)}return n.ratio=function(r){return t((r=+r)>1?r:1)},n}(mb);function bb(){var t=wh,e=!1,n=1,r=1,i=[0],o=pr,a=pr,s=pr,l=pr,u=pr;function c(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(f),i=[0],e&&h.eachBefore(pb),h}function f(h){var p=i[h.depth],d=h.x0+p,m=h.y0+p,g=h.x1-p,y=h.y1-p;g<d&&(d=g=(d+g)/2),y<m&&(m=y=(m+y)/2),h.x0=d,h.y0=m,h.x1=g,h.y1=y,h.children&&(p=i[h.depth+1]=o(h)/2,d+=u(h)-p,m+=a(h)-p,g-=s(h)-p,y-=l(h)-p,g<d&&(d=g=(d+g)/2),y<m&&(m=y=(m+y)/2),t(h,d,m,g,y))}return c.round=function(h){return arguments.length?(e=!!h,c):e},c.size=function(h){return arguments.length?(n=+h[0],r=+h[1],c):[n,r]},c.tile=function(h){return arguments.length?(t=nb(h),c):t},c.padding=function(h){return arguments.length?c.paddingInner(h).paddingOuter(h):c.paddingInner()},c.paddingInner=function(h){return arguments.length?(o=typeof h=="function"?h:mi(+h),c):o},c.paddingOuter=function(h){return arguments.length?c.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):c.paddingTop()},c.paddingTop=function(h){return arguments.length?(a=typeof h=="function"?h:mi(+h),c):a},c.paddingRight=function(h){return arguments.length?(s=typeof h=="function"?h:mi(+h),c):s},c.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:mi(+h),c):l},c.paddingLeft=function(h){return arguments.length?(u=typeof h=="function"?h:mi(+h),c):u},c}function y7(t,e,n,r,i){var o=t.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,t.value,e,n,r,i);function c(f,h,p,d,m,g,y){if(f>=h-1){var b=o[f];b.x0=d,b.y0=m,b.x1=g,b.y1=y;return}for(var v=u[f],x=p/2+v,_=f+1,S=h-1;_<S;){var A=_+S>>>1;u[A]<x?_=A+1:S=A}x-u[_-1]<u[_]-x&&f+1<_&&--_;var T=u[_]-v,C=p-T;if(g-d>y-m){var I=p?(d*C+g*T)/p:g;c(f,_,T,d,m,I,y),c(_,h,C,I,m,g,y)}else{var $=p?(m*C+y*T)/p:y;c(f,_,T,d,m,g,$),c(_,h,C,d,$,g,y)}}}function b7(t,e,n,r,i){(t.depth&1?_l:zo)(t,e,n,r,i)}const x7=function t(e){function n(r,i,o,a,s){if((l=r._squarify)&&l.ratio===e)for(var l,u,c,f,h=-1,p,d=l.length,m=r.value;++h<d;){for(u=l[h],c=u.children,f=u.value=0,p=c.length;f<p;++f)u.value+=c[f].value;u.dice?zo(u,i,o,a,m?o+=(s-o)*u.value/m:s):_l(u,i,o,m?i+=(a-i)*u.value/m:a,s),m-=u.value}else r._squarify=l=yb(e,r,i,o,a,s),l.ratio=e}return n.ratio=function(r){return t((r=+r)>1?r:1)},n}(mb);function v7(t){for(var e=-1,n=t.length,r,i=t[n-1],o=0;++e<n;)r=i,i=t[e],o+=r[1]*i[0]-r[0]*i[1];return o/2}function $7(t){for(var e=-1,n=t.length,r=0,i=0,o,a=t[n-1],s,l=0;++e<n;)o=a,a=t[e],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 _7(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function w7(t,e){return t[0]-e[0]||t[1]-e[1]}function xb(t){const e=t.length,n=[0,1];let r=2,i;for(i=2;i<e;++i){for(;r>1&&_7(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function S7(t){if((n=t.length)<3)return null;var e,n,r=new Array(n),i=new Array(n);for(e=0;e<n;++e)r[e]=[+t[e][0],+t[e][1],e];for(r.sort(w7),e=0;e<n;++e)i[e]=[r[e][0],-r[e][1]];var o=xb(r),a=xb(i),s=a[0]===o[0],l=a[a.length-1]===o[o.length-1],u=[];for(e=o.length-1;e>=0;--e)u.push(t[r[o[e]][2]]);for(e=+s;e<a.length-l;++e)u.push(t[r[a[e]][2]]);return u}function A7(t,e){for(var n=t.length,r=t[n-1],i=e[0],o=e[1],a=r[0],s=r[1],l,u,c=!1,f=0;f<n;++f)r=t[f],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 T7(t){for(var e=-1,n=t.length,r=t[n-1],i,o,a=r[0],s=r[1],l=0;++e<n;)i=a,o=s,r=t[e],a=r[0],s=r[1],i-=a,o-=s,l+=Math.hypot(i,o);return l}const Ft=Math.random,P7=function t(e){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 e()*i+r}}return n.source=t,n}(Ft),D7=function t(e){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(e()*i+r)}}return n.source=t,n}(Ft),Sh=function t(e){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=e()*2-1,s=e()*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=t,n}(Ft),M7=function t(e){var n=Sh.source(e);function r(){var i=n.apply(this,arguments);return function(){return Math.exp(i())}}return r.source=t,r}(Ft),vb=function t(e){function n(r){return(r=+r)<=0?()=>0:function(){for(var i=0,o=r;o>1;--o)i+=e();return i+o*e()}}return n.source=t,n}(Ft),C7=function t(e){var n=vb.source(e);function r(i){if((i=+i)==0)return e;var o=n(i);return function(){return o()/i}}return r.source=t,r}(Ft),L7=function t(e){function n(r){return function(){return-Math.log1p(-e())/r}}return n.source=t,n}(Ft),k7=function t(e){function n(r){if((r=+r)<0)throw new RangeError("invalid alpha");return r=1/-r,function(){return Math.pow(1-e(),r)}}return n.source=t,n}(Ft),R7=function t(e){function n(r){if((r=+r)<0||r>1)throw new RangeError("invalid p");return function(){return Math.floor(e()+r)}}return n.source=t,n}(Ft),$b=function t(e){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(-e())/r)})}return n.source=t,n}(Ft),Ah=function t(e){var n=Sh.source(e)();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(-e())*o;var a=(i<1?i+1:i)-1/3,s=1/(3*Math.sqrt(a)),l=i<1?()=>Math.pow(e(),1/i):()=>1;return function(){do{do var u=n(),c=1+s*u;while(c<=0);c*=c*c;var f=1-e()}while(f>=1-.0331*u*u*u*u&&Math.log(f)>=.5*u*u+a*(1-c+Math.log(c)));return a*c*l()*o}}return r.source=t,r}(Ft),_b=function t(e){var n=Ah.source(e);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=t,r}(Ft),wb=function t(e){var n=$b.source(e),r=_b.source(e);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),f=r(c,l-c+1)();f<=u?(s+=c,l-=c,u=(u-f)/(1-f)):(l=c-1,u/=f)}for(var h=u<.5,p=h?u:1-u,d=n(p),m=d(),g=0;m<=l;++g)m+=d();return s+(h?g:l-g)}}return i.source=t,i}(Ft),E7=function t(e){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(-e()))}}return n.source=t,n}(Ft),I7=function t(e){function n(r,i){return r=r==null?0:+r,i=i==null?1:+i,function(){return r+i*Math.tan(Math.PI*e())}}return n.source=t,n}(Ft),B7=function t(e){function n(r,i){return r=r==null?0:+r,i=i==null?1:+i,function(){var o=e();return r+i*Math.log(o/(1-o))}}return n.source=t,n}(Ft),N7=function t(e){var n=Ah.source(e),r=wb.source(e);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(-e()),f=0;c<=s;++f)c-=Math.log1p(-e());return a+f}}return i.source=t,i}(Ft),F7=1664525,O7=1013904223,Sb=1/4294967296;function z7(t=Math.random()){let e=(0<=t&&t<1?t/Sb:Math.abs(t))|0;return()=>(e=F7*e+O7|0,Sb*(e>>>0))}function xe(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function un(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const Th=Symbol("implicit");function Ph(){var t=new Ui,e=[],n=[],r=Th;function i(o){let a=t.get(o);if(a===void 0){if(r!==Th)return r;t.set(o,a=e.push(o)-1)}return n[a%n.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new Ui;for(const a of o)t.has(a)||t.set(a,e.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 Ph(e,n).unknown(r)},xe.apply(i,arguments),i}function Dh(){var t=Ph().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,o,a,s=!1,l=0,u=0,c=.5;delete t.unknown;function f(){var h=e().length,p=i<r,d=p?i:r,m=p?r:i;o=(m-d)/Math.max(1,h-l+u*2),s&&(o=Math.floor(o)),d+=(m-d-o*(h-l))*c,a=o*(1-l),s&&(d=Math.round(d),a=Math.round(a));var g=$n(h).map(function(y){return d+o*y});return n(p?g.reverse():g)}return t.domain=function(h){return arguments.length?(e(h),f()):e()},t.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},t.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,s=!0,f()},t.bandwidth=function(){return a},t.step=function(){return o},t.round=function(h){return arguments.length?(s=!!h,f()):s},t.padding=function(h){return arguments.length?(l=Math.min(1,u=+h),f()):l},t.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),f()):l},t.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},t.align=function(h){return arguments.length?(c=Math.max(0,Math.min(1,h)),f()):c},t.copy=function(){return Dh(e(),[r,i]).round(s).paddingInner(l).paddingOuter(u).align(c)},xe.apply(f(),arguments)}function Ab(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Ab(e())},t}function Mh(){return Ab(Dh.apply(null,arguments).paddingInner(1))}function G7(t){return function(){return t}}function wl(t){return+t}var Tb=[0,1];function te(t){return t}function Ch(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:G7(isNaN(e)?NaN:.5)}function Y7(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function X7(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=Ch(i,r),o=n(a,o)):(r=Ch(r,i),o=n(o,a)),function(s){return o(r(s))}}function V7(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=Ch(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(s){var l=Vn(t,s,1,r)-1;return o[l](i[l](s))}}function Go(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Sl(){var t=Tb,e=Tb,n=tn,r,i,o,a=te,s,l,u;function c(){var h=Math.min(t.length,e.length);return a!==te&&(a=Y7(t[0],t[h-1])),s=h>2?V7:X7,l=u=null,f}function f(h){return h==null||isNaN(h=+h)?o:(l||(l=s(t.map(r),e,n)))(r(a(h)))}return f.invert=function(h){return a(i((u||(u=s(e,t.map(r),me)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,wl),c()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),c()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=ps,c()},f.clamp=function(h){return arguments.length?(a=h?!0:te,c()):a!==te},f.interpolate=function(h){return arguments.length?(n=h,c()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,p){return r=h,i=p,c()}}function Lh(){return Sl()(te,te)}function Pb(t,e,n,r){var i=Va(t,e,n),o;switch(r=li(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=Fy(i,a))&&(r.precision=o),wf(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Oy(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Ny(i))&&(r.precision=o-(r.type==="%")*2);break}}return bo(r)}function Dn(t){var e=t.domain;return t.ticks=function(n){var r=e();return Un(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Pb(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],s=r[o],l,u,c=10;for(s<a&&(u=a,a=s,s=u,u=i,i=o,o=u);c-- >0;){if(u=Hn(a,s,n),u===l)return r[i]=a,r[o]=s,e(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 t},t}function yi(){var t=Lh();return t.copy=function(){return Go(t,yi())},xe.apply(t,arguments),Dn(t)}function Db(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,wl),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return Db(t).unknown(e)},t=arguments.length?Array.from(t,wl):[0,1],Dn(n)}function Mb(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],a;return o<i&&(a=n,n=r,r=a,a=i,i=o,o=a),t[n]=e.floor(i),t[r]=e.ceil(o),t}function Cb(t){return Math.log(t)}function Lb(t){return Math.exp(t)}function W7(t){return-Math.log(-t)}function U7(t){return-Math.exp(-t)}function H7(t){return isFinite(t)?+("1e"+t):t<0?0:t}function j7(t){return t===10?H7:t===Math.E?Math.exp:e=>Math.pow(t,e)}function q7(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function kb(t){return(e,n)=>-t(-e,n)}function kh(t){const e=t(Cb,Lb),n=e.domain;let r=10,i,o;function a(){return i=q7(r),o=j7(r),n()[0]<0?(i=kb(i),o=kb(o),t(W7,U7)):t(Cb,Lb),e}return e.base=function(s){return arguments.length?(r=+s,a()):r},e.domain=function(s){return arguments.length?(n(s),a()):n()},e.ticks=s=>{const l=n();let u=l[0],c=l[l.length-1];const f=c<u;f&&([u,c]=[c,u]);let h=i(u),p=i(c),d,m;const g=s==null?10:+s;let y=[];if(!(r%1)&&p-h<g){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(d=1;d<r;++d)if(m=h<0?d/o(-h):d*o(h),!(m<u)){if(m>c)break;y.push(m)}}else for(;h<=p;++h)for(d=r-1;d>=1;--d)if(m=h>0?d/o(-h):d*o(h),!(m<u)){if(m>c)break;y.push(m)}y.length*2<g&&(y=Un(u,c,g))}else y=Un(h,p,Math.min(p-h,g)).map(o);return f?y.reverse():y},e.tickFormat=(s,l)=>{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=li(l)).precision==null&&(l.trim=!0),l=bo(l)),s===1/0)return l;const u=Math.max(1,r*s/e.ticks().length);return c=>{let f=c/o(Math.round(i(c)));return f*r<r-.5&&(f*=r),f<=u?l(c):""}},e.nice=()=>n(Mb(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function Rb(){const t=kh(Sl()).domain([1,10]);return t.copy=()=>Go(t,Rb()).base(t.base()),xe.apply(t,arguments),t}function Eb(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Ib(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Rh(t){var e=1,n=t(Eb(e),Ib(e));return n.constant=function(r){return arguments.length?t(Eb(e=+r),Ib(e)):e},Dn(n)}function Bb(){var t=Rh(Sl());return t.copy=function(){return Go(t,Bb()).constant(t.constant())},xe.apply(t,arguments)}function Nb(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Z7(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function K7(t){return t<0?-t*t:t*t}function Eh(t){var e=t(te,te),n=1;function r(){return n===1?t(te,te):n===.5?t(Z7,K7):t(Nb(n),Nb(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},Dn(e)}function dr(){var t=Eh(Sl());return t.copy=function(){return Go(t,dr()).exponent(t.exponent())},xe.apply(t,arguments),t}function Q7(){return dr.apply(null,arguments).exponent(.5)}function Fb(t){return Math.sign(t)*t*t}function J7(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function Ob(){var t=Lh(),e=[0,1],n=!1,r;function i(o){var a=J7(t(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return t.invert(Fb(o))},i.domain=function(o){return arguments.length?(t.domain(o),i):t.domain()},i.range=function(o){return arguments.length?(t.range((e=Array.from(o,wl)).map(Fb)),i):e.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?(t.clamp(o),i):t.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return Ob(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},xe.apply(i,arguments),Dn(i)}function zb(){var t=[],e=[],n=[],r;function i(){var a=0,s=Math.max(1,e.length);for(n=new Array(s-1);++a<s;)n[a-1]=v0(t,a/s);return o}function o(a){return a==null||isNaN(a=+a)?r:e[Vn(n,a)]}return o.invertExtent=function(a){var s=e.indexOf(a);return s<0?[NaN,NaN]:[s>0?n[s-1]:t[0],s<n.length?n[s]:t[t.length-1]]},o.domain=function(a){if(!arguments.length)return t.slice();t=[];for(let s of a)s!=null&&!isNaN(s=+s)&&t.push(s);return t.sort(wt),i()},o.range=function(a){return arguments.length?(e=Array.from(a),i()):e.slice()},o.unknown=function(a){return arguments.length?(r=a,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return zb().domain(t).range(e).unknown(r)},xe.apply(o,arguments)}function Gb(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function a(l){return l!=null&&l<=l?i[Vn(r,l,0,n)]:o}function s(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*e-(l-n)*t)/(n+1);return a}return a.domain=function(l){return arguments.length?([t,e]=l,t=+t,e=+e,s()):[t,e]},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?[t,r[0]]:u>=n?[r[n-1],e]:[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 Gb().domain([t,e]).range(i).unknown(o)},xe.apply(Dn(a),arguments)}function Yb(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[Vn(t,o,0,r)]:n}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(o){return arguments.length?(e=Array.from(o),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(o){var a=e.indexOf(o);return[t[a-1],t[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return Yb().domain(t).range(e).unknown(n)},xe.apply(i,arguments)}const Ih=new Date,Bh=new Date;function Mt(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a<s-o?a:s},i.offset=(o,a)=>(e(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)),e(o,s),t(o);while(u<o&&o<a);return l},i.filter=o=>Mt(a=>{if(a>=a)for(;t(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;e(a,-1),!o(a););else for(;--s>=0;)for(;e(a,1),!o(a););}),n&&(i.count=(o,a)=>(Ih.setTime(+o),Bh.setTime(+a),t(Ih),t(Bh),Math.floor(n(Ih,Bh))),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 bi=Mt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);bi.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Mt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):bi);const Xb=bi.range,cn=1e3,ve=cn*60,fn=ve*60,hn=fn*24,Nh=hn*7,Vb=hn*30,Fh=hn*365,pn=Mt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*cn)},(t,e)=>(e-t)/cn,t=>t.getUTCSeconds()),Wb=pn.range,Al=Mt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*cn)},(t,e)=>{t.setTime(+t+e*ve)},(t,e)=>(e-t)/ve,t=>t.getMinutes()),t9=Al.range,Tl=Mt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ve)},(t,e)=>(e-t)/ve,t=>t.getUTCMinutes()),e9=Tl.range,Pl=Mt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*cn-t.getMinutes()*ve)},(t,e)=>{t.setTime(+t+e*fn)},(t,e)=>(e-t)/fn,t=>t.getHours()),n9=Pl.range,Dl=Mt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*fn)},(t,e)=>(e-t)/fn,t=>t.getUTCHours()),r9=Dl.range,xi=Mt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ve)/hn,t=>t.getDate()-1),i9=xi.range,Yo=Mt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/hn,t=>t.getUTCDate()-1),o9=Yo.range,Oh=Mt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/hn,t=>Math.floor(t/hn)),a9=Oh.range;function gr(t){return Mt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ve)/Nh)}const vi=gr(0),Xo=gr(1),Ub=gr(2),Hb=gr(3),mr=gr(4),jb=gr(5),qb=gr(6),Zb=vi.range,s9=Xo.range,l9=Ub.range,u9=Hb.range,c9=mr.range,f9=jb.range,h9=qb.range;function yr(t){return Mt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Nh)}const $i=yr(0),Vo=yr(1),Kb=yr(2),Qb=yr(3),br=yr(4),Jb=yr(5),tx=yr(6),ex=$i.range,p9=Vo.range,d9=Kb.range,g9=Qb.range,m9=br.range,y9=Jb.range,b9=tx.range,Ml=Mt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),x9=Ml.range,Cl=Mt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),v9=Cl.range,je=Mt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());je.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Mt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});const $9=je.range,qe=Mt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());qe.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Mt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});const _9=qe.range;function nx(t,e,n,r,i,o){const a=[[pn,1,cn],[pn,5,5*cn],[pn,15,15*cn],[pn,30,30*cn],[o,1,ve],[o,5,5*ve],[o,15,15*ve],[o,30,30*ve],[i,1,fn],[i,3,3*fn],[i,6,6*fn],[i,12,12*fn],[r,1,hn],[r,2,2*hn],[n,1,Nh],[e,1,Vb],[e,3,3*Vb],[t,1,Fh]];function s(u,c,f){const h=c<u;h&&([u,c]=[c,u]);const p=f&&typeof f.range=="function"?f:l(u,c,f),d=p?p.range(u,+c+1):[];return h?d.reverse():d}function l(u,c,f){const h=Math.abs(c-u)/f,p=za(([,,g])=>g).right(a,h);if(p===a.length)return t.every(Va(u/Fh,c/Fh,f));if(p===0)return bi.every(Math.max(Va(u,c,f),1));const[d,m]=a[h/a[p-1][2]<a[p][2]/h?p-1:p];return d.every(m)}return[s,l]}const[rx,ix]=nx(qe,Cl,$i,Oh,Dl,Tl),[ox,ax]=nx(je,Ml,vi,xi,Pl,Al);function zh(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Gh(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Wo(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function sx(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,s=t.months,l=t.shortMonths,u=Uo(i),c=Ho(i),f=Uo(o),h=Ho(o),p=Uo(a),d=Ho(a),m=Uo(s),g=Ho(s),y=Uo(l),b=Ho(l),v={a:X,A:O,b:E,B:N,c:null,d:px,e:px,f:W9,g:ek,G:rk,H:Y9,I:X9,j:V9,L:dx,m:U9,M:H9,p:R,q:F,Q:vx,s:$x,S:j9,u:q9,U:Z9,V:K9,w:Q9,W:J9,x:null,X:null,y:tk,Y:nk,Z:ik,"%":xx},x={a:U,A:it,b:z,B:K,c:null,d:mx,e:mx,f:lk,g:bk,G:vk,H:ok,I:ak,j:sk,L:yx,m:uk,M:ck,p:V,q:Z,Q:vx,s:$x,S:fk,u:hk,U:pk,V:dk,w:gk,W:mk,x:null,X:null,y:yk,Y:xk,Z:$k,"%":xx},_={a:I,A:$,b:L,B:P,c:w,d:fx,e:fx,f:F9,g:cx,G:ux,H:hx,I:hx,j:E9,L:N9,m:R9,M:I9,p:C,q:k9,Q:z9,s:G9,S:B9,u:P9,U:D9,V:M9,w:T9,W:C9,x:M,X:D,y:cx,Y:ux,Z:L9,"%":O9};v.x=S(n,v),v.X=S(r,v),v.c=S(e,v),x.x=S(n,x),x.X=S(r,x),x.c=S(e,x);function S(j,nt){return function(st){var W=[],gt=-1,ft=0,Rt=j.length,ee,lt,Dt;for(st instanceof Date||(st=new Date(+st));++gt<Rt;)j.charCodeAt(gt)===37&&(W.push(j.slice(ft,gt)),(lt=lx[ee=j.charAt(++gt)])!=null?ee=j.charAt(++gt):lt=ee==="e"?" ":"0",(Dt=nt[ee])&&(ee=Dt(st,lt)),W.push(ee),ft=gt+1);return W.push(j.slice(ft,gt)),W.join("")}}function A(j,nt){return function(st){var W=Wo(1900,void 0,1),gt=T(W,j,st+="",0),ft,Rt;if(gt!=st.length)return null;if("Q"in W)return new Date(W.Q);if("s"in W)return new Date(W.s*1e3+("L"in W?W.L:0));if(nt&&!("Z"in W)&&(W.Z=0),"p"in W&&(W.H=W.H%12+W.p*12),W.m===void 0&&(W.m="q"in W?W.q:0),"V"in W){if(W.V<1||W.V>53)return null;"w"in W||(W.w=1),"Z"in W?(ft=Gh(Wo(W.y,0,1)),Rt=ft.getUTCDay(),ft=Rt>4||Rt===0?Vo.ceil(ft):Vo(ft),ft=Yo.offset(ft,(W.V-1)*7),W.y=ft.getUTCFullYear(),W.m=ft.getUTCMonth(),W.d=ft.getUTCDate()+(W.w+6)%7):(ft=zh(Wo(W.y,0,1)),Rt=ft.getDay(),ft=Rt>4||Rt===0?Xo.ceil(ft):Xo(ft),ft=xi.offset(ft,(W.V-1)*7),W.y=ft.getFullYear(),W.m=ft.getMonth(),W.d=ft.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),Rt="Z"in W?Gh(Wo(W.y,0,1)).getUTCDay():zh(Wo(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(Rt+5)%7:W.w+W.U*7-(Rt+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,Gh(W)):zh(W)}}function T(j,nt,st,W){for(var gt=0,ft=nt.length,Rt=st.length,ee,lt;gt<ft;){if(W>=Rt)return-1;if(ee=nt.charCodeAt(gt++),ee===37){if(ee=nt.charAt(gt++),lt=_[ee in lx?nt.charAt(gt++):ee],!lt||(W=lt(j,st,W))<0)return-1}else if(ee!=st.charCodeAt(W++))return-1}return W}function C(j,nt,st){var W=u.exec(nt.slice(st));return W?(j.p=c.get(W[0].toLowerCase()),st+W[0].length):-1}function I(j,nt,st){var W=p.exec(nt.slice(st));return W?(j.w=d.get(W[0].toLowerCase()),st+W[0].length):-1}function $(j,nt,st){var W=f.exec(nt.slice(st));return W?(j.w=h.get(W[0].toLowerCase()),st+W[0].length):-1}function L(j,nt,st){var W=y.exec(nt.slice(st));return W?(j.m=b.get(W[0].toLowerCase()),st+W[0].length):-1}function P(j,nt,st){var W=m.exec(nt.slice(st));return W?(j.m=g.get(W[0].toLowerCase()),st+W[0].length):-1}function w(j,nt,st){return T(j,e,nt,st)}function M(j,nt,st){return T(j,n,nt,st)}function D(j,nt,st){return T(j,r,nt,st)}function X(j){return a[j.getDay()]}function O(j){return o[j.getDay()]}function E(j){return l[j.getMonth()]}function N(j){return s[j.getMonth()]}function R(j){return i[+(j.getHours()>=12)]}function F(j){return 1+~~(j.getMonth()/3)}function U(j){return a[j.getUTCDay()]}function it(j){return o[j.getUTCDay()]}function z(j){return l[j.getUTCMonth()]}function K(j){return s[j.getUTCMonth()]}function V(j){return i[+(j.getUTCHours()>=12)]}function Z(j){return 1+~~(j.getUTCMonth()/3)}return{format:function(j){var nt=S(j+="",v);return nt.toString=function(){return j},nt},parse:function(j){var nt=A(j+="",!1);return nt.toString=function(){return j},nt},utcFormat:function(j){var nt=S(j+="",x);return nt.toString=function(){return j},nt},utcParse:function(j){var nt=A(j+="",!0);return nt.toString=function(){return j},nt}}}var lx={"-":"",_:" ",0:"0"},Nt=/^\s*\d+/,w9=/^%/,S9=/[\\^$*+?|[\]().{}]/g;function mt(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function A9(t){return t.replace(S9,"\\$&")}function Uo(t){return new RegExp("^(?:"+t.map(A9).join("|")+")","i")}function Ho(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function T9(t,e,n){var r=Nt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function P9(t,e,n){var r=Nt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function D9(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function M9(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function C9(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ux(t,e,n){var r=Nt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function cx(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function L9(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function k9(t,e,n){var r=Nt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function R9(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function fx(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function E9(t,e,n){var r=Nt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function hx(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function I9(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function B9(t,e,n){var r=Nt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function N9(t,e,n){var r=Nt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function F9(t,e,n){var r=Nt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function O9(t,e,n){var r=w9.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function z9(t,e,n){var r=Nt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function G9(t,e,n){var r=Nt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function px(t,e){return mt(t.getDate(),e,2)}function Y9(t,e){return mt(t.getHours(),e,2)}function X9(t,e){return mt(t.getHours()%12||12,e,2)}function V9(t,e){return mt(1+xi.count(je(t),t),e,3)}function dx(t,e){return mt(t.getMilliseconds(),e,3)}function W9(t,e){return dx(t,e)+"000"}function U9(t,e){return mt(t.getMonth()+1,e,2)}function H9(t,e){return mt(t.getMinutes(),e,2)}function j9(t,e){return mt(t.getSeconds(),e,2)}function q9(t){var e=t.getDay();return e===0?7:e}function Z9(t,e){return mt(vi.count(je(t)-1,t),e,2)}function gx(t){var e=t.getDay();return e>=4||e===0?mr(t):mr.ceil(t)}function K9(t,e){return t=gx(t),mt(mr.count(je(t),t)+(je(t).getDay()===4),e,2)}function Q9(t){return t.getDay()}function J9(t,e){return mt(Xo.count(je(t)-1,t),e,2)}function tk(t,e){return mt(t.getFullYear()%100,e,2)}function ek(t,e){return t=gx(t),mt(t.getFullYear()%100,e,2)}function nk(t,e){return mt(t.getFullYear()%1e4,e,4)}function rk(t,e){var n=t.getDay();return t=n>=4||n===0?mr(t):mr.ceil(t),mt(t.getFullYear()%1e4,e,4)}function ik(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+mt(e/60|0,"0",2)+mt(e%60,"0",2)}function mx(t,e){return mt(t.getUTCDate(),e,2)}function ok(t,e){return mt(t.getUTCHours(),e,2)}function ak(t,e){return mt(t.getUTCHours()%12||12,e,2)}function sk(t,e){return mt(1+Yo.count(qe(t),t),e,3)}function yx(t,e){return mt(t.getUTCMilliseconds(),e,3)}function lk(t,e){return yx(t,e)+"000"}function uk(t,e){return mt(t.getUTCMonth()+1,e,2)}function ck(t,e){return mt(t.getUTCMinutes(),e,2)}function fk(t,e){return mt(t.getUTCSeconds(),e,2)}function hk(t){var e=t.getUTCDay();return e===0?7:e}function pk(t,e){return mt($i.count(qe(t)-1,t),e,2)}function bx(t){var e=t.getUTCDay();return e>=4||e===0?br(t):br.ceil(t)}function dk(t,e){return t=bx(t),mt(br.count(qe(t),t)+(qe(t).getUTCDay()===4),e,2)}function gk(t){return t.getUTCDay()}function mk(t,e){return mt(Vo.count(qe(t)-1,t),e,2)}function yk(t,e){return mt(t.getUTCFullYear()%100,e,2)}function bk(t,e){return t=bx(t),mt(t.getUTCFullYear()%100,e,2)}function xk(t,e){return mt(t.getUTCFullYear()%1e4,e,4)}function vk(t,e){var n=t.getUTCDay();return t=n>=4||n===0?br(t):br.ceil(t),mt(t.getUTCFullYear()%1e4,e,4)}function $k(){return"+0000"}function xx(){return"%"}function vx(t){return+t}function $x(t){return Math.floor(+t/1e3)}var _i,Yh,_x,Ll,Xh;wx({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 wx(t){return _i=sx(t),Yh=_i.format,_x=_i.parse,Ll=_i.utcFormat,Xh=_i.utcParse,_i}var Sx="%Y-%m-%dT%H:%M:%S.%LZ";function _k(t){return t.toISOString()}var wk=Date.prototype.toISOString?_k:Ll(Sx);const Sk=wk;function Ak(t){var e=new Date(t);return isNaN(e)?null:e}var Tk=+new Date("2000-01-01T00:00:00.000Z")?Ak:Xh(Sx);const Pk=Tk;function Dk(t){return new Date(t)}function Mk(t){return t instanceof Date?+t:+new Date(+t)}function Vh(t,e,n,r,i,o,a,s,l,u){var c=Lh(),f=c.invert,h=c.domain,p=u(".%L"),d=u(":%S"),m=u("%I:%M"),g=u("%I %p"),y=u("%a %d"),b=u("%b %d"),v=u("%B"),x=u("%Y");function _(S){return(l(S)<S?p:s(S)<S?d:a(S)<S?m:o(S)<S?g:r(S)<S?i(S)<S?y:b:n(S)<S?v:x)(S)}return c.invert=function(S){return new Date(f(S))},c.domain=function(S){return arguments.length?h(Array.from(S,Mk)):h().map(Dk)},c.ticks=function(S){var A=h();return t(A[0],A[A.length-1],S??10)},c.tickFormat=function(S,A){return A==null?_:u(A)},c.nice=function(S){var A=h();return(!S||typeof S.range!="function")&&(S=e(A[0],A[A.length-1],S??10)),S?h(Mb(A,S)):c},c.copy=function(){return Go(c,Vh(t,e,n,r,i,o,a,s,l,u))},c}function Ck(){return xe.apply(Vh(ox,ax,je,Ml,vi,xi,Pl,Al,pn,Yh).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Lk(){return xe.apply(Vh(rx,ix,qe,Cl,$i,Yo,Dl,Tl,pn,Ll).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function kl(){var t=0,e=1,n,r,i,o,a=te,s=!1,l;function u(f){return f==null||isNaN(f=+f)?l:a(i===0?.5:(f=(o(f)-n)*i,s?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([t,e]=f,n=o(t=+t),r=o(e=+e),i=n===r?0:1/(r-n),u):[t,e]},u.clamp=function(f){return arguments.length?(s=!!f,u):s},u.interpolator=function(f){return arguments.length?(a=f,u):a};function c(f){return function(h){var p,d;return arguments.length?([p,d]=h,a=f(p,d),u):[a(0),a(1)]}}return u.range=c(tn),u.rangeRound=c(ps),u.unknown=function(f){return arguments.length?(l=f,u):l},function(f){return o=f,n=f(t),r=f(e),i=n===r?0:1/(r-n),u}}function Mn(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Ax(){var t=Dn(kl()(te));return t.copy=function(){return Mn(t,Ax())},un.apply(t,arguments)}function Tx(){var t=kh(kl()).domain([1,10]);return t.copy=function(){return Mn(t,Tx()).base(t.base())},un.apply(t,arguments)}function Px(){var t=Rh(kl());return t.copy=function(){return Mn(t,Px()).constant(t.constant())},un.apply(t,arguments)}function Wh(){var t=Eh(kl());return t.copy=function(){return Mn(t,Wh()).exponent(t.exponent())},un.apply(t,arguments)}function kk(){return Wh.apply(null,arguments).exponent(.5)}function Dx(){var t=[],e=te;function n(r){if(r!=null&&!isNaN(r=+r))return e((Vn(t,r,1)-1)/(t.length-1))}return n.domain=function(r){if(!arguments.length)return t.slice();t=[];for(let i of r)i!=null&&!isNaN(i=+i)&&t.push(i);return t.sort(wt),n},n.interpolator=function(r){return arguments.length?(e=r,n):e},n.range=function(){return t.map((r,i)=>e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>qi(t,o/r))},n.copy=function(){return Dx(e).domain(t)},un.apply(n,arguments)}function Rl(){var t=0,e=.5,n=1,r=1,i,o,a,s,l,u=te,c,f=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+c(m))-o)*(r*m<r*o?s:l),u(f?Math.max(0,Math.min(1,m)):m))}p.domain=function(m){return arguments.length?([t,e,n]=m,i=c(t=+t),o=c(e=+e),a=c(n=+n),s=i===o?0:.5/(o-i),l=o===a?0:.5/(a-o),r=o<i?-1:1,p):[t,e,n]},p.clamp=function(m){return arguments.length?(f=!!m,p):f},p.interpolator=function(m){return arguments.length?(u=m,p):u};function d(m){return function(g){var y,b,v;return arguments.length?([y,b,v]=g,u=Mm(m,[y,b,v]),p):[u(0),u(.5),u(1)]}}return p.range=d(tn),p.rangeRound=d(ps),p.unknown=function(m){return arguments.length?(h=m,p):h},function(m){return c=m,i=m(t),o=m(e),a=m(n),s=i===o?0:.5/(o-i),l=o===a?0:.5/(a-o),r=o<i?-1:1,p}}function Mx(){var t=Dn(Rl()(te));return t.copy=function(){return Mn(t,Mx())},un.apply(t,arguments)}function Cx(){var t=kh(Rl()).domain([.1,1,10]);return t.copy=function(){return Mn(t,Cx()).base(t.base())},un.apply(t,arguments)}function Lx(){var t=Rh(Rl());return t.copy=function(){return Mn(t,Lx()).constant(t.constant())},un.apply(t,arguments)}function Uh(){var t=Eh(Rl());return t.copy=function(){return Mn(t,Uh()).exponent(t.exponent())},un.apply(t,arguments)}function Rk(){return Uh.apply(null,arguments).exponent(.5)}function ct(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(r*6,++r*6);return n}const Ek=ct("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Ik=ct("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Bk=ct("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),Nk=ct("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),Fk=ct("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),Ok=ct("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),zk=ct("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),Gk=ct("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),Yk=ct("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Xk=ct("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),Vk=ct("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),$t=t=>dm(t[t.length-1]);var kx=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(ct);const Wk=$t(kx);var Rx=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(ct);const Uk=$t(Rx);var Ex=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(ct);const Hk=$t(Ex);var Ix=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(ct);const jk=$t(Ix);var Bx=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(ct);const qk=$t(Bx);var Nx=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(ct);const Zk=$t(Nx);var Fx=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(ct);const Kk=$t(Fx);var Ox=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(ct);const Qk=$t(Ox);var zx=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(ct);const Jk=$t(zx);var Gx=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(ct);const tR=$t(Gx);var Yx=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(ct);const eR=$t(Yx);var Xx=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(ct);const nR=$t(Xx);var Vx=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(ct);const rR=$t(Vx);var Wx=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(ct);const iR=$t(Wx);var Ux=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(ct);const oR=$t(Ux);var Hx=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(ct);const aR=$t(Hx);var jx=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(ct);const sR=$t(jx);var qx=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(ct);const lR=$t(qx);var Zx=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(ct);const uR=$t(Zx);var Kx=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(ct);const cR=$t(Kx);var Qx=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(ct);const fR=$t(Qx);var Jx=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(ct);const hR=$t(Jx);var tv=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(ct);const pR=$t(tv);var ev=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(ct);const dR=$t(ev);var nv=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(ct);const gR=$t(nv);var rv=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(ct);const mR=$t(rv);var iv=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(ct);const yR=$t(iv);function bR(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-t*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-t*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-t*2475.67)))))))+")"}const xR=gs(Ce(300,.5,0),Ce(-240,.5,1));var vR=gs(Ce(-100,.75,.35),Ce(80,1.5,.8)),$R=gs(Ce(260,.75,.35),Ce(80,1.5,.8)),El=Ce();function _R(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return El.h=360*t-100,El.s=1.5-1.5*e,El.l=.8-.9*e,El+""}var Il=Zr(),wR=Math.PI/3,SR=Math.PI*2/3;function AR(t){var e;return t=(.5-t)*Math.PI,Il.r=255*(e=Math.sin(t))*e,Il.g=255*(e=Math.sin(t+wR))*e,Il.b=255*(e=Math.sin(t+SR))*e,Il+""}function TR(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-t*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+t*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-t*6838.66)))))))+")"}function Bl(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const PR=Bl(ct("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var DR=Bl(ct("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),MR=Bl(ct("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),CR=Bl(ct("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function ut(t){return function(){return t}}const ov=Math.abs,Yt=Math.atan2,dn=Math.cos,LR=Math.max,wi=Math.min,se=Math.sin,_t=Math.sqrt,Xt=1e-12,Cn=Math.PI,Nl=Cn/2,Ln=2*Cn;function kR(t){return t>1?0:t<-1?Cn:Math.acos(t)}function av(t){return t>=1?Nl:t<=-1?-Nl:Math.asin(t)}function jo(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new po(e)}function RR(t){return t.innerRadius}function ER(t){return t.outerRadius}function IR(t){return t.startAngle}function BR(t){return t.endAngle}function NR(t){return t&&t.padAngle}function FR(t,e,n,r,i,o,a,s){var l=n-t,u=r-e,c=a-i,f=s-o,h=f*l-c*u;if(!(h*h<Xt))return h=(c*(e-o)-f*(t-i))/h,[t+h*l,e+h*u]}function Fl(t,e,n,r,i,o,a){var s=t-n,l=e-r,u=(a?o:-o)/_t(s*s+l*l),c=u*l,f=-u*s,h=t+c,p=e+f,d=n+c,m=r+f,g=(h+d)/2,y=(p+m)/2,b=d-h,v=m-p,x=b*b+v*v,_=i-o,S=h*m-d*p,A=(v<0?-1:1)*_t(LR(0,_*_*x-S*S)),T=(S*v-b*A)/x,C=(-S*b-v*A)/x,I=(S*v+b*A)/x,$=(-S*b+v*A)/x,L=T-g,P=C-y,w=I-g,M=$-y;return L*L+P*P>w*w+M*M&&(T=I,C=$),{cx:T,cy:C,x01:-c,y01:-f,x11:T*(i/_-1),y11:C*(i/_-1)}}function Ol(){var t=RR,e=ER,n=ut(0),r=null,i=IR,o=BR,a=NR,s=null,l=jo(u);function u(){var c,f,h=+t.apply(this,arguments),p=+e.apply(this,arguments),d=i.apply(this,arguments)-Nl,m=o.apply(this,arguments)-Nl,g=ov(m-d),y=m>d;if(s||(s=c=l()),p<h&&(f=p,p=h,h=f),!(p>Xt))s.moveTo(0,0);else if(g>Ln-Xt)s.moveTo(p*dn(d),p*se(d)),s.arc(0,0,p,d,m,!y),h>Xt&&(s.moveTo(h*dn(m),h*se(m)),s.arc(0,0,h,m,d,y));else{var b=d,v=m,x=d,_=m,S=g,A=g,T=a.apply(this,arguments)/2,C=T>Xt&&(r?+r.apply(this,arguments):_t(h*h+p*p)),I=wi(ov(p-h)/2,+n.apply(this,arguments)),$=I,L=I,P,w;if(C>Xt){var M=av(C/h*se(T)),D=av(C/p*se(T));(S-=M*2)>Xt?(M*=y?1:-1,x+=M,_-=M):(S=0,x=_=(d+m)/2),(A-=D*2)>Xt?(D*=y?1:-1,b+=D,v-=D):(A=0,b=v=(d+m)/2)}var X=p*dn(b),O=p*se(b),E=h*dn(_),N=h*se(_);if(I>Xt){var R=p*dn(v),F=p*se(v),U=h*dn(x),it=h*se(x),z;if(g<Cn)if(z=FR(X,O,U,it,R,F,E,N)){var K=X-z[0],V=O-z[1],Z=R-z[0],j=F-z[1],nt=1/se(kR((K*Z+V*j)/(_t(K*K+V*V)*_t(Z*Z+j*j)))/2),st=_t(z[0]*z[0]+z[1]*z[1]);$=wi(I,(h-st)/(nt-1)),L=wi(I,(p-st)/(nt+1))}else $=L=0}A>Xt?L>Xt?(P=Fl(U,it,X,O,p,L,y),w=Fl(R,F,E,N,p,L,y),s.moveTo(P.cx+P.x01,P.cy+P.y01),L<I?s.arc(P.cx,P.cy,L,Yt(P.y01,P.x01),Yt(w.y01,w.x01),!y):(s.arc(P.cx,P.cy,L,Yt(P.y01,P.x01),Yt(P.y11,P.x11),!y),s.arc(0,0,p,Yt(P.cy+P.y11,P.cx+P.x11),Yt(w.cy+w.y11,w.cx+w.x11),!y),s.arc(w.cx,w.cy,L,Yt(w.y11,w.x11),Yt(w.y01,w.x01),!y))):(s.moveTo(X,O),s.arc(0,0,p,b,v,!y)):s.moveTo(X,O),!(h>Xt)||!(S>Xt)?s.lineTo(E,N):$>Xt?(P=Fl(E,N,R,F,h,-$,y),w=Fl(X,O,U,it,h,-$,y),s.lineTo(P.cx+P.x01,P.cy+P.y01),$<I?s.arc(P.cx,P.cy,$,Yt(P.y01,P.x01),Yt(w.y01,w.x01),!y):(s.arc(P.cx,P.cy,$,Yt(P.y01,P.x01),Yt(P.y11,P.x11),!y),s.arc(0,0,h,Yt(P.cy+P.y11,P.cx+P.x11),Yt(w.cy+w.y11,w.cx+w.x11),y),s.arc(w.cx,w.cy,$,Yt(w.y11,w.x11),Yt(w.y01,w.x01),!y))):s.arc(0,0,h,_,x,y)}if(s.closePath(),c)return s=null,c+""||null}return u.centroid=function(){var c=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,f=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Cn/2;return[dn(f)*c,se(f)*c]},u.innerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:ut(+c),u):t},u.outerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:ut(+c),u):e},u.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:ut(+c),u):n},u.padRadius=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:ut(+c),u):r},u.startAngle=function(c){return arguments.length?(i=typeof c=="function"?c:ut(+c),u):i},u.endAngle=function(c){return arguments.length?(o=typeof c=="function"?c:ut(+c),u):o},u.padAngle=function(c){return arguments.length?(a=typeof c=="function"?c:ut(+c),u):a},u.context=function(c){return arguments.length?(s=c??null,u):s},u}var OR=Array.prototype.slice;function zl(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function sv(t){this._context=t}sv.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function Gl(t){return new sv(t)}function Hh(t){return t[0]}function jh(t){return t[1]}function Yl(t,e){var n=ut(!0),r=null,i=Gl,o=null,a=jo(s);t=typeof t=="function"?t:t===void 0?Hh:ut(t),e=typeof e=="function"?e:e===void 0?jh:ut(e);function s(l){var u,c=(l=zl(l)).length,f,h=!1,p;for(r==null&&(o=i(p=a())),u=0;u<=c;++u)!(u<c&&n(f=l[u],u,l))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(f,u,l),+e(f,u,l));if(p)return o=null,p+""||null}return s.x=function(l){return arguments.length?(t=typeof l=="function"?l:ut(+l),s):t},s.y=function(l){return arguments.length?(e=typeof l=="function"?l:ut(+l),s):e},s.defined=function(l){return arguments.length?(n=typeof l=="function"?l:ut(!!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 qh(t,e,n){var r=null,i=ut(!0),o=null,a=Gl,s=null,l=jo(u);t=typeof t=="function"?t:t===void 0?Hh:ut(+t),e=typeof e=="function"?e:ut(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?jh:ut(+n);function u(f){var h,p,d,m=(f=zl(f)).length,g,y=!1,b,v=new Array(m),x=new Array(m);for(o==null&&(s=a(b=l())),h=0;h<=m;++h){if(!(h<m&&i(g=f[h],h,f))===y)if(y=!y)p=h,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=h-1;d>=p;--d)s.point(v[d],x[d]);s.lineEnd(),s.areaEnd()}y&&(v[h]=+t(g,h,f),x[h]=+e(g,h,f),s.point(r?+r(g,h,f):v[h],n?+n(g,h,f):x[h]))}if(b)return s=null,b+""||null}function c(){return Yl().defined(i).curve(a).context(o)}return u.x=function(f){return arguments.length?(t=typeof f=="function"?f:ut(+f),r=null,u):t},u.x0=function(f){return arguments.length?(t=typeof f=="function"?f:ut(+f),u):t},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ut(+f),u):r},u.y=function(f){return arguments.length?(e=typeof f=="function"?f:ut(+f),n=null,u):e},u.y0=function(f){return arguments.length?(e=typeof f=="function"?f:ut(+f),u):e},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ut(+f),u):n},u.lineX0=u.lineY0=function(){return c().x(t).y(e)},u.lineY1=function(){return c().x(t).y(n)},u.lineX1=function(){return c().x(r).y(e)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:ut(!!f),u):i},u.curve=function(f){return arguments.length?(a=f,o!=null&&(s=a(o)),u):a},u.context=function(f){return arguments.length?(f==null?o=s=null:s=a(o=f),u):o},u}function zR(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function GR(t){return t}function lv(){var t=GR,e=zR,n=null,r=ut(0),i=ut(Ln),o=ut(0);function a(s){var l,u=(s=zl(s)).length,c,f,h=0,p=new Array(u),d=new Array(u),m=+r.apply(this,arguments),g=Math.min(Ln,Math.max(-Ln,i.apply(this,arguments)-m)),y,b=Math.min(Math.abs(g)/u,o.apply(this,arguments)),v=b*(g<0?-1:1),x;for(l=0;l<u;++l)(x=d[p[l]=l]=+t(s[l],l,s))>0&&(h+=x);for(e!=null?p.sort(function(_,S){return e(d[_],d[S])}):n!=null&&p.sort(function(_,S){return n(s[_],s[S])}),l=0,f=h?(g-u*v)/h:0;l<u;++l,m=y)c=p[l],x=d[c],y=m+(x>0?x*f:0)+v,d[c]={data:s[c],index:l,value:x,startAngle:m,endAngle:y,padAngle:b};return d}return a.value=function(s){return arguments.length?(t=typeof s=="function"?s:ut(+s),a):t},a.sortValues=function(s){return arguments.length?(e=s,n=null,a):e},a.sort=function(s){return arguments.length?(n=s,e=null,a):n},a.startAngle=function(s){return arguments.length?(r=typeof s=="function"?s:ut(+s),a):r},a.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:ut(+s),a):i},a.padAngle=function(s){return arguments.length?(o=typeof s=="function"?s:ut(+s),a):o},a}var uv=Zh(Gl);function cv(t){this._curve=t}cv.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};function Zh(t){function e(n){return new cv(t(n))}return e._curve=t,e}function qo(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(n){return arguments.length?e(Zh(n)):e()._curve},t}function fv(){return qo(Yl().curve(uv))}function hv(){var t=qh().curve(uv),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return qo(n())},delete t.lineX0,t.lineEndAngle=function(){return qo(r())},delete t.lineX1,t.lineInnerRadius=function(){return qo(i())},delete t.lineY0,t.lineOuterRadius=function(){return qo(o())},delete t.lineY1,t.curve=function(a){return arguments.length?e(Zh(a)):e()._curve},t}function Zo(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}class pv{constructor(e,n){this._context=e,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(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}class YR{constructor(e){this._context=e}lineStart(){this._point=0}lineEnd(){}point(e,n){if(e=+e,n=+n,this._point===0)this._point=1;else{const r=Zo(this._x0,this._y0),i=Zo(this._x0,this._y0=(this._y0+n)/2),o=Zo(e,this._y0),a=Zo(e,n);this._context.moveTo(...r),this._context.bezierCurveTo(...i,...o,...a)}this._x0=e,this._y0=n}}function dv(t){return new pv(t,!0)}function gv(t){return new pv(t,!1)}function XR(t){return new YR(t)}function VR(t){return t.source}function WR(t){return t.target}function Xl(t){let e=VR,n=WR,r=Hh,i=jh,o=null,a=null,s=jo(l);function l(){let u;const c=OR.call(arguments),f=e.apply(this,c),h=n.apply(this,c);if(o==null&&(a=t(u=s())),a.lineStart(),c[0]=f,a.point(+r.apply(this,c),+i.apply(this,c)),c[0]=h,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?(e=u,l):e},l.target=function(u){return arguments.length?(n=u,l):n},l.x=function(u){return arguments.length?(r=typeof u=="function"?u:ut(+u),l):r},l.y=function(u){return arguments.length?(i=typeof u=="function"?u:ut(+u),l):i},l.context=function(u){return arguments.length?(u==null?o=a=null:a=t(o=u),l):o},l}function UR(){return Xl(dv)}function HR(){return Xl(gv)}function jR(){const t=Xl(XR);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}const qR=_t(3),mv={draw(t,e){const n=_t(e+wi(e/28,.75))*.59436,r=n/2,i=r*qR;t.moveTo(0,n),t.lineTo(0,-n),t.moveTo(-i,-r),t.lineTo(i,r),t.moveTo(-i,r),t.lineTo(i,-r)}},Vl={draw(t,e){const n=_t(e/Cn);t.moveTo(n,0),t.arc(0,0,n,0,Ln)}},yv={draw(t,e){const n=_t(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},bv=_t(1/3),ZR=bv*2,xv={draw(t,e){const n=_t(e/ZR),r=n*bv;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},vv={draw(t,e){const n=_t(e)*.62625;t.moveTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.lineTo(-n,0),t.closePath()}},$v={draw(t,e){const n=_t(e-wi(e/7,2))*.87559;t.moveTo(-n,0),t.lineTo(n,0),t.moveTo(0,n),t.lineTo(0,-n)}},_v={draw(t,e){const n=_t(e),r=-n/2;t.rect(r,r,n,n)}},wv={draw(t,e){const n=_t(e)*.4431;t.moveTo(n,n),t.lineTo(n,-n),t.lineTo(-n,-n),t.lineTo(-n,n),t.closePath()}},KR=.8908130915292852,Sv=se(Cn/10)/se(7*Cn/10),QR=se(Ln/10)*Sv,JR=-dn(Ln/10)*Sv,Av={draw(t,e){const n=_t(e*KR),r=QR*n,i=JR*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){const a=Ln*o/5,s=dn(a),l=se(a);t.lineTo(l*n,-s*n),t.lineTo(s*r-l*i,l*r+s*i)}t.closePath()}},Kh=_t(3),Tv={draw(t,e){const n=-_t(e/(Kh*3));t.moveTo(0,n*2),t.lineTo(-Kh*n,-n),t.lineTo(Kh*n,-n),t.closePath()}},tE=_t(3),Pv={draw(t,e){const n=_t(e)*.6824,r=n/2,i=n*tE/2;t.moveTo(0,-n),t.lineTo(i,r),t.lineTo(-i,r),t.closePath()}},$e=-.5,_e=_t(3)/2,Qh=1/_t(12),eE=(Qh/2+1)*3,Dv={draw(t,e){const n=_t(e/eE),r=n/2,i=n*Qh,o=r,a=n*Qh+n,s=-o,l=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,l),t.lineTo($e*r-_e*i,_e*r+$e*i),t.lineTo($e*o-_e*a,_e*o+$e*a),t.lineTo($e*s-_e*l,_e*s+$e*l),t.lineTo($e*r+_e*i,$e*i-_e*r),t.lineTo($e*o+_e*a,$e*a-_e*o),t.lineTo($e*s+_e*l,$e*l-_e*s),t.closePath()}},Jh={draw(t,e){const n=_t(e-wi(e/6,1.7))*.6189;t.moveTo(-n,-n),t.lineTo(n,n),t.moveTo(-n,n),t.lineTo(n,-n)}},Mv=[Vl,yv,xv,_v,Av,Tv,Dv],nE=[Vl,$v,Jh,Pv,mv,wv,vv];function rE(t,e){let n=null,r=jo(i);t=typeof t=="function"?t:ut(t||Vl),e=typeof e=="function"?e:ut(e===void 0?64:+e);function i(){let o;if(n||(n=o=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(t=typeof o=="function"?o:ut(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:ut(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function kn(){}function Wl(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Ul(t){this._context=t}Ul.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:Wl(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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);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:Wl(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function iE(t){return new Ul(t)}function Cv(t){this._context=t}Cv.prototype={areaStart:kn,areaEnd:kn,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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Wl(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function oE(t){return new Cv(t)}function Lv(t){this._context=t}Lv.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(t,e){switch(t=+t,e=+e,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+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Wl(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function aE(t){return new Lv(t)}function kv(t,e){this._basis=new Ul(t),this._beta=e}kv.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r=t[0],i=e[0],o=t[n]-r,a=e[n]-i,s=-1,l;++s<=n;)l=s/n,this._basis.point(this._beta*t[s]+(1-this._beta)*(r+l*o),this._beta*e[s]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const sE=function t(e){function n(r){return e===1?new Ul(r):new kv(r,e)}return n.beta=function(r){return t(+r)},n}(.85);function Hl(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function tp(t,e){this._context=t,this._k=(1-e)/6}tp.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:Hl(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Hl(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const lE=function t(e){function n(r){return new tp(r,e)}return n.tension=function(r){return t(+r)},n}(0);function ep(t,e){this._context=t,this._k=(1-e)/6}ep.prototype={areaStart:kn,areaEnd:kn,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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Hl(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const uE=function t(e){function n(r){return new ep(r,e)}return n.tension=function(r){return t(+r)},n}(0);function np(t,e){this._context=t,this._k=(1-e)/6}np.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(t,e){switch(t=+t,e=+e,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:Hl(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const cE=function t(e){function n(r){return new np(r,e)}return n.tension=function(r){return t(+r)},n}(0);function rp(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Xt){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Xt){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*u+t._x1*t._l23_2a-e*t._l12_2a)/c,a=(a*u+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function Rv(t,e){this._context=t,this._alpha=e}Rv.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(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;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(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:rp(this,t,e);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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const fE=function t(e){function n(r){return e?new Rv(r,e):new tp(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function Ev(t,e){this._context=t,this._alpha=e}Ev.prototype={areaStart:kn,areaEnd:kn,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(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;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=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:rp(this,t,e);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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const hE=function t(e){function n(r){return e?new Ev(r,e):new ep(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function Iv(t,e){this._context=t,this._alpha=e}Iv.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(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;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:rp(this,t,e);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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const pE=function t(e){function n(r){return e?new Iv(r,e):new np(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function Bv(t){this._context=t}Bv.prototype={areaStart:kn,areaEnd:kn,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function dE(t){return new Bv(t)}function Nv(t){return t<0?-1:1}function Fv(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Nv(o)+Nv(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Ov(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function ip(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function jl(t){this._context=t}jl.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:ip(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(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,ip(this,Ov(this,n=Fv(this,t,e)),n);break;default:ip(this,this._t0,n=Fv(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function zv(t){this._context=new Gv(t)}(zv.prototype=Object.create(jl.prototype)).point=function(t,e){jl.prototype.point.call(this,e,t)};function Gv(t){this._context=t}Gv.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};function gE(t){return new jl(t)}function mE(t){return new zv(t)}function Yv(t){this._context=t}Yv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=Xv(t),i=Xv(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[a],e[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function Xv(t){var e,n=t.length-1,r,i=new Array(n),o=new Array(n),a=new Array(n);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<n-1;++e)i[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(i[n-1]=2,o[n-1]=7,a[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=i[e]/o[e-1],o[e]-=r,a[e]-=r*a[e-1];for(i[n-1]=a[n-1]/o[n-1],e=n-2;e>=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[n-1]=(t[n]+i[n-1])/2,e=0;e<n-1;++e)o[e]=2*t[e+1]-i[e+1];return[i,o]}function yE(t){return new Yv(t)}function ql(t,e){this._context=t,this._t=e}ql.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function bE(t){return new ql(t,.5)}function xE(t){return new ql(t,0)}function vE(t){return new ql(t,1)}function Si(t,e){if((a=t.length)>1)for(var n=1,r,i,o=t[e[0]],a,s=o.length;n<a;++n)for(i=o,o=t[e[n]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Ai(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function $E(t,e){return t[e]}function _E(t){const e=[];return e.key=t,e}function wE(){var t=ut([]),e=Ai,n=Si,r=$E;function i(o){var a=Array.from(t.apply(this,arguments),_E),s,l=a.length,u=-1,c;for(const f of o)for(s=0,++u;s<l;++s)(a[s][u]=[0,+r(f,a[s].key,u,o)]).data=f;for(s=0,c=zl(e(a));s<l;++s)a[c[s]].index=s;return n(a,c),a}return i.keys=function(o){return arguments.length?(t=typeof o=="function"?o:ut(Array.from(o)),i):t},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:ut(+o),i):r},i.order=function(o){return arguments.length?(e=o==null?Ai:typeof o=="function"?o:ut(Array.from(o)),i):e},i.offset=function(o){return arguments.length?(n=o??Si,i):n},i}function SE(t,e){if((r=t.length)>0){for(var n,r,i=0,o=t[0].length,a;i<o;++i){for(a=n=0;n<r;++n)a+=t[n][i][1]||0;if(a)for(n=0;n<r;++n)t[n][i][1]/=a}Si(t,e)}}function AE(t,e){if((l=t.length)>0)for(var n,r=0,i,o,a,s,l,u=t[e[0]].length;r<u;++r)for(a=s=0,n=0;n<l;++n)(o=(i=t[e[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 TE(t,e){if((i=t.length)>0){for(var n=0,r=t[e[0]],i,o=r.length;n<o;++n){for(var a=0,s=0;a<i;++a)s+=t[a][n][1]||0;r[n][1]+=r[n][0]=-s/2}Si(t,e)}}function PE(t,e){if(!(!((a=t.length)>0)||!((o=(i=t[e[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=t[e[s]],f=c[r][1]||0,h=c[r-1][1]||0,p=(f-h)/2,d=0;d<s;++d){var m=t[e[d]],g=m[r][1]||0,y=m[r-1][1]||0;p+=g-y}l+=f,u+=p*f}i[r-1][1]+=i[r-1][0]=n,l&&(n-=u/l)}i[r-1][1]+=i[r-1][0]=n,Si(t,e)}}function Vv(t){var e=t.map(DE);return Ai(t).sort(function(n,r){return e[n]-e[r]})}function DE(t){for(var e=-1,n=0,r=t.length,i,o=-1/0;++e<r;)(i=+t[e][1])>o&&(o=i,n=e);return n}function Wv(t){var e=t.map(Uv);return Ai(t).sort(function(n,r){return e[n]-e[r]})}function Uv(t){for(var e=0,n=-1,r=t.length,i;++n<r;)(i=+t[n][1])&&(e+=i);return e}function ME(t){return Wv(t).reverse()}function CE(t){var e=t.length,n,r,i=t.map(Uv),o=Vv(t),a=0,s=0,l=[],u=[];for(n=0;n<e;++n)r=o[n],a<s?(a+=i[r],l.push(r)):(s+=i[r],u.push(r));return u.reverse().concat(l)}function LE(t){return Ai(t).reverse()}const Zl=t=>()=>t;function kE(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Ze(t,e,n){this.k=t,this.x=e,this.y=n}Ze.prototype={constructor:Ze,scale:function(t){return t===1?this:new Ze(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Ze(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Kl=new Ze(1,0,0);Hv.prototype=Ze.prototype;function Hv(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Kl;return t.__zoom}function op(t){t.stopImmediatePropagation()}function Ko(t){t.preventDefault(),t.stopImmediatePropagation()}function RE(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function EE(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function jv(){return this.__zoom||Kl}function IE(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function BE(){return navigator.maxTouchPoints||"ontouchstart"in this}function NE(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.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 Qo(){var t=RE,e=EE,n=NE,r=IE,i=BE,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,l=Am,u=jn("start","zoom","end"),c,f,h,p=500,d=150,m=0,g=10;function y(w){w.property("__zoom",jv).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",C).on("dblclick.zoom",I).filter(i).on("touchstart.zoom",$).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",P).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(w,M,D,X){var O=w.selection?w.selection():w;O.property("__zoom",jv),w!==O?_(w,M,D,X):O.interrupt().each(function(){S(this,arguments).event(X).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},y.scaleBy=function(w,M,D,X){y.scaleTo(w,function(){var O=this.__zoom.k,E=typeof M=="function"?M.apply(this,arguments):M;return O*E},D,X)},y.scaleTo=function(w,M,D,X){y.transform(w,function(){var O=e.apply(this,arguments),E=this.__zoom,N=D==null?x(O):typeof D=="function"?D.apply(this,arguments):D,R=E.invert(N),F=typeof M=="function"?M.apply(this,arguments):M;return n(v(b(E,F),N,R),O,a)},D,X)},y.translateBy=function(w,M,D,X){y.transform(w,function(){return n(this.__zoom.translate(typeof M=="function"?M.apply(this,arguments):M,typeof D=="function"?D.apply(this,arguments):D),e.apply(this,arguments),a)},null,X)},y.translateTo=function(w,M,D,X,O){y.transform(w,function(){var E=e.apply(this,arguments),N=this.__zoom,R=X==null?x(E):typeof X=="function"?X.apply(this,arguments):X;return n(Kl.translate(R[0],R[1]).scale(N.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof D=="function"?-D.apply(this,arguments):-D),E,a)},X,O)};function b(w,M){return M=Math.max(o[0],Math.min(o[1],M)),M===w.k?w:new Ze(M,w.x,w.y)}function v(w,M,D){var X=M[0]-D[0]*w.k,O=M[1]-D[1]*w.k;return X===w.x&&O===w.y?w:new Ze(w.k,X,O)}function x(w){return[(+w[0][0]+ +w[1][0])/2,(+w[0][1]+ +w[1][1])/2]}function _(w,M,D,X){w.on("start.zoom",function(){S(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(X).end()}).tween("zoom",function(){var O=this,E=arguments,N=S(O,E).event(X),R=e.apply(O,E),F=D==null?x(R):typeof D=="function"?D.apply(O,E):D,U=Math.max(R[1][0]-R[0][0],R[1][1]-R[0][1]),it=O.__zoom,z=typeof M=="function"?M.apply(O,E):M,K=l(it.invert(F).concat(U/it.k),z.invert(F).concat(U/z.k));return function(V){if(V===1)V=z;else{var Z=K(V),j=U/Z[2];V=new Ze(j,F[0]-Z[0]*j,F[1]-Z[1]*j)}N.zoom(null,V)}})}function S(w,M,D){return!D&&w.__zooming||new A(w,M)}function A(w,M){this.that=w,this.args=M,this.active=0,this.sourceEvent=null,this.extent=e.apply(w,M),this.taps=0}A.prototype={event:function(w){return w&&(this.sourceEvent=w),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(w,M){return this.mouse&&w!=="mouse"&&(this.mouse[1]=M.invert(this.mouse[0])),this.touch0&&w!=="touch"&&(this.touch0[1]=M.invert(this.touch0[0])),this.touch1&&w!=="touch"&&(this.touch1[1]=M.invert(this.touch1[0])),this.that.__zoom=M,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(w){var M=H(this.that).datum();u.call(w,this.that,new kE(w,{sourceEvent:this.sourceEvent,target:y,type:w,transform:this.that.__zoom,dispatch:u}),M)}};function T(w,...M){if(!t.apply(this,arguments))return;var D=S(this,M).event(w),X=this.__zoom,O=Math.max(o[0],Math.min(o[1],X.k*Math.pow(2,r.apply(this,arguments)))),E=fe(w);if(D.wheel)(D.mouse[0][0]!==E[0]||D.mouse[0][1]!==E[1])&&(D.mouse[1]=X.invert(D.mouse[0]=E)),clearTimeout(D.wheel);else{if(X.k===O)return;D.mouse=[E,X.invert(E)],nr(this),D.start()}Ko(w),D.wheel=setTimeout(N,d),D.zoom("mouse",n(v(b(X,O),D.mouse[0],D.mouse[1]),D.extent,a));function N(){D.wheel=null,D.end()}}function C(w,...M){if(h||!t.apply(this,arguments))return;var D=w.currentTarget,X=S(this,M,!0).event(w),O=H(w.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",U,!0),E=fe(w,D),N=w.clientX,R=w.clientY;ts(w.view),op(w),X.mouse=[E,this.__zoom.invert(E)],nr(this),X.start();function F(it){if(Ko(it),!X.moved){var z=it.clientX-N,K=it.clientY-R;X.moved=z*z+K*K>m}X.event(it).zoom("mouse",n(v(X.that.__zoom,X.mouse[0]=fe(it,D),X.mouse[1]),X.extent,a))}function U(it){O.on("mousemove.zoom mouseup.zoom",null),es(it.view,X.moved),Ko(it),X.event(it).end()}}function I(w,...M){if(t.apply(this,arguments)){var D=this.__zoom,X=fe(w.changedTouches?w.changedTouches[0]:w,this),O=D.invert(X),E=D.k*(w.shiftKey?.5:2),N=n(v(b(D,E),X,O),e.apply(this,M),a);Ko(w),s>0?H(this).transition().duration(s).call(_,N,X,w):H(this).call(y.transform,N,X,w)}}function $(w,...M){if(t.apply(this,arguments)){var D=w.touches,X=D.length,O=S(this,M,w.changedTouches.length===X).event(w),E,N,R,F;for(op(w),N=0;N<X;++N)R=D[N],F=fe(R,this),F=[F,this.__zoom.invert(F),R.identifier],O.touch0?!O.touch1&&O.touch0[2]!==F[2]&&(O.touch1=F,O.taps=0):(O.touch0=F,E=!0,O.taps=1+!!c);c&&(c=clearTimeout(c)),E&&(O.taps<2&&(f=F[0],c=setTimeout(function(){c=null},p)),nr(this),O.start())}}function L(w,...M){if(this.__zooming){var D=S(this,M).event(w),X=w.changedTouches,O=X.length,E,N,R,F;for(Ko(w),E=0;E<O;++E)N=X[E],R=fe(N,this),D.touch0&&D.touch0[2]===N.identifier?D.touch0[0]=R:D.touch1&&D.touch1[2]===N.identifier&&(D.touch1[0]=R);if(N=D.that.__zoom,D.touch1){var U=D.touch0[0],it=D.touch0[1],z=D.touch1[0],K=D.touch1[1],V=(V=z[0]-U[0])*V+(V=z[1]-U[1])*V,Z=(Z=K[0]-it[0])*Z+(Z=K[1]-it[1])*Z;N=b(N,Math.sqrt(V/Z)),R=[(U[0]+z[0])/2,(U[1]+z[1])/2],F=[(it[0]+K[0])/2,(it[1]+K[1])/2]}else if(D.touch0)R=D.touch0[0],F=D.touch0[1];else return;D.zoom("touch",n(v(N,R,F),D.extent,a))}}function P(w,...M){if(this.__zooming){var D=S(this,M).event(w),X=w.changedTouches,O=X.length,E,N;for(op(w),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),E=0;E<O;++E)N=X[E],D.touch0&&D.touch0[2]===N.identifier?delete D.touch0:D.touch1&&D.touch1[2]===N.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(N=fe(N,this),Math.hypot(f[0]-N[0],f[1]-N[1])<g)){var R=H(this).on("dblclick.zoom");R&&R.apply(this,arguments)}}}return y.wheelDelta=function(w){return arguments.length?(r=typeof w=="function"?w:Zl(+w),y):r},y.filter=function(w){return arguments.length?(t=typeof w=="function"?w:Zl(!!w),y):t},y.touchable=function(w){return arguments.length?(i=typeof w=="function"?w:Zl(!!w),y):i},y.extent=function(w){return arguments.length?(e=typeof w=="function"?w:Zl([[+w[0][0],+w[0][1]],[+w[1][0],+w[1][1]]]),y):e},y.scaleExtent=function(w){return arguments.length?(o[0]=+w[0],o[1]=+w[1],y):[o[0],o[1]]},y.translateExtent=function(w){return arguments.length?(a[0][0]=+w[0][0],a[1][0]=+w[1][0],a[0][1]=+w[0][1],a[1][1]=+w[1][1],y):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},y.constrain=function(w){return arguments.length?(n=w,y):n},y.duration=function(w){return arguments.length?(s=+w,y):s},y.interpolate=function(w){return arguments.length?(l=w,y):l},y.on=function(){var w=u.on.apply(u,arguments);return w===u?y:w},y.clickDistance=function(w){return arguments.length?(m=(w=+w)*w,y):Math.sqrt(m)},y.tapDistance=function(w){return arguments.length?(g=+w,y):g},y}const ap=Object.freeze(Object.defineProperty({__proto__:null,Adder:Lt,Delaunay:yf,FormatSpecifier:Es,InternMap:Ui,InternSet:Wn,Node:hr,Path:po,Voronoi:py,ZoomTransform:Ze,active:G5,arc:Ol,area:qh,areaRadial:hv,ascending:wt,autoType:f8,axisBottom:mc,axisLeft:yc,axisRight:RD,axisTop:kD,bin:b0,bisect:Vn,bisectCenter:MP,bisectLeft:DP,bisectRight:r0,bisector:za,blob:d8,blur:CP,blur2:i0,blurImage:LP,brush:t6,brushSelection:K5,brushX:Q5,brushY:J5,buffer:m8,chord:n6,chordDirected:i6,chordTranspose:r6,cluster:D4,color:wn,contourDensity:C6,contours:hf,count:Ya,create:d3,creator:Ka,cross:FP,csv:x8,csvFormat:t8,csvFormatBody:e8,csvFormatRow:r8,csvFormatRows:n8,csvFormatValue:i8,csvParse:yy,csvParseRows:J6,cubehelix:Ce,cumsum:OP,curveBasis:iE,curveBasisClosed:oE,curveBasisOpen:aE,curveBumpX:dv,curveBumpY:gv,curveBundle:sE,curveCardinal:lE,curveCardinalClosed:uE,curveCardinalOpen:cE,curveCatmullRom:fE,curveCatmullRomClosed:hE,curveCatmullRomOpen:pE,curveLinear:Gl,curveLinearClosed:dE,curveMonotoneX:gE,curveMonotoneY:mE,curveNatural:yE,curveStep:bE,curveStepAfter:vE,curveStepBefore:xE,descending:e0,deviation:s0,difference:vD,disjoint:$D,dispatch:jn,drag:O0,dragDisable:ts,dragEnable:es,dsv:b8,dsvFormat:Cs,easeBack:Hm,easeBackIn:R5,easeBackInOut:Hm,easeBackOut:E5,easeBounce:co,easeBounceIn:L5,easeBounceInOut:k5,easeBounceOut:co,easeCircle:Um,easeCircleIn:$5,easeCircleInOut:Um,easeCircleOut:_5,easeCubic:uo,easeCubicIn:p5,easeCubicInOut:uo,easeCubicOut:d5,easeElastic:fo,easeElasticIn:I5,easeElasticInOut:B5,easeElasticOut:fo,easeExp:Wm,easeExpIn:x5,easeExpInOut:Wm,easeExpOut:v5,easeLinear:c5,easePoly:Gm,easePolyIn:g5,easePolyInOut:Gm,easePolyOut:m5,easeQuad:zm,easeQuadIn:f5,easeQuadInOut:zm,easeQuadOut:h5,easeSin:Vm,easeSinIn:y5,easeSinInOut:Vm,easeSinOut:b5,every:dD,extent:Wi,fcumsum:GP,filter:mD,flatGroup:YP,flatRollup:XP,forceCenter:P8,forceCollide:_y,forceLink:H8,forceManyBody:Ty,forceRadial:eL,forceSimulation:Ay,forceX:Py,forceY:Dy,get format(){return bo},formatDefaultLocale:By,formatLocale:Iy,get formatPrefix(){return wf},formatSpecifier:li,fsum:zP,geoAlbers:Z1,geoAlbersUsa:a4,geoArea:fL,geoAzimuthalEqualArea:s4,geoAzimuthalEqualAreaRaw:lh,geoAzimuthalEquidistant:l4,geoAzimuthalEquidistantRaw:uh,geoBounds:gL,geoCentroid:$L,geoCircle:_L,geoClipAntimeridian:Gf,geoClipCircle:b1,geoClipExtent:ML,geoClipRectangle:nl,geoConicConformal:c4,geoConicConformalRaw:J1,geoConicEqualArea:dl,geoConicEqualAreaRaw:q1,geoConicEquidistant:h4,geoConicEquidistantRaw:tb,geoContains:BL,geoDistance:ol,geoEqualEarth:d4,geoEqualEarthRaw:ch,geoEquirectangular:f4,geoEquirectangularRaw:Eo,geoGnomonic:g4,geoGnomonicRaw:fh,geoGraticule:D1,geoGraticule10:NL,geoIdentity:m4,geoInterpolate:FL,geoLength:x1,geoMercator:u4,geoMercatorRaw:Ro,geoNaturalEarth1:y4,geoNaturalEarth1Raw:hh,geoOrthographic:b4,geoOrthographicRaw:ph,geoPath:ZL,geoProjection:He,geoProjectionMutator:ah,geoRotation:c1,geoStereographic:x4,geoStereographicRaw:dh,geoStream:ke,geoTransform:KL,geoTransverseMercator:v4,geoTransverseMercatorRaw:gh,gray:E3,greatest:x0,greatestIndex:uD,group:f0,groupSort:UP,groups:h0,hcl:us,hierarchy:yl,histogram:b0,hsl:os,html:A8,image:$8,index:VP,indexes:WP,interpolate:tn,interpolateArray:z3,interpolateBasis:cm,interpolateBasisClosed:fm,interpolateBlues:hR,interpolateBrBG:Wk,interpolateBuGn:tR,interpolateBuPu:eR,interpolateCividis:bR,interpolateCool:$R,interpolateCubehelix:eC,interpolateCubehelixDefault:xR,interpolateCubehelixLong:gs,interpolateDate:ym,interpolateDiscrete:X3,interpolateGnBu:nR,interpolateGreens:pR,interpolateGreys:dR,interpolateHcl:J3,interpolateHclLong:tC,interpolateHsl:Z3,interpolateHslLong:K3,interpolateHue:V3,interpolateInferno:MR,interpolateLab:Q3,interpolateMagma:DR,interpolateNumber:me,interpolateNumberArray:Bc,interpolateObject:bm,interpolateOrRd:rR,interpolateOranges:yR,interpolatePRGn:Uk,interpolatePiYG:Hk,interpolatePlasma:CR,interpolatePuBu:oR,interpolatePuBuGn:iR,interpolatePuOr:jk,interpolatePuRd:aR,interpolatePurples:gR,interpolateRainbow:_R,interpolateRdBu:qk,interpolateRdGy:Zk,interpolateRdPu:sR,interpolateRdYlBu:Kk,interpolateRdYlGn:Qk,interpolateReds:mR,interpolateRgb:no,interpolateRgbBasis:dm,interpolateRgbBasisClosed:O3,interpolateRound:ps,interpolateSinebow:AR,interpolateSpectral:Jk,interpolateString:Oc,interpolateTransformCss:_m,interpolateTransformSvg:wm,interpolateTurbo:TR,interpolateViridis:PR,interpolateWarm:vR,interpolateYlGn:uR,interpolateYlGnBu:lR,interpolateYlOrBr:cR,interpolateYlOrRd:fR,interpolateZoom:Am,interrupt:nr,intersection:_D,interval:aC,isoFormat:Sk,isoParse:Pk,json:w8,lab:ls,lch:I3,least:lD,leastIndex:_0,line:Yl,lineRadial:fv,link:Xl,linkHorizontal:UR,linkRadial:jR,linkVertical:HR,local:N0,map:yD,matcher:$c,max:Hi,maxIndex:fc,mean:tD,median:eD,medianIndex:nD,merge:pc,min:Wa,minIndex:hc,mode:iD,namespace:Ki,namespaces:xc,nice:uc,now:so,pack:i7,packEnclose:Q4,packSiblings:n7,pairs:oD,partition:o7,path:ff,pathRound:s6,permute:y0,pie:lv,piecewise:Mm,pointRadial:Zo,pointer:fe,pointers:m3,polygonArea:v7,polygonCentroid:$7,polygonContains:A7,polygonHull:S7,polygonLength:T7,precisionFixed:Ny,precisionPrefix:Fy,precisionRound:Oy,quadtree:ks,quantile:qi,quantileIndex:$0,quantileSorted:v0,quantize:nC,quickselect:Ua,radialArea:hv,radialLine:fv,randomBates:C7,randomBernoulli:R7,randomBeta:_b,randomBinomial:wb,randomCauchy:I7,randomExponential:L7,randomGamma:Ah,randomGeometric:$b,randomInt:D7,randomIrwinHall:vb,randomLcg:z7,randomLogNormal:M7,randomLogistic:B7,randomNormal:Sh,randomPareto:k7,randomPoisson:N7,randomUniform:P7,randomWeibull:E7,range:$n,rank:sD,reduce:bD,reverse:xD,rgb:Zr,ribbon:g6,ribbonArrow:m6,rollup:d0,rollups:g0,scaleBand:Dh,scaleDiverging:Mx,scaleDivergingLog:Cx,scaleDivergingPow:Uh,scaleDivergingSqrt:Rk,scaleDivergingSymlog:Lx,scaleIdentity:Db,scaleImplicit:Th,scaleLinear:yi,scaleLog:Rb,scaleOrdinal:Ph,scalePoint:Mh,scalePow:dr,scaleQuantile:zb,scaleQuantize:Gb,scaleRadial:Ob,scaleSequential:Ax,scaleSequentialLog:Tx,scaleSequentialPow:Wh,scaleSequentialQuantile:Dx,scaleSequentialSqrt:kk,scaleSequentialSymlog:Px,scaleSqrt:Q7,scaleSymlog:Bb,scaleThreshold:Yb,scaleTime:Ck,scaleUtc:Lk,scan:cD,schemeAccent:Ik,schemeBlues:Jx,schemeBrBG:kx,schemeBuGn:Gx,schemeBuPu:Yx,schemeCategory10:Ek,schemeDark2:Bk,schemeGnBu:Xx,schemeGreens:tv,schemeGreys:ev,schemeObservable10:Nk,schemeOrRd:Vx,schemeOranges:iv,schemePRGn:Rx,schemePaired:Fk,schemePastel1:Ok,schemePastel2:zk,schemePiYG:Ex,schemePuBu:Ux,schemePuBuGn:Wx,schemePuOr:Ix,schemePuRd:Hx,schemePurples:nv,schemeRdBu:Bx,schemeRdGy:Nx,schemeRdPu:jx,schemeRdYlBu:Fx,schemeRdYlGn:Ox,schemeReds:rv,schemeSet1:Gk,schemeSet2:Yk,schemeSet3:Xk,schemeSpectral:zx,schemeTableau10:Vk,schemeYlGn:Zx,schemeYlGnBu:qx,schemeYlOrBr:Kx,schemeYlOrRd:Qx,select:H,selectAll:y3,selection:Zn,selector:Qa,selectorAll:vc,shuffle:fD,shuffler:w0,some:gD,sort:ac,stack:wE,stackOffsetDiverging:AE,stackOffsetExpand:SE,stackOffsetNone:Si,stackOffsetSilhouette:TE,stackOffsetWiggle:PE,stackOrderAppearance:Vv,stackOrderAscending:Wv,stackOrderDescending:ME,stackOrderInsideOut:CE,stackOrderNone:Ai,stackOrderReverse:LE,stratify:u7,style:qn,subset:SD,sum:dc,superset:A0,svg:T8,symbol:rE,symbolAsterisk:mv,symbolCircle:Vl,symbolCross:yv,symbolDiamond:xv,symbolDiamond2:vv,symbolPlus:$v,symbolSquare:_v,symbolSquare2:wv,symbolStar:Av,symbolTimes:Jh,symbolTriangle:Tv,symbolTriangle2:Pv,symbolWye:Dv,symbolX:Jh,symbols:Mv,symbolsFill:Mv,symbolsStroke:nE,text:Ls,thresholdFreedmanDiaconis:QP,thresholdScott:JP,thresholdSturges:cc,tickFormat:Pb,tickIncrement:Hn,tickStep:Va,ticks:Un,timeDay:xi,timeDays:i9,get timeFormat(){return Yh},timeFormatDefaultLocale:wx,timeFormatLocale:sx,timeFriday:jb,timeFridays:f9,timeHour:Pl,timeHours:n9,timeInterval:Mt,timeMillisecond:bi,timeMilliseconds:Xb,timeMinute:Al,timeMinutes:t9,timeMonday:Xo,timeMondays:s9,timeMonth:Ml,timeMonths:x9,get timeParse(){return _x},timeSaturday:qb,timeSaturdays:h9,timeSecond:pn,timeSeconds:Wb,timeSunday:vi,timeSundays:Zb,timeThursday:mr,timeThursdays:c9,timeTickInterval:ax,timeTicks:ox,timeTuesday:Ub,timeTuesdays:l9,timeWednesday:Hb,timeWednesdays:u9,timeWeek:vi,timeWeeks:Zb,timeYear:je,timeYears:$9,timeout:Yc,timer:xs,timerFlush:km,transition:Fm,transpose:S0,tree:m7,treemap:bb,treemapBinary:y7,treemapDice:zo,treemapResquarify:x7,treemapSlice:_l,treemapSliceDice:b7,treemapSquarify:wh,tsv:v8,tsvFormat:a8,tsvFormatBody:s8,tsvFormatRow:u8,tsvFormatRows:l8,tsvFormatValue:c8,tsvParse:by,tsvParseRows:o8,union:AD,unixDay:Oh,unixDays:a9,utcDay:Yo,utcDays:o9,get utcFormat(){return Ll},utcFriday:Jb,utcFridays:y9,utcHour:Dl,utcHours:r9,utcMillisecond:bi,utcMilliseconds:Xb,utcMinute:Tl,utcMinutes:e9,utcMonday:Vo,utcMondays:p9,utcMonth:Cl,utcMonths:v9,get utcParse(){return Xh},utcSaturday:tx,utcSaturdays:b9,utcSecond:pn,utcSeconds:Wb,utcSunday:$i,utcSundays:ex,utcThursday:br,utcThursdays:m9,utcTickInterval:ix,utcTicks:rx,utcTuesday:Kb,utcTuesdays:d9,utcWednesday:Qb,utcWednesdays:g9,utcWeek:$i,utcWeeks:ex,utcYear:qe,utcYears:_9,variance:a0,window:_c,xml:S8,zip:pD,zoom:Qo,zoomIdentity:Kl,zoomTransform:Hv},Symbol.toStringTag,{value:"Module"}));function qv(t){try{return t.node().getBBox()}catch(e){throw new Error(e)}}function FE(t,e){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=t.node();for(;r.hasChildNodes();)r.removeChild(r.firstChild);t.node().appendChild(n(e))}function Jo(t){return t.substring(0,4)!=="ease"?uo:ap[t]??uo}function Ql({axisWidth:t,innerRadius:e,outerRadius:n,padAngle:r,cornerRadius:i}){const o=yi().domain([0,1]).range([0,t/2]),a=o(n);return Ol().innerRadius(o(e)).outerRadius(a).padAngle(r).padRadius(a).cornerRadius(i)}const xr=(t,e)=>{if(e instanceof Function){const n=e(t);return String(n??"")}return bo(e)(t)};function ta(t,e=10){var i;const n=document.createElement("canvas").getContext("2d");return(((i=n==null?void 0:n.measureText(t))==null?void 0:i.width)??0)*e/10}function bt(t,e){const n=e.colors[e.colorScheme];return t==="series"?n.series[0]:t=="none"?"none":n[t]!=null?n[t]:n.primary}function we({datum:t,colorType:e,fullChartParams:n}){return e==="series"?t.color?t.color:n.colors[n.colorScheme].series[0]:e=="none"?"none":n.colors[n.colorScheme][e]!=null?n.colors[n.colorScheme][e]:n.colors[n.colorScheme].primary}function J(t,e,n){const r=n?`--${n}`:"";return`orbcharts-${t}__${e}${r}`}function Ke(t,e){const r=Math.random().toString(36).substr(2,5);return J(t,e,r)}function ea(t,e){let n=new pt(()=>{});return t.each(function(){const r=_u(this,e);n=Su(n,r)}),n}const vr=({selection:t,pluginName:e,clipPathID:n,seriesLabels$:r,gridContainerPosition$:i,gridAxesTransform$:o,gridGraphicTransform$:a})=>{const s=J(e,"series"),l=J(e,"axes"),u=J(e,"graphic"),c=r.pipe(B((d,m)=>t.selectAll(`g.${s}`).data(d,g=>g).join(g=>g.append("g").classed(s,!0).each((y,b,v)=>{H(v[b]).selectAll(`g.${l}`).data([b]).join(x=>x.append("g").classed(l,!0).attr("clip-path",`url(#${n})`).each((_,S,A)=>{H(A[S]).selectAll("defs").data([S]).join("defs"),H(A[S]).selectAll("g").data([S]).join("g").classed(u,!0)}),x=>x,x=>x.remove())}),g=>g,g=>g.remove())),yt(1));Y({seriesSelection:c,gridContainerPosition:i}).pipe(G(async d=>d)).subscribe(d=>{d.seriesSelection.transition().attr("transform",(m,g)=>{const y=d.gridContainerPosition[g]??d.gridContainerPosition[0],b=y.translate,v=y.scale;return`translate(${b[0]}, ${b[1]}) scale(${v[0]}, ${v[1]})`})});const f=Y({seriesSelection:c,gridAxesTransform:o}).pipe(G(async d=>d),B(d=>d.seriesSelection.select(`g.${l}`).style("transform",d.gridAxesTransform.value)),yt(1)),h=f.pipe(B(d=>d.select("defs")),yt(1)),p=Y({axesSelection:f,gridGraphicTransform:a}).pipe(G(async d=>d),B(d=>{const m=d.axesSelection.select(`g.${u}`);return m.transition().duration(50).style("transform",d.gridGraphicTransform.value),m}),yt(1));return{seriesSelection$:c,axesSelection$:f,defsSelection$:h,graphicGSelection$:p}},Zv=({fullDataFormatter$:t,gridAxesSize$:e,computedData$:n,fullChartParams$:r,gridContainerPosition$:i,layout$:o})=>{const a=new tt,s=Y({fullDataFormatter:t,gridAxesSize:e,computedData:n}).pipe(G(async h=>h),B(h=>{const p=h.computedData[0]?h.computedData[0].length-1:0,d=h.fullDataFormatter.grid.groupAxis.scaleDomain[0]-h.fullDataFormatter.grid.groupAxis.scalePadding,m=h.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="max"?p+h.fullDataFormatter.grid.groupAxis.scalePadding:h.fullDataFormatter.grid.groupAxis.scaleDomain[1]+h.fullDataFormatter.grid.groupAxis.scalePadding;return[d,m]}),yt(1)),l=Y({fullDataFormatter:t,computedData:n}).pipe(G(async h=>h),B(h=>h.fullDataFormatter.grid.seriesDirection==="row"?(h.computedData[0]??[]).map(p=>p.groupLabel):h.computedData.map(p=>p[0].groupLabel))),u=Y({groupScaleDomain:s,groupLabels:l}).pipe(G(async h=>h),B(h=>h.groupLabels.filter((p,d)=>d>=h.groupScaleDomain[0]&&d<=h.groupScaleDomain[1]))),c=i.pipe(B(h=>h.reduce((d,m)=>m.columnIndex>d?m.columnIndex:d,0)+1),Q()),f=i.pipe(B(h=>h.reduce((d,m)=>m.rowIndex>d?m.rowIndex:d,0)+1),Q());return new pt(h=>{Y({dataFormatter:t,axisSize:e,fullChartParams:r,scaleRangeGroupLabels:u,groupLabels:l,groupScaleDomain:s,columnAmount:c,rowAmount:f,layout:o}).pipe(k(a),G(async p=>p)).subscribe(p=>{const d=p.dataFormatter.grid.valueAxis.position==="right"||p.dataFormatter.grid.valueAxis.position==="bottom",m=Kg({axisLabels:p.scaleRangeGroupLabels,axisWidth:p.axisSize.width,padding:p.dataFormatter.grid.groupAxis.scalePadding,reverse:d}),g=b=>p.dataFormatter.grid.groupAxis.position==="bottom"||p.dataFormatter.grid.groupAxis.position==="top"?b.offsetX-p.fullChartParams.padding.left:b.offsetY-p.fullChartParams.padding.top,y=b=>{const v={offsetX:b.offsetX*p.columnAmount%p.layout.rootWidth,offsetY:b.offsetY*p.rowAmount%p.layout.rootHeight},x=g(v),_=m(x),S=Math.ceil(p.groupScaleDomain[0]),A=_+S;return{groupIndex:A,groupLabel:p.groupLabels[A]??""}};return h.next(y),function(){a.next(void 0)}})})},OE=({rootSelection:t,fullDataFormatter$:e,gridAxesSize$:n,computedData$:r,fullChartParams$:i,gridContainerPosition$:o,layout$:a})=>{const s=ea(t,"mousemove"),l=Y({fullDataFormatter:e,gridAxesSize:n,computedData:r}).pipe(G(async b=>b),B(b=>{const v=b.computedData[0]?b.computedData[0].length-1:0,x=b.fullDataFormatter.grid.groupAxis.scaleDomain[0]-b.fullDataFormatter.grid.groupAxis.scalePadding,_=b.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="max"?v+b.fullDataFormatter.grid.groupAxis.scalePadding:b.fullDataFormatter.grid.groupAxis.scaleDomain[1]+b.fullDataFormatter.grid.groupAxis.scalePadding;return[x,_]}),yt(1)),u=Y({fullDataFormatter:e,computedData:r}).pipe(G(async b=>b),B(b=>b.fullDataFormatter.grid.seriesDirection==="row"?(b.computedData[0]??[]).map(v=>v.groupLabel):b.computedData.map(v=>v[0].groupLabel))),c=Y({groupScaleDomain:l,groupLabels:u}).pipe(G(async b=>b),B(b=>b.groupLabels.filter((v,x)=>x>=b.groupScaleDomain[0]&&x<=b.groupScaleDomain[1]))),f=e.pipe(B(b=>b.grid.valueAxis.position==="right"||b.grid.valueAxis.position==="bottom")),h=Y({reverse:f,gridAxesSize:n,scaleRangeGroupLabels:c,fullDataFormatter:e}).pipe(G(async b=>b),B(b=>Kg({axisLabels:b.scaleRangeGroupLabels,axisWidth:b.gridAxesSize.width,padding:b.fullDataFormatter.grid.groupAxis.scalePadding,reverse:b.reverse}))),p=o.pipe(B(b=>b.reduce((x,_)=>_.columnIndex>x?_.columnIndex:x,0)+1),Q()),d=o.pipe(B(b=>b.reduce((x,_)=>_.rowIndex>x?_.rowIndex:x,0)+1),Q()),m=Y({fullDataFormatter:e,fullChartParams:i,rootMousemove:s,columnAmount:p,rowAmount:d,layout:a}).pipe(G(async b=>b),B(b=>{const v={offsetX:b.rootMousemove.offsetX*b.columnAmount%b.layout.rootWidth,offsetY:b.rootMousemove.offsetY*b.rowAmount%b.layout.rootHeight};return b.fullDataFormatter.grid.groupAxis.position==="bottom"||b.fullDataFormatter.grid.groupAxis.position==="top"?v.offsetX-b.fullChartParams.padding.left:v.offsetY-b.fullChartParams.padding.top})),g=Y({xIndexScale:h,axisValue:m,groupScaleDomain:l}).pipe(G(async b=>b),B(b=>{const v=b.xIndexScale(b.axisValue),x=Math.ceil(b.groupScaleDomain[0]);return v+x})),y=Y({groupIndex:g,groupLabels:u}).pipe(G(async b=>b),B(b=>b.groupLabels[b.groupIndex]??""));return Y({groupIndex:g,groupLabel:y}).pipe(G(async b=>b),B(b=>({groupIndex:b.groupIndex,groupLabel:b.groupLabel})))};function zE(t="curveLinear"){return Yl().x(e=>e.axisX).y(e=>e.axisY).curve(ap[t])}function GE(t){let e=[[]],n=0;for(let r in t){if(t[r].visible==!1||t[r].value===void 0||t[r].value===null){e[n].length&&(n++,e[n]=[]);continue}e[n].push(t[r])}return e}function YE({selection:t,pathClassName:e,segmentData:n,linePath:r,params:i}){return t.selectAll("path").data(n,(a,s)=>a.length?`${a[0].id}_${a[a.length-1].id}`:s).join(a=>a.append("path").classed(e,!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 XE({selection:t,seriesLabel:e,fullChartParams:n}){if(t.interrupt("highlight"),!e){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{r===e?H(o[i]).style("opacity",1):H(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}function VE({defsSelection:t,clipPathData:e,transitionDuration:n,transitionEase:r}){t.selectAll("clipPath").data(e).join(i=>i.append("clipPath"),i=>i,i=>i.remove()).attr("id",i=>i.id).each((i,o,a)=>{H(a[o]).selectAll("rect").data([i]).join(s=>{const l=s.append("rect");return l.transition().duration(n).ease(Jo(r)).tween("tween",(u,c,f)=>h=>{const p=u.width*h;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 Kv=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullDataFormatter$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:m,gridContainerPosition$:g,allContainerPosition$:y,layout$:b,event$:v})=>{const x=new tt,_=Ke(t,"clipPath-box"),S=J(t,"path"),{seriesSelection$:A,axesSelection$:T,defsSelection$:C,graphicGSelection$:I}=vr({selection:e,pluginName:t,clipPathID:_,seriesLabels$:a,gridContainerPosition$:g,gridAxesTransform$:h,gridGraphicTransform$:p}),$=new pt(O=>{const E=u.pipe(k(x)).subscribe(N=>{if(!N)return;const R=zE(N.lineCurve);O.next(R)});return()=>{E.unsubscribe()}}),L=f.pipe(B(O=>O.transitionDuration),Q()),P=f.pipe(B(O=>O.transitionEase),Q());Y({defsSelection:C,seriesLabels:a,axisSize:d,transitionDuration:L,transitionEase:P}).pipe(k(x),G(async O=>O)).subscribe(O=>{const N=[{id:_,width:O.axisSize.width,height:O.axisSize.height}].concat(O.seriesLabels.map(R=>({id:`orbcharts__clipPath_${R}`,width:O.axisSize.width,height:O.axisSize.height})));VE({defsSelection:O.defsSelection,clipPathData:N,transitionDuration:O.transitionDuration,transitionEase:O.transitionEase})});const w=n.pipe(B(O=>{const E=new Map;return O.flat().forEach(N=>E.set(N.id,N)),E})),M=Zv({fullDataFormatter$:c,gridAxesSize$:d,computedData$:n,fullChartParams$:f,gridContainerPosition$:y,layout$:b}),D=f.pipe(k(x),B(O=>O.highlightTarget),Q()),X=Y({graphicGSelection:I,visibleComputedLayoutData:o,linePath:$,params:u}).pipe(k(x),G(async O=>O),B(O=>{let E=[];return O.graphicGSelection.each((N,R,F)=>{const U=GE(O.visibleComputedLayoutData[R]??[]);E[R]=YE({selection:H(F[R]),pathClassName:S,linePath:O.linePath,segmentData:U,params:O.params})}),E}));return Y({pathSelectionArr:X,computedData:n,SeriesDataMap:s,GroupDataMap:l,highlightTarget:D,gridGroupPositionFn:M}).pipe(k(x),G(async O=>O)).subscribe(O=>{O.pathSelectionArr.forEach(E=>{E.on("mouseover",(N,R)=>{N.stopPropagation();const F=R[0]?R[0].seriesLabel:"",{groupIndex:U,groupLabel:it}=O.gridGroupPositionFn(N),V=O.GroupDataMap.get(it).find(Z=>Z.seriesLabel===F)??R[0];v.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:O.highlightTarget,datum:V,gridIndex:V.gridIndex,series:O.SeriesDataMap.get(V.seriesLabel),seriesIndex:V.seriesIndex,seriesLabel:V.seriesLabel,groups:O.GroupDataMap.get(V.groupLabel),groupIndex:V.groupIndex,groupLabel:V.groupLabel,event:N,data:O.computedData})}).on("mousemove",(N,R)=>{N.stopPropagation();const F=R[0]?R[0].seriesLabel:"",{groupIndex:U,groupLabel:it}=O.gridGroupPositionFn(N),V=O.GroupDataMap.get(it).find(Z=>Z.seriesLabel===F)??R[0];v.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:O.highlightTarget,datum:V,gridIndex:V.gridIndex,series:O.SeriesDataMap.get(V.seriesLabel),seriesIndex:V.seriesIndex,seriesLabel:V.seriesLabel,groups:O.GroupDataMap.get(V.groupLabel),groupIndex:V.groupIndex,groupLabel:V.groupLabel,event:N,data:O.computedData})}).on("mouseout",(N,R)=>{N.stopPropagation();const F=R[0]?R[0].seriesLabel:"",{groupIndex:U,groupLabel:it}=O.gridGroupPositionFn(N),V=O.GroupDataMap.get(it).find(Z=>Z.seriesLabel===F)??R[0];v.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:O.highlightTarget,datum:V,gridIndex:V.gridIndex,series:O.SeriesDataMap.get(V.seriesLabel),seriesIndex:V.seriesIndex,seriesLabel:V.seriesLabel,groups:O.GroupDataMap.get(V.groupLabel),groupIndex:V.groupIndex,groupLabel:V.groupLabel,event:N,data:O.computedData})}).on("click",(N,R)=>{N.stopPropagation();const F=R[0]?R[0].seriesLabel:"",{groupIndex:U,groupLabel:it}=O.gridGroupPositionFn(N),V=O.GroupDataMap.get(it).find(Z=>Z.seriesLabel===F)??R[0];v.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:O.highlightTarget,datum:V,gridIndex:V.gridIndex,series:O.SeriesDataMap.get(V.seriesLabel),seriesIndex:V.seriesIndex,seriesLabel:V.seriesLabel,groups:O.GroupDataMap.get(V.groupLabel),groupIndex:V.groupIndex,groupLabel:V.groupLabel,event:N,data:O.computedData})})})}),f.pipe(k(x),Dr(O=>O.highlightTarget==="series"),G(O=>Y({graphicGSelection:I,gridHighlight:m,DataMap:w,fullChartParams:f}).pipe(k(x),G(async E=>E)))).subscribe(O=>{const E=O.gridHighlight[0]?O.gridHighlight[0].seriesLabel:null;XE({selection:O.graphicGSelection,seriesLabel:E,fullChartParams:O.fullChartParams})}),()=>{x.next(void 0)}},Qv=0,gn=2,Jv=3,t2=4,Ee=5,Jl=6,sp=7,na=8,ra=9,e2="Lines",WE=ie({name:e2,defaultParams:wr,layerIndex:Ee,validator:(t,{validateColumns:e})=>e(t,{lineCurve:{toBeTypes:["string"]},lineWidth:{toBeTypes:["number"]}})})(({selection:t,rootSelection:e,name:n,observer:r,subject:i})=>{const o=new tt,a=Kv(e2,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,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 UE(t="curveLinear",e){return qh().x(n=>n.axisX).y0(n=>e).y1(n=>n.axisY).curve(ap[t])}function HE(t){let e=[[]],n=0;for(let r in t){if(t[r].visible==!1||t[r].value===void 0||t[r].value===null){e[n].length&&(n++,e[n]=[]);continue}e[n].push(t[r])}return e}function jE({selection:t,pathClassName:e,segmentData:n,areaPath:r,linearGradientIds:i,params:o}){return t.selectAll("path").data(n,(s,l)=>s.length?`${s[0].id}_${s[s.length-1].id}`:l).join(s=>s.append("path").classed(e,!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 qE({selection:t,seriesLabel:e,fullChartParams:n}){if(t.interrupt("highlight"),!e){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{r===e?H(o[i]).style("opacity",1):H(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}function ZE({defsSelection:t,computedData:e,linearGradientIds:n,params:r}){t.selectAll("linearGradient").data(e??[]).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`
46
+ `)}function u(f){return f.map(c).join(e)}function c(f){return f==null?"":f instanceof Date?M6(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:r,parseRows:i,format:a,formatBody:s,formatRows:l,formatRow:u,formatValue:c}}var hr=Os(","),Cy=hr.parse,C6=hr.parseRows,L6=hr.format,k6=hr.formatBody,R6=hr.formatRows,E6=hr.formatRow,I6=hr.formatValue,pr=Os(" "),Ly=pr.parse,B6=pr.parseRows,N6=pr.format,F6=pr.formatBody,z6=pr.formatRows,O6=pr.formatRow,G6=pr.formatValue;function Y6(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})?)?$/))W6&&i[4]&&!i[7]&&(n=n.replace(/-/g,"/").replace(/T/," ")),n=new Date(n);else continue;e[t]=n}return e}const W6=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();function X6(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.blob()}function V6(e,t){return fetch(e,t).then(X6)}function U6(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.arrayBuffer()}function H6(e,t){return fetch(e,t).then(U6)}function j6(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.text()}function Gs(e,t){return fetch(e,t).then(j6)}function ky(e){return function(t,n,r){return arguments.length===2&&typeof n=="function"&&(r=n,n=void 0),Gs(t,n).then(function(i){return e(i,r)})}}function q6(e,t,n,r){arguments.length===3&&typeof n=="function"&&(r=n,n=void 0);var i=Os(e);return Gs(t,n).then(function(o){return i.parse(o,r)})}var Z6=ky(Cy),K6=ky(Ly);function Q6(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 J6(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);if(!(e.status===204||e.status===205))return e.json()}function e8(e,t){return fetch(e,t).then(J6)}function Rf(e){return(t,n)=>Gs(t,n).then(r=>new DOMParser().parseFromString(r,e))}const t8=Rf("application/xml");var n8=Rf("text/html"),r8=Rf("image/svg+xml");function Ef(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 i8(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return Ry(this.cover(t,n),t,n,e)}function Ry(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,f,h,p,d,m,g,y,b;if(!o)return e._root=a,e;for(;o.length;)if((m=t>=(f=(s+u)/2))?s=f:u=f,(g=n>=(h=(l+c)/2))?l=h:c=h,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>=(f=(s+u)/2))?s=f:u=f,(g=n>=(h=(l+c)/2))?l=h:c=h;while((y=g<<1|m)===(b=(d>=h)<<1|p>=f));return i[b]=o,i[y]=a,e}function o8(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,f=-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>f&&(f=o));if(l>c||u>f)return this;for(this.cover(l,u).cover(c,f),n=0;n<r;++n)Ry(this,a[n],s[n],e[n]);return this}function a8(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 s8(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function l8(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 qe(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function u8(e,t,n){var r,i=this._x0,o=this._y0,a,s,l,u,c=this._x1,f=this._y1,h=[],p=this._root,d,m;for(p&&h.push(new qe(p,i,o,c,f)),n==null?n=1/0:(i=e-n,o=t-n,c=e+n,f=t+n,n*=n);d=h.pop();)if(!(!(p=d.node)||(a=d.x0)>c||(s=d.y0)>f||(l=d.x1)<i||(u=d.y1)<o))if(p.length){var g=(a+l)/2,y=(s+u)/2;h.push(new qe(p[3],g,y,l,u),new qe(p[2],a,y,g,u),new qe(p[1],g,s,l,y),new qe(p[0],a,s,g,y)),(m=(t>=y)<<1|e>=g)&&(d=h[h.length-1],h[h.length-1]=h[h.length-1-m],h[h.length-1-m]=d)}else{var b=e-+this._x.call(null,p.data),v=t-+this._y.call(null,p.data),x=b*b+v*v;if(x<n){var _=Math.sqrt(n=x);i=e-_,o=t-_,c=e+_,f=t+_,r=p.data}}return r}function c8(e){if(isNaN(c=+this._x.call(null,e))||isNaN(f=+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,f,h,p,d,m,g,y;if(!n)return this;if(n.length)for(;;){if((d=c>=(h=(a+l)/2))?a=h:l=h,(m=f>=(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 f8(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function h8(){return this._root}function p8(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function d8(e){var t=[],n,r=this._root,i,o,a,s,l;for(r&&t.push(new qe(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 qe(i,u,c,s,l)),(i=r[2])&&t.push(new qe(i,o,c,u,l)),(i=r[1])&&t.push(new qe(i,u,a,s,c)),(i=r[0])&&t.push(new qe(i,o,a,u,c))}return this}function g8(e){var t=[],n=[],r;for(this._root&&t.push(new qe(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,f=(s+u)/2;(o=i[0])&&t.push(new qe(o,a,s,c,f)),(o=i[1])&&t.push(new qe(o,c,s,l,f)),(o=i[2])&&t.push(new qe(o,a,f,c,u)),(o=i[3])&&t.push(new qe(o,c,f,l,u))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function m8(e){return e[0]}function y8(e){return arguments.length?(this._x=e,this):this._x}function b8(e){return e[1]}function x8(e){return arguments.length?(this._y=e,this):this._y}function Ys(e,t,n){var r=new If(t??m8,n??b8,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function If(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 Ey(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var Ze=Ys.prototype=If.prototype;Ze.copy=function(){var e=new If(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=Ey(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]=Ey(r));return e},Ze.add=i8,Ze.addAll=o8,Ze.cover=a8,Ze.data=s8,Ze.extent=l8,Ze.find=u8,Ze.remove=c8,Ze.removeAll=f8,Ze.root=h8,Ze.size=p8,Ze.visit=d8,Ze.visitAfter=g8,Ze.x=y8,Ze.y=x8;function Re(e){return function(){return e}}function Mn(e){return(e()-.5)*1e-6}function v8(e){return e.x+e.vx}function $8(e){return e.y+e.vy}function Ws(e){var t,n,r,i=1,o=1;typeof e!="function"&&(e=Re(e==null?1:+e));function a(){for(var u,c=t.length,f,h,p,d,m,g,y=0;y<o;++y)for(f=Ys(t,v8,$8).visitAfter(s),u=0;u<c;++u)h=t[u],m=n[h.index],g=m*m,p=h.x+h.vx,d=h.y+h.vy,f.visit(b);function b(v,x,_,A,S){var P=v.data,M=v.r,B=m+M;if(P){if(P.index>h.index){var $=p-P.x-P.vx,k=d-P.y-P.vy,C=$*$+k*k;C<B*B&&($===0&&($=Mn(r),C+=$*$),k===0&&(k=Mn(r),C+=k*k),C=(B-(C=Math.sqrt(C)))/C*i,h.vx+=($*=C)*(B=(M*=M)/(g+M)),h.vy+=(k*=C)*B,P.vx-=$*(B=1-B),P.vy-=k*B)}return}return x>p+B||A<p-B||_>d+B||S<d-B}}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,f;for(n=new Array(c),u=0;u<c;++u)f=t[u],n[f.index]=+e(f,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:Re(+u),l(),a):e},a}function _8(e){return e.index}function Iy(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function Bf(e){var t=_8,n=f,r,i=Re(30),o,a,s,l,u,c=1;e==null&&(e=[]);function f(g){return 1/Math.min(s[g.source.index],s[g.target.index])}function h(g){for(var y=0,b=e.length;y<c;++y)for(var v=0,x,_,A,S,P,M,B;v<b;++v)x=e[v],_=x.source,A=x.target,S=A.x+A.vx-_.x-_.vx||Mn(u),P=A.y+A.vy-_.y-_.vy||Mn(u),M=Math.sqrt(S*S+P*P),M=(M-o[v])/M*g*r[v],S*=M,P*=M,A.vx-=S*(B=l[v]),A.vy-=P*B,_.vx+=S*(B=1-B),_.vy+=P*B}function p(){if(a){var g,y=a.length,b=e.length,v=new Map(a.map((_,A)=>[t(_,A,a),_])),x;for(g=0,s=new Array(y);g<b;++g)x=e[g],x.index=g,typeof x.source!="object"&&(x.source=Iy(v,x.source)),typeof x.target!="object"&&(x.target=Iy(v,x.target)),s[x.source.index]=(s[x.source.index]||0)+1,s[x.target.index]=(s[x.target.index]||0)+1;for(g=0,l=new Array(b);g<b;++g)x=e[g],l[g]=s[x.source.index]/(s[x.source.index]+s[x.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 h.initialize=function(g,y){a=g,u=y,p()},h.links=function(g){return arguments.length?(e=g,p(),h):e},h.id=function(g){return arguments.length?(t=g,h):t},h.iterations=function(g){return arguments.length?(c=+g,h):c},h.strength=function(g){return arguments.length?(n=typeof g=="function"?g:Re(+g),d(),h):n},h.distance=function(g){return arguments.length?(i=typeof g=="function"?g:Re(+g),m(),h):i},h}const S8=1664525,w8=1013904223,By=4294967296;function T8(){let e=1;return()=>(e=(S8*e+w8)%By)/By}function A8(e){return e.x}function P8(e){return e.y}var D8=10,M8=Math.PI*(3-Math.sqrt(5));function Xs(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,l=Ms(f),u=Qn("tick","end"),c=T8();e==null&&(e=[]);function f(){h(),u.call("tick",t),n<r&&(l.stop(),u.call("end",t))}function h(m){var g,y=e.length,b;m===void 0&&(m=1);for(var v=0;v<m;++v)for(n+=(o-n)*i,s.forEach(function(x){x(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=D8*Math.sqrt(.5+m),v=m*M8;y.x=b*Math.cos(v),y.y=b*Math.sin(v)}(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:h,restart:function(){return l.restart(f),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,v=e.length,x,_,A,S,P;for(y==null?y=1/0:y*=y,b=0;b<v;++b)S=e[b],x=m-S.x,_=g-S.y,A=x*x+_*_,A<y&&(P=S,y=A);return P},on:function(m,g){return arguments.length>1?(u.on(m,g),t):u.on(m)}}}function Vs(){var e,t,n,r,i=Re(-30),o,a=1,s=1/0,l=.81;function u(p){var d,m=e.length,g=Ys(e,A8,P8).visitAfter(f);for(r=p,d=0;d<m;++d)t=e[d],g.visit(h)}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 f(p){var d=0,m,g,y=0,b,v,x;if(p.length){for(b=v=x=0;x<4;++x)(m=p[x])&&(g=Math.abs(m.value))&&(d+=m.value,y+=g,b+=g*m.x,v+=g*m.y);p.x=b/y,p.y=v/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 h(p,d,m,g){if(!p.value)return!0;var y=p.x-t.x,b=p.y-t.y,v=g-d,x=y*y+b*b;if(v*v/l<x)return x<s&&(y===0&&(y=Mn(n),x+=y*y),b===0&&(b=Mn(n),x+=b*b),x<a&&(x=Math.sqrt(a*x)),t.vx+=y*p.value*r/x,t.vy+=b*p.value*r/x),!0;if(p.length||x>=s)return;(p.data!==t||p.next)&&(y===0&&(y=Mn(n),x+=y*y),b===0&&(b=Mn(n),x+=b*b),x<a&&(x=Math.sqrt(a*x)));do p.data!==t&&(v=o[p.data.index]*r/x,t.vx+=y*v,t.vy+=b*v);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:Re(+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 C8(e,t,n){var r,i=Re(.1),o,a;typeof e!="function"&&(e=Re(+e)),t==null&&(t=0),n==null&&(n=0);function s(u){for(var c=0,f=r.length;c<f;++c){var h=r[c],p=h.x-t||1e-6,d=h.y-n||1e-6,m=Math.sqrt(p*p+d*d),g=(a[c]-m)*o[c]*u/m;h.vx+=p*g,h.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:Re(+u),l(),s):i},s.radius=function(u){return arguments.length?(e=typeof u=="function"?u:Re(+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 Ny(e){var t=Re(.1),n,r,i;typeof e!="function"&&(e=Re(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:Re(+s),a(),o):t},o.x=function(s){return arguments.length?(e=typeof s=="function"?s:Re(+s),a(),o):e},o}function Fy(e){var t=Re(.1),n,r,i;typeof e!="function"&&(e=Re(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:Re(+s),a(),o):t},o.y=function(s){return arguments.length?(e=typeof s=="function"?s:Re(+s),a(),o):e},o}function L8(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Us(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 pi(e){return e=Us(Math.abs(e)),e?e[1]:NaN}function k8(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 R8(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var E8=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function di(e){if(!(t=E8.exec(e)))throw new Error("invalid format: "+e);var t;return new Hs({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]})}di.prototype=Hs.prototype;function Hs(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+""}Hs.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 I8(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 zy;function B8(e,t){var n=Us(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(zy=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")+Us(e,Math.max(0,t+o-1))[0]}function Oy(e,t){var n=Us(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 Gy={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:L8,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)=>Oy(e*100,t),r:Oy,s:B8,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Yy(e){return e}var Wy=Array.prototype.map,Xy=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Vy(e){var t=e.grouping===void 0||e.thousands===void 0?Yy:k8(Wy.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?Yy:R8(Wy.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(f){f=di(f);var h=f.fill,p=f.align,d=f.sign,m=f.symbol,g=f.zero,y=f.width,b=f.comma,v=f.precision,x=f.trim,_=f.type;_==="n"?(b=!0,_="g"):Gy[_]||(v===void 0&&(v=12),x=!0,_="g"),(g||h==="0"&&p==="=")&&(g=!0,h="0",p="=");var A=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",S=m==="$"?r:/[%p]/.test(_)?a:"",P=Gy[_],M=/[defgprs%]/.test(_);v=v===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function B($){var k=A,C=S,T,w,D;if(_==="c")C=P($)+C,$="";else{$=+$;var F=$<0||1/$<0;if($=isNaN($)?l:P(Math.abs($),v),x&&($=I8($)),F&&+$==0&&d!=="+"&&(F=!1),k=(F?d==="("?d:s:d==="-"||d==="("?"":d)+k,C=(_==="s"?Xy[8+zy/3]:"")+C+(F&&d==="("?")":""),M){for(T=-1,w=$.length;++T<w;)if(D=$.charCodeAt(T),48>D||D>57){C=(D===46?i+$.slice(T+1):$.slice(T))+C,$=$.slice(0,T);break}}}b&&!g&&($=t($,1/0));var z=k.length+$.length+C.length,I=z<y?new Array(y-z+1).join(h):"";switch(b&&g&&($=t(I+$,I.length?y-C.length:1/0),I=""),p){case"<":$=k+$+C+I;break;case"=":$=k+I+$+C;break;case"^":$=I.slice(0,z=I.length>>1)+k+$+C+I.slice(z);break;default:$=I+k+$+C;break}return o($)}return B.toString=function(){return f+""},B}function c(f,h){var p=u((f=di(f),f.type="f",f)),d=Math.max(-8,Math.min(8,Math.floor(pi(h)/3)))*3,m=Math.pow(10,-d),g=Xy[8+d/3];return function(y){return p(m*y)+g}}return{format:u,formatPrefix:c}}var js,Co,Nf;Uy({thousands:",",grouping:[3],currency:["$",""]});function Uy(e){return js=Vy(e),Co=js.format,Nf=js.formatPrefix,js}function Hy(e){return Math.max(0,-pi(Math.abs(e)))}function jy(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(pi(t)/3)))*3-pi(Math.abs(e)))}function qy(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,pi(t)-pi(e))+1}var oe=1e-6,Lo=1e-12,he=Math.PI,Ae=he/2,qs=he/4,Ke=he*2,ve=180/he,ae=he/180,ge=Math.abs,gi=Math.atan,Qe=Math.atan2,re=Math.cos,Zs=Math.ceil,Zy=Math.exp,Ff=Math.hypot,Ks=Math.log,zf=Math.pow,te=Math.sin,$t=Math.sign||function(e){return e>0?1:e<0?-1:0},Ne=Math.sqrt,Of=Math.tan;function Ky(e){return e>1?0:e<-1?he:Math.acos(e)}function Je(e){return e>1?Ae:e<-1?-Ae:Math.asin(e)}function Qy(e){return(e=te(e/2))*e}function we(){}function Qs(e,t){e&&e1.hasOwnProperty(e.type)&&e1[e.type](e,t)}var Jy={Feature:function(e,t){Qs(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Qs(n[r].geometry,t)}},e1={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){Gf(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Gf(n[r],t,0)},Polygon:function(e,t){t1(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)t1(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Qs(n[r],t)}};function Gf(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 t1(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Gf(e[n],t,1);t.polygonEnd()}function Bt(e,t){e&&Jy.hasOwnProperty(e.type)?Jy[e.type](e,t):Qs(e,t)}var Js=new ke,el=new ke,n1,r1,Yf,Wf,Xf,Ht={point:we,lineStart:we,lineEnd:we,polygonStart:function(){Js=new ke,Ht.lineStart=N8,Ht.lineEnd=F8},polygonEnd:function(){var e=+Js;el.add(e<0?Ke+e:e),this.lineStart=this.lineEnd=this.point=we},sphere:function(){el.add(Ke)}};function N8(){Ht.point=z8}function F8(){i1(n1,r1)}function z8(e,t){Ht.point=i1,n1=e,r1=t,e*=ae,t*=ae,Yf=e,Wf=re(t=t/2+qs),Xf=te(t)}function i1(e,t){e*=ae,t*=ae,t=t/2+qs;var n=e-Yf,r=n>=0?1:-1,i=r*n,o=re(t),a=te(t),s=Xf*a,l=Wf*o+s*re(i),u=s*r*te(i);Js.add(Qe(u,l)),Yf=e,Wf=o,Xf=a}function O8(e){return el=new ke,Bt(e,Ht),el*2}function tl(e){return[Qe(e[1],e[0]),Je(e[2])]}function dr(e){var t=e[0],n=e[1],r=re(n);return[r*re(t),r*te(t),te(n)]}function nl(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function mi(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 Vf(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function rl(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function il(e){var t=Ne(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var Te,ut,Pe,mt,gr,o1,a1,yi,ko,Cn,ln,un={point:Uf,lineStart:l1,lineEnd:u1,polygonStart:function(){un.point=c1,un.lineStart=G8,un.lineEnd=Y8,ko=new ke,Ht.polygonStart()},polygonEnd:function(){Ht.polygonEnd(),un.point=Uf,un.lineStart=l1,un.lineEnd=u1,Js<0?(Te=-(Pe=180),ut=-(mt=90)):ko>oe?mt=90:ko<-oe&&(ut=-90),ln[0]=Te,ln[1]=Pe},sphere:function(){Te=-(Pe=180),ut=-(mt=90)}};function Uf(e,t){Cn.push(ln=[Te=e,Pe=e]),t<ut&&(ut=t),t>mt&&(mt=t)}function s1(e,t){var n=dr([e*ae,t*ae]);if(yi){var r=mi(yi,n),i=[r[1],-r[0],0],o=mi(i,r);il(o),o=tl(o);var a=e-gr,s=a>0?1:-1,l=o[0]*ve*s,u,c=ge(a)>180;c^(s*gr<l&&l<s*e)?(u=o[1]*ve,u>mt&&(mt=u)):(l=(l+360)%360-180,c^(s*gr<l&&l<s*e)?(u=-o[1]*ve,u<ut&&(ut=u)):(t<ut&&(ut=t),t>mt&&(mt=t))),c?e<gr?yt(Te,e)>yt(Te,Pe)&&(Pe=e):yt(e,Pe)>yt(Te,Pe)&&(Te=e):Pe>=Te?(e<Te&&(Te=e),e>Pe&&(Pe=e)):e>gr?yt(Te,e)>yt(Te,Pe)&&(Pe=e):yt(e,Pe)>yt(Te,Pe)&&(Te=e)}else Cn.push(ln=[Te=e,Pe=e]);t<ut&&(ut=t),t>mt&&(mt=t),yi=n,gr=e}function l1(){un.point=s1}function u1(){ln[0]=Te,ln[1]=Pe,un.point=Uf,yi=null}function c1(e,t){if(yi){var n=e-gr;ko.add(ge(n)>180?n+(n>0?360:-360):n)}else o1=e,a1=t;Ht.point(e,t),s1(e,t)}function G8(){Ht.lineStart()}function Y8(){c1(o1,a1),Ht.lineEnd(),ge(ko)>oe&&(Te=-(Pe=180)),ln[0]=Te,ln[1]=Pe,yi=null}function yt(e,t){return(t-=e)<0?t+360:t}function W8(e,t){return e[0]-t[0]}function f1(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function X8(e){var t,n,r,i,o,a,s;if(mt=Pe=-(Te=ut=1/0),Cn=[],Bt(e,un),n=Cn.length){for(Cn.sort(W8),t=1,r=Cn[0],o=[r];t<n;++t)i=Cn[t],f1(r,i[0])||f1(r,i[1])?(yt(r[0],i[1])>yt(r[0],r[1])&&(r[1]=i[1]),yt(i[0],r[1])>yt(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=yt(r[1],i[0]))>a&&(a=s,Te=i[0],Pe=r[1])}return Cn=ln=null,Te===1/0||ut===1/0?[[NaN,NaN],[NaN,NaN]]:[[Te,ut],[Pe,mt]]}var Ro,ol,al,sl,ll,ul,cl,fl,Hf,jf,qf,h1,p1,et,tt,nt,Nt={sphere:we,point:Zf,lineStart:d1,lineEnd:g1,polygonStart:function(){Nt.lineStart=H8,Nt.lineEnd=j8},polygonEnd:function(){Nt.lineStart=d1,Nt.lineEnd=g1}};function Zf(e,t){e*=ae,t*=ae;var n=re(t);Eo(n*re(e),n*te(e),te(t))}function Eo(e,t,n){++Ro,al+=(e-al)/Ro,sl+=(t-sl)/Ro,ll+=(n-ll)/Ro}function d1(){Nt.point=V8}function V8(e,t){e*=ae,t*=ae;var n=re(t);et=n*re(e),tt=n*te(e),nt=te(t),Nt.point=U8,Eo(et,tt,nt)}function U8(e,t){e*=ae,t*=ae;var n=re(t),r=n*re(e),i=n*te(e),o=te(t),a=Qe(Ne((a=tt*o-nt*i)*a+(a=nt*r-et*o)*a+(a=et*i-tt*r)*a),et*r+tt*i+nt*o);ol+=a,ul+=a*(et+(et=r)),cl+=a*(tt+(tt=i)),fl+=a*(nt+(nt=o)),Eo(et,tt,nt)}function g1(){Nt.point=Zf}function H8(){Nt.point=q8}function j8(){m1(h1,p1),Nt.point=Zf}function q8(e,t){h1=e,p1=t,e*=ae,t*=ae,Nt.point=m1;var n=re(t);et=n*re(e),tt=n*te(e),nt=te(t),Eo(et,tt,nt)}function m1(e,t){e*=ae,t*=ae;var n=re(t),r=n*re(e),i=n*te(e),o=te(t),a=tt*o-nt*i,s=nt*r-et*o,l=et*i-tt*r,u=Ff(a,s,l),c=Je(u),f=u&&-c/u;Hf.add(f*a),jf.add(f*s),qf.add(f*l),ol+=c,ul+=c*(et+(et=r)),cl+=c*(tt+(tt=i)),fl+=c*(nt+(nt=o)),Eo(et,tt,nt)}function Z8(e){Ro=ol=al=sl=ll=ul=cl=fl=0,Hf=new ke,jf=new ke,qf=new ke,Bt(e,Nt);var t=+Hf,n=+jf,r=+qf,i=Ff(t,n,r);return i<Lo&&(t=ul,n=cl,r=fl,ol<oe&&(t=al,n=sl,r=ll),i=Ff(t,n,r),i<Lo)?[NaN,NaN]:[Qe(n,t)*ve,Je(r/i)*ve]}function bi(e){return function(){return e}}function Kf(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 Qf(e,t){return ge(e)>he&&(e-=Math.round(e/Ke)*Ke),[e,t]}Qf.invert=Qf;function Jf(e,t,n){return(e%=Ke)?t||n?Kf(b1(e),x1(t,n)):b1(e):t||n?x1(t,n):Qf}function y1(e){return function(t,n){return t+=e,ge(t)>he&&(t-=Math.round(t/Ke)*Ke),[t,n]}}function b1(e){var t=y1(e);return t.invert=y1(-e),t}function x1(e,t){var n=re(e),r=te(e),i=re(t),o=te(t);function a(s,l){var u=re(l),c=re(s)*u,f=te(s)*u,h=te(l),p=h*n+c*r;return[Qe(f*i-p*o,c*n-h*r),Je(p*i+f*o)]}return a.invert=function(s,l){var u=re(l),c=re(s)*u,f=te(s)*u,h=te(l),p=h*i-f*o;return[Qe(f*i+h*o,c*n+p*r),Je(p*n-c*r)]},a}function v1(e){e=Jf(e[0]*ae,e[1]*ae,e.length>2?e[2]*ae:0);function t(n){return n=e(n[0]*ae,n[1]*ae),n[0]*=ve,n[1]*=ve,n}return t.invert=function(n){return n=e.invert(n[0]*ae,n[1]*ae),n[0]*=ve,n[1]*=ve,n},t}function $1(e,t,n,r,i,o){if(n){var a=re(t),s=te(t),l=r*n;i==null?(i=t+r*Ke,o=t-l/2):(i=_1(a,i),o=_1(a,o),(r>0?i<o:i>o)&&(i+=r*Ke));for(var u,c=i;r>0?c>o:c<o;c-=l)u=tl([a,-s*re(c),-s*te(c)]),e.point(u[0],u[1])}}function _1(e,t){t=dr(t),t[0]-=e,il(t);var n=Ky(-t[1]);return((-t[2]<0?-n:n)+Ke-oe)%Ke}function K8(){var e=bi([0,0]),t=bi(90),n=bi(2),r,i,o={point:a};function a(l,u){r.push(l=i(l,u)),l[0]*=ve,l[1]*=ve}function s(){var l=e.apply(this,arguments),u=t.apply(this,arguments)*ae,c=n.apply(this,arguments)*ae;return r=[],i=Jf(-l[0]*ae,-l[1]*ae,0).invert,$1(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:bi([+l[0],+l[1]]),s):e},s.radius=function(l){return arguments.length?(t=typeof l=="function"?l:bi(+l),s):t},s.precision=function(l){return arguments.length?(n=typeof l=="function"?l:bi(+l),s):n},s}function S1(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:we,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function hl(e,t){return ge(e[0]-t[0])<oe&&ge(e[1]-t[1])<oe}function pl(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 w1(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(hl(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*oe}o.push(b=new pl(g,d,null,!0)),a.push(b.o=new pl(g,null,b,!1)),o.push(b=new pl(y,d,null,!1)),a.push(b.o=new pl(y,null,b,!0))}}),!!o.length){for(a.sort(t),T1(o),T1(a),s=0,l=a.length;s<l;++s)a[s].e=n=!n;for(var u=o[0],c,f;;){for(var h=u,p=!0;h.v;)if((h=h.n)===u)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(s=0,l=c.length;s<l;++s)i.point((f=c[s])[0],f[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(p)for(c=h.p.z,s=c.length-1;s>=0;--s)i.point((f=c[s])[0],f[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,c=h.z,p=!p}while(!h.v);i.lineEnd()}}}function T1(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 eh(e){return ge(e[0])<=he?e[0]:$t(e[0])*((ge(e[0])+he)%Ke-he)}function A1(e,t){var n=eh(t),r=t[1],i=te(r),o=[te(n),-re(n),0],a=0,s=0,l=new ke;i===1?r=Ae+oe:i===-1&&(r=-Ae-oe);for(var u=0,c=e.length;u<c;++u)if(h=(f=e[u]).length)for(var f,h,p=f[h-1],d=eh(p),m=p[1]/2+qs,g=te(m),y=re(m),b=0;b<h;++b,d=x,g=A,y=S,p=v){var v=f[b],x=eh(v),_=v[1]/2+qs,A=te(_),S=re(_),P=x-d,M=P>=0?1:-1,B=M*P,$=B>he,k=g*A;if(l.add(Qe(k*M*te(B),y*S+k*re(B))),a+=$?P+M*Ke:P,$^d>=n^x>=n){var C=mi(dr(p),dr(v));il(C);var T=mi(o,C);il(T);var w=($^P>=0?-1:1)*Je(T[2]);(r>w||r===w&&(C[0]||C[1]))&&(s+=$^P>=0?1:-1)}}return(a<-oe||a<oe&&l<-Lo)^s&1}function P1(e,t,n,r){return function(i){var o=t(i),a=S1(),s=t(a),l=!1,u,c,f,h={point:p,lineStart:m,lineEnd:g,polygonStart:function(){h.point=y,h.lineStart=b,h.lineEnd=v,c=[],u=[]},polygonEnd:function(){h.point=p,h.lineStart=m,h.lineEnd=g,c=Tc(c);var x=A1(u,r);c.length?(l||(i.polygonStart(),l=!0),w1(c,J8,x,n,i)):x&&(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(x,_){e(x,_)&&i.point(x,_)}function d(x,_){o.point(x,_)}function m(){h.point=d,o.lineStart()}function g(){h.point=p,o.lineEnd()}function y(x,_){f.push([x,_]),s.point(x,_)}function b(){s.lineStart(),f=[]}function v(){y(f[0][0],f[0][1]),s.lineEnd();var x=s.clean(),_=a.result(),A,S=_.length,P,M,B;if(f.pop(),u.push(f),f=null,!!S){if(x&1){if(M=_[0],(P=M.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),A=0;A<P;++A)i.point((B=M[A])[0],B[1]);i.lineEnd()}return}S>1&&x&2&&_.push(_.pop().concat(_.shift())),c.push(_.filter(Q8))}}return h}}function Q8(e){return e.length>1}function J8(e,t){return((e=e.x)[0]<0?e[1]-Ae-oe:Ae-e[1])-((t=t.x)[0]<0?t[1]-Ae-oe:Ae-t[1])}const th=P1(function(){return!0},e4,n4,[-he,-Ae]);function e4(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,a){var s=o>0?he:-he,l=ge(o-t);ge(l-he)<oe?(e.point(t,n=(n+a)/2>0?Ae:-Ae),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),e.point(o,n),i=0):r!==s&&l>=he&&(ge(t-r)<oe&&(t-=r*oe),ge(o-s)<oe&&(o-=s*oe),n=t4(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 t4(e,t,n,r){var i,o,a=te(e-n);return ge(a)>oe?gi((te(t)*(o=re(r))*te(n)-te(r)*(i=re(t))*te(e))/(i*o*a)):(t+r)/2}function n4(e,t,n,r){var i;if(e==null)i=n*Ae,r.point(-he,i),r.point(0,i),r.point(he,i),r.point(he,0),r.point(he,-i),r.point(0,-i),r.point(-he,-i),r.point(-he,0),r.point(-he,i);else if(ge(e[0]-t[0])>oe){var o=e[0]<t[0]?he:-he;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}function D1(e){var t=re(e),n=2*ae,r=t>0,i=ge(t)>oe;function o(c,f,h,p){$1(p,e,n,h,c,f)}function a(c,f){return re(c)*re(f)>t}function s(c){var f,h,p,d,m;return{lineStart:function(){d=p=!1,m=1},point:function(g,y){var b=[g,y],v,x=a(g,y),_=r?x?0:u(g,y):x?u(g+(g<0?he:-he),y):0;if(!f&&(d=p=x)&&c.lineStart(),x!==p&&(v=l(f,b),(!v||hl(f,v)||hl(b,v))&&(b[2]=1)),x!==p)m=0,x?(c.lineStart(),v=l(b,f),c.point(v[0],v[1])):(v=l(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(i&&f&&r^x){var A;!(_&h)&&(A=l(b,f,!0))&&(m=0,r?(c.lineStart(),c.point(A[0][0],A[0][1]),c.point(A[1][0],A[1][1]),c.lineEnd()):(c.point(A[1][0],A[1][1]),c.lineEnd(),c.lineStart(),c.point(A[0][0],A[0][1],3)))}x&&(!f||!hl(f,b))&&c.point(b[0],b[1]),f=b,p=x,h=_},lineEnd:function(){p&&c.lineEnd(),f=null},clean:function(){return m|(d&&p)<<1}}}function l(c,f,h){var p=dr(c),d=dr(f),m=[1,0,0],g=mi(p,d),y=nl(g,g),b=g[0],v=y-b*b;if(!v)return!h&&c;var x=t*y/v,_=-t*b/v,A=mi(m,g),S=rl(m,x),P=rl(g,_);Vf(S,P);var M=A,B=nl(S,M),$=nl(M,M),k=B*B-$*(nl(S,S)-1);if(!(k<0)){var C=Ne(k),T=rl(M,(-B-C)/$);if(Vf(T,S),T=tl(T),!h)return T;var w=c[0],D=f[0],F=c[1],z=f[1],I;D<w&&(I=w,w=D,D=I);var N=D-w,E=ge(N-he)<oe,O=E||N<oe;if(!E&&z<F&&(I=F,F=z,z=I),O?E?F+z>0^T[1]<(ge(T[0]-w)<oe?F:z):F<=T[1]&&T[1]<=z:N>he^(w<=T[0]&&T[0]<=D)){var j=rl(M,(-B+C)/$);return Vf(j,S),[T,tl(j)]}}}function u(c,f){var h=r?e:he-e,p=0;return c<-h?p|=1:c>h&&(p|=2),f<-h?p|=4:f>h&&(p|=8),p}return P1(a,s,o,r?[0,-e]:[-he,e-he])}function r4(e,t,n,r,i,o){var a=e[0],s=e[1],l=t[0],u=t[1],c=0,f=1,h=l-a,p=u-s,d;if(d=n-a,!(!h&&d>0)){if(d/=h,h<0){if(d<c)return;d<f&&(f=d)}else if(h>0){if(d>f)return;d>c&&(c=d)}if(d=i-a,!(!h&&d<0)){if(d/=h,h<0){if(d>f)return;d>c&&(c=d)}else if(h>0){if(d<c)return;d<f&&(f=d)}if(d=r-s,!(!p&&d>0)){if(d/=p,p<0){if(d<c)return;d<f&&(f=d)}else if(p>0){if(d>f)return;d>c&&(c=d)}if(d=o-s,!(!p&&d<0)){if(d/=p,p<0){if(d>f)return;d>c&&(c=d)}else if(p>0){if(d<c)return;d<f&&(f=d)}return c>0&&(e[0]=a+c*h,e[1]=s+c*p),f<1&&(t[0]=a+f*h,t[1]=s+f*p),!0}}}}}var Io=1e9,dl=-Io;function gl(e,t,n,r){function i(u,c){return e<=u&&u<=n&&t<=c&&c<=r}function o(u,c,f,h){var p=0,d=0;if(u==null||(p=a(u,f))!==(d=a(c,f))||l(u,c)<0^f>0)do h.point(p===0||p===3?e:n,p>1?r:t);while((p=(p+f+4)%4)!==d);else h.point(c[0],c[1])}function a(u,c){return ge(u[0]-e)<oe?c>0?0:3:ge(u[0]-n)<oe?c>0?2:1:ge(u[1]-t)<oe?c>0?1:0:c>0?3:2}function s(u,c){return l(u.x,c.x)}function l(u,c){var f=a(u,1),h=a(c,1);return f!==h?f-h:f===0?c[1]-u[1]:f===1?u[0]-c[0]:f===2?u[1]-c[1]:c[0]-u[0]}return function(u){var c=u,f=S1(),h,p,d,m,g,y,b,v,x,_,A,S={point:P,lineStart:k,lineEnd:C,polygonStart:B,polygonEnd:$};function P(w,D){i(w,D)&&c.point(w,D)}function M(){for(var w=0,D=0,F=p.length;D<F;++D)for(var z=p[D],I=1,N=z.length,E=z[0],O,j,ie=E[0],W=E[1];I<N;++I)O=ie,j=W,E=z[I],ie=E[0],W=E[1],j<=r?W>r&&(ie-O)*(r-j)>(W-j)*(e-O)&&++w:W<=r&&(ie-O)*(r-j)<(W-j)*(e-O)&&--w;return w}function B(){c=f,h=[],p=[],A=!0}function $(){var w=M(),D=A&&w,F=(h=Tc(h)).length;(D||F)&&(u.polygonStart(),D&&(u.lineStart(),o(null,null,1,u),u.lineEnd()),F&&w1(h,s,w,o,u),u.polygonEnd()),c=u,h=p=d=null}function k(){S.point=T,p&&p.push(d=[]),_=!0,x=!1,b=v=NaN}function C(){h&&(T(m,g),y&&x&&f.rejoin(),h.push(f.result())),S.point=P,x&&c.lineEnd()}function T(w,D){var F=i(w,D);if(p&&d.push([w,D]),_)m=w,g=D,y=F,_=!1,F&&(c.lineStart(),c.point(w,D));else if(F&&x)c.point(w,D);else{var z=[b=Math.max(dl,Math.min(Io,b)),v=Math.max(dl,Math.min(Io,v))],I=[w=Math.max(dl,Math.min(Io,w)),D=Math.max(dl,Math.min(Io,D))];r4(z,I,e,t,n,r)?(x||(c.lineStart(),c.point(z[0],z[1])),c.point(I[0],I[1]),F||c.lineEnd(),A=!1):F&&(c.lineStart(),c.point(w,D),A=!1)}b=w,v=D,x=F}return S}}function i4(){var e=0,t=0,n=960,r=500,i,o,a;return a={stream:function(s){return i&&o===s?i:i=gl(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 nh,rh,ml,yl,xi={sphere:we,point:we,lineStart:o4,lineEnd:we,polygonStart:we,polygonEnd:we};function o4(){xi.point=s4,xi.lineEnd=a4}function a4(){xi.point=xi.lineEnd=we}function s4(e,t){e*=ae,t*=ae,rh=e,ml=te(t),yl=re(t),xi.point=l4}function l4(e,t){e*=ae,t*=ae;var n=te(t),r=re(t),i=ge(e-rh),o=re(i),a=te(i),s=r*a,l=yl*n-ml*r*o,u=ml*n+yl*r*o;nh.add(Qe(Ne(s*s+l*l),u)),rh=e,ml=n,yl=r}function M1(e){return nh=new ke,Bt(e,xi),+nh}var ih=[null,null],u4={type:"LineString",coordinates:ih};function bl(e,t){return ih[0]=e,ih[1]=t,M1(u4)}var C1={Feature:function(e,t){return xl(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)if(xl(n[r].geometry,t))return!0;return!1}},L1={Sphere:function(){return!0},Point:function(e,t){return k1(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(k1(n[r],t))return!0;return!1},LineString:function(e,t){return R1(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(R1(n[r],t))return!0;return!1},Polygon:function(e,t){return E1(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(E1(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)if(xl(n[r],t))return!0;return!1}};function xl(e,t){return e&&L1.hasOwnProperty(e.type)?L1[e.type](e,t):!1}function k1(e,t){return bl(e,t)===0}function R1(e,t){for(var n,r,i,o=0,a=e.length;o<a;o++){if(r=bl(e[o],t),r===0||o>0&&(i=bl(e[o],e[o-1]),i>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<Lo*i))return!0;n=r}return!1}function E1(e,t){return!!A1(e.map(c4),I1(t))}function c4(e){return e=e.map(I1),e.pop(),e}function I1(e){return[e[0]*ae,e[1]*ae]}function f4(e,t){return(e&&C1.hasOwnProperty(e.type)?C1[e.type]:xl)(e,t)}function B1(e,t,n){var r=wn(e,t-oe,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function N1(e,t,n){var r=wn(e,t-oe,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function F1(){var e,t,n,r,i,o,a,s,l=10,u=l,c=90,f=360,h,p,d,m,g=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return wn(Zs(r/c)*c,n,c).map(d).concat(wn(Zs(s/f)*f,a,f).map(m)).concat(wn(Zs(t/l)*l,e,l).filter(function(v){return ge(v%c)>oe}).map(h)).concat(wn(Zs(o/u)*u,i,u).filter(function(v){return ge(v%f)>oe}).map(p))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},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(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(r=+v[0][0],n=+v[1][0],s=+v[0][1],a=+v[1][1],r>n&&(v=r,r=n,n=v),s>a&&(v=s,s=a,a=v),y.precision(g)):[[r,s],[n,a]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],o=+v[0][1],i=+v[1][1],t>e&&(v=t,t=e,e=v),o>i&&(v=o,o=i,i=v),y.precision(g)):[[t,o],[e,i]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(l=+v[0],u=+v[1],y):[l,u]},y.precision=function(v){return arguments.length?(g=+v,h=B1(o,i,90),p=N1(t,e,g),d=B1(s,a,90),m=N1(r,n,g),y):g},y.extentMajor([[-180,-90+oe],[180,90-oe]]).extentMinor([[-180,-80-oe],[180,80+oe]])}function h4(){return F1()()}function p4(e,t){var n=e[0]*ae,r=e[1]*ae,i=t[0]*ae,o=t[1]*ae,a=re(r),s=te(r),l=re(o),u=te(o),c=a*re(n),f=a*te(n),h=l*re(i),p=l*te(i),d=2*Je(Ne(Qy(o-r)+a*l*Qy(i-n))),m=te(d),g=d?function(y){var b=te(y*=d)/m,v=te(d-y)/m,x=v*c+b*h,_=v*f+b*p,A=v*s+b*u;return[Qe(_,x)*ve,Qe(A,Ne(x*x+_*_))*ve]}:function(){return[n*ve,r*ve]};return g.distance=d,g}const Bo=e=>e;var oh=new ke,ah=new ke,z1,O1,sh,lh,cn={point:we,lineStart:we,lineEnd:we,polygonStart:function(){cn.lineStart=d4,cn.lineEnd=m4},polygonEnd:function(){cn.lineStart=cn.lineEnd=cn.point=we,oh.add(ge(ah)),ah=new ke},result:function(){var e=oh/2;return oh=new ke,e}};function d4(){cn.point=g4}function g4(e,t){cn.point=G1,z1=sh=e,O1=lh=t}function G1(e,t){ah.add(lh*e-sh*t),sh=e,lh=t}function m4(){G1(z1,O1)}var vi=1/0,vl=vi,No=-vi,$l=No,_l={point:y4,lineStart:we,lineEnd:we,polygonStart:we,polygonEnd:we,result:function(){var e=[[vi,vl],[No,$l]];return No=$l=-(vl=vi=1/0),e}};function y4(e,t){e<vi&&(vi=e),e>No&&(No=e),t<vl&&(vl=t),t>$l&&($l=t)}var uh=0,ch=0,Fo=0,Sl=0,wl=0,$i=0,fh=0,hh=0,zo=0,Y1,W1,jt,qt,_t={point:mr,lineStart:X1,lineEnd:V1,polygonStart:function(){_t.lineStart=v4,_t.lineEnd=$4},polygonEnd:function(){_t.point=mr,_t.lineStart=X1,_t.lineEnd=V1},result:function(){var e=zo?[fh/zo,hh/zo]:$i?[Sl/$i,wl/$i]:Fo?[uh/Fo,ch/Fo]:[NaN,NaN];return uh=ch=Fo=Sl=wl=$i=fh=hh=zo=0,e}};function mr(e,t){uh+=e,ch+=t,++Fo}function X1(){_t.point=b4}function b4(e,t){_t.point=x4,mr(jt=e,qt=t)}function x4(e,t){var n=e-jt,r=t-qt,i=Ne(n*n+r*r);Sl+=i*(jt+e)/2,wl+=i*(qt+t)/2,$i+=i,mr(jt=e,qt=t)}function V1(){_t.point=mr}function v4(){_t.point=_4}function $4(){U1(Y1,W1)}function _4(e,t){_t.point=U1,mr(Y1=jt=e,W1=qt=t)}function U1(e,t){var n=e-jt,r=t-qt,i=Ne(n*n+r*r);Sl+=i*(jt+e)/2,wl+=i*(qt+t)/2,$i+=i,i=qt*e-jt*t,fh+=i*(jt+e),hh+=i*(qt+t),zo+=i*3,mr(jt=e,qt=t)}function H1(e){this._context=e}H1.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,Ke);break}}},result:we};var ph=new ke,dh,j1,q1,Oo,Go,Yo={point:we,lineStart:function(){Yo.point=S4},lineEnd:function(){dh&&Z1(j1,q1),Yo.point=we},polygonStart:function(){dh=!0},polygonEnd:function(){dh=null},result:function(){var e=+ph;return ph=new ke,e}};function S4(e,t){Yo.point=Z1,j1=Oo=e,q1=Go=t}function Z1(e,t){Oo-=e,Go-=t,ph.add(Ne(Oo*Oo+Go*Go)),Oo=e,Go=t}let K1,Tl,Q1,J1;class eb{constructor(t){this._append=t==null?tb:w4(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!==Q1||this._append!==Tl){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`,Q1=r,Tl=this._append,J1=this._,this._=i}this._+=J1;break}}}result(){const t=this._;return this._="",t.length?t:null}}function tb(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function w4(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return tb;if(t!==K1){const n=10**t;K1=t,Tl=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 Tl}function T4(e,t){let n=3,r=4.5,i,o;function a(s){return s&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),Bt(s,i(o))),o.result()}return a.area=function(s){return Bt(s,i(cn)),cn.result()},a.measure=function(s){return Bt(s,i(Yo)),Yo.result()},a.bounds=function(s){return Bt(s,i(_l)),_l.result()},a.centroid=function(s){return Bt(s,i(_t)),_t.result()},a.projection=function(s){return arguments.length?(i=s==null?(e=null,Bo):(e=s).stream,a):e},a.context=function(s){return arguments.length?(o=s==null?(t=null,new eb(n)):new H1(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 eb(n)),a},a.projection(e).digits(n).context(t)}function A4(e){return{stream:Wo(e)}}function Wo(e){return function(t){var n=new gh;for(var r in e)n[r]=e[r];return n.stream=t,n}}function gh(){}gh.prototype={constructor:gh,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 mh(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Bt(n,e.stream(_l)),t(_l.result()),r!=null&&e.clipExtent(r),e}function Al(e,t,n){return mh(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 yh(e,t,n){return Al(e,[[0,0],t],n)}function bh(e,t,n){return mh(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 xh(e,t,n){return mh(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 nb=16,P4=re(30*ae);function rb(e,t){return+t?M4(e,t):D4(e)}function D4(e){return Wo({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function M4(e,t){function n(r,i,o,a,s,l,u,c,f,h,p,d,m,g){var y=u-r,b=c-i,v=y*y+b*b;if(v>4*t&&m--){var x=a+h,_=s+p,A=l+d,S=Ne(x*x+_*_+A*A),P=Je(A/=S),M=ge(ge(A)-1)<oe||ge(o-f)<oe?(o+f)/2:Qe(_,x),B=e(M,P),$=B[0],k=B[1],C=$-r,T=k-i,w=b*C-y*T;(w*w/v>t||ge((y*C+b*T)/v-.5)>.3||a*h+s*p+l*d<P4)&&(n(r,i,o,a,s,l,$,k,M,x/=S,_/=S,A,m,g),g.point($,k),n($,k,M,x,_,A,u,c,f,h,p,d,m,g))}}return function(r){var i,o,a,s,l,u,c,f,h,p,d,m,g={point:y,lineStart:b,lineEnd:x,polygonStart:function(){r.polygonStart(),g.lineStart=_},polygonEnd:function(){r.polygonEnd(),g.lineStart=b}};function y(P,M){P=e(P,M),r.point(P[0],P[1])}function b(){f=NaN,g.point=v,r.lineStart()}function v(P,M){var B=dr([P,M]),$=e(P,M);n(f,h,c,p,d,m,f=$[0],h=$[1],c=P,p=B[0],d=B[1],m=B[2],nb,r),r.point(f,h)}function x(){g.point=y,r.lineEnd()}function _(){b(),g.point=A,g.lineEnd=S}function A(P,M){v(i=P,M),o=f,a=h,s=p,l=d,u=m,g.point=v}function S(){n(f,h,c,p,d,m,o,a,i,s,l,u,nb,r),g.lineEnd=x,x()}return g}}var C4=Wo({point:function(e,t){this.stream.point(e*ae,t*ae)}});function L4(e){return Wo({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function k4(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 ib(e,t,n,r,i,o){if(!o)return k4(e,t,n,r,i);var a=re(o),s=te(o),l=a*e,u=s*e,c=a/e,f=s/e,h=(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-f*g+h),i*(p-f*m-c*g)]},d}function Zt(e){return vh(function(){return e})()}function vh(e){var t,n=150,r=480,i=250,o=0,a=0,s=0,l=0,u=0,c,f=0,h=1,p=1,d=null,m=th,g=null,y,b,v,x=Bo,_=.5,A,S,P,M,B;function $(w){return P(w[0]*ae,w[1]*ae)}function k(w){return w=P.invert(w[0],w[1]),w&&[w[0]*ve,w[1]*ve]}$.stream=function(w){return M&&B===w?M:M=C4(L4(c)(m(A(x(B=w)))))},$.preclip=function(w){return arguments.length?(m=w,d=void 0,T()):m},$.postclip=function(w){return arguments.length?(x=w,g=y=b=v=null,T()):x},$.clipAngle=function(w){return arguments.length?(m=+w?D1(d=w*ae):(d=null,th),T()):d*ve},$.clipExtent=function(w){return arguments.length?(x=w==null?(g=y=b=v=null,Bo):gl(g=+w[0][0],y=+w[0][1],b=+w[1][0],v=+w[1][1]),T()):g==null?null:[[g,y],[b,v]]},$.scale=function(w){return arguments.length?(n=+w,C()):n},$.translate=function(w){return arguments.length?(r=+w[0],i=+w[1],C()):[r,i]},$.center=function(w){return arguments.length?(o=w[0]%360*ae,a=w[1]%360*ae,C()):[o*ve,a*ve]},$.rotate=function(w){return arguments.length?(s=w[0]%360*ae,l=w[1]%360*ae,u=w.length>2?w[2]%360*ae:0,C()):[s*ve,l*ve,u*ve]},$.angle=function(w){return arguments.length?(f=w%360*ae,C()):f*ve},$.reflectX=function(w){return arguments.length?(h=w?-1:1,C()):h<0},$.reflectY=function(w){return arguments.length?(p=w?-1:1,C()):p<0},$.precision=function(w){return arguments.length?(A=rb(S,_=w*w),T()):Ne(_)},$.fitExtent=function(w,D){return Al($,w,D)},$.fitSize=function(w,D){return yh($,w,D)},$.fitWidth=function(w,D){return bh($,w,D)},$.fitHeight=function(w,D){return xh($,w,D)};function C(){var w=ib(n,0,0,h,p,f).apply(null,t(o,a)),D=ib(n,r-w[0],i-w[1],h,p,f);return c=Jf(s,l,u),S=Kf(t,D),P=Kf(c,S),A=rb(S,_),T()}function T(){return M=B=null,$}return function(){return t=e.apply(this,arguments),$.invert=t.invert&&k,C()}}function $h(e){var t=0,n=he/3,r=vh(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*ae,n=o[1]*ae):[t*ve,n*ve]},i}function R4(e){var t=re(e);function n(r,i){return[r*t,te(i)/t]}return n.invert=function(r,i){return[r/t,Je(i*t)]},n}function ob(e,t){var n=te(e),r=(n+te(t))/2;if(ge(r)<oe)return R4(e);var i=1+n*(2*r-n),o=Ne(i)/r;function a(s,l){var u=Ne(i-2*r*te(l))/r;return[u*te(s*=r),o-u*re(s)]}return a.invert=function(s,l){var u=o-l,c=Qe(s,ge(u))*$t(u);return u*r<0&&(c-=he*$t(s)*$t(u)),[c/r,Je((i-(s*s+u*u)*r*r)/(2*r))]},a}function Pl(){return $h(ob).scale(155.424).center([0,33.6442])}function ab(){return Pl().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function E4(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 I4(){var e,t,n=ab(),r,i=Pl().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,a=Pl().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s,l,u={point:function(h,p){l=[h,p]}};function c(h){var p=h[0],d=h[1];return l=null,r.point(p,d),l||(o.point(p,d),l)||(s.point(p,d),l)}c.invert=function(h){var p=n.scale(),d=n.translate(),m=(h[0]-d[0])/p,g=(h[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(h)},c.stream=function(h){return e&&t===h?e:e=E4([n.stream(t=h),i.stream(h),a.stream(h)])},c.precision=function(h){return arguments.length?(n.precision(h),i.precision(h),a.precision(h),f()):n.precision()},c.scale=function(h){return arguments.length?(n.scale(h),i.scale(h*.35),a.scale(h),c.translate(n.translate())):n.scale()},c.translate=function(h){if(!arguments.length)return n.translate();var p=n.scale(),d=+h[0],m=+h[1];return r=n.translate(h).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+oe,m+.12*p+oe],[d-.214*p-oe,m+.234*p-oe]]).stream(u),s=a.translate([d-.205*p,m+.212*p]).clipExtent([[d-.214*p+oe,m+.166*p+oe],[d-.115*p-oe,m+.234*p-oe]]).stream(u),f()},c.fitExtent=function(h,p){return Al(c,h,p)},c.fitSize=function(h,p){return yh(c,h,p)},c.fitWidth=function(h,p){return bh(c,h,p)},c.fitHeight=function(h,p){return xh(c,h,p)};function f(){return e=t=null,c}return c.scale(1070)}function sb(e){return function(t,n){var r=re(t),i=re(n),o=e(r*i);return o===1/0?[2,0]:[o*i*te(t),o*te(n)]}}function Xo(e){return function(t,n){var r=Ne(t*t+n*n),i=e(r),o=te(i),a=re(i);return[Qe(t*o,r*a),Je(r&&n*o/r)]}}var _h=sb(function(e){return Ne(2/(1+e))});_h.invert=Xo(function(e){return 2*Je(e/2)});function B4(){return Zt(_h).scale(124.75).clipAngle(180-.001)}var Sh=sb(function(e){return(e=Ky(e))&&e/te(e)});Sh.invert=Xo(function(e){return e});function N4(){return Zt(Sh).scale(79.4188).clipAngle(180-.001)}function Vo(e,t){return[e,Ks(Of((Ae+t)/2))]}Vo.invert=function(e,t){return[e,2*gi(Zy(t))-Ae]};function F4(){return lb(Vo).scale(961/Ke)}function lb(e){var t=Zt(e),n=t.center,r=t.scale,i=t.translate,o=t.clipExtent,a=null,s,l,u;t.scale=function(f){return arguments.length?(r(f),c()):r()},t.translate=function(f){return arguments.length?(i(f),c()):i()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?a=s=l=u=null:(a=+f[0][0],s=+f[0][1],l=+f[1][0],u=+f[1][1]),c()):a==null?null:[[a,s],[l,u]]};function c(){var f=he*r(),h=t(v1(t.rotate()).invert([0,0]));return o(a==null?[[h[0]-f,h[1]-f],[h[0]+f,h[1]+f]]:e===Vo?[[Math.max(h[0]-f,a),s],[Math.min(h[0]+f,l),u]]:[[a,Math.max(h[1]-f,s)],[l,Math.min(h[1]+f,u)]])}return c()}function Dl(e){return Of((Ae+e)/2)}function ub(e,t){var n=re(e),r=e===t?te(e):Ks(n/re(t))/Ks(Dl(t)/Dl(e)),i=n*zf(Dl(e),r)/r;if(!r)return Vo;function o(a,s){i>0?s<-Ae+oe&&(s=-Ae+oe):s>Ae-oe&&(s=Ae-oe);var l=i/zf(Dl(s),r);return[l*te(r*a),i-l*re(r*a)]}return o.invert=function(a,s){var l=i-s,u=$t(r)*Ne(a*a+l*l),c=Qe(a,ge(l))*$t(l);return l*r<0&&(c-=he*$t(a)*$t(l)),[c/r,2*gi(zf(i/u,1/r))-Ae]},o}function z4(){return $h(ub).scale(109.5).parallels([30,30])}function Uo(e,t){return[e,t]}Uo.invert=Uo;function O4(){return Zt(Uo).scale(152.63)}function cb(e,t){var n=re(e),r=e===t?te(e):(n-re(t))/(t-e),i=n/r+e;if(ge(r)<oe)return Uo;function o(a,s){var l=i-s,u=r*a;return[l*te(u),i-l*re(u)]}return o.invert=function(a,s){var l=i-s,u=Qe(a,ge(l))*$t(l);return l*r<0&&(u-=he*$t(a)*$t(l)),[u/r,i-$t(r)*Ne(a*a+l*l)]},o}function G4(){return $h(cb).scale(131.154).center([0,13.9389])}var Ho=1.340264,jo=-.081106,qo=893e-6,Zo=.003796,Ml=Ne(3)/2,Y4=12;function wh(e,t){var n=Je(Ml*te(t)),r=n*n,i=r*r*r;return[e*re(n)/(Ml*(Ho+3*jo*r+i*(7*qo+9*Zo*r))),n*(Ho+jo*r+i*(qo+Zo*r))]}wh.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,o=0,a,s,l;o<Y4&&(s=n*(Ho+jo*r+i*(qo+Zo*r))-t,l=Ho+3*jo*r+i*(7*qo+9*Zo*r),n-=a=s/l,r=n*n,i=r*r*r,!(ge(a)<Lo));++o);return[Ml*e*(Ho+3*jo*r+i*(7*qo+9*Zo*r))/re(n),Je(te(n)/Ml)]};function W4(){return Zt(wh).scale(177.158)}function Th(e,t){var n=re(t),r=re(e)*n;return[n*te(e)/r,te(t)/r]}Th.invert=Xo(gi);function X4(){return Zt(Th).scale(144.049).clipAngle(60)}function V4(){var e=1,t=0,n=0,r=1,i=1,o=0,a,s,l=null,u,c,f,h=1,p=1,d=Wo({point:function(x,_){var A=v([x,_]);this.stream.point(A[0],A[1])}}),m=Bo,g,y;function b(){return h=e*r,p=e*i,g=y=null,v}function v(x){var _=x[0]*h,A=x[1]*p;if(o){var S=A*a-_*s;_=_*a+A*s,A=S}return[_+t,A+n]}return v.invert=function(x){var _=x[0]-t,A=x[1]-n;if(o){var S=A*a+_*s;_=_*a-A*s,A=S}return[_/h,A/p]},v.stream=function(x){return g&&y===x?g:g=d(m(y=x))},v.postclip=function(x){return arguments.length?(m=x,l=u=c=f=null,b()):m},v.clipExtent=function(x){return arguments.length?(m=x==null?(l=u=c=f=null,Bo):gl(l=+x[0][0],u=+x[0][1],c=+x[1][0],f=+x[1][1]),b()):l==null?null:[[l,u],[c,f]]},v.scale=function(x){return arguments.length?(e=+x,b()):e},v.translate=function(x){return arguments.length?(t=+x[0],n=+x[1],b()):[t,n]},v.angle=function(x){return arguments.length?(o=x%360*ae,s=te(o),a=re(o),b()):o*ve},v.reflectX=function(x){return arguments.length?(r=x?-1:1,b()):r<0},v.reflectY=function(x){return arguments.length?(i=x?-1:1,b()):i<0},v.fitExtent=function(x,_){return Al(v,x,_)},v.fitSize=function(x,_){return yh(v,x,_)},v.fitWidth=function(x,_){return bh(v,x,_)},v.fitHeight=function(x,_){return xh(v,x,_)},v}function Ah(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)))]}Ah.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(ge(i)>oe&&--r>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function U4(){return Zt(Ah).scale(175.295)}function Ph(e,t){return[re(t)*te(e),te(t)]}Ph.invert=Xo(Je);function H4(){return Zt(Ph).scale(249.5).clipAngle(90+oe)}function Dh(e,t){var n=re(t),r=1+re(e)*n;return[n*te(e)/r,te(t)/r]}Dh.invert=Xo(function(e){return 2*gi(e)});function j4(){return Zt(Dh).scale(250).clipAngle(142)}function Mh(e,t){return[Ks(Of((Ae+t)/2)),-e]}Mh.invert=function(e,t){return[-t,2*gi(Zy(e))-Ae]};function q4(){var e=lb(Mh),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 Z4(e,t){return e.parent===t.parent?1:2}function K4(e){return e.reduce(Q4,0)/e.length}function Q4(e,t){return e+t.x}function J4(e){return 1+e.reduce(e7,0)}function e7(e,t){return Math.max(e,t.y)}function t7(e){for(var t;t=e.children;)e=t[0];return e}function n7(e){for(var t;t=e.children;)e=t[t.length-1];return e}function r7(){var e=Z4,t=1,n=1,r=!1;function i(o){var a,s=0;o.eachAfter(function(h){var p=h.children;p?(h.x=K4(p),h.y=J4(p)):(h.x=a?s+=e(h,a):0,h.y=0,a=h)});var l=t7(o),u=n7(o),c=l.x-e(l,u)/2,f=u.x+e(u,l)/2;return o.eachAfter(r?function(h){h.x=(h.x-o.x)*t,h.y=(o.y-h.y)*n}:function(h){h.x=(h.x-c)/(f-c)*t,h.y=(1-(o.y?h.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 i7(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 o7(){return this.eachAfter(i7)}function a7(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function s7(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 l7(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 u7(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function c7(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 f7(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function h7(e){for(var t=this,n=p7(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 p7(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 d7(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function g7(){return Array.from(this)}function m7(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function y7(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*b7(){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 Cl(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=$7)):t===void 0&&(t=v7);for(var n=new yr(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 yr(a[s])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(fb)}function x7(){return Cl(this).eachBefore(_7)}function v7(e){return e.children}function $7(e){return Array.isArray(e)?e[1]:null}function _7(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function fb(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function yr(e){this.data=e,this.depth=this.height=0,this.parent=null}yr.prototype=Cl.prototype={constructor:yr,count:o7,each:a7,eachAfter:l7,eachBefore:s7,find:u7,sum:c7,sort:f7,path:h7,ancestors:d7,descendants:g7,leaves:m7,links:y7,copy:x7,[Symbol.iterator]:b7};function Ll(e){return e==null?null:hb(e)}function hb(e){if(typeof e!="function")throw new Error;return e}function br(){return 0}function _i(e){return function(){return e}}const S7=1664525,w7=1013904223,pb=4294967296;function Ch(){let e=1;return()=>(e=(S7*e+w7)%pb)/pb}function T7(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function A7(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 P7(e){return db(e,Ch())}function db(e,t){for(var n=0,r=(e=A7(Array.from(e),t)).length,i=[],o,a;n<r;)o=e[n],a&&gb(a,o)?++n:(a=M7(i=D7(i,o)),n=0);return a}function D7(e,t){var n,r;if(Lh(t,e))return[t];for(n=0;n<e.length;++n)if(kl(t,e[n])&&Lh(Ko(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(kl(Ko(e[n],e[r]),t)&&kl(Ko(e[n],t),e[r])&&kl(Ko(e[r],t),e[n])&&Lh(mb(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function kl(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 gb(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 Lh(e,t){for(var n=0;n<t.length;++n)if(!gb(e,t[n]))return!1;return!0}function M7(e){switch(e.length){case 1:return C7(e[0]);case 2:return Ko(e[0],e[1]);case 3:return mb(e[0],e[1],e[2])}}function C7(e){return{x:e.x,y:e.y,r:e.r}}function Ko(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,f=Math.sqrt(l*l+u*u);return{x:(n+o+l/f*c)/2,y:(r+a+u/f*c)/2,r:(f+i+s)/2}}function mb(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,f=n.r,h=r-a,p=r-u,d=i-s,m=i-c,g=l-o,y=f-o,b=r*r+i*i-o*o,v=b-a*a-s*s+l*l,x=b-u*u-c*c+f*f,_=p*d-h*m,A=(d*x-m*v)/(_*2)-r,S=(m*g-d*y)/_,P=(p*v-h*x)/(_*2)-i,M=(h*y-p*g)/_,B=S*S+M*M-1,$=2*(o+A*S+P*M),k=A*A+P*P-o*o,C=-(Math.abs(B)>1e-6?($+Math.sqrt($*$-4*B*k))/(2*B):k/$);return{x:r+A+S*C,y:i+P+M*C,r:C}}function yb(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 bb(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 xb(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 Rl(e){this._=e,this.next=null,this.previous=null}function vb(e,t){if(!(o=(e=T7(e)).length))return 0;var n,r,i,o,a,s,l,u,c,f,h;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;yb(r,n,i=e[2]),n=new Rl(n),r=new Rl(r),i=new Rl(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(l=3;l<o;++l){yb(n._,r._,i=e[l]),i=new Rl(i),u=r.next,c=n.previous,f=r._.r,h=n._.r;do if(f<=h){if(bb(u._,i._)){r=u,n.next=r,r.previous=n,--l;continue e}f+=u._.r,u=u.next}else{if(bb(c._,i._)){n=c,n.next=r,r.previous=n,--l;continue e}h+=c._.r,c=c.previous}while(u!==c.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=xb(n);(i=i.next)!==r;)(s=xb(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=db(n,t),l=0;l<o;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function L7(e){return vb(e,Ch()),e}function k7(e){return Math.sqrt(e.value)}function R7(){var e=null,t=1,n=1,r=br;function i(o){const a=Ch();return o.x=t/2,o.y=n/2,e?o.eachBefore($b(e)).eachAfter(kh(r,.5,a)).eachBefore(_b(1)):o.eachBefore($b(k7)).eachAfter(kh(br,1,a)).eachAfter(kh(r,o.r/Math.min(t,n),a)).eachBefore(_b(Math.min(t,n)/(2*o.r))),o}return i.radius=function(o){return arguments.length?(e=Ll(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 $b(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function kh(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=vb(i,n),s)for(o=0;o<a;++o)i[o].r-=s;r.r=l+s}}}function _b(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 Sb(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 Qo(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 E7(){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(Sb),a}function o(a,s){return function(l){l.children&&Qo(l,l.x0,a*(l.depth+1)/s,l.x1,a*(l.depth+2)/s);var u=l.x0,c=l.y0,f=l.x1-n,h=l.y1-n;f<u&&(u=f=(u+f)/2),h<c&&(c=h=(c+h)/2),l.x0=u,l.y0=c,l.x1=f,l.y1=h}}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 I7={depth:-1},wb={},Rh={};function B7(e){return e.id}function N7(e){return e.parentId}function F7(){var e=B7,t=N7,n;function r(i){var o=Array.from(i),a=e,s=t,l,u,c,f,h,p,d,m,g=new Map;if(n!=null){const y=o.map((x,_)=>z7(n(x,_,i))),b=y.map(Tb),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(Tb(x)),o.push(Rh));a=(x,_)=>y[_],s=(x,_)=>b[_]}for(c=0,l=o.length;c<l;++c)u=o[c],p=o[c]=new yr(u),(d=a(u,c,i))!=null&&(d+="")&&(m=p.id=d,g.set(m,g.has(m)?wb: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(h=g.get(d),!h)throw new Error("missing: "+d);if(h===wb)throw new Error("ambiguous: "+d);h.children?h.children.push(p):h.children=[p],p.parent=h}else{if(f)throw new Error("multiple roots");f=p}if(!f)throw new Error("no root");if(n!=null){for(;f.data===Rh&&f.children.length===1;)f=f.children[0],--l;for(let y=o.length-1;y>=0&&(p=o[y],p.data===Rh);--y)p.data=null}if(f.parent=I7,f.eachBefore(function(y){y.depth=y.parent.depth+1,--l}).eachBefore(fb),f.parent=null,l>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(e=Ll(i),r):e},r.parentId=function(i){return arguments.length?(t=Ll(i),r):t},r.path=function(i){return arguments.length?(n=Ll(i),r):n},r}function z7(e){e=`${e}`;let t=e.length;return Eh(e,t-1)&&!Eh(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function Tb(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Eh(e,t););return e.slice(0,t)}function Eh(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function O7(e,t){return e.parent===t.parent?1:2}function Ih(e){var t=e.children;return t?t[0]:e.t}function Bh(e){var t=e.children;return t?t[t.length-1]:e.t}function G7(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 Y7(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 W7(e,t,n){return e.a.parent===t.parent?e.a:n}function El(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}El.prototype=Object.create(yr.prototype);function X7(e){for(var t=new El(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 El(o[a],a)),i.parent=n;return(t.parent=new El(null,0)).children=[t],t}function V7(){var e=O7,t=1,n=1,r=null;function i(u){var c=X7(u);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)u.eachBefore(l);else{var f=u,h=u,p=u;u.eachBefore(function(b){b.x<f.x&&(f=b),b.x>h.x&&(h=b),b.depth>p.depth&&(p=b)});var d=f===h?1:e(f,h)/2,m=d-f.x,g=t/(h.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,f=u.parent.children,h=u.i?f[u.i-1]:null;if(c){Y7(u);var p=(c[0].z+c[c.length-1].z)/2;h?(u.z=h.z+e(u._,h._),u.m=u.z-p):u.z=p}else h&&(u.z=h.z+e(u._,h._));u.parent.A=s(u,h,u.parent.A||f[0])}function a(u){u._.x=u.z+u.parent.m,u.m+=u.parent.m}function s(u,c,f){if(c){for(var h=u,p=u,d=c,m=h.parent.children[0],g=h.m,y=p.m,b=d.m,v=m.m,x;d=Bh(d),h=Ih(h),d&&h;)m=Ih(m),p=Bh(p),p.a=u,x=d.z+b-h.z-g+e(d._,h._),x>0&&(G7(W7(d,u,f),u,x),g+=x,y+=x),b+=d.m,g+=h.m,v+=m.m,y+=p.m;d&&!Bh(p)&&(p.t=d,p.m+=b-y),h&&!Ih(m)&&(m.t=h,m.m+=g-v,f=u)}return f}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 Il(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 Ab=(1+Math.sqrt(5))/2;function Pb(e,t,n,r,i,o){for(var a=[],s=t.children,l,u,c=0,f=0,h=s.length,p,d,m=t.value,g,y,b,v,x,_,A;c<h;){p=i-n,d=o-r;do g=s[f++].value;while(!g&&f<h);for(y=b=g,_=Math.max(d/p,p/d)/(m*e),A=g*g*_,x=Math.max(b/A,A/y);f<h;++f){if(g+=u=s[f].value,u<y&&(y=u),u>b&&(b=u),A=g*g*_,v=Math.max(b/A,A/y),v>x){g-=u;break}x=v}a.push(l={value:g,dice:p<d,children:s.slice(c,f)}),l.dice?Qo(l,n,r,i,m?r+=d*g/m:o):Il(l,n,r,m?n+=p*g/m:i,o),m-=g,c=f}return a}const Nh=function e(t){function n(r,i,o,a,s){Pb(t,r,i,o,a,s)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(Ab);function Db(){var e=Nh,t=!1,n=1,r=1,i=[0],o=br,a=br,s=br,l=br,u=br;function c(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(f),i=[0],t&&h.eachBefore(Sb),h}function f(h){var p=i[h.depth],d=h.x0+p,m=h.y0+p,g=h.x1-p,y=h.y1-p;g<d&&(d=g=(d+g)/2),y<m&&(m=y=(m+y)/2),h.x0=d,h.y0=m,h.x1=g,h.y1=y,h.children&&(p=i[h.depth+1]=o(h)/2,d+=u(h)-p,m+=a(h)-p,g-=s(h)-p,y-=l(h)-p,g<d&&(d=g=(d+g)/2),y<m&&(m=y=(m+y)/2),e(h,d,m,g,y))}return c.round=function(h){return arguments.length?(t=!!h,c):t},c.size=function(h){return arguments.length?(n=+h[0],r=+h[1],c):[n,r]},c.tile=function(h){return arguments.length?(e=hb(h),c):e},c.padding=function(h){return arguments.length?c.paddingInner(h).paddingOuter(h):c.paddingInner()},c.paddingInner=function(h){return arguments.length?(o=typeof h=="function"?h:_i(+h),c):o},c.paddingOuter=function(h){return arguments.length?c.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):c.paddingTop()},c.paddingTop=function(h){return arguments.length?(a=typeof h=="function"?h:_i(+h),c):a},c.paddingRight=function(h){return arguments.length?(s=typeof h=="function"?h:_i(+h),c):s},c.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:_i(+h),c):l},c.paddingLeft=function(h){return arguments.length?(u=typeof h=="function"?h:_i(+h),c):u},c}function U7(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(f,h,p,d,m,g,y){if(f>=h-1){var b=o[f];b.x0=d,b.y0=m,b.x1=g,b.y1=y;return}for(var v=u[f],x=p/2+v,_=f+1,A=h-1;_<A;){var S=_+A>>>1;u[S]<x?_=S+1:A=S}x-u[_-1]<u[_]-x&&f+1<_&&--_;var P=u[_]-v,M=p-P;if(g-d>y-m){var B=p?(d*M+g*P)/p:g;c(f,_,P,d,m,B,y),c(_,h,M,B,m,g,y)}else{var $=p?(m*M+y*P)/p:y;c(f,_,P,d,m,g,$),c(_,h,M,d,$,g,y)}}}function H7(e,t,n,r,i){(e.depth&1?Il:Qo)(e,t,n,r,i)}const j7=function e(t){function n(r,i,o,a,s){if((l=r._squarify)&&l.ratio===t)for(var l,u,c,f,h=-1,p,d=l.length,m=r.value;++h<d;){for(u=l[h],c=u.children,f=u.value=0,p=c.length;f<p;++f)u.value+=c[f].value;u.dice?Qo(u,i,o,a,m?o+=(s-o)*u.value/m:s):Il(u,i,o,m?i+=(a-i)*u.value/m:a,s),m-=u.value}else r._squarify=l=Pb(t,r,i,o,a,s),l.ratio=t}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(Ab);function q7(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 Z7(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 K7(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function Q7(e,t){return e[0]-t[0]||e[1]-t[1]}function Mb(e){const t=e.length,n=[0,1];let r=2,i;for(i=2;i<t;++i){for(;r>1&&K7(e[n[r-2]],e[n[r-1]],e[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function J7(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(Q7),t=0;t<n;++t)i[t]=[r[t][0],-r[t][1]];var o=Mb(r),a=Mb(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 ek(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,f=0;f<n;++f)r=e[f],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 tk(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 Oe=Math.random,nk=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}(Oe),rk=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}(Oe),Fh=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}(Oe),ik=function e(t){var n=Fh.source(t);function r(){var i=n.apply(this,arguments);return function(){return Math.exp(i())}}return r.source=e,r}(Oe),Cb=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}(Oe),ok=function e(t){var n=Cb.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}(Oe),ak=function e(t){function n(r){return function(){return-Math.log1p(-t())/r}}return n.source=e,n}(Oe),sk=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}(Oe),lk=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}(Oe),Lb=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}(Oe),zh=function e(t){var n=Fh.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 f=1-t()}while(f>=1-.0331*u*u*u*u&&Math.log(f)>=.5*u*u+a*(1-c+Math.log(c)));return a*c*l()*o}}return r.source=e,r}(Oe),kb=function e(t){var n=zh.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}(Oe),Rb=function e(t){var n=Lb.source(t),r=kb.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),f=r(c,l-c+1)();f<=u?(s+=c,l-=c,u=(u-f)/(1-f)):(l=c-1,u/=f)}for(var h=u<.5,p=h?u:1-u,d=n(p),m=d(),g=0;m<=l;++g)m+=d();return s+(h?g:l-g)}}return i.source=e,i}(Oe),uk=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}(Oe),ck=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}(Oe),fk=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}(Oe),hk=function e(t){var n=zh.source(t),r=Rb.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()),f=0;c<=s;++f)c-=Math.log1p(-t());return a+f}}return i.source=e,i}(Oe),pk=1664525,dk=1013904223,Eb=1/4294967296;function gk(e=Math.random()){let t=(0<=e&&e<1?e/Eb:Math.abs(e))|0;return()=>(t=pk*t+dk|0,Eb*(t>>>0))}function St(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function fn(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 Oh=Symbol("implicit");function Gh(){var e=new oo,t=[],n=[],r=Oh;function i(o){let a=e.get(o);if(a===void 0){if(r!==Oh)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 oo;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 Gh(t,n).unknown(r)},St.apply(i,arguments),i}function Yh(){var e=Gh().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 f(){var h=t().length,p=i<r,d=p?i:r,m=p?r:i;o=(m-d)/Math.max(1,h-l+u*2),s&&(o=Math.floor(o)),d+=(m-d-o*(h-l))*c,a=o*(1-l),s&&(d=Math.round(d),a=Math.round(a));var g=wn(h).map(function(y){return d+o*y});return n(p?g.reverse():g)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,s=!0,f()},e.bandwidth=function(){return a},e.step=function(){return o},e.round=function(h){return arguments.length?(s=!!h,f()):s},e.padding=function(h){return arguments.length?(l=Math.min(1,u=+h),f()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),f()):l},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(c=Math.max(0,Math.min(1,h)),f()):c},e.copy=function(){return Yh(t(),[r,i]).round(s).paddingInner(l).paddingOuter(u).align(c)},St.apply(f(),arguments)}function Ib(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Ib(t())},e}function Wh(){return Ib(Yh.apply(null,arguments).paddingInner(1))}function mk(e){return function(){return e}}function Bl(e){return+e}var Bb=[0,1];function rt(e){return e}function Xh(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:mk(isNaN(t)?NaN:.5)}function yk(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function bk(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=Xh(i,r),o=n(a,o)):(r=Xh(r,i),o=n(o,a)),function(s){return o(r(s))}}function xk(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]=Xh(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(s){var l=jn(e,s,1,r)-1;return o[l](i[l](s))}}function Jo(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Nl(){var e=Bb,t=Bb,n=nn,r,i,o,a=rt,s,l,u;function c(){var h=Math.min(e.length,t.length);return a!==rt&&(a=yk(e[0],e[h-1])),s=h>2?xk:bk,l=u=null,f}function f(h){return h==null||isNaN(h=+h)?o:(l||(l=s(e.map(r),t,n)))(r(a(h)))}return f.invert=function(h){return a(i((u||(u=s(t,e.map(r),vt)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Bl),c()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),c()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=Ss,c()},f.clamp=function(h){return arguments.length?(a=h?!0:rt,c()):a!==rt},f.interpolate=function(h){return arguments.length?(n=h,c()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,p){return r=h,i=p,c()}}function Vh(){return Nl()(rt,rt)}function Nb(e,t,n,r){var i=Ja(e,t,n),o;switch(r=di(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=jy(i,a))&&(r.precision=o),Nf(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=qy(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Hy(i))&&(r.precision=o-(r.type==="%")*2);break}}return Co(r)}function Ln(e){var t=e.domain;return e.ticks=function(n){var r=t();return Zn(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Nb(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=Kn(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 xr(){var e=Vh();return e.copy=function(){return Jo(e,xr())},St.apply(e,arguments),Ln(e)}function Fb(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,Bl),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Fb(e).unknown(t)},e=arguments.length?Array.from(e,Bl):[0,1],Ln(n)}function zb(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 Ob(e){return Math.log(e)}function Gb(e){return Math.exp(e)}function vk(e){return-Math.log(-e)}function $k(e){return-Math.exp(-e)}function _k(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Sk(e){return e===10?_k:e===Math.E?Math.exp:t=>Math.pow(e,t)}function wk(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 Yb(e){return(t,n)=>-e(-t,n)}function Uh(e){const t=e(Ob,Gb),n=t.domain;let r=10,i,o;function a(){return i=wk(r),o=Sk(r),n()[0]<0?(i=Yb(i),o=Yb(o),e(vk,$k)):e(Ob,Gb),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 f=c<u;f&&([u,c]=[c,u]);let h=i(u),p=i(c),d,m;const g=s==null?10:+s;let y=[];if(!(r%1)&&p-h<g){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(d=1;d<r;++d)if(m=h<0?d/o(-h):d*o(h),!(m<u)){if(m>c)break;y.push(m)}}else for(;h<=p;++h)for(d=r-1;d>=1;--d)if(m=h>0?d/o(-h):d*o(h),!(m<u)){if(m>c)break;y.push(m)}y.length*2<g&&(y=Zn(u,c,g))}else y=Zn(h,p,Math.min(p-h,g)).map(o);return f?y.reverse():y},t.tickFormat=(s,l)=>{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=di(l)).precision==null&&(l.trim=!0),l=Co(l)),s===1/0)return l;const u=Math.max(1,r*s/t.ticks().length);return c=>{let f=c/o(Math.round(i(c)));return f*r<r-.5&&(f*=r),f<=u?l(c):""}},t.nice=()=>n(zb(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),t}function Wb(){const e=Uh(Nl()).domain([1,10]);return e.copy=()=>Jo(e,Wb()).base(e.base()),St.apply(e,arguments),e}function Xb(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Vb(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Hh(e){var t=1,n=e(Xb(t),Vb(t));return n.constant=function(r){return arguments.length?e(Xb(t=+r),Vb(t)):t},Ln(n)}function Ub(){var e=Hh(Nl());return e.copy=function(){return Jo(e,Ub()).constant(e.constant())},St.apply(e,arguments)}function Hb(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Tk(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Ak(e){return e<0?-e*e:e*e}function jh(e){var t=e(rt,rt),n=1;function r(){return n===1?e(rt,rt):n===.5?e(Tk,Ak):e(Hb(n),Hb(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Ln(t)}function kn(){var e=jh(Nl());return e.copy=function(){return Jo(e,kn()).exponent(e.exponent())},St.apply(e,arguments),e}function Pk(){return kn.apply(null,arguments).exponent(.5)}function jb(e){return Math.sign(e)*e*e}function Dk(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function qb(){var e=Vh(),t=[0,1],n=!1,r;function i(o){var a=Dk(e(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return e.invert(jb(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,Bl)).map(jb)),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 qb(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},St.apply(i,arguments),Ln(i)}function Zb(){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]=E0(e,a/s);return o}function o(a){return a==null||isNaN(a=+a)?r:t[jn(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(Se),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 Zb().domain(e).range(t).unknown(r)},St.apply(o,arguments)}function Kb(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function a(l){return l!=null&&l<=l?i[jn(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 Kb().domain([e,t]).range(i).unknown(o)},St.apply(Ln(a),arguments)}function Qb(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[jn(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 Qb().domain(e).range(t).unknown(n)},St.apply(i,arguments)}const qh=new Date,Zh=new Date;function Ce(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=>Ce(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)=>(qh.setTime(+o),Zh.setTime(+a),e(qh),e(Zh),Math.floor(n(qh,Zh))),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=Ce(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Si.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ce(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Si);const Jb=Si.range,hn=1e3,wt=hn*60,pn=wt*60,dn=pn*24,Kh=dn*7,ex=dn*30,Qh=dn*365,gn=Ce(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*hn)},(e,t)=>(t-e)/hn,e=>e.getUTCSeconds()),tx=gn.range,Fl=Ce(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hn)},(e,t)=>{e.setTime(+e+t*wt)},(e,t)=>(t-e)/wt,e=>e.getMinutes()),Mk=Fl.range,zl=Ce(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*wt)},(e,t)=>(t-e)/wt,e=>e.getUTCMinutes()),Ck=zl.range,Ol=Ce(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hn-e.getMinutes()*wt)},(e,t)=>{e.setTime(+e+t*pn)},(e,t)=>(t-e)/pn,e=>e.getHours()),Lk=Ol.range,Gl=Ce(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*pn)},(e,t)=>(t-e)/pn,e=>e.getUTCHours()),kk=Gl.range,wi=Ce(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*wt)/dn,e=>e.getDate()-1),Rk=wi.range,ea=Ce(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/dn,e=>e.getUTCDate()-1),Ek=ea.range,Jh=Ce(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/dn,e=>Math.floor(e/dn)),Ik=Jh.range;function vr(e){return Ce(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)/Kh)}const Ti=vr(0),ta=vr(1),nx=vr(2),rx=vr(3),$r=vr(4),ix=vr(5),ox=vr(6),ax=Ti.range,Bk=ta.range,Nk=nx.range,Fk=rx.range,zk=$r.range,Ok=ix.range,Gk=ox.range;function _r(e){return Ce(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)/Kh)}const Ai=_r(0),na=_r(1),sx=_r(2),lx=_r(3),Sr=_r(4),ux=_r(5),cx=_r(6),fx=Ai.range,Yk=na.range,Wk=sx.range,Xk=lx.range,Vk=Sr.range,Uk=ux.range,Hk=cx.range,Yl=Ce(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()),jk=Yl.range,Wl=Ce(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()),qk=Wl.range,Kt=Ce(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());Kt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ce(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 Zk=Kt.range,Qt=Ce(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());Qt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ce(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 Kk=Qt.range;function hx(e,t,n,r,i,o){const a=[[gn,1,hn],[gn,5,5*hn],[gn,15,15*hn],[gn,30,30*hn],[o,1,wt],[o,5,5*wt],[o,15,15*wt],[o,30,30*wt],[i,1,pn],[i,3,3*pn],[i,6,6*pn],[i,12,12*pn],[r,1,dn],[r,2,2*dn],[n,1,Kh],[t,1,ex],[t,3,3*ex],[e,1,Qh]];function s(u,c,f){const h=c<u;h&&([u,c]=[c,u]);const p=f&&typeof f.range=="function"?f:l(u,c,f),d=p?p.range(u,+c+1):[];return h?d.reverse():d}function l(u,c,f){const h=Math.abs(c-u)/f,p=qa(([,,g])=>g).right(a,h);if(p===a.length)return e.every(Ja(u/Qh,c/Qh,f));if(p===0)return Si.every(Math.max(Ja(u,c,f),1));const[d,m]=a[h/a[p-1][2]<a[p][2]/h?p-1:p];return d.every(m)}return[s,l]}const[px,dx]=hx(Qt,Wl,Ai,Jh,Gl,zl),[gx,mx]=hx(Kt,Yl,Ti,wi,Ol,Fl);function ep(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 tp(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 ra(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function yx(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=ia(i),c=oa(i),f=ia(o),h=oa(o),p=ia(a),d=oa(a),m=ia(s),g=oa(s),y=ia(l),b=oa(l),v={a:F,A:z,b:I,B:N,c:null,d:Sx,e:Sx,f:v9,g:C9,G:k9,H:y9,I:b9,j:x9,L:wx,m:$9,M:_9,p:E,q:O,Q:Cx,s:Lx,S:S9,u:w9,U:T9,V:A9,w:P9,W:D9,x:null,X:null,y:M9,Y:L9,Z:R9,"%":Mx},x={a:j,A:ie,b:W,B:Q,c:null,d:Ax,e:Ax,f:N9,g:H9,G:q9,H:E9,I:I9,j:B9,L:Px,m:F9,M:z9,p:X,q:K,Q:Cx,s:Lx,S:O9,u:G9,U:Y9,V:W9,w:X9,W:V9,x:null,X:null,y:U9,Y:j9,Z:Z9,"%":Mx},_={a:B,A:$,b:k,B:C,c:T,d:$x,e:$x,f:p9,g:vx,G:xx,H:_x,I:_x,j:u9,L:h9,m:l9,M:c9,p:M,q:s9,Q:g9,s:m9,S:f9,u:n9,U:r9,V:i9,w:t9,W:o9,x:w,X:D,y:vx,Y:xx,Z:a9,"%":d9};v.x=A(n,v),v.X=A(r,v),v.c=A(t,v),x.x=A(n,x),x.X=A(r,x),x.c=A(t,x);function A(q,ne){return function(se){var U=[],me=-1,fe=0,Ee=q.length,it,le,De;for(se instanceof Date||(se=new Date(+se));++me<Ee;)q.charCodeAt(me)===37&&(U.push(q.slice(fe,me)),(le=bx[it=q.charAt(++me)])!=null?it=q.charAt(++me):le=it==="e"?" ":"0",(De=ne[it])&&(it=De(se,le)),U.push(it),fe=me+1);return U.push(q.slice(fe,me)),U.join("")}}function S(q,ne){return function(se){var U=ra(1900,void 0,1),me=P(U,q,se+="",0),fe,Ee;if(me!=se.length)return null;if("Q"in U)return new Date(U.Q);if("s"in U)return new Date(U.s*1e3+("L"in U?U.L:0));if(ne&&!("Z"in U)&&(U.Z=0),"p"in U&&(U.H=U.H%12+U.p*12),U.m===void 0&&(U.m="q"in U?U.q:0),"V"in U){if(U.V<1||U.V>53)return null;"w"in U||(U.w=1),"Z"in U?(fe=tp(ra(U.y,0,1)),Ee=fe.getUTCDay(),fe=Ee>4||Ee===0?na.ceil(fe):na(fe),fe=ea.offset(fe,(U.V-1)*7),U.y=fe.getUTCFullYear(),U.m=fe.getUTCMonth(),U.d=fe.getUTCDate()+(U.w+6)%7):(fe=ep(ra(U.y,0,1)),Ee=fe.getDay(),fe=Ee>4||Ee===0?ta.ceil(fe):ta(fe),fe=wi.offset(fe,(U.V-1)*7),U.y=fe.getFullYear(),U.m=fe.getMonth(),U.d=fe.getDate()+(U.w+6)%7)}else("W"in U||"U"in U)&&("w"in U||(U.w="u"in U?U.u%7:"W"in U?1:0),Ee="Z"in U?tp(ra(U.y,0,1)).getUTCDay():ep(ra(U.y,0,1)).getDay(),U.m=0,U.d="W"in U?(U.w+6)%7+U.W*7-(Ee+5)%7:U.w+U.U*7-(Ee+6)%7);return"Z"in U?(U.H+=U.Z/100|0,U.M+=U.Z%100,tp(U)):ep(U)}}function P(q,ne,se,U){for(var me=0,fe=ne.length,Ee=se.length,it,le;me<fe;){if(U>=Ee)return-1;if(it=ne.charCodeAt(me++),it===37){if(it=ne.charAt(me++),le=_[it in bx?ne.charAt(me++):it],!le||(U=le(q,se,U))<0)return-1}else if(it!=se.charCodeAt(U++))return-1}return U}function M(q,ne,se){var U=u.exec(ne.slice(se));return U?(q.p=c.get(U[0].toLowerCase()),se+U[0].length):-1}function B(q,ne,se){var U=p.exec(ne.slice(se));return U?(q.w=d.get(U[0].toLowerCase()),se+U[0].length):-1}function $(q,ne,se){var U=f.exec(ne.slice(se));return U?(q.w=h.get(U[0].toLowerCase()),se+U[0].length):-1}function k(q,ne,se){var U=y.exec(ne.slice(se));return U?(q.m=b.get(U[0].toLowerCase()),se+U[0].length):-1}function C(q,ne,se){var U=m.exec(ne.slice(se));return U?(q.m=g.get(U[0].toLowerCase()),se+U[0].length):-1}function T(q,ne,se){return P(q,t,ne,se)}function w(q,ne,se){return P(q,n,ne,se)}function D(q,ne,se){return P(q,r,ne,se)}function F(q){return a[q.getDay()]}function z(q){return o[q.getDay()]}function I(q){return l[q.getMonth()]}function N(q){return s[q.getMonth()]}function E(q){return i[+(q.getHours()>=12)]}function O(q){return 1+~~(q.getMonth()/3)}function j(q){return a[q.getUTCDay()]}function ie(q){return o[q.getUTCDay()]}function W(q){return l[q.getUTCMonth()]}function Q(q){return s[q.getUTCMonth()]}function X(q){return i[+(q.getUTCHours()>=12)]}function K(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var ne=A(q+="",v);return ne.toString=function(){return q},ne},parse:function(q){var ne=S(q+="",!1);return ne.toString=function(){return q},ne},utcFormat:function(q){var ne=A(q+="",x);return ne.toString=function(){return q},ne},utcParse:function(q){var ne=S(q+="",!0);return ne.toString=function(){return q},ne}}}var bx={"-":"",_:" ",0:"0"},Fe=/^\s*\d+/,Qk=/^%/,Jk=/[\\^$*+?|[\]().{}]/g;function ye(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 e9(e){return e.replace(Jk,"\\$&")}function ia(e){return new RegExp("^(?:"+e.map(e9).join("|")+")","i")}function oa(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function t9(e,t,n){var r=Fe.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function n9(e,t,n){var r=Fe.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function r9(e,t,n){var r=Fe.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function i9(e,t,n){var r=Fe.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function o9(e,t,n){var r=Fe.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function xx(e,t,n){var r=Fe.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function vx(e,t,n){var r=Fe.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function a9(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 s9(e,t,n){var r=Fe.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function l9(e,t,n){var r=Fe.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function $x(e,t,n){var r=Fe.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function u9(e,t,n){var r=Fe.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function _x(e,t,n){var r=Fe.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function c9(e,t,n){var r=Fe.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function f9(e,t,n){var r=Fe.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function h9(e,t,n){var r=Fe.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function p9(e,t,n){var r=Fe.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function d9(e,t,n){var r=Qk.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function g9(e,t,n){var r=Fe.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function m9(e,t,n){var r=Fe.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Sx(e,t){return ye(e.getDate(),t,2)}function y9(e,t){return ye(e.getHours(),t,2)}function b9(e,t){return ye(e.getHours()%12||12,t,2)}function x9(e,t){return ye(1+wi.count(Kt(e),e),t,3)}function wx(e,t){return ye(e.getMilliseconds(),t,3)}function v9(e,t){return wx(e,t)+"000"}function $9(e,t){return ye(e.getMonth()+1,t,2)}function _9(e,t){return ye(e.getMinutes(),t,2)}function S9(e,t){return ye(e.getSeconds(),t,2)}function w9(e){var t=e.getDay();return t===0?7:t}function T9(e,t){return ye(Ti.count(Kt(e)-1,e),t,2)}function Tx(e){var t=e.getDay();return t>=4||t===0?$r(e):$r.ceil(e)}function A9(e,t){return e=Tx(e),ye($r.count(Kt(e),e)+(Kt(e).getDay()===4),t,2)}function P9(e){return e.getDay()}function D9(e,t){return ye(ta.count(Kt(e)-1,e),t,2)}function M9(e,t){return ye(e.getFullYear()%100,t,2)}function C9(e,t){return e=Tx(e),ye(e.getFullYear()%100,t,2)}function L9(e,t){return ye(e.getFullYear()%1e4,t,4)}function k9(e,t){var n=e.getDay();return e=n>=4||n===0?$r(e):$r.ceil(e),ye(e.getFullYear()%1e4,t,4)}function R9(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ye(t/60|0,"0",2)+ye(t%60,"0",2)}function Ax(e,t){return ye(e.getUTCDate(),t,2)}function E9(e,t){return ye(e.getUTCHours(),t,2)}function I9(e,t){return ye(e.getUTCHours()%12||12,t,2)}function B9(e,t){return ye(1+ea.count(Qt(e),e),t,3)}function Px(e,t){return ye(e.getUTCMilliseconds(),t,3)}function N9(e,t){return Px(e,t)+"000"}function F9(e,t){return ye(e.getUTCMonth()+1,t,2)}function z9(e,t){return ye(e.getUTCMinutes(),t,2)}function O9(e,t){return ye(e.getUTCSeconds(),t,2)}function G9(e){var t=e.getUTCDay();return t===0?7:t}function Y9(e,t){return ye(Ai.count(Qt(e)-1,e),t,2)}function Dx(e){var t=e.getUTCDay();return t>=4||t===0?Sr(e):Sr.ceil(e)}function W9(e,t){return e=Dx(e),ye(Sr.count(Qt(e),e)+(Qt(e).getUTCDay()===4),t,2)}function X9(e){return e.getUTCDay()}function V9(e,t){return ye(na.count(Qt(e)-1,e),t,2)}function U9(e,t){return ye(e.getUTCFullYear()%100,t,2)}function H9(e,t){return e=Dx(e),ye(e.getUTCFullYear()%100,t,2)}function j9(e,t){return ye(e.getUTCFullYear()%1e4,t,4)}function q9(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Sr(e):Sr.ceil(e),ye(e.getUTCFullYear()%1e4,t,4)}function Z9(){return"+0000"}function Mx(){return"%"}function Cx(e){return+e}function Lx(e){return Math.floor(+e/1e3)}var Pi,np,kx,Xl,rp;Rx({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 Rx(e){return Pi=yx(e),np=Pi.format,kx=Pi.parse,Xl=Pi.utcFormat,rp=Pi.utcParse,Pi}var Ex="%Y-%m-%dT%H:%M:%S.%LZ";function K9(e){return e.toISOString()}var Q9=Date.prototype.toISOString?K9:Xl(Ex);const J9=Q9;function eR(e){var t=new Date(e);return isNaN(t)?null:t}var tR=+new Date("2000-01-01T00:00:00.000Z")?eR:rp(Ex);const nR=tR;function rR(e){return new Date(e)}function iR(e){return e instanceof Date?+e:+new Date(+e)}function ip(e,t,n,r,i,o,a,s,l,u){var c=Vh(),f=c.invert,h=c.domain,p=u(".%L"),d=u(":%S"),m=u("%I:%M"),g=u("%I %p"),y=u("%a %d"),b=u("%b %d"),v=u("%B"),x=u("%Y");function _(A){return(l(A)<A?p:s(A)<A?d:a(A)<A?m:o(A)<A?g:r(A)<A?i(A)<A?y:b:n(A)<A?v:x)(A)}return c.invert=function(A){return new Date(f(A))},c.domain=function(A){return arguments.length?h(Array.from(A,iR)):h().map(rR)},c.ticks=function(A){var S=h();return e(S[0],S[S.length-1],A??10)},c.tickFormat=function(A,S){return S==null?_:u(S)},c.nice=function(A){var S=h();return(!A||typeof A.range!="function")&&(A=t(S[0],S[S.length-1],A??10)),A?h(zb(S,A)):c},c.copy=function(){return Jo(c,ip(e,t,n,r,i,o,a,s,l,u))},c}function oR(){return St.apply(ip(gx,mx,Kt,Yl,Ti,wi,Ol,Fl,gn,np).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function aR(){return St.apply(ip(px,dx,Qt,Wl,Ai,ea,Gl,zl,gn,Xl).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Vl(){var e=0,t=1,n,r,i,o,a=rt,s=!1,l;function u(f){return f==null||isNaN(f=+f)?l:a(i===0?.5:(f=(o(f)-n)*i,s?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(f){return arguments.length?(s=!!f,u):s},u.interpolator=function(f){return arguments.length?(a=f,u):a};function c(f){return function(h){var p,d;return arguments.length?([p,d]=h,a=f(p,d),u):[a(0),a(1)]}}return u.range=c(nn),u.rangeRound=c(Ss),u.unknown=function(f){return arguments.length?(l=f,u):l},function(f){return o=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),u}}function Rn(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Ix(){var e=Ln(Vl()(rt));return e.copy=function(){return Rn(e,Ix())},fn.apply(e,arguments)}function Bx(){var e=Uh(Vl()).domain([1,10]);return e.copy=function(){return Rn(e,Bx()).base(e.base())},fn.apply(e,arguments)}function Nx(){var e=Hh(Vl());return e.copy=function(){return Rn(e,Nx()).constant(e.constant())},fn.apply(e,arguments)}function op(){var e=jh(Vl());return e.copy=function(){return Rn(e,op()).exponent(e.exponent())},fn.apply(e,arguments)}function sR(){return op.apply(null,arguments).exponent(.5)}function Fx(){var e=[],t=rt;function n(r){if(r!=null&&!isNaN(r=+r))return t((jn(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(Se),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)=>lo(e,o/r))},n.copy=function(){return Fx(t).domain(e)},fn.apply(n,arguments)}function Ul(){var e=0,t=.5,n=1,r=1,i,o,a,s,l,u=rt,c,f=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+c(m))-o)*(r*m<r*o?s:l),u(f?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?(f=!!m,p):f},p.interpolator=function(m){return arguments.length?(u=m,p):u};function d(m){return function(g){var y,b,v;return arguments.length?([y,b,v]=g,u=Ym(m,[y,b,v]),p):[u(0),u(.5),u(1)]}}return p.range=d(nn),p.rangeRound=d(Ss),p.unknown=function(m){return arguments.length?(h=m,p):h},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 zx(){var e=Ln(Ul()(rt));return e.copy=function(){return Rn(e,zx())},fn.apply(e,arguments)}function Ox(){var e=Uh(Ul()).domain([.1,1,10]);return e.copy=function(){return Rn(e,Ox()).base(e.base())},fn.apply(e,arguments)}function Gx(){var e=Hh(Ul());return e.copy=function(){return Rn(e,Gx()).constant(e.constant())},fn.apply(e,arguments)}function ap(){var e=jh(Ul());return e.copy=function(){return Rn(e,ap()).exponent(e.exponent())},fn.apply(e,arguments)}function lR(){return ap.apply(null,arguments).exponent(.5)}function ce(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 uR=ce("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),cR=ce("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),fR=ce("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),hR=ce("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),pR=ce("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),dR=ce("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),gR=ce("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),mR=ce("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),yR=ce("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),bR=ce("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),xR=ce("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),$e=e=>Pm(e[e.length-1]);var Yx=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(ce);const vR=$e(Yx);var Wx=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(ce);const $R=$e(Wx);var Xx=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(ce);const _R=$e(Xx);var Vx=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(ce);const SR=$e(Vx);var Ux=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(ce);const wR=$e(Ux);var Hx=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(ce);const TR=$e(Hx);var jx=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(ce);const AR=$e(jx);var qx=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(ce);const PR=$e(qx);var Zx=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(ce);const DR=$e(Zx);var Kx=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(ce);const MR=$e(Kx);var Qx=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(ce);const CR=$e(Qx);var Jx=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(ce);const LR=$e(Jx);var ev=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(ce);const kR=$e(ev);var tv=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(ce);const RR=$e(tv);var nv=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(ce);const ER=$e(nv);var rv=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(ce);const IR=$e(rv);var iv=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(ce);const BR=$e(iv);var ov=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(ce);const NR=$e(ov);var av=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(ce);const FR=$e(av);var sv=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(ce);const zR=$e(sv);var lv=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(ce);const OR=$e(lv);var uv=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(ce);const GR=$e(uv);var cv=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(ce);const YR=$e(cv);var fv=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(ce);const WR=$e(fv);var hv=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(ce);const XR=$e(hv);var pv=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(ce);const VR=$e(pv);var dv=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(ce);const UR=$e(dv);function HR(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 jR=Ts(Et(300,.5,0),Et(-240,.5,1));var qR=Ts(Et(-100,.75,.35),Et(80,1.5,.8)),ZR=Ts(Et(260,.75,.35),Et(80,1.5,.8)),Hl=Et();function KR(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return Hl.h=360*e-100,Hl.s=1.5-1.5*t,Hl.l=.8-.9*t,Hl+""}var jl=ni(),QR=Math.PI/3,JR=Math.PI*2/3;function eE(e){var t;return e=(.5-e)*Math.PI,jl.r=255*(t=Math.sin(e))*t,jl.g=255*(t=Math.sin(e+QR))*t,jl.b=255*(t=Math.sin(e+JR))*t,jl+""}function tE(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 ql(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const nE=ql(ce("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var rE=ql(ce("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),iE=ql(ce("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),oE=ql(ce("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function ue(e){return function(){return e}}const gv=Math.abs,Xe=Math.atan2,mn=Math.cos,aE=Math.max,Di=Math.min,ct=Math.sin,_e=Math.sqrt,Ve=1e-12,En=Math.PI,Zl=En/2,In=2*En;function sE(e){return e>1?0:e<-1?En:Math.acos(e)}function mv(e){return e>=1?Zl:e<=-1?-Zl:Math.asin(e)}function aa(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 Ao(t)}function lE(e){return e.innerRadius}function uE(e){return e.outerRadius}function cE(e){return e.startAngle}function fE(e){return e.endAngle}function hE(e){return e&&e.padAngle}function pE(e,t,n,r,i,o,a,s){var l=n-e,u=r-t,c=a-i,f=s-o,h=f*l-c*u;if(!(h*h<Ve))return h=(c*(t-o)-f*(e-i))/h,[e+h*l,t+h*u]}function Kl(e,t,n,r,i,o,a){var s=e-n,l=t-r,u=(a?o:-o)/_e(s*s+l*l),c=u*l,f=-u*s,h=e+c,p=t+f,d=n+c,m=r+f,g=(h+d)/2,y=(p+m)/2,b=d-h,v=m-p,x=b*b+v*v,_=i-o,A=h*m-d*p,S=(v<0?-1:1)*_e(aE(0,_*_*x-A*A)),P=(A*v-b*S)/x,M=(-A*b-v*S)/x,B=(A*v+b*S)/x,$=(-A*b+v*S)/x,k=P-g,C=M-y,T=B-g,w=$-y;return k*k+C*C>T*T+w*w&&(P=B,M=$),{cx:P,cy:M,x01:-c,y01:-f,x11:P*(i/_-1),y11:M*(i/_-1)}}function Ql(){var e=lE,t=uE,n=ue(0),r=null,i=cE,o=fE,a=hE,s=null,l=aa(u);function u(){var c,f,h=+e.apply(this,arguments),p=+t.apply(this,arguments),d=i.apply(this,arguments)-Zl,m=o.apply(this,arguments)-Zl,g=gv(m-d),y=m>d;if(s||(s=c=l()),p<h&&(f=p,p=h,h=f),!(p>Ve))s.moveTo(0,0);else if(g>In-Ve)s.moveTo(p*mn(d),p*ct(d)),s.arc(0,0,p,d,m,!y),h>Ve&&(s.moveTo(h*mn(m),h*ct(m)),s.arc(0,0,h,m,d,y));else{var b=d,v=m,x=d,_=m,A=g,S=g,P=a.apply(this,arguments)/2,M=P>Ve&&(r?+r.apply(this,arguments):_e(h*h+p*p)),B=Di(gv(p-h)/2,+n.apply(this,arguments)),$=B,k=B,C,T;if(M>Ve){var w=mv(M/h*ct(P)),D=mv(M/p*ct(P));(A-=w*2)>Ve?(w*=y?1:-1,x+=w,_-=w):(A=0,x=_=(d+m)/2),(S-=D*2)>Ve?(D*=y?1:-1,b+=D,v-=D):(S=0,b=v=(d+m)/2)}var F=p*mn(b),z=p*ct(b),I=h*mn(_),N=h*ct(_);if(B>Ve){var E=p*mn(v),O=p*ct(v),j=h*mn(x),ie=h*ct(x),W;if(g<En)if(W=pE(F,z,j,ie,E,O,I,N)){var Q=F-W[0],X=z-W[1],K=E-W[0],q=O-W[1],ne=1/ct(sE((Q*K+X*q)/(_e(Q*Q+X*X)*_e(K*K+q*q)))/2),se=_e(W[0]*W[0]+W[1]*W[1]);$=Di(B,(h-se)/(ne-1)),k=Di(B,(p-se)/(ne+1))}else $=k=0}S>Ve?k>Ve?(C=Kl(j,ie,F,z,p,k,y),T=Kl(E,O,I,N,p,k,y),s.moveTo(C.cx+C.x01,C.cy+C.y01),k<B?s.arc(C.cx,C.cy,k,Xe(C.y01,C.x01),Xe(T.y01,T.x01),!y):(s.arc(C.cx,C.cy,k,Xe(C.y01,C.x01),Xe(C.y11,C.x11),!y),s.arc(0,0,p,Xe(C.cy+C.y11,C.cx+C.x11),Xe(T.cy+T.y11,T.cx+T.x11),!y),s.arc(T.cx,T.cy,k,Xe(T.y11,T.x11),Xe(T.y01,T.x01),!y))):(s.moveTo(F,z),s.arc(0,0,p,b,v,!y)):s.moveTo(F,z),!(h>Ve)||!(A>Ve)?s.lineTo(I,N):$>Ve?(C=Kl(I,N,E,O,h,-$,y),T=Kl(F,z,j,ie,h,-$,y),s.lineTo(C.cx+C.x01,C.cy+C.y01),$<B?s.arc(C.cx,C.cy,$,Xe(C.y01,C.x01),Xe(T.y01,T.x01),!y):(s.arc(C.cx,C.cy,$,Xe(C.y01,C.x01),Xe(C.y11,C.x11),!y),s.arc(0,0,h,Xe(C.cy+C.y11,C.cx+C.x11),Xe(T.cy+T.y11,T.cx+T.x11),y),s.arc(T.cx,T.cy,$,Xe(T.y11,T.x11),Xe(T.y01,T.x01),!y))):s.arc(0,0,h,_,x,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,f=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-En/2;return[mn(f)*c,ct(f)*c]},u.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:ue(+c),u):e},u.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:ue(+c),u):t},u.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:ue(+c),u):n},u.padRadius=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:ue(+c),u):r},u.startAngle=function(c){return arguments.length?(i=typeof c=="function"?c:ue(+c),u):i},u.endAngle=function(c){return arguments.length?(o=typeof c=="function"?c:ue(+c),u):o},u.padAngle=function(c){return arguments.length?(a=typeof c=="function"?c:ue(+c),u):a},u.context=function(c){return arguments.length?(s=c??null,u):s},u}var dE=Array.prototype.slice;function Jl(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function yv(e){this._context=e}yv.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 eu(e){return new yv(e)}function sp(e){return e[0]}function lp(e){return e[1]}function tu(e,t){var n=ue(!0),r=null,i=eu,o=null,a=aa(s);e=typeof e=="function"?e:e===void 0?sp:ue(e),t=typeof t=="function"?t:t===void 0?lp:ue(t);function s(l){var u,c=(l=Jl(l)).length,f,h=!1,p;for(r==null&&(o=i(p=a())),u=0;u<=c;++u)!(u<c&&n(f=l[u],u,l))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(f,u,l),+t(f,u,l));if(p)return o=null,p+""||null}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:ue(+l),s):e},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:ue(+l),s):t},s.defined=function(l){return arguments.length?(n=typeof l=="function"?l:ue(!!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 up(e,t,n){var r=null,i=ue(!0),o=null,a=eu,s=null,l=aa(u);e=typeof e=="function"?e:e===void 0?sp:ue(+e),t=typeof t=="function"?t:ue(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?lp:ue(+n);function u(f){var h,p,d,m=(f=Jl(f)).length,g,y=!1,b,v=new Array(m),x=new Array(m);for(o==null&&(s=a(b=l())),h=0;h<=m;++h){if(!(h<m&&i(g=f[h],h,f))===y)if(y=!y)p=h,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=h-1;d>=p;--d)s.point(v[d],x[d]);s.lineEnd(),s.areaEnd()}y&&(v[h]=+e(g,h,f),x[h]=+t(g,h,f),s.point(r?+r(g,h,f):v[h],n?+n(g,h,f):x[h]))}if(b)return s=null,b+""||null}function c(){return tu().defined(i).curve(a).context(o)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:ue(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ue(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ue(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:ue(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ue(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ue(+f),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(f){return arguments.length?(i=typeof f=="function"?f:ue(!!f),u):i},u.curve=function(f){return arguments.length?(a=f,o!=null&&(s=a(o)),u):a},u.context=function(f){return arguments.length?(f==null?o=s=null:s=a(o=f),u):o},u}function gE(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function mE(e){return e}function bv(){var e=mE,t=gE,n=null,r=ue(0),i=ue(In),o=ue(0);function a(s){var l,u=(s=Jl(s)).length,c,f,h=0,p=new Array(u),d=new Array(u),m=+r.apply(this,arguments),g=Math.min(In,Math.max(-In,i.apply(this,arguments)-m)),y,b=Math.min(Math.abs(g)/u,o.apply(this,arguments)),v=b*(g<0?-1:1),x;for(l=0;l<u;++l)(x=d[p[l]=l]=+e(s[l],l,s))>0&&(h+=x);for(t!=null?p.sort(function(_,A){return t(d[_],d[A])}):n!=null&&p.sort(function(_,A){return n(s[_],s[A])}),l=0,f=h?(g-u*v)/h:0;l<u;++l,m=y)c=p[l],x=d[c],y=m+(x>0?x*f:0)+v,d[c]={data:s[c],index:l,value:x,startAngle:m,endAngle:y,padAngle:b};return d}return a.value=function(s){return arguments.length?(e=typeof s=="function"?s:ue(+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:ue(+s),a):r},a.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:ue(+s),a):i},a.padAngle=function(s){return arguments.length?(o=typeof s=="function"?s:ue(+s),a):o},a}var xv=cp(eu);function vv(e){this._curve=e}vv.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 cp(e){function t(n){return new vv(e(n))}return t._curve=e,t}function sa(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(cp(n)):t()._curve},e}function $v(){return sa(tu().curve(xv))}function _v(){var e=up().curve(xv),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 sa(n())},delete e.lineX0,e.lineEndAngle=function(){return sa(r())},delete e.lineX1,e.lineInnerRadius=function(){return sa(i())},delete e.lineY0,e.lineOuterRadius=function(){return sa(o())},delete e.lineY1,e.curve=function(a){return arguments.length?t(cp(a)):t()._curve},e}function la(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}class Sv{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 yE{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=la(this._x0,this._y0),i=la(this._x0,this._y0=(this._y0+n)/2),o=la(t,this._y0),a=la(t,n);this._context.moveTo(...r),this._context.bezierCurveTo(...i,...o,...a)}this._x0=t,this._y0=n}}function wv(e){return new Sv(e,!0)}function Tv(e){return new Sv(e,!1)}function bE(e){return new yE(e)}function xE(e){return e.source}function vE(e){return e.target}function nu(e){let t=xE,n=vE,r=sp,i=lp,o=null,a=null,s=aa(l);function l(){let u;const c=dE.call(arguments),f=t.apply(this,c),h=n.apply(this,c);if(o==null&&(a=e(u=s())),a.lineStart(),c[0]=f,a.point(+r.apply(this,c),+i.apply(this,c)),c[0]=h,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:ue(+u),l):r},l.y=function(u){return arguments.length?(i=typeof u=="function"?u:ue(+u),l):i},l.context=function(u){return arguments.length?(u==null?o=a=null:a=e(o=u),l):o},l}function $E(){return nu(wv)}function _E(){return nu(Tv)}function SE(){const e=nu(bE);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}const wE=_e(3),Av={draw(e,t){const n=_e(t+Di(t/28,.75))*.59436,r=n/2,i=r*wE;e.moveTo(0,n),e.lineTo(0,-n),e.moveTo(-i,-r),e.lineTo(i,r),e.moveTo(-i,r),e.lineTo(i,-r)}},ru={draw(e,t){const n=_e(t/En);e.moveTo(n,0),e.arc(0,0,n,0,In)}},Pv={draw(e,t){const n=_e(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()}},Dv=_e(1/3),TE=Dv*2,Mv={draw(e,t){const n=_e(t/TE),r=n*Dv;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Cv={draw(e,t){const n=_e(t)*.62625;e.moveTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.lineTo(-n,0),e.closePath()}},Lv={draw(e,t){const n=_e(t-Di(t/7,2))*.87559;e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}},kv={draw(e,t){const n=_e(t),r=-n/2;e.rect(r,r,n,n)}},Rv={draw(e,t){const n=_e(t)*.4431;e.moveTo(n,n),e.lineTo(n,-n),e.lineTo(-n,-n),e.lineTo(-n,n),e.closePath()}},AE=.8908130915292852,Ev=ct(En/10)/ct(7*En/10),PE=ct(In/10)*Ev,DE=-mn(In/10)*Ev,Iv={draw(e,t){const n=_e(t*AE),r=PE*n,i=DE*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const a=In*o/5,s=mn(a),l=ct(a);e.lineTo(l*n,-s*n),e.lineTo(s*r-l*i,l*r+s*i)}e.closePath()}},fp=_e(3),Bv={draw(e,t){const n=-_e(t/(fp*3));e.moveTo(0,n*2),e.lineTo(-fp*n,-n),e.lineTo(fp*n,-n),e.closePath()}},ME=_e(3),Nv={draw(e,t){const n=_e(t)*.6824,r=n/2,i=n*ME/2;e.moveTo(0,-n),e.lineTo(i,r),e.lineTo(-i,r),e.closePath()}},Tt=-.5,At=_e(3)/2,hp=1/_e(12),CE=(hp/2+1)*3,Fv={draw(e,t){const n=_e(t/CE),r=n/2,i=n*hp,o=r,a=n*hp+n,s=-o,l=a;e.moveTo(r,i),e.lineTo(o,a),e.lineTo(s,l),e.lineTo(Tt*r-At*i,At*r+Tt*i),e.lineTo(Tt*o-At*a,At*o+Tt*a),e.lineTo(Tt*s-At*l,At*s+Tt*l),e.lineTo(Tt*r+At*i,Tt*i-At*r),e.lineTo(Tt*o+At*a,Tt*a-At*o),e.lineTo(Tt*s+At*l,Tt*l-At*s),e.closePath()}},pp={draw(e,t){const n=_e(t-Di(t/6,1.7))*.6189;e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}},zv=[ru,Pv,Mv,kv,Iv,Bv,Fv],LE=[ru,Lv,pp,Nv,Av,Rv,Cv];function kE(e,t){let n=null,r=aa(i);e=typeof e=="function"?e:ue(e||ru),t=typeof t=="function"?t:ue(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:ue(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:ue(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function Bn(){}function iu(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 ou(e){this._context=e}ou.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:iu(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:iu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function RE(e){return new ou(e)}function Ov(e){this._context=e}Ov.prototype={areaStart:Bn,areaEnd:Bn,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:iu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function EE(e){return new Ov(e)}function Gv(e){this._context=e}Gv.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:iu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function IE(e){return new Gv(e)}function Yv(e,t){this._basis=new ou(e),this._beta=t}Yv.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 BE=function e(t){function n(r){return t===1?new ou(r):new Yv(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function au(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 dp(e,t){this._context=e,this._k=(1-t)/6}dp.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:au(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:au(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 NE=function e(t){function n(r){return new dp(r,t)}return n.tension=function(r){return e(+r)},n}(0);function gp(e,t){this._context=e,this._k=(1-t)/6}gp.prototype={areaStart:Bn,areaEnd:Bn,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:au(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 FE=function e(t){function n(r){return new gp(r,t)}return n.tension=function(r){return e(+r)},n}(0);function mp(e,t){this._context=e,this._k=(1-t)/6}mp.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:au(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 zE=function e(t){function n(r){return new mp(r,t)}return n.tension=function(r){return e(+r)},n}(0);function yp(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>Ve){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>Ve){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 Wv(e,t){this._context=e,this._alpha=t}Wv.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:yp(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 OE=function e(t){function n(r){return t?new Wv(r,t):new dp(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Xv(e,t){this._context=e,this._alpha=t}Xv.prototype={areaStart:Bn,areaEnd:Bn,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:yp(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 GE=function e(t){function n(r){return t?new Xv(r,t):new gp(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Vv(e,t){this._context=e,this._alpha=t}Vv.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:yp(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 YE=function e(t){function n(r){return t?new Vv(r,t):new mp(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Uv(e){this._context=e}Uv.prototype={areaStart:Bn,areaEnd:Bn,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 WE(e){return new Uv(e)}function Hv(e){return e<0?-1:1}function jv(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(Hv(o)+Hv(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function qv(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function bp(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 su(e){this._context=e}su.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:bp(this,this._t0,qv(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,bp(this,qv(this,n=jv(this,e,t)),n);break;default:bp(this,this._t0,n=jv(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Zv(e){this._context=new Kv(e)}(Zv.prototype=Object.create(su.prototype)).point=function(e,t){su.prototype.point.call(this,t,e)};function Kv(e){this._context=e}Kv.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 XE(e){return new su(e)}function VE(e){return new Zv(e)}function Qv(e){this._context=e}Qv.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=Jv(e),i=Jv(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 Jv(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 UE(e){return new Qv(e)}function lu(e,t){this._context=e,this._t=t}lu.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 HE(e){return new lu(e,.5)}function jE(e){return new lu(e,0)}function qE(e){return new lu(e,1)}function Mi(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 ZE(e,t){return e[t]}function KE(e){const t=[];return t.key=e,t}function QE(){var e=ue([]),t=Ci,n=Mi,r=ZE;function i(o){var a=Array.from(e.apply(this,arguments),KE),s,l=a.length,u=-1,c;for(const f of o)for(s=0,++u;s<l;++s)(a[s][u]=[0,+r(f,a[s].key,u,o)]).data=f;for(s=0,c=Jl(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:ue(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:ue(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?Ci:typeof o=="function"?o:ue(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??Mi,i):n},i}function JE(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}Mi(e,t)}}function eI(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 tI(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}Mi(e,t)}}function nI(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]],f=c[r][1]||0,h=c[r-1][1]||0,p=(f-h)/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+=f,u+=p*f}i[r-1][1]+=i[r-1][0]=n,l&&(n-=u/l)}i[r-1][1]+=i[r-1][0]=n,Mi(e,t)}}function e$(e){var t=e.map(rI);return Ci(e).sort(function(n,r){return t[n]-t[r]})}function rI(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 t$(e){var t=e.map(n$);return Ci(e).sort(function(n,r){return t[n]-t[r]})}function n$(e){for(var t=0,n=-1,r=e.length,i;++n<r;)(i=+e[n][1])&&(t+=i);return t}function iI(e){return t$(e).reverse()}function oI(e){var t=e.length,n,r,i=e.map(n$),o=e$(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 aI(e){return Ci(e).reverse()}const uu=e=>()=>e;function sI(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 Jt(e,t,n){this.k=e,this.x=t,this.y=n}Jt.prototype={constructor:Jt,scale:function(e){return e===1?this:new Jt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Jt(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 Jt(1,0,0);r$.prototype=Jt.prototype;function r$(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Li;return e.__zoom}function xp(e){e.stopImmediatePropagation()}function ua(e){e.preventDefault(),e.stopImmediatePropagation()}function lI(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function uI(){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 i$(){return this.__zoom||Li}function cI(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function fI(){return navigator.maxTouchPoints||"ontouchstart"in this}function hI(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 yn(){var e=lI,t=uI,n=hI,r=cI,i=fI,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,l=Fm,u=Qn("start","zoom","end"),c,f,h,p=500,d=150,m=0,g=10;function y(T){T.property("__zoom",i$).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",B).filter(i).on("touchstart.zoom",$).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",C).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(T,w,D,F){var z=T.selection?T.selection():T;z.property("__zoom",i$),T!==z?_(T,w,D,F):z.interrupt().each(function(){A(this,arguments).event(F).start().zoom(null,typeof w=="function"?w.apply(this,arguments):w).end()})},y.scaleBy=function(T,w,D,F){y.scaleTo(T,function(){var z=this.__zoom.k,I=typeof w=="function"?w.apply(this,arguments):w;return z*I},D,F)},y.scaleTo=function(T,w,D,F){y.transform(T,function(){var z=t.apply(this,arguments),I=this.__zoom,N=D==null?x(z):typeof D=="function"?D.apply(this,arguments):D,E=I.invert(N),O=typeof w=="function"?w.apply(this,arguments):w;return n(v(b(I,O),N,E),z,a)},D,F)},y.translateBy=function(T,w,D,F){y.transform(T,function(){return n(this.__zoom.translate(typeof w=="function"?w.apply(this,arguments):w,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),a)},null,F)},y.translateTo=function(T,w,D,F,z){y.transform(T,function(){var I=t.apply(this,arguments),N=this.__zoom,E=F==null?x(I):typeof F=="function"?F.apply(this,arguments):F;return n(Li.translate(E[0],E[1]).scale(N.k).translate(typeof w=="function"?-w.apply(this,arguments):-w,typeof D=="function"?-D.apply(this,arguments):-D),I,a)},F,z)};function b(T,w){return w=Math.max(o[0],Math.min(o[1],w)),w===T.k?T:new Jt(w,T.x,T.y)}function v(T,w,D){var F=w[0]-D[0]*T.k,z=w[1]-D[1]*T.k;return F===T.x&&z===T.y?T:new Jt(T.k,F,z)}function x(T){return[(+T[0][0]+ +T[1][0])/2,(+T[0][1]+ +T[1][1])/2]}function _(T,w,D,F){T.on("start.zoom",function(){A(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(F).end()}).tween("zoom",function(){var z=this,I=arguments,N=A(z,I).event(F),E=t.apply(z,I),O=D==null?x(E):typeof D=="function"?D.apply(z,I):D,j=Math.max(E[1][0]-E[0][0],E[1][1]-E[0][1]),ie=z.__zoom,W=typeof w=="function"?w.apply(z,I):w,Q=l(ie.invert(O).concat(j/ie.k),W.invert(O).concat(j/W.k));return function(X){if(X===1)X=W;else{var K=Q(X),q=j/K[2];X=new Jt(q,O[0]-K[0]*q,O[1]-K[1]*q)}N.zoom(null,X)}})}function A(T,w,D){return!D&&T.__zooming||new S(T,w)}function S(T,w){this.that=T,this.args=w,this.active=0,this.sourceEvent=null,this.extent=t.apply(T,w),this.taps=0}S.prototype={event:function(T){return T&&(this.sourceEvent=T),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(T,w){return this.mouse&&T!=="mouse"&&(this.mouse[1]=w.invert(this.mouse[0])),this.touch0&&T!=="touch"&&(this.touch0[1]=w.invert(this.touch0[0])),this.touch1&&T!=="touch"&&(this.touch1[1]=w.invert(this.touch1[0])),this.that.__zoom=w,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(T){var w=V(this.that).datum();u.call(T,this.that,new sI(T,{sourceEvent:this.sourceEvent,target:y,type:T,transform:this.that.__zoom,dispatch:u}),w)}};function P(T,...w){if(!e.apply(this,arguments))return;var D=A(this,w).event(T),F=this.__zoom,z=Math.max(o[0],Math.min(o[1],F.k*Math.pow(2,r.apply(this,arguments)))),I=gt(T);if(D.wheel)(D.mouse[0][0]!==I[0]||D.mouse[0][1]!==I[1])&&(D.mouse[1]=F.invert(D.mouse[0]=I)),clearTimeout(D.wheel);else{if(F.k===z)return;D.mouse=[I,F.invert(I)],ar(this),D.start()}ua(T),D.wheel=setTimeout(N,d),D.zoom("mouse",n(v(b(F,z),D.mouse[0],D.mouse[1]),D.extent,a));function N(){D.wheel=null,D.end()}}function M(T,...w){if(h||!e.apply(this,arguments))return;var D=T.currentTarget,F=A(this,w,!0).event(T),z=V(T.view).on("mousemove.zoom",O,!0).on("mouseup.zoom",j,!0),I=gt(T,D),N=T.clientX,E=T.clientY;us(T.view),xp(T),F.mouse=[I,this.__zoom.invert(I)],ar(this),F.start();function O(ie){if(ua(ie),!F.moved){var W=ie.clientX-N,Q=ie.clientY-E;F.moved=W*W+Q*Q>m}F.event(ie).zoom("mouse",n(v(F.that.__zoom,F.mouse[0]=gt(ie,D),F.mouse[1]),F.extent,a))}function j(ie){z.on("mousemove.zoom mouseup.zoom",null),cs(ie.view,F.moved),ua(ie),F.event(ie).end()}}function B(T,...w){if(e.apply(this,arguments)){var D=this.__zoom,F=gt(T.changedTouches?T.changedTouches[0]:T,this),z=D.invert(F),I=D.k*(T.shiftKey?.5:2),N=n(v(b(D,I),F,z),t.apply(this,w),a);ua(T),s>0?V(this).transition().duration(s).call(_,N,F,T):V(this).call(y.transform,N,F,T)}}function $(T,...w){if(e.apply(this,arguments)){var D=T.touches,F=D.length,z=A(this,w,T.changedTouches.length===F).event(T),I,N,E,O;for(xp(T),N=0;N<F;++N)E=D[N],O=gt(E,this),O=[O,this.__zoom.invert(O),E.identifier],z.touch0?!z.touch1&&z.touch0[2]!==O[2]&&(z.touch1=O,z.taps=0):(z.touch0=O,I=!0,z.taps=1+!!c);c&&(c=clearTimeout(c)),I&&(z.taps<2&&(f=O[0],c=setTimeout(function(){c=null},p)),ar(this),z.start())}}function k(T,...w){if(this.__zooming){var D=A(this,w).event(T),F=T.changedTouches,z=F.length,I,N,E,O;for(ua(T),I=0;I<z;++I)N=F[I],E=gt(N,this),D.touch0&&D.touch0[2]===N.identifier?D.touch0[0]=E:D.touch1&&D.touch1[2]===N.identifier&&(D.touch1[0]=E);if(N=D.that.__zoom,D.touch1){var j=D.touch0[0],ie=D.touch0[1],W=D.touch1[0],Q=D.touch1[1],X=(X=W[0]-j[0])*X+(X=W[1]-j[1])*X,K=(K=Q[0]-ie[0])*K+(K=Q[1]-ie[1])*K;N=b(N,Math.sqrt(X/K)),E=[(j[0]+W[0])/2,(j[1]+W[1])/2],O=[(ie[0]+Q[0])/2,(ie[1]+Q[1])/2]}else if(D.touch0)E=D.touch0[0],O=D.touch0[1];else return;D.zoom("touch",n(v(N,E,O),D.extent,a))}}function C(T,...w){if(this.__zooming){var D=A(this,w).event(T),F=T.changedTouches,z=F.length,I,N;for(xp(T),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),I=0;I<z;++I)N=F[I],D.touch0&&D.touch0[2]===N.identifier?delete D.touch0:D.touch1&&D.touch1[2]===N.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(N=gt(N,this),Math.hypot(f[0]-N[0],f[1]-N[1])<g)){var E=V(this).on("dblclick.zoom");E&&E.apply(this,arguments)}}}return y.wheelDelta=function(T){return arguments.length?(r=typeof T=="function"?T:uu(+T),y):r},y.filter=function(T){return arguments.length?(e=typeof T=="function"?T:uu(!!T),y):e},y.touchable=function(T){return arguments.length?(i=typeof T=="function"?T:uu(!!T),y):i},y.extent=function(T){return arguments.length?(t=typeof T=="function"?T:uu([[+T[0][0],+T[0][1]],[+T[1][0],+T[1][1]]]),y):t},y.scaleExtent=function(T){return arguments.length?(o[0]=+T[0],o[1]=+T[1],y):[o[0],o[1]]},y.translateExtent=function(T){return arguments.length?(a[0][0]=+T[0][0],a[1][0]=+T[1][0],a[0][1]=+T[0][1],a[1][1]=+T[1][1],y):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},y.constrain=function(T){return arguments.length?(n=T,y):n},y.duration=function(T){return arguments.length?(s=+T,y):s},y.interpolate=function(T){return arguments.length?(l=T,y):l},y.on=function(){var T=u.on.apply(u,arguments);return T===u?y:T},y.clickDistance=function(T){return arguments.length?(m=(T=+T)*T,y):Math.sqrt(m)},y.tapDistance=function(T){return arguments.length?(g=+T,y):g},y}const vp=Object.freeze(Object.defineProperty({__proto__:null,Adder:ke,Delaunay:Mf,FormatSpecifier:Hs,InternMap:oo,InternSet:qn,Node:yr,Path:Ao,Voronoi:Ay,ZoomTransform:Jt,active:b5,arc:Ql,area:up,areaRadial:_v,ascending:Se,autoType:Y6,axisBottom:Dc,axisLeft:Mc,axisRight:cM,axisTop:uM,bin:k0,bisect:jn,bisectCenter:aD,bisectLeft:oD,bisectRight:y0,bisector:qa,blob:V6,blur:sD,blur2:b0,blurImage:lD,brush:L5,brushSelection:D5,brushX:M5,brushY:C5,buffer:H6,chord:R5,chordDirected:I5,chordTranspose:E5,cluster:r7,color:An,contourDensity:s6,contours:wf,count:Ka,create:VC,creator:as,cross:gD,csv:Z6,csvFormat:L6,csvFormatBody:k6,csvFormatRow:E6,csvFormatRows:R6,csvFormatValue:I6,csvParse:Cy,csvParseRows:C6,cubehelix:Et,cumsum:mD,curveBasis:RE,curveBasisClosed:EE,curveBasisOpen:IE,curveBumpX:wv,curveBumpY:Tv,curveBundle:BE,curveCardinal:NE,curveCardinalClosed:FE,curveCardinalOpen:zE,curveCatmullRom:OE,curveCatmullRomClosed:GE,curveCatmullRomOpen:YE,curveLinear:eu,curveLinearClosed:WE,curveMonotoneX:XE,curveMonotoneY:VE,curveNatural:UE,curveStep:HE,curveStepAfter:qE,curveStepBefore:jE,descending:g0,deviation:$0,difference:KD,disjoint:QD,dispatch:Qn,drag:hs,dragDisable:us,dragEnable:cs,dsv:q6,dsvFormat:Os,easeBack:ay,easeBackIn:c5,easeBackInOut:ay,easeBackOut:f5,easeBounce:wo,easeBounceIn:l5,easeBounceInOut:u5,easeBounceOut:wo,easeCircle:oy,easeCircleIn:Q3,easeCircleInOut:oy,easeCircleOut:J3,easeCubic:So,easeCubicIn:X3,easeCubicInOut:So,easeCubicOut:V3,easeElastic:sr,easeElasticIn:h5,easeElasticInOut:p5,easeElasticOut:sr,easeExp:iy,easeExpIn:Z3,easeExpInOut:iy,easeExpOut:K3,easeLinear:G3,easePoly:ey,easePolyIn:U3,easePolyInOut:ey,easePolyOut:H3,easeQuad:Jm,easeQuadIn:Y3,easeQuadInOut:Jm,easeQuadOut:W3,easeSin:ry,easeSinIn:j3,easeSinInOut:ry,easeSinOut:q3,every:VD,extent:io,fcumsum:bD,filter:HD,flatGroup:xD,flatRollup:vD,forceCenter:Ef,forceCollide:Ws,forceLink:Bf,forceManyBody:Vs,forceRadial:C8,forceSimulation:Xs,forceX:Ny,forceY:Fy,get format(){return Co},formatDefaultLocale:Uy,formatLocale:Vy,get formatPrefix(){return Nf},formatSpecifier:di,fsum:yD,geoAlbers:ab,geoAlbersUsa:I4,geoArea:O8,geoAzimuthalEqualArea:B4,geoAzimuthalEqualAreaRaw:_h,geoAzimuthalEquidistant:N4,geoAzimuthalEquidistantRaw:Sh,geoBounds:X8,geoCentroid:Z8,geoCircle:K8,geoClipAntimeridian:th,geoClipCircle:D1,geoClipExtent:i4,geoClipRectangle:gl,geoConicConformal:z4,geoConicConformalRaw:ub,geoConicEqualArea:Pl,geoConicEqualAreaRaw:ob,geoConicEquidistant:G4,geoConicEquidistantRaw:cb,geoContains:f4,geoDistance:bl,geoEqualEarth:W4,geoEqualEarthRaw:wh,geoEquirectangular:O4,geoEquirectangularRaw:Uo,geoGnomonic:X4,geoGnomonicRaw:Th,geoGraticule:F1,geoGraticule10:h4,geoIdentity:V4,geoInterpolate:p4,geoLength:M1,geoMercator:F4,geoMercatorRaw:Vo,geoNaturalEarth1:U4,geoNaturalEarth1Raw:Ah,geoOrthographic:H4,geoOrthographicRaw:Ph,geoPath:T4,geoProjection:Zt,geoProjectionMutator:vh,geoRotation:v1,geoStereographic:j4,geoStereographicRaw:Dh,geoStream:Bt,geoTransform:A4,geoTransverseMercator:q4,geoTransverseMercatorRaw:Mh,gray:fL,greatest:R0,greatestIndex:OD,group:T0,groupSort:SD,groups:A0,hcl:xs,hierarchy:Cl,histogram:k0,hsl:gs,html:n8,image:Q6,index:$D,indexes:_D,interpolate:nn,interpolateArray:yL,interpolateBasis:Sm,interpolateBasisClosed:wm,interpolateBlues:GR,interpolateBrBG:vR,interpolateBuGn:MR,interpolateBuPu:CR,interpolateCividis:HR,interpolateCool:ZR,interpolateCubehelix:kL,interpolateCubehelixDefault:jR,interpolateCubehelixLong:Ts,interpolateDate:Cm,interpolateDiscrete:vL,interpolateGnBu:LR,interpolateGreens:YR,interpolateGreys:WR,interpolateHcl:CL,interpolateHclLong:LL,interpolateHsl:PL,interpolateHslLong:DL,interpolateHue:$L,interpolateInferno:iE,interpolateLab:ML,interpolateMagma:rE,interpolateNumber:vt,interpolateNumberArray:jc,interpolateObject:Lm,interpolateOrRd:kR,interpolateOranges:UR,interpolatePRGn:$R,interpolatePiYG:_R,interpolatePlasma:oE,interpolatePuBu:ER,interpolatePuBuGn:RR,interpolatePuOr:SR,interpolatePuRd:IR,interpolatePurples:XR,interpolateRainbow:KR,interpolateRdBu:wR,interpolateRdGy:TR,interpolateRdPu:BR,interpolateRdYlBu:AR,interpolateRdYlGn:PR,interpolateReds:VR,interpolateRgb:mo,interpolateRgbBasis:Pm,interpolateRgbBasisClosed:mL,interpolateRound:Ss,interpolateSinebow:eE,interpolateSpectral:DR,interpolateString:Kc,interpolateTransformCss:Im,interpolateTransformSvg:Bm,interpolateTurbo:tE,interpolateViridis:nE,interpolateWarm:qR,interpolateYlGn:FR,interpolateYlGnBu:NR,interpolateYlOrBr:zR,interpolateYlOrRd:OR,interpolateZoom:Fm,interrupt:ar,intersection:JD,interval:NL,isoFormat:J9,isoParse:nR,json:e8,lab:bs,lch:hL,least:zD,leastIndex:B0,line:tu,lineRadial:$v,link:nu,linkHorizontal:$E,linkRadial:SE,linkVertical:_E,local:K0,map:jD,matcher:Rc,max:ao,maxIndex:Sc,mean:LD,median:kD,medianIndex:RD,merge:Tc,min:es,minIndex:wc,mode:ID,namespace:co,namespaces:Lc,nice:$c,now:$o,pack:R7,packEnclose:P7,packSiblings:L7,pairs:BD,partition:E7,path:Sf,pathRound:F5,permute:L0,pie:bv,piecewise:Ym,pointRadial:la,pointer:gt,pointers:HC,polygonArea:q7,polygonCentroid:Z7,polygonContains:ek,polygonHull:J7,polygonLength:tk,precisionFixed:Hy,precisionPrefix:jy,precisionRound:qy,quadtree:Ys,quantile:lo,quantileIndex:I0,quantileSorted:E0,quantize:RL,quickselect:ts,radialArea:_v,radialLine:$v,randomBates:ok,randomBernoulli:lk,randomBeta:kb,randomBinomial:Rb,randomCauchy:ck,randomExponential:ak,randomGamma:zh,randomGeometric:Lb,randomInt:rk,randomIrwinHall:Cb,randomLcg:gk,randomLogNormal:ik,randomLogistic:fk,randomNormal:Fh,randomPareto:sk,randomPoisson:hk,randomUniform:nk,randomWeibull:uk,range:wn,rank:FD,reduce:qD,reverse:ZD,rgb:ni,ribbon:U5,ribbonArrow:H5,rollup:D0,rollups:M0,scaleBand:Yh,scaleDiverging:zx,scaleDivergingLog:Ox,scaleDivergingPow:ap,scaleDivergingSqrt:lR,scaleDivergingSymlog:Gx,scaleIdentity:Fb,scaleImplicit:Oh,scaleLinear:xr,scaleLog:Wb,scaleOrdinal:Gh,scalePoint:Wh,scalePow:kn,scaleQuantile:Zb,scaleQuantize:Kb,scaleRadial:qb,scaleSequential:Ix,scaleSequentialLog:Bx,scaleSequentialPow:op,scaleSequentialQuantile:Fx,scaleSequentialSqrt:sR,scaleSequentialSymlog:Nx,scaleSqrt:Pk,scaleSymlog:Ub,scaleThreshold:Qb,scaleTime:oR,scaleUtc:aR,scan:GD,schemeAccent:cR,schemeBlues:uv,schemeBrBG:Yx,schemeBuGn:Kx,schemeBuPu:Qx,schemeCategory10:uR,schemeDark2:fR,schemeGnBu:Jx,schemeGreens:cv,schemeGreys:fv,schemeObservable10:hR,schemeOrRd:ev,schemeOranges:dv,schemePRGn:Wx,schemePaired:pR,schemePastel1:dR,schemePastel2:gR,schemePiYG:Xx,schemePuBu:nv,schemePuBuGn:tv,schemePuOr:Vx,schemePuRd:rv,schemePurples:hv,schemeRdBu:Ux,schemeRdGy:Hx,schemeRdPu:iv,schemeRdYlBu:jx,schemeRdYlGn:qx,schemeReds:pv,schemeSet1:mR,schemeSet2:yR,schemeSet3:bR,schemeSpectral:Zx,schemeTableau10:xR,schemeYlGn:av,schemeYlGnBu:ov,schemeYlOrBr:sv,schemeYlOrRd:lv,select:V,selectAll:jC,selection:er,selector:ss,selectorAll:kc,shuffle:YD,shuffler:N0,some:UD,sort:bc,stack:QE,stackOffsetDiverging:eI,stackOffsetExpand:JE,stackOffsetNone:Mi,stackOffsetSilhouette:tI,stackOffsetWiggle:nI,stackOrderAppearance:e$,stackOrderAscending:t$,stackOrderDescending:iI,stackOrderInsideOut:oI,stackOrderNone:Ci,stackOrderReverse:aI,stratify:F7,style:Jn,subset:tM,sum:Ac,superset:z0,svg:r8,symbol:kE,symbolAsterisk:Av,symbolCircle:ru,symbolCross:Pv,symbolDiamond:Mv,symbolDiamond2:Cv,symbolPlus:Lv,symbolSquare:kv,symbolSquare2:Rv,symbolStar:Iv,symbolTimes:pp,symbolTriangle:Bv,symbolTriangle2:Nv,symbolWye:Fv,symbolX:pp,symbols:zv,symbolsFill:zv,symbolsStroke:LE,text:Gs,thresholdFreedmanDiaconis:MD,thresholdScott:CD,thresholdSturges:_c,tickFormat:Nb,tickIncrement:Kn,tickStep:Ja,ticks:Zn,timeDay:wi,timeDays:Rk,get timeFormat(){return np},timeFormatDefaultLocale:Rx,timeFormatLocale:yx,timeFriday:ix,timeFridays:Ok,timeHour:Ol,timeHours:Lk,timeInterval:Ce,timeMillisecond:Si,timeMilliseconds:Jb,timeMinute:Fl,timeMinutes:Mk,timeMonday:ta,timeMondays:Bk,timeMonth:Yl,timeMonths:jk,get timeParse(){return kx},timeSaturday:ox,timeSaturdays:Gk,timeSecond:gn,timeSeconds:tx,timeSunday:Ti,timeSundays:ax,timeThursday:$r,timeThursdays:zk,timeTickInterval:mx,timeTicks:gx,timeTuesday:nx,timeTuesdays:Nk,timeWednesday:rx,timeWednesdays:Fk,timeWeek:Ti,timeWeeks:ax,timeYear:Kt,timeYears:Zk,timeout:ef,timer:Ms,timerFlush:Vm,transition:Km,transpose:F0,tree:V7,treemap:Db,treemapBinary:U7,treemapDice:Qo,treemapResquarify:j7,treemapSlice:Il,treemapSliceDice:H7,treemapSquarify:Nh,tsv:K6,tsvFormat:N6,tsvFormatBody:F6,tsvFormatRow:O6,tsvFormatRows:z6,tsvFormatValue:G6,tsvParse:Ly,tsvParseRows:B6,union:nM,unixDay:Jh,unixDays:Ik,utcDay:ea,utcDays:Ek,get utcFormat(){return Xl},utcFriday:ux,utcFridays:Uk,utcHour:Gl,utcHours:kk,utcMillisecond:Si,utcMilliseconds:Jb,utcMinute:zl,utcMinutes:Ck,utcMonday:na,utcMondays:Yk,utcMonth:Wl,utcMonths:qk,get utcParse(){return rp},utcSaturday:cx,utcSaturdays:Hk,utcSecond:gn,utcSeconds:tx,utcSunday:Ai,utcSundays:fx,utcThursday:Sr,utcThursdays:Vk,utcTickInterval:dx,utcTicks:px,utcTuesday:sx,utcTuesdays:Wk,utcWednesday:lx,utcWednesdays:Xk,utcWeek:Ai,utcWeeks:fx,utcYear:Qt,utcYears:Kk,variance:v0,window:Ec,xml:t8,zip:XD,zoom:yn,zoomIdentity:Li,zoomTransform:r$},Symbol.toStringTag,{value:"Module"}));function o$(e){try{return e.node().getBBox()}catch(t){throw new Error(t)}}function pI(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 ca(e){return e.substring(0,4)!=="ease"?So:vp[e]??So}function cu({axisWidth:e,innerRadius:t,outerRadius:n,padAngle:r,cornerRadius:i}){const o=xr().domain([0,1]).range([0,e/2]),a=o(n);return Ql().innerRadius(o(t)).outerRadius(a).padAngle(r).padRadius(a).cornerRadius(i)}const wr=(e,t)=>{if(t instanceof Function){const n=t(e);return String(n??"")}return Co(t)(e)};function fa(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 be(e,t){const n=t.colors[t.colorScheme];return e==="label"?n.label[0]:e=="none"?"none":n[e]!=null?n[e]:n.primary}function Me({datum:e,colorType:t,fullChartParams:n}){return t==="label"?e.color?e.color:n.colors[n.colorScheme].label[0]:t=="none"?"none":n.colors[n.colorScheme][t]!=null?n.colors[n.colorScheme][t]:n.colors[n.colorScheme].primary}function Z(e,t,n){const r=n?`--${n}`:"";return`orbcharts-${e}__${t}${r}`}function Pt(e,t){const r=Math.random().toString(36).substr(2,5);return Z(e,t,r)}function ha(e,t){let n=new de(()=>{});return e.each(function(){const r=Iu(this,t);n=Bu(n,r)}),n}const Tr=({selection:e,pluginName:t,clipPathID:n,seriesLabels$:r,gridContainerPosition$:i,gridAxesTransform$:o,gridGraphicTransform$:a})=>{const s=Z(t,"series"),l=Z(t,"axes"),u=Z(t,"graphic"),c=r.pipe(R((d,m)=>e.selectAll(`g.${s}`).data(d,g=>g).join(g=>g.append("g").classed(s,!0).each((y,b,v)=>{V(v[b]).selectAll(`g.${l}`).data([b]).join(x=>x.append("g").classed(l,!0).attr("clip-path",`url(#${n})`).each((_,A,S)=>{V(S[A]).selectAll("defs").data([A]).join("defs"),V(S[A]).selectAll("g").data([A]).join("g").classed(u,!0)}),x=>x,x=>x.remove())}),g=>g,g=>g.remove())),pe(1));Y({seriesSelection:c,gridContainerPosition:i}).pipe(G(async d=>d)).subscribe(d=>{d.seriesSelection.transition().attr("transform",(m,g)=>{const y=d.gridContainerPosition[g]??d.gridContainerPosition[0],b=y.translate,v=y.scale;return`translate(${b[0]}, ${b[1]}) scale(${v[0]}, ${v[1]})`})});const f=Y({seriesSelection:c,gridAxesTransform:o}).pipe(G(async d=>d),R(d=>d.seriesSelection.select(`g.${l}`).style("transform",d.gridAxesTransform.value)),pe(1)),h=f.pipe(R(d=>d.select("defs")),pe(1)),p=Y({axesSelection:f,gridGraphicTransform:a}).pipe(G(async d=>d),R(d=>{const m=d.axesSelection.select(`g.${u}`);return m.transition().duration(50).style("transform",d.gridGraphicTransform.value),m}),pe(1));return{seriesSelection$:c,axesSelection$:f,defsSelection$:h,graphicGSelection$:p}},a$=({fullDataFormatter$:e,gridAxesSize$:t,computedData$:n,fullChartParams$:r,gridContainerPosition$:i,layout$:o})=>{const a=new J,s=Y({fullDataFormatter:e,gridAxesSize:t,computedData:n}).pipe(G(async h=>h),R(h=>{const p=h.computedData[0]?h.computedData[0].length-1:0,d=h.fullDataFormatter.groupAxis.scaleDomain[0]-h.fullDataFormatter.groupAxis.scalePadding,m=h.fullDataFormatter.groupAxis.scaleDomain[1]==="max"?p+h.fullDataFormatter.groupAxis.scalePadding:h.fullDataFormatter.groupAxis.scaleDomain[1]+h.fullDataFormatter.groupAxis.scalePadding;return[d,m]}),pe(1)),l=Y({fullDataFormatter:e,computedData:n}).pipe(G(async h=>h),R(h=>h.fullDataFormatter.seriesDirection==="row"?(h.computedData[0]??[]).map(p=>p.groupLabel):h.computedData.map(p=>p[0].groupLabel))),u=Y({groupScaleDomain:s,groupLabels:l}).pipe(G(async h=>h),R(h=>h.groupLabels.filter((p,d)=>d>=h.groupScaleDomain[0]&&d<=h.groupScaleDomain[1]))),c=i.pipe(R(h=>h.reduce((d,m)=>m.columnIndex>d?m.columnIndex:d,0)+1),ee()),f=i.pipe(R(h=>h.reduce((d,m)=>m.rowIndex>d?m.rowIndex:d,0)+1),ee());return new de(h=>{Y({dataFormatter:e,axisSize:t,fullChartParams:r,scaleRangeGroupLabels:u,groupLabels:l,groupScaleDomain:s,columnAmount:c,rowAmount:f,layout:o}).pipe(L(a),G(async p=>p)).subscribe(p=>{const d=p.dataFormatter.valueAxis.position==="right"||p.dataFormatter.valueAxis.position==="bottom",m=f0({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 v={offsetX:b.offsetX*p.columnAmount%p.layout.rootWidth,offsetY:b.offsetY*p.rowAmount%p.layout.rootHeight},x=g(v),_=m(x),A=Math.ceil(p.groupScaleDomain[0]),S=_+A;return{groupIndex:S,groupLabel:p.groupLabels[S]??""}};return h.next(y),function(){a.next(void 0)}})})},dI=({rootSelection:e,fullDataFormatter$:t,gridAxesSize$:n,computedData$:r,fullChartParams$:i,gridContainerPosition$:o,layout$:a})=>{const s=ha(e,"mousemove"),l=Y({fullDataFormatter:t,gridAxesSize:n,computedData:r}).pipe(G(async b=>b),R(b=>{const v=b.computedData[0]?b.computedData[0].length-1:0,x=b.fullDataFormatter.groupAxis.scaleDomain[0]-b.fullDataFormatter.groupAxis.scalePadding,_=b.fullDataFormatter.groupAxis.scaleDomain[1]==="max"?v+b.fullDataFormatter.groupAxis.scalePadding:b.fullDataFormatter.groupAxis.scaleDomain[1]+b.fullDataFormatter.groupAxis.scalePadding;return[x,_]}),pe(1)),u=Y({fullDataFormatter:t,computedData:r}).pipe(G(async b=>b),R(b=>b.fullDataFormatter.seriesDirection==="row"?(b.computedData[0]??[]).map(v=>v.groupLabel):b.computedData.map(v=>v[0].groupLabel))),c=Y({groupScaleDomain:l,groupLabels:u}).pipe(G(async b=>b),R(b=>b.groupLabels.filter((v,x)=>x>=b.groupScaleDomain[0]&&x<=b.groupScaleDomain[1]))),f=t.pipe(R(b=>b.valueAxis.position==="right"||b.valueAxis.position==="bottom")),h=Y({reverse:f,gridAxesSize:n,scaleRangeGroupLabels:c,fullDataFormatter:t}).pipe(G(async b=>b),R(b=>f0({axisLabels:b.scaleRangeGroupLabels,axisWidth:b.gridAxesSize.width,padding:b.fullDataFormatter.groupAxis.scalePadding,reverse:b.reverse}))),p=o.pipe(R(b=>b.reduce((x,_)=>_.columnIndex>x?_.columnIndex:x,0)+1),ee()),d=o.pipe(R(b=>b.reduce((x,_)=>_.rowIndex>x?_.rowIndex:x,0)+1),ee()),m=Y({fullDataFormatter:t,fullChartParams:i,rootMousemove:s,columnAmount:p,rowAmount:d,layout:a}).pipe(G(async b=>b),R(b=>{const v={offsetX:b.rootMousemove.offsetX*b.columnAmount%b.layout.rootWidth,offsetY:b.rootMousemove.offsetY*b.rowAmount%b.layout.rootHeight};return b.fullDataFormatter.groupAxis.position==="bottom"||b.fullDataFormatter.groupAxis.position==="top"?v.offsetX-b.fullChartParams.padding.left:v.offsetY-b.fullChartParams.padding.top})),g=Y({xIndexScale:h,axisValue:m,groupScaleDomain:l}).pipe(G(async b=>b),R(b=>{const v=b.xIndexScale(b.axisValue),x=Math.ceil(b.groupScaleDomain[0]);return v+x})),y=Y({groupIndex:g,groupLabels:u}).pipe(G(async b=>b),R(b=>b.groupLabels[b.groupIndex]??""));return Y({groupIndex:g,groupLabel:y}).pipe(G(async b=>b),R(b=>({groupIndex:b.groupIndex,groupLabel:b.groupLabel})))};function gI(e="curveLinear"){return tu().x(t=>t.axisX).y(t=>t.axisY).curve(vp[e])}function mI(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 yI({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 bI({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?V(o[i]).style("opacity",1):V(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}function xI({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)=>{V(a[o]).selectAll("rect").data([i]).join(s=>{const l=s.append("rect");return l.transition().duration(n).ease(ca(r)).tween("tween",(u,c,f)=>h=>{const p=u.width*h;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 s$=(e,{selection:t,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullDataFormatter$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:m,gridContainerPosition$:g,allContainerPosition$:y,layout$:b,event$:v})=>{const x=new J,_=Pt(e,"clipPath-box"),A=Z(e,"path"),{seriesSelection$:S,axesSelection$:P,defsSelection$:M,graphicGSelection$:B}=Tr({selection:t,pluginName:e,clipPathID:_,seriesLabels$:a,gridContainerPosition$:g,gridAxesTransform$:h,gridGraphicTransform$:p}),$=new de(z=>{const I=u.pipe(L(x)).subscribe(N=>{if(!N)return;const E=gI(N.lineCurve);z.next(E)});return()=>{I.unsubscribe()}}),k=f.pipe(R(z=>z.transitionDuration),ee()),C=f.pipe(R(z=>z.transitionEase),ee());Y({defsSelection:M,seriesLabels:a,axisSize:d,transitionDuration:k,transitionEase:C}).pipe(L(x),G(async z=>z)).subscribe(z=>{const N=[{id:_,width:z.axisSize.width,height:z.axisSize.height}].concat(z.seriesLabels.map(E=>({id:`orbcharts__clipPath_${E}`,width:z.axisSize.width,height:z.axisSize.height})));xI({defsSelection:z.defsSelection,clipPathData:N,transitionDuration:z.transitionDuration,transitionEase:z.transitionEase})});const T=n.pipe(R(z=>{const I=new Map;return z.flat().forEach(N=>I.set(N.id,N)),I})),w=a$({fullDataFormatter$:c,gridAxesSize$:d,computedData$:n,fullChartParams$:f,gridContainerPosition$:y,layout$:b}),D=f.pipe(L(x),R(z=>z.highlightTarget),ee()),F=Y({graphicGSelection:B,visibleComputedLayoutData:o,linePath:$,params:u}).pipe(L(x),G(async z=>z),R(z=>{let I=[];return z.graphicGSelection.each((N,E,O)=>{const j=mI(z.visibleComputedLayoutData[E]??[]);I[E]=yI({selection:V(O[E]),pathClassName:A,linePath:z.linePath,segmentData:j,params:z.params})}),I}));return Y({pathSelectionArr:F,computedData:n,SeriesDataMap:s,GroupDataMap:l,highlightTarget:D,gridGroupPositionFn:w}).pipe(L(x),G(async z=>z)).subscribe(z=>{z.pathSelectionArr.forEach(I=>{I.on("mouseover",(N,E)=>{N.stopPropagation();const O=E[0]?E[0].seriesLabel:"",{groupIndex:j,groupLabel:ie}=z.gridGroupPositionFn(N),X=z.GroupDataMap.get(ie).find(K=>K.seriesLabel===O)??E[0];v.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:z.highlightTarget,datum:X,gridIndex:X.gridIndex,series:z.SeriesDataMap.get(X.seriesLabel),seriesIndex:X.seriesIndex,seriesLabel:X.seriesLabel,groups:z.GroupDataMap.get(X.groupLabel),groupIndex:X.groupIndex,groupLabel:X.groupLabel,event:N,data:z.computedData})}).on("mousemove",(N,E)=>{N.stopPropagation();const O=E[0]?E[0].seriesLabel:"",{groupIndex:j,groupLabel:ie}=z.gridGroupPositionFn(N),X=z.GroupDataMap.get(ie).find(K=>K.seriesLabel===O)??E[0];v.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:z.highlightTarget,datum:X,gridIndex:X.gridIndex,series:z.SeriesDataMap.get(X.seriesLabel),seriesIndex:X.seriesIndex,seriesLabel:X.seriesLabel,groups:z.GroupDataMap.get(X.groupLabel),groupIndex:X.groupIndex,groupLabel:X.groupLabel,event:N,data:z.computedData})}).on("mouseout",(N,E)=>{N.stopPropagation();const O=E[0]?E[0].seriesLabel:"",{groupIndex:j,groupLabel:ie}=z.gridGroupPositionFn(N),X=z.GroupDataMap.get(ie).find(K=>K.seriesLabel===O)??E[0];v.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:z.highlightTarget,datum:X,gridIndex:X.gridIndex,series:z.SeriesDataMap.get(X.seriesLabel),seriesIndex:X.seriesIndex,seriesLabel:X.seriesLabel,groups:z.GroupDataMap.get(X.groupLabel),groupIndex:X.groupIndex,groupLabel:X.groupLabel,event:N,data:z.computedData})}).on("click",(N,E)=>{N.stopPropagation();const O=E[0]?E[0].seriesLabel:"",{groupIndex:j,groupLabel:ie}=z.gridGroupPositionFn(N),X=z.GroupDataMap.get(ie).find(K=>K.seriesLabel===O)??E[0];v.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:z.highlightTarget,datum:X,gridIndex:X.gridIndex,series:z.SeriesDataMap.get(X.seriesLabel),seriesIndex:X.seriesIndex,seriesLabel:X.seriesLabel,groups:z.GroupDataMap.get(X.groupLabel),groupIndex:X.groupIndex,groupLabel:X.groupLabel,event:N,data:z.computedData})})})}),f.pipe(L(x),Rr(z=>z.highlightTarget==="series"),G(z=>Y({graphicGSelection:B,gridHighlight:m,DataMap:T,fullChartParams:f}).pipe(L(x),G(async I=>I)))).subscribe(z=>{const I=z.gridHighlight[0]?z.gridHighlight[0].seriesLabel:null;bI({selection:z.graphicGSelection,seriesLabel:I,fullChartParams:z.fullChartParams})}),()=>{x.next(void 0)}},l$=0,bn=2,u$=3,c$=4,bt=5,fu=6,$p=7,ki=8,Ri=9,f$="Lines",vI=st({name:f$,defaultParams:Dr,layerIndex:bt,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 J,a=s$(f$,{selection:e,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,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 $I(e="curveLinear",t){return up().x(n=>n.axisX).y0(n=>t).y1(n=>n.axisY).curve(vp[e])}function _I(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 SI({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 wI({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?V(o[i]).style("opacity",1):V(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}function TI({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`
47
47
  <stop offset="0%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[0]}"/>
48
48
  <stop offset="100%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[1]}"/>
49
- `})}function KE({defsSelection:t,clipPathData:e,transitionDuration:n,transitionEase:r}){t.selectAll("clipPath").data(e).join(i=>i.append("clipPath"),i=>i,i=>i.remove()).attr("id",i=>i.id).each((i,o,a)=>{H(a[o]).selectAll("rect").data([i]).join(s=>{const l=s.append("rect");return l.transition().duration(n).ease(Jo(r)).tween("tween",(u,c,f)=>h=>{const p=u.width*h;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 n2=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullDataFormatter$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:m,gridContainerPosition$:g,layout$:y,event$:b})=>{const v=new tt,x=Ke(t,"clipPath-box"),_=J(t,"path"),{seriesSelection$:S,axesSelection$:A,defsSelection$:T,graphicGSelection$:C}=vr({selection:e,pluginName:t,clipPathID:x,seriesLabels$:a,gridContainerPosition$:g,gridAxesTransform$:h,gridGraphicTransform$:p}),I=p.pipe(k(v),B(E=>-E.translate[1]/E.scale[1])),$=new pt(E=>{const N=Y({fullParams:u,valueAxisStart:I}).pipe(k(v)).subscribe(R=>{const F=UE(R.fullParams.lineCurve,R.valueAxisStart);E.next(F)});return()=>{N.unsubscribe()}}),L=f.pipe(B(E=>E.transitionDuration),Q()),P=f.pipe(B(E=>E.transitionEase),Q());Y({defsSelection:T,seriesLabels:a,axisSize:d,transitionDuration:L,transitionEase:P}).pipe(k(v),G(async E=>E)).subscribe(E=>{const R=[{id:x,width:E.axisSize.width,height:E.axisSize.height}].concat(E.seriesLabels.map(F=>({id:`orbcharts__clipPath_${F}`,width:E.axisSize.width,height:E.axisSize.height})));KE({defsSelection:E.defsSelection,clipPathData:R,transitionDuration:E.transitionDuration,transitionEase:E.transitionEase})});const w=n.pipe(B(E=>{const N=new Map;return E.flat().forEach(R=>N.set(R.id,R)),N})),M=Zv({fullDataFormatter$:c,gridAxesSize$:d,computedData$:n,fullChartParams$:f,gridContainerPosition$:g,layout$:y}),D=f.pipe(k(v),B(E=>E.highlightTarget),Q()),X=a.pipe(k(v),B(E=>E.map((N,R)=>Ke(t,`lineargradient-${N}`)))),O=Y({graphicGSelection:C,defsSelection:T,visibleComputedLayoutData:o,linearGradientIds:X,areaPath:$,params:u}).pipe(k(v),G(async E=>E),B(E=>{let N=[];return E.graphicGSelection.each((R,F,U)=>{const it=HE(E.visibleComputedLayoutData[F]??[]);N[F]=jE({selection:H(U[F]),pathClassName:_,areaPath:E.areaPath,segmentData:it,linearGradientIds:E.linearGradientIds,params:E.params}),ZE({defsSelection:E.defsSelection,computedData:E.visibleComputedLayoutData,linearGradientIds:E.linearGradientIds,params:E.params})}),N}));return Y({pathSelectionArr:O,computedData:n,SeriesDataMap:s,GroupDataMap:l,highlightTarget:D,gridGroupPositionFn:M}).pipe(k(v),G(async E=>E)).subscribe(E=>{E.pathSelectionArr.forEach(N=>{N.on("mouseover",(R,F)=>{const U=F[0]?F[0].seriesLabel:"",{groupIndex:it,groupLabel:z}=E.gridGroupPositionFn(R),Z=E.GroupDataMap.get(z).find(j=>j.seriesLabel===U)??F[0];b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:E.highlightTarget,datum:Z,gridIndex:Z.gridIndex,series:E.SeriesDataMap.get(Z.seriesLabel),seriesIndex:Z.seriesIndex,seriesLabel:Z.seriesLabel,groups:E.GroupDataMap.get(Z.groupLabel),groupIndex:Z.groupIndex,groupLabel:Z.groupLabel,event:R,data:E.computedData})}).on("mousemove",(R,F)=>{const U=F[0]?F[0].seriesLabel:"",{groupIndex:it,groupLabel:z}=E.gridGroupPositionFn(R),Z=E.GroupDataMap.get(z).find(j=>j.seriesLabel===U)??F[0];b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:E.highlightTarget,datum:Z,gridIndex:Z.gridIndex,series:E.SeriesDataMap.get(Z.seriesLabel),seriesIndex:Z.seriesIndex,seriesLabel:Z.seriesLabel,groups:E.GroupDataMap.get(Z.groupLabel),groupIndex:Z.groupIndex,groupLabel:Z.groupLabel,event:R,data:E.computedData})}).on("mouseout",(R,F)=>{const U=F[0]?F[0].seriesLabel:"",{groupIndex:it,groupLabel:z}=E.gridGroupPositionFn(R),Z=E.GroupDataMap.get(z).find(j=>j.seriesLabel===U)??F[0];b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:E.highlightTarget,datum:Z,gridIndex:Z.gridIndex,series:E.SeriesDataMap.get(Z.seriesLabel),seriesIndex:Z.seriesIndex,seriesLabel:Z.seriesLabel,groups:E.GroupDataMap.get(Z.groupLabel),groupIndex:Z.groupIndex,groupLabel:Z.groupLabel,event:R,data:E.computedData})}).on("click",(R,F)=>{const U=F[0]?F[0].seriesLabel:"",{groupIndex:it,groupLabel:z}=E.gridGroupPositionFn(R),Z=E.GroupDataMap.get(z).find(j=>j.seriesLabel===U)??F[0];b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:E.highlightTarget,datum:Z,gridIndex:Z.gridIndex,series:E.SeriesDataMap.get(Z.seriesLabel),seriesIndex:Z.seriesIndex,seriesLabel:Z.seriesLabel,groups:E.GroupDataMap.get(Z.groupLabel),groupIndex:Z.groupIndex,groupLabel:Z.groupLabel,event:R,data:E.computedData})})})}),f.pipe(k(v),Dr(E=>E.highlightTarget==="series"),G(E=>Y({graphicGSelection:C,gridHighlight:m,DataMap:w,fullChartParams:f}).pipe(k(v),G(async N=>N)))).subscribe(E=>{const N=E.gridHighlight[0]?E.gridHighlight[0].seriesLabel:null;qE({selection:E.graphicGSelection,seriesLabel:N,fullChartParams:E.fullChartParams})}),()=>{v.next(void 0)}},r2="LineAreas",QE=ie({name:r2,defaultParams:Op,layerIndex:t2,validator:(t,{validateColumns:e})=>e(t,{lineCurve:{toBeTypes:["string"]},linearGradientOpacity:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}})})(({selection:t,name:e,observer:n,subject:r})=>{const i=new tt,o=n2(r2,{selection:t,computedData$:n.computedData$,visibleComputedData$:n.visibleComputedData$,computedLayoutData$:n.computedLayoutData$,visibleComputedLayoutData$:n.visibleComputedLayoutData$,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()}}),i2=.3;function o2({axisWidth:t,groupAmount:e,barAmountOfGroup:n,barPadding:r=0,barGroupPadding:i=0}){const a=((e>1?t/(e-1):t)-i)/n-r;return a>1?a:1}function JE(t,e,n){const r=t/2,i=t*e.length+n.barPadding*e.length;return Mh().domain(e).range([-i/2+r,i/2-r])}function tI(t,e){return t<=1?0:e/(t-1)*i2}function eI(t,e){return t<=1?e:e*(1-i2)}function nI({graphicGSelection:t,rectClassName:e,visibleComputedLayoutData:n,zeroYArr:r,groupLabels:i,barScale:o,params:a,chartParams:s,barWidth:l,transformedBarRadius:u,delayGroup:c,transitionItem:f,isSeriesSeprate:h}){const p=l/2;return t.each((m,g,y)=>{H(y[g]).selectAll(`rect.${e}`).data(n[g]??[],b=>b.id).join(b=>b.append("rect").classed(e,!0).attr("cursor","pointer").attr("height",v=>1),b=>b,b=>b.remove()).attr("transform",(b,v)=>`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=>h?0:o(b.seriesLabel)).attr("width",l).attr("rx",u[g][0]??1).attr("ry",u[g][1]??1).transition().duration(f).ease(Jo(s.transitionEase)).delay((b,v)=>b.groupIndex*c).attr("height",b=>Math.abs(b.axisYFromZero)||1)}),t.selectAll(`rect.${e}`)}function rI({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{H(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 iI({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{e.includes(r.id)?H(o[i]).style("opacity",1):H(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const lp=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullChartParams$:c,gridAxesTransform$:f,gridGraphicTransform$:h,gridGraphicReverseScale$:p,gridAxesSize$:d,gridHighlight$:m,gridContainerPosition$:g,isSeriesSeprate$:y,event$:b})=>{const v=new tt,x=Ke(t,"clipPath-box"),_=J(t,"rect"),{seriesSelection$:S,axesSelection$:A,defsSelection$:T,graphicGSelection$:C}=vr({selection:e,pluginName:t,clipPathID:x,seriesLabels$:a,gridContainerPosition$:g,gridAxesTransform$:f,gridGraphicTransform$:h}),I=o.pipe(k(v),B(N=>N.map(R=>R[0]?R[0].axisY-R[0].axisYFromZero:0)),Q()),$=Y({computedData:n,visibleComputedData:i,params:u,gridAxesSize:d,isSeriesSeprate:y}).pipe(k(v),G(async N=>N),B(N=>N.params.barWidth?N.params.barWidth:N.isSeriesSeprate?o2({axisWidth:N.gridAxesSize.width,groupAmount:N.computedData[0]?N.computedData[0].length:0,barAmountOfGroup:1,barPadding:N.params.barPadding,barGroupPadding:N.params.barGroupPadding}):o2({axisWidth:N.gridAxesSize.width,groupAmount:N.computedData[0]?N.computedData[0].length:0,barAmountOfGroup:N.visibleComputedData.length,barPadding:N.params.barPadding,barGroupPadding:N.params.barGroupPadding})),Q()),L=Y({computedData:n,barWidth:$,params:u,gridGraphicReverseScale:p}).pipe(k(v),G(async N=>N),B(N=>{const R=N.barWidth/2,F=N.params.barRadius===!0?R:N.params.barRadius===!1?0:typeof N.params.barRadius=="number"?N.params.barRadius:0;return N.computedData.map((U,it)=>{const z=N.gridGraphicReverseScale[it]??N.gridGraphicReverseScale[0];let K=F*z[0],V=F*z[1];if(K>R){const Z=R/K;K=K*Z,V=V*Z}return[K,V]})})),P=i.pipe(k(v),B(N=>{const R=new Set;return N.forEach(F=>{F.forEach(U=>{R.add(U.groupLabel)})}),Array.from(R)})),w=Y({seriesLabels:a,barWidth:$,params:u}).pipe(k(v),G(async N=>N),B(N=>JE(N.barWidth,N.seriesLabels,N.params))),M=c.pipe(k(v),B(N=>N.transitionDuration),Q()),D=new pt(N=>{Y({groupLabels:P,transitionDuration:M}).pipe(G(async R=>R)).subscribe(R=>{const F=tI(R.groupLabels.length,R.transitionDuration);N.next(F)})}).pipe(k(v),Q()),X=new pt(N=>{Y({groupLabels:P,transitionDuration:M}).pipe(G(async R=>R)).subscribe(R=>{const F=eI(R.groupLabels.length,R.transitionDuration);N.next(F)})}).pipe(k(v),Q());Y({defsSelection:T,gridAxesSize:d}).pipe(k(v),G(async N=>N)).subscribe(N=>{const R=[{id:x,width:N.gridAxesSize.width,height:N.gridAxesSize.height}];rI({defsSelection:N.defsSelection,clipPathData:R})});const O=c.pipe(k(v),B(N=>N.highlightTarget),Q()),E=Y({graphicGSelection:C,visibleComputedLayoutData:o,zeroYArr:I,groupLabels:P,barScale:w,params:u,chartParams:c,highlightTarget:O,barWidth:$,transformedBarRadius:L,delayGroup:D,transitionItem:X,isSeriesSeprate:y}).pipe(k(v),G(async N=>N),B(N=>nI({graphicGSelection:N.graphicGSelection,rectClassName:_,visibleComputedLayoutData:N.visibleComputedLayoutData,zeroYArr:N.zeroYArr,groupLabels:N.groupLabels,barScale:N.barScale,params:N.params,chartParams:N.chartParams,barWidth:N.barWidth,transformedBarRadius:N.transformedBarRadius,delayGroup:N.delayGroup,transitionItem:N.transitionItem,isSeriesSeprate:N.isSeriesSeprate})));return Y({barSelection:E,computedData:n,highlightTarget:O,SeriesDataMap:s,GroupDataMap:l}).pipe(k(v),G(async N=>N)).subscribe(N=>{N.barSelection.on("mouseover",(R,F)=>{R.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:N.highlightTarget,datum:F,gridIndex:F.gridIndex,series:N.SeriesDataMap.get(F.seriesLabel),seriesIndex:F.seriesIndex,seriesLabel:F.seriesLabel,groups:N.GroupDataMap.get(F.groupLabel),groupIndex:F.groupIndex,groupLabel:F.groupLabel,event:R,data:N.computedData})}).on("mousemove",(R,F)=>{R.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:N.highlightTarget,datum:F,gridIndex:F.gridIndex,series:N.SeriesDataMap.get(F.seriesLabel),seriesIndex:F.seriesIndex,seriesLabel:F.seriesLabel,groups:N.GroupDataMap.get(F.groupLabel),groupIndex:F.groupIndex,groupLabel:F.groupLabel,event:R,data:N.computedData})}).on("mouseout",(R,F)=>{R.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:N.highlightTarget,datum:F,gridIndex:F.gridIndex,series:N.SeriesDataMap.get(F.seriesLabel),seriesIndex:F.seriesIndex,seriesLabel:F.seriesLabel,groups:N.GroupDataMap.get(F.groupLabel),groupIndex:F.groupIndex,groupLabel:F.groupLabel,event:R,data:N.computedData})}).on("click",(R,F)=>{R.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:N.highlightTarget,datum:F,gridIndex:F.gridIndex,series:N.SeriesDataMap.get(F.seriesLabel),seriesIndex:F.seriesIndex,seriesLabel:F.seriesLabel,groups:N.GroupDataMap.get(F.groupLabel),groupIndex:F.groupIndex,groupLabel:F.groupLabel,event:R,data:N.computedData})})}),Y({barSelection:E,highlight:m.pipe(B(N=>N.map(R=>R.id))),fullChartParams:c}).pipe(k(v),G(async N=>N)).subscribe(N=>{iI({selection:N.barSelection,ids:N.highlight,fullChartParams:N.fullChartParams})}),()=>{v.next(void 0)}},a2="Bars",oI=ie({name:a2,defaultParams:la,layerIndex:Ee,validator:(t,{validateColumns:e})=>e(t,{barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:t,name:e,subject:n,observer:r})=>{const i=new tt,o=lp(a2,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,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()}}),s2="BarsPN",aI=ie({name:s2,defaultParams:la,layerIndex:Ee,validator:(t,{validateColumns:e})=>e(t,{barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:t,name:e,subject:n,observer:r})=>{const i=new tt,o=lp(s2,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,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$:da(!0),event$:n.event$});return()=>{i.next(void 0),o()}}),l2=.3;function sI({axisWidth:t,groupAmount:e,barGroupPadding:n=0}){const i=(e>1?t/(e-1):t)-n;return i>1?i:1}function lI(t,e){return t<=1?0:e/(t-1)*l2}function uI(t,e){return t<=1?e:e*(1-l2)}function cI({graphicGSelection:t,rectClassName:e,barData:n,zeroY:r,groupLabels:i,params:o,chartParams:a,barWidth:s,transformedBarRadius:l,delayGroup:u,transitionItem:c,isSeriesSeprate:f}){const h=s/2;return t.each((d,m,g)=>{H(g[m]).selectAll(`rect.${e}`).data(n[m]??[],y=>y.id).join(y=>y.append("rect").classed(e,!0).attr("cursor","pointer").attr("height",b=>1),y=>y,y=>y.remove()).attr("transform",(y,b)=>`translate(${(y?y.axisX:0)-h}, 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(Jo(a.transitionEase)).delay((y,b)=>y.groupIndex*u).attr("y",y=>y._barStartY).attr("height",y=>Math.abs(y._barHeight)||1)}),t.selectAll(`rect.${e}`)}function fI({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{H(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 hI({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{e.includes(r.id)?H(o[i]).style("opacity",1):H(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const u2=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullDataFormatter$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridGraphicReverseScale$:d,gridAxesSize$:m,gridHighlight$:g,gridContainerPosition$:y,isSeriesSeprate$:b,event$:v})=>{const x=new tt,_=Ke(t,"clipPath-box"),S=J(t,"rect"),{seriesSelection$:A,axesSelection$:T,defsSelection$:C,graphicGSelection$:I}=vr({selection:e,pluginName:t,clipPathID:_,seriesLabels$:a,gridContainerPosition$:y,gridAxesTransform$:h,gridGraphicTransform$:p}),$=o.pipe(k(x),B(z=>z[0]&&z[0][0]?z[0][0].axisY-z[0][0].axisYFromZero:0),Q()),L=Y({computedData:n,params:u,axisSize:m,isSeriesSeprate:b}).pipe(k(x),G(async z=>z),B(z=>z.params.barWidth?z.params.barWidth:sI({axisWidth:z.axisSize.width,groupAmount:z.computedData[0]?z.computedData[0].length:0,barGroupPadding:z.params.barGroupPadding})),Q()),P=Y({computedData:n,barWidth:L,params:u,gridGraphicReverseScale:d}).pipe(k(x),G(async z=>z),B(z=>{const K=z.barWidth/2,V=z.params.barRadius===!0?K:z.params.barRadius===!1?0:typeof z.params.barRadius=="number"?z.params.barRadius:0;return z.computedData.map((Z,j)=>{const nt=z.gridGraphicReverseScale[j]??z.gridGraphicReverseScale[0],st=V*nt[0],W=V*nt[1];return[st,W]})})),w=i.pipe(k(x),B(z=>{const K=new Set;return z.forEach(V=>{V.forEach(Z=>{K.add(Z.groupLabel)})}),Array.from(K)}),yt(1)),M=f.pipe(k(x),B(z=>z.transitionDuration),Q()),D=new pt(z=>{Y({groupLabels:w,transitionDuration:M}).pipe(G(async K=>K)).subscribe(K=>{const V=lI(K.groupLabels.length,K.transitionDuration);z.next(V)})}).pipe(k(x),Q()),X=new pt(z=>{Y({groupLabels:w,transitionDuration:M}).pipe(G(async K=>K)).subscribe(K=>{const V=uI(K.groupLabels.length,K.transitionDuration);z.next(V)})}).pipe(k(x),Q()),O=Y({computedData:n,dataFormatter:c}).pipe(k(x),G(async z=>z),B(z=>{const K=z.computedData[0]?z.computedData[0].length-1:0,V=z.dataFormatter.grid.groupAxis.scaleDomain[0],Z=z.dataFormatter.grid.groupAxis.scaleDomain[1]==="max"?K:z.dataFormatter.grid.groupAxis.scaleDomain[1];return[V,Z]})),E=Y({visibleComputedLayoutData:o,groupScaleDomain:O}).pipe(k(x),G(async z=>z),B(z=>{const K=z.groupScaleDomain[0],V=z.groupScaleDomain[1],j=z.visibleComputedLayoutData.map(gt=>gt.filter((ft,Rt)=>ft.groupIndex>=K&&ft.groupIndex<=V)).flat();if(j.length<=1)return 1;const nt=j.reduce((gt,ft)=>ft.value>gt.value?ft:gt,j[0]),st=nt.groupIndex,W=j.filter(gt=>gt.groupIndex===st).reduce((gt,ft)=>gt+ft.value,0);return nt.value/W})),N=Y({computedLayoutData:r,yRatio:E,zeroY:$}).pipe(k(x),B(z=>{let K=z.computedLayoutData[0]?z.computedLayoutData[0].map(()=>z.zeroY):[];return z.computedLayoutData.map((V,Z)=>V.map((j,nt)=>{const st=K[nt];let W=0;return j.visible&&(W=j.axisYFromZero*z.yRatio,K[nt]=K[nt]+W),{...j,_barStartY:st,_barHeight:W}}))})),R=Y({computedLayoutData:r,zeroY:$}).pipe(k(x),B(z=>z.computedLayoutData.map((K,V)=>K.map((Z,j)=>({...Z,_barStartY:z.zeroY,_barHeight:Z.axisYFromZero}))))),F=b.pipe(G(z=>wu(()=>z,R,N)));Y({defsSelection:C,gridAxesSize:m}).pipe(k(x),G(async z=>z)).subscribe(z=>{const K=[{id:_,width:z.gridAxesSize.width,height:z.gridAxesSize.height}];fI({defsSelection:z.defsSelection,clipPathData:K})});const U=f.pipe(k(x),B(z=>z.highlightTarget),Q()),it=Y({graphicGSelection:I,graphicData:F,zeroY:$,groupLabels:w,params:u,chartParams:f,highlightTarget:U,barWidth:L,transformedBarRadius:P,delayGroup:D,transitionItem:X,isSeriesSeprate:b}).pipe(k(x),G(async z=>z),B(z=>cI({graphicGSelection:z.graphicGSelection,rectClassName:S,barData:z.graphicData,zeroY:z.zeroY,groupLabels:z.groupLabels,params:z.params,chartParams:z.chartParams,barWidth:z.barWidth,transformedBarRadius:z.transformedBarRadius,delayGroup:z.delayGroup,transitionItem:z.transitionItem,isSeriesSeprate:z.isSeriesSeprate})));return Y({barSelection:it,computedData:n,highlightTarget:U,SeriesDataMap:s,GroupDataMap:l}).subscribe(z=>{z.barSelection.on("mouseover",(K,V)=>{K.stopPropagation(),v.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:z.highlightTarget,datum:V,gridIndex:V.gridIndex,series:z.SeriesDataMap.get(V.seriesLabel),seriesIndex:V.seriesIndex,seriesLabel:V.seriesLabel,groups:z.GroupDataMap.get(V.groupLabel),groupIndex:V.groupIndex,groupLabel:V.groupLabel,event:K,data:z.computedData})}).on("mousemove",(K,V)=>{K.stopPropagation(),v.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:z.highlightTarget,datum:V,gridIndex:V.gridIndex,series:z.SeriesDataMap.get(V.seriesLabel),seriesIndex:V.seriesIndex,seriesLabel:V.seriesLabel,groups:z.GroupDataMap.get(V.groupLabel),groupIndex:V.groupIndex,groupLabel:V.groupLabel,event:K,data:z.computedData})}).on("mouseout",(K,V)=>{K.stopPropagation(),v.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:z.highlightTarget,datum:V,gridIndex:V.gridIndex,series:z.SeriesDataMap.get(V.seriesLabel),seriesIndex:V.seriesIndex,seriesLabel:V.seriesLabel,groups:z.GroupDataMap.get(V.groupLabel),groupIndex:V.groupIndex,groupLabel:V.groupLabel,event:K,data:z.computedData})}).on("click",(K,V)=>{K.stopPropagation(),v.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:z.highlightTarget,datum:V,gridIndex:V.gridIndex,series:z.SeriesDataMap.get(V.seriesLabel),seriesIndex:V.seriesIndex,seriesLabel:V.seriesLabel,groups:z.GroupDataMap.get(V.groupLabel),groupIndex:V.groupIndex,groupLabel:V.groupLabel,event:K,data:z.computedData})})}),Y({barSelection:it,highlight:g.pipe(B(z=>z.map(K=>K.id))),fullChartParams:f}).pipe(k(x),G(async z=>z)).subscribe(z=>{hI({selection:z.barSelection,ids:z.highlight,fullChartParams:z.fullChartParams})}),()=>{x.next(void 0)}},c2="BarStack",pI=ie({name:c2,defaultParams:Gp,layerIndex:5,validator:(t,{validateColumns:e})=>e(t,{barWidth:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}})})(({selection:t,name:e,subject:n,observer:r})=>{const i=new tt,o=u2(c2,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,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()}}),f2=.3;function h2({axisWidth:t,groupAmount:e,barAmountOfGroup:n,barPadding:r=0,barGroupPadding:i=0}){const a=((e>1?t/(e-1):t)-i)/n-r;return a>1?a:1}function dI(t,e,n){const r=t/2,i=t*e.length+n.barPadding*e.length;return Mh().domain(e).range([-i/2+r,i/2-r])}function gI(t,e){return t<=1?0:e/(t-1)*f2}function mI(t,e){return t<=1?e:e*(1-f2)}function yI({graphicGSelection:t,pathGClassName:e,pathClassName:n,visibleComputedLayoutData:r,linearGradientIds:i,zeroYArr:o,groupLabels:a,barScale:s,params:l,chartParams:u,barWidth:c,delayGroup:f,transitionItem:h,isSeriesSeprate:p}){const d=c/2;return t.each((g,y,b)=>{H(b[y]).selectAll(`g.${e}`).data(r[y]??[]).join(x=>{const _=x.append("g").classed(e,!0).attr("cursor","pointer");return _.append("path").classed(n,!0).style("vector-effect","non-scaling-stroke").attr("d",S=>{const A=-d,T=o[y],C=o[y];return`M${A},${T} L${A+c/2},${C} ${A+c},${T}`}),_},x=>x,x=>x.remove()).attr("transform",x=>`translate(${p?0:s(x.seriesLabel)}, 0)`).select(`path.${n}`).attr("height",x=>Math.abs(x.axisYFromZero)||1).attr("y",x=>x.axisY<o[y]?x.axisY:o[y]).attr("x",x=>p?0:s(x.seriesLabel)).style("fill",x=>`url(#${i[x.seriesIndex]})`).attr("stroke",x=>x.color).attr("transform",x=>`translate(${x?x.axisX:0}, 0)`).transition().duration(h).ease(Jo(u.transitionEase)).delay((x,_)=>x.groupIndex*f).attr("d",x=>{const _=-d,S=o[y],A=x.axisY;return`M${_},${S} L${_+c/2},${A} ${_+c},${S}`})}),t.selectAll(`path.${n}`)}function bI({defsSelection:t,computedData:e,linearGradientIds:n,params:r}){t.selectAll("linearGradient").data(e??[]).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`
49
+ `})}function AI({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)=>{V(a[o]).selectAll("rect").data([i]).join(s=>{const l=s.append("rect");return l.transition().duration(n).ease(ca(r)).tween("tween",(u,c,f)=>h=>{const p=u.width*h;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 h$=(e,{selection:t,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullDataFormatter$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:m,gridContainerPosition$:g,layout$:y,event$:b})=>{const v=new J,x=Pt(e,"clipPath-box"),_=Z(e,"path"),{seriesSelection$:A,axesSelection$:S,defsSelection$:P,graphicGSelection$:M}=Tr({selection:t,pluginName:e,clipPathID:x,seriesLabels$:a,gridContainerPosition$:g,gridAxesTransform$:h,gridGraphicTransform$:p}),B=p.pipe(L(v),R(I=>-I.translate[1]/I.scale[1])),$=new de(I=>{const N=Y({fullParams:u,valueAxisStart:B}).pipe(L(v)).subscribe(E=>{const O=$I(E.fullParams.lineCurve,E.valueAxisStart);I.next(O)});return()=>{N.unsubscribe()}}),k=f.pipe(R(I=>I.transitionDuration),ee()),C=f.pipe(R(I=>I.transitionEase),ee());Y({defsSelection:P,seriesLabels:a,axisSize:d,transitionDuration:k,transitionEase:C}).pipe(L(v),G(async I=>I)).subscribe(I=>{const E=[{id:x,width:I.axisSize.width,height:I.axisSize.height}].concat(I.seriesLabels.map(O=>({id:`orbcharts__clipPath_${O}`,width:I.axisSize.width,height:I.axisSize.height})));AI({defsSelection:I.defsSelection,clipPathData:E,transitionDuration:I.transitionDuration,transitionEase:I.transitionEase})});const T=n.pipe(R(I=>{const N=new Map;return I.flat().forEach(E=>N.set(E.id,E)),N})),w=a$({fullDataFormatter$:c,gridAxesSize$:d,computedData$:n,fullChartParams$:f,gridContainerPosition$:g,layout$:y}),D=f.pipe(L(v),R(I=>I.highlightTarget),ee()),F=a.pipe(L(v),R(I=>I.map((N,E)=>Pt(e,`lineargradient-${N}`)))),z=Y({graphicGSelection:M,defsSelection:P,visibleComputedLayoutData:o,linearGradientIds:F,areaPath:$,params:u}).pipe(L(v),G(async I=>I),R(I=>{let N=[];return I.graphicGSelection.each((E,O,j)=>{const ie=_I(I.visibleComputedLayoutData[O]??[]);N[O]=SI({selection:V(j[O]),pathClassName:_,areaPath:I.areaPath,segmentData:ie,linearGradientIds:I.linearGradientIds,params:I.params}),TI({defsSelection:I.defsSelection,computedData:I.visibleComputedLayoutData,linearGradientIds:I.linearGradientIds,params:I.params})}),N}));return Y({pathSelectionArr:z,computedData:n,SeriesDataMap:s,GroupDataMap:l,highlightTarget:D,gridGroupPositionFn:w}).pipe(L(v),G(async I=>I)).subscribe(I=>{I.pathSelectionArr.forEach(N=>{N.on("mouseover",(E,O)=>{const j=O[0]?O[0].seriesLabel:"",{groupIndex:ie,groupLabel:W}=I.gridGroupPositionFn(E),K=I.GroupDataMap.get(W).find(q=>q.seriesLabel===j)??O[0];b.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:I.highlightTarget,datum:K,gridIndex:K.gridIndex,series:I.SeriesDataMap.get(K.seriesLabel),seriesIndex:K.seriesIndex,seriesLabel:K.seriesLabel,groups:I.GroupDataMap.get(K.groupLabel),groupIndex:K.groupIndex,groupLabel:K.groupLabel,event:E,data:I.computedData})}).on("mousemove",(E,O)=>{const j=O[0]?O[0].seriesLabel:"",{groupIndex:ie,groupLabel:W}=I.gridGroupPositionFn(E),K=I.GroupDataMap.get(W).find(q=>q.seriesLabel===j)??O[0];b.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:I.highlightTarget,datum:K,gridIndex:K.gridIndex,series:I.SeriesDataMap.get(K.seriesLabel),seriesIndex:K.seriesIndex,seriesLabel:K.seriesLabel,groups:I.GroupDataMap.get(K.groupLabel),groupIndex:K.groupIndex,groupLabel:K.groupLabel,event:E,data:I.computedData})}).on("mouseout",(E,O)=>{const j=O[0]?O[0].seriesLabel:"",{groupIndex:ie,groupLabel:W}=I.gridGroupPositionFn(E),K=I.GroupDataMap.get(W).find(q=>q.seriesLabel===j)??O[0];b.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:I.highlightTarget,datum:K,gridIndex:K.gridIndex,series:I.SeriesDataMap.get(K.seriesLabel),seriesIndex:K.seriesIndex,seriesLabel:K.seriesLabel,groups:I.GroupDataMap.get(K.groupLabel),groupIndex:K.groupIndex,groupLabel:K.groupLabel,event:E,data:I.computedData})}).on("click",(E,O)=>{const j=O[0]?O[0].seriesLabel:"",{groupIndex:ie,groupLabel:W}=I.gridGroupPositionFn(E),K=I.GroupDataMap.get(W).find(q=>q.seriesLabel===j)??O[0];b.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:I.highlightTarget,datum:K,gridIndex:K.gridIndex,series:I.SeriesDataMap.get(K.seriesLabel),seriesIndex:K.seriesIndex,seriesLabel:K.seriesLabel,groups:I.GroupDataMap.get(K.groupLabel),groupIndex:K.groupIndex,groupLabel:K.groupLabel,event:E,data:I.computedData})})})}),f.pipe(L(v),Rr(I=>I.highlightTarget==="series"),G(I=>Y({graphicGSelection:M,gridHighlight:m,DataMap:T,fullChartParams:f}).pipe(L(v),G(async N=>N)))).subscribe(I=>{const N=I.gridHighlight[0]?I.gridHighlight[0].seriesLabel:null;wI({selection:I.graphicGSelection,seriesLabel:N,fullChartParams:I.fullChartParams})}),()=>{v.next(void 0)}},p$="LineAreas",PI=st({name:p$,defaultParams:ed,layerIndex:c$,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 J,o=h$(p$,{selection:e,computedData$:n.computedData$,visibleComputedData$:n.visibleComputedData$,computedLayoutData$:n.computedLayoutData$,visibleComputedLayoutData$:n.visibleComputedLayoutData$,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()}}),d$=.3;function g$({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 DI(e,t,n){const r=e/2,i=e*t.length+n.barPadding*t.length;return Wh().domain(t).range([-i/2+r,i/2-r])}function MI(e,t){return e<=1?0:t/(e-1)*d$}function CI(e,t){return e<=1?t:t*(1-d$)}function LI({graphicGSelection:e,rectClassName:t,visibleComputedLayoutData:n,zeroYArr:r,groupLabels:i,barScale:o,params:a,chartParams:s,barWidth:l,transformedBarRadius:u,delayGroup:c,transitionItem:f,isSeriesSeprate:h}){const p=l/2;return e.each((m,g,y)=>{V(y[g]).selectAll(`rect.${t}`).data(n[g]??[],b=>b.id).join(b=>b.append("rect").classed(t,!0).attr("cursor","pointer").attr("height",v=>1),b=>b,b=>b.remove()).attr("transform",(b,v)=>`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=>h?0:o(b.seriesLabel)).attr("width",l).attr("rx",u[g][0]??1).attr("ry",u[g][1]??1).transition().duration(f).ease(ca(s.transitionEase)).delay((b,v)=>b.groupIndex*c).attr("height",b=>Math.abs(b.axisYFromZero)||1)}),e.selectAll(`rect.${t}`)}function kI({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)=>{V(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 RI({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)?V(o[i]).style("opacity",1):V(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const _p=(e,{selection:t,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullChartParams$:c,gridAxesTransform$:f,gridGraphicTransform$:h,gridGraphicReverseScale$:p,gridAxesSize$:d,gridHighlight$:m,gridContainerPosition$:g,isSeriesSeprate$:y,event$:b})=>{const v=new J,x=Pt(e,"clipPath-box"),_=Z(e,"rect"),{seriesSelection$:A,axesSelection$:S,defsSelection$:P,graphicGSelection$:M}=Tr({selection:t,pluginName:e,clipPathID:x,seriesLabels$:a,gridContainerPosition$:g,gridAxesTransform$:f,gridGraphicTransform$:h}),B=o.pipe(L(v),R(N=>N.map(E=>E[0]?E[0].axisY-E[0].axisYFromZero:0)),ee()),$=Y({computedData:n,visibleComputedData:i,params:u,gridAxesSize:d,isSeriesSeprate:y}).pipe(L(v),G(async N=>N),R(N=>N.params.barWidth?N.params.barWidth:N.isSeriesSeprate?g$({axisWidth:N.gridAxesSize.width,groupAmount:N.computedData[0]?N.computedData[0].length:0,barAmountOfGroup:1,barPadding:N.params.barPadding,barGroupPadding:N.params.barGroupPadding}):g$({axisWidth:N.gridAxesSize.width,groupAmount:N.computedData[0]?N.computedData[0].length:0,barAmountOfGroup:N.visibleComputedData.length,barPadding:N.params.barPadding,barGroupPadding:N.params.barGroupPadding})),ee()),k=Y({computedData:n,barWidth:$,params:u,gridGraphicReverseScale:p}).pipe(L(v),G(async N=>N),R(N=>{const E=N.barWidth/2,O=N.params.barRadius===!0?E:N.params.barRadius===!1?0:typeof N.params.barRadius=="number"?N.params.barRadius:0;return N.computedData.map((j,ie)=>{const W=N.gridGraphicReverseScale[ie]??N.gridGraphicReverseScale[0];let Q=O*W[0],X=O*W[1];if(Q>E){const K=E/Q;Q=Q*K,X=X*K}return[Q,X]})})),C=i.pipe(L(v),R(N=>{const E=new Set;return N.forEach(O=>{O.forEach(j=>{E.add(j.groupLabel)})}),Array.from(E)})),T=Y({seriesLabels:a,barWidth:$,params:u}).pipe(L(v),G(async N=>N),R(N=>DI(N.barWidth,N.seriesLabels,N.params))),w=c.pipe(L(v),R(N=>N.transitionDuration),ee()),D=new de(N=>{Y({groupLabels:C,transitionDuration:w}).pipe(G(async E=>E)).subscribe(E=>{const O=MI(E.groupLabels.length,E.transitionDuration);N.next(O)})}).pipe(L(v),ee()),F=new de(N=>{Y({groupLabels:C,transitionDuration:w}).pipe(G(async E=>E)).subscribe(E=>{const O=CI(E.groupLabels.length,E.transitionDuration);N.next(O)})}).pipe(L(v),ee());Y({defsSelection:P,gridAxesSize:d}).pipe(L(v),G(async N=>N)).subscribe(N=>{const E=[{id:x,width:N.gridAxesSize.width,height:N.gridAxesSize.height}];kI({defsSelection:N.defsSelection,clipPathData:E})});const z=c.pipe(L(v),R(N=>N.highlightTarget),ee()),I=Y({graphicGSelection:M,visibleComputedLayoutData:o,zeroYArr:B,groupLabels:C,barScale:T,params:u,chartParams:c,highlightTarget:z,barWidth:$,transformedBarRadius:k,delayGroup:D,transitionItem:F,isSeriesSeprate:y}).pipe(L(v),G(async N=>N),R(N=>LI({graphicGSelection:N.graphicGSelection,rectClassName:_,visibleComputedLayoutData:N.visibleComputedLayoutData,zeroYArr:N.zeroYArr,groupLabels:N.groupLabels,barScale:N.barScale,params:N.params,chartParams:N.chartParams,barWidth:N.barWidth,transformedBarRadius:N.transformedBarRadius,delayGroup:N.delayGroup,transitionItem:N.transitionItem,isSeriesSeprate:N.isSeriesSeprate})));return Y({barSelection:I,computedData:n,highlightTarget:z,SeriesDataMap:s,GroupDataMap:l}).pipe(L(v),G(async N=>N)).subscribe(N=>{N.barSelection.on("mouseover",(E,O)=>{E.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:N.highlightTarget,datum:O,gridIndex:O.gridIndex,series:N.SeriesDataMap.get(O.seriesLabel),seriesIndex:O.seriesIndex,seriesLabel:O.seriesLabel,groups:N.GroupDataMap.get(O.groupLabel),groupIndex:O.groupIndex,groupLabel:O.groupLabel,event:E,data:N.computedData})}).on("mousemove",(E,O)=>{E.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:N.highlightTarget,datum:O,gridIndex:O.gridIndex,series:N.SeriesDataMap.get(O.seriesLabel),seriesIndex:O.seriesIndex,seriesLabel:O.seriesLabel,groups:N.GroupDataMap.get(O.groupLabel),groupIndex:O.groupIndex,groupLabel:O.groupLabel,event:E,data:N.computedData})}).on("mouseout",(E,O)=>{E.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:N.highlightTarget,datum:O,gridIndex:O.gridIndex,series:N.SeriesDataMap.get(O.seriesLabel),seriesIndex:O.seriesIndex,seriesLabel:O.seriesLabel,groups:N.GroupDataMap.get(O.groupLabel),groupIndex:O.groupIndex,groupLabel:O.groupLabel,event:E,data:N.computedData})}).on("click",(E,O)=>{E.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:N.highlightTarget,datum:O,gridIndex:O.gridIndex,series:N.SeriesDataMap.get(O.seriesLabel),seriesIndex:O.seriesIndex,seriesLabel:O.seriesLabel,groups:N.GroupDataMap.get(O.groupLabel),groupIndex:O.groupIndex,groupLabel:O.groupLabel,event:E,data:N.computedData})})}),Y({barSelection:I,highlight:m.pipe(R(N=>N.map(E=>E.id))),fullChartParams:c}).pipe(L(v),G(async N=>N)).subscribe(N=>{RI({selection:N.barSelection,ids:N.highlight,fullChartParams:N.fullChartParams})}),()=>{v.next(void 0)}},m$="Bars",EI=st({name:m$,defaultParams:ga,layerIndex:bt,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 J,o=_p(m$,{selection:e,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,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()}}),y$="BarsPN",II=st({name:y$,defaultParams:ga,layerIndex:bt,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 J,o=_p(y$,{selection:e,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,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$:_a(!0),event$:n.event$});return()=>{i.next(void 0),o()}}),b$=.3;function BI({axisWidth:e,groupAmount:t,barGroupPadding:n=0}){const i=(t>1?e/(t-1):e)-n;return i>1?i:1}function NI(e,t){return e<=1?0:t/(e-1)*b$}function FI(e,t){return e<=1?t:t*(1-b$)}function zI({graphicGSelection:e,rectClassName:t,barData:n,zeroY:r,groupLabels:i,params:o,chartParams:a,barWidth:s,transformedBarRadius:l,delayGroup:u,transitionItem:c,isSeriesSeprate:f}){const h=s/2;return e.each((d,m,g)=>{V(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)-h}, 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(ca(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 OI({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)=>{V(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 GI({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)?V(o[i]).style("opacity",1):V(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const x$=(e,{selection:t,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullDataFormatter$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridGraphicReverseScale$:d,gridAxesSize$:m,gridHighlight$:g,gridContainerPosition$:y,isSeriesSeprate$:b,event$:v})=>{const x=new J,_=Pt(e,"clipPath-box"),A=Z(e,"rect"),{seriesSelection$:S,axesSelection$:P,defsSelection$:M,graphicGSelection$:B}=Tr({selection:t,pluginName:e,clipPathID:_,seriesLabels$:a,gridContainerPosition$:y,gridAxesTransform$:h,gridGraphicTransform$:p}),$=o.pipe(L(x),R(W=>W[0]&&W[0][0]?W[0][0].axisY-W[0][0].axisYFromZero:0),ee()),k=Y({computedData:n,params:u,axisSize:m,isSeriesSeprate:b}).pipe(L(x),G(async W=>W),R(W=>W.params.barWidth?W.params.barWidth:BI({axisWidth:W.axisSize.width,groupAmount:W.computedData[0]?W.computedData[0].length:0,barGroupPadding:W.params.barGroupPadding})),ee()),C=Y({computedData:n,barWidth:k,params:u,gridGraphicReverseScale:d}).pipe(L(x),G(async W=>W),R(W=>{const Q=W.barWidth/2,X=W.params.barRadius===!0?Q:W.params.barRadius===!1?0:typeof W.params.barRadius=="number"?W.params.barRadius:0;return W.computedData.map((K,q)=>{const ne=W.gridGraphicReverseScale[q]??W.gridGraphicReverseScale[0],se=X*ne[0],U=X*ne[1];return[se,U]})})),T=i.pipe(L(x),R(W=>{const Q=new Set;return W.forEach(X=>{X.forEach(K=>{Q.add(K.groupLabel)})}),Array.from(Q)}),pe(1)),w=f.pipe(L(x),R(W=>W.transitionDuration),ee()),D=new de(W=>{Y({groupLabels:T,transitionDuration:w}).pipe(G(async Q=>Q)).subscribe(Q=>{const X=NI(Q.groupLabels.length,Q.transitionDuration);W.next(X)})}).pipe(L(x),ee()),F=new de(W=>{Y({groupLabels:T,transitionDuration:w}).pipe(G(async Q=>Q)).subscribe(Q=>{const X=FI(Q.groupLabels.length,Q.transitionDuration);W.next(X)})}).pipe(L(x),ee()),z=Y({computedData:n,dataFormatter:c}).pipe(L(x),G(async W=>W),R(W=>{const Q=W.computedData[0]?W.computedData[0].length-1:0,X=W.dataFormatter.groupAxis.scaleDomain[0],K=W.dataFormatter.groupAxis.scaleDomain[1]==="max"?Q:W.dataFormatter.groupAxis.scaleDomain[1];return[X,K]})),I=Y({visibleComputedLayoutData:o,groupScaleDomain:z}).pipe(L(x),G(async W=>W),R(W=>{const Q=W.groupScaleDomain[0],X=W.groupScaleDomain[1],q=W.visibleComputedLayoutData.map(me=>me.filter((fe,Ee)=>fe.groupIndex>=Q&&fe.groupIndex<=X)).flat();if(q.length<=1)return 1;const ne=q.reduce((me,fe)=>fe.value>me.value?fe:me,q[0]),se=ne.groupIndex,U=q.filter(me=>me.groupIndex===se).reduce((me,fe)=>me+fe.value,0);return ne.value/U})),N=Y({computedLayoutData:r,yRatio:I,zeroY:$}).pipe(L(x),R(W=>{let Q=W.computedLayoutData[0]?W.computedLayoutData[0].map(()=>W.zeroY):[];return W.computedLayoutData.map((X,K)=>X.map((q,ne)=>{const se=Q[ne];let U=0;return q.visible&&(U=q.axisYFromZero*W.yRatio,Q[ne]=Q[ne]+U),{...q,_barStartY:se,_barHeight:U}}))})),E=Y({computedLayoutData:r,zeroY:$}).pipe(L(x),R(W=>W.computedLayoutData.map((Q,X)=>Q.map((K,q)=>({...K,_barStartY:W.zeroY,_barHeight:K.axisYFromZero}))))),O=b.pipe(G(W=>Wi(()=>W,E,N)));Y({defsSelection:M,gridAxesSize:m}).pipe(L(x),G(async W=>W)).subscribe(W=>{const Q=[{id:_,width:W.gridAxesSize.width,height:W.gridAxesSize.height}];OI({defsSelection:W.defsSelection,clipPathData:Q})});const j=f.pipe(L(x),R(W=>W.highlightTarget),ee()),ie=Y({graphicGSelection:B,graphicData:O,zeroY:$,groupLabels:T,params:u,chartParams:f,highlightTarget:j,barWidth:k,transformedBarRadius:C,delayGroup:D,transitionItem:F,isSeriesSeprate:b}).pipe(L(x),G(async W=>W),R(W=>zI({graphicGSelection:W.graphicGSelection,rectClassName:A,barData:W.graphicData,zeroY:W.zeroY,groupLabels:W.groupLabels,params:W.params,chartParams:W.chartParams,barWidth:W.barWidth,transformedBarRadius:W.transformedBarRadius,delayGroup:W.delayGroup,transitionItem:W.transitionItem,isSeriesSeprate:W.isSeriesSeprate})));return Y({barSelection:ie,computedData:n,highlightTarget:j,SeriesDataMap:s,GroupDataMap:l}).subscribe(W=>{W.barSelection.on("mouseover",(Q,X)=>{Q.stopPropagation(),v.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:W.highlightTarget,datum:X,gridIndex:X.gridIndex,series:W.SeriesDataMap.get(X.seriesLabel),seriesIndex:X.seriesIndex,seriesLabel:X.seriesLabel,groups:W.GroupDataMap.get(X.groupLabel),groupIndex:X.groupIndex,groupLabel:X.groupLabel,event:Q,data:W.computedData})}).on("mousemove",(Q,X)=>{Q.stopPropagation(),v.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:W.highlightTarget,datum:X,gridIndex:X.gridIndex,series:W.SeriesDataMap.get(X.seriesLabel),seriesIndex:X.seriesIndex,seriesLabel:X.seriesLabel,groups:W.GroupDataMap.get(X.groupLabel),groupIndex:X.groupIndex,groupLabel:X.groupLabel,event:Q,data:W.computedData})}).on("mouseout",(Q,X)=>{Q.stopPropagation(),v.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:W.highlightTarget,datum:X,gridIndex:X.gridIndex,series:W.SeriesDataMap.get(X.seriesLabel),seriesIndex:X.seriesIndex,seriesLabel:X.seriesLabel,groups:W.GroupDataMap.get(X.groupLabel),groupIndex:X.groupIndex,groupLabel:X.groupLabel,event:Q,data:W.computedData})}).on("click",(Q,X)=>{Q.stopPropagation(),v.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:W.highlightTarget,datum:X,gridIndex:X.gridIndex,series:W.SeriesDataMap.get(X.seriesLabel),seriesIndex:X.seriesIndex,seriesLabel:X.seriesLabel,groups:W.GroupDataMap.get(X.groupLabel),groupIndex:X.groupIndex,groupLabel:X.groupLabel,event:Q,data:W.computedData})})}),Y({barSelection:ie,highlight:g.pipe(R(W=>W.map(Q=>Q.id))),fullChartParams:f}).pipe(L(x),G(async W=>W)).subscribe(W=>{GI({selection:W.barSelection,ids:W.highlight,fullChartParams:W.fullChartParams})}),()=>{x.next(void 0)}},v$="StackedBar",YI=st({name:v$,defaultParams:nd,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 J,o=x$(v$,{selection:e,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,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()}}),$$=.3;function _$({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 WI(e,t,n){const r=e/2,i=e*t.length+n.barPadding*t.length;return Wh().domain(t).range([-i/2+r,i/2-r])}function XI(e,t){return e<=1?0:t/(e-1)*$$}function VI(e,t){return e<=1?t:t*(1-$$)}function UI({graphicGSelection:e,pathGClassName:t,pathClassName:n,visibleComputedLayoutData:r,linearGradientIds:i,zeroYArr:o,groupLabels:a,barScale:s,params:l,chartParams:u,barWidth:c,delayGroup:f,transitionItem:h,isSeriesSeprate:p}){const d=c/2;return e.each((g,y,b)=>{V(b[y]).selectAll(`g.${t}`).data(r[y]??[]).join(x=>{const _=x.append("g").classed(t,!0).attr("cursor","pointer");return _.append("path").classed(n,!0).style("vector-effect","non-scaling-stroke").attr("d",A=>{const S=-d,P=o[y],M=o[y];return`M${S},${P} L${S+c/2},${M} ${S+c},${P}`}),_},x=>x,x=>x.remove()).attr("transform",x=>`translate(${p?0:s(x.seriesLabel)}, 0)`).select(`path.${n}`).attr("height",x=>Math.abs(x.axisYFromZero)||1).attr("y",x=>x.axisY<o[y]?x.axisY:o[y]).attr("x",x=>p?0:s(x.seriesLabel)).style("fill",x=>`url(#${i[x.seriesIndex]})`).attr("stroke",x=>x.color).attr("transform",x=>`translate(${x?x.axisX:0}, 0)`).transition().duration(h).ease(ca(u.transitionEase)).delay((x,_)=>x.groupIndex*f).attr("d",x=>{const _=-d,A=o[y],S=x.axisY;return`M${_},${A} L${_+c/2},${S} ${_+c},${A}`})}),e.selectAll(`path.${n}`)}function HI({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`
50
50
  <stop offset="0%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[0]}"/>
51
51
  <stop offset="100%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[1]}"/>
52
- `})}function xI({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{H(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 vI({selection:t,ids:e,fullChartParams:n}){t.interrupt("highlight");const r=()=>{t.transition("highlight").duration(200).style("opacity",1)};if(!e.length){r();return}t.each((i,o,a)=>{e.includes(i.id)?H(a[o]).style("opacity",1):H(a[o]).style("opacity",n.styles.unhighlightedOpacity)})}const p2=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,fullDataFormatter$:a,seriesLabels$:s,SeriesDataMap$:l,GroupDataMap$:u,fullParams$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:m,gridContainerPosition$:g,isSeriesSeprate$:y,event$:b})=>{const v=new tt,x=Ke(t,"clipPath-box"),_=J(t,"pathG"),S=J(t,"path"),{seriesSelection$:A,axesSelection$:T,defsSelection$:C,graphicGSelection$:I}=vr({selection:e,pluginName:t,clipPathID:x,seriesLabels$:s,gridContainerPosition$:g,gridAxesTransform$:h,gridGraphicTransform$:p});p.pipe(k(v),B(R=>-R.translate[1]/R.scale[1]));const $=o.pipe(B(R=>R.map(F=>F[0]?F[0].axisY-F[0].axisYFromZero:0)),Q()),L=Y({computedData:n,visibleComputedData:i,params:c,gridAxesSize:d,isSeriesSeprate:y}).pipe(k(v),G(async R=>R),B(R=>R.params.barWidth?R.params.barWidth:R.isSeriesSeprate?h2({axisWidth:R.gridAxesSize.width,groupAmount:R.computedData[0]?R.computedData[0].length:0,barAmountOfGroup:1,barPadding:R.params.barPadding,barGroupPadding:R.params.barGroupPadding}):h2({axisWidth:R.gridAxesSize.width,groupAmount:R.computedData[0]?R.computedData[0].length:0,barAmountOfGroup:R.visibleComputedData.length,barPadding:R.params.barPadding,barGroupPadding:R.params.barGroupPadding}))),P=i.pipe(k(v),B(R=>{const F=new Set;return R.forEach(U=>{U.forEach(it=>{F.add(it.groupLabel)})}),Array.from(F)})),w=new pt(R=>{Y({seriesLabels:s,barWidth:L,params:c}).pipe(k(v),G(async F=>F)).subscribe(F=>{const U=dI(F.barWidth,F.seriesLabels,F.params);R.next(U)})}),M=f.pipe(k(v),B(R=>R.transitionDuration),Q()),D=new pt(R=>{Y({groupLabels:P,transitionDuration:M}).pipe(G(async F=>F)).subscribe(F=>{const U=gI(F.groupLabels.length,F.transitionDuration);R.next(U)})}).pipe(k(v),Q()),X=new pt(R=>{Y({groupLabels:P,transitionDuration:M}).pipe(G(async F=>F)).subscribe(F=>{const U=mI(F.groupLabels.length,F.transitionDuration);R.next(U)})}).pipe(k(v),Q());Y({defsSelection:C,gridAxesSize:d}).pipe(k(v),G(async R=>R)).subscribe(R=>{const F=[{id:x,width:R.gridAxesSize.width,height:R.gridAxesSize.height}];xI({defsSelection:R.defsSelection,clipPathData:F})});const O=f.pipe(k(v),B(R=>R.highlightTarget),Q()),E=s.pipe(k(v),B(R=>R.map((F,U)=>Ke(t,`lineargradient-${F}`)))),N=Y({graphicGSelection:I,defsSelection:C,computedData:n,visibleComputedLayoutData:o,linearGradientIds:E,zeroYArr:$,groupLabels:P,barScale:w,params:c,chartParams:f,barWidth:L,delayGroup:D,transitionItem:X,isSeriesSeprate:y}).pipe(k(v),G(async R=>R),B(R=>(bI({defsSelection:R.defsSelection,computedData:R.computedData,linearGradientIds:R.linearGradientIds,params:R.params}),yI({graphicGSelection:R.graphicGSelection,pathGClassName:_,pathClassName:S,visibleComputedLayoutData:R.visibleComputedLayoutData,linearGradientIds:R.linearGradientIds,zeroYArr:R.zeroYArr,groupLabels:R.groupLabels,barScale:R.barScale,params:R.params,chartParams:R.chartParams,barWidth:R.barWidth,delayGroup:R.delayGroup,transitionItem:R.transitionItem,isSeriesSeprate:R.isSeriesSeprate}))));return Y({barSelection:N,computedData:n,highlightTarget:O,SeriesDataMap:l,GroupDataMap:u}).subscribe(R=>{R.barSelection.on("mouseover",(F,U)=>{F.stopPropagation(),b.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:R.highlightTarget,datum:U,gridIndex:U.gridIndex,series:R.SeriesDataMap.get(U.seriesLabel),seriesIndex:U.seriesIndex,seriesLabel:U.seriesLabel,groups:R.GroupDataMap.get(U.groupLabel),groupIndex:U.groupIndex,groupLabel:U.groupLabel,event:F,data:R.computedData})}).on("mousemove",(F,U)=>{F.stopPropagation(),b.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:R.highlightTarget,datum:U,gridIndex:U.gridIndex,series:R.SeriesDataMap.get(U.seriesLabel),seriesIndex:U.seriesIndex,seriesLabel:U.seriesLabel,groups:R.GroupDataMap.get(U.groupLabel),groupIndex:U.groupIndex,groupLabel:U.groupLabel,event:F,data:R.computedData})}).on("mouseout",(F,U)=>{F.stopPropagation(),b.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:R.highlightTarget,datum:U,gridIndex:U.gridIndex,series:R.SeriesDataMap.get(U.seriesLabel),seriesIndex:U.seriesIndex,seriesLabel:U.seriesLabel,groups:R.GroupDataMap.get(U.groupLabel),groupIndex:U.groupIndex,groupLabel:U.groupLabel,event:F,data:R.computedData})}).on("click",(F,U)=>{F.stopPropagation(),b.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:R.highlightTarget,datum:U,gridIndex:U.gridIndex,series:R.SeriesDataMap.get(U.seriesLabel),seriesIndex:U.seriesIndex,seriesLabel:U.seriesLabel,groups:R.GroupDataMap.get(U.groupLabel),groupIndex:U.groupIndex,groupLabel:U.groupLabel,event:F,data:R.computedData})})}),Y({barSelection:N,highlight:m.pipe(B(R=>R.map(F=>F.id))),fullChartParams:f}).pipe(k(v),G(async R=>R)).subscribe(R=>{vI({selection:R.barSelection,ids:R.highlight,fullChartParams:R.fullChartParams})}),()=>{v.next(void 0)}},d2="BarsTriangle",$I=ie({name:d2,defaultParams:Yp,layerIndex:5,validator:(t,{validateColumns:e})=>e(t,{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:t,name:e,subject:n,observer:r})=>{const i=new tt,o=p2(d2,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,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 _I({graphicGSelection:t,circleGClassName:e,circleClassName:n,visibleComputedLayoutData:r,fullParams:i,fullChartParams:o,graphicReverseScale:a}){const s=c=>{const f=c.size();return o.transitionDuration/f};let l=0;return t.each((c,f,h)=>{H(h[f]).selectAll("g").data(r[f],p=>p.id).join(p=>(l=s(p),p.append("g").classed(e,!0)),p=>p,p=>p.remove()).attr("transform",p=>`translate(${p.axisX}, ${p.axisY})`).each((p,d,m)=>{H(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)=>we({datum:g,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(g,y)=>we({datum:g,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${a[f][0]??1}, ${a[f][1]??1})`)})}),t.selectAll(`circle.${n}`)}function wI({selection:t,ids:e,onlyShowHighlighted:n,fullChartParams:r}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",n===!0?0:1);return}t.each((i,o,a)=>{e.includes(i.id)?H(a[o]).style("opacity",1).transition("highlight").duration(200):H(a[o]).style("opacity",n===!0?0:r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function SI({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{H(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 g2=(t,{selection:e,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullChartParams$:c,gridAxesTransform$:f,gridGraphicTransform$:h,gridGraphicReverseScale$:p,gridAxesSize$:d,gridHighlight$:m,gridContainerPosition$:g,event$:y})=>{const b=new tt,v=Ke(t,"clipPath-box"),x=J(t,"circleG"),_=J(t,"circle"),{seriesSelection$:S,axesSelection$:A,defsSelection$:T,graphicGSelection$:C}=vr({selection:e,pluginName:t,clipPathID:v,seriesLabels$:a,gridContainerPosition$:g,gridAxesTransform$:f,gridGraphicTransform$:h}),I=Y({computedData:n,gridGraphicReverseScale:p}).pipe(k(b),G(async w=>w),B(w=>w.computedData.map((M,D)=>w.gridGraphicReverseScale[D])));Y({defsSelection:T,gridAxesSize:d}).pipe(k(b),G(async w=>w)).subscribe(w=>{const M=[{id:v,width:w.gridAxesSize.width,height:w.gridAxesSize.height}];SI({defsSelection:w.defsSelection,clipPathData:M})});const $=c.pipe(k(b),B(w=>w.highlightTarget),Q()),L=Y({graphicGSelection:C,visibleComputedLayoutData:o,graphicReverseScale:I,fullChartParams:c,fullParams:u}).pipe(k(b),G(async w=>w),B(w=>_I({graphicGSelection:w.graphicGSelection,circleGClassName:x,circleClassName:_,visibleComputedLayoutData:w.visibleComputedLayoutData,fullParams:w.fullParams,fullChartParams:w.fullChartParams,graphicReverseScale:w.graphicReverseScale})));Y({graphicSelection:L,computedData:n,SeriesDataMap:s,GroupDataMap:l,highlightTarget:$}).pipe(k(b),G(async w=>w)).subscribe(w=>{w.graphicSelection.on("mouseover",(M,D)=>{y.next({type:"grid",eventName:"mouseover",pluginName:t,highlightTarget:w.highlightTarget,datum:D,gridIndex:D.gridIndex,series:w.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:w.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:M,data:w.computedData})}).on("mousemove",(M,D)=>{y.next({type:"grid",eventName:"mousemove",pluginName:t,highlightTarget:w.highlightTarget,data:w.computedData,datum:D,gridIndex:D.gridIndex,series:w.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:w.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:M})}).on("mouseout",(M,D)=>{y.next({type:"grid",eventName:"mouseout",pluginName:t,highlightTarget:w.highlightTarget,datum:D,gridIndex:D.gridIndex,series:w.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:w.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:M,data:w.computedData})}).on("click",(M,D)=>{y.next({type:"grid",eventName:"click",pluginName:t,highlightTarget:w.highlightTarget,datum:D,gridIndex:D.gridIndex,series:w.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:w.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:M,data:w.computedData})})});const P=u.pipe(k(b),B(w=>w.onlyShowHighlighted),Q());return Y({graphicSelection:L,highlight:m.pipe(B(w=>w.map(M=>M.id))),onlyShowHighlighted:P,fullChartParams:c}).pipe(k(b),G(async w=>w)).subscribe(w=>{wI({selection:w.graphicSelection,ids:w.highlight,onlyShowHighlighted:w.onlyShowHighlighted,fullChartParams:w.fullChartParams})}),()=>{b.next(void 0)}},m2="Dots",AI=ie({name:m2,defaultParams:zp,layerIndex:Jl,validator:(t,{validateColumns:e})=>e(t,{radius:{toBeTypes:["number"]},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},onlyShowHighlighted:{toBeTypes:["boolean"]}})})(({selection:t,name:e,subject:n,observer:r})=>{const i=new tt,o=g2(m2,{selection:t,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,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()}}),TI=" - ",PI={listRectWidth:14,listRectHeight:14,listRectRadius:0};function y2(t,e){const n=t<e.colors[e.colorScheme].series.length?t:t%e.colors[e.colorScheme].series.length;return e.colors[e.colorScheme].series[n]}const ia=(t,{rootSelection:e,legendLabels$:n,fullParams$:r,layout$:i,fullChartParams$:o,textSizePx$:a})=>{const s=J(t,"root-position"),l=J(t,"legend-card"),u=J(t,"legend-list"),c=J(t,"legend-item"),f=new tt,h=Y({legendLabels:n,fullChartParams:o}).pipe(k(f),G(async $=>$),B($=>{const L=new Map;let P=0;return $.legendLabels.forEach((w,M)=>{if(!L.has(w)){const D=y2(P,$.fullChartParams);L.set(w,D),P++}}),L})),p=n.pipe(k(f),B($=>{const L=new Set;let P=[];return $.forEach(w=>{L.has(w)?P.push(!1):P.push(!0),L.add(w)}),P})),d=r.pipe(k(f),B($=>$.placement==="top"||$.placement==="top-start"||$.placement==="top-end"?"top":$.placement==="bottom"||$.placement==="bottom-start"||$.placement==="bottom-end"?"bottom":$.placement==="left"||$.placement==="left-start"||$.placement==="left-end"?"left":"right"),Q(($,L)=>$===L),yt(1)),m=r.pipe(k(f),B($=>$.placement==="top-start"||$.placement==="bottom-start"||$.placement==="left-start"||$.placement==="right-start"?"start":$.placement==="top-end"||$.placement==="bottom-end"||$.placement==="left-end"||$.placement==="right-end"?"end":($.placement==="top"||$.placement==="bottom"||$.placement==="left"||$.placement==="right","center")),Q(($,L)=>$===L),yt(1)),g=d.pipe(k(f),B($=>$==="bottom"||$==="top"?"row":"column"),Q(($,L)=>$===L),yt(1)),y=Y({fullParams:r,position:d,layout:i}).pipe(k(f),G(async $=>$),B($=>{const L=$.fullParams.padding*2+$.fullParams.gap*2;return $.position==="bottom"||$.position==="top"?$.layout.rootWidth-L:$.layout.rootHeight-L})),v=Y({layout:i,position:d,justify:m}).pipe(k(f),G(async $=>$),B($=>{let L=0,P=0;return $.position==="bottom"?(P=$.layout.rootHeight,$.justify==="start"?L=0:$.justify==="center"?L=$.layout.rootWidth/2:$.justify==="end"&&(L=$.layout.rootWidth)):$.position==="right"?(L=$.layout.rootWidth,$.justify==="start"?P=0:$.justify==="center"?P=$.layout.rootHeight/2:$.justify==="end"&&(P=$.layout.rootHeight)):$.position==="top"?(P=0,$.justify==="start"?L=0:$.justify==="center"?L=$.layout.rootWidth/2:$.justify==="end"&&(L=$.layout.rootWidth)):$.position==="left"&&(L=0,$.justify==="start"?P=0:$.justify==="center"?P=$.layout.rootHeight/2:$.justify==="end"&&(P=$.layout.rootHeight)),{x:L,y:P}})).pipe(k(f),B($=>e.selectAll(`g.${s}`).data([$]).join(L=>L.append("g").classed(s,!0).attr("transform",P=>`translate(${P.x}, ${P.y})`),L=>L.transition().attr("transform",P=>`translate(${P.x}, ${P.y})`),L=>L.remove()))),x=r.pipe(k(f),B($=>$.labelList[0]?$.labelList[0]:PI)),_=Y({visibleList:p,fullParams:r,fullChartParams:o,legendLabels:n,lineDirection:g,lineMaxSize:y,defaultListStyle:x,SeriesLabelColorMap:h,textSizePx:a}).pipe(k(f),G(async $=>$),B($=>$.legendLabels.reduce((L,P,w)=>{if(!$.visibleList[w])return L;const M=P!==""?P:TI,D=ta(M,$.textSizePx),X=$.textSizePx*1.5+D,O=$.SeriesLabelColorMap.get(P),E=L[0]&&L[0][0]?L[L.length-1][L[L.length-1].length-1]:null,{translateX:N,translateY:R,lineIndex:F,itemIndex:U}=((z,K,V)=>{let Z=0,j=0,nt=0,st=0;if(z.lineDirection==="column"){let W=V?V.translateY+z.textSizePx+z.fullParams.gap:0;if(W+z.textSizePx>z.lineMaxSize){nt=V.lineIndex+1,st=0,j=0;const gt=K[K.length-1].reduce((ft,Rt)=>Rt.itemWidth>ft?Rt.itemWidth:ft,0);Z=V.translateX+gt+z.fullParams.gap}else nt=V?V.lineIndex:0,st=V?V.itemIndex+1:0,j=W,Z=V?V.translateX:0}else{let W=V?V.translateX+V.itemWidth+z.fullParams.gap:0;W+X>z.lineMaxSize?(nt=V.lineIndex+1,st=0,Z=0):(nt=V?V.lineIndex:0,st=V?V.itemIndex+1:0,Z=W),j=(z.textSizePx+z.fullParams.gap)*nt}return{translateX:Z,translateY:j,lineIndex:nt,itemIndex:st}})($,L,E);L[F]||(L[F]=[]);const it=$.fullParams.labelList[U]?$.fullParams.labelList[U]:$.defaultListStyle;return L[F].push({id:M,seriesLabel:M,seriesIndex:w,lineIndex:F,itemIndex:U,text:M,itemWidth:X,translateX:N,translateY:R,color:O,listRectWidth:it.listRectWidth,listRectHeight:it.listRectHeight,listRectRadius:it.listRectRadius}),L},[])),yt(1)),S=Y({fullParams:r,fullChartParams:o,lineDirection:g,lengendItems:_,textSizePx:a}).pipe(k(f),G(async $=>$),B($=>{const{width:L,height:P}=((w,M)=>{let D=0,X=0;if(!M.length||!M[0].length)return{width:D,height:X};const O=M[0][M[0].length-1];return w.lineDirection==="column"?(D=M.reduce((E,N)=>{const R=N.reduce((F,U)=>U.itemWidth>F?U.itemWidth:F,0);return E+R},0),D+=w.fullParams.gap*(M.length-1),X=O.translateY+w.textSizePx):(D=O.translateX+O.itemWidth,X=w.textSizePx*M.length+w.fullParams.gap*(M.length-1)),{width:D,height:X}})($,$.lengendItems);return{direction:$.lineDirection,width:L,height:P,translateX:$.fullParams.gap,translateY:$.fullParams.gap}}),yt(1)),A=Y({fullParams:r,position:d,justify:m,lengendList:S}).pipe(k(f),G(async $=>$),B($=>{const L=$.lengendList.width+$.fullParams.gap*2,P=$.lengendList.height+$.fullParams.gap*2;let w=0,M=0;return $.position==="left"?$.justify==="start"?(w=$.fullParams.padding,M=$.fullParams.padding):$.justify==="center"?(w=$.fullParams.padding,M=-P/2):$.justify==="end"&&(w=$.fullParams.padding,M=-P-$.fullParams.padding):$.position==="right"?$.justify==="start"?(w=-L-$.fullParams.padding,M=$.fullParams.padding):$.justify==="center"?(w=-L-$.fullParams.padding,M=-P/2):$.justify==="end"&&(w=-L-$.fullParams.padding,M=-P-$.fullParams.padding):$.position==="top"?$.justify==="start"?(w=$.fullParams.padding,M=$.fullParams.padding):$.justify==="center"?(w=-L/2,M=$.fullParams.padding):$.justify==="end"&&(w=-L-$.fullParams.padding,M=$.fullParams.padding):$.justify==="start"?(w=$.fullParams.padding,M=-P-$.fullParams.padding):$.justify==="center"?(w=-L/2,M=-P-$.fullParams.padding):$.justify==="end"&&(w=-L-$.fullParams.padding,M=-P-$.fullParams.padding),{width:L,height:P,translateX:w,translateY:M}})),T=Y({rootPositionSelection:v,fullParams:r,fullChartParams:o,legendCard:A}).pipe(k(f),G(async $=>$),B($=>$.rootPositionSelection.selectAll("g").data([$.legendCard]).join(L=>L.append("g").classed(l,!0).attr("transform",P=>`translate(${P.translateX}, ${P.translateY})`),L=>L.transition().attr("transform",P=>`translate(${P.translateX}, ${P.translateY})`),L=>L.remove()).each((L,P,w)=>{H(w[P]).selectAll("rect").data([L]).join("rect").attr("width",M=>M.width).attr("height",M=>M.height).attr("fill",bt($.fullParams.backgroundFill,$.fullChartParams)).attr("stroke",bt($.fullParams.backgroundStroke,$.fullChartParams))}))),C=Y({lengendCardSelection:T,fullParams:r,lengendList:S}).pipe(k(f),G(async $=>$),B($=>$.lengendCardSelection.selectAll("g").data([$.lengendList]).join(L=>L.append("g").classed(u,!0).attr("transform",P=>`translate(${P.translateX}, ${P.translateY})`),L=>L.transition().attr("transform",P=>`translate(${P.translateX}, ${P.translateY})`),L=>L.remove())));return Y({lengendListSelection:C,fullParams:r,fullChartParams:o,lengendItems:_,textSizePx:a}).pipe(k(f),G(async $=>$),B($=>{const L=$.lengendItems[0]?$.lengendItems.flat():[];return $.lengendListSelection.selectAll(`g.${c}`).data(L).join(P=>P.append("g").classed(c,!0).attr("cursor","default"),P=>P,P=>P.remove()).attr("transform",(P,w)=>`translate(${P.translateX}, ${P.translateY})`).each((P,w,M)=>{const D=$.textSizePx/2,X=-P.listRectWidth/2,O=-P.listRectHeight/2;H(M[w]).selectAll("rect").data([P]).join("rect").attr("x",D).attr("y",D).attr("width",E=>E.listRectWidth).attr("height",E=>E.listRectHeight).attr("transform",E=>`translate(${X}, ${O})`).attr("fill",E=>E.color).attr("rx",E=>E.listRectRadius),H(M[w]).selectAll("text").data([P]).join(E=>E.append("text").attr("dominant-baseline","hanging"),E=>E,E=>E.remove()).attr("x",$.textSizePx*1.5).attr("font-size",$.fullChartParams.styles.textSize).attr("fill",E=>$.fullParams.textColorType==="series"?y2(E.seriesIndex,$.fullChartParams):bt($.fullParams.textColorType,$.fullChartParams)).text(E=>E.text)})})).subscribe(),()=>{e.select(`g.${s}`).remove(),f.next(void 0)}},b2="GridLegend",DI=ie({name:b2,defaultParams:Wp,layerIndex:na,validator:(t,{validateColumns:e})=>e(t,{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:t,rootSelection:e,observer:n,subject:r})=>{const i=new tt,o=n.SeriesDataMap$.pipe(k(i),B(l=>Array.from(l.keys()))),a=n.fullParams$.pipe(k(i),B(l=>{const u=[{listRectWidth:l.listRectWidth,listRectHeight:l.listRectHeight,listRectRadius:l.listRectRadius}];return{...l,labelList:u}})),s=ia(b2,{rootSelection:e,legendLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}});function MI(t,{text:e,radius:n,lineHeight:r,isBreakAll:i=!1,limit:o=0}){if(t==null||e==null){console.error("selection or text is not defined");return}n==null&&(n=t.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 v=0,x=p.length;v<x;++v){const _=(m.text?m.text+b:"")+p[v],S=l(_);(g+S)/2<d?(m.width=g=S,m.text=_):(g=l(p[v]),m={width:g,text:p[v]},y.push(m))}return y}function f(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 h(p,d){o>0&&(d=s(d,o));const m=a(d),g=u(d),y=c(m,g),b=f(y);let v=p.select("text");v.size()||(v=p.append("text")),v.attr("transform",`translate(0,0) scale(${n/b})`);const x=v.selectAll("tspan").data(y),_=x.enter().append("tspan").attr("x",0).merge(x).attr("y",(S,A)=>(A-y.length/2+.8)*r).text(S=>S.text);return x.exit().remove(),x.merge(_)}return h(t,e)}function up(t,{textArr:e,textSizePx:n,groupAxisPosition:r}){t.text(null);const i=Number(t.attr("x"));let o=Number(t.attr("y"));r==="top"&&(o-=(e.length-1)*n),t.selectAll("tspan").data(e).join("tspan").attr("x",i).attr("y",(a,s)=>o+s*n).text(a=>a)}function x2(t,{textArr:e,textSizePx:n,quadrant:r}){t.selectAll("tspan").data(e).join("tspan").attr("x",0).attr("y",(i,o)=>r==1||r==2?-(e.length-1-o)*n:o*n).text(i=>i)}const CI=6;function LI(t,e){return t.map((n,r)=>{const i=xr(n,e),o=typeof i=="string"?i.split(`
53
- `):[i];return{text:i,textArr:o}})}function kI({selection:t,groupingLabelClassName:e,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,f=0;o.grid.groupAxis.position==="bottom"?(f=u,o.grid.valueAxis.position==="left"?c=l:o.grid.valueAxis.position==="right"&&(c=-l)):o.grid.groupAxis.position==="top"?(f=-u,o.grid.valueAxis.position==="left"?c=l:o.grid.valueAxis.position==="right"&&(c=-l)):o.grid.groupAxis.position==="left"?(c=-l,o.grid.valueAxis.position==="bottom"?f=-u:o.grid.valueAxis.position==="top"&&(f=u)):o.grid.groupAxis.position==="right"&&(c=l,o.grid.valueAxis.position==="bottom"?f=-u:o.grid.valueAxis.position==="top"&&(f=u)),t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0).each((h,p,d)=>{H(d[p]).selectAll("text").data([h]).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",bt(n.labelColorType,a)).style("transform",s).attr("x",c).attr("y",f).text(m=>o.grid.groupAxis.label)}).attr("transform",h=>`translate(${i.width}, 0)`)}function RI({selection:t,xAxisClassName:e,fullParams:n,tickTextAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,groupScale:s,groupScaleDomain:l,groupLabelData:u,textReverseTransformWithRotate:c,textSizePx:f}){const h=t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0),p=Math.floor(l[1])-Math.ceil(l[0])+1;let d=0,m=0;o.grid.groupAxis.position==="left"?(d=0,m=-n.tickPadding):o.grid.groupAxis.position==="right"?(d=0,m=n.tickPadding):o.grid.groupAxis.position==="bottom"?(d=n.tickPadding,m=0):o.grid.groupAxis.position==="top"&&(d=-n.tickPadding,m=-0);const g=mc(s).scale(s).ticks(n.ticks==="all"||n.ticks>p?p:n.ticks).tickSize(n.tickFullLine==!0?i.height:-CI).tickSizeOuter(0).tickFormat(v=>{var x;return((x=u[v])==null?void 0:x.text)??""}).tickPadding(d),y=h.transition().duration(100).call(g).on("end",(v,x)=>{h.selectAll(".tick text").each((_,S,A)=>{var C;const T=((C=u[_])==null?void 0:C.textArr)??[];up(H(A[S]),{textArr:T,textSizePx:f,groupAxisPosition:o.grid.groupAxis.position})})});return y.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?bt(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),y.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?bt(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges"),h.selectAll("text").attr("font-size",a.styles.textSize).attr("fill",bt(n.tickTextColorType,a)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("x",m).style("transform",c).attr("dy",0),h}const v2=(t,{selection:e,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,gridAxesTransform$:a,gridAxesReverseTransform$:s,gridAxesSize$:l,gridContainerPosition$:u,isSeriesSeprate$:c,textSizePx$:f})=>{const h=new tt,p=J(t,"container"),d=J(t,"xAxisG"),m=J(t,"xAxis"),g=J(t,"groupingLabel"),y=Y({computedData:n.pipe(Q(($,L)=>$.length===L.length)),isSeriesSeprate:c}).pipe(k(h),G(async $=>$),B($=>$.isSeriesSeprate?$.computedData:[$.computedData[0]]),B(($,L)=>e.selectAll(`g.${p}`).data($,P=>P[0]?P[0].seriesIndex:L).join("g").classed(p,!0))),b=y.pipe(k(h),B(($,L)=>$.selectAll(`g.${d}`).data([d]).join("g").classed(d,!0)));Y({containerSelection:y,gridContainerPosition:u}).pipe(k(h),G(async $=>$)).subscribe($=>{$.containerSelection.attr("transform",(L,P)=>{const w=$.gridContainerPosition[P]??$.gridContainerPosition[0],M=w.translate,D=w.scale;return`translate(${M[0]}, ${M[1]}) scale(${D[0]}, ${D[1]})`})}),Y({axisSelection:b,gridAxesTransform:a}).pipe(k(h),G(async $=>$)).subscribe($=>{$.axisSelection.style("transform",$.gridAxesTransform.value)});const v=Y({gridAxesReverseTransform:s,gridContainerPosition:u}).pipe(k(h),G(async $=>$),B($=>{const L=`rotateX(${$.gridAxesReverseTransform.rotateX}deg) rotateY(${$.gridAxesReverseTransform.rotateY}deg)`,P=`rotate(${$.gridAxesReverseTransform.rotate}deg)`,w=`scale(${1/$.gridContainerPosition[0].scale[0]}, ${1/$.gridContainerPosition[0].scale[1]})`;return`${L} ${P} ${w}`}),Q()),x=Y({textReverseTransform:v,fullParams:r}).pipe(k(h),G(async $=>$),B($=>`${$.textReverseTransform} rotate(${$.fullParams.tickTextRotate}deg)`)),_=Y({fullDataFormatter:i,gridAxesSize:l,computedData:n}).pipe(k(h),G(async $=>$),B($=>{const L=$.computedData[0]?$.computedData[0].length-1:0,P=$.fullDataFormatter.grid.groupAxis.scaleDomain[0]-$.fullDataFormatter.grid.groupAxis.scalePadding,w=$.fullDataFormatter.grid.groupAxis.scaleDomain[1]==="max"?L+$.fullDataFormatter.grid.groupAxis.scalePadding:$.fullDataFormatter.grid.groupAxis.scaleDomain[1]+$.fullDataFormatter.grid.groupAxis.scalePadding;return[P,w]}),yt(1)),S=Y({groupScaleDomain:_,gridAxesSize:l}).pipe(k(h),G(async $=>$),B($=>yi().domain($.groupScaleDomain).range([0,$.gridAxesSize.width]))),A=n.pipe(B($=>($[0]??[]).map(L=>L.groupLabel))),T=Y({fullDataFormatter:i,fullParams:r}).pipe(k(h),G(async $=>$),B($=>{let L="middle",P="hanging";return $.fullDataFormatter.grid.groupAxis.position==="bottom"?(L=$.fullParams.tickTextRotate?"end":"middle",P="hanging"):$.fullDataFormatter.grid.groupAxis.position==="top"?(L=$.fullParams.tickTextRotate?"start":"middle",P="auto"):$.fullDataFormatter.grid.groupAxis.position==="left"?(L="end",P="middle"):$.fullDataFormatter.grid.groupAxis.position==="right"&&(L="start",P="middle"),{textAnchor:L,dominantBaseline:P}})),C=i.pipe(k(h),B($=>{let L="start",P="hanging";return $.grid.groupAxis.position==="bottom"?P="hanging":$.grid.groupAxis.position==="top"?P="auto":$.grid.groupAxis.position==="left"?L="end":$.grid.groupAxis.position==="right"&&(L="start"),$.grid.valueAxis.position==="left"?L="start":$.grid.valueAxis.position==="right"?L="end":$.grid.valueAxis.position==="bottom"?P="auto":$.grid.valueAxis.position==="top"&&(P="hanging"),{textAnchor:L,dominantBaseline:P}})),I=Y({groupLabels:A,fullParams:r}).pipe(k(h),G(async $=>$),B($=>LI($.groupLabels,$.fullParams.tickFormat)));return Y({axisSelection:b,fullParams:r,tickTextAlign:T,axisLabelAlign:C,gridAxesSize:l,fullDataFormatter:i,chartParams:o,groupScale:S,groupScaleDomain:_,groupLabelData:I,textReverseTransform:v,textReverseTransformWithRotate:x,textSizePx:f}).pipe(k(h),G(async $=>$)).subscribe($=>{RI({selection:$.axisSelection,xAxisClassName:m,fullParams:$.fullParams,tickTextAlign:$.tickTextAlign,gridAxesSize:$.gridAxesSize,fullDataFormatter:$.fullDataFormatter,chartParams:$.chartParams,groupScale:$.groupScale,groupScaleDomain:$.groupScaleDomain,groupLabelData:$.groupLabelData,textReverseTransformWithRotate:$.textReverseTransformWithRotate,textSizePx:$.textSizePx}),kI({selection:$.axisSelection,groupingLabelClassName:g,fullParams:$.fullParams,axisLabelAlign:$.axisLabelAlign,gridAxesSize:$.gridAxesSize,fullDataFormatter:$.fullDataFormatter,chartParams:$.chartParams,textReverseTransform:$.textReverseTransform})}),()=>{h.next(void 0)}},$2="GroupAxis",EI=ie({name:$2,defaultParams:su,layerIndex:gn,validator:(t,{validateColumns:e})=>e(t,{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:t,name:e,observer:n,subject:r})=>{const i=new tt,o=v2($2,{selection:t,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()}}),II=6;function BI({selection:t,textClassName:e,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,f=0;o.grid.groupAxis.position==="bottom"?(f=-u,o.grid.valueAxis.position==="left"?c=-l:o.grid.valueAxis.position==="right"&&(c=l)):o.grid.groupAxis.position==="top"?(f=u,o.grid.valueAxis.position==="left"?c=-l:o.grid.valueAxis.position==="right"&&(c=l)):o.grid.groupAxis.position==="left"?(c=l,o.grid.valueAxis.position==="bottom"?f=u:o.grid.valueAxis.position==="top"&&(f=-u)):o.grid.groupAxis.position==="right"&&(c=-l,o.grid.valueAxis.position==="bottom"?f=u:o.grid.valueAxis.position==="top"&&(f=-u)),t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0).each((h,p,d)=>{H(d[p]).selectAll("text").data([h]).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",bt(n.labelColorType,a)).style("transform",s).attr("x",c).attr("y",f).text(m=>o.grid.valueAxis.label)}).attr("transform",h=>`translate(0, ${i.height})`)}function NI({selection:t,yAxisClassName:e,fullParams:n,tickTextAlign:r,gridAxesSize:i,fullDataFormatter:o,fullChartParams:a,valueScale:s,textReverseTransformWithRotate:l,filteredMinMaxValue:u}){const c=t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0);let f=0,h=0;o.grid.valueAxis.position==="left"?(f=n.tickPadding,h=0):o.grid.valueAxis.position==="right"?(f=-n.tickPadding,h=0):o.grid.valueAxis.position==="bottom"?(f=0,h=n.tickPadding):o.grid.valueAxis.position==="top"&&(f=0,h=-n.tickPadding);const p=yc(s).scale(s).ticks(n.ticks).tickFormat(g=>xr(g,n.tickFormat)).tickSize(n.tickFullLine==!0?-i.width:II).tickPadding(f),d=c.transition().duration(100).call(p);d.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?bt(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),d.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?bt(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges");const m=c.selectAll("text").attr("font-size",a.styles.textSize).style("color",bt(n.tickTextColorType,a)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("y",h).attr("dy",0);return m.style("transform",l),(o.grid.valueAxis.position==="bottom"||o.grid.valueAxis.position==="top")&&m.attr("dy",0),c}const Ti=(t,{selection:e,computedData$:n,filteredMinMaxValue$:r,fullParams$:i,fullDataFormatter$:o,fullChartParams$:a,gridAxesTransform$:s,gridAxesReverseTransform$:l,gridAxesSize$:u,gridContainerPosition$:c,isSeriesSeprate$:f})=>{const h=new tt,p=J(t,"container"),d=J(t,"yAxisG"),m=J(t,"yAxis"),g=J(t,"text"),y=Y({computedData:n.pipe(Q((T,C)=>T.length===C.length)),isSeriesSeprate:f}).pipe(k(h),G(async T=>T),B(T=>T.isSeriesSeprate?T.computedData:[T.computedData[0]]),B((T,C)=>e.selectAll(`g.${p}`).data(T,I=>I[0]?I[0].seriesIndex:C).join("g").classed(p,!0))),b=y.pipe(k(h),B((T,C)=>T.selectAll(`g.${d}`).data([d]).join("g").classed(d,!0)));Y({containerSelection:y,gridContainerPosition:c}).pipe(k(h),G(async T=>T)).subscribe(T=>{T.containerSelection.attr("transform",(C,I)=>{const $=T.gridContainerPosition[I]??T.gridContainerPosition[0],L=$.translate,P=$.scale;return`translate(${L[0]}, ${L[1]}) scale(${P[0]}, ${P[1]})`})}),Y({axisSelection:b,gridAxesTransform:s}).pipe(k(h),G(async T=>T)).subscribe(T=>{T.axisSelection.style("transform",T.gridAxesTransform.value)});const v=Y({gridAxesReverseTransform:l,gridContainerPosition:c}).pipe(k(h),G(async T=>T),B(T=>{const C=`rotateX(${T.gridAxesReverseTransform.rotateX}deg) rotateY(${T.gridAxesReverseTransform.rotateY}deg)`,I=`rotate(${T.gridAxesReverseTransform.rotate}deg)`,$=`scale(${1/T.gridContainerPosition[0].scale[0]}, ${1/T.gridContainerPosition[0].scale[1]})`;return`${C} ${I} ${$}`}),Q()),x=Y({textReverseTransform:v,fullParams:i}).pipe(k(h),G(async T=>T),B(T=>`${T.textReverseTransform} rotate(${T.fullParams.tickTextRotate}deg)`)),_=new pt(T=>{Y({fullDataFormatter:o,gridAxesSize:u,filteredMinMaxValue:r}).pipe(k(h),G(async C=>C)).subscribe(C=>{let I=C.filteredMinMaxValue[1],$=C.filteredMinMaxValue[0];I===$&&I===0&&(I=1);const L=Xi({maxValue:I,minValue:$,axisWidth:C.gridAxesSize.height,scaleDomain:C.fullDataFormatter.grid.valueAxis.scaleDomain,scaleRange:C.fullDataFormatter.grid.valueAxis.scaleRange});T.next(L)})}),S=Y({fullDataFormatter:o,fullParams:i}).pipe(k(h),G(async T=>T),B(T=>{let C="start",I="hanging";return T.fullDataFormatter.grid.valueAxis.position==="left"?(C="end",I="middle"):T.fullDataFormatter.grid.valueAxis.position==="right"?(C="start",I="middle"):T.fullDataFormatter.grid.valueAxis.position==="bottom"?(C=T.fullParams.tickTextRotate?"end":"middle",I="hanging"):T.fullDataFormatter.grid.valueAxis.position==="top"&&(C=T.fullParams.tickTextRotate?"start":"middle",I="auto"),{textAnchor:C,dominantBaseline:I}})),A=o.pipe(k(h),B(T=>{let C="start",I="hanging";return T.grid.groupAxis.position==="bottom"?I="auto":T.grid.groupAxis.position==="top"?I="hanging":T.grid.groupAxis.position==="left"?C="start":T.grid.groupAxis.position==="right"&&(C="end"),T.grid.valueAxis.position==="left"?C="end":T.grid.valueAxis.position==="right"?C="start":T.grid.valueAxis.position==="bottom"?I="hanging":T.grid.valueAxis.position==="top"&&(I="auto"),{textAnchor:C,dominantBaseline:I}}));return Y({axisSelection:b,fullParams:i,tickTextAlign:S,axisLabelAlign:A,computedData:n,gridAxesSize:u,fullDataFormatter:o,fullChartParams:a,valueScale:_,textReverseTransform:v,textReverseTransformWithRotate:x,filteredMinMaxValue:r}).pipe(k(h),G(async T=>T)).subscribe(T=>{NI({selection:T.axisSelection,yAxisClassName:m,fullParams:T.fullParams,tickTextAlign:T.tickTextAlign,gridAxesSize:T.gridAxesSize,fullDataFormatter:T.fullDataFormatter,fullChartParams:T.fullChartParams,valueScale:T.valueScale,textReverseTransformWithRotate:T.textReverseTransformWithRotate,filteredMinMaxValue:T.filteredMinMaxValue}),BI({selection:T.axisSelection,textClassName:g,fullParams:T.fullParams,axisLabelAlign:T.axisLabelAlign,gridAxesSize:T.gridAxesSize,fullDataFormatter:T.fullDataFormatter,fullChartParams:T.fullChartParams,textReverseTransform:T.textReverseTransform})}),()=>{h.next(void 0)}},_2="ValueAxis",FI=ie({name:_2,defaultParams:ua,layerIndex:gn,validator:(t,{validateColumns:e})=>e(t,{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:t,name:e,observer:n,subject:r})=>{const i=new tt,o=Ti(_2,{selection:t,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()}}),w2="ValueStackAxis",OI=ie({name:w2,defaultParams:Xp,layerIndex:gn,validator:(t,{validateColumns:e})=>e(t,{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:t,name:e,observer:n,subject:r})=>{const i=new tt,o=Ti(w2,{selection:t,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 S2(t,e){const n=e.textSizePx*1.5,i=(t==null?[]:Array.isArray(t)?t:typeof t=="string"?t.split(`
54
- `):[t]).filter(o=>o!="").map((o,a)=>`<tspan x="0" y="${a*n}">${o}</tspan>`).join("");return i?`<text font-size="${e.textSize}" fill="${e.textColor}" x="0" y="0" style="dominant-baseline:text-before-edge">
52
+ `})}function jI({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)=>{V(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 qI({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)?V(a[o]).style("opacity",1):V(a[o]).style("opacity",n.styles.unhighlightedOpacity)})}const S$=(e,{selection:t,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,fullDataFormatter$:a,seriesLabels$:s,SeriesDataMap$:l,GroupDataMap$:u,fullParams$:c,fullChartParams$:f,gridAxesTransform$:h,gridGraphicTransform$:p,gridAxesSize$:d,gridHighlight$:m,gridContainerPosition$:g,isSeriesSeprate$:y,event$:b})=>{const v=new J,x=Pt(e,"clipPath-box"),_=Z(e,"pathG"),A=Z(e,"path"),{seriesSelection$:S,axesSelection$:P,defsSelection$:M,graphicGSelection$:B}=Tr({selection:t,pluginName:e,clipPathID:x,seriesLabels$:s,gridContainerPosition$:g,gridAxesTransform$:h,gridGraphicTransform$:p});p.pipe(L(v),R(E=>-E.translate[1]/E.scale[1]));const $=o.pipe(R(E=>E.map(O=>O[0]?O[0].axisY-O[0].axisYFromZero:0)),ee()),k=Y({computedData:n,visibleComputedData:i,params:c,gridAxesSize:d,isSeriesSeprate:y}).pipe(L(v),G(async E=>E),R(E=>E.params.barWidth?E.params.barWidth:E.isSeriesSeprate?_$({axisWidth:E.gridAxesSize.width,groupAmount:E.computedData[0]?E.computedData[0].length:0,barAmountOfGroup:1,barPadding:E.params.barPadding,barGroupPadding:E.params.barGroupPadding}):_$({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}))),C=i.pipe(L(v),R(E=>{const O=new Set;return E.forEach(j=>{j.forEach(ie=>{O.add(ie.groupLabel)})}),Array.from(O)})),T=new de(E=>{Y({seriesLabels:s,barWidth:k,params:c}).pipe(L(v),G(async O=>O)).subscribe(O=>{const j=WI(O.barWidth,O.seriesLabels,O.params);E.next(j)})}),w=f.pipe(L(v),R(E=>E.transitionDuration),ee()),D=new de(E=>{Y({groupLabels:C,transitionDuration:w}).pipe(G(async O=>O)).subscribe(O=>{const j=XI(O.groupLabels.length,O.transitionDuration);E.next(j)})}).pipe(L(v),ee()),F=new de(E=>{Y({groupLabels:C,transitionDuration:w}).pipe(G(async O=>O)).subscribe(O=>{const j=VI(O.groupLabels.length,O.transitionDuration);E.next(j)})}).pipe(L(v),ee());Y({defsSelection:M,gridAxesSize:d}).pipe(L(v),G(async E=>E)).subscribe(E=>{const O=[{id:x,width:E.gridAxesSize.width,height:E.gridAxesSize.height}];jI({defsSelection:E.defsSelection,clipPathData:O})});const z=f.pipe(L(v),R(E=>E.highlightTarget),ee()),I=s.pipe(L(v),R(E=>E.map((O,j)=>Pt(e,`lineargradient-${O}`)))),N=Y({graphicGSelection:B,defsSelection:M,computedData:n,visibleComputedLayoutData:o,linearGradientIds:I,zeroYArr:$,groupLabels:C,barScale:T,params:c,chartParams:f,barWidth:k,delayGroup:D,transitionItem:F,isSeriesSeprate:y}).pipe(L(v),G(async E=>E),R(E=>(HI({defsSelection:E.defsSelection,computedData:E.computedData,linearGradientIds:E.linearGradientIds,params:E.params}),UI({graphicGSelection:E.graphicGSelection,pathGClassName:_,pathClassName:A,visibleComputedLayoutData:E.visibleComputedLayoutData,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 Y({barSelection:N,computedData:n,highlightTarget:z,SeriesDataMap:l,GroupDataMap:u}).subscribe(E=>{E.barSelection.on("mouseover",(O,j)=>{O.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,groups:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:O,data:E.computedData})}).on("mousemove",(O,j)=>{O.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,groups:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:O,data:E.computedData})}).on("mouseout",(O,j)=>{O.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,groups:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:O,data:E.computedData})}).on("click",(O,j)=>{O.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,groups:E.GroupDataMap.get(j.groupLabel),groupIndex:j.groupIndex,groupLabel:j.groupLabel,event:O,data:E.computedData})})}),Y({barSelection:N,highlight:m.pipe(R(E=>E.map(O=>O.id))),fullChartParams:f}).pipe(L(v),G(async E=>E)).subscribe(E=>{qI({selection:E.barSelection,ids:E.highlight,fullChartParams:E.fullChartParams})}),()=>{v.next(void 0)}},w$="BarsTriangle",ZI=st({name:w$,defaultParams:rd,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 J,o=S$(w$,{selection:e,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,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 KI({graphicGSelection:e,circleGClassName:t,circleClassName:n,visibleComputedLayoutData:r,fullParams:i,fullChartParams:o,graphicReverseScale:a}){const s=c=>{const f=c.size();return o.transitionDuration/f};let l=0;return e.each((c,f,h)=>{V(h[f]).selectAll("g").data(r[f],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)=>{V(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)=>Me({datum:g,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(g,y)=>Me({datum:g,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${a[f][0]??1}, ${a[f][1]??1})`)})}),e.selectAll(`circle.${n}`)}function QI({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)?V(a[o]).style("opacity",1).transition("highlight").duration(200):V(a[o]).style("opacity",n===!0?0:r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function JI({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)=>{V(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 T$=(e,{selection:t,computedData$:n,computedLayoutData$:r,visibleComputedData$:i,visibleComputedLayoutData$:o,seriesLabels$:a,SeriesDataMap$:s,GroupDataMap$:l,fullParams$:u,fullChartParams$:c,gridAxesTransform$:f,gridGraphicTransform$:h,gridGraphicReverseScale$:p,gridAxesSize$:d,gridHighlight$:m,gridContainerPosition$:g,event$:y})=>{const b=new J,v=Pt(e,"clipPath-box"),x=Z(e,"circleG"),_=Z(e,"circle"),{seriesSelection$:A,axesSelection$:S,defsSelection$:P,graphicGSelection$:M}=Tr({selection:t,pluginName:e,clipPathID:v,seriesLabels$:a,gridContainerPosition$:g,gridAxesTransform$:f,gridGraphicTransform$:h}),B=Y({computedData:n,gridGraphicReverseScale:p}).pipe(L(b),G(async T=>T),R(T=>T.computedData.map((w,D)=>T.gridGraphicReverseScale[D])));Y({defsSelection:P,gridAxesSize:d}).pipe(L(b),G(async T=>T)).subscribe(T=>{const w=[{id:v,width:T.gridAxesSize.width,height:T.gridAxesSize.height}];JI({defsSelection:T.defsSelection,clipPathData:w})});const $=c.pipe(L(b),R(T=>T.highlightTarget),ee()),k=Y({graphicGSelection:M,visibleComputedLayoutData:o,graphicReverseScale:B,fullChartParams:c,fullParams:u}).pipe(L(b),G(async T=>T),R(T=>KI({graphicGSelection:T.graphicGSelection,circleGClassName:x,circleClassName:_,visibleComputedLayoutData:T.visibleComputedLayoutData,fullParams:T.fullParams,fullChartParams:T.fullChartParams,graphicReverseScale:T.graphicReverseScale})));Y({graphicSelection:k,computedData:n,SeriesDataMap:s,GroupDataMap:l,highlightTarget:$}).pipe(L(b),G(async T=>T)).subscribe(T=>{T.graphicSelection.on("mouseover",(w,D)=>{y.next({type:"grid",eventName:"mouseover",pluginName:e,highlightTarget:T.highlightTarget,datum:D,gridIndex:D.gridIndex,series:T.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:T.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:w,data:T.computedData})}).on("mousemove",(w,D)=>{y.next({type:"grid",eventName:"mousemove",pluginName:e,highlightTarget:T.highlightTarget,data:T.computedData,datum:D,gridIndex:D.gridIndex,series:T.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:T.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:w})}).on("mouseout",(w,D)=>{y.next({type:"grid",eventName:"mouseout",pluginName:e,highlightTarget:T.highlightTarget,datum:D,gridIndex:D.gridIndex,series:T.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:T.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:w,data:T.computedData})}).on("click",(w,D)=>{y.next({type:"grid",eventName:"click",pluginName:e,highlightTarget:T.highlightTarget,datum:D,gridIndex:D.gridIndex,series:T.SeriesDataMap.get(D.seriesLabel),seriesIndex:D.seriesIndex,seriesLabel:D.seriesLabel,groups:T.GroupDataMap.get(D.groupLabel),groupIndex:D.groupIndex,groupLabel:D.groupLabel,event:w,data:T.computedData})})});const C=u.pipe(L(b),R(T=>T.onlyShowHighlighted),ee());return Y({graphicSelection:k,highlight:m.pipe(R(T=>T.map(w=>w.id))),onlyShowHighlighted:C,fullChartParams:c}).pipe(L(b),G(async T=>T)).subscribe(T=>{QI({selection:T.graphicSelection,ids:T.highlight,onlyShowHighlighted:T.onlyShowHighlighted,fullChartParams:T.fullChartParams})}),()=>{b.next(void 0)}},A$="Dots",eB=st({name:A$,defaultParams:td,layerIndex:fu,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 J,o=T$(A$,{selection:e,computedData$:r.computedData$,computedLayoutData$:r.computedLayoutData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,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()}}),tB=" - ",nB={listRectWidth:14,listRectHeight:14,listRectRadius:0};function P$(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 Ei=(e,{rootSelection:t,legendLabels$:n,fullParams$:r,layout$:i,fullChartParams$:o,textSizePx$:a})=>{const s=Z(e,"root-position"),l=Z(e,"legend-card"),u=Z(e,"legend-list"),c=Z(e,"legend-item"),f=new J,h=Y({legendLabels:n,fullChartParams:o}).pipe(L(f),G(async $=>$),R($=>{const k=new Map;let C=0;return $.legendLabels.forEach((T,w)=>{if(!k.has(T)){const D=P$(C,$.fullChartParams);k.set(T,D),C++}}),k})),p=n.pipe(L(f),R($=>{const k=new Set;let C=[];return $.forEach(T=>{k.has(T)?C.push(!1):C.push(!0),k.add(T)}),C})),d=r.pipe(L(f),R($=>$.placement==="top"||$.placement==="top-start"||$.placement==="top-end"?"top":$.placement==="bottom"||$.placement==="bottom-start"||$.placement==="bottom-end"?"bottom":$.placement==="left"||$.placement==="left-start"||$.placement==="left-end"?"left":"right"),ee(($,k)=>$===k),pe(1)),m=r.pipe(L(f),R($=>$.placement==="top-start"||$.placement==="bottom-start"||$.placement==="left-start"||$.placement==="right-start"?"start":$.placement==="top-end"||$.placement==="bottom-end"||$.placement==="left-end"||$.placement==="right-end"?"end":($.placement==="top"||$.placement==="bottom"||$.placement==="left"||$.placement==="right","center")),ee(($,k)=>$===k),pe(1)),g=d.pipe(L(f),R($=>$==="bottom"||$==="top"?"row":"column"),ee(($,k)=>$===k),pe(1)),y=Y({fullParams:r,position:d,layout:i}).pipe(L(f),G(async $=>$),R($=>{const k=$.fullParams.padding*2+$.fullParams.gap*2;return $.position==="bottom"||$.position==="top"?$.layout.rootWidth-k:$.layout.rootHeight-k})),v=Y({layout:i,position:d,justify:m}).pipe(L(f),G(async $=>$),R($=>{let k=0,C=0;return $.position==="bottom"?(C=$.layout.rootHeight,$.justify==="start"?k=0:$.justify==="center"?k=$.layout.rootWidth/2:$.justify==="end"&&(k=$.layout.rootWidth)):$.position==="right"?(k=$.layout.rootWidth,$.justify==="start"?C=0:$.justify==="center"?C=$.layout.rootHeight/2:$.justify==="end"&&(C=$.layout.rootHeight)):$.position==="top"?(C=0,$.justify==="start"?k=0:$.justify==="center"?k=$.layout.rootWidth/2:$.justify==="end"&&(k=$.layout.rootWidth)):$.position==="left"&&(k=0,$.justify==="start"?C=0:$.justify==="center"?C=$.layout.rootHeight/2:$.justify==="end"&&(C=$.layout.rootHeight)),{x:k,y:C}})).pipe(L(f),R($=>t.selectAll(`g.${s}`).data([$]).join(k=>k.append("g").classed(s,!0).attr("transform",C=>`translate(${C.x}, ${C.y})`),k=>k.transition().attr("transform",C=>`translate(${C.x}, ${C.y})`),k=>k.remove()))),x=r.pipe(L(f),R($=>$.labelList[0]?$.labelList[0]:nB)),_=Y({visibleList:p,fullParams:r,fullChartParams:o,legendLabels:n,lineDirection:g,lineMaxSize:y,defaultListStyle:x,SeriesLabelColorMap:h,textSizePx:a}).pipe(L(f),G(async $=>$),R($=>$.legendLabels.reduce((k,C,T)=>{if(!$.visibleList[T])return k;const w=C!==""?C:tB,D=fa(w,$.textSizePx),F=$.textSizePx*1.5+D,z=$.SeriesLabelColorMap.get(C),I=k[0]&&k[0][0]?k[k.length-1][k[k.length-1].length-1]:null,{translateX:N,translateY:E,lineIndex:O,itemIndex:j}=((W,Q,X)=>{let K=0,q=0,ne=0,se=0;if(W.lineDirection==="column"){let U=X?X.translateY+W.textSizePx+W.fullParams.gap:0;if(U+W.textSizePx>W.lineMaxSize){ne=X.lineIndex+1,se=0,q=0;const me=Q[Q.length-1].reduce((fe,Ee)=>Ee.itemWidth>fe?Ee.itemWidth:fe,0);K=X.translateX+me+W.fullParams.gap}else ne=X?X.lineIndex:0,se=X?X.itemIndex+1:0,q=U,K=X?X.translateX:0}else{let U=X?X.translateX+X.itemWidth+W.fullParams.gap:0;U+F>W.lineMaxSize?(ne=X.lineIndex+1,se=0,K=0):(ne=X?X.lineIndex:0,se=X?X.itemIndex+1:0,K=U),q=(W.textSizePx+W.fullParams.gap)*ne}return{translateX:K,translateY:q,lineIndex:ne,itemIndex:se}})($,k,I);k[O]||(k[O]=[]);const ie=$.fullParams.labelList[j]?$.fullParams.labelList[j]:$.defaultListStyle;return k[O].push({id:w,seriesLabel:w,seriesIndex:T,lineIndex:O,itemIndex:j,text:w,itemWidth:F,translateX:N,translateY:E,color:z,listRectWidth:ie.listRectWidth,listRectHeight:ie.listRectHeight,listRectRadius:ie.listRectRadius}),k},[])),pe(1)),A=Y({fullParams:r,fullChartParams:o,lineDirection:g,lengendItems:_,textSizePx:a}).pipe(L(f),G(async $=>$),R($=>{const{width:k,height:C}=((T,w)=>{let D=0,F=0;if(!w.length||!w[0].length)return{width:D,height:F};const z=w[0][w[0].length-1];return T.lineDirection==="column"?(D=w.reduce((I,N)=>{const E=N.reduce((O,j)=>j.itemWidth>O?j.itemWidth:O,0);return I+E},0),D+=T.fullParams.gap*(w.length-1),F=z.translateY+T.textSizePx):(D=z.translateX+z.itemWidth,F=T.textSizePx*w.length+T.fullParams.gap*(w.length-1)),{width:D,height:F}})($,$.lengendItems);return{direction:$.lineDirection,width:k,height:C,translateX:$.fullParams.gap,translateY:$.fullParams.gap}}),pe(1)),S=Y({fullParams:r,position:d,justify:m,lengendList:A}).pipe(L(f),G(async $=>$),R($=>{const k=$.lengendList.width+$.fullParams.gap*2,C=$.lengendList.height+$.fullParams.gap*2;let T=0,w=0;return $.position==="left"?$.justify==="start"?(T=$.fullParams.padding,w=$.fullParams.padding):$.justify==="center"?(T=$.fullParams.padding,w=-C/2):$.justify==="end"&&(T=$.fullParams.padding,w=-C-$.fullParams.padding):$.position==="right"?$.justify==="start"?(T=-k-$.fullParams.padding,w=$.fullParams.padding):$.justify==="center"?(T=-k-$.fullParams.padding,w=-C/2):$.justify==="end"&&(T=-k-$.fullParams.padding,w=-C-$.fullParams.padding):$.position==="top"?$.justify==="start"?(T=$.fullParams.padding,w=$.fullParams.padding):$.justify==="center"?(T=-k/2,w=$.fullParams.padding):$.justify==="end"&&(T=-k-$.fullParams.padding,w=$.fullParams.padding):$.justify==="start"?(T=$.fullParams.padding,w=-C-$.fullParams.padding):$.justify==="center"?(T=-k/2,w=-C-$.fullParams.padding):$.justify==="end"&&(T=-k-$.fullParams.padding,w=-C-$.fullParams.padding),{width:k,height:C,translateX:T,translateY:w}})),P=Y({rootPositionSelection:v,fullParams:r,fullChartParams:o,legendCard:S}).pipe(L(f),G(async $=>$),R($=>$.rootPositionSelection.selectAll("g").data([$.legendCard]).join(k=>k.append("g").classed(l,!0).attr("transform",C=>`translate(${C.translateX}, ${C.translateY})`),k=>k.transition().attr("transform",C=>`translate(${C.translateX}, ${C.translateY})`),k=>k.remove()).each((k,C,T)=>{V(T[C]).selectAll("rect").data([k]).join("rect").attr("width",w=>w.width).attr("height",w=>w.height).attr("fill",be($.fullParams.backgroundFill,$.fullChartParams)).attr("stroke",be($.fullParams.backgroundStroke,$.fullChartParams))}))),M=Y({lengendCardSelection:P,fullParams:r,lengendList:A}).pipe(L(f),G(async $=>$),R($=>$.lengendCardSelection.selectAll("g").data([$.lengendList]).join(k=>k.append("g").classed(u,!0).attr("transform",C=>`translate(${C.translateX}, ${C.translateY})`),k=>k.transition().attr("transform",C=>`translate(${C.translateX}, ${C.translateY})`),k=>k.remove())));return Y({lengendListSelection:M,fullParams:r,fullChartParams:o,lengendItems:_,textSizePx:a}).pipe(L(f),G(async $=>$),R($=>{const k=$.lengendItems[0]?$.lengendItems.flat():[];return $.lengendListSelection.selectAll(`g.${c}`).data(k).join(C=>C.append("g").classed(c,!0).attr("cursor","default"),C=>C,C=>C.remove()).attr("transform",(C,T)=>`translate(${C.translateX}, ${C.translateY})`).each((C,T,w)=>{const D=$.textSizePx/2,F=-C.listRectWidth/2,z=-C.listRectHeight/2;V(w[T]).selectAll("rect").data([C]).join("rect").attr("x",D).attr("y",D).attr("width",I=>I.listRectWidth).attr("height",I=>I.listRectHeight).attr("transform",I=>`translate(${F}, ${z})`).attr("fill",I=>I.color).attr("rx",I=>I.listRectRadius),V(w[T]).selectAll("text").data([C]).join(I=>I.append("text").attr("dominant-baseline","hanging"),I=>I,I=>I.remove()).attr("x",$.textSizePx*1.5).attr("font-size",$.fullChartParams.styles.textSize).attr("fill",I=>$.fullParams.textColorType==="label"?P$(I.seriesIndex,$.fullChartParams):be($.fullParams.textColorType,$.fullChartParams)).text(I=>I.text)})})).subscribe(),()=>{t.select(`g.${s}`).remove(),f.next(void 0)}},D$="GridLegend",rB=st({name:D$,defaultParams:ad,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 J,o=n.SeriesDataMap$.pipe(L(i),R(l=>Array.from(l.keys()))),a=n.fullParams$.pipe(L(i),R(l=>{const u=[{listRectWidth:l.listRectWidth,listRectHeight:l.listRectHeight,listRectRadius:l.listRectRadius}];return{...l,labelList:u}})),s=Ei(D$,{rootSelection:t,legendLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}});function M$(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 v=0,x=p.length;v<x;++v){const _=(m.text?m.text+b:"")+p[v],A=l(_);(g+A)/2<d?(m.width=g=A,m.text=_):(g=l(p[v]),m={width:g,text:p[v]},y.push(m))}return y}function f(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 h(p,d){o>0&&(d=s(d,o));const m=a(d),g=u(d),y=c(m,g),b=f(y);let v=p.select("text");v.size()||(v=p.append("text")),v.attr("transform",`translate(0,0) scale(${n/b})`);const x=v.selectAll("tspan").data(y),_=x.enter().append("tspan").attr("x",0).merge(x).attr("y",(A,S)=>(S-y.length/2+.8)*r).text(A=>A.text);return x.exit().remove(),x.merge(_)}return h(e,t)}function Sp(e,{textArr:t,textSizePx:n,groupAxisPosition:r}){e.text(null);const i=Number(e.attr("x"));let o=Number(e.attr("y"));r==="top"&&(o-=(t.length-1)*n),e.selectAll("tspan").data(t).join("tspan").attr("x",i).attr("y",(a,s)=>o+s*n).text(a=>a)}function C$(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 iB=6;function oB(e,t){return e.map((n,r)=>{const i=wr(n,t),o=typeof i=="string"?i.split(`
53
+ `):[i];return{text:i,textArr:o}})}function aB({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,f=0;o.groupAxis.position==="bottom"?(f=u,o.valueAxis.position==="left"?c=l:o.valueAxis.position==="right"&&(c=-l)):o.groupAxis.position==="top"?(f=-u,o.valueAxis.position==="left"?c=l:o.valueAxis.position==="right"&&(c=-l)):o.groupAxis.position==="left"?(c=-l,o.valueAxis.position==="bottom"?f=-u:o.valueAxis.position==="top"&&(f=u)):o.groupAxis.position==="right"&&(c=l,o.valueAxis.position==="bottom"?f=-u:o.valueAxis.position==="top"&&(f=u)),e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).each((h,p,d)=>{V(d[p]).selectAll("text").data([h]).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",be(n.labelColorType,a)).style("transform",s).attr("x",c).attr("y",f).text(m=>o.groupAxis.label)}).attr("transform",h=>`translate(${i.width}, 0)`)}function sB({selection:e,xAxisClassName:t,fullParams:n,tickTextAlign:r,gridAxesSize:i,fullDataFormatter:o,chartParams:a,groupScale:s,groupScaleDomain:l,groupLabelData:u,textReverseTransformWithRotate:c,textSizePx:f}){const h=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"?(d=n.tickPadding,m=0):o.groupAxis.position==="top"&&(d=-n.tickPadding,m=-0);const g=Dc(s).scale(s).ticks(n.ticks==="all"||n.ticks>p?p:n.ticks).tickSize(n.tickFullLine==!0?i.height:-iB).tickSizeOuter(0).tickFormat(v=>{var x;return((x=u[v])==null?void 0:x.text)??""}).tickPadding(d),y=h.transition().duration(100).call(g).on("end",(v,x)=>{h.selectAll(".tick text").each((_,A,S)=>{var M;const P=((M=u[_])==null?void 0:M.textArr)??[];Sp(V(S[A]),{textArr:P,textSizePx:f,groupAxisPosition:o.groupAxis.position})})});return y.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?be(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),y.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?be(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges"),h.selectAll("text").attr("font-size",a.styles.textSize).attr("fill",be(n.tickTextColorType,a)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("x",m).style("transform",c).attr("dy",0),h}const L$=(e,{selection:t,computedData$:n,fullParams$:r,fullDataFormatter$:i,fullChartParams$:o,gridAxesTransform$:a,gridAxesReverseTransform$:s,gridAxesSize$:l,gridContainerPosition$:u,isSeriesSeprate$:c,textSizePx$:f})=>{const h=new J,p=Z(e,"container"),d=Z(e,"xAxisG"),m=Z(e,"xAxis"),g=Z(e,"groupingLabel"),y=Y({computedData:n.pipe(ee(($,k)=>$.length===k.length)),isSeriesSeprate:c}).pipe(L(h),G(async $=>$),R($=>$.isSeriesSeprate?$.computedData:[$.computedData[0]]),R(($,k)=>t.selectAll(`g.${p}`).data($,C=>C[0]?C[0].seriesIndex:k).join("g").classed(p,!0))),b=y.pipe(L(h),R(($,k)=>$.selectAll(`g.${d}`).data([d]).join("g").classed(d,!0)));Y({containerSelection:y,gridContainerPosition:u}).pipe(L(h),G(async $=>$)).subscribe($=>{$.containerSelection.attr("transform",(k,C)=>{const T=$.gridContainerPosition[C]??$.gridContainerPosition[0],w=T.translate,D=T.scale;return`translate(${w[0]}, ${w[1]}) scale(${D[0]}, ${D[1]})`})}),Y({axisSelection:b,gridAxesTransform:a}).pipe(L(h),G(async $=>$)).subscribe($=>{$.axisSelection.style("transform",$.gridAxesTransform.value)});const v=Y({gridAxesReverseTransform:s,gridContainerPosition:u}).pipe(L(h),G(async $=>$),R($=>{const k=`rotateX(${$.gridAxesReverseTransform.rotateX}deg) rotateY(${$.gridAxesReverseTransform.rotateY}deg)`,C=`rotate(${$.gridAxesReverseTransform.rotate}deg)`,T=`scale(${1/$.gridContainerPosition[0].scale[0]}, ${1/$.gridContainerPosition[0].scale[1]})`;return`${k} ${C} ${T}`}),ee()),x=Y({textReverseTransform:v,fullParams:r}).pipe(L(h),G(async $=>$),R($=>`${$.textReverseTransform} rotate(${$.fullParams.tickTextRotate}deg)`)),_=Y({fullDataFormatter:i,gridAxesSize:l,computedData:n}).pipe(L(h),G(async $=>$),R($=>{const k=$.computedData[0]?$.computedData[0].length-1:0,C=$.fullDataFormatter.groupAxis.scaleDomain[0]-$.fullDataFormatter.groupAxis.scalePadding,T=$.fullDataFormatter.groupAxis.scaleDomain[1]==="max"?k+$.fullDataFormatter.groupAxis.scalePadding:$.fullDataFormatter.groupAxis.scaleDomain[1]+$.fullDataFormatter.groupAxis.scalePadding;return[C,T]}),pe(1)),A=Y({groupScaleDomain:_,gridAxesSize:l}).pipe(L(h),G(async $=>$),R($=>xr().domain($.groupScaleDomain).range([0,$.gridAxesSize.width]))),S=n.pipe(R($=>($[0]??[]).map(k=>k.groupLabel))),P=Y({fullDataFormatter:i,fullParams:r}).pipe(L(h),G(async $=>$),R($=>{let k="middle",C="hanging";return $.fullDataFormatter.groupAxis.position==="bottom"?(k=$.fullParams.tickTextRotate?"end":"middle",C="hanging"):$.fullDataFormatter.groupAxis.position==="top"?(k=$.fullParams.tickTextRotate?"start":"middle",C="auto"):$.fullDataFormatter.groupAxis.position==="left"?(k="end",C="middle"):$.fullDataFormatter.groupAxis.position==="right"&&(k="start",C="middle"),{textAnchor:k,dominantBaseline:C}})),M=i.pipe(L(h),R($=>{let k="start",C="hanging";return $.groupAxis.position==="bottom"?C="hanging":$.groupAxis.position==="top"?C="auto":$.groupAxis.position==="left"?k="end":$.groupAxis.position==="right"&&(k="start"),$.valueAxis.position==="left"?k="start":$.valueAxis.position==="right"?k="end":$.valueAxis.position==="bottom"?C="auto":$.valueAxis.position==="top"&&(C="hanging"),{textAnchor:k,dominantBaseline:C}})),B=Y({groupLabels:S,fullParams:r}).pipe(L(h),G(async $=>$),R($=>oB($.groupLabels,$.fullParams.tickFormat)));return Y({axisSelection:b,fullParams:r,tickTextAlign:P,axisLabelAlign:M,gridAxesSize:l,fullDataFormatter:i,chartParams:o,groupScale:A,groupScaleDomain:_,groupLabelData:B,textReverseTransform:v,textReverseTransformWithRotate:x,textSizePx:f}).pipe(L(h),G(async $=>$)).subscribe($=>{sB({selection:$.axisSelection,xAxisClassName:m,fullParams:$.fullParams,tickTextAlign:$.tickTextAlign,gridAxesSize:$.gridAxesSize,fullDataFormatter:$.fullDataFormatter,chartParams:$.chartParams,groupScale:$.groupScale,groupScaleDomain:$.groupScaleDomain,groupLabelData:$.groupLabelData,textReverseTransformWithRotate:$.textReverseTransformWithRotate,textSizePx:$.textSizePx}),aB({selection:$.axisSelection,groupingLabelClassName:g,fullParams:$.fullParams,axisLabelAlign:$.axisLabelAlign,gridAxesSize:$.gridAxesSize,fullDataFormatter:$.fullDataFormatter,chartParams:$.chartParams,textReverseTransform:$.textReverseTransform})}),()=>{h.next(void 0)}},k$="GroupAxis",lB=st({name:k$,defaultParams:xu,layerIndex:bn,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"},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 J,o=L$(k$,{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()}}),uB=6;function cB({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,f=0;o.groupAxis.position==="bottom"?(f=-u,o.valueAxis.position==="left"?c=-l:o.valueAxis.position==="right"&&(c=l)):o.groupAxis.position==="top"?(f=u,o.valueAxis.position==="left"?c=-l:o.valueAxis.position==="right"&&(c=l)):o.groupAxis.position==="left"?(c=l,o.valueAxis.position==="bottom"?f=u:o.valueAxis.position==="top"&&(f=-u)):o.groupAxis.position==="right"&&(c=-l,o.valueAxis.position==="bottom"?f=u:o.valueAxis.position==="top"&&(f=-u)),e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).each((h,p,d)=>{V(d[p]).selectAll("text").data([h]).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",be(n.labelColorType,a)).style("transform",s).attr("x",c).attr("y",f).text(m=>o.valueAxis.label)}).attr("transform",h=>`translate(0, ${i.height})`)}function fB({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 f=0,h=0;o.valueAxis.position==="left"?(f=n.tickPadding,h=0):o.valueAxis.position==="right"?(f=-n.tickPadding,h=0):o.valueAxis.position==="bottom"?(f=0,h=n.tickPadding):o.valueAxis.position==="top"&&(f=0,h=-n.tickPadding);const p=Mc(s).scale(s).ticks(n.ticks).tickFormat(g=>wr(g,n.tickFormat)).tickSize(n.tickFullLine==!0?-i.width:uB).tickPadding(f),d=c.transition().duration(100).call(p);d.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?be(n.tickColorType,a):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),d.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?be(n.axisLineColorType,a):"none").style("shape-rendering","crispEdges");const m=c.selectAll("text").attr("font-size",a.styles.textSize).style("color",be(n.tickTextColorType,a)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("y",h).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,gridAxesTransform$:s,gridAxesReverseTransform$:l,gridAxesSize$:u,gridContainerPosition$:c,isSeriesSeprate$:f})=>{const h=new J,p=Z(e,"container"),d=Z(e,"yAxisG"),m=Z(e,"yAxis"),g=Z(e,"text"),y=Y({computedData:n.pipe(ee((P,M)=>P.length===M.length)),isSeriesSeprate:f}).pipe(L(h),G(async P=>P),R(P=>P.isSeriesSeprate?P.computedData:[P.computedData[0]]),R((P,M)=>t.selectAll(`g.${p}`).data(P,B=>B[0]?B[0].seriesIndex:M).join("g").classed(p,!0))),b=y.pipe(L(h),R((P,M)=>P.selectAll(`g.${d}`).data([d]).join("g").classed(d,!0)));Y({containerSelection:y,gridContainerPosition:c}).pipe(L(h),G(async P=>P)).subscribe(P=>{P.containerSelection.attr("transform",(M,B)=>{const $=P.gridContainerPosition[B]??P.gridContainerPosition[0],k=$.translate,C=$.scale;return`translate(${k[0]}, ${k[1]}) scale(${C[0]}, ${C[1]})`})}),Y({axisSelection:b,gridAxesTransform:s}).pipe(L(h),G(async P=>P)).subscribe(P=>{P.axisSelection.style("transform",P.gridAxesTransform.value)});const v=Y({gridAxesReverseTransform:l,gridContainerPosition:c}).pipe(L(h),G(async P=>P),R(P=>{const M=`rotateX(${P.gridAxesReverseTransform.rotateX}deg) rotateY(${P.gridAxesReverseTransform.rotateY}deg)`,B=`rotate(${P.gridAxesReverseTransform.rotate}deg)`,$=`scale(${1/P.gridContainerPosition[0].scale[0]}, ${1/P.gridContainerPosition[0].scale[1]})`;return`${M} ${B} ${$}`}),ee()),x=Y({textReverseTransform:v,fullParams:i}).pipe(L(h),G(async P=>P),R(P=>`${P.textReverseTransform} rotate(${P.fullParams.tickTextRotate}deg)`)),_=new de(P=>{Y({fullDataFormatter:o,gridAxesSize:u,filteredMinMaxValue:r}).pipe(L(h),G(async M=>M)).subscribe(M=>{let B=M.filteredMinMaxValue[1],$=M.filteredMinMaxValue[0];B===$&&B===0&&(B=1);const k=ro({maxValue:B,minValue:$,axisWidth:M.gridAxesSize.height,scaleDomain:M.fullDataFormatter.valueAxis.scaleDomain,scaleRange:M.fullDataFormatter.valueAxis.scaleRange});P.next(k)})}),A=Y({fullDataFormatter:o,fullParams:i}).pipe(L(h),G(async P=>P),R(P=>{let M="start",B="hanging";return P.fullDataFormatter.valueAxis.position==="left"?(M="end",B="middle"):P.fullDataFormatter.valueAxis.position==="right"?(M="start",B="middle"):P.fullDataFormatter.valueAxis.position==="bottom"?(M=P.fullParams.tickTextRotate?"end":"middle",B="hanging"):P.fullDataFormatter.valueAxis.position==="top"&&(M=P.fullParams.tickTextRotate?"start":"middle",B="auto"),{textAnchor:M,dominantBaseline:B}})),S=o.pipe(L(h),R(P=>{let M="start",B="hanging";return P.groupAxis.position==="bottom"?B="auto":P.groupAxis.position==="top"?B="hanging":P.groupAxis.position==="left"?M="start":P.groupAxis.position==="right"&&(M="end"),P.valueAxis.position==="left"?M="end":P.valueAxis.position==="right"?M="start":P.valueAxis.position==="bottom"?B="hanging":P.valueAxis.position==="top"&&(B="auto"),{textAnchor:M,dominantBaseline:B}}));return Y({axisSelection:b,fullParams:i,tickTextAlign:A,axisLabelAlign:S,computedData:n,gridAxesSize:u,fullDataFormatter:o,fullChartParams:a,valueScale:_,textReverseTransform:v,textReverseTransformWithRotate:x,filteredMinMaxValue:r}).pipe(L(h),G(async P=>P)).subscribe(P=>{fB({selection:P.axisSelection,yAxisClassName:m,fullParams:P.fullParams,tickTextAlign:P.tickTextAlign,gridAxesSize:P.gridAxesSize,fullDataFormatter:P.fullDataFormatter,fullChartParams:P.fullChartParams,valueScale:P.valueScale,textReverseTransformWithRotate:P.textReverseTransformWithRotate,filteredMinMaxValue:P.filteredMinMaxValue}),cB({selection:P.axisSelection,textClassName:g,fullParams:P.fullParams,axisLabelAlign:P.axisLabelAlign,gridAxesSize:P.gridAxesSize,fullDataFormatter:P.fullDataFormatter,fullChartParams:P.fullChartParams,textReverseTransform:P.textReverseTransform})}),()=>{h.next(void 0)}},R$="ValueAxis",hB=st({name:R$,defaultParams:ma,layerIndex:bn,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 J,o=Ii(R$,{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()}}),E$="StackedValueAxis",pB=st({name:E$,defaultParams:id,layerIndex:bn,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 J,o=Ii(E$,{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 I$(e,t){const n=t.textSizePx*1.5,i=(e==null?[]:Array.isArray(e)?e:typeof e=="string"?e.split(`
54
+ `):[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">
55
55
  ${i}
56
- </text>`:""}function zI({rootSelection:t,pluginName:e,gClassName:n,boxClassName:r,rootWidth:i,rootHeight:o,svgString:a,tooltipStyle:s,event:l}){t.interrupt("fadeout");const u=5,c=a?[a]:[],f=a?[s]:[],p=t.selectAll(`g.${n}`).data(c).join(S=>S.append("g").classed(n,!0).attr("pointer-events","none"),S=>S,S=>S.style("opacity",0).remove()).attr("transform",()=>`translate(${l.offsetX}, ${l.offsetY})`).selectAll(`g.${r}`).data(f).join(S=>S.append("g").classed(J(e,"box"),!0)),d=p.selectAll("rect").data(f).join(S=>S.append("rect").attr("rx",u).attr("ry",u)).attr("fill",S=>S.backgroundColor).attr("stroke",S=>S.strokeColor).attr("opacity",S=>S.backgroundOpacity),m=p.selectAll("g").data(c).join(S=>S.append("g").classed(J(e,"content"),!0).attr("transform",()=>`translate(${s.padding}, ${s.padding})`));c.length&&FE(m,c[0]);const g=m!=null&&m.node()?qv(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()?qv(p):{width:0,height:0},b=i-y.width,v=o-y.height,x=l.offsetX+s.offset[0]>b?b-l.offsetX:s.offset[0],_=l.offsetY+s.offset[1]>v?v-l.offsetY:s.offset[1];p.attr("transform",S=>`translate(${x}, ${_})`),p.attr("transform",S=>`translate(${x}, ${_})`)}const oa=(t,{rootSelection:e,fullParams$:n,fullChartParams$:r,layout$:i,event$:o})=>{const a=new tt,s=J(t,"g"),l=J(t,"box"),u=o.pipe(k(a),Dr(b=>b.eventName==="mouseover"||b.eventName==="mousemove")),c=o.pipe(k(a),Dr(b=>b.eventName==="mouseout")),f=$P(r),h=Y({fullChartParams:r,fullParams:n,textSizePx:f}).pipe(k(a),G(async b=>b),B(b=>({backgroundColor:bt(b.fullParams.backgroundColorType,b.fullChartParams),backgroundOpacity:b.fullParams.backgroundOpacity,strokeColor:bt(b.fullParams.strokeColorType,b.fullChartParams),offset:b.fullParams.offset,padding:b.fullParams.padding,textSize:b.fullChartParams.styles.textSize,textSizePx:b.textSizePx,textColor:bt(b.fullParams.textColorType,b.fullChartParams),seriesColors:b.fullChartParams.colors[b.fullChartParams.colorScheme].series}))),p=Y({fullParams:n,tooltipStyle:h}).pipe(k(a),G(async b=>b),B(b=>v=>{const x=b.fullParams.renderFn(v,{utils:{measureTextWidth:ta},styles:b.tooltipStyle});if(typeof x=="string"){const _=x.trim();if(_.slice(0,1)==="<"&&_.slice(_.length-1,_.length)===">")return x;{const A=x.split(`
57
- `);return S2(A,b.tooltipStyle)}}else if(Array.isArray(x))return S2(x,b.tooltipStyle);return""})),d=Y({event:u,contentRenderFn:p}).pipe(k(a),G(async b=>b),B(b=>b.contentRenderFn(b.event))),m=c.pipe(k(a),B(b=>"")),g=Su(d,m).pipe(k(a),Q((b,v)=>b===v)),y=Su(u,c).pipe(k(a),B(b=>b.event));return Y({svgString:g,eventTooltip:y,layout:i,tooltipStyle:h}).pipe(k(a),G(async b=>b)).subscribe(b=>{zI({rootSelection:e,pluginName:t,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)}},A2="GridTooltip",GI=ie({name:A2,defaultParams:lu,layerIndex:ra,validator:(t,{validateColumns:e})=>e(t,{backgroundColorType:{toBeOption:"ColorType"},backgroundOpacity:{toBeTypes:["number"]},strokeColorType:{toBeOption:"ColorType"},offset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},padding:{toBeTypes:["number"]},textColorType:{toBeOption:"ColorType"},renderFn:{toBeTypes:["Function"]}})})(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new tt,a=oa(A2,{rootSelection:e,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),YI=ie({name:"GridZoom",defaultParams:Vp,layerIndex:Qv,validator:(t,{validateColumns:e})=>({status:"success",columnName:"",expectToBe:""})})(({selection:t,rootSelection:e,name:n,observer:r,subject:i})=>{const o=new tt;let a={k:1,x:0,y:0};const s=r.computedData$.pipe(B(c=>c[0]?c[0].length-1:0),Q()),l=r.fullDataFormatter$.pipe(B(c=>c.grid.groupAxis),Au()),u=Y({initGroupAxis:l,groupMaxIndex:s,layout:r.layout$,axisSize:r.gridAxesSize$}).pipe(k(o),G(async c=>c),B(c=>{const f=c.initGroupAxis.scaleDomain[0]-c.initGroupAxis.scalePadding,h=c.initGroupAxis.scaleDomain[1]==="max"?c.groupMaxIndex+c.initGroupAxis.scalePadding:c.initGroupAxis.scaleDomain[1]+c.initGroupAxis.scalePadding;return Xi({maxValue:c.groupMaxIndex,minValue:0,axisWidth:c.axisSize.width,scaleDomain:[f,h],scaleRange:[0,1]})}));return Y({initGroupScale:u,fullDataFormatter:r.fullDataFormatter$,groupMaxIndex:s}).pipe(k(o),G(async c=>c)).subscribe(c=>{const h=c.initGroupScale.copy(),p=Qo().on("zoom",function(m){const g=m.transform,y=x=>{const _=Math.round(x);return Math.min(c.groupMaxIndex,Math.max(0,_))},b=c.fullDataFormatter.grid.groupAxis.position==="bottom"||c.fullDataFormatter.grid.groupAxis.position==="top"?g.rescaleX(h).domain().map(y):g.rescaleY(h).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 v={...c.fullDataFormatter,grid:{...c.fullDataFormatter.grid,groupAxis:{...c.fullDataFormatter.grid.groupAxis,scaleDomain:b}}};i.dataFormatter$.next(v)});e.call(p)}),()=>{o.next(void 0),e.call(Qo().on("zoom",null))}}),tu="GroupAux",cp=J(tu,"label-box"),XI={name:tu,defaultParams:au,layerIndex:Jv,validator:(t,{validateColumns:e})=>e(t,{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 VI({groupLabel:t,axisX:e,axisHeight:n,fullParams:r}){return r.showLine&&t?[{id:t,x1:e,x2:e,y1:0,y2:n}]:[]}function WI({groupLabel:t,axisX:e,fullParams:n,textSizePx:r,rowAmount:i}){const o=xr(t,n.labelTextFormat),a=o.split(`
58
- `),s=a.reduce((c,f)=>f.length>c.length?f:c,""),l=ta(s,r),u=r*a.length;return n.showLabel&&t?[{id:t,x:e,y:-n.labelPadding*i,text:o,textArr:a,textWidth:l,textHeight:u}]:[]}function UI({selection:t,pluginName:e,lineData:n,fullParams:r,fullChartParams:i}){const o=J(e,"auxline");return t.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=>bt(r.lineColorType,i)).style("stroke-dasharray",r.lineDashArray??"none")}function HI(t){t.selectAll("line").data([]).exit().remove()}function jI({selection:t,labelData:e,fullParams:n,fullDataFormatter:r,fullChartParams:i,textReverseTransformWithRotate:o,textSizePx:a}){return t.selectAll(`g.${cp}`).data(e).join(l=>l.append("g").classed(cp,!0).style("cursor","pointer").attr("transform",(u,c)=>`translate(${u.x}, ${u.y})`),l=>l.transition().duration(50).attr("transform",(c,f)=>`translate(${c.x}, ${c.y})`),l=>l.remove()).each((l,u,c)=>{const f=l.textWidth+12,h=l.textHeight+6;let p=-f/2,d=-2;r.grid.groupAxis.position==="bottom"?(p=n.labelRotate?-f+h:-f/2,d=2):r.grid.groupAxis.position==="left"?(p=-f+2,d=-h/2):r.grid.groupAxis.position==="right"?(p=-2,d=-h/2):r.grid.groupAxis.position==="top"&&(p=n.labelRotate?-f+h:-f/2,d=-h+2),H(c[u]).selectAll("rect").data([l]).join(m=>m.append("rect").style("cursor","pointer").attr("rx",5).attr("ry",5),m=>m,m=>m.remove()).attr("width",m=>`${f}px`).attr("height",`${h}px`).attr("fill",m=>bt(n.labelColorType,i)).attr("x",p).attr("y",d-3).style("transform",o),H(c[u]).selectAll("text").data([l]).join(m=>m.append("text").style("dominant-baseline","hanging").style("cursor","pointer"),m=>m,m=>m.remove()).style("transform",o).attr("fill",m=>bt(n.labelTextColorType,i)).attr("font-size",i.styles.textSize).attr("x",p+6).attr("y",d).each((m,g,y)=>{up(H(y[g]),{textArr:l.textArr,textSizePx:a,groupAxisPosition:r.grid.groupAxis.position})})})}function qI(t){t.selectAll(`g.${cp}`).data([]).exit().remove()}const ZI=ie(XI)(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new tt;let a=!1;const s=e.insert("rect","g").classed(J(tu,"rect"),!0).attr("opacity",0),{seriesSelection$:l,axesSelection$:u,defsSelection$:c,graphicGSelection$:f}=vr({selection:t,pluginName:tu,clipPathID:"test",seriesLabels$:i.isSeriesSeprate$.pipe(G(_=>wu(()=>_,i.seriesLabels$,i.seriesLabels$.pipe(B(S=>[S[0]]))))),gridContainerPosition$:i.gridContainerPosition$,gridAxesTransform$:i.gridAxesTransform$,gridGraphicTransform$:i.gridGraphicTransform$});i.layout$.pipe(k(o)).subscribe(_=>{s.attr("width",_.rootWidth).attr("height",_.rootHeight)});const h=Y({groupScaleDomainValue:i.groupScaleDomainValue$,gridAxesSize:i.gridAxesSize$}).pipe(k(o),G(async _=>_),B(_=>yi().domain(_.groupScaleDomainValue).range([0,_.gridAxesSize.width]))),p=i.fullChartParams$.pipe(k(o),B(_=>_.highlightTarget),Q()),d=ea(e,"mousemove").pipe(k(o)),m=Y({gridAxesReverseTransform:i.gridAxesReverseTransform$,gridContainerPosition:i.gridContainerPosition$}).pipe(k(o),G(async _=>_),B(_=>{const S=`rotateX(${_.gridAxesReverseTransform.rotateX}deg) rotateY(${_.gridAxesReverseTransform.rotateY}deg)`,A=`rotate(${_.gridAxesReverseTransform.rotate}deg)`,T=`scale(${1/_.gridContainerPosition[0].scale[0]}, ${1/_.gridContainerPosition[0].scale[1]})`;return`${S} ${A} ${T}`}),Q()),g=Y({textReverseTransform:m,fullParams:i.fullParams$}).pipe(k(o),G(async _=>_),B(_=>`${_.textReverseTransform} rotate(${_.fullParams.labelRotate}deg)`)),y=i.gridContainerPosition$.pipe(k(o),B(_=>_.reduce((A,T)=>T.columnIndex>A?T.columnIndex:A,0)+1),Q()),b=i.gridContainerPosition$.pipe(k(o),B(_=>_.reduce((A,T)=>T.rowIndex>A?T.rowIndex:A,0)+1),Q()),v=OE({rootSelection:e,fullDataFormatter$:i.fullDataFormatter$,gridAxesSize$:i.gridAxesSize$,computedData$:i.computedData$,fullChartParams$:i.fullChartParams$,gridContainerPosition$:i.gridContainerPosition$,layout$:i.layout$}).pipe(k(o));Y({axesSelection:u,columnAmount:y,rowAmount:b,layout:i.layout$,rootMousemove:d,gridGroupPosition:v,computedData:i.computedData$,groupScale:h,gridAxesSize:i.gridAxesSize$,fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,fullChartParams:i.fullChartParams$,highlightTarget:p,textReverseTransformWithRotate:g,GroupDataMap:i.GroupDataMap$,textSizePx:i.textSizePx$}).pipe(k(o),G(async _=>_)).subscribe(_=>{const{groupIndex:S,groupLabel:A}=_.gridGroupPosition,T=_.groupScale(S)??0,C=VI({groupLabel:A,axisX:T,axisHeight:_.gridAxesSize.height,fullParams:_.fullParams});UI({selection:_.axesSelection,pluginName:n,lineData:C,fullParams:_.fullParams,fullChartParams:_.fullChartParams});const I=WI({groupLabel:A,axisX:T,fullParams:_.fullParams,textSizePx:_.textSizePx,rowAmount:_.rowAmount});jI({selection:_.axesSelection,labelData:I,fullParams:_.fullParams,fullDataFormatter:_.fullDataFormatter,fullChartParams:_.fullChartParams,textReverseTransformWithRotate:_.textReverseTransformWithRotate,textSizePx:_.textSizePx}).on("mouseover",(L,P)=>{L.stopPropagation(),a=!0,r.event$.next({type:"grid",pluginName:n,eventName:"mouseover",highlightTarget:_.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:_.GroupDataMap.get(A)??[],groupIndex:S,groupLabel:A,event:L,data:_.computedData})}).on("mousemove",(L,P)=>{L.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:_.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:_.GroupDataMap.get(A)??[],groupIndex:S,groupLabel:A,event:L,data:_.computedData})}).on("mouseout",(L,P)=>{L.stopPropagation(),a=!1,r.event$.next({type:"grid",pluginName:n,eventName:"mouseout",highlightTarget:_.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:_.GroupDataMap.get(A)??[],groupIndex:S,groupLabel:A,event:L,data:_.computedData})}).on("click",(L,P)=>{L.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:_.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:_.GroupDataMap.get(A)??[],groupIndex:S,groupLabel:A,event:L,data:_.computedData})})});const x=ea(s,"mouseout").pipe(k(o));return Y({rootRectMouseout:x,axesSelection:u}).pipe(k(o),G(async _=>_)).subscribe(_=>{setTimeout(()=>{a!=!0&&(HI(_.axesSelection),qI(_.axesSelection))})}),()=>{o.next(void 0),s.remove()}}),T2={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"},fp={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!0,axisLineColorType:"primary",ticks:"all",tickFormat:t=>t,tickLineVisible:!0,tickPadding:20,tickFullLine:!1,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary",gridIndexes:[0]};fp.tickFormat.toString=()=>"text => text";const eu={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]},KI={...eu},P2={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1,gridIndexes:[0]},D2={barWidth:0,barGroupPadding:10,barRadius:!1,gridIndexes:[0]},M2={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0],gridIndexes:[0]},C2={lineCurve:"curveLinear",lineWidth:2,gridIndexes:[1]},L2={lineCurve:"curveLinear",linearGradientOpacity:[1,0],gridIndexes:[1]},k2={radius:4,fillColorType:"white",strokeColorType:"series",strokeWidth:2,onlyShowHighlighted:!1,gridIndexes:[1]},hp={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]},R2={...hp},pp={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(t,{styles:e,utils:n})=>{const r=e.textSizePx*.7,i=e.textSizePx/2-r/2,o=`<g><text dominant-baseline="hanging" font-size="${e.textSizePx}">${t.groupLabel}</text></g>`,a=t.groups.reduce((c,f)=>{const h=`${f.seriesLabel}${f.value}`;return h.length>c.length?h:c},""),l=n.measureTextWidth(a,e.textSizePx)+e.textSizePx*2,u=t.groups.map((c,f)=>{const h=f*e.textSizePx*1.5,p=c.id===(t.datum&&t.datum.id);return`<g transform="translate(0, ${e.textSizePx*2})">
56
+ </text>`:""}function dB({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]:[],f=a?[s]:[],p=e.selectAll(`g.${n}`).data(c).join(A=>A.append("g").classed(n,!0).attr("pointer-events","none"),A=>A,A=>A.style("opacity",0).remove()).attr("transform",()=>`translate(${l.offsetX}, ${l.offsetY})`).selectAll(`g.${r}`).data(f).join(A=>A.append("g").classed(Z(t,"box"),!0)),d=p.selectAll("rect").data(f).join(A=>A.append("rect").attr("rx",u).attr("ry",u)).attr("fill",A=>A.backgroundColor).attr("stroke",A=>A.strokeColor).attr("opacity",A=>A.backgroundOpacity),m=p.selectAll("g").data(c).join(A=>A.append("g").classed(Z(t,"content"),!0).attr("transform",()=>`translate(${s.padding}, ${s.padding})`));c.length&&pI(m,c[0]);const g=m!=null&&m.node()?o$(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()?o$(p):{width:0,height:0},b=i-y.width,v=o-y.height,x=l.offsetX+s.offset[0]>b?b-l.offsetX:s.offset[0],_=l.offsetY+s.offset[1]>v?v-l.offsetY:s.offset[1];p.attr("transform",A=>`translate(${x}, ${_})`),p.attr("transform",A=>`translate(${x}, ${_})`)}const Bi=(e,{rootSelection:t,fullParams$:n,fullChartParams$:r,layout$:i,event$:o})=>{const a=new J,s=Z(e,"g"),l=Z(e,"box"),u=o.pipe(L(a),Rr(b=>b.eventName==="mouseover"||b.eventName==="mousemove")),c=o.pipe(L(a),Rr(b=>b.eventName==="mouseout")),f=QP(r),h=Y({fullChartParams:r,fullParams:n,textSizePx:f}).pipe(L(a),G(async b=>b),R(b=>({backgroundColor:be(b.fullParams.backgroundColorType,b.fullChartParams),backgroundOpacity:b.fullParams.backgroundOpacity,strokeColor:be(b.fullParams.strokeColorType,b.fullChartParams),offset:b.fullParams.offset,padding:b.fullParams.padding,textSize:b.fullChartParams.styles.textSize,textSizePx:b.textSizePx,textColor:be(b.fullParams.textColorType,b.fullChartParams),seriesColors:b.fullChartParams.colors[b.fullChartParams.colorScheme].label}))),p=Y({fullParams:n,tooltipStyle:h}).pipe(L(a),G(async b=>b),R(b=>v=>{const x=b.fullParams.renderFn(v,{utils:{measureTextWidth:fa},styles:b.tooltipStyle});if(typeof x=="string"){const _=x.trim();if(_.slice(0,1)==="<"&&_.slice(_.length-1,_.length)===">")return x;{const S=x.split(`
57
+ `);return I$(S,b.tooltipStyle)}}else if(Array.isArray(x))return I$(x,b.tooltipStyle);return""})),d=Y({event:u,contentRenderFn:p}).pipe(L(a),G(async b=>b),R(b=>b.contentRenderFn(b.event))),m=c.pipe(L(a),R(b=>"")),g=Bu(d,m).pipe(L(a),ee((b,v)=>b===v)),y=Bu(u,c).pipe(L(a),R(b=>b.event));return Y({svgString:g,eventTooltip:y,layout:i,tooltipStyle:h}).pipe(L(a),G(async b=>b)).subscribe(b=>{dB({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)}},B$="GridTooltip",gB=st({name:B$,defaultParams:vu,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 J,a=Bi(B$,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),mB=st({name:"GridZoom",defaultParams:od,layerIndex:l$,validator:(e,{validateColumns:t})=>({status:"success",columnName:"",expectToBe:""})})(({selection:e,rootSelection:t,name:n,observer:r,subject:i})=>{const o=new J;let a={k:1,x:0,y:0};const s=r.computedData$.pipe(R(c=>c[0]?c[0].length-1:0),ee()),l=r.fullDataFormatter$.pipe(R(c=>c.groupAxis),Xi()),u=Y({initGroupAxis:l,groupMaxIndex:s,layout:r.layout$,axisSize:r.gridAxesSize$}).pipe(L(o),G(async c=>c),R(c=>{const f=c.initGroupAxis.scaleDomain[0]-c.initGroupAxis.scalePadding,h=c.initGroupAxis.scaleDomain[1]==="max"?c.groupMaxIndex+c.initGroupAxis.scalePadding:c.initGroupAxis.scaleDomain[1]+c.initGroupAxis.scalePadding;return ro({maxValue:c.groupMaxIndex,minValue:0,axisWidth:c.axisSize.width,scaleDomain:[f,h],scaleRange:[0,1]})}));return Y({initGroupScale:u,fullDataFormatter:r.fullDataFormatter$,groupMaxIndex:s}).pipe(L(o),G(async c=>c)).subscribe(c=>{const h=c.initGroupScale.copy(),p=yn().on("zoom",function(m){const g=m.transform,y=x=>{const _=Math.round(x);return Math.min(c.groupMaxIndex,Math.max(0,_))},b=c.fullDataFormatter.groupAxis.position==="bottom"||c.fullDataFormatter.groupAxis.position==="top"?g.rescaleX(h).domain().map(y):g.rescaleY(h).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 v={...c.fullDataFormatter,groupAxis:{...c.fullDataFormatter.groupAxis,scaleDomain:b}};i.dataFormatter$.next(v)});t.call(p)}),()=>{o.next(void 0),t.call(yn().on("zoom",null))}}),hu="GroupAux",wp=Z(hu,"label-box"),yB={name:hu,defaultParams:bu,layerIndex:u$,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 bB({groupLabel:e,axisX:t,axisHeight:n,fullParams:r}){return r.showLine&&e?[{id:e,x1:t,x2:t,y1:0,y2:n}]:[]}function xB({groupLabel:e,axisX:t,fullParams:n,textSizePx:r,rowAmount:i}){const o=wr(e,n.labelTextFormat),a=o.split(`
58
+ `),s=a.reduce((c,f)=>f.length>c.length?f:c,""),l=fa(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 vB({selection:e,pluginName:t,lineData:n,fullParams:r,fullChartParams:i}){const o=Z(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=>be(r.lineColorType,i)).style("stroke-dasharray",r.lineDashArray??"none")}function $B(e){e.selectAll("line").data([]).exit().remove()}function _B({selection:e,labelData:t,fullParams:n,fullDataFormatter:r,fullChartParams:i,textReverseTransformWithRotate:o,textSizePx:a}){return e.selectAll(`g.${wp}`).data(t).join(l=>l.append("g").classed(wp,!0).style("cursor","pointer").attr("transform",(u,c)=>`translate(${u.x}, ${u.y})`),l=>l.transition().duration(50).attr("transform",(c,f)=>`translate(${c.x}, ${c.y})`),l=>l.remove()).each((l,u,c)=>{const f=l.textWidth+12,h=l.textHeight+6;let p=-f/2,d=-2;r.groupAxis.position==="bottom"?(p=n.labelRotate?-f+h:-f/2,d=2):r.groupAxis.position==="left"?(p=-f+2,d=-h/2):r.groupAxis.position==="right"?(p=-2,d=-h/2):r.groupAxis.position==="top"&&(p=n.labelRotate?-f+h:-f/2,d=-h+2),V(c[u]).selectAll("rect").data([l]).join(m=>m.append("rect").style("cursor","pointer").attr("rx",5).attr("ry",5),m=>m,m=>m.remove()).attr("width",m=>`${f}px`).attr("height",`${h}px`).attr("fill",m=>be(n.labelColorType,i)).attr("x",p).attr("y",d-3).style("transform",o),V(c[u]).selectAll("text").data([l]).join(m=>m.append("text").style("dominant-baseline","hanging").style("cursor","pointer"),m=>m,m=>m.remove()).style("transform",o).attr("fill",m=>be(n.labelTextColorType,i)).attr("font-size",i.styles.textSize).attr("x",p+6).attr("y",d).each((m,g,y)=>{Sp(V(y[g]),{textArr:l.textArr,textSizePx:a,groupAxisPosition:r.groupAxis.position})})})}function SB(e){e.selectAll(`g.${wp}`).data([]).exit().remove()}const wB=st(yB)(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new J;let a=!1;const s=t.insert("rect","g").classed(Z(hu,"rect"),!0).attr("opacity",0),{seriesSelection$:l,axesSelection$:u,defsSelection$:c,graphicGSelection$:f}=Tr({selection:e,pluginName:hu,clipPathID:"test",seriesLabels$:i.isSeriesSeprate$.pipe(G(_=>Wi(()=>_,i.seriesLabels$,i.seriesLabels$.pipe(R(A=>[A[0]]))))),gridContainerPosition$:i.gridContainerPosition$,gridAxesTransform$:i.gridAxesTransform$,gridGraphicTransform$:i.gridGraphicTransform$});i.layout$.pipe(L(o)).subscribe(_=>{s.attr("width",_.rootWidth).attr("height",_.rootHeight)});const h=Y({groupScaleDomainValue:i.groupScaleDomainValue$,gridAxesSize:i.gridAxesSize$}).pipe(L(o),G(async _=>_),R(_=>xr().domain(_.groupScaleDomainValue).range([0,_.gridAxesSize.width]))),p=i.fullChartParams$.pipe(L(o),R(_=>_.highlightTarget),ee()),d=ha(t,"mousemove").pipe(L(o)),m=Y({gridAxesReverseTransform:i.gridAxesReverseTransform$,gridContainerPosition:i.gridContainerPosition$}).pipe(L(o),G(async _=>_),R(_=>{const A=`rotateX(${_.gridAxesReverseTransform.rotateX}deg) rotateY(${_.gridAxesReverseTransform.rotateY}deg)`,S=`rotate(${_.gridAxesReverseTransform.rotate}deg)`,P=`scale(${1/_.gridContainerPosition[0].scale[0]}, ${1/_.gridContainerPosition[0].scale[1]})`;return`${A} ${S} ${P}`}),ee()),g=Y({textReverseTransform:m,fullParams:i.fullParams$}).pipe(L(o),G(async _=>_),R(_=>`${_.textReverseTransform} rotate(${_.fullParams.labelRotate}deg)`)),y=i.gridContainerPosition$.pipe(L(o),R(_=>_.reduce((S,P)=>P.columnIndex>S?P.columnIndex:S,0)+1),ee()),b=i.gridContainerPosition$.pipe(L(o),R(_=>_.reduce((S,P)=>P.rowIndex>S?P.rowIndex:S,0)+1),ee()),v=dI({rootSelection:t,fullDataFormatter$:i.fullDataFormatter$,gridAxesSize$:i.gridAxesSize$,computedData$:i.computedData$,fullChartParams$:i.fullChartParams$,gridContainerPosition$:i.gridContainerPosition$,layout$:i.layout$}).pipe(L(o));Y({axesSelection:u,columnAmount:y,rowAmount:b,layout:i.layout$,rootMousemove:d,gridGroupPosition:v,computedData:i.computedData$,groupScale:h,gridAxesSize:i.gridAxesSize$,fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,fullChartParams:i.fullChartParams$,highlightTarget:p,textReverseTransformWithRotate:g,GroupDataMap:i.GroupDataMap$,textSizePx:i.textSizePx$}).pipe(L(o),G(async _=>_)).subscribe(_=>{const{groupIndex:A,groupLabel:S}=_.gridGroupPosition,P=_.groupScale(A)??0,M=bB({groupLabel:S,axisX:P,axisHeight:_.gridAxesSize.height,fullParams:_.fullParams});vB({selection:_.axesSelection,pluginName:n,lineData:M,fullParams:_.fullParams,fullChartParams:_.fullChartParams});const B=xB({groupLabel:S,axisX:P,fullParams:_.fullParams,textSizePx:_.textSizePx,rowAmount:_.rowAmount});_B({selection:_.axesSelection,labelData:B,fullParams:_.fullParams,fullDataFormatter:_.fullDataFormatter,fullChartParams:_.fullChartParams,textReverseTransformWithRotate:_.textReverseTransformWithRotate,textSizePx:_.textSizePx}).on("mouseover",(k,C)=>{k.stopPropagation(),a=!0,r.event$.next({type:"grid",pluginName:n,eventName:"mouseover",highlightTarget:_.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:_.GroupDataMap.get(S)??[],groupIndex:A,groupLabel:S,event:k,data:_.computedData})}).on("mousemove",(k,C)=>{k.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"mousemove",highlightTarget:_.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:_.GroupDataMap.get(S)??[],groupIndex:A,groupLabel:S,event:k,data:_.computedData})}).on("mouseout",(k,C)=>{k.stopPropagation(),a=!1,r.event$.next({type:"grid",pluginName:n,eventName:"mouseout",highlightTarget:_.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:_.GroupDataMap.get(S)??[],groupIndex:A,groupLabel:S,event:k,data:_.computedData})}).on("click",(k,C)=>{k.stopPropagation(),r.event$.next({type:"grid",pluginName:n,eventName:"click",highlightTarget:_.highlightTarget,datum:null,gridIndex:0,series:[],seriesIndex:-1,seriesLabel:"",groups:_.GroupDataMap.get(S)??[],groupIndex:A,groupLabel:S,event:k,data:_.computedData})})});const x=ha(s,"mouseout").pipe(L(o));return Y({rootRectMouseout:x,axesSelection:u}).pipe(L(o),G(async _=>_)).subscribe(_=>{setTimeout(()=>{a!=!0&&($B(_.axesSelection),SB(_.axesSelection))})}),()=>{o.next(void 0),s.remove()}}),N$={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"},Tp={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]};Tp.tickFormat.toString=()=>"text => text";const pu={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]},TB={...pu},F$={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1,gridIndexes:[0]},z$={barWidth:0,barGroupPadding:10,barRadius:!1,gridIndexes:[0]},O$={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0],gridIndexes:[0]},G$={lineCurve:"curveLinear",lineWidth:2,gridIndexes:[1]},Y$={lineCurve:"curveLinear",linearGradientOpacity:[1,0],gridIndexes:[1]},W$={radius:4,fillColorType:"white",strokeColorType:"label",strokeWidth:2,onlyShowHighlighted:!1,gridIndexes:[1]},Ap={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]},X$={...Ap},Pp={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}">${e.groupLabel}</text></g>`,a=e.groups.reduce((c,f)=>{const h=`${f.seriesLabel}${f.value}`;return h.length>c.length?h:c},""),l=n.measureTextWidth(a,t.textSizePx)+t.textSizePx*2,u=e.groups.map((c,f)=>{const h=f*t.textSizePx*1.5,p=c.id===(e.datum&&e.datum.id);return`<g transform="translate(0, ${t.textSizePx*2})">
59
59
  <rect width="${r}" height="${r}" x="${i}" y="${h+i}" rx="${r/2}" fill="${c.color}"></rect>
60
- <text x="${e.textSizePx*1.5}" y="${h}" font-size="${e.textSizePx}" dominant-baseline="hanging" fill="${e.textColor}">
60
+ <text x="${t.textSizePx*1.5}" y="${h}" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
61
61
  <tspan font-weight="${p?"bold":""}">${c.seriesLabel}</tspan>
62
62
  <tspan font-weight="bold" text-anchor="end" x="${l}">${c.value}</tspan>
63
63
  </text>
64
64
  </g>`}).join("");return`${o}
65
- ${u}`}};pp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
65
+ ${u}`}};Pp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
66
66
  const bulletWidth = styles.textSizePx * 0.7
67
67
  const offset = (styles.textSizePx / 2) - (bulletWidth / 2)
68
68
 
@@ -88,15 +88,15 @@ ${u}`}};pp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
88
88
  .join('')
89
89
  return \`\${titleSvg}
90
90
  \${contentSvg}\`
91
- }`;const E2="MultiGridLegend",QI=ce({name:E2,defaultParams:T2,layerIndex:na,validator:(t,{validateColumns:e})=>{const n=e(t,{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(t.gridList){const i=t.gridList.map((o,a)=>e(o,{listRectWidth:{toBeTypes:["number"]},listRectHeight:{toBeTypes:["number"]},listRectRadius:{toBeTypes:["number"]}})).find(o=>o.status==="error");if(i)return i}return n}})(({selection:t,rootSelection:e,observer:n,subject:r})=>{const i=new tt,o=n.multiGridEachDetail$.pipe(k(i),B(u=>u.map((f,h)=>f.SeriesDataMap$.pipe(B(p=>Array.from(p.keys()))))),G(u=>Y(u)),B(u=>u.flat())),a=Y({fullParams:n.fullParams$,computedData:n.computedData$}).pipe(k(i),G(async u=>u),B(u=>u.computedData.map((c,f)=>{const h=Pu(u.fullParams.gridList[f]??{},{listRectWidth:u.fullParams.listRectWidth,listRectHeight:u.fullParams.listRectHeight,listRectRadius:u.fullParams.listRectRadius});return c.map(p=>h)}).flat())),s=Y({fullParams:n.fullParams$,seriesList:a}).pipe(k(i),G(async u=>u),B(u=>({...u.fullParams,labelList:u.seriesList}))),l=ia(E2,{rootSelection:e,legendLabels$:o,fullParams$:s,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),l()}}),Ie=t=>{const e=t.fullParams$.pipe(B(n=>n.gridIndexes),Q(),yt(1));return Y({multiGridEachDetail:t.multiGridEachDetail$,gridIndexes:e}).pipe(B(n=>n.gridIndexes==="all"?n.multiGridEachDetail:n.gridIndexes.map(r=>n.multiGridEachDetail[r]??n.multiGridEachDetail[0])))},dp="MultiBars",I2=J(dp,"grid"),JI=ce({name:dp,defaultParams:P2,layerIndex:Ee,validator:(t,{validateColumns:e})=>e(t,{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:t,name:e,subject:n,observer:r})=>{const i=new tt,o=[];return Ie(r).pipe(k(i)).subscribe(s=>{o.forEach(l=>l()),t.selectAll(`g.${I2}`).data(s).join("g").attr("class",I2).each((l,u,c)=>{const f=H(c[u]),h=l.dataFormatter$.pipe(k(i),B(p=>p.grid.separateSeries),Q(),yt(1));o[u]=lp(dp,{selection:f,computedData$:l.computedData$,visibleComputedData$:l.visibleComputedData$,computedLayoutData$:l.computedLayoutData$,visibleComputedLayoutData$:l.visibleComputedLayoutData$,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$:l.gridHighlight$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),gp="MultiBarStack",B2=J(gp,"grid"),tB=ce({name:gp,defaultParams:D2,layerIndex:Ee,validator:(t,{validateColumns:e})=>e(t,{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:t,name:e,subject:n,observer:r})=>{const i=new tt,o=[];return Ie(r).pipe(k(i)).subscribe(s=>{o.forEach(l=>l()),t.selectAll(`g.${B2}`).data(s).join("g").attr("class",B2).each((l,u,c)=>{const f=H(c[u]),h=l.dataFormatter$.pipe(k(i),B(p=>p.grid.separateSeries),Q(),yt(1));o[u]=u2(gp,{selection:f,computedData$:l.computedData$,visibleComputedData$:l.visibleComputedData$,computedLayoutData$:l.computedLayoutData$,visibleComputedLayoutData$:l.visibleComputedLayoutData$,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$:l.gridHighlight$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),mp="MultiBarsTriangle",N2=J(mp,"grid"),eB=ce({name:mp,defaultParams:M2,layerIndex:Ee,validator:(t,{validateColumns:e})=>e(t,{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:t,name:e,subject:n,observer:r})=>{const i=new tt,o=[];return Ie(r).pipe(k(i)).subscribe(s=>{o.forEach(l=>l()),t.selectAll(`g.${N2}`).data(s).join("g").attr("class",N2).each((l,u,c)=>{const f=H(c[u]),h=l.dataFormatter$.pipe(k(i),B(p=>p.grid.separateSeries),Q(),yt(1));o[u]=p2(mp,{selection:f,computedData$:l.computedData$,visibleComputedData$:l.visibleComputedData$,computedLayoutData$:l.computedLayoutData$,visibleComputedLayoutData$:l.visibleComputedLayoutData$,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$:l.gridHighlight$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),yp="MultiLines",F2=J(yp,"grid"),nB=ce({name:yp,defaultParams:C2,layerIndex:Ee,validator:(t,{validateColumns:e})=>e(t,{gridIndexes:{toBe:'number[] | "all"',test:r=>r==="all"||Array.isArray(r)&&r.every(i=>typeof i=="number")},lineCurve:{toBeTypes:["string"]},lineWidth:{toBeTypes:["number"]}})})(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new tt,a=[],s=i.multiGridContainerPosition$.pipe(k(o),B(u=>u.flat()));return Ie(i).pipe(k(o)).subscribe(u=>{a.forEach(c=>c()),t.selectAll(`g.${F2}`).data(u).join("g").attr("class",F2).each((c,f,h)=>{const p=H(h[f]);a[f]=Kv(yp,{selection:p,computedData$:c.computedData$,computedLayoutData$:c.computedLayoutData$,visibleComputedData$:c.visibleComputedData$,visibleComputedLayoutData$:c.visibleComputedLayoutData$,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$:c.gridHighlight$,gridContainerPosition$:c.gridContainerPosition$,allContainerPosition$:s,layout$:i.layout$,event$:r.event$})})}),()=>{o.next(void 0),a.forEach(u=>u())}}),bp="MultiLineAreas",O2=J(bp,"grid"),rB=ce({name:bp,defaultParams:L2,layerIndex:t2,validator:(t,{validateColumns:e})=>e(t,{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:t,name:e,subject:n,observer:r})=>{const i=new tt,o=[],a=r.multiGridContainerPosition$.pipe(k(i),B(l=>l.flat()));return Ie(r).pipe(k(i)).subscribe(l=>{o.forEach(u=>u()),t.selectAll(`g.${O2}`).data(l).join("g").attr("class",O2).each((u,c,f)=>{const h=H(f[c]);o[c]=n2(bp,{selection:h,computedData$:u.computedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedData$:u.visibleComputedData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,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$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,allContainerPosition$:a,layout$:r.layout$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(l=>l())}}),xp="MultiDots",z2=J(xp,"grid"),iB=ce({name:xp,defaultParams:k2,layerIndex:Jl,validator:(t,{validateColumns:e})=>e(t,{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:t,name:e,subject:n,observer:r})=>{const i=new tt,o=[];return Ie(r).pipe(k(i)).subscribe(s=>{o.forEach(l=>l()),t.selectAll(`g.${z2}`).data(s).join("g").attr("class",z2).each((l,u,c)=>{const f=H(c[u]);o[u]=g2(xp,{selection:f,computedData$:l.computedData$,visibleComputedData$:l.visibleComputedData$,computedLayoutData$:l.computedLayoutData$,visibleComputedLayoutData$:l.visibleComputedLayoutData$,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$:l.gridHighlight$,gridContainerPosition$:l.gridContainerPosition$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),vp="MultiGroupAxis",G2=J(vp,"grid"),oB=ce({name:vp,defaultParams:fp,layerIndex:gn,validator:(t,{validateColumns:e})=>e(t,{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:t,name:e,subject:n,observer:r})=>{const i=new tt,o=[];return Ie(r).pipe(k(i)).subscribe(s=>{o.forEach(l=>l()),t.selectAll(`g.${G2}`).data(s).join("g").attr("class",G2).each((l,u,c)=>{const f=H(c[u]),h=l.dataFormatter$.pipe(k(i),B(p=>p.grid.separateSeries),Q(),yt(1));o[u]=v2(vp,{selection:f,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$:h,textSizePx$:r.textSizePx$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),$p="MultiValueAxis",Y2=J($p,"grid"),aB=ce({name:$p,defaultParams:eu,layerIndex:gn,validator:(t,{validateColumns:e})=>e(t,{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:t,name:e,subject:n,observer:r})=>{const i=new tt,o=[];return Ie(r).pipe(k(i)).subscribe(s=>{o.forEach(l=>l()),t.selectAll(`g.${Y2}`).data(s).join("g").attr("class",Y2).each((l,u,c)=>{const f=H(c[u]),h=l.dataFormatter$.pipe(k(i),B(p=>p.grid.separateSeries),Q(),yt(1));o[u]=Ti($p,{selection:f,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$:h})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),X2="MultiGridTooltip",sB=ce({name:X2,defaultParams:pp,layerIndex:ra,validator:(t,{validateColumns:e})=>e(t,{backgroundColorType:{toBeOption:"ColorType"},backgroundOpacity:{toBeTypes:["number"]},strokeColorType:{toBeOption:"ColorType"},offset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},padding:{toBeTypes:["number"]},textColorType:{toBeOption:"ColorType"},renderFn:{toBeTypes:["Function"]}})})(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new tt,a=oa(X2,{rootSelection:e,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),_p="MultiValueStackAxis",V2=J(_p,"grid"),lB=ce({name:_p,defaultParams:eu,layerIndex:gn,validator:(t,{validateColumns:e})=>e(t,{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:t,name:e,subject:n,observer:r})=>{const i=new tt,o=[];return Ie(r).pipe(k(i)).subscribe(s=>{o.forEach(l=>l()),t.selectAll(`g.${V2}`).data(s).join("g").attr("class",V2).each((l,u,c)=>{const f=H(c[u]),h=l.dataFormatter$.pipe(k(i),B(p=>p.grid.separateSeries),Q(),yt(1));o[u]=Ti(_p,{selection:f,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$:h})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),wp="OverlappingValueAxes",W2=J(wp,"grid"),uB=ce({name:wp,defaultParams:hp,layerIndex:gn,validator:(t,{validateColumns:e})=>{const n=e(t,{firstAxis:{toBeTypes:["object"]},secondAxis:{toBeTypes:["object"]},gridIndexes:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2}});if(t.firstAxis){const r=e(t.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(t.secondAxis){const r=e(t.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:t,name:e,subject:n,observer:r})=>{const i=new tt,o=[],a=r.fullParams$.pipe(k(i),B(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(k(i),B(c=>c.gridIndexes[1])),l=Y({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(k(i),G(async c=>c),B(c=>{c.fullDataFormatter.gridList[c.secondGridIndex]||(c.fullDataFormatter.gridList[c.secondGridIndex]=Object.assign({},c.fullDataFormatter.gridList[c.firstGridIndex]));const f=c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;let h=f;return f==="left"?h="right":f==="bottom"?h="top":f==="top"?h="bottom":f==="right"&&(h="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,grid:{...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:h}},container:{...c.fullDataFormatter.container}}}));return da(r).pipe(k(i),B(c=>({...c,fullParams$:c.fullParams$.pipe(B(f=>(f.gridIndexes.length>2&&(f.gridIndexes.length=2),f)))})),G(c=>Ie(c)),B(c=>c.map((f,h)=>{if(h===0)return f;const p=Jg({fullDataFormatter$:l,layout$:r.layout$}),d=t0({gridAxesTransform$:p}),m=Qg({computedData$:f.computedData$,fullDataFormatter$:l,layout$:r.layout$});return{...f,dataFormatter$:l,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:m}}))).pipe(k(i)).subscribe(c=>{o.forEach(f=>f()),t.selectAll(`g.${W2}`).data(c).join("g").attr("class",W2).each((f,h,p)=>{if(h>1)return;const d=H(p[h]);o[h]=Ti(wp,{selection:d,computedData$:f.computedData$,filteredMinMaxValue$:f.filteredMinMaxValue$,fullParams$:r.fullParams$.pipe(B(m=>h===0?m.firstAxis:m.secondAxis)),fullDataFormatter$:f.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:f.gridAxesTransform$,gridAxesReverseTransform$:f.gridAxesReverseTransform$,gridAxesSize$:f.gridAxesSize$,gridContainerPosition$:f.gridContainerPosition$,isSeriesSeprate$:f.isSeriesSeprate$})})}),()=>{i.next(void 0),o.forEach(c=>c())}}),Sp="OverlappingValueStackAxes",U2=J(Sp,"grid"),cB=ce({name:Sp,defaultParams:R2,layerIndex:gn,validator:(t,{validateColumns:e})=>{const n=e(t,{firstAxis:{toBeTypes:["object"]},secondAxis:{toBeTypes:["object"]},gridIndexes:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2}});if(t.firstAxis){const r=e(t.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(t.secondAxis){const r=e(t.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:t,name:e,subject:n,observer:r})=>{const i=new tt,o=[],a=r.fullParams$.pipe(k(i),B(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(k(i),B(c=>c.gridIndexes[1])),l=Y({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(k(i),G(async c=>c),B(c=>{c.fullDataFormatter.gridList[c.secondGridIndex]||(c.fullDataFormatter.gridList[c.secondGridIndex]=Object.assign({},c.fullDataFormatter.gridList[c.firstGridIndex]));const f=c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;let h=f;return f==="left"?h="right":f==="bottom"?h="top":f==="top"?h="bottom":f==="right"&&(h="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,grid:{...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:h}},container:{...c.fullDataFormatter.container}}}));return da(r).pipe(k(i),B(c=>({...c,fullParams$:c.fullParams$.pipe(B(f=>(f.gridIndexes.length>2&&(f.gridIndexes.length=2),f)))})),G(c=>Ie(c)),B(c=>c.map((f,h)=>{if(h===0)return f;const p=Jg({fullDataFormatter$:l,layout$:r.layout$}),d=t0({gridAxesTransform$:p}),m=Qg({computedData$:f.computedData$,fullDataFormatter$:l,layout$:r.layout$});return{...f,dataFormatter$:l,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:m}}))).pipe(k(i)).subscribe(c=>{o.forEach(f=>f()),t.selectAll(`g.${U2}`).data(c).join("g").attr("class",U2).each((f,h,p)=>{if(h>1)return;const d=H(p[h]);o[h]=Ti(Sp,{selection:d,computedData$:h===0?f.computedStackedData$:f.computedData$,filteredMinMaxValue$:f.filteredMinMaxValue$,fullParams$:r.fullParams$.pipe(B(m=>h===0?m.firstAxis:m.secondAxis)),fullDataFormatter$:f.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:f.gridAxesTransform$,gridAxesReverseTransform$:f.gridAxesReverseTransform$,gridAxesSize$:f.gridAxesSize$,gridContainerPosition$:f.gridContainerPosition$,isSeriesSeprate$:f.isSeriesSeprate$})})}),()=>{i.next(void 0),o.forEach(c=>c())}}),H2={placement:"bottom",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},Ap={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(t,{styles:e,utils:n})=>{const r=t.categoryLabel!=="",i=t.datum.label.slice(0,11)!=="multiValue_",o=e.textSizePx*.7,a=e.textSizePx/2-o/2,s=r?`<rect width="${o}" height="${o}" x="${a}" y="${a-1}" rx="${o/2}" fill="${t.datum.color}"></rect>
92
- <text x="${e.textSizePx*1.5}" font-size="${e.textSizePx}" dominant-baseline="hanging" fill="${e.textColor}">
93
- <tspan>${t.categoryLabel}</tspan>
94
- </text>`:"",l=i?`<tspan>${t.datum.label}</tspan> `:"",u=`<text font-size="${e.textSizePx}" dominant-baseline="hanging" fill="${e.textColor}">
95
- ${l}<tspan font-weight="bold">${t.datum.value}</tspan>
91
+ }`;const V$="MultiGridLegend",AB=dt({name:V$,defaultParams:N$,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 J,o=n.multiGridEachDetail$.pipe(L(i),R(u=>u.map((f,h)=>f.SeriesDataMap$.pipe(R(p=>Array.from(p.keys()))))),G(u=>Y(u)),R(u=>u.flat())),a=Y({fullParams:n.fullParams$,computedData:n.computedData$}).pipe(L(i),G(async u=>u),R(u=>u.computedData.map((c,f)=>{const h=Fu(u.fullParams.gridList[f]??{},{listRectWidth:u.fullParams.listRectWidth,listRectHeight:u.fullParams.listRectHeight,listRectRadius:u.fullParams.listRectRadius});return c.map(p=>h)}).flat())),s=Y({fullParams:n.fullParams$,seriesList:a}).pipe(L(i),G(async u=>u),R(u=>({...u.fullParams,labelList:u.seriesList}))),l=Ei(V$,{rootSelection:t,legendLabels$:o,fullParams$:s,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),l()}}),Ft=e=>{const t=e.fullParams$.pipe(R(n=>n.gridIndexes),ee(),pe(1));return Y({multiGridEachDetail:e.multiGridEachDetail$,gridIndexes:t}).pipe(R(n=>n.gridIndexes==="all"?n.multiGridEachDetail:n.gridIndexes.map(r=>n.multiGridEachDetail[r]??n.multiGridEachDetail[0])))},Dp="MultiBars",U$=Z(Dp,"grid"),PB=dt({name:Dp,defaultParams:F$,layerIndex:bt,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 J,o=[];return Ft(r).pipe(L(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${U$}`).data(s).join("g").attr("class",U$).each((l,u,c)=>{const f=V(c[u]),h=l.dataFormatter$.pipe(L(i),R(p=>p.separateSeries),ee(),pe(1));o[u]=_p(Dp,{selection:f,computedData$:l.computedData$,visibleComputedData$:l.visibleComputedData$,computedLayoutData$:l.computedLayoutData$,visibleComputedLayoutData$:l.visibleComputedLayoutData$,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$:l.gridHighlight$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Mp="MultiStackedBar",H$=Z(Mp,"grid"),DB=dt({name:Mp,defaultParams:z$,layerIndex:bt,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 J,o=[];return Ft(r).pipe(L(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${H$}`).data(s).join("g").attr("class",H$).each((l,u,c)=>{const f=V(c[u]),h=l.dataFormatter$.pipe(L(i),R(p=>p.separateSeries),ee(),pe(1));o[u]=x$(Mp,{selection:f,computedData$:l.computedData$,visibleComputedData$:l.visibleComputedData$,computedLayoutData$:l.computedLayoutData$,visibleComputedLayoutData$:l.visibleComputedLayoutData$,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$:l.gridHighlight$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Cp="MultiBarsTriangle",j$=Z(Cp,"grid"),MB=dt({name:Cp,defaultParams:O$,layerIndex:bt,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 J,o=[];return Ft(r).pipe(L(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${j$}`).data(s).join("g").attr("class",j$).each((l,u,c)=>{const f=V(c[u]),h=l.dataFormatter$.pipe(L(i),R(p=>p.separateSeries),ee(),pe(1));o[u]=S$(Cp,{selection:f,computedData$:l.computedData$,visibleComputedData$:l.visibleComputedData$,computedLayoutData$:l.computedLayoutData$,visibleComputedLayoutData$:l.visibleComputedLayoutData$,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$:l.gridHighlight$,gridContainerPosition$:l.gridContainerPosition$,isSeriesSeprate$:h,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Lp="MultiLines",q$=Z(Lp,"grid"),CB=dt({name:Lp,defaultParams:G$,layerIndex:bt,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 J,a=[],s=i.multiGridContainerPosition$.pipe(L(o),R(u=>u.flat()));return Ft(i).pipe(L(o)).subscribe(u=>{a.forEach(c=>c()),e.selectAll(`g.${q$}`).data(u).join("g").attr("class",q$).each((c,f,h)=>{const p=V(h[f]);a[f]=s$(Lp,{selection:p,computedData$:c.computedData$,computedLayoutData$:c.computedLayoutData$,visibleComputedData$:c.visibleComputedData$,visibleComputedLayoutData$:c.visibleComputedLayoutData$,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$:c.gridHighlight$,gridContainerPosition$:c.gridContainerPosition$,allContainerPosition$:s,layout$:i.layout$,event$:r.event$})})}),()=>{o.next(void 0),a.forEach(u=>u())}}),kp="MultiLineAreas",Z$=Z(kp,"grid"),LB=dt({name:kp,defaultParams:Y$,layerIndex:c$,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 J,o=[],a=r.multiGridContainerPosition$.pipe(L(i),R(l=>l.flat()));return Ft(r).pipe(L(i)).subscribe(l=>{o.forEach(u=>u()),e.selectAll(`g.${Z$}`).data(l).join("g").attr("class",Z$).each((u,c,f)=>{const h=V(f[c]);o[c]=h$(kp,{selection:h,computedData$:u.computedData$,computedLayoutData$:u.computedLayoutData$,visibleComputedData$:u.visibleComputedData$,visibleComputedLayoutData$:u.visibleComputedLayoutData$,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$:u.gridHighlight$,gridContainerPosition$:u.gridContainerPosition$,allContainerPosition$:a,layout$:r.layout$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(l=>l())}}),Rp="MultiDots",K$=Z(Rp,"grid"),kB=dt({name:Rp,defaultParams:W$,layerIndex:fu,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 J,o=[];return Ft(r).pipe(L(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${K$}`).data(s).join("g").attr("class",K$).each((l,u,c)=>{const f=V(c[u]);o[u]=T$(Rp,{selection:f,computedData$:l.computedData$,visibleComputedData$:l.visibleComputedData$,computedLayoutData$:l.computedLayoutData$,visibleComputedLayoutData$:l.visibleComputedLayoutData$,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$:l.gridHighlight$,gridContainerPosition$:l.gridContainerPosition$,event$:n.event$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Ep="MultiGroupAxis",Q$=Z(Ep,"grid"),RB=dt({name:Ep,defaultParams:Tp,layerIndex:bn,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 J,o=[];return Ft(r).pipe(L(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${Q$}`).data(s).join("g").attr("class",Q$).each((l,u,c)=>{const f=V(c[u]),h=l.dataFormatter$.pipe(L(i),R(p=>p.separateSeries),ee(),pe(1));o[u]=L$(Ep,{selection:f,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$:h,textSizePx$:r.textSizePx$})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Ip="MultiValueAxis",J$=Z(Ip,"grid"),EB=dt({name:Ip,defaultParams:pu,layerIndex:bn,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 J,o=[];return Ft(r).pipe(L(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${J$}`).data(s).join("g").attr("class",J$).each((l,u,c)=>{const f=V(c[u]),h=l.dataFormatter$.pipe(L(i),R(p=>p.separateSeries),ee(),pe(1));o[u]=Ii(Ip,{selection:f,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$:h})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),e2="MultiGridTooltip",IB=dt({name:e2,defaultParams:Pp,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 J,a=Bi(e2,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),Bp="MultiStackedValueAxis",t2=Z(Bp,"grid"),BB=dt({name:Bp,defaultParams:pu,layerIndex:bn,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 J,o=[];return Ft(r).pipe(L(i)).subscribe(s=>{o.forEach(l=>l()),e.selectAll(`g.${t2}`).data(s).join("g").attr("class",t2).each((l,u,c)=>{const f=V(c[u]),h=l.dataFormatter$.pipe(L(i),R(p=>p.separateSeries),ee(),pe(1));o[u]=Ii(Bp,{selection:f,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$:h})})}),()=>{i.next(void 0),o.forEach(s=>s())}}),Np="OverlappingValueAxes",n2=Z(Np,"grid"),NB=dt({name:Np,defaultParams:Ap,layerIndex:bn,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 J,o=[],a=r.fullParams$.pipe(L(i),R(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(L(i),R(c=>c.gridIndexes[1])),l=Y({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(L(i),G(async c=>c),R(c=>{c.fullDataFormatter.gridList[c.secondGridIndex]||(c.fullDataFormatter.gridList[c.secondGridIndex]=Object.assign({},c.fullDataFormatter.gridList[c.firstGridIndex]));const f=c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;let h=f;return f==="left"?h="right":f==="bottom"?h="top":f==="top"?h="bottom":f==="right"&&(h="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:h},container:{...c.fullDataFormatter.container}}}));return _a(r).pipe(L(i),R(c=>({...c,fullParams$:c.fullParams$.pipe(R(f=>(f.gridIndexes.length>2&&(f.gridIndexes.length=2),f)))})),G(c=>Ft(c)),R(c=>c.map((f,h)=>{if(h===0)return f;const p=p0({fullDataFormatter$:l,layout$:r.layout$}),d=d0({gridAxesTransform$:p}),m=h0({computedData$:f.computedData$,fullDataFormatter$:l,layout$:r.layout$});return{...f,dataFormatter$:l,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:m}}))).pipe(L(i)).subscribe(c=>{o.forEach(f=>f()),e.selectAll(`g.${n2}`).data(c).join("g").attr("class",n2).each((f,h,p)=>{if(h>1)return;const d=V(p[h]);o[h]=Ii(Np,{selection:d,computedData$:f.computedData$,filteredMinMaxValue$:f.filteredMinMaxValue$,fullParams$:r.fullParams$.pipe(R(m=>h===0?m.firstAxis:m.secondAxis)),fullDataFormatter$:f.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:f.gridAxesTransform$,gridAxesReverseTransform$:f.gridAxesReverseTransform$,gridAxesSize$:f.gridAxesSize$,gridContainerPosition$:f.gridContainerPosition$,isSeriesSeprate$:f.isSeriesSeprate$})})}),()=>{i.next(void 0),o.forEach(c=>c())}}),Fp="OverlappingStackedValueAxes",r2=Z(Fp,"grid"),FB=dt({name:Fp,defaultParams:X$,layerIndex:bn,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 J,o=[],a=r.fullParams$.pipe(L(i),R(c=>c.gridIndexes[0])),s=r.fullParams$.pipe(L(i),R(c=>c.gridIndexes[1])),l=Y({firstGridIndex:a,secondGridIndex:s,fullDataFormatter:r.fullDataFormatter$}).pipe(L(i),G(async c=>c),R(c=>{c.fullDataFormatter.gridList[c.secondGridIndex]||(c.fullDataFormatter.gridList[c.secondGridIndex]=Object.assign({},c.fullDataFormatter.gridList[c.firstGridIndex]));const f=c.fullDataFormatter.gridList[c.firstGridIndex].valueAxis.position;let h=f;return f==="left"?h="right":f==="bottom"?h="top":f==="top"?h="bottom":f==="right"&&(h="left"),{type:"grid",visibleFilter:c.fullDataFormatter.visibleFilter,...c.fullDataFormatter.gridList[c.secondGridIndex],valueAxis:{...c.fullDataFormatter.gridList[c.secondGridIndex].valueAxis,position:h},container:{...c.fullDataFormatter.container}}}));return _a(r).pipe(L(i),R(c=>({...c,fullParams$:c.fullParams$.pipe(R(f=>(f.gridIndexes.length>2&&(f.gridIndexes.length=2),f)))})),G(c=>Ft(c)),R(c=>c.map((f,h)=>{if(h===0)return f;const p=p0({fullDataFormatter$:l,layout$:r.layout$}),d=d0({gridAxesTransform$:p}),m=h0({computedData$:f.computedData$,fullDataFormatter$:l,layout$:r.layout$});return{...f,dataFormatter$:l,gridAxesTransform$:p,gridAxesReverseTransform$:d,gridContainerPosition$:m}}))).pipe(L(i)).subscribe(c=>{o.forEach(f=>f()),e.selectAll(`g.${r2}`).data(c).join("g").attr("class",r2).each((f,h,p)=>{if(h>1)return;const d=V(p[h]);o[h]=Ii(Fp,{selection:d,computedData$:h===0?f.computedStackedData$:f.computedData$,filteredMinMaxValue$:f.filteredMinMaxValue$,fullParams$:r.fullParams$.pipe(R(m=>h===0?m.firstAxis:m.secondAxis)),fullDataFormatter$:f.dataFormatter$,fullChartParams$:r.fullChartParams$,gridAxesTransform$:f.gridAxesTransform$,gridAxesReverseTransform$:f.gridAxesReverseTransform$,gridAxesSize$:f.gridAxesSize$,gridContainerPosition$:f.gridContainerPosition$,isSeriesSeprate$:f.isSeriesSeprate$})})}),()=>{i.next(void 0),o.forEach(c=>c())}}),i2={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.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>
92
+ <text x="${t.textSizePx*1.5}" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
93
+ <tspan>${e.categoryLabel}</tspan>
94
+ </text>`:"",l=i?`<tspan>${e.datum.label}</tspan> `:"",u=`<text font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
95
+ ${l}<tspan font-weight="bold">${e.datum.value}</tspan>
96
96
  </text>`;return`${s}
97
- <g ${r?`transform="translate(0, ${e.textSizePx*2})"`:""}>
97
+ <g ${r?`transform="translate(0, ${t.textSizePx*2})"`:""}>
98
98
  ${u}
99
- </g>`}};Ap.renderFn.toString=()=>`(eventData, { styles, utils }) => {
99
+ </g>`}};zp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
100
100
  const hasCategoryLabel = eventData.categoryLabel === '' ? false : true
101
101
  const hasDatumLabel = eventData.datum.label.slice(0, 11) === 'multiValue_' ? false : true
102
102
  const bulletWidth = styles.textSizePx * 0.7
@@ -118,9 +118,9 @@ ${u}`}};pp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
118
118
  <g \${hasCategoryLabel ? \`transform="translate(0, \${styles.textSizePx * 2})"\` : ''}>
119
119
  \${datumSvg}
120
120
  </g>\`
121
- }`;const j2={radius:5,fillColorType:"series",strokeColorType:"series",strokeWidth:0},q2={fillColorType:"series",strokeColorType:"series",strokeWidth:0,valueLinearOpacity:[.8,.8],arcScaleType:"area",sizeAdjust:.5},nu={xAxis:{showLine:!0,showLabel:!0,lineDashArray:"3, 3",lineColorType:"primary",labelColorType:"primary",labelTextColorType:"background",labelTextFormat:t=>String(Math.round(t)),labelPadding:20},yAxis:{showLine:!0,showLabel:!0,lineDashArray:"3, 3",lineColorType:"primary",labelColorType:"primary",labelTextColorType:"background",labelTextFormat:t=>String(Math.round(t)),labelPadding:20}};nu.xAxis.labelTextFormat.toString=()=>"(value: number) => String(Math.round(value))",nu.yAxis.labelTextFormat.toString=()=>"(value: number) => String(Math.round(value))";const ru={xAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:null,tickFormat:t=>t,tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextColorType:"primary"},yAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:null,tickFormat:t=>t,tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextColorType:"primary"}};ru.xAxis.tickFormat.toString=()=>"v => v",ru.yAxis.tickFormat.toString=()=>"v => v";const Z2={},K2="MultiValueLegend",fB=Xn({name:K2,defaultParams:H2,layerIndex:na,validator:(t,{validateColumns:e})=>e(t,{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:t,rootSelection:e,observer:n,subject:r})=>{const i=new tt,o=n.CategoryDataMap$.pipe(k(i),B(l=>Array.from(l.keys()))),a=n.fullParams$.pipe(k(i),B(l=>{const u=[{listRectWidth:l.listRectWidth,listRectHeight:l.listRectHeight,listRectRadius:l.listRectRadius}];return{...l,labelList:u}})),s=ia(K2,{rootSelection:e,legendLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),Q2="MultiValueTooltip",hB=Xn({name:Q2,defaultParams:Ap,layerIndex:ra,validator:(t,{validateColumns:e})=>e(t,{backgroundColorType:{toBeOption:"ColorType"},backgroundOpacity:{toBeTypes:["number"]},strokeColorType:{toBeOption:"ColorType"},offset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},padding:{toBeTypes:["number"]},textColorType:{toBeOption:"ColorType"},renderFn:{toBeTypes:["Function"]}})})(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new tt,a=oa(Q2,{rootSelection:e,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),Tp=({selection:t,pluginName:e,clipPathID:n,categoryLabels$:r,multiValueContainerPosition$:i,multiValueGraphicTransform$:o})=>{const a=J(e,"category"),s=J(e,"axes"),l=J(e,"graphic"),u=r.pipe(B((p,d)=>t.selectAll(`g.${a}`).data(p,m=>m).join(m=>m.append("g").classed(a,!0).each((g,y,b)=>{H(b[y]).selectAll(`g.${s}`).data([y]).join(v=>v.append("g").classed(s,!0).attr("clip-path",`url(#${n})`).each((x,_,S)=>{H(S[_]).selectAll("defs").data([_]).join("defs"),H(S[_]).selectAll("g").data([_]).join("g").classed(l,!0)}),v=>v,v=>v.remove())}),m=>m,m=>m.remove())),yt(1));Y({categorySelection:u,multiValueContainerPosition:i}).pipe(G(async p=>p)).subscribe(p=>{p.categorySelection.transition().attr("transform",(d,m)=>{const g=p.multiValueContainerPosition[m]??p.multiValueContainerPosition[0],y=g.translate,b=g.scale;return`translate(${y[0]}, ${y[1]}) scale(${b[0]}, ${b[1]})`})});const c=u.pipe(B(p=>p.select(`g.${s}`)),yt(1)),f=c.pipe(B(p=>p.select("defs")),yt(1)),h=Y({axesSelection:c,multiValueGraphicTransform:o}).pipe(G(async p=>p),B(p=>{const d=p.axesSelection.select(`g.${l}`);return d.transition().duration(50).style("transform",p.multiValueGraphicTransform.value),d}),yt(1));return{categorySelection$:u,axesSelection$:c,defsSelection$:f,graphicGSelection$:h}},pB=({rootSelection:t,fullDataFormatter$:e,filteredMinMaxXYData$:n,multiValueContainerPosition$:r,layout$:i})=>{const o=ea(t,"mousemove").pipe(b_(2)),a=r.pipe(B(c=>c.reduce((h,p)=>p.columnIndex>h?p.columnIndex:h,0)+1),Q(),yt(1)),s=r.pipe(B(c=>c.reduce((h,p)=>p.rowIndex>h?p.rowIndex:h,0)+1),Q(),yt(1)),l=new pt(c=>{Y({layout:i,filteredMinMaxXYData:n,fullDataFormatter:e,columnAmount:a,rowAmount:s}).pipe(G(async f=>f)).subscribe(f=>{if(!f.filteredMinMaxXYData.minXDatum||!f.filteredMinMaxXYData.maxXDatum||f.filteredMinMaxXYData.minXDatum.value[0]==null||f.filteredMinMaxXYData.maxXDatum.value[0]==null||!f.filteredMinMaxXYData.minYDatum||!f.filteredMinMaxXYData.maxYDatum||f.filteredMinMaxXYData.minYDatum.value[1]==null||f.filteredMinMaxXYData.maxYDatum.value[1]==null)return;const h=Zg({maxValue:f.filteredMinMaxXYData.maxXDatum.value[0],minValue:f.filteredMinMaxXYData.minXDatum.value[0],axisWidth:f.layout.width,scaleDomain:f.fullDataFormatter.xAxis.scaleDomain,scaleRange:f.fullDataFormatter.xAxis.scaleRange}),p=Zg({maxValue:f.filteredMinMaxXYData.maxYDatum.value[1],minValue:f.filteredMinMaxXYData.minYDatum.value[1],axisWidth:f.layout.height,scaleDomain:f.fullDataFormatter.yAxis.scaleDomain,scaleRange:f.fullDataFormatter.yAxis.scaleRange,reverse:!0});c.next({xScale:h,yScale:p})})}),u=Y({fullDataFormatter:e,rootMousemove:o,columnAmount:a,rowAmount:s,layout:i,multiValueContainerPosition:r}).pipe(G(async c=>c),B(c=>({x:(c.rootMousemove.offsetX-c.layout.left)/c.multiValueContainerPosition[0].scale[0]%(c.layout.rootWidth/c.columnAmount/c.multiValueContainerPosition[0].scale[0]),y:(c.rootMousemove.offsetY-c.layout.top)/c.multiValueContainerPosition[0].scale[1]%(c.layout.rootHeight/c.rowAmount/c.multiValueContainerPosition[0].scale[1])})));return Y({xyScale:l,axisValue:u}).pipe(G(async c=>c),B(c=>({x:c.axisValue.x,y:c.axisValue.y,xValue:c.xyScale.xScale(c.axisValue.x),yValue:c.xyScale.yScale(c.axisValue.y)})))},mn="Scatter",dB={name:mn,defaultParams:j2,layerIndex:Jl,validator:(t,{validateColumns:e})=>e(t,{radius:{toBeTypes:["number"]},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]}})};function gB({graphicGSelection:t,circleGClassName:e,circleClassName:n,visibleComputedLayoutData:r,fullParams:i,fullChartParams:o,graphicReverseScale:a}){const s=c=>{const f=c.size();return o.transitionDuration/f};let l=0;return t.each((c,f,h)=>{H(h[f]).selectAll("g").data(r[f],p=>p.id).join(p=>(l=s(p),p.append("g").classed(e,!0)),p=>p,p=>p.remove()).attr("transform",p=>`translate(${p.axisX}, ${p.axisY})`).each((p,d,m)=>{H(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)=>we({datum:g,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(g,y)=>we({datum:g,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${a[f][0]??1}, ${a[f][1]??1})`)})}),t.selectAll(`circle.${n}`)}function mB({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{e.includes(r.id)?H(o[i]).style("opacity",1).transition("highlight").duration(200):H(o[i]).style("opacity",n.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function yB({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{H(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 bB=Xn(dB)(({selection:t,name:e,subject:n,observer:r})=>{const i=new tt,o=Ke(mn,"clipPath-box"),a=J(mn,"circleG"),s=J(mn,"circle"),{categorySelection$:l,axesSelection$:u,defsSelection$:c,graphicGSelection$:f}=Tp({selection:t,pluginName:mn,clipPathID:o,categoryLabels$:r.categoryLabels$,multiValueContainerPosition$:r.multiValueContainerPosition$,multiValueGraphicTransform$:r.multiValueGraphicTransform$}),h=Y({computedData:r.computedData$,multiValueGraphicReverseScale:r.multiValueGraphicReverseScale$}).pipe(k(i),G(async m=>m),B(m=>m.computedData.map((g,y)=>m.multiValueGraphicReverseScale[y])));Y({defsSelection:c,layout:r.layout$}).pipe(k(i),G(async m=>m)).subscribe(m=>{const g=[{id:o,width:m.layout.width,height:m.layout.height}];yB({defsSelection:m.defsSelection,clipPathData:g})});const p=Y({graphicGSelection:f,visibleComputedLayoutData:r.visibleComputedLayoutData$,graphicReverseScale:h,fullChartParams:r.fullChartParams$,fullParams:r.fullParams$}).pipe(k(i),G(async m=>m),B(m=>gB({graphicGSelection:m.graphicGSelection,circleGClassName:a,circleClassName:s,visibleComputedLayoutData:m.visibleComputedLayoutData,fullParams:m.fullParams,fullChartParams:m.fullChartParams,graphicReverseScale:m.graphicReverseScale}))),d=r.fullChartParams$.pipe(k(i),B(m=>m.highlightTarget),Q());return Y({graphicSelection:p,computedData:r.computedData$,CategoryDataMap:r.CategoryDataMap$,highlightTarget:d}).pipe(k(i),G(async m=>m)).subscribe(m=>{m.graphicSelection.on("mouseover",(g,y)=>{n.event$.next({type:"multiValue",eventName:"mouseover",pluginName:mn,highlightTarget:m.highlightTarget,datum:y,category:m.CategoryDataMap.get(y.categoryLabel),categoryIndex:y.categoryIndex,categoryLabel:y.categoryLabel,data:m.computedData,event:g})}).on("mousemove",(g,y)=>{n.event$.next({type:"multiValue",eventName:"mousemove",pluginName:mn,highlightTarget:m.highlightTarget,datum:y,category:m.CategoryDataMap.get(y.categoryLabel),categoryIndex:y.categoryIndex,categoryLabel:y.categoryLabel,data:m.computedData,event:g})}).on("mouseout",(g,y)=>{n.event$.next({type:"multiValue",eventName:"mouseout",pluginName:mn,highlightTarget:m.highlightTarget,datum:y,category:m.CategoryDataMap.get(y.categoryLabel),categoryIndex:y.categoryIndex,categoryLabel:y.categoryLabel,data:m.computedData,event:g})}).on("click",(g,y)=>{n.event$.next({type:"multiValue",eventName:"click",pluginName:mn,highlightTarget:m.highlightTarget,datum:y,category:m.CategoryDataMap.get(y.categoryLabel),categoryIndex:y.categoryIndex,categoryLabel:y.categoryLabel,data:m.computedData,event:g})})}),Y({graphicSelection:p,highlight:r.multiValueHighlight$.pipe(B(m=>m.map(g=>g.id))),fullChartParams:r.fullChartParams$}).pipe(k(i),G(async m=>m)).subscribe(m=>{mB({selection:m.graphicSelection,ids:m.highlight,fullChartParams:m.fullChartParams})}),()=>{i.next(void 0)}}),yn="ScatterBubbles",xB=.9,vB={name:yn,defaultParams:q2,layerIndex:Jl,validator:(t,{validateColumns:e})=>e(t,{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 $B({graphicGSelection:t,circleGClassName:e,circleClassName:n,bubbleData:r,fullParams:i,fullChartParams:o,graphicReverseScale:a}){const s=c=>{const f=c.size();return o.transitionDuration/f};let l=0;return t.each((c,f,h)=>{H(h[f]).selectAll("g").data(r[f],p=>p.id).join(p=>(l=s(p),p.append("g").classed(e,!0)),p=>p,p=>p.remove()).attr("transform",p=>`translate(${p.axisX}, ${p.axisY})`).each((p,d,m)=>{H(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",.8),g=>g.transition().duration(50).attr("opacity",.8),g=>g.remove()).attr("r",g=>g.r).attr("fill",(g,y)=>we({datum:g,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(g,y)=>we({datum:g,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${a[f][0]??1}, ${a[f][1]??1})`)})}),t.selectAll(`circle.${n}`)}function _B({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",r=>r.opacity);return}t.each((r,i,o)=>{e.includes(r.id)?H(o[i]).style("opacity",s=>s.opacity).transition("highlight").duration(200):H(o[i]).style("opacity",n.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function wB({defsSelection:t,clipPathData:e}){t.selectAll("clipPath").data(e).join(n=>n.append("clipPath"),n=>n,n=>n.remove()).attr("id",n=>n.id).each((n,r,i)=>{H(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 SB=Xn(vB)(({selection:t,name:e,subject:n,observer:r})=>{const i=new tt,o=Ke(yn,"clipPath-box"),a=J(yn,"circleG"),s=J(yn,"circle"),{categorySelection$:l,axesSelection$:u,defsSelection$:c,graphicGSelection$:f}=Tp({selection:t,pluginName:yn,clipPathID:o,categoryLabels$:r.categoryLabels$,multiValueContainerPosition$:r.multiValueContainerPosition$,multiValueGraphicTransform$:r.multiValueGraphicTransform$}),h=Y({computedData:r.computedData$,multiValueGraphicReverseScale:r.multiValueGraphicReverseScale$}).pipe(k(i),G(async A=>A),B(A=>A.computedData.map((T,C)=>A.multiValueGraphicReverseScale[C])));Y({defsSelection:c,layout:r.layout$}).pipe(k(i),G(async A=>A)).subscribe(A=>{const T=[{id:o,width:A.layout.width,height:A.layout.height}];wB({defsSelection:A.defsSelection,clipPathData:T})});const p=r.filteredMinMaxXYData$.pipe(k(i),B(A=>A.datumList.flat().map(T=>T.value[2]??0)),yt(1)),d=r.filteredMinMaxXYData$.pipe(k(i),B(A=>ST(A.datumList.flat().map(T=>T.value[2]??0)))),m=Y({filteredMinMaxValue:d,fullParams:r.fullParams$}).pipe(k(i),G(async A=>A),B(A=>yi().domain(A.filteredMinMaxValue).range(A.fullParams.valueLinearOpacity))),g=Y({layout:r.layout$,fullParams:r.fullParams$}).pipe(k(i),B(A=>Math.min(A.layout.width,A.layout.height)/2*A.fullParams.sizeAdjust)),y=p.pipe(k(i),B(A=>A.reduce((T,C)=>T+C,0)),Dr(A=>A>0)),b=Y({totalR:g,totalValue:y,fullParams:r.fullParams$}).pipe(k(i),G(async A=>A),B(A=>dr().domain([0,A.totalValue]).range([0,A.totalR]).exponent(A.fullParams.arcScaleType==="area"?.5:1))),v=Y({radiusScale:b,fullParams:r.fullParams$,totalR:g,filteredValueList:p}).pipe(k(i),G(async A=>A),B(A=>A.fullParams.arcScaleType==="area"?1:(()=>{const T=A.totalR*A.totalR*Math.PI;return Math.sqrt(T/dc(A.filteredValueList,C=>Math.PI*Math.pow(A.radiusScale(C),2)))})())),x=Y({computedLayoutData:r.computedLayoutData$,opacityScale:m,radiusScale:b,scaleFactor:v,fullParams:r.fullParams$}).pipe(k(i),G(async A=>A),B(A=>A.computedLayoutData.map(T=>T.map(C=>{const I=C;return I.r=A.radiusScale(I.value[2])*A.scaleFactor*xB,I.opacity=A.opacityScale(I.value[2]),I})))),_=Y({graphicGSelection:f,bubbleData:x,graphicReverseScale:h,fullChartParams:r.fullChartParams$,fullParams:r.fullParams$}).pipe(k(i),G(async A=>A),B(A=>$B({graphicGSelection:A.graphicGSelection,circleGClassName:a,circleClassName:s,bubbleData:A.bubbleData,fullParams:A.fullParams,fullChartParams:A.fullChartParams,graphicReverseScale:A.graphicReverseScale}))),S=r.fullChartParams$.pipe(k(i),B(A=>A.highlightTarget),Q());return Y({graphicSelection:_,computedData:r.computedData$,CategoryDataMap:r.CategoryDataMap$,highlightTarget:S}).pipe(k(i),G(async A=>A)).subscribe(A=>{A.graphicSelection.on("mouseover",(T,C)=>{n.event$.next({type:"multiValue",eventName:"mouseover",pluginName:yn,highlightTarget:A.highlightTarget,datum:C,category:A.CategoryDataMap.get(C.categoryLabel),categoryIndex:C.categoryIndex,categoryLabel:C.categoryLabel,data:A.computedData,event:T})}).on("mousemove",(T,C)=>{n.event$.next({type:"multiValue",eventName:"mousemove",pluginName:yn,highlightTarget:A.highlightTarget,datum:C,category:A.CategoryDataMap.get(C.categoryLabel),categoryIndex:C.categoryIndex,categoryLabel:C.categoryLabel,data:A.computedData,event:T})}).on("mouseout",(T,C)=>{n.event$.next({type:"multiValue",eventName:"mouseout",pluginName:yn,highlightTarget:A.highlightTarget,datum:C,category:A.CategoryDataMap.get(C.categoryLabel),categoryIndex:C.categoryIndex,categoryLabel:C.categoryLabel,data:A.computedData,event:T})}).on("click",(T,C)=>{n.event$.next({type:"multiValue",eventName:"click",pluginName:yn,highlightTarget:A.highlightTarget,datum:C,category:A.CategoryDataMap.get(C.categoryLabel),categoryIndex:C.categoryIndex,categoryLabel:C.categoryLabel,data:A.computedData,event:T})})}),Y({graphicSelection:_,highlight:r.multiValueHighlight$.pipe(B(A=>A.map(T=>T.id))),fullChartParams:r.fullChartParams$}).pipe(k(i),G(async A=>A)).subscribe(A=>{_B({selection:A.graphicSelection,ids:A.highlight,fullChartParams:A.fullChartParams})}),()=>{i.next(void 0)}}),iu="XYAux",Pp=J(iu,"label-box"),AB={name:iu,defaultParams:nu,layerIndex:Jv,validator:(t,{validateColumns:e})=>{const n=e(t,{xAxis:{toBeTypes:["object"]},yAxis:{toBeTypes:["object"]}});if(t.xAxis){const r=e(t.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(t.yAxis){const r=e(t.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 TB({axisX:t,axisY:e,layout:n,fullParams:r}){return t>=0&&t<=n.width&&e>=0&&e<=n.height?[{id:"line-x",x1:t,x2:t,y1:0,y2:n.height,dashArray:r.xAxis.lineDashArray??"none",colorType:r.xAxis.lineColorType},{id:"line-0",x1:0,x2:n.width,y1:e,y2:e,dashArray:r.yAxis.lineDashArray??"none",colorType:r.yAxis.lineColorType}]:[]}function PB({axisX:t,axisY:e,xValue:n,yValue:r,fullParams:i,textSizePx:o,layout:a,columnAmount:s,rowAmount:l}){if(!(t>=0&&t<=a.width&&e>=0&&e<=a.height))return[];const u=6,c=3,f=t,h=a.height+i.xAxis.labelPadding*l,p=xr(n,i.xAxis.labelTextFormat),d=p.split(`
122
- `),m=d.reduce((R,F)=>F.length>R.length?F:R,""),g=ta(m,o),y=o*d.length,b=g+u*2,v=y+c*2,x=-b/2,_=-c,S=x+u,A=_+c,T=-(i.yAxis.labelPadding*s),C=e,I=xr(r,i.yAxis.labelTextFormat),$=I.split(`
123
- `),L=$.reduce((R,F)=>F.length>R.length?F:R,""),P=ta(L,o),w=o*$.length,M=P+u*2,D=w+c*2,X=-P-u,O=-c-w/2,E=X+u,N=O+c;return[{id:"label-x",x:f,y:h,text:p,textArr:d,textWidth:g,textHeight:y,colorType:i.xAxis.labelColorType,textColorType:i.xAxis.labelTextColorType,rectWidth:b,rectHeight:v,rectX:x,rectY:_,textX:S,textY:A},{id:"label-y",x:T,y:C,text:I,textArr:$,textWidth:P,textHeight:w,colorType:i.yAxis.labelColorType,textColorType:i.xAxis.labelTextColorType,rectWidth:M,rectHeight:D,rectX:X,rectY:O,textX:E,textY:N}]}function DB({selection:t,pluginName:e,lineData:n,fullParams:r,fullChartParams:i}){const o=J(e,"auxline");return t.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=>bt(s.colorType,i)).style("stroke-dasharray",s=>s.dashArray)}function MB(t){t.selectAll("line").data([]).exit().remove()}function CB({selection:t,labelData:e,fullParams:n,fullDataFormatter:r,fullChartParams:i,textReverseTransform:o,textSizePx:a}){return t.selectAll(`g.${Pp}`).data(e).join(l=>l.append("g").classed(Pp,!0).style("cursor","pointer").attr("transform",(u,c)=>`translate(${u.x}, ${u.y})`),l=>l.transition().duration(50).attr("transform",(c,f)=>`translate(${c.x}, ${c.y})`),l=>l.remove()).each((l,u,c)=>{H(c[u]).selectAll("rect").data([l]).join(f=>f.append("rect").style("cursor","pointer").attr("rx",5).attr("ry",5),f=>f,f=>f.remove()).attr("width",f=>`${f.rectWidth}px`).attr("height",f=>`${f.rectHeight}px`).attr("fill",f=>bt(f.colorType,i)).attr("x",f=>f.rectX).attr("y",f=>f.rectY).style("transform",o),H(c[u]).selectAll("text").data([l]).join(f=>f.append("text").style("dominant-baseline","hanging").style("cursor","pointer").style("pointer-events","none"),f=>f,f=>f.remove()).style("transform",o).attr("fill",f=>bt(f.textColorType,i)).attr("font-size",i.styles.textSize).attr("x",f=>f.textX).attr("y",f=>f.textY).each((f,h,p)=>{up(H(p[h]),{textArr:l.textArr,textSizePx:a,groupAxisPosition:h===0?"bottom":"left"})})})}function LB(t){t.selectAll(`g.${Pp}`).data([]).exit().remove()}const kB=Xn(AB)(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new tt,a=e.insert("rect","g").classed(J(iu,"rect"),!0).attr("opacity",0),{categorySelection$:s,axesSelection$:l,defsSelection$:u,graphicGSelection$:c}=Tp({selection:t,pluginName:iu,clipPathID:"test",categoryLabels$:i.isCategorySeprate$.pipe(G(g=>wu(()=>g,i.categoryLabels$,i.categoryLabels$.pipe(B(y=>[y[0]]))))),multiValueContainerPosition$:i.multiValueContainerPosition$,multiValueGraphicTransform$:i.multiValueGraphicTransform$});i.layout$.pipe(k(o)).subscribe(g=>{a.attr("width",g.rootWidth).attr("height",g.rootHeight)});const f=i.multiValueContainerPosition$.pipe(B(g=>g.reduce((b,v)=>v.columnIndex>b?v.columnIndex:b,0)+1),Q()),h=i.multiValueContainerPosition$.pipe(B(g=>g.reduce((b,v)=>v.rowIndex>b?v.rowIndex:b,0)+1),Q()),p=i.multiValueContainerPosition$.pipe(k(o),G(async g=>g),B(g=>`${`scale(${1/g[0].scale[0]}, ${1/g[0].scale[1]})`}`),Q()),d=pB({rootSelection:e,fullDataFormatter$:i.fullDataFormatter$,filteredMinMaxXYData$:i.filteredMinMaxXYData$,multiValueContainerPosition$:i.multiValueContainerPosition$,layout$:i.layout$}).pipe(k(o));Y({axesSelection:l,layout:i.layout$,xyPosition:d,fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,fullChartParams:i.fullChartParams$,textReverseTransform:p,textSizePx:i.textSizePx$,columnAmount:f,rowAmount:h}).pipe(k(o),G(async g=>g)).subscribe(g=>{const{x:y,y:b,xValue:v,yValue:x}=g.xyPosition,_=TB({axisX:y,axisY:b,layout:g.layout,fullParams:g.fullParams});DB({selection:g.axesSelection,pluginName:n,lineData:_,fullParams:g.fullParams,fullChartParams:g.fullChartParams});const S=PB({axisX:y,axisY:b,xValue:v,yValue:x,fullParams:g.fullParams,textSizePx:g.textSizePx,layout:g.layout,columnAmount:g.columnAmount,rowAmount:g.rowAmount});CB({selection:g.axesSelection,labelData:S,fullParams:g.fullParams,fullDataFormatter:g.fullDataFormatter,fullChartParams:g.fullChartParams,textReverseTransform:g.textReverseTransform,textSizePx:g.textSizePx})});const m=ea(a,"mouseout").pipe(k(o));return Y({rootRectMouseout:m,axesSelection:l}).pipe(k(o),G(async g=>g)).subscribe(g=>{setTimeout(()=>{MB(g.axesSelection),LB(g.axesSelection)})}),()=>{o.next(void 0),a.remove()}}),$r="XYAxes",J2=6,RB="middle",EB="hanging",IB="start",BB="hanging",NB="end",FB="middle",OB="end",zB="auto",GB={name:$r,defaultParams:ru,layerIndex:gn,validator:(t,{validateColumns:e})=>{const n=e(t,{xAxis:{toBeTypes:["object"]},yAxis:{toBeTypes:["object"]}});if(t.xAxis){const r=e(t.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(t.yAxis){const r=e(t.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}};function YB({selection:t,xLabelClassName:e,fullParams:n,layout:r,fullDataFormatter:i,fullChartParams:o,textReverseTransform:a}){const s=n.xAxis.tickPadding+n.xAxis.labelOffset[0],l=n.xAxis.tickPadding+n.xAxis.labelOffset[1];let u=s,c=l;t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0).each((f,h,p)=>{H(p[h]).selectAll("text").data([f]).join(d=>d.append("text").style("font-weight","bold"),d=>d,d=>d.remove()).attr("text-anchor",IB).attr("dominant-baseline",BB).attr("font-size",o.styles.textSize).style("fill",bt(n.xAxis.labelColorType,o)).style("transform",a).attr("x",u).attr("y",c).text(d=>i.xAxis.label)}).attr("transform",f=>`translate(${r.width}, ${r.height})`)}function XB({selection:t,yLabelClassName:e,fullParams:n,layout:r,fullDataFormatter:i,fullChartParams:o,textReverseTransform:a}){const s=n.yAxis.tickPadding-n.yAxis.labelOffset[0],l=n.yAxis.tickPadding+n.yAxis.labelOffset[1];let u=-s,c=-l;t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0).each((f,h,p)=>{H(p[h]).selectAll("text").data([f]).join(d=>d.append("text").style("font-weight","bold"),d=>d,d=>d.remove()).attr("text-anchor",OB).attr("dominant-baseline",zB).attr("font-size",o.styles.textSize).style("fill",bt(n.yAxis.labelColorType,o)).style("transform",a).attr("x",u).attr("y",c).text(d=>i.yAxis.label)})}function VB({selection:t,xAxisClassName:e,fullParams:n,layout:r,fullDataFormatter:i,fullChartParams:o,xScale:a,textReverseTransform:s,minMaxXY:l}){const u=t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0).attr("transform",`translate(0, ${r.height})`);let c=n.xAxis.tickPadding;const f=mc(a).scale(a).ticks(n.xAxis.ticks).tickFormat(d=>xr(d,n.xAxis.tickFormat)).tickSize(n.xAxis.tickFullLine==!0?-r.height:J2).tickSizeOuter(-r.height).tickPadding(c),h=u.transition().duration(100).call(f);return h.selectAll("line").style("fill","none").style("stroke",n.xAxis.tickLineVisible==!0?bt(n.xAxis.tickColorType,o):"none").style("stroke-dasharray",n.xAxis.tickFullLineDasharray).attr("pointer-events","none"),h.selectAll("path").style("fill","none").style("stroke",n.xAxis.axisLineVisible==!0?bt(n.xAxis.axisLineColorType,o):"none").style("shape-rendering","crispEdges"),u.selectAll("text").attr("font-size",o.styles.textSize).style("color",bt(n.xAxis.tickTextColorType,o)).attr("text-anchor",RB).attr("dominant-baseline",EB).attr("dy",0).attr("y",c).style("transform",s),u}function WB({selection:t,yAxisClassName:e,fullParams:n,layout:r,fullDataFormatter:i,fullChartParams:o,yScale:a,textReverseTransform:s,minMaxXY:l}){const u=t.selectAll(`g.${e}`).data([n]).join("g").classed(e,!0);let c=n.yAxis.tickPadding;const f=yc(a).scale(a).ticks(n.xAxis.ticks).tickFormat(d=>xr(d,n.yAxis.tickFormat)).tickSize(n.yAxis.tickFullLine==!0?-r.width:J2).tickPadding(c),h=u.transition().duration(100).call(f);return h.selectAll("line").style("fill","none").style("stroke",n.yAxis.tickLineVisible==!0?bt(n.yAxis.tickColorType,o):"none").style("stroke-dasharray",n.yAxis.tickFullLineDasharray).attr("pointer-events","none"),h.selectAll("path").style("fill","none").style("stroke",n.yAxis.axisLineVisible==!0?bt(n.yAxis.axisLineColorType,o):"none").style("shape-rendering","crispEdges"),u.selectAll("text").attr("font-size",o.styles.textSize).style("color",bt(n.yAxis.tickTextColorType,o)).attr("text-anchor",NB).attr("dominant-baseline",FB).attr("x",-c).attr("dy",0).style("transform",s),u}const UB=Xn(GB)(({selection:t,name:e,observer:n,subject:r})=>{const i=new tt,o=J($r,"container"),a=J($r,"xAxis"),s=J($r,"yAxisG"),l=J($r,"yAxis"),u=J($r,"xLabel"),c=J($r,"yLabel"),f=Y({computedData:n.computedData$.pipe(Q((g,y)=>g.length===y.length)),isCategorySeprate:n.isCategorySeprate$}).pipe(k(i),G(async g=>g),B(g=>g.isCategorySeprate?g.computedData:[g.computedData[0]]),B((g,y)=>t.selectAll(`g.${o}`).data(g,b=>b[0]?b[0].categoryIndex:y).join("g").classed(o,!0))),h=f.pipe(k(i),B((g,y)=>g.selectAll(`g.${s}`).data([s]).join("g").classed(s,!0)));Y({containerSelection:f,gridContainerPosition:n.multiValueContainerPosition$}).pipe(k(i),G(async g=>g)).subscribe(g=>{g.containerSelection.attr("transform",(y,b)=>{const v=g.gridContainerPosition[b]??g.gridContainerPosition[0],x=v.translate,_=v.scale;return`translate(${x[0]}, ${x[1]}) scale(${_[0]}, ${_[1]})`})});const p=n.multiValueContainerPosition$.pipe(k(i),G(async g=>g),B(g=>`${`scale(${1/g[0].scale[0]}, ${1/g[0].scale[1]})`}`),Q()),d=new pt(g=>{Y({fullDataFormatter:n.fullDataFormatter$,layout:n.layout$,filteredMinMaxXYData:n.filteredMinMaxXYData$}).pipe(k(i),G(async y=>y)).subscribe(y=>{if(!y.filteredMinMaxXYData.minXDatum||!y.filteredMinMaxXYData.maxXDatum||y.filteredMinMaxXYData.minXDatum.value[0]==null||y.filteredMinMaxXYData.maxXDatum.value[0]==null)return;let b=y.filteredMinMaxXYData.maxXDatum.value[0],v=y.filteredMinMaxXYData.minXDatum.value[0];b===v&&b===0&&(b=1);const x=Xi({maxValue:b,minValue:v,axisWidth:y.layout.width,scaleDomain:y.fullDataFormatter.xAxis.scaleDomain,scaleRange:y.fullDataFormatter.xAxis.scaleRange});g.next(x)})}),m=new pt(g=>{Y({fullDataFormatter:n.fullDataFormatter$,layout:n.layout$,filteredMinMaxXYData:n.filteredMinMaxXYData$}).pipe(k(i),G(async y=>y)).subscribe(y=>{if(!y.filteredMinMaxXYData.minYDatum||!y.filteredMinMaxXYData.maxYDatum||y.filteredMinMaxXYData.minYDatum.value[1]==null||y.filteredMinMaxXYData.maxYDatum.value[1]==null)return;let b=y.filteredMinMaxXYData.maxYDatum.value[1],v=y.filteredMinMaxXYData.minYDatum.value[1];b===v&&b===0&&(b=1);const x=Xi({maxValue:b,minValue:v,axisWidth:y.layout.height,scaleDomain:y.fullDataFormatter.yAxis.scaleDomain,scaleRange:y.fullDataFormatter.yAxis.scaleRange,reverse:!0});g.next(x)})});return Y({axisSelection:h,fullParams:n.fullParams$,computedData:n.computedData$,layout:n.layout$,fullDataFormatter:n.fullDataFormatter$,fullChartParams:n.fullChartParams$,xScale:d,yScale:m,textReverseTransform:p,minMaxXY:n.minMaxXY$}).pipe(k(i),G(async g=>g)).subscribe(g=>{VB({selection:g.axisSelection,xAxisClassName:a,fullParams:g.fullParams,layout:g.layout,fullDataFormatter:g.fullDataFormatter,fullChartParams:g.fullChartParams,xScale:g.xScale,textReverseTransform:g.textReverseTransform,minMaxXY:g.minMaxXY}),WB({selection:g.axisSelection,yAxisClassName:l,fullParams:g.fullParams,layout:g.layout,fullDataFormatter:g.fullDataFormatter,fullChartParams:g.fullChartParams,yScale:g.yScale,textReverseTransform:g.textReverseTransform,minMaxXY:g.minMaxXY}),YB({selection:g.axisSelection,xLabelClassName:u,fullParams:g.fullParams,layout:g.layout,fullDataFormatter:g.fullDataFormatter,fullChartParams:g.fullChartParams,textReverseTransform:g.textReverseTransform}),XB({selection:g.axisSelection,yLabelClassName:c,fullParams:g.fullParams,layout:g.layout,fullDataFormatter:g.fullDataFormatter,fullChartParams:g.fullChartParams,textReverseTransform:g.textReverseTransform})}),()=>{i.next(void 0)}}),HB=Xn({name:"XYZoom",defaultParams:Z2,layerIndex:Qv,validator:(t,{validateColumns:e})=>({status:"success",columnName:"",expectToBe:""})})(({selection:t,rootSelection:e,name:n,observer:r,subject:i})=>{const o=new tt;let a={k:1,x:0,y:0};const s=r.fullDataFormatter$.pipe(B(f=>f.xAxis),Au()),l=r.fullDataFormatter$.pipe(B(f=>f.yAxis),Au()),u=new pt(f=>{Y({initXAxis:s,layout:r.layout$,minMaxXY:r.minMaxXY$}).pipe(k(o),G(async h=>h)).subscribe(h=>{const p=Xi({maxValue:h.minMaxXY.maxX,minValue:h.minMaxXY.minX,axisWidth:h.layout.width,scaleDomain:h.initXAxis.scaleDomain,scaleRange:h.initXAxis.scaleRange});f.next(p)})}),c=Y({initXAxis:s,initYAxis:l,minMaxXY:r.minMaxXY$}).pipe(k(o),G(async f=>f),B(f=>{let h=f.minMaxXY.minX,p=f.minMaxXY.maxX,d=f.minMaxXY.minY,m=f.minMaxXY.maxY;return f.initXAxis.scaleDomain[0]==="auto"&&h>0&&(h=0),f.initXAxis.scaleDomain[1]==="auto"&&p<0&&(p=0),f.initYAxis.scaleDomain[0]==="auto"&&d>0&&(d=0),f.initYAxis.scaleDomain[1]==="auto"&&m<0&&(m=0),{minX:h,maxX:p,minY:d,maxY:m}}));return Y({initXScale:u,fullDataFormatter:r.fullDataFormatter$,minMaxScaleDomain:c}).pipe(k(o),G(async f=>f)).subscribe(f=>{const h=f.initXScale.copy(),p=Qo().on("zoom",function(m){const g=m.transform,y=x=>{const _=Math.round(x);return Math.min(f.minMaxScaleDomain.maxX,Math.max(f.minMaxScaleDomain.minX,_))},b=g.rescaleX(h).domain().map(y);b[0]<=f.minMaxScaleDomain.minX&&b[1]>=f.minMaxScaleDomain.maxX?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 v={...f.fullDataFormatter,xAxis:{...f.fullDataFormatter.xAxis,scaleDomain:b}};i.dataFormatter$.next(v)});e.call(p)}),()=>{o.next(void 0),e.call(Qo().on("zoom",null))}}),jB={header:{height:36,text:[],textStyle:[]},footer:{height:0,text:[],textStyle:[]}},t$={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,textRenderFn:t=>{if(t.highlightTarget==="datum"&&t.datum)return[`${t.datum.label}: ${t.datum.value}`];if(t.highlightTarget==="series"){const e=t.seriesLabel,n=t.series.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[e,r]}else if(t.highlightTarget==="group"){const e=t.groupLabel,n=t.series.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[e,r]}else if(t.highlightTarget==="category"){const e=t.categoryLabel,n=t.category.filter(i=>i.visible==!0).map(i=>i.value),r=n.length>5?n.slice(0,5).join(",")+"...":n.join(",");return[e,r]}return[]},svgRenderFn:null};t$.textRenderFn.toString=()=>`(eventData) => {
121
+ }`;const o2={radius:5,fillColorType:"label",strokeColorType:"label",strokeWidth:0},a2={fillColorType:"label",strokeColorType:"label",strokeWidth:0,valueLinearOpacity:[.8,.8],arcScaleType:"area",sizeAdjust:.5},du={xAxis:{showLine:!0,showLabel:!0,lineDashArray:"3, 3",lineColorType:"primary",labelColorType:"primary",labelTextColorType:"background",labelTextFormat:e=>String(Math.round(e)),labelPadding:20},yAxis:{showLine:!0,showLabel:!0,lineDashArray:"3, 3",lineColorType:"primary",labelColorType:"primary",labelTextColorType:"background",labelTextFormat:e=>String(Math.round(e)),labelPadding:20}};du.xAxis.labelTextFormat.toString=()=>"(value: number) => String(Math.round(value))",du.yAxis.labelTextFormat.toString=()=>"(value: number) => String(Math.round(value))";const gu={xAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:null,tickFormat:e=>e,tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextColorType:"primary"},yAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:null,tickFormat:e=>e,tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextColorType:"primary"}};gu.xAxis.tickFormat.toString=()=>"v => v",gu.yAxis.tickFormat.toString=()=>"v => v";const s2={},l2="MultiValueLegend",zB=Hn({name:l2,defaultParams:i2,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 J,o=n.CategoryDataMap$.pipe(L(i),R(l=>Array.from(l.keys()))),a=n.fullParams$.pipe(L(i),R(l=>{const u=[{listRectWidth:l.listRectWidth,listRectHeight:l.listRectHeight,listRectRadius:l.listRectRadius}];return{...l,labelList:u}})),s=Ei(l2,{rootSelection:t,legendLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),u2="MultiValueTooltip",OB=Hn({name:u2,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 J,a=Bi(u2,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),Op=({selection:e,pluginName:t,clipPathID:n,categoryLabels$:r,multiValueContainerPosition$:i,multiValueGraphicTransform$:o})=>{const a=Z(t,"category"),s=Z(t,"axes"),l=Z(t,"graphic"),u=r.pipe(R((p,d)=>e.selectAll(`g.${a}`).data(p,m=>m).join(m=>m.append("g").classed(a,!0).each((g,y,b)=>{V(b[y]).selectAll(`g.${s}`).data([y]).join(v=>v.append("g").classed(s,!0).attr("clip-path",`url(#${n})`).each((x,_,A)=>{V(A[_]).selectAll("defs").data([_]).join("defs"),V(A[_]).selectAll("g").data([_]).join("g").classed(l,!0)}),v=>v,v=>v.remove())}),m=>m,m=>m.remove())),pe(1));Y({categorySelection:u,multiValueContainerPosition:i}).pipe(G(async p=>p)).subscribe(p=>{p.categorySelection.transition().attr("transform",(d,m)=>{const g=p.multiValueContainerPosition[m]??p.multiValueContainerPosition[0],y=g.translate,b=g.scale;return`translate(${y[0]}, ${y[1]}) scale(${b[0]}, ${b[1]})`})});const c=u.pipe(R(p=>p.select(`g.${s}`)),pe(1)),f=c.pipe(R(p=>p.select("defs")),pe(1)),h=Y({axesSelection:c,multiValueGraphicTransform:o}).pipe(G(async p=>p),R(p=>{const d=p.axesSelection.select(`g.${l}`);return d.transition().duration(50).style("transform",p.multiValueGraphicTransform.value),d}),pe(1));return{categorySelection$:u,axesSelection$:c,defsSelection$:f,graphicGSelection$:h}},GB=({rootSelection:e,fullDataFormatter$:t,filteredMinMaxXYData$:n,multiValueContainerPosition$:r,layout$:i})=>{const o=ha(e,"mousemove").pipe(U_(2)),a=r.pipe(R(c=>c.reduce((h,p)=>p.columnIndex>h?p.columnIndex:h,0)+1),ee(),pe(1)),s=r.pipe(R(c=>c.reduce((h,p)=>p.rowIndex>h?p.rowIndex:h,0)+1),ee(),pe(1)),l=new de(c=>{Y({layout:i,filteredMinMaxXYData:n,fullDataFormatter:t,columnAmount:a,rowAmount:s}).pipe(G(async f=>f)).subscribe(f=>{if(!f.filteredMinMaxXYData.minXDatum||!f.filteredMinMaxXYData.maxXDatum||f.filteredMinMaxXYData.minXDatum.value[0]==null||f.filteredMinMaxXYData.maxXDatum.value[0]==null||!f.filteredMinMaxXYData.minYDatum||!f.filteredMinMaxXYData.maxYDatum||f.filteredMinMaxXYData.minYDatum.value[1]==null||f.filteredMinMaxXYData.maxYDatum.value[1]==null)return;const h=c0({maxValue:f.filteredMinMaxXYData.maxXDatum.value[0],minValue:f.filteredMinMaxXYData.minXDatum.value[0],axisWidth:f.layout.width,scaleDomain:f.fullDataFormatter.xAxis.scaleDomain,scaleRange:f.fullDataFormatter.xAxis.scaleRange}),p=c0({maxValue:f.filteredMinMaxXYData.maxYDatum.value[1],minValue:f.filteredMinMaxXYData.minYDatum.value[1],axisWidth:f.layout.height,scaleDomain:f.fullDataFormatter.yAxis.scaleDomain,scaleRange:f.fullDataFormatter.yAxis.scaleRange,reverse:!0});c.next({xScale:h,yScale:p})})}),u=Y({fullDataFormatter:t,rootMousemove:o,columnAmount:a,rowAmount:s,layout:i,multiValueContainerPosition:r}).pipe(G(async c=>c),R(c=>({x:(c.rootMousemove.offsetX-c.layout.left)/c.multiValueContainerPosition[0].scale[0]%(c.layout.rootWidth/c.columnAmount/c.multiValueContainerPosition[0].scale[0]),y:(c.rootMousemove.offsetY-c.layout.top)/c.multiValueContainerPosition[0].scale[1]%(c.layout.rootHeight/c.rowAmount/c.multiValueContainerPosition[0].scale[1])})));return Y({xyScale:l,axisValue:u}).pipe(G(async c=>c),R(c=>({x:c.axisValue.x,y:c.axisValue.y,xValue:c.xyScale.xScale(c.axisValue.x),yValue:c.xyScale.yScale(c.axisValue.y)})))},xn="Scatter",YB={name:xn,defaultParams:o2,layerIndex:fu,validator:(e,{validateColumns:t})=>t(e,{radius:{toBeTypes:["number"]},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]}})};function WB({graphicGSelection:e,circleGClassName:t,circleClassName:n,visibleComputedLayoutData:r,fullParams:i,fullChartParams:o,graphicReverseScale:a}){const s=c=>{const f=c.size();return o.transitionDuration/f};let l=0;return e.each((c,f,h)=>{V(h[f]).selectAll("g").data(r[f],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)=>{V(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)=>Me({datum:g,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(g,y)=>Me({datum:g,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${a[f][0]??1}, ${a[f][1]??1})`)})}),e.selectAll(`circle.${n}`)}function XB({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)?V(o[i]).style("opacity",1).transition("highlight").duration(200):V(o[i]).style("opacity",n.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function VB({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)=>{V(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 UB=Hn(YB)(({selection:e,name:t,subject:n,observer:r})=>{const i=new J,o=Pt(xn,"clipPath-box"),a=Z(xn,"circleG"),s=Z(xn,"circle"),{categorySelection$:l,axesSelection$:u,defsSelection$:c,graphicGSelection$:f}=Op({selection:e,pluginName:xn,clipPathID:o,categoryLabels$:r.categoryLabels$,multiValueContainerPosition$:r.multiValueContainerPosition$,multiValueGraphicTransform$:r.multiValueGraphicTransform$}),h=Y({computedData:r.computedData$,multiValueGraphicReverseScale:r.multiValueGraphicReverseScale$}).pipe(L(i),G(async m=>m),R(m=>m.computedData.map((g,y)=>m.multiValueGraphicReverseScale[y])));Y({defsSelection:c,layout:r.layout$}).pipe(L(i),G(async m=>m)).subscribe(m=>{const g=[{id:o,width:m.layout.width,height:m.layout.height}];VB({defsSelection:m.defsSelection,clipPathData:g})});const p=Y({graphicGSelection:f,visibleComputedLayoutData:r.visibleComputedLayoutData$,graphicReverseScale:h,fullChartParams:r.fullChartParams$,fullParams:r.fullParams$}).pipe(L(i),G(async m=>m),R(m=>WB({graphicGSelection:m.graphicGSelection,circleGClassName:a,circleClassName:s,visibleComputedLayoutData:m.visibleComputedLayoutData,fullParams:m.fullParams,fullChartParams:m.fullChartParams,graphicReverseScale:m.graphicReverseScale}))),d=r.fullChartParams$.pipe(L(i),R(m=>m.highlightTarget),ee());return Y({graphicSelection:p,computedData:r.computedData$,CategoryDataMap:r.CategoryDataMap$,highlightTarget:d}).pipe(L(i),G(async m=>m)).subscribe(m=>{m.graphicSelection.on("mouseover",(g,y)=>{n.event$.next({type:"multiValue",eventName:"mouseover",pluginName:xn,highlightTarget:m.highlightTarget,datum:y,category:m.CategoryDataMap.get(y.categoryLabel),categoryIndex:y.categoryIndex,categoryLabel:y.categoryLabel,data:m.computedData,event:g})}).on("mousemove",(g,y)=>{n.event$.next({type:"multiValue",eventName:"mousemove",pluginName:xn,highlightTarget:m.highlightTarget,datum:y,category:m.CategoryDataMap.get(y.categoryLabel),categoryIndex:y.categoryIndex,categoryLabel:y.categoryLabel,data:m.computedData,event:g})}).on("mouseout",(g,y)=>{n.event$.next({type:"multiValue",eventName:"mouseout",pluginName:xn,highlightTarget:m.highlightTarget,datum:y,category:m.CategoryDataMap.get(y.categoryLabel),categoryIndex:y.categoryIndex,categoryLabel:y.categoryLabel,data:m.computedData,event:g})}).on("click",(g,y)=>{n.event$.next({type:"multiValue",eventName:"click",pluginName:xn,highlightTarget:m.highlightTarget,datum:y,category:m.CategoryDataMap.get(y.categoryLabel),categoryIndex:y.categoryIndex,categoryLabel:y.categoryLabel,data:m.computedData,event:g})})}),Y({graphicSelection:p,highlight:r.multiValueHighlight$.pipe(R(m=>m.map(g=>g.id))),fullChartParams:r.fullChartParams$}).pipe(L(i),G(async m=>m)).subscribe(m=>{XB({selection:m.graphicSelection,ids:m.highlight,fullChartParams:m.fullChartParams})}),()=>{i.next(void 0)}}),vn="ScatterBubbles",HB=.9,jB={name:vn,defaultParams:a2,layerIndex:fu,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 qB({graphicGSelection:e,circleGClassName:t,circleClassName:n,bubbleData:r,fullParams:i,fullChartParams:o,graphicReverseScale:a}){const s=c=>{const f=c.size();return o.transitionDuration/f};let l=0;return e.each((c,f,h)=>{V(h[f]).selectAll("g").data(r[f],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)=>{V(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",.8),g=>g.transition().duration(50).attr("opacity",.8),g=>g.remove()).attr("r",g=>g.r).attr("fill",(g,y)=>Me({datum:g,colorType:i.fillColorType,fullChartParams:o})).attr("stroke",(g,y)=>Me({datum:g,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${a[f][0]??1}, ${a[f][1]??1})`)})}),e.selectAll(`circle.${n}`)}function ZB({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)?V(o[i]).style("opacity",s=>s.opacity).transition("highlight").duration(200):V(o[i]).style("opacity",n.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function KB({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)=>{V(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 QB=Hn(jB)(({selection:e,name:t,subject:n,observer:r})=>{const i=new J,o=Pt(vn,"clipPath-box"),a=Z(vn,"circleG"),s=Z(vn,"circle"),{categorySelection$:l,axesSelection$:u,defsSelection$:c,graphicGSelection$:f}=Op({selection:e,pluginName:vn,clipPathID:o,categoryLabels$:r.categoryLabels$,multiValueContainerPosition$:r.multiValueContainerPosition$,multiValueGraphicTransform$:r.multiValueGraphicTransform$}),h=Y({computedData:r.computedData$,multiValueGraphicReverseScale:r.multiValueGraphicReverseScale$}).pipe(L(i),G(async S=>S),R(S=>S.computedData.map((P,M)=>S.multiValueGraphicReverseScale[M])));Y({defsSelection:c,layout:r.layout$}).pipe(L(i),G(async S=>S)).subscribe(S=>{const P=[{id:o,width:S.layout.width,height:S.layout.height}];KB({defsSelection:S.defsSelection,clipPathData:P})});const p=r.filteredMinMaxXYData$.pipe(L(i),R(S=>S.datumList.flat().map(P=>P.value[2]??0)),pe(1)),d=r.filteredMinMaxXYData$.pipe(L(i),R(S=>ic(S.datumList.flat().map(P=>P.value[2]??0)))),m=Y({filteredMinMaxValue:d,fullParams:r.fullParams$}).pipe(L(i),G(async S=>S),R(S=>xr().domain(S.filteredMinMaxValue).range(S.fullParams.valueLinearOpacity))),g=Y({layout:r.layout$,fullParams:r.fullParams$}).pipe(L(i),R(S=>Math.min(S.layout.width,S.layout.height)/2*S.fullParams.sizeAdjust)),y=p.pipe(L(i),R(S=>S.reduce((P,M)=>P+M,0)),Rr(S=>S>0)),b=Y({totalR:g,totalValue:y,fullParams:r.fullParams$}).pipe(L(i),G(async S=>S),R(S=>kn().domain([0,S.totalValue]).range([0,S.totalR]).exponent(S.fullParams.arcScaleType==="area"?.5:1))),v=Y({radiusScale:b,fullParams:r.fullParams$,totalR:g,filteredValueList:p}).pipe(L(i),G(async S=>S),R(S=>S.fullParams.arcScaleType==="area"?1:(()=>{const P=S.totalR*S.totalR*Math.PI;return Math.sqrt(P/Ac(S.filteredValueList,M=>Math.PI*Math.pow(S.radiusScale(M),2)))})())),x=Y({computedLayoutData:r.computedLayoutData$,opacityScale:m,radiusScale:b,scaleFactor:v,fullParams:r.fullParams$}).pipe(L(i),G(async S=>S),R(S=>S.computedLayoutData.map(P=>P.map(M=>{const B=M;return B.r=S.radiusScale(B.value[2])*S.scaleFactor*HB,B.opacity=S.opacityScale(B.value[2]),B})))),_=Y({graphicGSelection:f,bubbleData:x,graphicReverseScale:h,fullChartParams:r.fullChartParams$,fullParams:r.fullParams$}).pipe(L(i),G(async S=>S),R(S=>qB({graphicGSelection:S.graphicGSelection,circleGClassName:a,circleClassName:s,bubbleData:S.bubbleData,fullParams:S.fullParams,fullChartParams:S.fullChartParams,graphicReverseScale:S.graphicReverseScale}))),A=r.fullChartParams$.pipe(L(i),R(S=>S.highlightTarget),ee());return Y({graphicSelection:_,computedData:r.computedData$,CategoryDataMap:r.CategoryDataMap$,highlightTarget:A}).pipe(L(i),G(async S=>S)).subscribe(S=>{S.graphicSelection.on("mouseover",(P,M)=>{n.event$.next({type:"multiValue",eventName:"mouseover",pluginName:vn,highlightTarget:S.highlightTarget,datum:M,category:S.CategoryDataMap.get(M.categoryLabel),categoryIndex:M.categoryIndex,categoryLabel:M.categoryLabel,data:S.computedData,event:P})}).on("mousemove",(P,M)=>{n.event$.next({type:"multiValue",eventName:"mousemove",pluginName:vn,highlightTarget:S.highlightTarget,datum:M,category:S.CategoryDataMap.get(M.categoryLabel),categoryIndex:M.categoryIndex,categoryLabel:M.categoryLabel,data:S.computedData,event:P})}).on("mouseout",(P,M)=>{n.event$.next({type:"multiValue",eventName:"mouseout",pluginName:vn,highlightTarget:S.highlightTarget,datum:M,category:S.CategoryDataMap.get(M.categoryLabel),categoryIndex:M.categoryIndex,categoryLabel:M.categoryLabel,data:S.computedData,event:P})}).on("click",(P,M)=>{n.event$.next({type:"multiValue",eventName:"click",pluginName:vn,highlightTarget:S.highlightTarget,datum:M,category:S.CategoryDataMap.get(M.categoryLabel),categoryIndex:M.categoryIndex,categoryLabel:M.categoryLabel,data:S.computedData,event:P})})}),Y({graphicSelection:_,highlight:r.multiValueHighlight$.pipe(R(S=>S.map(P=>P.id))),fullChartParams:r.fullChartParams$}).pipe(L(i),G(async S=>S)).subscribe(S=>{ZB({selection:S.graphicSelection,ids:S.highlight,fullChartParams:S.fullChartParams})}),()=>{i.next(void 0)}}),mu="XYAux",Gp=Z(mu,"label-box"),JB={name:mu,defaultParams:du,layerIndex:u$,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 eN({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 tN({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,f=e,h=a.height+i.xAxis.labelPadding*l,p=wr(n,i.xAxis.labelTextFormat),d=p.split(`
122
+ `),m=d.reduce((E,O)=>O.length>E.length?O:E,""),g=fa(m,o),y=o*d.length,b=g+u*2,v=y+c*2,x=-b/2,_=-c,A=x+u,S=_+c,P=-(i.yAxis.labelPadding*s),M=t,B=wr(r,i.yAxis.labelTextFormat),$=B.split(`
123
+ `),k=$.reduce((E,O)=>O.length>E.length?O:E,""),C=fa(k,o),T=o*$.length,w=C+u*2,D=T+c*2,F=-C-u,z=-c-T/2,I=F+u,N=z+c;return[{id:"label-x",x:f,y:h,text:p,textArr:d,textWidth:g,textHeight:y,colorType:i.xAxis.labelColorType,textColorType:i.xAxis.labelTextColorType,rectWidth:b,rectHeight:v,rectX:x,rectY:_,textX:A,textY:S},{id:"label-y",x:P,y:M,text:B,textArr:$,textWidth:C,textHeight:T,colorType:i.yAxis.labelColorType,textColorType:i.xAxis.labelTextColorType,rectWidth:w,rectHeight:D,rectX:F,rectY:z,textX:I,textY:N}]}function nN({selection:e,pluginName:t,lineData:n,fullParams:r,fullChartParams:i}){const o=Z(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=>be(s.colorType,i)).style("stroke-dasharray",s=>s.dashArray)}function rN(e){e.selectAll("line").data([]).exit().remove()}function iN({selection:e,labelData:t,fullParams:n,fullDataFormatter:r,fullChartParams:i,textReverseTransform:o,textSizePx:a}){return e.selectAll(`g.${Gp}`).data(t).join(l=>l.append("g").classed(Gp,!0).style("cursor","pointer").attr("transform",(u,c)=>`translate(${u.x}, ${u.y})`),l=>l.transition().duration(50).attr("transform",(c,f)=>`translate(${c.x}, ${c.y})`),l=>l.remove()).each((l,u,c)=>{V(c[u]).selectAll("rect").data([l]).join(f=>f.append("rect").style("cursor","pointer").attr("rx",5).attr("ry",5),f=>f,f=>f.remove()).attr("width",f=>`${f.rectWidth}px`).attr("height",f=>`${f.rectHeight}px`).attr("fill",f=>be(f.colorType,i)).attr("x",f=>f.rectX).attr("y",f=>f.rectY).style("transform",o),V(c[u]).selectAll("text").data([l]).join(f=>f.append("text").style("dominant-baseline","hanging").style("cursor","pointer").style("pointer-events","none"),f=>f,f=>f.remove()).style("transform",o).attr("fill",f=>be(f.textColorType,i)).attr("font-size",i.styles.textSize).attr("x",f=>f.textX).attr("y",f=>f.textY).each((f,h,p)=>{Sp(V(p[h]),{textArr:l.textArr,textSizePx:a,groupAxisPosition:h===0?"bottom":"left"})})})}function oN(e){e.selectAll(`g.${Gp}`).data([]).exit().remove()}const aN=Hn(JB)(({selection:e,rootSelection:t,name:n,subject:r,observer:i})=>{const o=new J,a=t.insert("rect","g").classed(Z(mu,"rect"),!0).attr("opacity",0),{categorySelection$:s,axesSelection$:l,defsSelection$:u,graphicGSelection$:c}=Op({selection:e,pluginName:mu,clipPathID:"test",categoryLabels$:i.isCategorySeprate$.pipe(G(g=>Wi(()=>g,i.categoryLabels$,i.categoryLabels$.pipe(R(y=>[y[0]]))))),multiValueContainerPosition$:i.multiValueContainerPosition$,multiValueGraphicTransform$:i.multiValueGraphicTransform$});i.layout$.pipe(L(o)).subscribe(g=>{a.attr("width",g.rootWidth).attr("height",g.rootHeight)});const f=i.multiValueContainerPosition$.pipe(R(g=>g.reduce((b,v)=>v.columnIndex>b?v.columnIndex:b,0)+1),ee()),h=i.multiValueContainerPosition$.pipe(R(g=>g.reduce((b,v)=>v.rowIndex>b?v.rowIndex:b,0)+1),ee()),p=i.multiValueContainerPosition$.pipe(L(o),G(async g=>g),R(g=>`${`scale(${1/g[0].scale[0]}, ${1/g[0].scale[1]})`}`),ee()),d=GB({rootSelection:t,fullDataFormatter$:i.fullDataFormatter$,filteredMinMaxXYData$:i.filteredMinMaxXYData$,multiValueContainerPosition$:i.multiValueContainerPosition$,layout$:i.layout$}).pipe(L(o));Y({axesSelection:l,layout:i.layout$,xyPosition:d,fullParams:i.fullParams$,fullDataFormatter:i.fullDataFormatter$,fullChartParams:i.fullChartParams$,textReverseTransform:p,textSizePx:i.textSizePx$,columnAmount:f,rowAmount:h}).pipe(L(o),G(async g=>g)).subscribe(g=>{const{x:y,y:b,xValue:v,yValue:x}=g.xyPosition,_=eN({axisX:y,axisY:b,layout:g.layout,fullParams:g.fullParams});nN({selection:g.axesSelection,pluginName:n,lineData:_,fullParams:g.fullParams,fullChartParams:g.fullChartParams});const A=tN({axisX:y,axisY:b,xValue:v,yValue:x,fullParams:g.fullParams,textSizePx:g.textSizePx,layout:g.layout,columnAmount:g.columnAmount,rowAmount:g.rowAmount});iN({selection:g.axesSelection,labelData:A,fullParams:g.fullParams,fullDataFormatter:g.fullDataFormatter,fullChartParams:g.fullChartParams,textReverseTransform:g.textReverseTransform,textSizePx:g.textSizePx})});const m=ha(a,"mouseout").pipe(L(o));return Y({rootRectMouseout:m,axesSelection:l}).pipe(L(o),G(async g=>g)).subscribe(g=>{setTimeout(()=>{rN(g.axesSelection),oN(g.axesSelection)})}),()=>{o.next(void 0),a.remove()}}),Ar="XYAxes",c2=6,sN="middle",lN="hanging",uN="start",cN="hanging",fN="end",hN="middle",pN="end",dN="auto",gN={name:Ar,defaultParams:gu,layerIndex:bn,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}};function mN({selection:e,xLabelClassName:t,fullParams:n,layout:r,fullDataFormatter:i,fullChartParams:o,textReverseTransform:a}){const s=n.xAxis.tickPadding+n.xAxis.labelOffset[0],l=n.xAxis.tickPadding+n.xAxis.labelOffset[1];let u=s,c=l;e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).each((f,h,p)=>{V(p[h]).selectAll("text").data([f]).join(d=>d.append("text").style("font-weight","bold"),d=>d,d=>d.remove()).attr("text-anchor",uN).attr("dominant-baseline",cN).attr("font-size",o.styles.textSize).style("fill",be(n.xAxis.labelColorType,o)).style("transform",a).attr("x",u).attr("y",c).text(d=>i.xAxis.label)}).attr("transform",f=>`translate(${r.width}, ${r.height})`)}function yN({selection:e,yLabelClassName:t,fullParams:n,layout:r,fullDataFormatter:i,fullChartParams:o,textReverseTransform:a}){const s=n.yAxis.tickPadding-n.yAxis.labelOffset[0],l=n.yAxis.tickPadding+n.yAxis.labelOffset[1];let u=-s,c=-l;e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).each((f,h,p)=>{V(p[h]).selectAll("text").data([f]).join(d=>d.append("text").style("font-weight","bold"),d=>d,d=>d.remove()).attr("text-anchor",pN).attr("dominant-baseline",dN).attr("font-size",o.styles.textSize).style("fill",be(n.yAxis.labelColorType,o)).style("transform",a).attr("x",u).attr("y",c).text(d=>i.yAxis.label)})}function bN({selection:e,xAxisClassName:t,fullParams:n,layout:r,fullDataFormatter:i,fullChartParams:o,xScale:a,textReverseTransform:s,minMaxXY:l}){const u=e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).attr("transform",`translate(0, ${r.height})`);let c=n.xAxis.tickPadding;const f=Dc(a).scale(a).ticks(n.xAxis.ticks).tickFormat(d=>wr(d,n.xAxis.tickFormat)).tickSize(n.xAxis.tickFullLine==!0?-r.height:c2).tickSizeOuter(-r.height).tickPadding(c),h=u.transition().duration(100).call(f);return h.selectAll("line").style("fill","none").style("stroke",n.xAxis.tickLineVisible==!0?be(n.xAxis.tickColorType,o):"none").style("stroke-dasharray",n.xAxis.tickFullLineDasharray).attr("pointer-events","none"),h.selectAll("path").style("fill","none").style("stroke",n.xAxis.axisLineVisible==!0?be(n.xAxis.axisLineColorType,o):"none").style("shape-rendering","crispEdges"),u.selectAll("text").attr("font-size",o.styles.textSize).style("color",be(n.xAxis.tickTextColorType,o)).attr("text-anchor",sN).attr("dominant-baseline",lN).attr("dy",0).attr("y",c).style("transform",s),u}function xN({selection:e,yAxisClassName:t,fullParams:n,layout:r,fullDataFormatter:i,fullChartParams:o,yScale:a,textReverseTransform:s,minMaxXY:l}){const u=e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0);let c=n.yAxis.tickPadding;const f=Mc(a).scale(a).ticks(n.xAxis.ticks).tickFormat(d=>wr(d,n.yAxis.tickFormat)).tickSize(n.yAxis.tickFullLine==!0?-r.width:c2).tickPadding(c),h=u.transition().duration(100).call(f);return h.selectAll("line").style("fill","none").style("stroke",n.yAxis.tickLineVisible==!0?be(n.yAxis.tickColorType,o):"none").style("stroke-dasharray",n.yAxis.tickFullLineDasharray).attr("pointer-events","none"),h.selectAll("path").style("fill","none").style("stroke",n.yAxis.axisLineVisible==!0?be(n.yAxis.axisLineColorType,o):"none").style("shape-rendering","crispEdges"),u.selectAll("text").attr("font-size",o.styles.textSize).style("color",be(n.yAxis.tickTextColorType,o)).attr("text-anchor",fN).attr("dominant-baseline",hN).attr("x",-c).attr("dy",0).style("transform",s),u}const vN=Hn(gN)(({selection:e,name:t,observer:n,subject:r})=>{const i=new J,o=Z(Ar,"container"),a=Z(Ar,"xAxis"),s=Z(Ar,"yAxisG"),l=Z(Ar,"yAxis"),u=Z(Ar,"xLabel"),c=Z(Ar,"yLabel"),f=Y({computedData:n.computedData$.pipe(ee((g,y)=>g.length===y.length)),isCategorySeprate:n.isCategorySeprate$}).pipe(L(i),G(async g=>g),R(g=>g.isCategorySeprate?g.computedData:[g.computedData[0]]),R((g,y)=>e.selectAll(`g.${o}`).data(g,b=>b[0]?b[0].categoryIndex:y).join("g").classed(o,!0))),h=f.pipe(L(i),R((g,y)=>g.selectAll(`g.${s}`).data([s]).join("g").classed(s,!0)));Y({containerSelection:f,gridContainerPosition:n.multiValueContainerPosition$}).pipe(L(i),G(async g=>g)).subscribe(g=>{g.containerSelection.attr("transform",(y,b)=>{const v=g.gridContainerPosition[b]??g.gridContainerPosition[0],x=v.translate,_=v.scale;return`translate(${x[0]}, ${x[1]}) scale(${_[0]}, ${_[1]})`})});const p=n.multiValueContainerPosition$.pipe(L(i),G(async g=>g),R(g=>`${`scale(${1/g[0].scale[0]}, ${1/g[0].scale[1]})`}`),ee()),d=new de(g=>{Y({fullDataFormatter:n.fullDataFormatter$,layout:n.layout$,filteredMinMaxXYData:n.filteredMinMaxXYData$}).pipe(L(i),G(async y=>y)).subscribe(y=>{if(!y.filteredMinMaxXYData.minXDatum||!y.filteredMinMaxXYData.maxXDatum||y.filteredMinMaxXYData.minXDatum.value[0]==null||y.filteredMinMaxXYData.maxXDatum.value[0]==null)return;let b=y.filteredMinMaxXYData.maxXDatum.value[0],v=y.filteredMinMaxXYData.minXDatum.value[0];b===v&&b===0&&(b=1);const x=ro({maxValue:b,minValue:v,axisWidth:y.layout.width,scaleDomain:y.fullDataFormatter.xAxis.scaleDomain,scaleRange:y.fullDataFormatter.xAxis.scaleRange});g.next(x)})}),m=new de(g=>{Y({fullDataFormatter:n.fullDataFormatter$,layout:n.layout$,filteredMinMaxXYData:n.filteredMinMaxXYData$}).pipe(L(i),G(async y=>y)).subscribe(y=>{if(!y.filteredMinMaxXYData.minYDatum||!y.filteredMinMaxXYData.maxYDatum||y.filteredMinMaxXYData.minYDatum.value[1]==null||y.filteredMinMaxXYData.maxYDatum.value[1]==null)return;let b=y.filteredMinMaxXYData.maxYDatum.value[1],v=y.filteredMinMaxXYData.minYDatum.value[1];b===v&&b===0&&(b=1);const x=ro({maxValue:b,minValue:v,axisWidth:y.layout.height,scaleDomain:y.fullDataFormatter.yAxis.scaleDomain,scaleRange:y.fullDataFormatter.yAxis.scaleRange,reverse:!0});g.next(x)})});return Y({axisSelection:h,fullParams:n.fullParams$,computedData:n.computedData$,layout:n.layout$,fullDataFormatter:n.fullDataFormatter$,fullChartParams:n.fullChartParams$,xScale:d,yScale:m,textReverseTransform:p,minMaxXY:n.minMaxXY$}).pipe(L(i),G(async g=>g)).subscribe(g=>{bN({selection:g.axisSelection,xAxisClassName:a,fullParams:g.fullParams,layout:g.layout,fullDataFormatter:g.fullDataFormatter,fullChartParams:g.fullChartParams,xScale:g.xScale,textReverseTransform:g.textReverseTransform,minMaxXY:g.minMaxXY}),xN({selection:g.axisSelection,yAxisClassName:l,fullParams:g.fullParams,layout:g.layout,fullDataFormatter:g.fullDataFormatter,fullChartParams:g.fullChartParams,yScale:g.yScale,textReverseTransform:g.textReverseTransform,minMaxXY:g.minMaxXY}),mN({selection:g.axisSelection,xLabelClassName:u,fullParams:g.fullParams,layout:g.layout,fullDataFormatter:g.fullDataFormatter,fullChartParams:g.fullChartParams,textReverseTransform:g.textReverseTransform}),yN({selection:g.axisSelection,yLabelClassName:c,fullParams:g.fullParams,layout:g.layout,fullDataFormatter:g.fullDataFormatter,fullChartParams:g.fullChartParams,textReverseTransform:g.textReverseTransform})}),()=>{i.next(void 0)}}),$N=Hn({name:"XYZoom",defaultParams:s2,layerIndex:l$,validator:(e,{validateColumns:t})=>({status:"success",columnName:"",expectToBe:""})})(({selection:e,rootSelection:t,name:n,observer:r,subject:i})=>{const o=new J;let a={k:1,x:0,y:0};const s=r.fullDataFormatter$.pipe(R(f=>f.xAxis),Xi()),l=r.fullDataFormatter$.pipe(R(f=>f.yAxis),Xi()),u=new de(f=>{Y({initXAxis:s,layout:r.layout$,minMaxXY:r.minMaxXY$}).pipe(L(o),G(async h=>h)).subscribe(h=>{const p=ro({maxValue:h.minMaxXY.maxX,minValue:h.minMaxXY.minX,axisWidth:h.layout.width,scaleDomain:h.initXAxis.scaleDomain,scaleRange:h.initXAxis.scaleRange});f.next(p)})}),c=Y({initXAxis:s,initYAxis:l,minMaxXY:r.minMaxXY$}).pipe(L(o),G(async f=>f),R(f=>{let h=f.minMaxXY.minX,p=f.minMaxXY.maxX,d=f.minMaxXY.minY,m=f.minMaxXY.maxY;return f.initXAxis.scaleDomain[0]==="auto"&&h>0&&(h=0),f.initXAxis.scaleDomain[1]==="auto"&&p<0&&(p=0),f.initYAxis.scaleDomain[0]==="auto"&&d>0&&(d=0),f.initYAxis.scaleDomain[1]==="auto"&&m<0&&(m=0),{minX:h,maxX:p,minY:d,maxY:m}}));return Y({initXScale:u,fullDataFormatter:r.fullDataFormatter$,minMaxScaleDomain:c}).pipe(L(o),G(async f=>f)).subscribe(f=>{const h=f.initXScale.copy(),p=yn().on("zoom",function(m){const g=m.transform,y=x=>{const _=Math.round(x);return Math.min(f.minMaxScaleDomain.maxX,Math.max(f.minMaxScaleDomain.minX,_))},b=g.rescaleX(h).domain().map(y);b[0]<=f.minMaxScaleDomain.minX&&b[1]>=f.minMaxScaleDomain.maxX?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 v={...f.fullDataFormatter,xAxis:{...f.fullDataFormatter.xAxis,scaleDomain:b}};i.dataFormatter$.next(v)});t.call(p)}),()=>{o.next(void 0),t.call(yn().on("zoom",null))}}),_N={header:{height:36,text:[],textStyle:[]},footer:{height:0,text:[],textStyle:[]}},f2={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};f2.textRenderFn.toString=()=>`(eventData) => {
124
124
  if (eventData.highlightTarget === 'datum' && eventData.datum) {
125
125
  return [\`\${eventData.datum.label}: \${eventData.datum.value}\`]
126
126
  } else if (eventData.highlightTarget === 'series') {
@@ -158,9 +158,27 @@ ${u}`}};pp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
158
158
  return [label, value]
159
159
  }
160
160
  return []
161
- }`;const e$={force:{strength:.08,velocityDecay:.3,collisionSpacing:2},bubbleText:{fillRate:.6,lineHeight:12,lineLengthMin:4},arcScaleType:"area"},n$={outerRadius:.85,innerRadius:0,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,padAngle:0,strokeColorType:"background",strokeWidth:1,cornerRadius:0},Dp={eventFn:(t,e,n)=>e==="mouseover"||e==="mousemove"?[String(t.datum.value)]:[String(Math.round(t.data.reduce((r,i)=>r+i.reduce((o,a)=>o+(a.value??0),0),0)*n))],textAttrs:[{transform:"translate(0, 0)"}],textStyles:[{"font-weight":"bold","text-anchor":"middle","pointer-events":"none","dominant-baseline":"middle","font-size":64,fill:"#000"}]};Dp.eventFn.toString=()=>`(eventData: EventSeries, eventName: EventName, t: number) => {
162
- if (eventName === 'mouseover' || eventName === 'mousemove') {
163
- return [String(eventData.datum!.value)]
161
+ }`;const Ni={dot:{radius:10,fillColorType:"label",strokeColorType:"label",strokeWidth:1,styleFn:e=>""},dotLabel:{colorType:"primary",sizeFixed:!1,styleFn:e=>"text-shadow:0 1px 0 #fff, 1px 0 0 #fff, 0 -1px 0 #fff, -1px 0 0 #fff"},arrow:{colorType:"primary",strokeWidth:1.5,pointerWidth:5,pointerHeight:5,styleFn:e=>""},arrowLabel:{colorType:"secondary",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}};Ni.dot.styleFn.toString=()=>"(node) => ''",Ni.dotLabel.styleFn.toString=()=>"(node) => 'text-shadow:0 1px 0 #fff, 1px 0 0 #fff, 0 -1px 0 #fff, -1px 0 0 #fff'",Ni.arrow.styleFn.toString=()=>"(node) => ''",Ni.arrowLabel.styleFn.toString=()=>"(node) => ''";const Fi={bubble:{radiusMin:30,radiusMax:60,arcScaleType:"area",fillColorType:"label",strokeColorType:"label",strokeWidth:1,styleFn:e=>""},bubbleLabel:{fillRate:.8,lineHeight:1,lineLengthMin:4,colorType:"primary",styleFn:e=>""},arrow:{colorType:"primary",strokeWidthMin:1.5,strokeWidthMax:4.5,pointerWidth:5,pointerHeight:5,styleFn:e=>""},arrowLabel:{colorType:"secondary",sizeFixed:!1,styleFn:e=>""},force:{nodeStrength:-500,linkDistance:200,velocityDecay:.1,alphaDecay:.05},zoomable:!0,transform:{x:0,y:0,k:1},scaleExtent:{min:0,max:1/0}};Fi.bubble.styleFn.toString=()=>"(node) => ''",Fi.bubbleLabel.styleFn.toString=()=>"(node) => ''",Fi.arrow.styleFn.toString=()=>"(node) => ''",Fi.arrowLabel.styleFn.toString=()=>"(node) => ''";const h2={placement:"right-end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},Yp={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=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>
162
+ <text x="${t.textSizePx*1.5}" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
163
+ <tspan>${e.categoryLabel}</tspan>
164
+ </text>`:"",l=i?`<tspan>${e.datum.label}</tspan> `:"",u=`<text font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
165
+ ${l}<tspan font-weight="bold">${e.datum.value}</tspan>
166
+ </text>`;return`${s}
167
+ <g ${r?`transform="translate(0, ${t.textSizePx*2})"`:""}>
168
+ ${u}
169
+ </g>`}};Yp.renderFn.toString=()=>'(eventData, { styles, utils }) => {\n const hasCategoryLabel = eventData.categoryLabel ? true : false\n const hasDatumLabel = eventData.datum.label ? true : false\n const bulletWidth = styles.textSizePx * 0.7\n const offset = (styles.textSizePx / 2) - (bulletWidth / 2)\n const categorySvg = hasCategoryLabel\n ? `<rect width="${bulletWidth}" height="${bulletWidth}" x="${offset}" y="${offset - 1}" rx="${bulletWidth / 2}" fill="${eventData.datum.color}"></rect>\n<text x="${styles.textSizePx * 1.5}" font-size="${styles.textSizePx}" dominant-baseline="hanging" fill="${styles.textColor}">\n <tspan>${eventData.categoryLabel}</tspan>\n</text>`\n : \'\'\n const datumLabelSvg = hasDatumLabel\n ? `<tspan>${eventData.datum.label}</tspan> `\n : \'\'\n const datumSvg = `<text font-size="${styles.textSizePx}" dominant-baseline="hanging" fill="${styles.textColor}">\n ${datumLabelSvg}<tspan font-weight="bold">${eventData.datum.value}</tspan>\n</text>`\n\n return `${categorySvg}\n<g ${hasCategoryLabel ? `transform="translate(0, ${styles.textSizePx * 2})"` : \'\'}>\n ${datumSvg}\n</g>`\n}';const ze="ForceDirected",SN=Z(ze,"zoom-area"),p2=Pt(ze,"arrow"),d2=Z(ze,"arrow-marker"),wN=Z(ze,"edge-list-g"),TN=Z(ze,"edge-g"),g2=Z(ze,"edge-arrow-path"),m2=Z(ze,"edge-label-g"),y2=Z(ze,"edge-label"),AN=Z(ze,"node-list-g"),PN=Z(ze,"node-g"),b2=Z(ze,"node-circle"),x2=Z(ze,"node-label-g"),v2=Z(ze,"node-label"),DN={name:ze,defaultParams:Ni,layerIndex:bt,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 MN(e,t){return Xs().velocityDecay(t.force.velocityDecay).alphaDecay(t.force.alphaDecay).force("link",Bf().id(n=>n.id).strength(1).distance(n=>t.force.linkDistance)).force("charge",Vs().strength(t.force.nodeStrength)).force("collision",Ws(t.dot.radius).strength(1)).force("center",Ef(e.width/2,e.height/2))}function CN(e){return"translate("+e.x+","+e.y+")"}function LN(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 kN(e){return"M"+e.source.x+","+e.source.y+" L"+e.target.x+","+e.target.y}function RN(e,t){return e.selectAll(`marker.${d2}`).data([t]).join(n=>{const r=n.append("marker").classed(d2,!0).attr("id",p2).attr("viewBox",i=>`-${i.arrow.pointerWidth} -${i.arrow.pointerHeight/2} ${i.arrow.pointerWidth} ${i.arrow.pointerHeight}`).attr("orient","auto");return r.append("path").attr("d",i=>`M${-i.arrow.pointerWidth},${-i.arrow.pointerHeight/2}L0,0L${-i.arrow.pointerWidth},${i.arrow.pointerHeight/2}`),r},n=>n,n=>n.remove()).attr("markerWidth",n=>n.arrow.pointerWidth).attr("markerHeight",n=>n.arrow.pointerHeight).attr("refX",n=>(n.dot.radius+t.dot.strokeWidth/2)/n.arrow.strokeWidth-1).attr("refY",0)}function EN(e,t){function n(o){o.active||e.alphaTarget(.3).restart(),o.subject.fx=o.subject.x,o.subject.fy=o.subject.y,t.next("start")}function r(o){o.subject.fx=o.x,o.subject.fy=o.y,t.next("drag")}function i(o){o.active||e.alphaTarget(0),o.subject.fx=null,o.subject.fy=null,t.next("end")}return hs().on("start",n).on("drag",r).on("end",i)}function IN({nodeListGSelection:e,nodes:t}){return e.selectAll("g").data(t,n=>n.id).join(n=>n.append("g").classed(PN,!0),n=>n,n=>n.remove())}function BN({nodeGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{V(o[i]).selectAll("circle").data([r]).join(s=>s.append("circle").classed(b2,!0).attr("cursor","pointer"),s=>s,s=>s.remove()).attr("r",t.dot.radius).attr("fill",s=>Me({datum:s,colorType:t.dot.fillColorType,fullChartParams:n})).attr("stroke",s=>Me({datum:s,colorType:t.dot.strokeColorType,fullChartParams:n})).attr("stroke-width",t.dot.strokeWidth).attr("style",s=>t.dot.styleFn(s))}),e.select(`circle.${b2}`)}function NN({nodeGSelection:e,fullParams:t}){return e.each((n,r,i)=>{V(i[r]).selectAll("g").data([n]).join(a=>a.append("g").classed(x2,!0),a=>a,a=>a.remove()).attr("transform",`translate(0, ${-t.dot.radius-10})`)}),e.select(`g.${x2}`)}function FN({nodeLabelGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{V(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=>Me({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 zN({edgeListGSelection:e,edges:t}){return e.selectAll("g").data(t,n=>n.id).join(n=>n.append("g").classed(TN,!0),n=>n,n=>n.remove())}function ON({edgeGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{V(o[i]).selectAll("path").data([r]).join(s=>s.append("path").classed(g2,!0).attr("marker-end",`url(#${p2})`),s=>s,s=>s.remove()).attr("stroke",s=>Me({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.${g2}`)}function GN({edgeGSelection:e}){return e.each((t,n,r)=>{V(r[n]).selectAll("g").data([t]).join(o=>o.append("g").classed(m2,!0),o=>o,o=>o.remove())}),e.select(`g.${m2}`)}function YN({edgeLabelGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{V(o[i]).selectAll("text").data([r],s=>s.id).join(s=>s.append("text").classed(y2,!0).attr("text-anchor","middle").attr("pointer-events","none"),s=>s,s=>s.remove()).text(s=>s.label).attr("fill",s=>Me({datum:s,colorType:t.arrowLabel.colorType,fullChartParams:n})).attr("font-size",n.styles.textSize).attr("style",s=>t.arrowLabel.styleFn(s))}),e.select(`text.${y2}`)}function WN({nodeGSelection:e,edgeGSelection:t,highlightIds:n,fullChartParams:r}){if(e.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=V(a[o]);n.includes(i.id)?s.style("opacity",1).transition("highlight").ease(sr).duration(500):s.style("opacity",r.styles.unhighlightedOpacity)})}const XN=ja(DN)(({selection:e,rootSelection:t,name:n,observer:r,subject:i})=>{const o=new J,a=e.append("g").classed(SN,!0),s=a.append("defs"),l=a.append("g").classed(wN,!0),u=a.append("g").classed(AN,!0);let c,f,h,p,d,m,g,y;const b=new Du("end"),v=new J;r.fullParams$.pipe(L(o),R(S=>RN(s,S))).subscribe();const x=r.fullParams$.pipe(L(o),R(S=>{let P=S.zoomable?yn().on("zoom",M=>{a.attr("transform",`translate(
170
+ ${M.transform.x},
171
+ ${M.transform.y}
172
+ ) scale(
173
+ ${M.transform.k}
174
+ )`),S.dotLabel.sizeFixed&&p&&p.attr("transform",`scale(${1/M.transform.k})`),S.arrowLabel.sizeFixed&&y&&y.attr("transform",`scale(${1/M.transform.k})`)}):yn().on("zoom",null);return S.scaleExtent&&P.scaleExtent([S.scaleExtent.min,S.scaleExtent.max]),t.call(P),P}));Y({d3Zoom:x,transform:r.fullParams$.pipe(L(o),R(S=>S.transform))}).pipe(L(o),G(async S=>S)).subscribe(S=>{e.call(S.d3Zoom.transform,Li.translate(S.transform.x,S.transform.y).scale(S.transform.k))});const _=Y({layout:r.layout$.pipe(Xi()),fullParams:r.fullParams$}).pipe(L(o),G(async S=>S),R(S=>MN(S.layout,S.fullParams)),pe(1)),A=r.visibleComputedData$.pipe(L(o),R(S=>({nodes:S.nodes,edges:S.edges.map(P=>{let M=P;return M.source=P.startNode,M.target=P.endNode,M})})),pe(1));return Y({renderData:A,computedData:r.computedData$,CategoryNodeMap:r.CategoryNodeMap$,simulation:_,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$}).pipe(L(o),G(async S=>S)).subscribe(S=>{c=IN({nodeListGSelection:u,nodes:S.renderData.nodes}),f=BN({nodeGSelection:c,fullParams:S.fullParams,fullChartParams:S.fullChartParams}),f.call(EN(S.simulation,b)),h=NN({nodeGSelection:c,fullParams:S.fullParams}),p=FN({nodeLabelGSelection:h,fullParams:S.fullParams,fullChartParams:S.fullChartParams}),d=zN({edgeListGSelection:l,edges:S.renderData.edges}),m=ON({edgeGSelection:d,fullParams:S.fullParams,fullChartParams:S.fullChartParams}),g=GN({edgeGSelection:d}),y=YN({edgeLabelGSelection:g,fullParams:S.fullParams,fullChartParams:S.fullChartParams}),S.simulation.nodes(S.renderData.nodes).on("tick",()=>{m.attr("d",kN),c.attr("transform",CN),g.attr("transform",P=>LN(P))}),S.simulation.force("link").links(S.renderData.edges),S.simulation.alpha(.3).restart(),f.on("mouseover",(P,M)=>{P.stopPropagation(),v.next({type:"relationship",eventName:"mouseover",pluginName:ze,highlightTarget:S.fullChartParams.highlightTarget,datum:M,category:S.CategoryNodeMap.get(M.categoryLabel),categoryIndex:M.categoryIndex,categoryLabel:M.categoryLabel,event:P,data:S.computedData})}).on("mousemove",(P,M)=>{P.stopPropagation(),v.next({type:"relationship",eventName:"mousemove",pluginName:ze,highlightTarget:S.fullChartParams.highlightTarget,datum:M,category:S.CategoryNodeMap.get(M.categoryLabel),categoryIndex:M.categoryIndex,categoryLabel:M.categoryLabel,event:P,data:S.computedData})}).on("mouseout",(P,M)=>{P.stopPropagation(),v.next({type:"relationship",eventName:"mouseout",pluginName:ze,highlightTarget:S.fullChartParams.highlightTarget,datum:M,category:S.CategoryNodeMap.get(M.categoryLabel),categoryIndex:M.categoryIndex,categoryLabel:M.categoryLabel,event:P,data:S.computedData})}).on("click",(P,M)=>{P.stopPropagation(),v.next({type:"relationship",eventName:"click",pluginName:ze,highlightTarget:S.fullChartParams.highlightTarget,datum:M,category:S.CategoryNodeMap.get(M.categoryLabel),categoryIndex:M.categoryIndex,categoryLabel:M.categoryLabel,event:P,data:S.computedData})})}),b.pipe(G(S=>Wi(()=>S==="end",v,va))).subscribe(S=>{i.event$.next(S)}),Y({renderData:A,highlightNodes:r.relationshipHighlightNodes$.pipe(R(S=>S.map(P=>P.id))),highlightEdges:r.relationshipHighlightEdges$.pipe(R(S=>S.map(P=>P.id))),fullChartParams:r.fullChartParams$,fullParams:r.fullParams$}).pipe(L(o),G(async S=>S)).subscribe(S=>{!c||!d||WN({nodeGSelection:c,edgeGSelection:d,highlightIds:S.highlightNodes,fullChartParams:S.fullChartParams})}),()=>{o.next(void 0)}}),Ue="ForceDirectedBubbles",$2=12,VN=Z(Ue,"zoom-area"),UN=Pt(Ue,"arrow"),_2=Z(Ue,"arrow-marker"),HN=Z(Ue,"edge-list-g"),jN=Z(Ue,"edge-g"),S2=Z(Ue,"edge-arrow-path"),w2=Z(Ue,"edge-label-g"),T2=Z(Ue,"edge-label"),qN=Z(Ue,"node-list-g"),ZN=Z(Ue,"node-g"),A2=Z(Ue,"node-circle"),KN={name:Ue,defaultParams:Fi,layerIndex:bt,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"]},lineLengthMin:{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 QN(e,t){return Xs().velocityDecay(t.force.velocityDecay).alphaDecay(t.force.alphaDecay).force("link",Bf().id(n=>n.id).strength(1).distance(n=>t.force.linkDistance)).force("charge",Vs().strength(t.force.nodeStrength)).force("collision",Ws(t.bubble.radiusMax).strength(1)).force("center",Ef(e.width/2,e.height/2))}function JN(e){return"translate("+e.x+","+e.y+")"}function eF(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 tF(e){return"M"+e.source.x+","+e.source.y+" L"+e.target.x+","+e.target.y}function nF({defsSelection:e,markerParams:t,markerData:n}){return e.selectAll(`marker.${_2}`).data(n).join(r=>{const i=r.append("marker").classed(_2,!0).attr("viewBox",t.viewBox).attr("orient","auto");return i.append("path").attr("d",t.d),i},r=>r,r=>r.remove()).attr("id",r=>r.id).attr("markerWidth",t.pointerWidth).attr("markerHeight",t.pointerHeight).attr("refX",r=>r.refX).attr("refY",0)}function rF(e,t){function n(o){o.active||e.alphaTarget(.3).restart(),o.subject.fx=o.subject.x,o.subject.fy=o.subject.y,t.next("start")}function r(o){o.subject.fx=o.x,o.subject.fy=o.y,t.next("drag")}function i(o){o.active||e.alphaTarget(0),o.subject.fx=null,o.subject.fy=null,t.next("end")}return hs().on("start",n).on("drag",r).on("end",i)}function iF({nodeListGSelection:e,nodes:t}){return e.selectAll("g").data(t,n=>n.id).join(n=>n.append("g").classed(ZN,!0),n=>n,n=>n.remove())}function oF({nodeGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{V(o[i]).selectAll("circle").data([r]).join(s=>s.append("circle").classed(A2,!0).attr("cursor","pointer"),s=>s,s=>s.remove()).attr("r",s=>s.r).attr("fill",s=>Me({datum:s,colorType:t.bubble.fillColorType,fullChartParams:n})).attr("stroke",s=>Me({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",$2).each((r,i,o)=>{const a=V(o[i]);let s=!0;r.label.length<=t.bubbleLabel.lineLengthMin&&(s=!1),a.call(M$,{text:r.label,radius:r.r*t.bubbleLabel.fillRate,lineHeight:$2*t.bubbleLabel.lineHeight,isBreakAll:s})}),e.select("text").attr("pointer-events","none").attr("style",r=>t.bubbleLabel.styleFn(r)),e.select(`circle.${A2}`)}function aF({edgeListGSelection:e,edges:t}){return e.selectAll("g").data(t,n=>n.id).join(n=>n.append("g").classed(jN,!0),n=>n,n=>n.remove())}function sF({edgeGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{V(o[i]).selectAll("path").data([r]).join(s=>s.append("path").classed(S2,!0),s=>s,s=>s.remove()).attr("marker-end",s=>`url(#${s.markerId})`).attr("stroke",s=>Me({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.${S2}`)}function lF({edgeGSelection:e}){return e.each((t,n,r)=>{V(r[n]).selectAll("g").data([t]).join(o=>o.append("g").classed(w2,!0),o=>o,o=>o.remove())}),e.select(`g.${w2}`)}function uF({edgeLabelGSelection:e,fullParams:t,fullChartParams:n}){return e.each((r,i,o)=>{V(o[i]).selectAll("text").data([r],s=>s.id).join(s=>s.append("text").classed(T2,!0).attr("text-anchor","middle").attr("pointer-events","none"),s=>s,s=>s.remove()).text(s=>s.label).attr("fill",s=>Me({datum:s,colorType:t.arrowLabel.colorType,fullChartParams:n})).attr("font-size",n.styles.textSize).attr("style",s=>t.arrowLabel.styleFn(s))}),e.select(`text.${T2}`)}function cF({nodeGSelection:e,edgeGSelection:t,highlightIds:n,fullChartParams:r}){if(e.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=V(a[o]);n.includes(i.id)?s.style("opacity",1).transition("highlight").ease(sr).duration(500):s.style("opacity",r.styles.unhighlightedOpacity)})}const fF=ja(KN)(({selection:e,rootSelection:t,name:n,observer:r,subject:i})=>{const o=new J,a=e.append("g").classed(VN,!0),s=a.append("defs"),l=a.append("g").classed(HN,!0),u=a.append("g").classed(qN,!0);let c,f,h,p,d,m;const g=new Du("end"),y=new J,b=r.fullParams$.pipe(L(o),R(w=>{let D=w.zoomable?yn().on("zoom",F=>{a.attr("transform",`translate(
175
+ ${F.transform.x},
176
+ ${F.transform.y}
177
+ ) scale(
178
+ ${F.transform.k}
179
+ )`),w.arrowLabel.sizeFixed&&m&&m.attr("transform",`scale(${1/F.transform.k})`)}):yn().on("zoom",null);return w.scaleExtent&&D.scaleExtent([w.scaleExtent.min,w.scaleExtent.max]),t.call(D),D}));Y({d3Zoom:b,transform:r.fullParams$.pipe(L(o),R(w=>w.transform))}).pipe(L(o),G(async w=>w)).subscribe(w=>{e.call(w.d3Zoom.transform,Li.translate(w.transform.x,w.transform.y).scale(w.transform.k))});const v=Y({layout:r.layout$.pipe(Xi()),fullParams:r.fullParams$}).pipe(L(o),G(async w=>w),R(w=>QN(w.layout,w.fullParams)),pe(1)),x=r.computedData$.pipe(L(o),R(w=>{const D=w.nodes.filter(z=>z.value!=null);if(!D.length)return[0,2];const F=ic(w.nodes.map(z=>z.value));return D.length==1||F[0]===F[1]?[F[0]-1,F[1]+1]:F}),pe(1)),_=r.computedData$.pipe(L(o),R(w=>{const D=w.edges.filter(z=>z.value!=null);if(!D.length)return[0,2];const F=ic(w.edges.map(z=>z.value));return D.length==1||F[0]===F[1]?[F[0]-1,F[1]+1]:F}),pe(1)),A=x.pipe(L(o),R(w=>(w[1]-w[0])/2)),S=_.pipe(L(o),R(w=>(w[1]-w[0])/2)),P=Y({nodeMinMaxValue:x,fullParams:r.fullParams$}).pipe(L(o),G(async w=>w),R(w=>kn().domain(w.nodeMinMaxValue).range([w.fullParams.bubble.radiusMin,w.fullParams.bubble.radiusMax]).exponent(w.fullParams.bubble.arcScaleType==="area"?.5:1))),M=Y({edgeMinMaxValue:_,fullParams:r.fullParams$}).pipe(L(o),G(async w=>w),R(w=>xr().domain(w.edgeMinMaxValue).range([w.fullParams.arrow.strokeWidthMin,w.fullParams.arrow.strokeWidthMax]))),B=Y({computedData:r.computedData$,radiusScale:P,defaultNodeValue:A}).pipe(L(o),G(async w=>w),R(w=>new Map(w.computedData.nodes.map(D=>{let F=D;return F.r=w.radiusScale(F.value??w.defaultNodeValue),[F.id,F]})))),$=Y({computedData:r.computedData$,strokeWidthScale:M,defaultEdgeValue:S}).pipe(L(o),G(async w=>w),R(w=>new Map(w.computedData.edges.map(D=>{let F=D;return F.source=D.startNode,F.target=D.endNode,F.strokeWidth=w.strokeWidthScale(F.value??w.defaultEdgeValue),F.markerId=`${UN}__${F.id}`,[F.id,F]})))),k=Y({visibleComputedData:r.visibleComputedData$,RenderNodeMap:B,RenderEdgeMap:$}).pipe(L(o),G(async w=>w),R(w=>({nodes:w.visibleComputedData.nodes.map(D=>w.RenderNodeMap.get(D.id)),edges:w.visibleComputedData.edges.map(D=>w.RenderEdgeMap.get(D.id))})),pe(1)),C=r.fullParams$.pipe(L(o),R(w=>({viewBox:`-${w.arrow.pointerWidth} -${w.arrow.pointerHeight/2} ${w.arrow.pointerWidth} ${w.arrow.pointerHeight}`,d:`M${-w.arrow.pointerWidth},${-w.arrow.pointerHeight/2}L0,0L${-w.arrow.pointerWidth},${w.arrow.pointerHeight/2}`,pointerWidth:w.arrow.pointerWidth,pointerHeight:w.arrow.pointerHeight}))),T=Y({computedData:r.computedData$,fullParams:r.fullParams$,RenderNodeMap:B,RenderEdgeMap:$}).pipe(L(o),G(async w=>w),R(w=>w.computedData.edges.map(D=>{const F=w.RenderEdgeMap.get(D.id),z=w.RenderNodeMap.get(D.endNode.id);return{id:F.markerId,edgeId:D.id,strokeWidth:F.strokeWidth,refX:(z.r+w.fullParams.bubble.strokeWidth/2)/F.strokeWidth-1}})));return Y({defsSelection:s,markerParams:C,markerData:T}).pipe(L(o),R(w=>nF({defsSelection:s,markerParams:w.markerParams,markerData:w.markerData}))).subscribe(),Y({renderData:k,computedData:r.computedData$,CategoryNodeMap:r.CategoryNodeMap$,simulation:v,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$}).pipe(L(o),G(async w=>w)).subscribe(w=>{c=iF({nodeListGSelection:u,nodes:w.renderData.nodes}),f=oF({nodeGSelection:c,fullParams:w.fullParams,fullChartParams:w.fullChartParams}),f.call(rF(w.simulation,g)),h=aF({edgeListGSelection:l,edges:w.renderData.edges}),p=sF({edgeGSelection:h,fullParams:w.fullParams,fullChartParams:w.fullChartParams}),d=lF({edgeGSelection:h}),m=uF({edgeLabelGSelection:d,fullParams:w.fullParams,fullChartParams:w.fullChartParams}),w.simulation.nodes(w.renderData.nodes).on("tick",()=>{p.attr("d",tF),c.attr("transform",JN),d.attr("transform",D=>eF(D))}),w.simulation.force("link").links(w.renderData.edges),w.simulation.alpha(.3).restart(),f.on("mouseover",(D,F)=>{D.stopPropagation(),y.next({type:"relationship",eventName:"mouseover",pluginName:Ue,highlightTarget:w.fullChartParams.highlightTarget,datum:F,category:w.CategoryNodeMap.get(F.categoryLabel),categoryIndex:F.categoryIndex,categoryLabel:F.categoryLabel,event:D,data:w.computedData})}).on("mousemove",(D,F)=>{D.stopPropagation(),y.next({type:"relationship",eventName:"mousemove",pluginName:Ue,highlightTarget:w.fullChartParams.highlightTarget,datum:F,category:w.CategoryNodeMap.get(F.categoryLabel),categoryIndex:F.categoryIndex,categoryLabel:F.categoryLabel,event:D,data:w.computedData})}).on("mouseout",(D,F)=>{D.stopPropagation(),y.next({type:"relationship",eventName:"mouseout",pluginName:Ue,highlightTarget:w.fullChartParams.highlightTarget,datum:F,category:w.CategoryNodeMap.get(F.categoryLabel),categoryIndex:F.categoryIndex,categoryLabel:F.categoryLabel,event:D,data:w.computedData})}).on("click",(D,F)=>{D.stopPropagation(),y.next({type:"relationship",eventName:"click",pluginName:Ue,highlightTarget:w.fullChartParams.highlightTarget,datum:F,category:w.CategoryNodeMap.get(F.categoryLabel),categoryIndex:F.categoryIndex,categoryLabel:F.categoryLabel,event:D,data:w.computedData})})}),g.pipe(G(w=>Wi(()=>w==="end",y,va))).subscribe(w=>{i.event$.next(w)}),Y({renderData:k,highlightNodes:r.relationshipHighlightNodes$.pipe(R(w=>w.map(D=>D.id))),highlightEdges:r.relationshipHighlightEdges$.pipe(R(w=>w.map(D=>D.id))),fullChartParams:r.fullChartParams$,fullParams:r.fullParams$}).pipe(L(o),G(async w=>w)).subscribe(w=>{!c||!h||cF({nodeGSelection:c,edgeGSelection:h,highlightIds:w.highlightNodes,fullChartParams:w.fullChartParams})}),()=>{o.next(void 0)}}),P2="RelationshipLegend",hF=ja({name:P2,defaultParams:h2,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 J,o=n.fullParams$.pipe(L(i),R(s=>{const l=[{listRectWidth:s.listRectWidth,listRectHeight:s.listRectHeight,listRectRadius:s.listRectRadius}];return{...s,labelList:l}})),a=Ei(P2,{rootSelection:t,legendLabels$:n.categoryLabels$,fullParams$:o,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),a()}}),D2="RelationshipTooltip",pF=ja({name:D2,defaultParams:Yp,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 J,a=Bi(D2,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),M2={force:{strength:.08,velocityDecay:.3,collisionSpacing:2},bubbleLabel:{fillRate:.6,lineHeight:1,lineLengthMin:4},arcScaleType:"area"},C2={outerRadius:.85,innerRadius:0,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,padAngle:0,strokeColorType:"background",strokeWidth:1,cornerRadius:0},Wp={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"}]};Wp.renderFn.toString=()=>`(eventData) => {
180
+ if (eventData.eventName === 'mouseover' || eventData.eventName === 'mousemove') {
181
+ return [String(eventData.datum.value)]
164
182
  }
165
183
  return [
166
184
  String(
@@ -169,19 +187,19 @@ ${u}`}};pp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
169
187
  return acc + seriesData.reduce((_acc, data) => {
170
188
  return _acc + (data.value ?? 0)
171
189
  }, 0)
172
- }, 0) * t
190
+ }, 0) * (eventData.tween ?? 1)
173
191
  )
174
192
  )
175
193
  ]
176
- }`;const Mp={outerRadius:.85,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,labelCentroid:2.1,labelColorType:"primary",labelFn:t=>String(t.label)};Mp.labelFn.toString=()=>"d => String(d.label)";const r$={outerRadius:.85,padAngle:0,strokeColorType:"background",strokeWidth:0,cornerRadius:0,arcScaleType:"area",angleIncreaseWhileHighlight:.05},Cp={outerRadius:.85,labelCentroid:2.1,labelFn:t=>String(t.label),labelColorType:"primary",arcScaleType:"area"};Cp.labelFn.toString=()=>"d => String(d.label)";const i$={placement:"right-end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},Lp={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(t,{styles:e,utils:n})=>{const r=t.seriesLabel.slice(0,7)!=="series_",i=t.datum.label.slice(0,7)!=="series_",o=e.textSizePx*.7,a=e.textSizePx/2-o/2,s=r?`<rect width="${o}" height="${o}" x="${a}" y="${a-1}" rx="${o/2}" fill="${t.datum.color}"></rect>
177
- <text x="${e.textSizePx*1.5}" font-size="${e.textSizePx}" dominant-baseline="hanging" fill="${e.textColor}">
178
- <tspan>${t.seriesLabel}</tspan>
179
- </text>`:"",l=i?`<tspan>${t.datum.label}</tspan> `:"",u=`<text font-size="${e.textSizePx}" dominant-baseline="hanging" fill="${e.textColor}">
180
- ${l}<tspan font-weight="bold">${t.datum.value}</tspan>
194
+ }`;const Xp={outerRadius:.85,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,labelCentroid:2.1,labelColorType:"primary",labelFn:e=>String(e.label)};Xp.labelFn.toString=()=>"d => String(d.label)";const L2={outerRadius:.85,padAngle:0,strokeColorType:"background",strokeWidth:0,cornerRadius:0,arcScaleType:"area",angleIncreaseWhileHighlight:.05},Vp={outerRadius:.85,labelCentroid:2.1,labelFn:e=>String(e.label),labelColorType:"primary",arcScaleType:"area"};Vp.labelFn.toString=()=>"d => String(d.label)";const k2={placement:"right-end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},Up={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=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>
195
+ <text x="${t.textSizePx*1.5}" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
196
+ <tspan>${e.seriesLabel}</tspan>
197
+ </text>`:"",l=i?`<tspan>${e.datum.label}</tspan> `:"",u=`<text font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
198
+ ${l}<tspan font-weight="bold">${e.datum.value}</tspan>
181
199
  </text>`;return`${s}
182
- <g ${r?`transform="translate(0, ${e.textSizePx*2})"`:""}>
200
+ <g ${r?`transform="translate(0, ${t.textSizePx*2})"`:""}>
183
201
  ${u}
184
- </g>`}};Lp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
202
+ </g>`}};Up.renderFn.toString=()=>`(eventData, { styles, utils }) => {
185
203
  const hasSeriesLabel = eventData.seriesLabel.slice(0, 7) === 'series_' ? false : true
186
204
  const hasDatumLabel = eventData.datum.label.slice(0, 7) === 'series_' ? false : true
187
205
  const bulletWidth = styles.textSizePx * 0.7
@@ -203,14 +221,14 @@ ${u}`}};pp.renderFn.toString=()=>`(eventData, { styles, utils }) => {
203
221
  <g \${hasSeriesLabel ? \`transform="translate(0, \${styles.textSizePx * 2})"\` : ''}>
204
222
  \${datumSvg}
205
223
  </g>\`
206
- }`;const qB={name:"Bubbles",defaultParams:e$,layerIndex:Ee,validator:(t,{validateColumns:e})=>{const n=e(t,{force:{toBeTypes:["object"]},bubbleText:{toBeTypes:["object"]},arcScaleType:{toBe:'"area" | "radius"',test:r=>r==="area"||r==="radius"}});if(t.force){const r=e(t.force,{velocityDecay:{toBeTypes:["number"]},collisionSpacing:{toBeTypes:["number"]},strength:{toBeTypes:["number"]}});if(r.status==="error")return r}if(t.bubbleText){const r=e(t.bubbleText,{fillRate:{toBeTypes:["number"]},lineHeight:{toBeTypes:["number"]},lineLengthMin:{toBeTypes:["number"]}});if(r.status==="error")return r}return n}};let Rn;function ZB(t,e){return Ay().velocityDecay(e.force.velocityDecay).force("collision",_y().radius(n=>n.r+e.force.collisionSpacing)).force("charge",Ty().strength(n=>-Math.pow(n.r,2)*e.force.strength)).on("tick",()=>{t.attr("transform",n=>`translate(${n.x},${n.y})`)})}function KB({visibleComputedLayoutData:t,LastBubbleDataMap:e,graphicWidth:n,graphicHeight:r,SeriesContainerPositionMap:i,scaleType:o}){const a=Math.min(n,r)/2,s=t.flat(),l=s.reduce((h,p)=>h+p.value,0),u=dr().domain([0,l]).range([0,a]).exponent(o==="area"?.5:1),c=o==="area"?1:(()=>{const h=a*a*Math.PI;return Math.sqrt(h/dc(s,p=>Math.PI*Math.pow(u(p.value),2)))})(),f=.9;return s.map(h=>{const p=h,d=e.get(p.id);if(d)p.x=d.x,p.y=d.y;else{const g=i.get(p.seriesLabel);p.x=Math.random()*g.width,p.y=Math.random()*g.height}const m=u(p.value??0)*c*f;return p.r=m,p._originR=m,p})}function QB({selection:t,bubblesData:e,fullParams:n,sumSeries:r}){const i=t.selectAll("g").data(e,a=>a.id).join(a=>{const s=a.append("g").attr("cursor","pointer").attr("font-size",12).style("fill","#ffffff").attr("text-anchor","middle");return s.append("circle").attr("class","node").attr("cx",0).attr("cy",0).attr("fill",l=>l.color),s.append("text").style("opacity",.8).attr("pointer-events","none"),s},a=>a,a=>a.remove()).attr("transform",a=>`translate(${a.x},${a.y})`),o=r?"seriesLabel":"label";return i.select("circle").transition().duration(200).attr("r",a=>a.r).attr("fill",a=>a.color),i.each((a,s,l)=>{const u=H(l[s]);let c=!0;a[o].length<=n.bubbleText.lineLengthMin&&(c=!1),u.call(MI,{text:a[o],radius:a.r*n.bubbleText.fillRate,lineHeight:n.bubbleText.lineHeight,isBreakAll:c})}),i}function JB(){return O0().on("start",(t,e)=>{t.active||Rn.alpha(1).restart(),e.fx=e.x,e.fy=e.y}).on("drag",(t,e)=>{t.active||Rn.alphaTarget(0),e.fx=t.x,e.fy=t.y}).on("end",(t,e)=>{e.fx=null,e.fy=null})}function tN({fullParams:t,SeriesContainerPositionMap:e}){Rn.force("x",Py().strength(t.force.strength).x(n=>e.get(n.seriesLabel).centerX)).force("y",Dy().strength(t.force.strength).y(n=>e.get(n.seriesLabel).centerY)),Rn.alpha(1).restart()}function eN({bubblesSelection:t,highlightIds:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1);return}t.each((r,i,o)=>{const a=H(o[i]);e.includes(r.id)?a.style("opacity",1).transition("highlight").ease(fo).duration(500):a.style("opacity",n.styles.unhighlightedOpacity)})}const nN=vn(qB)(({selection:t,name:e,observer:n,subject:r})=>{const i=new tt;let o=new Map;const a=n.fullDataFormatter$.pipe(B(f=>f.sumSeries),Q()),s=n.fullParams$.pipe(k(i),B(f=>f.arcScaleType),Q()),l=Y({layout:n.layout$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,visibleComputedLayoutData:n.visibleComputedLayoutData$,scaleType:s}).pipe(k(i),G(async f=>f),B(f=>KB({visibleComputedLayoutData:f.visibleComputedLayoutData,LastBubbleDataMap:o,graphicWidth:f.layout.width,graphicHeight:f.layout.height,SeriesContainerPositionMap:f.SeriesContainerPositionMap,scaleType:f.scaleType})),yt(1));l.subscribe(f=>{o=new Map(f.map(h=>[h.id,h]))});const u=n.fullChartParams$.pipe(k(i),B(f=>f.highlightTarget),Q()),c=Y({bubblesData:l,fullParams:n.fullParams$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,sumSeries:a}).pipe(k(i),G(async f=>f),B(f=>{Rn&&Rn.stop();const h=QB({selection:t,bubblesData:f.bubblesData,fullParams:f.fullParams,sumSeries:f.sumSeries});return Rn=ZB(h,f.fullParams),Rn.nodes(f.bubblesData),tN({fullParams:f.fullParams,SeriesContainerPositionMap:f.SeriesContainerPositionMap}),h}));return Y({bubblesSelection:c,computedData:n.computedData$,SeriesDataMap:n.SeriesDataMap$,highlightTarget:u}).pipe(k(i),G(async f=>f)).subscribe(f=>{f.bubblesSelection.on("mouseover",(h,p)=>{r.event$.next({type:"series",eventName:"mouseover",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("mousemove",(h,p)=>{r.event$.next({type:"series",eventName:"mousemove",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("mouseout",(h,p)=>{r.event$.next({type:"series",eventName:"mouseout",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("click",(h,p)=>{r.event$.next({type:"series",eventName:"click",pluginName:e,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).call(JB())}),Y({bubblesSelection:c,bubblesData:l,highlight:n.seriesHighlight$.pipe(B(f=>f.map(h=>h.id))),fullChartParams:n.fullChartParams$,fullParams:n.fullParams$,sumSeries:a,SeriesContainerPositionMap:n.SeriesContainerPositionMap$}).pipe(k(i),G(async f=>f)).subscribe(f=>{eN({bubblesSelection:f.bubblesSelection,highlightIds:f.highlight,fullChartParams:f.fullChartParams})}),()=>{i.next(void 0)}});function o$({data:t,startAngle:e,endAngle:n}){return lv().startAngle(e).endAngle(n).value(o=>o.value).sort((o,a)=>o.seq-a.seq)(t).map((o,a)=>{let s=o;return s.id=o.data.id,s})}function rN({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r}){const i=J(e,"series");return Y({seriesLabels:r,separateSeries:n}).pipe(G(async o=>o),B((o,a)=>{const s=o.separateSeries?o.seriesLabels:[o.seriesLabels.join("")];return t.selectAll(`g.${i}`).data(s,l=>l).join(l=>l.append("g").classed(i,!0),l=>l,l=>l.remove())}),yt(1))}const aa=({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r,seriesContainerPosition$:i})=>{const o=rN({selection:t,pluginName:e,separateSeries$:n,seriesLabels$:r});return Y({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(G(async a=>a),Q((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})`})}),Y({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(G(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}},kp="Pie",iN={name:kp,defaultParams:n$,layerIndex:Ee,validator:(t,{validateColumns:e})=>e(t,{outerRadius:{toBeTypes:["number"]},innerRadius:{toBeTypes:["number"]},outerRadiusWhileHighlight:{toBeTypes:["number"]},startAngle:{toBeTypes:["number"]},endAngle:{toBeTypes:["number"]},padAngle:{toBeTypes:["number"]},strokeColorType:{toBeTypes:["string"]},strokeWidth:{toBeTypes:["number"]},cornerRadius:{toBeTypes:["number"]}})};function oN({enter:t,exit:e,data:n,lastTweenData:r,fullParams:i}){return!t.size()&&!e.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 Rp(a,i.startAngle,i.endAngle,1)}:o=>Rp(n,i.startAngle,i.endAngle,o)}function Rp(t,e,n,r){return t.map((i,o)=>{const a=e+(i.startAngle-e)*r,s=a+(i.endAngle-i.startAngle)*r;return{...i,startAngle:a,endAngle:s}})}function a$({selection:t,data:e,arc:n,pathClassName:r,fullParams:i,fullChartParams:o}){return t.selectAll("path").data(e,s=>s.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(s,l)=>s.data.color).attr("stroke",(s,l)=>we({datum:s.data,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("d",(s,l)=>n(s))}function aN({pathSelection:t,ids:e,fullChartParams:n,arc:r,arcHighlight:i}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1).attr("d",o=>r(o));return}t.each((o,a,s)=>{const l=H(s[a]);e.includes(o.data.id)?l.style("opacity",1).transition("highlight").ease(fo).duration(500).attr("d",u=>i(u)):l.style("opacity",n.styles.unhighlightedOpacity).transition("highlight").attr("d",u=>r(u))})}function sN(t,e){const n=new tt,r=J(t,"path");let i=[],o=[];const a=e.seriesContainerPosition$.pipe(k(n),B(h=>h.width<h.height?h.width:h.height),Q()),s=new pt(h=>{Y({containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$}).pipe(k(n),G(async p=>p)).subscribe(p=>{const d=o$({data:p.containerVisibleComputedLayoutData,startAngle:p.fullParams.startAngle,endAngle:p.fullParams.endAngle});h.next(d)})}),l=new pt(h=>{Y({shorterSideWith:a,fullParams:e.fullParams$}).pipe(k(n),G(async p=>p)).subscribe(p=>{const d=Ql({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadius,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});h.next(d)})}),u=new pt(h=>{Y({shorterSideWith:a,fullParams:e.fullParams$}).pipe(k(n),G(async p=>p)).subscribe(p=>{const d=Ql({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadiusWhileHighlight,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});h.next(d)})}),c=e.fullChartParams$.pipe(k(n),B(h=>h.highlightTarget),Q()),f=new pt(h=>{Y({pieData:s,arc:l,computedData:e.computedData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,highlightTarget:c}).pipe(k(n),G(async p=>p)).subscribe(p=>{e.containerSelection.interrupt("graphicMove");const d=e.containerSelection.selectAll("path").data(p.pieData,b=>b.id),m=d.enter(),g=d.exit(),y=oN({enter:m,exit:g,data:p.pieData,lastTweenData:i,fullParams:p.fullParams});e.containerSelection.transition("graphicMove").duration(p.fullChartParams.transitionDuration).tween("move",(b,v)=>x=>{o=y(x),a$({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams})}).on("end",(b,v)=>{o=Rp(p.pieData,p.fullParams.startAngle,p.fullParams.endAngle,1);const x=a$({selection:e.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams});h.next(x),i=Object.assign([],p.pieData),e.event$.next({type:"series",pluginName:t,eventName:"transitionEnd",event:void 0,highlightTarget:p.highlightTarget,datum:null,series:[],seriesIndex:-1,seriesLabel:"",data:p.computedData})})})}).pipe(yt(1));return Y({pathSelection:f,SeriesDataMap:e.SeriesDataMap$,computedData:e.computedData$,highlightTarget:c}).pipe(k(n),G(async h=>h)).subscribe(h=>{h.pathSelection.on("mouseover",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mouseover",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("mousemove",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mousemove",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("mouseout",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"mouseout",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("click",(p,d)=>{p.stopPropagation(),e.event$.next({type:"series",eventName:"click",pluginName:t,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})})}),Y({pathSelection:f,highlight:e.seriesHighlight$.pipe(B(h=>h.map(p=>p.id))),fullChartParams:e.fullChartParams$,arc:l,arcHighlight:u}).pipe(k(n),G(async h=>h)).subscribe(h=>{aN({pathSelection:h.pathSelection,ids:h.highlight,fullChartParams:h.fullChartParams,arc:h.arc,arcHighlight:h.arcHighlight})}),()=>{n.next(void 0)}}const lN=vn(iN)(({selection:t,name:e,subject:n,observer:r})=>{const i=new tt,{seriesCenterSelection$:o}=aa({selection:t,pluginName:kp,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(k(i)).subscribe(s=>{a.forEach(l=>l()),s.each((l,u,c)=>{const f=H(c[u]),h=r.visibleComputedLayoutData$.pipe(k(i),B(d=>d[u]??d[0])),p=r.seriesContainerPosition$.pipe(k(i),B(d=>d[u]??d[0]));a[u]=sN(kp,{containerSelection:f,computedData$:r.computedData$,containerVisibleComputedLayoutData$:h,SeriesDataMap$:r.SeriesDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,event$:n.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),ou="PieEventTexts",s$=J(ou,"text"),uN={name:ou,defaultParams:Dp,layerIndex:sp,validator:(t,{validateColumns:e})=>e(t,{eventFn:{toBeTypes:["Function"]},textAttrs:{toBeTypes:["object[]"]},textStyles:{toBeTypes:["object[]"]}})};function Ep(t,e){const n=t.selectAll(`text.${s$}`).data(e),r=n.enter().append("text").classed(s$,!0),i=n.merge(r);return i.each((o,a,s)=>{const l=H(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 Ip({eventData:t,eventName:e,t:n,eventFn:r,textAttrs:i,textStyles:o}){return r(t,e,n).map((s,l)=>({text:s,attr:i[l],style:o[l]}))}function cN(t,e){const n=new tt;let r;const i=e.fullChartParams$.pipe(k(n),B(o=>o.highlightTarget),Q());return Y({computedData:e.computedData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,highlightTarget:i}).pipe(k(n),G(async o=>o)).subscribe(o=>{e.containerSelection.transition("move").duration(o.fullChartParams.transitionDuration).tween("move",(a,s)=>l=>{const u=Ip({eventData:{type:"series",pluginName:t,eventName:"transitionMove",event:a,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:l,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});Ep(e.containerSelection,u)}).on("end",(a,s)=>{const l=Ip({eventData:{type:"series",pluginName:t,eventName:"transitionEnd",event:a,highlightTarget:o.highlightTarget,data:o.computedData,series:[],seriesIndex:-1,seriesLabel:"",datum:null},eventName:"transitionMove",t:1,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});Ep(e.containerSelection,l),r&&r.unsubscribe(),r=e.event$.subscribe(u=>{const c=Ip({eventData:u,eventName:u.eventName,t:1,eventFn:o.fullParams.eventFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});Ep(e.containerSelection,c)})})}),()=>{n.next(void 0)}}const fN=vn(uN)(({selection:t,name:e,observer:n,subject:r})=>{const i=new tt,{seriesCenterSelection$:o}=aa({selection:t,pluginName:ou,separateSeries$:n.separateSeries$,seriesLabels$:n.seriesLabels$,seriesContainerPosition$:n.seriesContainerPosition$}),a=[];return o.pipe(k(i)).subscribe(s=>{a.forEach(l=>l()),s.each((l,u,c)=>{const f=H(c[u]),h=n.computedLayoutData$.pipe(k(i),B(d=>d[u]??d[0])),p=n.seriesContainerPosition$.pipe(k(i),B(d=>d[u]??d[0]));a[u]=cN(ou,{containerSelection:f,computedData$:n.computedData$,containerComputedLayoutData$:h,SeriesDataMap$:n.SeriesDataMap$,fullParams$:n.fullParams$,fullChartParams$:n.fullChartParams$,seriesHighlight$:n.seriesHighlight$,seriesContainerPosition$:p,event$:r.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),Pi="PieLabels",hN=J(Pi,"label-g"),pN=J(Pi,"line-g"),dN=J(Pi,"text"),l$=2,gN={name:Pi,defaultParams:Mp,layerIndex:sp,validator:(t,{validateColumns:e})=>e(t,{outerRadius:{toBeTypes:["number"]},outerRadiusWhileHighlight:{toBeTypes:["number"]},startAngle:{toBeTypes:["number"]},endAngle:{toBeTypes:["number"]},labelCentroid:{toBeTypes:["number"]},labelFn:{toBeTypes:["Function"]},labelColorType:{toBeOption:"ColorType"}})};function mN({pieData:t,arc:e,arcMouseover:n,labelCentroid:r,lineStartCentroid:i,fullParams:o}){return t.map((a,s)=>{const[l,u]=e.centroid(a),[c,f]=n.centroid(a),h=o.labelFn(a.data);return{pieDatum:a,arcIndex:s,arcLabels:h.split(`
207
- `),lineStartX:l*i,lineStartY:u*i,lineStartMouseoverX:c*i,lineStartMouseoverY:f*i,x:l*r,y:u*r,mouseoverX:c*r,mouseoverY:f*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 yN({labelGSelection:t,data:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=t.selectAll("text").data(e,a=>a.pieDatum.id).join("text").classed(dN,!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)=>we({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).each((a,s,l)=>{x2(H(l[s]),{textArr:a.arcLabels,textSizePx:i,quadrant:a.quadrant})});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function bN(t,e,n){const r=t.nodes(),i=n,o=r.map((a,s)=>{const l=a.getBBox(),u=[e[s].x,e[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];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=u.x+e[l].collisionShiftX,p=u.y+e[l].collisionShiftY;if(!(c+s.width/2<h-u.width/2||c-s.width/2>h+u.width/2||f+s.height/2<p-u.height/2||f-s.height/2>p+u.height/2)){if(e[l].quadrant==2){const d=p>f?-i*2:-i;e[l].collisionShiftY+=d}else if(e[l].quadrant==4){const d=p>f?i:i*2;e[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];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=u.x+e[l].collisionShiftX,p=u.y+e[l].collisionShiftY;if(!(c+s.width/2<h-u.width/2||c-s.width/2>h+u.width/2||f+s.height/2<p-u.height/2||f-s.height/2>p+u.height/2)){if(e[l].quadrant==1){const d=p>f?-i*2:-i;e[l].collisionShiftY+=d}else if(e[l].quadrant==3){const d=p>f?i:i*2;e[l].collisionShiftY+=d}}}}t.data(e).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function xN({lineGSelection:t,data:e,fullParams:n,fullChartParams:r}){const i=e.filter(a=>a.collisionShiftX||a.collisionShiftY),o=t.selectAll("polyline").data(i,a=>a.pieDatum.id).join("polyline").attr("stroke",a=>we({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 vN({textSelection:t,lineSelection:e,ids:n,fullChartParams:r}){if(t.interrupt("highlight"),e.interrupt("highlight"),!n.length){t.transition("highlight").duration(200).attr("transform",i=>`translate(${i.x+i.collisionShiftX},${i.y+i.collisionShiftY})`).style("opacity",1),e.transition("highlight").duration(200).style("opacity",1);return}t.each((i,o,a)=>{const s=H(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})`)}),e.each((i,o,a)=>{const s=H(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 $N(t,e){const n=new tt;e.containerSelection.selectAll("g").remove();const r=e.containerSelection.append("g");r.classed(pN,!0);const i=e.containerSelection.append("g");i.classed(hN,!0);const o=new tt,a=new tt;let s=[];const l=e.seriesContainerPosition$.pipe(k(n),B(c=>c.width<c.height?c.width:c.height),Q()),u=e.fullParams$.pipe(k(n),B(c=>c.labelCentroid>=l$?l$:c.labelCentroid));return Y({shorterSideWith:l,containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,textSizePx:e.textSizePx$,lineStartCentroid:u}).pipe(k(n),G(async c=>c)).subscribe(c=>{const f=Ql({axisWidth:c.shorterSideWith,innerRadius:0,outerRadius:c.fullParams.outerRadius,padAngle:0,cornerRadius:0}),h=Ql({axisWidth:c.shorterSideWith,innerRadius:0,outerRadius:c.fullParams.outerRadiusWhileHighlight,padAngle:0,cornerRadius:0}),p=o$({data:c.containerVisibleComputedLayoutData,startAngle:c.fullParams.startAngle,endAngle:c.fullParams.endAngle});s=mN({pieData:p,arc:f,arcMouseover:h,labelCentroid:c.fullParams.labelCentroid,lineStartCentroid:c.lineStartCentroid,fullParams:c.fullParams}),r.selectAll("polyline").remove();const d=yN({labelGSelection:i,data:s,fullParams:c.fullParams,fullChartParams:c.fullChartParams,textSizePx:c.textSizePx});setTimeout(()=>{bN(d,s,c.textSizePx);const m=xN({lineGSelection:r,data:s,fullParams:c.fullParams,fullChartParams:c.fullChartParams});a.next(m)},1e3),o.next(d)}),Y({textSelection:o,lineSelection:a,highlight:e.seriesHighlight$.pipe(B(c=>c.map(f=>f.id))),fullChartParams:e.fullChartParams$}).pipe(k(n),G(async c=>c)).subscribe(c=>{vN({textSelection:c.textSelection,lineSelection:c.lineSelection,ids:c.highlight,fullChartParams:c.fullChartParams})}),()=>{n.next(void 0)}}const _N=vn(gN)(({selection:t,observer:e,subject:n})=>{const r=new tt,{seriesCenterSelection$:i}=aa({selection:t,pluginName:Pi,separateSeries$:e.separateSeries$,seriesLabels$:e.seriesLabels$,seriesContainerPosition$:e.seriesContainerPosition$}),o=[];return i.pipe(k(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,l,u)=>{const c=H(u[l]),f=e.visibleComputedLayoutData$.pipe(k(r),B(p=>p[l]??p[0])),h=e.seriesContainerPosition$.pipe(k(r),B(p=>p[l]??p[0]));o[l]=$N(Pi,{containerSelection:c,containerVisibleComputedLayoutData$:f,fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,textSizePx$:e.textSizePx$,seriesHighlight$:e.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),Bp="Rose",wN=Math.PI*2,SN={name:Bp,defaultParams:r$,layerIndex:Ee,validator:(t,{validateColumns:e})=>e(t,{outerRadius:{toBeTypes:["number"]},padAngle:{toBeTypes:["number"]},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},cornerRadius:{toBeTypes:["number"]},arcScaleType:{toBe:'"area" | "radius"',test:r=>r==="area"||r==="radius"},angleIncreaseWhileHighlight:{toBeTypes:["number"]}})};function AN({cornerRadius:t,outerRadius:e,axisWidth:n,maxValue:r,arcScaleType:i,fullParams:o}){const a=n/2*e,s=i==="area"?.5:1,l=dr().domain([0,r]).range([0,a]).exponent(s);return u=>{const c=l(u.prevValue),f=l(u.value),h=tn(c,f);return p=>{const d=h(p);return Ol().innerRadius(0).outerRadius(d).padAngle(o.padAngle).padRadius(d).cornerRadius(t)(u)}}}function TN({pathSelection:t,ids:e,fullParams:n,fullChartParams:r,tweenArc:i}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").style("opacity",1).attr("d",o=>i(o)(1));return}t.each((o,a,s)=>{const l=H(s[a]);e.includes(o.data.id)?l.style("opacity",1).transition("highlight").ease(fo).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 PN(t,e){const n=new tt,r=J(t,"path");let i=[];const o=e.seriesContainerPosition$.pipe(k(n),B(p=>p.width<p.height?p.width:p.height),Q()),a=Y({containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,fullParams:e.fullParams$}).pipe(k(n),G(async p=>p),B(p=>{const d=wN/p.containerVisibleComputedLayoutData.length;return p.containerVisibleComputedLayoutData.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=e.fullChartParams$.pipe(k(n),B(p=>p.highlightTarget),Q()),l=e.visibleComputedLayoutData$.pipe(B(p=>Math.max(...p.flat().map(d=>d.value))),Q()),u=Y({fullParams:e.fullParams$,axisWidth:o,maxValue:l}).pipe(k(n),G(async p=>p),B(p=>AN({cornerRadius:p.fullParams.cornerRadius,outerRadius:p.fullParams.outerRadius,axisWidth:p.axisWidth,maxValue:p.maxValue,arcScaleType:p.fullParams.arcScaleType,fullParams:p.fullParams}))),c=e.fullChartParams$.pipe(k(n),B(p=>p.transitionDuration),Q()),f=new L$(!1),h=new pt(p=>{Y({pieData:a,tweenArc:u,transitionDuration:c,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$}).pipe(k(n),G(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));f.next(!0);const g=e.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)=>we({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),f.next(!1)}),i=Object.assign([],m)})}).pipe(yt(1));return Y({pathSelection:h,SeriesDataMap:e.SeriesDataMap$,computedData:e.computedData$,highlightTarget:s}).pipe(k(n),G(async p=>p)).subscribe(p=>{p.pathSelection.on("mouseover",(d,m)=>{d.stopPropagation(),e.event$.next({type:"series",eventName:"mouseover",pluginName:t,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(),e.event$.next({type:"series",eventName:"mousemove",pluginName:t,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(),e.event$.next({type:"series",eventName:"mouseout",pluginName:t,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(),e.event$.next({type:"series",eventName:"click",pluginName:t,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})})}),Y({pathSelection:h,highlight:e.seriesHighlight$.pipe(B(p=>p.map(d=>d.id))),fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,tweenArc:u,isTransitionMoving:f}).pipe(k(n),G(async p=>p),Dr(p=>!p.isTransitionMoving)).subscribe(p=>{TN({pathSelection:p.pathSelection,ids:p.highlight,fullParams:p.fullParams,fullChartParams:p.fullChartParams,tweenArc:p.tweenArc})}),()=>{n.next(void 0)}}const DN=vn(SN)(({selection:t,name:e,subject:n,observer:r})=>{const i=new tt,{seriesCenterSelection$:o}=aa({selection:t,pluginName:Bp,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(k(i)).subscribe(s=>{a.forEach(l=>l()),s.each((l,u,c)=>{const f=H(c[u]),h=r.visibleComputedLayoutData$.pipe(k(i),B(d=>JSON.parse(JSON.stringify(d[u]??d[0])))),p=r.seriesContainerPosition$.pipe(k(i),B(d=>JSON.parse(JSON.stringify(d[u]??d[0]))));a[u]=PN(Bp,{containerSelection:f,computedData$:r.computedData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,containerVisibleComputedLayoutData$:h,SeriesDataMap$:r.SeriesDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,event$:n.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),Di="RoseLabels",MN=J(Di,"label-g"),CN=J(Di,"line-g"),LN=J(Di,"text"),u$=2,kN={name:Di,defaultParams:Cp,layerIndex:sp,validator:(t,{validateColumns:e})=>e(t,{outerRadius:{toBeTypes:["number"]},labelCentroid:{toBeTypes:["number"]},labelFn:{toBeTypes:["Function"]},labelColorType:{toBeOption:"ColorType"},arcScaleType:{toBe:'"area" | "radius"',test:r=>r==="area"||r==="radius"}})};function RN({pieData:t,labelCentroid:e,arcScaleType:n,maxValue:r,axisWidth:i,outerRadius:o,lineStartCentroid:a,fullParams:s}){const l=i/2*o,u=n==="area"?.5:1,c=dr().domain([0,r]).range([0,l]).exponent(u);return t.map((f,h)=>{const p=c(f.value),d=Ol().innerRadius(0).outerRadius(p).padAngle(0).padRadius(p).cornerRadius(0),[m,g]=d.centroid(f),[y,b]=[m,g],v=s.labelFn(f.data);return{pieDatum:f,arcIndex:h,arcLabels:v.split(`
208
- `),lineStartX:m*a,lineStartY:g*a,lineStartMouseoverX:y*a,lineStartMouseoverY:b*a,x:m*e,y:g*e,mouseoverX:y*e,mouseoverY:b*e,textWidth:0,collisionShiftX:0,collisionShiftY:0,quadrant:m>=0&&g<=0?1:m<0&&g<=0?2:m<0&&g>0?3:4}}).filter(f=>f.pieDatum.data.visible)}function EN({labelGSelection:t,data:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=t.selectAll("text").data(e,a=>a.pieDatum.id).join("text").classed(LN,!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)=>we({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).each((a,s,l)=>{x2(H(l[s]),{textArr:a.arcLabels,textSizePx:i,quadrant:a.quadrant})});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function IN(t,e,n){const r=t.nodes(),i=n,o=r.map((a,s)=>{const l=a.getBBox(),u=[e[s].x,e[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];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=u.x+e[l].collisionShiftX,p=u.y+e[l].collisionShiftY;if(!(c+s.width/2<h-u.width/2||c-s.width/2>h+u.width/2||f+s.height/2<p-u.height/2||f-s.height/2>p+u.height/2)){if(e[l].quadrant==2){const d=p>f?-i*2:-i;e[l].collisionShiftY+=d}else if(e[l].quadrant==4){const d=p>f?i:i*2;e[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];e[a].textWidth=s.width;const c=s.x+e[a].collisionShiftX,f=s.y+e[a].collisionShiftY,h=u.x+e[l].collisionShiftX,p=u.y+e[l].collisionShiftY;if(!(c+s.width/2<h-u.width/2||c-s.width/2>h+u.width/2||f+s.height/2<p-u.height/2||f-s.height/2>p+u.height/2)){if(e[l].quadrant==1){const d=p>f?-i*2:-i;e[l].collisionShiftY+=d}else if(e[l].quadrant==3){const d=p>f?i:i*2;e[l].collisionShiftY+=d}}}}t.data(e).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function BN({lineGSelection:t,data:e,fullParams:n,fullChartParams:r}){const i=e.filter(a=>a.collisionShiftX||a.collisionShiftY),o=t.selectAll("polyline").data(i,a=>a.pieDatum.id).join("polyline").attr("stroke",a=>we({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 NN({textSelection:t,lineSelection:e,ids:n,fullChartParams:r}){if(t.interrupt("highlight"),e.interrupt("highlight"),!n.length){t.transition("highlight").duration(200).attr("transform",i=>`translate(${i.x+i.collisionShiftX},${i.y+i.collisionShiftY})`).style("opacity",1),e.transition("highlight").duration(200).style("opacity",1);return}t.each((i,o,a)=>{const s=H(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})`)}),e.each((i,o,a)=>{const s=H(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 FN(t,e){const n=new tt;e.containerSelection.selectAll("g").remove();const r=e.containerSelection.append("g");r.classed(CN,!0);const i=e.containerSelection.append("g");i.classed(MN,!0);const o=new tt,a=new tt;let s=[];const l=e.seriesContainerPosition$.pipe(k(n),B(f=>f.width<f.height?f.width:f.height),Q()),u=e.visibleComputedLayoutData$.pipe(B(f=>Math.max(...f.flat().map(h=>h.value))),Q()),c=e.fullParams$.pipe(k(n),B(f=>f.labelCentroid>=u$?u$:f.labelCentroid));return Y({shorterSideWith:l,containerVisibleComputedLayoutData:e.containerVisibleComputedLayoutData$,maxValue:u,fullParams:e.fullParams$,fullChartParams:e.fullChartParams$,textSizePx:e.textSizePx$,lineStartCentroid:c}).pipe(k(n),G(async f=>f)).subscribe(f=>{const h=Math.PI*2/f.containerVisibleComputedLayoutData.length,p=f.containerVisibleComputedLayoutData.map((m,g)=>({id:m.id,data:m,index:g,value:m.value,startAngle:h*g,endAngle:h*(g+1),padAngle:0}));s=RN({pieData:p,labelCentroid:f.fullParams.labelCentroid,arcScaleType:f.fullParams.arcScaleType,maxValue:f.maxValue,axisWidth:f.shorterSideWith,outerRadius:f.fullParams.outerRadius,lineStartCentroid:f.lineStartCentroid,fullParams:f.fullParams}),r.selectAll("polyline").remove();const d=EN({labelGSelection:i,data:s,fullParams:f.fullParams,fullChartParams:f.fullChartParams,textSizePx:f.textSizePx});setTimeout(()=>{IN(d,s,f.textSizePx);const m=BN({lineGSelection:r,data:s,fullParams:f.fullParams,fullChartParams:f.fullChartParams});a.next(m)},1e3),o.next(d)}),Y({textSelection:o,lineSelection:a,highlight:e.seriesHighlight$.pipe(B(f=>f.map(h=>h.id))),fullChartParams:e.fullChartParams$}).pipe(k(n),G(async f=>f)).subscribe(f=>{NN({textSelection:f.textSelection,lineSelection:f.lineSelection,ids:f.highlight,fullChartParams:f.fullChartParams})}),()=>{n.next(void 0)}}const ON=vn(kN)(({selection:t,observer:e,subject:n})=>{const r=new tt,{seriesCenterSelection$:i}=aa({selection:t,pluginName:Di,separateSeries$:e.separateSeries$,seriesLabels$:e.seriesLabels$,seriesContainerPosition$:e.seriesContainerPosition$}),o=[];return i.pipe(k(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,l,u)=>{const c=H(u[l]),f=e.visibleComputedLayoutData$.pipe(k(r),B(p=>JSON.parse(JSON.stringify(p[l]??p[0])))),h=e.seriesContainerPosition$.pipe(k(r),B(p=>JSON.parse(JSON.stringify(p[l]??p[0]))));o[l]=FN(Di,{containerSelection:c,visibleComputedLayoutData$:e.visibleComputedLayoutData$,containerVisibleComputedLayoutData$:f,fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,textSizePx$:e.textSizePx$,seriesHighlight$:e.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),c$="SeriesLegend",zN=vn({name:c$,defaultParams:i$,layerIndex:na,validator:(t,{validateColumns:e})=>e(t,{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:t,rootSelection:e,observer:n,subject:r})=>{const i=new tt,o=n.SeriesDataMap$.pipe(k(i),B(l=>Array.from(l.keys()))),a=n.fullParams$.pipe(k(i),B(l=>{const u=[{listRectWidth:l.listRectWidth,listRectHeight:l.listRectHeight,listRectRadius:l.listRectRadius}];return{...l,labelList:u}})),s=ia(c$,{rootSelection:e,legendLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),f$="SeriesTooltip",GN=vn({name:f$,defaultParams:Lp,layerIndex:ra,validator:(t,{validateColumns:e})=>e(t,{backgroundColorType:{toBeOption:"ColorType"},backgroundOpacity:{toBeTypes:["number"]},strokeColorType:{toBeOption:"ColorType"},offset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},padding:{toBeTypes:["number"]},textColorType:{toBeOption:"ColorType"},renderFn:{toBeTypes:["Function"]}})})(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new tt,a=oa(f$,{rootSelection:e,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),Np={paddingInner:2,paddingOuter:2,labelColorType:"primary",squarifyRatio:1.618034,sort:(t,e)=>e.value-t.value};Np.sort.toString=()=>"(a, b) => b.value - a.value";const h$={placement:"bottom",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},Fp={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(t,{styles:e,utils:n})=>{const r=!!t.categoryLabel,i=!!t.datum.label,o=e.textSizePx*.7,a=e.textSizePx/2-o/2,s=r?`<rect width="${o}" height="${o}" x="${a}" y="${a-1}" rx="${o/2}" fill="${t.datum.color}"></rect>
209
- <text x="${e.textSizePx*1.5}" font-size="${e.textSizePx}" dominant-baseline="hanging" fill="${e.textColor}">
210
- <tspan>${t.categoryLabel}</tspan>
211
- </text>`:"",l=i?`<tspan>${t.datum.label}</tspan> `:"",u=`<text font-size="${e.textSizePx}" dominant-baseline="hanging" fill="${e.textColor}">
212
- ${l}<tspan font-weight="bold">${t.datum.value}</tspan>
224
+ }`;const dF="Bubbles",R2=12,gF={name:dF,defaultParams:M2,layerIndex:bt,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,{fillRate:{toBeTypes:["number"]},lineHeight:{toBeTypes:["number"]},lineLengthMin:{toBeTypes:["number"]}});if(r.status==="error")return r}return n}};let Nn;function mF(e,t){return Xs().velocityDecay(t.force.velocityDecay).force("collision",Ws().radius(n=>n.r+t.force.collisionSpacing)).force("charge",Vs().strength(n=>-Math.pow(n.r,2)*t.force.strength)).on("tick",()=>{e.attr("transform",n=>`translate(${n.x},${n.y})`)})}function yF({visibleComputedLayoutData:e,LastBubbleDataMap:t,graphicWidth:n,graphicHeight:r,SeriesContainerPositionMap:i,scaleType:o}){const a=Math.min(n,r)/2,s=e.flat(),l=s.reduce((h,p)=>h+p.value,0),u=kn().domain([0,l]).range([0,a]).exponent(o==="area"?.5:1),c=o==="area"?1:(()=>{const h=a*a*Math.PI;return Math.sqrt(h/Ac(s,p=>Math.PI*Math.pow(u(p.value),2)))})(),f=.9;return s.map(h=>{const p=h,d=t.get(p.id);if(d)p.x=d.x,p.y=d.y;else{const g=i.get(p.seriesLabel);p.x=Math.random()*g.width,p.y=Math.random()*g.height}const m=u(p.value??0)*c*f;return p.r=m,p._originR=m,p})}function bF({selection:e,bubblesData:t,fullParams:n,sumSeries:r}){const i=e.selectAll("g").data(t,a=>a.id).join(a=>{const s=a.append("g").attr("cursor","pointer").attr("font-size",R2).style("fill","#ffffff").attr("text-anchor","middle");return s.append("circle").attr("class","node").attr("cx",0).attr("cy",0).attr("fill",l=>l.color),s.append("text").style("opacity",.8).attr("pointer-events","none"),s},a=>a,a=>a.remove()).attr("transform",a=>`translate(${a.x},${a.y})`),o=r?"seriesLabel":"label";return i.select("circle").transition().duration(200).attr("r",a=>a.r).attr("fill",a=>a.color),i.each((a,s,l)=>{const u=V(l[s]);let c=!0;a[o].length<=n.bubbleLabel.lineLengthMin&&(c=!1),u.call(M$,{text:a[o],radius:a.r*n.bubbleLabel.fillRate,lineHeight:R2*n.bubbleLabel.lineHeight,isBreakAll:c})}),i}function xF(){return hs().on("start",(e,t)=>{e.active||Nn.alpha(1).restart(),t.fx=t.x,t.fy=t.y}).on("drag",(e,t)=>{e.active||Nn.alphaTarget(0),t.fx=e.x,t.fy=e.y}).on("end",(e,t)=>{t.fx=null,t.fy=null})}function vF({fullParams:e,SeriesContainerPositionMap:t}){Nn.force("x",Ny().strength(e.force.strength).x(n=>t.get(n.seriesLabel).centerX)).force("y",Fy().strength(e.force.strength).y(n=>t.get(n.seriesLabel).centerY)),Nn.alpha(1).restart()}function $F({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=V(o[i]);t.includes(r.id)?a.style("opacity",1).transition("highlight").ease(sr).duration(500):a.style("opacity",n.styles.unhighlightedOpacity)})}const _F=Sn(gF)(({selection:e,name:t,observer:n,subject:r})=>{const i=new J;let o=new Map;const a=n.fullDataFormatter$.pipe(R(f=>f.sumSeries),ee()),s=n.fullParams$.pipe(L(i),R(f=>f.arcScaleType),ee()),l=Y({layout:n.layout$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,visibleComputedLayoutData:n.visibleComputedLayoutData$,scaleType:s}).pipe(L(i),G(async f=>f),R(f=>yF({visibleComputedLayoutData:f.visibleComputedLayoutData,LastBubbleDataMap:o,graphicWidth:f.layout.width,graphicHeight:f.layout.height,SeriesContainerPositionMap:f.SeriesContainerPositionMap,scaleType:f.scaleType})),pe(1));l.subscribe(f=>{o=new Map(f.map(h=>[h.id,h]))});const u=n.fullChartParams$.pipe(L(i),R(f=>f.highlightTarget),ee()),c=Y({bubblesData:l,fullParams:n.fullParams$,SeriesContainerPositionMap:n.SeriesContainerPositionMap$,sumSeries:a}).pipe(L(i),G(async f=>f),R(f=>{Nn&&Nn.stop();const h=bF({selection:e,bubblesData:f.bubblesData,fullParams:f.fullParams,sumSeries:f.sumSeries});return Nn=mF(h,f.fullParams),Nn.nodes(f.bubblesData),vF({fullParams:f.fullParams,SeriesContainerPositionMap:f.SeriesContainerPositionMap}),h}));return Y({bubblesSelection:c,computedData:n.computedData$,SeriesDataMap:n.SeriesDataMap$,highlightTarget:u}).pipe(L(i),G(async f=>f)).subscribe(f=>{f.bubblesSelection.on("mouseover",(h,p)=>{r.event$.next({type:"series",eventName:"mouseover",pluginName:t,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("mousemove",(h,p)=>{r.event$.next({type:"series",eventName:"mousemove",pluginName:t,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("mouseout",(h,p)=>{r.event$.next({type:"series",eventName:"mouseout",pluginName:t,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).on("click",(h,p)=>{r.event$.next({type:"series",eventName:"click",pluginName:t,highlightTarget:f.highlightTarget,datum:p,series:f.SeriesDataMap.get(p.seriesLabel),seriesIndex:p.seriesIndex,seriesLabel:p.seriesLabel,event:h,data:f.computedData})}).call(xF())}),Y({bubblesSelection:c,bubblesData:l,highlight:n.seriesHighlight$.pipe(R(f=>f.map(h=>h.id))),fullChartParams:n.fullChartParams$,fullParams:n.fullParams$,sumSeries:a,SeriesContainerPositionMap:n.SeriesContainerPositionMap$}).pipe(L(i),G(async f=>f)).subscribe(f=>{$F({bubblesSelection:f.bubblesSelection,highlightIds:f.highlight,fullChartParams:f.fullChartParams})}),()=>{i.next(void 0)}});function E2({data:e,startAngle:t,endAngle:n}){return bv().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 SF({selection:e,pluginName:t,separateSeries$:n,seriesLabels$:r}){const i=Z(t,"series");return Y({seriesLabels:r,separateSeries:n}).pipe(G(async o=>o),R((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())}),pe(1))}const pa=({selection:e,pluginName:t,separateSeries$:n,seriesLabels$:r,seriesContainerPosition$:i})=>{const o=SF({selection:e,pluginName:t,separateSeries$:n,seriesLabels$:r});return Y({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(G(async a=>a),ee((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})`})}),Y({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(G(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}},Hp="Pie",wF={name:Hp,defaultParams:C2,layerIndex:bt,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 TF({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 jp(a,i.startAngle,i.endAngle,1)}:o=>jp(n,i.startAngle,i.endAngle,o)}function jp(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)=>Me({datum:s.data,colorType:i.strokeColorType,fullChartParams:o})).attr("stroke-width",i.strokeWidth).attr("d",(s,l)=>n(s))}function AF({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=V(s[a]);t.includes(o.data.id)?l.style("opacity",1).transition("highlight").ease(sr).duration(500).attr("d",u=>i(u)):l.style("opacity",n.styles.unhighlightedOpacity).transition("highlight").attr("d",u=>r(u))})}function PF(e,t){const n=new J,r=Z(e,"path");let i=[],o=[];const a=t.seriesContainerPosition$.pipe(L(n),R(h=>h.width<h.height?h.width:h.height),ee()),s=new de(h=>{Y({containerVisibleComputedLayoutData:t.containerVisibleComputedLayoutData$,fullParams:t.fullParams$}).pipe(L(n),G(async p=>p)).subscribe(p=>{const d=E2({data:p.containerVisibleComputedLayoutData,startAngle:p.fullParams.startAngle,endAngle:p.fullParams.endAngle});h.next(d)})}),l=new de(h=>{Y({shorterSideWith:a,fullParams:t.fullParams$}).pipe(L(n),G(async p=>p)).subscribe(p=>{const d=cu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadius,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});h.next(d)})}),u=new de(h=>{Y({shorterSideWith:a,fullParams:t.fullParams$}).pipe(L(n),G(async p=>p)).subscribe(p=>{const d=cu({axisWidth:p.shorterSideWith,innerRadius:p.fullParams.innerRadius,outerRadius:p.fullParams.outerRadiusWhileHighlight,padAngle:p.fullParams.padAngle,cornerRadius:p.fullParams.cornerRadius});h.next(d)})}),c=t.fullChartParams$.pipe(L(n),R(h=>h.highlightTarget),ee()),f=new de(h=>{Y({pieData:s,arc:l,computedData:t.computedData$,fullParams:t.fullParams$,fullChartParams:t.fullChartParams$,highlightTarget:c}).pipe(L(n),G(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=TF({enter:m,exit:g,data:p.pieData,lastTweenData:i,fullParams:p.fullParams});t.containerSelection.transition("graphicMove").duration(p.fullChartParams.transitionDuration).tween("move",(b,v)=>x=>{o=y(x),I2({selection:t.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams})}).on("end",(b,v)=>{o=jp(p.pieData,p.fullParams.startAngle,p.fullParams.endAngle,1);const x=I2({selection:t.containerSelection,data:o,arc:p.arc,pathClassName:r,fullParams:p.fullParams,fullChartParams:p.fullChartParams});h.next(x),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(pe(1));return Y({pathSelection:f,SeriesDataMap:t.SeriesDataMap$,computedData:t.computedData$,highlightTarget:c}).pipe(L(n),G(async h=>h)).subscribe(h=>{h.pathSelection.on("mouseover",(p,d)=>{p.stopPropagation(),t.event$.next({type:"series",eventName:"mouseover",pluginName:e,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("mousemove",(p,d)=>{p.stopPropagation(),t.event$.next({type:"series",eventName:"mousemove",pluginName:e,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("mouseout",(p,d)=>{p.stopPropagation(),t.event$.next({type:"series",eventName:"mouseout",pluginName:e,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})}).on("click",(p,d)=>{p.stopPropagation(),t.event$.next({type:"series",eventName:"click",pluginName:e,highlightTarget:h.highlightTarget,datum:d.data,series:h.SeriesDataMap.get(d.data.seriesLabel),seriesIndex:d.data.seriesIndex,seriesLabel:d.data.seriesLabel,event:p,data:h.computedData})})}),Y({pathSelection:f,highlight:t.seriesHighlight$.pipe(R(h=>h.map(p=>p.id))),fullChartParams:t.fullChartParams$,arc:l,arcHighlight:u}).pipe(L(n),G(async h=>h)).subscribe(h=>{AF({pathSelection:h.pathSelection,ids:h.highlight,fullChartParams:h.fullChartParams,arc:h.arc,arcHighlight:h.arcHighlight})}),()=>{n.next(void 0)}}const DF=Sn(wF)(({selection:e,name:t,subject:n,observer:r})=>{const i=new J,{seriesCenterSelection$:o}=pa({selection:e,pluginName:Hp,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(L(i)).subscribe(s=>{a.forEach(l=>l()),s.each((l,u,c)=>{const f=V(c[u]),h=r.visibleComputedLayoutData$.pipe(L(i),R(d=>d[u]??d[0])),p=r.seriesContainerPosition$.pipe(L(i),R(d=>d[u]??d[0]));a[u]=PF(Hp,{containerSelection:f,computedData$:r.computedData$,containerVisibleComputedLayoutData$:h,SeriesDataMap$:r.SeriesDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,event$:n.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),yu="PieEventTexts",B2=Z(yu,"text"),MF={name:yu,defaultParams:Wp,layerIndex:$p,validator:(e,{validateColumns:t})=>t(e,{renderFn:{toBeTypes:["Function"]},textAttrs:{toBeTypes:["object[]"]},textStyles:{toBeTypes:["object[]"]}})};function qp(e,t){const n=e.selectAll(`text.${B2}`).data(t),r=n.enter().append("text").classed(B2,!0),i=n.merge(r);return i.each((o,a,s)=>{const l=V(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 Zp({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 CF(e,t){const n=new J;let r;const i=t.fullChartParams$.pipe(L(n),R(o=>o.highlightTarget),ee());return Y({computedData:t.computedData$,fullParams:t.fullParams$,fullChartParams:t.fullChartParams$,highlightTarget:i}).pipe(L(n),G(async o=>o)).subscribe(o=>{t.containerSelection.transition("move").duration(o.fullChartParams.transitionDuration).tween("move",(a,s)=>l=>{const u=Zp({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});qp(t.containerSelection,u)}).on("end",(a,s)=>{const l=Zp({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});qp(t.containerSelection,l),r&&r.unsubscribe(),r=t.event$.subscribe(u=>{const c=Zp({eventData:u,renderFn:o.fullParams.renderFn,textAttrs:o.fullParams.textAttrs,textStyles:o.fullParams.textStyles});qp(t.containerSelection,c)})})}),()=>{n.next(void 0)}}const LF=Sn(MF)(({selection:e,name:t,observer:n,subject:r})=>{const i=new J,{seriesCenterSelection$:o}=pa({selection:e,pluginName:yu,separateSeries$:n.separateSeries$,seriesLabels$:n.seriesLabels$,seriesContainerPosition$:n.seriesContainerPosition$}),a=[];return o.pipe(L(i)).subscribe(s=>{a.forEach(l=>l()),s.each((l,u,c)=>{const f=V(c[u]),h=n.computedLayoutData$.pipe(L(i),R(d=>d[u]??d[0])),p=n.seriesContainerPosition$.pipe(L(i),R(d=>d[u]??d[0]));a[u]=CF(yu,{containerSelection:f,computedData$:n.computedData$,containerComputedLayoutData$:h,SeriesDataMap$:n.SeriesDataMap$,fullParams$:n.fullParams$,fullChartParams$:n.fullChartParams$,seriesHighlight$:n.seriesHighlight$,seriesContainerPosition$:p,event$:r.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),zi="PieLabels",kF=Z(zi,"label-g"),RF=Z(zi,"line-g"),EF=Z(zi,"text"),N2=2,IF={name:zi,defaultParams:Xp,layerIndex:$p,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 BF({pieData:e,arc:t,arcMouseover:n,labelCentroid:r,lineStartCentroid:i,fullParams:o}){return e.map((a,s)=>{const[l,u]=t.centroid(a),[c,f]=n.centroid(a),h=o.labelFn(a.data);return{pieDatum:a,arcIndex:s,arcLabels:h.split(`
225
+ `),lineStartX:l*i,lineStartY:u*i,lineStartMouseoverX:c*i,lineStartMouseoverY:f*i,x:l*r,y:u*r,mouseoverX:c*r,mouseoverY:f*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 NF({labelGSelection:e,data:t,fullParams:n,fullChartParams:r,textSizePx:i}){const o=e.selectAll("text").data(t,a=>a.pieDatum.id).join("text").classed(EF,!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)=>Me({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).each((a,s,l)=>{C$(V(l[s]),{textArr:a.arcLabels,textSizePx:i,quadrant:a.quadrant})});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function FF(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,f=s.y+t[a].collisionShiftY,h=u.x+t[l].collisionShiftX,p=u.y+t[l].collisionShiftY;if(!(c+s.width/2<h-u.width/2||c-s.width/2>h+u.width/2||f+s.height/2<p-u.height/2||f-s.height/2>p+u.height/2)){if(t[l].quadrant==2){const d=p>f?-i*2:-i;t[l].collisionShiftY+=d}else if(t[l].quadrant==4){const d=p>f?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,f=s.y+t[a].collisionShiftY,h=u.x+t[l].collisionShiftX,p=u.y+t[l].collisionShiftY;if(!(c+s.width/2<h-u.width/2||c-s.width/2>h+u.width/2||f+s.height/2<p-u.height/2||f-s.height/2>p+u.height/2)){if(t[l].quadrant==1){const d=p>f?-i*2:-i;t[l].collisionShiftY+=d}else if(t[l].quadrant==3){const d=p>f?i:i*2;t[l].collisionShiftY+=d}}}}e.data(t).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function zF({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=>Me({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 OF({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=V(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=V(a[o]);n.includes(i.pieDatum.data.id)?s.style("opacity",1).transition("highlight").duration(200):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function GF(e,t){const n=new J;t.containerSelection.selectAll("g").remove();const r=t.containerSelection.append("g");r.classed(RF,!0);const i=t.containerSelection.append("g");i.classed(kF,!0);const o=new J,a=new J;let s=[];const l=t.seriesContainerPosition$.pipe(L(n),R(c=>c.width<c.height?c.width:c.height),ee()),u=t.fullParams$.pipe(L(n),R(c=>c.labelCentroid>=N2?N2:c.labelCentroid));return Y({shorterSideWith:l,containerVisibleComputedLayoutData:t.containerVisibleComputedLayoutData$,fullParams:t.fullParams$,fullChartParams:t.fullChartParams$,textSizePx:t.textSizePx$,lineStartCentroid:u}).pipe(L(n),G(async c=>c)).subscribe(c=>{const f=cu({axisWidth:c.shorterSideWith,innerRadius:0,outerRadius:c.fullParams.outerRadius,padAngle:0,cornerRadius:0}),h=cu({axisWidth:c.shorterSideWith,innerRadius:0,outerRadius:c.fullParams.outerRadiusWhileHighlight,padAngle:0,cornerRadius:0}),p=E2({data:c.containerVisibleComputedLayoutData,startAngle:c.fullParams.startAngle,endAngle:c.fullParams.endAngle});s=BF({pieData:p,arc:f,arcMouseover:h,labelCentroid:c.fullParams.labelCentroid,lineStartCentroid:c.lineStartCentroid,fullParams:c.fullParams}),r.selectAll("polyline").remove();const d=NF({labelGSelection:i,data:s,fullParams:c.fullParams,fullChartParams:c.fullChartParams,textSizePx:c.textSizePx});setTimeout(()=>{FF(d,s,c.textSizePx);const m=zF({lineGSelection:r,data:s,fullParams:c.fullParams,fullChartParams:c.fullChartParams});a.next(m)},1e3),o.next(d)}),Y({textSelection:o,lineSelection:a,highlight:t.seriesHighlight$.pipe(R(c=>c.map(f=>f.id))),fullChartParams:t.fullChartParams$}).pipe(L(n),G(async c=>c)).subscribe(c=>{OF({textSelection:c.textSelection,lineSelection:c.lineSelection,ids:c.highlight,fullChartParams:c.fullChartParams})}),()=>{n.next(void 0)}}const YF=Sn(IF)(({selection:e,observer:t,subject:n})=>{const r=new J,{seriesCenterSelection$:i}=pa({selection:e,pluginName:zi,separateSeries$:t.separateSeries$,seriesLabels$:t.seriesLabels$,seriesContainerPosition$:t.seriesContainerPosition$}),o=[];return i.pipe(L(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,l,u)=>{const c=V(u[l]),f=t.visibleComputedLayoutData$.pipe(L(r),R(p=>p[l]??p[0])),h=t.seriesContainerPosition$.pipe(L(r),R(p=>p[l]??p[0]));o[l]=GF(zi,{containerSelection:c,containerVisibleComputedLayoutData$:f,fullParams$:t.fullParams$,fullChartParams$:t.fullChartParams$,textSizePx$:t.textSizePx$,seriesHighlight$:t.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),Kp="Rose",WF=Math.PI*2,XF={name:Kp,defaultParams:L2,layerIndex:bt,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 VF({cornerRadius:e,outerRadius:t,axisWidth:n,maxValue:r,arcScaleType:i,fullParams:o}){const a=n/2*t,s=i==="area"?.5:1,l=kn().domain([0,r]).range([0,a]).exponent(s);return u=>{const c=l(u.prevValue),f=l(u.value),h=nn(c,f);return p=>{const d=h(p);return Ql().innerRadius(0).outerRadius(d).padAngle(o.padAngle).padRadius(d).cornerRadius(e)(u)}}}function UF({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=V(s[a]);t.includes(o.data.id)?l.style("opacity",1).transition("highlight").ease(sr).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 HF(e,t){const n=new J,r=Z(e,"path");let i=[];const o=t.seriesContainerPosition$.pipe(L(n),R(p=>p.width<p.height?p.width:p.height),ee()),a=Y({containerVisibleComputedLayoutData:t.containerVisibleComputedLayoutData$,fullParams:t.fullParams$}).pipe(L(n),G(async p=>p),R(p=>{const d=WF/p.containerVisibleComputedLayoutData.length;return p.containerVisibleComputedLayoutData.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(L(n),R(p=>p.highlightTarget),ee()),l=t.visibleComputedLayoutData$.pipe(R(p=>Math.max(...p.flat().map(d=>d.value))),ee()),u=Y({fullParams:t.fullParams$,axisWidth:o,maxValue:l}).pipe(L(n),G(async p=>p),R(p=>VF({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(L(n),R(p=>p.transitionDuration),ee()),f=new Du(!1),h=new de(p=>{Y({pieData:a,tweenArc:u,transitionDuration:c,fullParams:t.fullParams$,fullChartParams:t.fullChartParams$}).pipe(L(n),G(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));f.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)=>Me({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),f.next(!1)}),i=Object.assign([],m)})}).pipe(pe(1));return Y({pathSelection:h,SeriesDataMap:t.SeriesDataMap$,computedData:t.computedData$,highlightTarget:s}).pipe(L(n),G(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})})}),Y({pathSelection:h,highlight:t.seriesHighlight$.pipe(R(p=>p.map(d=>d.id))),fullParams:t.fullParams$,fullChartParams:t.fullChartParams$,tweenArc:u,isTransitionMoving:f}).pipe(L(n),G(async p=>p),Rr(p=>!p.isTransitionMoving)).subscribe(p=>{UF({pathSelection:p.pathSelection,ids:p.highlight,fullParams:p.fullParams,fullChartParams:p.fullChartParams,tweenArc:p.tweenArc})}),()=>{n.next(void 0)}}const jF=Sn(XF)(({selection:e,name:t,subject:n,observer:r})=>{const i=new J,{seriesCenterSelection$:o}=pa({selection:e,pluginName:Kp,separateSeries$:r.separateSeries$,seriesLabels$:r.seriesLabels$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(L(i)).subscribe(s=>{a.forEach(l=>l()),s.each((l,u,c)=>{const f=V(c[u]),h=r.visibleComputedLayoutData$.pipe(L(i),R(d=>JSON.parse(JSON.stringify(d[u]??d[0])))),p=r.seriesContainerPosition$.pipe(L(i),R(d=>JSON.parse(JSON.stringify(d[u]??d[0]))));a[u]=HF(Kp,{containerSelection:f,computedData$:r.computedData$,visibleComputedData$:r.visibleComputedData$,visibleComputedLayoutData$:r.visibleComputedLayoutData$,containerVisibleComputedLayoutData$:h,SeriesDataMap$:r.SeriesDataMap$,fullParams$:r.fullParams$,fullChartParams$:r.fullChartParams$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,event$:n.event$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}),Oi="RoseLabels",qF=Z(Oi,"label-g"),ZF=Z(Oi,"line-g"),KF=Z(Oi,"text"),F2=2,QF={name:Oi,defaultParams:Vp,layerIndex:$p,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 JF({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=kn().domain([0,r]).range([0,l]).exponent(u);return e.map((f,h)=>{const p=c(f.value),d=Ql().innerRadius(0).outerRadius(p).padAngle(0).padRadius(p).cornerRadius(0),[m,g]=d.centroid(f),[y,b]=[m,g],v=s.labelFn(f.data);return{pieDatum:f,arcIndex:h,arcLabels:v.split(`
226
+ `),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(f=>f.pieDatum.data.visible)}function ez({labelGSelection:e,data:t,fullParams:n,fullChartParams:r,textSizePx:i}){const o=e.selectAll("text").data(t,a=>a.pieDatum.id).join("text").classed(KF,!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)=>Me({datum:a.pieDatum.data,colorType:n.labelColorType,fullChartParams:r})).each((a,s,l)=>{C$(V(l[s]),{textArr:a.arcLabels,textSizePx:i,quadrant:a.quadrant})});return o.transition().attr("transform",a=>"translate("+a.x+","+a.y+")"),o}function tz(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,f=s.y+t[a].collisionShiftY,h=u.x+t[l].collisionShiftX,p=u.y+t[l].collisionShiftY;if(!(c+s.width/2<h-u.width/2||c-s.width/2>h+u.width/2||f+s.height/2<p-u.height/2||f-s.height/2>p+u.height/2)){if(t[l].quadrant==2){const d=p>f?-i*2:-i;t[l].collisionShiftY+=d}else if(t[l].quadrant==4){const d=p>f?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,f=s.y+t[a].collisionShiftY,h=u.x+t[l].collisionShiftX,p=u.y+t[l].collisionShiftY;if(!(c+s.width/2<h-u.width/2||c-s.width/2>h+u.width/2||f+s.height/2<p-u.height/2||f-s.height/2>p+u.height/2)){if(t[l].quadrant==1){const d=p>f?-i*2:-i;t[l].collisionShiftY+=d}else if(t[l].quadrant==3){const d=p>f?i:i*2;t[l].collisionShiftY+=d}}}}e.data(t).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function nz({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=>Me({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 rz({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=V(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=V(a[o]);n.includes(i.pieDatum.data.id)?s.style("opacity",1).transition("highlight").duration(200):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200)})}function iz(e,t){const n=new J;t.containerSelection.selectAll("g").remove();const r=t.containerSelection.append("g");r.classed(ZF,!0);const i=t.containerSelection.append("g");i.classed(qF,!0);const o=new J,a=new J;let s=[];const l=t.seriesContainerPosition$.pipe(L(n),R(f=>f.width<f.height?f.width:f.height),ee()),u=t.visibleComputedLayoutData$.pipe(R(f=>Math.max(...f.flat().map(h=>h.value))),ee()),c=t.fullParams$.pipe(L(n),R(f=>f.labelCentroid>=F2?F2:f.labelCentroid));return Y({shorterSideWith:l,containerVisibleComputedLayoutData:t.containerVisibleComputedLayoutData$,maxValue:u,fullParams:t.fullParams$,fullChartParams:t.fullChartParams$,textSizePx:t.textSizePx$,lineStartCentroid:c}).pipe(L(n),G(async f=>f)).subscribe(f=>{const h=Math.PI*2/f.containerVisibleComputedLayoutData.length,p=f.containerVisibleComputedLayoutData.map((m,g)=>({id:m.id,data:m,index:g,value:m.value,startAngle:h*g,endAngle:h*(g+1),padAngle:0}));s=JF({pieData:p,labelCentroid:f.fullParams.labelCentroid,arcScaleType:f.fullParams.arcScaleType,maxValue:f.maxValue,axisWidth:f.shorterSideWith,outerRadius:f.fullParams.outerRadius,lineStartCentroid:f.lineStartCentroid,fullParams:f.fullParams}),r.selectAll("polyline").remove();const d=ez({labelGSelection:i,data:s,fullParams:f.fullParams,fullChartParams:f.fullChartParams,textSizePx:f.textSizePx});setTimeout(()=>{tz(d,s,f.textSizePx);const m=nz({lineGSelection:r,data:s,fullParams:f.fullParams,fullChartParams:f.fullChartParams});a.next(m)},1e3),o.next(d)}),Y({textSelection:o,lineSelection:a,highlight:t.seriesHighlight$.pipe(R(f=>f.map(h=>h.id))),fullChartParams:t.fullChartParams$}).pipe(L(n),G(async f=>f)).subscribe(f=>{rz({textSelection:f.textSelection,lineSelection:f.lineSelection,ids:f.highlight,fullChartParams:f.fullChartParams})}),()=>{n.next(void 0)}}const oz=Sn(QF)(({selection:e,observer:t,subject:n})=>{const r=new J,{seriesCenterSelection$:i}=pa({selection:e,pluginName:Oi,separateSeries$:t.separateSeries$,seriesLabels$:t.seriesLabels$,seriesContainerPosition$:t.seriesContainerPosition$}),o=[];return i.pipe(L(r)).subscribe(a=>{o.forEach(s=>s()),a.each((s,l,u)=>{const c=V(u[l]),f=t.visibleComputedLayoutData$.pipe(L(r),R(p=>JSON.parse(JSON.stringify(p[l]??p[0])))),h=t.seriesContainerPosition$.pipe(L(r),R(p=>JSON.parse(JSON.stringify(p[l]??p[0]))));o[l]=iz(Oi,{containerSelection:c,visibleComputedLayoutData$:t.visibleComputedLayoutData$,containerVisibleComputedLayoutData$:f,fullParams$:t.fullParams$,fullChartParams$:t.fullChartParams$,textSizePx$:t.textSizePx$,seriesHighlight$:t.seriesHighlight$,seriesContainerPosition$:h,event$:n.event$})})}),()=>{r.next(void 0)}}),z2="SeriesLegend",az=Sn({name:z2,defaultParams:k2,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 J,o=n.SeriesDataMap$.pipe(L(i),R(l=>Array.from(l.keys()))),a=n.fullParams$.pipe(L(i),R(l=>{const u=[{listRectWidth:l.listRectWidth,listRectHeight:l.listRectHeight,listRectRadius:l.listRectRadius}];return{...l,labelList:u}})),s=Ei(z2,{rootSelection:t,legendLabels$:o,fullParams$:a,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),s()}}),O2="SeriesTooltip",sz=Sn({name:O2,defaultParams:Up,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 J,a=Bi(O2,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}}),Qp={paddingInner:2,paddingOuter:2,labelColorType:"primary",squarifyRatio:1.618034,sort:(e,t)=>t.value-e.value};Qp.sort.toString=()=>"(a, b) => b.value - a.value";const G2={placement:"right-end",padding:28,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},Jp={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=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>
227
+ <text x="${t.textSizePx*1.5}" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
228
+ <tspan>${e.categoryLabel}</tspan>
229
+ </text>`:"",l=i?`<tspan>${e.datum.label}</tspan> `:"",u=`<text font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
230
+ ${l}<tspan font-weight="bold">${e.datum.value}</tspan>
213
231
  </text>`;return`${s}
214
- <g ${r?`transform="translate(0, ${e.textSizePx*2})"`:""}>
232
+ <g ${r?`transform="translate(0, ${t.textSizePx*2})"`:""}>
215
233
  ${u}
216
- </g>`}};Fp.renderFn.toString=()=>'(eventData, { styles, utils }) => {\n const hasCategoryLabel = eventData.categoryLabel ? true : false\n const hasDatumLabel = eventData.datum.label ? true : false\n const bulletWidth = styles.textSizePx * 0.7\n const offset = (styles.textSizePx / 2) - (bulletWidth / 2)\n const categorySvg = hasCategoryLabel\n ? `<rect width="${bulletWidth}" height="${bulletWidth}" x="${offset}" y="${offset - 1}" rx="${bulletWidth / 2}" fill="${eventData.datum.color}"></rect>\n <text x="${styles.textSizePx * 1.5}" font-size="${styles.textSizePx}" dominant-baseline="hanging" fill="${styles.textColor}">\n <tspan>${eventData.categoryLabel}</tspan>\n </text>`\n : \'\'\n const datumLabelSvg = hasDatumLabel\n ? `<tspan>${eventData.datum.label}</tspan> `\n : \'\'\n const datumSvg = `<text font-size="${styles.textSizePx}" dominant-baseline="hanging" fill="${styles.textColor}">\n ${datumLabelSvg}<tspan font-weight="bold">${eventData.datum.value}</tspan>\n </text>`\n\n return `${categorySvg}\n <g ${hasCategoryLabel ? `transform="translate(0, ${styles.textSizePx * 2})"` : \'\'}>\n ${datumSvg}\n </g>`\n}';const p$="TreeLegend",YN=rc({name:p$,defaultParams:h$,layerIndex:na,validator:(t,{validateColumns:e})=>e(t,{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:t,rootSelection:e,observer:n,subject:r})=>{const i=new tt,o=n.fullParams$.pipe(k(i),B(s=>{const l=[{listRectWidth:s.listRectWidth,listRectHeight:s.listRectHeight,listRectRadius:s.listRectRadius}];return{...s,labelList:l}})),a=ia(p$,{rootSelection:e,legendLabels$:n.categoryLabels$,fullParams$:o,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),a()}}),_r="TreeMap",d$=J(_r,"tree"),g$=J(_r,"tile"),XN={name:_r,defaultParams:Np,layerIndex:Ee,validator:(t,{validateColumns:e})=>e(t,{paddingInner:{toBeTypes:["number"]},paddingOuter:{toBeTypes:["number"]},labelColorType:{toBeOption:"ColorType"},squarifyRatio:{toBeTypes:["number"]},sort:{toBeTypes:["Function"]}})};function VN({selection:t,treeData:e,fullParams:n,fullChartParams:r,textSizePx:i}){const o=i/2,a=i,s=t.selectAll(`g.${d$}`).data(e,l=>l.data.id).join("g").attr("class",d$);return s.attr("transform",l=>!l.x0||!l.y0?null:`translate(${l.x0},${l.y0})`).each((l,u,c)=>{const f=H(c[u]);f.selectAll(`rect.${g$}`).data([l],h=>h.data.id).join("rect").attr("id",h=>h.data.id).attr("class",g$).attr("cursor","pointer").attr("width",h=>h.x1-h.x0).attr("height",h=>h.y1-h.y0).attr("fill",h=>h.data.color).attr("data-name",h=>h.data.label).attr("data-category",h=>h.data.categoryLabel).attr("data-value",h=>h.data.value),f.selectAll("g").data([l]).join("g").each((h,p,d)=>{H(d[p]).selectAll("text").data([h]).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=H(this),b=g.data.label.split(/\s+/).reverse();let v,x=[];const _=y.attr("x");let S=y.attr("y"),A=0,T=y.text(null).append("tspan").attr("cursor","pointer").attr("fill",bt(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",_).attr("y",S);for(;v=b.pop();)x.push(v),T.text(x.join(" ")),T.node().getComputedTextLength()>g.x1-g.x0-o&&(x.pop(),T.text(x.join(" ")),x=[v],A+=a,T=y.append("tspan").attr("cursor","pointer").attr("fill",bt(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",_).attr("y",S).attr("dy",A+"px").text(v))})})}),s}function WN({selection:t,ids:e,fullChartParams:n}){if(t.interrupt("highlight"),!e.length){t.transition("highlight").duration(200).style("opacity",1);return}t.each((r,i,o)=>{e.includes(r.data.id)?H(o[i]).style("opacity",1):H(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const UN=rc(XN)(({selection:t,name:e,subject:n,observer:r})=>{const i=new tt,o=Y({layout:r.layout$,visibleComputedData:r.visibleComputedData$,fullParams:r.fullParams$,fullDataFormatter:r.fullDataFormatter$,fullChartParams:r.fullChartParams$}).pipe(k(i),G(async l=>l),B(l=>{const u=bb().size([l.layout.width,l.layout.height]).paddingInner(l.fullParams.paddingInner).paddingOuter(l.fullParams.paddingOuter).round(!0).tile(wh.ratio(l.fullParams.squarifyRatio)),c=yl(l.visibleComputedData).sum(h=>h.value).sort(l.fullParams.sort);return u(c),c.leaves()})),a=Y({selection:da(t),treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,textSizePx:r.textSizePx$}).pipe(k(i),G(async l=>l),B(l=>VN({selection:t,treeData:l.treeData,fullParams:l.fullParams,fullChartParams:l.fullChartParams,textSizePx:l.textSizePx}))),s=r.fullChartParams$.pipe(k(i),B(l=>l.highlightTarget),Q());return Y({cellSelection:a,computedData:r.computedData$,treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,highlightTarget:s,CategoryDataMap:r.CategoryDataMap$}).pipe(k(i),G(async l=>l)).subscribe(l=>{l.cellSelection.on("mouseover",(u,c)=>{u.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseover",pluginName:_r,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:_r,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:_r,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:_r,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})})}),Y({cellSelection:a,highlight:r.treeHighlight$.pipe(B(l=>l.map(u=>u.id))),fullChartParams:r.fullChartParams$}).pipe(k(i),G(async l=>l)).subscribe(l=>{WN({selection:l.cellSelection,ids:l.highlight,fullChartParams:l.fullChartParams})}),()=>{i.next(void 0)}}),m$="TreeTooltip",HN=rc({name:m$,defaultParams:Fp,layerIndex:ra,validator:(t,{validateColumns:e})=>e(t,{backgroundColorType:{toBeOption:"ColorType"},backgroundOpacity:{toBeTypes:["number"]},strokeColorType:{toBeOption:"ColorType"},offset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},padding:{toBeTypes:["number"]},textColorType:{toBeOption:"ColorType"},renderFn:{toBeTypes:["Function"]}})})(({selection:t,rootSelection:e,name:n,subject:r,observer:i})=>{const o=new tt,a=oa(m$,{rootSelection:e,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}});q.BarStack=pI,q.Bars=oI,q.BarsPN=aI,q.BarsTriangle=$I,q.Bubbles=nN,q.CONTAINER_PLUGIN_PARAMS=jB,q.DEFAULT_BARS_DIVERGING_PARAMS=y$,q.DEFAULT_BARS_PARAMS=la,q.DEFAULT_BARS_TRIANGLE_PARAMS=Yp,q.DEFAULT_BAR_STACK_PARAMS=Gp,q.DEFAULT_BUBBLES_PARAMS=e$,q.DEFAULT_DOTS_PARAMS=zp,q.DEFAULT_GRID_LEGEND_PARAMS=Wp,q.DEFAULT_GRID_TOOLTIP_PARAMS=lu,q.DEFAULT_GRID_ZOOM_PARAMS=Vp,q.DEFAULT_GROUP_AUX_PARAMS=au,q.DEFAULT_GROUP_AXIS_PARAMS=su,q.DEFAULT_LINES_PARAMS=wr,q.DEFAULT_LINE_AREAS_PARAMS=Op,q.DEFAULT_MULTI_BARS_PARAMS=P2,q.DEFAULT_MULTI_BARS_TRIANGLE_PARAMS=M2,q.DEFAULT_MULTI_BAR_STACK_PARAMS=D2,q.DEFAULT_MULTI_DOTS_PARAMS=k2,q.DEFAULT_MULTI_GRID_LEGEND_PARAMS=T2,q.DEFAULT_MULTI_GRID_TOOLTIP_PARAMS=pp,q.DEFAULT_MULTI_GROUP_AXIS_PARAMS=fp,q.DEFAULT_MULTI_LINES_PARAMS=C2,q.DEFAULT_MULTI_LINE_AREAS_PARAMS=L2,q.DEFAULT_MULTI_VALUE_AXIS_PARAMS=eu,q.DEFAULT_MULTI_VALUE_LEGEND_PARAMS=H2,q.DEFAULT_MULTI_VALUE_STACK_AXIS_PARAMS=KI,q.DEFAULT_MULTI_VALUE_TOOLTIP_PARAMS=Ap,q.DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS=hp,q.DEFAULT_OVERLAPPING_VALUE_STACK_AXES_PARAMS=R2,q.DEFAULT_PIE_EVENT_TEXTS_PARAMS=Dp,q.DEFAULT_PIE_LABELS_PARAMS=Mp,q.DEFAULT_PIE_PARAMS=n$,q.DEFAULT_ROSE_LABELS_PARAMS=Cp,q.DEFAULT_ROSE_PARAMS=r$,q.DEFAULT_SCATTER_BUBBLES_PARAMS=q2,q.DEFAULT_SCATTER_PARAMS=j2,q.DEFAULT_SERIES_LEGEND_PARAMS=i$,q.DEFAULT_SERIES_TOOLTIP_PARAMS=Lp,q.DEFAULT_TREE_LEGEND_PARAMS=h$,q.DEFAULT_TREE_MAP_PARAMS=Np,q.DEFAULT_TREE_TOOLTIP_PARAMS=Fp,q.DEFAULT_VALUE_AXIS_PARAMS=ua,q.DEFAULT_VALUE_STACK_AXIS_PARAMS=Xp,q.DEFAULT_X_Y_AUX_PARAMS=nu,q.DEFAULT_X_Y_AXES_PARAMS=ru,q.DEFAULT_X_Y_ZOOM_PARAMS=Z2,q.Dots=AI,q.GridLegend=DI,q.GridTooltip=GI,q.GridZoom=YI,q.GroupAux=ZI,q.GroupAxis=EI,q.LineAreas=QE,q.Lines=WE,q.MultiBarStack=tB,q.MultiBars=JI,q.MultiBarsTriangle=eB,q.MultiDots=iB,q.MultiGridLegend=QI,q.MultiGridTooltip=sB,q.MultiGroupAxis=oB,q.MultiLineAreas=rB,q.MultiLines=nB,q.MultiValueAxis=aB,q.MultiValueLegend=fB,q.MultiValueStackAxis=lB,q.MultiValueTooltip=hB,q.OverlappingValueAxes=uB,q.OverlappingValueStackAxes=cB,q.Pie=lN,q.PieEventTexts=fN,q.PieLabels=_N,q.Rose=DN,q.RoseLabels=ON,q.Scatter=bB,q.ScatterBubbles=SB,q.SeriesLegend=zN,q.SeriesTooltip=GN,q.TOOLTIP_PARAMS=t$,q.TreeLegend=YN,q.TreeMap=UN,q.TreeTooltip=HN,q.ValueAxis=FI,q.ValueStackAxis=OI,q.XYAux=kB,q.XYAxes=UB,q.XYZoom=HB,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
234
+ </g>`}};Jp.renderFn.toString=()=>'(eventData, { styles, utils }) => {\n const hasCategoryLabel = eventData.categoryLabel ? true : false\n const hasDatumLabel = eventData.datum.label ? true : false\n const bulletWidth = styles.textSizePx * 0.7\n const offset = (styles.textSizePx / 2) - (bulletWidth / 2)\n const categorySvg = hasCategoryLabel\n ? `<rect width="${bulletWidth}" height="${bulletWidth}" x="${offset}" y="${offset - 1}" rx="${bulletWidth / 2}" fill="${eventData.datum.color}"></rect>\n <text x="${styles.textSizePx * 1.5}" font-size="${styles.textSizePx}" dominant-baseline="hanging" fill="${styles.textColor}">\n <tspan>${eventData.categoryLabel}</tspan>\n </text>`\n : \'\'\n const datumLabelSvg = hasDatumLabel\n ? `<tspan>${eventData.datum.label}</tspan> `\n : \'\'\n const datumSvg = `<text font-size="${styles.textSizePx}" dominant-baseline="hanging" fill="${styles.textColor}">\n ${datumLabelSvg}<tspan font-weight="bold">${eventData.datum.value}</tspan>\n </text>`\n\n return `${categorySvg}\n <g ${hasCategoryLabel ? `transform="translate(0, ${styles.textSizePx * 2})"` : \'\'}>\n ${datumSvg}\n </g>`\n}';const Y2="TreeLegend",lz=gc({name:Y2,defaultParams:G2,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 J,o=n.fullParams$.pipe(L(i),R(s=>{const l=[{listRectWidth:s.listRectWidth,listRectHeight:s.listRectHeight,listRectRadius:s.listRectRadius}];return{...s,labelList:l}})),a=Ei(Y2,{rootSelection:t,legendLabels$:n.categoryLabels$,fullParams$:o,layout$:n.layout$,fullChartParams$:n.fullChartParams$,textSizePx$:n.textSizePx$});return()=>{i.next(void 0),a()}}),Pr="TreeMap",W2=Z(Pr,"tree"),X2=Z(Pr,"tile"),uz={name:Pr,defaultParams:Qp,layerIndex:bt,validator:(e,{validateColumns:t})=>t(e,{paddingInner:{toBeTypes:["number"]},paddingOuter:{toBeTypes:["number"]},labelColorType:{toBeOption:"ColorType"},squarifyRatio:{toBeTypes:["number"]},sort:{toBeTypes:["Function"]}})};function cz({selection:e,treeData:t,fullParams:n,fullChartParams:r,textSizePx:i}){const o=i/2,a=i,s=e.selectAll(`g.${W2}`).data(t,l=>l.data.id).join("g").attr("class",W2);return s.attr("transform",l=>!l.x0||!l.y0?null:`translate(${l.x0},${l.y0})`).each((l,u,c)=>{const f=V(c[u]);f.selectAll(`rect.${X2}`).data([l],h=>h.data.id).join("rect").attr("id",h=>h.data.id).attr("class",X2).attr("cursor","pointer").attr("width",h=>h.x1-h.x0).attr("height",h=>h.y1-h.y0).attr("fill",h=>h.data.color).attr("data-name",h=>h.data.label).attr("data-category",h=>h.data.categoryLabel).attr("data-value",h=>h.data.value),f.selectAll("g").data([l]).join("g").each((h,p,d)=>{V(d[p]).selectAll("text").data([h]).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=V(this),b=g.data.label.split(/\s+/).reverse();let v,x=[];const _=y.attr("x");let A=y.attr("y"),S=0,P=y.text(null).append("tspan").attr("cursor","pointer").attr("fill",be(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",_).attr("y",A);for(;v=b.pop();)x.push(v),P.text(x.join(" ")),P.node().getComputedTextLength()>g.x1-g.x0-o&&(x.pop(),P.text(x.join(" ")),x=[v],S+=a,P=y.append("tspan").attr("cursor","pointer").attr("fill",be(n.labelColorType,r)).attr("font-size",r.styles.textSize).attr("x",_).attr("y",A).attr("dy",S+"px").text(v))})})}),s}function fz({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)?V(o[i]).style("opacity",1):V(o[i]).style("opacity",n.styles.unhighlightedOpacity)})}const hz=gc(uz)(({selection:e,name:t,subject:n,observer:r})=>{const i=new J,o=Y({layout:r.layout$,visibleComputedData:r.visibleComputedData$,fullParams:r.fullParams$,fullDataFormatter:r.fullDataFormatter$,fullChartParams:r.fullChartParams$}).pipe(L(i),G(async l=>l),R(l=>{const u=Db().size([l.layout.width,l.layout.height]).paddingInner(l.fullParams.paddingInner).paddingOuter(l.fullParams.paddingOuter).round(!0).tile(Nh.ratio(l.fullParams.squarifyRatio)),c=Cl(l.visibleComputedData).sum(h=>h.value).sort(l.fullParams.sort);return u(c),c.leaves()})),a=Y({selection:_a(e),treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,textSizePx:r.textSizePx$}).pipe(L(i),G(async l=>l),R(l=>cz({selection:e,treeData:l.treeData,fullParams:l.fullParams,fullChartParams:l.fullChartParams,textSizePx:l.textSizePx}))),s=r.fullChartParams$.pipe(L(i),R(l=>l.highlightTarget),ee());return Y({cellSelection:a,computedData:r.computedData$,treeData:o,fullParams:r.fullParams$,fullChartParams:r.fullChartParams$,highlightTarget:s,CategoryDataMap:r.CategoryDataMap$}).pipe(L(i),G(async l=>l)).subscribe(l=>{l.cellSelection.on("mouseover",(u,c)=>{u.stopPropagation(),n.event$.next({type:"tree",eventName:"mouseover",pluginName:Pr,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:Pr,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:Pr,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:Pr,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})})}),Y({cellSelection:a,highlight:r.treeHighlight$.pipe(R(l=>l.map(u=>u.id))),fullChartParams:r.fullChartParams$}).pipe(L(i),G(async l=>l)).subscribe(l=>{fz({selection:l.cellSelection,ids:l.highlight,fullChartParams:l.fullChartParams})}),()=>{i.next(void 0)}}),V2="TreeTooltip",pz=gc({name:V2,defaultParams:Jp,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 J,a=Bi(V2,{rootSelection:t,fullParams$:i.fullParams$,fullChartParams$:i.fullChartParams$,layout$:i.layout$,event$:r.event$});return()=>{o.next(void 0),a()}});H.Bars=EI,H.BarsPN=II,H.BarsTriangle=ZI,H.Bubbles=_F,H.CONTAINER_PLUGIN_PARAMS=_N,H.DEFAULT_BARS_DIVERGING_PARAMS=U2,H.DEFAULT_BARS_PARAMS=ga,H.DEFAULT_BARS_TRIANGLE_PARAMS=rd,H.DEFAULT_BUBBLES_PARAMS=M2,H.DEFAULT_DOTS_PARAMS=td,H.DEFAULT_FORCE_DIRECTED_BUBBLES_PARAMS=Fi,H.DEFAULT_FORCE_DIRECTED_PARAMS=Ni,H.DEFAULT_GRID_LEGEND_PARAMS=ad,H.DEFAULT_GRID_TOOLTIP_PARAMS=vu,H.DEFAULT_GRID_ZOOM_PARAMS=od,H.DEFAULT_GROUP_AUX_PARAMS=bu,H.DEFAULT_GROUP_AXIS_PARAMS=xu,H.DEFAULT_LINES_PARAMS=Dr,H.DEFAULT_LINE_AREAS_PARAMS=ed,H.DEFAULT_MULTI_BARS_PARAMS=F$,H.DEFAULT_MULTI_BARS_TRIANGLE_PARAMS=O$,H.DEFAULT_MULTI_DOTS_PARAMS=W$,H.DEFAULT_MULTI_GRID_LEGEND_PARAMS=N$,H.DEFAULT_MULTI_GRID_TOOLTIP_PARAMS=Pp,H.DEFAULT_MULTI_GROUP_AXIS_PARAMS=Tp,H.DEFAULT_MULTI_LINES_PARAMS=G$,H.DEFAULT_MULTI_LINE_AREAS_PARAMS=Y$,H.DEFAULT_MULTI_STACKED_BAR_PARAMS=z$,H.DEFAULT_MULTI_STACKED_VALUE_AXIS_PARAMS=TB,H.DEFAULT_MULTI_VALUE_AXIS_PARAMS=pu,H.DEFAULT_MULTI_VALUE_LEGEND_PARAMS=i2,H.DEFAULT_MULTI_VALUE_TOOLTIP_PARAMS=zp,H.DEFAULT_OVERLAPPING_STACKED_VALUE_AXES_PARAMS=X$,H.DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS=Ap,H.DEFAULT_PIE_EVENT_TEXTS_PARAMS=Wp,H.DEFAULT_PIE_LABELS_PARAMS=Xp,H.DEFAULT_PIE_PARAMS=C2,H.DEFAULT_RELATIONSHIP_LEGEND_PARAMS=h2,H.DEFAULT_RELATIONSHIP_TOOLTIP_PARAMS=Yp,H.DEFAULT_ROSE_LABELS_PARAMS=Vp,H.DEFAULT_ROSE_PARAMS=L2,H.DEFAULT_SCATTER_BUBBLES_PARAMS=a2,H.DEFAULT_SCATTER_PARAMS=o2,H.DEFAULT_SERIES_LEGEND_PARAMS=k2,H.DEFAULT_SERIES_TOOLTIP_PARAMS=Up,H.DEFAULT_STACKED_BAR_PARAMS=nd,H.DEFAULT_STACKED_VALUE_AXIS_PARAMS=id,H.DEFAULT_TREE_LEGEND_PARAMS=G2,H.DEFAULT_TREE_MAP_PARAMS=Qp,H.DEFAULT_TREE_TOOLTIP_PARAMS=Jp,H.DEFAULT_VALUE_AXIS_PARAMS=ma,H.DEFAULT_X_Y_AUX_PARAMS=du,H.DEFAULT_X_Y_AXES_PARAMS=gu,H.DEFAULT_X_Y_ZOOM_PARAMS=s2,H.Dots=eB,H.ForceDirected=XN,H.ForceDirectedBubbles=fF,H.GridLegend=rB,H.GridTooltip=gB,H.GridZoom=mB,H.GroupAux=wB,H.GroupAxis=lB,H.LineAreas=PI,H.Lines=vI,H.MultiBars=PB,H.MultiBarsTriangle=MB,H.MultiDots=kB,H.MultiGridLegend=AB,H.MultiGridTooltip=IB,H.MultiGroupAxis=RB,H.MultiLineAreas=LB,H.MultiLines=CB,H.MultiStackedBar=DB,H.MultiStackedValueAxis=BB,H.MultiValueAxis=EB,H.MultiValueLegend=zB,H.MultiValueTooltip=OB,H.OverlappingStackedValueAxes=FB,H.OverlappingValueAxes=NB,H.Pie=DF,H.PieEventTexts=LF,H.PieLabels=YF,H.RelationshipLegend=hF,H.RelationshipTooltip=pF,H.Rose=jF,H.RoseLabels=oz,H.Scatter=UB,H.ScatterBubbles=QB,H.SeriesLegend=az,H.SeriesTooltip=sz,H.StackedBar=YI,H.StackedValueAxis=pB,H.TOOLTIP_PARAMS=f2,H.TreeLegend=lz,H.TreeMap=hz,H.TreeTooltip=pz,H.ValueAxis=hB,H.XYAux=aN,H.XYAxes=vN,H.XYZoom=$N,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});